summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--Makefile.inc16
-rw-r--r--UPDATING39
-rw-r--r--bin/ps/extern.h2
-rw-r--r--bin/ps/keyword.c7
-rw-r--r--bin/ps/print.c16
-rw-r--r--bin/ps/ps.111
-rw-r--r--bin/sh/TOUR37
-rw-r--r--bin/sh/alias.c3
-rw-r--r--bin/sh/alias.h2
-rw-r--r--bin/sh/arith.h1
-rw-r--r--bin/sh/arith_yacc.c2
-rw-r--r--bin/sh/bltin/bltin.h4
-rw-r--r--bin/sh/builtins.def2
-rw-r--r--bin/sh/cd.c11
-rw-r--r--bin/sh/cd.h2
-rw-r--r--bin/sh/eval.c47
-rw-r--r--bin/sh/eval.h9
-rw-r--r--bin/sh/exec.h2
-rw-r--r--bin/sh/expand.c127
-rw-r--r--bin/sh/expand.h2
-rw-r--r--bin/sh/histedit.c1
-rw-r--r--bin/sh/input.c2
-rw-r--r--bin/sh/jobs.c9
-rw-r--r--bin/sh/jobs.h5
-rw-r--r--bin/sh/main.c19
-rw-r--r--bin/sh/main.h2
-rwxr-xr-xbin/sh/mkbuiltins8
-rw-r--r--bin/sh/mktokens1
-rw-r--r--bin/sh/myhistedit.h2
-rw-r--r--bin/sh/nodetypes4
-rw-r--r--bin/sh/options.c7
-rw-r--r--bin/sh/options.h7
-rw-r--r--bin/sh/parser.c63
-rw-r--r--bin/sh/parser.h1
-rw-r--r--bin/sh/sh.134
-rw-r--r--bin/sh/trap.c1
-rw-r--r--bin/sh/trap.h1
-rw-r--r--bin/sh/var.c24
-rw-r--r--bin/sh/var.h6
-rw-r--r--cddl/compat/opensolaris/include/assert.h9
-rw-r--r--cddl/compat/opensolaris/misc/fsshare.c1
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c16
-rw-r--r--contrib/bind9/CHANGES203
-rw-r--r--contrib/bind9/FAQ.xml2
-rw-r--r--contrib/bind9/Makefile.in2
-rw-r--r--contrib/bind9/README.idnkit2
-rw-r--r--contrib/bind9/RELEASE-NOTES-BIND-9.6.3.html165
-rw-r--r--contrib/bind9/RELEASE-NOTES-BIND-9.6.3.pdfbin48990 -> 0 bytes
-rw-r--r--contrib/bind9/RELEASE-NOTES-BIND-9.6.3.txt118
-rw-r--r--contrib/bind9/acconfig.h2
-rw-r--r--contrib/bind9/bin/Makefile.in2
-rw-r--r--contrib/bind9/bin/check/Makefile.in2
-rw-r--r--contrib/bind9/bin/check/named-checkconf.82
-rw-r--r--contrib/bind9/bin/check/named-checkconf.docbook2
-rw-r--r--contrib/bind9/bin/check/named-checkconf.html2
-rw-r--r--contrib/bind9/bin/check/named-checkzone.82
-rw-r--r--contrib/bind9/bin/check/named-checkzone.docbook2
-rw-r--r--contrib/bind9/bin/check/named-checkzone.html2
-rw-r--r--contrib/bind9/bin/dig/Makefile.in2
-rw-r--r--contrib/bind9/bin/dig/dig.12
-rw-r--r--contrib/bind9/bin/dig/dig.docbook2
-rw-r--r--contrib/bind9/bin/dig/dig.html2
-rw-r--r--contrib/bind9/bin/dig/host.12
-rw-r--r--contrib/bind9/bin/dig/host.docbook2
-rw-r--r--contrib/bind9/bin/dig/host.html2
-rw-r--r--contrib/bind9/bin/dig/include/dig/dig.h2
-rw-r--r--contrib/bind9/bin/dig/nslookup.c2
-rw-r--r--contrib/bind9/bin/dnssec/Makefile.in2
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-dsfromkey.c2
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook2
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-keyfromlabel.82
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c2
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook2
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-keygen.82
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-keygen.c2
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-keygen.docbook2
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-signzone.82
-rw-r--r--contrib/bind9/bin/dnssec/dnssec-signzone.docbook2
-rw-r--r--contrib/bind9/bin/dnssec/dnssectool.c2
-rw-r--r--contrib/bind9/bin/dnssec/dnssectool.h2
-rw-r--r--contrib/bind9/bin/named/Makefile.in2
-rw-r--r--contrib/bind9/bin/named/bind9.xsl2
-rw-r--r--contrib/bind9/bin/named/config.c2
-rw-r--r--contrib/bind9/bin/named/controlconf.c2
-rwxr-xr-xcontrib/bind9/bin/named/convertxsl.pl4
-rw-r--r--contrib/bind9/bin/named/include/named/builtin.h2
-rw-r--r--contrib/bind9/bin/named/include/named/client.h2
-rw-r--r--contrib/bind9/bin/named/include/named/config.h2
-rw-r--r--contrib/bind9/bin/named/include/named/control.h2
-rw-r--r--contrib/bind9/bin/named/include/named/interfacemgr.h2
-rw-r--r--contrib/bind9/bin/named/include/named/listenlist.h2
-rw-r--r--contrib/bind9/bin/named/include/named/log.h2
-rw-r--r--contrib/bind9/bin/named/include/named/logconf.h2
-rw-r--r--contrib/bind9/bin/named/include/named/lwaddr.h2
-rw-r--r--contrib/bind9/bin/named/include/named/lwdclient.h2
-rw-r--r--contrib/bind9/bin/named/include/named/lwresd.h2
-rw-r--r--contrib/bind9/bin/named/include/named/lwsearch.h2
-rw-r--r--contrib/bind9/bin/named/include/named/main.h2
-rw-r--r--contrib/bind9/bin/named/include/named/notify.h2
-rw-r--r--contrib/bind9/bin/named/include/named/ns_smf_globals.h2
-rw-r--r--contrib/bind9/bin/named/include/named/server.h2
-rw-r--r--contrib/bind9/bin/named/include/named/sortlist.h2
-rw-r--r--contrib/bind9/bin/named/include/named/statschannel.h2
-rw-r--r--contrib/bind9/bin/named/include/named/tkeyconf.h2
-rw-r--r--contrib/bind9/bin/named/include/named/tsigconf.h2
-rw-r--r--contrib/bind9/bin/named/include/named/types.h2
-rw-r--r--contrib/bind9/bin/named/include/named/update.h2
-rw-r--r--contrib/bind9/bin/named/include/named/xfrout.h2
-rw-r--r--contrib/bind9/bin/named/include/named/zoneconf.h2
-rw-r--r--contrib/bind9/bin/named/interfacemgr.c2
-rw-r--r--contrib/bind9/bin/named/listenlist.c2
-rw-r--r--contrib/bind9/bin/named/log.c2
-rw-r--r--contrib/bind9/bin/named/logconf.c2
-rw-r--r--contrib/bind9/bin/named/lwaddr.c2
-rw-r--r--contrib/bind9/bin/named/lwdclient.c2
-rw-r--r--contrib/bind9/bin/named/lwderror.c2
-rw-r--r--contrib/bind9/bin/named/lwdgabn.c2
-rw-r--r--contrib/bind9/bin/named/lwdgnba.c2
-rw-r--r--contrib/bind9/bin/named/lwdgrbn.c2
-rw-r--r--contrib/bind9/bin/named/lwdnoop.c2
-rw-r--r--contrib/bind9/bin/named/lwresd.82
-rw-r--r--contrib/bind9/bin/named/lwresd.c2
-rw-r--r--contrib/bind9/bin/named/lwresd.docbook2
-rw-r--r--contrib/bind9/bin/named/lwresd.html2
-rw-r--r--contrib/bind9/bin/named/lwsearch.c2
-rw-r--r--contrib/bind9/bin/named/named.82
-rw-r--r--contrib/bind9/bin/named/named.conf.52
-rw-r--r--contrib/bind9/bin/named/named.conf.docbook2
-rw-r--r--contrib/bind9/bin/named/named.conf.html2
-rw-r--r--contrib/bind9/bin/named/named.docbook2
-rw-r--r--contrib/bind9/bin/named/named.html2
-rw-r--r--contrib/bind9/bin/named/notify.c2
-rw-r--r--contrib/bind9/bin/named/sortlist.c2
-rw-r--r--contrib/bind9/bin/named/statschannel.c2
-rw-r--r--contrib/bind9/bin/named/tkeyconf.c2
-rw-r--r--contrib/bind9/bin/named/tsigconf.c2
-rw-r--r--contrib/bind9/bin/named/unix/Makefile.in2
-rw-r--r--contrib/bind9/bin/named/unix/include/named/os.h2
-rw-r--r--contrib/bind9/bin/named/unix/os.c2
-rw-r--r--contrib/bind9/bin/named/zoneconf.c2
-rw-r--r--contrib/bind9/bin/nsupdate/Makefile.in2
-rw-r--r--contrib/bind9/bin/nsupdate/nsupdate.c4
-rw-r--r--contrib/bind9/bin/rndc/Makefile.in2
-rw-r--r--contrib/bind9/bin/rndc/include/rndc/os.h2
-rw-r--r--contrib/bind9/bin/rndc/rndc-confgen.82
-rw-r--r--contrib/bind9/bin/rndc/rndc-confgen.c2
-rw-r--r--contrib/bind9/bin/rndc/rndc-confgen.docbook2
-rw-r--r--contrib/bind9/bin/rndc/rndc-confgen.html2
-rw-r--r--contrib/bind9/bin/rndc/rndc.82
-rw-r--r--contrib/bind9/bin/rndc/rndc.c2
-rw-r--r--contrib/bind9/bin/rndc/rndc.conf2
-rw-r--r--contrib/bind9/bin/rndc/rndc.conf.52
-rw-r--r--contrib/bind9/bin/rndc/rndc.conf.docbook2
-rw-r--r--contrib/bind9/bin/rndc/rndc.conf.html2
-rw-r--r--contrib/bind9/bin/rndc/rndc.docbook2
-rw-r--r--contrib/bind9/bin/rndc/rndc.html2
-rw-r--r--contrib/bind9/bin/rndc/unix/Makefile.in2
-rw-r--r--contrib/bind9/bin/rndc/unix/os.c2
-rw-r--r--contrib/bind9/bin/rndc/util.c2
-rw-r--r--contrib/bind9/bin/rndc/util.h2
-rw-r--r--contrib/bind9/doc/Makefile.in2
-rw-r--r--contrib/bind9/doc/arm/Bv9ARM.ch01.html2
-rw-r--r--contrib/bind9/doc/arm/Bv9ARM.ch02.html2
-rw-r--r--contrib/bind9/doc/arm/Bv9ARM.ch03.html2
-rw-r--r--contrib/bind9/doc/arm/Bv9ARM.ch04.html2
-rw-r--r--contrib/bind9/doc/arm/Bv9ARM.ch05.html2
-rw-r--r--contrib/bind9/doc/arm/Bv9ARM.ch10.html2
-rw-r--r--contrib/bind9/doc/arm/Makefile.in2
-rw-r--r--contrib/bind9/doc/arm/README-SGML2
-rw-r--r--contrib/bind9/doc/misc/Makefile.in2
-rw-r--r--contrib/bind9/doc/misc/dnssec2
-rw-r--r--contrib/bind9/doc/misc/format-options.pl2
-rw-r--r--contrib/bind9/doc/misc/ipv62
-rw-r--r--contrib/bind9/doc/misc/migration2
-rw-r--r--contrib/bind9/doc/misc/migration-4to92
-rw-r--r--contrib/bind9/doc/misc/rfc-compliance2
-rw-r--r--contrib/bind9/doc/misc/roadmap2
-rw-r--r--contrib/bind9/doc/misc/sdb2
-rwxr-xr-xcontrib/bind9/doc/misc/sort-options.pl2
-rw-r--r--contrib/bind9/isc-config.sh.in2
-rw-r--r--contrib/bind9/lib/Makefile.in2
-rw-r--r--contrib/bind9/lib/bind9/Makefile.in2
-rw-r--r--contrib/bind9/lib/bind9/getaddresses.c2
-rw-r--r--contrib/bind9/lib/bind9/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/bind9/include/bind9/Makefile.in2
-rw-r--r--contrib/bind9/lib/bind9/include/bind9/check.h2
-rw-r--r--contrib/bind9/lib/bind9/include/bind9/getaddresses.h2
-rw-r--r--contrib/bind9/lib/bind9/include/bind9/version.h2
-rw-r--r--contrib/bind9/lib/bind9/version.c2
-rw-r--r--contrib/bind9/lib/dns/acache.c2
-rw-r--r--contrib/bind9/lib/dns/acl.c2
-rw-r--r--contrib/bind9/lib/dns/api2
-rw-r--r--contrib/bind9/lib/dns/byaddr.c2
-rw-r--r--contrib/bind9/lib/dns/cache.c2
-rw-r--r--contrib/bind9/lib/dns/callbacks.c2
-rw-r--r--contrib/bind9/lib/dns/compress.c2
-rw-r--r--contrib/bind9/lib/dns/db.c2
-rw-r--r--contrib/bind9/lib/dns/dbiterator.c2
-rw-r--r--contrib/bind9/lib/dns/dbtable.c2
-rw-r--r--contrib/bind9/lib/dns/diff.c2
-rw-r--r--contrib/bind9/lib/dns/dispatch.c2
-rw-r--r--contrib/bind9/lib/dns/dlz.c2
-rw-r--r--contrib/bind9/lib/dns/dnssec.c2
-rw-r--r--contrib/bind9/lib/dns/ds.c2
-rw-r--r--contrib/bind9/lib/dns/dst_lib.c2
-rw-r--r--contrib/bind9/lib/dns/dst_openssl.h2
-rw-r--r--contrib/bind9/lib/dns/dst_parse.c2
-rw-r--r--contrib/bind9/lib/dns/dst_parse.h2
-rw-r--r--contrib/bind9/lib/dns/dst_result.c2
-rw-r--r--contrib/bind9/lib/dns/forward.c2
-rw-r--r--contrib/bind9/lib/dns/gen-unix.h2
-rw-r--r--contrib/bind9/lib/dns/gen.c2
-rw-r--r--contrib/bind9/lib/dns/gssapi_link.c2
-rw-r--r--contrib/bind9/lib/dns/hmac_link.c2
-rw-r--r--contrib/bind9/lib/dns/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/dns/include/dns/Makefile.in2
-rw-r--r--contrib/bind9/lib/dns/include/dns/acache.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/acl.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/adb.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/bit.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/byaddr.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/cache.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/callbacks.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/cert.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/compress.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/db.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/dbiterator.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/dbtable.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/dispatch.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/dlz.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/dnssec.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/ds.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/fixedname.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/forward.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/iptable.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/journal.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/keyflags.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/keytable.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/keyvalues.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/lib.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/log.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/lookup.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/master.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/masterdump.h5
-rw-r--r--contrib/bind9/lib/dns/include/dns/message.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/nsec.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/nsec3.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/opcode.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/order.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/peer.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/portlist.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rbt.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rcode.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rdata.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rdataclass.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rdatalist.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rdataset.h8
-rw-r--r--contrib/bind9/lib/dns/include/dns/rdatasetiter.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rdataslab.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rdatatype.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/request.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/rootns.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/sdb.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/sdlz.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/secalg.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/secproto.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/soa.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/ssu.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/stats.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/tcpmsg.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/time.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/timer.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/tkey.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/ttl.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/version.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/xfrin.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/zonekey.h2
-rw-r--r--contrib/bind9/lib/dns/include/dns/zt.h2
-rw-r--r--contrib/bind9/lib/dns/include/dst/Makefile.in2
-rw-r--r--contrib/bind9/lib/dns/include/dst/gssapi.h2
-rw-r--r--contrib/bind9/lib/dns/include/dst/lib.h2
-rw-r--r--contrib/bind9/lib/dns/include/dst/result.h2
-rw-r--r--contrib/bind9/lib/dns/iptable.c2
-rw-r--r--contrib/bind9/lib/dns/key.c2
-rw-r--r--contrib/bind9/lib/dns/keytable.c2
-rw-r--r--contrib/bind9/lib/dns/lib.c2
-rw-r--r--contrib/bind9/lib/dns/log.c2
-rw-r--r--contrib/bind9/lib/dns/lookup.c2
-rw-r--r--contrib/bind9/lib/dns/master.c2
-rw-r--r--contrib/bind9/lib/dns/masterdump.c27
-rw-r--r--contrib/bind9/lib/dns/ncache.c4
-rw-r--r--contrib/bind9/lib/dns/nsec.c2
-rw-r--r--contrib/bind9/lib/dns/nsec3.c2
-rw-r--r--contrib/bind9/lib/dns/openssldh_link.c2
-rw-r--r--contrib/bind9/lib/dns/openssldsa_link.c2
-rw-r--r--contrib/bind9/lib/dns/opensslrsa_link.c2
-rw-r--r--contrib/bind9/lib/dns/order.c2
-rw-r--r--contrib/bind9/lib/dns/peer.c2
-rw-r--r--contrib/bind9/lib/dns/portlist.c2
-rw-r--r--contrib/bind9/lib/dns/rbt.c2
-rw-r--r--contrib/bind9/lib/dns/rbtdb.h2
-rw-r--r--contrib/bind9/lib/dns/rbtdb64.c2
-rw-r--r--contrib/bind9/lib/dns/rbtdb64.h2
-rw-r--r--contrib/bind9/lib/dns/rcode.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/any_255/tsig_250.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/any_255/tsig_250.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/ch_3/a_1.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/ch_3/a_1.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/afsdb_18.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/afsdb_18.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/cert_37.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/cert_37.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/cname_5.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/cname_5.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/dlv_32769.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/dlv_32769.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/dname_39.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/dname_39.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/dnskey_48.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/dnskey_48.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/ds_43.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/ds_43.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/gpos_27.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/gpos_27.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/hinfo_13.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/hinfo_13.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/isdn_20.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/isdn_20.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/key_25.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/key_25.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/loc_29.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/loc_29.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mb_7.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mb_7.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/md_3.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/md_3.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mf_4.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mf_4.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mg_8.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mg_8.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/minfo_14.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/minfo_14.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mr_9.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mr_9.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mx_15.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/mx_15.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/ns_2.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/ns_2.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/nsec3_50.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/nsec3_50.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/nsec3param_51.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/nsec3param_51.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/nsec_47.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/null_10.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/null_10.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/nxt_30.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/nxt_30.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/opt_41.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/opt_41.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/proforma.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/proforma.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/ptr_12.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/ptr_12.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/rp_17.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/rp_17.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/rrsig_46.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/rt_21.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/rt_21.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/sig_24.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/sig_24.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/soa_6.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/soa_6.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/spf_99.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/spf_99.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/sshfp_44.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/sshfp_44.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/tkey_249.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/tkey_249.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/txt_16.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/txt_16.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/unspec_103.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/unspec_103.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/x25_19.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/generic/x25_19.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/hs_4/a_1.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/hs_4/a_1.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/a6_38.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/a6_38.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/a_1.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/a_1.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/apl_42.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/apl_42.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/dhcid_49.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/dhcid_49.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/kx_36.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/kx_36.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/naptr_35.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/naptr_35.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/nsap_22.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/nsap_22.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/px_26.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/px_26.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/srv_33.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/srv_33.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/wks_11.c2
-rw-r--r--contrib/bind9/lib/dns/rdata/in_1/wks_11.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/rdatastructpre.h2
-rw-r--r--contrib/bind9/lib/dns/rdata/rdatastructsuf.h2
-rw-r--r--contrib/bind9/lib/dns/rdatalist_p.h2
-rw-r--r--contrib/bind9/lib/dns/rdataset.c22
-rw-r--r--contrib/bind9/lib/dns/rdatasetiter.c2
-rw-r--r--contrib/bind9/lib/dns/request.c2
-rw-r--r--contrib/bind9/lib/dns/soa.c2
-rw-r--r--contrib/bind9/lib/dns/spnego.asn12
-rw-r--r--contrib/bind9/lib/dns/spnego.c2
-rw-r--r--contrib/bind9/lib/dns/spnego.h2
-rw-r--r--contrib/bind9/lib/dns/spnego_asn1.c2
-rwxr-xr-xcontrib/bind9/lib/dns/spnego_asn1.pl4
-rw-r--r--contrib/bind9/lib/dns/ssu.c2
-rw-r--r--contrib/bind9/lib/dns/stats.c2
-rw-r--r--contrib/bind9/lib/dns/tcpmsg.c2
-rw-r--r--contrib/bind9/lib/dns/timer.c2
-rw-r--r--contrib/bind9/lib/dns/ttl.c2
-rw-r--r--contrib/bind9/lib/dns/validator.c33
-rw-r--r--contrib/bind9/lib/dns/version.c2
-rw-r--r--contrib/bind9/lib/dns/xfrin.c2
-rw-r--r--contrib/bind9/lib/dns/zonekey.c2
-rw-r--r--contrib/bind9/lib/dns/zt.c2
-rw-r--r--contrib/bind9/lib/isc/alpha/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/alpha/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/alpha/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/alpha/include/isc/atomic.h2
-rw-r--r--contrib/bind9/lib/isc/assertions.c2
-rw-r--r--contrib/bind9/lib/isc/base32.c2
-rw-r--r--contrib/bind9/lib/isc/base64.c2
-rw-r--r--contrib/bind9/lib/isc/bitstring.c2
-rw-r--r--contrib/bind9/lib/isc/buffer.c2
-rw-r--r--contrib/bind9/lib/isc/bufferlist.c2
-rw-r--r--contrib/bind9/lib/isc/commandline.c2
-rw-r--r--contrib/bind9/lib/isc/error.c2
-rw-r--r--contrib/bind9/lib/isc/event.c2
-rw-r--r--contrib/bind9/lib/isc/fsaccess.c2
-rw-r--r--contrib/bind9/lib/isc/hash.c2
-rw-r--r--contrib/bind9/lib/isc/heap.c2
-rw-r--r--contrib/bind9/lib/isc/hex.c2
-rw-r--r--contrib/bind9/lib/isc/hmacmd5.c2
-rw-r--r--contrib/bind9/lib/isc/hmacsha.c2
-rw-r--r--contrib/bind9/lib/isc/httpd.c2
-rw-r--r--contrib/bind9/lib/isc/ia64/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/ia64/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/ia64/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/ia64/include/isc/atomic.h2
-rw-r--r--contrib/bind9/lib/isc/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/include/isc/app.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/assertions.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/base32.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/base64.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/bitstring.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/boolean.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/buffer.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/bufferlist.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/commandline.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/entropy.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/error.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/event.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/eventclass.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/file.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/formatcheck.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/fsaccess.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/hash.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/heap.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/hex.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/hmacmd5.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/hmacsha.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/httpd.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/interfaceiter.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/ipv6.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/iterated_hash.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/lang.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/lex.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/lfsr.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/lib.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/list.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/log.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/magic.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/md5.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/msgcat.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/msgs.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/mutexblock.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/netaddr.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/netscope.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/ondestroy.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/os.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/parseint.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/portset.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/print.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/quota.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/radix.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/random.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/ratelimiter.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/refcount.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/region.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/resource.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/result.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/resultclass.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/rwlock.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/serial.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/sha1.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/sha2.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/sockaddr.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/socket.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/stats.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/stdio.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/stdlib.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/string.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/symtab.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/taskpool.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/timer.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/types.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/util.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/version.h2
-rw-r--r--contrib/bind9/lib/isc/include/isc/xml.h2
-rw-r--r--contrib/bind9/lib/isc/inet_aton.c2
-rw-r--r--contrib/bind9/lib/isc/inet_ntop.c2
-rw-r--r--contrib/bind9/lib/isc/inet_pton.c2
-rw-r--r--contrib/bind9/lib/isc/iterated_hash.c2
-rw-r--r--contrib/bind9/lib/isc/lex.c2
-rw-r--r--contrib/bind9/lib/isc/lfsr.c2
-rw-r--r--contrib/bind9/lib/isc/lib.c2
-rw-r--r--contrib/bind9/lib/isc/log.c2
-rw-r--r--contrib/bind9/lib/isc/md5.c2
-rw-r--r--contrib/bind9/lib/isc/mips/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/mips/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/mips/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/mips/include/isc/atomic.h2
-rw-r--r--contrib/bind9/lib/isc/mutexblock.c2
-rw-r--r--contrib/bind9/lib/isc/netaddr.c2
-rw-r--r--contrib/bind9/lib/isc/netscope.c2
-rw-r--r--contrib/bind9/lib/isc/nls/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/nls/msgcat.c2
-rw-r--r--contrib/bind9/lib/isc/noatomic/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/noatomic/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/noatomic/include/isc/atomic.h2
-rw-r--r--contrib/bind9/lib/isc/nothreads/condition.c2
-rw-r--r--contrib/bind9/lib/isc/nothreads/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/nothreads/include/isc/condition.h2
-rw-r--r--contrib/bind9/lib/isc/nothreads/include/isc/mutex.h2
-rw-r--r--contrib/bind9/lib/isc/nothreads/include/isc/once.h2
-rw-r--r--contrib/bind9/lib/isc/nothreads/include/isc/thread.h2
-rw-r--r--contrib/bind9/lib/isc/nothreads/mutex.c2
-rw-r--r--contrib/bind9/lib/isc/nothreads/thread.c2
-rw-r--r--contrib/bind9/lib/isc/ondestroy.c2
-rw-r--r--contrib/bind9/lib/isc/parseint.c2
-rw-r--r--contrib/bind9/lib/isc/portset.c2
-rw-r--r--contrib/bind9/lib/isc/powerpc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/powerpc/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/powerpc/include/isc/atomic.h2
-rw-r--r--contrib/bind9/lib/isc/pthreads/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/pthreads/condition.c2
-rw-r--r--contrib/bind9/lib/isc/pthreads/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/pthreads/include/isc/condition.h2
-rw-r--r--contrib/bind9/lib/isc/pthreads/include/isc/mutex.h2
-rw-r--r--contrib/bind9/lib/isc/pthreads/include/isc/once.h2
-rw-r--r--contrib/bind9/lib/isc/pthreads/include/isc/thread.h2
-rw-r--r--contrib/bind9/lib/isc/pthreads/thread.c2
-rw-r--r--contrib/bind9/lib/isc/quota.c2
-rw-r--r--contrib/bind9/lib/isc/radix.c2
-rw-r--r--contrib/bind9/lib/isc/random.c2
-rw-r--r--contrib/bind9/lib/isc/ratelimiter.c2
-rw-r--r--contrib/bind9/lib/isc/refcount.c2
-rw-r--r--contrib/bind9/lib/isc/region.c2
-rw-r--r--contrib/bind9/lib/isc/result.c2
-rw-r--r--contrib/bind9/lib/isc/rwlock.c2
-rw-r--r--contrib/bind9/lib/isc/serial.c2
-rw-r--r--contrib/bind9/lib/isc/sha1.c2
-rw-r--r--contrib/bind9/lib/isc/sha2.c2
-rw-r--r--contrib/bind9/lib/isc/sockaddr.c2
-rw-r--r--contrib/bind9/lib/isc/sparc64/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/sparc64/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/sparc64/include/isc/atomic.h2
-rw-r--r--contrib/bind9/lib/isc/stats.c2
-rw-r--r--contrib/bind9/lib/isc/string.c2
-rw-r--r--contrib/bind9/lib/isc/strtoul.c2
-rw-r--r--contrib/bind9/lib/isc/symtab.c2
-rw-r--r--contrib/bind9/lib/isc/task_p.h2
-rw-r--r--contrib/bind9/lib/isc/taskpool.c2
-rw-r--r--contrib/bind9/lib/isc/timer.c2
-rw-r--r--contrib/bind9/lib/isc/timer_p.h2
-rw-r--r--contrib/bind9/lib/isc/unix/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/unix/app.c2
-rw-r--r--contrib/bind9/lib/isc/unix/dir.c2
-rw-r--r--contrib/bind9/lib/isc/unix/entropy.c2
-rw-r--r--contrib/bind9/lib/isc/unix/errno2result.c2
-rw-r--r--contrib/bind9/lib/isc/unix/errno2result.h2
-rw-r--r--contrib/bind9/lib/isc/unix/file.c2
-rw-r--r--contrib/bind9/lib/isc/unix/fsaccess.c2
-rw-r--r--contrib/bind9/lib/isc/unix/ifiter_getifaddrs.c2
-rw-r--r--contrib/bind9/lib/isc/unix/ifiter_ioctl.c2
-rw-r--r--contrib/bind9/lib/isc/unix/ifiter_sysctl.c2
-rw-r--r--contrib/bind9/lib/isc/unix/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/dir.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/int.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/keyboard.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/net.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/netdb.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/offset.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/stat.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/stdtime.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/strerror.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/syslog.h2
-rw-r--r--contrib/bind9/lib/isc/unix/include/isc/time.h2
-rw-r--r--contrib/bind9/lib/isc/unix/interfaceiter.c2
-rw-r--r--contrib/bind9/lib/isc/unix/ipv6.c2
-rw-r--r--contrib/bind9/lib/isc/unix/keyboard.c2
-rw-r--r--contrib/bind9/lib/isc/unix/net.c2
-rw-r--r--contrib/bind9/lib/isc/unix/os.c2
-rw-r--r--contrib/bind9/lib/isc/unix/resource.c2
-rw-r--r--contrib/bind9/lib/isc/unix/socket_p.h2
-rw-r--r--contrib/bind9/lib/isc/unix/stdio.c2
-rw-r--r--contrib/bind9/lib/isc/unix/stdtime.c2
-rw-r--r--contrib/bind9/lib/isc/unix/strerror.c2
-rw-r--r--contrib/bind9/lib/isc/unix/syslog.c2
-rw-r--r--contrib/bind9/lib/isc/unix/time.c2
-rw-r--r--contrib/bind9/lib/isc/version.c2
-rw-r--r--contrib/bind9/lib/isc/x86_32/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/x86_32/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/x86_32/include/isc/atomic.h2
-rw-r--r--contrib/bind9/lib/isc/x86_64/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/x86_64/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isc/x86_64/include/isc/atomic.h2
-rw-r--r--contrib/bind9/lib/isccc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isccc/alist.c2
-rw-r--r--contrib/bind9/lib/isccc/base64.c2
-rw-r--r--contrib/bind9/lib/isccc/cc.c2
-rw-r--r--contrib/bind9/lib/isccc/ccmsg.c2
-rw-r--r--contrib/bind9/lib/isccc/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/Makefile.in2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/alist.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/base64.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/cc.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/ccmsg.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/events.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/lib.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/result.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/sexpr.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/symtab.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/symtype.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/types.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/util.h2
-rw-r--r--contrib/bind9/lib/isccc/include/isccc/version.h2
-rw-r--r--contrib/bind9/lib/isccc/lib.c2
-rw-r--r--contrib/bind9/lib/isccc/result.c2
-rw-r--r--contrib/bind9/lib/isccc/sexpr.c2
-rw-r--r--contrib/bind9/lib/isccc/symtab.c2
-rw-r--r--contrib/bind9/lib/isccc/version.c2
-rw-r--r--contrib/bind9/lib/isccfg/Makefile.in2
-rw-r--r--contrib/bind9/lib/isccfg/aclconf.c2
-rw-r--r--contrib/bind9/lib/isccfg/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/isccfg/include/isccfg/Makefile.in2
-rw-r--r--contrib/bind9/lib/isccfg/include/isccfg/aclconf.h2
-rw-r--r--contrib/bind9/lib/isccfg/include/isccfg/cfg.h2
-rw-r--r--contrib/bind9/lib/isccfg/include/isccfg/grammar.h2
-rw-r--r--contrib/bind9/lib/isccfg/include/isccfg/log.h2
-rw-r--r--contrib/bind9/lib/isccfg/include/isccfg/namedconf.h2
-rw-r--r--contrib/bind9/lib/isccfg/include/isccfg/version.h2
-rw-r--r--contrib/bind9/lib/isccfg/log.c2
-rw-r--r--contrib/bind9/lib/isccfg/parser.c2
-rw-r--r--contrib/bind9/lib/isccfg/version.c2
-rw-r--r--contrib/bind9/lib/lwres/Makefile.in2
-rw-r--r--contrib/bind9/lib/lwres/assert_p.h2
-rw-r--r--contrib/bind9/lib/lwres/context.c2
-rw-r--r--contrib/bind9/lib/lwres/context_p.h2
-rw-r--r--contrib/bind9/lib/lwres/gai_strerror.c2
-rw-r--r--contrib/bind9/lib/lwres/getaddrinfo.c2
-rw-r--r--contrib/bind9/lib/lwres/gethost.c2
-rw-r--r--contrib/bind9/lib/lwres/getipnode.c2
-rw-r--r--contrib/bind9/lib/lwres/getnameinfo.c2
-rw-r--r--contrib/bind9/lib/lwres/getrrset.c2
-rw-r--r--contrib/bind9/lib/lwres/herror.c2
-rw-r--r--contrib/bind9/lib/lwres/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/Makefile.in2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/context.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/int.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/ipv6.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/lang.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/list.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/lwbuffer.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/lwpacket.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/lwres.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/netdb.h.in2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/platform.h.in2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/result.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/stdlib.h2
-rw-r--r--contrib/bind9/lib/lwres/include/lwres/version.h2
-rw-r--r--contrib/bind9/lib/lwres/lwbuffer.c2
-rw-r--r--contrib/bind9/lib/lwres/lwconfig.c2
-rw-r--r--contrib/bind9/lib/lwres/lwinetaton.c2
-rw-r--r--contrib/bind9/lib/lwres/lwinetntop.c2
-rw-r--r--contrib/bind9/lib/lwres/lwinetpton.c2
-rw-r--r--contrib/bind9/lib/lwres/lwpacket.c2
-rw-r--r--contrib/bind9/lib/lwres/lwres_gabn.c2
-rw-r--r--contrib/bind9/lib/lwres/lwres_gnba.c2
-rw-r--r--contrib/bind9/lib/lwres/lwres_grbn.c2
-rw-r--r--contrib/bind9/lib/lwres/lwres_noop.c2
-rw-r--r--contrib/bind9/lib/lwres/lwresutil.c2
-rw-r--r--contrib/bind9/lib/lwres/man/Makefile.in2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_buffer.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_buffer.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_config.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_config.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_context.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_context.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_gabn.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_gabn.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_gai_strerror.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_getaddrinfo.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_gethostent.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_gethostent.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_getipnode.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_getipnode.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_getnameinfo.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_gnba.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_gnba.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_hstrerror.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_inetntop.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_inetntop.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_noop.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_noop.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_packet.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_packet.docbook2
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_resutil.32
-rw-r--r--contrib/bind9/lib/lwres/man/lwres_resutil.docbook2
-rw-r--r--contrib/bind9/lib/lwres/print.c2
-rw-r--r--contrib/bind9/lib/lwres/strtoul.c2
-rw-r--r--contrib/bind9/lib/lwres/unix/Makefile.in2
-rw-r--r--contrib/bind9/lib/lwres/unix/include/Makefile.in2
-rw-r--r--contrib/bind9/lib/lwres/unix/include/lwres/Makefile.in2
-rw-r--r--contrib/bind9/lib/lwres/unix/include/lwres/net.h2
-rw-r--r--contrib/bind9/lib/lwres/version.c2
-rw-r--r--contrib/bind9/make/Makefile.in2
-rw-r--r--contrib/bind9/make/includes.in2
-rw-r--r--contrib/bind9/make/rules.in2
-rwxr-xr-xcontrib/bind9/mkinstalldirs2
-rw-r--r--contrib/bind9/version8
-rw-r--r--contrib/binutils/bfd/coffcode.h2
-rw-r--r--contrib/binutils/bfd/opncls.c2
-rw-r--r--contrib/binutils/bfd/peicode.h2
-rw-r--r--contrib/binutils/gas/config/obj-elf.c2
-rw-r--r--contrib/binutils/gas/frags.c2
-rw-r--r--contrib/binutils/gas/subsegs.c4
-rw-r--r--contrib/binutils/ld/emulparams/elf64bmip-defs.sh10
-rw-r--r--contrib/binutils/ld/ldexp.c6
-rw-r--r--contrib/binutils/ld/sysdep.h3
-rw-r--r--contrib/binutils/opcodes/i386-dis.c24
-rw-r--r--contrib/compiler-rt/CREDITS.TXT3
-rw-r--r--contrib/compiler-rt/LICENSE.TXT53
-rw-r--r--contrib/compiler-rt/README.txt8
-rw-r--r--contrib/compiler-rt/lib/abi.h23
-rw-r--r--contrib/compiler-rt/lib/absvdi2.c7
-rw-r--r--contrib/compiler-rt/lib/absvsi2.c9
-rw-r--r--contrib/compiler-rt/lib/absvti2.c4
-rw-r--r--contrib/compiler-rt/lib/adddf3.c22
-rw-r--r--contrib/compiler-rt/lib/addsf3.c29
-rw-r--r--contrib/compiler-rt/lib/addvdi3.c7
-rw-r--r--contrib/compiler-rt/lib/addvsi3.c7
-rw-r--r--contrib/compiler-rt/lib/addvti3.c4
-rw-r--r--contrib/compiler-rt/lib/apple_versioning.c145
-rw-r--r--contrib/compiler-rt/lib/arm/adddf3vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/addsf3vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/bswapdi2.S4
-rw-r--r--contrib/compiler-rt/lib/arm/bswapsi2.S4
-rw-r--r--contrib/compiler-rt/lib/arm/comparesf2.S4
-rw-r--r--contrib/compiler-rt/lib/arm/divdf3vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/divmodsi4.S47
-rw-r--r--contrib/compiler-rt/lib/arm/divsf3vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/divsi3.S41
-rw-r--r--contrib/compiler-rt/lib/arm/eqdf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/eqsf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/extendsfdf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/fixdfsivfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/fixsfsivfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/fixunsdfsivfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/fixunssfsivfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/floatsidfvfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/floatsisfvfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/floatunssidfvfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/floatunssisfvfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/gedf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/gesf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/gtdf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/gtsf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/ledf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/lesf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/ltdf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/ltsf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/modsi3.S67
-rw-r--r--contrib/compiler-rt/lib/arm/muldf3vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/mulsf3vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/nedf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/negdf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/negsf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/nesf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S4
-rw-r--r--contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S4
-rw-r--r--contrib/compiler-rt/lib/arm/softfloat-alias.list21
-rw-r--r--contrib/compiler-rt/lib/arm/subdf3vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/subsf3vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/switch16.S4
-rw-r--r--contrib/compiler-rt/lib/arm/switch32.S4
-rw-r--r--contrib/compiler-rt/lib/arm/switch8.S4
-rw-r--r--contrib/compiler-rt/lib/arm/switchu8.S4
-rw-r--r--contrib/compiler-rt/lib/arm/sync_synchronize.S4
-rw-r--r--contrib/compiler-rt/lib/arm/truncdfsf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/udivmodsi4.S80
-rw-r--r--contrib/compiler-rt/lib/arm/udivsi3.S80
-rw-r--r--contrib/compiler-rt/lib/arm/umodsi3.S58
-rw-r--r--contrib/compiler-rt/lib/arm/unorddf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/arm/unordsf2vfp.S4
-rw-r--r--contrib/compiler-rt/lib/ashldi3.c9
-rw-r--r--contrib/compiler-rt/lib/ashlti3.c4
-rw-r--r--contrib/compiler-rt/lib/ashrdi3.c9
-rw-r--r--contrib/compiler-rt/lib/ashrti3.c4
-rw-r--r--contrib/compiler-rt/lib/assembly.h47
-rw-r--r--contrib/compiler-rt/lib/clear_cache.c4
-rw-r--r--contrib/compiler-rt/lib/clzdi2.c9
-rw-r--r--contrib/compiler-rt/lib/clzsi2.c9
-rw-r--r--contrib/compiler-rt/lib/clzti2.c4
-rw-r--r--contrib/compiler-rt/lib/cmpdi2.c11
-rw-r--r--contrib/compiler-rt/lib/cmpti2.c4
-rw-r--r--contrib/compiler-rt/lib/comparedf2.c4
-rw-r--r--contrib/compiler-rt/lib/comparesf2.c4
-rw-r--r--contrib/compiler-rt/lib/ctzdi2.c7
-rw-r--r--contrib/compiler-rt/lib/ctzsi2.c7
-rw-r--r--contrib/compiler-rt/lib/ctzti2.c4
-rw-r--r--contrib/compiler-rt/lib/divdc3.c4
-rw-r--r--contrib/compiler-rt/lib/divdf3.c7
-rw-r--r--contrib/compiler-rt/lib/divdi3.c9
-rw-r--r--contrib/compiler-rt/lib/divmoddi4.c30
-rw-r--r--contrib/compiler-rt/lib/divmodsi4.c31
-rw-r--r--contrib/compiler-rt/lib/divsc3.c4
-rw-r--r--contrib/compiler-rt/lib/divsf3.c7
-rw-r--r--contrib/compiler-rt/lib/divsi3.c11
-rw-r--r--contrib/compiler-rt/lib/divti3.c4
-rw-r--r--contrib/compiler-rt/lib/divxc3.c4
-rw-r--r--contrib/compiler-rt/lib/enable_execute_stack.c4
-rw-r--r--contrib/compiler-rt/lib/endianness.h4
-rw-r--r--contrib/compiler-rt/lib/eprintf.c4
-rw-r--r--contrib/compiler-rt/lib/extendsfdf2.c8
-rw-r--r--contrib/compiler-rt/lib/ffsdi2.c7
-rw-r--r--contrib/compiler-rt/lib/ffsti2.c4
-rw-r--r--contrib/compiler-rt/lib/fixdfdi.c7
-rw-r--r--contrib/compiler-rt/lib/fixdfsi.c9
-rw-r--r--contrib/compiler-rt/lib/fixdfti.c4
-rw-r--r--contrib/compiler-rt/lib/fixsfdi.c9
-rw-r--r--contrib/compiler-rt/lib/fixsfsi.c11
-rw-r--r--contrib/compiler-rt/lib/fixsfti.c4
-rw-r--r--contrib/compiler-rt/lib/fixunsdfdi.c9
-rw-r--r--contrib/compiler-rt/lib/fixunsdfsi.c9
-rw-r--r--contrib/compiler-rt/lib/fixunsdfti.c4
-rw-r--r--contrib/compiler-rt/lib/fixunssfdi.c10
-rw-r--r--contrib/compiler-rt/lib/fixunssfsi.c9
-rw-r--r--contrib/compiler-rt/lib/fixunssfti.c4
-rw-r--r--contrib/compiler-rt/lib/fixunsxfdi.c4
-rw-r--r--contrib/compiler-rt/lib/fixunsxfsi.c4
-rw-r--r--contrib/compiler-rt/lib/fixunsxfti.c4
-rw-r--r--contrib/compiler-rt/lib/fixxfdi.c4
-rw-r--r--contrib/compiler-rt/lib/fixxfti.c4
-rw-r--r--contrib/compiler-rt/lib/floatdidf.c11
-rw-r--r--contrib/compiler-rt/lib/floatdisf.c12
-rw-r--r--contrib/compiler-rt/lib/floatdixf.c4
-rw-r--r--contrib/compiler-rt/lib/floatsidf.c9
-rw-r--r--contrib/compiler-rt/lib/floatsisf.c9
-rw-r--r--contrib/compiler-rt/lib/floattidf.c4
-rw-r--r--contrib/compiler-rt/lib/floattisf.c4
-rw-r--r--contrib/compiler-rt/lib/floattixf.c4
-rw-r--r--contrib/compiler-rt/lib/floatundidf.c14
-rw-r--r--contrib/compiler-rt/lib/floatundisf.c12
-rw-r--r--contrib/compiler-rt/lib/floatundixf.c4
-rw-r--r--contrib/compiler-rt/lib/floatunsidf.c9
-rw-r--r--contrib/compiler-rt/lib/floatunsisf.c9
-rw-r--r--contrib/compiler-rt/lib/floatuntidf.c4
-rw-r--r--contrib/compiler-rt/lib/floatuntisf.c4
-rw-r--r--contrib/compiler-rt/lib/floatuntixf.c4
-rw-r--r--contrib/compiler-rt/lib/fp_lib.h4
-rw-r--r--contrib/compiler-rt/lib/gcc_personality_v0.c4
-rw-r--r--contrib/compiler-rt/lib/i386/ashldi3.S4
-rw-r--r--contrib/compiler-rt/lib/i386/ashrdi3.S4
-rw-r--r--contrib/compiler-rt/lib/i386/divdi3.S4
-rw-r--r--contrib/compiler-rt/lib/i386/floatdidf.S4
-rw-r--r--contrib/compiler-rt/lib/i386/floatdisf.S4
-rw-r--r--contrib/compiler-rt/lib/i386/floatdixf.S4
-rw-r--r--contrib/compiler-rt/lib/i386/floatundidf.S4
-rw-r--r--contrib/compiler-rt/lib/i386/floatundisf.S4
-rw-r--r--contrib/compiler-rt/lib/i386/floatundixf.S4
-rw-r--r--contrib/compiler-rt/lib/i386/lshrdi3.S4
-rw-r--r--contrib/compiler-rt/lib/i386/moddi3.S4
-rw-r--r--contrib/compiler-rt/lib/i386/muldi3.S4
-rw-r--r--contrib/compiler-rt/lib/i386/udivdi3.S4
-rw-r--r--contrib/compiler-rt/lib/i386/umoddi3.S4
-rw-r--r--contrib/compiler-rt/lib/int_lib.h5
-rw-r--r--contrib/compiler-rt/lib/lshrdi3.c9
-rw-r--r--contrib/compiler-rt/lib/lshrti3.c4
-rw-r--r--contrib/compiler-rt/lib/moddi3.c9
-rw-r--r--contrib/compiler-rt/lib/modsi3.c11
-rw-r--r--contrib/compiler-rt/lib/modti3.c4
-rw-r--r--contrib/compiler-rt/lib/muldc3.c4
-rw-r--r--contrib/compiler-rt/lib/muldf3.c10
-rw-r--r--contrib/compiler-rt/lib/muldi3.c11
-rw-r--r--contrib/compiler-rt/lib/mulsc3.c4
-rw-r--r--contrib/compiler-rt/lib/mulsf3.c10
-rw-r--r--contrib/compiler-rt/lib/multi3.c4
-rw-r--r--contrib/compiler-rt/lib/mulvdi3.c4
-rw-r--r--contrib/compiler-rt/lib/mulvsi3.c4
-rw-r--r--contrib/compiler-rt/lib/mulvti3.c4
-rw-r--r--contrib/compiler-rt/lib/mulxc3.c4
-rw-r--r--contrib/compiler-rt/lib/negdf2.c7
-rw-r--r--contrib/compiler-rt/lib/negdi2.c4
-rw-r--r--contrib/compiler-rt/lib/negsf2.c10
-rw-r--r--contrib/compiler-rt/lib/negti2.c4
-rw-r--r--contrib/compiler-rt/lib/negvdi2.c7
-rw-r--r--contrib/compiler-rt/lib/negvsi2.c7
-rw-r--r--contrib/compiler-rt/lib/negvti2.c4
-rw-r--r--contrib/compiler-rt/lib/paritydi2.c9
-rw-r--r--contrib/compiler-rt/lib/paritysi2.c7
-rw-r--r--contrib/compiler-rt/lib/parityti2.c4
-rw-r--r--contrib/compiler-rt/lib/popcountdi2.c7
-rw-r--r--contrib/compiler-rt/lib/popcountsi2.c7
-rw-r--r--contrib/compiler-rt/lib/popcountti2.c4
-rw-r--r--contrib/compiler-rt/lib/powidf2.c7
-rw-r--r--contrib/compiler-rt/lib/powisf2.c7
-rw-r--r--contrib/compiler-rt/lib/powitf2.c4
-rw-r--r--contrib/compiler-rt/lib/powixf2.c4
-rw-r--r--contrib/compiler-rt/lib/ppc/restFP.S4
-rw-r--r--contrib/compiler-rt/lib/ppc/saveFP.S4
-rw-r--r--contrib/compiler-rt/lib/subdf3.c30
-rw-r--r--contrib/compiler-rt/lib/subsf3.c29
-rw-r--r--contrib/compiler-rt/lib/subvdi3.c9
-rw-r--r--contrib/compiler-rt/lib/subvsi3.c9
-rw-r--r--contrib/compiler-rt/lib/subvti3.c4
-rw-r--r--contrib/compiler-rt/lib/trampoline_setup.c4
-rw-r--r--contrib/compiler-rt/lib/truncdfsf2.c11
-rw-r--r--contrib/compiler-rt/lib/ucmpdi2.c7
-rw-r--r--contrib/compiler-rt/lib/ucmpti2.c4
-rw-r--r--contrib/compiler-rt/lib/udivdi3.c9
-rw-r--r--contrib/compiler-rt/lib/udivmoddi4.c9
-rw-r--r--contrib/compiler-rt/lib/udivmodsi4.c31
-rw-r--r--contrib/compiler-rt/lib/udivmodti4.c4
-rw-r--r--contrib/compiler-rt/lib/udivsi3.c9
-rw-r--r--contrib/compiler-rt/lib/udivti3.c4
-rw-r--r--contrib/compiler-rt/lib/umoddi3.c9
-rw-r--r--contrib/compiler-rt/lib/umodsi3.c9
-rw-r--r--contrib/compiler-rt/lib/umodti3.c4
-rw-r--r--contrib/compiler-rt/lib/x86_64/floatundidf.S4
-rw-r--r--contrib/compiler-rt/lib/x86_64/floatundisf.S4
-rw-r--r--contrib/compiler-rt/lib/x86_64/floatundixf.S4
-rw-r--r--contrib/dialog/dialog.h7
-rw-r--r--contrib/gcc/cfg.c2
-rw-r--r--contrib/gcc/output.h3
-rw-r--r--contrib/gcc/rtl.h11
-rw-r--r--contrib/gcc/tree.h13
-rw-r--r--contrib/gdb/gdb/ppcfbsd-tdep.c380
-rw-r--r--contrib/gperf/src/gen-perf.cc2
-rw-r--r--contrib/gperf/src/key-list.cc2
-rw-r--r--contrib/groff/tmac/doc-common12
-rw-r--r--contrib/groff/tmac/doc-syms4
-rw-r--r--contrib/groff/tmac/doc.tmac20
-rw-r--r--contrib/groff/tmac/troffrc8
-rw-r--r--contrib/less/NEWS9
-rw-r--r--contrib/less/README4
-rw-r--r--contrib/less/command.c3
-rw-r--r--contrib/less/funcs.h1
-rw-r--r--contrib/less/less.man4
-rw-r--r--contrib/less/less.nro4
-rw-r--r--contrib/less/lessecho.man2
-rw-r--r--contrib/less/lessecho.nro2
-rw-r--r--contrib/less/lesskey.man2
-rw-r--r--contrib/less/lesskey.nro2
-rw-r--r--contrib/less/optfunc.c28
-rw-r--r--contrib/less/opttbl.c4
-rw-r--r--contrib/less/version.c3
-rw-r--r--contrib/libpcap/pcap-bpf.c1
-rw-r--r--contrib/llvm/include/llvm-c/Core.h3
-rw-r--r--contrib/llvm/include/llvm-c/Disassembler.h71
-rw-r--r--contrib/llvm/include/llvm/ADT/FoldingSet.h9
-rw-r--r--contrib/llvm/include/llvm/ADT/PackedVector.h158
-rw-r--r--contrib/llvm/include/llvm/ADT/StringRef.h31
-rw-r--r--contrib/llvm/include/llvm/ADT/Triple.h2
-rw-r--r--contrib/llvm/include/llvm/Analysis/AliasAnalysis.h27
-rw-r--r--contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h78
-rw-r--r--contrib/llvm/include/llvm/Analysis/CallGraph.h3
-rw-r--r--contrib/llvm/include/llvm/Analysis/DIBuilder.h3
-rw-r--r--contrib/llvm/include/llvm/Analysis/DebugInfo.h22
-rw-r--r--contrib/llvm/include/llvm/Analysis/FindUsedTypes.h6
-rw-r--r--contrib/llvm/include/llvm/Analysis/IVUsers.h16
-rw-r--r--contrib/llvm/include/llvm/Analysis/RegionPass.h2
-rw-r--r--contrib/llvm/include/llvm/Analysis/ScalarEvolution.h10
-rw-r--r--contrib/llvm/include/llvm/Argument.h3
-rw-r--r--contrib/llvm/include/llvm/Attributes.h16
-rw-r--r--contrib/llvm/include/llvm/CodeGen/AsmPrinter.h18
-rw-r--r--contrib/llvm/include/llvm/CodeGen/CallingConvLower.h18
-rw-r--r--contrib/llvm/include/llvm/CodeGen/FastISel.h13
-rw-r--r--contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h8
-rw-r--r--contrib/llvm/include/llvm/CodeGen/LiveInterval.h5
-rw-r--r--contrib/llvm/include/llvm/CodeGen/MachineInstr.h1
-rw-r--r--contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h2
-rw-r--r--contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h31
-rw-r--r--contrib/llvm/include/llvm/CodeGen/MachineOperand.h6
-rw-r--r--contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h2
-rw-r--r--contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h2
-rw-r--r--contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h1
-rw-r--r--contrib/llvm/include/llvm/CodeGen/SelectionDAG.h6
-rw-r--r--contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h12
-rw-r--r--contrib/llvm/include/llvm/CompilerDriver/Common.td7
-rw-r--r--contrib/llvm/include/llvm/DefaultPasses.h167
-rw-r--r--contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h18
-rw-r--r--contrib/llvm/include/llvm/Function.h21
-rw-r--r--contrib/llvm/include/llvm/InitializePasses.h1
-rw-r--r--contrib/llvm/include/llvm/IntrinsicInst.h6
-rw-r--r--contrib/llvm/include/llvm/Intrinsics.td6
-rw-r--r--contrib/llvm/include/llvm/IntrinsicsARM.td47
-rw-r--r--contrib/llvm/include/llvm/IntrinsicsX86.td26
-rw-r--r--contrib/llvm/include/llvm/IntrinsicsXCore.td6
-rw-r--r--contrib/llvm/include/llvm/LinkAllPasses.h2
-rw-r--r--contrib/llvm/include/llvm/MC/MCAsmInfo.h29
-rw-r--r--contrib/llvm/include/llvm/MC/MCDwarf.h7
-rw-r--r--contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h3
-rw-r--r--contrib/llvm/include/llvm/MC/MCExpr.h6
-rw-r--r--contrib/llvm/include/llvm/MC/MCInstPrinter.h4
-rw-r--r--contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h1
-rw-r--r--contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h4
-rw-r--r--contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h2
-rw-r--r--contrib/llvm/include/llvm/MC/MCStreamer.h53
-rw-r--r--contrib/llvm/include/llvm/MC/MCWin64EH.h93
-rw-r--r--contrib/llvm/include/llvm/Metadata.h2
-rw-r--r--contrib/llvm/include/llvm/Operator.h34
-rw-r--r--contrib/llvm/include/llvm/Support/BranchProbability.h50
-rw-r--r--contrib/llvm/include/llvm/Support/Casting.h88
-rw-r--r--contrib/llvm/include/llvm/Support/CrashRecoveryContext.h7
-rw-r--r--contrib/llvm/include/llvm/Support/Dwarf.h1
-rw-r--r--contrib/llvm/include/llvm/Support/IRBuilder.h24
-rw-r--r--contrib/llvm/include/llvm/Support/MemoryBuffer.h2
-rw-r--r--contrib/llvm/include/llvm/Support/PassManagerBuilder.h322
-rw-r--r--contrib/llvm/include/llvm/Support/PatternMatch.h93
-rw-r--r--contrib/llvm/include/llvm/Support/Program.h5
-rw-r--r--contrib/llvm/include/llvm/Support/SourceMgr.h4
-rw-r--r--contrib/llvm/include/llvm/Support/StandardPasses.h244
-rw-r--r--contrib/llvm/include/llvm/Support/Win64EH.h100
-rw-r--r--contrib/llvm/include/llvm/Target/Target.td13
-rw-r--r--contrib/llvm/include/llvm/Target/TargetAsmInfo.h25
-rw-r--r--contrib/llvm/include/llvm/Target/TargetInstrItineraries.h3
-rw-r--r--contrib/llvm/include/llvm/Target/TargetLibraryInfo.h1
-rw-r--r--contrib/llvm/include/llvm/Target/TargetLowering.h295
-rw-r--r--contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h9
-rw-r--r--contrib/llvm/include/llvm/Target/TargetOptions.h4
-rw-r--r--contrib/llvm/include/llvm/Target/TargetRegisterInfo.h35
-rw-r--r--contrib/llvm/include/llvm/Target/TargetSelectionDAG.td1
-rw-r--r--contrib/llvm/include/llvm/Transforms/Instrumentation.h3
-rw-r--r--contrib/llvm/include/llvm/Transforms/Utils/Local.h10
-rw-r--r--contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h7
-rw-r--r--contrib/llvm/include/llvm/Type.h3
-rw-r--r--contrib/llvm/lib/Analysis/Analysis.cpp1
-rw-r--r--contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp143
-rw-r--r--contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp357
-rw-r--r--contrib/llvm/lib/Analysis/ConstantFolding.cpp8
-rw-r--r--contrib/llvm/lib/Analysis/DIBuilder.cpp8
-rw-r--r--contrib/llvm/lib/Analysis/IPA/CallGraph.cpp2
-rw-r--r--contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp4
-rw-r--r--contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp4
-rw-r--r--contrib/llvm/lib/Analysis/IVUsers.cpp33
-rw-r--r--contrib/llvm/lib/Analysis/InlineCost.cpp19
-rw-r--r--contrib/llvm/lib/Analysis/InstructionSimplify.cpp250
-rw-r--r--contrib/llvm/lib/Analysis/LazyValueInfo.cpp10
-rw-r--r--contrib/llvm/lib/Analysis/Loads.cpp4
-rw-r--r--contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp90
-rw-r--r--contrib/llvm/lib/Analysis/RegionPass.cpp2
-rw-r--r--contrib/llvm/lib/Analysis/ScalarEvolution.cpp137
-rw-r--r--contrib/llvm/lib/Analysis/ValueTracking.cpp16
-rw-r--r--contrib/llvm/lib/AsmParser/LLLexer.cpp94
-rw-r--r--contrib/llvm/lib/AsmParser/LLLexer.h3
-rw-r--r--contrib/llvm/lib/AsmParser/LLParser.cpp2
-rw-r--r--contrib/llvm/lib/AsmParser/LLToken.h1
-rw-r--r--contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp13
-rw-r--r--contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp11
-rw-r--r--contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp1
-rw-r--r--contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp16
-rw-r--r--contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h3
-rw-r--r--contrib/llvm/lib/CodeGen/AllocationOrder.cpp61
-rw-r--r--contrib/llvm/lib/CodeGen/AllocationOrder.h25
-rw-r--r--contrib/llvm/lib/CodeGen/AntiDepBreaker.h18
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp4
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp95
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp91
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp15
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp89
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h8
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp442
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h32
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h63
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/DwarfTableException.cpp349
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp116
-rw-r--r--contrib/llvm/lib/CodeGen/BranchFolding.cpp312
-rw-r--r--contrib/llvm/lib/CodeGen/BranchFolding.h7
-rw-r--r--contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp2
-rw-r--r--contrib/llvm/lib/CodeGen/CallingConvLower.cpp22
-rw-r--r--contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp15
-rw-r--r--contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h3
-rw-r--r--contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp73
-rw-r--r--contrib/llvm/lib/CodeGen/IfConversion.cpp4
-rw-r--r--contrib/llvm/lib/CodeGen/InlineSpiller.cpp60
-rw-r--r--contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp10
-rw-r--r--contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp167
-rw-r--r--contrib/llvm/lib/CodeGen/LiveDebugVariables.h7
-rw-r--r--contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp8
-rw-r--r--contrib/llvm/lib/CodeGen/LiveRangeEdit.h7
-rw-r--r--contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp41
-rw-r--r--contrib/llvm/lib/CodeGen/MachineFunction.cpp28
-rw-r--r--contrib/llvm/lib/CodeGen/MachineInstr.cpp33
-rw-r--r--contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp2
-rw-r--r--contrib/llvm/lib/CodeGen/MachineVerifier.cpp17
-rw-r--r--contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp22
-rw-r--r--contrib/llvm/lib/CodeGen/RegAllocBase.h6
-rw-r--r--contrib/llvm/lib/CodeGen/RegAllocBasic.cpp41
-rw-r--r--contrib/llvm/lib/CodeGen/RegAllocFast.cpp30
-rw-r--r--contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp259
-rw-r--r--contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp114
-rw-r--r--contrib/llvm/lib/CodeGen/RegisterClassInfo.h121
-rw-r--r--contrib/llvm/lib/CodeGen/RegisterScavenging.cpp9
-rw-r--r--contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp129
-rw-r--r--contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.h12
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp151
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp120
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp41
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp2
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp167
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp216
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp32
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h52
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp16
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp63
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp9
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp30
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp226
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h8
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp149
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp103
-rw-r--r--contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp339
-rw-r--r--contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h31
-rw-r--r--contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp2
-rw-r--r--contrib/llvm/lib/CodeGen/SplitKit.cpp96
-rw-r--r--contrib/llvm/lib/CodeGen/SplitKit.h40
-rw-r--r--contrib/llvm/lib/CodeGen/TailDuplication.cpp175
-rw-r--r--contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp3
-rw-r--r--contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp53
-rw-r--r--contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp25
-rw-r--r--contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp7
-rw-r--r--contrib/llvm/lib/CodeGen/VirtRegMap.cpp2
-rw-r--r--contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp67
-rw-r--r--contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp29
-rw-r--r--contrib/llvm/lib/ExecutionEngine/JIT/JIT.h13
-rw-r--r--contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp24
-rw-r--r--contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h12
-rw-r--r--contrib/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h12
-rw-r--r--contrib/llvm/lib/ExecutionEngine/MCJIT/TargetSelect.cpp91
-rw-r--r--contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp31
-rw-r--r--contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp (renamed from contrib/llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp)12
-rw-r--r--contrib/llvm/lib/MC/ELFObjectWriter.cpp145
-rw-r--r--contrib/llvm/lib/MC/ELFObjectWriter.h18
-rw-r--r--contrib/llvm/lib/MC/MCAsmInfo.cpp3
-rw-r--r--contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp2
-rw-r--r--contrib/llvm/lib/MC/MCAsmStreamer.cpp196
-rw-r--r--contrib/llvm/lib/MC/MCAssembler.cpp3
-rw-r--r--contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp26
-rw-r--r--contrib/llvm/lib/MC/MCDwarf.cpp240
-rw-r--r--contrib/llvm/lib/MC/MCELF.cpp4
-rw-r--r--contrib/llvm/lib/MC/MCELFStreamer.cpp8
-rw-r--r--contrib/llvm/lib/MC/MCExpr.cpp14
-rw-r--r--contrib/llvm/lib/MC/MCInstPrinter.cpp3
-rw-r--r--contrib/llvm/lib/MC/MCMachOStreamer.cpp3
-rw-r--r--contrib/llvm/lib/MC/MCObjectStreamer.cpp8
-rw-r--r--contrib/llvm/lib/MC/MCParser/AsmLexer.cpp1
-rw-r--r--contrib/llvm/lib/MC/MCParser/AsmParser.cpp202
-rw-r--r--contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp298
-rw-r--r--contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp6
-rw-r--r--contrib/llvm/lib/MC/MCStreamer.cpp212
-rw-r--r--contrib/llvm/lib/MC/MCWin64EH.cpp258
-rw-r--r--contrib/llvm/lib/MC/WinCOFFStreamer.cpp11
-rw-r--r--contrib/llvm/lib/Support/APInt.cpp2
-rw-r--r--contrib/llvm/lib/Support/BranchProbability.cpp44
-rw-r--r--contrib/llvm/lib/Support/Dwarf.cpp1
-rw-r--r--contrib/llvm/lib/Support/FoldingSet.cpp2
-rw-r--r--contrib/llvm/lib/Support/Host.cpp3
-rw-r--r--contrib/llvm/lib/Support/MemoryBuffer.cpp8
-rw-r--r--contrib/llvm/lib/Support/SourceMgr.cpp10
-rw-r--r--contrib/llvm/lib/Support/Unix/Host.inc29
-rw-r--r--contrib/llvm/lib/Support/Unix/Program.inc6
-rw-r--r--contrib/llvm/lib/Support/Windows/Program.inc6
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMAsmBackend.cpp16
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp164
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h4
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp11
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h1
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp11
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMFastISel.cpp134
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMFixupKinds.h2
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp105
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp187
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMISelLowering.h11
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMInstrFormats.td33
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMInstrInfo.td145
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMInstrNEON.td29
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMInstrThumb.td91
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td59
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp15
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp2
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp36
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMPerfectShuffle.h13122
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td43
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp64
-rw-r--r--contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h9
-rw-r--r--contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp35
-rw-r--r--contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp7
-rw-r--r--contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h16
-rw-r--r--contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp4
-rw-r--r--contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h2
-rw-r--r--contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp2
-rw-r--r--contrib/llvm/lib/Target/Alpha/AlphaISelLowering.cpp15
-rw-r--r--contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h3
-rw-r--r--contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp6
-rw-r--r--contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h1
-rw-r--r--contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.td39
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.cpp6
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.h1
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinISelDAGToDAG.cpp4
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp23
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h1
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp2
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp6
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h3
-rw-r--r--contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.td69
-rw-r--r--contrib/llvm/lib/Target/CBackend/CBackend.cpp9
-rw-r--r--contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp29
-rw-r--r--contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h5
-rw-r--r--contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp4
-rw-r--r--contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h1
-rw-r--r--contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.td144
-rw-r--r--contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp29
-rw-r--r--contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h1
-rw-r--r--contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td5
-rw-r--r--contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp4
-rw-r--r--contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h1
-rw-r--r--contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.td30
-rw-r--r--contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp24
-rw-r--r--contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h3
-rw-r--r--contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp11
-rw-r--r--contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h8
-rw-r--r--contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td36
-rw-r--r--contrib/llvm/lib/Target/Mips/Mips.h1
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp68
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp94
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp318
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsFrameLowering.h10
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp71
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp1361
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsISelLowering.h30
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsInstrFPU.td53
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsInstrFormats.td2
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsInstrInfo.h16
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsInstrInfo.td219
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp8
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsMachineFunction.h123
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp115
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h1
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td118
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp11
-rw-r--r--contrib/llvm/lib/Target/Mips/MipsTargetMachine.h2
-rw-r--r--contrib/llvm/lib/Target/PTX/PTX.td7
-rw-r--r--contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp4
-rw-r--r--contrib/llvm/lib/Target/PTX/PTXISelLowering.h3
-rw-r--r--contrib/llvm/lib/Target/PTX/PTXInstrInfo.td12
-rw-r--r--contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h3
-rw-r--r--contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp4
-rw-r--r--contrib/llvm/lib/Target/PTX/PTXSubtarget.h12
-rw-r--r--contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp3
-rw-r--r--contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h1
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPC.h2
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp4
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp11
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp2
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp7
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp55
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h5
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td13
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td3
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp2
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp17
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp21
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h1
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td412
-rw-r--r--contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp27
-rw-r--r--contrib/llvm/lib/Target/Sparc/SparcISelLowering.h3
-rw-r--r--contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp6
-rw-r--r--contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h1
-rw-r--r--contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td48
-rw-r--r--contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp18
-rw-r--r--contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h5
-rw-r--r--contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp20
-rw-r--r--contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h5
-rw-r--r--contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td96
-rw-r--r--contrib/llvm/lib/Target/TargetLibraryInfo.cpp10
-rw-r--r--contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp1
-rw-r--r--contrib/llvm/lib/Target/TargetMachine.cpp6
-rw-r--r--contrib/llvm/lib/Target/TargetRegisterInfo.cpp3
-rw-r--r--contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp5
-rw-r--r--contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h1
-rw-r--r--contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp4
-rw-r--r--contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h1
-rw-r--r--contrib/llvm/lib/Target/X86/X86.td4
-rw-r--r--contrib/llvm/lib/Target/X86/X86FastISel.cpp485
-rw-r--r--contrib/llvm/lib/Target/X86/X86FrameLowering.cpp2
-rw-r--r--contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp169
-rw-r--r--contrib/llvm/lib/Target/X86/X86ISelLowering.cpp347
-rw-r--r--contrib/llvm/lib/Target/X86/X86ISelLowering.h31
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrCompiler.td220
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrExtension.td39
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td3
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrInfo.cpp84
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrInfo.h1
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrInfo.td12
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrMMX.td2
-rw-r--r--contrib/llvm/lib/Target/X86/X86InstrSSE.td153
-rw-r--r--contrib/llvm/lib/Target/X86/X86MCAsmInfo.cpp2
-rw-r--r--contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp3
-rw-r--r--contrib/llvm/lib/Target/X86/X86MCInstLower.cpp4
-rw-r--r--contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp109
-rw-r--r--contrib/llvm/lib/Target/X86/X86RegisterInfo.h4
-rw-r--r--contrib/llvm/lib/Target/X86/X86RegisterInfo.td487
-rw-r--r--contrib/llvm/lib/Target/X86/X86Subtarget.cpp1
-rw-r--r--contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp10
-rw-r--r--contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp35
-rw-r--r--contrib/llvm/lib/Target/XCore/XCoreISelLowering.h6
-rw-r--r--contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td17
-rw-r--r--contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp8
-rw-r--r--contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h1
-rw-r--r--contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td43
-rw-r--r--contrib/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp3
-rw-r--r--contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp20
-rw-r--r--contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp30
-rw-r--r--contrib/llvm/lib/Transforms/IPO/PruneEH.cpp3
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombine.h10
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp84
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp9
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp34
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp18
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp91
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp32
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp122
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp34
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp43
-rw-r--r--contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp91
-rw-r--r--contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp2
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp26
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/GVN.cpp15
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp761
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp9
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/LICM.cpp29
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp115
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp80
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp48
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp45
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/SCCP.cpp2
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp54
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp3
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp9
-rw-r--r--contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp10
-rw-r--r--contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp3
-rw-r--r--contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp6
-rw-r--r--contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp563
-rw-r--r--contrib/llvm/lib/Transforms/Utils/Local.cpp71
-rw-r--r--contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp12
-rw-r--r--contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp26
-rw-r--r--contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp273
-rw-r--r--contrib/llvm/lib/VMCore/Attributes.cpp2
-rw-r--r--contrib/llvm/lib/VMCore/AutoUpgrade.cpp60
-rw-r--r--contrib/llvm/lib/VMCore/DebugInfoProbe.cpp43
-rw-r--r--contrib/llvm/lib/VMCore/Function.cpp39
-rw-r--r--contrib/llvm/lib/VMCore/IRBuilder.cpp31
-rw-r--r--contrib/llvm/lib/VMCore/InlineAsm.cpp5
-rw-r--r--contrib/llvm/lib/VMCore/Instructions.cpp167
-rw-r--r--contrib/llvm/lib/VMCore/PassManager.cpp18
-rw-r--r--contrib/llvm/lib/VMCore/Type.cpp19
-rw-r--r--contrib/llvm/lib/VMCore/Verifier.cpp3
-rw-r--r--contrib/llvm/tools/clang/include/clang-c/Index.h40
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/APValue.h8
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/ASTContext.h56
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h10
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/Decl.h125
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/DeclBase.h11
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h184
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h20
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h75
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/Expr.h66
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h2
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h17
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h57
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/Type.h95
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h47
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def1
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def14
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def1
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td1
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h9
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td6
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td8
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h21
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td22
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td263
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationType.h13
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h8
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h1
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td2
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h9
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def7
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td7
-rw-r--r--contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td13
-rw-r--r--contrib/llvm/tools/clang/include/clang/Driver/Options.td17
-rw-r--r--contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h2
-rw-r--r--contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h26
-rw-r--r--contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h4
-rw-r--r--contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h5
-rw-r--r--contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h20
-rw-r--r--contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def11
-rw-r--r--contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOptions.h5
-rw-r--r--contrib/llvm/tools/clang/include/clang/Frontend/Utils.h3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h46
-rw-r--r--contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h8
-rw-r--r--contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h11
-rw-r--r--contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Parse/Parser.h60
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h5
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h45
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/Initialization.h49
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/Lookup.h16
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/Overload.h3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/Scope.h7
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/Sema.h326
-rw-r--r--contrib/llvm/tools/clang/include/clang/Sema/Template.h3
-rw-r--r--contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h37
-rw-r--r--contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h24
-rw-r--r--contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h23
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h22
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h35
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h9
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h16
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h6
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h1
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h2
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h2
-rw-r--r--contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h17
-rw-r--r--contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h81
-rw-r--r--contrib/llvm/tools/clang/lib/AST/APValue.cpp8
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ASTContext.cpp351
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp8
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp29
-rw-r--r--contrib/llvm/tools/clang/lib/AST/Decl.cpp78
-rw-r--r--contrib/llvm/tools/clang/lib/AST/DeclBase.cpp9
-rw-r--r--contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp323
-rw-r--r--contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp3
-rw-r--r--contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp126
-rw-r--r--contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp31
-rw-r--r--contrib/llvm/tools/clang/lib/AST/DumpXML.cpp10
-rw-r--r--contrib/llvm/tools/clang/lib/AST/Expr.cpp75
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp11
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp616
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp141
-rw-r--r--contrib/llvm/tools/clang/lib/AST/Mangle.cpp5
-rw-r--r--contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp154
-rw-r--r--contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp10
-rw-r--r--contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/AST/Type.cpp116
-rw-r--r--contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp17
-rw-r--r--contrib/llvm/tools/clang/lib/Analysis/AnalysisContext.cpp8
-rw-r--r--contrib/llvm/tools/clang/lib/Analysis/CFG.cpp69
-rw-r--r--contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp1
-rw-r--r--contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp51
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp47
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp185
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/FileManager.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp1
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp73
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/Targets.cpp46
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp75
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp64
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp59
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp24
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp120
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGCall.h9
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp262
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp60
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h2
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp19
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp12
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp188
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp5
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp437
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp11
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp100
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp100
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp99
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp755
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp13
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h7
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp8
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp12
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp183
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp64
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h25
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp189
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h10
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h5
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp14
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp90
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/Driver.cpp31
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/HostInfo.cpp15
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp205
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/ToolChains.h5
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/Tools.cpp242
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/Tools.h14
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp137
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp3
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp69
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/DiagChecker.cpp301
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp52
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp69
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/LogDiagnosticPrinter.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp36
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp51
-rw-r--r--contrib/llvm/tools/clang/lib/Headers/emmintrin.h14
-rw-r--r--contrib/llvm/tools/clang/lib/Headers/mmintrin.h8
-rw-r--r--contrib/llvm/tools/clang/lib/Headers/xmmintrin.h5
-rw-r--r--contrib/llvm/tools/clang/lib/Index/CallGraph.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/Index/Indexer.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp18
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/Lexer.cpp3
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp19
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp1
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp53
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/Pragma.cpp23
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp8
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp5
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp157
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp60
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp487
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp72
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp72
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp8
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp1
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp37
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp8
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp6
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/Parser.cpp155
-rw-r--r--contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp15
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp7
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp1
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp50
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/Sema.cpp154
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp102
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp75
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp45
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp96
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp162
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp474
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp2004
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp287
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp28
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp719
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp238
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp119
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp103
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp211
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp235
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp134
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp688
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp19
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp81
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp162
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp3
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaType.cpp182
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/TreeTransform.h139
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp211
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp40
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp6
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp109
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp399
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp31
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp112
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp2
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicStore.cpp18
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp3
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp251
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp17
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp27
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp34
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FlatStore.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/GRState.cpp16
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ObjCMessage.cpp7
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp26
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp3
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp6
-rw-r--r--contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp13
-rw-r--r--contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.cpp214
-rw-r--r--contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.h107
-rw-r--r--contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp322
-rw-r--r--contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp2
-rw-r--r--contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp2
-rw-r--r--contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp35
-rw-r--r--contrib/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp6
-rw-r--r--contrib/llvm/utils/TableGen/CodeGenIntrinsics.h3
-rw-r--r--contrib/llvm/utils/TableGen/CodeGenRegisters.cpp312
-rw-r--r--contrib/llvm/utils/TableGen/CodeGenRegisters.h72
-rw-r--r--contrib/llvm/utils/TableGen/CodeGenTarget.cpp109
-rw-r--r--contrib/llvm/utils/TableGen/CodeGenTarget.h25
-rw-r--r--contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp62
-rw-r--r--contrib/llvm/utils/TableGen/EDEmitter.cpp2
-rw-r--r--contrib/llvm/utils/TableGen/FastISelEmitter.cpp12
-rw-r--r--contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp170
-rw-r--r--contrib/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp45
-rw-r--r--contrib/llvm/utils/TableGen/NeonEmitter.cpp11
-rw-r--r--contrib/llvm/utils/TableGen/Record.cpp21
-rw-r--r--contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp278
-rw-r--r--contrib/llvm/utils/TableGen/SetTheory.cpp270
-rw-r--r--contrib/llvm/utils/TableGen/SetTheory.h136
-rw-r--r--contrib/llvm/utils/TableGen/TGLexer.cpp5
-rw-r--r--contrib/llvm/utils/TableGen/TGLexer.h7
-rw-r--r--contrib/llvm/utils/TableGen/TGParser.h3
-rw-r--r--contrib/llvm/utils/TableGen/TableGen.cpp113
-rw-r--r--contrib/lukemftp/FreeBSD-patchset64
-rw-r--r--contrib/lukemftp/INSTALL211
-rw-r--r--contrib/lukemftp/Makefile.in33
-rw-r--r--contrib/lukemftp/NEWS84
-rw-r--r--contrib/lukemftp/README61
-rw-r--r--contrib/lukemftp/THANKS30
-rw-r--r--contrib/lukemftp/acconfig.h92
-rw-r--r--contrib/lukemftp/aclocal.m4257
-rw-r--r--contrib/lukemftp/config.h.in275
-rwxr-xr-xcontrib/lukemftp/configure4229
-rw-r--r--contrib/lukemftp/configure.in307
-rw-r--r--contrib/lukemftp/diffout3500
-rwxr-xr-xcontrib/lukemftp/install-sh251
-rw-r--r--contrib/lukemftp/lukemftp.h403
-rw-r--r--contrib/lukemftp/src/Makefile28
-rw-r--r--contrib/lukemftp/src/Makefile.in43
-rw-r--r--contrib/lukemftp/todo25
-rw-r--r--contrib/ntp/ntpd/ntp_io.c9
-rw-r--r--contrib/openbsm/libbsm/audit_submit.32
-rw-r--r--contrib/pf/pfctl/pfctl.88
-rw-r--r--contrib/pf/pfctl/pfctl.c17
-rw-r--r--contrib/pf/pfctl/pfctl_optimize.c2
-rw-r--r--contrib/pf/pfctl/pfctl_parser.c23
-rw-r--r--contrib/pf/pfctl/pfctl_parser.h3
-rw-r--r--contrib/sendmail/CACerts69
-rw-r--r--contrib/sendmail/FREEBSD-upgrade4
-rw-r--r--contrib/sendmail/KNOWNBUGS10
-rw-r--r--contrib/sendmail/LICENSE24
-rw-r--r--contrib/sendmail/PGPKEYS219
-rw-r--r--contrib/sendmail/RELEASE_NOTES66
-rw-r--r--contrib/sendmail/cf/cf/submit.cf13
-rw-r--r--contrib/sendmail/cf/feature/ldap_routing.m436
-rw-r--r--contrib/sendmail/cf/m4/cfhead.m45
-rw-r--r--contrib/sendmail/cf/m4/proto.m48
-rw-r--r--contrib/sendmail/cf/m4/version.m46
-rw-r--r--contrib/sendmail/cf/ostype/solaris11.m422
-rwxr-xr-xcontrib/sendmail/contrib/qtool.pl4
-rw-r--r--contrib/sendmail/doc/op/op.me12
-rw-r--r--contrib/sendmail/include/sm/conf.h22
-rw-r--r--contrib/sendmail/libmilter/docs/overview.html4
-rw-r--r--contrib/sendmail/libmilter/docs/smfi_stop.html4
-rw-r--r--contrib/sendmail/libmilter/docs/xxfi_envrcpt.html7
-rw-r--r--contrib/sendmail/libmilter/engine.c22
-rw-r--r--contrib/sendmail/libmilter/sm_gethost.c14
-rw-r--r--contrib/sendmail/libmilter/worker.c65
-rw-r--r--contrib/sendmail/libsm/ldap.c24
-rw-r--r--contrib/sendmail/makemap/makemap.c4
-rw-r--r--contrib/sendmail/src/Makefile.m42
-rw-r--r--contrib/sendmail/src/conf.c41
-rw-r--r--contrib/sendmail/src/daemon.c14
-rw-r--r--contrib/sendmail/src/deliver.c14
-rw-r--r--contrib/sendmail/src/domain.c25
-rw-r--r--contrib/sendmail/src/envelope.c4
-rw-r--r--contrib/sendmail/src/err.c12
-rw-r--r--contrib/sendmail/src/main.c57
-rw-r--r--contrib/sendmail/src/map.c4
-rw-r--r--contrib/sendmail/src/mci.c31
-rw-r--r--contrib/sendmail/src/parseaddr.c4
-rw-r--r--contrib/sendmail/src/queue.c17
-rw-r--r--contrib/sendmail/src/readcf.c81
-rw-r--r--contrib/sendmail/src/sendmail.88
-rw-r--r--contrib/sendmail/src/sendmail.h112
-rw-r--r--contrib/sendmail/src/sm_resolve.c49
-rw-r--r--contrib/sendmail/src/srvrsmtp.c61
-rw-r--r--contrib/sendmail/src/tls.c10
-rw-r--r--contrib/sendmail/src/udb.c6
-rw-r--r--contrib/sendmail/src/usersmtp.c60
-rw-r--r--contrib/sendmail/src/version.c6
-rw-r--r--contrib/tnftp/COPYING (renamed from contrib/lukemftp/COPYING)42
-rw-r--r--contrib/tnftp/ChangeLog (renamed from contrib/lukemftp/ChangeLog)728
-rw-r--r--contrib/tnftp/INSTALL60
-rw-r--r--contrib/tnftp/Makefile.am13
-rw-r--r--contrib/tnftp/Makefile.in726
-rw-r--r--contrib/tnftp/NEWS36
-rw-r--r--contrib/tnftp/README68
-rw-r--r--contrib/tnftp/THANKS53
-rw-r--r--contrib/tnftp/src/Makefile.am52
-rw-r--r--contrib/tnftp/src/Makefile.in809
-rw-r--r--contrib/tnftp/src/cmds.c (renamed from contrib/lukemftp/src/cmds.c)500
-rw-r--r--contrib/tnftp/src/cmdtab.c (renamed from contrib/lukemftp/src/cmdtab.c)29
-rw-r--r--contrib/tnftp/src/complete.c (renamed from contrib/lukemftp/src/complete.c)76
-rw-r--r--contrib/tnftp/src/domacro.c (renamed from contrib/lukemftp/src/domacro.c)17
-rw-r--r--contrib/tnftp/src/extern.h (renamed from contrib/lukemftp/src/extern.h)45
-rw-r--r--contrib/tnftp/src/fetch.c (renamed from contrib/lukemftp/src/fetch.c)651
-rw-r--r--contrib/tnftp/src/ftp.1 (renamed from contrib/lukemftp/src/ftp.1)357
-rw-r--r--contrib/tnftp/src/ftp.c (renamed from contrib/lukemftp/src/ftp.c)686
-rw-r--r--contrib/tnftp/src/ftp_var.h (renamed from contrib/lukemftp/src/ftp_var.h)60
-rw-r--r--contrib/tnftp/src/main.c (renamed from contrib/lukemftp/src/main.c)232
-rw-r--r--contrib/tnftp/src/progressbar.c (renamed from contrib/lukemftp/src/progressbar.c)103
-rw-r--r--contrib/tnftp/src/progressbar.h (renamed from contrib/lukemftp/src/progressbar.h)23
-rw-r--r--contrib/tnftp/src/ruserpass.c (renamed from contrib/lukemftp/src/ruserpass.c)84
-rw-r--r--contrib/tnftp/src/util.c (renamed from contrib/lukemftp/src/util.c)662
-rw-r--r--contrib/tnftp/src/version.h (renamed from contrib/lukemftp/src/version.h)15
-rw-r--r--contrib/tnftp/tnftp.h495
-rw-r--r--contrib/tnftp/todo25
-rw-r--r--contrib/top/commands.c1
-rw-r--r--contrib/top/display.c12
-rw-r--r--contrib/top/machine.h1
-rw-r--r--contrib/top/top.X22
-rw-r--r--contrib/top/top.c24
-rw-r--r--contrib/top/top.h2
-rw-r--r--etc/defaults/rc.conf12
-rw-r--r--etc/network.subr59
-rwxr-xr-xetc/periodic/daily/800.scrub-zfs2
-rw-r--r--etc/periodic/monthly/Makefile2
-rw-r--r--etc/rc.d/Makefile4
-rwxr-xr-xetc/rc.d/kld53
-rwxr-xr-xetc/rc.d/mountcritremote4
-rwxr-xr-xetc/rc.d/netwait97
-rwxr-xr-xetc/rc.d/nfsclient2
-rwxr-xr-xetc/rc.d/rtadvd8
-rwxr-xr-xetc/rc.d/var2
-rw-r--r--etc/rc.subr34
-rw-r--r--etc/sendmail/freebsd.mc8
-rw-r--r--etc/sendmail/freebsd.submit.mc1
-rw-r--r--games/fortune/datfiles/fortunes8
-rw-r--r--gnu/usr.bin/Makefile6
-rw-r--r--gnu/usr.bin/gdb/kgdb/kthr.c18
-rw-r--r--gnu/usr.bin/grep/Makefile15
-rw-r--r--gnu/usr.bin/groff/tmac/mdoc.local3
-rw-r--r--lib/clang/include/clang/Basic/Version.inc4
-rw-r--r--lib/clang/libclangfrontend/Makefile1
-rw-r--r--lib/clang/libllvmasmprinter/Makefile4
-rw-r--r--lib/clang/libllvmcodegen/Makefile1
-rw-r--r--lib/clang/libllvmmc/Makefile1
-rw-r--r--lib/clang/libllvmmipscodegen/Makefile1
-rw-r--r--lib/libc/db/btree/bt_split.c7
-rw-r--r--lib/libc/db/man/mpool.311
-rw-r--r--lib/libc/gen/basename.351
-rw-r--r--lib/libc/gen/basename.c71
-rw-r--r--lib/libc/gen/feature_present.32
-rw-r--r--lib/libc/gen/ftw.c8
-rw-r--r--lib/libc/gen/posix_spawn.323
-rw-r--r--lib/libc/gen/posix_spawn.c7
-rw-r--r--lib/libc/gen/sysconf.c6
-rw-r--r--lib/libc/iconv/Symbol.map21
-rw-r--r--lib/libc/iconv/citrus_mapper.c2
-rw-r--r--lib/libc/iconv/iconv.c2
-rw-r--r--lib/libc/iconv/iconvctl.36
-rw-r--r--lib/libc/net/sctp_opt_info.335
-rw-r--r--lib/libc/net/sctp_sys_calls.c326
-rw-r--r--lib/libc/sys/wait.213
-rw-r--r--lib/libcompiler_rt/Makefile5
-rw-r--r--lib/libiconv/Makefile1
-rw-r--r--lib/libkvm/kvm_pcpu.c31
-rw-r--r--lib/libmemstat/memstat_uma.c15
-rw-r--r--lib/libprocstat/libprocstat.c30
-rw-r--r--lib/libstand/bswap.c36
-rw-r--r--lib/libstand/net.c2
-rw-r--r--lib/libstand/tftp.c293
-rw-r--r--lib/libstand/zalloc.c6
-rw-r--r--lib/libstand/zalloc_malloc.c2
-rw-r--r--lib/libthr/arch/sparc64/Makefile.inc2
-rw-r--r--lib/libthr/arch/sparc64/include/pthread_md.h23
-rw-r--r--lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S38
-rw-r--r--lib/libthr/arch/sparc64/sparc64/pthread_md.c12
-rw-r--r--lib/libthr/thread/thr_init.c1
-rw-r--r--lib/msun/ld128/e_rem_pio2l.h5
-rw-r--r--lib/msun/ld80/e_rem_pio2l.h7
-rw-r--r--lib/msun/src/e_rem_pio2.c3
-rw-r--r--lib/msun/src/s_cosl.c1
-rw-r--r--lib/msun/src/s_sinl.c1
-rw-r--r--lib/msun/src/s_tanl.c1
-rw-r--r--libexec/comsat/comsat.c2
-rw-r--r--libexec/rtld-elf/Makefile1
-rw-r--r--libexec/rtld-elf/rtld.c8
-rw-r--r--libexec/tftpd/tftp-io.c2
-rw-r--r--libexec/tftpd/tftpd.85
-rw-r--r--release/Makefile9
-rw-r--r--release/doc/en_US.ISO8859-1/relnotes/article.sgml2
-rw-r--r--release/ia64/mkisoimages.sh20
-rw-r--r--release/powerpc/mkisoimages.sh2
-rw-r--r--sbin/camcontrol/camcontrol.c19
-rw-r--r--sbin/ddb/ddb.82
-rw-r--r--sbin/fsck_ffs/suj.c52
-rw-r--r--sbin/geom/class/part/geom_part.c61
-rw-r--r--sbin/geom/class/part/gpart.8249
-rw-r--r--sbin/geom/class/sched/Makefile2
-rw-r--r--sbin/hastd/primary.c4
-rw-r--r--sbin/hastd/secondary.c4
-rw-r--r--sbin/ifconfig/Makefile12
-rw-r--r--sbin/ifconfig/af_inet.c2
-rw-r--r--sbin/ifconfig/af_inet6.c7
-rw-r--r--sbin/ifconfig/af_nd6.c70
-rw-r--r--sbin/ifconfig/ifconfig.810
-rw-r--r--sbin/ifconfig/ifconfig.c29
-rw-r--r--sbin/ipfw/ipfw.830
-rw-r--r--sbin/ipfw/ipfw2.c42
-rw-r--r--sbin/ipfw/ipfw2.h1
-rw-r--r--sbin/ipfw/main.c5
-rw-r--r--sbin/ipfw/nat.c69
-rw-r--r--sbin/mount/mount.813
-rw-r--r--sbin/mount/mount.c16
-rw-r--r--sbin/newfs/newfs.88
-rw-r--r--sbin/newfs/newfs.h4
-rw-r--r--sbin/rcorder/rcorder.88
-rw-r--r--sbin/rtsol/Makefile2
-rw-r--r--sbin/setkey/setkey.85
-rw-r--r--sbin/umount/umount.85
-rw-r--r--sbin/umount/umount.c7
-rw-r--r--share/examples/Makefile1
-rw-r--r--share/examples/etc/make.conf1
-rw-r--r--share/examples/ses/srcs/eltsub.c12
-rw-r--r--share/man/man4/Makefile3
-rw-r--r--share/man/man4/amdsbwd.414
-rw-r--r--share/man/man4/ath.415
-rw-r--r--share/man/man4/ath_ahb.460
-rw-r--r--share/man/man4/ath_hal.414
-rw-r--r--share/man/man4/ath_pci.457
-rw-r--r--share/man/man4/atkbd.47
-rw-r--r--share/man/man4/atrtc.42
-rw-r--r--share/man/man4/attimer.42
-rw-r--r--share/man/man4/bwn.46
-rw-r--r--share/man/man4/cc.42
-rw-r--r--share/man/man4/em.428
-rw-r--r--share/man/man4/h_ertt.42
-rw-r--r--share/man/man4/igb.428
-rw-r--r--share/man/man4/mps.426
-rw-r--r--share/man/man4/nvram2env.42
-rw-r--r--share/man/man4/snd_hda.420
-rw-r--r--share/man/man4/ucom.41
-rw-r--r--share/man/man4/uep.410
-rw-r--r--share/man/man4/umcs.497
-rw-r--r--share/man/man4/vge.49
-rw-r--r--share/man/man5/fstab.538
-rw-r--r--share/man/man5/make.conf.549
-rw-r--r--share/man/man5/rc.conf.566
-rw-r--r--share/man/man5/src.conf.523
-rw-r--r--share/man/man7/build.76
-rw-r--r--share/man/man7/c99.74
-rw-r--r--share/man/man7/eventtimers.72
-rw-r--r--share/man/man7/ports.76
-rw-r--r--share/man/man7/release.76
-rw-r--r--share/man/man9/Makefile16
-rw-r--r--share/man/man9/bus_adjust_resource.918
-rw-r--r--share/man/man9/devfs_set_cdevpriv.92
-rw-r--r--share/man/man9/device_get_sysctl.94
-rw-r--r--share/man/man9/hhook.92
-rw-r--r--share/man/man9/khelp.92
-rw-r--r--share/misc/committers-ports.dot10
-rw-r--r--share/misc/committers-src.dot3
-rw-r--r--share/misc/mdoc.template1
-rw-r--r--share/misc/usb_hid_usages10
-rw-r--r--share/mk/bsd.doc.mk6
-rw-r--r--share/mk/bsd.own.mk1
-rw-r--r--share/skel/dot.shrc2
-rw-r--r--sys/Makefile2
-rw-r--r--sys/amd64/acpica/acpi_wakeup.c21
-rw-r--r--sys/amd64/amd64/intr_machdep.c10
-rw-r--r--sys/amd64/amd64/legacy.c1
-rw-r--r--sys/amd64/amd64/machdep.c7
-rw-r--r--sys/amd64/amd64/mp_machdep.c342
-rw-r--r--sys/amd64/amd64/pmap.c84
-rw-r--r--sys/amd64/amd64/vm_machdep.c21
-rw-r--r--sys/amd64/conf/GENERIC9
-rw-r--r--sys/amd64/ia32/ia32_sigtramp.S25
-rw-r--r--sys/amd64/include/_types.h1
-rw-r--r--sys/amd64/include/pmap.h3
-rw-r--r--sys/amd64/include/smp.h9
-rw-r--r--sys/amd64/include/vmm.h8
-rw-r--r--sys/amd64/vmm/amd/amdv.c1
-rw-r--r--sys/amd64/vmm/io/ppt.c1
-rw-r--r--sys/amd64/vmm/io/vlapic.c27
-rw-r--r--sys/amd64/vmm/vmm.c8
-rw-r--r--sys/amd64/vmm/vmm_lapic.c1
-rw-r--r--sys/amd64/vmm/vmm_msr.c1
-rw-r--r--sys/amd64/vmm/vmm_stat.c1
-rw-r--r--sys/arm/arm/pmap.c4
-rw-r--r--sys/arm/include/_types.h1
-rw-r--r--sys/arm/include/pmap.h3
-rw-r--r--sys/boot/common/Makefile.inc7
-rw-r--r--sys/boot/common/load_elf_obj.c37
-rw-r--r--sys/boot/forth/beastie.4th423
-rw-r--r--sys/boot/forth/beastie.4th.8171
-rw-r--r--sys/boot/forth/brand.4th91
-rw-r--r--sys/boot/forth/brand.4th.8125
-rw-r--r--sys/boot/forth/check-password.4th156
-rw-r--r--sys/boot/forth/check-password.4th.8123
-rw-r--r--sys/boot/forth/color.4th48
-rw-r--r--sys/boot/forth/color.4th.8117
-rw-r--r--sys/boot/forth/delay.4th112
-rw-r--r--sys/boot/forth/delay.4th.8126
-rw-r--r--sys/boot/forth/loader.4th25
-rw-r--r--sys/boot/forth/loader.conf.58
-rw-r--r--sys/boot/forth/menu-commands.4th190
-rw-r--r--sys/boot/forth/menu.4th971
-rw-r--r--sys/boot/forth/menu.4th.8307
-rw-r--r--sys/boot/forth/menu.rc76
-rw-r--r--sys/boot/forth/shortcuts.4th50
-rw-r--r--sys/boot/forth/support.4th33
-rw-r--r--sys/boot/forth/version.4th60
-rw-r--r--sys/boot/forth/version.4th.8126
-rw-r--r--sys/boot/i386/libi386/biosacpi.c2
-rw-r--r--sys/boot/i386/loader/Makefile5
-rw-r--r--sys/boot/i386/zfsboot/Makefile2
-rw-r--r--sys/boot/ia64/common/Makefile8
-rw-r--r--sys/boot/ia64/common/exec.c2
-rw-r--r--sys/boot/ia64/common/icache.c51
-rw-r--r--sys/boot/ia64/common/libia64.h1
-rw-r--r--sys/boot/ia64/efi/efimd.c32
-rw-r--r--sys/boot/ia64/efi/main.c37
-rw-r--r--sys/boot/ia64/efi/version2
-rw-r--r--sys/boot/pc98/loader/Makefile6
-rw-r--r--sys/boot/powerpc/ofw/Makefile7
-rw-r--r--sys/boot/powerpc/ps3/Makefile7
-rw-r--r--sys/boot/sparc64/loader/Makefile7
-rw-r--r--sys/cam/ata/ata_all.c1
-rw-r--r--sys/cam/ata/ata_da.c151
-rw-r--r--sys/cam/ata/ata_xpt.c10
-rw-r--r--sys/cam/cam_ccb.h39
-rw-r--r--sys/cam/cam_periph.c45
-rw-r--r--sys/cam/cam_periph.h8
-rw-r--r--sys/cam/cam_xpt.c129
-rw-r--r--sys/cam/cam_xpt.h2
-rw-r--r--sys/cam/cam_xpt_internal.h2
-rw-r--r--sys/cam/scsi/scsi_all.c203
-rw-r--r--sys/cam/scsi/scsi_all.h67
-rw-r--r--sys/cam/scsi/scsi_da.c105
-rw-r--r--sys/cam/scsi/scsi_pass.c79
-rw-r--r--sys/cam/scsi/scsi_ses.h4
-rw-r--r--sys/cam/scsi/scsi_xpt.c80
-rw-r--r--sys/cddl/compat/opensolaris/kern/opensolaris.c3
-rw-r--r--sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c4
-rw-r--r--sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c5
-rw-r--r--sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c5
-rw-r--r--sys/cddl/compat/opensolaris/sys/atomic.h2
-rw-r--r--sys/cddl/compat/opensolaris/sys/kstat.h2
-rw-r--r--sys/cddl/compat/opensolaris/sys/taskq.h1
-rw-r--r--sys/cddl/compat/opensolaris/sys/time.h17
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h12
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h12
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h162
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h26
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c31
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c14
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h2
-rw-r--r--sys/cddl/dev/cyclic/i386/cyclic_machdep.c4
-rw-r--r--sys/cddl/dev/dtrace/amd64/dtrace_subr.c9
-rw-r--r--sys/cddl/dev/dtrace/i386/dtrace_subr.c10
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c13
-rw-r--r--sys/compat/freebsd32/freebsd32_proto.h9
-rw-r--r--sys/compat/freebsd32/freebsd32_syscall.h4
-rw-r--r--sys/compat/freebsd32/freebsd32_syscalls.c4
-rw-r--r--sys/compat/freebsd32/freebsd32_sysent.c4
-rw-r--r--sys/compat/freebsd32/syscalls.master3
-rw-r--r--sys/compat/linprocfs/linprocfs.c18
-rw-r--r--sys/conf/Makefile.arm3
-rw-r--r--sys/conf/Makefile.powerpc2
-rw-r--r--sys/conf/NOTES7
-rw-r--r--sys/conf/files142
-rw-r--r--sys/conf/files.powerpc10
-rw-r--r--sys/conf/options1
-rw-r--r--sys/contrib/dev/acpica/changes.txt129
-rw-r--r--sys/contrib/dev/acpica/debugger/dbexec.c405
-rw-r--r--sys/contrib/dev/acpica/debugger/dbinput.c112
-rw-r--r--sys/contrib/dev/acpica/debugger/dbutils.c7
-rw-r--r--sys/contrib/dev/acpica/debugger/dbxface.c8
-rw-r--r--sys/contrib/dev/acpica/include/acconfig.h3
-rw-r--r--sys/contrib/dev/acpica/include/acdebug.h7
-rw-r--r--sys/contrib/dev/acpica/include/acglobal.h9
-rw-r--r--sys/contrib/dev/acpica/include/aclocal.h2
-rw-r--r--sys/contrib/dev/acpica/include/acpiosxf.h6
-rw-r--r--sys/contrib/dev/acpica/include/acpixf.h2
-rw-r--r--sys/contrib/dev/acpica/include/acpredef.h1
-rw-r--r--sys/contrib/dev/acpica/osunixxf.c24
-rw-r--r--sys/contrib/dev/acpica/tables/tbinstal.c26
-rw-r--r--sys/contrib/pf/net/pf.c47
-rw-r--r--sys/contrib/pf/net/pf_ioctl.c5
-rw-r--r--sys/contrib/pf/net/pf_norm.c2
-rw-r--r--sys/ddb/db_command.c24
-rw-r--r--sys/dev/aac/aac.c23
-rw-r--r--sys/dev/aac/aacvar.h7
-rw-r--r--sys/dev/acpica/Osd/OsdDebug.c23
-rw-r--r--sys/dev/acpica/acpi.c68
-rw-r--r--sys/dev/acpica/acpi_pci.c26
-rw-r--r--sys/dev/ahci/ahci.c101
-rw-r--r--sys/dev/amdsbwd/amdsbwd.c184
-rw-r--r--sys/dev/ata/ata-sata.c30
-rw-r--r--sys/dev/ata/chipsets/ata-intel.c4
-rw-r--r--sys/dev/ath/ath_dfs/null/dfs_null.c160
-rw-r--r--sys/dev/ath/ath_hal/ah.c8
-rw-r--r--sys/dev/ath/ath_hal/ah.h100
-rw-r--r--sys/dev/ath/ath_hal/ah_desc.h3
-rw-r--r--sys/dev/ath/ath_hal/ah_devid.h2
-rw-r--r--sys/dev/ath/ath_hal/ah_eeprom.h4
-rw-r--r--sys/dev/ath/ath_hal/ah_eeprom_9287.c42
-rw-r--r--sys/dev/ath/ath_hal/ah_internal.h14
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212.h10
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_attach.c9
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_misc.c131
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212reg.h1
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416.h7
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_ani.c17
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_attach.c14
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_cal.c4
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_misc.c148
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_reset.c54
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416phy.h21
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416reg.h60
-rw-r--r--sys/dev/ath/ath_hal/ar9001/ar9130_attach.c1
-rw-r--r--sys/dev/ath/ath_hal/ar9001/ar9160_attach.c3
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9280_attach.c4
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_attach.c3
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287.c392
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287.h62
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287.ini783
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_attach.c476
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_cal.c73
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_cal.h33
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_olc.c171
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_olc.h31
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_reset.c571
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_reset.h27
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287an.h49
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287phy.h26
-rw-r--r--sys/dev/ath/if_ath.c99
-rw-r--r--sys/dev/ath/if_ath_ahb.c6
-rw-r--r--sys/dev/ath/if_ath_tx_ht.c20
-rw-r--r--sys/dev/ath/if_athdfs.h47
-rw-r--r--sys/dev/ath/if_athvar.h24
-rw-r--r--sys/dev/atkbdc/atkbd.c15
-rw-r--r--sys/dev/atkbdc/atkbdreg.h1
-rw-r--r--sys/dev/bxe/bxe_debug.h49
-rw-r--r--sys/dev/bxe/bxe_link.c36
-rw-r--r--sys/dev/bxe/if_bxe.c5858
-rw-r--r--sys/dev/bxe/if_bxe.h363
-rw-r--r--sys/dev/cardbus/cardbus_cis.c5
-rw-r--r--sys/dev/cxgbe/adapter.h25
-rw-r--r--sys/dev/cxgbe/common/common.h2
-rw-r--r--sys/dev/cxgbe/common/jhash.h140
-rw-r--r--sys/dev/cxgbe/common/t4fw_interface.h237
-rw-r--r--sys/dev/cxgbe/offload.h18
-rw-r--r--sys/dev/cxgbe/osdep.h1
-rw-r--r--sys/dev/cxgbe/t4_ioctl.h19
-rw-r--r--sys/dev/cxgbe/t4_l2t.c361
-rw-r--r--sys/dev/cxgbe/t4_l2t.h71
-rw-r--r--sys/dev/cxgbe/t4_main.c380
-rw-r--r--sys/dev/cxgbe/t4_sge.c415
-rw-r--r--sys/dev/e1000/if_igb.c256
-rw-r--r--sys/dev/e1000/if_igb.h6
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c8
-rw-r--r--sys/dev/iicbus/ad7417.c621
-rw-r--r--sys/dev/iicbus/ds1775.c105
-rw-r--r--sys/dev/iicbus/max6690.c113
-rw-r--r--sys/dev/ipw/if_ipw.c2
-rw-r--r--sys/dev/iwi/if_iwi.c2
-rw-r--r--sys/dev/iwn/if_iwn.c39
-rw-r--r--sys/dev/ixgbe/LICENSE2
-rw-r--r--sys/dev/ixgbe/README267
-rw-r--r--sys/dev/ixgbe/ixgbe.c79
-rw-r--r--sys/dev/ixgbe/ixv.c58
-rw-r--r--sys/dev/mfi/mfi.c18
-rw-r--r--sys/dev/mfi/mfireg.h4
-rw-r--r--sys/dev/mmc/mmc.c22
-rw-r--r--sys/dev/mmc/mmcvar.h2
-rw-r--r--sys/dev/msk/if_msk.c35
-rw-r--r--sys/dev/mvs/mvs.c44
-rw-r--r--sys/dev/nfe/if_nfe.c2
-rw-r--r--sys/dev/pccard/pccard.c8
-rw-r--r--sys/dev/pccbb/pccbb.c20
-rw-r--r--sys/dev/pci/pci.c11
-rw-r--r--sys/dev/pci/pci_pci.c7
-rw-r--r--sys/dev/puc/puc.c38
-rw-r--r--sys/dev/puc/puc_bfe.h3
-rw-r--r--sys/dev/puc/puc_pccard.c4
-rw-r--r--sys/dev/puc/puc_pci.c4
-rw-r--r--sys/dev/puc/pucdata.c56
-rw-r--r--sys/dev/safe/safe.c9
-rw-r--r--sys/dev/sdhci/sdhci.c28
-rw-r--r--sys/dev/siis/siis.c25
-rw-r--r--sys/dev/sound/pci/hda/hdac.c70
-rw-r--r--sys/dev/sound/pcm/sound.c54
-rw-r--r--sys/dev/uart/uart_dev_ns8250.c8
-rw-r--r--sys/dev/usb/net/if_axe.c21
-rw-r--r--sys/dev/usb/net/if_udav.c1
-rw-r--r--sys/dev/usb/serial/umcs.c1075
-rw-r--r--sys/dev/usb/serial/umcs.h644
-rw-r--r--sys/dev/usb/usb_device.h2
-rw-r--r--sys/dev/usb/usb_freebsd.h1
-rw-r--r--sys/dev/usb/usb_generic.c6
-rw-r--r--sys/dev/usb/usb_hub.c27
-rw-r--r--sys/dev/usb/usb_process.c7
-rw-r--r--sys/dev/usb/usb_request.c100
-rw-r--r--sys/dev/usb/usb_request.h4
-rw-r--r--sys/dev/usb/usb_transfer.c5
-rw-r--r--sys/dev/usb/usbdevs3
-rw-r--r--sys/dev/usb/usbdi.h1
-rw-r--r--sys/dev/wpi/if_wpi.c2
-rw-r--r--sys/dev/xen/blkback/blkback.c1983
-rw-r--r--sys/dev/xen/blkfront/blkfront.c4
-rw-r--r--sys/dev/xen/control/control.c24
-rw-r--r--sys/dev/xen/netfront/netfront.c3
-rw-r--r--sys/fs/nfs/nfs_commonkrpc.c81
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c19
-rw-r--r--sys/fs/nfs/nfs_var.h25
-rw-r--r--sys/fs/nfs/nfsport.h4
-rw-r--r--sys/fs/nfs/nfsproto.h42
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c22
-rw-r--r--sys/fs/nfsclient/nfs_clcomsubs.c2
-rw-r--r--sys/fs/nfsclient/nfs_clkdtrace.c600
-rw-r--r--sys/fs/nfsclient/nfs_clkrpc.c12
-rw-r--r--sys/fs/nfsclient/nfs_clnode.c5
-rw-r--r--sys/fs/nfsclient/nfs_clport.c97
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c33
-rw-r--r--sys/fs/nfsclient/nfs_clstate.c126
-rw-r--r--sys/fs/nfsclient/nfs_clsubs.c5
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c12
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c103
-rw-r--r--sys/fs/nfsclient/nfs_kdtrace.h120
-rw-r--r--sys/fs/nfsserver/nfs_nfsdcache.c19
-rw-r--r--sys/fs/nfsserver/nfs_nfsdkrpc.c37
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c30
-rw-r--r--sys/fs/nfsserver/nfs_nfsdserv.c12
-rw-r--r--sys/fs/nfsserver/nfs_nfsdsocket.c8
-rw-r--r--sys/fs/nfsserver/nfs_nfsdstate.c18
-rw-r--r--sys/fs/nwfs/nwfs_io.c11
-rw-r--r--sys/fs/smbfs/smbfs_io.c11
-rw-r--r--sys/geom/eli/g_eli.c2
-rw-r--r--sys/geom/geom.h5
-rw-r--r--sys/geom/geom_dev.c52
-rw-r--r--sys/geom/geom_disk.c27
-rw-r--r--sys/geom/geom_disk.h3
-rw-r--r--sys/geom/geom_dump.c6
-rw-r--r--sys/geom/geom_event.c47
-rw-r--r--sys/geom/geom_subr.c1
-rw-r--r--sys/geom/part/g_part.c17
-rw-r--r--sys/geom/part/g_part_bsd.c25
-rw-r--r--sys/geom/part/g_part_ebr.c3
-rw-r--r--sys/geom/part/g_part_mbr.c16
-rw-r--r--sys/geom/part/g_part_pc98.c10
-rw-r--r--sys/geom/vinum/geom_vinum_drive.c4
-rw-r--r--sys/geom/vinum/geom_vinum_events.c6
-rw-r--r--sys/i386/conf/GENERIC9
-rw-r--r--sys/i386/i386/intr_machdep.c10
-rw-r--r--sys/i386/i386/legacy.c1
-rw-r--r--sys/i386/i386/machdep.c7
-rw-r--r--sys/i386/i386/mp_machdep.c332
-rw-r--r--sys/i386/i386/pmap.c118
-rw-r--r--sys/i386/i386/vm_machdep.c36
-rw-r--r--sys/i386/include/_types.h1
-rw-r--r--sys/i386/include/pmap.h3
-rw-r--r--sys/i386/include/sf_buf.h3
-rw-r--r--sys/i386/include/smp.h9
-rw-r--r--sys/i386/pci/pci_cfgreg.c2
-rw-r--r--sys/i386/xen/mp_machdep.c117
-rw-r--r--sys/i386/xen/pmap.c81
-rw-r--r--sys/ia64/acpica/acpi_machdep.c7
-rw-r--r--sys/ia64/ia64/busdma_machdep.c167
-rw-r--r--sys/ia64/ia64/machdep.c40
-rw-r--r--sys/ia64/ia64/mp_machdep.c29
-rw-r--r--sys/ia64/ia64/pal.S25
-rw-r--r--sys/ia64/ia64/pmap.c6
-rw-r--r--sys/ia64/include/_types.h1
-rw-r--r--sys/ia64/include/ia64_cpu.h13
-rw-r--r--sys/ia64/include/smp.h4
-rw-r--r--sys/kern/imgact_aout.c4
-rw-r--r--sys/kern/kern_conf.c62
-rw-r--r--sys/kern/kern_cpuset.c88
-rw-r--r--sys/kern/kern_exit.c11
-rw-r--r--sys/kern/kern_idle.c2
-rw-r--r--sys/kern/kern_ktr.c61
-rw-r--r--sys/kern/kern_pmc.c6
-rw-r--r--sys/kern/kern_racct.c5
-rw-r--r--sys/kern/kern_rctl.c2
-rw-r--r--sys/kern/kern_rmlock.c15
-rw-r--r--sys/kern/kern_shutdown.c33
-rw-r--r--sys/kern/kern_sig.c6
-rw-r--r--sys/kern/ksched.c2
-rw-r--r--sys/kern/link_elf.c2
-rw-r--r--sys/kern/sched_4bsd.c70
-rw-r--r--sys/kern/sched_ule.c9
-rw-r--r--sys/kern/subr_devstat.c14
-rw-r--r--sys/kern/subr_kdb.c36
-rw-r--r--sys/kern/subr_msgbuf.c191
-rw-r--r--sys/kern/subr_pcpu.c8
-rw-r--r--sys/kern/subr_prf.c160
-rw-r--r--sys/kern/subr_rman.c1
-rw-r--r--sys/kern/subr_smp.c95
-rw-r--r--sys/kern/sys_process.c17
-rw-r--r--sys/kern/uipc_socket.c14
-rw-r--r--sys/kern/uipc_syscalls.c4
-rw-r--r--sys/kern/vfs_bio.c5
-rw-r--r--sys/kgssapi/gss_impl.c37
-rw-r--r--sys/mips/cavium/octeon_ebt3000_cf.c331
-rw-r--r--sys/mips/cavium/octeon_mp.c14
-rw-r--r--sys/mips/include/_types.h1
-rw-r--r--sys/mips/include/hwfunc.h4
-rw-r--r--sys/mips/include/pmap.h3
-rw-r--r--sys/mips/include/smp.h4
-rw-r--r--sys/mips/mips/mp_machdep.c64
-rw-r--r--sys/mips/mips/pmap.c36
-rw-r--r--sys/mips/rmi/xlr_machdep.c10
-rw-r--r--sys/mips/sibyte/sb_scd.c11
-rw-r--r--sys/modules/Makefile2
-rw-r--r--sys/modules/ath/Makefile10
-rw-r--r--sys/modules/cxgbe/if_cxgbe/Makefile2
-rw-r--r--sys/modules/dtrace/Makefile1
-rw-r--r--sys/modules/dtrace/dtnfscl/Makefile13
-rw-r--r--sys/modules/dtrace/dtraceall/dtraceall.c1
-rw-r--r--sys/modules/kgssapi_krb5/Makefile3
-rw-r--r--sys/modules/usb/Makefile2
-rw-r--r--sys/modules/usb/umcs/Makefile36
-rw-r--r--sys/net/bridgestp.c5
-rw-r--r--sys/net/bridgestp.h1
-rw-r--r--sys/net/if.h10
-rw-r--r--sys/net/if_ethersubr.c42
-rw-r--r--sys/net/if_gre.c83
-rw-r--r--sys/net/if_gre.h2
-rw-r--r--sys/net/if_tun.c17
-rw-r--r--sys/net/netisr.c2
-rw-r--r--sys/net/route.c1
-rw-r--r--sys/net80211/ieee80211_acl.c5
-rw-r--r--sys/net80211/ieee80211_ht.c31
-rw-r--r--sys/net80211/ieee80211_ioctl.c10
-rw-r--r--sys/net80211/ieee80211_ioctl.h2
-rw-r--r--sys/net80211/ieee80211_output.c13
-rw-r--r--sys/net80211/ieee80211_var.h2
-rw-r--r--sys/netgraph/ng_nat.c20
-rw-r--r--sys/netgraph/ng_pipe.c31
-rw-r--r--sys/netinet/icmp6.h21
-rw-r--r--sys/netinet/if_ether.c2
-rw-r--r--sys/netinet/in.c25
-rw-r--r--sys/netinet/in_pcb.c377
-rw-r--r--sys/netinet/in_pcb.h137
-rw-r--r--sys/netinet/in_pcbgroup.c457
-rw-r--r--sys/netinet/in_proto.c2
-rw-r--r--sys/netinet/ip_divert.c11
-rw-r--r--sys/netinet/ip_input.c2
-rw-r--r--sys/netinet/ip_ipsec.c2
-rw-r--r--sys/netinet/ipfw/ip_dummynet.c10
-rw-r--r--sys/netinet/ipfw/ip_fw2.c151
-rw-r--r--sys/netinet/ipfw/ip_fw_dynamic.c3
-rw-r--r--sys/netinet/ipfw/ip_fw_nat.c67
-rw-r--r--sys/netinet/ipfw/ip_fw_sockopt.c10
-rw-r--r--sys/netinet/libalias/alias.h24
-rw-r--r--sys/netinet/libalias/alias_sctp.h8
-rw-r--r--sys/netinet/raw_ip.c32
-rw-r--r--sys/netinet/sctp.h14
-rw-r--r--sys/netinet/sctp_auth.c2
-rw-r--r--sys/netinet/sctp_indata.c155
-rw-r--r--sys/netinet/sctp_indata.h5
-rw-r--r--sys/netinet/sctp_output.c457
-rw-r--r--sys/netinet/sctp_pcb.c10
-rw-r--r--sys/netinet/sctp_structs.h3
-rw-r--r--sys/netinet/sctp_uio.h136
-rw-r--r--sys/netinet/sctp_usrreq.c1563
-rw-r--r--sys/netinet/sctp_var.h24
-rw-r--r--sys/netinet/sctputil.c93
-rw-r--r--sys/netinet/sctputil.h14
-rw-r--r--sys/netinet/siftr.c22
-rw-r--r--sys/netinet/tcp_input.c240
-rw-r--r--sys/netinet/tcp_output.c11
-rw-r--r--sys/netinet/tcp_subr.c53
-rw-r--r--sys/netinet/tcp_syncache.c22
-rw-r--r--sys/netinet/tcp_timer.c2
-rw-r--r--sys/netinet/tcp_usrreq.c98
-rw-r--r--sys/netinet/udp_usrreq.c139
-rw-r--r--sys/netinet6/in6.c26
-rw-r--r--sys/netinet6/in6.h5
-rw-r--r--sys/netinet6/in6_pcb.c272
-rw-r--r--sys/netinet6/in6_pcb.h26
-rw-r--r--sys/netinet6/in6_pcbgroup.c103
-rw-r--r--sys/netinet6/in6_proto.c12
-rw-r--r--sys/netinet6/in6_src.c2
-rw-r--r--sys/netinet6/ip6_input.c7
-rw-r--r--sys/netinet6/ip6_ipsec.c12
-rw-r--r--sys/netinet6/ip6_var.h5
-rw-r--r--sys/netinet6/nd6.c48
-rw-r--r--sys/netinet6/nd6.h1
-rw-r--r--sys/netinet6/nd6_nbr.c14
-rw-r--r--sys/netinet6/nd6_rtr.c40
-rw-r--r--sys/netinet6/send.h2
-rw-r--r--sys/netinet6/udp6_usrreq.c78
-rw-r--r--sys/nfsclient/nfs_bio.c8
-rw-r--r--sys/nfsclient/nfs_krpc.c12
-rw-r--r--sys/nfsclient/nfs_vfsops.c12
-rw-r--r--sys/nfsserver/nfs_srvkrpc.c16
-rw-r--r--sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c4
-rw-r--r--sys/ofed/include/linux/list.h1
-rw-r--r--sys/pc98/conf/GENERIC13
-rw-r--r--sys/pc98/pc98/machdep.c7
-rw-r--r--sys/powerpc/aim/interrupt.c4
-rw-r--r--sys/powerpc/aim/locore32.S13
-rw-r--r--sys/powerpc/aim/locore64.S134
-rw-r--r--sys/powerpc/aim/machdep.c29
-rw-r--r--sys/powerpc/aim/mmu_oea.c33
-rw-r--r--sys/powerpc/aim/mmu_oea64.c43
-rw-r--r--sys/powerpc/aim/moea64_native.c6
-rw-r--r--sys/powerpc/aim/mp_cpudep.c5
-rw-r--r--sys/powerpc/aim/slb.c26
-rw-r--r--sys/powerpc/aim/trap_subr64.S47
-rw-r--r--sys/powerpc/booke/locore.S68
-rw-r--r--sys/powerpc/booke/machdep.c53
-rw-r--r--sys/powerpc/booke/platform_bare.c62
-rw-r--r--sys/powerpc/booke/pmap.c40
-rw-r--r--sys/powerpc/conf/GENERIC12
-rw-r--r--sys/powerpc/conf/GENERIC6410
-rw-r--r--sys/powerpc/conf/NOTES2
-rw-r--r--sys/powerpc/include/_types.h1
-rw-r--r--sys/powerpc/include/openpicvar.h2
-rw-r--r--sys/powerpc/include/param.h2
-rw-r--r--sys/powerpc/include/pmap.h5
-rw-r--r--sys/powerpc/include/rtas.h61
-rw-r--r--sys/powerpc/include/slb.h2
-rw-r--r--sys/powerpc/include/smp.h4
-rw-r--r--sys/powerpc/include/spr.h16
-rw-r--r--sys/powerpc/mpc85xx/mpc85xx.c21
-rw-r--r--sys/powerpc/mpc85xx/mpc85xx.h5
-rw-r--r--sys/powerpc/mpc85xx/openpic_fdt.c3
-rw-r--r--sys/powerpc/ofw/ofw_machdep.c187
-rw-r--r--sys/powerpc/ofw/ofw_real.c7
-rw-r--r--sys/powerpc/ofw/ofwcall32.S154
-rw-r--r--sys/powerpc/ofw/ofwcall64.S290
-rw-r--r--sys/powerpc/ofw/ofwmagic.S (renamed from sys/powerpc/aim/ofwmagic.S)0
-rw-r--r--sys/powerpc/ofw/rtas.c243
-rw-r--r--sys/powerpc/powermac/fcu.c219
-rw-r--r--sys/powerpc/powermac/powermac_thermal.c183
-rw-r--r--sys/powerpc/powermac/powermac_thermal.h56
-rw-r--r--sys/powerpc/powermac/smu.c199
-rw-r--r--sys/powerpc/powermac/smusat.c50
-rw-r--r--sys/powerpc/powermac/windtunnel.c216
-rw-r--r--sys/powerpc/powerpc/intr_machdep.c7
-rw-r--r--sys/powerpc/powerpc/mp_machdep.c32
-rw-r--r--sys/powerpc/powerpc/openpic.c9
-rw-r--r--sys/powerpc/powerpc/pic_if.m3
-rw-r--r--sys/powerpc/ps3/if_glc.c47
-rw-r--r--sys/powerpc/ps3/ohci_ps3.c170
-rw-r--r--sys/powerpc/ps3/ps3bus.c191
-rw-r--r--sys/powerpc/ps3/ps3bus.h6
-rw-r--r--sys/powerpc/ps3/ps3disk.c901
-rw-r--r--sys/rpc/rpc_generic.c4
-rw-r--r--sys/rpc/rpcsec_gss.h265
-rw-r--r--sys/sparc64/conf/GENERIC11
-rw-r--r--sys/sparc64/include/_types.h1
-rw-r--r--sys/sparc64/include/ktr.h42
-rw-r--r--sys/sparc64/include/pmap.h3
-rw-r--r--sys/sparc64/include/smp.h57
-rw-r--r--sys/sparc64/sparc64/exception.S99
-rw-r--r--sys/sparc64/sparc64/genassym.c4
-rw-r--r--sys/sparc64/sparc64/intr_machdep.c39
-rw-r--r--sys/sparc64/sparc64/mp_exception.S34
-rw-r--r--sys/sparc64/sparc64/mp_locore.S8
-rw-r--r--sys/sparc64/sparc64/mp_machdep.c112
-rw-r--r--sys/sparc64/sparc64/pmap.c18
-rw-r--r--sys/sparc64/sparc64/swtch.S40
-rw-r--r--sys/sparc64/sparc64/tlb.c6
-rw-r--r--sys/sys/_cpuset.h52
-rw-r--r--sys/sys/_rmlock.h2
-rw-r--r--sys/sys/conf.h4
-rw-r--r--sys/sys/cpuset.h61
-rw-r--r--sys/sys/disk.h8
-rw-r--r--sys/sys/diskpc98.h4
-rw-r--r--sys/sys/dtrace_bsd.h25
-rw-r--r--sys/sys/ktr.h5
-rw-r--r--sys/sys/mbuf.h40
-rw-r--r--sys/sys/msgbuf.h21
-rw-r--r--sys/sys/param.h6
-rw-r--r--sys/sys/pcpu.h19
-rw-r--r--sys/sys/pmckern.h4
-rw-r--r--sys/sys/proc.h2
-rw-r--r--sys/sys/racct.h40
-rw-r--r--sys/sys/smp.h26
-rw-r--r--sys/sys/soundcard.h3
-rw-r--r--sys/sys/types.h1
-rw-r--r--sys/sys/vnode.h1
-rw-r--r--sys/teken/libteken/teken.332
-rw-r--r--sys/ufs/ffs/ffs_alloc.c54
-rw-r--r--sys/ufs/ffs/ffs_balloc.c74
-rw-r--r--sys/ufs/ffs/ffs_extern.h35
-rw-r--r--sys/ufs/ffs/ffs_inode.c138
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c133
-rw-r--r--sys/ufs/ffs/ffs_softdep.c3954
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c8
-rw-r--r--sys/ufs/ffs/ffs_vnops.c176
-rw-r--r--sys/ufs/ffs/fs.h3
-rw-r--r--sys/ufs/ffs/softdep.h106
-rw-r--r--sys/ufs/ufs/inode.h2
-rw-r--r--sys/ufs/ufs/quota.h6
-rw-r--r--sys/ufs/ufs/ufs_lookup.c2
-rw-r--r--sys/ufs/ufs/ufs_quota.c95
-rw-r--r--sys/ufs/ufs/ufs_vnops.c8
-rw-r--r--sys/ufs/ufs/ufsmount.h5
-rw-r--r--sys/vm/vm_fault.c10
-rw-r--r--sys/vm/vm_object.c15
-rw-r--r--sys/vm/vm_page.c52
-rw-r--r--sys/vm/vm_page.h42
-rw-r--r--sys/vm/vnode_pager.c25
-rw-r--r--sys/vm/vnode_pager.h3
-rw-r--r--sys/x86/x86/local_apic.c2
-rw-r--r--sys/x86/x86/tsc.c77
-rw-r--r--sys/xen/interface/io/xenbus.h9
-rw-r--r--sys/xen/xenbus/xenbus.c12
-rw-r--r--sys/xen/xenbus/xenbus_if.m22
-rw-r--r--sys/xen/xenbus/xenbusb.c111
-rw-r--r--sys/xen/xenbus/xenbusb.h46
-rw-r--r--sys/xen/xenbus/xenbusb_back.c104
-rw-r--r--sys/xen/xenbus/xenbusb_front.c1
-rw-r--r--sys/xen/xenbus/xenbusb_if.m39
-rw-r--r--sys/xen/xenbus/xenbusvar.h24
-rw-r--r--sys/xen/xenstore/xenstorevar.h9
-rw-r--r--tools/build/make_check/Makefile21
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc21
-rw-r--r--tools/build/options/WITHOUT_ACCT4
-rw-r--r--tools/build/options/WITHOUT_UTMPX10
-rw-r--r--tools/build/options/WITH_BSD_GREP2
-rw-r--r--tools/regression/bin/sh/builtins/alias.1.stderr2
-rw-r--r--tools/regression/bin/sh/builtins/case6.052
-rw-r--r--tools/regression/bin/sh/builtins/case7.024
-rw-r--r--tools/regression/bin/sh/builtins/case8.032
-rw-r--r--tools/regression/bin/sh/builtins/case9.039
-rw-r--r--tools/regression/bin/sh/builtins/cd5.023
-rw-r--r--tools/regression/bin/sh/builtins/cd6.010
-rw-r--r--tools/regression/bin/sh/builtins/cd7.015
-rw-r--r--tools/regression/bin/sh/builtins/export1.03
-rw-r--r--tools/regression/bin/sh/builtins/set1.032
-rw-r--r--tools/regression/bin/sh/builtins/set2.03
-rw-r--r--tools/regression/bin/sh/execution/bg4.06
-rw-r--r--tools/regression/bin/sh/execution/set-n1.07
-rw-r--r--tools/regression/bin/sh/execution/set-n2.05
-rw-r--r--tools/regression/bin/sh/execution/set-n3.04
-rw-r--r--tools/regression/bin/sh/execution/set-n4.03
-rw-r--r--tools/regression/bin/sh/execution/set-x1.08
-rw-r--r--tools/regression/bin/sh/execution/set-x2.09
-rw-r--r--tools/regression/bin/sh/execution/set-x3.09
-rw-r--r--tools/regression/bin/sh/expansion/cmdsubst11.05
-rw-r--r--tools/regression/bin/sh/expansion/heredoc1.025
-rw-r--r--tools/regression/bin/sh/expansion/heredoc2.015
-rw-r--r--tools/regression/bin/sh/expansion/ifs4.039
-rw-r--r--tools/regression/bin/sh/parameters/env1.011
-rw-r--r--tools/regression/bin/sh/parser/func2.06
-rw-r--r--tools/regression/bin/sh/parser/func3.06
-rw-r--r--tools/regression/netinet/ipdivert/Makefile11
-rw-r--r--tools/regression/netinet/ipdivert/ipdivert.c166
-rw-r--r--tools/regression/netinet/tcpconnect/tcpconnect.c1
-rw-r--r--tools/regression/netinet/tcpdrop/tcpdrop.c81
-rw-r--r--tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c1
-rw-r--r--tools/regression/netinet/tcpsocktimewait/tcpsocktimewait.c123
-rw-r--r--tools/regression/netinet/udpconnectjail/udpconnectjail.c11
-rw-r--r--tools/regression/usr.bin/printf/regress.l1.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.l2.out1
-rw-r--r--tools/regression/usr.bin/printf/regress.sh4
-rw-r--r--tools/tools/README1
-rw-r--r--tools/tools/ath/ath_ee_9287_print/9287.c316
-rw-r--r--tools/tools/ath/ath_ee_9287_print/9287.h15
-rw-r--r--tools/tools/ath/ath_ee_9287_print/Makefile12
-rw-r--r--tools/tools/ath/ath_ee_9287_print/eeprom.c72
-rw-r--r--tools/tools/ath/ath_ee_9287_print/eeprom.h8
-rw-r--r--tools/tools/ath/ath_ee_9287_print/main.c85
-rw-r--r--tools/tools/cxgbetool/Makefile9
-rw-r--r--tools/tools/cxgbetool/cxgbetool.c1453
-rw-r--r--tools/tools/cxgbetool/reg_defs_t4.c40394
-rw-r--r--tools/tools/cxgbetool/reg_defs_t4vf.c122
-rw-r--r--tools/tools/ether_reflect/ether_reflect.12
-rw-r--r--tools/tools/nanobsd/nanobsd.sh2
-rw-r--r--usr.bin/Makefile17
-rw-r--r--usr.bin/calendar/calendars/calendar.freebsd3
-rw-r--r--usr.bin/calendar/io.c2
-rw-r--r--usr.bin/clang/tblgen/Makefile2
-rw-r--r--usr.bin/find/function.c26
-rw-r--r--usr.bin/find/main.c2
-rw-r--r--usr.bin/find/option.c2
-rw-r--r--usr.bin/fstat/fuser.120
-rw-r--r--usr.bin/fstat/fuser.c5
-rw-r--r--usr.bin/ftp/Makefile10
-rw-r--r--usr.bin/ftp/config.h285
-rw-r--r--usr.bin/ftp/tnftp_config.h514
-rw-r--r--usr.bin/grep/Makefile11
-rw-r--r--usr.bin/grep/fastgrep.c2
-rw-r--r--usr.bin/grep/grep.c6
-rw-r--r--usr.bin/grep/util.c27
-rw-r--r--usr.bin/gzip/gzip.c3
-rw-r--r--usr.bin/iconv/Makefile2
-rw-r--r--usr.bin/kdump/mksubr25
-rw-r--r--usr.bin/ldd/sods.c46
-rw-r--r--usr.bin/man/man.126
-rw-r--r--usr.bin/man/man.conf.55
-rwxr-xr-xusr.bin/man/man.sh90
-rw-r--r--usr.bin/mkcsmapper/mkcsmapper.12
-rw-r--r--usr.bin/mkesdb/mkesdb.12
-rw-r--r--usr.bin/printf/printf.128
-rw-r--r--usr.bin/printf/printf.c22
-rw-r--r--usr.bin/rctl/Makefile2
-rw-r--r--usr.bin/rctl/rctl.86
-rw-r--r--usr.bin/su/su.116
-rw-r--r--usr.bin/tftp/main.c10
-rw-r--r--usr.bin/tftp/tftp.15
-rw-r--r--usr.bin/top/machine.c7
-rw-r--r--usr.bin/top/top.local.14
-rw-r--r--usr.bin/users/users.c2
-rw-r--r--usr.bin/xlint/lint1/decl.c3
-rw-r--r--usr.bin/xlint/lint1/scan.l3
-rw-r--r--usr.bin/xlint/lint2/msg.c3
-rw-r--r--usr.bin/xlint/lint2/read.c4
-rw-r--r--usr.sbin/Makefile11
-rw-r--r--usr.sbin/bluetooth/ath3kfw/Makefile1
-rw-r--r--usr.sbin/bsdinstall/Makefile1
-rw-r--r--usr.sbin/bsdinstall/bsdinstall.8187
-rw-r--r--usr.sbin/bsdinstall/scripts/Makefile3
-rwxr-xr-xusr.sbin/bsdinstall/scripts/auto4
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig168
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv485
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv6148
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.32
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.32
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_wlan/Makefile2
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.32
-rw-r--r--usr.sbin/diskinfo/diskinfo.c5
-rw-r--r--usr.sbin/fdread/fdread.c2
-rw-r--r--usr.sbin/gpioctl/gpioctl.810
-rw-r--r--usr.sbin/jail/Makefile3
-rw-r--r--usr.sbin/jail/jail.c76
-rw-r--r--usr.sbin/jls/Makefile9
-rw-r--r--usr.sbin/jls/jls.c76
-rw-r--r--usr.sbin/kbdmap/kbdmap.c2
-rw-r--r--usr.sbin/lastlogin/lastlogin.820
-rw-r--r--usr.sbin/lastlogin/lastlogin.c58
-rw-r--r--usr.sbin/makefs/Makefile4
-rw-r--r--usr.sbin/makefs/cd9660/cd9660_write.c8
-rw-r--r--usr.sbin/makefs/ffs.c11
-rw-r--r--usr.sbin/makefs/ffs/ffs_bswap.c8
-rw-r--r--usr.sbin/makefs/ffs/ffs_subr.c9
-rw-r--r--usr.sbin/makefs/makefs.811
-rw-r--r--usr.sbin/makefs/makefs.c41
-rw-r--r--usr.sbin/makefs/makefs.h3
-rw-r--r--usr.sbin/makefs/mtree.c1051
-rw-r--r--usr.sbin/mfiutil/mfi_config.c133
-rw-r--r--usr.sbin/mfiutil/mfi_drive.c122
-rw-r--r--usr.sbin/mfiutil/mfi_evt.c23
-rw-r--r--usr.sbin/mfiutil/mfi_flash.c32
-rw-r--r--usr.sbin/mfiutil/mfi_patrol.c28
-rw-r--r--usr.sbin/mfiutil/mfi_show.c74
-rw-r--r--usr.sbin/mfiutil/mfi_volume.c14
-rw-r--r--usr.sbin/mfiutil/mfiutil.840
-rw-r--r--usr.sbin/mfiutil/mfiutil.c13
-rw-r--r--usr.sbin/mfiutil/mfiutil.h8
-rw-r--r--usr.sbin/mountd/mountd.c243
-rwxr-xr-xusr.sbin/pc-sysinstall/backend-query/enable-net.sh57
-rwxr-xr-xusr.sbin/pc-sysinstall/backend-query/test-netup.sh25
-rwxr-xr-xusr.sbin/pc-sysinstall/backend/functions-cleanup.sh4
-rwxr-xr-xusr.sbin/pc-sysinstall/backend/functions-networking.sh195
-rw-r--r--usr.sbin/pmccontrol/pmccontrol.c25
-rw-r--r--usr.sbin/pw/pw_user.c2
-rw-r--r--usr.sbin/rpc.lockd/lockd.c249
-rw-r--r--usr.sbin/rpc.statd/statd.c240
-rw-r--r--usr.sbin/rtadvd/advcap.c51
-rw-r--r--usr.sbin/rtadvd/config.c1111
-rw-r--r--usr.sbin/rtadvd/config.h10
-rw-r--r--usr.sbin/rtadvd/dump.c217
-rw-r--r--usr.sbin/rtadvd/dump.h6
-rw-r--r--usr.sbin/rtadvd/if.c113
-rw-r--r--usr.sbin/rtadvd/if.h4
-rw-r--r--usr.sbin/rtadvd/pathnames.h5
-rw-r--r--usr.sbin/rtadvd/rrenum.c192
-rw-r--r--usr.sbin/rtadvd/rrenum.h4
-rw-r--r--usr.sbin/rtadvd/rtadvd.847
-rw-r--r--usr.sbin/rtadvd/rtadvd.c1292
-rw-r--r--usr.sbin/rtadvd/rtadvd.conf3
-rw-r--r--usr.sbin/rtadvd/rtadvd.conf.5111
-rw-r--r--usr.sbin/rtadvd/rtadvd.h227
-rw-r--r--usr.sbin/rtadvd/timer.c120
-rw-r--r--usr.sbin/rtadvd/timer.h61
-rw-r--r--usr.sbin/rtsold/dump.c89
-rw-r--r--usr.sbin/rtsold/if.c58
-rw-r--r--usr.sbin/rtsold/probe.c9
-rw-r--r--usr.sbin/rtsold/rtsock.c8
-rw-r--r--usr.sbin/rtsold/rtsol.c572
-rw-r--r--usr.sbin/rtsold/rtsold.829
-rw-r--r--usr.sbin/rtsold/rtsold.c435
-rw-r--r--usr.sbin/rtsold/rtsold.h66
-rw-r--r--usr.sbin/tcpdrop/tcpdrop.c3
-rw-r--r--usr.sbin/usbdump/usbdump.810
-rw-r--r--usr.sbin/ypserv/yp_main.c2
2649 files changed, 130149 insertions, 48573 deletions
diff --git a/Makefile b/Makefile
index e28569a..61e678b 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
# kernel - buildkernel + installkernel.
# kernel-toolchain - Builds the subset of world necessary to build a kernel
# doxygen - Build API documentation of the kernel, needs doxygen.
-# update - Convenient way to update your source tree (cvs).
+# update - Convenient way to update your source tree(s).
# check-old - List obsolete directories/files/libraries.
# check-old-dirs - List obsolete directories.
# check-old-files - List obsolete files.
diff --git a/Makefile.inc1 b/Makefile.inc1
index 9ebc1e3..7fdce36 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -12,6 +12,7 @@
# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
+# -DNO_WWWUPDATE do not update www in ${MAKE} update
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
# TARGET="machine" to crossbuild world for a different machine type
@@ -904,7 +905,7 @@ doxygen:
#
# update
#
-# Update the source tree, by running cvsup and/or running cvs to update to the
+# Update the source tree(s), by running cvsup/cvs/svn to update to the
# latest copy.
#
update:
@@ -927,6 +928,9 @@ update:
.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
@${SUP} ${SUPFLAGS} ${DOCSUPFILE}
.endif
+.if defined(WWWSUPFILE) && !defined(NO_WWWUPDATE)
+ @${SUP} ${SUPFLAGS} ${WWWSUPFILE}
+.endif
.endif
.if defined(CVS_UPDATE)
@cd ${.CURDIR} ; \
diff --git a/UPDATING b/UPDATING
index 1ff9e8f..be548b5 100644
--- a/UPDATING
+++ b/UPDATING
@@ -22,9 +22,48 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
machines to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
+20110608:
+ The following sysctls and tunables are retired on x86 platforms:
+ machdep.hlt_cpus
+ machdep.hlt_logical_cpus
+ The following sysctl is retired:
+ machdep.hyperthreading_allowed
+ The sysctls were supposed to provide a way to dynamically offline and
+ online selected CPUs on x86 platforms, but the implementation has not
+ been reliable especially with SCHED_ULE scheduler.
+ machdep.hyperthreading_allowed tunable is still available to ignore
+ hyperthreading CPUs at OS level.
+ Individual CPUs can be disabled using hint.lapic.X.disabled tunable,
+ where X is an APIC ID of a CPU. Be advised, though, that disabling
+ CPUs in non-uniform fashion will result in non-uniform topology and
+ may lead to sub-optimal system performance with SCHED_ULE, which is
+ a default scheduler.
+
+20110607:
+ cpumask_t type is retired and cpuset_t is used in order to describe
+ a mask of CPUs.
+
+20110531:
+ Changes to ifconfig(8) for dynamic address family detection mandate
+ that you are running a kernel of 20110525 or later. Make sure to
+ follow the update procedure to boot a new kernel before installing
+ world.
+
20110513:
Support for sun4v architecture is officially dropped
+20110503:
+ Several KPI breaking changes have been committed to the mii(4) layer,
+ the PHY drivers and consequently some Ethernet drivers using mii(4).
+ This means that miibus.ko and the modules of the affected Ethernet
+ drivers need to be recompiled.
+
+ Note to kernel developers: Given that the OUI bit reversion problem
+ was fixed as part of these changes all mii(4) commits related to OUIs,
+ i.e. to sys/dev/mii/miidevs, PHY driver probing and vendor specific
+ handling, no longer can be merged verbatim to stable/8 and previous
+ branches.
+
20110430:
Users of the Atheros AR71xx SoC code now need to add 'device ar71xx_pci'
into their kernel configurations along with 'device pci'.
diff --git a/bin/ps/extern.h b/bin/ps/extern.h
index 4321285..7b5522d 100644
--- a/bin/ps/extern.h
+++ b/bin/ps/extern.h
@@ -70,6 +70,7 @@ void pmem(KINFO *, VARENT *);
void pri(KINFO *, VARENT *);
void printheader(void);
void priorityr(KINFO *, VARENT *);
+void egroupname(KINFO *, VARENT *);
void rgroupname(KINFO *, VARENT *);
void runame(KINFO *, VARENT *);
void rvar(KINFO *, VARENT *);
@@ -78,6 +79,7 @@ int s_cputime(KINFO *);
int s_label(KINFO *);
int s_loginclass(KINFO *);
int s_logname(KINFO *);
+int s_egroupname(KINFO *);
int s_rgroupname(KINFO *);
int s_runame(KINFO *);
int s_systime(KINFO *);
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 136d084..c446756 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -88,12 +88,19 @@ static VAR var[] = {
{"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d",
0},
{"cputime", "", "time", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
+ {"egid", "", "gid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
+ {"egroup", "", "group", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
{"emul", "EMUL", NULL, LJUST, emulname, NULL, EMULLEN, 0, CHAR,
NULL, 0},
{"etime", "ELAPSED", NULL, USER, elapsed, NULL, 12, 0, CHAR, NULL, 0},
{"etimes", "ELAPSED", NULL, USER, elapseds, NULL, 12, 0, CHAR, NULL, 0},
+ {"euid", "", "uid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
{"f", "F", NULL, 0, kvar, NULL, 8, KOFF(ki_flag), INT, "x", 0},
{"flags", "", "f", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
+ {"gid", "GID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_groups),
+ UINT, UIDFMT, 0},
+ {"group", "GROUP", NULL, LJUST, egroupname, s_egroupname,
+ USERLEN, 0, CHAR, NULL, 0},
{"ignored", "", "sigignore", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
{"inblk", "INBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG,
"ld", 0},
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 432cffa..02c6112 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -341,6 +341,22 @@ s_uname(KINFO *k)
}
void
+egroupname(KINFO *k, VARENT *ve)
+{
+ VAR *v;
+
+ v = ve->var;
+ (void)printf("%-*s", v->width,
+ group_from_gid(k->ki_p->ki_groups[0], 0));
+}
+
+int
+s_egroupname(KINFO *k)
+{
+ return (strlen(group_from_gid(k->ki_p->ki_groups[0], 0)));
+}
+
+void
rgroupname(KINFO *k, VARENT *ve)
{
VAR *v;
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 2465df3..10dd6af 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd April 18, 2011
+.Dd June 14, 2011
.Dt PS 1
.Os
.Sh NAME
@@ -502,6 +502,12 @@ elapsed running time, in decimal integer seconds
.It Cm flags
the process flags, in hexadecimal (alias
.Cm f )
+.It Cm gid
+effective group ID (alias
+.Cm egid )
+.It Cm group
+group name (from egid) (alias
+.Cm egroup )
.It Cm inblk
total blocks read (alias
.Cm inblock )
@@ -629,7 +635,8 @@ process pointer
.It Cm ucomm
name to be used for accounting
.It Cm uid
-effective user ID
+effective user ID (alias
+.Cm euid )
.It Cm upr
scheduling priority on return from system call (alias
.Cm usrpri )
diff --git a/bin/sh/TOUR b/bin/sh/TOUR
index 8448966..4b61bdf 100644
--- a/bin/sh/TOUR
+++ b/bin/sh/TOUR
@@ -27,10 +27,8 @@ programs is:
mkbuiltins builtins builtins.h builtins.c
mkinit *.c init.c
mknodes nodetypes nodes.h nodes.c
- mksignames - signames.h signames.c
mksyntax - syntax.h syntax.c
mktokens - token.h
- bltin/mkexpr unary_op binary_op operators.h operators.c
There are undoubtedly too many of these. Mkinit searches all the
C source files for entries looking like:
@@ -64,14 +62,6 @@ tion:
Preprocessor #define statements are copied to init.c without any
special action to request this.
-INDENTATION: The ash source is indented in multiples of six
-spaces. The only study that I have heard of on the subject con-
-cluded that the optimal amount to indent is in the range of four
-to six spaces. I use six spaces since it is not too big a jump
-from the widely used eight spaces. If you really hate six space
-indentation, use the adjind (source included) program to change
-it to something else.
-
EXCEPTIONS: Code for dealing with exceptions appears in
exceptions.c. The C language doesn't include exception handling,
so I implement it using setjmp and longjmp. The global variable
@@ -115,7 +105,7 @@ repeatedly parses and executes commands.
OPTIONS.C: This file contains the option processing code. It is
called from main to parse the shell arguments when the shell is
-invoked, and it also contains the set builtin. The -i and -j op-
+invoked, and it also contains the set builtin. The -i and -m op-
tions (the latter turns on job control) require changes in signal
handling. The routines setjobctl (in jobs.c) and setinteractive
(in trap.c) are called to handle changes to these options.
@@ -123,10 +113,11 @@ handling. The routines setjobctl (in jobs.c) and setinteractive
PARSING: The parser code is all in parser.c. A recursive des-
cent parser is used. Syntax tables (generated by mksyntax) are
used to classify characters during lexical analysis. There are
-three tables: one for normal use, one for use when inside single
-quotes, and one for use when inside double quotes. The tables
-are machine dependent because they are indexed by character vari-
-ables and the range of a char varies from machine to machine.
+four tables: one for normal use, one for use when inside single
+quotes and dollar single quotes, one for use when inside double
+quotes and one for use in arithmetic. The tables are machine
+dependent because they are indexed by character variables and
+the range of a char varies from machine to machine.
PARSE OUTPUT: The output of the parser consists of a tree of
nodes. The various types of nodes are defined in the file node-
@@ -242,12 +233,7 @@ The routine shellexec is the interface to the exec system call.
EXPAND.C: Arguments are processed in three passes. The first
(performed by the routine argstr) performs variable and command
substitution. The second (ifsbreakup) performs word splitting
-and the third (expandmeta) performs file name generation. If the
-"/u" directory is simulated, then when "/u/username" is replaced
-by the user's home directory, the flag "didudir" is set. This
-tells the cd command that it should print out the directory name,
-just as it would if the "/u" directory were implemented using
-symbolic links.
+and the third (expandmeta) performs file name generation.
VAR.C: Variables are stored in a hash table. Probably we should
switch to extensible hashing. The variable name is stored in the
@@ -292,14 +278,7 @@ when the program is linked into ash. This #define should appear
before bltin.h is included; bltin.h will #undef main if the pro-
gram is to be compiled stand-alone.
-CD.C: This file defines the cd and pwd builtins. The pwd com-
-mand runs /bin/pwd the first time it is invoked (unless the user
-has already done a cd to an absolute pathname), but then
-remembers the current directory and updates it when the cd com-
-mand is run, so subsequent pwd commands run very fast. The main
-complication in the cd command is in the docd command, which
-resolves symbolic links into actual names and informs the user
-where the user ended up if he crossed a symbolic link.
+CD.C: This file defines the cd and pwd builtins.
SIGNALS: Trap.c implements the trap command. The routine set-
signal figures out what action should be taken when a signal is
diff --git a/bin/sh/alias.c b/bin/sh/alias.c
index 4662519..fb0e922 100644
--- a/bin/sh/alias.c
+++ b/bin/sh/alias.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include "mystring.h"
#include "alias.h"
#include "options.h" /* XXX for argptr (should remove?) */
+#include "builtins.h"
#define ATABSIZE 39
@@ -238,7 +239,7 @@ aliascmd(int argc, char **argv)
while ((n = *++argv) != NULL) {
if ((v = strchr(n+1, '=')) == NULL) /* n+1: funny ksh stuff */
if ((ap = lookupalias(n, 0)) == NULL) {
- warning("%s not found", n);
+ warning("%s: not found", n);
ret = 1;
} else
printalias(ap);
diff --git a/bin/sh/alias.h b/bin/sh/alias.h
index 7983663..546e91a 100644
--- a/bin/sh/alias.h
+++ b/bin/sh/alias.h
@@ -43,5 +43,3 @@ struct alias {
};
struct alias *lookupalias(const char *, int);
-int aliascmd(int, char **);
-int unaliascmd(int, char **);
diff --git a/bin/sh/arith.h b/bin/sh/arith.h
index 3a7db9e..5b18bd6 100644
--- a/bin/sh/arith.h
+++ b/bin/sh/arith.h
@@ -36,4 +36,3 @@
arith_t arith(const char *);
void arith_lex_reset(void);
-int expcmd(int, char **);
diff --git a/bin/sh/arith_yacc.c b/bin/sh/arith_yacc.c
index 63f236c..f1ac59e 100644
--- a/bin/sh/arith_yacc.c
+++ b/bin/sh/arith_yacc.c
@@ -344,7 +344,7 @@ arith_t arith(const char *s)
* The exp(1) builtin.
*/
int
-expcmd(int argc, char **argv)
+letcmd(int argc, char **argv)
{
const char *p;
char *concat;
diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h
index e449673..0143b6e 100644
--- a/bin/sh/bltin/bltin.h
+++ b/bin/sh/bltin/bltin.h
@@ -43,6 +43,7 @@
#include "../mystring.h"
#ifdef SHELL
#include "../output.h"
+#include "builtins.h"
#define FILE struct output
#undef stdout
#define stdout out1
@@ -75,7 +76,4 @@ pointer stalloc(int);
void error(const char *, ...) __printf0like(1, 2);
pid_t getjobpgrp(char *);
-int echocmd(int, char **);
-int testcmd(int, char **);
-
extern char *commandname;
diff --git a/bin/sh/builtins.def b/bin/sh/builtins.def
index cfc6361..1cbeea9 100644
--- a/bin/sh/builtins.def
+++ b/bin/sh/builtins.def
@@ -60,7 +60,7 @@ echocmd echo
evalcmd -s eval
execcmd -s exec
exitcmd -s exit
-expcmd exp let
+letcmd let
exportcmd -s export -s readonly
#exprcmd expr
falsecmd false
diff --git a/bin/sh/cd.c b/bin/sh/cd.c
index 776bdba..6fb1039 100644
--- a/bin/sh/cd.c
+++ b/bin/sh/cd.c
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
#include "mystring.h"
#include "show.h"
#include "cd.h"
+#include "builtins.h"
static int cdlogical(char *);
static int cdphysical(char *);
@@ -86,6 +87,7 @@ cdcmd(int argc, char **argv)
struct stat statb;
int ch, phys, print = 0, getcwderr = 0;
int rc;
+ int errno1 = ENOENT;
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
phys = Pflag;
@@ -122,7 +124,10 @@ cdcmd(int argc, char **argv)
else
dest = ".";
}
- if (*dest == '/' || (path = bltinlookup("CDPATH", 1)) == NULL)
+ if (dest[0] == '/' ||
+ (dest[0] == '.' && (dest[1] == '/' || dest[1] == '\0')) ||
+ (dest[0] == '.' && dest[1] == '.' && (dest[2] == '/' || dest[2] == '\0')) ||
+ (path = bltinlookup("CDPATH", 1)) == NULL)
path = nullstr;
while ((p = padvance(&path, dest)) != NULL) {
if (stat(p, &statb) >= 0 && S_ISDIR(statb.st_mode)) {
@@ -138,9 +143,11 @@ cdcmd(int argc, char **argv)
rc = docd(p, print, phys);
if (rc >= 0)
return getcwderr ? rc : 0;
+ if (errno != ENOENT)
+ errno1 = errno;
}
}
- error("can't cd to %s", dest);
+ error("%s: %s", dest, strerror(errno1));
/*NOTREACHED*/
return 0;
}
diff --git a/bin/sh/cd.h b/bin/sh/cd.h
index f88ce26..91fbc2b 100644
--- a/bin/sh/cd.h
+++ b/bin/sh/cd.h
@@ -30,5 +30,3 @@
*/
void pwd_init(int);
-int cdcmd (int, char **);
-int pwdcmd(int, char **);
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index a50c53f..d5da7d3 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -140,7 +140,7 @@ evalcmd(int argc, char **argv)
STPUTC('\0', concat);
p = grabstackstr(concat);
}
- evalstring(p, builtin_flags & EV_TESTED);
+ evalstring(p, builtin_flags);
} else
exitstatus = 0;
return exitstatus;
@@ -165,7 +165,7 @@ evalstring(char *s, int flags)
setstackmark(&smark);
setinputstring(s, 1);
while ((n = parsecmd(0)) != NEOF) {
- if (n != NULL) {
+ if (n != NULL && !nflag) {
if (flags_exit && preadateof())
evaltree(n, flags | EV_EXIT);
else
@@ -386,6 +386,14 @@ evalcase(union node *n, int flags)
for (cp = n->ncase.cases ; cp && evalskip == 0 ; cp = cp->nclist.next) {
for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) {
if (casematch(patp, arglist.list->text)) {
+ while (cp->nclist.next &&
+ cp->type == NCLISTFALLTHRU) {
+ if (evalskip != 0)
+ break;
+ evaltree(cp->nclist.body,
+ flags & ~EV_EXIT);
+ cp = cp->nclist.next;
+ }
if (evalskip == 0) {
evaltree(cp->nclist.body, flags);
}
@@ -409,6 +417,7 @@ evalsubshell(union node *n, int flags)
struct job *jp;
int backgnd = (n->type == NBACKGND);
+ oexitstatus = exitstatus;
expredir(n->nredir.redirect);
if ((!backgnd && flags & EV_EXIT && !have_traps()) ||
forkshell(jp = makejob(n, 1), n, backgnd) == 0) {
@@ -436,6 +445,7 @@ evalredir(union node *n, int flags)
struct jmploc *savehandler;
volatile int in_redirect = 1;
+ oexitstatus = exitstatus;
expredir(n->nredir.redirect);
savehandler = handler;
if (setjmp(jmploc.loc)) {
@@ -478,7 +488,6 @@ expredir(union node *n)
for (redir = n ; redir ; redir = redir->nfile.next) {
struct arglist fn;
fn.lastp = &fn.list;
- oexitstatus = exitstatus;
switch (redir->type) {
case NFROM:
case NTO:
@@ -570,14 +579,8 @@ evalpipe(union node *n)
static int
is_valid_fast_cmdsubst(union node *n)
{
- union node *argp;
- if (n->type != NCMD)
- return 0;
- for (argp = n->ncmd.args ; argp ; argp = argp->narg.next)
- if (expandhassideeffects(argp->narg.text))
- return 0;
- return 1;
+ return (n->type == NCMD);
}
/*
@@ -595,6 +598,7 @@ evalbackcmd(union node *n, struct backcmd *result)
struct stackmark smark; /* unnecessary */
struct jmploc jmploc;
struct jmploc *savehandler;
+ struct localvar *savelocalvars;
setstackmark(&smark);
result->fd = -1;
@@ -607,12 +611,18 @@ evalbackcmd(union node *n, struct backcmd *result)
}
if (is_valid_fast_cmdsubst(n)) {
exitstatus = oexitstatus;
+ savelocalvars = localvars;
+ localvars = NULL;
+ forcelocal++;
savehandler = handler;
if (setjmp(jmploc.loc)) {
if (exception == EXERROR || exception == EXEXEC)
exitstatus = 2;
else if (exception != 0) {
handler = savehandler;
+ forcelocal--;
+ poplocalvars();
+ localvars = savelocalvars;
longjmp(handler->loc, 1);
}
} else {
@@ -620,6 +630,9 @@ evalbackcmd(union node *n, struct backcmd *result)
evalcommand(n, EV_BACKCMD, result);
}
handler = savehandler;
+ forcelocal--;
+ poplocalvars();
+ localvars = savelocalvars;
} else {
exitstatus = 0;
if (pipe(pip) < 0)
@@ -744,8 +757,9 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
/* Print the command if xflag is set. */
if (xflag) {
char sep = 0;
- const char *p;
- out2str(ps4val());
+ const char *p, *ps4;
+ ps4 = expandstr(ps4val());
+ out2str(ps4 != NULL ? ps4 : ps4val());
for (sp = varlist.list ; sp ; sp = sp->next) {
if (sep != 0)
out2c(' ');
@@ -880,14 +894,13 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
}
/* Fork off a child process if necessary. */
- if (cmd->ncmd.backgnd
- || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN)
+ if (((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN)
&& ((flags & EV_EXIT) == 0 || have_traps()))
|| ((flags & EV_BACKCMD) != 0
&& (cmdentry.cmdtype != CMDBUILTIN ||
!safe_builtin(cmdentry.u.index, argc, argv)))) {
jp = makejob(cmd, 1);
- mode = cmd->ncmd.backgnd;
+ mode = FORK_FG;
if (flags & EV_BACKCMD) {
mode = FORK_NOJOB;
if (pipe(pip) < 0)
@@ -902,6 +915,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
dup2(pip[1], 1);
close(pip[1]);
}
+ flags &= ~EV_BACKCMD;
}
flags |= EV_EXIT;
}
@@ -1053,8 +1067,7 @@ parent: /* parent process gets here (if we forked) */
backcmd->fd = pip[0];
close(pip[1]);
backcmd->jp = jp;
- } else
- exitstatus = 0;
+ }
out:
if (lastarg)
diff --git a/bin/sh/eval.h b/bin/sh/eval.h
index bf98782..fba6f9a 100644
--- a/bin/sh/eval.h
+++ b/bin/sh/eval.h
@@ -51,19 +51,10 @@ struct backcmd { /* result of evalbackcmd */
#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
#define EV_BACKCMD 04 /* command executing within back quotes */
-int evalcmd(int, char **);
void evalstring(char *, int);
union node; /* BLETCH for ansi C */
void evaltree(union node *, int);
void evalbackcmd(union node *, struct backcmd *);
-int bltincmd(int, char **);
-int breakcmd(int, char **);
-int returncmd(int, char **);
-int falsecmd(int, char **);
-int truecmd(int, char **);
-int execcmd(int, char **);
-int timescmd(int, char **);
-int commandcmd(int, char **);
/* in_function returns nonzero if we are currently evaluating a function */
#define in_function() funcnest
diff --git a/bin/sh/exec.h b/bin/sh/exec.h
index 392cc33..31f11c0 100644
--- a/bin/sh/exec.h
+++ b/bin/sh/exec.h
@@ -66,7 +66,6 @@ extern int exerrno; /* last exec error */
void shellexec(char **, char **, const char *, int) __dead2;
char *padvance(const char **, const char *);
-int hashcmd(int, char **);
void find_command(const char *, struct cmdentry *, int, const char *);
int find_builtin(const char *, int *);
void hashcd(void);
@@ -75,5 +74,4 @@ void addcmdentry(const char *, struct cmdentry *);
void defun(const char *, union node *);
int unsetfunc(const char *);
int typecmd_impl(int, char **, int, const char *);
-int typecmd(int, char **);
void clearcmdentry(void);
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index b3c4962..ea8d78d 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
#include <wchar.h>
+#include <wctype.h>
/*
* Routines to expand arguments to commands. We have to deal with
@@ -76,6 +77,7 @@ __FBSDID("$FreeBSD$");
#include "mystring.h"
#include "arith.h"
#include "show.h"
+#include "builtins.h"
/*
* Structure specifying which parts of the string should be searched
@@ -174,6 +176,7 @@ expandarg(union node *arg, struct arglist *arglist, int flag)
ifslastp = NULL;
argstr(arg->narg.text, flag);
if (arglist == NULL) {
+ STACKSTRNUL(expdest);
return; /* here document expanded */
}
STPUTC('\0', expdest);
@@ -761,7 +764,8 @@ again: /* jump here after setting a variable with ${var=text} */
break;
record:
recordregion(startloc, expdest - stackblock(),
- varflags & VSQUOTE);
+ varflags & VSQUOTE || (ifsset() && ifsval()[0] == '\0' &&
+ (*var == '@' || *var == '*')));
break;
case VSPLUS:
@@ -947,7 +951,9 @@ numvar:
sep = ' ';
for (ap = shellparam.p ; (p = *ap++) != NULL ; ) {
strtodest(p, flag, subtype, quoted);
- if (*ap && sep)
+ if (!*ap)
+ break;
+ if (sep || (flag & EXP_FULL && !quoted && **ap != '\0'))
STPUTC(sep, expdest);
}
break;
@@ -1396,13 +1402,43 @@ get_wc(const char **p)
/*
+ * See if a character matches a character class, starting at the first colon
+ * of "[:class:]".
+ * If a valid character class is recognized, a pointer to the next character
+ * after the final closing bracket is stored into *end, otherwise a null
+ * pointer is stored into *end.
+ */
+static int
+match_charclass(const char *p, wchar_t chr, const char **end)
+{
+ char name[20];
+ const char *nameend;
+ wctype_t cclass;
+
+ *end = NULL;
+ p++;
+ nameend = strstr(p, ":]");
+ if (nameend == NULL || nameend - p >= sizeof(name) || nameend == p)
+ return 0;
+ memcpy(name, p, nameend - p);
+ name[nameend - p] = '\0';
+ *end = nameend + 2;
+ cclass = wctype(name);
+ /* An unknown class matches nothing but is valid nevertheless. */
+ if (cclass == 0)
+ return 0;
+ return iswctype(chr, cclass);
+}
+
+
+/*
* Returns true if the pattern matches the string.
*/
int
patmatch(const char *pattern, const char *string, int squoted)
{
- const char *p, *q;
+ const char *p, *q, *end;
char c;
wchar_t wc, wc2;
@@ -1426,7 +1462,7 @@ patmatch(const char *pattern, const char *string, int squoted)
if (localeisutf8)
wc = get_wc(&q);
else
- wc = *q++;
+ wc = (unsigned char)*q++;
if (wc == '\0')
return 0;
break;
@@ -1483,13 +1519,18 @@ patmatch(const char *pattern, const char *string, int squoted)
if (localeisutf8)
chr = get_wc(&q);
else
- chr = *q++;
+ chr = (unsigned char)*q++;
if (chr == '\0')
return 0;
c = *p++;
do {
if (c == CTLQUOTEMARK)
continue;
+ if (c == '[' && *p == ':') {
+ found |= match_charclass(p, chr, &end);
+ if (end != NULL)
+ p = end;
+ }
if (c == CTLESC)
c = *p++;
if (localeisutf8 && c & 0x80) {
@@ -1498,7 +1539,7 @@ patmatch(const char *pattern, const char *string, int squoted)
if (wc == 0) /* bad utf-8 */
return 0;
} else
- wc = c;
+ wc = (unsigned char)c;
if (*p == '-' && p[1] != ']') {
p++;
while (*p == CTLQUOTEMARK)
@@ -1510,7 +1551,7 @@ patmatch(const char *pattern, const char *string, int squoted)
if (wc2 == 0) /* bad utf-8 */
return 0;
} else
- wc2 = *p++;
+ wc2 = (unsigned char)*p++;
if ( collate_range_cmp(chr, wc) >= 0
&& collate_range_cmp(chr, wc2) <= 0
)
@@ -1617,78 +1658,6 @@ cvtnum(int num, char *buf)
}
/*
- * Check statically if expanding a string may have side effects.
- */
-int
-expandhassideeffects(const char *p)
-{
- int c;
- int arinest;
-
- arinest = 0;
- while ((c = *p++) != '\0') {
- switch (c) {
- case CTLESC:
- p++;
- break;
- case CTLVAR:
- c = *p++;
- /* Expanding $! sets the job to remembered. */
- if (*p == '!')
- return 1;
- if ((c & VSTYPE) == VSASSIGN)
- return 1;
- /*
- * If we are in arithmetic, the parameter may contain
- * '=' which may cause side effects. Exceptions are
- * the length of a parameter and $$, $# and $? which
- * are always numeric.
- */
- if ((c & VSTYPE) == VSLENGTH) {
- while (*p != '=')
- p++;
- p++;
- break;
- }
- if ((*p == '$' || *p == '#' || *p == '?') &&
- p[1] == '=') {
- p += 2;
- break;
- }
- if (arinest > 0)
- return 1;
- break;
- case CTLBACKQ:
- case CTLBACKQ | CTLQUOTE:
- if (arinest > 0)
- return 1;
- break;
- case CTLARI:
- arinest++;
- break;
- case CTLENDARI:
- arinest--;
- break;
- case '=':
- if (*p == '=') {
- /* Allow '==' operator. */
- p++;
- continue;
- }
- if (arinest > 0)
- return 1;
- break;
- case '!': case '<': case '>':
- /* Allow '!=', '<=', '>=' operators. */
- if (*p == '=')
- p++;
- break;
- }
- }
- return 0;
-}
-
-/*
* Do most of the work for wordexp(3).
*/
diff --git a/bin/sh/expand.h b/bin/sh/expand.h
index be08dec..5029552 100644
--- a/bin/sh/expand.h
+++ b/bin/sh/expand.h
@@ -63,5 +63,3 @@ void expari(int);
int patmatch(const char *, const char *, int);
void rmescapes(char *);
int casematch(union node *, const char *);
-int expandhassideeffects(const char *);
-int wordexpcmd(int, char **);
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
index 7ebe5d8..4619baf 100644
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include "error.h"
#include "eval.h"
#include "memalloc.h"
+#include "builtins.h"
#define MAXHISTLOOPS 4 /* max recursions through fc */
#define DEFEDITOR "ed" /* default editor *should* be $EDITOR */
diff --git a/bin/sh/input.c b/bin/sh/input.c
index e7baed3..c8b1a45 100644
--- a/bin/sh/input.c
+++ b/bin/sh/input.c
@@ -403,7 +403,7 @@ setinputfile(const char *fname, int push)
INTOFF;
if ((fd = open(fname, O_RDONLY)) < 0)
- error("Can't open %s: %s", fname, strerror(errno));
+ error("cannot open %s: %s", fname, strerror(errno));
if (fd < 10) {
fd2 = fcntl(fd, F_DUPFD, 10);
close(fd);
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index f4f1dac..75b503e 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$");
#include "memalloc.h"
#include "error.h"
#include "mystring.h"
+#include "var.h"
+#include "builtins.h"
static struct job *jobtab; /* array of jobs */
@@ -798,6 +800,7 @@ forkshell(struct job *jp, union node *n, int mode)
handler = &main_handler;
closescript();
INTON;
+ forcelocal = 0;
clear_traps();
#if JOBS
jobctl = 0; /* do job control only in root shell */
@@ -820,7 +823,7 @@ forkshell(struct job *jp, union node *n, int mode)
! fd0_redirected_p ()) {
close(0);
if (open(_PATH_DEVNULL, O_RDONLY) != 0)
- error("Can't open %s: %s",
+ error("cannot open %s: %s",
_PATH_DEVNULL, strerror(errno));
}
}
@@ -832,7 +835,7 @@ forkshell(struct job *jp, union node *n, int mode)
! fd0_redirected_p ()) {
close(0);
if (open(_PATH_DEVNULL, O_RDONLY) != 0)
- error("Can't open %s: %s",
+ error("cannot open %s: %s",
_PATH_DEVNULL, strerror(errno));
}
}
@@ -1121,7 +1124,7 @@ backgndpidset(void)
pid_t
backgndpidval(void)
{
- if (bgjob != NULL)
+ if (bgjob != NULL && !forcelocal)
bgjob->remembered = 1;
return backgndpid;
}
diff --git a/bin/sh/jobs.h b/bin/sh/jobs.h
index 8bc1082..5e9d70d 100644
--- a/bin/sh/jobs.h
+++ b/bin/sh/jobs.h
@@ -88,12 +88,7 @@ extern int in_dowait; /* are we in dowait()? */
extern volatile sig_atomic_t breakwaitcmd; /* break wait to process traps? */
void setjobctl(int);
-int fgcmd(int, char **);
-int bgcmd(int, char **);
-int jobscmd(int, char **);
void showjobs(int, int);
-int waitcmd(int, char **);
-int jobidcmd(int, char **);
struct job *makejob(union node *, int);
pid_t forkshell(struct job *, union node *, int);
int waitforjob(struct job *, int *);
diff --git a/bin/sh/main.c b/bin/sh/main.c
index 408d37c..e6c8a20 100644
--- a/bin/sh/main.c
+++ b/bin/sh/main.c
@@ -72,13 +72,14 @@ __FBSDID("$FreeBSD$");
#include "mystring.h"
#include "exec.h"
#include "cd.h"
+#include "builtins.h"
int rootpid;
int rootshell;
struct jmploc main_handler;
int localeisutf8, initial_localeisutf8;
-static void read_profile(const char *);
+static void read_profile(char *);
static char *find_dot_file(char *);
/*
@@ -92,7 +93,7 @@ static char *find_dot_file(char *);
int
main(int argc, char *argv[])
{
- struct stackmark smark;
+ struct stackmark smark, smark2;
volatile int state;
char *shinit;
@@ -139,6 +140,7 @@ main(int argc, char *argv[])
rootshell = 1;
init();
setstackmark(&smark);
+ setstackmark(&smark2);
procargs(argc, argv);
pwd_init(iflag);
if (iflag)
@@ -149,7 +151,7 @@ main(int argc, char *argv[])
state1:
state = 2;
if (privileged == 0)
- read_profile(".profile");
+ read_profile("${HOME-}/.profile");
else
read_profile("/etc/suid_profile");
}
@@ -163,6 +165,7 @@ state2:
}
state3:
state = 4;
+ popstackmark(&smark2);
if (minusc) {
evalstring(minusc, sflag ? 0 : EV_EXIT);
}
@@ -235,12 +238,16 @@ cmdloop(int top)
*/
static void
-read_profile(const char *name)
+read_profile(char *name)
{
int fd;
+ const char *expandedname;
+ expandedname = expandstr(name);
+ if (expandedname == NULL)
+ return;
INTOFF;
- if ((fd = open(name, O_RDONLY)) >= 0)
+ if ((fd = open(expandedname, O_RDONLY)) >= 0)
setinputfd(fd, 1);
INTON;
if (fd < 0)
@@ -264,7 +271,7 @@ readcmdfile(const char *name)
if ((fd = open(name, O_RDONLY)) >= 0)
setinputfd(fd, 1);
else
- error("Can't open %s: %s", name, strerror(errno));
+ error("cannot open %s: %s", name, strerror(errno));
INTON;
cmdloop(0);
popfile();
diff --git a/bin/sh/main.h b/bin/sh/main.h
index c5e8bfd3..6d4cc4a 100644
--- a/bin/sh/main.h
+++ b/bin/sh/main.h
@@ -39,5 +39,3 @@ extern struct jmploc main_handler; /* top level exception handler */
void readcmdfile(const char *);
void cmdloop(int);
-int dotcmd(int, char **);
-int exitcmd(int, char **);
diff --git a/bin/sh/mkbuiltins b/bin/sh/mkbuiltins
index b78729a..49af058 100755
--- a/bin/sh/mkbuiltins
+++ b/bin/sh/mkbuiltins
@@ -58,9 +58,7 @@ cat <<\!
!
awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \
print $0}' builtins.def | sed 's/-[hj]//' > $temp
-awk '{ printf "int %s(int, char **);\n", $1}' $temp
-echo '
-int (*const builtinfunc[])(int, char **) = {'
+echo 'int (*const builtinfunc[])(int, char **) = {'
awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp
echo '};
@@ -94,5 +92,7 @@ struct builtincmd {
};
extern int (*const builtinfunc[])(int, char **);
-extern const struct builtincmd builtincmd[];'
+extern const struct builtincmd builtincmd[];
+'
+awk '{ printf "int %s(int, char **);\n", $1}' $temp
rm -f $temp
diff --git a/bin/sh/mktokens b/bin/sh/mktokens
index b85c8cb9..82d7cd7 100644
--- a/bin/sh/mktokens
+++ b/bin/sh/mktokens
@@ -50,6 +50,7 @@ TPIPE 0 "|"
TLP 0 "("
TRP 1 ")"
TENDCASE 1 ";;"
+TFALLTHRU 1 ";&"
TREDIR 0 redirection
TWORD 0 word
TIF 0 "if"
diff --git a/bin/sh/myhistedit.h b/bin/sh/myhistedit.h
index bc9fd4e..9a649ec 100644
--- a/bin/sh/myhistedit.h
+++ b/bin/sh/myhistedit.h
@@ -39,8 +39,6 @@ extern int displayhist;
void histedit(void);
void sethistsize(const char *);
void setterm(const char *);
-int histcmd(int, char **);
int not_fcnumber(const char *);
int str_to_event(const char *, int);
-int bindcmd(int, char **);
diff --git a/bin/sh/nodetypes b/bin/sh/nodetypes
index e1e1b04..ae4bc4a 100644
--- a/bin/sh/nodetypes
+++ b/bin/sh/nodetypes
@@ -56,7 +56,6 @@ NSEMI nbinary # two commands separated by a semicolon
NCMD ncmd # a simple command
type int
- backgnd int # set to run command in background
args nodeptr # the arguments
redirect nodeptr # list of file redirections
@@ -96,12 +95,13 @@ NCASE ncase # a case statement
expr nodeptr # the word to switch on
cases nodeptr # the list of cases (NCLIST nodes)
-NCLIST nclist # a case
+NCLIST nclist # a case ending with ;;
type int
next nodeptr # the next case in list
pattern nodeptr # list of patterns for this case
body nodeptr # code to execute for this case
+NCLISTFALLTHRU nclist # a case ending with ;&
NDEFUN narg # define a function. The "next" field contains
# the body of the function.
diff --git a/bin/sh/options.c b/bin/sh/options.c
index a99fe81..9104e93 100644
--- a/bin/sh/options.c
+++ b/bin/sh/options.c
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include "memalloc.h"
#include "error.h"
#include "mystring.h"
+#include "builtins.h"
#ifndef NO_HISTORY
#include "myhistedit.h"
#endif
@@ -83,6 +84,7 @@ void
procargs(int argc, char **argv)
{
int i;
+ char *scriptname;
argptr = argv;
if (argc > 0)
@@ -105,8 +107,9 @@ procargs(int argc, char **argv)
optlist[i].val = 0;
arg0 = argv[0];
if (sflag == 0 && minusc == NULL) {
- commandname = arg0 = *argptr++;
- setinputfile(commandname, 0);
+ scriptname = *argptr++;
+ setinputfile(scriptname, 0);
+ commandname = arg0 = scriptname;
}
/* POSIX 1003.2: first arg after -c cmd is $0, remainder $1... */
if (argptr && minusc && *argptr)
diff --git a/bin/sh/options.h b/bin/sh/options.h
index 5004549..acc2a11 100644
--- a/bin/sh/options.h
+++ b/bin/sh/options.h
@@ -62,8 +62,9 @@ struct shparam {
#define privileged optlist[15].val
#define Tflag optlist[16].val
#define Pflag optlist[17].val
+#define hflag optlist[18].val
-#define NOPTS 18
+#define NOPTS 19
struct optent {
const char *name;
@@ -91,6 +92,7 @@ struct optent optlist[NOPTS] = {
{ "privileged", 'p', 0 },
{ "trapsasync", 'T', 0 },
{ "physical", 'P', 0 },
+ { "trackall", 'h', 0 },
};
#else
extern struct optent optlist[NOPTS];
@@ -108,8 +110,5 @@ void procargs(int, char **);
void optschanged(void);
void setparam(char **);
void freeparam(struct shparam *);
-int shiftcmd(int, char **);
-int setcmd(int, char **);
-int getoptscmd(int, char **);
int nextopt(const char *);
void getoptsreset(const char *);
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 151970b..ef1aa36 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -240,8 +240,8 @@ list(int nlflag, int erflag)
n2 = andor();
tok = readtoken();
if (tok == TBACKGND) {
- if (n2->type == NCMD || n2->type == NPIPE) {
- n2->ncmd.backgnd = 1;
+ if (n2->type == NPIPE) {
+ n2->npipe.backgnd = 1;
} else if (n2->type == NREDIR) {
n2->type = NBACKGND;
} else {
@@ -542,10 +542,13 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
checkkwd = CHKNL | CHKKWD | CHKALIAS;
if ((t = readtoken()) != TESAC) {
- if (t != TENDCASE)
- synexpect(TENDCASE);
+ if (t == TENDCASE)
+ ;
+ else if (t == TFALLTHRU)
+ cp->type = NCLISTFALLTHRU;
else
- checkkwd = CHKNL | CHKKWD, readtoken();
+ synexpect(TENDCASE);
+ checkkwd = CHKNL | CHKKWD, readtoken();
}
cpp = &cp->nclist.next;
}
@@ -686,7 +689,6 @@ simplecmd(union node **rpp, union node *redir)
*rpp = NULL;
n = (union node *)stalloc(sizeof (struct ncmd));
n->type = NCMD;
- n->ncmd.backgnd = 0;
n->ncmd.args = args;
n->ncmd.redirect = redir;
return n;
@@ -931,8 +933,11 @@ xxreadtoken(void)
pungetc();
RETURN(TPIPE);
case ';':
- if (pgetc() == ';')
+ c = pgetc();
+ if (c == ';')
RETURN(TENDCASE);
+ else if (c == '&')
+ RETURN(TFALLTHRU);
pungetc();
RETURN(TSEMI);
case '(':
@@ -2029,3 +2034,47 @@ getprompt(void *unused __unused)
ps[i] = '\0';
return (ps);
}
+
+
+const char *
+expandstr(char *ps)
+{
+ union node n;
+ struct jmploc jmploc;
+ struct jmploc *const savehandler = handler;
+ const int saveprompt = doprompt;
+ struct parsefile *const savetopfile = getcurrentfile();
+ struct parser_temp *const saveparser_temp = parser_temp;
+ const char *result = NULL;
+
+ if (!setjmp(jmploc.loc)) {
+ handler = &jmploc;
+ parser_temp = NULL;
+ setinputstring(ps, 1);
+ doprompt = 0;
+ readtoken1(pgetc(), DQSYNTAX, "\n\n", 0);
+ if (backquotelist != NULL)
+ error("Command substitution not allowed here");
+
+ n.narg.type = NARG;
+ n.narg.next = NULL;
+ n.narg.text = wordtext;
+ n.narg.backquote = backquotelist;
+
+ expandarg(&n, NULL, 0);
+ result = stackblock();
+ INTOFF;
+ }
+ handler = savehandler;
+ doprompt = saveprompt;
+ popfilesupto(savetopfile);
+ if (parser_temp != saveparser_temp) {
+ parser_temp_free_all();
+ parser_temp = saveparser_temp;
+ }
+ if (result != NULL) {
+ INTON;
+ } else if (exception == EXINT)
+ raise(SIGINT);
+ return result;
+}
diff --git a/bin/sh/parser.h b/bin/sh/parser.h
index e213e21..9a996d0 100644
--- a/bin/sh/parser.h
+++ b/bin/sh/parser.h
@@ -82,3 +82,4 @@ void fixredir(union node *, const char *, int);
int goodname(const char *);
int isassignment(const char *);
char *getprompt(void *);
+const char *expandstr(char *);
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index 42e55d3..e318216 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
-.Dd May 21, 2011
+.Dd June 18, 2011
.Dt SH 1
.Os
.Sh NAME
@@ -124,8 +124,8 @@ If the environment variable
.Ev ENV
is set on entry to a shell, or is set in the
.Pa .profile
-of a login shell, the shell then reads commands from the file named in
-.Ev ENV .
+of a login shell, the shell then subjects its value to parameter expansion
+and arithmetic expansion and reads commands from the named file.
Therefore, a user should place commands that are to be executed only
at login time in the
.Pa .profile
@@ -241,6 +241,10 @@ tested, all commands of the function are considered to be tested as
well.
.It Fl f Li noglob
Disable pathname expansion.
+.It Fl h Li trackall
+A do-nothing option for
+.Tn POSIX
+compliance.
.It Fl I Li ignoreeof
Ignore
.Dv EOF Ap s
@@ -324,7 +328,7 @@ Useful for debugging.
Write each command
(preceded by the value of the
.Va PS4
-variable)
+variable subjected to parameter expansion and arithmetic expansion)
to standard error before it is executed.
Useful for debugging.
.El
@@ -372,7 +376,7 @@ The following is a list of valid operators:
.It Control operators:
.Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
.It Li & Ta Li && Ta Li ( Ta Li ) Ta Li \en
-.It Li ;; Ta Li ; Ta Li | Ta Li ||
+.It Li ;; Ta Li ;& Ta Li ; Ta Li | Ta Li ||
.El
.It Redirection operators:
.Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact
@@ -990,6 +994,11 @@ described later),
separated by
.Ql \&|
characters.
+If the selected list is terminated by the control operator
+.Ql ;&
+instead of
+.Ql ;; ,
+execution continues with the next list.
The exit code of the
.Ic case
command is the exit code of the last command executed in the list or
@@ -1536,10 +1545,7 @@ except that the built-in commands
and
.Ic trap
return information about the main shell environment
-if they are the only command in a command substitution
-and the substitutions in the command cannot cause side effects
-(such as from assigning values to variables or referencing
-.Li $! ).
+if they are the only command in a command substitution.
.Ss Arithmetic Expansion
Arithmetic expansion provides a mechanism for evaluating an arithmetic
expression and substituting its value.
@@ -1651,6 +1657,15 @@ matches a
rather than introducing a character class.
A character class matches any of the characters between the square brackets.
A range of characters may be specified using a minus sign.
+A named class of characters (see
+.Xr wctype 3 )
+may be specified by surrounding the name with
+.Ql \&[:
+and
+.Ql :\&] .
+For example,
+.Ql \&[\&[:alpha:\&]\&]
+is a shell pattern that matches a single letter.
The character class may be complemented by making an exclamation point
.Pq Ql !\&
the first character of the character class.
@@ -2575,6 +2590,7 @@ will return the argument.
.Xr execve 2 ,
.Xr getrlimit 2 ,
.Xr umask 2 ,
+.Xr wctype 3 ,
.Xr editrc 5
.Sh HISTORY
A
diff --git a/bin/sh/trap.c b/bin/sh/trap.c
index aaa4753..2b6d8a5 100644
--- a/bin/sh/trap.c
+++ b/bin/sh/trap.c
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
#include "error.h"
#include "trap.h"
#include "mystring.h"
+#include "builtins.h"
#include "myhistedit.h"
diff --git a/bin/sh/trap.h b/bin/sh/trap.h
index d8686ce..bf1250a 100644
--- a/bin/sh/trap.h
+++ b/bin/sh/trap.h
@@ -37,7 +37,6 @@ extern int pendingsigs;
extern int in_dotrap;
extern volatile sig_atomic_t gotwinch;
-int trapcmd(int, char **);
void clear_traps(void);
int have_traps(void);
void setsignal(int);
diff --git a/bin/sh/var.c b/bin/sh/var.c
index f6d7fb1..b3bc6f7f 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
#include "error.h"
#include "mystring.h"
#include "parser.h"
+#include "builtins.h"
#ifndef NO_HISTORY
#include "myhistedit.h"
#endif
@@ -94,6 +95,8 @@ struct var vps4;
struct var vvers;
static struct var voptind;
+int forcelocal;
+
static const struct varinit varinit[] = {
#ifndef NO_HISTORY
{ &vhistsize, VUNSET, "HISTSIZE=",
@@ -325,6 +328,8 @@ setvareq(char *s, int flags)
if (aflag)
flags |= VEXPORT;
+ if (forcelocal && !(flags & (VNOSET | VNOLOCAL)))
+ mklocal(s);
vp = find_var(s, &vpp, &nlen);
if (vp != NULL) {
if (vp->flags & VREADONLY)
@@ -607,6 +612,12 @@ showvarscmd(int argc __unused, char **argv __unused)
qsort(vars, n, sizeof(*vars), var_compare);
for (i = 0; i < n; i++) {
+ /*
+ * Skip improper variable names so the output remains usable as
+ * shell input.
+ */
+ if (!isassignment(vars[i]))
+ continue;
s = strchr(vars[i], '=');
s++;
outbin(vars[i], s - vars[i], out1);
@@ -678,6 +689,13 @@ exportcmd(int argc, char **argv)
for (vp = *vpp ; vp ; vp = vp->next) {
if (vp->flags & flag) {
if (values) {
+ /*
+ * Skip improper variable names
+ * so the output remains usable
+ * as shell input.
+ */
+ if (!isassignment(vp->text))
+ continue;
out1str(cmdname);
out1c(' ');
}
@@ -740,9 +758,9 @@ mklocal(char *name)
vp = find_var(name, &vpp, NULL);
if (vp == NULL) {
if (strchr(name, '='))
- setvareq(savestr(name), VSTRFIXED);
+ setvareq(savestr(name), VSTRFIXED | VNOLOCAL);
else
- setvar(name, NULL, VSTRFIXED);
+ setvar(name, NULL, VSTRFIXED | VNOLOCAL);
vp = *vpp; /* the new variable */
lvp->text = NULL;
lvp->flags = VUNSET;
@@ -751,7 +769,7 @@ mklocal(char *name)
lvp->flags = vp->flags;
vp->flags |= VSTRFIXED|VTEXTFIXED;
if (name[vp->name_len] == '=')
- setvareq(savestr(name), 0);
+ setvareq(savestr(name), VNOLOCAL);
}
}
lvp->vp = vp;
diff --git a/bin/sh/var.h b/bin/sh/var.h
index ff21c7d..347c377 100644
--- a/bin/sh/var.h
+++ b/bin/sh/var.h
@@ -46,6 +46,7 @@
#define VUNSET 0x20 /* the variable is not set */
#define VNOFUNC 0x40 /* don't call the callback function */
#define VNOSET 0x80 /* do not set variable - just readonly test */
+#define VNOLOCAL 0x100 /* ignore forcelocal */
struct var {
@@ -68,6 +69,7 @@ struct localvar {
struct localvar *localvars;
+extern int forcelocal;
extern struct var vifs;
extern struct var vmail;
@@ -121,11 +123,7 @@ void updatecharset(void);
void initcharset(void);
char **environment(void);
int showvarscmd(int, char **);
-int exportcmd(int, char **);
-int localcmd(int, char **);
void mklocal(char *);
void poplocalvars(void);
-int setvarcmd(int, char **);
-int unsetcmd(int, char **);
int unsetvar(const char *);
int setvarsafe(const char *, const char *, int);
diff --git a/cddl/compat/opensolaris/include/assert.h b/cddl/compat/opensolaris/include/assert.h
index 353f0c9..0887093 100644
--- a/cddl/compat/opensolaris/include/assert.h
+++ b/cddl/compat/opensolaris/include/assert.h
@@ -43,6 +43,10 @@
#include <stdio.h>
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static __inline void
__assert(const char *expr, const char *file, int line)
{
@@ -52,4 +56,9 @@ __assert(const char *expr, const char *file, int line)
abort();
/* NOTREACHED */
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_ASSERT_H_ */
diff --git a/cddl/compat/opensolaris/misc/fsshare.c b/cddl/compat/opensolaris/misc/fsshare.c
index e8faa92..c3247f9 100644
--- a/cddl/compat/opensolaris/misc/fsshare.c
+++ b/cddl/compat/opensolaris/misc/fsshare.c
@@ -223,6 +223,7 @@ out:
error = errno;
unlink(tmpfile);
} else {
+ fflush(newfd);
/*
* Send SIGHUP to mountd, but unlock exports file later.
*/
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
index f4eadbc..ea4607f 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
@@ -45,6 +45,7 @@
#include <assert.h>
#include <libgen.h>
#include <limits.h>
+#include <stdint.h>
#include <dt_impl.h>
@@ -811,15 +812,14 @@ dt_basename(char *str)
ulong_t
dt_popc(ulong_t x)
{
-#ifdef _ILP32
+#if defined(_ILP32)
x = x - ((x >> 1) & 0x55555555UL);
x = (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL);
x = (x + (x >> 4)) & 0x0F0F0F0FUL;
x = x + (x >> 8);
x = x + (x >> 16);
return (x & 0x3F);
-#endif
-#ifdef _LP64
+#elif defined(_LP64)
x = x - ((x >> 1) & 0x5555555555555555ULL);
x = (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL);
x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL;
@@ -827,6 +827,8 @@ dt_popc(ulong_t x)
x = x + (x >> 16);
x = x + (x >> 32);
return (x & 0x7F);
+#else
+/* This should be a #warning but for now ignore error. Err: "need td_popc() implementation" */
#endif
}
@@ -958,7 +960,7 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_t pid,
P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE, 0);
if (P == NULL) {
- (void) snprintf(c, sizeof (c), "0x%llx", addr);
+ (void) snprintf(c, sizeof (c), "0x%jx", (uintmax_t)addr);
return (dt_string2str(c, str, nbytes));
}
@@ -976,10 +978,10 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_t pid,
(void) snprintf(c, sizeof (c), "%s`%s", obj, name);
}
} else if (Pobjname(P, addr, objname, sizeof (objname)) != 0) {
- (void) snprintf(c, sizeof (c), "%s`0x%llx",
- dt_basename(objname), addr);
+ (void) snprintf(c, sizeof (c), "%s`0x%jx",
+ dt_basename(objname), (uintmax_t)addr);
} else {
- (void) snprintf(c, sizeof (c), "0x%llx", addr);
+ (void) snprintf(c, sizeof (c), "0x%jx", (uintmax_t)addr);
}
dt_proc_unlock(dtp, P);
diff --git a/contrib/bind9/CHANGES b/contrib/bind9/CHANGES
index edf2c89..cd744c6 100644
--- a/contrib/bind9/CHANGES
+++ b/contrib/bind9/CHANGES
@@ -1,3 +1,16 @@
+ --- 9.6-ESV-R4-P1 released ---
+
+3121. [security] An authoritative name server sending a negative
+ response containing a very large RRset could
+ trigger an off-by-one error in the ncache code
+ and crash named. [RT #24650]
+
+3120. [bug] Named could fail to validate zones listed in a DLV
+ that validated insecure without using DLV and had
+ DS records in the parent zone. [RT #24631]
+
+ --- 9.6-ESV-R4 released ---
+
--- 9.6.3 released ---
3009. [bug] clients-per-query code didn't work as expected with
@@ -50,51 +63,9 @@
wrong lock which could lead to server deadlock.
[RT #22614]
-2972. [bug] win32: address windows socket errors. [RT #21906]
-
-2971. [bug] Fixed a bug that caused journal files not to be
- compacted on Windows systems as a result of
- non-POSIX-compliant rename() semantics. [RT #22434]
-
-2970. [security] Adding a NO DATA negative cache entry failed to clear
- any matching RRSIG records. A subsequent lookup of
- of NO DATA cache entry could trigger a INSIST when the
- unexpected RRSIG was also returned with the NO DATA
- cache entry.
-
- CVE-2010-3613, VU#706148. [RT #22288]
-
-2969. [security] Fix acl type processing so that allow-query works
- in options and view statements. Also add a new
- set of tests to verify proper functioning.
-
- CVE-2010-3615, VU#510208. [RT #22418]
-
-2968. [security] Named could fail to prove a data set was insecure
- before marking it as insecure. One set of conditions
- that can trigger this occurs naturally when rolling
- DNSKEY algorithms.
-
- CVE-2010-3614, VU#837744. [RT #22309]
-
-2967. [bug] 'host -D' now turns on debugging messages earlier.
- [RT #22361]
-
-2966. [bug] isc_print_vsnprintf() failed to check if there was
- space available in the buffer when adding a left
- justified character with a non zero width,
- (e.g. "%-1c"). [RT #22270]
-
2965. [func] Test HMAC functions using test data from RFC 2104 and
RFC 4634. [RT #21702]
-2964. [bug] view->queryacl was being overloaded. Seperate the
- usage into view->queryacl, view->cacheacl and
- view->queryonacl. [RT #22114]
-
-2962. [port] win32: add more dependencies to BINDBuild.dsw.
- [RT #22062]
-
2960. [func] Check that named accepts non-authoritative answers.
[RT #21594]
@@ -114,13 +85,6 @@
exact match" message when returning a wildcard
no data response. [RT #21744]
-2952. [port] win32: named-checkzone and named-checkconf failed
- to initialise winsock. [RT #21932]
-
-2951. [bug] named failed to generate a correct signed response
- in a optout, delegation only zone with no secure
- delegations. [RT #22007]
-
2950. [bug] named failed to perform a SOA up to date check when
falling back to TCP on UDP timeouts when
ixfr-from-differences was set. [RT #21595]
@@ -139,27 +103,6 @@
2941. [bug] sdb and sdlz (dlz's zone database) failed to support
DNAME at the zone apex. [RT #21610]
-2939. [func] Check that named successfully skips NSEC3 records
- that fail to match the NSEC3PARAM record currently
- in use. [RT# 21868]
-
-2937. [bug] Worked around an apparent race condition in over
- memory conditions. Without this fix a DNS cache DB or
- ADB could incorrectly stay in an over memory state,
- effectively refusing further caching, which
- subsequently made a BIND 9 caching server unworkable.
- This fix prevents this problem from happening by
- polling the state of the memory context, rather than
- making a copy of the state, which appeared to cause
- a race. This is a "workaround" in that it doesn't
- solve the possible race per se, but several experiments
- proved this change solves the symptom. Also, the
- polling overhead hasn't been reported to be an issue.
- This bug should only affect a caching server that
- specifies a finite max-cache-size. It's also quite
- likely that the bug happens only when enabling threads,
- but it's not confirmed yet. [RT #21818]
-
2935. [bug] nsupdate: improve 'file not found' error message.
[RT #21871]
@@ -189,17 +132,11 @@
smaller)
[RT #19737]
-2925. [bug] Named failed to accept uncachable negative responses
- from insecure zones. [RT# 21555]
-
2923. [bug] 'dig +trace' could drop core after "connection
timeout". [RT #21514]
2922. [contrib] Update zkt to version 1.0.
-2921. [bug] The resolver could attempt to destroy a fetch context
- too soon. [RT #19878]
-
2918. [maint] Add AAAA address for I.ROOT-SERVERS.NET.
2916. [func] Add framework to use IPv6 in tests.
@@ -229,10 +166,6 @@
2901. [port] Use AC_C_FLEXIBLE_ARRAY_MEMBER. [RT #21316]
-2900. [bug] The placeholder negative caching element was not
- properly constructed triggering a INSIST in
- dns_ncache_towire(). [RT #21346]
-
2899. [port] win32: Support linking against OpenSSL 1.0.0.
2898. [bug] nslookup leaked memory when -domain=value was
@@ -243,9 +176,6 @@
2891. [maint] Update empty-zones list to match
draft-ietf-dnsop-default-local-zones-13. [RT# 21099]
-2890. [bug] Handle the introduction of new trusted-keys and
- DS, DLV RRsets better. [RT #21097]
-
2889. [bug] Elements of the grammar where not properly reported.
[RT #21046]
@@ -272,9 +202,6 @@
2877. [bug] The validator failed to skip obviously mismatching
RRSIGs. [RT #21138]
-2876. [bug] Named could return SERVFAIL for negative responses
- from unsigned zones. [RT #21131]
-
2875. [bug] dns_time64_fromtext() could accept non digits.
[RT #21033]
@@ -284,9 +211,6 @@
2870. [maint] Add AAAA address for L.ROOT-SERVERS.NET.
-2869. [bug] Fix arguments to dns_keytable_findnextkeynode() call.
- [RT #20877]
-
2868. [cleanup] Run "make clean" at the end of configure to ensure
any changes made by configure are integrated.
Use --with-make-clean=no to disable. [RT #20994]
@@ -322,11 +246,108 @@
2853. [bug] add_sigs() could run out of scratch space. [RT #21015]
-2852. [bug] Handle broken DNSSEC trust chains better. [RT #15619]
-
2851. [doc] nslookup.1, removed <informalexample> from the docbook
source as it produced bad nroff. [RT #21007]
+ --- 9.6-ESV-R3 released ---
+
+2972. [bug] win32: address windows socket errors. [RT #21906]
+
+2971. [bug] Fixed a bug that caused journal files not to be
+ compacted on Windows systems as a result of
+ non-POSIX-compliant rename() semantics. [RT #22434]
+
+2970. [security] Adding a NO DATA negative cache entry failed to clear
+ any matching RRSIG records. A subsequent lookup of
+ of NO DATA cache entry could trigger a INSIST when the
+ unexpected RRSIG was also returned with the NO DATA
+ cache entry.
+
+ CVE-2010-3613, VU#706148. [RT #22288]
+
+2969. [security] Fix acl type processing so that allow-query works
+ in options and view statements. Also add a new
+ set of tests to verify proper functioning.
+
+ CVE-2010-3615, VU#510208. [RT #22418]
+
+2968. [security] Named could fail to prove a data set was insecure
+ before marking it as insecure. One set of conditions
+ that can trigger this occurs naturally when rolling
+ DNSKEY algorithms.
+
+ CVE-2010-3614, VU#837744. [RT #22309]
+
+2967. [bug] 'host -D' now turns on debugging messages earlier.
+ [RT #22361]
+
+2966. [bug] isc_print_vsnprintf() failed to check if there was
+ space available in the buffer when adding a left
+ justified character with a non zero width,
+ (e.g. "%-1c"). [RT #22270]
+
+2964. [bug] view->queryacl was being overloaded. Seperate the
+ usage into view->queryacl, view->cacheacl and
+ view->queryonacl. [RT #22114]
+
+2962. [port] win32: add more dependencies to BINDBuild.dsw.
+ [RT #22062]
+
+2952. [port] win32: named-checkzone and named-checkconf failed
+ to initialise winsock. [RT #21932]
+
+2951. [bug] named failed to generate a correct signed response
+ in a optout, delegation only zone with no secure
+ delegations. [RT #22007]
+
+ --- 9.6-ESV-R2 released ---
+
+2939. [func] Check that named successfully skips NSEC3 records
+ that fail to match the NSEC3PARAM record currently
+ in use. [RT# 21868]
+
+2937. [bug] Worked around an apparent race condition in over
+ memory conditions. Without this fix a DNS cache DB or
+ ADB could incorrectly stay in an over memory state,
+ effectively refusing further caching, which
+ subsequently made a BIND 9 caching server unworkable.
+ This fix prevents this problem from happening by
+ polling the state of the memory context, rather than
+ making a copy of the state, which appeared to cause
+ a race. This is a "workaround" in that it doesn't
+ solve the possible race per se, but several experiments
+ proved this change solves the symptom. Also, the
+ polling overhead hasn't been reported to be an issue.
+ This bug should only affect a caching server that
+ specifies a finite max-cache-size. It's also quite
+ likely that the bug happens only when enabling threads,
+ but it's not confirmed yet. [RT #21818]
+
+2925. [bug] Named failed to accept uncachable negative responses
+ from insecure zones. [RT# 21555]
+
+2921. [bug] The resolver could attempt to destroy a fetch context
+ too soon. [RT #19878]
+
+2900. [bug] The placeholder negative caching element was not
+ properly constructed triggering a INSIST in
+ dns_ncache_towire(). [RT #21346]
+
+2890. [bug] Handle the introduction of new trusted-keys and
+ DS, DLV RRsets better. [RT #21097]
+
+2869. [bug] Fix arguments to dns_keytable_findnextkeynode() call.
+ [RT #20877]
+
+ --- 9.6-ESV-R1 released ---
+
+2876. [bug] Named could return SERVFAIL for negative responses
+ from unsigned zones. [RT #21131]
+
+ --- 9.6-ESV released ---
+
+2852. [bug] Handle broken DNSSEC trust chains better. [RT #15619]
+
--- 9.6.2 released ---
2850. [bug] If isc_heap_insert() failed due to memory shortage
diff --git a/contrib/bind9/FAQ.xml b/contrib/bind9/FAQ.xml
index 1d87642..a9b2b41 100644
--- a/contrib/bind9/FAQ.xml
+++ b/contrib/bind9/FAQ.xml
@@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: FAQ.xml,v 1.46.56.9 2010/01/20 23:47:43 tbox Exp $ -->
+<!-- $Id: FAQ.xml,v 1.46.56.9 2010-01-20 23:47:43 tbox Exp $ -->
<article class="faq">
<title>Frequently Asked Questions about BIND 9</title>
diff --git a/contrib/bind9/Makefile.in b/contrib/bind9/Makefile.in
index 662ee0f..e4d5639 100644
--- a/contrib/bind9/Makefile.in
+++ b/contrib/bind9/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.52.48.2 2009/02/20 23:47:23 tbox Exp $
+# $Id: Makefile.in,v 1.52.48.2 2009-02-20 23:47:23 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/README.idnkit b/contrib/bind9/README.idnkit
index 0eda0a5..f5255f5 100644
--- a/contrib/bind9/README.idnkit
+++ b/contrib/bind9/README.idnkit
@@ -109,4 +109,4 @@ about idnkit and this patch.
Bug reports and comments on this kit should be sent to
mdnkit-bugs@nic.ad.jp and idn-cmt@nic.ad.jp, respectively.
-; $Id: README.idnkit,v 1.2.762.1 2009/01/18 23:25:14 marka Exp $
+; $Id: README.idnkit,v 1.2.762.1 2009-01-18 23:25:14 marka Exp $
diff --git a/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.html b/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.html
deleted file mode 100644
index c8830f2..0000000
--- a/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.html
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><link rel="stylesheet" href="release-notes.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div class="article"><div class="titlepage"><hr /></div>
-
- <div class="section" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3026830"></a>Introduction</h2></div></div></div>
-
- <p>
- BIND 9.6.3 is the current release of BIND 9.6.
- </p>
- <p>
- This document summarizes changes from BIND 9.6.2-P2 to BIND 9.6.3.
- Please see the CHANGES file in the source code release for a
- complete list of all changes.
- </p>
- </div>
-
- <div class="section" title="Download"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3893341"></a>Download</h2></div></div></div>
-
- <p>
- The latest development version of BIND 9 software can always be found
- on our web site at
- <a class="ulink" href="http://www.isc.org/downloads/development" target="_top">http://www.isc.org/downloads/development</a>.
- There you will find additional information about each release,
- source code, and some pre-compiled versions for certain operating
- systems.
- </p>
- </div>
-
- <div class="section" title="Support"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3026768"></a>Support</h2></div></div></div>
-
- <p>Product support information is available on
- <a class="ulink" href="http://www.isc.org/services/support" target="_top">http://www.isc.org/services/support</a>
- for paid support options. Free support is provided by our user
- community via a mailing list. Information on all public email
- lists is available at
- <a class="ulink" href="https://lists.isc.org/mailman/listinfo" target="_top">https://lists.isc.org/mailman/listinfo</a>.
- </p>
- </div>
-
- <div class="section" title="New Features"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3893404"></a>New Features</h2></div></div></div>
-
- <div class="section" title="9.6.3"><div class="titlepage"><div><div><h3 class="title"><a id="id3893409"></a>9.6.3</h3></div></div></div>
-
- <p>None.</p>
- </div>
- </div>
-
- <div class="section" title="Feature Changes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3893420"></a>Feature Changes</h2></div></div></div>
-
- <div class="section" title="9.6.3"><div class="titlepage"><div><div><h3 class="title"><a id="id3893425"></a>9.6.3</h3></div></div></div>
-
- <p>None.</p>
- </div>
- </div>
-
- <div class="section" title="Security Fixes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3893436"></a>Security Fixes</h2></div></div></div>
-
- <div class="section" title="9.6.2-P3"><div class="titlepage"><div><div><h3 class="title"><a id="id3893441"></a>9.6.2-P3</h3></div></div></div>
-
- <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
- Adding a NO DATA signed negative response to cache failed to clear
- any matching RRSIG records already in cache. A subsequent lookup
- of the cached NO DATA entry could crash named (INSIST) when the
- unexpected RRSIG was also returned with the NO DATA cache entry.
- [RT #22288] [CVE-2010-3613] [VU#706148]
- </li><li class="listitem">
- BIND, acting as a DNSSEC validator, was determining if the NS RRset
- is insecure based on a value that could mean either that the RRset
- is actually insecure or that there wasn't a matching key for the RRSIG
- in the DNSKEY RRset when resuming from validating the DNSKEY RRset.
- This can happen when in the middle of a DNSKEY algorithm rollover,
- when two different algorithms were used to sign a zone but only the
- new set of keys are in the zone DNSKEY RRset.
- [RT #22309] [CVE-2010-3614] [VU#837744]
- </li></ul></div>
- </div>
- </div>
-
- <div class="section" title="Bug Fixes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3026756"></a>Bug Fixes</h2></div></div></div>
-
- <div class="section" title="9.6.3"><div class="titlepage"><div><div><h3 class="title"><a id="id3026817"></a>9.6.3</h3></div></div></div>
-
- <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
- BIND now builds with threads disabled in versions of NetBSD earlier
- than 5.0 and with pthreads enabled by default in NetBSD versions 5.0
- and higher. Also removes support for unproven-pthreads, mit-pthreads
- and ptl2. [RT #19203]
- </li><li class="listitem">
- HPUX now correctly defaults to using /dev/poll, which should
- increase performance. [RT #21919]
- </li><li class="listitem">
- If named is running as a threaded application, after an "rndc stop"
- command has been issued, other inbound TCP requests can cause named
- to hang and never complete shutdown. [RT #22108]
- </li><li class="listitem">
- When performing a GSS-TSIG signed dynamic zone update, memory could be
- leaked. This causes an unclean shutdown and may affect long-running
- servers. [RT #22573]
- </li><li class="listitem">
- A bug in NetBSD and FreeBSD kernels with SO_ACCEPTFILTER enabled allows
- for a TCP DoS attack. Until there is a kernel fix, ISC is disabling
- SO_ACCEPTFILTER support in BIND. [RT #22589]
- </li><li class="listitem">
- Corrected a defect where a combination of dynamic updates and zone
- transfers incorrectly locked the in-memory zone database, causing
- named to freeze. [RT #22614]
- </li><li class="listitem">
- Don't run MX checks (check-mx) when the MX record points to ".".
- [RT #22645]
- </li><li class="listitem">
- DST key reference counts can now be incremented via dst_key_attach.
- [RT #22672]
- </li><li class="listitem">
- isc_mutex_init_errcheck() in phtreads/mutex.c failed to destroy attr. [RT #22766]
- </li><li class="listitem">
- The Kerberos realm was being truncated when being pulled from the
- the host prinicipal, make krb5-self updates fail. [RT #22770]
- </li><li class="listitem">
- named failed to preserve the case of domain names in RDATA which is not compressible when writing master files. [RT #22863]
- </li><li class="listitem">
-There was a bug in how the clients-per-query code worked with some
-query patterns. This could result, in rare circumstances, in having all
-the client query slots filled with queries for the same DNS label,
-essentially ignoring the max-clients-per-query setting.
-[RT #22972]
- </li></ul></div>
- </div>
- <div class="section" title="9.6.2-P3"><div class="titlepage"><div><div><h3 class="title"><a id="id3893557"></a>9.6.2-P3</h3></div></div></div>
-
- <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
- Worked around a race condition in the cache database memory
- handling. Without this fix a DNS cache DB or ADB could
- incorrectly stay in an over memory state, effectively refusing
- further caching, which subsequently made a BIND 9 caching
- server unworkable.
- [RT #21818]
- </li><li class="listitem">
- Microsoft changed the behavior of sockets between NT/XP based
- stacks vs Vista/windows7 stacks. Server 2003/2008 have the older
- behavior, 2008r2 has the new behavior. With the change, different
- error results are possible, so ISC adapted BIND to handle the new
- error results.
- This resolves an issue where sockets would shut down on
- Windows servers causing named to stop responding to queries.
- [RT #21906]
- </li><li class="listitem">
- Windows has non-POSIX compliant behavior in its rename() and unlink()
- calls. This caused journal compaction to fail on Windows BIND servers
- with the log error: "dns_journal_compact failed: failure".
- [RT #22434]
- </li></ul></div>
-
- </div>
- </div>
-
- <div class="section" title="Thank You"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3893594"></a>Thank You</h2></div></div></div>
-
- <p>
- Thank you to everyone who assisted us in making this release possible.
- If you would like to contribute to ISC to assist us in continuing to make
- quality open source software, please visit our donations page at
- <a class="ulink" href="http://www.isc.org/supportisc" target="_top">http://www.isc.org/supportisc</a>.
- </p>
- </div>
-</div></body></html>
diff --git a/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.pdf b/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.pdf
deleted file mode 100644
index 53f0b11..0000000
--- a/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.pdf
+++ /dev/null
Binary files differ
diff --git a/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.txt b/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.txt
deleted file mode 100644
index c2a5d53..0000000
--- a/contrib/bind9/RELEASE-NOTES-BIND-9.6.3.txt
+++ /dev/null
@@ -1,118 +0,0 @@
- __________________________________________________________________
-
-Introduction
-
- BIND 9.6.3 is the current release of BIND 9.6.
-
- This document summarizes changes from BIND 9.6.2-P2 to BIND 9.6.3.
- Please see the CHANGES file in the source code release for a complete
- list of all changes.
-
-Download
-
- The latest development version of BIND 9 software can always be found
- on our web site at http://www.isc.org/downloads/development. There you
- will find additional information about each release, source code, and
- some pre-compiled versions for certain operating systems.
-
-Support
-
- Product support information is available on
- http://www.isc.org/services/support for paid support options. Free
- support is provided by our user community via a mailing list.
- Information on all public email lists is available at
- https://lists.isc.org/mailman/listinfo.
-
-New Features
-
-9.6.3
-
- None.
-
-Feature Changes
-
-9.6.3
-
- None.
-
-Security Fixes
-
-9.6.2-P3
-
- * Adding a NO DATA signed negative response to cache failed to clear
- any matching RRSIG records already in cache. A subsequent lookup of
- the cached NO DATA entry could crash named (INSIST) when the
- unexpected RRSIG was also returned with the NO DATA cache entry.
- [RT #22288] [CVE-2010-3613] [VU#706148]
- * BIND, acting as a DNSSEC validator, was determining if the NS RRset
- is insecure based on a value that could mean either that the RRset
- is actually insecure or that there wasn't a matching key for the
- RRSIG in the DNSKEY RRset when resuming from validating the DNSKEY
- RRset. This can happen when in the middle of a DNSKEY algorithm
- rollover, when two different algorithms were used to sign a zone
- but only the new set of keys are in the zone DNSKEY RRset. [RT
- #22309] [CVE-2010-3614] [VU#837744]
-
-Bug Fixes
-
-9.6.3
-
- * BIND now builds with threads disabled in versions of NetBSD earlier
- than 5.0 and with pthreads enabled by default in NetBSD versions
- 5.0 and higher. Also removes support for unproven-pthreads,
- mit-pthreads and ptl2. [RT #19203]
- * HPUX now correctly defaults to using /dev/poll, which should
- increase performance. [RT #21919]
- * If named is running as a threaded application, after an "rndc stop"
- command has been issued, other inbound TCP requests can cause named
- to hang and never complete shutdown. [RT #22108]
- * When performing a GSS-TSIG signed dynamic zone update, memory could
- be leaked. This causes an unclean shutdown and may affect
- long-running servers. [RT #22573]
- * A bug in NetBSD and FreeBSD kernels with SO_ACCEPTFILTER enabled
- allows for a TCP DoS attack. Until there is a kernel fix, ISC is
- disabling SO_ACCEPTFILTER support in BIND. [RT #22589]
- * Corrected a defect where a combination of dynamic updates and zone
- transfers incorrectly locked the in-memory zone database, causing
- named to freeze. [RT #22614]
- * Don't run MX checks (check-mx) when the MX record points to ".".
- [RT #22645]
- * DST key reference counts can now be incremented via dst_key_attach.
- [RT #22672]
- * isc_mutex_init_errcheck() in phtreads/mutex.c failed to destroy
- attr. [RT #22766]
- * The Kerberos realm was being truncated when being pulled from the
- the host prinicipal, make krb5-self updates fail. [RT #22770]
- * named failed to preserve the case of domain names in RDATA which is
- not compressible when writing master files. [RT #22863]
- * There was a bug in how the clients-per-query code worked with some
- query patterns. This could result, in rare circumstances, in having
- all the client query slots filled with queries for the same DNS
- label, essentially ignoring the max-clients-per-query setting. [RT
- #22972]
-
-9.6.2-P3
-
- * Worked around a race condition in the cache database memory
- handling. Without this fix a DNS cache DB or ADB could incorrectly
- stay in an over memory state, effectively refusing further caching,
- which subsequently made a BIND 9 caching server unworkable. [RT
- #21818]
- * Microsoft changed the behavior of sockets between NT/XP based
- stacks vs Vista/windows7 stacks. Server 2003/2008 have the older
- behavior, 2008r2 has the new behavior. With the change, different
- error results are possible, so ISC adapted BIND to handle the new
- error results. This resolves an issue where sockets would shut down
- on Windows servers causing named to stop responding to queries. [RT
- #21906]
- * Windows has non-POSIX compliant behavior in its rename() and
- unlink() calls. This caused journal compaction to fail on Windows
- BIND servers with the log error: "dns_journal_compact failed:
- failure". [RT #22434]
-
-Thank You
-
- Thank you to everyone who assisted us in making this release possible.
- If you would like to contribute to ISC to assist us in continuing to
- make quality open source software, please visit our donations page at
- http://www.isc.org/supportisc.
diff --git a/contrib/bind9/acconfig.h b/contrib/bind9/acconfig.h
index eb19150..d64404a 100644
--- a/contrib/bind9/acconfig.h
+++ b/contrib/bind9/acconfig.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acconfig.h,v 1.51.334.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: acconfig.h,v 1.51.334.2 2009-02-16 23:47:15 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/Makefile.in b/contrib/bind9/bin/Makefile.in
index ef28e0c..1694268 100644
--- a/contrib/bind9/bin/Makefile.in
+++ b/contrib/bind9/bin/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.25 2007/06/19 23:46:59 tbox Exp $
+# $Id: Makefile.in,v 1.25 2007-06-19 23:46:59 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/check/Makefile.in b/contrib/bind9/bin/check/Makefile.in
index 06f5541..46271c7 100644
--- a/contrib/bind9/bin/check/Makefile.in
+++ b/contrib/bind9/bin/check/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.32 2007/06/19 23:46:59 tbox Exp $
+# $Id: Makefile.in,v 1.32 2007-06-19 23:46:59 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/check/named-checkconf.8 b/contrib/bind9/bin/check/named-checkconf.8
index 072d1cf..7131007 100644
--- a/contrib/bind9/bin/check/named-checkconf.8
+++ b/contrib/bind9/bin/check/named-checkconf.8
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: named-checkconf.8,v 1.30.334.1 2009/07/11 01:55:20 tbox Exp $
+.\" $Id: named-checkconf.8,v 1.30.334.1 2009-07-11 01:55:20 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/check/named-checkconf.docbook b/contrib/bind9/bin/check/named-checkconf.docbook
index 5359239..e0c43d1 100644
--- a/contrib/bind9/bin/check/named-checkconf.docbook
+++ b/contrib/bind9/bin/check/named-checkconf.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named-checkconf.docbook,v 1.19 2007/06/19 06:58:03 marka Exp $ -->
+<!-- $Id: named-checkconf.docbook,v 1.19 2007-06-19 06:58:03 marka Exp $ -->
<refentry id="man.named-checkconf">
<refentryinfo>
<date>June 14, 2000</date>
diff --git a/contrib/bind9/bin/check/named-checkconf.html b/contrib/bind9/bin/check/named-checkconf.html
index 8fd1e6d..458b486 100644
--- a/contrib/bind9/bin/check/named-checkconf.html
+++ b/contrib/bind9/bin/check/named-checkconf.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named-checkconf.html,v 1.30.334.1 2009/07/11 01:55:20 tbox Exp $ -->
+<!-- $Id: named-checkconf.html,v 1.30.334.1 2009-07-11 01:55:20 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/check/named-checkzone.8 b/contrib/bind9/bin/check/named-checkzone.8
index dfc409e..e5f0790 100644
--- a/contrib/bind9/bin/check/named-checkzone.8
+++ b/contrib/bind9/bin/check/named-checkzone.8
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: named-checkzone.8,v 1.42.334.3 2009/11/11 01:56:22 tbox Exp $
+.\" $Id: named-checkzone.8,v 1.42.334.3 2009-11-11 01:56:22 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/check/named-checkzone.docbook b/contrib/bind9/bin/check/named-checkzone.docbook
index 4abb07f..0e04c03 100644
--- a/contrib/bind9/bin/check/named-checkzone.docbook
+++ b/contrib/bind9/bin/check/named-checkzone.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named-checkzone.docbook,v 1.34.334.3 2009/11/10 20:01:41 each Exp $ -->
+<!-- $Id: named-checkzone.docbook,v 1.34.334.3 2009-11-10 20:01:41 each Exp $ -->
<refentry id="man.named-checkzone">
<refentryinfo>
<date>June 13, 2000</date>
diff --git a/contrib/bind9/bin/check/named-checkzone.html b/contrib/bind9/bin/check/named-checkzone.html
index 68a6331..24f5c05 100644
--- a/contrib/bind9/bin/check/named-checkzone.html
+++ b/contrib/bind9/bin/check/named-checkzone.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named-checkzone.html,v 1.42.334.3 2009/11/11 01:56:22 tbox Exp $ -->
+<!-- $Id: named-checkzone.html,v 1.42.334.3 2009-11-11 01:56:22 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/dig/Makefile.in b/contrib/bind9/bin/dig/Makefile.in
index bc9d34f..ad20553 100644
--- a/contrib/bind9/bin/dig/Makefile.in
+++ b/contrib/bind9/bin/dig/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.41 2007/06/19 23:46:59 tbox Exp $
+# $Id: Makefile.in,v 1.41 2007-06-19 23:46:59 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/dig/dig.1 b/contrib/bind9/bin/dig/dig.1
index c8704a1..93f90b2 100644
--- a/contrib/bind9/bin/dig/dig.1
+++ b/contrib/bind9/bin/dig/dig.1
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: dig.1,v 1.50.44.3 2009/07/11 01:55:20 tbox Exp $
+.\" $Id: dig.1,v 1.50.44.3 2009-07-11 01:55:20 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/dig/dig.docbook b/contrib/bind9/bin/dig/dig.docbook
index f987465b..d8e3586 100644
--- a/contrib/bind9/bin/dig/dig.docbook
+++ b/contrib/bind9/bin/dig/dig.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dig.docbook,v 1.42.44.3 2009/02/02 04:42:48 marka Exp $ -->
+<!-- $Id: dig.docbook,v 1.42.44.3 2009-02-02 04:42:48 marka Exp $ -->
<refentry id="man.dig">
<refentryinfo>
diff --git a/contrib/bind9/bin/dig/dig.html b/contrib/bind9/bin/dig/dig.html
index 3fd3e75..17fd5bb 100644
--- a/contrib/bind9/bin/dig/dig.html
+++ b/contrib/bind9/bin/dig/dig.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dig.html,v 1.45.44.3 2009/07/11 01:55:20 tbox Exp $ -->
+<!-- $Id: dig.html,v 1.45.44.3 2009-07-11 01:55:20 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/dig/host.1 b/contrib/bind9/bin/dig/host.1
index c538ae3..1573eff 100644
--- a/contrib/bind9/bin/dig/host.1
+++ b/contrib/bind9/bin/dig/host.1
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: host.1,v 1.29.114.2 2009/07/11 01:55:20 tbox Exp $
+.\" $Id: host.1,v 1.29.114.2 2009-07-11 01:55:20 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/dig/host.docbook b/contrib/bind9/bin/dig/host.docbook
index 3e75b05..41175aa 100644
--- a/contrib/bind9/bin/dig/host.docbook
+++ b/contrib/bind9/bin/dig/host.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: host.docbook,v 1.18.114.2 2009/01/22 23:47:05 tbox Exp $ -->
+<!-- $Id: host.docbook,v 1.18.114.2 2009-01-22 23:47:05 tbox Exp $ -->
<refentry id="man.host">
<refentryinfo>
diff --git a/contrib/bind9/bin/dig/host.html b/contrib/bind9/bin/dig/host.html
index 3928c93..de4b579 100644
--- a/contrib/bind9/bin/dig/host.html
+++ b/contrib/bind9/bin/dig/host.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: host.html,v 1.28.114.2 2009/07/11 01:55:20 tbox Exp $ -->
+<!-- $Id: host.html,v 1.28.114.2 2009-07-11 01:55:20 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/dig/include/dig/dig.h b/contrib/bind9/bin/dig/include/dig/dig.h
index d9ee757..3d696c7 100644
--- a/contrib/bind9/bin/dig/include/dig/dig.h
+++ b/contrib/bind9/bin/dig/include/dig/dig.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dig.h,v 1.107.120.2 2009/01/06 23:47:26 tbox Exp $ */
+/* $Id: dig.h,v 1.107.120.2 2009-01-06 23:47:26 tbox Exp $ */
#ifndef DIG_H
#define DIG_H
diff --git a/contrib/bind9/bin/dig/nslookup.c b/contrib/bind9/bin/dig/nslookup.c
index 000f54e..8a166fd 100644
--- a/contrib/bind9/bin/dig/nslookup.c
+++ b/contrib/bind9/bin/dig/nslookup.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nslookup.c,v 1.117.334.5 2009/10/20 01:11:22 marka Exp $ */
+/* $Id: nslookup.c,v 1.117.334.5 2009-10-20 01:11:22 marka Exp $ */
#include <config.h>
diff --git a/contrib/bind9/bin/dnssec/Makefile.in b/contrib/bind9/bin/dnssec/Makefile.in
index d59a38fb..50429be 100644
--- a/contrib/bind9/bin/dnssec/Makefile.in
+++ b/contrib/bind9/bin/dnssec/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.35 2008/11/07 02:28:49 marka Exp $
+# $Id: Makefile.in,v 1.35 2008-11-07 02:28:49 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c b/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c
index 8bd4aa5..934d25b 100644
--- a/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c
+++ b/contrib/bind9/bin/dnssec/dnssec-dsfromkey.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-dsfromkey.c,v 1.2.14.6 2010/01/11 23:47:22 tbox Exp $ */
+/* $Id: dnssec-dsfromkey.c,v 1.2.14.6 2010-01-11 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook b/contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook
index c2c6b85..c4ea38d 100644
--- a/contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook
+++ b/contrib/bind9/bin/dnssec/dnssec-dsfromkey.docbook
@@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dnssec-dsfromkey.docbook,v 1.6 2008/11/07 13:54:11 jreed Exp $ -->
+<!-- $Id: dnssec-dsfromkey.docbook,v 1.6 2008-11-07 13:54:11 jreed Exp $ -->
<refentry id="man.dnssec-dsfromkey">
<refentryinfo>
<date>November 29, 2008</date>
diff --git a/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8 b/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8
index 03f13e9..45fc087 100644
--- a/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8
+++ b/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.8
@@ -12,7 +12,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: dnssec-keyfromlabel.8,v 1.6.14.3 2010/01/16 01:55:32 tbox Exp $
+.\" $Id: dnssec-keyfromlabel.8,v 1.6.14.3 2010-01-16 01:55:32 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c b/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c
index 78bfda3..8e9a53b 100644
--- a/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c
+++ b/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-keyfromlabel.c,v 1.4.50.2 2010/01/15 23:47:31 tbox Exp $ */
+/* $Id: dnssec-keyfromlabel.c,v 1.4.50.2 2010-01-15 23:47:31 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook b/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook
index f2ab152..a2fff5a 100644
--- a/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook
+++ b/contrib/bind9/bin/dnssec/dnssec-keyfromlabel.docbook
@@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dnssec-keyfromlabel.docbook,v 1.6.14.2 2010/01/15 23:47:31 tbox Exp $ -->
+<!-- $Id: dnssec-keyfromlabel.docbook,v 1.6.14.2 2010-01-15 23:47:31 tbox Exp $ -->
<refentry id="man.dnssec-keyfromlabel">
<refentryinfo>
<date>February 8, 2008</date>
diff --git a/contrib/bind9/bin/dnssec/dnssec-keygen.8 b/contrib/bind9/bin/dnssec/dnssec-keygen.8
index 485ea6e..c4be24e 100644
--- a/contrib/bind9/bin/dnssec/dnssec-keygen.8
+++ b/contrib/bind9/bin/dnssec/dnssec-keygen.8
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: dnssec-keygen.8,v 1.40.44.4 2010/01/16 01:55:32 tbox Exp $
+.\" $Id: dnssec-keygen.8,v 1.40.44.4 2010-01-16 01:55:32 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/dnssec/dnssec-keygen.c b/contrib/bind9/bin/dnssec/dnssec-keygen.c
index 2b9a863..2184122 100644
--- a/contrib/bind9/bin/dnssec/dnssec-keygen.c
+++ b/contrib/bind9/bin/dnssec/dnssec-keygen.c
@@ -29,7 +29,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec-keygen.c,v 1.81.48.2 2010/01/15 23:47:31 tbox Exp $ */
+/* $Id: dnssec-keygen.c,v 1.81.48.2 2010-01-15 23:47:31 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/dnssec/dnssec-keygen.docbook b/contrib/bind9/bin/dnssec/dnssec-keygen.docbook
index 92ef9b9..5c7d164 100644
--- a/contrib/bind9/bin/dnssec/dnssec-keygen.docbook
+++ b/contrib/bind9/bin/dnssec/dnssec-keygen.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dnssec-keygen.docbook,v 1.22.44.4 2010/01/15 23:47:33 tbox Exp $ -->
+<!-- $Id: dnssec-keygen.docbook,v 1.22.44.4 2010-01-15 23:47:33 tbox Exp $ -->
<refentry id="man.dnssec-keygen">
<refentryinfo>
<date>June 30, 2000</date>
diff --git a/contrib/bind9/bin/dnssec/dnssec-signzone.8 b/contrib/bind9/bin/dnssec/dnssec-signzone.8
index 7b21fb6..bfe7a20 100644
--- a/contrib/bind9/bin/dnssec/dnssec-signzone.8
+++ b/contrib/bind9/bin/dnssec/dnssec-signzone.8
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: dnssec-signzone.8,v 1.47.44.8 2009/11/07 01:56:11 tbox Exp $
+.\" $Id: dnssec-signzone.8,v 1.47.44.8 2009-11-07 01:56:11 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/dnssec/dnssec-signzone.docbook b/contrib/bind9/bin/dnssec/dnssec-signzone.docbook
index f204fcd..87a801e 100644
--- a/contrib/bind9/bin/dnssec/dnssec-signzone.docbook
+++ b/contrib/bind9/bin/dnssec/dnssec-signzone.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: dnssec-signzone.docbook,v 1.31.44.8 2009/11/06 21:36:22 each Exp $ -->
+<!-- $Id: dnssec-signzone.docbook,v 1.31.44.8 2009-11-06 21:36:22 each Exp $ -->
<refentry id="man.dnssec-signzone">
<refentryinfo>
<date>June 08, 2009</date>
diff --git a/contrib/bind9/bin/dnssec/dnssectool.c b/contrib/bind9/bin/dnssec/dnssectool.c
index 3a6b7f0..81120e3 100644
--- a/contrib/bind9/bin/dnssec/dnssectool.c
+++ b/contrib/bind9/bin/dnssec/dnssectool.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssectool.c,v 1.45.334.5 2009/06/22 05:05:00 marka Exp $ */
+/* $Id: dnssectool.c,v 1.45.334.5 2009-06-22 05:05:00 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/dnssec/dnssectool.h b/contrib/bind9/bin/dnssec/dnssectool.h
index 43b7375..8cc133d 100644
--- a/contrib/bind9/bin/dnssec/dnssectool.h
+++ b/contrib/bind9/bin/dnssec/dnssectool.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssectool.h,v 1.22.48.2 2009/09/04 23:46:58 tbox Exp $ */
+/* $Id: dnssectool.h,v 1.22.48.2 2009-09-04 23:46:58 tbox Exp $ */
#ifndef DNSSECTOOL_H
#define DNSSECTOOL_H 1
diff --git a/contrib/bind9/bin/named/Makefile.in b/contrib/bind9/bin/named/Makefile.in
index 4d800a6..ee76134 100644
--- a/contrib/bind9/bin/named/Makefile.in
+++ b/contrib/bind9/bin/named/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.101 2008/09/23 17:25:47 jinmei Exp $
+# $Id: Makefile.in,v 1.101 2008-09-23 17:25:47 jinmei Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/named/bind9.xsl b/contrib/bind9/bin/named/bind9.xsl
index 2cadbfd..71d2eba 100644
--- a/contrib/bind9/bin/named/bind9.xsl
+++ b/contrib/bind9/bin/named/bind9.xsl
@@ -15,7 +15,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: bind9.xsl,v 1.19.82.2 2009/01/29 23:47:43 tbox Exp $ -->
+<!-- $Id: bind9.xsl,v 1.19.82.2 2009-01-29 23:47:43 tbox Exp $ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
diff --git a/contrib/bind9/bin/named/config.c b/contrib/bind9/bin/named/config.c
index 8b96050..43d0e52 100644
--- a/contrib/bind9/bin/named/config.c
+++ b/contrib/bind9/bin/named/config.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: config.c,v 1.93.14.2 2009/03/17 23:47:28 tbox Exp $ */
+/* $Id: config.c,v 1.93.14.2 2009-03-17 23:47:28 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/controlconf.c b/contrib/bind9/bin/named/controlconf.c
index 766f013..16d375b 100644
--- a/contrib/bind9/bin/named/controlconf.c
+++ b/contrib/bind9/bin/named/controlconf.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: controlconf.c,v 1.60 2008/07/23 23:27:54 marka Exp $ */
+/* $Id: controlconf.c,v 1.60 2008-07-23 23:27:54 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/convertxsl.pl b/contrib/bind9/bin/named/convertxsl.pl
index 87550b3..a6a5668 100755
--- a/contrib/bind9/bin/named/convertxsl.pl
+++ b/contrib/bind9/bin/named/convertxsl.pl
@@ -14,12 +14,12 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: convertxsl.pl,v 1.14 2008/07/17 23:43:26 jinmei Exp $
+# $Id: convertxsl.pl,v 1.14 2008-07-17 23:43:26 jinmei Exp $
use strict;
use warnings;
-my $rev = '$Id: convertxsl.pl,v 1.14 2008/07/17 23:43:26 jinmei Exp $';
+my $rev = '$Id: convertxsl.pl,v 1.14 2008-07-17 23:43:26 jinmei Exp $';
$rev =~ s/\$//g;
$rev =~ s/,v//g;
$rev =~ s/Id: //;
diff --git a/contrib/bind9/bin/named/include/named/builtin.h b/contrib/bind9/bin/named/include/named/builtin.h
index a5185ba..ec1a575 100644
--- a/contrib/bind9/bin/named/include/named/builtin.h
+++ b/contrib/bind9/bin/named/include/named/builtin.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: builtin.h,v 1.6 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: builtin.h,v 1.6 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_BUILTIN_H
#define NAMED_BUILTIN_H 1
diff --git a/contrib/bind9/bin/named/include/named/client.h b/contrib/bind9/bin/named/include/named/client.h
index 3ebed3f..5ad9c6b 100644
--- a/contrib/bind9/bin/named/include/named/client.h
+++ b/contrib/bind9/bin/named/include/named/client.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: client.h,v 1.86.120.2 2009/01/18 23:47:34 tbox Exp $ */
+/* $Id: client.h,v 1.86.120.2 2009-01-18 23:47:34 tbox Exp $ */
#ifndef NAMED_CLIENT_H
#define NAMED_CLIENT_H 1
diff --git a/contrib/bind9/bin/named/include/named/config.h b/contrib/bind9/bin/named/include/named/config.h
index f7ceed8..fa96d32 100644
--- a/contrib/bind9/bin/named/include/named/config.h
+++ b/contrib/bind9/bin/named/include/named/config.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: config.h,v 1.14 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: config.h,v 1.14 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_CONFIG_H
#define NAMED_CONFIG_H 1
diff --git a/contrib/bind9/bin/named/include/named/control.h b/contrib/bind9/bin/named/include/named/control.h
index d382ffe..436fb19 100644
--- a/contrib/bind9/bin/named/include/named/control.h
+++ b/contrib/bind9/bin/named/include/named/control.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: control.h,v 1.25 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: control.h,v 1.25 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_CONTROL_H
#define NAMED_CONTROL_H 1
diff --git a/contrib/bind9/bin/named/include/named/interfacemgr.h b/contrib/bind9/bin/named/include/named/interfacemgr.h
index 2724c39..1b1e463 100644
--- a/contrib/bind9/bin/named/include/named/interfacemgr.h
+++ b/contrib/bind9/bin/named/include/named/interfacemgr.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: interfacemgr.h,v 1.33 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: interfacemgr.h,v 1.33 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_INTERFACEMGR_H
#define NAMED_INTERFACEMGR_H 1
diff --git a/contrib/bind9/bin/named/include/named/listenlist.h b/contrib/bind9/bin/named/include/named/listenlist.h
index 9e65d5d..e1c2002 100644
--- a/contrib/bind9/bin/named/include/named/listenlist.h
+++ b/contrib/bind9/bin/named/include/named/listenlist.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: listenlist.h,v 1.15 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: listenlist.h,v 1.15 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_LISTENLIST_H
#define NAMED_LISTENLIST_H 1
diff --git a/contrib/bind9/bin/named/include/named/log.h b/contrib/bind9/bin/named/include/named/log.h
index 444fe50..0cfbee9 100644
--- a/contrib/bind9/bin/named/include/named/log.h
+++ b/contrib/bind9/bin/named/include/named/log.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.h,v 1.25.332.2 2009/01/07 23:47:16 tbox Exp $ */
+/* $Id: log.h,v 1.25.332.2 2009-01-07 23:47:16 tbox Exp $ */
#ifndef NAMED_LOG_H
#define NAMED_LOG_H 1
diff --git a/contrib/bind9/bin/named/include/named/logconf.h b/contrib/bind9/bin/named/include/named/logconf.h
index 0354345..fc91c10 100644
--- a/contrib/bind9/bin/named/include/named/logconf.h
+++ b/contrib/bind9/bin/named/include/named/logconf.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: logconf.h,v 1.17 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: logconf.h,v 1.17 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_LOGCONF_H
#define NAMED_LOGCONF_H 1
diff --git a/contrib/bind9/bin/named/include/named/lwaddr.h b/contrib/bind9/bin/named/include/named/lwaddr.h
index 962aa91..3818620 100644
--- a/contrib/bind9/bin/named/include/named/lwaddr.h
+++ b/contrib/bind9/bin/named/include/named/lwaddr.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwaddr.h,v 1.8 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: lwaddr.h,v 1.8 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/include/named/lwdclient.h b/contrib/bind9/bin/named/include/named/lwdclient.h
index f0ab057..44e1fa6 100644
--- a/contrib/bind9/bin/named/include/named/lwdclient.h
+++ b/contrib/bind9/bin/named/include/named/lwdclient.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwdclient.h,v 1.18.332.2 2009/01/18 23:47:34 tbox Exp $ */
+/* $Id: lwdclient.h,v 1.18.332.2 2009-01-18 23:47:34 tbox Exp $ */
#ifndef NAMED_LWDCLIENT_H
#define NAMED_LWDCLIENT_H 1
diff --git a/contrib/bind9/bin/named/include/named/lwresd.h b/contrib/bind9/bin/named/include/named/lwresd.h
index 565e58d..3a540fb 100644
--- a/contrib/bind9/bin/named/include/named/lwresd.h
+++ b/contrib/bind9/bin/named/include/named/lwresd.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwresd.h,v 1.19 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: lwresd.h,v 1.19 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_LWRESD_H
#define NAMED_LWRESD_H 1
diff --git a/contrib/bind9/bin/named/include/named/lwsearch.h b/contrib/bind9/bin/named/include/named/lwsearch.h
index c1b4f48..b9ced52 100644
--- a/contrib/bind9/bin/named/include/named/lwsearch.h
+++ b/contrib/bind9/bin/named/include/named/lwsearch.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwsearch.h,v 1.9 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: lwsearch.h,v 1.9 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_LWSEARCH_H
#define NAMED_LWSEARCH_H 1
diff --git a/contrib/bind9/bin/named/include/named/main.h b/contrib/bind9/bin/named/include/named/main.h
index e834539..96fb23e 100644
--- a/contrib/bind9/bin/named/include/named/main.h
+++ b/contrib/bind9/bin/named/include/named/main.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: main.h,v 1.15 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: main.h,v 1.15 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_MAIN_H
#define NAMED_MAIN_H 1
diff --git a/contrib/bind9/bin/named/include/named/notify.h b/contrib/bind9/bin/named/include/named/notify.h
index e8df0a1..ac7fe2d 100644
--- a/contrib/bind9/bin/named/include/named/notify.h
+++ b/contrib/bind9/bin/named/include/named/notify.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: notify.h,v 1.14.332.2 2009/01/18 23:47:34 tbox Exp $ */
+/* $Id: notify.h,v 1.14.332.2 2009-01-18 23:47:34 tbox Exp $ */
#ifndef NAMED_NOTIFY_H
#define NAMED_NOTIFY_H 1
diff --git a/contrib/bind9/bin/named/include/named/ns_smf_globals.h b/contrib/bind9/bin/named/include/named/ns_smf_globals.h
index 3a35743..5c6b917 100644
--- a/contrib/bind9/bin/named/include/named/ns_smf_globals.h
+++ b/contrib/bind9/bin/named/include/named/ns_smf_globals.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ns_smf_globals.h,v 1.7 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: ns_smf_globals.h,v 1.7 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NS_SMF_GLOBALS_H
#define NS_SMF_GLOBALS_H 1
diff --git a/contrib/bind9/bin/named/include/named/server.h b/contrib/bind9/bin/named/include/named/server.h
index 1a3f746..3a4c5f7 100644
--- a/contrib/bind9/bin/named/include/named/server.h
+++ b/contrib/bind9/bin/named/include/named/server.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: server.h,v 1.93.120.3 2009/07/11 04:23:53 marka Exp $ */
+/* $Id: server.h,v 1.93.120.3 2009-07-11 04:23:53 marka Exp $ */
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
diff --git a/contrib/bind9/bin/named/include/named/sortlist.h b/contrib/bind9/bin/named/include/named/sortlist.h
index b9f6076..5f3b05b 100644
--- a/contrib/bind9/bin/named/include/named/sortlist.h
+++ b/contrib/bind9/bin/named/include/named/sortlist.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sortlist.h,v 1.11 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: sortlist.h,v 1.11 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_SORTLIST_H
#define NAMED_SORTLIST_H 1
diff --git a/contrib/bind9/bin/named/include/named/statschannel.h b/contrib/bind9/bin/named/include/named/statschannel.h
index 0c36d8c..fff7cad 100644
--- a/contrib/bind9/bin/named/include/named/statschannel.h
+++ b/contrib/bind9/bin/named/include/named/statschannel.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: statschannel.h,v 1.3 2008/04/03 05:55:51 marka Exp $ */
+/* $Id: statschannel.h,v 1.3 2008-04-03 05:55:51 marka Exp $ */
#ifndef NAMED_STATSCHANNEL_H
#define NAMED_STATSCHANNEL_H 1
diff --git a/contrib/bind9/bin/named/include/named/tkeyconf.h b/contrib/bind9/bin/named/include/named/tkeyconf.h
index 02bd718..89d050c 100644
--- a/contrib/bind9/bin/named/include/named/tkeyconf.h
+++ b/contrib/bind9/bin/named/include/named/tkeyconf.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tkeyconf.h,v 1.16 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: tkeyconf.h,v 1.16 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NS_TKEYCONF_H
#define NS_TKEYCONF_H 1
diff --git a/contrib/bind9/bin/named/include/named/tsigconf.h b/contrib/bind9/bin/named/include/named/tsigconf.h
index 49ad82a..a4841ba 100644
--- a/contrib/bind9/bin/named/include/named/tsigconf.h
+++ b/contrib/bind9/bin/named/include/named/tsigconf.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tsigconf.h,v 1.16 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: tsigconf.h,v 1.16 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NS_TSIGCONF_H
#define NS_TSIGCONF_H 1
diff --git a/contrib/bind9/bin/named/include/named/types.h b/contrib/bind9/bin/named/include/named/types.h
index eb25520..b0729a7 100644
--- a/contrib/bind9/bin/named/include/named/types.h
+++ b/contrib/bind9/bin/named/include/named/types.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: types.h,v 1.29 2008/01/17 23:46:59 tbox Exp $ */
+/* $Id: types.h,v 1.29 2008-01-17 23:46:59 tbox Exp $ */
#ifndef NAMED_TYPES_H
#define NAMED_TYPES_H 1
diff --git a/contrib/bind9/bin/named/include/named/update.h b/contrib/bind9/bin/named/include/named/update.h
index a34570c..ffa55ef 100644
--- a/contrib/bind9/bin/named/include/named/update.h
+++ b/contrib/bind9/bin/named/include/named/update.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: update.h,v 1.13 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: update.h,v 1.13 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_UPDATE_H
#define NAMED_UPDATE_H 1
diff --git a/contrib/bind9/bin/named/include/named/xfrout.h b/contrib/bind9/bin/named/include/named/xfrout.h
index 4bb79a3..4bea6f1 100644
--- a/contrib/bind9/bin/named/include/named/xfrout.h
+++ b/contrib/bind9/bin/named/include/named/xfrout.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: xfrout.h,v 1.12 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: xfrout.h,v 1.12 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NAMED_XFROUT_H
#define NAMED_XFROUT_H 1
diff --git a/contrib/bind9/bin/named/include/named/zoneconf.h b/contrib/bind9/bin/named/include/named/zoneconf.h
index b973013..ab84c84 100644
--- a/contrib/bind9/bin/named/include/named/zoneconf.h
+++ b/contrib/bind9/bin/named/include/named/zoneconf.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zoneconf.h,v 1.26 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: zoneconf.h,v 1.26 2007-06-19 23:46:59 tbox Exp $ */
#ifndef NS_ZONECONF_H
#define NS_ZONECONF_H 1
diff --git a/contrib/bind9/bin/named/interfacemgr.c b/contrib/bind9/bin/named/interfacemgr.c
index 46eb96e..fad3213 100644
--- a/contrib/bind9/bin/named/interfacemgr.c
+++ b/contrib/bind9/bin/named/interfacemgr.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: interfacemgr.c,v 1.93.70.2 2009/01/18 23:47:34 tbox Exp $ */
+/* $Id: interfacemgr.c,v 1.93.70.2 2009-01-18 23:47:34 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/listenlist.c b/contrib/bind9/bin/named/listenlist.c
index 513fe9c..b1aa427 100644
--- a/contrib/bind9/bin/named/listenlist.c
+++ b/contrib/bind9/bin/named/listenlist.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: listenlist.c,v 1.14 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: listenlist.c,v 1.14 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/log.c b/contrib/bind9/bin/named/log.c
index 359ab9f..867ad56 100644
--- a/contrib/bind9/bin/named/log.c
+++ b/contrib/bind9/bin/named/log.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.c,v 1.46.334.3 2009/01/07 01:50:14 jinmei Exp $ */
+/* $Id: log.c,v 1.46.334.3 2009-01-07 01:50:14 jinmei Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/logconf.c b/contrib/bind9/bin/named/logconf.c
index e324965..8ae55ff 100644
--- a/contrib/bind9/bin/named/logconf.c
+++ b/contrib/bind9/bin/named/logconf.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: logconf.c,v 1.42 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: logconf.c,v 1.42 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/lwaddr.c b/contrib/bind9/bin/named/lwaddr.c
index ed7880a..c7eeb78 100644
--- a/contrib/bind9/bin/named/lwaddr.c
+++ b/contrib/bind9/bin/named/lwaddr.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwaddr.c,v 1.10 2008/01/11 23:46:56 tbox Exp $ */
+/* $Id: lwaddr.c,v 1.10 2008-01-11 23:46:56 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/lwdclient.c b/contrib/bind9/bin/named/lwdclient.c
index a843134..63a2be2 100644
--- a/contrib/bind9/bin/named/lwdclient.c
+++ b/contrib/bind9/bin/named/lwdclient.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwdclient.c,v 1.22 2007/06/18 23:47:18 tbox Exp $ */
+/* $Id: lwdclient.c,v 1.22 2007-06-18 23:47:18 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/lwderror.c b/contrib/bind9/bin/named/lwderror.c
index 33f247a..9594dba 100644
--- a/contrib/bind9/bin/named/lwderror.c
+++ b/contrib/bind9/bin/named/lwderror.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwderror.c,v 1.12 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: lwderror.c,v 1.12 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/lwdgabn.c b/contrib/bind9/bin/named/lwdgabn.c
index dec1e1a..66d7246 100644
--- a/contrib/bind9/bin/named/lwdgabn.c
+++ b/contrib/bind9/bin/named/lwdgabn.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwdgabn.c,v 1.22 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: lwdgabn.c,v 1.22 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/lwdgnba.c b/contrib/bind9/bin/named/lwdgnba.c
index dfc2ad6..64b05d6 100644
--- a/contrib/bind9/bin/named/lwdgnba.c
+++ b/contrib/bind9/bin/named/lwdgnba.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwdgnba.c,v 1.22 2008/01/14 23:46:56 tbox Exp $ */
+/* $Id: lwdgnba.c,v 1.22 2008-01-14 23:46:56 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/lwdgrbn.c b/contrib/bind9/bin/named/lwdgrbn.c
index b54e83d..bf29a48 100644
--- a/contrib/bind9/bin/named/lwdgrbn.c
+++ b/contrib/bind9/bin/named/lwdgrbn.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwdgrbn.c,v 1.20 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: lwdgrbn.c,v 1.20 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/lwdnoop.c b/contrib/bind9/bin/named/lwdnoop.c
index 14d8e0c..eebe39d 100644
--- a/contrib/bind9/bin/named/lwdnoop.c
+++ b/contrib/bind9/bin/named/lwdnoop.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwdnoop.c,v 1.13 2008/01/22 23:28:04 tbox Exp $ */
+/* $Id: lwdnoop.c,v 1.13 2008-01-22 23:28:04 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/lwresd.8 b/contrib/bind9/bin/named/lwresd.8
index 56d272b..d1e760d 100644
--- a/contrib/bind9/bin/named/lwresd.8
+++ b/contrib/bind9/bin/named/lwresd.8
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwresd.8,v 1.29.14.2 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwresd.8,v 1.29.14.2 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/named/lwresd.c b/contrib/bind9/bin/named/lwresd.c
index 4e245fd..b7dc0af 100644
--- a/contrib/bind9/bin/named/lwresd.c
+++ b/contrib/bind9/bin/named/lwresd.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwresd.c,v 1.58 2008/07/23 23:27:54 marka Exp $ */
+/* $Id: lwresd.c,v 1.58 2008-07-23 23:27:54 marka Exp $ */
/*! \file
* \brief
diff --git a/contrib/bind9/bin/named/lwresd.docbook b/contrib/bind9/bin/named/lwresd.docbook
index 8d9985a..f8e1500 100644
--- a/contrib/bind9/bin/named/lwresd.docbook
+++ b/contrib/bind9/bin/named/lwresd.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwresd.docbook,v 1.18.14.2 2009/01/22 23:47:05 tbox Exp $ -->
+<!-- $Id: lwresd.docbook,v 1.18.14.2 2009-01-22 23:47:05 tbox Exp $ -->
<refentry>
<refentryinfo>
<date>June 30, 2000</date>
diff --git a/contrib/bind9/bin/named/lwresd.html b/contrib/bind9/bin/named/lwresd.html
index 728acc8..dec47ca 100644
--- a/contrib/bind9/bin/named/lwresd.html
+++ b/contrib/bind9/bin/named/lwresd.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwresd.html,v 1.25.14.2 2009/07/11 01:55:21 tbox Exp $ -->
+<!-- $Id: lwresd.html,v 1.25.14.2 2009-07-11 01:55:21 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/named/lwsearch.c b/contrib/bind9/bin/named/lwsearch.c
index 6754c98..8ad6779 100644
--- a/contrib/bind9/bin/named/lwsearch.c
+++ b/contrib/bind9/bin/named/lwsearch.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwsearch.c,v 1.13 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: lwsearch.c,v 1.13 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/named.8 b/contrib/bind9/bin/named/named.8
index 2874272..90782ed 100644
--- a/contrib/bind9/bin/named/named.8
+++ b/contrib/bind9/bin/named/named.8
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: named.8,v 1.38.14.2 2009/12/03 05:06:38 tbox Exp $
+.\" $Id: named.8,v 1.38.14.2 2009-12-03 05:06:38 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/named/named.conf.5 b/contrib/bind9/bin/named/named.conf.5
index 3206f5d..cd0d4ad 100644
--- a/contrib/bind9/bin/named/named.conf.5
+++ b/contrib/bind9/bin/named/named.conf.5
@@ -12,7 +12,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: named.conf.5,v 1.36.48.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: named.conf.5,v 1.36.48.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/named/named.conf.docbook b/contrib/bind9/bin/named/named.conf.docbook
index a4a8044..d98e289 100644
--- a/contrib/bind9/bin/named/named.conf.docbook
+++ b/contrib/bind9/bin/named/named.conf.docbook
@@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named.conf.docbook,v 1.39 2008/09/24 02:46:21 marka Exp $ -->
+<!-- $Id: named.conf.docbook,v 1.39 2008-09-24 02:46:21 marka Exp $ -->
<refentry>
<refentryinfo>
<date>Aug 13, 2004</date>
diff --git a/contrib/bind9/bin/named/named.conf.html b/contrib/bind9/bin/named/named.conf.html
index 190f0c1..fccad18 100644
--- a/contrib/bind9/bin/named/named.conf.html
+++ b/contrib/bind9/bin/named/named.conf.html
@@ -13,7 +13,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named.conf.html,v 1.45.48.1 2009/07/11 01:55:21 tbox Exp $ -->
+<!-- $Id: named.conf.html,v 1.45.48.1 2009-07-11 01:55:21 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/named/named.docbook b/contrib/bind9/bin/named/named.docbook
index 246c4f5..808e998 100644
--- a/contrib/bind9/bin/named/named.docbook
+++ b/contrib/bind9/bin/named/named.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named.docbook,v 1.23.14.2 2009/12/03 04:49:32 tbox Exp $ -->
+<!-- $Id: named.docbook,v 1.23.14.2 2009-12-03 04:49:32 tbox Exp $ -->
<refentry id="man.named">
<refentryinfo>
<date>May 21, 2009</date>
diff --git a/contrib/bind9/bin/named/named.html b/contrib/bind9/bin/named/named.html
index 3522475..031b492 100644
--- a/contrib/bind9/bin/named/named.html
+++ b/contrib/bind9/bin/named/named.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: named.html,v 1.30.14.2 2009/12/03 05:06:38 tbox Exp $ -->
+<!-- $Id: named.html,v 1.30.14.2 2009-12-03 05:06:38 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/named/notify.c b/contrib/bind9/bin/named/notify.c
index de52b8c..da5a651 100644
--- a/contrib/bind9/bin/named/notify.c
+++ b/contrib/bind9/bin/named/notify.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: notify.c,v 1.37 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: notify.c,v 1.37 2007-06-19 23:46:59 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/bin/named/sortlist.c b/contrib/bind9/bin/named/sortlist.c
index daefa07..0710fb1 100644
--- a/contrib/bind9/bin/named/sortlist.c
+++ b/contrib/bind9/bin/named/sortlist.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sortlist.c,v 1.17 2007/09/14 01:46:05 marka Exp $ */
+/* $Id: sortlist.c,v 1.17 2007-09-14 01:46:05 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/statschannel.c b/contrib/bind9/bin/named/statschannel.c
index 4773ec6..c77d3ca 100644
--- a/contrib/bind9/bin/named/statschannel.c
+++ b/contrib/bind9/bin/named/statschannel.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: statschannel.c,v 1.14.64.11 2010/02/04 23:47:46 tbox Exp $ */
+/* $Id: statschannel.c,v 1.14.64.11 2010-02-04 23:47:46 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/tkeyconf.c b/contrib/bind9/bin/named/tkeyconf.c
index 82cf573..7344978 100644
--- a/contrib/bind9/bin/named/tkeyconf.c
+++ b/contrib/bind9/bin/named/tkeyconf.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tkeyconf.c,v 1.29 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: tkeyconf.c,v 1.29 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/tsigconf.c b/contrib/bind9/bin/named/tsigconf.c
index b3c6e02..e90a86b 100644
--- a/contrib/bind9/bin/named/tsigconf.c
+++ b/contrib/bind9/bin/named/tsigconf.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tsigconf.c,v 1.30 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: tsigconf.c,v 1.30 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/unix/Makefile.in b/contrib/bind9/bin/named/unix/Makefile.in
index 5092834..502db25 100644
--- a/contrib/bind9/bin/named/unix/Makefile.in
+++ b/contrib/bind9/bin/named/unix/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.10 2007/06/19 23:46:59 tbox Exp $
+# $Id: Makefile.in,v 1.10 2007-06-19 23:46:59 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/named/unix/include/named/os.h b/contrib/bind9/bin/named/unix/include/named/os.h
index d03bf75..0a84608 100644
--- a/contrib/bind9/bin/named/unix/include/named/os.h
+++ b/contrib/bind9/bin/named/unix/include/named/os.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: os.h,v 1.29 2008/10/24 01:44:48 tbox Exp $ */
+/* $Id: os.h,v 1.29 2008-10-24 01:44:48 tbox Exp $ */
#ifndef NS_OS_H
#define NS_OS_H 1
diff --git a/contrib/bind9/bin/named/unix/os.c b/contrib/bind9/bin/named/unix/os.c
index 5e6b98f..3f07784 100644
--- a/contrib/bind9/bin/named/unix/os.c
+++ b/contrib/bind9/bin/named/unix/os.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: os.c,v 1.89.12.5 2009/03/02 03:03:54 marka Exp $ */
+/* $Id: os.c,v 1.89.12.5 2009-03-02 03:03:54 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/named/zoneconf.c b/contrib/bind9/bin/named/zoneconf.c
index 641831d..367ddd3 100644
--- a/contrib/bind9/bin/named/zoneconf.c
+++ b/contrib/bind9/bin/named/zoneconf.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zoneconf.c,v 1.147.50.2 2009/01/29 23:47:44 tbox Exp $ */
+/* $Id: zoneconf.c,v 1.147.50.2 2009-01-29 23:47:44 tbox Exp $ */
/*% */
diff --git a/contrib/bind9/bin/nsupdate/Makefile.in b/contrib/bind9/bin/nsupdate/Makefile.in
index 6d65697..f7f6346 100644
--- a/contrib/bind9/bin/nsupdate/Makefile.in
+++ b/contrib/bind9/bin/nsupdate/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.29 2008/08/29 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.29 2008-08-29 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/nsupdate/nsupdate.c b/contrib/bind9/bin/nsupdate/nsupdate.c
index d9ee488..69d390d 100644
--- a/contrib/bind9/bin/nsupdate/nsupdate.c
+++ b/contrib/bind9/bin/nsupdate/nsupdate.c
@@ -617,8 +617,10 @@ setup_keyfile(void) {
keyfile, isc_result_totext(result));
return;
}
- } else
+ } else {
dst_key_attach(dstkey, &sig0key);
+ dst_key_free(&dstkey);
+ }
}
static void
diff --git a/contrib/bind9/bin/rndc/Makefile.in b/contrib/bind9/bin/rndc/Makefile.in
index 9b0e20d..27d4611 100644
--- a/contrib/bind9/bin/rndc/Makefile.in
+++ b/contrib/bind9/bin/rndc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.44 2007/06/18 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.44 2007-06-18 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/rndc/include/rndc/os.h b/contrib/bind9/bin/rndc/include/rndc/os.h
index 253dcba..9f96165 100644
--- a/contrib/bind9/bin/rndc/include/rndc/os.h
+++ b/contrib/bind9/bin/rndc/include/rndc/os.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: os.h,v 1.9.332.2 2009/01/18 23:47:35 tbox Exp $ */
+/* $Id: os.h,v 1.9.332.2 2009-01-18 23:47:35 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/rndc/rndc-confgen.8 b/contrib/bind9/bin/rndc/rndc-confgen.8
index d37c00a..db45df4 100644
--- a/contrib/bind9/bin/rndc/rndc-confgen.8
+++ b/contrib/bind9/bin/rndc/rndc-confgen.8
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: rndc-confgen.8,v 1.20.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: rndc-confgen.8,v 1.20.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/rndc/rndc-confgen.c b/contrib/bind9/bin/rndc/rndc-confgen.c
index 221135e..1cb0a0a 100644
--- a/contrib/bind9/bin/rndc/rndc-confgen.c
+++ b/contrib/bind9/bin/rndc/rndc-confgen.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rndc-confgen.c,v 1.26 2008/10/15 23:47:31 tbox Exp $ */
+/* $Id: rndc-confgen.c,v 1.26 2008-10-15 23:47:31 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/rndc/rndc-confgen.docbook b/contrib/bind9/bin/rndc/rndc-confgen.docbook
index 4c51da5..f71dd9f 100644
--- a/contrib/bind9/bin/rndc/rndc-confgen.docbook
+++ b/contrib/bind9/bin/rndc/rndc-confgen.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: rndc-confgen.docbook,v 1.13 2007/06/18 23:47:25 tbox Exp $ -->
+<!-- $Id: rndc-confgen.docbook,v 1.13 2007-06-18 23:47:25 tbox Exp $ -->
<refentry id="man.rndc-confgen">
<refentryinfo>
<date>Aug 27, 2001</date>
diff --git a/contrib/bind9/bin/rndc/rndc-confgen.html b/contrib/bind9/bin/rndc/rndc-confgen.html
index 41debdc..6ef1073 100644
--- a/contrib/bind9/bin/rndc/rndc-confgen.html
+++ b/contrib/bind9/bin/rndc/rndc-confgen.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: rndc-confgen.html,v 1.25.418.1 2009/07/11 01:55:21 tbox Exp $ -->
+<!-- $Id: rndc-confgen.html,v 1.25.418.1 2009-07-11 01:55:21 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/rndc/rndc.8 b/contrib/bind9/bin/rndc/rndc.8
index 8ab0df2..285ca9b 100644
--- a/contrib/bind9/bin/rndc/rndc.8
+++ b/contrib/bind9/bin/rndc/rndc.8
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: rndc.8,v 1.42.214.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: rndc.8,v 1.42.214.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/rndc/rndc.c b/contrib/bind9/bin/rndc/rndc.c
index c3d4cb7..133103e 100644
--- a/contrib/bind9/bin/rndc/rndc.c
+++ b/contrib/bind9/bin/rndc/rndc.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rndc.c,v 1.122.44.2 2009/01/18 23:47:35 tbox Exp $ */
+/* $Id: rndc.c,v 1.122.44.2 2009-01-18 23:47:35 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/rndc/rndc.conf b/contrib/bind9/bin/rndc/rndc.conf
index 67542b9..057028a 100644
--- a/contrib/bind9/bin/rndc/rndc.conf
+++ b/contrib/bind9/bin/rndc/rndc.conf
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rndc.conf,v 1.11 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: rndc.conf,v 1.11 2007-06-19 23:46:59 tbox Exp $ */
/*
* Sample rndc configuration file.
diff --git a/contrib/bind9/bin/rndc/rndc.conf.5 b/contrib/bind9/bin/rndc/rndc.conf.5
index edb3a36..d7ad81e 100644
--- a/contrib/bind9/bin/rndc/rndc.conf.5
+++ b/contrib/bind9/bin/rndc/rndc.conf.5
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: rndc.conf.5,v 1.38.366.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: rndc.conf.5,v 1.38.366.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/bin/rndc/rndc.conf.docbook b/contrib/bind9/bin/rndc/rndc.conf.docbook
index 9de19954..4a92682 100644
--- a/contrib/bind9/bin/rndc/rndc.conf.docbook
+++ b/contrib/bind9/bin/rndc/rndc.conf.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: rndc.conf.docbook,v 1.17 2007/06/18 23:47:25 tbox Exp $ -->
+<!-- $Id: rndc.conf.docbook,v 1.17 2007-06-18 23:47:25 tbox Exp $ -->
<refentry id="man.rndc.conf">
<refentryinfo>
<date>June 30, 2000</date>
diff --git a/contrib/bind9/bin/rndc/rndc.conf.html b/contrib/bind9/bin/rndc/rndc.conf.html
index 6fbaaa2..114cc15 100644
--- a/contrib/bind9/bin/rndc/rndc.conf.html
+++ b/contrib/bind9/bin/rndc/rndc.conf.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: rndc.conf.html,v 1.29.366.1 2009/07/11 01:55:21 tbox Exp $ -->
+<!-- $Id: rndc.conf.html,v 1.29.366.1 2009-07-11 01:55:21 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/rndc/rndc.docbook b/contrib/bind9/bin/rndc/rndc.docbook
index d407f2b..3bf6325 100644
--- a/contrib/bind9/bin/rndc/rndc.docbook
+++ b/contrib/bind9/bin/rndc/rndc.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: rndc.docbook,v 1.21 2007/12/14 20:39:14 marka Exp $ -->
+<!-- $Id: rndc.docbook,v 1.21 2007-12-14 20:39:14 marka Exp $ -->
<refentry id="man.rndc">
<refentryinfo>
<date>June 30, 2000</date>
diff --git a/contrib/bind9/bin/rndc/rndc.html b/contrib/bind9/bin/rndc/rndc.html
index 52c862a..0d91784 100644
--- a/contrib/bind9/bin/rndc/rndc.html
+++ b/contrib/bind9/bin/rndc/rndc.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: rndc.html,v 1.31.214.1 2009/07/11 01:55:21 tbox Exp $ -->
+<!-- $Id: rndc.html,v 1.31.214.1 2009-07-11 01:55:21 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/bin/rndc/unix/Makefile.in b/contrib/bind9/bin/rndc/unix/Makefile.in
index 31a0532..e503db3 100644
--- a/contrib/bind9/bin/rndc/unix/Makefile.in
+++ b/contrib/bind9/bin/rndc/unix/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.5 2007/06/19 23:46:59 tbox Exp $
+# $Id: Makefile.in,v 1.5 2007-06-19 23:46:59 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/bin/rndc/unix/os.c b/contrib/bind9/bin/rndc/unix/os.c
index ddf8259..e9ece1b 100644
--- a/contrib/bind9/bin/rndc/unix/os.c
+++ b/contrib/bind9/bin/rndc/unix/os.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: os.c,v 1.10 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: os.c,v 1.10 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/rndc/util.c b/contrib/bind9/bin/rndc/util.c
index c654462..8a7078a 100644
--- a/contrib/bind9/bin/rndc/util.c
+++ b/contrib/bind9/bin/rndc/util.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: util.c,v 1.7 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: util.c,v 1.7 2007-06-19 23:46:59 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/bin/rndc/util.h b/contrib/bind9/bin/rndc/util.h
index 7adcaa5..c5da488 100644
--- a/contrib/bind9/bin/rndc/util.h
+++ b/contrib/bind9/bin/rndc/util.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: util.h,v 1.10 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: util.h,v 1.10 2007-06-19 23:46:59 tbox Exp $ */
#ifndef RNDC_UTIL_H
#define RNDC_UTIL_H 1
diff --git a/contrib/bind9/doc/Makefile.in b/contrib/bind9/doc/Makefile.in
index 14d35bc..41d1f97 100644
--- a/contrib/bind9/doc/Makefile.in
+++ b/contrib/bind9/doc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.11 2007/06/19 23:47:13 tbox Exp $
+# $Id: Makefile.in,v 1.11 2007-06-19 23:47:13 tbox Exp $
# This Makefile is a placeholder. It exists merely to make
# sure that its directory gets created in the object directory
diff --git a/contrib/bind9/doc/arm/Bv9ARM.ch01.html b/contrib/bind9/doc/arm/Bv9ARM.ch01.html
index ea561e6..4cdfb09 100644
--- a/contrib/bind9/doc/arm/Bv9ARM.ch01.html
+++ b/contrib/bind9/doc/arm/Bv9ARM.ch01.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: Bv9ARM.ch01.html,v 1.43.48.4 2010/01/24 01:55:26 tbox Exp $ -->
+<!-- $Id: Bv9ARM.ch01.html,v 1.43.48.4 2010-01-24 01:55:26 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/doc/arm/Bv9ARM.ch02.html b/contrib/bind9/doc/arm/Bv9ARM.ch02.html
index b279c67..5181a2a 100644
--- a/contrib/bind9/doc/arm/Bv9ARM.ch02.html
+++ b/contrib/bind9/doc/arm/Bv9ARM.ch02.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: Bv9ARM.ch02.html,v 1.38.56.3 2010/01/24 01:55:25 tbox Exp $ -->
+<!-- $Id: Bv9ARM.ch02.html,v 1.38.56.3 2010-01-24 01:55:25 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/doc/arm/Bv9ARM.ch03.html b/contrib/bind9/doc/arm/Bv9ARM.ch03.html
index 59d7e73..454fdd6 100644
--- a/contrib/bind9/doc/arm/Bv9ARM.ch03.html
+++ b/contrib/bind9/doc/arm/Bv9ARM.ch03.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: Bv9ARM.ch03.html,v 1.71.48.4 2010/01/24 01:55:25 tbox Exp $ -->
+<!-- $Id: Bv9ARM.ch03.html,v 1.71.48.4 2010-01-24 01:55:25 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/doc/arm/Bv9ARM.ch04.html b/contrib/bind9/doc/arm/Bv9ARM.ch04.html
index 2be5791..7b8a200 100644
--- a/contrib/bind9/doc/arm/Bv9ARM.ch04.html
+++ b/contrib/bind9/doc/arm/Bv9ARM.ch04.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: Bv9ARM.ch04.html,v 1.87.48.6 2010/01/24 01:55:26 tbox Exp $ -->
+<!-- $Id: Bv9ARM.ch04.html,v 1.87.48.6 2010-01-24 01:55:26 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/doc/arm/Bv9ARM.ch05.html b/contrib/bind9/doc/arm/Bv9ARM.ch05.html
index e84781f..b0339b4 100644
--- a/contrib/bind9/doc/arm/Bv9ARM.ch05.html
+++ b/contrib/bind9/doc/arm/Bv9ARM.ch05.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: Bv9ARM.ch05.html,v 1.71.48.6 2010/01/24 01:55:26 tbox Exp $ -->
+<!-- $Id: Bv9ARM.ch05.html,v 1.71.48.6 2010-01-24 01:55:26 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/doc/arm/Bv9ARM.ch10.html b/contrib/bind9/doc/arm/Bv9ARM.ch10.html
index 452717c..6929485 100644
--- a/contrib/bind9/doc/arm/Bv9ARM.ch10.html
+++ b/contrib/bind9/doc/arm/Bv9ARM.ch10.html
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: Bv9ARM.ch10.html,v 1.11.14.3 2010/01/24 01:55:26 tbox Exp $ -->
+<!-- $Id: Bv9ARM.ch10.html,v 1.11.14.3 2010-01-24 01:55:26 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
diff --git a/contrib/bind9/doc/arm/Makefile.in b/contrib/bind9/doc/arm/Makefile.in
index 5fa267e..5098528 100644
--- a/contrib/bind9/doc/arm/Makefile.in
+++ b/contrib/bind9/doc/arm/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.20.332.2 2009/02/12 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.20.332.2 2009-02-12 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/doc/arm/README-SGML b/contrib/bind9/doc/arm/README-SGML
index e33c937..ef2f928 100644
--- a/contrib/bind9/doc/arm/README-SGML
+++ b/contrib/bind9/doc/arm/README-SGML
@@ -4,7 +4,7 @@ See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
The BIND v9 ARM master document is now kept in DocBook XML format.
-Version: $Id: README-SGML,v 1.17 2004/03/05 05:04:43 marka Exp $
+Version: $Id: README-SGML,v 1.17 2004-03-05 05:04:43 marka Exp $
The entire ARM is in the single file:
diff --git a/contrib/bind9/doc/misc/Makefile.in b/contrib/bind9/doc/misc/Makefile.in
index 24ef3bc..5a671b8 100644
--- a/contrib/bind9/doc/misc/Makefile.in
+++ b/contrib/bind9/doc/misc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.7.252.2 2009/07/11 23:47:17 tbox Exp $
+# $Id: Makefile.in,v 1.7.252.2 2009-07-11 23:47:17 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/doc/misc/dnssec b/contrib/bind9/doc/misc/dnssec
index 4451e6c..ebff52e 100644
--- a/contrib/bind9/doc/misc/dnssec
+++ b/contrib/bind9/doc/misc/dnssec
@@ -81,4 +81,4 @@ future as we consider them inferior to the use of TSIG or SIG(0) to
ensure the integrity of zone transfers.
-$Id: dnssec,v 1.19 2004/03/05 05:04:53 marka Exp $
+$Id: dnssec,v 1.19 2004-03-05 05:04:53 marka Exp $
diff --git a/contrib/bind9/doc/misc/format-options.pl b/contrib/bind9/doc/misc/format-options.pl
index b0b8d52..91e5464 100644
--- a/contrib/bind9/doc/misc/format-options.pl
+++ b/contrib/bind9/doc/misc/format-options.pl
@@ -15,7 +15,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: format-options.pl,v 1.5 2007/09/24 04:21:59 marka Exp $
+# $Id: format-options.pl,v 1.5 2007-09-24 04:21:59 marka Exp $
print <<END;
diff --git a/contrib/bind9/doc/misc/ipv6 b/contrib/bind9/doc/misc/ipv6
index 4060bc3..cd3529f 100644
--- a/contrib/bind9/doc/misc/ipv6
+++ b/contrib/bind9/doc/misc/ipv6
@@ -110,4 +110,4 @@ RELEVANT RFCs
3542: Advanced Sockets Application Program Interface (API) for IPv6
-$Id: ipv6,v 1.9 2004/08/10 04:27:51 jinmei Exp $
+$Id: ipv6,v 1.9 2004-08-10 04:27:51 jinmei Exp $
diff --git a/contrib/bind9/doc/misc/migration b/contrib/bind9/doc/misc/migration
index 21856bf..71874f2 100644
--- a/contrib/bind9/doc/misc/migration
+++ b/contrib/bind9/doc/misc/migration
@@ -264,4 +264,4 @@ necessary, the umask should be set explicitly in the script used to
start the named process.
-$Id: migration,v 1.49 2008/03/18 15:42:53 jreed Exp $
+$Id: migration,v 1.49 2008-03-18 15:42:53 jreed Exp $
diff --git a/contrib/bind9/doc/misc/migration-4to9 b/contrib/bind9/doc/misc/migration-4to9
index 008cbed..6a2b28d 100644
--- a/contrib/bind9/doc/misc/migration-4to9
+++ b/contrib/bind9/doc/misc/migration-4to9
@@ -2,7 +2,7 @@ Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 2001 Internet Software Consortium.
See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
-$Id: migration-4to9,v 1.4 2004/03/05 05:04:53 marka Exp $
+$Id: migration-4to9,v 1.4 2004-03-05 05:04:53 marka Exp $
BIND 4 to BIND 9 Migration Notes
diff --git a/contrib/bind9/doc/misc/rfc-compliance b/contrib/bind9/doc/misc/rfc-compliance
index 4c87c66..cd62fcd 100644
--- a/contrib/bind9/doc/misc/rfc-compliance
+++ b/contrib/bind9/doc/misc/rfc-compliance
@@ -2,7 +2,7 @@ Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 2001 Internet Software Consortium.
See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
-$Id: rfc-compliance,v 1.4 2004/03/05 05:04:53 marka Exp $
+$Id: rfc-compliance,v 1.4 2004-03-05 05:04:53 marka Exp $
BIND 9 is striving for strict compliance with IETF standards. We
believe this release of BIND 9 complies with the following RFCs, with
diff --git a/contrib/bind9/doc/misc/roadmap b/contrib/bind9/doc/misc/roadmap
index f63a469..f99eb87 100644
--- a/contrib/bind9/doc/misc/roadmap
+++ b/contrib/bind9/doc/misc/roadmap
@@ -2,7 +2,7 @@ Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 2000, 2001 Internet Software Consortium.
See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
-$Id: roadmap,v 1.2 2004/03/05 05:04:54 marka Exp $
+$Id: roadmap,v 1.2 2004-03-05 05:04:54 marka Exp $
Road Map to the BIND 9 Source Tree
diff --git a/contrib/bind9/doc/misc/sdb b/contrib/bind9/doc/misc/sdb
index 552028a..764a216 100644
--- a/contrib/bind9/doc/misc/sdb
+++ b/contrib/bind9/doc/misc/sdb
@@ -166,4 +166,4 @@ Future Directions
A future release may support dynamic loading of sdb drivers.
-$Id: sdb,v 1.6 2004/03/05 05:04:54 marka Exp $
+$Id: sdb,v 1.6 2004-03-05 05:04:54 marka Exp $
diff --git a/contrib/bind9/doc/misc/sort-options.pl b/contrib/bind9/doc/misc/sort-options.pl
index 4251521..e2b411a 100755
--- a/contrib/bind9/doc/misc/sort-options.pl
+++ b/contrib/bind9/doc/misc/sort-options.pl
@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: sort-options.pl,v 1.3 2007/09/24 23:46:48 tbox Exp $
+# $Id: sort-options.pl,v 1.3 2007-09-24 23:46:48 tbox Exp $
sub sortlevel() {
my @options = ();
diff --git a/contrib/bind9/isc-config.sh.in b/contrib/bind9/isc-config.sh.in
index 0eafca7..f23d6cd 100644
--- a/contrib/bind9/isc-config.sh.in
+++ b/contrib/bind9/isc-config.sh.in
@@ -15,7 +15,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: isc-config.sh.in,v 1.17 2007/06/19 23:46:59 tbox Exp $
+# $Id: isc-config.sh.in,v 1.17 2007-06-19 23:46:59 tbox Exp $
prefix=@prefix@
exec_prefix=@exec_prefix@
diff --git a/contrib/bind9/lib/Makefile.in b/contrib/bind9/lib/Makefile.in
index e46aef2..7fd149c 100644
--- a/contrib/bind9/lib/Makefile.in
+++ b/contrib/bind9/lib/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.21 2007/06/19 23:47:13 tbox Exp $
+# $Id: Makefile.in,v 1.21 2007-06-19 23:47:13 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/bind9/Makefile.in b/contrib/bind9/lib/bind9/Makefile.in
index 7c1e5b0..e37d524 100644
--- a/contrib/bind9/lib/bind9/Makefile.in
+++ b/contrib/bind9/lib/bind9/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.11 2007/06/19 23:47:16 tbox Exp $
+# $Id: Makefile.in,v 1.11 2007-06-19 23:47:16 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/bind9/getaddresses.c b/contrib/bind9/lib/bind9/getaddresses.c
index a75e14e..70af7a1 100644
--- a/contrib/bind9/lib/bind9/getaddresses.c
+++ b/contrib/bind9/lib/bind9/getaddresses.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getaddresses.c,v 1.22 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: getaddresses.c,v 1.22 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/bind9/include/Makefile.in b/contrib/bind9/lib/bind9/include/Makefile.in
index 65eecb0..f2d8caa 100644
--- a/contrib/bind9/lib/bind9/include/Makefile.in
+++ b/contrib/bind9/lib/bind9/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.4 2007/06/19 23:47:16 tbox Exp $
+# $Id: Makefile.in,v 1.4 2007-06-19 23:47:16 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/bind9/include/bind9/Makefile.in b/contrib/bind9/lib/bind9/include/bind9/Makefile.in
index 8abfaf6..a6a2683 100644
--- a/contrib/bind9/lib/bind9/include/bind9/Makefile.in
+++ b/contrib/bind9/lib/bind9/include/bind9/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.8 2007/06/19 23:47:16 tbox Exp $
+# $Id: Makefile.in,v 1.8 2007-06-19 23:47:16 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/bind9/include/bind9/check.h b/contrib/bind9/lib/bind9/include/bind9/check.h
index 1647568..89cf57f 100644
--- a/contrib/bind9/lib/bind9/include/bind9/check.h
+++ b/contrib/bind9/lib/bind9/include/bind9/check.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: check.h,v 1.9 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: check.h,v 1.9 2007-06-19 23:47:16 tbox Exp $ */
#ifndef BIND9_CHECK_H
#define BIND9_CHECK_H 1
diff --git a/contrib/bind9/lib/bind9/include/bind9/getaddresses.h b/contrib/bind9/lib/bind9/include/bind9/getaddresses.h
index 736feb6..677ced2 100644
--- a/contrib/bind9/lib/bind9/include/bind9/getaddresses.h
+++ b/contrib/bind9/lib/bind9/include/bind9/getaddresses.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getaddresses.h,v 1.9.332.2 2009/01/18 23:47:35 tbox Exp $ */
+/* $Id: getaddresses.h,v 1.9.332.2 2009-01-18 23:47:35 tbox Exp $ */
#ifndef BIND9_GETADDRESSES_H
#define BIND9_GETADDRESSES_H 1
diff --git a/contrib/bind9/lib/bind9/include/bind9/version.h b/contrib/bind9/lib/bind9/include/bind9/version.h
index 5b08b7c..d4c8468 100644
--- a/contrib/bind9/lib/bind9/include/bind9/version.h
+++ b/contrib/bind9/lib/bind9/include/bind9/version.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.h,v 1.9 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: version.h,v 1.9 2007-06-19 23:47:16 tbox Exp $ */
/*! \file bind9/version.h */
diff --git a/contrib/bind9/lib/bind9/version.c b/contrib/bind9/lib/bind9/version.c
index d5934cc..46b7b6b 100644
--- a/contrib/bind9/lib/bind9/version.c
+++ b/contrib/bind9/lib/bind9/version.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.c,v 1.8 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: version.c,v 1.8 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/acache.c b/contrib/bind9/lib/dns/acache.c
index 2ad4981..22f14c1 100644
--- a/contrib/bind9/lib/dns/acache.c
+++ b/contrib/bind9/lib/dns/acache.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acache.c,v 1.22 2008/02/07 23:46:54 tbox Exp $ */
+/* $Id: acache.c,v 1.22 2008-02-07 23:46:54 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/dns/acl.c b/contrib/bind9/lib/dns/acl.c
index 3af8dd3..cfb7fd8 100644
--- a/contrib/bind9/lib/dns/acl.c
+++ b/contrib/bind9/lib/dns/acl.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acl.c,v 1.50.44.3 2009/01/18 23:47:35 tbox Exp $ */
+/* $Id: acl.c,v 1.50.44.3 2009-01-18 23:47:35 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/api b/contrib/bind9/lib/dns/api
index 29ebff2..a04d4bc 100644
--- a/contrib/bind9/lib/dns/api
+++ b/contrib/bind9/lib/dns/api
@@ -1,3 +1,3 @@
LIBINTERFACE = 59
-LIBREVISION = 2
+LIBREVISION = 4
LIBAGE = 1
diff --git a/contrib/bind9/lib/dns/byaddr.c b/contrib/bind9/lib/dns/byaddr.c
index 234d6b2..96b9f38 100644
--- a/contrib/bind9/lib/dns/byaddr.c
+++ b/contrib/bind9/lib/dns/byaddr.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: byaddr.c,v 1.39 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: byaddr.c,v 1.39 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/cache.c b/contrib/bind9/lib/dns/cache.c
index aee824e..28ead66 100644
--- a/contrib/bind9/lib/dns/cache.c
+++ b/contrib/bind9/lib/dns/cache.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cache.c,v 1.80.50.3 2009/05/06 23:34:30 jinmei Exp $ */
+/* $Id: cache.c,v 1.80.50.3 2009-05-06 23:34:30 jinmei Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/callbacks.c b/contrib/bind9/lib/dns/callbacks.c
index 928f37d..474d4e2 100644
--- a/contrib/bind9/lib/dns/callbacks.c
+++ b/contrib/bind9/lib/dns/callbacks.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: callbacks.c,v 1.17 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: callbacks.c,v 1.17 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/compress.c b/contrib/bind9/lib/dns/compress.c
index 11473ee..4097ed1 100644
--- a/contrib/bind9/lib/dns/compress.c
+++ b/contrib/bind9/lib/dns/compress.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: compress.c,v 1.59 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: compress.c,v 1.59 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/db.c b/contrib/bind9/lib/dns/db.c
index 02ea6b5..f52f674 100644
--- a/contrib/bind9/lib/dns/db.c
+++ b/contrib/bind9/lib/dns/db.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: db.c,v 1.88.50.2 2009/06/23 00:19:34 tbox Exp $ */
+/* $Id: db.c,v 1.88.50.2 2009-06-23 00:19:34 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/dbiterator.c b/contrib/bind9/lib/dns/dbiterator.c
index 8981e49..3828e1e 100644
--- a/contrib/bind9/lib/dns/dbiterator.c
+++ b/contrib/bind9/lib/dns/dbiterator.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dbiterator.c,v 1.18 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: dbiterator.c,v 1.18 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/dbtable.c b/contrib/bind9/lib/dns/dbtable.c
index 57bbfc1..0b90347 100644
--- a/contrib/bind9/lib/dns/dbtable.c
+++ b/contrib/bind9/lib/dns/dbtable.c
@@ -16,7 +16,7 @@
*/
/*
- * $Id: dbtable.c,v 1.33 2007/06/19 23:47:16 tbox Exp $
+ * $Id: dbtable.c,v 1.33 2007-06-19 23:47:16 tbox Exp $
*/
/*! \file
diff --git a/contrib/bind9/lib/dns/diff.c b/contrib/bind9/lib/dns/diff.c
index 9489821..a92a496 100644
--- a/contrib/bind9/lib/dns/diff.c
+++ b/contrib/bind9/lib/dns/diff.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: diff.c,v 1.18.50.2 2009/01/05 23:47:22 tbox Exp $ */
+/* $Id: diff.c,v 1.18.50.2 2009-01-05 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/dispatch.c b/contrib/bind9/lib/dns/dispatch.c
index 1d04961..632d349 100644
--- a/contrib/bind9/lib/dns/dispatch.c
+++ b/contrib/bind9/lib/dns/dispatch.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dispatch.c,v 1.155.12.11 2009/12/02 23:26:28 marka Exp $ */
+/* $Id: dispatch.c,v 1.155.12.11 2009-12-02 23:26:28 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/dlz.c b/contrib/bind9/lib/dns/dlz.c
index 75486af..f848230 100644
--- a/contrib/bind9/lib/dns/dlz.c
+++ b/contrib/bind9/lib/dns/dlz.c
@@ -50,7 +50,7 @@
* USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dlz.c,v 1.5.332.2 2009/01/18 23:47:35 tbox Exp $ */
+/* $Id: dlz.c,v 1.5.332.2 2009-01-18 23:47:35 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/dnssec.c b/contrib/bind9/lib/dns/dnssec.c
index 8ae29bc..67a2c67 100644
--- a/contrib/bind9/lib/dns/dnssec.c
+++ b/contrib/bind9/lib/dns/dnssec.c
@@ -16,7 +16,7 @@
*/
/*
- * $Id: dnssec.c,v 1.93.12.6 2009/06/22 23:47:18 tbox Exp $
+ * $Id: dnssec.c,v 1.93.12.6 2009-06-22 23:47:18 tbox Exp $
*/
/*! \file */
diff --git a/contrib/bind9/lib/dns/ds.c b/contrib/bind9/lib/dns/ds.c
index e994cc5..9cf5659 100644
--- a/contrib/bind9/lib/dns/ds.c
+++ b/contrib/bind9/lib/dns/ds.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ds.c,v 1.11 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: ds.c,v 1.11 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/dst_lib.c b/contrib/bind9/lib/dns/dst_lib.c
index f1021d3..edf479e 100644
--- a/contrib/bind9/lib/dns/dst_lib.c
+++ b/contrib/bind9/lib/dns/dst_lib.c
@@ -17,7 +17,7 @@
/*
* Principal Author: Brian Wellington
- * $Id: dst_lib.c,v 1.5 2007/06/19 23:47:16 tbox Exp $
+ * $Id: dst_lib.c,v 1.5 2007-06-19 23:47:16 tbox Exp $
*/
/*! \file */
diff --git a/contrib/bind9/lib/dns/dst_openssl.h b/contrib/bind9/lib/dns/dst_openssl.h
index 80eef93..a095d45 100644
--- a/contrib/bind9/lib/dns/dst_openssl.h
+++ b/contrib/bind9/lib/dns/dst_openssl.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dst_openssl.h,v 1.7 2008/04/01 23:47:10 tbox Exp $ */
+/* $Id: dst_openssl.h,v 1.7 2008-04-01 23:47:10 tbox Exp $ */
#ifndef DST_OPENSSL_H
#define DST_OPENSSL_H 1
diff --git a/contrib/bind9/lib/dns/dst_parse.c b/contrib/bind9/lib/dns/dst_parse.c
index e8ab34f..37264be 100644
--- a/contrib/bind9/lib/dns/dst_parse.c
+++ b/contrib/bind9/lib/dns/dst_parse.c
@@ -31,7 +31,7 @@
/*%
* Principal Author: Brian Wellington
- * $Id: dst_parse.c,v 1.14.120.6 2010/01/15 19:38:53 each Exp $
+ * $Id: dst_parse.c,v 1.14.120.6 2010-01-15 19:38:53 each Exp $
*/
#include <config.h>
diff --git a/contrib/bind9/lib/dns/dst_parse.h b/contrib/bind9/lib/dns/dst_parse.h
index 27c7580..11e2b33 100644
--- a/contrib/bind9/lib/dns/dst_parse.h
+++ b/contrib/bind9/lib/dns/dst_parse.h
@@ -29,7 +29,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dst_parse.h,v 1.11 2008/05/15 00:50:26 each Exp $ */
+/* $Id: dst_parse.h,v 1.11 2008-05-15 00:50:26 each Exp $ */
/*! \file */
#ifndef DST_DST_PARSE_H
diff --git a/contrib/bind9/lib/dns/dst_result.c b/contrib/bind9/lib/dns/dst_result.c
index 429dbb2..f077c2f 100644
--- a/contrib/bind9/lib/dns/dst_result.c
+++ b/contrib/bind9/lib/dns/dst_result.c
@@ -17,7 +17,7 @@
/*%
* Principal Author: Brian Wellington
- * $Id: dst_result.c,v 1.7 2008/04/01 23:47:10 tbox Exp $
+ * $Id: dst_result.c,v 1.7 2008-04-01 23:47:10 tbox Exp $
*/
#include <config.h>
diff --git a/contrib/bind9/lib/dns/forward.c b/contrib/bind9/lib/dns/forward.c
index 39e2ef5..1406b46 100644
--- a/contrib/bind9/lib/dns/forward.c
+++ b/contrib/bind9/lib/dns/forward.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: forward.c,v 1.12 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: forward.c,v 1.12 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/gen-unix.h b/contrib/bind9/lib/dns/gen-unix.h
index 4186f63..91cd4d5 100644
--- a/contrib/bind9/lib/dns/gen-unix.h
+++ b/contrib/bind9/lib/dns/gen-unix.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gen-unix.h,v 1.19.332.2 2009/01/18 23:47:35 tbox Exp $ */
+/* $Id: gen-unix.h,v 1.19.332.2 2009-01-18 23:47:35 tbox Exp $ */
/*! \file
* \brief
diff --git a/contrib/bind9/lib/dns/gen.c b/contrib/bind9/lib/dns/gen.c
index ede8bc0..6f8ce7d 100644
--- a/contrib/bind9/lib/dns/gen.c
+++ b/contrib/bind9/lib/dns/gen.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gen.c,v 1.83 2008/09/25 04:02:38 tbox Exp $ */
+/* $Id: gen.c,v 1.83 2008-09-25 04:02:38 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/gssapi_link.c b/contrib/bind9/lib/dns/gssapi_link.c
index 0dd27bb..a7af67f 100644
--- a/contrib/bind9/lib/dns/gssapi_link.c
+++ b/contrib/bind9/lib/dns/gssapi_link.c
@@ -16,7 +16,7 @@
*/
/*
- * $Id: gssapi_link.c,v 1.12 2008/11/11 03:55:01 marka Exp $
+ * $Id: gssapi_link.c,v 1.12 2008-11-11 03:55:01 marka Exp $
*/
#include <config.h>
diff --git a/contrib/bind9/lib/dns/hmac_link.c b/contrib/bind9/lib/dns/hmac_link.c
index fce98d7..5d6dce7 100644
--- a/contrib/bind9/lib/dns/hmac_link.c
+++ b/contrib/bind9/lib/dns/hmac_link.c
@@ -31,7 +31,7 @@
/*
* Principal Author: Brian Wellington
- * $Id: hmac_link.c,v 1.11 2008/04/01 23:47:10 tbox Exp $
+ * $Id: hmac_link.c,v 1.11 2008-04-01 23:47:10 tbox Exp $
*/
#include <config.h>
diff --git a/contrib/bind9/lib/dns/include/Makefile.in b/contrib/bind9/lib/dns/include/Makefile.in
index b52cb98..f448a42 100644
--- a/contrib/bind9/lib/dns/include/Makefile.in
+++ b/contrib/bind9/lib/dns/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.15 2007/06/19 23:47:16 tbox Exp $
+# $Id: Makefile.in,v 1.15 2007-06-19 23:47:16 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/dns/include/dns/Makefile.in b/contrib/bind9/lib/dns/include/dns/Makefile.in
index e9e049e..a4cd810 100644
--- a/contrib/bind9/lib/dns/include/dns/Makefile.in
+++ b/contrib/bind9/lib/dns/include/dns/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.55 2008/11/14 23:47:33 tbox Exp $
+# $Id: Makefile.in,v 1.55 2008-11-14 23:47:33 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/dns/include/dns/acache.h b/contrib/bind9/lib/dns/include/dns/acache.h
index 28990c2..a4f37b8 100644
--- a/contrib/bind9/lib/dns/include/dns/acache.h
+++ b/contrib/bind9/lib/dns/include/dns/acache.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acache.h,v 1.8 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: acache.h,v 1.8 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_ACACHE_H
#define DNS_ACACHE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/acl.h b/contrib/bind9/lib/dns/include/dns/acl.h
index 721fe51..1045cd2 100644
--- a/contrib/bind9/lib/dns/include/dns/acl.h
+++ b/contrib/bind9/lib/dns/include/dns/acl.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: acl.h,v 1.31.206.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: acl.h,v 1.31.206.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_ACL_H
#define DNS_ACL_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/adb.h b/contrib/bind9/lib/dns/include/dns/adb.h
index d4ac40c..bd6bd24 100644
--- a/contrib/bind9/lib/dns/include/dns/adb.h
+++ b/contrib/bind9/lib/dns/include/dns/adb.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: adb.h,v 1.85 2008/04/03 06:09:04 tbox Exp $ */
+/* $Id: adb.h,v 1.85 2008-04-03 06:09:04 tbox Exp $ */
#ifndef DNS_ADB_H
#define DNS_ADB_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/bit.h b/contrib/bind9/lib/dns/include/dns/bit.h
index 28c733d..020b21c 100644
--- a/contrib/bind9/lib/dns/include/dns/bit.h
+++ b/contrib/bind9/lib/dns/include/dns/bit.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: bit.h,v 1.14 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: bit.h,v 1.14 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_BIT_H
#define DNS_BIT_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/byaddr.h b/contrib/bind9/lib/dns/include/dns/byaddr.h
index edf8430..fcd3d34 100644
--- a/contrib/bind9/lib/dns/include/dns/byaddr.h
+++ b/contrib/bind9/lib/dns/include/dns/byaddr.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: byaddr.h,v 1.22 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: byaddr.h,v 1.22 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_BYADDR_H
#define DNS_BYADDR_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/cache.h b/contrib/bind9/lib/dns/include/dns/cache.h
index 7b37235..94077d6 100644
--- a/contrib/bind9/lib/dns/include/dns/cache.h
+++ b/contrib/bind9/lib/dns/include/dns/cache.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cache.h,v 1.26 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: cache.h,v 1.26 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_CACHE_H
#define DNS_CACHE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/callbacks.h b/contrib/bind9/lib/dns/include/dns/callbacks.h
index 8a8385a..1b92008 100644
--- a/contrib/bind9/lib/dns/include/dns/callbacks.h
+++ b/contrib/bind9/lib/dns/include/dns/callbacks.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: callbacks.h,v 1.24 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: callbacks.h,v 1.24 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_CALLBACKS_H
#define DNS_CALLBACKS_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/cert.h b/contrib/bind9/lib/dns/include/dns/cert.h
index 1cda848..31f404a 100644
--- a/contrib/bind9/lib/dns/include/dns/cert.h
+++ b/contrib/bind9/lib/dns/include/dns/cert.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cert.h,v 1.19 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: cert.h,v 1.19 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_CERT_H
#define DNS_CERT_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/compress.h b/contrib/bind9/lib/dns/include/dns/compress.h
index 4632aff..4181c77 100644
--- a/contrib/bind9/lib/dns/include/dns/compress.h
+++ b/contrib/bind9/lib/dns/include/dns/compress.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: compress.h,v 1.40.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: compress.h,v 1.40.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_COMPRESS_H
#define DNS_COMPRESS_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/db.h b/contrib/bind9/lib/dns/include/dns/db.h
index 9a1126d..f622834 100644
--- a/contrib/bind9/lib/dns/include/dns/db.h
+++ b/contrib/bind9/lib/dns/include/dns/db.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: db.h,v 1.93.50.5 2009/11/25 23:48:42 tbox Exp $ */
+/* $Id: db.h,v 1.93.50.5 2009-11-25 23:48:42 tbox Exp $ */
#ifndef DNS_DB_H
#define DNS_DB_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/dbiterator.h b/contrib/bind9/lib/dns/include/dns/dbiterator.h
index 366d676..48ba52c 100644
--- a/contrib/bind9/lib/dns/include/dns/dbiterator.h
+++ b/contrib/bind9/lib/dns/include/dns/dbiterator.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dbiterator.h,v 1.25 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: dbiterator.h,v 1.25 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_DBITERATOR_H
#define DNS_DBITERATOR_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/dbtable.h b/contrib/bind9/lib/dns/include/dns/dbtable.h
index 503de95..0915c95 100644
--- a/contrib/bind9/lib/dns/include/dns/dbtable.h
+++ b/contrib/bind9/lib/dns/include/dns/dbtable.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dbtable.h,v 1.23 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: dbtable.h,v 1.23 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_DBTABLE_H
#define DNS_DBTABLE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/dispatch.h b/contrib/bind9/lib/dns/include/dns/dispatch.h
index 96a44fe..6e2f3e1 100644
--- a/contrib/bind9/lib/dns/include/dns/dispatch.h
+++ b/contrib/bind9/lib/dns/include/dns/dispatch.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dispatch.h,v 1.60.82.2 2009/01/29 23:47:44 tbox Exp $ */
+/* $Id: dispatch.h,v 1.60.82.2 2009-01-29 23:47:44 tbox Exp $ */
#ifndef DNS_DISPATCH_H
#define DNS_DISPATCH_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/dlz.h b/contrib/bind9/lib/dns/include/dns/dlz.h
index 75ba99f..28a24a9 100644
--- a/contrib/bind9/lib/dns/include/dns/dlz.h
+++ b/contrib/bind9/lib/dns/include/dns/dlz.h
@@ -50,7 +50,7 @@
* USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dlz.h,v 1.7.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: dlz.h,v 1.7.332.2 2009-01-18 23:47:41 tbox Exp $ */
/*! \file dns/dlz.h */
diff --git a/contrib/bind9/lib/dns/include/dns/dnssec.h b/contrib/bind9/lib/dns/include/dns/dnssec.h
index 1446266..5a1468a 100644
--- a/contrib/bind9/lib/dns/include/dns/dnssec.h
+++ b/contrib/bind9/lib/dns/include/dns/dnssec.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnssec.h,v 1.32.332.6 2009/06/22 23:47:18 tbox Exp $ */
+/* $Id: dnssec.h,v 1.32.332.6 2009-06-22 23:47:18 tbox Exp $ */
#ifndef DNS_DNSSEC_H
#define DNS_DNSSEC_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/ds.h b/contrib/bind9/lib/dns/include/dns/ds.h
index b59fb83..77a2cb8 100644
--- a/contrib/bind9/lib/dns/include/dns/ds.h
+++ b/contrib/bind9/lib/dns/include/dns/ds.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ds.h,v 1.10 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: ds.h,v 1.10 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_DS_H
#define DNS_DS_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/fixedname.h b/contrib/bind9/lib/dns/include/dns/fixedname.h
index 5a2aaf3..17b995c 100644
--- a/contrib/bind9/lib/dns/include/dns/fixedname.h
+++ b/contrib/bind9/lib/dns/include/dns/fixedname.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: fixedname.h,v 1.19 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: fixedname.h,v 1.19 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_FIXEDNAME_H
#define DNS_FIXEDNAME_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/forward.h b/contrib/bind9/lib/dns/include/dns/forward.h
index 512c5e3..5fbe898 100644
--- a/contrib/bind9/lib/dns/include/dns/forward.h
+++ b/contrib/bind9/lib/dns/include/dns/forward.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: forward.h,v 1.11 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: forward.h,v 1.11 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_FORWARD_H
#define DNS_FORWARD_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/iptable.h b/contrib/bind9/lib/dns/include/dns/iptable.h
index d7eb140..4a56b13 100644
--- a/contrib/bind9/lib/dns/include/dns/iptable.h
+++ b/contrib/bind9/lib/dns/include/dns/iptable.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: iptable.h,v 1.4 2007/09/14 01:46:05 marka Exp $ */
+/* $Id: iptable.h,v 1.4 2007-09-14 01:46:05 marka Exp $ */
#ifndef DNS_IPTABLE_H
#define DNS_IPTABLE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/journal.h b/contrib/bind9/lib/dns/include/dns/journal.h
index a1e16e4..9e56c19 100644
--- a/contrib/bind9/lib/dns/include/dns/journal.h
+++ b/contrib/bind9/lib/dns/include/dns/journal.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: journal.h,v 1.33.120.4 2009/11/04 23:47:25 tbox Exp $ */
+/* $Id: journal.h,v 1.33.120.4 2009-11-04 23:47:25 tbox Exp $ */
#ifndef DNS_JOURNAL_H
#define DNS_JOURNAL_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/keyflags.h b/contrib/bind9/lib/dns/include/dns/keyflags.h
index 74a1740..22e0f58 100644
--- a/contrib/bind9/lib/dns/include/dns/keyflags.h
+++ b/contrib/bind9/lib/dns/include/dns/keyflags.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: keyflags.h,v 1.16 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: keyflags.h,v 1.16 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_KEYFLAGS_H
#define DNS_KEYFLAGS_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/keytable.h b/contrib/bind9/lib/dns/include/dns/keytable.h
index 553aa99..40c4b16 100644
--- a/contrib/bind9/lib/dns/include/dns/keytable.h
+++ b/contrib/bind9/lib/dns/include/dns/keytable.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: keytable.h,v 1.16 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: keytable.h,v 1.16 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_KEYTABLE_H
#define DNS_KEYTABLE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/keyvalues.h b/contrib/bind9/lib/dns/include/dns/keyvalues.h
index f4a50fa..70ca3fa 100644
--- a/contrib/bind9/lib/dns/include/dns/keyvalues.h
+++ b/contrib/bind9/lib/dns/include/dns/keyvalues.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: keyvalues.h,v 1.23.48.4 2010/01/15 23:47:33 tbox Exp $ */
+/* $Id: keyvalues.h,v 1.23.48.4 2010-01-15 23:47:33 tbox Exp $ */
#ifndef DNS_KEYVALUES_H
#define DNS_KEYVALUES_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/lib.h b/contrib/bind9/lib/dns/include/dns/lib.h
index fd3325b..361ef8f 100644
--- a/contrib/bind9/lib/dns/include/dns/lib.h
+++ b/contrib/bind9/lib/dns/include/dns/lib.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lib.h,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: lib.h,v 1.16 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_LIB_H
#define DNS_LIB_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/log.h b/contrib/bind9/lib/dns/include/dns/log.h
index b7aed42..4b648ff 100644
--- a/contrib/bind9/lib/dns/include/dns/log.h
+++ b/contrib/bind9/lib/dns/include/dns/log.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.h,v 1.42.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: log.h,v 1.42.332.2 2009-01-18 23:47:41 tbox Exp $ */
/*! \file dns/log.h
* \author Principal Authors: DCL */
diff --git a/contrib/bind9/lib/dns/include/dns/lookup.h b/contrib/bind9/lib/dns/include/dns/lookup.h
index 0e9a327..81bb9b9 100644
--- a/contrib/bind9/lib/dns/include/dns/lookup.h
+++ b/contrib/bind9/lib/dns/include/dns/lookup.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lookup.h,v 1.12.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: lookup.h,v 1.12.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_LOOKUP_H
#define DNS_LOOKUP_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/master.h b/contrib/bind9/lib/dns/include/dns/master.h
index 93a782d..3f3a4de 100644
--- a/contrib/bind9/lib/dns/include/dns/master.h
+++ b/contrib/bind9/lib/dns/include/dns/master.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: master.h,v 1.51 2008/04/02 02:37:42 marka Exp $ */
+/* $Id: master.h,v 1.51 2008-04-02 02:37:42 marka Exp $ */
#ifndef DNS_MASTER_H
#define DNS_MASTER_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/masterdump.h b/contrib/bind9/lib/dns/include/dns/masterdump.h
index 42521b3..651d0d0 100644
--- a/contrib/bind9/lib/dns/include/dns/masterdump.h
+++ b/contrib/bind9/lib/dns/include/dns/masterdump.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: masterdump.h,v 1.42 2008/09/24 02:46:23 marka Exp $ */
+/* $Id: masterdump.h,v 1.42.602.1 2011-05-27 00:19:19 each Exp $ */
#ifndef DNS_MASTERDUMP_H
#define DNS_MASTERDUMP_H 1
@@ -332,9 +332,6 @@ dns_master_stylecreate(dns_master_style_t **style, unsigned int flags,
void
dns_master_styledestroy(dns_master_style_t **style, isc_mem_t *mctx);
-const char *
-dns_trust_totext(dns_trust_t trust);
-
ISC_LANG_ENDDECLS
#endif /* DNS_MASTERDUMP_H */
diff --git a/contrib/bind9/lib/dns/include/dns/message.h b/contrib/bind9/lib/dns/include/dns/message.h
index f880095..98fb321 100644
--- a/contrib/bind9/lib/dns/include/dns/message.h
+++ b/contrib/bind9/lib/dns/include/dns/message.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: message.h,v 1.125.118.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: message.h,v 1.125.118.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_MESSAGE_H
#define DNS_MESSAGE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/nsec.h b/contrib/bind9/lib/dns/include/dns/nsec.h
index 335a463..d97f1b6 100644
--- a/contrib/bind9/lib/dns/include/dns/nsec.h
+++ b/contrib/bind9/lib/dns/include/dns/nsec.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec.h,v 1.12 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: nsec.h,v 1.12 2008-09-25 04:02:39 tbox Exp $ */
#ifndef DNS_NSEC_H
#define DNS_NSEC_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/nsec3.h b/contrib/bind9/lib/dns/include/dns/nsec3.h
index 6243fdb..ba808e4 100644
--- a/contrib/bind9/lib/dns/include/dns/nsec3.h
+++ b/contrib/bind9/lib/dns/include/dns/nsec3.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec3.h,v 1.5.48.3 2009/10/06 21:20:18 each Exp $ */
+/* $Id: nsec3.h,v 1.5.48.3 2009-10-06 21:20:18 each Exp $ */
#ifndef DNS_NSEC3_H
#define DNS_NSEC3_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/opcode.h b/contrib/bind9/lib/dns/include/dns/opcode.h
index 368b2b2..26d4de0 100644
--- a/contrib/bind9/lib/dns/include/dns/opcode.h
+++ b/contrib/bind9/lib/dns/include/dns/opcode.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: opcode.h,v 1.8 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: opcode.h,v 1.8 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_OPCODE_H
#define DNS_OPCODE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/order.h b/contrib/bind9/lib/dns/include/dns/order.h
index 85663c3..04eda55 100644
--- a/contrib/bind9/lib/dns/include/dns/order.h
+++ b/contrib/bind9/lib/dns/include/dns/order.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: order.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: order.h,v 1.9 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_ORDER_H
#define DNS_ORDER_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/peer.h b/contrib/bind9/lib/dns/include/dns/peer.h
index 9e7a188..1f8a42e 100644
--- a/contrib/bind9/lib/dns/include/dns/peer.h
+++ b/contrib/bind9/lib/dns/include/dns/peer.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: peer.h,v 1.33.118.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: peer.h,v 1.33.118.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_PEER_H
#define DNS_PEER_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/portlist.h b/contrib/bind9/lib/dns/include/dns/portlist.h
index f76731a..8b0db20 100644
--- a/contrib/bind9/lib/dns/include/dns/portlist.h
+++ b/contrib/bind9/lib/dns/include/dns/portlist.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: portlist.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: portlist.h,v 1.9 2007-06-19 23:47:17 tbox Exp $ */
/*! \file dns/portlist.h */
diff --git a/contrib/bind9/lib/dns/include/dns/rbt.h b/contrib/bind9/lib/dns/include/dns/rbt.h
index 2615596..72ef2f1 100644
--- a/contrib/bind9/lib/dns/include/dns/rbt.h
+++ b/contrib/bind9/lib/dns/include/dns/rbt.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbt.h,v 1.71.48.3 2009/10/20 05:06:04 marka Exp $ */
+/* $Id: rbt.h,v 1.71.48.3 2009-10-20 05:06:04 marka Exp $ */
#ifndef DNS_RBT_H
#define DNS_RBT_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/rcode.h b/contrib/bind9/lib/dns/include/dns/rcode.h
index 94e831b..78a00a9 100644
--- a/contrib/bind9/lib/dns/include/dns/rcode.h
+++ b/contrib/bind9/lib/dns/include/dns/rcode.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rcode.h,v 1.21 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: rcode.h,v 1.21 2008-09-25 04:02:39 tbox Exp $ */
#ifndef DNS_RCODE_H
#define DNS_RCODE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/rdata.h b/contrib/bind9/lib/dns/include/dns/rdata.h
index 126bc96..1674b0c 100644
--- a/contrib/bind9/lib/dns/include/dns/rdata.h
+++ b/contrib/bind9/lib/dns/include/dns/rdata.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdata.h,v 1.70.120.3 2009/02/16 00:29:27 marka Exp $ */
+/* $Id: rdata.h,v 1.70.120.3 2009-02-16 00:29:27 marka Exp $ */
#ifndef DNS_RDATA_H
#define DNS_RDATA_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/rdataclass.h b/contrib/bind9/lib/dns/include/dns/rdataclass.h
index 786eb6a..1cf887c 100644
--- a/contrib/bind9/lib/dns/include/dns/rdataclass.h
+++ b/contrib/bind9/lib/dns/include/dns/rdataclass.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataclass.h,v 1.24 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rdataclass.h,v 1.24 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_RDATACLASS_H
#define DNS_RDATACLASS_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/rdatalist.h b/contrib/bind9/lib/dns/include/dns/rdatalist.h
index 57debc3..76917a2 100644
--- a/contrib/bind9/lib/dns/include/dns/rdatalist.h
+++ b/contrib/bind9/lib/dns/include/dns/rdatalist.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatalist.h,v 1.22 2008/04/03 06:09:05 tbox Exp $ */
+/* $Id: rdatalist.h,v 1.22 2008-04-03 06:09:05 tbox Exp $ */
#ifndef DNS_RDATALIST_H
#define DNS_RDATALIST_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/rdataset.h b/contrib/bind9/lib/dns/include/dns/rdataset.h
index b3a0c1d..9b48209 100644
--- a/contrib/bind9/lib/dns/include/dns/rdataset.h
+++ b/contrib/bind9/lib/dns/include/dns/rdataset.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataset.h,v 1.65.50.4 2010-02-25 10:56:41 tbox Exp $ */
+/* $Id: rdataset.h,v 1.65.50.4.6.1 2011-05-27 00:19:19 each Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
@@ -650,6 +650,12 @@ dns_rdataset_expire(dns_rdataset_t *rdataset);
* Mark the rdataset to be expired in the backing database.
*/
+const char *
+dns_trust_totext(dns_trust_t trust);
+/*%<
+ * Display trust in textual form.
+ */
+
ISC_LANG_ENDDECLS
#endif /* DNS_RDATASET_H */
diff --git a/contrib/bind9/lib/dns/include/dns/rdatasetiter.h b/contrib/bind9/lib/dns/include/dns/rdatasetiter.h
index dcde367..36c2b6f 100644
--- a/contrib/bind9/lib/dns/include/dns/rdatasetiter.h
+++ b/contrib/bind9/lib/dns/include/dns/rdatasetiter.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatasetiter.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rdatasetiter.h,v 1.21 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_RDATASETITER_H
#define DNS_RDATASETITER_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/rdataslab.h b/contrib/bind9/lib/dns/include/dns/rdataslab.h
index 3ac44b8..6d67e56 100644
--- a/contrib/bind9/lib/dns/include/dns/rdataslab.h
+++ b/contrib/bind9/lib/dns/include/dns/rdataslab.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataslab.h,v 1.33 2008/04/01 23:47:10 tbox Exp $ */
+/* $Id: rdataslab.h,v 1.33 2008-04-01 23:47:10 tbox Exp $ */
#ifndef DNS_RDATASLAB_H
#define DNS_RDATASLAB_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/rdatatype.h b/contrib/bind9/lib/dns/include/dns/rdatatype.h
index ba9a92c..939828a 100644
--- a/contrib/bind9/lib/dns/include/dns/rdatatype.h
+++ b/contrib/bind9/lib/dns/include/dns/rdatatype.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatatype.h,v 1.26 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: rdatatype.h,v 1.26 2008-09-25 04:02:39 tbox Exp $ */
#ifndef DNS_RDATATYPE_H
#define DNS_RDATATYPE_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/request.h b/contrib/bind9/lib/dns/include/dns/request.h
index 62a83ca..8808c0a 100644
--- a/contrib/bind9/lib/dns/include/dns/request.h
+++ b/contrib/bind9/lib/dns/include/dns/request.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: request.h,v 1.27.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: request.h,v 1.27.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_REQUEST_H
#define DNS_REQUEST_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/rootns.h b/contrib/bind9/lib/dns/include/dns/rootns.h
index 6da3f79..fe8943c 100644
--- a/contrib/bind9/lib/dns/include/dns/rootns.h
+++ b/contrib/bind9/lib/dns/include/dns/rootns.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rootns.h,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rootns.h,v 1.16 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_ROOTNS_H
#define DNS_ROOTNS_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/sdb.h b/contrib/bind9/lib/dns/include/dns/sdb.h
index c850028..18995ed 100644
--- a/contrib/bind9/lib/dns/include/dns/sdb.h
+++ b/contrib/bind9/lib/dns/include/dns/sdb.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sdb.h,v 1.21.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: sdb.h,v 1.21.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_SDB_H
#define DNS_SDB_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/sdlz.h b/contrib/bind9/lib/dns/include/dns/sdlz.h
index acb0437..9d2a0ed 100644
--- a/contrib/bind9/lib/dns/include/dns/sdlz.h
+++ b/contrib/bind9/lib/dns/include/dns/sdlz.h
@@ -50,7 +50,7 @@
* USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sdlz.h,v 1.7.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: sdlz.h,v 1.7.332.2 2009-01-18 23:47:41 tbox Exp $ */
/*! \file dns/sdlz.h */
diff --git a/contrib/bind9/lib/dns/include/dns/secalg.h b/contrib/bind9/lib/dns/include/dns/secalg.h
index 2e4fe3e..0eb0333 100644
--- a/contrib/bind9/lib/dns/include/dns/secalg.h
+++ b/contrib/bind9/lib/dns/include/dns/secalg.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: secalg.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: secalg.h,v 1.19 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_SECALG_H
#define DNS_SECALG_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/secproto.h b/contrib/bind9/lib/dns/include/dns/secproto.h
index b9179c0..55637f2 100644
--- a/contrib/bind9/lib/dns/include/dns/secproto.h
+++ b/contrib/bind9/lib/dns/include/dns/secproto.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: secproto.h,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: secproto.h,v 1.16 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_SECPROTO_H
#define DNS_SECPROTO_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/soa.h b/contrib/bind9/lib/dns/include/dns/soa.h
index bb56365..c1ad706 100644
--- a/contrib/bind9/lib/dns/include/dns/soa.h
+++ b/contrib/bind9/lib/dns/include/dns/soa.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: soa.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: soa.h,v 1.9 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_SOA_H
#define DNS_SOA_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/ssu.h b/contrib/bind9/lib/dns/include/dns/ssu.h
index f013bd0..686928b 100644
--- a/contrib/bind9/lib/dns/include/dns/ssu.h
+++ b/contrib/bind9/lib/dns/include/dns/ssu.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ssu.h,v 1.24 2008/01/18 23:46:58 tbox Exp $ */
+/* $Id: ssu.h,v 1.24 2008-01-18 23:46:58 tbox Exp $ */
#ifndef DNS_SSU_H
#define DNS_SSU_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/stats.h b/contrib/bind9/lib/dns/include/dns/stats.h
index 0b35aa8..853c1e9 100644
--- a/contrib/bind9/lib/dns/include/dns/stats.h
+++ b/contrib/bind9/lib/dns/include/dns/stats.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stats.h,v 1.18.56.2 2009/01/29 23:47:44 tbox Exp $ */
+/* $Id: stats.h,v 1.18.56.2 2009-01-29 23:47:44 tbox Exp $ */
#ifndef DNS_STATS_H
#define DNS_STATS_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/tcpmsg.h b/contrib/bind9/lib/dns/include/dns/tcpmsg.h
index fe83c53..fdc1432 100644
--- a/contrib/bind9/lib/dns/include/dns/tcpmsg.h
+++ b/contrib/bind9/lib/dns/include/dns/tcpmsg.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tcpmsg.h,v 1.22 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: tcpmsg.h,v 1.22 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_TCPMSG_H
#define DNS_TCPMSG_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/time.h b/contrib/bind9/lib/dns/include/dns/time.h
index 5b47d11..3771e9a 100644
--- a/contrib/bind9/lib/dns/include/dns/time.h
+++ b/contrib/bind9/lib/dns/include/dns/time.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: time.h,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: time.h,v 1.17 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_TIME_H
#define DNS_TIME_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/timer.h b/contrib/bind9/lib/dns/include/dns/timer.h
index 48d6d56..7478f40 100644
--- a/contrib/bind9/lib/dns/include/dns/timer.h
+++ b/contrib/bind9/lib/dns/include/dns/timer.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: timer.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: timer.h,v 1.9 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_TIMER_H
#define DNS_TIMER_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/tkey.h b/contrib/bind9/lib/dns/include/dns/tkey.h
index 3511f2f..cb1fe0e 100644
--- a/contrib/bind9/lib/dns/include/dns/tkey.h
+++ b/contrib/bind9/lib/dns/include/dns/tkey.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tkey.h,v 1.26.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: tkey.h,v 1.26.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_TKEY_H
#define DNS_TKEY_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/ttl.h b/contrib/bind9/lib/dns/include/dns/ttl.h
index c252518..848f64f 100644
--- a/contrib/bind9/lib/dns/include/dns/ttl.h
+++ b/contrib/bind9/lib/dns/include/dns/ttl.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ttl.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ttl.h,v 1.19 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_TTL_H
#define DNS_TTL_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/version.h b/contrib/bind9/lib/dns/include/dns/version.h
index 2a33dcf..03c05c4 100644
--- a/contrib/bind9/lib/dns/include/dns/version.h
+++ b/contrib/bind9/lib/dns/include/dns/version.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.h,v 1.9 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: version.h,v 1.9 2007-06-19 23:47:17 tbox Exp $ */
/*! \file dns/version.h */
diff --git a/contrib/bind9/lib/dns/include/dns/xfrin.h b/contrib/bind9/lib/dns/include/dns/xfrin.h
index 04866ee..b957e25 100644
--- a/contrib/bind9/lib/dns/include/dns/xfrin.h
+++ b/contrib/bind9/lib/dns/include/dns/xfrin.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: xfrin.h,v 1.28.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: xfrin.h,v 1.28.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DNS_XFRIN_H
#define DNS_XFRIN_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/zonekey.h b/contrib/bind9/lib/dns/include/dns/zonekey.h
index d9ba862..909859f 100644
--- a/contrib/bind9/lib/dns/include/dns/zonekey.h
+++ b/contrib/bind9/lib/dns/include/dns/zonekey.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zonekey.h,v 1.10 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: zonekey.h,v 1.10 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_ZONEKEY_H
#define DNS_ZONEKEY_H 1
diff --git a/contrib/bind9/lib/dns/include/dns/zt.h b/contrib/bind9/lib/dns/include/dns/zt.h
index 6cfe3d3..6e5ef5c 100644
--- a/contrib/bind9/lib/dns/include/dns/zt.h
+++ b/contrib/bind9/lib/dns/include/dns/zt.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zt.h,v 1.38 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: zt.h,v 1.38 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_ZT_H
#define DNS_ZT_H 1
diff --git a/contrib/bind9/lib/dns/include/dst/Makefile.in b/contrib/bind9/lib/dns/include/dst/Makefile.in
index 4ed4ec0..2a98703 100644
--- a/contrib/bind9/lib/dns/include/dst/Makefile.in
+++ b/contrib/bind9/lib/dns/include/dst/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.4 2007/12/11 20:28:55 marka Exp $
+# $Id: Makefile.in,v 1.4 2007-12-11 20:28:55 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/dns/include/dst/gssapi.h b/contrib/bind9/lib/dns/include/dst/gssapi.h
index 446b76d..0a468d3 100644
--- a/contrib/bind9/lib/dns/include/dst/gssapi.h
+++ b/contrib/bind9/lib/dns/include/dst/gssapi.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gssapi.h,v 1.9.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: gssapi.h,v 1.9.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef DST_GSSAPI_H
#define DST_GSSAPI_H 1
diff --git a/contrib/bind9/lib/dns/include/dst/lib.h b/contrib/bind9/lib/dns/include/dst/lib.h
index 886575e..1e3717a 100644
--- a/contrib/bind9/lib/dns/include/dst/lib.h
+++ b/contrib/bind9/lib/dns/include/dst/lib.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lib.h,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: lib.h,v 1.7 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DST_LIB_H
#define DST_LIB_H 1
diff --git a/contrib/bind9/lib/dns/include/dst/result.h b/contrib/bind9/lib/dns/include/dst/result.h
index d77b72e..da2500f 100644
--- a/contrib/bind9/lib/dns/include/dst/result.h
+++ b/contrib/bind9/lib/dns/include/dst/result.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: result.h,v 1.9 2008/04/01 23:47:10 tbox Exp $ */
+/* $Id: result.h,v 1.9 2008-04-01 23:47:10 tbox Exp $ */
#ifndef DST_RESULT_H
#define DST_RESULT_H 1
diff --git a/contrib/bind9/lib/dns/iptable.c b/contrib/bind9/lib/dns/iptable.c
index 55a5351..071f9a6 100644
--- a/contrib/bind9/lib/dns/iptable.c
+++ b/contrib/bind9/lib/dns/iptable.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: iptable.c,v 1.12.44.3 2009/02/18 23:47:12 tbox Exp $ */
+/* $Id: iptable.c,v 1.12.44.3 2009-02-18 23:47:12 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/dns/key.c b/contrib/bind9/lib/dns/key.c
index 5cf4442..7c8114e 100644
--- a/contrib/bind9/lib/dns/key.c
+++ b/contrib/bind9/lib/dns/key.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: key.c,v 1.8 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: key.c,v 1.8 2007-06-19 23:47:16 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/dns/keytable.c b/contrib/bind9/lib/dns/keytable.c
index bffd2d3..874868d 100644
--- a/contrib/bind9/lib/dns/keytable.c
+++ b/contrib/bind9/lib/dns/keytable.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: keytable.c,v 1.34 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: keytable.c,v 1.34 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/lib.c b/contrib/bind9/lib/dns/lib.c
index 6f98b537..761be56 100644
--- a/contrib/bind9/lib/dns/lib.c
+++ b/contrib/bind9/lib/dns/lib.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lib.c,v 1.16 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: lib.c,v 1.16 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/log.c b/contrib/bind9/lib/dns/log.c
index 7551e15..5b3ee32 100644
--- a/contrib/bind9/lib/dns/log.c
+++ b/contrib/bind9/lib/dns/log.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.c,v 1.45 2007/06/18 23:47:40 tbox Exp $ */
+/* $Id: log.c,v 1.45 2007-06-18 23:47:40 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/lookup.c b/contrib/bind9/lib/dns/lookup.c
index d5fc7aa..72367ab 100644
--- a/contrib/bind9/lib/dns/lookup.c
+++ b/contrib/bind9/lib/dns/lookup.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lookup.c,v 1.21 2007/06/18 23:47:40 tbox Exp $ */
+/* $Id: lookup.c,v 1.21 2007-06-18 23:47:40 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/master.c b/contrib/bind9/lib/dns/master.c
index 462269e..9c6d3b8 100644
--- a/contrib/bind9/lib/dns/master.c
+++ b/contrib/bind9/lib/dns/master.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: master.c,v 1.171.120.2 2009/01/18 23:47:40 tbox Exp $ */
+/* $Id: master.c,v 1.171.120.2 2009-01-18 23:47:40 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/masterdump.c b/contrib/bind9/lib/dns/masterdump.c
index 314112c..34c984b 100644
--- a/contrib/bind9/lib/dns/masterdump.c
+++ b/contrib/bind9/lib/dns/masterdump.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: masterdump.c,v 1.94.50.3 2009/11/18 00:15:37 marka Exp $ */
+/* $Id: masterdump.c,v 1.94.50.3.18.1 2011-05-27 00:19:19 each Exp $ */
/*! \file */
@@ -773,26 +773,6 @@ dump_order_compare(const void *a, const void *b) {
#define MAXSORT 64
-static const char *trustnames[] = {
- "none",
- "pending-additional",
- "pending-answer",
- "additional",
- "glue",
- "answer",
- "authauthority",
- "authanswer",
- "secure",
- "local" /* aka ultimate */
-};
-
-const char *
-dns_trust_totext(dns_trust_t trust) {
- if (trust >= sizeof(trustnames)/sizeof(*trustnames))
- return ("bad");
- return (trustnames[trust]);
-}
-
static isc_result_t
dump_rdatasets_text(isc_mem_t *mctx, dns_name_t *name,
dns_rdatasetiter_t *rdsiter, dns_totext_ctx_t *ctx,
@@ -832,10 +812,7 @@ dump_rdatasets_text(isc_mem_t *mctx, dns_name_t *name,
for (i = 0; i < n; i++) {
dns_rdataset_t *rds = sorted[i];
if (ctx->style.flags & DNS_STYLEFLAG_TRUST) {
- unsigned int trust = rds->trust;
- INSIST(trust < (sizeof(trustnames) /
- sizeof(trustnames[0])));
- fprintf(f, "; %s\n", trustnames[trust]);
+ fprintf(f, "; %s\n", dns_trust_totext(rds->trust));
}
if (rds->type == 0 &&
(ctx->style.flags & DNS_STYLEFLAG_NCACHE) == 0) {
diff --git a/contrib/bind9/lib/dns/ncache.c b/contrib/bind9/lib/dns/ncache.c
index 5f24683..cfa4783 100644
--- a/contrib/bind9/lib/dns/ncache.c
+++ b/contrib/bind9/lib/dns/ncache.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ncache.c,v 1.43.48.7 2010-05-19 09:53:46 marka Exp $ */
+/* $Id: ncache.c,v 1.43.48.7.6.1 2011-05-27 00:19:19 each Exp $ */
/*! \file */
@@ -186,7 +186,7 @@ dns_ncache_addoptout(dns_message_t *message, dns_db_t *cache,
*/
isc_buffer_availableregion(&buffer,
&r);
- if (r.length < 2)
+ if (r.length < 3)
return (ISC_R_NOSPACE);
isc_buffer_putuint16(&buffer,
rdataset->type);
diff --git a/contrib/bind9/lib/dns/nsec.c b/contrib/bind9/lib/dns/nsec.c
index 39f409c..7d93ecc 100644
--- a/contrib/bind9/lib/dns/nsec.c
+++ b/contrib/bind9/lib/dns/nsec.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec.c,v 1.11.48.2 2009/01/06 23:47:26 tbox Exp $ */
+/* $Id: nsec.c,v 1.11.48.2 2009-01-06 23:47:26 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/nsec3.c b/contrib/bind9/lib/dns/nsec3.c
index ea6546d..9c85781 100644
--- a/contrib/bind9/lib/dns/nsec3.c
+++ b/contrib/bind9/lib/dns/nsec3.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec3.c,v 1.6.12.4 2009/11/03 23:47:46 tbox Exp $ */
+/* $Id: nsec3.c,v 1.6.12.4 2009-11-03 23:47:46 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/dns/openssldh_link.c b/contrib/bind9/lib/dns/openssldh_link.c
index abc3b7c..e31137f 100644
--- a/contrib/bind9/lib/dns/openssldh_link.c
+++ b/contrib/bind9/lib/dns/openssldh_link.c
@@ -31,7 +31,7 @@
/*
* Principal Author: Brian Wellington
- * $Id: openssldh_link.c,v 1.14 2008/04/01 23:47:10 tbox Exp $
+ * $Id: openssldh_link.c,v 1.14 2008-04-01 23:47:10 tbox Exp $
*/
#ifdef OPENSSL
diff --git a/contrib/bind9/lib/dns/openssldsa_link.c b/contrib/bind9/lib/dns/openssldsa_link.c
index 14e89e1..c563d9b 100644
--- a/contrib/bind9/lib/dns/openssldsa_link.c
+++ b/contrib/bind9/lib/dns/openssldsa_link.c
@@ -29,7 +29,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: openssldsa_link.c,v 1.13.120.2 2009/01/14 23:47:26 tbox Exp $ */
+/* $Id: openssldsa_link.c,v 1.13.120.2 2009-01-14 23:47:26 tbox Exp $ */
#ifdef OPENSSL
#ifndef USE_EVP
diff --git a/contrib/bind9/lib/dns/opensslrsa_link.c b/contrib/bind9/lib/dns/opensslrsa_link.c
index 95095d11..1e3c5c2 100644
--- a/contrib/bind9/lib/dns/opensslrsa_link.c
+++ b/contrib/bind9/lib/dns/opensslrsa_link.c
@@ -17,7 +17,7 @@
/*
* Principal Author: Brian Wellington
- * $Id: opensslrsa_link.c,v 1.20.50.8 2010/01/22 02:36:49 marka Exp $
+ * $Id: opensslrsa_link.c,v 1.20.50.8 2010-01-22 02:36:49 marka Exp $
*/
#ifdef OPENSSL
#include <config.h>
diff --git a/contrib/bind9/lib/dns/order.c b/contrib/bind9/lib/dns/order.c
index 853b001..ebfd6dd 100644
--- a/contrib/bind9/lib/dns/order.c
+++ b/contrib/bind9/lib/dns/order.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: order.c,v 1.10 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: order.c,v 1.10 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/peer.c b/contrib/bind9/lib/dns/peer.c
index 12474cb..1e81023 100644
--- a/contrib/bind9/lib/dns/peer.c
+++ b/contrib/bind9/lib/dns/peer.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: peer.c,v 1.31 2008/04/03 06:09:04 tbox Exp $ */
+/* $Id: peer.c,v 1.31 2008-04-03 06:09:04 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/portlist.c b/contrib/bind9/lib/dns/portlist.c
index 5bc89f4..a9c87ec 100644
--- a/contrib/bind9/lib/dns/portlist.c
+++ b/contrib/bind9/lib/dns/portlist.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: portlist.c,v 1.13 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: portlist.c,v 1.13 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/rbt.c b/contrib/bind9/lib/dns/rbt.c
index 62a9e2b..5e09db3 100644
--- a/contrib/bind9/lib/dns/rbt.c
+++ b/contrib/bind9/lib/dns/rbt.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbt.c,v 1.142.50.3 2009/10/20 05:06:04 marka Exp $ */
+/* $Id: rbt.c,v 1.142.50.3 2009-10-20 05:06:04 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/rbtdb.h b/contrib/bind9/lib/dns/rbtdb.h
index b024d13..f4249af 100644
--- a/contrib/bind9/lib/dns/rbtdb.h
+++ b/contrib/bind9/lib/dns/rbtdb.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbtdb.h,v 1.18 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: rbtdb.h,v 1.18 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_RBTDB_H
#define DNS_RBTDB_H 1
diff --git a/contrib/bind9/lib/dns/rbtdb64.c b/contrib/bind9/lib/dns/rbtdb64.c
index 5e325fa..dc92981 100644
--- a/contrib/bind9/lib/dns/rbtdb64.c
+++ b/contrib/bind9/lib/dns/rbtdb64.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbtdb64.c,v 1.11 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: rbtdb64.c,v 1.11 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/rbtdb64.h b/contrib/bind9/lib/dns/rbtdb64.h
index fe11622..2a677ae 100644
--- a/contrib/bind9/lib/dns/rbtdb64.h
+++ b/contrib/bind9/lib/dns/rbtdb64.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rbtdb64.h,v 1.17 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: rbtdb64.h,v 1.17 2007-06-19 23:47:16 tbox Exp $ */
#ifndef DNS_RBTDB64_H
#define DNS_RBTDB64_H 1
diff --git a/contrib/bind9/lib/dns/rcode.c b/contrib/bind9/lib/dns/rcode.c
index 9feaeb0..2dc0a29 100644
--- a/contrib/bind9/lib/dns/rcode.c
+++ b/contrib/bind9/lib/dns/rcode.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rcode.c,v 1.8.48.2 2010/01/15 23:47:33 tbox Exp $ */
+/* $Id: rcode.c,v 1.8.48.2 2010-01-15 23:47:33 tbox Exp $ */
#include <config.h>
#include <ctype.h>
diff --git a/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c b/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c
index 3121f78..e698239 100644
--- a/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c
+++ b/contrib/bind9/lib/dns/rdata/any_255/tsig_250.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tsig_250.c,v 1.63 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: tsig_250.c,v 1.63 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
diff --git a/contrib/bind9/lib/dns/rdata/any_255/tsig_250.h b/contrib/bind9/lib/dns/rdata/any_255/tsig_250.h
index 0c01667..7a0bab3 100644
--- a/contrib/bind9/lib/dns/rdata/any_255/tsig_250.h
+++ b/contrib/bind9/lib/dns/rdata/any_255/tsig_250.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tsig_250.h,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: tsig_250.h,v 1.25 2007-06-19 23:47:17 tbox Exp $ */
#ifndef ANY_255_TSIG_250_H
#define ANY_255_TSIG_250_H 1
diff --git a/contrib/bind9/lib/dns/rdata/ch_3/a_1.c b/contrib/bind9/lib/dns/rdata/ch_3/a_1.c
index 78d4ecd..156caac 100644
--- a/contrib/bind9/lib/dns/rdata/ch_3/a_1.c
+++ b/contrib/bind9/lib/dns/rdata/ch_3/a_1.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: a_1.c,v 1.6 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: a_1.c,v 1.6 2007-06-19 23:47:17 tbox Exp $ */
/* by Bjorn.Victor@it.uu.se, 2005-05-07 */
/* Based on generic/soa_6.c and generic/mx_15.c */
diff --git a/contrib/bind9/lib/dns/rdata/ch_3/a_1.h b/contrib/bind9/lib/dns/rdata/ch_3/a_1.h
index a279d0e..9ae44f0 100644
--- a/contrib/bind9/lib/dns/rdata/ch_3/a_1.h
+++ b/contrib/bind9/lib/dns/rdata/ch_3/a_1.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: a_1.h,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: a_1.h,v 1.5 2007-06-19 23:47:17 tbox Exp $ */
/* by Bjorn.Victor@it.uu.se, 2005-05-07 */
/* Based on generic/mx_15.h */
diff --git a/contrib/bind9/lib/dns/rdata/generic/afsdb_18.c b/contrib/bind9/lib/dns/rdata/generic/afsdb_18.c
index 2230efb..f82167be 100644
--- a/contrib/bind9/lib/dns/rdata/generic/afsdb_18.c
+++ b/contrib/bind9/lib/dns/rdata/generic/afsdb_18.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: afsdb_18.c,v 1.47 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: afsdb_18.c,v 1.47 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */
diff --git a/contrib/bind9/lib/dns/rdata/generic/afsdb_18.h b/contrib/bind9/lib/dns/rdata/generic/afsdb_18.h
index ccccc11..6b483c0 100644
--- a/contrib/bind9/lib/dns/rdata/generic/afsdb_18.h
+++ b/contrib/bind9/lib/dns/rdata/generic/afsdb_18.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_AFSDB_18_H
#define GENERIC_AFSDB_18_H 1
-/* $Id: afsdb_18.h,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: afsdb_18.h,v 1.20 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1183 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/cert_37.c b/contrib/bind9/lib/dns/rdata/generic/cert_37.c
index 2c45230..e0398d2 100644
--- a/contrib/bind9/lib/dns/rdata/generic/cert_37.c
+++ b/contrib/bind9/lib/dns/rdata/generic/cert_37.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cert_37.c,v 1.50 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: cert_37.c,v 1.50 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */
diff --git a/contrib/bind9/lib/dns/rdata/generic/cert_37.h b/contrib/bind9/lib/dns/rdata/generic/cert_37.h
index ddfaa4f..5f29309 100644
--- a/contrib/bind9/lib/dns/rdata/generic/cert_37.h
+++ b/contrib/bind9/lib/dns/rdata/generic/cert_37.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cert_37.h,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: cert_37.h,v 1.20 2007-06-19 23:47:17 tbox Exp $ */
#ifndef GENERIC_CERT_37_H
#define GENERIC_CERT_37_H 1
diff --git a/contrib/bind9/lib/dns/rdata/generic/cname_5.c b/contrib/bind9/lib/dns/rdata/generic/cname_5.c
index 28c3d60..f44d8c5 100644
--- a/contrib/bind9/lib/dns/rdata/generic/cname_5.c
+++ b/contrib/bind9/lib/dns/rdata/generic/cname_5.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cname_5.c,v 1.47 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: cname_5.c,v 1.47 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/generic/cname_5.h b/contrib/bind9/lib/dns/rdata/generic/cname_5.h
index 516f8d3..050e5e7 100644
--- a/contrib/bind9/lib/dns/rdata/generic/cname_5.h
+++ b/contrib/bind9/lib/dns/rdata/generic/cname_5.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cname_5.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: cname_5.h,v 1.26 2007-06-19 23:47:17 tbox Exp $ */
#ifndef GENERIC_CNAME_5_H
#define GENERIC_CNAME_5_H 1
diff --git a/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c b/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c
index 957f038..21d7abbb4 100644
--- a/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c
+++ b/contrib/bind9/lib/dns/rdata/generic/dlv_32769.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dlv_32769.c,v 1.6 2007/06/18 23:47:43 tbox Exp $ */
+/* $Id: dlv_32769.c,v 1.6 2007-06-18 23:47:43 tbox Exp $ */
/* draft-ietf-dnsext-delegation-signer-05.txt */
diff --git a/contrib/bind9/lib/dns/rdata/generic/dlv_32769.h b/contrib/bind9/lib/dns/rdata/generic/dlv_32769.h
index 2313c57..14d4588 100644
--- a/contrib/bind9/lib/dns/rdata/generic/dlv_32769.h
+++ b/contrib/bind9/lib/dns/rdata/generic/dlv_32769.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dlv_32769.h,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: dlv_32769.h,v 1.5 2007-06-19 23:47:17 tbox Exp $ */
/* draft-ietf-dnsext-delegation-signer-05.txt */
#ifndef GENERIC_DLV_32769_H
diff --git a/contrib/bind9/lib/dns/rdata/generic/dname_39.c b/contrib/bind9/lib/dns/rdata/generic/dname_39.c
index c399f1e..e36702d 100644
--- a/contrib/bind9/lib/dns/rdata/generic/dname_39.c
+++ b/contrib/bind9/lib/dns/rdata/generic/dname_39.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dname_39.c,v 1.38 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: dname_39.c,v 1.38 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */
diff --git a/contrib/bind9/lib/dns/rdata/generic/dname_39.h b/contrib/bind9/lib/dns/rdata/generic/dname_39.h
index f8aca27..bf1c3e0 100644
--- a/contrib/bind9/lib/dns/rdata/generic/dname_39.h
+++ b/contrib/bind9/lib/dns/rdata/generic/dname_39.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_DNAME_39_H
#define GENERIC_DNAME_39_H 1
-/* $Id: dname_39.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: dname_39.h,v 1.21 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief per RFC2672 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c b/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c
index 2e11cba..d526ca0 100644
--- a/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c
+++ b/contrib/bind9/lib/dns/rdata/generic/dnskey_48.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dnskey_48.c,v 1.8 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: dnskey_48.c,v 1.8 2007-06-19 23:47:17 tbox Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
diff --git a/contrib/bind9/lib/dns/rdata/generic/dnskey_48.h b/contrib/bind9/lib/dns/rdata/generic/dnskey_48.h
index ce88cd1..5834d06 100644
--- a/contrib/bind9/lib/dns/rdata/generic/dnskey_48.h
+++ b/contrib/bind9/lib/dns/rdata/generic/dnskey_48.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_DNSKEY_48_H
#define GENERIC_DNSKEY_48_H 1
-/* $Id: dnskey_48.h,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: dnskey_48.h,v 1.7 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief per RFC2535 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/ds_43.c b/contrib/bind9/lib/dns/rdata/generic/ds_43.c
index 08e5d5f..fcaa69b 100644
--- a/contrib/bind9/lib/dns/rdata/generic/ds_43.c
+++ b/contrib/bind9/lib/dns/rdata/generic/ds_43.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ds_43.c,v 1.12 2007/06/18 23:47:43 tbox Exp $ */
+/* $Id: ds_43.c,v 1.12 2007-06-18 23:47:43 tbox Exp $ */
/* draft-ietf-dnsext-delegation-signer-05.txt */
diff --git a/contrib/bind9/lib/dns/rdata/generic/ds_43.h b/contrib/bind9/lib/dns/rdata/generic/ds_43.h
index 3a409a1..c5329d8 100644
--- a/contrib/bind9/lib/dns/rdata/generic/ds_43.h
+++ b/contrib/bind9/lib/dns/rdata/generic/ds_43.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ds_43.h,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ds_43.h,v 1.7 2007-06-19 23:47:17 tbox Exp $ */
#ifndef GENERIC_DS_43_H
#define GENERIC_DS_43_H 1
diff --git a/contrib/bind9/lib/dns/rdata/generic/gpos_27.c b/contrib/bind9/lib/dns/rdata/generic/gpos_27.c
index 18effb5..35fcc50 100644
--- a/contrib/bind9/lib/dns/rdata/generic/gpos_27.c
+++ b/contrib/bind9/lib/dns/rdata/generic/gpos_27.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gpos_27.c,v 1.41 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: gpos_27.c,v 1.41 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/generic/gpos_27.h b/contrib/bind9/lib/dns/rdata/generic/gpos_27.h
index f5df4fa..8b0e321 100644
--- a/contrib/bind9/lib/dns/rdata/generic/gpos_27.h
+++ b/contrib/bind9/lib/dns/rdata/generic/gpos_27.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_GPOS_27_H
#define GENERIC_GPOS_27_H 1
-/* $Id: gpos_27.h,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: gpos_27.h,v 1.17 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief per RFC1712 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c b/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c
index 5321357..7f31ab0 100644
--- a/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c
+++ b/contrib/bind9/lib/dns/rdata/generic/hinfo_13.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hinfo_13.c,v 1.44 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: hinfo_13.c,v 1.44 2007-06-19 23:47:17 tbox Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
diff --git a/contrib/bind9/lib/dns/rdata/generic/hinfo_13.h b/contrib/bind9/lib/dns/rdata/generic/hinfo_13.h
index 66766df..72060d6 100644
--- a/contrib/bind9/lib/dns/rdata/generic/hinfo_13.h
+++ b/contrib/bind9/lib/dns/rdata/generic/hinfo_13.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_HINFO_13_H
#define GENERIC_HINFO_13_H 1
-/* $Id: hinfo_13.h,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: hinfo_13.h,v 1.25 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_hinfo {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h b/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h
index 2a6201f..ced3e9b 100644
--- a/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h
+++ b/contrib/bind9/lib/dns/rdata/generic/ipseckey_45.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ipseckey_45.h,v 1.4 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ipseckey_45.h,v 1.4 2007-06-19 23:47:17 tbox Exp $ */
#ifndef GENERIC_IPSECKEY_45_H
#define GENERIC_IPSECKEY_45_H 1
diff --git a/contrib/bind9/lib/dns/rdata/generic/isdn_20.c b/contrib/bind9/lib/dns/rdata/generic/isdn_20.c
index d7333d1..a9e03b2c 100644
--- a/contrib/bind9/lib/dns/rdata/generic/isdn_20.c
+++ b/contrib/bind9/lib/dns/rdata/generic/isdn_20.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: isdn_20.c,v 1.38 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: isdn_20.c,v 1.38 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/generic/isdn_20.h b/contrib/bind9/lib/dns/rdata/generic/isdn_20.h
index a1f65ca..6c88b16 100644
--- a/contrib/bind9/lib/dns/rdata/generic/isdn_20.h
+++ b/contrib/bind9/lib/dns/rdata/generic/isdn_20.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_ISDN_20_H
#define GENERIC_ISDN_20_H 1
-/* $Id: isdn_20.h,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: isdn_20.h,v 1.18 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1183 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/key_25.c b/contrib/bind9/lib/dns/rdata/generic/key_25.c
index 9acfe95..acd314c 100644
--- a/contrib/bind9/lib/dns/rdata/generic/key_25.c
+++ b/contrib/bind9/lib/dns/rdata/generic/key_25.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: key_25.c,v 1.51 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: key_25.c,v 1.51 2007-06-19 23:47:17 tbox Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
diff --git a/contrib/bind9/lib/dns/rdata/generic/key_25.h b/contrib/bind9/lib/dns/rdata/generic/key_25.h
index bcf9cb6..1bbae4a 100644
--- a/contrib/bind9/lib/dns/rdata/generic/key_25.h
+++ b/contrib/bind9/lib/dns/rdata/generic/key_25.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_KEY_25_H
#define GENERIC_KEY_25_H 1
-/* $Id: key_25.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: key_25.h,v 1.19 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC2535 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/loc_29.c b/contrib/bind9/lib/dns/rdata/generic/loc_29.c
index a5d7f72..a5efb01 100644
--- a/contrib/bind9/lib/dns/rdata/generic/loc_29.c
+++ b/contrib/bind9/lib/dns/rdata/generic/loc_29.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: loc_29.c,v 1.45.332.4 2009/02/17 05:54:12 marka Exp $ */
+/* $Id: loc_29.c,v 1.45.332.4 2009-02-17 05:54:12 marka Exp $ */
/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
diff --git a/contrib/bind9/lib/dns/rdata/generic/loc_29.h b/contrib/bind9/lib/dns/rdata/generic/loc_29.h
index f053c60..ecf90b8 100644
--- a/contrib/bind9/lib/dns/rdata/generic/loc_29.h
+++ b/contrib/bind9/lib/dns/rdata/generic/loc_29.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_LOC_29_H
#define GENERIC_LOC_29_H 1
-/* $Id: loc_29.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: loc_29.h,v 1.19 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1876 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/mb_7.c b/contrib/bind9/lib/dns/rdata/generic/mb_7.c
index fc3a7b6..c47365a 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mb_7.c
+++ b/contrib/bind9/lib/dns/rdata/generic/mb_7.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mb_7.c,v 1.45 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mb_7.c,v 1.45 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/generic/mb_7.h b/contrib/bind9/lib/dns/rdata/generic/mb_7.h
index b427ee9..185f573 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mb_7.h
+++ b/contrib/bind9/lib/dns/rdata/generic/mb_7.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_MB_7_H
#define GENERIC_MB_7_H 1
-/* $Id: mb_7.h,v 1.27 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mb_7.h,v 1.27 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_mb {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/md_3.c b/contrib/bind9/lib/dns/rdata/generic/md_3.c
index 0f8560f..269f9be 100644
--- a/contrib/bind9/lib/dns/rdata/generic/md_3.c
+++ b/contrib/bind9/lib/dns/rdata/generic/md_3.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: md_3.c,v 1.47 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: md_3.c,v 1.47 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/generic/md_3.h b/contrib/bind9/lib/dns/rdata/generic/md_3.h
index ba70d18..319ea7c 100644
--- a/contrib/bind9/lib/dns/rdata/generic/md_3.h
+++ b/contrib/bind9/lib/dns/rdata/generic/md_3.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_MD_3_H
#define GENERIC_MD_3_H 1
-/* $Id: md_3.h,v 1.28 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: md_3.h,v 1.28 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_md {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/mf_4.c b/contrib/bind9/lib/dns/rdata/generic/mf_4.c
index dffcec2..9223384 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mf_4.c
+++ b/contrib/bind9/lib/dns/rdata/generic/mf_4.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mf_4.c,v 1.45 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mf_4.c,v 1.45 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/generic/mf_4.h b/contrib/bind9/lib/dns/rdata/generic/mf_4.h
index 32d2493..602832c 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mf_4.h
+++ b/contrib/bind9/lib/dns/rdata/generic/mf_4.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_MF_4_H
#define GENERIC_MF_4_H 1
-/* $Id: mf_4.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mf_4.h,v 1.26 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_mf {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/mg_8.c b/contrib/bind9/lib/dns/rdata/generic/mg_8.c
index e4dca1d..ba7630c 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mg_8.c
+++ b/contrib/bind9/lib/dns/rdata/generic/mg_8.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mg_8.c,v 1.43 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mg_8.c,v 1.43 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/generic/mg_8.h b/contrib/bind9/lib/dns/rdata/generic/mg_8.h
index 8fa143a..9c8dce2 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mg_8.h
+++ b/contrib/bind9/lib/dns/rdata/generic/mg_8.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_MG_8_H
#define GENERIC_MG_8_H 1
-/* $Id: mg_8.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mg_8.h,v 1.26 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_mg {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/minfo_14.c b/contrib/bind9/lib/dns/rdata/generic/minfo_14.c
index 6645bbc..6848a4e 100644
--- a/contrib/bind9/lib/dns/rdata/generic/minfo_14.c
+++ b/contrib/bind9/lib/dns/rdata/generic/minfo_14.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: minfo_14.c,v 1.45 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: minfo_14.c,v 1.45 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/generic/minfo_14.h b/contrib/bind9/lib/dns/rdata/generic/minfo_14.h
index 76195c5..33fcfcb 100644
--- a/contrib/bind9/lib/dns/rdata/generic/minfo_14.h
+++ b/contrib/bind9/lib/dns/rdata/generic/minfo_14.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_MINFO_14_H
#define GENERIC_MINFO_14_H 1
-/* $Id: minfo_14.h,v 1.27 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: minfo_14.h,v 1.27 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_minfo {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/mr_9.c b/contrib/bind9/lib/dns/rdata/generic/mr_9.c
index 289d739..a480bd4 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mr_9.c
+++ b/contrib/bind9/lib/dns/rdata/generic/mr_9.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mr_9.c,v 1.42 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mr_9.c,v 1.42 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Wed Mar 15 21:30:35 EST 2000 by tale */
diff --git a/contrib/bind9/lib/dns/rdata/generic/mr_9.h b/contrib/bind9/lib/dns/rdata/generic/mr_9.h
index 3d81bdd..19676fb 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mr_9.h
+++ b/contrib/bind9/lib/dns/rdata/generic/mr_9.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_MR_9_H
#define GENERIC_MR_9_H 1
-/* $Id: mr_9.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mr_9.h,v 1.26 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_mr {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/mx_15.c b/contrib/bind9/lib/dns/rdata/generic/mx_15.c
index 086c043..b7b43f3 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mx_15.c
+++ b/contrib/bind9/lib/dns/rdata/generic/mx_15.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mx_15.c,v 1.56 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mx_15.c,v 1.56 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/generic/mx_15.h b/contrib/bind9/lib/dns/rdata/generic/mx_15.h
index 25d5ac5..7ebe3e2 100644
--- a/contrib/bind9/lib/dns/rdata/generic/mx_15.h
+++ b/contrib/bind9/lib/dns/rdata/generic/mx_15.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_MX_15_H
#define GENERIC_MX_15_H 1
-/* $Id: mx_15.h,v 1.29 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mx_15.h,v 1.29 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_mx {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/ns_2.c b/contrib/bind9/lib/dns/rdata/generic/ns_2.c
index 9a2ee8c..14e0c9d 100644
--- a/contrib/bind9/lib/dns/rdata/generic/ns_2.c
+++ b/contrib/bind9/lib/dns/rdata/generic/ns_2.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ns_2.c,v 1.46 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ns_2.c,v 1.46 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Wed Mar 15 18:15:00 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/generic/ns_2.h b/contrib/bind9/lib/dns/rdata/generic/ns_2.h
index 546e71a..d38e517 100644
--- a/contrib/bind9/lib/dns/rdata/generic/ns_2.h
+++ b/contrib/bind9/lib/dns/rdata/generic/ns_2.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_NS_2_H
#define GENERIC_NS_2_H 1
-/* $Id: ns_2.h,v 1.27 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ns_2.h,v 1.27 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_ns {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/nsec3_50.c b/contrib/bind9/lib/dns/rdata/generic/nsec3_50.c
index c5f0acb..890af1a 100644
--- a/contrib/bind9/lib/dns/rdata/generic/nsec3_50.c
+++ b/contrib/bind9/lib/dns/rdata/generic/nsec3_50.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec3_50.c,v 1.4.48.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: nsec3_50.c,v 1.4.48.2 2009-01-18 23:47:41 tbox Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
diff --git a/contrib/bind9/lib/dns/rdata/generic/nsec3_50.h b/contrib/bind9/lib/dns/rdata/generic/nsec3_50.h
index 658dd9d..06274a7 100644
--- a/contrib/bind9/lib/dns/rdata/generic/nsec3_50.h
+++ b/contrib/bind9/lib/dns/rdata/generic/nsec3_50.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_NSEC3_50_H
#define GENERIC_NSEC3_50_H 1
-/* $Id: nsec3_50.h,v 1.4 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: nsec3_50.h,v 1.4 2008-09-25 04:02:39 tbox Exp $ */
/*!
* \brief Per RFC 5155 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.c b/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.c
index 607ce6a..1457015 100644
--- a/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.c
+++ b/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsec3param_51.c,v 1.4.48.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: nsec3param_51.c,v 1.4.48.2 2009-01-18 23:47:41 tbox Exp $ */
/*
* Copyright (C) 2004 Nominet, Ltd.
diff --git a/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.h b/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.h
index 2efd7e6..9981c67 100644
--- a/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.h
+++ b/contrib/bind9/lib/dns/rdata/generic/nsec3param_51.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_NSEC3PARAM_51_H
#define GENERIC_NSEC3PARAM_51_H 1
-/* $Id: nsec3param_51.h,v 1.4 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: nsec3param_51.h,v 1.4 2008-09-25 04:02:39 tbox Exp $ */
/*!
* \brief Per RFC 5155 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/nsec_47.h b/contrib/bind9/lib/dns/rdata/generic/nsec_47.h
index 2b3c6b6..52eadbb 100644
--- a/contrib/bind9/lib/dns/rdata/generic/nsec_47.h
+++ b/contrib/bind9/lib/dns/rdata/generic/nsec_47.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_NSEC_47_H
#define GENERIC_NSEC_47_H 1
-/* $Id: nsec_47.h,v 1.10 2008/07/15 23:47:21 tbox Exp $ */
+/* $Id: nsec_47.h,v 1.10 2008-07-15 23:47:21 tbox Exp $ */
/*!
* \brief Per RFC 3845 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/null_10.c b/contrib/bind9/lib/dns/rdata/generic/null_10.c
index 00bb542..06a8877 100644
--- a/contrib/bind9/lib/dns/rdata/generic/null_10.c
+++ b/contrib/bind9/lib/dns/rdata/generic/null_10.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: null_10.c,v 1.42 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: null_10.c,v 1.42 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 13:57:50 PST 2000 by explorer */
diff --git a/contrib/bind9/lib/dns/rdata/generic/null_10.h b/contrib/bind9/lib/dns/rdata/generic/null_10.h
index ceeb018..466eca6 100644
--- a/contrib/bind9/lib/dns/rdata/generic/null_10.h
+++ b/contrib/bind9/lib/dns/rdata/generic/null_10.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_NULL_10_H
#define GENERIC_NULL_10_H 1
-/* $Id: null_10.h,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: null_10.h,v 1.25 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_null {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/nxt_30.c b/contrib/bind9/lib/dns/rdata/generic/nxt_30.c
index 7ffb86c..362e6fc 100644
--- a/contrib/bind9/lib/dns/rdata/generic/nxt_30.c
+++ b/contrib/bind9/lib/dns/rdata/generic/nxt_30.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nxt_30.c,v 1.63 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: nxt_30.c,v 1.63 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Wed Mar 15 18:21:15 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/generic/nxt_30.h b/contrib/bind9/lib/dns/rdata/generic/nxt_30.h
index e2e8688..86ef888 100644
--- a/contrib/bind9/lib/dns/rdata/generic/nxt_30.h
+++ b/contrib/bind9/lib/dns/rdata/generic/nxt_30.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_NXT_30_H
#define GENERIC_NXT_30_H 1
-/* $Id: nxt_30.h,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: nxt_30.h,v 1.25 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief RFC2535 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/opt_41.c b/contrib/bind9/lib/dns/rdata/generic/opt_41.c
index d2cfc2e..506f4a3 100644
--- a/contrib/bind9/lib/dns/rdata/generic/opt_41.c
+++ b/contrib/bind9/lib/dns/rdata/generic/opt_41.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: opt_41.c,v 1.33 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: opt_41.c,v 1.33 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 14:06:44 PST 2000 by gson */
diff --git a/contrib/bind9/lib/dns/rdata/generic/opt_41.h b/contrib/bind9/lib/dns/rdata/generic/opt_41.h
index d6539cf..0f05ace 100644
--- a/contrib/bind9/lib/dns/rdata/generic/opt_41.h
+++ b/contrib/bind9/lib/dns/rdata/generic/opt_41.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_OPT_41_H
#define GENERIC_OPT_41_H 1
-/* $Id: opt_41.h,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: opt_41.h,v 1.18 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC2671 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/proforma.c b/contrib/bind9/lib/dns/rdata/generic/proforma.c
index 879b761..c3db196 100644
--- a/contrib/bind9/lib/dns/rdata/generic/proforma.c
+++ b/contrib/bind9/lib/dns/rdata/generic/proforma.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: proforma.c,v 1.36 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: proforma.c,v 1.36 2007-06-19 23:47:17 tbox Exp $ */
#ifndef RDATA_GENERIC_#_#_C
#define RDATA_GENERIC_#_#_C
diff --git a/contrib/bind9/lib/dns/rdata/generic/proforma.h b/contrib/bind9/lib/dns/rdata/generic/proforma.h
index e5c420a..50d841f 100644
--- a/contrib/bind9/lib/dns/rdata/generic/proforma.h
+++ b/contrib/bind9/lib/dns/rdata/generic/proforma.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_PROFORMA_H
#define GENERIC_PROFORMA_H 1
-/* $Id: proforma.h,v 1.23 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: proforma.h,v 1.23 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_# {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/ptr_12.c b/contrib/bind9/lib/dns/rdata/generic/ptr_12.c
index fbabcbf..8e718cd 100644
--- a/contrib/bind9/lib/dns/rdata/generic/ptr_12.c
+++ b/contrib/bind9/lib/dns/rdata/generic/ptr_12.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ptr_12.c,v 1.43 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ptr_12.c,v 1.43 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */
diff --git a/contrib/bind9/lib/dns/rdata/generic/ptr_12.h b/contrib/bind9/lib/dns/rdata/generic/ptr_12.h
index 304dcc4..ca4da77 100644
--- a/contrib/bind9/lib/dns/rdata/generic/ptr_12.h
+++ b/contrib/bind9/lib/dns/rdata/generic/ptr_12.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_PTR_12_H
#define GENERIC_PTR_12_H 1
-/* $Id: ptr_12.h,v 1.27 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ptr_12.h,v 1.27 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_ptr {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/rp_17.c b/contrib/bind9/lib/dns/rdata/generic/rp_17.c
index 557cb04..19d7b35 100644
--- a/contrib/bind9/lib/dns/rdata/generic/rp_17.c
+++ b/contrib/bind9/lib/dns/rdata/generic/rp_17.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rp_17.c,v 1.42 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rp_17.c,v 1.42 2007-06-19 23:47:17 tbox Exp $ */
/* RFC1183 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/rp_17.h b/contrib/bind9/lib/dns/rdata/generic/rp_17.h
index 6223038..d1c759a 100644
--- a/contrib/bind9/lib/dns/rdata/generic/rp_17.h
+++ b/contrib/bind9/lib/dns/rdata/generic/rp_17.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_RP_17_H
#define GENERIC_RP_17_H 1
-/* $Id: rp_17.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rp_17.h,v 1.21 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1183 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/rrsig_46.h b/contrib/bind9/lib/dns/rdata/generic/rrsig_46.h
index 8e8dc4e..5444cfc 100644
--- a/contrib/bind9/lib/dns/rdata/generic/rrsig_46.h
+++ b/contrib/bind9/lib/dns/rdata/generic/rrsig_46.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_DNSSIG_46_H
#define GENERIC_DNSSIG_46_H 1
-/* $Id: rrsig_46.h,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rrsig_46.h,v 1.7 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC2535 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/rt_21.c b/contrib/bind9/lib/dns/rdata/generic/rt_21.c
index 6444102..48323c7 100644
--- a/contrib/bind9/lib/dns/rdata/generic/rt_21.c
+++ b/contrib/bind9/lib/dns/rdata/generic/rt_21.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rt_21.c,v 1.46 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rt_21.c,v 1.46 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/generic/rt_21.h b/contrib/bind9/lib/dns/rdata/generic/rt_21.h
index 2c0e9fc..3215ed4 100644
--- a/contrib/bind9/lib/dns/rdata/generic/rt_21.h
+++ b/contrib/bind9/lib/dns/rdata/generic/rt_21.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_RT_21_H
#define GENERIC_RT_21_H 1
-/* $Id: rt_21.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rt_21.h,v 1.21 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1183 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/sig_24.c b/contrib/bind9/lib/dns/rdata/generic/sig_24.c
index e79e1e4..3010b8e 100644
--- a/contrib/bind9/lib/dns/rdata/generic/sig_24.c
+++ b/contrib/bind9/lib/dns/rdata/generic/sig_24.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sig_24.c,v 1.66 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: sig_24.c,v 1.66 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Fri Mar 17 09:05:02 PST 2000 by gson */
diff --git a/contrib/bind9/lib/dns/rdata/generic/sig_24.h b/contrib/bind9/lib/dns/rdata/generic/sig_24.h
index 7212d4d..c85610d 100644
--- a/contrib/bind9/lib/dns/rdata/generic/sig_24.h
+++ b/contrib/bind9/lib/dns/rdata/generic/sig_24.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_SIG_24_H
#define GENERIC_SIG_24_H 1
-/* $Id: sig_24.h,v 1.26 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: sig_24.h,v 1.26 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC2535 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/soa_6.c b/contrib/bind9/lib/dns/rdata/generic/soa_6.c
index 921aead..d3fdf41 100644
--- a/contrib/bind9/lib/dns/rdata/generic/soa_6.c
+++ b/contrib/bind9/lib/dns/rdata/generic/soa_6.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: soa_6.c,v 1.61.332.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: soa_6.c,v 1.61.332.2 2009-02-16 23:47:15 tbox Exp $ */
/* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */
diff --git a/contrib/bind9/lib/dns/rdata/generic/soa_6.h b/contrib/bind9/lib/dns/rdata/generic/soa_6.h
index 7443b04..8f78a88 100644
--- a/contrib/bind9/lib/dns/rdata/generic/soa_6.h
+++ b/contrib/bind9/lib/dns/rdata/generic/soa_6.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_SOA_6_H
#define GENERIC_SOA_6_H 1
-/* $Id: soa_6.h,v 1.32 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: soa_6.h,v 1.32 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_soa {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/spf_99.c b/contrib/bind9/lib/dns/rdata/generic/spf_99.c
index 12e813e..b1ad062 100644
--- a/contrib/bind9/lib/dns/rdata/generic/spf_99.c
+++ b/contrib/bind9/lib/dns/rdata/generic/spf_99.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: spf_99.c,v 1.4 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: spf_99.c,v 1.4 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/generic/spf_99.h b/contrib/bind9/lib/dns/rdata/generic/spf_99.h
index be5e978..f0b876e 100644
--- a/contrib/bind9/lib/dns/rdata/generic/spf_99.h
+++ b/contrib/bind9/lib/dns/rdata/generic/spf_99.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_SPF_99_H
#define GENERIC_SPF_99_H 1
-/* $Id: spf_99.h,v 1.4 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: spf_99.h,v 1.4 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_spf_string {
isc_uint8_t length;
diff --git a/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c b/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c
index 570a3b7..892c1ec 100644
--- a/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c
+++ b/contrib/bind9/lib/dns/rdata/generic/sshfp_44.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sshfp_44.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: sshfp_44.c,v 1.7 2007-06-19 23:47:17 tbox Exp $ */
/* RFC 4255 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/sshfp_44.h b/contrib/bind9/lib/dns/rdata/generic/sshfp_44.h
index daea74c..37808ad 100644
--- a/contrib/bind9/lib/dns/rdata/generic/sshfp_44.h
+++ b/contrib/bind9/lib/dns/rdata/generic/sshfp_44.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sshfp_44.h,v 1.8 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: sshfp_44.h,v 1.8 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC 4255 */
diff --git a/contrib/bind9/lib/dns/rdata/generic/tkey_249.c b/contrib/bind9/lib/dns/rdata/generic/tkey_249.c
index 2412c85..6927c8d 100644
--- a/contrib/bind9/lib/dns/rdata/generic/tkey_249.c
+++ b/contrib/bind9/lib/dns/rdata/generic/tkey_249.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tkey_249.c,v 1.57 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: tkey_249.c,v 1.57 2007-06-19 23:47:17 tbox Exp $ */
/*
* Reviewed: Thu Mar 16 17:35:30 PST 2000 by halley.
diff --git a/contrib/bind9/lib/dns/rdata/generic/tkey_249.h b/contrib/bind9/lib/dns/rdata/generic/tkey_249.h
index 34d5646..aec2a91 100644
--- a/contrib/bind9/lib/dns/rdata/generic/tkey_249.h
+++ b/contrib/bind9/lib/dns/rdata/generic/tkey_249.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_TKEY_249_H
#define GENERIC_TKEY_249_H 1
-/* $Id: tkey_249.h,v 1.24 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: tkey_249.h,v 1.24 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per draft-ietf-dnsind-tkey-00.txt */
diff --git a/contrib/bind9/lib/dns/rdata/generic/txt_16.c b/contrib/bind9/lib/dns/rdata/generic/txt_16.c
index a158a59..fa14b86 100644
--- a/contrib/bind9/lib/dns/rdata/generic/txt_16.c
+++ b/contrib/bind9/lib/dns/rdata/generic/txt_16.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: txt_16.c,v 1.45 2008/02/15 23:46:51 tbox Exp $ */
+/* $Id: txt_16.c,v 1.45 2008-02-15 23:46:51 tbox Exp $ */
/* Reviewed: Thu Mar 16 15:40:00 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/generic/txt_16.h b/contrib/bind9/lib/dns/rdata/generic/txt_16.h
index fc46486..372fe8a 100644
--- a/contrib/bind9/lib/dns/rdata/generic/txt_16.h
+++ b/contrib/bind9/lib/dns/rdata/generic/txt_16.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_TXT_16_H
#define GENERIC_TXT_16_H 1
-/* $Id: txt_16.h,v 1.28 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: txt_16.h,v 1.28 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_txt_string {
isc_uint8_t length;
diff --git a/contrib/bind9/lib/dns/rdata/generic/unspec_103.c b/contrib/bind9/lib/dns/rdata/generic/unspec_103.c
index 384863e..ffd14d9 100644
--- a/contrib/bind9/lib/dns/rdata/generic/unspec_103.c
+++ b/contrib/bind9/lib/dns/rdata/generic/unspec_103.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: unspec_103.c,v 1.35 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: unspec_103.c,v 1.35 2007-06-19 23:47:17 tbox Exp $ */
#ifndef RDATA_GENERIC_UNSPEC_103_C
#define RDATA_GENERIC_UNSPEC_103_C
diff --git a/contrib/bind9/lib/dns/rdata/generic/unspec_103.h b/contrib/bind9/lib/dns/rdata/generic/unspec_103.h
index 4b2d310..c1e7df5 100644
--- a/contrib/bind9/lib/dns/rdata/generic/unspec_103.h
+++ b/contrib/bind9/lib/dns/rdata/generic/unspec_103.h
@@ -19,7 +19,7 @@
#ifndef GENERIC_UNSPEC_103_H
#define GENERIC_UNSPEC_103_H 1
-/* $Id: unspec_103.h,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: unspec_103.h,v 1.17 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_unspec_t {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/generic/x25_19.c b/contrib/bind9/lib/dns/rdata/generic/x25_19.c
index c496aaf..47aeb7f 100644
--- a/contrib/bind9/lib/dns/rdata/generic/x25_19.c
+++ b/contrib/bind9/lib/dns/rdata/generic/x25_19.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: x25_19.c,v 1.39 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: x25_19.c,v 1.39 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 16:15:57 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/generic/x25_19.h b/contrib/bind9/lib/dns/rdata/generic/x25_19.h
index 5ebc230..473a79b 100644
--- a/contrib/bind9/lib/dns/rdata/generic/x25_19.h
+++ b/contrib/bind9/lib/dns/rdata/generic/x25_19.h
@@ -18,7 +18,7 @@
#ifndef GENERIC_X25_19_H
#define GENERIC_X25_19_H 1
-/* $Id: x25_19.h,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: x25_19.h,v 1.18 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1183 */
diff --git a/contrib/bind9/lib/dns/rdata/hs_4/a_1.c b/contrib/bind9/lib/dns/rdata/hs_4/a_1.c
index 487e8bc..ae30719 100644
--- a/contrib/bind9/lib/dns/rdata/hs_4/a_1.c
+++ b/contrib/bind9/lib/dns/rdata/hs_4/a_1.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: a_1.c,v 1.31 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: a_1.c,v 1.31 2007-06-19 23:47:17 tbox Exp $ */
/* reviewed: Thu Mar 16 15:58:36 PST 2000 by brister */
diff --git a/contrib/bind9/lib/dns/rdata/hs_4/a_1.h b/contrib/bind9/lib/dns/rdata/hs_4/a_1.h
index dee812f..b215f26 100644
--- a/contrib/bind9/lib/dns/rdata/hs_4/a_1.h
+++ b/contrib/bind9/lib/dns/rdata/hs_4/a_1.h
@@ -19,7 +19,7 @@
#ifndef HS_4_A_1_H
#define HS_4_A_1_H 1
-/* $Id: a_1.h,v 1.12 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: a_1.h,v 1.12 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_hs_a {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/in_1/a6_38.c b/contrib/bind9/lib/dns/rdata/in_1/a6_38.c
index d4d42bb..450b74c 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/a6_38.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/a6_38.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: a6_38.c,v 1.54 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: a6_38.c,v 1.54 2007-06-19 23:47:17 tbox Exp $ */
/* RFC2874 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/a6_38.h b/contrib/bind9/lib/dns/rdata/in_1/a6_38.h
index 75e53f1..2fcb4b3 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/a6_38.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/a6_38.h
@@ -18,7 +18,7 @@
#ifndef IN_1_A6_38_H
#define IN_1_A6_38_H 1
-/* $Id: a6_38.h,v 1.24 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: a6_38.h,v 1.24 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC2874 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/a_1.c b/contrib/bind9/lib/dns/rdata/in_1/a_1.c
index d7644bc..1181e44 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/a_1.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/a_1.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: a_1.c,v 1.53 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: a_1.c,v 1.53 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/a_1.h b/contrib/bind9/lib/dns/rdata/in_1/a_1.h
index c192d1a..6d0fb35 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/a_1.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/a_1.h
@@ -19,7 +19,7 @@
#ifndef IN_1_A_1_H
#define IN_1_A_1_H 1
-/* $Id: a_1.h,v 1.28 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: a_1.h,v 1.28 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_in_a {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c b/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c
index d0503a9..119131c 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: aaaa_28.c,v 1.45 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: aaaa_28.c,v 1.45 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h b/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h
index 54a0cb3..76dd219 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/aaaa_28.h
@@ -18,7 +18,7 @@
#ifndef IN_1_AAAA_28_H
#define IN_1_AAAA_28_H 1
-/* $Id: aaaa_28.h,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: aaaa_28.h,v 1.21 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1886 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/apl_42.c b/contrib/bind9/lib/dns/rdata/in_1/apl_42.c
index 28ca68e..70f6880 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/apl_42.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/apl_42.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: apl_42.c,v 1.14 2008/01/22 23:28:04 tbox Exp $ */
+/* $Id: apl_42.c,v 1.14 2008-01-22 23:28:04 tbox Exp $ */
/* RFC3123 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/apl_42.h b/contrib/bind9/lib/dns/rdata/in_1/apl_42.h
index 2d01040..049a28b 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/apl_42.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/apl_42.h
@@ -19,7 +19,7 @@
#ifndef IN_1_APL_42_H
#define IN_1_APL_42_H 1
-/* $Id: apl_42.h,v 1.6 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: apl_42.h,v 1.6 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_apl_ent {
isc_boolean_t negative;
diff --git a/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.c b/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.c
index 27c4e4e..5759a76d 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dhcid_49.c,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: dhcid_49.c,v 1.5 2007-06-19 23:47:17 tbox Exp $ */
/* RFC 4701 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.h b/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.h
index 2797192..c63cc7b 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/dhcid_49.h
@@ -18,7 +18,7 @@
#ifndef IN_1_DHCID_49_H
#define IN_1_DHCID_49_H 1
-/* $Id: dhcid_49.h,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: dhcid_49.h,v 1.5 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_in_dhcid {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/in_1/kx_36.c b/contrib/bind9/lib/dns/rdata/in_1/kx_36.c
index 9df2e5e..795844d 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/kx_36.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/kx_36.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: kx_36.c,v 1.45 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: kx_36.c,v 1.45 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/kx_36.h b/contrib/bind9/lib/dns/rdata/in_1/kx_36.h
index 391ae27..db58c15 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/kx_36.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/kx_36.h
@@ -18,7 +18,7 @@
#ifndef IN_1_KX_36_H
#define IN_1_KX_36_H 1
-/* $Id: kx_36.h,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: kx_36.h,v 1.20 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC2230 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c b/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c
index 21ab44c..51aadf7 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/naptr_35.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: naptr_35.c,v 1.53 2008/02/15 23:46:51 tbox Exp $ */
+/* $Id: naptr_35.c,v 1.53 2008-02-15 23:46:51 tbox Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h b/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h
index 503f7a8..03acbdd 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/naptr_35.h
@@ -18,7 +18,7 @@
#ifndef IN_1_NAPTR_35_H
#define IN_1_NAPTR_35_H 1
-/* $Id: naptr_35.h,v 1.23 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: naptr_35.h,v 1.23 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC2915 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c b/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c
index 2da7869..615d24a 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsap-ptr_23.c,v 1.38 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: nsap-ptr_23.c,v 1.38 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Fri Mar 17 10:16:02 PST 2000 by gson */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h b/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h
index 14a8b19..3becbd0 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/nsap-ptr_23.h
@@ -18,7 +18,7 @@
#ifndef IN_1_NSAP_PTR_23_H
#define IN_1_NSAP_PTR_23_H 1
-/* $Id: nsap-ptr_23.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: nsap-ptr_23.h,v 1.19 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1348. Obsoleted in RFC 1706 - use PTR instead. */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/nsap_22.c b/contrib/bind9/lib/dns/rdata/in_1/nsap_22.c
index c25f560..1aaf13f 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/nsap_22.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/nsap_22.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsap_22.c,v 1.42 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: nsap_22.c,v 1.42 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Fri Mar 17 10:41:07 PST 2000 by gson */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/nsap_22.h b/contrib/bind9/lib/dns/rdata/in_1/nsap_22.h
index 11e3f66..1742472 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/nsap_22.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/nsap_22.h
@@ -18,7 +18,7 @@
#ifndef IN_1_NSAP_22_H
#define IN_1_NSAP_22_H 1
-/* $Id: nsap_22.h,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: nsap_22.h,v 1.18 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC1706 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/px_26.c b/contrib/bind9/lib/dns/rdata/in_1/px_26.c
index 1d17f2f..517b87c 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/px_26.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/px_26.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: px_26.c,v 1.43 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: px_26.c,v 1.43 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Mon Mar 20 10:44:27 PST 2000 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/px_26.h b/contrib/bind9/lib/dns/rdata/in_1/px_26.h
index 69a7bae..57285f4 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/px_26.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/px_26.h
@@ -18,7 +18,7 @@
#ifndef IN_1_PX_26_H
#define IN_1_PX_26_H 1
-/* $Id: px_26.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: px_26.h,v 1.19 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \brief Per RFC2163 */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/srv_33.c b/contrib/bind9/lib/dns/rdata/in_1/srv_33.c
index 7bc85cd..ac9e577 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/srv_33.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/srv_33.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: srv_33.c,v 1.45 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: srv_33.c,v 1.45 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/srv_33.h b/contrib/bind9/lib/dns/rdata/in_1/srv_33.h
index e019698..b7c2a13 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/srv_33.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/srv_33.h
@@ -18,7 +18,7 @@
#ifndef IN_1_SRV_33_H
#define IN_1_SRV_33_H 1
-/* $Id: srv_33.h,v 1.19 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: srv_33.h,v 1.19 2007-06-19 23:47:17 tbox Exp $ */
/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/wks_11.c b/contrib/bind9/lib/dns/rdata/in_1/wks_11.c
index 55859c4..b7d5057 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/wks_11.c
+++ b/contrib/bind9/lib/dns/rdata/in_1/wks_11.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: wks_11.c,v 1.54.332.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: wks_11.c,v 1.54.332.2 2009-02-16 23:47:15 tbox Exp $ */
/* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */
diff --git a/contrib/bind9/lib/dns/rdata/in_1/wks_11.h b/contrib/bind9/lib/dns/rdata/in_1/wks_11.h
index 2fd26e8..9ef250a 100644
--- a/contrib/bind9/lib/dns/rdata/in_1/wks_11.h
+++ b/contrib/bind9/lib/dns/rdata/in_1/wks_11.h
@@ -18,7 +18,7 @@
#ifndef IN_1_WKS_11_H
#define IN_1_WKS_11_H 1
-/* $Id: wks_11.h,v 1.22 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: wks_11.h,v 1.22 2007-06-19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_in_wks {
dns_rdatacommon_t common;
diff --git a/contrib/bind9/lib/dns/rdata/rdatastructpre.h b/contrib/bind9/lib/dns/rdata/rdatastructpre.h
index ab7e051..e6b71cb 100644
--- a/contrib/bind9/lib/dns/rdata/rdatastructpre.h
+++ b/contrib/bind9/lib/dns/rdata/rdatastructpre.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatastructpre.h,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rdatastructpre.h,v 1.16 2007-06-19 23:47:17 tbox Exp $ */
#ifndef DNS_RDATASTRUCT_H
#define DNS_RDATASTRUCT_H 1
diff --git a/contrib/bind9/lib/dns/rdata/rdatastructsuf.h b/contrib/bind9/lib/dns/rdata/rdatastructsuf.h
index 3ba1275..eaf1d89 100644
--- a/contrib/bind9/lib/dns/rdata/rdatastructsuf.h
+++ b/contrib/bind9/lib/dns/rdata/rdatastructsuf.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatastructsuf.h,v 1.10 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: rdatastructsuf.h,v 1.10 2007-06-19 23:47:17 tbox Exp $ */
ISC_LANG_ENDDECLS
diff --git a/contrib/bind9/lib/dns/rdatalist_p.h b/contrib/bind9/lib/dns/rdatalist_p.h
index 3e73e20..c529ff6 100644
--- a/contrib/bind9/lib/dns/rdatalist_p.h
+++ b/contrib/bind9/lib/dns/rdatalist_p.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatalist_p.h,v 1.11 2008/09/25 04:02:38 tbox Exp $ */
+/* $Id: rdatalist_p.h,v 1.11 2008-09-25 04:02:38 tbox Exp $ */
#ifndef DNS_RDATALIST_P_H
#define DNS_RDATALIST_P_H
diff --git a/contrib/bind9/lib/dns/rdataset.c b/contrib/bind9/lib/dns/rdataset.c
index c0fcde5..44b3a5e 100644
--- a/contrib/bind9/lib/dns/rdataset.c
+++ b/contrib/bind9/lib/dns/rdataset.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataset.c,v 1.82.50.4 2010-02-25 10:56:41 tbox Exp $ */
+/* $Id: rdataset.c,v 1.82.50.4.6.1 2011-05-27 00:19:19 each Exp $ */
/*! \file */
@@ -34,6 +34,26 @@
#include <dns/rdataset.h>
#include <dns/compress.h>
+static const char *trustnames[] = {
+ "none",
+ "pending-additional",
+ "pending-answer",
+ "additional",
+ "glue",
+ "answer",
+ "authauthority",
+ "authanswer",
+ "secure",
+ "local" /* aka ultimate */
+};
+
+const char *
+dns_trust_totext(dns_trust_t trust) {
+ if (trust >= sizeof(trustnames)/sizeof(*trustnames))
+ return ("bad");
+ return (trustnames[trust]);
+}
+
void
dns_rdataset_init(dns_rdataset_t *rdataset) {
diff --git a/contrib/bind9/lib/dns/rdatasetiter.c b/contrib/bind9/lib/dns/rdatasetiter.c
index 7ed3030..88e8807 100644
--- a/contrib/bind9/lib/dns/rdatasetiter.c
+++ b/contrib/bind9/lib/dns/rdatasetiter.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatasetiter.c,v 1.16 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: rdatasetiter.c,v 1.16 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/request.c b/contrib/bind9/lib/dns/request.c
index ac844e1..c1cd235 100644
--- a/contrib/bind9/lib/dns/request.c
+++ b/contrib/bind9/lib/dns/request.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: request.c,v 1.82.72.2 2009/01/18 23:47:40 tbox Exp $ */
+/* $Id: request.c,v 1.82.72.2 2009-01-18 23:47:40 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/soa.c b/contrib/bind9/lib/dns/soa.c
index 83a1c17..f338586 100644
--- a/contrib/bind9/lib/dns/soa.c
+++ b/contrib/bind9/lib/dns/soa.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: soa.c,v 1.8 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: soa.c,v 1.8 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/spnego.asn1 b/contrib/bind9/lib/dns/spnego.asn1
index 43d152b..04035d2 100644
--- a/contrib/bind9/lib/dns/spnego.asn1
+++ b/contrib/bind9/lib/dns/spnego.asn1
@@ -4,7 +4,7 @@
-- (The above copyright notice is per RFC 3978 5.6 (a), q.v.)
--- $Id: spnego.asn1,v 1.2 2006/12/04 01:52:46 marka Exp $
+-- $Id: spnego.asn1,v 1.2 2006-12-04 01:52:46 marka Exp $
-- This is the SPNEGO ASN.1 module from RFC 4178, tweaked
-- to get the Heimdal ASN.1 compiler to accept it.
diff --git a/contrib/bind9/lib/dns/spnego.c b/contrib/bind9/lib/dns/spnego.c
index 6c94e51..ad15331 100644
--- a/contrib/bind9/lib/dns/spnego.c
+++ b/contrib/bind9/lib/dns/spnego.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: spnego.c,v 1.8.118.4 2009/07/21 07:27:13 marka Exp $ */
+/* $Id: spnego.c,v 1.8.118.4 2009-07-21 07:27:13 marka Exp $ */
/*! \file
* \brief
diff --git a/contrib/bind9/lib/dns/spnego.h b/contrib/bind9/lib/dns/spnego.h
index c44614b..cc08409 100644
--- a/contrib/bind9/lib/dns/spnego.h
+++ b/contrib/bind9/lib/dns/spnego.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: spnego.h,v 1.4 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: spnego.h,v 1.4 2007-06-19 23:47:16 tbox Exp $ */
/*! \file
* \brief
diff --git a/contrib/bind9/lib/dns/spnego_asn1.c b/contrib/bind9/lib/dns/spnego_asn1.c
index 75c2304..caa8b4d 100644
--- a/contrib/bind9/lib/dns/spnego_asn1.c
+++ b/contrib/bind9/lib/dns/spnego_asn1.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: spnego_asn1.c,v 1.4 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: spnego_asn1.c,v 1.4 2007-06-19 23:47:16 tbox Exp $ */
/*! \file
* \brief Method routines generated from SPNEGO ASN.1 module.
diff --git a/contrib/bind9/lib/dns/spnego_asn1.pl b/contrib/bind9/lib/dns/spnego_asn1.pl
index 93dd676..eea8f01 100755
--- a/contrib/bind9/lib/dns/spnego_asn1.pl
+++ b/contrib/bind9/lib/dns/spnego_asn1.pl
@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: spnego_asn1.pl,v 1.4 2007/06/19 23:47:16 tbox Exp $
+# $Id: spnego_asn1.pl,v 1.4 2007-06-19 23:47:16 tbox Exp $
# Our SPNEGO implementation uses some functions generated by the
# Heimdal ASN.1 compiler, which this script then whacks a bit to make
@@ -99,7 +99,7 @@ print(q~/*
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: spnego_asn1.pl,v 1.4 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: spnego_asn1.pl,v 1.4 2007-06-19 23:47:16 tbox Exp $ */
/*! \file
* \brief Method routines generated from SPNEGO ASN.1 module.
diff --git a/contrib/bind9/lib/dns/ssu.c b/contrib/bind9/lib/dns/ssu.c
index ab69242..128071c 100644
--- a/contrib/bind9/lib/dns/ssu.c
+++ b/contrib/bind9/lib/dns/ssu.c
@@ -17,7 +17,7 @@
/*! \file */
/*
- * $Id: ssu.c,v 1.34 2008/01/18 23:46:58 tbox Exp $
+ * $Id: ssu.c,v 1.34 2008-01-18 23:46:58 tbox Exp $
* Principal Author: Brian Wellington
*/
diff --git a/contrib/bind9/lib/dns/stats.c b/contrib/bind9/lib/dns/stats.c
index 60fed35..b73a3b3 100644
--- a/contrib/bind9/lib/dns/stats.c
+++ b/contrib/bind9/lib/dns/stats.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stats.c,v 1.16.118.2 2009/01/29 23:47:44 tbox Exp $ */
+/* $Id: stats.c,v 1.16.118.2 2009-01-29 23:47:44 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/tcpmsg.c b/contrib/bind9/lib/dns/tcpmsg.c
index 49add56..0ece078 100644
--- a/contrib/bind9/lib/dns/tcpmsg.c
+++ b/contrib/bind9/lib/dns/tcpmsg.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: tcpmsg.c,v 1.31 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: tcpmsg.c,v 1.31 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/timer.c b/contrib/bind9/lib/dns/timer.c
index 39e4551..8d7ae33 100644
--- a/contrib/bind9/lib/dns/timer.c
+++ b/contrib/bind9/lib/dns/timer.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: timer.c,v 1.7 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: timer.c,v 1.7 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/ttl.c b/contrib/bind9/lib/dns/ttl.c
index 9d0dec5..3e41d63 100644
--- a/contrib/bind9/lib/dns/ttl.c
+++ b/contrib/bind9/lib/dns/ttl.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ttl.c,v 1.29 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: ttl.c,v 1.29 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/validator.c b/contrib/bind9/lib/dns/validator.c
index 054c5a6..4ecec8d 100644
--- a/contrib/bind9/lib/dns/validator.c
+++ b/contrib/bind9/lib/dns/validator.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: validator.c,v 1.164.12.23 2010-11-16 02:23:44 marka Exp $ */
+/* $Id: validator.c,v 1.164.12.23.4.1 2011-05-27 00:19:19 each Exp $ */
#include <config.h>
@@ -420,7 +420,8 @@ fetch_callback_validator(isc_task_t *task, isc_event_t *event) {
validator_done(val, ISC_R_CANCELED);
} else if (eresult == ISC_R_SUCCESS) {
validator_log(val, ISC_LOG_DEBUG(3),
- "keyset with trust %d", rdataset->trust);
+ "keyset with trust %s",
+ dns_trust_totext(rdataset->trust));
/*
* Only extract the dst key if the keyset is secure.
*/
@@ -497,7 +498,8 @@ dsfetched(isc_task_t *task, isc_event_t *event) {
validator_done(val, ISC_R_CANCELED);
} else if (eresult == ISC_R_SUCCESS) {
validator_log(val, ISC_LOG_DEBUG(3),
- "dsset with trust %d", rdataset->trust);
+ "dsset with trust %s",
+ dns_trust_totext(rdataset->trust));
val->dsset = &val->frdataset;
result = validatezonekey(val);
if (result != DNS_R_WAIT)
@@ -651,7 +653,8 @@ keyvalidated(isc_task_t *task, isc_event_t *event) {
validator_done(val, ISC_R_CANCELED);
} else if (eresult == ISC_R_SUCCESS) {
validator_log(val, ISC_LOG_DEBUG(3),
- "keyset with trust %d", val->frdataset.trust);
+ "keyset with trust %s",
+ dns_trust_totext(val->frdataset.trust));
/*
* Only extract the dst key if the keyset is secure.
*/
@@ -722,10 +725,10 @@ dsvalidated(isc_task_t *task, isc_event_t *event) {
isc_boolean_t have_dsset;
dns_name_t *name;
validator_log(val, ISC_LOG_DEBUG(3),
- "%s with trust %d",
+ "%s with trust %s",
val->frdataset.type == dns_rdatatype_ds ?
"dsset" : "ds non-existance",
- val->frdataset.trust);
+ dns_trust_totext(val->frdataset.trust));
have_dsset = ISC_TF(val->frdataset.type == dns_rdatatype_ds);
name = dns_fixedname_name(&val->fname);
if ((val->attributes & VALATTR_INSECURITY) != 0 &&
@@ -1376,8 +1379,8 @@ view_find(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type) {
INSIST(type == dns_rdatatype_dlv);
if (val->frdataset.trust != dns_trust_secure) {
validator_log(val, ISC_LOG_DEBUG(3),
- "covering nsec: trust %u",
- val->frdataset.trust);
+ "covering nsec: trust %s",
+ dns_trust_totext(val->frdataset.trust));
goto notfound;
}
result = dns_rdataset_first(&val->frdataset);
@@ -1706,8 +1709,8 @@ get_key(dns_validator_t *val, dns_rdata_rrsig_t *siginfo) {
* See if we've got the key used in the signature.
*/
validator_log(val, ISC_LOG_DEBUG(3),
- "keyset with trust %d",
- val->frdataset.trust);
+ "keyset with trust %s",
+ dns_trust_totext(val->frdataset.trust));
result = get_dst_key(val, siginfo, val->keyset);
if (result != ISC_R_SUCCESS) {
/*
@@ -2411,8 +2414,11 @@ validatezonekey(dns_validator_t *val) {
"must be secure failure");
return (DNS_R_MUSTBESECURE);
}
- markanswer(val, "validatezonekey (2)");
- return (ISC_R_SUCCESS);
+ if (val->view->dlv == NULL || DLVTRIED(val)) {
+ markanswer(val, "validatezonekey (2)");
+ return (ISC_R_SUCCESS);
+ }
+ return (startfinddlvsep(val, val->event->name));
}
/*
@@ -3195,7 +3201,8 @@ dlvvalidated(isc_task_t *task, isc_event_t *event) {
validator_done(val, ISC_R_CANCELED);
} else if (eresult == ISC_R_SUCCESS) {
validator_log(val, ISC_LOG_DEBUG(3),
- "dlvset with trust %d", val->frdataset.trust);
+ "dlvset with trust %s",
+ dns_trust_totext(val->frdataset.trust));
dns_rdataset_clone(&val->frdataset, &val->dlv);
val->havedlvsep = ISC_TRUE;
if (dlv_algorithm_supported(val))
diff --git a/contrib/bind9/lib/dns/version.c b/contrib/bind9/lib/dns/version.c
index fbc8889..99db4de 100644
--- a/contrib/bind9/lib/dns/version.c
+++ b/contrib/bind9/lib/dns/version.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.c,v 1.15 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: version.c,v 1.15 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/xfrin.c b/contrib/bind9/lib/dns/xfrin.c
index 4e3d2c3..b3f2e95 100644
--- a/contrib/bind9/lib/dns/xfrin.c
+++ b/contrib/bind9/lib/dns/xfrin.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: xfrin.c,v 1.166 2008/09/25 04:12:39 marka Exp $ */
+/* $Id: xfrin.c,v 1.166 2008-09-25 04:12:39 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/zonekey.c b/contrib/bind9/lib/dns/zonekey.c
index bf7474b..877b3b1 100644
--- a/contrib/bind9/lib/dns/zonekey.c
+++ b/contrib/bind9/lib/dns/zonekey.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zonekey.c,v 1.9 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: zonekey.c,v 1.9 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/dns/zt.c b/contrib/bind9/lib/dns/zt.c
index ed7f28a..fd6af28 100644
--- a/contrib/bind9/lib/dns/zt.c
+++ b/contrib/bind9/lib/dns/zt.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zt.c,v 1.47 2007/06/19 23:47:16 tbox Exp $ */
+/* $Id: zt.c,v 1.47 2007-06-19 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/alpha/Makefile.in b/contrib/bind9/lib/isc/alpha/Makefile.in
index 324db07..701fb84 100644
--- a/contrib/bind9/lib/isc/alpha/Makefile.in
+++ b/contrib/bind9/lib/isc/alpha/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/alpha/include/Makefile.in b/contrib/bind9/lib/isc/alpha/include/Makefile.in
index f1d8bdd..8c5dd3a 100644
--- a/contrib/bind9/lib/isc/alpha/include/Makefile.in
+++ b/contrib/bind9/lib/isc/alpha/include/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/alpha/include/isc/Makefile.in b/contrib/bind9/lib/isc/alpha/include/isc/Makefile.in
index 5f116ca..43829a1 100644
--- a/contrib/bind9/lib/isc/alpha/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/alpha/include/isc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/alpha/include/isc/atomic.h b/contrib/bind9/lib/isc/alpha/include/isc/atomic.h
index f60f9fd..bb4f1ad 100644
--- a/contrib/bind9/lib/isc/alpha/include/isc/atomic.h
+++ b/contrib/bind9/lib/isc/alpha/include/isc/atomic.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: atomic.h,v 1.5.332.2 2009/04/08 06:47:32 tbox Exp $ */
+/* $Id: atomic.h,v 1.5.332.2 2009-04-08 06:47:32 tbox Exp $ */
/*
* This code was written based on FreeBSD's kernel source whose copyright
diff --git a/contrib/bind9/lib/isc/assertions.c b/contrib/bind9/lib/isc/assertions.c
index 4c9251b..b98d61d 100644
--- a/contrib/bind9/lib/isc/assertions.c
+++ b/contrib/bind9/lib/isc/assertions.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: assertions.c,v 1.23 2008/10/15 23:47:31 tbox Exp $ */
+/* $Id: assertions.c,v 1.23 2008-10-15 23:47:31 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/base32.c b/contrib/bind9/lib/isc/base32.c
index d324da9..5e5cbd9 100644
--- a/contrib/bind9/lib/isc/base32.c
+++ b/contrib/bind9/lib/isc/base32.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base32.c,v 1.3.116.3 2009/10/21 01:22:47 each Exp $ */
+/* $Id: base32.c,v 1.3.116.3 2009-10-21 01:22:47 each Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/base64.c b/contrib/bind9/lib/isc/base64.c
index 4844a4b..858525f 100644
--- a/contrib/bind9/lib/isc/base64.c
+++ b/contrib/bind9/lib/isc/base64.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base64.c,v 1.32.332.2 2009/10/21 23:47:20 tbox Exp $ */
+/* $Id: base64.c,v 1.32.332.2 2009-10-21 23:47:20 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/bitstring.c b/contrib/bind9/lib/isc/bitstring.c
index 33c7c1f..3171150 100644
--- a/contrib/bind9/lib/isc/bitstring.c
+++ b/contrib/bind9/lib/isc/bitstring.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: bitstring.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: bitstring.c,v 1.17 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/buffer.c b/contrib/bind9/lib/isc/buffer.c
index 1b59e65..141487b 100644
--- a/contrib/bind9/lib/isc/buffer.c
+++ b/contrib/bind9/lib/isc/buffer.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: buffer.c,v 1.49 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: buffer.c,v 1.49 2008-09-25 04:02:39 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/bufferlist.c b/contrib/bind9/lib/isc/bufferlist.c
index 0e5c125..c7376bb 100644
--- a/contrib/bind9/lib/isc/bufferlist.c
+++ b/contrib/bind9/lib/isc/bufferlist.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: bufferlist.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: bufferlist.c,v 1.17 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/commandline.c b/contrib/bind9/lib/isc/commandline.c
index aca1203..1f98c7b 100644
--- a/contrib/bind9/lib/isc/commandline.c
+++ b/contrib/bind9/lib/isc/commandline.c
@@ -48,7 +48,7 @@
* SUCH DAMAGE.
*/
-/* $Id: commandline.c,v 1.22 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: commandline.c,v 1.22 2008-09-25 04:02:39 tbox Exp $ */
/*! \file
* This file was adapted from the NetBSD project's source tree, RCS ID:
diff --git a/contrib/bind9/lib/isc/error.c b/contrib/bind9/lib/isc/error.c
index 095100a..f5239f9 100644
--- a/contrib/bind9/lib/isc/error.c
+++ b/contrib/bind9/lib/isc/error.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: error.c,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: error.c,v 1.21 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/event.c b/contrib/bind9/lib/isc/event.c
index 8ab7524..8665160 100644
--- a/contrib/bind9/lib/isc/event.c
+++ b/contrib/bind9/lib/isc/event.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: event.c,v 1.21 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: event.c,v 1.21 2007-06-19 23:47:17 tbox Exp $ */
/*!
* \file
diff --git a/contrib/bind9/lib/isc/fsaccess.c b/contrib/bind9/lib/isc/fsaccess.c
index 5c97183..2ddd3db 100644
--- a/contrib/bind9/lib/isc/fsaccess.c
+++ b/contrib/bind9/lib/isc/fsaccess.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: fsaccess.c,v 1.10 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: fsaccess.c,v 1.10 2007-06-19 23:47:17 tbox Exp $ */
/*! \file
* \brief
diff --git a/contrib/bind9/lib/isc/hash.c b/contrib/bind9/lib/isc/hash.c
index 9911bde..7c0fcea 100644
--- a/contrib/bind9/lib/isc/hash.c
+++ b/contrib/bind9/lib/isc/hash.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hash.c,v 1.13.332.3 2009/05/07 23:47:12 tbox Exp $ */
+/* $Id: hash.c,v 1.13.332.3 2009-05-07 23:47:12 tbox Exp $ */
/*! \file
* Some portion of this code was derived from universal hash function
diff --git a/contrib/bind9/lib/isc/heap.c b/contrib/bind9/lib/isc/heap.c
index dc32100..68f8ba8 100644
--- a/contrib/bind9/lib/isc/heap.c
+++ b/contrib/bind9/lib/isc/heap.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: heap.c,v 1.37.240.3 2010/02/04 23:47:46 tbox Exp $ */
+/* $Id: heap.c,v 1.37.240.3 2010-02-04 23:47:46 tbox Exp $ */
/*! \file
* Heap implementation of priority queues adapted from the following:
diff --git a/contrib/bind9/lib/isc/hex.c b/contrib/bind9/lib/isc/hex.c
index 3fa0e69..3e01013 100644
--- a/contrib/bind9/lib/isc/hex.c
+++ b/contrib/bind9/lib/isc/hex.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hex.c,v 1.20 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: hex.c,v 1.20 2008-09-25 04:02:39 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/hmacmd5.c b/contrib/bind9/lib/isc/hmacmd5.c
index 63853dc..b1d5906 100644
--- a/contrib/bind9/lib/isc/hmacmd5.c
+++ b/contrib/bind9/lib/isc/hmacmd5.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hmacmd5.c,v 1.14 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: hmacmd5.c,v 1.14 2007-06-19 23:47:17 tbox Exp $ */
/*! \file
* This code implements the HMAC-MD5 keyed hash algorithm
diff --git a/contrib/bind9/lib/isc/hmacsha.c b/contrib/bind9/lib/isc/hmacsha.c
index dfcd8bf..9f27163 100644
--- a/contrib/bind9/lib/isc/hmacsha.c
+++ b/contrib/bind9/lib/isc/hmacsha.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hmacsha.c,v 1.8 2007/08/27 03:27:53 marka Exp $ */
+/* $Id: hmacsha.c,v 1.8 2007-08-27 03:27:53 marka Exp $ */
/*
* This code implements the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384
diff --git a/contrib/bind9/lib/isc/httpd.c b/contrib/bind9/lib/isc/httpd.c
index 066939d..b653f79 100644
--- a/contrib/bind9/lib/isc/httpd.c
+++ b/contrib/bind9/lib/isc/httpd.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: httpd.c,v 1.16.64.2 2010/02/04 23:47:46 tbox Exp $ */
+/* $Id: httpd.c,v 1.16.64.2 2010-02-04 23:47:46 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/ia64/Makefile.in b/contrib/bind9/lib/isc/ia64/Makefile.in
index 324db07..701fb84 100644
--- a/contrib/bind9/lib/isc/ia64/Makefile.in
+++ b/contrib/bind9/lib/isc/ia64/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/ia64/include/Makefile.in b/contrib/bind9/lib/isc/ia64/include/Makefile.in
index f1d8bdd..8c5dd3a 100644
--- a/contrib/bind9/lib/isc/ia64/include/Makefile.in
+++ b/contrib/bind9/lib/isc/ia64/include/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/ia64/include/isc/Makefile.in b/contrib/bind9/lib/isc/ia64/include/isc/Makefile.in
index 5f116ca..43829a1 100644
--- a/contrib/bind9/lib/isc/ia64/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/ia64/include/isc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/ia64/include/isc/atomic.h b/contrib/bind9/lib/isc/ia64/include/isc/atomic.h
index 5d7c366..b2d355e 100644
--- a/contrib/bind9/lib/isc/ia64/include/isc/atomic.h
+++ b/contrib/bind9/lib/isc/ia64/include/isc/atomic.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: atomic.h,v 1.4.326.3 2009/06/24 02:21:28 marka Exp $ */
+/* $Id: atomic.h,v 1.4.326.3 2009-06-24 02:21:28 marka Exp $ */
#ifndef ISC_ATOMIC_H
#define ISC_ATOMIC_H 1
diff --git a/contrib/bind9/lib/isc/include/Makefile.in b/contrib/bind9/lib/isc/include/Makefile.in
index 04778d7..0435384 100644
--- a/contrib/bind9/lib/isc/include/Makefile.in
+++ b/contrib/bind9/lib/isc/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.13 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.13 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/include/isc/Makefile.in b/contrib/bind9/lib/isc/include/isc/Makefile.in
index def1180..c1d71f4 100644
--- a/contrib/bind9/lib/isc/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/include/isc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.64.12.2 2009/02/12 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.64.12.2 2009-02-12 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/include/isc/app.h b/contrib/bind9/lib/isc/include/isc/app.h
index c4d54cb..0552758 100644
--- a/contrib/bind9/lib/isc/include/isc/app.h
+++ b/contrib/bind9/lib/isc/include/isc/app.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: app.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: app.h,v 1.8 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_APP_H
#define ISC_APP_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/assertions.h b/contrib/bind9/lib/isc/include/isc/assertions.h
index b031152..8a2ba7e 100644
--- a/contrib/bind9/lib/isc/include/isc/assertions.h
+++ b/contrib/bind9/lib/isc/include/isc/assertions.h
@@ -16,7 +16,7 @@
*/
/*
- * $Id: assertions.h,v 1.26 2008/10/15 23:47:31 tbox Exp $
+ * $Id: assertions.h,v 1.26 2008-10-15 23:47:31 tbox Exp $
*/
/*! \file isc/assertions.h
*/
diff --git a/contrib/bind9/lib/isc/include/isc/base32.h b/contrib/bind9/lib/isc/include/isc/base32.h
index 978a8db..884c724 100644
--- a/contrib/bind9/lib/isc/include/isc/base32.h
+++ b/contrib/bind9/lib/isc/include/isc/base32.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base32.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: base32.h,v 1.3 2008-09-25 04:02:39 tbox Exp $ */
#ifndef ISC_BASE32_H
#define ISC_BASE32_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/base64.h b/contrib/bind9/lib/isc/include/isc/base64.h
index e48ef2a..574e57d 100644
--- a/contrib/bind9/lib/isc/include/isc/base64.h
+++ b/contrib/bind9/lib/isc/include/isc/base64.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base64.h,v 1.22 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: base64.h,v 1.22 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_BASE64_H
#define ISC_BASE64_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/bitstring.h b/contrib/bind9/lib/isc/include/isc/bitstring.h
index 252d111..e280bc0 100644
--- a/contrib/bind9/lib/isc/include/isc/bitstring.h
+++ b/contrib/bind9/lib/isc/include/isc/bitstring.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: bitstring.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: bitstring.h,v 1.14 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_BITSTRING_H
#define ISC_BITSTRING_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/boolean.h b/contrib/bind9/lib/isc/include/isc/boolean.h
index 348b096..45a0e57 100644
--- a/contrib/bind9/lib/isc/include/isc/boolean.h
+++ b/contrib/bind9/lib/isc/include/isc/boolean.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: boolean.h,v 1.19 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: boolean.h,v 1.19 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_BOOLEAN_H
#define ISC_BOOLEAN_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/buffer.h b/contrib/bind9/lib/isc/include/isc/buffer.h
index 2a02d88..e55c5b0 100644
--- a/contrib/bind9/lib/isc/include/isc/buffer.h
+++ b/contrib/bind9/lib/isc/include/isc/buffer.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: buffer.h,v 1.53 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: buffer.h,v 1.53 2008-09-25 04:02:39 tbox Exp $ */
#ifndef ISC_BUFFER_H
#define ISC_BUFFER_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/bufferlist.h b/contrib/bind9/lib/isc/include/isc/bufferlist.h
index 54e00c7..99b0c8d 100644
--- a/contrib/bind9/lib/isc/include/isc/bufferlist.h
+++ b/contrib/bind9/lib/isc/include/isc/bufferlist.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: bufferlist.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: bufferlist.h,v 1.17 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_BUFFERLIST_H
#define ISC_BUFFERLIST_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/commandline.h b/contrib/bind9/lib/isc/include/isc/commandline.h
index 384640a..21ae1e5 100644
--- a/contrib/bind9/lib/isc/include/isc/commandline.h
+++ b/contrib/bind9/lib/isc/include/isc/commandline.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: commandline.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: commandline.h,v 1.16 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_COMMANDLINE_H
#define ISC_COMMANDLINE_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/entropy.h b/contrib/bind9/lib/isc/include/isc/entropy.h
index 125669c..1eb8fd1 100644
--- a/contrib/bind9/lib/isc/include/isc/entropy.h
+++ b/contrib/bind9/lib/isc/include/isc/entropy.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: entropy.h,v 1.32.332.3 2009/10/19 02:46:07 marka Exp $ */
+/* $Id: entropy.h,v 1.32.332.3 2009-10-19 02:46:07 marka Exp $ */
#ifndef ISC_ENTROPY_H
#define ISC_ENTROPY_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/error.h b/contrib/bind9/lib/isc/include/isc/error.h
index efb9b5f..a0025e0 100644
--- a/contrib/bind9/lib/isc/include/isc/error.h
+++ b/contrib/bind9/lib/isc/include/isc/error.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: error.h,v 1.20 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: error.h,v 1.20 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_ERROR_H
#define ISC_ERROR_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/event.h b/contrib/bind9/lib/isc/include/isc/event.h
index 68fabb2..621edd8 100644
--- a/contrib/bind9/lib/isc/include/isc/event.h
+++ b/contrib/bind9/lib/isc/include/isc/event.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: event.h,v 1.34 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: event.h,v 1.34 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_EVENT_H
#define ISC_EVENT_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/eventclass.h b/contrib/bind9/lib/isc/include/isc/eventclass.h
index 9e6c145..97aed78 100644
--- a/contrib/bind9/lib/isc/include/isc/eventclass.h
+++ b/contrib/bind9/lib/isc/include/isc/eventclass.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: eventclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: eventclass.h,v 1.18 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_EVENTCLASS_H
#define ISC_EVENTCLASS_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/file.h b/contrib/bind9/lib/isc/include/isc/file.h
index c945734..6629a3e 100644
--- a/contrib/bind9/lib/isc/include/isc/file.h
+++ b/contrib/bind9/lib/isc/include/isc/file.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: file.h,v 1.33.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: file.h,v 1.33.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_FILE_H
#define ISC_FILE_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/formatcheck.h b/contrib/bind9/lib/isc/include/isc/formatcheck.h
index 51ce3ca..213374e 100644
--- a/contrib/bind9/lib/isc/include/isc/formatcheck.h
+++ b/contrib/bind9/lib/isc/include/isc/formatcheck.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: formatcheck.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: formatcheck.h,v 1.13 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_FORMATCHECK_H
#define ISC_FORMATCHECK_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/fsaccess.h b/contrib/bind9/lib/isc/include/isc/fsaccess.h
index 3b455e5..88469dd 100644
--- a/contrib/bind9/lib/isc/include/isc/fsaccess.h
+++ b/contrib/bind9/lib/isc/include/isc/fsaccess.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: fsaccess.h,v 1.14.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: fsaccess.h,v 1.14.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_FSACCESS_H
#define ISC_FSACCESS_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/hash.h b/contrib/bind9/lib/isc/include/isc/hash.h
index da30a19..9bfb709 100644
--- a/contrib/bind9/lib/isc/include/isc/hash.h
+++ b/contrib/bind9/lib/isc/include/isc/hash.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hash.h,v 1.10.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: hash.h,v 1.10.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_HASH_H
#define ISC_HASH_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/heap.h b/contrib/bind9/lib/isc/include/isc/heap.h
index 82c5982..ae346c1 100644
--- a/contrib/bind9/lib/isc/include/isc/heap.h
+++ b/contrib/bind9/lib/isc/include/isc/heap.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: heap.h,v 1.24.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: heap.h,v 1.24.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_HEAP_H
#define ISC_HEAP_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/hex.h b/contrib/bind9/lib/isc/include/isc/hex.h
index a5e2f53..d19e825 100644
--- a/contrib/bind9/lib/isc/include/isc/hex.h
+++ b/contrib/bind9/lib/isc/include/isc/hex.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hex.h,v 1.13 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: hex.h,v 1.13 2008-09-25 04:02:39 tbox Exp $ */
#ifndef ISC_HEX_H
#define ISC_HEX_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/hmacmd5.h b/contrib/bind9/lib/isc/include/isc/hmacmd5.h
index fab9c58..68074ae 100644
--- a/contrib/bind9/lib/isc/include/isc/hmacmd5.h
+++ b/contrib/bind9/lib/isc/include/isc/hmacmd5.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hmacmd5.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: hmacmd5.h,v 1.12 2007-06-19 23:47:18 tbox Exp $ */
/*! \file isc/hmacmd5.h
* \brief This is the header file for the HMAC-MD5 keyed hash algorithm
diff --git a/contrib/bind9/lib/isc/include/isc/hmacsha.h b/contrib/bind9/lib/isc/include/isc/hmacsha.h
index 362b37f..c439883 100644
--- a/contrib/bind9/lib/isc/include/isc/hmacsha.h
+++ b/contrib/bind9/lib/isc/include/isc/hmacsha.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: hmacsha.h,v 1.7 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: hmacsha.h,v 1.7 2007-06-19 23:47:18 tbox Exp $ */
/*! \file isc/hmacsha.h
* This is the header file for the HMAC-SHA1, HMAC-SHA224, HMAC-SHA256,
diff --git a/contrib/bind9/lib/isc/include/isc/httpd.h b/contrib/bind9/lib/isc/include/isc/httpd.h
index ba7f900..aff9856 100644
--- a/contrib/bind9/lib/isc/include/isc/httpd.h
+++ b/contrib/bind9/lib/isc/include/isc/httpd.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: httpd.h,v 1.9 2008/08/08 05:06:49 marka Exp $ */
+/* $Id: httpd.h,v 1.9 2008-08-08 05:06:49 marka Exp $ */
#ifndef ISC_HTTPD_H
#define ISC_HTTPD_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/interfaceiter.h b/contrib/bind9/lib/isc/include/isc/interfaceiter.h
index 26d5dfb..3abf957 100644
--- a/contrib/bind9/lib/isc/include/isc/interfaceiter.h
+++ b/contrib/bind9/lib/isc/include/isc/interfaceiter.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: interfaceiter.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: interfaceiter.h,v 1.17 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_INTERFACEITER_H
#define ISC_INTERFACEITER_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/ipv6.h b/contrib/bind9/lib/isc/include/isc/ipv6.h
index 8054c9e..b9c30cd 100644
--- a/contrib/bind9/lib/isc/include/isc/ipv6.h
+++ b/contrib/bind9/lib/isc/include/isc/ipv6.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ipv6.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: ipv6.h,v 1.24 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_IPV6_H
#define ISC_IPV6_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/iterated_hash.h b/contrib/bind9/lib/isc/include/isc/iterated_hash.h
index a8173f0..a6de8fc 100644
--- a/contrib/bind9/lib/isc/include/isc/iterated_hash.h
+++ b/contrib/bind9/lib/isc/include/isc/iterated_hash.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: iterated_hash.h,v 1.3 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: iterated_hash.h,v 1.3 2008-09-25 04:02:39 tbox Exp $ */
#ifndef ISC_ITERATED_HASH_H
#define ISC_ITERATED_HASH_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/lang.h b/contrib/bind9/lib/isc/include/isc/lang.h
index 8c60866..5e1c61e 100644
--- a/contrib/bind9/lib/isc/include/isc/lang.h
+++ b/contrib/bind9/lib/isc/include/isc/lang.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lang.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: lang.h,v 1.13 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_LANG_H
#define ISC_LANG_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/lex.h b/contrib/bind9/lib/isc/include/isc/lex.h
index 8612150..e260a5b 100644
--- a/contrib/bind9/lib/isc/include/isc/lex.h
+++ b/contrib/bind9/lib/isc/include/isc/lex.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lex.h,v 1.37 2008/05/30 23:47:01 tbox Exp $ */
+/* $Id: lex.h,v 1.37 2008-05-30 23:47:01 tbox Exp $ */
#ifndef ISC_LEX_H
#define ISC_LEX_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/lfsr.h b/contrib/bind9/lib/isc/include/isc/lfsr.h
index d4d9707..c9ad13d 100644
--- a/contrib/bind9/lib/isc/include/isc/lfsr.h
+++ b/contrib/bind9/lib/isc/include/isc/lfsr.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lfsr.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: lfsr.h,v 1.17 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_LFSR_H
#define ISC_LFSR_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/lib.h b/contrib/bind9/lib/isc/include/isc/lib.h
index 765cdfa..3804a07 100644
--- a/contrib/bind9/lib/isc/include/isc/lib.h
+++ b/contrib/bind9/lib/isc/include/isc/lib.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lib.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: lib.h,v 1.14 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_LIB_H
#define ISC_LIB_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/list.h b/contrib/bind9/lib/isc/include/isc/list.h
index 9338275..69ba1c6 100644
--- a/contrib/bind9/lib/isc/include/isc/list.h
+++ b/contrib/bind9/lib/isc/include/isc/list.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: list.h,v 1.24 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: list.h,v 1.24 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_LIST_H
#define ISC_LIST_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/log.h b/contrib/bind9/lib/isc/include/isc/log.h
index c9ba808..fec3d9d 100644
--- a/contrib/bind9/lib/isc/include/isc/log.h
+++ b/contrib/bind9/lib/isc/include/isc/log.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.h,v 1.54.332.5 2009/02/16 02:04:05 marka Exp $ */
+/* $Id: log.h,v 1.54.332.5 2009-02-16 02:04:05 marka Exp $ */
#ifndef ISC_LOG_H
#define ISC_LOG_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/magic.h b/contrib/bind9/lib/isc/include/isc/magic.h
index 073de90..0a864ea 100644
--- a/contrib/bind9/lib/isc/include/isc/magic.h
+++ b/contrib/bind9/lib/isc/include/isc/magic.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: magic.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: magic.h,v 1.18 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_MAGIC_H
#define ISC_MAGIC_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/md5.h b/contrib/bind9/lib/isc/include/isc/md5.h
index 5b0d785..9d5b1ec 100644
--- a/contrib/bind9/lib/isc/include/isc/md5.h
+++ b/contrib/bind9/lib/isc/include/isc/md5.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: md5.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: md5.h,v 1.16 2007-06-19 23:47:18 tbox Exp $ */
/*! \file isc/md5.h
* \brief This is the header file for the MD5 message-digest algorithm.
diff --git a/contrib/bind9/lib/isc/include/isc/msgcat.h b/contrib/bind9/lib/isc/include/isc/msgcat.h
index fe3d336..e4bdf52 100644
--- a/contrib/bind9/lib/isc/include/isc/msgcat.h
+++ b/contrib/bind9/lib/isc/include/isc/msgcat.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: msgcat.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: msgcat.h,v 1.13 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_MSGCAT_H
#define ISC_MSGCAT_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/msgs.h b/contrib/bind9/lib/isc/include/isc/msgs.h
index d8f2787..674371f5 100644
--- a/contrib/bind9/lib/isc/include/isc/msgs.h
+++ b/contrib/bind9/lib/isc/include/isc/msgs.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: msgs.h,v 1.17 2008/08/08 06:28:59 tbox Exp $ */
+/* $Id: msgs.h,v 1.17 2008-08-08 06:28:59 tbox Exp $ */
#ifndef ISC_MSGS_H
#define ISC_MSGS_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/mutexblock.h b/contrib/bind9/lib/isc/include/isc/mutexblock.h
index 65bf2bf..b08ece7 100644
--- a/contrib/bind9/lib/isc/include/isc/mutexblock.h
+++ b/contrib/bind9/lib/isc/include/isc/mutexblock.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutexblock.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: mutexblock.h,v 1.17 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_MUTEXBLOCK_H
#define ISC_MUTEXBLOCK_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/netaddr.h b/contrib/bind9/lib/isc/include/isc/netaddr.h
index 8bfdbce..52418ec 100644
--- a/contrib/bind9/lib/isc/include/isc/netaddr.h
+++ b/contrib/bind9/lib/isc/include/isc/netaddr.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: netaddr.h,v 1.35.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: netaddr.h,v 1.35.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_NETADDR_H
#define ISC_NETADDR_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/netscope.h b/contrib/bind9/lib/isc/include/isc/netscope.h
index 0883140..7b2c13c 100644
--- a/contrib/bind9/lib/isc/include/isc/netscope.h
+++ b/contrib/bind9/lib/isc/include/isc/netscope.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: netscope.h,v 1.11.332.2 2009/06/25 23:47:24 tbox Exp $ */
+/* $Id: netscope.h,v 1.11.332.2 2009-06-25 23:47:24 tbox Exp $ */
#ifndef ISC_NETSCOPE_H
#define ISC_NETSCOPE_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/ondestroy.h b/contrib/bind9/lib/isc/include/isc/ondestroy.h
index 64bd643..8fe5b27 100644
--- a/contrib/bind9/lib/isc/include/isc/ondestroy.h
+++ b/contrib/bind9/lib/isc/include/isc/ondestroy.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ondestroy.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: ondestroy.h,v 1.14 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_ONDESTROY_H
#define ISC_ONDESTROY_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/os.h b/contrib/bind9/lib/isc/include/isc/os.h
index 3cf59e2..5ebdd76 100644
--- a/contrib/bind9/lib/isc/include/isc/os.h
+++ b/contrib/bind9/lib/isc/include/isc/os.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: os.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: os.h,v 1.12 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_OS_H
#define ISC_OS_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/parseint.h b/contrib/bind9/lib/isc/include/isc/parseint.h
index 5047676..a92b215 100644
--- a/contrib/bind9/lib/isc/include/isc/parseint.h
+++ b/contrib/bind9/lib/isc/include/isc/parseint.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: parseint.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: parseint.h,v 1.9 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_PARSEINT_H
#define ISC_PARSEINT_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/portset.h b/contrib/bind9/lib/isc/include/isc/portset.h
index a7ad3d6..a257322 100644
--- a/contrib/bind9/lib/isc/include/isc/portset.h
+++ b/contrib/bind9/lib/isc/include/isc/portset.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: portset.h,v 1.3.90.3 2009/06/25 05:31:51 marka Exp $ */
+/* $Id: portset.h,v 1.3.90.3 2009-06-25 05:31:51 marka Exp $ */
/*! \file isc/portset.h
* \brief Transport Protocol Port Manipulation Module
diff --git a/contrib/bind9/lib/isc/include/isc/print.h b/contrib/bind9/lib/isc/include/isc/print.h
index cd1e38e..bf77ac7 100644
--- a/contrib/bind9/lib/isc/include/isc/print.h
+++ b/contrib/bind9/lib/isc/include/isc/print.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: print.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: print.h,v 1.26 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_PRINT_H
#define ISC_PRINT_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/quota.h b/contrib/bind9/lib/isc/include/isc/quota.h
index 7b0d0d9..93f63fe 100644
--- a/contrib/bind9/lib/isc/include/isc/quota.h
+++ b/contrib/bind9/lib/isc/include/isc/quota.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: quota.h,v 1.16 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: quota.h,v 1.16 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_QUOTA_H
#define ISC_QUOTA_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/radix.h b/contrib/bind9/lib/isc/include/isc/radix.h
index fbb1893..fa5e294 100644
--- a/contrib/bind9/lib/isc/include/isc/radix.h
+++ b/contrib/bind9/lib/isc/include/isc/radix.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: radix.h,v 1.11.44.2 2008/12/24 23:47:02 tbox Exp $ */
+/* $Id: radix.h,v 1.11.44.2 2008-12-24 23:47:02 tbox Exp $ */
/*
* This source was adapted from MRT's RCS Ids:
diff --git a/contrib/bind9/lib/isc/include/isc/random.h b/contrib/bind9/lib/isc/include/isc/random.h
index 9b6ca64..9743cb4 100644
--- a/contrib/bind9/lib/isc/include/isc/random.h
+++ b/contrib/bind9/lib/isc/include/isc/random.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: random.h,v 1.18.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: random.h,v 1.18.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_RANDOM_H
#define ISC_RANDOM_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/ratelimiter.h b/contrib/bind9/lib/isc/include/isc/ratelimiter.h
index d18cf25..7ed312a 100644
--- a/contrib/bind9/lib/isc/include/isc/ratelimiter.h
+++ b/contrib/bind9/lib/isc/include/isc/ratelimiter.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ratelimiter.h,v 1.21.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: ratelimiter.h,v 1.21.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_RATELIMITER_H
#define ISC_RATELIMITER_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/refcount.h b/contrib/bind9/lib/isc/include/isc/refcount.h
index 6ab14ae..8e83a13 100644
--- a/contrib/bind9/lib/isc/include/isc/refcount.h
+++ b/contrib/bind9/lib/isc/include/isc/refcount.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: refcount.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: refcount.h,v 1.15 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_REFCOUNT_H
#define ISC_REFCOUNT_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/region.h b/contrib/bind9/lib/isc/include/isc/region.h
index 43d8f8f..4d4f677 100644
--- a/contrib/bind9/lib/isc/include/isc/region.h
+++ b/contrib/bind9/lib/isc/include/isc/region.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: region.h,v 1.25 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: region.h,v 1.25 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_REGION_H
#define ISC_REGION_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/resource.h b/contrib/bind9/lib/isc/include/isc/resource.h
index 747c9fd..2e2e73c 100644
--- a/contrib/bind9/lib/isc/include/isc/resource.h
+++ b/contrib/bind9/lib/isc/include/isc/resource.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: resource.h,v 1.13 2008/07/11 23:47:09 tbox Exp $ */
+/* $Id: resource.h,v 1.13 2008-07-11 23:47:09 tbox Exp $ */
#ifndef ISC_RESOURCE_H
#define ISC_RESOURCE_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/result.h b/contrib/bind9/lib/isc/include/isc/result.h
index 56b4ca6..804ab5e 100644
--- a/contrib/bind9/lib/isc/include/isc/result.h
+++ b/contrib/bind9/lib/isc/include/isc/result.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: result.h,v 1.71 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: result.h,v 1.71 2008-09-25 04:02:39 tbox Exp $ */
#ifndef ISC_RESULT_H
#define ISC_RESULT_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/resultclass.h b/contrib/bind9/lib/isc/include/isc/resultclass.h
index b32426f..86c55b6 100644
--- a/contrib/bind9/lib/isc/include/isc/resultclass.h
+++ b/contrib/bind9/lib/isc/include/isc/resultclass.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: resultclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: resultclass.h,v 1.18 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_RESULTCLASS_H
#define ISC_RESULTCLASS_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/rwlock.h b/contrib/bind9/lib/isc/include/isc/rwlock.h
index 28052cd..57cc16c 100644
--- a/contrib/bind9/lib/isc/include/isc/rwlock.h
+++ b/contrib/bind9/lib/isc/include/isc/rwlock.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rwlock.h,v 1.28 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: rwlock.h,v 1.28 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_RWLOCK_H
#define ISC_RWLOCK_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/serial.h b/contrib/bind9/lib/isc/include/isc/serial.h
index f7e3049..97d5fe1 100644
--- a/contrib/bind9/lib/isc/include/isc/serial.h
+++ b/contrib/bind9/lib/isc/include/isc/serial.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: serial.h,v 1.16.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: serial.h,v 1.16.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_SERIAL_H
#define ISC_SERIAL_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/sha1.h b/contrib/bind9/lib/isc/include/isc/sha1.h
index 63f12bb..4da682a 100644
--- a/contrib/bind9/lib/isc/include/isc/sha1.h
+++ b/contrib/bind9/lib/isc/include/isc/sha1.h
@@ -18,7 +18,7 @@
#ifndef ISC_SHA1_H
#define ISC_SHA1_H 1
-/* $Id: sha1.h,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: sha1.h,v 1.17 2007-06-19 23:47:18 tbox Exp $ */
/* $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */
diff --git a/contrib/bind9/lib/isc/include/isc/sha2.h b/contrib/bind9/lib/isc/include/isc/sha2.h
index edafa61..c3130a8 100644
--- a/contrib/bind9/lib/isc/include/isc/sha2.h
+++ b/contrib/bind9/lib/isc/include/isc/sha2.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sha2.h,v 1.9.332.2 2010/01/15 23:47:34 tbox Exp $ */
+/* $Id: sha2.h,v 1.9.332.2 2010-01-15 23:47:34 tbox Exp $ */
/* $FreeBSD$ */
/* $KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $ */
diff --git a/contrib/bind9/lib/isc/include/isc/sockaddr.h b/contrib/bind9/lib/isc/include/isc/sockaddr.h
index 62cc773..758cef7 100644
--- a/contrib/bind9/lib/isc/include/isc/sockaddr.h
+++ b/contrib/bind9/lib/isc/include/isc/sockaddr.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sockaddr.h,v 1.55.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: sockaddr.h,v 1.55.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_SOCKADDR_H
#define ISC_SOCKADDR_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/socket.h b/contrib/bind9/lib/isc/include/isc/socket.h
index 035c994..749ee52 100644
--- a/contrib/bind9/lib/isc/include/isc/socket.h
+++ b/contrib/bind9/lib/isc/include/isc/socket.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket.h,v 1.85.58.3 2009/01/29 22:40:35 jinmei Exp $ */
+/* $Id: socket.h,v 1.85.58.3 2009-01-29 22:40:35 jinmei Exp $ */
#ifndef ISC_SOCKET_H
#define ISC_SOCKET_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/stats.h b/contrib/bind9/lib/isc/include/isc/stats.h
index a6156d8..1148a16 100644
--- a/contrib/bind9/lib/isc/include/isc/stats.h
+++ b/contrib/bind9/lib/isc/include/isc/stats.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stats.h,v 1.4.2.2 2009/01/29 23:47:44 tbox Exp $ */
+/* $Id: stats.h,v 1.4.2.2 2009-01-29 23:47:44 tbox Exp $ */
#ifndef ISC_STATS_H
#define ISC_STATS_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/stdio.h b/contrib/bind9/lib/isc/include/isc/stdio.h
index 1a7ae64..6a1de5d 100644
--- a/contrib/bind9/lib/isc/include/isc/stdio.h
+++ b/contrib/bind9/lib/isc/include/isc/stdio.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stdio.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: stdio.h,v 1.13 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_STDIO_H
#define ISC_STDIO_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/stdlib.h b/contrib/bind9/lib/isc/include/isc/stdlib.h
index 02243f0..3198d48 100644
--- a/contrib/bind9/lib/isc/include/isc/stdlib.h
+++ b/contrib/bind9/lib/isc/include/isc/stdlib.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stdlib.h,v 1.8 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: stdlib.h,v 1.8 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_STDLIB_H
#define ISC_STDLIB_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/string.h b/contrib/bind9/lib/isc/include/isc/string.h
index b49fdbc..e8c6834 100644
--- a/contrib/bind9/lib/isc/include/isc/string.h
+++ b/contrib/bind9/lib/isc/include/isc/string.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: string.h,v 1.23 2007/09/13 04:48:16 each Exp $ */
+/* $Id: string.h,v 1.23 2007-09-13 04:48:16 each Exp $ */
#ifndef ISC_STRING_H
#define ISC_STRING_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/symtab.h b/contrib/bind9/lib/isc/include/isc/symtab.h
index 396d645..a1d7102 100644
--- a/contrib/bind9/lib/isc/include/isc/symtab.h
+++ b/contrib/bind9/lib/isc/include/isc/symtab.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: symtab.h,v 1.24.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: symtab.h,v 1.24.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISC_SYMTAB_H
#define ISC_SYMTAB_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/taskpool.h b/contrib/bind9/lib/isc/include/isc/taskpool.h
index fd07bfd..07aba70 100644
--- a/contrib/bind9/lib/isc/include/isc/taskpool.h
+++ b/contrib/bind9/lib/isc/include/isc/taskpool.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: taskpool.h,v 1.15 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: taskpool.h,v 1.15 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_TASKPOOL_H
#define ISC_TASKPOOL_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/timer.h b/contrib/bind9/lib/isc/include/isc/timer.h
index a4b2df7..052e25b 100644
--- a/contrib/bind9/lib/isc/include/isc/timer.h
+++ b/contrib/bind9/lib/isc/include/isc/timer.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: timer.h,v 1.40 2008/06/23 23:47:11 tbox Exp $ */
+/* $Id: timer.h,v 1.40 2008-06-23 23:47:11 tbox Exp $ */
#ifndef ISC_TIMER_H
#define ISC_TIMER_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/types.h b/contrib/bind9/lib/isc/include/isc/types.h
index 4dccbf9..01362b8 100644
--- a/contrib/bind9/lib/isc/include/isc/types.h
+++ b/contrib/bind9/lib/isc/include/isc/types.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: types.h,v 1.46.84.2 2009/01/29 23:47:44 tbox Exp $ */
+/* $Id: types.h,v 1.46.84.2 2009-01-29 23:47:44 tbox Exp $ */
#ifndef ISC_TYPES_H
#define ISC_TYPES_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/util.h b/contrib/bind9/lib/isc/include/isc/util.h
index 85846b6..8ccad8d 100644
--- a/contrib/bind9/lib/isc/include/isc/util.h
+++ b/contrib/bind9/lib/isc/include/isc/util.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: util.h,v 1.30.332.2 2010/01/11 23:47:22 tbox Exp $ */
+/* $Id: util.h,v 1.30.332.2 2010-01-11 23:47:22 tbox Exp $ */
#ifndef ISC_UTIL_H
#define ISC_UTIL_H 1
diff --git a/contrib/bind9/lib/isc/include/isc/version.h b/contrib/bind9/lib/isc/include/isc/version.h
index ec00bde..1be37b6 100644
--- a/contrib/bind9/lib/isc/include/isc/version.h
+++ b/contrib/bind9/lib/isc/include/isc/version.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.h,v 1.9 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: version.h,v 1.9 2007-06-19 23:47:18 tbox Exp $ */
/*! \file isc/version.h */
diff --git a/contrib/bind9/lib/isc/include/isc/xml.h b/contrib/bind9/lib/isc/include/isc/xml.h
index d31a31a..afbfa2b 100644
--- a/contrib/bind9/lib/isc/include/isc/xml.h
+++ b/contrib/bind9/lib/isc/include/isc/xml.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: xml.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: xml.h,v 1.4 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_XML_H
#define ISC_XML_H 1
diff --git a/contrib/bind9/lib/isc/inet_aton.c b/contrib/bind9/lib/isc/inet_aton.c
index ad9401f..3c25ca3 100644
--- a/contrib/bind9/lib/isc/inet_aton.c
+++ b/contrib/bind9/lib/isc/inet_aton.c
@@ -71,7 +71,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static char rcsid[] = "$Id: inet_aton.c,v 1.21.332.2 2009/03/05 23:47:03 tbox Exp $";
+static char rcsid[] = "$Id: inet_aton.c,v 1.21.332.2 2009-03-05 23:47:03 tbox Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/inet_ntop.c b/contrib/bind9/lib/isc/inet_ntop.c
index c37be5c..22930f3 100644
--- a/contrib/bind9/lib/isc/inet_ntop.c
+++ b/contrib/bind9/lib/isc/inet_ntop.c
@@ -19,7 +19,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] =
- "$Id: inet_ntop.c,v 1.19.332.2 2009/07/18 23:47:25 tbox Exp $";
+ "$Id: inet_ntop.c,v 1.19.332.2 2009-07-18 23:47:25 tbox Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/inet_pton.c b/contrib/bind9/lib/isc/inet_pton.c
index 6bada23..65901ba 100644
--- a/contrib/bind9/lib/isc/inet_pton.c
+++ b/contrib/bind9/lib/isc/inet_pton.c
@@ -19,7 +19,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] =
- "$Id: inet_pton.c,v 1.19 2007/06/19 23:47:17 tbox Exp $";
+ "$Id: inet_pton.c,v 1.19 2007-06-19 23:47:17 tbox Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/iterated_hash.c b/contrib/bind9/lib/isc/iterated_hash.c
index 1674314..ebc5076 100644
--- a/contrib/bind9/lib/isc/iterated_hash.c
+++ b/contrib/bind9/lib/isc/iterated_hash.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: iterated_hash.c,v 1.4.48.2 2009/02/18 23:47:12 tbox Exp $ */
+/* $Id: iterated_hash.c,v 1.4.48.2 2009-02-18 23:47:12 tbox Exp $ */
#include "config.h"
diff --git a/contrib/bind9/lib/isc/lex.c b/contrib/bind9/lib/isc/lex.c
index 8749ed0..41db5fe 100644
--- a/contrib/bind9/lib/isc/lex.c
+++ b/contrib/bind9/lib/isc/lex.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lex.c,v 1.86 2007/09/17 09:56:29 shane Exp $ */
+/* $Id: lex.c,v 1.86 2007-09-17 09:56:29 shane Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/lfsr.c b/contrib/bind9/lib/isc/lfsr.c
index 0b8d782..7c56634 100644
--- a/contrib/bind9/lib/isc/lfsr.c
+++ b/contrib/bind9/lib/isc/lfsr.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lfsr.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: lfsr.c,v 1.20 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/lib.c b/contrib/bind9/lib/isc/lib.c
index f3a2c2d..99b0178 100644
--- a/contrib/bind9/lib/isc/lib.c
+++ b/contrib/bind9/lib/isc/lib.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lib.c,v 1.14 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: lib.c,v 1.14 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/log.c b/contrib/bind9/lib/isc/log.c
index e19c9ba..121bd25 100644
--- a/contrib/bind9/lib/isc/log.c
+++ b/contrib/bind9/lib/isc/log.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.c,v 1.94.332.5 2009/02/16 02:04:05 marka Exp $ */
+/* $Id: log.c,v 1.94.332.5 2009-02-16 02:04:05 marka Exp $ */
/*! \file
* \author Principal Authors: DCL */
diff --git a/contrib/bind9/lib/isc/md5.c b/contrib/bind9/lib/isc/md5.c
index 5004c3e..b9ec42c 100644
--- a/contrib/bind9/lib/isc/md5.c
+++ b/contrib/bind9/lib/isc/md5.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: md5.c,v 1.14 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: md5.c,v 1.14 2007-06-19 23:47:17 tbox Exp $ */
/*! \file
* This code implements the MD5 message-digest algorithm.
diff --git a/contrib/bind9/lib/isc/mips/Makefile.in b/contrib/bind9/lib/isc/mips/Makefile.in
index 324db07..701fb84 100644
--- a/contrib/bind9/lib/isc/mips/Makefile.in
+++ b/contrib/bind9/lib/isc/mips/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/mips/include/Makefile.in b/contrib/bind9/lib/isc/mips/include/Makefile.in
index f1d8bdd..8c5dd3a 100644
--- a/contrib/bind9/lib/isc/mips/include/Makefile.in
+++ b/contrib/bind9/lib/isc/mips/include/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/mips/include/isc/Makefile.in b/contrib/bind9/lib/isc/mips/include/isc/Makefile.in
index 5f116ca..43829a1 100644
--- a/contrib/bind9/lib/isc/mips/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/mips/include/isc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/mips/include/isc/atomic.h b/contrib/bind9/lib/isc/mips/include/isc/atomic.h
index bb739f7..1c2f23d 100644
--- a/contrib/bind9/lib/isc/mips/include/isc/atomic.h
+++ b/contrib/bind9/lib/isc/mips/include/isc/atomic.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: atomic.h,v 1.3 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: atomic.h,v 1.3 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_ATOMIC_H
#define ISC_ATOMIC_H 1
diff --git a/contrib/bind9/lib/isc/mutexblock.c b/contrib/bind9/lib/isc/mutexblock.c
index d45ad0e..38f423a 100644
--- a/contrib/bind9/lib/isc/mutexblock.c
+++ b/contrib/bind9/lib/isc/mutexblock.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutexblock.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: mutexblock.c,v 1.20 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/netaddr.c b/contrib/bind9/lib/isc/netaddr.c
index 85dd53e..92c4fe5 100644
--- a/contrib/bind9/lib/isc/netaddr.c
+++ b/contrib/bind9/lib/isc/netaddr.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: netaddr.c,v 1.38 2007/06/18 23:47:44 tbox Exp $ */
+/* $Id: netaddr.c,v 1.38 2007-06-18 23:47:44 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/netscope.c b/contrib/bind9/lib/isc/netscope.c
index 9aa11db..c34b8d3 100644
--- a/contrib/bind9/lib/isc/netscope.c
+++ b/contrib/bind9/lib/isc/netscope.c
@@ -19,7 +19,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] =
- "$Id: netscope.c,v 1.13 2007/06/19 23:47:17 tbox Exp $";
+ "$Id: netscope.c,v 1.13 2007-06-19 23:47:17 tbox Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/nls/Makefile.in b/contrib/bind9/lib/isc/nls/Makefile.in
index 695c313..c4ec7a1 100644
--- a/contrib/bind9/lib/isc/nls/Makefile.in
+++ b/contrib/bind9/lib/isc/nls/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.14 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.14 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/nls/msgcat.c b/contrib/bind9/lib/isc/nls/msgcat.c
index 3d6b676..e9bb9e1 100644
--- a/contrib/bind9/lib/isc/nls/msgcat.c
+++ b/contrib/bind9/lib/isc/nls/msgcat.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: msgcat.c,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: msgcat.c,v 1.18 2007-06-19 23:47:18 tbox Exp $ */
/*! \file msgcat.c
*
diff --git a/contrib/bind9/lib/isc/noatomic/Makefile.in b/contrib/bind9/lib/isc/noatomic/Makefile.in
index 324db07..701fb84 100644
--- a/contrib/bind9/lib/isc/noatomic/Makefile.in
+++ b/contrib/bind9/lib/isc/noatomic/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/noatomic/include/Makefile.in b/contrib/bind9/lib/isc/noatomic/include/Makefile.in
index f1d8bdd..8c5dd3a 100644
--- a/contrib/bind9/lib/isc/noatomic/include/Makefile.in
+++ b/contrib/bind9/lib/isc/noatomic/include/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in b/contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in
index 5f116ca..43829a1 100644
--- a/contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/noatomic/include/isc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/noatomic/include/isc/atomic.h b/contrib/bind9/lib/isc/noatomic/include/isc/atomic.h
index 942ba03..453952e 100644
--- a/contrib/bind9/lib/isc/noatomic/include/isc/atomic.h
+++ b/contrib/bind9/lib/isc/noatomic/include/isc/atomic.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: atomic.h,v 1.4 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: atomic.h,v 1.4 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_ATOMIC_H
#define ISC_ATOMIC_H 1
diff --git a/contrib/bind9/lib/isc/nothreads/condition.c b/contrib/bind9/lib/isc/nothreads/condition.c
index 9be8f83..86ca487 100644
--- a/contrib/bind9/lib/isc/nothreads/condition.c
+++ b/contrib/bind9/lib/isc/nothreads/condition.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: condition.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: condition.c,v 1.10 2007-06-19 23:47:18 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/nothreads/include/Makefile.in b/contrib/bind9/lib/isc/nothreads/include/Makefile.in
index a52310a..4535607 100644
--- a/contrib/bind9/lib/isc/nothreads/include/Makefile.in
+++ b/contrib/bind9/lib/isc/nothreads/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.5 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.5 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in b/contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in
index 3c9eab0..536372f 100644
--- a/contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/nothreads/include/isc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.7 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.7 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/nothreads/include/isc/condition.h b/contrib/bind9/lib/isc/nothreads/include/isc/condition.h
index b269f82..9fef02a 100644
--- a/contrib/bind9/lib/isc/nothreads/include/isc/condition.h
+++ b/contrib/bind9/lib/isc/nothreads/include/isc/condition.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: condition.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: condition.h,v 1.6 2007-06-19 23:47:18 tbox Exp $ */
/*
* This provides a limited subset of the isc_condition_t
diff --git a/contrib/bind9/lib/isc/nothreads/include/isc/mutex.h b/contrib/bind9/lib/isc/nothreads/include/isc/mutex.h
index 1f2187b..7355f43 100644
--- a/contrib/bind9/lib/isc/nothreads/include/isc/mutex.h
+++ b/contrib/bind9/lib/isc/nothreads/include/isc/mutex.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutex.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: mutex.h,v 1.6 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_MUTEX_H
#define ISC_MUTEX_H 1
diff --git a/contrib/bind9/lib/isc/nothreads/include/isc/once.h b/contrib/bind9/lib/isc/nothreads/include/isc/once.h
index ab705a4..21319d1 100644
--- a/contrib/bind9/lib/isc/nothreads/include/isc/once.h
+++ b/contrib/bind9/lib/isc/nothreads/include/isc/once.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: once.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: once.h,v 1.6 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_ONCE_H
#define ISC_ONCE_H 1
diff --git a/contrib/bind9/lib/isc/nothreads/include/isc/thread.h b/contrib/bind9/lib/isc/nothreads/include/isc/thread.h
index 313bc5f..5746c99 100644
--- a/contrib/bind9/lib/isc/nothreads/include/isc/thread.h
+++ b/contrib/bind9/lib/isc/nothreads/include/isc/thread.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: thread.h,v 1.6 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: thread.h,v 1.6 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_THREAD_H
#define ISC_THREAD_H 1
diff --git a/contrib/bind9/lib/isc/nothreads/mutex.c b/contrib/bind9/lib/isc/nothreads/mutex.c
index 50ba0f4..fb6a1db 100644
--- a/contrib/bind9/lib/isc/nothreads/mutex.c
+++ b/contrib/bind9/lib/isc/nothreads/mutex.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutex.c,v 1.10 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: mutex.c,v 1.10 2007-06-19 23:47:18 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/nothreads/thread.c b/contrib/bind9/lib/isc/nothreads/thread.c
index 9075e25..3e61b49 100644
--- a/contrib/bind9/lib/isc/nothreads/thread.c
+++ b/contrib/bind9/lib/isc/nothreads/thread.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: thread.c,v 1.5 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: thread.c,v 1.5 2007-06-19 23:47:18 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/ondestroy.c b/contrib/bind9/lib/isc/ondestroy.c
index 32a75e1..0326557 100644
--- a/contrib/bind9/lib/isc/ondestroy.c
+++ b/contrib/bind9/lib/isc/ondestroy.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ondestroy.c,v 1.16 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ondestroy.c,v 1.16 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/parseint.c b/contrib/bind9/lib/isc/parseint.c
index 266d44c..a7fe84f 100644
--- a/contrib/bind9/lib/isc/parseint.c
+++ b/contrib/bind9/lib/isc/parseint.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: parseint.c,v 1.8 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: parseint.c,v 1.8 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/portset.c b/contrib/bind9/lib/isc/portset.c
index 471ca8e..07fb0cb 100644
--- a/contrib/bind9/lib/isc/portset.c
+++ b/contrib/bind9/lib/isc/portset.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: portset.c,v 1.4 2008/06/24 23:24:35 marka Exp $ */
+/* $Id: portset.c,v 1.4 2008-06-24 23:24:35 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/powerpc/Makefile.in b/contrib/bind9/lib/isc/powerpc/Makefile.in
index 324db07..701fb84 100644
--- a/contrib/bind9/lib/isc/powerpc/Makefile.in
+++ b/contrib/bind9/lib/isc/powerpc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/powerpc/include/Makefile.in b/contrib/bind9/lib/isc/powerpc/include/Makefile.in
index f1d8bdd..8c5dd3a 100644
--- a/contrib/bind9/lib/isc/powerpc/include/Makefile.in
+++ b/contrib/bind9/lib/isc/powerpc/include/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in b/contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in
index 5f116ca..43829a1 100644
--- a/contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/powerpc/include/isc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/powerpc/include/isc/atomic.h b/contrib/bind9/lib/isc/powerpc/include/isc/atomic.h
index 2114767..074fea1 100644
--- a/contrib/bind9/lib/isc/powerpc/include/isc/atomic.h
+++ b/contrib/bind9/lib/isc/powerpc/include/isc/atomic.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: atomic.h,v 1.6.332.2 2009/10/14 23:47:14 tbox Exp $ */
+/* $Id: atomic.h,v 1.6.332.2 2009-10-14 23:47:14 tbox Exp $ */
#ifndef ISC_ATOMIC_H
#define ISC_ATOMIC_H 1
diff --git a/contrib/bind9/lib/isc/pthreads/Makefile.in b/contrib/bind9/lib/isc/pthreads/Makefile.in
index a287457..572d76c 100644
--- a/contrib/bind9/lib/isc/pthreads/Makefile.in
+++ b/contrib/bind9/lib/isc/pthreads/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.19 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.19 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/pthreads/condition.c b/contrib/bind9/lib/isc/pthreads/condition.c
index 50281a2..f19ab6d 100644
--- a/contrib/bind9/lib/isc/pthreads/condition.c
+++ b/contrib/bind9/lib/isc/pthreads/condition.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: condition.c,v 1.36 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: condition.c,v 1.36 2007-06-19 23:47:18 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/pthreads/include/Makefile.in b/contrib/bind9/lib/isc/pthreads/include/Makefile.in
index 0303ab1..8c03aef 100644
--- a/contrib/bind9/lib/isc/pthreads/include/Makefile.in
+++ b/contrib/bind9/lib/isc/pthreads/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.14 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.14 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in b/contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in
index 11675ec..f14dbd6 100644
--- a/contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/pthreads/include/isc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.16 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.16 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/pthreads/include/isc/condition.h b/contrib/bind9/lib/isc/pthreads/include/isc/condition.h
index 04a6118..b216657 100644
--- a/contrib/bind9/lib/isc/pthreads/include/isc/condition.h
+++ b/contrib/bind9/lib/isc/pthreads/include/isc/condition.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: condition.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: condition.h,v 1.26 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_CONDITION_H
#define ISC_CONDITION_H 1
diff --git a/contrib/bind9/lib/isc/pthreads/include/isc/mutex.h b/contrib/bind9/lib/isc/pthreads/include/isc/mutex.h
index dd7d326..71bb430 100644
--- a/contrib/bind9/lib/isc/pthreads/include/isc/mutex.h
+++ b/contrib/bind9/lib/isc/pthreads/include/isc/mutex.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: mutex.h,v 1.30 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: mutex.h,v 1.30 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_MUTEX_H
#define ISC_MUTEX_H 1
diff --git a/contrib/bind9/lib/isc/pthreads/include/isc/once.h b/contrib/bind9/lib/isc/pthreads/include/isc/once.h
index 31d76fb..dd580f1 100644
--- a/contrib/bind9/lib/isc/pthreads/include/isc/once.h
+++ b/contrib/bind9/lib/isc/pthreads/include/isc/once.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: once.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: once.h,v 1.13 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_ONCE_H
#define ISC_ONCE_H 1
diff --git a/contrib/bind9/lib/isc/pthreads/include/isc/thread.h b/contrib/bind9/lib/isc/pthreads/include/isc/thread.h
index 7dcc952..390ca73 100644
--- a/contrib/bind9/lib/isc/pthreads/include/isc/thread.h
+++ b/contrib/bind9/lib/isc/pthreads/include/isc/thread.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: thread.h,v 1.26 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: thread.h,v 1.26 2007-06-19 23:47:18 tbox Exp $ */
#ifndef ISC_THREAD_H
#define ISC_THREAD_H 1
diff --git a/contrib/bind9/lib/isc/pthreads/thread.c b/contrib/bind9/lib/isc/pthreads/thread.c
index 4b5b491..663ca8c 100644
--- a/contrib/bind9/lib/isc/pthreads/thread.c
+++ b/contrib/bind9/lib/isc/pthreads/thread.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: thread.c,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: thread.c,v 1.17 2007-06-19 23:47:18 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/quota.c b/contrib/bind9/lib/isc/quota.c
index 5e5c50c..f977fb5 100644
--- a/contrib/bind9/lib/isc/quota.c
+++ b/contrib/bind9/lib/isc/quota.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: quota.c,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: quota.c,v 1.18 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/radix.c b/contrib/bind9/lib/isc/radix.c
index 7786984..d72ed33 100644
--- a/contrib/bind9/lib/isc/radix.c
+++ b/contrib/bind9/lib/isc/radix.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: radix.c,v 1.20.36.3 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: radix.c,v 1.20.36.3 2009-01-18 23:47:41 tbox Exp $ */
/*
* This source was adapted from MRT's RCS Ids:
diff --git a/contrib/bind9/lib/isc/random.c b/contrib/bind9/lib/isc/random.c
index 84ba6a0..09145f4 100644
--- a/contrib/bind9/lib/isc/random.c
+++ b/contrib/bind9/lib/isc/random.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: random.c,v 1.25.332.2 2009/07/16 23:47:17 tbox Exp $ */
+/* $Id: random.c,v 1.25.332.2 2009-07-16 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/ratelimiter.c b/contrib/bind9/lib/isc/ratelimiter.c
index 07bcc7c..2bd3c9c 100644
--- a/contrib/bind9/lib/isc/ratelimiter.c
+++ b/contrib/bind9/lib/isc/ratelimiter.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ratelimiter.c,v 1.25 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: ratelimiter.c,v 1.25 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/refcount.c b/contrib/bind9/lib/isc/refcount.c
index 36dfff2..3bef1be 100644
--- a/contrib/bind9/lib/isc/refcount.c
+++ b/contrib/bind9/lib/isc/refcount.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: refcount.c,v 1.5 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: refcount.c,v 1.5 2007-06-19 23:47:17 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/region.c b/contrib/bind9/lib/isc/region.c
index cf64979..72973be 100644
--- a/contrib/bind9/lib/isc/region.c
+++ b/contrib/bind9/lib/isc/region.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: region.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: region.c,v 1.7 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/result.c b/contrib/bind9/lib/isc/result.c
index 5713580..fcb5295 100644
--- a/contrib/bind9/lib/isc/result.c
+++ b/contrib/bind9/lib/isc/result.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: result.c,v 1.71 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: result.c,v 1.71 2008-09-25 04:02:39 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/rwlock.c b/contrib/bind9/lib/isc/rwlock.c
index ca8e83d..39b90d7 100644
--- a/contrib/bind9/lib/isc/rwlock.c
+++ b/contrib/bind9/lib/isc/rwlock.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rwlock.c,v 1.44.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: rwlock.c,v 1.44.332.2 2009-01-18 23:47:41 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/serial.c b/contrib/bind9/lib/isc/serial.c
index b43aac7..0126d02 100644
--- a/contrib/bind9/lib/isc/serial.c
+++ b/contrib/bind9/lib/isc/serial.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: serial.c,v 1.12 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: serial.c,v 1.12 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/sha1.c b/contrib/bind9/lib/isc/sha1.c
index 3575288..20ee28d 100644
--- a/contrib/bind9/lib/isc/sha1.c
+++ b/contrib/bind9/lib/isc/sha1.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sha1.c,v 1.18 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: sha1.c,v 1.18 2007-06-19 23:47:17 tbox Exp $ */
/* $NetBSD: sha1.c,v 1.5 2000/01/22 22:19:14 mycroft Exp $ */
/* $OpenBSD: sha1.c,v 1.9 1997/07/23 21:12:32 kstailey Exp $ */
diff --git a/contrib/bind9/lib/isc/sha2.c b/contrib/bind9/lib/isc/sha2.c
index ff19274..22f1d47 100644
--- a/contrib/bind9/lib/isc/sha2.c
+++ b/contrib/bind9/lib/isc/sha2.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sha2.c,v 1.13.332.4 2010/01/15 23:47:34 tbox Exp $ */
+/* $Id: sha2.c,v 1.13.332.4 2010-01-15 23:47:34 tbox Exp $ */
/* $FreeBSD$ */
/* $KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $ */
diff --git a/contrib/bind9/lib/isc/sockaddr.c b/contrib/bind9/lib/isc/sockaddr.c
index 62975df..19833e4 100644
--- a/contrib/bind9/lib/isc/sockaddr.c
+++ b/contrib/bind9/lib/isc/sockaddr.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sockaddr.c,v 1.70 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: sockaddr.c,v 1.70 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/sparc64/Makefile.in b/contrib/bind9/lib/isc/sparc64/Makefile.in
index 324db07..701fb84 100644
--- a/contrib/bind9/lib/isc/sparc64/Makefile.in
+++ b/contrib/bind9/lib/isc/sparc64/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/sparc64/include/Makefile.in b/contrib/bind9/lib/isc/sparc64/include/Makefile.in
index f1d8bdd..8c5dd3a 100644
--- a/contrib/bind9/lib/isc/sparc64/include/Makefile.in
+++ b/contrib/bind9/lib/isc/sparc64/include/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in b/contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in
index 5f116ca..43829a1 100644
--- a/contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/sparc64/include/isc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/sparc64/include/isc/atomic.h b/contrib/bind9/lib/isc/sparc64/include/isc/atomic.h
index b920095..9ee3c0b 100644
--- a/contrib/bind9/lib/isc/sparc64/include/isc/atomic.h
+++ b/contrib/bind9/lib/isc/sparc64/include/isc/atomic.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: atomic.h,v 1.5 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: atomic.h,v 1.5 2007-06-19 23:47:18 tbox Exp $ */
/*
* This code was written based on FreeBSD's kernel source whose copyright
diff --git a/contrib/bind9/lib/isc/stats.c b/contrib/bind9/lib/isc/stats.c
index 9e4e089..ac66bcf 100644
--- a/contrib/bind9/lib/isc/stats.c
+++ b/contrib/bind9/lib/isc/stats.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stats.c,v 1.3.6.2 2009/01/29 23:47:44 tbox Exp $ */
+/* $Id: stats.c,v 1.3.6.2 2009-01-29 23:47:44 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/string.c b/contrib/bind9/lib/isc/string.c
index b9c43e7..3bcea3a 100644
--- a/contrib/bind9/lib/isc/string.c
+++ b/contrib/bind9/lib/isc/string.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: string.c,v 1.20 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: string.c,v 1.20 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/strtoul.c b/contrib/bind9/lib/isc/strtoul.c
index 18d93e2..31a0dde 100644
--- a/contrib/bind9/lib/isc/strtoul.c
+++ b/contrib/bind9/lib/isc/strtoul.c
@@ -53,7 +53,7 @@
static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
-/* $Id: strtoul.c,v 1.7 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: strtoul.c,v 1.7 2007-06-19 23:47:17 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/symtab.c b/contrib/bind9/lib/isc/symtab.c
index 9f8e798..c30054f 100644
--- a/contrib/bind9/lib/isc/symtab.c
+++ b/contrib/bind9/lib/isc/symtab.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: symtab.c,v 1.30 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: symtab.c,v 1.30 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/task_p.h b/contrib/bind9/lib/isc/task_p.h
index c888103..7bf208a 100644
--- a/contrib/bind9/lib/isc/task_p.h
+++ b/contrib/bind9/lib/isc/task_p.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: task_p.h,v 1.11 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: task_p.h,v 1.11 2007-06-19 23:47:17 tbox Exp $ */
#ifndef ISC_TASK_P_H
#define ISC_TASK_P_H
diff --git a/contrib/bind9/lib/isc/taskpool.c b/contrib/bind9/lib/isc/taskpool.c
index d9c2fbe..8efbf28 100644
--- a/contrib/bind9/lib/isc/taskpool.c
+++ b/contrib/bind9/lib/isc/taskpool.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: taskpool.c,v 1.18 2007/06/18 23:47:44 tbox Exp $ */
+/* $Id: taskpool.c,v 1.18 2007-06-18 23:47:44 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/timer.c b/contrib/bind9/lib/isc/timer.c
index 21fcd69..6342688 100644
--- a/contrib/bind9/lib/isc/timer.c
+++ b/contrib/bind9/lib/isc/timer.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: timer.c,v 1.84.58.4 2009/01/23 23:47:21 tbox Exp $ */
+/* $Id: timer.c,v 1.84.58.4 2009-01-23 23:47:21 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/timer_p.h b/contrib/bind9/lib/isc/timer_p.h
index ec8e2e0..b41f922 100644
--- a/contrib/bind9/lib/isc/timer_p.h
+++ b/contrib/bind9/lib/isc/timer_p.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: timer_p.h,v 1.10 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: timer_p.h,v 1.10 2007-06-19 23:47:17 tbox Exp $ */
#ifndef ISC_TIMER_P_H
#define ISC_TIMER_P_H
diff --git a/contrib/bind9/lib/isc/unix/Makefile.in b/contrib/bind9/lib/isc/unix/Makefile.in
index 7d19b5c..7d23b96 100644
--- a/contrib/bind9/lib/isc/unix/Makefile.in
+++ b/contrib/bind9/lib/isc/unix/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.41 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.41 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/unix/app.c b/contrib/bind9/lib/isc/unix/app.c
index 660b438..6bd1660 100644
--- a/contrib/bind9/lib/isc/unix/app.c
+++ b/contrib/bind9/lib/isc/unix/app.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: app.c,v 1.60 2008/10/15 03:41:17 marka Exp $ */
+/* $Id: app.c,v 1.60 2008-10-15 03:41:17 marka Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/unix/dir.c b/contrib/bind9/lib/isc/unix/dir.c
index 9244147..8053c42 100644
--- a/contrib/bind9/lib/isc/unix/dir.c
+++ b/contrib/bind9/lib/isc/unix/dir.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dir.c,v 1.25.332.3 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: dir.c,v 1.25.332.3 2009-02-16 23:47:15 tbox Exp $ */
/*! \file
* \author Principal Authors: DCL */
diff --git a/contrib/bind9/lib/isc/unix/entropy.c b/contrib/bind9/lib/isc/unix/entropy.c
index 0e9e297..bdff8d9 100644
--- a/contrib/bind9/lib/isc/unix/entropy.c
+++ b/contrib/bind9/lib/isc/unix/entropy.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: entropy.c,v 1.80.332.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: entropy.c,v 1.80.332.2 2009-02-16 23:47:15 tbox Exp $ */
/* \file unix/entropy.c
* \brief
diff --git a/contrib/bind9/lib/isc/unix/errno2result.c b/contrib/bind9/lib/isc/unix/errno2result.c
index 606c560..4252de6 100644
--- a/contrib/bind9/lib/isc/unix/errno2result.c
+++ b/contrib/bind9/lib/isc/unix/errno2result.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: errno2result.c,v 1.17 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: errno2result.c,v 1.17 2007-06-19 23:47:18 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/unix/errno2result.h b/contrib/bind9/lib/isc/unix/errno2result.h
index b5b658d..8770a05 100644
--- a/contrib/bind9/lib/isc/unix/errno2result.h
+++ b/contrib/bind9/lib/isc/unix/errno2result.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: errno2result.h,v 1.12 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: errno2result.h,v 1.12 2007-06-19 23:47:18 tbox Exp $ */
#ifndef UNIX_ERRNO2RESULT_H
#define UNIX_ERRNO2RESULT_H 1
diff --git a/contrib/bind9/lib/isc/unix/file.c b/contrib/bind9/lib/isc/unix/file.c
index 748aee8..ae737b8 100644
--- a/contrib/bind9/lib/isc/unix/file.c
+++ b/contrib/bind9/lib/isc/unix/file.c
@@ -48,7 +48,7 @@
* SUCH DAMAGE.
*/
-/* $Id: file.c,v 1.51.332.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: file.c,v 1.51.332.2 2009-02-16 23:47:15 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/unix/fsaccess.c b/contrib/bind9/lib/isc/unix/fsaccess.c
index a2bd89a..c974819 100644
--- a/contrib/bind9/lib/isc/unix/fsaccess.c
+++ b/contrib/bind9/lib/isc/unix/fsaccess.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: fsaccess.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: fsaccess.c,v 1.13 2007-06-19 23:47:18 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/unix/ifiter_getifaddrs.c b/contrib/bind9/lib/isc/unix/ifiter_getifaddrs.c
index 87ef9ba..1e9c814 100644
--- a/contrib/bind9/lib/isc/unix/ifiter_getifaddrs.c
+++ b/contrib/bind9/lib/isc/unix/ifiter_getifaddrs.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ifiter_getifaddrs.c,v 1.11.120.2 2009/09/24 23:47:34 tbox Exp $ */
+/* $Id: ifiter_getifaddrs.c,v 1.11.120.2 2009-09-24 23:47:34 tbox Exp $ */
/*! \file
* \brief
diff --git a/contrib/bind9/lib/isc/unix/ifiter_ioctl.c b/contrib/bind9/lib/isc/unix/ifiter_ioctl.c
index a9d29bc..c004f61 100644
--- a/contrib/bind9/lib/isc/unix/ifiter_ioctl.c
+++ b/contrib/bind9/lib/isc/unix/ifiter_ioctl.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ifiter_ioctl.c,v 1.60.120.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: ifiter_ioctl.c,v 1.60.120.2 2009-01-18 23:47:41 tbox Exp $ */
/*! \file
* \brief
diff --git a/contrib/bind9/lib/isc/unix/ifiter_sysctl.c b/contrib/bind9/lib/isc/unix/ifiter_sysctl.c
index 9d5bf6d..bb30b6a 100644
--- a/contrib/bind9/lib/isc/unix/ifiter_sysctl.c
+++ b/contrib/bind9/lib/isc/unix/ifiter_sysctl.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ifiter_sysctl.c,v 1.25 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: ifiter_sysctl.c,v 1.25 2007-06-19 23:47:18 tbox Exp $ */
/*! \file
* \brief
diff --git a/contrib/bind9/lib/isc/unix/include/Makefile.in b/contrib/bind9/lib/isc/unix/include/Makefile.in
index 0303ab1..8c03aef 100644
--- a/contrib/bind9/lib/isc/unix/include/Makefile.in
+++ b/contrib/bind9/lib/isc/unix/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.14 2007/06/19 23:47:18 tbox Exp $
+# $Id: Makefile.in,v 1.14 2007-06-19 23:47:18 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/unix/include/isc/Makefile.in b/contrib/bind9/lib/isc/unix/include/isc/Makefile.in
index 2f4d216..5481b3b 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/unix/include/isc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.30 2007/06/19 23:47:19 tbox Exp $
+# $Id: Makefile.in,v 1.30 2007-06-19 23:47:19 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/unix/include/isc/dir.h b/contrib/bind9/lib/isc/unix/include/isc/dir.h
index e4a2ad0..a6e4440 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/dir.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/dir.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: dir.h,v 1.21 2007/06/19 23:47:19 tbox Exp $ */
+/* $Id: dir.h,v 1.21 2007-06-19 23:47:19 tbox Exp $ */
/* Principal Authors: DCL */
diff --git a/contrib/bind9/lib/isc/unix/include/isc/int.h b/contrib/bind9/lib/isc/unix/include/isc/int.h
index 73feb3b..177e68a 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/int.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/int.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: int.h,v 1.16 2007/06/19 23:47:19 tbox Exp $ */
+/* $Id: int.h,v 1.16 2007-06-19 23:47:19 tbox Exp $ */
#ifndef ISC_INT_H
#define ISC_INT_H 1
diff --git a/contrib/bind9/lib/isc/unix/include/isc/keyboard.h b/contrib/bind9/lib/isc/unix/include/isc/keyboard.h
index 43f5e7e..0f15b1a 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/keyboard.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/keyboard.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: keyboard.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */
+/* $Id: keyboard.h,v 1.11 2007-06-19 23:47:19 tbox Exp $ */
#ifndef ISC_KEYBOARD_H
#define ISC_KEYBOARD_H 1
diff --git a/contrib/bind9/lib/isc/unix/include/isc/net.h b/contrib/bind9/lib/isc/unix/include/isc/net.h
index 53bebd7..5fad793 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/net.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/net.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: net.h,v 1.48.84.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: net.h,v 1.48.84.2 2009-02-16 23:47:15 tbox Exp $ */
#ifndef ISC_NET_H
#define ISC_NET_H 1
diff --git a/contrib/bind9/lib/isc/unix/include/isc/netdb.h b/contrib/bind9/lib/isc/unix/include/isc/netdb.h
index ff12a26..d6703f1 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/netdb.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/netdb.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: netdb.h,v 1.11 2007/06/19 23:47:19 tbox Exp $ */
+/* $Id: netdb.h,v 1.11 2007-06-19 23:47:19 tbox Exp $ */
#ifndef ISC_NETDB_H
#define ISC_NETDB_H 1
diff --git a/contrib/bind9/lib/isc/unix/include/isc/offset.h b/contrib/bind9/lib/isc/unix/include/isc/offset.h
index 0e484be..91f43c37 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/offset.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/offset.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: offset.h,v 1.15.332.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: offset.h,v 1.15.332.2 2009-02-16 23:47:15 tbox Exp $ */
#ifndef ISC_OFFSET_H
#define ISC_OFFSET_H 1
diff --git a/contrib/bind9/lib/isc/unix/include/isc/stat.h b/contrib/bind9/lib/isc/unix/include/isc/stat.h
index b7a7986..4489002 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/stat.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/stat.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stat.h,v 1.5 2007/06/19 23:47:19 tbox Exp $ */
+/* $Id: stat.h,v 1.5 2007-06-19 23:47:19 tbox Exp $ */
#ifndef ISC_STAT_H
#define ISC_STAT_H 1
diff --git a/contrib/bind9/lib/isc/unix/include/isc/stdtime.h b/contrib/bind9/lib/isc/unix/include/isc/stdtime.h
index 4cb9e81..581e6f7 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/stdtime.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/stdtime.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stdtime.h,v 1.14 2007/06/19 23:47:19 tbox Exp $ */
+/* $Id: stdtime.h,v 1.14 2007-06-19 23:47:19 tbox Exp $ */
#ifndef ISC_STDTIME_H
#define ISC_STDTIME_H 1
diff --git a/contrib/bind9/lib/isc/unix/include/isc/strerror.h b/contrib/bind9/lib/isc/unix/include/isc/strerror.h
index 2953f71..e094e96 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/strerror.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/strerror.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: strerror.h,v 1.8.332.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: strerror.h,v 1.8.332.2 2009-02-16 23:47:15 tbox Exp $ */
#ifndef ISC_STRERROR_H
#define ISC_STRERROR_H
diff --git a/contrib/bind9/lib/isc/unix/include/isc/syslog.h b/contrib/bind9/lib/isc/unix/include/isc/syslog.h
index 7e0c88c..7ac714b 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/syslog.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/syslog.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: syslog.h,v 1.7 2007/06/19 23:47:19 tbox Exp $ */
+/* $Id: syslog.h,v 1.7 2007-06-19 23:47:19 tbox Exp $ */
#ifndef ISC_SYSLOG_H
#define ISC_SYSLOG_H 1
diff --git a/contrib/bind9/lib/isc/unix/include/isc/time.h b/contrib/bind9/lib/isc/unix/include/isc/time.h
index 45c4510..2149011 100644
--- a/contrib/bind9/lib/isc/unix/include/isc/time.h
+++ b/contrib/bind9/lib/isc/unix/include/isc/time.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: time.h,v 1.38.56.2 2009/01/05 23:47:23 tbox Exp $ */
+/* $Id: time.h,v 1.38.56.2 2009-01-05 23:47:23 tbox Exp $ */
#ifndef ISC_TIME_H
#define ISC_TIME_H 1
diff --git a/contrib/bind9/lib/isc/unix/interfaceiter.c b/contrib/bind9/lib/isc/unix/interfaceiter.c
index 4cfc821..2d60a33 100644
--- a/contrib/bind9/lib/isc/unix/interfaceiter.c
+++ b/contrib/bind9/lib/isc/unix/interfaceiter.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: interfaceiter.c,v 1.44.120.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: interfaceiter.c,v 1.44.120.2 2009-02-16 23:47:15 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/unix/ipv6.c b/contrib/bind9/lib/isc/unix/ipv6.c
index 61e984f..3fb1424 100644
--- a/contrib/bind9/lib/isc/unix/ipv6.c
+++ b/contrib/bind9/lib/isc/unix/ipv6.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ipv6.c,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: ipv6.c,v 1.14 2007-06-19 23:47:18 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/unix/keyboard.c b/contrib/bind9/lib/isc/unix/keyboard.c
index 8ee62d3..d022c03 100644
--- a/contrib/bind9/lib/isc/unix/keyboard.c
+++ b/contrib/bind9/lib/isc/unix/keyboard.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: keyboard.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: keyboard.c,v 1.13 2007-06-19 23:47:18 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/unix/net.c b/contrib/bind9/lib/isc/unix/net.c
index b2fb30e..11a06ce 100644
--- a/contrib/bind9/lib/isc/unix/net.c
+++ b/contrib/bind9/lib/isc/unix/net.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: net.c,v 1.40 2008/07/04 05:52:31 each Exp $ */
+/* $Id: net.c,v 1.40 2008-07-04 05:52:31 each Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/unix/os.c b/contrib/bind9/lib/isc/unix/os.c
index c050d14..1a3faf2 100644
--- a/contrib/bind9/lib/isc/unix/os.c
+++ b/contrib/bind9/lib/isc/unix/os.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: os.c,v 1.18 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: os.c,v 1.18 2007-06-19 23:47:18 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/unix/resource.c b/contrib/bind9/lib/isc/unix/resource.c
index 8bd8885..1061282 100644
--- a/contrib/bind9/lib/isc/unix/resource.c
+++ b/contrib/bind9/lib/isc/unix/resource.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: resource.c,v 1.21.66.2 2009/02/13 23:47:39 tbox Exp $ */
+/* $Id: resource.c,v 1.21.66.2 2009-02-13 23:47:39 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/unix/socket_p.h b/contrib/bind9/lib/isc/unix/socket_p.h
index fc044e5..b9a2347 100644
--- a/contrib/bind9/lib/isc/unix/socket_p.h
+++ b/contrib/bind9/lib/isc/unix/socket_p.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: socket_p.h,v 1.13 2008/06/23 23:47:11 tbox Exp $ */
+/* $Id: socket_p.h,v 1.13 2008-06-23 23:47:11 tbox Exp $ */
#ifndef ISC_SOCKET_P_H
#define ISC_SOCKET_P_H
diff --git a/contrib/bind9/lib/isc/unix/stdio.c b/contrib/bind9/lib/isc/unix/stdio.c
index 4e294db..ff3a527 100644
--- a/contrib/bind9/lib/isc/unix/stdio.c
+++ b/contrib/bind9/lib/isc/unix/stdio.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stdio.c,v 1.8 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: stdio.c,v 1.8 2007-06-19 23:47:18 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isc/unix/stdtime.c b/contrib/bind9/lib/isc/unix/stdtime.c
index c5d0c47..11b2533 100644
--- a/contrib/bind9/lib/isc/unix/stdtime.c
+++ b/contrib/bind9/lib/isc/unix/stdtime.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stdtime.c,v 1.19 2007/06/19 23:47:18 tbox Exp $ */
+/* $Id: stdtime.c,v 1.19 2007-06-19 23:47:18 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/unix/strerror.c b/contrib/bind9/lib/isc/unix/strerror.c
index 349c8bd..08ea52d 100644
--- a/contrib/bind9/lib/isc/unix/strerror.c
+++ b/contrib/bind9/lib/isc/unix/strerror.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: strerror.c,v 1.8.332.2 2009/02/16 23:47:15 tbox Exp $ */
+/* $Id: strerror.c,v 1.8.332.2 2009-02-16 23:47:15 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/unix/syslog.c b/contrib/bind9/lib/isc/unix/syslog.c
index 997508e..a752abd 100644
--- a/contrib/bind9/lib/isc/unix/syslog.c
+++ b/contrib/bind9/lib/isc/unix/syslog.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: syslog.c,v 1.8 2007/09/13 04:45:18 each Exp $ */
+/* $Id: syslog.c,v 1.8 2007-09-13 04:45:18 each Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/unix/time.c b/contrib/bind9/lib/isc/unix/time.c
index 59428d3..1dc05b8 100644
--- a/contrib/bind9/lib/isc/unix/time.c
+++ b/contrib/bind9/lib/isc/unix/time.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: time.c,v 1.56 2008/02/15 23:46:51 tbox Exp $ */
+/* $Id: time.c,v 1.56 2008-02-15 23:46:51 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/version.c b/contrib/bind9/lib/isc/version.c
index bfe4d6d..cde9bc6 100644
--- a/contrib/bind9/lib/isc/version.c
+++ b/contrib/bind9/lib/isc/version.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.c,v 1.15 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: version.c,v 1.15 2007-06-19 23:47:17 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isc/x86_32/Makefile.in b/contrib/bind9/lib/isc/x86_32/Makefile.in
index 324db07..701fb84 100644
--- a/contrib/bind9/lib/isc/x86_32/Makefile.in
+++ b/contrib/bind9/lib/isc/x86_32/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/x86_32/include/Makefile.in b/contrib/bind9/lib/isc/x86_32/include/Makefile.in
index f1d8bdd..8c5dd3a 100644
--- a/contrib/bind9/lib/isc/x86_32/include/Makefile.in
+++ b/contrib/bind9/lib/isc/x86_32/include/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in b/contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in
index 5f116ca..43829a1 100644
--- a/contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/x86_32/include/isc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/x86_32/include/isc/atomic.h b/contrib/bind9/lib/isc/x86_32/include/isc/atomic.h
index bf2148c..0e6a07e0 100644
--- a/contrib/bind9/lib/isc/x86_32/include/isc/atomic.h
+++ b/contrib/bind9/lib/isc/x86_32/include/isc/atomic.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: atomic.h,v 1.10 2008/01/24 23:47:00 tbox Exp $ */
+/* $Id: atomic.h,v 1.10 2008-01-24 23:47:00 tbox Exp $ */
#ifndef ISC_ATOMIC_H
#define ISC_ATOMIC_H 1
diff --git a/contrib/bind9/lib/isc/x86_64/Makefile.in b/contrib/bind9/lib/isc/x86_64/Makefile.in
index 324db07..701fb84 100644
--- a/contrib/bind9/lib/isc/x86_64/Makefile.in
+++ b/contrib/bind9/lib/isc/x86_64/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/x86_64/include/Makefile.in b/contrib/bind9/lib/isc/x86_64/include/Makefile.in
index f1d8bdd..8c5dd3a 100644
--- a/contrib/bind9/lib/isc/x86_64/include/Makefile.in
+++ b/contrib/bind9/lib/isc/x86_64/include/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:09:59 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:09:59 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in b/contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in
index f33ae99..6b7bc40 100644
--- a/contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in
+++ b/contrib/bind9/lib/isc/x86_64/include/isc/Makefile.in
@@ -12,7 +12,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.2 2007/09/14 04:10:00 marka Exp $
+# $Id: Makefile.in,v 1.2 2007-09-14 04:10:00 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isc/x86_64/include/isc/atomic.h b/contrib/bind9/lib/isc/x86_64/include/isc/atomic.h
index f57bd2a..a9d3e61 100644
--- a/contrib/bind9/lib/isc/x86_64/include/isc/atomic.h
+++ b/contrib/bind9/lib/isc/x86_64/include/isc/atomic.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: atomic.h,v 1.6 2008/01/24 23:47:00 tbox Exp $ */
+/* $Id: atomic.h,v 1.6 2008-01-24 23:47:00 tbox Exp $ */
#ifndef ISC_ATOMIC_H
#define ISC_ATOMIC_H 1
diff --git a/contrib/bind9/lib/isccc/Makefile.in b/contrib/bind9/lib/isccc/Makefile.in
index 5dcc225..fb08fcd 100644
--- a/contrib/bind9/lib/isccc/Makefile.in
+++ b/contrib/bind9/lib/isccc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.9 2007/06/19 23:47:21 tbox Exp $
+# $Id: Makefile.in,v 1.9 2007-06-19 23:47:21 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isccc/alist.c b/contrib/bind9/lib/isccc/alist.c
index 4f1743e..a4a912e 100644
--- a/contrib/bind9/lib/isccc/alist.c
+++ b/contrib/bind9/lib/isccc/alist.c
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: alist.c,v 1.8 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: alist.c,v 1.8 2007-08-28 07:20:43 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccc/base64.c b/contrib/bind9/lib/isccc/base64.c
index 78b34ed..6c1a7bf 100644
--- a/contrib/bind9/lib/isccc/base64.c
+++ b/contrib/bind9/lib/isccc/base64.c
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base64.c,v 1.8 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: base64.c,v 1.8 2007-08-28 07:20:43 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccc/cc.c b/contrib/bind9/lib/isccc/cc.c
index cfa1db6..9f5a60c 100644
--- a/contrib/bind9/lib/isccc/cc.c
+++ b/contrib/bind9/lib/isccc/cc.c
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cc.c,v 1.18 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: cc.c,v 1.18 2007-08-28 07:20:43 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccc/ccmsg.c b/contrib/bind9/lib/isccc/ccmsg.c
index 298fc22..c94d90f 100644
--- a/contrib/bind9/lib/isccc/ccmsg.c
+++ b/contrib/bind9/lib/isccc/ccmsg.c
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ccmsg.c,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: ccmsg.c,v 1.10 2007-08-28 07:20:43 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccc/include/Makefile.in b/contrib/bind9/lib/isccc/include/Makefile.in
index 9f727c3..240560f 100644
--- a/contrib/bind9/lib/isccc/include/Makefile.in
+++ b/contrib/bind9/lib/isccc/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.5 2007/06/19 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.5 2007-06-19 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isccc/include/isccc/Makefile.in b/contrib/bind9/lib/isccc/include/isccc/Makefile.in
index ae5bec7..ba52f3f 100644
--- a/contrib/bind9/lib/isccc/include/isccc/Makefile.in
+++ b/contrib/bind9/lib/isccc/include/isccc/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.7 2007/06/19 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.7 2007-06-19 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isccc/include/isccc/alist.h b/contrib/bind9/lib/isccc/include/isccc/alist.h
index 29147a6..54100a3 100644
--- a/contrib/bind9/lib/isccc/include/isccc/alist.h
+++ b/contrib/bind9/lib/isccc/include/isccc/alist.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: alist.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: alist.h,v 1.10 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_ALIST_H
#define ISCCC_ALIST_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/base64.h b/contrib/bind9/lib/isccc/include/isccc/base64.h
index 795b044..f39aef1 100644
--- a/contrib/bind9/lib/isccc/include/isccc/base64.h
+++ b/contrib/bind9/lib/isccc/include/isccc/base64.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base64.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: base64.h,v 1.10 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_BASE64_H
#define ISCCC_BASE64_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/cc.h b/contrib/bind9/lib/isccc/include/isccc/cc.h
index 79393be..2f72b27 100644
--- a/contrib/bind9/lib/isccc/include/isccc/cc.h
+++ b/contrib/bind9/lib/isccc/include/isccc/cc.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cc.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: cc.h,v 1.11 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_CC_H
#define ISCCC_CC_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/ccmsg.h b/contrib/bind9/lib/isccc/include/isccc/ccmsg.h
index e25aa51..8479345 100644
--- a/contrib/bind9/lib/isccc/include/isccc/ccmsg.h
+++ b/contrib/bind9/lib/isccc/include/isccc/ccmsg.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ccmsg.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: ccmsg.h,v 1.11 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_CCMSG_H
#define ISCCC_CCMSG_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/events.h b/contrib/bind9/lib/isccc/include/isccc/events.h
index a3e1470..bf2c405 100644
--- a/contrib/bind9/lib/isccc/include/isccc/events.h
+++ b/contrib/bind9/lib/isccc/include/isccc/events.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: events.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: events.h,v 1.10 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_EVENTS_H
#define ISCCC_EVENTS_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/lib.h b/contrib/bind9/lib/isccc/include/isccc/lib.h
index de74666..6de52ed 100644
--- a/contrib/bind9/lib/isccc/include/isccc/lib.h
+++ b/contrib/bind9/lib/isccc/include/isccc/lib.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lib.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: lib.h,v 1.11 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_LIB_H
#define ISCCC_LIB_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/result.h b/contrib/bind9/lib/isccc/include/isccc/result.h
index 2d54969..13a09c7 100644
--- a/contrib/bind9/lib/isccc/include/isccc/result.h
+++ b/contrib/bind9/lib/isccc/include/isccc/result.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: result.h,v 1.12 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: result.h,v 1.12 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_RESULT_H
#define ISCCC_RESULT_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/sexpr.h b/contrib/bind9/lib/isccc/include/isccc/sexpr.h
index 6112631..e0e5af5 100644
--- a/contrib/bind9/lib/isccc/include/isccc/sexpr.h
+++ b/contrib/bind9/lib/isccc/include/isccc/sexpr.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sexpr.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: sexpr.h,v 1.11 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_SEXPR_H
#define ISCCC_SEXPR_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/symtab.h b/contrib/bind9/lib/isccc/include/isccc/symtab.h
index 77a188a..031e851 100644
--- a/contrib/bind9/lib/isccc/include/isccc/symtab.h
+++ b/contrib/bind9/lib/isccc/include/isccc/symtab.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: symtab.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: symtab.h,v 1.10 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_SYMTAB_H
#define ISCCC_SYMTAB_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/symtype.h b/contrib/bind9/lib/isccc/include/isccc/symtype.h
index c8e6868..d007997 100644
--- a/contrib/bind9/lib/isccc/include/isccc/symtype.h
+++ b/contrib/bind9/lib/isccc/include/isccc/symtype.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: symtype.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: symtype.h,v 1.10 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_SYMTYPE_H
#define ISCCC_SYMTYPE_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/types.h b/contrib/bind9/lib/isccc/include/isccc/types.h
index fd5c9f3..2ff494c 100644
--- a/contrib/bind9/lib/isccc/include/isccc/types.h
+++ b/contrib/bind9/lib/isccc/include/isccc/types.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: types.h,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: types.h,v 1.10 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_TYPES_H
#define ISCCC_TYPES_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/util.h b/contrib/bind9/lib/isccc/include/isccc/util.h
index 2e36b6e..dda3b5e 100644
--- a/contrib/bind9/lib/isccc/include/isccc/util.h
+++ b/contrib/bind9/lib/isccc/include/isccc/util.h
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: util.h,v 1.11 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: util.h,v 1.11 2007-08-28 07:20:43 tbox Exp $ */
#ifndef ISCCC_UTIL_H
#define ISCCC_UTIL_H 1
diff --git a/contrib/bind9/lib/isccc/include/isccc/version.h b/contrib/bind9/lib/isccc/include/isccc/version.h
index 869316c..d352a1b 100644
--- a/contrib/bind9/lib/isccc/include/isccc/version.h
+++ b/contrib/bind9/lib/isccc/include/isccc/version.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.h,v 1.9 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: version.h,v 1.9 2007-06-19 23:47:22 tbox Exp $ */
/*! \file isccc/version.h */
diff --git a/contrib/bind9/lib/isccc/lib.c b/contrib/bind9/lib/isccc/lib.c
index 17170f5..43edcf1 100644
--- a/contrib/bind9/lib/isccc/lib.c
+++ b/contrib/bind9/lib/isccc/lib.c
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lib.c,v 1.9 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: lib.c,v 1.9 2007-08-28 07:20:43 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccc/result.c b/contrib/bind9/lib/isccc/result.c
index cbedc16..e37fc06 100644
--- a/contrib/bind9/lib/isccc/result.c
+++ b/contrib/bind9/lib/isccc/result.c
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: result.c,v 1.10 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: result.c,v 1.10 2007-08-28 07:20:43 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccc/sexpr.c b/contrib/bind9/lib/isccc/sexpr.c
index e96536d..0f14ab9 100644
--- a/contrib/bind9/lib/isccc/sexpr.c
+++ b/contrib/bind9/lib/isccc/sexpr.c
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: sexpr.c,v 1.9 2007/08/28 07:20:43 tbox Exp $ */
+/* $Id: sexpr.c,v 1.9 2007-08-28 07:20:43 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccc/symtab.c b/contrib/bind9/lib/isccc/symtab.c
index d7ae687..1fc7b5f 100644
--- a/contrib/bind9/lib/isccc/symtab.c
+++ b/contrib/bind9/lib/isccc/symtab.c
@@ -29,7 +29,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: symtab.c,v 1.11 2007/09/13 04:45:18 each Exp $ */
+/* $Id: symtab.c,v 1.11 2007-09-13 04:45:18 each Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccc/version.c b/contrib/bind9/lib/isccc/version.c
index c9d9124..35c4253 100644
--- a/contrib/bind9/lib/isccc/version.c
+++ b/contrib/bind9/lib/isccc/version.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.c,v 1.7 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: version.c,v 1.7 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccfg/Makefile.in b/contrib/bind9/lib/isccfg/Makefile.in
index 6dcacdd..4c55a16 100644
--- a/contrib/bind9/lib/isccfg/Makefile.in
+++ b/contrib/bind9/lib/isccfg/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.18 2007/06/19 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.18 2007-06-19 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isccfg/aclconf.c b/contrib/bind9/lib/isccfg/aclconf.c
index 92839e4..6bf0ad8 100644
--- a/contrib/bind9/lib/isccfg/aclconf.c
+++ b/contrib/bind9/lib/isccfg/aclconf.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: aclconf.c,v 1.22.34.4 2009/10/01 23:47:17 tbox Exp $ */
+/* $Id: aclconf.c,v 1.22.34.4 2009-10-01 23:47:17 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/isccfg/include/Makefile.in b/contrib/bind9/lib/isccfg/include/Makefile.in
index 1f24003..2ea4441 100644
--- a/contrib/bind9/lib/isccfg/include/Makefile.in
+++ b/contrib/bind9/lib/isccfg/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.7 2007/06/19 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.7 2007-06-19 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isccfg/include/isccfg/Makefile.in b/contrib/bind9/lib/isccfg/include/isccfg/Makefile.in
index a6fd412..3efdb83 100644
--- a/contrib/bind9/lib/isccfg/include/isccfg/Makefile.in
+++ b/contrib/bind9/lib/isccfg/include/isccfg/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.12 2007/06/19 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.12 2007-06-19 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/isccfg/include/isccfg/aclconf.h b/contrib/bind9/lib/isccfg/include/isccfg/aclconf.h
index 7ad4351..f2ab70f 100644
--- a/contrib/bind9/lib/isccfg/include/isccfg/aclconf.h
+++ b/contrib/bind9/lib/isccfg/include/isccfg/aclconf.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: aclconf.h,v 1.10 2007/10/12 04:17:18 each Exp $ */
+/* $Id: aclconf.h,v 1.10 2007-10-12 04:17:18 each Exp $ */
#ifndef ISCCFG_ACLCONF_H
#define ISCCFG_ACLCONF_H 1
diff --git a/contrib/bind9/lib/isccfg/include/isccfg/cfg.h b/contrib/bind9/lib/isccfg/include/isccfg/cfg.h
index d0ed94b..06efa35 100644
--- a/contrib/bind9/lib/isccfg/include/isccfg/cfg.h
+++ b/contrib/bind9/lib/isccfg/include/isccfg/cfg.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cfg.h,v 1.44 2007/10/12 04:17:18 each Exp $ */
+/* $Id: cfg.h,v 1.44 2007-10-12 04:17:18 each Exp $ */
#ifndef ISCCFG_CFG_H
#define ISCCFG_CFG_H 1
diff --git a/contrib/bind9/lib/isccfg/include/isccfg/grammar.h b/contrib/bind9/lib/isccfg/include/isccfg/grammar.h
index f194d4c..b8b845b 100644
--- a/contrib/bind9/lib/isccfg/include/isccfg/grammar.h
+++ b/contrib/bind9/lib/isccfg/include/isccfg/grammar.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: grammar.h,v 1.17 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: grammar.h,v 1.17 2008-09-25 04:02:39 tbox Exp $ */
#ifndef ISCCFG_GRAMMAR_H
#define ISCCFG_GRAMMAR_H 1
diff --git a/contrib/bind9/lib/isccfg/include/isccfg/log.h b/contrib/bind9/lib/isccfg/include/isccfg/log.h
index 9750a52..f45e4c2 100644
--- a/contrib/bind9/lib/isccfg/include/isccfg/log.h
+++ b/contrib/bind9/lib/isccfg/include/isccfg/log.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.h,v 1.12.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: log.h,v 1.12.332.2 2009-01-18 23:47:41 tbox Exp $ */
#ifndef ISCCFG_LOG_H
#define ISCCFG_LOG_H 1
diff --git a/contrib/bind9/lib/isccfg/include/isccfg/namedconf.h b/contrib/bind9/lib/isccfg/include/isccfg/namedconf.h
index 55c5a81..34aa3e8 100644
--- a/contrib/bind9/lib/isccfg/include/isccfg/namedconf.h
+++ b/contrib/bind9/lib/isccfg/include/isccfg/namedconf.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: namedconf.h,v 1.9.332.2 2009/06/25 23:47:28 tbox Exp $ */
+/* $Id: namedconf.h,v 1.9.332.2 2009-06-25 23:47:28 tbox Exp $ */
#ifndef ISCCFG_NAMEDCONF_H
#define ISCCFG_NAMEDCONF_H 1
diff --git a/contrib/bind9/lib/isccfg/include/isccfg/version.h b/contrib/bind9/lib/isccfg/include/isccfg/version.h
index 8aed111..c999842 100644
--- a/contrib/bind9/lib/isccfg/include/isccfg/version.h
+++ b/contrib/bind9/lib/isccfg/include/isccfg/version.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.h,v 1.9 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: version.h,v 1.9 2007-06-19 23:47:22 tbox Exp $ */
/*! \file isccfg/version.h */
diff --git a/contrib/bind9/lib/isccfg/log.c b/contrib/bind9/lib/isccfg/log.c
index 8747fc0..bd5b6b9 100644
--- a/contrib/bind9/lib/isccfg/log.c
+++ b/contrib/bind9/lib/isccfg/log.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: log.c,v 1.11 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: log.c,v 1.11 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccfg/parser.c b/contrib/bind9/lib/isccfg/parser.c
index ee19cf5..2f64a09 100644
--- a/contrib/bind9/lib/isccfg/parser.c
+++ b/contrib/bind9/lib/isccfg/parser.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: parser.c,v 1.129 2008/09/25 04:02:39 tbox Exp $ */
+/* $Id: parser.c,v 1.129 2008-09-25 04:02:39 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/isccfg/version.c b/contrib/bind9/lib/isccfg/version.c
index 25b98c6..4850939 100644
--- a/contrib/bind9/lib/isccfg/version.c
+++ b/contrib/bind9/lib/isccfg/version.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.c,v 1.7 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: version.c,v 1.7 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/Makefile.in b/contrib/bind9/lib/lwres/Makefile.in
index 858b325..e31d71e 100644
--- a/contrib/bind9/lib/lwres/Makefile.in
+++ b/contrib/bind9/lib/lwres/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.34 2007/06/19 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.34 2007-06-19 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/lwres/assert_p.h b/contrib/bind9/lib/lwres/assert_p.h
index f8d6e22..c8965b5 100644
--- a/contrib/bind9/lib/lwres/assert_p.h
+++ b/contrib/bind9/lib/lwres/assert_p.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: assert_p.h,v 1.14 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: assert_p.h,v 1.14 2007-06-19 23:47:22 tbox Exp $ */
#ifndef LWRES_ASSERT_P_H
#define LWRES_ASSERT_P_H 1
diff --git a/contrib/bind9/lib/lwres/context.c b/contrib/bind9/lib/lwres/context.c
index d042c87..1310022 100644
--- a/contrib/bind9/lib/lwres/context.c
+++ b/contrib/bind9/lib/lwres/context.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: context.c,v 1.50.332.5 2009/09/01 23:47:05 tbox Exp $ */
+/* $Id: context.c,v 1.50.332.5 2009-09-01 23:47:05 tbox Exp $ */
/*! \file context.c
lwres_context_create() creates a #lwres_context_t structure for use in
diff --git a/contrib/bind9/lib/lwres/context_p.h b/contrib/bind9/lib/lwres/context_p.h
index dd6f2b6..663b1da 100644
--- a/contrib/bind9/lib/lwres/context_p.h
+++ b/contrib/bind9/lib/lwres/context_p.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: context_p.h,v 1.17.332.2 2008/12/30 23:46:49 tbox Exp $ */
+/* $Id: context_p.h,v 1.17.332.2 2008-12-30 23:46:49 tbox Exp $ */
#ifndef LWRES_CONTEXT_P_H
#define LWRES_CONTEXT_P_H 1
diff --git a/contrib/bind9/lib/lwres/gai_strerror.c b/contrib/bind9/lib/lwres/gai_strerror.c
index 70b35b0..f4a0018 100644
--- a/contrib/bind9/lib/lwres/gai_strerror.c
+++ b/contrib/bind9/lib/lwres/gai_strerror.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gai_strerror.c,v 1.22 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: gai_strerror.c,v 1.22 2007-06-19 23:47:22 tbox Exp $ */
/*! \file gai_strerror.c
* lwres_gai_strerror() returns an error message corresponding to an
diff --git a/contrib/bind9/lib/lwres/getaddrinfo.c b/contrib/bind9/lib/lwres/getaddrinfo.c
index fc53e63..665205a 100644
--- a/contrib/bind9/lib/lwres/getaddrinfo.c
+++ b/contrib/bind9/lib/lwres/getaddrinfo.c
@@ -18,7 +18,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getaddrinfo.c,v 1.52.254.2 2009/03/31 23:47:16 tbox Exp $ */
+/* $Id: getaddrinfo.c,v 1.52.254.2 2009-03-31 23:47:16 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/gethost.c b/contrib/bind9/lib/lwres/gethost.c
index 1a1efd4..0a60ffd 100644
--- a/contrib/bind9/lib/lwres/gethost.c
+++ b/contrib/bind9/lib/lwres/gethost.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: gethost.c,v 1.34 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: gethost.c,v 1.34 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/getipnode.c b/contrib/bind9/lib/lwres/getipnode.c
index 4331638..b9eadee 100644
--- a/contrib/bind9/lib/lwres/getipnode.c
+++ b/contrib/bind9/lib/lwres/getipnode.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getipnode.c,v 1.42.332.5 2009/09/01 23:47:05 tbox Exp $ */
+/* $Id: getipnode.c,v 1.42.332.5 2009-09-01 23:47:05 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/getnameinfo.c b/contrib/bind9/lib/lwres/getnameinfo.c
index 74a5b85..b27ac40 100644
--- a/contrib/bind9/lib/lwres/getnameinfo.c
+++ b/contrib/bind9/lib/lwres/getnameinfo.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getnameinfo.c,v 1.39 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: getnameinfo.c,v 1.39 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/getrrset.c b/contrib/bind9/lib/lwres/getrrset.c
index d8b6cc3..87c2b24 100644
--- a/contrib/bind9/lib/lwres/getrrset.c
+++ b/contrib/bind9/lib/lwres/getrrset.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: getrrset.c,v 1.18 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: getrrset.c,v 1.18 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/herror.c b/contrib/bind9/lib/lwres/herror.c
index cf5b892..babc1f0 100644
--- a/contrib/bind9/lib/lwres/herror.c
+++ b/contrib/bind9/lib/lwres/herror.c
@@ -72,7 +72,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)herror.c 8.1 (Berkeley) 6/4/93";
static const char rcsid[] =
- "$Id: herror.c,v 1.17 2007/06/19 23:47:22 tbox Exp $";
+ "$Id: herror.c,v 1.17 2007-06-19 23:47:22 tbox Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
diff --git a/contrib/bind9/lib/lwres/include/Makefile.in b/contrib/bind9/lib/lwres/include/Makefile.in
index 4750a5e..7cbd33f 100644
--- a/contrib/bind9/lib/lwres/include/Makefile.in
+++ b/contrib/bind9/lib/lwres/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.8 2007/06/19 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.8 2007-06-19 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/lwres/include/lwres/Makefile.in b/contrib/bind9/lib/lwres/include/lwres/Makefile.in
index fc3126f..df96778 100644
--- a/contrib/bind9/lib/lwres/include/lwres/Makefile.in
+++ b/contrib/bind9/lib/lwres/include/lwres/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.23 2007/06/19 23:47:22 tbox Exp $
+# $Id: Makefile.in,v 1.23 2007-06-19 23:47:22 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/lwres/include/lwres/context.h b/contrib/bind9/lib/lwres/include/lwres/context.h
index 5ae0b37..46be27a 100644
--- a/contrib/bind9/lib/lwres/include/lwres/context.h
+++ b/contrib/bind9/lib/lwres/include/lwres/context.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: context.h,v 1.21.332.2 2008/12/30 23:46:49 tbox Exp $ */
+/* $Id: context.h,v 1.21.332.2 2008-12-30 23:46:49 tbox Exp $ */
#ifndef LWRES_CONTEXT_H
#define LWRES_CONTEXT_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/int.h b/contrib/bind9/lib/lwres/include/lwres/int.h
index 3fb0c4f..c9c31bb 100644
--- a/contrib/bind9/lib/lwres/include/lwres/int.h
+++ b/contrib/bind9/lib/lwres/include/lwres/int.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: int.h,v 1.14 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: int.h,v 1.14 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_INT_H
#define LWRES_INT_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/ipv6.h b/contrib/bind9/lib/lwres/include/lwres/ipv6.h
index 5d54b29..b1f9a74 100644
--- a/contrib/bind9/lib/lwres/include/lwres/ipv6.h
+++ b/contrib/bind9/lib/lwres/include/lwres/ipv6.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: ipv6.h,v 1.16 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: ipv6.h,v 1.16 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_IPV6_H
#define LWRES_IPV6_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/lang.h b/contrib/bind9/lib/lwres/include/lwres/lang.h
index b680e4b..2993b25 100644
--- a/contrib/bind9/lib/lwres/include/lwres/lang.h
+++ b/contrib/bind9/lib/lwres/include/lwres/lang.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lang.h,v 1.13 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: lang.h,v 1.13 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_LANG_H
#define LWRES_LANG_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/list.h b/contrib/bind9/lib/lwres/include/lwres/list.h
index c6ab096..a6c1cfc 100644
--- a/contrib/bind9/lib/lwres/include/lwres/list.h
+++ b/contrib/bind9/lib/lwres/include/lwres/list.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: list.h,v 1.14 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: list.h,v 1.14 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_LIST_H
#define LWRES_LIST_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/lwbuffer.h b/contrib/bind9/lib/lwres/include/lwres/lwbuffer.h
index e3cf343..d2d9b93 100644
--- a/contrib/bind9/lib/lwres/include/lwres/lwbuffer.h
+++ b/contrib/bind9/lib/lwres/include/lwres/lwbuffer.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwbuffer.h,v 1.22 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: lwbuffer.h,v 1.22 2007-06-19 23:47:23 tbox Exp $ */
/*! \file lwres/lwbuffer.h
diff --git a/contrib/bind9/lib/lwres/include/lwres/lwpacket.h b/contrib/bind9/lib/lwres/include/lwres/lwpacket.h
index 96f8e54..ec64493 100644
--- a/contrib/bind9/lib/lwres/include/lwres/lwpacket.h
+++ b/contrib/bind9/lib/lwres/include/lwres/lwpacket.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwpacket.h,v 1.24 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: lwpacket.h,v 1.24 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_LWPACKET_H
#define LWRES_LWPACKET_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/lwres.h b/contrib/bind9/lib/lwres/include/lwres/lwres.h
index 6912448..39a27ee 100644
--- a/contrib/bind9/lib/lwres/include/lwres/lwres.h
+++ b/contrib/bind9/lib/lwres/include/lwres/lwres.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwres.h,v 1.57 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: lwres.h,v 1.57 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_LWRES_H
#define LWRES_LWRES_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/netdb.h.in b/contrib/bind9/lib/lwres/include/lwres/netdb.h.in
index 37ab039..7531ca3 100644
--- a/contrib/bind9/lib/lwres/include/lwres/netdb.h.in
+++ b/contrib/bind9/lib/lwres/include/lwres/netdb.h.in
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: netdb.h.in,v 1.39.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: netdb.h.in,v 1.39.332.2 2009-01-18 23:47:41 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/include/lwres/platform.h.in b/contrib/bind9/lib/lwres/include/lwres/platform.h.in
index bb4f6ee..3923b51 100644
--- a/contrib/bind9/lib/lwres/include/lwres/platform.h.in
+++ b/contrib/bind9/lib/lwres/include/lwres/platform.h.in
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: platform.h.in,v 1.21 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: platform.h.in,v 1.21 2007-06-19 23:47:23 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/include/lwres/result.h b/contrib/bind9/lib/lwres/include/lwres/result.h
index cfcf166..5fd6d96 100644
--- a/contrib/bind9/lib/lwres/include/lwres/result.h
+++ b/contrib/bind9/lib/lwres/include/lwres/result.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: result.h,v 1.21 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: result.h,v 1.21 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_RESULT_H
#define LWRES_RESULT_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/stdlib.h b/contrib/bind9/lib/lwres/include/lwres/stdlib.h
index 25a109e..0cfb0b4 100644
--- a/contrib/bind9/lib/lwres/include/lwres/stdlib.h
+++ b/contrib/bind9/lib/lwres/include/lwres/stdlib.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: stdlib.h,v 1.6 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: stdlib.h,v 1.6 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_STDLIB_H
#define LWRES_STDLIB_H 1
diff --git a/contrib/bind9/lib/lwres/include/lwres/version.h b/contrib/bind9/lib/lwres/include/lwres/version.h
index 9efc86d..5f5d041 100644
--- a/contrib/bind9/lib/lwres/include/lwres/version.h
+++ b/contrib/bind9/lib/lwres/include/lwres/version.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.h,v 1.9 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: version.h,v 1.9 2007-06-19 23:47:23 tbox Exp $ */
/*! \file lwres/version.h */
diff --git a/contrib/bind9/lib/lwres/lwbuffer.c b/contrib/bind9/lib/lwres/lwbuffer.c
index 49aaeb7..f6b8eaf 100644
--- a/contrib/bind9/lib/lwres/lwbuffer.c
+++ b/contrib/bind9/lib/lwres/lwbuffer.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwbuffer.c,v 1.15 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: lwbuffer.c,v 1.15 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/lwconfig.c b/contrib/bind9/lib/lwres/lwconfig.c
index 7ededdf..356c106 100644
--- a/contrib/bind9/lib/lwres/lwconfig.c
+++ b/contrib/bind9/lib/lwres/lwconfig.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwconfig.c,v 1.46.332.2 2008/12/30 23:46:49 tbox Exp $ */
+/* $Id: lwconfig.c,v 1.46.332.2 2008-12-30 23:46:49 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/lwinetaton.c b/contrib/bind9/lib/lwres/lwinetaton.c
index e40c28f..e829ca2 100644
--- a/contrib/bind9/lib/lwres/lwinetaton.c
+++ b/contrib/bind9/lib/lwres/lwinetaton.c
@@ -72,7 +72,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static char rcsid[] = "$Id: lwinetaton.c,v 1.16 2007/06/19 23:47:22 tbox Exp $";
+static char rcsid[] = "$Id: lwinetaton.c,v 1.16 2007-06-19 23:47:22 tbox Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
diff --git a/contrib/bind9/lib/lwres/lwinetntop.c b/contrib/bind9/lib/lwres/lwinetntop.c
index cf3bdfe..a29e1ba 100644
--- a/contrib/bind9/lib/lwres/lwinetntop.c
+++ b/contrib/bind9/lib/lwres/lwinetntop.c
@@ -19,7 +19,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] =
- "$Id: lwinetntop.c,v 1.18 2007/06/19 23:47:22 tbox Exp $";
+ "$Id: lwinetntop.c,v 1.18 2007-06-19 23:47:22 tbox Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
diff --git a/contrib/bind9/lib/lwres/lwinetpton.c b/contrib/bind9/lib/lwres/lwinetpton.c
index 5bbef08..55c732c 100644
--- a/contrib/bind9/lib/lwres/lwinetpton.c
+++ b/contrib/bind9/lib/lwres/lwinetpton.c
@@ -19,7 +19,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id: lwinetpton.c,v 1.12 2007/06/19 23:47:22 tbox Exp $";
+static char rcsid[] = "$Id: lwinetpton.c,v 1.12 2007-06-19 23:47:22 tbox Exp $";
#endif /* LIBC_SCCS and not lint */
#include <config.h>
diff --git a/contrib/bind9/lib/lwres/lwpacket.c b/contrib/bind9/lib/lwres/lwpacket.c
index cfa2723..bf42fda 100644
--- a/contrib/bind9/lib/lwres/lwpacket.c
+++ b/contrib/bind9/lib/lwres/lwpacket.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwpacket.c,v 1.18 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: lwpacket.c,v 1.18 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/lwres_gabn.c b/contrib/bind9/lib/lwres/lwres_gabn.c
index 3363e66..e38d69a 100644
--- a/contrib/bind9/lib/lwres/lwres_gabn.c
+++ b/contrib/bind9/lib/lwres/lwres_gabn.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwres_gabn.c,v 1.33 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: lwres_gabn.c,v 1.33 2007-06-19 23:47:22 tbox Exp $ */
/*! \file lwres_gabn.c
These are low-level routines for creating and parsing lightweight
diff --git a/contrib/bind9/lib/lwres/lwres_gnba.c b/contrib/bind9/lib/lwres/lwres_gnba.c
index d18ae15..20b05e0 100644
--- a/contrib/bind9/lib/lwres/lwres_gnba.c
+++ b/contrib/bind9/lib/lwres/lwres_gnba.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwres_gnba.c,v 1.28 2007/09/24 17:18:25 each Exp $ */
+/* $Id: lwres_gnba.c,v 1.28 2007-09-24 17:18:25 each Exp $ */
/*! \file lwres_gnba.c
These are low-level routines for creating and parsing lightweight
diff --git a/contrib/bind9/lib/lwres/lwres_grbn.c b/contrib/bind9/lib/lwres/lwres_grbn.c
index 72718ba..6f99cfc 100644
--- a/contrib/bind9/lib/lwres/lwres_grbn.c
+++ b/contrib/bind9/lib/lwres/lwres_grbn.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwres_grbn.c,v 1.10 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: lwres_grbn.c,v 1.10 2007-06-19 23:47:22 tbox Exp $ */
/*! \file lwres_grbn.c
diff --git a/contrib/bind9/lib/lwres/lwres_noop.c b/contrib/bind9/lib/lwres/lwres_noop.c
index 369fe4e..92b5ecc 100644
--- a/contrib/bind9/lib/lwres/lwres_noop.c
+++ b/contrib/bind9/lib/lwres/lwres_noop.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwres_noop.c,v 1.19 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: lwres_noop.c,v 1.19 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/lwresutil.c b/contrib/bind9/lib/lwres/lwresutil.c
index 3bf5660..5121f4e 100644
--- a/contrib/bind9/lib/lwres/lwresutil.c
+++ b/contrib/bind9/lib/lwres/lwresutil.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwresutil.c,v 1.34 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: lwresutil.c,v 1.34 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/lib/lwres/man/Makefile.in b/contrib/bind9/lib/lwres/man/Makefile.in
index cb723c2..0cb8333 100644
--- a/contrib/bind9/lib/lwres/man/Makefile.in
+++ b/contrib/bind9/lib/lwres/man/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.9 2007/06/19 23:47:23 tbox Exp $
+# $Id: Makefile.in,v 1.9 2007-06-19 23:47:23 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/lwres/man/lwres.3 b/contrib/bind9/lib/lwres/man/lwres.3
index 14c719a..77f96b6 100644
--- a/contrib/bind9/lib/lwres/man/lwres.3
+++ b/contrib/bind9/lib/lwres/man/lwres.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres.3,v 1.28.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres.3,v 1.28.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres.docbook b/contrib/bind9/lib/lwres/man/lwres.docbook
index 97d591c..3bce827 100644
--- a/contrib/bind9/lib/lwres/man/lwres.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres.docbook,v 1.10 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres.docbook,v 1.10 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_buffer.3 b/contrib/bind9/lib/lwres/man/lwres_buffer.3
index e8fe631..89b9b65 100644
--- a/contrib/bind9/lib/lwres/man/lwres_buffer.3
+++ b/contrib/bind9/lib/lwres/man/lwres_buffer.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_buffer.3,v 1.26.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_buffer.3,v 1.26.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_buffer.docbook b/contrib/bind9/lib/lwres/man/lwres_buffer.docbook
index 97c52bd..3b55164 100644
--- a/contrib/bind9/lib/lwres/man/lwres_buffer.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_buffer.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_buffer.docbook,v 1.10 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_buffer.docbook,v 1.10 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
<date>Jun 30, 2000</date>
diff --git a/contrib/bind9/lib/lwres/man/lwres_config.3 b/contrib/bind9/lib/lwres/man/lwres_config.3
index 2d3b813..5b8a728 100644
--- a/contrib/bind9/lib/lwres/man/lwres_config.3
+++ b/contrib/bind9/lib/lwres/man/lwres_config.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_config.3,v 1.26.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_config.3,v 1.26.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_config.docbook b/contrib/bind9/lib/lwres/man/lwres_config.docbook
index 5736ef3..40da9aa 100644
--- a/contrib/bind9/lib/lwres/man/lwres_config.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_config.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_config.docbook,v 1.9 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_config.docbook,v 1.9 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_context.3 b/contrib/bind9/lib/lwres/man/lwres_context.3
index dae7ee5..a96a075 100644
--- a/contrib/bind9/lib/lwres/man/lwres_context.3
+++ b/contrib/bind9/lib/lwres/man/lwres_context.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_context.3,v 1.28.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_context.3,v 1.28.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_context.docbook b/contrib/bind9/lib/lwres/man/lwres_context.docbook
index ad0392e..68b9fed 100644
--- a/contrib/bind9/lib/lwres/man/lwres_context.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_context.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_context.docbook,v 1.11 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_context.docbook,v 1.11 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_gabn.3 b/contrib/bind9/lib/lwres/man/lwres_gabn.3
index 64846d1..28ea7e1 100644
--- a/contrib/bind9/lib/lwres/man/lwres_gabn.3
+++ b/contrib/bind9/lib/lwres/man/lwres_gabn.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_gabn.3,v 1.27.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_gabn.3,v 1.27.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_gabn.docbook b/contrib/bind9/lib/lwres/man/lwres_gabn.docbook
index d0b5c19..30b2ead 100644
--- a/contrib/bind9/lib/lwres/man/lwres_gabn.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_gabn.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_gabn.docbook,v 1.10 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_gabn.docbook,v 1.10 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3 b/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3
index 46b54c0..3d80727 100644
--- a/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3
+++ b/contrib/bind9/lib/lwres/man/lwres_gai_strerror.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_gai_strerror.3,v 1.27.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_gai_strerror.3,v 1.27.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook b/contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook
index c33fee5..8e97e07 100644
--- a/contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_gai_strerror.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_gai_strerror.docbook,v 1.10 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_gai_strerror.docbook,v 1.10 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3 b/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3
index edac051..2953f3b 100644
--- a/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3
+++ b/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_getaddrinfo.3,v 1.31.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_getaddrinfo.3,v 1.31.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook b/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook
index a328764..67b8f68 100644
--- a/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_getaddrinfo.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_getaddrinfo.docbook,v 1.13 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_getaddrinfo.docbook,v 1.13 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_gethostent.3 b/contrib/bind9/lib/lwres/man/lwres_gethostent.3
index 688c618..35ea1c2 100644
--- a/contrib/bind9/lib/lwres/man/lwres_gethostent.3
+++ b/contrib/bind9/lib/lwres/man/lwres_gethostent.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_gethostent.3,v 1.29.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_gethostent.3,v 1.29.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_gethostent.docbook b/contrib/bind9/lib/lwres/man/lwres_gethostent.docbook
index a3f084b..7887452f 100644
--- a/contrib/bind9/lib/lwres/man/lwres_gethostent.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_gethostent.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_gethostent.docbook,v 1.11 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_gethostent.docbook,v 1.11 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_getipnode.3 b/contrib/bind9/lib/lwres/man/lwres_getipnode.3
index b74b342..b46e78f 100644
--- a/contrib/bind9/lib/lwres/man/lwres_getipnode.3
+++ b/contrib/bind9/lib/lwres/man/lwres_getipnode.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_getipnode.3,v 1.28.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_getipnode.3,v 1.28.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_getipnode.docbook b/contrib/bind9/lib/lwres/man/lwres_getipnode.docbook
index 825f462..60b5274 100644
--- a/contrib/bind9/lib/lwres/man/lwres_getipnode.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_getipnode.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_getipnode.docbook,v 1.12 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_getipnode.docbook,v 1.12 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3 b/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3
index d77776b..3a75efb 100644
--- a/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3
+++ b/contrib/bind9/lib/lwres/man/lwres_getnameinfo.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_getnameinfo.3,v 1.29.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_getnameinfo.3,v 1.29.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook b/contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook
index 504dfb7..e08d45a 100644
--- a/contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_getnameinfo.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_getnameinfo.docbook,v 1.10 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_getnameinfo.docbook,v 1.10 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3 b/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3
index bda5aa2..c804e11 100644
--- a/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3
+++ b/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_getrrsetbyname.3,v 1.25.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_getrrsetbyname.3,v 1.25.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook b/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook
index 5f2a68d..6aa18fc 100644
--- a/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_getrrsetbyname.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_getrrsetbyname.docbook,v 1.10 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_getrrsetbyname.docbook,v 1.10 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_gnba.3 b/contrib/bind9/lib/lwres/man/lwres_gnba.3
index e04fa8f..b34fc05 100644
--- a/contrib/bind9/lib/lwres/man/lwres_gnba.3
+++ b/contrib/bind9/lib/lwres/man/lwres_gnba.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_gnba.3,v 1.27.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_gnba.3,v 1.27.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_gnba.docbook b/contrib/bind9/lib/lwres/man/lwres_gnba.docbook
index 452cdfc..0a898eb 100644
--- a/contrib/bind9/lib/lwres/man/lwres_gnba.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_gnba.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_gnba.docbook,v 1.11 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_gnba.docbook,v 1.11 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_hstrerror.3 b/contrib/bind9/lib/lwres/man/lwres_hstrerror.3
index badb5fe..f65ba54 100644
--- a/contrib/bind9/lib/lwres/man/lwres_hstrerror.3
+++ b/contrib/bind9/lib/lwres/man/lwres_hstrerror.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_hstrerror.3,v 1.27.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_hstrerror.3,v 1.27.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook b/contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook
index ca4589e..a38ba5e 100644
--- a/contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_hstrerror.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_hstrerror.docbook,v 1.11 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_hstrerror.docbook,v 1.11 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_inetntop.3 b/contrib/bind9/lib/lwres/man/lwres_inetntop.3
index 1f9e097..6bd063a 100644
--- a/contrib/bind9/lib/lwres/man/lwres_inetntop.3
+++ b/contrib/bind9/lib/lwres/man/lwres_inetntop.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_inetntop.3,v 1.26.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_inetntop.3,v 1.26.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_inetntop.docbook b/contrib/bind9/lib/lwres/man/lwres_inetntop.docbook
index 26f1779..30e9320 100644
--- a/contrib/bind9/lib/lwres/man/lwres_inetntop.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_inetntop.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_inetntop.docbook,v 1.10 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_inetntop.docbook,v 1.10 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_noop.3 b/contrib/bind9/lib/lwres/man/lwres_noop.3
index 6c39ce6..fd05e7e 100644
--- a/contrib/bind9/lib/lwres/man/lwres_noop.3
+++ b/contrib/bind9/lib/lwres/man/lwres_noop.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_noop.3,v 1.28.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_noop.3,v 1.28.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_noop.docbook b/contrib/bind9/lib/lwres/man/lwres_noop.docbook
index eb823b7..a13154f 100644
--- a/contrib/bind9/lib/lwres/man/lwres_noop.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_noop.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_noop.docbook,v 1.11 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_noop.docbook,v 1.11 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_packet.3 b/contrib/bind9/lib/lwres/man/lwres_packet.3
index 068d241..5c096b5 100644
--- a/contrib/bind9/lib/lwres/man/lwres_packet.3
+++ b/contrib/bind9/lib/lwres/man/lwres_packet.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_packet.3,v 1.29.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_packet.3,v 1.29.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_packet.docbook b/contrib/bind9/lib/lwres/man/lwres_packet.docbook
index 87841db..9e75135 100644
--- a/contrib/bind9/lib/lwres/man/lwres_packet.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_packet.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_packet.docbook,v 1.13 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_packet.docbook,v 1.13 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/man/lwres_resutil.3 b/contrib/bind9/lib/lwres/man/lwres_resutil.3
index 2297cb7..6e17797 100644
--- a/contrib/bind9/lib/lwres/man/lwres_resutil.3
+++ b/contrib/bind9/lib/lwres/man/lwres_resutil.3
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $Id: lwres_resutil.3,v 1.28.418.1 2009/07/11 01:55:21 tbox Exp $
+.\" $Id: lwres_resutil.3,v 1.28.418.1 2009-07-11 01:55:21 tbox Exp $
.\"
.hy 0
.ad l
diff --git a/contrib/bind9/lib/lwres/man/lwres_resutil.docbook b/contrib/bind9/lib/lwres/man/lwres_resutil.docbook
index e6184d9..2c07170 100644
--- a/contrib/bind9/lib/lwres/man/lwres_resutil.docbook
+++ b/contrib/bind9/lib/lwres/man/lwres_resutil.docbook
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
-<!-- $Id: lwres_resutil.docbook,v 1.12 2007/06/18 23:47:51 tbox Exp $ -->
+<!-- $Id: lwres_resutil.docbook,v 1.12 2007-06-18 23:47:51 tbox Exp $ -->
<refentry>
<refentryinfo>
diff --git a/contrib/bind9/lib/lwres/print.c b/contrib/bind9/lib/lwres/print.c
index 5245d29..f461177 100644
--- a/contrib/bind9/lib/lwres/print.c
+++ b/contrib/bind9/lib/lwres/print.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: print.c,v 1.10 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: print.c,v 1.10 2007-06-19 23:47:22 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/lwres/strtoul.c b/contrib/bind9/lib/lwres/strtoul.c
index f16896c..ee65148 100644
--- a/contrib/bind9/lib/lwres/strtoul.c
+++ b/contrib/bind9/lib/lwres/strtoul.c
@@ -53,7 +53,7 @@
static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
-/* $Id: strtoul.c,v 1.4 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: strtoul.c,v 1.4 2007-06-19 23:47:22 tbox Exp $ */
#include <config.h>
diff --git a/contrib/bind9/lib/lwres/unix/Makefile.in b/contrib/bind9/lib/lwres/unix/Makefile.in
index 5d77208..5ef4588 100644
--- a/contrib/bind9/lib/lwres/unix/Makefile.in
+++ b/contrib/bind9/lib/lwres/unix/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.4 2007/06/19 23:47:23 tbox Exp $
+# $Id: Makefile.in,v 1.4 2007-06-19 23:47:23 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/lwres/unix/include/Makefile.in b/contrib/bind9/lib/lwres/unix/include/Makefile.in
index 6190633..240cb03 100644
--- a/contrib/bind9/lib/lwres/unix/include/Makefile.in
+++ b/contrib/bind9/lib/lwres/unix/include/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.4 2007/06/19 23:47:23 tbox Exp $
+# $Id: Makefile.in,v 1.4 2007-06-19 23:47:23 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/lwres/unix/include/lwres/Makefile.in b/contrib/bind9/lib/lwres/unix/include/lwres/Makefile.in
index c943e01..c98cb3f 100644
--- a/contrib/bind9/lib/lwres/unix/include/lwres/Makefile.in
+++ b/contrib/bind9/lib/lwres/unix/include/lwres/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.4 2007/06/19 23:47:23 tbox Exp $
+# $Id: Makefile.in,v 1.4 2007-06-19 23:47:23 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/lib/lwres/unix/include/lwres/net.h b/contrib/bind9/lib/lwres/unix/include/lwres/net.h
index 0b16178..c703e45 100644
--- a/contrib/bind9/lib/lwres/unix/include/lwres/net.h
+++ b/contrib/bind9/lib/lwres/unix/include/lwres/net.h
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: net.h,v 1.9 2007/06/19 23:47:23 tbox Exp $ */
+/* $Id: net.h,v 1.9 2007-06-19 23:47:23 tbox Exp $ */
#ifndef LWRES_NET_H
#define LWRES_NET_H 1
diff --git a/contrib/bind9/lib/lwres/version.c b/contrib/bind9/lib/lwres/version.c
index cc52c51..8b33a20 100644
--- a/contrib/bind9/lib/lwres/version.c
+++ b/contrib/bind9/lib/lwres/version.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: version.c,v 1.12 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: version.c,v 1.12 2007-06-19 23:47:22 tbox Exp $ */
/*! \file */
diff --git a/contrib/bind9/make/Makefile.in b/contrib/bind9/make/Makefile.in
index cffd561..9f0ae81 100644
--- a/contrib/bind9/make/Makefile.in
+++ b/contrib/bind9/make/Makefile.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: Makefile.in,v 1.16 2007/06/19 23:47:24 tbox Exp $
+# $Id: Makefile.in,v 1.16 2007-06-19 23:47:24 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
diff --git a/contrib/bind9/make/includes.in b/contrib/bind9/make/includes.in
index 8e5750c..fd05f4e 100644
--- a/contrib/bind9/make/includes.in
+++ b/contrib/bind9/make/includes.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: includes.in,v 1.21 2007/06/19 23:47:24 tbox Exp $
+# $Id: includes.in,v 1.21 2007-06-19 23:47:24 tbox Exp $
# Search for machine-generated header files in the build tree,
# and for normal headers in the source tree (${top_srcdir}).
diff --git a/contrib/bind9/make/rules.in b/contrib/bind9/make/rules.in
index 0b07980..d848480 100644
--- a/contrib/bind9/make/rules.in
+++ b/contrib/bind9/make/rules.in
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-# $Id: rules.in,v 1.64.130.2 2009/01/10 23:46:57 tbox Exp $
+# $Id: rules.in,v 1.64.130.2 2009-01-10 23:46:57 tbox Exp $
###
### Common Makefile rules for BIND 9.
diff --git a/contrib/bind9/mkinstalldirs b/contrib/bind9/mkinstalldirs
index 4992567..83ba1cf 100755
--- a/contrib/bind9/mkinstalldirs
+++ b/contrib/bind9/mkinstalldirs
@@ -4,7 +4,7 @@
# Created: 1993-05-16
# Public domain
-# $Id: mkinstalldirs,v 1.1 2000/09/20 19:05:51 gson Exp $
+# $Id: mkinstalldirs,v 1.1 2000-09-20 19:05:51 gson Exp $
errstatus=0
diff --git a/contrib/bind9/version b/contrib/bind9/version
index 4ff5434..f03c983 100644
--- a/contrib/bind9/version
+++ b/contrib/bind9/version
@@ -1,10 +1,10 @@
-# $Id: version,v 1.43.12.11 2011-01-30 06:38:13 marka Exp $
+# $Id: version,v 1.43.12.11.2.2.2.1 2011-05-27 00:19:16 each Exp $
#
# This file must follow /bin/sh rules. It is imported directly via
# configure.
#
MAJORVER=9
MINORVER=6
-PATCHVER=3
-RELEASETYPE=
-RELEASEVER=
+PATCHVER=
+RELEASETYPE=-ESV
+RELEASEVER=-R4-P1
diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h
index a2aac5f..e654148 100644
--- a/contrib/binutils/bfd/coffcode.h
+++ b/contrib/binutils/bfd/coffcode.h
@@ -3240,7 +3240,7 @@ coff_compute_section_file_positions (bfd * abfd)
incremented in coff_set_section_contents. This is right for
SVR3.2. */
if (strcmp (current->name, _LIB) == 0)
- bfd_set_section_vma (abfd, current, 0);
+ (void) bfd_set_section_vma (abfd, current, 0);
#endif
previous = current;
diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c
index 9e0cc26..ad22db5 100644
--- a/contrib/binutils/bfd/opncls.c
+++ b/contrib/binutils/bfd/opncls.c
@@ -231,7 +231,7 @@ bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
then it may have been opened with special flags that make it
unsafe to close and reopen the file. */
if (fd == -1)
- bfd_set_cacheable (nbfd, TRUE);
+ (void) bfd_set_cacheable (nbfd, TRUE);
return nbfd;
}
diff --git a/contrib/binutils/bfd/peicode.h b/contrib/binutils/bfd/peicode.h
index 0f4858f..4ae10db 100644
--- a/contrib/binutils/bfd/peicode.h
+++ b/contrib/binutils/bfd/peicode.h
@@ -607,7 +607,7 @@ pe_ILF_make_a_section (pe_ILF_vars * vars,
bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
- bfd_set_section_alignment (vars->abfd, sec, 2);
+ (void) bfd_set_section_alignment (vars->abfd, sec, 2);
/* Check that we will not run out of space. */
BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
diff --git a/contrib/binutils/gas/config/obj-elf.c b/contrib/binutils/gas/config/obj-elf.c
index 2f93990..12ca242 100644
--- a/contrib/binutils/gas/config/obj-elf.c
+++ b/contrib/binutils/gas/config/obj-elf.c
@@ -1636,7 +1636,7 @@ obj_elf_init_stab_section (segT seg)
/* Force the section to align to a longword boundary. Without this,
UnixWare ar crashes. */
- bfd_set_section_alignment (stdoutput, seg, 2);
+ (void) bfd_set_section_alignment (stdoutput, seg, 2);
/* Make space for this first symbol. */
p = frag_more (12);
diff --git a/contrib/binutils/gas/frags.c b/contrib/binutils/gas/frags.c
index adb9b19..98ac536 100644
--- a/contrib/binutils/gas/frags.c
+++ b/contrib/binutils/gas/frags.c
@@ -146,7 +146,7 @@ frag_new (int old_frags_var_max_size
/* This will align the obstack so the next struct we allocate on it
will begin at a correct boundary. */
- obstack_finish (&frchain_now->frch_obstack);
+ (void) obstack_finish (&frchain_now->frch_obstack);
frchP = frchain_now;
know (frchP);
former_last_fragP = frchP->frch_last;
diff --git a/contrib/binutils/gas/subsegs.c b/contrib/binutils/gas/subsegs.c
index 0094764..066a2fd 100644
--- a/contrib/binutils/gas/subsegs.c
+++ b/contrib/binutils/gas/subsegs.c
@@ -67,7 +67,7 @@ subseg_change (register segT seg, register int subseg)
{
seginfo = xcalloc (1, sizeof (*seginfo));
seginfo->bfd_section = seg;
- bfd_set_section_userdata (stdoutput, seg, seginfo);
+ (void) bfd_set_section_userdata (stdoutput, seg, seginfo);
}
}
@@ -169,7 +169,7 @@ subseg_get (const char *segname, int force_new)
secptr->output_section = secptr;
seginfo = xcalloc (1, sizeof (*seginfo));
seginfo->bfd_section = secptr;
- bfd_set_section_userdata (stdoutput, secptr, seginfo);
+ (void) bfd_set_section_userdata (stdoutput, secptr, seginfo);
}
return secptr;
}
diff --git a/contrib/binutils/ld/emulparams/elf64bmip-defs.sh b/contrib/binutils/ld/emulparams/elf64bmip-defs.sh
index 110f892..73094be 100644
--- a/contrib/binutils/ld/emulparams/elf64bmip-defs.sh
+++ b/contrib/binutils/ld/emulparams/elf64bmip-defs.sh
@@ -1,3 +1,11 @@
. ${srcdir}/emulparams/elf32bmipn32-defs.sh
COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
-INITIAL_READONLY_SECTIONS=".MIPS.options : { *(.MIPS.options) }"
+
+# elf32bmipn32-defs.sh use .reginfo, n64 ABI should use .MIPS.options,
+# override INITIAL_READONLY_SECTIONS to do this.
+INITIAL_READONLY_SECTIONS=
+if test -z "${CREATE_SHLIB}"; then
+ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
+fi
+INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS}
+ .MIPS.options ${RELOCATING-0} : { *(.MIPS.options) }"
diff --git a/contrib/binutils/ld/ldexp.c b/contrib/binutils/ld/ldexp.c
index 4f1d61d..809b958 100644
--- a/contrib/binutils/ld/ldexp.c
+++ b/contrib/binutils/ld/ldexp.c
@@ -1112,9 +1112,9 @@ exp_get_fill (etree_type *tree, fill_type *def, char *name)
fill = xmalloc (4 + sizeof (*fill) - 1);
val = expld.result.value;
fill->data[0] = (val >> 24) & 0xff;
- fill->data[1] = (val >> 16) & 0xff;
- fill->data[2] = (val >> 8) & 0xff;
- fill->data[3] = (val >> 0) & 0xff;
+ __PAST_END(fill->data, 1) = (val >> 16) & 0xff;
+ __PAST_END(fill->data, 2) = (val >> 8) & 0xff;
+ __PAST_END(fill->data, 3) = (val >> 0) & 0xff;
fill->size = 4;
}
return fill;
diff --git a/contrib/binutils/ld/sysdep.h b/contrib/binutils/ld/sysdep.h
index 4c5e994..2ee2047 100644
--- a/contrib/binutils/ld/sysdep.h
+++ b/contrib/binutils/ld/sysdep.h
@@ -54,6 +54,9 @@ extern char *strrchr ();
/* for MAXPATHLEN */
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#ifndef __PAST_END
+# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+#endif
#endif
#ifdef PATH_MAX
# define LD_PATHMAX PATH_MAX
diff --git a/contrib/binutils/opcodes/i386-dis.c b/contrib/binutils/opcodes/i386-dis.c
index e84d314..10de45b 100644
--- a/contrib/binutils/opcodes/i386-dis.c
+++ b/contrib/binutils/opcodes/i386-dis.c
@@ -3203,7 +3203,7 @@ ckprefix (void)
rex_used = 0;
while (1)
{
- FETCH_DATA (the_info, codep + 1);
+ (void) FETCH_DATA (the_info, codep + 1);
newrex = 0;
switch (*codep)
{
@@ -3606,7 +3606,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
insn_codep = codep;
sizeflag = priv.orig_sizeflag;
- FETCH_DATA (info, codep + 1);
+ (void) FETCH_DATA (info, codep + 1);
two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
if (((prefixes & PREFIX_FWAIT)
@@ -3628,7 +3628,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
if (*codep == 0x0f)
{
unsigned char threebyte;
- FETCH_DATA (info, codep + 2);
+ (void) FETCH_DATA (info, codep + 2);
threebyte = *++codep;
dp = &dis386_twobyte[threebyte];
need_modrm = twobyte_has_modrm[*codep];
@@ -3639,7 +3639,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
codep++;
if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE)
{
- FETCH_DATA (info, codep + 2);
+ (void) FETCH_DATA (info, codep + 2);
op = *codep++;
switch (threebyte)
{
@@ -3724,7 +3724,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
}
else if (need_modrm)
{
- FETCH_DATA (info, codep + 1);
+ (void) FETCH_DATA (info, codep + 1);
modrm.mod = (*codep >> 6) & 3;
modrm.reg = (*codep >> 3) & 7;
modrm.rm = *codep & 7;
@@ -4890,7 +4890,7 @@ OP_E (int bytemode, int sizeflag)
if (base == 4)
{
havesib = 1;
- FETCH_DATA (the_info, codep + 1);
+ (void) FETCH_DATA (the_info, codep + 1);
index = (*codep >> 3) & 7;
if (address_mode == mode_64bit || index != 0x4)
/* When INDEX == 0x4 in 32 bit mode, SCALE is ignored. */
@@ -5147,7 +5147,7 @@ get64 (void)
unsigned int a;
unsigned int b;
- FETCH_DATA (the_info, codep + 8);
+ (void) FETCH_DATA (the_info, codep + 8);
a = *codep++ & 0xff;
a |= (*codep++ & 0xff) << 8;
a |= (*codep++ & 0xff) << 16;
@@ -5169,7 +5169,7 @@ get32 (void)
{
bfd_signed_vma x = 0;
- FETCH_DATA (the_info, codep + 4);
+ (void) FETCH_DATA (the_info, codep + 4);
x = *codep++ & (bfd_signed_vma) 0xff;
x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
@@ -5182,7 +5182,7 @@ get32s (void)
{
bfd_signed_vma x = 0;
- FETCH_DATA (the_info, codep + 4);
+ (void) FETCH_DATA (the_info, codep + 4);
x = *codep++ & (bfd_signed_vma) 0xff;
x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
@@ -5198,7 +5198,7 @@ get16 (void)
{
int x = 0;
- FETCH_DATA (the_info, codep + 2);
+ (void) FETCH_DATA (the_info, codep + 2);
x = *codep++ & 0xff;
x |= (*codep++ & 0xff) << 8;
return x;
@@ -6018,7 +6018,7 @@ OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
const char *mnemonic;
- FETCH_DATA (the_info, codep + 1);
+ (void) FETCH_DATA (the_info, codep + 1);
/* AMD 3DNow! instructions are specified by an opcode suffix in the
place where an 8-bit immediate would normally go. ie. the last
byte of the instruction. */
@@ -6054,7 +6054,7 @@ OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
unsigned int cmp_type;
- FETCH_DATA (the_info, codep + 1);
+ (void) FETCH_DATA (the_info, codep + 1);
obufp = obuf + strlen (obuf);
cmp_type = *codep++ & 0xff;
if (cmp_type < 8)
diff --git a/contrib/compiler-rt/CREDITS.TXT b/contrib/compiler-rt/CREDITS.TXT
index 8b07b82..818f4fa 100644
--- a/contrib/compiler-rt/CREDITS.TXT
+++ b/contrib/compiler-rt/CREDITS.TXT
@@ -19,3 +19,6 @@ W: http://www.auroraux.org
D: CMake'ify Compiler-RT build system
D: Maintain Solaris & AuroraUX ports of Compiler-RT
+N: Howard Hinnant
+E: hhinnant@apple.com
+D: Architect and primary author of compiler-rt
diff --git a/contrib/compiler-rt/LICENSE.TXT b/contrib/compiler-rt/LICENSE.TXT
index a5e1345..2552e8c 100644
--- a/contrib/compiler-rt/LICENSE.TXT
+++ b/contrib/compiler-rt/LICENSE.TXT
@@ -1,10 +1,21 @@
==============================================================================
-LLVM Release License
+compiler_rt License
==============================================================================
+
+The compiler_rt library is dual licensed under both the University of Illinois
+"BSD-Like" license and the MIT license. As a user of this code you may choose
+to use it under either license. As a contributor, you agree to allow your code
+to be used under both.
+
+Full text of the relevant licenses is included below.
+
+==============================================================================
+
University of Illinois/NCSA
Open Source License
-Copyright (c) 2003-2009 University of Illinois at Urbana-Champaign.
+Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
+
All rights reserved.
Developed by:
@@ -43,21 +54,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
==============================================================================
-Copyrights and Licenses for Third Party Software Distributed with LLVM:
-==============================================================================
-The LLVM software contains code written by third parties. Such software will
-have its own individual LICENSE.TXT file in the directory in which it appears.
-This file will describe the copyrights, license, and restrictions which apply
-to that code.
-
-The disclaimer of warranty in the University of Illinois Open Source License
-applies to all code in the LLVM Distribution, and nothing in any of the
-other licenses gives permission to use the names of the LLVM Team or the
-University of Illinois to endorse or promote products derived from this
-Software.
-
-The following pieces of software have additional or alternate copyrights,
-licenses, and/or restrictions:
-
-Program Directory
-------- ---------
+
+Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/contrib/compiler-rt/README.txt b/contrib/compiler-rt/README.txt
index ab389d2..cbeb10c 100644
--- a/contrib/compiler-rt/README.txt
+++ b/contrib/compiler-rt/README.txt
@@ -77,8 +77,12 @@ ti_int __modti3 (ti_int a, ti_int b); // a % b signed
su_int __umodsi3 (su_int a, su_int b); // a % b unsigned
du_int __umoddi3 (du_int a, du_int b); // a % b unsigned
tu_int __umodti3 (tu_int a, tu_int b); // a % b unsigned
-du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b
-tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); // a / b, *rem = a % b
+du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b unsigned
+tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); // a / b, *rem = a % b unsigned
+su_int __udivmodsi4(su_int a, su_int b, su_int* rem); // a / b, *rem = a % b unsigned
+si_int __divmodsi4(si_int a, si_int b, si_int* rem); // a / b, *rem = a % b signed
+
+
// Integral arithmetic with trapping overflow
diff --git a/contrib/compiler-rt/lib/abi.h b/contrib/compiler-rt/lib/abi.h
new file mode 100644
index 0000000..2534317
--- /dev/null
+++ b/contrib/compiler-rt/lib/abi.h
@@ -0,0 +1,23 @@
+/* ===------ abi.h - configuration header for compiler-rt -----------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file is a configuration header for compiler-rt.
+ * This file is not part of the interface of this library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+#if __ARM_EABI__
+# define ARM_EABI_FNALIAS(aeabi_name, name) \
+ void __aeabi_##aeabi_name() __attribute__((alias("__" #name)));
+# define COMPILER_RT_ABI __attribute__((pcs("aapcs")))
+#else
+# define ARM_EABI_FNALIAS(aeabi_name, name)
+# define COMPILER_RT_ABI
+#endif
diff --git a/contrib/compiler-rt/lib/absvdi2.c b/contrib/compiler-rt/lib/absvdi2.c
index 919afd1..9c5d4a2 100644
--- a/contrib/compiler-rt/lib/absvdi2.c
+++ b/contrib/compiler-rt/lib/absvdi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
*===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
#include <stdlib.h>
@@ -19,7 +20,7 @@
/* Effects: aborts if abs(x) < 0 */
-di_int
+COMPILER_RT_ABI di_int
__absvdi2(di_int a)
{
const int N = (int)(sizeof(di_int) * CHAR_BIT);
diff --git a/contrib/compiler-rt/lib/absvsi2.c b/contrib/compiler-rt/lib/absvsi2.c
index a2c8e3f..80a1a78 100644
--- a/contrib/compiler-rt/lib/absvsi2.c
+++ b/contrib/compiler-rt/lib/absvsi2.c
@@ -2,15 +2,16 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file implements __absvsi2 for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
- */
+ */
+#include "abi.h"
#include "int_lib.h"
#include <stdlib.h>
@@ -19,7 +20,7 @@
/* Effects: aborts if abs(x) < 0 */
-si_int
+COMPILER_RT_ABI si_int
__absvsi2(si_int a)
{
const int N = (int)(sizeof(si_int) * CHAR_BIT);
diff --git a/contrib/compiler-rt/lib/absvti2.c b/contrib/compiler-rt/lib/absvti2.c
index 0978122..9e73a26 100644
--- a/contrib/compiler-rt/lib/absvti2.c
+++ b/contrib/compiler-rt/lib/absvti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/adddf3.c b/contrib/compiler-rt/lib/adddf3.c
index 1ec43dc..3cc997b 100644
--- a/contrib/compiler-rt/lib/adddf3.c
+++ b/contrib/compiler-rt/lib/adddf3.c
@@ -1,21 +1,26 @@
-//===-- lib/adddf3.c - Double-precision addition and subtraction --*- C -*-===//
+//===-- lib/adddf3.c - Double-precision addition ------------------*- C -*-===//
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
-// This file implements double-precision soft-float addition and subtraction
-// with the IEEE-754 default rounding (to nearest, ties to even).
+// This file implements double-precision soft-float addition with the IEEE-754
+// default rounding (to nearest, ties to even).
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
+
#define DOUBLE_PRECISION
#include "fp_lib.h"
-fp_t __adddf3(fp_t a, fp_t b) {
+ARM_EABI_FNALIAS(dadd, adddf3);
+
+COMPILER_RT_ABI fp_t
+__adddf3(fp_t a, fp_t b) {
rep_t aRep = toRep(a);
rep_t bRep = toRep(b);
@@ -147,8 +152,3 @@ fp_t __adddf3(fp_t a, fp_t b) {
if (roundGuardSticky == 0x4) result += result & 1;
return fromRep(result);
}
-
-// Subtraction; flip the sign bit of b and add.
-fp_t __subdf3(fp_t a, fp_t b) {
- return __adddf3(a, fromRep(toRep(b) ^ signBit));
-}
diff --git a/contrib/compiler-rt/lib/addsf3.c b/contrib/compiler-rt/lib/addsf3.c
index fec14e8..20610ef 100644
--- a/contrib/compiler-rt/lib/addsf3.c
+++ b/contrib/compiler-rt/lib/addsf3.c
@@ -1,20 +1,24 @@
-//===-- lib/addsf3.c - Single-precision addition and subtraction --*- C -*-===//
+//===-- lib/addsf3.c - Single-precision addition ------------------*- C -*-===//
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
-// This file implements single-precision soft-float addition and subtraction
-// with the IEEE-754 default rounding (to nearest, ties to even).
+// This file implements single-precision soft-float addition with the IEEE-754
+// default rounding (to nearest, ties to even).
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
+
#define SINGLE_PRECISION
#include "fp_lib.h"
+ARM_EABI_FNALIAS(fadd, addsf3);
+
fp_t __addsf3(fp_t a, fp_t b) {
rep_t aRep = toRep(a);
@@ -147,18 +151,3 @@ fp_t __addsf3(fp_t a, fp_t b) {
if (roundGuardSticky == 0x4) result += result & 1;
return fromRep(result);
}
-
-// Subtraction; flip the sign bit of b and add.
-fp_t __subsf3(fp_t a, fp_t b) {
- return __addsf3(a, fromRep(toRep(b) ^ signBit));
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/contrib/compiler-rt/lib/addvdi3.c b/contrib/compiler-rt/lib/addvdi3.c
index 53ab102..51ad397 100644
--- a/contrib/compiler-rt/lib/addvdi3.c
+++ b/contrib/compiler-rt/lib/addvdi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
#include <stdlib.h>
@@ -19,7 +20,7 @@
/* Effects: aborts if a + b overflows */
-di_int
+COMPILER_RT_ABI di_int
__addvdi3(di_int a, di_int b)
{
di_int s = a + b;
diff --git a/contrib/compiler-rt/lib/addvsi3.c b/contrib/compiler-rt/lib/addvsi3.c
index 22cd315..c18f7bd 100644
--- a/contrib/compiler-rt/lib/addvsi3.c
+++ b/contrib/compiler-rt/lib/addvsi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
#include <stdlib.h>
@@ -19,7 +20,7 @@
/* Effects: aborts if a + b overflows */
-si_int
+COMPILER_RT_ABI si_int
__addvsi3(si_int a, si_int b)
{
si_int s = a + b;
diff --git a/contrib/compiler-rt/lib/addvti3.c b/contrib/compiler-rt/lib/addvti3.c
index 3df1a74..ba220f5 100644
--- a/contrib/compiler-rt/lib/addvti3.c
+++ b/contrib/compiler-rt/lib/addvti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/apple_versioning.c b/contrib/compiler-rt/lib/apple_versioning.c
index 0360026..e838d72 100644
--- a/contrib/compiler-rt/lib/apple_versioning.c
+++ b/contrib/compiler-rt/lib/apple_versioning.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*/
@@ -143,6 +143,147 @@ NOT_HERE_BEFORE_10_6(__gcc_qsub)
NOT_HERE_BEFORE_10_6(__trampoline_setup)
#endif /* __ppc__ */
+#if __arm__ && __DYNAMIC__
+ #define NOT_HERE_UNTIL_AFTER_4_3(sym) \
+ extern const char sym##_tmp1 __asm("$ld$hide$os3.0$_" #sym ); \
+ __attribute__((visibility("default"))) const char sym##_tmp1 = 0; \
+ extern const char sym##_tmp2 __asm("$ld$hide$os3.1$_" #sym ); \
+ __attribute__((visibility("default"))) const char sym##_tmp2 = 0; \
+ extern const char sym##_tmp3 __asm("$ld$hide$os3.2$_" #sym ); \
+ __attribute__((visibility("default"))) const char sym##_tmp3 = 0; \
+ extern const char sym##_tmp4 __asm("$ld$hide$os4.0$_" #sym ); \
+ __attribute__((visibility("default"))) const char sym##_tmp4 = 0; \
+ extern const char sym##_tmp5 __asm("$ld$hide$os4.1$_" #sym ); \
+ __attribute__((visibility("default"))) const char sym##_tmp5 = 0; \
+ extern const char sym##_tmp6 __asm("$ld$hide$os4.2$_" #sym ); \
+ __attribute__((visibility("default"))) const char sym##_tmp6 = 0; \
+ extern const char sym##_tmp7 __asm("$ld$hide$os4.3$_" #sym ); \
+ __attribute__((visibility("default"))) const char sym##_tmp7 = 0;
+
+NOT_HERE_UNTIL_AFTER_4_3(__absvdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__absvsi2)
+NOT_HERE_UNTIL_AFTER_4_3(__adddf3)
+NOT_HERE_UNTIL_AFTER_4_3(__adddf3vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__addsf3)
+NOT_HERE_UNTIL_AFTER_4_3(__addsf3vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__addvdi3)
+NOT_HERE_UNTIL_AFTER_4_3(__addvsi3)
+NOT_HERE_UNTIL_AFTER_4_3(__ashldi3)
+NOT_HERE_UNTIL_AFTER_4_3(__ashrdi3)
+NOT_HERE_UNTIL_AFTER_4_3(__bswapdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__bswapsi2)
+NOT_HERE_UNTIL_AFTER_4_3(__clzdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__clzsi2)
+NOT_HERE_UNTIL_AFTER_4_3(__cmpdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__ctzdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__ctzsi2)
+NOT_HERE_UNTIL_AFTER_4_3(__divdc3)
+NOT_HERE_UNTIL_AFTER_4_3(__divdf3)
+NOT_HERE_UNTIL_AFTER_4_3(__divdf3vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__divdi3)
+NOT_HERE_UNTIL_AFTER_4_3(__divsc3)
+NOT_HERE_UNTIL_AFTER_4_3(__divsf3)
+NOT_HERE_UNTIL_AFTER_4_3(__divsf3vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__divsi3)
+NOT_HERE_UNTIL_AFTER_4_3(__eqdf2)
+NOT_HERE_UNTIL_AFTER_4_3(__eqdf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__eqsf2)
+NOT_HERE_UNTIL_AFTER_4_3(__eqsf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__extendsfdf2)
+NOT_HERE_UNTIL_AFTER_4_3(__extendsfdf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__ffsdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__fixdfdi)
+NOT_HERE_UNTIL_AFTER_4_3(__fixdfsi)
+NOT_HERE_UNTIL_AFTER_4_3(__fixdfsivfp)
+NOT_HERE_UNTIL_AFTER_4_3(__fixsfdi)
+NOT_HERE_UNTIL_AFTER_4_3(__fixsfsi)
+NOT_HERE_UNTIL_AFTER_4_3(__fixsfsivfp)
+NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfdi)
+NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfsi)
+NOT_HERE_UNTIL_AFTER_4_3(__fixunsdfsivfp)
+NOT_HERE_UNTIL_AFTER_4_3(__fixunssfdi)
+NOT_HERE_UNTIL_AFTER_4_3(__fixunssfsi)
+NOT_HERE_UNTIL_AFTER_4_3(__fixunssfsivfp)
+NOT_HERE_UNTIL_AFTER_4_3(__floatdidf)
+NOT_HERE_UNTIL_AFTER_4_3(__floatdisf)
+NOT_HERE_UNTIL_AFTER_4_3(__floatsidf)
+NOT_HERE_UNTIL_AFTER_4_3(__floatsidfvfp)
+NOT_HERE_UNTIL_AFTER_4_3(__floatsisf)
+NOT_HERE_UNTIL_AFTER_4_3(__floatsisfvfp)
+NOT_HERE_UNTIL_AFTER_4_3(__floatundidf)
+NOT_HERE_UNTIL_AFTER_4_3(__floatundisf)
+NOT_HERE_UNTIL_AFTER_4_3(__floatunsidf)
+NOT_HERE_UNTIL_AFTER_4_3(__floatunsisf)
+NOT_HERE_UNTIL_AFTER_4_3(__floatunssidfvfp)
+NOT_HERE_UNTIL_AFTER_4_3(__floatunssisfvfp)
+NOT_HERE_UNTIL_AFTER_4_3(__gedf2)
+NOT_HERE_UNTIL_AFTER_4_3(__gedf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__gesf2)
+NOT_HERE_UNTIL_AFTER_4_3(__gesf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__gtdf2)
+NOT_HERE_UNTIL_AFTER_4_3(__gtdf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__gtsf2)
+NOT_HERE_UNTIL_AFTER_4_3(__gtsf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__ledf2)
+NOT_HERE_UNTIL_AFTER_4_3(__ledf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__lesf2)
+NOT_HERE_UNTIL_AFTER_4_3(__lesf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__lshrdi3)
+NOT_HERE_UNTIL_AFTER_4_3(__ltdf2)
+NOT_HERE_UNTIL_AFTER_4_3(__ltdf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__ltsf2)
+NOT_HERE_UNTIL_AFTER_4_3(__ltsf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__moddi3)
+NOT_HERE_UNTIL_AFTER_4_3(__modsi3)
+NOT_HERE_UNTIL_AFTER_4_3(__muldc3)
+NOT_HERE_UNTIL_AFTER_4_3(__muldf3)
+NOT_HERE_UNTIL_AFTER_4_3(__muldf3vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__muldi3)
+NOT_HERE_UNTIL_AFTER_4_3(__mulsc3)
+NOT_HERE_UNTIL_AFTER_4_3(__mulsf3)
+NOT_HERE_UNTIL_AFTER_4_3(__mulsf3vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__mulvdi3)
+NOT_HERE_UNTIL_AFTER_4_3(__mulvsi3)
+NOT_HERE_UNTIL_AFTER_4_3(__nedf2)
+NOT_HERE_UNTIL_AFTER_4_3(__nedf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__negdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__negvdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__negvsi2)
+NOT_HERE_UNTIL_AFTER_4_3(__nesf2)
+NOT_HERE_UNTIL_AFTER_4_3(__nesf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__paritydi2)
+NOT_HERE_UNTIL_AFTER_4_3(__paritysi2)
+NOT_HERE_UNTIL_AFTER_4_3(__popcountdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__popcountsi2)
+NOT_HERE_UNTIL_AFTER_4_3(__powidf2)
+NOT_HERE_UNTIL_AFTER_4_3(__powisf2)
+NOT_HERE_UNTIL_AFTER_4_3(__subdf3)
+NOT_HERE_UNTIL_AFTER_4_3(__subdf3vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__subsf3)
+NOT_HERE_UNTIL_AFTER_4_3(__subsf3vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__subvdi3)
+NOT_HERE_UNTIL_AFTER_4_3(__subvsi3)
+NOT_HERE_UNTIL_AFTER_4_3(__truncdfsf2)
+NOT_HERE_UNTIL_AFTER_4_3(__truncdfsf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__ucmpdi2)
+NOT_HERE_UNTIL_AFTER_4_3(__udivdi3)
+NOT_HERE_UNTIL_AFTER_4_3(__udivmoddi4)
+NOT_HERE_UNTIL_AFTER_4_3(__udivsi3)
+NOT_HERE_UNTIL_AFTER_4_3(__umoddi3)
+NOT_HERE_UNTIL_AFTER_4_3(__umodsi3)
+NOT_HERE_UNTIL_AFTER_4_3(__unorddf2)
+NOT_HERE_UNTIL_AFTER_4_3(__unorddf2vfp)
+NOT_HERE_UNTIL_AFTER_4_3(__unordsf2)
+NOT_HERE_UNTIL_AFTER_4_3(__unordsf2vfp)
+
+NOT_HERE_UNTIL_AFTER_4_3(__divmodsi4)
+NOT_HERE_UNTIL_AFTER_4_3(__udivmodsi4)
+#endif // __arm__ && __DYNAMIC__
+
+
+
+
+
#else /* !__APPLE__ */
extern int avoid_empty_file;
diff --git a/contrib/compiler-rt/lib/arm/adddf3vfp.S b/contrib/compiler-rt/lib/arm/adddf3vfp.S
index 5e705e3..cced1e0 100644
--- a/contrib/compiler-rt/lib/arm/adddf3vfp.S
+++ b/contrib/compiler-rt/lib/arm/adddf3vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/addsf3vfp.S b/contrib/compiler-rt/lib/arm/addsf3vfp.S
index 36d509c..b747528 100644
--- a/contrib/compiler-rt/lib/arm/addsf3vfp.S
+++ b/contrib/compiler-rt/lib/arm/addsf3vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/bswapdi2.S b/contrib/compiler-rt/lib/arm/bswapdi2.S
index d3ca33a..a0283e1 100644
--- a/contrib/compiler-rt/lib/arm/bswapdi2.S
+++ b/contrib/compiler-rt/lib/arm/bswapdi2.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/bswapsi2.S b/contrib/compiler-rt/lib/arm/bswapsi2.S
index 0a0c073..4c3af1f 100644
--- a/contrib/compiler-rt/lib/arm/bswapsi2.S
+++ b/contrib/compiler-rt/lib/arm/bswapsi2.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/comparesf2.S b/contrib/compiler-rt/lib/arm/comparesf2.S
index f21e0bcd..ee18203 100644
--- a/contrib/compiler-rt/lib/arm/comparesf2.S
+++ b/contrib/compiler-rt/lib/arm/comparesf2.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
diff --git a/contrib/compiler-rt/lib/arm/divdf3vfp.S b/contrib/compiler-rt/lib/arm/divdf3vfp.S
index e43baa3..74ef0ea 100644
--- a/contrib/compiler-rt/lib/arm/divdf3vfp.S
+++ b/contrib/compiler-rt/lib/arm/divdf3vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/divmodsi4.S b/contrib/compiler-rt/lib/arm/divmodsi4.S
new file mode 100644
index 0000000..cec39a7
--- /dev/null
+++ b/contrib/compiler-rt/lib/arm/divmodsi4.S
@@ -0,0 +1,47 @@
+/*===-- divmodsi4.S - 32-bit signed integer divide and modulus ------------===//
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===//
+ *
+ * This file implements the __divmodsi4 (32-bit signed integer divide and
+ * modulus) function for the ARM architecture. A naive digit-by-digit
+ * computation is employed for simplicity.
+ *
+ *===----------------------------------------------------------------------===*/
+
+#include "../assembly.h"
+
+#define ESTABLISH_FRAME \
+ push {r4-r7, lr} ;\
+ add r7, sp, #12
+#define CLEAR_FRAME_AND_RETURN \
+ pop {r4-r7, pc}
+
+.syntax unified
+.align 3
+DEFINE_COMPILERRT_FUNCTION(__divmodsi4)
+ ESTABLISH_FRAME
+// Set aside the sign of the quotient and modulus, and the address for the
+// modulus.
+ eor r4, r0, r1
+ mov r5, r0
+ mov r6, r2
+// Take the absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31).
+ eor ip, r0, r0, asr #31
+ eor lr, r1, r1, asr #31
+ sub r0, ip, r0, asr #31
+ sub r1, lr, r1, asr #31
+// Unsigned divmod:
+ bl SYMBOL_NAME(__udivmodsi4)
+// Apply the sign of quotient and modulus
+ ldr r1, [r6]
+ eor r0, r0, r4, asr #31
+ eor r1, r1, r5, asr #31
+ sub r0, r0, r4, asr #31
+ sub r1, r1, r5, asr #31
+ str r1, [r6]
+ CLEAR_FRAME_AND_RETURN
diff --git a/contrib/compiler-rt/lib/arm/divsf3vfp.S b/contrib/compiler-rt/lib/arm/divsf3vfp.S
index d96c930..9eefcf31e 100644
--- a/contrib/compiler-rt/lib/arm/divsf3vfp.S
+++ b/contrib/compiler-rt/lib/arm/divsf3vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/divsi3.S b/contrib/compiler-rt/lib/arm/divsi3.S
new file mode 100644
index 0000000..00e6181
--- /dev/null
+++ b/contrib/compiler-rt/lib/arm/divsi3.S
@@ -0,0 +1,41 @@
+/*===-- divsi3.S - 32-bit signed integer divide ---------------------------===//
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===//
+ *
+ * This file implements the __divsi3 (32-bit signed integer divide) function
+ * for the ARM architecture as a wrapper around the unsigned routine.
+ *
+ *===----------------------------------------------------------------------===*/
+
+#include "../assembly.h"
+
+#define ESTABLISH_FRAME \
+ push {r4, r7, lr} ;\
+ add r7, sp, #4
+#define CLEAR_FRAME_AND_RETURN \
+ pop {r4, r7, pc}
+
+.syntax unified
+.align 3
+// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine.
+DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_idiv, __divsi3)
+DEFINE_COMPILERRT_FUNCTION(__divsi3)
+ ESTABLISH_FRAME
+// Set aside the sign of the quotient.
+ eor r4, r0, r1
+// Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31).
+ eor r2, r0, r0, asr #31
+ eor r3, r1, r1, asr #31
+ sub r0, r2, r0, asr #31
+ sub r1, r3, r1, asr #31
+// abs(a) / abs(b)
+ bl SYMBOL_NAME(__udivsi3)
+// Apply sign of quotient to result and return.
+ eor r0, r0, r4, asr #31
+ sub r0, r0, r4, asr #31
+ CLEAR_FRAME_AND_RETURN
diff --git a/contrib/compiler-rt/lib/arm/eqdf2vfp.S b/contrib/compiler-rt/lib/arm/eqdf2vfp.S
index d4384ec..2998a76 100644
--- a/contrib/compiler-rt/lib/arm/eqdf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/eqdf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/eqsf2vfp.S b/contrib/compiler-rt/lib/arm/eqsf2vfp.S
index 07355a3..927566e 100644
--- a/contrib/compiler-rt/lib/arm/eqsf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/eqsf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S b/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S
index 4343a7e..b1aa88e 100644
--- a/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/extendsfdf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/fixdfsivfp.S b/contrib/compiler-rt/lib/arm/fixdfsivfp.S
index 30458cc..0285a17 100644
--- a/contrib/compiler-rt/lib/arm/fixdfsivfp.S
+++ b/contrib/compiler-rt/lib/arm/fixdfsivfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/fixsfsivfp.S b/contrib/compiler-rt/lib/arm/fixsfsivfp.S
index ce6f18e..d05ba74 100644
--- a/contrib/compiler-rt/lib/arm/fixsfsivfp.S
+++ b/contrib/compiler-rt/lib/arm/fixsfsivfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S b/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S
index 7e766c0..ddb703c 100644
--- a/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S
+++ b/contrib/compiler-rt/lib/arm/fixunsdfsivfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/fixunssfsivfp.S b/contrib/compiler-rt/lib/arm/fixunssfsivfp.S
index ba2344f..afbb64f 100644
--- a/contrib/compiler-rt/lib/arm/fixunssfsivfp.S
+++ b/contrib/compiler-rt/lib/arm/fixunssfsivfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/floatsidfvfp.S b/contrib/compiler-rt/lib/arm/floatsidfvfp.S
index 5ed4ace..fe3366a 100644
--- a/contrib/compiler-rt/lib/arm/floatsidfvfp.S
+++ b/contrib/compiler-rt/lib/arm/floatsidfvfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/floatsisfvfp.S b/contrib/compiler-rt/lib/arm/floatsisfvfp.S
index 0114c78..5b41610 100644
--- a/contrib/compiler-rt/lib/arm/floatsisfvfp.S
+++ b/contrib/compiler-rt/lib/arm/floatsisfvfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/floatunssidfvfp.S b/contrib/compiler-rt/lib/arm/floatunssidfvfp.S
index d1bfe3a..9b22a6f 100644
--- a/contrib/compiler-rt/lib/arm/floatunssidfvfp.S
+++ b/contrib/compiler-rt/lib/arm/floatunssidfvfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/floatunssisfvfp.S b/contrib/compiler-rt/lib/arm/floatunssisfvfp.S
index 0b73577..44d5e93 100644
--- a/contrib/compiler-rt/lib/arm/floatunssisfvfp.S
+++ b/contrib/compiler-rt/lib/arm/floatunssisfvfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/gedf2vfp.S b/contrib/compiler-rt/lib/arm/gedf2vfp.S
index 6ab856f..9993f52 100644
--- a/contrib/compiler-rt/lib/arm/gedf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/gedf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/gesf2vfp.S b/contrib/compiler-rt/lib/arm/gesf2vfp.S
index b00d821..9ce1682 100644
--- a/contrib/compiler-rt/lib/arm/gesf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/gesf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/gtdf2vfp.S b/contrib/compiler-rt/lib/arm/gtdf2vfp.S
index 65594c7..8a049c8 100644
--- a/contrib/compiler-rt/lib/arm/gtdf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/gtdf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/gtsf2vfp.S b/contrib/compiler-rt/lib/arm/gtsf2vfp.S
index 53ef2a0..1ffe1ec 100644
--- a/contrib/compiler-rt/lib/arm/gtsf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/gtsf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/ledf2vfp.S b/contrib/compiler-rt/lib/arm/ledf2vfp.S
index 327a7d5..a04d0f2 100644
--- a/contrib/compiler-rt/lib/arm/ledf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/ledf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/lesf2vfp.S b/contrib/compiler-rt/lib/arm/lesf2vfp.S
index b7e05da..3011200 100644
--- a/contrib/compiler-rt/lib/arm/lesf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/lesf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/ltdf2vfp.S b/contrib/compiler-rt/lib/arm/ltdf2vfp.S
index 55dfd80..87144a8 100644
--- a/contrib/compiler-rt/lib/arm/ltdf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/ltdf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/ltsf2vfp.S b/contrib/compiler-rt/lib/arm/ltsf2vfp.S
index 3816a71..ca06ae2 100644
--- a/contrib/compiler-rt/lib/arm/ltsf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/ltsf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/modsi3.S b/contrib/compiler-rt/lib/arm/modsi3.S
index 64a3afd..a4cd2ee 100644
--- a/contrib/compiler-rt/lib/arm/modsi3.S
+++ b/contrib/compiler-rt/lib/arm/modsi3.S
@@ -1,36 +1,39 @@
-//===-------- modsi3.S - Implement modsi3 ---------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
+/*===-- modsi3.S - 32-bit signed integer modulus --------------------------===//
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===//
+ *
+ * This file implements the __modsi3 (32-bit signed integer modulus) function
+ * for the ARM architecture as a wrapper around the unsigned routine.
+ *
+ *===----------------------------------------------------------------------===*/
#include "../assembly.h"
-//
-// extern int32_t __modsi3(int32_t a, int32_t b);
-//
-// Returns the remainder when dividing two 32-bit signed integers.
-// Conceptually, the function is: { return a - (a / b) * b; }
-// But if you write that in C, llvm compiles it to a call to __modsi3...
-//
- .align 2
-DEFINE_COMPILERRT_FUNCTION(__modsi3)
- push {r4, r5, r7, lr}
- add r7, sp, #8 // set stack frame
- mov r5, r0 // save a
- mov r4, r1 // save b
- bl ___divsi3 // compute a/b
-#if __ARM_ARCH_7A__
- mls r0, r4, r0, r5 // mulitple result * b and subtract from a
-#else
- // before armv7, does not have "mls" instruction
- mul r3, r0, r4 // multiple result * b
- sub r0, r5, r3 // a - result
-#endif
- pop {r4, r5, r7, pc}
-
-
+#define ESTABLISH_FRAME \
+ push {r4, r7, lr} ;\
+ add r7, sp, #4
+#define CLEAR_FRAME_AND_RETURN \
+ pop {r4, r7, pc}
+.syntax unified
+.align 3
+DEFINE_COMPILERRT_FUNCTION(__modsi3)
+ ESTABLISH_FRAME
+ // Set aside the sign of the dividend.
+ mov r4, r0
+ // Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31).
+ eor r2, r0, r0, asr #31
+ eor r3, r1, r1, asr #31
+ sub r0, r2, r0, asr #31
+ sub r1, r3, r1, asr #31
+ // abs(a) % abs(b)
+ bl SYMBOL_NAME(__umodsi3)
+ // Apply sign of dividend to result and return.
+ eor r0, r0, r4, asr #31
+ sub r0, r0, r4, asr #31
+ CLEAR_FRAME_AND_RETURN
diff --git a/contrib/compiler-rt/lib/arm/muldf3vfp.S b/contrib/compiler-rt/lib/arm/muldf3vfp.S
index cb503d3..96bba06 100644
--- a/contrib/compiler-rt/lib/arm/muldf3vfp.S
+++ b/contrib/compiler-rt/lib/arm/muldf3vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/mulsf3vfp.S b/contrib/compiler-rt/lib/arm/mulsf3vfp.S
index 49b4d1d..c56991d 100644
--- a/contrib/compiler-rt/lib/arm/mulsf3vfp.S
+++ b/contrib/compiler-rt/lib/arm/mulsf3vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/nedf2vfp.S b/contrib/compiler-rt/lib/arm/nedf2vfp.S
index 813864e..a02b09c 100644
--- a/contrib/compiler-rt/lib/arm/nedf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/nedf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/negdf2vfp.S b/contrib/compiler-rt/lib/arm/negdf2vfp.S
index 80139754..100f4fd 100644
--- a/contrib/compiler-rt/lib/arm/negdf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/negdf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/negsf2vfp.S b/contrib/compiler-rt/lib/arm/negsf2vfp.S
index 243c086..f96c8ad 100644
--- a/contrib/compiler-rt/lib/arm/negsf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/negsf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/nesf2vfp.S b/contrib/compiler-rt/lib/arm/nesf2vfp.S
index d470afa..d620549 100644
--- a/contrib/compiler-rt/lib/arm/nesf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/nesf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S b/contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S
index 25404cd..7f441db 100644
--- a/contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S
+++ b/contrib/compiler-rt/lib/arm/restore_vfp_d8_d15_regs.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S b/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S
index 92de61b..fbd21ba 100644
--- a/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S
+++ b/contrib/compiler-rt/lib/arm/save_vfp_d8_d15_regs.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/softfloat-alias.list b/contrib/compiler-rt/lib/arm/softfloat-alias.list
new file mode 100644
index 0000000..cc6a4b3c
--- /dev/null
+++ b/contrib/compiler-rt/lib/arm/softfloat-alias.list
@@ -0,0 +1,21 @@
+#
+# These are soft float functions which can be
+# aliased to the *vfp functions on arm processors
+# that support floating point instructions.
+#
+___adddf3vfp ___adddf3
+___addsf3vfp ___addsf3
+___divdf3vfp ___divdf3
+___divsf3vfp ___divsf3
+___extendsfdf2vfp ___extendsfdf2
+___fixdfsivfp ___fixdfsi
+___fixsfsivfp ___fixsfsi
+___floatsidfvfp ___floatsidf
+___floatsisfvfp ___floatsisf
+___muldf3vfp ___muldf3
+___mulsf3vfp ___mulsf3
+___subdf3vfp ___subdf3
+___subsf3vfp ___subsf3
+___truncdfsf2vfp ___truncdfsf2
+___floatunssidfvfp ___floatunsidf
+___floatunssisfvfp ___floatunsisf
diff --git a/contrib/compiler-rt/lib/arm/subdf3vfp.S b/contrib/compiler-rt/lib/arm/subdf3vfp.S
index 8841600..ff53b30 100644
--- a/contrib/compiler-rt/lib/arm/subdf3vfp.S
+++ b/contrib/compiler-rt/lib/arm/subdf3vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/subsf3vfp.S b/contrib/compiler-rt/lib/arm/subsf3vfp.S
index 4ead9c23..238f3f0 100644
--- a/contrib/compiler-rt/lib/arm/subsf3vfp.S
+++ b/contrib/compiler-rt/lib/arm/subsf3vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/switch16.S b/contrib/compiler-rt/lib/arm/switch16.S
index 05c7b98..e8f08c4 100644
--- a/contrib/compiler-rt/lib/arm/switch16.S
+++ b/contrib/compiler-rt/lib/arm/switch16.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/switch32.S b/contrib/compiler-rt/lib/arm/switch32.S
index a127cb7..7008fcc 100644
--- a/contrib/compiler-rt/lib/arm/switch32.S
+++ b/contrib/compiler-rt/lib/arm/switch32.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/switch8.S b/contrib/compiler-rt/lib/arm/switch8.S
index d05f6ac..e784b40 100644
--- a/contrib/compiler-rt/lib/arm/switch8.S
+++ b/contrib/compiler-rt/lib/arm/switch8.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/switchu8.S b/contrib/compiler-rt/lib/arm/switchu8.S
index faffddb..19bed2f 100644
--- a/contrib/compiler-rt/lib/arm/switchu8.S
+++ b/contrib/compiler-rt/lib/arm/switchu8.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/sync_synchronize.S b/contrib/compiler-rt/lib/arm/sync_synchronize.S
index 76fdab1..06dade9 100644
--- a/contrib/compiler-rt/lib/arm/sync_synchronize.S
+++ b/contrib/compiler-rt/lib/arm/sync_synchronize.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S b/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S
index 5725e25..6e55c7f 100644
--- a/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/truncdfsf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/udivmodsi4.S b/contrib/compiler-rt/lib/arm/udivmodsi4.S
new file mode 100644
index 0000000..d164a75
--- /dev/null
+++ b/contrib/compiler-rt/lib/arm/udivmodsi4.S
@@ -0,0 +1,80 @@
+/*===-- udivmodsi4.S - 32-bit unsigned integer divide and modulus ---------===//
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===//
+ *
+ * This file implements the __udivmodsi4 (32-bit unsigned integer divide and
+ * modulus) function for the ARM architecture. A naive digit-by-digit
+ * computation is employed for simplicity.
+ *
+ *===----------------------------------------------------------------------===*/
+
+#include "../assembly.h"
+
+#define ESTABLISH_FRAME \
+ push {r4, r7, lr} ;\
+ add r7, sp, #4
+#define CLEAR_FRAME_AND_RETURN \
+ pop {r4, r7, pc}
+
+#define a r0
+#define b r1
+#define i r3
+#define r r4
+#define q ip
+#define one lr
+
+.syntax unified
+.align 3
+DEFINE_COMPILERRT_FUNCTION(__udivmodsi4)
+// We use a simple digit by digit algorithm; before we get into the actual
+// divide loop, we must calculate the left-shift amount necessary to align
+// the MSB of the divisor with that of the dividend (If this shift is
+// negative, then the result is zero, and we early out). We also conjure a
+// bit mask of 1 to use in constructing the quotient, and initialize the
+// quotient to zero.
+ ESTABLISH_FRAME
+ clz r4, a
+ tst b, b // detect divide-by-zero
+ clz r3, b
+ mov q, #0
+ beq LOCAL_LABEL(return) // return 0 if b is zero.
+ mov one, #1
+ subs i, r3, r4
+ blt LOCAL_LABEL(return) // return 0 if MSB(a) < MSB(b)
+
+LOCAL_LABEL(mainLoop):
+// This loop basically implements the following:
+//
+// do {
+// if (a >= b << i) {
+// a -= b << i;
+// q |= 1 << i;
+// if (a == 0) break;
+// }
+// } while (--i)
+//
+// Note that this does not perform the final iteration (i == 0); by doing it
+// this way, we can merge the two branches which is a substantial win for
+// such a tight loop on current ARM architectures.
+ subs r, a, b, lsl i
+ orrhs q, q,one, lsl i
+ movhs a, r
+ subsne i, i, #1
+ bhi LOCAL_LABEL(mainLoop)
+
+// Do the final test subtraction and update of quotient (i == 0), as it is
+// not performed in the main loop.
+ subs r, a, b
+ orrhs q, #1
+ movhs a, r
+
+LOCAL_LABEL(return):
+// Store the remainder, and move the quotient to r0, then return.
+ str a, [r2]
+ mov r0, q
+ CLEAR_FRAME_AND_RETURN
diff --git a/contrib/compiler-rt/lib/arm/udivsi3.S b/contrib/compiler-rt/lib/arm/udivsi3.S
new file mode 100644
index 0000000..6d89665
--- /dev/null
+++ b/contrib/compiler-rt/lib/arm/udivsi3.S
@@ -0,0 +1,80 @@
+/*===-- udivsi3.S - 32-bit unsigned integer divide ------------------------===//
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===//
+ *
+ * This file implements the __udivsi3 (32-bit unsigned integer divide)
+ * function for the ARM architecture. A naive digit-by-digit computation is
+ * employed for simplicity.
+ *
+ *===----------------------------------------------------------------------===*/
+
+#include "../assembly.h"
+
+#define ESTABLISH_FRAME \
+ push {r7, lr} ;\
+ mov r7, sp
+#define CLEAR_FRAME_AND_RETURN \
+ pop {r7, pc}
+
+#define a r0
+#define b r1
+#define r r2
+#define i r3
+#define q ip
+#define one lr
+
+.syntax unified
+.align 3
+// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine.
+DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3)
+DEFINE_COMPILERRT_FUNCTION(__udivsi3)
+// We use a simple digit by digit algorithm; before we get into the actual
+// divide loop, we must calculate the left-shift amount necessary to align
+// the MSB of the divisor with that of the dividend (If this shift is
+// negative, then the result is zero, and we early out). We also conjure a
+// bit mask of 1 to use in constructing the quotient, and initialize the
+// quotient to zero.
+ ESTABLISH_FRAME
+ clz r2, a
+ tst b, b // detect divide-by-zero
+ clz r3, b
+ mov q, #0
+ beq LOCAL_LABEL(return) // return 0 if b is zero.
+ mov one, #1
+ subs i, r3, r2
+ blt LOCAL_LABEL(return) // return 0 if MSB(a) < MSB(b)
+
+LOCAL_LABEL(mainLoop):
+// This loop basically implements the following:
+//
+// do {
+// if (a >= b << i) {
+// a -= b << i;
+// q |= 1 << i;
+// if (a == 0) break;
+// }
+// } while (--i)
+//
+// Note that this does not perform the final iteration (i == 0); by doing it
+// this way, we can merge the two branches which is a substantial win for
+// such a tight loop on current ARM architectures.
+ subs r, a, b, lsl i
+ orrhs q, q,one, lsl i
+ movhs a, r
+ subsne i, i, #1
+ bhi LOCAL_LABEL(mainLoop)
+
+// Do the final test subtraction and update of quotient (i == 0), as it is
+// not performed in the main loop.
+ subs r, a, b
+ orrhs q, #1
+
+LOCAL_LABEL(return):
+// Move the quotient to r0 and return.
+ mov r0, q
+ CLEAR_FRAME_AND_RETURN
diff --git a/contrib/compiler-rt/lib/arm/umodsi3.S b/contrib/compiler-rt/lib/arm/umodsi3.S
new file mode 100644
index 0000000..3a2ab2b
--- /dev/null
+++ b/contrib/compiler-rt/lib/arm/umodsi3.S
@@ -0,0 +1,58 @@
+/*===-- umodsi3.S - 32-bit unsigned integer modulus -----------------------===//
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ *===----------------------------------------------------------------------===//
+ *
+ * This file implements the __umodsi3 (32-bit unsigned integer modulus)
+ * function for the ARM architecture. A naive digit-by-digit computation is
+ * employed for simplicity.
+ *
+ *===----------------------------------------------------------------------===*/
+
+#include "../assembly.h"
+
+#define a r0
+#define b r1
+#define r r2
+#define i r3
+
+.syntax unified
+.align 3
+DEFINE_COMPILERRT_FUNCTION(__umodsi3)
+// We use a simple digit by digit algorithm; before we get into the actual
+// divide loop, we must calculate the left-shift amount necessary to align
+// the MSB of the divisor with that of the dividend.
+ clz r2, a
+ tst b, b // detect b == 0
+ clz r3, b
+ bxeq lr // return a if b == 0
+ subs i, r3, r2
+ bxlt lr // return a if MSB(a) < MSB(b)
+
+LOCAL_LABEL(mainLoop):
+// This loop basically implements the following:
+//
+// do {
+// if (a >= b << i) {
+// a -= b << i;
+// if (a == 0) break;
+// }
+// } while (--i)
+//
+// Note that this does not perform the final iteration (i == 0); by doing it
+// this way, we can merge the two branches which is a substantial win for
+// such a tight loop on current ARM architectures.
+ subs r, a, b, lsl i
+ movhs a, r
+ subsne i, i, #1
+ bhi LOCAL_LABEL(mainLoop)
+
+// Do the final test subtraction and update of remainder (i == 0), as it is
+// not performed in the main loop.
+ subs r, a, b
+ movhs a, r
+ bx lr
diff --git a/contrib/compiler-rt/lib/arm/unorddf2vfp.S b/contrib/compiler-rt/lib/arm/unorddf2vfp.S
index de00b07..9b52131 100644
--- a/contrib/compiler-rt/lib/arm/unorddf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/unorddf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/arm/unordsf2vfp.S b/contrib/compiler-rt/lib/arm/unordsf2vfp.S
index ab291a8..e486533 100644
--- a/contrib/compiler-rt/lib/arm/unordsf2vfp.S
+++ b/contrib/compiler-rt/lib/arm/unordsf2vfp.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/ashldi3.c b/contrib/compiler-rt/lib/ashldi3.c
index 993f71c..adce4e2 100644
--- a/contrib/compiler-rt/lib/ashldi3.c
+++ b/contrib/compiler-rt/lib/ashldi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,9 @@
/* Precondition: 0 <= b < bits_in_dword */
-di_int
+ARM_EABI_FNALIAS(llsl, ashldi3);
+
+COMPILER_RT_ABI di_int
__ashldi3(di_int a, si_int b)
{
const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT);
diff --git a/contrib/compiler-rt/lib/ashlti3.c b/contrib/compiler-rt/lib/ashlti3.c
index 317de66..7042b53 100644
--- a/contrib/compiler-rt/lib/ashlti3.c
+++ b/contrib/compiler-rt/lib/ashlti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/ashrdi3.c b/contrib/compiler-rt/lib/ashrdi3.c
index 8e27a11..03692a3 100644
--- a/contrib/compiler-rt/lib/ashrdi3.c
+++ b/contrib/compiler-rt/lib/ashrdi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,9 @@
/* Precondition: 0 <= b < bits_in_dword */
-di_int
+ARM_EABI_FNALIAS(lasr, ashrdi3);
+
+COMPILER_RT_ABI di_int
__ashrdi3(di_int a, si_int b)
{
const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT);
diff --git a/contrib/compiler-rt/lib/ashrti3.c b/contrib/compiler-rt/lib/ashrti3.c
index 4eab247..4d16230 100644
--- a/contrib/compiler-rt/lib/ashrti3.c
+++ b/contrib/compiler-rt/lib/ashrti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/assembly.h b/contrib/compiler-rt/lib/assembly.h
index c124e19..0ce83ac 100644
--- a/contrib/compiler-rt/lib/assembly.h
+++ b/contrib/compiler-rt/lib/assembly.h
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -22,33 +22,48 @@
#define SEPARATOR ;
#endif
-/* We can't use __USER_LABEL_PREFIX__ here, it isn't possible to concatenate the
- *values* of two macros. This is quite brittle, though. */
#if defined(__APPLE__)
-#define SYMBOL_NAME(name) _##name
+#define HIDDEN_DIRECTIVE .private_extern
+#define LOCAL_LABEL(name) L_##name
#else
-#define SYMBOL_NAME(name) name
+#define HIDDEN_DIRECTIVE .hidden
+#define LOCAL_LABEL(name) .L_##name
#endif
+#define GLUE2(a, b) a ## b
+#define GLUE(a, b) GLUE2(a, b)
+#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
+
#ifdef VISIBILITY_HIDDEN
-#define DEFINE_COMPILERRT_FUNCTION(name) \
- .globl SYMBOL_NAME(name) SEPARATOR \
- .hidden SYMBOL_NAME(name) SEPARATOR \
+#define DEFINE_COMPILERRT_FUNCTION(name) \
+ .globl SYMBOL_NAME(name) SEPARATOR \
+ HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#else
-#define DEFINE_COMPILERRT_FUNCTION(name) \
- .globl SYMBOL_NAME(name) SEPARATOR \
+#define DEFINE_COMPILERRT_FUNCTION(name) \
+ .globl SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#endif
-#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
- .globl SYMBOL_NAME(name) SEPARATOR \
- .hidden SYMBOL_NAME(name) SEPARATOR \
+#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
+ .globl SYMBOL_NAME(name) SEPARATOR \
+ HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \
SYMBOL_NAME(name):
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION_UNMANGLED(name) \
- .globl name SEPARATOR \
- .hidden name SEPARATOR \
+ .globl name SEPARATOR \
+ HIDDEN_DIRECTIVE name SEPARATOR \
name:
+#define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \
+ .globl SYMBOL_NAME(name) SEPARATOR \
+ .set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR
+
+#if defined (__ARM_EABI__)
+# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name) \
+ DEFINE_COMPILERRT_FUNCTION_ALIAS(aeabi_name, name)
+#else
+# define DEFINE_AEABI_FUNCTION_ALIAS(aeabi_name, name)
+#endif
+
#endif /* COMPILERRT_ASSEMBLY_H */
diff --git a/contrib/compiler-rt/lib/clear_cache.c b/contrib/compiler-rt/lib/clear_cache.c
index 43db37a..7b59a7f 100644
--- a/contrib/compiler-rt/lib/clear_cache.c
+++ b/contrib/compiler-rt/lib/clear_cache.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*/
diff --git a/contrib/compiler-rt/lib/clzdi2.c b/contrib/compiler-rt/lib/clzdi2.c
index ea95396..c281945 100644
--- a/contrib/compiler-rt/lib/clzdi2.c
+++ b/contrib/compiler-rt/lib/clzdi2.c
@@ -1,9 +1,9 @@
/* ===-- clzdi2.c - Implement __clzdi2 -------------------------------------===
*
- * The LLVM Compiler Infrastructure
+ * The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,7 @@
/* Precondition: a != 0 */
-si_int
+COMPILER_RT_ABI si_int
__clzdi2(di_int a)
{
dwords x;
diff --git a/contrib/compiler-rt/lib/clzsi2.c b/contrib/compiler-rt/lib/clzsi2.c
index 7e14af2..d0a6aea 100644
--- a/contrib/compiler-rt/lib/clzsi2.c
+++ b/contrib/compiler-rt/lib/clzsi2.c
@@ -1,9 +1,9 @@
/* ===-- clzsi2.c - Implement __clzsi2 -------------------------------------===
*
- * The LLVM Compiler Infrastructure
+ * The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,7 @@
/* Precondition: a != 0 */
-si_int
+COMPILER_RT_ABI si_int
__clzsi2(si_int a)
{
su_int x = (su_int)a;
diff --git a/contrib/compiler-rt/lib/clzti2.c b/contrib/compiler-rt/lib/clzti2.c
index 805688f..7a650eb 100644
--- a/contrib/compiler-rt/lib/clzti2.c
+++ b/contrib/compiler-rt/lib/clzti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/cmpdi2.c b/contrib/compiler-rt/lib/cmpdi2.c
index 0b87352..999c3d2 100644
--- a/contrib/compiler-rt/lib/cmpdi2.c
+++ b/contrib/compiler-rt/lib/cmpdi2.c
@@ -2,24 +2,25 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
- *
+ *
* This file implements __cmpdi2 for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
-/* Returns: if (a < b) returns 0
+/* Returns: if (a < b) returns 0
* if (a == b) returns 1
* if (a > b) returns 2
*/
-si_int
+COMPILER_RT_ABI si_int
__cmpdi2(di_int a, di_int b)
{
dwords x;
diff --git a/contrib/compiler-rt/lib/cmpti2.c b/contrib/compiler-rt/lib/cmpti2.c
index 90b3b75..b156fce 100644
--- a/contrib/compiler-rt/lib/cmpti2.c
+++ b/contrib/compiler-rt/lib/cmpti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/comparedf2.c b/contrib/compiler-rt/lib/comparedf2.c
index 5c5ee9d..fe35fd8 100644
--- a/contrib/compiler-rt/lib/comparedf2.c
+++ b/contrib/compiler-rt/lib/comparedf2.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
diff --git a/contrib/compiler-rt/lib/comparesf2.c b/contrib/compiler-rt/lib/comparesf2.c
index fd05724..3f2e358 100644
--- a/contrib/compiler-rt/lib/comparesf2.c
+++ b/contrib/compiler-rt/lib/comparesf2.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
diff --git a/contrib/compiler-rt/lib/ctzdi2.c b/contrib/compiler-rt/lib/ctzdi2.c
index b49f2c7..b3d37d0 100644
--- a/contrib/compiler-rt/lib/ctzdi2.c
+++ b/contrib/compiler-rt/lib/ctzdi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,7 @@
/* Precondition: a != 0 */
-si_int
+COMPILER_RT_ABI si_int
__ctzdi2(di_int a)
{
dwords x;
diff --git a/contrib/compiler-rt/lib/ctzsi2.c b/contrib/compiler-rt/lib/ctzsi2.c
index 30d34c8..2ff0e5d 100644
--- a/contrib/compiler-rt/lib/ctzsi2.c
+++ b/contrib/compiler-rt/lib/ctzsi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,7 @@
/* Precondition: a != 0 */
-si_int
+COMPILER_RT_ABI si_int
__ctzsi2(si_int a)
{
su_int x = (su_int)a;
diff --git a/contrib/compiler-rt/lib/ctzti2.c b/contrib/compiler-rt/lib/ctzti2.c
index f2d41fe..1c9508f 100644
--- a/contrib/compiler-rt/lib/ctzti2.c
+++ b/contrib/compiler-rt/lib/ctzti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/divdc3.c b/contrib/compiler-rt/lib/divdc3.c
index c96aefd..5f63298 100644
--- a/contrib/compiler-rt/lib/divdc3.c
+++ b/contrib/compiler-rt/lib/divdc3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/divdf3.c b/contrib/compiler-rt/lib/divdf3.c
index 21b8f09..925abd5 100644
--- a/contrib/compiler-rt/lib/divdf3.c
+++ b/contrib/compiler-rt/lib/divdf3.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -15,10 +15,13 @@
// underflow with correct rounding.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define DOUBLE_PRECISION
#include "fp_lib.h"
+ARM_EABI_FNALIAS(ddiv, divdf3);
+
fp_t __divdf3(fp_t a, fp_t b) {
const unsigned int aExponent = toRep(a) >> significandBits & maxExponent;
diff --git a/contrib/compiler-rt/lib/divdi3.c b/contrib/compiler-rt/lib/divdi3.c
index fccfb8b..d62df56 100644
--- a/contrib/compiler-rt/lib/divdi3.c
+++ b/contrib/compiler-rt/lib/divdi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,14 +11,15 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
-du_int __udivmoddi4(du_int a, du_int b, du_int* rem);
+du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem);
/* Returns: a / b */
-di_int
+COMPILER_RT_ABI di_int
__divdi3(di_int a, di_int b)
{
const int bits_in_dword_m1 = (int)(sizeof(di_int) * CHAR_BIT) - 1;
diff --git a/contrib/compiler-rt/lib/divmoddi4.c b/contrib/compiler-rt/lib/divmoddi4.c
new file mode 100644
index 0000000..d3ca745
--- /dev/null
+++ b/contrib/compiler-rt/lib/divmoddi4.c
@@ -0,0 +1,30 @@
+/*===-- divmoddi4.c - Implement __divmoddi4 --------------------------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file implements __divmoddi4 for the compiler_rt library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+#include "abi.h"
+
+#include "int_lib.h"
+
+extern COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b);
+
+ARM_EABI_FNALIAS(ldivmod, divmoddi4);
+
+/* Returns: a / b, *rem = a % b */
+
+COMPILER_RT_ABI di_int
+__divmoddi4(di_int a, di_int b, di_int* rem)
+{
+ di_int d = __divdi3(a,b);
+ *rem = a - (d*b);
+ return d;
+}
diff --git a/contrib/compiler-rt/lib/divmodsi4.c b/contrib/compiler-rt/lib/divmodsi4.c
new file mode 100644
index 0000000..4dc1978
--- /dev/null
+++ b/contrib/compiler-rt/lib/divmodsi4.c
@@ -0,0 +1,31 @@
+/*===-- divmodsi4.c - Implement __divmodsi4 --------------------------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file implements __divmodsi4 for the compiler_rt library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+#include "abi.h"
+
+#include "int_lib.h"
+
+extern COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b);
+
+
+/* Returns: a / b, *rem = a % b */
+
+COMPILER_RT_ABI si_int
+__divmodsi4(si_int a, si_int b, si_int* rem)
+{
+ si_int d = __divsi3(a,b);
+ *rem = a - (d*b);
+ return d;
+}
+
+
diff --git a/contrib/compiler-rt/lib/divsc3.c b/contrib/compiler-rt/lib/divsc3.c
index c38c863..a05f429 100644
--- a/contrib/compiler-rt/lib/divsc3.c
+++ b/contrib/compiler-rt/lib/divsc3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/divsf3.c b/contrib/compiler-rt/lib/divsf3.c
index 03b7311..b733307 100644
--- a/contrib/compiler-rt/lib/divsf3.c
+++ b/contrib/compiler-rt/lib/divsf3.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -15,10 +15,13 @@
// underflow with correct rounding.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define SINGLE_PRECISION
#include "fp_lib.h"
+ARM_EABI_FNALIAS(fdiv, divsf3);
+
fp_t __divsf3(fp_t a, fp_t b) {
const unsigned int aExponent = toRep(a) >> significandBits & maxExponent;
diff --git a/contrib/compiler-rt/lib/divsi3.c b/contrib/compiler-rt/lib/divsi3.c
index 0eff6ef..01ef274 100644
--- a/contrib/compiler-rt/lib/divsi3.c
+++ b/contrib/compiler-rt/lib/divsi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,14 +11,17 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
-su_int __udivsi3(su_int n, su_int d);
+su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d);
/* Returns: a / b */
-si_int
+ARM_EABI_FNALIAS(idiv, divsi3);
+
+COMPILER_RT_ABI si_int
__divsi3(si_int a, si_int b)
{
const int bits_in_word_m1 = (int)(sizeof(si_int) * CHAR_BIT) - 1;
diff --git a/contrib/compiler-rt/lib/divti3.c b/contrib/compiler-rt/lib/divti3.c
index c752f6c..4ec3fa3 100644
--- a/contrib/compiler-rt/lib/divti3.c
+++ b/contrib/compiler-rt/lib/divti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/divxc3.c b/contrib/compiler-rt/lib/divxc3.c
index 03357ae..f054d40 100644
--- a/contrib/compiler-rt/lib/divxc3.c
+++ b/contrib/compiler-rt/lib/divxc3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/enable_execute_stack.c b/contrib/compiler-rt/lib/enable_execute_stack.c
index 193e7db..7ab8e8d 100644
--- a/contrib/compiler-rt/lib/enable_execute_stack.c
+++ b/contrib/compiler-rt/lib/enable_execute_stack.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*/
diff --git a/contrib/compiler-rt/lib/endianness.h b/contrib/compiler-rt/lib/endianness.h
index 6d2587d..9b7e7c1 100644
--- a/contrib/compiler-rt/lib/endianness.h
+++ b/contrib/compiler-rt/lib/endianness.h
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/eprintf.c b/contrib/compiler-rt/lib/eprintf.c
index 786fe6a..7c79174 100644
--- a/contrib/compiler-rt/lib/eprintf.c
+++ b/contrib/compiler-rt/lib/eprintf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*/
diff --git a/contrib/compiler-rt/lib/extendsfdf2.c b/contrib/compiler-rt/lib/extendsfdf2.c
index 025eb95..c0b628d 100644
--- a/contrib/compiler-rt/lib/extendsfdf2.c
+++ b/contrib/compiler-rt/lib/extendsfdf2.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -41,6 +41,8 @@
#include <stdint.h>
#include <limits.h>
+#include "abi.h"
+
typedef float src_t;
typedef uint32_t src_rep_t;
#define SRC_REP_C UINT32_C
@@ -67,6 +69,8 @@ static inline dst_t dstFromRep(dst_rep_t x) {
// End helper routines. Conversion implementation follows.
+ARM_EABI_FNALIAS(f2d, extendsfdf2);
+
dst_t __extendsfdf2(src_t a) {
// Various constants whose values follow from the type parameters.
diff --git a/contrib/compiler-rt/lib/ffsdi2.c b/contrib/compiler-rt/lib/ffsdi2.c
index 8c03d19..89f1b7b 100644
--- a/contrib/compiler-rt/lib/ffsdi2.c
+++ b/contrib/compiler-rt/lib/ffsdi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,7 @@
* the value zero if a is zero. The least significant bit is index one.
*/
-si_int
+COMPILER_RT_ABI si_int
__ffsdi2(di_int a)
{
dwords x;
diff --git a/contrib/compiler-rt/lib/ffsti2.c b/contrib/compiler-rt/lib/ffsti2.c
index 0139eb1..948c696 100644
--- a/contrib/compiler-rt/lib/ffsti2.c
+++ b/contrib/compiler-rt/lib/ffsti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixdfdi.c b/contrib/compiler-rt/lib/fixdfdi.c
index 3d3116c..85a456d 100644
--- a/contrib/compiler-rt/lib/fixdfdi.c
+++ b/contrib/compiler-rt/lib/fixdfdi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -23,6 +24,8 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
+ARM_EABI_FNALIAS(d2lz, fixdfdi);
+
di_int
__fixdfdi(double a)
{
diff --git a/contrib/compiler-rt/lib/fixdfsi.c b/contrib/compiler-rt/lib/fixdfsi.c
index 7d17aed..fbcf147 100644
--- a/contrib/compiler-rt/lib/fixdfsi.c
+++ b/contrib/compiler-rt/lib/fixdfsi.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -12,10 +12,15 @@
// conversion is undefined for out of range values in the C standard.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define DOUBLE_PRECISION
#include "fp_lib.h"
+#include "int_lib.h"
+
+ARM_EABI_FNALIAS(d2iz, fixdfsi);
+
int __fixdfsi(fp_t a) {
// Break a into sign, exponent, significand
diff --git a/contrib/compiler-rt/lib/fixdfti.c b/contrib/compiler-rt/lib/fixdfti.c
index 359b84e..4140d14 100644
--- a/contrib/compiler-rt/lib/fixdfti.c
+++ b/contrib/compiler-rt/lib/fixdfti.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixsfdi.c b/contrib/compiler-rt/lib/fixsfdi.c
index 08f1524..d80e33e 100644
--- a/contrib/compiler-rt/lib/fixsfdi.c
+++ b/contrib/compiler-rt/lib/fixsfdi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -23,7 +24,9 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
-di_int
+ARM_EABI_FNALIAS(d2lz, fixsfdi);
+
+COMPILER_RT_ABI di_int
__fixsfdi(float a)
{
float_bits fb;
diff --git a/contrib/compiler-rt/lib/fixsfsi.c b/contrib/compiler-rt/lib/fixsfsi.c
index ff79377..67749a5 100644
--- a/contrib/compiler-rt/lib/fixsfsi.c
+++ b/contrib/compiler-rt/lib/fixsfsi.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -12,12 +12,15 @@
// conversion is undefined for out of range values in the C standard.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define SINGLE_PRECISION
#include "fp_lib.h"
-int __fixsfsi(fp_t a) {
-
+ARM_EABI_FNALIAS(f2iz, fixsfsi);
+
+COMPILER_RT_ABI int
+__fixsfsi(fp_t a) {
// Break a into sign, exponent, significand
const rep_t aRep = toRep(a);
const rep_t aAbs = aRep & absMask;
diff --git a/contrib/compiler-rt/lib/fixsfti.c b/contrib/compiler-rt/lib/fixsfti.c
index 95992fe..c64e5ae 100644
--- a/contrib/compiler-rt/lib/fixsfti.c
+++ b/contrib/compiler-rt/lib/fixsfti.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixunsdfdi.c b/contrib/compiler-rt/lib/fixunsdfdi.c
index bdcee13..d80b84a 100644
--- a/contrib/compiler-rt/lib/fixunsdfdi.c
+++ b/contrib/compiler-rt/lib/fixunsdfdi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -26,7 +27,9 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
-du_int
+ARM_EABI_FNALIAS(d2ulz, fixunsdfdi);
+
+COMPILER_RT_ABI du_int
__fixunsdfdi(double a)
{
double_bits fb;
diff --git a/contrib/compiler-rt/lib/fixunsdfsi.c b/contrib/compiler-rt/lib/fixunsdfsi.c
index a0cba79..ecdfb5d 100644
--- a/contrib/compiler-rt/lib/fixunsdfsi.c
+++ b/contrib/compiler-rt/lib/fixunsdfsi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -26,7 +27,9 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
-su_int
+ARM_EABI_FNALIAS(d2uiz, fixunsdfsi);
+
+COMPILER_RT_ABI su_int
__fixunsdfsi(double a)
{
double_bits fb;
diff --git a/contrib/compiler-rt/lib/fixunsdfti.c b/contrib/compiler-rt/lib/fixunsdfti.c
index c1cd72d..524a207 100644
--- a/contrib/compiler-rt/lib/fixunsdfti.c
+++ b/contrib/compiler-rt/lib/fixunsdfti.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixunssfdi.c b/contrib/compiler-rt/lib/fixunssfdi.c
index 3837bd8..1506420 100644
--- a/contrib/compiler-rt/lib/fixunssfdi.c
+++ b/contrib/compiler-rt/lib/fixunssfdi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,9 +11,9 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
-
/* Returns: convert a to a unsigned long long, rounding toward zero.
* Negative values all become zero.
*/
@@ -26,7 +26,9 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
-du_int
+ARM_EABI_FNALIAS(f2ulz, fixunssfdi);
+
+COMPILER_RT_ABI du_int
__fixunssfdi(float a)
{
float_bits fb;
diff --git a/contrib/compiler-rt/lib/fixunssfsi.c b/contrib/compiler-rt/lib/fixunssfsi.c
index a001cd4..dbaa511 100644
--- a/contrib/compiler-rt/lib/fixunssfsi.c
+++ b/contrib/compiler-rt/lib/fixunssfsi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -26,7 +27,9 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
-su_int
+ARM_EABI_FNALIAS(f2uiz, fixunssfsi);
+
+COMPILER_RT_ABI su_int
__fixunssfsi(float a)
{
float_bits fb;
diff --git a/contrib/compiler-rt/lib/fixunssfti.c b/contrib/compiler-rt/lib/fixunssfti.c
index 20b7e76..b807910 100644
--- a/contrib/compiler-rt/lib/fixunssfti.c
+++ b/contrib/compiler-rt/lib/fixunssfti.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixunsxfdi.c b/contrib/compiler-rt/lib/fixunsxfdi.c
index 872727b..6c817d8e 100644
--- a/contrib/compiler-rt/lib/fixunsxfdi.c
+++ b/contrib/compiler-rt/lib/fixunsxfdi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixunsxfsi.c b/contrib/compiler-rt/lib/fixunsxfsi.c
index c9a607a..b9da86c 100644
--- a/contrib/compiler-rt/lib/fixunsxfsi.c
+++ b/contrib/compiler-rt/lib/fixunsxfsi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixunsxfti.c b/contrib/compiler-rt/lib/fixunsxfti.c
index d0bd512..f0e16db 100644
--- a/contrib/compiler-rt/lib/fixunsxfti.c
+++ b/contrib/compiler-rt/lib/fixunsxfti.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixxfdi.c b/contrib/compiler-rt/lib/fixxfdi.c
index de6f818..9592ce4 100644
--- a/contrib/compiler-rt/lib/fixxfdi.c
+++ b/contrib/compiler-rt/lib/fixxfdi.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fixxfti.c b/contrib/compiler-rt/lib/fixxfti.c
index c224801..1022770 100644
--- a/contrib/compiler-rt/lib/fixxfti.c
+++ b/contrib/compiler-rt/lib/fixxfti.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/floatdidf.c b/contrib/compiler-rt/lib/floatdidf.c
index a0f501b..5ba9526 100644
--- a/contrib/compiler-rt/lib/floatdidf.c
+++ b/contrib/compiler-rt/lib/floatdidf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
*===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
#include <float.h>
@@ -23,13 +24,15 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
+ARM_EABI_FNALIAS(l2d, floatdidf);
+
#ifndef __SOFT_FP__
/* Support for systems that have hardware floating-point; we'll set the inexact flag
* as a side-effect of this computation.
*/
#include <stdint.h>
-double
+COMPILER_RT_ABI double
__floatdidf(di_int a)
{
static const double twop52 = 0x1.0p52;
@@ -49,7 +52,7 @@ __floatdidf(di_int a)
* set, and we don't want to code-gen to an unknown soft-float implementation.
*/
-double
+COMPILER_RT_ABI double
__floatdidf(di_int a)
{
if (a == 0)
diff --git a/contrib/compiler-rt/lib/floatdisf.c b/contrib/compiler-rt/lib/floatdisf.c
index 1925f15..4dc13ca 100644
--- a/contrib/compiler-rt/lib/floatdisf.c
+++ b/contrib/compiler-rt/lib/floatdisf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===
*
@@ -12,7 +12,7 @@
*===----------------------------------------------------------------------===
*/
-#include "int_lib.h"
+#include "abi.h"
#include <float.h>
/* Returns: convert a to a float, rounding toward even.*/
@@ -23,7 +23,11 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
-float
+#include "int_lib.h"
+
+ARM_EABI_FNALIAS(l2f, floatdisf);
+
+COMPILER_RT_ABI float
__floatdisf(di_int a)
{
if (a == 0)
diff --git a/contrib/compiler-rt/lib/floatdixf.c b/contrib/compiler-rt/lib/floatdixf.c
index bfda367..ebf62db 100644
--- a/contrib/compiler-rt/lib/floatdixf.c
+++ b/contrib/compiler-rt/lib/floatdixf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/floatsidf.c b/contrib/compiler-rt/lib/floatsidf.c
index a13ab8f..7227335 100644
--- a/contrib/compiler-rt/lib/floatsidf.c
+++ b/contrib/compiler-rt/lib/floatsidf.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -12,10 +12,15 @@
// mode.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define DOUBLE_PRECISION
#include "fp_lib.h"
+#include "int_lib.h"
+
+ARM_EABI_FNALIAS(i2d, floatsidf);
+
fp_t __floatsidf(int a) {
const int aWidth = sizeof a * CHAR_BIT;
diff --git a/contrib/compiler-rt/lib/floatsisf.c b/contrib/compiler-rt/lib/floatsisf.c
index 4a62975..e5250ff 100644
--- a/contrib/compiler-rt/lib/floatsisf.c
+++ b/contrib/compiler-rt/lib/floatsisf.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -12,10 +12,15 @@
// mode.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define SINGLE_PRECISION
#include "fp_lib.h"
+#include "int_lib.h"
+
+ARM_EABI_FNALIAS(i2f, floatsisf);
+
fp_t __floatsisf(int a) {
const int aWidth = sizeof a * CHAR_BIT;
diff --git a/contrib/compiler-rt/lib/floattidf.c b/contrib/compiler-rt/lib/floattidf.c
index 274f585..f61844d 100644
--- a/contrib/compiler-rt/lib/floattidf.c
+++ b/contrib/compiler-rt/lib/floattidf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/floattisf.c b/contrib/compiler-rt/lib/floattisf.c
index 72f3748..7eb761d 100644
--- a/contrib/compiler-rt/lib/floattisf.c
+++ b/contrib/compiler-rt/lib/floattisf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/floattixf.c b/contrib/compiler-rt/lib/floattixf.c
index 77d9060..e4bcb5f 100644
--- a/contrib/compiler-rt/lib/floattixf.c
+++ b/contrib/compiler-rt/lib/floattixf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/floatundidf.c b/contrib/compiler-rt/lib/floatundidf.c
index 1f304c5..e74e9d8 100644
--- a/contrib/compiler-rt/lib/floatundidf.c
+++ b/contrib/compiler-rt/lib/floatundidf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -12,7 +12,7 @@
* ===----------------------------------------------------------------------===
*/
-#include "int_lib.h"
+#include "abi.h"
#include <float.h>
/* Returns: convert a to a double, rounding toward even. */
@@ -23,6 +23,10 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
+#include "int_lib.h"
+
+ARM_EABI_FNALIAS(ul2d, floatundidf);
+
#ifndef __SOFT_FP__
/* Support for systems that have hardware floating-point; we'll set the inexact flag
* as a side-effect of this computation.
@@ -30,7 +34,7 @@
#include <stdint.h>
-double
+COMPILER_RT_ABI double
__floatundidf(du_int a)
{
static const double twop52 = 0x1.0p52;
@@ -52,7 +56,7 @@ __floatundidf(du_int a)
* set, and we don't want to code-gen to an unknown soft-float implementation.
*/
-double
+COMPILER_RT_ABI double
__floatundidf(du_int a)
{
if (a == 0)
diff --git a/contrib/compiler-rt/lib/floatundisf.c b/contrib/compiler-rt/lib/floatundisf.c
index 79b4b82..eea45a7 100644
--- a/contrib/compiler-rt/lib/floatundisf.c
+++ b/contrib/compiler-rt/lib/floatundisf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -12,7 +12,7 @@
*===----------------------------------------------------------------------===
*/
-#include "int_lib.h"
+#include "abi.h"
#include <float.h>
/* Returns: convert a to a float, rounding toward even. */
@@ -23,7 +23,11 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
-float
+#include "int_lib.h"
+
+ARM_EABI_FNALIAS(ul2f, floatundisf);
+
+COMPILER_RT_ABI float
__floatundisf(du_int a)
{
if (a == 0)
diff --git a/contrib/compiler-rt/lib/floatundixf.c b/contrib/compiler-rt/lib/floatundixf.c
index bc9582f..64f7662 100644
--- a/contrib/compiler-rt/lib/floatundixf.c
+++ b/contrib/compiler-rt/lib/floatundixf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/floatunsidf.c b/contrib/compiler-rt/lib/floatunsidf.c
index 05242c1..3756299 100644
--- a/contrib/compiler-rt/lib/floatunsidf.c
+++ b/contrib/compiler-rt/lib/floatunsidf.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -12,10 +12,15 @@
// mode.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define DOUBLE_PRECISION
#include "fp_lib.h"
+#include "int_lib.h"
+
+ARM_EABI_FNALIAS(ui2d, floatunsidf);
+
fp_t __floatunsidf(unsigned int a) {
const int aWidth = sizeof a * CHAR_BIT;
diff --git a/contrib/compiler-rt/lib/floatunsisf.c b/contrib/compiler-rt/lib/floatunsisf.c
index 31c0644..14ef103 100644
--- a/contrib/compiler-rt/lib/floatunsisf.c
+++ b/contrib/compiler-rt/lib/floatunsisf.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -12,10 +12,15 @@
// mode.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define SINGLE_PRECISION
#include "fp_lib.h"
+#include "int_lib.h"
+
+ARM_EABI_FNALIAS(ui2f, floatunsisf);
+
fp_t __floatunsisf(unsigned int a) {
const int aWidth = sizeof a * CHAR_BIT;
diff --git a/contrib/compiler-rt/lib/floatuntidf.c b/contrib/compiler-rt/lib/floatuntidf.c
index 51d8b28..bab7483 100644
--- a/contrib/compiler-rt/lib/floatuntidf.c
+++ b/contrib/compiler-rt/lib/floatuntidf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/floatuntisf.c b/contrib/compiler-rt/lib/floatuntisf.c
index 328f39b..0ab6d7e 100644
--- a/contrib/compiler-rt/lib/floatuntisf.c
+++ b/contrib/compiler-rt/lib/floatuntisf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/floatuntixf.c b/contrib/compiler-rt/lib/floatuntixf.c
index e82d0c1..a84709a 100644
--- a/contrib/compiler-rt/lib/floatuntixf.c
+++ b/contrib/compiler-rt/lib/floatuntixf.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/fp_lib.h b/contrib/compiler-rt/lib/fp_lib.h
index eac670d..6c9455a 100644
--- a/contrib/compiler-rt/lib/fp_lib.h
+++ b/contrib/compiler-rt/lib/fp_lib.h
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
diff --git a/contrib/compiler-rt/lib/gcc_personality_v0.c b/contrib/compiler-rt/lib/gcc_personality_v0.c
index 5940190..c840eef 100644
--- a/contrib/compiler-rt/lib/gcc_personality_v0.c
+++ b/contrib/compiler-rt/lib/gcc_personality_v0.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/i386/ashldi3.S b/contrib/compiler-rt/lib/i386/ashldi3.S
index af6f98b..5488ad6 100644
--- a/contrib/compiler-rt/lib/i386/ashldi3.S
+++ b/contrib/compiler-rt/lib/i386/ashldi3.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/ashrdi3.S b/contrib/compiler-rt/lib/i386/ashrdi3.S
index 346f9b1..b1445dd 100644
--- a/contrib/compiler-rt/lib/i386/ashrdi3.S
+++ b/contrib/compiler-rt/lib/i386/ashrdi3.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/divdi3.S b/contrib/compiler-rt/lib/i386/divdi3.S
index 5ad530c..69593e3 100644
--- a/contrib/compiler-rt/lib/i386/divdi3.S
+++ b/contrib/compiler-rt/lib/i386/divdi3.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/floatdidf.S b/contrib/compiler-rt/lib/i386/floatdidf.S
index 3a526ea..a953d26 100644
--- a/contrib/compiler-rt/lib/i386/floatdidf.S
+++ b/contrib/compiler-rt/lib/i386/floatdidf.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/floatdisf.S b/contrib/compiler-rt/lib/i386/floatdisf.S
index 741e4a6..a98a46e 100644
--- a/contrib/compiler-rt/lib/i386/floatdisf.S
+++ b/contrib/compiler-rt/lib/i386/floatdisf.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/floatdixf.S b/contrib/compiler-rt/lib/i386/floatdixf.S
index f0271ab..412976f 100644
--- a/contrib/compiler-rt/lib/i386/floatdixf.S
+++ b/contrib/compiler-rt/lib/i386/floatdixf.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/floatundidf.S b/contrib/compiler-rt/lib/i386/floatundidf.S
index 7186a35..6bba7e1 100644
--- a/contrib/compiler-rt/lib/i386/floatundidf.S
+++ b/contrib/compiler-rt/lib/i386/floatundidf.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
diff --git a/contrib/compiler-rt/lib/i386/floatundisf.S b/contrib/compiler-rt/lib/i386/floatundisf.S
index 070820c..1afd1d4 100644
--- a/contrib/compiler-rt/lib/i386/floatundisf.S
+++ b/contrib/compiler-rt/lib/i386/floatundisf.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/floatundixf.S b/contrib/compiler-rt/lib/i386/floatundixf.S
index 2cf6d5c..6e6710b 100644
--- a/contrib/compiler-rt/lib/i386/floatundixf.S
+++ b/contrib/compiler-rt/lib/i386/floatundixf.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/lshrdi3.S b/contrib/compiler-rt/lib/i386/lshrdi3.S
index 74937d2..cf411f2 100644
--- a/contrib/compiler-rt/lib/i386/lshrdi3.S
+++ b/contrib/compiler-rt/lib/i386/lshrdi3.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/moddi3.S b/contrib/compiler-rt/lib/i386/moddi3.S
index 85f5b38..8839cfc 100644
--- a/contrib/compiler-rt/lib/i386/moddi3.S
+++ b/contrib/compiler-rt/lib/i386/moddi3.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/muldi3.S b/contrib/compiler-rt/lib/i386/muldi3.S
index 5f99f6a..e56a355 100644
--- a/contrib/compiler-rt/lib/i386/muldi3.S
+++ b/contrib/compiler-rt/lib/i386/muldi3.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/udivdi3.S b/contrib/compiler-rt/lib/i386/udivdi3.S
index 77936f8..5abeaea 100644
--- a/contrib/compiler-rt/lib/i386/udivdi3.S
+++ b/contrib/compiler-rt/lib/i386/udivdi3.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/i386/umoddi3.S b/contrib/compiler-rt/lib/i386/umoddi3.S
index 3cf8aeb..7fd8485 100644
--- a/contrib/compiler-rt/lib/i386/umoddi3.S
+++ b/contrib/compiler-rt/lib/i386/umoddi3.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/int_lib.h b/contrib/compiler-rt/lib/int_lib.h
index 912a12f..e1fd6b7 100644
--- a/contrib/compiler-rt/lib/int_lib.h
+++ b/contrib/compiler-rt/lib/int_lib.h
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -20,6 +20,7 @@
/* Assumption: right shift of signed negative is arithmetic shift */
#include <limits.h>
+#include <stdint.h>
#include "endianness.h"
#include <math.h>
diff --git a/contrib/compiler-rt/lib/lshrdi3.c b/contrib/compiler-rt/lib/lshrdi3.c
index 57484ee..911edb1 100644
--- a/contrib/compiler-rt/lib/lshrdi3.c
+++ b/contrib/compiler-rt/lib/lshrdi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,9 @@
/* Precondition: 0 <= b < bits_in_dword */
-di_int
+ARM_EABI_FNALIAS(llsr, lshrdi3);
+
+COMPILER_RT_ABI di_int
__lshrdi3(di_int a, si_int b)
{
const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT);
diff --git a/contrib/compiler-rt/lib/lshrti3.c b/contrib/compiler-rt/lib/lshrti3.c
index 3272c9c..5fdd99e 100644
--- a/contrib/compiler-rt/lib/lshrti3.c
+++ b/contrib/compiler-rt/lib/lshrti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/moddi3.c b/contrib/compiler-rt/lib/moddi3.c
index 4533555..af0a8083 100644
--- a/contrib/compiler-rt/lib/moddi3.c
+++ b/contrib/compiler-rt/lib/moddi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,14 +11,15 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
-du_int __udivmoddi4(du_int a, du_int b, du_int* rem);
+COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem);
/* Returns: a % b */
-di_int
+COMPILER_RT_ABI di_int
__moddi3(di_int a, di_int b)
{
const int bits_in_dword_m1 = (int)(sizeof(di_int) * CHAR_BIT) - 1;
diff --git a/contrib/compiler-rt/lib/modsi3.c b/contrib/compiler-rt/lib/modsi3.c
index c9214a2..05ce806 100644
--- a/contrib/compiler-rt/lib/modsi3.c
+++ b/contrib/compiler-rt/lib/modsi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,13 +11,16 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
+su_int COMPILER_RT_ABI __divsi3(si_int a, si_int b);
+
/* Returns: a % b */
-si_int
+COMPILER_RT_ABI si_int
__modsi3(si_int a, si_int b)
{
- return a - (a / b) * b;
+ return a - __divsi3(a, b) * b;
}
diff --git a/contrib/compiler-rt/lib/modti3.c b/contrib/compiler-rt/lib/modti3.c
index 75d688e..dbe5e94 100644
--- a/contrib/compiler-rt/lib/modti3.c
+++ b/contrib/compiler-rt/lib/modti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/muldc3.c b/contrib/compiler-rt/lib/muldc3.c
index c048d84..9f9bd2a 100644
--- a/contrib/compiler-rt/lib/muldc3.c
+++ b/contrib/compiler-rt/lib/muldc3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/muldf3.c b/contrib/compiler-rt/lib/muldf3.c
index 63a473e..f402cfb 100644
--- a/contrib/compiler-rt/lib/muldf3.c
+++ b/contrib/compiler-rt/lib/muldf3.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -11,11 +11,15 @@
// with the IEEE-754 default rounding (to nearest, ties to even).
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define DOUBLE_PRECISION
#include "fp_lib.h"
-fp_t __muldf3(fp_t a, fp_t b) {
+ARM_EABI_FNALIAS(dmul, muldf3);
+
+COMPILER_RT_ABI fp_t
+__muldf3(fp_t a, fp_t b) {
const unsigned int aExponent = toRep(a) >> significandBits & maxExponent;
const unsigned int bExponent = toRep(b) >> significandBits & maxExponent;
diff --git a/contrib/compiler-rt/lib/muldi3.c b/contrib/compiler-rt/lib/muldi3.c
index 38963b7..e6322bf 100644
--- a/contrib/compiler-rt/lib/muldi3.c
+++ b/contrib/compiler-rt/lib/muldi3.c
@@ -2,15 +2,16 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file implements __muldi3 for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
- */
+ */
+#include "abi.h"
#include "int_lib.h"
@@ -40,7 +41,9 @@ __muldsi3(su_int a, su_int b)
/* Returns: a * b */
-di_int
+ARM_EABI_FNALIAS(lmul, muldi3);
+
+COMPILER_RT_ABI di_int
__muldi3(di_int a, di_int b)
{
dwords x;
diff --git a/contrib/compiler-rt/lib/mulsc3.c b/contrib/compiler-rt/lib/mulsc3.c
index c7b9f64..a878ba1 100644
--- a/contrib/compiler-rt/lib/mulsc3.c
+++ b/contrib/compiler-rt/lib/mulsc3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/mulsf3.c b/contrib/compiler-rt/lib/mulsf3.c
index 6bd2f9d..bf46e14 100644
--- a/contrib/compiler-rt/lib/mulsf3.c
+++ b/contrib/compiler-rt/lib/mulsf3.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -11,11 +11,15 @@
// with the IEEE-754 default rounding (to nearest, ties to even).
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define SINGLE_PRECISION
#include "fp_lib.h"
-fp_t __mulsf3(fp_t a, fp_t b) {
+ARM_EABI_FNALIAS(fmul, mulsf3);
+
+COMPILER_RT_ABI fp_t
+__mulsf3(fp_t a, fp_t b) {
const unsigned int aExponent = toRep(a) >> significandBits & maxExponent;
const unsigned int bExponent = toRep(b) >> significandBits & maxExponent;
diff --git a/contrib/compiler-rt/lib/multi3.c b/contrib/compiler-rt/lib/multi3.c
index 13a3867..ad8ab3f 100644
--- a/contrib/compiler-rt/lib/multi3.c
+++ b/contrib/compiler-rt/lib/multi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
diff --git a/contrib/compiler-rt/lib/mulvdi3.c b/contrib/compiler-rt/lib/mulvdi3.c
index 295ae18..fcbb5b3 100644
--- a/contrib/compiler-rt/lib/mulvdi3.c
+++ b/contrib/compiler-rt/lib/mulvdi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/mulvsi3.c b/contrib/compiler-rt/lib/mulvsi3.c
index b4a509b..6271cd4 100644
--- a/contrib/compiler-rt/lib/mulvsi3.c
+++ b/contrib/compiler-rt/lib/mulvsi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/mulvti3.c b/contrib/compiler-rt/lib/mulvti3.c
index 778222e..7da9187 100644
--- a/contrib/compiler-rt/lib/mulvti3.c
+++ b/contrib/compiler-rt/lib/mulvti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/mulxc3.c b/contrib/compiler-rt/lib/mulxc3.c
index 94895f2..b5ae865 100644
--- a/contrib/compiler-rt/lib/mulxc3.c
+++ b/contrib/compiler-rt/lib/mulxc3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/negdf2.c b/contrib/compiler-rt/lib/negdf2.c
index 527b068..b47f397 100644
--- a/contrib/compiler-rt/lib/negdf2.c
+++ b/contrib/compiler-rt/lib/negdf2.c
@@ -2,18 +2,21 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements double-precision soft-float negation.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define DOUBLE_PRECISION
#include "fp_lib.h"
+ARM_EABI_FNALIAS(dneg, negdf2);
+
fp_t __negdf2(fp_t a) {
return fromRep(toRep(a) ^ signBit);
}
diff --git a/contrib/compiler-rt/lib/negdi2.c b/contrib/compiler-rt/lib/negdi2.c
index 707b0dd..b000dda 100644
--- a/contrib/compiler-rt/lib/negdi2.c
+++ b/contrib/compiler-rt/lib/negdi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/negsf2.c b/contrib/compiler-rt/lib/negsf2.c
index 5e91e87..98f9fc0 100644
--- a/contrib/compiler-rt/lib/negsf2.c
+++ b/contrib/compiler-rt/lib/negsf2.c
@@ -2,18 +2,22 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements single-precision soft-float negation.
//
//===----------------------------------------------------------------------===//
+#include "abi.h"
#define SINGLE_PRECISION
#include "fp_lib.h"
-fp_t __negsf2(fp_t a) {
+ARM_EABI_FNALIAS(fneg, negsf2);
+
+COMPILER_RT_ABI fp_t
+__negsf2(fp_t a) {
return fromRep(toRep(a) ^ signBit);
}
diff --git a/contrib/compiler-rt/lib/negti2.c b/contrib/compiler-rt/lib/negti2.c
index 6ce6a04..774e808 100644
--- a/contrib/compiler-rt/lib/negti2.c
+++ b/contrib/compiler-rt/lib/negti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/negvdi2.c b/contrib/compiler-rt/lib/negvdi2.c
index 0baf377..aafaa9d 100644
--- a/contrib/compiler-rt/lib/negvdi2.c
+++ b/contrib/compiler-rt/lib/negvdi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
#include <stdlib.h>
@@ -19,7 +20,7 @@
/* Effects: aborts if -a overflows */
-di_int
+COMPILER_RT_ABI di_int
__negvdi2(di_int a)
{
const di_int MIN = (di_int)1 << ((int)(sizeof(di_int) * CHAR_BIT)-1);
diff --git a/contrib/compiler-rt/lib/negvsi2.c b/contrib/compiler-rt/lib/negvsi2.c
index e5a36a5..559ea18 100644
--- a/contrib/compiler-rt/lib/negvsi2.c
+++ b/contrib/compiler-rt/lib/negvsi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
#include <stdlib.h>
@@ -19,7 +20,7 @@
/* Effects: aborts if -a overflows */
-si_int
+COMPILER_RT_ABI si_int
__negvsi2(si_int a)
{
const si_int MIN = (si_int)1 << ((int)(sizeof(si_int) * CHAR_BIT)-1);
diff --git a/contrib/compiler-rt/lib/negvti2.c b/contrib/compiler-rt/lib/negvti2.c
index d56e1e3..d931305 100644
--- a/contrib/compiler-rt/lib/negvti2.c
+++ b/contrib/compiler-rt/lib/negvti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/paritydi2.c b/contrib/compiler-rt/lib/paritydi2.c
index 90e5559..e7bebf6 100644
--- a/contrib/compiler-rt/lib/paritydi2.c
+++ b/contrib/compiler-rt/lib/paritydi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,14 +11,15 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
/* Returns: 1 if number of bits is odd else returns 0 */
-si_int __paritysi2(si_int a);
+si_int COMPILER_RT_ABI __paritysi2(si_int a);
-si_int
+COMPILER_RT_ABI si_int
__paritydi2(di_int a)
{
dwords x;
diff --git a/contrib/compiler-rt/lib/paritysi2.c b/contrib/compiler-rt/lib/paritysi2.c
index ba05782..64d509f 100644
--- a/contrib/compiler-rt/lib/paritysi2.c
+++ b/contrib/compiler-rt/lib/paritysi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,12 +11,13 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
/* Returns: 1 if number of bits is odd else returns 0 */
-si_int
+COMPILER_RT_ABI si_int
__paritysi2(si_int a)
{
su_int x = (su_int)a;
diff --git a/contrib/compiler-rt/lib/parityti2.c b/contrib/compiler-rt/lib/parityti2.c
index 650d417..8f85745 100644
--- a/contrib/compiler-rt/lib/parityti2.c
+++ b/contrib/compiler-rt/lib/parityti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/popcountdi2.c b/contrib/compiler-rt/lib/popcountdi2.c
index 78b6d88..136fc04 100644
--- a/contrib/compiler-rt/lib/popcountdi2.c
+++ b/contrib/compiler-rt/lib/popcountdi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,12 +11,13 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
/* Returns: count of 1 bits */
-si_int
+COMPILER_RT_ABI si_int
__popcountdi2(di_int a)
{
du_int x2 = (du_int)a;
diff --git a/contrib/compiler-rt/lib/popcountsi2.c b/contrib/compiler-rt/lib/popcountsi2.c
index 4f092ee..bfaa3ff 100644
--- a/contrib/compiler-rt/lib/popcountsi2.c
+++ b/contrib/compiler-rt/lib/popcountsi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,12 +11,13 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
/* Returns: count of 1 bits */
-si_int
+COMPILER_RT_ABI si_int
__popcountsi2(si_int a)
{
su_int x = (su_int)a;
diff --git a/contrib/compiler-rt/lib/popcountti2.c b/contrib/compiler-rt/lib/popcountti2.c
index 16f89b7..68d9427 100644
--- a/contrib/compiler-rt/lib/popcountti2.c
+++ b/contrib/compiler-rt/lib/popcountti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/powidf2.c b/contrib/compiler-rt/lib/powidf2.c
index 37972b6..2e211eb 100644
--- a/contrib/compiler-rt/lib/powidf2.c
+++ b/contrib/compiler-rt/lib/powidf2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,12 +11,13 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
/* Returns: a ^ b */
-double
+COMPILER_RT_ABI double
__powidf2(double a, si_int b)
{
const int recip = b < 0;
diff --git a/contrib/compiler-rt/lib/powisf2.c b/contrib/compiler-rt/lib/powisf2.c
index ace08c2..e6b43b3 100644
--- a/contrib/compiler-rt/lib/powisf2.c
+++ b/contrib/compiler-rt/lib/powisf2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,12 +11,13 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
/* Returns: a ^ b */
-float
+COMPILER_RT_ABI float
__powisf2(float a, si_int b)
{
const int recip = b < 0;
diff --git a/contrib/compiler-rt/lib/powitf2.c b/contrib/compiler-rt/lib/powitf2.c
index 3dacbf6..189632c 100644
--- a/contrib/compiler-rt/lib/powitf2.c
+++ b/contrib/compiler-rt/lib/powitf2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/powixf2.c b/contrib/compiler-rt/lib/powixf2.c
index 1a816e9..f050964 100644
--- a/contrib/compiler-rt/lib/powixf2.c
+++ b/contrib/compiler-rt/lib/powixf2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/ppc/restFP.S b/contrib/compiler-rt/lib/ppc/restFP.S
index 00919c8..9503289 100644
--- a/contrib/compiler-rt/lib/ppc/restFP.S
+++ b/contrib/compiler-rt/lib/ppc/restFP.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/ppc/saveFP.S b/contrib/compiler-rt/lib/ppc/saveFP.S
index 302da6e..72bd459 100644
--- a/contrib/compiler-rt/lib/ppc/saveFP.S
+++ b/contrib/compiler-rt/lib/ppc/saveFP.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
diff --git a/contrib/compiler-rt/lib/subdf3.c b/contrib/compiler-rt/lib/subdf3.c
new file mode 100644
index 0000000..825e3c6
--- /dev/null
+++ b/contrib/compiler-rt/lib/subdf3.c
@@ -0,0 +1,30 @@
+//===-- lib/adddf3.c - Double-precision subtraction ---------------*- C -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements double-precision soft-float subtraction with the
+// IEEE-754 default rounding (to nearest, ties to even).
+//
+//===----------------------------------------------------------------------===//
+#include "abi.h"
+
+#define DOUBLE_PRECISION
+#include "fp_lib.h"
+
+fp_t COMPILER_RT_ABI __adddf3(fp_t a, fp_t b);
+
+
+ARM_EABI_FNALIAS(dsub, subdf3);
+
+// Subtraction; flip the sign bit of b and add.
+COMPILER_RT_ABI fp_t
+__subdf3(fp_t a, fp_t b) {
+ return __adddf3(a, fromRep(toRep(b) ^ signBit));
+}
+
+/* FIXME: rsub for ARM EABI */
diff --git a/contrib/compiler-rt/lib/subsf3.c b/contrib/compiler-rt/lib/subsf3.c
new file mode 100644
index 0000000..625376a
--- /dev/null
+++ b/contrib/compiler-rt/lib/subsf3.c
@@ -0,0 +1,29 @@
+//===-- lib/subsf3.c - Single-precision subtraction ---------------*- C -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements single-precision soft-float subtraction with the
+// IEEE-754 default rounding (to nearest, ties to even).
+//
+//===----------------------------------------------------------------------===//
+#include "abi.h"
+
+#define SINGLE_PRECISION
+#include "fp_lib.h"
+
+fp_t COMPILER_RT_ABI __addsf3(fp_t a, fp_t b);
+
+ARM_EABI_FNALIAS(fsub, subsf3);
+
+// Subtraction; flip the sign bit of b and add.
+COMPILER_RT_ABI fp_t
+__subsf3(fp_t a, fp_t b) {
+ return __addsf3(a, fromRep(toRep(b) ^ signBit));
+}
+
+/* FIXME: rsub for ARM EABI */
diff --git a/contrib/compiler-rt/lib/subvdi3.c b/contrib/compiler-rt/lib/subvdi3.c
index e4926b8..36b51ad 100644
--- a/contrib/compiler-rt/lib/subvdi3.c
+++ b/contrib/compiler-rt/lib/subvdi3.c
@@ -1,9 +1,9 @@
/* ===-- subvdi3.c - Implement __subvdi3 -----------------------------------===
*
- * The LLVM Compiler Infrastructure
+ * The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
#include <stdlib.h>
@@ -19,7 +20,7 @@
/* Effects: aborts if a - b overflows */
-di_int
+COMPILER_RT_ABI di_int
__subvdi3(di_int a, di_int b)
{
di_int s = a - b;
diff --git a/contrib/compiler-rt/lib/subvsi3.c b/contrib/compiler-rt/lib/subvsi3.c
index ce39c81..03983f7 100644
--- a/contrib/compiler-rt/lib/subvsi3.c
+++ b/contrib/compiler-rt/lib/subvsi3.c
@@ -1,9 +1,9 @@
/* ===-- subvsi3.c - Implement __subvsi3 -----------------------------------===
*
- * The LLVM Compiler Infrastructure
+ * The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
#include <stdlib.h>
@@ -19,7 +20,7 @@
/* Effects: aborts if a - b overflows */
-si_int
+COMPILER_RT_ABI si_int
__subvsi3(si_int a, si_int b)
{
si_int s = a - b;
diff --git a/contrib/compiler-rt/lib/subvti3.c b/contrib/compiler-rt/lib/subvti3.c
index 55b7925..5d693dc 100644
--- a/contrib/compiler-rt/lib/subvti3.c
+++ b/contrib/compiler-rt/lib/subvti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/trampoline_setup.c b/contrib/compiler-rt/lib/trampoline_setup.c
index a2f49a4..a22199e 100644
--- a/contrib/compiler-rt/lib/trampoline_setup.c
+++ b/contrib/compiler-rt/lib/trampoline_setup.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*/
diff --git a/contrib/compiler-rt/lib/truncdfsf2.c b/contrib/compiler-rt/lib/truncdfsf2.c
index d289cb9..1dbf02f 100644
--- a/contrib/compiler-rt/lib/truncdfsf2.c
+++ b/contrib/compiler-rt/lib/truncdfsf2.c
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
@@ -41,6 +41,8 @@
#include <limits.h>
#include <stdbool.h>
+#include "abi.h"
+
typedef double src_t;
typedef uint64_t src_rep_t;
#define SRC_REP_C UINT64_C
@@ -66,7 +68,10 @@ static inline dst_t dstFromRep(dst_rep_t x) {
// End helper routines. Conversion implementation follows.
-dst_t __truncdfsf2(src_t a) {
+ARM_EABI_FNALIAS(d2f, truncdfsf2);
+
+COMPILER_RT_ABI dst_t
+__truncdfsf2(src_t a) {
// Various constants whose values follow from the type parameters.
// Any reasonable optimizer will fold and propagate all of these.
diff --git a/contrib/compiler-rt/lib/ucmpdi2.c b/contrib/compiler-rt/lib/ucmpdi2.c
index d2900ca..f2d3f99 100644
--- a/contrib/compiler-rt/lib/ucmpdi2.c
+++ b/contrib/compiler-rt/lib/ucmpdi2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -19,7 +20,7 @@
* if (a > b) returns 2
*/
-si_int
+COMPILER_RT_ABI si_int
__ucmpdi2(du_int a, du_int b)
{
udwords x;
diff --git a/contrib/compiler-rt/lib/ucmpti2.c b/contrib/compiler-rt/lib/ucmpti2.c
index 0e7eea3..11137c5 100644
--- a/contrib/compiler-rt/lib/ucmpti2.c
+++ b/contrib/compiler-rt/lib/ucmpti2.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/udivdi3.c b/contrib/compiler-rt/lib/udivdi3.c
index 25d1df6..bbd551a 100644
--- a/contrib/compiler-rt/lib/udivdi3.c
+++ b/contrib/compiler-rt/lib/udivdi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,14 +11,15 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
-du_int __udivmoddi4(du_int a, du_int b, du_int* rem);
+du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem);
/* Returns: a / b */
-du_int
+COMPILER_RT_ABI du_int
__udivdi3(du_int a, du_int b)
{
return __udivmoddi4(a, b, 0);
diff --git a/contrib/compiler-rt/lib/udivmoddi4.c b/contrib/compiler-rt/lib/udivmoddi4.c
index 9274230..c5db21c 100644
--- a/contrib/compiler-rt/lib/udivmoddi4.c
+++ b/contrib/compiler-rt/lib/udivmoddi4.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -20,7 +21,9 @@
/* Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide */
-du_int
+ARM_EABI_FNALIAS(uldivmod, udivmoddi4);
+
+COMPILER_RT_ABI du_int
__udivmoddi4(du_int a, du_int b, du_int* rem)
{
const unsigned n_uword_bits = sizeof(su_int) * CHAR_BIT;
diff --git a/contrib/compiler-rt/lib/udivmodsi4.c b/contrib/compiler-rt/lib/udivmodsi4.c
new file mode 100644
index 0000000..2a3ee27
--- /dev/null
+++ b/contrib/compiler-rt/lib/udivmodsi4.c
@@ -0,0 +1,31 @@
+/*===-- udivmodsi4.c - Implement __udivmodsi4 ------------------------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file implements __udivmodsi4 for the compiler_rt library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+#include "abi.h"
+
+#include "int_lib.h"
+
+extern su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d);
+
+
+/* Returns: a / b, *rem = a % b */
+
+COMPILER_RT_ABI su_int
+__udivmodsi4(su_int a, su_int b, su_int* rem)
+{
+ si_int d = __udivsi3(a,b);
+ *rem = a - (d*b);
+ return d;
+}
+
+
diff --git a/contrib/compiler-rt/lib/udivmodti4.c b/contrib/compiler-rt/lib/udivmodti4.c
index 53b4072..d1e19ed 100644
--- a/contrib/compiler-rt/lib/udivmodti4.c
+++ b/contrib/compiler-rt/lib/udivmodti4.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/udivsi3.c b/contrib/compiler-rt/lib/udivsi3.c
index 70528b6..721ae89 100644
--- a/contrib/compiler-rt/lib/udivsi3.c
+++ b/contrib/compiler-rt/lib/udivsi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,6 +11,7 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
@@ -18,7 +19,9 @@
/* Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide */
-su_int
+ARM_EABI_FNALIAS(uidiv, udivsi3);
+
+COMPILER_RT_ABI su_int
__udivsi3(su_int n, su_int d)
{
const unsigned n_uword_bits = sizeof(su_int) * CHAR_BIT;
diff --git a/contrib/compiler-rt/lib/udivti3.c b/contrib/compiler-rt/lib/udivti3.c
index fb810fd..7405a0f 100644
--- a/contrib/compiler-rt/lib/udivti3.c
+++ b/contrib/compiler-rt/lib/udivti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/umoddi3.c b/contrib/compiler-rt/lib/umoddi3.c
index 807bb5ce..9de1a64 100644
--- a/contrib/compiler-rt/lib/umoddi3.c
+++ b/contrib/compiler-rt/lib/umoddi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,14 +11,15 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
-du_int __udivmoddi4(du_int a, du_int b, du_int* rem);
+du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem);
/* Returns: a % b */
-du_int
+COMPILER_RT_ABI du_int
__umoddi3(du_int a, du_int b)
{
du_int r;
diff --git a/contrib/compiler-rt/lib/umodsi3.c b/contrib/compiler-rt/lib/umodsi3.c
index ead7737..569b7fc 100644
--- a/contrib/compiler-rt/lib/umodsi3.c
+++ b/contrib/compiler-rt/lib/umodsi3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
@@ -11,14 +11,15 @@
*
* ===----------------------------------------------------------------------===
*/
+#include "abi.h"
#include "int_lib.h"
/* Returns: a % b */
-su_int __udivsi3(su_int a, su_int b);
+su_int COMPILER_RT_ABI __udivsi3(su_int a, su_int b);
-su_int
+COMPILER_RT_ABI su_int
__umodsi3(su_int a, su_int b)
{
return a - __udivsi3(a, b) * b;
diff --git a/contrib/compiler-rt/lib/umodti3.c b/contrib/compiler-rt/lib/umodti3.c
index 6c8a758..8f20c5f 100644
--- a/contrib/compiler-rt/lib/umodti3.c
+++ b/contrib/compiler-rt/lib/umodti3.c
@@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
diff --git a/contrib/compiler-rt/lib/x86_64/floatundidf.S b/contrib/compiler-rt/lib/x86_64/floatundidf.S
index 6e684b2..1be553b 100644
--- a/contrib/compiler-rt/lib/x86_64/floatundidf.S
+++ b/contrib/compiler-rt/lib/x86_64/floatundidf.S
@@ -2,8 +2,8 @@
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
diff --git a/contrib/compiler-rt/lib/x86_64/floatundisf.S b/contrib/compiler-rt/lib/x86_64/floatundisf.S
index fe20963..89d3f07 100644
--- a/contrib/compiler-rt/lib/x86_64/floatundisf.S
+++ b/contrib/compiler-rt/lib/x86_64/floatundisf.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/compiler-rt/lib/x86_64/floatundixf.S b/contrib/compiler-rt/lib/x86_64/floatundixf.S
index 246f026..a7243f2 100644
--- a/contrib/compiler-rt/lib/x86_64/floatundixf.S
+++ b/contrib/compiler-rt/lib/x86_64/floatundixf.S
@@ -1,5 +1,5 @@
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
#include "../assembly.h"
diff --git a/contrib/dialog/dialog.h b/contrib/dialog/dialog.h
index e726573..ceeba45 100644
--- a/contrib/dialog/dialog.h
+++ b/contrib/dialog/dialog.h
@@ -1,5 +1,5 @@
/*
- * $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $
+ * $Id: dialog.h,v 1.224 2011/06/13 14:29:42 tom Exp $
*
* dialog.h -- common declarations for all dialog modules
*
@@ -44,7 +44,10 @@
#include <signal.h> /* fork() etc. */
#include <math.h> /* sqrt() */
-#undef ERR /* header conflict with Solaris xpg4 */
+/* header conflict with Solaris xpg4 versus <sys/regset.h> */
+#if defined(ERR) && (ERR == 13)
+#undef ERR
+#endif
#if defined(HAVE_NCURSESW_NCURSES_H)
#include <ncursesw/ncurses.h>
diff --git a/contrib/gcc/cfg.c b/contrib/gcc/cfg.c
index aa8eaca..ec11f43 100644
--- a/contrib/gcc/cfg.c
+++ b/contrib/gcc/cfg.c
@@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_block bb)
else
fprintf (file, ", ");
first = false;
- fprintf (file, bb_bitnames[i]);
+ fputs (bb_bitnames[i], file);
}
if (!first)
fprintf (file, ")");
diff --git a/contrib/gcc/output.h b/contrib/gcc/output.h
index 1d9b837..9b29059 100644
--- a/contrib/gcc/output.h
+++ b/contrib/gcc/output.h
@@ -109,13 +109,14 @@ extern void output_addr_const (FILE *, rtx);
/* Output a string of assembler code, substituting numbers, strings
and fixed syntactic prefixes. */
-#if GCC_VERSION >= 3004
+#if GCC_VERSION >= 3004 && !defined(__clang__)
#define ATTRIBUTE_ASM_FPRINTF(m, n) __attribute__ ((__format__ (__asm_fprintf__, m, n))) ATTRIBUTE_NONNULL(m)
/* This is a magic identifier which allows GCC to figure out the type
of HOST_WIDE_INT for %wd specifier checks. You must issue this
typedef before using the __asm_fprintf__ format attribute. */
typedef HOST_WIDE_INT __gcc_host_wide_int__;
#else
+/* FIXME(benl): what about %wd? */
#define ATTRIBUTE_ASM_FPRINTF(m, n) ATTRIBUTE_NONNULL(m)
#endif
diff --git a/contrib/gcc/rtl.h b/contrib/gcc/rtl.h
index 6c76f9d..d4af682 100644
--- a/contrib/gcc/rtl.h
+++ b/contrib/gcc/rtl.h
@@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifndef GCC_RTL_H
#define GCC_RTL_H
+#include <sys/param.h>
+#ifndef __PAST_END
+# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+#endif
+
#include "statistics.h"
#include "machmode.h"
#include "input.h"
@@ -565,12 +570,12 @@ extern void rtvec_check_failed_bounds (rtvec, int, const char *, int,
#define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N])
#define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N])
-#define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N])
+#define RTL_CHECKC1(RTX, N, C) __PAST_END((RTX)->u.fld, N)
#define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N])
-#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
+#define RTVEC_ELT(RTVEC, I) __PAST_END((RTVEC)->elem, I)
#define XWINT(RTX, N) ((RTX)->u.hwint[N])
#define XCWINT(RTX, N, C) ((RTX)->u.hwint[N])
-#define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
+#define XCMWINT(RTX, N, C, M) __PAST_END((RTX)->u.hwint, N)
#define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
#define XCNMPRV(RTX, C, M) (&(RTX)->u.rv)
#define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym)
diff --git a/contrib/gcc/tree.h b/contrib/gcc/tree.h
index 7861514..97090be 100644
--- a/contrib/gcc/tree.h
+++ b/contrib/gcc/tree.h
@@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifndef GCC_TREE_H
#define GCC_TREE_H
+#include <sys/param.h>
+#ifndef __PAST_END
+# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+#endif
+
#include "hashtab.h"
#include "machmode.h"
#include "input.h"
@@ -830,12 +835,12 @@ extern void omp_clause_range_check_failed (const tree, const char *, int,
#define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define EXPR_CHECK(T) (T)
#define NON_TYPE_CHECK(T) (T)
-#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
-#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
-#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
+#define TREE_VEC_ELT_CHECK(T, I) __PAST_END((T)->vec.a, I)
+#define TREE_OPERAND_CHECK(T, I) __PAST_END((T)->exp.operands, I)
+#define TREE_OPERAND_CHECK_CODE(T, CODE, I) __PAST_END((T)->exp.operands, I)
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
#define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i])
-#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
+#define OMP_CLAUSE_ELT_CHECK(T, i) __PAST_END((T)->omp_clause.ops, i)
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
diff --git a/contrib/gdb/gdb/ppcfbsd-tdep.c b/contrib/gdb/gdb/ppcfbsd-tdep.c
index 3828e7f..d835224 100644
--- a/contrib/gdb/gdb/ppcfbsd-tdep.c
+++ b/contrib/gdb/gdb/ppcfbsd-tdep.c
@@ -27,7 +27,9 @@
#include "target.h"
#include "breakpoint.h"
#include "value.h"
+#include "gdb_string.h"
#include "osabi.h"
+#include "regset.h"
#include "ppc-tdep.h"
#include "ppcfbsd-tdep.h"
@@ -80,6 +82,17 @@ ppcfbsd_supply_reg (char *regs, int regno)
regcache_raw_supply (current_regcache, PC_REGNUM,
regs + REG_PC_OFFSET);
}
+static void
+ppcfbsd_supply_gregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, void *gregs, size_t size)
+{
+ ppcfbsd_supply_reg (gregs, -1);
+}
+
+static struct regset ppcfbsd_gregset = {
+ NULL, (void*)ppcfbsd_supply_gregset
+};
void
ppcfbsd_fill_reg (char *regs, int regno)
@@ -144,6 +157,20 @@ ppcfbsd_supply_fpreg (char *fpregs, int regno)
fpregs + FPREG_FPSCR_OFFSET);
}
+static void
+ppcfbsd_supply_fpregset (const struct regset *regset,
+ struct regcache * regcache,
+ int regnum, void *fpset, size_t size)
+{
+ ppcfbsd_supply_fpreg (fpset, -1);
+}
+
+
+static struct regset ppcfbsd_fpregset =
+{
+ NULL, (void*)ppcfbsd_supply_fpregset
+};
+
void
ppcfbsd_fill_fpreg (char *fpregs, int regno)
{
@@ -174,69 +201,285 @@ ppcfbsd_fill_fpreg (char *fpregs, int regno)
fpregs + FPREG_FPSCR_OFFSET);
}
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
- CORE_ADDR ignore)
+/* Return the appropriate register set for the core section identified
+ by SECT_NAME and SECT_SIZE. */
+
+const struct regset *
+ppcfbsd_regset_from_core_section (struct gdbarch *gdbarch,
+ const char *sect_name, size_t sect_size)
{
- char *regs, *fpregs;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (strcmp (sect_name, ".reg") == 0 && sect_size >= SIZEOF_STRUCT_REG)
+ return &ppcfbsd_gregset;
- /* We get everything from one section. */
- if (which != 0)
- return;
+ if (strcmp (sect_name, ".reg2") == 0 && sect_size >= SIZEOF_STRUCT_FPREG)
+ return &ppcfbsd_fpregset;
- regs = core_reg_sect;
- fpregs = core_reg_sect + SIZEOF_STRUCT_REG;
+ return NULL;
+}
- /* Integer registers. */
- ppcfbsd_supply_reg (regs, -1);
- /* Floating point registers. */
- ppcfbsd_supply_fpreg (fpregs, -1);
+/* Macros for matching instructions. Note that, since all the
+ operands are masked off before they're or-ed into the instruction,
+ you can use -1 to make masks. */
+
+#define insn_d(opcd, rts, ra, d) \
+ ((((opcd) & 0x3f) << 26) \
+ | (((rts) & 0x1f) << 21) \
+ | (((ra) & 0x1f) << 16) \
+ | ((d) & 0xffff))
+
+#define insn_ds(opcd, rts, ra, d, xo) \
+ ((((opcd) & 0x3f) << 26) \
+ | (((rts) & 0x1f) << 21) \
+ | (((ra) & 0x1f) << 16) \
+ | ((d) & 0xfffc) \
+ | ((xo) & 0x3))
+
+#define insn_xfx(opcd, rts, spr, xo) \
+ ((((opcd) & 0x3f) << 26) \
+ | (((rts) & 0x1f) << 21) \
+ | (((spr) & 0x1f) << 16) \
+ | (((spr) & 0x3e0) << 6) \
+ | (((xo) & 0x3ff) << 1))
+
+/* Read a PPC instruction from memory. PPC instructions are always
+ big-endian, no matter what endianness the program is running in, so
+ we can't use read_memory_integer or one of its friends here. */
+static unsigned int
+read_insn (CORE_ADDR pc)
+{
+ unsigned char buf[4];
+
+ read_memory (pc, buf, 4);
+ return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
}
-static void
-fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size, int which,
- CORE_ADDR ignore)
+
+/* An instruction to match. */
+struct insn_pattern
{
- switch (which)
+ unsigned int mask; /* mask the insn with this... */
+ unsigned int data; /* ...and see if it matches this. */
+ int optional; /* If non-zero, this insn may be absent. */
+};
+
+/* Return non-zero if the instructions at PC match the series
+ described in PATTERN, or zero otherwise. PATTERN is an array of
+ 'struct insn_pattern' objects, terminated by an entry whose mask is
+ zero.
+
+ When the match is successful, fill INSN[i] with what PATTERN[i]
+ matched. If PATTERN[i] is optional, and the instruction wasn't
+ present, set INSN[i] to 0 (which is not a valid PPC instruction).
+ INSN should have as many elements as PATTERN. Note that, if
+ PATTERN contains optional instructions which aren't present in
+ memory, then INSN will have holes, so INSN[i] isn't necessarily the
+ i'th instruction in memory. */
+static int
+insns_match_pattern (CORE_ADDR pc,
+ struct insn_pattern *pattern,
+ unsigned int *insn)
+{
+ int i;
+
+ for (i = 0; pattern[i].mask; i++)
{
- case 0: /* Integer registers. */
- if (core_reg_size != SIZEOF_STRUCT_REG)
- warning (_("Wrong size register set in core file."));
+ insn[i] = read_insn (pc);
+ if ((insn[i] & pattern[i].mask) == pattern[i].data)
+ pc += 4;
+ else if (pattern[i].optional)
+ insn[i] = 0;
else
- ppcfbsd_supply_reg (core_reg_sect, -1);
- break;
+ return 0;
+ }
- case 2: /* Floating point registers. */
- if (core_reg_size != SIZEOF_STRUCT_FPREG)
- warning (_("Wrong size FP register set in core file."));
- else
- ppcfbsd_supply_fpreg (core_reg_sect, -1);
- break;
+ return 1;
+}
- default:
- /* Don't know what kind of register request this is; just ignore it. */
- break;
- }
+
+/* Return the 'd' field of the d-form instruction INSN, properly
+ sign-extended. */
+static CORE_ADDR
+insn_d_field (unsigned int insn)
+{
+ return ((((CORE_ADDR) insn & 0xffff) ^ 0x8000) - 0x8000);
}
-static struct core_fns ppcfbsd_core_fns =
+
+/* Return the 'ds' field of the ds-form instruction INSN, with the two
+ zero bits concatenated at the right, and properly
+ sign-extended. */
+static CORE_ADDR
+insn_ds_field (unsigned int insn)
{
- bfd_target_unknown_flavour, /* core_flavour */
- default_check_format, /* check_format */
- default_core_sniffer, /* core_sniffer */
- fetch_core_registers, /* core_read_registers */
- NULL /* next */
-};
+ return ((((CORE_ADDR) insn & 0xfffc) ^ 0x8000) - 0x8000);
+}
+
-static struct core_fns ppcfbsd_elfcore_fns =
+/* If DESC is the address of a 64-bit PowerPC FreeBSD function
+ descriptor, return the descriptor's entry point. */
+static CORE_ADDR
+ppc64_desc_entry_point (CORE_ADDR desc)
{
- bfd_target_elf_flavour, /* core_flavour */
- default_check_format, /* check_format */
- default_core_sniffer, /* core_sniffer */
- fetch_elfcore_registers, /* core_read_registers */
- NULL /* next */
-};
+ /* The first word of the descriptor is the entry point. */
+ return (CORE_ADDR) read_memory_unsigned_integer (desc, 8);
+}
+
+
+/* Pattern for the standard linkage function. These are built by
+ build_plt_stub in elf64-ppc.c, whose GLINK argument is always
+ zero. */
+static struct insn_pattern ppc64_standard_linkage[] =
+ {
+ /* addis r12, r2, <any> */
+ { insn_d (-1, -1, -1, 0), insn_d (15, 12, 2, 0), 0 },
+
+ /* std r2, 40(r1) */
+ { -1, insn_ds (62, 2, 1, 40, 0), 0 },
+
+ /* ld r11, <any>(r12) */
+ { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 0 },
+
+ /* addis r12, r12, 1 <optional> */
+ { insn_d (-1, -1, -1, -1), insn_d (15, 12, 2, 1), 1 },
+
+ /* ld r2, <any>(r12) */
+ { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 2, 12, 0, 0), 0 },
+
+ /* addis r12, r12, 1 <optional> */
+ { insn_d (-1, -1, -1, -1), insn_d (15, 12, 2, 1), 1 },
+
+ /* mtctr r11 */
+ { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 11, 9, 467),
+ 0 },
+
+ /* ld r11, <any>(r12) */
+ { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 0 },
+
+ /* bctr */
+ { -1, 0x4e800420, 0 },
+
+ { 0, 0, 0 }
+ };
+#define PPC64_STANDARD_LINKAGE_LEN \
+ (sizeof (ppc64_standard_linkage) / sizeof (ppc64_standard_linkage[0]))
+
+/* When the dynamic linker is doing lazy symbol resolution, the first
+ call to a function in another object will go like this:
+
+ - The user's function calls the linkage function:
+
+ 100007c4: 4b ff fc d5 bl 10000498
+ 100007c8: e8 41 00 28 ld r2,40(r1)
+
+ - The linkage function loads the entry point (and other stuff) from
+ the function descriptor in the PLT, and jumps to it:
+
+ 10000498: 3d 82 00 00 addis r12,r2,0
+ 1000049c: f8 41 00 28 std r2,40(r1)
+ 100004a0: e9 6c 80 98 ld r11,-32616(r12)
+ 100004a4: e8 4c 80 a0 ld r2,-32608(r12)
+ 100004a8: 7d 69 03 a6 mtctr r11
+ 100004ac: e9 6c 80 a8 ld r11,-32600(r12)
+ 100004b0: 4e 80 04 20 bctr
+
+ - But since this is the first time that PLT entry has been used, it
+ sends control to its glink entry. That loads the number of the
+ PLT entry and jumps to the common glink0 code:
+
+ 10000c98: 38 00 00 00 li r0,0
+ 10000c9c: 4b ff ff dc b 10000c78
+
+ - The common glink0 code then transfers control to the dynamic
+ linker's fixup code:
+
+ 10000c78: e8 41 00 28 ld r2,40(r1)
+ 10000c7c: 3d 82 00 00 addis r12,r2,0
+ 10000c80: e9 6c 80 80 ld r11,-32640(r12)
+ 10000c84: e8 4c 80 88 ld r2,-32632(r12)
+ 10000c88: 7d 69 03 a6 mtctr r11
+ 10000c8c: e9 6c 80 90 ld r11,-32624(r12)
+ 10000c90: 4e 80 04 20 bctr
+
+ Eventually, this code will figure out how to skip all of this,
+ including the dynamic linker. At the moment, we just get through
+ the linkage function. */
+
+/* If the current thread is about to execute a series of instructions
+ at PC matching the ppc64_standard_linkage pattern, and INSN is the result
+ from that pattern match, return the code address to which the
+ standard linkage function will send them. (This doesn't deal with
+ dynamic linker lazy symbol resolution stubs.) */
+static CORE_ADDR
+ppc64_standard_linkage_target (CORE_ADDR pc, unsigned int *insn)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ /* The address of the function descriptor this linkage function
+ references. */
+ CORE_ADDR desc
+ = ((CORE_ADDR) read_register (tdep->ppc_gp0_regnum + 2)
+ + (insn_d_field (insn[0]) << 16)
+ + insn_ds_field (insn[2]));
+
+ /* The first word of the descriptor is the entry point. Return that. */
+ return ppc64_desc_entry_point (desc);
+}
+
+
+/* Given that we've begun executing a call trampoline at PC, return
+ the entry point of the function the trampoline will go to. */
+static CORE_ADDR
+ppc64_skip_trampoline_code (CORE_ADDR pc)
+{
+ unsigned int ppc64_standard_linkage_insn[PPC64_STANDARD_LINKAGE_LEN];
+
+ if (insns_match_pattern (pc, ppc64_standard_linkage,
+ ppc64_standard_linkage_insn))
+ return ppc64_standard_linkage_target (pc, ppc64_standard_linkage_insn);
+ else
+ return 0;
+}
+
+
+/* Support for CONVERT_FROM_FUNC_PTR_ADDR (ARCH, ADDR, TARG) on PPC64
+ GNU/Linux and FreeBSD.
+
+ Usually a function pointer's representation is simply the address
+ of the function. On GNU/Linux on the 64-bit PowerPC however, a
+ function pointer is represented by a pointer to a TOC entry. This
+ TOC entry contains three words, the first word is the address of
+ the function, the second word is the TOC pointer (r2), and the
+ third word is the static chain value. Throughout GDB it is
+ currently assumed that a function pointer contains the address of
+ the function, which is not easy to fix. In addition, the
+ conversion of a function address to a function pointer would
+ require allocation of a TOC entry in the inferior's memory space,
+ with all its drawbacks. To be able to call C++ virtual methods in
+ the inferior (which are called via function pointers),
+ find_function_addr uses this function to get the function address
+ from a function pointer. */
+
+/* If ADDR points at what is clearly a function descriptor, transform
+ it into the address of the corresponding function. Be
+ conservative, otherwize GDB will do the transformation on any
+ random addresses such as occures when there is no symbol table. */
+
+static CORE_ADDR
+ppc64_fbsd_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+ CORE_ADDR addr,
+ struct target_ops *targ)
+{
+ struct section_table *s = target_section_by_addr (targ, addr);
+
+ /* Check if ADDR points to a function descriptor. */
+ if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
+ return get_target_memory_unsigned (targ, addr, 8);
+
+ return addr;
+}
static int
ppcfbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
@@ -270,27 +513,42 @@ static void
ppcfbsd_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ /* FreeBSD doesn't support the 128-bit `long double' from the psABI. */
+ set_gdbarch_long_double_bit (gdbarch, 64);
+
set_gdbarch_pc_in_sigtramp (gdbarch, ppcfbsd_pc_in_sigtramp);
- /* For NetBSD, this is an on again, off again thing. Some systems
- do use the broken struct convention, and some don't. */
- set_gdbarch_return_value (gdbarch, ppcfbsd_return_value);
-#ifdef __powerpc64__
- set_solib_svr4_fetch_link_map_offsets (gdbarch,
- svr4_lp64_fetch_link_map_offsets);
-#else
- set_solib_svr4_fetch_link_map_offsets (gdbarch,
- svr4_ilp32_fetch_link_map_offsets);
-#endif
+
+ if (tdep->wordsize == 4)
+ {
+ set_gdbarch_return_value (gdbarch, ppcfbsd_return_value);
+ set_solib_svr4_fetch_link_map_offsets (gdbarch,
+ svr4_ilp32_fetch_link_map_offsets);
+ }
+
+ if (tdep->wordsize == 8)
+ {
+ set_gdbarch_convert_from_func_ptr_addr
+ (gdbarch, ppc64_fbsd_convert_from_func_ptr_addr);
+
+ set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code);
+
+ set_solib_svr4_fetch_link_map_offsets (gdbarch,
+ svr4_lp64_fetch_link_map_offsets);
+ }
+
+ set_gdbarch_regset_from_core_section (gdbarch,
+ ppcfbsd_regset_from_core_section);
}
void
_initialize_ppcfbsd_tdep (void)
{
+ gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc,
+ GDB_OSABI_FREEBSD_ELF, ppcfbsd_init_abi);
+ gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64,
+ GDB_OSABI_FREEBSD_ELF, ppcfbsd_init_abi);
gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_FREEBSD_ELF,
ppcfbsd_init_abi);
- gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_FREEBSD_ELF,
- ppcfbsd_init_abi);
-
- add_core_fns (&ppcfbsd_core_fns);
- add_core_fns (&ppcfbsd_elfcore_fns);
}
diff --git a/contrib/gperf/src/gen-perf.cc b/contrib/gperf/src/gen-perf.cc
index 8840dc6..7cf9f06 100644
--- a/contrib/gperf/src/gen-perf.cc
+++ b/contrib/gperf/src/gen-perf.cc
@@ -246,7 +246,7 @@ Gen_Perf::change (List_Node *prior, List_Node *curr)
{
if (option[DEBUG])
{
- fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n",
+ fprintf (stderr, " by changing asso_value['%c'] (char #%td) to %d\n",
*p, p - union_set + 1, asso_values[(unsigned char)(*p)]);
fflush (stderr);
}
diff --git a/contrib/gperf/src/key-list.cc b/contrib/gperf/src/key-list.cc
index 2461470..11292bc 100644
--- a/contrib/gperf/src/key-list.cc
+++ b/contrib/gperf/src/key-list.cc
@@ -1441,7 +1441,7 @@ Key_List::output_lookup_array (void)
if (option[DEBUG])
fprintf (stderr,
- "dup_ptr[%zd]: hash_value = %d, index = %d, count = %d\n",
+ "dup_ptr[%td]: hash_value = %d, index = %d, count = %d\n",
dup_ptr - duplicates,
dup_ptr->hash_value, dup_ptr->index, dup_ptr->count);
diff --git a/contrib/groff/tmac/doc-common b/contrib/groff/tmac/doc-common
index 26dcc56..20d0cab 100644
--- a/contrib/groff/tmac/doc-common
+++ b/contrib/groff/tmac/doc-common
@@ -543,6 +543,7 @@
.ds doc-operating-system-FreeBSD-7.3 7.3
.ds doc-operating-system-FreeBSD-8.0 8.0
.ds doc-operating-system-FreeBSD-8.1 8.1
+.ds doc-operating-system-FreeBSD-8.2 8.2
.
.ds doc-operating-system-Darwin-8.0.0 8.0.0
.ds doc-operating-system-Darwin-8.1.0 8.1.0
@@ -563,6 +564,17 @@
.ds doc-operating-system-Darwin-9.4.0 9.4.0
.ds doc-operating-system-Darwin-9.5.0 9.5.0
.ds doc-operating-system-Darwin-9.6.0 9.6.0
+.ds doc-operating-system-Darwin-9.7.0 9.7.0
+.ds doc-operating-system-Darwin-9.8.0 9.8.0
+.ds doc-operating-system-Darwin-10.6.0 10.6.0
+.ds doc-operating-system-Darwin-10.1.0 10.1.0
+.ds doc-operating-system-Darwin-10.2.0 10.2.0
+.ds doc-operating-system-Darwin-10.3.0 10.3.0
+.ds doc-operating-system-Darwin-10.4.0 10.4.0
+.ds doc-operating-system-Darwin-10.5.0 10.5.0
+.ds doc-operating-system-Darwin-10.6.0 10.6.0
+.ds doc-operating-system-Darwin-10.7.0 10.7.0
+.ds doc-operating-system-Darwin-11.0.0 11.0.0
.
.ds doc-operating-system-DragonFly-1.0 1.0
.ds doc-operating-system-DragonFly-1.1 1.1
diff --git a/contrib/groff/tmac/doc-syms b/contrib/groff/tmac/doc-syms
index d2a070d..0e862ad 100644
--- a/contrib/groff/tmac/doc-syms
+++ b/contrib/groff/tmac/doc-syms
@@ -617,6 +617,8 @@
.\" POSIX Part 1: System API
.ds doc-str-St--p1003.1 \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1
.as doc-str-St--p1003.1 " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
+.ds doc-str-St--p1003.1b \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1b
+.as doc-str-St--p1003.1b " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
.ds doc-str-St--p1003.1-88 \*[doc-Tn-font-size]\%IEEE\*[doc-str-St] Std 1003.1-1988
.as doc-str-St--p1003.1-88 " (\*[Lq]\)\*[Px]\*[doc-str-St].1\*[Rq])
.ds doc-str-St--p1003.1-90 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9945-1:1990
@@ -754,6 +756,7 @@
.
.ds doc-str-Lb-libarm ARM Architecture Library (libarm, \-larm)
.ds doc-str-Lb-libarm32 ARM32 Architecture Library (libarm32, \-larm32)
+.ds doc-str-Lb-libbsm Basic Security Module Library (libbsm, \-lbsm)
.ds doc-str-Lb-libc Standard C\~Library (libc, \-lc)
.ds doc-str-Lb-libcdk Curses Development Kit Library (libcdk, \-lcdk)
.ds doc-str-Lb-libcompat Compatibility Library (libcompat, \-lcompat)
@@ -779,6 +782,7 @@
.ds doc-str-Lb-libpthread \*[Px] \*[doc-str-Lb]Threads Library (libpthread, \-lpthread)
.ds doc-str-Lb-libresolv DNS Resolver Library (libresolv, \-lresolv)
.ds doc-str-Lb-librt \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt)
+.ds doc-str-Lb-libSystem System Library (libSystem, \-lSystem)
.ds doc-str-Lb-libtermcap Termcap Access Library (libtermcap, \-ltermcap)
.ds doc-str-Lb-libusbhid USB Human Interface Devices Library (libusbhid, \-lusbhid)
.ds doc-str-Lb-libutil System Utilities Library (libutil, \-lutil)
diff --git a/contrib/groff/tmac/doc.tmac b/contrib/groff/tmac/doc.tmac
index 7bdbf32..c1c32dc 100644
--- a/contrib/groff/tmac/doc.tmac
+++ b/contrib/groff/tmac/doc.tmac
@@ -1197,8 +1197,14 @@
. if !\n[doc-arg-limit] \
. ds doc-macro-name Aq
.
-. ds doc-quote-left <
-. ds doc-quote-right >
+. ie "\*[doc-macro-name]"An" \{\
+. ds doc-quote-left <
+. ds doc-quote-right >
+. \}
+. el \{\
+. ds doc-quote-left \[la]
+. ds doc-quote-right \[ra]
+. \}
.
. doc-enclose-string \$@
..
@@ -1527,7 +1533,10 @@
. if !\n[doc-arg-limit] \
. ds doc-macro-name Ao
.
-. ds doc-quote-left \[la]
+. ie "\*[doc-macro-name]"An" \
+. ds doc-quote-left <
+. el \
+. ds doc-quote-left \[la]
.
. doc-enclose-open \$@
..
@@ -1546,7 +1555,10 @@
. if !\n[doc-arg-limit] \
. ds doc-macro-name Ac
.
-. ds doc-quote-right \[ra]
+. ie "\*[doc-macro-name]"An" \
+. ds doc-quote-right >
+. el \
+. ds doc-quote-right \[ra]
.
. doc-enclose-close \$@
..
diff --git a/contrib/groff/tmac/troffrc b/contrib/groff/tmac/troffrc
index 5defe8a..92b5fad 100644
--- a/contrib/groff/tmac/troffrc
+++ b/contrib/groff/tmac/troffrc
@@ -50,12 +50,4 @@ troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html
.\" Handle paper formats
.do mso papersize.tmac
.
-.\" Disable SGR support in grotty(1).
-.if n \{\
-. do nop \X'tty: sgr 0'
-. sp -1
-. nr nl 0-1
-. nr % -1
-.\}
-.
.\" Don't let blank lines creep in here.
diff --git a/contrib/less/NEWS b/contrib/less/NEWS
index 4beefaf..eb38025 100644
--- a/contrib/less/NEWS
+++ b/contrib/less/NEWS
@@ -12,6 +12,15 @@
======================================================================
+ Major changes between "less" versions 443 and 444
+
+* Fix bug in unget handling that can cause strange effects on the
+ command line.
+
+* Remove vestiges of obsolete -l option that can cause a crash.
+
+======================================================================
+
Major changes between "less" versions 436 and 443
* Change search behavior such that when a search is given an explicit
diff --git a/contrib/less/README b/contrib/less/README
index 8d5a95b..ba6f269 100644
--- a/contrib/less/README
+++ b/contrib/less/README
@@ -7,9 +7,9 @@
**************************************************************************
**************************************************************************
- Less, version 443
+ Less, version 444
- This is the distribution of less, version 443, released 09 Apr 2011.
+ This is the distribution of less, version 444, released 09 Jun 2011.
This program is part of the GNU project (http://www.gnu.org).
This program is free software. You may redistribute it and/or
diff --git a/contrib/less/command.c b/contrib/less/command.c
index 653db0b..41c3869 100644
--- a/contrib/less/command.c
+++ b/contrib/less/command.c
@@ -302,7 +302,7 @@ is_erase_char(c)
*/
static int
mca_opt_first_char(c)
- int c;
+ int c;
{
int flag = (optflag & ~OPT_NO_PROMPT);
if (flag == OPT_NO_TOGGLE)
@@ -846,6 +846,7 @@ ungetcc(c)
ug->ug_char = c;
ug->ug_next = ungot;
ungot = ug;
+ unget_end = 0;
}
/*
diff --git a/contrib/less/funcs.h b/contrib/less/funcs.h
index 8464ada..6595232 100644
--- a/contrib/less/funcs.h
+++ b/contrib/less/funcs.h
@@ -194,7 +194,6 @@
public void unmark ();
public void opt_o ();
public void opt__O ();
- public void opt_l ();
public void opt_j ();
public void calc_jump_sline ();
public void opt_shift ();
diff --git a/contrib/less/less.man b/contrib/less/less.man
index 86e329c..a54609d 100644
--- a/contrib/less/less.man
+++ b/contrib/less/less.man
@@ -1156,7 +1156,7 @@ LESS(1) LESS(1)
next 8bcccbcc18b95.bb125.bb
If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings
- "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_TYPE or
+ "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_CTYPE or
LANG environment variables, then the default character set is utf-8.
If that string is not found, but your system supports the setlocale
@@ -1580,4 +1580,4 @@ LESS(1) LESS(1)
- Version 443: 09 Apr 2011 LESS(1)
+ Version 444: 09 Jun 2011 LESS(1)
diff --git a/contrib/less/less.nro b/contrib/less/less.nro
index 33050e1..0bc21b5 100644
--- a/contrib/less/less.nro
+++ b/contrib/less/less.nro
@@ -1,4 +1,4 @@
-.TH LESS 1 "Version 443: 09 Apr 2011"
+.TH LESS 1 "Version 444: 09 Jun 2011"
.SH NAME
less \- opposite of more
.SH SYNOPSIS
@@ -1276,7 +1276,7 @@ to each of the possible values for LESSCHARSET:
.PP
If neither LESSCHARSET nor LESSCHARDEF is set,
but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8"
-is found in the LC_ALL, LC_TYPE or LANG
+is found in the LC_ALL, LC_CTYPE or LANG
environment variables, then the default character set is utf-8.
.PP
If that string is not found, but your system supports the
diff --git a/contrib/less/lessecho.man b/contrib/less/lessecho.man
index 32bccba..682b0bd 100644
--- a/contrib/less/lessecho.man
+++ b/contrib/less/lessecho.man
@@ -46,4 +46,4 @@ LESSECHO(1) LESSECHO(1)
- Version 443: 09 Apr 2011 LESSECHO(1)
+ Version 444: 09 Jun 2011 LESSECHO(1)
diff --git a/contrib/less/lessecho.nro b/contrib/less/lessecho.nro
index 5c17708..46540e8 100644
--- a/contrib/less/lessecho.nro
+++ b/contrib/less/lessecho.nro
@@ -1,4 +1,4 @@
-.TH LESSECHO 1 "Version 443: 09 Apr 2011"
+.TH LESSECHO 1 "Version 444: 09 Jun 2011"
.SH NAME
lessecho \- expand metacharacters
.SH SYNOPSIS
diff --git a/contrib/less/lesskey.man b/contrib/less/lesskey.man
index b315ea6..5e0a999 100644
--- a/contrib/less/lesskey.man
+++ b/contrib/less/lesskey.man
@@ -354,4 +354,4 @@ LESSKEY(1) LESSKEY(1)
- Version 443: 09 Apr 2011 LESSKEY(1)
+ Version 444: 09 Jun 2011 LESSKEY(1)
diff --git a/contrib/less/lesskey.nro b/contrib/less/lesskey.nro
index 8c99a0f..d305b95 100644
--- a/contrib/less/lesskey.nro
+++ b/contrib/less/lesskey.nro
@@ -1,4 +1,4 @@
-.TH LESSKEY 1 "Version 443: 09 Apr 2011"
+.TH LESSKEY 1 "Version 444: 09 Jun 2011"
.SH NAME
lesskey \- specify key bindings for less
.SH SYNOPSIS
diff --git a/contrib/less/optfunc.c b/contrib/less/optfunc.c
index 79ac7c6..a0aa10a 100644
--- a/contrib/less/optfunc.c
+++ b/contrib/less/optfunc.c
@@ -132,34 +132,6 @@ opt__O(type, s)
#endif
/*
- * Handlers for -l option.
- */
- public void
-opt_l(type, s)
- int type;
- char *s;
-{
- int err;
- int n;
- char *t;
-
- switch (type)
- {
- case INIT:
- t = s;
- n = getnum(&t, "l", &err);
- if (err || n <= 0)
- {
- error("Line number is required after -l", NULL_PARG);
- return;
- }
- plusoption = TRUE;
- ungetsc(s);
- break;
- }
-}
-
-/*
* Handlers for -j option.
*/
public void
diff --git a/contrib/less/opttbl.c b/contrib/less/opttbl.c
index d1c60a2..63f6889 100644
--- a/contrib/less/opttbl.c
+++ b/contrib/less/opttbl.c
@@ -263,10 +263,6 @@ static struct loption option[] =
NULL
}
},
- { 'l', NULL,
- STRING|NO_TOGGLE|NO_QUERY, 0, NULL, opt_l,
- { NULL, NULL, NULL }
- },
{ 'L', &L__optname,
BOOL, OPT_ON, &use_lessopen, NULL,
{
diff --git a/contrib/less/version.c b/contrib/less/version.c
index be75d20..dc5bb0c 100644
--- a/contrib/less/version.c
+++ b/contrib/less/version.c
@@ -742,6 +742,7 @@ v441 1/21/11 Fix semi-infinite loop if no newlines in file;
v442 3/2/11 Fix search bug.
Add ctrl-G line edit command.
v443 4/9/11 Fix Windows build.
+v444 6/8/11 Fix ungetc bug; remove vestiges of obsolete -l option.
*/
-char version[] = "443";
+char version[] = "444";
diff --git a/contrib/libpcap/pcap-bpf.c b/contrib/libpcap/pcap-bpf.c
index 10dcfd1..5e3d3ea 100644
--- a/contrib/libpcap/pcap-bpf.c
+++ b/contrib/libpcap/pcap-bpf.c
@@ -1281,6 +1281,7 @@ pcap_cleanup_bpf(pcap_t *p)
munmap(p->md.zbuf1, p->md.zbufsize);
if (p->md.zbuf2 != MAP_FAILED && p->md.zbuf2 != NULL)
munmap(p->md.zbuf2, p->md.zbufsize);
+ p->buffer = NULL;
}
#endif
if (p->md.device != NULL) {
diff --git a/contrib/llvm/include/llvm-c/Core.h b/contrib/llvm/include/llvm-c/Core.h
index 39c3cb4..2eccc11 100644
--- a/contrib/llvm/include/llvm-c/Core.h
+++ b/contrib/llvm/include/llvm-c/Core.h
@@ -282,6 +282,8 @@ typedef enum {
LLVMRealPredicateTrue /**< Always true (always folded) */
} LLVMRealPredicate;
+void LLVMInitializeCore(LLVMPassRegistryRef R);
+
/*===-- Error handling ----------------------------------------------------===*/
@@ -1164,6 +1166,7 @@ namespace llvm {
for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I)
cast<T>(*I);
#endif
+ (void)Length;
return reinterpret_cast<T**>(Vals);
}
diff --git a/contrib/llvm/include/llvm-c/Disassembler.h b/contrib/llvm/include/llvm-c/Disassembler.h
index 9f10973..3a3eb23 100644
--- a/contrib/llvm/include/llvm-c/Disassembler.h
+++ b/contrib/llvm/include/llvm-c/Disassembler.h
@@ -7,16 +7,16 @@
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
-|* This header provides public interface to a disassembler library. *|
+|* This header provides a public interface to a disassembler library. *|
|* LLVM provides an implementation of this interface. *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifndef LLVM_C_DISASSEMBLER_H
-#define LLVM_C_DISASSEMBLER_H 1
+#define LLVM_C_DISASSEMBLER_H
-#include <stddef.h>
#include "llvm/Support/DataTypes.h"
+#include <stddef.h>
/**
* An opaque reference to a disassembler context.
@@ -38,14 +38,11 @@ typedef void *LLVMDisasmContextRef;
* will be the instruction width. The information is returned in TagBuf and is
* Triple specific with its specific information defined by the value of
* TagType for that Triple. If symbolic information is returned the function
- * returns 1 else it returns 0.
+ * returns 1, otherwise it returns 0.
*/
-typedef int (*LLVMOpInfoCallback)(void *DisInfo,
- uint64_t PC,
- uint64_t Offset,
- uint64_t Size,
- int TagType,
- void *TagBuf);
+typedef int (*LLVMOpInfoCallback)(void *DisInfo, uint64_t PC,
+ uint64_t Offset, uint64_t Size,
+ int TagType, void *TagBuf);
/**
* The initial support in LLVM MC for the most general form of a relocatable
@@ -68,10 +65,11 @@ typedef int (*LLVMOpInfoCallback)(void *DisInfo,
* operands like "_foo@GOT", ":lower16:_foo", etc.
*/
struct LLVMOpInfoSymbol1 {
- uint64_t Present; /* 1 if this symbol is present */
- char *Name; /* symbol name if not NULL */
- uint64_t Value; /* symbol value if name is NULL */
+ uint64_t Present; /* 1 if this symbol is present */
+ char *Name; /* symbol name if not NULL */
+ uint64_t Value; /* symbol value if name is NULL */
};
+
struct LLVMOpInfo1 {
struct LLVMOpInfoSymbol1 AddSymbol;
struct LLVMOpInfoSymbol1 SubtractSymbol;
@@ -92,11 +90,11 @@ struct LLVMOpInfo1 {
/**
* The type for the symbol lookup function. This may be called by the
- * disassembler for such things like adding a comment for a PC plus a constant
+ * disassembler for things like adding a comment for a PC plus a constant
* offset load instruction to use a symbol name instead of a load address value.
* It is passed the block information is saved when the disassembler context is
* created and a value of a symbol to look up. If no symbol is found NULL is
- * to be returned.
+ * returned.
*/
typedef const char *(*LLVMSymbolLookupCallback)(void *DisInfo,
uint64_t SymbolValue);
@@ -107,40 +105,33 @@ extern "C" {
/**
* Create a disassembler for the TripleName. Symbolic disassembly is supported
- * by passing a block of information in the DisInfo parameter and specifing the
- * TagType and call back functions as described above. These can all be passed
- * as NULL. If successful this returns a disassembler context if not it
+ * by passing a block of information in the DisInfo parameter and specifying the
+ * TagType and callback functions as described above. These can all be passed
+ * as NULL. If successful, this returns a disassembler context. If not, it
* returns NULL.
*/
-extern LLVMDisasmContextRef
-LLVMCreateDisasm(const char *TripleName,
- void *DisInfo,
- int TagType,
- LLVMOpInfoCallback GetOpInfo,
- LLVMSymbolLookupCallback SymbolLookUp);
+LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
+ int TagType, LLVMOpInfoCallback GetOpInfo,
+ LLVMSymbolLookupCallback SymbolLookUp);
/**
* Dispose of a disassembler context.
*/
-extern void
-LLVMDisasmDispose(LLVMDisasmContextRef DC);
+void LLVMDisasmDispose(LLVMDisasmContextRef DC);
/**
- * Disassmble a single instruction using the disassembler context specified in
- * the parameter DC. The bytes of the instruction are specified in the parameter
- * Bytes, and contains at least BytesSize number of bytes. The instruction is
- * at the address specified by the PC parameter. If a valid instruction can be
- * disassembled its string is returned indirectly in OutString which whos size
- * is specified in the parameter OutStringSize. This function returns the
- * number of bytes in the instruction or zero if there was no valid instruction.
+ * Disassemble a single instruction using the disassembler context specified in
+ * the parameter DC. The bytes of the instruction are specified in the
+ * parameter Bytes, and contains at least BytesSize number of bytes. The
+ * instruction is at the address specified by the PC parameter. If a valid
+ * instruction can be disassembled, its string is returned indirectly in
+ * OutString whose size is specified in the parameter OutStringSize. This
+ * function returns the number of bytes in the instruction or zero if there was
+ * no valid instruction.
*/
-extern size_t
-LLVMDisasmInstruction(LLVMDisasmContextRef DC,
- uint8_t *Bytes,
- uint64_t BytesSize,
- uint64_t PC,
- char *OutString,
- size_t OutStringSize);
+size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes,
+ uint64_t BytesSize, uint64_t PC,
+ char *OutString, size_t OutStringSize);
#ifdef __cplusplus
}
diff --git a/contrib/llvm/include/llvm/ADT/FoldingSet.h b/contrib/llvm/include/llvm/ADT/FoldingSet.h
index 52e0434..d2e0b8f 100644
--- a/contrib/llvm/include/llvm/ADT/FoldingSet.h
+++ b/contrib/llvm/include/llvm/ADT/FoldingSet.h
@@ -671,17 +671,10 @@ public:
// Partial specializations of FoldingSetTrait.
template<typename T> struct FoldingSetTrait<T*> {
- static inline void Profile(const T *X, FoldingSetNodeID &ID) {
+ static inline void Profile(T *X, FoldingSetNodeID &ID) {
ID.AddPointer(X);
}
};
-
-template<typename T> struct FoldingSetTrait<const T*> {
- static inline void Profile(const T *X, FoldingSetNodeID &ID) {
- ID.AddPointer(X);
- }
-};
-
} // End of namespace llvm.
#endif
diff --git a/contrib/llvm/include/llvm/ADT/PackedVector.h b/contrib/llvm/include/llvm/ADT/PackedVector.h
new file mode 100644
index 0000000..272322a
--- /dev/null
+++ b/contrib/llvm/include/llvm/ADT/PackedVector.h
@@ -0,0 +1,158 @@
+//===- llvm/ADT/PackedVector.h - Packed values vector -----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the PackedVector class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_PACKEDVECTOR_H
+#define LLVM_ADT_PACKEDVECTOR_H
+
+#include "llvm/ADT/BitVector.h"
+#include <limits>
+
+namespace llvm {
+
+template <typename T, unsigned BitNum, bool isSigned>
+class PackedVectorBase;
+
+// This won't be necessary if we can specialize members without specializing
+// the parent template.
+template <typename T, unsigned BitNum>
+class PackedVectorBase<T, BitNum, false> {
+protected:
+ static T getValue(const llvm::BitVector &Bits, unsigned Idx) {
+ T val = T();
+ for (unsigned i = 0; i != BitNum; ++i)
+ val = T(val | ((Bits[(Idx << (BitNum-1)) + i] ? 1UL : 0UL) << i));
+ return val;
+ }
+
+ static void setValue(llvm::BitVector &Bits, unsigned Idx, T val) {
+ assert((val >> BitNum) == 0 && "value is too big");
+ for (unsigned i = 0; i != BitNum; ++i)
+ Bits[(Idx << (BitNum-1)) + i] = val & (T(1) << i);
+ }
+};
+
+template <typename T, unsigned BitNum>
+class PackedVectorBase<T, BitNum, true> {
+protected:
+ static T getValue(const llvm::BitVector &Bits, unsigned Idx) {
+ T val = T();
+ for (unsigned i = 0; i != BitNum-1; ++i)
+ val = T(val | ((Bits[(Idx << (BitNum-1)) + i] ? 1UL : 0UL) << i));
+ if (Bits[(Idx << (BitNum-1)) + BitNum-1])
+ val = ~val;
+ return val;
+ }
+
+ static void setValue(llvm::BitVector &Bits, unsigned Idx, T val) {
+ if (val < 0) {
+ val = ~val;
+ Bits.set((Idx << (BitNum-1)) + BitNum-1);
+ }
+ assert((val >> (BitNum-1)) == 0 && "value is too big");
+ for (unsigned i = 0; i != BitNum-1; ++i)
+ Bits[(Idx << (BitNum-1)) + i] = val & (T(1) << i);
+ }
+};
+
+/// \brief Store a vector of values using a specific number of bits for each
+/// value. Both signed and unsigned types can be used, e.g
+/// @code
+/// PackedVector<signed, 2> vec;
+/// @endcode
+/// will create a vector accepting values -2, -1, 0, 1. Any other value will hit
+/// an assertion.
+template <typename T, unsigned BitNum>
+class PackedVector : public PackedVectorBase<T, BitNum,
+ std::numeric_limits<T>::is_signed> {
+ llvm::BitVector Bits;
+ typedef PackedVectorBase<T, BitNum, std::numeric_limits<T>::is_signed> base;
+
+public:
+ class reference {
+ PackedVector &Vec;
+ const unsigned Idx;
+
+ reference(); // Undefined
+ public:
+ reference(PackedVector &vec, unsigned idx) : Vec(vec), Idx(idx) { }
+
+ reference &operator=(T val) {
+ Vec.setValue(Vec.Bits, Idx, val);
+ return *this;
+ }
+ operator T() {
+ return Vec.getValue(Vec.Bits, Idx);
+ }
+ };
+
+ PackedVector() { }
+ explicit PackedVector(unsigned size) : Bits(size << (BitNum-1)) { }
+
+ bool empty() const { return Bits.empty(); }
+
+ unsigned size() const { return Bits.size() >> (BitNum-1); }
+
+ void clear() { Bits.clear(); }
+
+ void resize(unsigned N) { Bits.resize(N << (BitNum-1)); }
+
+ void reserve(unsigned N) { Bits.reserve(N << (BitNum-1)); }
+
+ PackedVector &reset() {
+ Bits.reset();
+ return *this;
+ }
+
+ void push_back(T val) {
+ resize(size()+1);
+ (*this)[size()-1] = val;
+ }
+
+ reference operator[](unsigned Idx) {
+ return reference(*this, Idx);
+ }
+
+ T operator[](unsigned Idx) const {
+ return base::getValue(Bits, Idx);
+ }
+
+ bool operator==(const PackedVector &RHS) const {
+ return Bits == RHS.Bits;
+ }
+
+ bool operator!=(const PackedVector &RHS) const {
+ return Bits != RHS.Bits;
+ }
+
+ const PackedVector &operator=(const PackedVector &RHS) {
+ Bits = RHS.Bits;
+ return *this;
+ }
+
+ PackedVector &operator|=(const PackedVector &RHS) {
+ Bits |= RHS.Bits;
+ return *this;
+ }
+
+ void swap(PackedVector &RHS) {
+ Bits.swap(RHS.Bits);
+ }
+};
+
+// Leave BitNum=0 undefined.
+template <typename T>
+class PackedVector<T, 0>;
+
+} // end llvm namespace
+
+#endif
diff --git a/contrib/llvm/include/llvm/ADT/StringRef.h b/contrib/llvm/include/llvm/ADT/StringRef.h
index 1766d2b..8396921 100644
--- a/contrib/llvm/include/llvm/ADT/StringRef.h
+++ b/contrib/llvm/include/llvm/ADT/StringRef.h
@@ -46,7 +46,14 @@ namespace llvm {
// integer works around this bug.
static size_t min(size_t a, size_t b) { return a < b ? a : b; }
static size_t max(size_t a, size_t b) { return a > b ? a : b; }
-
+
+ // Workaround memcmp issue with null pointers (undefined behavior)
+ // by providing a specialized version
+ static int compareMemory(const char *Lhs, const char *Rhs, size_t Length) {
+ if (Length == 0) { return 0; }
+ return ::memcmp(Lhs,Rhs,Length);
+ }
+
public:
/// @name Constructors
/// @{
@@ -56,11 +63,17 @@ namespace llvm {
/// Construct a string ref from a cstring.
/*implicit*/ StringRef(const char *Str)
- : Data(Str), Length(::strlen(Str)) {}
+ : Data(Str) {
+ assert(Str && "StringRef cannot be built from a NULL argument");
+ Length = ::strlen(Str); // invoking strlen(NULL) is undefined behavior
+ }
/// Construct a string ref from a pointer and length.
/*implicit*/ StringRef(const char *data, size_t length)
- : Data(data), Length(length) {}
+ : Data(data), Length(length) {
+ assert((data || length == 0) &&
+ "StringRef cannot be built from a NULL argument with non-null length");
+ }
/// Construct a string ref from an std::string.
/*implicit*/ StringRef(const std::string &Str)
@@ -104,7 +117,7 @@ namespace llvm {
/// compare() when the relative ordering of inequal strings isn't needed.
bool equals(StringRef RHS) const {
return (Length == RHS.Length &&
- memcmp(Data, RHS.Data, RHS.Length) == 0);
+ compareMemory(Data, RHS.Data, RHS.Length) == 0);
}
/// equals_lower - Check for string equality, ignoring case.
@@ -116,7 +129,7 @@ namespace llvm {
/// is lexicographically less than, equal to, or greater than the \arg RHS.
int compare(StringRef RHS) const {
// Check the prefix for a mismatch.
- if (int Res = memcmp(Data, RHS.Data, min(Length, RHS.Length)))
+ if (int Res = compareMemory(Data, RHS.Data, min(Length, RHS.Length)))
return Res < 0 ? -1 : 1;
// Otherwise the prefixes match, so we only need to check the lengths.
@@ -183,13 +196,13 @@ namespace llvm {
/// startswith - Check if this string starts with the given \arg Prefix.
bool startswith(StringRef Prefix) const {
return Length >= Prefix.Length &&
- memcmp(Data, Prefix.Data, Prefix.Length) == 0;
+ compareMemory(Data, Prefix.Data, Prefix.Length) == 0;
}
/// endswith - Check if this string ends with the given \arg Suffix.
bool endswith(StringRef Suffix) const {
return Length >= Suffix.Length &&
- memcmp(end() - Suffix.Length, Suffix.Data, Suffix.Length) == 0;
+ compareMemory(end() - Suffix.Length, Suffix.Data, Suffix.Length) == 0;
}
/// @}
@@ -447,6 +460,10 @@ namespace llvm {
return LHS.compare(RHS) != -1;
}
+ inline std::string &operator+=(std::string &buffer, llvm::StringRef string) {
+ return buffer.append(string.data(), string.size());
+ }
+
/// @}
// StringRefs can be treated like a POD type.
diff --git a/contrib/llvm/include/llvm/ADT/Triple.h b/contrib/llvm/include/llvm/ADT/Triple.h
index 2659bce..078033d 100644
--- a/contrib/llvm/include/llvm/ADT/Triple.h
+++ b/contrib/llvm/include/llvm/ADT/Triple.h
@@ -225,7 +225,7 @@ public:
/// if the environment component is present).
StringRef getOSAndEnvironmentName() const;
- /// getOSNumber - Parse the version number from the OS name component of the
+ /// getOSVersion - Parse the version number from the OS name component of the
/// triple, if present.
///
/// For example, "fooos1.2.3" would return (1, 2, 3).
diff --git a/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h b/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h
index 8f9708b..5d8edd1 100644
--- a/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -38,6 +38,7 @@
#define LLVM_ANALYSIS_ALIAS_ANALYSIS_H
#include "llvm/Support/CallSite.h"
+#include "llvm/ADT/DenseMap.h"
namespace llvm {
@@ -488,6 +489,32 @@ public:
}
};
+// Specialize DenseMapInfo for Location.
+template<>
+struct DenseMapInfo<AliasAnalysis::Location> {
+ static inline AliasAnalysis::Location getEmptyKey() {
+ return
+ AliasAnalysis::Location(DenseMapInfo<const Value *>::getEmptyKey(),
+ 0, 0);
+ }
+ static inline AliasAnalysis::Location getTombstoneKey() {
+ return
+ AliasAnalysis::Location(DenseMapInfo<const Value *>::getTombstoneKey(),
+ 0, 0);
+ }
+ static unsigned getHashValue(const AliasAnalysis::Location &Val) {
+ return DenseMapInfo<const Value *>::getHashValue(Val.Ptr) ^
+ DenseMapInfo<uint64_t>::getHashValue(Val.Size) ^
+ DenseMapInfo<const MDNode *>::getHashValue(Val.TBAATag);
+ }
+ static bool isEqual(const AliasAnalysis::Location &LHS,
+ const AliasAnalysis::Location &RHS) {
+ return LHS.Ptr == RHS.Ptr &&
+ LHS.Size == RHS.Size &&
+ LHS.TBAATag == RHS.TBAATag;
+ }
+};
+
/// isNoAliasCall - Return true if this pointer is returned by a noalias
/// function.
bool isNoAliasCall(const Value *V);
diff --git a/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h b/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h
new file mode 100644
index 0000000..91f289d
--- /dev/null
+++ b/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h
@@ -0,0 +1,78 @@
+//===--- BranchProbabilityInfo.h - Branch Probability Analysis --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This pass is used to evaluate branch probabilties.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H
+#define LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H
+
+#include "llvm/InitializePasses.h"
+#include "llvm/Support/BranchProbability.h"
+#include "llvm/Analysis/LoopInfo.h"
+
+namespace llvm {
+
+class raw_ostream;
+
+class BranchProbabilityInfo : public FunctionPass {
+
+ // Default weight value. Used when we don't have information about the edge.
+ static const uint32_t DEFAULT_WEIGHT = 16;
+
+ typedef std::pair<BasicBlock *, BasicBlock *> Edge;
+
+ DenseMap<Edge, uint32_t> Weights;
+
+ // Get sum of the block successors' weights.
+ uint32_t getSumForBlock(BasicBlock *BB) const;
+
+public:
+ static char ID;
+
+ BranchProbabilityInfo() : FunctionPass(ID) {
+ initializeBranchProbabilityInfoPass(*PassRegistry::getPassRegistry());
+ }
+
+ void getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.addRequired<LoopInfo>();
+ AU.setPreservesAll();
+ }
+
+ bool runOnFunction(Function &F);
+
+ // Returned value is between 1 and UINT32_MAX. Look at
+ // BranchProbabilityInfo.cpp for details.
+ uint32_t getEdgeWeight(BasicBlock *Src, BasicBlock *Dst) const;
+
+ // Look at BranchProbabilityInfo.cpp for details. Use it with caution!
+ void setEdgeWeight(BasicBlock *Src, BasicBlock *Dst, uint32_t Weight);
+
+ // A 'Hot' edge is an edge which probability is >= 80%.
+ bool isEdgeHot(BasicBlock *Src, BasicBlock *Dst) const;
+
+ // Return a hot successor for the block BB or null if there isn't one.
+ BasicBlock *getHotSucc(BasicBlock *BB) const;
+
+ // Return a probability as a fraction between 0 (0% probability) and
+ // 1 (100% probability), however the value is never equal to 0, and can be 1
+ // only iff SRC block has only one successor.
+ BranchProbability getEdgeProbability(BasicBlock *Src, BasicBlock *Dst) const;
+
+ // Print value between 0 (0% probability) and 1 (100% probability),
+ // however the value is never equal to 0, and can be 1 only iff SRC block
+ // has only one successor.
+ raw_ostream &printEdgeProbability(raw_ostream &OS, BasicBlock *Src,
+ BasicBlock *Dst) const;
+};
+
+}
+
+#endif
diff --git a/contrib/llvm/include/llvm/Analysis/CallGraph.h b/contrib/llvm/include/llvm/Analysis/CallGraph.h
index 089f322..fb77da7 100644
--- a/contrib/llvm/include/llvm/Analysis/CallGraph.h
+++ b/contrib/llvm/include/llvm/Analysis/CallGraph.h
@@ -259,6 +259,9 @@ public:
/// addCalledFunction - Add a function to the list of functions called by this
/// one.
void addCalledFunction(CallSite CS, CallGraphNode *M) {
+ assert(!CS.getInstruction() ||
+ !CS.getCalledFunction() ||
+ !CS.getCalledFunction()->isIntrinsic());
CalledFunctions.push_back(std::make_pair(CS.getInstruction(), M));
M->AddRef();
}
diff --git a/contrib/llvm/include/llvm/Analysis/DIBuilder.h b/contrib/llvm/include/llvm/Analysis/DIBuilder.h
index 5846dbf..96c6587 100644
--- a/contrib/llvm/include/llvm/Analysis/DIBuilder.h
+++ b/contrib/llvm/include/llvm/Analysis/DIBuilder.h
@@ -117,8 +117,9 @@ namespace llvm {
/// @param Name Typedef name.
/// @param File File where this type is defined.
/// @param LineNo Line number.
+ /// @param Context The surrounding context for the typedef.
DIType createTypedef(DIType Ty, StringRef Name, DIFile File,
- unsigned LineNo);
+ unsigned LineNo, DIDescriptor Context);
/// createFriend - Create debugging information entry for a 'friend'.
DIType createFriend(DIType Ty, DIType FriendTy);
diff --git a/contrib/llvm/include/llvm/Analysis/DebugInfo.h b/contrib/llvm/include/llvm/Analysis/DebugInfo.h
index c6cc8f7..fbee5a6 100644
--- a/contrib/llvm/include/llvm/Analysis/DebugInfo.h
+++ b/contrib/llvm/include/llvm/Analysis/DebugInfo.h
@@ -49,15 +49,16 @@ namespace llvm {
class DIDescriptor {
public:
enum {
- FlagPrivate = 1 << 0,
- FlagProtected = 1 << 1,
- FlagFwdDecl = 1 << 2,
- FlagAppleBlock = 1 << 3,
- FlagBlockByrefStruct = 1 << 4,
- FlagVirtual = 1 << 5,
- FlagArtificial = 1 << 6,
- FlagExplicit = 1 << 7,
- FlagPrototyped = 1 << 8
+ FlagPrivate = 1 << 0,
+ FlagProtected = 1 << 1,
+ FlagFwdDecl = 1 << 2,
+ FlagAppleBlock = 1 << 3,
+ FlagBlockByrefStruct = 1 << 4,
+ FlagVirtual = 1 << 5,
+ FlagArtificial = 1 << 6,
+ FlagExplicit = 1 << 7,
+ FlagPrototyped = 1 << 8,
+ FlagObjcClassComplete = 1 << 9
};
protected:
const MDNode *DbgNode;
@@ -271,6 +272,9 @@ namespace llvm {
bool isArtificial() const {
return (getFlags() & FlagArtificial) != 0;
}
+ bool isObjcClassComplete() const {
+ return (getFlags() & FlagObjcClassComplete) != 0;
+ }
bool isValid() const {
return DbgNode && (isBasicType() || isDerivedType() || isCompositeType());
}
diff --git a/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h b/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h
index fc57e1a..3e5da57 100644
--- a/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h
+++ b/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h
@@ -14,8 +14,8 @@
#ifndef LLVM_ANALYSIS_FINDUSEDTYPES_H
#define LLVM_ANALYSIS_FINDUSEDTYPES_H
+#include "llvm/ADT/SetVector.h"
#include "llvm/Pass.h"
-#include <set>
namespace llvm {
@@ -23,7 +23,7 @@ class Type;
class Value;
class FindUsedTypes : public ModulePass {
- std::set<const Type *> UsedTypes;
+ SetVector<const Type *> UsedTypes;
public:
static char ID; // Pass identification, replacement for typeid
FindUsedTypes() : ModulePass(ID) {
@@ -33,7 +33,7 @@ public:
/// getTypes - After the pass has been run, return the set containing all of
/// the types used in the module.
///
- const std::set<const Type *> &getTypes() const { return UsedTypes; }
+ const SetVector<const Type *> &getTypes() const { return UsedTypes; }
/// Print the types found in the module. If the optional Module parameter is
/// passed in, then the types are printed symbolically if possible, using the
diff --git a/contrib/llvm/include/llvm/Analysis/IVUsers.h b/contrib/llvm/include/llvm/Analysis/IVUsers.h
index e56d24d..1b78fe4 100644
--- a/contrib/llvm/include/llvm/Analysis/IVUsers.h
+++ b/contrib/llvm/include/llvm/Analysis/IVUsers.h
@@ -37,8 +37,8 @@ class TargetData;
class IVStrideUse : public CallbackVH, public ilist_node<IVStrideUse> {
friend class IVUsers;
public:
- IVStrideUse(IVUsers *P, Instruction* U, Value *O)
- : CallbackVH(U), Parent(P), OperandValToReplace(O) {
+ IVStrideUse(IVUsers *P, Instruction* U, Value *O, Value *PN)
+ : CallbackVH(U), Parent(P), OperandValToReplace(O), Phi(PN) {
}
/// getUser - Return the user instruction for this use.
@@ -51,6 +51,11 @@ public:
setValPtr(NewUser);
}
+ /// getPhi - Return the phi node that represents this IV.
+ PHINode *getPhi() const {
+ return cast<PHINode>(Phi);
+ }
+
/// getOperandValToReplace - Return the Value of the operand in the user
/// instruction that this IVStrideUse is representing.
Value *getOperandValToReplace() const {
@@ -81,6 +86,9 @@ private:
/// that this IVStrideUse is representing.
WeakVH OperandValToReplace;
+ /// Phi - The loop header phi that represents this IV.
+ WeakVH Phi;
+
/// PostIncLoops - The set of loops for which Expr has been adjusted to
/// use post-inc mode. This corresponds with SCEVExpander's post-inc concept.
PostIncLoopSet PostIncLoops;
@@ -143,9 +151,9 @@ public:
/// AddUsersIfInteresting - Inspect the specified Instruction. If it is a
/// reducible SCEV, recursively add its users to the IVUsesByStride set and
/// return true. Otherwise, return false.
- bool AddUsersIfInteresting(Instruction *I);
+ bool AddUsersIfInteresting(Instruction *I, PHINode *Phi);
- IVStrideUse &AddUser(Instruction *User, Value *Operand);
+ IVStrideUse &AddUser(Instruction *User, Value *Operand, PHINode *Phi);
/// getReplacementExpr - Return a SCEV expression which computes the
/// value of the OperandValToReplace of the given IVStrideUse.
diff --git a/contrib/llvm/include/llvm/Analysis/RegionPass.h b/contrib/llvm/include/llvm/Analysis/RegionPass.h
index 5403e09..1a93859 100644
--- a/contrib/llvm/include/llvm/Analysis/RegionPass.h
+++ b/contrib/llvm/include/llvm/Analysis/RegionPass.h
@@ -109,7 +109,7 @@ public:
/// @brief Print passes managed by this manager.
void dumpPassStructure(unsigned Offset);
- /// @brief Print passes contained by this manager.
+ /// @brief Get passes contained by this manager.
Pass *getContainedPass(unsigned N) {
assert(N < PassVector.size() && "Pass number out of range!");
Pass *FP = static_cast<Pass *>(PassVector[N]);
diff --git a/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h b/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h
index a62f6a8..554524a 100644
--- a/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -270,30 +270,30 @@ namespace llvm {
/// BackedgeTakenCounts - Cache the backedge-taken count of the loops for
/// this function as they are computed.
- std::map<const Loop*, BackedgeTakenInfo> BackedgeTakenCounts;
+ DenseMap<const Loop*, BackedgeTakenInfo> BackedgeTakenCounts;
/// ConstantEvolutionLoopExitValue - This map contains entries for all of
/// the PHI instructions that we attempt to compute constant evolutions for.
/// This allows us to avoid potentially expensive recomputation of these
/// properties. An instruction maps to null if we are unable to compute its
/// exit value.
- std::map<PHINode*, Constant*> ConstantEvolutionLoopExitValue;
+ DenseMap<PHINode*, Constant*> ConstantEvolutionLoopExitValue;
/// ValuesAtScopes - This map contains entries for all the expressions
/// that we attempt to compute getSCEVAtScope information for, which can
/// be expensive in extreme cases.
- std::map<const SCEV *,
+ DenseMap<const SCEV *,
std::map<const Loop *, const SCEV *> > ValuesAtScopes;
/// LoopDispositions - Memoized computeLoopDisposition results.
- std::map<const SCEV *,
+ DenseMap<const SCEV *,
std::map<const Loop *, LoopDisposition> > LoopDispositions;
/// computeLoopDisposition - Compute a LoopDisposition value.
LoopDisposition computeLoopDisposition(const SCEV *S, const Loop *L);
/// BlockDispositions - Memoized computeBlockDisposition results.
- std::map<const SCEV *,
+ DenseMap<const SCEV *,
std::map<const BasicBlock *, BlockDisposition> > BlockDispositions;
/// computeBlockDisposition - Compute a BlockDisposition value.
diff --git a/contrib/llvm/include/llvm/Argument.h b/contrib/llvm/include/llvm/Argument.h
index 71c001f..ff86378 100644
--- a/contrib/llvm/include/llvm/Argument.h
+++ b/contrib/llvm/include/llvm/Argument.h
@@ -51,6 +51,9 @@ public:
/// hasByValAttr - Return true if this argument has the byval attribute on it
/// in its containing function.
bool hasByValAttr() const;
+
+ /// getParamAlignment - If this is a byval argument, return its alignment.
+ unsigned getParamAlignment() const;
/// hasNestAttr - Return true if this argument has the nest attribute on
/// it in its containing function.
diff --git a/contrib/llvm/include/llvm/Attributes.h b/contrib/llvm/include/llvm/Attributes.h
index da6188b..8b69d6e 100644
--- a/contrib/llvm/include/llvm/Attributes.h
+++ b/contrib/llvm/include/llvm/Attributes.h
@@ -67,6 +67,20 @@ const Attributes StackAlignment = 7<<26; ///< Alignment of stack for
///alignstack(1))
const Attributes Hotpatch = 1<<29; ///< Function should have special
///'hotpatch' sequence in prologue
+const Attributes UWTable = 1<<30; ///< Function must be in a unwind
+ ///table
+
+/// Note that uwtable is about the ABI or the user mandating an entry in the
+/// unwind table. The nounwind attribute is about an exception passing by the
+/// function.
+/// In a theoretical system that uses tables for profiling and sjlj for
+/// exceptions, they would be fully independent. In a normal system that
+/// uses tables for both, the semantics are:
+/// nil = Needs an entry because an exception might pass by.
+/// nounwind = No need for an entry
+/// uwtable = Needs an entry because the ABI says so and because
+/// an exception might pass by.
+/// uwtable + nounwind = Needs an entry because the ABI says so.
/// @brief Attributes that only apply to function parameters.
const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture;
@@ -76,7 +90,7 @@ const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture;
const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly |
NoInline | AlwaysInline | OptimizeForSize | StackProtect | StackProtectReq |
NoRedZone | NoImplicitFloat | Naked | InlineHint | StackAlignment |
- Hotpatch;
+ Hotpatch | UWTable;
/// @brief Parameter attributes that do not apply to vararg call arguments.
const Attributes VarArgsIncompatible = StructRet;
diff --git a/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h b/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h
index 58395ba..5eea099 100644
--- a/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h
+++ b/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h
@@ -185,7 +185,14 @@ namespace llvm {
void emitPrologLabel(const MachineInstr &MI);
- bool needsCFIMoves();
+ enum CFIMoveType {
+ CFI_M_None,
+ CFI_M_EH,
+ CFI_M_Debug
+ };
+ CFIMoveType needsCFIMoves();
+
+ bool needsSEHMoves();
/// EmitConstantPool - Print to the current output stream assembly
/// representations of the constants in the constant pool MCP. This is
@@ -381,10 +388,6 @@ namespace llvm {
/// operands.
virtual MachineLocation getDebugValueLocation(const MachineInstr *MI) const;
- /// getDwarfRegOpSize - get size required to emit given machine location
- /// using dwarf encoding.
- virtual unsigned getDwarfRegOpSize(const MachineLocation &MLoc) const;
-
/// getISAEncoding - Get the value for DW_AT_APPLE_isa. Zero if no isa
/// encoding specified.
virtual unsigned getISAEncoding() { return 0; }
@@ -396,12 +399,9 @@ namespace llvm {
// Dwarf Lowering Routines
//===------------------------------------------------------------------===//
- /// EmitFrameMoves - Emit frame instructions to describe the layout of the
+ /// EmitCFIFrameMove - Emit frame instruction to describe the layout of the
/// frame.
- void EmitFrameMoves(const std::vector<MachineMove> &Moves,
- MCSymbol *BaseLabel, bool isEH) const;
void EmitCFIFrameMove(const MachineMove &Move) const;
- void EmitCFIFrameMoves(const std::vector<MachineMove> &Moves) const;
//===------------------------------------------------------------------===//
// Inline Asm Support
diff --git a/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h b/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h
index 9018ea3..77dc644 100644
--- a/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h
+++ b/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h
@@ -16,6 +16,7 @@
#define LLVM_CODEGEN_CALLINGCONVLOWER_H
#include "llvm/ADT/SmallVector.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/Target/TargetCallingConv.h"
#include "llvm/CallingConv.h"
@@ -141,14 +142,19 @@ typedef bool CCCustomFn(unsigned &ValNo, MVT &ValVT,
MVT &LocVT, CCValAssign::LocInfo &LocInfo,
ISD::ArgFlagsTy &ArgFlags, CCState &State);
-typedef enum { Invalid, Prologue, Call } ParmContext;
+/// ParmContext - This enum tracks whether calling convention lowering is in
+/// the context of prologue or call generation. Not all backends make use of
+/// this information.
+typedef enum { Unknown, Prologue, Call } ParmContext;
/// CCState - This class holds information needed while lowering arguments and
/// return values. It captures which registers are already assigned and which
/// stack slots are used. It provides accessors to allocate these values.
class CCState {
+private:
CallingConv::ID CallingConv;
bool IsVarArg;
+ MachineFunction &MF;
const TargetMachine &TM;
const TargetRegisterInfo &TRI;
SmallVector<CCValAssign, 16> &Locs;
@@ -158,10 +164,14 @@ class CCState {
SmallVector<uint32_t, 16> UsedRegs;
unsigned FirstByValReg;
bool FirstByValRegValid;
+
+protected:
ParmContext CallOrPrologue;
+
public:
- CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &TM,
- SmallVector<CCValAssign, 16> &locs, LLVMContext &C);
+ CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
+ const TargetMachine &TM, SmallVector<CCValAssign, 16> &locs,
+ LLVMContext &C);
void addLoc(const CCValAssign &V) {
Locs.push_back(V);
@@ -169,6 +179,7 @@ public:
LLVMContext &getContext() const { return Context; }
const TargetMachine &getTarget() const { return TM; }
+ MachineFunction &getMachineFunction() const { return MF; }
CallingConv::ID getCallingConv() const { return CallingConv; }
bool isVarArg() const { return IsVarArg; }
@@ -301,7 +312,6 @@ public:
bool isFirstByValRegValid() { return FirstByValRegValid; }
ParmContext getCallOrPrologue() { return CallOrPrologue; }
- void setCallOrPrologue(ParmContext pc) { CallOrPrologue = pc; }
private:
/// MarkAllocated - Mark a register and all of its aliases as allocated.
diff --git a/contrib/llvm/include/llvm/CodeGen/FastISel.h b/contrib/llvm/include/llvm/CodeGen/FastISel.h
index 10c4c33d..962a4e2 100644
--- a/contrib/llvm/include/llvm/CodeGen/FastISel.h
+++ b/contrib/llvm/include/llvm/CodeGen/FastISel.h
@@ -241,6 +241,15 @@ protected:
unsigned Op0, bool Op0IsKill,
unsigned Op1, bool Op1IsKill);
+ /// FastEmitInst_rrr - Emit a MachineInstr with three register operands
+ /// and a result register in the given register class.
+ ///
+ unsigned FastEmitInst_rrr(unsigned MachineInstOpcode,
+ const TargetRegisterClass *RC,
+ unsigned Op0, bool Op0IsKill,
+ unsigned Op1, bool Op1IsKill,
+ unsigned Op2, bool Op2IsKill);
+
/// FastEmitInst_ri - Emit a MachineInstr with a register operand,
/// an immediate, and a result register in the given register class.
///
@@ -301,7 +310,7 @@ protected:
/// the CFG.
void FastEmitBranch(MachineBasicBlock *MBB, DebugLoc DL);
- unsigned UpdateValueMap(const Value* I, unsigned Reg);
+ void UpdateValueMap(const Value* I, unsigned Reg, unsigned NumRegs = 1);
unsigned createResultReg(const TargetRegisterClass *RC);
@@ -334,6 +343,8 @@ private:
bool SelectCast(const User *I, unsigned Opcode);
+ bool SelectExtractValue(const User *I);
+
/// HandlePHINodesInSuccessorBlocks - Handle PHI nodes in successor blocks.
/// Emit code to ensure constants are copied into registers when needed.
/// Remember the virtual registers that need to be added to the Machine PHI
diff --git a/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h b/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h
index f0de936..e765cad 100644
--- a/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h
+++ b/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h
@@ -107,11 +107,11 @@ namespace ISD {
// and returns an outchain.
EH_SJLJ_LONGJMP,
- // OUTCHAIN = EH_SJLJ_DISPATCHSETUP(INCHAIN, context)
+ // OUTCHAIN = EH_SJLJ_DISPATCHSETUP(INCHAIN, setjmpval)
// This corresponds to the eh.sjlj.dispatchsetup intrinsic. It takes an
- // input chain and a pointer to the sjlj function context as inputs and
- // returns an outchain. By default, this does nothing. Targets can lower
- // this to unwind setup code if needed.
+ // input chain and the value returning from setjmp as inputs and returns an
+ // outchain. By default, this does nothing. Targets can lower this to unwind
+ // setup code if needed.
EH_SJLJ_DISPATCHSETUP,
// TargetConstant* - Like Constant*, but the DAG does not do any folding,
diff --git a/contrib/llvm/include/llvm/CodeGen/LiveInterval.h b/contrib/llvm/include/llvm/CodeGen/LiveInterval.h
index c5285ce..5fd4d3d 100644
--- a/contrib/llvm/include/llvm/CodeGen/LiveInterval.h
+++ b/contrib/llvm/include/llvm/CodeGen/LiveInterval.h
@@ -492,9 +492,10 @@ namespace llvm {
/// Returns true if the live interval is zero length, i.e. no live ranges
/// span instructions. It doesn't pay to spill such an interval.
- bool isZeroLength() const {
+ bool isZeroLength(SlotIndexes *Indexes) const {
for (const_iterator i = begin(), e = end(); i != e; ++i)
- if (i->end.getPrevIndex() > i->start)
+ if (Indexes->getNextNonNullIndex(i->start).getBaseIndex() <
+ i->end.getBaseIndex())
return false;
return true;
}
diff --git a/contrib/llvm/include/llvm/CodeGen/MachineInstr.h b/contrib/llvm/include/llvm/CodeGen/MachineInstr.h
index 2724689..c36dd69 100644
--- a/contrib/llvm/include/llvm/CodeGen/MachineInstr.h
+++ b/contrib/llvm/include/llvm/CodeGen/MachineInstr.h
@@ -229,6 +229,7 @@ public:
enum MICheckType {
CheckDefs, // Check all operands for equality
+ CheckKillDead, // Check all operands including kill / dead markers
IgnoreDefs, // Ignore all definitions
IgnoreVRegDefs // Ignore virtual register definitions
};
diff --git a/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h b/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
index 967e019..c8183a3 100644
--- a/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -88,7 +88,7 @@ public:
return *this;
}
- const MachineInstrBuilder &addFrameIndex(unsigned Idx) const {
+ const MachineInstrBuilder &addFrameIndex(int Idx) const {
MI->addOperand(MachineOperand::CreateFI(Idx));
return *this;
}
diff --git a/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h b/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h
index 6bc80b0..fa185c4 100644
--- a/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h
@@ -52,27 +52,13 @@ namespace llvm {
class Constant;
class GlobalVariable;
class MDNode;
+class MMIAddrLabelMap;
class MachineBasicBlock;
class MachineFunction;
class Module;
class PointerType;
class StructType;
-/// MachineModuleInfoImpl - This class can be derived from and used by targets
-/// to hold private target-specific information for each Module. Objects of
-/// type are accessed/created with MMI::getInfo and destroyed when the
-/// MachineModuleInfo is destroyed.
-class MachineModuleInfoImpl {
-public:
- typedef PointerIntPair<MCSymbol*, 1, bool> StubValueTy;
- virtual ~MachineModuleInfoImpl();
- typedef std::vector<std::pair<MCSymbol*, StubValueTy> > SymbolListTy;
-protected:
- static SymbolListTy GetSortedStubs(const DenseMap<MCSymbol*, StubValueTy>&);
-};
-
-
-
//===----------------------------------------------------------------------===//
/// LandingPadInfo - This structure is used to retain landing pad info for
/// the current function.
@@ -89,7 +75,20 @@ struct LandingPadInfo {
: LandingPadBlock(MBB), LandingPadLabel(0), Personality(0) {}
};
-class MMIAddrLabelMap;
+//===----------------------------------------------------------------------===//
+/// MachineModuleInfoImpl - This class can be derived from and used by targets
+/// to hold private target-specific information for each Module. Objects of
+/// type are accessed/created with MMI::getInfo and destroyed when the
+/// MachineModuleInfo is destroyed.
+///
+class MachineModuleInfoImpl {
+public:
+ typedef PointerIntPair<MCSymbol*, 1, bool> StubValueTy;
+ virtual ~MachineModuleInfoImpl();
+ typedef std::vector<std::pair<MCSymbol*, StubValueTy> > SymbolListTy;
+protected:
+ static SymbolListTy GetSortedStubs(const DenseMap<MCSymbol*, StubValueTy>&);
+};
//===----------------------------------------------------------------------===//
/// MachineModuleInfo - This class contains meta information specific to a
diff --git a/contrib/llvm/include/llvm/CodeGen/MachineOperand.h b/contrib/llvm/include/llvm/CodeGen/MachineOperand.h
index 8acc949..140c6e8 100644
--- a/contrib/llvm/include/llvm/CodeGen/MachineOperand.h
+++ b/contrib/llvm/include/llvm/CodeGen/MachineOperand.h
@@ -94,8 +94,8 @@ private:
/// not a real instruction. Such uses should be ignored during codegen.
bool IsDebug : 1;
- /// SmallContents - Thisreally should be part of the Contents union, but lives
- /// out here so we can get a better packed struct.
+ /// SmallContents - This really should be part of the Contents union, but
+ /// lives out here so we can get a better packed struct.
/// MO_Register: Register number.
/// OffsetedInfo: Low bits of offset.
union {
@@ -473,7 +473,7 @@ public:
Op.setTargetFlags(TargetFlags);
return Op;
}
- static MachineOperand CreateFI(unsigned Idx) {
+ static MachineOperand CreateFI(int Idx) {
MachineOperand Op(MachineOperand::MO_FrameIndex);
Op.setIndex(Idx);
return Op;
diff --git a/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h b/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h
index bace631..7dab4f9 100644
--- a/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h
+++ b/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h
@@ -21,7 +21,7 @@ namespace llvm {
class raw_ostream;
/// PseudoSourceValue - Special value supplied for machine level alias
- /// analysis. It indicates that the a memory access references the functions
+ /// analysis. It indicates that a memory access references the functions
/// stack frame (e.g., a spill slot), below the stack frame (e.g., argument
/// space), or constant pool.
class PseudoSourceValue : public Value {
diff --git a/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h b/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h
index 7e8745e..8139c65 100644
--- a/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h
+++ b/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h
@@ -94,7 +94,7 @@ namespace llvm {
typedef std::map<PBQP::Graph::ConstNodeItr, unsigned,
PBQP::NodeItrComparator> Node2VReg;
typedef DenseMap<unsigned, PBQP::Graph::NodeItr> VReg2Node;
- typedef std::map<unsigned, AllowedSet> AllowedSetMap;
+ typedef DenseMap<unsigned, AllowedSet> AllowedSetMap;
PBQP::Graph graph;
Node2VReg node2VReg;
diff --git a/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h b/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h
index 2eb3db3..2f01948 100644
--- a/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h
+++ b/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h
@@ -265,7 +265,6 @@ namespace llvm {
bool isCloned : 1; // True if this node has been cloned.
Sched::Preference SchedulingPref; // Scheduling preference.
- SmallVector<MachineInstr*, 4> DbgInstrList; // dbg_values referencing this.
private:
bool isDepthCurrent : 1; // True if Depth is current.
bool isHeightCurrent : 1; // True if Height is current.
diff --git a/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h b/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h
index 92fd0c9..1c42bef 100644
--- a/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -284,7 +284,7 @@ public:
///
/// Note that this is an involved process that may invalidate pointers into
/// the graph.
- void Legalize(CodeGenOpt::Level OptLevel);
+ void Legalize();
/// LegalizeVectors - This transforms the SelectionDAG into a SelectionDAG
/// that only uses vector math operations supported by the target. This is
@@ -985,10 +985,6 @@ public:
/// other positive zero.
bool isEqualTo(SDValue A, SDValue B) const;
- /// isVerifiedDebugInfoDesc - Returns true if the specified SDValue has
- /// been verified as a debug information descriptor.
- bool isVerifiedDebugInfoDesc(SDValue Op) const;
-
/// UnrollVectorOp - Utility function used by legalize and lowering to
/// "unroll" a vector operation by splitting out the scalars and operating
/// on each element individually. If the ResNE is 0, fully unroll the vector
diff --git a/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h b/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
index 829f580..54e5751 100644
--- a/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
+++ b/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
@@ -58,6 +58,10 @@ public:
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
virtual const MCSection *getEHFrameSection() const;
+ virtual const MCSection *getWin64EHFuncTableSection(StringRef) const {
+ return NULL;
+ }
+ virtual const MCSection *getWin64EHTableSection(StringRef) const{return NULL;}
virtual void emitPersonalityValue(MCStreamer &Streamer,
const TargetMachine &TM,
@@ -133,6 +137,10 @@ public:
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
virtual const MCSection *getEHFrameSection() const;
+ virtual const MCSection *getWin64EHFuncTableSection(StringRef) const {
+ return NULL;
+ }
+ virtual const MCSection *getWin64EHTableSection(StringRef) const{return NULL;}
virtual const MCSection *
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
@@ -196,6 +204,8 @@ public:
class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
const MCSection *DrectveSection;
+ const MCSection *PDataSection;
+ const MCSection *XDataSection;
public:
TargetLoweringObjectFileCOFF() {}
~TargetLoweringObjectFileCOFF() {}
@@ -203,6 +213,8 @@ public:
virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
virtual const MCSection *getEHFrameSection() const;
+ virtual const MCSection *getWin64EHFuncTableSection(StringRef) const;
+ virtual const MCSection *getWin64EHTableSection(StringRef) const;
virtual const MCSection *getDrectveSection() const { return DrectveSection; }
diff --git a/contrib/llvm/include/llvm/CompilerDriver/Common.td b/contrib/llvm/include/llvm/CompilerDriver/Common.td
index 84e8783..6ba30aa 100644
--- a/contrib/llvm/include/llvm/CompilerDriver/Common.td
+++ b/contrib/llvm/include/llvm/CompilerDriver/Common.td
@@ -56,8 +56,11 @@ def forward_not_split;
def case;
// Boolean constants.
-def true;
-def false;
+class Bool<bit val> {
+ bit Value = val;
+}
+def true : Bool<1>;
+def false : Bool<0>;
// Boolean operators.
def and;
diff --git a/contrib/llvm/include/llvm/DefaultPasses.h b/contrib/llvm/include/llvm/DefaultPasses.h
new file mode 100644
index 0000000..e2e58a5b
--- /dev/null
+++ b/contrib/llvm/include/llvm/DefaultPasses.h
@@ -0,0 +1,167 @@
+//===- llvm/DefaultPasses.h - Default Pass Support code --------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// This file defines the infrastructure for registering the standard pass list.
+// This defines sets of standard optimizations that plugins can modify and
+// front ends can use.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEFAULT_PASS_SUPPORT_H
+#define LLVM_DEFAULT_PASS_SUPPORT_H
+
+namespace llvm {
+
+class PassManagerBase;
+
+/// Unique identifiers for the default standard passes. The addresses of
+/// these symbols are used to uniquely identify passes from the default list.
+namespace DefaultStandardPasses {
+extern unsigned char AggressiveDCEID;
+extern unsigned char ArgumentPromotionID;
+extern unsigned char BasicAliasAnalysisID;
+extern unsigned char CFGSimplificationID;
+extern unsigned char ConstantMergeID;
+extern unsigned char CorrelatedValuePropagationID;
+extern unsigned char DeadArgEliminationID;
+extern unsigned char DeadStoreEliminationID;
+extern unsigned char DeadTypeEliminationID;
+extern unsigned char EarlyCSEID;
+extern unsigned char FunctionAttrsID;
+extern unsigned char FunctionInliningID;
+extern unsigned char GVNID;
+extern unsigned char GlobalDCEID;
+extern unsigned char GlobalOptimizerID;
+extern unsigned char GlobalsModRefID;
+extern unsigned char IPSCCPID;
+extern unsigned char IndVarSimplifyID;
+extern unsigned char InlinerPlaceholderID;
+extern unsigned char InstructionCombiningID;
+extern unsigned char JumpThreadingID;
+extern unsigned char LICMID;
+extern unsigned char LoopDeletionID;
+extern unsigned char LoopIdiomID;
+extern unsigned char LoopRotateID;
+extern unsigned char LoopUnrollID;
+extern unsigned char LoopUnswitchID;
+extern unsigned char MemCpyOptID;
+extern unsigned char PruneEHID;
+extern unsigned char ReassociateID;
+extern unsigned char SCCPID;
+extern unsigned char ScalarReplAggregatesID;
+extern unsigned char SimplifyLibCallsID;
+extern unsigned char StripDeadPrototypesID;
+extern unsigned char TailCallEliminationID;
+extern unsigned char TypeBasedAliasAnalysisID;
+}
+
+/// StandardPass - The class responsible for maintaining the lists of standard
+class StandardPass {
+ friend class RegisterStandardPassLists;
+ public:
+ /// Predefined standard sets of passes
+ enum StandardSet {
+ AliasAnalysis,
+ Function,
+ Module,
+ LTO
+ };
+ /// Flags to specify whether a pass should be enabled. Passes registered
+ /// with the standard sets may specify a minimum optimization level and one
+ /// or more flags that must be set when constructing the set for the pass to
+ /// be used.
+ enum OptimizationFlags {
+ /// Optimize for size was requested.
+ OptimizeSize = 1<<0,
+ /// Allow passes which may make global module changes.
+ UnitAtATime = 1<<1,
+ /// UnrollLoops - Allow loop unrolling.
+ UnrollLoops = 1<<2,
+ /// Allow library calls to be simplified.
+ SimplifyLibCalls = 1<<3,
+ /// Whether the module may have code using exceptions.
+ HaveExceptions = 1<<4,
+ // Run an inliner pass as part of this set.
+ RunInliner = 1<<5
+ };
+ enum OptimizationFlagComponents {
+ /// The low bits are used to store the optimization level. When requesting
+ /// passes, this should store the requested optimisation level. When
+ /// setting passes, this should set the minimum optimization level at which
+ /// the pass will run.
+ OptimizationLevelMask=0xf,
+ /// The maximum optimisation level at which the pass is run.
+ MaxOptimizationLevelMask=0xf0,
+ // Flags that must be set
+ RequiredFlagMask=0xff00,
+ // Flags that may not be set.
+ DisallowedFlagMask=0xff0000,
+ MaxOptimizationLevelShift=4,
+ RequiredFlagShift=8,
+ DisallowedFlagShift=16
+ };
+ /// Returns the optimisation level from a set of flags.
+ static unsigned OptimizationLevel(unsigned flags) {
+ return flags & OptimizationLevelMask;
+ }
+ /// Returns the maximum optimization level for this set of flags
+ static unsigned MaxOptimizationLevel(unsigned flags) {
+ return (flags & MaxOptimizationLevelMask) >> 4;
+ }
+ /// Constructs a set of flags from the specified minimum and maximum
+ /// optimisation level
+ static unsigned OptimzationFlags(unsigned minLevel=0, unsigned maxLevel=0xf,
+ unsigned requiredFlags=0, unsigned disallowedFlags=0) {
+ return ((minLevel & OptimizationLevelMask) |
+ ((maxLevel<<MaxOptimizationLevelShift) & MaxOptimizationLevelMask)
+ | ((requiredFlags<<RequiredFlagShift) & RequiredFlagMask)
+ | ((disallowedFlags<<DisallowedFlagShift) & DisallowedFlagMask));
+ }
+ /// Returns the flags that must be set for this to match
+ static unsigned RequiredFlags(unsigned flags) {
+ return (flags & RequiredFlagMask) >> RequiredFlagShift;
+ }
+ /// Returns the flags that must not be set for this to match
+ static unsigned DisallowedFlags(unsigned flags) {
+ return (flags & DisallowedFlagMask) >> DisallowedFlagShift;
+ }
+ /// Register a standard pass in the specified set. If flags is non-zero,
+ /// then the pass will only be returned when the specified flags are set.
+ template<typename passName>
+ class RegisterStandardPass {
+ public:
+ RegisterStandardPass(StandardSet set, unsigned char *runBefore=0,
+ unsigned flags=0, unsigned char *ID=0) {
+ // Use the pass's ID if one is not specified
+ RegisterDefaultPass(PassInfo::NormalCtor_t(callDefaultCtor<passName>),
+ ID ? ID : (unsigned char*)&passName::ID, runBefore, set, flags);
+ }
+ };
+ /// Adds the passes from the specified set to the provided pass manager
+ static void AddPassesFromSet(PassManagerBase *PM,
+ StandardSet set,
+ unsigned flags=0,
+ bool VerifyEach=false,
+ Pass *inliner=0);
+ private:
+ /// Registers the default passes. This is set by RegisterStandardPassLists
+ /// and is called lazily.
+ static void (*RegisterDefaultPasses)(void);
+ /// Creates the verifier pass that is inserted when a VerifyEach is passed to
+ /// AddPassesFromSet()
+ static Pass* (*CreateVerifierPass)(void);
+ /// Registers the pass
+ static void RegisterDefaultPass(PassInfo::NormalCtor_t constructor,
+ unsigned char *newPass,
+ unsigned char *oldPass,
+ StandardSet set,
+ unsigned flags=0);
+};
+
+} // namespace llvm
+
+#endif
diff --git a/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h b/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
index a01ad3a..88b21cd 100644
--- a/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
+++ b/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
@@ -135,20 +135,14 @@ protected:
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- CodeModel::Model CMM,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs);
+ TargetMachine *TM);
static ExecutionEngine *(*MCJITCtor)(
Module *M,
std::string *ErrorStr,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- CodeModel::Model CMM,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs);
+ TargetMachine *TM);
static ExecutionEngine *(*InterpCtor)(Module *M,
std::string *ErrorStr);
@@ -569,6 +563,14 @@ public:
return *this;
}
+ /// selectTarget - Pick a target either via -march or by guessing the native
+ /// arch. Add any CPU features specified via -mcpu or -mattr.
+ static TargetMachine *selectTarget(Module *M,
+ StringRef MArch,
+ StringRef MCPU,
+ const SmallVectorImpl<std::string>& MAttrs,
+ std::string *Err);
+
ExecutionEngine *create();
};
diff --git a/contrib/llvm/include/llvm/Function.h b/contrib/llvm/include/llvm/Function.h
index 9a0825a..1edc176 100644
--- a/contrib/llvm/include/llvm/Function.h
+++ b/contrib/llvm/include/llvm/Function.h
@@ -253,6 +253,23 @@ public:
else removeFnAttr(Attribute::NoUnwind);
}
+ /// @brief True if the ABI mandates (or the user requested) that this
+ /// function be in a unwind table.
+ bool hasUWTable() const {
+ return hasFnAttr(Attribute::UWTable);
+ }
+ void setHasUWTable(bool HasUWTable = true) {
+ if (HasUWTable)
+ addFnAttr(Attribute::UWTable);
+ else
+ removeFnAttr(Attribute::UWTable);
+ }
+
+ /// @brief True if this function needs an unwind table.
+ bool needsUnwindTableEntry() const {
+ return hasUWTable() || !doesNotThrow();
+ }
+
/// @brief Determine if the function returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
@@ -414,6 +431,10 @@ public:
///
bool hasAddressTaken(const User** = 0) const;
+ /// callsFunctionThatReturnsTwice - Return true if the function has a call to
+ /// setjmp or other function that gcc recognizes as "returning twice".
+ bool callsFunctionThatReturnsTwice() const;
+
private:
// Shadow Value::setValueSubclassData with a private forwarding method so that
// subclasses cannot accidentally use it.
diff --git a/contrib/llvm/include/llvm/InitializePasses.h b/contrib/llvm/include/llvm/InitializePasses.h
index cca0194..372eaba 100644
--- a/contrib/llvm/include/llvm/InitializePasses.h
+++ b/contrib/llvm/include/llvm/InitializePasses.h
@@ -66,6 +66,7 @@ void initializeBasicAliasAnalysisPass(PassRegistry&);
void initializeBasicCallGraphPass(PassRegistry&);
void initializeBlockExtractorPassPass(PassRegistry&);
void initializeBlockPlacementPass(PassRegistry&);
+void initializeBranchProbabilityInfoPass(PassRegistry&);
void initializeBreakCriticalEdgesPass(PassRegistry&);
void initializeCFGOnlyPrinterPass(PassRegistry&);
void initializeCFGOnlyViewerPass(PassRegistry&);
diff --git a/contrib/llvm/include/llvm/IntrinsicInst.h b/contrib/llvm/include/llvm/IntrinsicInst.h
index 74c30fb..24e5fe7 100644
--- a/contrib/llvm/include/llvm/IntrinsicInst.h
+++ b/contrib/llvm/include/llvm/IntrinsicInst.h
@@ -139,7 +139,7 @@ namespace llvm {
return !getVolatileCst()->isZero();
}
- unsigned getAddressSpace() const {
+ unsigned getDestAddressSpace() const {
return cast<PointerType>(getRawDest()->getType())->getAddressSpace();
}
@@ -227,6 +227,10 @@ namespace llvm {
/// value is guaranteed to be a pointer.
Value *getSource() const { return getRawSource()->stripPointerCasts(); }
+ unsigned getSourceAddressSpace() const {
+ return cast<PointerType>(getRawSource()->getType())->getAddressSpace();
+ }
+
void setSource(Value *Ptr) {
assert(getRawSource()->getType() == Ptr->getType() &&
"setSource called with pointer of wrong type!");
diff --git a/contrib/llvm/include/llvm/Intrinsics.td b/contrib/llvm/include/llvm/Intrinsics.td
index a63cd6a..d8f249a 100644
--- a/contrib/llvm/include/llvm/Intrinsics.td
+++ b/contrib/llvm/include/llvm/Intrinsics.td
@@ -47,6 +47,9 @@ def IntrReadWriteArgMem : IntrinsicProperty;
// Commutative - This intrinsic is commutative: X op Y == Y op X.
def Commutative : IntrinsicProperty;
+// Throws - This intrinsic can throw.
+def Throws : IntrinsicProperty;
+
// NoCapture - The specified argument pointer is not captured by the intrinsic.
class NoCapture<int argNo> : IntrinsicProperty {
int ArgNo = argNo;
@@ -292,6 +295,7 @@ let Properties = [IntrNoMem] in {
def int_eh_exception : Intrinsic<[llvm_ptr_ty], [], [IntrReadMem]>;
def int_eh_selector : Intrinsic<[llvm_i32_ty],
[llvm_ptr_ty, llvm_ptr_ty, llvm_vararg_ty]>;
+def int_eh_resume : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [Throws]>;
def int_eh_typeid_for : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>;
@@ -307,7 +311,7 @@ let Properties = [IntrNoMem] in {
def int_eh_sjlj_lsda : Intrinsic<[llvm_ptr_ty]>;
def int_eh_sjlj_callsite: Intrinsic<[], [llvm_i32_ty]>;
}
-def int_eh_sjlj_dispatch_setup : Intrinsic<[], []>;
+def int_eh_sjlj_dispatch_setup : Intrinsic<[], [llvm_i32_ty], [IntrReadMem]>;
def int_eh_sjlj_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>;
def int_eh_sjlj_longjmp : Intrinsic<[], [llvm_ptr_ty]>;
diff --git a/contrib/llvm/include/llvm/IntrinsicsARM.td b/contrib/llvm/include/llvm/IntrinsicsARM.td
index 03e9261..fa8034e 100644
--- a/contrib/llvm/include/llvm/IntrinsicsARM.td
+++ b/contrib/llvm/include/llvm/IntrinsicsARM.td
@@ -36,6 +36,16 @@ let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
}
//===----------------------------------------------------------------------===//
+// Load and Store exclusive doubleword
+
+let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
+ def int_arm_strexd : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty,
+ llvm_ptr_ty], [IntrReadWriteArgMem]>;
+ def int_arm_ldrexd : Intrinsic<[llvm_i32_ty, llvm_i32_ty], [llvm_ptr_ty],
+ [IntrReadArgMem]>;
+}
+
+//===----------------------------------------------------------------------===//
// VFP
let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
@@ -50,6 +60,43 @@ let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
}
//===----------------------------------------------------------------------===//
+// Coprocessor
+
+let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
+ // Move to coprocessor
+ def int_arm_mcr : GCCBuiltin<"__builtin_arm_mcr">,
+ Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
+ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
+ def int_arm_mcr2 : GCCBuiltin<"__builtin_arm_mcr2">,
+ Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
+ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
+
+ // Move from coprocessor
+ def int_arm_mrc : GCCBuiltin<"__builtin_arm_mrc">,
+ Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
+ llvm_i32_ty, llvm_i32_ty], []>;
+ def int_arm_mrc2 : GCCBuiltin<"__builtin_arm_mrc2">,
+ Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
+ llvm_i32_ty, llvm_i32_ty], []>;
+
+ // Coprocessor data processing
+ def int_arm_cdp : GCCBuiltin<"__builtin_arm_cdp">,
+ Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
+ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
+ def int_arm_cdp2 : GCCBuiltin<"__builtin_arm_cdp2">,
+ Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
+ llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], []>;
+
+ // Move from two registers to coprocessor
+ def int_arm_mcrr : GCCBuiltin<"__builtin_arm_mcrr">,
+ Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
+ llvm_i32_ty, llvm_i32_ty], []>;
+ def int_arm_mcrr2 : GCCBuiltin<"__builtin_arm_mcrr2">,
+ Intrinsic<[], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty,
+ llvm_i32_ty, llvm_i32_ty], []>;
+}
+
+//===----------------------------------------------------------------------===//
// Advanced SIMD (NEON)
let TargetPrefix = "arm" in { // All intrinsics start with "llvm.arm.".
diff --git a/contrib/llvm/include/llvm/IntrinsicsX86.td b/contrib/llvm/include/llvm/IntrinsicsX86.td
index b44101a..d445a01 100644
--- a/contrib/llvm/include/llvm/IntrinsicsX86.td
+++ b/contrib/llvm/include/llvm/IntrinsicsX86.td
@@ -224,9 +224,6 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
// Cacheability support ops
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse_movnt_ps : GCCBuiltin<"__builtin_ia32_movntps">,
- Intrinsic<[], [llvm_ptr_ty,
- llvm_v4f32_ty], []>;
def int_x86_sse_sfence : GCCBuiltin<"__builtin_ia32_sfence">,
Intrinsic<[], [], []>;
}
@@ -536,19 +533,6 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
llvm_v4i32_ty], []>;
}
-// Cacheability support ops
-let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse2_movnt_dq : GCCBuiltin<"__builtin_ia32_movntdq">,
- Intrinsic<[], [llvm_ptr_ty,
- llvm_v2i64_ty], []>;
- def int_x86_sse2_movnt_pd : GCCBuiltin<"__builtin_ia32_movntpd">,
- Intrinsic<[], [llvm_ptr_ty,
- llvm_v2f64_ty], []>;
- def int_x86_sse2_movnt_i : GCCBuiltin<"__builtin_ia32_movnti">,
- Intrinsic<[], [llvm_ptr_ty,
- llvm_i32_ty], []>;
-}
-
// Misc.
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
def int_x86_sse2_packsswb_128 : GCCBuiltin<"__builtin_ia32_packsswb128">,
@@ -964,19 +948,19 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
// Miscellaneous
// CRC Instruction
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
- def int_x86_sse42_crc32_8 : GCCBuiltin<"__builtin_ia32_crc32qi">,
+ def int_x86_sse42_crc32_32_8 : GCCBuiltin<"__builtin_ia32_crc32qi">,
Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i8_ty],
[IntrNoMem]>;
- def int_x86_sse42_crc32_16 : GCCBuiltin<"__builtin_ia32_crc32hi">,
+ def int_x86_sse42_crc32_32_16 : GCCBuiltin<"__builtin_ia32_crc32hi">,
Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i16_ty],
[IntrNoMem]>;
- def int_x86_sse42_crc32_32 : GCCBuiltin<"__builtin_ia32_crc32si">,
+ def int_x86_sse42_crc32_32_32 : GCCBuiltin<"__builtin_ia32_crc32si">,
Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
[IntrNoMem]>;
- def int_x86_sse42_crc64_8 :
+ def int_x86_sse42_crc32_64_8 :
Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i8_ty],
[IntrNoMem]>;
- def int_x86_sse42_crc64_64 : GCCBuiltin<"__builtin_ia32_crc32di">,
+ def int_x86_sse42_crc32_64_64 : GCCBuiltin<"__builtin_ia32_crc32di">,
Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
[IntrNoMem]>;
}
diff --git a/contrib/llvm/include/llvm/IntrinsicsXCore.td b/contrib/llvm/include/llvm/IntrinsicsXCore.td
index e633af0..a062fc4 100644
--- a/contrib/llvm/include/llvm/IntrinsicsXCore.td
+++ b/contrib/llvm/include/llvm/IntrinsicsXCore.td
@@ -11,6 +11,12 @@
let TargetPrefix = "xcore" in { // All intrinsics start with "llvm.xcore.".
// Miscellaneous instructions.
def int_xcore_bitrev : Intrinsic<[llvm_i32_ty],[llvm_i32_ty],[IntrNoMem]>;
+ def int_xcore_crc8 : Intrinsic<[llvm_i32_ty, llvm_i32_ty],
+ [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
+ [IntrNoMem]>;
+ def int_xcore_crc32 : Intrinsic<[llvm_i32_ty],
+ [llvm_i32_ty,llvm_i32_ty,llvm_i32_ty],
+ [IntrNoMem]>;
def int_xcore_getid : Intrinsic<[llvm_i32_ty],[],[IntrNoMem]>;
def int_xcore_getps : Intrinsic<[llvm_i32_ty],[llvm_i32_ty]>;
def int_xcore_setps : Intrinsic<[],[llvm_i32_ty, llvm_i32_ty]>;
diff --git a/contrib/llvm/include/llvm/LinkAllPasses.h b/contrib/llvm/include/llvm/LinkAllPasses.h
index 88ee65a..c02e161 100644
--- a/contrib/llvm/include/llvm/LinkAllPasses.h
+++ b/contrib/llvm/include/llvm/LinkAllPasses.h
@@ -70,7 +70,7 @@ namespace {
(void) llvm::createEdgeProfilerPass();
(void) llvm::createOptimalEdgeProfilerPass();
(void) llvm::createPathProfilerPass();
- (void) llvm::createGCOVProfilerPass(true, true);
+ (void) llvm::createGCOVProfilerPass(true, true, false);
(void) llvm::createFunctionInliningPass();
(void) llvm::createAlwaysInlinerPass();
(void) llvm::createGlobalDCEPass();
diff --git a/contrib/llvm/include/llvm/MC/MCAsmInfo.h b/contrib/llvm/include/llvm/MC/MCAsmInfo.h
index 8733161..775d22b 100644
--- a/contrib/llvm/include/llvm/MC/MCAsmInfo.h
+++ b/contrib/llvm/include/llvm/MC/MCAsmInfo.h
@@ -26,12 +26,12 @@ namespace llvm {
class MCSymbol;
class MCContext;
- /// MCAsmInfo - This class is intended to be used as a base class for asm
- /// properties and features specific to the target.
namespace ExceptionHandling {
- enum ExceptionsType { None, DwarfTable, DwarfCFI, SjLj, ARM };
+ enum ExceptionsType { None, DwarfCFI, SjLj, ARM, Win64 };
}
+ /// MCAsmInfo - This class is intended to be used as a base class for asm
+ /// properties and features specific to the target.
class MCAsmInfo {
protected:
//===------------------------------------------------------------------===//
@@ -269,9 +269,6 @@ namespace llvm {
/// SupportsExceptionHandling - True if target supports exception handling.
ExceptionHandling::ExceptionsType ExceptionsType; // Defaults to None
- /// RequiresFrameSection - true if the Dwarf2 output needs a frame section
- bool DwarfRequiresFrameSection; // Defaults to true.
-
/// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
/// encode inline subroutine information.
bool DwarfUsesInlineInfoSection; // Defaults to false.
@@ -279,9 +276,9 @@ namespace llvm {
/// DwarfSectionOffsetDirective - Special section offset directive.
const char* DwarfSectionOffsetDirective; // Defaults to NULL
- /// DwarfUsesAbsoluteLabelForStmtList - True if DW_AT_stmt_list needs
- /// absolute label instead of offset.
- bool DwarfUsesAbsoluteLabelForStmtList; // Defaults to true;
+ /// DwarfRequiresRelocationForSectionOffset - True if we need to produce a
+ // relocation when we want a section offset in dwarf.
+ bool DwarfRequiresRelocationForSectionOffset; // Defaults to true;
// DwarfUsesLabelOffsetDifference - True if Dwarf2 output can
// use EmitLabelOffsetDifference.
@@ -462,13 +459,9 @@ namespace llvm {
}
bool isExceptionHandlingDwarf() const {
return
- (ExceptionsType == ExceptionHandling::DwarfTable ||
- ExceptionsType == ExceptionHandling::DwarfCFI ||
- ExceptionsType == ExceptionHandling::ARM);
- }
-
- bool doesDwarfRequireFrameSection() const {
- return DwarfRequiresFrameSection;
+ (ExceptionsType == ExceptionHandling::DwarfCFI ||
+ ExceptionsType == ExceptionHandling::ARM ||
+ ExceptionsType == ExceptionHandling::Win64);
}
bool doesDwarfUsesInlineInfoSection() const {
return DwarfUsesInlineInfoSection;
@@ -476,8 +469,8 @@ namespace llvm {
const char *getDwarfSectionOffsetDirective() const {
return DwarfSectionOffsetDirective;
}
- bool doesDwarfUsesAbsoluteLabelForStmtList() const {
- return DwarfUsesAbsoluteLabelForStmtList;
+ bool doesDwarfRequireRelocationForSectionOffset() const {
+ return DwarfRequiresRelocationForSectionOffset;
}
bool doesDwarfUsesLabelOffsetForRanges() const {
return DwarfUsesLabelOffsetForRanges;
diff --git a/contrib/llvm/include/llvm/MC/MCDwarf.h b/contrib/llvm/include/llvm/MC/MCDwarf.h
index 3bbcf3e..90c3728 100644
--- a/contrib/llvm/include/llvm/MC/MCDwarf.h
+++ b/contrib/llvm/include/llvm/MC/MCDwarf.h
@@ -281,11 +281,10 @@ namespace llvm {
//
// This emits the frame info section.
//
- static void Emit(MCStreamer &streamer, bool usingCFI);
- static void EmitDarwin(MCStreamer &streamer, bool usingCFI);
+ static void Emit(MCStreamer &streamer, bool usingCFI,
+ bool isEH);
static void EmitAdvanceLoc(MCStreamer &Streamer, uint64_t AddrDelta);
- static void EncodeAdvanceLoc(uint64_t AddrDelta, raw_ostream &OS,
- const TargetAsmInfo &AsmInfo);
+ static void EncodeAdvanceLoc(uint64_t AddrDelta, raw_ostream &OS);
};
} // end namespace llvm
diff --git a/contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h b/contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h
index d798fb0..2225ea0 100644
--- a/contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h
+++ b/contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h
@@ -49,7 +49,8 @@ namespace llvm {
ELF_STV_Hidden = (ELF::STV_HIDDEN << ELF_STV_Shift),
ELF_STV_Protected = (ELF::STV_PROTECTED << ELF_STV_Shift),
- ELF_Other_Weakref = (1 << ELF_Other_Shift)
+ ELF_Other_Weakref = (1 << ELF_Other_Shift),
+ ELF_Other_ThumbFunc = (2 << ELF_Other_Shift)
};
} // end namespace llvm
diff --git a/contrib/llvm/include/llvm/MC/MCExpr.h b/contrib/llvm/include/llvm/MC/MCExpr.h
index 521fde6..0f28599 100644
--- a/contrib/llvm/include/llvm/MC/MCExpr.h
+++ b/contrib/llvm/include/llvm/MC/MCExpr.h
@@ -171,8 +171,10 @@ public:
VK_ARM_GOTTPOFF,
VK_PPC_TOC,
- VK_PPC_HA16, // ha16(symbol)
- VK_PPC_LO16 // lo16(symbol)
+ VK_PPC_DARWIN_HA16, // ha16(symbol)
+ VK_PPC_DARWIN_LO16, // lo16(symbol)
+ VK_PPC_GAS_HA16, // symbol@ha
+ VK_PPC_GAS_LO16 // symbol@l
};
private:
diff --git a/contrib/llvm/include/llvm/MC/MCInstPrinter.h b/contrib/llvm/include/llvm/MC/MCInstPrinter.h
index 0669558..39002da 100644
--- a/contrib/llvm/include/llvm/MC/MCInstPrinter.h
+++ b/contrib/llvm/include/llvm/MC/MCInstPrinter.h
@@ -45,8 +45,8 @@ public:
/// "MOV32ri") or empty if we can't resolve it.
virtual StringRef getOpcodeName(unsigned Opcode) const;
- /// getRegName - Return the assembler register name.
- virtual StringRef getRegName(unsigned RegNo) const;
+ /// printRegName - Print the assembler register name.
+ virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
unsigned getAvailableFeatures() const { return AvailableFeatures; }
void setAvailableFeatures(unsigned Value) { AvailableFeatures = Value; }
diff --git a/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h b/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
index 606725a..47c580f 100644
--- a/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+++ b/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
@@ -44,6 +44,7 @@ public:
Colon,
Plus, Minus, Tilde,
Slash, // '/'
+ BackSlash, // '\'
LParen, RParen, LBrac, RBrac, LCurly, RCurly,
Star, Dot, Comma, Dollar, Equal, EqualEqual,
diff --git a/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h b/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h
index 54979d9..7376693 100644
--- a/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h
+++ b/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h
@@ -71,7 +71,9 @@ public:
/// Warning - Emit a warning at the location \arg L, with the message \arg
/// Msg.
- virtual void Warning(SMLoc L, const Twine &Msg) = 0;
+ ///
+ /// \return The return value is true, if warnings are fatal.
+ virtual bool Warning(SMLoc L, const Twine &Msg) = 0;
/// Error - Emit an error at the location \arg L, with the message \arg
/// Msg.
diff --git a/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h b/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
index ceb57f5..4e2aee9 100644
--- a/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
+++ b/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
@@ -56,7 +56,7 @@ public:
MCAsmParser &getParser() { return *Parser; }
SourceMgr &getSourceManager() { return getParser().getSourceManager(); }
MCStreamer &getStreamer() { return getParser().getStreamer(); }
- void Warning(SMLoc L, const Twine &Msg) {
+ bool Warning(SMLoc L, const Twine &Msg) {
return getParser().Warning(L, Msg);
}
bool Error(SMLoc L, const Twine &Msg) {
diff --git a/contrib/llvm/include/llvm/MC/MCStreamer.h b/contrib/llvm/include/llvm/MC/MCStreamer.h
index b005c8b..c05a925 100644
--- a/contrib/llvm/include/llvm/MC/MCStreamer.h
+++ b/contrib/llvm/include/llvm/MC/MCStreamer.h
@@ -18,6 +18,7 @@
#include "llvm/Support/DataTypes.h"
#include "llvm/MC/MCDirectives.h"
#include "llvm/MC/MCDwarf.h"
+#include "llvm/MC/MCWin64EH.h"
namespace llvm {
class MCAsmInfo;
@@ -50,10 +51,18 @@ namespace llvm {
MCStreamer(const MCStreamer&); // DO NOT IMPLEMENT
MCStreamer &operator=(const MCStreamer&); // DO NOT IMPLEMENT
+ bool EmitEHFrame;
+ bool EmitDebugFrame;
+
std::vector<MCDwarfFrameInfo> FrameInfos;
MCDwarfFrameInfo *getCurrentFrameInfo();
void EnsureValidFrame();
+ std::vector<MCWin64EHUnwindInfo *> W64UnwindInfos;
+ MCWin64EHUnwindInfo *CurrentW64UnwindInfo;
+ void setCurrentW64UnwindInfo(MCWin64EHUnwindInfo *Frame);
+ void EnsureValidW64UnwindInfo();
+
const MCSymbol* LastNonPrivate;
/// SectionStack - This is stack of current and previous section
@@ -67,8 +76,12 @@ namespace llvm {
const MCExpr *BuildSymbolDiff(MCContext &Context, const MCSymbol *A,
const MCSymbol *B);
- const MCExpr *ForceExpAbs(MCStreamer *Streamer, MCContext &Context,
- const MCExpr* Expr);
+ const MCExpr *ForceExpAbs(const MCExpr* Expr);
+
+ void EmitFrames(bool usingCFI);
+
+ MCWin64EHUnwindInfo *getCurrentW64UnwindInfo(){return CurrentW64UnwindInfo;}
+ void EmitW64Tables();
public:
virtual ~MCStreamer();
@@ -83,6 +96,14 @@ namespace llvm {
return FrameInfos[i];
}
+ unsigned getNumW64UnwindInfos() {
+ return W64UnwindInfos.size();
+ }
+
+ MCWin64EHUnwindInfo &getW64UnwindInfo(unsigned i) {
+ return *W64UnwindInfos[i];
+ }
+
/// @name Assembly File Formatting.
/// @{
@@ -174,6 +195,17 @@ namespace llvm {
}
}
+ /// SwitchSectionNoChange - Set the current section where code is being
+ /// emitted to @p Section. This is required to update CurSection. This
+ /// version does not call ChangeSection.
+ void SwitchSectionNoChange(const MCSection *Section) {
+ assert(Section && "Cannot switch to a null section!");
+ const MCSection *curSection = SectionStack.back().first;
+ SectionStack.back().second = curSection;
+ if (Section != curSection)
+ SectionStack.back().first = Section;
+ }
+
/// InitSections - Create the default sections and set the initial one.
virtual void InitSections() = 0;
@@ -288,6 +320,7 @@ namespace llvm {
/// if non-zero. This must be a power of 2 on some targets.
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment = 0) = 0;
+
/// @}
/// @name Generating Data
/// @{
@@ -436,6 +469,7 @@ namespace llvm {
void EmitDwarfSetLineAddr(int64_t LineDelta, const MCSymbol *Label,
int PointerSize);
+ virtual void EmitCFISections(bool EH, bool Debug);
virtual void EmitCFIStartProc();
virtual void EmitCFIEndProc();
virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
@@ -450,6 +484,21 @@ namespace llvm {
virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
+ virtual void EmitWin64EHStartProc(const MCSymbol *Symbol);
+ virtual void EmitWin64EHEndProc();
+ virtual void EmitWin64EHStartChained();
+ virtual void EmitWin64EHEndChained();
+ virtual void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
+ bool Except);
+ virtual void EmitWin64EHHandlerData();
+ virtual void EmitWin64EHPushReg(unsigned Register);
+ virtual void EmitWin64EHSetFrame(unsigned Register, unsigned Offset);
+ virtual void EmitWin64EHAllocStack(unsigned Size);
+ virtual void EmitWin64EHSaveReg(unsigned Register, unsigned Offset);
+ virtual void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset);
+ virtual void EmitWin64EHPushFrame(bool Code);
+ virtual void EmitWin64EHEndProlog();
+
/// EmitInstruction - Emit the given @p Instruction into the current
/// section.
virtual void EmitInstruction(const MCInst &Inst) = 0;
diff --git a/contrib/llvm/include/llvm/MC/MCWin64EH.h b/contrib/llvm/include/llvm/MC/MCWin64EH.h
new file mode 100644
index 0000000..eb4665a
--- /dev/null
+++ b/contrib/llvm/include/llvm/MC/MCWin64EH.h
@@ -0,0 +1,93 @@
+//===- MCWin64EH.h - Machine Code Win64 EH support --------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains declarations to support the Win64 Exception Handling
+// scheme in MC.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_MC_MCWIN64EH_H
+#define LLVM_MC_MCWIN64EH_H
+
+#include "llvm/Support/Win64EH.h"
+#include <cassert>
+#include <vector>
+
+namespace llvm {
+ class StringRef;
+ class MCStreamer;
+ class MCSymbol;
+
+ class MCWin64EHInstruction {
+ public:
+ typedef Win64EH::UnwindOpcodes OpType;
+ private:
+ OpType Operation;
+ MCSymbol *Label;
+ unsigned Offset;
+ unsigned Register;
+ public:
+ MCWin64EHInstruction(OpType Op, MCSymbol *L, unsigned Reg)
+ : Operation(Op), Label(L), Offset(0), Register(Reg) {
+ assert(Op == Win64EH::UOP_PushNonVol);
+ }
+ MCWin64EHInstruction(MCSymbol *L, unsigned Size)
+ : Operation(Size>128 ? Win64EH::UOP_AllocLarge : Win64EH::UOP_AllocSmall),
+ Label(L), Offset(Size) { }
+ MCWin64EHInstruction(OpType Op, MCSymbol *L, unsigned Reg, unsigned Off)
+ : Operation(Op), Label(L), Offset(Off), Register(Reg) {
+ assert(Op == Win64EH::UOP_SetFPReg ||
+ Op == Win64EH::UOP_SaveNonVol ||
+ Op == Win64EH::UOP_SaveNonVolBig ||
+ Op == Win64EH::UOP_SaveXMM128 ||
+ Op == Win64EH::UOP_SaveXMM128Big);
+ }
+ MCWin64EHInstruction(OpType Op, MCSymbol *L, bool Code)
+ : Operation(Op), Label(L), Offset(Code ? 1 : 0) {
+ assert(Op == Win64EH::UOP_PushMachFrame);
+ }
+ OpType getOperation() const { return Operation; }
+ MCSymbol *getLabel() const { return Label; }
+ unsigned getOffset() const { return Offset; }
+ unsigned getSize() const { return Offset; }
+ unsigned getRegister() const { return Register; }
+ bool isPushCodeFrame() const { return Offset == 1; }
+ };
+
+ struct MCWin64EHUnwindInfo {
+ MCWin64EHUnwindInfo() : Begin(0), End(0), ExceptionHandler(0),
+ Function(0), PrologEnd(0), Symbol(0),
+ HandlesUnwind(false), HandlesExceptions(false),
+ LastFrameInst(-1), ChainedParent(0),
+ Instructions() {}
+ MCSymbol *Begin;
+ MCSymbol *End;
+ const MCSymbol *ExceptionHandler;
+ const MCSymbol *Function;
+ MCSymbol *PrologEnd;
+ MCSymbol *Symbol;
+ bool HandlesUnwind;
+ bool HandlesExceptions;
+ int LastFrameInst;
+ MCWin64EHUnwindInfo *ChainedParent;
+ std::vector<MCWin64EHInstruction> Instructions;
+ };
+
+ class MCWin64EHUnwindEmitter {
+ public:
+ static StringRef GetSectionSuffix(const MCSymbol *func);
+ //
+ // This emits the unwind info sections (.pdata and .xdata in PE/COFF).
+ //
+ static void Emit(MCStreamer &streamer);
+ static void EmitUnwindInfo(MCStreamer &streamer, MCWin64EHUnwindInfo *info);
+ };
+} // end namespace llvm
+
+#endif
diff --git a/contrib/llvm/include/llvm/Metadata.h b/contrib/llvm/include/llvm/Metadata.h
index c323025..887e33c 100644
--- a/contrib/llvm/include/llvm/Metadata.h
+++ b/contrib/llvm/include/llvm/Metadata.h
@@ -34,7 +34,7 @@ template<typename ValueSubClass, typename ItemParentClass>
//===----------------------------------------------------------------------===//
/// MDString - a single uniqued string.
/// These are used to efficiently contain a byte sequence for metadata.
-/// MDString is always unnamd.
+/// MDString is always unnamed.
class MDString : public Value {
MDString(const MDString &); // DO NOT IMPLEMENT
diff --git a/contrib/llvm/include/llvm/Operator.h b/contrib/llvm/include/llvm/Operator.h
index ff2a0ad..e9aa499 100644
--- a/contrib/llvm/include/llvm/Operator.h
+++ b/contrib/llvm/include/llvm/Operator.h
@@ -186,28 +186,46 @@ public:
};
class AddOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
+ ~AddOperator(); // DO NOT IMPLEMENT
+};
class SubOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
+ ~SubOperator(); // DO NOT IMPLEMENT
+};
class MulOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
+ ~MulOperator(); // DO NOT IMPLEMENT
+};
class ShlOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
+ ~ShlOperator(); // DO NOT IMPLEMENT
+};
class SDivOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
+ ~SDivOperator(); // DO NOT IMPLEMENT
+};
class UDivOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
+ ~UDivOperator(); // DO NOT IMPLEMENT
+};
class AShrOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
+ ~AShrOperator(); // DO NOT IMPLEMENT
+};
class LShrOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
+ ~LShrOperator(); // DO NOT IMPLEMENT
+};
class GEPOperator
: public ConcreteOperator<Operator, Instruction::GetElementPtr> {
+ ~GEPOperator(); // DO NOT IMPLEMENT
+
enum {
IsInBounds = (1 << 0)
};
diff --git a/contrib/llvm/include/llvm/Support/BranchProbability.h b/contrib/llvm/include/llvm/Support/BranchProbability.h
new file mode 100644
index 0000000..7ba6491
--- /dev/null
+++ b/contrib/llvm/include/llvm/Support/BranchProbability.h
@@ -0,0 +1,50 @@
+//===- BranchProbability.h - Branch Probability Analysis --------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Definition of BranchProbability shared by IR and Machine Instructions.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_BRANCHPROBABILITY_H
+#define LLVM_SUPPORT_BRANCHPROBABILITY_H
+
+#include "llvm/Support/DataTypes.h"
+
+namespace llvm {
+
+class raw_ostream;
+class BranchProbabilityInfo;
+class MachineBranchProbabilityInfo;
+class MachineBasicBlock;
+
+// This class represents Branch Probability as a non-negative fraction.
+class BranchProbability {
+ friend class BranchProbabilityInfo;
+ friend class MachineBranchProbabilityInfo;
+ friend class MachineBasicBlock;
+
+ // Numerator
+ uint32_t N;
+
+ // Denominator
+ uint32_t D;
+
+ BranchProbability(uint32_t n, uint32_t d);
+
+public:
+ raw_ostream &print(raw_ostream &OS) const;
+
+ void dump() const;
+};
+
+raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob);
+
+}
+
+#endif
diff --git a/contrib/llvm/include/llvm/Support/Casting.h b/contrib/llvm/include/llvm/Support/Casting.h
index abb5a9a..3aab436 100644
--- a/contrib/llvm/include/llvm/Support/Casting.h
+++ b/contrib/llvm/include/llvm/Support/Casting.h
@@ -23,8 +23,6 @@ namespace llvm {
// isa<x> Support Templates
//===----------------------------------------------------------------------===//
-template<typename FromCl> struct isa_impl_cl;
-
// Define a template that can be specialized by smart pointers to reflect the
// fact that they are automatically dereferenced, and are not involved with the
// template selection process... the default implementation is a noop.
@@ -43,12 +41,9 @@ template<typename From> struct simplify_type<const From> {
}
};
-
-// isa<X> - Return true if the parameter to the template is an instance of the
-// template type argument. Used like this:
-//
-// if (isa<Type*>(myVal)) { ... }
-//
+// The core of the implementation of isa<X> is here; To and From should be
+// the names of classes. This template can be specialized to customize the
+// implementation of isa<> without rewriting it from scratch.
template <typename To, typename From>
struct isa_impl {
static inline bool doit(const From &Val) {
@@ -56,66 +51,63 @@ struct isa_impl {
}
};
-template<typename To, typename From, typename SimpleType>
-struct isa_impl_wrap {
- // When From != SimplifiedType, we can simplify the type some more by using
- // the simplify_type template.
- static bool doit(const From &Val) {
- return isa_impl_cl<const SimpleType>::template
- isa<To>(simplify_type<const From>::getSimplifiedValue(Val));
+template <typename To, typename From> struct isa_impl_cl {
+ static inline bool doit(const From &Val) {
+ return isa_impl<To, From>::doit(Val);
}
};
-template<typename To, typename FromTy>
-struct isa_impl_wrap<To, const FromTy, const FromTy> {
- // When From == SimpleType, we are as simple as we are going to get.
- static bool doit(const FromTy &Val) {
- return isa_impl<To,FromTy>::doit(Val);
+template <typename To, typename From> struct isa_impl_cl<To, const From> {
+ static inline bool doit(const From &Val) {
+ return isa_impl<To, From>::doit(Val);
}
};
-// isa_impl_cl - Use class partial specialization to transform types to a single
-// canonical form for isa_impl.
-//
-template<typename FromCl>
-struct isa_impl_cl {
- template<class ToCl>
- static bool isa(const FromCl &Val) {
- return isa_impl_wrap<ToCl,const FromCl,
- typename simplify_type<const FromCl>::SimpleType>::doit(Val);
+template <typename To, typename From> struct isa_impl_cl<To, From*> {
+ static inline bool doit(const From *Val) {
+ return isa_impl<To, From>::doit(*Val);
}
};
-// Specialization used to strip const qualifiers off of the FromCl type...
-template<typename FromCl>
-struct isa_impl_cl<const FromCl> {
- template<class ToCl>
- static bool isa(const FromCl &Val) {
- return isa_impl_cl<FromCl>::template isa<ToCl>(Val);
+template <typename To, typename From> struct isa_impl_cl<To, const From*> {
+ static inline bool doit(const From *Val) {
+ return isa_impl<To, From>::doit(*Val);
}
};
-// Define pointer traits in terms of base traits...
-template<class FromCl>
-struct isa_impl_cl<FromCl*> {
- template<class ToCl>
- static bool isa(FromCl *Val) {
- return isa_impl_cl<FromCl>::template isa<ToCl>(*Val);
+template <typename To, typename From> struct isa_impl_cl<To, const From*const> {
+ static inline bool doit(const From *Val) {
+ return isa_impl<To, From>::doit(*Val);
}
};
-// Define reference traits in terms of base traits...
-template<class FromCl>
-struct isa_impl_cl<FromCl&> {
- template<class ToCl>
- static bool isa(FromCl &Val) {
- return isa_impl_cl<FromCl>::template isa<ToCl>(&Val);
+template<typename To, typename From, typename SimpleFrom>
+struct isa_impl_wrap {
+ // When From != SimplifiedType, we can simplify the type some more by using
+ // the simplify_type template.
+ static bool doit(const From &Val) {
+ return isa_impl_wrap<To, SimpleFrom,
+ typename simplify_type<SimpleFrom>::SimpleType>::doit(
+ simplify_type<From>::getSimplifiedValue(Val));
+ }
+};
+
+template<typename To, typename FromTy>
+struct isa_impl_wrap<To, FromTy, FromTy> {
+ // When From == SimpleType, we are as simple as we are going to get.
+ static bool doit(const FromTy &Val) {
+ return isa_impl_cl<To,FromTy>::doit(Val);
}
};
+// isa<X> - Return true if the parameter to the template is an instance of the
+// template type argument. Used like this:
+//
+// if (isa<Type>(myVal)) { ... }
+//
template <class X, class Y>
inline bool isa(const Y &Val) {
- return isa_impl_cl<Y>::template isa<X>(Val);
+ return isa_impl_wrap<X, Y, typename simplify_type<Y>::SimpleType>::doit(Val);
}
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/include/llvm/Support/CrashRecoveryContext.h b/contrib/llvm/include/llvm/Support/CrashRecoveryContext.h
index db835e8..4c0a5e2 100644
--- a/contrib/llvm/include/llvm/Support/CrashRecoveryContext.h
+++ b/contrib/llvm/include/llvm/Support/CrashRecoveryContext.h
@@ -186,8 +186,13 @@ public:
}
~CrashRecoveryContextCleanupRegistrar() {
+ unregister();
+ }
+
+ void unregister() {
if (cleanup && !cleanup->cleanupFired)
- cleanup->getContext()->unregisterCleanup(cleanup);
+ cleanup->getContext()->unregisterCleanup(cleanup);
+ cleanup = 0;
}
};
}
diff --git a/contrib/llvm/include/llvm/Support/Dwarf.h b/contrib/llvm/include/llvm/Support/Dwarf.h
index f6d680b..70bac0c 100644
--- a/contrib/llvm/include/llvm/Support/Dwarf.h
+++ b/contrib/llvm/include/llvm/Support/Dwarf.h
@@ -235,6 +235,7 @@ enum dwarf_constants {
DW_AT_APPLE_property_getter = 0x3fe9,
DW_AT_APPLE_property_setter = 0x3fea,
DW_AT_APPLE_property_attribute = 0x3feb,
+ DW_AT_APPLE_objc_complete_type = 0x3fec,
// Attribute form encodings
DW_FORM_addr = 0x01,
diff --git a/contrib/llvm/include/llvm/Support/IRBuilder.h b/contrib/llvm/include/llvm/Support/IRBuilder.h
index 3878e79..6a7c277 100644
--- a/contrib/llvm/include/llvm/Support/IRBuilder.h
+++ b/contrib/llvm/include/llvm/Support/IRBuilder.h
@@ -80,6 +80,7 @@ public:
void SetInsertPoint(Instruction *I) {
BB = I->getParent();
InsertPt = I;
+ SetCurrentDebugLocation(I->getDebugLoc());
}
/// SetInsertPoint - This specifies that created instructions should be
@@ -106,6 +107,10 @@ public:
I->setDebugLoc(CurDbgLocation);
}
+ /// getCurrentFunctionReturnType - Get the return type of the current function
+ /// that we're emitting into.
+ const Type *getCurrentFunctionReturnType() const;
+
/// InsertPoint - A saved insertion point.
class InsertPoint {
BasicBlock *Block;
@@ -194,6 +199,7 @@ public:
return ConstantInt::get(getInt64Ty(), C);
}
+ /// getInt - Get a constant integer value.
ConstantInt *getInt(const APInt &AI) {
return ConstantInt::get(Context, AI);
}
@@ -246,10 +252,10 @@ public:
return Type::getInt8PtrTy(Context, AddrSpace);
}
- /// getCurrentFunctionReturnType - Get the return type of the current function
- /// that we're emitting into.
- const Type *getCurrentFunctionReturnType() const;
-
+ //===--------------------------------------------------------------------===//
+ // Intrinsic creation methods
+ //===--------------------------------------------------------------------===//
+
/// CreateMemSet - Create and insert a memset to the specified pointer and the
/// specified value. If the pointer isn't an i8*, it will be converted. If a
/// TBAA tag is specified, it will be added to the instruction.
@@ -282,6 +288,15 @@ public:
CallInst *CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align,
bool isVolatile = false, MDNode *TBAATag = 0);
+
+ /// CreateLifetimeStart - Create a lifetime.start intrinsic. If the pointer
+ /// isn't i8* it will be converted.
+ CallInst *CreateLifetimeStart(Value *Ptr, ConstantInt *Size = 0);
+
+ /// CreateLifetimeEnd - Create a lifetime.end intrinsic. If the pointer isn't
+ /// i8* it will be converted.
+ CallInst *CreateLifetimeEnd(Value *Ptr, ConstantInt *Size = 0);
+
private:
Value *getCastedInt8PtrValue(Value *Ptr);
};
@@ -324,6 +339,7 @@ public:
explicit IRBuilder(Instruction *IP)
: IRBuilderBase(IP->getContext()), Folder() {
SetInsertPoint(IP);
+ SetCurrentDebugLocation(IP->getDebugLoc());
}
IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, const T& F)
diff --git a/contrib/llvm/include/llvm/Support/MemoryBuffer.h b/contrib/llvm/include/llvm/Support/MemoryBuffer.h
index d912e86..5e55bd9 100644
--- a/contrib/llvm/include/llvm/Support/MemoryBuffer.h
+++ b/contrib/llvm/include/llvm/Support/MemoryBuffer.h
@@ -81,7 +81,7 @@ public:
bool RequiresNullTerminator = true);
/// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note
- /// that InputData must be null terminated.
+ /// that InputData must be null terminated if RequiresNullTerminator is true.
static MemoryBuffer *getMemBuffer(StringRef InputData,
StringRef BufferName = "",
bool RequiresNullTerminator = true);
diff --git a/contrib/llvm/include/llvm/Support/PassManagerBuilder.h b/contrib/llvm/include/llvm/Support/PassManagerBuilder.h
new file mode 100644
index 0000000..513bb88
--- /dev/null
+++ b/contrib/llvm/include/llvm/Support/PassManagerBuilder.h
@@ -0,0 +1,322 @@
+//===-- llvm/Support/PassManagerBuilder.h - Build Standard Pass -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the PassManagerBuilder class, which is used to set up a
+// "standard" optimization sequence suitable for languages like C and C++.
+//
+// These are implemented as inline functions so that we do not have to worry
+// about link issues.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_PASSMANAGERBUILDER_H
+#define LLVM_SUPPORT_PASSMANAGERBUILDER_H
+
+#include "llvm/PassManager.h"
+#include "llvm/DefaultPasses.h"
+#include "llvm/Analysis/Passes.h"
+#include "llvm/Analysis/Verifier.h"
+#include "llvm/Target/TargetLibraryInfo.h"
+#include "llvm/Transforms/Scalar.h"
+#include "llvm/Transforms/IPO.h"
+
+namespace llvm {
+
+/// PassManagerBuilder - This class is used to set up a standard optimization
+/// sequence for languages like C and C++, allowing some APIs to customize the
+/// pass sequence in various ways. A simple example of using it would be:
+///
+/// PassManagerBuilder Builder;
+/// Builder.OptLevel = 2;
+/// Builder.populateFunctionPassManager(FPM);
+/// Builder.populateModulePassManager(MPM);
+///
+/// In addition to setting up the basic passes, PassManagerBuilder allows
+/// frontends to vend a plugin API, where plugins are allowed to add extensions
+/// to the default pass manager. They do this by specifying where in the pass
+/// pipeline they want to be added, along with a callback function that adds
+/// the pass(es). For example, a plugin that wanted to add a loop optimization
+/// could do something like this:
+///
+/// static void addMyLoopPass(const PMBuilder &Builder, PassManagerBase &PM) {
+/// if (Builder.getOptLevel() > 2 && Builder.getOptSizeLevel() == 0)
+/// PM.add(createMyAwesomePass());
+/// }
+/// ...
+/// Builder.addExtension(PassManagerBuilder::EP_LoopOptimizerEnd,
+/// addMyLoopPass);
+/// ...
+class PassManagerBuilder {
+public:
+
+ /// Extensions are passed the builder itself (so they can see how it is
+ /// configured) as well as the pass manager to add stuff to.
+ typedef void (*ExtensionFn)(const PassManagerBuilder &Builder,
+ PassManagerBase &PM);
+ enum ExtensionPointTy {
+ /// EP_EarlyAsPossible - This extension point allows adding passes before
+ /// any other transformations, allowing them to see the code as it is coming
+ /// out of the frontend.
+ EP_EarlyAsPossible,
+
+ /// EP_LoopOptimizerEnd - This extension point allows adding loop passes to
+ /// the end of the loop optimizer.
+ EP_LoopOptimizerEnd
+ };
+
+ /// The Optimization Level - Specify the basic optimization level.
+ /// 0 = -O0, 1 = -O1, 2 = -O2, 3 = -O3
+ unsigned OptLevel;
+
+ /// SizeLevel - How much we're optimizing for size.
+ /// 0 = none, 1 = -Os, 2 = -Oz
+ unsigned SizeLevel;
+
+ /// LibraryInfo - Specifies information about the runtime library for the
+ /// optimizer. If this is non-null, it is added to both the function and
+ /// per-module pass pipeline.
+ TargetLibraryInfo *LibraryInfo;
+
+ /// Inliner - Specifies the inliner to use. If this is non-null, it is
+ /// added to the per-module passes.
+ Pass *Inliner;
+
+ bool DisableSimplifyLibCalls;
+ bool DisableUnitAtATime;
+ bool DisableUnrollLoops;
+
+private:
+ /// ExtensionList - This is list of all of the extensions that are registered.
+ std::vector<std::pair<ExtensionPointTy, ExtensionFn> > Extensions;
+
+public:
+ PassManagerBuilder() {
+ OptLevel = 2;
+ SizeLevel = 0;
+ LibraryInfo = 0;
+ Inliner = 0;
+ DisableSimplifyLibCalls = false;
+ DisableUnitAtATime = false;
+ DisableUnrollLoops = false;
+ }
+
+ ~PassManagerBuilder() {
+ delete LibraryInfo;
+ delete Inliner;
+ }
+
+ void addExtension(ExtensionPointTy Ty, ExtensionFn Fn) {
+ Extensions.push_back(std::make_pair(Ty, Fn));
+ }
+
+private:
+ void addExtensionsToPM(ExtensionPointTy ETy, PassManagerBase &PM) const {
+ for (unsigned i = 0, e = Extensions.size(); i != e; ++i)
+ if (Extensions[i].first == ETy)
+ Extensions[i].second(*this, PM);
+ }
+
+ void addInitialAliasAnalysisPasses(PassManagerBase &PM) const {
+ // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that
+ // BasicAliasAnalysis wins if they disagree. This is intended to help
+ // support "obvious" type-punning idioms.
+ PM.add(createTypeBasedAliasAnalysisPass());
+ PM.add(createBasicAliasAnalysisPass());
+ }
+public:
+
+ /// populateFunctionPassManager - This fills in the function pass manager,
+ /// which is expected to be run on each function immediately as it is
+ /// generated. The idea is to reduce the size of the IR in memory.
+ void populateFunctionPassManager(FunctionPassManager &FPM) {
+ addExtensionsToPM(EP_EarlyAsPossible, FPM);
+
+ // Add LibraryInfo if we have some.
+ if (LibraryInfo) FPM.add(new TargetLibraryInfo(*LibraryInfo));
+
+ if (OptLevel == 0) return;
+
+ addInitialAliasAnalysisPasses(FPM);
+
+ FPM.add(createCFGSimplificationPass());
+ FPM.add(createScalarReplAggregatesPass());
+ FPM.add(createEarlyCSEPass());
+ }
+
+ /// populateModulePassManager - This sets up the primary pass manager.
+ void populateModulePassManager(PassManagerBase &MPM) {
+ // If all optimizations are disabled, just run the always-inline pass.
+ if (OptLevel == 0) {
+ if (Inliner) {
+ MPM.add(Inliner);
+ Inliner = 0;
+ }
+ return;
+ }
+
+ // Add LibraryInfo if we have some.
+ if (LibraryInfo) MPM.add(new TargetLibraryInfo(*LibraryInfo));
+
+ addInitialAliasAnalysisPasses(MPM);
+
+ if (!DisableUnitAtATime) {
+ MPM.add(createGlobalOptimizerPass()); // Optimize out global vars
+
+ MPM.add(createIPSCCPPass()); // IP SCCP
+ MPM.add(createDeadArgEliminationPass()); // Dead argument elimination
+
+ MPM.add(createInstructionCombiningPass());// Clean up after IPCP & DAE
+ MPM.add(createCFGSimplificationPass()); // Clean up after IPCP & DAE
+ }
+
+ // Start of CallGraph SCC passes.
+ if (!DisableUnitAtATime)
+ MPM.add(createPruneEHPass()); // Remove dead EH info
+ if (Inliner) {
+ MPM.add(Inliner);
+ Inliner = 0;
+ }
+ if (!DisableUnitAtATime)
+ MPM.add(createFunctionAttrsPass()); // Set readonly/readnone attrs
+ if (OptLevel > 2)
+ MPM.add(createArgumentPromotionPass()); // Scalarize uninlined fn args
+
+ // Start of function pass.
+ // Break up aggregate allocas, using SSAUpdater.
+ MPM.add(createScalarReplAggregatesPass(-1, false));
+ MPM.add(createEarlyCSEPass()); // Catch trivial redundancies
+ if (!DisableSimplifyLibCalls)
+ MPM.add(createSimplifyLibCallsPass()); // Library Call Optimizations
+ MPM.add(createJumpThreadingPass()); // Thread jumps.
+ MPM.add(createCorrelatedValuePropagationPass()); // Propagate conditionals
+ MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
+ MPM.add(createInstructionCombiningPass()); // Combine silly seq's
+
+ MPM.add(createTailCallEliminationPass()); // Eliminate tail calls
+ MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
+ MPM.add(createReassociatePass()); // Reassociate expressions
+ MPM.add(createLoopRotatePass()); // Rotate Loop
+ MPM.add(createLICMPass()); // Hoist loop invariants
+ MPM.add(createLoopUnswitchPass(SizeLevel || OptLevel < 3));
+ MPM.add(createInstructionCombiningPass());
+ MPM.add(createIndVarSimplifyPass()); // Canonicalize indvars
+ MPM.add(createLoopIdiomPass()); // Recognize idioms like memset.
+ MPM.add(createLoopDeletionPass()); // Delete dead loops
+ if (!DisableUnrollLoops)
+ MPM.add(createLoopUnrollPass()); // Unroll small loops
+ addExtensionsToPM(EP_LoopOptimizerEnd, MPM);
+
+ if (OptLevel > 1)
+ MPM.add(createGVNPass()); // Remove redundancies
+ MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
+ MPM.add(createSCCPPass()); // Constant prop with SCCP
+
+ // Run instcombine after redundancy elimination to exploit opportunities
+ // opened up by them.
+ MPM.add(createInstructionCombiningPass());
+ MPM.add(createJumpThreadingPass()); // Thread jumps
+ MPM.add(createCorrelatedValuePropagationPass());
+ MPM.add(createDeadStoreEliminationPass()); // Delete dead stores
+ MPM.add(createAggressiveDCEPass()); // Delete dead instructions
+ MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
+ MPM.add(createInstructionCombiningPass()); // Clean up after everything.
+
+ if (!DisableUnitAtATime) {
+ MPM.add(createStripDeadPrototypesPass()); // Get rid of dead prototypes
+ MPM.add(createDeadTypeEliminationPass()); // Eliminate dead types
+
+ // GlobalOpt already deletes dead functions and globals, at -O3 try a
+ // late pass of GlobalDCE. It is capable of deleting dead cycles.
+ if (OptLevel > 2)
+ MPM.add(createGlobalDCEPass()); // Remove dead fns and globals.
+
+ if (OptLevel > 1)
+ MPM.add(createConstantMergePass()); // Merge dup global constants
+ }
+ }
+
+ void populateLTOPassManager(PassManagerBase &PM, bool Internalize,
+ bool RunInliner) {
+ // Provide AliasAnalysis services for optimizations.
+ addInitialAliasAnalysisPasses(PM);
+
+ // Now that composite has been compiled, scan through the module, looking
+ // for a main function. If main is defined, mark all other functions
+ // internal.
+ if (Internalize)
+ PM.add(createInternalizePass(true));
+
+ // Propagate constants at call sites into the functions they call. This
+ // opens opportunities for globalopt (and inlining) by substituting function
+ // pointers passed as arguments to direct uses of functions.
+ PM.add(createIPSCCPPass());
+
+ // Now that we internalized some globals, see if we can hack on them!
+ PM.add(createGlobalOptimizerPass());
+
+ // Linking modules together can lead to duplicated global constants, only
+ // keep one copy of each constant.
+ PM.add(createConstantMergePass());
+
+ // Remove unused arguments from functions.
+ PM.add(createDeadArgEliminationPass());
+
+ // Reduce the code after globalopt and ipsccp. Both can open up significant
+ // simplification opportunities, and both can propagate functions through
+ // function pointers. When this happens, we often have to resolve varargs
+ // calls, etc, so let instcombine do this.
+ PM.add(createInstructionCombiningPass());
+
+ // Inline small functions
+ if (RunInliner)
+ PM.add(createFunctionInliningPass());
+
+ PM.add(createPruneEHPass()); // Remove dead EH info.
+
+ // Optimize globals again if we ran the inliner.
+ if (RunInliner)
+ PM.add(createGlobalOptimizerPass());
+ PM.add(createGlobalDCEPass()); // Remove dead functions.
+
+ // If we didn't decide to inline a function, check to see if we can
+ // transform it to pass arguments by value instead of by reference.
+ PM.add(createArgumentPromotionPass());
+
+ // The IPO passes may leave cruft around. Clean up after them.
+ PM.add(createInstructionCombiningPass());
+ PM.add(createJumpThreadingPass());
+ // Break up allocas
+ PM.add(createScalarReplAggregatesPass());
+
+ // Run a few AA driven optimizations here and now, to cleanup the code.
+ PM.add(createFunctionAttrsPass()); // Add nocapture.
+ PM.add(createGlobalsModRefPass()); // IP alias analysis.
+
+ PM.add(createLICMPass()); // Hoist loop invariants.
+ PM.add(createGVNPass()); // Remove redundancies.
+ PM.add(createMemCpyOptPass()); // Remove dead memcpys.
+ // Nuke dead stores.
+ PM.add(createDeadStoreEliminationPass());
+
+ // Cleanup and simplify the code after the scalar optimizations.
+ PM.add(createInstructionCombiningPass());
+
+ PM.add(createJumpThreadingPass());
+
+ // Delete basic blocks, which optimization passes may have killed.
+ PM.add(createCFGSimplificationPass());
+
+ // Now that we have optimized the program, discard unreachable functions.
+ PM.add(createGlobalDCEPass());
+ }
+};
+
+
+} // end namespace llvm
+#endif
diff --git a/contrib/llvm/include/llvm/Support/PatternMatch.h b/contrib/llvm/include/llvm/Support/PatternMatch.h
index 172480e..f0fb516 100644
--- a/contrib/llvm/include/llvm/Support/PatternMatch.h
+++ b/contrib/llvm/include/llvm/Support/PatternMatch.h
@@ -694,6 +694,99 @@ inline brc_match<Cond_t> m_Br(const Cond_t &C, BasicBlock *&T, BasicBlock *&F) {
return brc_match<Cond_t>(C, T, F);
}
+
+//===----------------------------------------------------------------------===//
+// Matchers for max/min idioms, eg: "select (sgt x, y), x, y" -> smax(x,y).
+//
+
+template<typename LHS_t, typename RHS_t, typename Pred_t>
+struct MaxMin_match {
+ LHS_t L;
+ RHS_t R;
+
+ MaxMin_match(const LHS_t &LHS, const RHS_t &RHS)
+ : L(LHS), R(RHS) {}
+
+ template<typename OpTy>
+ bool match(OpTy *V) {
+ // Look for "(x pred y) ? x : y" or "(x pred y) ? y : x".
+ SelectInst *SI = dyn_cast<SelectInst>(V);
+ if (!SI)
+ return false;
+ ICmpInst *Cmp = dyn_cast<ICmpInst>(SI->getCondition());
+ if (!Cmp)
+ return false;
+ // At this point we have a select conditioned on a comparison. Check that
+ // it is the values returned by the select that are being compared.
+ Value *TrueVal = SI->getTrueValue();
+ Value *FalseVal = SI->getFalseValue();
+ Value *LHS = Cmp->getOperand(0);
+ Value *RHS = Cmp->getOperand(1);
+ if ((TrueVal != LHS || FalseVal != RHS) &&
+ (TrueVal != RHS || FalseVal != LHS))
+ return false;
+ ICmpInst::Predicate Pred = LHS == TrueVal ?
+ Cmp->getPredicate() : Cmp->getSwappedPredicate();
+ // Does "(x pred y) ? x : y" represent the desired max/min operation?
+ if (!Pred_t::match(Pred))
+ return false;
+ // It does! Bind the operands.
+ return L.match(LHS) && R.match(RHS);
+ }
+};
+
+/// smax_pred_ty - Helper class for identifying signed max predicates.
+struct smax_pred_ty {
+ static bool match(ICmpInst::Predicate Pred) {
+ return Pred == CmpInst::ICMP_SGT || Pred == CmpInst::ICMP_SGE;
+ }
+};
+
+/// smin_pred_ty - Helper class for identifying signed min predicates.
+struct smin_pred_ty {
+ static bool match(ICmpInst::Predicate Pred) {
+ return Pred == CmpInst::ICMP_SLT || Pred == CmpInst::ICMP_SLE;
+ }
+};
+
+/// umax_pred_ty - Helper class for identifying unsigned max predicates.
+struct umax_pred_ty {
+ static bool match(ICmpInst::Predicate Pred) {
+ return Pred == CmpInst::ICMP_UGT || Pred == CmpInst::ICMP_UGE;
+ }
+};
+
+/// umin_pred_ty - Helper class for identifying unsigned min predicates.
+struct umin_pred_ty {
+ static bool match(ICmpInst::Predicate Pred) {
+ return Pred == CmpInst::ICMP_ULT || Pred == CmpInst::ICMP_ULE;
+ }
+};
+
+template<typename LHS, typename RHS>
+inline MaxMin_match<LHS, RHS, smax_pred_ty>
+m_SMax(const LHS &L, const RHS &R) {
+ return MaxMin_match<LHS, RHS, smax_pred_ty>(L, R);
+}
+
+template<typename LHS, typename RHS>
+inline MaxMin_match<LHS, RHS, smin_pred_ty>
+m_SMin(const LHS &L, const RHS &R) {
+ return MaxMin_match<LHS, RHS, smin_pred_ty>(L, R);
+}
+
+template<typename LHS, typename RHS>
+inline MaxMin_match<LHS, RHS, umax_pred_ty>
+m_UMax(const LHS &L, const RHS &R) {
+ return MaxMin_match<LHS, RHS, umax_pred_ty>(L, R);
+}
+
+template<typename LHS, typename RHS>
+inline MaxMin_match<LHS, RHS, umin_pred_ty>
+m_UMin(const LHS &L, const RHS &R) {
+ return MaxMin_match<LHS, RHS, umin_pred_ty>(L, R);
+}
+
} // end namespace PatternMatch
} // end namespace llvm
diff --git a/contrib/llvm/include/llvm/Support/Program.h b/contrib/llvm/include/llvm/Support/Program.h
index 96b3566..a502657 100644
--- a/contrib/llvm/include/llvm/Support/Program.h
+++ b/contrib/llvm/include/llvm/Support/Program.h
@@ -85,8 +85,9 @@ namespace sys {
/// This function waits for the program to exit. This function will block
/// the current program until the invoked program exits.
/// @returns an integer result code indicating the status of the program.
- /// A zero or positive value indicates the result code of the program. A
- /// negative value is the signal number on which it terminated.
+ /// A zero or positive value indicates the result code of the program.
+ /// -1 indicates failure to execute
+ /// -2 indicates a crash during execution or timeout
/// @see Execute
/// @brief Waits for the program to exit.
int Wait
diff --git a/contrib/llvm/include/llvm/Support/SourceMgr.h b/contrib/llvm/include/llvm/Support/SourceMgr.h
index 2a712e4..030db8f 100644
--- a/contrib/llvm/include/llvm/Support/SourceMgr.h
+++ b/contrib/llvm/include/llvm/Support/SourceMgr.h
@@ -106,7 +106,9 @@ public:
/// AddIncludeFile - Search for a file with the specified name in the current
/// directory or in one of the IncludeDirs. If no file is found, this returns
/// ~0, otherwise it returns the buffer ID of the stacked file.
- unsigned AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc);
+ /// The full path to the included file can be found in IncludedFile.
+ unsigned AddIncludeFile(const std::string &Filename, SMLoc IncludeLoc,
+ std::string &IncludedFile);
/// FindBufferContainingLoc - Return the ID of the buffer containing the
/// specified location, returning -1 if not found.
diff --git a/contrib/llvm/include/llvm/Support/StandardPasses.h b/contrib/llvm/include/llvm/Support/StandardPasses.h
deleted file mode 100644
index 8dfd6f9..0000000
--- a/contrib/llvm/include/llvm/Support/StandardPasses.h
+++ /dev/null
@@ -1,244 +0,0 @@
-//===-- llvm/Support/StandardPasses.h - Standard pass lists -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines utility functions for creating a "standard" set of
-// optimization passes, so that compilers and tools which use optimization
-// passes use the same set of standard passes.
-//
-// These are implemented as inline functions so that we do not have to worry
-// about link issues.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_STANDARDPASSES_H
-#define LLVM_SUPPORT_STANDARDPASSES_H
-
-#include "llvm/PassManager.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/IPO.h"
-
-namespace llvm {
-
- static inline void createStandardAliasAnalysisPasses(PassManagerBase *PM) {
- // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that
- // BasicAliasAnalysis wins if they disagree. This is intended to help
- // support "obvious" type-punning idioms.
- PM->add(createTypeBasedAliasAnalysisPass());
- PM->add(createBasicAliasAnalysisPass());
- }
-
- /// createStandardFunctionPasses - Add the standard list of function passes to
- /// the provided pass manager.
- ///
- /// \arg OptimizationLevel - The optimization level, corresponding to -O0,
- /// -O1, etc.
- static inline void createStandardFunctionPasses(PassManagerBase *PM,
- unsigned OptimizationLevel) {
- if (OptimizationLevel > 0) {
- createStandardAliasAnalysisPasses(PM);
- PM->add(createCFGSimplificationPass());
- PM->add(createScalarReplAggregatesPass());
- PM->add(createEarlyCSEPass());
- }
- }
-
- /// createStandardModulePasses - Add the standard list of module passes to the
- /// provided pass manager.
- ///
- /// \arg OptimizationLevel - The optimization level, corresponding to -O0,
- /// -O1, etc.
- /// \arg OptimizeSize - Whether the transformations should optimize for size.
- /// \arg UnitAtATime - Allow passes which may make global module changes.
- /// \arg UnrollLoops - Allow loop unrolling.
- /// \arg SimplifyLibCalls - Allow library calls to be simplified.
- /// \arg HaveExceptions - Whether the module may have code using exceptions.
- /// \arg InliningPass - The inlining pass to use, if any, or null. This will
- /// always be added, even at -O0.a
- static inline void createStandardModulePasses(PassManagerBase *PM,
- unsigned OptimizationLevel,
- bool OptimizeSize,
- bool UnitAtATime,
- bool UnrollLoops,
- bool SimplifyLibCalls,
- bool HaveExceptions,
- Pass *InliningPass) {
- createStandardAliasAnalysisPasses(PM);
-
- // If all optimizations are disabled, just run the always-inline pass.
- if (OptimizationLevel == 0) {
- if (InliningPass)
- PM->add(InliningPass);
- return;
- }
-
- if (UnitAtATime) {
- PM->add(createGlobalOptimizerPass()); // Optimize out global vars
-
- PM->add(createIPSCCPPass()); // IP SCCP
- PM->add(createDeadArgEliminationPass()); // Dead argument elimination
-
- PM->add(createInstructionCombiningPass());// Clean up after IPCP & DAE
- PM->add(createCFGSimplificationPass()); // Clean up after IPCP & DAE
- }
-
- // Start of CallGraph SCC passes.
- if (UnitAtATime && HaveExceptions)
- PM->add(createPruneEHPass()); // Remove dead EH info
- if (InliningPass)
- PM->add(InliningPass);
- if (UnitAtATime)
- PM->add(createFunctionAttrsPass()); // Set readonly/readnone attrs
- if (OptimizationLevel > 2)
- PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args
-
- // Start of function pass.
- // Break up aggregate allocas, using SSAUpdater.
- PM->add(createScalarReplAggregatesPass(-1, false));
- PM->add(createEarlyCSEPass()); // Catch trivial redundancies
- if (SimplifyLibCalls)
- PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations
- PM->add(createJumpThreadingPass()); // Thread jumps.
- PM->add(createCorrelatedValuePropagationPass()); // Propagate conditionals
- PM->add(createCFGSimplificationPass()); // Merge & remove BBs
- PM->add(createInstructionCombiningPass()); // Combine silly seq's
-
- PM->add(createTailCallEliminationPass()); // Eliminate tail calls
- PM->add(createCFGSimplificationPass()); // Merge & remove BBs
- PM->add(createReassociatePass()); // Reassociate expressions
- PM->add(createLoopRotatePass()); // Rotate Loop
- PM->add(createLICMPass()); // Hoist loop invariants
- PM->add(createLoopUnswitchPass(OptimizeSize || OptimizationLevel < 3));
- PM->add(createInstructionCombiningPass());
- PM->add(createIndVarSimplifyPass()); // Canonicalize indvars
- PM->add(createLoopIdiomPass()); // Recognize idioms like memset.
- PM->add(createLoopDeletionPass()); // Delete dead loops
- if (UnrollLoops)
- PM->add(createLoopUnrollPass()); // Unroll small loops
- if (OptimizationLevel > 1)
- PM->add(createGVNPass()); // Remove redundancies
- PM->add(createMemCpyOptPass()); // Remove memcpy / form memset
- PM->add(createSCCPPass()); // Constant prop with SCCP
-
- // Run instcombine after redundancy elimination to exploit opportunities
- // opened up by them.
- PM->add(createInstructionCombiningPass());
- PM->add(createJumpThreadingPass()); // Thread jumps
- PM->add(createCorrelatedValuePropagationPass());
- PM->add(createDeadStoreEliminationPass()); // Delete dead stores
- PM->add(createAggressiveDCEPass()); // Delete dead instructions
- PM->add(createCFGSimplificationPass()); // Merge & remove BBs
- PM->add(createInstructionCombiningPass()); // Clean up after everything.
-
- if (UnitAtATime) {
- PM->add(createStripDeadPrototypesPass()); // Get rid of dead prototypes
- PM->add(createDeadTypeEliminationPass()); // Eliminate dead types
-
- // GlobalOpt already deletes dead functions and globals, at -O3 try a
- // late pass of GlobalDCE. It is capable of deleting dead cycles.
- if (OptimizationLevel > 2)
- PM->add(createGlobalDCEPass()); // Remove dead fns and globals.
-
- if (OptimizationLevel > 1)
- PM->add(createConstantMergePass()); // Merge dup global constants
- }
- }
-
- static inline void addOnePass(PassManagerBase *PM, Pass *P, bool AndVerify) {
- PM->add(P);
-
- if (AndVerify)
- PM->add(createVerifierPass());
- }
-
- /// createStandardLTOPasses - Add the standard list of module passes suitable
- /// for link time optimization.
- ///
- /// Internalize - Run the internalize pass.
- /// RunInliner - Use a function inlining pass.
- /// VerifyEach - Run the verifier after each pass.
- static inline void createStandardLTOPasses(PassManagerBase *PM,
- bool Internalize,
- bool RunInliner,
- bool VerifyEach) {
- // Provide AliasAnalysis services for optimizations.
- createStandardAliasAnalysisPasses(PM);
-
- // Now that composite has been compiled, scan through the module, looking
- // for a main function. If main is defined, mark all other functions
- // internal.
- if (Internalize)
- addOnePass(PM, createInternalizePass(true), VerifyEach);
-
- // Propagate constants at call sites into the functions they call. This
- // opens opportunities for globalopt (and inlining) by substituting function
- // pointers passed as arguments to direct uses of functions.
- addOnePass(PM, createIPSCCPPass(), VerifyEach);
-
- // Now that we internalized some globals, see if we can hack on them!
- addOnePass(PM, createGlobalOptimizerPass(), VerifyEach);
-
- // Linking modules together can lead to duplicated global constants, only
- // keep one copy of each constant...
- addOnePass(PM, createConstantMergePass(), VerifyEach);
-
- // Remove unused arguments from functions...
- addOnePass(PM, createDeadArgEliminationPass(), VerifyEach);
-
- // Reduce the code after globalopt and ipsccp. Both can open up significant
- // simplification opportunities, and both can propagate functions through
- // function pointers. When this happens, we often have to resolve varargs
- // calls, etc, so let instcombine do this.
- addOnePass(PM, createInstructionCombiningPass(), VerifyEach);
-
- // Inline small functions
- if (RunInliner)
- addOnePass(PM, createFunctionInliningPass(), VerifyEach);
-
- addOnePass(PM, createPruneEHPass(), VerifyEach); // Remove dead EH info.
- // Optimize globals again if we ran the inliner.
- if (RunInliner)
- addOnePass(PM, createGlobalOptimizerPass(), VerifyEach);
- addOnePass(PM, createGlobalDCEPass(), VerifyEach); // Remove dead functions.
-
- // If we didn't decide to inline a function, check to see if we can
- // transform it to pass arguments by value instead of by reference.
- addOnePass(PM, createArgumentPromotionPass(), VerifyEach);
-
- // The IPO passes may leave cruft around. Clean up after them.
- addOnePass(PM, createInstructionCombiningPass(), VerifyEach);
- addOnePass(PM, createJumpThreadingPass(), VerifyEach);
- // Break up allocas
- addOnePass(PM, createScalarReplAggregatesPass(), VerifyEach);
-
- // Run a few AA driven optimizations here and now, to cleanup the code.
- addOnePass(PM, createFunctionAttrsPass(), VerifyEach); // Add nocapture.
- addOnePass(PM, createGlobalsModRefPass(), VerifyEach); // IP alias analysis.
-
- addOnePass(PM, createLICMPass(), VerifyEach); // Hoist loop invariants.
- addOnePass(PM, createGVNPass(), VerifyEach); // Remove redundancies.
- addOnePass(PM, createMemCpyOptPass(), VerifyEach); // Remove dead memcpys.
- // Nuke dead stores.
- addOnePass(PM, createDeadStoreEliminationPass(), VerifyEach);
-
- // Cleanup and simplify the code after the scalar optimizations.
- addOnePass(PM, createInstructionCombiningPass(), VerifyEach);
-
- addOnePass(PM, createJumpThreadingPass(), VerifyEach);
-
- // Delete basic blocks, which optimization passes may have killed.
- addOnePass(PM, createCFGSimplificationPass(), VerifyEach);
-
- // Now that we have optimized the program, discard unreachable functions.
- addOnePass(PM, createGlobalDCEPass(), VerifyEach);
- }
-}
-
-#endif
diff --git a/contrib/llvm/include/llvm/Support/Win64EH.h b/contrib/llvm/include/llvm/Support/Win64EH.h
new file mode 100644
index 0000000..8d74e10
--- /dev/null
+++ b/contrib/llvm/include/llvm/Support/Win64EH.h
@@ -0,0 +1,100 @@
+//===-- llvm/Support/Win64EH.h ---Win64 EH Constants-------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains constants and structures used for implementing
+// exception handling on Win64 platforms. For more information, see
+// http://msdn.microsoft.com/en-us/library/1eyas8tf.aspx
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_WIN64EH_H
+#define LLVM_SUPPORT_WIN64EH_H
+
+#include "llvm/Support/DataTypes.h"
+
+namespace llvm {
+namespace Win64EH {
+
+/// UnwindOpcodes - Enumeration whose values specify a single operation in
+/// the prolog of a function.
+enum UnwindOpcodes {
+ UOP_PushNonVol = 0,
+ UOP_AllocLarge,
+ UOP_AllocSmall,
+ UOP_SetFPReg,
+ UOP_SaveNonVol,
+ UOP_SaveNonVolBig,
+ UOP_SaveXMM128 = 8,
+ UOP_SaveXMM128Big,
+ UOP_PushMachFrame
+};
+
+/// UnwindCode - This union describes a single operation in a function prolog,
+/// or part thereof.
+union UnwindCode {
+ struct {
+ uint8_t codeOffset;
+ uint8_t unwindOp:4,
+ opInfo:4;
+ } u;
+ uint16_t frameOffset;
+};
+
+enum {
+ /// UNW_ExceptionHandler - Specifies that this function has an exception
+ /// handler.
+ UNW_ExceptionHandler = 0x01,
+ /// UNW_TerminateHandler - Specifies that this function has a termination
+ /// handler.
+ UNW_TerminateHandler = 0x02,
+ /// UNW_ChainInfo - Specifies that this UnwindInfo structure is chained to
+ /// another one.
+ UNW_ChainInfo = 0x04
+};
+
+/// RuntimeFunction - An entry in the table of functions with unwind info.
+struct RuntimeFunction {
+ uint64_t startAddress;
+ uint64_t endAddress;
+ uint64_t unwindInfoOffset;
+};
+
+/// UnwindInfo - An entry in the exception table.
+struct UnwindInfo {
+ uint8_t version:3,
+ flags:5;
+ uint8_t prologSize;
+ uint8_t numCodes;
+ uint8_t frameRegister:4,
+ frameOffset:4;
+ UnwindCode unwindCodes[1];
+
+ void *getLanguageSpecificData() {
+ return reinterpret_cast<void *>(&unwindCodes[(numCodes+1) & ~1]);
+ }
+ uint64_t getLanguageSpecificHandlerOffset() {
+ return *reinterpret_cast<uint64_t *>(getLanguageSpecificData());
+ }
+ void setLanguageSpecificHandlerOffset(uint64_t offset) {
+ *reinterpret_cast<uint64_t *>(getLanguageSpecificData()) = offset;
+ }
+ RuntimeFunction *getChainedFunctionEntry() {
+ return reinterpret_cast<RuntimeFunction *>(getLanguageSpecificData());
+ }
+ void *getExceptionData() {
+ return reinterpret_cast<void *>(reinterpret_cast<uint64_t *>(
+ getLanguageSpecificData())+1);
+ }
+};
+
+
+} // End of namespace Win64EH
+} // End of namespace llvm
+
+#endif
diff --git a/contrib/llvm/include/llvm/Target/Target.td b/contrib/llvm/include/llvm/Target/Target.td
index 68f0515..ab6a4e2 100644
--- a/contrib/llvm/include/llvm/Target/Target.td
+++ b/contrib/llvm/include/llvm/Target/Target.td
@@ -128,6 +128,11 @@ class RegisterClass<string namespace, list<ValueType> regTypes, int alignment,
// dags: (RegClass SubRegIndex, SubRegindex, ...)
list<dag> SubRegClasses = [];
+ // isAllocatable - Specify that the register class can be used for virtual
+ // registers and register allocation. Some register classes are only used to
+ // model instruction operand constraints, and should have isAllocatable = 0.
+ bit isAllocatable = 1;
+
// MethodProtos/MethodBodies - These members can be used to insert arbitrary
// code into a generated register class. The normal usage of this is to
// overload virtual methods.
@@ -151,6 +156,14 @@ class DwarfRegNum<list<int> Numbers> {
list<int> DwarfNumbers = Numbers;
}
+// DwarfRegAlias - This class declares that a given register uses the same dwarf
+// numbers as another one. This is useful for making it clear that the two
+// registers do have the same number. It also lets us build a mapping
+// from dwarf register number to llvm register.
+class DwarfRegAlias<Register reg> {
+ Register DwarfAlias = reg;
+}
+
//===----------------------------------------------------------------------===//
// Pull in the common support for scheduling
//
diff --git a/contrib/llvm/include/llvm/Target/TargetAsmInfo.h b/contrib/llvm/include/llvm/Target/TargetAsmInfo.h
index 0271b67..743a2d4 100644
--- a/contrib/llvm/include/llvm/Target/TargetAsmInfo.h
+++ b/contrib/llvm/include/llvm/Target/TargetAsmInfo.h
@@ -22,6 +22,7 @@
namespace llvm {
class MCSection;
class MCContext;
+ class MachineFunction;
class TargetMachine;
class TargetLoweringObjectFile;
@@ -58,6 +59,18 @@ public:
return TLOF->getEHFrameSection();
}
+ const MCSection *getDwarfFrameSection() const {
+ return TLOF->getDwarfFrameSection();
+ }
+
+ const MCSection *getWin64EHFuncTableSection(StringRef Suffix) const {
+ return TLOF->getWin64EHFuncTableSection(Suffix);
+ }
+
+ const MCSection *getWin64EHTableSection(StringRef Suffix) const {
+ return TLOF->getWin64EHTableSection(Suffix);
+ }
+
unsigned getFDEEncoding(bool CFI) const {
return TLOF->getFDEEncoding(CFI);
}
@@ -66,6 +79,10 @@ public:
return TLOF->isFunctionEHFrameSymbolPrivate();
}
+ const unsigned *getCalleeSavedRegs(MachineFunction *MF = 0) const {
+ return TRI->getCalleeSavedRegs(MF);
+ }
+
unsigned getDwarfRARegNum(bool isEH) const {
return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
}
@@ -77,6 +94,14 @@ public:
int getDwarfRegNum(unsigned RegNum, bool isEH) const {
return TRI->getDwarfRegNum(RegNum, isEH);
}
+
+ int getLLVMRegNum(unsigned DwarfRegNum, bool isEH) const {
+ return TRI->getLLVMRegNum(DwarfRegNum, isEH);
+ }
+
+ int getSEHRegNum(unsigned RegNum) const {
+ return TRI->getSEHRegNum(RegNum);
+ }
};
}
diff --git a/contrib/llvm/include/llvm/Target/TargetInstrItineraries.h b/contrib/llvm/include/llvm/Target/TargetInstrItineraries.h
index 198d585..6011402 100644
--- a/contrib/llvm/include/llvm/Target/TargetInstrItineraries.h
+++ b/contrib/llvm/include/llvm/Target/TargetInstrItineraries.h
@@ -122,7 +122,8 @@ public:
InstrItineraryData(const InstrStage *S, const unsigned *OS,
const unsigned *F, const InstrItinerary *I)
- : Stages(S), OperandCycles(OS), Forwardings(F), Itineraries(I) {}
+ : Stages(S), OperandCycles(OS), Forwardings(F), Itineraries(I),
+ IssueWidth(0) {}
/// isEmpty - Returns true if there are no itineraries.
///
diff --git a/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h b/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h
index 0914b5d..02a1a3c 100644
--- a/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h
+++ b/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h
@@ -51,6 +51,7 @@ public:
static char ID;
TargetLibraryInfo();
TargetLibraryInfo(const Triple &T);
+ explicit TargetLibraryInfo(const TargetLibraryInfo &TLI);
/// has - This function is used by optimizations that want to match on or form
/// a given library function.
diff --git a/contrib/llvm/include/llvm/Target/TargetLowering.h b/contrib/llvm/include/llvm/Target/TargetLowering.h
index 17d761c..3e36fb7 100644
--- a/contrib/llvm/include/llvm/Target/TargetLowering.h
+++ b/contrib/llvm/include/llvm/Target/TargetLowering.h
@@ -94,6 +94,19 @@ public:
Custom // Use the LowerOperation hook to implement custom lowering.
};
+ /// LegalizeAction - This enum indicates whether a types are legal for a
+ /// target, and if not, what action should be used to make them valid.
+ enum LegalizeTypeAction {
+ TypeLegal, // The target natively supports this type.
+ TypePromoteInteger, // Replace this integer with a larger one.
+ TypeExpandInteger, // Split this integer into two of half the size.
+ TypeSoftenFloat, // Convert this float to a same size integer type.
+ TypeExpandFloat, // Split this float into two of half the size.
+ TypeScalarizeVector, // Replace this one-element vector with its element.
+ TypeSplitVector, // Split this vector into two of half the size.
+ TypeWidenVector // This vector should be widened into a larger vector.
+ };
+
enum BooleanContent { // How the target represents true/false values.
UndefinedBooleanContent, // Only bit 0 counts, the rest can hold garbage.
ZeroOrOneBooleanContent, // All bits zero except for bit 0.
@@ -200,71 +213,20 @@ public:
}
class ValueTypeActionImpl {
- /// ValueTypeActions - For each value type, keep a LegalizeAction enum
+ /// ValueTypeActions - For each value type, keep a LegalizeTypeAction enum
/// that indicates how instruction selection should deal with the type.
uint8_t ValueTypeActions[MVT::LAST_VALUETYPE];
- LegalizeAction getExtendedTypeAction(EVT VT) const {
- // Handle non-vector integers.
- if (!VT.isVector()) {
- assert(VT.isInteger() && "Unsupported extended type!");
- unsigned BitSize = VT.getSizeInBits();
- // First promote to a power-of-two size, then expand if necessary.
- if (BitSize < 8 || !isPowerOf2_32(BitSize))
- return Promote;
- return Expand;
- }
-
- // Vectors with only one element are always scalarized.
- if (VT.getVectorNumElements() == 1)
- return Expand;
-
- // Vectors with a number of elements that is not a power of two are always
- // widened, for example <3 x float> -> <4 x float>.
- if (!VT.isPow2VectorType())
- return Promote;
-
- // Vectors with a crazy element type are always expanded, for example
- // <4 x i2> is expanded into two vectors of type <2 x i2>.
- if (!VT.getVectorElementType().isSimple())
- return Expand;
-
- // If this type is smaller than a legal vector type then widen it,
- // otherwise expand it. E.g. <2 x float> -> <4 x float>.
- MVT EltType = VT.getVectorElementType().getSimpleVT();
- unsigned NumElts = VT.getVectorNumElements();
- while (1) {
- // Round up to the next power of 2.
- NumElts = (unsigned)NextPowerOf2(NumElts);
-
- // If there is no simple vector type with this many elements then there
- // cannot be a larger legal vector type. Note that this assumes that
- // there are no skipped intermediate vector types in the simple types.
- MVT LargerVector = MVT::getVectorVT(EltType, NumElts);
- if (LargerVector == MVT())
- return Expand;
-
- // If this type is legal then widen the vector.
- if (getTypeAction(LargerVector) == Legal)
- return Promote;
- }
- }
public:
ValueTypeActionImpl() {
std::fill(ValueTypeActions, array_endof(ValueTypeActions), 0);
}
- LegalizeAction getTypeAction(EVT VT) const {
- if (!VT.isExtended())
- return getTypeAction(VT.getSimpleVT());
- return getExtendedTypeAction(VT);
- }
-
- LegalizeAction getTypeAction(MVT VT) const {
- return (LegalizeAction)ValueTypeActions[VT.SimpleTy];
+ LegalizeTypeAction getTypeAction(MVT VT) const {
+ return (LegalizeTypeAction)ValueTypeActions[VT.SimpleTy];
}
- void setTypeAction(EVT VT, LegalizeAction Action) {
+ void setTypeAction(EVT VT, LegalizeTypeAction Action) {
unsigned I = VT.getSimpleVT().SimpleTy;
ValueTypeActions[I] = Action;
}
@@ -278,10 +240,10 @@ public:
/// it is already legal (return 'Legal') or we need to promote it to a larger
/// type (return 'Promote'), or we need to expand it into multiple registers
/// of smaller integer type (return 'Expand'). 'Custom' is not an option.
- LegalizeAction getTypeAction(EVT VT) const {
- return ValueTypeActions.getTypeAction(VT);
+ LegalizeTypeAction getTypeAction(LLVMContext &Context, EVT VT) const {
+ return getTypeConversion(Context, VT).first;
}
- LegalizeAction getTypeAction(MVT VT) const {
+ LegalizeTypeAction getTypeAction(MVT VT) const {
return ValueTypeActions.getTypeAction(VT);
}
@@ -292,38 +254,7 @@ public:
/// to get to the smaller register. For illegal floating point types, this
/// returns the integer type to transform to.
EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const {
- if (VT.isSimple()) {
- assert((unsigned)VT.getSimpleVT().SimpleTy <
- array_lengthof(TransformToType));
- EVT NVT = TransformToType[VT.getSimpleVT().SimpleTy];
- assert(getTypeAction(NVT) != Promote &&
- "Promote may not follow Expand or Promote");
- return NVT;
- }
-
- if (VT.isVector()) {
- EVT NVT = VT.getPow2VectorType(Context);
- if (NVT == VT) {
- // Vector length is a power of 2 - split to half the size.
- unsigned NumElts = VT.getVectorNumElements();
- EVT EltVT = VT.getVectorElementType();
- return (NumElts == 1) ?
- EltVT : EVT::getVectorVT(Context, EltVT, NumElts / 2);
- }
- // Promote to a power of two size, avoiding multi-step promotion.
- return getTypeAction(NVT) == Promote ?
- getTypeToTransformTo(Context, NVT) : NVT;
- } else if (VT.isInteger()) {
- EVT NVT = VT.getRoundIntegerType(Context);
- if (NVT == VT) // Size is a power of two - expand to half the size.
- return EVT::getIntegerVT(Context, VT.getSizeInBits() / 2);
-
- // Promote to a power of two size, avoiding multi-step promotion.
- return getTypeAction(NVT) == Promote ?
- getTypeToTransformTo(Context, NVT) : NVT;
- }
- assert(0 && "Unsupported extended type!");
- return MVT(MVT::Other); // Not reached
+ return getTypeConversion(Context, VT).second;
}
/// getTypeToExpandTo - For types supported by the target, this is an
@@ -333,7 +264,7 @@ public:
EVT getTypeToExpandTo(LLVMContext &Context, EVT VT) const {
assert(!VT.isVector());
while (true) {
- switch (getTypeAction(VT)) {
+ switch (getTypeAction(Context, VT)) {
case Legal:
return VT;
case Expand:
@@ -761,6 +692,18 @@ public:
return MinStackArgumentAlignment;
}
+ /// getMinFunctionAlignment - return the minimum function alignment.
+ ///
+ unsigned getMinFunctionAlignment() const {
+ return MinFunctionAlignment;
+ }
+
+ /// getPrefFunctionAlignment - return the preferred function alignment.
+ ///
+ unsigned getPrefFunctionAlignment() const {
+ return PrefFunctionAlignment;
+ }
+
/// getPrefLoopAlignment - return the preferred loop alignment.
///
unsigned getPrefLoopAlignment() const {
@@ -824,9 +767,6 @@ public:
/// PIC relocation models.
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *) const = 0;
-
/// getStackCookieLocation - Return true if the target stores stack
/// protector cookies at a fixed offset in some non-standard address
/// space, and populates the address space and offset as
@@ -1167,6 +1107,18 @@ protected:
JumpBufAlignment = Align;
}
+ /// setMinFunctionAlignment - Set the target's minimum function alignment.
+ void setMinFunctionAlignment(unsigned Align) {
+ MinFunctionAlignment = Align;
+ }
+
+ /// setPrefFunctionAlignment - Set the target's preferred function alignment.
+ /// This should be set if there is a performance benefit to
+ /// higher-than-minimum alignment
+ void setPrefFunctionAlignment(unsigned Align) {
+ PrefFunctionAlignment = Align;
+ }
+
/// setPrefLoopAlignment - Set the target's preferred loop alignment. Default
/// alignment is zero, it means the target does not care about loop alignment.
void setPrefLoopAlignment(unsigned Align) {
@@ -1259,7 +1211,8 @@ public:
/// return values described by the Outs array can fit into the return
/// registers. If false is returned, an sret-demotion is performed.
///
- virtual bool CanLowerReturn(CallingConv::ID CallConv, bool isVarArg,
+ virtual bool CanLowerReturn(CallingConv::ID CallConv,
+ MachineFunction &MF, bool isVarArg,
const SmallVectorImpl<ISD::OutputArg> &Outs,
LLVMContext &Context) const
{
@@ -1497,7 +1450,7 @@ public:
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
- virtual void LowerAsmOperandForConstraint(SDValue Op, char ConstraintLetter,
+ virtual void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint,
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const;
@@ -1583,6 +1536,14 @@ public:
return true;
}
+ /// isLegalAddImmediate - Return true if the specified immediate is legal
+ /// add immediate, that is the target has add instructions which can add
+ /// a register with the immediate without having to materialize the
+ /// immediate into a register.
+ virtual bool isLegalAddImmediate(int64_t Imm) const {
+ return true;
+ }
+
//===--------------------------------------------------------------------===//
// Div utility functions
//
@@ -1637,6 +1598,13 @@ private:
const TargetData *TD;
const TargetLoweringObjectFile &TLOF;
+ /// We are in the process of implementing a new TypeLegalization action
+ /// which is the promotion of vector elements. This feature is under
+ /// development. Until this feature is complete, it is only enabled using a
+ /// flag. We pass this flag using a member because of circular dep issues.
+ /// This member will be removed with the flag once we complete the transition.
+ bool mayPromoteElements;
+
/// PointerTy - The type to use for pointers, usually i32 or i64.
///
MVT PointerTy;
@@ -1693,7 +1661,18 @@ private:
///
unsigned MinStackArgumentAlignment;
- /// PrefLoopAlignment - The perferred loop alignment.
+ /// MinFunctionAlignment - The minimum function alignment (used when
+ /// optimizing for size, and to prevent explicitly provided alignment
+ /// from leading to incorrect code).
+ ///
+ unsigned MinFunctionAlignment;
+
+ /// PrefFunctionAlignment - The preferred function alignment (used when
+ /// alignment unspecified and optimizing for speed).
+ ///
+ unsigned PrefFunctionAlignment;
+
+ /// PrefLoopAlignment - The preferred loop alignment.
///
unsigned PrefLoopAlignment;
@@ -1774,6 +1753,128 @@ private:
ValueTypeActionImpl ValueTypeActions;
+ typedef std::pair<LegalizeTypeAction, EVT> LegalizeKind;
+
+ LegalizeKind
+ getTypeConversion(LLVMContext &Context, EVT VT) const {
+ // If this is a simple type, use the ComputeRegisterProp mechanism.
+ if (VT.isSimple()) {
+ assert((unsigned)VT.getSimpleVT().SimpleTy <
+ array_lengthof(TransformToType));
+ EVT NVT = TransformToType[VT.getSimpleVT().SimpleTy];
+ LegalizeTypeAction LA = ValueTypeActions.getTypeAction(VT.getSimpleVT());
+
+ assert(
+ (!(NVT.isSimple() && LA != TypeLegal) ||
+ ValueTypeActions.getTypeAction(NVT.getSimpleVT()) != TypePromoteInteger)
+ && "Promote may not follow Expand or Promote");
+
+ return LegalizeKind(LA, NVT);
+ }
+
+ // Handle Extended Scalar Types.
+ if (!VT.isVector()) {
+ assert(VT.isInteger() && "Float types must be simple");
+ unsigned BitSize = VT.getSizeInBits();
+ // First promote to a power-of-two size, then expand if necessary.
+ if (BitSize < 8 || !isPowerOf2_32(BitSize)) {
+ EVT NVT = VT.getRoundIntegerType(Context);
+ assert(NVT != VT && "Unable to round integer VT");
+ LegalizeKind NextStep = getTypeConversion(Context, NVT);
+ // Avoid multi-step promotion.
+ if (NextStep.first == TypePromoteInteger) return NextStep;
+ // Return rounded integer type.
+ return LegalizeKind(TypePromoteInteger, NVT);
+ }
+
+ return LegalizeKind(TypeExpandInteger,
+ EVT::getIntegerVT(Context, VT.getSizeInBits()/2));
+ }
+
+ // Handle vector types.
+ unsigned NumElts = VT.getVectorNumElements();
+ EVT EltVT = VT.getVectorElementType();
+
+ // Vectors with only one element are always scalarized.
+ if (NumElts == 1)
+ return LegalizeKind(TypeScalarizeVector, EltVT);
+
+ // If we allow the promotion of vector elements using a flag,
+ // then try to widen vector elements until a legal type is found.
+ if (mayPromoteElements && EltVT.isInteger()) {
+ // Vectors with a number of elements that is not a power of two are always
+ // widened, for example <3 x float> -> <4 x float>.
+ if (!VT.isPow2VectorType()) {
+ NumElts = (unsigned)NextPowerOf2(NumElts);
+ EVT NVT = EVT::getVectorVT(Context, EltVT, NumElts);
+ return LegalizeKind(TypeWidenVector, NVT);
+ }
+
+ // Examine the element type.
+ LegalizeKind LK = getTypeConversion(Context, EltVT);
+
+ // If type is to be expanded, split the vector.
+ // <4 x i140> -> <2 x i140>
+ if (LK.first == TypeExpandInteger)
+ return LegalizeKind(TypeSplitVector,
+ EVT::getVectorVT(Context, EltVT, NumElts / 2));
+
+ // Promote the integer element types until a legal vector type is found
+ // or until the element integer type is too big. If a legal type was not
+ // found, fallback to the usual mechanism of widening/splitting the
+ // vector.
+ while (1) {
+ // Increase the bitwidth of the element to the next pow-of-two
+ // (which is greater than 8 bits).
+ EltVT = EVT::getIntegerVT(Context, 1 + EltVT.getSizeInBits()
+ ).getRoundIntegerType(Context);
+
+ // Stop trying when getting a non-simple element type.
+ // Note that vector elements may be greater than legal vector element
+ // types. Example: X86 XMM registers hold 64bit element on 32bit systems.
+ if (!EltVT.isSimple()) break;
+
+ // Build a new vector type and check if it is legal.
+ MVT NVT = MVT::getVectorVT(EltVT.getSimpleVT(), NumElts);
+
+ // Found a legal promoted vector type.
+ if (ValueTypeActions.getTypeAction(NVT) == TypeLegal)
+ return LegalizeKind(TypePromoteInteger,
+ EVT::getVectorVT(Context, EltVT, NumElts));
+ }
+ }
+
+ // Try to widen the vector until a legal type is found.
+ // If there is no wider legal type, split the vector.
+ while (1) {
+ // Round up to the next power of 2.
+ NumElts = (unsigned)NextPowerOf2(NumElts);
+
+ // If there is no simple vector type with this many elements then there
+ // cannot be a larger legal vector type. Note that this assumes that
+ // there are no skipped intermediate vector types in the simple types.
+ MVT LargerVector = MVT::getVectorVT(EltVT.getSimpleVT(), NumElts);
+ if (LargerVector == MVT()) break;
+
+ // If this type is legal then widen the vector.
+ if (ValueTypeActions.getTypeAction(LargerVector) == TypeLegal)
+ return LegalizeKind(TypeWidenVector, LargerVector);
+ }
+
+ // Widen odd vectors to next power of two.
+ if (!VT.isPow2VectorType()) {
+ EVT NVT = VT.getPow2VectorType(Context);
+ return LegalizeKind(TypeWidenVector, NVT);
+ }
+
+ // Vectors with illegal element types are expanded.
+ EVT NVT = EVT::getVectorVT(Context, EltVT, VT.getVectorNumElements() / 2);
+ return LegalizeKind(TypeSplitVector, NVT);
+
+ assert(false && "Unable to handle this kind of vector type");
+ return LegalizeKind(TypeLegal, VT);
+ }
+
std::vector<std::pair<EVT, TargetRegisterClass*> > AvailableRegClasses;
/// TargetDAGCombineArray - Targets can specify ISD nodes that they would
diff --git a/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h b/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h
index 7402ed6..3991035 100644
--- a/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h
+++ b/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h
@@ -97,10 +97,6 @@ protected:
/// weak_definition of constant 0 for an omitted EH frame.
bool SupportsWeakOmittedEHFrame;
- /// IsFunctionEHSymbolGlobal - This flag is set to true if the ".eh" symbol
- /// for a function should be marked .globl.
- bool IsFunctionEHSymbolGlobal;
-
/// IsFunctionEHFrameSymbolPrivate - This flag is set to true if the
/// "EH_frame" symbol for EH information should be an assembler temporary (aka
/// private linkage, aka an L or .L label) or false if it should be a normal
@@ -119,9 +115,6 @@ public:
Ctx = &ctx;
}
- bool isFunctionEHSymbolGlobal() const {
- return IsFunctionEHSymbolGlobal;
- }
bool isFunctionEHFrameSymbolPrivate() const {
return IsFunctionEHFrameSymbolPrivate;
}
@@ -162,6 +155,8 @@ public:
const MCSection *getTLSExtraDataSection() const {
return TLSExtraDataSection;
}
+ virtual const MCSection *getWin64EHFuncTableSection(StringRef suffix)const=0;
+ virtual const MCSection *getWin64EHTableSection(StringRef suffix) const = 0;
/// shouldEmitUsedDirectiveFor - This hook allows targets to selectively
/// decide not to emit the UsedDirective for some symbols in llvm.used.
diff --git a/contrib/llvm/include/llvm/Target/TargetOptions.h b/contrib/llvm/include/llvm/Target/TargetOptions.h
index 62190c1..beed039 100644
--- a/contrib/llvm/include/llvm/Target/TargetOptions.h
+++ b/contrib/llvm/include/llvm/Target/TargetOptions.h
@@ -125,10 +125,6 @@ namespace llvm {
/// flag is hidden and is only for debugging the debug info.
extern bool JITEmitDebugInfoToDisk;
- /// UnwindTablesMandatory - This flag indicates that unwind tables should
- /// be emitted for all functions.
- extern bool UnwindTablesMandatory;
-
/// GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is
/// specified on the commandline. When the flag is on, participating targets
/// will perform tail call optimization on all calls which use the fastcc
diff --git a/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h b/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h
index 205e76f..f6a8414 100644
--- a/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h
+++ b/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h
@@ -47,6 +47,7 @@ struct TargetRegisterDesc {
const unsigned *SubRegs; // Sub-register set, described above
const unsigned *SuperRegs; // Super-register set, described above
unsigned CostPerUse; // Extra cost of instructions using register.
+ bool inAllocatableClass; // Register belongs to an allocatable regclass.
};
class TargetRegisterClass {
@@ -66,6 +67,7 @@ private:
const sc_iterator SuperRegClasses;
const unsigned RegSize, Alignment; // Size & Alignment of register in bytes
const int CopyCost;
+ const bool Allocatable;
const iterator RegsBegin, RegsEnd;
DenseSet<unsigned> RegSet;
public:
@@ -76,11 +78,12 @@ public:
const TargetRegisterClass * const *supcs,
const TargetRegisterClass * const *subregcs,
const TargetRegisterClass * const *superregcs,
- unsigned RS, unsigned Al, int CC,
+ unsigned RS, unsigned Al, int CC, bool Allocable,
iterator RB, iterator RE)
: ID(id), Name(name), VTs(vts), SubClasses(subcs), SuperClasses(supcs),
SubRegClasses(subregcs), SuperRegClasses(superregcs),
- RegSize(RS), Alignment(Al), CopyCost(CC), RegsBegin(RB), RegsEnd(RE) {
+ RegSize(RS), Alignment(Al), CopyCost(CC), Allocatable(Allocable),
+ RegsBegin(RB), RegsEnd(RE) {
for (iterator I = RegsBegin, E = RegsEnd; I != E; ++I)
RegSet.insert(*I);
}
@@ -182,6 +185,12 @@ public:
return false;
}
+ /// hasSubClassEq - Returns true if RC is a subclass of or equal to this
+ /// class.
+ bool hasSubClassEq(const TargetRegisterClass *RC) const {
+ return RC == this || hasSubClass(RC);
+ }
+
/// subclasses_begin / subclasses_end - Loop over all of the classes
/// that are proper subsets of this register class.
sc_iterator subclasses_begin() const {
@@ -203,6 +212,12 @@ public:
return false;
}
+ /// hasSuperClassEq - Returns true if RC is a superclass of or equal to this
+ /// class.
+ bool hasSuperClassEq(const TargetRegisterClass *RC) const {
+ return RC == this || hasSuperClass(RC);
+ }
+
/// superclasses_begin / superclasses_end - Loop over all of the classes
/// that are proper supersets of this register class.
sc_iterator superclasses_begin() const {
@@ -256,6 +271,10 @@ public:
/// this class. A negative number means the register class is very expensive
/// to copy e.g. status flag register classes.
int getCopyCost() const { return CopyCost; }
+
+ /// isAllocatable - Return true if this register class may be used to create
+ /// virtual registers.
+ bool isAllocatable() const { return Allocatable; }
};
@@ -351,13 +370,13 @@ public:
/// The first virtual register in a function will get the index 0.
static unsigned virtReg2Index(unsigned Reg) {
assert(isVirtualRegister(Reg) && "Not a virtual register");
- return Reg - (1u << 31);
+ return Reg & ~(1u << 31);
}
/// index2VirtReg - Convert a 0-based index to a virtual register number.
/// This is the inverse operation of VirtReg2IndexFunctor below.
static unsigned index2VirtReg(unsigned Index) {
- return Index + (1u << 31);
+ return Index | (1u << 31);
}
/// getMinimalPhysRegClass - Returns the Register Class of a physical
@@ -802,6 +821,8 @@ public:
/// debugging info.
virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const = 0;
+ virtual int getLLVMRegNum(unsigned RegNum, bool isEH) const = 0;
+
/// getFrameRegister - This method should return the register used as a base
/// for values allocated in the current stack frame.
virtual unsigned getFrameRegister(const MachineFunction &MF) const = 0;
@@ -809,6 +830,12 @@ public:
/// getRARegister - This method should return the register where the return
/// address can be found.
virtual unsigned getRARegister() const = 0;
+
+ /// getSEHRegNum - Map a target register to an equivalent SEH register
+ /// number. Returns -1 if there is no equivalent value.
+ virtual int getSEHRegNum(unsigned i) const {
+ return i;
+ }
};
diff --git a/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td b/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td
index ff8d07d..672117f 100644
--- a/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td
+++ b/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td
@@ -354,6 +354,7 @@ def fmul : SDNode<"ISD::FMUL" , SDTFPBinOp, [SDNPCommutative]>;
def fdiv : SDNode<"ISD::FDIV" , SDTFPBinOp>;
def frem : SDNode<"ISD::FREM" , SDTFPBinOp>;
def fabs : SDNode<"ISD::FABS" , SDTFPUnaryOp>;
+def fgetsign : SDNode<"ISD::FGETSIGN" , SDTFPToIntOp>;
def fneg : SDNode<"ISD::FNEG" , SDTFPUnaryOp>;
def fsqrt : SDNode<"ISD::FSQRT" , SDTFPUnaryOp>;
def fsin : SDNode<"ISD::FSIN" , SDTFPUnaryOp>;
diff --git a/contrib/llvm/include/llvm/Transforms/Instrumentation.h b/contrib/llvm/include/llvm/Transforms/Instrumentation.h
index 088775a..8d55231 100644
--- a/contrib/llvm/include/llvm/Transforms/Instrumentation.h
+++ b/contrib/llvm/include/llvm/Transforms/Instrumentation.h
@@ -28,7 +28,8 @@ ModulePass *createOptimalEdgeProfilerPass();
ModulePass *createPathProfilerPass();
// Insert GCOV profiling instrumentation
-ModulePass *createGCOVProfilerPass(bool EmitNotes = true, bool EmitData = true);
+ModulePass *createGCOVProfilerPass(bool EmitNotes = true, bool EmitData = true,
+ bool Use402Format = false);
} // End llvm namespace
diff --git a/contrib/llvm/include/llvm/Transforms/Utils/Local.h b/contrib/llvm/include/llvm/Transforms/Utils/Local.h
index e61dcb3..7f99dbc 100644
--- a/contrib/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/contrib/llvm/include/llvm/Transforms/Utils/Local.h
@@ -43,8 +43,10 @@ template<typename T> class SmallVectorImpl;
/// constant value, convert it into an unconditional branch to the constant
/// destination. This is a nontrivial operation because the successors of this
/// basic block must have their PHI nodes updated.
-///
-bool ConstantFoldTerminator(BasicBlock *BB);
+/// Also calls RecursivelyDeleteTriviallyDeadInstructions() on any branch/switch
+/// conditions and indirectbr addresses this might make dead if
+/// DeleteDeadConditions is true.
+bool ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions = false);
//===----------------------------------------------------------------------===//
// Local dead code elimination.
@@ -176,6 +178,10 @@ bool ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
/// of llvm.dbg.value intrinsics.
bool LowerDbgDeclare(Function &F);
+/// FindAllocaDbgDeclare - Finds the llvm.dbg.declare intrinsic corresponding to
+/// an alloca, if any.
+DbgDeclareInst *FindAllocaDbgDeclare(Value *V);
+
} // End llvm namespace
#endif
diff --git a/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h b/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
index b4048b9..51c8467 100644
--- a/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
+++ b/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
@@ -21,6 +21,8 @@ namespace llvm {
class PHINode;
template<typename T> class SmallVectorImpl;
template<typename T> class SSAUpdaterTraits;
+ class DbgDeclareInst;
+ class DIBuilder;
class BumpPtrAllocator;
/// SSAUpdater - This class updates SSA form for a set of values defined in
@@ -120,9 +122,12 @@ private:
class LoadAndStorePromoter {
protected:
SSAUpdater &SSA;
+ DbgDeclareInst *DDI;
+ DIBuilder *DIB;
public:
LoadAndStorePromoter(const SmallVectorImpl<Instruction*> &Insts,
- SSAUpdater &S, StringRef Name = StringRef());
+ SSAUpdater &S, DbgDeclareInst *DDI, DIBuilder *DIB,
+ StringRef Name = StringRef());
virtual ~LoadAndStorePromoter() {}
/// run - This does the promotion. Insts is a list of loads and stores to
diff --git a/contrib/llvm/include/llvm/Type.h b/contrib/llvm/include/llvm/Type.h
index 0939d67..3bda91d 100644
--- a/contrib/llvm/include/llvm/Type.h
+++ b/contrib/llvm/include/llvm/Type.h
@@ -273,6 +273,9 @@ public:
/// @brief Determine if this type could be losslessly bitcast to Ty
bool canLosslesslyBitCastTo(const Type *Ty) const;
+ /// isEmptyTy - Return true if this type is empty, that is, it has no
+ /// elements or all its elements are empty.
+ bool isEmptyTy() const;
/// Here are some useful little methods to query what type derived types are
/// Note that all other types can just compare to see if this == Type::xxxTy;
diff --git a/contrib/llvm/lib/Analysis/Analysis.cpp b/contrib/llvm/lib/Analysis/Analysis.cpp
index 6ebe100..e57ba78 100644
--- a/contrib/llvm/lib/Analysis/Analysis.cpp
+++ b/contrib/llvm/lib/Analysis/Analysis.cpp
@@ -23,6 +23,7 @@ void llvm::initializeAnalysis(PassRegistry &Registry) {
initializeAliasSetPrinterPass(Registry);
initializeNoAAPass(Registry);
initializeBasicAliasAnalysisPass(Registry);
+ initializeBranchProbabilityInfoPass(Registry);
initializeCFGViewerPass(Registry);
initializeCFGPrinterPass(Registry);
initializeCFGOnlyViewerPass(Registry);
diff --git a/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index f1bb8a3..8330ea7 100644
--- a/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -281,17 +281,20 @@ DecomposeGEPExpression(const Value *V, int64_t &BaseOffs,
continue;
}
- if (const Instruction *I = dyn_cast<Instruction>(V))
- // TODO: Get a DominatorTree and use it here.
- if (const Value *Simplified =
- SimplifyInstruction(const_cast<Instruction *>(I), TD)) {
- V = Simplified;
- continue;
- }
-
const GEPOperator *GEPOp = dyn_cast<GEPOperator>(Op);
- if (GEPOp == 0)
+ if (GEPOp == 0) {
+ // If it's not a GEP, hand it off to SimplifyInstruction to see if it
+ // can come up with something. This matches what GetUnderlyingObject does.
+ if (const Instruction *I = dyn_cast<Instruction>(V))
+ // TODO: Get a DominatorTree and use it here.
+ if (const Value *Simplified =
+ SimplifyInstruction(const_cast<Instruction *>(I), TD)) {
+ V = Simplified;
+ continue;
+ }
+
return V;
+ }
// Don't attempt to analyze GEPs over unsized objects.
if (!cast<PointerType>(GEPOp->getOperand(0)->getType())
@@ -448,7 +451,13 @@ namespace {
/// BasicAliasAnalysis - This is the primary alias analysis implementation.
struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
static char ID; // Class identification, replacement for typeinfo
- BasicAliasAnalysis() : ImmutablePass(ID) {
+ BasicAliasAnalysis() : ImmutablePass(ID),
+ // AliasCache rarely has more than 1 or 2 elements,
+ // so start it off fairly small so that clear()
+ // doesn't have to tromp through 64 (the default)
+ // elements on each alias query. This really wants
+ // something like a SmallDenseMap.
+ AliasCache(8) {
initializeBasicAliasAnalysisPass(*PassRegistry::getPassRegistry());
}
@@ -462,12 +471,12 @@ namespace {
virtual AliasResult alias(const Location &LocA,
const Location &LocB) {
- assert(Visited.empty() && "Visited must be cleared after use!");
+ assert(AliasCache.empty() && "AliasCache must be cleared after use!");
assert(notDifferentParent(LocA.Ptr, LocB.Ptr) &&
"BasicAliasAnalysis doesn't support interprocedural queries.");
AliasResult Alias = aliasCheck(LocA.Ptr, LocA.Size, LocA.TBAATag,
LocB.Ptr, LocB.Size, LocB.TBAATag);
- Visited.clear();
+ AliasCache.clear();
return Alias;
}
@@ -503,7 +512,12 @@ namespace {
}
private:
- // Visited - Track instructions visited by a aliasPHI, aliasSelect(), and aliasGEP().
+ // AliasCache - Track alias queries to guard against recursion.
+ typedef std::pair<Location, Location> LocPair;
+ typedef DenseMap<LocPair, AliasResult> AliasCacheTy;
+ AliasCacheTy AliasCache;
+
+ // Visited - Track instructions visited by pointsToConstantMemory.
SmallPtrSet<const Value*, 16> Visited;
// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP
@@ -680,9 +694,12 @@ BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS,
unsigned ArgNo = 0;
for (ImmutableCallSite::arg_iterator CI = CS.arg_begin(), CE = CS.arg_end();
CI != CE; ++CI, ++ArgNo) {
- // Only look at the no-capture pointer arguments.
+ // Only look at the no-capture or byval pointer arguments. If this
+ // pointer were passed to arguments that were neither of these, then it
+ // couldn't be no-capture.
if (!(*CI)->getType()->isPointerTy() ||
- !CS.paramHasAttr(ArgNo+1, Attribute::NoCapture))
+ (!CS.paramHasAttr(ArgNo+1, Attribute::NoCapture) &&
+ !CS.paramHasAttr(ArgNo+1, Attribute::ByVal)))
continue;
// If this is a no-capture pointer argument, see if we can tell that it
@@ -816,13 +833,6 @@ BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
const MDNode *V2TBAAInfo,
const Value *UnderlyingV1,
const Value *UnderlyingV2) {
- // If this GEP has been visited before, we're on a use-def cycle.
- // Such cycles are only valid when PHI nodes are involved or in unreachable
- // code. The visitPHI function catches cycles containing PHIs, but there
- // could still be a cycle without PHIs in unreachable code.
- if (!Visited.insert(GEP1))
- return MayAlias;
-
int64_t GEP1BaseOffset;
SmallVector<VariableGEPIndex, 4> GEP1VariableIndices;
@@ -940,7 +950,30 @@ BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
return NoAlias;
}
- return MayAlias;
+ // Statically, we can see that the base objects are the same, but the
+ // pointers have dynamic offsets which we can't resolve. And none of our
+ // little tricks above worked.
+ //
+ // TODO: Returning PartialAlias instead of MayAlias is a mild hack; the
+ // practical effect of this is protecting TBAA in the case of dynamic
+ // indices into arrays of unions. An alternative way to solve this would
+ // be to have clang emit extra metadata for unions and/or union accesses.
+ // A union-specific solution wouldn't handle the problem for malloc'd
+ // memory however.
+ return PartialAlias;
+}
+
+static AliasAnalysis::AliasResult
+MergeAliasResults(AliasAnalysis::AliasResult A, AliasAnalysis::AliasResult B) {
+ // If the results agree, take it.
+ if (A == B)
+ return A;
+ // A mix of PartialAlias and MustAlias is PartialAlias.
+ if ((A == AliasAnalysis::PartialAlias && B == AliasAnalysis::MustAlias) ||
+ (B == AliasAnalysis::PartialAlias && A == AliasAnalysis::MustAlias))
+ return AliasAnalysis::PartialAlias;
+ // Otherwise, we don't know anything.
+ return AliasAnalysis::MayAlias;
}
/// aliasSelect - Provide a bunch of ad-hoc rules to disambiguate a Select
@@ -950,13 +983,6 @@ BasicAliasAnalysis::aliasSelect(const SelectInst *SI, uint64_t SISize,
const MDNode *SITBAAInfo,
const Value *V2, uint64_t V2Size,
const MDNode *V2TBAAInfo) {
- // If this select has been visited before, we're on a use-def cycle.
- // Such cycles are only valid when PHI nodes are involved or in unreachable
- // code. The visitPHI function catches cycles containing PHIs, but there
- // could still be a cycle without PHIs in unreachable code.
- if (!Visited.insert(SI))
- return MayAlias;
-
// If the values are Selects with the same condition, we can do a more precise
// check: just check for aliases between the values on corresponding arms.
if (const SelectInst *SI2 = dyn_cast<SelectInst>(V2))
@@ -969,9 +995,7 @@ BasicAliasAnalysis::aliasSelect(const SelectInst *SI, uint64_t SISize,
AliasResult ThisAlias =
aliasCheck(SI->getFalseValue(), SISize, SITBAAInfo,
SI2->getFalseValue(), V2Size, V2TBAAInfo);
- if (ThisAlias != Alias)
- return MayAlias;
- return Alias;
+ return MergeAliasResults(ThisAlias, Alias);
}
// If both arms of the Select node NoAlias or MustAlias V2, then returns
@@ -981,16 +1005,9 @@ BasicAliasAnalysis::aliasSelect(const SelectInst *SI, uint64_t SISize,
if (Alias == MayAlias)
return MayAlias;
- // If V2 is visited, the recursive case will have been caught in the
- // above aliasCheck call, so these subsequent calls to aliasCheck
- // don't need to assume that V2 is being visited recursively.
- Visited.erase(V2);
-
AliasResult ThisAlias =
aliasCheck(V2, V2Size, V2TBAAInfo, SI->getFalseValue(), SISize, SITBAAInfo);
- if (ThisAlias != Alias)
- return MayAlias;
- return Alias;
+ return MergeAliasResults(ThisAlias, Alias);
}
// aliasPHI - Provide a bunch of ad-hoc rules to disambiguate a PHI instruction
@@ -1000,10 +1017,6 @@ BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize,
const MDNode *PNTBAAInfo,
const Value *V2, uint64_t V2Size,
const MDNode *V2TBAAInfo) {
- // The PHI node has already been visited, avoid recursion any further.
- if (!Visited.insert(PN))
- return MayAlias;
-
// If the values are PHIs in the same block, we can do a more precise
// as well as efficient check: just check for aliases between the values
// on corresponding edges.
@@ -1020,8 +1033,9 @@ BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize,
aliasCheck(PN->getIncomingValue(i), PNSize, PNTBAAInfo,
PN2->getIncomingValueForBlock(PN->getIncomingBlock(i)),
V2Size, V2TBAAInfo);
- if (ThisAlias != Alias)
- return MayAlias;
+ Alias = MergeAliasResults(ThisAlias, Alias);
+ if (Alias == MayAlias)
+ break;
}
return Alias;
}
@@ -1052,15 +1066,11 @@ BasicAliasAnalysis::aliasPHI(const PHINode *PN, uint64_t PNSize,
for (unsigned i = 1, e = V1Srcs.size(); i != e; ++i) {
Value *V = V1Srcs[i];
- // If V2 is visited, the recursive case will have been caught in the
- // above aliasCheck call, so these subsequent calls to aliasCheck
- // don't need to assume that V2 is being visited recursively.
- Visited.erase(V2);
-
AliasResult ThisAlias = aliasCheck(V2, V2Size, V2TBAAInfo,
V, PNSize, PNTBAAInfo);
- if (ThisAlias != Alias || ThisAlias == MayAlias)
- return MayAlias;
+ Alias = MergeAliasResults(ThisAlias, Alias);
+ if (Alias == MayAlias)
+ break;
}
return Alias;
@@ -1145,6 +1155,17 @@ BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
(V2Size != UnknownSize && isObjectSmallerThan(O1, V2Size, *TD)))
return NoAlias;
+ // Check the cache before climbing up use-def chains. This also terminates
+ // otherwise infinitely recursive queries.
+ LocPair Locs(Location(V1, V1Size, V1TBAAInfo),
+ Location(V2, V2Size, V2TBAAInfo));
+ if (V1 > V2)
+ std::swap(Locs.first, Locs.second);
+ std::pair<AliasCacheTy::iterator, bool> Pair =
+ AliasCache.insert(std::make_pair(Locs, MayAlias));
+ if (!Pair.second)
+ return Pair.first->second;
+
// FIXME: This isn't aggressively handling alias(GEP, PHI) for example: if the
// GEP can't simplify, we don't even look at the PHI cases.
if (!isa<GEPOperator>(V1) && isa<GEPOperator>(V2)) {
@@ -1154,7 +1175,7 @@ BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
}
if (const GEPOperator *GV1 = dyn_cast<GEPOperator>(V1)) {
AliasResult Result = aliasGEP(GV1, V1Size, V2, V2Size, V2TBAAInfo, O1, O2);
- if (Result != MayAlias) return Result;
+ if (Result != MayAlias) return AliasCache[Locs] = Result;
}
if (isa<PHINode>(V2) && !isa<PHINode>(V1)) {
@@ -1164,7 +1185,7 @@ BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
if (const PHINode *PN = dyn_cast<PHINode>(V1)) {
AliasResult Result = aliasPHI(PN, V1Size, V1TBAAInfo,
V2, V2Size, V2TBAAInfo);
- if (Result != MayAlias) return Result;
+ if (Result != MayAlias) return AliasCache[Locs] = Result;
}
if (isa<SelectInst>(V2) && !isa<SelectInst>(V1)) {
@@ -1174,7 +1195,7 @@ BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
if (const SelectInst *S1 = dyn_cast<SelectInst>(V1)) {
AliasResult Result = aliasSelect(S1, V1Size, V1TBAAInfo,
V2, V2Size, V2TBAAInfo);
- if (Result != MayAlias) return Result;
+ if (Result != MayAlias) return AliasCache[Locs] = Result;
}
// If both pointers are pointing into the same object and one of them
@@ -1183,8 +1204,10 @@ BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
if (TD && O1 == O2)
if ((V1Size != UnknownSize && isObjectSize(O1, V1Size, *TD)) ||
(V2Size != UnknownSize && isObjectSize(O2, V2Size, *TD)))
- return PartialAlias;
+ return AliasCache[Locs] = PartialAlias;
- return AliasAnalysis::alias(Location(V1, V1Size, V1TBAAInfo),
- Location(V2, V2Size, V2TBAAInfo));
+ AliasResult Result =
+ AliasAnalysis::alias(Location(V1, V1Size, V1TBAAInfo),
+ Location(V2, V2Size, V2TBAAInfo));
+ return AliasCache[Locs] = Result;
}
diff --git a/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp
new file mode 100644
index 0000000..812fac0
--- /dev/null
+++ b/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -0,0 +1,357 @@
+//===-- BranchProbabilityInfo.cpp - Branch Probability Analysis -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Loops should be simplified before this analysis.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Instructions.h"
+#include "llvm/Analysis/BranchProbabilityInfo.h"
+#include "llvm/Support/Debug.h"
+
+using namespace llvm;
+
+INITIALIZE_PASS_BEGIN(BranchProbabilityInfo, "branch-prob",
+ "Branch Probability Analysis", false, true)
+INITIALIZE_PASS_DEPENDENCY(LoopInfo)
+INITIALIZE_PASS_END(BranchProbabilityInfo, "branch-prob",
+ "Branch Probability Analysis", false, true)
+
+char BranchProbabilityInfo::ID = 0;
+
+
+// Please note that BranchProbabilityAnalysis is not a FunctionPass.
+// It is created by BranchProbabilityInfo (which is a FunctionPass), which
+// provides a clear interface. Thanks to that, all heuristics and other
+// private methods are hidden in the .cpp file.
+class BranchProbabilityAnalysis {
+
+ typedef std::pair<BasicBlock *, BasicBlock *> Edge;
+
+ DenseMap<Edge, uint32_t> *Weights;
+
+ BranchProbabilityInfo *BP;
+
+ LoopInfo *LI;
+
+
+ // Weights are for internal use only. They are used by heuristics to help to
+ // estimate edges' probability. Example:
+ //
+ // Using "Loop Branch Heuristics" we predict weights of edges for the
+ // block BB2.
+ // ...
+ // |
+ // V
+ // BB1<-+
+ // | |
+ // | | (Weight = 128)
+ // V |
+ // BB2--+
+ // |
+ // | (Weight = 4)
+ // V
+ // BB3
+ //
+ // Probability of the edge BB2->BB1 = 128 / (128 + 4) = 0.9696..
+ // Probability of the edge BB2->BB3 = 4 / (128 + 4) = 0.0303..
+
+ static const uint32_t LBH_TAKEN_WEIGHT = 128;
+ static const uint32_t LBH_NONTAKEN_WEIGHT = 4;
+
+ // Standard weight value. Used when none of the heuristics set weight for
+ // the edge.
+ static const uint32_t NORMAL_WEIGHT = 16;
+
+ // Minimum weight of an edge. Please note, that weight is NEVER 0.
+ static const uint32_t MIN_WEIGHT = 1;
+
+ // Return TRUE if BB leads directly to a Return Instruction.
+ static bool isReturningBlock(BasicBlock *BB) {
+ SmallPtrSet<BasicBlock *, 8> Visited;
+
+ while (true) {
+ TerminatorInst *TI = BB->getTerminator();
+ if (isa<ReturnInst>(TI))
+ return true;
+
+ if (TI->getNumSuccessors() > 1)
+ break;
+
+ // It is unreachable block which we can consider as a return instruction.
+ if (TI->getNumSuccessors() == 0)
+ return true;
+
+ Visited.insert(BB);
+ BB = TI->getSuccessor(0);
+
+ // Stop if cycle is detected.
+ if (Visited.count(BB))
+ return false;
+ }
+
+ return false;
+ }
+
+ // Multiply Edge Weight by two.
+ void incEdgeWeight(BasicBlock *Src, BasicBlock *Dst) {
+ uint32_t Weight = BP->getEdgeWeight(Src, Dst);
+ uint32_t MaxWeight = getMaxWeightFor(Src);
+
+ if (Weight * 2 > MaxWeight)
+ BP->setEdgeWeight(Src, Dst, MaxWeight);
+ else
+ BP->setEdgeWeight(Src, Dst, Weight * 2);
+ }
+
+ // Divide Edge Weight by two.
+ void decEdgeWeight(BasicBlock *Src, BasicBlock *Dst) {
+ uint32_t Weight = BP->getEdgeWeight(Src, Dst);
+
+ assert(Weight > 0);
+ if (Weight / 2 < MIN_WEIGHT)
+ BP->setEdgeWeight(Src, Dst, MIN_WEIGHT);
+ else
+ BP->setEdgeWeight(Src, Dst, Weight / 2);
+ }
+
+
+ uint32_t getMaxWeightFor(BasicBlock *BB) const {
+ return UINT32_MAX / BB->getTerminator()->getNumSuccessors();
+ }
+
+public:
+ BranchProbabilityAnalysis(DenseMap<Edge, uint32_t> *W,
+ BranchProbabilityInfo *BP, LoopInfo *LI)
+ : Weights(W), BP(BP), LI(LI) {
+ }
+
+ // Return Heuristics
+ void calcReturnHeuristics(BasicBlock *BB);
+
+ // Pointer Heuristics
+ void calcPointerHeuristics(BasicBlock *BB);
+
+ // Loop Branch Heuristics
+ void calcLoopBranchHeuristics(BasicBlock *BB);
+
+ bool runOnFunction(Function &F);
+};
+
+// Calculate Edge Weights using "Return Heuristics". Predict a successor which
+// leads directly to Return Instruction will not be taken.
+void BranchProbabilityAnalysis::calcReturnHeuristics(BasicBlock *BB){
+ if (BB->getTerminator()->getNumSuccessors() == 1)
+ return;
+
+ for (succ_iterator I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {
+ BasicBlock *Succ = *I;
+ if (isReturningBlock(Succ)) {
+ decEdgeWeight(BB, Succ);
+ }
+ }
+}
+
+// Calculate Edge Weights using "Pointer Heuristics". Predict a comparsion
+// between two pointer or pointer and NULL will fail.
+void BranchProbabilityAnalysis::calcPointerHeuristics(BasicBlock *BB) {
+ BranchInst * BI = dyn_cast<BranchInst>(BB->getTerminator());
+ if (!BI || !BI->isConditional())
+ return;
+
+ Value *Cond = BI->getCondition();
+ ICmpInst *CI = dyn_cast<ICmpInst>(Cond);
+ if (!CI)
+ return;
+
+ Value *LHS = CI->getOperand(0);
+
+ if (!LHS->getType()->isPointerTy())
+ return;
+
+ assert(CI->getOperand(1)->getType()->isPointerTy());
+
+ BasicBlock *Taken = BI->getSuccessor(0);
+ BasicBlock *NonTaken = BI->getSuccessor(1);
+
+ // p != 0 -> isProb = true
+ // p == 0 -> isProb = false
+ // p != q -> isProb = true
+ // p == q -> isProb = false;
+ bool isProb = !CI->isEquality();
+ if (!isProb)
+ std::swap(Taken, NonTaken);
+
+ incEdgeWeight(BB, Taken);
+ decEdgeWeight(BB, NonTaken);
+}
+
+// Calculate Edge Weights using "Loop Branch Heuristics". Predict backedges
+// as taken, exiting edges as not-taken.
+void BranchProbabilityAnalysis::calcLoopBranchHeuristics(BasicBlock *BB) {
+ uint32_t numSuccs = BB->getTerminator()->getNumSuccessors();
+
+ Loop *L = LI->getLoopFor(BB);
+ if (!L)
+ return;
+
+ SmallVector<BasicBlock *, 8> BackEdges;
+ SmallVector<BasicBlock *, 8> ExitingEdges;
+
+ for (succ_iterator I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {
+ BasicBlock *Succ = *I;
+ Loop *SuccL = LI->getLoopFor(Succ);
+ if (SuccL != L)
+ ExitingEdges.push_back(Succ);
+ else if (Succ == L->getHeader())
+ BackEdges.push_back(Succ);
+ }
+
+ if (uint32_t numBackEdges = BackEdges.size()) {
+ uint32_t backWeight = LBH_TAKEN_WEIGHT / numBackEdges;
+ if (backWeight < NORMAL_WEIGHT)
+ backWeight = NORMAL_WEIGHT;
+
+ for (SmallVector<BasicBlock *, 8>::iterator EI = BackEdges.begin(),
+ EE = BackEdges.end(); EI != EE; ++EI) {
+ BasicBlock *Back = *EI;
+ BP->setEdgeWeight(BB, Back, backWeight);
+ }
+ }
+
+ uint32_t numExitingEdges = ExitingEdges.size();
+ if (uint32_t numNonExitingEdges = numSuccs - numExitingEdges) {
+ uint32_t exitWeight = LBH_NONTAKEN_WEIGHT / numNonExitingEdges;
+ if (exitWeight < MIN_WEIGHT)
+ exitWeight = MIN_WEIGHT;
+
+ for (SmallVector<BasicBlock *, 8>::iterator EI = ExitingEdges.begin(),
+ EE = ExitingEdges.end(); EI != EE; ++EI) {
+ BasicBlock *Exiting = *EI;
+ BP->setEdgeWeight(BB, Exiting, exitWeight);
+ }
+ }
+}
+
+bool BranchProbabilityAnalysis::runOnFunction(Function &F) {
+
+ for (Function::iterator I = F.begin(), E = F.end(); I != E; ) {
+ BasicBlock *BB = I++;
+
+ // Only LBH uses setEdgeWeight method.
+ calcLoopBranchHeuristics(BB);
+
+ // PH and RH use only incEdgeWeight and decEwdgeWeight methods to
+ // not efface LBH results.
+ calcPointerHeuristics(BB);
+ calcReturnHeuristics(BB);
+ }
+
+ return false;
+}
+
+
+bool BranchProbabilityInfo::runOnFunction(Function &F) {
+ LoopInfo &LI = getAnalysis<LoopInfo>();
+ BranchProbabilityAnalysis BPA(&Weights, this, &LI);
+ return BPA.runOnFunction(F);
+}
+
+uint32_t BranchProbabilityInfo::getSumForBlock(BasicBlock *BB) const {
+ uint32_t Sum = 0;
+
+ for (succ_iterator I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {
+ BasicBlock *Succ = *I;
+ uint32_t Weight = getEdgeWeight(BB, Succ);
+ uint32_t PrevSum = Sum;
+
+ Sum += Weight;
+ assert(Sum > PrevSum); (void) PrevSum;
+ }
+
+ return Sum;
+}
+
+bool BranchProbabilityInfo::isEdgeHot(BasicBlock *Src, BasicBlock *Dst) const {
+ // Hot probability is at least 4/5 = 80%
+ uint32_t Weight = getEdgeWeight(Src, Dst);
+ uint32_t Sum = getSumForBlock(Src);
+
+ // FIXME: Implement BranchProbability::compare then change this code to
+ // compare this BranchProbability against a static "hot" BranchProbability.
+ return (uint64_t)Weight * 5 > (uint64_t)Sum * 4;
+}
+
+BasicBlock *BranchProbabilityInfo::getHotSucc(BasicBlock *BB) const {
+ uint32_t Sum = 0;
+ uint32_t MaxWeight = 0;
+ BasicBlock *MaxSucc = 0;
+
+ for (succ_iterator I = succ_begin(BB), E = succ_end(BB); I != E; ++I) {
+ BasicBlock *Succ = *I;
+ uint32_t Weight = getEdgeWeight(BB, Succ);
+ uint32_t PrevSum = Sum;
+
+ Sum += Weight;
+ assert(Sum > PrevSum); (void) PrevSum;
+
+ if (Weight > MaxWeight) {
+ MaxWeight = Weight;
+ MaxSucc = Succ;
+ }
+ }
+
+ // FIXME: Use BranchProbability::compare.
+ if ((uint64_t)MaxWeight * 5 > (uint64_t)Sum * 4)
+ return MaxSucc;
+
+ return 0;
+}
+
+// Return edge's weight. If can't find it, return DEFAULT_WEIGHT value.
+uint32_t
+BranchProbabilityInfo::getEdgeWeight(BasicBlock *Src, BasicBlock *Dst) const {
+ Edge E(Src, Dst);
+ DenseMap<Edge, uint32_t>::const_iterator I = Weights.find(E);
+
+ if (I != Weights.end())
+ return I->second;
+
+ return DEFAULT_WEIGHT;
+}
+
+void BranchProbabilityInfo::setEdgeWeight(BasicBlock *Src, BasicBlock *Dst,
+ uint32_t Weight) {
+ Weights[std::make_pair(Src, Dst)] = Weight;
+ DEBUG(dbgs() << "set edge " << Src->getNameStr() << " -> "
+ << Dst->getNameStr() << " weight to " << Weight
+ << (isEdgeHot(Src, Dst) ? " [is HOT now]\n" : "\n"));
+}
+
+
+BranchProbability BranchProbabilityInfo::
+getEdgeProbability(BasicBlock *Src, BasicBlock *Dst) const {
+
+ uint32_t N = getEdgeWeight(Src, Dst);
+ uint32_t D = getSumForBlock(Src);
+
+ return BranchProbability(N, D);
+}
+
+raw_ostream &
+BranchProbabilityInfo::printEdgeProbability(raw_ostream &OS, BasicBlock *Src,
+ BasicBlock *Dst) const {
+ BranchProbability Prob = getEdgeProbability(Src, Dst);
+
+ OS << "edge " << Src->getNameStr() << " -> " << Dst->getNameStr()
+ << " probability is " << Prob
+ << (isEdgeHot(Src, Dst) ? " [HOT edge]\n" : "\n");
+
+ return OS;
+}
diff --git a/contrib/llvm/lib/Analysis/ConstantFolding.cpp b/contrib/llvm/lib/Analysis/ConstantFolding.cpp
index 5de2b04..08a6065 100644
--- a/contrib/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/contrib/llvm/lib/Analysis/ConstantFolding.cpp
@@ -1085,7 +1085,7 @@ llvm::canConstantFoldCallTo(const Function *F) {
case 'c':
return Name == "cos" || Name == "ceil" || Name == "cosf" || Name == "cosh";
case 'e':
- return Name == "exp";
+ return Name == "exp" || Name == "exp2";
case 'f':
return Name == "fabs" || Name == "fmod" || Name == "floor";
case 'l':
@@ -1221,6 +1221,12 @@ llvm::ConstantFoldCall(Function *F,
case 'e':
if (Name == "exp")
return ConstantFoldFP(exp, V, Ty);
+
+ if (Name == "exp2") {
+ // Constant fold exp2(x) as pow(2,x) in case the host doesn't have a
+ // C99 library.
+ return ConstantFoldBinaryFP(pow, 2.0, V, Ty);
+ }
break;
case 'f':
if (Name == "fabs")
diff --git a/contrib/llvm/lib/Analysis/DIBuilder.cpp b/contrib/llvm/lib/Analysis/DIBuilder.cpp
index dc98c9e..ef5d03a 100644
--- a/contrib/llvm/lib/Analysis/DIBuilder.cpp
+++ b/contrib/llvm/lib/Analysis/DIBuilder.cpp
@@ -51,6 +51,10 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer)
};
TheCU = DICompileUnit(MDNode::get(VMContext, Elts));
+
+ // Create a named metadata so that it is easier to find cu in a module.
+ NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
+ NMD->addOperand(TheCU);
}
/// createFile - Create a file descriptor to hold debugging information
@@ -156,12 +160,12 @@ DIType DIBuilder::createReferenceType(DIType RTy) {
/// createTypedef - Create debugging information entry for a typedef.
DIType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File,
- unsigned LineNo) {
+ unsigned LineNo, DIDescriptor Context) {
// typedefs are encoded in DIDerivedType format.
assert(Ty.Verify() && "Invalid typedef type!");
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_typedef),
- Ty.getContext(),
+ Context,
MDString::get(VMContext, Name),
File,
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
diff --git a/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp b/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp
index 690c4b4..2e79eab 100644
--- a/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -148,7 +148,7 @@ private:
for (BasicBlock::iterator II = BB->begin(), IE = BB->end();
II != IE; ++II) {
CallSite CS(cast<Value>(II));
- if (CS && !isa<DbgInfoIntrinsic>(II)) {
+ if (CS && !isa<IntrinsicInst>(II)) {
const Function *Callee = CS.getCalledFunction();
if (Callee)
Node->addCalledFunction(CS, getOrInsertFunction(Callee));
diff --git a/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
index 725ab72..659ffab 100644
--- a/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -245,8 +245,8 @@ bool CGPassManager::RefreshCallGraph(CallGraphSCC &CurSCC,
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
- CallSite CS(cast<Value>(I));
- if (!CS || isa<DbgInfoIntrinsic>(I)) continue;
+ CallSite CS(cast<Value>(I));
+ if (!CS || isa<IntrinsicInst>(I)) continue;
// If this call site already existed in the callgraph, just verify it
// matches up to expectations and remove it from CallSites.
diff --git a/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp b/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
index 06ae34c..dde2556 100644
--- a/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -32,7 +32,7 @@ INITIALIZE_PASS(FindUsedTypes, "print-used-types",
void FindUsedTypes::IncorporateType(const Type *Ty) {
// If ty doesn't already exist in the used types map, add it now, otherwise
// return.
- if (!UsedTypes.insert(Ty).second) return; // Already contain Ty.
+ if (!UsedTypes.insert(Ty)) return; // Already contain Ty.
// Make sure to add any types this type references now.
//
@@ -94,7 +94,7 @@ bool FindUsedTypes::runOnModule(Module &m) {
//
void FindUsedTypes::print(raw_ostream &OS, const Module *M) const {
OS << "Types in use by this module:\n";
- for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
+ for (SetVector<const Type *>::const_iterator I = UsedTypes.begin(),
E = UsedTypes.end(); I != E; ++I) {
OS << " ";
WriteTypeSymbolic(OS, *I, M);
diff --git a/contrib/llvm/lib/Analysis/IVUsers.cpp b/contrib/llvm/lib/Analysis/IVUsers.cpp
index 2cda791..a0c42f0 100644
--- a/contrib/llvm/lib/Analysis/IVUsers.cpp
+++ b/contrib/llvm/lib/Analysis/IVUsers.cpp
@@ -21,6 +21,7 @@
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/ADT/STLExtras.h"
@@ -38,6 +39,15 @@ INITIALIZE_PASS_DEPENDENCY(ScalarEvolution)
INITIALIZE_PASS_END(IVUsers, "iv-users",
"Induction Variable Users", false, true)
+// IVUsers behavior currently depends on this temporary indvars mode. The
+// option must be defined upstream from its uses.
+namespace llvm {
+ bool DisableIVRewrite = false;
+}
+cl::opt<bool, true> DisableIVRewriteOpt(
+ "disable-iv-rewrite", cl::Hidden, cl::location(llvm::DisableIVRewrite),
+ cl::desc("Disable canonical induction variable rewriting"));
+
Pass *llvm::createIVUsersPass() {
return new IVUsers();
}
@@ -79,7 +89,7 @@ static bool isInteresting(const SCEV *S, const Instruction *I, const Loop *L,
/// AddUsersIfInteresting - Inspect the specified instruction. If it is a
/// reducible SCEV, recursively add its users to the IVUsesByStride set and
/// return true. Otherwise, return false.
-bool IVUsers::AddUsersIfInteresting(Instruction *I) {
+bool IVUsers::AddUsersIfInteresting(Instruction *I, PHINode *Phi) {
if (!SE->isSCEVable(I->getType()))
return false; // Void and FP expressions cannot be reduced.
@@ -90,6 +100,11 @@ bool IVUsers::AddUsersIfInteresting(Instruction *I) {
if (Width > 64 || (TD && !TD->isLegalInteger(Width)))
return false;
+ // We expect Sign/Zero extension to be eliminated from the IR before analyzing
+ // any downstream uses.
+ if (DisableIVRewrite && (isa<SExtInst>(I) || isa<ZExtInst>(I)))
+ return false;
+
if (!Processed.insert(I))
return true; // Instruction already handled.
@@ -121,13 +136,13 @@ bool IVUsers::AddUsersIfInteresting(Instruction *I) {
bool AddUserToIVUsers = false;
if (LI->getLoopFor(User->getParent()) != L) {
if (isa<PHINode>(User) || Processed.count(User) ||
- !AddUsersIfInteresting(User)) {
+ !AddUsersIfInteresting(User, Phi)) {
DEBUG(dbgs() << "FOUND USER in other loop: " << *User << '\n'
<< " OF SCEV: " << *ISE << '\n');
AddUserToIVUsers = true;
}
} else if (Processed.count(User) ||
- !AddUsersIfInteresting(User)) {
+ !AddUsersIfInteresting(User, Phi)) {
DEBUG(dbgs() << "FOUND USER: " << *User << '\n'
<< " OF SCEV: " << *ISE << '\n');
AddUserToIVUsers = true;
@@ -135,9 +150,11 @@ bool IVUsers::AddUsersIfInteresting(Instruction *I) {
if (AddUserToIVUsers) {
// Okay, we found a user that we cannot reduce.
- IVUses.push_back(new IVStrideUse(this, User, I));
+ IVUses.push_back(new IVStrideUse(this, User, I, Phi));
IVStrideUse &NewUse = IVUses.back();
- // Transform the expression into a normalized form.
+ // Autodetect the post-inc loop set, populating NewUse.PostIncLoops.
+ // The regular return value here is discarded; instead of recording
+ // it, we just recompute it when we need it.
ISE = TransformForPostIncUse(NormalizeAutodetect,
ISE, User, I,
NewUse.PostIncLoops,
@@ -148,8 +165,8 @@ bool IVUsers::AddUsersIfInteresting(Instruction *I) {
return true;
}
-IVStrideUse &IVUsers::AddUser(Instruction *User, Value *Operand) {
- IVUses.push_back(new IVStrideUse(this, User, Operand));
+IVStrideUse &IVUsers::AddUser(Instruction *User, Value *Operand, PHINode *Phi) {
+ IVUses.push_back(new IVStrideUse(this, User, Operand, Phi));
return IVUses.back();
}
@@ -177,7 +194,7 @@ bool IVUsers::runOnLoop(Loop *l, LPPassManager &LPM) {
// them by stride. Start by finding all of the PHI nodes in the header for
// this loop. If they are induction variables, inspect their uses.
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ++I)
- (void)AddUsersIfInteresting(I);
+ (void)AddUsersIfInteresting(I, cast<PHINode>(I));
return false;
}
diff --git a/contrib/llvm/lib/Analysis/InlineCost.cpp b/contrib/llvm/lib/Analysis/InlineCost.cpp
index a820ecf..efde598 100644
--- a/contrib/llvm/lib/Analysis/InlineCost.cpp
+++ b/contrib/llvm/lib/Analysis/InlineCost.cpp
@@ -66,21 +66,13 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) {
ImmutableCallSite CS(cast<Instruction>(II));
- // If this function contains a call to setjmp or _setjmp, never inline
- // it. This is a hack because we depend on the user marking their local
- // variables as volatile if they are live across a setjmp call, and they
- // probably won't do this in callers.
if (const Function *F = CS.getCalledFunction()) {
// If a function is both internal and has a single use, then it is
// extremely likely to get inlined in the future (it was probably
// exposed by an interleaved devirtualization pass).
if (F->hasInternalLinkage() && F->hasOneUse())
++NumInlineCandidates;
-
- if (F->isDeclaration() &&
- (F->getName() == "setjmp" || F->getName() == "_setjmp"))
- callsSetJmp = true;
-
+
// If this call is to function itself, then the function is recursive.
// Inlining it into other functions is a bad idea, because this is
// basically just a form of loop peeling, and our metrics aren't useful
@@ -226,6 +218,13 @@ unsigned CodeMetrics::CountCodeReductionForAlloca(Value *V) {
/// analyzeFunction - Fill in the current structure with information gleaned
/// from the specified function.
void CodeMetrics::analyzeFunction(Function *F) {
+ // If this function contains a call to setjmp or _setjmp, never inline
+ // it. This is a hack because we depend on the user marking their local
+ // variables as volatile if they are live across a setjmp call, and they
+ // probably won't do this in callers.
+ if (F->callsFunctionThatReturnsTwice())
+ callsSetJmp = true;
+
// Look at the size of the callee.
for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
analyzeBasicBlock(&*BB);
@@ -594,7 +593,7 @@ InlineCostAnalyzer::growCachedCostInfo(Function *Caller, Function *Callee) {
CodeMetrics &CallerMetrics = CachedFunctionInfo[Caller].Metrics;
// For small functions we prefer to recalculate the cost for better accuracy.
- if (CallerMetrics.NumBlocks < 10 || CallerMetrics.NumInsts < 1000) {
+ if (CallerMetrics.NumBlocks < 10 && CallerMetrics.NumInsts < 1000) {
resetCachedCostInfo(Caller);
return;
}
diff --git a/contrib/llvm/lib/Analysis/InstructionSimplify.cpp b/contrib/llvm/lib/Analysis/InstructionSimplify.cpp
index 9d6d339..9d78f8b 100644
--- a/contrib/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/contrib/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -913,8 +913,6 @@ static Value *SimplifyRem(Instruction::BinaryOps Opcode, Value *Op0, Value *Op1,
}
}
- bool isSigned = Opcode == Instruction::SRem;
-
// X % undef -> undef
if (match(Op1, m_Undef()))
return Op1;
@@ -1378,6 +1376,26 @@ static const Type *GetCompareTy(Value *Op) {
return CmpInst::makeCmpResultType(Op->getType());
}
+/// ExtractEquivalentCondition - Rummage around inside V looking for something
+/// equivalent to the comparison "LHS Pred RHS". Return such a value if found,
+/// otherwise return null. Helper function for analyzing max/min idioms.
+static Value *ExtractEquivalentCondition(Value *V, CmpInst::Predicate Pred,
+ Value *LHS, Value *RHS) {
+ SelectInst *SI = dyn_cast<SelectInst>(V);
+ if (!SI)
+ return 0;
+ CmpInst *Cmp = dyn_cast<CmpInst>(SI->getCondition());
+ if (!Cmp)
+ return 0;
+ Value *CmpLHS = Cmp->getOperand(0), *CmpRHS = Cmp->getOperand(1);
+ if (Pred == Cmp->getPredicate() && LHS == CmpLHS && RHS == CmpRHS)
+ return Cmp;
+ if (Pred == CmpInst::getSwappedPredicate(Cmp->getPredicate()) &&
+ LHS == CmpRHS && RHS == CmpLHS)
+ return Cmp;
+ return 0;
+}
+
/// SimplifyICmpInst - Given operands for an ICmpInst, see if we can
/// fold the result. If not, this returns null.
static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
@@ -1460,46 +1478,48 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
default:
assert(false && "Unknown ICmp predicate!");
case ICmpInst::ICMP_ULT:
- return ConstantInt::getFalse(LHS->getContext());
+ // getNullValue also works for vectors, unlike getFalse.
+ return Constant::getNullValue(ITy);
case ICmpInst::ICMP_UGE:
- return ConstantInt::getTrue(LHS->getContext());
+ // getAllOnesValue also works for vectors, unlike getTrue.
+ return ConstantInt::getAllOnesValue(ITy);
case ICmpInst::ICMP_EQ:
case ICmpInst::ICMP_ULE:
if (isKnownNonZero(LHS, TD))
- return ConstantInt::getFalse(LHS->getContext());
+ return Constant::getNullValue(ITy);
break;
case ICmpInst::ICMP_NE:
case ICmpInst::ICMP_UGT:
if (isKnownNonZero(LHS, TD))
- return ConstantInt::getTrue(LHS->getContext());
+ return ConstantInt::getAllOnesValue(ITy);
break;
case ICmpInst::ICMP_SLT:
ComputeSignBit(LHS, LHSKnownNonNegative, LHSKnownNegative, TD);
if (LHSKnownNegative)
- return ConstantInt::getTrue(LHS->getContext());
+ return ConstantInt::getAllOnesValue(ITy);
if (LHSKnownNonNegative)
- return ConstantInt::getFalse(LHS->getContext());
+ return Constant::getNullValue(ITy);
break;
case ICmpInst::ICMP_SLE:
ComputeSignBit(LHS, LHSKnownNonNegative, LHSKnownNegative, TD);
if (LHSKnownNegative)
- return ConstantInt::getTrue(LHS->getContext());
+ return ConstantInt::getAllOnesValue(ITy);
if (LHSKnownNonNegative && isKnownNonZero(LHS, TD))
- return ConstantInt::getFalse(LHS->getContext());
+ return Constant::getNullValue(ITy);
break;
case ICmpInst::ICMP_SGE:
ComputeSignBit(LHS, LHSKnownNonNegative, LHSKnownNegative, TD);
if (LHSKnownNegative)
- return ConstantInt::getFalse(LHS->getContext());
+ return Constant::getNullValue(ITy);
if (LHSKnownNonNegative)
- return ConstantInt::getTrue(LHS->getContext());
+ return ConstantInt::getAllOnesValue(ITy);
break;
case ICmpInst::ICMP_SGT:
ComputeSignBit(LHS, LHSKnownNonNegative, LHSKnownNegative, TD);
if (LHSKnownNegative)
- return ConstantInt::getFalse(LHS->getContext());
+ return Constant::getNullValue(ITy);
if (LHSKnownNonNegative && isKnownNonZero(LHS, TD))
- return ConstantInt::getTrue(LHS->getContext());
+ return ConstantInt::getAllOnesValue(ITy);
break;
}
}
@@ -1791,7 +1811,8 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
case ICmpInst::ICMP_EQ:
case ICmpInst::ICMP_UGT:
case ICmpInst::ICMP_UGE:
- return ConstantInt::getFalse(RHS->getContext());
+ // getNullValue also works for vectors, unlike getFalse.
+ return Constant::getNullValue(ITy);
case ICmpInst::ICMP_SLT:
case ICmpInst::ICMP_SLE:
ComputeSignBit(LHS, KnownNonNegative, KnownNegative, TD);
@@ -1801,7 +1822,8 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
case ICmpInst::ICMP_NE:
case ICmpInst::ICMP_ULT:
case ICmpInst::ICMP_ULE:
- return ConstantInt::getTrue(RHS->getContext());
+ // getAllOnesValue also works for vectors, unlike getTrue.
+ return Constant::getAllOnesValue(ITy);
}
}
if (RBO && match(RBO, m_URem(m_Value(), m_Specific(LHS)))) {
@@ -1818,7 +1840,8 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
case ICmpInst::ICMP_NE:
case ICmpInst::ICMP_UGT:
case ICmpInst::ICMP_UGE:
- return ConstantInt::getTrue(RHS->getContext());
+ // getAllOnesValue also works for vectors, unlike getTrue.
+ return Constant::getAllOnesValue(ITy);
case ICmpInst::ICMP_SLT:
case ICmpInst::ICMP_SLE:
ComputeSignBit(RHS, KnownNonNegative, KnownNegative, TD);
@@ -1828,7 +1851,8 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
case ICmpInst::ICMP_EQ:
case ICmpInst::ICMP_ULT:
case ICmpInst::ICMP_ULE:
- return ConstantInt::getFalse(RHS->getContext());
+ // getNullValue also works for vectors, unlike getFalse.
+ return Constant::getNullValue(ITy);
}
}
@@ -1843,7 +1867,7 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
// fall-through
case Instruction::SDiv:
case Instruction::AShr:
- if (!LBO->isExact() && !RBO->isExact())
+ if (!LBO->isExact() || !RBO->isExact())
break;
if (Value *V = SimplifyICmpInst(Pred, LBO->getOperand(0),
RBO->getOperand(0), TD, DT, MaxRecurse-1))
@@ -1864,6 +1888,194 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
}
}
+ // Simplify comparisons involving max/min.
+ Value *A, *B;
+ CmpInst::Predicate P = CmpInst::BAD_ICMP_PREDICATE;
+ CmpInst::Predicate EqP; // Chosen so that "A == max/min(A,B)" iff "A EqP B".
+
+ // Signed variants on "max(a,b)>=a -> true".
+ if (match(LHS, m_SMax(m_Value(A), m_Value(B))) && (A == RHS || B == RHS)) {
+ if (A != RHS) std::swap(A, B); // smax(A, B) pred A.
+ EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B".
+ // We analyze this as smax(A, B) pred A.
+ P = Pred;
+ } else if (match(RHS, m_SMax(m_Value(A), m_Value(B))) &&
+ (A == LHS || B == LHS)) {
+ if (A != LHS) std::swap(A, B); // A pred smax(A, B).
+ EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B".
+ // We analyze this as smax(A, B) swapped-pred A.
+ P = CmpInst::getSwappedPredicate(Pred);
+ } else if (match(LHS, m_SMin(m_Value(A), m_Value(B))) &&
+ (A == RHS || B == RHS)) {
+ if (A != RHS) std::swap(A, B); // smin(A, B) pred A.
+ EqP = CmpInst::ICMP_SLE; // "A == smin(A, B)" iff "A sle B".
+ // We analyze this as smax(-A, -B) swapped-pred -A.
+ // Note that we do not need to actually form -A or -B thanks to EqP.
+ P = CmpInst::getSwappedPredicate(Pred);
+ } else if (match(RHS, m_SMin(m_Value(A), m_Value(B))) &&
+ (A == LHS || B == LHS)) {
+ if (A != LHS) std::swap(A, B); // A pred smin(A, B).
+ EqP = CmpInst::ICMP_SLE; // "A == smin(A, B)" iff "A sle B".
+ // We analyze this as smax(-A, -B) pred -A.
+ // Note that we do not need to actually form -A or -B thanks to EqP.
+ P = Pred;
+ }
+ if (P != CmpInst::BAD_ICMP_PREDICATE) {
+ // Cases correspond to "max(A, B) p A".
+ switch (P) {
+ default:
+ break;
+ case CmpInst::ICMP_EQ:
+ case CmpInst::ICMP_SLE:
+ // Equivalent to "A EqP B". This may be the same as the condition tested
+ // in the max/min; if so, we can just return that.
+ if (Value *V = ExtractEquivalentCondition(LHS, EqP, A, B))
+ return V;
+ if (Value *V = ExtractEquivalentCondition(RHS, EqP, A, B))
+ return V;
+ // Otherwise, see if "A EqP B" simplifies.
+ if (MaxRecurse)
+ if (Value *V = SimplifyICmpInst(EqP, A, B, TD, DT, MaxRecurse-1))
+ return V;
+ break;
+ case CmpInst::ICMP_NE:
+ case CmpInst::ICMP_SGT: {
+ CmpInst::Predicate InvEqP = CmpInst::getInversePredicate(EqP);
+ // Equivalent to "A InvEqP B". This may be the same as the condition
+ // tested in the max/min; if so, we can just return that.
+ if (Value *V = ExtractEquivalentCondition(LHS, InvEqP, A, B))
+ return V;
+ if (Value *V = ExtractEquivalentCondition(RHS, InvEqP, A, B))
+ return V;
+ // Otherwise, see if "A InvEqP B" simplifies.
+ if (MaxRecurse)
+ if (Value *V = SimplifyICmpInst(InvEqP, A, B, TD, DT, MaxRecurse-1))
+ return V;
+ break;
+ }
+ case CmpInst::ICMP_SGE:
+ // Always true.
+ return Constant::getAllOnesValue(ITy);
+ case CmpInst::ICMP_SLT:
+ // Always false.
+ return Constant::getNullValue(ITy);
+ }
+ }
+
+ // Unsigned variants on "max(a,b)>=a -> true".
+ P = CmpInst::BAD_ICMP_PREDICATE;
+ if (match(LHS, m_UMax(m_Value(A), m_Value(B))) && (A == RHS || B == RHS)) {
+ if (A != RHS) std::swap(A, B); // umax(A, B) pred A.
+ EqP = CmpInst::ICMP_UGE; // "A == umax(A, B)" iff "A uge B".
+ // We analyze this as umax(A, B) pred A.
+ P = Pred;
+ } else if (match(RHS, m_UMax(m_Value(A), m_Value(B))) &&
+ (A == LHS || B == LHS)) {
+ if (A != LHS) std::swap(A, B); // A pred umax(A, B).
+ EqP = CmpInst::ICMP_UGE; // "A == umax(A, B)" iff "A uge B".
+ // We analyze this as umax(A, B) swapped-pred A.
+ P = CmpInst::getSwappedPredicate(Pred);
+ } else if (match(LHS, m_UMin(m_Value(A), m_Value(B))) &&
+ (A == RHS || B == RHS)) {
+ if (A != RHS) std::swap(A, B); // umin(A, B) pred A.
+ EqP = CmpInst::ICMP_ULE; // "A == umin(A, B)" iff "A ule B".
+ // We analyze this as umax(-A, -B) swapped-pred -A.
+ // Note that we do not need to actually form -A or -B thanks to EqP.
+ P = CmpInst::getSwappedPredicate(Pred);
+ } else if (match(RHS, m_UMin(m_Value(A), m_Value(B))) &&
+ (A == LHS || B == LHS)) {
+ if (A != LHS) std::swap(A, B); // A pred umin(A, B).
+ EqP = CmpInst::ICMP_ULE; // "A == umin(A, B)" iff "A ule B".
+ // We analyze this as umax(-A, -B) pred -A.
+ // Note that we do not need to actually form -A or -B thanks to EqP.
+ P = Pred;
+ }
+ if (P != CmpInst::BAD_ICMP_PREDICATE) {
+ // Cases correspond to "max(A, B) p A".
+ switch (P) {
+ default:
+ break;
+ case CmpInst::ICMP_EQ:
+ case CmpInst::ICMP_ULE:
+ // Equivalent to "A EqP B". This may be the same as the condition tested
+ // in the max/min; if so, we can just return that.
+ if (Value *V = ExtractEquivalentCondition(LHS, EqP, A, B))
+ return V;
+ if (Value *V = ExtractEquivalentCondition(RHS, EqP, A, B))
+ return V;
+ // Otherwise, see if "A EqP B" simplifies.
+ if (MaxRecurse)
+ if (Value *V = SimplifyICmpInst(EqP, A, B, TD, DT, MaxRecurse-1))
+ return V;
+ break;
+ case CmpInst::ICMP_NE:
+ case CmpInst::ICMP_UGT: {
+ CmpInst::Predicate InvEqP = CmpInst::getInversePredicate(EqP);
+ // Equivalent to "A InvEqP B". This may be the same as the condition
+ // tested in the max/min; if so, we can just return that.
+ if (Value *V = ExtractEquivalentCondition(LHS, InvEqP, A, B))
+ return V;
+ if (Value *V = ExtractEquivalentCondition(RHS, InvEqP, A, B))
+ return V;
+ // Otherwise, see if "A InvEqP B" simplifies.
+ if (MaxRecurse)
+ if (Value *V = SimplifyICmpInst(InvEqP, A, B, TD, DT, MaxRecurse-1))
+ return V;
+ break;
+ }
+ case CmpInst::ICMP_UGE:
+ // Always true.
+ return Constant::getAllOnesValue(ITy);
+ case CmpInst::ICMP_ULT:
+ // Always false.
+ return Constant::getNullValue(ITy);
+ }
+ }
+
+ // Variants on "max(x,y) >= min(x,z)".
+ Value *C, *D;
+ if (match(LHS, m_SMax(m_Value(A), m_Value(B))) &&
+ match(RHS, m_SMin(m_Value(C), m_Value(D))) &&
+ (A == C || A == D || B == C || B == D)) {
+ // max(x, ?) pred min(x, ?).
+ if (Pred == CmpInst::ICMP_SGE)
+ // Always true.
+ return Constant::getAllOnesValue(ITy);
+ if (Pred == CmpInst::ICMP_SLT)
+ // Always false.
+ return Constant::getNullValue(ITy);
+ } else if (match(LHS, m_SMin(m_Value(A), m_Value(B))) &&
+ match(RHS, m_SMax(m_Value(C), m_Value(D))) &&
+ (A == C || A == D || B == C || B == D)) {
+ // min(x, ?) pred max(x, ?).
+ if (Pred == CmpInst::ICMP_SLE)
+ // Always true.
+ return Constant::getAllOnesValue(ITy);
+ if (Pred == CmpInst::ICMP_SGT)
+ // Always false.
+ return Constant::getNullValue(ITy);
+ } else if (match(LHS, m_UMax(m_Value(A), m_Value(B))) &&
+ match(RHS, m_UMin(m_Value(C), m_Value(D))) &&
+ (A == C || A == D || B == C || B == D)) {
+ // max(x, ?) pred min(x, ?).
+ if (Pred == CmpInst::ICMP_UGE)
+ // Always true.
+ return Constant::getAllOnesValue(ITy);
+ if (Pred == CmpInst::ICMP_ULT)
+ // Always false.
+ return Constant::getNullValue(ITy);
+ } else if (match(LHS, m_UMin(m_Value(A), m_Value(B))) &&
+ match(RHS, m_UMax(m_Value(C), m_Value(D))) &&
+ (A == C || A == D || B == C || B == D)) {
+ // min(x, ?) pred max(x, ?).
+ if (Pred == CmpInst::ICMP_ULE)
+ // Always true.
+ return Constant::getAllOnesValue(ITy);
+ if (Pred == CmpInst::ICMP_UGT)
+ // Always false.
+ return Constant::getNullValue(ITy);
+ }
+
// If the comparison is with the result of a select instruction, check whether
// comparing with either branch of the select always yields the same value.
if (isa<SelectInst>(LHS) || isa<SelectInst>(RHS))
diff --git a/contrib/llvm/lib/Analysis/LazyValueInfo.cpp b/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
index d5f0b5c..6e27597 100644
--- a/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/contrib/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -589,16 +589,18 @@ static bool InstructionDereferencesPointer(Instruction *I, Value *Ptr) {
}
if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(I)) {
if (MI->isVolatile()) return false;
- if (MI->getAddressSpace() != 0) return false;
// FIXME: check whether it has a valuerange that excludes zero?
ConstantInt *Len = dyn_cast<ConstantInt>(MI->getLength());
if (!Len || Len->isZero()) return false;
- if (MI->getRawDest() == Ptr || MI->getDest() == Ptr)
- return true;
+ if (MI->getDestAddressSpace() == 0)
+ if (MI->getRawDest() == Ptr || MI->getDest() == Ptr)
+ return true;
if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(MI))
- return MTI->getRawSource() == Ptr || MTI->getSource() == Ptr;
+ if (MTI->getSourceAddressSpace() == 0)
+ if (MTI->getRawSource() == Ptr || MTI->getSource() == Ptr)
+ return true;
}
return false;
}
diff --git a/contrib/llvm/lib/Analysis/Loads.cpp b/contrib/llvm/lib/Analysis/Loads.cpp
index ab34fd6..c5c676b 100644
--- a/contrib/llvm/lib/Analysis/Loads.cpp
+++ b/contrib/llvm/lib/Analysis/Loads.cpp
@@ -31,7 +31,7 @@ using namespace llvm;
static bool AreEquivalentAddressValues(const Value *A, const Value *B) {
// Test if the values are trivially equivalent.
if (A == B) return true;
-
+
// Test if the values come from identical arithmetic instructions.
// Use isIdenticalToWhenDefined instead of isIdenticalTo because
// this function is only used when one address use dominates the
@@ -42,7 +42,7 @@ static bool AreEquivalentAddressValues(const Value *A, const Value *B) {
if (const Instruction *BI = dyn_cast<Instruction>(B))
if (cast<Instruction>(A)->isIdenticalToWhenDefined(BI))
return true;
-
+
// Otherwise they may not be equivalent.
return false;
}
diff --git a/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index ce7fab6..5f640c0 100644
--- a/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -374,10 +374,16 @@ getPointerDependencyFrom(const AliasAnalysis::Location &MemLoc, bool isLoad,
if (R == AliasAnalysis::MustAlias)
return MemDepResult::getDef(Inst);
+#if 0 // FIXME: Temporarily disabled. GVN is cleverly rewriting loads
+ // in terms of clobbering loads, but since it does this by looking
+ // at the clobbering load directly, it doesn't know about any
+ // phi translation that may have happened along the way.
+
// If we have a partial alias, then return this as a clobber for the
// client to handle.
if (R == AliasAnalysis::PartialAlias)
return MemDepResult::getClobber(Inst);
+#endif
// Random may-alias loads don't depend on each other without a
// dependence.
@@ -497,7 +503,7 @@ MemDepResult MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) {
// If we can do a pointer scan, make it happen.
bool isLoad = !(MR & AliasAnalysis::Mod);
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(QueryInst))
- isLoad |= II->getIntrinsicID() == Intrinsic::lifetime_end;
+ isLoad |= II->getIntrinsicID() == Intrinsic::lifetime_start;
LocalCache = getPointerDependencyFrom(MemLoc, isLoad, ScanPos,
QueryParent);
@@ -937,6 +943,9 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
SmallVector<BasicBlock*, 32> Worklist;
Worklist.push_back(StartBB);
+ // PredList used inside loop.
+ SmallVector<std::pair<BasicBlock*, PHITransAddr>, 16> PredList;
+
// Keep track of the entries that we know are sorted. Previously cached
// entries will all be sorted. The entries we add we only sort on demand (we
// don't insert every element into its sorted position). We know that we
@@ -973,22 +982,29 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
// the same Pointer.
if (!Pointer.NeedsPHITranslationFromBlock(BB)) {
SkipFirstBlock = false;
+ SmallVector<BasicBlock*, 16> NewBlocks;
for (BasicBlock **PI = PredCache->GetPreds(BB); *PI; ++PI) {
// Verify that we haven't looked at this block yet.
std::pair<DenseMap<BasicBlock*,Value*>::iterator, bool>
InsertRes = Visited.insert(std::make_pair(*PI, Pointer.getAddr()));
if (InsertRes.second) {
// First time we've looked at *PI.
- Worklist.push_back(*PI);
+ NewBlocks.push_back(*PI);
continue;
}
// If we have seen this block before, but it was with a different
// pointer then we have a phi translation failure and we have to treat
// this as a clobber.
- if (InsertRes.first->second != Pointer.getAddr())
+ if (InsertRes.first->second != Pointer.getAddr()) {
+ // Make sure to clean up the Visited map before continuing on to
+ // PredTranslationFailure.
+ for (unsigned i = 0; i < NewBlocks.size(); i++)
+ Visited.erase(NewBlocks[i]);
goto PredTranslationFailure;
+ }
}
+ Worklist.append(NewBlocks.begin(), NewBlocks.end());
continue;
}
@@ -1007,13 +1023,15 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
NumSortedEntries = Cache->size();
}
Cache = 0;
-
+
+ PredList.clear();
for (BasicBlock **PI = PredCache->GetPreds(BB); *PI; ++PI) {
BasicBlock *Pred = *PI;
-
+ PredList.push_back(std::make_pair(Pred, Pointer));
+
// Get the PHI translated pointer in this predecessor. This can fail if
// not translatable, in which case the getAddr() returns null.
- PHITransAddr PredPointer(Pointer);
+ PHITransAddr &PredPointer = PredList.back().second;
PredPointer.PHITranslateValue(BB, Pred, 0);
Value *PredPtrVal = PredPointer.getAddr();
@@ -1027,6 +1045,9 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
InsertRes = Visited.insert(std::make_pair(Pred, PredPtrVal));
if (!InsertRes.second) {
+ // We found the pred; take it off the list of preds to visit.
+ PredList.pop_back();
+
// If the predecessor was visited with PredPtr, then we already did
// the analysis and can ignore it.
if (InsertRes.first->second == PredPtrVal)
@@ -1035,14 +1056,47 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
// Otherwise, the block was previously analyzed with a different
// pointer. We can't represent the result of this case, so we just
// treat this as a phi translation failure.
+
+ // Make sure to clean up the Visited map before continuing on to
+ // PredTranslationFailure.
+ for (unsigned i = 0; i < PredList.size(); i++)
+ Visited.erase(PredList[i].first);
+
goto PredTranslationFailure;
}
-
+ }
+
+ // Actually process results here; this need to be a separate loop to avoid
+ // calling getNonLocalPointerDepFromBB for blocks we don't want to return
+ // any results for. (getNonLocalPointerDepFromBB will modify our
+ // datastructures in ways the code after the PredTranslationFailure label
+ // doesn't expect.)
+ for (unsigned i = 0; i < PredList.size(); i++) {
+ BasicBlock *Pred = PredList[i].first;
+ PHITransAddr &PredPointer = PredList[i].second;
+ Value *PredPtrVal = PredPointer.getAddr();
+
+ bool CanTranslate = true;
// If PHI translation was unable to find an available pointer in this
// predecessor, then we have to assume that the pointer is clobbered in
// that predecessor. We can still do PRE of the load, which would insert
// a computation of the pointer in this predecessor.
- if (PredPtrVal == 0) {
+ if (PredPtrVal == 0)
+ CanTranslate = false;
+
+ // FIXME: it is entirely possible that PHI translating will end up with
+ // the same value. Consider PHI translating something like:
+ // X = phi [x, bb1], [y, bb2]. PHI translating for bb1 doesn't *need*
+ // to recurse here, pedantically speaking.
+
+ // If getNonLocalPointerDepFromBB fails here, that means the cached
+ // result conflicted with the Visited list; we have to conservatively
+ // assume a clobber, but this also does not block PRE of the load.
+ if (!CanTranslate ||
+ getNonLocalPointerDepFromBB(PredPointer,
+ Loc.getWithNewPtr(PredPtrVal),
+ isLoad, Pred,
+ Result, Visited)) {
// Add the entry to the Result list.
NonLocalDepResult Entry(Pred,
MemDepResult::getClobber(Pred->getTerminator()),
@@ -1058,19 +1112,6 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
NLPI.Pair = BBSkipFirstBlockPair();
continue;
}
-
- // FIXME: it is entirely possible that PHI translating will end up with
- // the same value. Consider PHI translating something like:
- // X = phi [x, bb1], [y, bb2]. PHI translating for bb1 doesn't *need*
- // to recurse here, pedantically speaking.
-
- // If we have a problem phi translating, fall through to the code below
- // to handle the failure condition.
- if (getNonLocalPointerDepFromBB(PredPointer,
- Loc.getWithNewPtr(PredPointer.getAddr()),
- isLoad, Pred,
- Result, Visited))
- goto PredTranslationFailure;
}
// Refresh the CacheInfo/Cache pointer so that it isn't invalidated.
@@ -1087,6 +1128,9 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
continue;
PredTranslationFailure:
+ // The following code is "failure"; we can't produce a sane translation
+ // for the given block. It assumes that we haven't modified any of
+ // our datastructures while processing the current block.
if (Cache == 0) {
// Refresh the CacheInfo/Cache pointer if it got invalidated.
@@ -1117,8 +1161,8 @@ getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
assert(I->getResult().isNonLocal() &&
"Should only be here with transparent block");
- I->setResult(MemDepResult::getClobber(BB->begin()));
- ReverseNonLocalPtrDeps[BB->begin()].insert(CacheKey);
+ I->setResult(MemDepResult::getClobber(BB->getTerminator()));
+ ReverseNonLocalPtrDeps[BB->getTerminator()].insert(CacheKey);
Result.push_back(NonLocalDepResult(I->getBB(), I->getResult(),
Pointer.getAddr()));
break;
diff --git a/contrib/llvm/lib/Analysis/RegionPass.cpp b/contrib/llvm/lib/Analysis/RegionPass.cpp
index 3269dcc..80eda79 100644
--- a/contrib/llvm/lib/Analysis/RegionPass.cpp
+++ b/contrib/llvm/lib/Analysis/RegionPass.cpp
@@ -249,7 +249,7 @@ void RegionPass::assignPassManager(PMStack &PMS,
assert (!PMS.empty() && "Unable to create Region Pass Manager");
PMDataManager *PMD = PMS.top();
- // [1] Create new Call Graph Pass Manager
+ // [1] Create new Region Pass Manager
RGPM = new RGPassManager(PMD->getDepth() + 1);
RGPM->populateInheritedAnalysis(PMS);
diff --git a/contrib/llvm/lib/Analysis/ScalarEvolution.cpp b/contrib/llvm/lib/Analysis/ScalarEvolution.cpp
index bab4619..025718e 100644
--- a/contrib/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/contrib/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -1035,6 +1035,93 @@ const SCEV *ScalarEvolution::getZeroExtendExpr(const SCEV *Op,
return S;
}
+// Get the limit of a recurrence such that incrementing by Step cannot cause
+// signed overflow as long as the value of the recurrence within the loop does
+// not exceed this limit before incrementing.
+static const SCEV *getOverflowLimitForStep(const SCEV *Step,
+ ICmpInst::Predicate *Pred,
+ ScalarEvolution *SE) {
+ unsigned BitWidth = SE->getTypeSizeInBits(Step->getType());
+ if (SE->isKnownPositive(Step)) {
+ *Pred = ICmpInst::ICMP_SLT;
+ return SE->getConstant(APInt::getSignedMinValue(BitWidth) -
+ SE->getSignedRange(Step).getSignedMax());
+ }
+ if (SE->isKnownNegative(Step)) {
+ *Pred = ICmpInst::ICMP_SGT;
+ return SE->getConstant(APInt::getSignedMaxValue(BitWidth) -
+ SE->getSignedRange(Step).getSignedMin());
+ }
+ return 0;
+}
+
+// The recurrence AR has been shown to have no signed wrap. Typically, if we can
+// prove NSW for AR, then we can just as easily prove NSW for its preincrement
+// or postincrement sibling. This allows normalizing a sign extended AddRec as
+// such: {sext(Step + Start),+,Step} => {(Step + sext(Start),+,Step} As a
+// result, the expression "Step + sext(PreIncAR)" is congruent with
+// "sext(PostIncAR)"
+static const SCEV *getPreStartForSignExtend(const SCEVAddRecExpr *AR,
+ const Type *Ty,
+ ScalarEvolution *SE) {
+ const Loop *L = AR->getLoop();
+ const SCEV *Start = AR->getStart();
+ const SCEV *Step = AR->getStepRecurrence(*SE);
+
+ // Check for a simple looking step prior to loop entry.
+ const SCEVAddExpr *SA = dyn_cast<SCEVAddExpr>(Start);
+ if (!SA || SA->getNumOperands() != 2 || SA->getOperand(0) != Step)
+ return 0;
+
+ // This is a postinc AR. Check for overflow on the preinc recurrence using the
+ // same three conditions that getSignExtendedExpr checks.
+
+ // 1. NSW flags on the step increment.
+ const SCEV *PreStart = SA->getOperand(1);
+ const SCEVAddRecExpr *PreAR = dyn_cast<SCEVAddRecExpr>(
+ SE->getAddRecExpr(PreStart, Step, L, SCEV::FlagAnyWrap));
+
+ if (PreAR && PreAR->getNoWrapFlags(SCEV::FlagNSW))
+ return PreStart;
+
+ // 2. Direct overflow check on the step operation's expression.
+ unsigned BitWidth = SE->getTypeSizeInBits(AR->getType());
+ const Type *WideTy = IntegerType::get(SE->getContext(), BitWidth * 2);
+ const SCEV *OperandExtendedStart =
+ SE->getAddExpr(SE->getSignExtendExpr(PreStart, WideTy),
+ SE->getSignExtendExpr(Step, WideTy));
+ if (SE->getSignExtendExpr(Start, WideTy) == OperandExtendedStart) {
+ // Cache knowledge of PreAR NSW.
+ if (PreAR)
+ const_cast<SCEVAddRecExpr *>(PreAR)->setNoWrapFlags(SCEV::FlagNSW);
+ // FIXME: this optimization needs a unit test
+ DEBUG(dbgs() << "SCEV: untested prestart overflow check\n");
+ return PreStart;
+ }
+
+ // 3. Loop precondition.
+ ICmpInst::Predicate Pred;
+ const SCEV *OverflowLimit = getOverflowLimitForStep(Step, &Pred, SE);
+
+ if (OverflowLimit &&
+ SE->isLoopEntryGuardedByCond(L, Pred, PreStart, OverflowLimit)) {
+ return PreStart;
+ }
+ return 0;
+}
+
+// Get the normalized sign-extended expression for this AddRec's Start.
+static const SCEV *getSignExtendAddRecStart(const SCEVAddRecExpr *AR,
+ const Type *Ty,
+ ScalarEvolution *SE) {
+ const SCEV *PreStart = getPreStartForSignExtend(AR, Ty, SE);
+ if (!PreStart)
+ return SE->getSignExtendExpr(AR->getStart(), Ty);
+
+ return SE->getAddExpr(SE->getSignExtendExpr(AR->getStepRecurrence(*SE), Ty),
+ SE->getSignExtendExpr(PreStart, Ty));
+}
+
const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
const Type *Ty) {
assert(getTypeSizeInBits(Op->getType()) < getTypeSizeInBits(Ty) &&
@@ -1097,7 +1184,7 @@ const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
// If we have special knowledge that this addrec won't overflow,
// we don't need to do any further analysis.
if (AR->getNoWrapFlags(SCEV::FlagNSW))
- return getAddRecExpr(getSignExtendExpr(Start, Ty),
+ return getAddRecExpr(getSignExtendAddRecStart(AR, Ty, this),
getSignExtendExpr(Step, Ty),
L, SCEV::FlagNSW);
@@ -1133,7 +1220,7 @@ const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
// Cache knowledge of AR NSW, which is propagated to this AddRec.
const_cast<SCEVAddRecExpr *>(AR)->setNoWrapFlags(SCEV::FlagNSW);
// Return the expression with the addrec on the outside.
- return getAddRecExpr(getSignExtendExpr(Start, Ty),
+ return getAddRecExpr(getSignExtendAddRecStart(AR, Ty, this),
getSignExtendExpr(Step, Ty),
L, AR->getNoWrapFlags());
}
@@ -1149,7 +1236,7 @@ const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
// Cache knowledge of AR NSW, which is propagated to this AddRec.
const_cast<SCEVAddRecExpr *>(AR)->setNoWrapFlags(SCEV::FlagNSW);
// Return the expression with the addrec on the outside.
- return getAddRecExpr(getSignExtendExpr(Start, Ty),
+ return getAddRecExpr(getSignExtendAddRecStart(AR, Ty, this),
getZeroExtendExpr(Step, Ty),
L, AR->getNoWrapFlags());
}
@@ -1159,34 +1246,18 @@ const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
// the addrec is safe. Also, if the entry is guarded by a comparison
// with the start value and the backedge is guarded by a comparison
// with the post-inc value, the addrec is safe.
- if (isKnownPositive(Step)) {
- const SCEV *N = getConstant(APInt::getSignedMinValue(BitWidth) -
- getSignedRange(Step).getSignedMax());
- if (isLoopBackedgeGuardedByCond(L, ICmpInst::ICMP_SLT, AR, N) ||
- (isLoopEntryGuardedByCond(L, ICmpInst::ICMP_SLT, Start, N) &&
- isLoopBackedgeGuardedByCond(L, ICmpInst::ICMP_SLT,
- AR->getPostIncExpr(*this), N))) {
- // Cache knowledge of AR NSW, which is propagated to this AddRec.
- const_cast<SCEVAddRecExpr *>(AR)->setNoWrapFlags(SCEV::FlagNSW);
- // Return the expression with the addrec on the outside.
- return getAddRecExpr(getSignExtendExpr(Start, Ty),
- getSignExtendExpr(Step, Ty),
- L, AR->getNoWrapFlags());
- }
- } else if (isKnownNegative(Step)) {
- const SCEV *N = getConstant(APInt::getSignedMaxValue(BitWidth) -
- getSignedRange(Step).getSignedMin());
- if (isLoopBackedgeGuardedByCond(L, ICmpInst::ICMP_SGT, AR, N) ||
- (isLoopEntryGuardedByCond(L, ICmpInst::ICMP_SGT, Start, N) &&
- isLoopBackedgeGuardedByCond(L, ICmpInst::ICMP_SGT,
- AR->getPostIncExpr(*this), N))) {
- // Cache knowledge of AR NSW, which is propagated to this AddRec.
- const_cast<SCEVAddRecExpr *>(AR)->setNoWrapFlags(SCEV::FlagNSW);
- // Return the expression with the addrec on the outside.
- return getAddRecExpr(getSignExtendExpr(Start, Ty),
- getSignExtendExpr(Step, Ty),
- L, AR->getNoWrapFlags());
- }
+ ICmpInst::Predicate Pred;
+ const SCEV *OverflowLimit = getOverflowLimitForStep(Step, &Pred, this);
+ if (OverflowLimit &&
+ (isLoopBackedgeGuardedByCond(L, Pred, AR, OverflowLimit) ||
+ (isLoopEntryGuardedByCond(L, Pred, Start, OverflowLimit) &&
+ isLoopBackedgeGuardedByCond(L, Pred, AR->getPostIncExpr(*this),
+ OverflowLimit)))) {
+ // Cache knowledge of AR NSW, then propagate NSW to the wide AddRec.
+ const_cast<SCEVAddRecExpr *>(AR)->setNoWrapFlags(SCEV::FlagNSW);
+ return getAddRecExpr(getSignExtendAddRecStart(AR, Ty, this),
+ getSignExtendExpr(Step, Ty),
+ L, AR->getNoWrapFlags());
}
}
}
@@ -3783,7 +3854,7 @@ ScalarEvolution::getBackedgeTakenInfo(const Loop *L) {
// update the value. The temporary CouldNotCompute value tells SCEV
// code elsewhere that it shouldn't attempt to request a new
// backedge-taken count, which could result in infinite recursion.
- std::pair<std::map<const Loop *, BackedgeTakenInfo>::iterator, bool> Pair =
+ std::pair<DenseMap<const Loop *, BackedgeTakenInfo>::iterator, bool> Pair =
BackedgeTakenCounts.insert(std::make_pair(L, getCouldNotCompute()));
if (!Pair.second)
return Pair.first->second;
@@ -4433,7 +4504,7 @@ Constant *
ScalarEvolution::getConstantEvolutionLoopExitValue(PHINode *PN,
const APInt &BEs,
const Loop *L) {
- std::map<PHINode*, Constant*>::const_iterator I =
+ DenseMap<PHINode*, Constant*>::const_iterator I =
ConstantEvolutionLoopExitValue.find(PN);
if (I != ConstantEvolutionLoopExitValue.end())
return I->second;
diff --git a/contrib/llvm/lib/Analysis/ValueTracking.cpp b/contrib/llvm/lib/Analysis/ValueTracking.cpp
index 8f18dd2..dab5aeb 100644
--- a/contrib/llvm/lib/Analysis/ValueTracking.cpp
+++ b/contrib/llvm/lib/Analysis/ValueTracking.cpp
@@ -131,8 +131,18 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
}
return;
}
+
+ if (Argument *A = dyn_cast<Argument>(V)) {
+ // Get alignment information off byval arguments if specified in the IR.
+ if (A->hasByValAttr())
+ if (unsigned Align = A->getParamAlignment())
+ KnownZero = Mask & APInt::getLowBitsSet(BitWidth,
+ CountTrailingZeros_32(Align));
+ return;
+ }
- KnownZero.clearAllBits(); KnownOne.clearAllBits(); // Start out not knowing anything.
+ // Start out not knowing anything.
+ KnownZero.clearAllBits(); KnownOne.clearAllBits();
if (Depth == MaxDepth || Mask == 0)
return; // Limit search depth.
@@ -670,6 +680,10 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - LowBits);
break;
}
+ case Intrinsic::x86_sse42_crc32_64_8:
+ case Intrinsic::x86_sse42_crc32_64_64:
+ KnownZero = APInt::getHighBitsSet(64, 32);
+ break;
}
}
break;
diff --git a/contrib/llvm/lib/AsmParser/LLLexer.cpp b/contrib/llvm/lib/AsmParser/LLLexer.cpp
index 857fa1e..014e816 100644
--- a/contrib/llvm/lib/AsmParser/LLLexer.cpp
+++ b/contrib/llvm/lib/AsmParser/LLLexer.cpp
@@ -308,16 +308,8 @@ lltok::Kind LLLexer::LexAt() {
}
// Handle GlobalVarName: @[-a-zA-Z$._][-a-zA-Z$._0-9]*
- if (isalpha(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
- CurPtr[0] == '.' || CurPtr[0] == '_') {
- ++CurPtr;
- while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
- CurPtr[0] == '.' || CurPtr[0] == '_')
- ++CurPtr;
-
- StrVal.assign(TokStart+1, CurPtr); // Skip @
+ if (ReadVarName())
return lltok::GlobalVar;
- }
// Handle GlobalVarID: @[0-9]+
if (isdigit(CurPtr[0])) {
@@ -334,6 +326,39 @@ lltok::Kind LLLexer::LexAt() {
return lltok::Error;
}
+/// ReadString - Read a string until the closing quote.
+lltok::Kind LLLexer::ReadString(lltok::Kind kind) {
+ const char *Start = CurPtr;
+ while (1) {
+ int CurChar = getNextChar();
+
+ if (CurChar == EOF) {
+ Error("end of file in string constant");
+ return lltok::Error;
+ }
+ if (CurChar == '"') {
+ StrVal.assign(Start, CurPtr-1);
+ UnEscapeLexed(StrVal);
+ return kind;
+ }
+ }
+}
+
+/// ReadVarName - Read the rest of a token containing a variable name.
+bool LLLexer::ReadVarName() {
+ const char *NameStart = CurPtr;
+ if (isalpha(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
+ CurPtr[0] == '.' || CurPtr[0] == '_') {
+ ++CurPtr;
+ while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
+ CurPtr[0] == '.' || CurPtr[0] == '_')
+ ++CurPtr;
+
+ StrVal.assign(NameStart, CurPtr);
+ return true;
+ }
+ return false;
+}
/// LexPercent - Lex all tokens that start with a % character:
/// LocalVar ::= %\"[^\"]*\"
@@ -343,33 +368,12 @@ lltok::Kind LLLexer::LexPercent() {
// Handle LocalVarName: %\"[^\"]*\"
if (CurPtr[0] == '"') {
++CurPtr;
-
- while (1) {
- int CurChar = getNextChar();
-
- if (CurChar == EOF) {
- Error("end of file in string constant");
- return lltok::Error;
- }
- if (CurChar == '"') {
- StrVal.assign(TokStart+2, CurPtr-1);
- UnEscapeLexed(StrVal);
- return lltok::LocalVar;
- }
- }
+ return ReadString(lltok::LocalVar);
}
// Handle LocalVarName: %[-a-zA-Z$._][-a-zA-Z$._0-9]*
- if (isalpha(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
- CurPtr[0] == '.' || CurPtr[0] == '_') {
- ++CurPtr;
- while (isalnum(CurPtr[0]) || CurPtr[0] == '-' || CurPtr[0] == '$' ||
- CurPtr[0] == '.' || CurPtr[0] == '_')
- ++CurPtr;
-
- StrVal.assign(TokStart+1, CurPtr); // Skip %
+ if (ReadVarName())
return lltok::LocalVar;
- }
// Handle LocalVarID: %[0-9]+
if (isdigit(CurPtr[0])) {
@@ -390,27 +394,16 @@ lltok::Kind LLLexer::LexPercent() {
/// QuoteLabel "[^"]+":
/// StringConstant "[^"]*"
lltok::Kind LLLexer::LexQuote() {
- while (1) {
- int CurChar = getNextChar();
-
- if (CurChar == EOF) {
- Error("end of file in quoted string");
- return lltok::Error;
- }
-
- if (CurChar != '"') continue;
-
- if (CurPtr[0] != ':') {
- StrVal.assign(TokStart+1, CurPtr-1);
- UnEscapeLexed(StrVal);
- return lltok::StringConstant;
- }
+ lltok::Kind kind = ReadString(lltok::StringConstant);
+ if (kind == lltok::Error || kind == lltok::Eof)
+ return kind;
+ if (CurPtr[0] == ':') {
++CurPtr;
- StrVal.assign(TokStart+1, CurPtr-2);
- UnEscapeLexed(StrVal);
- return lltok::LabelStr;
+ kind = lltok::LabelStr;
}
+
+ return kind;
}
static bool JustWhitespaceNewLine(const char *&Ptr) {
@@ -565,6 +558,7 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(nest);
KEYWORD(readnone);
KEYWORD(readonly);
+ KEYWORD(uwtable);
KEYWORD(inlinehint);
KEYWORD(noinline);
diff --git a/contrib/llvm/lib/AsmParser/LLLexer.h b/contrib/llvm/lib/AsmParser/LLLexer.h
index 09ae801..4fe705e 100644
--- a/contrib/llvm/lib/AsmParser/LLLexer.h
+++ b/contrib/llvm/lib/AsmParser/LLLexer.h
@@ -71,6 +71,9 @@ namespace llvm {
int getNextChar();
void SkipLineComment();
+ lltok::Kind ReadString(lltok::Kind kind);
+ bool ReadVarName();
+
lltok::Kind LexIdentifier();
lltok::Kind LexDigitOrNegative();
lltok::Kind LexPositive();
diff --git a/contrib/llvm/lib/AsmParser/LLParser.cpp b/contrib/llvm/lib/AsmParser/LLParser.cpp
index a2c53be..81e0747 100644
--- a/contrib/llvm/lib/AsmParser/LLParser.cpp
+++ b/contrib/llvm/lib/AsmParser/LLParser.cpp
@@ -972,6 +972,7 @@ bool LLParser::ParseOptionalAttrs(unsigned &Attrs, unsigned AttrKind) {
case lltok::kw_noreturn: Attrs |= Attribute::NoReturn; break;
case lltok::kw_nounwind: Attrs |= Attribute::NoUnwind; break;
+ case lltok::kw_uwtable: Attrs |= Attribute::UWTable; break;
case lltok::kw_noinline: Attrs |= Attribute::NoInline; break;
case lltok::kw_readnone: Attrs |= Attribute::ReadNone; break;
case lltok::kw_readonly: Attrs |= Attribute::ReadOnly; break;
@@ -3003,7 +3004,6 @@ int LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
case lltok::kw_sub:
case lltok::kw_mul:
case lltok::kw_shl: {
- LocTy ModifierLoc = Lex.getLoc();
bool NUW = EatIfPresent(lltok::kw_nuw);
bool NSW = EatIfPresent(lltok::kw_nsw);
if (!NUW) NUW = EatIfPresent(lltok::kw_nuw);
diff --git a/contrib/llvm/lib/AsmParser/LLToken.h b/contrib/llvm/lib/AsmParser/LLToken.h
index 576da19..02f97a3 100644
--- a/contrib/llvm/lib/AsmParser/LLToken.h
+++ b/contrib/llvm/lib/AsmParser/LLToken.h
@@ -87,6 +87,7 @@ namespace lltok {
kw_nest,
kw_readnone,
kw_readonly,
+ kw_uwtable,
kw_inlinehint,
kw_noinline,
diff --git a/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 19f57cf..bc995ae 100644
--- a/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1588,8 +1588,18 @@ bool BitcodeReader::ParseBitcodeInto(Module *M) {
while (!Stream.AtEndOfStream()) {
unsigned Code = Stream.ReadCode();
- if (Code != bitc::ENTER_SUBBLOCK)
+ if (Code != bitc::ENTER_SUBBLOCK) {
+
+ // The ranlib in xcode 4 will align archive members by appending newlines to the
+ // end of them. If this file size is a multiple of 4 but not 8, we have to read and
+ // ignore these final 4 bytes :-(
+ if (Stream.GetAbbrevIDWidth() == 2 && Code == 2 &&
+ Stream.Read(6) == 2 && Stream.Read(24) == 0xa0a0a &&
+ Stream.AtEndOfStream())
+ return false;
+
return Error("Invalid record at top-level");
+ }
unsigned BlockID = Stream.ReadSubBlockID();
@@ -1842,7 +1852,6 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
FunctionBBs[i] = BasicBlock::Create(Context, "", F);
CurBB = FunctionBBs[0];
continue;
-
case bitc::FUNC_CODE_DEBUG_LOC_AGAIN: // DEBUG_LOC_AGAIN
// This record indicates that the last instruction is at the same
diff --git a/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index e34137f..6972a45 100644
--- a/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -100,8 +100,6 @@ static unsigned GetEncodedBinaryOpcode(unsigned Opcode) {
}
}
-
-
static void WriteStringRecord(unsigned Code, const std::string &Str,
unsigned AbbrevToUse, BitstreamWriter &Stream) {
SmallVector<unsigned, 64> Vals;
@@ -447,7 +445,6 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
Vals.clear();
}
-
// Emit the alias information.
for (Module::const_alias_iterator AI = M->alias_begin(), E = M->alias_end();
AI != E; ++AI) {
@@ -871,8 +868,6 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
break;
}
} else if (const BlockAddress *BA = dyn_cast<BlockAddress>(C)) {
- assert(BA->getFunction() == BA->getBasicBlock()->getParent() &&
- "Malformed blockaddress");
Code = bitc::CST_CODE_BLOCKADDRESS;
Record.push_back(VE.getTypeID(BA->getFunction()->getType()));
Record.push_back(VE.getValueID(BA->getFunction()));
@@ -1514,9 +1509,9 @@ static void WriteModule(const Module *M, BitstreamWriter &Stream) {
WriteModuleMetadata(M, VE, Stream);
// Emit function bodies.
- for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
- if (!I->isDeclaration())
- WriteFunction(*I, VE, Stream);
+ for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F)
+ if (!F->isDeclaration())
+ WriteFunction(*F, VE, Stream);
// Emit metadata.
WriteModuleMetadataStore(M, Stream);
diff --git a/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
index 21f004a..5138c3c 100644
--- a/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -452,7 +452,6 @@ void ValueEnumerator::EnumerateAttributes(const AttrListPtr &PAL) {
}
}
-
void ValueEnumerator::incorporateFunction(const Function &F) {
InstructionCount = 0;
NumModuleValues = Values.size();
diff --git a/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp b/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
index 5c809f7..dca1d29 100644
--- a/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
+++ b/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
@@ -719,7 +719,9 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies(
const std::vector<SUnit>& SUnits,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
- unsigned InsertPosIndex) {
+ unsigned InsertPosIndex,
+ DbgValueVector &DbgValues) {
+
std::vector<unsigned> &KillIndices = State->GetKillIndices();
std::vector<unsigned> &DefIndices = State->GetDefIndices();
std::multimap<unsigned, AggressiveAntiDepState::RegisterReference>&
@@ -923,14 +925,10 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies(
// sure to update that as well.
const SUnit *SU = MISUnitMap[Q->second.Operand->getParent()];
if (!SU) continue;
- for (unsigned i = 0, e = SU->DbgInstrList.size() ; i < e ; ++i) {
- MachineInstr *DI = SU->DbgInstrList[i];
- assert (DI->getNumOperands()==3 && DI->getOperand(0).isReg() &&
- DI->getOperand(0).getReg()
- && "Non register dbg_value attached to SUnit!");
- if (DI->getOperand(0).getReg() == AntiDepReg)
- DI->getOperand(0).setReg(NewReg);
- }
+ for (DbgValueVector::iterator DVI = DbgValues.begin(),
+ DVE = DbgValues.end(); DVI != DVE; ++DVI)
+ if (DVI->second == Q->second.Operand->getParent())
+ UpdateDbgValue(DVI->first, AntiDepReg, NewReg);
}
// We just went back in time and modified history; the
diff --git a/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h b/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h
index 9d715cc..b7ddafc 100644
--- a/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h
+++ b/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h
@@ -146,7 +146,8 @@ namespace llvm {
unsigned BreakAntiDependencies(const std::vector<SUnit>& SUnits,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
- unsigned InsertPosIndex);
+ unsigned InsertPosIndex,
+ DbgValueVector &DbgValues);
/// Observe - Update liveness information to account for the current
/// instruction, which will not be scheduled.
diff --git a/contrib/llvm/lib/CodeGen/AllocationOrder.cpp b/contrib/llvm/lib/CodeGen/AllocationOrder.cpp
index 20c7625..a8ee2b6 100644
--- a/contrib/llvm/lib/CodeGen/AllocationOrder.cpp
+++ b/contrib/llvm/lib/CodeGen/AllocationOrder.cpp
@@ -15,6 +15,7 @@
//===----------------------------------------------------------------------===//
#include "AllocationOrder.h"
+#include "RegisterClassInfo.h"
#include "VirtRegMap.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
@@ -23,8 +24,8 @@ using namespace llvm;
// Compare VirtRegMap::getRegAllocPref().
AllocationOrder::AllocationOrder(unsigned VirtReg,
const VirtRegMap &VRM,
- const BitVector &ReservedRegs)
- : Pos(0), Reserved(ReservedRegs) {
+ const RegisterClassInfo &RegClassInfo)
+ : Begin(0), End(0), Pos(0), RCI(RegClassInfo), OwnedBegin(false) {
const TargetRegisterClass *RC = VRM.getRegInfo().getRegClass(VirtReg);
std::pair<unsigned, unsigned> HintPair =
VRM.getRegInfo().getRegAllocationHint(VirtReg);
@@ -36,33 +37,45 @@ AllocationOrder::AllocationOrder(unsigned VirtReg,
if (TargetRegisterInfo::isVirtualRegister(Hint))
Hint = VRM.getPhys(Hint);
- // The remaining allocation order may depend on the hint.
- tie(Begin, End) = VRM.getTargetRegInfo()
- .getAllocationOrder(RC, HintPair.first, Hint, VRM.getMachineFunction());
+ // The first hint pair component indicates a target-specific hint.
+ if (HintPair.first) {
+ const TargetRegisterInfo &TRI = VRM.getTargetRegInfo();
+ // The remaining allocation order may depend on the hint.
+ const unsigned *B, *E;
+ tie(B, E) = TRI.getAllocationOrder(RC, HintPair.first, Hint,
+ VRM.getMachineFunction());
- // Target-dependent hints require resolution.
- if (HintPair.first)
- Hint = VRM.getTargetRegInfo().ResolveRegAllocHint(HintPair.first, Hint,
- VRM.getMachineFunction());
+ // Empty allocation order?
+ if (B == E)
+ return;
+
+ // Copy the allocation order with reserved registers removed.
+ OwnedBegin = true;
+ unsigned *P = new unsigned[E - B];
+ Begin = P;
+ for (; B != E; ++B)
+ if (!RCI.isReserved(*B))
+ *P++ = *B;
+ End = P;
+
+ // Target-dependent hints require resolution.
+ Hint = TRI.ResolveRegAllocHint(HintPair.first, Hint,
+ VRM.getMachineFunction());
+ } else {
+ // If there is no hint or just a normal hint, use the cached allocation
+ // order from RegisterClassInfo.
+ ArrayRef<unsigned> O = RCI.getOrder(RC);
+ Begin = O.begin();
+ End = O.end();
+ }
// The hint must be a valid physreg for allocation.
if (Hint && (!TargetRegisterInfo::isPhysicalRegister(Hint) ||
- !RC->contains(Hint) || ReservedRegs.test(Hint)))
+ !RC->contains(Hint) || RCI.isReserved(Hint)))
Hint = 0;
}
-unsigned AllocationOrder::next() {
- // First take the hint.
- if (!Pos) {
- Pos = Begin;
- if (Hint)
- return Hint;
- }
- // Then look at the order from TRI.
- while(Pos != End) {
- unsigned Reg = *Pos++;
- if (Reg != Hint && !Reserved.test(Reg))
- return Reg;
- }
- return 0;
+AllocationOrder::~AllocationOrder() {
+ if (OwnedBegin)
+ delete [] Begin;
}
diff --git a/contrib/llvm/lib/CodeGen/AllocationOrder.h b/contrib/llvm/lib/CodeGen/AllocationOrder.h
index 61fd8f8..d1e48a1 100644
--- a/contrib/llvm/lib/CodeGen/AllocationOrder.h
+++ b/contrib/llvm/lib/CodeGen/AllocationOrder.h
@@ -19,15 +19,16 @@
namespace llvm {
-class BitVector;
+class RegisterClassInfo;
class VirtRegMap;
class AllocationOrder {
const unsigned *Begin;
const unsigned *End;
const unsigned *Pos;
- const BitVector &Reserved;
+ const RegisterClassInfo &RCI;
unsigned Hint;
+ bool OwnedBegin;
public:
/// AllocationOrder - Create a new AllocationOrder for VirtReg.
@@ -37,12 +38,28 @@ public:
/// TargetRegisterInfo::getReservedRegs().
AllocationOrder(unsigned VirtReg,
const VirtRegMap &VRM,
- const BitVector &ReservedRegs);
+ const RegisterClassInfo &RegClassInfo);
+
+ ~AllocationOrder();
/// next - Return the next physical register in the allocation order, or 0.
/// It is safe to call next again after it returned 0.
/// It will keep returning 0 until rewind() is called.
- unsigned next();
+ unsigned next() {
+ // First take the hint.
+ if (!Pos) {
+ Pos = Begin;
+ if (Hint)
+ return Hint;
+ }
+ // Then look at the order from TRI.
+ while (Pos != End) {
+ unsigned Reg = *Pos++;
+ if (Reg != Hint)
+ return Reg;
+ }
+ return 0;
+ }
/// rewind - Start over from the beginning.
void rewind() { Pos = 0; }
diff --git a/contrib/llvm/lib/CodeGen/AntiDepBreaker.h b/contrib/llvm/lib/CodeGen/AntiDepBreaker.h
index 086b757..df47f98 100644
--- a/contrib/llvm/lib/CodeGen/AntiDepBreaker.h
+++ b/contrib/llvm/lib/CodeGen/AntiDepBreaker.h
@@ -30,6 +30,9 @@ namespace llvm {
/// anti-dependencies.
class AntiDepBreaker {
public:
+ typedef std::vector<std::pair<MachineInstr *, MachineInstr *> >
+ DbgValueVector;
+
virtual ~AntiDepBreaker();
/// Start - Initialize anti-dep breaking for a new basic block.
@@ -40,9 +43,10 @@ public:
/// the number of anti-dependencies broken.
///
virtual unsigned BreakAntiDependencies(const std::vector<SUnit>& SUnits,
- MachineBasicBlock::iterator Begin,
- MachineBasicBlock::iterator End,
- unsigned InsertPosIndex) =0;
+ MachineBasicBlock::iterator Begin,
+ MachineBasicBlock::iterator End,
+ unsigned InsertPosIndex,
+ DbgValueVector &DbgValues) = 0;
/// Observe - Update liveness information to account for the current
/// instruction, which will not be scheduled.
@@ -52,6 +56,14 @@ public:
/// Finish - Finish anti-dep breaking for a basic block.
virtual void FinishBlock() =0;
+
+ /// UpdateDbgValue - Update DBG_VALUE if dependency breaker is updating
+ /// other machine instruction to use NewReg.
+ void UpdateDbgValue(MachineInstr *MI, unsigned OldReg, unsigned NewReg) {
+ assert (MI->isDebugValue() && "MI is not DBG_VALUE!");
+ if (MI && MI->getOperand(0).isReg() && MI->getOperand(0).getReg() == OldReg)
+ MI->getOperand(0).setReg(NewReg);
+ }
};
}
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
index 0db28a6..5861fa4 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
@@ -52,7 +52,7 @@ void ARMException::EndModule() {
/// being emitted immediately after the function entry point.
void ARMException::BeginFunction(const MachineFunction *MF) {
Asm->OutStreamer.EmitFnStart();
- if (!Asm->MF->getFunction()->doesNotThrow() || UnwindTablesMandatory)
+ if (Asm->MF->getFunction()->needsUnwindTableEntry())
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_begin",
Asm->getFunctionNumber()));
}
@@ -60,7 +60,7 @@ void ARMException::BeginFunction(const MachineFunction *MF) {
/// EndFunction - Gather and emit post-function exception information.
///
void ARMException::EndFunction() {
- if (Asm->MF->getFunction()->doesNotThrow() && !UnwindTablesMandatory)
+ if (!Asm->MF->getFunction()->needsUnwindTableEntry())
Asm->OutStreamer.EmitCantUnwind();
else {
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_end",
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 8116f8d..161afba 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -189,21 +189,22 @@ bool AsmPrinter::doInitialization(Module &M) {
if (MAI->doesSupportDebugInformation())
DD = new DwarfDebug(this, &M);
- if (MAI->doesSupportExceptionHandling())
- switch (MAI->getExceptionHandlingType()) {
- default:
- case ExceptionHandling::DwarfTable:
- DE = new DwarfTableException(this);
- break;
- case ExceptionHandling::DwarfCFI:
- DE = new DwarfCFIException(this);
- break;
- case ExceptionHandling::ARM:
- DE = new ARMException(this);
- break;
- }
+ switch (MAI->getExceptionHandlingType()) {
+ case ExceptionHandling::None:
+ return false;
+ case ExceptionHandling::SjLj:
+ case ExceptionHandling::DwarfCFI:
+ DE = new DwarfCFIException(this);
+ return false;
+ case ExceptionHandling::ARM:
+ DE = new ARMException(this);
+ return false;
+ case ExceptionHandling::Win64:
+ DE = new Win64Exception(this);
+ return false;
+ }
- return false;
+ llvm_unreachable("Unknown exception type.");
}
void AsmPrinter::EmitLinkage(unsigned Linkage, MCSymbol *GVSym) const {
@@ -268,7 +269,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
}
MCSymbol *GVSym = Mang->getSymbol(GV);
- EmitVisibility(GVSym, GV->getVisibility());
+ EmitVisibility(GVSym, GV->getVisibility(), !GV->isDeclaration());
if (!GV->hasInitializer()) // External globals require no extra code.
return;
@@ -592,30 +593,29 @@ static bool EmitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) {
return true;
}
-bool AsmPrinter::needsCFIMoves() {
- if (UnwindTablesMandatory)
- return true;
+AsmPrinter::CFIMoveType AsmPrinter::needsCFIMoves() {
+ if (MAI->getExceptionHandlingType() == ExceptionHandling::DwarfCFI &&
+ MF->getFunction()->needsUnwindTableEntry())
+ return CFI_M_EH;
- if (MMI->hasDebugInfo() && !MAI->doesDwarfRequireFrameSection())
- return true;
+ if (MMI->hasDebugInfo())
+ return CFI_M_Debug;
- if (MF->getFunction()->doesNotThrow())
- return false;
+ return CFI_M_None;
+}
- return true;
+bool AsmPrinter::needsSEHMoves() {
+ return MAI->getExceptionHandlingType() == ExceptionHandling::Win64 &&
+ MF->getFunction()->needsUnwindTableEntry();
}
void AsmPrinter::emitPrologLabel(const MachineInstr &MI) {
MCSymbol *Label = MI.getOperand(0).getMCSymbol();
- if (MAI->doesDwarfRequireFrameSection() ||
- MAI->getExceptionHandlingType() != ExceptionHandling::DwarfCFI)
- OutStreamer.EmitLabel(Label);
-
if (MAI->getExceptionHandlingType() != ExceptionHandling::DwarfCFI)
return;
- if (!needsCFIMoves())
+ if (needsCFIMoves() == CFI_M_None)
return;
MachineModuleInfo &MMI = MF->getMMI();
@@ -768,30 +768,25 @@ getDebugValueLocation(const MachineInstr *MI) const {
return MachineLocation();
}
-/// getDwarfRegOpSize - get size required to emit given machine location using
-/// dwarf encoding.
-unsigned AsmPrinter::getDwarfRegOpSize(const MachineLocation &MLoc) const {
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- unsigned DWReg = RI->getDwarfRegNum(MLoc.getReg(), false);
- if (int Offset = MLoc.getOffset()) {
- // If the value is at a certain offset from frame register then
- // use DW_OP_breg.
- if (DWReg < 32)
- return 1 + MCAsmInfo::getSLEB128Size(Offset);
- else
- return 1 + MCAsmInfo::getULEB128Size(MLoc.getReg())
- + MCAsmInfo::getSLEB128Size(Offset);
- }
- if (DWReg < 32)
- return 1;
-
- return 1 + MCAsmInfo::getULEB128Size(DWReg);
-}
-
/// EmitDwarfRegOp - Emit dwarf register operation.
void AsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc) const {
const TargetRegisterInfo *TRI = TM.getRegisterInfo();
- unsigned Reg = TRI->getDwarfRegNum(MLoc.getReg(), false);
+ int Reg = TRI->getDwarfRegNum(MLoc.getReg(), false);
+
+ for (const unsigned *SR = TRI->getSuperRegisters(MLoc.getReg());
+ *SR && Reg < 0; ++SR) {
+ Reg = TRI->getDwarfRegNum(*SR, false);
+ // FIXME: Get the bit range this register uses of the superregister
+ // so that we can produce a DW_OP_bit_piece
+ }
+
+ // FIXME: Handle cases like a super register being encoded as
+ // DW_OP_reg 32 DW_OP_piece 4 DW_OP_reg 33
+
+ // FIXME: We have no reasonable way of handling errors in here. The
+ // caller might be in the middle of an dwarf expression. We should
+ // probably assert that Reg >= 0 once debug info generation is more mature.
+
if (int Offset = MLoc.getOffset()) {
if (Reg < 32) {
OutStreamer.AddComment(
@@ -816,6 +811,8 @@ void AsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc) const {
EmitULEB128(Reg);
}
}
+
+ // FIXME: Produce a DW_OP_bit_piece if we used a superregister
}
bool AsmPrinter::doFinalization(Module &M) {
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
index 6d1708a..dd5b0e2 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
@@ -206,78 +206,7 @@ void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
// Dwarf Lowering Routines
//===----------------------------------------------------------------------===//
-
-/// EmitFrameMoves - Emit frame instructions to describe the layout of the
-/// frame.
-void AsmPrinter::EmitFrameMoves(const std::vector<MachineMove> &Moves,
- MCSymbol *BaseLabel, bool isEH) const {
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
-
- int stackGrowth = TM.getTargetData()->getPointerSize();
- if (TM.getFrameLowering()->getStackGrowthDirection() !=
- TargetFrameLowering::StackGrowsUp)
- stackGrowth *= -1;
-
- for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
- const MachineMove &Move = Moves[i];
- MCSymbol *Label = Move.getLabel();
- // Throw out move if the label is invalid.
- if (Label && !Label->isDefined()) continue; // Not emitted, in dead code.
-
- const MachineLocation &Dst = Move.getDestination();
- const MachineLocation &Src = Move.getSource();
-
- // Advance row if new location.
- if (BaseLabel && Label) {
- MCSymbol *ThisSym = Label;
- if (ThisSym != BaseLabel) {
- EmitCFAByte(dwarf::DW_CFA_advance_loc4);
- EmitLabelDifference(ThisSym, BaseLabel, 4);
- BaseLabel = ThisSym;
- }
- }
-
- // If advancing cfa.
- if (Dst.isReg() && Dst.getReg() == MachineLocation::VirtualFP) {
- assert(!Src.isReg() && "Machine move not supported yet.");
-
- if (Src.getReg() == MachineLocation::VirtualFP) {
- EmitCFAByte(dwarf::DW_CFA_def_cfa_offset);
- } else {
- EmitCFAByte(dwarf::DW_CFA_def_cfa);
- EmitULEB128(RI->getDwarfRegNum(Src.getReg(), isEH), "Register");
- }
-
- EmitULEB128(-Src.getOffset(), "Offset");
- continue;
- }
-
- if (Src.isReg() && Src.getReg() == MachineLocation::VirtualFP) {
- assert(Dst.isReg() && "Machine move not supported yet.");
- EmitCFAByte(dwarf::DW_CFA_def_cfa_register);
- EmitULEB128(RI->getDwarfRegNum(Dst.getReg(), isEH), "Register");
- continue;
- }
-
- unsigned Reg = RI->getDwarfRegNum(Src.getReg(), isEH);
- int Offset = Dst.getOffset() / stackGrowth;
-
- if (Offset < 0) {
- EmitCFAByte(dwarf::DW_CFA_offset_extended_sf);
- EmitULEB128(Reg, "Reg");
- EmitSLEB128(Offset, "Offset");
- } else if (Reg < 64) {
- EmitCFAByte(dwarf::DW_CFA_offset + Reg);
- EmitULEB128(Offset, "Offset");
- } else {
- EmitCFAByte(dwarf::DW_CFA_offset_extended);
- EmitULEB128(Reg, "Reg");
- EmitULEB128(Offset, "Offset");
- }
- }
-}
-
-/// EmitFrameMoves - Emit a frame instruction.
+/// EmitCFIFrameMove - Emit a frame instruction.
void AsmPrinter::EmitCFIFrameMove(const MachineMove &Move) const {
const TargetRegisterInfo *RI = TM.getRegisterInfo();
@@ -286,13 +215,12 @@ void AsmPrinter::EmitCFIFrameMove(const MachineMove &Move) const {
// If advancing cfa.
if (Dst.isReg() && Dst.getReg() == MachineLocation::VirtualFP) {
- assert(!Src.isReg() && "Machine move not supported yet.");
-
if (Src.getReg() == MachineLocation::VirtualFP) {
OutStreamer.EmitCFIDefCfaOffset(-Src.getOffset());
} else {
- assert("Machine move not supported yet");
// Reg + Offset
+ OutStreamer.EmitCFIDefCfa(RI->getDwarfRegNum(Src.getReg(), true),
+ Src.getOffset());
}
} else if (Src.isReg() && Src.getReg() == MachineLocation::VirtualFP) {
assert(Dst.isReg() && "Machine move not supported yet.");
@@ -303,16 +231,3 @@ void AsmPrinter::EmitCFIFrameMove(const MachineMove &Move) const {
Dst.getOffset());
}
}
-
-/// EmitFrameMoves - Emit frame instructions to describe the layout of the
-/// frame.
-void AsmPrinter::EmitCFIFrameMoves(const std::vector<MachineMove> &Moves) const {
- for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
- const MachineMove &Move = Moves[i];
- MCSymbol *Label = Move.getLabel();
- // Throw out move if the label is invalid.
- if (Label && !Label->isDefined()) continue; // Not emitted, in dead code.
-
- EmitCFIFrameMove(Move);
- }
-}
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
index dbd52c4..91b7d08 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
@@ -41,14 +41,17 @@ using namespace llvm;
DwarfCFIException::DwarfCFIException(AsmPrinter *A)
: DwarfException(A),
- shouldEmitPersonality(false), shouldEmitLSDA(false), shouldEmitMoves(false)
- {}
+ shouldEmitPersonality(false), shouldEmitLSDA(false), shouldEmitMoves(false),
+ moveTypeModule(AsmPrinter::CFI_M_None) {}
DwarfCFIException::~DwarfCFIException() {}
/// EndModule - Emit all exception information that should come after the
/// content.
void DwarfCFIException::EndModule() {
+ if (moveTypeModule == AsmPrinter::CFI_M_Debug)
+ Asm->OutStreamer.EmitCFISections(false, true);
+
if (!Asm->MAI->isExceptionHandlingDwarf())
return;
@@ -87,7 +90,13 @@ void DwarfCFIException::BeginFunction(const MachineFunction *MF) {
bool hasLandingPads = !MMI->getLandingPads().empty();
// See if we need frame move info.
- shouldEmitMoves = Asm->needsCFIMoves();
+ AsmPrinter::CFIMoveType MoveType = Asm->needsCFIMoves();
+ if (MoveType == AsmPrinter::CFI_M_EH ||
+ (MoveType == AsmPrinter::CFI_M_Debug &&
+ moveTypeModule == AsmPrinter::CFI_M_None))
+ moveTypeModule = MoveType;
+
+ shouldEmitMoves = MoveType != AsmPrinter::CFI_M_None;
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
unsigned PerEncoding = TLOF.getPersonalityEncoding();
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 7ce0cfe..bff1a35 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -440,11 +440,27 @@ void CompileUnit::addBlockByrefAddress(DbgVariable *&DV, DIE *Die,
}
/// addConstantValue - Add constant value entry in variable DIE.
-bool CompileUnit::addConstantValue(DIE *Die, const MachineOperand &MO) {
+bool CompileUnit::addConstantValue(DIE *Die, const MachineOperand &MO,
+ DIType Ty) {
assert (MO.isImm() && "Invalid machine operand!");
DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
- unsigned Imm = MO.getImm();
- addUInt(Block, 0, dwarf::DW_FORM_udata, Imm);
+ unsigned form = dwarf::DW_FORM_udata;
+ switch (Ty.getSizeInBits()) {
+ case 8: form = dwarf::DW_FORM_data1; break;
+ case 16: form = dwarf::DW_FORM_data2; break;
+ case 32: form = dwarf::DW_FORM_data4; break;
+ case 64: form = dwarf::DW_FORM_data8; break;
+ default: break;
+ }
+
+ DIBasicType BTy(Ty);
+ if (BTy.Verify() &&
+ (BTy.getEncoding() == dwarf::DW_ATE_signed
+ || BTy.getEncoding() == dwarf::DW_ATE_signed_char))
+ addSInt(Block, 0, form, MO.getImm());
+ else
+ addUInt(Block, 0, form, MO.getImm());
+
addBlock(Die, dwarf::DW_AT_const_value, 0, Block);
return true;
}
@@ -477,13 +493,21 @@ bool CompileUnit::addConstantFPValue(DIE *Die, const MachineOperand &MO) {
/// addConstantValue - Add constant value entry in variable DIE.
bool CompileUnit::addConstantValue(DIE *Die, ConstantInt *CI,
bool Unsigned) {
- if (CI->getBitWidth() <= 64) {
+ unsigned CIBitWidth = CI->getBitWidth();
+ if (CIBitWidth <= 64) {
+ unsigned form = 0;
+ switch (CIBitWidth) {
+ case 8: form = dwarf::DW_FORM_data1; break;
+ case 16: form = dwarf::DW_FORM_data2; break;
+ case 32: form = dwarf::DW_FORM_data4; break;
+ case 64: form = dwarf::DW_FORM_data8; break;
+ default:
+ form = Unsigned ? dwarf::DW_FORM_udata : dwarf::DW_FORM_sdata;
+ }
if (Unsigned)
- addUInt(Die, dwarf::DW_AT_const_value, dwarf::DW_FORM_udata,
- CI->getZExtValue());
+ addUInt(Die, dwarf::DW_AT_const_value, form, CI->getZExtValue());
else
- addSInt(Die, dwarf::DW_AT_const_value, dwarf::DW_FORM_sdata,
- CI->getSExtValue());
+ addSInt(Die, dwarf::DW_AT_const_value, form, CI->getSExtValue());
return true;
}
@@ -581,8 +605,37 @@ void CompileUnit::addType(DIE *Entity, DIType Ty) {
// Set up proxy.
Entry = createDIEEntry(Buffer);
insertDIEEntry(Ty, Entry);
-
Entity->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, Entry);
+
+ // If this is a complete composite type then include it in the
+ // list of global types.
+ addGlobalType(Ty);
+}
+
+/// addGlobalType - Add a new global type to the compile unit.
+///
+void CompileUnit::addGlobalType(DIType Ty) {
+ DIDescriptor Context = Ty.getContext();
+ if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl()
+ && (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace()))
+ if (DIEEntry *Entry = getDIEEntry(Ty))
+ GlobalTypes[Ty.getName()] = Entry->getEntry();
+}
+
+/// addPubTypes - Add type for pubtypes section.
+void CompileUnit::addPubTypes(DISubprogram SP) {
+ DICompositeType SPTy = SP.getType();
+ unsigned SPTag = SPTy.getTag();
+ if (SPTag != dwarf::DW_TAG_subroutine_type)
+ return;
+
+ DIArray Args = SPTy.getTypeArray();
+ for (unsigned i = 0, e = Args.getNumElements(); i != e; ++i) {
+ DIType ATy(Args.getElement(i));
+ if (!ATy.Verify())
+ continue;
+ addGlobalType(ATy);
+ }
}
/// constructTypeDIE - Construct basic type die from DIBasicType.
@@ -745,6 +798,10 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
addToContextOwner(&Buffer, Context);
}
+ if (CTy.isObjcClassComplete())
+ addUInt(&Buffer, dwarf::DW_AT_APPLE_objc_complete_type,
+ dwarf::DW_FORM_flag, 1);
+
if (Tag == dwarf::DW_TAG_class_type)
addTemplateParams(Buffer, CTy.getTemplateParams());
@@ -809,6 +866,20 @@ CompileUnit::getOrCreateTemplateValueParameterDIE(DITemplateValueParameter TPV)
return ParamDIE;
}
+/// getOrCreateNameSpace - Create a DIE for DINameSpace.
+DIE *CompileUnit::getOrCreateNameSpace(DINameSpace NS) {
+ DIE *NDie = getDIE(NS);
+ if (NDie)
+ return NDie;
+ NDie = new DIE(dwarf::DW_TAG_namespace);
+ insertDIE(NS, NDie);
+ if (!NS.getName().empty())
+ addString(NDie, dwarf::DW_AT_name, dwarf::DW_FORM_string, NS.getName());
+ addSourceLine(NDie, NS);
+ addToContextOwner(NDie, NS.getContext());
+ return NDie;
+}
+
/// constructSubrangeDIE - Construct subrange DIE from DISubrange.
void CompileUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy){
DIE *DW_Subrange = new DIE(dwarf::DW_TAG_subrange_type);
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index f4f6fb8..60a9b28 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -87,9 +87,7 @@ public:
/// addGlobalType - Add a new global type to the compile unit.
///
- void addGlobalType(StringRef Name, DIE *Die) {
- GlobalTypes[Name] = Die;
- }
+ void addGlobalType(DIType Ty);
/// getDIE - Returns the debug information entry map slot for the
/// specified debug variable.
@@ -104,7 +102,7 @@ public:
MDNodeToDieMap.insert(std::make_pair(N, D));
}
- /// getDIEEntry - Returns the debug information entry for the speciefied
+ /// getDIEEntry - Returns the debug information entry for the specified
/// debug variable.
DIEEntry *getDIEEntry(const MDNode *N) {
DenseMap<const MDNode *, DIEEntry *>::iterator I =
@@ -182,7 +180,7 @@ public:
const MachineLocation &Location);
/// addConstantValue - Add constant value entry in variable DIE.
- bool addConstantValue(DIE *Die, const MachineOperand &MO);
+ bool addConstantValue(DIE *Die, const MachineOperand &MO, DIType Ty);
bool addConstantValue(DIE *Die, ConstantInt *CI, bool Unsigned);
/// addConstantFPValue - Add constant value entry in variable DIE.
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 26da800..8845bfa 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -56,10 +56,6 @@ static cl::opt<bool> UnknownLocations("use-unknown-locations", cl::Hidden,
cl::desc("Make an absence of debug location information explicit."),
cl::init(false));
-#ifndef NDEBUG
-STATISTIC(BlocksWithoutLineNo, "Number of blocks without any line number");
-#endif
-
namespace {
const char *DWARFGroupName = "DWARF Emission";
const char *DbgTimerName = "DWARF Debug Writer";
@@ -260,7 +256,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
CurrentFnDbgScope(0), PrevLabel(NULL) {
NextStringPoolNumber = 0;
- DwarfFrameSectionSym = DwarfInfoSectionSym = DwarfAbbrevSectionSym = 0;
+ DwarfInfoSectionSym = DwarfAbbrevSectionSym = 0;
DwarfStrSectionSym = TextSectionSym = 0;
DwarfDebugRangeSectionSym = DwarfDebugLocSectionSym = 0;
FunctionBeginSym = FunctionEndSym = 0;
@@ -332,6 +328,11 @@ DIE *DwarfDebug::createSubprogramDIE(DISubprogram SP) {
// Add function template parameters.
SPCU->addTemplateParams(*SPDie, SP.getTemplateParams());
+ StringRef LinkageName = SP.getLinkageName();
+ if (!LinkageName.empty())
+ SPCU->addString(SPDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
+ getRealLinkageName(LinkageName));
+
// If this DIE is going to refer declaration info using AT_specification
// then there is no need to add other attributes.
if (SP.getFunctionDeclaration().isSubprogram())
@@ -342,11 +343,6 @@ DIE *DwarfDebug::createSubprogramDIE(DISubprogram SP) {
SPCU->addString(SPDie, dwarf::DW_AT_name, dwarf::DW_FORM_string,
SP.getName());
- StringRef LinkageName = SP.getLinkageName();
- if (!LinkageName.empty())
- SPCU->addString(SPDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
- getRealLinkageName(LinkageName));
-
SPCU->addSourceLine(SPDie, SP);
if (SP.isPrototyped())
@@ -588,12 +584,14 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
if (!Scope->getScopeNode())
return NULL;
DIScope DS(Scope->getScopeNode());
- DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine);
-
DISubprogram InlinedSP = getDISubprogram(DS);
CompileUnit *TheCU = getCompileUnit(InlinedSP);
DIE *OriginDIE = TheCU->getDIE(InlinedSP);
- assert(OriginDIE && "Unable to find Origin DIE!");
+ if (!OriginDIE) {
+ DEBUG(dbgs() << "Unable to find original DIE for inlined subprogram.");
+ return NULL;
+ }
+ DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine);
TheCU->addDIEEntry(ScopeDIE, dwarf::DW_AT_abstract_origin,
dwarf::DW_FORM_ref4, OriginDIE);
@@ -714,8 +712,9 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
updated = true;
}
else if (DVInsn->getOperand(0).isImm())
- updated = VariableCU->addConstantValue(VariableDie,
- DVInsn->getOperand(0));
+ updated =
+ VariableCU->addConstantValue(VariableDie, DVInsn->getOperand(0),
+ DV->getType());
else if (DVInsn->getOperand(0).isFPImm())
updated =
VariableCU->addConstantFPValue(VariableDie, DVInsn->getOperand(0));
@@ -750,26 +749,6 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
}
-void CompileUnit::addPubTypes(DISubprogram SP) {
- DICompositeType SPTy = SP.getType();
- unsigned SPTag = SPTy.getTag();
- if (SPTag != dwarf::DW_TAG_subroutine_type)
- return;
-
- DIArray Args = SPTy.getTypeArray();
- for (unsigned i = 0, e = Args.getNumElements(); i != e; ++i) {
- DIType ATy(Args.getElement(i));
- if (!ATy.Verify())
- continue;
- DICompositeType CATy = getDICompositeType(ATy);
- if (DIDescriptor(CATy).Verify() && !CATy.getName().empty()
- && !CATy.isForwardDecl()) {
- if (DIEEntry *Entry = getDIEEntry(CATy))
- addGlobalType(CATy.getName(), Entry->getEntry());
- }
- }
-}
-
/// constructScopeDIE - Construct a DIE for this scope.
DIE *DwarfDebug::constructScopeDIE(DbgScope *Scope) {
if (!Scope || !Scope->getScopeNode())
@@ -840,11 +819,9 @@ unsigned DwarfDebug::GetOrCreateSourceID(StringRef FileName,
return GetOrCreateSourceID("<stdin>", StringRef());
// MCStream expects full path name as filename.
- if (!DirName.empty() && !FileName.startswith("/")) {
- std::string FullPathName(DirName.data());
- if (!DirName.endswith("/"))
- FullPathName += "/";
- FullPathName += FileName.data();
+ if (!DirName.empty() && !sys::path::is_absolute(FileName)) {
+ SmallString<128> FullPathName = DirName;
+ sys::path::append(FullPathName, FileName);
// Here FullPathName will be copied into StringMap by GetOrCreateSourceID.
return GetOrCreateSourceID(StringRef(FullPathName), StringRef());
}
@@ -862,20 +839,6 @@ unsigned DwarfDebug::GetOrCreateSourceID(StringRef FileName,
return SrcId;
}
-/// getOrCreateNameSpace - Create a DIE for DINameSpace.
-DIE *CompileUnit::getOrCreateNameSpace(DINameSpace NS) {
- DIE *NDie = getDIE(NS);
- if (NDie)
- return NDie;
- NDie = new DIE(dwarf::DW_TAG_namespace);
- insertDIE(NS, NDie);
- if (!NS.getName().empty())
- addString(NDie, dwarf::DW_AT_name, dwarf::DW_FORM_string, NS.getName());
- addSourceLine(NDie, NS);
- addToContextOwner(NDie, NS.getContext());
- return NDie;
-}
-
/// constructCompileUnit - Create new CompileUnit for the given
/// metadata node with tag DW_TAG_compile_unit.
void DwarfDebug::constructCompileUnit(const MDNode *N) {
@@ -896,8 +859,8 @@ void DwarfDebug::constructCompileUnit(const MDNode *N) {
NewCU->addUInt(Die, dwarf::DW_AT_entry_pc, dwarf::DW_FORM_addr, 0);
// DW_AT_stmt_list is a offset of line number information for this
// compile unit in debug_line section.
- if (Asm->MAI->doesDwarfUsesAbsoluteLabelForStmtList())
- NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_addr,
+ if(Asm->MAI->doesDwarfRequireRelocationForSectionOffset())
+ NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,
Asm->GetTempSymbol("section_line"));
else
NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
@@ -1020,12 +983,7 @@ void DwarfDebug::constructGlobalVariableDIE(const MDNode *N) {
getRealLinkageName(LinkageName));
// Add type.
TheCU->addType(VariableDIE, GTy);
- if (GTy.isCompositeType() && !GTy.getName().empty()
- && !GTy.isForwardDecl()) {
- DIEEntry *Entry = TheCU->getDIEEntry(GTy);
- assert(Entry && "Missing global type!");
- TheCU->addGlobalType(GTy.getName(), Entry->getEntry());
- }
+
// Add scoping info.
if (!GV.isLocalToUnit()) {
TheCU->addUInt(VariableDIE, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1);
@@ -1113,44 +1071,68 @@ void DwarfDebug::beginModule(Module *M) {
if (DisableDebugInfoPrinting)
return;
- DebugInfoFinder DbgFinder;
- DbgFinder.processModule(*M);
+ // If module has named metadata anchors then use them, otherwise scan the module
+ // using debug info finder to collect debug info.
+ NamedMDNode *CU_Nodes = M->getNamedMetadata("llvm.dbg.cu");
+ if (CU_Nodes) {
- bool HasDebugInfo = false;
+ NamedMDNode *GV_Nodes = M->getNamedMetadata("llvm.dbg.gv");
+ NamedMDNode *SP_Nodes = M->getNamedMetadata("llvm.dbg.sp");
+ if (!GV_Nodes && !SP_Nodes)
+ // If there are not any global variables or any functions then
+ // there is not any debug info in this module.
+ return;
- // Scan all the compile-units to see if there are any marked as the main unit.
- // if not, we do not generate debug info.
- for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
- E = DbgFinder.compile_unit_end(); I != E; ++I) {
- if (DICompileUnit(*I).isMain()) {
- HasDebugInfo = true;
- break;
- }
- }
+ for (unsigned i = 0, e = CU_Nodes->getNumOperands(); i != e; ++i)
+ constructCompileUnit(CU_Nodes->getOperand(i));
- if (!HasDebugInfo) return;
+ if (GV_Nodes)
+ for (unsigned i = 0, e = GV_Nodes->getNumOperands(); i != e; ++i)
+ constructGlobalVariableDIE(GV_Nodes->getOperand(i));
+
+ if (SP_Nodes)
+ for (unsigned i = 0, e = SP_Nodes->getNumOperands(); i != e; ++i)
+ constructSubprogramDIE(SP_Nodes->getOperand(i));
+
+ } else {
+ DebugInfoFinder DbgFinder;
+ DbgFinder.processModule(*M);
+
+ bool HasDebugInfo = false;
+ // Scan all the compile-units to see if there are any marked as the main unit.
+ // if not, we do not generate debug info.
+ for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
+ E = DbgFinder.compile_unit_end(); I != E; ++I) {
+ if (DICompileUnit(*I).isMain()) {
+ HasDebugInfo = true;
+ break;
+ }
+ }
+ if (!HasDebugInfo) return;
+
+ // Create all the compile unit DIEs.
+ for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
+ E = DbgFinder.compile_unit_end(); I != E; ++I)
+ constructCompileUnit(*I);
+
+ // Create DIEs for each global variable.
+ for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(),
+ E = DbgFinder.global_variable_end(); I != E; ++I)
+ constructGlobalVariableDIE(*I);
+
+ // Create DIEs for each subprogram.
+ for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(),
+ E = DbgFinder.subprogram_end(); I != E; ++I)
+ constructSubprogramDIE(*I);
+ }
+
// Tell MMI that we have debug info.
MMI->setDebugInfoAvailability(true);
-
+
// Emit initial sections.
EmitSectionLabels();
- // Create all the compile unit DIEs.
- for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
- E = DbgFinder.compile_unit_end(); I != E; ++I)
- constructCompileUnit(*I);
-
- // Create DIEs for each subprogram.
- for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(),
- E = DbgFinder.subprogram_end(); I != E; ++I)
- constructSubprogramDIE(*I);
-
- // Create DIEs for each global variable.
- for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(),
- E = DbgFinder.global_variable_end(); I != E; ++I)
- constructGlobalVariableDIE(*I);
-
//getOrCreateTypeDIE
if (NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.enum"))
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
@@ -1239,14 +1221,6 @@ void DwarfDebug::endModule() {
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("section_end", i));
}
- // Emit common frame information.
- emitCommonDebugFrame();
-
- // Emit function debug frame information
- for (std::vector<FunctionDebugFrameInfo>::iterator I = DebugFrames.begin(),
- E = DebugFrames.end(); I != E; ++I)
- emitFunctionDebugFrame(*I);
-
// Compute DIE offsets and sizes.
computeSizeAndOffsets();
@@ -1434,15 +1408,10 @@ DwarfDebug::collectVariableInfo(const MachineFunction *MF,
HI = History.begin(), HE = History.end(); HI != HE; ++HI) {
const MachineInstr *Begin = *HI;
assert(Begin->isDebugValue() && "Invalid History entry");
- MachineLocation MLoc;
- if (Begin->getNumOperands() == 3) {
- if (Begin->getOperand(0).isReg() && Begin->getOperand(1).isImm())
- MLoc.set(Begin->getOperand(0).getReg(), Begin->getOperand(1).getImm());
- } else
- MLoc = Asm->getDebugValueLocation(Begin);
- // FIXME: emitDebugLoc only understands registers.
- if (!MLoc.getReg())
+ // Check if DBG_VALUE is truncating a range.
+ if (Begin->getNumOperands() > 1 && Begin->getOperand(0).isReg()
+ && !Begin->getOperand(0).getReg())
continue;
// Compute the range for a register location.
@@ -1466,7 +1435,25 @@ DwarfDebug::collectVariableInfo(const MachineFunction *MF,
}
// The value is valid until the next DBG_VALUE or clobber.
- DotDebugLocEntries.push_back(DotDebugLocEntry(FLabel, SLabel, MLoc, Var));
+ MachineLocation MLoc;
+ if (Begin->getNumOperands() == 3) {
+ if (Begin->getOperand(0).isReg() && Begin->getOperand(1).isImm()) {
+ MLoc.set(Begin->getOperand(0).getReg(),
+ Begin->getOperand(1).getImm());
+ DotDebugLocEntries.
+ push_back(DotDebugLocEntry(FLabel, SLabel, MLoc, Var));
+ }
+ // FIXME: Handle isFPImm also.
+ else if (Begin->getOperand(0).isImm()) {
+ DotDebugLocEntries.
+ push_back(DotDebugLocEntry(FLabel, SLabel,
+ Begin->getOperand(0).getImm()));
+ }
+ } else {
+ MLoc = Asm->getDebugValueLocation(Begin);
+ DotDebugLocEntries.
+ push_back(DotDebugLocEntry(FLabel, SLabel, MLoc, Var));
+ }
}
DotDebugLocEntries.push_back(DotDebugLocEntry());
}
@@ -1503,12 +1490,17 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
if (!MI->isDebugValue()) {
DebugLoc DL = MI->getDebugLoc();
if (DL != PrevInstLoc && (!DL.isUnknown() || UnknownLocations)) {
+ unsigned Flags = DWARF2_FLAG_IS_STMT;
PrevInstLoc = DL;
+ if (DL == PrologEndLoc) {
+ Flags |= DWARF2_FLAG_PROLOGUE_END;
+ PrologEndLoc = DebugLoc();
+ }
if (!DL.isUnknown()) {
const MDNode *Scope = DL.getScope(Asm->MF->getFunction()->getContext());
- recordSourceLine(DL.getLine(), DL.getCol(), Scope);
+ recordSourceLine(DL.getLine(), DL.getCol(), Scope, Flags);
} else
- recordSourceLine(0, 0, 0);
+ recordSourceLine(0, 0, 0, 0);
}
}
@@ -1820,41 +1812,22 @@ void DwarfDebug::identifyScopeMarkers() {
}
}
-/// FindFirstDebugLoc - Find the first debug location in the function. This
-/// is intended to be an approximation for the source position of the
-/// beginning of the function.
-static DebugLoc FindFirstDebugLoc(const MachineFunction *MF) {
- for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
- I != E; ++I)
- for (MachineBasicBlock::const_iterator MBBI = I->begin(), MBBE = I->end();
- MBBI != MBBE; ++MBBI) {
- DebugLoc DL = MBBI->getDebugLoc();
- if (!DL.isUnknown())
- return DL;
- }
- return DebugLoc();
+/// getScopeNode - Get MDNode for DebugLoc's scope.
+static MDNode *getScopeNode(DebugLoc DL, const LLVMContext &Ctx) {
+ if (MDNode *InlinedAt = DL.getInlinedAt(Ctx))
+ return getScopeNode(DebugLoc::getFromDILocation(InlinedAt), Ctx);
+ return DL.getScope(Ctx);
}
-#ifndef NDEBUG
-/// CheckLineNumbers - Count basicblocks whose instructions do not have any
-/// line number information.
-static void CheckLineNumbers(const MachineFunction *MF) {
- for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
- I != E; ++I) {
- bool FoundLineNo = false;
- for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
- II != IE; ++II) {
- const MachineInstr *MI = II;
- if (!MI->getDebugLoc().isUnknown()) {
- FoundLineNo = true;
- break;
- }
- }
- if (!FoundLineNo && I->size())
- ++BlocksWithoutLineNo;
- }
+/// getFnDebugLoc - Walk up the scope chain of given debug loc and find
+/// line number info for the function.
+static DebugLoc getFnDebugLoc(DebugLoc DL, const LLVMContext &Ctx) {
+ const MDNode *Scope = getScopeNode(DL, Ctx);
+ DISubprogram SP = getDISubprogram(Scope);
+ if (SP.Verify())
+ return DebugLoc::get(SP.getLineNumber(), 0, SP);
+ return DebugLoc();
}
-#endif
/// beginFunction - Gather pre-function debug information. Assumes being
/// emitted immediately after the function entry point.
@@ -1862,44 +1835,16 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
if (!MMI->hasDebugInfo()) return;
if (!extractScopeInformation()) return;
-#ifndef NDEBUG
- CheckLineNumbers(MF);
-#endif
-
FunctionBeginSym = Asm->GetTempSymbol("func_begin",
Asm->getFunctionNumber());
// Assumes in correct section after the entry point.
Asm->OutStreamer.EmitLabel(FunctionBeginSym);
- // Emit label for the implicitly defined dbg.stoppoint at the start of the
- // function.
- DebugLoc FDL = FindFirstDebugLoc(MF);
- if (FDL.isUnknown()) return;
-
- const MDNode *Scope = FDL.getScope(MF->getFunction()->getContext());
- const MDNode *TheScope = 0;
-
- DISubprogram SP = getDISubprogram(Scope);
- unsigned Line, Col;
- if (SP.Verify()) {
- Line = SP.getLineNumber();
- Col = 0;
- TheScope = SP;
- } else {
- Line = FDL.getLine();
- Col = FDL.getCol();
- TheScope = Scope;
- }
-
- recordSourceLine(Line, Col, TheScope);
-
assert(UserVariables.empty() && DbgValues.empty() && "Maps weren't cleaned");
/// ProcessedArgs - Collection of arguments already processed.
SmallPtrSet<const MDNode *, 8> ProcessedArgs;
-
const TargetRegisterInfo *TRI = Asm->TM.getRegisterInfo();
-
/// LiveUserVar - Map physreg numbers to the MDNode they contain.
std::vector<const MDNode*> LiveUserVar(TRI->getNumRegs());
@@ -1965,6 +1910,11 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
if (!MI->isLabel())
AtBlockEntry = false;
+ // First known non DBG_VALUE location marks beginning of function
+ // body.
+ if (PrologEndLoc.isUnknown() && !MI->getDebugLoc().isUnknown())
+ PrologEndLoc = MI->getDebugLoc();
+
// Check if the instruction clobbers any registers with debug vars.
for (MachineInstr::const_mop_iterator MOI = MI->operands_begin(),
MOE = MI->operands_end(); MOI != MOE; ++MOI) {
@@ -2033,6 +1983,15 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
PrevInstLoc = DebugLoc();
PrevLabel = FunctionBeginSym;
+
+ // Record beginning of function.
+ if (!PrologEndLoc.isUnknown()) {
+ DebugLoc FnStartDL = getFnDebugLoc(PrologEndLoc,
+ MF->getFunction()->getContext());
+ recordSourceLine(FnStartDL.getLine(), FnStartDL.getCol(),
+ FnStartDL.getScope(MF->getFunction()->getContext()),
+ DWARF2_FLAG_IS_STMT);
+ }
}
/// endFunction - Gather and emit post-function debug information.
@@ -2147,7 +2106,8 @@ DbgScope *DwarfDebug::findDbgScope(const MachineInstr *MInsn) {
/// recordSourceLine - Register a source line with debug info. Returns the
/// unique label that was emitted and which provides correspondence to
/// the source line list.
-void DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, const MDNode *S){
+void DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, const MDNode *S,
+ unsigned Flags) {
StringRef Fn;
StringRef Dir;
unsigned Src = 1;
@@ -2175,7 +2135,7 @@ void DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, const MDNode *S){
Src = GetOrCreateSourceID(Fn, Dir);
}
- Asm->OutStreamer.EmitDwarfLocDirective(Src, Line, Col, DWARF2_FLAG_IS_STMT,
+ Asm->OutStreamer.EmitDwarfLocDirective(Src, Line, Col, Flags,
0, 0, Fn);
}
@@ -2264,11 +2224,6 @@ void DwarfDebug::EmitSectionLabels() {
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
// Dwarf sections base addresses.
- if (Asm->MAI->doesDwarfRequireFrameSection()) {
- DwarfFrameSectionSym =
- EmitSectionSym(Asm, TLOF.getDwarfFrameSection(), "section_debug_frame");
- }
-
DwarfInfoSectionSym =
EmitSectionSym(Asm, TLOF.getDwarfInfoSection(), "section_info");
DwarfAbbrevSectionSym =
@@ -2476,91 +2431,6 @@ void DwarfDebug::emitEndOfLineMatrix(unsigned SectionEnd) {
Asm->EmitInt8(1);
}
-/// emitCommonDebugFrame - Emit common frame info into a debug frame section.
-///
-void DwarfDebug::emitCommonDebugFrame() {
- if (!Asm->MAI->doesDwarfRequireFrameSection())
- return;
-
- int stackGrowth = Asm->getTargetData().getPointerSize();
- if (Asm->TM.getFrameLowering()->getStackGrowthDirection() ==
- TargetFrameLowering::StackGrowsDown)
- stackGrowth *= -1;
-
- // Start the dwarf frame section.
- Asm->OutStreamer.SwitchSection(
- Asm->getObjFileLowering().getDwarfFrameSection());
-
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_frame_common"));
- Asm->OutStreamer.AddComment("Length of Common Information Entry");
- Asm->EmitLabelDifference(Asm->GetTempSymbol("debug_frame_common_end"),
- Asm->GetTempSymbol("debug_frame_common_begin"), 4);
-
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_frame_common_begin"));
- Asm->OutStreamer.AddComment("CIE Identifier Tag");
- Asm->EmitInt32((int)dwarf::DW_CIE_ID);
- Asm->OutStreamer.AddComment("CIE Version");
- Asm->EmitInt8(dwarf::DW_CIE_VERSION);
- Asm->OutStreamer.AddComment("CIE Augmentation");
- Asm->OutStreamer.EmitIntValue(0, 1, /*addrspace*/0); // nul terminator.
- Asm->EmitULEB128(1, "CIE Code Alignment Factor");
- Asm->EmitSLEB128(stackGrowth, "CIE Data Alignment Factor");
- Asm->OutStreamer.AddComment("CIE RA Column");
- const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
- const TargetFrameLowering *TFI = Asm->TM.getFrameLowering();
- Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), false));
-
- std::vector<MachineMove> Moves;
- TFI->getInitialFrameState(Moves);
-
- Asm->EmitFrameMoves(Moves, 0, false);
-
- Asm->EmitAlignment(2);
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_frame_common_end"));
-}
-
-/// emitFunctionDebugFrame - Emit per function frame info into a debug frame
-/// section.
-void DwarfDebug::
-emitFunctionDebugFrame(const FunctionDebugFrameInfo &DebugFrameInfo) {
- if (!Asm->MAI->doesDwarfRequireFrameSection())
- return;
-
- // Start the dwarf frame section.
- Asm->OutStreamer.SwitchSection(
- Asm->getObjFileLowering().getDwarfFrameSection());
-
- Asm->OutStreamer.AddComment("Length of Frame Information Entry");
- MCSymbol *DebugFrameBegin =
- Asm->GetTempSymbol("debug_frame_begin", DebugFrameInfo.Number);
- MCSymbol *DebugFrameEnd =
- Asm->GetTempSymbol("debug_frame_end", DebugFrameInfo.Number);
- Asm->EmitLabelDifference(DebugFrameEnd, DebugFrameBegin, 4);
-
- Asm->OutStreamer.EmitLabel(DebugFrameBegin);
-
- Asm->OutStreamer.AddComment("FDE CIE offset");
- Asm->EmitSectionOffset(Asm->GetTempSymbol("debug_frame_common"),
- DwarfFrameSectionSym);
-
- Asm->OutStreamer.AddComment("FDE initial location");
- MCSymbol *FuncBeginSym =
- Asm->GetTempSymbol("func_begin", DebugFrameInfo.Number);
- Asm->OutStreamer.EmitSymbolValue(FuncBeginSym,
- Asm->getTargetData().getPointerSize(),
- 0/*AddrSpace*/);
-
-
- Asm->OutStreamer.AddComment("FDE address range");
- Asm->EmitLabelDifference(Asm->GetTempSymbol("func_end",DebugFrameInfo.Number),
- FuncBeginSym, Asm->getTargetData().getPointerSize());
-
- Asm->EmitFrameMoves(DebugFrameInfo.Moves, FuncBeginSym, false);
-
- Asm->EmitAlignment(2);
- Asm->OutStreamer.EmitLabel(DebugFrameEnd);
-}
-
/// emitDebugPubNames - Emit visible names into a debug pubnames section.
///
void DwarfDebug::emitDebugPubNames() {
@@ -2722,20 +2592,44 @@ void DwarfDebug::emitDebugLoc() {
Asm->OutStreamer.EmitSymbolValue(Entry.Begin, Size, 0);
Asm->OutStreamer.EmitSymbolValue(Entry.End, Size, 0);
DIVariable DV(Entry.Variable);
- if (DV.hasComplexAddress()) {
+ Asm->OutStreamer.AddComment("Loc expr size");
+ MCSymbol *begin = Asm->OutStreamer.getContext().CreateTempSymbol();
+ MCSymbol *end = Asm->OutStreamer.getContext().CreateTempSymbol();
+ Asm->EmitLabelDifference(end, begin, 2);
+ Asm->OutStreamer.EmitLabel(begin);
+ if (Entry.isConstant()) {
+ DIBasicType BTy(DV.getType());
+ if (BTy.Verify() &&
+ (BTy.getEncoding() == dwarf::DW_ATE_signed
+ || BTy.getEncoding() == dwarf::DW_ATE_signed_char)) {
+ Asm->OutStreamer.AddComment("DW_OP_consts");
+ Asm->EmitInt8(dwarf::DW_OP_consts);
+ Asm->EmitSLEB128(Entry.getConstant());
+ } else {
+ Asm->OutStreamer.AddComment("DW_OP_constu");
+ Asm->EmitInt8(dwarf::DW_OP_constu);
+ Asm->EmitULEB128(Entry.getConstant());
+ }
+ } else if (DV.hasComplexAddress()) {
unsigned N = DV.getNumAddrElements();
unsigned i = 0;
- Asm->OutStreamer.AddComment("Loc expr size");
if (N >= 2 && DV.getAddrElement(0) == DIBuilder::OpPlus) {
- // If first address element is OpPlus then emit
- // DW_OP_breg + Offset instead of DW_OP_reg + Offset.
- MachineLocation Loc(Entry.Loc.getReg(), DV.getAddrElement(1));
- Asm->EmitInt16(Asm->getDwarfRegOpSize(Loc) + N - 2);
- Asm->EmitDwarfRegOp(Loc);
-// Asm->EmitULEB128(DV.getAddrElement(1));
- i = 2;
+ if (Entry.Loc.getOffset()) {
+ i = 2;
+ Asm->EmitDwarfRegOp(Entry.Loc);
+ Asm->OutStreamer.AddComment("DW_OP_deref");
+ Asm->EmitInt8(dwarf::DW_OP_deref);
+ Asm->OutStreamer.AddComment("DW_OP_plus_uconst");
+ Asm->EmitInt8(dwarf::DW_OP_plus_uconst);
+ Asm->EmitSLEB128(DV.getAddrElement(1));
+ } else {
+ // If first address element is OpPlus then emit
+ // DW_OP_breg + Offset instead of DW_OP_reg + Offset.
+ MachineLocation Loc(Entry.Loc.getReg(), DV.getAddrElement(1));
+ Asm->EmitDwarfRegOp(Loc);
+ i = 2;
+ }
} else {
- Asm->EmitInt16(Asm->getDwarfRegOpSize(Entry.Loc) + N);
Asm->EmitDwarfRegOp(Entry.Loc);
}
@@ -2750,10 +2644,10 @@ void DwarfDebug::emitDebugLoc() {
else llvm_unreachable("unknown Opcode found in complex address");
}
} else {
- Asm->OutStreamer.AddComment("Loc expr size");
- Asm->EmitInt16(Asm->getDwarfRegOpSize(Entry.Loc));
+ // Regular entry.
Asm->EmitDwarfRegOp(Entry.Loc);
}
+ Asm->OutStreamer.EmitLabel(end);
}
}
}
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 25f2675..abda2e6 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -68,10 +68,19 @@ typedef struct DotDebugLocEntry {
MachineLocation Loc;
const MDNode *Variable;
bool Merged;
- DotDebugLocEntry() : Begin(0), End(0), Variable(0), Merged(false) {}
+ bool Constant;
+ int64_t iConstant;
+ DotDebugLocEntry()
+ : Begin(0), End(0), Variable(0), Merged(false),
+ Constant(false), iConstant(0) {}
DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, MachineLocation &L,
const MDNode *V)
- : Begin(B), End(E), Loc(L), Variable(V), Merged(false) {}
+ : Begin(B), End(E), Loc(L), Variable(V), Merged(false),
+ Constant(false), iConstant(0) {}
+ DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, int64_t i)
+ : Begin(B), End(E), Variable(0), Merged(false),
+ Constant(true), iConstant(i) {}
+
/// Empty entries are also used as a trigger to emit temp label. Such
/// labels are referenced is used to find debug_loc offset for a given DIE.
bool isEmpty() { return Begin == 0 && End == 0; }
@@ -82,6 +91,8 @@ typedef struct DotDebugLocEntry {
Next->Begin = Begin;
Merged = true;
}
+ bool isConstant() { return Constant; }
+ int64_t getConstant() { return iConstant; }
} DotDebugLocEntry;
//===----------------------------------------------------------------------===//
@@ -253,6 +264,10 @@ class DwarfDebug {
DebugLoc PrevInstLoc;
MCSymbol *PrevLabel;
+ /// PrologEndLoc - This location indicates end of function prologue and
+ /// beginning of function body.
+ DebugLoc PrologEndLoc;
+
struct FunctionDebugFrameInfo {
unsigned Number;
std::vector<MachineMove> Moves;
@@ -269,7 +284,7 @@ class DwarfDebug {
// Section Symbols: these are assembler temporary labels that are emitted at
// the beginning of each supported dwarf section. These are used to form
// section offsets and are created by EmitSectionLabels.
- MCSymbol *DwarfFrameSectionSym, *DwarfInfoSectionSym, *DwarfAbbrevSectionSym;
+ MCSymbol *DwarfInfoSectionSym, *DwarfAbbrevSectionSym;
MCSymbol *DwarfStrSectionSym, *TextSectionSym, *DwarfDebugRangeSectionSym;
MCSymbol *DwarfDebugLocSectionSym;
MCSymbol *FunctionBeginSym, *FunctionEndSym;
@@ -338,14 +353,6 @@ private:
///
void emitEndOfLineMatrix(unsigned SectionEnd);
- /// emitCommonDebugFrame - Emit common frame info into a debug frame section.
- ///
- void emitCommonDebugFrame();
-
- /// emitFunctionDebugFrame - Emit per function frame info into a debug frame
- /// section.
- void emitFunctionDebugFrame(const FunctionDebugFrameInfo &DebugFrameInfo);
-
/// emitDebugPubNames - Emit visible names into a debug pubnames section.
///
void emitDebugPubNames();
@@ -410,7 +417,8 @@ private:
/// recordSourceLine - Register a source line with debug info. Returns the
/// unique label that was emitted and which provides correspondence to
/// the source line list.
- void recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope);
+ void recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope,
+ unsigned Flags);
/// recordVariableFrameIndex - Record a variable's index.
void recordVariableFrameIndex(const DbgVariable *V, int Index);
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h
index f111641..b5f86ab 100644
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h
@@ -15,6 +15,7 @@
#define LLVM_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/CodeGen/AsmPrinter.h"
#include <vector>
namespace llvm {
@@ -152,6 +153,8 @@ class DwarfCFIException : public DwarfException {
/// should be emitted.
bool shouldEmitMoves;
+ AsmPrinter::CFIMoveType moveTypeModule;
+
public:
//===--------------------------------------------------------------------===//
// Main entry points.
@@ -171,7 +174,7 @@ public:
virtual void EndFunction();
};
-class DwarfTableException : public DwarfException {
+class ARMException : public DwarfException {
/// shouldEmitTable - Per-function flag to indicate if EH tables should
/// be emitted.
bool shouldEmitTable;
@@ -183,48 +186,12 @@ class DwarfTableException : public DwarfException {
/// shouldEmitTableModule - Per-module flag to indicate if EH tables
/// should be emitted.
bool shouldEmitTableModule;
-
- /// shouldEmitMovesModule - Per-module flag to indicate if frame moves
- /// should be emitted.
- bool shouldEmitMovesModule;
-
- struct FunctionEHFrameInfo {
- MCSymbol *FunctionEHSym; // L_foo.eh
- unsigned Number;
- unsigned PersonalityIndex;
- bool adjustsStack;
- bool hasLandingPads;
- std::vector<MachineMove> Moves;
- const Function *function;
-
- FunctionEHFrameInfo(MCSymbol *EHSym, unsigned Num, unsigned P,
- bool hC, bool hL,
- const std::vector<MachineMove> &M,
- const Function *f):
- FunctionEHSym(EHSym), Number(Num), PersonalityIndex(P),
- adjustsStack(hC), hasLandingPads(hL), Moves(M), function (f) { }
- };
-
- std::vector<FunctionEHFrameInfo> EHFrames;
-
- /// UsesLSDA - Indicates whether an FDE that uses the CIE at the given index
- /// uses an LSDA. If so, then we need to encode that information in the CIE's
- /// augmentation.
- DenseMap<unsigned, bool> UsesLSDA;
-
- /// EmitCIE - Emit a Common Information Entry (CIE). This holds information
- /// that is shared among many Frame Description Entries. There is at least
- /// one CIE in every non-empty .debug_frame section.
- void EmitCIE(const Function *Personality, unsigned Index);
-
- /// EmitFDE - Emit the Frame Description Entry (FDE) for the function.
- void EmitFDE(const FunctionEHFrameInfo &EHFrameInfo);
public:
//===--------------------------------------------------------------------===//
// Main entry points.
//
- DwarfTableException(AsmPrinter *A);
- virtual ~DwarfTableException();
+ ARMException(AsmPrinter *A);
+ virtual ~ARMException();
/// EndModule - Emit all exception information that should come after the
/// content.
@@ -238,25 +205,25 @@ public:
virtual void EndFunction();
};
+class Win64Exception : public DwarfException {
+ /// shouldEmitPersonality - Per-function flag to indicate if personality
+ /// info should be emitted.
+ bool shouldEmitPersonality;
-class ARMException : public DwarfException {
- /// shouldEmitTable - Per-function flag to indicate if EH tables should
- /// be emitted.
- bool shouldEmitTable;
+ /// shouldEmitLSDA - Per-function flag to indicate if the LSDA
+ /// should be emitted.
+ bool shouldEmitLSDA;
/// shouldEmitMoves - Per-function flag to indicate if frame moves info
/// should be emitted.
bool shouldEmitMoves;
- /// shouldEmitTableModule - Per-module flag to indicate if EH tables
- /// should be emitted.
- bool shouldEmitTableModule;
public:
//===--------------------------------------------------------------------===//
// Main entry points.
//
- ARMException(AsmPrinter *A);
- virtual ~ARMException();
+ Win64Exception(AsmPrinter *A);
+ virtual ~Win64Exception();
/// EndModule - Emit all exception information that should come after the
/// content.
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfTableException.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfTableException.cpp
deleted file mode 100644
index b50d8bd..0000000
--- a/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfTableException.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-//===-- CodeGen/AsmPrinter/DwarfTableException.cpp - Dwarf Exception Impl --==//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains support for writing DWARF exception info into asm files.
-// The implementation emits all the necessary tables "by hands".
-//
-//===----------------------------------------------------------------------===//
-
-#include "DwarfException.h"
-#include "llvm/Module.h"
-#include "llvm/CodeGen/AsmPrinter.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineLocation.h"
-#include "llvm/MC/MCAsmInfo.h"
-#include "llvm/MC/MCContext.h"
-#include "llvm/MC/MCExpr.h"
-#include "llvm/MC/MCSection.h"
-#include "llvm/MC/MCStreamer.h"
-#include "llvm/MC/MCSymbol.h"
-#include "llvm/Target/Mangler.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetFrameLowering.h"
-#include "llvm/Target/TargetLoweringObjectFile.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/Support/Dwarf.h"
-#include "llvm/Support/FormattedStream.h"
-#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/Twine.h"
-using namespace llvm;
-
-DwarfTableException::DwarfTableException(AsmPrinter *A)
- : DwarfException(A),
- shouldEmitTable(false), shouldEmitMoves(false),
- shouldEmitTableModule(false), shouldEmitMovesModule(false) {}
-
-DwarfTableException::~DwarfTableException() {}
-
-/// EmitCIE - Emit a Common Information Entry (CIE). This holds information that
-/// is shared among many Frame Description Entries. There is at least one CIE
-/// in every non-empty .debug_frame section.
-void DwarfTableException::EmitCIE(const Function *PersonalityFn, unsigned Index) {
- // Size and sign of stack growth.
- int stackGrowth = Asm->getTargetData().getPointerSize();
- if (Asm->TM.getFrameLowering()->getStackGrowthDirection() ==
- TargetFrameLowering::StackGrowsDown)
- stackGrowth *= -1;
-
- const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
-
- // Begin eh frame section.
- Asm->OutStreamer.SwitchSection(TLOF.getEHFrameSection());
-
- MCSymbol *EHFrameSym;
- if (TLOF.isFunctionEHFrameSymbolPrivate())
- EHFrameSym = Asm->GetTempSymbol("EH_frame", Index);
- else
- EHFrameSym = Asm->OutContext.GetOrCreateSymbol(Twine("EH_frame") +
- Twine(Index));
- Asm->OutStreamer.EmitLabel(EHFrameSym);
-
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("section_eh_frame", Index));
-
- // Define base labels.
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_frame_common", Index));
-
- // Define the eh frame length.
- Asm->OutStreamer.AddComment("Length of Common Information Entry");
- Asm->EmitLabelDifference(Asm->GetTempSymbol("eh_frame_common_end", Index),
- Asm->GetTempSymbol("eh_frame_common_begin", Index),
- 4);
-
- // EH frame header.
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_frame_common_begin",Index));
- Asm->OutStreamer.AddComment("CIE Identifier Tag");
- Asm->OutStreamer.EmitIntValue(0, 4/*size*/, 0/*addrspace*/);
- Asm->OutStreamer.AddComment("DW_CIE_VERSION");
- Asm->OutStreamer.EmitIntValue(dwarf::DW_CIE_VERSION, 1/*size*/, 0/*addr*/);
-
- // The personality presence indicates that language specific information will
- // show up in the eh frame. Find out how we are supposed to lower the
- // personality function reference:
-
- unsigned LSDAEncoding = TLOF.getLSDAEncoding();
- unsigned FDEEncoding = TLOF.getFDEEncoding(false);
- unsigned PerEncoding = TLOF.getPersonalityEncoding();
-
- char Augmentation[6] = { 0 };
- unsigned AugmentationSize = 0;
- char *APtr = Augmentation + 1;
-
- if (PersonalityFn) {
- // There is a personality function.
- *APtr++ = 'P';
- AugmentationSize += 1 + Asm->GetSizeOfEncodedValue(PerEncoding);
- }
-
- if (UsesLSDA[Index]) {
- // An LSDA pointer is in the FDE augmentation.
- *APtr++ = 'L';
- ++AugmentationSize;
- }
-
- if (FDEEncoding != dwarf::DW_EH_PE_absptr) {
- // A non-default pointer encoding for the FDE.
- *APtr++ = 'R';
- ++AugmentationSize;
- }
-
- if (APtr != Augmentation + 1)
- Augmentation[0] = 'z';
-
- Asm->OutStreamer.AddComment("CIE Augmentation");
- Asm->OutStreamer.EmitBytes(StringRef(Augmentation, strlen(Augmentation)+1),0);
-
- // Round out reader.
- Asm->EmitULEB128(1, "CIE Code Alignment Factor");
- Asm->EmitSLEB128(stackGrowth, "CIE Data Alignment Factor");
- Asm->OutStreamer.AddComment("CIE Return Address Column");
-
- const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
- const TargetFrameLowering *TFI = Asm->TM.getFrameLowering();
- Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), true));
-
- if (Augmentation[0]) {
- Asm->EmitULEB128(AugmentationSize, "Augmentation Size");
-
- // If there is a personality, we need to indicate the function's location.
- if (PersonalityFn) {
- Asm->EmitEncodingByte(PerEncoding, "Personality");
- Asm->OutStreamer.AddComment("Personality");
- Asm->EmitReference(PersonalityFn, PerEncoding);
- }
- if (UsesLSDA[Index])
- Asm->EmitEncodingByte(LSDAEncoding, "LSDA");
- if (FDEEncoding != dwarf::DW_EH_PE_absptr)
- Asm->EmitEncodingByte(FDEEncoding, "FDE");
- }
-
- // Indicate locations of general callee saved registers in frame.
- std::vector<MachineMove> Moves;
- TFI->getInitialFrameState(Moves);
- Asm->EmitFrameMoves(Moves, 0, true);
-
- // On Darwin the linker honors the alignment of eh_frame, which means it must
- // be 8-byte on 64-bit targets to match what gcc does. Otherwise you get
- // holes which confuse readers of eh_frame.
- Asm->EmitAlignment(Asm->getTargetData().getPointerSize() == 4 ? 2 : 3);
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_frame_common_end", Index));
-}
-
-/// EmitFDE - Emit the Frame Description Entry (FDE) for the function.
-void DwarfTableException::EmitFDE(const FunctionEHFrameInfo &EHFrameInfo) {
- assert(!EHFrameInfo.function->hasAvailableExternallyLinkage() &&
- "Should not emit 'available externally' functions at all");
-
- const Function *TheFunc = EHFrameInfo.function;
- const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
-
- unsigned LSDAEncoding = TLOF.getLSDAEncoding();
- unsigned FDEEncoding = TLOF.getFDEEncoding(false);
-
- Asm->OutStreamer.SwitchSection(TLOF.getEHFrameSection());
-
- // Externally visible entry into the functions eh frame info. If the
- // corresponding function is static, this should not be externally visible.
- if (!TheFunc->hasLocalLinkage() && TLOF.isFunctionEHSymbolGlobal())
- Asm->OutStreamer.EmitSymbolAttribute(EHFrameInfo.FunctionEHSym,MCSA_Global);
-
- // If corresponding function is weak definition, this should be too.
- if (TheFunc->isWeakForLinker() && Asm->MAI->getWeakDefDirective())
- Asm->OutStreamer.EmitSymbolAttribute(EHFrameInfo.FunctionEHSym,
- MCSA_WeakDefinition);
-
- // If corresponding function is hidden, this should be too.
- if (TheFunc->hasHiddenVisibility())
- if (MCSymbolAttr HiddenAttr = Asm->MAI->getHiddenVisibilityAttr())
- Asm->OutStreamer.EmitSymbolAttribute(EHFrameInfo.FunctionEHSym,
- HiddenAttr);
-
- // If there are no calls then you can't unwind. This may mean we can omit the
- // EH Frame, but some environments do not handle weak absolute symbols. If
- // UnwindTablesMandatory is set we cannot do this optimization; the unwind
- // info is to be available for non-EH uses.
- if (!EHFrameInfo.adjustsStack && !UnwindTablesMandatory &&
- (!TheFunc->isWeakForLinker() ||
- !Asm->MAI->getWeakDefDirective() ||
- TLOF.getSupportsWeakOmittedEHFrame())) {
- Asm->OutStreamer.EmitAssignment(EHFrameInfo.FunctionEHSym,
- MCConstantExpr::Create(0, Asm->OutContext));
- // This name has no connection to the function, so it might get
- // dead-stripped when the function is not, erroneously. Prohibit
- // dead-stripping unconditionally.
- if (Asm->MAI->hasNoDeadStrip())
- Asm->OutStreamer.EmitSymbolAttribute(EHFrameInfo.FunctionEHSym,
- MCSA_NoDeadStrip);
- } else {
- Asm->OutStreamer.EmitLabel(EHFrameInfo.FunctionEHSym);
-
- // EH frame header.
- Asm->OutStreamer.AddComment("Length of Frame Information Entry");
- Asm->EmitLabelDifference(
- Asm->GetTempSymbol("eh_frame_end", EHFrameInfo.Number),
- Asm->GetTempSymbol("eh_frame_begin", EHFrameInfo.Number), 4);
-
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_frame_begin",
- EHFrameInfo.Number));
-
- Asm->OutStreamer.AddComment("FDE CIE offset");
- Asm->EmitLabelDifference(
- Asm->GetTempSymbol("eh_frame_begin", EHFrameInfo.Number),
- Asm->GetTempSymbol("eh_frame_common",
- EHFrameInfo.PersonalityIndex), 4);
-
- MCSymbol *EHFuncBeginSym =
- Asm->GetTempSymbol("eh_func_begin", EHFrameInfo.Number);
-
- Asm->OutStreamer.AddComment("FDE initial location");
- Asm->EmitReference(EHFuncBeginSym, FDEEncoding);
-
- Asm->OutStreamer.AddComment("FDE address range");
- Asm->EmitLabelDifference(Asm->GetTempSymbol("eh_func_end",
- EHFrameInfo.Number),
- EHFuncBeginSym,
- Asm->GetSizeOfEncodedValue(FDEEncoding));
-
- // If there is a personality and landing pads then point to the language
- // specific data area in the exception table.
- if (MMI->getPersonalities()[0] != NULL) {
- unsigned Size = Asm->GetSizeOfEncodedValue(LSDAEncoding);
-
- Asm->EmitULEB128(Size, "Augmentation size");
- Asm->OutStreamer.AddComment("Language Specific Data Area");
- if (EHFrameInfo.hasLandingPads)
- Asm->EmitReference(Asm->GetTempSymbol("exception", EHFrameInfo.Number),
- LSDAEncoding);
- else
- Asm->OutStreamer.EmitIntValue(0, Size/*size*/, 0/*addrspace*/);
-
- } else {
- Asm->EmitULEB128(0, "Augmentation size");
- }
-
- // Indicate locations of function specific callee saved registers in frame.
- Asm->EmitFrameMoves(EHFrameInfo.Moves, EHFuncBeginSym, true);
-
- // On Darwin the linker honors the alignment of eh_frame, which means it
- // must be 8-byte on 64-bit targets to match what gcc does. Otherwise you
- // get holes which confuse readers of eh_frame.
- Asm->EmitAlignment(Asm->getTargetData().getPointerSize() == 4 ? 2 : 3);
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_frame_end",
- EHFrameInfo.Number));
-
- // If the function is marked used, this table should be also. We cannot
- // make the mark unconditional in this case, since retaining the table also
- // retains the function in this case, and there is code around that depends
- // on unused functions (calling undefined externals) being dead-stripped to
- // link correctly. Yes, there really is.
- if (MMI->isUsedFunction(EHFrameInfo.function))
- if (Asm->MAI->hasNoDeadStrip())
- Asm->OutStreamer.EmitSymbolAttribute(EHFrameInfo.FunctionEHSym,
- MCSA_NoDeadStrip);
- }
- Asm->OutStreamer.AddBlankLine();
-}
-
-/// EndModule - Emit all exception information that should come after the
-/// content.
-void DwarfTableException::EndModule() {
- if (!Asm->MAI->isExceptionHandlingDwarf())
- return;
-
- if (!shouldEmitMovesModule && !shouldEmitTableModule)
- return;
-
- const std::vector<const Function*> &Personalities = MMI->getPersonalities();
-
- for (unsigned I = 0, E = Personalities.size(); I < E; ++I)
- EmitCIE(Personalities[I], I);
-
- for (std::vector<FunctionEHFrameInfo>::iterator
- I = EHFrames.begin(), E = EHFrames.end(); I != E; ++I)
- EmitFDE(*I);
-}
-
-/// BeginFunction - Gather pre-function exception information. Assumes it's
-/// being emitted immediately after the function entry point.
-void DwarfTableException::BeginFunction(const MachineFunction *MF) {
- shouldEmitTable = shouldEmitMoves = false;
-
- // If any landing pads survive, we need an EH table.
- shouldEmitTable = !MMI->getLandingPads().empty();
-
- // See if we need frame move info.
- shouldEmitMoves =
- !Asm->MF->getFunction()->doesNotThrow() || UnwindTablesMandatory;
-
- if (shouldEmitMoves || shouldEmitTable)
- // Assumes in correct section after the entry point.
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_begin",
- Asm->getFunctionNumber()));
-
- shouldEmitTableModule |= shouldEmitTable;
- shouldEmitMovesModule |= shouldEmitMoves;
-}
-
-/// EndFunction - Gather and emit post-function exception information.
-///
-void DwarfTableException::EndFunction() {
- if (!shouldEmitMoves && !shouldEmitTable) return;
-
- Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_end",
- Asm->getFunctionNumber()));
-
- // Record if this personality index uses a landing pad.
- bool HasLandingPad = !MMI->getLandingPads().empty();
- UsesLSDA[MMI->getPersonalityIndex()] |= HasLandingPad;
-
- // Map all labels and get rid of any dead landing pads.
- MMI->TidyLandingPads();
-
- if (HasLandingPad)
- EmitExceptionTable();
-
- const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
- MCSymbol *FunctionEHSym =
- Asm->GetSymbolWithGlobalValueBase(Asm->MF->getFunction(), ".eh",
- TLOF.isFunctionEHFrameSymbolPrivate());
-
- // Save EH frame information
- EHFrames.
- push_back(FunctionEHFrameInfo(FunctionEHSym,
- Asm->getFunctionNumber(),
- MMI->getPersonalityIndex(),
- Asm->MF->getFrameInfo()->adjustsStack(),
- !MMI->getLandingPads().empty(),
- MMI->getFrameMoves(),
- Asm->MF->getFunction()));
-}
diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp b/contrib/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
new file mode 100644
index 0000000..c2ad5eb
--- /dev/null
+++ b/contrib/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
@@ -0,0 +1,116 @@
+//===-- CodeGen/AsmPrinter/Win64Exception.cpp - Dwarf Exception Impl ------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains support for writing Win64 exception info into asm files.
+//
+//===----------------------------------------------------------------------===//
+
+#include "DwarfException.h"
+#include "llvm/Module.h"
+#include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineLocation.h"
+#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCSection.h"
+#include "llvm/MC/MCStreamer.h"
+#include "llvm/MC/MCSymbol.h"
+#include "llvm/Target/Mangler.h"
+#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetFrameLowering.h"
+#include "llvm/Target/TargetLoweringObjectFile.h"
+#include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetOptions.h"
+#include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Support/Dwarf.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/FormattedStream.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/Twine.h"
+using namespace llvm;
+
+Win64Exception::Win64Exception(AsmPrinter *A)
+ : DwarfException(A),
+ shouldEmitPersonality(false), shouldEmitLSDA(false), shouldEmitMoves(false)
+ {}
+
+Win64Exception::~Win64Exception() {}
+
+/// EndModule - Emit all exception information that should come after the
+/// content.
+void Win64Exception::EndModule() {
+}
+
+/// BeginFunction - Gather pre-function exception information. Assumes it's
+/// being emitted immediately after the function entry point.
+void Win64Exception::BeginFunction(const MachineFunction *MF) {
+ shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false;
+
+ // If any landing pads survive, we need an EH table.
+ bool hasLandingPads = !MMI->getLandingPads().empty();
+
+ shouldEmitMoves = Asm->needsSEHMoves();
+
+ const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
+ unsigned PerEncoding = TLOF.getPersonalityEncoding();
+ const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
+
+ shouldEmitPersonality = hasLandingPads &&
+ PerEncoding != dwarf::DW_EH_PE_omit && Per;
+
+ unsigned LSDAEncoding = TLOF.getLSDAEncoding();
+ shouldEmitLSDA = shouldEmitPersonality &&
+ LSDAEncoding != dwarf::DW_EH_PE_omit;
+
+ if (!shouldEmitPersonality && !shouldEmitMoves)
+ return;
+
+ Asm->OutStreamer.EmitWin64EHStartProc(Asm->CurrentFnSym);
+
+ if (!shouldEmitPersonality)
+ return;
+
+ MCSymbol *GCCHandlerSym =
+ Asm->GetExternalSymbolSymbol("_GCC_specific_handler");
+ Asm->OutStreamer.EmitWin64EHHandler(GCCHandlerSym, true, true);
+
+ Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_begin",
+ Asm->getFunctionNumber()));
+}
+
+/// EndFunction - Gather and emit post-function exception information.
+///
+void Win64Exception::EndFunction() {
+ if (!shouldEmitPersonality && !shouldEmitMoves)
+ return;
+
+ Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_end",
+ Asm->getFunctionNumber()));
+
+ // Map all labels and get rid of any dead landing pads.
+ MMI->TidyLandingPads();
+
+ if (shouldEmitPersonality) {
+ const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
+ const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
+ const MCSymbol *Sym = TLOF.getCFIPersonalitySymbol(Per, Asm->Mang, MMI);
+
+ Asm->OutStreamer.PushSection();
+ Asm->OutStreamer.EmitWin64EHHandlerData();
+ Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(Sym, Asm->OutContext),
+ 4);
+ EmitExceptionTable();
+ Asm->OutStreamer.PopSection();
+ }
+ Asm->OutStreamer.EmitWin64EHEndProc();
+}
diff --git a/contrib/llvm/lib/CodeGen/BranchFolding.cpp b/contrib/llvm/lib/CodeGen/BranchFolding.cpp
index 7704340..719cd26 100644
--- a/contrib/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/contrib/llvm/lib/CodeGen/BranchFolding.cpp
@@ -41,6 +41,7 @@ using namespace llvm;
STATISTIC(NumDeadBlocks, "Number of dead blocks removed");
STATISTIC(NumBranchOpts, "Number of branches optimized");
STATISTIC(NumTailMerge , "Number of block tails merged");
+STATISTIC(NumHoist , "Number of times common instructions are hoisted");
static cl::opt<cl::boolOrDefault> FlagEnableTailMerge("enable-tail-merge",
cl::init(cl::BOU_UNSET), cl::Hidden);
@@ -65,7 +66,7 @@ namespace {
public:
static char ID;
explicit BranchFolderPass(bool defaultEnableTailMerge)
- : MachineFunctionPass(ID), BranchFolder(defaultEnableTailMerge) {}
+ : MachineFunctionPass(ID), BranchFolder(defaultEnableTailMerge, true) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Control Flow Optimizer"; }
@@ -86,12 +87,14 @@ bool BranchFolderPass::runOnMachineFunction(MachineFunction &MF) {
}
-BranchFolder::BranchFolder(bool defaultEnableTailMerge) {
+BranchFolder::BranchFolder(bool defaultEnableTailMerge, bool CommonHoist) {
switch (FlagEnableTailMerge) {
case cl::BOU_UNSET: EnableTailMerge = defaultEnableTailMerge; break;
case cl::BOU_TRUE: EnableTailMerge = true; break;
case cl::BOU_FALSE: EnableTailMerge = false; break;
}
+
+ EnableHoistCommonCode = CommonHoist;
}
/// RemoveDeadBlock - Remove the specified dead machine basic block from the
@@ -186,9 +189,10 @@ bool BranchFolder::OptimizeFunction(MachineFunction &MF,
bool MadeChangeThisIteration = true;
while (MadeChangeThisIteration) {
- MadeChangeThisIteration = false;
- MadeChangeThisIteration |= TailMergeBlocks(MF);
- MadeChangeThisIteration |= OptimizeBranches(MF);
+ MadeChangeThisIteration = TailMergeBlocks(MF);
+ MadeChangeThisIteration |= OptimizeBranches(MF);
+ if (EnableHoistCommonCode)
+ MadeChangeThisIteration |= HoistCommonCode(MF);
MadeChange |= MadeChangeThisIteration;
}
@@ -910,7 +914,8 @@ bool BranchFolder::OptimizeBranches(MachineFunction &MF) {
// Make sure blocks are numbered in order
MF.RenumberBlocks();
- for (MachineFunction::iterator I = ++MF.begin(), E = MF.end(); I != E; ) {
+ for (MachineFunction::iterator I = llvm::next(MF.begin()), E = MF.end();
+ I != E; ) {
MachineBasicBlock *MBB = I++;
MadeChange |= OptimizeBlock(MBB);
@@ -1051,6 +1056,22 @@ ReoptimizeBlock:
!MBB->hasAddressTaken() && !MBB->isLandingPad()) {
DEBUG(dbgs() << "\nMerging into block: " << PrevBB
<< "From MBB: " << *MBB);
+ // Remove redundant DBG_VALUEs first.
+ if (PrevBB.begin() != PrevBB.end()) {
+ MachineBasicBlock::iterator PrevBBIter = PrevBB.end();
+ --PrevBBIter;
+ MachineBasicBlock::iterator MBBIter = MBB->begin();
+ // Check if DBG_VALUE at the end of PrevBB is identical to the
+ // DBG_VALUE at the beginning of MBB.
+ while (PrevBBIter != PrevBB.begin() && MBBIter != MBB->end()
+ && PrevBBIter->isDebugValue() && MBBIter->isDebugValue()) {
+ if (!MBBIter->isIdenticalTo(PrevBBIter))
+ break;
+ MachineInstr *DuplicateDbg = MBBIter;
+ ++MBBIter; -- PrevBBIter;
+ DuplicateDbg->eraseFromParent();
+ }
+ }
PrevBB.splice(PrevBB.end(), MBB, MBB->begin(), MBB->end());
PrevBB.removeSuccessor(PrevBB.succ_begin());;
assert(PrevBB.succ_empty());
@@ -1339,3 +1360,282 @@ ReoptimizeBlock:
return MadeChange;
}
+
+//===----------------------------------------------------------------------===//
+// Hoist Common Code
+//===----------------------------------------------------------------------===//
+
+/// HoistCommonCode - Hoist common instruction sequences at the start of basic
+/// blocks to their common predecessor.
+bool BranchFolder::HoistCommonCode(MachineFunction &MF) {
+ bool MadeChange = false;
+ for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ) {
+ MachineBasicBlock *MBB = I++;
+ MadeChange |= HoistCommonCodeInSuccs(MBB);
+ }
+
+ return MadeChange;
+}
+
+/// findFalseBlock - BB has a fallthrough. Find its 'false' successor given
+/// its 'true' successor.
+static MachineBasicBlock *findFalseBlock(MachineBasicBlock *BB,
+ MachineBasicBlock *TrueBB) {
+ for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
+ E = BB->succ_end(); SI != E; ++SI) {
+ MachineBasicBlock *SuccBB = *SI;
+ if (SuccBB != TrueBB)
+ return SuccBB;
+ }
+ return NULL;
+}
+
+/// findHoistingInsertPosAndDeps - Find the location to move common instructions
+/// in successors to. The location is ususally just before the terminator,
+/// however if the terminator is a conditional branch and its previous
+/// instruction is the flag setting instruction, the previous instruction is
+/// the preferred location. This function also gathers uses and defs of the
+/// instructions from the insertion point to the end of the block. The data is
+/// used by HoistCommonCodeInSuccs to ensure safety.
+static
+MachineBasicBlock::iterator findHoistingInsertPosAndDeps(MachineBasicBlock *MBB,
+ const TargetInstrInfo *TII,
+ const TargetRegisterInfo *TRI,
+ SmallSet<unsigned,4> &Uses,
+ SmallSet<unsigned,4> &Defs) {
+ MachineBasicBlock::iterator Loc = MBB->getFirstTerminator();
+ if (!TII->isUnpredicatedTerminator(Loc))
+ return MBB->end();
+
+ for (unsigned i = 0, e = Loc->getNumOperands(); i != e; ++i) {
+ const MachineOperand &MO = Loc->getOperand(i);
+ if (!MO.isReg())
+ continue;
+ unsigned Reg = MO.getReg();
+ if (!Reg)
+ continue;
+ if (MO.isUse()) {
+ Uses.insert(Reg);
+ for (const unsigned *AS = TRI->getAliasSet(Reg); *AS; ++AS)
+ Uses.insert(*AS);
+ } else if (!MO.isDead())
+ // Don't try to hoist code in the rare case the terminator defines a
+ // register that is later used.
+ return MBB->end();
+ }
+
+ if (Uses.empty())
+ return Loc;
+ if (Loc == MBB->begin())
+ return MBB->end();
+
+ // The terminator is probably a conditional branch, try not to separate the
+ // branch from condition setting instruction.
+ MachineBasicBlock::iterator PI = Loc;
+ --PI;
+ while (PI != MBB->begin() && Loc->isDebugValue())
+ --PI;
+
+ bool IsDef = false;
+ for (unsigned i = 0, e = PI->getNumOperands(); !IsDef && i != e; ++i) {
+ const MachineOperand &MO = PI->getOperand(i);
+ if (!MO.isReg() || MO.isUse())
+ continue;
+ unsigned Reg = MO.getReg();
+ if (!Reg)
+ continue;
+ if (Uses.count(Reg))
+ IsDef = true;
+ }
+ if (!IsDef)
+ // The condition setting instruction is not just before the conditional
+ // branch.
+ return Loc;
+
+ // Be conservative, don't insert instruction above something that may have
+ // side-effects. And since it's potentially bad to separate flag setting
+ // instruction from the conditional branch, just abort the optimization
+ // completely.
+ // Also avoid moving code above predicated instruction since it's hard to
+ // reason about register liveness with predicated instruction.
+ bool DontMoveAcrossStore = true;
+ if (!PI->isSafeToMove(TII, 0, DontMoveAcrossStore) ||
+ TII->isPredicated(PI))
+ return MBB->end();
+
+
+ // Find out what registers are live. Note this routine is ignoring other live
+ // registers which are only used by instructions in successor blocks.
+ for (unsigned i = 0, e = PI->getNumOperands(); i != e; ++i) {
+ const MachineOperand &MO = PI->getOperand(i);
+ if (!MO.isReg())
+ continue;
+ unsigned Reg = MO.getReg();
+ if (!Reg)
+ continue;
+ if (MO.isUse()) {
+ Uses.insert(Reg);
+ for (const unsigned *AS = TRI->getAliasSet(Reg); *AS; ++AS)
+ Uses.insert(*AS);
+ } else {
+ if (Uses.count(Reg)) {
+ Uses.erase(Reg);
+ for (const unsigned *SR = TRI->getSubRegisters(Reg); *SR; ++SR)
+ Uses.erase(*SR); // Use getSubRegisters to be conservative
+ }
+ Defs.insert(Reg);
+ for (const unsigned *AS = TRI->getAliasSet(Reg); *AS; ++AS)
+ Defs.insert(*AS);
+ }
+ }
+
+ return PI;
+}
+
+/// HoistCommonCodeInSuccs - If the successors of MBB has common instruction
+/// sequence at the start of the function, move the instructions before MBB
+/// terminator if it's legal.
+bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
+ MachineBasicBlock *TBB = 0, *FBB = 0;
+ SmallVector<MachineOperand, 4> Cond;
+ if (TII->AnalyzeBranch(*MBB, TBB, FBB, Cond, true) || !TBB || Cond.empty())
+ return false;
+
+ if (!FBB) FBB = findFalseBlock(MBB, TBB);
+ if (!FBB)
+ // Malformed bcc? True and false blocks are the same?
+ return false;
+
+ // Restrict the optimization to cases where MBB is the only predecessor,
+ // it is an obvious win.
+ if (TBB->pred_size() > 1 || FBB->pred_size() > 1)
+ return false;
+
+ // Find a suitable position to hoist the common instructions to. Also figure
+ // out which registers are used or defined by instructions from the insertion
+ // point to the end of the block.
+ SmallSet<unsigned, 4> Uses, Defs;
+ MachineBasicBlock::iterator Loc =
+ findHoistingInsertPosAndDeps(MBB, TII, TRI, Uses, Defs);
+ if (Loc == MBB->end())
+ return false;
+
+ bool HasDups = false;
+ SmallVector<unsigned, 4> LocalDefs;
+ SmallSet<unsigned, 4> LocalDefsSet;
+ MachineBasicBlock::iterator TIB = TBB->begin();
+ MachineBasicBlock::iterator FIB = FBB->begin();
+ MachineBasicBlock::iterator TIE = TBB->end();
+ MachineBasicBlock::iterator FIE = FBB->end();
+ while (TIB != TIE && FIB != FIE) {
+ // Skip dbg_value instructions. These do not count.
+ if (TIB->isDebugValue()) {
+ while (TIB != TIE && TIB->isDebugValue())
+ ++TIB;
+ if (TIB == TIE)
+ break;
+ }
+ if (FIB->isDebugValue()) {
+ while (FIB != FIE && FIB->isDebugValue())
+ ++FIB;
+ if (FIB == FIE)
+ break;
+ }
+ if (!TIB->isIdenticalTo(FIB, MachineInstr::CheckKillDead))
+ break;
+
+ if (TII->isPredicated(TIB))
+ // Hard to reason about register liveness with predicated instruction.
+ break;
+
+ bool IsSafe = true;
+ for (unsigned i = 0, e = TIB->getNumOperands(); i != e; ++i) {
+ MachineOperand &MO = TIB->getOperand(i);
+ if (!MO.isReg())
+ continue;
+ unsigned Reg = MO.getReg();
+ if (!Reg)
+ continue;
+ if (MO.isDef()) {
+ if (Uses.count(Reg)) {
+ // Avoid clobbering a register that's used by the instruction at
+ // the point of insertion.
+ IsSafe = false;
+ break;
+ }
+
+ if (Defs.count(Reg) && !MO.isDead()) {
+ // Don't hoist the instruction if the def would be clobber by the
+ // instruction at the point insertion. FIXME: This is overly
+ // conservative. It should be possible to hoist the instructions
+ // in BB2 in the following example:
+ // BB1:
+ // r1, eflag = op1 r2, r3
+ // brcc eflag
+ //
+ // BB2:
+ // r1 = op2, ...
+ // = op3, r1<kill>
+ IsSafe = false;
+ break;
+ }
+ } else if (!LocalDefsSet.count(Reg)) {
+ if (Defs.count(Reg)) {
+ // Use is defined by the instruction at the point of insertion.
+ IsSafe = false;
+ break;
+ }
+ }
+ }
+ if (!IsSafe)
+ break;
+
+ bool DontMoveAcrossStore = true;
+ if (!TIB->isSafeToMove(TII, 0, DontMoveAcrossStore))
+ break;
+
+ // Track local defs so we can update liveins.
+ for (unsigned i = 0, e = TIB->getNumOperands(); i != e; ++i) {
+ MachineOperand &MO = TIB->getOperand(i);
+ if (!MO.isReg())
+ continue;
+ unsigned Reg = MO.getReg();
+ if (!Reg)
+ continue;
+ if (MO.isDef()) {
+ if (!MO.isDead()) {
+ LocalDefs.push_back(Reg);
+ LocalDefsSet.insert(Reg);
+ for (const unsigned *SR = TRI->getSubRegisters(Reg); *SR; ++SR)
+ LocalDefsSet.insert(*SR);
+ }
+ } else if (MO.isKill() && LocalDefsSet.count(Reg)) {
+ LocalDefsSet.erase(Reg);
+ for (const unsigned *SR = TRI->getSubRegisters(Reg); *SR; ++SR)
+ LocalDefsSet.erase(*SR);
+ }
+ }
+
+ HasDups = true;;
+ ++TIB;
+ ++FIB;
+ }
+
+ if (!HasDups)
+ return false;
+
+ MBB->splice(Loc, TBB, TBB->begin(), TIB);
+ FBB->erase(FBB->begin(), FIB);
+
+ // Update livein's.
+ for (unsigned i = 0, e = LocalDefs.size(); i != e; ++i) {
+ unsigned Def = LocalDefs[i];
+ if (LocalDefsSet.count(Def)) {
+ TBB->addLiveIn(Def);
+ FBB->addLiveIn(Def);
+ }
+ }
+
+ ++NumHoist;
+ return true;
+}
diff --git a/contrib/llvm/lib/CodeGen/BranchFolding.h b/contrib/llvm/lib/CodeGen/BranchFolding.h
index 15dfa7f..4daf4ec 100644
--- a/contrib/llvm/lib/CodeGen/BranchFolding.h
+++ b/contrib/llvm/lib/CodeGen/BranchFolding.h
@@ -19,11 +19,10 @@ namespace llvm {
class RegScavenger;
class TargetInstrInfo;
class TargetRegisterInfo;
- template<typename T> class SmallVectorImpl;
class BranchFolder {
public:
- explicit BranchFolder(bool defaultEnableTailMerge);
+ explicit BranchFolder(bool defaultEnableTailMerge, bool CommonHoist);
bool OptimizeFunction(MachineFunction &MF,
const TargetInstrInfo *tii,
@@ -85,6 +84,7 @@ namespace llvm {
std::vector<SameTailElt> SameTails;
bool EnableTailMerge;
+ bool EnableHoistCommonCode;
const TargetInstrInfo *TII;
const TargetRegisterInfo *TRI;
MachineModuleInfo *MMI;
@@ -110,6 +110,9 @@ namespace llvm {
bool OptimizeBlock(MachineBasicBlock *MBB);
void RemoveDeadBlock(MachineBasicBlock *MBB);
bool OptimizeImpDefsBlock(MachineBasicBlock *MBB);
+
+ bool HoistCommonCode(MachineFunction &MF);
+ bool HoistCommonCodeInSuccs(MachineBasicBlock *MBB);
};
}
diff --git a/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp
index e5894b8..5d722ee 100644
--- a/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp
+++ b/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp
@@ -165,7 +165,7 @@ void VirtRegAuxInfo::CalculateWeightAndHint(LiveInterval &li) {
return;
// Mark li as unspillable if all live ranges are tiny.
- if (li.isZeroLength()) {
+ if (li.isZeroLength(LIS.getSlotIndexes())) {
li.markNotSpillable();
return;
}
diff --git a/contrib/llvm/lib/CodeGen/CallingConvLower.cpp b/contrib/llvm/lib/CodeGen/CallingConvLower.cpp
index bfb6ba1..14eb054 100644
--- a/contrib/llvm/lib/CodeGen/CallingConvLower.cpp
+++ b/contrib/llvm/lib/CodeGen/CallingConvLower.cpp
@@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/CallingConvLower.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
@@ -22,21 +23,22 @@
#include "llvm/Target/TargetLowering.h"
using namespace llvm;
-CCState::CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &tm,
- SmallVector<CCValAssign, 16> &locs, LLVMContext &C)
- : CallingConv(CC), IsVarArg(isVarArg), TM(tm),
+CCState::CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &mf,
+ const TargetMachine &tm, SmallVector<CCValAssign, 16> &locs,
+ LLVMContext &C)
+ : CallingConv(CC), IsVarArg(isVarArg), MF(mf), TM(tm),
TRI(*TM.getRegisterInfo()), Locs(locs), Context(C),
- CallOrPrologue(Invalid) {
+ CallOrPrologue(Unknown) {
// No stack is used.
StackOffset = 0;
-
+
clearFirstByValReg();
UsedRegs.resize((TRI.getNumRegs()+31)/32);
}
-// HandleByVal - Allocate a stack slot large enough to pass an argument by
-// value. The size and alignment information of the argument is encoded in its
-// parameter attribute.
+// HandleByVal - Allocate space on the stack large enough to pass an argument
+// by value. The size and alignment information of the argument is encoded in
+// its parameter attribute.
void CCState::HandleByVal(unsigned ValNo, MVT ValVT,
MVT LocVT, CCValAssign::LocInfo LocInfo,
int MinSize, int MinAlign,
@@ -47,7 +49,9 @@ void CCState::HandleByVal(unsigned ValNo, MVT ValVT,
Size = MinSize;
if (MinAlign > (int)Align)
Align = MinAlign;
- TM.getTargetLowering()->HandleByVal(const_cast<CCState*>(this), Size);
+ if (MF.getFrameInfo()->getMaxAlignment() < Align)
+ MF.getFrameInfo()->setMaxAlignment(Align);
+ TM.getTargetLowering()->HandleByVal(this, Size);
unsigned Offset = AllocateStack(Size, Align);
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
}
diff --git a/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp b/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
index f79598d..51d984f 100644
--- a/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
+++ b/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp
@@ -421,7 +421,8 @@ unsigned CriticalAntiDepBreaker::
BreakAntiDependencies(const std::vector<SUnit>& SUnits,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
- unsigned InsertPosIndex) {
+ unsigned InsertPosIndex,
+ DbgValueVector &DbgValues) {
// The code below assumes that there is at least one instruction,
// so just duck out immediately if the block is empty.
if (SUnits.empty()) return 0;
@@ -628,14 +629,10 @@ BreakAntiDependencies(const std::vector<SUnit>& SUnits,
// as well.
const SUnit *SU = MISUnitMap[Q->second->getParent()];
if (!SU) continue;
- for (unsigned i = 0, e = SU->DbgInstrList.size() ; i < e ; ++i) {
- MachineInstr *DI = SU->DbgInstrList[i];
- assert (DI->getNumOperands()==3 && DI->getOperand(0).isReg() &&
- DI->getOperand(0).getReg()
- && "Non register dbg_value attached to SUnit!");
- if (DI->getOperand(0).getReg() == AntiDepReg)
- DI->getOperand(0).setReg(NewReg);
- }
+ for (DbgValueVector::iterator DVI = DbgValues.begin(),
+ DVE = DbgValues.end(); DVI != DVE; ++DVI)
+ if (DVI->second == Q->second->getParent())
+ UpdateDbgValue(DVI->first, AntiDepReg, NewReg);
}
// We just went back in time and modified history; the
diff --git a/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h b/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h
index 0daaef2..5bbb8f5 100644
--- a/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h
+++ b/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h
@@ -79,7 +79,8 @@ class TargetRegisterInfo;
unsigned BreakAntiDependencies(const std::vector<SUnit>& SUnits,
MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
- unsigned InsertPosIndex);
+ unsigned InsertPosIndex,
+ DbgValueVector &DbgValues);
/// Observe - Update liveness information to account for the current
/// instruction, which will not be scheduled.
diff --git a/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp b/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp
index 34b1a39..22c5465 100644
--- a/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp
+++ b/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp
@@ -30,6 +30,7 @@ using namespace llvm;
STATISTIC(NumLandingPadsSplit, "Number of landing pads split");
STATISTIC(NumUnwindsLowered, "Number of unwind instructions lowered");
+STATISTIC(NumResumesLowered, "Number of eh.resume calls lowered");
STATISTIC(NumExceptionValuesMoved, "Number of eh.exception calls moved");
namespace {
@@ -63,7 +64,7 @@ namespace {
BBSet LandingPads;
bool NormalizeLandingPads();
- bool LowerUnwinds();
+ bool LowerUnwindsAndResumes();
bool MoveExceptionValueCalls();
Instruction *CreateExceptionValueCall(BasicBlock *BB);
@@ -251,10 +252,7 @@ bool DwarfEHPrepare::HandleURoRInvokes() {
if (!URoR) {
URoR = F->getParent()->getFunction("_Unwind_Resume_or_Rethrow");
- if (!URoR) {
- URoR = F->getParent()->getFunction("_Unwind_SjLj_Resume");
- if (!URoR) return CleanupSelectors(CatchAllSels);
- }
+ if (!URoR) return CleanupSelectors(CatchAllSels);
}
SmallPtrSet<InvokeInst*, 32> URoRInvokes;
@@ -480,20 +478,25 @@ bool DwarfEHPrepare::NormalizeLandingPads() {
/// rethrowing any previously caught exception. This will crash horribly
/// at runtime if there is no such exception: using unwind to throw a new
/// exception is currently not supported.
-bool DwarfEHPrepare::LowerUnwinds() {
- SmallVector<TerminatorInst*, 16> UnwindInsts;
-
- for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) {
- TerminatorInst *TI = I->getTerminator();
- if (isa<UnwindInst>(TI))
- UnwindInsts.push_back(TI);
+bool DwarfEHPrepare::LowerUnwindsAndResumes() {
+ SmallVector<Instruction*, 16> ResumeInsts;
+
+ for (Function::iterator fi = F->begin(), fe = F->end(); fi != fe; ++fi) {
+ for (BasicBlock::iterator bi = fi->begin(), be = fi->end(); bi != be; ++bi){
+ if (isa<UnwindInst>(bi))
+ ResumeInsts.push_back(bi);
+ else if (CallInst *call = dyn_cast<CallInst>(bi))
+ if (Function *fn = dyn_cast<Function>(call->getCalledValue()))
+ if (fn->getName() == "llvm.eh.resume")
+ ResumeInsts.push_back(bi);
+ }
}
- if (UnwindInsts.empty()) return false;
+ if (ResumeInsts.empty()) return false;
// Find the rewind function if we didn't already.
if (!RewindFunction) {
- LLVMContext &Ctx = UnwindInsts[0]->getContext();
+ LLVMContext &Ctx = ResumeInsts[0]->getContext();
std::vector<const Type*>
Params(1, Type::getInt8PtrTy(Ctx));
FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx),
@@ -504,24 +507,36 @@ bool DwarfEHPrepare::LowerUnwinds() {
bool Changed = false;
- for (SmallVectorImpl<TerminatorInst*>::iterator
- I = UnwindInsts.begin(), E = UnwindInsts.end(); I != E; ++I) {
- TerminatorInst *TI = *I;
+ for (SmallVectorImpl<Instruction*>::iterator
+ I = ResumeInsts.begin(), E = ResumeInsts.end(); I != E; ++I) {
+ Instruction *RI = *I;
- // Replace the unwind instruction with a call to _Unwind_Resume (or the
- // appropriate target equivalent) followed by an UnreachableInst.
+ // Replace the resuming instruction with a call to _Unwind_Resume (or the
+ // appropriate target equivalent).
+
+ llvm::Value *ExnValue;
+ if (isa<UnwindInst>(RI))
+ ExnValue = CreateExceptionValueCall(RI->getParent());
+ else
+ ExnValue = cast<CallInst>(RI)->getArgOperand(0);
// Create the call...
- CallInst *CI = CallInst::Create(RewindFunction,
- CreateExceptionValueCall(TI->getParent()),
- "", TI);
+ CallInst *CI = CallInst::Create(RewindFunction, ExnValue, "", RI);
CI->setCallingConv(TLI->getLibcallCallingConv(RTLIB::UNWIND_RESUME));
- // ...followed by an UnreachableInst.
- new UnreachableInst(TI->getContext(), TI);
- // Nuke the unwind instruction.
- TI->eraseFromParent();
- ++NumUnwindsLowered;
+ // ...followed by an UnreachableInst, if it was an unwind.
+ // Calls to llvm.eh.resume are typically already followed by this.
+ if (isa<UnwindInst>(RI))
+ new UnreachableInst(RI->getContext(), RI);
+
+ if (isa<UnwindInst>(RI))
+ ++NumUnwindsLowered;
+ else
+ ++NumResumesLowered;
+
+ // Nuke the resume instruction.
+ RI->eraseFromParent();
+
Changed = true;
}
@@ -657,8 +672,8 @@ bool DwarfEHPrepare::runOnFunction(Function &Fn) {
// basic block where an invoke unwind edge ends).
Changed |= NormalizeLandingPads();
- // Turn unwind instructions into libcalls.
- Changed |= LowerUnwinds();
+ // Turn unwind instructions and eh.resume calls into libcalls.
+ Changed |= LowerUnwindsAndResumes();
// TODO: Move eh.selector calls to landing pads and combine them.
diff --git a/contrib/llvm/lib/CodeGen/IfConversion.cpp b/contrib/llvm/lib/CodeGen/IfConversion.cpp
index 790200b..8b2c981 100644
--- a/contrib/llvm/lib/CodeGen/IfConversion.cpp
+++ b/contrib/llvm/lib/CodeGen/IfConversion.cpp
@@ -265,7 +265,7 @@ bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
if (!TII) return false;
// Tail merge tend to expose more if-conversion opportunities.
- BranchFolder BF(true);
+ BranchFolder BF(true, false);
bool BFChange = BF.OptimizeFunction(MF, TII,
MF.getTarget().getRegisterInfo(),
getAnalysisIfAvailable<MachineModuleInfo>());
@@ -399,7 +399,7 @@ bool IfConverter::runOnMachineFunction(MachineFunction &MF) {
BBAnalysis.clear();
if (MadeChange && IfCvtBranchFold) {
- BranchFolder BF(false);
+ BranchFolder BF(false, false);
BF.OptimizeFunction(MF, TII,
MF.getTarget().getRegisterInfo(),
getAnalysisIfAvailable<MachineModuleInfo>());
diff --git a/contrib/llvm/lib/CodeGen/InlineSpiller.cpp b/contrib/llvm/lib/CodeGen/InlineSpiller.cpp
index b1a33a6..19ae333 100644
--- a/contrib/llvm/lib/CodeGen/InlineSpiller.cpp
+++ b/contrib/llvm/lib/CodeGen/InlineSpiller.cpp
@@ -16,6 +16,7 @@
#include "Spiller.h"
#include "LiveRangeEdit.h"
#include "VirtRegMap.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/LiveStackAnalysis.h"
@@ -31,6 +32,18 @@
using namespace llvm;
+STATISTIC(NumSpilledRanges, "Number of spilled live ranges");
+STATISTIC(NumSnippets, "Number of snippets included in spills");
+STATISTIC(NumSpills, "Number of spills inserted");
+STATISTIC(NumReloads, "Number of reloads inserted");
+STATISTIC(NumFolded, "Number of folded stack accesses");
+STATISTIC(NumFoldedLoads, "Number of folded loads");
+STATISTIC(NumRemats, "Number of rematerialized defs for spilling");
+STATISTIC(NumOmitReloadSpill, "Number of omitted spills after reloads");
+STATISTIC(NumHoistLocal, "Number of locally hoisted spills");
+STATISTIC(NumHoistGlobal, "Number of globally hoisted spills");
+STATISTIC(NumRedundantSpills, "Number of redundant spills identified");
+
namespace {
class InlineSpiller : public Spiller {
MachineFunctionPass &Pass;
@@ -247,10 +260,11 @@ void InlineSpiller::collectRegsToSpill() {
if (!isSnippet(SnipLI))
continue;
SnippetCopies.insert(MI);
- if (!isRegToSpill(SnipReg))
- RegsToSpill.push_back(SnipReg);
-
+ if (isRegToSpill(SnipReg))
+ continue;
+ RegsToSpill.push_back(SnipReg);
DEBUG(dbgs() << "\talso spill snippet " << SnipLI << '\n');
+ ++NumSnippets;
}
}
@@ -469,9 +483,10 @@ bool InlineSpiller::hoistSpill(LiveInterval &SpillLI, MachineInstr *CopyMI) {
<< *StackInt << '\n');
// Already spilled everywhere.
- if (SVI.AllDefsAreReloads)
+ if (SVI.AllDefsAreReloads) {
+ ++NumOmitReloadSpill;
return true;
-
+ }
// We are going to spill SVI.SpillVNI immediately after its def, so clear out
// any later spills of the same value.
eliminateRedundantSpills(SibLI, SVI.SpillVNI);
@@ -493,6 +508,11 @@ bool InlineSpiller::hoistSpill(LiveInterval &SpillLI, MachineInstr *CopyMI) {
LIS.InsertMachineInstrInMaps(MII);
VRM.addSpillSlotUse(StackSlot, MII);
DEBUG(dbgs() << "\thoisted: " << SVI.SpillVNI->def << '\t' << *MII);
+
+ if (MBB == CopyMI->getParent())
+ ++NumHoistLocal;
+ else
+ ++NumHoistGlobal;
return true;
}
@@ -547,6 +567,7 @@ void InlineSpiller::eliminateRedundantSpills(LiveInterval &SLI, VNInfo *VNI) {
// eliminateDeadDefs won't normally remove stores, so switch opcode.
MI->setDesc(TII.get(TargetOpcode::KILL));
DeadDefs.push_back(MI);
+ ++NumRedundantSpills;
}
}
} while (!WorkList.empty());
@@ -642,6 +663,7 @@ bool InlineSpiller::reMaterializeFor(LiveInterval &VirtReg,
if (RM.OrigMI->getDesc().canFoldAsLoad() &&
foldMemoryOperand(MI, Ops, RM.OrigMI)) {
Edit->markRematerialized(RM.ParentVNI);
+ ++NumFoldedLoads;
return true;
}
@@ -668,6 +690,7 @@ bool InlineSpiller::reMaterializeFor(LiveInterval &VirtReg,
VNInfo *DefVNI = NewLI.getNextValue(DefIdx, 0, LIS.getVNInfoAllocator());
NewLI.addRange(LiveRange(DefIdx, UseIdx.getDefIndex(), DefVNI));
DEBUG(dbgs() << "\tinterval: " << NewLI << '\n');
+ ++NumRemats;
return true;
}
@@ -794,6 +817,7 @@ bool InlineSpiller::foldMemoryOperand(MachineBasicBlock::iterator MI,
VRM.addSpillSlotUse(StackSlot, FoldMI);
MI->eraseFromParent();
DEBUG(dbgs() << "\tfolded: " << *FoldMI);
+ ++NumFolded;
return true;
}
@@ -811,6 +835,7 @@ void InlineSpiller::insertReload(LiveInterval &NewLI,
VNInfo *LoadVNI = NewLI.getNextValue(LoadIdx, 0,
LIS.getVNInfoAllocator());
NewLI.addRange(LiveRange(LoadIdx, Idx, LoadVNI));
+ ++NumReloads;
}
/// insertSpill - Insert a spill of NewLI.reg after MI.
@@ -825,10 +850,12 @@ void InlineSpiller::insertSpill(LiveInterval &NewLI, const LiveInterval &OldLI,
DEBUG(dbgs() << "\tspilled: " << StoreIdx << '\t' << *MI);
VNInfo *StoreVNI = NewLI.getNextValue(Idx, 0, LIS.getVNInfoAllocator());
NewLI.addRange(LiveRange(Idx, StoreIdx, StoreVNI));
+ ++NumSpills;
}
/// spillAroundUses - insert spill code around each use of Reg.
void InlineSpiller::spillAroundUses(unsigned Reg) {
+ DEBUG(dbgs() << "spillAroundUses " << PrintReg(Reg) << '\n');
LiveInterval &OldLI = LIS.getInterval(Reg);
// Iterate over instructions using Reg.
@@ -876,6 +903,12 @@ void InlineSpiller::spillAroundUses(unsigned Reg) {
// Check for a sibling copy.
unsigned SibReg = isFullCopyOf(MI, Reg);
if (SibReg && isSibling(SibReg)) {
+ // This may actually be a copy between snippets.
+ if (isRegToSpill(SibReg)) {
+ DEBUG(dbgs() << "Found new snippet copy: " << *MI);
+ SnippetCopies.insert(MI);
+ continue;
+ }
if (Writes) {
// Hoist the spill of a sib-reg copy.
if (hoistSpill(OldLI, MI)) {
@@ -957,13 +990,15 @@ void InlineSpiller::spillAll() {
}
// Finally delete the SnippetCopies.
- for (MachineRegisterInfo::reg_iterator RI = MRI.reg_begin(Edit->getReg());
- MachineInstr *MI = RI.skipInstruction();) {
- assert(SnippetCopies.count(MI) && "Remaining use wasn't a snippet copy");
- // FIXME: Do this with a LiveRangeEdit callback.
- VRM.RemoveMachineInstrFromMaps(MI);
- LIS.RemoveMachineInstrFromMaps(MI);
- MI->eraseFromParent();
+ for (unsigned i = 0, e = RegsToSpill.size(); i != e; ++i) {
+ for (MachineRegisterInfo::reg_iterator RI = MRI.reg_begin(RegsToSpill[i]);
+ MachineInstr *MI = RI.skipInstruction();) {
+ assert(SnippetCopies.count(MI) && "Remaining use wasn't a snippet copy");
+ // FIXME: Do this with a LiveRangeEdit callback.
+ VRM.RemoveMachineInstrFromMaps(MI);
+ LIS.RemoveMachineInstrFromMaps(MI);
+ MI->eraseFromParent();
+ }
}
// Delete all spilled registers.
@@ -972,6 +1007,7 @@ void InlineSpiller::spillAll() {
}
void InlineSpiller::spill(LiveRangeEdit &edit) {
+ ++NumSpilledRanges;
Edit = &edit;
assert(!TargetRegisterInfo::isStackSlot(edit.getReg())
&& "Trying to spill a stack slot.");
diff --git a/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index e1dad2e..589d0a9 100644
--- a/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -13,6 +13,7 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/PassManager.h"
+#include "llvm/Analysis/Passes.h"
#include "llvm/Analysis/Verifier.h"
#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/CodeGen/AsmPrinter.h"
@@ -32,7 +33,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormattedStream.h"
-#include "llvm/Support/StandardPasses.h"
using namespace llvm;
namespace llvm {
@@ -292,7 +292,11 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
// Standard LLVM-Level Passes.
// Basic AliasAnalysis support.
- createStandardAliasAnalysisPasses(&PM);
+ // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that
+ // BasicAliasAnalysis wins if they disagree. This is intended to help
+ // support "obvious" type-punning idioms.
+ PM.add(createTypeBasedAliasAnalysisPass());
+ PM.add(createBasicAliasAnalysisPass());
// Before running any passes, run the verifier to determine if the input
// coming from the front-end and/or optimizer is valid.
@@ -324,8 +328,8 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
PM.add(createSjLjEHPass(getTargetLowering()));
// FALLTHROUGH
case ExceptionHandling::DwarfCFI:
- case ExceptionHandling::DwarfTable:
case ExceptionHandling::ARM:
+ case ExceptionHandling::Win64:
PM.add(createDwarfEHPass(this));
break;
case ExceptionHandling::None:
diff --git a/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp b/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp
index 8b21483..292928f 100644
--- a/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp
+++ b/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp
@@ -101,9 +101,13 @@ class UserValue {
void insertDebugValue(MachineBasicBlock *MBB, SlotIndex Idx, unsigned LocNo,
LiveIntervals &LIS, const TargetInstrInfo &TII);
+ /// splitLocation - Replace OldLocNo ranges with NewRegs ranges where NewRegs
+ /// is live. Returns true if any changes were made.
+ bool splitLocation(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs);
+
public:
/// UserValue - Create a new UserValue.
- UserValue(const MDNode *var, unsigned o, DebugLoc L,
+ UserValue(const MDNode *var, unsigned o, DebugLoc L,
LocMap::Allocator &alloc)
: variable(var), offset(o), dl(L), leader(this), next(0), locInts(alloc)
{}
@@ -215,6 +219,10 @@ public:
void renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx,
const TargetRegisterInfo *TRI);
+ /// splitRegister - Replace OldReg ranges with NewRegs ranges where NewRegs is
+ /// live. Returns true if any changes were made.
+ bool splitRegister(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs);
+
/// rewriteLocations - Rewrite virtual register locations according to the
/// provided virtual register map.
void rewriteLocations(VirtRegMap &VRM, const TargetRegisterInfo &TRI);
@@ -228,7 +236,7 @@ public:
/// Only first one needs DebugLoc to identify variable's lexical scope
/// in source file.
DebugLoc findDebugLoc();
- void print(raw_ostream&, const TargetRegisterInfo*);
+ void print(raw_ostream&, const TargetMachine*);
};
} // namespace
@@ -293,6 +301,9 @@ public:
/// renameRegister - Replace all references to OldReg with NewReg:SubIdx.
void renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx);
+ /// splitRegister - Replace all references to OldReg with NewRegs.
+ void splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs);
+
/// emitDebugVariables - Recreate DBG_VALUE instruction from data structures.
void emitDebugValues(VirtRegMap *VRM);
@@ -300,7 +311,7 @@ public:
};
} // namespace
-void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
+void UserValue::print(raw_ostream &OS, const TargetMachine *TM) {
if (const MDString *MDS = dyn_cast<MDString>(variable->getOperand(2)))
OS << "!\"" << MDS->getString() << "\"\t";
if (offset)
@@ -312,15 +323,17 @@ void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
else
OS << I.value();
}
- for (unsigned i = 0, e = locations.size(); i != e; ++i)
- OS << " Loc" << i << '=' << locations[i];
+ for (unsigned i = 0, e = locations.size(); i != e; ++i) {
+ OS << " Loc" << i << '=';
+ locations[i].print(OS, TM);
+ }
OS << '\n';
}
void LDVImpl::print(raw_ostream &OS) {
OS << "********** DEBUG VARIABLES **********\n";
for (unsigned i = 0, e = userValues.size(); i != e; ++i)
- userValues[i]->print(OS, TRI);
+ userValues[i]->print(OS, &MF->getTarget());
}
void UserValue::coalesceLocation(unsigned LocNo) {
@@ -677,6 +690,143 @@ renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx) {
static_cast<LDVImpl*>(pImpl)->renameRegister(OldReg, NewReg, SubIdx);
}
+//===----------------------------------------------------------------------===//
+// Live Range Splitting
+//===----------------------------------------------------------------------===//
+
+bool
+UserValue::splitLocation(unsigned OldLocNo, ArrayRef<LiveInterval*> NewRegs) {
+ DEBUG({
+ dbgs() << "Splitting Loc" << OldLocNo << '\t';
+ print(dbgs(), 0);
+ });
+ bool DidChange = false;
+ LocMap::iterator LocMapI;
+ LocMapI.setMap(locInts);
+ for (unsigned i = 0; i != NewRegs.size(); ++i) {
+ LiveInterval *LI = NewRegs[i];
+ if (LI->empty())
+ continue;
+
+ // Don't allocate the new LocNo until it is needed.
+ unsigned NewLocNo = ~0u;
+
+ // Iterate over the overlaps between locInts and LI.
+ LocMapI.find(LI->beginIndex());
+ if (!LocMapI.valid())
+ continue;
+ LiveInterval::iterator LII = LI->advanceTo(LI->begin(), LocMapI.start());
+ LiveInterval::iterator LIE = LI->end();
+ while (LocMapI.valid() && LII != LIE) {
+ // At this point, we know that LocMapI.stop() > LII->start.
+ LII = LI->advanceTo(LII, LocMapI.start());
+ if (LII == LIE)
+ break;
+
+ // Now LII->end > LocMapI.start(). Do we have an overlap?
+ if (LocMapI.value() == OldLocNo && LII->start < LocMapI.stop()) {
+ // Overlapping correct location. Allocate NewLocNo now.
+ if (NewLocNo == ~0u) {
+ MachineOperand MO = MachineOperand::CreateReg(LI->reg, false);
+ MO.setSubReg(locations[OldLocNo].getSubReg());
+ NewLocNo = getLocationNo(MO);
+ DidChange = true;
+ }
+
+ SlotIndex LStart = LocMapI.start();
+ SlotIndex LStop = LocMapI.stop();
+
+ // Trim LocMapI down to the LII overlap.
+ if (LStart < LII->start)
+ LocMapI.setStartUnchecked(LII->start);
+ if (LStop > LII->end)
+ LocMapI.setStopUnchecked(LII->end);
+
+ // Change the value in the overlap. This may trigger coalescing.
+ LocMapI.setValue(NewLocNo);
+
+ // Re-insert any removed OldLocNo ranges.
+ if (LStart < LocMapI.start()) {
+ LocMapI.insert(LStart, LocMapI.start(), OldLocNo);
+ ++LocMapI;
+ assert(LocMapI.valid() && "Unexpected coalescing");
+ }
+ if (LStop > LocMapI.stop()) {
+ ++LocMapI;
+ LocMapI.insert(LII->end, LStop, OldLocNo);
+ --LocMapI;
+ }
+ }
+
+ // Advance to the next overlap.
+ if (LII->end < LocMapI.stop()) {
+ if (++LII == LIE)
+ break;
+ LocMapI.advanceTo(LII->start);
+ } else {
+ ++LocMapI;
+ if (!LocMapI.valid())
+ break;
+ LII = LI->advanceTo(LII, LocMapI.start());
+ }
+ }
+ }
+
+ // Finally, remove any remaining OldLocNo intervals and OldLocNo itself.
+ locations.erase(locations.begin() + OldLocNo);
+ LocMapI.goToBegin();
+ while (LocMapI.valid()) {
+ unsigned v = LocMapI.value();
+ if (v == OldLocNo) {
+ DEBUG(dbgs() << "Erasing [" << LocMapI.start() << ';'
+ << LocMapI.stop() << ")\n");
+ LocMapI.erase();
+ } else {
+ if (v > OldLocNo)
+ LocMapI.setValueUnchecked(v-1);
+ ++LocMapI;
+ }
+ }
+
+ DEBUG({dbgs() << "Split result: \t"; print(dbgs(), 0);});
+ return DidChange;
+}
+
+bool
+UserValue::splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
+ bool DidChange = false;
+ // Split locations referring to OldReg. Iterate backwards so splitLocation can
+ // safely erase unuused locations.
+ for (unsigned i = locations.size(); i ; --i) {
+ unsigned LocNo = i-1;
+ const MachineOperand *Loc = &locations[LocNo];
+ if (!Loc->isReg() || Loc->getReg() != OldReg)
+ continue;
+ DidChange |= splitLocation(LocNo, NewRegs);
+ }
+ return DidChange;
+}
+
+void LDVImpl::splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
+ bool DidChange = false;
+ for (UserValue *UV = lookupVirtReg(OldReg); UV; UV = UV->getNext())
+ DidChange |= UV->splitRegister(OldReg, NewRegs);
+
+ if (!DidChange)
+ return;
+
+ // Map all of the new virtual registers.
+ UserValue *UV = lookupVirtReg(OldReg);
+ for (unsigned i = 0; i != NewRegs.size(); ++i)
+ mapVirtReg(NewRegs[i]->reg, UV);
+}
+
+void LiveDebugVariables::
+splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs) {
+ if (pImpl)
+ static_cast<LDVImpl*>(pImpl)->splitRegister(OldReg, NewRegs);
+}
+
void
UserValue::rewriteLocations(VirtRegMap &VRM, const TargetRegisterInfo &TRI) {
// Iterate over locations in reverse makes it easier to handle coalescing.
@@ -690,6 +840,9 @@ UserValue::rewriteLocations(VirtRegMap &VRM, const TargetRegisterInfo &TRI) {
unsigned VirtReg = Loc.getReg();
if (VRM.isAssignedReg(VirtReg) &&
TargetRegisterInfo::isPhysicalRegister(VRM.getPhys(VirtReg))) {
+ // This can create a %noreg operand in rare cases when the sub-register
+ // index is no longer available. That means the user value is in a
+ // non-existent sub-register, and %noreg is exactly what we want.
Loc.substPhysReg(VRM.getPhys(VirtReg), TRI);
} else if (VRM.getStackSlot(VirtReg) != VirtRegMap::NO_STACK_SLOT &&
VRM.isSpillSlotUsed(VRM.getStackSlot(VirtReg))) {
@@ -701,7 +854,6 @@ UserValue::rewriteLocations(VirtRegMap &VRM, const TargetRegisterInfo &TRI) {
}
coalesceLocation(LocNo);
}
- DEBUG(print(dbgs(), &TRI));
}
/// findInsertLocation - Find an iterator for inserting a DBG_VALUE
@@ -793,6 +945,7 @@ void LDVImpl::emitDebugValues(VirtRegMap *VRM) {
DEBUG(dbgs() << "********** EMITTING LIVE DEBUG VARIABLES **********\n");
const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();
for (unsigned i = 0, e = userValues.size(); i != e; ++i) {
+ DEBUG(userValues[i]->print(dbgs(), &MF->getTarget()));
userValues[i]->rewriteLocations(*VRM, *TRI);
userValues[i]->emitDebugValues(VRM, *LIS, *TII);
}
diff --git a/contrib/llvm/lib/CodeGen/LiveDebugVariables.h b/contrib/llvm/lib/CodeGen/LiveDebugVariables.h
index a6e40a1..3ce3c39 100644
--- a/contrib/llvm/lib/CodeGen/LiveDebugVariables.h
+++ b/contrib/llvm/lib/CodeGen/LiveDebugVariables.h
@@ -21,10 +21,12 @@
#ifndef LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
#define LLVM_CODEGEN_LIVEDEBUGVARIABLES_H
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
namespace llvm {
+class LiveInterval;
class VirtRegMap;
class LiveDebugVariables : public MachineFunctionPass {
@@ -42,6 +44,11 @@ public:
/// register.
void renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx);
+ /// splitRegister - Move any user variables in OldReg to the live ranges in
+ /// NewRegs where they are live. Mark the values as unavailable where no new
+ /// register is live.
+ void splitRegister(unsigned OldReg, ArrayRef<LiveInterval*> NewRegs);
+
/// emitDebugValues - Emit new DBG_VALUE instructions reflecting the changes
/// that happened during register allocation.
/// @param VRM Rename virtual registers according to map.
diff --git a/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp b/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp
index f8a3dbb..052abad 100644
--- a/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ b/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp
@@ -15,6 +15,7 @@
#include "LiveRangeEdit.h"
#include "VirtRegMap.h"
#include "llvm/ADT/SetVector.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
@@ -24,6 +25,10 @@
using namespace llvm;
+STATISTIC(NumDCEDeleted, "Number of instructions deleted by DCE");
+STATISTIC(NumDCEFoldedLoads, "Number of single use loads folded after DCE");
+STATISTIC(NumFracRanges, "Number of live ranges fractured by DCE");
+
LiveInterval &LiveRangeEdit::createFrom(unsigned OldReg,
LiveIntervals &LIS,
VirtRegMap &VRM) {
@@ -199,6 +204,7 @@ bool LiveRangeEdit::foldAsLoad(LiveInterval *LI,
UseMI->eraseFromParent();
DefMI->addRegisterDead(LI->reg, 0);
Dead.push_back(DefMI);
+ ++NumDCEFoldedLoads;
return true;
}
@@ -269,6 +275,7 @@ void LiveRangeEdit::eliminateDeadDefs(SmallVectorImpl<MachineInstr*> &Dead,
delegate_->LRE_WillEraseInstruction(MI);
LIS.RemoveMachineInstrFromMaps(MI);
MI->eraseFromParent();
+ ++NumDCEDeleted;
}
if (ToShrink.empty())
@@ -290,6 +297,7 @@ void LiveRangeEdit::eliminateDeadDefs(SmallVectorImpl<MachineInstr*> &Dead,
unsigned NumComp = ConEQ.Classify(LI);
if (NumComp <= 1)
continue;
+ ++NumFracRanges;
DEBUG(dbgs() << NumComp << " components: " << *LI << '\n');
SmallVector<LiveInterval*, 8> Dups(1, LI);
for (unsigned i = 1; i != NumComp; ++i) {
diff --git a/contrib/llvm/lib/CodeGen/LiveRangeEdit.h b/contrib/llvm/lib/CodeGen/LiveRangeEdit.h
index 14d227e..db6740c 100644
--- a/contrib/llvm/lib/CodeGen/LiveRangeEdit.h
+++ b/contrib/llvm/lib/CodeGen/LiveRangeEdit.h
@@ -18,8 +18,9 @@
#ifndef LLVM_CODEGEN_LIVERANGEEDIT_H
#define LLVM_CODEGEN_LIVERANGEEDIT_H
-#include "llvm/CodeGen/LiveInterval.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/CodeGen/LiveInterval.h"
namespace llvm {
@@ -113,6 +114,10 @@ public:
bool empty() const { return size() == 0; }
LiveInterval *get(unsigned idx) const { return newRegs_[idx+firstNew_]; }
+ ArrayRef<LiveInterval*> regs() const {
+ return ArrayRef<LiveInterval*>(newRegs_).slice(firstNew_);
+ }
+
/// FIXME: Temporary accessors until we can get rid of
/// LiveIntervals::AddIntervalsForSpills
SmallVectorImpl<LiveInterval*> *getNewVRegs() { return &newRegs_; }
diff --git a/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp b/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 57f3e34..68946a2 100644
--- a/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -485,6 +485,30 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
<< " -- BB#" << NMBB->getNumber()
<< " -- BB#" << Succ->getNumber() << '\n');
+ // On some targets like Mips, branches may kill virtual registers. Make sure
+ // that LiveVariables is properly updated after updateTerminator replaces the
+ // terminators.
+ LiveVariables *LV = P->getAnalysisIfAvailable<LiveVariables>();
+
+ // Collect a list of virtual registers killed by the terminators.
+ SmallVector<unsigned, 4> KilledRegs;
+ if (LV)
+ for (iterator I = getFirstTerminator(), E = end(); I != E; ++I) {
+ MachineInstr *MI = I;
+ for (MachineInstr::mop_iterator OI = MI->operands_begin(),
+ OE = MI->operands_end(); OI != OE; ++OI) {
+ if (!OI->isReg() || !OI->isUse() || !OI->isKill() || OI->isUndef())
+ continue;
+ unsigned Reg = OI->getReg();
+ if (TargetRegisterInfo::isVirtualRegister(Reg) &&
+ LV->getVarInfo(Reg).removeKill(MI)) {
+ KilledRegs.push_back(Reg);
+ DEBUG(dbgs() << "Removing terminator kill: " << *MI);
+ OI->setIsKill(false);
+ }
+ }
+ }
+
ReplaceUsesOfBlockWith(Succ, NMBB);
updateTerminator();
@@ -502,9 +526,22 @@ MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P) {
if (i->getOperand(ni+1).getMBB() == this)
i->getOperand(ni+1).setMBB(NMBB);
- if (LiveVariables *LV =
- P->getAnalysisIfAvailable<LiveVariables>())
+ // Update LiveVariables.
+ if (LV) {
+ // Restore kills of virtual registers that were killed by the terminators.
+ while (!KilledRegs.empty()) {
+ unsigned Reg = KilledRegs.pop_back_val();
+ for (iterator I = end(), E = begin(); I != E;) {
+ if (!(--I)->addRegisterKilled(Reg, NULL, /* addIfNotFound= */ false))
+ continue;
+ LV->getVarInfo(Reg).Kills.push_back(I);
+ DEBUG(dbgs() << "Restored terminator kill: " << *I);
+ break;
+ }
+ }
+ // Update relevant live-through information.
LV->addNewBlock(NMBB, this, Succ);
+ }
if (MachineDominatorTree *MDT =
P->getAnalysisIfAvailable<MachineDominatorTree>()) {
diff --git a/contrib/llvm/lib/CodeGen/MachineFunction.cpp b/contrib/llvm/lib/CodeGen/MachineFunction.cpp
index d81e4a1..50750a5 100644
--- a/contrib/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/contrib/llvm/lib/CodeGen/MachineFunction.cpp
@@ -65,7 +65,11 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
FrameInfo->setMaxAlignment(Attribute::getStackAlignmentFromAttrs(
Fn->getAttributes().getFnAttributes()));
ConstantPool = new (Allocator) MachineConstantPool(TM.getTargetData());
- Alignment = TM.getTargetLowering()->getFunctionAlignment(F);
+ Alignment = TM.getTargetLowering()->getMinFunctionAlignment();
+ // FIXME: Shouldn't use pref alignment if explicit alignment is set on Fn.
+ if (!Fn->hasFnAttr(Attribute::OptimizeForSize))
+ Alignment = std::max(Alignment,
+ TM.getTargetLowering()->getPrefFunctionAlignment());
FunctionNumber = FunctionNum;
JumpTableInfo = 0;
}
@@ -300,31 +304,19 @@ void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
OS << "Function Live Ins: ";
for (MachineRegisterInfo::livein_iterator
I = RegInfo->livein_begin(), E = RegInfo->livein_end(); I != E; ++I) {
- if (TRI)
- OS << "%" << TRI->getName(I->first);
- else
- OS << " %physreg" << I->first;
-
+ OS << PrintReg(I->first, TRI);
if (I->second)
- OS << " in reg%" << I->second;
-
+ OS << " in " << PrintReg(I->second, TRI);
if (llvm::next(I) != E)
OS << ", ";
}
OS << '\n';
}
if (RegInfo && !RegInfo->liveout_empty()) {
- OS << "Function Live Outs: ";
+ OS << "Function Live Outs:";
for (MachineRegisterInfo::liveout_iterator
- I = RegInfo->liveout_begin(), E = RegInfo->liveout_end(); I != E; ++I){
- if (TRI)
- OS << '%' << TRI->getName(*I);
- else
- OS << "%physreg" << *I;
-
- if (llvm::next(I) != E)
- OS << " ";
- }
+ I = RegInfo->liveout_begin(), E = RegInfo->liveout_end(); I != E; ++I)
+ OS << ' ' << PrintReg(*I, TRI);
OS << '\n';
}
diff --git a/contrib/llvm/lib/CodeGen/MachineInstr.cpp b/contrib/llvm/lib/CodeGen/MachineInstr.cpp
index 71df6f8..36b0b83 100644
--- a/contrib/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/contrib/llvm/lib/CodeGen/MachineInstr.cpp
@@ -125,7 +125,8 @@ void MachineOperand::substPhysReg(unsigned Reg, const TargetRegisterInfo &TRI) {
assert(TargetRegisterInfo::isPhysicalRegister(Reg));
if (getSubReg()) {
Reg = TRI.getSubReg(Reg, getSubReg());
- assert(Reg && "Invalid SubReg for physical register");
+ // Note that getSubReg() may return 0 if the sub-register doesn't exist.
+ // That won't happen in legal code.
setSubReg(0);
}
setReg(Reg);
@@ -763,19 +764,35 @@ bool MachineInstr::isIdenticalTo(const MachineInstr *Other,
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
const MachineOperand &MO = getOperand(i);
const MachineOperand &OMO = Other->getOperand(i);
+ if (!MO.isReg()) {
+ if (!MO.isIdenticalTo(OMO))
+ return false;
+ continue;
+ }
+
// Clients may or may not want to ignore defs when testing for equality.
// For example, machine CSE pass only cares about finding common
// subexpressions, so it's safe to ignore virtual register defs.
- if (Check != CheckDefs && MO.isReg() && MO.isDef()) {
+ if (MO.isDef()) {
if (Check == IgnoreDefs)
continue;
- // Check == IgnoreVRegDefs
- if (TargetRegisterInfo::isPhysicalRegister(MO.getReg()) ||
- TargetRegisterInfo::isPhysicalRegister(OMO.getReg()))
- if (MO.getReg() != OMO.getReg())
+ else if (Check == IgnoreVRegDefs) {
+ if (TargetRegisterInfo::isPhysicalRegister(MO.getReg()) ||
+ TargetRegisterInfo::isPhysicalRegister(OMO.getReg()))
+ if (MO.getReg() != OMO.getReg())
+ return false;
+ } else {
+ if (!MO.isIdenticalTo(OMO))
return false;
- } else if (!MO.isIdenticalTo(OMO))
- return false;
+ if (Check == CheckKillDead && MO.isDead() != OMO.isDead())
+ return false;
+ }
+ } else {
+ if (!MO.isIdenticalTo(OMO))
+ return false;
+ if (Check == CheckKillDead && MO.isKill() != OMO.isKill())
+ return false;
+ }
}
return true;
}
diff --git a/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp
index 7244d5f..08ff5bb 100644
--- a/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp
@@ -79,6 +79,8 @@ MachineRegisterInfo::constrainRegClass(unsigned Reg,
unsigned
MachineRegisterInfo::createVirtualRegister(const TargetRegisterClass *RegClass){
assert(RegClass && "Cannot create register without RegClass!");
+ assert(RegClass->isAllocatable() &&
+ "Virtual register RegClass must be allocatable.");
// New virtual register number.
unsigned Reg = TargetRegisterInfo::index2VirtReg(getNumVirtRegs());
diff --git a/contrib/llvm/lib/CodeGen/MachineVerifier.cpp b/contrib/llvm/lib/CodeGen/MachineVerifier.cpp
index f95f411..471463b 100644
--- a/contrib/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/contrib/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -23,6 +23,7 @@
// the verifier errors.
//===----------------------------------------------------------------------===//
+#include "llvm/Instructions.h"
#include "llvm/Function.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/LiveVariables.h"
@@ -32,6 +33,7 @@
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
+#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetInstrInfo.h"
@@ -394,7 +396,13 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) {
if ((*I)->isLandingPad())
LandingPadSuccs.insert(*I);
}
- if (LandingPadSuccs.size() > 1)
+
+ const MCAsmInfo *AsmInfo = TM->getMCAsmInfo();
+ const BasicBlock *BB = MBB->getBasicBlock();
+ if (LandingPadSuccs.size() > 1 &&
+ !(AsmInfo &&
+ AsmInfo->getExceptionHandlingType() == ExceptionHandling::SjLj &&
+ BB && isa<SwitchInst>(BB->getTerminator())))
report("MBB has more than one landing pad successor", MBB);
// Call AnalyzeBranch. If it succeeds, there several more conditions to check.
@@ -402,11 +410,6 @@ MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) {
SmallVector<MachineOperand, 4> Cond;
if (!TII->AnalyzeBranch(*const_cast<MachineBasicBlock *>(MBB),
TBB, FBB, Cond)) {
- // If the block branches directly to a landing pad successor, pretend that
- // the landing pad is a normal block.
- LandingPadSuccs.erase(TBB);
- LandingPadSuccs.erase(FBB);
-
// Ok, AnalyzeBranch thinks it knows what's going on with this block. Let's
// check whether its answers match up with reality.
if (!TBB && !FBB) {
@@ -741,7 +744,7 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
RC = SRC;
}
if (const TargetRegisterClass *DRC = TOI.getRegClass(TRI)) {
- if (RC != DRC && !RC->hasSuperClass(DRC)) {
+ if (!RC->hasSuperClassEq(DRC)) {
report("Illegal virtual register for instruction", MO, MONum);
*OS << "Expected a " << DRC->getName() << " register, but got a "
<< RC->getName() << " register\n";
diff --git a/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp b/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp
index 60c24b7..ba8501f 100644
--- a/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -304,7 +304,7 @@ void SchedulePostRATDList::Schedule() {
if (AntiDepBreak != NULL) {
unsigned Broken =
AntiDepBreak->BreakAntiDependencies(SUnits, Begin, InsertPos,
- InsertPosIndex);
+ InsertPosIndex, DbgValues);
if (Broken != 0) {
// We made changes. Update the dependency graph.
@@ -540,10 +540,16 @@ void SchedulePostRATDList::ReleaseSucc(SUnit *SU, SDep *SuccEdge) {
#endif
--SuccSU->NumPredsLeft;
- // Compute how many cycles it will be before this actually becomes
- // available. This is the max of the start time of all predecessors plus
- // their latencies.
- SuccSU->setDepthToAtLeast(SU->getDepth() + SuccEdge->getLatency());
+ // Standard scheduler algorithms will recompute the depth of the successor
+ // here as such:
+ // SuccSU->setDepthToAtLeast(SU->getDepth() + SuccEdge->getLatency());
+ //
+ // However, we lazily compute node depth instead. Note that
+ // ScheduleNodeTopDown has already updated the depth of this node which causes
+ // all descendents to be marked dirty. Setting the successor depth explicitly
+ // here would cause depth to be recomputed for all its ancestors. If the
+ // successor is not yet ready (because of a transitively redundant edge) then
+ // this causes depth computation to be quadratic in the size of the DAG.
// If all the node's predecessors are scheduled, this node is ready
// to be scheduled. Ignore the special ExitSU node.
@@ -655,6 +661,12 @@ void SchedulePostRATDList::ListScheduleTopDown() {
ScheduleNodeTopDown(FoundSUnit, CurCycle);
HazardRec->EmitInstruction(FoundSUnit);
CycleHasInsts = true;
+ if (HazardRec->atIssueLimit()) {
+ DEBUG(dbgs() << "*** Max instructions per cycle " << CurCycle << '\n');
+ HazardRec->AdvanceCycle();
+ ++CurCycle;
+ CycleHasInsts = false;
+ }
} else {
if (CycleHasInsts) {
DEBUG(dbgs() << "*** Finished cycle " << CurCycle << '\n');
diff --git a/contrib/llvm/lib/CodeGen/RegAllocBase.h b/contrib/llvm/lib/CodeGen/RegAllocBase.h
index f431d5a..03164211 100644
--- a/contrib/llvm/lib/CodeGen/RegAllocBase.h
+++ b/contrib/llvm/lib/CodeGen/RegAllocBase.h
@@ -39,6 +39,7 @@
#include "llvm/ADT/OwningPtr.h"
#include "LiveIntervalUnion.h"
+#include "RegisterClassInfo.h"
namespace llvm {
@@ -91,6 +92,7 @@ protected:
MachineRegisterInfo *MRI;
VirtRegMap *VRM;
LiveIntervals *LIS;
+ RegisterClassInfo RegClassInfo;
LiveUnionArray PhysReg2LiveUnion;
// Current queries, one per physreg. They must be reinitialized each time we
@@ -113,6 +115,10 @@ protected:
return Queries[PhysReg];
}
+ // Invalidate all cached information about virtual registers - live ranges may
+ // have changed.
+ void invalidateVirtRegs() { ++UserTag; }
+
// The top-level driver. The output is a VirtRegMap that us updated with
// physical register assignments.
//
diff --git a/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp b/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp
index d92d80f..1d77b29 100644
--- a/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp
+++ b/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp
@@ -13,10 +13,10 @@
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "regalloc"
+#include "RegAllocBase.h"
#include "LiveDebugVariables.h"
#include "LiveIntervalUnion.h"
#include "LiveRangeEdit.h"
-#include "RegAllocBase.h"
#include "RenderMachineFunction.h"
#include "Spiller.h"
#include "VirtRegMap.h"
@@ -85,7 +85,6 @@ class RABasic : public MachineFunctionPass, public RegAllocBase
{
// context
MachineFunction *MF;
- BitVector ReservedRegs;
// analyses
LiveStacks *LS;
@@ -235,6 +234,8 @@ void RegAllocBase::init(VirtRegMap &vrm, LiveIntervals &lis) {
MRI = &vrm.getRegInfo();
VRM = &vrm;
LIS = &lis;
+ RegClassInfo.runOnMachineFunction(vrm.getMachineFunction());
+
const unsigned NumRegs = TRI->getNumRegs();
if (NumRegs != PhysReg2LiveUnion.numRegs()) {
PhysReg2LiveUnion.init(UnionAllocator, NumRegs);
@@ -309,7 +310,7 @@ void RegAllocBase::allocatePhysRegs() {
}
// Invalidate all interference queries, live ranges could have changed.
- ++UserTag;
+ invalidateVirtRegs();
// selectOrSplit requests the allocator to return an available physical
// register if possible and populate a list of new live intervals that
@@ -321,6 +322,23 @@ void RegAllocBase::allocatePhysRegs() {
VirtRegVec SplitVRegs;
unsigned AvailablePhysReg = selectOrSplit(*VirtReg, SplitVRegs);
+ if (AvailablePhysReg == ~0u) {
+ // selectOrSplit failed to find a register!
+ std::string msg;
+ raw_string_ostream Msg(msg);
+ Msg << "Ran out of registers during register allocation!"
+ "\nCannot allocate: " << *VirtReg;
+ for (MachineRegisterInfo::reg_iterator I = MRI->reg_begin(VirtReg->reg);
+ MachineInstr *MI = I.skipInstruction();) {
+ if (!MI->isInlineAsm())
+ continue;
+ Msg << "\nPlease check your inline asm statement for "
+ "invalid constraints:\n";
+ MI->print(Msg, &VRM->getMachineFunction().getTarget());
+ }
+ report_fatal_error(Msg.str());
+ }
+
if (AvailablePhysReg)
assign(*VirtReg, AvailablePhysReg);
@@ -462,14 +480,11 @@ unsigned RABasic::selectOrSplit(LiveInterval &VirtReg,
SmallVector<unsigned, 8> PhysRegSpillCands;
// Check for an available register in this class.
- const TargetRegisterClass *TRC = MRI->getRegClass(VirtReg.reg);
-
- for (TargetRegisterClass::iterator I = TRC->allocation_order_begin(*MF),
- E = TRC->allocation_order_end(*MF);
- I != E; ++I) {
-
+ ArrayRef<unsigned> Order =
+ RegClassInfo.getOrder(MRI->getRegClass(VirtReg.reg));
+ for (ArrayRef<unsigned>::iterator I = Order.begin(), E = Order.end(); I != E;
+ ++I) {
unsigned PhysReg = *I;
- if (ReservedRegs.test(PhysReg)) continue;
// Check interference and as a side effect, intialize queries for this
// VirtReg and its aliases.
@@ -498,8 +513,11 @@ unsigned RABasic::selectOrSplit(LiveInterval &VirtReg,
// Tell the caller to allocate to this newly freed physical register.
return *PhysRegI;
}
+
// No other spill candidates were found, so spill the current VirtReg.
DEBUG(dbgs() << "spilling: " << VirtReg << '\n');
+ if (!VirtReg.isSpillable())
+ return ~0u;
LiveRangeEdit LRE(VirtReg, SplitVRegs);
spiller().spill(LRE);
@@ -517,9 +535,6 @@ bool RABasic::runOnMachineFunction(MachineFunction &mf) {
DEBUG(RMF = &getAnalysis<RenderMachineFunction>());
RegAllocBase::init(getAnalysis<VirtRegMap>(), getAnalysis<LiveIntervals>());
-
- ReservedRegs = TRI->getReservedRegs(*MF);
-
SpillerInstance.reset(createInlineSpiller(*this, *MF, *VRM));
allocatePhysRegs();
diff --git a/contrib/llvm/lib/CodeGen/RegAllocFast.cpp b/contrib/llvm/lib/CodeGen/RegAllocFast.cpp
index b2fd6e0..9765203 100644
--- a/contrib/llvm/lib/CodeGen/RegAllocFast.cpp
+++ b/contrib/llvm/lib/CodeGen/RegAllocFast.cpp
@@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "regalloc"
+#include "RegisterClassInfo.h"
#include "llvm/BasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
@@ -58,6 +59,7 @@ namespace {
MachineRegisterInfo *MRI;
const TargetRegisterInfo *TRI;
const TargetInstrInfo *TII;
+ RegisterClassInfo RegClassInfo;
// Basic block currently being allocated.
MachineBasicBlock *MBB;
@@ -113,9 +115,6 @@ namespace {
// instruction, and so cannot be allocated.
BitVector UsedInInstr;
- // Allocatable - vector of allocatable physical registers.
- BitVector Allocatable;
-
// SkippedInstrs - Descriptors of instructions whose clobber list was
// ignored because all registers were spilled. It is still necessary to
// mark all the clobbered registers as used by the function.
@@ -483,7 +482,7 @@ void RAFast::allocVirtReg(MachineInstr *MI, LiveRegEntry &LRE, unsigned Hint) {
// Ignore invalid hints.
if (Hint && (!TargetRegisterInfo::isPhysicalRegister(Hint) ||
- !RC->contains(Hint) || !Allocatable.test(Hint)))
+ !RC->contains(Hint) || !RegClassInfo.isAllocatable(Hint)))
Hint = 0;
// Take hint when possible.
@@ -499,14 +498,12 @@ void RAFast::allocVirtReg(MachineInstr *MI, LiveRegEntry &LRE, unsigned Hint) {
}
}
- TargetRegisterClass::iterator AOB = RC->allocation_order_begin(*MF);
- TargetRegisterClass::iterator AOE = RC->allocation_order_end(*MF);
+ ArrayRef<unsigned> AO = RegClassInfo.getOrder(RC);
// First try to find a completely free register.
- for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
+ for (ArrayRef<unsigned>::iterator I = AO.begin(), E = AO.end(); I != E; ++I) {
unsigned PhysReg = *I;
- if (PhysRegState[PhysReg] == regFree && !UsedInInstr.test(PhysReg) &&
- Allocatable.test(PhysReg))
+ if (PhysRegState[PhysReg] == regFree && !UsedInInstr.test(PhysReg))
return assignVirtToPhysReg(LRE, PhysReg);
}
@@ -514,11 +511,7 @@ void RAFast::allocVirtReg(MachineInstr *MI, LiveRegEntry &LRE, unsigned Hint) {
<< RC->getName() << "\n");
unsigned BestReg = 0, BestCost = spillImpossible;
- for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
- if (!Allocatable.test(*I)) {
- DEBUG(dbgs() << "\tRegister " << *I << " is not allocatable.\n");
- continue;
- }
+ for (ArrayRef<unsigned>::iterator I = AO.begin(), E = AO.end(); I != E; ++I) {
unsigned Cost = calcSpillCost(*I);
DEBUG(dbgs() << "\tRegister: " << *I << "\n");
DEBUG(dbgs() << "\tCost: " << Cost << "\n");
@@ -772,7 +765,7 @@ void RAFast::AllocateBasicBlock() {
// Add live-in registers as live.
for (MachineBasicBlock::livein_iterator I = MBB->livein_begin(),
E = MBB->livein_end(); I != E; ++I)
- if (Allocatable.test(*I))
+ if (RegClassInfo.isAllocatable(*I))
definePhysReg(MII, *I, regReserved);
SmallVector<unsigned, 8> VirtDead;
@@ -903,7 +896,7 @@ void RAFast::AllocateBasicBlock() {
}
continue;
}
- if (!Allocatable.test(Reg)) continue;
+ if (!RegClassInfo.isAllocatable(Reg)) continue;
if (MO.isUse()) {
usePhysReg(MO);
} else if (MO.isEarlyClobber()) {
@@ -992,7 +985,7 @@ void RAFast::AllocateBasicBlock() {
unsigned Reg = MO.getReg();
if (TargetRegisterInfo::isPhysicalRegister(Reg)) {
- if (!Allocatable.test(Reg)) continue;
+ if (!RegClassInfo.isAllocatable(Reg)) continue;
definePhysReg(MI, Reg, (MO.isImplicit() || MO.isDead()) ?
regFree : regReserved);
continue;
@@ -1048,9 +1041,8 @@ bool RAFast::runOnMachineFunction(MachineFunction &Fn) {
TM = &Fn.getTarget();
TRI = TM->getRegisterInfo();
TII = TM->getInstrInfo();
-
+ RegClassInfo.runOnMachineFunction(Fn);
UsedInInstr.resize(TRI->getNumRegs());
- Allocatable = TRI->getAllocatableSet(*MF);
// initialize the virtual->physical register map to have a 'null'
// mapping for all virtual registers
diff --git a/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp b/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 7c461d8..8d06325 100644
--- a/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -62,7 +62,6 @@ class RAGreedy : public MachineFunctionPass,
// context
MachineFunction *MF;
- BitVector ReservedRegs;
// analyses
SlotIndexes *Indexes;
@@ -72,6 +71,7 @@ class RAGreedy : public MachineFunctionPass,
MachineLoopRanges *LoopRanges;
EdgeBundles *Bundles;
SpillPlacement *SpillPlacer;
+ LiveDebugVariables *DebugVars;
// state
std::auto_ptr<Spiller> SpillerInstance;
@@ -99,6 +99,8 @@ class RAGreedy : public MachineFunctionPass,
RS_Spill ///< Produced by spilling.
};
+ static const char *const StageName[];
+
IndexedMap<unsigned char, VirtReg2IndexFunctor> LRStage;
LiveRangeStage getStage(const LiveInterval &VirtReg) const {
@@ -115,6 +117,15 @@ class RAGreedy : public MachineFunctionPass,
}
}
+ // Eviction. Sometimes an assigned live range can be evicted without
+ // conditions, but other times it must be split after being evicted to avoid
+ // infinite loops.
+ enum CanEvict {
+ CE_Never, ///< Can never evict.
+ CE_Always, ///< Can always evict.
+ CE_WithSplit ///< Can evict only if range is also split or spilled.
+ };
+
// splitting state.
std::auto_ptr<SplitAnalysis> SA;
std::auto_ptr<SplitEditor> SE;
@@ -143,10 +154,6 @@ class RAGreedy : public MachineFunctionPass,
/// class.
SmallVector<GlobalSplitCandidate, 32> GlobalCand;
- /// For every instruction in SA->UseSlots, store the previous non-copy
- /// instruction.
- SmallVector<SlotIndex, 8> PrevSlot;
-
public:
RAGreedy();
@@ -183,9 +190,7 @@ private:
void splitAroundRegion(LiveInterval&, GlobalSplitCandidate&,
SmallVectorImpl<LiveInterval*>&);
void calcGapWeights(unsigned, SmallVectorImpl<float>&);
- SlotIndex getPrevMappedIndex(const MachineInstr*);
- void calcPrevSlots();
- unsigned nextSplitPoint(unsigned);
+ CanEvict canEvict(LiveInterval &A, LiveInterval &B);
bool canEvictInterference(LiveInterval&, unsigned, float&);
unsigned tryAssign(LiveInterval&, AllocationOrder&,
@@ -203,6 +208,17 @@ private:
char RAGreedy::ID = 0;
+#ifndef NDEBUG
+const char *const RAGreedy::StageName[] = {
+ "RS_New",
+ "RS_First",
+ "RS_Second",
+ "RS_Global",
+ "RS_Local",
+ "RS_Spill"
+};
+#endif
+
// Hysteresis to use when comparing floats.
// This helps stabilize decisions based on float comparisons.
const float Hysteresis = 0.98f;
@@ -377,6 +393,20 @@ unsigned RAGreedy::tryAssign(LiveInterval &VirtReg,
// Interference eviction
//===----------------------------------------------------------------------===//
+/// canEvict - determine if A can evict the assigned live range B. The eviction
+/// policy defined by this function together with the allocation order defined
+/// by enqueue() decides which registers ultimately end up being split and
+/// spilled.
+///
+/// This function must define a non-circular relation when it returns CE_Always,
+/// otherwise infinite eviction loops are possible. When evicting a <= RS_Second
+/// range, it is possible to return CE_WithSplit which forces the evicted
+/// register to be split or spilled before it can evict anything again. That
+/// guarantees progress.
+RAGreedy::CanEvict RAGreedy::canEvict(LiveInterval &A, LiveInterval &B) {
+ return A.weight > B.weight ? CE_Always : CE_Never;
+}
+
/// canEvict - Return true if all interferences between VirtReg and PhysReg can
/// be evicted.
/// Return false if any interference is heavier than MaxWeight.
@@ -397,6 +427,16 @@ bool RAGreedy::canEvictInterference(LiveInterval &VirtReg, unsigned PhysReg,
return false;
if (Intf->weight >= MaxWeight)
return false;
+ switch (canEvict(VirtReg, *Intf)) {
+ case CE_Always:
+ break;
+ case CE_Never:
+ return false;
+ case CE_WithSplit:
+ if (getStage(*Intf) > RS_Second)
+ return false;
+ break;
+ }
Weight = std::max(Weight, Intf->weight);
}
}
@@ -415,7 +455,7 @@ unsigned RAGreedy::tryEvict(LiveInterval &VirtReg,
NamedRegionTimer T("Evict", TimerGroupName, TimePassesIsEnabled);
// Keep track of the lightest single interference seen so far.
- float BestWeight = VirtReg.weight;
+ float BestWeight = HUGE_VALF;
unsigned BestPhys = 0;
Order.rewind();
@@ -456,6 +496,11 @@ unsigned RAGreedy::tryEvict(LiveInterval &VirtReg,
unassign(*Intf, VRM->getPhys(Intf->reg));
++NumEvicted;
NewVRegs.push_back(Intf);
+ // Prevent looping by forcing the evicted ranges to be split before they
+ // can evict anything else.
+ if (getStage(*Intf) < RS_Second &&
+ canEvict(VirtReg, *Intf) == CE_WithSplit)
+ LRStage[Intf->reg] = RS_Second;
}
}
return BestPhys;
@@ -499,7 +544,7 @@ bool RAGreedy::addSplitConstraints(InterferenceCache::Cursor Intf,
BC.Entry = SpillPlacement::MustSpill, ++Ins;
else if (Intf.first() < BI.FirstUse)
BC.Entry = SpillPlacement::PrefSpill, ++Ins;
- else if (Intf.first() < (BI.LiveThrough ? BI.LastUse : BI.Kill))
+ else if (Intf.first() < BI.LastUse)
++Ins;
}
@@ -509,7 +554,7 @@ bool RAGreedy::addSplitConstraints(InterferenceCache::Cursor Intf,
BC.Exit = SpillPlacement::MustSpill, ++Ins;
else if (Intf.last() > BI.LastUse)
BC.Exit = SpillPlacement::PrefSpill, ++Ins;
- else if (Intf.last() > (BI.LiveThrough ? BI.FirstUse : BI.Def))
+ else if (Intf.last() > BI.FirstUse)
++Ins;
}
@@ -758,7 +803,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg,
DEBUG(dbgs() << ", no interference");
if (!BI.LiveThrough) {
DEBUG(dbgs() << ", not live-through.\n");
- SE->useIntv(SE->enterIntvBefore(BI.Def), Stop);
+ SE->useIntv(SE->enterIntvBefore(BI.FirstUse), Stop);
continue;
}
if (!RegIn) {
@@ -775,10 +820,10 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg,
// Block has interference.
DEBUG(dbgs() << ", interference to " << Intf.last());
- if (!BI.LiveThrough && Intf.last() <= BI.Def) {
+ if (!BI.LiveThrough && Intf.last() <= BI.FirstUse) {
// The interference doesn't reach the outgoing segment.
- DEBUG(dbgs() << " doesn't affect def from " << BI.Def << '\n');
- SE->useIntv(BI.Def, Stop);
+ DEBUG(dbgs() << " doesn't affect def from " << BI.FirstUse << '\n');
+ SE->useIntv(BI.FirstUse, Stop);
continue;
}
@@ -834,7 +879,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg,
DEBUG(dbgs() << ", no interference");
if (!BI.LiveThrough) {
DEBUG(dbgs() << ", killed in block.\n");
- SE->useIntv(Start, SE->leaveIntvAfter(BI.Kill));
+ SE->useIntv(Start, SE->leaveIntvAfter(BI.LastUse));
continue;
}
if (!RegOut) {
@@ -867,10 +912,10 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg,
// Block has interference.
DEBUG(dbgs() << ", interference from " << Intf.first());
- if (!BI.LiveThrough && Intf.first() >= BI.Kill) {
+ if (!BI.LiveThrough && Intf.first() >= BI.LastUse) {
// The interference doesn't reach the outgoing segment.
- DEBUG(dbgs() << " doesn't affect kill at " << BI.Kill << '\n');
- SE->useIntv(Start, BI.Kill);
+ DEBUG(dbgs() << " doesn't affect kill at " << BI.LastUse << '\n');
+ SE->useIntv(Start, BI.LastUse);
continue;
}
@@ -920,8 +965,10 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg,
SmallVector<unsigned, 8> IntvMap;
SE->finish(&IntvMap);
+ DebugVars->splitRegister(VirtReg.reg, LREdit.regs());
+
LRStage.resize(MRI->getNumVirtRegs());
- unsigned OrigBlocks = SA->getNumThroughBlocks() + SA->getUseBlocks().size();
+ unsigned OrigBlocks = SA->getNumLiveBlocks();
// Sort out the new intervals created by splitting. We get four kinds:
// - Remainder intervals should not be split again.
@@ -1083,47 +1130,6 @@ void RAGreedy::calcGapWeights(unsigned PhysReg,
}
}
-/// getPrevMappedIndex - Return the slot index of the last non-copy instruction
-/// before MI that has a slot index. If MI is the first mapped instruction in
-/// its block, return the block start index instead.
-///
-SlotIndex RAGreedy::getPrevMappedIndex(const MachineInstr *MI) {
- assert(MI && "Missing MachineInstr");
- const MachineBasicBlock *MBB = MI->getParent();
- MachineBasicBlock::const_iterator B = MBB->begin(), I = MI;
- while (I != B)
- if (!(--I)->isDebugValue() && !I->isCopy())
- return Indexes->getInstructionIndex(I);
- return Indexes->getMBBStartIdx(MBB);
-}
-
-/// calcPrevSlots - Fill in the PrevSlot array with the index of the previous
-/// real non-copy instruction for each instruction in SA->UseSlots.
-///
-void RAGreedy::calcPrevSlots() {
- const SmallVectorImpl<SlotIndex> &Uses = SA->UseSlots;
- PrevSlot.clear();
- PrevSlot.reserve(Uses.size());
- for (unsigned i = 0, e = Uses.size(); i != e; ++i) {
- const MachineInstr *MI = Indexes->getInstructionFromIndex(Uses[i]);
- PrevSlot.push_back(getPrevMappedIndex(MI).getDefIndex());
- }
-}
-
-/// nextSplitPoint - Find the next index into SA->UseSlots > i such that it may
-/// be beneficial to split before UseSlots[i].
-///
-/// 0 is always a valid split point
-unsigned RAGreedy::nextSplitPoint(unsigned i) {
- const SmallVectorImpl<SlotIndex> &Uses = SA->UseSlots;
- const unsigned Size = Uses.size();
- assert(i != Size && "No split points after the end");
- // Allow split before i when Uses[i] is not adjacent to the previous use.
- while (++i != Size && PrevSlot[i].getBaseIndex() <= Uses[i-1].getBaseIndex())
- ;
- return i;
-}
-
/// tryLocalSplit - Try to split VirtReg into smaller intervals inside its only
/// basic block.
///
@@ -1151,11 +1157,27 @@ unsigned RAGreedy::tryLocalSplit(LiveInterval &VirtReg, AllocationOrder &Order,
dbgs() << '\n';
});
- // For every use, find the previous mapped non-copy instruction.
- // We use this to detect valid split points, and to estimate new interval
- // sizes.
- calcPrevSlots();
+ // Since we allow local split results to be split again, there is a risk of
+ // creating infinite loops. It is tempting to require that the new live
+ // ranges have less instructions than the original. That would guarantee
+ // convergence, but it is too strict. A live range with 3 instructions can be
+ // split 2+3 (including the COPY), and we want to allow that.
+ //
+ // Instead we use these rules:
+ //
+ // 1. Allow any split for ranges with getStage() < RS_Local. (Except for the
+ // noop split, of course).
+ // 2. Require progress be made for ranges with getStage() >= RS_Local. All
+ // the new ranges must have fewer instructions than before the split.
+ // 3. New ranges with the same number of instructions are marked RS_Local,
+ // smaller ranges are marked RS_New.
+ //
+ // These rules allow a 3 -> 2+3 split once, which we need. They also prevent
+ // excessive splitting and infinite loops.
+ //
+ bool ProgressRequired = getStage(VirtReg) >= RS_Local;
+ // Best split candidate.
unsigned BestBefore = NumGaps;
unsigned BestAfter = 0;
float BestDiff = 0;
@@ -1173,13 +1195,11 @@ unsigned RAGreedy::tryLocalSplit(LiveInterval &VirtReg, AllocationOrder &Order,
// The new spill weight must be larger than any gap interference.
// We will split before Uses[SplitBefore] and after Uses[SplitAfter].
- unsigned SplitBefore = 0, SplitAfter = nextSplitPoint(1) - 1;
+ unsigned SplitBefore = 0, SplitAfter = 1;
// MaxGap should always be max(GapWeight[SplitBefore..SplitAfter-1]).
// It is the spill weight that needs to be evicted.
float MaxGap = GapWeight[0];
- for (unsigned i = 1; i != SplitAfter; ++i)
- MaxGap = std::max(MaxGap, GapWeight[i]);
for (;;) {
// Live before/after split?
@@ -1197,32 +1217,22 @@ unsigned RAGreedy::tryLocalSplit(LiveInterval &VirtReg, AllocationOrder &Order,
}
// Should the interval be extended or shrunk?
bool Shrink = true;
- if (MaxGap < HUGE_VALF) {
- // Estimate the new spill weight.
- //
- // Each instruction reads and writes the register, except the first
- // instr doesn't read when !FirstLive, and the last instr doesn't write
- // when !LastLive.
- //
- // We will be inserting copies before and after, so the total number of
- // reads and writes is 2 * EstUses.
- //
- const unsigned EstUses = 2*(SplitAfter - SplitBefore) +
- 2*(LiveBefore + LiveAfter);
- // Try to guess the size of the new interval. This should be trivial,
- // but the slot index of an inserted copy can be a lot smaller than the
- // instruction it is inserted before if there are many dead indexes
- // between them.
- //
- // We measure the distance from the instruction before SplitBefore to
- // get a conservative estimate.
- //
- // The final distance can still be different if inserting copies
- // triggers a slot index renumbering.
+ // How many gaps would the new range have?
+ unsigned NewGaps = LiveBefore + SplitAfter - SplitBefore + LiveAfter;
+
+ // Legally, without causing looping?
+ bool Legal = !ProgressRequired || NewGaps < NumGaps;
+
+ if (Legal && MaxGap < HUGE_VALF) {
+ // Estimate the new spill weight. Each instruction reads or writes the
+ // register. Conservatively assume there are no read-modify-write
+ // instructions.
//
- const float EstWeight = normalizeSpillWeight(blockFreq * EstUses,
- PrevSlot[SplitBefore].distance(Uses[SplitAfter]));
+ // Try to guess the size of the new interval.
+ const float EstWeight = normalizeSpillWeight(blockFreq * (NewGaps + 1),
+ Uses[SplitBefore].distance(Uses[SplitAfter]) +
+ (LiveBefore + LiveAfter)*SlotIndex::InstrDist);
// Would this split be possible to allocate?
// Never allocate all gaps, we wouldn't be making progress.
DEBUG(dbgs() << " w=" << EstWeight);
@@ -1240,8 +1250,7 @@ unsigned RAGreedy::tryLocalSplit(LiveInterval &VirtReg, AllocationOrder &Order,
// Try to shrink.
if (Shrink) {
- SplitBefore = nextSplitPoint(SplitBefore);
- if (SplitBefore < SplitAfter) {
+ if (++SplitBefore < SplitAfter) {
DEBUG(dbgs() << " shrink\n");
// Recompute the max when necessary.
if (GapWeight[SplitBefore - 1] >= MaxGap) {
@@ -1261,10 +1270,7 @@ unsigned RAGreedy::tryLocalSplit(LiveInterval &VirtReg, AllocationOrder &Order,
}
DEBUG(dbgs() << " extend\n");
- for (unsigned e = nextSplitPoint(SplitAfter + 1) - 1;
- SplitAfter != e; ++SplitAfter)
- MaxGap = std::max(MaxGap, GapWeight[SplitAfter]);
- continue;
+ MaxGap = std::max(MaxGap, GapWeight[SplitAfter++]);
}
}
@@ -1283,8 +1289,27 @@ unsigned RAGreedy::tryLocalSplit(LiveInterval &VirtReg, AllocationOrder &Order,
SlotIndex SegStart = SE->enterIntvBefore(Uses[BestBefore]);
SlotIndex SegStop = SE->leaveIntvAfter(Uses[BestAfter]);
SE->useIntv(SegStart, SegStop);
- SE->finish();
- setStage(NewVRegs.begin(), NewVRegs.end(), RS_Local);
+ SmallVector<unsigned, 8> IntvMap;
+ SE->finish(&IntvMap);
+ DebugVars->splitRegister(VirtReg.reg, LREdit.regs());
+
+ // If the new range has the same number of instructions as before, mark it as
+ // RS_Local so the next split will be forced to make progress. Otherwise,
+ // leave the new intervals as RS_New so they can compete.
+ bool LiveBefore = BestBefore != 0 || BI.LiveIn;
+ bool LiveAfter = BestAfter != NumGaps || BI.LiveOut;
+ unsigned NewGaps = LiveBefore + BestAfter - BestBefore + LiveAfter;
+ if (NewGaps >= NumGaps) {
+ DEBUG(dbgs() << "Tagging non-progress ranges: ");
+ assert(!ProgressRequired && "Didn't make progress when it was required.");
+ LRStage.resize(MRI->getNumVirtRegs());
+ for (unsigned i = 0, e = IntvMap.size(); i != e; ++i)
+ if (IntvMap[i] == 1) {
+ LRStage[LREdit.get(i)->reg] = RS_Local;
+ DEBUG(dbgs() << PrintReg(LREdit.get(i)->reg));
+ }
+ DEBUG(dbgs() << '\n');
+ }
++NumLocalSplits;
return 0;
@@ -1315,6 +1340,17 @@ unsigned RAGreedy::trySplit(LiveInterval &VirtReg, AllocationOrder &Order,
SA->analyze(&VirtReg);
+ // FIXME: SplitAnalysis may repair broken live ranges coming from the
+ // coalescer. That may cause the range to become allocatable which means that
+ // tryRegionSplit won't be making progress. This check should be replaced with
+ // an assertion when the coalescer is fixed.
+ if (SA->didRepairRange()) {
+ // VirtReg has changed, so all cached queries are invalid.
+ invalidateVirtRegs();
+ if (unsigned PhysReg = tryAssign(VirtReg, Order, NewVRegs))
+ return PhysReg;
+ }
+
// First try to split around a region spanning multiple blocks.
unsigned PhysReg = tryRegionSplit(VirtReg, Order, NewVRegs);
if (PhysReg || !NewVRegs.empty())
@@ -1343,19 +1379,25 @@ unsigned RAGreedy::trySplit(LiveInterval &VirtReg, AllocationOrder &Order,
unsigned RAGreedy::selectOrSplit(LiveInterval &VirtReg,
SmallVectorImpl<LiveInterval*> &NewVRegs) {
// First try assigning a free register.
- AllocationOrder Order(VirtReg.reg, *VRM, ReservedRegs);
+ AllocationOrder Order(VirtReg.reg, *VRM, RegClassInfo);
if (unsigned PhysReg = tryAssign(VirtReg, Order, NewVRegs))
return PhysReg;
- if (unsigned PhysReg = tryEvict(VirtReg, Order, NewVRegs))
- return PhysReg;
+ LiveRangeStage Stage = getStage(VirtReg);
+ DEBUG(dbgs() << StageName[Stage] << '\n');
+
+ // Try to evict a less worthy live range, but only for ranges from the primary
+ // queue. The RS_Second ranges already failed to do this, and they should not
+ // get a second chance until they have been split.
+ if (Stage != RS_Second)
+ if (unsigned PhysReg = tryEvict(VirtReg, Order, NewVRegs))
+ return PhysReg;
assert(NewVRegs.empty() && "Cannot append to existing NewVRegs");
// The first time we see a live range, don't try to split or spill.
// Wait until the second time, when all smaller ranges have been allocated.
// This gives a better picture of the interference to split around.
- LiveRangeStage Stage = getStage(VirtReg);
if (Stage == RS_First) {
LRStage[VirtReg.reg] = RS_Second;
DEBUG(dbgs() << "wait for second round\n");
@@ -1363,7 +1405,10 @@ unsigned RAGreedy::selectOrSplit(LiveInterval &VirtReg,
return 0;
}
- assert(Stage < RS_Spill && "Cannot allocate after spilling");
+ // If we couldn't allocate a register from spilling, there is probably some
+ // invalid inline assembly. The base class wil report it.
+ if (Stage >= RS_Spill)
+ return ~0u;
// Try splitting VirtReg or interferences.
unsigned PhysReg = trySplit(VirtReg, Order, NewVRegs);
@@ -1396,12 +1441,12 @@ bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
RegAllocBase::init(getAnalysis<VirtRegMap>(), getAnalysis<LiveIntervals>());
Indexes = &getAnalysis<SlotIndexes>();
DomTree = &getAnalysis<MachineDominatorTree>();
- ReservedRegs = TRI->getReservedRegs(*MF);
SpillerInstance.reset(createInlineSpiller(*this, *MF, *VRM));
Loops = &getAnalysis<MachineLoopInfo>();
LoopRanges = &getAnalysis<MachineLoopRanges>();
Bundles = &getAnalysis<EdgeBundles>();
SpillPlacer = &getAnalysis<SpillPlacement>();
+ DebugVars = &getAnalysis<LiveDebugVariables>();
SA.reset(new SplitAnalysis(*VRM, *LIS, *Loops));
SE.reset(new SplitEditor(*SA, *LIS, *VRM, *DomTree));
@@ -1420,7 +1465,7 @@ bool RAGreedy::runOnMachineFunction(MachineFunction &mf) {
}
// Write out new DBG_VALUE instructions.
- getAnalysis<LiveDebugVariables>().emitDebugValues(VRM);
+ DebugVars->emitDebugValues(VRM);
// The pass output is in VirtRegMap. Release all the transient data.
releaseMemory();
diff --git a/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp b/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp
new file mode 100644
index 0000000..75b0c90
--- /dev/null
+++ b/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp
@@ -0,0 +1,114 @@
+//===-- RegisterClassInfo.cpp - Dynamic Register Class Info ---------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the RegisterClassInfo class which provides dynamic
+// information about target register classes. Callee saved and reserved
+// registers depends on calling conventions and other dynamic information, so
+// some things cannot be determined statically.
+//
+//===----------------------------------------------------------------------===//
+
+#define DEBUG_TYPE "regalloc"
+#include "RegisterClassInfo.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/Target/TargetMachine.h"
+
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm;
+
+RegisterClassInfo::RegisterClassInfo() : Tag(0), MF(0), TRI(0), CalleeSaved(0)
+{}
+
+void RegisterClassInfo::runOnMachineFunction(const MachineFunction &mf) {
+ bool Update = false;
+ MF = &mf;
+
+ // Allocate new array the first time we see a new target.
+ if (MF->getTarget().getRegisterInfo() != TRI) {
+ TRI = MF->getTarget().getRegisterInfo();
+ RegClass.reset(new RCInfo[TRI->getNumRegClasses()]);
+ Update = true;
+ }
+
+ // Does this MF have different CSRs?
+ const unsigned *CSR = TRI->getCalleeSavedRegs(MF);
+ if (Update || CSR != CalleeSaved) {
+ // Build a CSRNum map. Every CSR alias gets an entry pointing to the last
+ // overlapping CSR.
+ CSRNum.clear();
+ CSRNum.resize(TRI->getNumRegs(), 0);
+ for (unsigned N = 0; unsigned Reg = CSR[N]; ++N)
+ for (const unsigned *AS = TRI->getOverlaps(Reg);
+ unsigned Alias = *AS; ++AS)
+ CSRNum[Alias] = N + 1; // 0 means no CSR, 1 means CalleeSaved[0], ...
+ Update = true;
+ }
+ CalleeSaved = CSR;
+
+ // Different reserved registers?
+ BitVector RR = TRI->getReservedRegs(*MF);
+ if (RR != Reserved)
+ Update = true;
+ Reserved = RR;
+
+ // Invalidate cached information from previous function.
+ if (Update)
+ ++Tag;
+}
+
+/// compute - Compute the preferred allocation order for RC with reserved
+/// registers filtered out. Volatile registers come first followed by CSR
+/// aliases ordered according to the CSR order specified by the target.
+void RegisterClassInfo::compute(const TargetRegisterClass *RC) const {
+ RCInfo &RCI = RegClass[RC->getID()];
+
+ // Raw register count, including all reserved regs.
+ unsigned NumRegs = RC->getNumRegs();
+
+ if (!RCI.Order)
+ RCI.Order.reset(new unsigned[NumRegs]);
+
+ unsigned N = 0;
+ SmallVector<unsigned, 16> CSRAlias;
+
+ // FIXME: Once targets reserve registers instead of removing them from the
+ // allocation order, we can simply use begin/end here.
+ TargetRegisterClass::iterator AOB = RC->allocation_order_begin(*MF);
+ TargetRegisterClass::iterator AOE = RC->allocation_order_end(*MF);
+
+ for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
+ unsigned PhysReg = *I;
+ // Remove reserved registers from the allocation order.
+ if (Reserved.test(PhysReg))
+ continue;
+ if (CSRNum[PhysReg])
+ // PhysReg aliases a CSR, save it for later.
+ CSRAlias.push_back(PhysReg);
+ else
+ RCI.Order[N++] = PhysReg;
+ }
+ RCI.NumRegs = N + CSRAlias.size();
+ assert (RCI.NumRegs <= NumRegs && "Allocation order larger than regclass");
+
+ // CSR aliases go after the volatile registers, preserve the target's order.
+ std::copy(CSRAlias.begin(), CSRAlias.end(), &RCI.Order[N]);
+
+ DEBUG({
+ dbgs() << "AllocationOrder(" << RC->getName() << ") = [";
+ for (unsigned I = 0; I != N; ++I)
+ dbgs() << ' ' << PrintReg(RCI.Order[I], TRI);
+ dbgs() << " ]\n";
+ });
+
+ // RCI is now up-to-date.
+ RCI.Tag = Tag;
+}
+
diff --git a/contrib/llvm/lib/CodeGen/RegisterClassInfo.h b/contrib/llvm/lib/CodeGen/RegisterClassInfo.h
new file mode 100644
index 0000000..6f7d9c9
--- /dev/null
+++ b/contrib/llvm/lib/CodeGen/RegisterClassInfo.h
@@ -0,0 +1,121 @@
+//===-- RegisterClassInfo.h - Dynamic Register Class Info -*- C++ -*-------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the RegisterClassInfo class which provides dynamic
+// information about target register classes. Callee saved and reserved
+// registers depends on calling conventions and other dynamic information, so
+// some things cannot be determined statically.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CODEGEN_REGISTERCLASSINFO_H
+#define LLVM_CODEGEN_REGISTERCLASSINFO_H
+
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/OwningPtr.h"
+#include "llvm/Target/TargetRegisterInfo.h"
+
+namespace llvm {
+
+class RegisterClassInfo {
+ struct RCInfo {
+ unsigned Tag;
+ unsigned NumRegs;
+ OwningArrayPtr<unsigned> Order;
+
+ RCInfo() : Tag(0), NumRegs(0) {}
+ operator ArrayRef<unsigned>() const {
+ return ArrayRef<unsigned>(Order.get(), NumRegs);
+ }
+ };
+
+ // Brief cached information for each register class.
+ OwningArrayPtr<RCInfo> RegClass;
+
+ // Tag changes whenever cached information needs to be recomputed. An RCInfo
+ // entry is valid when its tag matches.
+ unsigned Tag;
+
+ const MachineFunction *MF;
+ const TargetRegisterInfo *TRI;
+
+ // Callee saved registers of last MF. Assumed to be valid until the next
+ // runOnFunction() call.
+ const unsigned *CalleeSaved;
+
+ // Map register number to CalleeSaved index + 1;
+ SmallVector<uint8_t, 4> CSRNum;
+
+ // Reserved registers in the current MF.
+ BitVector Reserved;
+
+ // Compute all information about RC.
+ void compute(const TargetRegisterClass *RC) const;
+
+ // Return an up-to-date RCInfo for RC.
+ const RCInfo &get(const TargetRegisterClass *RC) const {
+ const RCInfo &RCI = RegClass[RC->getID()];
+ if (Tag != RCI.Tag)
+ compute(RC);
+ return RCI;
+ }
+
+public:
+ RegisterClassInfo();
+
+ /// runOnFunction - Prepare to answer questions about MF. This must be called
+ /// before any other methods are used.
+ void runOnMachineFunction(const MachineFunction &MF);
+
+ /// getNumAllocatableRegs - Returns the number of actually allocatable
+ /// registers in RC in the current function.
+ unsigned getNumAllocatableRegs(const TargetRegisterClass *RC) const {
+ return get(RC).NumRegs;
+ }
+
+ /// getOrder - Returns the preferred allocation order for RC. The order
+ /// contains no reserved registers, and registers that alias callee saved
+ /// registers come last.
+ ArrayRef<unsigned> getOrder(const TargetRegisterClass *RC) const {
+ return get(RC);
+ }
+
+ /// getLastCalleeSavedAlias - Returns the last callee saved register that
+ /// overlaps PhysReg, or 0 if Reg doesn't overlap a CSR.
+ unsigned getLastCalleeSavedAlias(unsigned PhysReg) const {
+ assert(TargetRegisterInfo::isPhysicalRegister(PhysReg));
+ if (unsigned N = CSRNum[PhysReg])
+ return CalleeSaved[N-1];
+ return 0;
+ }
+
+ /// isReserved - Returns true when PhysReg is a reserved register.
+ ///
+ /// Reserved registers may belong to an allocatable register class, but the
+ /// target has explicitly requested that they are not used.
+ ///
+ bool isReserved(unsigned PhysReg) const {
+ return Reserved.test(PhysReg);
+ }
+
+ /// isAllocatable - Returns true when PhysReg belongs to an allocatable
+ /// register class and it hasn't been reserved.
+ ///
+ /// Allocatable registers may show up in the allocation order of some virtual
+ /// register, so a register allocator needs to track its liveness and
+ /// availability.
+ bool isAllocatable(unsigned PhysReg) const {
+ return TRI->get(PhysReg).inAllocatableClass && !isReserved(PhysReg);
+ }
+};
+} // end namespace llvm
+
+#endif
+
diff --git a/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp b/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp
index ebfe533..9e9a145 100644
--- a/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp
+++ b/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp
@@ -154,13 +154,16 @@ void RegScavenger::forward() {
BitVector DeadRegs(NumPhysRegs);
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isReg() || MO.isUndef())
+ if (!MO.isReg())
continue;
unsigned Reg = MO.getReg();
if (!Reg || isReserved(Reg))
continue;
if (MO.isUse()) {
+ // Ignore undef uses.
+ if (MO.isUndef())
+ continue;
// Two-address operands implicitly kill.
if (!isPred && (MO.isKill() || MI->isRegTiedToDefOperand(i)))
addRegWithSubRegs(KillRegs, Reg);
@@ -178,12 +181,14 @@ void RegScavenger::forward() {
// Verify uses and defs.
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isReg() || MO.isUndef())
+ if (!MO.isReg())
continue;
unsigned Reg = MO.getReg();
if (!Reg || isReserved(Reg))
continue;
if (MO.isUse()) {
+ if (MO.isUndef())
+ continue;
if (!isUsed(Reg)) {
// Check if it's partial live: e.g.
// D0 = insert_subreg D0<undef>, S0
diff --git a/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 67c209e..2363df4 100644
--- a/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -35,8 +35,9 @@ ScheduleDAGInstrs::ScheduleDAGInstrs(MachineFunction &mf,
const MachineDominatorTree &mdt)
: ScheduleDAG(mf), MLI(mli), MDT(mdt), MFI(mf.getFrameInfo()),
InstrItins(mf.getTarget().getInstrItineraryData()),
- Defs(TRI->getNumRegs()), Uses(TRI->getNumRegs()), LoopRegs(MLI, MDT) {
- DbgValueVec.clear();
+ Defs(TRI->getNumRegs()), Uses(TRI->getNumRegs()),
+ LoopRegs(MLI, MDT), FirstDbgValue(0) {
+ DbgValues.clear();
}
/// Run - perform scheduling.
@@ -120,7 +121,7 @@ static const Value *getUnderlyingObjectForInstr(const MachineInstr *MI,
// such aliases.
if (PSV->isAliased(MFI))
return 0;
-
+
MayAlias = PSV->mayAlias(MFI);
return V;
}
@@ -174,7 +175,7 @@ void ScheduleDAGInstrs::AddSchedBarrierDeps() {
for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
SE = BB->succ_end(); SI != SE; ++SI)
for (MachineBasicBlock::livein_iterator I = (*SI)->livein_begin(),
- E = (*SI)->livein_end(); I != E; ++I) {
+ E = (*SI)->livein_end(); I != E; ++I) {
unsigned Reg = *I;
if (Seen.insert(Reg))
Uses[Reg].push_back(&ExitSU);
@@ -200,11 +201,6 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
std::map<const Value *, SUnit *> AliasMemDefs, NonAliasMemDefs;
std::map<const Value *, std::vector<SUnit *> > AliasMemUses, NonAliasMemUses;
- // Keep track of dangling debug references to registers.
- std::vector<std::pair<MachineInstr*, unsigned> >
- DanglingDebugValue(TRI->getNumRegs(),
- std::make_pair(static_cast<MachineInstr*>(0), 0));
-
// Check to see if the scheduler cares about latencies.
bool UnitLatencies = ForceUnitLatencies();
@@ -214,26 +210,32 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
// Remove any stale debug info; sometimes BuildSchedGraph is called again
// without emitting the info from the previous call.
- DbgValueVec.clear();
+ DbgValues.clear();
+ FirstDbgValue = NULL;
// Model data dependencies between instructions being scheduled and the
// ExitSU.
AddSchedBarrierDeps();
+ for (int i = 0, e = TRI->getNumRegs(); i != e; ++i) {
+ assert(Defs[i].empty() && "Only BuildGraph should push/pop Defs");
+ }
+
// Walk the list of instructions, from bottom moving up.
+ MachineInstr *PrevMI = NULL;
for (MachineBasicBlock::iterator MII = InsertPos, MIE = Begin;
MII != MIE; --MII) {
MachineInstr *MI = prior(MII);
- // DBG_VALUE does not have SUnit's built, so just remember these for later
- // reinsertion.
+ if (MI && PrevMI) {
+ DbgValues.push_back(std::make_pair(PrevMI, MI));
+ PrevMI = NULL;
+ }
+
if (MI->isDebugValue()) {
- if (MI->getNumOperands()==3 && MI->getOperand(0).isReg() &&
- MI->getOperand(0).getReg())
- DanglingDebugValue[MI->getOperand(0).getReg()] =
- std::make_pair(MI, DbgValueVec.size());
- DbgValueVec.push_back(MI);
+ PrevMI = MI;
continue;
}
+
const TargetInstrDesc &TID = MI->getDesc();
assert(!TID.isTerminator() && !MI->isLabel() &&
"Cannot schedule terminators or labels!");
@@ -257,13 +259,8 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
assert(TRI->isPhysicalRegister(Reg) && "Virtual register encountered!");
- if (MO.isDef() && DanglingDebugValue[Reg].first!=0) {
- SU->DbgInstrList.push_back(DanglingDebugValue[Reg].first);
- DbgValueVec[DanglingDebugValue[Reg].second] = 0;
- DanglingDebugValue[Reg] = std::make_pair((MachineInstr*)0, 0);
- }
-
std::vector<SUnit *> &UseList = Uses[Reg];
+ // Defs are push in the order they are visited and never reordered.
std::vector<SUnit *> &DefList = Defs[Reg];
// Optionally add output and anti dependencies. For anti
// dependencies we use a latency of 0 because for a multi-issue
@@ -283,9 +280,9 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
DefSU->addPred(SDep(SU, Kind, AOLatency, /*Reg=*/Reg));
}
for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias) {
- std::vector<SUnit *> &DefList = Defs[*Alias];
- for (unsigned i = 0, e = DefList.size(); i != e; ++i) {
- SUnit *DefSU = DefList[i];
+ std::vector<SUnit *> &MemDefList = Defs[*Alias];
+ for (unsigned i = 0, e = MemDefList.size(); i != e; ++i) {
+ SUnit *DefSU = MemDefList[i];
if (DefSU == &ExitSU)
continue;
if (DefSU != SU &&
@@ -393,6 +390,16 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
UseList.clear();
if (!MO.isDead())
DefList.clear();
+
+ // Calls will not be reordered because of chain dependencies (see
+ // below). Since call operands are dead, calls may continue to be added
+ // to the DefList making dependence checking quadratic in the size of
+ // the block. Instead, we leave only one call at the back of the
+ // DefList.
+ if (SU->isCall) {
+ while (!DefList.empty() && DefList.back()->isCall)
+ DefList.pop_back();
+ }
DefList.push_back(SU);
} else {
UseList.push_back(SU);
@@ -411,11 +418,11 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
#define STORE_LOAD_LATENCY 1
unsigned TrueMemOrderLatency = 0;
if (TID.isCall() || MI->hasUnmodeledSideEffects() ||
- (MI->hasVolatileMemoryRef() &&
+ (MI->hasVolatileMemoryRef() &&
(!TID.mayLoad() || !MI->isInvariantLoad(AA)))) {
// Be conservative with these and add dependencies on all memory
// references, even those that are known to not alias.
- for (std::map<const Value *, SUnit *>::iterator I =
+ for (std::map<const Value *, SUnit *>::iterator I =
NonAliasMemDefs.begin(), E = NonAliasMemDefs.end(); I != E; ++I) {
I->second->addPred(SDep(SU, SDep::Order, /*Latency=*/0));
}
@@ -458,9 +465,9 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
// A store to a specific PseudoSourceValue. Add precise dependencies.
// Record the def in MemDefs, first adding a dep if there is
// an existing def.
- std::map<const Value *, SUnit *>::iterator I =
+ std::map<const Value *, SUnit *>::iterator I =
((MayAlias) ? AliasMemDefs.find(V) : NonAliasMemDefs.find(V));
- std::map<const Value *, SUnit *>::iterator IE =
+ std::map<const Value *, SUnit *>::iterator IE =
((MayAlias) ? AliasMemDefs.end() : NonAliasMemDefs.end());
if (I != IE) {
I->second->addPred(SDep(SU, SDep::Order, /*Latency=*/0, /*Reg=*/0,
@@ -513,39 +520,41 @@ void ScheduleDAGInstrs::BuildSchedGraph(AliasAnalysis *AA) {
if (MI->isInvariantLoad(AA)) {
// Invariant load, no chain dependencies needed!
} else {
- if (const Value *V =
+ if (const Value *V =
getUnderlyingObjectForInstr(MI, MFI, MayAlias)) {
// A load from a specific PseudoSourceValue. Add precise dependencies.
- std::map<const Value *, SUnit *>::iterator I =
+ std::map<const Value *, SUnit *>::iterator I =
((MayAlias) ? AliasMemDefs.find(V) : NonAliasMemDefs.find(V));
- std::map<const Value *, SUnit *>::iterator IE =
+ std::map<const Value *, SUnit *>::iterator IE =
((MayAlias) ? AliasMemDefs.end() : NonAliasMemDefs.end());
if (I != IE)
I->second->addPred(SDep(SU, SDep::Order, /*Latency=*/0, /*Reg=*/0,
/*isNormalMemory=*/true));
if (MayAlias)
AliasMemUses[V].push_back(SU);
- else
+ else
NonAliasMemUses[V].push_back(SU);
} else {
// A load with no underlying object. Depend on all
// potentially aliasing stores.
- for (std::map<const Value *, SUnit *>::iterator I =
+ for (std::map<const Value *, SUnit *>::iterator I =
AliasMemDefs.begin(), E = AliasMemDefs.end(); I != E; ++I)
I->second->addPred(SDep(SU, SDep::Order, /*Latency=*/0));
-
+
PendingLoads.push_back(SU);
MayAlias = true;
}
-
+
// Add dependencies on alias and barrier chains, if needed.
if (MayAlias && AliasChain)
AliasChain->addPred(SDep(SU, SDep::Order, /*Latency=*/0));
if (BarrierChain)
BarrierChain->addPred(SDep(SU, SDep::Order, /*Latency=*/0));
- }
+ }
}
}
+ if (PrevMI)
+ FirstDbgValue = PrevMI;
for (int i = 0, e = TRI->getNumRegs(); i != e; ++i) {
Defs[i].clear();
@@ -572,11 +581,11 @@ void ScheduleDAGInstrs::ComputeLatency(SUnit *SU) {
}
}
-void ScheduleDAGInstrs::ComputeOperandLatency(SUnit *Def, SUnit *Use,
+void ScheduleDAGInstrs::ComputeOperandLatency(SUnit *Def, SUnit *Use,
SDep& dep) const {
if (!InstrItins || InstrItins->isEmpty())
return;
-
+
// For a data dependency with a known register...
if ((dep.getKind() != SDep::Data) || (dep.getReg() == 0))
return;
@@ -655,39 +664,33 @@ MachineBasicBlock *ScheduleDAGInstrs::EmitSchedule() {
BB->remove(I);
}
- // First reinsert any remaining debug_values; these are either constants,
- // or refer to live-in registers. The beginning of the block is the right
- // place for the latter. The former might reasonably be placed elsewhere
- // using some kind of ordering algorithm, but right now it doesn't matter.
- for (int i = DbgValueVec.size()-1; i>=0; --i)
- if (DbgValueVec[i])
- BB->insert(InsertPos, DbgValueVec[i]);
+ // If first instruction was a DBG_VALUE then put it back.
+ if (FirstDbgValue)
+ BB->insert(InsertPos, FirstDbgValue);
// Then re-insert them according to the given schedule.
for (unsigned i = 0, e = Sequence.size(); i != e; i++) {
- SUnit *SU = Sequence[i];
- if (!SU) {
+ if (SUnit *SU = Sequence[i])
+ BB->insert(InsertPos, SU->getInstr());
+ else
// Null SUnit* is a noop.
EmitNoop();
- continue;
- }
-
- BB->insert(InsertPos, SU->getInstr());
- for (unsigned i = 0, e = SU->DbgInstrList.size() ; i < e ; ++i)
- BB->insert(InsertPos, SU->DbgInstrList[i]);
}
// Update the Begin iterator, as the first instruction in the block
// may have been scheduled later.
- if (!DbgValueVec.empty()) {
- for (int i = DbgValueVec.size()-1; i>=0; --i)
- if (DbgValueVec[i]!=0) {
- Begin = DbgValueVec[DbgValueVec.size()-1];
- break;
- }
- } else if (!Sequence.empty())
+ if (!Sequence.empty())
Begin = Sequence[0]->getInstr();
- DbgValueVec.clear();
+ // Reinsert any remaining debug_values.
+ for (std::vector<std::pair<MachineInstr *, MachineInstr *> >::iterator
+ DI = DbgValues.end(), DE = DbgValues.begin(); DI != DE; --DI) {
+ std::pair<MachineInstr *, MachineInstr *> P = *prior(DI);
+ MachineInstr *DbgValue = P.first;
+ MachineInstr *OrigPrivMI = P.second;
+ BB->insertAfter(OrigPrivMI, DbgValue);
+ }
+ DbgValues.clear();
+ FirstDbgValue = NULL;
return BB;
}
diff --git a/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.h b/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.h
index c878287..8a4ea85 100644
--- a/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.h
+++ b/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.h
@@ -110,10 +110,6 @@ namespace llvm {
std::vector<std::vector<SUnit *> > Defs;
std::vector<std::vector<SUnit *> > Uses;
- /// DbgValueVec - Remember DBG_VALUEs that refer to a particular
- /// register.
- std::vector<MachineInstr *>DbgValueVec;
-
/// PendingLoads - Remember where unknown loads are after the most recent
/// unknown store, as we iterate. As with Defs and Uses, this is here
/// to minimize construction/destruction.
@@ -128,6 +124,14 @@ namespace llvm {
///
SmallSet<unsigned, 8> LoopLiveInRegs;
+ protected:
+
+ /// DbgValues - Remember instruction that preceeds DBG_VALUE.
+ typedef std::vector<std::pair<MachineInstr *, MachineInstr *> >
+ DbgValueVector;
+ DbgValueVector DbgValues;
+ MachineInstr *FirstDbgValue;
+
public:
MachineBasicBlock::iterator Begin; // The beginning of the range to
// be scheduled. The range extends
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index f427511..e843f5f 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -165,6 +165,8 @@ namespace {
SDValue visitMULHS(SDNode *N);
SDValue visitSMUL_LOHI(SDNode *N);
SDValue visitUMUL_LOHI(SDNode *N);
+ SDValue visitSMULO(SDNode *N);
+ SDValue visitUMULO(SDNode *N);
SDValue visitSDIVREM(SDNode *N);
SDValue visitUDIVREM(SDNode *N);
SDValue visitAND(SDNode *N);
@@ -529,7 +531,8 @@ SDValue DAGCombiner::ReassociateOps(unsigned Opc, DebugLoc DL,
cast<ConstantSDNode>(N0.getOperand(1)),
cast<ConstantSDNode>(N1));
return DAG.getNode(Opc, DL, VT, N0.getOperand(0), OpNode);
- } else if (N0.hasOneUse()) {
+ }
+ if (N0.hasOneUse()) {
// reassoc. (op (op x, c1), y) -> (op (op x, y), c1) iff x+c1 has one use
SDValue OpNode = DAG.getNode(Opc, N0.getDebugLoc(), VT,
N0.getOperand(0), N1);
@@ -546,7 +549,8 @@ SDValue DAGCombiner::ReassociateOps(unsigned Opc, DebugLoc DL,
cast<ConstantSDNode>(N1.getOperand(1)),
cast<ConstantSDNode>(N0));
return DAG.getNode(Opc, DL, VT, N1.getOperand(0), OpNode);
- } else if (N1.hasOneUse()) {
+ }
+ if (N1.hasOneUse()) {
// reassoc. (op y, (op x, c1)) -> (op (op x, y), c1) iff x+c1 has one use
SDValue OpNode = DAG.getNode(Opc, N0.getDebugLoc(), VT,
N1.getOperand(0), N0);
@@ -990,6 +994,9 @@ void DAGCombiner::Run(CombineLevel AtLevel) {
dbgs() << "\nWith: ";
RV.getNode()->dump(&DAG);
dbgs() << '\n');
+
+ // Transfer debug value.
+ DAG.TransferDbgValues(SDValue(N, 0), RV);
WorkListRemover DeadNodes(*this);
if (N->getNumValues() == RV.getNode()->getNumValues())
DAG.ReplaceAllUsesWith(N, RV.getNode(), &DeadNodes);
@@ -1045,6 +1052,8 @@ SDValue DAGCombiner::visit(SDNode *N) {
case ISD::MULHS: return visitMULHS(N);
case ISD::SMUL_LOHI: return visitSMUL_LOHI(N);
case ISD::UMUL_LOHI: return visitUMUL_LOHI(N);
+ case ISD::SMULO: return visitSMULO(N);
+ case ISD::UMULO: return visitUMULO(N);
case ISD::SDIVREM: return visitSDIVREM(N);
case ISD::UDIVREM: return visitUDIVREM(N);
case ISD::AND: return visitAND(N);
@@ -1566,7 +1575,8 @@ static SDValue tryFoldToZero(DebugLoc DL, const TargetLowering &TLI, EVT VT,
SelectionDAG &DAG, bool LegalOperations) {
if (!VT.isVector()) {
return DAG.getConstant(0, VT);
- } else if (!LegalOperations || TLI.isOperationLegal(ISD::BUILD_VECTOR, VT)) {
+ }
+ if (!LegalOperations || TLI.isOperationLegal(ISD::BUILD_VECTOR, VT)) {
// Produce a vector of zeros.
SDValue El = DAG.getConstant(0, VT.getVectorElementType());
std::vector<SDValue> Ops(VT.getVectorNumElements(), El);
@@ -2174,6 +2184,26 @@ SDValue DAGCombiner::visitUMUL_LOHI(SDNode *N) {
return SDValue();
}
+SDValue DAGCombiner::visitSMULO(SDNode *N) {
+ // (smulo x, 2) -> (saddo x, x)
+ if (ConstantSDNode *C2 = dyn_cast<ConstantSDNode>(N->getOperand(1)))
+ if (C2->getAPIntValue() == 2)
+ return DAG.getNode(ISD::SADDO, N->getDebugLoc(), N->getVTList(),
+ N->getOperand(0), N->getOperand(0));
+
+ return SDValue();
+}
+
+SDValue DAGCombiner::visitUMULO(SDNode *N) {
+ // (umulo x, 2) -> (uaddo x, x)
+ if (ConstantSDNode *C2 = dyn_cast<ConstantSDNode>(N->getOperand(1)))
+ if (C2->getAPIntValue() == 2)
+ return DAG.getNode(ISD::UADDO, N->getDebugLoc(), N->getVTList(),
+ N->getOperand(0), N->getOperand(0));
+
+ return SDValue();
+}
+
SDValue DAGCombiner::visitSDIVREM(SDNode *N) {
SDValue Res = SimplifyNodeWithTwoResults(N, ISD::SDIV, ISD::SREM);
if (Res.getNode()) return Res;
@@ -3062,26 +3092,27 @@ SDValue DAGCombiner::visitSHL(SDNode *N) {
}
}
- // fold (shl (srl x, c1), c2) -> (shl (and x, (shl -1, c1)), (sub c2, c1)) or
- // (srl (and x, (shl -1, c1)), (sub c1, c2))
+ // fold (shl (srl x, c1), c2) -> (and (shl x, (sub c2, c1), MASK) or
+ // (and (srl x, (sub c1, c2), MASK)
if (N1C && N0.getOpcode() == ISD::SRL &&
N0.getOperand(1).getOpcode() == ISD::Constant) {
uint64_t c1 = cast<ConstantSDNode>(N0.getOperand(1))->getZExtValue();
if (c1 < VT.getSizeInBits()) {
uint64_t c2 = N1C->getZExtValue();
- SDValue HiBitsMask =
- DAG.getConstant(APInt::getHighBitsSet(VT.getSizeInBits(),
- VT.getSizeInBits() - c1),
- VT);
- SDValue Mask = DAG.getNode(ISD::AND, N0.getDebugLoc(), VT,
- N0.getOperand(0),
- HiBitsMask);
- if (c2 > c1)
- return DAG.getNode(ISD::SHL, N->getDebugLoc(), VT, Mask,
- DAG.getConstant(c2-c1, N1.getValueType()));
- else
- return DAG.getNode(ISD::SRL, N->getDebugLoc(), VT, Mask,
- DAG.getConstant(c1-c2, N1.getValueType()));
+ APInt Mask = APInt::getHighBitsSet(VT.getSizeInBits(),
+ VT.getSizeInBits() - c1);
+ SDValue Shift;
+ if (c2 > c1) {
+ Mask = Mask.shl(c2-c1);
+ Shift = DAG.getNode(ISD::SHL, N->getDebugLoc(), VT, N0.getOperand(0),
+ DAG.getConstant(c2-c1, N1.getValueType()));
+ } else {
+ Mask = Mask.lshr(c1-c2);
+ Shift = DAG.getNode(ISD::SRL, N->getDebugLoc(), VT, N0.getOperand(0),
+ DAG.getConstant(c1-c2, N1.getValueType()));
+ }
+ return DAG.getNode(ISD::AND, N0.getDebugLoc(), VT, Shift,
+ DAG.getConstant(Mask, VT));
}
}
// fold (shl (sra x, c1), c1) -> (and x, (shl -1, c1))
@@ -4014,7 +4045,7 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) {
EVT EltVT = VT.getVectorElementType();
SmallVector<SDValue,8> OneOps(VT.getVectorNumElements(),
DAG.getConstant(1, EltVT));
- if (VT.getSizeInBits() == N0VT.getSizeInBits()) {
+ if (VT.getSizeInBits() == N0VT.getSizeInBits())
// We know that the # elements of the results is the same as the
// # elements of the compare (and the # elements of the compare result
// for that matter). Check to see that they are the same size. If so,
@@ -4026,25 +4057,24 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) {
cast<CondCodeSDNode>(N0.getOperand(2))->get()),
DAG.getNode(ISD::BUILD_VECTOR, N->getDebugLoc(), VT,
&OneOps[0], OneOps.size()));
- } else {
- // If the desired elements are smaller or larger than the source
- // elements we can use a matching integer vector type and then
- // truncate/sign extend
- EVT MatchingElementType =
- EVT::getIntegerVT(*DAG.getContext(),
- N0VT.getScalarType().getSizeInBits());
- EVT MatchingVectorType =
- EVT::getVectorVT(*DAG.getContext(), MatchingElementType,
- N0VT.getVectorNumElements());
- SDValue VsetCC =
- DAG.getVSetCC(N->getDebugLoc(), MatchingVectorType, N0.getOperand(0),
- N0.getOperand(1),
- cast<CondCodeSDNode>(N0.getOperand(2))->get());
- return DAG.getNode(ISD::AND, N->getDebugLoc(), VT,
- DAG.getSExtOrTrunc(VsetCC, N->getDebugLoc(), VT),
- DAG.getNode(ISD::BUILD_VECTOR, N->getDebugLoc(), VT,
- &OneOps[0], OneOps.size()));
- }
+
+ // If the desired elements are smaller or larger than the source
+ // elements we can use a matching integer vector type and then
+ // truncate/sign extend
+ EVT MatchingElementType =
+ EVT::getIntegerVT(*DAG.getContext(),
+ N0VT.getScalarType().getSizeInBits());
+ EVT MatchingVectorType =
+ EVT::getVectorVT(*DAG.getContext(), MatchingElementType,
+ N0VT.getVectorNumElements());
+ SDValue VsetCC =
+ DAG.getVSetCC(N->getDebugLoc(), MatchingVectorType, N0.getOperand(0),
+ N0.getOperand(1),
+ cast<CondCodeSDNode>(N0.getOperand(2))->get());
+ return DAG.getNode(ISD::AND, N->getDebugLoc(), VT,
+ DAG.getSExtOrTrunc(VsetCC, N->getDebugLoc(), VT),
+ DAG.getNode(ISD::BUILD_VECTOR, N->getDebugLoc(), VT,
+ &OneOps[0], OneOps.size()));
}
// zext(setcc x,y,cc) -> select_cc x, y, 1, 0, cc
@@ -6494,18 +6524,18 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
// (vextract (scalar_to_vector val, 0) -> val
SDValue InVec = N->getOperand(0);
- if (InVec.getOpcode() == ISD::SCALAR_TO_VECTOR) {
- // Check if the result type doesn't match the inserted element type. A
- // SCALAR_TO_VECTOR may truncate the inserted element and the
- // EXTRACT_VECTOR_ELT may widen the extracted vector.
- SDValue InOp = InVec.getOperand(0);
- EVT NVT = N->getValueType(0);
- if (InOp.getValueType() != NVT) {
- assert(InOp.getValueType().isInteger() && NVT.isInteger());
- return DAG.getSExtOrTrunc(InOp, InVec.getDebugLoc(), NVT);
- }
- return InOp;
- }
+ if (InVec.getOpcode() == ISD::SCALAR_TO_VECTOR) {
+ // Check if the result type doesn't match the inserted element type. A
+ // SCALAR_TO_VECTOR may truncate the inserted element and the
+ // EXTRACT_VECTOR_ELT may widen the extracted vector.
+ SDValue InOp = InVec.getOperand(0);
+ EVT NVT = N->getValueType(0);
+ if (InOp.getValueType() != NVT) {
+ assert(InOp.getValueType().isInteger() && NVT.isInteger());
+ return DAG.getSExtOrTrunc(InOp, InVec.getDebugLoc(), NVT);
+ }
+ return InOp;
+ }
// Perform only after legalization to ensure build_vector / vector_shuffle
// optimizations have already been done.
@@ -6566,7 +6596,7 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
}
}
- if (!LN0 || !LN0->hasOneUse() || LN0->isVolatile())
+ if (!LN0 || !LN0->hasNUsesOfValue(1,0) || LN0->isVolatile())
return SDValue();
// If Idx was -1 above, Elt is going to be -1, so just return undef.
@@ -7505,18 +7535,17 @@ bool DAGCombiner::FindAliasInfo(SDNode *N,
SrcValueAlign = LD->getOriginalAlignment();
TBAAInfo = LD->getTBAAInfo();
return true;
- } else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
+ }
+ if (StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
Ptr = ST->getBasePtr();
Size = ST->getMemoryVT().getSizeInBits() >> 3;
SrcValue = ST->getSrcValue();
SrcValueOffset = ST->getSrcValueOffset();
SrcValueAlign = ST->getOriginalAlignment();
TBAAInfo = ST->getTBAAInfo();
- } else {
- llvm_unreachable("FindAliasInfo expected a memory operand");
+ return false;
}
-
- return false;
+ llvm_unreachable("FindAliasInfo expected a memory operand");
}
/// GatherAllAliases - Walk up chain skipping non-aliasing memory nodes,
@@ -7629,13 +7658,13 @@ SDValue DAGCombiner::FindBetterChain(SDNode *N, SDValue OldChain) {
// Accumulate all the aliases to this node.
GatherAllAliases(N, OldChain, Aliases);
- if (Aliases.size() == 0) {
- // If no operands then chain to entry token.
+ // If no operands then chain to entry token.
+ if (Aliases.size() == 0)
return DAG.getEntryNode();
- } else if (Aliases.size() == 1) {
- // If a single operand then chain to it. We don't need to revisit it.
+
+ // If a single operand then chain to it. We don't need to revisit it.
+ if (Aliases.size() == 1)
return Aliases[0];
- }
// Construct a custom tailored token factor.
return DAG.getNode(ISD::TokenFactor, N->getDebugLoc(), MVT::Other,
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 3af9482..797f174 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -44,6 +44,7 @@
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Operator.h"
+#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/FastISel.h"
#include "llvm/CodeGen/FunctionLoweringInfo.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -110,8 +111,8 @@ unsigned FastISel::getRegForValue(const Value *V) {
// of whether FastISel can handle them.
MVT VT = RealVT.getSimpleVT();
if (!TLI.isTypeLegal(VT)) {
- // Promote MVT::i1 to a legal type though, because it's common and easy.
- if (VT == MVT::i1)
+ // Handle integer promotions, though, because they're common and easy.
+ if (VT == MVT::i1 || VT == MVT::i8 || VT == MVT::i16)
VT = TLI.getTypeToTransformTo(V->getContext(), VT).getSimpleVT();
else
return 0;
@@ -234,10 +235,10 @@ unsigned FastISel::lookUpRegForValue(const Value *V) {
/// NOTE: This is only necessary because we might select a block that uses
/// a value before we select the block that defines the value. It might be
/// possible to fix this by selecting blocks in reverse postorder.
-unsigned FastISel::UpdateValueMap(const Value *I, unsigned Reg) {
+void FastISel::UpdateValueMap(const Value *I, unsigned Reg, unsigned NumRegs) {
if (!isa<Instruction>(I)) {
LocalValueMap[I] = Reg;
- return Reg;
+ return;
}
unsigned &AssignedReg = FuncInfo.ValueMap[I];
@@ -246,12 +247,11 @@ unsigned FastISel::UpdateValueMap(const Value *I, unsigned Reg) {
AssignedReg = Reg;
else if (Reg != AssignedReg) {
// Arrange for uses of AssignedReg to be replaced by uses of Reg.
- FuncInfo.RegFixups[AssignedReg] = Reg;
+ for (unsigned i = 0; i < NumRegs; i++)
+ FuncInfo.RegFixups[AssignedReg+i] = Reg+i;
AssignedReg = Reg;
}
-
- return AssignedReg;
}
std::pair<unsigned, bool> FastISel::getRegForGEPIndex(const Value *Idx) {
@@ -628,6 +628,16 @@ bool FastISel::SelectCall(const User *I) {
return true;
}
+ case Intrinsic::objectsize: {
+ ConstantInt *CI = cast<ConstantInt>(Call->getArgOperand(1));
+ unsigned long long Res = CI->isZero() ? -1ULL : 0;
+ Constant *ResCI = ConstantInt::get(Call->getType(), Res);
+ unsigned ResultReg = getRegForValue(ResCI);
+ if (ResultReg == 0)
+ return false;
+ UpdateValueMap(Call, ResultReg);
+ return true;
+ }
}
// An arbitrary call. Bail.
@@ -643,21 +653,13 @@ bool FastISel::SelectCast(const User *I, unsigned Opcode) {
// Unhandled type. Halt "fast" selection and bail.
return false;
- // Check if the destination type is legal. Or as a special case,
- // it may be i1 if we're doing a truncate because that's
- // easy and somewhat common.
+ // Check if the destination type is legal.
if (!TLI.isTypeLegal(DstVT))
- if (DstVT != MVT::i1 || Opcode != ISD::TRUNCATE)
- // Unhandled type. Halt "fast" selection and bail.
- return false;
+ return false;
- // Check if the source operand is legal. Or as a special case,
- // it may be i1 if we're doing zero-extension because that's
- // easy and somewhat common.
+ // Check if the source operand is legal.
if (!TLI.isTypeLegal(SrcVT))
- if (SrcVT != MVT::i1 || Opcode != ISD::ZERO_EXTEND)
- // Unhandled type. Halt "fast" selection and bail.
- return false;
+ return false;
unsigned InputReg = getRegForValue(I->getOperand(0));
if (!InputReg)
@@ -666,18 +668,6 @@ bool FastISel::SelectCast(const User *I, unsigned Opcode) {
bool InputRegIsKill = hasTrivialKill(I->getOperand(0));
- // If the operand is i1, arrange for the high bits in the register to be zero.
- if (SrcVT == MVT::i1) {
- SrcVT = TLI.getTypeToTransformTo(I->getContext(), SrcVT);
- InputReg = FastEmitZExtFromI1(SrcVT.getSimpleVT(), InputReg, InputRegIsKill);
- if (!InputReg)
- return false;
- InputRegIsKill = true;
- }
- // If the result is i1, truncate to the target's type for i1 first.
- if (DstVT == MVT::i1)
- DstVT = TLI.getTypeToTransformTo(I->getContext(), DstVT);
-
unsigned ResultReg = FastEmit_r(SrcVT.getSimpleVT(),
DstVT.getSimpleVT(),
Opcode,
@@ -829,6 +819,47 @@ FastISel::SelectFNeg(const User *I) {
}
bool
+FastISel::SelectExtractValue(const User *U) {
+ const ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(U);
+ if (!EVI)
+ return false;
+
+ // Make sure we only try to handle extracts with a legal result. But also
+ // allow i1 because it's easy.
+ EVT RealVT = TLI.getValueType(EVI->getType(), /*AllowUnknown=*/true);
+ if (!RealVT.isSimple())
+ return false;
+ MVT VT = RealVT.getSimpleVT();
+ if (!TLI.isTypeLegal(VT) && VT != MVT::i1)
+ return false;
+
+ const Value *Op0 = EVI->getOperand(0);
+ const Type *AggTy = Op0->getType();
+
+ // Get the base result register.
+ unsigned ResultReg;
+ DenseMap<const Value *, unsigned>::iterator I = FuncInfo.ValueMap.find(Op0);
+ if (I != FuncInfo.ValueMap.end())
+ ResultReg = I->second;
+ else if (isa<Instruction>(Op0))
+ ResultReg = FuncInfo.InitializeRegForValue(Op0);
+ else
+ return false; // fast-isel can't handle aggregate constants at the moment
+
+ // Get the actual result register, which is an offset from the base register.
+ unsigned VTIndex = ComputeLinearIndex(AggTy, EVI->idx_begin(), EVI->idx_end());
+
+ SmallVector<EVT, 4> AggValueVTs;
+ ComputeValueVTs(TLI, AggTy, AggValueVTs);
+
+ for (unsigned i = 0; i < VTIndex; i++)
+ ResultReg += TLI.getNumRegisters(FuncInfo.Fn->getContext(), AggValueVTs[i]);
+
+ UpdateValueMap(EVI, ResultReg);
+ return true;
+}
+
+bool
FastISel::SelectOperator(const User *I, unsigned Opcode) {
switch (Opcode) {
case Instruction::Add:
@@ -932,6 +963,9 @@ FastISel::SelectOperator(const User *I, unsigned Opcode) {
return true;
}
+ case Instruction::ExtractValue:
+ return SelectExtractValue(I);
+
case Instruction::PHI:
llvm_unreachable("FastISel shouldn't visit PHI nodes!");
@@ -1097,6 +1131,30 @@ unsigned FastISel::FastEmitInst_rr(unsigned MachineInstOpcode,
return ResultReg;
}
+unsigned FastISel::FastEmitInst_rrr(unsigned MachineInstOpcode,
+ const TargetRegisterClass *RC,
+ unsigned Op0, bool Op0IsKill,
+ unsigned Op1, bool Op1IsKill,
+ unsigned Op2, bool Op2IsKill) {
+ unsigned ResultReg = createResultReg(RC);
+ const TargetInstrDesc &II = TII.get(MachineInstOpcode);
+
+ if (II.getNumDefs() >= 1)
+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg)
+ .addReg(Op0, Op0IsKill * RegState::Kill)
+ .addReg(Op1, Op1IsKill * RegState::Kill)
+ .addReg(Op2, Op2IsKill * RegState::Kill);
+ else {
+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II)
+ .addReg(Op0, Op0IsKill * RegState::Kill)
+ .addReg(Op1, Op1IsKill * RegState::Kill)
+ .addReg(Op2, Op2IsKill * RegState::Kill);
+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY),
+ ResultReg).addReg(II.ImplicitDefs[0]);
+ }
+ return ResultReg;
+}
+
unsigned FastISel::FastEmitInst_ri(unsigned MachineInstOpcode,
const TargetRegisterClass *RC,
unsigned Op0, bool Op0IsKill,
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index d8a5770..d518b5d 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -54,25 +54,6 @@ static bool isUsedOutsideOfDefiningBlock(const Instruction *I) {
return false;
}
-/// isOnlyUsedInEntryBlock - If the specified argument is only used in the
-/// entry block, return true. This includes arguments used by switches, since
-/// the switch may expand into multiple basic blocks.
-static bool isOnlyUsedInEntryBlock(const Argument *A, bool EnableFastISel) {
- // With FastISel active, we may be splitting blocks, so force creation
- // of virtual registers for all non-dead arguments.
- if (EnableFastISel)
- return A->use_empty();
-
- const BasicBlock *Entry = A->getParent()->begin();
- for (Value::const_use_iterator UI = A->use_begin(), E = A->use_end();
- UI != E; ++UI) {
- const User *U = *UI;
- if (cast<Instruction>(U)->getParent() != Entry || isa<SwitchInst>(U))
- return false; // Use not in entry block.
- }
- return true;
-}
-
FunctionLoweringInfo::FunctionLoweringInfo(const TargetLowering &tli)
: TLI(tli) {
}
@@ -86,16 +67,10 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf) {
SmallVector<ISD::OutputArg, 4> Outs;
GetReturnInfo(Fn->getReturnType(),
Fn->getAttributes().getRetAttributes(), Outs, TLI);
- CanLowerReturn = TLI.CanLowerReturn(Fn->getCallingConv(), Fn->isVarArg(),
+ CanLowerReturn = TLI.CanLowerReturn(Fn->getCallingConv(), *MF,
+ Fn->isVarArg(),
Outs, Fn->getContext());
- // Create a vreg for each argument register that is not dead and is used
- // outside of the entry block for the function.
- for (Function::const_arg_iterator AI = Fn->arg_begin(), E = Fn->arg_end();
- AI != E; ++AI)
- if (!isOnlyUsedInEntryBlock(AI, EnableFastISel))
- InitializeRegForValue(AI);
-
// Initialize the mapping of values to registers. This is only set up for
// instruction values that are used outside of the block that defines
// them.
@@ -181,6 +156,10 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf) {
const PHINode *PN = dyn_cast<PHINode>(I); ++I) {
if (PN->use_empty()) continue;
+ // Skip empty types
+ if (PN->getType()->isEmptyTy())
+ continue;
+
DebugLoc DL = PN->getDebugLoc();
unsigned PHIReg = ValueMap[PN];
assert(PHIReg && "PHI node does not have an assigned virtual register!");
@@ -343,7 +322,7 @@ void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) {
APInt Zero(BitWidth, 0);
DestLOI.KnownZero = Zero;
DestLOI.KnownOne = Zero;
- return;
+ return;
}
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
@@ -375,18 +354,18 @@ void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) {
/// setByValArgumentFrameIndex - Record frame index for the byval
/// argument. This overrides previous frame index entry for this argument,
/// if any.
-void FunctionLoweringInfo::setByValArgumentFrameIndex(const Argument *A,
+void FunctionLoweringInfo::setByValArgumentFrameIndex(const Argument *A,
int FI) {
assert (A->hasByValAttr() && "Argument does not have byval attribute!");
ByValArgFrameIndexMap[A] = FI;
}
-
+
/// getByValArgumentFrameIndex - Get frame index for the byval argument.
/// If the argument does not have any assigned frame index then 0 is
/// returned.
int FunctionLoweringInfo::getByValArgumentFrameIndex(const Argument *A) {
assert (A->hasByValAttr() && "Argument does not have byval attribute!");
- DenseMap<const Argument *, int>::iterator I =
+ DenseMap<const Argument *, int>::iterator I =
ByValArgFrameIndexMap.find(A);
if (I != ByValArgFrameIndexMap.end())
return I->second;
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
index e309def..cb49a80 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
@@ -283,7 +283,7 @@ InstrEmitter::AddRegisterOperand(MachineInstr *MI, SDValue Op,
DstRC = II->OpInfo[IIOpNum].getRegClass(TRI);
assert((DstRC || (TID.isVariadic() && IIOpNum >= TID.getNumOperands())) &&
"Don't have operand info for this instruction!");
- if (DstRC && SrcRC != DstRC && !SrcRC->hasSuperClass(DstRC)) {
+ if (DstRC && !SrcRC->hasSuperClassEq(DstRC)) {
unsigned NewVReg = MRI->createVirtualRegister(DstRC);
BuildMI(*MBB, InsertPos, Op.getNode()->getDebugLoc(),
TII->get(TargetOpcode::COPY), NewVReg).addReg(VReg);
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 2b6c56e..62d777c 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -14,23 +14,16 @@
#include "llvm/Analysis/DebugInfo.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
-#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetOptions.h"
#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/GlobalVariable.h"
#include "llvm/LLVMContext.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
@@ -57,7 +50,6 @@ class SelectionDAGLegalize {
const TargetMachine &TM;
const TargetLowering &TLI;
SelectionDAG &DAG;
- CodeGenOpt::Level OptLevel;
// Libcall insertion helpers.
@@ -93,13 +85,13 @@ class SelectionDAGLegalize {
}
public:
- SelectionDAGLegalize(SelectionDAG &DAG, CodeGenOpt::Level ol);
+ explicit SelectionDAGLegalize(SelectionDAG &DAG);
/// getTypeAction - Return how we should legalize values of this type, either
/// it is already legal or we need to expand it into multiple registers of
/// smaller integer type, or we need to promote it to a larger type.
LegalizeAction getTypeAction(EVT VT) const {
- return (LegalizeAction)ValueTypeActions.getTypeAction(VT);
+ return (LegalizeAction)TLI.getTypeAction(*DAG.getContext(), VT);
}
/// isTypeLegal - Return true if this type is legal on this target.
@@ -226,10 +218,9 @@ SelectionDAGLegalize::ShuffleWithNarrowerEltType(EVT NVT, EVT VT, DebugLoc dl,
return DAG.getVectorShuffle(NVT, dl, N1, N2, &NewMask[0]);
}
-SelectionDAGLegalize::SelectionDAGLegalize(SelectionDAG &dag,
- CodeGenOpt::Level ol)
+SelectionDAGLegalize::SelectionDAGLegalize(SelectionDAG &dag)
: TM(dag.getTarget()), TLI(dag.getTargetLoweringInfo()),
- DAG(dag), OptLevel(ol),
+ DAG(dag),
ValueTypeActions(TLI.getValueTypeActions()) {
assert(MVT::LAST_VALUETYPE <= MVT::MAX_ALLOWED_VALUETYPE &&
"Too many value types for ValueTypeActions to hold!");
@@ -324,6 +315,7 @@ static SDNode *FindCallStartFromCallEnd(SDNode *Node) {
case ISD::CALLSEQ_START:
if (!nested)
return Node;
+ Node = Node->getOperand(0).getNode();
nested--;
break;
case ISD::CALLSEQ_END:
@@ -331,7 +323,7 @@ static SDNode *FindCallStartFromCallEnd(SDNode *Node) {
break;
}
}
- return 0;
+ return (Node->getOpcode() == ISD::CALLSEQ_START) ? Node : 0;
}
/// LegalizeAllNodesNotLeadingTo - Recursively walk the uses of N, looking to
@@ -440,68 +432,67 @@ SDValue ExpandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG,
SDValue Result = DAG.getNode(ISD::BITCAST, dl, intVT, Val);
return DAG.getStore(Chain, dl, Result, Ptr, ST->getPointerInfo(),
ST->isVolatile(), ST->isNonTemporal(), Alignment);
- } else {
- // Do a (aligned) store to a stack slot, then copy from the stack slot
- // to the final destination using (unaligned) integer loads and stores.
- EVT StoredVT = ST->getMemoryVT();
- EVT RegVT =
- TLI.getRegisterType(*DAG.getContext(),
- EVT::getIntegerVT(*DAG.getContext(),
- StoredVT.getSizeInBits()));
- unsigned StoredBytes = StoredVT.getSizeInBits() / 8;
- unsigned RegBytes = RegVT.getSizeInBits() / 8;
- unsigned NumRegs = (StoredBytes + RegBytes - 1) / RegBytes;
-
- // Make sure the stack slot is also aligned for the register type.
- SDValue StackPtr = DAG.CreateStackTemporary(StoredVT, RegVT);
-
- // Perform the original store, only redirected to the stack slot.
- SDValue Store = DAG.getTruncStore(Chain, dl,
- Val, StackPtr, MachinePointerInfo(),
- StoredVT, false, false, 0);
- SDValue Increment = DAG.getConstant(RegBytes, TLI.getPointerTy());
- SmallVector<SDValue, 8> Stores;
- unsigned Offset = 0;
-
- // Do all but one copies using the full register width.
- for (unsigned i = 1; i < NumRegs; i++) {
- // Load one integer register's worth from the stack slot.
- SDValue Load = DAG.getLoad(RegVT, dl, Store, StackPtr,
- MachinePointerInfo(),
- false, false, 0);
- // Store it to the final location. Remember the store.
- Stores.push_back(DAG.getStore(Load.getValue(1), dl, Load, Ptr,
- ST->getPointerInfo().getWithOffset(Offset),
- ST->isVolatile(), ST->isNonTemporal(),
- MinAlign(ST->getAlignment(), Offset)));
- // Increment the pointers.
- Offset += RegBytes;
- StackPtr = DAG.getNode(ISD::ADD, dl, StackPtr.getValueType(), StackPtr,
- Increment);
- Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, Increment);
- }
+ }
+ // Do a (aligned) store to a stack slot, then copy from the stack slot
+ // to the final destination using (unaligned) integer loads and stores.
+ EVT StoredVT = ST->getMemoryVT();
+ EVT RegVT =
+ TLI.getRegisterType(*DAG.getContext(),
+ EVT::getIntegerVT(*DAG.getContext(),
+ StoredVT.getSizeInBits()));
+ unsigned StoredBytes = StoredVT.getSizeInBits() / 8;
+ unsigned RegBytes = RegVT.getSizeInBits() / 8;
+ unsigned NumRegs = (StoredBytes + RegBytes - 1) / RegBytes;
- // The last store may be partial. Do a truncating store. On big-endian
- // machines this requires an extending load from the stack slot to ensure
- // that the bits are in the right place.
- EVT MemVT = EVT::getIntegerVT(*DAG.getContext(),
- 8 * (StoredBytes - Offset));
+ // Make sure the stack slot is also aligned for the register type.
+ SDValue StackPtr = DAG.CreateStackTemporary(StoredVT, RegVT);
- // Load from the stack slot.
- SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, dl, RegVT, Store, StackPtr,
- MachinePointerInfo(),
- MemVT, false, false, 0);
+ // Perform the original store, only redirected to the stack slot.
+ SDValue Store = DAG.getTruncStore(Chain, dl,
+ Val, StackPtr, MachinePointerInfo(),
+ StoredVT, false, false, 0);
+ SDValue Increment = DAG.getConstant(RegBytes, TLI.getPointerTy());
+ SmallVector<SDValue, 8> Stores;
+ unsigned Offset = 0;
- Stores.push_back(DAG.getTruncStore(Load.getValue(1), dl, Load, Ptr,
- ST->getPointerInfo()
- .getWithOffset(Offset),
- MemVT, ST->isVolatile(),
- ST->isNonTemporal(),
- MinAlign(ST->getAlignment(), Offset)));
- // The order of the stores doesn't matter - say it with a TokenFactor.
- return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, &Stores[0],
- Stores.size());
+ // Do all but one copies using the full register width.
+ for (unsigned i = 1; i < NumRegs; i++) {
+ // Load one integer register's worth from the stack slot.
+ SDValue Load = DAG.getLoad(RegVT, dl, Store, StackPtr,
+ MachinePointerInfo(),
+ false, false, 0);
+ // Store it to the final location. Remember the store.
+ Stores.push_back(DAG.getStore(Load.getValue(1), dl, Load, Ptr,
+ ST->getPointerInfo().getWithOffset(Offset),
+ ST->isVolatile(), ST->isNonTemporal(),
+ MinAlign(ST->getAlignment(), Offset)));
+ // Increment the pointers.
+ Offset += RegBytes;
+ StackPtr = DAG.getNode(ISD::ADD, dl, StackPtr.getValueType(), StackPtr,
+ Increment);
+ Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr, Increment);
}
+
+ // The last store may be partial. Do a truncating store. On big-endian
+ // machines this requires an extending load from the stack slot to ensure
+ // that the bits are in the right place.
+ EVT MemVT = EVT::getIntegerVT(*DAG.getContext(),
+ 8 * (StoredBytes - Offset));
+
+ // Load from the stack slot.
+ SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, dl, RegVT, Store, StackPtr,
+ MachinePointerInfo(),
+ MemVT, false, false, 0);
+
+ Stores.push_back(DAG.getTruncStore(Load.getValue(1), dl, Load, Ptr,
+ ST->getPointerInfo()
+ .getWithOffset(Offset),
+ MemVT, ST->isVolatile(),
+ ST->isNonTemporal(),
+ MinAlign(ST->getAlignment(), Offset)));
+ // The order of the stores doesn't matter - say it with a TokenFactor.
+ return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, &Stores[0],
+ Stores.size());
}
assert(ST->getMemoryVT().isInteger() &&
!ST->getMemoryVT().isVector() &&
@@ -1093,8 +1084,9 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
{
SDNode *myCALLSEQ_BEGIN = FindCallStartFromCallEnd(Node);
- // If the CALLSEQ_START node hasn't been legalized first, legalize it. This
- // will cause this node to be legalized as well as handling libcalls right.
+ // If the CALLSEQ_START node hasn't been legalized first, legalize it.
+ // This will cause this node to be legalized as well as handling libcalls
+ // right.
if (getLastCALLSEQ().getNode() != Node) {
LegalizeOp(SDValue(myCALLSEQ_BEGIN, 0));
DenseMap<SDValue, SDValue>::iterator I = LegalizedNodes.find(Op);
@@ -2059,14 +2051,14 @@ SDValue SelectionDAGLegalize::ExpandLibCall(RTLIB::Libcall LC, SDNode *Node,
return CallInfo.first;
}
-/// ExpandLibCall - Generate a libcall taking the given operands as arguments
+/// ExpandLibCall - Generate a libcall taking the given operands as arguments
/// and returning a result of type RetVT.
SDValue SelectionDAGLegalize::ExpandLibCall(RTLIB::Libcall LC, EVT RetVT,
const SDValue *Ops, unsigned NumOps,
bool isSigned, DebugLoc dl) {
TargetLowering::ArgListTy Args;
Args.reserve(NumOps);
-
+
TargetLowering::ArgListEntry Entry;
for (unsigned i = 0; i != NumOps; ++i) {
Entry.Node = Ops[i];
@@ -2077,14 +2069,14 @@ SDValue SelectionDAGLegalize::ExpandLibCall(RTLIB::Libcall LC, EVT RetVT,
}
SDValue Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC),
TLI.getPointerTy());
-
+
const Type *RetTy = RetVT.getTypeForEVT(*DAG.getContext());
std::pair<SDValue,SDValue> CallInfo =
TLI.LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false,
false, 0, TLI.getLibcallCallingConv(LC), false,
/*isReturnValueUsed=*/true,
Callee, Args, DAG, dl);
-
+
// Legalize the call sequence, starting with the chain. This will advance
// the LastCALLSEQ_END to the legalized version of the CALLSEQ_END node that
// was added by LowerCallTo (guaranteeing proper serialization of calls).
@@ -3432,8 +3424,8 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node,
else if (WideVT == MVT::i128)
LC = RTLIB::MUL_I128;
assert(LC != RTLIB::UNKNOWN_LIBCALL && "Cannot expand this operation!");
-
- // The high part is obtained by SRA'ing all but one of the bits of low
+
+ // The high part is obtained by SRA'ing all but one of the bits of low
// part.
unsigned LoSize = VT.getSizeInBits();
SDValue HiLHS = DAG.getNode(ISD::SRA, dl, VT, RHS,
@@ -3452,7 +3444,7 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node,
TopHalf = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, VT, Ret,
DAG.getIntPtrConstant(1));
}
-
+
if (isSigned) {
Tmp1 = DAG.getConstant(VT.getSizeInBits() - 1,
TLI.getShiftAmountTy(BottomHalf.getValueType()));
@@ -3534,9 +3526,13 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node,
Tmp2.getOperand(0), Tmp2.getOperand(1),
Node->getOperand(2));
} else {
+ // We test only the i1 bit. Skip the AND if UNDEF.
+ Tmp3 = (Tmp2.getOpcode() == ISD::UNDEF) ? Tmp2 :
+ DAG.getNode(ISD::AND, dl, Tmp2.getValueType(), Tmp2,
+ DAG.getConstant(1, Tmp2.getValueType()));
Tmp1 = DAG.getNode(ISD::BR_CC, dl, MVT::Other, Tmp1,
- DAG.getCondCode(ISD::SETNE), Tmp2,
- DAG.getConstant(0, Tmp2.getValueType()),
+ DAG.getCondCode(ISD::SETNE), Tmp3,
+ DAG.getConstant(0, Tmp3.getValueType()),
Node->getOperand(2));
}
Results.push_back(Tmp1);
@@ -3746,9 +3742,8 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node,
// SelectionDAG::Legalize - This is the entry point for the file.
//
-void SelectionDAG::Legalize(CodeGenOpt::Level OptLevel) {
+void SelectionDAG::Legalize() {
/// run - This is the main entry point to this class.
///
- SelectionDAGLegalize(*this, OptLevel).LegalizeDAG();
+ SelectionDAGLegalize(*this).LegalizeDAG();
}
-
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 935aab0..b8da57f 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -73,6 +73,17 @@ void DAGTypeLegalizer::PromoteIntegerResult(SDNode *N, unsigned ResNo) {
case ISD::UNDEF: Res = PromoteIntRes_UNDEF(N); break;
case ISD::VAARG: Res = PromoteIntRes_VAARG(N); break;
+ case ISD::EXTRACT_SUBVECTOR:
+ Res = PromoteIntRes_EXTRACT_SUBVECTOR(N); break;
+ case ISD::VECTOR_SHUFFLE:
+ Res = PromoteIntRes_VECTOR_SHUFFLE(N); break;
+ case ISD::INSERT_VECTOR_ELT:
+ Res = PromoteIntRes_INSERT_VECTOR_ELT(N); break;
+ case ISD::BUILD_VECTOR:
+ Res = PromoteIntRes_BUILD_VECTOR(N); break;
+ case ISD::SCALAR_TO_VECTOR:
+ Res = PromoteIntRes_SCALAR_TO_VECTOR(N); break;
+
case ISD::SIGN_EXTEND:
case ISD::ZERO_EXTEND:
case ISD::ANY_EXTEND: Res = PromoteIntRes_INT_EXTEND(N); break;
@@ -174,24 +185,28 @@ SDValue DAGTypeLegalizer::PromoteIntRes_BITCAST(SDNode *N) {
default:
assert(false && "Unknown type action!");
break;
- case Legal:
+ case TargetLowering::TypeLegal:
break;
- case PromoteInteger:
+ case TargetLowering::TypePromoteInteger:
if (NOutVT.bitsEq(NInVT))
// The input promotes to the same size. Convert the promoted value.
return DAG.getNode(ISD::BITCAST, dl, NOutVT, GetPromotedInteger(InOp));
+ if (NInVT.isVector())
+ // Promote vector element via memory load/store.
+ return DAG.getNode(ISD::ANY_EXTEND, dl, NOutVT,
+ CreateStackStoreLoad(InOp, OutVT));
break;
- case SoftenFloat:
+ case TargetLowering::TypeSoftenFloat:
// Promote the integer operand by hand.
return DAG.getNode(ISD::ANY_EXTEND, dl, NOutVT, GetSoftenedFloat(InOp));
- case ExpandInteger:
- case ExpandFloat:
+ case TargetLowering::TypeExpandInteger:
+ case TargetLowering::TypeExpandFloat:
break;
- case ScalarizeVector:
+ case TargetLowering::TypeScalarizeVector:
// Convert the element to an integer and promote it by hand.
return DAG.getNode(ISD::ANY_EXTEND, dl, NOutVT,
BitConvertToInteger(GetScalarizedVector(InOp)));
- case SplitVector: {
+ case TargetLowering::TypeSplitVector: {
// For example, i32 = BITCAST v2i16 on alpha. Convert the split
// pieces of the input into integers and reassemble in the final type.
SDValue Lo, Hi;
@@ -208,7 +223,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_BITCAST(SDNode *N) {
JoinIntegers(Lo, Hi));
return DAG.getNode(ISD::BITCAST, dl, NOutVT, InOp);
}
- case WidenVector:
+ case TargetLowering::TypeWidenVector:
if (OutVT.bitsEq(NInVT))
// The input is widened to the same size. Convert to the widened value.
return DAG.getNode(ISD::BITCAST, dl, OutVT, GetWidenedVector(InOp));
@@ -342,7 +357,8 @@ SDValue DAGTypeLegalizer::PromoteIntRes_INT_EXTEND(SDNode *N) {
EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
DebugLoc dl = N->getDebugLoc();
- if (getTypeAction(N->getOperand(0).getValueType()) == PromoteInteger) {
+ if (getTypeAction(N->getOperand(0).getValueType())
+ == TargetLowering::TypePromoteInteger) {
SDValue Res = GetPromotedInteger(N->getOperand(0));
assert(Res.getValueType().bitsLE(NVT) && "Extension doesn't make sense!");
@@ -507,11 +523,11 @@ SDValue DAGTypeLegalizer::PromoteIntRes_TRUNCATE(SDNode *N) {
switch (getTypeAction(N->getOperand(0).getValueType())) {
default: llvm_unreachable("Unknown type action!");
- case Legal:
- case ExpandInteger:
+ case TargetLowering::TypeLegal:
+ case TargetLowering::TypeExpandInteger:
Res = N->getOperand(0);
break;
- case PromoteInteger:
+ case TargetLowering::TypePromoteInteger:
Res = GetPromotedInteger(N->getOperand(0));
break;
}
@@ -557,9 +573,9 @@ SDValue DAGTypeLegalizer::PromoteIntRes_XMULO(SDNode *N, unsigned ResNo) {
DebugLoc DL = N->getDebugLoc();
EVT SmallVT = LHS.getValueType();
- // To determine if the result overflowed in a larger type, we extend the input
- // to the larger type, do the multiply, then check the high bits of the result
- // to see if the overflow happened.
+ // To determine if the result overflowed in a larger type, we extend the
+ // input to the larger type, do the multiply, then check the high bits of
+ // the result to see if the overflow happened.
if (N->getOpcode() == ISD::SMULO) {
LHS = SExtPromotedInteger(LHS);
RHS = SExtPromotedInteger(RHS);
@@ -569,8 +585,8 @@ SDValue DAGTypeLegalizer::PromoteIntRes_XMULO(SDNode *N, unsigned ResNo) {
}
SDValue Mul = DAG.getNode(ISD::MUL, DL, LHS.getValueType(), LHS, RHS);
- // Overflow occurred iff the high part of the result does not zero/sign-extend
- // the low part.
+ // Overflow occurred iff the high part of the result does not
+ // zero/sign-extend the low part.
SDValue Overflow;
if (N->getOpcode() == ISD::UMULO) {
// Unsigned overflow occurred iff the high part is non-zero.
@@ -672,6 +688,8 @@ bool DAGTypeLegalizer::PromoteIntegerOperand(SDNode *N, unsigned OpNo) {
case ISD::BRCOND: Res = PromoteIntOp_BRCOND(N, OpNo); break;
case ISD::BUILD_PAIR: Res = PromoteIntOp_BUILD_PAIR(N); break;
case ISD::BUILD_VECTOR: Res = PromoteIntOp_BUILD_VECTOR(N); break;
+ case ISD::CONCAT_VECTORS: Res = PromoteIntOp_CONCAT_VECTORS(N); break;
+ case ISD::EXTRACT_VECTOR_ELT: Res = PromoteIntOp_EXTRACT_VECTOR_ELT(N); break;
case ISD::CONVERT_RNDSAT:
Res = PromoteIntOp_CONVERT_RNDSAT(N); break;
case ISD::INSERT_VECTOR_ELT:
@@ -1513,7 +1531,8 @@ void DAGTypeLegalizer::ExpandIntRes_ANY_EXTEND(SDNode *N,
} else {
// For example, extension of an i48 to an i64. The operand type necessarily
// promotes to the result type, so will end up being expanded too.
- assert(getTypeAction(Op.getValueType()) == PromoteInteger &&
+ assert(getTypeAction(Op.getValueType()) ==
+ TargetLowering::TypePromoteInteger &&
"Only know how to promote this result!");
SDValue Res = GetPromotedInteger(Op);
assert(Res.getValueType() == N->getValueType(0) &&
@@ -2030,7 +2049,8 @@ void DAGTypeLegalizer::ExpandIntRes_SIGN_EXTEND(SDNode *N,
} else {
// For example, extension of an i48 to an i64. The operand type necessarily
// promotes to the result type, so will end up being expanded too.
- assert(getTypeAction(Op.getValueType()) == PromoteInteger &&
+ assert(getTypeAction(Op.getValueType()) ==
+ TargetLowering::TypePromoteInteger &&
"Only know how to promote this result!");
SDValue Res = GetPromotedInteger(Op);
assert(Res.getValueType() == N->getValueType(0) &&
@@ -2178,7 +2198,8 @@ void DAGTypeLegalizer::ExpandIntRes_ZERO_EXTEND(SDNode *N,
} else {
// For example, extension of an i48 to an i64. The operand type necessarily
// promotes to the result type, so will end up being expanded too.
- assert(getTypeAction(Op.getValueType()) == PromoteInteger &&
+ assert(getTypeAction(Op.getValueType()) ==
+ TargetLowering::TypePromoteInteger &&
"Only know how to promote this result!");
SDValue Res = GetPromotedInteger(Op);
assert(Res.getValueType() == N->getValueType(0) &&
@@ -2613,3 +2634,158 @@ SDValue DAGTypeLegalizer::ExpandIntOp_UINT_TO_FP(SDNode *N) {
"Don't know how to expand this UINT_TO_FP!");
return MakeLibCall(LC, DstVT, &Op, 1, true, dl);
}
+
+SDValue DAGTypeLegalizer::PromoteIntRes_EXTRACT_SUBVECTOR(SDNode *N) {
+ SDValue InOp0 = N->getOperand(0);
+ EVT InVT = InOp0.getValueType();
+ EVT NInVT = TLI.getTypeToTransformTo(*DAG.getContext(), InVT);
+
+ EVT OutVT = N->getValueType(0);
+ EVT NOutVT = TLI.getTypeToTransformTo(*DAG.getContext(), OutVT);
+ assert(NOutVT.isVector() && "This type must be promoted to a vector type");
+ unsigned OutNumElems = N->getValueType(0).getVectorNumElements();
+ EVT NOutVTElem = NOutVT.getVectorElementType();
+
+ DebugLoc dl = N->getDebugLoc();
+ SDValue BaseIdx = N->getOperand(1);
+
+ SmallVector<SDValue, 8> Ops;
+ for (unsigned i = 0; i != OutNumElems; ++i) {
+
+ // Extract the element from the original vector.
+ SDValue Index = DAG.getNode(ISD::ADD, dl, BaseIdx.getValueType(),
+ BaseIdx, DAG.getIntPtrConstant(i));
+ SDValue Ext = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl,
+ InVT.getVectorElementType(), N->getOperand(0), Index);
+
+ SDValue Op = DAG.getNode(ISD::ANY_EXTEND, dl, NOutVTElem, Ext);
+ // Insert the converted element to the new vector.
+ Ops.push_back(Op);
+ }
+
+ return DAG.getNode(ISD::BUILD_VECTOR, dl, NOutVT, &Ops[0], Ops.size());
+}
+
+
+SDValue DAGTypeLegalizer::PromoteIntRes_VECTOR_SHUFFLE(SDNode *N) {
+
+ ShuffleVectorSDNode *SV = cast<ShuffleVectorSDNode>(N);
+ EVT VT = N->getValueType(0);
+ DebugLoc dl = N->getDebugLoc();
+
+ unsigned NumElts = VT.getVectorNumElements();
+ SmallVector<int, 8> NewMask;
+ for (unsigned i = 0; i != NumElts; ++i) {
+ NewMask.push_back(SV->getMaskElt(i));
+ }
+
+ SDValue V0 = GetPromotedInteger(N->getOperand(0));
+ SDValue V1 = GetPromotedInteger(N->getOperand(1));
+ EVT OutVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
+
+ return DAG.getVectorShuffle(OutVT, dl, V0,V1, &NewMask[0]);
+}
+
+
+SDValue DAGTypeLegalizer::PromoteIntRes_BUILD_VECTOR(SDNode *N) {
+
+ SDValue InOp0 = N->getOperand(0);
+ EVT InVT = InOp0.getValueType();
+ EVT NInVT = TLI.getTypeToTransformTo(*DAG.getContext(), InVT);
+
+ EVT OutVT = N->getValueType(0);
+ EVT NOutVT = TLI.getTypeToTransformTo(*DAG.getContext(), OutVT);
+ assert(NOutVT.isVector() && "This type must be promoted to a vector type");
+ unsigned NumElems = N->getNumOperands();
+ EVT NOutVTElem = NOutVT.getVectorElementType();
+
+ DebugLoc dl = N->getDebugLoc();
+
+ SmallVector<SDValue, 8> Ops;
+ for (unsigned i = 0; i != NumElems; ++i) {
+ SDValue Op = DAG.getNode(ISD::ANY_EXTEND, dl, NOutVTElem, N->getOperand(i));
+ Ops.push_back(Op);
+ }
+
+ return DAG.getNode(ISD::BUILD_VECTOR, dl, NOutVT, &Ops[0], Ops.size());
+}
+
+SDValue DAGTypeLegalizer::PromoteIntRes_SCALAR_TO_VECTOR(SDNode *N) {
+
+ DebugLoc dl = N->getDebugLoc();
+
+ SDValue InOp0 = N->getOperand(0);
+ EVT InVT = InOp0.getValueType();
+ EVT NInVT = TLI.getTypeToTransformTo(*DAG.getContext(), InVT);
+ assert(!InVT.isVector() && "Input must not be a scalar");
+
+ EVT OutVT = N->getValueType(0);
+ EVT NOutVT = TLI.getTypeToTransformTo(*DAG.getContext(), OutVT);
+ assert(NOutVT.isVector() && "This type must be promoted to a vector type");
+ EVT NOutVTElem = NOutVT.getVectorElementType();
+
+ SDValue Op = DAG.getNode(ISD::ANY_EXTEND, dl, NOutVTElem, N->getOperand(0));
+
+ return DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, NOutVT, Op);
+}
+
+SDValue DAGTypeLegalizer::PromoteIntRes_INSERT_VECTOR_ELT(SDNode *N) {
+
+ SDValue InOp0 = N->getOperand(0);
+ EVT InVT = InOp0.getValueType();
+ EVT InElVT = InVT.getVectorElementType();
+ EVT NInVT = TLI.getTypeToTransformTo(*DAG.getContext(), InVT);
+
+ EVT OutVT = N->getValueType(0);
+ EVT NOutVT = TLI.getTypeToTransformTo(*DAG.getContext(), OutVT);
+ assert(NOutVT.isVector() && "This type must be promoted to a vector type");
+
+ EVT NOutVTElem = NOutVT.getVectorElementType();
+
+ DebugLoc dl = N->getDebugLoc();
+
+ SDValue ConvertedVector = DAG.getNode(ISD::ANY_EXTEND, dl, NOutVT, InOp0);
+
+ SDValue ConvElem = DAG.getNode(ISD::ANY_EXTEND, dl,
+ NOutVTElem, N->getOperand(1));
+ return DAG.getNode(ISD::INSERT_VECTOR_ELT, dl,NOutVT,
+ ConvertedVector, ConvElem, N->getOperand(2));
+}
+
+SDValue DAGTypeLegalizer::PromoteIntOp_EXTRACT_VECTOR_ELT(SDNode *N) {
+ DebugLoc dl = N->getDebugLoc();
+ SDValue V0 = GetPromotedInteger(N->getOperand(0));
+ SDValue V1 = N->getOperand(1);
+ SDValue Ext = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl,
+ V0->getValueType(0).getScalarType(), V0, V1);
+
+ return DAG.getNode(ISD::TRUNCATE, dl, N->getValueType(0), Ext);
+
+}
+
+SDValue DAGTypeLegalizer::PromoteIntOp_CONCAT_VECTORS(SDNode *N) {
+
+ DebugLoc dl = N->getDebugLoc();
+
+ EVT RetSclrTy = N->getValueType(0).getVectorElementType();
+
+ SmallVector<SDValue, 8> NewOps;
+
+ // For each incoming vector
+ for (unsigned VecIdx = 0, E = N->getNumOperands(); VecIdx!= E; ++VecIdx) {
+ SDValue Incoming = GetPromotedInteger(N->getOperand(VecIdx));
+ EVT SclrTy = Incoming->getValueType(0).getVectorElementType();
+ unsigned NumElem = Incoming->getValueType(0).getVectorNumElements();
+
+ for (unsigned i=0; i<NumElem; ++i) {
+ // Extract element from incoming vector
+ SDValue Ex = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, SclrTy,
+ Incoming, DAG.getIntPtrConstant(i));
+ SDValue Tr = DAG.getNode(ISD::TRUNCATE, dl, RetSclrTy, Ex);
+ NewOps.push_back(Tr);
+ }
+ }
+
+ return DAG.getNode(ISD::BUILD_VECTOR, dl, N->getValueType(0),
+ &NewOps[0], NewOps.size());
+ }
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index cedda7e..ba658b0 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -224,38 +224,38 @@ bool DAGTypeLegalizer::run() {
switch (getTypeAction(ResultVT)) {
default:
assert(false && "Unknown action!");
- case Legal:
+ case TargetLowering::TypeLegal:
break;
// The following calls must take care of *all* of the node's results,
// not just the illegal result they were passed (this includes results
// with a legal type). Results can be remapped using ReplaceValueWith,
// or their promoted/expanded/etc values registered in PromotedIntegers,
// ExpandedIntegers etc.
- case PromoteInteger:
+ case TargetLowering::TypePromoteInteger:
PromoteIntegerResult(N, i);
Changed = true;
goto NodeDone;
- case ExpandInteger:
+ case TargetLowering::TypeExpandInteger:
ExpandIntegerResult(N, i);
Changed = true;
goto NodeDone;
- case SoftenFloat:
+ case TargetLowering::TypeSoftenFloat:
SoftenFloatResult(N, i);
Changed = true;
goto NodeDone;
- case ExpandFloat:
+ case TargetLowering::TypeExpandFloat:
ExpandFloatResult(N, i);
Changed = true;
goto NodeDone;
- case ScalarizeVector:
+ case TargetLowering::TypeScalarizeVector:
ScalarizeVectorResult(N, i);
Changed = true;
goto NodeDone;
- case SplitVector:
+ case TargetLowering::TypeSplitVector:
SplitVectorResult(N, i);
Changed = true;
goto NodeDone;
- case WidenVector:
+ case TargetLowering::TypeWidenVector:
WidenVectorResult(N, i);
Changed = true;
goto NodeDone;
@@ -277,36 +277,36 @@ ScanOperands:
switch (getTypeAction(OpVT)) {
default:
assert(false && "Unknown action!");
- case Legal:
+ case TargetLowering::TypeLegal:
continue;
// The following calls must either replace all of the node's results
// using ReplaceValueWith, and return "false"; or update the node's
// operands in place, and return "true".
- case PromoteInteger:
+ case TargetLowering::TypePromoteInteger:
NeedsReanalyzing = PromoteIntegerOperand(N, i);
Changed = true;
break;
- case ExpandInteger:
+ case TargetLowering::TypeExpandInteger:
NeedsReanalyzing = ExpandIntegerOperand(N, i);
Changed = true;
break;
- case SoftenFloat:
+ case TargetLowering::TypeSoftenFloat:
NeedsReanalyzing = SoftenFloatOperand(N, i);
Changed = true;
break;
- case ExpandFloat:
+ case TargetLowering::TypeExpandFloat:
NeedsReanalyzing = ExpandFloatOperand(N, i);
Changed = true;
break;
- case ScalarizeVector:
+ case TargetLowering::TypeScalarizeVector:
NeedsReanalyzing = ScalarizeVectorOperand(N, i);
Changed = true;
break;
- case SplitVector:
+ case TargetLowering::TypeSplitVector:
NeedsReanalyzing = SplitVectorOperand(N, i);
Changed = true;
break;
- case WidenVector:
+ case TargetLowering::TypeWidenVector:
NeedsReanalyzing = WidenVectorOperand(N, i);
Changed = true;
break;
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
index 5409b88..b2f966b 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
@@ -57,16 +57,6 @@ public:
// 1+ - This is a node which has this many unprocessed operands.
};
private:
- enum LegalizeAction {
- Legal, // The target natively supports this type.
- PromoteInteger, // Replace this integer type with a larger one.
- ExpandInteger, // Split this integer type into two of half the size.
- SoftenFloat, // Convert this float type to a same size integer type.
- ExpandFloat, // Split this float type into two of half the size.
- ScalarizeVector, // Replace this one-element vector with its element type.
- SplitVector, // Split this vector type into two of half the size.
- WidenVector // This vector type should be widened into a larger vector.
- };
/// ValueTypeActions - This is a bitvector that contains two bits for each
/// simple value type, where the two bits correspond to the LegalizeAction
@@ -74,41 +64,13 @@ private:
TargetLowering::ValueTypeActionImpl ValueTypeActions;
/// getTypeAction - Return how we should legalize values of this type.
- LegalizeAction getTypeAction(EVT VT) const {
- switch (ValueTypeActions.getTypeAction(VT)) {
- default:
- assert(false && "Unknown legalize action!");
- case TargetLowering::Legal:
- return Legal;
- case TargetLowering::Promote:
- // Promote can mean
- // 1) For integers, use a larger integer type (e.g. i8 -> i32).
- // 2) For vectors, use a wider vector type (e.g. v3i32 -> v4i32).
- if (!VT.isVector())
- return PromoteInteger;
- return WidenVector;
- case TargetLowering::Expand:
- // Expand can mean
- // 1) split scalar in half, 2) convert a float to an integer,
- // 3) scalarize a single-element vector, 4) split a vector in two.
- if (!VT.isVector()) {
- if (VT.isInteger())
- return ExpandInteger;
- if (VT.getSizeInBits() ==
- TLI.getTypeToTransformTo(*DAG.getContext(), VT).getSizeInBits())
- return SoftenFloat;
- return ExpandFloat;
- }
-
- if (VT.getVectorNumElements() == 1)
- return ScalarizeVector;
- return SplitVector;
- }
+ TargetLowering::LegalizeTypeAction getTypeAction(EVT VT) const {
+ return TLI.getTypeAction(*DAG.getContext(), VT);
}
/// isTypeLegal - Return true if this type is legal on this target.
bool isTypeLegal(EVT VT) const {
- return ValueTypeActions.getTypeAction(VT) == TargetLowering::Legal;
+ return TLI.getTypeAction(*DAG.getContext(), VT) == TargetLowering::TypeLegal;
}
/// IgnoreNodeResults - Pretend all of this node's results are legal.
@@ -248,6 +210,11 @@ private:
SDValue PromoteIntRes_AssertZext(SDNode *N);
SDValue PromoteIntRes_Atomic1(AtomicSDNode *N);
SDValue PromoteIntRes_Atomic2(AtomicSDNode *N);
+ SDValue PromoteIntRes_EXTRACT_SUBVECTOR(SDNode *N);
+ SDValue PromoteIntRes_VECTOR_SHUFFLE(SDNode *N);
+ SDValue PromoteIntRes_BUILD_VECTOR(SDNode *N);
+ SDValue PromoteIntRes_SCALAR_TO_VECTOR(SDNode *N);
+ SDValue PromoteIntRes_INSERT_VECTOR_ELT(SDNode *N);
SDValue PromoteIntRes_BITCAST(SDNode *N);
SDValue PromoteIntRes_BSWAP(SDNode *N);
SDValue PromoteIntRes_BUILD_PAIR(SDNode *N);
@@ -289,6 +256,9 @@ private:
SDValue PromoteIntOp_BUILD_VECTOR(SDNode *N);
SDValue PromoteIntOp_CONVERT_RNDSAT(SDNode *N);
SDValue PromoteIntOp_INSERT_VECTOR_ELT(SDNode *N, unsigned OpNo);
+ SDValue PromoteIntOp_EXTRACT_ELEMENT(SDNode *N);
+ SDValue PromoteIntOp_EXTRACT_VECTOR_ELT(SDNode *N);
+ SDValue PromoteIntOp_CONCAT_VECTORS(SDNode *N);
SDValue PromoteIntOp_MEMBARRIER(SDNode *N);
SDValue PromoteIntOp_SCALAR_TO_VECTOR(SDNode *N);
SDValue PromoteIntOp_SELECT(SDNode *N, unsigned OpNo);
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
index a75ae87..85ea6b6 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
@@ -43,36 +43,36 @@ void DAGTypeLegalizer::ExpandRes_BITCAST(SDNode *N, SDValue &Lo, SDValue &Hi) {
switch (getTypeAction(InVT)) {
default:
assert(false && "Unknown type action!");
- case Legal:
- case PromoteInteger:
+ case TargetLowering::TypeLegal:
+ case TargetLowering::TypePromoteInteger:
break;
- case SoftenFloat:
+ case TargetLowering::TypeSoftenFloat:
// Convert the integer operand instead.
SplitInteger(GetSoftenedFloat(InOp), Lo, Hi);
Lo = DAG.getNode(ISD::BITCAST, dl, NOutVT, Lo);
Hi = DAG.getNode(ISD::BITCAST, dl, NOutVT, Hi);
return;
- case ExpandInteger:
- case ExpandFloat:
+ case TargetLowering::TypeExpandInteger:
+ case TargetLowering::TypeExpandFloat:
// Convert the expanded pieces of the input.
GetExpandedOp(InOp, Lo, Hi);
Lo = DAG.getNode(ISD::BITCAST, dl, NOutVT, Lo);
Hi = DAG.getNode(ISD::BITCAST, dl, NOutVT, Hi);
return;
- case SplitVector:
+ case TargetLowering::TypeSplitVector:
GetSplitVector(InOp, Lo, Hi);
if (TLI.isBigEndian())
std::swap(Lo, Hi);
Lo = DAG.getNode(ISD::BITCAST, dl, NOutVT, Lo);
Hi = DAG.getNode(ISD::BITCAST, dl, NOutVT, Hi);
return;
- case ScalarizeVector:
+ case TargetLowering::TypeScalarizeVector:
// Convert the element instead.
SplitInteger(BitConvertToInteger(GetScalarizedVector(InOp)), Lo, Hi);
Lo = DAG.getNode(ISD::BITCAST, dl, NOutVT, Lo);
Hi = DAG.getNode(ISD::BITCAST, dl, NOutVT, Hi);
return;
- case WidenVector: {
+ case TargetLowering::TypeWidenVector: {
assert(!(InVT.getVectorNumElements() & 1) && "Unsupported BITCAST");
InOp = GetWidenedVector(InOp);
EVT InNVT = EVT::getVectorVT(*DAG.getContext(), InVT.getVectorElementType(),
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 0b4dd35..9595f69 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -526,13 +526,13 @@ void DAGTypeLegalizer::SplitVecRes_BITCAST(SDNode *N, SDValue &Lo,
switch (getTypeAction(InVT)) {
default:
assert(false && "Unknown type action!");
- case Legal:
- case PromoteInteger:
- case SoftenFloat:
- case ScalarizeVector:
+ case TargetLowering::TypeLegal:
+ case TargetLowering::TypePromoteInteger:
+ case TargetLowering::TypeSoftenFloat:
+ case TargetLowering::TypeScalarizeVector:
break;
- case ExpandInteger:
- case ExpandFloat:
+ case TargetLowering::TypeExpandInteger:
+ case TargetLowering::TypeExpandFloat:
// A scalar to vector conversion, where the scalar needs expansion.
// If the vector is being split in two then we can just convert the
// expanded pieces.
@@ -545,7 +545,7 @@ void DAGTypeLegalizer::SplitVecRes_BITCAST(SDNode *N, SDValue &Lo,
return;
}
break;
- case SplitVector:
+ case TargetLowering::TypeSplitVector:
// If the input is a vector that needs to be split, convert each split
// piece of the input now.
GetSplitVector(InOp, Lo, Hi);
@@ -774,7 +774,7 @@ void DAGTypeLegalizer::SplitVecRes_UnaryOp(SDNode *N, SDValue &Lo,
EVT InVT = N->getOperand(0).getValueType();
switch (getTypeAction(InVT)) {
default: llvm_unreachable("Unexpected type action!");
- case Legal: {
+ case TargetLowering::TypeLegal: {
EVT InNVT = EVT::getVectorVT(*DAG.getContext(), InVT.getVectorElementType(),
LoVT.getVectorNumElements());
Lo = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, InNVT, N->getOperand(0),
@@ -783,10 +783,21 @@ void DAGTypeLegalizer::SplitVecRes_UnaryOp(SDNode *N, SDValue &Lo,
DAG.getIntPtrConstant(InNVT.getVectorNumElements()));
break;
}
- case SplitVector:
+ case TargetLowering::TypePromoteInteger: {
+ SDValue InOp = GetPromotedInteger(N->getOperand(0));
+ EVT InNVT = EVT::getVectorVT(*DAG.getContext(),
+ InOp.getValueType().getVectorElementType(),
+ LoVT.getVectorNumElements());
+ Lo = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, InNVT, InOp,
+ DAG.getIntPtrConstant(0));
+ Hi = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, InNVT, InOp,
+ DAG.getIntPtrConstant(InNVT.getVectorNumElements()));
+ break;
+ }
+ case TargetLowering::TypeSplitVector:
GetSplitVector(N->getOperand(0), Lo, Hi);
break;
- case WidenVector: {
+ case TargetLowering::TypeWidenVector: {
// If the result needs to be split and the input needs to be widened,
// the two types must have different lengths. Use the widened result
// and extract from it to do the split.
@@ -1439,7 +1450,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_Convert(SDNode *N) {
unsigned Opcode = N->getOpcode();
unsigned InVTNumElts = InVT.getVectorNumElements();
- if (getTypeAction(InVT) == WidenVector) {
+ if (getTypeAction(InVT) == TargetLowering::TypeWidenVector) {
InOp = GetWidenedVector(N->getOperand(0));
InVT = InOp.getValueType();
InVTNumElts = InVT.getVectorNumElements();
@@ -1515,7 +1526,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_Shift(SDNode *N) {
SDValue ShOp = N->getOperand(1);
EVT ShVT = ShOp.getValueType();
- if (getTypeAction(ShVT) == WidenVector) {
+ if (getTypeAction(ShVT) == TargetLowering::TypeWidenVector) {
ShOp = GetWidenedVector(ShOp);
ShVT = ShOp.getValueType();
}
@@ -1557,9 +1568,9 @@ SDValue DAGTypeLegalizer::WidenVecRes_BITCAST(SDNode *N) {
default:
assert(false && "Unknown type action!");
break;
- case Legal:
+ case TargetLowering::TypeLegal:
break;
- case PromoteInteger:
+ case TargetLowering::TypePromoteInteger:
// If the InOp is promoted to the same size, convert it. Otherwise,
// fall out of the switch and widen the promoted input.
InOp = GetPromotedInteger(InOp);
@@ -1567,13 +1578,13 @@ SDValue DAGTypeLegalizer::WidenVecRes_BITCAST(SDNode *N) {
if (WidenVT.bitsEq(InVT))
return DAG.getNode(ISD::BITCAST, dl, WidenVT, InOp);
break;
- case SoftenFloat:
- case ExpandInteger:
- case ExpandFloat:
- case ScalarizeVector:
- case SplitVector:
+ case TargetLowering::TypeSoftenFloat:
+ case TargetLowering::TypeExpandInteger:
+ case TargetLowering::TypeExpandFloat:
+ case TargetLowering::TypeScalarizeVector:
+ case TargetLowering::TypeSplitVector:
break;
- case WidenVector:
+ case TargetLowering::TypeWidenVector:
// If the InOp is widened to the same size, convert it. Otherwise, fall
// out of the switch and widen the widened input.
InOp = GetWidenedVector(InOp);
@@ -1653,7 +1664,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_CONCAT_VECTORS(SDNode *N) {
unsigned NumOperands = N->getNumOperands();
bool InputWidened = false; // Indicates we need to widen the input.
- if (getTypeAction(InVT) != WidenVector) {
+ if (getTypeAction(InVT) != TargetLowering::TypeWidenVector) {
if (WidenVT.getVectorNumElements() % InVT.getVectorNumElements() == 0) {
// Add undef vectors to widen to correct length.
unsigned NumConcat = WidenVT.getVectorNumElements() /
@@ -1732,7 +1743,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_CONVERT_RNDSAT(SDNode *N) {
ISD::CvtCode CvtCode = cast<CvtRndSatSDNode>(N)->getCvtCode();
unsigned InVTNumElts = InVT.getVectorNumElements();
- if (getTypeAction(InVT) == WidenVector) {
+ if (getTypeAction(InVT) == TargetLowering::TypeWidenVector) {
InOp = GetWidenedVector(InOp);
InVT = InOp.getValueType();
InVTNumElts = InVT.getVectorNumElements();
@@ -1800,7 +1811,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_EXTRACT_SUBVECTOR(SDNode *N) {
SDValue Idx = N->getOperand(1);
DebugLoc dl = N->getDebugLoc();
- if (getTypeAction(InOp.getValueType()) == WidenVector)
+ if (getTypeAction(InOp.getValueType()) == TargetLowering::TypeWidenVector)
InOp = GetWidenedVector(InOp);
EVT InVT = InOp.getValueType();
@@ -1882,7 +1893,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_SELECT(SDNode *N) {
EVT CondEltVT = CondVT.getVectorElementType();
EVT CondWidenVT = EVT::getVectorVT(*DAG.getContext(),
CondEltVT, WidenNumElts);
- if (getTypeAction(CondVT) == WidenVector)
+ if (getTypeAction(CondVT) == TargetLowering::TypeWidenVector)
Cond1 = GetWidenedVector(Cond1);
if (Cond1.getValueType() != CondWidenVT)
@@ -2026,7 +2037,7 @@ SDValue DAGTypeLegalizer::WidenVecOp_Convert(SDNode *N) {
DebugLoc dl = N->getDebugLoc();
unsigned NumElts = VT.getVectorNumElements();
SDValue InOp = N->getOperand(0);
- if (getTypeAction(InOp.getValueType()) == WidenVector)
+ if (getTypeAction(InOp.getValueType()) == TargetLowering::TypeWidenVector)
InOp = GetWidenedVector(InOp);
EVT InVT = InOp.getValueType();
EVT InEltVT = InVT.getVectorElementType();
@@ -2081,7 +2092,7 @@ SDValue DAGTypeLegalizer::WidenVecOp_CONCAT_VECTORS(SDNode *N) {
unsigned NumOperands = N->getNumOperands();
for (unsigned i=0; i < NumOperands; ++i) {
SDValue InOp = N->getOperand(i);
- if (getTypeAction(InOp.getValueType()) == WidenVector)
+ if (getTypeAction(InOp.getValueType()) == TargetLowering::TypeWidenVector)
InOp = GetWidenedVector(InOp);
for (unsigned j=0; j < NumInElts; ++j)
Ops[Idx++] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, EltVT, InOp,
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index 88bd450..8d61a89 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -1008,14 +1008,15 @@ static void CheckForLiveRegDef(SUnit *SU, unsigned Reg,
for (const unsigned *AliasI = TRI->getOverlaps(Reg); *AliasI; ++AliasI) {
// Check if Ref is live.
- if (!LiveRegDefs[Reg]) continue;
+ if (!LiveRegDefs[*AliasI]) continue;
// Allow multiple uses of the same def.
- if (LiveRegDefs[Reg] == SU) continue;
+ if (LiveRegDefs[*AliasI] == SU) continue;
// Add Reg to the set of interfering live regs.
- if (RegAdded.insert(Reg))
- LRegs.push_back(Reg);
+ if (RegAdded.insert(*AliasI)) {
+ LRegs.push_back(*AliasI);
+ }
}
}
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index c2711c8..68eeb60 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2050,14 +2050,15 @@ void SelectionDAG::ComputeMaskedBits(SDValue Op, const APInt &Mask,
break;
default:
- // Allow the target to implement this method for its nodes.
- if (Op.getOpcode() >= ISD::BUILTIN_OP_END) {
+ if (Op.getOpcode() < ISD::BUILTIN_OP_END)
+ break;
+ // Fallthrough
case ISD::INTRINSIC_WO_CHAIN:
case ISD::INTRINSIC_W_CHAIN:
case ISD::INTRINSIC_VOID:
- TLI.computeMaskedBitsForTargetNode(Op, Mask, KnownZero, KnownOne, *this,
- Depth);
- }
+ // Allow the target to implement this method for its nodes.
+ TLI.computeMaskedBitsForTargetNode(Op, Mask, KnownZero, KnownOne, *this,
+ Depth);
return;
}
}
@@ -2322,6 +2323,13 @@ bool SelectionDAG::isKnownNeverZero(SDValue Op) const {
return !C->isZero();
// TODO: Recognize more cases here.
+ switch (Op.getOpcode()) {
+ default: break;
+ case ISD::OR:
+ if (const ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1)))
+ return !C->isNullValue();
+ break;
+ }
return false;
}
@@ -2339,16 +2347,6 @@ bool SelectionDAG::isEqualTo(SDValue A, SDValue B) const {
return false;
}
-bool SelectionDAG::isVerifiedDebugInfoDesc(SDValue Op) const {
- GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(Op);
- if (!GA) return false;
- if (GA->getOffset() != 0) return false;
- const GlobalVariable *GV = dyn_cast<GlobalVariable>(GA->getGlobal());
- if (!GV) return false;
- return MF->getMMI().hasDebugInfo();
-}
-
-
/// getNode - Gets or creates the specified node.
///
SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT) {
@@ -6304,7 +6302,7 @@ SDValue SelectionDAG::UnrollVectorOp(SDNode *N, unsigned ResNE) {
Operands[j] = getNode(ISD::EXTRACT_VECTOR_ELT, dl,
OperandEltVT,
Operand,
- getConstant(i, MVT::i32));
+ getConstant(i, TLI.getPointerTy()));
} else {
// A scalar operand; just use it as is.
Operands[j] = Operand;
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index b02a7b6..7a8a975 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -280,9 +280,36 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
}
// Vector/Vector bitcast.
- return DAG.getNode(ISD::BITCAST, DL, ValueVT, Val);
+ if (ValueVT.getSizeInBits() == PartVT.getSizeInBits())
+ return DAG.getNode(ISD::BITCAST, DL, ValueVT, Val);
+
+ assert(PartVT.getVectorNumElements() == ValueVT.getVectorNumElements() &&
+ "Cannot handle this kind of promotion");
+ // Promoted vector extract
+ unsigned NumElts = ValueVT.getVectorNumElements();
+ SmallVector<SDValue, 8> NewOps;
+ for (unsigned i = 0; i < NumElts; ++i) {
+ SDValue Ext = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
+ PartVT.getScalarType(), Val ,DAG.getIntPtrConstant(i));
+ SDValue Cast;
+
+ bool Smaller = ValueVT.bitsLE(PartVT);
+
+ Cast = DAG.getNode((Smaller ? ISD::TRUNCATE : ISD::ANY_EXTEND),
+ DL, ValueVT.getScalarType(), Ext);
+
+ NewOps.push_back(Cast);
+ }
+ return DAG.getNode(ISD::BUILD_VECTOR, DL, ValueVT,
+ &NewOps[0], NewOps.size());
}
+ // Trivial bitcast if the types are the same size and the destination
+ // vector type is legal.
+ if (PartVT.getSizeInBits() == ValueVT.getSizeInBits() &&
+ TLI.isTypeLegal(ValueVT))
+ return DAG.getNode(ISD::BITCAST, DL, ValueVT, Val);
+
assert(ValueVT.getVectorElementType() == PartVT &&
ValueVT.getVectorNumElements() == 1 &&
"Only trivial scalar-to-vector conversions should get here!");
@@ -446,7 +473,24 @@ static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
//SDValue UndefElts = DAG.getUNDEF(VectorTy);
//Val = DAG.getNode(ISD::CONCAT_VECTORS, DL, PartVT, Val, UndefElts);
- } else {
+ } else if (PartVT.isVector() &&
+ PartVT.getVectorElementType().bitsGE(
+ ValueVT.getVectorElementType())&&
+ PartVT.getVectorNumElements() == ValueVT.getVectorNumElements()) {
+
+ // Promoted vector extract
+ unsigned NumElts = ValueVT.getVectorNumElements();
+ SmallVector<SDValue, 8> NewOps;
+ for (unsigned i = 0; i < NumElts; ++i) {
+ SDValue Ext = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
+ ValueVT.getScalarType(), Val ,DAG.getIntPtrConstant(i));
+ SDValue Cast = DAG.getNode(ISD::ANY_EXTEND,
+ DL, PartVT.getScalarType(), Ext);
+ NewOps.push_back(Cast);
+ }
+ Val = DAG.getNode(ISD::BUILD_VECTOR, DL, PartVT,
+ &NewOps[0], NewOps.size());
+ } else{
// Vector -> scalar conversion.
assert(ValueVT.getVectorElementType() == PartVT &&
ValueVT.getVectorNumElements() == 1 &&
@@ -783,11 +827,20 @@ void SelectionDAGBuilder::clear() {
UnusedArgNodeMap.clear();
PendingLoads.clear();
PendingExports.clear();
- DanglingDebugInfoMap.clear();
CurDebugLoc = DebugLoc();
HasTailCall = false;
}
+/// clearDanglingDebugInfo - Clear the dangling debug information
+/// map. This function is seperated from the clear so that debug
+/// information that is dangling in a basic block can be properly
+/// resolved in a different basic block. This allows the
+/// SelectionDAG to resolve dangling debug information attached
+/// to PHI nodes.
+void SelectionDAGBuilder::clearDanglingDebugInfo() {
+ DanglingDebugInfoMap.clear();
+}
+
/// getRoot - Return the current virtual root of the Selection DAG,
/// flushing any PendingLoad items. This must be done before emitting
/// a store or any other node that may need to be ordered after any
@@ -1175,6 +1228,10 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
/// created for it, emit nodes to copy the value into the virtual
/// registers.
void SelectionDAGBuilder::CopyToExportRegsIfNeeded(const Value *V) {
+ // Skip empty types
+ if (V->getType()->isEmptyTy())
+ return;
+
DenseMap<const Value *, unsigned>::iterator VMI = FuncInfo.ValueMap.find(V);
if (VMI != FuncInfo.ValueMap.end()) {
assert(!V->use_empty() && "Unused value assigned virtual registers!");
@@ -2810,16 +2867,18 @@ void SelectionDAGBuilder::visitInsertValue(const InsertValueInst &I) {
SmallVector<SDValue, 4> Values(NumAggValues);
SDValue Agg = getValue(Op0);
- SDValue Val = getValue(Op1);
unsigned i = 0;
// Copy the beginning value(s) from the original aggregate.
for (; i != LinearIndex; ++i)
Values[i] = IntoUndef ? DAG.getUNDEF(AggValueVTs[i]) :
SDValue(Agg.getNode(), Agg.getResNo() + i);
// Copy values from the inserted value(s).
- for (; i != LinearIndex + NumValValues; ++i)
- Values[i] = FromUndef ? DAG.getUNDEF(AggValueVTs[i]) :
- SDValue(Val.getNode(), Val.getResNo() + i - LinearIndex);
+ if (NumValValues) {
+ SDValue Val = getValue(Op1);
+ for (; i != LinearIndex + NumValValues; ++i)
+ Values[i] = FromUndef ? DAG.getUNDEF(AggValueVTs[i]) :
+ SDValue(Val.getNode(), Val.getResNo() + i - LinearIndex);
+ }
// Copy remaining value(s) from the original aggregate.
for (; i != NumAggValues; ++i)
Values[i] = IntoUndef ? DAG.getUNDEF(AggValueVTs[i]) :
@@ -2842,6 +2901,13 @@ void SelectionDAGBuilder::visitExtractValue(const ExtractValueInst &I) {
ComputeValueVTs(TLI, ValTy, ValValueVTs);
unsigned NumValValues = ValValueVTs.size();
+
+ // Ignore a extractvalue that produces an empty object
+ if (!NumValValues) {
+ setValue(&I, DAG.getUNDEF(MVT(MVT::Other)));
+ return;
+ }
+
SmallVector<SDValue, 4> Values(NumValValues);
SDValue Agg = getValue(Op0);
@@ -4013,6 +4079,24 @@ static SDValue ExpandPowI(DebugLoc DL, SDValue LHS, SDValue RHS,
return DAG.getNode(ISD::FPOWI, DL, LHS.getValueType(), LHS, RHS);
}
+// getTruncatedArgReg - Find underlying register used for an truncated
+// argument.
+static unsigned getTruncatedArgReg(const SDValue &N) {
+ if (N.getOpcode() != ISD::TRUNCATE)
+ return 0;
+
+ const SDValue &Ext = N.getOperand(0);
+ if (Ext.getOpcode() == ISD::AssertZext || Ext.getOpcode() == ISD::AssertSext){
+ const SDValue &CFR = Ext.getOperand(0);
+ if (CFR.getOpcode() == ISD::CopyFromReg)
+ return cast<RegisterSDNode>(CFR.getOperand(1))->getReg();
+ else
+ if (CFR.getOpcode() == ISD::TRUNCATE)
+ return getTruncatedArgReg(CFR);
+ }
+ return 0;
+}
+
/// EmitFuncArgumentDbgValue - If the DbgValueInst is a dbg_value of a function
/// argument, create the corresponding DBG_VALUE machine instruction for it now.
/// At the end of instruction selection, they will be inserted to the entry BB.
@@ -4044,9 +4128,12 @@ SelectionDAGBuilder::EmitFuncArgumentDbgValue(const Value *V, MDNode *Variable,
Reg = 0;
}
- if (N.getNode() && N.getOpcode() == ISD::CopyFromReg) {
- Reg = cast<RegisterSDNode>(N.getOperand(1))->getReg();
- if (TargetRegisterInfo::isVirtualRegister(Reg)) {
+ if (N.getNode()) {
+ if (N.getOpcode() == ISD::CopyFromReg)
+ Reg = cast<RegisterSDNode>(N.getOperand(1))->getReg();
+ else
+ Reg = getTruncatedArgReg(N);
+ if (Reg && TargetRegisterInfo::isVirtualRegister(Reg)) {
MachineRegisterInfo &RegInfo = MF.getRegInfo();
unsigned PR = RegInfo.getLiveInPhysReg(Reg);
if (PR)
@@ -4208,9 +4295,9 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
SDV = DAG.getDbgValue(Variable, FINode->getIndex(),
0, dl, SDNodeOrder);
else {
- // Can't do anything with other non-AI cases yet. This might be a
- // parameter of a callee function that got inlined, for example.
- DEBUG(dbgs() << "Dropping debug info for " << DI);
+ // Address is an argument, so try to emit its dbg value using
+ // virtual register info from the FuncInfo.ValueMap.
+ EmitFuncArgumentDbgValue(Address, Variable, 0, N);
return 0;
}
} else if (AI)
@@ -4403,7 +4490,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
}
case Intrinsic::eh_sjlj_dispatch_setup: {
DAG.setRoot(DAG.getNode(ISD::EH_SJLJ_DISPATCHSETUP, dl, MVT::Other,
- getRoot()));
+ getRoot(), getValue(I.getArgOperand(0))));
return 0;
}
@@ -4797,7 +4884,9 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
Outs, TLI, &Offsets);
bool CanLowerReturn = TLI.CanLowerReturn(CS.getCallingConv(),
- FTy->isVarArg(), Outs, FTy->getContext());
+ DAG.getMachineFunction(),
+ FTy->isVarArg(), Outs,
+ FTy->getContext());
SDValue DemoteStackSlot;
int DemoteStackIdx = -100;
@@ -4827,8 +4916,14 @@ void SelectionDAGBuilder::LowerCallTo(ImmutableCallSite CS, SDValue Callee,
for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
i != e; ++i) {
- SDValue ArgNode = getValue(*i);
- Entry.Node = ArgNode; Entry.Ty = (*i)->getType();
+ const Value *V = *i;
+
+ // Skip empty types
+ if (V->getType()->isEmptyTy())
+ continue;
+
+ SDValue ArgNode = getValue(V);
+ Entry.Node = ArgNode; Entry.Ty = V->getType();
unsigned attrInd = i - CS.arg_begin() + 1;
Entry.isSExt = CS.paramHasAttr(attrInd, Attribute::SExt);
@@ -5268,6 +5363,7 @@ public:
const llvm::Type *OpTy = CallOperandVal->getType();
+ // FIXME: code duplicated from TargetLowering::ParseConstraints().
// If this is an indirect operand, the operand is a pointer to the
// accessed type.
if (isIndirect) {
@@ -5277,6 +5373,11 @@ public:
OpTy = PtrTy->getElementType();
}
+ // Look for vector wrapped in a struct. e.g. { <16 x i8> }.
+ if (const StructType *STy = dyn_cast<StructType>(OpTy))
+ if (STy->getNumElements() == 1)
+ OpTy = STy->getElementType(0);
+
// If OpTy is not a single value, it may be a struct/union that we
// can tile with integers.
if (!OpTy->isSingleValueType() && OpTy->isSized()) {
@@ -5555,7 +5656,9 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
std::set<unsigned> OutputRegs, InputRegs;
- TargetLowering::AsmOperandInfoVector TargetConstraints = TLI.ParseConstraints(CS);
+ TargetLowering::AsmOperandInfoVector
+ TargetConstraints = TLI.ParseConstraints(CS);
+
bool hasMemory = false;
unsigned ArgNo = 0; // ArgNo - The argument of the CallInst.
@@ -5614,7 +5717,8 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
hasMemory = true;
else {
for (unsigned j = 0, ee = OpInfo.Codes.size(); j != ee; ++j) {
- TargetLowering::ConstraintType CType = TLI.getConstraintType(OpInfo.Codes[j]);
+ TargetLowering::ConstraintType
+ CType = TLI.getConstraintType(OpInfo.Codes[j]);
if (CType == TargetLowering::C_Memory) {
hasMemory = true;
break;
@@ -5664,12 +5768,17 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
// need to to provide an address for the memory input.
if (OpInfo.ConstraintType == TargetLowering::C_Memory &&
!OpInfo.isIndirect) {
- assert((OpInfo.isMultipleAlternative || (OpInfo.Type == InlineAsm::isInput)) &&
+ assert((OpInfo.isMultipleAlternative ||
+ (OpInfo.Type == InlineAsm::isInput)) &&
"Can only indirectify direct input operands!");
// Memory operands really want the address of the value. If we don't have
// an indirect input, put it in the constpool if we can, otherwise spill
// it to a stack slot.
+ // TODO: This isn't quite right. We need to handle these according to
+ // the addressing mode that the constraint wants. Also, this may take
+ // an additional register for the computation and we don't want that
+ // either.
// If the operand is a float, integer, or vector constant, spill to a
// constant pool entry to get its address.
@@ -5871,7 +5980,7 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
if (OpInfo.ConstraintType == TargetLowering::C_Other) {
std::vector<SDValue> Ops;
- TLI.LowerAsmOperandForConstraint(InOperandVal, OpInfo.ConstraintCode[0],
+ TLI.LowerAsmOperandForConstraint(InOperandVal, OpInfo.ConstraintCode,
Ops, DAG);
if (Ops.empty())
report_fatal_error("Invalid operand for inline asm constraint '" +
@@ -6080,14 +6189,15 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
Flags.setByVal();
const PointerType *Ty = cast<PointerType>(Args[i].Ty);
const Type *ElementTy = Ty->getElementType();
- unsigned FrameAlign = getByValTypeAlignment(ElementTy);
- unsigned FrameSize = getTargetData()->getTypeAllocSize(ElementTy);
+ Flags.setByValSize(getTargetData()->getTypeAllocSize(ElementTy));
// For ByVal, alignment should come from FE. BE will guess if this
// info is not there but there are cases it cannot get right.
+ unsigned FrameAlign;
if (Args[i].Alignment)
FrameAlign = Args[i].Alignment;
+ else
+ FrameAlign = getByValTypeAlignment(ElementTy);
Flags.setByValAlign(FrameAlign);
- Flags.setByValSize(FrameSize);
}
if (Args[i].isNest)
Flags.setNest();
@@ -6232,6 +6342,25 @@ SelectionDAGBuilder::CopyValueToVirtualRegister(const Value *V, unsigned Reg) {
#include "llvm/CodeGen/SelectionDAGISel.h"
+/// isOnlyUsedInEntryBlock - If the specified argument is only used in the
+/// entry block, return true. This includes arguments used by switches, since
+/// the switch may expand into multiple basic blocks.
+static bool isOnlyUsedInEntryBlock(const Argument *A) {
+ // With FastISel active, we may be splitting blocks, so force creation
+ // of virtual registers for all non-dead arguments.
+ if (EnableFastISel)
+ return A->use_empty();
+
+ const BasicBlock *Entry = A->getParent()->begin();
+ for (Value::const_use_iterator UI = A->use_begin(), E = A->use_end();
+ UI != E; ++UI) {
+ const User *U = *UI;
+ if (cast<Instruction>(U)->getParent() != Entry || isa<SwitchInst>(U))
+ return false; // Use not in entry block.
+ }
+ return true;
+}
+
void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
// If this is the entry block, emit arguments.
const Function &F = *LLVMBB->getParent();
@@ -6286,14 +6415,15 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
Flags.setByVal();
const PointerType *Ty = cast<PointerType>(I->getType());
const Type *ElementTy = Ty->getElementType();
- unsigned FrameAlign = TLI.getByValTypeAlignment(ElementTy);
- unsigned FrameSize = TD->getTypeAllocSize(ElementTy);
+ Flags.setByValSize(TD->getTypeAllocSize(ElementTy));
// For ByVal, alignment should be passed from FE. BE will guess if
// this info is not there but there are cases it cannot get right.
+ unsigned FrameAlign;
if (F.getParamAlignment(Idx))
FrameAlign = F.getParamAlignment(Idx);
+ else
+ FrameAlign = TLI.getByValTypeAlignment(ElementTy);
Flags.setByValAlign(FrameAlign);
- Flags.setByValSize(FrameSize);
}
if (F.paramHasAttr(Idx, Attribute::Nest))
Flags.setNest();
@@ -6375,8 +6505,8 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
if (I->use_empty() && NumValues)
SDB->setUnusedArgValue(I, InVals[i]);
- for (unsigned Value = 0; Value != NumValues; ++Value) {
- EVT VT = ValueVTs[Value];
+ for (unsigned Val = 0; Val != NumValues; ++Val) {
+ EVT VT = ValueVTs[Val];
EVT PartVT = TLI.getRegisterType(*CurDAG->getContext(), VT);
unsigned NumParts = TLI.getNumRegisters(*CurDAG->getContext(), VT);
@@ -6395,21 +6525,35 @@ void SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) {
i += NumParts;
}
+ // We don't need to do anything else for unused arguments.
+ if (ArgValues.empty())
+ continue;
+
// Note down frame index for byval arguments.
- if (I->hasByValAttr() && !ArgValues.empty())
+ if (I->hasByValAttr())
if (FrameIndexSDNode *FI =
dyn_cast<FrameIndexSDNode>(ArgValues[0].getNode()))
FuncInfo->setByValArgumentFrameIndex(I, FI->getIndex());
- if (!I->use_empty()) {
- SDValue Res;
- if (!ArgValues.empty())
- Res = DAG.getMergeValues(&ArgValues[0], NumValues,
- SDB->getCurDebugLoc());
- SDB->setValue(I, Res);
-
- // If this argument is live outside of the entry block, insert a copy from
- // wherever we got it to the vreg that other BB's will reference it as.
+ SDValue Res = DAG.getMergeValues(&ArgValues[0], NumValues,
+ SDB->getCurDebugLoc());
+ SDB->setValue(I, Res);
+
+ // If this argument is live outside of the entry block, insert a copy from
+ // wherever we got it to the vreg that other BB's will reference it as.
+ if (!EnableFastISel && Res.getOpcode() == ISD::CopyFromReg) {
+ // If we can, though, try to skip creating an unnecessary vreg.
+ // FIXME: This isn't very clean... it would be nice to make this more
+ // general. It's also subtly incompatible with the hacks FastISel
+ // uses with vregs.
+ unsigned Reg = cast<RegisterSDNode>(Res.getOperand(1))->getReg();
+ if (TargetRegisterInfo::isVirtualRegister(Reg)) {
+ FuncInfo->ValueMap[I] = Reg;
+ continue;
+ }
+ }
+ if (!isOnlyUsedInEntryBlock(I)) {
+ FuncInfo->InitializeRegForValue(I);
SDB->CopyToExportRegsIfNeeded(I);
}
}
@@ -6455,6 +6599,10 @@ SelectionDAGBuilder::HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB) {
// Ignore dead phi's.
if (PN->use_empty()) continue;
+ // Skip empty types
+ if (PN->getType()->isEmptyTy())
+ continue;
+
unsigned Reg;
const Value *PHIOp = PN->getIncomingValueForBlock(LLVMBB);
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
index a689b76..8376d41 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
@@ -332,6 +332,14 @@ public:
/// consumed.
void clear();
+ /// clearDanglingDebugInfo - Clear the dangling debug information
+ /// map. This function is seperated from the clear so that debug
+ /// information that is dangling in a basic block can be properly
+ /// resolved in a different basic block. This allows the
+ /// SelectionDAG to resolve dangling debug information attached
+ /// to PHI nodes.
+ void clearDanglingDebugInfo();
+
/// getRoot - Return the current virtual root of the Selection DAG,
/// flushing any PendingLoad items. This must be done before emitting
/// a store or any other node that may need to be ordered after any
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index fdf3767..771b008 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -55,17 +55,11 @@
using namespace llvm;
STATISTIC(NumFastIselFailures, "Number of instructions fast isel failed on");
+STATISTIC(NumFastIselSuccess, "Number of instructions fast isel selected");
STATISTIC(NumFastIselBlocks, "Number of blocks selected entirely by fast isel");
STATISTIC(NumDAGBlocks, "Number of blocks selected using DAG");
STATISTIC(NumDAGIselRetries,"Number of times dag isel has to try another path");
-#ifndef NDEBUG
-STATISTIC(NumBBWithOutOfOrderLineInfo,
- "Number of blocks with out of order line number info");
-STATISTIC(NumMBBWithOutOfOrderLineInfo,
- "Number of machine blocks with out of order line number info");
-#endif
-
static cl::opt<bool>
EnableFastISelVerbose("fast-isel-verbose", cl::Hidden,
cl::desc("Enable verbose messages in the \"fast\" "
@@ -208,40 +202,6 @@ void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const {
MachineFunctionPass::getAnalysisUsage(AU);
}
-/// FunctionCallsSetJmp - Return true if the function has a call to setjmp or
-/// other function that gcc recognizes as "returning twice". This is used to
-/// limit code-gen optimizations on the machine function.
-///
-/// FIXME: Remove after <rdar://problem/8031714> is fixed.
-static bool FunctionCallsSetJmp(const Function *F) {
- const Module *M = F->getParent();
- static const char *ReturnsTwiceFns[] = {
- "_setjmp",
- "setjmp",
- "sigsetjmp",
- "setjmp_syscall",
- "savectx",
- "qsetjmp",
- "vfork",
- "getcontext"
- };
-#define NUM_RETURNS_TWICE_FNS sizeof(ReturnsTwiceFns) / sizeof(const char *)
-
- for (unsigned I = 0; I < NUM_RETURNS_TWICE_FNS; ++I)
- if (const Function *Callee = M->getFunction(ReturnsTwiceFns[I])) {
- if (!Callee->use_empty())
- for (Value::const_use_iterator
- I = Callee->use_begin(), E = Callee->use_end();
- I != E; ++I)
- if (const CallInst *CI = dyn_cast<CallInst>(*I))
- if (CI->getParent()->getParent() == F)
- return true;
- }
-
- return false;
-#undef NUM_RETURNS_TWICE_FNS
-}
-
/// SplitCriticalSideEffectEdges - Look for critical edges with a PHI value that
/// may trap on it. In this case we have to split the edge so that the path
/// through the predecessor block that doesn't go to the phi block doesn't
@@ -392,7 +352,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
}
// Determine if there is a call to setjmp in the machine function.
- MF->setCallsSetJmp(FunctionCallsSetJmp(&Fn));
+ MF->setCallsSetJmp(Fn.callsFunctionThatReturnsTwice());
// Replace forward-declared registers with the registers containing
// the desired value.
@@ -570,7 +530,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
{
NamedRegionTimer T("DAG Legalization", GroupName, TimePassesIsEnabled);
- CurDAG->Legalize(OptLevel);
+ CurDAG->Legalize();
}
DEBUG(dbgs() << "Legalized selection DAG: BB#" << BlockNumber
@@ -819,48 +779,6 @@ bool SelectionDAGISel::TryToFoldFastISelLoad(const LoadInst *LI,
return FastIS->TryToFoldLoad(User, RI.getOperandNo(), LI);
}
-#ifndef NDEBUG
-/// CheckLineNumbers - Check if basic block instructions follow source order
-/// or not.
-static void CheckLineNumbers(const BasicBlock *BB) {
- unsigned Line = 0;
- unsigned Col = 0;
- for (BasicBlock::const_iterator BI = BB->begin(),
- BE = BB->end(); BI != BE; ++BI) {
- const DebugLoc DL = BI->getDebugLoc();
- if (DL.isUnknown()) continue;
- unsigned L = DL.getLine();
- unsigned C = DL.getCol();
- if (L < Line || (L == Line && C < Col)) {
- ++NumBBWithOutOfOrderLineInfo;
- return;
- }
- Line = L;
- Col = C;
- }
-}
-
-/// CheckLineNumbers - Check if machine basic block instructions follow source
-/// order or not.
-static void CheckLineNumbers(const MachineBasicBlock *MBB) {
- unsigned Line = 0;
- unsigned Col = 0;
- for (MachineBasicBlock::const_iterator MBI = MBB->begin(),
- MBE = MBB->end(); MBI != MBE; ++MBI) {
- const DebugLoc DL = MBI->getDebugLoc();
- if (DL.isUnknown()) continue;
- unsigned L = DL.getLine();
- unsigned C = DL.getCol();
- if (L < Line || (L == Line && C < Col)) {
- ++NumMBBWithOutOfOrderLineInfo;
- return;
- }
- Line = L;
- Col = C;
- }
-}
-#endif
-
/// isFoldedOrDeadInstruction - Return true if the specified instruction is
/// side-effect free and is either dead or folded into a generated instruction.
/// Return false if it needs to be emitted.
@@ -883,9 +801,6 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
for (ReversePostOrderTraversal<const Function*>::rpo_iterator
I = RPOT.begin(), E = RPOT.end(); I != E; ++I) {
const BasicBlock *LLVMBB = *I;
-#ifndef NDEBUG
- CheckLineNumbers(LLVMBB);
-#endif
if (OptLevel != CodeGenOpt::None) {
bool AllPredsVisited = true;
@@ -961,6 +876,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
// Try to select the instruction with FastISel.
if (FastIS->SelectInstruction(Inst)) {
+ ++NumFastIselSuccess;
// If fast isel succeeded, skip over all the folded instructions, and
// then see if there is a load right before the selected instructions.
// Try to fold the load if so.
@@ -1004,9 +920,14 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
continue;
}
- // Otherwise, give up on FastISel for the rest of the block.
- // For now, be a little lenient about non-branch terminators.
- if (!isa<TerminatorInst>(Inst) || isa<BranchInst>(Inst)) {
+ if (isa<TerminatorInst>(Inst) && !isa<BranchInst>(Inst)) {
+ // Don't abort, and use a different message for terminator misses.
+ ++NumFastIselFailures;
+ if (EnableFastISelVerbose || EnableFastISelAbort) {
+ dbgs() << "FastISel missed terminator: ";
+ Inst->dump();
+ }
+ } else {
++NumFastIselFailures;
if (EnableFastISelVerbose || EnableFastISelAbort) {
dbgs() << "FastISel miss: ";
@@ -1041,11 +962,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
}
delete FastIS;
-#ifndef NDEBUG
- for (MachineFunction::const_iterator MBI = MF->begin(), MBE = MF->end();
- MBI != MBE; ++MBI)
- CheckLineNumbers(MBI);
-#endif
+ SDB->clearDanglingDebugInfo();
}
void
@@ -2677,11 +2594,45 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
// instructions that access memory and for ComplexPatterns that match
// loads.
if (EmitNodeInfo & OPFL_MemRefs) {
+ // Only attach load or store memory operands if the generated
+ // instruction may load or store.
+ const TargetInstrDesc &TID = TM.getInstrInfo()->get(TargetOpc);
+ bool mayLoad = TID.mayLoad();
+ bool mayStore = TID.mayStore();
+
+ unsigned NumMemRefs = 0;
+ for (SmallVector<MachineMemOperand*, 2>::const_iterator I =
+ MatchedMemRefs.begin(), E = MatchedMemRefs.end(); I != E; ++I) {
+ if ((*I)->isLoad()) {
+ if (mayLoad)
+ ++NumMemRefs;
+ } else if ((*I)->isStore()) {
+ if (mayStore)
+ ++NumMemRefs;
+ } else {
+ ++NumMemRefs;
+ }
+ }
+
MachineSDNode::mmo_iterator MemRefs =
- MF->allocateMemRefsArray(MatchedMemRefs.size());
- std::copy(MatchedMemRefs.begin(), MatchedMemRefs.end(), MemRefs);
+ MF->allocateMemRefsArray(NumMemRefs);
+
+ MachineSDNode::mmo_iterator MemRefsPos = MemRefs;
+ for (SmallVector<MachineMemOperand*, 2>::const_iterator I =
+ MatchedMemRefs.begin(), E = MatchedMemRefs.end(); I != E; ++I) {
+ if ((*I)->isLoad()) {
+ if (mayLoad)
+ *MemRefsPos++ = *I;
+ } else if ((*I)->isStore()) {
+ if (mayStore)
+ *MemRefsPos++ = *I;
+ } else {
+ *MemRefsPos++ = *I;
+ }
+ }
+
cast<MachineSDNode>(Res)
- ->setMemRefs(MemRefs, MemRefs + MatchedMemRefs.size());
+ ->setMemRefs(MemRefs, MemRefs + NumMemRefs);
}
DEBUG(errs() << " "
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 15606af..cf6069a 100644
--- a/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -26,11 +26,19 @@
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include <cctype>
using namespace llvm;
+/// We are in the process of implementing a new TypeLegalization action
+/// - the promotion of vector elements. This feature is disabled by default
+/// and only enabled using this flag.
+static cl::opt<bool>
+AllowPromoteIntElem("promote-elements", cl::Hidden,
+ cl::desc("Allow promotion of integer vector element types"));
+
namespace llvm {
TLSModel::Model getTLSModel(const GlobalValue *GV, Reloc::Model reloc) {
bool isLocal = GV->hasLocalLinkage();
@@ -528,7 +536,8 @@ static void InitCmpLibcallCCs(ISD::CondCode *CCs) {
/// NOTE: The constructor takes ownership of TLOF.
TargetLowering::TargetLowering(const TargetMachine &tm,
const TargetLoweringObjectFile *tlof)
- : TM(tm), TD(TM.getTargetData()), TLOF(*tlof) {
+ : TM(tm), TD(TM.getTargetData()), TLOF(*tlof),
+ mayPromoteElements(AllowPromoteIntElem) {
// All operations default to being supported.
memset(OpActions, 0, sizeof(OpActions));
memset(LoadExtActions, 0, sizeof(LoadExtActions));
@@ -596,6 +605,8 @@ TargetLowering::TargetLowering(const TargetMachine &tm,
SchedPreferenceInfo = Sched::Latency;
JumpBufSize = 0;
JumpBufAlignment = 0;
+ MinFunctionAlignment = 0;
+ PrefFunctionAlignment = 0;
PrefLoopAlignment = 0;
MinStackArgumentAlignment = 1;
ShouldFoldAtomicFences = false;
@@ -747,7 +758,7 @@ void TargetLowering::computeRegisterProperties() {
NumRegistersForVT[ExpandedReg] = 2*NumRegistersForVT[ExpandedReg-1];
RegisterTypeForVT[ExpandedReg] = (MVT::SimpleValueType)LargestIntReg;
TransformToType[ExpandedReg] = (MVT::SimpleValueType)(ExpandedReg - 1);
- ValueTypeActions.setTypeAction(ExpandedVT, Expand);
+ ValueTypeActions.setTypeAction(ExpandedVT, TypeExpandInteger);
}
// Inspect all of the ValueType's smaller than the largest integer
@@ -761,7 +772,7 @@ void TargetLowering::computeRegisterProperties() {
} else {
RegisterTypeForVT[IntReg] = TransformToType[IntReg] =
(MVT::SimpleValueType)LegalIntReg;
- ValueTypeActions.setTypeAction(IVT, Promote);
+ ValueTypeActions.setTypeAction(IVT, TypePromoteInteger);
}
}
@@ -770,7 +781,7 @@ void TargetLowering::computeRegisterProperties() {
NumRegistersForVT[MVT::ppcf128] = 2*NumRegistersForVT[MVT::f64];
RegisterTypeForVT[MVT::ppcf128] = MVT::f64;
TransformToType[MVT::ppcf128] = MVT::f64;
- ValueTypeActions.setTypeAction(MVT::ppcf128, Expand);
+ ValueTypeActions.setTypeAction(MVT::ppcf128, TypeExpandFloat);
}
// Decide how to handle f64. If the target does not have native f64 support,
@@ -779,7 +790,7 @@ void TargetLowering::computeRegisterProperties() {
NumRegistersForVT[MVT::f64] = NumRegistersForVT[MVT::i64];
RegisterTypeForVT[MVT::f64] = RegisterTypeForVT[MVT::i64];
TransformToType[MVT::f64] = MVT::i64;
- ValueTypeActions.setTypeAction(MVT::f64, Expand);
+ ValueTypeActions.setTypeAction(MVT::f64, TypeSoftenFloat);
}
// Decide how to handle f32. If the target does not have native support for
@@ -789,12 +800,12 @@ void TargetLowering::computeRegisterProperties() {
NumRegistersForVT[MVT::f32] = NumRegistersForVT[MVT::f64];
RegisterTypeForVT[MVT::f32] = RegisterTypeForVT[MVT::f64];
TransformToType[MVT::f32] = MVT::f64;
- ValueTypeActions.setTypeAction(MVT::f32, Promote);
+ ValueTypeActions.setTypeAction(MVT::f32, TypePromoteInteger);
} else {
NumRegistersForVT[MVT::f32] = NumRegistersForVT[MVT::i32];
RegisterTypeForVT[MVT::f32] = RegisterTypeForVT[MVT::i32];
TransformToType[MVT::f32] = MVT::i32;
- ValueTypeActions.setTypeAction(MVT::f32, Expand);
+ ValueTypeActions.setTypeAction(MVT::f32, TypeSoftenFloat);
}
}
@@ -810,6 +821,30 @@ void TargetLowering::computeRegisterProperties() {
unsigned NElts = VT.getVectorNumElements();
if (NElts != 1) {
bool IsLegalWiderType = false;
+ // If we allow the promotion of vector elements using a flag,
+ // then return TypePromoteInteger on vector elements.
+ // First try to promote the elements of integer vectors. If no legal
+ // promotion was found, fallback to the widen-vector method.
+ if (mayPromoteElements)
+ for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
+ EVT SVT = (MVT::SimpleValueType)nVT;
+ // Promote vectors of integers to vectors with the same number
+ // of elements, with a wider element type.
+ if (SVT.getVectorElementType().getSizeInBits() > EltVT.getSizeInBits()
+ && SVT.getVectorNumElements() == NElts &&
+ isTypeLegal(SVT) && SVT.getScalarType().isInteger()) {
+ TransformToType[i] = SVT;
+ RegisterTypeForVT[i] = SVT;
+ NumRegistersForVT[i] = 1;
+ ValueTypeActions.setTypeAction(VT, TypePromoteInteger);
+ IsLegalWiderType = true;
+ break;
+ }
+ }
+
+ if (IsLegalWiderType) continue;
+
+ // Try to widen the vector.
for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
EVT SVT = (MVT::SimpleValueType)nVT;
if (SVT.getVectorElementType() == EltVT &&
@@ -818,7 +853,7 @@ void TargetLowering::computeRegisterProperties() {
TransformToType[i] = SVT;
RegisterTypeForVT[i] = SVT;
NumRegistersForVT[i] = 1;
- ValueTypeActions.setTypeAction(VT, Promote);
+ ValueTypeActions.setTypeAction(VT, TypeWidenVector);
IsLegalWiderType = true;
break;
}
@@ -838,10 +873,12 @@ void TargetLowering::computeRegisterProperties() {
if (NVT == VT) {
// Type is already a power of 2. The default action is to split.
TransformToType[i] = MVT::Other;
- ValueTypeActions.setTypeAction(VT, Expand);
+ unsigned NumElts = VT.getVectorNumElements();
+ ValueTypeActions.setTypeAction(VT,
+ NumElts > 1 ? TypeSplitVector : TypeScalarizeVector);
} else {
TransformToType[i] = NVT;
- ValueTypeActions.setTypeAction(VT, Promote);
+ ValueTypeActions.setTypeAction(VT, TypeWidenVector);
}
}
@@ -890,7 +927,7 @@ unsigned TargetLowering::getVectorTypeBreakdown(LLVMContext &Context, EVT VT,
// If there is a wider vector type with the same element type as this one,
// we should widen to that legal vector type. This handles things like
// <2 x float> -> <4 x float>.
- if (NumElts != 1 && getTypeAction(VT) == Promote) {
+ if (NumElts != 1 && getTypeAction(Context, VT) == TypeWidenVector) {
RegisterVT = getTypeToTransformTo(Context, VT);
if (isTypeLegal(RegisterVT)) {
IntermediateVT = RegisterVT;
@@ -1723,26 +1760,28 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
break;
}
case ISD::BITCAST:
-#if 0
- // If this is an FP->Int bitcast and if the sign bit is the only thing that
- // is demanded, turn this into a FGETSIGN.
- if (NewMask == EVT::getIntegerVTSignBit(Op.getValueType()) &&
- MVT::isFloatingPoint(Op.getOperand(0).getValueType()) &&
- !MVT::isVector(Op.getOperand(0).getValueType())) {
- // Only do this xform if FGETSIGN is valid or if before legalize.
- if (!TLO.AfterLegalize ||
- isOperationLegal(ISD::FGETSIGN, Op.getValueType())) {
+ // If this is an FP->Int bitcast and if the sign bit is the only
+ // thing demanded, turn this into a FGETSIGN.
+ if (NewMask == APInt::getSignBit(Op.getValueType().getSizeInBits()) &&
+ Op.getOperand(0).getValueType().isFloatingPoint() &&
+ !Op.getOperand(0).getValueType().isVector()) {
+ bool OpVTLegal = isOperationLegalOrCustom(ISD::FGETSIGN, Op.getValueType());
+ bool i32Legal = isOperationLegalOrCustom(ISD::FGETSIGN, MVT::i32);
+ if ((OpVTLegal || i32Legal) && Op.getValueType().isSimple()) {
+ EVT Ty = OpVTLegal ? Op.getValueType() : MVT::i32;
// Make a FGETSIGN + SHL to move the sign bit into the appropriate
// place. We expect the SHL to be eliminated by other optimizations.
- SDValue Sign = TLO.DAG.getNode(ISD::FGETSIGN, Op.getValueType(),
- Op.getOperand(0));
+ SDValue Sign = TLO.DAG.getNode(ISD::FGETSIGN, dl, Ty, Op.getOperand(0));
+ unsigned OpVTSizeInBits = Op.getValueType().getSizeInBits();
+ if (!OpVTLegal && OpVTSizeInBits > 32)
+ Sign = TLO.DAG.getNode(ISD::ZERO_EXTEND, dl, Op.getValueType(), Sign);
unsigned ShVal = Op.getValueType().getSizeInBits()-1;
- SDValue ShAmt = TLO.DAG.getConstant(ShVal, getShiftAmountTy());
- return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SHL, Op.getValueType(),
+ SDValue ShAmt = TLO.DAG.getConstant(ShVal, Op.getValueType());
+ return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SHL, dl,
+ Op.getValueType(),
Sign, ShAmt));
}
}
-#endif
break;
case ISD::ADD:
case ISD::MUL:
@@ -2619,9 +2658,13 @@ const char *TargetLowering::LowerXConstraint(EVT ConstraintVT) const{
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
void TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
- char ConstraintLetter,
+ std::string &Constraint,
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const {
+
+ if (Constraint.length() > 1) return;
+
+ char ConstraintLetter = Constraint[0];
switch (ConstraintLetter) {
default: break;
case 'X': // Allows any operand; labels (basic block) use this.
@@ -2810,6 +2853,12 @@ TargetLowering::AsmOperandInfoVector TargetLowering::ParseConstraints(
report_fatal_error("Indirect operand for inline asm not a pointer!");
OpTy = PtrTy->getElementType();
}
+
+ // Look for vector wrapped in a struct. e.g. { <16 x i8> }.
+ if (const StructType *STy = dyn_cast<StructType>(OpTy))
+ if (STy->getNumElements() == 1)
+ OpTy = STy->getElementType(0);
+
// If OpTy is not a single value, it may be a struct/union that we
// can tile with integers.
if (!OpTy->isSingleValueType() && OpTy->isSized()) {
@@ -3054,7 +3103,7 @@ static void ChooseConstraint(TargetLowering::AsmOperandInfo &OpInfo,
assert(OpInfo.Codes[i].size() == 1 &&
"Unhandled multi-letter 'other' constraint");
std::vector<SDValue> ResultOps;
- TLI.LowerAsmOperandForConstraint(Op, OpInfo.Codes[i][0],
+ TLI.LowerAsmOperandForConstraint(Op, OpInfo.Codes[i],
ResultOps, *DAG);
if (!ResultOps.empty()) {
BestType = CType;
diff --git a/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 35b8e14..221bec5 100644
--- a/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -47,7 +47,6 @@ STATISTIC(numExtends , "Number of copies extended");
STATISTIC(NumReMats , "Number of instructions re-materialized");
STATISTIC(numPeep , "Number of identity moves eliminated after coalescing");
STATISTIC(numAborts , "Number of times interval joining aborted");
-STATISTIC(numDeadValNo, "Number of valno def marked dead");
char SimpleRegisterCoalescing::ID = 0;
static cl::opt<bool>
@@ -61,9 +60,9 @@ DisableCrossClassJoin("disable-cross-class-join",
cl::init(false), cl::Hidden);
static cl::opt<bool>
-DisablePhysicalJoin("disable-physical-join",
- cl::desc("Avoid coalescing physical register copies"),
- cl::init(false), cl::Hidden);
+EnablePhysicalJoin("join-physregs",
+ cl::desc("Join physical register copies"),
+ cl::init(false), cl::Hidden);
static cl::opt<bool>
VerifyCoalescing("verify-coalescing",
@@ -253,7 +252,12 @@ bool SimpleRegisterCoalescing::AdjustCopiesBackFrom(const CoalescerPair &CP,
// Okay, merge "B1" into the same value number as "B0".
if (BValNo != ValLR->valno) {
+ // If B1 is killed by a PHI, then the merged live range must also be killed
+ // by the same PHI, as B0 and B1 can not overlap.
+ bool HasPHIKill = BValNo->hasPHIKill();
IntB.MergeValueNumberInto(BValNo, ValLR->valno);
+ if (HasPHIKill)
+ ValLR->valno->setHasPHIKill(true);
}
DEBUG({
dbgs() << " result = ";
@@ -272,7 +276,7 @@ bool SimpleRegisterCoalescing::AdjustCopiesBackFrom(const CoalescerPair &CP,
// merge, find the last use and trim the live range. That will also add the
// isKill marker.
if (ALR->end == CopyIdx)
- TrimLiveIntervalToLastUse(CopyUseIdx, CopyMI->getParent(), IntA, ALR);
+ li_->shrinkToUses(&IntA);
++numExtends;
return true;
@@ -426,6 +430,10 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
MachineInstr *NewMI = tii_->commuteInstruction(DefMI);
if (!NewMI)
return false;
+ if (TargetRegisterInfo::isVirtualRegister(IntA.reg) &&
+ TargetRegisterInfo::isVirtualRegister(IntB.reg) &&
+ !mri_->constrainRegClass(IntB.reg, mri_->getRegClass(IntA.reg)))
+ return false;
if (NewMI != DefMI) {
li_->ReplaceMachineInstrInMaps(DefMI, NewMI);
MBB->insert(DefMI, NewMI);
@@ -503,98 +511,6 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
return true;
}
-/// isSameOrFallThroughBB - Return true if MBB == SuccMBB or MBB simply
-/// fallthoughs to SuccMBB.
-static bool isSameOrFallThroughBB(MachineBasicBlock *MBB,
- MachineBasicBlock *SuccMBB,
- const TargetInstrInfo *tii_) {
- if (MBB == SuccMBB)
- return true;
- MachineBasicBlock *TBB = 0, *FBB = 0;
- SmallVector<MachineOperand, 4> Cond;
- return !tii_->AnalyzeBranch(*MBB, TBB, FBB, Cond) && !TBB && !FBB &&
- MBB->isSuccessor(SuccMBB);
-}
-
-/// removeRange - Wrapper for LiveInterval::removeRange. This removes a range
-/// from a physical register live interval as well as from the live intervals
-/// of its sub-registers.
-static void removeRange(LiveInterval &li,
- SlotIndex Start, SlotIndex End,
- LiveIntervals *li_, const TargetRegisterInfo *tri_) {
- li.removeRange(Start, End, true);
- if (TargetRegisterInfo::isPhysicalRegister(li.reg)) {
- for (const unsigned* SR = tri_->getSubRegisters(li.reg); *SR; ++SR) {
- if (!li_->hasInterval(*SR))
- continue;
- LiveInterval &sli = li_->getInterval(*SR);
- SlotIndex RemoveStart = Start;
- SlotIndex RemoveEnd = Start;
-
- while (RemoveEnd != End) {
- LiveInterval::iterator LR = sli.FindLiveRangeContaining(RemoveStart);
- if (LR == sli.end())
- break;
- RemoveEnd = (LR->end < End) ? LR->end : End;
- sli.removeRange(RemoveStart, RemoveEnd, true);
- RemoveStart = RemoveEnd;
- }
- }
- }
-}
-
-/// TrimLiveIntervalToLastUse - If there is a last use in the same basic block
-/// as the copy instruction, trim the live interval to the last use and return
-/// true.
-bool
-SimpleRegisterCoalescing::TrimLiveIntervalToLastUse(SlotIndex CopyIdx,
- MachineBasicBlock *CopyMBB,
- LiveInterval &li,
- const LiveRange *LR) {
- SlotIndex MBBStart = li_->getMBBStartIdx(CopyMBB);
- SlotIndex LastUseIdx;
- MachineOperand *LastUse =
- lastRegisterUse(LR->start, CopyIdx.getPrevSlot(), li.reg, LastUseIdx);
- if (LastUse) {
- MachineInstr *LastUseMI = LastUse->getParent();
- if (!isSameOrFallThroughBB(LastUseMI->getParent(), CopyMBB, tii_)) {
- // r1024 = op
- // ...
- // BB1:
- // = r1024
- //
- // BB2:
- // r1025<dead> = r1024<kill>
- if (MBBStart < LR->end)
- removeRange(li, MBBStart, LR->end, li_, tri_);
- return true;
- }
-
- // There are uses before the copy, just shorten the live range to the end
- // of last use.
- LastUse->setIsKill();
- removeRange(li, LastUseIdx.getDefIndex(), LR->end, li_, tri_);
- if (LastUseMI->isCopy()) {
- MachineOperand &DefMO = LastUseMI->getOperand(0);
- if (DefMO.getReg() == li.reg && !DefMO.getSubReg())
- DefMO.setIsDead();
- }
- return true;
- }
-
- // Is it livein?
- if (LR->start <= MBBStart && LR->end > MBBStart) {
- if (LR->start == li_->getZeroIndex()) {
- assert(TargetRegisterInfo::isPhysicalRegister(li.reg));
- // Live-in to the function but dead. Remove it from entry live-in set.
- mf_->begin()->removeLiveIn(li.reg);
- }
- // FIXME: Shorten intervals in BBs that reaches this BB.
- }
-
- return false;
-}
-
/// ReMaterializeTrivialDef - If the source of a copy is defined by a trivial
/// computation, replace the copy by rematerialize the definition.
bool SimpleRegisterCoalescing::ReMaterializeTrivialDef(LiveInterval &SrcInt,
@@ -781,26 +697,6 @@ static bool removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_,
return false;
}
-/// ShortenDeadCopyLiveRange - Shorten a live range defined by a dead copy.
-/// Return true if live interval is removed.
-bool SimpleRegisterCoalescing::ShortenDeadCopyLiveRange(LiveInterval &li,
- MachineInstr *CopyMI) {
- SlotIndex CopyIdx = li_->getInstructionIndex(CopyMI);
- LiveInterval::iterator MLR =
- li.FindLiveRangeContaining(CopyIdx.getDefIndex());
- if (MLR == li.end())
- return false; // Already removed by ShortenDeadCopySrcLiveRange.
- SlotIndex RemoveStart = MLR->start;
- SlotIndex RemoveEnd = MLR->end;
- SlotIndex DefIdx = CopyIdx.getDefIndex();
- // Remove the liverange that's defined by this.
- if (RemoveStart == DefIdx && RemoveEnd == DefIdx.getStoreIndex()) {
- removeRange(li, RemoveStart, RemoveEnd, li_, tri_);
- return removeIntervalIfEmpty(li, li_, tri_);
- }
- return false;
-}
-
/// RemoveDeadDef - If a def of a live interval is now determined dead, remove
/// the val# it defines. If the live interval becomes empty, remove it as well.
bool SimpleRegisterCoalescing::RemoveDeadDef(LiveInterval &li,
@@ -834,84 +730,6 @@ void SimpleRegisterCoalescing::RemoveCopyFlag(unsigned DstReg,
}
}
-/// PropagateDeadness - Propagate the dead marker to the instruction which
-/// defines the val#.
-static void PropagateDeadness(LiveInterval &li, MachineInstr *CopyMI,
- SlotIndex &LRStart, LiveIntervals *li_,
- const TargetRegisterInfo* tri_) {
- MachineInstr *DefMI =
- li_->getInstructionFromIndex(LRStart.getDefIndex());
- if (DefMI && DefMI != CopyMI) {
- int DeadIdx = DefMI->findRegisterDefOperandIdx(li.reg);
- if (DeadIdx != -1)
- DefMI->getOperand(DeadIdx).setIsDead();
- else
- DefMI->addOperand(MachineOperand::CreateReg(li.reg,
- /*def*/true, /*implicit*/true, /*kill*/false, /*dead*/true));
- LRStart = LRStart.getNextSlot();
- }
-}
-
-/// ShortenDeadCopySrcLiveRange - Shorten a live range as it's artificially
-/// extended by a dead copy. Mark the last use (if any) of the val# as kill as
-/// ends the live range there. If there isn't another use, then this live range
-/// is dead. Return true if live interval is removed.
-bool
-SimpleRegisterCoalescing::ShortenDeadCopySrcLiveRange(LiveInterval &li,
- MachineInstr *CopyMI) {
- SlotIndex CopyIdx = li_->getInstructionIndex(CopyMI);
- if (CopyIdx == SlotIndex()) {
- // FIXME: special case: function live in. It can be a general case if the
- // first instruction index starts at > 0 value.
- assert(TargetRegisterInfo::isPhysicalRegister(li.reg));
- // Live-in to the function but dead. Remove it from entry live-in set.
- if (mf_->begin()->isLiveIn(li.reg))
- mf_->begin()->removeLiveIn(li.reg);
- if (const LiveRange *LR = li.getLiveRangeContaining(CopyIdx))
- removeRange(li, LR->start, LR->end, li_, tri_);
- return removeIntervalIfEmpty(li, li_, tri_);
- }
-
- LiveInterval::iterator LR =
- li.FindLiveRangeContaining(CopyIdx.getPrevIndex().getStoreIndex());
- if (LR == li.end())
- // Livein but defined by a phi.
- return false;
-
- SlotIndex RemoveStart = LR->start;
- SlotIndex RemoveEnd = CopyIdx.getStoreIndex();
- if (LR->end > RemoveEnd)
- // More uses past this copy? Nothing to do.
- return false;
-
- // If there is a last use in the same bb, we can't remove the live range.
- // Shorten the live interval and return.
- MachineBasicBlock *CopyMBB = CopyMI->getParent();
- if (TrimLiveIntervalToLastUse(CopyIdx, CopyMBB, li, LR))
- return false;
-
- // There are other kills of the val#. Nothing to do.
- if (!li.isOnlyLROfValNo(LR))
- return false;
-
- MachineBasicBlock *StartMBB = li_->getMBBFromIndex(RemoveStart);
- if (!isSameOrFallThroughBB(StartMBB, CopyMBB, tii_))
- // If the live range starts in another mbb and the copy mbb is not a fall
- // through mbb, then we can only cut the range from the beginning of the
- // copy mbb.
- RemoveStart = li_->getMBBStartIdx(CopyMBB).getNextIndex().getBaseIndex();
-
- if (LR->valno->def == RemoveStart) {
- // If the def MI defines the val# and this copy is the only kill of the
- // val#, then propagate the dead marker.
- PropagateDeadness(li, CopyMI, RemoveStart, li_, tri_);
- ++numDeadValNo;
- }
-
- removeRange(li, RemoveStart, RemoveEnd, li_, tri_);
- return removeIntervalIfEmpty(li, li_, tri_);
-}
-
/// shouldJoinPhys - Return true if a copy involving a physreg should be joined.
/// We need to be careful about coalescing a source physical register with a
/// virtual register. Once the coalescing is done, it cannot be broken and these
@@ -927,7 +745,7 @@ bool SimpleRegisterCoalescing::shouldJoinPhys(CoalescerPair &CP) {
if (!Allocatable && CP.isFlipped() && JoinVInt.containsOneValue())
return true;
- if (DisablePhysicalJoin) {
+ if (!EnablePhysicalJoin) {
DEBUG(dbgs() << "\tPhysreg joins disabled.\n");
return false;
}
@@ -954,7 +772,7 @@ bool SimpleRegisterCoalescing::shouldJoinPhys(CoalescerPair &CP) {
// CodeGen/X86/phys_subreg_coalesce-3.ll needs it.
if (!CP.isPartial()) {
const TargetRegisterClass *RC = mri_->getRegClass(CP.getSrcReg());
- unsigned Threshold = allocatableRCRegs_[RC].count() * 2;
+ unsigned Threshold = RegClassInfo.getNumAllocatableRegs(RC) * 2;
unsigned Length = li_->getApproximateInstructionCount(JoinVInt);
if (Length > Threshold) {
++numAborts;
@@ -973,7 +791,7 @@ SimpleRegisterCoalescing::isWinToJoinCrossClass(unsigned SrcReg,
const TargetRegisterClass *SrcRC,
const TargetRegisterClass *DstRC,
const TargetRegisterClass *NewRC) {
- unsigned NewRCCount = allocatableRCRegs_[NewRC].count();
+ unsigned NewRCCount = RegClassInfo.getNumAllocatableRegs(NewRC);
// This heuristics is good enough in practice, but it's obviously not *right*.
// 4 is a magic number that works well enough for x86, ARM, etc. It filter
// out all but the most restrictive register classes.
@@ -987,8 +805,14 @@ SimpleRegisterCoalescing::isWinToJoinCrossClass(unsigned SrcReg,
LiveInterval &DstInt = li_->getInterval(DstReg);
unsigned SrcSize = li_->getApproximateInstructionCount(SrcInt);
unsigned DstSize = li_->getApproximateInstructionCount(DstInt);
- if (SrcSize <= NewRCCount && DstSize <= NewRCCount)
+
+ // Coalesce aggressively if the intervals are small compared to the number of
+ // registers in the new class. The number 4 is fairly arbitrary, chosen to be
+ // less aggressive than the 8 used for the whole function size.
+ const unsigned ThresSize = 4 * NewRCCount;
+ if (SrcSize <= ThresSize && DstSize <= ThresSize)
return true;
+
// Estimate *register use density*. If it doubles or more, abort.
unsigned SrcUses = std::distance(mri_->use_nodbg_begin(SrcReg),
mri_->use_nodbg_end());
@@ -996,13 +820,13 @@ SimpleRegisterCoalescing::isWinToJoinCrossClass(unsigned SrcReg,
mri_->use_nodbg_end());
unsigned NewUses = SrcUses + DstUses;
unsigned NewSize = SrcSize + DstSize;
- if (SrcRC != NewRC && SrcSize > NewRCCount) {
- unsigned SrcRCCount = allocatableRCRegs_[SrcRC].count();
+ if (SrcRC != NewRC && SrcSize > ThresSize) {
+ unsigned SrcRCCount = RegClassInfo.getNumAllocatableRegs(SrcRC);
if (NewUses*SrcSize*SrcRCCount > 2*SrcUses*NewSize*NewRCCount)
return false;
}
- if (DstRC != NewRC && DstSize > NewRCCount) {
- unsigned DstRCCount = allocatableRCRegs_[DstRC].count();
+ if (DstRC != NewRC && DstSize > ThresSize) {
+ unsigned DstRCCount = RegClassInfo.getNumAllocatableRegs(DstRC);
if (NewUses*DstSize*DstRCCount > 2*DstUses*NewSize*NewRCCount)
return false;
}
@@ -1032,6 +856,7 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
// If they are already joined we continue.
if (CP.getSrcReg() == CP.getDstReg()) {
+ markAsJoined(CopyMI);
DEBUG(dbgs() << "\tCopy already coalesced.\n");
return false; // Not coalescable.
}
@@ -1551,81 +1376,6 @@ void SimpleRegisterCoalescing::joinIntervals() {
}
}
-/// Return true if the two specified registers belong to different register
-/// classes. The registers may be either phys or virt regs.
-bool
-SimpleRegisterCoalescing::differingRegisterClasses(unsigned RegA,
- unsigned RegB) const {
- // Get the register classes for the first reg.
- if (TargetRegisterInfo::isPhysicalRegister(RegA)) {
- assert(TargetRegisterInfo::isVirtualRegister(RegB) &&
- "Shouldn't consider two physregs!");
- return !mri_->getRegClass(RegB)->contains(RegA);
- }
-
- // Compare against the regclass for the second reg.
- const TargetRegisterClass *RegClassA = mri_->getRegClass(RegA);
- if (TargetRegisterInfo::isVirtualRegister(RegB)) {
- const TargetRegisterClass *RegClassB = mri_->getRegClass(RegB);
- return RegClassA != RegClassB;
- }
- return !RegClassA->contains(RegB);
-}
-
-/// lastRegisterUse - Returns the last (non-debug) use of the specific register
-/// between cycles Start and End or NULL if there are no uses.
-MachineOperand *
-SimpleRegisterCoalescing::lastRegisterUse(SlotIndex Start,
- SlotIndex End,
- unsigned Reg,
- SlotIndex &UseIdx) const{
- UseIdx = SlotIndex();
- if (TargetRegisterInfo::isVirtualRegister(Reg)) {
- MachineOperand *LastUse = NULL;
- for (MachineRegisterInfo::use_nodbg_iterator I = mri_->use_nodbg_begin(Reg),
- E = mri_->use_nodbg_end(); I != E; ++I) {
- MachineOperand &Use = I.getOperand();
- MachineInstr *UseMI = Use.getParent();
- if (UseMI->isIdentityCopy())
- continue;
- SlotIndex Idx = li_->getInstructionIndex(UseMI);
- if (Idx >= Start && Idx < End && (!UseIdx.isValid() || Idx >= UseIdx)) {
- LastUse = &Use;
- UseIdx = Idx.getUseIndex();
- }
- }
- return LastUse;
- }
-
- SlotIndex s = Start;
- SlotIndex e = End.getPrevSlot().getBaseIndex();
- while (e >= s) {
- // Skip deleted instructions
- MachineInstr *MI = li_->getInstructionFromIndex(e);
- while (e != SlotIndex() && e.getPrevIndex() >= s && !MI) {
- e = e.getPrevIndex();
- MI = li_->getInstructionFromIndex(e);
- }
- if (e < s || MI == NULL)
- return NULL;
-
- // Ignore identity copies.
- if (!MI->isIdentityCopy())
- for (unsigned i = 0, NumOps = MI->getNumOperands(); i != NumOps; ++i) {
- MachineOperand &Use = MI->getOperand(i);
- if (Use.isReg() && Use.isUse() && Use.getReg() &&
- tri_->regsOverlap(Use.getReg(), Reg)) {
- UseIdx = e.getUseIndex();
- return &Use;
- }
- }
-
- e = e.getPrevIndex();
- }
-
- return NULL;
-}
-
void SimpleRegisterCoalescing::releaseMemory() {
JoinedCopies.clear();
ReMatCopies.clear();
@@ -1650,10 +1400,7 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
if (VerifyCoalescing)
mf_->verify(this, "Before register coalescing");
- for (TargetRegisterInfo::regclass_iterator I = tri_->regclass_begin(),
- E = tri_->regclass_end(); I != E; ++I)
- allocatableRCRegs_.insert(std::make_pair(*I,
- tri_->getAllocatableSet(fn, *I)));
+ RegClassInfo.runOnMachineFunction(fn);
// Join (coalesce) intervals if requested.
if (EnableJoining) {
@@ -1690,13 +1437,11 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
// or else the scavenger may complain. LowerSubregs will
// delete them later.
DoDelete = false;
-
+
if (MI->allDefsAreDead()) {
- if (li_->hasInterval(SrcReg)) {
- LiveInterval &li = li_->getInterval(SrcReg);
- if (!ShortenDeadCopySrcLiveRange(li, MI))
- ShortenDeadCopyLiveRange(li, MI);
- }
+ if (TargetRegisterInfo::isVirtualRegister(SrcReg) &&
+ li_->hasInterval(SrcReg))
+ li_->shrinkToUses(&li_->getInterval(SrcReg));
DoDelete = true;
}
if (!DoDelete) {
@@ -1748,24 +1493,6 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
DeadDefs.clear();
}
- // If the move will be an identity move delete it
- if (MI->isIdentityCopy()) {
- unsigned SrcReg = MI->getOperand(1).getReg();
- if (li_->hasInterval(SrcReg)) {
- LiveInterval &RegInt = li_->getInterval(SrcReg);
- // If def of this move instruction is dead, remove its live range
- // from the destination register's live interval.
- if (MI->allDefsAreDead()) {
- if (!ShortenDeadCopySrcLiveRange(RegInt, MI))
- ShortenDeadCopyLiveRange(RegInt, MI);
- }
- }
- li_->RemoveMachineInstrFromMaps(MI);
- mii = mbbi->erase(mii);
- ++numPeep;
- continue;
- }
-
++mii;
// Check for now unnecessary kill flags.
diff --git a/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h b/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h
index 65cf542..92f6c64 100644
--- a/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h
+++ b/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h
@@ -17,7 +17,7 @@
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/RegisterCoalescer.h"
-#include "llvm/ADT/BitVector.h"
+#include "RegisterClassInfo.h"
namespace llvm {
class SimpleRegisterCoalescing;
@@ -47,8 +47,7 @@ namespace llvm {
LiveDebugVariables *ldv_;
const MachineLoopInfo* loopInfo;
AliasAnalysis *AA;
-
- DenseMap<const TargetRegisterClass*, BitVector> allocatableRCRegs_;
+ RegisterClassInfo RegClassInfo;
/// JoinedCopies - Keep track of copies eliminated due to coalescing.
///
@@ -103,10 +102,6 @@ namespace llvm {
/// use this information below to update aliases.
bool JoinIntervals(CoalescerPair &CP);
- /// Return true if the two specified registers belong to different register
- /// classes. The registers may be either phys or virt regs.
- bool differingRegisterClasses(unsigned RegA, unsigned RegB) const;
-
/// AdjustCopiesBackFrom - We found a non-trivially-coalescable copy. If
/// the source value number is defined by a copy from the destination reg
/// see if we can merge these two destination reg valno# into a single
@@ -124,13 +119,6 @@ namespace llvm {
/// can transform the copy into a noop by commuting the definition.
bool RemoveCopyByCommutingDef(const CoalescerPair &CP,MachineInstr *CopyMI);
- /// TrimLiveIntervalToLastUse - If there is a last use in the same basic
- /// block as the copy instruction, trim the ive interval to the last use
- /// and return true.
- bool TrimLiveIntervalToLastUse(SlotIndex CopyIdx,
- MachineBasicBlock *CopyMBB,
- LiveInterval &li, const LiveRange *LR);
-
/// ReMaterializeTrivialDef - If the source of a copy is defined by a trivial
/// computation, replace the copy by rematerialize the definition.
/// If PreserveSrcInt is true, make sure SrcInt is valid after the call.
@@ -156,16 +144,6 @@ namespace llvm {
/// subregister.
void UpdateRegDefsUses(const CoalescerPair &CP);
- /// ShortenDeadCopyLiveRange - Shorten a live range defined by a dead copy.
- /// Return true if live interval is removed.
- bool ShortenDeadCopyLiveRange(LiveInterval &li, MachineInstr *CopyMI);
-
- /// ShortenDeadCopyLiveRange - Shorten a live range as it's artificially
- /// extended by a dead copy. Mark the last use (if any) of the val# as kill
- /// as ends the live range there. If there isn't another use, then this
- /// live range is dead. Return true if live interval is removed.
- bool ShortenDeadCopySrcLiveRange(LiveInterval &li, MachineInstr *CopyMI);
-
/// RemoveDeadDef - If a def of a live interval is now determined dead,
/// remove the val# it defines. If the live interval becomes empty, remove
/// it as well.
@@ -175,11 +153,6 @@ namespace llvm {
/// VNInfo copy flag for DstReg and all aliases.
void RemoveCopyFlag(unsigned DstReg, const MachineInstr *CopyMI);
- /// lastRegisterUse - Returns the last use of the specific register between
- /// cycles Start and End or NULL if there are no uses.
- MachineOperand *lastRegisterUse(SlotIndex Start, SlotIndex End,
- unsigned Reg, SlotIndex &LastUseIdx) const;
-
/// markAsJoined - Remember that CopyMI has already been joined.
void markAsJoined(MachineInstr *CopyMI);
};
diff --git a/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp
index 43904a7..92970e4 100644
--- a/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp
@@ -520,7 +520,7 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
// Add a call to dispatch_setup after the setjmp call. This is expanded to any
// target-specific setup that needs to be done.
- CallInst::Create(DispatchSetupFn, "", EntryBB->getTerminator());
+ CallInst::Create(DispatchSetupFn, DispatchVal, "", EntryBB->getTerminator());
// check the return value of the setjmp. non-zero goes to dispatcher.
Value *IsNormal = new ICmpInst(EntryBB->getTerminator(),
diff --git a/contrib/llvm/lib/CodeGen/SplitKit.cpp b/contrib/llvm/lib/CodeGen/SplitKit.cpp
index ac9d72b..bf27cc8 100644
--- a/contrib/llvm/lib/CodeGen/SplitKit.cpp
+++ b/contrib/llvm/lib/CodeGen/SplitKit.cpp
@@ -30,6 +30,9 @@ using namespace llvm;
STATISTIC(NumFinished, "Number of splits finished");
STATISTIC(NumSimple, "Number of splits that were simple");
+STATISTIC(NumCopies, "Number of copies inserted for splitting");
+STATISTIC(NumRemats, "Number of rematerialized defs for splitting");
+STATISTIC(NumRepairs, "Number of invalid live ranges repaired");
//===----------------------------------------------------------------------===//
// Split Analysis
@@ -51,6 +54,7 @@ void SplitAnalysis::clear() {
UseBlocks.clear();
ThroughBlocks.clear();
CurLI = 0;
+ DidRepairRange = false;
}
SlotIndex SplitAnalysis::computeLastSplitPoint(unsigned Num) {
@@ -119,6 +123,8 @@ void SplitAnalysis::analyzeUses() {
if (!calcLiveBlockInfo()) {
// FIXME: calcLiveBlockInfo found inconsistencies in the live range.
// I am looking at you, SimpleRegisterCoalescing!
+ DidRepairRange = true;
+ ++NumRepairs;
DEBUG(dbgs() << "*** Fixing inconsistent live interval! ***\n");
const_cast<LiveIntervals&>(LIS)
.shrinkToUses(const_cast<LiveInterval*>(CurLI));
@@ -139,7 +145,7 @@ void SplitAnalysis::analyzeUses() {
/// where CurLI is live.
bool SplitAnalysis::calcLiveBlockInfo() {
ThroughBlocks.resize(MF.getNumBlockIDs());
- NumThroughBlocks = 0;
+ NumThroughBlocks = NumGapBlocks = 0;
if (CurLI->empty())
return true;
@@ -158,55 +164,63 @@ bool SplitAnalysis::calcLiveBlockInfo() {
SlotIndex Start, Stop;
tie(Start, Stop) = LIS.getSlotIndexes()->getMBBRange(BI.MBB);
- // LVI is the first live segment overlapping MBB.
- BI.LiveIn = LVI->start <= Start;
- if (!BI.LiveIn)
- BI.Def = LVI->start;
-
- // Find the first and last uses in the block.
- bool Uses = UseI != UseE && *UseI < Stop;
- if (Uses) {
+ // If the block contains no uses, the range must be live through. At one
+ // point, SimpleRegisterCoalescing could create dangling ranges that ended
+ // mid-block.
+ if (UseI == UseE || *UseI >= Stop) {
+ ++NumThroughBlocks;
+ ThroughBlocks.set(BI.MBB->getNumber());
+ // The range shouldn't end mid-block if there are no uses. This shouldn't
+ // happen.
+ if (LVI->end < Stop)
+ return false;
+ } else {
+ // This block has uses. Find the first and last uses in the block.
BI.FirstUse = *UseI;
assert(BI.FirstUse >= Start);
do ++UseI;
while (UseI != UseE && *UseI < Stop);
BI.LastUse = UseI[-1];
assert(BI.LastUse < Stop);
- }
- // Look for gaps in the live range.
- bool hasGap = false;
- BI.LiveOut = true;
- while (LVI->end < Stop) {
- SlotIndex LastStop = LVI->end;
- if (++LVI == LVE || LVI->start >= Stop) {
- BI.Kill = LastStop;
- BI.LiveOut = false;
- break;
- }
- if (LastStop < LVI->start) {
- hasGap = true;
- BI.Kill = LastStop;
- BI.Def = LVI->start;
+ // LVI is the first live segment overlapping MBB.
+ BI.LiveIn = LVI->start <= Start;
+
+ // Look for gaps in the live range.
+ BI.LiveOut = true;
+ while (LVI->end < Stop) {
+ SlotIndex LastStop = LVI->end;
+ if (++LVI == LVE || LVI->start >= Stop) {
+ BI.LiveOut = false;
+ BI.LastUse = LastStop;
+ break;
+ }
+ if (LastStop < LVI->start) {
+ // There is a gap in the live range. Create duplicate entries for the
+ // live-in snippet and the live-out snippet.
+ ++NumGapBlocks;
+
+ // Push the Live-in part.
+ BI.LiveThrough = false;
+ BI.LiveOut = false;
+ UseBlocks.push_back(BI);
+ UseBlocks.back().LastUse = LastStop;
+
+ // Set up BI for the live-out part.
+ BI.LiveIn = false;
+ BI.LiveOut = true;
+ BI.FirstUse = LVI->start;
+ }
}
- }
- // Don't set LiveThrough when the block has a gap.
- BI.LiveThrough = !hasGap && BI.LiveIn && BI.LiveOut;
- if (Uses)
+ // Don't set LiveThrough when the block has a gap.
+ BI.LiveThrough = BI.LiveIn && BI.LiveOut;
UseBlocks.push_back(BI);
- else {
- ++NumThroughBlocks;
- ThroughBlocks.set(BI.MBB->getNumber());
- }
- // FIXME: This should never happen. The live range stops or starts without a
- // corresponding use. An earlier pass did something wrong.
- if (!BI.LiveThrough && !Uses)
- return false;
- // LVI is now at LVE or LVI->end >= Stop.
- if (LVI == LVE)
- break;
+ // LVI is now at LVE or LVI->end >= Stop.
+ if (LVI == LVE)
+ break;
+ }
// Live segment ends exactly at Stop. Move to the next segment.
if (LVI->end == Stop && ++LVI == LVE)
@@ -218,6 +232,8 @@ bool SplitAnalysis::calcLiveBlockInfo() {
else
MFI = LIS.getMBBFromIndex(LVI->start);
}
+
+ assert(getNumLiveBlocks() == countLiveBlocks(CurLI) && "Bad block count");
return true;
}
@@ -587,12 +603,14 @@ VNInfo *SplitEditor::defFromParent(unsigned RegIdx,
LiveRangeEdit::Remat RM(ParentVNI);
if (Edit->canRematerializeAt(RM, UseIdx, true, LIS)) {
Def = Edit->rematerializeAt(MBB, I, LI->reg, RM, LIS, TII, TRI, Late);
+ ++NumRemats;
} else {
// Can't remat, just insert a copy from parent.
CopyMI = BuildMI(MBB, I, DebugLoc(), TII.get(TargetOpcode::COPY), LI->reg)
.addReg(Edit->getReg());
Def = LIS.getSlotIndexes()->insertMachineInstrInMaps(CopyMI, Late)
.getDefIndex();
+ ++NumCopies;
}
// Define the value in Reg.
diff --git a/contrib/llvm/lib/CodeGen/SplitKit.h b/contrib/llvm/lib/CodeGen/SplitKit.h
index 2ae760a..7174c0b 100644
--- a/contrib/llvm/lib/CodeGen/SplitKit.h
+++ b/contrib/llvm/lib/CodeGen/SplitKit.h
@@ -63,17 +63,22 @@ public:
/// 1. | o---x | Internal to block. Variable is only live in this block.
/// 2. |---x | Live-in, kill.
/// 3. | o---| Def, live-out.
- /// 4. |---x o---| Live-in, kill, def, live-out.
+ /// 4. |---x o---| Live-in, kill, def, live-out. Counted by NumGapBlocks.
/// 5. |---o---o---| Live-through with uses or defs.
- /// 6. |-----------| Live-through without uses. Transparent.
+ /// 6. |-----------| Live-through without uses. Counted by NumThroughBlocks.
+ ///
+ /// Two BlockInfo entries are created for template 4. One for the live-in
+ /// segment, and one for the live-out segment. These entries look as if the
+ /// block were split in the middle where the live range isn't live.
+ ///
+ /// Live-through blocks without any uses don't get BlockInfo entries. They
+ /// are simply listed in ThroughBlocks instead.
///
struct BlockInfo {
MachineBasicBlock *MBB;
SlotIndex FirstUse; ///< First instr using current reg.
SlotIndex LastUse; ///< Last instr using current reg.
- SlotIndex Kill; ///< Interval end point inside block.
- SlotIndex Def; ///< Interval start point inside block.
- bool LiveThrough; ///< Live in whole block (Templ 5. or 6. above).
+ bool LiveThrough; ///< Live in whole block (Templ 5. above).
bool LiveIn; ///< Current reg is live in.
bool LiveOut; ///< Current reg is live out.
};
@@ -91,12 +96,19 @@ private:
/// UseBlocks - Blocks where CurLI has uses.
SmallVector<BlockInfo, 8> UseBlocks;
+ /// NumGapBlocks - Number of duplicate entries in UseBlocks for blocks where
+ /// the live range has a gap.
+ unsigned NumGapBlocks;
+
/// ThroughBlocks - Block numbers where CurLI is live through without uses.
BitVector ThroughBlocks;
/// NumThroughBlocks - Number of live-through blocks.
unsigned NumThroughBlocks;
+ /// DidRepairRange - analyze was forced to shrinkToUses().
+ bool DidRepairRange;
+
SlotIndex computeLastSplitPoint(unsigned Num);
// Sumarize statistics by counting instructions using CurLI.
@@ -113,6 +125,11 @@ public:
/// split.
void analyze(const LiveInterval *li);
+ /// didRepairRange() - Returns true if CurLI was invalid and has been repaired
+ /// by analyze(). This really shouldn't happen, but sometimes the coalescer
+ /// can create live ranges that end in mid-air.
+ bool didRepairRange() const { return DidRepairRange; }
+
/// clear - clear all data structures so SplitAnalysis is ready to analyze a
/// new interval.
void clear();
@@ -139,7 +156,7 @@ public:
/// getUseBlocks - Return an array of BlockInfo objects for the basic blocks
/// where CurLI has uses.
- ArrayRef<BlockInfo> getUseBlocks() { return UseBlocks; }
+ ArrayRef<BlockInfo> getUseBlocks() const { return UseBlocks; }
/// getNumThroughBlocks - Return the number of through blocks.
unsigned getNumThroughBlocks() const { return NumThroughBlocks; }
@@ -150,9 +167,14 @@ public:
/// getThroughBlocks - Return the set of through blocks.
const BitVector &getThroughBlocks() const { return ThroughBlocks; }
- /// countLiveBlocks - Return the number of blocks where li is live.
- /// This is guaranteed to return the same number as getNumThroughBlocks() +
- /// getUseBlocks().size() after calling analyze(li).
+ /// getNumLiveBlocks - Return the number of blocks where CurLI is live.
+ unsigned getNumLiveBlocks() const {
+ return getUseBlocks().size() - NumGapBlocks + getNumThroughBlocks();
+ }
+
+ /// countLiveBlocks - Return the number of blocks where li is live. This is
+ /// guaranteed to return the same number as getNumLiveBlocks() after calling
+ /// analyze(li).
unsigned countLiveBlocks(const LiveInterval *li) const;
typedef SmallPtrSet<const MachineBasicBlock*, 16> BlockPtrSet;
diff --git a/contrib/llvm/lib/CodeGen/TailDuplication.cpp b/contrib/llvm/lib/CodeGen/TailDuplication.cpp
index 04d3d31..e8eab8f 100644
--- a/contrib/llvm/lib/CodeGen/TailDuplication.cpp
+++ b/contrib/llvm/lib/CodeGen/TailDuplication.cpp
@@ -34,6 +34,7 @@ STATISTIC(NumTails , "Number of tails duplicated");
STATISTIC(NumTailDups , "Number of tail duplicated blocks");
STATISTIC(NumInstrDups , "Additional instructions due to tail duplication");
STATISTIC(NumDeadBlocks, "Number of dead blocks removed");
+STATISTIC(NumAddedPHIs , "Number of phis added");
// Heuristic for tail duplication.
static cl::opt<unsigned>
@@ -80,16 +81,21 @@ namespace {
void ProcessPHI(MachineInstr *MI, MachineBasicBlock *TailBB,
MachineBasicBlock *PredBB,
DenseMap<unsigned, unsigned> &LocalVRMap,
- SmallVector<std::pair<unsigned,unsigned>, 4> &Copies);
+ SmallVector<std::pair<unsigned,unsigned>, 4> &Copies,
+ const DenseSet<unsigned> &UsedByPhi,
+ bool Remove);
void DuplicateInstruction(MachineInstr *MI,
MachineBasicBlock *TailBB,
MachineBasicBlock *PredBB,
MachineFunction &MF,
- DenseMap<unsigned, unsigned> &LocalVRMap);
+ DenseMap<unsigned, unsigned> &LocalVRMap,
+ const DenseSet<unsigned> &UsedByPhi);
void UpdateSuccessorsPHIs(MachineBasicBlock *FromBB, bool isDead,
SmallVector<MachineBasicBlock*, 8> &TDBBs,
SmallSetVector<MachineBasicBlock*, 8> &Succs);
bool TailDuplicateBlocks(MachineFunction &MF);
+ bool shouldTailDuplicate(const MachineFunction &MF,
+ MachineBasicBlock &TailBB);
bool TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
SmallVector<MachineBasicBlock*, 8> &TDBBs,
SmallVector<MachineInstr*, 16> &Copies);
@@ -146,11 +152,11 @@ static void VerifyPHIs(MachineFunction &MF, bool CheckExtra) {
for (unsigned i = 1, e = MI->getNumOperands(); i != e; i += 2) {
MachineBasicBlock *PHIBB = MI->getOperand(i+1).getMBB();
if (CheckExtra && !Preds.count(PHIBB)) {
- // This is not a hard error.
dbgs() << "Warning: malformed PHI in BB#" << MBB->getNumber()
<< ": " << *MI;
dbgs() << " extra input from predecessor BB#"
<< PHIBB->getNumber() << '\n';
+ llvm_unreachable(0);
}
if (PHIBB->getNumber() < 0) {
dbgs() << "Malformed PHI in BB#" << MBB->getNumber() << ": " << *MI;
@@ -183,10 +189,6 @@ bool TailDuplicatePass::TailDuplicateBlocks(MachineFunction &MF) {
if (NumTails == TailDupLimit)
break;
- // Only duplicate blocks that end with unconditional branches.
- if (MBB->canFallThrough())
- continue;
-
// Save the successors list.
SmallSetVector<MachineBasicBlock*, 8> Succs(MBB->succ_begin(),
MBB->succ_end());
@@ -240,7 +242,7 @@ bool TailDuplicatePass::TailDuplicateBlocks(MachineFunction &MF) {
MachineOperand &UseMO = UI.getOperand();
MachineInstr *UseMI = &*UI;
++UI;
- if (UseMI->getParent() == DefBB)
+ if (UseMI->getParent() == DefBB && !UseMI->isPHI())
continue;
SSAUpdate.RewriteUse(UseMO);
}
@@ -271,6 +273,7 @@ bool TailDuplicatePass::TailDuplicateBlocks(MachineFunction &MF) {
MadeChange = true;
}
}
+ NumAddedPHIs += NewPHIs.size();
return MadeChange;
}
@@ -293,6 +296,24 @@ static unsigned getPHISrcRegOpIdx(MachineInstr *MI, MachineBasicBlock *SrcBB) {
return 0;
}
+
+// Remember which registers are used by phis in this block. This is
+// used to determine which registers are liveout while modifying the
+// block (which is why we need to copy the information).
+static void getRegsUsedByPHIs(const MachineBasicBlock &BB,
+ DenseSet<unsigned> *UsedByPhi) {
+ for(MachineBasicBlock::const_iterator I = BB.begin(), E = BB.end();
+ I != E; ++I) {
+ const MachineInstr &MI = *I;
+ if (!MI.isPHI())
+ break;
+ for (unsigned i = 1, e = MI.getNumOperands(); i != e; i += 2) {
+ unsigned SrcReg = MI.getOperand(i).getReg();
+ UsedByPhi->insert(SrcReg);
+ }
+ }
+}
+
/// AddSSAUpdateEntry - Add a definition and source virtual registers pair for
/// SSA update.
void TailDuplicatePass::AddSSAUpdateEntry(unsigned OrigReg, unsigned NewReg,
@@ -315,7 +336,9 @@ void TailDuplicatePass::ProcessPHI(MachineInstr *MI,
MachineBasicBlock *TailBB,
MachineBasicBlock *PredBB,
DenseMap<unsigned, unsigned> &LocalVRMap,
- SmallVector<std::pair<unsigned,unsigned>, 4> &Copies) {
+ SmallVector<std::pair<unsigned,unsigned>, 4> &Copies,
+ const DenseSet<unsigned> &RegsUsedByPhi,
+ bool Remove) {
unsigned DefReg = MI->getOperand(0).getReg();
unsigned SrcOpIdx = getPHISrcRegOpIdx(MI, PredBB);
assert(SrcOpIdx && "Unable to find matching PHI source?");
@@ -327,9 +350,12 @@ void TailDuplicatePass::ProcessPHI(MachineInstr *MI,
// available value liveout of the block.
unsigned NewDef = MRI->createVirtualRegister(RC);
Copies.push_back(std::make_pair(NewDef, SrcReg));
- if (isDefLiveOut(DefReg, TailBB, MRI))
+ if (isDefLiveOut(DefReg, TailBB, MRI) || RegsUsedByPhi.count(DefReg))
AddSSAUpdateEntry(DefReg, NewDef, PredBB);
+ if (!Remove)
+ return;
+
// Remove PredBB from the PHI node.
MI->RemoveOperand(SrcOpIdx+1);
MI->RemoveOperand(SrcOpIdx);
@@ -343,7 +369,8 @@ void TailDuplicatePass::DuplicateInstruction(MachineInstr *MI,
MachineBasicBlock *TailBB,
MachineBasicBlock *PredBB,
MachineFunction &MF,
- DenseMap<unsigned, unsigned> &LocalVRMap) {
+ DenseMap<unsigned, unsigned> &LocalVRMap,
+ const DenseSet<unsigned> &UsedByPhi) {
MachineInstr *NewMI = TII->duplicate(MI, MF);
for (unsigned i = 0, e = NewMI->getNumOperands(); i != e; ++i) {
MachineOperand &MO = NewMI->getOperand(i);
@@ -357,7 +384,7 @@ void TailDuplicatePass::DuplicateInstruction(MachineInstr *MI,
unsigned NewReg = MRI->createVirtualRegister(RC);
MO.setReg(NewReg);
LocalVRMap.insert(std::make_pair(Reg, NewReg));
- if (isDefLiveOut(Reg, TailBB, MRI))
+ if (isDefLiveOut(Reg, TailBB, MRI) || UsedByPhi.count(Reg))
AddSSAUpdateEntry(Reg, NewReg, PredBB);
} else {
DenseMap<unsigned, unsigned>::iterator VI = LocalVRMap.find(Reg);
@@ -416,6 +443,13 @@ TailDuplicatePass::UpdateSuccessorsPHIs(MachineBasicBlock *FromBB, bool isDead,
// This register is defined in the tail block.
for (unsigned j = 0, ee = LI->second.size(); j != ee; ++j) {
MachineBasicBlock *SrcBB = LI->second[j].first;
+ // If we didn't duplicate a bb into a particular predecessor, we
+ // might still have added an entry to SSAUpdateVals to correcly
+ // recompute SSA. If that case, avoid adding a dummy extra argument
+ // this PHI.
+ if (!SrcBB->isSuccessor(SuccBB))
+ continue;
+
unsigned SrcReg = LI->second[j].second;
if (Idx != 0) {
II->getOperand(Idx).setReg(SrcReg);
@@ -448,14 +482,15 @@ TailDuplicatePass::UpdateSuccessorsPHIs(MachineBasicBlock *FromBB, bool isDead,
}
}
-/// TailDuplicate - If it is profitable, duplicate TailBB's contents in each
-/// of its predecessors.
+/// shouldTailDuplicate - Determine if it is profitable to duplicate this block.
bool
-TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
- SmallVector<MachineBasicBlock*, 8> &TDBBs,
- SmallVector<MachineInstr*, 16> &Copies) {
- // Set the limit on the number of instructions to duplicate, with a default
- // of one less than the tail-merge threshold. When optimizing for size,
+TailDuplicatePass::shouldTailDuplicate(const MachineFunction &MF,
+ MachineBasicBlock &TailBB) {
+ // Only duplicate blocks that end with unconditional branches.
+ if (TailBB.canFallThrough())
+ return false;
+
+ // Set the limit on the cost to duplicate. When optimizing for size,
// duplicate only one, because one branch instruction can be eliminated to
// compensate for the duplication.
unsigned MaxDuplicateCount;
@@ -466,12 +501,12 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
MaxDuplicateCount = TailDuplicateSize;
if (PreRegAlloc) {
- if (TailBB->empty())
+ if (TailBB.empty())
return false;
- const TargetInstrDesc &TID = TailBB->back().getDesc();
+ const TargetInstrDesc &TID = TailBB.back().getDesc();
// Pre-regalloc tail duplication hurts compile time and doesn't help
- // much except for indirect branches and returns.
- if (!TID.isIndirectBranch() && !TID.isReturn())
+ // much except for indirect branches.
+ if (!TID.isIndirectBranch())
return false;
// If the target has hardware branch prediction that can handle indirect
// branches, duplicating them can often make them predictable when there
@@ -482,15 +517,15 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
}
// Don't try to tail-duplicate single-block loops.
- if (TailBB->isSuccessor(TailBB))
+ if (TailBB.isSuccessor(&TailBB))
return false;
// Check the instructions in the block to determine whether tail-duplication
// is invalid or unlikely to be profitable.
unsigned InstrCount = 0;
bool HasCall = false;
- for (MachineBasicBlock::iterator I = TailBB->begin();
- I != TailBB->end(); ++I) {
+ for (MachineBasicBlock::const_iterator I = TailBB.begin(); I != TailBB.end();
+ ++I) {
// Non-duplicable things shouldn't be tail-duplicated.
if (I->getDesc().isNotDuplicable()) return false;
// Do not duplicate 'return' instructions if this is a pre-regalloc run.
@@ -510,6 +545,18 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
if (InstrCount > 1 && (PreRegAlloc && HasCall))
return false;
+ return true;
+}
+
+/// TailDuplicate - If it is profitable, duplicate TailBB's contents in each
+/// of its predecessors.
+bool
+TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
+ SmallVector<MachineBasicBlock*, 8> &TDBBs,
+ SmallVector<MachineInstr*, 16> &Copies) {
+ if (!shouldTailDuplicate(MF, *TailBB))
+ return false;
+
DEBUG(dbgs() << "\n*** Tail-duplicating BB#" << TailBB->getNumber() << '\n');
// Iterate through all the unique predecessors and tail-duplicate this
@@ -518,13 +565,17 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
bool Changed = false;
SmallSetVector<MachineBasicBlock*, 8> Preds(TailBB->pred_begin(),
TailBB->pred_end());
+ DenseSet<unsigned> UsedByPhi;
+ getRegsUsedByPHIs(*TailBB, &UsedByPhi);
for (SmallSetVector<MachineBasicBlock *, 8>::iterator PI = Preds.begin(),
PE = Preds.end(); PI != PE; ++PI) {
MachineBasicBlock *PredBB = *PI;
assert(TailBB != PredBB &&
"Single-block loop should have been rejected earlier!");
- if (PredBB->succ_size() > 1) continue;
+ // EH edges are ignored by AnalyzeBranch.
+ if (PredBB->succ_size() > 1)
+ continue;
MachineBasicBlock *PredTBB, *PredFBB;
SmallVector<MachineOperand, 4> PredCond;
@@ -532,9 +583,6 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
continue;
if (!PredCond.empty())
continue;
- // EH edges are ignored by AnalyzeBranch.
- if (PredBB->succ_size() != 1)
- continue;
// Don't duplicate into a fall-through predecessor (at least for now).
if (PredBB->isLayoutSuccessor(TailBB) && PredBB->canFallThrough())
continue;
@@ -557,11 +605,11 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
if (MI->isPHI()) {
// Replace the uses of the def of the PHI with the register coming
// from PredBB.
- ProcessPHI(MI, TailBB, PredBB, LocalVRMap, CopyInfos);
+ ProcessPHI(MI, TailBB, PredBB, LocalVRMap, CopyInfos, UsedByPhi, true);
} else {
// Replace def of virtual registers with new registers, and update
// uses with PHI source register or the new registers.
- DuplicateInstruction(MI, TailBB, PredBB, MF, LocalVRMap);
+ DuplicateInstruction(MI, TailBB, PredBB, MF, LocalVRMap, UsedByPhi);
}
}
MachineBasicBlock::iterator Loc = PredBB->getFirstTerminator();
@@ -590,12 +638,11 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
MachineBasicBlock *PrevBB = prior(MachineFunction::iterator(TailBB));
MachineBasicBlock *PriorTBB = 0, *PriorFBB = 0;
SmallVector<MachineOperand, 4> PriorCond;
- bool PriorUnAnalyzable =
- TII->AnalyzeBranch(*PrevBB, PriorTBB, PriorFBB, PriorCond, true);
// This has to check PrevBB->succ_size() because EH edges are ignored by
// AnalyzeBranch.
- if (!PriorUnAnalyzable && PriorCond.empty() && !PriorTBB &&
- TailBB->pred_size() == 1 && PrevBB->succ_size() == 1 &&
+ if (PrevBB->succ_size() == 1 &&
+ !TII->AnalyzeBranch(*PrevBB, PriorTBB, PriorFBB, PriorCond, true) &&
+ PriorCond.empty() && !PriorTBB && TailBB->pred_size() == 1 &&
!TailBB->hasAddressTaken()) {
DEBUG(dbgs() << "\nMerging into block: " << *PrevBB
<< "From MBB: " << *TailBB);
@@ -608,7 +655,7 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
// Replace the uses of the def of the PHI with the register coming
// from PredBB.
MachineInstr *MI = &*I++;
- ProcessPHI(MI, TailBB, PrevBB, LocalVRMap, CopyInfos);
+ ProcessPHI(MI, TailBB, PrevBB, LocalVRMap, CopyInfos, UsedByPhi, true);
if (MI->getParent())
MI->eraseFromParent();
}
@@ -618,7 +665,7 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
// Replace def of virtual registers with new registers, and update
// uses with PHI source register or the new registers.
MachineInstr *MI = &*I++;
- DuplicateInstruction(MI, TailBB, PrevBB, MF, LocalVRMap);
+ DuplicateInstruction(MI, TailBB, PrevBB, MF, LocalVRMap, UsedByPhi);
MI->eraseFromParent();
}
MachineBasicBlock::iterator Loc = PrevBB->getFirstTerminator();
@@ -639,6 +686,57 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
Changed = true;
}
+ // If this is after register allocation, there are no phis to fix.
+ if (!PreRegAlloc)
+ return Changed;
+
+ // If we made no changes so far, we are safe.
+ if (!Changed)
+ return Changed;
+
+
+ // Handle the nasty case in that we duplicated a block that is part of a loop
+ // into some but not all of its predecessors. For example:
+ // 1 -> 2 <-> 3 |
+ // \ |
+ // \---> rest |
+ // if we duplicate 2 into 1 but not into 3, we end up with
+ // 12 -> 3 <-> 2 -> rest |
+ // \ / |
+ // \----->-----/ |
+ // If there was a "var = phi(1, 3)" in 2, it has to be ultimately replaced
+ // with a phi in 3 (which now dominates 2).
+ // What we do here is introduce a copy in 3 of the register defined by the
+ // phi, just like when we are duplicating 2 into 3, but we don't copy any
+ // real instructions or remove the 3 -> 2 edge from the phi in 2.
+ for (SmallSetVector<MachineBasicBlock *, 8>::iterator PI = Preds.begin(),
+ PE = Preds.end(); PI != PE; ++PI) {
+ MachineBasicBlock *PredBB = *PI;
+ if (std::find(TDBBs.begin(), TDBBs.end(), PredBB) != TDBBs.end())
+ continue;
+
+ // EH edges
+ if (PredBB->succ_size() != 1)
+ continue;
+
+ DenseMap<unsigned, unsigned> LocalVRMap;
+ SmallVector<std::pair<unsigned,unsigned>, 4> CopyInfos;
+ MachineBasicBlock::iterator I = TailBB->begin();
+ // Process PHI instructions first.
+ while (I != TailBB->end() && I->isPHI()) {
+ // Replace the uses of the def of the PHI with the register coming
+ // from PredBB.
+ MachineInstr *MI = &*I++;
+ ProcessPHI(MI, TailBB, PredBB, LocalVRMap, CopyInfos, UsedByPhi, false);
+ }
+ MachineBasicBlock::iterator Loc = PredBB->getFirstTerminator();
+ for (unsigned i = 0, e = CopyInfos.size(); i != e; ++i) {
+ Copies.push_back(BuildMI(*PredBB, Loc, DebugLoc(),
+ TII->get(TargetOpcode::COPY),
+ CopyInfos[i].first).addReg(CopyInfos[i].second));
+ }
+ }
+
return Changed;
}
@@ -655,4 +753,3 @@ void TailDuplicatePass::RemoveDeadBlock(MachineBasicBlock *MBB) {
// Remove the block.
MBB->eraseFromParent();
}
-
diff --git a/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp b/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp
index b9fcd38..34e2b33 100644
--- a/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp
+++ b/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp
@@ -212,8 +212,7 @@ static const TargetRegisterClass *canFoldCopy(const MachineInstr *MI,
if (TargetRegisterInfo::isPhysicalRegister(LiveOp.getReg()))
return RC->contains(LiveOp.getReg()) ? RC : 0;
- const TargetRegisterClass *LiveRC = MRI.getRegClass(LiveReg);
- if (RC == LiveRC || RC->hasSubClass(LiveRC))
+ if (RC->hasSubClassEq(MRI.getRegClass(LiveReg)))
return RC;
// FIXME: Allow folding when register classes are memory compatible.
diff --git a/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 6ed91b0..cdac42d 100644
--- a/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -225,10 +225,11 @@ void TargetLoweringObjectFileELF::emitPersonalityValue(MCStreamer &Streamer,
static SectionKind
getELFKindForNamedSection(StringRef Name, SectionKind K) {
- // FIXME: Why is this here? Codegen is should not be in the business
- // of figuring section flags. If the user wrote section(".eh_frame"),
- // we should just pass that to MC which will defer to the assembly
- // or use its default if producing an object file.
+ // N.B.: The defaults used in here are no the same ones used in MC.
+ // We follow gcc, MC follows gas. For example, given ".section .eh_frame",
+ // both gas and MC will produce a section with no flags. Given
+ // section(".eh_frame") gcc will produce
+ // .section .eh_frame,"a",@progbits
if (Name.empty() || Name[0] != '.') return K;
// Some lame default implementation based on some magic section names.
@@ -254,9 +255,6 @@ getELFKindForNamedSection(StringRef Name, SectionKind K) {
Name.startswith(".llvm.linkonce.tb."))
return SectionKind::getThreadBSS();
- if (Name == ".eh_frame")
- return SectionKind::getDataRel();
-
return K;
}
@@ -484,11 +482,6 @@ getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
- // _foo.eh symbols are currently always exported so that the linker knows
- // about them. This is not necessary on 10.6 and later, but it
- // doesn't hurt anything.
- // FIXME: I need to get this from Triple.
- IsFunctionEHSymbolGlobal = true;
IsFunctionEHFrameSymbolPrivate = false;
SupportsWeakOmittedEHFrame = false;
@@ -994,6 +987,20 @@ void TargetLoweringObjectFileCOFF::Initialize(MCContext &Ctx,
getContext().getCOFFSection(".drectve",
COFF::IMAGE_SCN_LNK_INFO,
SectionKind::getMetadata());
+
+ PDataSection =
+ getContext().getCOFFSection(".pdata",
+ COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ |
+ COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getDataRel());
+
+ XDataSection =
+ getContext().getCOFFSection(".xdata",
+ COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ |
+ COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getDataRel());
}
const MCSection *TargetLoweringObjectFileCOFF::getEHFrameSection() const {
@@ -1004,6 +1011,28 @@ const MCSection *TargetLoweringObjectFileCOFF::getEHFrameSection() const {
SectionKind::getDataRel());
}
+const MCSection *TargetLoweringObjectFileCOFF::getWin64EHFuncTableSection(
+ StringRef suffix) const {
+ if (suffix == "")
+ return PDataSection;
+ return getContext().getCOFFSection((".pdata"+suffix).str(),
+ COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ |
+ COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getDataRel());
+}
+
+const MCSection *TargetLoweringObjectFileCOFF::getWin64EHTableSection(
+ StringRef suffix) const {
+ if (suffix == "")
+ return XDataSection;
+ return getContext().getCOFFSection((".xdata"+suffix).str(),
+ COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+ COFF::IMAGE_SCN_MEM_READ |
+ COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getDataRel());
+}
+
static unsigned
getCOFFSectionFlags(SectionKind K) {
diff --git a/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 52ea872..f54d879 100644
--- a/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1125,6 +1125,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
break; // The tied operands have been eliminated.
}
+ bool IsEarlyClobber = false;
bool RemovedKillFlag = false;
bool AllUsesCopied = true;
unsigned LastCopiedReg = 0;
@@ -1132,7 +1133,11 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
for (unsigned tpi = 0, tpe = TiedPairs.size(); tpi != tpe; ++tpi) {
unsigned SrcIdx = TiedPairs[tpi].first;
unsigned DstIdx = TiedPairs[tpi].second;
- unsigned regA = mi->getOperand(DstIdx).getReg();
+
+ const MachineOperand &DstMO = mi->getOperand(DstIdx);
+ unsigned regA = DstMO.getReg();
+ IsEarlyClobber |= DstMO.isEarlyClobber();
+
// Grab regB from the instruction because it may have changed if the
// instruction was commuted.
regB = mi->getOperand(SrcIdx).getReg();
@@ -1196,15 +1201,17 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
}
if (AllUsesCopied) {
- // Replace other (un-tied) uses of regB with LastCopiedReg.
- for (unsigned i = 0, e = mi->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = mi->getOperand(i);
- if (MO.isReg() && MO.getReg() == regB && MO.isUse()) {
- if (MO.isKill()) {
- MO.setIsKill(false);
- RemovedKillFlag = true;
+ if (!IsEarlyClobber) {
+ // Replace other (un-tied) uses of regB with LastCopiedReg.
+ for (unsigned i = 0, e = mi->getNumOperands(); i != e; ++i) {
+ MachineOperand &MO = mi->getOperand(i);
+ if (MO.isReg() && MO.getReg() == regB && MO.isUse()) {
+ if (MO.isKill()) {
+ MO.setIsKill(false);
+ RemovedKillFlag = true;
+ }
+ MO.setReg(LastCopiedReg);
}
- MO.setReg(LastCopiedReg);
}
}
diff --git a/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp b/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp
index 48d8ab1..52693f0 100644
--- a/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp
@@ -196,8 +196,11 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) {
temp->eraseFromParent();
ModifiedPHI = true;
- if (Input != Output)
- F.getRegInfo().replaceRegWith(Output, Input);
+ if (Input != Output) {
+ MachineRegisterInfo &MRI = F.getRegInfo();
+ MRI.constrainRegClass(Input, MRI.getRegClass(Output));
+ MRI.replaceRegWith(Output, Input);
+ }
continue;
}
diff --git a/contrib/llvm/lib/CodeGen/VirtRegMap.cpp b/contrib/llvm/lib/CodeGen/VirtRegMap.cpp
index 226b78f..7557979 100644
--- a/contrib/llvm/lib/CodeGen/VirtRegMap.cpp
+++ b/contrib/llvm/lib/CodeGen/VirtRegMap.cpp
@@ -42,6 +42,7 @@
using namespace llvm;
STATISTIC(NumSpills , "Number of register spills");
+STATISTIC(NumIdCopies, "Number of identity moves eliminated after rewriting");
//===----------------------------------------------------------------------===//
// VirtRegMap implementation
@@ -318,6 +319,7 @@ void VirtRegMap::rewrite(SlotIndexes *Indexes) {
// Finally, remove any identity copies.
if (MI->isIdentityCopy()) {
+ ++NumIdCopies;
if (MI->getNumOperands() == 2) {
DEBUG(dbgs() << "Deleting identity copy.\n");
RemoveMachineInstrFromMaps(MI);
diff --git a/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 2b1e878..7652090 100644
--- a/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -29,6 +29,7 @@
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/Host.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/Target/TargetMachine.h"
#include <cmath>
#include <cstring>
using namespace llvm;
@@ -42,20 +43,14 @@ ExecutionEngine *(*ExecutionEngine::JITCtor)(
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- CodeModel::Model CMM,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs) = 0;
+ TargetMachine *TM) = 0;
ExecutionEngine *(*ExecutionEngine::MCJITCtor)(
Module *M,
std::string *ErrorStr,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- CodeModel::Model CMM,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs) = 0;
+ TargetMachine *TM) = 0;
ExecutionEngine *(*ExecutionEngine::InterpCtor)(Module *M,
std::string *ErrorStr) = 0;
@@ -419,6 +414,35 @@ ExecutionEngine *ExecutionEngine::create(Module *M,
.create();
}
+/// createJIT - This is the factory method for creating a JIT for the current
+/// machine, it does not fall back to the interpreter. This takes ownership
+/// of the module.
+ExecutionEngine *ExecutionEngine::createJIT(Module *M,
+ std::string *ErrorStr,
+ JITMemoryManager *JMM,
+ CodeGenOpt::Level OptLevel,
+ bool GVsWithCode,
+ CodeModel::Model CMM) {
+ if (ExecutionEngine::JITCtor == 0) {
+ if (ErrorStr)
+ *ErrorStr = "JIT has not been linked in.";
+ return 0;
+ }
+
+ // Use the defaults for extra parameters. Users can use EngineBuilder to
+ // set them.
+ StringRef MArch = "";
+ StringRef MCPU = "";
+ SmallVector<std::string, 1> MAttrs;
+
+ TargetMachine *TM =
+ EngineBuilder::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr);
+ if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0;
+ TM->setCodeModel(CMM);
+
+ return ExecutionEngine::JITCtor(M, ErrorStr, JMM, OptLevel, GVsWithCode, TM);
+}
+
ExecutionEngine *EngineBuilder::create() {
// Make sure we can resolve symbols in the program as well. The zero arg
// to the function tells DynamicLibrary to load the program, not a library.
@@ -441,18 +465,21 @@ ExecutionEngine *EngineBuilder::create() {
// Unless the interpreter was explicitly selected or the JIT is not linked,
// try making a JIT.
if (WhichEngine & EngineKind::JIT) {
- if (UseMCJIT && ExecutionEngine::MCJITCtor) {
- ExecutionEngine *EE =
- ExecutionEngine::MCJITCtor(M, ErrorStr, JMM, OptLevel,
- AllocateGVsWithCode, CMModel,
- MArch, MCPU, MAttrs);
- if (EE) return EE;
- } else if (ExecutionEngine::JITCtor) {
- ExecutionEngine *EE =
- ExecutionEngine::JITCtor(M, ErrorStr, JMM, OptLevel,
- AllocateGVsWithCode, CMModel,
- MArch, MCPU, MAttrs);
- if (EE) return EE;
+ if (TargetMachine *TM =
+ EngineBuilder::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr)) {
+ TM->setCodeModel(CMModel);
+
+ if (UseMCJIT && ExecutionEngine::MCJITCtor) {
+ ExecutionEngine *EE =
+ ExecutionEngine::MCJITCtor(M, ErrorStr, JMM, OptLevel,
+ AllocateGVsWithCode, TM);
+ if (EE) return EE;
+ } else if (ExecutionEngine::JITCtor) {
+ ExecutionEngine *EE =
+ ExecutionEngine::JITCtor(M, ErrorStr, JMM, OptLevel,
+ AllocateGVsWithCode, TM);
+ if (EE) return EE;
+ }
}
}
diff --git a/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp
index d1f87ac..8fceaf2 100644
--- a/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp
@@ -203,39 +203,18 @@ void DarwinRegisterFrame(void* FrameBegin) {
/// createJIT - This is the factory method for creating a JIT for the current
/// machine, it does not fall back to the interpreter. This takes ownership
/// of the module.
-ExecutionEngine *ExecutionEngine::createJIT(Module *M,
- std::string *ErrorStr,
- JITMemoryManager *JMM,
- CodeGenOpt::Level OptLevel,
- bool GVsWithCode,
- CodeModel::Model CMM) {
- // Use the defaults for extra parameters. Users can use EngineBuilder to
- // set them.
- StringRef MArch = "";
- StringRef MCPU = "";
- SmallVector<std::string, 1> MAttrs;
- return JIT::createJIT(M, ErrorStr, JMM, OptLevel, GVsWithCode, CMM,
- MArch, MCPU, MAttrs);
-}
-
ExecutionEngine *JIT::createJIT(Module *M,
std::string *ErrorStr,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- CodeModel::Model CMM,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs) {
+ TargetMachine *TM) {
// Try to register the program as a source of symbols to resolve against.
+ //
+ // FIXME: Don't do this here.
sys::DynamicLibrary::LoadLibraryPermanently(0, NULL);
- // Pick a target either via -march or by guessing the native arch.
- TargetMachine *TM = JIT::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr);
- if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0;
- TM->setCodeModel(CMM);
-
- // If the target supports JIT code generation, create a the JIT.
+ // If the target supports JIT code generation, create the JIT.
if (TargetJITInfo *TJ = TM->getJITInfo()) {
return new JIT(M, *TM, *TJ, JMM, OptLevel, GVsWithCode);
} else {
diff --git a/contrib/llvm/lib/ExecutionEngine/JIT/JIT.h b/contrib/llvm/lib/ExecutionEngine/JIT/JIT.h
index b576c16..b879fc3 100644
--- a/contrib/llvm/lib/ExecutionEngine/JIT/JIT.h
+++ b/contrib/llvm/lib/ExecutionEngine/JIT/JIT.h
@@ -181,23 +181,12 @@ public:
///
JITCodeEmitter *getCodeEmitter() const { return JCE; }
- /// selectTarget - Pick a target either via -march or by guessing the native
- /// arch. Add any CPU features specified via -mcpu or -mattr.
- static TargetMachine *selectTarget(Module *M,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs,
- std::string *Err);
-
static ExecutionEngine *createJIT(Module *M,
std::string *ErrorStr,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- CodeModel::Model CMM,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs);
+ TargetMachine *TM);
// Run the JIT on F and return information about the generated code
void runJITOnFunction(Function *F, MachineCodeInfo *MCI = 0);
diff --git a/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 3d4ee36..4475f4d 100644
--- a/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -38,27 +38,15 @@ ExecutionEngine *MCJIT::createJIT(Module *M,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- CodeModel::Model CMM,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs) {
+ TargetMachine *TM) {
// Try to register the program as a source of symbols to resolve against.
//
// FIXME: Don't do this here.
sys::DynamicLibrary::LoadLibraryPermanently(0, NULL);
- // Pick a target either via -march or by guessing the native arch.
- //
- // FIXME: This should be lifted out of here, it isn't something which should
- // be part of the JIT policy, rather the burden for this selection should be
- // pushed to clients.
- TargetMachine *TM = MCJIT::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr);
- if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0;
- TM->setCodeModel(CMM);
-
// If the target supports JIT code generation, create the JIT.
if (TargetJITInfo *TJ = TM->getJITInfo())
- return new MCJIT(M, TM, *TJ, new MCJITMemoryManager(JMM), OptLevel,
+ return new MCJIT(M, TM, *TJ, new MCJITMemoryManager(JMM, M), OptLevel,
GVsWithCode);
if (ErrorStr)
@@ -114,8 +102,12 @@ void *MCJIT::getPointerToFunction(Function *F) {
return Addr;
}
- Twine Name = TM->getMCAsmInfo()->getGlobalPrefix() + F->getName();
- return (void*)Dyld.getSymbolAddress(Name.str());
+ // FIXME: Should we be using the mangler for this? Probably.
+ StringRef BaseName = F->getName();
+ if (BaseName[0] == '\1')
+ return (void*)Dyld.getSymbolAddress(BaseName.substr(1));
+ return (void*)Dyld.getSymbolAddress((TM->getMCAsmInfo()->getGlobalPrefix()
+ + BaseName).str());
}
void *MCJIT::recompileAndRelinkFunction(Function *F) {
diff --git a/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h b/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h
index 1b50766..b64c21a 100644
--- a/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h
+++ b/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h
@@ -76,22 +76,12 @@ public:
MCJITCtor = createJIT;
}
- // FIXME: This routine is scheduled for termination. Do not use it.
- static TargetMachine *selectTarget(Module *M,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs,
- std::string *Err);
-
static ExecutionEngine *createJIT(Module *M,
std::string *ErrorStr,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel,
bool GVsWithCode,
- CodeModel::Model CMM,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs);
+ TargetMachine *TM);
// @}
};
diff --git a/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h b/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
index e3c6fda..40bc031 100644
--- a/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
+++ b/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
@@ -26,7 +26,7 @@ class MCJITMemoryManager : public RTDyldMemoryManager {
// FIXME: Multiple modules.
Module *M;
public:
- MCJITMemoryManager(JITMemoryManager *jmm) : JMM(jmm) {}
+ MCJITMemoryManager(JITMemoryManager *jmm, Module *m) : JMM(jmm), M(m) {}
// Allocate ActualSize bytes, or more, for the named function. Return
// a pointer to the allocated memory and update Size to reflect how much
@@ -36,6 +36,11 @@ public:
// prefix.
if (Name[0] == '_') ++Name;
Function *F = M->getFunction(Name);
+ // Some ObjC names have a prefixed \01 in the IR. If we failed to find
+ // the symbol and it's of the ObjC conventions (starts with "-"), try
+ // prepending a \01 and see if we can find it that way.
+ if (!F && Name[0] == '-')
+ F = M->getFunction((Twine("\1") + Name).str());
assert(F && "No matching function in JIT IR Module!");
return JMM->startFunctionBody(F, Size);
}
@@ -48,6 +53,11 @@ public:
// prefix.
if (Name[0] == '_') ++Name;
Function *F = M->getFunction(Name);
+ // Some ObjC names have a prefixed \01 in the IR. If we failed to find
+ // the symbol and it's of the ObjC conventions (starts with "-"), try
+ // prepending a \01 and see if we can find it that way.
+ if (!F && Name[0] == '-')
+ F = M->getFunction((Twine("\1") + Name).str());
assert(F && "No matching function in JIT IR Module!");
JMM->endFunctionBody(F, FunctionStart, FunctionEnd);
}
diff --git a/contrib/llvm/lib/ExecutionEngine/MCJIT/TargetSelect.cpp b/contrib/llvm/lib/ExecutionEngine/MCJIT/TargetSelect.cpp
deleted file mode 100644
index 50f6593..0000000
--- a/contrib/llvm/lib/ExecutionEngine/MCJIT/TargetSelect.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//===-- TargetSelect.cpp - Target Chooser Code ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This just asks the TargetRegistry for the appropriate JIT to use, and allows
-// the user to specify a specific one on the commandline with -march=x. Clients
-// should initialize targets prior to calling createJIT.
-//
-//===----------------------------------------------------------------------===//
-
-#include "MCJIT.h"
-#include "llvm/Module.h"
-#include "llvm/ADT/Triple.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/Host.h"
-#include "llvm/Target/SubtargetFeature.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegistry.h"
-using namespace llvm;
-
-/// selectTarget - Pick a target either via -march or by guessing the native
-/// arch. Add any CPU features specified via -mcpu or -mattr.
-TargetMachine *MCJIT::selectTarget(Module *Mod,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs,
- std::string *ErrorStr) {
- Triple TheTriple(Mod->getTargetTriple());
- if (TheTriple.getTriple().empty())
- TheTriple.setTriple(sys::getHostTriple());
-
- // Adjust the triple to match what the user requested.
- const Target *TheTarget = 0;
- if (!MArch.empty()) {
- for (TargetRegistry::iterator it = TargetRegistry::begin(),
- ie = TargetRegistry::end(); it != ie; ++it) {
- if (MArch == it->getName()) {
- TheTarget = &*it;
- break;
- }
- }
-
- if (!TheTarget) {
- *ErrorStr = "No available targets are compatible with this -march, "
- "see -version for the available targets.\n";
- return 0;
- }
-
- // Adjust the triple to match (if known), otherwise stick with the
- // module/host triple.
- Triple::ArchType Type = Triple::getArchTypeForLLVMName(MArch);
- if (Type != Triple::UnknownArch)
- TheTriple.setArch(Type);
- } else {
- std::string Error;
- TheTarget = TargetRegistry::lookupTarget(TheTriple.getTriple(), Error);
- if (TheTarget == 0) {
- if (ErrorStr)
- *ErrorStr = Error;
- return 0;
- }
- }
-
- if (!TheTarget->hasJIT()) {
- errs() << "WARNING: This target JIT is not designed for the host you are"
- << " running. If bad things happen, please choose a different "
- << "-march switch.\n";
- }
-
- // Package up features to be passed to target/subtarget
- std::string FeaturesStr;
- if (!MCPU.empty() || !MAttrs.empty()) {
- SubtargetFeatures Features;
- Features.setCPU(MCPU);
- for (unsigned i = 0; i != MAttrs.size(); ++i)
- Features.AddFeature(MAttrs[i]);
- FeaturesStr = Features.getString();
- }
-
- // Allocate a target...
- TargetMachine *Target =
- TheTarget->createTargetMachine(TheTriple.getTriple(), FeaturesStr);
- assert(Target && "Could not allocate target machine!");
- return Target;
-}
diff --git a/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 065e5e3..eda4cbb 100644
--- a/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -129,18 +129,19 @@ void RuntimeDyldImpl::extractFunction(StringRef Name, uint8_t *StartAddress,
uint8_t *EndAddress) {
// Allocate memory for the function via the memory manager.
uintptr_t Size = EndAddress - StartAddress + 1;
- uint8_t *Mem = MemMgr->startFunctionBody(Name.data(), Size);
+ uintptr_t AllocSize = Size;
+ uint8_t *Mem = MemMgr->startFunctionBody(Name.data(), AllocSize);
assert(Size >= (uint64_t)(EndAddress - StartAddress + 1) &&
"Memory manager failed to allocate enough memory!");
// Copy the function payload into the memory block.
- memcpy(Mem, StartAddress, EndAddress - StartAddress + 1);
+ memcpy(Mem, StartAddress, Size);
MemMgr->endFunctionBody(Name.data(), Mem, Mem + Size);
// Remember where we put it.
Functions[Name] = sys::MemoryBlock(Mem, Size);
// Default the assigned address for this symbol to wherever this
// allocated it.
SymbolTable[Name] = Mem;
- DEBUG(dbgs() << " allocated to " << Mem << "\n");
+ DEBUG(dbgs() << " allocated to [" << Mem << ", " << Mem + Size << "]\n");
}
bool RuntimeDyldImpl::
@@ -268,9 +269,9 @@ loadSegment32(const MachOObject *Obj,
if (!Sect)
return Error("unable to load section: '" + Twine(SectNum) + "'");
- // FIXME: Improve check.
+ // FIXME: For the time being, we're only loading text segments.
if (Sect->Flags != 0x80000400)
- return Error("unsupported section type!");
+ continue;
// Address and names of symbols in the section.
typedef std::pair<uint64_t, StringRef> SymbolEntry;
@@ -295,11 +296,11 @@ loadSegment32(const MachOObject *Obj,
// FIXME: Check the symbol type and flags.
if (STE->Type != 0xF) // external, defined in this section.
- return Error("unexpected symbol type!");
+ continue;
// Flags == 0x8 marks a thumb function for ARM, which is fine as it
// doesn't require any special handling here.
if (STE->Flags != 0x0 && STE->Flags != 0x8)
- return Error("unexpected symbol type!");
+ continue;
// Remember the symbol.
Symbols.push_back(SymbolEntry(STE->Value, Name));
@@ -310,6 +311,10 @@ loadSegment32(const MachOObject *Obj,
// Sort the symbols by address, just in case they didn't come in that way.
array_pod_sort(Symbols.begin(), Symbols.end());
+ // If there weren't any functions (odd, but just in case...)
+ if (!Symbols.size())
+ continue;
+
// Extract the function data.
uint8_t *Base = (uint8_t*)Obj->getData(SegmentLC->FileOffset,
SegmentLC->FileSize).data();
@@ -403,9 +408,9 @@ loadSegment64(const MachOObject *Obj,
if (!Sect)
return Error("unable to load section: '" + Twine(SectNum) + "'");
- // FIXME: Improve check.
+ // FIXME: For the time being, we're only loading text segments.
if (Sect->Flags != 0x80000400)
- return Error("unsupported section type!");
+ continue;
// Address and names of symbols in the section.
typedef std::pair<uint64_t, StringRef> SymbolEntry;
@@ -430,9 +435,9 @@ loadSegment64(const MachOObject *Obj,
// FIXME: Check the symbol type and flags.
if (STE->Type != 0xF) // external, defined in this section.
- return Error("unexpected symbol type!");
+ continue;
if (STE->Flags != 0x0)
- return Error("unexpected symbol type!");
+ continue;
// Remember the symbol.
Symbols.push_back(SymbolEntry(STE->Value, Name));
@@ -443,6 +448,10 @@ loadSegment64(const MachOObject *Obj,
// Sort the symbols by address, just in case they didn't come in that way.
array_pod_sort(Symbols.begin(), Symbols.end());
+ // If there weren't any functions (odd, but just in case...)
+ if (!Symbols.size())
+ continue;
+
// Extract the function data.
uint8_t *Base = (uint8_t*)Obj->getData(Segment64LC->FileOffset,
Segment64LC->FileSize).data();
diff --git a/contrib/llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp b/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp
index 8d92ab0..a8822e5 100644
--- a/contrib/llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp
+++ b/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp
@@ -13,7 +13,7 @@
//
//===----------------------------------------------------------------------===//
-#include "JIT.h"
+#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/Module.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Support/CommandLine.h"
@@ -26,11 +26,11 @@ using namespace llvm;
/// selectTarget - Pick a target either via -march or by guessing the native
/// arch. Add any CPU features specified via -mcpu or -mattr.
-TargetMachine *JIT::selectTarget(Module *Mod,
- StringRef MArch,
- StringRef MCPU,
- const SmallVectorImpl<std::string>& MAttrs,
- std::string *ErrorStr) {
+TargetMachine *EngineBuilder::selectTarget(Module *Mod,
+ StringRef MArch,
+ StringRef MCPU,
+ const SmallVectorImpl<std::string>& MAttrs,
+ std::string *ErrorStr) {
Triple TheTriple(Mod->getTargetTriple());
if (TheTriple.getTriple().empty())
TheTriple.setTriple(sys::getHostTriple());
diff --git a/contrib/llvm/lib/MC/ELFObjectWriter.cpp b/contrib/llvm/lib/MC/ELFObjectWriter.cpp
index 23c6d4c..59e1b8e 100644
--- a/contrib/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/contrib/llvm/lib/MC/ELFObjectWriter.cpp
@@ -25,6 +25,8 @@
#include "llvm/Support/ELF.h"
#include "llvm/Target/TargetAsmBackend.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/ADT/Statistic.h"
#include "../Target/X86/X86FixupKinds.h"
#include "../Target/ARM/ARMFixupKinds.h"
@@ -32,6 +34,9 @@
#include <vector>
using namespace llvm;
+#undef DEBUG_TYPE
+#define DEBUG_TYPE "reloc-info"
+
bool ELFObjectWriter::isFixupKindPCRel(const MCAssembler &Asm, unsigned Kind) {
const MCFixupKindInfo &FKI =
Asm.getBackend().getFixupKindInfo((MCFixupKind) Kind);
@@ -46,6 +51,7 @@ bool ELFObjectWriter::RelocNeedsGOT(MCSymbolRefExpr::VariantKind Variant) {
case MCSymbolRefExpr::VK_GOT:
case MCSymbolRefExpr::VK_PLT:
case MCSymbolRefExpr::VK_GOTPCREL:
+ case MCSymbolRefExpr::VK_GOTOFF:
case MCSymbolRefExpr::VK_TPOFF:
case MCSymbolRefExpr::VK_TLSGD:
case MCSymbolRefExpr::VK_GOTTPOFF:
@@ -181,8 +187,13 @@ uint64_t ELFObjectWriter::SymbolValue(MCSymbolData &Data,
if (!Symbol.isInSection())
return 0;
- if (Data.getFragment())
- return Layout.getSymbolOffset(&Data);
+
+ if (Data.getFragment()) {
+ if (Data.getFlags() & ELF_Other_ThumbFunc)
+ return Layout.getSymbolOffset(&Data)+1;
+ else
+ return Layout.getSymbolOffset(&Data);
+ }
return 0;
}
@@ -319,7 +330,9 @@ void ELFObjectWriter::WriteSymbolTable(MCDataFragment *SymtabF,
const MCSymbol *ELFObjectWriter::SymbolToReloc(const MCAssembler &Asm,
const MCValue &Target,
- const MCFragment &F) const {
+ const MCFragment &F,
+ const MCFixup &Fixup,
+ bool IsPCRel) const {
const MCSymbol &Symbol = Target.getSymA()->getSymbol();
const MCSymbol &ASymbol = Symbol.AliasedSymbol();
const MCSymbol *Renamed = Renames.lookup(&Symbol);
@@ -342,7 +355,7 @@ const MCSymbol *ELFObjectWriter::SymbolToReloc(const MCAssembler &Asm,
const SectionKind secKind = Section.getKind();
if (secKind.isBSS())
- return ExplicitRelSym(Asm, Target, F, true);
+ return ExplicitRelSym(Asm, Target, F, Fixup, IsPCRel);
if (secKind.isThreadLocal()) {
if (Renamed)
@@ -365,13 +378,14 @@ const MCSymbol *ELFObjectWriter::SymbolToReloc(const MCAssembler &Asm,
if (Section.getFlags() & ELF::SHF_MERGE) {
if (Target.getConstant() == 0)
- return NULL;
+ return ExplicitRelSym(Asm, Target, F, Fixup, IsPCRel);
if (Renamed)
return Renamed;
return &Symbol;
}
- return ExplicitRelSym(Asm, Target, F, false);
+ return ExplicitRelSym(Asm, Target, F, Fixup, IsPCRel);
+
}
@@ -390,7 +404,7 @@ void ELFObjectWriter::RecordRelocation(const MCAssembler &Asm,
if (!Target.isAbsolute()) {
const MCSymbol &Symbol = Target.getSymA()->getSymbol();
const MCSymbol &ASymbol = Symbol.AliasedSymbol();
- RelocSymbol = SymbolToReloc(Asm, Target, *Fragment);
+ RelocSymbol = SymbolToReloc(Asm, Target, *Fragment, Fixup, IsPCRel);
if (const MCSymbolRefExpr *RefB = Target.getSymB()) {
const MCSymbol &SymbolB = RefB->getSymbol();
@@ -532,6 +546,7 @@ void ELFObjectWriter::ComputeSymbolTable(MCAssembler &Asm,
RevGroupMapTy RevGroupMap,
unsigned NumRegularSections) {
// FIXME: Is this the correct place to do this?
+ // FIXME: Why is an undefined reference to _GLOBAL_OFFSET_TABLE_ needed?
if (NeedsGOT) {
llvm::StringRef Name = "_GLOBAL_OFFSET_TABLE_";
MCSymbol *Sym = Asm.getContext().GetOrCreateSymbol(Name);
@@ -1261,32 +1276,93 @@ void ARMELFObjectWriter::WriteEFlags() {
// In ARM, _MergedGlobals and other most symbols get emitted directly.
// I.e. not as an offset to a section symbol.
-// This code is a first-cut approximation of what ARM/gcc does.
+// This code is an approximation of what ARM/gcc does.
+
+STATISTIC(PCRelCount, "Total number of PIC Relocations");
+STATISTIC(NonPCRelCount, "Total number of non-PIC relocations");
const MCSymbol *ARMELFObjectWriter::ExplicitRelSym(const MCAssembler &Asm,
const MCValue &Target,
const MCFragment &F,
- bool IsBSS) const {
+ const MCFixup &Fixup,
+ bool IsPCRel) const {
const MCSymbol &Symbol = Target.getSymA()->getSymbol();
bool EmitThisSym = false;
- if (IsBSS) {
- EmitThisSym = StringSwitch<bool>(Symbol.getName())
- .Case("_MergedGlobals", true)
- .Default(false);
+ const MCSectionELF &Section =
+ static_cast<const MCSectionELF&>(Symbol.getSection());
+ bool InNormalSection = true;
+ unsigned RelocType = 0;
+ RelocType = GetRelocTypeInner(Target, Fixup, IsPCRel);
+
+ DEBUG(
+ const MCSymbolRefExpr::VariantKind Kind = Target.getSymA()->getKind();
+ MCSymbolRefExpr::VariantKind Kind2;
+ Kind2 = Target.getSymB() ? Target.getSymB()->getKind() :
+ MCSymbolRefExpr::VK_None;
+ dbgs() << "considering symbol "
+ << Section.getSectionName() << "/"
+ << Symbol.getName() << "/"
+ << " Rel:" << (unsigned)RelocType
+ << " Kind: " << (int)Kind << "/" << (int)Kind2
+ << " Tmp:"
+ << Symbol.isAbsolute() << "/" << Symbol.isDefined() << "/"
+ << Symbol.isVariable() << "/" << Symbol.isTemporary()
+ << " Counts:" << PCRelCount << "/" << NonPCRelCount << "\n");
+
+ if (IsPCRel) { ++PCRelCount;
+ switch (RelocType) {
+ default:
+ // Most relocation types are emitted as explicit symbols
+ InNormalSection =
+ StringSwitch<bool>(Section.getSectionName())
+ .Case(".data.rel.ro.local", false)
+ .Case(".data.rel", false)
+ .Case(".bss", false)
+ .Default(true);
+ EmitThisSym = true;
+ break;
+ case ELF::R_ARM_ABS32:
+ // But things get strange with R_ARM_ABS32
+ // In this case, most things that go in .rodata show up
+ // as section relative relocations
+ InNormalSection =
+ StringSwitch<bool>(Section.getSectionName())
+ .Case(".data.rel.ro.local", false)
+ .Case(".data.rel", false)
+ .Case(".rodata", false)
+ .Case(".bss", false)
+ .Default(true);
+ EmitThisSym = false;
+ break;
+ }
} else {
- EmitThisSym = StringSwitch<bool>(Symbol.getName())
- .Case("_MergedGlobals", true)
- .StartsWith(".L.str", true)
- .Default(false);
+ NonPCRelCount++;
+ InNormalSection =
+ StringSwitch<bool>(Section.getSectionName())
+ .Case(".data.rel.ro.local", false)
+ .Case(".rodata", false)
+ .Case(".data.rel", false)
+ .Case(".bss", false)
+ .Default(true);
+
+ switch (RelocType) {
+ default: EmitThisSym = true; break;
+ case ELF::R_ARM_ABS32: EmitThisSym = false; break;
+ }
}
+
if (EmitThisSym)
return &Symbol;
- if (! Symbol.isTemporary())
+ if (! Symbol.isTemporary() && InNormalSection) {
return &Symbol;
+ }
return NULL;
}
+// Need to examine the Fixup when determining whether to
+// emit the relocation as an explicit symbol or as a section relative
+// offset
unsigned ARMELFObjectWriter::GetRelocType(const MCValue &Target,
const MCFixup &Fixup,
bool IsPCRel,
@@ -1295,6 +1371,20 @@ unsigned ARMELFObjectWriter::GetRelocType(const MCValue &Target,
MCSymbolRefExpr::VariantKind Modifier = Target.isAbsolute() ?
MCSymbolRefExpr::VK_None : Target.getSymA()->getKind();
+ unsigned Type = GetRelocTypeInner(Target, Fixup, IsPCRel);
+
+ if (RelocNeedsGOT(Modifier))
+ NeedsGOT = true;
+
+ return Type;
+}
+
+unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
+ const MCFixup &Fixup,
+ bool IsPCRel) const {
+ MCSymbolRefExpr::VariantKind Modifier = Target.isAbsolute() ?
+ MCSymbolRefExpr::VK_None : Target.getSymA()->getKind();
+
unsigned Type = 0;
if (IsPCRel) {
switch ((unsigned)Fixup.getKind()) {
@@ -1303,7 +1393,7 @@ unsigned ARMELFObjectWriter::GetRelocType(const MCValue &Target,
switch (Modifier) {
default: llvm_unreachable("Unsupported Modifier");
case MCSymbolRefExpr::VK_None:
- Type = ELF::R_ARM_BASE_PREL;
+ Type = ELF::R_ARM_REL32;
break;
case MCSymbolRefExpr::VK_ARM_TLSGD:
assert(0 && "unimplemented");
@@ -1342,6 +1432,17 @@ unsigned ARMELFObjectWriter::GetRelocType(const MCValue &Target,
case ARM::fixup_t2_movw_lo16_pcrel:
Type = ELF::R_ARM_THM_MOVW_PREL_NC;
break;
+ case ARM::fixup_arm_thumb_bl:
+ case ARM::fixup_arm_thumb_blx:
+ switch (Modifier) {
+ case MCSymbolRefExpr::VK_ARM_PLT:
+ Type = ELF::R_ARM_THM_CALL;
+ break;
+ default:
+ Type = ELF::R_ARM_NONE;
+ break;
+ }
+ break;
}
} else {
switch ((unsigned)Fixup.getKind()) {
@@ -1399,9 +1500,6 @@ unsigned ARMELFObjectWriter::GetRelocType(const MCValue &Target,
}
}
- if (RelocNeedsGOT(Modifier))
- NeedsGOT = true;
-
return Type;
}
@@ -1613,6 +1711,9 @@ unsigned X86ELFObjectWriter::GetRelocType(const MCValue &Target,
case MCSymbolRefExpr::VK_DTPOFF:
Type = ELF::R_386_TLS_LDO_32;
break;
+ case MCSymbolRefExpr::VK_GOTTPOFF:
+ Type = ELF::R_386_TLS_IE_32;
+ break;
}
break;
case FK_Data_2: Type = ELF::R_386_16; break;
diff --git a/contrib/llvm/lib/MC/ELFObjectWriter.h b/contrib/llvm/lib/MC/ELFObjectWriter.h
index f1d514a..7593099 100644
--- a/contrib/llvm/lib/MC/ELFObjectWriter.h
+++ b/contrib/llvm/lib/MC/ELFObjectWriter.h
@@ -140,15 +140,18 @@ class ELFObjectWriter : public MCObjectWriter {
unsigned ShstrtabIndex;
- const MCSymbol *SymbolToReloc(const MCAssembler &Asm,
- const MCValue &Target,
- const MCFragment &F) const;
+ virtual const MCSymbol *SymbolToReloc(const MCAssembler &Asm,
+ const MCValue &Target,
+ const MCFragment &F,
+ const MCFixup &Fixup,
+ bool IsPCRel) const;
// For arch-specific emission of explicit reloc symbol
virtual const MCSymbol *ExplicitRelSym(const MCAssembler &Asm,
const MCValue &Target,
const MCFragment &F,
- bool IsBSS) const {
+ const MCFixup &Fixup,
+ bool IsPCRel) const {
return NULL;
}
@@ -380,11 +383,16 @@ class ELFObjectWriter : public MCObjectWriter {
virtual const MCSymbol *ExplicitRelSym(const MCAssembler &Asm,
const MCValue &Target,
const MCFragment &F,
- bool IsBSS) const;
+ const MCFixup &Fixup,
+ bool IsPCRel) const;
virtual unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
bool IsPCRel, bool IsRelocWithSymbol,
int64_t Addend);
+ private:
+ unsigned GetRelocTypeInner(const MCValue &Target,
+ const MCFixup &Fixup, bool IsPCRel) const;
+
};
//===- MBlazeELFObjectWriter -------------------------------------------===//
diff --git a/contrib/llvm/lib/MC/MCAsmInfo.cpp b/contrib/llvm/lib/MC/MCAsmInfo.cpp
index 541dd08..73b259e 100644
--- a/contrib/llvm/lib/MC/MCAsmInfo.cpp
+++ b/contrib/llvm/lib/MC/MCAsmInfo.cpp
@@ -74,9 +74,8 @@ MCAsmInfo::MCAsmInfo() {
HasLEB128 = false;
SupportsDebugInformation = false;
ExceptionsType = ExceptionHandling::None;
- DwarfRequiresFrameSection = true;
DwarfUsesInlineInfoSection = false;
- DwarfUsesAbsoluteLabelForStmtList = true;
+ DwarfRequiresRelocationForSectionOffset = true;
DwarfSectionOffsetDirective = 0;
DwarfUsesLabelOffsetForRanges = true;
HasMicrosoftFastStdCallMangling = false;
diff --git a/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp b/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp
index 4dd1d44..5851cb0 100644
--- a/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp
+++ b/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp
@@ -56,6 +56,6 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
HasNoDeadStrip = true;
HasSymbolResolver = true;
- DwarfUsesAbsoluteLabelForStmtList = false;
+ DwarfRequiresRelocationForSectionOffset = false;
DwarfUsesLabelOffsetForRanges = false;
}
diff --git a/contrib/llvm/lib/MC/MCAsmStreamer.cpp b/contrib/llvm/lib/MC/MCAsmStreamer.cpp
index 9717c01..e8b09fc 100644
--- a/contrib/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/contrib/llvm/lib/MC/MCAsmStreamer.cpp
@@ -54,6 +54,8 @@ class MCAsmStreamer : public MCStreamer {
bool needsSet(const MCExpr *Value);
+ void EmitRegisterName(int64_t Register);
+
public:
MCAsmStreamer(MCContext &Context, formatted_raw_ostream &os,
bool isVerboseAsm, bool useLoc, bool useCFI,
@@ -193,6 +195,7 @@ public:
unsigned Isa, unsigned Discriminator,
StringRef FileName);
+ virtual void EmitCFISections(bool EH, bool Debug);
virtual void EmitCFIStartProc();
virtual void EmitCFIEndProc();
virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
@@ -207,6 +210,21 @@ public:
virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
+ virtual void EmitWin64EHStartProc(const MCSymbol *Symbol);
+ virtual void EmitWin64EHEndProc();
+ virtual void EmitWin64EHStartChained();
+ virtual void EmitWin64EHEndChained();
+ virtual void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
+ bool Except);
+ virtual void EmitWin64EHHandlerData();
+ virtual void EmitWin64EHPushReg(unsigned Register);
+ virtual void EmitWin64EHSetFrame(unsigned Register, unsigned Offset);
+ virtual void EmitWin64EHAllocStack(unsigned Size);
+ virtual void EmitWin64EHSaveReg(unsigned Register, unsigned Offset);
+ virtual void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset);
+ virtual void EmitWin64EHPushFrame(bool Code);
+ virtual void EmitWin64EHEndProlog();
+
virtual void EmitFnStart();
virtual void EmitFnEnd();
virtual void EmitCantUnwind();
@@ -322,7 +340,8 @@ void MCAsmStreamer::EmitThumbFunc(MCSymbol *Func) {
// This needs to emit to a temporary string to get properly quoted
// MCSymbols when they have spaces in them.
OS << "\t.thumb_func";
- if (Func)
+ // Only Mach-O hasSubsectionsViaSymbols()
+ if (MAI.hasSubsectionsViaSymbols())
OS << '\t' << *Func;
EmitEOL();
}
@@ -351,7 +370,7 @@ void MCAsmStreamer::EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
const MCSymbol *Label) {
EmitIntValue(dwarf::DW_CFA_advance_loc4, 1);
const MCExpr *AddrDelta = BuildSymbolDiff(getContext(), Label, LastLabel);
- AddrDelta = ForceExpAbs(this, getContext(), AddrDelta);
+ AddrDelta = ForceExpAbs(AddrDelta);
EmitValue(AddrDelta, 4);
}
@@ -764,6 +783,24 @@ void MCAsmStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
EmitEOL();
}
+void MCAsmStreamer::EmitCFISections(bool EH, bool Debug) {
+ MCStreamer::EmitCFISections(EH, Debug);
+
+ if (!UseCFI)
+ return;
+
+ OS << "\t.cfi_sections ";
+ if (EH) {
+ OS << ".eh_frame";
+ if (Debug)
+ OS << ", .debug_frame";
+ } else if (Debug) {
+ OS << ".debug_frame";
+ }
+
+ EmitEOL();
+}
+
void MCAsmStreamer::EmitCFIStartProc() {
MCStreamer::EmitCFIStartProc();
@@ -784,13 +821,25 @@ void MCAsmStreamer::EmitCFIEndProc() {
EmitEOL();
}
+void MCAsmStreamer::EmitRegisterName(int64_t Register) {
+ if (InstPrinter) {
+ const TargetAsmInfo &asmInfo = getContext().getTargetAsmInfo();
+ unsigned LLVMRegister = asmInfo.getLLVMRegNum(Register, true);
+ InstPrinter->printRegName(OS, LLVMRegister);
+ } else {
+ OS << Register;
+ }
+}
+
void MCAsmStreamer::EmitCFIDefCfa(int64_t Register, int64_t Offset) {
MCStreamer::EmitCFIDefCfa(Register, Offset);
if (!UseCFI)
return;
- OS << ".cfi_def_cfa " << Register << ", " << Offset;
+ OS << "\t.cfi_def_cfa ";
+ EmitRegisterName(Register);
+ OS << ", " << Offset;
EmitEOL();
}
@@ -810,7 +859,8 @@ void MCAsmStreamer::EmitCFIDefCfaRegister(int64_t Register) {
if (!UseCFI)
return;
- OS << "\t.cfi_def_cfa_register " << Register;
+ OS << "\t.cfi_def_cfa_register ";
+ EmitRegisterName(Register);
EmitEOL();
}
@@ -820,7 +870,9 @@ void MCAsmStreamer::EmitCFIOffset(int64_t Register, int64_t Offset) {
if (!UseCFI)
return;
- OS << "\t.cfi_offset " << Register << ", " << Offset;
+ OS << "\t.cfi_offset ";
+ EmitRegisterName(Register);
+ OS << ", " << Offset;
EmitEOL();
}
@@ -871,7 +923,8 @@ void MCAsmStreamer::EmitCFISameValue(int64_t Register) {
if (!UseCFI)
return;
- OS << "\t.cfi_same_value " << Register;
+ OS << "\t.cfi_same_value ";
+ EmitRegisterName(Register);
EmitEOL();
}
@@ -881,7 +934,9 @@ void MCAsmStreamer::EmitCFIRelOffset(int64_t Register, int64_t Offset) {
if (!UseCFI)
return;
- OS << "\t.cfi_rel_offset " << Register << ", " << Offset;
+ OS << "\t.cfi_rel_offset ";
+ EmitRegisterName(Register);
+ OS << ", " << Offset;
EmitEOL();
}
@@ -895,6 +950,115 @@ void MCAsmStreamer::EmitCFIAdjustCfaOffset(int64_t Adjustment) {
EmitEOL();
}
+void MCAsmStreamer::EmitWin64EHStartProc(const MCSymbol *Symbol) {
+ MCStreamer::EmitWin64EHStartProc(Symbol);
+
+ OS << ".seh_proc " << *Symbol;
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHEndProc() {
+ MCStreamer::EmitWin64EHEndProc();
+
+ OS << "\t.seh_endproc";
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHStartChained() {
+ MCStreamer::EmitWin64EHStartChained();
+
+ OS << "\t.seh_startchained";
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHEndChained() {
+ MCStreamer::EmitWin64EHEndChained();
+
+ OS << "\t.seh_endchained";
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
+ bool Except) {
+ MCStreamer::EmitWin64EHHandler(Sym, Unwind, Except);
+
+ OS << "\t.seh_handler " << *Sym;
+ if (Unwind)
+ OS << ", @unwind";
+ if (Except)
+ OS << ", @except";
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHHandlerData() {
+ MCStreamer::EmitWin64EHHandlerData();
+
+ // Switch sections. Don't call SwitchSection directly, because that will
+ // cause the section switch to be visible in the emitted assembly.
+ // We only do this so the section switch that terminates the handler
+ // data block is visible.
+ MCWin64EHUnwindInfo *CurFrame = getCurrentW64UnwindInfo();
+ StringRef suffix=MCWin64EHUnwindEmitter::GetSectionSuffix(CurFrame->Function);
+ const MCSection *xdataSect =
+ getContext().getTargetAsmInfo().getWin64EHTableSection(suffix);
+ if (xdataSect)
+ SwitchSectionNoChange(xdataSect);
+
+ OS << "\t.seh_handlerdata";
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHPushReg(unsigned Register) {
+ MCStreamer::EmitWin64EHPushReg(Register);
+
+ OS << "\t.seh_pushreg " << Register;
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHSetFrame(unsigned Register, unsigned Offset) {
+ MCStreamer::EmitWin64EHSetFrame(Register, Offset);
+
+ OS << "\t.seh_setframe " << Register << ", " << Offset;
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHAllocStack(unsigned Size) {
+ MCStreamer::EmitWin64EHAllocStack(Size);
+
+ OS << "\t.seh_stackalloc " << Size;
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHSaveReg(unsigned Register, unsigned Offset) {
+ MCStreamer::EmitWin64EHSaveReg(Register, Offset);
+
+ OS << "\t.seh_savereg " << Register << ", " << Offset;
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHSaveXMM(unsigned Register, unsigned Offset) {
+ MCStreamer::EmitWin64EHSaveXMM(Register, Offset);
+
+ OS << "\t.seh_savexmm " << Register << ", " << Offset;
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHPushFrame(bool Code) {
+ MCStreamer::EmitWin64EHPushFrame(Code);
+
+ OS << "\t.seh_pushframe";
+ if (Code)
+ OS << " @code";
+ EmitEOL();
+}
+
+void MCAsmStreamer::EmitWin64EHEndProlog(void) {
+ MCStreamer::EmitWin64EHEndProlog();
+
+ OS << "\t.seh_endprologue";
+ EmitEOL();
+}
+
void MCAsmStreamer::AddEncodingComment(const MCInst &Inst) {
raw_ostream &OS = GetCommentOS();
SmallString<256> Code;
@@ -1005,8 +1169,10 @@ void MCAsmStreamer::EmitPersonality(const MCSymbol *Personality) {
}
void MCAsmStreamer::EmitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset) {
- OS << "\t.setfp\t" << InstPrinter->getRegName(FpReg)
- << ", " << InstPrinter->getRegName(SpReg);
+ OS << "\t.setfp\t";
+ InstPrinter->printRegName(OS, FpReg);
+ OS << ", ";
+ InstPrinter->printRegName(OS, SpReg);
if (Offset)
OS << ", #" << Offset;
EmitEOL();
@@ -1025,10 +1191,12 @@ void MCAsmStreamer::EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
else
OS << "\t.save\t{";
- OS << InstPrinter->getRegName(RegList[0]);
+ InstPrinter->printRegName(OS, RegList[0]);
- for (unsigned i = 1, e = RegList.size(); i != e; ++i)
- OS << ", " << InstPrinter->getRegName(RegList[i]);
+ for (unsigned i = 1, e = RegList.size(); i != e; ++i) {
+ OS << ", ";
+ InstPrinter->printRegName(OS, RegList[i]);
+ }
OS << "}";
EmitEOL();
@@ -1070,8 +1238,8 @@ void MCAsmStreamer::Finish() {
if (getContext().hasDwarfFiles() && !UseLoc)
MCDwarfFileTable::Emit(this);
- if (getNumFrameInfos() && !UseCFI)
- MCDwarfFrameEmitter::Emit(*this, false);
+ if (!UseCFI)
+ EmitFrames(false);
}
MCStreamer *llvm::createAsmStreamer(MCContext &Context,
diff --git a/contrib/llvm/lib/MC/MCAssembler.cpp b/contrib/llvm/lib/MC/MCAssembler.cpp
index 8360fc9f..527a63c 100644
--- a/contrib/llvm/lib/MC/MCAssembler.cpp
+++ b/contrib/llvm/lib/MC/MCAssembler.cpp
@@ -759,8 +759,7 @@ bool MCAssembler::RelaxDwarfCallFrameFragment(MCAsmLayout &Layout,
SmallString<8> &Data = DF.getContents();
Data.clear();
raw_svector_ostream OSE(Data);
- const TargetAsmInfo &AsmInfo = getContext().getTargetAsmInfo();
- MCDwarfFrameEmitter::EncodeAdvanceLoc(AddrDelta, OSE, AsmInfo);
+ MCDwarfFrameEmitter::EncodeAdvanceLoc(AddrDelta, OSE);
OSE.flush();
return OldSize != Data.size();
}
diff --git a/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp b/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp
index ced57e8..6e636f0 100644
--- a/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp
+++ b/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp
@@ -6,11 +6,10 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+
#include "Disassembler.h"
-#include <stdio.h>
#include "llvm-c/Disassembler.h"
-#include <string>
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCDisassembler.h"
#include "llvm/MC/MCInst.h"
@@ -27,17 +26,12 @@ class Target;
} // namespace llvm
using namespace llvm;
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-//
// LLVMCreateDisasm() creates a disassembler for the TripleName. Symbolic
// disassembly is supported by passing a block of information in the DisInfo
-// parameter and specifing the TagType and call back functions as described in
+// parameter and specifying the TagType and callback functions as described in
// the header llvm-c/Disassembler.h . The pointer to the block and the
-// functions can all be passed as NULL. If successful this returns a
-// disassembler context if not it returns NULL.
+// functions can all be passed as NULL. If successful, this returns a
+// disassembler context. If not, it returns NULL.
//
LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
int TagType, LLVMOpInfoCallback GetOpInfo,
@@ -108,7 +102,6 @@ namespace {
// The memory object created by LLVMDisasmInstruction().
//
class DisasmMemoryObject : public MemoryObject {
-private:
uint8_t *Bytes;
uint64_t Size;
uint64_t BasePC;
@@ -126,7 +119,7 @@ public:
return 0;
}
};
-} // namespace
+} // end anonymous namespace
//
// LLVMDisasmInstruction() disassembles a single instruction using the
@@ -154,18 +147,15 @@ size_t LLVMDisasmInstruction(LLVMDisasmContextRef DCR, uint8_t *Bytes,
if (!DisAsm->getInstruction(Inst, Size, MemoryObject, PC, /*REMOVE*/ nulls()))
return 0;
- std::string InsnStr;
- raw_string_ostream OS(InsnStr);
+ SmallVector<char, 64> InsnStr;
+ raw_svector_ostream OS(InsnStr);
IP->printInst(&Inst, OS);
OS.flush();
+ assert(OutStringSize != 0 && "Output buffer cannot be zero size");
size_t OutputSize = std::min(OutStringSize-1, InsnStr.size());
std::memcpy(OutString, InsnStr.data(), OutputSize);
OutString[OutputSize] = '\0'; // Terminate string.
return Size;
}
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
diff --git a/contrib/llvm/lib/MC/MCDwarf.cpp b/contrib/llvm/lib/MC/MCDwarf.cpp
index f61f0c2..13cb81a 100644
--- a/contrib/llvm/lib/MC/MCDwarf.cpp
+++ b/contrib/llvm/lib/MC/MCDwarf.cpp
@@ -501,10 +501,13 @@ namespace {
int CFAOffset;
int CIENum;
bool UsingCFI;
+ bool IsEH;
+ const MCSymbol *SectionStart;
public:
- FrameEmitterImpl(bool usingCFI) : CFAOffset(0), CIENum(0),
- UsingCFI(usingCFI) {
+ FrameEmitterImpl(bool usingCFI, bool isEH, const MCSymbol *sectionStart) :
+ CFAOffset(0), CIENum(0), UsingCFI(usingCFI), IsEH(isEH),
+ SectionStart(sectionStart) {
}
const MCSymbol &EmitCIE(MCStreamer &streamer,
@@ -514,8 +517,7 @@ namespace {
unsigned lsdaEncoding);
MCSymbol *EmitFDE(MCStreamer &streamer,
const MCSymbol &cieStart,
- const MCDwarfFrameInfo &frame,
- bool forceLsda);
+ const MCDwarfFrameInfo &frame);
void EmitCFIInstructions(MCStreamer &streamer,
const std::vector<MCCFIInstruction> &Instrs,
MCSymbol *BaseLabel);
@@ -537,8 +539,6 @@ void FrameEmitterImpl::EmitCFIInstruction(MCStreamer &Streamer,
// If advancing cfa.
if (Dst.isReg() && Dst.getReg() == MachineLocation::VirtualFP) {
- assert(!Src.isReg() && "Machine move not supported yet.");
-
if (Src.getReg() == MachineLocation::VirtualFP) {
Streamer.EmitIntValue(dwarf::DW_CFA_def_cfa_offset, 1);
} else {
@@ -630,11 +630,9 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
unsigned lsdaEncoding) {
MCContext &context = streamer.getContext();
const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
- const MCSection &section = *asmInfo.getEHFrameSection();
- streamer.SwitchSection(&section);
MCSymbol *sectionStart;
- if (asmInfo.isFunctionEHFrameSymbolPrivate())
+ if (asmInfo.isFunctionEHFrameSymbolPrivate() || !IsEH)
sectionStart = context.CreateTempSymbol();
else
sectionStart = context.GetOrCreateSymbol(Twine("EH_frame") + Twine(CIENum));
@@ -650,20 +648,23 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
streamer.EmitAbsValue(Length, 4);
// CIE ID
- streamer.EmitIntValue(0, 4);
+ unsigned CIE_ID = IsEH ? 0 : -1;
+ streamer.EmitIntValue(CIE_ID, 4);
// Version
streamer.EmitIntValue(dwarf::DW_CIE_VERSION, 1);
// Augmentation String
SmallString<8> Augmentation;
- Augmentation += "z";
- if (personality)
- Augmentation += "P";
- if (lsda)
- Augmentation += "L";
- Augmentation += "R";
- streamer.EmitBytes(Augmentation.str(), 0);
+ if (IsEH) {
+ Augmentation += "z";
+ if (personality)
+ Augmentation += "P";
+ if (lsda)
+ Augmentation += "L";
+ Augmentation += "R";
+ streamer.EmitBytes(Augmentation.str(), 0);
+ }
streamer.EmitIntValue(0, 1);
// Code Alignment Factor
@@ -678,33 +679,32 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
// Augmentation Data Length (optional)
unsigned augmentationLength = 0;
- if (personality) {
- // Personality Encoding
- augmentationLength += 1;
- // Personality
- augmentationLength += getSizeForEncoding(streamer, personalityEncoding);
- }
- if (lsda) {
+ if (IsEH) {
+ if (personality) {
+ // Personality Encoding
+ augmentationLength += 1;
+ // Personality
+ augmentationLength += getSizeForEncoding(streamer, personalityEncoding);
+ }
+ if (lsda)
+ augmentationLength += 1;
+ // Encoding of the FDE pointers
augmentationLength += 1;
- }
- // Encoding of the FDE pointers
- augmentationLength += 1;
- streamer.EmitULEB128IntValue(augmentationLength);
+ streamer.EmitULEB128IntValue(augmentationLength);
- // Augmentation Data (optional)
- if (personality) {
- // Personality Encoding
- streamer.EmitIntValue(personalityEncoding, 1);
- // Personality
- EmitPersonality(streamer, *personality, personalityEncoding);
- }
- if (lsda) {
- // LSDA Encoding
- streamer.EmitIntValue(lsdaEncoding, 1);
+ // Augmentation Data (optional)
+ if (personality) {
+ // Personality Encoding
+ streamer.EmitIntValue(personalityEncoding, 1);
+ // Personality
+ EmitPersonality(streamer, *personality, personalityEncoding);
+ }
+ if (lsda)
+ streamer.EmitIntValue(lsdaEncoding, 1); // LSDA Encoding
+ // Encoding of the FDE pointers
+ streamer.EmitIntValue(asmInfo.getFDEEncoding(UsingCFI), 1);
}
- // Encoding of the FDE pointers
- streamer.EmitIntValue(asmInfo.getFDEEncoding(UsingCFI), 1);
// Initial Instructions
@@ -724,7 +724,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
EmitCFIInstructions(streamer, Instructions, NULL);
// Padding
- streamer.EmitValueToAlignment(4);
+ streamer.EmitValueToAlignment(IsEH ? 4 : asmInfo.getPointerSize());
streamer.EmitLabel(sectionEnd);
return *sectionStart;
@@ -732,16 +732,15 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
const MCSymbol &cieStart,
- const MCDwarfFrameInfo &frame,
- bool forceLsda) {
+ const MCDwarfFrameInfo &frame) {
MCContext &context = streamer.getContext();
MCSymbol *fdeStart = context.CreateTempSymbol();
MCSymbol *fdeEnd = context.CreateTempSymbol();
- const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
+ const TargetAsmInfo &TAsmInfo = context.getTargetAsmInfo();
- if (!asmInfo.isFunctionEHFrameSymbolPrivate()) {
- Twine EHName = frame.Function->getName() + Twine(".eh");
- MCSymbol *EHSym = context.GetOrCreateSymbol(EHName);
+ if (!TAsmInfo.isFunctionEHFrameSymbolPrivate() && IsEH) {
+ MCSymbol *EHSym = context.GetOrCreateSymbol(
+ frame.Function->getName() + Twine(".eh"));
streamer.EmitEHSymAttributes(frame.Function, EHSym);
streamer.EmitLabel(EHSym);
}
@@ -751,45 +750,54 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
streamer.EmitAbsValue(Length, 4);
streamer.EmitLabel(fdeStart);
+
// CIE Pointer
- const MCExpr *offset = MakeStartMinusEndExpr(streamer, cieStart, *fdeStart,
- 0);
- streamer.EmitAbsValue(offset, 4);
- unsigned fdeEncoding = asmInfo.getFDEEncoding(UsingCFI);
+ const MCAsmInfo &asmInfo = context.getAsmInfo();
+ if (IsEH) {
+ const MCExpr *offset = MakeStartMinusEndExpr(streamer, cieStart, *fdeStart,
+ 0);
+ streamer.EmitAbsValue(offset, 4);
+ } else if (!asmInfo.doesDwarfRequireRelocationForSectionOffset()) {
+ const MCExpr *offset = MakeStartMinusEndExpr(streamer, *SectionStart,
+ cieStart, 0);
+ streamer.EmitAbsValue(offset, 4);
+ } else {
+ streamer.EmitSymbolValue(&cieStart, 4);
+ }
+ unsigned fdeEncoding = TAsmInfo.getFDEEncoding(UsingCFI);
unsigned size = getSizeForEncoding(streamer, fdeEncoding);
// PC Begin
- EmitSymbol(streamer, *frame.Begin, fdeEncoding);
+ unsigned PCBeginEncoding = IsEH ? fdeEncoding :
+ (unsigned)dwarf::DW_EH_PE_absptr;
+ unsigned PCBeginSize = getSizeForEncoding(streamer, PCBeginEncoding);
+ EmitSymbol(streamer, *frame.Begin, PCBeginEncoding);
// PC Range
const MCExpr *Range = MakeStartMinusEndExpr(streamer, *frame.Begin,
*frame.End, 0);
streamer.EmitAbsValue(Range, size);
- // Augmentation Data Length
- unsigned augmentationLength = 0;
-
- if (frame.Lsda || forceLsda)
- augmentationLength += getSizeForEncoding(streamer, frame.LsdaEncoding);
+ if (IsEH) {
+ // Augmentation Data Length
+ unsigned augmentationLength = 0;
- streamer.EmitULEB128IntValue(augmentationLength);
+ if (frame.Lsda)
+ augmentationLength += getSizeForEncoding(streamer, frame.LsdaEncoding);
- // Augmentation Data
+ streamer.EmitULEB128IntValue(augmentationLength);
- // When running in "CodeGen compatibility mode" a FDE with no LSDA can be
- // assigned to a CIE that requires one. In that case we output a 0 (as does
- // CodeGen).
- if (frame.Lsda)
- EmitSymbol(streamer, *frame.Lsda, frame.LsdaEncoding);
- else if (forceLsda)
- streamer.EmitIntValue(0, getSizeForEncoding(streamer, frame.LsdaEncoding));
+ // Augmentation Data
+ if (frame.Lsda)
+ EmitSymbol(streamer, *frame.Lsda, frame.LsdaEncoding);
+ }
// Call Frame Instructions
EmitCFIInstructions(streamer, frame.Instructions, frame.Begin);
// Padding
- streamer.EmitValueToAlignment(size);
+ streamer.EmitValueToAlignment(PCBeginSize);
return fdeEnd;
}
@@ -835,89 +843,32 @@ namespace llvm {
};
}
-// This is an implementation of CIE and FDE emission that is bug by bug
-// compatible with the one in CodeGen. It is useful during the transition
-// to make it easy to compare the outputs, but should probably be removed
-// afterwards.
-void MCDwarfFrameEmitter::EmitDarwin(MCStreamer &streamer,
- bool usingCFI) {
- FrameEmitterImpl Emitter(usingCFI);
- DenseMap<const MCSymbol*, const MCSymbol*> Personalities;
- const MCSymbol *aCIE = NULL;
- const MCDwarfFrameInfo *aFrame = NULL;
-
- for (unsigned i = 0, n = streamer.getNumFrameInfos(); i < n; ++i) {
- const MCDwarfFrameInfo &frame = streamer.getFrameInfo(i);
- if (!frame.Personality)
- continue;
- if (Personalities.count(frame.Personality))
- continue;
-
- const MCSymbol *cieStart = &Emitter.EmitCIE(streamer, frame.Personality,
- frame.PersonalityEncoding,
- frame.Lsda,
- frame.LsdaEncoding);
- aCIE = cieStart;
- aFrame = &frame;
- Personalities[frame.Personality] = cieStart;
- }
-
- if (Personalities.empty()) {
- const MCDwarfFrameInfo &frame = streamer.getFrameInfo(0);
- aCIE = &Emitter.EmitCIE(streamer, frame.Personality,
- frame.PersonalityEncoding, frame.Lsda,
- frame.LsdaEncoding);
- aFrame = &frame;
- }
-
- MCSymbol *fdeEnd = NULL;
- for (unsigned i = 0, n = streamer.getNumFrameInfos(); i < n; ++i) {
- const MCDwarfFrameInfo &frame = streamer.getFrameInfo(i);
- const MCSymbol *cieStart = Personalities[frame.Personality];
- bool hasLSDA;
- if (!cieStart) {
- cieStart = aCIE;
- hasLSDA = aFrame->Lsda;
- } else {
- hasLSDA = true;
- }
-
- fdeEnd = Emitter.EmitFDE(streamer, *cieStart, frame,
- hasLSDA);
- if (i != n - 1)
- streamer.EmitLabel(fdeEnd);
- }
-
- const MCContext &context = streamer.getContext();
- const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
- streamer.EmitValueToAlignment(asmInfo.getPointerSize());
- if (fdeEnd)
- streamer.EmitLabel(fdeEnd);
-}
-
void MCDwarfFrameEmitter::Emit(MCStreamer &streamer,
- bool usingCFI) {
- const MCContext &context = streamer.getContext();
+ bool usingCFI,
+ bool isEH) {
+ MCContext &context = streamer.getContext();
const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
- if (!asmInfo.isFunctionEHFrameSymbolPrivate()) {
- EmitDarwin(streamer, usingCFI);
- return;
- }
+ const MCSection &section = isEH ?
+ *asmInfo.getEHFrameSection() : *asmInfo.getDwarfFrameSection();
+ streamer.SwitchSection(&section);
+ MCSymbol *SectionStart = context.CreateTempSymbol();
+ streamer.EmitLabel(SectionStart);
MCSymbol *fdeEnd = NULL;
DenseMap<CIEKey, const MCSymbol*> CIEStarts;
- FrameEmitterImpl Emitter(usingCFI);
+ FrameEmitterImpl Emitter(usingCFI, isEH, SectionStart);
+ const MCSymbol *DummyDebugKey = NULL;
for (unsigned i = 0, n = streamer.getNumFrameInfos(); i < n; ++i) {
const MCDwarfFrameInfo &frame = streamer.getFrameInfo(i);
CIEKey key(frame.Personality, frame.PersonalityEncoding,
frame.LsdaEncoding);
- const MCSymbol *&cieStart = CIEStarts[key];
+ const MCSymbol *&cieStart = isEH ? CIEStarts[key] : DummyDebugKey;
if (!cieStart)
cieStart = &Emitter.EmitCIE(streamer, frame.Personality,
frame.PersonalityEncoding, frame.Lsda,
frame.LsdaEncoding);
- fdeEnd = Emitter.EmitFDE(streamer, *cieStart, frame, false);
+ fdeEnd = Emitter.EmitFDE(streamer, *cieStart, frame);
if (i != n - 1)
streamer.EmitLabel(fdeEnd);
}
@@ -931,28 +882,21 @@ void MCDwarfFrameEmitter::EmitAdvanceLoc(MCStreamer &Streamer,
uint64_t AddrDelta) {
SmallString<256> Tmp;
raw_svector_ostream OS(Tmp);
- const TargetAsmInfo &AsmInfo = Streamer.getContext().getTargetAsmInfo();
- MCDwarfFrameEmitter::EncodeAdvanceLoc(AddrDelta, OS, AsmInfo);
+ MCDwarfFrameEmitter::EncodeAdvanceLoc(AddrDelta, OS);
Streamer.EmitBytes(OS.str(), /*AddrSpace=*/0);
}
void MCDwarfFrameEmitter::EncodeAdvanceLoc(uint64_t AddrDelta,
- raw_ostream &OS,
- const TargetAsmInfo &AsmInfo) {
- // This is a small hack to facilitate the transition to CFI on OS X. It
- // relaxes all address advances which lets us produces identical output
- // to the one produce by CodeGen.
- const bool Relax = !AsmInfo.isFunctionEHFrameSymbolPrivate();
-
+ raw_ostream &OS) {
// FIXME: Assumes the code alignment factor is 1.
if (AddrDelta == 0) {
- } else if (isUIntN(6, AddrDelta) && !Relax) {
+ } else if (isUIntN(6, AddrDelta)) {
uint8_t Opcode = dwarf::DW_CFA_advance_loc | AddrDelta;
OS << Opcode;
- } else if (isUInt<8>(AddrDelta) && !Relax) {
+ } else if (isUInt<8>(AddrDelta)) {
OS << uint8_t(dwarf::DW_CFA_advance_loc1);
OS << uint8_t(AddrDelta);
- } else if (isUInt<16>(AddrDelta) && !Relax) {
+ } else if (isUInt<16>(AddrDelta)) {
// FIXME: check what is the correct behavior on a big endian machine.
OS << uint8_t(dwarf::DW_CFA_advance_loc2);
OS << uint8_t( AddrDelta & 0xff);
diff --git a/contrib/llvm/lib/MC/MCELF.cpp b/contrib/llvm/lib/MC/MCELF.cpp
index ce7783e..2c3f8e8 100644
--- a/contrib/llvm/lib/MC/MCELF.cpp
+++ b/contrib/llvm/lib/MC/MCELF.cpp
@@ -57,13 +57,13 @@ void MCELF::SetVisibility(MCSymbolData &SD, unsigned Visibility) {
assert(Visibility == ELF::STV_DEFAULT || Visibility == ELF::STV_INTERNAL ||
Visibility == ELF::STV_HIDDEN || Visibility == ELF::STV_PROTECTED);
- uint32_t OtherFlags = SD.getFlags() & ~(0xf << ELF_STV_Shift);
+ uint32_t OtherFlags = SD.getFlags() & ~(0x3 << ELF_STV_Shift);
SD.setFlags(OtherFlags | (Visibility << ELF_STV_Shift));
}
unsigned MCELF::GetVisibility(MCSymbolData &SD) {
unsigned Visibility =
- (SD.getFlags() & (0xf << ELF_STV_Shift)) >> ELF_STV_Shift;
+ (SD.getFlags() & (0x3 << ELF_STV_Shift)) >> ELF_STV_Shift;
assert(Visibility == ELF::STV_DEFAULT || Visibility == ELF::STV_INTERNAL ||
Visibility == ELF::STV_HIDDEN || Visibility == ELF::STV_PROTECTED);
return Visibility;
diff --git a/contrib/llvm/lib/MC/MCELFStreamer.cpp b/contrib/llvm/lib/MC/MCELFStreamer.cpp
index be8e2e3..bbb2789 100644
--- a/contrib/llvm/lib/MC/MCELFStreamer.cpp
+++ b/contrib/llvm/lib/MC/MCELFStreamer.cpp
@@ -66,6 +66,11 @@ void MCELFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
void MCELFStreamer::EmitThumbFunc(MCSymbol *Func) {
// FIXME: Anything needed here to flag the function as thumb?
+
+ getAssembler().setIsThumbFunc(Func);
+
+ MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Func);
+ SD.setFlags(SD.getFlags() | ELF_Other_ThumbFunc);
}
void MCELFStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
@@ -345,8 +350,7 @@ void MCELFStreamer::EmitInstToData(const MCInst &Inst) {
}
void MCELFStreamer::Finish() {
- if (getNumFrameInfos())
- MCDwarfFrameEmitter::Emit(*this, true);
+ EmitFrames(true);
for (std::vector<LocalCommon>::const_iterator i = LocalCommons.begin(),
e = LocalCommons.end();
diff --git a/contrib/llvm/lib/MC/MCExpr.cpp b/contrib/llvm/lib/MC/MCExpr.cpp
index 3a674d7..fcf1aab 100644
--- a/contrib/llvm/lib/MC/MCExpr.cpp
+++ b/contrib/llvm/lib/MC/MCExpr.cpp
@@ -42,8 +42,8 @@ void MCExpr::print(raw_ostream &OS) const {
// absolute names.
bool UseParens = Sym.getName()[0] == '$';
- if (SRE.getKind() == MCSymbolRefExpr::VK_PPC_HA16 ||
- SRE.getKind() == MCSymbolRefExpr::VK_PPC_LO16) {
+ if (SRE.getKind() == MCSymbolRefExpr::VK_PPC_DARWIN_HA16 ||
+ SRE.getKind() == MCSymbolRefExpr::VK_PPC_DARWIN_LO16) {
OS << MCSymbolRefExpr::getVariantKindName(SRE.getKind());
UseParens = true;
}
@@ -61,8 +61,8 @@ void MCExpr::print(raw_ostream &OS) const {
SRE.getKind() == MCSymbolRefExpr::VK_ARM_GOTTPOFF)
OS << MCSymbolRefExpr::getVariantKindName(SRE.getKind());
else if (SRE.getKind() != MCSymbolRefExpr::VK_None &&
- SRE.getKind() != MCSymbolRefExpr::VK_PPC_HA16 &&
- SRE.getKind() != MCSymbolRefExpr::VK_PPC_LO16)
+ SRE.getKind() != MCSymbolRefExpr::VK_PPC_DARWIN_HA16 &&
+ SRE.getKind() != MCSymbolRefExpr::VK_PPC_DARWIN_LO16)
OS << '@' << MCSymbolRefExpr::getVariantKindName(SRE.getKind());
return;
@@ -197,8 +197,10 @@ StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
case VK_ARM_GOTTPOFF: return "(gottpoff)";
case VK_ARM_TLSGD: return "(tlsgd)";
case VK_PPC_TOC: return "toc";
- case VK_PPC_HA16: return "ha16";
- case VK_PPC_LO16: return "lo16";
+ case VK_PPC_DARWIN_HA16: return "ha16";
+ case VK_PPC_DARWIN_LO16: return "lo16";
+ case VK_PPC_GAS_HA16: return "ha";
+ case VK_PPC_GAS_LO16: return "l";
}
}
diff --git a/contrib/llvm/lib/MC/MCInstPrinter.cpp b/contrib/llvm/lib/MC/MCInstPrinter.cpp
index 212b85e..81a939f 100644
--- a/contrib/llvm/lib/MC/MCInstPrinter.cpp
+++ b/contrib/llvm/lib/MC/MCInstPrinter.cpp
@@ -20,7 +20,6 @@ StringRef MCInstPrinter::getOpcodeName(unsigned Opcode) const {
return "";
}
-StringRef MCInstPrinter::getRegName(unsigned RegNo) const {
+void MCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
assert(0 && "Target should implement this");
- return "";
}
diff --git a/contrib/llvm/lib/MC/MCMachOStreamer.cpp b/contrib/llvm/lib/MC/MCMachOStreamer.cpp
index 3da5b49..12aeb4f 100644
--- a/contrib/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/contrib/llvm/lib/MC/MCMachOStreamer.cpp
@@ -377,8 +377,7 @@ void MCMachOStreamer::EmitInstToData(const MCInst &Inst) {
}
void MCMachOStreamer::Finish() {
- if (getNumFrameInfos())
- MCDwarfFrameEmitter::Emit(*this, true);
+ EmitFrames(true);
// We have to set the fragment atom associations so we can relax properly for
// Mach-O.
diff --git a/contrib/llvm/lib/MC/MCObjectStreamer.cpp b/contrib/llvm/lib/MC/MCObjectStreamer.cpp
index 0f349d0..e230c53 100644
--- a/contrib/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/contrib/llvm/lib/MC/MCObjectStreamer.cpp
@@ -127,7 +127,7 @@ void MCObjectStreamer::EmitULEB128Value(const MCExpr *Value) {
EmitULEB128IntValue(IntValue);
return;
}
- Value = ForceExpAbs(this, getContext(), Value);
+ Value = ForceExpAbs(Value);
new MCLEBFragment(*Value, false, getCurrentSectionData());
}
@@ -137,7 +137,7 @@ void MCObjectStreamer::EmitSLEB128Value(const MCExpr *Value) {
EmitSLEB128IntValue(IntValue);
return;
}
- Value = ForceExpAbs(this, getContext(), Value);
+ Value = ForceExpAbs(Value);
new MCLEBFragment(*Value, true, getCurrentSectionData());
}
@@ -209,7 +209,7 @@ void MCObjectStreamer::EmitDwarfAdvanceLineAddr(int64_t LineDelta,
MCDwarfLineAddr::Emit(this, LineDelta, Res);
return;
}
- AddrDelta = ForceExpAbs(this, getContext(), AddrDelta);
+ AddrDelta = ForceExpAbs(AddrDelta);
new MCDwarfLineAddrFragment(LineDelta, *AddrDelta, getCurrentSectionData());
}
@@ -221,7 +221,7 @@ void MCObjectStreamer::EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
MCDwarfFrameEmitter::EmitAdvanceLoc(*this, Res);
return;
}
- AddrDelta = ForceExpAbs(this, getContext(), AddrDelta);
+ AddrDelta = ForceExpAbs(AddrDelta);
new MCDwarfCallFrameFragment(*AddrDelta, getCurrentSectionData());
}
diff --git a/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp b/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp
index a3d3a49..0c1f8f0 100644
--- a/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp
+++ b/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp
@@ -388,6 +388,7 @@ AsmToken AsmLexer::LexToken() {
case ',': return AsmToken(AsmToken::Comma, StringRef(TokStart, 1));
case '$': return AsmToken(AsmToken::Dollar, StringRef(TokStart, 1));
case '@': return AsmToken(AsmToken::At, StringRef(TokStart, 1));
+ case '\\': return AsmToken(AsmToken::BackSlash, StringRef(TokStart, 1));
case '=':
if (*CurPtr == '=')
return ++CurPtr, AsmToken(AsmToken::EqualEqual, StringRef(TokStart, 2));
diff --git a/contrib/llvm/lib/MC/MCParser/AsmParser.cpp b/contrib/llvm/lib/MC/MCParser/AsmParser.cpp
index d8fd27d..4f55cea 100644
--- a/contrib/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/contrib/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -27,6 +27,7 @@
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCDwarf.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
@@ -36,15 +37,21 @@
#include <vector>
using namespace llvm;
+static cl::opt<bool>
+FatalAssemblerWarnings("fatal-assembler-warnings",
+ cl::desc("Consider warnings as error"));
+
namespace {
/// \brief Helper class for tracking macro definitions.
struct Macro {
StringRef Name;
StringRef Body;
+ std::vector<StringRef> Parameters;
public:
- Macro(StringRef N, StringRef B) : Name(N), Body(B) {}
+ Macro(StringRef N, StringRef B, const std::vector<StringRef> &P) :
+ Name(N), Body(B), Parameters(P) {}
};
/// \brief Helper class for storing information about an active macro
@@ -64,7 +71,7 @@ struct MacroInstantiation {
public:
MacroInstantiation(const Macro *M, SMLoc IL, SMLoc EL,
- const std::vector<std::vector<AsmToken> > &A);
+ MemoryBuffer *I);
};
/// \brief The concrete assembly parser instance.
@@ -128,7 +135,7 @@ public:
virtual MCContext &getContext() { return Ctx; }
virtual MCStreamer &getStreamer() { return Out; }
- virtual void Warning(SMLoc L, const Twine &Meg);
+ virtual bool Warning(SMLoc L, const Twine &Meg);
virtual bool Error(SMLoc L, const Twine &Msg);
const AsmToken &Lex();
@@ -146,6 +153,10 @@ private:
bool ParseStatement();
bool HandleMacroEntry(StringRef Name, SMLoc NameLoc, const Macro *M);
+ bool expandMacro(SmallString<256> &Buf, StringRef Body,
+ const std::vector<StringRef> &Parameters,
+ const std::vector<std::vector<AsmToken> > &A,
+ const SMLoc &L);
void HandleMacroExit();
void PrintMacroInstantiations();
@@ -243,6 +254,8 @@ public:
AddDirectiveHandler<&GenericAsmParser::ParseDirectiveStabs>(".stabs");
// CFI directives.
+ AddDirectiveHandler<&GenericAsmParser::ParseDirectiveCFISections>(
+ ".cfi_sections");
AddDirectiveHandler<&GenericAsmParser::ParseDirectiveCFIStartProc>(
".cfi_startproc");
AddDirectiveHandler<&GenericAsmParser::ParseDirectiveCFIEndProc>(
@@ -289,6 +302,7 @@ public:
bool ParseDirectiveLine(StringRef, SMLoc DirectiveLoc);
bool ParseDirectiveLoc(StringRef, SMLoc DirectiveLoc);
bool ParseDirectiveStabs(StringRef, SMLoc DirectiveLoc);
+ bool ParseDirectiveCFISections(StringRef, SMLoc DirectiveLoc);
bool ParseDirectiveCFIStartProc(StringRef, SMLoc DirectiveLoc);
bool ParseDirectiveCFIEndProc(StringRef, SMLoc DirectiveLoc);
bool ParseDirectiveCFIDefCfa(StringRef, SMLoc DirectiveLoc);
@@ -367,9 +381,12 @@ void AsmParser::PrintMacroInstantiations() {
"note");
}
-void AsmParser::Warning(SMLoc L, const Twine &Msg) {
+bool AsmParser::Warning(SMLoc L, const Twine &Msg) {
+ if (FatalAssemblerWarnings)
+ return Error(L, Msg);
PrintMessage(L, Msg, "warning");
PrintMacroInstantiations();
+ return false;
}
bool AsmParser::Error(SMLoc L, const Twine &Msg) {
@@ -380,7 +397,8 @@ bool AsmParser::Error(SMLoc L, const Twine &Msg) {
}
bool AsmParser::EnterIncludeFile(const std::string &Filename) {
- int NewBuf = SrcMgr.AddIncludeFile(Filename, Lexer.getLoc());
+ std::string IncludedFile;
+ int NewBuf = SrcMgr.AddIncludeFile(Filename, Lexer.getLoc(), IncludedFile);
if (NewBuf == -1)
return true;
@@ -542,7 +560,7 @@ bool AsmParser::ParsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
StringRef Identifier;
if (ParseIdentifier(Identifier))
- return false;
+ return true;
// This is a symbol reference.
std::pair<StringRef, StringRef> Split = Identifier.split('@');
@@ -1126,9 +1144,9 @@ bool AsmParser::ParseStatement() {
if (!getTargetParser().ParseDirective(ID))
return false;
- Warning(IDLoc, "ignoring directive for now");
+ bool retval = Warning(IDLoc, "ignoring directive for now");
EatToEndOfStatement();
- return false;
+ return retval;
}
CheckForValidSection();
@@ -1171,27 +1189,33 @@ bool AsmParser::ParseStatement() {
return false;
}
-MacroInstantiation::MacroInstantiation(const Macro *M, SMLoc IL, SMLoc EL,
- const std::vector<std::vector<AsmToken> > &A)
- : TheMacro(M), InstantiationLoc(IL), ExitLoc(EL)
-{
- // Macro instantiation is lexical, unfortunately. We construct a new buffer
- // to hold the macro body with substitutions.
- SmallString<256> Buf;
+bool AsmParser::expandMacro(SmallString<256> &Buf, StringRef Body,
+ const std::vector<StringRef> &Parameters,
+ const std::vector<std::vector<AsmToken> > &A,
+ const SMLoc &L) {
raw_svector_ostream OS(Buf);
+ unsigned NParameters = Parameters.size();
+ if (NParameters != 0 && NParameters != A.size())
+ return Error(L, "Wrong number of arguments");
- StringRef Body = M->Body;
while (!Body.empty()) {
// Scan for the next substitution.
std::size_t End = Body.size(), Pos = 0;
for (; Pos != End; ++Pos) {
// Check for a substitution or escape.
- if (Body[Pos] != '$' || Pos + 1 == End)
- continue;
-
- char Next = Body[Pos + 1];
- if (Next == '$' || Next == 'n' || isdigit(Next))
- break;
+ if (!NParameters) {
+ // This macro has no parameters, look for $0, $1, etc.
+ if (Body[Pos] != '$' || Pos + 1 == End)
+ continue;
+
+ char Next = Body[Pos + 1];
+ if (Next == '$' || Next == 'n' || isdigit(Next))
+ break;
+ } else {
+ // This macro has parameters, look for \foo, \bar, etc.
+ if (Body[Pos] == '\\' && Pos + 1 != End)
+ break;
+ }
}
// Add the prefix.
@@ -1201,41 +1225,69 @@ MacroInstantiation::MacroInstantiation(const Macro *M, SMLoc IL, SMLoc EL,
if (Pos == End)
break;
- switch (Body[Pos+1]) {
- // $$ => $
- case '$':
- OS << '$';
- break;
+ if (!NParameters) {
+ switch (Body[Pos+1]) {
+ // $$ => $
+ case '$':
+ OS << '$';
+ break;
- // $n => number of arguments
- case 'n':
- OS << A.size();
- break;
+ // $n => number of arguments
+ case 'n':
+ OS << A.size();
+ break;
- // $[0-9] => argument
- default: {
- // Missing arguments are ignored.
- unsigned Index = Body[Pos+1] - '0';
- if (Index >= A.size())
+ // $[0-9] => argument
+ default: {
+ // Missing arguments are ignored.
+ unsigned Index = Body[Pos+1] - '0';
+ if (Index >= A.size())
+ break;
+
+ // Otherwise substitute with the token values, with spaces eliminated.
+ for (std::vector<AsmToken>::const_iterator it = A[Index].begin(),
+ ie = A[Index].end(); it != ie; ++it)
+ OS << it->getString();
break;
+ }
+ }
+ Pos += 2;
+ } else {
+ unsigned I = Pos + 1;
+ while (isalnum(Body[I]) && I + 1 != End)
+ ++I;
+
+ const char *Begin = Body.data() + Pos +1;
+ StringRef Argument(Begin, I - (Pos +1));
+ unsigned Index = 0;
+ for (; Index < NParameters; ++Index)
+ if (Parameters[Index] == Argument)
+ break;
+
+ // FIXME: We should error at the macro definition.
+ if (Index == NParameters)
+ return Error(L, "Parameter not found");
- // Otherwise substitute with the token values, with spaces eliminated.
for (std::vector<AsmToken>::const_iterator it = A[Index].begin(),
ie = A[Index].end(); it != ie; ++it)
OS << it->getString();
- break;
- }
- }
+ Pos += 1 + Argument.size();
+ }
// Update the scan point.
- Body = Body.substr(Pos + 2);
+ Body = Body.substr(Pos);
}
// We include the .endmacro in the buffer as our queue to exit the macro
// instantiation.
OS << ".endmacro\n";
+ return false;
+}
- Instantiation = MemoryBuffer::getMemBufferCopy(OS.str(), "<instantiation>");
+MacroInstantiation::MacroInstantiation(const Macro *M, SMLoc IL, SMLoc EL,
+ MemoryBuffer *I)
+ : TheMacro(M), Instantiation(I), InstantiationLoc(IL), ExitLoc(EL)
+{
}
bool AsmParser::HandleMacroEntry(StringRef Name, SMLoc NameLoc,
@@ -1272,11 +1324,22 @@ bool AsmParser::HandleMacroEntry(StringRef Name, SMLoc NameLoc,
Lex();
}
+ // Macro instantiation is lexical, unfortunately. We construct a new buffer
+ // to hold the macro body with substitutions.
+ SmallString<256> Buf;
+ StringRef Body = M->Body;
+
+ if (expandMacro(Buf, Body, M->Parameters, MacroArguments, getTok().getLoc()))
+ return true;
+
+ MemoryBuffer *Instantiation =
+ MemoryBuffer::getMemBufferCopy(Buf.str(), "<instantiation>");
+
// Create the macro instantiation object and add to the current macro
// instantiation stack.
MacroInstantiation *MI = new MacroInstantiation(M, NameLoc,
getTok().getLoc(),
- MacroArguments);
+ Instantiation);
ActiveMacros.push_back(MI);
// Jump to the macro instantiation and prime the lexer.
@@ -2265,6 +2328,39 @@ bool GenericAsmParser::ParseDirectiveStabs(StringRef Directive,
return TokError("unsupported directive '" + Directive + "'");
}
+/// ParseDirectiveCFISections
+/// ::= .cfi_sections section [, section]
+bool GenericAsmParser::ParseDirectiveCFISections(StringRef,
+ SMLoc DirectiveLoc) {
+ StringRef Name;
+ bool EH = false;
+ bool Debug = false;
+
+ if (getParser().ParseIdentifier(Name))
+ return TokError("Expected an identifier");
+
+ if (Name == ".eh_frame")
+ EH = true;
+ else if (Name == ".debug_frame")
+ Debug = true;
+
+ if (getLexer().is(AsmToken::Comma)) {
+ Lex();
+
+ if (getParser().ParseIdentifier(Name))
+ return TokError("Expected an identifier");
+
+ if (Name == ".eh_frame")
+ EH = true;
+ else if (Name == ".debug_frame")
+ Debug = true;
+ }
+
+ getStreamer().EmitCFISections(EH, Debug);
+
+ return false;
+}
+
/// ParseDirectiveCFIStartProc
/// ::= .cfi_startproc
bool GenericAsmParser::ParseDirectiveCFIStartProc(StringRef,
@@ -2285,7 +2381,7 @@ bool GenericAsmParser::ParseRegisterOrRegisterNumber(int64_t &Register,
SMLoc DirectiveLoc) {
unsigned RegNo;
- if (getLexer().is(AsmToken::Percent)) {
+ if (getLexer().isNot(AsmToken::Integer)) {
if (getParser().getTargetParser().ParseRegister(RegNo, DirectiveLoc,
DirectiveLoc))
return true;
@@ -2493,13 +2589,27 @@ bool GenericAsmParser::ParseDirectiveMacrosOnOff(StringRef Directive,
}
/// ParseDirectiveMacro
-/// ::= .macro name
+/// ::= .macro name [parameters]
bool GenericAsmParser::ParseDirectiveMacro(StringRef Directive,
SMLoc DirectiveLoc) {
StringRef Name;
if (getParser().ParseIdentifier(Name))
return TokError("expected identifier in directive");
+ std::vector<StringRef> Parameters;
+ if (getLexer().isNot(AsmToken::EndOfStatement)) {
+ for(;;) {
+ StringRef Parameter;
+ if (getParser().ParseIdentifier(Parameter))
+ return TokError("expected identifier in directive");
+ Parameters.push_back(Parameter);
+
+ if (getLexer().isNot(AsmToken::Comma))
+ break;
+ Lex();
+ }
+ }
+
if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in '.macro' directive");
@@ -2537,7 +2647,7 @@ bool GenericAsmParser::ParseDirectiveMacro(StringRef Directive,
const char *BodyStart = StartToken.getLoc().getPointer();
const char *BodyEnd = EndToken.getLoc().getPointer();
StringRef Body = StringRef(BodyStart, BodyEnd - BodyStart);
- getParser().MacroMap[Name] = new Macro(Name, Body);
+ getParser().MacroMap[Name] = new Macro(Name, Body, Parameters);
return false;
}
diff --git a/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp b/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp
index 5ecab03..64f6355 100644
--- a/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp
+++ b/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp
@@ -14,6 +14,9 @@
#include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCSectionCOFF.h"
#include "llvm/MC/MCStreamer.h"
+#include "llvm/MC/MCExpr.h"
+#include "llvm/Target/TargetAsmInfo.h"
+#include "llvm/Target/TargetAsmParser.h"
#include "llvm/Support/COFF.h"
using namespace llvm;
@@ -41,6 +44,34 @@ class COFFAsmParser : public MCAsmParserExtension {
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveScl>(".scl");
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveType>(".type");
AddDirectiveHandler<&COFFAsmParser::ParseDirectiveEndef>(".endef");
+
+ // Win64 EH directives.
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveStartProc>(
+ ".seh_proc");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndProc>(
+ ".seh_endproc");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveStartChained>(
+ ".seh_startchained");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndChained>(
+ ".seh_endchained");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveHandler>(
+ ".seh_handler");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveHandlerData>(
+ ".seh_handlerdata");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectivePushReg>(
+ ".seh_pushreg");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSetFrame>(
+ ".seh_setframe");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveAllocStack>(
+ ".seh_stackalloc");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSaveReg>(
+ ".seh_savereg");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveSaveXMM>(
+ ".seh_savexmm");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectivePushFrame>(
+ ".seh_pushframe");
+ AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndProlog>(
+ ".seh_endprologue");
}
bool ParseSectionDirectiveText(StringRef, SMLoc) {
@@ -70,6 +101,23 @@ class COFFAsmParser : public MCAsmParserExtension {
bool ParseDirectiveType(StringRef, SMLoc);
bool ParseDirectiveEndef(StringRef, SMLoc);
+ // Win64 EH directives.
+ bool ParseSEHDirectiveStartProc(StringRef, SMLoc);
+ bool ParseSEHDirectiveEndProc(StringRef, SMLoc);
+ bool ParseSEHDirectiveStartChained(StringRef, SMLoc);
+ bool ParseSEHDirectiveEndChained(StringRef, SMLoc);
+ bool ParseSEHDirectiveHandler(StringRef, SMLoc);
+ bool ParseSEHDirectiveHandlerData(StringRef, SMLoc);
+ bool ParseSEHDirectivePushReg(StringRef, SMLoc);
+ bool ParseSEHDirectiveSetFrame(StringRef, SMLoc);
+ bool ParseSEHDirectiveAllocStack(StringRef, SMLoc);
+ bool ParseSEHDirectiveSaveReg(StringRef, SMLoc);
+ bool ParseSEHDirectiveSaveXMM(StringRef, SMLoc);
+ bool ParseSEHDirectivePushFrame(StringRef, SMLoc);
+ bool ParseSEHDirectiveEndProlog(StringRef, SMLoc);
+
+ bool ParseAtUnwindOrAtExcept(bool &unwind, bool &except);
+ bool ParseSEHRegisterNumber(unsigned &RegNo);
public:
COFFAsmParser() {}
};
@@ -135,6 +183,256 @@ bool COFFAsmParser::ParseDirectiveEndef(StringRef, SMLoc) {
return false;
}
+bool COFFAsmParser::ParseSEHDirectiveStartProc(StringRef, SMLoc) {
+ StringRef SymbolID;
+ if (getParser().ParseIdentifier(SymbolID))
+ return true;
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ MCSymbol *Symbol = getContext().GetOrCreateSymbol(SymbolID);
+
+ Lex();
+ getStreamer().EmitWin64EHStartProc(Symbol);
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveEndProc(StringRef, SMLoc) {
+ Lex();
+ getStreamer().EmitWin64EHEndProc();
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveStartChained(StringRef, SMLoc) {
+ Lex();
+ getStreamer().EmitWin64EHStartChained();
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveEndChained(StringRef, SMLoc) {
+ Lex();
+ getStreamer().EmitWin64EHEndChained();
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveHandler(StringRef, SMLoc) {
+ StringRef SymbolID;
+ if (getParser().ParseIdentifier(SymbolID))
+ return true;
+
+ if (getLexer().isNot(AsmToken::Comma))
+ return TokError("you must specify one or both of @unwind or @except");
+ Lex();
+ bool unwind = false, except = false;
+ if (ParseAtUnwindOrAtExcept(unwind, except))
+ return true;
+ if (getLexer().is(AsmToken::Comma)) {
+ Lex();
+ if (ParseAtUnwindOrAtExcept(unwind, except))
+ return true;
+ }
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ MCSymbol *handler = getContext().GetOrCreateSymbol(SymbolID);
+
+ Lex();
+ getStreamer().EmitWin64EHHandler(handler, unwind, except);
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveHandlerData(StringRef, SMLoc) {
+ Lex();
+ getStreamer().EmitWin64EHHandlerData();
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectivePushReg(StringRef, SMLoc L) {
+ unsigned Reg;
+ if (ParseSEHRegisterNumber(Reg))
+ return true;
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ Lex();
+ getStreamer().EmitWin64EHPushReg(Reg);
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveSetFrame(StringRef, SMLoc L) {
+ unsigned Reg;
+ int64_t Off;
+ if (ParseSEHRegisterNumber(Reg))
+ return true;
+ if (getLexer().isNot(AsmToken::Comma))
+ return TokError("you must specify a stack pointer offset");
+
+ Lex();
+ SMLoc startLoc = getLexer().getLoc();
+ if (getParser().ParseAbsoluteExpression(Off))
+ return true;
+
+ if (Off & 0x0F)
+ return Error(startLoc, "offset is not a multiple of 16");
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ Lex();
+ getStreamer().EmitWin64EHSetFrame(Reg, Off);
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveAllocStack(StringRef, SMLoc) {
+ int64_t Size;
+ SMLoc startLoc = getLexer().getLoc();
+ if (getParser().ParseAbsoluteExpression(Size))
+ return true;
+
+ if (Size & 7)
+ return Error(startLoc, "size is not a multiple of 8");
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ Lex();
+ getStreamer().EmitWin64EHAllocStack(Size);
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveSaveReg(StringRef, SMLoc L) {
+ unsigned Reg;
+ int64_t Off;
+ if (ParseSEHRegisterNumber(Reg))
+ return true;
+ if (getLexer().isNot(AsmToken::Comma))
+ return TokError("you must specify an offset on the stack");
+
+ Lex();
+ SMLoc startLoc = getLexer().getLoc();
+ if (getParser().ParseAbsoluteExpression(Off))
+ return true;
+
+ if (Off & 7)
+ return Error(startLoc, "size is not a multiple of 8");
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ Lex();
+ // FIXME: Err on %xmm* registers
+ getStreamer().EmitWin64EHSaveReg(Reg, Off);
+ return false;
+}
+
+// FIXME: This method is inherently x86-specific. It should really be in the
+// x86 backend.
+bool COFFAsmParser::ParseSEHDirectiveSaveXMM(StringRef, SMLoc L) {
+ unsigned Reg;
+ int64_t Off;
+ if (ParseSEHRegisterNumber(Reg))
+ return true;
+ if (getLexer().isNot(AsmToken::Comma))
+ return TokError("you must specify an offset on the stack");
+
+ Lex();
+ SMLoc startLoc = getLexer().getLoc();
+ if (getParser().ParseAbsoluteExpression(Off))
+ return true;
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ if (Off & 0x0F)
+ return Error(startLoc, "offset is not a multiple of 16");
+
+ Lex();
+ // FIXME: Err on non-%xmm* registers
+ getStreamer().EmitWin64EHSaveXMM(Reg, Off);
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectivePushFrame(StringRef, SMLoc) {
+ bool Code = false;
+ StringRef CodeID;
+ if (getLexer().is(AsmToken::At)) {
+ SMLoc startLoc = getLexer().getLoc();
+ Lex();
+ if (!getParser().ParseIdentifier(CodeID)) {
+ if (CodeID != "code")
+ return Error(startLoc, "expected @code");
+ Code = true;
+ }
+ }
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ Lex();
+ getStreamer().EmitWin64EHPushFrame(Code);
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHDirectiveEndProlog(StringRef, SMLoc) {
+ Lex();
+ getStreamer().EmitWin64EHEndProlog();
+ return false;
+}
+
+bool COFFAsmParser::ParseAtUnwindOrAtExcept(bool &unwind, bool &except) {
+ StringRef identifier;
+ if (getLexer().isNot(AsmToken::At))
+ return TokError("a handler attribute must begin with '@'");
+ SMLoc startLoc = getLexer().getLoc();
+ Lex();
+ if (getParser().ParseIdentifier(identifier))
+ return Error(startLoc, "expected @unwind or @except");
+ if (identifier == "unwind")
+ unwind = true;
+ else if (identifier == "except")
+ except = true;
+ else
+ return Error(startLoc, "expected @unwind or @except");
+ return false;
+}
+
+bool COFFAsmParser::ParseSEHRegisterNumber(unsigned &RegNo) {
+ SMLoc startLoc = getLexer().getLoc();
+ if (getLexer().is(AsmToken::Percent)) {
+ const TargetAsmInfo &asmInfo = getContext().getTargetAsmInfo();
+ SMLoc endLoc;
+ unsigned LLVMRegNo;
+ if (getParser().getTargetParser().ParseRegister(LLVMRegNo,startLoc,endLoc))
+ return true;
+
+ // Check that this is a non-volatile register.
+ const unsigned *NVRegs = asmInfo.getCalleeSavedRegs();
+ unsigned i;
+ for (i = 0; NVRegs[i] != 0; ++i)
+ if (NVRegs[i] == LLVMRegNo)
+ break;
+ if (NVRegs[i] == 0)
+ return Error(startLoc, "expected non-volatile register");
+
+ int SEHRegNo = asmInfo.getSEHRegNum(LLVMRegNo);
+ if (SEHRegNo < 0)
+ return Error(startLoc,"register can't be represented in SEH unwind info");
+ RegNo = SEHRegNo;
+ }
+ else {
+ int64_t n;
+ if (getParser().ParseAbsoluteExpression(n))
+ return true;
+ if (n > 15)
+ return Error(startLoc, "register number is too high");
+ RegNo = n;
+ }
+
+ return false;
+}
+
namespace llvm {
MCAsmParserExtension *createCOFFAsmParser() {
diff --git a/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp b/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
index 3c092cd..6f45068 100644
--- a/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
+++ b/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
@@ -369,11 +369,9 @@ bool DarwinAsmParser::ParseDirectiveDumpOrLoad(StringRef Directive,
// FIXME: If/when .dump and .load are implemented they will be done in the
// the assembly parser and not have any need for an MCStreamer API.
if (IsDump)
- Warning(IDLoc, "ignoring directive .dump for now");
+ return Warning(IDLoc, "ignoring directive .dump for now");
else
- Warning(IDLoc, "ignoring directive .load for now");
-
- return false;
+ return Warning(IDLoc, "ignoring directive .load for now");
}
/// ParseDirectiveLsym
diff --git a/contrib/llvm/lib/MC/MCStreamer.cpp b/contrib/llvm/lib/MC/MCStreamer.cpp
index fa245b1..ae3ed0f 100644
--- a/contrib/llvm/lib/MC/MCStreamer.cpp
+++ b/contrib/llvm/lib/MC/MCStreamer.cpp
@@ -15,17 +15,22 @@
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
#include <cstdlib>
using namespace llvm;
-MCStreamer::MCStreamer(MCContext &Ctx) : Context(Ctx) {
+MCStreamer::MCStreamer(MCContext &Ctx) : Context(Ctx), EmitEHFrame(true),
+ EmitDebugFrame(false),
+ CurrentW64UnwindInfo(0) {
const MCSection *section = NULL;
SectionStack.push_back(std::make_pair(section, section));
}
MCStreamer::~MCStreamer() {
+ for (unsigned i = 0; i < getNumW64UnwindInfos(); ++i)
+ delete W64UnwindInfos[i];
}
const MCExpr *MCStreamer::BuildSymbolDiff(MCContext &Context,
@@ -41,14 +46,14 @@ const MCExpr *MCStreamer::BuildSymbolDiff(MCContext &Context,
return AddrDelta;
}
-const MCExpr *MCStreamer::ForceExpAbs(MCStreamer *Streamer,
- MCContext &Context, const MCExpr* Expr) {
- if (Context.getAsmInfo().hasAggressiveSymbolFolding())
- return Expr;
+const MCExpr *MCStreamer::ForceExpAbs(const MCExpr* Expr) {
+ if (Context.getAsmInfo().hasAggressiveSymbolFolding() ||
+ isa<MCSymbolRefExpr>(Expr))
+ return Expr;
- MCSymbol *ABS = Context.CreateTempSymbol();
- Streamer->EmitAssignment(ABS, Expr);
- return MCSymbolRefExpr::Create(ABS, Context);
+ MCSymbol *ABS = Context.CreateTempSymbol();
+ EmitAssignment(ABS, Expr);
+ return MCSymbolRefExpr::Create(ABS, Context);
}
raw_ostream &MCStreamer::GetCommentOS() {
@@ -76,9 +81,11 @@ void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size,
assert((isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) &&
"Invalid size");
char buf[8];
- // FIXME: Endianness assumption.
- for (unsigned i = 0; i != Size; ++i)
- buf[i] = uint8_t(Value >> (i * 8));
+ const bool isLittleEndian = Context.getTargetAsmInfo().isLittleEndian();
+ for (unsigned i = 0; i != Size; ++i) {
+ unsigned index = isLittleEndian ? i : (Size - i - 1);
+ buf[i] = uint8_t(Value >> (index * 8));
+ }
EmitBytes(StringRef(buf, Size), AddrSpace);
}
@@ -102,13 +109,8 @@ void MCStreamer::EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace) {
void MCStreamer::EmitAbsValue(const MCExpr *Value, unsigned Size,
unsigned AddrSpace) {
- if (getContext().getAsmInfo().hasAggressiveSymbolFolding()) {
- EmitValue(Value, Size, AddrSpace);
- return;
- }
- MCSymbol *ABS = getContext().CreateTempSymbol();
- EmitAssignment(ABS, Value);
- EmitSymbolValue(ABS, Size, AddrSpace);
+ const MCExpr *ABS = ForceExpAbs(Value);
+ EmitValue(ABS, Size, AddrSpace);
}
@@ -176,6 +178,12 @@ void MCStreamer::EmitLabel(MCSymbol *Symbol) {
LastNonPrivate = Symbol;
}
+void MCStreamer::EmitCFISections(bool EH, bool Debug) {
+ assert(EH || Debug);
+ EmitEHFrame = EH;
+ EmitDebugFrame = Debug;
+}
+
void MCStreamer::EmitCFIStartProc() {
MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
if (CurFrame && !CurFrame->End)
@@ -303,6 +311,156 @@ void MCStreamer::EmitCFISameValue(int64_t Register) {
CurFrame->Instructions.push_back(Instruction);
}
+void MCStreamer::setCurrentW64UnwindInfo(MCWin64EHUnwindInfo *Frame) {
+ W64UnwindInfos.push_back(Frame);
+ CurrentW64UnwindInfo = W64UnwindInfos.back();
+}
+
+void MCStreamer::EnsureValidW64UnwindInfo() {
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ if (!CurFrame || CurFrame->End)
+ report_fatal_error("No open Win64 EH frame function!");
+}
+
+void MCStreamer::EmitWin64EHStartProc(const MCSymbol *Symbol) {
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ if (CurFrame && !CurFrame->End)
+ report_fatal_error("Starting a function before ending the previous one!");
+ MCWin64EHUnwindInfo *Frame = new MCWin64EHUnwindInfo;
+ Frame->Begin = getContext().CreateTempSymbol();
+ Frame->Function = Symbol;
+ EmitLabel(Frame->Begin);
+ setCurrentW64UnwindInfo(Frame);
+}
+
+void MCStreamer::EmitWin64EHEndProc() {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ if (CurFrame->ChainedParent)
+ report_fatal_error("Not all chained regions terminated!");
+ CurFrame->End = getContext().CreateTempSymbol();
+ EmitLabel(CurFrame->End);
+}
+
+void MCStreamer::EmitWin64EHStartChained() {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *Frame = new MCWin64EHUnwindInfo;
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ Frame->Begin = getContext().CreateTempSymbol();
+ Frame->Function = CurFrame->Function;
+ Frame->ChainedParent = CurFrame;
+ EmitLabel(Frame->Begin);
+ setCurrentW64UnwindInfo(Frame);
+}
+
+void MCStreamer::EmitWin64EHEndChained() {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ if (!CurFrame->ChainedParent)
+ report_fatal_error("End of a chained region outside a chained region!");
+ CurFrame->End = getContext().CreateTempSymbol();
+ EmitLabel(CurFrame->End);
+ CurrentW64UnwindInfo = CurFrame->ChainedParent;
+}
+
+void MCStreamer::EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
+ bool Except) {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ if (CurFrame->ChainedParent)
+ report_fatal_error("Chained unwind areas can't have handlers!");
+ CurFrame->ExceptionHandler = Sym;
+ if (!Except && !Unwind)
+ report_fatal_error("Don't know what kind of handler this is!");
+ if (Unwind)
+ CurFrame->HandlesUnwind = true;
+ if (Except)
+ CurFrame->HandlesExceptions = true;
+}
+
+void MCStreamer::EmitWin64EHHandlerData() {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ if (CurFrame->ChainedParent)
+ report_fatal_error("Chained unwind areas can't have handlers!");
+}
+
+void MCStreamer::EmitWin64EHPushReg(unsigned Register) {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ MCSymbol *Label = getContext().CreateTempSymbol();
+ MCWin64EHInstruction Inst(Win64EH::UOP_PushNonVol, Label, Register);
+ EmitLabel(Label);
+ CurFrame->Instructions.push_back(Inst);
+}
+
+void MCStreamer::EmitWin64EHSetFrame(unsigned Register, unsigned Offset) {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ if (CurFrame->LastFrameInst >= 0)
+ report_fatal_error("Frame register and offset already specified!");
+ if (Offset & 0x0F)
+ report_fatal_error("Misaligned frame pointer offset!");
+ MCWin64EHInstruction Inst(Win64EH::UOP_SetFPReg, NULL, Register, Offset);
+ CurFrame->LastFrameInst = CurFrame->Instructions.size();
+ CurFrame->Instructions.push_back(Inst);
+}
+
+void MCStreamer::EmitWin64EHAllocStack(unsigned Size) {
+ EnsureValidW64UnwindInfo();
+ if (Size & 7)
+ report_fatal_error("Misaligned stack allocation!");
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ MCSymbol *Label = getContext().CreateTempSymbol();
+ MCWin64EHInstruction Inst(Label, Size);
+ EmitLabel(Label);
+ CurFrame->Instructions.push_back(Inst);
+}
+
+void MCStreamer::EmitWin64EHSaveReg(unsigned Register, unsigned Offset) {
+ EnsureValidW64UnwindInfo();
+ if (Offset & 7)
+ report_fatal_error("Misaligned saved register offset!");
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ MCSymbol *Label = getContext().CreateTempSymbol();
+ MCWin64EHInstruction Inst(
+ Offset > 512*1024-8 ? Win64EH::UOP_SaveNonVolBig : Win64EH::UOP_SaveNonVol,
+ Label, Register, Offset);
+ EmitLabel(Label);
+ CurFrame->Instructions.push_back(Inst);
+}
+
+void MCStreamer::EmitWin64EHSaveXMM(unsigned Register, unsigned Offset) {
+ EnsureValidW64UnwindInfo();
+ if (Offset & 0x0F)
+ report_fatal_error("Misaligned saved vector register offset!");
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ MCSymbol *Label = getContext().CreateTempSymbol();
+ MCWin64EHInstruction Inst(
+ Offset > 512*1024-16 ? Win64EH::UOP_SaveXMM128Big : Win64EH::UOP_SaveXMM128,
+ Label, Register, Offset);
+ EmitLabel(Label);
+ CurFrame->Instructions.push_back(Inst);
+}
+
+void MCStreamer::EmitWin64EHPushFrame(bool Code) {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ if (CurFrame->Instructions.size() > 0)
+ report_fatal_error("If present, PushMachFrame must be the first UOP");
+ MCSymbol *Label = getContext().CreateTempSymbol();
+ MCWin64EHInstruction Inst(Win64EH::UOP_PushMachFrame, Label, Code);
+ EmitLabel(Label);
+ CurFrame->Instructions.push_back(Inst);
+}
+
+void MCStreamer::EmitWin64EHEndProlog() {
+ EnsureValidW64UnwindInfo();
+ MCWin64EHUnwindInfo *CurFrame = CurrentW64UnwindInfo;
+ CurFrame->PrologEnd = getContext().CreateTempSymbol();
+ EmitLabel(CurFrame->PrologEnd);
+}
+
void MCStreamer::EmitFnStart() {
errs() << "Not implemented yet\n";
abort();
@@ -357,3 +515,21 @@ void MCStreamer::EmitRawText(const Twine &T) {
T.toVector(Str);
EmitRawText(Str.str());
}
+
+void MCStreamer::EmitFrames(bool usingCFI) {
+ if (!getNumFrameInfos())
+ return;
+
+ if (EmitEHFrame)
+ MCDwarfFrameEmitter::Emit(*this, usingCFI, true);
+
+ if (EmitDebugFrame)
+ MCDwarfFrameEmitter::Emit(*this, usingCFI, false);
+}
+
+void MCStreamer::EmitW64Tables() {
+ if (!getNumW64UnwindInfos())
+ return;
+
+ MCWin64EHUnwindEmitter::Emit(*this);
+}
diff --git a/contrib/llvm/lib/MC/MCWin64EH.cpp b/contrib/llvm/lib/MC/MCWin64EH.cpp
new file mode 100644
index 0000000..9453f5c
--- /dev/null
+++ b/contrib/llvm/lib/MC/MCWin64EH.cpp
@@ -0,0 +1,258 @@
+//===- lib/MC/MCWin64EH.cpp - MCWin64EH implementation --------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/MC/MCWin64EH.h"
+#include "llvm/MC/MCStreamer.h"
+#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCSymbol.h"
+#include "llvm/MC/MCSectionCOFF.h"
+#include "llvm/MC/MCExpr.h"
+#include "llvm/Target/TargetAsmInfo.h"
+
+namespace llvm {
+
+// NOTE: All relocations generated here are 4-byte image-relative.
+
+static uint8_t CountOfUnwindCodes(std::vector<MCWin64EHInstruction> &instArray){
+ uint8_t count = 0;
+ for (std::vector<MCWin64EHInstruction>::const_iterator I = instArray.begin(),
+ E = instArray.end(); I != E; ++I) {
+ switch (I->getOperation()) {
+ case Win64EH::UOP_PushNonVol:
+ case Win64EH::UOP_AllocSmall:
+ case Win64EH::UOP_SetFPReg:
+ case Win64EH::UOP_PushMachFrame:
+ count += 1;
+ break;
+ case Win64EH::UOP_SaveNonVol:
+ case Win64EH::UOP_SaveXMM128:
+ count += 2;
+ break;
+ case Win64EH::UOP_SaveNonVolBig:
+ case Win64EH::UOP_SaveXMM128Big:
+ count += 3;
+ break;
+ case Win64EH::UOP_AllocLarge:
+ if (I->getSize() > 512*1024-8)
+ count += 3;
+ else
+ count += 2;
+ break;
+ }
+ }
+ return count;
+}
+
+static void EmitAbsDifference(MCStreamer &streamer, MCSymbol *lhs,
+ MCSymbol *rhs) {
+ MCContext &context = streamer.getContext();
+ const MCExpr *diff = MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(
+ lhs, context),
+ MCSymbolRefExpr::Create(
+ rhs, context),
+ context);
+ streamer.EmitAbsValue(diff, 1);
+
+}
+
+static void EmitUnwindCode(MCStreamer &streamer, MCSymbol *begin,
+ MCWin64EHInstruction &inst) {
+ uint8_t b1, b2;
+ uint16_t w;
+ b2 = (inst.getOperation() & 0x0F);
+ switch (inst.getOperation()) {
+ case Win64EH::UOP_PushNonVol:
+ EmitAbsDifference(streamer, inst.getLabel(), begin);
+ b2 |= (inst.getRegister() & 0x0F) << 4;
+ streamer.EmitIntValue(b2, 1);
+ break;
+ case Win64EH::UOP_AllocLarge:
+ EmitAbsDifference(streamer, inst.getLabel(), begin);
+ if (inst.getSize() > 512*1024-8) {
+ b2 |= 0x10;
+ streamer.EmitIntValue(b2, 1);
+ w = inst.getSize() & 0xFFF8;
+ streamer.EmitIntValue(w, 2);
+ w = inst.getSize() >> 16;
+ } else {
+ streamer.EmitIntValue(b2, 1);
+ w = inst.getSize() >> 3;
+ }
+ streamer.EmitIntValue(w, 2);
+ break;
+ case Win64EH::UOP_AllocSmall:
+ b2 |= (((inst.getSize()-8) >> 3) & 0x0F) << 4;
+ EmitAbsDifference(streamer, inst.getLabel(), begin);
+ streamer.EmitIntValue(b2, 1);
+ break;
+ case Win64EH::UOP_SetFPReg:
+ b1 = inst.getOffset() & 0xF0;
+ streamer.EmitIntValue(b1, 1);
+ streamer.EmitIntValue(b2, 1);
+ break;
+ case Win64EH::UOP_SaveNonVol:
+ case Win64EH::UOP_SaveXMM128:
+ b2 |= (inst.getRegister() & 0x0F) << 4;
+ EmitAbsDifference(streamer, inst.getLabel(), begin);
+ streamer.EmitIntValue(b2, 1);
+ w = inst.getOffset() >> 3;
+ if (inst.getOperation() == Win64EH::UOP_SaveXMM128)
+ w >>= 1;
+ streamer.EmitIntValue(w, 2);
+ break;
+ case Win64EH::UOP_SaveNonVolBig:
+ case Win64EH::UOP_SaveXMM128Big:
+ b2 |= (inst.getRegister() & 0x0F) << 4;
+ EmitAbsDifference(streamer, inst.getLabel(), begin);
+ streamer.EmitIntValue(b2, 1);
+ if (inst.getOperation() == Win64EH::UOP_SaveXMM128Big)
+ w = inst.getOffset() & 0xFFF0;
+ else
+ w = inst.getOffset() & 0xFFF8;
+ streamer.EmitIntValue(w, 2);
+ w = inst.getOffset() >> 16;
+ streamer.EmitIntValue(w, 2);
+ break;
+ case Win64EH::UOP_PushMachFrame:
+ if (inst.isPushCodeFrame())
+ b2 |= 0x10;
+ EmitAbsDifference(streamer, inst.getLabel(), begin);
+ streamer.EmitIntValue(b2, 1);
+ break;
+ }
+}
+
+static void EmitRuntimeFunction(MCStreamer &streamer,
+ const MCWin64EHUnwindInfo *info) {
+ MCContext &context = streamer.getContext();
+
+ streamer.EmitValueToAlignment(4);
+ streamer.EmitValue(MCSymbolRefExpr::Create(info->Begin, context), 4);
+ streamer.EmitValue(MCSymbolRefExpr::Create(info->End, context), 4);
+ streamer.EmitValue(MCSymbolRefExpr::Create(info->Symbol, context), 4);
+}
+
+static void EmitUnwindInfo(MCStreamer &streamer, MCWin64EHUnwindInfo *info) {
+ // If this UNWIND_INFO already has a symbol, it's already been emitted.
+ if (info->Symbol) return;
+
+ MCContext &context = streamer.getContext();
+ streamer.EmitValueToAlignment(4);
+ // Upper 3 bits are the version number (currently 1).
+ uint8_t flags = 0x01;
+ info->Symbol = context.CreateTempSymbol();
+ streamer.EmitLabel(info->Symbol);
+
+ if (info->ChainedParent)
+ flags |= Win64EH::UNW_ChainInfo << 3;
+ else {
+ if (info->HandlesUnwind)
+ flags |= Win64EH::UNW_TerminateHandler << 3;
+ if (info->HandlesExceptions)
+ flags |= Win64EH::UNW_ExceptionHandler << 3;
+ }
+ streamer.EmitIntValue(flags, 1);
+
+ if (info->PrologEnd)
+ EmitAbsDifference(streamer, info->PrologEnd, info->Begin);
+ else
+ streamer.EmitIntValue(0, 1);
+
+ uint8_t numCodes = CountOfUnwindCodes(info->Instructions);
+ streamer.EmitIntValue(numCodes, 1);
+
+ uint8_t frame = 0;
+ if (info->LastFrameInst >= 0) {
+ MCWin64EHInstruction &frameInst = info->Instructions[info->LastFrameInst];
+ assert(frameInst.getOperation() == Win64EH::UOP_SetFPReg);
+ frame = (frameInst.getRegister() & 0x0F) |
+ (frameInst.getOffset() & 0xF0);
+ }
+ streamer.EmitIntValue(frame, 1);
+
+ // Emit unwind instructions (in reverse order).
+ uint8_t numInst = info->Instructions.size();
+ for (uint8_t c = 0; c < numInst; ++c) {
+ MCWin64EHInstruction inst = info->Instructions.back();
+ info->Instructions.pop_back();
+ EmitUnwindCode(streamer, info->Begin, inst);
+ }
+
+ if (flags & (Win64EH::UNW_ChainInfo << 3))
+ EmitRuntimeFunction(streamer, info->ChainedParent);
+ else if (flags &
+ ((Win64EH::UNW_TerminateHandler|Win64EH::UNW_ExceptionHandler) << 3))
+ streamer.EmitValue(MCSymbolRefExpr::Create(info->ExceptionHandler, context),
+ 4);
+ else if (numCodes < 2) {
+ // The minimum size of an UNWIND_INFO struct is 8 bytes. If we're not
+ // a chained unwind info, if there is no handler, and if there are fewer
+ // than 2 slots used in the unwind code array, we have to pad to 8 bytes.
+ if (numCodes == 1)
+ streamer.EmitIntValue(0, 2);
+ else
+ streamer.EmitIntValue(0, 4);
+ }
+}
+
+StringRef MCWin64EHUnwindEmitter::GetSectionSuffix(const MCSymbol *func) {
+ if (!func || !func->isInSection()) return "";
+ const MCSection *section = &func->getSection();
+ const MCSectionCOFF *COFFSection;
+ if ((COFFSection = dyn_cast<MCSectionCOFF>(section))) {
+ StringRef name = COFFSection->getSectionName();
+ size_t dollar = name.find('$');
+ size_t dot = name.find('.', 1);
+ if (dollar == StringRef::npos && dot == StringRef::npos)
+ return "";
+ if (dot == StringRef::npos)
+ return name.substr(dollar);
+ if (dollar == StringRef::npos || dot < dollar)
+ return name.substr(dot);
+ return name.substr(dollar);
+ }
+ return "";
+}
+
+void MCWin64EHUnwindEmitter::EmitUnwindInfo(MCStreamer &streamer,
+ MCWin64EHUnwindInfo *info) {
+ // Switch sections (the static function above is meant to be called from
+ // here and from Emit().
+ MCContext &context = streamer.getContext();
+ const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
+ const MCSection *xdataSect =
+ asmInfo.getWin64EHTableSection(GetSectionSuffix(info->Function));
+ streamer.SwitchSection(xdataSect);
+
+ llvm::EmitUnwindInfo(streamer, info);
+}
+
+void MCWin64EHUnwindEmitter::Emit(MCStreamer &streamer) {
+ MCContext &context = streamer.getContext();
+ // Emit the unwind info structs first.
+ const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
+ for (unsigned i = 0; i < streamer.getNumW64UnwindInfos(); ++i) {
+ MCWin64EHUnwindInfo &info = streamer.getW64UnwindInfo(i);
+ const MCSection *xdataSect =
+ asmInfo.getWin64EHTableSection(GetSectionSuffix(info.Function));
+ streamer.SwitchSection(xdataSect);
+ llvm::EmitUnwindInfo(streamer, &info);
+ }
+ // Now emit RUNTIME_FUNCTION entries.
+ for (unsigned i = 0; i < streamer.getNumW64UnwindInfos(); ++i) {
+ MCWin64EHUnwindInfo &info = streamer.getW64UnwindInfo(i);
+ const MCSection *pdataSect =
+ asmInfo.getWin64EHFuncTableSection(GetSectionSuffix(info.Function));
+ streamer.SwitchSection(pdataSect);
+ EmitRuntimeFunction(streamer, &info);
+ }
+}
+
+} // End of namespace llvm
+
diff --git a/contrib/llvm/lib/MC/WinCOFFStreamer.cpp b/contrib/llvm/lib/MC/WinCOFFStreamer.cpp
index 46968e6..6c36c12 100644
--- a/contrib/llvm/lib/MC/WinCOFFStreamer.cpp
+++ b/contrib/llvm/lib/MC/WinCOFFStreamer.cpp
@@ -23,6 +23,7 @@
#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCSectionCOFF.h"
+#include "llvm/MC/MCWin64EH.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Target/TargetAsmBackend.h"
#include "llvm/ADT/StringMap.h"
@@ -74,6 +75,7 @@ public:
unsigned MaxBytesToEmit);
virtual void EmitFileDirective(StringRef Filename);
virtual void EmitInstruction(const MCInst &Instruction);
+ virtual void EmitWin64EHHandlerData();
virtual void Finish();
private:
@@ -377,7 +379,16 @@ void WinCOFFStreamer::EmitInstruction(const MCInst &Instruction) {
Fragment->getFixups());
}
+void WinCOFFStreamer::EmitWin64EHHandlerData() {
+ MCStreamer::EmitWin64EHHandlerData();
+
+ // We have to emit the unwind info now, because this directive
+ // actually switches to the .xdata section!
+ MCWin64EHUnwindEmitter::EmitUnwindInfo(*this, getCurrentW64UnwindInfo());
+}
+
void WinCOFFStreamer::Finish() {
+ EmitW64Tables();
MCObjectStreamer::Finish();
}
diff --git a/contrib/llvm/lib/Support/APInt.cpp b/contrib/llvm/lib/Support/APInt.cpp
index 23a22ac..74d61c1 100644
--- a/contrib/llvm/lib/Support/APInt.cpp
+++ b/contrib/llvm/lib/Support/APInt.cpp
@@ -1375,7 +1375,7 @@ APInt APInt::sqrt() const {
uint64_t(::round(::sqrt(double(isSingleWord()?VAL:pVal[0])))));
#else
return APInt(BitWidth,
- uint64_t(::sqrt(double(isSingleWord()?VAL:pVal[0]))) + 0.5);
+ uint64_t(::sqrt(double(isSingleWord()?VAL:pVal[0])) + 0.5));
#endif
}
diff --git a/contrib/llvm/lib/Support/BranchProbability.cpp b/contrib/llvm/lib/Support/BranchProbability.cpp
new file mode 100644
index 0000000..97342da
--- /dev/null
+++ b/contrib/llvm/lib/Support/BranchProbability.cpp
@@ -0,0 +1,44 @@
+//===-------------- lib/Support/BranchProbability.cpp -----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements Branch Probability class.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/BranchProbability.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm;
+
+BranchProbability::BranchProbability(uint32_t n, uint32_t d) {
+ assert(d > 0 && "Denomiator cannot be 0!");
+ assert(n <= d && "Probability cannot be bigger than 1!");
+ N = n;
+ D = d;
+}
+
+raw_ostream &BranchProbability::print(raw_ostream &OS) const {
+ OS << N << " / " << D << " = " << ((double)N / D);
+ return OS;
+}
+
+void BranchProbability::dump() const {
+ print(dbgs());
+ dbgs() << "\n";
+}
+
+namespace llvm {
+
+raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob) {
+ Prob.print(OS);
+ return OS;
+}
+
+}
diff --git a/contrib/llvm/lib/Support/Dwarf.cpp b/contrib/llvm/lib/Support/Dwarf.cpp
index 74a9fda..0813321 100644
--- a/contrib/llvm/lib/Support/Dwarf.cpp
+++ b/contrib/llvm/lib/Support/Dwarf.cpp
@@ -207,6 +207,7 @@ const char *llvm::dwarf::AttributeString(unsigned Attribute) {
case DW_AT_APPLE_property_getter: return "DW_AT_APPLE_property_getter";
case DW_AT_APPLE_property_setter: return "DW_AT_APPLE_property_setter";
case DW_AT_APPLE_property_attribute: return "DW_AT_APPLE_property_attribute";
+ case DW_AT_APPLE_objc_complete_type: return "DW_AT_APPLE_objc_complete_type";
}
return 0;
}
diff --git a/contrib/llvm/lib/Support/FoldingSet.cpp b/contrib/llvm/lib/Support/FoldingSet.cpp
index d2e35b8..1568342 100644
--- a/contrib/llvm/lib/Support/FoldingSet.cpp
+++ b/contrib/llvm/lib/Support/FoldingSet.cpp
@@ -92,7 +92,7 @@ void FoldingSetNodeID::AddInteger(long long I) {
}
void FoldingSetNodeID::AddInteger(unsigned long long I) {
AddInteger(unsigned(I));
- if ((uint64_t)(int)I != I)
+ if ((uint64_t)(unsigned)I != I)
Bits.push_back(unsigned(I >> 32));
}
diff --git a/contrib/llvm/lib/Support/Host.cpp b/contrib/llvm/lib/Support/Host.cpp
index 911c64a..4299aa4 100644
--- a/contrib/llvm/lib/Support/Host.cpp
+++ b/contrib/llvm/lib/Support/Host.cpp
@@ -215,7 +215,8 @@ std::string sys::getHostCPUName() {
case 37: // Intel Core i7, laptop version.
return "corei7";
case 42: // SandyBridge
- return "sandybridge";
+ case 45:
+ return "corei7-avx";
case 28: // Intel Atom processor. All processors are manufactured using
// the 45 nm process
diff --git a/contrib/llvm/lib/Support/MemoryBuffer.cpp b/contrib/llvm/lib/Support/MemoryBuffer.cpp
index e2b5b7a..d264be9 100644
--- a/contrib/llvm/lib/Support/MemoryBuffer.cpp
+++ b/contrib/llvm/lib/Support/MemoryBuffer.cpp
@@ -67,7 +67,7 @@ static void CopyStringRef(char *Memory, StringRef Data) {
/// GetNamedBuffer - Allocates a new MemoryBuffer with Name copied after it.
template <typename T>
-static T* GetNamedBuffer(StringRef Buffer, StringRef Name,
+static T *GetNamedBuffer(StringRef Buffer, StringRef Name,
bool RequiresNullTerminator) {
char *Mem = static_cast<char*>(operator new(sizeof(T) + Name.size() + 1));
CopyStringRef(Mem + sizeof(T), Name);
@@ -94,7 +94,7 @@ public:
}
/// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note
-/// that EndPtr[0] must be a null byte and be accessible!
+/// that InputData must be a null terminated if RequiresNullTerminator is true!
MemoryBuffer *MemoryBuffer::getMemBuffer(StringRef InputData,
StringRef BufferName,
bool RequiresNullTerminator) {
@@ -221,9 +221,9 @@ error_code MemoryBuffer::getFile(const char *Filename,
OpenFlags |= O_BINARY; // Open input file in binary mode on win32.
#endif
int FD = ::open(Filename, OpenFlags);
- if (FD == -1) {
+ if (FD == -1)
return error_code(errno, posix_category());
- }
+
error_code ret = getOpenFile(FD, Filename, result, FileSize, FileSize,
0, RequiresNullTerminator);
close(FD);
diff --git a/contrib/llvm/lib/Support/SourceMgr.cpp b/contrib/llvm/lib/Support/SourceMgr.cpp
index ef09916..de042a9f 100644
--- a/contrib/llvm/lib/Support/SourceMgr.cpp
+++ b/contrib/llvm/lib/Support/SourceMgr.cpp
@@ -49,14 +49,16 @@ SourceMgr::~SourceMgr() {
/// directory or in one of the IncludeDirs. If no file is found, this returns
/// ~0, otherwise it returns the buffer ID of the stacked file.
unsigned SourceMgr::AddIncludeFile(const std::string &Filename,
- SMLoc IncludeLoc) {
+ SMLoc IncludeLoc,
+ std::string &IncludedFile) {
OwningPtr<MemoryBuffer> NewBuf;
- MemoryBuffer::getFile(Filename.c_str(), NewBuf);
+ IncludedFile = Filename;
+ MemoryBuffer::getFile(IncludedFile.c_str(), NewBuf);
// If the file didn't exist directly, see if it's in an include path.
for (unsigned i = 0, e = IncludeDirectories.size(); i != e && !NewBuf; ++i) {
- std::string IncFile = IncludeDirectories[i] + "/" + Filename;
- MemoryBuffer::getFile(IncFile.c_str(), NewBuf);
+ IncludedFile = IncludeDirectories[i] + "/" + Filename;
+ MemoryBuffer::getFile(IncludedFile.c_str(), NewBuf);
}
if (NewBuf == 0) return ~0U;
diff --git a/contrib/llvm/lib/Support/Unix/Host.inc b/contrib/llvm/lib/Support/Unix/Host.inc
index 9c75230..eacb08b 100644
--- a/contrib/llvm/lib/Support/Unix/Host.inc
+++ b/contrib/llvm/lib/Support/Unix/Host.inc
@@ -47,35 +47,6 @@ std::string sys::getHostTriple() {
// Normalize the arch, since the host triple may not actually match the host.
std::string Arch = ArchSplit.first;
- // It would be nice to do this in terms of llvm::Triple, but that is in
- // Support which is layered above us.
-#if defined(__x86_64__)
- Arch = "x86_64";
-#elif defined(__i386__)
- Arch = "i386";
-#elif defined(__ppc64__)
- Arch = "powerpc64";
-#elif defined(__ppc__)
- Arch = "powerpc";
-#elif defined(__arm__)
-
- // FIXME: We need to pick the right ARM triple (which involves querying the
- // chip). However, for now this is most important for LLVM arch selection, so
- // we only need to make sure to distinguish ARM and Thumb.
-# if defined(__thumb__)
- Arch = "thumb";
-# else
- Arch = "arm";
-# endif
-
-#else
-
- // FIXME: When enough auto-detection is in place, this should just
- // #error. Then at least the arch selection is done, and we only need the OS
- // etc selection to kill off the use of LLVM_HOSTTRIPLE.
-
-#endif
-
std::string Triple(Arch);
Triple += '-';
Triple += ArchSplit.second;
diff --git a/contrib/llvm/lib/Support/Unix/Program.inc b/contrib/llvm/lib/Support/Unix/Program.inc
index 9f0a9ef..346baf1 100644
--- a/contrib/llvm/lib/Support/Unix/Program.inc
+++ b/contrib/llvm/lib/Support/Unix/Program.inc
@@ -338,7 +338,7 @@ Program::Wait(const sys::Path &path,
else
MakeErrMsg(ErrMsg, "Child timed out", 0);
- return -1; // Timeout detected
+ return -2; // Timeout detected
} else if (errno != EINTR) {
MakeErrMsg(ErrMsg, "Error waiting for child process");
return -1;
@@ -382,7 +382,9 @@ Program::Wait(const sys::Path &path,
*ErrMsg += " (core dumped)";
#endif
}
- return -1;
+ // Return a special value to indicate that the process received an unhandled
+ // signal during execution as opposed to failing to execute.
+ return -2;
}
return result;
#else
diff --git a/contrib/llvm/lib/Support/Windows/Program.inc b/contrib/llvm/lib/Support/Windows/Program.inc
index 350363c..e486e6e 100644
--- a/contrib/llvm/lib/Support/Windows/Program.inc
+++ b/contrib/llvm/lib/Support/Windows/Program.inc
@@ -349,7 +349,8 @@ Program::Wait(const Path &path,
if (WaitForSingleObject(hProcess, millisecondsToWait) == WAIT_TIMEOUT) {
if (!TerminateProcess(hProcess, 1)) {
MakeErrMsg(ErrMsg, "Failed to terminate timed-out program.");
- return -1;
+ // -2 indicates a crash or timeout as opposed to failure to execute.
+ return -2;
}
WaitForSingleObject(hProcess, INFINITE);
}
@@ -362,7 +363,8 @@ Program::Wait(const Path &path,
if (!rc) {
SetLastError(err);
MakeErrMsg(ErrMsg, "Failed getting status for program.");
- return -1;
+ // -2 indicates a crash or timeout as opposed to failure to execute.
+ return -2;
}
return status;
diff --git a/contrib/llvm/lib/Target/ARM/ARMAsmBackend.cpp b/contrib/llvm/lib/Target/ARM/ARMAsmBackend.cpp
index f062819..618a2b5 100644
--- a/contrib/llvm/lib/Target/ARM/ARMAsmBackend.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMAsmBackend.cpp
@@ -76,7 +76,7 @@ public:
{ "fixup_arm_thumb_blx", 7, 21, MCFixupKindInfo::FKF_IsPCRel },
{ "fixup_arm_thumb_cb", 0, 16, MCFixupKindInfo::FKF_IsPCRel },
{ "fixup_arm_thumb_cp", 1, 8, MCFixupKindInfo::FKF_IsPCRel },
-{ "fixup_arm_thumb_bcc", 1, 8, MCFixupKindInfo::FKF_IsPCRel },
+{ "fixup_arm_thumb_bcc", 0, 8, MCFixupKindInfo::FKF_IsPCRel },
// movw / movt: 16-bits immediate but scattered into two chunks 0 - 12, 16 - 19.
{ "fixup_arm_movt_hi16", 0, 20, 0 },
{ "fixup_arm_movw_lo16", 0, 20, 0 },
@@ -164,23 +164,25 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
case FK_Data_4:
return Value;
case ARM::fixup_arm_movt_hi16:
- case ARM::fixup_arm_movt_hi16_pcrel:
Value >>= 16;
// Fallthrough
case ARM::fixup_arm_movw_lo16:
+ case ARM::fixup_arm_movt_hi16_pcrel:
case ARM::fixup_arm_movw_lo16_pcrel: {
unsigned Hi4 = (Value & 0xF000) >> 12;
unsigned Lo12 = Value & 0x0FFF;
+ assert ((((int64_t)Value) >= -0x8000) && (((int64_t)Value) <= 0x7fff) &&
+ "Out of range pc-relative fixup value!");
// inst{19-16} = Hi4;
// inst{11-0} = Lo12;
Value = (Hi4 << 16) | (Lo12);
return Value;
}
case ARM::fixup_t2_movt_hi16:
- case ARM::fixup_t2_movt_hi16_pcrel:
Value >>= 16;
// Fallthrough
case ARM::fixup_t2_movw_lo16:
+ case ARM::fixup_t2_movt_hi16_pcrel:
case ARM::fixup_t2_movw_lo16_pcrel: {
unsigned Hi4 = (Value & 0xF000) >> 12;
unsigned i = (Value & 0x800) >> 11;
@@ -190,8 +192,9 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
// inst{26} = i;
// inst{14-12} = Mid3;
// inst{7-0} = Lo8;
+ assert ((((int64_t)Value) >= -0x8000) && (((int64_t)Value) <= 0x7fff) &&
+ "Out of range pc-relative fixup value!");
Value = (Hi4 << 16) | (i << 26) | (Mid3 << 12) | (Lo8);
-
uint64_t swapped = (Value & 0xFFFF0000) >> 16;
swapped |= (Value & 0x0000FFFF) << 16;
return swapped;
@@ -305,7 +308,7 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
//
// Note that the halfwords are stored high first, low second; so we need
// to transpose the fixup value here to map properly.
- unsigned isNeg = (int64_t(Value) < 0) ? 1 : 0;
+ unsigned isNeg = (int64_t(Value - 4) < 0) ? 1 : 0;
uint32_t Binary = 0;
Value = 0x3fffff & ((Value - 4) >> 1);
Binary = (Value & 0x7ff) << 16; // Low imm11 value.
@@ -323,7 +326,7 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t Value) {
//
// Note that the halfwords are stored high first, low second; so we need
// to transpose the fixup value here to map properly.
- unsigned isNeg = (int64_t(Value) < 0) ? 1 : 0;
+ unsigned isNeg = (int64_t(Value-4) < 0) ? 1 : 0;
uint32_t Binary = 0;
Value = 0xfffff & ((Value - 2) >> 2);
Binary = (Value & 0x3ff) << 17; // Low imm10L value.
@@ -404,7 +407,6 @@ void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, char *Data,
if (!Value) return; // Doesn't change encoding.
unsigned Offset = Fixup.getOffset();
- assert(Offset % NumBytes == 0 && "Offset mod NumBytes is nonzero!");
// For each byte of the fragment that the fixup touches, mask in the bits from
// the fixup value. The Value has been "split up" into the appropriate
diff --git a/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index c428e18..eb73902 100644
--- a/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -172,47 +172,6 @@ getDebugValueLocation(const MachineInstr *MI) const {
return Location;
}
-/// getDwarfRegOpSize - get size required to emit given machine location using
-/// dwarf encoding.
-unsigned ARMAsmPrinter::getDwarfRegOpSize(const MachineLocation &MLoc) const {
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- if (RI->getDwarfRegNum(MLoc.getReg(), false) != -1)
- return AsmPrinter::getDwarfRegOpSize(MLoc);
- else {
- unsigned Reg = MLoc.getReg();
- if (Reg >= ARM::S0 && Reg <= ARM::S31) {
- assert(ARM::S0 + 31 == ARM::S31 && "Unexpected ARM S register numbering");
- // S registers are described as bit-pieces of a register
- // S[2x] = DW_OP_regx(256 + (x>>1)) DW_OP_bit_piece(32, 0)
- // S[2x+1] = DW_OP_regx(256 + (x>>1)) DW_OP_bit_piece(32, 32)
-
- unsigned SReg = Reg - ARM::S0;
- unsigned Rx = 256 + (SReg >> 1);
- OutStreamer.AddComment("Loc expr size");
- // DW_OP_regx + ULEB + DW_OP_bit_piece + ULEB + ULEB
- // 1 + ULEB(Rx) + 1 + 1 + 1
- return 4 + MCAsmInfo::getULEB128Size(Rx);
- }
-
- if (Reg >= ARM::Q0 && Reg <= ARM::Q15) {
- assert(ARM::Q0 + 15 == ARM::Q15 && "Unexpected ARM Q register numbering");
- // Q registers Q0-Q15 are described by composing two D registers together.
- // Qx = DW_OP_regx(256+2x) DW_OP_piece(8) DW_OP_regx(256+2x+1) DW_OP_piece(8)
-
- unsigned QReg = Reg - ARM::Q0;
- unsigned D1 = 256 + 2 * QReg;
- unsigned D2 = D1 + 1;
-
- OutStreamer.AddComment("Loc expr size");
- // DW_OP_regx + ULEB + DW_OP_piece + ULEB(8) +
- // DW_OP_regx + ULEB + DW_OP_piece + ULEB(8);
- // 6 + ULEB(D1) + ULEB(D2)
- return 6 + MCAsmInfo::getULEB128Size(D1) + MCAsmInfo::getULEB128Size(D2);
- }
- }
- return 0;
-}
-
/// EmitDwarfRegOp - Emit dwarf register operation.
void ARMAsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc) const {
const TargetRegisterInfo *RI = TM.getRegisterInfo();
@@ -229,10 +188,6 @@ void ARMAsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc) const {
unsigned SReg = Reg - ARM::S0;
bool odd = SReg & 0x1;
unsigned Rx = 256 + (SReg >> 1);
- OutStreamer.AddComment("Loc expr size");
- // DW_OP_regx + ULEB + DW_OP_bit_piece + ULEB + ULEB
- // 1 + ULEB(Rx) + 1 + 1 + 1
- EmitInt16(4 + MCAsmInfo::getULEB128Size(Rx));
OutStreamer.AddComment("DW_OP_regx for S register");
EmitInt8(dwarf::DW_OP_regx);
@@ -260,12 +215,6 @@ void ARMAsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc) const {
unsigned D1 = 256 + 2 * QReg;
unsigned D2 = D1 + 1;
- OutStreamer.AddComment("Loc expr size");
- // DW_OP_regx + ULEB + DW_OP_piece + ULEB(8) +
- // DW_OP_regx + ULEB + DW_OP_piece + ULEB(8);
- // 6 + ULEB(D1) + ULEB(D2)
- EmitInt16(6 + MCAsmInfo::getULEB128Size(D1) + MCAsmInfo::getULEB128Size(D2));
-
OutStreamer.AddComment("DW_OP_regx for Q register: D1");
EmitInt8(dwarf::DW_OP_regx);
EmitULEB128(D1);
@@ -286,7 +235,7 @@ void ARMAsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc) const {
void ARMAsmPrinter::EmitFunctionEntryLabel() {
if (AFI->isThumbFunction()) {
OutStreamer.EmitAssemblerFlag(MCAF_Code16);
- OutStreamer.EmitThumbFunc(Subtarget->isTargetDarwin()? CurrentFnSym : 0);
+ OutStreamer.EmitThumbFunc(CurrentFnSym);
}
OutStreamer.EmitLabel(CurrentFnSym);
@@ -416,10 +365,63 @@ bool ARMAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
case 'q': // Print a NEON quad precision register.
printOperand(MI, OpNum, O);
return false;
- case 'Q':
- case 'R':
- case 'H':
- // These modifiers are not yet supported.
+ case 'y': // Print a VFP single precision register as indexed double.
+ // This uses the ordering of the alias table to get the first 'd' register
+ // that overlaps the 's' register. Also, s0 is an odd register, hence the
+ // odd modulus check below.
+ if (MI->getOperand(OpNum).isReg()) {
+ unsigned Reg = MI->getOperand(OpNum).getReg();
+ const TargetRegisterInfo *TRI = MF->getTarget().getRegisterInfo();
+ O << ARMInstPrinter::getRegisterName(TRI->getAliasSet(Reg)[0]) <<
+ (((Reg % 2) == 1) ? "[0]" : "[1]");
+ return false;
+ }
+ return true;
+ case 'B': // Bitwise inverse of integer or symbol without a preceding #.
+ if (!MI->getOperand(OpNum).isImm())
+ return true;
+ O << ~(MI->getOperand(OpNum).getImm());
+ return false;
+ case 'L': // The low 16 bits of an immediate constant.
+ if (!MI->getOperand(OpNum).isImm())
+ return true;
+ O << (MI->getOperand(OpNum).getImm() & 0xffff);
+ return false;
+ case 'M': { // A register range suitable for LDM/STM.
+ if (!MI->getOperand(OpNum).isReg())
+ return true;
+ const MachineOperand &MO = MI->getOperand(OpNum);
+ unsigned RegBegin = MO.getReg();
+ // This takes advantage of the 2 operand-ness of ldm/stm and that we've
+ // already got the operands in registers that are operands to the
+ // inline asm statement.
+
+ O << "{" << ARMInstPrinter::getRegisterName(RegBegin);
+
+ // FIXME: The register allocator not only may not have given us the
+ // registers in sequence, but may not be in ascending registers. This
+ // will require changes in the register allocator that'll need to be
+ // propagated down here if the operands change.
+ unsigned RegOps = OpNum + 1;
+ while (MI->getOperand(RegOps).isReg()) {
+ O << ", "
+ << ARMInstPrinter::getRegisterName(MI->getOperand(RegOps).getReg());
+ RegOps++;
+ }
+
+ O << "}";
+
+ return false;
+ }
+ // These modifiers are not yet supported.
+ case 'p': // The high single-precision register of a VFP double-precision
+ // register.
+ case 'e': // The low doubleword register of a NEON quad register.
+ case 'f': // The high doubleword register of a NEON quad register.
+ case 'h': // A range of VFP/NEON registers suitable for VLD1/VST1.
+ case 'Q': // The least significant register of a pair.
+ case 'R': // The most significant register of a pair.
+ case 'H': // The highest-numbered register of a pair.
return true;
}
}
@@ -432,9 +434,21 @@ bool ARMAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
unsigned OpNum, unsigned AsmVariant,
const char *ExtraCode,
raw_ostream &O) {
- if (ExtraCode && ExtraCode[0])
- return true; // Unknown modifier.
-
+ // Does this asm operand have a single letter operand modifier?
+ if (ExtraCode && ExtraCode[0]) {
+ if (ExtraCode[1] != 0) return true; // Unknown modifier.
+
+ switch (ExtraCode[0]) {
+ case 'A': // A memory operand for a VLD1/VST1 instruction.
+ default: return true; // Unknown modifier.
+ case 'm': // The base register of a memory operand.
+ if (!MI->getOperand(OpNum).isReg())
+ return true;
+ O << ARMInstPrinter::getRegisterName(MI->getOperand(OpNum).getReg());
+ return false;
+ }
+ }
+
const MachineOperand &MO = MI->getOperand(OpNum);
assert(MO.isReg() && "unexpected inline asm memory operand");
O << "[" << ARMInstPrinter::getRegisterName(MO.getReg()) << "]";
@@ -600,6 +614,12 @@ void ARMAsmPrinter::emitAttributes() {
//
/// ADD additional Else-cases here!
+ } else if (CPUString == "xscale") {
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v5TEJ);
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::ARM_ISA_use,
+ ARMBuildAttrs::Allowed);
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::THUMB_ISA_use,
+ ARMBuildAttrs::Allowed);
} else if (CPUString == "generic") {
// FIXME: Why these defaults?
AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v4T);
@@ -1188,6 +1208,26 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
}
return;
}
+ case ARM::tBXr9_CALL:
+ case ARM::tBX_CALL: {
+ {
+ MCInst TmpInst;
+ TmpInst.setOpcode(ARM::tMOVr);
+ TmpInst.addOperand(MCOperand::CreateReg(ARM::LR));
+ TmpInst.addOperand(MCOperand::CreateReg(ARM::PC));
+ OutStreamer.EmitInstruction(TmpInst);
+ }
+ {
+ MCInst TmpInst;
+ TmpInst.setOpcode(ARM::tBX);
+ TmpInst.addOperand(MCOperand::CreateReg(MI->getOperand(0).getReg()));
+ // Add predicate operands.
+ TmpInst.addOperand(MCOperand::CreateImm(ARMCC::AL));
+ TmpInst.addOperand(MCOperand::CreateReg(0));
+ OutStreamer.EmitInstruction(TmpInst);
+ }
+ return;
+ }
case ARM::BMOVPCRXr9_CALL:
case ARM::BMOVPCRX_CALL: {
{
@@ -1809,7 +1849,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
}
{
MCInst TmpInst;
- TmpInst.setOpcode(ARM::tBX_RET_vararg);
+ TmpInst.setOpcode(ARM::tBX);
TmpInst.addOperand(MCOperand::CreateReg(ScratchReg));
// Predicate.
TmpInst.addOperand(MCOperand::CreateImm(ARMCC::AL));
@@ -1838,7 +1878,9 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
case ARM::tTAILJMPdND: {
MCInst TmpInst, TmpInst2;
LowerARMMachineInstrToMCInst(MI, TmpInst2, *this);
- TmpInst.setOpcode(ARM::tB);
+ // The Darwin toolchain doesn't support tail call relocations of 16-bit
+ // branches.
+ TmpInst.setOpcode(Opc == ARM::tTAILJMPd ? ARM::t2B : ARM::tB);
TmpInst.addOperand(TmpInst2.getOperand(0));
OutStreamer.AddComment("TAILCALL");
OutStreamer.EmitInstruction(TmpInst);
diff --git a/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h b/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h
index 1ee1b70..5f9169e 100644
--- a/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h
+++ b/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h
@@ -89,10 +89,6 @@ public:
MachineLocation getDebugValueLocation(const MachineInstr *MI) const;
- /// getDwarfRegOpSize - get size required to emit given machine location
- /// using dwarf encoding.
- virtual unsigned getDwarfRegOpSize(const MachineLocation &MLoc) const;
-
/// EmitDwarfRegOp - Emit dwarf register operation.
virtual void EmitDwarfRegOp(const MachineLocation &MLoc) const;
diff --git a/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index ea1f08a..4ab37f6 100644
--- a/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -684,6 +684,10 @@ int ARMBaseRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
return ARMGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
+int ARMBaseRegisterInfo::getLLVMRegNum(unsigned DwarfRegNo, bool isEH) const {
+ return ARMGenRegisterInfo::getLLVMRegNumFull(DwarfRegNo,0);
+}
+
unsigned ARMBaseRegisterInfo::getRegisterPairEven(unsigned Reg,
const MachineFunction &MF) const {
switch (Reg) {
@@ -1111,8 +1115,11 @@ materializeFrameBaseRegister(MachineBasicBlock *MBB,
if (Ins != MBB->end())
DL = Ins->getDebugLoc();
- MachineInstrBuilder MIB =
- BuildMI(*MBB, Ins, DL, TII.get(ADDriOpc), BaseReg)
+ const TargetInstrDesc &TID = TII.get(ADDriOpc);
+ MachineRegisterInfo &MRI = MBB->getParent()->getRegInfo();
+ MRI.constrainRegClass(BaseReg, TID.OpInfo[0].getRegClass(this));
+
+ MachineInstrBuilder MIB = BuildMI(*MBB, Ins, DL, TID, BaseReg)
.addFrameIndex(FrameIdx).addImm(Offset);
if (!AFI->isThumb1OnlyFunction())
diff --git a/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h b/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h
index 9edf72d..c60d75a 100644
--- a/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h
+++ b/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h
@@ -172,6 +172,7 @@ public:
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
bool isLowRegister(unsigned Reg) const;
diff --git a/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp b/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp
index fa73716..16d4ca5 100644
--- a/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp
@@ -221,6 +221,9 @@ namespace {
const { return 0; }
unsigned getAddrMode6AddressOpValue(const MachineInstr &MI, unsigned Op)
const { return 0; }
+ unsigned getAddrMode6OneLane32AddressOpValue(const MachineInstr &MI,
+ unsigned Op)
+ const { return 0; }
unsigned getAddrMode6DupAddressOpValue(const MachineInstr &MI, unsigned Op)
const { return 0; }
unsigned getAddrMode6OffsetOpValue(const MachineInstr &MI, unsigned Op)
@@ -229,6 +232,8 @@ namespace {
unsigned Op) const { return 0; }
unsigned getMsbOpValue(const MachineInstr &MI,
unsigned Op) const { return 0; }
+ unsigned getSsatBitPosValue(const MachineInstr &MI,
+ unsigned Op) const { return 0; }
uint32_t getLdStmModeOpValue(const MachineInstr &MI, unsigned OpIdx)
const {return 0; }
uint32_t getLdStSORegOpValue(const MachineInstr &MI, unsigned OpIdx)
@@ -1372,6 +1377,12 @@ void ARMCodeEmitter::emitMiscArithInstruction(const MachineInstr &MI) {
// Set the conditional execution predicate
Binary |= II->getPredicate(&MI) << ARMII::CondShift;
+ // PKH instructions are finished at this point
+ if (TID.Opcode == ARM::PKHBT || TID.Opcode == ARM::PKHTB) {
+ emitWordLE(Binary);
+ return;
+ }
+
unsigned OpIdx = 0;
// Encode Rd
diff --git a/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp b/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp
index 3baf274..5cf73c4 100644
--- a/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp
@@ -71,12 +71,10 @@ namespace {
} Base;
int Offset;
- unsigned Scale;
- unsigned PlusReg;
// Innocuous defaults for our address.
Address()
- : BaseType(RegBase), Offset(0), Scale(0), PlusReg(0) {
+ : BaseType(RegBase), Offset(0) {
Base.Reg = 0;
}
} Address;
@@ -169,6 +167,7 @@ class ARMFastISel : public FastISel {
bool SelectCall(const Instruction *I);
bool SelectSelect(const Instruction *I);
bool SelectRet(const Instruction *I);
+ bool SelectIntCast(const Instruction *I);
// Utility routines.
private:
@@ -208,7 +207,8 @@ class ARMFastISel : public FastISel {
bool DefinesOptionalPredicate(MachineInstr *MI, bool *CPSR);
const MachineInstrBuilder &AddOptionalDefs(const MachineInstrBuilder &MIB);
void AddLoadStoreOperands(EVT VT, Address &Addr,
- const MachineInstrBuilder &MIB);
+ const MachineInstrBuilder &MIB,
+ unsigned Flags);
};
} // end anonymous namespace
@@ -443,14 +443,14 @@ unsigned ARMFastISel::FastEmitInst_ii(unsigned MachineInstOpcode,
uint64_t Imm1, uint64_t Imm2) {
unsigned ResultReg = createResultReg(RC);
const TargetInstrDesc &II = TII.get(MachineInstOpcode);
-
+
if (II.getNumDefs() >= 1)
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II, ResultReg)
.addImm(Imm1).addImm(Imm2));
else {
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, II)
.addImm(Imm1).addImm(Imm2));
- AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
+ AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(TargetOpcode::COPY),
ResultReg)
.addReg(II.ImplicitDefs[0]));
@@ -577,9 +577,6 @@ unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, EVT VT) {
Reloc::Model RelocM = TM.getRelocationModel();
- // TODO: No external globals for now.
- if (Subtarget->GVIsIndirectSymbol(GV, RelocM)) return 0;
-
// TODO: Need more magic for ARM PIC.
if (!isThumb && (RelocM == Reloc::PIC_)) return 0;
@@ -614,6 +611,23 @@ unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, EVT VT) {
.addImm(0);
}
AddOptionalDefs(MIB);
+
+ if (Subtarget->GVIsIndirectSymbol(GV, RelocM)) {
+ unsigned NewDestReg = createResultReg(TLI.getRegClassFor(VT));
+ if (isThumb)
+ MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(ARM::t2LDRi12),
+ NewDestReg)
+ .addReg(DestReg)
+ .addImm(0);
+ else
+ MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(ARM::LDRi12),
+ NewDestReg)
+ .addReg(DestReg)
+ .addImm(0);
+ DestReg = NewDestReg;
+ AddOptionalDefs(MIB);
+ }
+
return DestReg;
}
@@ -853,7 +867,8 @@ void ARMFastISel::ARMSimplifyAddress(Address &Addr, EVT VT) {
}
void ARMFastISel::AddLoadStoreOperands(EVT VT, Address &Addr,
- const MachineInstrBuilder &MIB) {
+ const MachineInstrBuilder &MIB,
+ unsigned Flags) {
// addrmode5 output depends on the selection dag addressing dividing the
// offset by 4 that it then later multiplies. Do this here as well.
if (VT.getSimpleVT().SimpleTy == MVT::f32 ||
@@ -867,7 +882,7 @@ void ARMFastISel::AddLoadStoreOperands(EVT VT, Address &Addr,
MachineMemOperand *MMO =
FuncInfo.MF->getMachineMemOperand(
MachinePointerInfo::getFixedStack(FI, Offset),
- MachineMemOperand::MOLoad,
+ Flags,
MFI.getObjectSize(FI),
MFI.getObjectAlignment(FI));
// Now add the rest of the operands.
@@ -926,7 +941,7 @@ bool ARMFastISel::ARMEmitLoad(EVT VT, unsigned &ResultReg, Address &Addr) {
ResultReg = createResultReg(RC);
MachineInstrBuilder MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(Opc), ResultReg);
- AddLoadStoreOperands(VT, Addr, MIB);
+ AddLoadStoreOperands(VT, Addr, MIB, MachineMemOperand::MOLoad);
return true;
}
@@ -985,7 +1000,7 @@ bool ARMFastISel::ARMEmitStore(EVT VT, unsigned SrcReg, Address &Addr) {
MachineInstrBuilder MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(StrOpc))
.addReg(SrcReg, getKillRegState(true));
- AddLoadStoreOperands(VT, Addr, MIB);
+ AddLoadStoreOperands(VT, Addr, MIB, MachineMemOperand::MOStore);
return true;
}
@@ -1131,7 +1146,7 @@ bool ARMFastISel::SelectBranch(const Instruction *I) {
} else if (TruncInst *TI = dyn_cast<TruncInst>(BI->getCondition())) {
MVT SourceVT;
if (TI->hasOneUse() && TI->getParent() == I->getParent() &&
- (isTypeLegal(TI->getOperand(0)->getType(), SourceVT))) {
+ (isLoadTypeLegal(TI->getOperand(0)->getType(), SourceVT))) {
unsigned TstOpc = isThumb ? ARM::t2TSTri : ARM::TSTri;
unsigned OpReg = getRegForValue(TI->getOperand(0));
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
@@ -1298,6 +1313,10 @@ bool ARMFastISel::SelectSIToFP(const Instruction *I) {
if (!isTypeLegal(Ty, DstVT))
return false;
+ // FIXME: Handle sign-extension where necessary.
+ if (!I->getOperand(0)->getType()->isIntegerTy(32))
+ return false;
+
unsigned Op = getRegForValue(I->getOperand(0));
if (Op == 0) return false;
@@ -1523,7 +1542,7 @@ bool ARMFastISel::ProcessCallArgs(SmallVectorImpl<Value*> &Args,
CallingConv::ID CC,
unsigned &NumBytes) {
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CC, false, TM, ArgLocs, *Context);
+ CCState CCInfo(CC, false, *FuncInfo.MF, TM, ArgLocs, *Context);
CCInfo.AnalyzeCallOperands(ArgVTs, ArgFlags, CCAssignFnForCall(CC, false));
// Get a count of how many bytes are to be pushed on the stack.
@@ -1636,7 +1655,7 @@ bool ARMFastISel::FinishCall(MVT RetVT, SmallVectorImpl<unsigned> &UsedRegs,
// Now the return value.
if (RetVT != MVT::isVoid) {
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CC, false, TM, RVLocs, *Context);
+ CCState CCInfo(CC, false, *FuncInfo.MF, TM, RVLocs, *Context);
CCInfo.AnalyzeCallResult(RetVT, CCAssignFnForCall(CC, true));
// Copy all of the result registers out of their specified physreg.
@@ -1692,7 +1711,7 @@ bool ARMFastISel::SelectRet(const Instruction *I) {
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ValLocs;
- CCState CCInfo(CC, F.isVarArg(), TM, ValLocs, I->getContext());
+ CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, TM, ValLocs, I->getContext());
CCInfo.AnalyzeReturn(Outs, CCAssignFnForCall(CC, true /* is Ret */));
const Value *RV = Ret->getOperand(0);
@@ -1839,9 +1858,9 @@ bool ARMFastISel::SelectCall(const Instruction *I) {
// Can't handle inline asm or worry about intrinsics yet.
if (isa<InlineAsm>(Callee) || isa<IntrinsicInst>(CI)) return false;
- // Only handle global variable Callees that are direct calls.
+ // Only handle global variable Callees.
const GlobalValue *GV = dyn_cast<GlobalValue>(Callee);
- if (!GV || Subtarget->GVIsIndirectSymbol(GV, TM.getRelocationModel()))
+ if (!GV)
return false;
// Check the calling convention.
@@ -1946,6 +1965,79 @@ bool ARMFastISel::SelectCall(const Instruction *I) {
}
+bool ARMFastISel::SelectIntCast(const Instruction *I) {
+ // On ARM, in general, integer casts don't involve legal types; this code
+ // handles promotable integers. The high bits for a type smaller than
+ // the register size are assumed to be undefined.
+ const Type *DestTy = I->getType();
+ Value *Op = I->getOperand(0);
+ const Type *SrcTy = Op->getType();
+
+ EVT SrcVT, DestVT;
+ SrcVT = TLI.getValueType(SrcTy, true);
+ DestVT = TLI.getValueType(DestTy, true);
+
+ if (isa<TruncInst>(I)) {
+ if (SrcVT != MVT::i32 && SrcVT != MVT::i16 && SrcVT != MVT::i8)
+ return false;
+ if (DestVT != MVT::i16 && DestVT != MVT::i8 && DestVT != MVT::i1)
+ return false;
+
+ unsigned SrcReg = getRegForValue(Op);
+ if (!SrcReg) return false;
+
+ // Because the high bits are undefined, a truncate doesn't generate
+ // any code.
+ UpdateValueMap(I, SrcReg);
+ return true;
+ }
+ if (DestVT != MVT::i32 && DestVT != MVT::i16 && DestVT != MVT::i8)
+ return false;
+
+ unsigned Opc;
+ bool isZext = isa<ZExtInst>(I);
+ bool isBoolZext = false;
+ if (!SrcVT.isSimple())
+ return false;
+ switch (SrcVT.getSimpleVT().SimpleTy) {
+ default: return false;
+ case MVT::i16:
+ if (isZext)
+ Opc = isThumb ? ARM::t2UXTHr : ARM::UXTHr;
+ else
+ Opc = isThumb ? ARM::t2SXTHr : ARM::SXTHr;
+ break;
+ case MVT::i8:
+ if (isZext)
+ Opc = isThumb ? ARM::t2UXTBr : ARM::UXTBr;
+ else
+ Opc = isThumb ? ARM::t2SXTBr : ARM::SXTBr;
+ break;
+ case MVT::i1:
+ if (isZext) {
+ Opc = isThumb ? ARM::t2ANDri : ARM::ANDri;
+ isBoolZext = true;
+ break;
+ }
+ return false;
+ }
+
+ // FIXME: We could save an instruction in many cases by special-casing
+ // load instructions.
+ unsigned SrcReg = getRegForValue(Op);
+ if (!SrcReg) return false;
+
+ unsigned DestReg = createResultReg(TLI.getRegClassFor(MVT::i32));
+ MachineInstrBuilder MIB;
+ MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc), DestReg)
+ .addReg(SrcReg);
+ if (isBoolZext)
+ MIB.addImm(1);
+ AddOptionalDefs(MIB);
+ UpdateValueMap(I, DestReg);
+ return true;
+}
+
// TODO: SoftFP support.
bool ARMFastISel::TargetSelectInstruction(const Instruction *I) {
@@ -1983,6 +2075,10 @@ bool ARMFastISel::TargetSelectInstruction(const Instruction *I) {
return SelectSelect(I);
case Instruction::Ret:
return SelectRet(I);
+ case Instruction::Trunc:
+ case Instruction::ZExt:
+ case Instruction::SExt:
+ return SelectIntCast(I);
default: break;
}
return false;
diff --git a/contrib/llvm/lib/Target/ARM/ARMFixupKinds.h b/contrib/llvm/lib/Target/ARM/ARMFixupKinds.h
index 3d175e3..350c92d 100644
--- a/contrib/llvm/lib/Target/ARM/ARMFixupKinds.h
+++ b/contrib/llvm/lib/Target/ARM/ARMFixupKinds.h
@@ -56,7 +56,7 @@ enum Fixups {
// fixup_arm_thumb_br - 12-bit fixup for Thumb B instructions.
fixup_arm_thumb_br,
- // fixup_arm_thumb_blx - Fixup for Thumb BL instructions.
+ // fixup_arm_thumb_bl - Fixup for Thumb BL instructions.
fixup_arm_thumb_bl,
// fixup_arm_thumb_blx - Fixup for Thumb BLX instructions.
diff --git a/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
index abe5a31..9ad516d 100644
--- a/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -2691,6 +2691,111 @@ SDNode *ARMDAGToDAGISel::Select(SDNode *N) {
default:
break;
+ case Intrinsic::arm_ldrexd: {
+ SDValue MemAddr = N->getOperand(2);
+ DebugLoc dl = N->getDebugLoc();
+ SDValue Chain = N->getOperand(0);
+
+ unsigned NewOpc = ARM::LDREXD;
+ if (Subtarget->isThumb() && Subtarget->hasThumb2())
+ NewOpc = ARM::t2LDREXD;
+
+ // arm_ldrexd returns a i64 value in {i32, i32}
+ std::vector<EVT> ResTys;
+ ResTys.push_back(MVT::i32);
+ ResTys.push_back(MVT::i32);
+ ResTys.push_back(MVT::Other);
+
+ // place arguments in the right order
+ SmallVector<SDValue, 7> Ops;
+ Ops.push_back(MemAddr);
+ Ops.push_back(getAL(CurDAG));
+ Ops.push_back(CurDAG->getRegister(0, MVT::i32));
+ Ops.push_back(Chain);
+ SDNode *Ld = CurDAG->getMachineNode(NewOpc, dl, ResTys, Ops.data(),
+ Ops.size());
+ // Transfer memoperands.
+ MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1);
+ MemOp[0] = cast<MemIntrinsicSDNode>(N)->getMemOperand();
+ cast<MachineSDNode>(Ld)->setMemRefs(MemOp, MemOp + 1);
+
+ // Until there's support for specifing explicit register constraints
+ // like the use of even/odd register pair, hardcode ldrexd to always
+ // use the pair [R0, R1] to hold the load result.
+ Chain = CurDAG->getCopyToReg(CurDAG->getEntryNode(), dl, ARM::R0,
+ SDValue(Ld, 0), SDValue(0,0));
+ Chain = CurDAG->getCopyToReg(Chain, dl, ARM::R1,
+ SDValue(Ld, 1), Chain.getValue(1));
+
+ // Remap uses.
+ SDValue Glue = Chain.getValue(1);
+ if (!SDValue(N, 0).use_empty()) {
+ SDValue Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), dl,
+ ARM::R0, MVT::i32, Glue);
+ Glue = Result.getValue(2);
+ ReplaceUses(SDValue(N, 0), Result);
+ }
+ if (!SDValue(N, 1).use_empty()) {
+ SDValue Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), dl,
+ ARM::R1, MVT::i32, Glue);
+ Glue = Result.getValue(2);
+ ReplaceUses(SDValue(N, 1), Result);
+ }
+
+ ReplaceUses(SDValue(N, 2), SDValue(Ld, 2));
+ return NULL;
+ }
+
+ case Intrinsic::arm_strexd: {
+ DebugLoc dl = N->getDebugLoc();
+ SDValue Chain = N->getOperand(0);
+ SDValue Val0 = N->getOperand(2);
+ SDValue Val1 = N->getOperand(3);
+ SDValue MemAddr = N->getOperand(4);
+
+ // Until there's support for specifing explicit register constraints
+ // like the use of even/odd register pair, hardcode strexd to always
+ // use the pair [R2, R3] to hold the i64 (i32, i32) value to be stored.
+ Chain = CurDAG->getCopyToReg(CurDAG->getEntryNode(), dl, ARM::R2, Val0,
+ SDValue(0, 0));
+ Chain = CurDAG->getCopyToReg(Chain, dl, ARM::R3, Val1, Chain.getValue(1));
+
+ SDValue Glue = Chain.getValue(1);
+ Val0 = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), dl,
+ ARM::R2, MVT::i32, Glue);
+ Glue = Val0.getValue(1);
+ Val1 = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), dl,
+ ARM::R3, MVT::i32, Glue);
+
+ // Store exclusive double return a i32 value which is the return status
+ // of the issued store.
+ std::vector<EVT> ResTys;
+ ResTys.push_back(MVT::i32);
+ ResTys.push_back(MVT::Other);
+
+ // place arguments in the right order
+ SmallVector<SDValue, 7> Ops;
+ Ops.push_back(Val0);
+ Ops.push_back(Val1);
+ Ops.push_back(MemAddr);
+ Ops.push_back(getAL(CurDAG));
+ Ops.push_back(CurDAG->getRegister(0, MVT::i32));
+ Ops.push_back(Chain);
+
+ unsigned NewOpc = ARM::STREXD;
+ if (Subtarget->isThumb() && Subtarget->hasThumb2())
+ NewOpc = ARM::t2STREXD;
+
+ SDNode *St = CurDAG->getMachineNode(NewOpc, dl, ResTys, Ops.data(),
+ Ops.size());
+ // Transfer memoperands.
+ MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1);
+ MemOp[0] = cast<MemIntrinsicSDNode>(N)->getMemOperand();
+ cast<MachineSDNode>(St)->setMemRefs(MemOp, MemOp + 1);
+
+ return St;
+ }
+
case Intrinsic::arm_neon_vld1: {
unsigned DOpcodes[] = { ARM::VLD1d8, ARM::VLD1d16,
ARM::VLD1d32, ARM::VLD1d64 };
diff --git a/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp b/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 0a31b87..339c858 100644
--- a/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -72,6 +72,21 @@ ARMInterworking("arm-interworking", cl::Hidden,
cl::desc("Enable / disable ARM interworking (for debugging only)"),
cl::init(true));
+namespace llvm {
+ class ARMCCState : public CCState {
+ public:
+ ARMCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
+ const TargetMachine &TM, SmallVector<CCValAssign, 16> &locs,
+ LLVMContext &C, ParmContext PC)
+ : CCState(CC, isVarArg, MF, TM, locs, C) {
+ assert(((PC == Call) || (PC == Prologue)) &&
+ "ARMCCState users must specify whether their context is call"
+ "or prologue generation.");
+ CallOrPrologue = PC;
+ }
+ };
+}
+
// The APCS parameter registers.
static const unsigned GPRArgRegs[] = {
ARM::R0, ARM::R1, ARM::R2, ARM::R3
@@ -396,12 +411,12 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
setLibcallCallingConv(RTLIB::UDIV_I8, CallingConv::ARM_AAPCS);
setLibcallCallingConv(RTLIB::UDIV_I16, CallingConv::ARM_AAPCS);
setLibcallCallingConv(RTLIB::UDIV_I32, CallingConv::ARM_AAPCS);
- }
- // Use divmod iOS compiler-rt calls.
- if (Subtarget->getTargetTriple().getOS() == Triple::IOS) {
- setLibcallName(RTLIB::SDIVREM_I32, "__divmodsi4");
- setLibcallName(RTLIB::UDIVREM_I32, "__udivmodsi4");
+ // Memory operations
+ // RTABI chapter 4.3.4
+ setLibcallName(RTLIB::MEMCPY, "__aeabi_memcpy");
+ setLibcallName(RTLIB::MEMMOVE, "__aeabi_memmove");
+ setLibcallName(RTLIB::MEMSET, "__aeabi_memset");
}
if (Subtarget->isThumb1Only())
@@ -656,6 +671,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
setOperationAction(ISD::EH_SJLJ_SETJMP, MVT::i32, Custom);
setOperationAction(ISD::EH_SJLJ_LONGJMP, MVT::Other, Custom);
setOperationAction(ISD::EH_SJLJ_DISPATCHSETUP, MVT::Other, Custom);
+ setLibcallName(RTLIB::UNWIND_RESUME, "_Unwind_SjLj_Resume");
}
setOperationAction(ISD::SETCC, MVT::i32, Expand);
@@ -730,6 +746,8 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
setMinStackArgumentAlignment(4);
benefitFromCodePlacementOpt = true;
+
+ setMinFunctionAlignment(Subtarget->isThumb() ? 1 : 2);
}
// FIXME: It might make sense to define the representative register class as the
@@ -931,11 +949,6 @@ ARMTargetLowering::createFastISel(FunctionLoweringInfo &funcInfo) const {
return ARM::createFastISel(funcInfo);
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned ARMTargetLowering::getFunctionAlignment(const Function *F) const {
- return getTargetMachine().getSubtarget<ARMSubtarget>().isThumb() ? 1 : 2;
-}
-
/// getMaximalGlobalOffset - Returns the maximal possible offset which can
/// be used for loads / stores from the global.
unsigned ARMTargetLowering::getMaximalGlobalOffset() const {
@@ -1073,8 +1086,8 @@ ARMTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext(), Call);
CCInfo.AnalyzeCallResult(Ins,
CCAssignFnForNode(CallConv, /* Return*/ true,
isVarArg));
@@ -1208,9 +1221,8 @@ ARMTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
- *DAG.getContext());
- CCInfo.setCallOrPrologue(Call);
+ ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext(), Call);
CCInfo.AnalyzeCallOperands(Outs,
CCAssignFnForNode(CallConv, /* Return*/ false,
isVarArg));
@@ -1640,13 +1652,13 @@ ARMTargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
// results are returned in the same way as what the caller expects.
if (!CCMatch) {
SmallVector<CCValAssign, 16> RVLocs1;
- CCState CCInfo1(CalleeCC, false, getTargetMachine(),
- RVLocs1, *DAG.getContext());
+ ARMCCState CCInfo1(CalleeCC, false, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs1, *DAG.getContext(), Call);
CCInfo1.AnalyzeCallResult(Ins, CCAssignFnForNode(CalleeCC, true, isVarArg));
SmallVector<CCValAssign, 16> RVLocs2;
- CCState CCInfo2(CallerCC, false, getTargetMachine(),
- RVLocs2, *DAG.getContext());
+ ARMCCState CCInfo2(CallerCC, false, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs2, *DAG.getContext(), Call);
CCInfo2.AnalyzeCallResult(Ins, CCAssignFnForNode(CallerCC, true, isVarArg));
if (RVLocs1.size() != RVLocs2.size())
@@ -1672,8 +1684,8 @@ ARMTargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
// Check if stack adjustment is needed. For now, do not do this if any
// argument is passed on the stack.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CalleeCC, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ ARMCCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext(), Call);
CCInfo.AnalyzeCallOperands(Outs,
CCAssignFnForNode(CalleeCC, false, isVarArg));
if (CCInfo.getNextStackOffset()) {
@@ -1732,8 +1744,8 @@ ARMTargetLowering::LowerReturn(SDValue Chain,
SmallVector<CCValAssign, 16> RVLocs;
// CCState - Info about the registers and stack slots.
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), RVLocs,
- *DAG.getContext());
+ ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext(), Call);
// Analyze outgoing return values.
CCInfo.AnalyzeReturn(Outs, CCAssignFnForNode(CallConv, /* Return */ true,
@@ -2085,7 +2097,8 @@ SDValue ARMTargetLowering::LowerGlobalAddressDarwin(SDValue Op,
MachineFunction &MF = DAG.getMachineFunction();
ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
- if (Subtarget->useMovt()) {
+ // FIXME: Enable this for static codegen when tool issues are fixed.
+ if (Subtarget->useMovt() && RelocM != Reloc::Static) {
++NumMovwMovt;
// FIXME: Once remat is capable of dealing with instructions with register
// operands, expand this into two nodes.
@@ -2160,7 +2173,7 @@ ARMTargetLowering::LowerEH_SJLJ_DISPATCHSETUP(SDValue Op, SelectionDAG &DAG)
const {
DebugLoc dl = Op.getDebugLoc();
return DAG.getNode(ARMISD::EH_SJLJ_DISPATCHSETUP, dl, MVT::Other,
- Op.getOperand(0));
+ Op.getOperand(0), Op.getOperand(1));
}
SDValue
@@ -2425,9 +2438,8 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
- *DAG.getContext());
- CCInfo.setCallOrPrologue(Prologue);
+ ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext(), Prologue);
CCInfo.AnalyzeFormalArguments(Ins,
CCAssignFnForNode(CallConv, /* Return*/ false,
isVarArg));
@@ -2525,7 +2537,7 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
if (index != lastInsIndex)
{
ISD::ArgFlagsTy Flags = Ins[index].Flags;
- // FIXME: For now, all byval parameter objects are marked mutable.
+ // FIXME: For now, all byval parameter objects are marked mutable.
// This can be changed with more analysis.
// In case of tail call optimization mark all arguments mutable.
// Since they could be overwritten by lowering of arguments in case of
@@ -2702,10 +2714,11 @@ SDValue ARMTargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
}
if (True.getNode() && False.getNode()) {
- EVT VT = Cond.getValueType();
+ EVT VT = Op.getValueType();
SDValue ARMcc = Cond.getOperand(2);
SDValue CCR = Cond.getOperand(3);
SDValue Cmp = duplicateCmp(Cond.getOperand(4), DAG);
+ assert(True.getValueType() == VT);
return DAG.getNode(ARMISD::CMOV, dl, VT, True, False, ARMcc, CCR, Cmp);
}
}
@@ -4191,7 +4204,16 @@ static SDValue GeneratePerfectShuffle(unsigned PFEntry, SDValue LHS,
switch (OpNum) {
default: llvm_unreachable("Unknown shuffle opcode!");
case OP_VREV:
- return DAG.getNode(ARMISD::VREV64, dl, VT, OpLHS);
+ // VREV divides the vector in half and swaps within the half.
+ if (VT.getVectorElementType() == MVT::i32 ||
+ VT.getVectorElementType() == MVT::f32)
+ return DAG.getNode(ARMISD::VREV64, dl, VT, OpLHS);
+ // vrev <4 x i16> -> VREV32
+ if (VT.getVectorElementType() == MVT::i16)
+ return DAG.getNode(ARMISD::VREV32, dl, VT, OpLHS);
+ // vrev <4 x i8> -> VREV16
+ assert(VT.getVectorElementType() == MVT::i8);
+ return DAG.getNode(ARMISD::VREV16, dl, VT, OpLHS);
case OP_VDUP0:
case OP_VDUP1:
case OP_VDUP2:
@@ -4662,10 +4684,10 @@ LowerSDIV_v4i16(SDValue N0, SDValue N1, DebugLoc dl, SelectionDAG &DAG) {
// Because short has a smaller range than ushort, we can actually get away
// with only a single newton step. This requires that we use a weird bias
// of 89, however (again, this has been exhaustively tested).
- // float4 result = as_float4(as_int4(xf*recip) + 89);
+ // float4 result = as_float4(as_int4(xf*recip) + 0x89);
N0 = DAG.getNode(ISD::FMUL, dl, MVT::v4f32, N0, N2);
N0 = DAG.getNode(ISD::BITCAST, dl, MVT::v4i32, N0);
- N1 = DAG.getConstant(89, MVT::i32);
+ N1 = DAG.getConstant(0x89, MVT::i32);
N1 = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4i32, N1, N1, N1, N1);
N0 = DAG.getNode(ISD::ADD, dl, MVT::v4i32, N0, N1);
N0 = DAG.getNode(ISD::BITCAST, dl, MVT::v4f32, N0);
@@ -4752,26 +4774,26 @@ static SDValue LowerUDIV(SDValue Op, SelectionDAG &DAG) {
N0 = DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::v4i32, N0);
N1 = DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::v4i32, N1);
N0 = DAG.getNode(ISD::SINT_TO_FP, dl, MVT::v4f32, N0);
- N1 = DAG.getNode(ISD::SINT_TO_FP, dl, MVT::v4f32, N1);
+ SDValue BN1 = DAG.getNode(ISD::SINT_TO_FP, dl, MVT::v4f32, N1);
// Use reciprocal estimate and two refinement steps.
// float4 recip = vrecpeq_f32(yf);
// recip *= vrecpsq_f32(yf, recip);
// recip *= vrecpsq_f32(yf, recip);
N2 = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, MVT::v4f32,
- DAG.getConstant(Intrinsic::arm_neon_vrecpe, MVT::i32), N1);
+ DAG.getConstant(Intrinsic::arm_neon_vrecpe, MVT::i32), BN1);
N1 = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, MVT::v4f32,
DAG.getConstant(Intrinsic::arm_neon_vrecps, MVT::i32),
- N1, N2);
+ BN1, N2);
N2 = DAG.getNode(ISD::FMUL, dl, MVT::v4f32, N1, N2);
N1 = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, MVT::v4f32,
DAG.getConstant(Intrinsic::arm_neon_vrecps, MVT::i32),
- N1, N2);
+ BN1, N2);
N2 = DAG.getNode(ISD::FMUL, dl, MVT::v4f32, N1, N2);
// Simply multiplying by the reciprocal estimate can leave us a few ulps
// too low, so we add 2 ulps (exhaustive testing shows that this is enough,
// and that it will never cause us to return an answer too large).
- // float4 result = as_float4(as_int4(xf*recip) + 89);
+ // float4 result = as_float4(as_int4(xf*recip) + 2);
N0 = DAG.getNode(ISD::FMUL, dl, MVT::v4f32, N0, N2);
N0 = DAG.getNode(ISD::BITCAST, dl, MVT::v4i32, N0);
N1 = DAG.getConstant(2, MVT::i32);
@@ -4869,12 +4891,21 @@ ARMTargetLowering::EmitAtomicCmpSwap(MachineInstr *MI,
unsigned ptr = MI->getOperand(1).getReg();
unsigned oldval = MI->getOperand(2).getReg();
unsigned newval = MI->getOperand(3).getReg();
- unsigned scratch = BB->getParent()->getRegInfo()
- .createVirtualRegister(ARM::GPRRegisterClass);
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
DebugLoc dl = MI->getDebugLoc();
bool isThumb2 = Subtarget->isThumb2();
+ MachineRegisterInfo &MRI = BB->getParent()->getRegInfo();
+ unsigned scratch =
+ MRI.createVirtualRegister(isThumb2 ? ARM::rGPRRegisterClass
+ : ARM::GPRRegisterClass);
+
+ if (isThumb2) {
+ MRI.constrainRegClass(dest, ARM::rGPRRegisterClass);
+ MRI.constrainRegClass(oldval, ARM::rGPRRegisterClass);
+ MRI.constrainRegClass(newval, ARM::rGPRRegisterClass);
+ }
+
unsigned ldrOpc, strOpc;
switch (Size) {
default: llvm_unreachable("unsupported size for AtomicCmpSwap!");
@@ -4966,8 +4997,14 @@ ARMTargetLowering::EmitAtomicBinary(MachineInstr *MI, MachineBasicBlock *BB,
unsigned ptr = MI->getOperand(1).getReg();
unsigned incr = MI->getOperand(2).getReg();
DebugLoc dl = MI->getDebugLoc();
-
bool isThumb2 = Subtarget->isThumb2();
+
+ MachineRegisterInfo &MRI = BB->getParent()->getRegInfo();
+ if (isThumb2) {
+ MRI.constrainRegClass(dest, ARM::rGPRRegisterClass);
+ MRI.constrainRegClass(ptr, ARM::rGPRRegisterClass);
+ }
+
unsigned ldrOpc, strOpc;
switch (Size) {
default: llvm_unreachable("unsupported size for AtomicCmpSwap!");
@@ -4996,10 +5033,10 @@ ARMTargetLowering::EmitAtomicBinary(MachineInstr *MI, MachineBasicBlock *BB,
BB->end());
exitMBB->transferSuccessorsAndUpdatePHIs(BB);
- MachineRegisterInfo &RegInfo = MF->getRegInfo();
- unsigned scratch = RegInfo.createVirtualRegister(ARM::GPRRegisterClass);
- unsigned scratch2 = (!BinOpcode) ? incr :
- RegInfo.createVirtualRegister(ARM::GPRRegisterClass);
+ TargetRegisterClass *TRC =
+ isThumb2 ? ARM::tGPRRegisterClass : ARM::GPRRegisterClass;
+ unsigned scratch = MRI.createVirtualRegister(TRC);
+ unsigned scratch2 = (!BinOpcode) ? incr : MRI.createVirtualRegister(TRC);
// thisMBB:
// ...
@@ -5062,8 +5099,14 @@ ARMTargetLowering::EmitAtomicBinaryMinMax(MachineInstr *MI,
unsigned incr = MI->getOperand(2).getReg();
unsigned oldval = dest;
DebugLoc dl = MI->getDebugLoc();
-
bool isThumb2 = Subtarget->isThumb2();
+
+ MachineRegisterInfo &MRI = BB->getParent()->getRegInfo();
+ if (isThumb2) {
+ MRI.constrainRegClass(dest, ARM::rGPRRegisterClass);
+ MRI.constrainRegClass(ptr, ARM::rGPRRegisterClass);
+ }
+
unsigned ldrOpc, strOpc, extendOpc;
switch (Size) {
default: llvm_unreachable("unsupported size for AtomicCmpSwap!");
@@ -5095,9 +5138,10 @@ ARMTargetLowering::EmitAtomicBinaryMinMax(MachineInstr *MI,
BB->end());
exitMBB->transferSuccessorsAndUpdatePHIs(BB);
- MachineRegisterInfo &RegInfo = MF->getRegInfo();
- unsigned scratch = RegInfo.createVirtualRegister(ARM::GPRRegisterClass);
- unsigned scratch2 = RegInfo.createVirtualRegister(ARM::GPRRegisterClass);
+ TargetRegisterClass *TRC =
+ isThumb2 ? ARM::tGPRRegisterClass : ARM::GPRRegisterClass;
+ unsigned scratch = MRI.createVirtualRegister(TRC);
+ unsigned scratch2 = MRI.createVirtualRegister(TRC);
// thisMBB:
// ...
@@ -5118,7 +5162,7 @@ ARMTargetLowering::EmitAtomicBinaryMinMax(MachineInstr *MI,
// Sign extend the value, if necessary.
if (signExtend && extendOpc) {
- oldval = RegInfo.createVirtualRegister(ARM::GPRRegisterClass);
+ oldval = MRI.createVirtualRegister(ARM::GPRRegisterClass);
AddDefaultPred(BuildMI(BB, dl, TII->get(extendOpc), oldval).addReg(dest));
}
@@ -6984,6 +7028,14 @@ bool ARMTargetLowering::isLegalICmpImmediate(int64_t Imm) const {
return Imm >= 0 && Imm <= 255;
}
+/// isLegalAddImmediate - Return true if the specified immediate is legal
+/// add immediate, that is the target has add instructions which can add
+/// a register with the immediate without having to materialize the
+/// immediate into a register.
+bool ARMTargetLowering::isLegalAddImmediate(int64_t Imm) const {
+ return ARM_AM::getSOImmVal(Imm) != -1;
+}
+
static bool getARMIndexedAddressParts(SDNode *Ptr, EVT VT,
bool isSEXTLoad, SDValue &Base,
SDValue &Offset, bool &isInc,
@@ -7226,6 +7278,9 @@ ARMTargetLowering::getConstraintType(const std::string &Constraint) const {
case 'l': return C_RegisterClass;
case 'w': return C_RegisterClass;
}
+ } else {
+ if (Constraint == "Uv")
+ return C_Memory;
}
return TargetLowering::getConstraintType(Constraint);
}
@@ -7337,12 +7392,16 @@ getRegClassForInlineAsmConstraint(const std::string &Constraint,
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
void ARMTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
- char Constraint,
+ std::string &Constraint,
std::vector<SDValue>&Ops,
SelectionDAG &DAG) const {
SDValue Result(0, 0);
- switch (Constraint) {
+ // Currently only support length 1 constraints.
+ if (Constraint.length() != 1) return;
+
+ char ConstraintLetter = Constraint[0];
+ switch (ConstraintLetter) {
default: break;
case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O':
@@ -7357,7 +7416,7 @@ void ARMTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
if (CVal != CVal64)
return;
- switch (Constraint) {
+ switch (ConstraintLetter) {
case 'I':
if (Subtarget->isThumb1Only()) {
// This must be a constant between 0 and 255, for ADD
@@ -7620,6 +7679,28 @@ bool ARMTargetLowering::getTgtMemIntrinsic(IntrinsicInfo &Info,
Info.writeMem = true;
return true;
}
+ case Intrinsic::arm_strexd: {
+ Info.opc = ISD::INTRINSIC_W_CHAIN;
+ Info.memVT = MVT::i64;
+ Info.ptrVal = I.getArgOperand(2);
+ Info.offset = 0;
+ Info.align = 8;
+ Info.vol = false;
+ Info.readMem = false;
+ Info.writeMem = true;
+ return true;
+ }
+ case Intrinsic::arm_ldrexd: {
+ Info.opc = ISD::INTRINSIC_W_CHAIN;
+ Info.memVT = MVT::i64;
+ Info.ptrVal = I.getArgOperand(0);
+ Info.offset = 0;
+ Info.align = 8;
+ Info.vol = false;
+ Info.readMem = true;
+ Info.writeMem = false;
+ return true;
+ }
default:
break;
}
diff --git a/contrib/llvm/lib/Target/ARM/ARMISelLowering.h b/contrib/llvm/lib/Target/ARM/ARMISelLowering.h
index a2e6260..21a9a3a 100644
--- a/contrib/llvm/lib/Target/ARM/ARMISelLowering.h
+++ b/contrib/llvm/lib/Target/ARM/ARMISelLowering.h
@@ -264,6 +264,12 @@ namespace llvm {
/// the immediate into a register.
virtual bool isLegalICmpImmediate(int64_t Imm) const;
+ /// isLegalAddImmediate - Return true if the specified immediate is legal
+ /// add immediate, that is the target has add instructions which can
+ /// add a register and the immediate without having to materialize
+ /// the immediate into a register.
+ virtual bool isLegalAddImmediate(int64_t Imm) const;
+
/// getPreIndexedAddressParts - returns true by value, base pointer and
/// offset pointer and addressing mode by reference if the node's address
/// can be legally represented as pre-indexed load / store address.
@@ -309,7 +315,7 @@ namespace llvm {
/// true it means one of the asm constraint of the inline asm instruction
/// being processed is 'm'.
virtual void LowerAsmOperandForConstraint(SDValue Op,
- char ConstraintLetter,
+ std::string &Constraint,
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const;
@@ -321,9 +327,6 @@ namespace llvm {
/// specified value type.
virtual TargetRegisterClass *getRegClassFor(EVT VT) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
/// getMaximalGlobalOffset - Returns the maximal possible offset which can
/// be used for loads / stores from the global.
virtual unsigned getMaximalGlobalOffset() const;
diff --git a/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td b/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td
index f5fb98e..897d8a5 100644
--- a/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td
+++ b/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td
@@ -860,6 +860,9 @@ class APKHI<bits<8> opcod, bit tb, dag oops, dag iops, InstrItinClass itin,
class ARMPat<dag pattern, dag result> : Pat<pattern, result> {
list<Predicate> Predicates = [IsARM];
}
+class ARMV5TPat<dag pattern, dag result> : Pat<pattern, result> {
+ list<Predicate> Predicates = [IsARM, HasV5T];
+}
class ARMV5TEPat<dag pattern, dag result> : Pat<pattern, result> {
list<Predicate> Predicates = [IsARM, HasV5TE];
}
@@ -1020,6 +1023,10 @@ class T1LoadStore<bits<4> opA, bits<3> opB> : Encoding16 {
}
class T1LdStSP<bits<3> opB> : T1LoadStore<0b1001, opB>; // SP relative
+class T1BranchCond<bits<4> opcode> : Encoding16 {
+ let Inst{15-12} = opcode;
+}
+
// Helper classes to encode Thumb1 loads and stores. For immediates, the
// following bits are used for "opA" (see A6.2.4):
//
@@ -1208,6 +1215,11 @@ class T1Pat<dag pattern, dag result> : Pat<pattern, result> {
list<Predicate> Predicates = [IsThumb, IsThumb1Only];
}
+// T2v6Pat - Same as Pat<>, but requires V6T2 Thumb2 mode.
+class T2v6Pat<dag pattern, dag result> : Pat<pattern, result> {
+ list<Predicate> Predicates = [IsThumb2, HasV6T2];
+}
+
// T2Pat - Same as Pat<>, but requires that the compiler be in Thumb2 mode.
class T2Pat<dag pattern, dag result> : Pat<pattern, result> {
list<Predicate> Predicates = [IsThumb2];
@@ -1742,9 +1754,10 @@ class N2VImm<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
// NEON 3 vector register format.
-class N3VCommon<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
- dag oops, dag iops, Format f, InstrItinClass itin,
- string opc, string dt, string asm, string cstr, list<dag> pattern>
+class N3VCommon<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
+ bit op4, dag oops, dag iops, Format f, InstrItinClass itin,
+ string opc, string dt, string asm, string cstr,
+ list<dag> pattern>
: NDataI<oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
let Inst{24} = op24;
let Inst{23} = op23;
@@ -1773,9 +1786,10 @@ class N3V<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
let Inst{5} = Vm{4};
}
-class N3VLane32<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
- dag oops, dag iops, Format f, InstrItinClass itin,
- string opc, string dt, string asm, string cstr, list<dag> pattern>
+class N3VLane32<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
+ bit op4, dag oops, dag iops, Format f, InstrItinClass itin,
+ string opc, string dt, string asm, string cstr,
+ list<dag> pattern>
: N3VCommon<op24, op23, op21_20, op11_8, op6, op4,
oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
@@ -1793,9 +1807,10 @@ class N3VLane32<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bi
let Inst{5} = lane;
}
-class N3VLane16<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6, bit op4,
- dag oops, dag iops, Format f, InstrItinClass itin,
- string opc, string dt, string asm, string cstr, list<dag> pattern>
+class N3VLane16<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op6,
+ bit op4, dag oops, dag iops, Format f, InstrItinClass itin,
+ string opc, string dt, string asm, string cstr,
+ list<dag> pattern>
: N3VCommon<op24, op23, op21_20, op11_8, op6, op4,
oops, iops, f, itin, opc, dt, asm, cstr, pattern> {
diff --git a/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td b/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td
index 209c1a3..9af76df 100644
--- a/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td
+++ b/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td
@@ -58,7 +58,7 @@ def SDT_ARMEH_SJLJ_Setjmp : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisPtrTy<1>,
SDTCisInt<2>]>;
def SDT_ARMEH_SJLJ_Longjmp: SDTypeProfile<0, 2, [SDTCisPtrTy<0>, SDTCisInt<1>]>;
-def SDT_ARMEH_SJLJ_DispatchSetup: SDTypeProfile<0, 0, []>;
+def SDT_ARMEH_SJLJ_DispatchSetup: SDTypeProfile<0, 1, [SDTCisInt<0>]>;
def SDT_ARMMEMBARRIER : SDTypeProfile<0, 1, [SDTCisInt<0>]>;
@@ -475,6 +475,12 @@ def width_imm : Operand<i32>, ImmLeaf<i32, [{
let EncoderMethod = "getMsbOpValue";
}
+def ssat_imm : Operand<i32>, ImmLeaf<i32, [{
+ return Imm > 0 && Imm <= 32;
+}]> {
+ let EncoderMethod = "getSsatBitPosValue";
+}
+
// Define ARM specific addressing modes.
def MemMode2AsmOperand : AsmOperandClass {
@@ -588,6 +594,15 @@ def am6offset : Operand<i32>,
let EncoderMethod = "getAddrMode6OffsetOpValue";
}
+// Special version of addrmode6 to handle alignment encoding for VST1/VLD1
+// (single element from one lane) for size 32.
+def addrmode6oneL32 : Operand<i32>,
+ ComplexPattern<i32, 2, "SelectAddrMode6", [], [SDNPWantParent]>{
+ let PrintMethod = "printAddrMode6Operand";
+ let MIOperandInfo = (ops GPR:$addr, i32imm);
+ let EncoderMethod = "getAddrMode6OneLane32AddressOpValue";
+}
+
// Special version of addrmode6 to handle alignment encoding for VLD-dup
// instructions, specifically VLD4-dup.
def addrmode6dup : Operand<i32>,
@@ -1304,6 +1319,15 @@ let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in {
let Inst{3-0} = dst;
}
+ // For disassembly only.
+ def BX_pred : AXI<(outs), (ins GPR:$dst, pred:$p), BrMiscFrm, IIC_Br,
+ "bx$p\t$dst", [/* pattern left blank */]>,
+ Requires<[IsARM, HasV4T]> {
+ bits<4> dst;
+ let Inst{27-4} = 0b000100101111111111110001;
+ let Inst{3-0} = dst;
+ }
+
// ARMV4 only
// FIXME: We would really like to define this as a vanilla ARMPat like:
// ARMPat<(brind GPR:$dst), (MOVr PC, GPR:$dst)>
@@ -1321,10 +1345,7 @@ let isCall = 1,
// FIXME: Do we really need a non-predicated version? If so, it should
// at least be a pseudo instruction expanding to the predicated version
// at MC lowering time.
- Defs = [R0, R1, R2, R3, R12, LR,
- D0, D1, D2, D3, D4, D5, D6, D7,
- D16, D17, D18, D19, D20, D21, D22, D23,
- D24, D25, D26, D27, D28, D29, D30, D31, CPSR, FPSCR],
+ Defs = [R0, R1, R2, R3, R12, LR, QQQQ0, QQQQ2, QQQQ3, CPSR, FPSCR],
Uses = [SP] in {
def BL : ABXI<0b1011, (outs), (ins bl_target:$func, variable_ops),
IIC_Br, "bl\t$func",
@@ -1378,10 +1399,7 @@ let isCall = 1,
// On Darwin R9 is call-clobbered.
// R7 is marked as a use to prevent frame-pointer assignments from being
// moved above / below calls.
- Defs = [R0, R1, R2, R3, R9, R12, LR,
- D0, D1, D2, D3, D4, D5, D6, D7,
- D16, D17, D18, D19, D20, D21, D22, D23,
- D24, D25, D26, D27, D28, D29, D30, D31, CPSR, FPSCR],
+ Defs = [R0, R1, R2, R3, R9, R12, LR, QQQQ0, QQQQ2, QQQQ3, CPSR, FPSCR],
Uses = [R7, SP] in {
def BLr9 : ARMPseudoInst<(outs), (ins bltarget:$func, variable_ops),
Size4Bytes, IIC_Br,
@@ -1420,10 +1438,7 @@ let isCall = 1,
// FIXME: The Thumb versions of these should live in ARMInstrThumb.td
let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in {
// Darwin versions.
- let Defs = [R0, R1, R2, R3, R9, R12,
- D0, D1, D2, D3, D4, D5, D6, D7,
- D16, D17, D18, D19, D20, D21, D22, D23, D24, D25, D26,
- D27, D28, D29, D30, D31, PC],
+ let Defs = [R0, R1, R2, R3, R9, R12, QQQQ0, QQQQ2, QQQQ3, PC],
Uses = [SP] in {
def TCRETURNdi : PseudoInst<(outs), (ins i32imm:$dst, variable_ops),
IIC_Br, []>, Requires<[IsDarwin]>;
@@ -1449,10 +1464,7 @@ let isCall = 1, isTerminator = 1, isReturn = 1, isBarrier = 1 in {
}
// Non-Darwin versions (the difference is R9).
- let Defs = [R0, R1, R2, R3, R12,
- D0, D1, D2, D3, D4, D5, D6, D7,
- D16, D17, D18, D19, D20, D21, D22, D23, D24, D25, D26,
- D27, D28, D29, D30, D31, PC],
+ let Defs = [R0, R1, R2, R3, R12, QQQQ0, QQQQ2, QQQQ3, PC],
Uses = [SP] in {
def TCRETURNdiND : PseudoInst<(outs), (ins i32imm:$dst, variable_ops),
IIC_Br, []>, Requires<[IsNotDarwin]>;
@@ -2449,7 +2461,7 @@ def USADA8 : AI<(outs GPR:$Rd), (ins GPR:$Rn, GPR:$Rm, GPR:$Ra),
// Signed/Unsigned saturate -- for disassembly only
-def SSAT : AI<(outs GPR:$Rd), (ins i32imm:$sat_imm, GPR:$a, shift_imm:$sh),
+def SSAT : AI<(outs GPR:$Rd), (ins ssat_imm:$sat_imm, GPR:$a, shift_imm:$sh),
SatFrm, NoItinerary, "ssat", "\t$Rd, $sat_imm, $a$sh",
[/* For disassembly only; pattern left blank */]> {
bits<4> Rd;
@@ -2465,7 +2477,7 @@ def SSAT : AI<(outs GPR:$Rd), (ins i32imm:$sat_imm, GPR:$a, shift_imm:$sh),
let Inst{3-0} = Rn;
}
-def SSAT16 : AI<(outs GPR:$Rd), (ins i32imm:$sat_imm, GPR:$Rn), SatFrm,
+def SSAT16 : AI<(outs GPR:$Rd), (ins ssat_imm:$sat_imm, GPR:$Rn), SatFrm,
NoItinerary, "ssat16", "\t$Rd, $sat_imm, $Rn",
[/* For disassembly only; pattern left blank */]> {
bits<4> Rd;
@@ -3360,8 +3372,9 @@ def LDREXH : AIldrex<0b11, (outs GPR:$Rt), (ins addrmode7:$addr), NoItinerary,
"ldrexh", "\t$Rt, $addr", []>;
def LDREX : AIldrex<0b00, (outs GPR:$Rt), (ins addrmode7:$addr), NoItinerary,
"ldrex", "\t$Rt, $addr", []>;
-def LDREXD : AIldrex<0b01, (outs GPR:$Rt, GPR:$Rt2), (ins addrmode7:$addr),
- NoItinerary, "ldrexd", "\t$Rt, $Rt2, $addr", []>;
+let hasExtraDefRegAllocReq = 1 in
+ def LDREXD : AIldrex<0b01, (outs GPR:$Rt, GPR:$Rt2), (ins addrmode7:$addr),
+ NoItinerary, "ldrexd", "\t$Rt, $Rt2, $addr", []>;
}
let mayStore = 1, Constraints = "@earlyclobber $Rd" in {
@@ -3371,10 +3384,12 @@ def STREXH : AIstrex<0b11, (outs GPR:$Rd), (ins GPR:$Rt, addrmode7:$addr),
NoItinerary, "strexh", "\t$Rd, $Rt, $addr", []>;
def STREX : AIstrex<0b00, (outs GPR:$Rd), (ins GPR:$Rt, addrmode7:$addr),
NoItinerary, "strex", "\t$Rd, $Rt, $addr", []>;
+}
+
+let hasExtraSrcRegAllocReq = 1, Constraints = "@earlyclobber $Rd" in
def STREXD : AIstrex<0b01, (outs GPR:$Rd),
(ins GPR:$Rt, GPR:$Rt2, addrmode7:$addr),
NoItinerary, "strexd", "\t$Rd, $Rt, $Rt2, $addr", []>;
-}
// Clear-Exclusive is for disassembly only.
def CLREX : AXI<(outs), (ins), MiscFrm, NoItinerary, "clrex",
@@ -3398,7 +3413,8 @@ def SWPB : AIswp<1, (outs GPR:$Rt), (ins GPR:$Rt2, GPR:$Rn), "swpb",
def CDP : ABI<0b1110, (outs), (ins p_imm:$cop, i32imm:$opc1,
c_imm:$CRd, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
NoItinerary, "cdp", "\t$cop, $opc1, $CRd, $CRn, $CRm, $opc2",
- [/* For disassembly only; pattern left blank */]> {
+ [(int_arm_cdp imm:$cop, imm:$opc1, imm:$CRd, imm:$CRn,
+ imm:$CRm, imm:$opc2)]> {
bits<4> opc1;
bits<4> CRn;
bits<4> CRd;
@@ -3418,7 +3434,8 @@ def CDP : ABI<0b1110, (outs), (ins p_imm:$cop, i32imm:$opc1,
def CDP2 : ABXI<0b1110, (outs), (ins p_imm:$cop, i32imm:$opc1,
c_imm:$CRd, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
NoItinerary, "cdp2\t$cop, $opc1, $CRd, $CRn, $CRm, $opc2",
- [/* For disassembly only; pattern left blank */]> {
+ [(int_arm_cdp2 imm:$cop, imm:$opc1, imm:$CRd, imm:$CRn,
+ imm:$CRm, imm:$opc2)]> {
let Inst{31-28} = 0b1111;
bits<4> opc1;
bits<4> CRn;
@@ -3542,10 +3559,10 @@ defm STC2 : LdStCop<0b1111, 0, (ins), "stc2", "">;
// Move between coprocessor and ARM core register -- for disassembly only
//
-class MovRCopro<string opc, bit direction, dag oops, dag iops>
+class MovRCopro<string opc, bit direction, dag oops, dag iops,
+ list<dag> pattern>
: ABI<0b1110, oops, iops, NoItinerary, opc,
- "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2",
- [/* For disassembly only; pattern left blank */]> {
+ "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2", pattern> {
let Inst{20} = direction;
let Inst{4} = 1;
@@ -3565,17 +3582,23 @@ class MovRCopro<string opc, bit direction, dag oops, dag iops>
}
def MCR : MovRCopro<"mcr", 0 /* from ARM core register to coprocessor */,
- (outs), (ins p_imm:$cop, i32imm:$opc1,
- GPR:$Rt, c_imm:$CRn, c_imm:$CRm,
- i32imm:$opc2)>;
+ (outs),
+ (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, c_imm:$CRn,
+ c_imm:$CRm, i32imm:$opc2),
+ [(int_arm_mcr imm:$cop, imm:$opc1, GPR:$Rt, imm:$CRn,
+ imm:$CRm, imm:$opc2)]>;
def MRC : MovRCopro<"mrc", 1 /* from coprocessor to ARM core register */,
- (outs GPR:$Rt), (ins p_imm:$cop, i32imm:$opc1,
- c_imm:$CRn, c_imm:$CRm, i32imm:$opc2)>;
+ (outs GPR:$Rt),
+ (ins p_imm:$cop, i32imm:$opc1, c_imm:$CRn, c_imm:$CRm,
+ i32imm:$opc2), []>;
-class MovRCopro2<string opc, bit direction, dag oops, dag iops>
+def : ARMPat<(int_arm_mrc imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2),
+ (MRC imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2)>;
+
+class MovRCopro2<string opc, bit direction, dag oops, dag iops,
+ list<dag> pattern>
: ABXI<0b1110, oops, iops, NoItinerary,
- !strconcat(opc, "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2"),
- [/* For disassembly only; pattern left blank */]> {
+ !strconcat(opc, "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2"), pattern> {
let Inst{31-28} = 0b1111;
let Inst{20} = direction;
let Inst{4} = 1;
@@ -3596,19 +3619,25 @@ class MovRCopro2<string opc, bit direction, dag oops, dag iops>
}
def MCR2 : MovRCopro2<"mcr2", 0 /* from ARM core register to coprocessor */,
- (outs), (ins p_imm:$cop, i32imm:$opc1,
- GPR:$Rt, c_imm:$CRn, c_imm:$CRm,
- i32imm:$opc2)>;
+ (outs),
+ (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, c_imm:$CRn,
+ c_imm:$CRm, i32imm:$opc2),
+ [(int_arm_mcr2 imm:$cop, imm:$opc1, GPR:$Rt, imm:$CRn,
+ imm:$CRm, imm:$opc2)]>;
def MRC2 : MovRCopro2<"mrc2", 1 /* from coprocessor to ARM core register */,
- (outs GPR:$Rt), (ins p_imm:$cop, i32imm:$opc1,
- c_imm:$CRn, c_imm:$CRm,
- i32imm:$opc2)>;
+ (outs GPR:$Rt),
+ (ins p_imm:$cop, i32imm:$opc1, c_imm:$CRn, c_imm:$CRm,
+ i32imm:$opc2), []>;
+
+def : ARMV5TPat<(int_arm_mrc2 imm:$cop, imm:$opc1, imm:$CRn,
+ imm:$CRm, imm:$opc2),
+ (MRC2 imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2)>;
-class MovRRCopro<string opc, bit direction>
+class MovRRCopro<string opc, bit direction,
+ list<dag> pattern = [/* For disassembly only */]>
: ABI<0b1100, (outs), (ins p_imm:$cop, i32imm:$opc1,
GPR:$Rt, GPR:$Rt2, c_imm:$CRm),
- NoItinerary, opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm",
- [/* For disassembly only; pattern left blank */]> {
+ NoItinerary, opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm", pattern> {
let Inst{23-21} = 0b010;
let Inst{20} = direction;
@@ -3625,14 +3654,16 @@ class MovRRCopro<string opc, bit direction>
let Inst{3-0} = CRm;
}
-def MCRR : MovRRCopro<"mcrr", 0 /* from ARM core register to coprocessor */>;
+def MCRR : MovRRCopro<"mcrr", 0 /* from ARM core register to coprocessor */,
+ [(int_arm_mcrr imm:$cop, imm:$opc1, GPR:$Rt, GPR:$Rt2,
+ imm:$CRm)]>;
def MRRC : MovRRCopro<"mrrc", 1 /* from coprocessor to ARM core register */>;
-class MovRRCopro2<string opc, bit direction>
+class MovRRCopro2<string opc, bit direction,
+ list<dag> pattern = [/* For disassembly only */]>
: ABXI<0b1100, (outs), (ins p_imm:$cop, i32imm:$opc1,
- GPR:$Rt, GPR:$Rt2, c_imm:$CRm),
- NoItinerary, !strconcat(opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm"),
- [/* For disassembly only; pattern left blank */]> {
+ GPR:$Rt, GPR:$Rt2, c_imm:$CRm), NoItinerary,
+ !strconcat(opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm"), pattern> {
let Inst{31-28} = 0b1111;
let Inst{23-21} = 0b010;
let Inst{20} = direction;
@@ -3650,7 +3681,9 @@ class MovRRCopro2<string opc, bit direction>
let Inst{3-0} = CRm;
}
-def MCRR2 : MovRRCopro2<"mcrr2", 0 /* from ARM core register to coprocessor */>;
+def MCRR2 : MovRRCopro2<"mcrr2", 0 /* from ARM core register to coprocessor */,
+ [(int_arm_mcrr2 imm:$cop, imm:$opc1, GPR:$Rt, GPR:$Rt2,
+ imm:$CRm)]>;
def MRRC2 : MovRRCopro2<"mrrc2", 1 /* from coprocessor to ARM core register */>;
//===----------------------------------------------------------------------===//
@@ -3739,10 +3772,8 @@ let isCall = 1,
// These are pseudo-instructions and are lowered to individual MC-insts, so
// no encoding information is necessary.
let Defs =
- [ R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR, D0,
- D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15,
- D16, D17, D18, D19, D20, D21, D22, D23, D24, D25, D26, D27, D28, D29, D30,
- D31 ], hasSideEffects = 1, isBarrier = 1 in {
+ [ R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR, CPSR,
+ QQQQ0, QQQQ1, QQQQ2, QQQQ3 ], hasSideEffects = 1, isBarrier = 1 in {
def Int_eh_sjlj_setjmp : PseudoInst<(outs), (ins GPR:$src, GPR:$val),
NoItinerary,
[(set R0, (ARMeh_sjlj_setjmp GPR:$src, GPR:$val))]>,
@@ -3750,7 +3781,7 @@ let Defs =
}
let Defs =
- [ R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR ],
+ [ R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR, CPSR ],
hasSideEffects = 1, isBarrier = 1 in {
def Int_eh_sjlj_setjmp_nofp : PseudoInst<(outs), (ins GPR:$src, GPR:$val),
NoItinerary,
@@ -3773,8 +3804,8 @@ def Int_eh_sjlj_longjmp : PseudoInst<(outs), (ins GPR:$src, GPR:$scratch),
// that need the instruction size).
let isBarrier = 1, hasSideEffects = 1 in
def Int_eh_sjlj_dispatchsetup :
- PseudoInst<(outs), (ins), NoItinerary,
- [(ARMeh_sjlj_dispatchsetup)]>,
+ PseudoInst<(outs), (ins GPR:$src), NoItinerary,
+ [(ARMeh_sjlj_dispatchsetup GPR:$src)]>,
Requires<[IsDarwin]>;
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td b/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td
index e34d69a..79d95d9 100644
--- a/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td
+++ b/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td
@@ -531,6 +531,17 @@ class VLD1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
imm:$lane))]> {
let Rm = 0b1111;
}
+class VLD1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
+ PatFrag LoadOp>
+ : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
+ (ins addrmode6oneL32:$Rn, DPR:$src, nohash_imm:$lane),
+ IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
+ "$src = $Vd",
+ [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
+ (i32 (LoadOp addrmode6oneL32:$Rn)),
+ imm:$lane))]> {
+ let Rm = 0b1111;
+}
class VLD1QLNPseudo<ValueType Ty, PatFrag LoadOp> : VLDQLNPseudo<IIC_VLD1ln> {
let Pattern = [(set QPR:$dst, (vector_insert (Ty QPR:$src),
(i32 (LoadOp addrmode6:$addr)),
@@ -544,7 +555,7 @@ def VLD1LNd16 : VLD1LN<0b0100, {?,?,0,?}, "16", v4i16, extloadi16> {
let Inst{7-6} = lane{1-0};
let Inst{4} = Rn{4};
}
-def VLD1LNd32 : VLD1LN<0b1000, {?,0,?,?}, "32", v2i32, load> {
+def VLD1LNd32 : VLD1LN32<0b1000, {?,0,?,?}, "32", v2i32, load> {
let Inst{7} = lane{0};
let Inst{5} = Rn{4};
let Inst{4} = Rn{4};
@@ -1371,6 +1382,14 @@ class VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
[(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), addrmode6:$Rn)]> {
let Rm = 0b1111;
}
+class VST1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
+ PatFrag StoreOp, SDNode ExtractOp>
+ : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
+ (ins addrmode6oneL32:$Rn, DPR:$Vd, nohash_imm:$lane),
+ IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
+ [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), addrmode6oneL32:$Rn)]> {
+ let Rm = 0b1111;
+}
class VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
: VSTQLNPseudo<IIC_VST1ln> {
let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
@@ -1386,7 +1405,8 @@ def VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
let Inst{7-6} = lane{1-0};
let Inst{4} = Rn{5};
}
-def VST1LNd32 : VST1LN<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt> {
+
+def VST1LNd32 : VST1LN32<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt> {
let Inst{7} = lane{0};
let Inst{5-4} = Rn{5-4};
}
@@ -4683,8 +4703,9 @@ def VEXTd32 : VEXTd<"vext", "32", v2i32> {
let Inst{9-8} = 0b00;
}
def VEXTdf : VEXTd<"vext", "32", v2f32> {
- let Inst{11} = index{0};
- let Inst{10-8} = 0b000;
+ let Inst{11-10} = index{1-0};
+ let Inst{9-8} = 0b00;
+
}
def VEXTq8 : VEXTq<"vext", "8", v16i8> {
diff --git a/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td b/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td
index 8c542fe..4777189 100644
--- a/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td
+++ b/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td
@@ -369,15 +369,6 @@ let isReturn = 1, isTerminator = 1, isBarrier = 1 in {
let Inst{2-0} = 0b000;
}
- def tBX_Rm : TI<(outs), (ins pred:$p, GPR:$Rm), IIC_Br, "bx${p}\t$Rm",
- [/* for disassembly only */]>,
- T1Special<{1,1,0,?}> {
- // A6.2.3 & A8.6.25
- bits<4> Rm;
- let Inst{6-3} = Rm;
- let Inst{2-0} = 0b000;
- }
-
// Alternative return instruction used by vararg functions.
def tBX_RET_vararg : TI<(outs), (ins tGPR:$Rm),
IIC_Br, "bx\t$Rm",
@@ -392,6 +383,14 @@ let isReturn = 1, isTerminator = 1, isBarrier = 1 in {
// Indirect branches
let isBranch = 1, isTerminator = 1, isBarrier = 1, isIndirectBranch = 1 in {
+ def tBX : TI<(outs), (ins GPR:$Rm, pred:$p), IIC_Br, "bx${p}\t$Rm", []>,
+ T1Special<{1,1,0,?}> {
+ // A6.2.3 & A8.6.25
+ bits<4> Rm;
+ let Inst{6-3} = Rm;
+ let Inst{2-0} = 0b000;
+ }
+
def tBRIND : TI<(outs), (ins GPR:$Rm),
IIC_Br,
"mov\tpc, $Rm",
@@ -423,10 +422,7 @@ def tPOP_RET : T1I<(outs), (ins pred:$p, reglist:$regs, variable_ops),
// potentially appearing dead.
let isCall = 1,
// On non-Darwin platforms R9 is callee-saved.
- Defs = [R0, R1, R2, R3, R12, LR,
- D0, D1, D2, D3, D4, D5, D6, D7,
- D16, D17, D18, D19, D20, D21, D22, D23,
- D24, D25, D26, D27, D28, D29, D30, D31, CPSR, FPSCR],
+ Defs = [R0, R1, R2, R3, R12, LR, QQQQ0, QQQQ2, QQQQ3, CPSR, FPSCR],
Uses = [SP] in {
// Also used for Thumb2
def tBL : TIx2<0b11110, 0b11, 1,
@@ -460,14 +456,15 @@ let isCall = 1,
"blx\t$func",
[(ARMtcall GPR:$func)]>,
Requires<[IsThumb, HasV5T, IsNotDarwin]>,
- T1Special<{1,1,1,?}>; // A6.2.3 & A8.6.24;
+ T1Special<{1,1,1,?}> { // A6.2.3 & A8.6.24;
+ bits<4> func;
+ let Inst{6-3} = func;
+ let Inst{2-0} = 0b000;
+ }
// ARMv4T
- // FIXME: Should be a pseudo.
- let isCodeGenOnly = 1 in
- def tBX : TIx2<{?,?,?,?,?}, {?,?}, ?,
- (outs), (ins tGPR:$func, variable_ops), IIC_Br,
- "mov\tlr, pc\n\tbx\t$func",
+ def tBX_CALL : tPseudoInst<(outs), (ins tGPR:$func, variable_ops),
+ Size4Bytes, IIC_Br,
[(ARMcall_nolink tGPR:$func)]>,
Requires<[IsThumb, IsThumb1Only, IsNotDarwin]>;
}
@@ -476,10 +473,7 @@ let isCall = 1,
// On Darwin R9 is call-clobbered.
// R7 is marked as a use to prevent frame-pointer assignments from being
// moved above / below calls.
- Defs = [R0, R1, R2, R3, R9, R12, LR,
- D0, D1, D2, D3, D4, D5, D6, D7,
- D16, D17, D18, D19, D20, D21, D22, D23,
- D24, D25, D26, D27, D28, D29, D30, D31, CPSR, FPSCR],
+ Defs = [R0, R1, R2, R3, R9, R12, LR, QQQQ0, QQQQ2, QQQQ3, CPSR, FPSCR],
Uses = [R7, SP] in {
// Also used for Thumb2
def tBLr9 : TIx2<0b11110, 0b11, 1,
@@ -521,11 +515,8 @@ let isCall = 1,
}
// ARMv4T
- let isCodeGenOnly = 1 in
- // FIXME: Should be a pseudo.
- def tBXr9 : TIx2<{?,?,?,?,?}, {?,?}, ?,
- (outs), (ins tGPR:$func, variable_ops), IIC_Br,
- "mov\tlr, pc\n\tbx\t$func",
+ def tBXr9_CALL : tPseudoInst<(outs), (ins tGPR:$func, variable_ops),
+ Size4Bytes, IIC_Br,
[(ARMcall_nolink tGPR:$func)]>,
Requires<[IsThumb, IsThumb1Only, IsDarwin]>;
}
@@ -560,7 +551,7 @@ let isBranch = 1, isTerminator = 1 in
def tBcc : T1I<(outs), (ins t_bcctarget:$target, pred:$p), IIC_Br,
"b${p}\t$target",
[/*(ARMbrcond bb:$target, imm:$cc)*/]>,
- T1Encoding<{1,1,0,1,?,?}> {
+ T1BranchCond<{1,1,0,1}> {
bits<4> p;
bits<8> target;
let Inst{11-8} = p;
@@ -606,7 +597,7 @@ def tSVC : T1pI<(outs), (ins i32imm:$imm), IIC_Br,
// The assembler uses 0xDEFE for a trap instruction.
let isBarrier = 1, isTerminator = 1 in
-def tTRAP : TI<(outs), (ins), IIC_Br,
+def tTRAP : TI<(outs), (ins), IIC_Br,
"trap", [(trap)]>, Encoding16 {
let Inst = 0xdefe;
}
@@ -813,7 +804,7 @@ defm tLDM : thumb_ldst_mult<"ldm", IIC_iLoad_m, IIC_iLoad_mu,
let mayStore = 1, hasExtraSrcRegAllocReq = 1 in
defm tSTM : thumb_ldst_mult<"stm", IIC_iStore_m, IIC_iStore_mu,
{1,1,0,0,0,?}, 0>;
-
+
} // neverHasSideEffects
let mayLoad = 1, Uses = [SP], Defs = [SP], hasExtraDefRegAllocReq = 1 in
@@ -1352,9 +1343,10 @@ def tLEApcrelJT : tPseudoInst<(outs tGPR:$Rd),
// Move between coprocessor and ARM core register -- for disassembly only
//
-class tMovRCopro<string opc, bit direction, dag oops, dag iops>
+class tMovRCopro<string opc, bit direction, dag oops, dag iops,
+ list<dag> pattern>
: T1Cop<oops, iops, !strconcat(opc, "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2"),
- [/* For disassembly only; pattern left blank */]> {
+ pattern> {
let Inst{27-24} = 0b1110;
let Inst{20} = direction;
let Inst{4} = 1;
@@ -1375,16 +1367,24 @@ class tMovRCopro<string opc, bit direction, dag oops, dag iops>
}
def tMCR : tMovRCopro<"mcr", 0 /* from ARM core register to coprocessor */,
- (outs), (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, c_imm:$CRn,
- c_imm:$CRm, i32imm:$opc2)>;
+ (outs),
+ (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, c_imm:$CRn,
+ c_imm:$CRm, i32imm:$opc2),
+ [(int_arm_mcr imm:$cop, imm:$opc1, GPR:$Rt, imm:$CRn,
+ imm:$CRm, imm:$opc2)]>;
def tMRC : tMovRCopro<"mrc", 1 /* from coprocessor to ARM core register */,
- (outs GPR:$Rt), (ins p_imm:$cop, i32imm:$opc1, c_imm:$CRn,
- c_imm:$CRm, i32imm:$opc2)>;
+ (outs GPR:$Rt),
+ (ins p_imm:$cop, i32imm:$opc1, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
+ []>;
-class tMovRRCopro<string opc, bit direction>
+def : Pat<(int_arm_mrc imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2),
+ (tMRC imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2)>,
+ Requires<[IsThumb, HasV6T2]>;
+
+class tMovRRCopro<string opc, bit direction,
+ list<dag> pattern = [/* For disassembly only */]>
: T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, GPR:$Rt2, c_imm:$CRm),
- !strconcat(opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm"),
- [/* For disassembly only; pattern left blank */]> {
+ !strconcat(opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm"), pattern> {
let Inst{27-24} = 0b1100;
let Inst{23-21} = 0b010;
let Inst{20} = direction;
@@ -1402,7 +1402,9 @@ class tMovRRCopro<string opc, bit direction>
let Inst{3-0} = CRm;
}
-def tMCRR : tMovRRCopro<"mcrr", 0 /* from ARM core register to coprocessor */>;
+def tMCRR : tMovRRCopro<"mcrr", 0 /* from ARM core register to coprocessor */,
+ [(int_arm_mcrr imm:$cop, imm:$opc1, GPR:$Rt, GPR:$Rt2,
+ imm:$CRm)]>;
def tMRRC : tMovRRCopro<"mrrc", 1 /* from coprocessor to ARM core register */>;
//===----------------------------------------------------------------------===//
@@ -1411,7 +1413,8 @@ def tMRRC : tMovRRCopro<"mrrc", 1 /* from coprocessor to ARM core register */>;
def tCDP : T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1,
c_imm:$CRd, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
"cdp\t$cop, $opc1, $CRd, $CRn, $CRm, $opc2",
- [/* For disassembly only; pattern left blank */]> {
+ [(int_arm_cdp imm:$cop, imm:$opc1, imm:$CRd, imm:$CRn,
+ imm:$CRm, imm:$opc2)]> {
let Inst{27-24} = 0b1110;
bits<4> opc1;
@@ -1445,7 +1448,7 @@ def tTPsoft : TIx2<0b11110, 0b11, 1, (outs), (ins), IIC_Br,
//===----------------------------------------------------------------------===//
// SJLJ Exception handling intrinsics
-//
+//
// eh_sjlj_setjmp() is an instruction sequence to store the return address and
// save #0 in R0 for the non-longjmp case. Since by its nature we may be coming
@@ -1457,7 +1460,7 @@ def tTPsoft : TIx2<0b11110, 0b11, 1, (outs), (ins), IIC_Br,
// Defs. By doing so, we also cause the prologue/epilogue code to actively
// preserve all of the callee-saved resgisters, which is exactly what we want.
// $val is a scratch register for our use.
-let Defs = [ R0, R1, R2, R3, R4, R5, R6, R7, R12 ],
+let Defs = [ R0, R1, R2, R3, R4, R5, R6, R7, R12, CPSR ],
hasSideEffects = 1, isBarrier = 1, isCodeGenOnly = 1 in
def tInt_eh_sjlj_setjmp : ThumbXI<(outs),(ins tGPR:$src, tGPR:$val),
AddrModeNone, SizeSpecial, NoItinerary, "","",
diff --git a/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td b/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td
index 600a121..598660c 100644
--- a/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td
+++ b/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td
@@ -158,7 +158,7 @@ def t2addrmode_so_reg : Operand<i32>,
//
def t2addrmode_reg : Operand<i32> {
let PrintMethod = "printAddrMode7Operand";
- let MIOperandInfo = (ops tGPR);
+ let MIOperandInfo = (ops GPR);
let ParserMatchClass = MemMode7AsmOperand;
}
@@ -1973,9 +1973,9 @@ class T2SatI<dag oops, dag iops, InstrItinClass itin,
}
def t2SSAT: T2SatI<
- (outs rGPR:$Rd), (ins i32imm:$sat_imm, rGPR:$Rn, shift_imm:$sh),
- NoItinerary, "ssat", "\t$Rd, $sat_imm, $Rn$sh",
- [/* For disassembly only; pattern left blank */]> {
+ (outs rGPR:$Rd), (ins ssat_imm:$sat_imm, rGPR:$Rn, shift_imm:$sh),
+ NoItinerary, "ssat", "\t$Rd, $sat_imm, $Rn$sh",
+ [/* For disassembly only; pattern left blank */]> {
let Inst{31-27} = 0b11110;
let Inst{25-22} = 0b1100;
let Inst{20} = 0;
@@ -1983,9 +1983,9 @@ def t2SSAT: T2SatI<
}
def t2SSAT16: T2SatI<
- (outs rGPR:$Rd), (ins i32imm:$sat_imm, rGPR:$Rn), NoItinerary,
- "ssat16", "\t$Rd, $sat_imm, $Rn",
- [/* For disassembly only; pattern left blank */]> {
+ (outs rGPR:$Rd), (ins ssat_imm:$sat_imm, rGPR:$Rn), NoItinerary,
+ "ssat16", "\t$Rd, $sat_imm, $Rn",
+ [/* For disassembly only; pattern left blank */]> {
let Inst{31-27} = 0b11110;
let Inst{25-22} = 0b1100;
let Inst{20} = 0;
@@ -2881,7 +2881,9 @@ def t2LDREX : Thumb2I<(outs rGPR:$Rt), (ins t2addrmode_reg:$addr), AddrModeNone
let Inst{19-16} = addr;
let Inst{15-12} = Rt;
}
-def t2LDREXD : T2I_ldrex<0b11, (outs rGPR:$Rt, rGPR:$Rt2), (ins t2addrmode_reg:$addr),
+let hasExtraDefRegAllocReq = 1 in
+def t2LDREXD : T2I_ldrex<0b11, (outs rGPR:$Rt, rGPR:$Rt2),
+ (ins t2addrmode_reg:$addr),
AddrModeNone, Size4Bytes, NoItinerary,
"ldrexd", "\t$Rt, $Rt2, $addr", "",
[], {?, ?, ?, ?}> {
@@ -2912,6 +2914,9 @@ def t2STREX : Thumb2I<(outs rGPR:$Rd), (ins rGPR:$Rt, t2addrmode_reg:$addr),
let Inst{19-16} = addr;
let Inst{15-12} = Rt;
}
+}
+
+let hasExtraSrcRegAllocReq = 1, Constraints = "@earlyclobber $Rd" in
def t2STREXD : T2I_strex<0b11, (outs rGPR:$Rd),
(ins rGPR:$Rt, rGPR:$Rt2, t2addrmode_reg:$addr),
AddrModeNone, Size4Bytes, NoItinerary,
@@ -2920,7 +2925,6 @@ def t2STREXD : T2I_strex<0b11, (outs rGPR:$Rd),
bits<4> Rt2;
let Inst{11-8} = Rt2;
}
-}
// Clear-Exclusive is for disassembly only.
def t2CLREX : T2XI<(outs), (ins), NoItinerary, "clrex",
@@ -2965,10 +2969,9 @@ let isCall = 1,
// all of the callee-saved resgisters, which is exactly what we want.
// $val is a scratch register for our use.
let Defs =
- [ R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR, D0,
- D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15,
- D16, D17, D18, D19, D20, D21, D22, D23, D24, D25, D26, D27, D28, D29, D30,
- D31 ], hasSideEffects = 1, isBarrier = 1, isCodeGenOnly = 1 in {
+ [ R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR, CPSR,
+ QQQQ0, QQQQ1, QQQQ2, QQQQ3 ],
+ hasSideEffects = 1, isBarrier = 1, isCodeGenOnly = 1 in {
def t2Int_eh_sjlj_setjmp : Thumb2XI<(outs), (ins tGPR:$src, tGPR:$val),
AddrModeNone, SizeSpecial, NoItinerary, "", "",
[(set R0, (ARMeh_sjlj_setjmp tGPR:$src, tGPR:$val))]>,
@@ -2976,7 +2979,7 @@ let Defs =
}
let Defs =
- [ R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR ],
+ [ R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, LR, CPSR ],
hasSideEffects = 1, isBarrier = 1, isCodeGenOnly = 1 in {
def t2Int_eh_sjlj_setjmp_nofp : Thumb2XI<(outs), (ins tGPR:$src, tGPR:$val),
AddrModeNone, SizeSpecial, NoItinerary, "", "",
@@ -3347,9 +3350,10 @@ def t2MSR : T2SpecialReg<0b111100111000 /* op31-20 */, 0b10 /* op15-14 */,
// Move between coprocessor and ARM core register -- for disassembly only
//
-class t2MovRCopro<string opc, bit direction, dag oops, dag iops>
+class t2MovRCopro<string opc, bit direction, dag oops, dag iops,
+ list<dag> pattern>
: T2Cop<oops, iops, !strconcat(opc, "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2"),
- [/* For disassembly only; pattern left blank */]> {
+ pattern> {
let Inst{27-24} = 0b1110;
let Inst{20} = direction;
let Inst{4} = 1;
@@ -3371,15 +3375,21 @@ class t2MovRCopro<string opc, bit direction, dag oops, dag iops>
def t2MCR2 : t2MovRCopro<"mcr2", 0 /* from ARM core register to coprocessor */,
(outs), (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, c_imm:$CRn,
- c_imm:$CRm, i32imm:$opc2)>;
+ c_imm:$CRm, i32imm:$opc2),
+ [(int_arm_mcr2 imm:$cop, imm:$opc1, GPR:$Rt, imm:$CRn,
+ imm:$CRm, imm:$opc2)]>;
def t2MRC2 : t2MovRCopro<"mrc2", 1 /* from coprocessor to ARM core register */,
(outs GPR:$Rt), (ins p_imm:$cop, i32imm:$opc1, c_imm:$CRn,
- c_imm:$CRm, i32imm:$opc2)>;
+ c_imm:$CRm, i32imm:$opc2), []>;
-class t2MovRRCopro<string opc, bit direction>
+def : T2v6Pat<(int_arm_mrc2 imm:$cop, imm:$opc1, imm:$CRn,
+ imm:$CRm, imm:$opc2),
+ (t2MRC2 imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2)>;
+
+class t2MovRRCopro<string opc, bit direction,
+ list<dag> pattern = [/* For disassembly only */]>
: T2Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, GPR:$Rt2, c_imm:$CRm),
- !strconcat(opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm"),
- [/* For disassembly only; pattern left blank */]> {
+ !strconcat(opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm"), pattern> {
let Inst{27-24} = 0b1100;
let Inst{23-21} = 0b010;
let Inst{20} = direction;
@@ -3398,7 +3408,9 @@ class t2MovRRCopro<string opc, bit direction>
}
def t2MCRR2 : t2MovRRCopro<"mcrr2",
- 0 /* from ARM core register to coprocessor */>;
+ 0 /* from ARM core register to coprocessor */,
+ [(int_arm_mcrr2 imm:$cop, imm:$opc1, GPR:$Rt,
+ GPR:$Rt2, imm:$CRm)]>;
def t2MRRC2 : t2MovRRCopro<"mrrc2",
1 /* from coprocessor to ARM core register */>;
@@ -3409,7 +3421,8 @@ def t2MRRC2 : t2MovRRCopro<"mrrc2",
def t2CDP2 : T2Cop<(outs), (ins p_imm:$cop, i32imm:$opc1,
c_imm:$CRd, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
"cdp2\t$cop, $opc1, $CRd, $CRn, $CRm, $opc2",
- [/* For disassembly only; pattern left blank */]> {
+ [(int_arm_cdp2 imm:$cop, imm:$opc1, imm:$CRd, imm:$CRn,
+ imm:$CRm, imm:$opc2)]> {
let Inst{27-24} = 0b1110;
bits<4> opc1;
diff --git a/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
index df89fad..f4645f1 100644
--- a/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -947,8 +947,8 @@ bool ARMLoadStoreOpt::MergeBaseUpdateLoadStore(MachineBasicBlock &MBB,
return true;
}
-/// isMemoryOp - Returns true if instruction is a memory operations (that this
-/// pass is capable of operating on).
+/// isMemoryOp - Returns true if instruction is a memory operation that this
+/// pass is capable of operating on.
static bool isMemoryOp(const MachineInstr *MI) {
// When no memory operands are present, conservatively assume unaligned,
// volatile, unfoldable.
@@ -1672,10 +1672,14 @@ bool ARMPreAllocLoadStoreOpt::RescheduleOps(MachineBasicBlock *MBB,
Ops.pop_back();
Ops.pop_back();
+ const TargetInstrDesc &TID = TII->get(NewOpc);
+ const TargetRegisterClass *TRC = TID.OpInfo[0].getRegClass(TRI);
+ MRI->constrainRegClass(EvenReg, TRC);
+ MRI->constrainRegClass(OddReg, TRC);
+
// Form the pair instruction.
if (isLd) {
- MachineInstrBuilder MIB = BuildMI(*MBB, InsertPos,
- dl, TII->get(NewOpc))
+ MachineInstrBuilder MIB = BuildMI(*MBB, InsertPos, dl, TID)
.addReg(EvenReg, RegState::Define)
.addReg(OddReg, RegState::Define)
.addReg(BaseReg);
@@ -1687,8 +1691,7 @@ bool ARMPreAllocLoadStoreOpt::RescheduleOps(MachineBasicBlock *MBB,
MIB.addImm(Offset).addImm(Pred).addReg(PredReg);
++NumLDRDFormed;
} else {
- MachineInstrBuilder MIB = BuildMI(*MBB, InsertPos,
- dl, TII->get(NewOpc))
+ MachineInstrBuilder MIB = BuildMI(*MBB, InsertPos, dl, TID)
.addReg(EvenReg)
.addReg(OddReg)
.addReg(BaseReg);
diff --git a/contrib/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp b/contrib/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp
index a3f89e9..53b4c95 100644
--- a/contrib/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp
@@ -70,8 +70,6 @@ ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
WeakRefDirective = "\t.weak\t";
HasLCOMMDirective = true;
- DwarfRequiresFrameSection = false;
-
SupportsDebugInformation = true;
// Exceptions handling
diff --git a/contrib/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp b/contrib/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
index 10607b1..c5f727d 100644
--- a/contrib/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp
@@ -269,10 +269,15 @@ public:
unsigned getMsbOpValue(const MCInst &MI, unsigned Op,
SmallVectorImpl<MCFixup> &Fixups) const;
+ unsigned getSsatBitPosValue(const MCInst &MI, unsigned Op,
+ SmallVectorImpl<MCFixup> &Fixups) const;
+
unsigned getRegisterListOpValue(const MCInst &MI, unsigned Op,
SmallVectorImpl<MCFixup> &Fixups) const;
unsigned getAddrMode6AddressOpValue(const MCInst &MI, unsigned Op,
SmallVectorImpl<MCFixup> &Fixups) const;
+ unsigned getAddrMode6OneLane32AddressOpValue(const MCInst &MI, unsigned Op,
+ SmallVectorImpl<MCFixup> &Fixups) const;
unsigned getAddrMode6DupAddressOpValue(const MCInst &MI, unsigned Op,
SmallVectorImpl<MCFixup> &Fixups) const;
unsigned getAddrMode6OffsetOpValue(const MCInst &MI, unsigned Op,
@@ -1122,6 +1127,13 @@ getMsbOpValue(const MCInst &MI, unsigned Op,
}
unsigned ARMMCCodeEmitter::
+getSsatBitPosValue(const MCInst &MI, unsigned Op,
+ SmallVectorImpl<MCFixup> &Fixups) const {
+ // For ssat instructions, the bit position should be encoded decremented by 1
+ return MI.getOperand(Op).getImm()-1;
+}
+
+unsigned ARMMCCodeEmitter::
getRegisterListOpValue(const MCInst &MI, unsigned Op,
SmallVectorImpl<MCFixup> &Fixups) const {
// VLDM/VSTM:
@@ -1178,6 +1190,30 @@ getAddrMode6AddressOpValue(const MCInst &MI, unsigned Op,
return RegNo | (Align << 4);
}
+/// getAddrMode6OneLane32AddressOpValue - Encode an addrmode6 register number
+/// along with the alignment operand for use in VST1 and VLD1 with size 32.
+unsigned ARMMCCodeEmitter::
+getAddrMode6OneLane32AddressOpValue(const MCInst &MI, unsigned Op,
+ SmallVectorImpl<MCFixup> &Fixups) const {
+ const MCOperand &Reg = MI.getOperand(Op);
+ const MCOperand &Imm = MI.getOperand(Op + 1);
+
+ unsigned RegNo = getARMRegisterNumbering(Reg.getReg());
+ unsigned Align = 0;
+
+ switch (Imm.getImm()) {
+ default: break;
+ case 2:
+ case 4:
+ case 8:
+ case 16: Align = 0x00; break;
+ case 32: Align = 0x03; break;
+ }
+
+ return RegNo | (Align << 4);
+}
+
+
/// getAddrMode6DupAddressOpValue - Encode an addrmode6 register number and
/// alignment operand for use in VLD-dup instructions. This is the same as
/// getAddrMode6AddressOpValue except for the alignment encoding, which is
diff --git a/contrib/llvm/lib/Target/ARM/ARMPerfectShuffle.h b/contrib/llvm/lib/Target/ARM/ARMPerfectShuffle.h
index edecc4b..18e1620 100644
--- a/contrib/llvm/lib/Target/ARM/ARMPerfectShuffle.h
+++ b/contrib/llvm/lib/Target/ARM/ARMPerfectShuffle.h
@@ -21,6566 +21,6566 @@
// This table is 6561*4 = 26244 bytes in size.
static const unsigned PerfectShuffleTable[6561+1] = {
- 135053414U, // <0,0,0,0>: Cost 1 vdup0 LHS
- 1543503974U, // <0,0,0,1>: Cost 2 vext2 <0,0,0,0>, LHS
- 2618572962U, // <0,0,0,2>: Cost 3 vext2 <0,2,0,0>, <0,2,0,0>
- 2568054923U, // <0,0,0,3>: Cost 3 vext1 <3,0,0,0>, <3,0,0,0>
- 1476398390U, // <0,0,0,4>: Cost 2 vext1 <0,0,0,0>, RHS
- 2550140624U, // <0,0,0,5>: Cost 3 vext1 <0,0,0,0>, <5,1,7,3>
- 2550141434U, // <0,0,0,6>: Cost 3 vext1 <0,0,0,0>, <6,2,7,3>
- 2591945711U, // <0,0,0,7>: Cost 3 vext1 <7,0,0,0>, <7,0,0,0>
- 135053414U, // <0,0,0,u>: Cost 1 vdup0 LHS
- 2886516736U, // <0,0,1,0>: Cost 3 vzipl LHS, <0,0,0,0>
- 1812775014U, // <0,0,1,1>: Cost 2 vzipl LHS, LHS
- 1618133094U, // <0,0,1,2>: Cost 2 vext3 <1,2,3,0>, LHS
- 2625209292U, // <0,0,1,3>: Cost 3 vext2 <1,3,0,0>, <1,3,0,0>
- 2886558034U, // <0,0,1,4>: Cost 3 vzipl LHS, <0,4,1,5>
- 2617246864U, // <0,0,1,5>: Cost 3 vext2 <0,0,0,0>, <1,5,3,7>
- 3659723031U, // <0,0,1,6>: Cost 4 vext1 <6,0,0,1>, <6,0,0,1>
- 2591953904U, // <0,0,1,7>: Cost 3 vext1 <7,0,0,1>, <7,0,0,1>
- 1812775581U, // <0,0,1,u>: Cost 2 vzipl LHS, LHS
- 3020734464U, // <0,0,2,0>: Cost 3 vtrnl LHS, <0,0,0,0>
- 3020734474U, // <0,0,2,1>: Cost 3 vtrnl LHS, <0,0,1,1>
- 1946992742U, // <0,0,2,2>: Cost 2 vtrnl LHS, LHS
- 2631181989U, // <0,0,2,3>: Cost 3 vext2 <2,3,0,0>, <2,3,0,0>
- 3020734668U, // <0,0,2,4>: Cost 3 vtrnl LHS, <0,2,4,6>
- 3826550569U, // <0,0,2,5>: Cost 4 vuzpl <0,2,0,2>, <2,4,5,6>
- 2617247674U, // <0,0,2,6>: Cost 3 vext2 <0,0,0,0>, <2,6,3,7>
- 2591962097U, // <0,0,2,7>: Cost 3 vext1 <7,0,0,2>, <7,0,0,2>
- 1946992796U, // <0,0,2,u>: Cost 2 vtrnl LHS, LHS
- 2635163787U, // <0,0,3,0>: Cost 3 vext2 <3,0,0,0>, <3,0,0,0>
- 2686419196U, // <0,0,3,1>: Cost 3 vext3 <0,3,1,0>, <0,3,1,0>
- 2686492933U, // <0,0,3,2>: Cost 3 vext3 <0,3,2,0>, <0,3,2,0>
- 2617248156U, // <0,0,3,3>: Cost 3 vext2 <0,0,0,0>, <3,3,3,3>
- 2617248258U, // <0,0,3,4>: Cost 3 vext2 <0,0,0,0>, <3,4,5,6>
- 3826551298U, // <0,0,3,5>: Cost 4 vuzpl <0,2,0,2>, <3,4,5,6>
- 3690990200U, // <0,0,3,6>: Cost 4 vext2 <0,0,0,0>, <3,6,0,7>
- 3713551042U, // <0,0,3,7>: Cost 4 vext2 <3,7,0,0>, <3,7,0,0>
- 2635163787U, // <0,0,3,u>: Cost 3 vext2 <3,0,0,0>, <3,0,0,0>
- 2617248658U, // <0,0,4,0>: Cost 3 vext2 <0,0,0,0>, <4,0,5,1>
- 2888450150U, // <0,0,4,1>: Cost 3 vzipl <0,4,1,5>, LHS
- 3021570150U, // <0,0,4,2>: Cost 3 vtrnl <0,2,4,6>, LHS
- 3641829519U, // <0,0,4,3>: Cost 4 vext1 <3,0,0,4>, <3,0,0,4>
- 3021570252U, // <0,0,4,4>: Cost 3 vtrnl <0,2,4,6>, <0,2,4,6>
- 1543507254U, // <0,0,4,5>: Cost 2 vext2 <0,0,0,0>, RHS
- 2752810294U, // <0,0,4,6>: Cost 3 vuzpl <0,2,0,2>, RHS
- 3786998152U, // <0,0,4,7>: Cost 4 vext3 <4,7,5,0>, <0,4,7,5>
- 1543507497U, // <0,0,4,u>: Cost 2 vext2 <0,0,0,0>, RHS
- 2684354972U, // <0,0,5,0>: Cost 3 vext3 <0,0,0,0>, <0,5,0,7>
- 2617249488U, // <0,0,5,1>: Cost 3 vext2 <0,0,0,0>, <5,1,7,3>
- 3765617070U, // <0,0,5,2>: Cost 4 vext3 <1,2,3,0>, <0,5,2,7>
- 3635865780U, // <0,0,5,3>: Cost 4 vext1 <2,0,0,5>, <3,0,4,5>
- 2617249734U, // <0,0,5,4>: Cost 3 vext2 <0,0,0,0>, <5,4,7,6>
- 2617249796U, // <0,0,5,5>: Cost 3 vext2 <0,0,0,0>, <5,5,5,5>
- 2718712274U, // <0,0,5,6>: Cost 3 vext3 <5,6,7,0>, <0,5,6,7>
- 2617249960U, // <0,0,5,7>: Cost 3 vext2 <0,0,0,0>, <5,7,5,7>
- 2720039396U, // <0,0,5,u>: Cost 3 vext3 <5,u,7,0>, <0,5,u,7>
- 2684355053U, // <0,0,6,0>: Cost 3 vext3 <0,0,0,0>, <0,6,0,7>
- 3963609190U, // <0,0,6,1>: Cost 4 vzipl <0,6,2,7>, LHS
- 2617250298U, // <0,0,6,2>: Cost 3 vext2 <0,0,0,0>, <6,2,7,3>
- 3796435464U, // <0,0,6,3>: Cost 4 vext3 <6,3,7,0>, <0,6,3,7>
- 3659762998U, // <0,0,6,4>: Cost 4 vext1 <6,0,0,6>, RHS
- 3659763810U, // <0,0,6,5>: Cost 4 vext1 <6,0,0,6>, <5,6,7,0>
- 2617250616U, // <0,0,6,6>: Cost 3 vext2 <0,0,0,0>, <6,6,6,6>
- 2657727309U, // <0,0,6,7>: Cost 3 vext2 <6,7,0,0>, <6,7,0,0>
- 2658390942U, // <0,0,6,u>: Cost 3 vext2 <6,u,0,0>, <6,u,0,0>
- 2659054575U, // <0,0,7,0>: Cost 3 vext2 <7,0,0,0>, <7,0,0,0>
- 3635880854U, // <0,0,7,1>: Cost 4 vext1 <2,0,0,7>, <1,2,3,0>
- 3635881401U, // <0,0,7,2>: Cost 4 vext1 <2,0,0,7>, <2,0,0,7>
- 3734787298U, // <0,0,7,3>: Cost 4 vext2 <7,3,0,0>, <7,3,0,0>
- 2617251174U, // <0,0,7,4>: Cost 3 vext2 <0,0,0,0>, <7,4,5,6>
- 3659772002U, // <0,0,7,5>: Cost 4 vext1 <6,0,0,7>, <5,6,7,0>
- 3659772189U, // <0,0,7,6>: Cost 4 vext1 <6,0,0,7>, <6,0,0,7>
- 2617251436U, // <0,0,7,7>: Cost 3 vext2 <0,0,0,0>, <7,7,7,7>
- 2659054575U, // <0,0,7,u>: Cost 3 vext2 <7,0,0,0>, <7,0,0,0>
- 135053414U, // <0,0,u,0>: Cost 1 vdup0 LHS
- 1817419878U, // <0,0,u,1>: Cost 2 vzipl LHS, LHS
- 1947435110U, // <0,0,u,2>: Cost 2 vtrnl LHS, LHS
- 2568120467U, // <0,0,u,3>: Cost 3 vext1 <3,0,0,u>, <3,0,0,u>
- 1476463926U, // <0,0,u,4>: Cost 2 vext1 <0,0,0,u>, RHS
- 1543510170U, // <0,0,u,5>: Cost 2 vext2 <0,0,0,0>, RHS
- 2752813210U, // <0,0,u,6>: Cost 3 vuzpl <0,2,0,2>, RHS
- 2592011255U, // <0,0,u,7>: Cost 3 vext1 <7,0,0,u>, <7,0,0,u>
- 135053414U, // <0,0,u,u>: Cost 1 vdup0 LHS
- 2618581002U, // <0,1,0,0>: Cost 3 vext2 <0,2,0,1>, <0,0,1,1>
- 1557446758U, // <0,1,0,1>: Cost 2 vext2 <2,3,0,1>, LHS
- 2618581155U, // <0,1,0,2>: Cost 3 vext2 <0,2,0,1>, <0,2,0,1>
- 2690548468U, // <0,1,0,3>: Cost 3 vext3 <1,0,3,0>, <1,0,3,0>
- 2626543954U, // <0,1,0,4>: Cost 3 vext2 <1,5,0,1>, <0,4,1,5>
- 4094985216U, // <0,1,0,5>: Cost 4 vtrnl <0,2,0,2>, <1,3,5,7>
- 2592019278U, // <0,1,0,6>: Cost 3 vext1 <7,0,1,0>, <6,7,0,1>
- 2592019448U, // <0,1,0,7>: Cost 3 vext1 <7,0,1,0>, <7,0,1,0>
- 1557447325U, // <0,1,0,u>: Cost 2 vext2 <2,3,0,1>, LHS
- 1476476938U, // <0,1,1,0>: Cost 2 vext1 <0,0,1,1>, <0,0,1,1>
- 2886517556U, // <0,1,1,1>: Cost 3 vzipl LHS, <1,1,1,1>
- 2886517654U, // <0,1,1,2>: Cost 3 vzipl LHS, <1,2,3,0>
- 2886517720U, // <0,1,1,3>: Cost 3 vzipl LHS, <1,3,1,3>
- 1476480310U, // <0,1,1,4>: Cost 2 vext1 <0,0,1,1>, RHS
- 2886558864U, // <0,1,1,5>: Cost 3 vzipl LHS, <1,5,3,7>
- 2550223354U, // <0,1,1,6>: Cost 3 vext1 <0,0,1,1>, <6,2,7,3>
- 2550223856U, // <0,1,1,7>: Cost 3 vext1 <0,0,1,1>, <7,0,0,1>
- 1476482862U, // <0,1,1,u>: Cost 2 vext1 <0,0,1,1>, LHS
- 1494401126U, // <0,1,2,0>: Cost 2 vext1 <3,0,1,2>, LHS
- 3020735284U, // <0,1,2,1>: Cost 3 vtrnl LHS, <1,1,1,1>
- 2562172349U, // <0,1,2,2>: Cost 3 vext1 <2,0,1,2>, <2,0,1,2>
- 835584U, // <0,1,2,3>: Cost 0 copy LHS
- 1494404406U, // <0,1,2,4>: Cost 2 vext1 <3,0,1,2>, RHS
- 3020735488U, // <0,1,2,5>: Cost 3 vtrnl LHS, <1,3,5,7>
- 2631190458U, // <0,1,2,6>: Cost 3 vext2 <2,3,0,1>, <2,6,3,7>
- 1518294010U, // <0,1,2,7>: Cost 2 vext1 <7,0,1,2>, <7,0,1,2>
- 835584U, // <0,1,2,u>: Cost 0 copy LHS
- 2692318156U, // <0,1,3,0>: Cost 3 vext3 <1,3,0,0>, <1,3,0,0>
- 2691875800U, // <0,1,3,1>: Cost 3 vext3 <1,2,3,0>, <1,3,1,3>
- 2691875806U, // <0,1,3,2>: Cost 3 vext3 <1,2,3,0>, <1,3,2,0>
- 2692539367U, // <0,1,3,3>: Cost 3 vext3 <1,3,3,0>, <1,3,3,0>
- 2562182454U, // <0,1,3,4>: Cost 3 vext1 <2,0,1,3>, RHS
- 2691875840U, // <0,1,3,5>: Cost 3 vext3 <1,2,3,0>, <1,3,5,7>
- 2692760578U, // <0,1,3,6>: Cost 3 vext3 <1,3,6,0>, <1,3,6,0>
- 2639817411U, // <0,1,3,7>: Cost 3 vext2 <3,7,0,1>, <3,7,0,1>
- 2691875863U, // <0,1,3,u>: Cost 3 vext3 <1,2,3,0>, <1,3,u,3>
- 2568159334U, // <0,1,4,0>: Cost 3 vext1 <3,0,1,4>, LHS
- 4095312692U, // <0,1,4,1>: Cost 4 vtrnl <0,2,4,6>, <1,1,1,1>
- 2568160934U, // <0,1,4,2>: Cost 3 vext1 <3,0,1,4>, <2,3,0,1>
- 2568161432U, // <0,1,4,3>: Cost 3 vext1 <3,0,1,4>, <3,0,1,4>
- 2568162614U, // <0,1,4,4>: Cost 3 vext1 <3,0,1,4>, RHS
- 1557450038U, // <0,1,4,5>: Cost 2 vext2 <2,3,0,1>, RHS
- 2754235702U, // <0,1,4,6>: Cost 3 vuzpl <0,4,1,5>, RHS
- 2592052220U, // <0,1,4,7>: Cost 3 vext1 <7,0,1,4>, <7,0,1,4>
- 1557450281U, // <0,1,4,u>: Cost 2 vext2 <2,3,0,1>, RHS
- 3765617775U, // <0,1,5,0>: Cost 4 vext3 <1,2,3,0>, <1,5,0,1>
- 2647781007U, // <0,1,5,1>: Cost 3 vext2 <5,1,0,1>, <5,1,0,1>
- 3704934138U, // <0,1,5,2>: Cost 4 vext2 <2,3,0,1>, <5,2,3,0>
- 2691875984U, // <0,1,5,3>: Cost 3 vext3 <1,2,3,0>, <1,5,3,7>
- 2657734598U, // <0,1,5,4>: Cost 3 vext2 <6,7,0,1>, <5,4,7,6>
- 2650435539U, // <0,1,5,5>: Cost 3 vext2 <5,5,0,1>, <5,5,0,1>
- 2651099172U, // <0,1,5,6>: Cost 3 vext2 <5,6,0,1>, <5,6,0,1>
- 2651762805U, // <0,1,5,7>: Cost 3 vext2 <5,7,0,1>, <5,7,0,1>
- 2691876029U, // <0,1,5,u>: Cost 3 vext3 <1,2,3,0>, <1,5,u,7>
- 2592063590U, // <0,1,6,0>: Cost 3 vext1 <7,0,1,6>, LHS
- 3765617871U, // <0,1,6,1>: Cost 4 vext3 <1,2,3,0>, <1,6,1,7>
- 2654417337U, // <0,1,6,2>: Cost 3 vext2 <6,2,0,1>, <6,2,0,1>
- 3765617889U, // <0,1,6,3>: Cost 4 vext3 <1,2,3,0>, <1,6,3,7>
- 2592066870U, // <0,1,6,4>: Cost 3 vext1 <7,0,1,6>, RHS
- 3765617907U, // <0,1,6,5>: Cost 4 vext3 <1,2,3,0>, <1,6,5,7>
- 2657071869U, // <0,1,6,6>: Cost 3 vext2 <6,6,0,1>, <6,6,0,1>
- 1583993678U, // <0,1,6,7>: Cost 2 vext2 <6,7,0,1>, <6,7,0,1>
- 1584657311U, // <0,1,6,u>: Cost 2 vext2 <6,u,0,1>, <6,u,0,1>
- 2657735672U, // <0,1,7,0>: Cost 3 vext2 <6,7,0,1>, <7,0,1,0>
- 2657735808U, // <0,1,7,1>: Cost 3 vext2 <6,7,0,1>, <7,1,7,1>
- 2631193772U, // <0,1,7,2>: Cost 3 vext2 <2,3,0,1>, <7,2,3,0>
- 2661053667U, // <0,1,7,3>: Cost 3 vext2 <7,3,0,1>, <7,3,0,1>
- 2657736038U, // <0,1,7,4>: Cost 3 vext2 <6,7,0,1>, <7,4,5,6>
- 3721524621U, // <0,1,7,5>: Cost 4 vext2 <5,1,0,1>, <7,5,1,0>
- 2657736158U, // <0,1,7,6>: Cost 3 vext2 <6,7,0,1>, <7,6,1,0>
- 2657736300U, // <0,1,7,7>: Cost 3 vext2 <6,7,0,1>, <7,7,7,7>
- 2657736322U, // <0,1,7,u>: Cost 3 vext2 <6,7,0,1>, <7,u,1,2>
- 1494450278U, // <0,1,u,0>: Cost 2 vext1 <3,0,1,u>, LHS
- 1557452590U, // <0,1,u,1>: Cost 2 vext2 <2,3,0,1>, LHS
- 2754238254U, // <0,1,u,2>: Cost 3 vuzpl <0,4,1,5>, LHS
- 835584U, // <0,1,u,3>: Cost 0 copy LHS
- 1494453558U, // <0,1,u,4>: Cost 2 vext1 <3,0,1,u>, RHS
- 1557452954U, // <0,1,u,5>: Cost 2 vext2 <2,3,0,1>, RHS
- 2754238618U, // <0,1,u,6>: Cost 3 vuzpl <0,4,1,5>, RHS
- 1518343168U, // <0,1,u,7>: Cost 2 vext1 <7,0,1,u>, <7,0,1,u>
- 835584U, // <0,1,u,u>: Cost 0 copy LHS
- 2752299008U, // <0,2,0,0>: Cost 3 vuzpl LHS, <0,0,0,0>
- 1544847462U, // <0,2,0,1>: Cost 2 vext2 <0,2,0,2>, LHS
- 1678557286U, // <0,2,0,2>: Cost 2 vuzpl LHS, LHS
- 2696521165U, // <0,2,0,3>: Cost 3 vext3 <2,0,3,0>, <2,0,3,0>
- 2752340172U, // <0,2,0,4>: Cost 3 vuzpl LHS, <0,2,4,6>
- 2691876326U, // <0,2,0,5>: Cost 3 vext3 <1,2,3,0>, <2,0,5,7>
- 2618589695U, // <0,2,0,6>: Cost 3 vext2 <0,2,0,2>, <0,6,2,7>
- 2592093185U, // <0,2,0,7>: Cost 3 vext1 <7,0,2,0>, <7,0,2,0>
- 1678557340U, // <0,2,0,u>: Cost 2 vuzpl LHS, LHS
- 2618589942U, // <0,2,1,0>: Cost 3 vext2 <0,2,0,2>, <1,0,3,2>
- 2752299828U, // <0,2,1,1>: Cost 3 vuzpl LHS, <1,1,1,1>
- 2886518376U, // <0,2,1,2>: Cost 3 vzipl LHS, <2,2,2,2>
- 2752299766U, // <0,2,1,3>: Cost 3 vuzpl LHS, <1,0,3,2>
- 2550295862U, // <0,2,1,4>: Cost 3 vext1 <0,0,2,1>, RHS
- 2752340992U, // <0,2,1,5>: Cost 3 vuzpl LHS, <1,3,5,7>
- 2886559674U, // <0,2,1,6>: Cost 3 vzipl LHS, <2,6,3,7>
- 3934208106U, // <0,2,1,7>: Cost 4 vuzpr <7,0,1,2>, <0,1,2,7>
- 2752340771U, // <0,2,1,u>: Cost 3 vuzpl LHS, <1,0,u,2>
- 1476558868U, // <0,2,2,0>: Cost 2 vext1 <0,0,2,2>, <0,0,2,2>
- 2226628029U, // <0,2,2,1>: Cost 3 vrev <2,0,1,2>
- 2752300648U, // <0,2,2,2>: Cost 3 vuzpl LHS, <2,2,2,2>
- 3020736114U, // <0,2,2,3>: Cost 3 vtrnl LHS, <2,2,3,3>
- 1476562230U, // <0,2,2,4>: Cost 2 vext1 <0,0,2,2>, RHS
- 2550304464U, // <0,2,2,5>: Cost 3 vext1 <0,0,2,2>, <5,1,7,3>
- 2618591162U, // <0,2,2,6>: Cost 3 vext2 <0,2,0,2>, <2,6,3,7>
- 2550305777U, // <0,2,2,7>: Cost 3 vext1 <0,0,2,2>, <7,0,0,2>
- 1476564782U, // <0,2,2,u>: Cost 2 vext1 <0,0,2,2>, LHS
- 2618591382U, // <0,2,3,0>: Cost 3 vext2 <0,2,0,2>, <3,0,1,2>
- 2752301206U, // <0,2,3,1>: Cost 3 vuzpl LHS, <3,0,1,2>
- 3826043121U, // <0,2,3,2>: Cost 4 vuzpl LHS, <3,1,2,3>
- 2752301468U, // <0,2,3,3>: Cost 3 vuzpl LHS, <3,3,3,3>
- 2618591746U, // <0,2,3,4>: Cost 3 vext2 <0,2,0,2>, <3,4,5,6>
- 2752301570U, // <0,2,3,5>: Cost 3 vuzpl LHS, <3,4,5,6>
- 3830688102U, // <0,2,3,6>: Cost 4 vuzpl LHS, <3,2,6,3>
- 2698807012U, // <0,2,3,7>: Cost 3 vext3 <2,3,7,0>, <2,3,7,0>
- 2752301269U, // <0,2,3,u>: Cost 3 vuzpl LHS, <3,0,u,2>
- 2562261094U, // <0,2,4,0>: Cost 3 vext1 <2,0,2,4>, LHS
- 4095313828U, // <0,2,4,1>: Cost 4 vtrnl <0,2,4,6>, <2,6,1,3>
- 2226718152U, // <0,2,4,2>: Cost 3 vrev <2,0,2,4>
- 2568235169U, // <0,2,4,3>: Cost 3 vext1 <3,0,2,4>, <3,0,2,4>
- 2562264374U, // <0,2,4,4>: Cost 3 vext1 <2,0,2,4>, RHS
- 1544850742U, // <0,2,4,5>: Cost 2 vext2 <0,2,0,2>, RHS
- 1678560566U, // <0,2,4,6>: Cost 2 vuzpl LHS, RHS
- 2592125957U, // <0,2,4,7>: Cost 3 vext1 <7,0,2,4>, <7,0,2,4>
- 1678560584U, // <0,2,4,u>: Cost 2 vuzpl LHS, RHS
- 2691876686U, // <0,2,5,0>: Cost 3 vext3 <1,2,3,0>, <2,5,0,7>
- 2618592976U, // <0,2,5,1>: Cost 3 vext2 <0,2,0,2>, <5,1,7,3>
- 3765618528U, // <0,2,5,2>: Cost 4 vext3 <1,2,3,0>, <2,5,2,7>
- 3765618536U, // <0,2,5,3>: Cost 4 vext3 <1,2,3,0>, <2,5,3,6>
- 2618593222U, // <0,2,5,4>: Cost 3 vext2 <0,2,0,2>, <5,4,7,6>
- 2752303108U, // <0,2,5,5>: Cost 3 vuzpl LHS, <5,5,5,5>
- 2618593378U, // <0,2,5,6>: Cost 3 vext2 <0,2,0,2>, <5,6,7,0>
- 2824785206U, // <0,2,5,7>: Cost 3 vuzpr <1,0,3,2>, RHS
- 2824785207U, // <0,2,5,u>: Cost 3 vuzpr <1,0,3,2>, RHS
- 2752303950U, // <0,2,6,0>: Cost 3 vuzpl LHS, <6,7,0,1>
- 3830690081U, // <0,2,6,1>: Cost 4 vuzpl LHS, <6,0,1,2>
- 2618593786U, // <0,2,6,2>: Cost 3 vext2 <0,2,0,2>, <6,2,7,3>
- 2691876794U, // <0,2,6,3>: Cost 3 vext3 <1,2,3,0>, <2,6,3,7>
- 2752303990U, // <0,2,6,4>: Cost 3 vuzpl LHS, <6,7,4,5>
- 3830690445U, // <0,2,6,5>: Cost 4 vuzpl LHS, <6,4,5,6>
- 2752303928U, // <0,2,6,6>: Cost 3 vuzpl LHS, <6,6,6,6>
- 2657743695U, // <0,2,6,7>: Cost 3 vext2 <6,7,0,2>, <6,7,0,2>
- 2691876839U, // <0,2,6,u>: Cost 3 vext3 <1,2,3,0>, <2,6,u,7>
- 2659070961U, // <0,2,7,0>: Cost 3 vext2 <7,0,0,2>, <7,0,0,2>
- 2659734594U, // <0,2,7,1>: Cost 3 vext2 <7,1,0,2>, <7,1,0,2>
- 3734140051U, // <0,2,7,2>: Cost 4 vext2 <7,2,0,2>, <7,2,0,2>
- 2701166596U, // <0,2,7,3>: Cost 3 vext3 <2,7,3,0>, <2,7,3,0>
- 2662389094U, // <0,2,7,4>: Cost 3 vext2 <7,5,0,2>, <7,4,5,6>
- 2662389126U, // <0,2,7,5>: Cost 3 vext2 <7,5,0,2>, <7,5,0,2>
- 3736794583U, // <0,2,7,6>: Cost 4 vext2 <7,6,0,2>, <7,6,0,2>
- 2752304748U, // <0,2,7,7>: Cost 3 vuzpl LHS, <7,7,7,7>
- 2659070961U, // <0,2,7,u>: Cost 3 vext2 <7,0,0,2>, <7,0,0,2>
- 1476608026U, // <0,2,u,0>: Cost 2 vext1 <0,0,2,u>, <0,0,2,u>
- 1544853294U, // <0,2,u,1>: Cost 2 vext2 <0,2,0,2>, LHS
- 1678563118U, // <0,2,u,2>: Cost 2 vuzpl LHS, LHS
- 3021178482U, // <0,2,u,3>: Cost 3 vtrnl LHS, <2,2,3,3>
- 1476611382U, // <0,2,u,4>: Cost 2 vext1 <0,0,2,u>, RHS
- 1544853658U, // <0,2,u,5>: Cost 2 vext2 <0,2,0,2>, RHS
- 1678563482U, // <0,2,u,6>: Cost 2 vuzpl LHS, RHS
- 2824785449U, // <0,2,u,7>: Cost 3 vuzpr <1,0,3,2>, RHS
- 1678563172U, // <0,2,u,u>: Cost 2 vuzpl LHS, LHS
- 2556329984U, // <0,3,0,0>: Cost 3 vext1 <1,0,3,0>, <0,0,0,0>
- 2686421142U, // <0,3,0,1>: Cost 3 vext3 <0,3,1,0>, <3,0,1,2>
- 2562303437U, // <0,3,0,2>: Cost 3 vext1 <2,0,3,0>, <2,0,3,0>
- 4094986652U, // <0,3,0,3>: Cost 4 vtrnl <0,2,0,2>, <3,3,3,3>
- 2556333366U, // <0,3,0,4>: Cost 3 vext1 <1,0,3,0>, RHS
- 4094986754U, // <0,3,0,5>: Cost 4 vtrnl <0,2,0,2>, <3,4,5,6>
- 3798796488U, // <0,3,0,6>: Cost 4 vext3 <6,7,3,0>, <3,0,6,7>
- 3776530634U, // <0,3,0,7>: Cost 4 vext3 <3,0,7,0>, <3,0,7,0>
- 2556335918U, // <0,3,0,u>: Cost 3 vext1 <1,0,3,0>, LHS
- 2886518934U, // <0,3,1,0>: Cost 3 vzipl LHS, <3,0,1,2>
- 2556338933U, // <0,3,1,1>: Cost 3 vext1 <1,0,3,1>, <1,0,3,1>
- 2691877105U, // <0,3,1,2>: Cost 3 vext3 <1,2,3,0>, <3,1,2,3>
- 2886519196U, // <0,3,1,3>: Cost 3 vzipl LHS, <3,3,3,3>
- 2886519298U, // <0,3,1,4>: Cost 3 vzipl LHS, <3,4,5,6>
- 4095740418U, // <0,3,1,5>: Cost 4 vtrnl <0,3,1,4>, <3,4,5,6>
- 3659944242U, // <0,3,1,6>: Cost 4 vext1 <6,0,3,1>, <6,0,3,1>
- 3769600286U, // <0,3,1,7>: Cost 4 vext3 <1,u,3,0>, <3,1,7,3>
- 2886519582U, // <0,3,1,u>: Cost 3 vzipl LHS, <3,u,1,2>
- 1482604646U, // <0,3,2,0>: Cost 2 vext1 <1,0,3,2>, LHS
- 1482605302U, // <0,3,2,1>: Cost 2 vext1 <1,0,3,2>, <1,0,3,2>
- 2556348008U, // <0,3,2,2>: Cost 3 vext1 <1,0,3,2>, <2,2,2,2>
- 3020736924U, // <0,3,2,3>: Cost 3 vtrnl LHS, <3,3,3,3>
- 1482607926U, // <0,3,2,4>: Cost 2 vext1 <1,0,3,2>, RHS
- 3020737026U, // <0,3,2,5>: Cost 3 vtrnl LHS, <3,4,5,6>
- 2598154746U, // <0,3,2,6>: Cost 3 vext1 <u,0,3,2>, <6,2,7,3>
- 2598155258U, // <0,3,2,7>: Cost 3 vext1 <u,0,3,2>, <7,0,1,2>
- 1482610478U, // <0,3,2,u>: Cost 2 vext1 <1,0,3,2>, LHS
- 3692341398U, // <0,3,3,0>: Cost 4 vext2 <0,2,0,3>, <3,0,1,2>
- 2635851999U, // <0,3,3,1>: Cost 3 vext2 <3,1,0,3>, <3,1,0,3>
- 3636069840U, // <0,3,3,2>: Cost 4 vext1 <2,0,3,3>, <2,0,3,3>
- 2691877276U, // <0,3,3,3>: Cost 3 vext3 <1,2,3,0>, <3,3,3,3>
- 3961522690U, // <0,3,3,4>: Cost 4 vzipl <0,3,1,4>, <3,4,5,6>
- 3826797058U, // <0,3,3,5>: Cost 4 vuzpl <0,2,3,5>, <3,4,5,6>
- 3703622282U, // <0,3,3,6>: Cost 4 vext2 <2,1,0,3>, <3,6,2,7>
- 3769600452U, // <0,3,3,7>: Cost 4 vext3 <1,u,3,0>, <3,3,7,7>
- 2640497430U, // <0,3,3,u>: Cost 3 vext2 <3,u,0,3>, <3,u,0,3>
- 3962194070U, // <0,3,4,0>: Cost 4 vzipl <0,4,1,5>, <3,0,1,2>
- 2232617112U, // <0,3,4,1>: Cost 3 vrev <3,0,1,4>
- 2232690849U, // <0,3,4,2>: Cost 3 vrev <3,0,2,4>
- 4095314332U, // <0,3,4,3>: Cost 4 vtrnl <0,2,4,6>, <3,3,3,3>
- 3962194434U, // <0,3,4,4>: Cost 4 vzipl <0,4,1,5>, <3,4,5,6>
- 2691877378U, // <0,3,4,5>: Cost 3 vext3 <1,2,3,0>, <3,4,5,6>
- 3826765110U, // <0,3,4,6>: Cost 4 vuzpl <0,2,3,1>, RHS
- 3665941518U, // <0,3,4,7>: Cost 4 vext1 <7,0,3,4>, <7,0,3,4>
- 2691877405U, // <0,3,4,u>: Cost 3 vext3 <1,2,3,0>, <3,4,u,6>
- 3630112870U, // <0,3,5,0>: Cost 4 vext1 <1,0,3,5>, LHS
- 3630113526U, // <0,3,5,1>: Cost 4 vext1 <1,0,3,5>, <1,0,3,2>
- 4035199734U, // <0,3,5,2>: Cost 4 vzipr <1,4,0,5>, <1,0,3,2>
- 3769600578U, // <0,3,5,3>: Cost 4 vext3 <1,u,3,0>, <3,5,3,7>
- 2232846516U, // <0,3,5,4>: Cost 3 vrev <3,0,4,5>
- 3779037780U, // <0,3,5,5>: Cost 4 vext3 <3,4,5,0>, <3,5,5,7>
- 2718714461U, // <0,3,5,6>: Cost 3 vext3 <5,6,7,0>, <3,5,6,7>
- 2706106975U, // <0,3,5,7>: Cost 3 vext3 <3,5,7,0>, <3,5,7,0>
- 2233141464U, // <0,3,5,u>: Cost 3 vrev <3,0,u,5>
- 2691877496U, // <0,3,6,0>: Cost 3 vext3 <1,2,3,0>, <3,6,0,7>
- 3727511914U, // <0,3,6,1>: Cost 4 vext2 <6,1,0,3>, <6,1,0,3>
- 3765619338U, // <0,3,6,2>: Cost 4 vext3 <1,2,3,0>, <3,6,2,7>
- 3765619347U, // <0,3,6,3>: Cost 4 vext3 <1,2,3,0>, <3,6,3,7>
- 3765987996U, // <0,3,6,4>: Cost 4 vext3 <1,2,u,0>, <3,6,4,7>
- 3306670270U, // <0,3,6,5>: Cost 4 vrev <3,0,5,6>
- 3792456365U, // <0,3,6,6>: Cost 4 vext3 <5,6,7,0>, <3,6,6,6>
- 2706770608U, // <0,3,6,7>: Cost 3 vext3 <3,6,7,0>, <3,6,7,0>
- 2706844345U, // <0,3,6,u>: Cost 3 vext3 <3,6,u,0>, <3,6,u,0>
- 3769600707U, // <0,3,7,0>: Cost 4 vext3 <1,u,3,0>, <3,7,0,1>
- 2659742787U, // <0,3,7,1>: Cost 3 vext2 <7,1,0,3>, <7,1,0,3>
- 3636102612U, // <0,3,7,2>: Cost 4 vext1 <2,0,3,7>, <2,0,3,7>
- 3769600740U, // <0,3,7,3>: Cost 4 vext3 <1,u,3,0>, <3,7,3,7>
- 3769600747U, // <0,3,7,4>: Cost 4 vext3 <1,u,3,0>, <3,7,4,5>
- 3769600758U, // <0,3,7,5>: Cost 4 vext3 <1,u,3,0>, <3,7,5,7>
- 3659993400U, // <0,3,7,6>: Cost 4 vext1 <6,0,3,7>, <6,0,3,7>
- 3781176065U, // <0,3,7,7>: Cost 4 vext3 <3,7,7,0>, <3,7,7,0>
- 2664388218U, // <0,3,7,u>: Cost 3 vext2 <7,u,0,3>, <7,u,0,3>
- 1482653798U, // <0,3,u,0>: Cost 2 vext1 <1,0,3,u>, LHS
- 1482654460U, // <0,3,u,1>: Cost 2 vext1 <1,0,3,u>, <1,0,3,u>
- 2556397160U, // <0,3,u,2>: Cost 3 vext1 <1,0,3,u>, <2,2,2,2>
- 3021179292U, // <0,3,u,3>: Cost 3 vtrnl LHS, <3,3,3,3>
- 1482657078U, // <0,3,u,4>: Cost 2 vext1 <1,0,3,u>, RHS
- 3021179394U, // <0,3,u,5>: Cost 3 vtrnl LHS, <3,4,5,6>
- 2598203898U, // <0,3,u,6>: Cost 3 vext1 <u,0,3,u>, <6,2,7,3>
- 2708097874U, // <0,3,u,7>: Cost 3 vext3 <3,u,7,0>, <3,u,7,0>
- 1482659630U, // <0,3,u,u>: Cost 2 vext1 <1,0,3,u>, LHS
- 2617278468U, // <0,4,0,0>: Cost 3 vext2 <0,0,0,4>, <0,0,0,4>
- 2618605670U, // <0,4,0,1>: Cost 3 vext2 <0,2,0,4>, LHS
- 2618605734U, // <0,4,0,2>: Cost 3 vext2 <0,2,0,4>, <0,2,0,4>
- 3642091695U, // <0,4,0,3>: Cost 4 vext1 <3,0,4,0>, <3,0,4,0>
- 2753134796U, // <0,4,0,4>: Cost 3 vuzpl <0,2,4,6>, <0,2,4,6>
- 2718714770U, // <0,4,0,5>: Cost 3 vext3 <5,6,7,0>, <4,0,5,1>
- 3021245750U, // <0,4,0,6>: Cost 3 vtrnl <0,2,0,2>, RHS
- 3665982483U, // <0,4,0,7>: Cost 4 vext1 <7,0,4,0>, <7,0,4,0>
- 3021245768U, // <0,4,0,u>: Cost 3 vtrnl <0,2,0,2>, RHS
- 2568355942U, // <0,4,1,0>: Cost 3 vext1 <3,0,4,1>, LHS
- 3692348212U, // <0,4,1,1>: Cost 4 vext2 <0,2,0,4>, <1,1,1,1>
- 3692348310U, // <0,4,1,2>: Cost 4 vext2 <0,2,0,4>, <1,2,3,0>
- 2568358064U, // <0,4,1,3>: Cost 3 vext1 <3,0,4,1>, <3,0,4,1>
- 2568359222U, // <0,4,1,4>: Cost 3 vext1 <3,0,4,1>, RHS
- 1812778294U, // <0,4,1,5>: Cost 2 vzipl LHS, RHS
- 3022671158U, // <0,4,1,6>: Cost 3 vtrnl <0,4,1,5>, RHS
- 2592248852U, // <0,4,1,7>: Cost 3 vext1 <7,0,4,1>, <7,0,4,1>
- 1812778537U, // <0,4,1,u>: Cost 2 vzipl LHS, RHS
- 2568364134U, // <0,4,2,0>: Cost 3 vext1 <3,0,4,2>, LHS
- 2238573423U, // <0,4,2,1>: Cost 3 vrev <4,0,1,2>
- 3692349032U, // <0,4,2,2>: Cost 4 vext2 <0,2,0,4>, <2,2,2,2>
- 2631214761U, // <0,4,2,3>: Cost 3 vext2 <2,3,0,4>, <2,3,0,4>
- 2568367414U, // <0,4,2,4>: Cost 3 vext1 <3,0,4,2>, RHS
- 2887028022U, // <0,4,2,5>: Cost 3 vzipl <0,2,0,2>, RHS
- 1946996022U, // <0,4,2,6>: Cost 2 vtrnl LHS, RHS
- 2592257045U, // <0,4,2,7>: Cost 3 vext1 <7,0,4,2>, <7,0,4,2>
- 1946996040U, // <0,4,2,u>: Cost 2 vtrnl LHS, RHS
- 3692349590U, // <0,4,3,0>: Cost 4 vext2 <0,2,0,4>, <3,0,1,2>
- 3826878614U, // <0,4,3,1>: Cost 4 vuzpl <0,2,4,6>, <3,0,1,2>
- 3826878625U, // <0,4,3,2>: Cost 4 vuzpl <0,2,4,6>, <3,0,2,4>
- 3692349852U, // <0,4,3,3>: Cost 4 vext2 <0,2,0,4>, <3,3,3,3>
- 3692349954U, // <0,4,3,4>: Cost 4 vext2 <0,2,0,4>, <3,4,5,6>
- 3826878978U, // <0,4,3,5>: Cost 4 vuzpl <0,2,4,6>, <3,4,5,6>
- 4095200566U, // <0,4,3,6>: Cost 4 vtrnl <0,2,3,1>, RHS
- 3713583814U, // <0,4,3,7>: Cost 4 vext2 <3,7,0,4>, <3,7,0,4>
- 3692350238U, // <0,4,3,u>: Cost 4 vext2 <0,2,0,4>, <3,u,1,2>
- 2550464552U, // <0,4,4,0>: Cost 3 vext1 <0,0,4,4>, <0,0,4,4>
- 3962194914U, // <0,4,4,1>: Cost 4 vzipl <0,4,1,5>, <4,1,5,0>
- 3693677631U, // <0,4,4,2>: Cost 4 vext2 <0,4,0,4>, <4,2,6,3>
- 3642124467U, // <0,4,4,3>: Cost 4 vext1 <3,0,4,4>, <3,0,4,4>
- 2718715088U, // <0,4,4,4>: Cost 3 vext3 <5,6,7,0>, <4,4,4,4>
- 2618608950U, // <0,4,4,5>: Cost 3 vext2 <0,2,0,4>, RHS
- 2753137974U, // <0,4,4,6>: Cost 3 vuzpl <0,2,4,6>, RHS
- 3666015255U, // <0,4,4,7>: Cost 4 vext1 <7,0,4,4>, <7,0,4,4>
- 2618609193U, // <0,4,4,u>: Cost 3 vext2 <0,2,0,4>, RHS
- 2568388710U, // <0,4,5,0>: Cost 3 vext1 <3,0,4,5>, LHS
- 2568389526U, // <0,4,5,1>: Cost 3 vext1 <3,0,4,5>, <1,2,3,0>
- 3636159963U, // <0,4,5,2>: Cost 4 vext1 <2,0,4,5>, <2,0,4,5>
- 2568390836U, // <0,4,5,3>: Cost 3 vext1 <3,0,4,5>, <3,0,4,5>
- 2568391990U, // <0,4,5,4>: Cost 3 vext1 <3,0,4,5>, RHS
- 2718715180U, // <0,4,5,5>: Cost 3 vext3 <5,6,7,0>, <4,5,5,6>
- 1618136374U, // <0,4,5,6>: Cost 2 vext3 <1,2,3,0>, RHS
- 2592281624U, // <0,4,5,7>: Cost 3 vext1 <7,0,4,5>, <7,0,4,5>
- 1618136392U, // <0,4,5,u>: Cost 2 vext3 <1,2,3,0>, RHS
- 2550480938U, // <0,4,6,0>: Cost 3 vext1 <0,0,4,6>, <0,0,4,6>
- 3826880801U, // <0,4,6,1>: Cost 4 vuzpl <0,2,4,6>, <6,0,1,2>
- 2562426332U, // <0,4,6,2>: Cost 3 vext1 <2,0,4,6>, <2,0,4,6>
- 3786190181U, // <0,4,6,3>: Cost 4 vext3 <4,6,3,0>, <4,6,3,0>
- 2718715252U, // <0,4,6,4>: Cost 3 vext3 <5,6,7,0>, <4,6,4,6>
- 3826881165U, // <0,4,6,5>: Cost 4 vuzpl <0,2,4,6>, <6,4,5,6>
- 2712669568U, // <0,4,6,6>: Cost 3 vext3 <4,6,6,0>, <4,6,6,0>
- 2657760081U, // <0,4,6,7>: Cost 3 vext2 <6,7,0,4>, <6,7,0,4>
- 2718715284U, // <0,4,6,u>: Cost 3 vext3 <5,6,7,0>, <4,6,u,2>
- 3654090854U, // <0,4,7,0>: Cost 4 vext1 <5,0,4,7>, LHS
- 3934229326U, // <0,4,7,1>: Cost 4 vuzpr <7,0,1,4>, <6,7,0,1>
- 3734156437U, // <0,4,7,2>: Cost 4 vext2 <7,2,0,4>, <7,2,0,4>
- 3734820070U, // <0,4,7,3>: Cost 4 vext2 <7,3,0,4>, <7,3,0,4>
- 3654094134U, // <0,4,7,4>: Cost 4 vext1 <5,0,4,7>, RHS
- 2713259464U, // <0,4,7,5>: Cost 3 vext3 <4,7,5,0>, <4,7,5,0>
- 2713333201U, // <0,4,7,6>: Cost 3 vext3 <4,7,6,0>, <4,7,6,0>
- 3654095866U, // <0,4,7,7>: Cost 4 vext1 <5,0,4,7>, <7,0,1,2>
- 2713259464U, // <0,4,7,u>: Cost 3 vext3 <4,7,5,0>, <4,7,5,0>
- 2568413286U, // <0,4,u,0>: Cost 3 vext1 <3,0,4,u>, LHS
- 2618611502U, // <0,4,u,1>: Cost 3 vext2 <0,2,0,4>, LHS
- 2753140526U, // <0,4,u,2>: Cost 3 vuzpl <0,2,4,6>, LHS
- 2568415415U, // <0,4,u,3>: Cost 3 vext1 <3,0,4,u>, <3,0,4,u>
- 2568416566U, // <0,4,u,4>: Cost 3 vext1 <3,0,4,u>, RHS
- 1817423158U, // <0,4,u,5>: Cost 2 vzipl LHS, RHS
- 1947438390U, // <0,4,u,6>: Cost 2 vtrnl LHS, RHS
- 2592306203U, // <0,4,u,7>: Cost 3 vext1 <7,0,4,u>, <7,0,4,u>
- 1947438408U, // <0,4,u,u>: Cost 2 vtrnl LHS, RHS
- 3630219264U, // <0,5,0,0>: Cost 4 vext1 <1,0,5,0>, <0,0,0,0>
- 2625912934U, // <0,5,0,1>: Cost 3 vext2 <1,4,0,5>, LHS
- 3692355748U, // <0,5,0,2>: Cost 4 vext2 <0,2,0,5>, <0,2,0,2>
- 3693019384U, // <0,5,0,3>: Cost 4 vext2 <0,3,0,5>, <0,3,0,5>
- 3630222646U, // <0,5,0,4>: Cost 4 vext1 <1,0,5,0>, RHS
- 3699655062U, // <0,5,0,5>: Cost 4 vext2 <1,4,0,5>, <0,5,0,1>
- 2718715508U, // <0,5,0,6>: Cost 3 vext3 <5,6,7,0>, <5,0,6,1>
- 3087011126U, // <0,5,0,7>: Cost 3 vtrnr <0,0,0,0>, RHS
- 2625913501U, // <0,5,0,u>: Cost 3 vext2 <1,4,0,5>, LHS
- 1500659814U, // <0,5,1,0>: Cost 2 vext1 <4,0,5,1>, LHS
- 2886520528U, // <0,5,1,1>: Cost 3 vzipl LHS, <5,1,7,3>
- 2574403176U, // <0,5,1,2>: Cost 3 vext1 <4,0,5,1>, <2,2,2,2>
- 2574403734U, // <0,5,1,3>: Cost 3 vext1 <4,0,5,1>, <3,0,1,2>
- 1500662674U, // <0,5,1,4>: Cost 2 vext1 <4,0,5,1>, <4,0,5,1>
- 2886520836U, // <0,5,1,5>: Cost 3 vzipl LHS, <5,5,5,5>
- 2886520930U, // <0,5,1,6>: Cost 3 vzipl LHS, <5,6,7,0>
- 2718715600U, // <0,5,1,7>: Cost 3 vext3 <5,6,7,0>, <5,1,7,3>
- 1500665646U, // <0,5,1,u>: Cost 2 vext1 <4,0,5,1>, LHS
- 2556493926U, // <0,5,2,0>: Cost 3 vext1 <1,0,5,2>, LHS
- 2244546120U, // <0,5,2,1>: Cost 3 vrev <5,0,1,2>
- 3692357256U, // <0,5,2,2>: Cost 4 vext2 <0,2,0,5>, <2,2,5,7>
- 2568439994U, // <0,5,2,3>: Cost 3 vext1 <3,0,5,2>, <3,0,5,2>
- 2556497206U, // <0,5,2,4>: Cost 3 vext1 <1,0,5,2>, RHS
- 3020738564U, // <0,5,2,5>: Cost 3 vtrnl LHS, <5,5,5,5>
- 4027877161U, // <0,5,2,6>: Cost 4 vzipr <0,2,0,2>, <2,4,5,6>
- 3093220662U, // <0,5,2,7>: Cost 3 vtrnr <1,0,3,2>, RHS
- 3093220663U, // <0,5,2,u>: Cost 3 vtrnr <1,0,3,2>, RHS
- 3699656854U, // <0,5,3,0>: Cost 4 vext2 <1,4,0,5>, <3,0,1,2>
- 3699656927U, // <0,5,3,1>: Cost 4 vext2 <1,4,0,5>, <3,1,0,3>
- 3699657006U, // <0,5,3,2>: Cost 4 vext2 <1,4,0,5>, <3,2,0,1>
- 3699657116U, // <0,5,3,3>: Cost 4 vext2 <1,4,0,5>, <3,3,3,3>
- 2637859284U, // <0,5,3,4>: Cost 3 vext2 <3,4,0,5>, <3,4,0,5>
- 3790319453U, // <0,5,3,5>: Cost 4 vext3 <5,3,5,0>, <5,3,5,0>
- 3699657354U, // <0,5,3,6>: Cost 4 vext2 <1,4,0,5>, <3,6,2,7>
- 2716725103U, // <0,5,3,7>: Cost 3 vext3 <5,3,7,0>, <5,3,7,0>
- 2716798840U, // <0,5,3,u>: Cost 3 vext3 <5,3,u,0>, <5,3,u,0>
- 2661747602U, // <0,5,4,0>: Cost 3 vext2 <7,4,0,5>, <4,0,5,1>
- 3630252810U, // <0,5,4,1>: Cost 4 vext1 <1,0,5,4>, <1,0,5,4>
- 3636225507U, // <0,5,4,2>: Cost 4 vext1 <2,0,5,4>, <2,0,5,4>
- 3716910172U, // <0,5,4,3>: Cost 4 vext2 <4,3,0,5>, <4,3,0,5>
- 3962195892U, // <0,5,4,4>: Cost 4 vzipl <0,4,1,5>, <5,4,5,6>
- 2625916214U, // <0,5,4,5>: Cost 3 vext2 <1,4,0,5>, RHS
- 3718901071U, // <0,5,4,6>: Cost 4 vext2 <4,6,0,5>, <4,6,0,5>
- 2718715846U, // <0,5,4,7>: Cost 3 vext3 <5,6,7,0>, <5,4,7,6>
- 2625916457U, // <0,5,4,u>: Cost 3 vext2 <1,4,0,5>, RHS
- 3791278034U, // <0,5,5,0>: Cost 4 vext3 <5,5,0,0>, <5,5,0,0>
- 3791351771U, // <0,5,5,1>: Cost 4 vext3 <5,5,1,0>, <5,5,1,0>
- 3318386260U, // <0,5,5,2>: Cost 4 vrev <5,0,2,5>
- 3791499245U, // <0,5,5,3>: Cost 4 vext3 <5,5,3,0>, <5,5,3,0>
- 3318533734U, // <0,5,5,4>: Cost 4 vrev <5,0,4,5>
- 2718715908U, // <0,5,5,5>: Cost 3 vext3 <5,6,7,0>, <5,5,5,5>
- 2657767522U, // <0,5,5,6>: Cost 3 vext2 <6,7,0,5>, <5,6,7,0>
- 2718715928U, // <0,5,5,7>: Cost 3 vext3 <5,6,7,0>, <5,5,7,7>
- 2718715937U, // <0,5,5,u>: Cost 3 vext3 <5,6,7,0>, <5,5,u,7>
- 2592358502U, // <0,5,6,0>: Cost 3 vext1 <7,0,5,6>, LHS
- 3792015404U, // <0,5,6,1>: Cost 4 vext3 <5,6,1,0>, <5,6,1,0>
- 3731509754U, // <0,5,6,2>: Cost 4 vext2 <6,7,0,5>, <6,2,7,3>
- 3785748546U, // <0,5,6,3>: Cost 4 vext3 <4,5,6,0>, <5,6,3,4>
- 2592361782U, // <0,5,6,4>: Cost 3 vext1 <7,0,5,6>, RHS
- 2592362594U, // <0,5,6,5>: Cost 3 vext1 <7,0,5,6>, <5,6,7,0>
- 3785748576U, // <0,5,6,6>: Cost 4 vext3 <4,5,6,0>, <5,6,6,7>
- 1644974178U, // <0,5,6,7>: Cost 2 vext3 <5,6,7,0>, <5,6,7,0>
- 1645047915U, // <0,5,6,u>: Cost 2 vext3 <5,6,u,0>, <5,6,u,0>
- 2562506854U, // <0,5,7,0>: Cost 3 vext1 <2,0,5,7>, LHS
- 2562507670U, // <0,5,7,1>: Cost 3 vext1 <2,0,5,7>, <1,2,3,0>
- 2562508262U, // <0,5,7,2>: Cost 3 vext1 <2,0,5,7>, <2,0,5,7>
- 3636250774U, // <0,5,7,3>: Cost 4 vext1 <2,0,5,7>, <3,0,1,2>
- 2562510134U, // <0,5,7,4>: Cost 3 vext1 <2,0,5,7>, RHS
- 2718716072U, // <0,5,7,5>: Cost 3 vext3 <5,6,7,0>, <5,7,5,7>
- 2718716074U, // <0,5,7,6>: Cost 3 vext3 <5,6,7,0>, <5,7,6,0>
- 2719379635U, // <0,5,7,7>: Cost 3 vext3 <5,7,7,0>, <5,7,7,0>
- 2562512686U, // <0,5,7,u>: Cost 3 vext1 <2,0,5,7>, LHS
- 1500717158U, // <0,5,u,0>: Cost 2 vext1 <4,0,5,u>, LHS
- 2625918766U, // <0,5,u,1>: Cost 3 vext2 <1,4,0,5>, LHS
- 2719674583U, // <0,5,u,2>: Cost 3 vext3 <5,u,2,0>, <5,u,2,0>
- 2568489152U, // <0,5,u,3>: Cost 3 vext1 <3,0,5,u>, <3,0,5,u>
- 1500720025U, // <0,5,u,4>: Cost 2 vext1 <4,0,5,u>, <4,0,5,u>
- 2625919130U, // <0,5,u,5>: Cost 3 vext2 <1,4,0,5>, RHS
- 2586407243U, // <0,5,u,6>: Cost 3 vext1 <6,0,5,u>, <6,0,5,u>
- 1646301444U, // <0,5,u,7>: Cost 2 vext3 <5,u,7,0>, <5,u,7,0>
- 1646375181U, // <0,5,u,u>: Cost 2 vext3 <5,u,u,0>, <5,u,u,0>
- 2586411110U, // <0,6,0,0>: Cost 3 vext1 <6,0,6,0>, LHS
- 2619949158U, // <0,6,0,1>: Cost 3 vext2 <0,4,0,6>, LHS
- 2619949220U, // <0,6,0,2>: Cost 3 vext2 <0,4,0,6>, <0,2,0,2>
- 3785748789U, // <0,6,0,3>: Cost 4 vext3 <4,5,6,0>, <6,0,3,4>
- 2619949386U, // <0,6,0,4>: Cost 3 vext2 <0,4,0,6>, <0,4,0,6>
- 2586415202U, // <0,6,0,5>: Cost 3 vext1 <6,0,6,0>, <5,6,7,0>
- 2586415436U, // <0,6,0,6>: Cost 3 vext1 <6,0,6,0>, <6,0,6,0>
- 2952793398U, // <0,6,0,7>: Cost 3 vzipr <0,0,0,0>, RHS
- 2619949725U, // <0,6,0,u>: Cost 3 vext2 <0,4,0,6>, LHS
- 2562531430U, // <0,6,1,0>: Cost 3 vext1 <2,0,6,1>, LHS
- 3693691700U, // <0,6,1,1>: Cost 4 vext2 <0,4,0,6>, <1,1,1,1>
- 2886521338U, // <0,6,1,2>: Cost 3 vzipl LHS, <6,2,7,3>
- 3693691864U, // <0,6,1,3>: Cost 4 vext2 <0,4,0,6>, <1,3,1,3>
- 2562534710U, // <0,6,1,4>: Cost 3 vext1 <2,0,6,1>, RHS
- 2580450932U, // <0,6,1,5>: Cost 3 vext1 <5,0,6,1>, <5,0,6,1>
- 2886521656U, // <0,6,1,6>: Cost 3 vzipl LHS, <6,6,6,6>
- 2966736182U, // <0,6,1,7>: Cost 3 vzipr <2,3,0,1>, RHS
- 2966736183U, // <0,6,1,u>: Cost 3 vzipr <2,3,0,1>, RHS
- 1500741734U, // <0,6,2,0>: Cost 2 vext1 <4,0,6,2>, LHS
- 2250518817U, // <0,6,2,1>: Cost 3 vrev <6,0,1,2>
- 2574485096U, // <0,6,2,2>: Cost 3 vext1 <4,0,6,2>, <2,2,2,2>
- 2631894694U, // <0,6,2,3>: Cost 3 vext2 <2,4,0,6>, <2,3,0,1>
- 1500744604U, // <0,6,2,4>: Cost 2 vext1 <4,0,6,2>, <4,0,6,2>
- 2574487248U, // <0,6,2,5>: Cost 3 vext1 <4,0,6,2>, <5,1,7,3>
- 3020739384U, // <0,6,2,6>: Cost 3 vtrnl LHS, <6,6,6,6>
- 2954136886U, // <0,6,2,7>: Cost 3 vzipr <0,2,0,2>, RHS
- 1500747566U, // <0,6,2,u>: Cost 2 vext1 <4,0,6,2>, LHS
- 3693693078U, // <0,6,3,0>: Cost 4 vext2 <0,4,0,6>, <3,0,1,2>
- 3705637136U, // <0,6,3,1>: Cost 4 vext2 <2,4,0,6>, <3,1,5,7>
- 3705637192U, // <0,6,3,2>: Cost 4 vext2 <2,4,0,6>, <3,2,3,0>
- 3693693340U, // <0,6,3,3>: Cost 4 vext2 <0,4,0,6>, <3,3,3,3>
- 2637867477U, // <0,6,3,4>: Cost 3 vext2 <3,4,0,6>, <3,4,0,6>
- 3705637424U, // <0,6,3,5>: Cost 4 vext2 <2,4,0,6>, <3,5,1,7>
- 3666154056U, // <0,6,3,6>: Cost 4 vext1 <7,0,6,3>, <6,3,7,0>
- 2722697800U, // <0,6,3,7>: Cost 3 vext3 <6,3,7,0>, <6,3,7,0>
- 2722771537U, // <0,6,3,u>: Cost 3 vext3 <6,3,u,0>, <6,3,u,0>
- 2562556006U, // <0,6,4,0>: Cost 3 vext1 <2,0,6,4>, LHS
- 4095316257U, // <0,6,4,1>: Cost 4 vtrnl <0,2,4,6>, <6,0,1,2>
- 2562557420U, // <0,6,4,2>: Cost 3 vext1 <2,0,6,4>, <2,0,6,4>
- 3636299926U, // <0,6,4,3>: Cost 4 vext1 <2,0,6,4>, <3,0,1,2>
- 2562559286U, // <0,6,4,4>: Cost 3 vext1 <2,0,6,4>, RHS
- 2619952438U, // <0,6,4,5>: Cost 3 vext2 <0,4,0,6>, RHS
- 2723287696U, // <0,6,4,6>: Cost 3 vext3 <6,4,6,0>, <6,4,6,0>
- 4027895094U, // <0,6,4,7>: Cost 4 vzipr <0,2,0,4>, RHS
- 2619952681U, // <0,6,4,u>: Cost 3 vext2 <0,4,0,6>, RHS
- 2718716594U, // <0,6,5,0>: Cost 3 vext3 <5,6,7,0>, <6,5,0,7>
- 3648250774U, // <0,6,5,1>: Cost 4 vext1 <4,0,6,5>, <1,2,3,0>
- 3792458436U, // <0,6,5,2>: Cost 4 vext3 <5,6,7,0>, <6,5,2,7>
- 3705638767U, // <0,6,5,3>: Cost 5 vext2 <2,4,0,6>, <5,3,7,0>
- 3648252831U, // <0,6,5,4>: Cost 4 vext1 <4,0,6,5>, <4,0,6,5>
- 3797619416U, // <0,6,5,5>: Cost 4 vext3 <6,5,5,0>, <6,5,5,0>
- 3792458472U, // <0,6,5,6>: Cost 4 vext3 <5,6,7,0>, <6,5,6,7>
- 4035202358U, // <0,6,5,7>: Cost 4 vzipr <1,4,0,5>, RHS
- 2718716594U, // <0,6,5,u>: Cost 3 vext3 <5,6,7,0>, <6,5,0,7>
- 3786412796U, // <0,6,6,0>: Cost 4 vext3 <4,6,6,0>, <6,6,0,0>
- 3792458504U, // <0,6,6,1>: Cost 4 vext3 <5,6,7,0>, <6,6,1,3>
- 3728200126U, // <0,6,6,2>: Cost 4 vext2 <6,2,0,6>, <6,2,0,6>
- 3798135575U, // <0,6,6,3>: Cost 4 vext3 <6,6,3,0>, <6,6,3,0>
- 3786412836U, // <0,6,6,4>: Cost 4 vext3 <4,6,6,0>, <6,6,4,4>
- 3792458543U, // <0,6,6,5>: Cost 4 vext3 <5,6,7,0>, <6,6,5,6>
- 2718716728U, // <0,6,6,6>: Cost 3 vext3 <5,6,7,0>, <6,6,6,6>
- 2718716738U, // <0,6,6,7>: Cost 3 vext3 <5,6,7,0>, <6,6,7,7>
- 2718716747U, // <0,6,6,u>: Cost 3 vext3 <5,6,7,0>, <6,6,u,7>
- 2718716750U, // <0,6,7,0>: Cost 3 vext3 <5,6,7,0>, <6,7,0,1>
- 2724909910U, // <0,6,7,1>: Cost 3 vext3 <6,7,1,0>, <6,7,1,0>
- 3636323823U, // <0,6,7,2>: Cost 4 vext1 <2,0,6,7>, <2,0,6,7>
- 2725057384U, // <0,6,7,3>: Cost 3 vext3 <6,7,3,0>, <6,7,3,0>
- 2718716790U, // <0,6,7,4>: Cost 3 vext3 <5,6,7,0>, <6,7,4,5>
- 2718716800U, // <0,6,7,5>: Cost 3 vext3 <5,6,7,0>, <6,7,5,6>
- 3792458629U, // <0,6,7,6>: Cost 4 vext3 <5,6,7,0>, <6,7,6,2>
- 2725352332U, // <0,6,7,7>: Cost 3 vext3 <6,7,7,0>, <6,7,7,0>
- 2718716822U, // <0,6,7,u>: Cost 3 vext3 <5,6,7,0>, <6,7,u,1>
- 1500790886U, // <0,6,u,0>: Cost 2 vext1 <4,0,6,u>, LHS
- 2619954990U, // <0,6,u,1>: Cost 3 vext2 <0,4,0,6>, LHS
- 2562590192U, // <0,6,u,2>: Cost 3 vext1 <2,0,6,u>, <2,0,6,u>
- 2725721017U, // <0,6,u,3>: Cost 3 vext3 <6,u,3,0>, <6,u,3,0>
- 1500793762U, // <0,6,u,4>: Cost 2 vext1 <4,0,6,u>, <4,0,6,u>
- 2619955354U, // <0,6,u,5>: Cost 3 vext2 <0,4,0,6>, RHS
- 2725942228U, // <0,6,u,6>: Cost 3 vext3 <6,u,6,0>, <6,u,6,0>
- 2954186038U, // <0,6,u,7>: Cost 3 vzipr <0,2,0,u>, RHS
- 1500796718U, // <0,6,u,u>: Cost 2 vext1 <4,0,6,u>, LHS
- 2256401391U, // <0,7,0,0>: Cost 3 vrev <7,0,0,0>
- 2632564838U, // <0,7,0,1>: Cost 3 vext2 <2,5,0,7>, LHS
- 2256548865U, // <0,7,0,2>: Cost 3 vrev <7,0,2,0>
- 3700998396U, // <0,7,0,3>: Cost 4 vext2 <1,6,0,7>, <0,3,1,0>
- 2718716952U, // <0,7,0,4>: Cost 3 vext3 <5,6,7,0>, <7,0,4,5>
- 2718716962U, // <0,7,0,5>: Cost 3 vext3 <5,6,7,0>, <7,0,5,6>
- 2621284845U, // <0,7,0,6>: Cost 3 vext2 <0,6,0,7>, <0,6,0,7>
- 3904685542U, // <0,7,0,7>: Cost 4 vuzpr <2,0,5,7>, <2,0,5,7>
- 2632565405U, // <0,7,0,u>: Cost 3 vext2 <2,5,0,7>, LHS
- 2256409584U, // <0,7,1,0>: Cost 3 vrev <7,0,0,1>
- 3706307380U, // <0,7,1,1>: Cost 4 vext2 <2,5,0,7>, <1,1,1,1>
- 2632565654U, // <0,7,1,2>: Cost 3 vext2 <2,5,0,7>, <1,2,3,0>
- 3769603168U, // <0,7,1,3>: Cost 4 vext3 <1,u,3,0>, <7,1,3,5>
- 2256704532U, // <0,7,1,4>: Cost 3 vrev <7,0,4,1>
- 3769603184U, // <0,7,1,5>: Cost 4 vext3 <1,u,3,0>, <7,1,5,3>
- 3700999366U, // <0,7,1,6>: Cost 4 vext2 <1,6,0,7>, <1,6,0,7>
- 2886522476U, // <0,7,1,7>: Cost 3 vzipl LHS, <7,7,7,7>
- 2256999480U, // <0,7,1,u>: Cost 3 vrev <7,0,u,1>
- 2586501222U, // <0,7,2,0>: Cost 3 vext1 <6,0,7,2>, LHS
- 1182749690U, // <0,7,2,1>: Cost 2 vrev <7,0,1,2>
- 3636356595U, // <0,7,2,2>: Cost 4 vext1 <2,0,7,2>, <2,0,7,2>
- 2727711916U, // <0,7,2,3>: Cost 3 vext3 <7,2,3,0>, <7,2,3,0>
- 2586504502U, // <0,7,2,4>: Cost 3 vext1 <6,0,7,2>, RHS
- 2632566606U, // <0,7,2,5>: Cost 3 vext2 <2,5,0,7>, <2,5,0,7>
- 2586505559U, // <0,7,2,6>: Cost 3 vext1 <6,0,7,2>, <6,0,7,2>
- 3020740204U, // <0,7,2,7>: Cost 3 vtrnl LHS, <7,7,7,7>
- 1183265849U, // <0,7,2,u>: Cost 2 vrev <7,0,u,2>
- 3701000342U, // <0,7,3,0>: Cost 4 vext2 <1,6,0,7>, <3,0,1,2>
- 3706308849U, // <0,7,3,1>: Cost 4 vext2 <2,5,0,7>, <3,1,2,3>
- 3330315268U, // <0,7,3,2>: Cost 4 vrev <7,0,2,3>
- 3706309020U, // <0,7,3,3>: Cost 4 vext2 <2,5,0,7>, <3,3,3,3>
- 3706309122U, // <0,7,3,4>: Cost 4 vext2 <2,5,0,7>, <3,4,5,6>
- 3712281127U, // <0,7,3,5>: Cost 4 vext2 <3,5,0,7>, <3,5,0,7>
- 2639202936U, // <0,7,3,6>: Cost 3 vext2 <3,6,0,7>, <3,6,0,7>
- 3802412321U, // <0,7,3,7>: Cost 4 vext3 <7,3,7,0>, <7,3,7,0>
- 2640530202U, // <0,7,3,u>: Cost 3 vext2 <3,u,0,7>, <3,u,0,7>
- 3654287462U, // <0,7,4,0>: Cost 4 vext1 <5,0,7,4>, LHS
- 2256507900U, // <0,7,4,1>: Cost 3 vrev <7,0,1,4>
- 2256581637U, // <0,7,4,2>: Cost 3 vrev <7,0,2,4>
- 3660262008U, // <0,7,4,3>: Cost 4 vext1 <6,0,7,4>, <3,6,0,7>
- 3786413405U, // <0,7,4,4>: Cost 4 vext3 <4,6,6,0>, <7,4,4,6>
- 2632568118U, // <0,7,4,5>: Cost 3 vext2 <2,5,0,7>, RHS
- 3718917457U, // <0,7,4,6>: Cost 4 vext2 <4,6,0,7>, <4,6,0,7>
- 3787003255U, // <0,7,4,7>: Cost 4 vext3 <4,7,5,0>, <7,4,7,5>
- 2632568361U, // <0,7,4,u>: Cost 3 vext2 <2,5,0,7>, RHS
- 3706310268U, // <0,7,5,0>: Cost 4 vext2 <2,5,0,7>, <5,0,7,0>
- 3792459156U, // <0,7,5,1>: Cost 4 vext3 <5,6,7,0>, <7,5,1,7>
- 3330331654U, // <0,7,5,2>: Cost 4 vrev <7,0,2,5>
- 3722899255U, // <0,7,5,3>: Cost 4 vext2 <5,3,0,7>, <5,3,0,7>
- 2256737304U, // <0,7,5,4>: Cost 3 vrev <7,0,4,5>
- 3724226521U, // <0,7,5,5>: Cost 4 vext2 <5,5,0,7>, <5,5,0,7>
- 2718717377U, // <0,7,5,6>: Cost 3 vext3 <5,6,7,0>, <7,5,6,7>
- 2729997763U, // <0,7,5,7>: Cost 3 vext3 <7,5,7,0>, <7,5,7,0>
- 2720044499U, // <0,7,5,u>: Cost 3 vext3 <5,u,7,0>, <7,5,u,7>
- 3712946517U, // <0,7,6,0>: Cost 4 vext2 <3,6,0,7>, <6,0,7,0>
- 2256524286U, // <0,7,6,1>: Cost 3 vrev <7,0,1,6>
- 3792459246U, // <0,7,6,2>: Cost 4 vext3 <5,6,7,0>, <7,6,2,7>
- 3796440567U, // <0,7,6,3>: Cost 4 vext3 <6,3,7,0>, <7,6,3,7>
- 3654307126U, // <0,7,6,4>: Cost 4 vext1 <5,0,7,6>, RHS
- 2656457394U, // <0,7,6,5>: Cost 3 vext2 <6,5,0,7>, <6,5,0,7>
- 3792459281U, // <0,7,6,6>: Cost 4 vext3 <5,6,7,0>, <7,6,6,6>
- 2730661396U, // <0,7,6,7>: Cost 3 vext3 <7,6,7,0>, <7,6,7,0>
- 2658448293U, // <0,7,6,u>: Cost 3 vext2 <6,u,0,7>, <6,u,0,7>
- 3787003431U, // <0,7,7,0>: Cost 4 vext3 <4,7,5,0>, <7,7,0,1>
- 3654312854U, // <0,7,7,1>: Cost 4 vext1 <5,0,7,7>, <1,2,3,0>
- 3654313446U, // <0,7,7,2>: Cost 4 vext1 <5,0,7,7>, <2,0,5,7>
- 3804771905U, // <0,7,7,3>: Cost 4 vext3 <7,7,3,0>, <7,7,3,0>
- 3654315318U, // <0,7,7,4>: Cost 4 vext1 <5,0,7,7>, RHS
- 3654315651U, // <0,7,7,5>: Cost 4 vext1 <5,0,7,7>, <5,0,7,7>
- 3660288348U, // <0,7,7,6>: Cost 4 vext1 <6,0,7,7>, <6,0,7,7>
- 2718717548U, // <0,7,7,7>: Cost 3 vext3 <5,6,7,0>, <7,7,7,7>
- 2664420990U, // <0,7,7,u>: Cost 3 vext2 <7,u,0,7>, <7,u,0,7>
- 2256466935U, // <0,7,u,0>: Cost 3 vrev <7,0,0,u>
- 1182798848U, // <0,7,u,1>: Cost 2 vrev <7,0,1,u>
- 2256614409U, // <0,7,u,2>: Cost 3 vrev <7,0,2,u>
- 2731693714U, // <0,7,u,3>: Cost 3 vext3 <7,u,3,0>, <7,u,3,0>
- 2256761883U, // <0,7,u,4>: Cost 3 vrev <7,0,4,u>
- 2632571034U, // <0,7,u,5>: Cost 3 vext2 <2,5,0,7>, RHS
- 2669066421U, // <0,7,u,6>: Cost 3 vext2 <u,6,0,7>, <u,6,0,7>
- 2731988662U, // <0,7,u,7>: Cost 3 vext3 <7,u,7,0>, <7,u,7,0>
- 1183315007U, // <0,7,u,u>: Cost 2 vrev <7,0,u,u>
- 135053414U, // <0,u,0,0>: Cost 1 vdup0 LHS
- 1544896614U, // <0,u,0,1>: Cost 2 vext2 <0,2,0,u>, LHS
- 1678999654U, // <0,u,0,2>: Cost 2 vuzpl LHS, LHS
- 2691880677U, // <0,u,0,3>: Cost 3 vext3 <1,2,3,0>, <u,0,3,2>
- 1476988214U, // <0,u,0,4>: Cost 2 vext1 <0,0,u,0>, RHS
- 2718791419U, // <0,u,0,5>: Cost 3 vext3 <5,6,u,0>, <u,0,5,6>
- 3021248666U, // <0,u,0,6>: Cost 3 vtrnl <0,2,0,2>, RHS
- 2592535607U, // <0,u,0,7>: Cost 3 vext1 <7,0,u,0>, <7,0,u,0>
- 135053414U, // <0,u,0,u>: Cost 1 vdup0 LHS
- 1476993097U, // <0,u,1,0>: Cost 2 vext1 <0,0,u,1>, <0,0,u,1>
- 1812780846U, // <0,u,1,1>: Cost 2 vzipl LHS, LHS
- 1618138926U, // <0,u,1,2>: Cost 2 vext3 <1,2,3,0>, LHS
- 2752742134U, // <0,u,1,3>: Cost 3 vuzpl LHS, <1,0,3,2>
- 1476996406U, // <0,u,1,4>: Cost 2 vext1 <0,0,u,1>, RHS
- 1812781210U, // <0,u,1,5>: Cost 2 vzipl LHS, RHS
- 2887006416U, // <0,u,1,6>: Cost 3 vzipl LHS, <u,6,3,7>
- 2966736200U, // <0,u,1,7>: Cost 3 vzipr <2,3,0,1>, RHS
- 1812781413U, // <0,u,1,u>: Cost 2 vzipl LHS, LHS
- 1482973286U, // <0,u,2,0>: Cost 2 vext1 <1,0,u,2>, LHS
- 1482973987U, // <0,u,2,1>: Cost 2 vext1 <1,0,u,2>, <1,0,u,2>
- 1946998574U, // <0,u,2,2>: Cost 2 vtrnl LHS, LHS
- 835584U, // <0,u,2,3>: Cost 0 copy LHS
- 1482976566U, // <0,u,2,4>: Cost 2 vext1 <1,0,u,2>, RHS
- 3020781631U, // <0,u,2,5>: Cost 3 vtrnl LHS, <u,4,5,6>
- 1946998938U, // <0,u,2,6>: Cost 2 vtrnl LHS, RHS
- 1518810169U, // <0,u,2,7>: Cost 2 vext1 <7,0,u,2>, <7,0,u,2>
- 835584U, // <0,u,2,u>: Cost 0 copy LHS
- 2618640534U, // <0,u,3,0>: Cost 3 vext2 <0,2,0,u>, <3,0,1,2>
- 2752743574U, // <0,u,3,1>: Cost 3 vuzpl LHS, <3,0,1,2>
- 2636556597U, // <0,u,3,2>: Cost 3 vext2 <3,2,0,u>, <3,2,0,u>
- 2752743836U, // <0,u,3,3>: Cost 3 vuzpl LHS, <3,3,3,3>
- 2618640898U, // <0,u,3,4>: Cost 3 vext2 <0,2,0,u>, <3,4,5,6>
- 2752743938U, // <0,u,3,5>: Cost 3 vuzpl LHS, <3,4,5,6>
- 2639202936U, // <0,u,3,6>: Cost 3 vext2 <3,6,0,7>, <3,6,0,7>
- 2639874762U, // <0,u,3,7>: Cost 3 vext2 <3,7,0,u>, <3,7,0,u>
- 2752743637U, // <0,u,3,u>: Cost 3 vuzpl LHS, <3,0,u,2>
- 2562703462U, // <0,u,4,0>: Cost 3 vext1 <2,0,u,4>, LHS
- 2888455982U, // <0,u,4,1>: Cost 3 vzipl <0,4,1,5>, LHS
- 3021575982U, // <0,u,4,2>: Cost 3 vtrnl <0,2,4,6>, LHS
- 2568677591U, // <0,u,4,3>: Cost 3 vext1 <3,0,u,4>, <3,0,u,4>
- 2562706742U, // <0,u,4,4>: Cost 3 vext1 <2,0,u,4>, RHS
- 1544899894U, // <0,u,4,5>: Cost 2 vext2 <0,2,0,u>, RHS
- 1679002934U, // <0,u,4,6>: Cost 2 vuzpl LHS, RHS
- 2718718033U, // <0,u,4,7>: Cost 3 vext3 <5,6,7,0>, <u,4,7,6>
- 1679002952U, // <0,u,4,u>: Cost 2 vuzpl LHS, RHS
- 2568683622U, // <0,u,5,0>: Cost 3 vext1 <3,0,u,5>, LHS
- 2568684438U, // <0,u,5,1>: Cost 3 vext1 <3,0,u,5>, <1,2,3,0>
- 3765622902U, // <0,u,5,2>: Cost 4 vext3 <1,2,3,0>, <u,5,2,7>
- 2691881087U, // <0,u,5,3>: Cost 3 vext3 <1,2,3,0>, <u,5,3,7>
- 2568686902U, // <0,u,5,4>: Cost 3 vext1 <3,0,u,5>, RHS
- 2650492890U, // <0,u,5,5>: Cost 3 vext2 <5,5,0,u>, <5,5,0,u>
- 1618139290U, // <0,u,5,6>: Cost 2 vext3 <1,2,3,0>, RHS
- 2824834358U, // <0,u,5,7>: Cost 3 vuzpr <1,0,3,u>, RHS
- 1618139308U, // <0,u,5,u>: Cost 2 vext3 <1,2,3,0>, RHS
- 2592579686U, // <0,u,6,0>: Cost 3 vext1 <7,0,u,6>, LHS
- 2262496983U, // <0,u,6,1>: Cost 3 vrev <u,0,1,6>
- 2654474688U, // <0,u,6,2>: Cost 3 vext2 <6,2,0,u>, <6,2,0,u>
- 2691881168U, // <0,u,6,3>: Cost 3 vext3 <1,2,3,0>, <u,6,3,7>
- 2592582966U, // <0,u,6,4>: Cost 3 vext1 <7,0,u,6>, RHS
- 2656465587U, // <0,u,6,5>: Cost 3 vext2 <6,5,0,u>, <6,5,0,u>
- 2657129220U, // <0,u,6,6>: Cost 3 vext2 <6,6,0,u>, <6,6,0,u>
- 1584051029U, // <0,u,6,7>: Cost 2 vext2 <6,7,0,u>, <6,7,0,u>
- 1584714662U, // <0,u,6,u>: Cost 2 vext2 <6,u,0,u>, <6,u,0,u>
- 2562728038U, // <0,u,7,0>: Cost 3 vext1 <2,0,u,7>, LHS
- 2562728854U, // <0,u,7,1>: Cost 3 vext1 <2,0,u,7>, <1,2,3,0>
- 2562729473U, // <0,u,7,2>: Cost 3 vext1 <2,0,u,7>, <2,0,u,7>
- 2661111018U, // <0,u,7,3>: Cost 3 vext2 <7,3,0,u>, <7,3,0,u>
- 2562731318U, // <0,u,7,4>: Cost 3 vext1 <2,0,u,7>, RHS
- 2718718258U, // <0,u,7,5>: Cost 3 vext3 <5,6,7,0>, <u,7,5,6>
- 2586620261U, // <0,u,7,6>: Cost 3 vext1 <6,0,u,7>, <6,0,u,7>
- 2657793644U, // <0,u,7,7>: Cost 3 vext2 <6,7,0,u>, <7,7,7,7>
- 2562733870U, // <0,u,7,u>: Cost 3 vext1 <2,0,u,7>, LHS
- 135053414U, // <0,u,u,0>: Cost 1 vdup0 LHS
- 1544902446U, // <0,u,u,1>: Cost 2 vext2 <0,2,0,u>, LHS
- 1679005486U, // <0,u,u,2>: Cost 2 vuzpl LHS, LHS
- 835584U, // <0,u,u,3>: Cost 0 copy LHS
- 1483025718U, // <0,u,u,4>: Cost 2 vext1 <1,0,u,u>, RHS
- 1544902810U, // <0,u,u,5>: Cost 2 vext2 <0,2,0,u>, RHS
- 1679005850U, // <0,u,u,6>: Cost 2 vuzpl LHS, RHS
- 1518859327U, // <0,u,u,7>: Cost 2 vext1 <7,0,u,u>, <7,0,u,u>
- 835584U, // <0,u,u,u>: Cost 0 copy LHS
- 2689744896U, // <1,0,0,0>: Cost 3 vext3 <0,u,1,1>, <0,0,0,0>
- 1610694666U, // <1,0,0,1>: Cost 2 vext3 <0,0,1,1>, <0,0,1,1>
- 2689744916U, // <1,0,0,2>: Cost 3 vext3 <0,u,1,1>, <0,0,2,2>
- 2619310332U, // <1,0,0,3>: Cost 3 vext2 <0,3,1,0>, <0,3,1,0>
- 2684657701U, // <1,0,0,4>: Cost 3 vext3 <0,0,4,1>, <0,0,4,1>
- 2620637598U, // <1,0,0,5>: Cost 3 vext2 <0,5,1,0>, <0,5,1,0>
- 3708977654U, // <1,0,0,6>: Cost 4 vext2 <3,0,1,0>, <0,6,1,7>
- 3666351168U, // <1,0,0,7>: Cost 4 vext1 <7,1,0,0>, <7,1,0,0>
- 1611210825U, // <1,0,0,u>: Cost 2 vext3 <0,0,u,1>, <0,0,u,1>
- 2556780646U, // <1,0,1,0>: Cost 3 vext1 <1,1,0,1>, LHS
- 2556781355U, // <1,0,1,1>: Cost 3 vext1 <1,1,0,1>, <1,1,0,1>
- 1616003174U, // <1,0,1,2>: Cost 2 vext3 <0,u,1,1>, LHS
- 3693052888U, // <1,0,1,3>: Cost 4 vext2 <0,3,1,0>, <1,3,1,3>
- 2556783926U, // <1,0,1,4>: Cost 3 vext1 <1,1,0,1>, RHS
- 2580672143U, // <1,0,1,5>: Cost 3 vext1 <5,1,0,1>, <5,1,0,1>
- 2724839566U, // <1,0,1,6>: Cost 3 vext3 <6,7,0,1>, <0,1,6,7>
- 3654415354U, // <1,0,1,7>: Cost 4 vext1 <5,1,0,1>, <7,0,1,2>
- 1616003228U, // <1,0,1,u>: Cost 2 vext3 <0,u,1,1>, LHS
- 2685690019U, // <1,0,2,0>: Cost 3 vext3 <0,2,0,1>, <0,2,0,1>
- 2685763756U, // <1,0,2,1>: Cost 3 vext3 <0,2,1,1>, <0,2,1,1>
- 2698297524U, // <1,0,2,2>: Cost 3 vext3 <2,3,0,1>, <0,2,2,0>
- 2685911230U, // <1,0,2,3>: Cost 3 vext3 <0,2,3,1>, <0,2,3,1>
- 2689745100U, // <1,0,2,4>: Cost 3 vext3 <0,u,1,1>, <0,2,4,6>
- 3764814038U, // <1,0,2,5>: Cost 4 vext3 <1,1,1,1>, <0,2,5,7>
- 2724839640U, // <1,0,2,6>: Cost 3 vext3 <6,7,0,1>, <0,2,6,0>
- 2592625658U, // <1,0,2,7>: Cost 3 vext1 <7,1,0,2>, <7,0,1,2>
- 2686279915U, // <1,0,2,u>: Cost 3 vext3 <0,2,u,1>, <0,2,u,1>
- 3087843328U, // <1,0,3,0>: Cost 3 vtrnr LHS, <0,0,0,0>
- 3087843338U, // <1,0,3,1>: Cost 3 vtrnr LHS, <0,0,1,1>
- 67944550U, // <1,0,3,2>: Cost 1 vrev LHS
- 2568743135U, // <1,0,3,3>: Cost 3 vext1 <3,1,0,3>, <3,1,0,3>
- 2562772278U, // <1,0,3,4>: Cost 3 vext1 <2,1,0,3>, RHS
- 4099850454U, // <1,0,3,5>: Cost 4 vtrnl <1,0,3,2>, <0,2,5,7>
- 3704998538U, // <1,0,3,6>: Cost 4 vext2 <2,3,1,0>, <3,6,2,7>
- 2592633923U, // <1,0,3,7>: Cost 3 vext1 <7,1,0,3>, <7,1,0,3>
- 68386972U, // <1,0,3,u>: Cost 1 vrev LHS
- 2620640146U, // <1,0,4,0>: Cost 3 vext2 <0,5,1,0>, <4,0,5,1>
- 2689745234U, // <1,0,4,1>: Cost 3 vext3 <0,u,1,1>, <0,4,1,5>
- 2689745244U, // <1,0,4,2>: Cost 3 vext3 <0,u,1,1>, <0,4,2,6>
- 3760980320U, // <1,0,4,3>: Cost 4 vext3 <0,4,3,1>, <0,4,3,1>
- 3761054057U, // <1,0,4,4>: Cost 4 vext3 <0,4,4,1>, <0,4,4,1>
- 2619313462U, // <1,0,4,5>: Cost 3 vext2 <0,3,1,0>, RHS
- 3761201531U, // <1,0,4,6>: Cost 4 vext3 <0,4,6,1>, <0,4,6,1>
- 3666383940U, // <1,0,4,7>: Cost 4 vext1 <7,1,0,4>, <7,1,0,4>
- 2619313705U, // <1,0,4,u>: Cost 3 vext2 <0,3,1,0>, RHS
- 4029300736U, // <1,0,5,0>: Cost 4 vzipr <0,4,1,5>, <0,0,0,0>
- 2895249510U, // <1,0,5,1>: Cost 3 vzipl <1,5,3,7>, LHS
- 3028287590U, // <1,0,5,2>: Cost 3 vtrnl <1,3,5,7>, LHS
- 3642501345U, // <1,0,5,3>: Cost 4 vext1 <3,1,0,5>, <3,1,0,5>
- 2215592058U, // <1,0,5,4>: Cost 3 vrev <0,1,4,5>
- 3724242907U, // <1,0,5,5>: Cost 4 vext2 <5,5,1,0>, <5,5,1,0>
- 3724906540U, // <1,0,5,6>: Cost 4 vext2 <5,6,1,0>, <5,6,1,0>
- 3911118134U, // <1,0,5,7>: Cost 4 vuzpr <3,1,3,0>, RHS
- 3028287644U, // <1,0,5,u>: Cost 3 vtrnl <1,3,5,7>, LHS
- 3762086375U, // <1,0,6,0>: Cost 4 vext3 <0,6,0,1>, <0,6,0,1>
- 2698297846U, // <1,0,6,1>: Cost 3 vext3 <2,3,0,1>, <0,6,1,7>
- 3760022015U, // <1,0,6,2>: Cost 4 vext3 <0,2,u,1>, <0,6,2,7>
- 3642509538U, // <1,0,6,3>: Cost 4 vext1 <3,1,0,6>, <3,1,0,6>
- 3762381323U, // <1,0,6,4>: Cost 4 vext3 <0,6,4,1>, <0,6,4,1>
- 3730215604U, // <1,0,6,5>: Cost 4 vext2 <6,5,1,0>, <6,5,1,0>
- 3730879237U, // <1,0,6,6>: Cost 4 vext2 <6,6,1,0>, <6,6,1,0>
- 2657801046U, // <1,0,6,7>: Cost 3 vext2 <6,7,1,0>, <6,7,1,0>
- 2658464679U, // <1,0,6,u>: Cost 3 vext2 <6,u,1,0>, <6,u,1,0>
- 2659128312U, // <1,0,7,0>: Cost 3 vext2 <7,0,1,0>, <7,0,1,0>
- 4047898278U, // <1,0,7,1>: Cost 4 vzipr <3,5,1,7>, <2,3,0,1>
- 2215460970U, // <1,0,7,2>: Cost 3 vrev <0,1,2,7>
- 3734861035U, // <1,0,7,3>: Cost 4 vext2 <7,3,1,0>, <7,3,1,0>
- 3731543398U, // <1,0,7,4>: Cost 4 vext2 <6,7,1,0>, <7,4,5,6>
- 3736188301U, // <1,0,7,5>: Cost 4 vext2 <7,5,1,0>, <7,5,1,0>
- 2663110110U, // <1,0,7,6>: Cost 3 vext2 <7,6,1,0>, <7,6,1,0>
- 3731543660U, // <1,0,7,7>: Cost 4 vext2 <6,7,1,0>, <7,7,7,7>
- 2664437376U, // <1,0,7,u>: Cost 3 vext2 <7,u,1,0>, <7,u,1,0>
- 3087884288U, // <1,0,u,0>: Cost 3 vtrnr LHS, <0,0,0,0>
- 1616003730U, // <1,0,u,1>: Cost 2 vext3 <0,u,1,1>, <0,u,1,1>
- 67985515U, // <1,0,u,2>: Cost 1 vrev LHS
- 2689893028U, // <1,0,u,3>: Cost 3 vext3 <0,u,3,1>, <0,u,3,1>
- 2689745586U, // <1,0,u,4>: Cost 3 vext3 <0,u,1,1>, <0,u,4,6>
- 2619316378U, // <1,0,u,5>: Cost 3 vext2 <0,3,1,0>, RHS
- 2669082807U, // <1,0,u,6>: Cost 3 vext2 <u,6,1,0>, <u,6,1,0>
- 2592674888U, // <1,0,u,7>: Cost 3 vext1 <7,1,0,u>, <7,1,0,u>
- 68427937U, // <1,0,u,u>: Cost 1 vrev LHS
- 1543585802U, // <1,1,0,0>: Cost 2 vext2 <0,0,1,1>, <0,0,1,1>
- 1548894310U, // <1,1,0,1>: Cost 2 vext2 <0,u,1,1>, LHS
- 2618654892U, // <1,1,0,2>: Cost 3 vext2 <0,2,1,1>, <0,2,1,1>
- 2689745654U, // <1,1,0,3>: Cost 3 vext3 <0,u,1,1>, <1,0,3,2>
- 2622636370U, // <1,1,0,4>: Cost 3 vext2 <0,u,1,1>, <0,4,1,5>
- 2620645791U, // <1,1,0,5>: Cost 3 vext2 <0,5,1,1>, <0,5,1,1>
- 3696378367U, // <1,1,0,6>: Cost 4 vext2 <0,u,1,1>, <0,6,2,7>
- 3666424905U, // <1,1,0,7>: Cost 4 vext1 <7,1,1,0>, <7,1,1,0>
- 1548894866U, // <1,1,0,u>: Cost 2 vext2 <0,u,1,1>, <0,u,1,1>
- 1483112550U, // <1,1,1,0>: Cost 2 vext1 <1,1,1,1>, LHS
- 202162278U, // <1,1,1,1>: Cost 1 vdup1 LHS
- 2622636950U, // <1,1,1,2>: Cost 3 vext2 <0,u,1,1>, <1,2,3,0>
- 2622637016U, // <1,1,1,3>: Cost 3 vext2 <0,u,1,1>, <1,3,1,3>
- 1483115830U, // <1,1,1,4>: Cost 2 vext1 <1,1,1,1>, RHS
- 2622637200U, // <1,1,1,5>: Cost 3 vext2 <0,u,1,1>, <1,5,3,7>
- 2622637263U, // <1,1,1,6>: Cost 3 vext2 <0,u,1,1>, <1,6,1,7>
- 2592691274U, // <1,1,1,7>: Cost 3 vext1 <7,1,1,1>, <7,1,1,1>
- 202162278U, // <1,1,1,u>: Cost 1 vdup1 LHS
- 2550890588U, // <1,1,2,0>: Cost 3 vext1 <0,1,1,2>, <0,1,1,2>
- 2617329183U, // <1,1,2,1>: Cost 3 vext2 <0,0,1,1>, <2,1,3,1>
- 2622637672U, // <1,1,2,2>: Cost 3 vext2 <0,u,1,1>, <2,2,2,2>
- 2622637734U, // <1,1,2,3>: Cost 3 vext2 <0,u,1,1>, <2,3,0,1>
- 2550893878U, // <1,1,2,4>: Cost 3 vext1 <0,1,1,2>, RHS
- 3696379744U, // <1,1,2,5>: Cost 4 vext2 <0,u,1,1>, <2,5,2,7>
- 2622638010U, // <1,1,2,6>: Cost 3 vext2 <0,u,1,1>, <2,6,3,7>
- 3804554170U, // <1,1,2,7>: Cost 4 vext3 <7,7,0,1>, <1,2,7,0>
- 2622638139U, // <1,1,2,u>: Cost 3 vext2 <0,u,1,1>, <2,u,0,1>
- 2622638230U, // <1,1,3,0>: Cost 3 vext2 <0,u,1,1>, <3,0,1,2>
- 3087844148U, // <1,1,3,1>: Cost 3 vtrnr LHS, <1,1,1,1>
- 4161585244U, // <1,1,3,2>: Cost 4 vtrnr LHS, <0,1,1,2>
- 2014101606U, // <1,1,3,3>: Cost 2 vtrnr LHS, LHS
- 2622638594U, // <1,1,3,4>: Cost 3 vext2 <0,u,1,1>, <3,4,5,6>
- 2689745920U, // <1,1,3,5>: Cost 3 vext3 <0,u,1,1>, <1,3,5,7>
- 3763487753U, // <1,1,3,6>: Cost 4 vext3 <0,u,1,1>, <1,3,6,7>
- 2592707660U, // <1,1,3,7>: Cost 3 vext1 <7,1,1,3>, <7,1,1,3>
- 2014101611U, // <1,1,3,u>: Cost 2 vtrnr LHS, LHS
- 2556878950U, // <1,1,4,0>: Cost 3 vext1 <1,1,1,4>, LHS
- 2221335351U, // <1,1,4,1>: Cost 3 vrev <1,1,1,4>
- 3696380988U, // <1,1,4,2>: Cost 4 vext2 <0,u,1,1>, <4,2,6,0>
- 3763487805U, // <1,1,4,3>: Cost 4 vext3 <0,u,1,1>, <1,4,3,5>
- 2556882230U, // <1,1,4,4>: Cost 3 vext1 <1,1,1,4>, RHS
- 1548897590U, // <1,1,4,5>: Cost 2 vext2 <0,u,1,1>, RHS
- 2758184246U, // <1,1,4,6>: Cost 3 vuzpl <1,1,1,1>, RHS
- 3666457677U, // <1,1,4,7>: Cost 4 vext1 <7,1,1,4>, <7,1,1,4>
- 1548897833U, // <1,1,4,u>: Cost 2 vext2 <0,u,1,1>, RHS
- 2693653615U, // <1,1,5,0>: Cost 3 vext3 <1,5,0,1>, <1,5,0,1>
- 2617331408U, // <1,1,5,1>: Cost 3 vext2 <0,0,1,1>, <5,1,7,3>
- 4029302934U, // <1,1,5,2>: Cost 4 vzipr <0,4,1,5>, <3,0,1,2>
- 2689746064U, // <1,1,5,3>: Cost 3 vext3 <0,u,1,1>, <1,5,3,7>
- 2221564755U, // <1,1,5,4>: Cost 3 vrev <1,1,4,5>
- 2955559250U, // <1,1,5,5>: Cost 3 vzipr <0,4,1,5>, <0,4,1,5>
- 2617331810U, // <1,1,5,6>: Cost 3 vext2 <0,0,1,1>, <5,6,7,0>
- 2825293110U, // <1,1,5,7>: Cost 3 vuzpr <1,1,1,1>, RHS
- 2689746109U, // <1,1,5,u>: Cost 3 vext3 <0,u,1,1>, <1,5,u,7>
- 3696382241U, // <1,1,6,0>: Cost 4 vext2 <0,u,1,1>, <6,0,1,2>
- 2689746127U, // <1,1,6,1>: Cost 3 vext3 <0,u,1,1>, <1,6,1,7>
- 2617332218U, // <1,1,6,2>: Cost 3 vext2 <0,0,1,1>, <6,2,7,3>
- 3763487969U, // <1,1,6,3>: Cost 4 vext3 <0,u,1,1>, <1,6,3,7>
- 3696382605U, // <1,1,6,4>: Cost 4 vext2 <0,u,1,1>, <6,4,5,6>
- 4029309266U, // <1,1,6,5>: Cost 4 vzipr <0,4,1,6>, <0,4,1,5>
- 2617332536U, // <1,1,6,6>: Cost 3 vext2 <0,0,1,1>, <6,6,6,6>
- 2724840702U, // <1,1,6,7>: Cost 3 vext3 <6,7,0,1>, <1,6,7,0>
- 2725504263U, // <1,1,6,u>: Cost 3 vext3 <6,u,0,1>, <1,6,u,0>
- 2617332720U, // <1,1,7,0>: Cost 3 vext2 <0,0,1,1>, <7,0,0,1>
- 2659800138U, // <1,1,7,1>: Cost 3 vext2 <7,1,1,1>, <7,1,1,1>
- 3691074717U, // <1,1,7,2>: Cost 4 vext2 <0,0,1,1>, <7,2,1,3>
- 4167811174U, // <1,1,7,3>: Cost 4 vtrnr <1,1,5,7>, LHS
- 2617333094U, // <1,1,7,4>: Cost 3 vext2 <0,0,1,1>, <7,4,5,6>
- 3295396702U, // <1,1,7,5>: Cost 4 vrev <1,1,5,7>
- 3803891014U, // <1,1,7,6>: Cost 4 vext3 <7,6,0,1>, <1,7,6,0>
- 2617333356U, // <1,1,7,7>: Cost 3 vext2 <0,0,1,1>, <7,7,7,7>
- 2659800138U, // <1,1,7,u>: Cost 3 vext2 <7,1,1,1>, <7,1,1,1>
- 1483112550U, // <1,1,u,0>: Cost 2 vext1 <1,1,1,1>, LHS
- 202162278U, // <1,1,u,1>: Cost 1 vdup1 LHS
- 2622642056U, // <1,1,u,2>: Cost 3 vext2 <0,u,1,1>, <u,2,3,3>
- 2014142566U, // <1,1,u,3>: Cost 2 vtrnr LHS, LHS
- 1483115830U, // <1,1,u,4>: Cost 2 vext1 <1,1,1,1>, RHS
- 1548900506U, // <1,1,u,5>: Cost 2 vext2 <0,u,1,1>, RHS
- 2622642384U, // <1,1,u,6>: Cost 3 vext2 <0,u,1,1>, <u,6,3,7>
- 2825293353U, // <1,1,u,7>: Cost 3 vuzpr <1,1,1,1>, RHS
- 202162278U, // <1,1,u,u>: Cost 1 vdup1 LHS
- 2635251712U, // <1,2,0,0>: Cost 3 vext2 <3,0,1,2>, <0,0,0,0>
- 1561509990U, // <1,2,0,1>: Cost 2 vext2 <3,0,1,2>, LHS
- 2618663085U, // <1,2,0,2>: Cost 3 vext2 <0,2,1,2>, <0,2,1,2>
- 2696529358U, // <1,2,0,3>: Cost 3 vext3 <2,0,3,1>, <2,0,3,1>
- 2635252050U, // <1,2,0,4>: Cost 3 vext2 <3,0,1,2>, <0,4,1,5>
- 3769533926U, // <1,2,0,5>: Cost 4 vext3 <1,u,2,1>, <2,0,5,7>
- 2621317617U, // <1,2,0,6>: Cost 3 vext2 <0,6,1,2>, <0,6,1,2>
- 2659140170U, // <1,2,0,7>: Cost 3 vext2 <7,0,1,2>, <0,7,2,1>
- 1561510557U, // <1,2,0,u>: Cost 2 vext2 <3,0,1,2>, LHS
- 2623308516U, // <1,2,1,0>: Cost 3 vext2 <1,0,1,2>, <1,0,1,2>
- 2635252532U, // <1,2,1,1>: Cost 3 vext2 <3,0,1,2>, <1,1,1,1>
- 2631271318U, // <1,2,1,2>: Cost 3 vext2 <2,3,1,2>, <1,2,3,0>
- 2958180454U, // <1,2,1,3>: Cost 3 vzipr <0,u,1,1>, LHS
- 2550959414U, // <1,2,1,4>: Cost 3 vext1 <0,1,2,1>, RHS
- 2635252880U, // <1,2,1,5>: Cost 3 vext2 <3,0,1,2>, <1,5,3,7>
- 2635252952U, // <1,2,1,6>: Cost 3 vext2 <3,0,1,2>, <1,6,2,7>
- 3732882731U, // <1,2,1,7>: Cost 4 vext2 <7,0,1,2>, <1,7,3,0>
- 2958180459U, // <1,2,1,u>: Cost 3 vzipr <0,u,1,1>, LHS
- 2629281213U, // <1,2,2,0>: Cost 3 vext2 <2,0,1,2>, <2,0,1,2>
- 2635253280U, // <1,2,2,1>: Cost 3 vext2 <3,0,1,2>, <2,1,3,2>
- 2618664552U, // <1,2,2,2>: Cost 3 vext2 <0,2,1,2>, <2,2,2,2>
- 2689746546U, // <1,2,2,3>: Cost 3 vext3 <0,u,1,1>, <2,2,3,3>
- 3764815485U, // <1,2,2,4>: Cost 4 vext3 <1,1,1,1>, <2,2,4,5>
- 3760023176U, // <1,2,2,5>: Cost 4 vext3 <0,2,u,1>, <2,2,5,7>
- 2635253690U, // <1,2,2,6>: Cost 3 vext2 <3,0,1,2>, <2,6,3,7>
- 2659141610U, // <1,2,2,7>: Cost 3 vext2 <7,0,1,2>, <2,7,0,1>
- 2689746591U, // <1,2,2,u>: Cost 3 vext3 <0,u,1,1>, <2,2,u,3>
- 403488870U, // <1,2,3,0>: Cost 1 vext1 LHS, LHS
- 1477231350U, // <1,2,3,1>: Cost 2 vext1 LHS, <1,0,3,2>
- 1477232232U, // <1,2,3,2>: Cost 2 vext1 LHS, <2,2,2,2>
- 1477233052U, // <1,2,3,3>: Cost 2 vext1 LHS, <3,3,3,3>
- 403492150U, // <1,2,3,4>: Cost 1 vext1 LHS, RHS
- 1525010128U, // <1,2,3,5>: Cost 2 vext1 LHS, <5,1,7,3>
- 1525010938U, // <1,2,3,6>: Cost 2 vext1 LHS, <6,2,7,3>
- 1525011450U, // <1,2,3,7>: Cost 2 vext1 LHS, <7,0,1,2>
- 403494702U, // <1,2,3,u>: Cost 1 vext1 LHS, LHS
- 2641226607U, // <1,2,4,0>: Cost 3 vext2 <4,0,1,2>, <4,0,1,2>
- 3624723446U, // <1,2,4,1>: Cost 4 vext1 <0,1,2,4>, <1,3,4,6>
- 3301123609U, // <1,2,4,2>: Cost 4 vrev <2,1,2,4>
- 2598759198U, // <1,2,4,3>: Cost 3 vext1 <u,1,2,4>, <3,u,1,2>
- 2659142864U, // <1,2,4,4>: Cost 3 vext2 <7,0,1,2>, <4,4,4,4>
- 1561513270U, // <1,2,4,5>: Cost 2 vext2 <3,0,1,2>, RHS
- 2659143028U, // <1,2,4,6>: Cost 3 vext2 <7,0,1,2>, <4,6,4,6>
- 2659143112U, // <1,2,4,7>: Cost 3 vext2 <7,0,1,2>, <4,7,5,0>
- 1561513513U, // <1,2,4,u>: Cost 2 vext2 <3,0,1,2>, RHS
- 2550988902U, // <1,2,5,0>: Cost 3 vext1 <0,1,2,5>, LHS
- 2550989824U, // <1,2,5,1>: Cost 3 vext1 <0,1,2,5>, <1,3,5,7>
- 3624732264U, // <1,2,5,2>: Cost 4 vext1 <0,1,2,5>, <2,2,2,2>
- 2955559014U, // <1,2,5,3>: Cost 3 vzipr <0,4,1,5>, LHS
- 2550992182U, // <1,2,5,4>: Cost 3 vext1 <0,1,2,5>, RHS
- 2659143684U, // <1,2,5,5>: Cost 3 vext2 <7,0,1,2>, <5,5,5,5>
- 2659143778U, // <1,2,5,6>: Cost 3 vext2 <7,0,1,2>, <5,6,7,0>
- 2659143848U, // <1,2,5,7>: Cost 3 vext2 <7,0,1,2>, <5,7,5,7>
- 2550994734U, // <1,2,5,u>: Cost 3 vext1 <0,1,2,5>, LHS
- 2700289945U, // <1,2,6,0>: Cost 3 vext3 <2,6,0,1>, <2,6,0,1>
- 2635256232U, // <1,2,6,1>: Cost 3 vext2 <3,0,1,2>, <6,1,7,2>
- 2659144186U, // <1,2,6,2>: Cost 3 vext2 <7,0,1,2>, <6,2,7,3>
- 2689746874U, // <1,2,6,3>: Cost 3 vext3 <0,u,1,1>, <2,6,3,7>
- 3763488705U, // <1,2,6,4>: Cost 4 vext3 <0,u,1,1>, <2,6,4,5>
- 3763488716U, // <1,2,6,5>: Cost 4 vext3 <0,u,1,1>, <2,6,5,7>
- 2659144504U, // <1,2,6,6>: Cost 3 vext2 <7,0,1,2>, <6,6,6,6>
- 2657817432U, // <1,2,6,7>: Cost 3 vext2 <6,7,1,2>, <6,7,1,2>
- 2689746919U, // <1,2,6,u>: Cost 3 vext3 <0,u,1,1>, <2,6,u,7>
- 1585402874U, // <1,2,7,0>: Cost 2 vext2 <7,0,1,2>, <7,0,1,2>
- 2659144770U, // <1,2,7,1>: Cost 3 vext2 <7,0,1,2>, <7,1,0,2>
- 3708998858U, // <1,2,7,2>: Cost 4 vext2 <3,0,1,2>, <7,2,6,3>
- 2635257059U, // <1,2,7,3>: Cost 3 vext2 <3,0,1,2>, <7,3,0,1>
- 2659145062U, // <1,2,7,4>: Cost 3 vext2 <7,0,1,2>, <7,4,5,6>
- 3732886916U, // <1,2,7,5>: Cost 4 vext2 <7,0,1,2>, <7,5,0,0>
- 3732886998U, // <1,2,7,6>: Cost 4 vext2 <7,0,1,2>, <7,6,0,1>
- 2659145255U, // <1,2,7,7>: Cost 3 vext2 <7,0,1,2>, <7,7,0,1>
- 1590711938U, // <1,2,7,u>: Cost 2 vext2 <7,u,1,2>, <7,u,1,2>
- 403529835U, // <1,2,u,0>: Cost 1 vext1 LHS, LHS
- 1477272310U, // <1,2,u,1>: Cost 2 vext1 LHS, <1,0,3,2>
- 1477273192U, // <1,2,u,2>: Cost 2 vext1 LHS, <2,2,2,2>
- 1477273750U, // <1,2,u,3>: Cost 2 vext1 LHS, <3,0,1,2>
- 403533110U, // <1,2,u,4>: Cost 1 vext1 LHS, RHS
- 1561516186U, // <1,2,u,5>: Cost 2 vext2 <3,0,1,2>, RHS
- 1525051898U, // <1,2,u,6>: Cost 2 vext1 LHS, <6,2,7,3>
- 1525052410U, // <1,2,u,7>: Cost 2 vext1 LHS, <7,0,1,2>
- 403535662U, // <1,2,u,u>: Cost 1 vext1 LHS, LHS
- 2819407872U, // <1,3,0,0>: Cost 3 vuzpr LHS, <0,0,0,0>
- 1551564902U, // <1,3,0,1>: Cost 2 vext2 <1,3,1,3>, LHS
- 2819408630U, // <1,3,0,2>: Cost 3 vuzpr LHS, <1,0,3,2>
- 2619334911U, // <1,3,0,3>: Cost 3 vext2 <0,3,1,3>, <0,3,1,3>
- 2625306962U, // <1,3,0,4>: Cost 3 vext2 <1,3,1,3>, <0,4,1,5>
- 3832725879U, // <1,3,0,5>: Cost 4 vuzpl <1,2,3,0>, <0,4,5,6>
- 3699048959U, // <1,3,0,6>: Cost 4 vext2 <1,3,1,3>, <0,6,2,7>
- 3776538827U, // <1,3,0,7>: Cost 4 vext3 <3,0,7,1>, <3,0,7,1>
- 1551565469U, // <1,3,0,u>: Cost 2 vext2 <1,3,1,3>, LHS
- 2618671862U, // <1,3,1,0>: Cost 3 vext2 <0,2,1,3>, <1,0,3,2>
- 2819408692U, // <1,3,1,1>: Cost 3 vuzpr LHS, <1,1,1,1>
- 2624643975U, // <1,3,1,2>: Cost 3 vext2 <1,2,1,3>, <1,2,1,3>
- 1745666150U, // <1,3,1,3>: Cost 2 vuzpr LHS, LHS
- 2557005110U, // <1,3,1,4>: Cost 3 vext1 <1,1,3,1>, RHS
- 2625307792U, // <1,3,1,5>: Cost 3 vext2 <1,3,1,3>, <1,5,3,7>
- 3698386127U, // <1,3,1,6>: Cost 4 vext2 <1,2,1,3>, <1,6,1,7>
- 2592838748U, // <1,3,1,7>: Cost 3 vext1 <7,1,3,1>, <7,1,3,1>
- 1745666155U, // <1,3,1,u>: Cost 2 vuzpr LHS, LHS
- 2819408790U, // <1,3,2,0>: Cost 3 vuzpr LHS, <1,2,3,0>
- 2625308193U, // <1,3,2,1>: Cost 3 vext2 <1,3,1,3>, <2,1,3,3>
- 2819408036U, // <1,3,2,2>: Cost 3 vuzpr LHS, <0,2,0,2>
- 2819851890U, // <1,3,2,3>: Cost 3 vuzpr LHS, <2,2,3,3>
- 2819408794U, // <1,3,2,4>: Cost 3 vuzpr LHS, <1,2,3,4>
- 3893149890U, // <1,3,2,5>: Cost 4 vuzpr LHS, <0,2,3,5>
- 2819408076U, // <1,3,2,6>: Cost 3 vuzpr LHS, <0,2,4,6>
- 3772041583U, // <1,3,2,7>: Cost 4 vext3 <2,3,0,1>, <3,2,7,3>
- 2819408042U, // <1,3,2,u>: Cost 3 vuzpr LHS, <0,2,0,u>
- 1483276390U, // <1,3,3,0>: Cost 2 vext1 <1,1,3,3>, LHS
- 1483277128U, // <1,3,3,1>: Cost 2 vext1 <1,1,3,3>, <1,1,3,3>
- 2557019752U, // <1,3,3,2>: Cost 3 vext1 <1,1,3,3>, <2,2,2,2>
- 2819408856U, // <1,3,3,3>: Cost 3 vuzpr LHS, <1,3,1,3>
- 1483279670U, // <1,3,3,4>: Cost 2 vext1 <1,1,3,3>, RHS
- 2819409614U, // <1,3,3,5>: Cost 3 vuzpr LHS, <2,3,4,5>
- 2598826490U, // <1,3,3,6>: Cost 3 vext1 <u,1,3,3>, <6,2,7,3>
- 3087844352U, // <1,3,3,7>: Cost 3 vtrnr LHS, <1,3,5,7>
- 1483282222U, // <1,3,3,u>: Cost 2 vext1 <1,1,3,3>, LHS
- 2568970342U, // <1,3,4,0>: Cost 3 vext1 <3,1,3,4>, LHS
- 2568971224U, // <1,3,4,1>: Cost 3 vext1 <3,1,3,4>, <1,3,1,3>
- 3832761290U, // <1,3,4,2>: Cost 4 vuzpl <1,2,3,4>, <4,1,2,3>
- 2233428219U, // <1,3,4,3>: Cost 3 vrev <3,1,3,4>
- 2568973622U, // <1,3,4,4>: Cost 3 vext1 <3,1,3,4>, RHS
- 1551568182U, // <1,3,4,5>: Cost 2 vext2 <1,3,1,3>, RHS
- 2819410434U, // <1,3,4,6>: Cost 3 vuzpr LHS, <3,4,5,6>
- 3666605151U, // <1,3,4,7>: Cost 4 vext1 <7,1,3,4>, <7,1,3,4>
- 1551568425U, // <1,3,4,u>: Cost 2 vext2 <1,3,1,3>, RHS
- 2563006566U, // <1,3,5,0>: Cost 3 vext1 <2,1,3,5>, LHS
- 2568979456U, // <1,3,5,1>: Cost 3 vext1 <3,1,3,5>, <1,3,5,7>
- 2563008035U, // <1,3,5,2>: Cost 3 vext1 <2,1,3,5>, <2,1,3,5>
- 2233436412U, // <1,3,5,3>: Cost 3 vrev <3,1,3,5>
- 2563009846U, // <1,3,5,4>: Cost 3 vext1 <2,1,3,5>, RHS
- 2867187716U, // <1,3,5,5>: Cost 3 vuzpr LHS, <5,5,5,5>
- 2655834214U, // <1,3,5,6>: Cost 3 vext2 <6,4,1,3>, <5,6,7,4>
- 1745669430U, // <1,3,5,7>: Cost 2 vuzpr LHS, RHS
- 1745669431U, // <1,3,5,u>: Cost 2 vuzpr LHS, RHS
- 2867187810U, // <1,3,6,0>: Cost 3 vuzpr LHS, <5,6,7,0>
- 3699052931U, // <1,3,6,1>: Cost 4 vext2 <1,3,1,3>, <6,1,3,1>
- 2654507460U, // <1,3,6,2>: Cost 3 vext2 <6,2,1,3>, <6,2,1,3>
- 3766291091U, // <1,3,6,3>: Cost 4 vext3 <1,3,3,1>, <3,6,3,7>
- 2655834726U, // <1,3,6,4>: Cost 3 vext2 <6,4,1,3>, <6,4,1,3>
- 3923384562U, // <1,3,6,5>: Cost 4 vuzpr <5,1,7,3>, <u,6,7,5>
- 2657161992U, // <1,3,6,6>: Cost 3 vext2 <6,6,1,3>, <6,6,1,3>
- 2819852218U, // <1,3,6,7>: Cost 3 vuzpr LHS, <2,6,3,7>
- 2819852219U, // <1,3,6,u>: Cost 3 vuzpr LHS, <2,6,3,u>
- 2706926275U, // <1,3,7,0>: Cost 3 vext3 <3,7,0,1>, <3,7,0,1>
- 2659816524U, // <1,3,7,1>: Cost 3 vext2 <7,1,1,3>, <7,1,1,3>
- 3636766245U, // <1,3,7,2>: Cost 4 vext1 <2,1,3,7>, <2,1,3,7>
- 2867187903U, // <1,3,7,3>: Cost 3 vuzpr LHS, <5,7,u,3>
- 2625312102U, // <1,3,7,4>: Cost 3 vext2 <1,3,1,3>, <7,4,5,6>
- 2867188598U, // <1,3,7,5>: Cost 3 vuzpr LHS, <6,7,4,5>
- 3728250344U, // <1,3,7,6>: Cost 4 vext2 <6,2,1,3>, <7,6,2,1>
- 2867187880U, // <1,3,7,7>: Cost 3 vuzpr LHS, <5,7,5,7>
- 2707516171U, // <1,3,7,u>: Cost 3 vext3 <3,7,u,1>, <3,7,u,1>
- 1483317350U, // <1,3,u,0>: Cost 2 vext1 <1,1,3,u>, LHS
- 1483318093U, // <1,3,u,1>: Cost 2 vext1 <1,1,3,u>, <1,1,3,u>
- 2819410718U, // <1,3,u,2>: Cost 3 vuzpr LHS, <3,u,1,2>
- 1745666717U, // <1,3,u,3>: Cost 2 vuzpr LHS, LHS
- 1483320630U, // <1,3,u,4>: Cost 2 vext1 <1,1,3,u>, RHS
- 1551571098U, // <1,3,u,5>: Cost 2 vext2 <1,3,1,3>, RHS
- 2819410758U, // <1,3,u,6>: Cost 3 vuzpr LHS, <3,u,5,6>
- 1745669673U, // <1,3,u,7>: Cost 2 vuzpr LHS, RHS
- 1745666722U, // <1,3,u,u>: Cost 2 vuzpr LHS, LHS
- 2617352205U, // <1,4,0,0>: Cost 3 vext2 <0,0,1,4>, <0,0,1,4>
- 2619342950U, // <1,4,0,1>: Cost 3 vext2 <0,3,1,4>, LHS
- 3692421295U, // <1,4,0,2>: Cost 4 vext2 <0,2,1,4>, <0,2,1,4>
- 2619343104U, // <1,4,0,3>: Cost 3 vext2 <0,3,1,4>, <0,3,1,4>
- 2617352530U, // <1,4,0,4>: Cost 3 vext2 <0,0,1,4>, <0,4,1,5>
- 1634880402U, // <1,4,0,5>: Cost 2 vext3 <4,0,5,1>, <4,0,5,1>
- 2713930652U, // <1,4,0,6>: Cost 3 vext3 <4,u,5,1>, <4,0,6,2>
- 3732898396U, // <1,4,0,7>: Cost 4 vext2 <7,0,1,4>, <0,7,4,1>
- 1635101613U, // <1,4,0,u>: Cost 2 vext3 <4,0,u,1>, <4,0,u,1>
- 3693085430U, // <1,4,1,0>: Cost 4 vext2 <0,3,1,4>, <1,0,3,2>
- 2623988535U, // <1,4,1,1>: Cost 3 vext2 <1,1,1,4>, <1,1,1,4>
- 3693085590U, // <1,4,1,2>: Cost 4 vext2 <0,3,1,4>, <1,2,3,0>
- 3692422134U, // <1,4,1,3>: Cost 4 vext2 <0,2,1,4>, <1,3,4,6>
- 3693085726U, // <1,4,1,4>: Cost 4 vext2 <0,3,1,4>, <1,4,0,1>
- 2892401974U, // <1,4,1,5>: Cost 3 vzipl <1,1,1,1>, RHS
- 3026619702U, // <1,4,1,6>: Cost 3 vtrnl <1,1,1,1>, RHS
- 3800206324U, // <1,4,1,7>: Cost 4 vext3 <7,0,4,1>, <4,1,7,0>
- 2892402217U, // <1,4,1,u>: Cost 3 vzipl <1,1,1,1>, RHS
- 3966978927U, // <1,4,2,0>: Cost 4 vzipl <1,2,3,4>, <4,0,1,2>
- 3966979018U, // <1,4,2,1>: Cost 4 vzipl <1,2,3,4>, <4,1,2,3>
- 3693086312U, // <1,4,2,2>: Cost 4 vext2 <0,3,1,4>, <2,2,2,2>
- 2635269798U, // <1,4,2,3>: Cost 3 vext2 <3,0,1,4>, <2,3,0,1>
- 3966979280U, // <1,4,2,4>: Cost 4 vzipl <1,2,3,4>, <4,4,4,4>
- 2893204790U, // <1,4,2,5>: Cost 3 vzipl <1,2,3,0>, RHS
- 3693086650U, // <1,4,2,6>: Cost 4 vext2 <0,3,1,4>, <2,6,3,7>
- 3666662502U, // <1,4,2,7>: Cost 4 vext1 <7,1,4,2>, <7,1,4,2>
- 2893205033U, // <1,4,2,u>: Cost 3 vzipl <1,2,3,0>, RHS
- 2563063910U, // <1,4,3,0>: Cost 3 vext1 <2,1,4,3>, LHS
- 2563064730U, // <1,4,3,1>: Cost 3 vext1 <2,1,4,3>, <1,2,3,4>
- 2563065386U, // <1,4,3,2>: Cost 3 vext1 <2,1,4,3>, <2,1,4,3>
- 3693087132U, // <1,4,3,3>: Cost 4 vext2 <0,3,1,4>, <3,3,3,3>
- 2619345410U, // <1,4,3,4>: Cost 3 vext2 <0,3,1,4>, <3,4,5,6>
- 3087843666U, // <1,4,3,5>: Cost 3 vtrnr LHS, <0,4,1,5>
- 3087843676U, // <1,4,3,6>: Cost 3 vtrnr LHS, <0,4,2,6>
- 3666670695U, // <1,4,3,7>: Cost 4 vext1 <7,1,4,3>, <7,1,4,3>
- 3087843669U, // <1,4,3,u>: Cost 3 vtrnr LHS, <0,4,1,u>
- 2620672914U, // <1,4,4,0>: Cost 3 vext2 <0,5,1,4>, <4,0,5,1>
- 3630842706U, // <1,4,4,1>: Cost 4 vext1 <1,1,4,4>, <1,1,4,4>
- 3313069003U, // <1,4,4,2>: Cost 4 vrev <4,1,2,4>
- 3642788100U, // <1,4,4,3>: Cost 4 vext1 <3,1,4,4>, <3,1,4,4>
- 2713930960U, // <1,4,4,4>: Cost 3 vext3 <4,u,5,1>, <4,4,4,4>
- 2619346230U, // <1,4,4,5>: Cost 3 vext2 <0,3,1,4>, RHS
- 2713930980U, // <1,4,4,6>: Cost 3 vext3 <4,u,5,1>, <4,4,6,6>
- 3736882642U, // <1,4,4,7>: Cost 4 vext2 <7,6,1,4>, <4,7,6,1>
- 2619346473U, // <1,4,4,u>: Cost 3 vext2 <0,3,1,4>, RHS
- 2557108326U, // <1,4,5,0>: Cost 3 vext1 <1,1,4,5>, LHS
- 2557109075U, // <1,4,5,1>: Cost 3 vext1 <1,1,4,5>, <1,1,4,5>
- 2598913774U, // <1,4,5,2>: Cost 3 vext1 <u,1,4,5>, <2,3,u,1>
- 3630852246U, // <1,4,5,3>: Cost 4 vext1 <1,1,4,5>, <3,0,1,2>
- 2557111606U, // <1,4,5,4>: Cost 3 vext1 <1,1,4,5>, RHS
- 2895252790U, // <1,4,5,5>: Cost 3 vzipl <1,5,3,7>, RHS
- 1616006454U, // <1,4,5,6>: Cost 2 vext3 <0,u,1,1>, RHS
- 3899059510U, // <1,4,5,7>: Cost 4 vuzpr <1,1,1,4>, RHS
- 1616006472U, // <1,4,5,u>: Cost 2 vext3 <0,u,1,1>, RHS
- 2557116518U, // <1,4,6,0>: Cost 3 vext1 <1,1,4,6>, LHS
- 2557117236U, // <1,4,6,1>: Cost 3 vext1 <1,1,4,6>, <1,1,1,1>
- 3630859880U, // <1,4,6,2>: Cost 4 vext1 <1,1,4,6>, <2,2,2,2>
- 2569062550U, // <1,4,6,3>: Cost 3 vext1 <3,1,4,6>, <3,0,1,2>
- 2557119798U, // <1,4,6,4>: Cost 3 vext1 <1,1,4,6>, RHS
- 3763490174U, // <1,4,6,5>: Cost 4 vext3 <0,u,1,1>, <4,6,5,7>
- 3763490183U, // <1,4,6,6>: Cost 4 vext3 <0,u,1,1>, <4,6,6,7>
- 2712751498U, // <1,4,6,7>: Cost 3 vext3 <4,6,7,1>, <4,6,7,1>
- 2557122350U, // <1,4,6,u>: Cost 3 vext1 <1,1,4,6>, LHS
- 2659161084U, // <1,4,7,0>: Cost 3 vext2 <7,0,1,4>, <7,0,1,4>
- 3732903040U, // <1,4,7,1>: Cost 4 vext2 <7,0,1,4>, <7,1,7,1>
- 3734230174U, // <1,4,7,2>: Cost 4 vext2 <7,2,1,4>, <7,2,1,4>
- 3734893807U, // <1,4,7,3>: Cost 4 vext2 <7,3,1,4>, <7,3,1,4>
- 3660729654U, // <1,4,7,4>: Cost 4 vext1 <6,1,4,7>, RHS
- 3786493384U, // <1,4,7,5>: Cost 4 vext3 <4,6,7,1>, <4,7,5,0>
- 2713341394U, // <1,4,7,6>: Cost 3 vext3 <4,7,6,1>, <4,7,6,1>
- 3660731386U, // <1,4,7,7>: Cost 4 vext1 <6,1,4,7>, <7,0,1,2>
- 2664470148U, // <1,4,7,u>: Cost 3 vext2 <7,u,1,4>, <7,u,1,4>
- 2557132902U, // <1,4,u,0>: Cost 3 vext1 <1,1,4,u>, LHS
- 2619348782U, // <1,4,u,1>: Cost 3 vext2 <0,3,1,4>, LHS
- 2563106351U, // <1,4,u,2>: Cost 3 vext1 <2,1,4,u>, <2,1,4,u>
- 2713783816U, // <1,4,u,3>: Cost 3 vext3 <4,u,3,1>, <4,u,3,1>
- 2622666815U, // <1,4,u,4>: Cost 3 vext2 <0,u,1,4>, <u,4,5,6>
- 1640189466U, // <1,4,u,5>: Cost 2 vext3 <4,u,5,1>, <4,u,5,1>
- 1616006697U, // <1,4,u,6>: Cost 2 vext3 <0,u,1,1>, RHS
- 2712751498U, // <1,4,u,7>: Cost 3 vext3 <4,6,7,1>, <4,6,7,1>
- 1616006715U, // <1,4,u,u>: Cost 2 vext3 <0,u,1,1>, RHS
- 2620014592U, // <1,5,0,0>: Cost 3 vext2 <0,4,1,5>, <0,0,0,0>
- 1546272870U, // <1,5,0,1>: Cost 2 vext2 <0,4,1,5>, LHS
- 2618687664U, // <1,5,0,2>: Cost 3 vext2 <0,2,1,5>, <0,2,1,5>
- 3693093120U, // <1,5,0,3>: Cost 4 vext2 <0,3,1,5>, <0,3,1,4>
- 1546273106U, // <1,5,0,4>: Cost 2 vext2 <0,4,1,5>, <0,4,1,5>
- 2620678563U, // <1,5,0,5>: Cost 3 vext2 <0,5,1,5>, <0,5,1,5>
- 2714668660U, // <1,5,0,6>: Cost 3 vext3 <5,0,6,1>, <5,0,6,1>
- 3772042877U, // <1,5,0,7>: Cost 4 vext3 <2,3,0,1>, <5,0,7,1>
- 1546273437U, // <1,5,0,u>: Cost 2 vext2 <0,4,1,5>, LHS
- 2620015350U, // <1,5,1,0>: Cost 3 vext2 <0,4,1,5>, <1,0,3,2>
- 2620015412U, // <1,5,1,1>: Cost 3 vext2 <0,4,1,5>, <1,1,1,1>
- 2620015510U, // <1,5,1,2>: Cost 3 vext2 <0,4,1,5>, <1,2,3,0>
- 2618688512U, // <1,5,1,3>: Cost 3 vext2 <0,2,1,5>, <1,3,5,7>
- 2620015677U, // <1,5,1,4>: Cost 3 vext2 <0,4,1,5>, <1,4,3,5>
- 2620015727U, // <1,5,1,5>: Cost 3 vext2 <0,4,1,5>, <1,5,0,1>
- 2620015859U, // <1,5,1,6>: Cost 3 vext2 <0,4,1,5>, <1,6,5,7>
- 3093728566U, // <1,5,1,7>: Cost 3 vtrnr <1,1,1,1>, RHS
- 2620015981U, // <1,5,1,u>: Cost 3 vext2 <0,4,1,5>, <1,u,1,3>
- 3692430816U, // <1,5,2,0>: Cost 4 vext2 <0,2,1,5>, <2,0,5,1>
- 2620016163U, // <1,5,2,1>: Cost 3 vext2 <0,4,1,5>, <2,1,3,5>
- 2620016232U, // <1,5,2,2>: Cost 3 vext2 <0,4,1,5>, <2,2,2,2>
- 2620016294U, // <1,5,2,3>: Cost 3 vext2 <0,4,1,5>, <2,3,0,1>
- 3693758221U, // <1,5,2,4>: Cost 4 vext2 <0,4,1,5>, <2,4,2,5>
- 3692431209U, // <1,5,2,5>: Cost 4 vext2 <0,2,1,5>, <2,5,3,7>
- 2620016570U, // <1,5,2,6>: Cost 3 vext2 <0,4,1,5>, <2,6,3,7>
- 4173598006U, // <1,5,2,7>: Cost 4 vtrnr <2,1,3,2>, RHS
- 2620016699U, // <1,5,2,u>: Cost 3 vext2 <0,4,1,5>, <2,u,0,1>
- 2620016790U, // <1,5,3,0>: Cost 3 vext2 <0,4,1,5>, <3,0,1,2>
- 2569110672U, // <1,5,3,1>: Cost 3 vext1 <3,1,5,3>, <1,5,3,7>
- 3693758785U, // <1,5,3,2>: Cost 4 vext2 <0,4,1,5>, <3,2,2,2>
- 2620017052U, // <1,5,3,3>: Cost 3 vext2 <0,4,1,5>, <3,3,3,3>
- 2620017154U, // <1,5,3,4>: Cost 3 vext2 <0,4,1,5>, <3,4,5,6>
- 3135623172U, // <1,5,3,5>: Cost 3 vtrnr LHS, <5,5,5,5>
- 4161587048U, // <1,5,3,6>: Cost 4 vtrnr LHS, <2,5,3,6>
- 2014104886U, // <1,5,3,7>: Cost 2 vtrnr LHS, RHS
- 2014104887U, // <1,5,3,u>: Cost 2 vtrnr LHS, RHS
- 2620017554U, // <1,5,4,0>: Cost 3 vext2 <0,4,1,5>, <4,0,5,1>
- 2620017634U, // <1,5,4,1>: Cost 3 vext2 <0,4,1,5>, <4,1,5,0>
- 3693759551U, // <1,5,4,2>: Cost 4 vext2 <0,4,1,5>, <4,2,6,3>
- 3642861837U, // <1,5,4,3>: Cost 4 vext1 <3,1,5,4>, <3,1,5,4>
- 2575092710U, // <1,5,4,4>: Cost 3 vext1 <4,1,5,4>, <4,1,5,4>
- 1546276150U, // <1,5,4,5>: Cost 2 vext2 <0,4,1,5>, RHS
- 2759855414U, // <1,5,4,6>: Cost 3 vuzpl <1,3,5,7>, RHS
- 2713931718U, // <1,5,4,7>: Cost 3 vext3 <4,u,5,1>, <5,4,7,6>
- 1546276393U, // <1,5,4,u>: Cost 2 vext2 <0,4,1,5>, RHS
- 2557182054U, // <1,5,5,0>: Cost 3 vext1 <1,1,5,5>, LHS
- 2557182812U, // <1,5,5,1>: Cost 3 vext1 <1,1,5,5>, <1,1,5,5>
- 3630925347U, // <1,5,5,2>: Cost 4 vext1 <1,1,5,5>, <2,1,3,5>
- 4029301675U, // <1,5,5,3>: Cost 4 vzipr <0,4,1,5>, <1,2,5,3>
- 2557185334U, // <1,5,5,4>: Cost 3 vext1 <1,1,5,5>, RHS
- 2713931780U, // <1,5,5,5>: Cost 3 vext3 <4,u,5,1>, <5,5,5,5>
- 2667794530U, // <1,5,5,6>: Cost 3 vext2 <u,4,1,5>, <5,6,7,0>
- 2713931800U, // <1,5,5,7>: Cost 3 vext3 <4,u,5,1>, <5,5,7,7>
- 2557187886U, // <1,5,5,u>: Cost 3 vext1 <1,1,5,5>, LHS
- 2718208036U, // <1,5,6,0>: Cost 3 vext3 <5,6,0,1>, <5,6,0,1>
- 2620019115U, // <1,5,6,1>: Cost 3 vext2 <0,4,1,5>, <6,1,7,5>
- 2667794938U, // <1,5,6,2>: Cost 3 vext2 <u,4,1,5>, <6,2,7,3>
- 3787673666U, // <1,5,6,3>: Cost 4 vext3 <4,u,5,1>, <5,6,3,4>
- 3693761165U, // <1,5,6,4>: Cost 4 vext2 <0,4,1,5>, <6,4,5,6>
- 3319279297U, // <1,5,6,5>: Cost 4 vrev <5,1,5,6>
- 2667795256U, // <1,5,6,6>: Cost 3 vext2 <u,4,1,5>, <6,6,6,6>
- 2713931874U, // <1,5,6,7>: Cost 3 vext3 <4,u,5,1>, <5,6,7,0>
- 2713931883U, // <1,5,6,u>: Cost 3 vext3 <4,u,5,1>, <5,6,u,0>
- 2557198438U, // <1,5,7,0>: Cost 3 vext1 <1,1,5,7>, LHS
- 2557199156U, // <1,5,7,1>: Cost 3 vext1 <1,1,5,7>, <1,1,1,1>
- 2569143974U, // <1,5,7,2>: Cost 3 vext1 <3,1,5,7>, <2,3,0,1>
- 2569144592U, // <1,5,7,3>: Cost 3 vext1 <3,1,5,7>, <3,1,5,7>
- 2557201718U, // <1,5,7,4>: Cost 3 vext1 <1,1,5,7>, RHS
- 2713931944U, // <1,5,7,5>: Cost 3 vext3 <4,u,5,1>, <5,7,5,7>
- 3787673770U, // <1,5,7,6>: Cost 4 vext3 <4,u,5,1>, <5,7,6,0>
- 2719387828U, // <1,5,7,7>: Cost 3 vext3 <5,7,7,1>, <5,7,7,1>
- 2557204270U, // <1,5,7,u>: Cost 3 vext1 <1,1,5,7>, LHS
- 2620020435U, // <1,5,u,0>: Cost 3 vext2 <0,4,1,5>, <u,0,1,2>
- 1546278702U, // <1,5,u,1>: Cost 2 vext2 <0,4,1,5>, LHS
- 2620020616U, // <1,5,u,2>: Cost 3 vext2 <0,4,1,5>, <u,2,3,3>
- 2620020668U, // <1,5,u,3>: Cost 3 vext2 <0,4,1,5>, <u,3,0,1>
- 1594054682U, // <1,5,u,4>: Cost 2 vext2 <u,4,1,5>, <u,4,1,5>
- 1546279066U, // <1,5,u,5>: Cost 2 vext2 <0,4,1,5>, RHS
- 2620020944U, // <1,5,u,6>: Cost 3 vext2 <0,4,1,5>, <u,6,3,7>
- 2014145846U, // <1,5,u,7>: Cost 2 vtrnr LHS, RHS
- 2014145847U, // <1,5,u,u>: Cost 2 vtrnr LHS, RHS
- 3692437504U, // <1,6,0,0>: Cost 4 vext2 <0,2,1,6>, <0,0,0,0>
- 2618695782U, // <1,6,0,1>: Cost 3 vext2 <0,2,1,6>, LHS
- 2618695857U, // <1,6,0,2>: Cost 3 vext2 <0,2,1,6>, <0,2,1,6>
- 3794161970U, // <1,6,0,3>: Cost 4 vext3 <6,0,3,1>, <6,0,3,1>
- 2620023122U, // <1,6,0,4>: Cost 3 vext2 <0,4,1,6>, <0,4,1,5>
- 2620686756U, // <1,6,0,5>: Cost 3 vext2 <0,5,1,6>, <0,5,1,6>
- 2621350389U, // <1,6,0,6>: Cost 3 vext2 <0,6,1,6>, <0,6,1,6>
- 4028599606U, // <1,6,0,7>: Cost 4 vzipr <0,3,1,0>, RHS
- 2618696349U, // <1,6,0,u>: Cost 3 vext2 <0,2,1,6>, LHS
- 3692438262U, // <1,6,1,0>: Cost 4 vext2 <0,2,1,6>, <1,0,3,2>
- 2625995572U, // <1,6,1,1>: Cost 3 vext2 <1,4,1,6>, <1,1,1,1>
- 3692438422U, // <1,6,1,2>: Cost 4 vext2 <0,2,1,6>, <1,2,3,0>
- 3692438488U, // <1,6,1,3>: Cost 4 vext2 <0,2,1,6>, <1,3,1,3>
- 2625995820U, // <1,6,1,4>: Cost 3 vext2 <1,4,1,6>, <1,4,1,6>
- 3692438672U, // <1,6,1,5>: Cost 4 vext2 <0,2,1,6>, <1,5,3,7>
- 3692438720U, // <1,6,1,6>: Cost 4 vext2 <0,2,1,6>, <1,6,0,1>
- 2958183734U, // <1,6,1,7>: Cost 3 vzipr <0,u,1,1>, RHS
- 2958183735U, // <1,6,1,u>: Cost 3 vzipr <0,u,1,1>, RHS
- 2721526201U, // <1,6,2,0>: Cost 3 vext3 <6,2,0,1>, <6,2,0,1>
- 3692439097U, // <1,6,2,1>: Cost 4 vext2 <0,2,1,6>, <2,1,6,0>
- 3692439144U, // <1,6,2,2>: Cost 4 vext2 <0,2,1,6>, <2,2,2,2>
- 3692439206U, // <1,6,2,3>: Cost 4 vext2 <0,2,1,6>, <2,3,0,1>
- 3636948278U, // <1,6,2,4>: Cost 4 vext1 <2,1,6,2>, RHS
- 3787674092U, // <1,6,2,5>: Cost 4 vext3 <4,u,5,1>, <6,2,5,7>
- 2618697658U, // <1,6,2,6>: Cost 3 vext2 <0,2,1,6>, <2,6,3,7>
- 2970799414U, // <1,6,2,7>: Cost 3 vzipr <3,0,1,2>, RHS
- 2970799415U, // <1,6,2,u>: Cost 3 vzipr <3,0,1,2>, RHS
- 2563211366U, // <1,6,3,0>: Cost 3 vext1 <2,1,6,3>, LHS
- 3699738854U, // <1,6,3,1>: Cost 4 vext2 <1,4,1,6>, <3,1,1,1>
- 2563212860U, // <1,6,3,2>: Cost 3 vext1 <2,1,6,3>, <2,1,6,3>
- 3692439964U, // <1,6,3,3>: Cost 4 vext2 <0,2,1,6>, <3,3,3,3>
- 2563214646U, // <1,6,3,4>: Cost 3 vext1 <2,1,6,3>, RHS
- 4191820018U, // <1,6,3,5>: Cost 4 vtrnr <5,1,7,3>, <u,6,7,5>
- 2587103648U, // <1,6,3,6>: Cost 3 vext1 <6,1,6,3>, <6,1,6,3>
- 3087845306U, // <1,6,3,7>: Cost 3 vtrnr LHS, <2,6,3,7>
- 3087845307U, // <1,6,3,u>: Cost 3 vtrnr LHS, <2,6,3,u>
- 3693767570U, // <1,6,4,0>: Cost 4 vext2 <0,4,1,6>, <4,0,5,1>
- 3693767650U, // <1,6,4,1>: Cost 4 vext2 <0,4,1,6>, <4,1,5,0>
- 3636962877U, // <1,6,4,2>: Cost 4 vext1 <2,1,6,4>, <2,1,6,4>
- 3325088134U, // <1,6,4,3>: Cost 4 vrev <6,1,3,4>
- 3693767898U, // <1,6,4,4>: Cost 4 vext2 <0,4,1,6>, <4,4,5,5>
- 2618699062U, // <1,6,4,5>: Cost 3 vext2 <0,2,1,6>, RHS
- 3833670966U, // <1,6,4,6>: Cost 4 vuzpl <1,3,6,7>, RHS
- 4028632374U, // <1,6,4,7>: Cost 4 vzipr <0,3,1,4>, RHS
- 2618699305U, // <1,6,4,u>: Cost 3 vext2 <0,2,1,6>, RHS
- 3693768264U, // <1,6,5,0>: Cost 4 vext2 <0,4,1,6>, <5,0,1,2>
- 3630998373U, // <1,6,5,1>: Cost 4 vext1 <1,1,6,5>, <1,1,6,5>
- 3636971070U, // <1,6,5,2>: Cost 4 vext1 <2,1,6,5>, <2,1,6,5>
- 3642943767U, // <1,6,5,3>: Cost 4 vext1 <3,1,6,5>, <3,1,6,5>
- 3693768628U, // <1,6,5,4>: Cost 4 vext2 <0,4,1,6>, <5,4,5,6>
- 3732918276U, // <1,6,5,5>: Cost 4 vext2 <7,0,1,6>, <5,5,5,5>
- 2620690530U, // <1,6,5,6>: Cost 3 vext2 <0,5,1,6>, <5,6,7,0>
- 2955562294U, // <1,6,5,7>: Cost 3 vzipr <0,4,1,5>, RHS
- 2955562295U, // <1,6,5,u>: Cost 3 vzipr <0,4,1,5>, RHS
- 2724180733U, // <1,6,6,0>: Cost 3 vext3 <6,6,0,1>, <6,6,0,1>
- 3631006566U, // <1,6,6,1>: Cost 4 vext1 <1,1,6,6>, <1,1,6,6>
- 3631007674U, // <1,6,6,2>: Cost 4 vext1 <1,1,6,6>, <2,6,3,7>
- 3692442184U, // <1,6,6,3>: Cost 4 vext2 <0,2,1,6>, <6,3,7,0>
- 3631009078U, // <1,6,6,4>: Cost 4 vext1 <1,1,6,6>, RHS
- 3787674416U, // <1,6,6,5>: Cost 4 vext3 <4,u,5,1>, <6,6,5,7>
- 2713932600U, // <1,6,6,6>: Cost 3 vext3 <4,u,5,1>, <6,6,6,6>
- 2713932610U, // <1,6,6,7>: Cost 3 vext3 <4,u,5,1>, <6,6,7,7>
- 2713932619U, // <1,6,6,u>: Cost 3 vext3 <4,u,5,1>, <6,6,u,7>
- 1651102542U, // <1,6,7,0>: Cost 2 vext3 <6,7,0,1>, <6,7,0,1>
- 2724918103U, // <1,6,7,1>: Cost 3 vext3 <6,7,1,1>, <6,7,1,1>
- 2698302306U, // <1,6,7,2>: Cost 3 vext3 <2,3,0,1>, <6,7,2,3>
- 3642960153U, // <1,6,7,3>: Cost 4 vext1 <3,1,6,7>, <3,1,6,7>
- 2713932662U, // <1,6,7,4>: Cost 3 vext3 <4,u,5,1>, <6,7,4,5>
- 2725213051U, // <1,6,7,5>: Cost 3 vext3 <6,7,5,1>, <6,7,5,1>
- 2724844426U, // <1,6,7,6>: Cost 3 vext3 <6,7,0,1>, <6,7,6,7>
- 4035956022U, // <1,6,7,7>: Cost 4 vzipr <1,5,1,7>, RHS
- 1651692438U, // <1,6,7,u>: Cost 2 vext3 <6,7,u,1>, <6,7,u,1>
- 1651766175U, // <1,6,u,0>: Cost 2 vext3 <6,u,0,1>, <6,u,0,1>
- 2618701614U, // <1,6,u,1>: Cost 3 vext2 <0,2,1,6>, LHS
- 3135663508U, // <1,6,u,2>: Cost 3 vtrnr LHS, <4,6,u,2>
- 3692443580U, // <1,6,u,3>: Cost 4 vext2 <0,2,1,6>, <u,3,0,1>
- 2713932743U, // <1,6,u,4>: Cost 3 vext3 <4,u,5,1>, <6,u,4,5>
- 2618701978U, // <1,6,u,5>: Cost 3 vext2 <0,2,1,6>, RHS
- 2622683344U, // <1,6,u,6>: Cost 3 vext2 <0,u,1,6>, <u,6,3,7>
- 3087886266U, // <1,6,u,7>: Cost 3 vtrnr LHS, <2,6,3,7>
- 1652356071U, // <1,6,u,u>: Cost 2 vext3 <6,u,u,1>, <6,u,u,1>
- 2726171632U, // <1,7,0,0>: Cost 3 vext3 <7,0,0,1>, <7,0,0,1>
- 2626666598U, // <1,7,0,1>: Cost 3 vext2 <1,5,1,7>, LHS
- 3695100067U, // <1,7,0,2>: Cost 4 vext2 <0,6,1,7>, <0,2,0,1>
- 3707044102U, // <1,7,0,3>: Cost 4 vext2 <2,6,1,7>, <0,3,2,1>
- 2726466580U, // <1,7,0,4>: Cost 3 vext3 <7,0,4,1>, <7,0,4,1>
- 3654921933U, // <1,7,0,5>: Cost 4 vext1 <5,1,7,0>, <5,1,7,0>
- 2621358582U, // <1,7,0,6>: Cost 3 vext2 <0,6,1,7>, <0,6,1,7>
- 2622022215U, // <1,7,0,7>: Cost 3 vext2 <0,7,1,7>, <0,7,1,7>
- 2626667165U, // <1,7,0,u>: Cost 3 vext2 <1,5,1,7>, LHS
- 2593128550U, // <1,7,1,0>: Cost 3 vext1 <7,1,7,1>, LHS
- 2626667316U, // <1,7,1,1>: Cost 3 vext2 <1,5,1,7>, <1,1,1,1>
- 3700409238U, // <1,7,1,2>: Cost 4 vext2 <1,5,1,7>, <1,2,3,0>
- 2257294428U, // <1,7,1,3>: Cost 3 vrev <7,1,3,1>
- 2593131830U, // <1,7,1,4>: Cost 3 vext1 <7,1,7,1>, RHS
- 2626667646U, // <1,7,1,5>: Cost 3 vext2 <1,5,1,7>, <1,5,1,7>
- 2627331279U, // <1,7,1,6>: Cost 3 vext2 <1,6,1,7>, <1,6,1,7>
- 2593133696U, // <1,7,1,7>: Cost 3 vext1 <7,1,7,1>, <7,1,7,1>
- 2628658545U, // <1,7,1,u>: Cost 3 vext2 <1,u,1,7>, <1,u,1,7>
- 2587164774U, // <1,7,2,0>: Cost 3 vext1 <6,1,7,2>, LHS
- 3701073445U, // <1,7,2,1>: Cost 4 vext2 <1,6,1,7>, <2,1,3,7>
- 3700409960U, // <1,7,2,2>: Cost 4 vext2 <1,5,1,7>, <2,2,2,2>
- 2638612134U, // <1,7,2,3>: Cost 3 vext2 <3,5,1,7>, <2,3,0,1>
- 2587168054U, // <1,7,2,4>: Cost 3 vext1 <6,1,7,2>, RHS
- 3706382167U, // <1,7,2,5>: Cost 4 vext2 <2,5,1,7>, <2,5,1,7>
- 2587169192U, // <1,7,2,6>: Cost 3 vext1 <6,1,7,2>, <6,1,7,2>
- 3660911610U, // <1,7,2,7>: Cost 4 vext1 <6,1,7,2>, <7,0,1,2>
- 2587170606U, // <1,7,2,u>: Cost 3 vext1 <6,1,7,2>, LHS
- 1507459174U, // <1,7,3,0>: Cost 2 vext1 <5,1,7,3>, LHS
- 2569257984U, // <1,7,3,1>: Cost 3 vext1 <3,1,7,3>, <1,3,5,7>
- 2581202536U, // <1,7,3,2>: Cost 3 vext1 <5,1,7,3>, <2,2,2,2>
- 2569259294U, // <1,7,3,3>: Cost 3 vext1 <3,1,7,3>, <3,1,7,3>
- 1507462454U, // <1,7,3,4>: Cost 2 vext1 <5,1,7,3>, RHS
- 1507462864U, // <1,7,3,5>: Cost 2 vext1 <5,1,7,3>, <5,1,7,3>
- 2581205498U, // <1,7,3,6>: Cost 3 vext1 <5,1,7,3>, <6,2,7,3>
- 2581206010U, // <1,7,3,7>: Cost 3 vext1 <5,1,7,3>, <7,0,1,2>
- 1507465006U, // <1,7,3,u>: Cost 2 vext1 <5,1,7,3>, LHS
- 2728826164U, // <1,7,4,0>: Cost 3 vext3 <7,4,0,1>, <7,4,0,1>
- 3654951732U, // <1,7,4,1>: Cost 4 vext1 <5,1,7,4>, <1,1,1,1>
- 3330987094U, // <1,7,4,2>: Cost 4 vrev <7,1,2,4>
- 3331060831U, // <1,7,4,3>: Cost 4 vrev <7,1,3,4>
- 3787674971U, // <1,7,4,4>: Cost 4 vext3 <4,u,5,1>, <7,4,4,4>
- 2626669878U, // <1,7,4,5>: Cost 3 vext2 <1,5,1,7>, RHS
- 3785979241U, // <1,7,4,6>: Cost 4 vext3 <4,6,0,1>, <7,4,6,0>
- 3787085176U, // <1,7,4,7>: Cost 4 vext3 <4,7,6,1>, <7,4,7,6>
- 2626670121U, // <1,7,4,u>: Cost 3 vext2 <1,5,1,7>, RHS
- 2569273446U, // <1,7,5,0>: Cost 3 vext1 <3,1,7,5>, LHS
- 2569274368U, // <1,7,5,1>: Cost 3 vext1 <3,1,7,5>, <1,3,5,7>
- 3643016808U, // <1,7,5,2>: Cost 4 vext1 <3,1,7,5>, <2,2,2,2>
- 2569275680U, // <1,7,5,3>: Cost 3 vext1 <3,1,7,5>, <3,1,7,5>
- 2569276726U, // <1,7,5,4>: Cost 3 vext1 <3,1,7,5>, RHS
- 4102034790U, // <1,7,5,5>: Cost 4 vtrnl <1,3,5,7>, <7,4,5,6>
- 2651222067U, // <1,7,5,6>: Cost 3 vext2 <5,6,1,7>, <5,6,1,7>
- 3899378998U, // <1,7,5,7>: Cost 4 vuzpr <1,1,5,7>, RHS
- 2569279278U, // <1,7,5,u>: Cost 3 vext1 <3,1,7,5>, LHS
- 2730153430U, // <1,7,6,0>: Cost 3 vext3 <7,6,0,1>, <7,6,0,1>
- 2724845022U, // <1,7,6,1>: Cost 3 vext3 <6,7,0,1>, <7,6,1,0>
- 3643025338U, // <1,7,6,2>: Cost 4 vext1 <3,1,7,6>, <2,6,3,7>
- 3643025697U, // <1,7,6,3>: Cost 4 vext1 <3,1,7,6>, <3,1,7,6>
- 3643026742U, // <1,7,6,4>: Cost 4 vext1 <3,1,7,6>, RHS
- 3654971091U, // <1,7,6,5>: Cost 4 vext1 <5,1,7,6>, <5,1,7,6>
- 3787675153U, // <1,7,6,6>: Cost 4 vext3 <4,u,5,1>, <7,6,6,6>
- 2724845076U, // <1,7,6,7>: Cost 3 vext3 <6,7,0,1>, <7,6,7,0>
- 2725508637U, // <1,7,6,u>: Cost 3 vext3 <6,u,0,1>, <7,6,u,0>
- 2730817063U, // <1,7,7,0>: Cost 3 vext3 <7,7,0,1>, <7,7,0,1>
- 3631088436U, // <1,7,7,1>: Cost 4 vext1 <1,1,7,7>, <1,1,1,1>
- 3660949158U, // <1,7,7,2>: Cost 4 vext1 <6,1,7,7>, <2,3,0,1>
- 3801904705U, // <1,7,7,3>: Cost 4 vext3 <7,3,0,1>, <7,7,3,0>
- 3631090998U, // <1,7,7,4>: Cost 4 vext1 <1,1,7,7>, RHS
- 2662503828U, // <1,7,7,5>: Cost 3 vext2 <7,5,1,7>, <7,5,1,7>
- 3660951981U, // <1,7,7,6>: Cost 4 vext1 <6,1,7,7>, <6,1,7,7>
- 2713933420U, // <1,7,7,7>: Cost 3 vext3 <4,u,5,1>, <7,7,7,7>
- 2731406959U, // <1,7,7,u>: Cost 3 vext3 <7,7,u,1>, <7,7,u,1>
- 1507500134U, // <1,7,u,0>: Cost 2 vext1 <5,1,7,u>, LHS
- 2626672430U, // <1,7,u,1>: Cost 3 vext2 <1,5,1,7>, LHS
- 2581243496U, // <1,7,u,2>: Cost 3 vext1 <5,1,7,u>, <2,2,2,2>
- 2569300259U, // <1,7,u,3>: Cost 3 vext1 <3,1,7,u>, <3,1,7,u>
- 1507503414U, // <1,7,u,4>: Cost 2 vext1 <5,1,7,u>, RHS
- 1507503829U, // <1,7,u,5>: Cost 2 vext1 <5,1,7,u>, <5,1,7,u>
- 2581246458U, // <1,7,u,6>: Cost 3 vext1 <5,1,7,u>, <6,2,7,3>
- 2581246970U, // <1,7,u,7>: Cost 3 vext1 <5,1,7,u>, <7,0,1,2>
- 1507505966U, // <1,7,u,u>: Cost 2 vext1 <5,1,7,u>, LHS
- 1543643153U, // <1,u,0,0>: Cost 2 vext2 <0,0,1,u>, <0,0,1,u>
- 1546297446U, // <1,u,0,1>: Cost 2 vext2 <0,4,1,u>, LHS
- 2819448852U, // <1,u,0,2>: Cost 3 vuzpr LHS, <0,0,2,2>
- 2619375876U, // <1,u,0,3>: Cost 3 vext2 <0,3,1,u>, <0,3,1,u>
- 1546297685U, // <1,u,0,4>: Cost 2 vext2 <0,4,1,u>, <0,4,1,u>
- 1658771190U, // <1,u,0,5>: Cost 2 vext3 <u,0,5,1>, <u,0,5,1>
- 2736789248U, // <1,u,0,6>: Cost 3 vext3 <u,7,0,1>, <u,0,6,2>
- 2659189376U, // <1,u,0,7>: Cost 3 vext2 <7,0,1,u>, <0,7,u,1>
- 1546298013U, // <1,u,0,u>: Cost 2 vext2 <0,4,1,u>, LHS
- 1483112550U, // <1,u,1,0>: Cost 2 vext1 <1,1,1,1>, LHS
- 202162278U, // <1,u,1,1>: Cost 1 vdup1 LHS
- 1616009006U, // <1,u,1,2>: Cost 2 vext3 <0,u,1,1>, LHS
- 1745707110U, // <1,u,1,3>: Cost 2 vuzpr LHS, LHS
- 1483115830U, // <1,u,1,4>: Cost 2 vext1 <1,1,1,1>, RHS
- 2620040336U, // <1,u,1,5>: Cost 3 vext2 <0,4,1,u>, <1,5,3,7>
- 3026622618U, // <1,u,1,6>: Cost 3 vtrnl <1,1,1,1>, RHS
- 2958183752U, // <1,u,1,7>: Cost 3 vzipr <0,u,1,1>, RHS
- 202162278U, // <1,u,1,u>: Cost 1 vdup1 LHS
- 2819449750U, // <1,u,2,0>: Cost 3 vuzpr LHS, <1,2,3,0>
- 2893207342U, // <1,u,2,1>: Cost 3 vzipl <1,2,3,0>, LHS
- 2819448996U, // <1,u,2,2>: Cost 3 vuzpr LHS, <0,2,0,2>
- 2819450482U, // <1,u,2,3>: Cost 3 vuzpr LHS, <2,2,3,3>
- 2819449754U, // <1,u,2,4>: Cost 3 vuzpr LHS, <1,2,3,4>
- 2893207706U, // <1,u,2,5>: Cost 3 vzipl <1,2,3,0>, RHS
- 2819449036U, // <1,u,2,6>: Cost 3 vuzpr LHS, <0,2,4,6>
- 2970799432U, // <1,u,2,7>: Cost 3 vzipr <3,0,1,2>, RHS
- 2819449002U, // <1,u,2,u>: Cost 3 vuzpr LHS, <0,2,0,u>
- 403931292U, // <1,u,3,0>: Cost 1 vext1 LHS, LHS
- 1477673718U, // <1,u,3,1>: Cost 2 vext1 LHS, <1,0,3,2>
- 115726126U, // <1,u,3,2>: Cost 1 vrev LHS
- 2014102173U, // <1,u,3,3>: Cost 2 vtrnr LHS, LHS
- 403934518U, // <1,u,3,4>: Cost 1 vext1 LHS, RHS
- 1507536601U, // <1,u,3,5>: Cost 2 vext1 <5,1,u,3>, <5,1,u,3>
- 1525453306U, // <1,u,3,6>: Cost 2 vext1 LHS, <6,2,7,3>
- 2014105129U, // <1,u,3,7>: Cost 2 vtrnr LHS, RHS
- 403937070U, // <1,u,3,u>: Cost 1 vext1 LHS, LHS
- 2620042157U, // <1,u,4,0>: Cost 3 vext2 <0,4,1,u>, <4,0,u,1>
- 2620042237U, // <1,u,4,1>: Cost 3 vext2 <0,4,1,u>, <4,1,u,0>
- 2263217967U, // <1,u,4,2>: Cost 3 vrev <u,1,2,4>
- 2569341224U, // <1,u,4,3>: Cost 3 vext1 <3,1,u,4>, <3,1,u,4>
- 2569342262U, // <1,u,4,4>: Cost 3 vext1 <3,1,u,4>, RHS
- 1546300726U, // <1,u,4,5>: Cost 2 vext2 <0,4,1,u>, RHS
- 2819449180U, // <1,u,4,6>: Cost 3 vuzpr LHS, <0,4,2,6>
- 2724845649U, // <1,u,4,7>: Cost 3 vext3 <6,7,0,1>, <u,4,7,6>
- 1546300969U, // <1,u,4,u>: Cost 2 vext2 <0,4,1,u>, RHS
- 2551431270U, // <1,u,5,0>: Cost 3 vext1 <0,1,u,5>, LHS
- 2551432192U, // <1,u,5,1>: Cost 3 vext1 <0,1,u,5>, <1,3,5,7>
- 3028293422U, // <1,u,5,2>: Cost 3 vtrnl <1,3,5,7>, LHS
- 2955559068U, // <1,u,5,3>: Cost 3 vzipr <0,4,1,5>, LHS
- 2551434550U, // <1,u,5,4>: Cost 3 vext1 <0,1,u,5>, RHS
- 2895255706U, // <1,u,5,5>: Cost 3 vzipl <1,5,3,7>, RHS
- 1616009370U, // <1,u,5,6>: Cost 2 vext3 <0,u,1,1>, RHS
- 1745710390U, // <1,u,5,7>: Cost 2 vuzpr LHS, RHS
- 1745710391U, // <1,u,5,u>: Cost 2 vuzpr LHS, RHS
- 2653221159U, // <1,u,6,0>: Cost 3 vext2 <6,0,1,u>, <6,0,1,u>
- 2725509303U, // <1,u,6,1>: Cost 3 vext3 <6,u,0,1>, <u,6,1,0>
- 2659193338U, // <1,u,6,2>: Cost 3 vext2 <7,0,1,u>, <6,2,7,3>
- 2689751248U, // <1,u,6,3>: Cost 3 vext3 <0,u,1,1>, <u,6,3,7>
- 2867228774U, // <1,u,6,4>: Cost 3 vuzpr LHS, <5,6,7,4>
- 3764820194U, // <1,u,6,5>: Cost 4 vext3 <1,1,1,1>, <u,6,5,7>
- 2657202957U, // <1,u,6,6>: Cost 3 vext2 <6,6,1,u>, <6,6,1,u>
- 2819450810U, // <1,u,6,7>: Cost 3 vuzpr LHS, <2,6,3,7>
- 2819450811U, // <1,u,6,u>: Cost 3 vuzpr LHS, <2,6,3,u>
- 1585452032U, // <1,u,7,0>: Cost 2 vext2 <7,0,1,u>, <7,0,1,u>
- 2557420340U, // <1,u,7,1>: Cost 3 vext1 <1,1,u,7>, <1,1,1,1>
- 2569365158U, // <1,u,7,2>: Cost 3 vext1 <3,1,u,7>, <2,3,0,1>
- 2569365803U, // <1,u,7,3>: Cost 3 vext1 <3,1,u,7>, <3,1,u,7>
- 2557422902U, // <1,u,7,4>: Cost 3 vext1 <1,1,u,7>, RHS
- 2662512021U, // <1,u,7,5>: Cost 3 vext2 <7,5,1,u>, <7,5,1,u>
- 2724845884U, // <1,u,7,6>: Cost 3 vext3 <6,7,0,1>, <u,7,6,7>
- 2659194476U, // <1,u,7,7>: Cost 3 vext2 <7,0,1,u>, <7,7,7,7>
- 1590761096U, // <1,u,7,u>: Cost 2 vext2 <7,u,1,u>, <7,u,1,u>
- 403972257U, // <1,u,u,0>: Cost 1 vext1 LHS, LHS
- 202162278U, // <1,u,u,1>: Cost 1 vdup1 LHS
- 115767091U, // <1,u,u,2>: Cost 1 vrev LHS
- 1745707677U, // <1,u,u,3>: Cost 2 vuzpr LHS, LHS
- 403975478U, // <1,u,u,4>: Cost 1 vext1 LHS, RHS
- 1546303642U, // <1,u,u,5>: Cost 2 vext2 <0,4,1,u>, RHS
- 1616009613U, // <1,u,u,6>: Cost 2 vext3 <0,u,1,1>, RHS
- 1745710633U, // <1,u,u,7>: Cost 2 vuzpr LHS, RHS
- 403978030U, // <1,u,u,u>: Cost 1 vext1 LHS, LHS
- 2551463936U, // <2,0,0,0>: Cost 3 vext1 <0,2,0,0>, <0,0,0,0>
- 2685698058U, // <2,0,0,1>: Cost 3 vext3 <0,2,0,2>, <0,0,1,1>
- 1610776596U, // <2,0,0,2>: Cost 2 vext3 <0,0,2,2>, <0,0,2,2>
- 2619384069U, // <2,0,0,3>: Cost 3 vext2 <0,3,2,0>, <0,3,2,0>
- 2551467318U, // <2,0,0,4>: Cost 3 vext1 <0,2,0,0>, RHS
- 3899836596U, // <2,0,0,5>: Cost 4 vuzpr <1,2,3,0>, <3,0,4,5>
- 2621374968U, // <2,0,0,6>: Cost 3 vext2 <0,6,2,0>, <0,6,2,0>
- 4168271334U, // <2,0,0,7>: Cost 4 vtrnr <1,2,3,0>, <2,0,5,7>
- 1611219018U, // <2,0,0,u>: Cost 2 vext3 <0,0,u,2>, <0,0,u,2>
- 2551472138U, // <2,0,1,0>: Cost 3 vext1 <0,2,0,1>, <0,0,1,1>
- 2690564186U, // <2,0,1,1>: Cost 3 vext3 <1,0,3,2>, <0,1,1,0>
- 1611956326U, // <2,0,1,2>: Cost 2 vext3 <0,2,0,2>, LHS
- 2826092646U, // <2,0,1,3>: Cost 3 vuzpr <1,2,3,0>, LHS
- 2551475510U, // <2,0,1,4>: Cost 3 vext1 <0,2,0,1>, RHS
- 3692463248U, // <2,0,1,5>: Cost 4 vext2 <0,2,2,0>, <1,5,3,7>
- 2587308473U, // <2,0,1,6>: Cost 3 vext1 <6,2,0,1>, <6,2,0,1>
- 3661050874U, // <2,0,1,7>: Cost 4 vext1 <6,2,0,1>, <7,0,1,2>
- 1611956380U, // <2,0,1,u>: Cost 2 vext3 <0,2,0,2>, LHS
- 1477738598U, // <2,0,2,0>: Cost 2 vext1 <0,2,0,2>, LHS
- 2551481078U, // <2,0,2,1>: Cost 3 vext1 <0,2,0,2>, <1,0,3,2>
- 2551481796U, // <2,0,2,2>: Cost 3 vext1 <0,2,0,2>, <2,0,2,0>
- 2551482518U, // <2,0,2,3>: Cost 3 vext1 <0,2,0,2>, <3,0,1,2>
- 1477741878U, // <2,0,2,4>: Cost 2 vext1 <0,2,0,2>, RHS
- 2551484112U, // <2,0,2,5>: Cost 3 vext1 <0,2,0,2>, <5,1,7,3>
- 2551484759U, // <2,0,2,6>: Cost 3 vext1 <0,2,0,2>, <6,0,7,2>
- 2551485434U, // <2,0,2,7>: Cost 3 vext1 <0,2,0,2>, <7,0,1,2>
- 1477744430U, // <2,0,2,u>: Cost 2 vext1 <0,2,0,2>, LHS
- 2953625600U, // <2,0,3,0>: Cost 3 vzipr LHS, <0,0,0,0>
- 2953627302U, // <2,0,3,1>: Cost 3 vzipr LHS, <2,3,0,1>
- 2953625764U, // <2,0,3,2>: Cost 3 vzipr LHS, <0,2,0,2>
- 4027369695U, // <2,0,3,3>: Cost 4 vzipr LHS, <3,1,0,3>
- 3625233718U, // <2,0,3,4>: Cost 4 vext1 <0,2,0,3>, RHS
- 3899836110U, // <2,0,3,5>: Cost 4 vuzpr <1,2,3,0>, <2,3,4,5>
- 4032012618U, // <2,0,3,6>: Cost 4 vzipr LHS, <0,4,0,6>
- 3899835392U, // <2,0,3,7>: Cost 4 vuzpr <1,2,3,0>, <1,3,5,7>
- 2953625770U, // <2,0,3,u>: Cost 3 vzipr LHS, <0,2,0,u>
- 2551496806U, // <2,0,4,0>: Cost 3 vext1 <0,2,0,4>, LHS
- 2685698386U, // <2,0,4,1>: Cost 3 vext3 <0,2,0,2>, <0,4,1,5>
- 2685698396U, // <2,0,4,2>: Cost 3 vext3 <0,2,0,2>, <0,4,2,6>
- 3625240726U, // <2,0,4,3>: Cost 4 vext1 <0,2,0,4>, <3,0,1,2>
- 2551500086U, // <2,0,4,4>: Cost 3 vext1 <0,2,0,4>, RHS
- 2618723638U, // <2,0,4,5>: Cost 3 vext2 <0,2,2,0>, RHS
- 2765409590U, // <2,0,4,6>: Cost 3 vuzpl <2,3,0,1>, RHS
- 3799990664U, // <2,0,4,7>: Cost 4 vext3 <7,0,1,2>, <0,4,7,5>
- 2685698450U, // <2,0,4,u>: Cost 3 vext3 <0,2,0,2>, <0,4,u,6>
- 3625246822U, // <2,0,5,0>: Cost 4 vext1 <0,2,0,5>, LHS
- 3289776304U, // <2,0,5,1>: Cost 4 vrev <0,2,1,5>
- 2690564526U, // <2,0,5,2>: Cost 3 vext3 <1,0,3,2>, <0,5,2,7>
- 3289923778U, // <2,0,5,3>: Cost 4 vrev <0,2,3,5>
- 2216255691U, // <2,0,5,4>: Cost 3 vrev <0,2,4,5>
- 3726307332U, // <2,0,5,5>: Cost 4 vext2 <5,u,2,0>, <5,5,5,5>
- 3726307426U, // <2,0,5,6>: Cost 4 vext2 <5,u,2,0>, <5,6,7,0>
- 2826095926U, // <2,0,5,7>: Cost 3 vuzpr <1,2,3,0>, RHS
- 2216550639U, // <2,0,5,u>: Cost 3 vrev <0,2,u,5>
- 4162420736U, // <2,0,6,0>: Cost 4 vtrnr <0,2,4,6>, <0,0,0,0>
- 2901885030U, // <2,0,6,1>: Cost 3 vzipl <2,6,3,7>, LHS
- 2685698559U, // <2,0,6,2>: Cost 3 vext3 <0,2,0,2>, <0,6,2,7>
- 3643173171U, // <2,0,6,3>: Cost 4 vext1 <3,2,0,6>, <3,2,0,6>
- 2216263884U, // <2,0,6,4>: Cost 3 vrev <0,2,4,6>
- 3730289341U, // <2,0,6,5>: Cost 4 vext2 <6,5,2,0>, <6,5,2,0>
- 3726308152U, // <2,0,6,6>: Cost 4 vext2 <5,u,2,0>, <6,6,6,6>
- 3899836346U, // <2,0,6,7>: Cost 4 vuzpr <1,2,3,0>, <2,6,3,7>
- 2216558832U, // <2,0,6,u>: Cost 3 vrev <0,2,u,6>
- 2659202049U, // <2,0,7,0>: Cost 3 vext2 <7,0,2,0>, <7,0,2,0>
- 3726308437U, // <2,0,7,1>: Cost 4 vext2 <5,u,2,0>, <7,1,2,3>
- 2726249034U, // <2,0,7,2>: Cost 3 vext3 <7,0,1,2>, <0,7,2,1>
- 3734934772U, // <2,0,7,3>: Cost 4 vext2 <7,3,2,0>, <7,3,2,0>
- 3726308710U, // <2,0,7,4>: Cost 4 vext2 <5,u,2,0>, <7,4,5,6>
- 3726308814U, // <2,0,7,5>: Cost 4 vext2 <5,u,2,0>, <7,5,u,2>
- 3736925671U, // <2,0,7,6>: Cost 4 vext2 <7,6,2,0>, <7,6,2,0>
- 3726308972U, // <2,0,7,7>: Cost 4 vext2 <5,u,2,0>, <7,7,7,7>
- 2659202049U, // <2,0,7,u>: Cost 3 vext2 <7,0,2,0>, <7,0,2,0>
- 1477787750U, // <2,0,u,0>: Cost 2 vext1 <0,2,0,u>, LHS
- 2953668262U, // <2,0,u,1>: Cost 3 vzipr LHS, <2,3,0,1>
- 1611956893U, // <2,0,u,2>: Cost 2 vext3 <0,2,0,2>, LHS
- 2551531670U, // <2,0,u,3>: Cost 3 vext1 <0,2,0,u>, <3,0,1,2>
- 1477791030U, // <2,0,u,4>: Cost 2 vext1 <0,2,0,u>, RHS
- 2618726554U, // <2,0,u,5>: Cost 3 vext2 <0,2,2,0>, RHS
- 2765412506U, // <2,0,u,6>: Cost 3 vuzpl <2,3,0,1>, RHS
- 2826096169U, // <2,0,u,7>: Cost 3 vuzpr <1,2,3,0>, RHS
- 1611956947U, // <2,0,u,u>: Cost 2 vext3 <0,2,0,2>, LHS
- 2569453670U, // <2,1,0,0>: Cost 3 vext1 <3,2,1,0>, LHS
- 2619392102U, // <2,1,0,1>: Cost 3 vext2 <0,3,2,1>, LHS
- 3759440619U, // <2,1,0,2>: Cost 4 vext3 <0,2,0,2>, <1,0,2,0>
- 1616823030U, // <2,1,0,3>: Cost 2 vext3 <1,0,3,2>, <1,0,3,2>
- 2569456950U, // <2,1,0,4>: Cost 3 vext1 <3,2,1,0>, RHS
- 2690712328U, // <2,1,0,5>: Cost 3 vext3 <1,0,5,2>, <1,0,5,2>
- 3661115841U, // <2,1,0,6>: Cost 4 vext1 <6,2,1,0>, <6,2,1,0>
- 2622046794U, // <2,1,0,7>: Cost 3 vext2 <0,7,2,1>, <0,7,2,1>
- 1617191715U, // <2,1,0,u>: Cost 2 vext3 <1,0,u,2>, <1,0,u,2>
- 2551545958U, // <2,1,1,0>: Cost 3 vext1 <0,2,1,1>, LHS
- 2685698868U, // <2,1,1,1>: Cost 3 vext3 <0,2,0,2>, <1,1,1,1>
- 2628682646U, // <2,1,1,2>: Cost 3 vext2 <1,u,2,1>, <1,2,3,0>
- 2685698888U, // <2,1,1,3>: Cost 3 vext3 <0,2,0,2>, <1,1,3,3>
- 2551549238U, // <2,1,1,4>: Cost 3 vext1 <0,2,1,1>, RHS
- 3693134992U, // <2,1,1,5>: Cost 4 vext2 <0,3,2,1>, <1,5,3,7>
- 3661124034U, // <2,1,1,6>: Cost 4 vext1 <6,2,1,1>, <6,2,1,1>
- 3625292794U, // <2,1,1,7>: Cost 4 vext1 <0,2,1,1>, <7,0,1,2>
- 2685698933U, // <2,1,1,u>: Cost 3 vext3 <0,2,0,2>, <1,1,u,3>
- 2551554150U, // <2,1,2,0>: Cost 3 vext1 <0,2,1,2>, LHS
- 3893649571U, // <2,1,2,1>: Cost 4 vuzpr <0,2,0,1>, <0,2,0,1>
- 2551555688U, // <2,1,2,2>: Cost 3 vext1 <0,2,1,2>, <2,2,2,2>
- 2685698966U, // <2,1,2,3>: Cost 3 vext3 <0,2,0,2>, <1,2,3,0>
- 2551557430U, // <2,1,2,4>: Cost 3 vext1 <0,2,1,2>, RHS
- 3763422123U, // <2,1,2,5>: Cost 4 vext3 <0,u,0,2>, <1,2,5,3>
- 3693135802U, // <2,1,2,6>: Cost 4 vext2 <0,3,2,1>, <2,6,3,7>
- 2726249402U, // <2,1,2,7>: Cost 3 vext3 <7,0,1,2>, <1,2,7,0>
- 2685699011U, // <2,1,2,u>: Cost 3 vext3 <0,2,0,2>, <1,2,u,0>
- 2551562342U, // <2,1,3,0>: Cost 3 vext1 <0,2,1,3>, LHS
- 2953625610U, // <2,1,3,1>: Cost 3 vzipr LHS, <0,0,1,1>
- 2953627798U, // <2,1,3,2>: Cost 3 vzipr LHS, <3,0,1,2>
- 2953626584U, // <2,1,3,3>: Cost 3 vzipr LHS, <1,3,1,3>
- 2551565622U, // <2,1,3,4>: Cost 3 vext1 <0,2,1,3>, RHS
- 2953625938U, // <2,1,3,5>: Cost 3 vzipr LHS, <0,4,1,5>
- 2587398596U, // <2,1,3,6>: Cost 3 vext1 <6,2,1,3>, <6,2,1,3>
- 4032013519U, // <2,1,3,7>: Cost 4 vzipr LHS, <1,6,1,7>
- 2953625617U, // <2,1,3,u>: Cost 3 vzipr LHS, <0,0,1,u>
- 2690565154U, // <2,1,4,0>: Cost 3 vext3 <1,0,3,2>, <1,4,0,5>
- 3625313270U, // <2,1,4,1>: Cost 4 vext1 <0,2,1,4>, <1,3,4,6>
- 3771532340U, // <2,1,4,2>: Cost 4 vext3 <2,2,2,2>, <1,4,2,5>
- 1148404634U, // <2,1,4,3>: Cost 2 vrev <1,2,3,4>
- 3625315638U, // <2,1,4,4>: Cost 4 vext1 <0,2,1,4>, RHS
- 2619395382U, // <2,1,4,5>: Cost 3 vext2 <0,3,2,1>, RHS
- 3837242678U, // <2,1,4,6>: Cost 4 vuzpl <2,0,1,2>, RHS
- 3799991394U, // <2,1,4,7>: Cost 4 vext3 <7,0,1,2>, <1,4,7,6>
- 1148773319U, // <2,1,4,u>: Cost 2 vrev <1,2,u,4>
- 2551578726U, // <2,1,5,0>: Cost 3 vext1 <0,2,1,5>, LHS
- 2551579648U, // <2,1,5,1>: Cost 3 vext1 <0,2,1,5>, <1,3,5,7>
- 3625321952U, // <2,1,5,2>: Cost 4 vext1 <0,2,1,5>, <2,0,5,1>
- 2685699216U, // <2,1,5,3>: Cost 3 vext3 <0,2,0,2>, <1,5,3,7>
- 2551582006U, // <2,1,5,4>: Cost 3 vext1 <0,2,1,5>, RHS
- 3740913668U, // <2,1,5,5>: Cost 4 vext2 <u,3,2,1>, <5,5,5,5>
- 3661156806U, // <2,1,5,6>: Cost 4 vext1 <6,2,1,5>, <6,2,1,5>
- 3893652790U, // <2,1,5,7>: Cost 4 vuzpr <0,2,0,1>, RHS
- 2685699261U, // <2,1,5,u>: Cost 3 vext3 <0,2,0,2>, <1,5,u,7>
- 2551586918U, // <2,1,6,0>: Cost 3 vext1 <0,2,1,6>, LHS
- 3625329398U, // <2,1,6,1>: Cost 4 vext1 <0,2,1,6>, <1,0,3,2>
- 2551588794U, // <2,1,6,2>: Cost 3 vext1 <0,2,1,6>, <2,6,3,7>
- 3088679014U, // <2,1,6,3>: Cost 3 vtrnr <0,2,4,6>, LHS
- 2551590198U, // <2,1,6,4>: Cost 3 vext1 <0,2,1,6>, RHS
- 4029382994U, // <2,1,6,5>: Cost 4 vzipr <0,4,2,6>, <0,4,1,5>
- 3625333560U, // <2,1,6,6>: Cost 4 vext1 <0,2,1,6>, <6,6,6,6>
- 3731624800U, // <2,1,6,7>: Cost 4 vext2 <6,7,2,1>, <6,7,2,1>
- 2551592750U, // <2,1,6,u>: Cost 3 vext1 <0,2,1,6>, LHS
- 2622051322U, // <2,1,7,0>: Cost 3 vext2 <0,7,2,1>, <7,0,1,2>
- 3733615699U, // <2,1,7,1>: Cost 4 vext2 <7,1,2,1>, <7,1,2,1>
- 3795125538U, // <2,1,7,2>: Cost 4 vext3 <6,1,7,2>, <1,7,2,0>
- 2222171037U, // <2,1,7,3>: Cost 3 vrev <1,2,3,7>
- 3740915046U, // <2,1,7,4>: Cost 4 vext2 <u,3,2,1>, <7,4,5,6>
- 3296060335U, // <2,1,7,5>: Cost 4 vrev <1,2,5,7>
- 3736933864U, // <2,1,7,6>: Cost 4 vext2 <7,6,2,1>, <7,6,2,1>
- 3805300055U, // <2,1,7,7>: Cost 4 vext3 <7,u,1,2>, <1,7,7,u>
- 2669827714U, // <2,1,7,u>: Cost 3 vext2 <u,7,2,1>, <7,u,1,2>
- 2551603302U, // <2,1,u,0>: Cost 3 vext1 <0,2,1,u>, LHS
- 2953666570U, // <2,1,u,1>: Cost 3 vzipr LHS, <0,0,1,1>
- 2953668758U, // <2,1,u,2>: Cost 3 vzipr LHS, <3,0,1,2>
- 1148437406U, // <2,1,u,3>: Cost 2 vrev <1,2,3,u>
- 2551606582U, // <2,1,u,4>: Cost 3 vext1 <0,2,1,u>, RHS
- 2953666898U, // <2,1,u,5>: Cost 3 vzipr LHS, <0,4,1,5>
- 2587398596U, // <2,1,u,6>: Cost 3 vext1 <6,2,1,3>, <6,2,1,3>
- 2669828370U, // <2,1,u,7>: Cost 3 vext2 <u,7,2,1>, <u,7,2,1>
- 1148806091U, // <2,1,u,u>: Cost 2 vrev <1,2,u,u>
- 1543667732U, // <2,2,0,0>: Cost 2 vext2 <0,0,2,2>, <0,0,2,2>
- 1548976230U, // <2,2,0,1>: Cost 2 vext2 <0,u,2,2>, LHS
- 2685699524U, // <2,2,0,2>: Cost 3 vext3 <0,2,0,2>, <2,0,2,0>
- 2685699535U, // <2,2,0,3>: Cost 3 vext3 <0,2,0,2>, <2,0,3,2>
- 2551614774U, // <2,2,0,4>: Cost 3 vext1 <0,2,2,0>, RHS
- 3704422830U, // <2,2,0,5>: Cost 4 vext2 <2,2,2,2>, <0,5,2,7>
- 3893657642U, // <2,2,0,6>: Cost 4 vuzpr <0,2,0,2>, <0,0,4,6>
- 3770574323U, // <2,2,0,7>: Cost 4 vext3 <2,0,7,2>, <2,0,7,2>
- 1548976796U, // <2,2,0,u>: Cost 2 vext2 <0,u,2,2>, <0,u,2,2>
- 2622718710U, // <2,2,1,0>: Cost 3 vext2 <0,u,2,2>, <1,0,3,2>
- 2622718772U, // <2,2,1,1>: Cost 3 vext2 <0,u,2,2>, <1,1,1,1>
- 2622718870U, // <2,2,1,2>: Cost 3 vext2 <0,u,2,2>, <1,2,3,0>
- 2819915878U, // <2,2,1,3>: Cost 3 vuzpr <0,2,0,2>, LHS
- 3625364790U, // <2,2,1,4>: Cost 4 vext1 <0,2,2,1>, RHS
- 2622719120U, // <2,2,1,5>: Cost 3 vext2 <0,u,2,2>, <1,5,3,7>
- 3760031292U, // <2,2,1,6>: Cost 4 vext3 <0,2,u,2>, <2,1,6,3>
- 3667170468U, // <2,2,1,7>: Cost 4 vext1 <7,2,2,1>, <7,2,2,1>
- 2819915883U, // <2,2,1,u>: Cost 3 vuzpr <0,2,0,2>, LHS
- 1489829990U, // <2,2,2,0>: Cost 2 vext1 <2,2,2,2>, LHS
- 2563572470U, // <2,2,2,1>: Cost 3 vext1 <2,2,2,2>, <1,0,3,2>
- 269271142U, // <2,2,2,2>: Cost 1 vdup2 LHS
- 2685699698U, // <2,2,2,3>: Cost 3 vext3 <0,2,0,2>, <2,2,3,3>
- 1489833270U, // <2,2,2,4>: Cost 2 vext1 <2,2,2,2>, RHS
- 2685699720U, // <2,2,2,5>: Cost 3 vext3 <0,2,0,2>, <2,2,5,7>
- 2622719930U, // <2,2,2,6>: Cost 3 vext2 <0,u,2,2>, <2,6,3,7>
- 2593436837U, // <2,2,2,7>: Cost 3 vext1 <7,2,2,2>, <7,2,2,2>
- 269271142U, // <2,2,2,u>: Cost 1 vdup2 LHS
- 2685699750U, // <2,2,3,0>: Cost 3 vext3 <0,2,0,2>, <2,3,0,1>
- 2690565806U, // <2,2,3,1>: Cost 3 vext3 <1,0,3,2>, <2,3,1,0>
- 2953627240U, // <2,2,3,2>: Cost 3 vzipr LHS, <2,2,2,2>
- 1879883878U, // <2,2,3,3>: Cost 2 vzipr LHS, LHS
- 2685699790U, // <2,2,3,4>: Cost 3 vext3 <0,2,0,2>, <2,3,4,5>
- 3893659342U, // <2,2,3,5>: Cost 4 vuzpr <0,2,0,2>, <2,3,4,5>
- 2958270812U, // <2,2,3,6>: Cost 3 vzipr LHS, <0,4,2,6>
- 2593445030U, // <2,2,3,7>: Cost 3 vext1 <7,2,2,3>, <7,2,2,3>
- 1879883883U, // <2,2,3,u>: Cost 2 vzipr LHS, LHS
- 2551644262U, // <2,2,4,0>: Cost 3 vext1 <0,2,2,4>, LHS
- 3625386742U, // <2,2,4,1>: Cost 4 vext1 <0,2,2,4>, <1,0,3,2>
- 2551645902U, // <2,2,4,2>: Cost 3 vext1 <0,2,2,4>, <2,3,4,5>
- 3759441686U, // <2,2,4,3>: Cost 4 vext3 <0,2,0,2>, <2,4,3,5>
- 2551647542U, // <2,2,4,4>: Cost 3 vext1 <0,2,2,4>, RHS
- 1548979510U, // <2,2,4,5>: Cost 2 vext2 <0,u,2,2>, RHS
- 2764901686U, // <2,2,4,6>: Cost 3 vuzpl <2,2,2,2>, RHS
- 3667195047U, // <2,2,4,7>: Cost 4 vext1 <7,2,2,4>, <7,2,2,4>
- 1548979753U, // <2,2,4,u>: Cost 2 vext2 <0,u,2,2>, RHS
- 3696463432U, // <2,2,5,0>: Cost 4 vext2 <0,u,2,2>, <5,0,1,2>
- 2617413328U, // <2,2,5,1>: Cost 3 vext2 <0,0,2,2>, <5,1,7,3>
- 2685699936U, // <2,2,5,2>: Cost 3 vext3 <0,2,0,2>, <2,5,2,7>
- 4027383910U, // <2,2,5,3>: Cost 4 vzipr <0,1,2,5>, LHS
- 2228201085U, // <2,2,5,4>: Cost 3 vrev <2,2,4,5>
- 2617413636U, // <2,2,5,5>: Cost 3 vext2 <0,0,2,2>, <5,5,5,5>
- 2617413730U, // <2,2,5,6>: Cost 3 vext2 <0,0,2,2>, <5,6,7,0>
- 2819919158U, // <2,2,5,7>: Cost 3 vuzpr <0,2,0,2>, RHS
- 2819919159U, // <2,2,5,u>: Cost 3 vuzpr <0,2,0,2>, RHS
- 3625402554U, // <2,2,6,0>: Cost 4 vext1 <0,2,2,6>, <0,2,2,6>
- 3760031652U, // <2,2,6,1>: Cost 4 vext3 <0,2,u,2>, <2,6,1,3>
- 2617414138U, // <2,2,6,2>: Cost 3 vext2 <0,0,2,2>, <6,2,7,3>
- 2685700026U, // <2,2,6,3>: Cost 3 vext3 <0,2,0,2>, <2,6,3,7>
- 3625405750U, // <2,2,6,4>: Cost 4 vext1 <0,2,2,6>, RHS
- 3760031692U, // <2,2,6,5>: Cost 4 vext3 <0,2,u,2>, <2,6,5,7>
- 3088679116U, // <2,2,6,6>: Cost 3 vtrnr <0,2,4,6>, <0,2,4,6>
- 2657891169U, // <2,2,6,7>: Cost 3 vext2 <6,7,2,2>, <6,7,2,2>
- 2685700071U, // <2,2,6,u>: Cost 3 vext3 <0,2,0,2>, <2,6,u,7>
- 2726250474U, // <2,2,7,0>: Cost 3 vext3 <7,0,1,2>, <2,7,0,1>
- 3704427616U, // <2,2,7,1>: Cost 4 vext2 <2,2,2,2>, <7,1,3,5>
- 2660545701U, // <2,2,7,2>: Cost 3 vext2 <7,2,2,2>, <7,2,2,2>
- 4030718054U, // <2,2,7,3>: Cost 4 vzipr <0,6,2,7>, LHS
- 2617415014U, // <2,2,7,4>: Cost 3 vext2 <0,0,2,2>, <7,4,5,6>
- 3302033032U, // <2,2,7,5>: Cost 4 vrev <2,2,5,7>
- 3661246929U, // <2,2,7,6>: Cost 4 vext1 <6,2,2,7>, <6,2,2,7>
- 2617415276U, // <2,2,7,7>: Cost 3 vext2 <0,0,2,2>, <7,7,7,7>
- 2731558962U, // <2,2,7,u>: Cost 3 vext3 <7,u,1,2>, <2,7,u,1>
- 1489829990U, // <2,2,u,0>: Cost 2 vext1 <2,2,2,2>, LHS
- 1548982062U, // <2,2,u,1>: Cost 2 vext2 <0,u,2,2>, LHS
- 269271142U, // <2,2,u,2>: Cost 1 vdup2 LHS
- 1879924838U, // <2,2,u,3>: Cost 2 vzipr LHS, LHS
- 1489833270U, // <2,2,u,4>: Cost 2 vext1 <2,2,2,2>, RHS
- 1548982426U, // <2,2,u,5>: Cost 2 vext2 <0,u,2,2>, RHS
- 2953666908U, // <2,2,u,6>: Cost 3 vzipr LHS, <0,4,2,6>
- 2819919401U, // <2,2,u,7>: Cost 3 vuzpr <0,2,0,2>, RHS
- 269271142U, // <2,2,u,u>: Cost 1 vdup2 LHS
- 1544339456U, // <2,3,0,0>: Cost 2 vext2 LHS, <0,0,0,0>
- 470597734U, // <2,3,0,1>: Cost 1 vext2 LHS, LHS
- 1548984484U, // <2,3,0,2>: Cost 2 vext2 LHS, <0,2,0,2>
- 2619408648U, // <2,3,0,3>: Cost 3 vext2 <0,3,2,3>, <0,3,2,3>
- 1548984658U, // <2,3,0,4>: Cost 2 vext2 LHS, <0,4,1,5>
- 2665857454U, // <2,3,0,5>: Cost 3 vext2 LHS, <0,5,2,7>
- 2622726655U, // <2,3,0,6>: Cost 3 vext2 LHS, <0,6,2,7>
- 2593494188U, // <2,3,0,7>: Cost 3 vext1 <7,2,3,0>, <7,2,3,0>
- 470598301U, // <2,3,0,u>: Cost 1 vext2 LHS, LHS
- 1544340214U, // <2,3,1,0>: Cost 2 vext2 LHS, <1,0,3,2>
- 1544340276U, // <2,3,1,1>: Cost 2 vext2 LHS, <1,1,1,1>
- 1544340374U, // <2,3,1,2>: Cost 2 vext2 LHS, <1,2,3,0>
- 1548985304U, // <2,3,1,3>: Cost 2 vext2 LHS, <1,3,1,3>
- 2551696694U, // <2,3,1,4>: Cost 3 vext1 <0,2,3,1>, RHS
- 1548985488U, // <2,3,1,5>: Cost 2 vext2 LHS, <1,5,3,7>
- 2622727375U, // <2,3,1,6>: Cost 3 vext2 LHS, <1,6,1,7>
- 2665858347U, // <2,3,1,7>: Cost 3 vext2 LHS, <1,7,3,0>
- 1548985709U, // <2,3,1,u>: Cost 2 vext2 LHS, <1,u,1,3>
- 2622727613U, // <2,3,2,0>: Cost 3 vext2 LHS, <2,0,1,2>
- 2622727711U, // <2,3,2,1>: Cost 3 vext2 LHS, <2,1,3,1>
- 1544341096U, // <2,3,2,2>: Cost 2 vext2 LHS, <2,2,2,2>
- 1544341158U, // <2,3,2,3>: Cost 2 vext2 LHS, <2,3,0,1>
- 2622727958U, // <2,3,2,4>: Cost 3 vext2 LHS, <2,4,3,5>
- 2622728032U, // <2,3,2,5>: Cost 3 vext2 LHS, <2,5,2,7>
- 1548986298U, // <2,3,2,6>: Cost 2 vext2 LHS, <2,6,3,7>
- 2665859050U, // <2,3,2,7>: Cost 3 vext2 LHS, <2,7,0,1>
- 1548986427U, // <2,3,2,u>: Cost 2 vext2 LHS, <2,u,0,1>
- 1548986518U, // <2,3,3,0>: Cost 2 vext2 LHS, <3,0,1,2>
- 2622728415U, // <2,3,3,1>: Cost 3 vext2 LHS, <3,1,0,3>
- 1489913458U, // <2,3,3,2>: Cost 2 vext1 <2,2,3,3>, <2,2,3,3>
- 1544341916U, // <2,3,3,3>: Cost 2 vext2 LHS, <3,3,3,3>
- 1548986882U, // <2,3,3,4>: Cost 2 vext2 LHS, <3,4,5,6>
- 2665859632U, // <2,3,3,5>: Cost 3 vext2 LHS, <3,5,1,7>
- 2234304870U, // <2,3,3,6>: Cost 3 vrev <3,2,6,3>
- 2958271632U, // <2,3,3,7>: Cost 3 vzipr LHS, <1,5,3,7>
- 1548987166U, // <2,3,3,u>: Cost 2 vext2 LHS, <3,u,1,2>
- 1483948134U, // <2,3,4,0>: Cost 2 vext1 <1,2,3,4>, LHS
- 1483948954U, // <2,3,4,1>: Cost 2 vext1 <1,2,3,4>, <1,2,3,4>
- 2622729276U, // <2,3,4,2>: Cost 3 vext2 LHS, <4,2,6,0>
- 2557692054U, // <2,3,4,3>: Cost 3 vext1 <1,2,3,4>, <3,0,1,2>
- 1483951414U, // <2,3,4,4>: Cost 2 vext1 <1,2,3,4>, RHS
- 470601014U, // <2,3,4,5>: Cost 1 vext2 LHS, RHS
- 1592118644U, // <2,3,4,6>: Cost 2 vext2 LHS, <4,6,4,6>
- 2593526960U, // <2,3,4,7>: Cost 3 vext1 <7,2,3,4>, <7,2,3,4>
- 470601257U, // <2,3,4,u>: Cost 1 vext2 LHS, RHS
- 2551726182U, // <2,3,5,0>: Cost 3 vext1 <0,2,3,5>, LHS
- 1592118992U, // <2,3,5,1>: Cost 2 vext2 LHS, <5,1,7,3>
- 2665860862U, // <2,3,5,2>: Cost 3 vext2 LHS, <5,2,3,4>
- 2551728642U, // <2,3,5,3>: Cost 3 vext1 <0,2,3,5>, <3,4,5,6>
- 1592119238U, // <2,3,5,4>: Cost 2 vext2 LHS, <5,4,7,6>
- 1592119300U, // <2,3,5,5>: Cost 2 vext2 LHS, <5,5,5,5>
- 1592119394U, // <2,3,5,6>: Cost 2 vext2 LHS, <5,6,7,0>
- 1592119464U, // <2,3,5,7>: Cost 2 vext2 LHS, <5,7,5,7>
- 1592119545U, // <2,3,5,u>: Cost 2 vext2 LHS, <5,u,5,7>
- 2622730529U, // <2,3,6,0>: Cost 3 vext2 LHS, <6,0,1,2>
- 2557707164U, // <2,3,6,1>: Cost 3 vext1 <1,2,3,6>, <1,2,3,6>
- 1592119802U, // <2,3,6,2>: Cost 2 vext2 LHS, <6,2,7,3>
- 2665861682U, // <2,3,6,3>: Cost 3 vext2 LHS, <6,3,4,5>
- 2622730893U, // <2,3,6,4>: Cost 3 vext2 LHS, <6,4,5,6>
- 2665861810U, // <2,3,6,5>: Cost 3 vext2 LHS, <6,5,0,7>
- 1592120120U, // <2,3,6,6>: Cost 2 vext2 LHS, <6,6,6,6>
- 1592120142U, // <2,3,6,7>: Cost 2 vext2 LHS, <6,7,0,1>
- 1592120223U, // <2,3,6,u>: Cost 2 vext2 LHS, <6,u,0,1>
- 1592120314U, // <2,3,7,0>: Cost 2 vext2 LHS, <7,0,1,2>
- 2659890261U, // <2,3,7,1>: Cost 3 vext2 <7,1,2,3>, <7,1,2,3>
- 2660553894U, // <2,3,7,2>: Cost 3 vext2 <7,2,2,3>, <7,2,2,3>
- 2665862371U, // <2,3,7,3>: Cost 3 vext2 LHS, <7,3,0,1>
- 1592120678U, // <2,3,7,4>: Cost 2 vext2 LHS, <7,4,5,6>
- 2665862534U, // <2,3,7,5>: Cost 3 vext2 LHS, <7,5,0,2>
- 2665862614U, // <2,3,7,6>: Cost 3 vext2 LHS, <7,6,0,1>
- 1592120940U, // <2,3,7,7>: Cost 2 vext2 LHS, <7,7,7,7>
- 1592120962U, // <2,3,7,u>: Cost 2 vext2 LHS, <7,u,1,2>
- 1548990163U, // <2,3,u,0>: Cost 2 vext2 LHS, <u,0,1,2>
- 470603566U, // <2,3,u,1>: Cost 1 vext2 LHS, LHS
- 1548990341U, // <2,3,u,2>: Cost 2 vext2 LHS, <u,2,3,0>
- 1548990396U, // <2,3,u,3>: Cost 2 vext2 LHS, <u,3,0,1>
- 1548990527U, // <2,3,u,4>: Cost 2 vext2 LHS, <u,4,5,6>
- 470603930U, // <2,3,u,5>: Cost 1 vext2 LHS, RHS
- 1548990672U, // <2,3,u,6>: Cost 2 vext2 LHS, <u,6,3,7>
- 1592121600U, // <2,3,u,7>: Cost 2 vext2 LHS, <u,7,0,1>
- 470604133U, // <2,3,u,u>: Cost 1 vext2 LHS, LHS
- 2617425942U, // <2,4,0,0>: Cost 3 vext2 <0,0,2,4>, <0,0,2,4>
- 2618753126U, // <2,4,0,1>: Cost 3 vext2 <0,2,2,4>, LHS
- 2618753208U, // <2,4,0,2>: Cost 3 vext2 <0,2,2,4>, <0,2,2,4>
- 2619416841U, // <2,4,0,3>: Cost 3 vext2 <0,3,2,4>, <0,3,2,4>
- 2587593628U, // <2,4,0,4>: Cost 3 vext1 <6,2,4,0>, <4,0,6,2>
- 2712832914U, // <2,4,0,5>: Cost 3 vext3 <4,6,u,2>, <4,0,5,1>
- 1634962332U, // <2,4,0,6>: Cost 2 vext3 <4,0,6,2>, <4,0,6,2>
- 3799993252U, // <2,4,0,7>: Cost 4 vext3 <7,0,1,2>, <4,0,7,1>
- 1634962332U, // <2,4,0,u>: Cost 2 vext3 <4,0,6,2>, <4,0,6,2>
- 2619417334U, // <2,4,1,0>: Cost 3 vext2 <0,3,2,4>, <1,0,3,2>
- 3692495668U, // <2,4,1,1>: Cost 4 vext2 <0,2,2,4>, <1,1,1,1>
- 2625389466U, // <2,4,1,2>: Cost 3 vext2 <1,3,2,4>, <1,2,3,4>
- 2826125414U, // <2,4,1,3>: Cost 3 vuzpr <1,2,3,4>, LHS
- 3699794995U, // <2,4,1,4>: Cost 4 vext2 <1,4,2,4>, <1,4,2,4>
- 3692496016U, // <2,4,1,5>: Cost 4 vext2 <0,2,2,4>, <1,5,3,7>
- 3763424238U, // <2,4,1,6>: Cost 4 vext3 <0,u,0,2>, <4,1,6,3>
- 3667317942U, // <2,4,1,7>: Cost 4 vext1 <7,2,4,1>, <7,2,4,1>
- 2826125419U, // <2,4,1,u>: Cost 3 vuzpr <1,2,3,4>, LHS
- 2629371336U, // <2,4,2,0>: Cost 3 vext2 <2,0,2,4>, <2,0,2,4>
- 3699131946U, // <2,4,2,1>: Cost 4 vext2 <1,3,2,4>, <2,1,4,3>
- 2630698602U, // <2,4,2,2>: Cost 3 vext2 <2,2,2,4>, <2,2,2,4>
- 2618754766U, // <2,4,2,3>: Cost 3 vext2 <0,2,2,4>, <2,3,4,5>
- 2826126234U, // <2,4,2,4>: Cost 3 vuzpr <1,2,3,4>, <1,2,3,4>
- 2899119414U, // <2,4,2,5>: Cost 3 vzipl <2,2,2,2>, RHS
- 3033337142U, // <2,4,2,6>: Cost 3 vtrnl <2,2,2,2>, RHS
- 3800214597U, // <2,4,2,7>: Cost 4 vext3 <7,0,4,2>, <4,2,7,0>
- 2899119657U, // <2,4,2,u>: Cost 3 vzipl <2,2,2,2>, RHS
- 2635344033U, // <2,4,3,0>: Cost 3 vext2 <3,0,2,4>, <3,0,2,4>
- 4032012325U, // <2,4,3,1>: Cost 4 vzipr LHS, <0,0,4,1>
- 3692497228U, // <2,4,3,2>: Cost 4 vext2 <0,2,2,4>, <3,2,3,4>
- 3692497308U, // <2,4,3,3>: Cost 4 vext2 <0,2,2,4>, <3,3,3,3>
- 3001404624U, // <2,4,3,4>: Cost 3 vzipr LHS, <4,4,4,4>
- 2953627342U, // <2,4,3,5>: Cost 3 vzipr LHS, <2,3,4,5>
- 2953625804U, // <2,4,3,6>: Cost 3 vzipr LHS, <0,2,4,6>
- 3899868160U, // <2,4,3,7>: Cost 4 vuzpr <1,2,3,4>, <1,3,5,7>
- 2953625806U, // <2,4,3,u>: Cost 3 vzipr LHS, <0,2,4,u>
- 2710916266U, // <2,4,4,0>: Cost 3 vext3 <4,4,0,2>, <4,4,0,2>
- 3899869648U, // <2,4,4,1>: Cost 4 vuzpr <1,2,3,4>, <3,4,0,1>
- 3899869658U, // <2,4,4,2>: Cost 4 vuzpr <1,2,3,4>, <3,4,1,2>
- 3899868930U, // <2,4,4,3>: Cost 4 vuzpr <1,2,3,4>, <2,4,1,3>
- 2712833232U, // <2,4,4,4>: Cost 3 vext3 <4,6,u,2>, <4,4,4,4>
- 2618756406U, // <2,4,4,5>: Cost 3 vext2 <0,2,2,4>, RHS
- 2765737270U, // <2,4,4,6>: Cost 3 vuzpl <2,3,4,5>, RHS
- 4168304426U, // <2,4,4,7>: Cost 4 vtrnr <1,2,3,4>, <2,4,5,7>
- 2618756649U, // <2,4,4,u>: Cost 3 vext2 <0,2,2,4>, RHS
- 2551800011U, // <2,4,5,0>: Cost 3 vext1 <0,2,4,5>, <0,2,4,5>
- 2569716470U, // <2,4,5,1>: Cost 3 vext1 <3,2,4,5>, <1,0,3,2>
- 2563745405U, // <2,4,5,2>: Cost 3 vext1 <2,2,4,5>, <2,2,4,5>
- 2569718102U, // <2,4,5,3>: Cost 3 vext1 <3,2,4,5>, <3,2,4,5>
- 2551803190U, // <2,4,5,4>: Cost 3 vext1 <0,2,4,5>, RHS
- 3625545732U, // <2,4,5,5>: Cost 4 vext1 <0,2,4,5>, <5,5,5,5>
- 1611959606U, // <2,4,5,6>: Cost 2 vext3 <0,2,0,2>, RHS
- 2826128694U, // <2,4,5,7>: Cost 3 vuzpr <1,2,3,4>, RHS
- 1611959624U, // <2,4,5,u>: Cost 2 vext3 <0,2,0,2>, RHS
- 1478066278U, // <2,4,6,0>: Cost 2 vext1 <0,2,4,6>, LHS
- 2551808758U, // <2,4,6,1>: Cost 3 vext1 <0,2,4,6>, <1,0,3,2>
- 2551809516U, // <2,4,6,2>: Cost 3 vext1 <0,2,4,6>, <2,0,6,4>
- 2551810198U, // <2,4,6,3>: Cost 3 vext1 <0,2,4,6>, <3,0,1,2>
- 1478069558U, // <2,4,6,4>: Cost 2 vext1 <0,2,4,6>, RHS
- 2901888310U, // <2,4,6,5>: Cost 3 vzipl <2,6,3,7>, RHS
- 2551812920U, // <2,4,6,6>: Cost 3 vext1 <0,2,4,6>, <6,6,6,6>
- 2726251914U, // <2,4,6,7>: Cost 3 vext3 <7,0,1,2>, <4,6,7,1>
- 1478072110U, // <2,4,6,u>: Cost 2 vext1 <0,2,4,6>, LHS
- 2659234821U, // <2,4,7,0>: Cost 3 vext2 <7,0,2,4>, <7,0,2,4>
- 3786722726U, // <2,4,7,1>: Cost 4 vext3 <4,7,1,2>, <4,7,1,2>
- 3734303911U, // <2,4,7,2>: Cost 4 vext2 <7,2,2,4>, <7,2,2,4>
- 3734967544U, // <2,4,7,3>: Cost 4 vext2 <7,3,2,4>, <7,3,2,4>
- 3727005030U, // <2,4,7,4>: Cost 4 vext2 <6,0,2,4>, <7,4,5,6>
- 2726251976U, // <2,4,7,5>: Cost 3 vext3 <7,0,1,2>, <4,7,5,0>
- 2726251986U, // <2,4,7,6>: Cost 3 vext3 <7,0,1,2>, <4,7,6,1>
- 3727005292U, // <2,4,7,7>: Cost 4 vext2 <6,0,2,4>, <7,7,7,7>
- 2659234821U, // <2,4,7,u>: Cost 3 vext2 <7,0,2,4>, <7,0,2,4>
- 1478082662U, // <2,4,u,0>: Cost 2 vext1 <0,2,4,u>, LHS
- 2618758958U, // <2,4,u,1>: Cost 3 vext2 <0,2,2,4>, LHS
- 2551826024U, // <2,4,u,2>: Cost 3 vext1 <0,2,4,u>, <2,2,2,2>
- 2551826582U, // <2,4,u,3>: Cost 3 vext1 <0,2,4,u>, <3,0,1,2>
- 1478085942U, // <2,4,u,4>: Cost 2 vext1 <0,2,4,u>, RHS
- 2953668302U, // <2,4,u,5>: Cost 3 vzipr LHS, <2,3,4,5>
- 1611959849U, // <2,4,u,6>: Cost 2 vext3 <0,2,0,2>, RHS
- 2826128937U, // <2,4,u,7>: Cost 3 vuzpr <1,2,3,4>, RHS
- 1611959867U, // <2,4,u,u>: Cost 2 vext3 <0,2,0,2>, RHS
- 3691839488U, // <2,5,0,0>: Cost 4 vext2 <0,1,2,5>, <0,0,0,0>
- 2618097766U, // <2,5,0,1>: Cost 3 vext2 <0,1,2,5>, LHS
- 2620088484U, // <2,5,0,2>: Cost 3 vext2 <0,4,2,5>, <0,2,0,2>
- 2619425034U, // <2,5,0,3>: Cost 3 vext2 <0,3,2,5>, <0,3,2,5>
- 2620088667U, // <2,5,0,4>: Cost 3 vext2 <0,4,2,5>, <0,4,2,5>
- 2620752300U, // <2,5,0,5>: Cost 3 vext2 <0,5,2,5>, <0,5,2,5>
- 3693830655U, // <2,5,0,6>: Cost 4 vext2 <0,4,2,5>, <0,6,2,7>
- 3094531382U, // <2,5,0,7>: Cost 3 vtrnr <1,2,3,0>, RHS
- 2618098333U, // <2,5,0,u>: Cost 3 vext2 <0,1,2,5>, LHS
- 3691840246U, // <2,5,1,0>: Cost 4 vext2 <0,1,2,5>, <1,0,3,2>
- 3691840308U, // <2,5,1,1>: Cost 4 vext2 <0,1,2,5>, <1,1,1,1>
- 2626061206U, // <2,5,1,2>: Cost 3 vext2 <1,4,2,5>, <1,2,3,0>
- 2618098688U, // <2,5,1,3>: Cost 3 vext2 <0,1,2,5>, <1,3,5,7>
- 2626061364U, // <2,5,1,4>: Cost 3 vext2 <1,4,2,5>, <1,4,2,5>
- 3691840656U, // <2,5,1,5>: Cost 4 vext2 <0,1,2,5>, <1,5,3,7>
- 3789082310U, // <2,5,1,6>: Cost 4 vext3 <5,1,6,2>, <5,1,6,2>
- 2712833744U, // <2,5,1,7>: Cost 3 vext3 <4,6,u,2>, <5,1,7,3>
- 2628715896U, // <2,5,1,u>: Cost 3 vext2 <1,u,2,5>, <1,u,2,5>
- 3693831613U, // <2,5,2,0>: Cost 4 vext2 <0,4,2,5>, <2,0,1,2>
- 4026698642U, // <2,5,2,1>: Cost 4 vzipr <0,0,2,2>, <4,0,5,1>
- 2632033896U, // <2,5,2,2>: Cost 3 vext2 <2,4,2,5>, <2,2,2,2>
- 3691841190U, // <2,5,2,3>: Cost 4 vext2 <0,1,2,5>, <2,3,0,1>
- 2632034061U, // <2,5,2,4>: Cost 3 vext2 <2,4,2,5>, <2,4,2,5>
- 3691841352U, // <2,5,2,5>: Cost 4 vext2 <0,1,2,5>, <2,5,0,1>
- 3691841466U, // <2,5,2,6>: Cost 4 vext2 <0,1,2,5>, <2,6,3,7>
- 3088354614U, // <2,5,2,7>: Cost 3 vtrnr <0,2,0,2>, RHS
- 3088354615U, // <2,5,2,u>: Cost 3 vtrnr <0,2,0,2>, RHS
- 2557829222U, // <2,5,3,0>: Cost 3 vext1 <1,2,5,3>, LHS
- 2557830059U, // <2,5,3,1>: Cost 3 vext1 <1,2,5,3>, <1,2,5,3>
- 2575746766U, // <2,5,3,2>: Cost 3 vext1 <4,2,5,3>, <2,3,4,5>
- 3691841948U, // <2,5,3,3>: Cost 4 vext2 <0,1,2,5>, <3,3,3,3>
- 2619427330U, // <2,5,3,4>: Cost 3 vext2 <0,3,2,5>, <3,4,5,6>
- 2581720847U, // <2,5,3,5>: Cost 3 vext1 <5,2,5,3>, <5,2,5,3>
- 2953628162U, // <2,5,3,6>: Cost 3 vzipr LHS, <3,4,5,6>
- 2953626624U, // <2,5,3,7>: Cost 3 vzipr LHS, <1,3,5,7>
- 2953626625U, // <2,5,3,u>: Cost 3 vzipr LHS, <1,3,5,u>
- 2569781350U, // <2,5,4,0>: Cost 3 vext1 <3,2,5,4>, LHS
- 3631580076U, // <2,5,4,1>: Cost 4 vext1 <1,2,5,4>, <1,2,5,4>
- 2569782990U, // <2,5,4,2>: Cost 3 vext1 <3,2,5,4>, <2,3,4,5>
- 2569783646U, // <2,5,4,3>: Cost 3 vext1 <3,2,5,4>, <3,2,5,4>
- 2569784630U, // <2,5,4,4>: Cost 3 vext1 <3,2,5,4>, RHS
- 2618101046U, // <2,5,4,5>: Cost 3 vext2 <0,1,2,5>, RHS
- 3893905922U, // <2,5,4,6>: Cost 4 vuzpr <0,2,3,5>, <3,4,5,6>
- 3094564150U, // <2,5,4,7>: Cost 3 vtrnr <1,2,3,4>, RHS
- 2618101289U, // <2,5,4,u>: Cost 3 vext2 <0,1,2,5>, RHS
- 2551873638U, // <2,5,5,0>: Cost 3 vext1 <0,2,5,5>, LHS
- 3637560320U, // <2,5,5,1>: Cost 4 vext1 <2,2,5,5>, <1,3,5,7>
- 3637560966U, // <2,5,5,2>: Cost 4 vext1 <2,2,5,5>, <2,2,5,5>
- 3723030343U, // <2,5,5,3>: Cost 4 vext2 <5,3,2,5>, <5,3,2,5>
- 2551876918U, // <2,5,5,4>: Cost 3 vext1 <0,2,5,5>, RHS
- 2712834052U, // <2,5,5,5>: Cost 3 vext3 <4,6,u,2>, <5,5,5,5>
- 4028713474U, // <2,5,5,6>: Cost 4 vzipr <0,3,2,5>, <3,4,5,6>
- 2712834072U, // <2,5,5,7>: Cost 3 vext3 <4,6,u,2>, <5,5,7,7>
- 2712834081U, // <2,5,5,u>: Cost 3 vext3 <4,6,u,2>, <5,5,u,7>
- 2575769702U, // <2,5,6,0>: Cost 3 vext1 <4,2,5,6>, LHS
- 3631596462U, // <2,5,6,1>: Cost 4 vext1 <1,2,5,6>, <1,2,5,6>
- 2655924730U, // <2,5,6,2>: Cost 3 vext2 <6,4,2,5>, <6,2,7,3>
- 3643541856U, // <2,5,6,3>: Cost 4 vext1 <3,2,5,6>, <3,2,5,6>
- 2655924849U, // <2,5,6,4>: Cost 3 vext2 <6,4,2,5>, <6,4,2,5>
- 3787755607U, // <2,5,6,5>: Cost 4 vext3 <4,u,6,2>, <5,6,5,7>
- 4029385218U, // <2,5,6,6>: Cost 4 vzipr <0,4,2,6>, <3,4,5,6>
- 3088682294U, // <2,5,6,7>: Cost 3 vtrnr <0,2,4,6>, RHS
- 3088682295U, // <2,5,6,u>: Cost 3 vtrnr <0,2,4,6>, RHS
- 2563833958U, // <2,5,7,0>: Cost 3 vext1 <2,2,5,7>, LHS
- 2551890678U, // <2,5,7,1>: Cost 3 vext1 <0,2,5,7>, <1,0,3,2>
- 2563835528U, // <2,5,7,2>: Cost 3 vext1 <2,2,5,7>, <2,2,5,7>
- 3637577878U, // <2,5,7,3>: Cost 4 vext1 <2,2,5,7>, <3,0,1,2>
- 2563837238U, // <2,5,7,4>: Cost 3 vext1 <2,2,5,7>, RHS
- 2712834216U, // <2,5,7,5>: Cost 3 vext3 <4,6,u,2>, <5,7,5,7>
- 2712834220U, // <2,5,7,6>: Cost 3 vext3 <4,6,u,2>, <5,7,6,2>
- 4174449974U, // <2,5,7,7>: Cost 4 vtrnr <2,2,5,7>, RHS
- 2563839790U, // <2,5,7,u>: Cost 3 vext1 <2,2,5,7>, LHS
- 2563842150U, // <2,5,u,0>: Cost 3 vext1 <2,2,5,u>, LHS
- 2618103598U, // <2,5,u,1>: Cost 3 vext2 <0,1,2,5>, LHS
- 2563843721U, // <2,5,u,2>: Cost 3 vext1 <2,2,5,u>, <2,2,5,u>
- 2569816418U, // <2,5,u,3>: Cost 3 vext1 <3,2,5,u>, <3,2,5,u>
- 2622748735U, // <2,5,u,4>: Cost 3 vext2 <0,u,2,5>, <u,4,5,6>
- 2618103962U, // <2,5,u,5>: Cost 3 vext2 <0,1,2,5>, RHS
- 2953669122U, // <2,5,u,6>: Cost 3 vzipr LHS, <3,4,5,6>
- 2953667584U, // <2,5,u,7>: Cost 3 vzipr LHS, <1,3,5,7>
- 2618104165U, // <2,5,u,u>: Cost 3 vext2 <0,1,2,5>, LHS
- 2620096512U, // <2,6,0,0>: Cost 3 vext2 <0,4,2,6>, <0,0,0,0>
- 1546354790U, // <2,6,0,1>: Cost 2 vext2 <0,4,2,6>, LHS
- 2620096676U, // <2,6,0,2>: Cost 3 vext2 <0,4,2,6>, <0,2,0,2>
- 3693838588U, // <2,6,0,3>: Cost 4 vext2 <0,4,2,6>, <0,3,1,0>
- 1546355036U, // <2,6,0,4>: Cost 2 vext2 <0,4,2,6>, <0,4,2,6>
- 3694502317U, // <2,6,0,5>: Cost 4 vext2 <0,5,2,6>, <0,5,2,6>
- 2551911246U, // <2,6,0,6>: Cost 3 vext1 <0,2,6,0>, <6,7,0,1>
- 2720723287U, // <2,6,0,7>: Cost 3 vext3 <6,0,7,2>, <6,0,7,2>
- 1546355357U, // <2,6,0,u>: Cost 2 vext2 <0,4,2,6>, LHS
- 2620097270U, // <2,6,1,0>: Cost 3 vext2 <0,4,2,6>, <1,0,3,2>
- 2620097332U, // <2,6,1,1>: Cost 3 vext2 <0,4,2,6>, <1,1,1,1>
- 2620097430U, // <2,6,1,2>: Cost 3 vext2 <0,4,2,6>, <1,2,3,0>
- 2820243558U, // <2,6,1,3>: Cost 3 vuzpr <0,2,4,6>, LHS
- 2620097598U, // <2,6,1,4>: Cost 3 vext2 <0,4,2,6>, <1,4,3,6>
- 2620097680U, // <2,6,1,5>: Cost 3 vext2 <0,4,2,6>, <1,5,3,7>
- 3693839585U, // <2,6,1,6>: Cost 4 vext2 <0,4,2,6>, <1,6,3,7>
- 2721386920U, // <2,6,1,7>: Cost 3 vext3 <6,1,7,2>, <6,1,7,2>
- 2820243563U, // <2,6,1,u>: Cost 3 vuzpr <0,2,4,6>, LHS
- 2714014137U, // <2,6,2,0>: Cost 3 vext3 <4,u,6,2>, <6,2,0,1>
- 2712834500U, // <2,6,2,1>: Cost 3 vext3 <4,6,u,2>, <6,2,1,3>
- 2620098152U, // <2,6,2,2>: Cost 3 vext2 <0,4,2,6>, <2,2,2,2>
- 2620098214U, // <2,6,2,3>: Cost 3 vext2 <0,4,2,6>, <2,3,0,1>
- 2632042254U, // <2,6,2,4>: Cost 3 vext2 <2,4,2,6>, <2,4,2,6>
- 2712834540U, // <2,6,2,5>: Cost 3 vext3 <4,6,u,2>, <6,2,5,7>
- 2820243660U, // <2,6,2,6>: Cost 3 vuzpr <0,2,4,6>, <0,2,4,6>
- 2958265654U, // <2,6,2,7>: Cost 3 vzipr <0,u,2,2>, RHS
- 2620098619U, // <2,6,2,u>: Cost 3 vext2 <0,4,2,6>, <2,u,0,1>
- 2620098710U, // <2,6,3,0>: Cost 3 vext2 <0,4,2,6>, <3,0,1,2>
- 3893986982U, // <2,6,3,1>: Cost 4 vuzpr <0,2,4,6>, <2,3,0,1>
- 2569848762U, // <2,6,3,2>: Cost 3 vext1 <3,2,6,3>, <2,6,3,7>
- 2620098972U, // <2,6,3,3>: Cost 3 vext2 <0,4,2,6>, <3,3,3,3>
- 2620099074U, // <2,6,3,4>: Cost 3 vext2 <0,4,2,6>, <3,4,5,6>
- 3893987022U, // <2,6,3,5>: Cost 4 vuzpr <0,2,4,6>, <2,3,4,5>
- 3001404644U, // <2,6,3,6>: Cost 3 vzipr LHS, <4,4,6,6>
- 1879887158U, // <2,6,3,7>: Cost 2 vzipr LHS, RHS
- 1879887159U, // <2,6,3,u>: Cost 2 vzipr LHS, RHS
- 2620099484U, // <2,6,4,0>: Cost 3 vext2 <0,4,2,6>, <4,0,6,2>
- 2620099566U, // <2,6,4,1>: Cost 3 vext2 <0,4,2,6>, <4,1,6,3>
- 2620099644U, // <2,6,4,2>: Cost 3 vext2 <0,4,2,6>, <4,2,6,0>
- 3643599207U, // <2,6,4,3>: Cost 4 vext1 <3,2,6,4>, <3,2,6,4>
- 2575830080U, // <2,6,4,4>: Cost 3 vext1 <4,2,6,4>, <4,2,6,4>
- 1546358070U, // <2,6,4,5>: Cost 2 vext2 <0,4,2,6>, RHS
- 2667875700U, // <2,6,4,6>: Cost 3 vext2 <u,4,2,6>, <4,6,4,6>
- 4028042550U, // <2,6,4,7>: Cost 4 vzipr <0,2,2,4>, RHS
- 1546358313U, // <2,6,4,u>: Cost 2 vext2 <0,4,2,6>, RHS
- 3693841992U, // <2,6,5,0>: Cost 4 vext2 <0,4,2,6>, <5,0,1,2>
- 2667876048U, // <2,6,5,1>: Cost 3 vext2 <u,4,2,6>, <5,1,7,3>
- 2712834756U, // <2,6,5,2>: Cost 3 vext3 <4,6,u,2>, <6,5,2,7>
- 3643607400U, // <2,6,5,3>: Cost 4 vext1 <3,2,6,5>, <3,2,6,5>
- 2252091873U, // <2,6,5,4>: Cost 3 vrev <6,2,4,5>
- 2667876356U, // <2,6,5,5>: Cost 3 vext2 <u,4,2,6>, <5,5,5,5>
- 2667876450U, // <2,6,5,6>: Cost 3 vext2 <u,4,2,6>, <5,6,7,0>
- 2820246838U, // <2,6,5,7>: Cost 3 vuzpr <0,2,4,6>, RHS
- 2820246839U, // <2,6,5,u>: Cost 3 vuzpr <0,2,4,6>, RHS
- 2563899494U, // <2,6,6,0>: Cost 3 vext1 <2,2,6,6>, LHS
- 3893988683U, // <2,6,6,1>: Cost 4 vuzpr <0,2,4,6>, <4,6,0,1>
- 2563901072U, // <2,6,6,2>: Cost 3 vext1 <2,2,6,6>, <2,2,6,6>
- 3893987236U, // <2,6,6,3>: Cost 4 vuzpr <0,2,4,6>, <2,6,1,3>
- 2563902774U, // <2,6,6,4>: Cost 3 vext1 <2,2,6,6>, RHS
- 3893988723U, // <2,6,6,5>: Cost 4 vuzpr <0,2,4,6>, <4,6,4,5>
- 2712834872U, // <2,6,6,6>: Cost 3 vext3 <4,6,u,2>, <6,6,6,6>
- 2955644214U, // <2,6,6,7>: Cost 3 vzipr <0,4,2,6>, RHS
- 2955644215U, // <2,6,6,u>: Cost 3 vzipr <0,4,2,6>, RHS
- 2712834894U, // <2,6,7,0>: Cost 3 vext3 <4,6,u,2>, <6,7,0,1>
- 2724926296U, // <2,6,7,1>: Cost 3 vext3 <6,7,1,2>, <6,7,1,2>
- 2725000033U, // <2,6,7,2>: Cost 3 vext3 <6,7,2,2>, <6,7,2,2>
- 2702365544U, // <2,6,7,3>: Cost 3 vext3 <3,0,1,2>, <6,7,3,0>
- 2712834934U, // <2,6,7,4>: Cost 3 vext3 <4,6,u,2>, <6,7,4,5>
- 3776107393U, // <2,6,7,5>: Cost 4 vext3 <3,0,1,2>, <6,7,5,7>
- 2725294981U, // <2,6,7,6>: Cost 3 vext3 <6,7,6,2>, <6,7,6,2>
- 2726253452U, // <2,6,7,7>: Cost 3 vext3 <7,0,1,2>, <6,7,7,0>
- 2712834966U, // <2,6,7,u>: Cost 3 vext3 <4,6,u,2>, <6,7,u,1>
- 2620102355U, // <2,6,u,0>: Cost 3 vext2 <0,4,2,6>, <u,0,1,2>
- 1546360622U, // <2,6,u,1>: Cost 2 vext2 <0,4,2,6>, LHS
- 2620102536U, // <2,6,u,2>: Cost 3 vext2 <0,4,2,6>, <u,2,3,3>
- 2820244125U, // <2,6,u,3>: Cost 3 vuzpr <0,2,4,6>, LHS
- 1594136612U, // <2,6,u,4>: Cost 2 vext2 <u,4,2,6>, <u,4,2,6>
- 1546360986U, // <2,6,u,5>: Cost 2 vext2 <0,4,2,6>, RHS
- 2620102864U, // <2,6,u,6>: Cost 3 vext2 <0,4,2,6>, <u,6,3,7>
- 1879928118U, // <2,6,u,7>: Cost 2 vzipr LHS, RHS
- 1879928119U, // <2,6,u,u>: Cost 2 vzipr LHS, RHS
- 2726179825U, // <2,7,0,0>: Cost 3 vext3 <7,0,0,2>, <7,0,0,2>
- 1652511738U, // <2,7,0,1>: Cost 2 vext3 <7,0,1,2>, <7,0,1,2>
- 2621431972U, // <2,7,0,2>: Cost 3 vext2 <0,6,2,7>, <0,2,0,2>
- 2257949868U, // <2,7,0,3>: Cost 3 vrev <7,2,3,0>
- 2726474773U, // <2,7,0,4>: Cost 3 vext3 <7,0,4,2>, <7,0,4,2>
- 2620768686U, // <2,7,0,5>: Cost 3 vext2 <0,5,2,7>, <0,5,2,7>
- 2621432319U, // <2,7,0,6>: Cost 3 vext2 <0,6,2,7>, <0,6,2,7>
- 2599760953U, // <2,7,0,7>: Cost 3 vext1 <u,2,7,0>, <7,0,u,2>
- 1653027897U, // <2,7,0,u>: Cost 2 vext3 <7,0,u,2>, <7,0,u,2>
- 2639348470U, // <2,7,1,0>: Cost 3 vext2 <3,6,2,7>, <1,0,3,2>
- 3695174452U, // <2,7,1,1>: Cost 4 vext2 <0,6,2,7>, <1,1,1,1>
- 3695174550U, // <2,7,1,2>: Cost 4 vext2 <0,6,2,7>, <1,2,3,0>
- 3694511104U, // <2,7,1,3>: Cost 4 vext2 <0,5,2,7>, <1,3,5,7>
- 3713090594U, // <2,7,1,4>: Cost 4 vext2 <3,6,2,7>, <1,4,0,5>
- 3693184144U, // <2,7,1,5>: Cost 4 vext2 <0,3,2,7>, <1,5,3,7>
- 2627405016U, // <2,7,1,6>: Cost 3 vext2 <1,6,2,7>, <1,6,2,7>
- 3799995519U, // <2,7,1,7>: Cost 4 vext3 <7,0,1,2>, <7,1,7,0>
- 2639348470U, // <2,7,1,u>: Cost 3 vext2 <3,6,2,7>, <1,0,3,2>
- 3695175101U, // <2,7,2,0>: Cost 4 vext2 <0,6,2,7>, <2,0,1,2>
- 3643655168U, // <2,7,2,1>: Cost 4 vext1 <3,2,7,2>, <1,3,5,7>
- 2257892517U, // <2,7,2,2>: Cost 3 vrev <7,2,2,2>
- 3695175334U, // <2,7,2,3>: Cost 4 vext2 <0,6,2,7>, <2,3,0,1>
- 3695175465U, // <2,7,2,4>: Cost 4 vext2 <0,6,2,7>, <2,4,5,6>
- 2632714080U, // <2,7,2,5>: Cost 3 vext2 <2,5,2,7>, <2,5,2,7>
- 2633377713U, // <2,7,2,6>: Cost 3 vext2 <2,6,2,7>, <2,6,2,7>
- 3695175658U, // <2,7,2,7>: Cost 4 vext2 <0,6,2,7>, <2,7,0,1>
- 2634704979U, // <2,7,2,u>: Cost 3 vext2 <2,u,2,7>, <2,u,2,7>
- 1514094694U, // <2,7,3,0>: Cost 2 vext1 <6,2,7,3>, LHS
- 2569921680U, // <2,7,3,1>: Cost 3 vext1 <3,2,7,3>, <1,5,3,7>
- 2587838056U, // <2,7,3,2>: Cost 3 vext1 <6,2,7,3>, <2,2,2,2>
- 2569922927U, // <2,7,3,3>: Cost 3 vext1 <3,2,7,3>, <3,2,7,3>
- 1514097974U, // <2,7,3,4>: Cost 2 vext1 <6,2,7,3>, RHS
- 2581868321U, // <2,7,3,5>: Cost 3 vext1 <5,2,7,3>, <5,2,7,3>
- 1514099194U, // <2,7,3,6>: Cost 2 vext1 <6,2,7,3>, <6,2,7,3>
- 2587841530U, // <2,7,3,7>: Cost 3 vext1 <6,2,7,3>, <7,0,1,2>
- 1514100526U, // <2,7,3,u>: Cost 2 vext1 <6,2,7,3>, LHS
- 2708706617U, // <2,7,4,0>: Cost 3 vext3 <4,0,6,2>, <7,4,0,6>
- 3649643418U, // <2,7,4,1>: Cost 4 vext1 <4,2,7,4>, <1,2,3,4>
- 3649644330U, // <2,7,4,2>: Cost 4 vext1 <4,2,7,4>, <2,4,5,7>
- 2257982640U, // <2,7,4,3>: Cost 3 vrev <7,2,3,4>
- 3649645641U, // <2,7,4,4>: Cost 4 vext1 <4,2,7,4>, <4,2,7,4>
- 2621435190U, // <2,7,4,5>: Cost 3 vext2 <0,6,2,7>, RHS
- 2712835441U, // <2,7,4,6>: Cost 3 vext3 <4,6,u,2>, <7,4,6,u>
- 3799995762U, // <2,7,4,7>: Cost 4 vext3 <7,0,1,2>, <7,4,7,0>
- 2621435433U, // <2,7,4,u>: Cost 3 vext2 <0,6,2,7>, RHS
- 2729497990U, // <2,7,5,0>: Cost 3 vext3 <7,5,0,2>, <7,5,0,2>
- 3643679744U, // <2,7,5,1>: Cost 4 vext1 <3,2,7,5>, <1,3,5,7>
- 3637708424U, // <2,7,5,2>: Cost 4 vext1 <2,2,7,5>, <2,2,5,7>
- 3643681137U, // <2,7,5,3>: Cost 4 vext1 <3,2,7,5>, <3,2,7,5>
- 2599800118U, // <2,7,5,4>: Cost 3 vext1 <u,2,7,5>, RHS
- 3786577334U, // <2,7,5,5>: Cost 4 vext3 <4,6,u,2>, <7,5,5,5>
- 3786577345U, // <2,7,5,6>: Cost 4 vext3 <4,6,u,2>, <7,5,6,7>
- 2599802214U, // <2,7,5,7>: Cost 3 vext1 <u,2,7,5>, <7,4,5,6>
- 2599802670U, // <2,7,5,u>: Cost 3 vext1 <u,2,7,5>, LHS
- 2581889126U, // <2,7,6,0>: Cost 3 vext1 <5,2,7,6>, LHS
- 3643687936U, // <2,7,6,1>: Cost 4 vext1 <3,2,7,6>, <1,3,5,7>
- 2663240186U, // <2,7,6,2>: Cost 3 vext2 <7,6,2,7>, <6,2,7,3>
- 3643689330U, // <2,7,6,3>: Cost 4 vext1 <3,2,7,6>, <3,2,7,6>
- 2581892406U, // <2,7,6,4>: Cost 3 vext1 <5,2,7,6>, RHS
- 2581892900U, // <2,7,6,5>: Cost 3 vext1 <5,2,7,6>, <5,2,7,6>
- 2587865597U, // <2,7,6,6>: Cost 3 vext1 <6,2,7,6>, <6,2,7,6>
- 3786577428U, // <2,7,6,7>: Cost 4 vext3 <4,6,u,2>, <7,6,7,0>
- 2581894958U, // <2,7,6,u>: Cost 3 vext1 <5,2,7,6>, LHS
- 2726254119U, // <2,7,7,0>: Cost 3 vext3 <7,0,1,2>, <7,7,0,1>
- 3804640817U, // <2,7,7,1>: Cost 4 vext3 <7,7,1,2>, <7,7,1,2>
- 3637724826U, // <2,7,7,2>: Cost 4 vext1 <2,2,7,7>, <2,2,7,7>
- 3734992123U, // <2,7,7,3>: Cost 4 vext2 <7,3,2,7>, <7,3,2,7>
- 2552040758U, // <2,7,7,4>: Cost 3 vext1 <0,2,7,7>, RHS
- 3799995992U, // <2,7,7,5>: Cost 4 vext3 <7,0,1,2>, <7,7,5,5>
- 2663241198U, // <2,7,7,6>: Cost 3 vext2 <7,6,2,7>, <7,6,2,7>
- 2712835692U, // <2,7,7,7>: Cost 3 vext3 <4,6,u,2>, <7,7,7,7>
- 2731562607U, // <2,7,7,u>: Cost 3 vext3 <7,u,1,2>, <7,7,u,1>
- 1514135654U, // <2,7,u,0>: Cost 2 vext1 <6,2,7,u>, LHS
- 1657820802U, // <2,7,u,1>: Cost 2 vext3 <7,u,1,2>, <7,u,1,2>
- 2587879016U, // <2,7,u,2>: Cost 3 vext1 <6,2,7,u>, <2,2,2,2>
- 2569963892U, // <2,7,u,3>: Cost 3 vext1 <3,2,7,u>, <3,2,7,u>
- 1514138934U, // <2,7,u,4>: Cost 2 vext1 <6,2,7,u>, RHS
- 2621438106U, // <2,7,u,5>: Cost 3 vext2 <0,6,2,7>, RHS
- 1514140159U, // <2,7,u,6>: Cost 2 vext1 <6,2,7,u>, <6,2,7,u>
- 2587882490U, // <2,7,u,7>: Cost 3 vext1 <6,2,7,u>, <7,0,1,2>
- 1514141486U, // <2,7,u,u>: Cost 2 vext1 <6,2,7,u>, LHS
- 1544380416U, // <2,u,0,0>: Cost 2 vext2 LHS, <0,0,0,0>
- 470638699U, // <2,u,0,1>: Cost 1 vext2 LHS, LHS
- 1544380580U, // <2,u,0,2>: Cost 2 vext2 LHS, <0,2,0,2>
- 1658631909U, // <2,u,0,3>: Cost 2 vext3 <u,0,3,2>, <u,0,3,2>
- 1544380754U, // <2,u,0,4>: Cost 2 vext2 LHS, <0,4,1,5>
- 2665898414U, // <2,u,0,5>: Cost 3 vext2 LHS, <0,5,2,7>
- 1658853120U, // <2,u,0,6>: Cost 2 vext3 <u,0,6,2>, <u,0,6,2>
- 3094531625U, // <2,u,0,7>: Cost 3 vtrnr <1,2,3,0>, RHS
- 470639261U, // <2,u,0,u>: Cost 1 vext2 LHS, LHS
- 1544381174U, // <2,u,1,0>: Cost 2 vext2 LHS, <1,0,3,2>
- 1544381236U, // <2,u,1,1>: Cost 2 vext2 LHS, <1,1,1,1>
- 1544381334U, // <2,u,1,2>: Cost 2 vext2 LHS, <1,2,3,0>
- 1544381400U, // <2,u,1,3>: Cost 2 vext2 LHS, <1,3,1,3>
- 2618123325U, // <2,u,1,4>: Cost 3 vext2 LHS, <1,4,3,5>
- 1544381584U, // <2,u,1,5>: Cost 2 vext2 LHS, <1,5,3,7>
- 2618123489U, // <2,u,1,6>: Cost 3 vext2 LHS, <1,6,3,7>
- 2726254427U, // <2,u,1,7>: Cost 3 vext3 <7,0,1,2>, <u,1,7,3>
- 1544381823U, // <2,u,1,u>: Cost 2 vext2 LHS, <1,u,3,3>
- 1478328422U, // <2,u,2,0>: Cost 2 vext1 <0,2,u,2>, LHS
- 2618123807U, // <2,u,2,1>: Cost 3 vext2 LHS, <2,1,3,1>
- 269271142U, // <2,u,2,2>: Cost 1 vdup2 LHS
- 1544382118U, // <2,u,2,3>: Cost 2 vext2 LHS, <2,3,0,1>
- 1478331702U, // <2,u,2,4>: Cost 2 vext1 <0,2,u,2>, RHS
- 2618124136U, // <2,u,2,5>: Cost 3 vext2 LHS, <2,5,3,6>
- 1544382394U, // <2,u,2,6>: Cost 2 vext2 LHS, <2,6,3,7>
- 3088354857U, // <2,u,2,7>: Cost 3 vtrnr <0,2,0,2>, RHS
- 269271142U, // <2,u,2,u>: Cost 1 vdup2 LHS
- 1544382614U, // <2,u,3,0>: Cost 2 vext2 LHS, <3,0,1,2>
- 2953627374U, // <2,u,3,1>: Cost 3 vzipr LHS, <2,3,u,1>
- 1490282143U, // <2,u,3,2>: Cost 2 vext1 <2,2,u,3>, <2,2,u,3>
- 1879883932U, // <2,u,3,3>: Cost 2 vzipr LHS, LHS
- 1544382978U, // <2,u,3,4>: Cost 2 vext2 LHS, <3,4,5,6>
- 2953627378U, // <2,u,3,5>: Cost 3 vzipr LHS, <2,3,u,5>
- 1514172931U, // <2,u,3,6>: Cost 2 vext1 <6,2,u,3>, <6,2,u,3>
- 1879887176U, // <2,u,3,7>: Cost 2 vzipr LHS, RHS
- 1879883937U, // <2,u,3,u>: Cost 2 vzipr LHS, LHS
- 1484316774U, // <2,u,4,0>: Cost 2 vext1 <1,2,u,4>, LHS
- 1484317639U, // <2,u,4,1>: Cost 2 vext1 <1,2,u,4>, <1,2,u,4>
- 2552088270U, // <2,u,4,2>: Cost 3 vext1 <0,2,u,4>, <2,3,4,5>
- 1190213513U, // <2,u,4,3>: Cost 2 vrev <u,2,3,4>
- 1484320054U, // <2,u,4,4>: Cost 2 vext1 <1,2,u,4>, RHS
- 470641974U, // <2,u,4,5>: Cost 1 vext2 LHS, RHS
- 1592159604U, // <2,u,4,6>: Cost 2 vext2 LHS, <4,6,4,6>
- 3094564393U, // <2,u,4,7>: Cost 3 vtrnr <1,2,3,4>, RHS
- 470642217U, // <2,u,4,u>: Cost 1 vext2 LHS, RHS
- 2552094959U, // <2,u,5,0>: Cost 3 vext1 <0,2,u,5>, <0,2,u,5>
- 1592159952U, // <2,u,5,1>: Cost 2 vext2 LHS, <5,1,7,3>
- 2564040353U, // <2,u,5,2>: Cost 3 vext1 <2,2,u,5>, <2,2,u,5>
- 2690275455U, // <2,u,5,3>: Cost 3 vext3 <0,u,u,2>, <u,5,3,7>
- 1592160198U, // <2,u,5,4>: Cost 2 vext2 LHS, <5,4,7,6>
- 1592160260U, // <2,u,5,5>: Cost 2 vext2 LHS, <5,5,5,5>
- 1611962522U, // <2,u,5,6>: Cost 2 vext3 <0,2,0,2>, RHS
- 1592160424U, // <2,u,5,7>: Cost 2 vext2 LHS, <5,7,5,7>
- 1611962540U, // <2,u,5,u>: Cost 2 vext3 <0,2,0,2>, RHS
- 1478361190U, // <2,u,6,0>: Cost 2 vext1 <0,2,u,6>, LHS
- 2552103670U, // <2,u,6,1>: Cost 3 vext1 <0,2,u,6>, <1,0,3,2>
- 1592160762U, // <2,u,6,2>: Cost 2 vext2 LHS, <6,2,7,3>
- 2685704400U, // <2,u,6,3>: Cost 3 vext3 <0,2,0,2>, <u,6,3,7>
- 1478364470U, // <2,u,6,4>: Cost 2 vext1 <0,2,u,6>, RHS
- 2901891226U, // <2,u,6,5>: Cost 3 vzipl <2,6,3,7>, RHS
- 1592161080U, // <2,u,6,6>: Cost 2 vext2 LHS, <6,6,6,6>
- 1592161102U, // <2,u,6,7>: Cost 2 vext2 LHS, <6,7,0,1>
- 1478367022U, // <2,u,6,u>: Cost 2 vext1 <0,2,u,6>, LHS
- 1592161274U, // <2,u,7,0>: Cost 2 vext2 LHS, <7,0,1,2>
- 2659931226U, // <2,u,7,1>: Cost 3 vext2 <7,1,2,u>, <7,1,2,u>
- 2564056739U, // <2,u,7,2>: Cost 3 vext1 <2,2,u,7>, <2,2,u,7>
- 2665903331U, // <2,u,7,3>: Cost 3 vext2 LHS, <7,3,0,1>
- 1592161638U, // <2,u,7,4>: Cost 2 vext2 LHS, <7,4,5,6>
- 2665903494U, // <2,u,7,5>: Cost 3 vext2 LHS, <7,5,0,2>
- 2587947527U, // <2,u,7,6>: Cost 3 vext1 <6,2,u,7>, <6,2,u,7>
- 1592161900U, // <2,u,7,7>: Cost 2 vext2 LHS, <7,7,7,7>
- 1592161922U, // <2,u,7,u>: Cost 2 vext2 LHS, <7,u,1,2>
- 1478377574U, // <2,u,u,0>: Cost 2 vext1 <0,2,u,u>, LHS
- 470644526U, // <2,u,u,1>: Cost 1 vext2 LHS, LHS
- 269271142U, // <2,u,u,2>: Cost 1 vdup2 LHS
- 1879924892U, // <2,u,u,3>: Cost 2 vzipr LHS, LHS
- 1478380854U, // <2,u,u,4>: Cost 2 vext1 <0,2,u,u>, RHS
- 470644890U, // <2,u,u,5>: Cost 1 vext2 LHS, RHS
- 1611962765U, // <2,u,u,6>: Cost 2 vext3 <0,2,0,2>, RHS
- 1879928136U, // <2,u,u,7>: Cost 2 vzipr LHS, RHS
- 470645093U, // <2,u,u,u>: Cost 1 vext2 LHS, LHS
- 1611448320U, // <3,0,0,0>: Cost 2 vext3 LHS, <0,0,0,0>
- 1611890698U, // <3,0,0,1>: Cost 2 vext3 LHS, <0,0,1,1>
- 1611890708U, // <3,0,0,2>: Cost 2 vext3 LHS, <0,0,2,2>
- 3763576860U, // <3,0,0,3>: Cost 4 vext3 LHS, <0,0,3,1>
- 2689835045U, // <3,0,0,4>: Cost 3 vext3 LHS, <0,0,4,1>
- 3698508206U, // <3,0,0,5>: Cost 4 vext2 <1,2,3,0>, <0,5,2,7>
- 3763576887U, // <3,0,0,6>: Cost 4 vext3 LHS, <0,0,6,1>
- 3667678434U, // <3,0,0,7>: Cost 4 vext1 <7,3,0,0>, <7,3,0,0>
- 1616093258U, // <3,0,0,u>: Cost 2 vext3 LHS, <0,0,u,2>
- 1490337894U, // <3,0,1,0>: Cost 2 vext1 <2,3,0,1>, LHS
- 2685632602U, // <3,0,1,1>: Cost 3 vext3 LHS, <0,1,1,0>
- 537706598U, // <3,0,1,2>: Cost 1 vext3 LHS, LHS
- 2624766936U, // <3,0,1,3>: Cost 3 vext2 <1,2,3,0>, <1,3,1,3>
- 1490341174U, // <3,0,1,4>: Cost 2 vext1 <2,3,0,1>, RHS
- 2624767120U, // <3,0,1,5>: Cost 3 vext2 <1,2,3,0>, <1,5,3,7>
- 2732966030U, // <3,0,1,6>: Cost 3 vext3 LHS, <0,1,6,7>
- 2593944803U, // <3,0,1,7>: Cost 3 vext1 <7,3,0,1>, <7,3,0,1>
- 537706652U, // <3,0,1,u>: Cost 1 vext3 LHS, LHS
- 1611890852U, // <3,0,2,0>: Cost 2 vext3 LHS, <0,2,0,2>
- 2685632684U, // <3,0,2,1>: Cost 3 vext3 LHS, <0,2,1,1>
- 2685632692U, // <3,0,2,2>: Cost 3 vext3 LHS, <0,2,2,0>
- 2685632702U, // <3,0,2,3>: Cost 3 vext3 LHS, <0,2,3,1>
- 1611890892U, // <3,0,2,4>: Cost 2 vext3 LHS, <0,2,4,6>
- 2732966102U, // <3,0,2,5>: Cost 3 vext3 LHS, <0,2,5,7>
- 2624767930U, // <3,0,2,6>: Cost 3 vext2 <1,2,3,0>, <2,6,3,7>
- 2685632744U, // <3,0,2,7>: Cost 3 vext3 LHS, <0,2,7,7>
- 1611890924U, // <3,0,2,u>: Cost 2 vext3 LHS, <0,2,u,2>
- 2624768150U, // <3,0,3,0>: Cost 3 vext2 <1,2,3,0>, <3,0,1,2>
- 2685632764U, // <3,0,3,1>: Cost 3 vext3 LHS, <0,3,1,0>
- 2685632774U, // <3,0,3,2>: Cost 3 vext3 LHS, <0,3,2,1>
- 2624768412U, // <3,0,3,3>: Cost 3 vext2 <1,2,3,0>, <3,3,3,3>
- 2624768514U, // <3,0,3,4>: Cost 3 vext2 <1,2,3,0>, <3,4,5,6>
- 3702491714U, // <3,0,3,5>: Cost 4 vext2 <1,u,3,0>, <3,5,3,7>
- 2624768632U, // <3,0,3,6>: Cost 3 vext2 <1,2,3,0>, <3,6,0,7>
- 3702491843U, // <3,0,3,7>: Cost 4 vext2 <1,u,3,0>, <3,7,0,1>
- 2686959934U, // <3,0,3,u>: Cost 3 vext3 <0,3,u,3>, <0,3,u,3>
- 2689835336U, // <3,0,4,0>: Cost 3 vext3 LHS, <0,4,0,4>
- 1611891026U, // <3,0,4,1>: Cost 2 vext3 LHS, <0,4,1,5>
- 1611891036U, // <3,0,4,2>: Cost 2 vext3 LHS, <0,4,2,6>
- 3763577184U, // <3,0,4,3>: Cost 4 vext3 LHS, <0,4,3,1>
- 2689835374U, // <3,0,4,4>: Cost 3 vext3 LHS, <0,4,4,6>
- 1551027510U, // <3,0,4,5>: Cost 2 vext2 <1,2,3,0>, RHS
- 2666573172U, // <3,0,4,6>: Cost 3 vext2 <u,2,3,0>, <4,6,4,6>
- 3667711206U, // <3,0,4,7>: Cost 4 vext1 <7,3,0,4>, <7,3,0,4>
- 1616093586U, // <3,0,4,u>: Cost 2 vext3 LHS, <0,4,u,6>
- 2685190556U, // <3,0,5,0>: Cost 3 vext3 LHS, <0,5,0,7>
- 2666573520U, // <3,0,5,1>: Cost 3 vext2 <u,2,3,0>, <5,1,7,3>
- 3040886886U, // <3,0,5,2>: Cost 3 vtrnl <3,4,5,6>, LHS
- 3625912834U, // <3,0,5,3>: Cost 4 vext1 <0,3,0,5>, <3,4,5,6>
- 2666573766U, // <3,0,5,4>: Cost 3 vext2 <u,2,3,0>, <5,4,7,6>
- 2666573828U, // <3,0,5,5>: Cost 3 vext2 <u,2,3,0>, <5,5,5,5>
- 2732966354U, // <3,0,5,6>: Cost 3 vext3 LHS, <0,5,6,7>
- 2666573992U, // <3,0,5,7>: Cost 3 vext2 <u,2,3,0>, <5,7,5,7>
- 3040886940U, // <3,0,5,u>: Cost 3 vtrnl <3,4,5,6>, LHS
- 2685190637U, // <3,0,6,0>: Cost 3 vext3 LHS, <0,6,0,7>
- 2732966390U, // <3,0,6,1>: Cost 3 vext3 LHS, <0,6,1,7>
- 2689835519U, // <3,0,6,2>: Cost 3 vext3 LHS, <0,6,2,7>
- 3667724438U, // <3,0,6,3>: Cost 4 vext1 <7,3,0,6>, <3,0,1,2>
- 3763577355U, // <3,0,6,4>: Cost 4 vext3 LHS, <0,6,4,1>
- 3806708243U, // <3,0,6,5>: Cost 4 vext3 LHS, <0,6,5,0>
- 2666574648U, // <3,0,6,6>: Cost 3 vext2 <u,2,3,0>, <6,6,6,6>
- 2657948520U, // <3,0,6,7>: Cost 3 vext2 <6,7,3,0>, <6,7,3,0>
- 2689835573U, // <3,0,6,u>: Cost 3 vext3 LHS, <0,6,u,7>
- 2666574842U, // <3,0,7,0>: Cost 3 vext2 <u,2,3,0>, <7,0,1,2>
- 2685633095U, // <3,0,7,1>: Cost 3 vext3 LHS, <0,7,1,7>
- 2660603052U, // <3,0,7,2>: Cost 3 vext2 <7,2,3,0>, <7,2,3,0>
- 3643844997U, // <3,0,7,3>: Cost 4 vext1 <3,3,0,7>, <3,3,0,7>
- 2666575206U, // <3,0,7,4>: Cost 3 vext2 <u,2,3,0>, <7,4,5,6>
- 3655790391U, // <3,0,7,5>: Cost 4 vext1 <5,3,0,7>, <5,3,0,7>
- 3731690968U, // <3,0,7,6>: Cost 4 vext2 <6,7,3,0>, <7,6,0,3>
- 2666575468U, // <3,0,7,7>: Cost 3 vext2 <u,2,3,0>, <7,7,7,7>
- 2664584850U, // <3,0,7,u>: Cost 3 vext2 <7,u,3,0>, <7,u,3,0>
- 1616093834U, // <3,0,u,0>: Cost 2 vext3 LHS, <0,u,0,2>
- 1611891346U, // <3,0,u,1>: Cost 2 vext3 LHS, <0,u,1,1>
- 537707165U, // <3,0,u,2>: Cost 1 vext3 LHS, LHS
- 2689835684U, // <3,0,u,3>: Cost 3 vext3 LHS, <0,u,3,1>
- 1616093874U, // <3,0,u,4>: Cost 2 vext3 LHS, <0,u,4,6>
- 1551030426U, // <3,0,u,5>: Cost 2 vext2 <1,2,3,0>, RHS
- 2624772304U, // <3,0,u,6>: Cost 3 vext2 <1,2,3,0>, <u,6,3,7>
- 2594002154U, // <3,0,u,7>: Cost 3 vext1 <7,3,0,u>, <7,3,0,u>
- 537707219U, // <3,0,u,u>: Cost 1 vext3 LHS, LHS
- 2552201318U, // <3,1,0,0>: Cost 3 vext1 <0,3,1,0>, LHS
- 2618802278U, // <3,1,0,1>: Cost 3 vext2 <0,2,3,1>, LHS
- 2618802366U, // <3,1,0,2>: Cost 3 vext2 <0,2,3,1>, <0,2,3,1>
- 1611449078U, // <3,1,0,3>: Cost 2 vext3 LHS, <1,0,3,2>
- 2552204598U, // <3,1,0,4>: Cost 3 vext1 <0,3,1,0>, RHS
- 2732966663U, // <3,1,0,5>: Cost 3 vext3 LHS, <1,0,5,1>
- 3906258396U, // <3,1,0,6>: Cost 4 vuzpr <2,3,0,1>, <2,0,4,6>
- 3667752171U, // <3,1,0,7>: Cost 4 vext1 <7,3,1,0>, <7,3,1,0>
- 1611891491U, // <3,1,0,u>: Cost 2 vext3 LHS, <1,0,u,2>
- 2689835819U, // <3,1,1,0>: Cost 3 vext3 LHS, <1,1,0,1>
- 1611449140U, // <3,1,1,1>: Cost 2 vext3 LHS, <1,1,1,1>
- 2624775063U, // <3,1,1,2>: Cost 3 vext2 <1,2,3,1>, <1,2,3,1>
- 1611891528U, // <3,1,1,3>: Cost 2 vext3 LHS, <1,1,3,3>
- 2689835859U, // <3,1,1,4>: Cost 3 vext3 LHS, <1,1,4,5>
- 2689835868U, // <3,1,1,5>: Cost 3 vext3 LHS, <1,1,5,5>
- 3763577701U, // <3,1,1,6>: Cost 4 vext3 LHS, <1,1,6,5>
- 3765273452U, // <3,1,1,7>: Cost 4 vext3 <1,1,7,3>, <1,1,7,3>
- 1611891573U, // <3,1,1,u>: Cost 2 vext3 LHS, <1,1,u,3>
- 2629420494U, // <3,1,2,0>: Cost 3 vext2 <2,0,3,1>, <2,0,3,1>
- 2689835911U, // <3,1,2,1>: Cost 3 vext3 LHS, <1,2,1,3>
- 2564163248U, // <3,1,2,2>: Cost 3 vext1 <2,3,1,2>, <2,3,1,2>
- 1611449238U, // <3,1,2,3>: Cost 2 vext3 LHS, <1,2,3,0>
- 2564164918U, // <3,1,2,4>: Cost 3 vext1 <2,3,1,2>, RHS
- 2689835947U, // <3,1,2,5>: Cost 3 vext3 LHS, <1,2,5,3>
- 3692545978U, // <3,1,2,6>: Cost 4 vext2 <0,2,3,1>, <2,6,3,7>
- 2732966842U, // <3,1,2,7>: Cost 3 vext3 LHS, <1,2,7,0>
- 1611891651U, // <3,1,2,u>: Cost 2 vext3 LHS, <1,2,u,0>
- 1484456038U, // <3,1,3,0>: Cost 2 vext1 <1,3,1,3>, LHS
- 1611891672U, // <3,1,3,1>: Cost 2 vext3 LHS, <1,3,1,3>
- 2685633502U, // <3,1,3,2>: Cost 3 vext3 LHS, <1,3,2,0>
- 2685633512U, // <3,1,3,3>: Cost 3 vext3 LHS, <1,3,3,1>
- 1484459318U, // <3,1,3,4>: Cost 2 vext1 <1,3,1,3>, RHS
- 1611891712U, // <3,1,3,5>: Cost 2 vext3 LHS, <1,3,5,7>
- 2689836041U, // <3,1,3,6>: Cost 3 vext3 LHS, <1,3,6,7>
- 2733409294U, // <3,1,3,7>: Cost 3 vext3 LHS, <1,3,7,3>
- 1611891735U, // <3,1,3,u>: Cost 2 vext3 LHS, <1,3,u,3>
- 2552234086U, // <3,1,4,0>: Cost 3 vext1 <0,3,1,4>, LHS
- 2732966955U, // <3,1,4,1>: Cost 3 vext3 LHS, <1,4,1,5>
- 2732966964U, // <3,1,4,2>: Cost 3 vext3 LHS, <1,4,2,5>
- 2685633597U, // <3,1,4,3>: Cost 3 vext3 LHS, <1,4,3,5>
- 2552237366U, // <3,1,4,4>: Cost 3 vext1 <0,3,1,4>, RHS
- 2618805558U, // <3,1,4,5>: Cost 3 vext2 <0,2,3,1>, RHS
- 2769472822U, // <3,1,4,6>: Cost 3 vuzpl <3,0,1,2>, RHS
- 3667784943U, // <3,1,4,7>: Cost 4 vext1 <7,3,1,4>, <7,3,1,4>
- 2685633642U, // <3,1,4,u>: Cost 3 vext3 LHS, <1,4,u,5>
- 2689836143U, // <3,1,5,0>: Cost 3 vext3 LHS, <1,5,0,1>
- 2564187280U, // <3,1,5,1>: Cost 3 vext1 <2,3,1,5>, <1,5,3,7>
- 2564187827U, // <3,1,5,2>: Cost 3 vext1 <2,3,1,5>, <2,3,1,5>
- 1611891856U, // <3,1,5,3>: Cost 2 vext3 LHS, <1,5,3,7>
- 2689836183U, // <3,1,5,4>: Cost 3 vext3 LHS, <1,5,4,5>
- 3759375522U, // <3,1,5,5>: Cost 4 vext3 LHS, <1,5,5,7>
- 3720417378U, // <3,1,5,6>: Cost 4 vext2 <4,u,3,1>, <5,6,7,0>
- 2832518454U, // <3,1,5,7>: Cost 3 vuzpr <2,3,0,1>, RHS
- 1611891901U, // <3,1,5,u>: Cost 2 vext3 LHS, <1,5,u,7>
- 3763578048U, // <3,1,6,0>: Cost 4 vext3 LHS, <1,6,0,1>
- 2689836239U, // <3,1,6,1>: Cost 3 vext3 LHS, <1,6,1,7>
- 2732967128U, // <3,1,6,2>: Cost 3 vext3 LHS, <1,6,2,7>
- 2685633761U, // <3,1,6,3>: Cost 3 vext3 LHS, <1,6,3,7>
- 3763578088U, // <3,1,6,4>: Cost 4 vext3 LHS, <1,6,4,5>
- 2689836275U, // <3,1,6,5>: Cost 3 vext3 LHS, <1,6,5,7>
- 3763578108U, // <3,1,6,6>: Cost 4 vext3 LHS, <1,6,6,7>
- 2732967166U, // <3,1,6,7>: Cost 3 vext3 LHS, <1,6,7,0>
- 2685633806U, // <3,1,6,u>: Cost 3 vext3 LHS, <1,6,u,7>
- 3631972454U, // <3,1,7,0>: Cost 4 vext1 <1,3,1,7>, LHS
- 2659947612U, // <3,1,7,1>: Cost 3 vext2 <7,1,3,1>, <7,1,3,1>
- 4036102294U, // <3,1,7,2>: Cost 4 vzipr <1,5,3,7>, <3,0,1,2>
- 3095396454U, // <3,1,7,3>: Cost 3 vtrnr <1,3,5,7>, LHS
- 3631975734U, // <3,1,7,4>: Cost 4 vext1 <1,3,1,7>, RHS
- 2222982144U, // <3,1,7,5>: Cost 3 vrev <1,3,5,7>
- 3296797705U, // <3,1,7,6>: Cost 4 vrev <1,3,6,7>
- 3720418924U, // <3,1,7,7>: Cost 4 vext2 <4,u,3,1>, <7,7,7,7>
- 3095396459U, // <3,1,7,u>: Cost 3 vtrnr <1,3,5,7>, LHS
- 1484496998U, // <3,1,u,0>: Cost 2 vext1 <1,3,1,u>, LHS
- 1611892077U, // <3,1,u,1>: Cost 2 vext3 LHS, <1,u,1,3>
- 2685633907U, // <3,1,u,2>: Cost 3 vext3 LHS, <1,u,2,0>
- 1611892092U, // <3,1,u,3>: Cost 2 vext3 LHS, <1,u,3,0>
- 1484500278U, // <3,1,u,4>: Cost 2 vext1 <1,3,1,u>, RHS
- 1611892117U, // <3,1,u,5>: Cost 2 vext3 LHS, <1,u,5,7>
- 2685633950U, // <3,1,u,6>: Cost 3 vext3 LHS, <1,u,6,7>
- 2832518697U, // <3,1,u,7>: Cost 3 vuzpr <2,3,0,1>, RHS
- 1611892140U, // <3,1,u,u>: Cost 2 vext3 LHS, <1,u,u,3>
- 2623455232U, // <3,2,0,0>: Cost 3 vext2 <1,0,3,2>, <0,0,0,0>
- 1549713510U, // <3,2,0,1>: Cost 2 vext2 <1,0,3,2>, LHS
- 2689836484U, // <3,2,0,2>: Cost 3 vext3 LHS, <2,0,2,0>
- 2685633997U, // <3,2,0,3>: Cost 3 vext3 LHS, <2,0,3,0>
- 2623455570U, // <3,2,0,4>: Cost 3 vext2 <1,0,3,2>, <0,4,1,5>
- 2732967398U, // <3,2,0,5>: Cost 3 vext3 LHS, <2,0,5,7>
- 2689836524U, // <3,2,0,6>: Cost 3 vext3 LHS, <2,0,6,4>
- 2229044964U, // <3,2,0,7>: Cost 3 vrev <2,3,7,0>
- 1549714077U, // <3,2,0,u>: Cost 2 vext2 <1,0,3,2>, LHS
- 1549714166U, // <3,2,1,0>: Cost 2 vext2 <1,0,3,2>, <1,0,3,2>
- 2623456052U, // <3,2,1,1>: Cost 3 vext2 <1,0,3,2>, <1,1,1,1>
- 2623456150U, // <3,2,1,2>: Cost 3 vext2 <1,0,3,2>, <1,2,3,0>
- 2685634079U, // <3,2,1,3>: Cost 3 vext3 LHS, <2,1,3,1>
- 2552286518U, // <3,2,1,4>: Cost 3 vext1 <0,3,2,1>, RHS
- 2623456400U, // <3,2,1,5>: Cost 3 vext2 <1,0,3,2>, <1,5,3,7>
- 2689836604U, // <3,2,1,6>: Cost 3 vext3 LHS, <2,1,6,3>
- 3667834101U, // <3,2,1,7>: Cost 4 vext1 <7,3,2,1>, <7,3,2,1>
- 1155385070U, // <3,2,1,u>: Cost 2 vrev <2,3,u,1>
- 2689836629U, // <3,2,2,0>: Cost 3 vext3 LHS, <2,2,0,1>
- 2689836640U, // <3,2,2,1>: Cost 3 vext3 LHS, <2,2,1,3>
- 1611449960U, // <3,2,2,2>: Cost 2 vext3 LHS, <2,2,2,2>
- 1611892338U, // <3,2,2,3>: Cost 2 vext3 LHS, <2,2,3,3>
- 2689836669U, // <3,2,2,4>: Cost 3 vext3 LHS, <2,2,4,5>
- 2689836680U, // <3,2,2,5>: Cost 3 vext3 LHS, <2,2,5,7>
- 2689836688U, // <3,2,2,6>: Cost 3 vext3 LHS, <2,2,6,6>
- 3763578518U, // <3,2,2,7>: Cost 4 vext3 LHS, <2,2,7,3>
- 1611892383U, // <3,2,2,u>: Cost 2 vext3 LHS, <2,2,u,3>
- 1611450022U, // <3,2,3,0>: Cost 2 vext3 LHS, <2,3,0,1>
- 2685191854U, // <3,2,3,1>: Cost 3 vext3 LHS, <2,3,1,0>
- 2685191865U, // <3,2,3,2>: Cost 3 vext3 LHS, <2,3,2,2>
- 2685191875U, // <3,2,3,3>: Cost 3 vext3 LHS, <2,3,3,3>
- 1611450062U, // <3,2,3,4>: Cost 2 vext3 LHS, <2,3,4,5>
- 2732967635U, // <3,2,3,5>: Cost 3 vext3 LHS, <2,3,5,1>
- 2732967645U, // <3,2,3,6>: Cost 3 vext3 LHS, <2,3,6,2>
- 2732967652U, // <3,2,3,7>: Cost 3 vext3 LHS, <2,3,7,0>
- 1611450094U, // <3,2,3,u>: Cost 2 vext3 LHS, <2,3,u,1>
- 2558279782U, // <3,2,4,0>: Cost 3 vext1 <1,3,2,4>, LHS
- 2558280602U, // <3,2,4,1>: Cost 3 vext1 <1,3,2,4>, <1,2,3,4>
- 2732967692U, // <3,2,4,2>: Cost 3 vext3 LHS, <2,4,2,4>
- 2685634326U, // <3,2,4,3>: Cost 3 vext3 LHS, <2,4,3,5>
- 2558283062U, // <3,2,4,4>: Cost 3 vext1 <1,3,2,4>, RHS
- 1549716790U, // <3,2,4,5>: Cost 2 vext2 <1,0,3,2>, RHS
- 2689836844U, // <3,2,4,6>: Cost 3 vext3 LHS, <2,4,6,0>
- 2229077736U, // <3,2,4,7>: Cost 3 vrev <2,3,7,4>
- 1549717033U, // <3,2,4,u>: Cost 2 vext2 <1,0,3,2>, RHS
- 2552316006U, // <3,2,5,0>: Cost 3 vext1 <0,3,2,5>, LHS
- 2228643507U, // <3,2,5,1>: Cost 3 vrev <2,3,1,5>
- 2689836896U, // <3,2,5,2>: Cost 3 vext3 LHS, <2,5,2,7>
- 2685634408U, // <3,2,5,3>: Cost 3 vext3 LHS, <2,5,3,6>
- 1155122894U, // <3,2,5,4>: Cost 2 vrev <2,3,4,5>
- 2665263108U, // <3,2,5,5>: Cost 3 vext2 <u,0,3,2>, <5,5,5,5>
- 2689836932U, // <3,2,5,6>: Cost 3 vext3 LHS, <2,5,6,7>
- 2665263272U, // <3,2,5,7>: Cost 3 vext2 <u,0,3,2>, <5,7,5,7>
- 1155417842U, // <3,2,5,u>: Cost 2 vrev <2,3,u,5>
- 2689836953U, // <3,2,6,0>: Cost 3 vext3 LHS, <2,6,0,1>
- 2689836964U, // <3,2,6,1>: Cost 3 vext3 LHS, <2,6,1,3>
- 2689836976U, // <3,2,6,2>: Cost 3 vext3 LHS, <2,6,2,6>
- 1611892666U, // <3,2,6,3>: Cost 2 vext3 LHS, <2,6,3,7>
- 2689836993U, // <3,2,6,4>: Cost 3 vext3 LHS, <2,6,4,5>
- 2689837004U, // <3,2,6,5>: Cost 3 vext3 LHS, <2,6,5,7>
- 2689837013U, // <3,2,6,6>: Cost 3 vext3 LHS, <2,6,6,7>
- 2665263950U, // <3,2,6,7>: Cost 3 vext2 <u,0,3,2>, <6,7,0,1>
- 1611892711U, // <3,2,6,u>: Cost 2 vext3 LHS, <2,6,u,7>
- 2665264122U, // <3,2,7,0>: Cost 3 vext2 <u,0,3,2>, <7,0,1,2>
- 2623460419U, // <3,2,7,1>: Cost 3 vext2 <1,0,3,2>, <7,1,0,3>
- 4169138340U, // <3,2,7,2>: Cost 4 vtrnr <1,3,5,7>, <0,2,0,2>
- 2962358374U, // <3,2,7,3>: Cost 3 vzipr <1,5,3,7>, LHS
- 2665264486U, // <3,2,7,4>: Cost 3 vext2 <u,0,3,2>, <7,4,5,6>
- 2228954841U, // <3,2,7,5>: Cost 3 vrev <2,3,5,7>
- 2229028578U, // <3,2,7,6>: Cost 3 vrev <2,3,6,7>
- 2665264748U, // <3,2,7,7>: Cost 3 vext2 <u,0,3,2>, <7,7,7,7>
- 2962358379U, // <3,2,7,u>: Cost 3 vzipr <1,5,3,7>, LHS
- 1611892795U, // <3,2,u,0>: Cost 2 vext3 LHS, <2,u,0,1>
- 1549719342U, // <3,2,u,1>: Cost 2 vext2 <1,0,3,2>, LHS
- 1611449960U, // <3,2,u,2>: Cost 2 vext3 LHS, <2,2,2,2>
- 1611892824U, // <3,2,u,3>: Cost 2 vext3 LHS, <2,u,3,3>
- 1611892835U, // <3,2,u,4>: Cost 2 vext3 LHS, <2,u,4,5>
- 1549719706U, // <3,2,u,5>: Cost 2 vext2 <1,0,3,2>, RHS
- 2689837168U, // <3,2,u,6>: Cost 3 vext3 LHS, <2,u,6,0>
- 2665265408U, // <3,2,u,7>: Cost 3 vext2 <u,0,3,2>, <u,7,0,1>
- 1611892867U, // <3,2,u,u>: Cost 2 vext3 LHS, <2,u,u,1>
- 2685192331U, // <3,3,0,0>: Cost 3 vext3 LHS, <3,0,0,0>
- 1611450518U, // <3,3,0,1>: Cost 2 vext3 LHS, <3,0,1,2>
- 2685634717U, // <3,3,0,2>: Cost 3 vext3 LHS, <3,0,2,0>
- 2564294806U, // <3,3,0,3>: Cost 3 vext1 <2,3,3,0>, <3,0,1,2>
- 2685634736U, // <3,3,0,4>: Cost 3 vext3 LHS, <3,0,4,1>
- 2732968122U, // <3,3,0,5>: Cost 3 vext3 LHS, <3,0,5,2>
- 3763579075U, // <3,3,0,6>: Cost 4 vext3 LHS, <3,0,6,2>
- 4034053264U, // <3,3,0,7>: Cost 4 vzipr <1,2,3,0>, <1,5,3,7>
- 1611450581U, // <3,3,0,u>: Cost 2 vext3 LHS, <3,0,u,2>
- 2685192415U, // <3,3,1,0>: Cost 3 vext3 LHS, <3,1,0,3>
- 1550385992U, // <3,3,1,1>: Cost 2 vext2 <1,1,3,3>, <1,1,3,3>
- 2685192433U, // <3,3,1,2>: Cost 3 vext3 LHS, <3,1,2,3>
- 2685634808U, // <3,3,1,3>: Cost 3 vext3 LHS, <3,1,3,1>
- 2558332214U, // <3,3,1,4>: Cost 3 vext1 <1,3,3,1>, RHS
- 2685634828U, // <3,3,1,5>: Cost 3 vext3 LHS, <3,1,5,3>
- 3759376661U, // <3,3,1,6>: Cost 4 vext3 LHS, <3,1,6,3>
- 2703477022U, // <3,3,1,7>: Cost 3 vext3 <3,1,7,3>, <3,1,7,3>
- 1555031423U, // <3,3,1,u>: Cost 2 vext2 <1,u,3,3>, <1,u,3,3>
- 2564309094U, // <3,3,2,0>: Cost 3 vext1 <2,3,3,2>, LHS
- 2630100513U, // <3,3,2,1>: Cost 3 vext2 <2,1,3,3>, <2,1,3,3>
- 1557022322U, // <3,3,2,2>: Cost 2 vext2 <2,2,3,3>, <2,2,3,3>
- 2685192520U, // <3,3,2,3>: Cost 3 vext3 LHS, <3,2,3,0>
- 2564312374U, // <3,3,2,4>: Cost 3 vext1 <2,3,3,2>, RHS
- 2732968286U, // <3,3,2,5>: Cost 3 vext3 LHS, <3,2,5,4>
- 2685634918U, // <3,3,2,6>: Cost 3 vext3 LHS, <3,2,6,3>
- 2704140655U, // <3,3,2,7>: Cost 3 vext3 <3,2,7,3>, <3,2,7,3>
- 1561004120U, // <3,3,2,u>: Cost 2 vext2 <2,u,3,3>, <2,u,3,3>
- 1496547430U, // <3,3,3,0>: Cost 2 vext1 <3,3,3,3>, LHS
- 2624129256U, // <3,3,3,1>: Cost 3 vext2 <1,1,3,3>, <3,1,1,3>
- 2630764866U, // <3,3,3,2>: Cost 3 vext2 <2,2,3,3>, <3,2,2,3>
- 336380006U, // <3,3,3,3>: Cost 1 vdup3 LHS
- 1496550710U, // <3,3,3,4>: Cost 2 vext1 <3,3,3,3>, RHS
- 2732968368U, // <3,3,3,5>: Cost 3 vext3 LHS, <3,3,5,5>
- 2624129683U, // <3,3,3,6>: Cost 3 vext2 <1,1,3,3>, <3,6,3,7>
- 2594182400U, // <3,3,3,7>: Cost 3 vext1 <7,3,3,3>, <7,3,3,3>
- 336380006U, // <3,3,3,u>: Cost 1 vdup3 LHS
- 2558353510U, // <3,3,4,0>: Cost 3 vext1 <1,3,3,4>, LHS
- 2558354411U, // <3,3,4,1>: Cost 3 vext1 <1,3,3,4>, <1,3,3,4>
- 2564327108U, // <3,3,4,2>: Cost 3 vext1 <2,3,3,4>, <2,3,3,4>
- 2564327938U, // <3,3,4,3>: Cost 3 vext1 <2,3,3,4>, <3,4,5,6>
- 2960343962U, // <3,3,4,4>: Cost 3 vzipr <1,2,3,4>, <1,2,3,4>
- 1611893250U, // <3,3,4,5>: Cost 2 vext3 LHS, <3,4,5,6>
- 2771619126U, // <3,3,4,6>: Cost 3 vuzpl <3,3,3,3>, RHS
- 4034086032U, // <3,3,4,7>: Cost 4 vzipr <1,2,3,4>, <1,5,3,7>
- 1611893277U, // <3,3,4,u>: Cost 2 vext3 LHS, <3,4,u,6>
- 2558361702U, // <3,3,5,0>: Cost 3 vext1 <1,3,3,5>, LHS
- 2558362604U, // <3,3,5,1>: Cost 3 vext1 <1,3,3,5>, <1,3,3,5>
- 2558363342U, // <3,3,5,2>: Cost 3 vext1 <1,3,3,5>, <2,3,4,5>
- 2732968512U, // <3,3,5,3>: Cost 3 vext3 LHS, <3,5,3,5>
- 2558364982U, // <3,3,5,4>: Cost 3 vext1 <1,3,3,5>, RHS
- 3101279950U, // <3,3,5,5>: Cost 3 vtrnr <2,3,4,5>, <2,3,4,5>
- 2665934946U, // <3,3,5,6>: Cost 3 vext2 <u,1,3,3>, <5,6,7,0>
- 2826636598U, // <3,3,5,7>: Cost 3 vuzpr <1,3,1,3>, RHS
- 2826636599U, // <3,3,5,u>: Cost 3 vuzpr <1,3,1,3>, RHS
- 2732968568U, // <3,3,6,0>: Cost 3 vext3 LHS, <3,6,0,7>
- 3763579521U, // <3,3,6,1>: Cost 4 vext3 LHS, <3,6,1,7>
- 2732968586U, // <3,3,6,2>: Cost 3 vext3 LHS, <3,6,2,7>
- 2732968595U, // <3,3,6,3>: Cost 3 vext3 LHS, <3,6,3,7>
- 2732968604U, // <3,3,6,4>: Cost 3 vext3 LHS, <3,6,4,7>
- 3763579557U, // <3,3,6,5>: Cost 4 vext3 LHS, <3,6,5,7>
- 2732968621U, // <3,3,6,6>: Cost 3 vext3 LHS, <3,6,6,6>
- 2657973099U, // <3,3,6,7>: Cost 3 vext2 <6,7,3,3>, <6,7,3,3>
- 2658636732U, // <3,3,6,u>: Cost 3 vext2 <6,u,3,3>, <6,u,3,3>
- 2558378086U, // <3,3,7,0>: Cost 3 vext1 <1,3,3,7>, LHS
- 2558378990U, // <3,3,7,1>: Cost 3 vext1 <1,3,3,7>, <1,3,3,7>
- 2564351687U, // <3,3,7,2>: Cost 3 vext1 <2,3,3,7>, <2,3,3,7>
- 2661291264U, // <3,3,7,3>: Cost 3 vext2 <7,3,3,3>, <7,3,3,3>
- 2558381366U, // <3,3,7,4>: Cost 3 vext1 <1,3,3,7>, RHS
- 2732968694U, // <3,3,7,5>: Cost 3 vext3 LHS, <3,7,5,7>
- 3781126907U, // <3,3,7,6>: Cost 4 vext3 <3,7,6,3>, <3,7,6,3>
- 3095397376U, // <3,3,7,7>: Cost 3 vtrnr <1,3,5,7>, <1,3,5,7>
- 2558383918U, // <3,3,7,u>: Cost 3 vext1 <1,3,3,7>, LHS
- 1496547430U, // <3,3,u,0>: Cost 2 vext1 <3,3,3,3>, LHS
- 1611893534U, // <3,3,u,1>: Cost 2 vext3 LHS, <3,u,1,2>
- 1592858504U, // <3,3,u,2>: Cost 2 vext2 <u,2,3,3>, <u,2,3,3>
- 336380006U, // <3,3,u,3>: Cost 1 vdup3 LHS
- 1496550710U, // <3,3,u,4>: Cost 2 vext1 <3,3,3,3>, RHS
- 1611893574U, // <3,3,u,5>: Cost 2 vext3 LHS, <3,u,5,6>
- 2690280268U, // <3,3,u,6>: Cost 3 vext3 LHS, <3,u,6,3>
- 2826636841U, // <3,3,u,7>: Cost 3 vuzpr <1,3,1,3>, RHS
- 336380006U, // <3,3,u,u>: Cost 1 vdup3 LHS
- 2624798720U, // <3,4,0,0>: Cost 3 vext2 <1,2,3,4>, <0,0,0,0>
- 1551056998U, // <3,4,0,1>: Cost 2 vext2 <1,2,3,4>, LHS
- 2624798884U, // <3,4,0,2>: Cost 3 vext2 <1,2,3,4>, <0,2,0,2>
- 3693232384U, // <3,4,0,3>: Cost 4 vext2 <0,3,3,4>, <0,3,1,4>
- 2624799058U, // <3,4,0,4>: Cost 3 vext2 <1,2,3,4>, <0,4,1,5>
- 1659227026U, // <3,4,0,5>: Cost 2 vext3 LHS, <4,0,5,1>
- 1659227036U, // <3,4,0,6>: Cost 2 vext3 LHS, <4,0,6,2>
- 3667973382U, // <3,4,0,7>: Cost 4 vext1 <7,3,4,0>, <7,3,4,0>
- 1551057565U, // <3,4,0,u>: Cost 2 vext2 <1,2,3,4>, LHS
- 2624799478U, // <3,4,1,0>: Cost 3 vext2 <1,2,3,4>, <1,0,3,2>
- 2624799540U, // <3,4,1,1>: Cost 3 vext2 <1,2,3,4>, <1,1,1,1>
- 1551057818U, // <3,4,1,2>: Cost 2 vext2 <1,2,3,4>, <1,2,3,4>
- 2624799704U, // <3,4,1,3>: Cost 3 vext2 <1,2,3,4>, <1,3,1,3>
- 2564377910U, // <3,4,1,4>: Cost 3 vext1 <2,3,4,1>, RHS
- 2689838050U, // <3,4,1,5>: Cost 3 vext3 LHS, <4,1,5,0>
- 2689838062U, // <3,4,1,6>: Cost 3 vext3 LHS, <4,1,6,3>
- 2628117807U, // <3,4,1,7>: Cost 3 vext2 <1,7,3,4>, <1,7,3,4>
- 1555039616U, // <3,4,1,u>: Cost 2 vext2 <1,u,3,4>, <1,u,3,4>
- 3626180710U, // <3,4,2,0>: Cost 4 vext1 <0,3,4,2>, LHS
- 2624800298U, // <3,4,2,1>: Cost 3 vext2 <1,2,3,4>, <2,1,4,3>
- 2624800360U, // <3,4,2,2>: Cost 3 vext2 <1,2,3,4>, <2,2,2,2>
- 2624800422U, // <3,4,2,3>: Cost 3 vext2 <1,2,3,4>, <2,3,0,1>
- 2624800514U, // <3,4,2,4>: Cost 3 vext2 <1,2,3,4>, <2,4,1,3>
- 2709965878U, // <3,4,2,5>: Cost 3 vext3 <4,2,5,3>, <4,2,5,3>
- 2689838140U, // <3,4,2,6>: Cost 3 vext3 LHS, <4,2,6,0>
- 2634090504U, // <3,4,2,7>: Cost 3 vext2 <2,7,3,4>, <2,7,3,4>
- 2689838158U, // <3,4,2,u>: Cost 3 vext3 LHS, <4,2,u,0>
- 2624800918U, // <3,4,3,0>: Cost 3 vext2 <1,2,3,4>, <3,0,1,2>
- 2636081403U, // <3,4,3,1>: Cost 3 vext2 <3,1,3,4>, <3,1,3,4>
- 2636745036U, // <3,4,3,2>: Cost 3 vext2 <3,2,3,4>, <3,2,3,4>
- 2624801180U, // <3,4,3,3>: Cost 3 vext2 <1,2,3,4>, <3,3,3,3>
- 2624801232U, // <3,4,3,4>: Cost 3 vext2 <1,2,3,4>, <3,4,0,1>
- 2905836854U, // <3,4,3,5>: Cost 3 vzipl <3,3,3,3>, RHS
- 3040054582U, // <3,4,3,6>: Cost 3 vtrnl <3,3,3,3>, RHS
- 3702524611U, // <3,4,3,7>: Cost 4 vext2 <1,u,3,4>, <3,7,0,1>
- 2624801566U, // <3,4,3,u>: Cost 3 vext2 <1,2,3,4>, <3,u,1,2>
- 2564399206U, // <3,4,4,0>: Cost 3 vext1 <2,3,4,4>, LHS
- 2564400026U, // <3,4,4,1>: Cost 3 vext1 <2,3,4,4>, <1,2,3,4>
- 2564400845U, // <3,4,4,2>: Cost 3 vext1 <2,3,4,4>, <2,3,4,4>
- 2570373542U, // <3,4,4,3>: Cost 3 vext1 <3,3,4,4>, <3,3,4,4>
- 1659227344U, // <3,4,4,4>: Cost 2 vext3 LHS, <4,4,4,4>
- 1551060278U, // <3,4,4,5>: Cost 2 vext2 <1,2,3,4>, RHS
- 1659227364U, // <3,4,4,6>: Cost 2 vext3 LHS, <4,4,6,6>
- 3668006154U, // <3,4,4,7>: Cost 4 vext1 <7,3,4,4>, <7,3,4,4>
- 1551060521U, // <3,4,4,u>: Cost 2 vext2 <1,2,3,4>, RHS
- 1490665574U, // <3,4,5,0>: Cost 2 vext1 <2,3,4,5>, LHS
- 2689838341U, // <3,4,5,1>: Cost 3 vext3 LHS, <4,5,1,3>
- 1490667214U, // <3,4,5,2>: Cost 2 vext1 <2,3,4,5>, <2,3,4,5>
- 2564409494U, // <3,4,5,3>: Cost 3 vext1 <2,3,4,5>, <3,0,1,2>
- 1490668854U, // <3,4,5,4>: Cost 2 vext1 <2,3,4,5>, RHS
- 2689838381U, // <3,4,5,5>: Cost 3 vext3 LHS, <4,5,5,7>
- 537709878U, // <3,4,5,6>: Cost 1 vext3 LHS, RHS
- 2594272523U, // <3,4,5,7>: Cost 3 vext1 <7,3,4,5>, <7,3,4,5>
- 537709896U, // <3,4,5,u>: Cost 1 vext3 LHS, RHS
- 2689838411U, // <3,4,6,0>: Cost 3 vext3 LHS, <4,6,0,1>
- 2558444534U, // <3,4,6,1>: Cost 3 vext1 <1,3,4,6>, <1,3,4,6>
- 2666607098U, // <3,4,6,2>: Cost 3 vext2 <u,2,3,4>, <6,2,7,3>
- 2558446082U, // <3,4,6,3>: Cost 3 vext1 <1,3,4,6>, <3,4,5,6>
- 1659227508U, // <3,4,6,4>: Cost 2 vext3 LHS, <4,6,4,6>
- 2689838462U, // <3,4,6,5>: Cost 3 vext3 LHS, <4,6,5,7>
- 2689838471U, // <3,4,6,6>: Cost 3 vext3 LHS, <4,6,6,7>
- 2657981292U, // <3,4,6,7>: Cost 3 vext2 <6,7,3,4>, <6,7,3,4>
- 1659227540U, // <3,4,6,u>: Cost 2 vext3 LHS, <4,6,u,2>
- 2666607610U, // <3,4,7,0>: Cost 3 vext2 <u,2,3,4>, <7,0,1,2>
- 3702527072U, // <3,4,7,1>: Cost 4 vext2 <1,u,3,4>, <7,1,3,5>
- 2660635824U, // <3,4,7,2>: Cost 3 vext2 <7,2,3,4>, <7,2,3,4>
- 3644139945U, // <3,4,7,3>: Cost 4 vext1 <3,3,4,7>, <3,3,4,7>
- 2666607974U, // <3,4,7,4>: Cost 3 vext2 <u,2,3,4>, <7,4,5,6>
- 2732969416U, // <3,4,7,5>: Cost 3 vext3 LHS, <4,7,5,0>
- 2732969425U, // <3,4,7,6>: Cost 3 vext3 LHS, <4,7,6,0>
- 2666608236U, // <3,4,7,7>: Cost 3 vext2 <u,2,3,4>, <7,7,7,7>
- 2664617622U, // <3,4,7,u>: Cost 3 vext2 <7,u,3,4>, <7,u,3,4>
- 1490690150U, // <3,4,u,0>: Cost 2 vext1 <2,3,4,u>, LHS
- 1551062830U, // <3,4,u,1>: Cost 2 vext2 <1,2,3,4>, LHS
- 1490691793U, // <3,4,u,2>: Cost 2 vext1 <2,3,4,u>, <2,3,4,u>
- 2624804796U, // <3,4,u,3>: Cost 3 vext2 <1,2,3,4>, <u,3,0,1>
- 1490693430U, // <3,4,u,4>: Cost 2 vext1 <2,3,4,u>, RHS
- 1551063194U, // <3,4,u,5>: Cost 2 vext2 <1,2,3,4>, RHS
- 537710121U, // <3,4,u,6>: Cost 1 vext3 LHS, RHS
- 2594297102U, // <3,4,u,7>: Cost 3 vext1 <7,3,4,u>, <7,3,4,u>
- 537710139U, // <3,4,u,u>: Cost 1 vext3 LHS, RHS
- 3692576768U, // <3,5,0,0>: Cost 4 vext2 <0,2,3,5>, <0,0,0,0>
- 2618835046U, // <3,5,0,1>: Cost 3 vext2 <0,2,3,5>, LHS
- 2618835138U, // <3,5,0,2>: Cost 3 vext2 <0,2,3,5>, <0,2,3,5>
- 3692577024U, // <3,5,0,3>: Cost 4 vext2 <0,2,3,5>, <0,3,1,4>
- 2689838690U, // <3,5,0,4>: Cost 3 vext3 LHS, <5,0,4,1>
- 2732969579U, // <3,5,0,5>: Cost 3 vext3 LHS, <5,0,5,1>
- 2732969588U, // <3,5,0,6>: Cost 3 vext3 LHS, <5,0,6,1>
- 2246963055U, // <3,5,0,7>: Cost 3 vrev <5,3,7,0>
- 2618835613U, // <3,5,0,u>: Cost 3 vext2 <0,2,3,5>, LHS
- 2594308198U, // <3,5,1,0>: Cost 3 vext1 <7,3,5,1>, LHS
- 3692577588U, // <3,5,1,1>: Cost 4 vext2 <0,2,3,5>, <1,1,1,1>
- 2624807835U, // <3,5,1,2>: Cost 3 vext2 <1,2,3,5>, <1,2,3,5>
- 2625471468U, // <3,5,1,3>: Cost 3 vext2 <1,3,3,5>, <1,3,3,5>
- 2626135101U, // <3,5,1,4>: Cost 3 vext2 <1,4,3,5>, <1,4,3,5>
- 2594311888U, // <3,5,1,5>: Cost 3 vext1 <7,3,5,1>, <5,1,7,3>
- 3699877107U, // <3,5,1,6>: Cost 4 vext2 <1,4,3,5>, <1,6,5,7>
- 1641680592U, // <3,5,1,7>: Cost 2 vext3 <5,1,7,3>, <5,1,7,3>
- 1641754329U, // <3,5,1,u>: Cost 2 vext3 <5,1,u,3>, <5,1,u,3>
- 3692578274U, // <3,5,2,0>: Cost 4 vext2 <0,2,3,5>, <2,0,5,3>
- 2630116899U, // <3,5,2,1>: Cost 3 vext2 <2,1,3,5>, <2,1,3,5>
- 3692578408U, // <3,5,2,2>: Cost 4 vext2 <0,2,3,5>, <2,2,2,2>
- 2625472206U, // <3,5,2,3>: Cost 3 vext2 <1,3,3,5>, <2,3,4,5>
- 2632107798U, // <3,5,2,4>: Cost 3 vext2 <2,4,3,5>, <2,4,3,5>
- 2715938575U, // <3,5,2,5>: Cost 3 vext3 <5,2,5,3>, <5,2,5,3>
- 3692578746U, // <3,5,2,6>: Cost 4 vext2 <0,2,3,5>, <2,6,3,7>
- 2716086049U, // <3,5,2,7>: Cost 3 vext3 <5,2,7,3>, <5,2,7,3>
- 2634762330U, // <3,5,2,u>: Cost 3 vext2 <2,u,3,5>, <2,u,3,5>
- 3692578966U, // <3,5,3,0>: Cost 4 vext2 <0,2,3,5>, <3,0,1,2>
- 2636089596U, // <3,5,3,1>: Cost 3 vext2 <3,1,3,5>, <3,1,3,5>
- 3699214668U, // <3,5,3,2>: Cost 4 vext2 <1,3,3,5>, <3,2,3,4>
- 2638080412U, // <3,5,3,3>: Cost 3 vext2 <3,4,3,5>, <3,3,3,3>
- 2618837506U, // <3,5,3,4>: Cost 3 vext2 <0,2,3,5>, <3,4,5,6>
- 2832844494U, // <3,5,3,5>: Cost 3 vuzpr <2,3,4,5>, <2,3,4,5>
- 4033415682U, // <3,5,3,6>: Cost 4 vzipr <1,1,3,3>, <3,4,5,6>
- 3095072054U, // <3,5,3,7>: Cost 3 vtrnr <1,3,1,3>, RHS
- 3095072055U, // <3,5,3,u>: Cost 3 vtrnr <1,3,1,3>, RHS
- 2600304742U, // <3,5,4,0>: Cost 3 vext1 <u,3,5,4>, LHS
- 3763580815U, // <3,5,4,1>: Cost 4 vext3 LHS, <5,4,1,5>
- 2564474582U, // <3,5,4,2>: Cost 3 vext1 <2,3,5,4>, <2,3,5,4>
- 3699879044U, // <3,5,4,3>: Cost 4 vext2 <1,4,3,5>, <4,3,5,0>
- 2600308022U, // <3,5,4,4>: Cost 3 vext1 <u,3,5,4>, RHS
- 2618838326U, // <3,5,4,5>: Cost 3 vext2 <0,2,3,5>, RHS
- 2772454710U, // <3,5,4,6>: Cost 3 vuzpl <3,4,5,6>, RHS
- 1659228102U, // <3,5,4,7>: Cost 2 vext3 LHS, <5,4,7,6>
- 1659228111U, // <3,5,4,u>: Cost 2 vext3 LHS, <5,4,u,6>
- 2570453094U, // <3,5,5,0>: Cost 3 vext1 <3,3,5,5>, LHS
- 2624810704U, // <3,5,5,1>: Cost 3 vext2 <1,2,3,5>, <5,1,7,3>
- 2570454734U, // <3,5,5,2>: Cost 3 vext1 <3,3,5,5>, <2,3,4,5>
- 2570455472U, // <3,5,5,3>: Cost 3 vext1 <3,3,5,5>, <3,3,5,5>
- 2570456374U, // <3,5,5,4>: Cost 3 vext1 <3,3,5,5>, RHS
- 1659228164U, // <3,5,5,5>: Cost 2 vext3 LHS, <5,5,5,5>
- 2732969998U, // <3,5,5,6>: Cost 3 vext3 LHS, <5,5,6,6>
- 1659228184U, // <3,5,5,7>: Cost 2 vext3 LHS, <5,5,7,7>
- 1659228193U, // <3,5,5,u>: Cost 2 vext3 LHS, <5,5,u,7>
- 2732970020U, // <3,5,6,0>: Cost 3 vext3 LHS, <5,6,0,1>
- 2732970035U, // <3,5,6,1>: Cost 3 vext3 LHS, <5,6,1,7>
- 2564490968U, // <3,5,6,2>: Cost 3 vext1 <2,3,5,6>, <2,3,5,6>
- 2732970050U, // <3,5,6,3>: Cost 3 vext3 LHS, <5,6,3,4>
- 2732970060U, // <3,5,6,4>: Cost 3 vext3 LHS, <5,6,4,5>
- 2732970071U, // <3,5,6,5>: Cost 3 vext3 LHS, <5,6,5,7>
- 2732970080U, // <3,5,6,6>: Cost 3 vext3 LHS, <5,6,6,7>
- 1659228258U, // <3,5,6,7>: Cost 2 vext3 LHS, <5,6,7,0>
- 1659228267U, // <3,5,6,u>: Cost 2 vext3 LHS, <5,6,u,0>
- 1484783718U, // <3,5,7,0>: Cost 2 vext1 <1,3,5,7>, LHS
- 1484784640U, // <3,5,7,1>: Cost 2 vext1 <1,3,5,7>, <1,3,5,7>
- 2558527080U, // <3,5,7,2>: Cost 3 vext1 <1,3,5,7>, <2,2,2,2>
- 2558527638U, // <3,5,7,3>: Cost 3 vext1 <1,3,5,7>, <3,0,1,2>
- 1484786998U, // <3,5,7,4>: Cost 2 vext1 <1,3,5,7>, RHS
- 1659228328U, // <3,5,7,5>: Cost 2 vext3 LHS, <5,7,5,7>
- 2732970154U, // <3,5,7,6>: Cost 3 vext3 LHS, <5,7,6,0>
- 2558531180U, // <3,5,7,7>: Cost 3 vext1 <1,3,5,7>, <7,7,7,7>
- 1484789550U, // <3,5,7,u>: Cost 2 vext1 <1,3,5,7>, LHS
- 1484791910U, // <3,5,u,0>: Cost 2 vext1 <1,3,5,u>, LHS
- 1484792833U, // <3,5,u,1>: Cost 2 vext1 <1,3,5,u>, <1,3,5,u>
- 2558535272U, // <3,5,u,2>: Cost 3 vext1 <1,3,5,u>, <2,2,2,2>
- 2558535830U, // <3,5,u,3>: Cost 3 vext1 <1,3,5,u>, <3,0,1,2>
- 1484795190U, // <3,5,u,4>: Cost 2 vext1 <1,3,5,u>, RHS
- 1659228409U, // <3,5,u,5>: Cost 2 vext3 LHS, <5,u,5,7>
- 2772457626U, // <3,5,u,6>: Cost 3 vuzpl <3,4,5,6>, RHS
- 1646326023U, // <3,5,u,7>: Cost 2 vext3 <5,u,7,3>, <5,u,7,3>
- 1484797742U, // <3,5,u,u>: Cost 2 vext1 <1,3,5,u>, LHS
- 2558541926U, // <3,6,0,0>: Cost 3 vext1 <1,3,6,0>, LHS
- 2689839393U, // <3,6,0,1>: Cost 3 vext3 LHS, <6,0,1,2>
- 2689839404U, // <3,6,0,2>: Cost 3 vext3 LHS, <6,0,2,4>
- 3706519808U, // <3,6,0,3>: Cost 4 vext2 <2,5,3,6>, <0,3,1,4>
- 2689839420U, // <3,6,0,4>: Cost 3 vext3 LHS, <6,0,4,2>
- 2732970314U, // <3,6,0,5>: Cost 3 vext3 LHS, <6,0,5,7>
- 2732970316U, // <3,6,0,6>: Cost 3 vext3 LHS, <6,0,6,0>
- 2960313654U, // <3,6,0,7>: Cost 3 vzipr <1,2,3,0>, RHS
- 2689839456U, // <3,6,0,u>: Cost 3 vext3 LHS, <6,0,u,2>
- 3763581290U, // <3,6,1,0>: Cost 4 vext3 LHS, <6,1,0,3>
- 3763581297U, // <3,6,1,1>: Cost 4 vext3 LHS, <6,1,1,1>
- 2624816028U, // <3,6,1,2>: Cost 3 vext2 <1,2,3,6>, <1,2,3,6>
- 3763581315U, // <3,6,1,3>: Cost 4 vext3 LHS, <6,1,3,1>
- 2626143294U, // <3,6,1,4>: Cost 3 vext2 <1,4,3,6>, <1,4,3,6>
- 3763581335U, // <3,6,1,5>: Cost 4 vext3 LHS, <6,1,5,3>
- 2721321376U, // <3,6,1,6>: Cost 3 vext3 <6,1,6,3>, <6,1,6,3>
- 2721395113U, // <3,6,1,7>: Cost 3 vext3 <6,1,7,3>, <6,1,7,3>
- 2628797826U, // <3,6,1,u>: Cost 3 vext2 <1,u,3,6>, <1,u,3,6>
- 2594390118U, // <3,6,2,0>: Cost 3 vext1 <7,3,6,2>, LHS
- 2721616324U, // <3,6,2,1>: Cost 3 vext3 <6,2,1,3>, <6,2,1,3>
- 2630788725U, // <3,6,2,2>: Cost 3 vext2 <2,2,3,6>, <2,2,3,6>
- 3763581395U, // <3,6,2,3>: Cost 4 vext3 LHS, <6,2,3,0>
- 2632115991U, // <3,6,2,4>: Cost 3 vext2 <2,4,3,6>, <2,4,3,6>
- 2632779624U, // <3,6,2,5>: Cost 3 vext2 <2,5,3,6>, <2,5,3,6>
- 2594394618U, // <3,6,2,6>: Cost 3 vext1 <7,3,6,2>, <6,2,7,3>
- 1648316922U, // <3,6,2,7>: Cost 2 vext3 <6,2,7,3>, <6,2,7,3>
- 1648390659U, // <3,6,2,u>: Cost 2 vext3 <6,2,u,3>, <6,2,u,3>
- 3693914262U, // <3,6,3,0>: Cost 4 vext2 <0,4,3,6>, <3,0,1,2>
- 3638281176U, // <3,6,3,1>: Cost 4 vext1 <2,3,6,3>, <1,3,1,3>
- 3696568678U, // <3,6,3,2>: Cost 4 vext2 <0,u,3,6>, <3,2,6,3>
- 2638088604U, // <3,6,3,3>: Cost 3 vext2 <3,4,3,6>, <3,3,3,3>
- 2632780290U, // <3,6,3,4>: Cost 3 vext2 <2,5,3,6>, <3,4,5,6>
- 3712494145U, // <3,6,3,5>: Cost 4 vext2 <3,5,3,6>, <3,5,3,6>
- 3698559612U, // <3,6,3,6>: Cost 4 vext2 <1,2,3,6>, <3,6,1,2>
- 2959674678U, // <3,6,3,7>: Cost 3 vzipr <1,1,3,3>, RHS
- 2959674679U, // <3,6,3,u>: Cost 3 vzipr <1,1,3,3>, RHS
- 3763581536U, // <3,6,4,0>: Cost 4 vext3 LHS, <6,4,0,6>
- 2722943590U, // <3,6,4,1>: Cost 3 vext3 <6,4,1,3>, <6,4,1,3>
- 2732970609U, // <3,6,4,2>: Cost 3 vext3 LHS, <6,4,2,5>
- 3698560147U, // <3,6,4,3>: Cost 4 vext2 <1,2,3,6>, <4,3,6,6>
- 2732970628U, // <3,6,4,4>: Cost 3 vext3 LHS, <6,4,4,6>
- 2689839757U, // <3,6,4,5>: Cost 3 vext3 LHS, <6,4,5,6>
- 2732970640U, // <3,6,4,6>: Cost 3 vext3 LHS, <6,4,6,0>
- 2960346422U, // <3,6,4,7>: Cost 3 vzipr <1,2,3,4>, RHS
- 2689839784U, // <3,6,4,u>: Cost 3 vext3 LHS, <6,4,u,6>
- 2576498790U, // <3,6,5,0>: Cost 3 vext1 <4,3,6,5>, LHS
- 3650241270U, // <3,6,5,1>: Cost 4 vext1 <4,3,6,5>, <1,0,3,2>
- 2732970692U, // <3,6,5,2>: Cost 3 vext3 LHS, <6,5,2,7>
- 2576501250U, // <3,6,5,3>: Cost 3 vext1 <4,3,6,5>, <3,4,5,6>
- 2576501906U, // <3,6,5,4>: Cost 3 vext1 <4,3,6,5>, <4,3,6,5>
- 3650244622U, // <3,6,5,5>: Cost 4 vext1 <4,3,6,5>, <5,5,6,6>
- 4114633528U, // <3,6,5,6>: Cost 4 vtrnl <3,4,5,6>, <6,6,6,6>
- 2732970735U, // <3,6,5,7>: Cost 3 vext3 LHS, <6,5,7,5>
- 2576504622U, // <3,6,5,u>: Cost 3 vext1 <4,3,6,5>, LHS
- 2732970749U, // <3,6,6,0>: Cost 3 vext3 LHS, <6,6,0,1>
- 2724270856U, // <3,6,6,1>: Cost 3 vext3 <6,6,1,3>, <6,6,1,3>
- 2624819706U, // <3,6,6,2>: Cost 3 vext2 <1,2,3,6>, <6,2,7,3>
- 3656223234U, // <3,6,6,3>: Cost 4 vext1 <5,3,6,6>, <3,4,5,6>
- 2732970788U, // <3,6,6,4>: Cost 3 vext3 LHS, <6,6,4,4>
- 2732970800U, // <3,6,6,5>: Cost 3 vext3 LHS, <6,6,5,7>
- 1659228984U, // <3,6,6,6>: Cost 2 vext3 LHS, <6,6,6,6>
- 1659228994U, // <3,6,6,7>: Cost 2 vext3 LHS, <6,6,7,7>
- 1659229003U, // <3,6,6,u>: Cost 2 vext3 LHS, <6,6,u,7>
- 1659229006U, // <3,6,7,0>: Cost 2 vext3 LHS, <6,7,0,1>
- 2558600201U, // <3,6,7,1>: Cost 3 vext1 <1,3,6,7>, <1,3,6,7>
- 2558601146U, // <3,6,7,2>: Cost 3 vext1 <1,3,6,7>, <2,6,3,7>
- 2725081963U, // <3,6,7,3>: Cost 3 vext3 <6,7,3,3>, <6,7,3,3>
- 1659229046U, // <3,6,7,4>: Cost 2 vext3 LHS, <6,7,4,5>
- 2715423611U, // <3,6,7,5>: Cost 3 vext3 <5,1,7,3>, <6,7,5,1>
- 2722059141U, // <3,6,7,6>: Cost 3 vext3 <6,2,7,3>, <6,7,6,2>
- 2962361654U, // <3,6,7,7>: Cost 3 vzipr <1,5,3,7>, RHS
- 1659229078U, // <3,6,7,u>: Cost 2 vext3 LHS, <6,7,u,1>
- 1659229087U, // <3,6,u,0>: Cost 2 vext3 LHS, <6,u,0,1>
- 2689840041U, // <3,6,u,1>: Cost 3 vext3 LHS, <6,u,1,2>
- 2558609339U, // <3,6,u,2>: Cost 3 vext1 <1,3,6,u>, <2,6,3,u>
- 2576525853U, // <3,6,u,3>: Cost 3 vext1 <4,3,6,u>, <3,4,u,6>
- 1659229127U, // <3,6,u,4>: Cost 2 vext3 LHS, <6,u,4,5>
- 2689840081U, // <3,6,u,5>: Cost 3 vext3 LHS, <6,u,5,6>
- 1659228984U, // <3,6,u,6>: Cost 2 vext3 LHS, <6,6,6,6>
- 1652298720U, // <3,6,u,7>: Cost 2 vext3 <6,u,7,3>, <6,u,7,3>
- 1659229159U, // <3,6,u,u>: Cost 2 vext3 LHS, <6,u,u,1>
- 2626813952U, // <3,7,0,0>: Cost 3 vext2 <1,5,3,7>, <0,0,0,0>
- 1553072230U, // <3,7,0,1>: Cost 2 vext2 <1,5,3,7>, LHS
- 2626814116U, // <3,7,0,2>: Cost 3 vext2 <1,5,3,7>, <0,2,0,2>
- 3700556028U, // <3,7,0,3>: Cost 4 vext2 <1,5,3,7>, <0,3,1,0>
- 2626814290U, // <3,7,0,4>: Cost 3 vext2 <1,5,3,7>, <0,4,1,5>
- 2582507375U, // <3,7,0,5>: Cost 3 vext1 <5,3,7,0>, <5,3,7,0>
- 2588480072U, // <3,7,0,6>: Cost 3 vext1 <6,3,7,0>, <6,3,7,0>
- 2732971055U, // <3,7,0,7>: Cost 3 vext3 LHS, <7,0,7,1>
- 1553072797U, // <3,7,0,u>: Cost 2 vext2 <1,5,3,7>, LHS
- 2626814710U, // <3,7,1,0>: Cost 3 vext2 <1,5,3,7>, <1,0,3,2>
- 2626814772U, // <3,7,1,1>: Cost 3 vext2 <1,5,3,7>, <1,1,1,1>
- 2626814870U, // <3,7,1,2>: Cost 3 vext2 <1,5,3,7>, <1,2,3,0>
- 2625487854U, // <3,7,1,3>: Cost 3 vext2 <1,3,3,7>, <1,3,3,7>
- 2582514998U, // <3,7,1,4>: Cost 3 vext1 <5,3,7,1>, RHS
- 1553073296U, // <3,7,1,5>: Cost 2 vext2 <1,5,3,7>, <1,5,3,7>
- 2627478753U, // <3,7,1,6>: Cost 3 vext2 <1,6,3,7>, <1,6,3,7>
- 2727367810U, // <3,7,1,7>: Cost 3 vext3 <7,1,7,3>, <7,1,7,3>
- 1555064195U, // <3,7,1,u>: Cost 2 vext2 <1,u,3,7>, <1,u,3,7>
- 2588491878U, // <3,7,2,0>: Cost 3 vext1 <6,3,7,2>, LHS
- 3700557318U, // <3,7,2,1>: Cost 4 vext2 <1,5,3,7>, <2,1,0,3>
- 2626815592U, // <3,7,2,2>: Cost 3 vext2 <1,5,3,7>, <2,2,2,2>
- 2626815654U, // <3,7,2,3>: Cost 3 vext2 <1,5,3,7>, <2,3,0,1>
- 2588495158U, // <3,7,2,4>: Cost 3 vext1 <6,3,7,2>, RHS
- 2632787817U, // <3,7,2,5>: Cost 3 vext2 <2,5,3,7>, <2,5,3,7>
- 1559709626U, // <3,7,2,6>: Cost 2 vext2 <2,6,3,7>, <2,6,3,7>
- 2728031443U, // <3,7,2,7>: Cost 3 vext3 <7,2,7,3>, <7,2,7,3>
- 1561036892U, // <3,7,2,u>: Cost 2 vext2 <2,u,3,7>, <2,u,3,7>
- 2626816150U, // <3,7,3,0>: Cost 3 vext2 <1,5,3,7>, <3,0,1,2>
- 2626816268U, // <3,7,3,1>: Cost 3 vext2 <1,5,3,7>, <3,1,5,3>
- 2633451878U, // <3,7,3,2>: Cost 3 vext2 <2,6,3,7>, <3,2,6,3>
- 2626816412U, // <3,7,3,3>: Cost 3 vext2 <1,5,3,7>, <3,3,3,3>
- 2626816514U, // <3,7,3,4>: Cost 3 vext2 <1,5,3,7>, <3,4,5,6>
- 2638760514U, // <3,7,3,5>: Cost 3 vext2 <3,5,3,7>, <3,5,3,7>
- 2639424147U, // <3,7,3,6>: Cost 3 vext2 <3,6,3,7>, <3,6,3,7>
- 2826961920U, // <3,7,3,7>: Cost 3 vuzpr <1,3,5,7>, <1,3,5,7>
- 2626816798U, // <3,7,3,u>: Cost 3 vext2 <1,5,3,7>, <3,u,1,2>
- 2582536294U, // <3,7,4,0>: Cost 3 vext1 <5,3,7,4>, LHS
- 2582537360U, // <3,7,4,1>: Cost 3 vext1 <5,3,7,4>, <1,5,3,7>
- 2588510138U, // <3,7,4,2>: Cost 3 vext1 <6,3,7,4>, <2,6,3,7>
- 3700558996U, // <3,7,4,3>: Cost 4 vext2 <1,5,3,7>, <4,3,6,7>
- 2582539574U, // <3,7,4,4>: Cost 3 vext1 <5,3,7,4>, RHS
- 1553075510U, // <3,7,4,5>: Cost 2 vext2 <1,5,3,7>, RHS
- 2588512844U, // <3,7,4,6>: Cost 3 vext1 <6,3,7,4>, <6,3,7,4>
- 2564625766U, // <3,7,4,7>: Cost 3 vext1 <2,3,7,4>, <7,4,5,6>
- 1553075753U, // <3,7,4,u>: Cost 2 vext2 <1,5,3,7>, RHS
- 2732971398U, // <3,7,5,0>: Cost 3 vext3 LHS, <7,5,0,2>
- 2626817744U, // <3,7,5,1>: Cost 3 vext2 <1,5,3,7>, <5,1,7,3>
- 3700559649U, // <3,7,5,2>: Cost 4 vext2 <1,5,3,7>, <5,2,7,3>
- 2626817903U, // <3,7,5,3>: Cost 3 vext2 <1,5,3,7>, <5,3,7,0>
- 2258728203U, // <3,7,5,4>: Cost 3 vrev <7,3,4,5>
- 2732971446U, // <3,7,5,5>: Cost 3 vext3 LHS, <7,5,5,5>
- 2732971457U, // <3,7,5,6>: Cost 3 vext3 LHS, <7,5,6,7>
- 2826964278U, // <3,7,5,7>: Cost 3 vuzpr <1,3,5,7>, RHS
- 2826964279U, // <3,7,5,u>: Cost 3 vuzpr <1,3,5,7>, RHS
- 2732971478U, // <3,7,6,0>: Cost 3 vext3 LHS, <7,6,0,1>
- 2732971486U, // <3,7,6,1>: Cost 3 vext3 LHS, <7,6,1,0>
- 2633454074U, // <3,7,6,2>: Cost 3 vext2 <2,6,3,7>, <6,2,7,3>
- 2633454152U, // <3,7,6,3>: Cost 3 vext2 <2,6,3,7>, <6,3,7,0>
- 2732971518U, // <3,7,6,4>: Cost 3 vext3 LHS, <7,6,4,5>
- 2732971526U, // <3,7,6,5>: Cost 3 vext3 LHS, <7,6,5,4>
- 2732971537U, // <3,7,6,6>: Cost 3 vext3 LHS, <7,6,6,6>
- 2732971540U, // <3,7,6,7>: Cost 3 vext3 LHS, <7,6,7,0>
- 2726041124U, // <3,7,6,u>: Cost 3 vext3 <6,u,7,3>, <7,6,u,7>
- 2570616934U, // <3,7,7,0>: Cost 3 vext1 <3,3,7,7>, LHS
- 2570617856U, // <3,7,7,1>: Cost 3 vext1 <3,3,7,7>, <1,3,5,7>
- 2564646635U, // <3,7,7,2>: Cost 3 vext1 <2,3,7,7>, <2,3,7,7>
- 2570619332U, // <3,7,7,3>: Cost 3 vext1 <3,3,7,7>, <3,3,7,7>
- 2570620214U, // <3,7,7,4>: Cost 3 vext1 <3,3,7,7>, RHS
- 2582564726U, // <3,7,7,5>: Cost 3 vext1 <5,3,7,7>, <5,3,7,7>
- 2588537423U, // <3,7,7,6>: Cost 3 vext1 <6,3,7,7>, <6,3,7,7>
- 1659229804U, // <3,7,7,7>: Cost 2 vext3 LHS, <7,7,7,7>
- 1659229804U, // <3,7,7,u>: Cost 2 vext3 LHS, <7,7,7,7>
- 2626819795U, // <3,7,u,0>: Cost 3 vext2 <1,5,3,7>, <u,0,1,2>
- 1553078062U, // <3,7,u,1>: Cost 2 vext2 <1,5,3,7>, LHS
- 2626819973U, // <3,7,u,2>: Cost 3 vext2 <1,5,3,7>, <u,2,3,0>
- 2826961565U, // <3,7,u,3>: Cost 3 vuzpr <1,3,5,7>, LHS
- 2626820159U, // <3,7,u,4>: Cost 3 vext2 <1,5,3,7>, <u,4,5,6>
- 1553078426U, // <3,7,u,5>: Cost 2 vext2 <1,5,3,7>, RHS
- 1595545808U, // <3,7,u,6>: Cost 2 vext2 <u,6,3,7>, <u,6,3,7>
- 1659229804U, // <3,7,u,7>: Cost 2 vext3 LHS, <7,7,7,7>
- 1553078629U, // <3,7,u,u>: Cost 2 vext2 <1,5,3,7>, LHS
- 1611448320U, // <3,u,0,0>: Cost 2 vext3 LHS, <0,0,0,0>
- 1611896531U, // <3,u,0,1>: Cost 2 vext3 LHS, <u,0,1,2>
- 1659672284U, // <3,u,0,2>: Cost 2 vext3 LHS, <u,0,2,2>
- 1616099045U, // <3,u,0,3>: Cost 2 vext3 LHS, <u,0,3,2>
- 2685638381U, // <3,u,0,4>: Cost 3 vext3 LHS, <u,0,4,1>
- 1663874806U, // <3,u,0,5>: Cost 2 vext3 LHS, <u,0,5,1>
- 1663874816U, // <3,u,0,6>: Cost 2 vext3 LHS, <u,0,6,2>
- 2960313672U, // <3,u,0,7>: Cost 3 vzipr <1,2,3,0>, RHS
- 1611896594U, // <3,u,0,u>: Cost 2 vext3 LHS, <u,0,u,2>
- 1549763324U, // <3,u,1,0>: Cost 2 vext2 <1,0,3,u>, <1,0,3,u>
- 1550426957U, // <3,u,1,1>: Cost 2 vext2 <1,1,3,u>, <1,1,3,u>
- 537712430U, // <3,u,1,2>: Cost 1 vext3 LHS, LHS
- 1616541495U, // <3,u,1,3>: Cost 2 vext3 LHS, <u,1,3,3>
- 1490930998U, // <3,u,1,4>: Cost 2 vext1 <2,3,u,1>, RHS
- 1553081489U, // <3,u,1,5>: Cost 2 vext2 <1,5,3,u>, <1,5,3,u>
- 2627486946U, // <3,u,1,6>: Cost 3 vext2 <1,6,3,u>, <1,6,3,u>
- 1659230043U, // <3,u,1,7>: Cost 2 vext3 LHS, <u,1,7,3>
- 537712484U, // <3,u,1,u>: Cost 1 vext3 LHS, LHS
- 1611890852U, // <3,u,2,0>: Cost 2 vext3 LHS, <0,2,0,2>
- 2624833102U, // <3,u,2,1>: Cost 3 vext2 <1,2,3,u>, <2,1,u,3>
- 1557063287U, // <3,u,2,2>: Cost 2 vext2 <2,2,3,u>, <2,2,3,u>
- 1616099205U, // <3,u,2,3>: Cost 2 vext3 LHS, <u,2,3,0>
- 1611890892U, // <3,u,2,4>: Cost 2 vext3 LHS, <0,2,4,6>
- 2689841054U, // <3,u,2,5>: Cost 3 vext3 LHS, <u,2,5,7>
- 1559717819U, // <3,u,2,6>: Cost 2 vext2 <2,6,3,u>, <2,6,3,u>
- 1659230124U, // <3,u,2,7>: Cost 2 vext3 LHS, <u,2,7,3>
- 1616541618U, // <3,u,2,u>: Cost 2 vext3 LHS, <u,2,u,0>
- 1611896764U, // <3,u,3,0>: Cost 2 vext3 LHS, <u,3,0,1>
- 1484973079U, // <3,u,3,1>: Cost 2 vext1 <1,3,u,3>, <1,3,u,3>
- 2685638607U, // <3,u,3,2>: Cost 3 vext3 LHS, <u,3,2,2>
- 336380006U, // <3,u,3,3>: Cost 1 vdup3 LHS
- 1611896804U, // <3,u,3,4>: Cost 2 vext3 LHS, <u,3,4,5>
- 1616541679U, // <3,u,3,5>: Cost 2 vext3 LHS, <u,3,5,7>
- 2690283512U, // <3,u,3,6>: Cost 3 vext3 LHS, <u,3,6,7>
- 2959674696U, // <3,u,3,7>: Cost 3 vzipr <1,1,3,3>, RHS
- 336380006U, // <3,u,3,u>: Cost 1 vdup3 LHS
- 2558722150U, // <3,u,4,0>: Cost 3 vext1 <1,3,u,4>, LHS
- 1659672602U, // <3,u,4,1>: Cost 2 vext3 LHS, <u,4,1,5>
- 1659672612U, // <3,u,4,2>: Cost 2 vext3 LHS, <u,4,2,6>
- 2689841196U, // <3,u,4,3>: Cost 3 vext3 LHS, <u,4,3,5>
- 1659227344U, // <3,u,4,4>: Cost 2 vext3 LHS, <4,4,4,4>
- 1611896895U, // <3,u,4,5>: Cost 2 vext3 LHS, <u,4,5,6>
- 1663875144U, // <3,u,4,6>: Cost 2 vext3 LHS, <u,4,6,6>
- 1659230289U, // <3,u,4,7>: Cost 2 vext3 LHS, <u,4,7,6>
- 1611896922U, // <3,u,4,u>: Cost 2 vext3 LHS, <u,4,u,6>
- 1490960486U, // <3,u,5,0>: Cost 2 vext1 <2,3,u,5>, LHS
- 2689841261U, // <3,u,5,1>: Cost 3 vext3 LHS, <u,5,1,7>
- 1490962162U, // <3,u,5,2>: Cost 2 vext1 <2,3,u,5>, <2,3,u,5>
- 1616541823U, // <3,u,5,3>: Cost 2 vext3 LHS, <u,5,3,7>
- 1490963766U, // <3,u,5,4>: Cost 2 vext1 <2,3,u,5>, RHS
- 1659228164U, // <3,u,5,5>: Cost 2 vext3 LHS, <5,5,5,5>
- 537712794U, // <3,u,5,6>: Cost 1 vext3 LHS, RHS
- 1659230371U, // <3,u,5,7>: Cost 2 vext3 LHS, <u,5,7,7>
- 537712812U, // <3,u,5,u>: Cost 1 vext3 LHS, RHS
- 2689841327U, // <3,u,6,0>: Cost 3 vext3 LHS, <u,6,0,1>
- 2558739482U, // <3,u,6,1>: Cost 3 vext1 <1,3,u,6>, <1,3,u,6>
- 2689841351U, // <3,u,6,2>: Cost 3 vext3 LHS, <u,6,2,7>
- 1616099536U, // <3,u,6,3>: Cost 2 vext3 LHS, <u,6,3,7>
- 1659227508U, // <3,u,6,4>: Cost 2 vext3 LHS, <4,6,4,6>
- 2690283746U, // <3,u,6,5>: Cost 3 vext3 LHS, <u,6,5,7>
- 1659228984U, // <3,u,6,6>: Cost 2 vext3 LHS, <6,6,6,6>
- 1659230445U, // <3,u,6,7>: Cost 2 vext3 LHS, <u,6,7,0>
- 1616099581U, // <3,u,6,u>: Cost 2 vext3 LHS, <u,6,u,7>
- 1485004902U, // <3,u,7,0>: Cost 2 vext1 <1,3,u,7>, LHS
- 1485005851U, // <3,u,7,1>: Cost 2 vext1 <1,3,u,7>, <1,3,u,7>
- 2558748264U, // <3,u,7,2>: Cost 3 vext1 <1,3,u,7>, <2,2,2,2>
- 3095397021U, // <3,u,7,3>: Cost 3 vtrnr <1,3,5,7>, LHS
- 1485008182U, // <3,u,7,4>: Cost 2 vext1 <1,3,u,7>, RHS
- 1659228328U, // <3,u,7,5>: Cost 2 vext3 LHS, <5,7,5,7>
- 2722060599U, // <3,u,7,6>: Cost 3 vext3 <6,2,7,3>, <u,7,6,2>
- 1659229804U, // <3,u,7,7>: Cost 2 vext3 LHS, <7,7,7,7>
- 1485010734U, // <3,u,7,u>: Cost 2 vext1 <1,3,u,7>, LHS
- 1616099665U, // <3,u,u,0>: Cost 2 vext3 LHS, <u,u,0,1>
- 1611897179U, // <3,u,u,1>: Cost 2 vext3 LHS, <u,u,1,2>
- 537712997U, // <3,u,u,2>: Cost 1 vext3 LHS, LHS
- 336380006U, // <3,u,u,3>: Cost 1 vdup3 LHS
- 1616099705U, // <3,u,u,4>: Cost 2 vext3 LHS, <u,u,4,5>
- 1611897219U, // <3,u,u,5>: Cost 2 vext3 LHS, <u,u,5,6>
- 537713037U, // <3,u,u,6>: Cost 1 vext3 LHS, RHS
- 1659230607U, // <3,u,u,7>: Cost 2 vext3 LHS, <u,u,7,0>
- 537713051U, // <3,u,u,u>: Cost 1 vext3 LHS, LHS
- 2691907584U, // <4,0,0,0>: Cost 3 vext3 <1,2,3,4>, <0,0,0,0>
- 2691907594U, // <4,0,0,1>: Cost 3 vext3 <1,2,3,4>, <0,0,1,1>
- 2691907604U, // <4,0,0,2>: Cost 3 vext3 <1,2,3,4>, <0,0,2,2>
- 3709862144U, // <4,0,0,3>: Cost 4 vext2 <3,1,4,0>, <0,3,1,4>
- 2684682280U, // <4,0,0,4>: Cost 3 vext3 <0,0,4,4>, <0,0,4,4>
- 3694600633U, // <4,0,0,5>: Cost 4 vext2 <0,5,4,0>, <0,5,4,0>
- 3291431290U, // <4,0,0,6>: Cost 4 vrev <0,4,6,0>
- 3668342067U, // <4,0,0,7>: Cost 4 vext1 <7,4,0,0>, <7,4,0,0>
- 2691907657U, // <4,0,0,u>: Cost 3 vext3 <1,2,3,4>, <0,0,u,1>
- 2570715238U, // <4,0,1,0>: Cost 3 vext1 <3,4,0,1>, LHS
- 2570716058U, // <4,0,1,1>: Cost 3 vext1 <3,4,0,1>, <1,2,3,4>
- 1618165862U, // <4,0,1,2>: Cost 2 vext3 <1,2,3,4>, LHS
- 2570717648U, // <4,0,1,3>: Cost 3 vext1 <3,4,0,1>, <3,4,0,1>
- 2570718518U, // <4,0,1,4>: Cost 3 vext1 <3,4,0,1>, RHS
- 2594607206U, // <4,0,1,5>: Cost 3 vext1 <7,4,0,1>, <5,6,7,4>
- 3662377563U, // <4,0,1,6>: Cost 4 vext1 <6,4,0,1>, <6,4,0,1>
- 2594608436U, // <4,0,1,7>: Cost 3 vext1 <7,4,0,1>, <7,4,0,1>
- 1618165916U, // <4,0,1,u>: Cost 2 vext3 <1,2,3,4>, LHS
- 2685714598U, // <4,0,2,0>: Cost 3 vext3 <0,2,0,4>, <0,2,0,4>
- 3759530159U, // <4,0,2,1>: Cost 4 vext3 <0,2,1,4>, <0,2,1,4>
- 2685862072U, // <4,0,2,2>: Cost 3 vext3 <0,2,2,4>, <0,2,2,4>
- 2631476937U, // <4,0,2,3>: Cost 3 vext2 <2,3,4,0>, <2,3,4,0>
- 2685714636U, // <4,0,2,4>: Cost 3 vext3 <0,2,0,4>, <0,2,4,6>
- 3765649622U, // <4,0,2,5>: Cost 4 vext3 <1,2,3,4>, <0,2,5,7>
- 2686157020U, // <4,0,2,6>: Cost 3 vext3 <0,2,6,4>, <0,2,6,4>
- 3668358453U, // <4,0,2,7>: Cost 4 vext1 <7,4,0,2>, <7,4,0,2>
- 2686304494U, // <4,0,2,u>: Cost 3 vext3 <0,2,u,4>, <0,2,u,4>
- 3632529510U, // <4,0,3,0>: Cost 4 vext1 <1,4,0,3>, LHS
- 2686451968U, // <4,0,3,1>: Cost 3 vext3 <0,3,1,4>, <0,3,1,4>
- 2686525705U, // <4,0,3,2>: Cost 3 vext3 <0,3,2,4>, <0,3,2,4>
- 3760341266U, // <4,0,3,3>: Cost 4 vext3 <0,3,3,4>, <0,3,3,4>
- 3632532790U, // <4,0,3,4>: Cost 4 vext1 <1,4,0,3>, RHS
- 3913254606U, // <4,0,3,5>: Cost 4 vuzpr <3,4,5,0>, <2,3,4,5>
- 3705219740U, // <4,0,3,6>: Cost 4 vext2 <2,3,4,0>, <3,6,4,7>
- 3713845990U, // <4,0,3,7>: Cost 4 vext2 <3,7,4,0>, <3,7,4,0>
- 2686451968U, // <4,0,3,u>: Cost 3 vext3 <0,3,1,4>, <0,3,1,4>
- 2552823910U, // <4,0,4,0>: Cost 3 vext1 <0,4,0,4>, LHS
- 2691907922U, // <4,0,4,1>: Cost 3 vext3 <1,2,3,4>, <0,4,1,5>
- 2691907932U, // <4,0,4,2>: Cost 3 vext3 <1,2,3,4>, <0,4,2,6>
- 3626567830U, // <4,0,4,3>: Cost 4 vext1 <0,4,0,4>, <3,0,1,2>
- 2552827190U, // <4,0,4,4>: Cost 3 vext1 <0,4,0,4>, RHS
- 2631478582U, // <4,0,4,5>: Cost 3 vext2 <2,3,4,0>, RHS
- 3626570017U, // <4,0,4,6>: Cost 4 vext1 <0,4,0,4>, <6,0,1,2>
- 3668374839U, // <4,0,4,7>: Cost 4 vext1 <7,4,0,4>, <7,4,0,4>
- 2552829742U, // <4,0,4,u>: Cost 3 vext1 <0,4,0,4>, LHS
- 2558804070U, // <4,0,5,0>: Cost 3 vext1 <1,4,0,5>, LHS
- 1839644774U, // <4,0,5,1>: Cost 2 vzipl RHS, LHS
- 2913386660U, // <4,0,5,2>: Cost 3 vzipl RHS, <0,2,0,2>
- 2570750420U, // <4,0,5,3>: Cost 3 vext1 <3,4,0,5>, <3,4,0,5>
- 2558807350U, // <4,0,5,4>: Cost 3 vext1 <1,4,0,5>, RHS
- 3987128750U, // <4,0,5,5>: Cost 4 vzipl RHS, <0,5,2,7>
- 3987128822U, // <4,0,5,6>: Cost 4 vzipl RHS, <0,6,1,7>
- 2594641208U, // <4,0,5,7>: Cost 3 vext1 <7,4,0,5>, <7,4,0,5>
- 1839645341U, // <4,0,5,u>: Cost 2 vzipl RHS, LHS
- 2552840294U, // <4,0,6,0>: Cost 3 vext1 <0,4,0,6>, LHS
- 3047604234U, // <4,0,6,1>: Cost 3 vtrnl RHS, <0,0,1,1>
- 1973862502U, // <4,0,6,2>: Cost 2 vtrnl RHS, LHS
- 2570758613U, // <4,0,6,3>: Cost 3 vext1 <3,4,0,6>, <3,4,0,6>
- 2552843574U, // <4,0,6,4>: Cost 3 vext1 <0,4,0,6>, RHS
- 2217664887U, // <4,0,6,5>: Cost 3 vrev <0,4,5,6>
- 3662418528U, // <4,0,6,6>: Cost 4 vext1 <6,4,0,6>, <6,4,0,6>
- 2658022257U, // <4,0,6,7>: Cost 3 vext2 <6,7,4,0>, <6,7,4,0>
- 1973862556U, // <4,0,6,u>: Cost 2 vtrnl RHS, LHS
- 3731764218U, // <4,0,7,0>: Cost 4 vext2 <6,7,4,0>, <7,0,1,2>
- 3988324454U, // <4,0,7,1>: Cost 4 vzipl <4,7,5,0>, LHS
- 4122034278U, // <4,0,7,2>: Cost 4 vtrnl <4,6,7,1>, LHS
- 3735082246U, // <4,0,7,3>: Cost 4 vext2 <7,3,4,0>, <7,3,4,0>
- 3731764536U, // <4,0,7,4>: Cost 4 vext2 <6,7,4,0>, <7,4,0,5>
- 3937145718U, // <4,0,7,5>: Cost 4 vuzpr <7,4,5,0>, <6,7,4,5>
- 3737073145U, // <4,0,7,6>: Cost 4 vext2 <7,6,4,0>, <7,6,4,0>
- 3731764844U, // <4,0,7,7>: Cost 4 vext2 <6,7,4,0>, <7,7,7,7>
- 4122034332U, // <4,0,7,u>: Cost 4 vtrnl <4,6,7,1>, LHS
- 2552856678U, // <4,0,u,0>: Cost 3 vext1 <0,4,0,u>, LHS
- 1841635430U, // <4,0,u,1>: Cost 2 vzipl RHS, LHS
- 1618166429U, // <4,0,u,2>: Cost 2 vext3 <1,2,3,4>, LHS
- 2570774999U, // <4,0,u,3>: Cost 3 vext1 <3,4,0,u>, <3,4,0,u>
- 2552859958U, // <4,0,u,4>: Cost 3 vext1 <0,4,0,u>, RHS
- 2631481498U, // <4,0,u,5>: Cost 3 vext2 <2,3,4,0>, RHS
- 2686157020U, // <4,0,u,6>: Cost 3 vext3 <0,2,6,4>, <0,2,6,4>
- 2594665787U, // <4,0,u,7>: Cost 3 vext1 <7,4,0,u>, <7,4,0,u>
- 1618166483U, // <4,0,u,u>: Cost 2 vext3 <1,2,3,4>, LHS
- 2617548837U, // <4,1,0,0>: Cost 3 vext2 <0,0,4,1>, <0,0,4,1>
- 2622857318U, // <4,1,0,1>: Cost 3 vext2 <0,u,4,1>, LHS
- 3693281484U, // <4,1,0,2>: Cost 4 vext2 <0,3,4,1>, <0,2,4,6>
- 2691908342U, // <4,1,0,3>: Cost 3 vext3 <1,2,3,4>, <1,0,3,2>
- 2622857554U, // <4,1,0,4>: Cost 3 vext2 <0,u,4,1>, <0,4,1,5>
- 3764470538U, // <4,1,0,5>: Cost 4 vext3 <1,0,5,4>, <1,0,5,4>
- 3695272459U, // <4,1,0,6>: Cost 4 vext2 <0,6,4,1>, <0,6,4,1>
- 3733094980U, // <4,1,0,7>: Cost 4 vext2 <7,0,4,1>, <0,7,1,4>
- 2622857885U, // <4,1,0,u>: Cost 3 vext2 <0,u,4,1>, LHS
- 3696599798U, // <4,1,1,0>: Cost 4 vext2 <0,u,4,1>, <1,0,3,2>
- 2691097399U, // <4,1,1,1>: Cost 3 vext3 <1,1,1,4>, <1,1,1,4>
- 2631484314U, // <4,1,1,2>: Cost 3 vext2 <2,3,4,1>, <1,2,3,4>
- 2691908424U, // <4,1,1,3>: Cost 3 vext3 <1,2,3,4>, <1,1,3,3>
- 3696600125U, // <4,1,1,4>: Cost 4 vext2 <0,u,4,1>, <1,4,3,5>
- 3696600175U, // <4,1,1,5>: Cost 4 vext2 <0,u,4,1>, <1,5,0,1>
- 3696600307U, // <4,1,1,6>: Cost 4 vext2 <0,u,4,1>, <1,6,5,7>
- 3668423997U, // <4,1,1,7>: Cost 4 vext1 <7,4,1,1>, <7,4,1,1>
- 2691908469U, // <4,1,1,u>: Cost 3 vext3 <1,2,3,4>, <1,1,u,3>
- 2570797158U, // <4,1,2,0>: Cost 3 vext1 <3,4,1,2>, LHS
- 2570797978U, // <4,1,2,1>: Cost 3 vext1 <3,4,1,2>, <1,2,3,4>
- 3696600680U, // <4,1,2,2>: Cost 4 vext2 <0,u,4,1>, <2,2,2,2>
- 1618166682U, // <4,1,2,3>: Cost 2 vext3 <1,2,3,4>, <1,2,3,4>
- 2570800438U, // <4,1,2,4>: Cost 3 vext1 <3,4,1,2>, RHS
- 3765650347U, // <4,1,2,5>: Cost 4 vext3 <1,2,3,4>, <1,2,5,3>
- 3696601018U, // <4,1,2,6>: Cost 4 vext2 <0,u,4,1>, <2,6,3,7>
- 3668432190U, // <4,1,2,7>: Cost 4 vext1 <7,4,1,2>, <7,4,1,2>
- 1618535367U, // <4,1,2,u>: Cost 2 vext3 <1,2,u,4>, <1,2,u,4>
- 2564833382U, // <4,1,3,0>: Cost 3 vext1 <2,4,1,3>, LHS
- 2691908568U, // <4,1,3,1>: Cost 3 vext3 <1,2,3,4>, <1,3,1,3>
- 2691908578U, // <4,1,3,2>: Cost 3 vext3 <1,2,3,4>, <1,3,2,4>
- 2692572139U, // <4,1,3,3>: Cost 3 vext3 <1,3,3,4>, <1,3,3,4>
- 2564836662U, // <4,1,3,4>: Cost 3 vext1 <2,4,1,3>, RHS
- 2691908608U, // <4,1,3,5>: Cost 3 vext3 <1,2,3,4>, <1,3,5,7>
- 2588725862U, // <4,1,3,6>: Cost 3 vext1 <6,4,1,3>, <6,4,1,3>
- 3662468090U, // <4,1,3,7>: Cost 4 vext1 <6,4,1,3>, <7,0,1,2>
- 2691908631U, // <4,1,3,u>: Cost 3 vext3 <1,2,3,4>, <1,3,u,3>
- 3760194590U, // <4,1,4,0>: Cost 4 vext3 <0,3,1,4>, <1,4,0,1>
- 3693947874U, // <4,1,4,1>: Cost 4 vext2 <0,4,4,1>, <4,1,5,0>
- 3765650484U, // <4,1,4,2>: Cost 4 vext3 <1,2,3,4>, <1,4,2,5>
- 3113877606U, // <4,1,4,3>: Cost 3 vtrnr <4,4,4,4>, LHS
- 3760194630U, // <4,1,4,4>: Cost 4 vext3 <0,3,1,4>, <1,4,4,5>
- 2622860598U, // <4,1,4,5>: Cost 3 vext2 <0,u,4,1>, RHS
- 3297436759U, // <4,1,4,6>: Cost 4 vrev <1,4,6,4>
- 3800007772U, // <4,1,4,7>: Cost 4 vext3 <7,0,1,4>, <1,4,7,0>
- 2622860841U, // <4,1,4,u>: Cost 3 vext2 <0,u,4,1>, RHS
- 1479164006U, // <4,1,5,0>: Cost 2 vext1 <0,4,1,5>, LHS
- 2552906486U, // <4,1,5,1>: Cost 3 vext1 <0,4,1,5>, <1,0,3,2>
- 2552907299U, // <4,1,5,2>: Cost 3 vext1 <0,4,1,5>, <2,1,3,5>
- 2552907926U, // <4,1,5,3>: Cost 3 vext1 <0,4,1,5>, <3,0,1,2>
- 1479167286U, // <4,1,5,4>: Cost 2 vext1 <0,4,1,5>, RHS
- 2913387664U, // <4,1,5,5>: Cost 3 vzipl RHS, <1,5,3,7>
- 2600686074U, // <4,1,5,6>: Cost 3 vext1 <u,4,1,5>, <6,2,7,3>
- 2600686586U, // <4,1,5,7>: Cost 3 vext1 <u,4,1,5>, <7,0,1,2>
- 1479169838U, // <4,1,5,u>: Cost 2 vext1 <0,4,1,5>, LHS
- 2552914022U, // <4,1,6,0>: Cost 3 vext1 <0,4,1,6>, LHS
- 2558886708U, // <4,1,6,1>: Cost 3 vext1 <1,4,1,6>, <1,1,1,1>
- 4028205206U, // <4,1,6,2>: Cost 4 vzipr <0,2,4,6>, <3,0,1,2>
- 3089858662U, // <4,1,6,3>: Cost 3 vtrnr <0,4,2,6>, LHS
- 2552917302U, // <4,1,6,4>: Cost 3 vext1 <0,4,1,6>, RHS
- 2223637584U, // <4,1,6,5>: Cost 3 vrev <1,4,5,6>
- 4121347081U, // <4,1,6,6>: Cost 4 vtrnl RHS, <1,3,6,7>
- 3721155406U, // <4,1,6,7>: Cost 4 vext2 <5,0,4,1>, <6,7,0,1>
- 2552919854U, // <4,1,6,u>: Cost 3 vext1 <0,4,1,6>, LHS
- 2659357716U, // <4,1,7,0>: Cost 3 vext2 <7,0,4,1>, <7,0,4,1>
- 3733763173U, // <4,1,7,1>: Cost 4 vext2 <7,1,4,1>, <7,1,4,1>
- 3734426806U, // <4,1,7,2>: Cost 4 vext2 <7,2,4,1>, <7,2,4,1>
- 2695226671U, // <4,1,7,3>: Cost 3 vext3 <1,7,3,4>, <1,7,3,4>
- 3721155942U, // <4,1,7,4>: Cost 4 vext2 <5,0,4,1>, <7,4,5,6>
- 3721155976U, // <4,1,7,5>: Cost 4 vext2 <5,0,4,1>, <7,5,0,4>
- 3662500458U, // <4,1,7,6>: Cost 4 vext1 <6,4,1,7>, <6,4,1,7>
- 3721156204U, // <4,1,7,7>: Cost 4 vext2 <5,0,4,1>, <7,7,7,7>
- 2659357716U, // <4,1,7,u>: Cost 3 vext2 <7,0,4,1>, <7,0,4,1>
- 1479188582U, // <4,1,u,0>: Cost 2 vext1 <0,4,1,u>, LHS
- 2552931062U, // <4,1,u,1>: Cost 3 vext1 <0,4,1,u>, <1,0,3,2>
- 2552931944U, // <4,1,u,2>: Cost 3 vext1 <0,4,1,u>, <2,2,2,2>
- 1622148480U, // <4,1,u,3>: Cost 2 vext3 <1,u,3,4>, <1,u,3,4>
- 1479191862U, // <4,1,u,4>: Cost 2 vext1 <0,4,1,u>, RHS
- 2622863514U, // <4,1,u,5>: Cost 3 vext2 <0,u,4,1>, RHS
- 2588725862U, // <4,1,u,6>: Cost 3 vext1 <6,4,1,3>, <6,4,1,3>
- 2600686586U, // <4,1,u,7>: Cost 3 vext1 <u,4,1,5>, <7,0,1,2>
- 1479194414U, // <4,1,u,u>: Cost 2 vext1 <0,4,1,u>, LHS
- 2617557030U, // <4,2,0,0>: Cost 3 vext2 <0,0,4,2>, <0,0,4,2>
- 2622865510U, // <4,2,0,1>: Cost 3 vext2 <0,u,4,2>, LHS
- 2622865612U, // <4,2,0,2>: Cost 3 vext2 <0,u,4,2>, <0,2,4,6>
- 3693289753U, // <4,2,0,3>: Cost 4 vext2 <0,3,4,2>, <0,3,4,2>
- 2635473244U, // <4,2,0,4>: Cost 3 vext2 <3,0,4,2>, <0,4,2,6>
- 3765650918U, // <4,2,0,5>: Cost 4 vext3 <1,2,3,4>, <2,0,5,7>
- 2696775148U, // <4,2,0,6>: Cost 3 vext3 <2,0,6,4>, <2,0,6,4>
- 3695944285U, // <4,2,0,7>: Cost 4 vext2 <0,7,4,2>, <0,7,4,2>
- 2622866077U, // <4,2,0,u>: Cost 3 vext2 <0,u,4,2>, LHS
- 3696607990U, // <4,2,1,0>: Cost 4 vext2 <0,u,4,2>, <1,0,3,2>
- 3696608052U, // <4,2,1,1>: Cost 4 vext2 <0,u,4,2>, <1,1,1,1>
- 3696608150U, // <4,2,1,2>: Cost 4 vext2 <0,u,4,2>, <1,2,3,0>
- 3895574630U, // <4,2,1,3>: Cost 4 vuzpr <0,4,u,2>, LHS
- 2691909162U, // <4,2,1,4>: Cost 3 vext3 <1,2,3,4>, <2,1,4,3>
- 3696608400U, // <4,2,1,5>: Cost 4 vext2 <0,u,4,2>, <1,5,3,7>
- 3760784956U, // <4,2,1,6>: Cost 4 vext3 <0,4,0,4>, <2,1,6,3>
- 3773908549U, // <4,2,1,7>: Cost 5 vext3 <2,5,7,4>, <2,1,7,3>
- 2691909162U, // <4,2,1,u>: Cost 3 vext3 <1,2,3,4>, <2,1,4,3>
- 3696608748U, // <4,2,2,0>: Cost 4 vext2 <0,u,4,2>, <2,0,6,4>
- 3696608828U, // <4,2,2,1>: Cost 4 vext2 <0,u,4,2>, <2,1,6,3>
- 2691909224U, // <4,2,2,2>: Cost 3 vext3 <1,2,3,4>, <2,2,2,2>
- 2691909234U, // <4,2,2,3>: Cost 3 vext3 <1,2,3,4>, <2,2,3,3>
- 3759605368U, // <4,2,2,4>: Cost 4 vext3 <0,2,2,4>, <2,2,4,0>
- 3696609156U, // <4,2,2,5>: Cost 4 vext2 <0,u,4,2>, <2,5,6,7>
- 3760785040U, // <4,2,2,6>: Cost 4 vext3 <0,4,0,4>, <2,2,6,6>
- 3668505927U, // <4,2,2,7>: Cost 4 vext1 <7,4,2,2>, <7,4,2,2>
- 2691909279U, // <4,2,2,u>: Cost 3 vext3 <1,2,3,4>, <2,2,u,3>
- 2691909286U, // <4,2,3,0>: Cost 3 vext3 <1,2,3,4>, <2,3,0,1>
- 3764840111U, // <4,2,3,1>: Cost 4 vext3 <1,1,1,4>, <2,3,1,1>
- 3765651129U, // <4,2,3,2>: Cost 4 vext3 <1,2,3,4>, <2,3,2,2>
- 2698544836U, // <4,2,3,3>: Cost 3 vext3 <2,3,3,4>, <2,3,3,4>
- 2685863630U, // <4,2,3,4>: Cost 3 vext3 <0,2,2,4>, <2,3,4,5>
- 2698692310U, // <4,2,3,5>: Cost 3 vext3 <2,3,5,4>, <2,3,5,4>
- 3772507871U, // <4,2,3,6>: Cost 4 vext3 <2,3,6,4>, <2,3,6,4>
- 2698839784U, // <4,2,3,7>: Cost 3 vext3 <2,3,7,4>, <2,3,7,4>
- 2691909358U, // <4,2,3,u>: Cost 3 vext3 <1,2,3,4>, <2,3,u,1>
- 2564915302U, // <4,2,4,0>: Cost 3 vext1 <2,4,2,4>, LHS
- 2564916122U, // <4,2,4,1>: Cost 3 vext1 <2,4,2,4>, <1,2,3,4>
- 2564917004U, // <4,2,4,2>: Cost 3 vext1 <2,4,2,4>, <2,4,2,4>
- 2699208469U, // <4,2,4,3>: Cost 3 vext3 <2,4,3,4>, <2,4,3,4>
- 2564918582U, // <4,2,4,4>: Cost 3 vext1 <2,4,2,4>, RHS
- 2622868790U, // <4,2,4,5>: Cost 3 vext2 <0,u,4,2>, RHS
- 2229667632U, // <4,2,4,6>: Cost 3 vrev <2,4,6,4>
- 3800082229U, // <4,2,4,7>: Cost 4 vext3 <7,0,2,4>, <2,4,7,0>
- 2622869033U, // <4,2,4,u>: Cost 3 vext2 <0,u,4,2>, RHS
- 2552979558U, // <4,2,5,0>: Cost 3 vext1 <0,4,2,5>, LHS
- 2558952342U, // <4,2,5,1>: Cost 3 vext1 <1,4,2,5>, <1,2,3,0>
- 2564925032U, // <4,2,5,2>: Cost 3 vext1 <2,4,2,5>, <2,2,2,2>
- 2967060582U, // <4,2,5,3>: Cost 3 vzipr <2,3,4,5>, LHS
- 2552982838U, // <4,2,5,4>: Cost 3 vext1 <0,4,2,5>, RHS
- 3987130190U, // <4,2,5,5>: Cost 4 vzipl RHS, <2,5,0,7>
- 2913388474U, // <4,2,5,6>: Cost 3 vzipl RHS, <2,6,3,7>
- 3895577910U, // <4,2,5,7>: Cost 4 vuzpr <0,4,u,2>, RHS
- 2552985390U, // <4,2,5,u>: Cost 3 vext1 <0,4,2,5>, LHS
- 1479245926U, // <4,2,6,0>: Cost 2 vext1 <0,4,2,6>, LHS
- 2552988406U, // <4,2,6,1>: Cost 3 vext1 <0,4,2,6>, <1,0,3,2>
- 2552989288U, // <4,2,6,2>: Cost 3 vext1 <0,4,2,6>, <2,2,2,2>
- 2954461286U, // <4,2,6,3>: Cost 3 vzipr <0,2,4,6>, LHS
- 1479249206U, // <4,2,6,4>: Cost 2 vext1 <0,4,2,6>, RHS
- 2229610281U, // <4,2,6,5>: Cost 3 vrev <2,4,5,6>
- 2600767994U, // <4,2,6,6>: Cost 3 vext1 <u,4,2,6>, <6,2,7,3>
- 2600768506U, // <4,2,6,7>: Cost 3 vext1 <u,4,2,6>, <7,0,1,2>
- 1479251758U, // <4,2,6,u>: Cost 2 vext1 <0,4,2,6>, LHS
- 2659365909U, // <4,2,7,0>: Cost 3 vext2 <7,0,4,2>, <7,0,4,2>
- 3733771366U, // <4,2,7,1>: Cost 4 vext2 <7,1,4,2>, <7,1,4,2>
- 3734434999U, // <4,2,7,2>: Cost 4 vext2 <7,2,4,2>, <7,2,4,2>
- 2701199368U, // <4,2,7,3>: Cost 3 vext3 <2,7,3,4>, <2,7,3,4>
- 4175774618U, // <4,2,7,4>: Cost 4 vtrnr <2,4,5,7>, <1,2,3,4>
- 3303360298U, // <4,2,7,5>: Cost 4 vrev <2,4,5,7>
- 3727136217U, // <4,2,7,6>: Cost 4 vext2 <6,0,4,2>, <7,6,0,4>
- 3727136364U, // <4,2,7,7>: Cost 4 vext2 <6,0,4,2>, <7,7,7,7>
- 2659365909U, // <4,2,7,u>: Cost 3 vext2 <7,0,4,2>, <7,0,4,2>
- 1479262310U, // <4,2,u,0>: Cost 2 vext1 <0,4,2,u>, LHS
- 2553004790U, // <4,2,u,1>: Cost 3 vext1 <0,4,2,u>, <1,0,3,2>
- 2553005672U, // <4,2,u,2>: Cost 3 vext1 <0,4,2,u>, <2,2,2,2>
- 2954477670U, // <4,2,u,3>: Cost 3 vzipr <0,2,4,u>, LHS
- 1479265590U, // <4,2,u,4>: Cost 2 vext1 <0,4,2,u>, RHS
- 2622871706U, // <4,2,u,5>: Cost 3 vext2 <0,u,4,2>, RHS
- 2229700404U, // <4,2,u,6>: Cost 3 vrev <2,4,6,u>
- 2600784890U, // <4,2,u,7>: Cost 3 vext1 <u,4,2,u>, <7,0,1,2>
- 1479268142U, // <4,2,u,u>: Cost 2 vext1 <0,4,2,u>, LHS
- 3765651595U, // <4,3,0,0>: Cost 4 vext3 <1,2,3,4>, <3,0,0,0>
- 2691909782U, // <4,3,0,1>: Cost 3 vext3 <1,2,3,4>, <3,0,1,2>
- 2702452897U, // <4,3,0,2>: Cost 3 vext3 <3,0,2,4>, <3,0,2,4>
- 3693297946U, // <4,3,0,3>: Cost 4 vext2 <0,3,4,3>, <0,3,4,3>
- 3760711856U, // <4,3,0,4>: Cost 4 vext3 <0,3,u,4>, <3,0,4,1>
- 2235533820U, // <4,3,0,5>: Cost 3 vrev <3,4,5,0>
- 3309349381U, // <4,3,0,6>: Cost 4 vrev <3,4,6,0>
- 3668563278U, // <4,3,0,7>: Cost 4 vext1 <7,4,3,0>, <7,4,3,0>
- 2691909845U, // <4,3,0,u>: Cost 3 vext3 <1,2,3,4>, <3,0,u,2>
- 2235173328U, // <4,3,1,0>: Cost 3 vrev <3,4,0,1>
- 3764840678U, // <4,3,1,1>: Cost 4 vext3 <1,1,1,4>, <3,1,1,1>
- 2630173594U, // <4,3,1,2>: Cost 3 vext2 <2,1,4,3>, <1,2,3,4>
- 2703190267U, // <4,3,1,3>: Cost 3 vext3 <3,1,3,4>, <3,1,3,4>
- 3760195840U, // <4,3,1,4>: Cost 4 vext3 <0,3,1,4>, <3,1,4,0>
- 3765651724U, // <4,3,1,5>: Cost 4 vext3 <1,2,3,4>, <3,1,5,3>
- 3309357574U, // <4,3,1,6>: Cost 4 vrev <3,4,6,1>
- 3769633054U, // <4,3,1,7>: Cost 4 vext3 <1,u,3,4>, <3,1,7,3>
- 2703558952U, // <4,3,1,u>: Cost 3 vext3 <3,1,u,4>, <3,1,u,4>
- 3626770534U, // <4,3,2,0>: Cost 4 vext1 <0,4,3,2>, LHS
- 2630174250U, // <4,3,2,1>: Cost 3 vext2 <2,1,4,3>, <2,1,4,3>
- 3765651777U, // <4,3,2,2>: Cost 4 vext3 <1,2,3,4>, <3,2,2,2>
- 2703853900U, // <4,3,2,3>: Cost 3 vext3 <3,2,3,4>, <3,2,3,4>
- 3626773814U, // <4,3,2,4>: Cost 4 vext1 <0,4,3,2>, RHS
- 2704001374U, // <4,3,2,5>: Cost 3 vext3 <3,2,5,4>, <3,2,5,4>
- 3765651814U, // <4,3,2,6>: Cost 4 vext3 <1,2,3,4>, <3,2,6,3>
- 3769633135U, // <4,3,2,7>: Cost 4 vext3 <1,u,3,4>, <3,2,7,3>
- 2634819681U, // <4,3,2,u>: Cost 3 vext2 <2,u,4,3>, <2,u,4,3>
- 3765651839U, // <4,3,3,0>: Cost 4 vext3 <1,2,3,4>, <3,3,0,1>
- 3765651848U, // <4,3,3,1>: Cost 4 vext3 <1,2,3,4>, <3,3,1,1>
- 3710552404U, // <4,3,3,2>: Cost 4 vext2 <3,2,4,3>, <3,2,4,3>
- 2691910044U, // <4,3,3,3>: Cost 3 vext3 <1,2,3,4>, <3,3,3,3>
- 2704591270U, // <4,3,3,4>: Cost 3 vext3 <3,3,4,4>, <3,3,4,4>
- 3769633202U, // <4,3,3,5>: Cost 4 vext3 <1,u,3,4>, <3,3,5,7>
- 3703917212U, // <4,3,3,6>: Cost 4 vext2 <2,1,4,3>, <3,6,4,7>
- 3769633220U, // <4,3,3,7>: Cost 4 vext3 <1,u,3,4>, <3,3,7,7>
- 2691910044U, // <4,3,3,u>: Cost 3 vext3 <1,2,3,4>, <3,3,3,3>
- 2691910096U, // <4,3,4,0>: Cost 3 vext3 <1,2,3,4>, <3,4,0,1>
- 2691910106U, // <4,3,4,1>: Cost 3 vext3 <1,2,3,4>, <3,4,1,2>
- 2564990741U, // <4,3,4,2>: Cost 3 vext1 <2,4,3,4>, <2,4,3,4>
- 3765651946U, // <4,3,4,3>: Cost 4 vext3 <1,2,3,4>, <3,4,3,0>
- 2691910136U, // <4,3,4,4>: Cost 3 vext3 <1,2,3,4>, <3,4,4,5>
- 2686454274U, // <4,3,4,5>: Cost 3 vext3 <0,3,1,4>, <3,4,5,6>
- 2235640329U, // <4,3,4,6>: Cost 3 vrev <3,4,6,4>
- 3801483792U, // <4,3,4,7>: Cost 4 vext3 <7,2,3,4>, <3,4,7,2>
- 2691910168U, // <4,3,4,u>: Cost 3 vext3 <1,2,3,4>, <3,4,u,1>
- 2559025254U, // <4,3,5,0>: Cost 3 vext1 <1,4,3,5>, LHS
- 2559026237U, // <4,3,5,1>: Cost 3 vext1 <1,4,3,5>, <1,4,3,5>
- 2564998862U, // <4,3,5,2>: Cost 3 vext1 <2,4,3,5>, <2,3,4,5>
- 2570971548U, // <4,3,5,3>: Cost 3 vext1 <3,4,3,5>, <3,3,3,3>
- 2559028534U, // <4,3,5,4>: Cost 3 vext1 <1,4,3,5>, RHS
- 4163519477U, // <4,3,5,5>: Cost 4 vtrnr <0,4,1,5>, <1,3,4,5>
- 3309390346U, // <4,3,5,6>: Cost 4 vrev <3,4,6,5>
- 2706139747U, // <4,3,5,7>: Cost 3 vext3 <3,5,7,4>, <3,5,7,4>
- 2559031086U, // <4,3,5,u>: Cost 3 vext1 <1,4,3,5>, LHS
- 2559033446U, // <4,3,6,0>: Cost 3 vext1 <1,4,3,6>, LHS
- 2559034430U, // <4,3,6,1>: Cost 3 vext1 <1,4,3,6>, <1,4,3,6>
- 2565007127U, // <4,3,6,2>: Cost 3 vext1 <2,4,3,6>, <2,4,3,6>
- 2570979740U, // <4,3,6,3>: Cost 3 vext1 <3,4,3,6>, <3,3,3,3>
- 2559036726U, // <4,3,6,4>: Cost 3 vext1 <1,4,3,6>, RHS
- 1161841154U, // <4,3,6,5>: Cost 2 vrev <3,4,5,6>
- 4028203932U, // <4,3,6,6>: Cost 4 vzipr <0,2,4,6>, <1,2,3,6>
- 2706803380U, // <4,3,6,7>: Cost 3 vext3 <3,6,7,4>, <3,6,7,4>
- 1162062365U, // <4,3,6,u>: Cost 2 vrev <3,4,u,6>
- 3769633475U, // <4,3,7,0>: Cost 4 vext3 <1,u,3,4>, <3,7,0,1>
- 3769633488U, // <4,3,7,1>: Cost 4 vext3 <1,u,3,4>, <3,7,1,5>
- 3638757144U, // <4,3,7,2>: Cost 4 vext1 <2,4,3,7>, <2,4,3,7>
- 3769633508U, // <4,3,7,3>: Cost 4 vext3 <1,u,3,4>, <3,7,3,7>
- 3769633515U, // <4,3,7,4>: Cost 4 vext3 <1,u,3,4>, <3,7,4,5>
- 3769633526U, // <4,3,7,5>: Cost 4 vext3 <1,u,3,4>, <3,7,5,7>
- 3662647932U, // <4,3,7,6>: Cost 4 vext1 <6,4,3,7>, <6,4,3,7>
- 3781208837U, // <4,3,7,7>: Cost 4 vext3 <3,7,7,4>, <3,7,7,4>
- 3769633547U, // <4,3,7,u>: Cost 4 vext3 <1,u,3,4>, <3,7,u,1>
- 2559049830U, // <4,3,u,0>: Cost 3 vext1 <1,4,3,u>, LHS
- 2691910430U, // <4,3,u,1>: Cost 3 vext3 <1,2,3,4>, <3,u,1,2>
- 2565023513U, // <4,3,u,2>: Cost 3 vext1 <2,4,3,u>, <2,4,3,u>
- 2707835698U, // <4,3,u,3>: Cost 3 vext3 <3,u,3,4>, <3,u,3,4>
- 2559053110U, // <4,3,u,4>: Cost 3 vext1 <1,4,3,u>, RHS
- 1161857540U, // <4,3,u,5>: Cost 2 vrev <3,4,5,u>
- 2235673101U, // <4,3,u,6>: Cost 3 vrev <3,4,6,u>
- 2708130646U, // <4,3,u,7>: Cost 3 vext3 <3,u,7,4>, <3,u,7,4>
- 1162078751U, // <4,3,u,u>: Cost 2 vrev <3,4,u,u>
- 2617573416U, // <4,4,0,0>: Cost 3 vext2 <0,0,4,4>, <0,0,4,4>
- 1570373734U, // <4,4,0,1>: Cost 2 vext2 <4,4,4,4>, LHS
- 2779676774U, // <4,4,0,2>: Cost 3 vuzpl <4,6,4,6>, LHS
- 3760196480U, // <4,4,0,3>: Cost 4 vext3 <0,3,1,4>, <4,0,3,1>
- 2576977100U, // <4,4,0,4>: Cost 3 vext1 <4,4,4,0>, <4,4,4,0>
- 2718747538U, // <4,4,0,5>: Cost 3 vext3 <5,6,7,4>, <4,0,5,1>
- 2718747548U, // <4,4,0,6>: Cost 3 vext3 <5,6,7,4>, <4,0,6,2>
- 3668637015U, // <4,4,0,7>: Cost 4 vext1 <7,4,4,0>, <7,4,4,0>
- 1570374301U, // <4,4,0,u>: Cost 2 vext2 <4,4,4,4>, LHS
- 2644116214U, // <4,4,1,0>: Cost 3 vext2 <4,4,4,4>, <1,0,3,2>
- 2644116276U, // <4,4,1,1>: Cost 3 vext2 <4,4,4,4>, <1,1,1,1>
- 2691910602U, // <4,4,1,2>: Cost 3 vext3 <1,2,3,4>, <4,1,2,3>
- 2644116440U, // <4,4,1,3>: Cost 3 vext2 <4,4,4,4>, <1,3,1,3>
- 2711227356U, // <4,4,1,4>: Cost 3 vext3 <4,4,4,4>, <4,1,4,3>
- 2709310438U, // <4,4,1,5>: Cost 3 vext3 <4,1,5,4>, <4,1,5,4>
- 3765652462U, // <4,4,1,6>: Cost 4 vext3 <1,2,3,4>, <4,1,6,3>
- 3768970231U, // <4,4,1,7>: Cost 4 vext3 <1,7,3,4>, <4,1,7,3>
- 2695891968U, // <4,4,1,u>: Cost 3 vext3 <1,u,3,4>, <4,1,u,3>
- 3703260634U, // <4,4,2,0>: Cost 4 vext2 <2,0,4,4>, <2,0,4,4>
- 3765652499U, // <4,4,2,1>: Cost 4 vext3 <1,2,3,4>, <4,2,1,4>
- 2644117096U, // <4,4,2,2>: Cost 3 vext2 <4,4,4,4>, <2,2,2,2>
- 2631509709U, // <4,4,2,3>: Cost 3 vext2 <2,3,4,4>, <2,3,4,4>
- 2644117269U, // <4,4,2,4>: Cost 3 vext2 <4,4,4,4>, <2,4,3,4>
- 3705251698U, // <4,4,2,5>: Cost 4 vext2 <2,3,4,4>, <2,5,4,7>
- 2710047808U, // <4,4,2,6>: Cost 3 vext3 <4,2,6,4>, <4,2,6,4>
- 3783863369U, // <4,4,2,7>: Cost 4 vext3 <4,2,7,4>, <4,2,7,4>
- 2634827874U, // <4,4,2,u>: Cost 3 vext2 <2,u,4,4>, <2,u,4,4>
- 2644117654U, // <4,4,3,0>: Cost 3 vext2 <4,4,4,4>, <3,0,1,2>
- 3638797210U, // <4,4,3,1>: Cost 4 vext1 <2,4,4,3>, <1,2,3,4>
- 3638798082U, // <4,4,3,2>: Cost 4 vext1 <2,4,4,3>, <2,4,1,3>
- 2637482406U, // <4,4,3,3>: Cost 3 vext2 <3,3,4,4>, <3,3,4,4>
- 2638146039U, // <4,4,3,4>: Cost 3 vext2 <3,4,4,4>, <3,4,4,4>
- 3913287374U, // <4,4,3,5>: Cost 4 vuzpr <3,4,5,4>, <2,3,4,5>
- 3765652625U, // <4,4,3,6>: Cost 4 vext3 <1,2,3,4>, <4,3,6,4>
- 3713878762U, // <4,4,3,7>: Cost 4 vext2 <3,7,4,4>, <3,7,4,4>
- 2637482406U, // <4,4,3,u>: Cost 3 vext2 <3,3,4,4>, <3,3,4,4>
- 1503264870U, // <4,4,4,0>: Cost 2 vext1 <4,4,4,4>, LHS
- 2577007514U, // <4,4,4,1>: Cost 3 vext1 <4,4,4,4>, <1,2,3,4>
- 2577008232U, // <4,4,4,2>: Cost 3 vext1 <4,4,4,4>, <2,2,2,2>
- 2571037175U, // <4,4,4,3>: Cost 3 vext1 <3,4,4,4>, <3,4,4,4>
- 161926454U, // <4,4,4,4>: Cost 1 vdup0 RHS
- 1570377014U, // <4,4,4,5>: Cost 2 vext2 <4,4,4,4>, RHS
- 2779680054U, // <4,4,4,6>: Cost 3 vuzpl <4,6,4,6>, RHS
- 2594927963U, // <4,4,4,7>: Cost 3 vext1 <7,4,4,4>, <7,4,4,4>
- 161926454U, // <4,4,4,u>: Cost 1 vdup0 RHS
- 2571042918U, // <4,4,5,0>: Cost 3 vext1 <3,4,4,5>, LHS
- 2571043738U, // <4,4,5,1>: Cost 3 vext1 <3,4,4,5>, <1,2,3,4>
- 3638814495U, // <4,4,5,2>: Cost 4 vext1 <2,4,4,5>, <2,4,4,5>
- 2571045368U, // <4,4,5,3>: Cost 3 vext1 <3,4,4,5>, <3,4,4,5>
- 2571046198U, // <4,4,5,4>: Cost 3 vext1 <3,4,4,5>, RHS
- 1839648054U, // <4,4,5,5>: Cost 2 vzipl RHS, RHS
- 1618169142U, // <4,4,5,6>: Cost 2 vext3 <1,2,3,4>, RHS
- 2594936156U, // <4,4,5,7>: Cost 3 vext1 <7,4,4,5>, <7,4,4,5>
- 1618169160U, // <4,4,5,u>: Cost 2 vext3 <1,2,3,4>, RHS
- 2553135206U, // <4,4,6,0>: Cost 3 vext1 <0,4,4,6>, LHS
- 3626877686U, // <4,4,6,1>: Cost 4 vext1 <0,4,4,6>, <1,0,3,2>
- 2565080782U, // <4,4,6,2>: Cost 3 vext1 <2,4,4,6>, <2,3,4,5>
- 2571053561U, // <4,4,6,3>: Cost 3 vext1 <3,4,4,6>, <3,4,4,6>
- 2553138486U, // <4,4,6,4>: Cost 3 vext1 <0,4,4,6>, RHS
- 2241555675U, // <4,4,6,5>: Cost 3 vrev <4,4,5,6>
- 1973865782U, // <4,4,6,6>: Cost 2 vtrnl RHS, RHS
- 2658055029U, // <4,4,6,7>: Cost 3 vext2 <6,7,4,4>, <6,7,4,4>
- 1973865800U, // <4,4,6,u>: Cost 2 vtrnl RHS, RHS
- 2644120570U, // <4,4,7,0>: Cost 3 vext2 <4,4,4,4>, <7,0,1,2>
- 3638829978U, // <4,4,7,1>: Cost 4 vext1 <2,4,4,7>, <1,2,3,4>
- 3638830881U, // <4,4,7,2>: Cost 4 vext1 <2,4,4,7>, <2,4,4,7>
- 3735115018U, // <4,4,7,3>: Cost 4 vext2 <7,3,4,4>, <7,3,4,4>
- 2662036827U, // <4,4,7,4>: Cost 3 vext2 <7,4,4,4>, <7,4,4,4>
- 2713292236U, // <4,4,7,5>: Cost 3 vext3 <4,7,5,4>, <4,7,5,4>
- 2713365973U, // <4,4,7,6>: Cost 3 vext3 <4,7,6,4>, <4,7,6,4>
- 2644121196U, // <4,4,7,7>: Cost 3 vext2 <4,4,4,4>, <7,7,7,7>
- 2662036827U, // <4,4,7,u>: Cost 3 vext2 <7,4,4,4>, <7,4,4,4>
- 1503297638U, // <4,4,u,0>: Cost 2 vext1 <4,4,4,u>, LHS
- 1570379566U, // <4,4,u,1>: Cost 2 vext2 <4,4,4,4>, LHS
- 2779682606U, // <4,4,u,2>: Cost 3 vuzpl <4,6,4,6>, LHS
- 2571069947U, // <4,4,u,3>: Cost 3 vext1 <3,4,4,u>, <3,4,4,u>
- 161926454U, // <4,4,u,4>: Cost 1 vdup0 RHS
- 1841638710U, // <4,4,u,5>: Cost 2 vzipl RHS, RHS
- 1618169385U, // <4,4,u,6>: Cost 2 vext3 <1,2,3,4>, RHS
- 2594960735U, // <4,4,u,7>: Cost 3 vext1 <7,4,4,u>, <7,4,4,u>
- 161926454U, // <4,4,u,u>: Cost 1 vdup0 RHS
- 2631516160U, // <4,5,0,0>: Cost 3 vext2 <2,3,4,5>, <0,0,0,0>
- 1557774438U, // <4,5,0,1>: Cost 2 vext2 <2,3,4,5>, LHS
- 2618908875U, // <4,5,0,2>: Cost 3 vext2 <0,2,4,5>, <0,2,4,5>
- 2571078140U, // <4,5,0,3>: Cost 3 vext1 <3,4,5,0>, <3,4,5,0>
- 2626871634U, // <4,5,0,4>: Cost 3 vext2 <1,5,4,5>, <0,4,1,5>
- 3705258414U, // <4,5,0,5>: Cost 4 vext2 <2,3,4,5>, <0,5,2,7>
- 2594968438U, // <4,5,0,6>: Cost 3 vext1 <7,4,5,0>, <6,7,4,5>
- 2594968928U, // <4,5,0,7>: Cost 3 vext1 <7,4,5,0>, <7,4,5,0>
- 1557775005U, // <4,5,0,u>: Cost 2 vext2 <2,3,4,5>, LHS
- 2631516918U, // <4,5,1,0>: Cost 3 vext2 <2,3,4,5>, <1,0,3,2>
- 2624217939U, // <4,5,1,1>: Cost 3 vext2 <1,1,4,5>, <1,1,4,5>
- 2631517078U, // <4,5,1,2>: Cost 3 vext2 <2,3,4,5>, <1,2,3,0>
- 2821341286U, // <4,5,1,3>: Cost 3 vuzpr <0,4,1,5>, LHS
- 3895086054U, // <4,5,1,4>: Cost 4 vuzpr <0,4,1,5>, <4,1,5,4>
- 2626872471U, // <4,5,1,5>: Cost 3 vext2 <1,5,4,5>, <1,5,4,5>
- 3895083131U, // <4,5,1,6>: Cost 4 vuzpr <0,4,1,5>, <0,1,4,6>
- 2718748368U, // <4,5,1,7>: Cost 3 vext3 <5,6,7,4>, <5,1,7,3>
- 2821341291U, // <4,5,1,u>: Cost 3 vuzpr <0,4,1,5>, LHS
- 2571092070U, // <4,5,2,0>: Cost 3 vext1 <3,4,5,2>, LHS
- 3699287585U, // <4,5,2,1>: Cost 4 vext2 <1,3,4,5>, <2,1,3,3>
- 2630854269U, // <4,5,2,2>: Cost 3 vext2 <2,2,4,5>, <2,2,4,5>
- 1557776078U, // <4,5,2,3>: Cost 2 vext2 <2,3,4,5>, <2,3,4,5>
- 2631517974U, // <4,5,2,4>: Cost 3 vext2 <2,3,4,5>, <2,4,3,5>
- 3692652384U, // <4,5,2,5>: Cost 4 vext2 <0,2,4,5>, <2,5,2,7>
- 2631518138U, // <4,5,2,6>: Cost 3 vext2 <2,3,4,5>, <2,6,3,7>
- 4164013366U, // <4,5,2,7>: Cost 4 vtrnr <0,4,u,2>, RHS
- 1561094243U, // <4,5,2,u>: Cost 2 vext2 <2,u,4,5>, <2,u,4,5>
- 2631518358U, // <4,5,3,0>: Cost 3 vext2 <2,3,4,5>, <3,0,1,2>
- 3895084710U, // <4,5,3,1>: Cost 4 vuzpr <0,4,1,5>, <2,3,0,1>
- 2631518540U, // <4,5,3,2>: Cost 3 vext2 <2,3,4,5>, <3,2,3,4>
- 2631518620U, // <4,5,3,3>: Cost 3 vext2 <2,3,4,5>, <3,3,3,3>
- 2631518716U, // <4,5,3,4>: Cost 3 vext2 <2,3,4,5>, <3,4,5,0>
- 2631518784U, // <4,5,3,5>: Cost 3 vext2 <2,3,4,5>, <3,5,3,5>
- 2658060980U, // <4,5,3,6>: Cost 3 vext2 <6,7,4,5>, <3,6,7,4>
- 2640145131U, // <4,5,3,7>: Cost 3 vext2 <3,7,4,5>, <3,7,4,5>
- 2631519006U, // <4,5,3,u>: Cost 3 vext2 <2,3,4,5>, <3,u,1,2>
- 2571108454U, // <4,5,4,0>: Cost 3 vext1 <3,4,5,4>, LHS
- 3632907342U, // <4,5,4,1>: Cost 4 vext1 <1,4,5,4>, <1,4,5,4>
- 2571110094U, // <4,5,4,2>: Cost 3 vext1 <3,4,5,4>, <2,3,4,5>
- 2571110912U, // <4,5,4,3>: Cost 3 vext1 <3,4,5,4>, <3,4,5,4>
- 2571111734U, // <4,5,4,4>: Cost 3 vext1 <3,4,5,4>, RHS
- 1557777718U, // <4,5,4,5>: Cost 2 vext2 <2,3,4,5>, RHS
- 2645454195U, // <4,5,4,6>: Cost 3 vext2 <4,6,4,5>, <4,6,4,5>
- 2718748614U, // <4,5,4,7>: Cost 3 vext3 <5,6,7,4>, <5,4,7,6>
- 1557777961U, // <4,5,4,u>: Cost 2 vext2 <2,3,4,5>, RHS
- 1503346790U, // <4,5,5,0>: Cost 2 vext1 <4,4,5,5>, LHS
- 2913398480U, // <4,5,5,1>: Cost 3 vzipl RHS, <5,1,7,3>
- 2631519998U, // <4,5,5,2>: Cost 3 vext2 <2,3,4,5>, <5,2,3,4>
- 2577090710U, // <4,5,5,3>: Cost 3 vext1 <4,4,5,5>, <3,0,1,2>
- 1503349978U, // <4,5,5,4>: Cost 2 vext1 <4,4,5,5>, <4,4,5,5>
- 2631520260U, // <4,5,5,5>: Cost 3 vext2 <2,3,4,5>, <5,5,5,5>
- 2913390690U, // <4,5,5,6>: Cost 3 vzipl RHS, <5,6,7,0>
- 2821344566U, // <4,5,5,7>: Cost 3 vuzpr <0,4,1,5>, RHS
- 1503352622U, // <4,5,5,u>: Cost 2 vext1 <4,4,5,5>, LHS
- 1497383014U, // <4,5,6,0>: Cost 2 vext1 <3,4,5,6>, LHS
- 2559181904U, // <4,5,6,1>: Cost 3 vext1 <1,4,5,6>, <1,4,5,6>
- 2565154601U, // <4,5,6,2>: Cost 3 vext1 <2,4,5,6>, <2,4,5,6>
- 1497385474U, // <4,5,6,3>: Cost 2 vext1 <3,4,5,6>, <3,4,5,6>
- 1497386294U, // <4,5,6,4>: Cost 2 vext1 <3,4,5,6>, RHS
- 3047608324U, // <4,5,6,5>: Cost 3 vtrnl RHS, <5,5,5,5>
- 2571129656U, // <4,5,6,6>: Cost 3 vext1 <3,4,5,6>, <6,6,6,6>
- 27705344U, // <4,5,6,7>: Cost 0 copy RHS
- 27705344U, // <4,5,6,u>: Cost 0 copy RHS
- 2565161062U, // <4,5,7,0>: Cost 3 vext1 <2,4,5,7>, LHS
- 2565161882U, // <4,5,7,1>: Cost 3 vext1 <2,4,5,7>, <1,2,3,4>
- 2565162794U, // <4,5,7,2>: Cost 3 vext1 <2,4,5,7>, <2,4,5,7>
- 2661381387U, // <4,5,7,3>: Cost 3 vext2 <7,3,4,5>, <7,3,4,5>
- 2565164342U, // <4,5,7,4>: Cost 3 vext1 <2,4,5,7>, RHS
- 2718748840U, // <4,5,7,5>: Cost 3 vext3 <5,6,7,4>, <5,7,5,7>
- 2718748846U, // <4,5,7,6>: Cost 3 vext3 <5,6,7,4>, <5,7,6,4>
- 2719412407U, // <4,5,7,7>: Cost 3 vext3 <5,7,7,4>, <5,7,7,4>
- 2565166894U, // <4,5,7,u>: Cost 3 vext1 <2,4,5,7>, LHS
- 1497399398U, // <4,5,u,0>: Cost 2 vext1 <3,4,5,u>, LHS
- 1557780270U, // <4,5,u,1>: Cost 2 vext2 <2,3,4,5>, LHS
- 2631522181U, // <4,5,u,2>: Cost 3 vext2 <2,3,4,5>, <u,2,3,0>
- 1497401860U, // <4,5,u,3>: Cost 2 vext1 <3,4,5,u>, <3,4,5,u>
- 1497402678U, // <4,5,u,4>: Cost 2 vext1 <3,4,5,u>, RHS
- 1557780634U, // <4,5,u,5>: Cost 2 vext2 <2,3,4,5>, RHS
- 2631522512U, // <4,5,u,6>: Cost 3 vext2 <2,3,4,5>, <u,6,3,7>
- 27705344U, // <4,5,u,7>: Cost 0 copy RHS
- 27705344U, // <4,5,u,u>: Cost 0 copy RHS
- 2618916864U, // <4,6,0,0>: Cost 3 vext2 <0,2,4,6>, <0,0,0,0>
- 1545175142U, // <4,6,0,1>: Cost 2 vext2 <0,2,4,6>, LHS
- 1545175244U, // <4,6,0,2>: Cost 2 vext2 <0,2,4,6>, <0,2,4,6>
- 3692658940U, // <4,6,0,3>: Cost 4 vext2 <0,2,4,6>, <0,3,1,0>
- 2618917202U, // <4,6,0,4>: Cost 3 vext2 <0,2,4,6>, <0,4,1,5>
- 3852910806U, // <4,6,0,5>: Cost 4 vuzpl RHS, <0,2,5,7>
- 2253525648U, // <4,6,0,6>: Cost 3 vrev <6,4,6,0>
- 4040764726U, // <4,6,0,7>: Cost 4 vzipr <2,3,4,0>, RHS
- 1545175709U, // <4,6,0,u>: Cost 2 vext2 <0,2,4,6>, LHS
- 2618917622U, // <4,6,1,0>: Cost 3 vext2 <0,2,4,6>, <1,0,3,2>
- 2618917684U, // <4,6,1,1>: Cost 3 vext2 <0,2,4,6>, <1,1,1,1>
- 2618917782U, // <4,6,1,2>: Cost 3 vext2 <0,2,4,6>, <1,2,3,0>
- 2618917848U, // <4,6,1,3>: Cost 3 vext2 <0,2,4,6>, <1,3,1,3>
- 3692659773U, // <4,6,1,4>: Cost 4 vext2 <0,2,4,6>, <1,4,3,5>
- 2618918032U, // <4,6,1,5>: Cost 3 vext2 <0,2,4,6>, <1,5,3,7>
- 3692659937U, // <4,6,1,6>: Cost 4 vext2 <0,2,4,6>, <1,6,3,7>
- 4032146742U, // <4,6,1,7>: Cost 4 vzipr <0,u,4,1>, RHS
- 2618918253U, // <4,6,1,u>: Cost 3 vext2 <0,2,4,6>, <1,u,1,3>
- 2618918380U, // <4,6,2,0>: Cost 3 vext2 <0,2,4,6>, <2,0,6,4>
- 2618918460U, // <4,6,2,1>: Cost 3 vext2 <0,2,4,6>, <2,1,6,3>
- 2618918504U, // <4,6,2,2>: Cost 3 vext2 <0,2,4,6>, <2,2,2,2>
- 2618918566U, // <4,6,2,3>: Cost 3 vext2 <0,2,4,6>, <2,3,0,1>
- 2618918679U, // <4,6,2,4>: Cost 3 vext2 <0,2,4,6>, <2,4,3,6>
- 2618918788U, // <4,6,2,5>: Cost 3 vext2 <0,2,4,6>, <2,5,6,7>
- 2618918842U, // <4,6,2,6>: Cost 3 vext2 <0,2,4,6>, <2,6,3,7>
- 2718749178U, // <4,6,2,7>: Cost 3 vext3 <5,6,7,4>, <6,2,7,3>
- 2618918971U, // <4,6,2,u>: Cost 3 vext2 <0,2,4,6>, <2,u,0,1>
- 2618919062U, // <4,6,3,0>: Cost 3 vext2 <0,2,4,6>, <3,0,1,2>
- 2636171526U, // <4,6,3,1>: Cost 3 vext2 <3,1,4,6>, <3,1,4,6>
- 3692661057U, // <4,6,3,2>: Cost 4 vext2 <0,2,4,6>, <3,2,2,2>
- 2618919324U, // <4,6,3,3>: Cost 3 vext2 <0,2,4,6>, <3,3,3,3>
- 2618919426U, // <4,6,3,4>: Cost 3 vext2 <0,2,4,6>, <3,4,5,6>
- 2638826058U, // <4,6,3,5>: Cost 3 vext2 <3,5,4,6>, <3,5,4,6>
- 3913303030U, // <4,6,3,6>: Cost 4 vuzpr <3,4,5,6>, <1,3,4,6>
- 2722730572U, // <4,6,3,7>: Cost 3 vext3 <6,3,7,4>, <6,3,7,4>
- 2618919710U, // <4,6,3,u>: Cost 3 vext2 <0,2,4,6>, <3,u,1,2>
- 2565210214U, // <4,6,4,0>: Cost 3 vext1 <2,4,6,4>, LHS
- 2718749286U, // <4,6,4,1>: Cost 3 vext3 <5,6,7,4>, <6,4,1,3>
- 2565211952U, // <4,6,4,2>: Cost 3 vext1 <2,4,6,4>, <2,4,6,4>
- 2571184649U, // <4,6,4,3>: Cost 3 vext1 <3,4,6,4>, <3,4,6,4>
- 2565213494U, // <4,6,4,4>: Cost 3 vext1 <2,4,6,4>, RHS
- 1545178422U, // <4,6,4,5>: Cost 2 vext2 <0,2,4,6>, RHS
- 1705430326U, // <4,6,4,6>: Cost 2 vuzpl RHS, RHS
- 2595075437U, // <4,6,4,7>: Cost 3 vext1 <7,4,6,4>, <7,4,6,4>
- 1545178665U, // <4,6,4,u>: Cost 2 vext2 <0,2,4,6>, RHS
- 2565218406U, // <4,6,5,0>: Cost 3 vext1 <2,4,6,5>, LHS
- 2645462736U, // <4,6,5,1>: Cost 3 vext2 <4,6,4,6>, <5,1,7,3>
- 2913399290U, // <4,6,5,2>: Cost 3 vzipl RHS, <6,2,7,3>
- 3913305394U, // <4,6,5,3>: Cost 4 vuzpr <3,4,5,6>, <4,5,6,3>
- 2645462982U, // <4,6,5,4>: Cost 3 vext2 <4,6,4,6>, <5,4,7,6>
- 2779172868U, // <4,6,5,5>: Cost 3 vuzpl RHS, <5,5,5,5>
- 2913391416U, // <4,6,5,6>: Cost 3 vzipl RHS, <6,6,6,6>
- 2821426486U, // <4,6,5,7>: Cost 3 vuzpr <0,4,2,6>, RHS
- 2821426487U, // <4,6,5,u>: Cost 3 vuzpr <0,4,2,6>, RHS
- 1503428710U, // <4,6,6,0>: Cost 2 vext1 <4,4,6,6>, LHS
- 2577171190U, // <4,6,6,1>: Cost 3 vext1 <4,4,6,6>, <1,0,3,2>
- 2645463546U, // <4,6,6,2>: Cost 3 vext2 <4,6,4,6>, <6,2,7,3>
- 2577172630U, // <4,6,6,3>: Cost 3 vext1 <4,4,6,6>, <3,0,1,2>
- 1503431908U, // <4,6,6,4>: Cost 2 vext1 <4,4,6,6>, <4,4,6,6>
- 2253501069U, // <4,6,6,5>: Cost 3 vrev <6,4,5,6>
- 2618921784U, // <4,6,6,6>: Cost 3 vext2 <0,2,4,6>, <6,6,6,6>
- 2954464566U, // <4,6,6,7>: Cost 3 vzipr <0,2,4,6>, RHS
- 1503434542U, // <4,6,6,u>: Cost 2 vext1 <4,4,6,6>, LHS
- 2645464058U, // <4,6,7,0>: Cost 3 vext2 <4,6,4,6>, <7,0,1,2>
- 2779173882U, // <4,6,7,1>: Cost 3 vuzpl RHS, <7,0,1,2>
- 3638978355U, // <4,6,7,2>: Cost 4 vext1 <2,4,6,7>, <2,4,6,7>
- 2725090156U, // <4,6,7,3>: Cost 3 vext3 <6,7,3,4>, <6,7,3,4>
- 2645464422U, // <4,6,7,4>: Cost 3 vext2 <4,6,4,6>, <7,4,5,6>
- 2779174246U, // <4,6,7,5>: Cost 3 vuzpl RHS, <7,4,5,6>
- 3852915914U, // <4,6,7,6>: Cost 4 vuzpl RHS, <7,2,6,3>
- 2779174508U, // <4,6,7,7>: Cost 3 vuzpl RHS, <7,7,7,7>
- 2779173945U, // <4,6,7,u>: Cost 3 vuzpl RHS, <7,0,u,2>
- 1503445094U, // <4,6,u,0>: Cost 2 vext1 <4,4,6,u>, LHS
- 1545180974U, // <4,6,u,1>: Cost 2 vext2 <0,2,4,6>, LHS
- 1705432878U, // <4,6,u,2>: Cost 2 vuzpl RHS, LHS
- 2618922940U, // <4,6,u,3>: Cost 3 vext2 <0,2,4,6>, <u,3,0,1>
- 1503448294U, // <4,6,u,4>: Cost 2 vext1 <4,4,6,u>, <4,4,6,u>
- 1545181338U, // <4,6,u,5>: Cost 2 vext2 <0,2,4,6>, RHS
- 1705433242U, // <4,6,u,6>: Cost 2 vuzpl RHS, RHS
- 2954480950U, // <4,6,u,7>: Cost 3 vzipr <0,2,4,u>, RHS
- 1545181541U, // <4,6,u,u>: Cost 2 vext2 <0,2,4,6>, LHS
- 3706601472U, // <4,7,0,0>: Cost 4 vext2 <2,5,4,7>, <0,0,0,0>
- 2632859750U, // <4,7,0,1>: Cost 3 vext2 <2,5,4,7>, LHS
- 2726343685U, // <4,7,0,2>: Cost 3 vext3 <7,0,2,4>, <7,0,2,4>
- 3701293312U, // <4,7,0,3>: Cost 4 vext2 <1,6,4,7>, <0,3,1,4>
- 3706601810U, // <4,7,0,4>: Cost 4 vext2 <2,5,4,7>, <0,4,1,5>
- 2259424608U, // <4,7,0,5>: Cost 3 vrev <7,4,5,0>
- 3695321617U, // <4,7,0,6>: Cost 4 vext2 <0,6,4,7>, <0,6,4,7>
- 3800454194U, // <4,7,0,7>: Cost 4 vext3 <7,0,7,4>, <7,0,7,4>
- 2632860317U, // <4,7,0,u>: Cost 3 vext2 <2,5,4,7>, LHS
- 2259064116U, // <4,7,1,0>: Cost 3 vrev <7,4,0,1>
- 3700630324U, // <4,7,1,1>: Cost 4 vext2 <1,5,4,7>, <1,1,1,1>
- 2632860570U, // <4,7,1,2>: Cost 3 vext2 <2,5,4,7>, <1,2,3,4>
- 3769635936U, // <4,7,1,3>: Cost 4 vext3 <1,u,3,4>, <7,1,3,5>
- 3656920374U, // <4,7,1,4>: Cost 4 vext1 <5,4,7,1>, RHS
- 3700630681U, // <4,7,1,5>: Cost 4 vext2 <1,5,4,7>, <1,5,4,7>
- 3701294314U, // <4,7,1,6>: Cost 4 vext2 <1,6,4,7>, <1,6,4,7>
- 3793818754U, // <4,7,1,7>: Cost 4 vext3 <5,u,7,4>, <7,1,7,3>
- 2259654012U, // <4,7,1,u>: Cost 3 vrev <7,4,u,1>
- 3656925286U, // <4,7,2,0>: Cost 4 vext1 <5,4,7,2>, LHS
- 3706603050U, // <4,7,2,1>: Cost 4 vext2 <2,5,4,7>, <2,1,4,3>
- 3706603112U, // <4,7,2,2>: Cost 4 vext2 <2,5,4,7>, <2,2,2,2>
- 2727744688U, // <4,7,2,3>: Cost 3 vext3 <7,2,3,4>, <7,2,3,4>
- 3705939745U, // <4,7,2,4>: Cost 4 vext2 <2,4,4,7>, <2,4,4,7>
- 2632861554U, // <4,7,2,5>: Cost 3 vext2 <2,5,4,7>, <2,5,4,7>
- 3706603450U, // <4,7,2,6>: Cost 4 vext2 <2,5,4,7>, <2,6,3,7>
- 3792491731U, // <4,7,2,7>: Cost 4 vext3 <5,6,7,4>, <7,2,7,3>
- 2634852453U, // <4,7,2,u>: Cost 3 vext2 <2,u,4,7>, <2,u,4,7>
- 3706603670U, // <4,7,3,0>: Cost 4 vext2 <2,5,4,7>, <3,0,1,2>
- 3662906266U, // <4,7,3,1>: Cost 4 vext1 <6,4,7,3>, <1,2,3,4>
- 3725183326U, // <4,7,3,2>: Cost 4 vext2 <5,6,4,7>, <3,2,5,4>
- 3706603932U, // <4,7,3,3>: Cost 4 vext2 <2,5,4,7>, <3,3,3,3>
- 3701295618U, // <4,7,3,4>: Cost 4 vext2 <1,6,4,7>, <3,4,5,6>
- 2638834251U, // <4,7,3,5>: Cost 3 vext2 <3,5,4,7>, <3,5,4,7>
- 2639497884U, // <4,7,3,6>: Cost 3 vext2 <3,6,4,7>, <3,6,4,7>
- 3802445093U, // <4,7,3,7>: Cost 4 vext3 <7,3,7,4>, <7,3,7,4>
- 2640825150U, // <4,7,3,u>: Cost 3 vext2 <3,u,4,7>, <3,u,4,7>
- 2718750004U, // <4,7,4,0>: Cost 3 vext3 <5,6,7,4>, <7,4,0,1>
- 3706604490U, // <4,7,4,1>: Cost 4 vext2 <2,5,4,7>, <4,1,2,3>
- 3656943474U, // <4,7,4,2>: Cost 4 vext1 <5,4,7,4>, <2,5,4,7>
- 3779884371U, // <4,7,4,3>: Cost 4 vext3 <3,5,7,4>, <7,4,3,5>
- 2259383643U, // <4,7,4,4>: Cost 3 vrev <7,4,4,4>
- 2632863030U, // <4,7,4,5>: Cost 3 vext2 <2,5,4,7>, RHS
- 2259531117U, // <4,7,4,6>: Cost 3 vrev <7,4,6,4>
- 3907340074U, // <4,7,4,7>: Cost 4 vuzpr <2,4,5,7>, <2,4,5,7>
- 2632863273U, // <4,7,4,u>: Cost 3 vext2 <2,5,4,7>, RHS
- 2913391610U, // <4,7,5,0>: Cost 3 vzipl RHS, <7,0,1,2>
- 3645006848U, // <4,7,5,1>: Cost 4 vext1 <3,4,7,5>, <1,3,5,7>
- 2589181646U, // <4,7,5,2>: Cost 3 vext1 <6,4,7,5>, <2,3,4,5>
- 3645008403U, // <4,7,5,3>: Cost 4 vext1 <3,4,7,5>, <3,4,7,5>
- 2913391974U, // <4,7,5,4>: Cost 3 vzipl RHS, <7,4,5,6>
- 2583211973U, // <4,7,5,5>: Cost 3 vext1 <5,4,7,5>, <5,4,7,5>
- 2589184670U, // <4,7,5,6>: Cost 3 vext1 <6,4,7,5>, <6,4,7,5>
- 2913392236U, // <4,7,5,7>: Cost 3 vzipl RHS, <7,7,7,7>
- 2913392258U, // <4,7,5,u>: Cost 3 vzipl RHS, <7,u,1,2>
- 1509474406U, // <4,7,6,0>: Cost 2 vext1 <5,4,7,6>, LHS
- 3047609338U, // <4,7,6,1>: Cost 3 vtrnl RHS, <7,0,1,2>
- 2583217768U, // <4,7,6,2>: Cost 3 vext1 <5,4,7,6>, <2,2,2,2>
- 2583218326U, // <4,7,6,3>: Cost 3 vext1 <5,4,7,6>, <3,0,1,2>
- 1509477686U, // <4,7,6,4>: Cost 2 vext1 <5,4,7,6>, RHS
- 1509478342U, // <4,7,6,5>: Cost 2 vext1 <5,4,7,6>, <5,4,7,6>
- 2583220730U, // <4,7,6,6>: Cost 3 vext1 <5,4,7,6>, <6,2,7,3>
- 3047609964U, // <4,7,6,7>: Cost 3 vtrnl RHS, <7,7,7,7>
- 1509480238U, // <4,7,6,u>: Cost 2 vext1 <5,4,7,6>, LHS
- 3650994278U, // <4,7,7,0>: Cost 4 vext1 <4,4,7,7>, LHS
- 3650995098U, // <4,7,7,1>: Cost 4 vext1 <4,4,7,7>, <1,2,3,4>
- 3650996010U, // <4,7,7,2>: Cost 4 vext1 <4,4,7,7>, <2,4,5,7>
- 3804804677U, // <4,7,7,3>: Cost 4 vext3 <7,7,3,4>, <7,7,3,4>
- 3650997486U, // <4,7,7,4>: Cost 4 vext1 <4,4,7,7>, <4,4,7,7>
- 2662725039U, // <4,7,7,5>: Cost 3 vext2 <7,5,4,7>, <7,5,4,7>
- 3662942880U, // <4,7,7,6>: Cost 4 vext1 <6,4,7,7>, <6,4,7,7>
- 2718750316U, // <4,7,7,7>: Cost 3 vext3 <5,6,7,4>, <7,7,7,7>
- 2664715938U, // <4,7,7,u>: Cost 3 vext2 <7,u,4,7>, <7,u,4,7>
- 1509490790U, // <4,7,u,0>: Cost 2 vext1 <5,4,7,u>, LHS
- 2632865582U, // <4,7,u,1>: Cost 3 vext2 <2,5,4,7>, LHS
- 2583234152U, // <4,7,u,2>: Cost 3 vext1 <5,4,7,u>, <2,2,2,2>
- 2583234710U, // <4,7,u,3>: Cost 3 vext1 <5,4,7,u>, <3,0,1,2>
- 1509494070U, // <4,7,u,4>: Cost 2 vext1 <5,4,7,u>, RHS
- 1509494728U, // <4,7,u,5>: Cost 2 vext1 <5,4,7,u>, <5,4,7,u>
- 2583237114U, // <4,7,u,6>: Cost 3 vext1 <5,4,7,u>, <6,2,7,3>
- 3047757420U, // <4,7,u,7>: Cost 3 vtrnl RHS, <7,7,7,7>
- 1509496622U, // <4,7,u,u>: Cost 2 vext1 <5,4,7,u>, LHS
- 2618933248U, // <4,u,0,0>: Cost 3 vext2 <0,2,4,u>, <0,0,0,0>
- 1545191526U, // <4,u,0,1>: Cost 2 vext2 <0,2,4,u>, LHS
- 1545191630U, // <4,u,0,2>: Cost 2 vext2 <0,2,4,u>, <0,2,4,u>
- 2691913445U, // <4,u,0,3>: Cost 3 vext3 <1,2,3,4>, <u,0,3,2>
- 2618933586U, // <4,u,0,4>: Cost 3 vext2 <0,2,4,u>, <0,4,1,5>
- 2265397305U, // <4,u,0,5>: Cost 3 vrev <u,4,5,0>
- 2595189625U, // <4,u,0,6>: Cost 3 vext1 <7,4,u,0>, <6,7,4,u>
- 2595190139U, // <4,u,0,7>: Cost 3 vext1 <7,4,u,0>, <7,4,u,0>
- 1545192093U, // <4,u,0,u>: Cost 2 vext2 <0,2,4,u>, LHS
- 2618934006U, // <4,u,1,0>: Cost 3 vext2 <0,2,4,u>, <1,0,3,2>
- 2618934068U, // <4,u,1,1>: Cost 3 vext2 <0,2,4,u>, <1,1,1,1>
- 1618171694U, // <4,u,1,2>: Cost 2 vext3 <1,2,3,4>, LHS
- 2618934232U, // <4,u,1,3>: Cost 3 vext2 <0,2,4,u>, <1,3,1,3>
- 2695894848U, // <4,u,1,4>: Cost 3 vext3 <1,u,3,4>, <u,1,4,3>
- 2618934416U, // <4,u,1,5>: Cost 3 vext2 <0,2,4,u>, <1,5,3,7>
- 3692676321U, // <4,u,1,6>: Cost 4 vext2 <0,2,4,u>, <1,6,3,7>
- 2718750555U, // <4,u,1,7>: Cost 3 vext3 <5,6,7,4>, <u,1,7,3>
- 1618171748U, // <4,u,1,u>: Cost 2 vext3 <1,2,3,4>, LHS
- 2553397350U, // <4,u,2,0>: Cost 3 vext1 <0,4,u,2>, LHS
- 2630215215U, // <4,u,2,1>: Cost 3 vext2 <2,1,4,u>, <2,1,4,u>
- 2618934888U, // <4,u,2,2>: Cost 3 vext2 <0,2,4,u>, <2,2,2,2>
- 1557800657U, // <4,u,2,3>: Cost 2 vext2 <2,3,4,u>, <2,3,4,u>
- 2618935065U, // <4,u,2,4>: Cost 3 vext2 <0,2,4,u>, <2,4,3,u>
- 2733864859U, // <4,u,2,5>: Cost 3 vext3 <u,2,5,4>, <u,2,5,4>
- 2618935226U, // <4,u,2,6>: Cost 3 vext2 <0,2,4,u>, <2,6,3,7>
- 2718750636U, // <4,u,2,7>: Cost 3 vext3 <5,6,7,4>, <u,2,7,3>
- 1561118822U, // <4,u,2,u>: Cost 2 vext2 <2,u,4,u>, <2,u,4,u>
- 2618935446U, // <4,u,3,0>: Cost 3 vext2 <0,2,4,u>, <3,0,1,2>
- 2779318422U, // <4,u,3,1>: Cost 3 vuzpl RHS, <3,0,1,2>
- 2636851545U, // <4,u,3,2>: Cost 3 vext2 <3,2,4,u>, <3,2,4,u>
- 2618935708U, // <4,u,3,3>: Cost 3 vext2 <0,2,4,u>, <3,3,3,3>
- 2618935810U, // <4,u,3,4>: Cost 3 vext2 <0,2,4,u>, <3,4,5,6>
- 2691913711U, // <4,u,3,5>: Cost 3 vext3 <1,2,3,4>, <u,3,5,7>
- 2588725862U, // <4,u,3,6>: Cost 3 vext1 <6,4,1,3>, <6,4,1,3>
- 2640169710U, // <4,u,3,7>: Cost 3 vext2 <3,7,4,u>, <3,7,4,u>
- 2618936094U, // <4,u,3,u>: Cost 3 vext2 <0,2,4,u>, <3,u,1,2>
- 1503559782U, // <4,u,4,0>: Cost 2 vext1 <4,4,u,4>, LHS
- 2692282391U, // <4,u,4,1>: Cost 3 vext3 <1,2,u,4>, <u,4,1,2>
- 2565359426U, // <4,u,4,2>: Cost 3 vext1 <2,4,u,4>, <2,4,u,4>
- 2571332123U, // <4,u,4,3>: Cost 3 vext1 <3,4,u,4>, <3,4,u,4>
- 161926454U, // <4,u,4,4>: Cost 1 vdup0 RHS
- 1545194806U, // <4,u,4,5>: Cost 2 vext2 <0,2,4,u>, RHS
- 1705577782U, // <4,u,4,6>: Cost 2 vuzpl RHS, RHS
- 2718750801U, // <4,u,4,7>: Cost 3 vext3 <5,6,7,4>, <u,4,7,6>
- 161926454U, // <4,u,4,u>: Cost 1 vdup0 RHS
- 1479164006U, // <4,u,5,0>: Cost 2 vext1 <0,4,1,5>, LHS
- 1839650606U, // <4,u,5,1>: Cost 2 vzipl RHS, LHS
- 2565367502U, // <4,u,5,2>: Cost 3 vext1 <2,4,u,5>, <2,3,4,5>
- 3089777309U, // <4,u,5,3>: Cost 3 vtrnr <0,4,1,5>, LHS
- 1479167286U, // <4,u,5,4>: Cost 2 vext1 <0,4,1,5>, RHS
- 1839650970U, // <4,u,5,5>: Cost 2 vzipl RHS, RHS
- 1618172058U, // <4,u,5,6>: Cost 2 vext3 <1,2,3,4>, RHS
- 3089780265U, // <4,u,5,7>: Cost 3 vtrnr <0,4,1,5>, RHS
- 1618172076U, // <4,u,5,u>: Cost 2 vext3 <1,2,3,4>, RHS
- 1479688294U, // <4,u,6,0>: Cost 2 vext1 <0,4,u,6>, LHS
- 2553430774U, // <4,u,6,1>: Cost 3 vext1 <0,4,u,6>, <1,0,3,2>
- 1973868334U, // <4,u,6,2>: Cost 2 vtrnl RHS, LHS
- 1497606685U, // <4,u,6,3>: Cost 2 vext1 <3,4,u,6>, <3,4,u,6>
- 1479691574U, // <4,u,6,4>: Cost 2 vext1 <0,4,u,6>, RHS
- 1509552079U, // <4,u,6,5>: Cost 2 vext1 <5,4,u,6>, <5,4,u,6>
- 1973868698U, // <4,u,6,6>: Cost 2 vtrnl RHS, RHS
- 27705344U, // <4,u,6,7>: Cost 0 copy RHS
- 27705344U, // <4,u,6,u>: Cost 0 copy RHS
- 2565382246U, // <4,u,7,0>: Cost 3 vext1 <2,4,u,7>, LHS
- 2565383066U, // <4,u,7,1>: Cost 3 vext1 <2,4,u,7>, <1,2,3,4>
- 2565384005U, // <4,u,7,2>: Cost 3 vext1 <2,4,u,7>, <2,4,u,7>
- 2661405966U, // <4,u,7,3>: Cost 3 vext2 <7,3,4,u>, <7,3,4,u>
- 2565385526U, // <4,u,7,4>: Cost 3 vext1 <2,4,u,7>, RHS
- 2779321702U, // <4,u,7,5>: Cost 3 vuzpl RHS, <7,4,5,6>
- 2589274793U, // <4,u,7,6>: Cost 3 vext1 <6,4,u,7>, <6,4,u,7>
- 2779321964U, // <4,u,7,7>: Cost 3 vuzpl RHS, <7,7,7,7>
- 2565388078U, // <4,u,7,u>: Cost 3 vext1 <2,4,u,7>, LHS
- 1479704678U, // <4,u,u,0>: Cost 2 vext1 <0,4,u,u>, LHS
- 1545197358U, // <4,u,u,1>: Cost 2 vext2 <0,2,4,u>, LHS
- 1618172261U, // <4,u,u,2>: Cost 2 vext3 <1,2,3,4>, LHS
- 1497623071U, // <4,u,u,3>: Cost 2 vext1 <3,4,u,u>, <3,4,u,u>
- 161926454U, // <4,u,u,4>: Cost 1 vdup0 RHS
- 1545197722U, // <4,u,u,5>: Cost 2 vext2 <0,2,4,u>, RHS
- 1618172301U, // <4,u,u,6>: Cost 2 vext3 <1,2,3,4>, RHS
- 27705344U, // <4,u,u,7>: Cost 0 copy RHS
- 27705344U, // <4,u,u,u>: Cost 0 copy RHS
- 2687123456U, // <5,0,0,0>: Cost 3 vext3 <0,4,1,5>, <0,0,0,0>
- 2687123466U, // <5,0,0,1>: Cost 3 vext3 <0,4,1,5>, <0,0,1,1>
- 2687123476U, // <5,0,0,2>: Cost 3 vext3 <0,4,1,5>, <0,0,2,2>
- 3710599434U, // <5,0,0,3>: Cost 4 vext2 <3,2,5,0>, <0,3,2,5>
- 2642166098U, // <5,0,0,4>: Cost 3 vext2 <4,1,5,0>, <0,4,1,5>
- 3657060306U, // <5,0,0,5>: Cost 4 vext1 <5,5,0,0>, <5,5,0,0>
- 3292094923U, // <5,0,0,6>: Cost 4 vrev <0,5,6,0>
- 3669005700U, // <5,0,0,7>: Cost 4 vext1 <7,5,0,0>, <7,5,0,0>
- 2687123530U, // <5,0,0,u>: Cost 3 vext3 <0,4,1,5>, <0,0,u,2>
- 2559434854U, // <5,0,1,0>: Cost 3 vext1 <1,5,0,1>, LHS
- 2559435887U, // <5,0,1,1>: Cost 3 vext1 <1,5,0,1>, <1,5,0,1>
- 1613381734U, // <5,0,1,2>: Cost 2 vext3 <0,4,1,5>, LHS
- 3698656256U, // <5,0,1,3>: Cost 4 vext2 <1,2,5,0>, <1,3,5,7>
- 2559438134U, // <5,0,1,4>: Cost 3 vext1 <1,5,0,1>, RHS
- 2583326675U, // <5,0,1,5>: Cost 3 vext1 <5,5,0,1>, <5,5,0,1>
- 3715908851U, // <5,0,1,6>: Cost 4 vext2 <4,1,5,0>, <1,6,5,7>
- 3657069562U, // <5,0,1,7>: Cost 4 vext1 <5,5,0,1>, <7,0,1,2>
- 1613381788U, // <5,0,1,u>: Cost 2 vext3 <0,4,1,5>, LHS
- 2686017700U, // <5,0,2,0>: Cost 3 vext3 <0,2,4,5>, <0,2,0,2>
- 2685796528U, // <5,0,2,1>: Cost 3 vext3 <0,2,1,5>, <0,2,1,5>
- 2698625208U, // <5,0,2,2>: Cost 3 vext3 <2,3,4,5>, <0,2,2,4>
- 2685944002U, // <5,0,2,3>: Cost 3 vext3 <0,2,3,5>, <0,2,3,5>
- 2686017739U, // <5,0,2,4>: Cost 3 vext3 <0,2,4,5>, <0,2,4,5>
- 2686091476U, // <5,0,2,5>: Cost 3 vext3 <0,2,5,5>, <0,2,5,5>
- 2725167324U, // <5,0,2,6>: Cost 3 vext3 <6,7,4,5>, <0,2,6,4>
- 2595280230U, // <5,0,2,7>: Cost 3 vext1 <7,5,0,2>, <7,4,5,6>
- 2686312687U, // <5,0,2,u>: Cost 3 vext3 <0,2,u,5>, <0,2,u,5>
- 3760128248U, // <5,0,3,0>: Cost 4 vext3 <0,3,0,5>, <0,3,0,5>
- 3759685888U, // <5,0,3,1>: Cost 4 vext3 <0,2,3,5>, <0,3,1,4>
- 2686533898U, // <5,0,3,2>: Cost 3 vext3 <0,3,2,5>, <0,3,2,5>
- 3760349459U, // <5,0,3,3>: Cost 4 vext3 <0,3,3,5>, <0,3,3,5>
- 2638187004U, // <5,0,3,4>: Cost 3 vext2 <3,4,5,0>, <3,4,5,0>
- 3776348452U, // <5,0,3,5>: Cost 4 vext3 <3,0,4,5>, <0,3,5,4>
- 3713256094U, // <5,0,3,6>: Cost 4 vext2 <3,6,5,0>, <3,6,5,0>
- 3914064896U, // <5,0,3,7>: Cost 4 vuzpr <3,5,7,0>, <1,3,5,7>
- 2686976320U, // <5,0,3,u>: Cost 3 vext3 <0,3,u,5>, <0,3,u,5>
- 2559459430U, // <5,0,4,0>: Cost 3 vext1 <1,5,0,4>, LHS
- 1613381970U, // <5,0,4,1>: Cost 2 vext3 <0,4,1,5>, <0,4,1,5>
- 2687123804U, // <5,0,4,2>: Cost 3 vext3 <0,4,1,5>, <0,4,2,6>
- 3761013092U, // <5,0,4,3>: Cost 4 vext3 <0,4,3,5>, <0,4,3,5>
- 2559462710U, // <5,0,4,4>: Cost 3 vext1 <1,5,0,4>, RHS
- 2638187830U, // <5,0,4,5>: Cost 3 vext2 <3,4,5,0>, RHS
- 3761234303U, // <5,0,4,6>: Cost 4 vext3 <0,4,6,5>, <0,4,6,5>
- 2646150600U, // <5,0,4,7>: Cost 3 vext2 <4,7,5,0>, <4,7,5,0>
- 1613381970U, // <5,0,4,u>: Cost 2 vext3 <0,4,1,5>, <0,4,1,5>
- 3766763926U, // <5,0,5,0>: Cost 4 vext3 <1,4,0,5>, <0,5,0,1>
- 2919268454U, // <5,0,5,1>: Cost 3 vzipl <5,5,5,5>, LHS
- 3053486182U, // <5,0,5,2>: Cost 3 vtrnl <5,5,5,5>, LHS
- 3723210589U, // <5,0,5,3>: Cost 4 vext2 <5,3,5,0>, <5,3,5,0>
- 3766763966U, // <5,0,5,4>: Cost 4 vext3 <1,4,0,5>, <0,5,4,5>
- 2650796031U, // <5,0,5,5>: Cost 3 vext2 <5,5,5,0>, <5,5,5,0>
- 3719893090U, // <5,0,5,6>: Cost 4 vext2 <4,7,5,0>, <5,6,7,0>
- 3914067254U, // <5,0,5,7>: Cost 4 vuzpr <3,5,7,0>, RHS
- 2919269021U, // <5,0,5,u>: Cost 3 vzipl <5,5,5,5>, LHS
- 4047519744U, // <5,0,6,0>: Cost 4 vzipr <3,4,5,6>, <0,0,0,0>
- 2920038502U, // <5,0,6,1>: Cost 3 vzipl <5,6,7,0>, LHS
- 3759759871U, // <5,0,6,2>: Cost 4 vext3 <0,2,4,5>, <0,6,2,7>
- 3645164070U, // <5,0,6,3>: Cost 4 vext1 <3,5,0,6>, <3,5,0,6>
- 3762414095U, // <5,0,6,4>: Cost 4 vext3 <0,6,4,5>, <0,6,4,5>
- 3993780690U, // <5,0,6,5>: Cost 4 vzipl <5,6,7,0>, <0,5,6,7>
- 3719893816U, // <5,0,6,6>: Cost 4 vext2 <4,7,5,0>, <6,6,6,6>
- 2662077302U, // <5,0,6,7>: Cost 3 vext2 <7,4,5,0>, <6,7,4,5>
- 2920039069U, // <5,0,6,u>: Cost 3 vzipl <5,6,7,0>, LHS
- 2565455974U, // <5,0,7,0>: Cost 3 vext1 <2,5,0,7>, LHS
- 2565456790U, // <5,0,7,1>: Cost 3 vext1 <2,5,0,7>, <1,2,3,0>
- 2565457742U, // <5,0,7,2>: Cost 3 vext1 <2,5,0,7>, <2,5,0,7>
- 3639199894U, // <5,0,7,3>: Cost 4 vext1 <2,5,0,7>, <3,0,1,2>
- 2565459254U, // <5,0,7,4>: Cost 3 vext1 <2,5,0,7>, RHS
- 2589347938U, // <5,0,7,5>: Cost 3 vext1 <6,5,0,7>, <5,6,7,0>
- 2589348530U, // <5,0,7,6>: Cost 3 vext1 <6,5,0,7>, <6,5,0,7>
- 4188456422U, // <5,0,7,7>: Cost 4 vtrnr RHS, <2,0,5,7>
- 2565461806U, // <5,0,7,u>: Cost 3 vext1 <2,5,0,7>, LHS
- 2687124106U, // <5,0,u,0>: Cost 3 vext3 <0,4,1,5>, <0,u,0,2>
- 1616036502U, // <5,0,u,1>: Cost 2 vext3 <0,u,1,5>, <0,u,1,5>
- 1613382301U, // <5,0,u,2>: Cost 2 vext3 <0,4,1,5>, LHS
- 2689925800U, // <5,0,u,3>: Cost 3 vext3 <0,u,3,5>, <0,u,3,5>
- 2687124146U, // <5,0,u,4>: Cost 3 vext3 <0,4,1,5>, <0,u,4,6>
- 2638190746U, // <5,0,u,5>: Cost 3 vext2 <3,4,5,0>, RHS
- 2589356723U, // <5,0,u,6>: Cost 3 vext1 <6,5,0,u>, <6,5,0,u>
- 2595280230U, // <5,0,u,7>: Cost 3 vext1 <7,5,0,2>, <7,4,5,6>
- 1613382355U, // <5,0,u,u>: Cost 2 vext3 <0,4,1,5>, LHS
- 2646818816U, // <5,1,0,0>: Cost 3 vext2 <4,u,5,1>, <0,0,0,0>
- 1573077094U, // <5,1,0,1>: Cost 2 vext2 <4,u,5,1>, LHS
- 2646818980U, // <5,1,0,2>: Cost 3 vext2 <4,u,5,1>, <0,2,0,2>
- 2687124214U, // <5,1,0,3>: Cost 3 vext3 <0,4,1,5>, <1,0,3,2>
- 2641510738U, // <5,1,0,4>: Cost 3 vext2 <4,0,5,1>, <0,4,1,5>
- 2641510814U, // <5,1,0,5>: Cost 3 vext2 <4,0,5,1>, <0,5,1,0>
- 3720561142U, // <5,1,0,6>: Cost 4 vext2 <4,u,5,1>, <0,6,1,7>
- 3298141357U, // <5,1,0,7>: Cost 4 vrev <1,5,7,0>
- 1573077661U, // <5,1,0,u>: Cost 2 vext2 <4,u,5,1>, LHS
- 2223891567U, // <5,1,1,0>: Cost 3 vrev <1,5,0,1>
- 2687124276U, // <5,1,1,1>: Cost 3 vext3 <0,4,1,5>, <1,1,1,1>
- 2646819734U, // <5,1,1,2>: Cost 3 vext2 <4,u,5,1>, <1,2,3,0>
- 2687124296U, // <5,1,1,3>: Cost 3 vext3 <0,4,1,5>, <1,1,3,3>
- 2691326803U, // <5,1,1,4>: Cost 3 vext3 <1,1,4,5>, <1,1,4,5>
- 2691400540U, // <5,1,1,5>: Cost 3 vext3 <1,1,5,5>, <1,1,5,5>
- 3765216101U, // <5,1,1,6>: Cost 4 vext3 <1,1,6,5>, <1,1,6,5>
- 3765289838U, // <5,1,1,7>: Cost 4 vext3 <1,1,7,5>, <1,1,7,5>
- 2687124341U, // <5,1,1,u>: Cost 3 vext3 <0,4,1,5>, <1,1,u,3>
- 3297641584U, // <5,1,2,0>: Cost 4 vrev <1,5,0,2>
- 3763520391U, // <5,1,2,1>: Cost 4 vext3 <0,u,1,5>, <1,2,1,3>
- 2646820456U, // <5,1,2,2>: Cost 3 vext2 <4,u,5,1>, <2,2,2,2>
- 2687124374U, // <5,1,2,3>: Cost 3 vext3 <0,4,1,5>, <1,2,3,0>
- 2691990436U, // <5,1,2,4>: Cost 3 vext3 <1,2,4,5>, <1,2,4,5>
- 2687124395U, // <5,1,2,5>: Cost 3 vext3 <0,4,1,5>, <1,2,5,3>
- 2646820794U, // <5,1,2,6>: Cost 3 vext2 <4,u,5,1>, <2,6,3,7>
- 3808199610U, // <5,1,2,7>: Cost 4 vext3 <u,3,4,5>, <1,2,7,0>
- 2687124419U, // <5,1,2,u>: Cost 3 vext3 <0,4,1,5>, <1,2,u,0>
- 2577440870U, // <5,1,3,0>: Cost 3 vext1 <4,5,1,3>, LHS
- 2687124440U, // <5,1,3,1>: Cost 3 vext3 <0,4,1,5>, <1,3,1,3>
- 3759686627U, // <5,1,3,2>: Cost 4 vext3 <0,2,3,5>, <1,3,2,5>
- 2692580332U, // <5,1,3,3>: Cost 3 vext3 <1,3,3,5>, <1,3,3,5>
- 2687124469U, // <5,1,3,4>: Cost 3 vext3 <0,4,1,5>, <1,3,4,5>
- 2685207552U, // <5,1,3,5>: Cost 3 vext3 <0,1,2,5>, <1,3,5,7>
- 3760866313U, // <5,1,3,6>: Cost 4 vext3 <0,4,1,5>, <1,3,6,7>
- 2692875280U, // <5,1,3,7>: Cost 3 vext3 <1,3,7,5>, <1,3,7,5>
- 2687124503U, // <5,1,3,u>: Cost 3 vext3 <0,4,1,5>, <1,3,u,3>
- 1567771538U, // <5,1,4,0>: Cost 2 vext2 <4,0,5,1>, <4,0,5,1>
- 2693096491U, // <5,1,4,1>: Cost 3 vext3 <1,4,1,5>, <1,4,1,5>
- 2693170228U, // <5,1,4,2>: Cost 3 vext3 <1,4,2,5>, <1,4,2,5>
- 2687124541U, // <5,1,4,3>: Cost 3 vext3 <0,4,1,5>, <1,4,3,5>
- 2646822096U, // <5,1,4,4>: Cost 3 vext2 <4,u,5,1>, <4,4,4,4>
- 1573080374U, // <5,1,4,5>: Cost 2 vext2 <4,u,5,1>, RHS
- 2646822260U, // <5,1,4,6>: Cost 3 vext2 <4,u,5,1>, <4,6,4,6>
- 3298174129U, // <5,1,4,7>: Cost 4 vrev <1,5,7,4>
- 1573080602U, // <5,1,4,u>: Cost 2 vext2 <4,u,5,1>, <4,u,5,1>
- 2687124591U, // <5,1,5,0>: Cost 3 vext3 <0,4,1,5>, <1,5,0,1>
- 2646822543U, // <5,1,5,1>: Cost 3 vext2 <4,u,5,1>, <5,1,0,1>
- 3760866433U, // <5,1,5,2>: Cost 4 vext3 <0,4,1,5>, <1,5,2,1>
- 2687124624U, // <5,1,5,3>: Cost 3 vext3 <0,4,1,5>, <1,5,3,7>
- 2687124631U, // <5,1,5,4>: Cost 3 vext3 <0,4,1,5>, <1,5,4,5>
- 2646822916U, // <5,1,5,5>: Cost 3 vext2 <4,u,5,1>, <5,5,5,5>
- 2646823010U, // <5,1,5,6>: Cost 3 vext2 <4,u,5,1>, <5,6,7,0>
- 2646823080U, // <5,1,5,7>: Cost 3 vext2 <4,u,5,1>, <5,7,5,7>
- 2687124663U, // <5,1,5,u>: Cost 3 vext3 <0,4,1,5>, <1,5,u,1>
- 2553577574U, // <5,1,6,0>: Cost 3 vext1 <0,5,1,6>, LHS
- 3763520719U, // <5,1,6,1>: Cost 4 vext3 <0,u,1,5>, <1,6,1,7>
- 2646823418U, // <5,1,6,2>: Cost 3 vext2 <4,u,5,1>, <6,2,7,3>
- 3760866529U, // <5,1,6,3>: Cost 4 vext3 <0,4,1,5>, <1,6,3,7>
- 2553580854U, // <5,1,6,4>: Cost 3 vext1 <0,5,1,6>, RHS
- 2687124723U, // <5,1,6,5>: Cost 3 vext3 <0,4,1,5>, <1,6,5,7>
- 2646823736U, // <5,1,6,6>: Cost 3 vext2 <4,u,5,1>, <6,6,6,6>
- 2646823758U, // <5,1,6,7>: Cost 3 vext2 <4,u,5,1>, <6,7,0,1>
- 2646823839U, // <5,1,6,u>: Cost 3 vext2 <4,u,5,1>, <6,u,0,1>
- 2559557734U, // <5,1,7,0>: Cost 3 vext1 <1,5,1,7>, LHS
- 2559558452U, // <5,1,7,1>: Cost 3 vext1 <1,5,1,7>, <1,1,1,1>
- 2571503270U, // <5,1,7,2>: Cost 3 vext1 <3,5,1,7>, <2,3,0,1>
- 2040971366U, // <5,1,7,3>: Cost 2 vtrnr RHS, LHS
- 2559561014U, // <5,1,7,4>: Cost 3 vext1 <1,5,1,7>, RHS
- 2595393232U, // <5,1,7,5>: Cost 3 vext1 <7,5,1,7>, <5,1,7,3>
- 4188455035U, // <5,1,7,6>: Cost 4 vtrnr RHS, <0,1,4,6>
- 2646824556U, // <5,1,7,7>: Cost 3 vext2 <4,u,5,1>, <7,7,7,7>
- 2040971371U, // <5,1,7,u>: Cost 2 vtrnr RHS, LHS
- 1591662326U, // <5,1,u,0>: Cost 2 vext2 <u,0,5,1>, <u,0,5,1>
- 1573082926U, // <5,1,u,1>: Cost 2 vext2 <4,u,5,1>, LHS
- 2695824760U, // <5,1,u,2>: Cost 3 vext3 <1,u,2,5>, <1,u,2,5>
- 2040979558U, // <5,1,u,3>: Cost 2 vtrnr RHS, LHS
- 2687124874U, // <5,1,u,4>: Cost 3 vext3 <0,4,1,5>, <1,u,4,5>
- 1573083290U, // <5,1,u,5>: Cost 2 vext2 <4,u,5,1>, RHS
- 2646825168U, // <5,1,u,6>: Cost 3 vext2 <4,u,5,1>, <u,6,3,7>
- 2646825216U, // <5,1,u,7>: Cost 3 vext2 <4,u,5,1>, <u,7,0,1>
- 2040979563U, // <5,1,u,u>: Cost 2 vtrnr RHS, LHS
- 3702652928U, // <5,2,0,0>: Cost 4 vext2 <1,u,5,2>, <0,0,0,0>
- 2628911206U, // <5,2,0,1>: Cost 3 vext2 <1,u,5,2>, LHS
- 2641518756U, // <5,2,0,2>: Cost 3 vext2 <4,0,5,2>, <0,2,0,2>
- 3759760847U, // <5,2,0,3>: Cost 4 vext3 <0,2,4,5>, <2,0,3,2>
- 3760866775U, // <5,2,0,4>: Cost 4 vext3 <0,4,1,5>, <2,0,4,1>
- 3759539680U, // <5,2,0,5>: Cost 4 vext3 <0,2,1,5>, <2,0,5,1>
- 3760866796U, // <5,2,0,6>: Cost 4 vext3 <0,4,1,5>, <2,0,6,4>
- 3304114054U, // <5,2,0,7>: Cost 4 vrev <2,5,7,0>
- 2628911773U, // <5,2,0,u>: Cost 3 vext2 <1,u,5,2>, LHS
- 2623603464U, // <5,2,1,0>: Cost 3 vext2 <1,0,5,2>, <1,0,5,2>
- 3698008921U, // <5,2,1,1>: Cost 4 vext2 <1,1,5,2>, <1,1,5,2>
- 3633325603U, // <5,2,1,2>: Cost 4 vext1 <1,5,2,1>, <2,1,3,5>
- 2687125027U, // <5,2,1,3>: Cost 3 vext3 <0,4,1,5>, <2,1,3,5>
- 3633327414U, // <5,2,1,4>: Cost 4 vext1 <1,5,2,1>, RHS
- 3759539760U, // <5,2,1,5>: Cost 4 vext3 <0,2,1,5>, <2,1,5,0>
- 3760866876U, // <5,2,1,6>: Cost 4 vext3 <0,4,1,5>, <2,1,6,3>
- 3304122247U, // <5,2,1,7>: Cost 4 vrev <2,5,7,1>
- 2687125072U, // <5,2,1,u>: Cost 3 vext3 <0,4,1,5>, <2,1,u,5>
- 3633332326U, // <5,2,2,0>: Cost 4 vext1 <1,5,2,2>, LHS
- 3759760992U, // <5,2,2,1>: Cost 4 vext3 <0,2,4,5>, <2,2,1,3>
- 2687125096U, // <5,2,2,2>: Cost 3 vext3 <0,4,1,5>, <2,2,2,2>
- 2687125106U, // <5,2,2,3>: Cost 3 vext3 <0,4,1,5>, <2,2,3,3>
- 2697963133U, // <5,2,2,4>: Cost 3 vext3 <2,2,4,5>, <2,2,4,5>
- 3759466120U, // <5,2,2,5>: Cost 4 vext3 <0,2,0,5>, <2,2,5,7>
- 3760866960U, // <5,2,2,6>: Cost 4 vext3 <0,4,1,5>, <2,2,6,6>
- 3771926168U, // <5,2,2,7>: Cost 4 vext3 <2,2,7,5>, <2,2,7,5>
- 2687125151U, // <5,2,2,u>: Cost 3 vext3 <0,4,1,5>, <2,2,u,3>
- 2687125158U, // <5,2,3,0>: Cost 3 vext3 <0,4,1,5>, <2,3,0,1>
- 2698405555U, // <5,2,3,1>: Cost 3 vext3 <2,3,1,5>, <2,3,1,5>
- 2577516238U, // <5,2,3,2>: Cost 3 vext1 <4,5,2,3>, <2,3,4,5>
- 3759687365U, // <5,2,3,3>: Cost 4 vext3 <0,2,3,5>, <2,3,3,5>
- 1624884942U, // <5,2,3,4>: Cost 2 vext3 <2,3,4,5>, <2,3,4,5>
- 2698700503U, // <5,2,3,5>: Cost 3 vext3 <2,3,5,5>, <2,3,5,5>
- 3772368608U, // <5,2,3,6>: Cost 4 vext3 <2,3,4,5>, <2,3,6,5>
- 3702655716U, // <5,2,3,7>: Cost 4 vext2 <1,u,5,2>, <3,7,3,7>
- 1625179890U, // <5,2,3,u>: Cost 2 vext3 <2,3,u,5>, <2,3,u,5>
- 2641521555U, // <5,2,4,0>: Cost 3 vext2 <4,0,5,2>, <4,0,5,2>
- 3772368642U, // <5,2,4,1>: Cost 4 vext3 <2,3,4,5>, <2,4,1,3>
- 2699142925U, // <5,2,4,2>: Cost 3 vext3 <2,4,2,5>, <2,4,2,5>
- 2698626838U, // <5,2,4,3>: Cost 3 vext3 <2,3,4,5>, <2,4,3,5>
- 2698626848U, // <5,2,4,4>: Cost 3 vext3 <2,3,4,5>, <2,4,4,6>
- 2628914486U, // <5,2,4,5>: Cost 3 vext2 <1,u,5,2>, RHS
- 2645503353U, // <5,2,4,6>: Cost 3 vext2 <4,6,5,2>, <4,6,5,2>
- 3304146826U, // <5,2,4,7>: Cost 4 vrev <2,5,7,4>
- 2628914729U, // <5,2,4,u>: Cost 3 vext2 <1,u,5,2>, RHS
- 2553643110U, // <5,2,5,0>: Cost 3 vext1 <0,5,2,5>, LHS
- 3758950227U, // <5,2,5,1>: Cost 4 vext3 <0,1,2,5>, <2,5,1,3>
- 3759761248U, // <5,2,5,2>: Cost 4 vext3 <0,2,4,5>, <2,5,2,7>
- 2982396006U, // <5,2,5,3>: Cost 3 vzipr <4,u,5,5>, LHS
- 2553646390U, // <5,2,5,4>: Cost 3 vext1 <0,5,2,5>, RHS
- 2553647108U, // <5,2,5,5>: Cost 3 vext1 <0,5,2,5>, <5,5,5,5>
- 3760867204U, // <5,2,5,6>: Cost 4 vext3 <0,4,1,5>, <2,5,6,7>
- 3702657141U, // <5,2,5,7>: Cost 4 vext2 <1,u,5,2>, <5,7,0,1>
- 2982396011U, // <5,2,5,u>: Cost 3 vzipr <4,u,5,5>, LHS
- 3627393126U, // <5,2,6,0>: Cost 4 vext1 <0,5,2,6>, LHS
- 3760867236U, // <5,2,6,1>: Cost 4 vext3 <0,4,1,5>, <2,6,1,3>
- 2645504506U, // <5,2,6,2>: Cost 3 vext2 <4,6,5,2>, <6,2,7,3>
- 2687125434U, // <5,2,6,3>: Cost 3 vext3 <0,4,1,5>, <2,6,3,7>
- 2700617665U, // <5,2,6,4>: Cost 3 vext3 <2,6,4,5>, <2,6,4,5>
- 3760867276U, // <5,2,6,5>: Cost 4 vext3 <0,4,1,5>, <2,6,5,7>
- 3763521493U, // <5,2,6,6>: Cost 4 vext3 <0,u,1,5>, <2,6,6,7>
- 3719246670U, // <5,2,6,7>: Cost 4 vext2 <4,6,5,2>, <6,7,0,1>
- 2687125479U, // <5,2,6,u>: Cost 3 vext3 <0,4,1,5>, <2,6,u,7>
- 2565603430U, // <5,2,7,0>: Cost 3 vext1 <2,5,2,7>, LHS
- 2553660150U, // <5,2,7,1>: Cost 3 vext1 <0,5,2,7>, <1,0,3,2>
- 2565605216U, // <5,2,7,2>: Cost 3 vext1 <2,5,2,7>, <2,5,2,7>
- 2961178726U, // <5,2,7,3>: Cost 3 vzipr <1,3,5,7>, LHS
- 2565606710U, // <5,2,7,4>: Cost 3 vext1 <2,5,2,7>, RHS
- 4034920552U, // <5,2,7,5>: Cost 4 vzipr <1,3,5,7>, <0,1,2,5>
- 3114713292U, // <5,2,7,6>: Cost 3 vtrnr RHS, <0,2,4,6>
- 3702658668U, // <5,2,7,7>: Cost 4 vext2 <1,u,5,2>, <7,7,7,7>
- 2961178731U, // <5,2,7,u>: Cost 3 vzipr <1,3,5,7>, LHS
- 2687125563U, // <5,2,u,0>: Cost 3 vext3 <0,4,1,5>, <2,u,0,1>
- 2628917038U, // <5,2,u,1>: Cost 3 vext2 <1,u,5,2>, LHS
- 2565613409U, // <5,2,u,2>: Cost 3 vext1 <2,5,2,u>, <2,5,2,u>
- 2687125592U, // <5,2,u,3>: Cost 3 vext3 <0,4,1,5>, <2,u,3,3>
- 1628203107U, // <5,2,u,4>: Cost 2 vext3 <2,u,4,5>, <2,u,4,5>
- 2628917402U, // <5,2,u,5>: Cost 3 vext2 <1,u,5,2>, RHS
- 2702092405U, // <5,2,u,6>: Cost 3 vext3 <2,u,6,5>, <2,u,6,5>
- 3304179598U, // <5,2,u,7>: Cost 4 vrev <2,5,7,u>
- 1628498055U, // <5,2,u,u>: Cost 2 vext3 <2,u,u,5>, <2,u,u,5>
- 3760867467U, // <5,3,0,0>: Cost 4 vext3 <0,4,1,5>, <3,0,0,0>
- 2687125654U, // <5,3,0,1>: Cost 3 vext3 <0,4,1,5>, <3,0,1,2>
- 3759761565U, // <5,3,0,2>: Cost 4 vext3 <0,2,4,5>, <3,0,2,0>
- 3633391766U, // <5,3,0,3>: Cost 4 vext1 <1,5,3,0>, <3,0,1,2>
- 2687125680U, // <5,3,0,4>: Cost 3 vext3 <0,4,1,5>, <3,0,4,1>
- 3760277690U, // <5,3,0,5>: Cost 4 vext3 <0,3,2,5>, <3,0,5,2>
- 3310013014U, // <5,3,0,6>: Cost 4 vrev <3,5,6,0>
- 2236344927U, // <5,3,0,7>: Cost 3 vrev <3,5,7,0>
- 2687125717U, // <5,3,0,u>: Cost 3 vext3 <0,4,1,5>, <3,0,u,2>
- 3760867551U, // <5,3,1,0>: Cost 4 vext3 <0,4,1,5>, <3,1,0,3>
- 3760867558U, // <5,3,1,1>: Cost 4 vext3 <0,4,1,5>, <3,1,1,1>
- 2624938923U, // <5,3,1,2>: Cost 3 vext2 <1,2,5,3>, <1,2,5,3>
- 2703198460U, // <5,3,1,3>: Cost 3 vext3 <3,1,3,5>, <3,1,3,5>
- 3760867587U, // <5,3,1,4>: Cost 4 vext3 <0,4,1,5>, <3,1,4,3>
- 2636219536U, // <5,3,1,5>: Cost 3 vext2 <3,1,5,3>, <1,5,3,7>
- 3698681075U, // <5,3,1,6>: Cost 4 vext2 <1,2,5,3>, <1,6,5,7>
- 2703493408U, // <5,3,1,7>: Cost 3 vext3 <3,1,7,5>, <3,1,7,5>
- 2628920721U, // <5,3,1,u>: Cost 3 vext2 <1,u,5,3>, <1,u,5,3>
- 3766765870U, // <5,3,2,0>: Cost 4 vext3 <1,4,0,5>, <3,2,0,1>
- 3698681379U, // <5,3,2,1>: Cost 4 vext2 <1,2,5,3>, <2,1,3,5>
- 3760867649U, // <5,3,2,2>: Cost 4 vext3 <0,4,1,5>, <3,2,2,2>
- 2698627404U, // <5,3,2,3>: Cost 3 vext3 <2,3,4,5>, <3,2,3,4>
- 2703935830U, // <5,3,2,4>: Cost 3 vext3 <3,2,4,5>, <3,2,4,5>
- 2698627422U, // <5,3,2,5>: Cost 3 vext3 <2,3,4,5>, <3,2,5,4>
- 3760867686U, // <5,3,2,6>: Cost 4 vext3 <0,4,1,5>, <3,2,6,3>
- 3769788783U, // <5,3,2,7>: Cost 4 vext3 <1,u,5,5>, <3,2,7,3>
- 2701945209U, // <5,3,2,u>: Cost 3 vext3 <2,u,4,5>, <3,2,u,4>
- 3760867711U, // <5,3,3,0>: Cost 4 vext3 <0,4,1,5>, <3,3,0,1>
- 2636220684U, // <5,3,3,1>: Cost 3 vext2 <3,1,5,3>, <3,1,5,3>
- 3772369298U, // <5,3,3,2>: Cost 4 vext3 <2,3,4,5>, <3,3,2,2>
- 2687125916U, // <5,3,3,3>: Cost 3 vext3 <0,4,1,5>, <3,3,3,3>
- 2704599463U, // <5,3,3,4>: Cost 3 vext3 <3,3,4,5>, <3,3,4,5>
- 2704673200U, // <5,3,3,5>: Cost 3 vext3 <3,3,5,5>, <3,3,5,5>
- 3709962935U, // <5,3,3,6>: Cost 4 vext2 <3,1,5,3>, <3,6,7,7>
- 3772369346U, // <5,3,3,7>: Cost 4 vext3 <2,3,4,5>, <3,3,7,5>
- 2704894411U, // <5,3,3,u>: Cost 3 vext3 <3,3,u,5>, <3,3,u,5>
- 2704968148U, // <5,3,4,0>: Cost 3 vext3 <3,4,0,5>, <3,4,0,5>
- 3698682850U, // <5,3,4,1>: Cost 4 vext2 <1,2,5,3>, <4,1,5,0>
- 2642857014U, // <5,3,4,2>: Cost 3 vext2 <4,2,5,3>, <4,2,5,3>
- 2705189359U, // <5,3,4,3>: Cost 3 vext3 <3,4,3,5>, <3,4,3,5>
- 2705263096U, // <5,3,4,4>: Cost 3 vext3 <3,4,4,5>, <3,4,4,5>
- 2685946370U, // <5,3,4,5>: Cost 3 vext3 <0,2,3,5>, <3,4,5,6>
- 3779152394U, // <5,3,4,6>: Cost 4 vext3 <3,4,6,5>, <3,4,6,5>
- 2236377699U, // <5,3,4,7>: Cost 3 vrev <3,5,7,4>
- 2687126045U, // <5,3,4,u>: Cost 3 vext3 <0,4,1,5>, <3,4,u,6>
- 2571632742U, // <5,3,5,0>: Cost 3 vext1 <3,5,3,5>, LHS
- 2559689870U, // <5,3,5,1>: Cost 3 vext1 <1,5,3,5>, <1,5,3,5>
- 2571634382U, // <5,3,5,2>: Cost 3 vext1 <3,5,3,5>, <2,3,4,5>
- 2571635264U, // <5,3,5,3>: Cost 3 vext1 <3,5,3,5>, <3,5,3,5>
- 2571636022U, // <5,3,5,4>: Cost 3 vext1 <3,5,3,5>, RHS
- 2559692804U, // <5,3,5,5>: Cost 3 vext1 <1,5,3,5>, <5,5,5,5>
- 3720581218U, // <5,3,5,6>: Cost 4 vext2 <4,u,5,3>, <5,6,7,0>
- 2236385892U, // <5,3,5,7>: Cost 3 vrev <3,5,7,5>
- 2571638574U, // <5,3,5,u>: Cost 3 vext1 <3,5,3,5>, LHS
- 2565668966U, // <5,3,6,0>: Cost 3 vext1 <2,5,3,6>, LHS
- 3633439887U, // <5,3,6,1>: Cost 4 vext1 <1,5,3,6>, <1,5,3,6>
- 2565670760U, // <5,3,6,2>: Cost 3 vext1 <2,5,3,6>, <2,5,3,6>
- 2565671426U, // <5,3,6,3>: Cost 3 vext1 <2,5,3,6>, <3,4,5,6>
- 2565672246U, // <5,3,6,4>: Cost 3 vext1 <2,5,3,6>, RHS
- 3639414630U, // <5,3,6,5>: Cost 4 vext1 <2,5,3,6>, <5,3,6,0>
- 4047521640U, // <5,3,6,6>: Cost 4 vzipr <3,4,5,6>, <2,5,3,6>
- 2725169844U, // <5,3,6,7>: Cost 3 vext3 <6,7,4,5>, <3,6,7,4>
- 2565674798U, // <5,3,6,u>: Cost 3 vext1 <2,5,3,6>, LHS
- 1485963366U, // <5,3,7,0>: Cost 2 vext1 <1,5,3,7>, LHS
- 1485964432U, // <5,3,7,1>: Cost 2 vext1 <1,5,3,7>, <1,5,3,7>
- 2559706728U, // <5,3,7,2>: Cost 3 vext1 <1,5,3,7>, <2,2,2,2>
- 2559707286U, // <5,3,7,3>: Cost 3 vext1 <1,5,3,7>, <3,0,1,2>
- 1485966646U, // <5,3,7,4>: Cost 2 vext1 <1,5,3,7>, RHS
- 2559708880U, // <5,3,7,5>: Cost 3 vext1 <1,5,3,7>, <5,1,7,3>
- 2601513466U, // <5,3,7,6>: Cost 3 vext1 <u,5,3,7>, <6,2,7,3>
- 3114714112U, // <5,3,7,7>: Cost 3 vtrnr RHS, <1,3,5,7>
- 1485969198U, // <5,3,7,u>: Cost 2 vext1 <1,5,3,7>, LHS
- 1485971558U, // <5,3,u,0>: Cost 2 vext1 <1,5,3,u>, LHS
- 1485972625U, // <5,3,u,1>: Cost 2 vext1 <1,5,3,u>, <1,5,3,u>
- 2559714920U, // <5,3,u,2>: Cost 3 vext1 <1,5,3,u>, <2,2,2,2>
- 2559715478U, // <5,3,u,3>: Cost 3 vext1 <1,5,3,u>, <3,0,1,2>
- 1485974838U, // <5,3,u,4>: Cost 2 vext1 <1,5,3,u>, RHS
- 2687126342U, // <5,3,u,5>: Cost 3 vext3 <0,4,1,5>, <3,u,5,6>
- 2601521658U, // <5,3,u,6>: Cost 3 vext1 <u,5,3,u>, <6,2,7,3>
- 2236410471U, // <5,3,u,7>: Cost 3 vrev <3,5,7,u>
- 1485977390U, // <5,3,u,u>: Cost 2 vext1 <1,5,3,u>, LHS
- 3627491430U, // <5,4,0,0>: Cost 4 vext1 <0,5,4,0>, LHS
- 2636890214U, // <5,4,0,1>: Cost 3 vext2 <3,2,5,4>, LHS
- 3703333028U, // <5,4,0,2>: Cost 4 vext2 <2,0,5,4>, <0,2,0,2>
- 3782249348U, // <5,4,0,3>: Cost 4 vext3 <4,0,3,5>, <4,0,3,5>
- 2642198866U, // <5,4,0,4>: Cost 3 vext2 <4,1,5,4>, <0,4,1,5>
- 2687126418U, // <5,4,0,5>: Cost 3 vext3 <0,4,1,5>, <4,0,5,1>
- 2242243887U, // <5,4,0,6>: Cost 3 vrev <4,5,6,0>
- 3316059448U, // <5,4,0,7>: Cost 4 vrev <4,5,7,0>
- 2636890781U, // <5,4,0,u>: Cost 3 vext2 <3,2,5,4>, LHS
- 2241809658U, // <5,4,1,0>: Cost 3 vrev <4,5,0,1>
- 3698025307U, // <5,4,1,1>: Cost 4 vext2 <1,1,5,4>, <1,1,5,4>
- 3698688940U, // <5,4,1,2>: Cost 4 vext2 <1,2,5,4>, <1,2,5,4>
- 3698689024U, // <5,4,1,3>: Cost 4 vext2 <1,2,5,4>, <1,3,5,7>
- 3700016206U, // <5,4,1,4>: Cost 4 vext2 <1,4,5,4>, <1,4,5,4>
- 2687126498U, // <5,4,1,5>: Cost 3 vext3 <0,4,1,5>, <4,1,5,0>
- 3760868336U, // <5,4,1,6>: Cost 4 vext3 <0,4,1,5>, <4,1,6,5>
- 3316067641U, // <5,4,1,7>: Cost 4 vrev <4,5,7,1>
- 2242399554U, // <5,4,1,u>: Cost 3 vrev <4,5,u,1>
- 3703334371U, // <5,4,2,0>: Cost 4 vext2 <2,0,5,4>, <2,0,5,4>
- 3703998004U, // <5,4,2,1>: Cost 4 vext2 <2,1,5,4>, <2,1,5,4>
- 3704661637U, // <5,4,2,2>: Cost 4 vext2 <2,2,5,4>, <2,2,5,4>
- 2636891854U, // <5,4,2,3>: Cost 3 vext2 <3,2,5,4>, <2,3,4,5>
- 3705988903U, // <5,4,2,4>: Cost 4 vext2 <2,4,5,4>, <2,4,5,4>
- 2698628150U, // <5,4,2,5>: Cost 3 vext3 <2,3,4,5>, <4,2,5,3>
- 3760868415U, // <5,4,2,6>: Cost 4 vext3 <0,4,1,5>, <4,2,6,3>
- 3783871562U, // <5,4,2,7>: Cost 4 vext3 <4,2,7,5>, <4,2,7,5>
- 2666752099U, // <5,4,2,u>: Cost 3 vext2 <u,2,5,4>, <2,u,4,5>
- 3639459942U, // <5,4,3,0>: Cost 4 vext1 <2,5,4,3>, LHS
- 3709970701U, // <5,4,3,1>: Cost 4 vext2 <3,1,5,4>, <3,1,5,4>
- 2636892510U, // <5,4,3,2>: Cost 3 vext2 <3,2,5,4>, <3,2,5,4>
- 3710634396U, // <5,4,3,3>: Cost 4 vext2 <3,2,5,4>, <3,3,3,3>
- 2638219776U, // <5,4,3,4>: Cost 3 vext2 <3,4,5,4>, <3,4,5,4>
- 3766987908U, // <5,4,3,5>: Cost 4 vext3 <1,4,3,5>, <4,3,5,0>
- 2710719634U, // <5,4,3,6>: Cost 3 vext3 <4,3,6,5>, <4,3,6,5>
- 3914097664U, // <5,4,3,7>: Cost 4 vuzpr <3,5,7,4>, <1,3,5,7>
- 2640874308U, // <5,4,3,u>: Cost 3 vext2 <3,u,5,4>, <3,u,5,4>
- 2583642214U, // <5,4,4,0>: Cost 3 vext1 <5,5,4,4>, LHS
- 2642201574U, // <5,4,4,1>: Cost 3 vext2 <4,1,5,4>, <4,1,5,4>
- 3710635062U, // <5,4,4,2>: Cost 4 vext2 <3,2,5,4>, <4,2,5,3>
- 3717270664U, // <5,4,4,3>: Cost 4 vext2 <4,3,5,4>, <4,3,5,4>
- 2713963728U, // <5,4,4,4>: Cost 3 vext3 <4,u,5,5>, <4,4,4,4>
- 1637567706U, // <5,4,4,5>: Cost 2 vext3 <4,4,5,5>, <4,4,5,5>
- 2242276659U, // <5,4,4,6>: Cost 3 vrev <4,5,6,4>
- 2646183372U, // <5,4,4,7>: Cost 3 vext2 <4,7,5,4>, <4,7,5,4>
- 1637788917U, // <5,4,4,u>: Cost 2 vext3 <4,4,u,5>, <4,4,u,5>
- 2559762534U, // <5,4,5,0>: Cost 3 vext1 <1,5,4,5>, LHS
- 2559763607U, // <5,4,5,1>: Cost 3 vext1 <1,5,4,5>, <1,5,4,5>
- 2698628366U, // <5,4,5,2>: Cost 3 vext3 <2,3,4,5>, <4,5,2,3>
- 3633506454U, // <5,4,5,3>: Cost 4 vext1 <1,5,4,5>, <3,0,1,2>
- 2559765814U, // <5,4,5,4>: Cost 3 vext1 <1,5,4,5>, RHS
- 2583654395U, // <5,4,5,5>: Cost 3 vext1 <5,5,4,5>, <5,5,4,5>
- 1613385014U, // <5,4,5,6>: Cost 2 vext3 <0,4,1,5>, RHS
- 3901639990U, // <5,4,5,7>: Cost 4 vuzpr <1,5,0,4>, RHS
- 1613385032U, // <5,4,5,u>: Cost 2 vext3 <0,4,1,5>, RHS
- 2559770726U, // <5,4,6,0>: Cost 3 vext1 <1,5,4,6>, LHS
- 2559771648U, // <5,4,6,1>: Cost 3 vext1 <1,5,4,6>, <1,3,5,7>
- 3633514088U, // <5,4,6,2>: Cost 4 vext1 <1,5,4,6>, <2,2,2,2>
- 2571717122U, // <5,4,6,3>: Cost 3 vext1 <3,5,4,6>, <3,4,5,6>
- 2559774006U, // <5,4,6,4>: Cost 3 vext1 <1,5,4,6>, RHS
- 2712636796U, // <5,4,6,5>: Cost 3 vext3 <4,6,5,5>, <4,6,5,5>
- 3760868743U, // <5,4,6,6>: Cost 4 vext3 <0,4,1,5>, <4,6,6,7>
- 2712784270U, // <5,4,6,7>: Cost 3 vext3 <4,6,7,5>, <4,6,7,5>
- 2559776558U, // <5,4,6,u>: Cost 3 vext1 <1,5,4,6>, LHS
- 2565750886U, // <5,4,7,0>: Cost 3 vext1 <2,5,4,7>, LHS
- 2565751706U, // <5,4,7,1>: Cost 3 vext1 <2,5,4,7>, <1,2,3,4>
- 2565752690U, // <5,4,7,2>: Cost 3 vext1 <2,5,4,7>, <2,5,4,7>
- 2571725387U, // <5,4,7,3>: Cost 3 vext1 <3,5,4,7>, <3,5,4,7>
- 2565754166U, // <5,4,7,4>: Cost 3 vext1 <2,5,4,7>, RHS
- 3114713426U, // <5,4,7,5>: Cost 3 vtrnr RHS, <0,4,1,5>
- 94817590U, // <5,4,7,6>: Cost 1 vrev RHS
- 2595616175U, // <5,4,7,7>: Cost 3 vext1 <7,5,4,7>, <7,5,4,7>
- 94965064U, // <5,4,7,u>: Cost 1 vrev RHS
- 2559787110U, // <5,4,u,0>: Cost 3 vext1 <1,5,4,u>, LHS
- 2559788186U, // <5,4,u,1>: Cost 3 vext1 <1,5,4,u>, <1,5,4,u>
- 2242014483U, // <5,4,u,2>: Cost 3 vrev <4,5,2,u>
- 2667419628U, // <5,4,u,3>: Cost 3 vext2 <u,3,5,4>, <u,3,5,4>
- 2559790390U, // <5,4,u,4>: Cost 3 vext1 <1,5,4,u>, RHS
- 1640222238U, // <5,4,u,5>: Cost 2 vext3 <4,u,5,5>, <4,u,5,5>
- 94825783U, // <5,4,u,6>: Cost 1 vrev RHS
- 2714111536U, // <5,4,u,7>: Cost 3 vext3 <4,u,7,5>, <4,u,7,5>
- 94973257U, // <5,4,u,u>: Cost 1 vrev RHS
- 2646851584U, // <5,5,0,0>: Cost 3 vext2 <4,u,5,5>, <0,0,0,0>
- 1573109862U, // <5,5,0,1>: Cost 2 vext2 <4,u,5,5>, LHS
- 2646851748U, // <5,5,0,2>: Cost 3 vext2 <4,u,5,5>, <0,2,0,2>
- 3760279130U, // <5,5,0,3>: Cost 4 vext3 <0,3,2,5>, <5,0,3,2>
- 2687127138U, // <5,5,0,4>: Cost 3 vext3 <0,4,1,5>, <5,0,4,1>
- 2248142847U, // <5,5,0,5>: Cost 3 vrev <5,5,5,0>
- 3720593910U, // <5,5,0,6>: Cost 4 vext2 <4,u,5,5>, <0,6,1,7>
- 4182502710U, // <5,5,0,7>: Cost 4 vtrnr <3,5,7,0>, RHS
- 1573110429U, // <5,5,0,u>: Cost 2 vext2 <4,u,5,5>, LHS
- 2646852342U, // <5,5,1,0>: Cost 3 vext2 <4,u,5,5>, <1,0,3,2>
- 2624291676U, // <5,5,1,1>: Cost 3 vext2 <1,1,5,5>, <1,1,5,5>
- 2646852502U, // <5,5,1,2>: Cost 3 vext2 <4,u,5,5>, <1,2,3,0>
- 2646852568U, // <5,5,1,3>: Cost 3 vext2 <4,u,5,5>, <1,3,1,3>
- 2715217591U, // <5,5,1,4>: Cost 3 vext3 <5,1,4,5>, <5,1,4,5>
- 2628936848U, // <5,5,1,5>: Cost 3 vext2 <1,u,5,5>, <1,5,3,7>
- 3698033907U, // <5,5,1,6>: Cost 4 vext2 <1,1,5,5>, <1,6,5,7>
- 2713964240U, // <5,5,1,7>: Cost 3 vext3 <4,u,5,5>, <5,1,7,3>
- 2628937107U, // <5,5,1,u>: Cost 3 vext2 <1,u,5,5>, <1,u,5,5>
- 3645497446U, // <5,5,2,0>: Cost 4 vext1 <3,5,5,2>, LHS
- 3760869099U, // <5,5,2,1>: Cost 4 vext3 <0,4,1,5>, <5,2,1,3>
- 2646853224U, // <5,5,2,2>: Cost 3 vext2 <4,u,5,5>, <2,2,2,2>
- 2698628862U, // <5,5,2,3>: Cost 3 vext3 <2,3,4,5>, <5,2,3,4>
- 3772370694U, // <5,5,2,4>: Cost 4 vext3 <2,3,4,5>, <5,2,4,3>
- 2713964303U, // <5,5,2,5>: Cost 3 vext3 <4,u,5,5>, <5,2,5,3>
- 2646853562U, // <5,5,2,6>: Cost 3 vext2 <4,u,5,5>, <2,6,3,7>
- 4038198272U, // <5,5,2,7>: Cost 4 vzipr <1,u,5,2>, <1,3,5,7>
- 2701946667U, // <5,5,2,u>: Cost 3 vext3 <2,u,4,5>, <5,2,u,4>
- 2646853782U, // <5,5,3,0>: Cost 3 vext2 <4,u,5,5>, <3,0,1,2>
- 3698034922U, // <5,5,3,1>: Cost 4 vext2 <1,1,5,5>, <3,1,1,5>
- 3702679919U, // <5,5,3,2>: Cost 4 vext2 <1,u,5,5>, <3,2,7,3>
- 2637564336U, // <5,5,3,3>: Cost 3 vext2 <3,3,5,5>, <3,3,5,5>
- 2646854146U, // <5,5,3,4>: Cost 3 vext2 <4,u,5,5>, <3,4,5,6>
- 2638891602U, // <5,5,3,5>: Cost 3 vext2 <3,5,5,5>, <3,5,5,5>
- 3702680247U, // <5,5,3,6>: Cost 4 vext2 <1,u,5,5>, <3,6,7,7>
- 3702680259U, // <5,5,3,7>: Cost 4 vext2 <1,u,5,5>, <3,7,0,1>
- 2646854430U, // <5,5,3,u>: Cost 3 vext2 <4,u,5,5>, <3,u,1,2>
- 2646854546U, // <5,5,4,0>: Cost 3 vext2 <4,u,5,5>, <4,0,5,1>
- 2642209767U, // <5,5,4,1>: Cost 3 vext2 <4,1,5,5>, <4,1,5,5>
- 3711306806U, // <5,5,4,2>: Cost 4 vext2 <3,3,5,5>, <4,2,5,3>
- 3645516369U, // <5,5,4,3>: Cost 4 vext1 <3,5,5,4>, <3,5,5,4>
- 1570458842U, // <5,5,4,4>: Cost 2 vext2 <4,4,5,5>, <4,4,5,5>
- 1573113142U, // <5,5,4,5>: Cost 2 vext2 <4,u,5,5>, RHS
- 2645527932U, // <5,5,4,6>: Cost 3 vext2 <4,6,5,5>, <4,6,5,5>
- 2713964486U, // <5,5,4,7>: Cost 3 vext3 <4,u,5,5>, <5,4,7,6>
- 1573113374U, // <5,5,4,u>: Cost 2 vext2 <4,u,5,5>, <4,u,5,5>
- 1509982310U, // <5,5,5,0>: Cost 2 vext1 <5,5,5,5>, LHS
- 2646855376U, // <5,5,5,1>: Cost 3 vext2 <4,u,5,5>, <5,1,7,3>
- 2583725672U, // <5,5,5,2>: Cost 3 vext1 <5,5,5,5>, <2,2,2,2>
- 2583726230U, // <5,5,5,3>: Cost 3 vext1 <5,5,5,5>, <3,0,1,2>
- 1509985590U, // <5,5,5,4>: Cost 2 vext1 <5,5,5,5>, RHS
- 229035318U, // <5,5,5,5>: Cost 1 vdup1 RHS
- 2646855778U, // <5,5,5,6>: Cost 3 vext2 <4,u,5,5>, <5,6,7,0>
- 2646855848U, // <5,5,5,7>: Cost 3 vext2 <4,u,5,5>, <5,7,5,7>
- 229035318U, // <5,5,5,u>: Cost 1 vdup1 RHS
- 2577760358U, // <5,5,6,0>: Cost 3 vext1 <4,5,5,6>, LHS
- 3633587361U, // <5,5,6,1>: Cost 4 vext1 <1,5,5,6>, <1,5,5,6>
- 2646856186U, // <5,5,6,2>: Cost 3 vext2 <4,u,5,5>, <6,2,7,3>
- 3633588738U, // <5,5,6,3>: Cost 4 vext1 <1,5,5,6>, <3,4,5,6>
- 2718535756U, // <5,5,6,4>: Cost 3 vext3 <5,6,4,5>, <5,6,4,5>
- 2644202223U, // <5,5,6,5>: Cost 3 vext2 <4,4,5,5>, <6,5,7,5>
- 2973780482U, // <5,5,6,6>: Cost 3 vzipr <3,4,5,6>, <3,4,5,6>
- 2646856526U, // <5,5,6,7>: Cost 3 vext2 <4,u,5,5>, <6,7,0,1>
- 2646856607U, // <5,5,6,u>: Cost 3 vext2 <4,u,5,5>, <6,u,0,1>
- 2571796582U, // <5,5,7,0>: Cost 3 vext1 <3,5,5,7>, LHS
- 3633595392U, // <5,5,7,1>: Cost 4 vext1 <1,5,5,7>, <1,3,5,7>
- 2571798222U, // <5,5,7,2>: Cost 3 vext1 <3,5,5,7>, <2,3,4,5>
- 2571799124U, // <5,5,7,3>: Cost 3 vext1 <3,5,5,7>, <3,5,5,7>
- 2571799862U, // <5,5,7,4>: Cost 3 vext1 <3,5,5,7>, RHS
- 3114717188U, // <5,5,7,5>: Cost 3 vtrnr RHS, <5,5,5,5>
- 4034923010U, // <5,5,7,6>: Cost 4 vzipr <1,3,5,7>, <3,4,5,6>
- 2040974646U, // <5,5,7,7>: Cost 2 vtrnr RHS, RHS
- 2040974647U, // <5,5,7,u>: Cost 2 vtrnr RHS, RHS
- 1509982310U, // <5,5,u,0>: Cost 2 vext1 <5,5,5,5>, LHS
- 1573115694U, // <5,5,u,1>: Cost 2 vext2 <4,u,5,5>, LHS
- 2571806414U, // <5,5,u,2>: Cost 3 vext1 <3,5,5,u>, <2,3,4,5>
- 2571807317U, // <5,5,u,3>: Cost 3 vext1 <3,5,5,u>, <3,5,5,u>
- 1509985590U, // <5,5,u,4>: Cost 2 vext1 <5,5,5,5>, RHS
- 229035318U, // <5,5,u,5>: Cost 1 vdup1 RHS
- 2646857936U, // <5,5,u,6>: Cost 3 vext2 <4,u,5,5>, <u,6,3,7>
- 2040982838U, // <5,5,u,7>: Cost 2 vtrnr RHS, RHS
- 229035318U, // <5,5,u,u>: Cost 1 vdup1 RHS
- 2638233600U, // <5,6,0,0>: Cost 3 vext2 <3,4,5,6>, <0,0,0,0>
- 1564491878U, // <5,6,0,1>: Cost 2 vext2 <3,4,5,6>, LHS
- 2632261796U, // <5,6,0,2>: Cost 3 vext2 <2,4,5,6>, <0,2,0,2>
- 2638233856U, // <5,6,0,3>: Cost 3 vext2 <3,4,5,6>, <0,3,1,4>
- 2638233938U, // <5,6,0,4>: Cost 3 vext2 <3,4,5,6>, <0,4,1,5>
- 3706003885U, // <5,6,0,5>: Cost 4 vext2 <2,4,5,6>, <0,5,2,6>
- 3706003967U, // <5,6,0,6>: Cost 4 vext2 <2,4,5,6>, <0,6,2,7>
- 4047473974U, // <5,6,0,7>: Cost 4 vzipr <3,4,5,0>, RHS
- 1564492445U, // <5,6,0,u>: Cost 2 vext2 <3,4,5,6>, LHS
- 2638234358U, // <5,6,1,0>: Cost 3 vext2 <3,4,5,6>, <1,0,3,2>
- 2638234420U, // <5,6,1,1>: Cost 3 vext2 <3,4,5,6>, <1,1,1,1>
- 2638234518U, // <5,6,1,2>: Cost 3 vext2 <3,4,5,6>, <1,2,3,0>
- 2638234584U, // <5,6,1,3>: Cost 3 vext2 <3,4,5,6>, <1,3,1,3>
- 2626290768U, // <5,6,1,4>: Cost 3 vext2 <1,4,5,6>, <1,4,5,6>
- 2638234768U, // <5,6,1,5>: Cost 3 vext2 <3,4,5,6>, <1,5,3,7>
- 3700032719U, // <5,6,1,6>: Cost 4 vext2 <1,4,5,6>, <1,6,1,7>
- 2982366518U, // <5,6,1,7>: Cost 3 vzipr <4,u,5,1>, RHS
- 2628945300U, // <5,6,1,u>: Cost 3 vext2 <1,u,5,6>, <1,u,5,6>
- 3706004925U, // <5,6,2,0>: Cost 4 vext2 <2,4,5,6>, <2,0,1,2>
- 3711976966U, // <5,6,2,1>: Cost 4 vext2 <3,4,5,6>, <2,1,0,3>
- 2638235240U, // <5,6,2,2>: Cost 3 vext2 <3,4,5,6>, <2,2,2,2>
- 2638235302U, // <5,6,2,3>: Cost 3 vext2 <3,4,5,6>, <2,3,0,1>
- 2632263465U, // <5,6,2,4>: Cost 3 vext2 <2,4,5,6>, <2,4,5,6>
- 2638235496U, // <5,6,2,5>: Cost 3 vext2 <3,4,5,6>, <2,5,3,6>
- 2638235578U, // <5,6,2,6>: Cost 3 vext2 <3,4,5,6>, <2,6,3,7>
- 2713965050U, // <5,6,2,7>: Cost 3 vext3 <4,u,5,5>, <6,2,7,3>
- 2634917997U, // <5,6,2,u>: Cost 3 vext2 <2,u,5,6>, <2,u,5,6>
- 2638235798U, // <5,6,3,0>: Cost 3 vext2 <3,4,5,6>, <3,0,1,2>
- 3711977695U, // <5,6,3,1>: Cost 4 vext2 <3,4,5,6>, <3,1,0,3>
- 3710650720U, // <5,6,3,2>: Cost 4 vext2 <3,2,5,6>, <3,2,5,6>
- 2638236060U, // <5,6,3,3>: Cost 3 vext2 <3,4,5,6>, <3,3,3,3>
- 1564494338U, // <5,6,3,4>: Cost 2 vext2 <3,4,5,6>, <3,4,5,6>
- 2638236234U, // <5,6,3,5>: Cost 3 vext2 <3,4,5,6>, <3,5,4,6>
- 3711978104U, // <5,6,3,6>: Cost 4 vext2 <3,4,5,6>, <3,6,0,7>
- 4034227510U, // <5,6,3,7>: Cost 4 vzipr <1,2,5,3>, RHS
- 1567148870U, // <5,6,3,u>: Cost 2 vext2 <3,u,5,6>, <3,u,5,6>
- 2577817702U, // <5,6,4,0>: Cost 3 vext1 <4,5,6,4>, LHS
- 3700034544U, // <5,6,4,1>: Cost 4 vext2 <1,4,5,6>, <4,1,6,5>
- 2723033713U, // <5,6,4,2>: Cost 3 vext3 <6,4,2,5>, <6,4,2,5>
- 2638236818U, // <5,6,4,3>: Cost 3 vext2 <3,4,5,6>, <4,3,6,5>
- 2644208859U, // <5,6,4,4>: Cost 3 vext2 <4,4,5,6>, <4,4,5,6>
- 1564495158U, // <5,6,4,5>: Cost 2 vext2 <3,4,5,6>, RHS
- 2645536125U, // <5,6,4,6>: Cost 3 vext2 <4,6,5,6>, <4,6,5,6>
- 2723402398U, // <5,6,4,7>: Cost 3 vext3 <6,4,7,5>, <6,4,7,5>
- 1564495401U, // <5,6,4,u>: Cost 2 vext2 <3,4,5,6>, RHS
- 2577825894U, // <5,6,5,0>: Cost 3 vext1 <4,5,6,5>, LHS
- 2662125264U, // <5,6,5,1>: Cost 3 vext2 <7,4,5,6>, <5,1,7,3>
- 3775836867U, // <5,6,5,2>: Cost 4 vext3 <2,u,6,5>, <6,5,2,6>
- 3711979343U, // <5,6,5,3>: Cost 4 vext2 <3,4,5,6>, <5,3,3,4>
- 2650181556U, // <5,6,5,4>: Cost 3 vext2 <5,4,5,6>, <5,4,5,6>
- 2662125572U, // <5,6,5,5>: Cost 3 vext2 <7,4,5,6>, <5,5,5,5>
- 2638237732U, // <5,6,5,6>: Cost 3 vext2 <3,4,5,6>, <5,6,0,1>
- 2982399286U, // <5,6,5,7>: Cost 3 vzipr <4,u,5,5>, RHS
- 2982399287U, // <5,6,5,u>: Cost 3 vzipr <4,u,5,5>, RHS
- 2583806054U, // <5,6,6,0>: Cost 3 vext1 <5,5,6,6>, LHS
- 3711979910U, // <5,6,6,1>: Cost 4 vext2 <3,4,5,6>, <6,1,3,4>
- 2662126074U, // <5,6,6,2>: Cost 3 vext2 <7,4,5,6>, <6,2,7,3>
- 2583808514U, // <5,6,6,3>: Cost 3 vext1 <5,5,6,6>, <3,4,5,6>
- 2583809334U, // <5,6,6,4>: Cost 3 vext1 <5,5,6,6>, RHS
- 2583810062U, // <5,6,6,5>: Cost 3 vext1 <5,5,6,6>, <5,5,6,6>
- 2638238520U, // <5,6,6,6>: Cost 3 vext2 <3,4,5,6>, <6,6,6,6>
- 2973781302U, // <5,6,6,7>: Cost 3 vzipr <3,4,5,6>, RHS
- 2973781303U, // <5,6,6,u>: Cost 3 vzipr <3,4,5,6>, RHS
- 430358630U, // <5,6,7,0>: Cost 1 vext1 RHS, LHS
- 1504101110U, // <5,6,7,1>: Cost 2 vext1 RHS, <1,0,3,2>
- 1504101992U, // <5,6,7,2>: Cost 2 vext1 RHS, <2,2,2,2>
- 1504102550U, // <5,6,7,3>: Cost 2 vext1 RHS, <3,0,1,2>
- 430361910U, // <5,6,7,4>: Cost 1 vext1 RHS, RHS
- 1504104390U, // <5,6,7,5>: Cost 2 vext1 RHS, <5,4,7,6>
- 1504105272U, // <5,6,7,6>: Cost 2 vext1 RHS, <6,6,6,6>
- 1504106092U, // <5,6,7,7>: Cost 2 vext1 RHS, <7,7,7,7>
- 430364462U, // <5,6,7,u>: Cost 1 vext1 RHS, LHS
- 430366822U, // <5,6,u,0>: Cost 1 vext1 RHS, LHS
- 1564497710U, // <5,6,u,1>: Cost 2 vext2 <3,4,5,6>, LHS
- 1504110184U, // <5,6,u,2>: Cost 2 vext1 RHS, <2,2,2,2>
- 1504110742U, // <5,6,u,3>: Cost 2 vext1 RHS, <3,0,1,2>
- 430370103U, // <5,6,u,4>: Cost 1 vext1 RHS, RHS
- 1564498074U, // <5,6,u,5>: Cost 2 vext2 <3,4,5,6>, RHS
- 1504113146U, // <5,6,u,6>: Cost 2 vext1 RHS, <6,2,7,3>
- 1504113658U, // <5,6,u,7>: Cost 2 vext1 RHS, <7,0,1,2>
- 430372654U, // <5,6,u,u>: Cost 1 vext1 RHS, LHS
- 2625634304U, // <5,7,0,0>: Cost 3 vext2 <1,3,5,7>, <0,0,0,0>
- 1551892582U, // <5,7,0,1>: Cost 2 vext2 <1,3,5,7>, LHS
- 2625634468U, // <5,7,0,2>: Cost 3 vext2 <1,3,5,7>, <0,2,0,2>
- 2571889247U, // <5,7,0,3>: Cost 3 vext1 <3,5,7,0>, <3,5,7,0>
- 2625634642U, // <5,7,0,4>: Cost 3 vext2 <1,3,5,7>, <0,4,1,5>
- 2595778728U, // <5,7,0,5>: Cost 3 vext1 <7,5,7,0>, <5,7,5,7>
- 3699376639U, // <5,7,0,6>: Cost 4 vext2 <1,3,5,7>, <0,6,2,7>
- 2260235715U, // <5,7,0,7>: Cost 3 vrev <7,5,7,0>
- 1551893149U, // <5,7,0,u>: Cost 2 vext2 <1,3,5,7>, LHS
- 2625635062U, // <5,7,1,0>: Cost 3 vext2 <1,3,5,7>, <1,0,3,2>
- 2624308020U, // <5,7,1,1>: Cost 3 vext2 <1,1,5,7>, <1,1,1,1>
- 2625635222U, // <5,7,1,2>: Cost 3 vext2 <1,3,5,7>, <1,2,3,0>
- 1551893504U, // <5,7,1,3>: Cost 2 vext2 <1,3,5,7>, <1,3,5,7>
- 2571898166U, // <5,7,1,4>: Cost 3 vext1 <3,5,7,1>, RHS
- 2625635472U, // <5,7,1,5>: Cost 3 vext2 <1,3,5,7>, <1,5,3,7>
- 2627626227U, // <5,7,1,6>: Cost 3 vext2 <1,6,5,7>, <1,6,5,7>
- 3702031684U, // <5,7,1,7>: Cost 4 vext2 <1,7,5,7>, <1,7,5,7>
- 1555211669U, // <5,7,1,u>: Cost 2 vext2 <1,u,5,7>, <1,u,5,7>
- 2629617126U, // <5,7,2,0>: Cost 3 vext2 <2,0,5,7>, <2,0,5,7>
- 3699377670U, // <5,7,2,1>: Cost 4 vext2 <1,3,5,7>, <2,1,0,3>
- 2625635944U, // <5,7,2,2>: Cost 3 vext2 <1,3,5,7>, <2,2,2,2>
- 2625636006U, // <5,7,2,3>: Cost 3 vext2 <1,3,5,7>, <2,3,0,1>
- 2632271658U, // <5,7,2,4>: Cost 3 vext2 <2,4,5,7>, <2,4,5,7>
- 2625636201U, // <5,7,2,5>: Cost 3 vext2 <1,3,5,7>, <2,5,3,7>
- 2625636282U, // <5,7,2,6>: Cost 3 vext2 <1,3,5,7>, <2,6,3,7>
- 3708004381U, // <5,7,2,7>: Cost 4 vext2 <2,7,5,7>, <2,7,5,7>
- 2625636411U, // <5,7,2,u>: Cost 3 vext2 <1,3,5,7>, <2,u,0,1>
- 2625636502U, // <5,7,3,0>: Cost 3 vext2 <1,3,5,7>, <3,0,1,2>
- 2625636604U, // <5,7,3,1>: Cost 3 vext2 <1,3,5,7>, <3,1,3,5>
- 3699378478U, // <5,7,3,2>: Cost 4 vext2 <1,3,5,7>, <3,2,0,1>
- 2625636764U, // <5,7,3,3>: Cost 3 vext2 <1,3,5,7>, <3,3,3,3>
- 2625636866U, // <5,7,3,4>: Cost 3 vext2 <1,3,5,7>, <3,4,5,6>
- 2625636959U, // <5,7,3,5>: Cost 3 vext2 <1,3,5,7>, <3,5,7,0>
- 3699378808U, // <5,7,3,6>: Cost 4 vext2 <1,3,5,7>, <3,6,0,7>
- 2640235254U, // <5,7,3,7>: Cost 3 vext2 <3,7,5,7>, <3,7,5,7>
- 2625637150U, // <5,7,3,u>: Cost 3 vext2 <1,3,5,7>, <3,u,1,2>
- 2571919462U, // <5,7,4,0>: Cost 3 vext1 <3,5,7,4>, LHS
- 2571920384U, // <5,7,4,1>: Cost 3 vext1 <3,5,7,4>, <1,3,5,7>
- 3699379260U, // <5,7,4,2>: Cost 4 vext2 <1,3,5,7>, <4,2,6,0>
- 2571922019U, // <5,7,4,3>: Cost 3 vext1 <3,5,7,4>, <3,5,7,4>
- 2571922742U, // <5,7,4,4>: Cost 3 vext1 <3,5,7,4>, RHS
- 1551895862U, // <5,7,4,5>: Cost 2 vext2 <1,3,5,7>, RHS
- 2846277980U, // <5,7,4,6>: Cost 3 vuzpr RHS, <0,4,2,6>
- 2646207951U, // <5,7,4,7>: Cost 3 vext2 <4,7,5,7>, <4,7,5,7>
- 1551896105U, // <5,7,4,u>: Cost 2 vext2 <1,3,5,7>, RHS
- 2583871590U, // <5,7,5,0>: Cost 3 vext1 <5,5,7,5>, LHS
- 2652180176U, // <5,7,5,1>: Cost 3 vext2 <5,7,5,7>, <5,1,7,3>
- 2625638177U, // <5,7,5,2>: Cost 3 vext2 <1,3,5,7>, <5,2,7,3>
- 2625638262U, // <5,7,5,3>: Cost 3 vext2 <1,3,5,7>, <5,3,7,7>
- 2583874870U, // <5,7,5,4>: Cost 3 vext1 <5,5,7,5>, RHS
- 2846281732U, // <5,7,5,5>: Cost 3 vuzpr RHS, <5,5,5,5>
- 2651517015U, // <5,7,5,6>: Cost 3 vext2 <5,6,5,7>, <5,6,5,7>
- 1772539190U, // <5,7,5,7>: Cost 2 vuzpr RHS, RHS
- 1772539191U, // <5,7,5,u>: Cost 2 vuzpr RHS, RHS
- 2846281826U, // <5,7,6,0>: Cost 3 vuzpr RHS, <5,6,7,0>
- 3699380615U, // <5,7,6,1>: Cost 4 vext2 <1,3,5,7>, <6,1,3,5>
- 2846281108U, // <5,7,6,2>: Cost 3 vuzpr RHS, <4,6,u,2>
- 2589854210U, // <5,7,6,3>: Cost 3 vext1 <6,5,7,6>, <3,4,5,6>
- 2846281830U, // <5,7,6,4>: Cost 3 vuzpr RHS, <5,6,7,4>
- 2725467658U, // <5,7,6,5>: Cost 3 vext3 <6,7,u,5>, <7,6,5,u>
- 2846281076U, // <5,7,6,6>: Cost 3 vuzpr RHS, <4,6,4,6>
- 2846279610U, // <5,7,6,7>: Cost 3 vuzpr RHS, <2,6,3,7>
- 2846279611U, // <5,7,6,u>: Cost 3 vuzpr RHS, <2,6,3,u>
- 1510146150U, // <5,7,7,0>: Cost 2 vext1 <5,5,7,7>, LHS
- 2846282574U, // <5,7,7,1>: Cost 3 vuzpr RHS, <6,7,0,1>
- 2583889512U, // <5,7,7,2>: Cost 3 vext1 <5,5,7,7>, <2,2,2,2>
- 2846281919U, // <5,7,7,3>: Cost 3 vuzpr RHS, <5,7,u,3>
- 1510149430U, // <5,7,7,4>: Cost 2 vext1 <5,5,7,7>, RHS
- 1510150168U, // <5,7,7,5>: Cost 2 vext1 <5,5,7,7>, <5,5,7,7>
- 2583892474U, // <5,7,7,6>: Cost 3 vext1 <5,5,7,7>, <6,2,7,3>
- 2625640044U, // <5,7,7,7>: Cost 3 vext2 <1,3,5,7>, <7,7,7,7>
- 1510151982U, // <5,7,7,u>: Cost 2 vext1 <5,5,7,7>, LHS
- 1510154342U, // <5,7,u,0>: Cost 2 vext1 <5,5,7,u>, LHS
- 1551898414U, // <5,7,u,1>: Cost 2 vext2 <1,3,5,7>, LHS
- 2625640325U, // <5,7,u,2>: Cost 3 vext2 <1,3,5,7>, <u,2,3,0>
- 1772536477U, // <5,7,u,3>: Cost 2 vuzpr RHS, LHS
- 1510157622U, // <5,7,u,4>: Cost 2 vext1 <5,5,7,u>, RHS
- 1551898778U, // <5,7,u,5>: Cost 2 vext2 <1,3,5,7>, RHS
- 2625640656U, // <5,7,u,6>: Cost 3 vext2 <1,3,5,7>, <u,6,3,7>
- 1772539433U, // <5,7,u,7>: Cost 2 vuzpr RHS, RHS
- 1551898981U, // <5,7,u,u>: Cost 2 vext2 <1,3,5,7>, LHS
- 2625642496U, // <5,u,0,0>: Cost 3 vext2 <1,3,5,u>, <0,0,0,0>
- 1551900774U, // <5,u,0,1>: Cost 2 vext2 <1,3,5,u>, LHS
- 2625642660U, // <5,u,0,2>: Cost 3 vext2 <1,3,5,u>, <0,2,0,2>
- 2698630885U, // <5,u,0,3>: Cost 3 vext3 <2,3,4,5>, <u,0,3,2>
- 2687129325U, // <5,u,0,4>: Cost 3 vext3 <0,4,1,5>, <u,0,4,1>
- 2689783542U, // <5,u,0,5>: Cost 3 vext3 <0,u,1,5>, <u,0,5,1>
- 2266134675U, // <5,u,0,6>: Cost 3 vrev <u,5,6,0>
- 2595853772U, // <5,u,0,7>: Cost 3 vext1 <7,5,u,0>, <7,5,u,0>
- 1551901341U, // <5,u,0,u>: Cost 2 vext2 <1,3,5,u>, LHS
- 2625643254U, // <5,u,1,0>: Cost 3 vext2 <1,3,5,u>, <1,0,3,2>
- 2625643316U, // <5,u,1,1>: Cost 3 vext2 <1,3,5,u>, <1,1,1,1>
- 1613387566U, // <5,u,1,2>: Cost 2 vext3 <0,4,1,5>, LHS
- 1551901697U, // <5,u,1,3>: Cost 2 vext2 <1,3,5,u>, <1,3,5,u>
- 2626307154U, // <5,u,1,4>: Cost 3 vext2 <1,4,5,u>, <1,4,5,u>
- 2689783622U, // <5,u,1,5>: Cost 3 vext3 <0,u,1,5>, <u,1,5,0>
- 2627634420U, // <5,u,1,6>: Cost 3 vext2 <1,6,5,u>, <1,6,5,u>
- 2982366536U, // <5,u,1,7>: Cost 3 vzipr <4,u,5,1>, RHS
- 1613387620U, // <5,u,1,u>: Cost 2 vext3 <0,4,1,5>, LHS
- 2846286742U, // <5,u,2,0>: Cost 3 vuzpr RHS, <1,2,3,0>
- 2685796528U, // <5,u,2,1>: Cost 3 vext3 <0,2,1,5>, <0,2,1,5>
- 2625644136U, // <5,u,2,2>: Cost 3 vext2 <1,3,5,u>, <2,2,2,2>
- 2687129480U, // <5,u,2,3>: Cost 3 vext3 <0,4,1,5>, <u,2,3,3>
- 2632279851U, // <5,u,2,4>: Cost 3 vext2 <2,4,5,u>, <2,4,5,u>
- 2625644394U, // <5,u,2,5>: Cost 3 vext2 <1,3,5,u>, <2,5,3,u>
- 2625644474U, // <5,u,2,6>: Cost 3 vext2 <1,3,5,u>, <2,6,3,7>
- 2713966508U, // <5,u,2,7>: Cost 3 vext3 <4,u,5,5>, <u,2,7,3>
- 2625644603U, // <5,u,2,u>: Cost 3 vext2 <1,3,5,u>, <2,u,0,1>
- 2687129532U, // <5,u,3,0>: Cost 3 vext3 <0,4,1,5>, <u,3,0,1>
- 2636261649U, // <5,u,3,1>: Cost 3 vext2 <3,1,5,u>, <3,1,5,u>
- 2636925282U, // <5,u,3,2>: Cost 3 vext2 <3,2,5,u>, <3,2,5,u>
- 2625644956U, // <5,u,3,3>: Cost 3 vext2 <1,3,5,u>, <3,3,3,3>
- 1564510724U, // <5,u,3,4>: Cost 2 vext2 <3,4,5,u>, <3,4,5,u>
- 2625645160U, // <5,u,3,5>: Cost 3 vext2 <1,3,5,u>, <3,5,u,0>
- 2734610422U, // <5,u,3,6>: Cost 3 vext3 <u,3,6,5>, <u,3,6,5>
- 2640243447U, // <5,u,3,7>: Cost 3 vext2 <3,7,5,u>, <3,7,5,u>
- 1567165256U, // <5,u,3,u>: Cost 2 vext2 <3,u,5,u>, <3,u,5,u>
- 1567828889U, // <5,u,4,0>: Cost 2 vext2 <4,0,5,u>, <4,0,5,u>
- 1661163546U, // <5,u,4,1>: Cost 2 vext3 <u,4,1,5>, <u,4,1,5>
- 2734463012U, // <5,u,4,2>: Cost 3 vext3 <u,3,4,5>, <u,4,2,6>
- 2698631212U, // <5,u,4,3>: Cost 3 vext3 <2,3,4,5>, <u,4,3,5>
- 1570458842U, // <5,u,4,4>: Cost 2 vext2 <4,4,5,5>, <4,4,5,5>
- 1551904054U, // <5,u,4,5>: Cost 2 vext2 <1,3,5,u>, RHS
- 2846286172U, // <5,u,4,6>: Cost 3 vuzpr RHS, <0,4,2,6>
- 2646216144U, // <5,u,4,7>: Cost 3 vext2 <4,7,5,u>, <4,7,5,u>
- 1551904297U, // <5,u,4,u>: Cost 2 vext2 <1,3,5,u>, RHS
- 1509982310U, // <5,u,5,0>: Cost 2 vext1 <5,5,5,5>, LHS
- 2560058555U, // <5,u,5,1>: Cost 3 vext1 <1,5,u,5>, <1,5,u,5>
- 2698926194U, // <5,u,5,2>: Cost 3 vext3 <2,3,u,5>, <u,5,2,3>
- 2698631295U, // <5,u,5,3>: Cost 3 vext3 <2,3,4,5>, <u,5,3,7>
- 1509985590U, // <5,u,5,4>: Cost 2 vext1 <5,5,5,5>, RHS
- 229035318U, // <5,u,5,5>: Cost 1 vdup1 RHS
- 1613387930U, // <5,u,5,6>: Cost 2 vext3 <0,4,1,5>, RHS
- 1772547382U, // <5,u,5,7>: Cost 2 vuzpr RHS, RHS
- 229035318U, // <5,u,5,u>: Cost 1 vdup1 RHS
- 2566037606U, // <5,u,6,0>: Cost 3 vext1 <2,5,u,6>, LHS
- 2920044334U, // <5,u,6,1>: Cost 3 vzipl <5,6,7,0>, LHS
- 2566039445U, // <5,u,6,2>: Cost 3 vext1 <2,5,u,6>, <2,5,u,6>
- 2687129808U, // <5,u,6,3>: Cost 3 vext3 <0,4,1,5>, <u,6,3,7>
- 2566040886U, // <5,u,6,4>: Cost 3 vext1 <2,5,u,6>, RHS
- 2920044698U, // <5,u,6,5>: Cost 3 vzipl <5,6,7,0>, RHS
- 2846289268U, // <5,u,6,6>: Cost 3 vuzpr RHS, <4,6,4,6>
- 2973781320U, // <5,u,6,7>: Cost 3 vzipr <3,4,5,6>, RHS
- 2687129853U, // <5,u,6,u>: Cost 3 vext3 <0,4,1,5>, <u,6,u,7>
- 430506086U, // <5,u,7,0>: Cost 1 vext1 RHS, LHS
- 1486333117U, // <5,u,7,1>: Cost 2 vext1 <1,5,u,7>, <1,5,u,7>
- 1504249448U, // <5,u,7,2>: Cost 2 vext1 RHS, <2,2,2,2>
- 2040971933U, // <5,u,7,3>: Cost 2 vtrnr RHS, LHS
- 430509384U, // <5,u,7,4>: Cost 1 vext1 RHS, RHS
- 1504251600U, // <5,u,7,5>: Cost 2 vext1 RHS, <5,1,7,3>
- 118708378U, // <5,u,7,6>: Cost 1 vrev RHS
- 2040974889U, // <5,u,7,7>: Cost 2 vtrnr RHS, RHS
- 430511918U, // <5,u,7,u>: Cost 1 vext1 RHS, LHS
- 430514278U, // <5,u,u,0>: Cost 1 vext1 RHS, LHS
- 1551906606U, // <5,u,u,1>: Cost 2 vext2 <1,3,5,u>, LHS
- 1613388133U, // <5,u,u,2>: Cost 2 vext3 <0,4,1,5>, LHS
- 1772544669U, // <5,u,u,3>: Cost 2 vuzpr RHS, LHS
- 430517577U, // <5,u,u,4>: Cost 1 vext1 RHS, RHS
- 229035318U, // <5,u,u,5>: Cost 1 vdup1 RHS
- 118716571U, // <5,u,u,6>: Cost 1 vrev RHS
- 1772547625U, // <5,u,u,7>: Cost 2 vuzpr RHS, RHS
- 430520110U, // <5,u,u,u>: Cost 1 vext1 RHS, LHS
- 2686025728U, // <6,0,0,0>: Cost 3 vext3 <0,2,4,6>, <0,0,0,0>
- 2686025738U, // <6,0,0,1>: Cost 3 vext3 <0,2,4,6>, <0,0,1,1>
- 2686025748U, // <6,0,0,2>: Cost 3 vext3 <0,2,4,6>, <0,0,2,2>
- 3779084320U, // <6,0,0,3>: Cost 4 vext3 <3,4,5,6>, <0,0,3,5>
- 2642903388U, // <6,0,0,4>: Cost 3 vext2 <4,2,6,0>, <0,4,2,6>
- 3657723939U, // <6,0,0,5>: Cost 4 vext1 <5,6,0,0>, <5,6,0,0>
- 3926676514U, // <6,0,0,6>: Cost 4 vuzpr <5,6,7,0>, <7,0,5,6>
- 3926675786U, // <6,0,0,7>: Cost 4 vuzpr <5,6,7,0>, <6,0,5,7>
- 2686025802U, // <6,0,0,u>: Cost 3 vext3 <0,2,4,6>, <0,0,u,2>
- 2566070374U, // <6,0,1,0>: Cost 3 vext1 <2,6,0,1>, LHS
- 3759767642U, // <6,0,1,1>: Cost 4 vext3 <0,2,4,6>, <0,1,1,0>
- 1612284006U, // <6,0,1,2>: Cost 2 vext3 <0,2,4,6>, LHS
- 2583988738U, // <6,0,1,3>: Cost 3 vext1 <5,6,0,1>, <3,4,5,6>
- 2566073654U, // <6,0,1,4>: Cost 3 vext1 <2,6,0,1>, RHS
- 2583990308U, // <6,0,1,5>: Cost 3 vext1 <5,6,0,1>, <5,6,0,1>
- 2589963005U, // <6,0,1,6>: Cost 3 vext1 <6,6,0,1>, <6,6,0,1>
- 2595935702U, // <6,0,1,7>: Cost 3 vext1 <7,6,0,1>, <7,6,0,1>
- 1612284060U, // <6,0,1,u>: Cost 2 vext3 <0,2,4,6>, LHS
- 2686025892U, // <6,0,2,0>: Cost 3 vext3 <0,2,4,6>, <0,2,0,2>
- 2685804721U, // <6,0,2,1>: Cost 3 vext3 <0,2,1,6>, <0,2,1,6>
- 3759620282U, // <6,0,2,2>: Cost 4 vext3 <0,2,2,6>, <0,2,2,6>
- 2705342658U, // <6,0,2,3>: Cost 3 vext3 <3,4,5,6>, <0,2,3,5>
- 1612284108U, // <6,0,2,4>: Cost 2 vext3 <0,2,4,6>, <0,2,4,6>
- 3706029956U, // <6,0,2,5>: Cost 4 vext2 <2,4,6,0>, <2,5,6,7>
- 2686173406U, // <6,0,2,6>: Cost 3 vext3 <0,2,6,6>, <0,2,6,6>
- 3651769338U, // <6,0,2,7>: Cost 4 vext1 <4,6,0,2>, <7,0,1,2>
- 1612579056U, // <6,0,2,u>: Cost 2 vext3 <0,2,u,6>, <0,2,u,6>
- 3706030230U, // <6,0,3,0>: Cost 4 vext2 <2,4,6,0>, <3,0,1,2>
- 2705342720U, // <6,0,3,1>: Cost 3 vext3 <3,4,5,6>, <0,3,1,4>
- 2705342730U, // <6,0,3,2>: Cost 3 vext3 <3,4,5,6>, <0,3,2,5>
- 3706030492U, // <6,0,3,3>: Cost 4 vext2 <2,4,6,0>, <3,3,3,3>
- 2644896258U, // <6,0,3,4>: Cost 3 vext2 <4,5,6,0>, <3,4,5,6>
- 3718638154U, // <6,0,3,5>: Cost 4 vext2 <4,5,6,0>, <3,5,4,6>
- 3729918619U, // <6,0,3,6>: Cost 4 vext2 <6,4,6,0>, <3,6,4,6>
- 3926672384U, // <6,0,3,7>: Cost 4 vuzpr <5,6,7,0>, <1,3,5,7>
- 2705342784U, // <6,0,3,u>: Cost 3 vext3 <3,4,5,6>, <0,3,u,5>
- 2687058250U, // <6,0,4,0>: Cost 3 vext3 <0,4,0,6>, <0,4,0,6>
- 2686026066U, // <6,0,4,1>: Cost 3 vext3 <0,2,4,6>, <0,4,1,5>
- 1613463900U, // <6,0,4,2>: Cost 2 vext3 <0,4,2,6>, <0,4,2,6>
- 3761021285U, // <6,0,4,3>: Cost 4 vext3 <0,4,3,6>, <0,4,3,6>
- 2687353198U, // <6,0,4,4>: Cost 3 vext3 <0,4,4,6>, <0,4,4,6>
- 2632289590U, // <6,0,4,5>: Cost 3 vext2 <2,4,6,0>, RHS
- 2645560704U, // <6,0,4,6>: Cost 3 vext2 <4,6,6,0>, <4,6,6,0>
- 2646224337U, // <6,0,4,7>: Cost 3 vext2 <4,7,6,0>, <4,7,6,0>
- 1613906322U, // <6,0,4,u>: Cost 2 vext3 <0,4,u,6>, <0,4,u,6>
- 3651788902U, // <6,0,5,0>: Cost 4 vext1 <4,6,0,5>, LHS
- 2687795620U, // <6,0,5,1>: Cost 3 vext3 <0,5,1,6>, <0,5,1,6>
- 3761611181U, // <6,0,5,2>: Cost 4 vext3 <0,5,2,6>, <0,5,2,6>
- 3723284326U, // <6,0,5,3>: Cost 4 vext2 <5,3,6,0>, <5,3,6,0>
- 2646224838U, // <6,0,5,4>: Cost 3 vext2 <4,7,6,0>, <5,4,7,6>
- 3718639630U, // <6,0,5,5>: Cost 4 vext2 <4,5,6,0>, <5,5,6,6>
- 2652196962U, // <6,0,5,6>: Cost 3 vext2 <5,7,6,0>, <5,6,7,0>
- 2852932918U, // <6,0,5,7>: Cost 3 vuzpr <5,6,7,0>, RHS
- 2852932919U, // <6,0,5,u>: Cost 3 vuzpr <5,6,7,0>, RHS
- 2852933730U, // <6,0,6,0>: Cost 3 vuzpr <5,6,7,0>, <5,6,7,0>
- 2925985894U, // <6,0,6,1>: Cost 3 vzipl <6,6,6,6>, LHS
- 3060203622U, // <6,0,6,2>: Cost 3 vtrnl <6,6,6,6>, LHS
- 3718640178U, // <6,0,6,3>: Cost 4 vext2 <4,5,6,0>, <6,3,4,5>
- 2656178832U, // <6,0,6,4>: Cost 3 vext2 <6,4,6,0>, <6,4,6,0>
- 3725939378U, // <6,0,6,5>: Cost 4 vext2 <5,7,6,0>, <6,5,0,7>
- 2657506098U, // <6,0,6,6>: Cost 3 vext2 <6,6,6,0>, <6,6,6,0>
- 2619020110U, // <6,0,6,7>: Cost 3 vext2 <0,2,6,0>, <6,7,0,1>
- 2925986461U, // <6,0,6,u>: Cost 3 vzipl <6,6,6,6>, LHS
- 2572091494U, // <6,0,7,0>: Cost 3 vext1 <3,6,0,7>, LHS
- 2572092310U, // <6,0,7,1>: Cost 3 vext1 <3,6,0,7>, <1,2,3,0>
- 2980495524U, // <6,0,7,2>: Cost 3 vzipr RHS, <0,2,0,2>
- 2572094072U, // <6,0,7,3>: Cost 3 vext1 <3,6,0,7>, <3,6,0,7>
- 2572094774U, // <6,0,7,4>: Cost 3 vext1 <3,6,0,7>, RHS
- 4054238242U, // <6,0,7,5>: Cost 4 vzipr RHS, <1,4,0,5>
- 3645837653U, // <6,0,7,6>: Cost 4 vext1 <3,6,0,7>, <6,0,7,0>
- 4054239054U, // <6,0,7,7>: Cost 4 vzipr RHS, <2,5,0,7>
- 2572097326U, // <6,0,7,u>: Cost 3 vext1 <3,6,0,7>, LHS
- 2686026378U, // <6,0,u,0>: Cost 3 vext3 <0,2,4,6>, <0,u,0,2>
- 2686026386U, // <6,0,u,1>: Cost 3 vext3 <0,2,4,6>, <0,u,1,1>
- 1612284573U, // <6,0,u,2>: Cost 2 vext3 <0,2,4,6>, LHS
- 2705343144U, // <6,0,u,3>: Cost 3 vext3 <3,4,5,6>, <0,u,3,5>
- 1616265906U, // <6,0,u,4>: Cost 2 vext3 <0,u,4,6>, <0,u,4,6>
- 2632292506U, // <6,0,u,5>: Cost 3 vext2 <2,4,6,0>, RHS
- 2590020356U, // <6,0,u,6>: Cost 3 vext1 <6,6,0,u>, <6,6,0,u>
- 2852933161U, // <6,0,u,7>: Cost 3 vuzpr <5,6,7,0>, RHS
- 1612284627U, // <6,0,u,u>: Cost 2 vext3 <0,2,4,6>, LHS
- 2595995750U, // <6,1,0,0>: Cost 3 vext1 <7,6,1,0>, LHS
- 2646229094U, // <6,1,0,1>: Cost 3 vext2 <4,7,6,1>, LHS
- 3694092492U, // <6,1,0,2>: Cost 4 vext2 <0,4,6,1>, <0,2,4,6>
- 2686026486U, // <6,1,0,3>: Cost 3 vext3 <0,2,4,6>, <1,0,3,2>
- 2595999030U, // <6,1,0,4>: Cost 3 vext1 <7,6,1,0>, RHS
- 3767730952U, // <6,1,0,5>: Cost 4 vext3 <1,5,4,6>, <1,0,5,2>
- 2596000590U, // <6,1,0,6>: Cost 3 vext1 <7,6,1,0>, <6,7,0,1>
- 2596001246U, // <6,1,0,7>: Cost 3 vext1 <7,6,1,0>, <7,6,1,0>
- 2686026531U, // <6,1,0,u>: Cost 3 vext3 <0,2,4,6>, <1,0,u,2>
- 3763602219U, // <6,1,1,0>: Cost 4 vext3 <0,u,2,6>, <1,1,0,1>
- 2686026548U, // <6,1,1,1>: Cost 3 vext3 <0,2,4,6>, <1,1,1,1>
- 3764929346U, // <6,1,1,2>: Cost 4 vext3 <1,1,2,6>, <1,1,2,6>
- 2686026568U, // <6,1,1,3>: Cost 3 vext3 <0,2,4,6>, <1,1,3,3>
- 2691334996U, // <6,1,1,4>: Cost 3 vext3 <1,1,4,6>, <1,1,4,6>
- 3760874332U, // <6,1,1,5>: Cost 4 vext3 <0,4,1,6>, <1,1,5,5>
- 3765224294U, // <6,1,1,6>: Cost 4 vext3 <1,1,6,6>, <1,1,6,6>
- 3669751263U, // <6,1,1,7>: Cost 4 vext1 <7,6,1,1>, <7,6,1,1>
- 2686026613U, // <6,1,1,u>: Cost 3 vext3 <0,2,4,6>, <1,1,u,3>
- 2554208358U, // <6,1,2,0>: Cost 3 vext1 <0,6,1,2>, LHS
- 3763602311U, // <6,1,2,1>: Cost 4 vext3 <0,u,2,6>, <1,2,1,3>
- 3639895971U, // <6,1,2,2>: Cost 4 vext1 <2,6,1,2>, <2,6,1,2>
- 2686026646U, // <6,1,2,3>: Cost 3 vext3 <0,2,4,6>, <1,2,3,0>
- 2554211638U, // <6,1,2,4>: Cost 3 vext1 <0,6,1,2>, RHS
- 3760874411U, // <6,1,2,5>: Cost 4 vext3 <0,4,1,6>, <1,2,5,3>
- 2554212858U, // <6,1,2,6>: Cost 3 vext1 <0,6,1,2>, <6,2,7,3>
- 3802973114U, // <6,1,2,7>: Cost 4 vext3 <7,4,5,6>, <1,2,7,0>
- 2686026691U, // <6,1,2,u>: Cost 3 vext3 <0,2,4,6>, <1,2,u,0>
- 2566160486U, // <6,1,3,0>: Cost 3 vext1 <2,6,1,3>, LHS
- 2686026712U, // <6,1,3,1>: Cost 3 vext3 <0,2,4,6>, <1,3,1,3>
- 2686026724U, // <6,1,3,2>: Cost 3 vext3 <0,2,4,6>, <1,3,2,6>
- 3759768552U, // <6,1,3,3>: Cost 4 vext3 <0,2,4,6>, <1,3,3,1>
- 2692662262U, // <6,1,3,4>: Cost 3 vext3 <1,3,4,6>, <1,3,4,6>
- 2686026752U, // <6,1,3,5>: Cost 3 vext3 <0,2,4,6>, <1,3,5,7>
- 2590053128U, // <6,1,3,6>: Cost 3 vext1 <6,6,1,3>, <6,6,1,3>
- 3663795194U, // <6,1,3,7>: Cost 4 vext1 <6,6,1,3>, <7,0,1,2>
- 2686026775U, // <6,1,3,u>: Cost 3 vext3 <0,2,4,6>, <1,3,u,3>
- 2641587099U, // <6,1,4,0>: Cost 3 vext2 <4,0,6,1>, <4,0,6,1>
- 2693104684U, // <6,1,4,1>: Cost 3 vext3 <1,4,1,6>, <1,4,1,6>
- 3639912357U, // <6,1,4,2>: Cost 4 vext1 <2,6,1,4>, <2,6,1,4>
- 2687206462U, // <6,1,4,3>: Cost 3 vext3 <0,4,2,6>, <1,4,3,6>
- 3633941814U, // <6,1,4,4>: Cost 4 vext1 <1,6,1,4>, RHS
- 2693399632U, // <6,1,4,5>: Cost 3 vext3 <1,4,5,6>, <1,4,5,6>
- 3765077075U, // <6,1,4,6>: Cost 4 vext3 <1,1,4,6>, <1,4,6,0>
- 2646232530U, // <6,1,4,7>: Cost 3 vext2 <4,7,6,1>, <4,7,6,1>
- 2687206507U, // <6,1,4,u>: Cost 3 vext3 <0,4,2,6>, <1,4,u,6>
- 2647559796U, // <6,1,5,0>: Cost 3 vext2 <5,0,6,1>, <5,0,6,1>
- 3765077118U, // <6,1,5,1>: Cost 4 vext3 <1,1,4,6>, <1,5,1,7>
- 3767583878U, // <6,1,5,2>: Cost 4 vext3 <1,5,2,6>, <1,5,2,6>
- 2686026896U, // <6,1,5,3>: Cost 3 vext3 <0,2,4,6>, <1,5,3,7>
- 2693989528U, // <6,1,5,4>: Cost 3 vext3 <1,5,4,6>, <1,5,4,6>
- 3767805089U, // <6,1,5,5>: Cost 4 vext3 <1,5,5,6>, <1,5,5,6>
- 2652868706U, // <6,1,5,6>: Cost 3 vext2 <5,u,6,1>, <5,6,7,0>
- 3908250934U, // <6,1,5,7>: Cost 4 vuzpr <2,6,0,1>, RHS
- 2686026941U, // <6,1,5,u>: Cost 3 vext3 <0,2,4,6>, <1,5,u,7>
- 2554241126U, // <6,1,6,0>: Cost 3 vext1 <0,6,1,6>, LHS
- 3763602639U, // <6,1,6,1>: Cost 4 vext3 <0,u,2,6>, <1,6,1,7>
- 3759547607U, // <6,1,6,2>: Cost 4 vext3 <0,2,1,6>, <1,6,2,6>
- 3115221094U, // <6,1,6,3>: Cost 3 vtrnr <4,6,4,6>, LHS
- 2554244406U, // <6,1,6,4>: Cost 3 vext1 <0,6,1,6>, RHS
- 3760874739U, // <6,1,6,5>: Cost 4 vext3 <0,4,1,6>, <1,6,5,7>
- 2554245944U, // <6,1,6,6>: Cost 3 vext1 <0,6,1,6>, <6,6,6,6>
- 3719975758U, // <6,1,6,7>: Cost 4 vext2 <4,7,6,1>, <6,7,0,1>
- 3115221099U, // <6,1,6,u>: Cost 3 vtrnr <4,6,4,6>, LHS
- 2560221286U, // <6,1,7,0>: Cost 3 vext1 <1,6,1,7>, LHS
- 2560222415U, // <6,1,7,1>: Cost 3 vext1 <1,6,1,7>, <1,6,1,7>
- 2980497558U, // <6,1,7,2>: Cost 3 vzipr RHS, <3,0,1,2>
- 3103211622U, // <6,1,7,3>: Cost 3 vtrnr <2,6,3,7>, LHS
- 2560224566U, // <6,1,7,4>: Cost 3 vext1 <1,6,1,7>, RHS
- 2980495698U, // <6,1,7,5>: Cost 3 vzipr RHS, <0,4,1,5>
- 3633967526U, // <6,1,7,6>: Cost 4 vext1 <1,6,1,7>, <6,1,7,0>
- 4054237686U, // <6,1,7,7>: Cost 4 vzipr RHS, <0,6,1,7>
- 2560227118U, // <6,1,7,u>: Cost 3 vext1 <1,6,1,7>, LHS
- 2560229478U, // <6,1,u,0>: Cost 3 vext1 <1,6,1,u>, LHS
- 2686027117U, // <6,1,u,1>: Cost 3 vext3 <0,2,4,6>, <1,u,1,3>
- 2686027129U, // <6,1,u,2>: Cost 3 vext3 <0,2,4,6>, <1,u,2,6>
- 2686027132U, // <6,1,u,3>: Cost 3 vext3 <0,2,4,6>, <1,u,3,0>
- 2687206795U, // <6,1,u,4>: Cost 3 vext3 <0,4,2,6>, <1,u,4,6>
- 2686027157U, // <6,1,u,5>: Cost 3 vext3 <0,2,4,6>, <1,u,5,7>
- 2590094093U, // <6,1,u,6>: Cost 3 vext1 <6,6,1,u>, <6,6,1,u>
- 2596066790U, // <6,1,u,7>: Cost 3 vext1 <7,6,1,u>, <7,6,1,u>
- 2686027177U, // <6,1,u,u>: Cost 3 vext3 <0,2,4,6>, <1,u,u,0>
- 2646900736U, // <6,2,0,0>: Cost 3 vext2 <4,u,6,2>, <0,0,0,0>
- 1573159014U, // <6,2,0,1>: Cost 2 vext2 <4,u,6,2>, LHS
- 2646900900U, // <6,2,0,2>: Cost 3 vext2 <4,u,6,2>, <0,2,0,2>
- 3759769037U, // <6,2,0,3>: Cost 4 vext3 <0,2,4,6>, <2,0,3,0>
- 2641592668U, // <6,2,0,4>: Cost 3 vext2 <4,0,6,2>, <0,4,2,6>
- 3779085794U, // <6,2,0,5>: Cost 4 vext3 <3,4,5,6>, <2,0,5,3>
- 2686027244U, // <6,2,0,6>: Cost 3 vext3 <0,2,4,6>, <2,0,6,4>
- 3669816807U, // <6,2,0,7>: Cost 4 vext1 <7,6,2,0>, <7,6,2,0>
- 1573159581U, // <6,2,0,u>: Cost 2 vext2 <4,u,6,2>, LHS
- 2230527897U, // <6,2,1,0>: Cost 3 vrev <2,6,0,1>
- 2646901556U, // <6,2,1,1>: Cost 3 vext2 <4,u,6,2>, <1,1,1,1>
- 2646901654U, // <6,2,1,2>: Cost 3 vext2 <4,u,6,2>, <1,2,3,0>
- 2847047782U, // <6,2,1,3>: Cost 3 vuzpr <4,6,u,2>, LHS
- 3771049517U, // <6,2,1,4>: Cost 4 vext3 <2,1,4,6>, <2,1,4,6>
- 2646901904U, // <6,2,1,5>: Cost 3 vext2 <4,u,6,2>, <1,5,3,7>
- 2686027324U, // <6,2,1,6>: Cost 3 vext3 <0,2,4,6>, <2,1,6,3>
- 3669825000U, // <6,2,1,7>: Cost 4 vext1 <7,6,2,1>, <7,6,2,1>
- 2231117793U, // <6,2,1,u>: Cost 3 vrev <2,6,u,1>
- 3763603029U, // <6,2,2,0>: Cost 4 vext3 <0,u,2,6>, <2,2,0,1>
- 3759769184U, // <6,2,2,1>: Cost 4 vext3 <0,2,4,6>, <2,2,1,3>
- 2686027368U, // <6,2,2,2>: Cost 3 vext3 <0,2,4,6>, <2,2,2,2>
- 2686027378U, // <6,2,2,3>: Cost 3 vext3 <0,2,4,6>, <2,2,3,3>
- 2697971326U, // <6,2,2,4>: Cost 3 vext3 <2,2,4,6>, <2,2,4,6>
- 3759769224U, // <6,2,2,5>: Cost 4 vext3 <0,2,4,6>, <2,2,5,7>
- 2698118800U, // <6,2,2,6>: Cost 3 vext3 <2,2,6,6>, <2,2,6,6>
- 3920794092U, // <6,2,2,7>: Cost 4 vuzpr <4,6,u,2>, <6,2,5,7>
- 2686027423U, // <6,2,2,u>: Cost 3 vext3 <0,2,4,6>, <2,2,u,3>
- 2686027430U, // <6,2,3,0>: Cost 3 vext3 <0,2,4,6>, <2,3,0,1>
- 3759769262U, // <6,2,3,1>: Cost 4 vext3 <0,2,4,6>, <2,3,1,0>
- 2698487485U, // <6,2,3,2>: Cost 3 vext3 <2,3,2,6>, <2,3,2,6>
- 2705344196U, // <6,2,3,3>: Cost 3 vext3 <3,4,5,6>, <2,3,3,4>
- 2686027470U, // <6,2,3,4>: Cost 3 vext3 <0,2,4,6>, <2,3,4,5>
- 2698708696U, // <6,2,3,5>: Cost 3 vext3 <2,3,5,6>, <2,3,5,6>
- 2724660961U, // <6,2,3,6>: Cost 3 vext3 <6,6,6,6>, <2,3,6,6>
- 2729232104U, // <6,2,3,7>: Cost 3 vext3 <7,4,5,6>, <2,3,7,4>
- 2686027502U, // <6,2,3,u>: Cost 3 vext3 <0,2,4,6>, <2,3,u,1>
- 1567853468U, // <6,2,4,0>: Cost 2 vext2 <4,0,6,2>, <4,0,6,2>
- 3759769351U, // <6,2,4,1>: Cost 4 vext3 <0,2,4,6>, <2,4,1,u>
- 2699151118U, // <6,2,4,2>: Cost 3 vext3 <2,4,2,6>, <2,4,2,6>
- 2686027543U, // <6,2,4,3>: Cost 3 vext3 <0,2,4,6>, <2,4,3,6>
- 2699298592U, // <6,2,4,4>: Cost 3 vext3 <2,4,4,6>, <2,4,4,6>
- 1573162294U, // <6,2,4,5>: Cost 2 vext2 <4,u,6,2>, RHS
- 2686027564U, // <6,2,4,6>: Cost 3 vext3 <0,2,4,6>, <2,4,6,0>
- 3719982547U, // <6,2,4,7>: Cost 4 vext2 <4,7,6,2>, <4,7,6,2>
- 1573162532U, // <6,2,4,u>: Cost 2 vext2 <4,u,6,2>, <4,u,6,2>
- 3779086154U, // <6,2,5,0>: Cost 4 vext3 <3,4,5,6>, <2,5,0,3>
- 2646904528U, // <6,2,5,1>: Cost 3 vext2 <4,u,6,2>, <5,1,7,3>
- 3759769440U, // <6,2,5,2>: Cost 4 vext3 <0,2,4,6>, <2,5,2,7>
- 2699888488U, // <6,2,5,3>: Cost 3 vext3 <2,5,3,6>, <2,5,3,6>
- 2230855617U, // <6,2,5,4>: Cost 3 vrev <2,6,4,5>
- 2646904836U, // <6,2,5,5>: Cost 3 vext2 <4,u,6,2>, <5,5,5,5>
- 2646904930U, // <6,2,5,6>: Cost 3 vext2 <4,u,6,2>, <5,6,7,0>
- 2847051062U, // <6,2,5,7>: Cost 3 vuzpr <4,6,u,2>, RHS
- 2700257173U, // <6,2,5,u>: Cost 3 vext3 <2,5,u,6>, <2,5,u,6>
- 2687207321U, // <6,2,6,0>: Cost 3 vext3 <0,4,2,6>, <2,6,0,1>
- 2686027684U, // <6,2,6,1>: Cost 3 vext3 <0,2,4,6>, <2,6,1,3>
- 2566260656U, // <6,2,6,2>: Cost 3 vext1 <2,6,2,6>, <2,6,2,6>
- 2685806522U, // <6,2,6,3>: Cost 3 vext3 <0,2,1,6>, <2,6,3,7>
- 2687207361U, // <6,2,6,4>: Cost 3 vext3 <0,4,2,6>, <2,6,4,5>
- 2686027724U, // <6,2,6,5>: Cost 3 vext3 <0,2,4,6>, <2,6,5,7>
- 2646905656U, // <6,2,6,6>: Cost 3 vext2 <4,u,6,2>, <6,6,6,6>
- 2646905678U, // <6,2,6,7>: Cost 3 vext2 <4,u,6,2>, <6,7,0,1>
- 2686027751U, // <6,2,6,u>: Cost 3 vext3 <0,2,4,6>, <2,6,u,7>
- 2554323046U, // <6,2,7,0>: Cost 3 vext1 <0,6,2,7>, LHS
- 2572239606U, // <6,2,7,1>: Cost 3 vext1 <3,6,2,7>, <1,0,3,2>
- 2566268849U, // <6,2,7,2>: Cost 3 vext1 <2,6,2,7>, <2,6,2,7>
- 1906753638U, // <6,2,7,3>: Cost 2 vzipr RHS, LHS
- 2554326326U, // <6,2,7,4>: Cost 3 vext1 <0,6,2,7>, RHS
- 3304687564U, // <6,2,7,5>: Cost 4 vrev <2,6,5,7>
- 2980495708U, // <6,2,7,6>: Cost 3 vzipr RHS, <0,4,2,6>
- 2646906476U, // <6,2,7,7>: Cost 3 vext2 <4,u,6,2>, <7,7,7,7>
- 1906753643U, // <6,2,7,u>: Cost 2 vzipr RHS, LHS
- 1591744256U, // <6,2,u,0>: Cost 2 vext2 <u,0,6,2>, <u,0,6,2>
- 1573164846U, // <6,2,u,1>: Cost 2 vext2 <4,u,6,2>, LHS
- 2701805650U, // <6,2,u,2>: Cost 3 vext3 <2,u,2,6>, <2,u,2,6>
- 1906761830U, // <6,2,u,3>: Cost 2 vzipr RHS, LHS
- 2686027875U, // <6,2,u,4>: Cost 3 vext3 <0,2,4,6>, <2,u,4,5>
- 1573165210U, // <6,2,u,5>: Cost 2 vext2 <4,u,6,2>, RHS
- 2686322800U, // <6,2,u,6>: Cost 3 vext3 <0,2,u,6>, <2,u,6,0>
- 2847051305U, // <6,2,u,7>: Cost 3 vuzpr <4,6,u,2>, RHS
- 1906761835U, // <6,2,u,u>: Cost 2 vzipr RHS, LHS
- 3759769739U, // <6,3,0,0>: Cost 4 vext3 <0,2,4,6>, <3,0,0,0>
- 2686027926U, // <6,3,0,1>: Cost 3 vext3 <0,2,4,6>, <3,0,1,2>
- 2686027937U, // <6,3,0,2>: Cost 3 vext3 <0,2,4,6>, <3,0,2,4>
- 3640027286U, // <6,3,0,3>: Cost 4 vext1 <2,6,3,0>, <3,0,1,2>
- 2687207601U, // <6,3,0,4>: Cost 3 vext3 <0,4,2,6>, <3,0,4,2>
- 2705344698U, // <6,3,0,5>: Cost 3 vext3 <3,4,5,6>, <3,0,5,2>
- 3663917847U, // <6,3,0,6>: Cost 4 vext1 <6,6,3,0>, <6,6,3,0>
- 2237008560U, // <6,3,0,7>: Cost 3 vrev <3,6,7,0>
- 2686027989U, // <6,3,0,u>: Cost 3 vext3 <0,2,4,6>, <3,0,u,2>
- 3759769823U, // <6,3,1,0>: Cost 4 vext3 <0,2,4,6>, <3,1,0,3>
- 3759769830U, // <6,3,1,1>: Cost 4 vext3 <0,2,4,6>, <3,1,1,1>
- 3759769841U, // <6,3,1,2>: Cost 4 vext3 <0,2,4,6>, <3,1,2,3>
- 3759769848U, // <6,3,1,3>: Cost 4 vext3 <0,2,4,6>, <3,1,3,1>
- 2703280390U, // <6,3,1,4>: Cost 3 vext3 <3,1,4,6>, <3,1,4,6>
- 3759769868U, // <6,3,1,5>: Cost 4 vext3 <0,2,4,6>, <3,1,5,3>
- 3704063194U, // <6,3,1,6>: Cost 4 vext2 <2,1,6,3>, <1,6,3,0>
- 3767732510U, // <6,3,1,7>: Cost 4 vext3 <1,5,4,6>, <3,1,7,3>
- 2703280390U, // <6,3,1,u>: Cost 3 vext3 <3,1,4,6>, <3,1,4,6>
- 3704063468U, // <6,3,2,0>: Cost 4 vext2 <2,1,6,3>, <2,0,6,4>
- 2630321724U, // <6,3,2,1>: Cost 3 vext2 <2,1,6,3>, <2,1,6,3>
- 3759769921U, // <6,3,2,2>: Cost 4 vext3 <0,2,4,6>, <3,2,2,2>
- 3759769928U, // <6,3,2,3>: Cost 4 vext3 <0,2,4,6>, <3,2,3,0>
- 3704063767U, // <6,3,2,4>: Cost 4 vext2 <2,1,6,3>, <2,4,3,6>
- 3704063876U, // <6,3,2,5>: Cost 4 vext2 <2,1,6,3>, <2,5,6,7>
- 2636957626U, // <6,3,2,6>: Cost 3 vext2 <3,2,6,3>, <2,6,3,7>
- 3777907058U, // <6,3,2,7>: Cost 4 vext3 <3,2,7,6>, <3,2,7,6>
- 2630321724U, // <6,3,2,u>: Cost 3 vext2 <2,1,6,3>, <2,1,6,3>
- 3759769983U, // <6,3,3,0>: Cost 4 vext3 <0,2,4,6>, <3,3,0,1>
- 3710036245U, // <6,3,3,1>: Cost 4 vext2 <3,1,6,3>, <3,1,6,3>
- 2636958054U, // <6,3,3,2>: Cost 3 vext2 <3,2,6,3>, <3,2,6,3>
- 2686028188U, // <6,3,3,3>: Cost 3 vext3 <0,2,4,6>, <3,3,3,3>
- 2704607656U, // <6,3,3,4>: Cost 3 vext3 <3,3,4,6>, <3,3,4,6>
- 3773041072U, // <6,3,3,5>: Cost 4 vext3 <2,4,4,6>, <3,3,5,5>
- 3711363731U, // <6,3,3,6>: Cost 4 vext2 <3,3,6,3>, <3,6,3,7>
- 3767732676U, // <6,3,3,7>: Cost 4 vext3 <1,5,4,6>, <3,3,7,7>
- 2707999179U, // <6,3,3,u>: Cost 3 vext3 <3,u,5,6>, <3,3,u,5>
- 2584232038U, // <6,3,4,0>: Cost 3 vext1 <5,6,3,4>, LHS
- 2642267118U, // <6,3,4,1>: Cost 3 vext2 <4,1,6,3>, <4,1,6,3>
- 2642930751U, // <6,3,4,2>: Cost 3 vext2 <4,2,6,3>, <4,2,6,3>
- 2705197552U, // <6,3,4,3>: Cost 3 vext3 <3,4,3,6>, <3,4,3,6>
- 2584235318U, // <6,3,4,4>: Cost 3 vext1 <5,6,3,4>, RHS
- 1631603202U, // <6,3,4,5>: Cost 2 vext3 <3,4,5,6>, <3,4,5,6>
- 2654211444U, // <6,3,4,6>: Cost 3 vext2 <6,1,6,3>, <4,6,4,6>
- 2237041332U, // <6,3,4,7>: Cost 3 vrev <3,6,7,4>
- 1631824413U, // <6,3,4,u>: Cost 2 vext3 <3,4,u,6>, <3,4,u,6>
- 3640066150U, // <6,3,5,0>: Cost 4 vext1 <2,6,3,5>, LHS
- 3772746288U, // <6,3,5,1>: Cost 4 vext3 <2,4,0,6>, <3,5,1,7>
- 3640067790U, // <6,3,5,2>: Cost 4 vext1 <2,6,3,5>, <2,3,4,5>
- 3773041216U, // <6,3,5,3>: Cost 4 vext3 <2,4,4,6>, <3,5,3,5>
- 2705934922U, // <6,3,5,4>: Cost 3 vext3 <3,5,4,6>, <3,5,4,6>
- 3773041236U, // <6,3,5,5>: Cost 4 vext3 <2,4,4,6>, <3,5,5,7>
- 3779086940U, // <6,3,5,6>: Cost 4 vext3 <3,4,5,6>, <3,5,6,6>
- 3767732831U, // <6,3,5,7>: Cost 4 vext3 <1,5,4,6>, <3,5,7,0>
- 2706229870U, // <6,3,5,u>: Cost 3 vext3 <3,5,u,6>, <3,5,u,6>
- 2602164326U, // <6,3,6,0>: Cost 3 vext1 <u,6,3,6>, LHS
- 2654212512U, // <6,3,6,1>: Cost 3 vext2 <6,1,6,3>, <6,1,6,3>
- 2566334393U, // <6,3,6,2>: Cost 3 vext1 <2,6,3,6>, <2,6,3,6>
- 3704066588U, // <6,3,6,3>: Cost 4 vext2 <2,1,6,3>, <6,3,2,1>
- 2602167524U, // <6,3,6,4>: Cost 3 vext1 <u,6,3,6>, <4,4,6,6>
- 3710702321U, // <6,3,6,5>: Cost 4 vext2 <3,2,6,3>, <6,5,7,7>
- 2724661933U, // <6,3,6,6>: Cost 3 vext3 <6,6,6,6>, <3,6,6,6>
- 3710702465U, // <6,3,6,7>: Cost 4 vext2 <3,2,6,3>, <6,7,5,7>
- 2602170158U, // <6,3,6,u>: Cost 3 vext1 <u,6,3,6>, LHS
- 1492598886U, // <6,3,7,0>: Cost 2 vext1 <2,6,3,7>, LHS
- 2560369889U, // <6,3,7,1>: Cost 3 vext1 <1,6,3,7>, <1,6,3,7>
- 1492600762U, // <6,3,7,2>: Cost 2 vext1 <2,6,3,7>, <2,6,3,7>
- 2566342806U, // <6,3,7,3>: Cost 3 vext1 <2,6,3,7>, <3,0,1,2>
- 1492602166U, // <6,3,7,4>: Cost 2 vext1 <2,6,3,7>, RHS
- 2602176208U, // <6,3,7,5>: Cost 3 vext1 <u,6,3,7>, <5,1,7,3>
- 2566345210U, // <6,3,7,6>: Cost 3 vext1 <2,6,3,7>, <6,2,7,3>
- 2980496528U, // <6,3,7,7>: Cost 3 vzipr RHS, <1,5,3,7>
- 1492604718U, // <6,3,7,u>: Cost 2 vext1 <2,6,3,7>, LHS
- 1492607078U, // <6,3,u,0>: Cost 2 vext1 <2,6,3,u>, LHS
- 2686028574U, // <6,3,u,1>: Cost 3 vext3 <0,2,4,6>, <3,u,1,2>
- 1492608955U, // <6,3,u,2>: Cost 2 vext1 <2,6,3,u>, <2,6,3,u>
- 2566350998U, // <6,3,u,3>: Cost 3 vext1 <2,6,3,u>, <3,0,1,2>
- 1492610358U, // <6,3,u,4>: Cost 2 vext1 <2,6,3,u>, RHS
- 1634257734U, // <6,3,u,5>: Cost 2 vext3 <3,u,5,6>, <3,u,5,6>
- 2566353489U, // <6,3,u,6>: Cost 3 vext1 <2,6,3,u>, <6,3,u,0>
- 2980504720U, // <6,3,u,7>: Cost 3 vzipr RHS, <1,5,3,7>
- 1492612910U, // <6,3,u,u>: Cost 2 vext1 <2,6,3,u>, LHS
- 3703406592U, // <6,4,0,0>: Cost 4 vext2 <2,0,6,4>, <0,0,0,0>
- 2629664870U, // <6,4,0,1>: Cost 3 vext2 <2,0,6,4>, LHS
- 2629664972U, // <6,4,0,2>: Cost 3 vext2 <2,0,6,4>, <0,2,4,6>
- 3779087232U, // <6,4,0,3>: Cost 4 vext3 <3,4,5,6>, <4,0,3,1>
- 2642936156U, // <6,4,0,4>: Cost 3 vext2 <4,2,6,4>, <0,4,2,6>
- 2712570770U, // <6,4,0,5>: Cost 3 vext3 <4,6,4,6>, <4,0,5,1>
- 2687208348U, // <6,4,0,6>: Cost 3 vext3 <0,4,2,6>, <4,0,6,2>
- 3316723081U, // <6,4,0,7>: Cost 4 vrev <4,6,7,0>
- 2629665437U, // <6,4,0,u>: Cost 3 vext2 <2,0,6,4>, LHS
- 2242473291U, // <6,4,1,0>: Cost 3 vrev <4,6,0,1>
- 3700089652U, // <6,4,1,1>: Cost 4 vext2 <1,4,6,4>, <1,1,1,1>
- 3703407510U, // <6,4,1,2>: Cost 4 vext2 <2,0,6,4>, <1,2,3,0>
- 2852962406U, // <6,4,1,3>: Cost 3 vuzpr <5,6,7,4>, LHS
- 3628166454U, // <6,4,1,4>: Cost 4 vext1 <0,6,4,1>, RHS
- 3760876514U, // <6,4,1,5>: Cost 4 vext3 <0,4,1,6>, <4,1,5,0>
- 2687208430U, // <6,4,1,6>: Cost 3 vext3 <0,4,2,6>, <4,1,6,3>
- 3316731274U, // <6,4,1,7>: Cost 4 vrev <4,6,7,1>
- 2243063187U, // <6,4,1,u>: Cost 3 vrev <4,6,u,1>
- 2629666284U, // <6,4,2,0>: Cost 3 vext2 <2,0,6,4>, <2,0,6,4>
- 3703408188U, // <6,4,2,1>: Cost 4 vext2 <2,0,6,4>, <2,1,6,3>
- 3703408232U, // <6,4,2,2>: Cost 4 vext2 <2,0,6,4>, <2,2,2,2>
- 3703408294U, // <6,4,2,3>: Cost 4 vext2 <2,0,6,4>, <2,3,0,1>
- 2632320816U, // <6,4,2,4>: Cost 3 vext2 <2,4,6,4>, <2,4,6,4>
- 2923384118U, // <6,4,2,5>: Cost 3 vzipl <6,2,7,3>, RHS
- 2687208508U, // <6,4,2,6>: Cost 3 vext3 <0,4,2,6>, <4,2,6,0>
- 3760950341U, // <6,4,2,7>: Cost 4 vext3 <0,4,2,6>, <4,2,7,0>
- 2634975348U, // <6,4,2,u>: Cost 3 vext2 <2,u,6,4>, <2,u,6,4>
- 3703408790U, // <6,4,3,0>: Cost 4 vext2 <2,0,6,4>, <3,0,1,2>
- 3316305238U, // <6,4,3,1>: Cost 4 vrev <4,6,1,3>
- 3703408947U, // <6,4,3,2>: Cost 4 vext2 <2,0,6,4>, <3,2,0,6>
- 3703409052U, // <6,4,3,3>: Cost 4 vext2 <2,0,6,4>, <3,3,3,3>
- 2644929026U, // <6,4,3,4>: Cost 3 vext2 <4,5,6,4>, <3,4,5,6>
- 3718670922U, // <6,4,3,5>: Cost 4 vext2 <4,5,6,4>, <3,5,4,6>
- 2705345682U, // <6,4,3,6>: Cost 3 vext3 <3,4,5,6>, <4,3,6,5>
- 3926705152U, // <6,4,3,7>: Cost 4 vuzpr <5,6,7,4>, <1,3,5,7>
- 2668817222U, // <6,4,3,u>: Cost 3 vext2 <u,5,6,4>, <3,u,5,6>
- 2590277734U, // <6,4,4,0>: Cost 3 vext1 <6,6,4,4>, LHS
- 3716017135U, // <6,4,4,1>: Cost 4 vext2 <4,1,6,4>, <4,1,6,4>
- 2642938944U, // <6,4,4,2>: Cost 3 vext2 <4,2,6,4>, <4,2,6,4>
- 3717344401U, // <6,4,4,3>: Cost 4 vext2 <4,3,6,4>, <4,3,6,4>
- 2712571088U, // <6,4,4,4>: Cost 3 vext3 <4,6,4,6>, <4,4,4,4>
- 2629668150U, // <6,4,4,5>: Cost 3 vext2 <2,0,6,4>, RHS
- 1637649636U, // <6,4,4,6>: Cost 2 vext3 <4,4,6,6>, <4,4,6,6>
- 2646257109U, // <6,4,4,7>: Cost 3 vext2 <4,7,6,4>, <4,7,6,4>
- 1637649636U, // <6,4,4,u>: Cost 2 vext3 <4,4,6,6>, <4,4,6,6>
- 2566398054U, // <6,4,5,0>: Cost 3 vext1 <2,6,4,5>, LHS
- 3760876805U, // <6,4,5,1>: Cost 4 vext3 <0,4,1,6>, <4,5,1,3>
- 2566399937U, // <6,4,5,2>: Cost 3 vext1 <2,6,4,5>, <2,6,4,5>
- 2584316418U, // <6,4,5,3>: Cost 3 vext1 <5,6,4,5>, <3,4,5,6>
- 2566401334U, // <6,4,5,4>: Cost 3 vext1 <2,6,4,5>, RHS
- 2584318028U, // <6,4,5,5>: Cost 3 vext1 <5,6,4,5>, <5,6,4,5>
- 1612287286U, // <6,4,5,6>: Cost 2 vext3 <0,2,4,6>, RHS
- 2852965686U, // <6,4,5,7>: Cost 3 vuzpr <5,6,7,4>, RHS
- 1612287304U, // <6,4,5,u>: Cost 2 vext3 <0,2,4,6>, RHS
- 1504608358U, // <6,4,6,0>: Cost 2 vext1 <4,6,4,6>, LHS
- 2578350838U, // <6,4,6,1>: Cost 3 vext1 <4,6,4,6>, <1,0,3,2>
- 2578351720U, // <6,4,6,2>: Cost 3 vext1 <4,6,4,6>, <2,2,2,2>
- 2578352278U, // <6,4,6,3>: Cost 3 vext1 <4,6,4,6>, <3,0,1,2>
- 1504611638U, // <6,4,6,4>: Cost 2 vext1 <4,6,4,6>, RHS
- 2578353872U, // <6,4,6,5>: Cost 3 vext1 <4,6,4,6>, <5,1,7,3>
- 2578354682U, // <6,4,6,6>: Cost 3 vext1 <4,6,4,6>, <6,2,7,3>
- 2578355194U, // <6,4,6,7>: Cost 3 vext1 <4,6,4,6>, <7,0,1,2>
- 1504614190U, // <6,4,6,u>: Cost 2 vext1 <4,6,4,6>, LHS
- 2572386406U, // <6,4,7,0>: Cost 3 vext1 <3,6,4,7>, LHS
- 2572387226U, // <6,4,7,1>: Cost 3 vext1 <3,6,4,7>, <1,2,3,4>
- 3640157902U, // <6,4,7,2>: Cost 4 vext1 <2,6,4,7>, <2,3,4,5>
- 2572389020U, // <6,4,7,3>: Cost 3 vext1 <3,6,4,7>, <3,6,4,7>
- 2572389686U, // <6,4,7,4>: Cost 3 vext1 <3,6,4,7>, RHS
- 2980497102U, // <6,4,7,5>: Cost 3 vzipr RHS, <2,3,4,5>
- 2980495564U, // <6,4,7,6>: Cost 3 vzipr RHS, <0,2,4,6>
- 4054239090U, // <6,4,7,7>: Cost 4 vzipr RHS, <2,5,4,7>
- 2572392238U, // <6,4,7,u>: Cost 3 vext1 <3,6,4,7>, LHS
- 1504608358U, // <6,4,u,0>: Cost 2 vext1 <4,6,4,6>, LHS
- 2629670702U, // <6,4,u,1>: Cost 3 vext2 <2,0,6,4>, LHS
- 2566424516U, // <6,4,u,2>: Cost 3 vext1 <2,6,4,u>, <2,6,4,u>
- 2584340994U, // <6,4,u,3>: Cost 3 vext1 <5,6,4,u>, <3,4,5,6>
- 1640156694U, // <6,4,u,4>: Cost 2 vext3 <4,u,4,6>, <4,u,4,6>
- 2629671066U, // <6,4,u,5>: Cost 3 vext2 <2,0,6,4>, RHS
- 1612287529U, // <6,4,u,6>: Cost 2 vext3 <0,2,4,6>, RHS
- 2852965929U, // <6,4,u,7>: Cost 3 vuzpr <5,6,7,4>, RHS
- 1612287547U, // <6,4,u,u>: Cost 2 vext3 <0,2,4,6>, RHS
- 3708723200U, // <6,5,0,0>: Cost 4 vext2 <2,u,6,5>, <0,0,0,0>
- 2634981478U, // <6,5,0,1>: Cost 3 vext2 <2,u,6,5>, LHS
- 3694125260U, // <6,5,0,2>: Cost 4 vext2 <0,4,6,5>, <0,2,4,6>
- 3779087962U, // <6,5,0,3>: Cost 4 vext3 <3,4,5,6>, <5,0,3,2>
- 3760877154U, // <6,5,0,4>: Cost 4 vext3 <0,4,1,6>, <5,0,4,1>
- 4195110916U, // <6,5,0,5>: Cost 4 vtrnr <5,6,7,0>, <5,5,5,5>
- 3696779775U, // <6,5,0,6>: Cost 4 vext2 <0,u,6,5>, <0,6,2,7>
- 1175212130U, // <6,5,0,7>: Cost 2 vrev <5,6,7,0>
- 1175285867U, // <6,5,0,u>: Cost 2 vrev <5,6,u,0>
- 2248445988U, // <6,5,1,0>: Cost 3 vrev <5,6,0,1>
- 3698107237U, // <6,5,1,1>: Cost 4 vext2 <1,1,6,5>, <1,1,6,5>
- 3708724118U, // <6,5,1,2>: Cost 4 vext2 <2,u,6,5>, <1,2,3,0>
- 3908575334U, // <6,5,1,3>: Cost 4 vuzpr <2,6,4,5>, LHS
- 3716023376U, // <6,5,1,4>: Cost 4 vext2 <4,1,6,5>, <1,4,5,6>
- 3708724368U, // <6,5,1,5>: Cost 4 vext2 <2,u,6,5>, <1,5,3,7>
- 3767733960U, // <6,5,1,6>: Cost 4 vext3 <1,5,4,6>, <5,1,6,4>
- 2712571600U, // <6,5,1,7>: Cost 3 vext3 <4,6,4,6>, <5,1,7,3>
- 2712571609U, // <6,5,1,u>: Cost 3 vext3 <4,6,4,6>, <5,1,u,3>
- 2578391142U, // <6,5,2,0>: Cost 3 vext1 <4,6,5,2>, LHS
- 3704079934U, // <6,5,2,1>: Cost 4 vext2 <2,1,6,5>, <2,1,6,5>
- 3708724840U, // <6,5,2,2>: Cost 4 vext2 <2,u,6,5>, <2,2,2,2>
- 3705407182U, // <6,5,2,3>: Cost 4 vext2 <2,3,6,5>, <2,3,4,5>
- 2578394422U, // <6,5,2,4>: Cost 3 vext1 <4,6,5,2>, RHS
- 3717351272U, // <6,5,2,5>: Cost 4 vext2 <4,3,6,5>, <2,5,3,6>
- 2634983354U, // <6,5,2,6>: Cost 3 vext2 <2,u,6,5>, <2,6,3,7>
- 3115486518U, // <6,5,2,7>: Cost 3 vtrnr <4,6,u,2>, RHS
- 2634983541U, // <6,5,2,u>: Cost 3 vext2 <2,u,6,5>, <2,u,6,5>
- 3708725398U, // <6,5,3,0>: Cost 4 vext2 <2,u,6,5>, <3,0,1,2>
- 3710052631U, // <6,5,3,1>: Cost 4 vext2 <3,1,6,5>, <3,1,6,5>
- 3708725606U, // <6,5,3,2>: Cost 4 vext2 <2,u,6,5>, <3,2,6,3>
- 3708725660U, // <6,5,3,3>: Cost 4 vext2 <2,u,6,5>, <3,3,3,3>
- 2643610114U, // <6,5,3,4>: Cost 3 vext2 <4,3,6,5>, <3,4,5,6>
- 3717352010U, // <6,5,3,5>: Cost 4 vext2 <4,3,6,5>, <3,5,4,6>
- 3773632358U, // <6,5,3,6>: Cost 4 vext3 <2,5,3,6>, <5,3,6,0>
- 2248978533U, // <6,5,3,7>: Cost 3 vrev <5,6,7,3>
- 2249052270U, // <6,5,3,u>: Cost 3 vrev <5,6,u,3>
- 2596323430U, // <6,5,4,0>: Cost 3 vext1 <7,6,5,4>, LHS
- 3716025328U, // <6,5,4,1>: Cost 4 vext2 <4,1,6,5>, <4,1,6,5>
- 3716688961U, // <6,5,4,2>: Cost 4 vext2 <4,2,6,5>, <4,2,6,5>
- 2643610770U, // <6,5,4,3>: Cost 3 vext2 <4,3,6,5>, <4,3,6,5>
- 2596326710U, // <6,5,4,4>: Cost 3 vext1 <7,6,5,4>, RHS
- 2634984758U, // <6,5,4,5>: Cost 3 vext2 <2,u,6,5>, RHS
- 3767734199U, // <6,5,4,6>: Cost 4 vext3 <1,5,4,6>, <5,4,6,0>
- 1643696070U, // <6,5,4,7>: Cost 2 vext3 <5,4,7,6>, <5,4,7,6>
- 1643769807U, // <6,5,4,u>: Cost 2 vext3 <5,4,u,6>, <5,4,u,6>
- 2578415718U, // <6,5,5,0>: Cost 3 vext1 <4,6,5,5>, LHS
- 3652158198U, // <6,5,5,1>: Cost 4 vext1 <4,6,5,5>, <1,0,3,2>
- 3652159080U, // <6,5,5,2>: Cost 4 vext1 <4,6,5,5>, <2,2,2,2>
- 3652159638U, // <6,5,5,3>: Cost 4 vext1 <4,6,5,5>, <3,0,1,2>
- 2578418998U, // <6,5,5,4>: Cost 3 vext1 <4,6,5,5>, RHS
- 2712571908U, // <6,5,5,5>: Cost 3 vext3 <4,6,4,6>, <5,5,5,5>
- 2718027790U, // <6,5,5,6>: Cost 3 vext3 <5,5,6,6>, <5,5,6,6>
- 2712571928U, // <6,5,5,7>: Cost 3 vext3 <4,6,4,6>, <5,5,7,7>
- 2712571937U, // <6,5,5,u>: Cost 3 vext3 <4,6,4,6>, <5,5,u,7>
- 2705346596U, // <6,5,6,0>: Cost 3 vext3 <3,4,5,6>, <5,6,0,1>
- 3767144496U, // <6,5,6,1>: Cost 4 vext3 <1,4,5,6>, <5,6,1,4>
- 3773116473U, // <6,5,6,2>: Cost 4 vext3 <2,4,5,6>, <5,6,2,4>
- 2705346626U, // <6,5,6,3>: Cost 3 vext3 <3,4,5,6>, <5,6,3,4>
- 2705346636U, // <6,5,6,4>: Cost 3 vext3 <3,4,5,6>, <5,6,4,5>
- 3908577217U, // <6,5,6,5>: Cost 4 vuzpr <2,6,4,5>, <2,6,4,5>
- 2578428728U, // <6,5,6,6>: Cost 3 vext1 <4,6,5,6>, <6,6,6,6>
- 2712572002U, // <6,5,6,7>: Cost 3 vext3 <4,6,4,6>, <5,6,7,0>
- 2705346668U, // <6,5,6,u>: Cost 3 vext3 <3,4,5,6>, <5,6,u,1>
- 2560516198U, // <6,5,7,0>: Cost 3 vext1 <1,6,5,7>, LHS
- 2560517363U, // <6,5,7,1>: Cost 3 vext1 <1,6,5,7>, <1,6,5,7>
- 2566490060U, // <6,5,7,2>: Cost 3 vext1 <2,6,5,7>, <2,6,5,7>
- 3634260118U, // <6,5,7,3>: Cost 4 vext1 <1,6,5,7>, <3,0,1,2>
- 2560519478U, // <6,5,7,4>: Cost 3 vext1 <1,6,5,7>, RHS
- 2980498650U, // <6,5,7,5>: Cost 3 vzipr RHS, <4,4,5,5>
- 2980497922U, // <6,5,7,6>: Cost 3 vzipr RHS, <3,4,5,6>
- 3103214902U, // <6,5,7,7>: Cost 3 vtrnr <2,6,3,7>, RHS
- 2560522030U, // <6,5,7,u>: Cost 3 vext1 <1,6,5,7>, LHS
- 2560524390U, // <6,5,u,0>: Cost 3 vext1 <1,6,5,u>, LHS
- 2560525556U, // <6,5,u,1>: Cost 3 vext1 <1,6,5,u>, <1,6,5,u>
- 2566498253U, // <6,5,u,2>: Cost 3 vext1 <2,6,5,u>, <2,6,5,u>
- 2646931439U, // <6,5,u,3>: Cost 3 vext2 <4,u,6,5>, <u,3,5,7>
- 2560527670U, // <6,5,u,4>: Cost 3 vext1 <1,6,5,u>, RHS
- 2634987674U, // <6,5,u,5>: Cost 3 vext2 <2,u,6,5>, RHS
- 2980506114U, // <6,5,u,6>: Cost 3 vzipr RHS, <3,4,5,6>
- 1175277674U, // <6,5,u,7>: Cost 2 vrev <5,6,7,u>
- 1175351411U, // <6,5,u,u>: Cost 2 vrev <5,6,u,u>
- 2578448486U, // <6,6,0,0>: Cost 3 vext1 <4,6,6,0>, LHS
- 1573191782U, // <6,6,0,1>: Cost 2 vext2 <4,u,6,6>, LHS
- 2686030124U, // <6,6,0,2>: Cost 3 vext3 <0,2,4,6>, <6,0,2,4>
- 3779088690U, // <6,6,0,3>: Cost 4 vext3 <3,4,5,6>, <6,0,3,1>
- 2687209788U, // <6,6,0,4>: Cost 3 vext3 <0,4,2,6>, <6,0,4,2>
- 3652194000U, // <6,6,0,5>: Cost 4 vext1 <4,6,6,0>, <5,1,7,3>
- 2254852914U, // <6,6,0,6>: Cost 3 vrev <6,6,6,0>
- 4041575734U, // <6,6,0,7>: Cost 4 vzipr <2,4,6,0>, RHS
- 1573192349U, // <6,6,0,u>: Cost 2 vext2 <4,u,6,6>, LHS
- 2646934262U, // <6,6,1,0>: Cost 3 vext2 <4,u,6,6>, <1,0,3,2>
- 2646934324U, // <6,6,1,1>: Cost 3 vext2 <4,u,6,6>, <1,1,1,1>
- 2646934422U, // <6,6,1,2>: Cost 3 vext2 <4,u,6,6>, <1,2,3,0>
- 2846785638U, // <6,6,1,3>: Cost 3 vuzpr <4,6,4,6>, LHS
- 3760951694U, // <6,6,1,4>: Cost 4 vext3 <0,4,2,6>, <6,1,4,3>
- 2646934672U, // <6,6,1,5>: Cost 3 vext2 <4,u,6,6>, <1,5,3,7>
- 2712572320U, // <6,6,1,6>: Cost 3 vext3 <4,6,4,6>, <6,1,6,3>
- 3775549865U, // <6,6,1,7>: Cost 4 vext3 <2,u,2,6>, <6,1,7,3>
- 2846785643U, // <6,6,1,u>: Cost 3 vuzpr <4,6,4,6>, LHS
- 3759772094U, // <6,6,2,0>: Cost 4 vext3 <0,2,4,6>, <6,2,0,6>
- 3704751676U, // <6,6,2,1>: Cost 4 vext2 <2,2,6,6>, <2,1,6,3>
- 2631009936U, // <6,6,2,2>: Cost 3 vext2 <2,2,6,6>, <2,2,6,6>
- 2646935206U, // <6,6,2,3>: Cost 3 vext2 <4,u,6,6>, <2,3,0,1>
- 3759772127U, // <6,6,2,4>: Cost 4 vext3 <0,2,4,6>, <6,2,4,3>
- 3704752004U, // <6,6,2,5>: Cost 4 vext2 <2,2,6,6>, <2,5,6,7>
- 2646935482U, // <6,6,2,6>: Cost 3 vext2 <4,u,6,6>, <2,6,3,7>
- 2712572410U, // <6,6,2,7>: Cost 3 vext3 <4,6,4,6>, <6,2,7,3>
- 2712572419U, // <6,6,2,u>: Cost 3 vext3 <4,6,4,6>, <6,2,u,3>
- 2646935702U, // <6,6,3,0>: Cost 3 vext2 <4,u,6,6>, <3,0,1,2>
- 3777024534U, // <6,6,3,1>: Cost 4 vext3 <3,1,4,6>, <6,3,1,4>
- 3704752453U, // <6,6,3,2>: Cost 4 vext2 <2,2,6,6>, <3,2,2,6>
- 2646935964U, // <6,6,3,3>: Cost 3 vext2 <4,u,6,6>, <3,3,3,3>
- 2705347122U, // <6,6,3,4>: Cost 3 vext3 <3,4,5,6>, <6,3,4,5>
- 3779678778U, // <6,6,3,5>: Cost 4 vext3 <3,5,4,6>, <6,3,5,4>
- 2657553069U, // <6,6,3,6>: Cost 3 vext2 <6,6,6,6>, <3,6,6,6>
- 4039609654U, // <6,6,3,7>: Cost 4 vzipr <2,1,6,3>, RHS
- 2708001366U, // <6,6,3,u>: Cost 3 vext3 <3,u,5,6>, <6,3,u,5>
- 2578481254U, // <6,6,4,0>: Cost 3 vext1 <4,6,6,4>, LHS
- 3652223734U, // <6,6,4,1>: Cost 4 vext1 <4,6,6,4>, <1,0,3,2>
- 3760951922U, // <6,6,4,2>: Cost 4 vext3 <0,4,2,6>, <6,4,2,6>
- 3779089019U, // <6,6,4,3>: Cost 4 vext3 <3,4,5,6>, <6,4,3,6>
- 1570540772U, // <6,6,4,4>: Cost 2 vext2 <4,4,6,6>, <4,4,6,6>
- 1573195062U, // <6,6,4,5>: Cost 2 vext2 <4,u,6,6>, RHS
- 2712572560U, // <6,6,4,6>: Cost 3 vext3 <4,6,4,6>, <6,4,6,0>
- 2723410591U, // <6,6,4,7>: Cost 3 vext3 <6,4,7,6>, <6,4,7,6>
- 1573195304U, // <6,6,4,u>: Cost 2 vext2 <4,u,6,6>, <4,u,6,6>
- 3640287334U, // <6,6,5,0>: Cost 4 vext1 <2,6,6,5>, LHS
- 2646937296U, // <6,6,5,1>: Cost 3 vext2 <4,u,6,6>, <5,1,7,3>
- 3640289235U, // <6,6,5,2>: Cost 4 vext1 <2,6,6,5>, <2,6,6,5>
- 3720679279U, // <6,6,5,3>: Cost 4 vext2 <4,u,6,6>, <5,3,7,0>
- 2646937542U, // <6,6,5,4>: Cost 3 vext2 <4,u,6,6>, <5,4,7,6>
- 2646937604U, // <6,6,5,5>: Cost 3 vext2 <4,u,6,6>, <5,5,5,5>
- 2646937698U, // <6,6,5,6>: Cost 3 vext2 <4,u,6,6>, <5,6,7,0>
- 2846788918U, // <6,6,5,7>: Cost 3 vuzpr <4,6,4,6>, RHS
- 2846788919U, // <6,6,5,u>: Cost 3 vuzpr <4,6,4,6>, RHS
- 1516699750U, // <6,6,6,0>: Cost 2 vext1 <6,6,6,6>, LHS
- 2590442230U, // <6,6,6,1>: Cost 3 vext1 <6,6,6,6>, <1,0,3,2>
- 2646938106U, // <6,6,6,2>: Cost 3 vext2 <4,u,6,6>, <6,2,7,3>
- 2590443670U, // <6,6,6,3>: Cost 3 vext1 <6,6,6,6>, <3,0,1,2>
- 1516703030U, // <6,6,6,4>: Cost 2 vext1 <6,6,6,6>, RHS
- 2590445264U, // <6,6,6,5>: Cost 3 vext1 <6,6,6,6>, <5,1,7,3>
- 296144182U, // <6,6,6,6>: Cost 1 vdup2 RHS
- 2712572738U, // <6,6,6,7>: Cost 3 vext3 <4,6,4,6>, <6,6,7,7>
- 296144182U, // <6,6,6,u>: Cost 1 vdup2 RHS
- 2566561894U, // <6,6,7,0>: Cost 3 vext1 <2,6,6,7>, LHS
- 3634332924U, // <6,6,7,1>: Cost 4 vext1 <1,6,6,7>, <1,6,6,7>
- 2566563797U, // <6,6,7,2>: Cost 3 vext1 <2,6,6,7>, <2,6,6,7>
- 2584480258U, // <6,6,7,3>: Cost 3 vext1 <5,6,6,7>, <3,4,5,6>
- 2566565174U, // <6,6,7,4>: Cost 3 vext1 <2,6,6,7>, RHS
- 2717438846U, // <6,6,7,5>: Cost 3 vext3 <5,4,7,6>, <6,7,5,4>
- 2980500280U, // <6,6,7,6>: Cost 3 vzipr RHS, <6,6,6,6>
- 1906756918U, // <6,6,7,7>: Cost 2 vzipr RHS, RHS
- 1906756919U, // <6,6,7,u>: Cost 2 vzipr RHS, RHS
- 1516699750U, // <6,6,u,0>: Cost 2 vext1 <6,6,6,6>, LHS
- 1573197614U, // <6,6,u,1>: Cost 2 vext2 <4,u,6,6>, LHS
- 2566571990U, // <6,6,u,2>: Cost 3 vext1 <2,6,6,u>, <2,6,6,u>
- 2846786205U, // <6,6,u,3>: Cost 3 vuzpr <4,6,4,6>, LHS
- 1516703030U, // <6,6,u,4>: Cost 2 vext1 <6,6,6,6>, RHS
- 1573197978U, // <6,6,u,5>: Cost 2 vext2 <4,u,6,6>, RHS
- 296144182U, // <6,6,u,6>: Cost 1 vdup2 RHS
- 1906765110U, // <6,6,u,7>: Cost 2 vzipr RHS, RHS
- 296144182U, // <6,6,u,u>: Cost 1 vdup2 RHS
- 1571209216U, // <6,7,0,0>: Cost 2 vext2 RHS, <0,0,0,0>
- 497467494U, // <6,7,0,1>: Cost 1 vext2 RHS, LHS
- 1571209380U, // <6,7,0,2>: Cost 2 vext2 RHS, <0,2,0,2>
- 2644951292U, // <6,7,0,3>: Cost 3 vext2 RHS, <0,3,1,0>
- 1571209554U, // <6,7,0,4>: Cost 2 vext2 RHS, <0,4,1,5>
- 1510756450U, // <6,7,0,5>: Cost 2 vext1 <5,6,7,0>, <5,6,7,0>
- 2644951542U, // <6,7,0,6>: Cost 3 vext2 RHS, <0,6,1,7>
- 2584499194U, // <6,7,0,7>: Cost 3 vext1 <5,6,7,0>, <7,0,1,2>
- 497468061U, // <6,7,0,u>: Cost 1 vext2 RHS, LHS
- 1571209974U, // <6,7,1,0>: Cost 2 vext2 RHS, <1,0,3,2>
- 1571210036U, // <6,7,1,1>: Cost 2 vext2 RHS, <1,1,1,1>
- 1571210134U, // <6,7,1,2>: Cost 2 vext2 RHS, <1,2,3,0>
- 1571210200U, // <6,7,1,3>: Cost 2 vext2 RHS, <1,3,1,3>
- 2644952098U, // <6,7,1,4>: Cost 3 vext2 RHS, <1,4,0,5>
- 1571210384U, // <6,7,1,5>: Cost 2 vext2 RHS, <1,5,3,7>
- 2644952271U, // <6,7,1,6>: Cost 3 vext2 RHS, <1,6,1,7>
- 2578535418U, // <6,7,1,7>: Cost 3 vext1 <4,6,7,1>, <7,0,1,2>
- 1571210605U, // <6,7,1,u>: Cost 2 vext2 RHS, <1,u,1,3>
- 2644952509U, // <6,7,2,0>: Cost 3 vext2 RHS, <2,0,1,2>
- 2644952582U, // <6,7,2,1>: Cost 3 vext2 RHS, <2,1,0,3>
- 1571210856U, // <6,7,2,2>: Cost 2 vext2 RHS, <2,2,2,2>
- 1571210918U, // <6,7,2,3>: Cost 2 vext2 RHS, <2,3,0,1>
- 2644952828U, // <6,7,2,4>: Cost 3 vext2 RHS, <2,4,0,6>
- 2633009028U, // <6,7,2,5>: Cost 3 vext2 <2,5,6,7>, <2,5,6,7>
- 1571211194U, // <6,7,2,6>: Cost 2 vext2 RHS, <2,6,3,7>
- 2668840938U, // <6,7,2,7>: Cost 3 vext2 RHS, <2,7,0,1>
- 1571211323U, // <6,7,2,u>: Cost 2 vext2 RHS, <2,u,0,1>
- 1571211414U, // <6,7,3,0>: Cost 2 vext2 RHS, <3,0,1,2>
- 2644953311U, // <6,7,3,1>: Cost 3 vext2 RHS, <3,1,0,3>
- 2644953390U, // <6,7,3,2>: Cost 3 vext2 RHS, <3,2,0,1>
- 1571211676U, // <6,7,3,3>: Cost 2 vext2 RHS, <3,3,3,3>
- 1571211778U, // <6,7,3,4>: Cost 2 vext2 RHS, <3,4,5,6>
- 2644953648U, // <6,7,3,5>: Cost 3 vext2 RHS, <3,5,1,7>
- 2644953720U, // <6,7,3,6>: Cost 3 vext2 RHS, <3,6,0,7>
- 2644953795U, // <6,7,3,7>: Cost 3 vext2 RHS, <3,7,0,1>
- 1571212062U, // <6,7,3,u>: Cost 2 vext2 RHS, <3,u,1,2>
- 1573202834U, // <6,7,4,0>: Cost 2 vext2 RHS, <4,0,5,1>
- 2644954058U, // <6,7,4,1>: Cost 3 vext2 RHS, <4,1,2,3>
- 2644954166U, // <6,7,4,2>: Cost 3 vext2 RHS, <4,2,5,3>
- 2644954258U, // <6,7,4,3>: Cost 3 vext2 RHS, <4,3,6,5>
- 1571212496U, // <6,7,4,4>: Cost 2 vext2 RHS, <4,4,4,4>
- 497470774U, // <6,7,4,5>: Cost 1 vext2 RHS, RHS
- 1573203316U, // <6,7,4,6>: Cost 2 vext2 RHS, <4,6,4,6>
- 2646281688U, // <6,7,4,7>: Cost 3 vext2 <4,7,6,7>, <4,7,6,7>
- 497471017U, // <6,7,4,u>: Cost 1 vext2 RHS, RHS
- 2644954696U, // <6,7,5,0>: Cost 3 vext2 RHS, <5,0,1,2>
- 1573203664U, // <6,7,5,1>: Cost 2 vext2 RHS, <5,1,7,3>
- 2644954878U, // <6,7,5,2>: Cost 3 vext2 RHS, <5,2,3,4>
- 2644954991U, // <6,7,5,3>: Cost 3 vext2 RHS, <5,3,7,0>
- 1571213254U, // <6,7,5,4>: Cost 2 vext2 RHS, <5,4,7,6>
- 1571213316U, // <6,7,5,5>: Cost 2 vext2 RHS, <5,5,5,5>
- 1571213410U, // <6,7,5,6>: Cost 2 vext2 RHS, <5,6,7,0>
- 1573204136U, // <6,7,5,7>: Cost 2 vext2 RHS, <5,7,5,7>
- 1573204217U, // <6,7,5,u>: Cost 2 vext2 RHS, <5,u,5,7>
- 2644955425U, // <6,7,6,0>: Cost 3 vext2 RHS, <6,0,1,2>
- 2644955561U, // <6,7,6,1>: Cost 3 vext2 RHS, <6,1,7,3>
- 1573204474U, // <6,7,6,2>: Cost 2 vext2 RHS, <6,2,7,3>
- 2644955698U, // <6,7,6,3>: Cost 3 vext2 RHS, <6,3,4,5>
- 2644955789U, // <6,7,6,4>: Cost 3 vext2 RHS, <6,4,5,6>
- 2644955889U, // <6,7,6,5>: Cost 3 vext2 RHS, <6,5,7,7>
- 1571214136U, // <6,7,6,6>: Cost 2 vext2 RHS, <6,6,6,6>
- 1571214158U, // <6,7,6,7>: Cost 2 vext2 RHS, <6,7,0,1>
- 1573204895U, // <6,7,6,u>: Cost 2 vext2 RHS, <6,u,0,1>
- 1573204986U, // <6,7,7,0>: Cost 2 vext2 RHS, <7,0,1,2>
- 2572608656U, // <6,7,7,1>: Cost 3 vext1 <3,6,7,7>, <1,5,3,7>
- 2644956362U, // <6,7,7,2>: Cost 3 vext2 RHS, <7,2,6,3>
- 2572610231U, // <6,7,7,3>: Cost 3 vext1 <3,6,7,7>, <3,6,7,7>
- 1573205350U, // <6,7,7,4>: Cost 2 vext2 RHS, <7,4,5,6>
- 2646947220U, // <6,7,7,5>: Cost 3 vext2 RHS, <7,5,1,7>
- 1516786498U, // <6,7,7,6>: Cost 2 vext1 <6,6,7,7>, <6,6,7,7>
- 1571214956U, // <6,7,7,7>: Cost 2 vext2 RHS, <7,7,7,7>
- 1573205634U, // <6,7,7,u>: Cost 2 vext2 RHS, <7,u,1,2>
- 1571215059U, // <6,7,u,0>: Cost 2 vext2 RHS, <u,0,1,2>
- 497473326U, // <6,7,u,1>: Cost 1 vext2 RHS, LHS
- 1571215237U, // <6,7,u,2>: Cost 2 vext2 RHS, <u,2,3,0>
- 1571215292U, // <6,7,u,3>: Cost 2 vext2 RHS, <u,3,0,1>
- 1571215423U, // <6,7,u,4>: Cost 2 vext2 RHS, <u,4,5,6>
- 497473690U, // <6,7,u,5>: Cost 1 vext2 RHS, RHS
- 1571215568U, // <6,7,u,6>: Cost 2 vext2 RHS, <u,6,3,7>
- 1573206272U, // <6,7,u,7>: Cost 2 vext2 RHS, <u,7,0,1>
- 497473893U, // <6,7,u,u>: Cost 1 vext2 RHS, LHS
- 1571217408U, // <6,u,0,0>: Cost 2 vext2 RHS, <0,0,0,0>
- 497475686U, // <6,u,0,1>: Cost 1 vext2 RHS, LHS
- 1571217572U, // <6,u,0,2>: Cost 2 vext2 RHS, <0,2,0,2>
- 2689865445U, // <6,u,0,3>: Cost 3 vext3 <0,u,2,6>, <u,0,3,2>
- 1571217746U, // <6,u,0,4>: Cost 2 vext2 RHS, <0,4,1,5>
- 1510830187U, // <6,u,0,5>: Cost 2 vext1 <5,6,u,0>, <5,6,u,0>
- 2644959734U, // <6,u,0,6>: Cost 3 vext2 RHS, <0,6,1,7>
- 1193130221U, // <6,u,0,7>: Cost 2 vrev <u,6,7,0>
- 497476253U, // <6,u,0,u>: Cost 1 vext2 RHS, LHS
- 1571218166U, // <6,u,1,0>: Cost 2 vext2 RHS, <1,0,3,2>
- 1571218228U, // <6,u,1,1>: Cost 2 vext2 RHS, <1,1,1,1>
- 1612289838U, // <6,u,1,2>: Cost 2 vext3 <0,2,4,6>, LHS
- 1571218392U, // <6,u,1,3>: Cost 2 vext2 RHS, <1,3,1,3>
- 2566663478U, // <6,u,1,4>: Cost 3 vext1 <2,6,u,1>, RHS
- 1571218576U, // <6,u,1,5>: Cost 2 vext2 RHS, <1,5,3,7>
- 2644960463U, // <6,u,1,6>: Cost 3 vext2 RHS, <1,6,1,7>
- 2717439835U, // <6,u,1,7>: Cost 3 vext3 <5,4,7,6>, <u,1,7,3>
- 1612289892U, // <6,u,1,u>: Cost 2 vext3 <0,2,4,6>, LHS
- 1504870502U, // <6,u,2,0>: Cost 2 vext1 <4,6,u,2>, LHS
- 2644960774U, // <6,u,2,1>: Cost 3 vext2 RHS, <2,1,0,3>
- 1571219048U, // <6,u,2,2>: Cost 2 vext2 RHS, <2,2,2,2>
- 1571219110U, // <6,u,2,3>: Cost 2 vext2 RHS, <2,3,0,1>
- 1504873782U, // <6,u,2,4>: Cost 2 vext1 <4,6,u,2>, RHS
- 2633017221U, // <6,u,2,5>: Cost 3 vext2 <2,5,6,u>, <2,5,6,u>
- 1571219386U, // <6,u,2,6>: Cost 2 vext2 RHS, <2,6,3,7>
- 2712573868U, // <6,u,2,7>: Cost 3 vext3 <4,6,4,6>, <u,2,7,3>
- 1571219515U, // <6,u,2,u>: Cost 2 vext2 RHS, <2,u,0,1>
- 1571219606U, // <6,u,3,0>: Cost 2 vext2 RHS, <3,0,1,2>
- 2644961503U, // <6,u,3,1>: Cost 3 vext2 RHS, <3,1,0,3>
- 2566678499U, // <6,u,3,2>: Cost 3 vext1 <2,6,u,3>, <2,6,u,3>
- 1571219868U, // <6,u,3,3>: Cost 2 vext2 RHS, <3,3,3,3>
- 1571219970U, // <6,u,3,4>: Cost 2 vext2 RHS, <3,4,5,6>
- 2689865711U, // <6,u,3,5>: Cost 3 vext3 <0,u,2,6>, <u,3,5,7>
- 2708002806U, // <6,u,3,6>: Cost 3 vext3 <3,u,5,6>, <u,3,6,5>
- 2644961987U, // <6,u,3,7>: Cost 3 vext2 RHS, <3,7,0,1>
- 1571220254U, // <6,u,3,u>: Cost 2 vext2 RHS, <3,u,1,2>
- 1571220370U, // <6,u,4,0>: Cost 2 vext2 RHS, <4,0,5,1>
- 2644962250U, // <6,u,4,1>: Cost 3 vext2 RHS, <4,1,2,3>
- 1661245476U, // <6,u,4,2>: Cost 2 vext3 <u,4,2,6>, <u,4,2,6>
- 2686031917U, // <6,u,4,3>: Cost 3 vext3 <0,2,4,6>, <u,4,3,6>
- 1571220688U, // <6,u,4,4>: Cost 2 vext2 RHS, <4,4,4,4>
- 497478967U, // <6,u,4,5>: Cost 1 vext2 RHS, RHS
- 1571220852U, // <6,u,4,6>: Cost 2 vext2 RHS, <4,6,4,6>
- 1661614161U, // <6,u,4,7>: Cost 2 vext3 <u,4,7,6>, <u,4,7,6>
- 497479209U, // <6,u,4,u>: Cost 1 vext2 RHS, RHS
- 2566692966U, // <6,u,5,0>: Cost 3 vext1 <2,6,u,5>, LHS
- 1571221200U, // <6,u,5,1>: Cost 2 vext2 RHS, <5,1,7,3>
- 2566694885U, // <6,u,5,2>: Cost 3 vext1 <2,6,u,5>, <2,6,u,5>
- 2689865855U, // <6,u,5,3>: Cost 3 vext3 <0,u,2,6>, <u,5,3,7>
- 1571221446U, // <6,u,5,4>: Cost 2 vext2 RHS, <5,4,7,6>
- 1571221508U, // <6,u,5,5>: Cost 2 vext2 RHS, <5,5,5,5>
- 1612290202U, // <6,u,5,6>: Cost 2 vext3 <0,2,4,6>, RHS
- 1571221672U, // <6,u,5,7>: Cost 2 vext2 RHS, <5,7,5,7>
- 1612290220U, // <6,u,5,u>: Cost 2 vext3 <0,2,4,6>, RHS
- 1504903270U, // <6,u,6,0>: Cost 2 vext1 <4,6,u,6>, LHS
- 2644963752U, // <6,u,6,1>: Cost 3 vext2 RHS, <6,1,7,2>
- 1571222010U, // <6,u,6,2>: Cost 2 vext2 RHS, <6,2,7,3>
- 2686032080U, // <6,u,6,3>: Cost 3 vext3 <0,2,4,6>, <u,6,3,7>
- 1504906550U, // <6,u,6,4>: Cost 2 vext1 <4,6,u,6>, RHS
- 2644964079U, // <6,u,6,5>: Cost 3 vext2 RHS, <6,5,7,5>
- 296144182U, // <6,u,6,6>: Cost 1 vdup2 RHS
- 1571222350U, // <6,u,6,7>: Cost 2 vext2 RHS, <6,7,0,1>
- 296144182U, // <6,u,6,u>: Cost 1 vdup2 RHS
- 1492967526U, // <6,u,7,0>: Cost 2 vext1 <2,6,u,7>, LHS
- 2560738574U, // <6,u,7,1>: Cost 3 vext1 <1,6,u,7>, <1,6,u,7>
- 1492969447U, // <6,u,7,2>: Cost 2 vext1 <2,6,u,7>, <2,6,u,7>
- 1906753692U, // <6,u,7,3>: Cost 2 vzipr RHS, LHS
- 1492970806U, // <6,u,7,4>: Cost 2 vext1 <2,6,u,7>, RHS
- 2980495761U, // <6,u,7,5>: Cost 3 vzipr RHS, <0,4,u,5>
- 1516860235U, // <6,u,7,6>: Cost 2 vext1 <6,6,u,7>, <6,6,u,7>
- 1906756936U, // <6,u,7,7>: Cost 2 vzipr RHS, RHS
- 1492973358U, // <6,u,7,u>: Cost 2 vext1 <2,6,u,7>, LHS
- 1492975718U, // <6,u,u,0>: Cost 2 vext1 <2,6,u,u>, LHS
- 497481518U, // <6,u,u,1>: Cost 1 vext2 RHS, LHS
- 1612290405U, // <6,u,u,2>: Cost 2 vext3 <0,2,4,6>, LHS
- 1571223484U, // <6,u,u,3>: Cost 2 vext2 RHS, <u,3,0,1>
- 1492978998U, // <6,u,u,4>: Cost 2 vext1 <2,6,u,u>, RHS
- 497481882U, // <6,u,u,5>: Cost 1 vext2 RHS, RHS
- 296144182U, // <6,u,u,6>: Cost 1 vdup2 RHS
- 1906765128U, // <6,u,u,7>: Cost 2 vzipr RHS, RHS
- 497482085U, // <6,u,u,u>: Cost 1 vext2 RHS, LHS
- 1638318080U, // <7,0,0,0>: Cost 2 vext3 RHS, <0,0,0,0>
- 1638318090U, // <7,0,0,1>: Cost 2 vext3 RHS, <0,0,1,1>
- 1638318100U, // <7,0,0,2>: Cost 2 vext3 RHS, <0,0,2,2>
- 3646442178U, // <7,0,0,3>: Cost 4 vext1 <3,7,0,0>, <3,7,0,0>
- 2712059941U, // <7,0,0,4>: Cost 3 vext3 RHS, <0,0,4,1>
- 2651603364U, // <7,0,0,5>: Cost 3 vext2 <5,6,7,0>, <0,5,1,6>
- 2590618445U, // <7,0,0,6>: Cost 3 vext1 <6,7,0,0>, <6,7,0,0>
- 3785801798U, // <7,0,0,7>: Cost 4 vext3 RHS, <0,0,7,7>
- 1638318153U, // <7,0,0,u>: Cost 2 vext3 RHS, <0,0,u,1>
- 1516879974U, // <7,0,1,0>: Cost 2 vext1 <6,7,0,1>, LHS
- 2693922911U, // <7,0,1,1>: Cost 3 vext3 <1,5,3,7>, <0,1,1,5>
- 564576358U, // <7,0,1,2>: Cost 1 vext3 RHS, LHS
- 2638996480U, // <7,0,1,3>: Cost 3 vext2 <3,5,7,0>, <1,3,5,7>
- 1516883254U, // <7,0,1,4>: Cost 2 vext1 <6,7,0,1>, RHS
- 2649613456U, // <7,0,1,5>: Cost 3 vext2 <5,3,7,0>, <1,5,3,7>
- 1516884814U, // <7,0,1,6>: Cost 2 vext1 <6,7,0,1>, <6,7,0,1>
- 2590626808U, // <7,0,1,7>: Cost 3 vext1 <6,7,0,1>, <7,0,1,0>
- 564576412U, // <7,0,1,u>: Cost 1 vext3 RHS, LHS
- 1638318244U, // <7,0,2,0>: Cost 2 vext3 RHS, <0,2,0,2>
- 2692743344U, // <7,0,2,1>: Cost 3 vext3 <1,3,5,7>, <0,2,1,5>
- 2712060084U, // <7,0,2,2>: Cost 3 vext3 RHS, <0,2,2,0>
- 2712060094U, // <7,0,2,3>: Cost 3 vext3 RHS, <0,2,3,1>
- 1638318284U, // <7,0,2,4>: Cost 2 vext3 RHS, <0,2,4,6>
- 2712060118U, // <7,0,2,5>: Cost 3 vext3 RHS, <0,2,5,7>
- 2651604922U, // <7,0,2,6>: Cost 3 vext2 <5,6,7,0>, <2,6,3,7>
- 2686255336U, // <7,0,2,7>: Cost 3 vext3 <0,2,7,7>, <0,2,7,7>
- 1638318316U, // <7,0,2,u>: Cost 2 vext3 RHS, <0,2,u,2>
- 2651605142U, // <7,0,3,0>: Cost 3 vext2 <5,6,7,0>, <3,0,1,2>
- 2712060156U, // <7,0,3,1>: Cost 3 vext3 RHS, <0,3,1,0>
- 2712060165U, // <7,0,3,2>: Cost 3 vext3 RHS, <0,3,2,0>
- 2651605404U, // <7,0,3,3>: Cost 3 vext2 <5,6,7,0>, <3,3,3,3>
- 2651605506U, // <7,0,3,4>: Cost 3 vext2 <5,6,7,0>, <3,4,5,6>
- 2638998111U, // <7,0,3,5>: Cost 3 vext2 <3,5,7,0>, <3,5,7,0>
- 2639661744U, // <7,0,3,6>: Cost 3 vext2 <3,6,7,0>, <3,6,7,0>
- 3712740068U, // <7,0,3,7>: Cost 4 vext2 <3,5,7,0>, <3,7,3,7>
- 2640989010U, // <7,0,3,u>: Cost 3 vext2 <3,u,7,0>, <3,u,7,0>
- 2712060232U, // <7,0,4,0>: Cost 3 vext3 RHS, <0,4,0,4>
- 1638318418U, // <7,0,4,1>: Cost 2 vext3 RHS, <0,4,1,5>
- 1638318428U, // <7,0,4,2>: Cost 2 vext3 RHS, <0,4,2,6>
- 3646474950U, // <7,0,4,3>: Cost 4 vext1 <3,7,0,4>, <3,7,0,4>
- 2712060270U, // <7,0,4,4>: Cost 3 vext3 RHS, <0,4,4,6>
- 1577864502U, // <7,0,4,5>: Cost 2 vext2 <5,6,7,0>, RHS
- 2651606388U, // <7,0,4,6>: Cost 3 vext2 <5,6,7,0>, <4,6,4,6>
- 3787792776U, // <7,0,4,7>: Cost 4 vext3 RHS, <0,4,7,5>
- 1638318481U, // <7,0,4,u>: Cost 2 vext3 RHS, <0,4,u,5>
- 2590654566U, // <7,0,5,0>: Cost 3 vext1 <6,7,0,5>, LHS
- 2651606736U, // <7,0,5,1>: Cost 3 vext2 <5,6,7,0>, <5,1,7,3>
- 2712060334U, // <7,0,5,2>: Cost 3 vext3 RHS, <0,5,2,7>
- 2649616239U, // <7,0,5,3>: Cost 3 vext2 <5,3,7,0>, <5,3,7,0>
- 2651606982U, // <7,0,5,4>: Cost 3 vext2 <5,6,7,0>, <5,4,7,6>
- 2651607044U, // <7,0,5,5>: Cost 3 vext2 <5,6,7,0>, <5,5,5,5>
- 1577865314U, // <7,0,5,6>: Cost 2 vext2 <5,6,7,0>, <5,6,7,0>
- 2651607208U, // <7,0,5,7>: Cost 3 vext2 <5,6,7,0>, <5,7,5,7>
- 1579192580U, // <7,0,5,u>: Cost 2 vext2 <5,u,7,0>, <5,u,7,0>
- 2688393709U, // <7,0,6,0>: Cost 3 vext3 <0,6,0,7>, <0,6,0,7>
- 2712060406U, // <7,0,6,1>: Cost 3 vext3 RHS, <0,6,1,7>
- 2688541183U, // <7,0,6,2>: Cost 3 vext3 <0,6,2,7>, <0,6,2,7>
- 2655588936U, // <7,0,6,3>: Cost 3 vext2 <6,3,7,0>, <6,3,7,0>
- 3762430481U, // <7,0,6,4>: Cost 4 vext3 <0,6,4,7>, <0,6,4,7>
- 2651607730U, // <7,0,6,5>: Cost 3 vext2 <5,6,7,0>, <6,5,0,7>
- 2651607864U, // <7,0,6,6>: Cost 3 vext2 <5,6,7,0>, <6,6,6,6>
- 2651607886U, // <7,0,6,7>: Cost 3 vext2 <5,6,7,0>, <6,7,0,1>
- 2688983605U, // <7,0,6,u>: Cost 3 vext3 <0,6,u,7>, <0,6,u,7>
- 2651608058U, // <7,0,7,0>: Cost 3 vext2 <5,6,7,0>, <7,0,1,2>
- 2932703334U, // <7,0,7,1>: Cost 3 vzipl <7,7,7,7>, LHS
- 3066921062U, // <7,0,7,2>: Cost 3 vtrnl <7,7,7,7>, LHS
- 3712742678U, // <7,0,7,3>: Cost 4 vext2 <3,5,7,0>, <7,3,5,7>
- 2651608422U, // <7,0,7,4>: Cost 3 vext2 <5,6,7,0>, <7,4,5,6>
- 2651608513U, // <7,0,7,5>: Cost 3 vext2 <5,6,7,0>, <7,5,6,7>
- 2663552532U, // <7,0,7,6>: Cost 3 vext2 <7,6,7,0>, <7,6,7,0>
- 2651608684U, // <7,0,7,7>: Cost 3 vext2 <5,6,7,0>, <7,7,7,7>
- 2651608706U, // <7,0,7,u>: Cost 3 vext2 <5,6,7,0>, <7,u,1,2>
- 1638318730U, // <7,0,u,0>: Cost 2 vext3 RHS, <0,u,0,2>
- 1638318738U, // <7,0,u,1>: Cost 2 vext3 RHS, <0,u,1,1>
- 564576925U, // <7,0,u,2>: Cost 1 vext3 RHS, LHS
- 2572765898U, // <7,0,u,3>: Cost 3 vext1 <3,7,0,u>, <3,7,0,u>
- 1638318770U, // <7,0,u,4>: Cost 2 vext3 RHS, <0,u,4,6>
- 1577867418U, // <7,0,u,5>: Cost 2 vext2 <5,6,7,0>, RHS
- 1516942165U, // <7,0,u,6>: Cost 2 vext1 <6,7,0,u>, <6,7,0,u>
- 2651609344U, // <7,0,u,7>: Cost 3 vext2 <5,6,7,0>, <u,7,0,1>
- 564576979U, // <7,0,u,u>: Cost 1 vext3 RHS, LHS
- 2590687334U, // <7,1,0,0>: Cost 3 vext1 <6,7,1,0>, LHS
- 2639003750U, // <7,1,0,1>: Cost 3 vext2 <3,5,7,1>, LHS
- 2793357414U, // <7,1,0,2>: Cost 3 vuzpl <7,0,1,2>, LHS
- 1638318838U, // <7,1,0,3>: Cost 2 vext3 RHS, <1,0,3,2>
- 2590690614U, // <7,1,0,4>: Cost 3 vext1 <6,7,1,0>, RHS
- 2712060679U, // <7,1,0,5>: Cost 3 vext3 RHS, <1,0,5,1>
- 2590692182U, // <7,1,0,6>: Cost 3 vext1 <6,7,1,0>, <6,7,1,0>
- 3785802521U, // <7,1,0,7>: Cost 4 vext3 RHS, <1,0,7,1>
- 1638318883U, // <7,1,0,u>: Cost 2 vext3 RHS, <1,0,u,2>
- 2712060715U, // <7,1,1,0>: Cost 3 vext3 RHS, <1,1,0,1>
- 1638318900U, // <7,1,1,1>: Cost 2 vext3 RHS, <1,1,1,1>
- 3774300994U, // <7,1,1,2>: Cost 4 vext3 <2,6,3,7>, <1,1,2,6>
- 1638318920U, // <7,1,1,3>: Cost 2 vext3 RHS, <1,1,3,3>
- 2712060755U, // <7,1,1,4>: Cost 3 vext3 RHS, <1,1,4,5>
- 2691416926U, // <7,1,1,5>: Cost 3 vext3 <1,1,5,7>, <1,1,5,7>
- 2590700375U, // <7,1,1,6>: Cost 3 vext1 <6,7,1,1>, <6,7,1,1>
- 3765158766U, // <7,1,1,7>: Cost 4 vext3 <1,1,5,7>, <1,1,7,5>
- 1638318965U, // <7,1,1,u>: Cost 2 vext3 RHS, <1,1,u,3>
- 2712060796U, // <7,1,2,0>: Cost 3 vext3 RHS, <1,2,0,1>
- 2712060807U, // <7,1,2,1>: Cost 3 vext3 RHS, <1,2,1,3>
- 3712747112U, // <7,1,2,2>: Cost 4 vext2 <3,5,7,1>, <2,2,2,2>
- 1638318998U, // <7,1,2,3>: Cost 2 vext3 RHS, <1,2,3,0>
- 2712060836U, // <7,1,2,4>: Cost 3 vext3 RHS, <1,2,4,5>
- 2712060843U, // <7,1,2,5>: Cost 3 vext3 RHS, <1,2,5,3>
- 2590708568U, // <7,1,2,6>: Cost 3 vext1 <6,7,1,2>, <6,7,1,2>
- 2735948730U, // <7,1,2,7>: Cost 3 vext3 RHS, <1,2,7,0>
- 1638319043U, // <7,1,2,u>: Cost 2 vext3 RHS, <1,2,u,0>
- 2712060876U, // <7,1,3,0>: Cost 3 vext3 RHS, <1,3,0,0>
- 1638319064U, // <7,1,3,1>: Cost 2 vext3 RHS, <1,3,1,3>
- 2712060894U, // <7,1,3,2>: Cost 3 vext3 RHS, <1,3,2,0>
- 2692596718U, // <7,1,3,3>: Cost 3 vext3 <1,3,3,7>, <1,3,3,7>
- 2712060917U, // <7,1,3,4>: Cost 3 vext3 RHS, <1,3,4,5>
- 1619002368U, // <7,1,3,5>: Cost 2 vext3 <1,3,5,7>, <1,3,5,7>
- 2692817929U, // <7,1,3,6>: Cost 3 vext3 <1,3,6,7>, <1,3,6,7>
- 2735948814U, // <7,1,3,7>: Cost 3 vext3 RHS, <1,3,7,3>
- 1619223579U, // <7,1,3,u>: Cost 2 vext3 <1,3,u,7>, <1,3,u,7>
- 2712060962U, // <7,1,4,0>: Cost 3 vext3 RHS, <1,4,0,5>
- 2712060971U, // <7,1,4,1>: Cost 3 vext3 RHS, <1,4,1,5>
- 2712060980U, // <7,1,4,2>: Cost 3 vext3 RHS, <1,4,2,5>
- 2712060989U, // <7,1,4,3>: Cost 3 vext3 RHS, <1,4,3,5>
- 3785802822U, // <7,1,4,4>: Cost 4 vext3 RHS, <1,4,4,5>
- 2639007030U, // <7,1,4,5>: Cost 3 vext2 <3,5,7,1>, RHS
- 2645642634U, // <7,1,4,6>: Cost 3 vext2 <4,6,7,1>, <4,6,7,1>
- 3719384520U, // <7,1,4,7>: Cost 4 vext2 <4,6,7,1>, <4,7,5,0>
- 2639007273U, // <7,1,4,u>: Cost 3 vext2 <3,5,7,1>, RHS
- 2572812390U, // <7,1,5,0>: Cost 3 vext1 <3,7,1,5>, LHS
- 2693776510U, // <7,1,5,1>: Cost 3 vext3 <1,5,1,7>, <1,5,1,7>
- 3774301318U, // <7,1,5,2>: Cost 4 vext3 <2,6,3,7>, <1,5,2,6>
- 1620182160U, // <7,1,5,3>: Cost 2 vext3 <1,5,3,7>, <1,5,3,7>
- 2572815670U, // <7,1,5,4>: Cost 3 vext1 <3,7,1,5>, RHS
- 3766486178U, // <7,1,5,5>: Cost 4 vext3 <1,3,5,7>, <1,5,5,7>
- 2651615331U, // <7,1,5,6>: Cost 3 vext2 <5,6,7,1>, <5,6,7,1>
- 2652278964U, // <7,1,5,7>: Cost 3 vext2 <5,7,7,1>, <5,7,7,1>
- 1620550845U, // <7,1,5,u>: Cost 2 vext3 <1,5,u,7>, <1,5,u,7>
- 3768108230U, // <7,1,6,0>: Cost 4 vext3 <1,6,0,7>, <1,6,0,7>
- 2694440143U, // <7,1,6,1>: Cost 3 vext3 <1,6,1,7>, <1,6,1,7>
- 2712061144U, // <7,1,6,2>: Cost 3 vext3 RHS, <1,6,2,7>
- 2694587617U, // <7,1,6,3>: Cost 3 vext3 <1,6,3,7>, <1,6,3,7>
- 3768403178U, // <7,1,6,4>: Cost 4 vext3 <1,6,4,7>, <1,6,4,7>
- 2694735091U, // <7,1,6,5>: Cost 3 vext3 <1,6,5,7>, <1,6,5,7>
- 3768550652U, // <7,1,6,6>: Cost 4 vext3 <1,6,6,7>, <1,6,6,7>
- 2652279630U, // <7,1,6,7>: Cost 3 vext2 <5,7,7,1>, <6,7,0,1>
- 2694956302U, // <7,1,6,u>: Cost 3 vext3 <1,6,u,7>, <1,6,u,7>
- 2645644282U, // <7,1,7,0>: Cost 3 vext2 <4,6,7,1>, <7,0,1,2>
- 2859062094U, // <7,1,7,1>: Cost 3 vuzpr <6,7,0,1>, <6,7,0,1>
- 3779462437U, // <7,1,7,2>: Cost 4 vext3 <3,5,1,7>, <1,7,2,3>
- 3121938534U, // <7,1,7,3>: Cost 3 vtrnr <5,7,5,7>, LHS
- 2554916150U, // <7,1,7,4>: Cost 3 vext1 <0,7,1,7>, RHS
- 3769140548U, // <7,1,7,5>: Cost 4 vext3 <1,7,5,7>, <1,7,5,7>
- 3726022164U, // <7,1,7,6>: Cost 4 vext2 <5,7,7,1>, <7,6,7,0>
- 2554918508U, // <7,1,7,7>: Cost 3 vext1 <0,7,1,7>, <7,7,7,7>
- 3121938539U, // <7,1,7,u>: Cost 3 vtrnr <5,7,5,7>, LHS
- 2572836966U, // <7,1,u,0>: Cost 3 vext1 <3,7,1,u>, LHS
- 1638319469U, // <7,1,u,1>: Cost 2 vext3 RHS, <1,u,1,3>
- 2712061299U, // <7,1,u,2>: Cost 3 vext3 RHS, <1,u,2,0>
- 1622173059U, // <7,1,u,3>: Cost 2 vext3 <1,u,3,7>, <1,u,3,7>
- 2572840246U, // <7,1,u,4>: Cost 3 vext1 <3,7,1,u>, RHS
- 1622320533U, // <7,1,u,5>: Cost 2 vext3 <1,u,5,7>, <1,u,5,7>
- 2696136094U, // <7,1,u,6>: Cost 3 vext3 <1,u,6,7>, <1,u,6,7>
- 2859060777U, // <7,1,u,7>: Cost 3 vuzpr <6,7,0,1>, RHS
- 1622541744U, // <7,1,u,u>: Cost 2 vext3 <1,u,u,7>, <1,u,u,7>
- 2712061364U, // <7,2,0,0>: Cost 3 vext3 RHS, <2,0,0,2>
- 2712061373U, // <7,2,0,1>: Cost 3 vext3 RHS, <2,0,1,2>
- 2712061380U, // <7,2,0,2>: Cost 3 vext3 RHS, <2,0,2,0>
- 2712061389U, // <7,2,0,3>: Cost 3 vext3 RHS, <2,0,3,0>
- 2712061404U, // <7,2,0,4>: Cost 3 vext3 RHS, <2,0,4,6>
- 2696725990U, // <7,2,0,5>: Cost 3 vext3 <2,0,5,7>, <2,0,5,7>
- 2712061417U, // <7,2,0,6>: Cost 3 vext3 RHS, <2,0,6,1>
- 3785803251U, // <7,2,0,7>: Cost 4 vext3 RHS, <2,0,7,2>
- 2696947201U, // <7,2,0,u>: Cost 3 vext3 <2,0,u,7>, <2,0,u,7>
- 2712061446U, // <7,2,1,0>: Cost 3 vext3 RHS, <2,1,0,3>
- 3785803276U, // <7,2,1,1>: Cost 4 vext3 RHS, <2,1,1,0>
- 3785803285U, // <7,2,1,2>: Cost 4 vext3 RHS, <2,1,2,0>
- 2712061471U, // <7,2,1,3>: Cost 3 vext3 RHS, <2,1,3,1>
- 2712061482U, // <7,2,1,4>: Cost 3 vext3 RHS, <2,1,4,3>
- 3766486576U, // <7,2,1,5>: Cost 4 vext3 <1,3,5,7>, <2,1,5,0>
- 2712061500U, // <7,2,1,6>: Cost 3 vext3 RHS, <2,1,6,3>
- 2602718850U, // <7,2,1,7>: Cost 3 vext1 <u,7,2,1>, <7,u,1,2>
- 2712061516U, // <7,2,1,u>: Cost 3 vext3 RHS, <2,1,u,1>
- 2712061525U, // <7,2,2,0>: Cost 3 vext3 RHS, <2,2,0,1>
- 2712061536U, // <7,2,2,1>: Cost 3 vext3 RHS, <2,2,1,3>
- 1638319720U, // <7,2,2,2>: Cost 2 vext3 RHS, <2,2,2,2>
- 1638319730U, // <7,2,2,3>: Cost 2 vext3 RHS, <2,2,3,3>
- 2712061565U, // <7,2,2,4>: Cost 3 vext3 RHS, <2,2,4,5>
- 2698053256U, // <7,2,2,5>: Cost 3 vext3 <2,2,5,7>, <2,2,5,7>
- 2712061584U, // <7,2,2,6>: Cost 3 vext3 RHS, <2,2,6,6>
- 3771795096U, // <7,2,2,7>: Cost 4 vext3 <2,2,5,7>, <2,2,7,5>
- 1638319775U, // <7,2,2,u>: Cost 2 vext3 RHS, <2,2,u,3>
- 1638319782U, // <7,2,3,0>: Cost 2 vext3 RHS, <2,3,0,1>
- 2693924531U, // <7,2,3,1>: Cost 3 vext3 <1,5,3,7>, <2,3,1,5>
- 2700560061U, // <7,2,3,2>: Cost 3 vext3 <2,6,3,7>, <2,3,2,6>
- 2693924551U, // <7,2,3,3>: Cost 3 vext3 <1,5,3,7>, <2,3,3,7>
- 1638319822U, // <7,2,3,4>: Cost 2 vext3 RHS, <2,3,4,5>
- 2698716889U, // <7,2,3,5>: Cost 3 vext3 <2,3,5,7>, <2,3,5,7>
- 2712061665U, // <7,2,3,6>: Cost 3 vext3 RHS, <2,3,6,6>
- 2735949540U, // <7,2,3,7>: Cost 3 vext3 RHS, <2,3,7,0>
- 1638319854U, // <7,2,3,u>: Cost 2 vext3 RHS, <2,3,u,1>
- 2712061692U, // <7,2,4,0>: Cost 3 vext3 RHS, <2,4,0,6>
- 2712061698U, // <7,2,4,1>: Cost 3 vext3 RHS, <2,4,1,3>
- 2712061708U, // <7,2,4,2>: Cost 3 vext3 RHS, <2,4,2,4>
- 2712061718U, // <7,2,4,3>: Cost 3 vext3 RHS, <2,4,3,5>
- 2712061728U, // <7,2,4,4>: Cost 3 vext3 RHS, <2,4,4,6>
- 2699380522U, // <7,2,4,5>: Cost 3 vext3 <2,4,5,7>, <2,4,5,7>
- 2712061740U, // <7,2,4,6>: Cost 3 vext3 RHS, <2,4,6,0>
- 3809691445U, // <7,2,4,7>: Cost 4 vext3 RHS, <2,4,7,0>
- 2699601733U, // <7,2,4,u>: Cost 3 vext3 <2,4,u,7>, <2,4,u,7>
- 2699675470U, // <7,2,5,0>: Cost 3 vext3 <2,5,0,7>, <2,5,0,7>
- 3766486867U, // <7,2,5,1>: Cost 4 vext3 <1,3,5,7>, <2,5,1,3>
- 2699822944U, // <7,2,5,2>: Cost 3 vext3 <2,5,2,7>, <2,5,2,7>
- 2692745065U, // <7,2,5,3>: Cost 3 vext3 <1,3,5,7>, <2,5,3,7>
- 2699970418U, // <7,2,5,4>: Cost 3 vext3 <2,5,4,7>, <2,5,4,7>
- 3766486907U, // <7,2,5,5>: Cost 4 vext3 <1,3,5,7>, <2,5,5,7>
- 2700117892U, // <7,2,5,6>: Cost 3 vext3 <2,5,6,7>, <2,5,6,7>
- 3771795334U, // <7,2,5,7>: Cost 4 vext3 <2,2,5,7>, <2,5,7,0>
- 2692745110U, // <7,2,5,u>: Cost 3 vext3 <1,3,5,7>, <2,5,u,7>
- 2572894310U, // <7,2,6,0>: Cost 3 vext1 <3,7,2,6>, LHS
- 2712061860U, // <7,2,6,1>: Cost 3 vext3 RHS, <2,6,1,3>
- 2700486577U, // <7,2,6,2>: Cost 3 vext3 <2,6,2,7>, <2,6,2,7>
- 1626818490U, // <7,2,6,3>: Cost 2 vext3 <2,6,3,7>, <2,6,3,7>
- 2572897590U, // <7,2,6,4>: Cost 3 vext1 <3,7,2,6>, RHS
- 2700707788U, // <7,2,6,5>: Cost 3 vext3 <2,6,5,7>, <2,6,5,7>
- 2700781525U, // <7,2,6,6>: Cost 3 vext3 <2,6,6,7>, <2,6,6,7>
- 3774597086U, // <7,2,6,7>: Cost 4 vext3 <2,6,7,7>, <2,6,7,7>
- 1627187175U, // <7,2,6,u>: Cost 2 vext3 <2,6,u,7>, <2,6,u,7>
- 2735949802U, // <7,2,7,0>: Cost 3 vext3 RHS, <2,7,0,1>
- 3780200434U, // <7,2,7,1>: Cost 4 vext3 <3,6,2,7>, <2,7,1,0>
- 3773564928U, // <7,2,7,2>: Cost 4 vext3 <2,5,2,7>, <2,7,2,5>
- 2986541158U, // <7,2,7,3>: Cost 3 vzipr <5,5,7,7>, LHS
- 2554989878U, // <7,2,7,4>: Cost 3 vext1 <0,7,2,7>, RHS
- 3775113245U, // <7,2,7,5>: Cost 4 vext3 <2,7,5,7>, <2,7,5,7>
- 4060283228U, // <7,2,7,6>: Cost 4 vzipr <5,5,7,7>, <0,4,2,6>
- 2554992236U, // <7,2,7,7>: Cost 3 vext1 <0,7,2,7>, <7,7,7,7>
- 2986541163U, // <7,2,7,u>: Cost 3 vzipr <5,5,7,7>, LHS
- 1638320187U, // <7,2,u,0>: Cost 2 vext3 RHS, <2,u,0,1>
- 2693924936U, // <7,2,u,1>: Cost 3 vext3 <1,5,3,7>, <2,u,1,5>
- 1638319720U, // <7,2,u,2>: Cost 2 vext3 RHS, <2,2,2,2>
- 1628145756U, // <7,2,u,3>: Cost 2 vext3 <2,u,3,7>, <2,u,3,7>
- 1638320227U, // <7,2,u,4>: Cost 2 vext3 RHS, <2,u,4,5>
- 2702035054U, // <7,2,u,5>: Cost 3 vext3 <2,u,5,7>, <2,u,5,7>
- 2702108791U, // <7,2,u,6>: Cost 3 vext3 <2,u,6,7>, <2,u,6,7>
- 2735949945U, // <7,2,u,7>: Cost 3 vext3 RHS, <2,u,7,0>
- 1628514441U, // <7,2,u,u>: Cost 2 vext3 <2,u,u,7>, <2,u,u,7>
- 2712062091U, // <7,3,0,0>: Cost 3 vext3 RHS, <3,0,0,0>
- 1638320278U, // <7,3,0,1>: Cost 2 vext3 RHS, <3,0,1,2>
- 2712062109U, // <7,3,0,2>: Cost 3 vext3 RHS, <3,0,2,0>
- 2590836886U, // <7,3,0,3>: Cost 3 vext1 <6,7,3,0>, <3,0,1,2>
- 2712062128U, // <7,3,0,4>: Cost 3 vext3 RHS, <3,0,4,1>
- 2712062138U, // <7,3,0,5>: Cost 3 vext3 RHS, <3,0,5,2>
- 2590839656U, // <7,3,0,6>: Cost 3 vext1 <6,7,3,0>, <6,7,3,0>
- 3311414017U, // <7,3,0,7>: Cost 4 vrev <3,7,7,0>
- 1638320341U, // <7,3,0,u>: Cost 2 vext3 RHS, <3,0,u,2>
- 2237164227U, // <7,3,1,0>: Cost 3 vrev <3,7,0,1>
- 2712062182U, // <7,3,1,1>: Cost 3 vext3 RHS, <3,1,1,1>
- 2712062193U, // <7,3,1,2>: Cost 3 vext3 RHS, <3,1,2,3>
- 2692745468U, // <7,3,1,3>: Cost 3 vext3 <1,3,5,7>, <3,1,3,5>
- 2712062214U, // <7,3,1,4>: Cost 3 vext3 RHS, <3,1,4,6>
- 2693925132U, // <7,3,1,5>: Cost 3 vext3 <1,5,3,7>, <3,1,5,3>
- 3768183059U, // <7,3,1,6>: Cost 4 vext3 <1,6,1,7>, <3,1,6,1>
- 2692745504U, // <7,3,1,7>: Cost 3 vext3 <1,3,5,7>, <3,1,7,5>
- 2696063273U, // <7,3,1,u>: Cost 3 vext3 <1,u,5,7>, <3,1,u,5>
- 2712062254U, // <7,3,2,0>: Cost 3 vext3 RHS, <3,2,0,1>
- 2712062262U, // <7,3,2,1>: Cost 3 vext3 RHS, <3,2,1,0>
- 2712062273U, // <7,3,2,2>: Cost 3 vext3 RHS, <3,2,2,2>
- 2712062280U, // <7,3,2,3>: Cost 3 vext3 RHS, <3,2,3,0>
- 2712062294U, // <7,3,2,4>: Cost 3 vext3 RHS, <3,2,4,5>
- 2712062302U, // <7,3,2,5>: Cost 3 vext3 RHS, <3,2,5,4>
- 2700560742U, // <7,3,2,6>: Cost 3 vext3 <2,6,3,7>, <3,2,6,3>
- 2712062319U, // <7,3,2,7>: Cost 3 vext3 RHS, <3,2,7,3>
- 2712062325U, // <7,3,2,u>: Cost 3 vext3 RHS, <3,2,u,0>
- 2712062335U, // <7,3,3,0>: Cost 3 vext3 RHS, <3,3,0,1>
- 2636368158U, // <7,3,3,1>: Cost 3 vext2 <3,1,7,3>, <3,1,7,3>
- 2637031791U, // <7,3,3,2>: Cost 3 vext2 <3,2,7,3>, <3,2,7,3>
- 1638320540U, // <7,3,3,3>: Cost 2 vext3 RHS, <3,3,3,3>
- 2712062374U, // <7,3,3,4>: Cost 3 vext3 RHS, <3,3,4,4>
- 2704689586U, // <7,3,3,5>: Cost 3 vext3 <3,3,5,7>, <3,3,5,7>
- 2590864235U, // <7,3,3,6>: Cost 3 vext1 <6,7,3,3>, <6,7,3,3>
- 2704837060U, // <7,3,3,7>: Cost 3 vext3 <3,3,7,7>, <3,3,7,7>
- 1638320540U, // <7,3,3,u>: Cost 2 vext3 RHS, <3,3,3,3>
- 2712062416U, // <7,3,4,0>: Cost 3 vext3 RHS, <3,4,0,1>
- 2712062426U, // <7,3,4,1>: Cost 3 vext3 RHS, <3,4,1,2>
- 2566981640U, // <7,3,4,2>: Cost 3 vext1 <2,7,3,4>, <2,7,3,4>
- 2712062447U, // <7,3,4,3>: Cost 3 vext3 RHS, <3,4,3,5>
- 2712062456U, // <7,3,4,4>: Cost 3 vext3 RHS, <3,4,4,5>
- 1638320642U, // <7,3,4,5>: Cost 2 vext3 RHS, <3,4,5,6>
- 2648313204U, // <7,3,4,6>: Cost 3 vext2 <5,1,7,3>, <4,6,4,6>
- 3311446789U, // <7,3,4,7>: Cost 4 vrev <3,7,7,4>
- 1638320669U, // <7,3,4,u>: Cost 2 vext3 RHS, <3,4,u,6>
- 2602819686U, // <7,3,5,0>: Cost 3 vext1 <u,7,3,5>, LHS
- 1574571728U, // <7,3,5,1>: Cost 2 vext2 <5,1,7,3>, <5,1,7,3>
- 2648977185U, // <7,3,5,2>: Cost 3 vext2 <5,2,7,3>, <5,2,7,3>
- 2705869378U, // <7,3,5,3>: Cost 3 vext3 <3,5,3,7>, <3,5,3,7>
- 2237491947U, // <7,3,5,4>: Cost 3 vrev <3,7,4,5>
- 2706016852U, // <7,3,5,5>: Cost 3 vext3 <3,5,5,7>, <3,5,5,7>
- 2648313954U, // <7,3,5,6>: Cost 3 vext2 <5,1,7,3>, <5,6,7,0>
- 2692745823U, // <7,3,5,7>: Cost 3 vext3 <1,3,5,7>, <3,5,7,0>
- 1579217159U, // <7,3,5,u>: Cost 2 vext2 <5,u,7,3>, <5,u,7,3>
- 2706311800U, // <7,3,6,0>: Cost 3 vext3 <3,6,0,7>, <3,6,0,7>
- 2654286249U, // <7,3,6,1>: Cost 3 vext2 <6,1,7,3>, <6,1,7,3>
- 1581208058U, // <7,3,6,2>: Cost 2 vext2 <6,2,7,3>, <6,2,7,3>
- 2706533011U, // <7,3,6,3>: Cost 3 vext3 <3,6,3,7>, <3,6,3,7>
- 2706606748U, // <7,3,6,4>: Cost 3 vext3 <3,6,4,7>, <3,6,4,7>
- 3780422309U, // <7,3,6,5>: Cost 4 vext3 <3,6,5,7>, <3,6,5,7>
- 2712062637U, // <7,3,6,6>: Cost 3 vext3 RHS, <3,6,6,6>
- 2706827959U, // <7,3,6,7>: Cost 3 vext3 <3,6,7,7>, <3,6,7,7>
- 1585189856U, // <7,3,6,u>: Cost 2 vext2 <6,u,7,3>, <6,u,7,3>
- 2693925571U, // <7,3,7,0>: Cost 3 vext3 <1,5,3,7>, <3,7,0,1>
- 2693925584U, // <7,3,7,1>: Cost 3 vext3 <1,5,3,7>, <3,7,1,5>
- 2700561114U, // <7,3,7,2>: Cost 3 vext3 <2,6,3,7>, <3,7,2,6>
- 2572978916U, // <7,3,7,3>: Cost 3 vext1 <3,7,3,7>, <3,7,3,7>
- 2693925611U, // <7,3,7,4>: Cost 3 vext3 <1,5,3,7>, <3,7,4,5>
- 2707344118U, // <7,3,7,5>: Cost 3 vext3 <3,7,5,7>, <3,7,5,7>
- 2654950894U, // <7,3,7,6>: Cost 3 vext2 <6,2,7,3>, <7,6,2,7>
- 2648315500U, // <7,3,7,7>: Cost 3 vext2 <5,1,7,3>, <7,7,7,7>
- 2693925643U, // <7,3,7,u>: Cost 3 vext3 <1,5,3,7>, <3,7,u,1>
- 2237221578U, // <7,3,u,0>: Cost 3 vrev <3,7,0,u>
- 1638320926U, // <7,3,u,1>: Cost 2 vext3 RHS, <3,u,1,2>
- 1593153452U, // <7,3,u,2>: Cost 2 vext2 <u,2,7,3>, <u,2,7,3>
- 1638320540U, // <7,3,u,3>: Cost 2 vext3 RHS, <3,3,3,3>
- 2237516526U, // <7,3,u,4>: Cost 3 vrev <3,7,4,u>
- 1638320966U, // <7,3,u,5>: Cost 2 vext3 RHS, <3,u,5,6>
- 2712062796U, // <7,3,u,6>: Cost 3 vext3 RHS, <3,u,6,3>
- 2692967250U, // <7,3,u,7>: Cost 3 vext3 <1,3,u,7>, <3,u,7,0>
- 1638320989U, // <7,3,u,u>: Cost 2 vext3 RHS, <3,u,u,2>
- 2651635712U, // <7,4,0,0>: Cost 3 vext2 <5,6,7,4>, <0,0,0,0>
- 1577893990U, // <7,4,0,1>: Cost 2 vext2 <5,6,7,4>, LHS
- 2651635876U, // <7,4,0,2>: Cost 3 vext2 <5,6,7,4>, <0,2,0,2>
- 3785804672U, // <7,4,0,3>: Cost 4 vext3 RHS, <4,0,3,1>
- 2651636050U, // <7,4,0,4>: Cost 3 vext2 <5,6,7,4>, <0,4,1,5>
- 1638468498U, // <7,4,0,5>: Cost 2 vext3 RHS, <4,0,5,1>
- 1638468508U, // <7,4,0,6>: Cost 2 vext3 RHS, <4,0,6,2>
- 3787795364U, // <7,4,0,7>: Cost 4 vext3 RHS, <4,0,7,1>
- 1640459181U, // <7,4,0,u>: Cost 2 vext3 RHS, <4,0,u,1>
- 2651636470U, // <7,4,1,0>: Cost 3 vext2 <5,6,7,4>, <1,0,3,2>
- 2651636532U, // <7,4,1,1>: Cost 3 vext2 <5,6,7,4>, <1,1,1,1>
- 2712062922U, // <7,4,1,2>: Cost 3 vext3 RHS, <4,1,2,3>
- 2639029248U, // <7,4,1,3>: Cost 3 vext2 <3,5,7,4>, <1,3,5,7>
- 2712062940U, // <7,4,1,4>: Cost 3 vext3 RHS, <4,1,4,3>
- 2712062946U, // <7,4,1,5>: Cost 3 vext3 RHS, <4,1,5,0>
- 2712062958U, // <7,4,1,6>: Cost 3 vext3 RHS, <4,1,6,3>
- 3785804791U, // <7,4,1,7>: Cost 4 vext3 RHS, <4,1,7,3>
- 2712062973U, // <7,4,1,u>: Cost 3 vext3 RHS, <4,1,u,0>
- 3785804807U, // <7,4,2,0>: Cost 4 vext3 RHS, <4,2,0,1>
- 3785804818U, // <7,4,2,1>: Cost 4 vext3 RHS, <4,2,1,3>
- 2651637352U, // <7,4,2,2>: Cost 3 vext2 <5,6,7,4>, <2,2,2,2>
- 2651637414U, // <7,4,2,3>: Cost 3 vext2 <5,6,7,4>, <2,3,0,1>
- 3716753194U, // <7,4,2,4>: Cost 4 vext2 <4,2,7,4>, <2,4,5,7>
- 2712063030U, // <7,4,2,5>: Cost 3 vext3 RHS, <4,2,5,3>
- 2712063036U, // <7,4,2,6>: Cost 3 vext3 RHS, <4,2,6,0>
- 3773123658U, // <7,4,2,7>: Cost 4 vext3 <2,4,5,7>, <4,2,7,5>
- 2712063054U, // <7,4,2,u>: Cost 3 vext3 RHS, <4,2,u,0>
- 2651637910U, // <7,4,3,0>: Cost 3 vext2 <5,6,7,4>, <3,0,1,2>
- 3712772348U, // <7,4,3,1>: Cost 4 vext2 <3,5,7,4>, <3,1,3,5>
- 3785804906U, // <7,4,3,2>: Cost 4 vext3 RHS, <4,3,2,1>
- 2651638172U, // <7,4,3,3>: Cost 3 vext2 <5,6,7,4>, <3,3,3,3>
- 2651638274U, // <7,4,3,4>: Cost 3 vext2 <5,6,7,4>, <3,4,5,6>
- 2639030883U, // <7,4,3,5>: Cost 3 vext2 <3,5,7,4>, <3,5,7,4>
- 2712063122U, // <7,4,3,6>: Cost 3 vext3 RHS, <4,3,6,5>
- 3712772836U, // <7,4,3,7>: Cost 4 vext2 <3,5,7,4>, <3,7,3,7>
- 2641021782U, // <7,4,3,u>: Cost 3 vext2 <3,u,7,4>, <3,u,7,4>
- 2714053802U, // <7,4,4,0>: Cost 3 vext3 RHS, <4,4,0,2>
- 3785804978U, // <7,4,4,1>: Cost 4 vext3 RHS, <4,4,1,1>
- 3716754505U, // <7,4,4,2>: Cost 4 vext2 <4,2,7,4>, <4,2,7,4>
- 3785804998U, // <7,4,4,3>: Cost 4 vext3 RHS, <4,4,3,3>
- 1638321360U, // <7,4,4,4>: Cost 2 vext3 RHS, <4,4,4,4>
- 1638468826U, // <7,4,4,5>: Cost 2 vext3 RHS, <4,4,5,5>
- 1638468836U, // <7,4,4,6>: Cost 2 vext3 RHS, <4,4,6,6>
- 3785215214U, // <7,4,4,7>: Cost 4 vext3 <4,4,7,7>, <4,4,7,7>
- 1640459509U, // <7,4,4,u>: Cost 2 vext3 RHS, <4,4,u,5>
- 1517207654U, // <7,4,5,0>: Cost 2 vext1 <6,7,4,5>, LHS
- 2573034640U, // <7,4,5,1>: Cost 3 vext1 <3,7,4,5>, <1,5,3,7>
- 2712063246U, // <7,4,5,2>: Cost 3 vext3 RHS, <4,5,2,3>
- 2573036267U, // <7,4,5,3>: Cost 3 vext1 <3,7,4,5>, <3,7,4,5>
- 1517210934U, // <7,4,5,4>: Cost 2 vext1 <6,7,4,5>, RHS
- 2711989549U, // <7,4,5,5>: Cost 3 vext3 <4,5,5,7>, <4,5,5,7>
- 564579638U, // <7,4,5,6>: Cost 1 vext3 RHS, RHS
- 2651639976U, // <7,4,5,7>: Cost 3 vext2 <5,6,7,4>, <5,7,5,7>
- 564579656U, // <7,4,5,u>: Cost 1 vext3 RHS, RHS
- 2712063307U, // <7,4,6,0>: Cost 3 vext3 RHS, <4,6,0,1>
- 3767668056U, // <7,4,6,1>: Cost 4 vext3 <1,5,3,7>, <4,6,1,5>
- 2651640314U, // <7,4,6,2>: Cost 3 vext2 <5,6,7,4>, <6,2,7,3>
- 2655621708U, // <7,4,6,3>: Cost 3 vext2 <6,3,7,4>, <6,3,7,4>
- 1638468980U, // <7,4,6,4>: Cost 2 vext3 RHS, <4,6,4,6>
- 2712063358U, // <7,4,6,5>: Cost 3 vext3 RHS, <4,6,5,7>
- 2712063367U, // <7,4,6,6>: Cost 3 vext3 RHS, <4,6,6,7>
- 2712210826U, // <7,4,6,7>: Cost 3 vext3 RHS, <4,6,7,1>
- 1638469012U, // <7,4,6,u>: Cost 2 vext3 RHS, <4,6,u,2>
- 2651640826U, // <7,4,7,0>: Cost 3 vext2 <5,6,7,4>, <7,0,1,2>
- 3773713830U, // <7,4,7,1>: Cost 4 vext3 <2,5,4,7>, <4,7,1,2>
- 3773713842U, // <7,4,7,2>: Cost 4 vext3 <2,5,4,7>, <4,7,2,5>
- 3780349372U, // <7,4,7,3>: Cost 4 vext3 <3,6,4,7>, <4,7,3,6>
- 2651641140U, // <7,4,7,4>: Cost 3 vext2 <5,6,7,4>, <7,4,0,1>
- 2712210888U, // <7,4,7,5>: Cost 3 vext3 RHS, <4,7,5,0>
- 2712210898U, // <7,4,7,6>: Cost 3 vext3 RHS, <4,7,6,1>
- 2651641452U, // <7,4,7,7>: Cost 3 vext2 <5,6,7,4>, <7,7,7,7>
- 2713538026U, // <7,4,7,u>: Cost 3 vext3 <4,7,u,7>, <4,7,u,7>
- 1517232230U, // <7,4,u,0>: Cost 2 vext1 <6,7,4,u>, LHS
- 1577899822U, // <7,4,u,1>: Cost 2 vext2 <5,6,7,4>, LHS
- 2712063489U, // <7,4,u,2>: Cost 3 vext3 RHS, <4,u,2,3>
- 2573060846U, // <7,4,u,3>: Cost 3 vext1 <3,7,4,u>, <3,7,4,u>
- 1640312342U, // <7,4,u,4>: Cost 2 vext3 RHS, <4,u,4,6>
- 1638469146U, // <7,4,u,5>: Cost 2 vext3 RHS, <4,u,5,1>
- 564579881U, // <7,4,u,6>: Cost 1 vext3 RHS, RHS
- 2714054192U, // <7,4,u,7>: Cost 3 vext3 RHS, <4,u,7,5>
- 564579899U, // <7,4,u,u>: Cost 1 vext3 RHS, RHS
- 2579038310U, // <7,5,0,0>: Cost 3 vext1 <4,7,5,0>, LHS
- 2636382310U, // <7,5,0,1>: Cost 3 vext2 <3,1,7,5>, LHS
- 2796339302U, // <7,5,0,2>: Cost 3 vuzpl <7,4,5,6>, LHS
- 3646810719U, // <7,5,0,3>: Cost 4 vext1 <3,7,5,0>, <3,5,7,0>
- 2712063586U, // <7,5,0,4>: Cost 3 vext3 RHS, <5,0,4,1>
- 2735951467U, // <7,5,0,5>: Cost 3 vext3 RHS, <5,0,5,1>
- 2735951476U, // <7,5,0,6>: Cost 3 vext3 RHS, <5,0,6,1>
- 2579043322U, // <7,5,0,7>: Cost 3 vext1 <4,7,5,0>, <7,0,1,2>
- 2636382877U, // <7,5,0,u>: Cost 3 vext2 <3,1,7,5>, LHS
- 2712211087U, // <7,5,1,0>: Cost 3 vext3 RHS, <5,1,0,1>
- 3698180916U, // <7,5,1,1>: Cost 4 vext2 <1,1,7,5>, <1,1,1,1>
- 3710124950U, // <7,5,1,2>: Cost 4 vext2 <3,1,7,5>, <1,2,3,0>
- 2636383232U, // <7,5,1,3>: Cost 3 vext2 <3,1,7,5>, <1,3,5,7>
- 2712211127U, // <7,5,1,4>: Cost 3 vext3 RHS, <5,1,4,5>
- 2590994128U, // <7,5,1,5>: Cost 3 vext1 <6,7,5,1>, <5,1,7,3>
- 2590995323U, // <7,5,1,6>: Cost 3 vext1 <6,7,5,1>, <6,7,5,1>
- 1638469328U, // <7,5,1,7>: Cost 2 vext3 RHS, <5,1,7,3>
- 1638469337U, // <7,5,1,u>: Cost 2 vext3 RHS, <5,1,u,3>
- 3785805536U, // <7,5,2,0>: Cost 4 vext3 RHS, <5,2,0,1>
- 3785805544U, // <7,5,2,1>: Cost 4 vext3 RHS, <5,2,1,0>
- 3704817288U, // <7,5,2,2>: Cost 4 vext2 <2,2,7,5>, <2,2,5,7>
- 2712063742U, // <7,5,2,3>: Cost 3 vext3 RHS, <5,2,3,4>
- 3716761386U, // <7,5,2,4>: Cost 4 vext2 <4,2,7,5>, <2,4,5,7>
- 2714054415U, // <7,5,2,5>: Cost 3 vext3 RHS, <5,2,5,3>
- 3774304024U, // <7,5,2,6>: Cost 4 vext3 <2,6,3,7>, <5,2,6,3>
- 2712063777U, // <7,5,2,7>: Cost 3 vext3 RHS, <5,2,7,3>
- 2712063787U, // <7,5,2,u>: Cost 3 vext3 RHS, <5,2,u,4>
- 3634888806U, // <7,5,3,0>: Cost 4 vext1 <1,7,5,3>, LHS
- 2636384544U, // <7,5,3,1>: Cost 3 vext2 <3,1,7,5>, <3,1,7,5>
- 3710790001U, // <7,5,3,2>: Cost 4 vext2 <3,2,7,5>, <3,2,7,5>
- 3710126492U, // <7,5,3,3>: Cost 4 vext2 <3,1,7,5>, <3,3,3,3>
- 3634892086U, // <7,5,3,4>: Cost 4 vext1 <1,7,5,3>, RHS
- 2639039076U, // <7,5,3,5>: Cost 3 vext2 <3,5,7,5>, <3,5,7,5>
- 3713444533U, // <7,5,3,6>: Cost 4 vext2 <3,6,7,5>, <3,6,7,5>
- 2693926767U, // <7,5,3,7>: Cost 3 vext3 <1,5,3,7>, <5,3,7,0>
- 2712063864U, // <7,5,3,u>: Cost 3 vext3 RHS, <5,3,u,0>
- 2579071078U, // <7,5,4,0>: Cost 3 vext1 <4,7,5,4>, LHS
- 3646841856U, // <7,5,4,1>: Cost 4 vext1 <3,7,5,4>, <1,3,5,7>
- 3716762698U, // <7,5,4,2>: Cost 4 vext2 <4,2,7,5>, <4,2,7,5>
- 3646843491U, // <7,5,4,3>: Cost 4 vext1 <3,7,5,4>, <3,5,7,4>
- 2579074358U, // <7,5,4,4>: Cost 3 vext1 <4,7,5,4>, RHS
- 2636385590U, // <7,5,4,5>: Cost 3 vext2 <3,1,7,5>, RHS
- 2645675406U, // <7,5,4,6>: Cost 3 vext2 <4,6,7,5>, <4,6,7,5>
- 1638322118U, // <7,5,4,7>: Cost 2 vext3 RHS, <5,4,7,6>
- 1638469583U, // <7,5,4,u>: Cost 2 vext3 RHS, <5,4,u,6>
- 2714054611U, // <7,5,5,0>: Cost 3 vext3 RHS, <5,5,0,1>
- 2652974800U, // <7,5,5,1>: Cost 3 vext2 <5,u,7,5>, <5,1,7,3>
- 3710127905U, // <7,5,5,2>: Cost 4 vext2 <3,1,7,5>, <5,2,7,3>
- 3785805808U, // <7,5,5,3>: Cost 4 vext3 RHS, <5,5,3,3>
- 2712211450U, // <7,5,5,4>: Cost 3 vext3 RHS, <5,5,4,4>
- 1638322180U, // <7,5,5,5>: Cost 2 vext3 RHS, <5,5,5,5>
- 2712064014U, // <7,5,5,6>: Cost 3 vext3 RHS, <5,5,6,6>
- 1638469656U, // <7,5,5,7>: Cost 2 vext3 RHS, <5,5,7,7>
- 1638469665U, // <7,5,5,u>: Cost 2 vext3 RHS, <5,5,u,7>
- 2712064036U, // <7,5,6,0>: Cost 3 vext3 RHS, <5,6,0,1>
- 2714054707U, // <7,5,6,1>: Cost 3 vext3 RHS, <5,6,1,7>
- 3785805879U, // <7,5,6,2>: Cost 4 vext3 RHS, <5,6,2,2>
- 2712064066U, // <7,5,6,3>: Cost 3 vext3 RHS, <5,6,3,4>
- 2712064076U, // <7,5,6,4>: Cost 3 vext3 RHS, <5,6,4,5>
- 2714054743U, // <7,5,6,5>: Cost 3 vext3 RHS, <5,6,5,7>
- 2712064096U, // <7,5,6,6>: Cost 3 vext3 RHS, <5,6,6,7>
- 1638322274U, // <7,5,6,7>: Cost 2 vext3 RHS, <5,6,7,0>
- 1638469739U, // <7,5,6,u>: Cost 2 vext3 RHS, <5,6,u,0>
- 1511325798U, // <7,5,7,0>: Cost 2 vext1 <5,7,5,7>, LHS
- 2692747392U, // <7,5,7,1>: Cost 3 vext3 <1,3,5,7>, <5,7,1,3>
- 2585069160U, // <7,5,7,2>: Cost 3 vext1 <5,7,5,7>, <2,2,2,2>
- 2573126390U, // <7,5,7,3>: Cost 3 vext1 <3,7,5,7>, <3,7,5,7>
- 1511329078U, // <7,5,7,4>: Cost 2 vext1 <5,7,5,7>, RHS
- 1638469800U, // <7,5,7,5>: Cost 2 vext3 RHS, <5,7,5,7>
- 2712211626U, // <7,5,7,6>: Cost 3 vext3 RHS, <5,7,6,0>
- 2712211636U, // <7,5,7,7>: Cost 3 vext3 RHS, <5,7,7,1>
- 1638469823U, // <7,5,7,u>: Cost 2 vext3 RHS, <5,7,u,3>
- 1511333990U, // <7,5,u,0>: Cost 2 vext1 <5,7,5,u>, LHS
- 2636388142U, // <7,5,u,1>: Cost 3 vext2 <3,1,7,5>, LHS
- 2712211671U, // <7,5,u,2>: Cost 3 vext3 RHS, <5,u,2,0>
- 2573134583U, // <7,5,u,3>: Cost 3 vext1 <3,7,5,u>, <3,7,5,u>
- 1511337270U, // <7,5,u,4>: Cost 2 vext1 <5,7,5,u>, RHS
- 1638469881U, // <7,5,u,5>: Cost 2 vext3 RHS, <5,u,5,7>
- 2712064258U, // <7,5,u,6>: Cost 3 vext3 RHS, <5,u,6,7>
- 1638469892U, // <7,5,u,7>: Cost 2 vext3 RHS, <5,u,7,0>
- 1638469904U, // <7,5,u,u>: Cost 2 vext3 RHS, <5,u,u,3>
- 2650324992U, // <7,6,0,0>: Cost 3 vext2 <5,4,7,6>, <0,0,0,0>
- 1576583270U, // <7,6,0,1>: Cost 2 vext2 <5,4,7,6>, LHS
- 2712064300U, // <7,6,0,2>: Cost 3 vext3 RHS, <6,0,2,4>
- 2255295336U, // <7,6,0,3>: Cost 3 vrev <6,7,3,0>
- 2712064316U, // <7,6,0,4>: Cost 3 vext3 RHS, <6,0,4,2>
- 2585088098U, // <7,6,0,5>: Cost 3 vext1 <5,7,6,0>, <5,6,7,0>
- 2735952204U, // <7,6,0,6>: Cost 3 vext3 RHS, <6,0,6,0>
- 2712211799U, // <7,6,0,7>: Cost 3 vext3 RHS, <6,0,7,2>
- 1576583837U, // <7,6,0,u>: Cost 2 vext2 <5,4,7,6>, LHS
- 1181340494U, // <7,6,1,0>: Cost 2 vrev <6,7,0,1>
- 2650325812U, // <7,6,1,1>: Cost 3 vext2 <5,4,7,6>, <1,1,1,1>
- 2650325910U, // <7,6,1,2>: Cost 3 vext2 <5,4,7,6>, <1,2,3,0>
- 2650325976U, // <7,6,1,3>: Cost 3 vext2 <5,4,7,6>, <1,3,1,3>
- 2579123510U, // <7,6,1,4>: Cost 3 vext1 <4,7,6,1>, RHS
- 2650326160U, // <7,6,1,5>: Cost 3 vext2 <5,4,7,6>, <1,5,3,7>
- 2714055072U, // <7,6,1,6>: Cost 3 vext3 RHS, <6,1,6,3>
- 2712064425U, // <7,6,1,7>: Cost 3 vext3 RHS, <6,1,7,3>
- 1181930390U, // <7,6,1,u>: Cost 2 vrev <6,7,u,1>
- 2712211897U, // <7,6,2,0>: Cost 3 vext3 RHS, <6,2,0,1>
- 2714055108U, // <7,6,2,1>: Cost 3 vext3 RHS, <6,2,1,3>
- 2650326632U, // <7,6,2,2>: Cost 3 vext2 <5,4,7,6>, <2,2,2,2>
- 2650326694U, // <7,6,2,3>: Cost 3 vext2 <5,4,7,6>, <2,3,0,1>
- 2714055137U, // <7,6,2,4>: Cost 3 vext3 RHS, <6,2,4,5>
- 2714055148U, // <7,6,2,5>: Cost 3 vext3 RHS, <6,2,5,7>
- 2650326970U, // <7,6,2,6>: Cost 3 vext2 <5,4,7,6>, <2,6,3,7>
- 1638470138U, // <7,6,2,7>: Cost 2 vext3 RHS, <6,2,7,3>
- 1638470147U, // <7,6,2,u>: Cost 2 vext3 RHS, <6,2,u,3>
- 2650327190U, // <7,6,3,0>: Cost 3 vext2 <5,4,7,6>, <3,0,1,2>
- 2255172441U, // <7,6,3,1>: Cost 3 vrev <6,7,1,3>
- 2255246178U, // <7,6,3,2>: Cost 3 vrev <6,7,2,3>
- 2650327452U, // <7,6,3,3>: Cost 3 vext2 <5,4,7,6>, <3,3,3,3>
- 2712064562U, // <7,6,3,4>: Cost 3 vext3 RHS, <6,3,4,5>
- 2650327627U, // <7,6,3,5>: Cost 3 vext2 <5,4,7,6>, <3,5,4,7>
- 3713452726U, // <7,6,3,6>: Cost 4 vext2 <3,6,7,6>, <3,6,7,6>
- 2700563016U, // <7,6,3,7>: Cost 3 vext3 <2,6,3,7>, <6,3,7,0>
- 2712064593U, // <7,6,3,u>: Cost 3 vext3 RHS, <6,3,u,0>
- 2650327954U, // <7,6,4,0>: Cost 3 vext2 <5,4,7,6>, <4,0,5,1>
- 2735952486U, // <7,6,4,1>: Cost 3 vext3 RHS, <6,4,1,3>
- 2735952497U, // <7,6,4,2>: Cost 3 vext3 RHS, <6,4,2,5>
- 2255328108U, // <7,6,4,3>: Cost 3 vrev <6,7,3,4>
- 2712212100U, // <7,6,4,4>: Cost 3 vext3 RHS, <6,4,4,6>
- 1576586550U, // <7,6,4,5>: Cost 2 vext2 <5,4,7,6>, RHS
- 2714055312U, // <7,6,4,6>: Cost 3 vext3 RHS, <6,4,6,0>
- 2712212126U, // <7,6,4,7>: Cost 3 vext3 RHS, <6,4,7,5>
- 1576586793U, // <7,6,4,u>: Cost 2 vext2 <5,4,7,6>, RHS
- 2579152998U, // <7,6,5,0>: Cost 3 vext1 <4,7,6,5>, LHS
- 2650328784U, // <7,6,5,1>: Cost 3 vext2 <5,4,7,6>, <5,1,7,3>
- 2714055364U, // <7,6,5,2>: Cost 3 vext3 RHS, <6,5,2,7>
- 3785806538U, // <7,6,5,3>: Cost 4 vext3 RHS, <6,5,3,4>
- 1576587206U, // <7,6,5,4>: Cost 2 vext2 <5,4,7,6>, <5,4,7,6>
- 2650329092U, // <7,6,5,5>: Cost 3 vext2 <5,4,7,6>, <5,5,5,5>
- 2650329186U, // <7,6,5,6>: Cost 3 vext2 <5,4,7,6>, <5,6,7,0>
- 2712064753U, // <7,6,5,7>: Cost 3 vext3 RHS, <6,5,7,7>
- 1181963162U, // <7,6,5,u>: Cost 2 vrev <6,7,u,5>
- 2714055421U, // <7,6,6,0>: Cost 3 vext3 RHS, <6,6,0,1>
- 2714055432U, // <7,6,6,1>: Cost 3 vext3 RHS, <6,6,1,3>
- 2650329594U, // <7,6,6,2>: Cost 3 vext2 <5,4,7,6>, <6,2,7,3>
- 3785806619U, // <7,6,6,3>: Cost 4 vext3 RHS, <6,6,3,4>
- 2712212260U, // <7,6,6,4>: Cost 3 vext3 RHS, <6,6,4,4>
- 2714055472U, // <7,6,6,5>: Cost 3 vext3 RHS, <6,6,5,7>
- 1638323000U, // <7,6,6,6>: Cost 2 vext3 RHS, <6,6,6,6>
- 1638470466U, // <7,6,6,7>: Cost 2 vext3 RHS, <6,6,7,7>
- 1638470475U, // <7,6,6,u>: Cost 2 vext3 RHS, <6,6,u,7>
- 1638323022U, // <7,6,7,0>: Cost 2 vext3 RHS, <6,7,0,1>
- 2712064854U, // <7,6,7,1>: Cost 3 vext3 RHS, <6,7,1,0>
- 2712064865U, // <7,6,7,2>: Cost 3 vext3 RHS, <6,7,2,2>
- 2712064872U, // <7,6,7,3>: Cost 3 vext3 RHS, <6,7,3,0>
- 1638323062U, // <7,6,7,4>: Cost 2 vext3 RHS, <6,7,4,5>
- 2712064894U, // <7,6,7,5>: Cost 3 vext3 RHS, <6,7,5,4>
- 2712064905U, // <7,6,7,6>: Cost 3 vext3 RHS, <6,7,6,6>
- 2712064915U, // <7,6,7,7>: Cost 3 vext3 RHS, <6,7,7,7>
- 1638323094U, // <7,6,7,u>: Cost 2 vext3 RHS, <6,7,u,1>
- 1638470559U, // <7,6,u,0>: Cost 2 vext3 RHS, <6,u,0,1>
- 1576589102U, // <7,6,u,1>: Cost 2 vext2 <5,4,7,6>, LHS
- 2712212402U, // <7,6,u,2>: Cost 3 vext3 RHS, <6,u,2,2>
- 2712212409U, // <7,6,u,3>: Cost 3 vext3 RHS, <6,u,3,0>
- 1638470599U, // <7,6,u,4>: Cost 2 vext3 RHS, <6,u,4,5>
- 1576589466U, // <7,6,u,5>: Cost 2 vext2 <5,4,7,6>, RHS
- 1638323000U, // <7,6,u,6>: Cost 2 vext3 RHS, <6,6,6,6>
- 1638470624U, // <7,6,u,7>: Cost 2 vext3 RHS, <6,u,7,3>
- 1638470631U, // <7,6,u,u>: Cost 2 vext3 RHS, <6,u,u,1>
- 2712065007U, // <7,7,0,0>: Cost 3 vext3 RHS, <7,0,0,0>
- 1638323194U, // <7,7,0,1>: Cost 2 vext3 RHS, <7,0,1,2>
- 2712065025U, // <7,7,0,2>: Cost 3 vext3 RHS, <7,0,2,0>
- 3646958337U, // <7,7,0,3>: Cost 4 vext1 <3,7,7,0>, <3,7,7,0>
- 2712065044U, // <7,7,0,4>: Cost 3 vext3 RHS, <7,0,4,1>
- 2585161907U, // <7,7,0,5>: Cost 3 vext1 <5,7,7,0>, <5,7,7,0>
- 2591134604U, // <7,7,0,6>: Cost 3 vext1 <6,7,7,0>, <6,7,7,0>
- 2591134714U, // <7,7,0,7>: Cost 3 vext1 <6,7,7,0>, <7,0,1,2>
- 1638323257U, // <7,7,0,u>: Cost 2 vext3 RHS, <7,0,u,2>
- 2712065091U, // <7,7,1,0>: Cost 3 vext3 RHS, <7,1,0,3>
- 2712065098U, // <7,7,1,1>: Cost 3 vext3 RHS, <7,1,1,1>
- 2712065109U, // <7,7,1,2>: Cost 3 vext3 RHS, <7,1,2,3>
- 2692748384U, // <7,7,1,3>: Cost 3 vext3 <1,3,5,7>, <7,1,3,5>
- 2585169206U, // <7,7,1,4>: Cost 3 vext1 <5,7,7,1>, RHS
- 2693928048U, // <7,7,1,5>: Cost 3 vext3 <1,5,3,7>, <7,1,5,3>
- 2585170766U, // <7,7,1,6>: Cost 3 vext1 <5,7,7,1>, <6,7,0,1>
- 2735953024U, // <7,7,1,7>: Cost 3 vext3 RHS, <7,1,7,1>
- 2695918731U, // <7,7,1,u>: Cost 3 vext3 <1,u,3,7>, <7,1,u,3>
- 3770471574U, // <7,7,2,0>: Cost 4 vext3 <2,0,5,7>, <7,2,0,5>
- 3785807002U, // <7,7,2,1>: Cost 4 vext3 RHS, <7,2,1,0>
- 2712065189U, // <7,7,2,2>: Cost 3 vext3 RHS, <7,2,2,2>
- 2712065196U, // <7,7,2,3>: Cost 3 vext3 RHS, <7,2,3,0>
- 3773125818U, // <7,7,2,4>: Cost 4 vext3 <2,4,5,7>, <7,2,4,5>
- 3766490305U, // <7,7,2,5>: Cost 4 vext3 <1,3,5,7>, <7,2,5,3>
- 2700563658U, // <7,7,2,6>: Cost 3 vext3 <2,6,3,7>, <7,2,6,3>
- 2735953107U, // <7,7,2,7>: Cost 3 vext3 RHS, <7,2,7,3>
- 2701890780U, // <7,7,2,u>: Cost 3 vext3 <2,u,3,7>, <7,2,u,3>
- 2712065251U, // <7,7,3,0>: Cost 3 vext3 RHS, <7,3,0,1>
- 3766490350U, // <7,7,3,1>: Cost 4 vext3 <1,3,5,7>, <7,3,1,3>
- 3774305530U, // <7,7,3,2>: Cost 4 vext3 <2,6,3,7>, <7,3,2,6>
- 2637728196U, // <7,7,3,3>: Cost 3 vext2 <3,3,7,7>, <3,3,7,7>
- 2712065291U, // <7,7,3,4>: Cost 3 vext3 RHS, <7,3,4,5>
- 2585186486U, // <7,7,3,5>: Cost 3 vext1 <5,7,7,3>, <5,7,7,3>
- 2639719095U, // <7,7,3,6>: Cost 3 vext2 <3,6,7,7>, <3,6,7,7>
- 2640382728U, // <7,7,3,7>: Cost 3 vext2 <3,7,7,7>, <3,7,7,7>
- 2641046361U, // <7,7,3,u>: Cost 3 vext2 <3,u,7,7>, <3,u,7,7>
- 2712212792U, // <7,7,4,0>: Cost 3 vext3 RHS, <7,4,0,5>
- 3646989312U, // <7,7,4,1>: Cost 4 vext1 <3,7,7,4>, <1,3,5,7>
- 3785807176U, // <7,7,4,2>: Cost 4 vext3 RHS, <7,4,2,3>
- 3646991109U, // <7,7,4,3>: Cost 4 vext1 <3,7,7,4>, <3,7,7,4>
- 2712065371U, // <7,7,4,4>: Cost 3 vext3 RHS, <7,4,4,4>
- 1638323558U, // <7,7,4,5>: Cost 2 vext3 RHS, <7,4,5,6>
- 2712212845U, // <7,7,4,6>: Cost 3 vext3 RHS, <7,4,6,4>
- 2591167846U, // <7,7,4,7>: Cost 3 vext1 <6,7,7,4>, <7,4,5,6>
- 1638323585U, // <7,7,4,u>: Cost 2 vext3 RHS, <7,4,u,6>
- 2585198694U, // <7,7,5,0>: Cost 3 vext1 <5,7,7,5>, LHS
- 2712212884U, // <7,7,5,1>: Cost 3 vext3 RHS, <7,5,1,7>
- 3711471393U, // <7,7,5,2>: Cost 4 vext2 <3,3,7,7>, <5,2,7,3>
- 2649673590U, // <7,7,5,3>: Cost 3 vext2 <5,3,7,7>, <5,3,7,7>
- 2712065455U, // <7,7,5,4>: Cost 3 vext3 RHS, <7,5,4,7>
- 1577259032U, // <7,7,5,5>: Cost 2 vext2 <5,5,7,7>, <5,5,7,7>
- 2712065473U, // <7,7,5,6>: Cost 3 vext3 RHS, <7,5,6,7>
- 2712212936U, // <7,7,5,7>: Cost 3 vext3 RHS, <7,5,7,5>
- 1579249931U, // <7,7,5,u>: Cost 2 vext2 <5,u,7,7>, <5,u,7,7>
- 2591178854U, // <7,7,6,0>: Cost 3 vext1 <6,7,7,6>, LHS
- 2735953374U, // <7,7,6,1>: Cost 3 vext3 RHS, <7,6,1,0>
- 2712212974U, // <7,7,6,2>: Cost 3 vext3 RHS, <7,6,2,7>
- 2655646287U, // <7,7,6,3>: Cost 3 vext2 <6,3,7,7>, <6,3,7,7>
- 2591182134U, // <7,7,6,4>: Cost 3 vext1 <6,7,7,6>, RHS
- 2656973553U, // <7,7,6,5>: Cost 3 vext2 <6,5,7,7>, <6,5,7,7>
- 1583895362U, // <7,7,6,6>: Cost 2 vext2 <6,6,7,7>, <6,6,7,7>
- 2712065556U, // <7,7,6,7>: Cost 3 vext3 RHS, <7,6,7,0>
- 1585222628U, // <7,7,6,u>: Cost 2 vext2 <6,u,7,7>, <6,u,7,7>
- 1523417190U, // <7,7,7,0>: Cost 2 vext1 <7,7,7,7>, LHS
- 2597159670U, // <7,7,7,1>: Cost 3 vext1 <7,7,7,7>, <1,0,3,2>
- 2597160552U, // <7,7,7,2>: Cost 3 vext1 <7,7,7,7>, <2,2,2,2>
- 2597161110U, // <7,7,7,3>: Cost 3 vext1 <7,7,7,7>, <3,0,1,2>
- 1523420470U, // <7,7,7,4>: Cost 2 vext1 <7,7,7,7>, RHS
- 2651002296U, // <7,7,7,5>: Cost 3 vext2 <5,5,7,7>, <7,5,5,7>
- 2657637906U, // <7,7,7,6>: Cost 3 vext2 <6,6,7,7>, <7,6,6,7>
- 363253046U, // <7,7,7,7>: Cost 1 vdup3 RHS
- 363253046U, // <7,7,7,u>: Cost 1 vdup3 RHS
- 1523417190U, // <7,7,u,0>: Cost 2 vext1 <7,7,7,7>, LHS
- 1638471298U, // <7,7,u,1>: Cost 2 vext3 RHS, <7,u,1,2>
- 2712213132U, // <7,7,u,2>: Cost 3 vext3 RHS, <7,u,2,3>
- 2712213138U, // <7,7,u,3>: Cost 3 vext3 RHS, <7,u,3,0>
- 1523420470U, // <7,7,u,4>: Cost 2 vext1 <7,7,7,7>, RHS
- 1638471338U, // <7,7,u,5>: Cost 2 vext3 RHS, <7,u,5,6>
- 1595840756U, // <7,7,u,6>: Cost 2 vext2 <u,6,7,7>, <u,6,7,7>
- 363253046U, // <7,7,u,7>: Cost 1 vdup3 RHS
- 363253046U, // <7,7,u,u>: Cost 1 vdup3 RHS
- 1638318080U, // <7,u,0,0>: Cost 2 vext3 RHS, <0,0,0,0>
- 1638323923U, // <7,u,0,1>: Cost 2 vext3 RHS, <u,0,1,2>
- 1662211804U, // <7,u,0,2>: Cost 2 vext3 RHS, <u,0,2,2>
- 1638323941U, // <7,u,0,3>: Cost 2 vext3 RHS, <u,0,3,2>
- 2712065773U, // <7,u,0,4>: Cost 3 vext3 RHS, <u,0,4,1>
- 1662359286U, // <7,u,0,5>: Cost 2 vext3 RHS, <u,0,5,1>
- 1662359296U, // <7,u,0,6>: Cost 2 vext3 RHS, <u,0,6,2>
- 2987150664U, // <7,u,0,7>: Cost 3 vzipr <5,6,7,0>, RHS
- 1638323986U, // <7,u,0,u>: Cost 2 vext3 RHS, <u,0,u,2>
- 1517469798U, // <7,u,1,0>: Cost 2 vext1 <6,7,u,1>, LHS
- 1638318900U, // <7,u,1,1>: Cost 2 vext3 RHS, <1,1,1,1>
- 564582190U, // <7,u,1,2>: Cost 1 vext3 RHS, LHS
- 1638324023U, // <7,u,1,3>: Cost 2 vext3 RHS, <u,1,3,3>
- 1517473078U, // <7,u,1,4>: Cost 2 vext1 <6,7,u,1>, RHS
- 2693928777U, // <7,u,1,5>: Cost 3 vext3 <1,5,3,7>, <u,1,5,3>
- 1517474710U, // <7,u,1,6>: Cost 2 vext1 <6,7,u,1>, <6,7,u,1>
- 1640462171U, // <7,u,1,7>: Cost 2 vext3 RHS, <u,1,7,3>
- 564582244U, // <7,u,1,u>: Cost 1 vext3 RHS, LHS
- 1638318244U, // <7,u,2,0>: Cost 2 vext3 RHS, <0,2,0,2>
- 2712065907U, // <7,u,2,1>: Cost 3 vext3 RHS, <u,2,1,0>
- 1638319720U, // <7,u,2,2>: Cost 2 vext3 RHS, <2,2,2,2>
- 1638324101U, // <7,u,2,3>: Cost 2 vext3 RHS, <u,2,3,0>
- 1638318284U, // <7,u,2,4>: Cost 2 vext3 RHS, <0,2,4,6>
- 2712065947U, // <7,u,2,5>: Cost 3 vext3 RHS, <u,2,5,4>
- 2700564387U, // <7,u,2,6>: Cost 3 vext3 <2,6,3,7>, <u,2,6,3>
- 1640314796U, // <7,u,2,7>: Cost 2 vext3 RHS, <u,2,7,3>
- 1638324146U, // <7,u,2,u>: Cost 2 vext3 RHS, <u,2,u,0>
- 1638324156U, // <7,u,3,0>: Cost 2 vext3 RHS, <u,3,0,1>
- 1638319064U, // <7,u,3,1>: Cost 2 vext3 RHS, <1,3,1,3>
- 2700564435U, // <7,u,3,2>: Cost 3 vext3 <2,6,3,7>, <u,3,2,6>
- 1638320540U, // <7,u,3,3>: Cost 2 vext3 RHS, <3,3,3,3>
- 1638324196U, // <7,u,3,4>: Cost 2 vext3 RHS, <u,3,4,5>
- 1638324207U, // <7,u,3,5>: Cost 2 vext3 RHS, <u,3,5,7>
- 2700564472U, // <7,u,3,6>: Cost 3 vext3 <2,6,3,7>, <u,3,6,7>
- 2695919610U, // <7,u,3,7>: Cost 3 vext3 <1,u,3,7>, <u,3,7,0>
- 1638324228U, // <7,u,3,u>: Cost 2 vext3 RHS, <u,3,u,1>
- 2712066061U, // <7,u,4,0>: Cost 3 vext3 RHS, <u,4,0,1>
- 1662212122U, // <7,u,4,1>: Cost 2 vext3 RHS, <u,4,1,5>
- 1662212132U, // <7,u,4,2>: Cost 2 vext3 RHS, <u,4,2,6>
- 2712066092U, // <7,u,4,3>: Cost 3 vext3 RHS, <u,4,3,5>
- 1638321360U, // <7,u,4,4>: Cost 2 vext3 RHS, <4,4,4,4>
- 1638324287U, // <7,u,4,5>: Cost 2 vext3 RHS, <u,4,5,6>
- 1662359624U, // <7,u,4,6>: Cost 2 vext3 RHS, <u,4,6,6>
- 1640314961U, // <7,u,4,7>: Cost 2 vext3 RHS, <u,4,7,6>
- 1638324314U, // <7,u,4,u>: Cost 2 vext3 RHS, <u,4,u,6>
- 1517502566U, // <7,u,5,0>: Cost 2 vext1 <6,7,u,5>, LHS
- 1574612693U, // <7,u,5,1>: Cost 2 vext2 <5,1,7,u>, <5,1,7,u>
- 2712066162U, // <7,u,5,2>: Cost 3 vext3 RHS, <u,5,2,3>
- 1638324351U, // <7,u,5,3>: Cost 2 vext3 RHS, <u,5,3,7>
- 1576603592U, // <7,u,5,4>: Cost 2 vext2 <5,4,7,u>, <5,4,7,u>
- 1577267225U, // <7,u,5,5>: Cost 2 vext2 <5,5,7,u>, <5,5,7,u>
- 564582554U, // <7,u,5,6>: Cost 1 vext3 RHS, RHS
- 1640462499U, // <7,u,5,7>: Cost 2 vext3 RHS, <u,5,7,7>
- 564582572U, // <7,u,5,u>: Cost 1 vext3 RHS, RHS
- 2712066223U, // <7,u,6,0>: Cost 3 vext3 RHS, <u,6,0,1>
- 2712066238U, // <7,u,6,1>: Cost 3 vext3 RHS, <u,6,1,7>
- 1581249023U, // <7,u,6,2>: Cost 2 vext2 <6,2,7,u>, <6,2,7,u>
- 1638324432U, // <7,u,6,3>: Cost 2 vext3 RHS, <u,6,3,7>
- 1638468980U, // <7,u,6,4>: Cost 2 vext3 RHS, <4,6,4,6>
- 2712066274U, // <7,u,6,5>: Cost 3 vext3 RHS, <u,6,5,7>
- 1583903555U, // <7,u,6,6>: Cost 2 vext2 <6,6,7,u>, <6,6,7,u>
- 1640315117U, // <7,u,6,7>: Cost 2 vext3 RHS, <u,6,7,0>
- 1638324477U, // <7,u,6,u>: Cost 2 vext3 RHS, <u,6,u,7>
- 1638471936U, // <7,u,7,0>: Cost 2 vext3 RHS, <u,7,0,1>
- 2692970763U, // <7,u,7,1>: Cost 3 vext3 <1,3,u,7>, <u,7,1,3>
- 2700933399U, // <7,u,7,2>: Cost 3 vext3 <2,6,u,7>, <u,7,2,6>
- 2573347601U, // <7,u,7,3>: Cost 3 vext1 <3,7,u,7>, <3,7,u,7>
- 1638471976U, // <7,u,7,4>: Cost 2 vext3 RHS, <u,7,4,5>
- 1511551171U, // <7,u,7,5>: Cost 2 vext1 <5,7,u,7>, <5,7,u,7>
- 2712213815U, // <7,u,7,6>: Cost 3 vext3 RHS, <u,7,6,2>
- 363253046U, // <7,u,7,7>: Cost 1 vdup3 RHS
- 363253046U, // <7,u,7,u>: Cost 1 vdup3 RHS
- 1638324561U, // <7,u,u,0>: Cost 2 vext3 RHS, <u,u,0,1>
- 1638324571U, // <7,u,u,1>: Cost 2 vext3 RHS, <u,u,1,2>
- 564582757U, // <7,u,u,2>: Cost 1 vext3 RHS, LHS
- 1638324587U, // <7,u,u,3>: Cost 2 vext3 RHS, <u,u,3,0>
- 1638324601U, // <7,u,u,4>: Cost 2 vext3 RHS, <u,u,4,5>
- 1638324611U, // <7,u,u,5>: Cost 2 vext3 RHS, <u,u,5,6>
- 564582797U, // <7,u,u,6>: Cost 1 vext3 RHS, RHS
- 363253046U, // <7,u,u,7>: Cost 1 vdup3 RHS
- 564582811U, // <7,u,u,u>: Cost 1 vext3 RHS, LHS
- 135053414U, // <u,0,0,0>: Cost 1 vdup0 LHS
- 1611489290U, // <u,0,0,1>: Cost 2 vext3 LHS, <0,0,1,1>
- 1611489300U, // <u,0,0,2>: Cost 2 vext3 LHS, <0,0,2,2>
- 2568054923U, // <u,0,0,3>: Cost 3 vext1 <3,0,0,0>, <3,0,0,0>
- 1481706806U, // <u,0,0,4>: Cost 2 vext1 <0,u,0,0>, RHS
- 2555449040U, // <u,0,0,5>: Cost 3 vext1 <0,u,0,0>, <5,1,7,3>
- 2591282078U, // <u,0,0,6>: Cost 3 vext1 <6,u,0,0>, <6,u,0,0>
- 2591945711U, // <u,0,0,7>: Cost 3 vext1 <7,0,0,0>, <7,0,0,0>
- 135053414U, // <u,0,0,u>: Cost 1 vdup0 LHS
- 1493655654U, // <u,0,1,0>: Cost 2 vext1 <2,u,0,1>, LHS
- 1860550758U, // <u,0,1,1>: Cost 2 vzipl LHS, LHS
- 537747563U, // <u,0,1,2>: Cost 1 vext3 LHS, LHS
- 2625135576U, // <u,0,1,3>: Cost 3 vext2 <1,2,u,0>, <1,3,1,3>
- 1493658934U, // <u,0,1,4>: Cost 2 vext1 <2,u,0,1>, RHS
- 2625135760U, // <u,0,1,5>: Cost 3 vext2 <1,2,u,0>, <1,5,3,7>
- 1517548447U, // <u,0,1,6>: Cost 2 vext1 <6,u,0,1>, <6,u,0,1>
- 2591290362U, // <u,0,1,7>: Cost 3 vext1 <6,u,0,1>, <7,0,1,2>
- 537747612U, // <u,0,1,u>: Cost 1 vext3 LHS, LHS
- 1611489444U, // <u,0,2,0>: Cost 2 vext3 LHS, <0,2,0,2>
- 2685231276U, // <u,0,2,1>: Cost 3 vext3 LHS, <0,2,1,1>
- 1994768486U, // <u,0,2,2>: Cost 2 vtrnl LHS, LHS
- 2685231294U, // <u,0,2,3>: Cost 3 vext3 LHS, <0,2,3,1>
- 1611489484U, // <u,0,2,4>: Cost 2 vext3 LHS, <0,2,4,6>
- 2712068310U, // <u,0,2,5>: Cost 3 vext3 RHS, <0,2,5,7>
- 2625136570U, // <u,0,2,6>: Cost 3 vext2 <1,2,u,0>, <2,6,3,7>
- 2591962097U, // <u,0,2,7>: Cost 3 vext1 <7,0,0,2>, <7,0,0,2>
- 1611489516U, // <u,0,2,u>: Cost 2 vext3 LHS, <0,2,u,2>
- 2954067968U, // <u,0,3,0>: Cost 3 vzipr LHS, <0,0,0,0>
- 2685231356U, // <u,0,3,1>: Cost 3 vext3 LHS, <0,3,1,0>
- 72589981U, // <u,0,3,2>: Cost 1 vrev LHS
- 2625137052U, // <u,0,3,3>: Cost 3 vext2 <1,2,u,0>, <3,3,3,3>
- 2625137154U, // <u,0,3,4>: Cost 3 vext2 <1,2,u,0>, <3,4,5,6>
- 2639071848U, // <u,0,3,5>: Cost 3 vext2 <3,5,u,0>, <3,5,u,0>
- 2639735481U, // <u,0,3,6>: Cost 3 vext2 <3,6,u,0>, <3,6,u,0>
- 2597279354U, // <u,0,3,7>: Cost 3 vext1 <7,u,0,3>, <7,u,0,3>
- 73032403U, // <u,0,3,u>: Cost 1 vrev LHS
- 2687074636U, // <u,0,4,0>: Cost 3 vext3 <0,4,0,u>, <0,4,0,u>
- 1611489618U, // <u,0,4,1>: Cost 2 vext3 LHS, <0,4,1,5>
- 1611489628U, // <u,0,4,2>: Cost 2 vext3 LHS, <0,4,2,6>
- 3629222038U, // <u,0,4,3>: Cost 4 vext1 <0,u,0,4>, <3,0,1,2>
- 2555481398U, // <u,0,4,4>: Cost 3 vext1 <0,u,0,4>, RHS
- 1551396150U, // <u,0,4,5>: Cost 2 vext2 <1,2,u,0>, RHS
- 2651680116U, // <u,0,4,6>: Cost 3 vext2 <5,6,u,0>, <4,6,4,6>
- 2646150600U, // <u,0,4,7>: Cost 3 vext2 <4,7,5,0>, <4,7,5,0>
- 1611932050U, // <u,0,4,u>: Cost 2 vext3 LHS, <0,4,u,6>
- 2561458278U, // <u,0,5,0>: Cost 3 vext1 <1,u,0,5>, LHS
- 1863532646U, // <u,0,5,1>: Cost 2 vzipl RHS, LHS
- 2712068526U, // <u,0,5,2>: Cost 3 vext3 RHS, <0,5,2,7>
- 2649689976U, // <u,0,5,3>: Cost 3 vext2 <5,3,u,0>, <5,3,u,0>
- 2220237489U, // <u,0,5,4>: Cost 3 vrev <0,u,4,5>
- 2651680772U, // <u,0,5,5>: Cost 3 vext2 <5,6,u,0>, <5,5,5,5>
- 1577939051U, // <u,0,5,6>: Cost 2 vext2 <5,6,u,0>, <5,6,u,0>
- 2830077238U, // <u,0,5,7>: Cost 3 vuzpr <1,u,3,0>, RHS
- 1579266317U, // <u,0,5,u>: Cost 2 vext2 <5,u,u,0>, <5,u,u,0>
- 2555494502U, // <u,0,6,0>: Cost 3 vext1 <0,u,0,6>, LHS
- 2712068598U, // <u,0,6,1>: Cost 3 vext3 RHS, <0,6,1,7>
- 1997750374U, // <u,0,6,2>: Cost 2 vtrnl RHS, LHS
- 2655662673U, // <u,0,6,3>: Cost 3 vext2 <6,3,u,0>, <6,3,u,0>
- 2555497782U, // <u,0,6,4>: Cost 3 vext1 <0,u,0,6>, RHS
- 2651681459U, // <u,0,6,5>: Cost 3 vext2 <5,6,u,0>, <6,5,0,u>
- 2651681592U, // <u,0,6,6>: Cost 3 vext2 <5,6,u,0>, <6,6,6,6>
- 2651681614U, // <u,0,6,7>: Cost 3 vext2 <5,6,u,0>, <6,7,0,1>
- 1997750428U, // <u,0,6,u>: Cost 2 vtrnl RHS, LHS
- 2567446630U, // <u,0,7,0>: Cost 3 vext1 <2,u,0,7>, LHS
- 2567447446U, // <u,0,7,1>: Cost 3 vext1 <2,u,0,7>, <1,2,3,0>
- 2567448641U, // <u,0,7,2>: Cost 3 vext1 <2,u,0,7>, <2,u,0,7>
- 2573421338U, // <u,0,7,3>: Cost 3 vext1 <3,u,0,7>, <3,u,0,7>
- 2567449910U, // <u,0,7,4>: Cost 3 vext1 <2,u,0,7>, RHS
- 2651682242U, // <u,0,7,5>: Cost 3 vext2 <5,6,u,0>, <7,5,6,u>
- 2591339429U, // <u,0,7,6>: Cost 3 vext1 <6,u,0,7>, <6,u,0,7>
- 2651682412U, // <u,0,7,7>: Cost 3 vext2 <5,6,u,0>, <7,7,7,7>
- 2567452462U, // <u,0,7,u>: Cost 3 vext1 <2,u,0,7>, LHS
- 135053414U, // <u,0,u,0>: Cost 1 vdup0 LHS
- 1611489938U, // <u,0,u,1>: Cost 2 vext3 LHS, <0,u,1,1>
- 537748125U, // <u,0,u,2>: Cost 1 vext3 LHS, LHS
- 2685674148U, // <u,0,u,3>: Cost 3 vext3 LHS, <0,u,3,1>
- 1611932338U, // <u,0,u,4>: Cost 2 vext3 LHS, <0,u,4,6>
- 1551399066U, // <u,0,u,5>: Cost 2 vext2 <1,2,u,0>, RHS
- 1517605798U, // <u,0,u,6>: Cost 2 vext1 <6,u,0,u>, <6,u,0,u>
- 2830077481U, // <u,0,u,7>: Cost 3 vuzpr <1,u,3,0>, RHS
- 537748179U, // <u,0,u,u>: Cost 1 vext3 LHS, LHS
- 1544101961U, // <u,1,0,0>: Cost 2 vext2 <0,0,u,1>, <0,0,u,1>
- 1558036582U, // <u,1,0,1>: Cost 2 vext2 <2,3,u,1>, LHS
- 2619171051U, // <u,1,0,2>: Cost 3 vext2 <0,2,u,1>, <0,2,u,1>
- 1611490038U, // <u,1,0,3>: Cost 2 vext3 LHS, <1,0,3,2>
- 2555522358U, // <u,1,0,4>: Cost 3 vext1 <0,u,1,0>, RHS
- 2712068871U, // <u,1,0,5>: Cost 3 vext3 RHS, <1,0,5,1>
- 2591355815U, // <u,1,0,6>: Cost 3 vext1 <6,u,1,0>, <6,u,1,0>
- 2597328512U, // <u,1,0,7>: Cost 3 vext1 <7,u,1,0>, <7,u,1,0>
- 1611490083U, // <u,1,0,u>: Cost 2 vext3 LHS, <1,0,u,2>
- 1481785446U, // <u,1,1,0>: Cost 2 vext1 <0,u,1,1>, LHS
- 202162278U, // <u,1,1,1>: Cost 1 vdup1 LHS
- 2555528808U, // <u,1,1,2>: Cost 3 vext1 <0,u,1,1>, <2,2,2,2>
- 1611490120U, // <u,1,1,3>: Cost 2 vext3 LHS, <1,1,3,3>
- 1481788726U, // <u,1,1,4>: Cost 2 vext1 <0,u,1,1>, RHS
- 2689876828U, // <u,1,1,5>: Cost 3 vext3 LHS, <1,1,5,5>
- 2591364008U, // <u,1,1,6>: Cost 3 vext1 <6,u,1,1>, <6,u,1,1>
- 2592691274U, // <u,1,1,7>: Cost 3 vext1 <7,1,1,1>, <7,1,1,1>
- 202162278U, // <u,1,1,u>: Cost 1 vdup1 LHS
- 1499709542U, // <u,1,2,0>: Cost 2 vext1 <3,u,1,2>, LHS
- 2689876871U, // <u,1,2,1>: Cost 3 vext3 LHS, <1,2,1,3>
- 2631116445U, // <u,1,2,2>: Cost 3 vext2 <2,2,u,1>, <2,2,u,1>
- 835584U, // <u,1,2,3>: Cost 0 copy LHS
- 1499712822U, // <u,1,2,4>: Cost 2 vext1 <3,u,1,2>, RHS
- 2689876907U, // <u,1,2,5>: Cost 3 vext3 LHS, <1,2,5,3>
- 2631780282U, // <u,1,2,6>: Cost 3 vext2 <2,3,u,1>, <2,6,3,7>
- 1523603074U, // <u,1,2,7>: Cost 2 vext1 <7,u,1,2>, <7,u,1,2>
- 835584U, // <u,1,2,u>: Cost 0 copy LHS
- 1487773798U, // <u,1,3,0>: Cost 2 vext1 <1,u,1,3>, LHS
- 1611490264U, // <u,1,3,1>: Cost 2 vext3 LHS, <1,3,1,3>
- 2685232094U, // <u,1,3,2>: Cost 3 vext3 LHS, <1,3,2,0>
- 2018746470U, // <u,1,3,3>: Cost 2 vtrnr LHS, LHS
- 1487777078U, // <u,1,3,4>: Cost 2 vext1 <1,u,1,3>, RHS
- 1611490304U, // <u,1,3,5>: Cost 2 vext3 LHS, <1,3,5,7>
- 2685674505U, // <u,1,3,6>: Cost 3 vext3 LHS, <1,3,6,7>
- 2640407307U, // <u,1,3,7>: Cost 3 vext2 <3,7,u,1>, <3,7,u,1>
- 1611490327U, // <u,1,3,u>: Cost 2 vext3 LHS, <1,3,u,3>
- 1567992749U, // <u,1,4,0>: Cost 2 vext2 <4,0,u,1>, <4,0,u,1>
- 2693121070U, // <u,1,4,1>: Cost 3 vext3 <1,4,1,u>, <1,4,1,u>
- 2693194807U, // <u,1,4,2>: Cost 3 vext3 <1,4,2,u>, <1,4,2,u>
- 1152386432U, // <u,1,4,3>: Cost 2 vrev <1,u,3,4>
- 2555555126U, // <u,1,4,4>: Cost 3 vext1 <0,u,1,4>, RHS
- 1558039862U, // <u,1,4,5>: Cost 2 vext2 <2,3,u,1>, RHS
- 2645716371U, // <u,1,4,6>: Cost 3 vext2 <4,6,u,1>, <4,6,u,1>
- 2597361284U, // <u,1,4,7>: Cost 3 vext1 <7,u,1,4>, <7,u,1,4>
- 1152755117U, // <u,1,4,u>: Cost 2 vrev <1,u,u,4>
- 1481818214U, // <u,1,5,0>: Cost 2 vext1 <0,u,1,5>, LHS
- 2555560694U, // <u,1,5,1>: Cost 3 vext1 <0,u,1,5>, <1,0,3,2>
- 2555561576U, // <u,1,5,2>: Cost 3 vext1 <0,u,1,5>, <2,2,2,2>
- 1611490448U, // <u,1,5,3>: Cost 2 vext3 LHS, <1,5,3,7>
- 1481821494U, // <u,1,5,4>: Cost 2 vext1 <0,u,1,5>, RHS
- 2651025435U, // <u,1,5,5>: Cost 3 vext2 <5,5,u,1>, <5,5,u,1>
- 2651689068U, // <u,1,5,6>: Cost 3 vext2 <5,6,u,1>, <5,6,u,1>
- 2823966006U, // <u,1,5,7>: Cost 3 vuzpr <0,u,1,1>, RHS
- 1611932861U, // <u,1,5,u>: Cost 2 vext3 LHS, <1,5,u,7>
- 2555568230U, // <u,1,6,0>: Cost 3 vext1 <0,u,1,6>, LHS
- 2689877199U, // <u,1,6,1>: Cost 3 vext3 LHS, <1,6,1,7>
- 2712069336U, // <u,1,6,2>: Cost 3 vext3 RHS, <1,6,2,7>
- 2685232353U, // <u,1,6,3>: Cost 3 vext3 LHS, <1,6,3,7>
- 2555571510U, // <u,1,6,4>: Cost 3 vext1 <0,u,1,6>, RHS
- 2689877235U, // <u,1,6,5>: Cost 3 vext3 LHS, <1,6,5,7>
- 2657661765U, // <u,1,6,6>: Cost 3 vext2 <6,6,u,1>, <6,6,u,1>
- 1584583574U, // <u,1,6,7>: Cost 2 vext2 <6,7,u,1>, <6,7,u,1>
- 1585247207U, // <u,1,6,u>: Cost 2 vext2 <6,u,u,1>, <6,u,u,1>
- 2561548390U, // <u,1,7,0>: Cost 3 vext1 <1,u,1,7>, LHS
- 2561549681U, // <u,1,7,1>: Cost 3 vext1 <1,u,1,7>, <1,u,1,7>
- 2573493926U, // <u,1,7,2>: Cost 3 vext1 <3,u,1,7>, <2,3,0,1>
- 2042962022U, // <u,1,7,3>: Cost 2 vtrnr RHS, LHS
- 2561551670U, // <u,1,7,4>: Cost 3 vext1 <1,u,1,7>, RHS
- 2226300309U, // <u,1,7,5>: Cost 3 vrev <1,u,5,7>
- 2658325990U, // <u,1,7,6>: Cost 3 vext2 <6,7,u,1>, <7,6,1,u>
- 2658326124U, // <u,1,7,7>: Cost 3 vext2 <6,7,u,1>, <7,7,7,7>
- 2042962027U, // <u,1,7,u>: Cost 2 vtrnr RHS, LHS
- 1481842790U, // <u,1,u,0>: Cost 2 vext1 <0,u,1,u>, LHS
- 202162278U, // <u,1,u,1>: Cost 1 vdup1 LHS
- 2685674867U, // <u,1,u,2>: Cost 3 vext3 LHS, <1,u,2,0>
- 835584U, // <u,1,u,3>: Cost 0 copy LHS
- 1481846070U, // <u,1,u,4>: Cost 2 vext1 <0,u,1,u>, RHS
- 1611933077U, // <u,1,u,5>: Cost 2 vext3 LHS, <1,u,5,7>
- 2685674910U, // <u,1,u,6>: Cost 3 vext3 LHS, <1,u,6,7>
- 1523652232U, // <u,1,u,7>: Cost 2 vext1 <7,u,1,u>, <7,u,1,u>
- 835584U, // <u,1,u,u>: Cost 0 copy LHS
- 1544110154U, // <u,2,0,0>: Cost 2 vext2 <0,0,u,2>, <0,0,u,2>
- 1545437286U, // <u,2,0,1>: Cost 2 vext2 <0,2,u,2>, LHS
- 1545437420U, // <u,2,0,2>: Cost 2 vext2 <0,2,u,2>, <0,2,u,2>
- 2685232589U, // <u,2,0,3>: Cost 3 vext3 LHS, <2,0,3,0>
- 2619179346U, // <u,2,0,4>: Cost 3 vext2 <0,2,u,2>, <0,4,1,5>
- 2712069606U, // <u,2,0,5>: Cost 3 vext3 RHS, <2,0,5,7>
- 2689877484U, // <u,2,0,6>: Cost 3 vext3 LHS, <2,0,6,4>
- 2659656273U, // <u,2,0,7>: Cost 3 vext2 <7,0,u,2>, <0,7,2,u>
- 1545437853U, // <u,2,0,u>: Cost 2 vext2 <0,2,u,2>, LHS
- 1550082851U, // <u,2,1,0>: Cost 2 vext2 <1,0,u,2>, <1,0,u,2>
- 2619179828U, // <u,2,1,1>: Cost 3 vext2 <0,2,u,2>, <1,1,1,1>
- 2619179926U, // <u,2,1,2>: Cost 3 vext2 <0,2,u,2>, <1,2,3,0>
- 2685232671U, // <u,2,1,3>: Cost 3 vext3 LHS, <2,1,3,1>
- 2555604278U, // <u,2,1,4>: Cost 3 vext1 <0,u,2,1>, RHS
- 2619180176U, // <u,2,1,5>: Cost 3 vext2 <0,2,u,2>, <1,5,3,7>
- 2689877564U, // <u,2,1,6>: Cost 3 vext3 LHS, <2,1,6,3>
- 2602718850U, // <u,2,1,7>: Cost 3 vext1 <u,7,2,1>, <7,u,1,2>
- 1158703235U, // <u,2,1,u>: Cost 2 vrev <2,u,u,1>
- 1481867366U, // <u,2,2,0>: Cost 2 vext1 <0,u,2,2>, LHS
- 2555609846U, // <u,2,2,1>: Cost 3 vext1 <0,u,2,2>, <1,0,3,2>
- 269271142U, // <u,2,2,2>: Cost 1 vdup2 LHS
- 1611490930U, // <u,2,2,3>: Cost 2 vext3 LHS, <2,2,3,3>
- 1481870646U, // <u,2,2,4>: Cost 2 vext1 <0,u,2,2>, RHS
- 2689877640U, // <u,2,2,5>: Cost 3 vext3 LHS, <2,2,5,7>
- 2619180986U, // <u,2,2,6>: Cost 3 vext2 <0,2,u,2>, <2,6,3,7>
- 2593436837U, // <u,2,2,7>: Cost 3 vext1 <7,2,2,2>, <7,2,2,2>
- 269271142U, // <u,2,2,u>: Cost 1 vdup2 LHS
- 408134301U, // <u,2,3,0>: Cost 1 vext1 LHS, LHS
- 1481876214U, // <u,2,3,1>: Cost 2 vext1 LHS, <1,0,3,2>
- 1481877096U, // <u,2,3,2>: Cost 2 vext1 LHS, <2,2,2,2>
- 1880326246U, // <u,2,3,3>: Cost 2 vzipr LHS, LHS
- 408137014U, // <u,2,3,4>: Cost 1 vext1 LHS, RHS
- 1529654992U, // <u,2,3,5>: Cost 2 vext1 LHS, <5,1,7,3>
- 1529655802U, // <u,2,3,6>: Cost 2 vext1 LHS, <6,2,7,3>
- 1529656314U, // <u,2,3,7>: Cost 2 vext1 LHS, <7,0,1,2>
- 408139566U, // <u,2,3,u>: Cost 1 vext1 LHS, LHS
- 1567853468U, // <u,2,4,0>: Cost 2 vext2 <4,0,6,2>, <4,0,6,2>
- 2561598362U, // <u,2,4,1>: Cost 3 vext1 <1,u,2,4>, <1,2,3,4>
- 2555627214U, // <u,2,4,2>: Cost 3 vext1 <0,u,2,4>, <2,3,4,5>
- 2685232918U, // <u,2,4,3>: Cost 3 vext3 LHS, <2,4,3,5>
- 2555628854U, // <u,2,4,4>: Cost 3 vext1 <0,u,2,4>, RHS
- 1545440566U, // <u,2,4,5>: Cost 2 vext2 <0,2,u,2>, RHS
- 1571982740U, // <u,2,4,6>: Cost 2 vext2 <4,6,u,2>, <4,6,u,2>
- 2592125957U, // <u,2,4,7>: Cost 3 vext1 <7,0,2,4>, <7,0,2,4>
- 1545440809U, // <u,2,4,u>: Cost 2 vext2 <0,2,u,2>, RHS
- 2555633766U, // <u,2,5,0>: Cost 3 vext1 <0,u,2,5>, LHS
- 2561606550U, // <u,2,5,1>: Cost 3 vext1 <1,u,2,5>, <1,2,3,0>
- 2689877856U, // <u,2,5,2>: Cost 3 vext3 LHS, <2,5,2,7>
- 2685233000U, // <u,2,5,3>: Cost 3 vext3 LHS, <2,5,3,6>
- 1158441059U, // <u,2,5,4>: Cost 2 vrev <2,u,4,5>
- 2645725188U, // <u,2,5,5>: Cost 3 vext2 <4,6,u,2>, <5,5,5,5>
- 2689877892U, // <u,2,5,6>: Cost 3 vext3 LHS, <2,5,6,7>
- 2823900470U, // <u,2,5,7>: Cost 3 vuzpr <0,u,0,2>, RHS
- 1158736007U, // <u,2,5,u>: Cost 2 vrev <2,u,u,5>
- 1481900134U, // <u,2,6,0>: Cost 2 vext1 <0,u,2,6>, LHS
- 2555642614U, // <u,2,6,1>: Cost 3 vext1 <0,u,2,6>, <1,0,3,2>
- 2555643496U, // <u,2,6,2>: Cost 3 vext1 <0,u,2,6>, <2,2,2,2>
- 1611491258U, // <u,2,6,3>: Cost 2 vext3 LHS, <2,6,3,7>
- 1481903414U, // <u,2,6,4>: Cost 2 vext1 <0,u,2,6>, RHS
- 2689877964U, // <u,2,6,5>: Cost 3 vext3 LHS, <2,6,5,7>
- 2689877973U, // <u,2,6,6>: Cost 3 vext3 LHS, <2,6,6,7>
- 2645726030U, // <u,2,6,7>: Cost 3 vext2 <4,6,u,2>, <6,7,0,1>
- 1611933671U, // <u,2,6,u>: Cost 2 vext3 LHS, <2,6,u,7>
- 1585919033U, // <u,2,7,0>: Cost 2 vext2 <7,0,u,2>, <7,0,u,2>
- 2573566710U, // <u,2,7,1>: Cost 3 vext1 <3,u,2,7>, <1,0,3,2>
- 2567596115U, // <u,2,7,2>: Cost 3 vext1 <2,u,2,7>, <2,u,2,7>
- 1906901094U, // <u,2,7,3>: Cost 2 vzipr RHS, LHS
- 2555653430U, // <u,2,7,4>: Cost 3 vext1 <0,u,2,7>, RHS
- 2800080230U, // <u,2,7,5>: Cost 3 vuzpl LHS, <7,4,5,6>
- 2980643164U, // <u,2,7,6>: Cost 3 vzipr RHS, <0,4,2,6>
- 2645726828U, // <u,2,7,7>: Cost 3 vext2 <4,6,u,2>, <7,7,7,7>
- 1906901099U, // <u,2,7,u>: Cost 2 vzipr RHS, LHS
- 408175266U, // <u,2,u,0>: Cost 1 vext1 LHS, LHS
- 1545443118U, // <u,2,u,1>: Cost 2 vext2 <0,2,u,2>, LHS
- 269271142U, // <u,2,u,2>: Cost 1 vdup2 LHS
- 1611491416U, // <u,2,u,3>: Cost 2 vext3 LHS, <2,u,3,3>
- 408177974U, // <u,2,u,4>: Cost 1 vext1 LHS, RHS
- 1545443482U, // <u,2,u,5>: Cost 2 vext2 <0,2,u,2>, RHS
- 1726339226U, // <u,2,u,6>: Cost 2 vuzpl LHS, RHS
- 1529697274U, // <u,2,u,7>: Cost 2 vext1 LHS, <7,0,1,2>
- 408180526U, // <u,2,u,u>: Cost 1 vext1 LHS, LHS
- 1544781824U, // <u,3,0,0>: Cost 2 vext2 LHS, <0,0,0,0>
- 471040156U, // <u,3,0,1>: Cost 1 vext2 LHS, LHS
- 1544781988U, // <u,3,0,2>: Cost 2 vext2 LHS, <0,2,0,2>
- 2618523900U, // <u,3,0,3>: Cost 3 vext2 LHS, <0,3,1,0>
- 1544782162U, // <u,3,0,4>: Cost 2 vext2 LHS, <0,4,1,5>
- 2238188352U, // <u,3,0,5>: Cost 3 vrev <3,u,5,0>
- 2623169023U, // <u,3,0,6>: Cost 3 vext2 LHS, <0,6,2,7>
- 2238335826U, // <u,3,0,7>: Cost 3 vrev <3,u,7,0>
- 471040669U, // <u,3,0,u>: Cost 1 vext2 LHS, LHS
- 1544782582U, // <u,3,1,0>: Cost 2 vext2 LHS, <1,0,3,2>
- 1544782644U, // <u,3,1,1>: Cost 2 vext2 LHS, <1,1,1,1>
- 1544782742U, // <u,3,1,2>: Cost 2 vext2 LHS, <1,2,3,0>
- 1544782808U, // <u,3,1,3>: Cost 2 vext2 LHS, <1,3,1,3>
- 2618524733U, // <u,3,1,4>: Cost 3 vext2 LHS, <1,4,3,5>
- 1544782992U, // <u,3,1,5>: Cost 2 vext2 LHS, <1,5,3,7>
- 2618524897U, // <u,3,1,6>: Cost 3 vext2 LHS, <1,6,3,7>
- 2703517987U, // <u,3,1,7>: Cost 3 vext3 <3,1,7,u>, <3,1,7,u>
- 1544783213U, // <u,3,1,u>: Cost 2 vext2 LHS, <1,u,1,3>
- 1529716838U, // <u,3,2,0>: Cost 2 vext1 <u,u,3,2>, LHS
- 1164167966U, // <u,3,2,1>: Cost 2 vrev <3,u,1,2>
- 1544783464U, // <u,3,2,2>: Cost 2 vext2 LHS, <2,2,2,2>
- 1544783526U, // <u,3,2,3>: Cost 2 vext2 LHS, <2,3,0,1>
- 1529720118U, // <u,3,2,4>: Cost 2 vext1 <u,u,3,2>, RHS
- 2618525544U, // <u,3,2,5>: Cost 3 vext2 LHS, <2,5,3,6>
- 1544783802U, // <u,3,2,6>: Cost 2 vext2 LHS, <2,6,3,7>
- 2704181620U, // <u,3,2,7>: Cost 3 vext3 <3,2,7,u>, <3,2,7,u>
- 1544783931U, // <u,3,2,u>: Cost 2 vext2 LHS, <2,u,0,1>
- 1544784022U, // <u,3,3,0>: Cost 2 vext2 LHS, <3,0,1,2>
- 1487922559U, // <u,3,3,1>: Cost 2 vext1 <1,u,3,3>, <1,u,3,3>
- 1493895256U, // <u,3,3,2>: Cost 2 vext1 <2,u,3,3>, <2,u,3,3>
- 336380006U, // <u,3,3,3>: Cost 1 vdup3 LHS
- 1544784386U, // <u,3,3,4>: Cost 2 vext2 LHS, <3,4,5,6>
- 2824054478U, // <u,3,3,5>: Cost 3 vuzpr LHS, <2,3,4,5>
- 2238286668U, // <u,3,3,6>: Cost 3 vrev <3,u,6,3>
- 2954069136U, // <u,3,3,7>: Cost 3 vzipr LHS, <1,5,3,7>
- 336380006U, // <u,3,3,u>: Cost 1 vdup3 LHS
- 1487929446U, // <u,3,4,0>: Cost 2 vext1 <1,u,3,4>, LHS
- 1487930752U, // <u,3,4,1>: Cost 2 vext1 <1,u,3,4>, <1,u,3,4>
- 2623171644U, // <u,3,4,2>: Cost 3 vext2 LHS, <4,2,6,0>
- 2561673366U, // <u,3,4,3>: Cost 3 vext1 <1,u,3,4>, <3,0,1,2>
- 1487932726U, // <u,3,4,4>: Cost 2 vext1 <1,u,3,4>, RHS
- 471043382U, // <u,3,4,5>: Cost 1 vext2 LHS, RHS
- 1592561012U, // <u,3,4,6>: Cost 2 vext2 LHS, <4,6,4,6>
- 2238368598U, // <u,3,4,7>: Cost 3 vrev <3,u,7,4>
- 471043625U, // <u,3,4,u>: Cost 1 vext2 LHS, RHS
- 2555707494U, // <u,3,5,0>: Cost 3 vext1 <0,u,3,5>, LHS
- 1574645465U, // <u,3,5,1>: Cost 2 vext2 <5,1,u,3>, <5,1,u,3>
- 2567653106U, // <u,3,5,2>: Cost 3 vext1 <2,u,3,5>, <2,3,u,5>
- 2555709954U, // <u,3,5,3>: Cost 3 vext1 <0,u,3,5>, <3,4,5,6>
- 1592561606U, // <u,3,5,4>: Cost 2 vext2 LHS, <5,4,7,6>
- 1592561668U, // <u,3,5,5>: Cost 2 vext2 LHS, <5,5,5,5>
- 1592561762U, // <u,3,5,6>: Cost 2 vext2 LHS, <5,6,7,0>
- 1750314294U, // <u,3,5,7>: Cost 2 vuzpr LHS, RHS
- 1750314295U, // <u,3,5,u>: Cost 2 vuzpr LHS, RHS
- 2623172897U, // <u,3,6,0>: Cost 3 vext2 LHS, <6,0,1,2>
- 2561688962U, // <u,3,6,1>: Cost 3 vext1 <1,u,3,6>, <1,u,3,6>
- 1581281795U, // <u,3,6,2>: Cost 2 vext2 <6,2,u,3>, <6,2,u,3>
- 2706541204U, // <u,3,6,3>: Cost 3 vext3 <3,6,3,u>, <3,6,3,u>
- 2623173261U, // <u,3,6,4>: Cost 3 vext2 LHS, <6,4,5,6>
- 1164495686U, // <u,3,6,5>: Cost 2 vrev <3,u,5,6>
- 1592562488U, // <u,3,6,6>: Cost 2 vext2 LHS, <6,6,6,6>
- 1592562510U, // <u,3,6,7>: Cost 2 vext2 LHS, <6,7,0,1>
- 1164716897U, // <u,3,6,u>: Cost 2 vrev <3,u,u,6>
- 1487954022U, // <u,3,7,0>: Cost 2 vext1 <1,u,3,7>, LHS
- 1487955331U, // <u,3,7,1>: Cost 2 vext1 <1,u,3,7>, <1,u,3,7>
- 1493928028U, // <u,3,7,2>: Cost 2 vext1 <2,u,3,7>, <2,u,3,7>
- 2561697942U, // <u,3,7,3>: Cost 3 vext1 <1,u,3,7>, <3,0,1,2>
- 1487957302U, // <u,3,7,4>: Cost 2 vext1 <1,u,3,7>, RHS
- 2707352311U, // <u,3,7,5>: Cost 3 vext3 <3,7,5,u>, <3,7,5,u>
- 2655024623U, // <u,3,7,6>: Cost 3 vext2 <6,2,u,3>, <7,6,2,u>
- 1592563308U, // <u,3,7,7>: Cost 2 vext2 LHS, <7,7,7,7>
- 1487959854U, // <u,3,7,u>: Cost 2 vext1 <1,u,3,7>, LHS
- 1544787667U, // <u,3,u,0>: Cost 2 vext2 LHS, <u,0,1,2>
- 471045934U, // <u,3,u,1>: Cost 1 vext2 LHS, LHS
- 1549432709U, // <u,3,u,2>: Cost 2 vext2 LHS, <u,2,3,0>
- 336380006U, // <u,3,u,3>: Cost 1 vdup3 LHS
- 1544788031U, // <u,3,u,4>: Cost 2 vext2 LHS, <u,4,5,6>
- 471046298U, // <u,3,u,5>: Cost 1 vext2 LHS, RHS
- 1549433040U, // <u,3,u,6>: Cost 2 vext2 LHS, <u,6,3,7>
- 1750314537U, // <u,3,u,7>: Cost 2 vuzpr LHS, RHS
- 471046501U, // <u,3,u,u>: Cost 1 vext2 LHS, LHS
- 2625167360U, // <u,4,0,0>: Cost 3 vext2 <1,2,u,4>, <0,0,0,0>
- 1551425638U, // <u,4,0,1>: Cost 2 vext2 <1,2,u,4>, LHS
- 2619195630U, // <u,4,0,2>: Cost 3 vext2 <0,2,u,4>, <0,2,u,4>
- 2619343104U, // <u,4,0,3>: Cost 3 vext2 <0,3,1,4>, <0,3,1,4>
- 2625167698U, // <u,4,0,4>: Cost 3 vext2 <1,2,u,4>, <0,4,1,5>
- 1638329234U, // <u,4,0,5>: Cost 2 vext3 RHS, <4,0,5,1>
- 1638329244U, // <u,4,0,6>: Cost 2 vext3 RHS, <4,0,6,2>
- 3787803556U, // <u,4,0,7>: Cost 4 vext3 RHS, <4,0,7,1>
- 1551426205U, // <u,4,0,u>: Cost 2 vext2 <1,2,u,4>, LHS
- 2555748454U, // <u,4,1,0>: Cost 3 vext1 <0,u,4,1>, LHS
- 2625168180U, // <u,4,1,1>: Cost 3 vext2 <1,2,u,4>, <1,1,1,1>
- 1551426503U, // <u,4,1,2>: Cost 2 vext2 <1,2,u,4>, <1,2,u,4>
- 2625168344U, // <u,4,1,3>: Cost 3 vext2 <1,2,u,4>, <1,3,1,3>
- 2555751734U, // <u,4,1,4>: Cost 3 vext1 <0,u,4,1>, RHS
- 1860554038U, // <u,4,1,5>: Cost 2 vzipl LHS, RHS
- 2689879022U, // <u,4,1,6>: Cost 3 vext3 LHS, <4,1,6,3>
- 2592248852U, // <u,4,1,7>: Cost 3 vext1 <7,0,4,1>, <7,0,4,1>
- 1555408301U, // <u,4,1,u>: Cost 2 vext2 <1,u,u,4>, <1,u,u,4>
- 2555756646U, // <u,4,2,0>: Cost 3 vext1 <0,u,4,2>, LHS
- 2625168943U, // <u,4,2,1>: Cost 3 vext2 <1,2,u,4>, <2,1,4,u>
- 2625169000U, // <u,4,2,2>: Cost 3 vext2 <1,2,u,4>, <2,2,2,2>
- 2619197134U, // <u,4,2,3>: Cost 3 vext2 <0,2,u,4>, <2,3,4,5>
- 2555759926U, // <u,4,2,4>: Cost 3 vext1 <0,u,4,2>, RHS
- 2712071222U, // <u,4,2,5>: Cost 3 vext3 RHS, <4,2,5,3>
- 1994771766U, // <u,4,2,6>: Cost 2 vtrnl LHS, RHS
- 2592257045U, // <u,4,2,7>: Cost 3 vext1 <7,0,4,2>, <7,0,4,2>
- 1994771784U, // <u,4,2,u>: Cost 2 vtrnl LHS, RHS
- 2625169558U, // <u,4,3,0>: Cost 3 vext2 <1,2,u,4>, <3,0,1,2>
- 2567709594U, // <u,4,3,1>: Cost 3 vext1 <2,u,4,3>, <1,2,3,4>
- 2567710817U, // <u,4,3,2>: Cost 3 vext1 <2,u,4,3>, <2,u,4,3>
- 2625169820U, // <u,4,3,3>: Cost 3 vext2 <1,2,u,4>, <3,3,3,3>
- 2625169922U, // <u,4,3,4>: Cost 3 vext2 <1,2,u,4>, <3,4,5,6>
- 2954069710U, // <u,4,3,5>: Cost 3 vzipr LHS, <2,3,4,5>
- 2954068172U, // <u,4,3,6>: Cost 3 vzipr LHS, <0,2,4,6>
- 3903849472U, // <u,4,3,7>: Cost 4 vuzpr <1,u,3,4>, <1,3,5,7>
- 2954068174U, // <u,4,3,u>: Cost 3 vzipr LHS, <0,2,4,u>
- 1505919078U, // <u,4,4,0>: Cost 2 vext1 <4,u,4,4>, LHS
- 2567717831U, // <u,4,4,1>: Cost 3 vext1 <2,u,4,4>, <1,2,u,4>
- 2567719010U, // <u,4,4,2>: Cost 3 vext1 <2,u,4,4>, <2,u,4,4>
- 2570373542U, // <u,4,4,3>: Cost 3 vext1 <3,3,4,4>, <3,3,4,4>
- 161926454U, // <u,4,4,4>: Cost 1 vdup0 RHS
- 1551428918U, // <u,4,4,5>: Cost 2 vext2 <1,2,u,4>, RHS
- 1638329572U, // <u,4,4,6>: Cost 2 vext3 RHS, <4,4,6,6>
- 2594927963U, // <u,4,4,7>: Cost 3 vext1 <7,4,4,4>, <7,4,4,4>
- 161926454U, // <u,4,4,u>: Cost 1 vdup0 RHS
- 1493983334U, // <u,4,5,0>: Cost 2 vext1 <2,u,4,5>, LHS
- 2689879301U, // <u,4,5,1>: Cost 3 vext3 LHS, <4,5,1,3>
- 1493985379U, // <u,4,5,2>: Cost 2 vext1 <2,u,4,5>, <2,u,4,5>
- 2567727254U, // <u,4,5,3>: Cost 3 vext1 <2,u,4,5>, <3,0,1,2>
- 1493986614U, // <u,4,5,4>: Cost 2 vext1 <2,u,4,5>, RHS
- 1863535926U, // <u,4,5,5>: Cost 2 vzipl RHS, RHS
- 537750838U, // <u,4,5,6>: Cost 1 vext3 LHS, RHS
- 2830110006U, // <u,4,5,7>: Cost 3 vuzpr <1,u,3,4>, RHS
- 537750856U, // <u,4,5,u>: Cost 1 vext3 LHS, RHS
- 1482047590U, // <u,4,6,0>: Cost 2 vext1 <0,u,4,6>, LHS
- 2555790070U, // <u,4,6,1>: Cost 3 vext1 <0,u,4,6>, <1,0,3,2>
- 2555790952U, // <u,4,6,2>: Cost 3 vext1 <0,u,4,6>, <2,2,2,2>
- 2555791510U, // <u,4,6,3>: Cost 3 vext1 <0,u,4,6>, <3,0,1,2>
- 1482050870U, // <u,4,6,4>: Cost 2 vext1 <0,u,4,6>, RHS
- 2689879422U, // <u,4,6,5>: Cost 3 vext3 LHS, <4,6,5,7>
- 1997753654U, // <u,4,6,6>: Cost 2 vtrnl RHS, RHS
- 2712071562U, // <u,4,6,7>: Cost 3 vext3 RHS, <4,6,7,1>
- 1482053422U, // <u,4,6,u>: Cost 2 vext1 <0,u,4,6>, LHS
- 2567741542U, // <u,4,7,0>: Cost 3 vext1 <2,u,4,7>, LHS
- 2567742362U, // <u,4,7,1>: Cost 3 vext1 <2,u,4,7>, <1,2,3,4>
- 2567743589U, // <u,4,7,2>: Cost 3 vext1 <2,u,4,7>, <2,u,4,7>
- 2573716286U, // <u,4,7,3>: Cost 3 vext1 <3,u,4,7>, <3,u,4,7>
- 2567744822U, // <u,4,7,4>: Cost 3 vext1 <2,u,4,7>, RHS
- 2712071624U, // <u,4,7,5>: Cost 3 vext3 RHS, <4,7,5,0>
- 96808489U, // <u,4,7,6>: Cost 1 vrev RHS
- 2651715180U, // <u,4,7,7>: Cost 3 vext2 <5,6,u,4>, <7,7,7,7>
- 96955963U, // <u,4,7,u>: Cost 1 vrev RHS
- 1482063974U, // <u,4,u,0>: Cost 2 vext1 <0,u,4,u>, LHS
- 1551431470U, // <u,4,u,1>: Cost 2 vext2 <1,2,u,4>, LHS
- 1494009958U, // <u,4,u,2>: Cost 2 vext1 <2,u,4,u>, <2,u,4,u>
- 2555807894U, // <u,4,u,3>: Cost 3 vext1 <0,u,4,u>, <3,0,1,2>
- 161926454U, // <u,4,u,4>: Cost 1 vdup0 RHS
- 1551431834U, // <u,4,u,5>: Cost 2 vext2 <1,2,u,4>, RHS
- 537751081U, // <u,4,u,6>: Cost 1 vext3 LHS, RHS
- 2830110249U, // <u,4,u,7>: Cost 3 vuzpr <1,u,3,4>, RHS
- 537751099U, // <u,4,u,u>: Cost 1 vext3 LHS, RHS
- 2631811072U, // <u,5,0,0>: Cost 3 vext2 <2,3,u,5>, <0,0,0,0>
- 1558069350U, // <u,5,0,1>: Cost 2 vext2 <2,3,u,5>, LHS
- 2619203823U, // <u,5,0,2>: Cost 3 vext2 <0,2,u,5>, <0,2,u,5>
- 2619867456U, // <u,5,0,3>: Cost 3 vext2 <0,3,u,5>, <0,3,u,5>
- 1546273106U, // <u,5,0,4>: Cost 2 vext2 <0,4,1,5>, <0,4,1,5>
- 2733010539U, // <u,5,0,5>: Cost 3 vext3 LHS, <5,0,5,1>
- 2597622682U, // <u,5,0,6>: Cost 3 vext1 <7,u,5,0>, <6,7,u,5>
- 1176539396U, // <u,5,0,7>: Cost 2 vrev <5,u,7,0>
- 1558069917U, // <u,5,0,u>: Cost 2 vext2 <2,3,u,5>, LHS
- 1505968230U, // <u,5,1,0>: Cost 2 vext1 <4,u,5,1>, LHS
- 2624512887U, // <u,5,1,1>: Cost 3 vext2 <1,1,u,5>, <1,1,u,5>
- 2631811990U, // <u,5,1,2>: Cost 3 vext2 <2,3,u,5>, <1,2,3,0>
- 2618541056U, // <u,5,1,3>: Cost 3 vext2 <0,1,u,5>, <1,3,5,7>
- 1505971510U, // <u,5,1,4>: Cost 2 vext1 <4,u,5,1>, RHS
- 2627167419U, // <u,5,1,5>: Cost 3 vext2 <1,5,u,5>, <1,5,u,5>
- 2579714554U, // <u,5,1,6>: Cost 3 vext1 <4,u,5,1>, <6,2,7,3>
- 1638330064U, // <u,5,1,7>: Cost 2 vext3 RHS, <5,1,7,3>
- 1638477529U, // <u,5,1,u>: Cost 2 vext3 RHS, <5,1,u,3>
- 2561802342U, // <u,5,2,0>: Cost 3 vext1 <1,u,5,2>, LHS
- 2561803264U, // <u,5,2,1>: Cost 3 vext1 <1,u,5,2>, <1,3,5,7>
- 2631149217U, // <u,5,2,2>: Cost 3 vext2 <2,2,u,5>, <2,2,u,5>
- 1558071026U, // <u,5,2,3>: Cost 2 vext2 <2,3,u,5>, <2,3,u,5>
- 2561805622U, // <u,5,2,4>: Cost 3 vext1 <1,u,5,2>, RHS
- 2714062607U, // <u,5,2,5>: Cost 3 vext3 RHS, <5,2,5,3>
- 2631813050U, // <u,5,2,6>: Cost 3 vext2 <2,3,u,5>, <2,6,3,7>
- 3092335926U, // <u,5,2,7>: Cost 3 vtrnr <0,u,0,2>, RHS
- 1561389191U, // <u,5,2,u>: Cost 2 vext2 <2,u,u,5>, <2,u,u,5>
- 2561810534U, // <u,5,3,0>: Cost 3 vext1 <1,u,5,3>, LHS
- 2561811857U, // <u,5,3,1>: Cost 3 vext1 <1,u,5,3>, <1,u,5,3>
- 2631813474U, // <u,5,3,2>: Cost 3 vext2 <2,3,u,5>, <3,2,5,u>
- 2631813532U, // <u,5,3,3>: Cost 3 vext2 <2,3,u,5>, <3,3,3,3>
- 2619869698U, // <u,5,3,4>: Cost 3 vext2 <0,3,u,5>, <3,4,5,6>
- 3001847002U, // <u,5,3,5>: Cost 3 vzipr LHS, <4,4,5,5>
- 2954070530U, // <u,5,3,6>: Cost 3 vzipr LHS, <3,4,5,6>
- 2018749750U, // <u,5,3,7>: Cost 2 vtrnr LHS, RHS
- 2018749751U, // <u,5,3,u>: Cost 2 vtrnr LHS, RHS
- 2573762662U, // <u,5,4,0>: Cost 3 vext1 <3,u,5,4>, LHS
- 2620017634U, // <u,5,4,1>: Cost 3 vext2 <0,4,1,5>, <4,1,5,0>
- 2573764338U, // <u,5,4,2>: Cost 3 vext1 <3,u,5,4>, <2,3,u,5>
- 2573765444U, // <u,5,4,3>: Cost 3 vext1 <3,u,5,4>, <3,u,5,4>
- 1570680053U, // <u,5,4,4>: Cost 2 vext2 <4,4,u,5>, <4,4,u,5>
- 1558072630U, // <u,5,4,5>: Cost 2 vext2 <2,3,u,5>, RHS
- 2645749143U, // <u,5,4,6>: Cost 3 vext2 <4,6,u,5>, <4,6,u,5>
- 1638330310U, // <u,5,4,7>: Cost 2 vext3 RHS, <5,4,7,6>
- 1558072873U, // <u,5,4,u>: Cost 2 vext2 <2,3,u,5>, RHS
- 1506000998U, // <u,5,5,0>: Cost 2 vext1 <4,u,5,5>, LHS
- 2561827984U, // <u,5,5,1>: Cost 3 vext1 <1,u,5,5>, <1,5,3,7>
- 2579744360U, // <u,5,5,2>: Cost 3 vext1 <4,u,5,5>, <2,2,2,2>
- 2579744918U, // <u,5,5,3>: Cost 3 vext1 <4,u,5,5>, <3,0,1,2>
- 1506004278U, // <u,5,5,4>: Cost 2 vext1 <4,u,5,5>, RHS
- 229035318U, // <u,5,5,5>: Cost 1 vdup1 RHS
- 2712072206U, // <u,5,5,6>: Cost 3 vext3 RHS, <5,5,6,6>
- 1638330392U, // <u,5,5,7>: Cost 2 vext3 RHS, <5,5,7,7>
- 229035318U, // <u,5,5,u>: Cost 1 vdup1 RHS
- 1500037222U, // <u,5,6,0>: Cost 2 vext1 <3,u,5,6>, LHS
- 2561836436U, // <u,5,6,1>: Cost 3 vext1 <1,u,5,6>, <1,u,5,6>
- 2567809133U, // <u,5,6,2>: Cost 3 vext1 <2,u,5,6>, <2,u,5,6>
- 1500040006U, // <u,5,6,3>: Cost 2 vext1 <3,u,5,6>, <3,u,5,6>
- 1500040502U, // <u,5,6,4>: Cost 2 vext1 <3,u,5,6>, RHS
- 2714062935U, // <u,5,6,5>: Cost 3 vext3 RHS, <5,6,5,7>
- 2712072288U, // <u,5,6,6>: Cost 3 vext3 RHS, <5,6,6,7>
- 27705344U, // <u,5,6,7>: Cost 0 copy RHS
- 27705344U, // <u,5,6,u>: Cost 0 copy RHS
- 1488101478U, // <u,5,7,0>: Cost 2 vext1 <1,u,5,7>, LHS
- 1488102805U, // <u,5,7,1>: Cost 2 vext1 <1,u,5,7>, <1,u,5,7>
- 2561844840U, // <u,5,7,2>: Cost 3 vext1 <1,u,5,7>, <2,2,2,2>
- 2561845398U, // <u,5,7,3>: Cost 3 vext1 <1,u,5,7>, <3,0,1,2>
- 1488104758U, // <u,5,7,4>: Cost 2 vext1 <1,u,5,7>, RHS
- 1638330536U, // <u,5,7,5>: Cost 2 vext3 RHS, <5,7,5,7>
- 2712072362U, // <u,5,7,6>: Cost 3 vext3 RHS, <5,7,6,0>
- 2042965302U, // <u,5,7,7>: Cost 2 vtrnr RHS, RHS
- 1488107310U, // <u,5,7,u>: Cost 2 vext1 <1,u,5,7>, LHS
- 1488109670U, // <u,5,u,0>: Cost 2 vext1 <1,u,5,u>, LHS
- 1488110998U, // <u,5,u,1>: Cost 2 vext1 <1,u,5,u>, <1,u,5,u>
- 2561853032U, // <u,5,u,2>: Cost 3 vext1 <1,u,5,u>, <2,2,2,2>
- 1500056392U, // <u,5,u,3>: Cost 2 vext1 <3,u,5,u>, <3,u,5,u>
- 1488112950U, // <u,5,u,4>: Cost 2 vext1 <1,u,5,u>, RHS
- 229035318U, // <u,5,u,5>: Cost 1 vdup1 RHS
- 2954111490U, // <u,5,u,6>: Cost 3 vzipr LHS, <3,4,5,6>
- 27705344U, // <u,5,u,7>: Cost 0 copy RHS
- 27705344U, // <u,5,u,u>: Cost 0 copy RHS
- 2619211776U, // <u,6,0,0>: Cost 3 vext2 <0,2,u,6>, <0,0,0,0>
- 1545470054U, // <u,6,0,1>: Cost 2 vext2 <0,2,u,6>, LHS
- 1545470192U, // <u,6,0,2>: Cost 2 vext2 <0,2,u,6>, <0,2,u,6>
- 2255958969U, // <u,6,0,3>: Cost 3 vrev <6,u,3,0>
- 1546797458U, // <u,6,0,4>: Cost 2 vext2 <0,4,u,6>, <0,4,u,6>
- 2720624971U, // <u,6,0,5>: Cost 3 vext3 <6,0,5,u>, <6,0,5,u>
- 2256180180U, // <u,6,0,6>: Cost 3 vrev <6,u,6,0>
- 2960682294U, // <u,6,0,7>: Cost 3 vzipr <1,2,u,0>, RHS
- 1545470621U, // <u,6,0,u>: Cost 2 vext2 <0,2,u,6>, LHS
- 1182004127U, // <u,6,1,0>: Cost 2 vrev <6,u,0,1>
- 2619212596U, // <u,6,1,1>: Cost 3 vext2 <0,2,u,6>, <1,1,1,1>
- 2619212694U, // <u,6,1,2>: Cost 3 vext2 <0,2,u,6>, <1,2,3,0>
- 2619212760U, // <u,6,1,3>: Cost 3 vext2 <0,2,u,6>, <1,3,1,3>
- 2626511979U, // <u,6,1,4>: Cost 3 vext2 <1,4,u,6>, <1,4,u,6>
- 2619212944U, // <u,6,1,5>: Cost 3 vext2 <0,2,u,6>, <1,5,3,7>
- 2714063264U, // <u,6,1,6>: Cost 3 vext3 RHS, <6,1,6,3>
- 2967326006U, // <u,6,1,7>: Cost 3 vzipr <2,3,u,1>, RHS
- 1182594023U, // <u,6,1,u>: Cost 2 vrev <6,u,u,1>
- 1506050150U, // <u,6,2,0>: Cost 2 vext1 <4,u,6,2>, LHS
- 2579792630U, // <u,6,2,1>: Cost 3 vext1 <4,u,6,2>, <1,0,3,2>
- 2619213416U, // <u,6,2,2>: Cost 3 vext2 <0,2,u,6>, <2,2,2,2>
- 2619213478U, // <u,6,2,3>: Cost 3 vext2 <0,2,u,6>, <2,3,0,1>
- 1506053430U, // <u,6,2,4>: Cost 2 vext1 <4,u,6,2>, RHS
- 2633148309U, // <u,6,2,5>: Cost 3 vext2 <2,5,u,6>, <2,5,u,6>
- 2619213754U, // <u,6,2,6>: Cost 3 vext2 <0,2,u,6>, <2,6,3,7>
- 1638330874U, // <u,6,2,7>: Cost 2 vext3 RHS, <6,2,7,3>
- 1638478339U, // <u,6,2,u>: Cost 2 vext3 RHS, <6,2,u,3>
- 2619213974U, // <u,6,3,0>: Cost 3 vext2 <0,2,u,6>, <3,0,1,2>
- 2255836074U, // <u,6,3,1>: Cost 3 vrev <6,u,1,3>
- 2255909811U, // <u,6,3,2>: Cost 3 vrev <6,u,2,3>
- 2619214236U, // <u,6,3,3>: Cost 3 vext2 <0,2,u,6>, <3,3,3,3>
- 1564715549U, // <u,6,3,4>: Cost 2 vext2 <3,4,u,6>, <3,4,u,6>
- 2639121006U, // <u,6,3,5>: Cost 3 vext2 <3,5,u,6>, <3,5,u,6>
- 3001847012U, // <u,6,3,6>: Cost 3 vzipr LHS, <4,4,6,6>
- 1880329526U, // <u,6,3,7>: Cost 2 vzipr LHS, RHS
- 1880329527U, // <u,6,3,u>: Cost 2 vzipr LHS, RHS
- 2567864422U, // <u,6,4,0>: Cost 3 vext1 <2,u,6,4>, LHS
- 2733011558U, // <u,6,4,1>: Cost 3 vext3 LHS, <6,4,1,3>
- 2567866484U, // <u,6,4,2>: Cost 3 vext1 <2,u,6,4>, <2,u,6,4>
- 2638458005U, // <u,6,4,3>: Cost 3 vext2 <3,4,u,6>, <4,3,6,u>
- 1570540772U, // <u,6,4,4>: Cost 2 vext2 <4,4,6,6>, <4,4,6,6>
- 1545473334U, // <u,6,4,5>: Cost 2 vext2 <0,2,u,6>, RHS
- 1572015512U, // <u,6,4,6>: Cost 2 vext2 <4,6,u,6>, <4,6,u,6>
- 2960715062U, // <u,6,4,7>: Cost 3 vzipr <1,2,u,4>, RHS
- 1545473577U, // <u,6,4,u>: Cost 2 vext2 <0,2,u,6>, RHS
- 2567872614U, // <u,6,5,0>: Cost 3 vext1 <2,u,6,5>, LHS
- 2645757648U, // <u,6,5,1>: Cost 3 vext2 <4,6,u,6>, <5,1,7,3>
- 2567874490U, // <u,6,5,2>: Cost 3 vext1 <2,u,6,5>, <2,6,3,7>
- 2576501250U, // <u,6,5,3>: Cost 3 vext1 <4,3,6,5>, <3,4,5,6>
- 1576660943U, // <u,6,5,4>: Cost 2 vext2 <5,4,u,6>, <5,4,u,6>
- 2645757956U, // <u,6,5,5>: Cost 3 vext2 <4,6,u,6>, <5,5,5,5>
- 2645758050U, // <u,6,5,6>: Cost 3 vext2 <4,6,u,6>, <5,6,7,0>
- 2824080694U, // <u,6,5,7>: Cost 3 vuzpr <0,u,2,6>, RHS
- 1182626795U, // <u,6,5,u>: Cost 2 vrev <6,u,u,5>
- 1506082918U, // <u,6,6,0>: Cost 2 vext1 <4,u,6,6>, LHS
- 2579825398U, // <u,6,6,1>: Cost 3 vext1 <4,u,6,6>, <1,0,3,2>
- 2645758458U, // <u,6,6,2>: Cost 3 vext2 <4,6,u,6>, <6,2,7,3>
- 2579826838U, // <u,6,6,3>: Cost 3 vext1 <4,u,6,6>, <3,0,1,2>
- 1506086198U, // <u,6,6,4>: Cost 2 vext1 <4,u,6,6>, RHS
- 2579828432U, // <u,6,6,5>: Cost 3 vext1 <4,u,6,6>, <5,1,7,3>
- 296144182U, // <u,6,6,6>: Cost 1 vdup2 RHS
- 1638331202U, // <u,6,6,7>: Cost 2 vext3 RHS, <6,6,7,7>
- 296144182U, // <u,6,6,u>: Cost 1 vdup2 RHS
- 432349286U, // <u,6,7,0>: Cost 1 vext1 RHS, LHS
- 1506091766U, // <u,6,7,1>: Cost 2 vext1 RHS, <1,0,3,2>
- 1506092648U, // <u,6,7,2>: Cost 2 vext1 RHS, <2,2,2,2>
- 1506093206U, // <u,6,7,3>: Cost 2 vext1 RHS, <3,0,1,2>
- 432352809U, // <u,6,7,4>: Cost 1 vext1 RHS, RHS
- 1506094800U, // <u,6,7,5>: Cost 2 vext1 RHS, <5,1,7,3>
- 1506095610U, // <u,6,7,6>: Cost 2 vext1 RHS, <6,2,7,3>
- 1906904374U, // <u,6,7,7>: Cost 2 vzipr RHS, RHS
- 432355118U, // <u,6,7,u>: Cost 1 vext1 RHS, LHS
- 432357478U, // <u,6,u,0>: Cost 1 vext1 RHS, LHS
- 1545475886U, // <u,6,u,1>: Cost 2 vext2 <0,2,u,6>, LHS
- 1506100840U, // <u,6,u,2>: Cost 2 vext1 RHS, <2,2,2,2>
- 1506101398U, // <u,6,u,3>: Cost 2 vext1 RHS, <3,0,1,2>
- 432361002U, // <u,6,u,4>: Cost 1 vext1 RHS, RHS
- 1545476250U, // <u,6,u,5>: Cost 2 vext2 <0,2,u,6>, RHS
- 296144182U, // <u,6,u,6>: Cost 1 vdup2 RHS
- 1880370486U, // <u,6,u,7>: Cost 2 vzipr LHS, RHS
- 432363310U, // <u,6,u,u>: Cost 1 vext1 RHS, LHS
- 1571356672U, // <u,7,0,0>: Cost 2 vext2 RHS, <0,0,0,0>
- 497614950U, // <u,7,0,1>: Cost 1 vext2 RHS, LHS
- 1571356836U, // <u,7,0,2>: Cost 2 vext2 RHS, <0,2,0,2>
- 2573880146U, // <u,7,0,3>: Cost 3 vext1 <3,u,7,0>, <3,u,7,0>
- 1571357010U, // <u,7,0,4>: Cost 2 vext2 RHS, <0,4,1,5>
- 1512083716U, // <u,7,0,5>: Cost 2 vext1 <5,u,7,0>, <5,u,7,0>
- 2621874741U, // <u,7,0,6>: Cost 3 vext2 <0,6,u,7>, <0,6,u,7>
- 2585826298U, // <u,7,0,7>: Cost 3 vext1 <5,u,7,0>, <7,0,1,2>
- 497615517U, // <u,7,0,u>: Cost 1 vext2 RHS, LHS
- 1571357430U, // <u,7,1,0>: Cost 2 vext2 RHS, <1,0,3,2>
- 1571357492U, // <u,7,1,1>: Cost 2 vext2 RHS, <1,1,1,1>
- 1571357590U, // <u,7,1,2>: Cost 2 vext2 RHS, <1,2,3,0>
- 1552114715U, // <u,7,1,3>: Cost 2 vext2 <1,3,u,7>, <1,3,u,7>
- 2573888822U, // <u,7,1,4>: Cost 3 vext1 <3,u,7,1>, RHS
- 1553441981U, // <u,7,1,5>: Cost 2 vext2 <1,5,u,7>, <1,5,u,7>
- 2627847438U, // <u,7,1,6>: Cost 3 vext2 <1,6,u,7>, <1,6,u,7>
- 2727408775U, // <u,7,1,7>: Cost 3 vext3 <7,1,7,u>, <7,1,7,u>
- 1555432880U, // <u,7,1,u>: Cost 2 vext2 <1,u,u,7>, <1,u,u,7>
- 2629838337U, // <u,7,2,0>: Cost 3 vext2 <2,0,u,7>, <2,0,u,7>
- 1188058754U, // <u,7,2,1>: Cost 2 vrev <7,u,1,2>
- 1571358312U, // <u,7,2,2>: Cost 2 vext2 RHS, <2,2,2,2>
- 1571358374U, // <u,7,2,3>: Cost 2 vext2 RHS, <2,3,0,1>
- 2632492869U, // <u,7,2,4>: Cost 3 vext2 <2,4,u,7>, <2,4,u,7>
- 2633156502U, // <u,7,2,5>: Cost 3 vext2 <2,5,u,7>, <2,5,u,7>
- 1560078311U, // <u,7,2,6>: Cost 2 vext2 <2,6,u,7>, <2,6,u,7>
- 2728072408U, // <u,7,2,7>: Cost 3 vext3 <7,2,7,u>, <7,2,7,u>
- 1561405577U, // <u,7,2,u>: Cost 2 vext2 <2,u,u,7>, <2,u,u,7>
- 1571358870U, // <u,7,3,0>: Cost 2 vext2 RHS, <3,0,1,2>
- 2627184913U, // <u,7,3,1>: Cost 3 vext2 <1,5,u,7>, <3,1,5,u>
- 2633820523U, // <u,7,3,2>: Cost 3 vext2 <2,6,u,7>, <3,2,6,u>
- 1571359132U, // <u,7,3,3>: Cost 2 vext2 RHS, <3,3,3,3>
- 1571359234U, // <u,7,3,4>: Cost 2 vext2 RHS, <3,4,5,6>
- 1512108295U, // <u,7,3,5>: Cost 2 vext1 <5,u,7,3>, <5,u,7,3>
- 1518080992U, // <u,7,3,6>: Cost 2 vext1 <6,u,7,3>, <6,u,7,3>
- 2640456465U, // <u,7,3,7>: Cost 3 vext2 <3,7,u,7>, <3,7,u,7>
- 1571359518U, // <u,7,3,u>: Cost 2 vext2 RHS, <3,u,1,2>
- 1571359634U, // <u,7,4,0>: Cost 2 vext2 RHS, <4,0,5,1>
- 2573911067U, // <u,7,4,1>: Cost 3 vext1 <3,u,7,4>, <1,3,u,7>
- 2645101622U, // <u,7,4,2>: Cost 3 vext2 RHS, <4,2,5,3>
- 2573912918U, // <u,7,4,3>: Cost 3 vext1 <3,u,7,4>, <3,u,7,4>
- 1571359952U, // <u,7,4,4>: Cost 2 vext2 RHS, <4,4,4,4>
- 497618248U, // <u,7,4,5>: Cost 1 vext2 RHS, RHS
- 1571360116U, // <u,7,4,6>: Cost 2 vext2 RHS, <4,6,4,6>
- 2645102024U, // <u,7,4,7>: Cost 3 vext2 RHS, <4,7,5,0>
- 497618473U, // <u,7,4,u>: Cost 1 vext2 RHS, RHS
- 2645102152U, // <u,7,5,0>: Cost 3 vext2 RHS, <5,0,1,2>
- 1571360464U, // <u,7,5,1>: Cost 2 vext2 RHS, <5,1,7,3>
- 2645102334U, // <u,7,5,2>: Cost 3 vext2 RHS, <5,2,3,4>
- 2645102447U, // <u,7,5,3>: Cost 3 vext2 RHS, <5,3,7,0>
- 1571360710U, // <u,7,5,4>: Cost 2 vext2 RHS, <5,4,7,6>
- 1571360772U, // <u,7,5,5>: Cost 2 vext2 RHS, <5,5,5,5>
- 1571360866U, // <u,7,5,6>: Cost 2 vext2 RHS, <5,6,7,0>
- 1571360936U, // <u,7,5,7>: Cost 2 vext2 RHS, <5,7,5,7>
- 1571361017U, // <u,7,5,u>: Cost 2 vext2 RHS, <5,u,5,7>
- 1530044518U, // <u,7,6,0>: Cost 2 vext1 <u,u,7,6>, LHS
- 2645103016U, // <u,7,6,1>: Cost 3 vext2 RHS, <6,1,7,2>
- 1571361274U, // <u,7,6,2>: Cost 2 vext2 RHS, <6,2,7,3>
- 2645103154U, // <u,7,6,3>: Cost 3 vext2 RHS, <6,3,4,5>
- 1530047798U, // <u,7,6,4>: Cost 2 vext1 <u,u,7,6>, RHS
- 1188386474U, // <u,7,6,5>: Cost 2 vrev <7,u,5,6>
- 1571361592U, // <u,7,6,6>: Cost 2 vext2 RHS, <6,6,6,6>
- 1571361614U, // <u,7,6,7>: Cost 2 vext2 RHS, <6,7,0,1>
- 1571361695U, // <u,7,6,u>: Cost 2 vext2 RHS, <6,u,0,1>
- 1571361786U, // <u,7,7,0>: Cost 2 vext2 RHS, <7,0,1,2>
- 2573935616U, // <u,7,7,1>: Cost 3 vext1 <3,u,7,7>, <1,3,5,7>
- 2645103781U, // <u,7,7,2>: Cost 3 vext2 RHS, <7,2,2,2>
- 2573937497U, // <u,7,7,3>: Cost 3 vext1 <3,u,7,7>, <3,u,7,7>
- 1571362150U, // <u,7,7,4>: Cost 2 vext2 RHS, <7,4,5,6>
- 1512141067U, // <u,7,7,5>: Cost 2 vext1 <5,u,7,7>, <5,u,7,7>
- 1518113764U, // <u,7,7,6>: Cost 2 vext1 <6,u,7,7>, <6,u,7,7>
- 363253046U, // <u,7,7,7>: Cost 1 vdup3 RHS
- 363253046U, // <u,7,7,u>: Cost 1 vdup3 RHS
- 1571362515U, // <u,7,u,0>: Cost 2 vext2 RHS, <u,0,1,2>
- 497620782U, // <u,7,u,1>: Cost 1 vext2 RHS, LHS
- 1571362693U, // <u,7,u,2>: Cost 2 vext2 RHS, <u,2,3,0>
- 1571362748U, // <u,7,u,3>: Cost 2 vext2 RHS, <u,3,0,1>
- 1571362879U, // <u,7,u,4>: Cost 2 vext2 RHS, <u,4,5,6>
- 497621146U, // <u,7,u,5>: Cost 1 vext2 RHS, RHS
- 1571363024U, // <u,7,u,6>: Cost 2 vext2 RHS, <u,6,3,7>
- 363253046U, // <u,7,u,7>: Cost 1 vdup3 RHS
- 497621349U, // <u,7,u,u>: Cost 1 vext2 RHS, LHS
- 135053414U, // <u,u,0,0>: Cost 1 vdup0 LHS
- 471081121U, // <u,u,0,1>: Cost 1 vext2 LHS, LHS
- 1544822948U, // <u,u,0,2>: Cost 2 vext2 LHS, <0,2,0,2>
- 1616140005U, // <u,u,0,3>: Cost 2 vext3 LHS, <u,0,3,2>
- 1544823122U, // <u,u,0,4>: Cost 2 vext2 LHS, <0,4,1,5>
- 1512157453U, // <u,u,0,5>: Cost 2 vext1 <5,u,u,0>, <5,u,u,0>
- 1662220032U, // <u,u,0,6>: Cost 2 vext3 RHS, <u,0,6,2>
- 1194457487U, // <u,u,0,7>: Cost 2 vrev <u,u,7,0>
- 471081629U, // <u,u,0,u>: Cost 1 vext2 LHS, LHS
- 1544823542U, // <u,u,1,0>: Cost 2 vext2 LHS, <1,0,3,2>
- 202162278U, // <u,u,1,1>: Cost 1 vdup1 LHS
- 537753390U, // <u,u,1,2>: Cost 1 vext3 LHS, LHS
- 1544823768U, // <u,u,1,3>: Cost 2 vext2 LHS, <1,3,1,3>
- 1494248758U, // <u,u,1,4>: Cost 2 vext1 <2,u,u,1>, RHS
- 1544823952U, // <u,u,1,5>: Cost 2 vext2 LHS, <1,5,3,7>
- 1518138343U, // <u,u,1,6>: Cost 2 vext1 <6,u,u,1>, <6,u,u,1>
- 1640322907U, // <u,u,1,7>: Cost 2 vext3 RHS, <u,1,7,3>
- 537753444U, // <u,u,1,u>: Cost 1 vext3 LHS, LHS
- 1482309734U, // <u,u,2,0>: Cost 2 vext1 <0,u,u,2>, LHS
- 1194031451U, // <u,u,2,1>: Cost 2 vrev <u,u,1,2>
- 269271142U, // <u,u,2,2>: Cost 1 vdup2 LHS
- 835584U, // <u,u,2,3>: Cost 0 copy LHS
- 1482313014U, // <u,u,2,4>: Cost 2 vext1 <0,u,u,2>, RHS
- 2618566504U, // <u,u,2,5>: Cost 3 vext2 LHS, <2,5,3,6>
- 1544824762U, // <u,u,2,6>: Cost 2 vext2 LHS, <2,6,3,7>
- 1638479788U, // <u,u,2,7>: Cost 2 vext3 RHS, <u,2,7,3>
- 835584U, // <u,u,2,u>: Cost 0 copy LHS
- 408576723U, // <u,u,3,0>: Cost 1 vext1 LHS, LHS
- 1482318582U, // <u,u,3,1>: Cost 2 vext1 LHS, <1,0,3,2>
- 120371557U, // <u,u,3,2>: Cost 1 vrev LHS
- 336380006U, // <u,u,3,3>: Cost 1 vdup3 LHS
- 408579382U, // <u,u,3,4>: Cost 1 vext1 LHS, RHS
- 1616140271U, // <u,u,3,5>: Cost 2 vext3 LHS, <u,3,5,7>
- 1530098170U, // <u,u,3,6>: Cost 2 vext1 LHS, <6,2,7,3>
- 1880329544U, // <u,u,3,7>: Cost 2 vzipr LHS, RHS
- 408581934U, // <u,u,3,u>: Cost 1 vext1 LHS, LHS
- 1488298086U, // <u,u,4,0>: Cost 2 vext1 <1,u,u,4>, LHS
- 1488299437U, // <u,u,4,1>: Cost 2 vext1 <1,u,u,4>, <1,u,u,4>
- 1659271204U, // <u,u,4,2>: Cost 2 vext3 LHS, <u,4,2,6>
- 1194195311U, // <u,u,4,3>: Cost 2 vrev <u,u,3,4>
- 161926454U, // <u,u,4,4>: Cost 1 vdup0 RHS
- 471084342U, // <u,u,4,5>: Cost 1 vext2 LHS, RHS
- 1571368308U, // <u,u,4,6>: Cost 2 vext2 RHS, <4,6,4,6>
- 1640323153U, // <u,u,4,7>: Cost 2 vext3 RHS, <u,4,7,6>
- 471084585U, // <u,u,4,u>: Cost 1 vext2 LHS, RHS
- 1494278246U, // <u,u,5,0>: Cost 2 vext1 <2,u,u,5>, LHS
- 1571368656U, // <u,u,5,1>: Cost 2 vext2 RHS, <5,1,7,3>
- 1494280327U, // <u,u,5,2>: Cost 2 vext1 <2,u,u,5>, <2,u,u,5>
- 1616140415U, // <u,u,5,3>: Cost 2 vext3 LHS, <u,5,3,7>
- 1494281526U, // <u,u,5,4>: Cost 2 vext1 <2,u,u,5>, RHS
- 229035318U, // <u,u,5,5>: Cost 1 vdup1 RHS
- 537753754U, // <u,u,5,6>: Cost 1 vext3 LHS, RHS
- 1750355254U, // <u,u,5,7>: Cost 2 vuzpr LHS, RHS
- 537753772U, // <u,u,5,u>: Cost 1 vext3 LHS, RHS
- 1482342502U, // <u,u,6,0>: Cost 2 vext1 <0,u,u,6>, LHS
- 2556084982U, // <u,u,6,1>: Cost 3 vext1 <0,u,u,6>, <1,0,3,2>
- 1571369466U, // <u,u,6,2>: Cost 2 vext2 RHS, <6,2,7,3>
- 1611938000U, // <u,u,6,3>: Cost 2 vext3 LHS, <u,6,3,7>
- 1482345782U, // <u,u,6,4>: Cost 2 vext1 <0,u,u,6>, RHS
- 1194359171U, // <u,u,6,5>: Cost 2 vrev <u,u,5,6>
- 296144182U, // <u,u,6,6>: Cost 1 vdup2 RHS
- 27705344U, // <u,u,6,7>: Cost 0 copy RHS
- 27705344U, // <u,u,6,u>: Cost 0 copy RHS
- 432496742U, // <u,u,7,0>: Cost 1 vext1 RHS, LHS
- 1488324016U, // <u,u,7,1>: Cost 2 vext1 <1,u,u,7>, <1,u,u,7>
- 1494296713U, // <u,u,7,2>: Cost 2 vext1 <2,u,u,7>, <2,u,u,7>
- 1906901148U, // <u,u,7,3>: Cost 2 vzipr RHS, LHS
- 432500283U, // <u,u,7,4>: Cost 1 vext1 RHS, RHS
- 1506242256U, // <u,u,7,5>: Cost 2 vext1 RHS, <5,1,7,3>
- 120699277U, // <u,u,7,6>: Cost 1 vrev RHS
- 363253046U, // <u,u,7,7>: Cost 1 vdup3 RHS
- 432502574U, // <u,u,7,u>: Cost 1 vext1 RHS, LHS
- 408617688U, // <u,u,u,0>: Cost 1 vext1 LHS, LHS
- 471086894U, // <u,u,u,1>: Cost 1 vext2 LHS, LHS
- 537753957U, // <u,u,u,2>: Cost 1 vext3 LHS, LHS
- 835584U, // <u,u,u,3>: Cost 0 copy LHS
- 408620342U, // <u,u,u,4>: Cost 1 vext1 LHS, RHS
- 471087258U, // <u,u,u,5>: Cost 1 vext2 LHS, RHS
- 537753997U, // <u,u,u,6>: Cost 1 vext3 LHS, RHS
- 27705344U, // <u,u,u,7>: Cost 0 copy RHS
- 835584U, // <u,u,u,u>: Cost 0 copy LHS
+ 135053414U, // <0,0,0,0>: Cost 1 vdup0 LHS
+ 1543503974U, // <0,0,0,1>: Cost 2 vext2 <0,0,0,0>, LHS
+ 2618572962U, // <0,0,0,2>: Cost 3 vext2 <0,2,0,0>, <0,2,0,0>
+ 2568054923U, // <0,0,0,3>: Cost 3 vext1 <3,0,0,0>, <3,0,0,0>
+ 1476398390U, // <0,0,0,4>: Cost 2 vext1 <0,0,0,0>, RHS
+ 2550140624U, // <0,0,0,5>: Cost 3 vext1 <0,0,0,0>, <5,1,7,3>
+ 2550141434U, // <0,0,0,6>: Cost 3 vext1 <0,0,0,0>, <6,2,7,3>
+ 2591945711U, // <0,0,0,7>: Cost 3 vext1 <7,0,0,0>, <7,0,0,0>
+ 135053414U, // <0,0,0,u>: Cost 1 vdup0 LHS
+ 2886516736U, // <0,0,1,0>: Cost 3 vzipl LHS, <0,0,0,0>
+ 1812775014U, // <0,0,1,1>: Cost 2 vzipl LHS, LHS
+ 1618133094U, // <0,0,1,2>: Cost 2 vext3 <1,2,3,0>, LHS
+ 2625209292U, // <0,0,1,3>: Cost 3 vext2 <1,3,0,0>, <1,3,0,0>
+ 2886558034U, // <0,0,1,4>: Cost 3 vzipl LHS, <0,4,1,5>
+ 2617246864U, // <0,0,1,5>: Cost 3 vext2 <0,0,0,0>, <1,5,3,7>
+ 3659723031U, // <0,0,1,6>: Cost 4 vext1 <6,0,0,1>, <6,0,0,1>
+ 2591953904U, // <0,0,1,7>: Cost 3 vext1 <7,0,0,1>, <7,0,0,1>
+ 1812775581U, // <0,0,1,u>: Cost 2 vzipl LHS, LHS
+ 3020734464U, // <0,0,2,0>: Cost 3 vtrnl LHS, <0,0,0,0>
+ 3020734474U, // <0,0,2,1>: Cost 3 vtrnl LHS, <0,0,1,1>
+ 1946992742U, // <0,0,2,2>: Cost 2 vtrnl LHS, LHS
+ 2631181989U, // <0,0,2,3>: Cost 3 vext2 <2,3,0,0>, <2,3,0,0>
+ 3020734668U, // <0,0,2,4>: Cost 3 vtrnl LHS, <0,2,4,6>
+ 3826550569U, // <0,0,2,5>: Cost 4 vuzpl <0,2,0,2>, <2,4,5,6>
+ 2617247674U, // <0,0,2,6>: Cost 3 vext2 <0,0,0,0>, <2,6,3,7>
+ 2591962097U, // <0,0,2,7>: Cost 3 vext1 <7,0,0,2>, <7,0,0,2>
+ 1946992796U, // <0,0,2,u>: Cost 2 vtrnl LHS, LHS
+ 2635163787U, // <0,0,3,0>: Cost 3 vext2 <3,0,0,0>, <3,0,0,0>
+ 2686419196U, // <0,0,3,1>: Cost 3 vext3 <0,3,1,0>, <0,3,1,0>
+ 2686492933U, // <0,0,3,2>: Cost 3 vext3 <0,3,2,0>, <0,3,2,0>
+ 2617248156U, // <0,0,3,3>: Cost 3 vext2 <0,0,0,0>, <3,3,3,3>
+ 2617248258U, // <0,0,3,4>: Cost 3 vext2 <0,0,0,0>, <3,4,5,6>
+ 3826551298U, // <0,0,3,5>: Cost 4 vuzpl <0,2,0,2>, <3,4,5,6>
+ 3690990200U, // <0,0,3,6>: Cost 4 vext2 <0,0,0,0>, <3,6,0,7>
+ 3713551042U, // <0,0,3,7>: Cost 4 vext2 <3,7,0,0>, <3,7,0,0>
+ 2635163787U, // <0,0,3,u>: Cost 3 vext2 <3,0,0,0>, <3,0,0,0>
+ 2617248658U, // <0,0,4,0>: Cost 3 vext2 <0,0,0,0>, <4,0,5,1>
+ 2888450150U, // <0,0,4,1>: Cost 3 vzipl <0,4,1,5>, LHS
+ 3021570150U, // <0,0,4,2>: Cost 3 vtrnl <0,2,4,6>, LHS
+ 3641829519U, // <0,0,4,3>: Cost 4 vext1 <3,0,0,4>, <3,0,0,4>
+ 3021570252U, // <0,0,4,4>: Cost 3 vtrnl <0,2,4,6>, <0,2,4,6>
+ 1543507254U, // <0,0,4,5>: Cost 2 vext2 <0,0,0,0>, RHS
+ 2752810294U, // <0,0,4,6>: Cost 3 vuzpl <0,2,0,2>, RHS
+ 3786998152U, // <0,0,4,7>: Cost 4 vext3 <4,7,5,0>, <0,4,7,5>
+ 1543507497U, // <0,0,4,u>: Cost 2 vext2 <0,0,0,0>, RHS
+ 2684354972U, // <0,0,5,0>: Cost 3 vext3 <0,0,0,0>, <0,5,0,7>
+ 2617249488U, // <0,0,5,1>: Cost 3 vext2 <0,0,0,0>, <5,1,7,3>
+ 3765617070U, // <0,0,5,2>: Cost 4 vext3 <1,2,3,0>, <0,5,2,7>
+ 3635865780U, // <0,0,5,3>: Cost 4 vext1 <2,0,0,5>, <3,0,4,5>
+ 2617249734U, // <0,0,5,4>: Cost 3 vext2 <0,0,0,0>, <5,4,7,6>
+ 2617249796U, // <0,0,5,5>: Cost 3 vext2 <0,0,0,0>, <5,5,5,5>
+ 2718712274U, // <0,0,5,6>: Cost 3 vext3 <5,6,7,0>, <0,5,6,7>
+ 2617249960U, // <0,0,5,7>: Cost 3 vext2 <0,0,0,0>, <5,7,5,7>
+ 2720039396U, // <0,0,5,u>: Cost 3 vext3 <5,u,7,0>, <0,5,u,7>
+ 2684355053U, // <0,0,6,0>: Cost 3 vext3 <0,0,0,0>, <0,6,0,7>
+ 3963609190U, // <0,0,6,1>: Cost 4 vzipl <0,6,2,7>, LHS
+ 2617250298U, // <0,0,6,2>: Cost 3 vext2 <0,0,0,0>, <6,2,7,3>
+ 3796435464U, // <0,0,6,3>: Cost 4 vext3 <6,3,7,0>, <0,6,3,7>
+ 3659762998U, // <0,0,6,4>: Cost 4 vext1 <6,0,0,6>, RHS
+ 3659763810U, // <0,0,6,5>: Cost 4 vext1 <6,0,0,6>, <5,6,7,0>
+ 2617250616U, // <0,0,6,6>: Cost 3 vext2 <0,0,0,0>, <6,6,6,6>
+ 2657727309U, // <0,0,6,7>: Cost 3 vext2 <6,7,0,0>, <6,7,0,0>
+ 2658390942U, // <0,0,6,u>: Cost 3 vext2 <6,u,0,0>, <6,u,0,0>
+ 2659054575U, // <0,0,7,0>: Cost 3 vext2 <7,0,0,0>, <7,0,0,0>
+ 3635880854U, // <0,0,7,1>: Cost 4 vext1 <2,0,0,7>, <1,2,3,0>
+ 3635881401U, // <0,0,7,2>: Cost 4 vext1 <2,0,0,7>, <2,0,0,7>
+ 3734787298U, // <0,0,7,3>: Cost 4 vext2 <7,3,0,0>, <7,3,0,0>
+ 2617251174U, // <0,0,7,4>: Cost 3 vext2 <0,0,0,0>, <7,4,5,6>
+ 3659772002U, // <0,0,7,5>: Cost 4 vext1 <6,0,0,7>, <5,6,7,0>
+ 3659772189U, // <0,0,7,6>: Cost 4 vext1 <6,0,0,7>, <6,0,0,7>
+ 2617251436U, // <0,0,7,7>: Cost 3 vext2 <0,0,0,0>, <7,7,7,7>
+ 2659054575U, // <0,0,7,u>: Cost 3 vext2 <7,0,0,0>, <7,0,0,0>
+ 135053414U, // <0,0,u,0>: Cost 1 vdup0 LHS
+ 1817419878U, // <0,0,u,1>: Cost 2 vzipl LHS, LHS
+ 1947435110U, // <0,0,u,2>: Cost 2 vtrnl LHS, LHS
+ 2568120467U, // <0,0,u,3>: Cost 3 vext1 <3,0,0,u>, <3,0,0,u>
+ 1476463926U, // <0,0,u,4>: Cost 2 vext1 <0,0,0,u>, RHS
+ 1543510170U, // <0,0,u,5>: Cost 2 vext2 <0,0,0,0>, RHS
+ 2752813210U, // <0,0,u,6>: Cost 3 vuzpl <0,2,0,2>, RHS
+ 2592011255U, // <0,0,u,7>: Cost 3 vext1 <7,0,0,u>, <7,0,0,u>
+ 135053414U, // <0,0,u,u>: Cost 1 vdup0 LHS
+ 2618581002U, // <0,1,0,0>: Cost 3 vext2 <0,2,0,1>, <0,0,1,1>
+ 1557446758U, // <0,1,0,1>: Cost 2 vext2 <2,3,0,1>, LHS
+ 2618581155U, // <0,1,0,2>: Cost 3 vext2 <0,2,0,1>, <0,2,0,1>
+ 2690548468U, // <0,1,0,3>: Cost 3 vext3 <1,0,3,0>, <1,0,3,0>
+ 2626543954U, // <0,1,0,4>: Cost 3 vext2 <1,5,0,1>, <0,4,1,5>
+ 4094985216U, // <0,1,0,5>: Cost 4 vtrnl <0,2,0,2>, <1,3,5,7>
+ 2592019278U, // <0,1,0,6>: Cost 3 vext1 <7,0,1,0>, <6,7,0,1>
+ 2592019448U, // <0,1,0,7>: Cost 3 vext1 <7,0,1,0>, <7,0,1,0>
+ 1557447325U, // <0,1,0,u>: Cost 2 vext2 <2,3,0,1>, LHS
+ 1476476938U, // <0,1,1,0>: Cost 2 vext1 <0,0,1,1>, <0,0,1,1>
+ 2886517556U, // <0,1,1,1>: Cost 3 vzipl LHS, <1,1,1,1>
+ 2886517654U, // <0,1,1,2>: Cost 3 vzipl LHS, <1,2,3,0>
+ 2886517720U, // <0,1,1,3>: Cost 3 vzipl LHS, <1,3,1,3>
+ 1476480310U, // <0,1,1,4>: Cost 2 vext1 <0,0,1,1>, RHS
+ 2886558864U, // <0,1,1,5>: Cost 3 vzipl LHS, <1,5,3,7>
+ 2550223354U, // <0,1,1,6>: Cost 3 vext1 <0,0,1,1>, <6,2,7,3>
+ 2550223856U, // <0,1,1,7>: Cost 3 vext1 <0,0,1,1>, <7,0,0,1>
+ 1476482862U, // <0,1,1,u>: Cost 2 vext1 <0,0,1,1>, LHS
+ 1494401126U, // <0,1,2,0>: Cost 2 vext1 <3,0,1,2>, LHS
+ 3020735284U, // <0,1,2,1>: Cost 3 vtrnl LHS, <1,1,1,1>
+ 2562172349U, // <0,1,2,2>: Cost 3 vext1 <2,0,1,2>, <2,0,1,2>
+ 835584U, // <0,1,2,3>: Cost 0 copy LHS
+ 1494404406U, // <0,1,2,4>: Cost 2 vext1 <3,0,1,2>, RHS
+ 3020735488U, // <0,1,2,5>: Cost 3 vtrnl LHS, <1,3,5,7>
+ 2631190458U, // <0,1,2,6>: Cost 3 vext2 <2,3,0,1>, <2,6,3,7>
+ 1518294010U, // <0,1,2,7>: Cost 2 vext1 <7,0,1,2>, <7,0,1,2>
+ 835584U, // <0,1,2,u>: Cost 0 copy LHS
+ 2692318156U, // <0,1,3,0>: Cost 3 vext3 <1,3,0,0>, <1,3,0,0>
+ 2691875800U, // <0,1,3,1>: Cost 3 vext3 <1,2,3,0>, <1,3,1,3>
+ 2691875806U, // <0,1,3,2>: Cost 3 vext3 <1,2,3,0>, <1,3,2,0>
+ 2692539367U, // <0,1,3,3>: Cost 3 vext3 <1,3,3,0>, <1,3,3,0>
+ 2562182454U, // <0,1,3,4>: Cost 3 vext1 <2,0,1,3>, RHS
+ 2691875840U, // <0,1,3,5>: Cost 3 vext3 <1,2,3,0>, <1,3,5,7>
+ 2692760578U, // <0,1,3,6>: Cost 3 vext3 <1,3,6,0>, <1,3,6,0>
+ 2639817411U, // <0,1,3,7>: Cost 3 vext2 <3,7,0,1>, <3,7,0,1>
+ 2691875863U, // <0,1,3,u>: Cost 3 vext3 <1,2,3,0>, <1,3,u,3>
+ 2568159334U, // <0,1,4,0>: Cost 3 vext1 <3,0,1,4>, LHS
+ 4095312692U, // <0,1,4,1>: Cost 4 vtrnl <0,2,4,6>, <1,1,1,1>
+ 2568160934U, // <0,1,4,2>: Cost 3 vext1 <3,0,1,4>, <2,3,0,1>
+ 2568161432U, // <0,1,4,3>: Cost 3 vext1 <3,0,1,4>, <3,0,1,4>
+ 2568162614U, // <0,1,4,4>: Cost 3 vext1 <3,0,1,4>, RHS
+ 1557450038U, // <0,1,4,5>: Cost 2 vext2 <2,3,0,1>, RHS
+ 2754235702U, // <0,1,4,6>: Cost 3 vuzpl <0,4,1,5>, RHS
+ 2592052220U, // <0,1,4,7>: Cost 3 vext1 <7,0,1,4>, <7,0,1,4>
+ 1557450281U, // <0,1,4,u>: Cost 2 vext2 <2,3,0,1>, RHS
+ 3765617775U, // <0,1,5,0>: Cost 4 vext3 <1,2,3,0>, <1,5,0,1>
+ 2647781007U, // <0,1,5,1>: Cost 3 vext2 <5,1,0,1>, <5,1,0,1>
+ 3704934138U, // <0,1,5,2>: Cost 4 vext2 <2,3,0,1>, <5,2,3,0>
+ 2691875984U, // <0,1,5,3>: Cost 3 vext3 <1,2,3,0>, <1,5,3,7>
+ 2657734598U, // <0,1,5,4>: Cost 3 vext2 <6,7,0,1>, <5,4,7,6>
+ 2650435539U, // <0,1,5,5>: Cost 3 vext2 <5,5,0,1>, <5,5,0,1>
+ 2651099172U, // <0,1,5,6>: Cost 3 vext2 <5,6,0,1>, <5,6,0,1>
+ 2651762805U, // <0,1,5,7>: Cost 3 vext2 <5,7,0,1>, <5,7,0,1>
+ 2691876029U, // <0,1,5,u>: Cost 3 vext3 <1,2,3,0>, <1,5,u,7>
+ 2592063590U, // <0,1,6,0>: Cost 3 vext1 <7,0,1,6>, LHS
+ 3765617871U, // <0,1,6,1>: Cost 4 vext3 <1,2,3,0>, <1,6,1,7>
+ 2654417337U, // <0,1,6,2>: Cost 3 vext2 <6,2,0,1>, <6,2,0,1>
+ 3765617889U, // <0,1,6,3>: Cost 4 vext3 <1,2,3,0>, <1,6,3,7>
+ 2592066870U, // <0,1,6,4>: Cost 3 vext1 <7,0,1,6>, RHS
+ 3765617907U, // <0,1,6,5>: Cost 4 vext3 <1,2,3,0>, <1,6,5,7>
+ 2657071869U, // <0,1,6,6>: Cost 3 vext2 <6,6,0,1>, <6,6,0,1>
+ 1583993678U, // <0,1,6,7>: Cost 2 vext2 <6,7,0,1>, <6,7,0,1>
+ 1584657311U, // <0,1,6,u>: Cost 2 vext2 <6,u,0,1>, <6,u,0,1>
+ 2657735672U, // <0,1,7,0>: Cost 3 vext2 <6,7,0,1>, <7,0,1,0>
+ 2657735808U, // <0,1,7,1>: Cost 3 vext2 <6,7,0,1>, <7,1,7,1>
+ 2631193772U, // <0,1,7,2>: Cost 3 vext2 <2,3,0,1>, <7,2,3,0>
+ 2661053667U, // <0,1,7,3>: Cost 3 vext2 <7,3,0,1>, <7,3,0,1>
+ 2657736038U, // <0,1,7,4>: Cost 3 vext2 <6,7,0,1>, <7,4,5,6>
+ 3721524621U, // <0,1,7,5>: Cost 4 vext2 <5,1,0,1>, <7,5,1,0>
+ 2657736158U, // <0,1,7,6>: Cost 3 vext2 <6,7,0,1>, <7,6,1,0>
+ 2657736300U, // <0,1,7,7>: Cost 3 vext2 <6,7,0,1>, <7,7,7,7>
+ 2657736322U, // <0,1,7,u>: Cost 3 vext2 <6,7,0,1>, <7,u,1,2>
+ 1494450278U, // <0,1,u,0>: Cost 2 vext1 <3,0,1,u>, LHS
+ 1557452590U, // <0,1,u,1>: Cost 2 vext2 <2,3,0,1>, LHS
+ 2754238254U, // <0,1,u,2>: Cost 3 vuzpl <0,4,1,5>, LHS
+ 835584U, // <0,1,u,3>: Cost 0 copy LHS
+ 1494453558U, // <0,1,u,4>: Cost 2 vext1 <3,0,1,u>, RHS
+ 1557452954U, // <0,1,u,5>: Cost 2 vext2 <2,3,0,1>, RHS
+ 2754238618U, // <0,1,u,6>: Cost 3 vuzpl <0,4,1,5>, RHS
+ 1518343168U, // <0,1,u,7>: Cost 2 vext1 <7,0,1,u>, <7,0,1,u>
+ 835584U, // <0,1,u,u>: Cost 0 copy LHS
+ 2752299008U, // <0,2,0,0>: Cost 3 vuzpl LHS, <0,0,0,0>
+ 1544847462U, // <0,2,0,1>: Cost 2 vext2 <0,2,0,2>, LHS
+ 1678557286U, // <0,2,0,2>: Cost 2 vuzpl LHS, LHS
+ 2696521165U, // <0,2,0,3>: Cost 3 vext3 <2,0,3,0>, <2,0,3,0>
+ 2752340172U, // <0,2,0,4>: Cost 3 vuzpl LHS, <0,2,4,6>
+ 2691876326U, // <0,2,0,5>: Cost 3 vext3 <1,2,3,0>, <2,0,5,7>
+ 2618589695U, // <0,2,0,6>: Cost 3 vext2 <0,2,0,2>, <0,6,2,7>
+ 2592093185U, // <0,2,0,7>: Cost 3 vext1 <7,0,2,0>, <7,0,2,0>
+ 1678557340U, // <0,2,0,u>: Cost 2 vuzpl LHS, LHS
+ 2618589942U, // <0,2,1,0>: Cost 3 vext2 <0,2,0,2>, <1,0,3,2>
+ 2752299828U, // <0,2,1,1>: Cost 3 vuzpl LHS, <1,1,1,1>
+ 2886518376U, // <0,2,1,2>: Cost 3 vzipl LHS, <2,2,2,2>
+ 2752299766U, // <0,2,1,3>: Cost 3 vuzpl LHS, <1,0,3,2>
+ 2550295862U, // <0,2,1,4>: Cost 3 vext1 <0,0,2,1>, RHS
+ 2752340992U, // <0,2,1,5>: Cost 3 vuzpl LHS, <1,3,5,7>
+ 2886559674U, // <0,2,1,6>: Cost 3 vzipl LHS, <2,6,3,7>
+ 3934208106U, // <0,2,1,7>: Cost 4 vuzpr <7,0,1,2>, <0,1,2,7>
+ 2752340771U, // <0,2,1,u>: Cost 3 vuzpl LHS, <1,0,u,2>
+ 1476558868U, // <0,2,2,0>: Cost 2 vext1 <0,0,2,2>, <0,0,2,2>
+ 2226628029U, // <0,2,2,1>: Cost 3 vrev <2,0,1,2>
+ 2752300648U, // <0,2,2,2>: Cost 3 vuzpl LHS, <2,2,2,2>
+ 3020736114U, // <0,2,2,3>: Cost 3 vtrnl LHS, <2,2,3,3>
+ 1476562230U, // <0,2,2,4>: Cost 2 vext1 <0,0,2,2>, RHS
+ 2550304464U, // <0,2,2,5>: Cost 3 vext1 <0,0,2,2>, <5,1,7,3>
+ 2618591162U, // <0,2,2,6>: Cost 3 vext2 <0,2,0,2>, <2,6,3,7>
+ 2550305777U, // <0,2,2,7>: Cost 3 vext1 <0,0,2,2>, <7,0,0,2>
+ 1476564782U, // <0,2,2,u>: Cost 2 vext1 <0,0,2,2>, LHS
+ 2618591382U, // <0,2,3,0>: Cost 3 vext2 <0,2,0,2>, <3,0,1,2>
+ 2752301206U, // <0,2,3,1>: Cost 3 vuzpl LHS, <3,0,1,2>
+ 3826043121U, // <0,2,3,2>: Cost 4 vuzpl LHS, <3,1,2,3>
+ 2752301468U, // <0,2,3,3>: Cost 3 vuzpl LHS, <3,3,3,3>
+ 2618591746U, // <0,2,3,4>: Cost 3 vext2 <0,2,0,2>, <3,4,5,6>
+ 2752301570U, // <0,2,3,5>: Cost 3 vuzpl LHS, <3,4,5,6>
+ 3830688102U, // <0,2,3,6>: Cost 4 vuzpl LHS, <3,2,6,3>
+ 2698807012U, // <0,2,3,7>: Cost 3 vext3 <2,3,7,0>, <2,3,7,0>
+ 2752301269U, // <0,2,3,u>: Cost 3 vuzpl LHS, <3,0,u,2>
+ 2562261094U, // <0,2,4,0>: Cost 3 vext1 <2,0,2,4>, LHS
+ 4095313828U, // <0,2,4,1>: Cost 4 vtrnl <0,2,4,6>, <2,6,1,3>
+ 2226718152U, // <0,2,4,2>: Cost 3 vrev <2,0,2,4>
+ 2568235169U, // <0,2,4,3>: Cost 3 vext1 <3,0,2,4>, <3,0,2,4>
+ 2562264374U, // <0,2,4,4>: Cost 3 vext1 <2,0,2,4>, RHS
+ 1544850742U, // <0,2,4,5>: Cost 2 vext2 <0,2,0,2>, RHS
+ 1678560566U, // <0,2,4,6>: Cost 2 vuzpl LHS, RHS
+ 2592125957U, // <0,2,4,7>: Cost 3 vext1 <7,0,2,4>, <7,0,2,4>
+ 1678560584U, // <0,2,4,u>: Cost 2 vuzpl LHS, RHS
+ 2691876686U, // <0,2,5,0>: Cost 3 vext3 <1,2,3,0>, <2,5,0,7>
+ 2618592976U, // <0,2,5,1>: Cost 3 vext2 <0,2,0,2>, <5,1,7,3>
+ 3765618528U, // <0,2,5,2>: Cost 4 vext3 <1,2,3,0>, <2,5,2,7>
+ 3765618536U, // <0,2,5,3>: Cost 4 vext3 <1,2,3,0>, <2,5,3,6>
+ 2618593222U, // <0,2,5,4>: Cost 3 vext2 <0,2,0,2>, <5,4,7,6>
+ 2752303108U, // <0,2,5,5>: Cost 3 vuzpl LHS, <5,5,5,5>
+ 2618593378U, // <0,2,5,6>: Cost 3 vext2 <0,2,0,2>, <5,6,7,0>
+ 2824785206U, // <0,2,5,7>: Cost 3 vuzpr <1,0,3,2>, RHS
+ 2824785207U, // <0,2,5,u>: Cost 3 vuzpr <1,0,3,2>, RHS
+ 2752303950U, // <0,2,6,0>: Cost 3 vuzpl LHS, <6,7,0,1>
+ 3830690081U, // <0,2,6,1>: Cost 4 vuzpl LHS, <6,0,1,2>
+ 2618593786U, // <0,2,6,2>: Cost 3 vext2 <0,2,0,2>, <6,2,7,3>
+ 2691876794U, // <0,2,6,3>: Cost 3 vext3 <1,2,3,0>, <2,6,3,7>
+ 2752303990U, // <0,2,6,4>: Cost 3 vuzpl LHS, <6,7,4,5>
+ 3830690445U, // <0,2,6,5>: Cost 4 vuzpl LHS, <6,4,5,6>
+ 2752303928U, // <0,2,6,6>: Cost 3 vuzpl LHS, <6,6,6,6>
+ 2657743695U, // <0,2,6,7>: Cost 3 vext2 <6,7,0,2>, <6,7,0,2>
+ 2691876839U, // <0,2,6,u>: Cost 3 vext3 <1,2,3,0>, <2,6,u,7>
+ 2659070961U, // <0,2,7,0>: Cost 3 vext2 <7,0,0,2>, <7,0,0,2>
+ 2659734594U, // <0,2,7,1>: Cost 3 vext2 <7,1,0,2>, <7,1,0,2>
+ 3734140051U, // <0,2,7,2>: Cost 4 vext2 <7,2,0,2>, <7,2,0,2>
+ 2701166596U, // <0,2,7,3>: Cost 3 vext3 <2,7,3,0>, <2,7,3,0>
+ 2662389094U, // <0,2,7,4>: Cost 3 vext2 <7,5,0,2>, <7,4,5,6>
+ 2662389126U, // <0,2,7,5>: Cost 3 vext2 <7,5,0,2>, <7,5,0,2>
+ 3736794583U, // <0,2,7,6>: Cost 4 vext2 <7,6,0,2>, <7,6,0,2>
+ 2752304748U, // <0,2,7,7>: Cost 3 vuzpl LHS, <7,7,7,7>
+ 2659070961U, // <0,2,7,u>: Cost 3 vext2 <7,0,0,2>, <7,0,0,2>
+ 1476608026U, // <0,2,u,0>: Cost 2 vext1 <0,0,2,u>, <0,0,2,u>
+ 1544853294U, // <0,2,u,1>: Cost 2 vext2 <0,2,0,2>, LHS
+ 1678563118U, // <0,2,u,2>: Cost 2 vuzpl LHS, LHS
+ 3021178482U, // <0,2,u,3>: Cost 3 vtrnl LHS, <2,2,3,3>
+ 1476611382U, // <0,2,u,4>: Cost 2 vext1 <0,0,2,u>, RHS
+ 1544853658U, // <0,2,u,5>: Cost 2 vext2 <0,2,0,2>, RHS
+ 1678563482U, // <0,2,u,6>: Cost 2 vuzpl LHS, RHS
+ 2824785449U, // <0,2,u,7>: Cost 3 vuzpr <1,0,3,2>, RHS
+ 1678563172U, // <0,2,u,u>: Cost 2 vuzpl LHS, LHS
+ 2556329984U, // <0,3,0,0>: Cost 3 vext1 <1,0,3,0>, <0,0,0,0>
+ 2686421142U, // <0,3,0,1>: Cost 3 vext3 <0,3,1,0>, <3,0,1,2>
+ 2562303437U, // <0,3,0,2>: Cost 3 vext1 <2,0,3,0>, <2,0,3,0>
+ 4094986652U, // <0,3,0,3>: Cost 4 vtrnl <0,2,0,2>, <3,3,3,3>
+ 2556333366U, // <0,3,0,4>: Cost 3 vext1 <1,0,3,0>, RHS
+ 4094986754U, // <0,3,0,5>: Cost 4 vtrnl <0,2,0,2>, <3,4,5,6>
+ 3798796488U, // <0,3,0,6>: Cost 4 vext3 <6,7,3,0>, <3,0,6,7>
+ 3776530634U, // <0,3,0,7>: Cost 4 vext3 <3,0,7,0>, <3,0,7,0>
+ 2556335918U, // <0,3,0,u>: Cost 3 vext1 <1,0,3,0>, LHS
+ 2886518934U, // <0,3,1,0>: Cost 3 vzipl LHS, <3,0,1,2>
+ 2556338933U, // <0,3,1,1>: Cost 3 vext1 <1,0,3,1>, <1,0,3,1>
+ 2691877105U, // <0,3,1,2>: Cost 3 vext3 <1,2,3,0>, <3,1,2,3>
+ 2886519196U, // <0,3,1,3>: Cost 3 vzipl LHS, <3,3,3,3>
+ 2886519298U, // <0,3,1,4>: Cost 3 vzipl LHS, <3,4,5,6>
+ 4095740418U, // <0,3,1,5>: Cost 4 vtrnl <0,3,1,4>, <3,4,5,6>
+ 3659944242U, // <0,3,1,6>: Cost 4 vext1 <6,0,3,1>, <6,0,3,1>
+ 3769600286U, // <0,3,1,7>: Cost 4 vext3 <1,u,3,0>, <3,1,7,3>
+ 2886519582U, // <0,3,1,u>: Cost 3 vzipl LHS, <3,u,1,2>
+ 1482604646U, // <0,3,2,0>: Cost 2 vext1 <1,0,3,2>, LHS
+ 1482605302U, // <0,3,2,1>: Cost 2 vext1 <1,0,3,2>, <1,0,3,2>
+ 2556348008U, // <0,3,2,2>: Cost 3 vext1 <1,0,3,2>, <2,2,2,2>
+ 3020736924U, // <0,3,2,3>: Cost 3 vtrnl LHS, <3,3,3,3>
+ 1482607926U, // <0,3,2,4>: Cost 2 vext1 <1,0,3,2>, RHS
+ 3020737026U, // <0,3,2,5>: Cost 3 vtrnl LHS, <3,4,5,6>
+ 2598154746U, // <0,3,2,6>: Cost 3 vext1 <u,0,3,2>, <6,2,7,3>
+ 2598155258U, // <0,3,2,7>: Cost 3 vext1 <u,0,3,2>, <7,0,1,2>
+ 1482610478U, // <0,3,2,u>: Cost 2 vext1 <1,0,3,2>, LHS
+ 3692341398U, // <0,3,3,0>: Cost 4 vext2 <0,2,0,3>, <3,0,1,2>
+ 2635851999U, // <0,3,3,1>: Cost 3 vext2 <3,1,0,3>, <3,1,0,3>
+ 3636069840U, // <0,3,3,2>: Cost 4 vext1 <2,0,3,3>, <2,0,3,3>
+ 2691877276U, // <0,3,3,3>: Cost 3 vext3 <1,2,3,0>, <3,3,3,3>
+ 3961522690U, // <0,3,3,4>: Cost 4 vzipl <0,3,1,4>, <3,4,5,6>
+ 3826797058U, // <0,3,3,5>: Cost 4 vuzpl <0,2,3,5>, <3,4,5,6>
+ 3703622282U, // <0,3,3,6>: Cost 4 vext2 <2,1,0,3>, <3,6,2,7>
+ 3769600452U, // <0,3,3,7>: Cost 4 vext3 <1,u,3,0>, <3,3,7,7>
+ 2640497430U, // <0,3,3,u>: Cost 3 vext2 <3,u,0,3>, <3,u,0,3>
+ 3962194070U, // <0,3,4,0>: Cost 4 vzipl <0,4,1,5>, <3,0,1,2>
+ 2232617112U, // <0,3,4,1>: Cost 3 vrev <3,0,1,4>
+ 2232690849U, // <0,3,4,2>: Cost 3 vrev <3,0,2,4>
+ 4095314332U, // <0,3,4,3>: Cost 4 vtrnl <0,2,4,6>, <3,3,3,3>
+ 3962194434U, // <0,3,4,4>: Cost 4 vzipl <0,4,1,5>, <3,4,5,6>
+ 2691877378U, // <0,3,4,5>: Cost 3 vext3 <1,2,3,0>, <3,4,5,6>
+ 3826765110U, // <0,3,4,6>: Cost 4 vuzpl <0,2,3,1>, RHS
+ 3665941518U, // <0,3,4,7>: Cost 4 vext1 <7,0,3,4>, <7,0,3,4>
+ 2691877405U, // <0,3,4,u>: Cost 3 vext3 <1,2,3,0>, <3,4,u,6>
+ 3630112870U, // <0,3,5,0>: Cost 4 vext1 <1,0,3,5>, LHS
+ 3630113526U, // <0,3,5,1>: Cost 4 vext1 <1,0,3,5>, <1,0,3,2>
+ 4035199734U, // <0,3,5,2>: Cost 4 vzipr <1,4,0,5>, <1,0,3,2>
+ 3769600578U, // <0,3,5,3>: Cost 4 vext3 <1,u,3,0>, <3,5,3,7>
+ 2232846516U, // <0,3,5,4>: Cost 3 vrev <3,0,4,5>
+ 3779037780U, // <0,3,5,5>: Cost 4 vext3 <3,4,5,0>, <3,5,5,7>
+ 2718714461U, // <0,3,5,6>: Cost 3 vext3 <5,6,7,0>, <3,5,6,7>
+ 2706106975U, // <0,3,5,7>: Cost 3 vext3 <3,5,7,0>, <3,5,7,0>
+ 2233141464U, // <0,3,5,u>: Cost 3 vrev <3,0,u,5>
+ 2691877496U, // <0,3,6,0>: Cost 3 vext3 <1,2,3,0>, <3,6,0,7>
+ 3727511914U, // <0,3,6,1>: Cost 4 vext2 <6,1,0,3>, <6,1,0,3>
+ 3765619338U, // <0,3,6,2>: Cost 4 vext3 <1,2,3,0>, <3,6,2,7>
+ 3765619347U, // <0,3,6,3>: Cost 4 vext3 <1,2,3,0>, <3,6,3,7>
+ 3765987996U, // <0,3,6,4>: Cost 4 vext3 <1,2,u,0>, <3,6,4,7>
+ 3306670270U, // <0,3,6,5>: Cost 4 vrev <3,0,5,6>
+ 3792456365U, // <0,3,6,6>: Cost 4 vext3 <5,6,7,0>, <3,6,6,6>
+ 2706770608U, // <0,3,6,7>: Cost 3 vext3 <3,6,7,0>, <3,6,7,0>
+ 2706844345U, // <0,3,6,u>: Cost 3 vext3 <3,6,u,0>, <3,6,u,0>
+ 3769600707U, // <0,3,7,0>: Cost 4 vext3 <1,u,3,0>, <3,7,0,1>
+ 2659742787U, // <0,3,7,1>: Cost 3 vext2 <7,1,0,3>, <7,1,0,3>
+ 3636102612U, // <0,3,7,2>: Cost 4 vext1 <2,0,3,7>, <2,0,3,7>
+ 3769600740U, // <0,3,7,3>: Cost 4 vext3 <1,u,3,0>, <3,7,3,7>
+ 3769600747U, // <0,3,7,4>: Cost 4 vext3 <1,u,3,0>, <3,7,4,5>
+ 3769600758U, // <0,3,7,5>: Cost 4 vext3 <1,u,3,0>, <3,7,5,7>
+ 3659993400U, // <0,3,7,6>: Cost 4 vext1 <6,0,3,7>, <6,0,3,7>
+ 3781176065U, // <0,3,7,7>: Cost 4 vext3 <3,7,7,0>, <3,7,7,0>
+ 2664388218U, // <0,3,7,u>: Cost 3 vext2 <7,u,0,3>, <7,u,0,3>
+ 1482653798U, // <0,3,u,0>: Cost 2 vext1 <1,0,3,u>, LHS
+ 1482654460U, // <0,3,u,1>: Cost 2 vext1 <1,0,3,u>, <1,0,3,u>
+ 2556397160U, // <0,3,u,2>: Cost 3 vext1 <1,0,3,u>, <2,2,2,2>
+ 3021179292U, // <0,3,u,3>: Cost 3 vtrnl LHS, <3,3,3,3>
+ 1482657078U, // <0,3,u,4>: Cost 2 vext1 <1,0,3,u>, RHS
+ 3021179394U, // <0,3,u,5>: Cost 3 vtrnl LHS, <3,4,5,6>
+ 2598203898U, // <0,3,u,6>: Cost 3 vext1 <u,0,3,u>, <6,2,7,3>
+ 2708097874U, // <0,3,u,7>: Cost 3 vext3 <3,u,7,0>, <3,u,7,0>
+ 1482659630U, // <0,3,u,u>: Cost 2 vext1 <1,0,3,u>, LHS
+ 2617278468U, // <0,4,0,0>: Cost 3 vext2 <0,0,0,4>, <0,0,0,4>
+ 2618605670U, // <0,4,0,1>: Cost 3 vext2 <0,2,0,4>, LHS
+ 2618605734U, // <0,4,0,2>: Cost 3 vext2 <0,2,0,4>, <0,2,0,4>
+ 3642091695U, // <0,4,0,3>: Cost 4 vext1 <3,0,4,0>, <3,0,4,0>
+ 2753134796U, // <0,4,0,4>: Cost 3 vuzpl <0,2,4,6>, <0,2,4,6>
+ 2718714770U, // <0,4,0,5>: Cost 3 vext3 <5,6,7,0>, <4,0,5,1>
+ 3021245750U, // <0,4,0,6>: Cost 3 vtrnl <0,2,0,2>, RHS
+ 3665982483U, // <0,4,0,7>: Cost 4 vext1 <7,0,4,0>, <7,0,4,0>
+ 3021245768U, // <0,4,0,u>: Cost 3 vtrnl <0,2,0,2>, RHS
+ 2568355942U, // <0,4,1,0>: Cost 3 vext1 <3,0,4,1>, LHS
+ 3692348212U, // <0,4,1,1>: Cost 4 vext2 <0,2,0,4>, <1,1,1,1>
+ 3692348310U, // <0,4,1,2>: Cost 4 vext2 <0,2,0,4>, <1,2,3,0>
+ 2568358064U, // <0,4,1,3>: Cost 3 vext1 <3,0,4,1>, <3,0,4,1>
+ 2568359222U, // <0,4,1,4>: Cost 3 vext1 <3,0,4,1>, RHS
+ 1812778294U, // <0,4,1,5>: Cost 2 vzipl LHS, RHS
+ 3022671158U, // <0,4,1,6>: Cost 3 vtrnl <0,4,1,5>, RHS
+ 2592248852U, // <0,4,1,7>: Cost 3 vext1 <7,0,4,1>, <7,0,4,1>
+ 1812778537U, // <0,4,1,u>: Cost 2 vzipl LHS, RHS
+ 2568364134U, // <0,4,2,0>: Cost 3 vext1 <3,0,4,2>, LHS
+ 2238573423U, // <0,4,2,1>: Cost 3 vrev <4,0,1,2>
+ 3692349032U, // <0,4,2,2>: Cost 4 vext2 <0,2,0,4>, <2,2,2,2>
+ 2631214761U, // <0,4,2,3>: Cost 3 vext2 <2,3,0,4>, <2,3,0,4>
+ 2568367414U, // <0,4,2,4>: Cost 3 vext1 <3,0,4,2>, RHS
+ 2887028022U, // <0,4,2,5>: Cost 3 vzipl <0,2,0,2>, RHS
+ 1946996022U, // <0,4,2,6>: Cost 2 vtrnl LHS, RHS
+ 2592257045U, // <0,4,2,7>: Cost 3 vext1 <7,0,4,2>, <7,0,4,2>
+ 1946996040U, // <0,4,2,u>: Cost 2 vtrnl LHS, RHS
+ 3692349590U, // <0,4,3,0>: Cost 4 vext2 <0,2,0,4>, <3,0,1,2>
+ 3826878614U, // <0,4,3,1>: Cost 4 vuzpl <0,2,4,6>, <3,0,1,2>
+ 3826878625U, // <0,4,3,2>: Cost 4 vuzpl <0,2,4,6>, <3,0,2,4>
+ 3692349852U, // <0,4,3,3>: Cost 4 vext2 <0,2,0,4>, <3,3,3,3>
+ 3692349954U, // <0,4,3,4>: Cost 4 vext2 <0,2,0,4>, <3,4,5,6>
+ 3826878978U, // <0,4,3,5>: Cost 4 vuzpl <0,2,4,6>, <3,4,5,6>
+ 4095200566U, // <0,4,3,6>: Cost 4 vtrnl <0,2,3,1>, RHS
+ 3713583814U, // <0,4,3,7>: Cost 4 vext2 <3,7,0,4>, <3,7,0,4>
+ 3692350238U, // <0,4,3,u>: Cost 4 vext2 <0,2,0,4>, <3,u,1,2>
+ 2550464552U, // <0,4,4,0>: Cost 3 vext1 <0,0,4,4>, <0,0,4,4>
+ 3962194914U, // <0,4,4,1>: Cost 4 vzipl <0,4,1,5>, <4,1,5,0>
+ 3693677631U, // <0,4,4,2>: Cost 4 vext2 <0,4,0,4>, <4,2,6,3>
+ 3642124467U, // <0,4,4,3>: Cost 4 vext1 <3,0,4,4>, <3,0,4,4>
+ 2718715088U, // <0,4,4,4>: Cost 3 vext3 <5,6,7,0>, <4,4,4,4>
+ 2618608950U, // <0,4,4,5>: Cost 3 vext2 <0,2,0,4>, RHS
+ 2753137974U, // <0,4,4,6>: Cost 3 vuzpl <0,2,4,6>, RHS
+ 3666015255U, // <0,4,4,7>: Cost 4 vext1 <7,0,4,4>, <7,0,4,4>
+ 2618609193U, // <0,4,4,u>: Cost 3 vext2 <0,2,0,4>, RHS
+ 2568388710U, // <0,4,5,0>: Cost 3 vext1 <3,0,4,5>, LHS
+ 2568389526U, // <0,4,5,1>: Cost 3 vext1 <3,0,4,5>, <1,2,3,0>
+ 3636159963U, // <0,4,5,2>: Cost 4 vext1 <2,0,4,5>, <2,0,4,5>
+ 2568390836U, // <0,4,5,3>: Cost 3 vext1 <3,0,4,5>, <3,0,4,5>
+ 2568391990U, // <0,4,5,4>: Cost 3 vext1 <3,0,4,5>, RHS
+ 2718715180U, // <0,4,5,5>: Cost 3 vext3 <5,6,7,0>, <4,5,5,6>
+ 1618136374U, // <0,4,5,6>: Cost 2 vext3 <1,2,3,0>, RHS
+ 2592281624U, // <0,4,5,7>: Cost 3 vext1 <7,0,4,5>, <7,0,4,5>
+ 1618136392U, // <0,4,5,u>: Cost 2 vext3 <1,2,3,0>, RHS
+ 2550480938U, // <0,4,6,0>: Cost 3 vext1 <0,0,4,6>, <0,0,4,6>
+ 3826880801U, // <0,4,6,1>: Cost 4 vuzpl <0,2,4,6>, <6,0,1,2>
+ 2562426332U, // <0,4,6,2>: Cost 3 vext1 <2,0,4,6>, <2,0,4,6>
+ 3786190181U, // <0,4,6,3>: Cost 4 vext3 <4,6,3,0>, <4,6,3,0>
+ 2718715252U, // <0,4,6,4>: Cost 3 vext3 <5,6,7,0>, <4,6,4,6>
+ 3826881165U, // <0,4,6,5>: Cost 4 vuzpl <0,2,4,6>, <6,4,5,6>
+ 2712669568U, // <0,4,6,6>: Cost 3 vext3 <4,6,6,0>, <4,6,6,0>
+ 2657760081U, // <0,4,6,7>: Cost 3 vext2 <6,7,0,4>, <6,7,0,4>
+ 2718715284U, // <0,4,6,u>: Cost 3 vext3 <5,6,7,0>, <4,6,u,2>
+ 3654090854U, // <0,4,7,0>: Cost 4 vext1 <5,0,4,7>, LHS
+ 3934229326U, // <0,4,7,1>: Cost 4 vuzpr <7,0,1,4>, <6,7,0,1>
+ 3734156437U, // <0,4,7,2>: Cost 4 vext2 <7,2,0,4>, <7,2,0,4>
+ 3734820070U, // <0,4,7,3>: Cost 4 vext2 <7,3,0,4>, <7,3,0,4>
+ 3654094134U, // <0,4,7,4>: Cost 4 vext1 <5,0,4,7>, RHS
+ 2713259464U, // <0,4,7,5>: Cost 3 vext3 <4,7,5,0>, <4,7,5,0>
+ 2713333201U, // <0,4,7,6>: Cost 3 vext3 <4,7,6,0>, <4,7,6,0>
+ 3654095866U, // <0,4,7,7>: Cost 4 vext1 <5,0,4,7>, <7,0,1,2>
+ 2713259464U, // <0,4,7,u>: Cost 3 vext3 <4,7,5,0>, <4,7,5,0>
+ 2568413286U, // <0,4,u,0>: Cost 3 vext1 <3,0,4,u>, LHS
+ 2618611502U, // <0,4,u,1>: Cost 3 vext2 <0,2,0,4>, LHS
+ 2753140526U, // <0,4,u,2>: Cost 3 vuzpl <0,2,4,6>, LHS
+ 2568415415U, // <0,4,u,3>: Cost 3 vext1 <3,0,4,u>, <3,0,4,u>
+ 2568416566U, // <0,4,u,4>: Cost 3 vext1 <3,0,4,u>, RHS
+ 1817423158U, // <0,4,u,5>: Cost 2 vzipl LHS, RHS
+ 1947438390U, // <0,4,u,6>: Cost 2 vtrnl LHS, RHS
+ 2592306203U, // <0,4,u,7>: Cost 3 vext1 <7,0,4,u>, <7,0,4,u>
+ 1947438408U, // <0,4,u,u>: Cost 2 vtrnl LHS, RHS
+ 3630219264U, // <0,5,0,0>: Cost 4 vext1 <1,0,5,0>, <0,0,0,0>
+ 2625912934U, // <0,5,0,1>: Cost 3 vext2 <1,4,0,5>, LHS
+ 3692355748U, // <0,5,0,2>: Cost 4 vext2 <0,2,0,5>, <0,2,0,2>
+ 3693019384U, // <0,5,0,3>: Cost 4 vext2 <0,3,0,5>, <0,3,0,5>
+ 3630222646U, // <0,5,0,4>: Cost 4 vext1 <1,0,5,0>, RHS
+ 3699655062U, // <0,5,0,5>: Cost 4 vext2 <1,4,0,5>, <0,5,0,1>
+ 2718715508U, // <0,5,0,6>: Cost 3 vext3 <5,6,7,0>, <5,0,6,1>
+ 3087011126U, // <0,5,0,7>: Cost 3 vtrnr <0,0,0,0>, RHS
+ 2625913501U, // <0,5,0,u>: Cost 3 vext2 <1,4,0,5>, LHS
+ 1500659814U, // <0,5,1,0>: Cost 2 vext1 <4,0,5,1>, LHS
+ 2886520528U, // <0,5,1,1>: Cost 3 vzipl LHS, <5,1,7,3>
+ 2574403176U, // <0,5,1,2>: Cost 3 vext1 <4,0,5,1>, <2,2,2,2>
+ 2574403734U, // <0,5,1,3>: Cost 3 vext1 <4,0,5,1>, <3,0,1,2>
+ 1500662674U, // <0,5,1,4>: Cost 2 vext1 <4,0,5,1>, <4,0,5,1>
+ 2886520836U, // <0,5,1,5>: Cost 3 vzipl LHS, <5,5,5,5>
+ 2886520930U, // <0,5,1,6>: Cost 3 vzipl LHS, <5,6,7,0>
+ 2718715600U, // <0,5,1,7>: Cost 3 vext3 <5,6,7,0>, <5,1,7,3>
+ 1500665646U, // <0,5,1,u>: Cost 2 vext1 <4,0,5,1>, LHS
+ 2556493926U, // <0,5,2,0>: Cost 3 vext1 <1,0,5,2>, LHS
+ 2244546120U, // <0,5,2,1>: Cost 3 vrev <5,0,1,2>
+ 3692357256U, // <0,5,2,2>: Cost 4 vext2 <0,2,0,5>, <2,2,5,7>
+ 2568439994U, // <0,5,2,3>: Cost 3 vext1 <3,0,5,2>, <3,0,5,2>
+ 2556497206U, // <0,5,2,4>: Cost 3 vext1 <1,0,5,2>, RHS
+ 3020738564U, // <0,5,2,5>: Cost 3 vtrnl LHS, <5,5,5,5>
+ 4027877161U, // <0,5,2,6>: Cost 4 vzipr <0,2,0,2>, <2,4,5,6>
+ 3093220662U, // <0,5,2,7>: Cost 3 vtrnr <1,0,3,2>, RHS
+ 3093220663U, // <0,5,2,u>: Cost 3 vtrnr <1,0,3,2>, RHS
+ 3699656854U, // <0,5,3,0>: Cost 4 vext2 <1,4,0,5>, <3,0,1,2>
+ 3699656927U, // <0,5,3,1>: Cost 4 vext2 <1,4,0,5>, <3,1,0,3>
+ 3699657006U, // <0,5,3,2>: Cost 4 vext2 <1,4,0,5>, <3,2,0,1>
+ 3699657116U, // <0,5,3,3>: Cost 4 vext2 <1,4,0,5>, <3,3,3,3>
+ 2637859284U, // <0,5,3,4>: Cost 3 vext2 <3,4,0,5>, <3,4,0,5>
+ 3790319453U, // <0,5,3,5>: Cost 4 vext3 <5,3,5,0>, <5,3,5,0>
+ 3699657354U, // <0,5,3,6>: Cost 4 vext2 <1,4,0,5>, <3,6,2,7>
+ 2716725103U, // <0,5,3,7>: Cost 3 vext3 <5,3,7,0>, <5,3,7,0>
+ 2716798840U, // <0,5,3,u>: Cost 3 vext3 <5,3,u,0>, <5,3,u,0>
+ 2661747602U, // <0,5,4,0>: Cost 3 vext2 <7,4,0,5>, <4,0,5,1>
+ 3630252810U, // <0,5,4,1>: Cost 4 vext1 <1,0,5,4>, <1,0,5,4>
+ 3636225507U, // <0,5,4,2>: Cost 4 vext1 <2,0,5,4>, <2,0,5,4>
+ 3716910172U, // <0,5,4,3>: Cost 4 vext2 <4,3,0,5>, <4,3,0,5>
+ 3962195892U, // <0,5,4,4>: Cost 4 vzipl <0,4,1,5>, <5,4,5,6>
+ 2625916214U, // <0,5,4,5>: Cost 3 vext2 <1,4,0,5>, RHS
+ 3718901071U, // <0,5,4,6>: Cost 4 vext2 <4,6,0,5>, <4,6,0,5>
+ 2718715846U, // <0,5,4,7>: Cost 3 vext3 <5,6,7,0>, <5,4,7,6>
+ 2625916457U, // <0,5,4,u>: Cost 3 vext2 <1,4,0,5>, RHS
+ 3791278034U, // <0,5,5,0>: Cost 4 vext3 <5,5,0,0>, <5,5,0,0>
+ 3791351771U, // <0,5,5,1>: Cost 4 vext3 <5,5,1,0>, <5,5,1,0>
+ 3318386260U, // <0,5,5,2>: Cost 4 vrev <5,0,2,5>
+ 3791499245U, // <0,5,5,3>: Cost 4 vext3 <5,5,3,0>, <5,5,3,0>
+ 3318533734U, // <0,5,5,4>: Cost 4 vrev <5,0,4,5>
+ 2718715908U, // <0,5,5,5>: Cost 3 vext3 <5,6,7,0>, <5,5,5,5>
+ 2657767522U, // <0,5,5,6>: Cost 3 vext2 <6,7,0,5>, <5,6,7,0>
+ 2718715928U, // <0,5,5,7>: Cost 3 vext3 <5,6,7,0>, <5,5,7,7>
+ 2718715937U, // <0,5,5,u>: Cost 3 vext3 <5,6,7,0>, <5,5,u,7>
+ 2592358502U, // <0,5,6,0>: Cost 3 vext1 <7,0,5,6>, LHS
+ 3792015404U, // <0,5,6,1>: Cost 4 vext3 <5,6,1,0>, <5,6,1,0>
+ 3731509754U, // <0,5,6,2>: Cost 4 vext2 <6,7,0,5>, <6,2,7,3>
+ 3785748546U, // <0,5,6,3>: Cost 4 vext3 <4,5,6,0>, <5,6,3,4>
+ 2592361782U, // <0,5,6,4>: Cost 3 vext1 <7,0,5,6>, RHS
+ 2592362594U, // <0,5,6,5>: Cost 3 vext1 <7,0,5,6>, <5,6,7,0>
+ 3785748576U, // <0,5,6,6>: Cost 4 vext3 <4,5,6,0>, <5,6,6,7>
+ 1644974178U, // <0,5,6,7>: Cost 2 vext3 <5,6,7,0>, <5,6,7,0>
+ 1645047915U, // <0,5,6,u>: Cost 2 vext3 <5,6,u,0>, <5,6,u,0>
+ 2562506854U, // <0,5,7,0>: Cost 3 vext1 <2,0,5,7>, LHS
+ 2562507670U, // <0,5,7,1>: Cost 3 vext1 <2,0,5,7>, <1,2,3,0>
+ 2562508262U, // <0,5,7,2>: Cost 3 vext1 <2,0,5,7>, <2,0,5,7>
+ 3636250774U, // <0,5,7,3>: Cost 4 vext1 <2,0,5,7>, <3,0,1,2>
+ 2562510134U, // <0,5,7,4>: Cost 3 vext1 <2,0,5,7>, RHS
+ 2718716072U, // <0,5,7,5>: Cost 3 vext3 <5,6,7,0>, <5,7,5,7>
+ 2718716074U, // <0,5,7,6>: Cost 3 vext3 <5,6,7,0>, <5,7,6,0>
+ 2719379635U, // <0,5,7,7>: Cost 3 vext3 <5,7,7,0>, <5,7,7,0>
+ 2562512686U, // <0,5,7,u>: Cost 3 vext1 <2,0,5,7>, LHS
+ 1500717158U, // <0,5,u,0>: Cost 2 vext1 <4,0,5,u>, LHS
+ 2625918766U, // <0,5,u,1>: Cost 3 vext2 <1,4,0,5>, LHS
+ 2719674583U, // <0,5,u,2>: Cost 3 vext3 <5,u,2,0>, <5,u,2,0>
+ 2568489152U, // <0,5,u,3>: Cost 3 vext1 <3,0,5,u>, <3,0,5,u>
+ 1500720025U, // <0,5,u,4>: Cost 2 vext1 <4,0,5,u>, <4,0,5,u>
+ 2625919130U, // <0,5,u,5>: Cost 3 vext2 <1,4,0,5>, RHS
+ 2586407243U, // <0,5,u,6>: Cost 3 vext1 <6,0,5,u>, <6,0,5,u>
+ 1646301444U, // <0,5,u,7>: Cost 2 vext3 <5,u,7,0>, <5,u,7,0>
+ 1646375181U, // <0,5,u,u>: Cost 2 vext3 <5,u,u,0>, <5,u,u,0>
+ 2586411110U, // <0,6,0,0>: Cost 3 vext1 <6,0,6,0>, LHS
+ 2619949158U, // <0,6,0,1>: Cost 3 vext2 <0,4,0,6>, LHS
+ 2619949220U, // <0,6,0,2>: Cost 3 vext2 <0,4,0,6>, <0,2,0,2>
+ 3785748789U, // <0,6,0,3>: Cost 4 vext3 <4,5,6,0>, <6,0,3,4>
+ 2619949386U, // <0,6,0,4>: Cost 3 vext2 <0,4,0,6>, <0,4,0,6>
+ 2586415202U, // <0,6,0,5>: Cost 3 vext1 <6,0,6,0>, <5,6,7,0>
+ 2586415436U, // <0,6,0,6>: Cost 3 vext1 <6,0,6,0>, <6,0,6,0>
+ 2952793398U, // <0,6,0,7>: Cost 3 vzipr <0,0,0,0>, RHS
+ 2619949725U, // <0,6,0,u>: Cost 3 vext2 <0,4,0,6>, LHS
+ 2562531430U, // <0,6,1,0>: Cost 3 vext1 <2,0,6,1>, LHS
+ 3693691700U, // <0,6,1,1>: Cost 4 vext2 <0,4,0,6>, <1,1,1,1>
+ 2886521338U, // <0,6,1,2>: Cost 3 vzipl LHS, <6,2,7,3>
+ 3693691864U, // <0,6,1,3>: Cost 4 vext2 <0,4,0,6>, <1,3,1,3>
+ 2562534710U, // <0,6,1,4>: Cost 3 vext1 <2,0,6,1>, RHS
+ 2580450932U, // <0,6,1,5>: Cost 3 vext1 <5,0,6,1>, <5,0,6,1>
+ 2886521656U, // <0,6,1,6>: Cost 3 vzipl LHS, <6,6,6,6>
+ 2966736182U, // <0,6,1,7>: Cost 3 vzipr <2,3,0,1>, RHS
+ 2966736183U, // <0,6,1,u>: Cost 3 vzipr <2,3,0,1>, RHS
+ 1500741734U, // <0,6,2,0>: Cost 2 vext1 <4,0,6,2>, LHS
+ 2250518817U, // <0,6,2,1>: Cost 3 vrev <6,0,1,2>
+ 2574485096U, // <0,6,2,2>: Cost 3 vext1 <4,0,6,2>, <2,2,2,2>
+ 2631894694U, // <0,6,2,3>: Cost 3 vext2 <2,4,0,6>, <2,3,0,1>
+ 1500744604U, // <0,6,2,4>: Cost 2 vext1 <4,0,6,2>, <4,0,6,2>
+ 2574487248U, // <0,6,2,5>: Cost 3 vext1 <4,0,6,2>, <5,1,7,3>
+ 3020739384U, // <0,6,2,6>: Cost 3 vtrnl LHS, <6,6,6,6>
+ 2954136886U, // <0,6,2,7>: Cost 3 vzipr <0,2,0,2>, RHS
+ 1500747566U, // <0,6,2,u>: Cost 2 vext1 <4,0,6,2>, LHS
+ 3693693078U, // <0,6,3,0>: Cost 4 vext2 <0,4,0,6>, <3,0,1,2>
+ 3705637136U, // <0,6,3,1>: Cost 4 vext2 <2,4,0,6>, <3,1,5,7>
+ 3705637192U, // <0,6,3,2>: Cost 4 vext2 <2,4,0,6>, <3,2,3,0>
+ 3693693340U, // <0,6,3,3>: Cost 4 vext2 <0,4,0,6>, <3,3,3,3>
+ 2637867477U, // <0,6,3,4>: Cost 3 vext2 <3,4,0,6>, <3,4,0,6>
+ 3705637424U, // <0,6,3,5>: Cost 4 vext2 <2,4,0,6>, <3,5,1,7>
+ 3666154056U, // <0,6,3,6>: Cost 4 vext1 <7,0,6,3>, <6,3,7,0>
+ 2722697800U, // <0,6,3,7>: Cost 3 vext3 <6,3,7,0>, <6,3,7,0>
+ 2722771537U, // <0,6,3,u>: Cost 3 vext3 <6,3,u,0>, <6,3,u,0>
+ 2562556006U, // <0,6,4,0>: Cost 3 vext1 <2,0,6,4>, LHS
+ 4095316257U, // <0,6,4,1>: Cost 4 vtrnl <0,2,4,6>, <6,0,1,2>
+ 2562557420U, // <0,6,4,2>: Cost 3 vext1 <2,0,6,4>, <2,0,6,4>
+ 3636299926U, // <0,6,4,3>: Cost 4 vext1 <2,0,6,4>, <3,0,1,2>
+ 2562559286U, // <0,6,4,4>: Cost 3 vext1 <2,0,6,4>, RHS
+ 2619952438U, // <0,6,4,5>: Cost 3 vext2 <0,4,0,6>, RHS
+ 2723287696U, // <0,6,4,6>: Cost 3 vext3 <6,4,6,0>, <6,4,6,0>
+ 4027895094U, // <0,6,4,7>: Cost 4 vzipr <0,2,0,4>, RHS
+ 2619952681U, // <0,6,4,u>: Cost 3 vext2 <0,4,0,6>, RHS
+ 2718716594U, // <0,6,5,0>: Cost 3 vext3 <5,6,7,0>, <6,5,0,7>
+ 3648250774U, // <0,6,5,1>: Cost 4 vext1 <4,0,6,5>, <1,2,3,0>
+ 3792458436U, // <0,6,5,2>: Cost 4 vext3 <5,6,7,0>, <6,5,2,7>
+ 3705638767U, // <0,6,5,3>: Cost 5 vext2 <2,4,0,6>, <5,3,7,0>
+ 3648252831U, // <0,6,5,4>: Cost 4 vext1 <4,0,6,5>, <4,0,6,5>
+ 3797619416U, // <0,6,5,5>: Cost 4 vext3 <6,5,5,0>, <6,5,5,0>
+ 3792458472U, // <0,6,5,6>: Cost 4 vext3 <5,6,7,0>, <6,5,6,7>
+ 4035202358U, // <0,6,5,7>: Cost 4 vzipr <1,4,0,5>, RHS
+ 2718716594U, // <0,6,5,u>: Cost 3 vext3 <5,6,7,0>, <6,5,0,7>
+ 3786412796U, // <0,6,6,0>: Cost 4 vext3 <4,6,6,0>, <6,6,0,0>
+ 3792458504U, // <0,6,6,1>: Cost 4 vext3 <5,6,7,0>, <6,6,1,3>
+ 3728200126U, // <0,6,6,2>: Cost 4 vext2 <6,2,0,6>, <6,2,0,6>
+ 3798135575U, // <0,6,6,3>: Cost 4 vext3 <6,6,3,0>, <6,6,3,0>
+ 3786412836U, // <0,6,6,4>: Cost 4 vext3 <4,6,6,0>, <6,6,4,4>
+ 3792458543U, // <0,6,6,5>: Cost 4 vext3 <5,6,7,0>, <6,6,5,6>
+ 2718716728U, // <0,6,6,6>: Cost 3 vext3 <5,6,7,0>, <6,6,6,6>
+ 2718716738U, // <0,6,6,7>: Cost 3 vext3 <5,6,7,0>, <6,6,7,7>
+ 2718716747U, // <0,6,6,u>: Cost 3 vext3 <5,6,7,0>, <6,6,u,7>
+ 2718716750U, // <0,6,7,0>: Cost 3 vext3 <5,6,7,0>, <6,7,0,1>
+ 2724909910U, // <0,6,7,1>: Cost 3 vext3 <6,7,1,0>, <6,7,1,0>
+ 3636323823U, // <0,6,7,2>: Cost 4 vext1 <2,0,6,7>, <2,0,6,7>
+ 2725057384U, // <0,6,7,3>: Cost 3 vext3 <6,7,3,0>, <6,7,3,0>
+ 2718716790U, // <0,6,7,4>: Cost 3 vext3 <5,6,7,0>, <6,7,4,5>
+ 2718716800U, // <0,6,7,5>: Cost 3 vext3 <5,6,7,0>, <6,7,5,6>
+ 3792458629U, // <0,6,7,6>: Cost 4 vext3 <5,6,7,0>, <6,7,6,2>
+ 2725352332U, // <0,6,7,7>: Cost 3 vext3 <6,7,7,0>, <6,7,7,0>
+ 2718716822U, // <0,6,7,u>: Cost 3 vext3 <5,6,7,0>, <6,7,u,1>
+ 1500790886U, // <0,6,u,0>: Cost 2 vext1 <4,0,6,u>, LHS
+ 2619954990U, // <0,6,u,1>: Cost 3 vext2 <0,4,0,6>, LHS
+ 2562590192U, // <0,6,u,2>: Cost 3 vext1 <2,0,6,u>, <2,0,6,u>
+ 2725721017U, // <0,6,u,3>: Cost 3 vext3 <6,u,3,0>, <6,u,3,0>
+ 1500793762U, // <0,6,u,4>: Cost 2 vext1 <4,0,6,u>, <4,0,6,u>
+ 2619955354U, // <0,6,u,5>: Cost 3 vext2 <0,4,0,6>, RHS
+ 2725942228U, // <0,6,u,6>: Cost 3 vext3 <6,u,6,0>, <6,u,6,0>
+ 2954186038U, // <0,6,u,7>: Cost 3 vzipr <0,2,0,u>, RHS
+ 1500796718U, // <0,6,u,u>: Cost 2 vext1 <4,0,6,u>, LHS
+ 2256401391U, // <0,7,0,0>: Cost 3 vrev <7,0,0,0>
+ 2632564838U, // <0,7,0,1>: Cost 3 vext2 <2,5,0,7>, LHS
+ 2256548865U, // <0,7,0,2>: Cost 3 vrev <7,0,2,0>
+ 3700998396U, // <0,7,0,3>: Cost 4 vext2 <1,6,0,7>, <0,3,1,0>
+ 2718716952U, // <0,7,0,4>: Cost 3 vext3 <5,6,7,0>, <7,0,4,5>
+ 2718716962U, // <0,7,0,5>: Cost 3 vext3 <5,6,7,0>, <7,0,5,6>
+ 2621284845U, // <0,7,0,6>: Cost 3 vext2 <0,6,0,7>, <0,6,0,7>
+ 3904685542U, // <0,7,0,7>: Cost 4 vuzpr <2,0,5,7>, <2,0,5,7>
+ 2632565405U, // <0,7,0,u>: Cost 3 vext2 <2,5,0,7>, LHS
+ 2256409584U, // <0,7,1,0>: Cost 3 vrev <7,0,0,1>
+ 3706307380U, // <0,7,1,1>: Cost 4 vext2 <2,5,0,7>, <1,1,1,1>
+ 2632565654U, // <0,7,1,2>: Cost 3 vext2 <2,5,0,7>, <1,2,3,0>
+ 3769603168U, // <0,7,1,3>: Cost 4 vext3 <1,u,3,0>, <7,1,3,5>
+ 2256704532U, // <0,7,1,4>: Cost 3 vrev <7,0,4,1>
+ 3769603184U, // <0,7,1,5>: Cost 4 vext3 <1,u,3,0>, <7,1,5,3>
+ 3700999366U, // <0,7,1,6>: Cost 4 vext2 <1,6,0,7>, <1,6,0,7>
+ 2886522476U, // <0,7,1,7>: Cost 3 vzipl LHS, <7,7,7,7>
+ 2256999480U, // <0,7,1,u>: Cost 3 vrev <7,0,u,1>
+ 2586501222U, // <0,7,2,0>: Cost 3 vext1 <6,0,7,2>, LHS
+ 1182749690U, // <0,7,2,1>: Cost 2 vrev <7,0,1,2>
+ 3636356595U, // <0,7,2,2>: Cost 4 vext1 <2,0,7,2>, <2,0,7,2>
+ 2727711916U, // <0,7,2,3>: Cost 3 vext3 <7,2,3,0>, <7,2,3,0>
+ 2586504502U, // <0,7,2,4>: Cost 3 vext1 <6,0,7,2>, RHS
+ 2632566606U, // <0,7,2,5>: Cost 3 vext2 <2,5,0,7>, <2,5,0,7>
+ 2586505559U, // <0,7,2,6>: Cost 3 vext1 <6,0,7,2>, <6,0,7,2>
+ 3020740204U, // <0,7,2,7>: Cost 3 vtrnl LHS, <7,7,7,7>
+ 1183265849U, // <0,7,2,u>: Cost 2 vrev <7,0,u,2>
+ 3701000342U, // <0,7,3,0>: Cost 4 vext2 <1,6,0,7>, <3,0,1,2>
+ 3706308849U, // <0,7,3,1>: Cost 4 vext2 <2,5,0,7>, <3,1,2,3>
+ 3330315268U, // <0,7,3,2>: Cost 4 vrev <7,0,2,3>
+ 3706309020U, // <0,7,3,3>: Cost 4 vext2 <2,5,0,7>, <3,3,3,3>
+ 3706309122U, // <0,7,3,4>: Cost 4 vext2 <2,5,0,7>, <3,4,5,6>
+ 3712281127U, // <0,7,3,5>: Cost 4 vext2 <3,5,0,7>, <3,5,0,7>
+ 2639202936U, // <0,7,3,6>: Cost 3 vext2 <3,6,0,7>, <3,6,0,7>
+ 3802412321U, // <0,7,3,7>: Cost 4 vext3 <7,3,7,0>, <7,3,7,0>
+ 2640530202U, // <0,7,3,u>: Cost 3 vext2 <3,u,0,7>, <3,u,0,7>
+ 3654287462U, // <0,7,4,0>: Cost 4 vext1 <5,0,7,4>, LHS
+ 2256507900U, // <0,7,4,1>: Cost 3 vrev <7,0,1,4>
+ 2256581637U, // <0,7,4,2>: Cost 3 vrev <7,0,2,4>
+ 3660262008U, // <0,7,4,3>: Cost 4 vext1 <6,0,7,4>, <3,6,0,7>
+ 3786413405U, // <0,7,4,4>: Cost 4 vext3 <4,6,6,0>, <7,4,4,6>
+ 2632568118U, // <0,7,4,5>: Cost 3 vext2 <2,5,0,7>, RHS
+ 3718917457U, // <0,7,4,6>: Cost 4 vext2 <4,6,0,7>, <4,6,0,7>
+ 3787003255U, // <0,7,4,7>: Cost 4 vext3 <4,7,5,0>, <7,4,7,5>
+ 2632568361U, // <0,7,4,u>: Cost 3 vext2 <2,5,0,7>, RHS
+ 3706310268U, // <0,7,5,0>: Cost 4 vext2 <2,5,0,7>, <5,0,7,0>
+ 3792459156U, // <0,7,5,1>: Cost 4 vext3 <5,6,7,0>, <7,5,1,7>
+ 3330331654U, // <0,7,5,2>: Cost 4 vrev <7,0,2,5>
+ 3722899255U, // <0,7,5,3>: Cost 4 vext2 <5,3,0,7>, <5,3,0,7>
+ 2256737304U, // <0,7,5,4>: Cost 3 vrev <7,0,4,5>
+ 3724226521U, // <0,7,5,5>: Cost 4 vext2 <5,5,0,7>, <5,5,0,7>
+ 2718717377U, // <0,7,5,6>: Cost 3 vext3 <5,6,7,0>, <7,5,6,7>
+ 2729997763U, // <0,7,5,7>: Cost 3 vext3 <7,5,7,0>, <7,5,7,0>
+ 2720044499U, // <0,7,5,u>: Cost 3 vext3 <5,u,7,0>, <7,5,u,7>
+ 3712946517U, // <0,7,6,0>: Cost 4 vext2 <3,6,0,7>, <6,0,7,0>
+ 2256524286U, // <0,7,6,1>: Cost 3 vrev <7,0,1,6>
+ 3792459246U, // <0,7,6,2>: Cost 4 vext3 <5,6,7,0>, <7,6,2,7>
+ 3796440567U, // <0,7,6,3>: Cost 4 vext3 <6,3,7,0>, <7,6,3,7>
+ 3654307126U, // <0,7,6,4>: Cost 4 vext1 <5,0,7,6>, RHS
+ 2656457394U, // <0,7,6,5>: Cost 3 vext2 <6,5,0,7>, <6,5,0,7>
+ 3792459281U, // <0,7,6,6>: Cost 4 vext3 <5,6,7,0>, <7,6,6,6>
+ 2730661396U, // <0,7,6,7>: Cost 3 vext3 <7,6,7,0>, <7,6,7,0>
+ 2658448293U, // <0,7,6,u>: Cost 3 vext2 <6,u,0,7>, <6,u,0,7>
+ 3787003431U, // <0,7,7,0>: Cost 4 vext3 <4,7,5,0>, <7,7,0,1>
+ 3654312854U, // <0,7,7,1>: Cost 4 vext1 <5,0,7,7>, <1,2,3,0>
+ 3654313446U, // <0,7,7,2>: Cost 4 vext1 <5,0,7,7>, <2,0,5,7>
+ 3804771905U, // <0,7,7,3>: Cost 4 vext3 <7,7,3,0>, <7,7,3,0>
+ 3654315318U, // <0,7,7,4>: Cost 4 vext1 <5,0,7,7>, RHS
+ 3654315651U, // <0,7,7,5>: Cost 4 vext1 <5,0,7,7>, <5,0,7,7>
+ 3660288348U, // <0,7,7,6>: Cost 4 vext1 <6,0,7,7>, <6,0,7,7>
+ 2718717548U, // <0,7,7,7>: Cost 3 vext3 <5,6,7,0>, <7,7,7,7>
+ 2664420990U, // <0,7,7,u>: Cost 3 vext2 <7,u,0,7>, <7,u,0,7>
+ 2256466935U, // <0,7,u,0>: Cost 3 vrev <7,0,0,u>
+ 1182798848U, // <0,7,u,1>: Cost 2 vrev <7,0,1,u>
+ 2256614409U, // <0,7,u,2>: Cost 3 vrev <7,0,2,u>
+ 2731693714U, // <0,7,u,3>: Cost 3 vext3 <7,u,3,0>, <7,u,3,0>
+ 2256761883U, // <0,7,u,4>: Cost 3 vrev <7,0,4,u>
+ 2632571034U, // <0,7,u,5>: Cost 3 vext2 <2,5,0,7>, RHS
+ 2669066421U, // <0,7,u,6>: Cost 3 vext2 <u,6,0,7>, <u,6,0,7>
+ 2731988662U, // <0,7,u,7>: Cost 3 vext3 <7,u,7,0>, <7,u,7,0>
+ 1183315007U, // <0,7,u,u>: Cost 2 vrev <7,0,u,u>
+ 135053414U, // <0,u,0,0>: Cost 1 vdup0 LHS
+ 1544896614U, // <0,u,0,1>: Cost 2 vext2 <0,2,0,u>, LHS
+ 1678999654U, // <0,u,0,2>: Cost 2 vuzpl LHS, LHS
+ 2691880677U, // <0,u,0,3>: Cost 3 vext3 <1,2,3,0>, <u,0,3,2>
+ 1476988214U, // <0,u,0,4>: Cost 2 vext1 <0,0,u,0>, RHS
+ 2718791419U, // <0,u,0,5>: Cost 3 vext3 <5,6,u,0>, <u,0,5,6>
+ 3021248666U, // <0,u,0,6>: Cost 3 vtrnl <0,2,0,2>, RHS
+ 2592535607U, // <0,u,0,7>: Cost 3 vext1 <7,0,u,0>, <7,0,u,0>
+ 135053414U, // <0,u,0,u>: Cost 1 vdup0 LHS
+ 1476993097U, // <0,u,1,0>: Cost 2 vext1 <0,0,u,1>, <0,0,u,1>
+ 1812780846U, // <0,u,1,1>: Cost 2 vzipl LHS, LHS
+ 1618138926U, // <0,u,1,2>: Cost 2 vext3 <1,2,3,0>, LHS
+ 2752742134U, // <0,u,1,3>: Cost 3 vuzpl LHS, <1,0,3,2>
+ 1476996406U, // <0,u,1,4>: Cost 2 vext1 <0,0,u,1>, RHS
+ 1812781210U, // <0,u,1,5>: Cost 2 vzipl LHS, RHS
+ 2887006416U, // <0,u,1,6>: Cost 3 vzipl LHS, <u,6,3,7>
+ 2966736200U, // <0,u,1,7>: Cost 3 vzipr <2,3,0,1>, RHS
+ 1812781413U, // <0,u,1,u>: Cost 2 vzipl LHS, LHS
+ 1482973286U, // <0,u,2,0>: Cost 2 vext1 <1,0,u,2>, LHS
+ 1482973987U, // <0,u,2,1>: Cost 2 vext1 <1,0,u,2>, <1,0,u,2>
+ 1946998574U, // <0,u,2,2>: Cost 2 vtrnl LHS, LHS
+ 835584U, // <0,u,2,3>: Cost 0 copy LHS
+ 1482976566U, // <0,u,2,4>: Cost 2 vext1 <1,0,u,2>, RHS
+ 3020781631U, // <0,u,2,5>: Cost 3 vtrnl LHS, <u,4,5,6>
+ 1946998938U, // <0,u,2,6>: Cost 2 vtrnl LHS, RHS
+ 1518810169U, // <0,u,2,7>: Cost 2 vext1 <7,0,u,2>, <7,0,u,2>
+ 835584U, // <0,u,2,u>: Cost 0 copy LHS
+ 2618640534U, // <0,u,3,0>: Cost 3 vext2 <0,2,0,u>, <3,0,1,2>
+ 2752743574U, // <0,u,3,1>: Cost 3 vuzpl LHS, <3,0,1,2>
+ 2636556597U, // <0,u,3,2>: Cost 3 vext2 <3,2,0,u>, <3,2,0,u>
+ 2752743836U, // <0,u,3,3>: Cost 3 vuzpl LHS, <3,3,3,3>
+ 2618640898U, // <0,u,3,4>: Cost 3 vext2 <0,2,0,u>, <3,4,5,6>
+ 2752743938U, // <0,u,3,5>: Cost 3 vuzpl LHS, <3,4,5,6>
+ 2639202936U, // <0,u,3,6>: Cost 3 vext2 <3,6,0,7>, <3,6,0,7>
+ 2639874762U, // <0,u,3,7>: Cost 3 vext2 <3,7,0,u>, <3,7,0,u>
+ 2752743637U, // <0,u,3,u>: Cost 3 vuzpl LHS, <3,0,u,2>
+ 2562703462U, // <0,u,4,0>: Cost 3 vext1 <2,0,u,4>, LHS
+ 2888455982U, // <0,u,4,1>: Cost 3 vzipl <0,4,1,5>, LHS
+ 3021575982U, // <0,u,4,2>: Cost 3 vtrnl <0,2,4,6>, LHS
+ 2568677591U, // <0,u,4,3>: Cost 3 vext1 <3,0,u,4>, <3,0,u,4>
+ 2562706742U, // <0,u,4,4>: Cost 3 vext1 <2,0,u,4>, RHS
+ 1544899894U, // <0,u,4,5>: Cost 2 vext2 <0,2,0,u>, RHS
+ 1679002934U, // <0,u,4,6>: Cost 2 vuzpl LHS, RHS
+ 2718718033U, // <0,u,4,7>: Cost 3 vext3 <5,6,7,0>, <u,4,7,6>
+ 1679002952U, // <0,u,4,u>: Cost 2 vuzpl LHS, RHS
+ 2568683622U, // <0,u,5,0>: Cost 3 vext1 <3,0,u,5>, LHS
+ 2568684438U, // <0,u,5,1>: Cost 3 vext1 <3,0,u,5>, <1,2,3,0>
+ 3765622902U, // <0,u,5,2>: Cost 4 vext3 <1,2,3,0>, <u,5,2,7>
+ 2691881087U, // <0,u,5,3>: Cost 3 vext3 <1,2,3,0>, <u,5,3,7>
+ 2568686902U, // <0,u,5,4>: Cost 3 vext1 <3,0,u,5>, RHS
+ 2650492890U, // <0,u,5,5>: Cost 3 vext2 <5,5,0,u>, <5,5,0,u>
+ 1618139290U, // <0,u,5,6>: Cost 2 vext3 <1,2,3,0>, RHS
+ 2824834358U, // <0,u,5,7>: Cost 3 vuzpr <1,0,3,u>, RHS
+ 1618139308U, // <0,u,5,u>: Cost 2 vext3 <1,2,3,0>, RHS
+ 2592579686U, // <0,u,6,0>: Cost 3 vext1 <7,0,u,6>, LHS
+ 2262496983U, // <0,u,6,1>: Cost 3 vrev <u,0,1,6>
+ 2654474688U, // <0,u,6,2>: Cost 3 vext2 <6,2,0,u>, <6,2,0,u>
+ 2691881168U, // <0,u,6,3>: Cost 3 vext3 <1,2,3,0>, <u,6,3,7>
+ 2592582966U, // <0,u,6,4>: Cost 3 vext1 <7,0,u,6>, RHS
+ 2656465587U, // <0,u,6,5>: Cost 3 vext2 <6,5,0,u>, <6,5,0,u>
+ 2657129220U, // <0,u,6,6>: Cost 3 vext2 <6,6,0,u>, <6,6,0,u>
+ 1584051029U, // <0,u,6,7>: Cost 2 vext2 <6,7,0,u>, <6,7,0,u>
+ 1584714662U, // <0,u,6,u>: Cost 2 vext2 <6,u,0,u>, <6,u,0,u>
+ 2562728038U, // <0,u,7,0>: Cost 3 vext1 <2,0,u,7>, LHS
+ 2562728854U, // <0,u,7,1>: Cost 3 vext1 <2,0,u,7>, <1,2,3,0>
+ 2562729473U, // <0,u,7,2>: Cost 3 vext1 <2,0,u,7>, <2,0,u,7>
+ 2661111018U, // <0,u,7,3>: Cost 3 vext2 <7,3,0,u>, <7,3,0,u>
+ 2562731318U, // <0,u,7,4>: Cost 3 vext1 <2,0,u,7>, RHS
+ 2718718258U, // <0,u,7,5>: Cost 3 vext3 <5,6,7,0>, <u,7,5,6>
+ 2586620261U, // <0,u,7,6>: Cost 3 vext1 <6,0,u,7>, <6,0,u,7>
+ 2657793644U, // <0,u,7,7>: Cost 3 vext2 <6,7,0,u>, <7,7,7,7>
+ 2562733870U, // <0,u,7,u>: Cost 3 vext1 <2,0,u,7>, LHS
+ 135053414U, // <0,u,u,0>: Cost 1 vdup0 LHS
+ 1544902446U, // <0,u,u,1>: Cost 2 vext2 <0,2,0,u>, LHS
+ 1679005486U, // <0,u,u,2>: Cost 2 vuzpl LHS, LHS
+ 835584U, // <0,u,u,3>: Cost 0 copy LHS
+ 1483025718U, // <0,u,u,4>: Cost 2 vext1 <1,0,u,u>, RHS
+ 1544902810U, // <0,u,u,5>: Cost 2 vext2 <0,2,0,u>, RHS
+ 1679005850U, // <0,u,u,6>: Cost 2 vuzpl LHS, RHS
+ 1518859327U, // <0,u,u,7>: Cost 2 vext1 <7,0,u,u>, <7,0,u,u>
+ 835584U, // <0,u,u,u>: Cost 0 copy LHS
+ 2689744896U, // <1,0,0,0>: Cost 3 vext3 <0,u,1,1>, <0,0,0,0>
+ 1610694666U, // <1,0,0,1>: Cost 2 vext3 <0,0,1,1>, <0,0,1,1>
+ 2689744916U, // <1,0,0,2>: Cost 3 vext3 <0,u,1,1>, <0,0,2,2>
+ 2619310332U, // <1,0,0,3>: Cost 3 vext2 <0,3,1,0>, <0,3,1,0>
+ 2684657701U, // <1,0,0,4>: Cost 3 vext3 <0,0,4,1>, <0,0,4,1>
+ 2620637598U, // <1,0,0,5>: Cost 3 vext2 <0,5,1,0>, <0,5,1,0>
+ 3708977654U, // <1,0,0,6>: Cost 4 vext2 <3,0,1,0>, <0,6,1,7>
+ 3666351168U, // <1,0,0,7>: Cost 4 vext1 <7,1,0,0>, <7,1,0,0>
+ 1611210825U, // <1,0,0,u>: Cost 2 vext3 <0,0,u,1>, <0,0,u,1>
+ 2556780646U, // <1,0,1,0>: Cost 3 vext1 <1,1,0,1>, LHS
+ 2556781355U, // <1,0,1,1>: Cost 3 vext1 <1,1,0,1>, <1,1,0,1>
+ 1616003174U, // <1,0,1,2>: Cost 2 vext3 <0,u,1,1>, LHS
+ 3693052888U, // <1,0,1,3>: Cost 4 vext2 <0,3,1,0>, <1,3,1,3>
+ 2556783926U, // <1,0,1,4>: Cost 3 vext1 <1,1,0,1>, RHS
+ 2580672143U, // <1,0,1,5>: Cost 3 vext1 <5,1,0,1>, <5,1,0,1>
+ 2724839566U, // <1,0,1,6>: Cost 3 vext3 <6,7,0,1>, <0,1,6,7>
+ 3654415354U, // <1,0,1,7>: Cost 4 vext1 <5,1,0,1>, <7,0,1,2>
+ 1616003228U, // <1,0,1,u>: Cost 2 vext3 <0,u,1,1>, LHS
+ 2685690019U, // <1,0,2,0>: Cost 3 vext3 <0,2,0,1>, <0,2,0,1>
+ 2685763756U, // <1,0,2,1>: Cost 3 vext3 <0,2,1,1>, <0,2,1,1>
+ 2698297524U, // <1,0,2,2>: Cost 3 vext3 <2,3,0,1>, <0,2,2,0>
+ 2685911230U, // <1,0,2,3>: Cost 3 vext3 <0,2,3,1>, <0,2,3,1>
+ 2689745100U, // <1,0,2,4>: Cost 3 vext3 <0,u,1,1>, <0,2,4,6>
+ 3764814038U, // <1,0,2,5>: Cost 4 vext3 <1,1,1,1>, <0,2,5,7>
+ 2724839640U, // <1,0,2,6>: Cost 3 vext3 <6,7,0,1>, <0,2,6,0>
+ 2592625658U, // <1,0,2,7>: Cost 3 vext1 <7,1,0,2>, <7,0,1,2>
+ 2686279915U, // <1,0,2,u>: Cost 3 vext3 <0,2,u,1>, <0,2,u,1>
+ 3087843328U, // <1,0,3,0>: Cost 3 vtrnr LHS, <0,0,0,0>
+ 3087843338U, // <1,0,3,1>: Cost 3 vtrnr LHS, <0,0,1,1>
+ 67944550U, // <1,0,3,2>: Cost 1 vrev LHS
+ 2568743135U, // <1,0,3,3>: Cost 3 vext1 <3,1,0,3>, <3,1,0,3>
+ 2562772278U, // <1,0,3,4>: Cost 3 vext1 <2,1,0,3>, RHS
+ 4099850454U, // <1,0,3,5>: Cost 4 vtrnl <1,0,3,2>, <0,2,5,7>
+ 3704998538U, // <1,0,3,6>: Cost 4 vext2 <2,3,1,0>, <3,6,2,7>
+ 2592633923U, // <1,0,3,7>: Cost 3 vext1 <7,1,0,3>, <7,1,0,3>
+ 68386972U, // <1,0,3,u>: Cost 1 vrev LHS
+ 2620640146U, // <1,0,4,0>: Cost 3 vext2 <0,5,1,0>, <4,0,5,1>
+ 2689745234U, // <1,0,4,1>: Cost 3 vext3 <0,u,1,1>, <0,4,1,5>
+ 2689745244U, // <1,0,4,2>: Cost 3 vext3 <0,u,1,1>, <0,4,2,6>
+ 3760980320U, // <1,0,4,3>: Cost 4 vext3 <0,4,3,1>, <0,4,3,1>
+ 3761054057U, // <1,0,4,4>: Cost 4 vext3 <0,4,4,1>, <0,4,4,1>
+ 2619313462U, // <1,0,4,5>: Cost 3 vext2 <0,3,1,0>, RHS
+ 3761201531U, // <1,0,4,6>: Cost 4 vext3 <0,4,6,1>, <0,4,6,1>
+ 3666383940U, // <1,0,4,7>: Cost 4 vext1 <7,1,0,4>, <7,1,0,4>
+ 2619313705U, // <1,0,4,u>: Cost 3 vext2 <0,3,1,0>, RHS
+ 4029300736U, // <1,0,5,0>: Cost 4 vzipr <0,4,1,5>, <0,0,0,0>
+ 2895249510U, // <1,0,5,1>: Cost 3 vzipl <1,5,3,7>, LHS
+ 3028287590U, // <1,0,5,2>: Cost 3 vtrnl <1,3,5,7>, LHS
+ 3642501345U, // <1,0,5,3>: Cost 4 vext1 <3,1,0,5>, <3,1,0,5>
+ 2215592058U, // <1,0,5,4>: Cost 3 vrev <0,1,4,5>
+ 3724242907U, // <1,0,5,5>: Cost 4 vext2 <5,5,1,0>, <5,5,1,0>
+ 3724906540U, // <1,0,5,6>: Cost 4 vext2 <5,6,1,0>, <5,6,1,0>
+ 3911118134U, // <1,0,5,7>: Cost 4 vuzpr <3,1,3,0>, RHS
+ 3028287644U, // <1,0,5,u>: Cost 3 vtrnl <1,3,5,7>, LHS
+ 3762086375U, // <1,0,6,0>: Cost 4 vext3 <0,6,0,1>, <0,6,0,1>
+ 2698297846U, // <1,0,6,1>: Cost 3 vext3 <2,3,0,1>, <0,6,1,7>
+ 3760022015U, // <1,0,6,2>: Cost 4 vext3 <0,2,u,1>, <0,6,2,7>
+ 3642509538U, // <1,0,6,3>: Cost 4 vext1 <3,1,0,6>, <3,1,0,6>
+ 3762381323U, // <1,0,6,4>: Cost 4 vext3 <0,6,4,1>, <0,6,4,1>
+ 3730215604U, // <1,0,6,5>: Cost 4 vext2 <6,5,1,0>, <6,5,1,0>
+ 3730879237U, // <1,0,6,6>: Cost 4 vext2 <6,6,1,0>, <6,6,1,0>
+ 2657801046U, // <1,0,6,7>: Cost 3 vext2 <6,7,1,0>, <6,7,1,0>
+ 2658464679U, // <1,0,6,u>: Cost 3 vext2 <6,u,1,0>, <6,u,1,0>
+ 2659128312U, // <1,0,7,0>: Cost 3 vext2 <7,0,1,0>, <7,0,1,0>
+ 4047898278U, // <1,0,7,1>: Cost 4 vzipr <3,5,1,7>, <2,3,0,1>
+ 2215460970U, // <1,0,7,2>: Cost 3 vrev <0,1,2,7>
+ 3734861035U, // <1,0,7,3>: Cost 4 vext2 <7,3,1,0>, <7,3,1,0>
+ 3731543398U, // <1,0,7,4>: Cost 4 vext2 <6,7,1,0>, <7,4,5,6>
+ 3736188301U, // <1,0,7,5>: Cost 4 vext2 <7,5,1,0>, <7,5,1,0>
+ 2663110110U, // <1,0,7,6>: Cost 3 vext2 <7,6,1,0>, <7,6,1,0>
+ 3731543660U, // <1,0,7,7>: Cost 4 vext2 <6,7,1,0>, <7,7,7,7>
+ 2664437376U, // <1,0,7,u>: Cost 3 vext2 <7,u,1,0>, <7,u,1,0>
+ 3087884288U, // <1,0,u,0>: Cost 3 vtrnr LHS, <0,0,0,0>
+ 1616003730U, // <1,0,u,1>: Cost 2 vext3 <0,u,1,1>, <0,u,1,1>
+ 67985515U, // <1,0,u,2>: Cost 1 vrev LHS
+ 2689893028U, // <1,0,u,3>: Cost 3 vext3 <0,u,3,1>, <0,u,3,1>
+ 2689745586U, // <1,0,u,4>: Cost 3 vext3 <0,u,1,1>, <0,u,4,6>
+ 2619316378U, // <1,0,u,5>: Cost 3 vext2 <0,3,1,0>, RHS
+ 2669082807U, // <1,0,u,6>: Cost 3 vext2 <u,6,1,0>, <u,6,1,0>
+ 2592674888U, // <1,0,u,7>: Cost 3 vext1 <7,1,0,u>, <7,1,0,u>
+ 68427937U, // <1,0,u,u>: Cost 1 vrev LHS
+ 1543585802U, // <1,1,0,0>: Cost 2 vext2 <0,0,1,1>, <0,0,1,1>
+ 1548894310U, // <1,1,0,1>: Cost 2 vext2 <0,u,1,1>, LHS
+ 2618654892U, // <1,1,0,2>: Cost 3 vext2 <0,2,1,1>, <0,2,1,1>
+ 2689745654U, // <1,1,0,3>: Cost 3 vext3 <0,u,1,1>, <1,0,3,2>
+ 2622636370U, // <1,1,0,4>: Cost 3 vext2 <0,u,1,1>, <0,4,1,5>
+ 2620645791U, // <1,1,0,5>: Cost 3 vext2 <0,5,1,1>, <0,5,1,1>
+ 3696378367U, // <1,1,0,6>: Cost 4 vext2 <0,u,1,1>, <0,6,2,7>
+ 3666424905U, // <1,1,0,7>: Cost 4 vext1 <7,1,1,0>, <7,1,1,0>
+ 1548894866U, // <1,1,0,u>: Cost 2 vext2 <0,u,1,1>, <0,u,1,1>
+ 1483112550U, // <1,1,1,0>: Cost 2 vext1 <1,1,1,1>, LHS
+ 202162278U, // <1,1,1,1>: Cost 1 vdup1 LHS
+ 2622636950U, // <1,1,1,2>: Cost 3 vext2 <0,u,1,1>, <1,2,3,0>
+ 2622637016U, // <1,1,1,3>: Cost 3 vext2 <0,u,1,1>, <1,3,1,3>
+ 1483115830U, // <1,1,1,4>: Cost 2 vext1 <1,1,1,1>, RHS
+ 2622637200U, // <1,1,1,5>: Cost 3 vext2 <0,u,1,1>, <1,5,3,7>
+ 2622637263U, // <1,1,1,6>: Cost 3 vext2 <0,u,1,1>, <1,6,1,7>
+ 2592691274U, // <1,1,1,7>: Cost 3 vext1 <7,1,1,1>, <7,1,1,1>
+ 202162278U, // <1,1,1,u>: Cost 1 vdup1 LHS
+ 2550890588U, // <1,1,2,0>: Cost 3 vext1 <0,1,1,2>, <0,1,1,2>
+ 2617329183U, // <1,1,2,1>: Cost 3 vext2 <0,0,1,1>, <2,1,3,1>
+ 2622637672U, // <1,1,2,2>: Cost 3 vext2 <0,u,1,1>, <2,2,2,2>
+ 2622637734U, // <1,1,2,3>: Cost 3 vext2 <0,u,1,1>, <2,3,0,1>
+ 2550893878U, // <1,1,2,4>: Cost 3 vext1 <0,1,1,2>, RHS
+ 3696379744U, // <1,1,2,5>: Cost 4 vext2 <0,u,1,1>, <2,5,2,7>
+ 2622638010U, // <1,1,2,6>: Cost 3 vext2 <0,u,1,1>, <2,6,3,7>
+ 3804554170U, // <1,1,2,7>: Cost 4 vext3 <7,7,0,1>, <1,2,7,0>
+ 2622638139U, // <1,1,2,u>: Cost 3 vext2 <0,u,1,1>, <2,u,0,1>
+ 2622638230U, // <1,1,3,0>: Cost 3 vext2 <0,u,1,1>, <3,0,1,2>
+ 3087844148U, // <1,1,3,1>: Cost 3 vtrnr LHS, <1,1,1,1>
+ 4161585244U, // <1,1,3,2>: Cost 4 vtrnr LHS, <0,1,1,2>
+ 2014101606U, // <1,1,3,3>: Cost 2 vtrnr LHS, LHS
+ 2622638594U, // <1,1,3,4>: Cost 3 vext2 <0,u,1,1>, <3,4,5,6>
+ 2689745920U, // <1,1,3,5>: Cost 3 vext3 <0,u,1,1>, <1,3,5,7>
+ 3763487753U, // <1,1,3,6>: Cost 4 vext3 <0,u,1,1>, <1,3,6,7>
+ 2592707660U, // <1,1,3,7>: Cost 3 vext1 <7,1,1,3>, <7,1,1,3>
+ 2014101611U, // <1,1,3,u>: Cost 2 vtrnr LHS, LHS
+ 2556878950U, // <1,1,4,0>: Cost 3 vext1 <1,1,1,4>, LHS
+ 2221335351U, // <1,1,4,1>: Cost 3 vrev <1,1,1,4>
+ 3696380988U, // <1,1,4,2>: Cost 4 vext2 <0,u,1,1>, <4,2,6,0>
+ 3763487805U, // <1,1,4,3>: Cost 4 vext3 <0,u,1,1>, <1,4,3,5>
+ 2556882230U, // <1,1,4,4>: Cost 3 vext1 <1,1,1,4>, RHS
+ 1548897590U, // <1,1,4,5>: Cost 2 vext2 <0,u,1,1>, RHS
+ 2758184246U, // <1,1,4,6>: Cost 3 vuzpl <1,1,1,1>, RHS
+ 3666457677U, // <1,1,4,7>: Cost 4 vext1 <7,1,1,4>, <7,1,1,4>
+ 1548897833U, // <1,1,4,u>: Cost 2 vext2 <0,u,1,1>, RHS
+ 2693653615U, // <1,1,5,0>: Cost 3 vext3 <1,5,0,1>, <1,5,0,1>
+ 2617331408U, // <1,1,5,1>: Cost 3 vext2 <0,0,1,1>, <5,1,7,3>
+ 4029302934U, // <1,1,5,2>: Cost 4 vzipr <0,4,1,5>, <3,0,1,2>
+ 2689746064U, // <1,1,5,3>: Cost 3 vext3 <0,u,1,1>, <1,5,3,7>
+ 2221564755U, // <1,1,5,4>: Cost 3 vrev <1,1,4,5>
+ 2955559250U, // <1,1,5,5>: Cost 3 vzipr <0,4,1,5>, <0,4,1,5>
+ 2617331810U, // <1,1,5,6>: Cost 3 vext2 <0,0,1,1>, <5,6,7,0>
+ 2825293110U, // <1,1,5,7>: Cost 3 vuzpr <1,1,1,1>, RHS
+ 2689746109U, // <1,1,5,u>: Cost 3 vext3 <0,u,1,1>, <1,5,u,7>
+ 3696382241U, // <1,1,6,0>: Cost 4 vext2 <0,u,1,1>, <6,0,1,2>
+ 2689746127U, // <1,1,6,1>: Cost 3 vext3 <0,u,1,1>, <1,6,1,7>
+ 2617332218U, // <1,1,6,2>: Cost 3 vext2 <0,0,1,1>, <6,2,7,3>
+ 3763487969U, // <1,1,6,3>: Cost 4 vext3 <0,u,1,1>, <1,6,3,7>
+ 3696382605U, // <1,1,6,4>: Cost 4 vext2 <0,u,1,1>, <6,4,5,6>
+ 4029309266U, // <1,1,6,5>: Cost 4 vzipr <0,4,1,6>, <0,4,1,5>
+ 2617332536U, // <1,1,6,6>: Cost 3 vext2 <0,0,1,1>, <6,6,6,6>
+ 2724840702U, // <1,1,6,7>: Cost 3 vext3 <6,7,0,1>, <1,6,7,0>
+ 2725504263U, // <1,1,6,u>: Cost 3 vext3 <6,u,0,1>, <1,6,u,0>
+ 2617332720U, // <1,1,7,0>: Cost 3 vext2 <0,0,1,1>, <7,0,0,1>
+ 2659800138U, // <1,1,7,1>: Cost 3 vext2 <7,1,1,1>, <7,1,1,1>
+ 3691074717U, // <1,1,7,2>: Cost 4 vext2 <0,0,1,1>, <7,2,1,3>
+ 4167811174U, // <1,1,7,3>: Cost 4 vtrnr <1,1,5,7>, LHS
+ 2617333094U, // <1,1,7,4>: Cost 3 vext2 <0,0,1,1>, <7,4,5,6>
+ 3295396702U, // <1,1,7,5>: Cost 4 vrev <1,1,5,7>
+ 3803891014U, // <1,1,7,6>: Cost 4 vext3 <7,6,0,1>, <1,7,6,0>
+ 2617333356U, // <1,1,7,7>: Cost 3 vext2 <0,0,1,1>, <7,7,7,7>
+ 2659800138U, // <1,1,7,u>: Cost 3 vext2 <7,1,1,1>, <7,1,1,1>
+ 1483112550U, // <1,1,u,0>: Cost 2 vext1 <1,1,1,1>, LHS
+ 202162278U, // <1,1,u,1>: Cost 1 vdup1 LHS
+ 2622642056U, // <1,1,u,2>: Cost 3 vext2 <0,u,1,1>, <u,2,3,3>
+ 2014142566U, // <1,1,u,3>: Cost 2 vtrnr LHS, LHS
+ 1483115830U, // <1,1,u,4>: Cost 2 vext1 <1,1,1,1>, RHS
+ 1548900506U, // <1,1,u,5>: Cost 2 vext2 <0,u,1,1>, RHS
+ 2622642384U, // <1,1,u,6>: Cost 3 vext2 <0,u,1,1>, <u,6,3,7>
+ 2825293353U, // <1,1,u,7>: Cost 3 vuzpr <1,1,1,1>, RHS
+ 202162278U, // <1,1,u,u>: Cost 1 vdup1 LHS
+ 2635251712U, // <1,2,0,0>: Cost 3 vext2 <3,0,1,2>, <0,0,0,0>
+ 1561509990U, // <1,2,0,1>: Cost 2 vext2 <3,0,1,2>, LHS
+ 2618663085U, // <1,2,0,2>: Cost 3 vext2 <0,2,1,2>, <0,2,1,2>
+ 2696529358U, // <1,2,0,3>: Cost 3 vext3 <2,0,3,1>, <2,0,3,1>
+ 2635252050U, // <1,2,0,4>: Cost 3 vext2 <3,0,1,2>, <0,4,1,5>
+ 3769533926U, // <1,2,0,5>: Cost 4 vext3 <1,u,2,1>, <2,0,5,7>
+ 2621317617U, // <1,2,0,6>: Cost 3 vext2 <0,6,1,2>, <0,6,1,2>
+ 2659140170U, // <1,2,0,7>: Cost 3 vext2 <7,0,1,2>, <0,7,2,1>
+ 1561510557U, // <1,2,0,u>: Cost 2 vext2 <3,0,1,2>, LHS
+ 2623308516U, // <1,2,1,0>: Cost 3 vext2 <1,0,1,2>, <1,0,1,2>
+ 2635252532U, // <1,2,1,1>: Cost 3 vext2 <3,0,1,2>, <1,1,1,1>
+ 2631271318U, // <1,2,1,2>: Cost 3 vext2 <2,3,1,2>, <1,2,3,0>
+ 2958180454U, // <1,2,1,3>: Cost 3 vzipr <0,u,1,1>, LHS
+ 2550959414U, // <1,2,1,4>: Cost 3 vext1 <0,1,2,1>, RHS
+ 2635252880U, // <1,2,1,5>: Cost 3 vext2 <3,0,1,2>, <1,5,3,7>
+ 2635252952U, // <1,2,1,6>: Cost 3 vext2 <3,0,1,2>, <1,6,2,7>
+ 3732882731U, // <1,2,1,7>: Cost 4 vext2 <7,0,1,2>, <1,7,3,0>
+ 2958180459U, // <1,2,1,u>: Cost 3 vzipr <0,u,1,1>, LHS
+ 2629281213U, // <1,2,2,0>: Cost 3 vext2 <2,0,1,2>, <2,0,1,2>
+ 2635253280U, // <1,2,2,1>: Cost 3 vext2 <3,0,1,2>, <2,1,3,2>
+ 2618664552U, // <1,2,2,2>: Cost 3 vext2 <0,2,1,2>, <2,2,2,2>
+ 2689746546U, // <1,2,2,3>: Cost 3 vext3 <0,u,1,1>, <2,2,3,3>
+ 3764815485U, // <1,2,2,4>: Cost 4 vext3 <1,1,1,1>, <2,2,4,5>
+ 3760023176U, // <1,2,2,5>: Cost 4 vext3 <0,2,u,1>, <2,2,5,7>
+ 2635253690U, // <1,2,2,6>: Cost 3 vext2 <3,0,1,2>, <2,6,3,7>
+ 2659141610U, // <1,2,2,7>: Cost 3 vext2 <7,0,1,2>, <2,7,0,1>
+ 2689746591U, // <1,2,2,u>: Cost 3 vext3 <0,u,1,1>, <2,2,u,3>
+ 403488870U, // <1,2,3,0>: Cost 1 vext1 LHS, LHS
+ 1477231350U, // <1,2,3,1>: Cost 2 vext1 LHS, <1,0,3,2>
+ 1477232232U, // <1,2,3,2>: Cost 2 vext1 LHS, <2,2,2,2>
+ 1477233052U, // <1,2,3,3>: Cost 2 vext1 LHS, <3,3,3,3>
+ 403492150U, // <1,2,3,4>: Cost 1 vext1 LHS, RHS
+ 1525010128U, // <1,2,3,5>: Cost 2 vext1 LHS, <5,1,7,3>
+ 1525010938U, // <1,2,3,6>: Cost 2 vext1 LHS, <6,2,7,3>
+ 1525011450U, // <1,2,3,7>: Cost 2 vext1 LHS, <7,0,1,2>
+ 403494702U, // <1,2,3,u>: Cost 1 vext1 LHS, LHS
+ 2641226607U, // <1,2,4,0>: Cost 3 vext2 <4,0,1,2>, <4,0,1,2>
+ 3624723446U, // <1,2,4,1>: Cost 4 vext1 <0,1,2,4>, <1,3,4,6>
+ 3301123609U, // <1,2,4,2>: Cost 4 vrev <2,1,2,4>
+ 2598759198U, // <1,2,4,3>: Cost 3 vext1 <u,1,2,4>, <3,u,1,2>
+ 2659142864U, // <1,2,4,4>: Cost 3 vext2 <7,0,1,2>, <4,4,4,4>
+ 1561513270U, // <1,2,4,5>: Cost 2 vext2 <3,0,1,2>, RHS
+ 2659143028U, // <1,2,4,6>: Cost 3 vext2 <7,0,1,2>, <4,6,4,6>
+ 2659143112U, // <1,2,4,7>: Cost 3 vext2 <7,0,1,2>, <4,7,5,0>
+ 1561513513U, // <1,2,4,u>: Cost 2 vext2 <3,0,1,2>, RHS
+ 2550988902U, // <1,2,5,0>: Cost 3 vext1 <0,1,2,5>, LHS
+ 2550989824U, // <1,2,5,1>: Cost 3 vext1 <0,1,2,5>, <1,3,5,7>
+ 3624732264U, // <1,2,5,2>: Cost 4 vext1 <0,1,2,5>, <2,2,2,2>
+ 2955559014U, // <1,2,5,3>: Cost 3 vzipr <0,4,1,5>, LHS
+ 2550992182U, // <1,2,5,4>: Cost 3 vext1 <0,1,2,5>, RHS
+ 2659143684U, // <1,2,5,5>: Cost 3 vext2 <7,0,1,2>, <5,5,5,5>
+ 2659143778U, // <1,2,5,6>: Cost 3 vext2 <7,0,1,2>, <5,6,7,0>
+ 2659143848U, // <1,2,5,7>: Cost 3 vext2 <7,0,1,2>, <5,7,5,7>
+ 2550994734U, // <1,2,5,u>: Cost 3 vext1 <0,1,2,5>, LHS
+ 2700289945U, // <1,2,6,0>: Cost 3 vext3 <2,6,0,1>, <2,6,0,1>
+ 2635256232U, // <1,2,6,1>: Cost 3 vext2 <3,0,1,2>, <6,1,7,2>
+ 2659144186U, // <1,2,6,2>: Cost 3 vext2 <7,0,1,2>, <6,2,7,3>
+ 2689746874U, // <1,2,6,3>: Cost 3 vext3 <0,u,1,1>, <2,6,3,7>
+ 3763488705U, // <1,2,6,4>: Cost 4 vext3 <0,u,1,1>, <2,6,4,5>
+ 3763488716U, // <1,2,6,5>: Cost 4 vext3 <0,u,1,1>, <2,6,5,7>
+ 2659144504U, // <1,2,6,6>: Cost 3 vext2 <7,0,1,2>, <6,6,6,6>
+ 2657817432U, // <1,2,6,7>: Cost 3 vext2 <6,7,1,2>, <6,7,1,2>
+ 2689746919U, // <1,2,6,u>: Cost 3 vext3 <0,u,1,1>, <2,6,u,7>
+ 1585402874U, // <1,2,7,0>: Cost 2 vext2 <7,0,1,2>, <7,0,1,2>
+ 2659144770U, // <1,2,7,1>: Cost 3 vext2 <7,0,1,2>, <7,1,0,2>
+ 3708998858U, // <1,2,7,2>: Cost 4 vext2 <3,0,1,2>, <7,2,6,3>
+ 2635257059U, // <1,2,7,3>: Cost 3 vext2 <3,0,1,2>, <7,3,0,1>
+ 2659145062U, // <1,2,7,4>: Cost 3 vext2 <7,0,1,2>, <7,4,5,6>
+ 3732886916U, // <1,2,7,5>: Cost 4 vext2 <7,0,1,2>, <7,5,0,0>
+ 3732886998U, // <1,2,7,6>: Cost 4 vext2 <7,0,1,2>, <7,6,0,1>
+ 2659145255U, // <1,2,7,7>: Cost 3 vext2 <7,0,1,2>, <7,7,0,1>
+ 1590711938U, // <1,2,7,u>: Cost 2 vext2 <7,u,1,2>, <7,u,1,2>
+ 403529835U, // <1,2,u,0>: Cost 1 vext1 LHS, LHS
+ 1477272310U, // <1,2,u,1>: Cost 2 vext1 LHS, <1,0,3,2>
+ 1477273192U, // <1,2,u,2>: Cost 2 vext1 LHS, <2,2,2,2>
+ 1477273750U, // <1,2,u,3>: Cost 2 vext1 LHS, <3,0,1,2>
+ 403533110U, // <1,2,u,4>: Cost 1 vext1 LHS, RHS
+ 1561516186U, // <1,2,u,5>: Cost 2 vext2 <3,0,1,2>, RHS
+ 1525051898U, // <1,2,u,6>: Cost 2 vext1 LHS, <6,2,7,3>
+ 1525052410U, // <1,2,u,7>: Cost 2 vext1 LHS, <7,0,1,2>
+ 403535662U, // <1,2,u,u>: Cost 1 vext1 LHS, LHS
+ 2819407872U, // <1,3,0,0>: Cost 3 vuzpr LHS, <0,0,0,0>
+ 1551564902U, // <1,3,0,1>: Cost 2 vext2 <1,3,1,3>, LHS
+ 2819408630U, // <1,3,0,2>: Cost 3 vuzpr LHS, <1,0,3,2>
+ 2619334911U, // <1,3,0,3>: Cost 3 vext2 <0,3,1,3>, <0,3,1,3>
+ 2625306962U, // <1,3,0,4>: Cost 3 vext2 <1,3,1,3>, <0,4,1,5>
+ 3832725879U, // <1,3,0,5>: Cost 4 vuzpl <1,2,3,0>, <0,4,5,6>
+ 3699048959U, // <1,3,0,6>: Cost 4 vext2 <1,3,1,3>, <0,6,2,7>
+ 3776538827U, // <1,3,0,7>: Cost 4 vext3 <3,0,7,1>, <3,0,7,1>
+ 1551565469U, // <1,3,0,u>: Cost 2 vext2 <1,3,1,3>, LHS
+ 2618671862U, // <1,3,1,0>: Cost 3 vext2 <0,2,1,3>, <1,0,3,2>
+ 2819408692U, // <1,3,1,1>: Cost 3 vuzpr LHS, <1,1,1,1>
+ 2624643975U, // <1,3,1,2>: Cost 3 vext2 <1,2,1,3>, <1,2,1,3>
+ 1745666150U, // <1,3,1,3>: Cost 2 vuzpr LHS, LHS
+ 2557005110U, // <1,3,1,4>: Cost 3 vext1 <1,1,3,1>, RHS
+ 2625307792U, // <1,3,1,5>: Cost 3 vext2 <1,3,1,3>, <1,5,3,7>
+ 3698386127U, // <1,3,1,6>: Cost 4 vext2 <1,2,1,3>, <1,6,1,7>
+ 2592838748U, // <1,3,1,7>: Cost 3 vext1 <7,1,3,1>, <7,1,3,1>
+ 1745666155U, // <1,3,1,u>: Cost 2 vuzpr LHS, LHS
+ 2819408790U, // <1,3,2,0>: Cost 3 vuzpr LHS, <1,2,3,0>
+ 2625308193U, // <1,3,2,1>: Cost 3 vext2 <1,3,1,3>, <2,1,3,3>
+ 2819408036U, // <1,3,2,2>: Cost 3 vuzpr LHS, <0,2,0,2>
+ 2819851890U, // <1,3,2,3>: Cost 3 vuzpr LHS, <2,2,3,3>
+ 2819408794U, // <1,3,2,4>: Cost 3 vuzpr LHS, <1,2,3,4>
+ 3893149890U, // <1,3,2,5>: Cost 4 vuzpr LHS, <0,2,3,5>
+ 2819408076U, // <1,3,2,6>: Cost 3 vuzpr LHS, <0,2,4,6>
+ 3772041583U, // <1,3,2,7>: Cost 4 vext3 <2,3,0,1>, <3,2,7,3>
+ 2819408042U, // <1,3,2,u>: Cost 3 vuzpr LHS, <0,2,0,u>
+ 1483276390U, // <1,3,3,0>: Cost 2 vext1 <1,1,3,3>, LHS
+ 1483277128U, // <1,3,3,1>: Cost 2 vext1 <1,1,3,3>, <1,1,3,3>
+ 2557019752U, // <1,3,3,2>: Cost 3 vext1 <1,1,3,3>, <2,2,2,2>
+ 2819408856U, // <1,3,3,3>: Cost 3 vuzpr LHS, <1,3,1,3>
+ 1483279670U, // <1,3,3,4>: Cost 2 vext1 <1,1,3,3>, RHS
+ 2819409614U, // <1,3,3,5>: Cost 3 vuzpr LHS, <2,3,4,5>
+ 2598826490U, // <1,3,3,6>: Cost 3 vext1 <u,1,3,3>, <6,2,7,3>
+ 3087844352U, // <1,3,3,7>: Cost 3 vtrnr LHS, <1,3,5,7>
+ 1483282222U, // <1,3,3,u>: Cost 2 vext1 <1,1,3,3>, LHS
+ 2568970342U, // <1,3,4,0>: Cost 3 vext1 <3,1,3,4>, LHS
+ 2568971224U, // <1,3,4,1>: Cost 3 vext1 <3,1,3,4>, <1,3,1,3>
+ 3832761290U, // <1,3,4,2>: Cost 4 vuzpl <1,2,3,4>, <4,1,2,3>
+ 2233428219U, // <1,3,4,3>: Cost 3 vrev <3,1,3,4>
+ 2568973622U, // <1,3,4,4>: Cost 3 vext1 <3,1,3,4>, RHS
+ 1551568182U, // <1,3,4,5>: Cost 2 vext2 <1,3,1,3>, RHS
+ 2819410434U, // <1,3,4,6>: Cost 3 vuzpr LHS, <3,4,5,6>
+ 3666605151U, // <1,3,4,7>: Cost 4 vext1 <7,1,3,4>, <7,1,3,4>
+ 1551568425U, // <1,3,4,u>: Cost 2 vext2 <1,3,1,3>, RHS
+ 2563006566U, // <1,3,5,0>: Cost 3 vext1 <2,1,3,5>, LHS
+ 2568979456U, // <1,3,5,1>: Cost 3 vext1 <3,1,3,5>, <1,3,5,7>
+ 2563008035U, // <1,3,5,2>: Cost 3 vext1 <2,1,3,5>, <2,1,3,5>
+ 2233436412U, // <1,3,5,3>: Cost 3 vrev <3,1,3,5>
+ 2563009846U, // <1,3,5,4>: Cost 3 vext1 <2,1,3,5>, RHS
+ 2867187716U, // <1,3,5,5>: Cost 3 vuzpr LHS, <5,5,5,5>
+ 2655834214U, // <1,3,5,6>: Cost 3 vext2 <6,4,1,3>, <5,6,7,4>
+ 1745669430U, // <1,3,5,7>: Cost 2 vuzpr LHS, RHS
+ 1745669431U, // <1,3,5,u>: Cost 2 vuzpr LHS, RHS
+ 2867187810U, // <1,3,6,0>: Cost 3 vuzpr LHS, <5,6,7,0>
+ 3699052931U, // <1,3,6,1>: Cost 4 vext2 <1,3,1,3>, <6,1,3,1>
+ 2654507460U, // <1,3,6,2>: Cost 3 vext2 <6,2,1,3>, <6,2,1,3>
+ 3766291091U, // <1,3,6,3>: Cost 4 vext3 <1,3,3,1>, <3,6,3,7>
+ 2655834726U, // <1,3,6,4>: Cost 3 vext2 <6,4,1,3>, <6,4,1,3>
+ 3923384562U, // <1,3,6,5>: Cost 4 vuzpr <5,1,7,3>, <u,6,7,5>
+ 2657161992U, // <1,3,6,6>: Cost 3 vext2 <6,6,1,3>, <6,6,1,3>
+ 2819852218U, // <1,3,6,7>: Cost 3 vuzpr LHS, <2,6,3,7>
+ 2819852219U, // <1,3,6,u>: Cost 3 vuzpr LHS, <2,6,3,u>
+ 2706926275U, // <1,3,7,0>: Cost 3 vext3 <3,7,0,1>, <3,7,0,1>
+ 2659816524U, // <1,3,7,1>: Cost 3 vext2 <7,1,1,3>, <7,1,1,3>
+ 3636766245U, // <1,3,7,2>: Cost 4 vext1 <2,1,3,7>, <2,1,3,7>
+ 2867187903U, // <1,3,7,3>: Cost 3 vuzpr LHS, <5,7,u,3>
+ 2625312102U, // <1,3,7,4>: Cost 3 vext2 <1,3,1,3>, <7,4,5,6>
+ 2867188598U, // <1,3,7,5>: Cost 3 vuzpr LHS, <6,7,4,5>
+ 3728250344U, // <1,3,7,6>: Cost 4 vext2 <6,2,1,3>, <7,6,2,1>
+ 2867187880U, // <1,3,7,7>: Cost 3 vuzpr LHS, <5,7,5,7>
+ 2707516171U, // <1,3,7,u>: Cost 3 vext3 <3,7,u,1>, <3,7,u,1>
+ 1483317350U, // <1,3,u,0>: Cost 2 vext1 <1,1,3,u>, LHS
+ 1483318093U, // <1,3,u,1>: Cost 2 vext1 <1,1,3,u>, <1,1,3,u>
+ 2819410718U, // <1,3,u,2>: Cost 3 vuzpr LHS, <3,u,1,2>
+ 1745666717U, // <1,3,u,3>: Cost 2 vuzpr LHS, LHS
+ 1483320630U, // <1,3,u,4>: Cost 2 vext1 <1,1,3,u>, RHS
+ 1551571098U, // <1,3,u,5>: Cost 2 vext2 <1,3,1,3>, RHS
+ 2819410758U, // <1,3,u,6>: Cost 3 vuzpr LHS, <3,u,5,6>
+ 1745669673U, // <1,3,u,7>: Cost 2 vuzpr LHS, RHS
+ 1745666722U, // <1,3,u,u>: Cost 2 vuzpr LHS, LHS
+ 2617352205U, // <1,4,0,0>: Cost 3 vext2 <0,0,1,4>, <0,0,1,4>
+ 2619342950U, // <1,4,0,1>: Cost 3 vext2 <0,3,1,4>, LHS
+ 3692421295U, // <1,4,0,2>: Cost 4 vext2 <0,2,1,4>, <0,2,1,4>
+ 2619343104U, // <1,4,0,3>: Cost 3 vext2 <0,3,1,4>, <0,3,1,4>
+ 2617352530U, // <1,4,0,4>: Cost 3 vext2 <0,0,1,4>, <0,4,1,5>
+ 1634880402U, // <1,4,0,5>: Cost 2 vext3 <4,0,5,1>, <4,0,5,1>
+ 2713930652U, // <1,4,0,6>: Cost 3 vext3 <4,u,5,1>, <4,0,6,2>
+ 3732898396U, // <1,4,0,7>: Cost 4 vext2 <7,0,1,4>, <0,7,4,1>
+ 1635101613U, // <1,4,0,u>: Cost 2 vext3 <4,0,u,1>, <4,0,u,1>
+ 3693085430U, // <1,4,1,0>: Cost 4 vext2 <0,3,1,4>, <1,0,3,2>
+ 2623988535U, // <1,4,1,1>: Cost 3 vext2 <1,1,1,4>, <1,1,1,4>
+ 3693085590U, // <1,4,1,2>: Cost 4 vext2 <0,3,1,4>, <1,2,3,0>
+ 3692422134U, // <1,4,1,3>: Cost 4 vext2 <0,2,1,4>, <1,3,4,6>
+ 3693085726U, // <1,4,1,4>: Cost 4 vext2 <0,3,1,4>, <1,4,0,1>
+ 2892401974U, // <1,4,1,5>: Cost 3 vzipl <1,1,1,1>, RHS
+ 3026619702U, // <1,4,1,6>: Cost 3 vtrnl <1,1,1,1>, RHS
+ 3800206324U, // <1,4,1,7>: Cost 4 vext3 <7,0,4,1>, <4,1,7,0>
+ 2892402217U, // <1,4,1,u>: Cost 3 vzipl <1,1,1,1>, RHS
+ 3966978927U, // <1,4,2,0>: Cost 4 vzipl <1,2,3,4>, <4,0,1,2>
+ 3966979018U, // <1,4,2,1>: Cost 4 vzipl <1,2,3,4>, <4,1,2,3>
+ 3693086312U, // <1,4,2,2>: Cost 4 vext2 <0,3,1,4>, <2,2,2,2>
+ 2635269798U, // <1,4,2,3>: Cost 3 vext2 <3,0,1,4>, <2,3,0,1>
+ 3966979280U, // <1,4,2,4>: Cost 4 vzipl <1,2,3,4>, <4,4,4,4>
+ 2893204790U, // <1,4,2,5>: Cost 3 vzipl <1,2,3,0>, RHS
+ 3693086650U, // <1,4,2,6>: Cost 4 vext2 <0,3,1,4>, <2,6,3,7>
+ 3666662502U, // <1,4,2,7>: Cost 4 vext1 <7,1,4,2>, <7,1,4,2>
+ 2893205033U, // <1,4,2,u>: Cost 3 vzipl <1,2,3,0>, RHS
+ 2563063910U, // <1,4,3,0>: Cost 3 vext1 <2,1,4,3>, LHS
+ 2563064730U, // <1,4,3,1>: Cost 3 vext1 <2,1,4,3>, <1,2,3,4>
+ 2563065386U, // <1,4,3,2>: Cost 3 vext1 <2,1,4,3>, <2,1,4,3>
+ 3693087132U, // <1,4,3,3>: Cost 4 vext2 <0,3,1,4>, <3,3,3,3>
+ 2619345410U, // <1,4,3,4>: Cost 3 vext2 <0,3,1,4>, <3,4,5,6>
+ 3087843666U, // <1,4,3,5>: Cost 3 vtrnr LHS, <0,4,1,5>
+ 3087843676U, // <1,4,3,6>: Cost 3 vtrnr LHS, <0,4,2,6>
+ 3666670695U, // <1,4,3,7>: Cost 4 vext1 <7,1,4,3>, <7,1,4,3>
+ 3087843669U, // <1,4,3,u>: Cost 3 vtrnr LHS, <0,4,1,u>
+ 2620672914U, // <1,4,4,0>: Cost 3 vext2 <0,5,1,4>, <4,0,5,1>
+ 3630842706U, // <1,4,4,1>: Cost 4 vext1 <1,1,4,4>, <1,1,4,4>
+ 3313069003U, // <1,4,4,2>: Cost 4 vrev <4,1,2,4>
+ 3642788100U, // <1,4,4,3>: Cost 4 vext1 <3,1,4,4>, <3,1,4,4>
+ 2713930960U, // <1,4,4,4>: Cost 3 vext3 <4,u,5,1>, <4,4,4,4>
+ 2619346230U, // <1,4,4,5>: Cost 3 vext2 <0,3,1,4>, RHS
+ 2713930980U, // <1,4,4,6>: Cost 3 vext3 <4,u,5,1>, <4,4,6,6>
+ 3736882642U, // <1,4,4,7>: Cost 4 vext2 <7,6,1,4>, <4,7,6,1>
+ 2619346473U, // <1,4,4,u>: Cost 3 vext2 <0,3,1,4>, RHS
+ 2557108326U, // <1,4,5,0>: Cost 3 vext1 <1,1,4,5>, LHS
+ 2557109075U, // <1,4,5,1>: Cost 3 vext1 <1,1,4,5>, <1,1,4,5>
+ 2598913774U, // <1,4,5,2>: Cost 3 vext1 <u,1,4,5>, <2,3,u,1>
+ 3630852246U, // <1,4,5,3>: Cost 4 vext1 <1,1,4,5>, <3,0,1,2>
+ 2557111606U, // <1,4,5,4>: Cost 3 vext1 <1,1,4,5>, RHS
+ 2895252790U, // <1,4,5,5>: Cost 3 vzipl <1,5,3,7>, RHS
+ 1616006454U, // <1,4,5,6>: Cost 2 vext3 <0,u,1,1>, RHS
+ 3899059510U, // <1,4,5,7>: Cost 4 vuzpr <1,1,1,4>, RHS
+ 1616006472U, // <1,4,5,u>: Cost 2 vext3 <0,u,1,1>, RHS
+ 2557116518U, // <1,4,6,0>: Cost 3 vext1 <1,1,4,6>, LHS
+ 2557117236U, // <1,4,6,1>: Cost 3 vext1 <1,1,4,6>, <1,1,1,1>
+ 3630859880U, // <1,4,6,2>: Cost 4 vext1 <1,1,4,6>, <2,2,2,2>
+ 2569062550U, // <1,4,6,3>: Cost 3 vext1 <3,1,4,6>, <3,0,1,2>
+ 2557119798U, // <1,4,6,4>: Cost 3 vext1 <1,1,4,6>, RHS
+ 3763490174U, // <1,4,6,5>: Cost 4 vext3 <0,u,1,1>, <4,6,5,7>
+ 3763490183U, // <1,4,6,6>: Cost 4 vext3 <0,u,1,1>, <4,6,6,7>
+ 2712751498U, // <1,4,6,7>: Cost 3 vext3 <4,6,7,1>, <4,6,7,1>
+ 2557122350U, // <1,4,6,u>: Cost 3 vext1 <1,1,4,6>, LHS
+ 2659161084U, // <1,4,7,0>: Cost 3 vext2 <7,0,1,4>, <7,0,1,4>
+ 3732903040U, // <1,4,7,1>: Cost 4 vext2 <7,0,1,4>, <7,1,7,1>
+ 3734230174U, // <1,4,7,2>: Cost 4 vext2 <7,2,1,4>, <7,2,1,4>
+ 3734893807U, // <1,4,7,3>: Cost 4 vext2 <7,3,1,4>, <7,3,1,4>
+ 3660729654U, // <1,4,7,4>: Cost 4 vext1 <6,1,4,7>, RHS
+ 3786493384U, // <1,4,7,5>: Cost 4 vext3 <4,6,7,1>, <4,7,5,0>
+ 2713341394U, // <1,4,7,6>: Cost 3 vext3 <4,7,6,1>, <4,7,6,1>
+ 3660731386U, // <1,4,7,7>: Cost 4 vext1 <6,1,4,7>, <7,0,1,2>
+ 2664470148U, // <1,4,7,u>: Cost 3 vext2 <7,u,1,4>, <7,u,1,4>
+ 2557132902U, // <1,4,u,0>: Cost 3 vext1 <1,1,4,u>, LHS
+ 2619348782U, // <1,4,u,1>: Cost 3 vext2 <0,3,1,4>, LHS
+ 2563106351U, // <1,4,u,2>: Cost 3 vext1 <2,1,4,u>, <2,1,4,u>
+ 2713783816U, // <1,4,u,3>: Cost 3 vext3 <4,u,3,1>, <4,u,3,1>
+ 2622666815U, // <1,4,u,4>: Cost 3 vext2 <0,u,1,4>, <u,4,5,6>
+ 1640189466U, // <1,4,u,5>: Cost 2 vext3 <4,u,5,1>, <4,u,5,1>
+ 1616006697U, // <1,4,u,6>: Cost 2 vext3 <0,u,1,1>, RHS
+ 2712751498U, // <1,4,u,7>: Cost 3 vext3 <4,6,7,1>, <4,6,7,1>
+ 1616006715U, // <1,4,u,u>: Cost 2 vext3 <0,u,1,1>, RHS
+ 2620014592U, // <1,5,0,0>: Cost 3 vext2 <0,4,1,5>, <0,0,0,0>
+ 1546272870U, // <1,5,0,1>: Cost 2 vext2 <0,4,1,5>, LHS
+ 2618687664U, // <1,5,0,2>: Cost 3 vext2 <0,2,1,5>, <0,2,1,5>
+ 3693093120U, // <1,5,0,3>: Cost 4 vext2 <0,3,1,5>, <0,3,1,4>
+ 1546273106U, // <1,5,0,4>: Cost 2 vext2 <0,4,1,5>, <0,4,1,5>
+ 2620678563U, // <1,5,0,5>: Cost 3 vext2 <0,5,1,5>, <0,5,1,5>
+ 2714668660U, // <1,5,0,6>: Cost 3 vext3 <5,0,6,1>, <5,0,6,1>
+ 3772042877U, // <1,5,0,7>: Cost 4 vext3 <2,3,0,1>, <5,0,7,1>
+ 1546273437U, // <1,5,0,u>: Cost 2 vext2 <0,4,1,5>, LHS
+ 2620015350U, // <1,5,1,0>: Cost 3 vext2 <0,4,1,5>, <1,0,3,2>
+ 2620015412U, // <1,5,1,1>: Cost 3 vext2 <0,4,1,5>, <1,1,1,1>
+ 2620015510U, // <1,5,1,2>: Cost 3 vext2 <0,4,1,5>, <1,2,3,0>
+ 2618688512U, // <1,5,1,3>: Cost 3 vext2 <0,2,1,5>, <1,3,5,7>
+ 2620015677U, // <1,5,1,4>: Cost 3 vext2 <0,4,1,5>, <1,4,3,5>
+ 2620015727U, // <1,5,1,5>: Cost 3 vext2 <0,4,1,5>, <1,5,0,1>
+ 2620015859U, // <1,5,1,6>: Cost 3 vext2 <0,4,1,5>, <1,6,5,7>
+ 3093728566U, // <1,5,1,7>: Cost 3 vtrnr <1,1,1,1>, RHS
+ 2620015981U, // <1,5,1,u>: Cost 3 vext2 <0,4,1,5>, <1,u,1,3>
+ 3692430816U, // <1,5,2,0>: Cost 4 vext2 <0,2,1,5>, <2,0,5,1>
+ 2620016163U, // <1,5,2,1>: Cost 3 vext2 <0,4,1,5>, <2,1,3,5>
+ 2620016232U, // <1,5,2,2>: Cost 3 vext2 <0,4,1,5>, <2,2,2,2>
+ 2620016294U, // <1,5,2,3>: Cost 3 vext2 <0,4,1,5>, <2,3,0,1>
+ 3693758221U, // <1,5,2,4>: Cost 4 vext2 <0,4,1,5>, <2,4,2,5>
+ 3692431209U, // <1,5,2,5>: Cost 4 vext2 <0,2,1,5>, <2,5,3,7>
+ 2620016570U, // <1,5,2,6>: Cost 3 vext2 <0,4,1,5>, <2,6,3,7>
+ 4173598006U, // <1,5,2,7>: Cost 4 vtrnr <2,1,3,2>, RHS
+ 2620016699U, // <1,5,2,u>: Cost 3 vext2 <0,4,1,5>, <2,u,0,1>
+ 2620016790U, // <1,5,3,0>: Cost 3 vext2 <0,4,1,5>, <3,0,1,2>
+ 2569110672U, // <1,5,3,1>: Cost 3 vext1 <3,1,5,3>, <1,5,3,7>
+ 3693758785U, // <1,5,3,2>: Cost 4 vext2 <0,4,1,5>, <3,2,2,2>
+ 2620017052U, // <1,5,3,3>: Cost 3 vext2 <0,4,1,5>, <3,3,3,3>
+ 2620017154U, // <1,5,3,4>: Cost 3 vext2 <0,4,1,5>, <3,4,5,6>
+ 3135623172U, // <1,5,3,5>: Cost 3 vtrnr LHS, <5,5,5,5>
+ 4161587048U, // <1,5,3,6>: Cost 4 vtrnr LHS, <2,5,3,6>
+ 2014104886U, // <1,5,3,7>: Cost 2 vtrnr LHS, RHS
+ 2014104887U, // <1,5,3,u>: Cost 2 vtrnr LHS, RHS
+ 2620017554U, // <1,5,4,0>: Cost 3 vext2 <0,4,1,5>, <4,0,5,1>
+ 2620017634U, // <1,5,4,1>: Cost 3 vext2 <0,4,1,5>, <4,1,5,0>
+ 3693759551U, // <1,5,4,2>: Cost 4 vext2 <0,4,1,5>, <4,2,6,3>
+ 3642861837U, // <1,5,4,3>: Cost 4 vext1 <3,1,5,4>, <3,1,5,4>
+ 2575092710U, // <1,5,4,4>: Cost 3 vext1 <4,1,5,4>, <4,1,5,4>
+ 1546276150U, // <1,5,4,5>: Cost 2 vext2 <0,4,1,5>, RHS
+ 2759855414U, // <1,5,4,6>: Cost 3 vuzpl <1,3,5,7>, RHS
+ 2713931718U, // <1,5,4,7>: Cost 3 vext3 <4,u,5,1>, <5,4,7,6>
+ 1546276393U, // <1,5,4,u>: Cost 2 vext2 <0,4,1,5>, RHS
+ 2557182054U, // <1,5,5,0>: Cost 3 vext1 <1,1,5,5>, LHS
+ 2557182812U, // <1,5,5,1>: Cost 3 vext1 <1,1,5,5>, <1,1,5,5>
+ 3630925347U, // <1,5,5,2>: Cost 4 vext1 <1,1,5,5>, <2,1,3,5>
+ 4029301675U, // <1,5,5,3>: Cost 4 vzipr <0,4,1,5>, <1,2,5,3>
+ 2557185334U, // <1,5,5,4>: Cost 3 vext1 <1,1,5,5>, RHS
+ 2713931780U, // <1,5,5,5>: Cost 3 vext3 <4,u,5,1>, <5,5,5,5>
+ 2667794530U, // <1,5,5,6>: Cost 3 vext2 <u,4,1,5>, <5,6,7,0>
+ 2713931800U, // <1,5,5,7>: Cost 3 vext3 <4,u,5,1>, <5,5,7,7>
+ 2557187886U, // <1,5,5,u>: Cost 3 vext1 <1,1,5,5>, LHS
+ 2718208036U, // <1,5,6,0>: Cost 3 vext3 <5,6,0,1>, <5,6,0,1>
+ 2620019115U, // <1,5,6,1>: Cost 3 vext2 <0,4,1,5>, <6,1,7,5>
+ 2667794938U, // <1,5,6,2>: Cost 3 vext2 <u,4,1,5>, <6,2,7,3>
+ 3787673666U, // <1,5,6,3>: Cost 4 vext3 <4,u,5,1>, <5,6,3,4>
+ 3693761165U, // <1,5,6,4>: Cost 4 vext2 <0,4,1,5>, <6,4,5,6>
+ 3319279297U, // <1,5,6,5>: Cost 4 vrev <5,1,5,6>
+ 2667795256U, // <1,5,6,6>: Cost 3 vext2 <u,4,1,5>, <6,6,6,6>
+ 2713931874U, // <1,5,6,7>: Cost 3 vext3 <4,u,5,1>, <5,6,7,0>
+ 2713931883U, // <1,5,6,u>: Cost 3 vext3 <4,u,5,1>, <5,6,u,0>
+ 2557198438U, // <1,5,7,0>: Cost 3 vext1 <1,1,5,7>, LHS
+ 2557199156U, // <1,5,7,1>: Cost 3 vext1 <1,1,5,7>, <1,1,1,1>
+ 2569143974U, // <1,5,7,2>: Cost 3 vext1 <3,1,5,7>, <2,3,0,1>
+ 2569144592U, // <1,5,7,3>: Cost 3 vext1 <3,1,5,7>, <3,1,5,7>
+ 2557201718U, // <1,5,7,4>: Cost 3 vext1 <1,1,5,7>, RHS
+ 2713931944U, // <1,5,7,5>: Cost 3 vext3 <4,u,5,1>, <5,7,5,7>
+ 3787673770U, // <1,5,7,6>: Cost 4 vext3 <4,u,5,1>, <5,7,6,0>
+ 2719387828U, // <1,5,7,7>: Cost 3 vext3 <5,7,7,1>, <5,7,7,1>
+ 2557204270U, // <1,5,7,u>: Cost 3 vext1 <1,1,5,7>, LHS
+ 2620020435U, // <1,5,u,0>: Cost 3 vext2 <0,4,1,5>, <u,0,1,2>
+ 1546278702U, // <1,5,u,1>: Cost 2 vext2 <0,4,1,5>, LHS
+ 2620020616U, // <1,5,u,2>: Cost 3 vext2 <0,4,1,5>, <u,2,3,3>
+ 2620020668U, // <1,5,u,3>: Cost 3 vext2 <0,4,1,5>, <u,3,0,1>
+ 1594054682U, // <1,5,u,4>: Cost 2 vext2 <u,4,1,5>, <u,4,1,5>
+ 1546279066U, // <1,5,u,5>: Cost 2 vext2 <0,4,1,5>, RHS
+ 2620020944U, // <1,5,u,6>: Cost 3 vext2 <0,4,1,5>, <u,6,3,7>
+ 2014145846U, // <1,5,u,7>: Cost 2 vtrnr LHS, RHS
+ 2014145847U, // <1,5,u,u>: Cost 2 vtrnr LHS, RHS
+ 3692437504U, // <1,6,0,0>: Cost 4 vext2 <0,2,1,6>, <0,0,0,0>
+ 2618695782U, // <1,6,0,1>: Cost 3 vext2 <0,2,1,6>, LHS
+ 2618695857U, // <1,6,0,2>: Cost 3 vext2 <0,2,1,6>, <0,2,1,6>
+ 3794161970U, // <1,6,0,3>: Cost 4 vext3 <6,0,3,1>, <6,0,3,1>
+ 2620023122U, // <1,6,0,4>: Cost 3 vext2 <0,4,1,6>, <0,4,1,5>
+ 2620686756U, // <1,6,0,5>: Cost 3 vext2 <0,5,1,6>, <0,5,1,6>
+ 2621350389U, // <1,6,0,6>: Cost 3 vext2 <0,6,1,6>, <0,6,1,6>
+ 4028599606U, // <1,6,0,7>: Cost 4 vzipr <0,3,1,0>, RHS
+ 2618696349U, // <1,6,0,u>: Cost 3 vext2 <0,2,1,6>, LHS
+ 3692438262U, // <1,6,1,0>: Cost 4 vext2 <0,2,1,6>, <1,0,3,2>
+ 2625995572U, // <1,6,1,1>: Cost 3 vext2 <1,4,1,6>, <1,1,1,1>
+ 3692438422U, // <1,6,1,2>: Cost 4 vext2 <0,2,1,6>, <1,2,3,0>
+ 3692438488U, // <1,6,1,3>: Cost 4 vext2 <0,2,1,6>, <1,3,1,3>
+ 2625995820U, // <1,6,1,4>: Cost 3 vext2 <1,4,1,6>, <1,4,1,6>
+ 3692438672U, // <1,6,1,5>: Cost 4 vext2 <0,2,1,6>, <1,5,3,7>
+ 3692438720U, // <1,6,1,6>: Cost 4 vext2 <0,2,1,6>, <1,6,0,1>
+ 2958183734U, // <1,6,1,7>: Cost 3 vzipr <0,u,1,1>, RHS
+ 2958183735U, // <1,6,1,u>: Cost 3 vzipr <0,u,1,1>, RHS
+ 2721526201U, // <1,6,2,0>: Cost 3 vext3 <6,2,0,1>, <6,2,0,1>
+ 3692439097U, // <1,6,2,1>: Cost 4 vext2 <0,2,1,6>, <2,1,6,0>
+ 3692439144U, // <1,6,2,2>: Cost 4 vext2 <0,2,1,6>, <2,2,2,2>
+ 3692439206U, // <1,6,2,3>: Cost 4 vext2 <0,2,1,6>, <2,3,0,1>
+ 3636948278U, // <1,6,2,4>: Cost 4 vext1 <2,1,6,2>, RHS
+ 3787674092U, // <1,6,2,5>: Cost 4 vext3 <4,u,5,1>, <6,2,5,7>
+ 2618697658U, // <1,6,2,6>: Cost 3 vext2 <0,2,1,6>, <2,6,3,7>
+ 2970799414U, // <1,6,2,7>: Cost 3 vzipr <3,0,1,2>, RHS
+ 2970799415U, // <1,6,2,u>: Cost 3 vzipr <3,0,1,2>, RHS
+ 2563211366U, // <1,6,3,0>: Cost 3 vext1 <2,1,6,3>, LHS
+ 3699738854U, // <1,6,3,1>: Cost 4 vext2 <1,4,1,6>, <3,1,1,1>
+ 2563212860U, // <1,6,3,2>: Cost 3 vext1 <2,1,6,3>, <2,1,6,3>
+ 3692439964U, // <1,6,3,3>: Cost 4 vext2 <0,2,1,6>, <3,3,3,3>
+ 2563214646U, // <1,6,3,4>: Cost 3 vext1 <2,1,6,3>, RHS
+ 4191820018U, // <1,6,3,5>: Cost 4 vtrnr <5,1,7,3>, <u,6,7,5>
+ 2587103648U, // <1,6,3,6>: Cost 3 vext1 <6,1,6,3>, <6,1,6,3>
+ 3087845306U, // <1,6,3,7>: Cost 3 vtrnr LHS, <2,6,3,7>
+ 3087845307U, // <1,6,3,u>: Cost 3 vtrnr LHS, <2,6,3,u>
+ 3693767570U, // <1,6,4,0>: Cost 4 vext2 <0,4,1,6>, <4,0,5,1>
+ 3693767650U, // <1,6,4,1>: Cost 4 vext2 <0,4,1,6>, <4,1,5,0>
+ 3636962877U, // <1,6,4,2>: Cost 4 vext1 <2,1,6,4>, <2,1,6,4>
+ 3325088134U, // <1,6,4,3>: Cost 4 vrev <6,1,3,4>
+ 3693767898U, // <1,6,4,4>: Cost 4 vext2 <0,4,1,6>, <4,4,5,5>
+ 2618699062U, // <1,6,4,5>: Cost 3 vext2 <0,2,1,6>, RHS
+ 3833670966U, // <1,6,4,6>: Cost 4 vuzpl <1,3,6,7>, RHS
+ 4028632374U, // <1,6,4,7>: Cost 4 vzipr <0,3,1,4>, RHS
+ 2618699305U, // <1,6,4,u>: Cost 3 vext2 <0,2,1,6>, RHS
+ 3693768264U, // <1,6,5,0>: Cost 4 vext2 <0,4,1,6>, <5,0,1,2>
+ 3630998373U, // <1,6,5,1>: Cost 4 vext1 <1,1,6,5>, <1,1,6,5>
+ 3636971070U, // <1,6,5,2>: Cost 4 vext1 <2,1,6,5>, <2,1,6,5>
+ 3642943767U, // <1,6,5,3>: Cost 4 vext1 <3,1,6,5>, <3,1,6,5>
+ 3693768628U, // <1,6,5,4>: Cost 4 vext2 <0,4,1,6>, <5,4,5,6>
+ 3732918276U, // <1,6,5,5>: Cost 4 vext2 <7,0,1,6>, <5,5,5,5>
+ 2620690530U, // <1,6,5,6>: Cost 3 vext2 <0,5,1,6>, <5,6,7,0>
+ 2955562294U, // <1,6,5,7>: Cost 3 vzipr <0,4,1,5>, RHS
+ 2955562295U, // <1,6,5,u>: Cost 3 vzipr <0,4,1,5>, RHS
+ 2724180733U, // <1,6,6,0>: Cost 3 vext3 <6,6,0,1>, <6,6,0,1>
+ 3631006566U, // <1,6,6,1>: Cost 4 vext1 <1,1,6,6>, <1,1,6,6>
+ 3631007674U, // <1,6,6,2>: Cost 4 vext1 <1,1,6,6>, <2,6,3,7>
+ 3692442184U, // <1,6,6,3>: Cost 4 vext2 <0,2,1,6>, <6,3,7,0>
+ 3631009078U, // <1,6,6,4>: Cost 4 vext1 <1,1,6,6>, RHS
+ 3787674416U, // <1,6,6,5>: Cost 4 vext3 <4,u,5,1>, <6,6,5,7>
+ 2713932600U, // <1,6,6,6>: Cost 3 vext3 <4,u,5,1>, <6,6,6,6>
+ 2713932610U, // <1,6,6,7>: Cost 3 vext3 <4,u,5,1>, <6,6,7,7>
+ 2713932619U, // <1,6,6,u>: Cost 3 vext3 <4,u,5,1>, <6,6,u,7>
+ 1651102542U, // <1,6,7,0>: Cost 2 vext3 <6,7,0,1>, <6,7,0,1>
+ 2724918103U, // <1,6,7,1>: Cost 3 vext3 <6,7,1,1>, <6,7,1,1>
+ 2698302306U, // <1,6,7,2>: Cost 3 vext3 <2,3,0,1>, <6,7,2,3>
+ 3642960153U, // <1,6,7,3>: Cost 4 vext1 <3,1,6,7>, <3,1,6,7>
+ 2713932662U, // <1,6,7,4>: Cost 3 vext3 <4,u,5,1>, <6,7,4,5>
+ 2725213051U, // <1,6,7,5>: Cost 3 vext3 <6,7,5,1>, <6,7,5,1>
+ 2724844426U, // <1,6,7,6>: Cost 3 vext3 <6,7,0,1>, <6,7,6,7>
+ 4035956022U, // <1,6,7,7>: Cost 4 vzipr <1,5,1,7>, RHS
+ 1651692438U, // <1,6,7,u>: Cost 2 vext3 <6,7,u,1>, <6,7,u,1>
+ 1651766175U, // <1,6,u,0>: Cost 2 vext3 <6,u,0,1>, <6,u,0,1>
+ 2618701614U, // <1,6,u,1>: Cost 3 vext2 <0,2,1,6>, LHS
+ 3135663508U, // <1,6,u,2>: Cost 3 vtrnr LHS, <4,6,u,2>
+ 3692443580U, // <1,6,u,3>: Cost 4 vext2 <0,2,1,6>, <u,3,0,1>
+ 2713932743U, // <1,6,u,4>: Cost 3 vext3 <4,u,5,1>, <6,u,4,5>
+ 2618701978U, // <1,6,u,5>: Cost 3 vext2 <0,2,1,6>, RHS
+ 2622683344U, // <1,6,u,6>: Cost 3 vext2 <0,u,1,6>, <u,6,3,7>
+ 3087886266U, // <1,6,u,7>: Cost 3 vtrnr LHS, <2,6,3,7>
+ 1652356071U, // <1,6,u,u>: Cost 2 vext3 <6,u,u,1>, <6,u,u,1>
+ 2726171632U, // <1,7,0,0>: Cost 3 vext3 <7,0,0,1>, <7,0,0,1>
+ 2626666598U, // <1,7,0,1>: Cost 3 vext2 <1,5,1,7>, LHS
+ 3695100067U, // <1,7,0,2>: Cost 4 vext2 <0,6,1,7>, <0,2,0,1>
+ 3707044102U, // <1,7,0,3>: Cost 4 vext2 <2,6,1,7>, <0,3,2,1>
+ 2726466580U, // <1,7,0,4>: Cost 3 vext3 <7,0,4,1>, <7,0,4,1>
+ 3654921933U, // <1,7,0,5>: Cost 4 vext1 <5,1,7,0>, <5,1,7,0>
+ 2621358582U, // <1,7,0,6>: Cost 3 vext2 <0,6,1,7>, <0,6,1,7>
+ 2622022215U, // <1,7,0,7>: Cost 3 vext2 <0,7,1,7>, <0,7,1,7>
+ 2626667165U, // <1,7,0,u>: Cost 3 vext2 <1,5,1,7>, LHS
+ 2593128550U, // <1,7,1,0>: Cost 3 vext1 <7,1,7,1>, LHS
+ 2626667316U, // <1,7,1,1>: Cost 3 vext2 <1,5,1,7>, <1,1,1,1>
+ 3700409238U, // <1,7,1,2>: Cost 4 vext2 <1,5,1,7>, <1,2,3,0>
+ 2257294428U, // <1,7,1,3>: Cost 3 vrev <7,1,3,1>
+ 2593131830U, // <1,7,1,4>: Cost 3 vext1 <7,1,7,1>, RHS
+ 2626667646U, // <1,7,1,5>: Cost 3 vext2 <1,5,1,7>, <1,5,1,7>
+ 2627331279U, // <1,7,1,6>: Cost 3 vext2 <1,6,1,7>, <1,6,1,7>
+ 2593133696U, // <1,7,1,7>: Cost 3 vext1 <7,1,7,1>, <7,1,7,1>
+ 2628658545U, // <1,7,1,u>: Cost 3 vext2 <1,u,1,7>, <1,u,1,7>
+ 2587164774U, // <1,7,2,0>: Cost 3 vext1 <6,1,7,2>, LHS
+ 3701073445U, // <1,7,2,1>: Cost 4 vext2 <1,6,1,7>, <2,1,3,7>
+ 3700409960U, // <1,7,2,2>: Cost 4 vext2 <1,5,1,7>, <2,2,2,2>
+ 2638612134U, // <1,7,2,3>: Cost 3 vext2 <3,5,1,7>, <2,3,0,1>
+ 2587168054U, // <1,7,2,4>: Cost 3 vext1 <6,1,7,2>, RHS
+ 3706382167U, // <1,7,2,5>: Cost 4 vext2 <2,5,1,7>, <2,5,1,7>
+ 2587169192U, // <1,7,2,6>: Cost 3 vext1 <6,1,7,2>, <6,1,7,2>
+ 3660911610U, // <1,7,2,7>: Cost 4 vext1 <6,1,7,2>, <7,0,1,2>
+ 2587170606U, // <1,7,2,u>: Cost 3 vext1 <6,1,7,2>, LHS
+ 1507459174U, // <1,7,3,0>: Cost 2 vext1 <5,1,7,3>, LHS
+ 2569257984U, // <1,7,3,1>: Cost 3 vext1 <3,1,7,3>, <1,3,5,7>
+ 2581202536U, // <1,7,3,2>: Cost 3 vext1 <5,1,7,3>, <2,2,2,2>
+ 2569259294U, // <1,7,3,3>: Cost 3 vext1 <3,1,7,3>, <3,1,7,3>
+ 1507462454U, // <1,7,3,4>: Cost 2 vext1 <5,1,7,3>, RHS
+ 1507462864U, // <1,7,3,5>: Cost 2 vext1 <5,1,7,3>, <5,1,7,3>
+ 2581205498U, // <1,7,3,6>: Cost 3 vext1 <5,1,7,3>, <6,2,7,3>
+ 2581206010U, // <1,7,3,7>: Cost 3 vext1 <5,1,7,3>, <7,0,1,2>
+ 1507465006U, // <1,7,3,u>: Cost 2 vext1 <5,1,7,3>, LHS
+ 2728826164U, // <1,7,4,0>: Cost 3 vext3 <7,4,0,1>, <7,4,0,1>
+ 3654951732U, // <1,7,4,1>: Cost 4 vext1 <5,1,7,4>, <1,1,1,1>
+ 3330987094U, // <1,7,4,2>: Cost 4 vrev <7,1,2,4>
+ 3331060831U, // <1,7,4,3>: Cost 4 vrev <7,1,3,4>
+ 3787674971U, // <1,7,4,4>: Cost 4 vext3 <4,u,5,1>, <7,4,4,4>
+ 2626669878U, // <1,7,4,5>: Cost 3 vext2 <1,5,1,7>, RHS
+ 3785979241U, // <1,7,4,6>: Cost 4 vext3 <4,6,0,1>, <7,4,6,0>
+ 3787085176U, // <1,7,4,7>: Cost 4 vext3 <4,7,6,1>, <7,4,7,6>
+ 2626670121U, // <1,7,4,u>: Cost 3 vext2 <1,5,1,7>, RHS
+ 2569273446U, // <1,7,5,0>: Cost 3 vext1 <3,1,7,5>, LHS
+ 2569274368U, // <1,7,5,1>: Cost 3 vext1 <3,1,7,5>, <1,3,5,7>
+ 3643016808U, // <1,7,5,2>: Cost 4 vext1 <3,1,7,5>, <2,2,2,2>
+ 2569275680U, // <1,7,5,3>: Cost 3 vext1 <3,1,7,5>, <3,1,7,5>
+ 2569276726U, // <1,7,5,4>: Cost 3 vext1 <3,1,7,5>, RHS
+ 4102034790U, // <1,7,5,5>: Cost 4 vtrnl <1,3,5,7>, <7,4,5,6>
+ 2651222067U, // <1,7,5,6>: Cost 3 vext2 <5,6,1,7>, <5,6,1,7>
+ 3899378998U, // <1,7,5,7>: Cost 4 vuzpr <1,1,5,7>, RHS
+ 2569279278U, // <1,7,5,u>: Cost 3 vext1 <3,1,7,5>, LHS
+ 2730153430U, // <1,7,6,0>: Cost 3 vext3 <7,6,0,1>, <7,6,0,1>
+ 2724845022U, // <1,7,6,1>: Cost 3 vext3 <6,7,0,1>, <7,6,1,0>
+ 3643025338U, // <1,7,6,2>: Cost 4 vext1 <3,1,7,6>, <2,6,3,7>
+ 3643025697U, // <1,7,6,3>: Cost 4 vext1 <3,1,7,6>, <3,1,7,6>
+ 3643026742U, // <1,7,6,4>: Cost 4 vext1 <3,1,7,6>, RHS
+ 3654971091U, // <1,7,6,5>: Cost 4 vext1 <5,1,7,6>, <5,1,7,6>
+ 3787675153U, // <1,7,6,6>: Cost 4 vext3 <4,u,5,1>, <7,6,6,6>
+ 2724845076U, // <1,7,6,7>: Cost 3 vext3 <6,7,0,1>, <7,6,7,0>
+ 2725508637U, // <1,7,6,u>: Cost 3 vext3 <6,u,0,1>, <7,6,u,0>
+ 2730817063U, // <1,7,7,0>: Cost 3 vext3 <7,7,0,1>, <7,7,0,1>
+ 3631088436U, // <1,7,7,1>: Cost 4 vext1 <1,1,7,7>, <1,1,1,1>
+ 3660949158U, // <1,7,7,2>: Cost 4 vext1 <6,1,7,7>, <2,3,0,1>
+ 3801904705U, // <1,7,7,3>: Cost 4 vext3 <7,3,0,1>, <7,7,3,0>
+ 3631090998U, // <1,7,7,4>: Cost 4 vext1 <1,1,7,7>, RHS
+ 2662503828U, // <1,7,7,5>: Cost 3 vext2 <7,5,1,7>, <7,5,1,7>
+ 3660951981U, // <1,7,7,6>: Cost 4 vext1 <6,1,7,7>, <6,1,7,7>
+ 2713933420U, // <1,7,7,7>: Cost 3 vext3 <4,u,5,1>, <7,7,7,7>
+ 2731406959U, // <1,7,7,u>: Cost 3 vext3 <7,7,u,1>, <7,7,u,1>
+ 1507500134U, // <1,7,u,0>: Cost 2 vext1 <5,1,7,u>, LHS
+ 2626672430U, // <1,7,u,1>: Cost 3 vext2 <1,5,1,7>, LHS
+ 2581243496U, // <1,7,u,2>: Cost 3 vext1 <5,1,7,u>, <2,2,2,2>
+ 2569300259U, // <1,7,u,3>: Cost 3 vext1 <3,1,7,u>, <3,1,7,u>
+ 1507503414U, // <1,7,u,4>: Cost 2 vext1 <5,1,7,u>, RHS
+ 1507503829U, // <1,7,u,5>: Cost 2 vext1 <5,1,7,u>, <5,1,7,u>
+ 2581246458U, // <1,7,u,6>: Cost 3 vext1 <5,1,7,u>, <6,2,7,3>
+ 2581246970U, // <1,7,u,7>: Cost 3 vext1 <5,1,7,u>, <7,0,1,2>
+ 1507505966U, // <1,7,u,u>: Cost 2 vext1 <5,1,7,u>, LHS
+ 1543643153U, // <1,u,0,0>: Cost 2 vext2 <0,0,1,u>, <0,0,1,u>
+ 1546297446U, // <1,u,0,1>: Cost 2 vext2 <0,4,1,u>, LHS
+ 2819448852U, // <1,u,0,2>: Cost 3 vuzpr LHS, <0,0,2,2>
+ 2619375876U, // <1,u,0,3>: Cost 3 vext2 <0,3,1,u>, <0,3,1,u>
+ 1546297685U, // <1,u,0,4>: Cost 2 vext2 <0,4,1,u>, <0,4,1,u>
+ 1658771190U, // <1,u,0,5>: Cost 2 vext3 <u,0,5,1>, <u,0,5,1>
+ 2736789248U, // <1,u,0,6>: Cost 3 vext3 <u,7,0,1>, <u,0,6,2>
+ 2659189376U, // <1,u,0,7>: Cost 3 vext2 <7,0,1,u>, <0,7,u,1>
+ 1546298013U, // <1,u,0,u>: Cost 2 vext2 <0,4,1,u>, LHS
+ 1483112550U, // <1,u,1,0>: Cost 2 vext1 <1,1,1,1>, LHS
+ 202162278U, // <1,u,1,1>: Cost 1 vdup1 LHS
+ 1616009006U, // <1,u,1,2>: Cost 2 vext3 <0,u,1,1>, LHS
+ 1745707110U, // <1,u,1,3>: Cost 2 vuzpr LHS, LHS
+ 1483115830U, // <1,u,1,4>: Cost 2 vext1 <1,1,1,1>, RHS
+ 2620040336U, // <1,u,1,5>: Cost 3 vext2 <0,4,1,u>, <1,5,3,7>
+ 3026622618U, // <1,u,1,6>: Cost 3 vtrnl <1,1,1,1>, RHS
+ 2958183752U, // <1,u,1,7>: Cost 3 vzipr <0,u,1,1>, RHS
+ 202162278U, // <1,u,1,u>: Cost 1 vdup1 LHS
+ 2819449750U, // <1,u,2,0>: Cost 3 vuzpr LHS, <1,2,3,0>
+ 2893207342U, // <1,u,2,1>: Cost 3 vzipl <1,2,3,0>, LHS
+ 2819448996U, // <1,u,2,2>: Cost 3 vuzpr LHS, <0,2,0,2>
+ 2819450482U, // <1,u,2,3>: Cost 3 vuzpr LHS, <2,2,3,3>
+ 2819449754U, // <1,u,2,4>: Cost 3 vuzpr LHS, <1,2,3,4>
+ 2893207706U, // <1,u,2,5>: Cost 3 vzipl <1,2,3,0>, RHS
+ 2819449036U, // <1,u,2,6>: Cost 3 vuzpr LHS, <0,2,4,6>
+ 2970799432U, // <1,u,2,7>: Cost 3 vzipr <3,0,1,2>, RHS
+ 2819449002U, // <1,u,2,u>: Cost 3 vuzpr LHS, <0,2,0,u>
+ 403931292U, // <1,u,3,0>: Cost 1 vext1 LHS, LHS
+ 1477673718U, // <1,u,3,1>: Cost 2 vext1 LHS, <1,0,3,2>
+ 115726126U, // <1,u,3,2>: Cost 1 vrev LHS
+ 2014102173U, // <1,u,3,3>: Cost 2 vtrnr LHS, LHS
+ 403934518U, // <1,u,3,4>: Cost 1 vext1 LHS, RHS
+ 1507536601U, // <1,u,3,5>: Cost 2 vext1 <5,1,u,3>, <5,1,u,3>
+ 1525453306U, // <1,u,3,6>: Cost 2 vext1 LHS, <6,2,7,3>
+ 2014105129U, // <1,u,3,7>: Cost 2 vtrnr LHS, RHS
+ 403937070U, // <1,u,3,u>: Cost 1 vext1 LHS, LHS
+ 2620042157U, // <1,u,4,0>: Cost 3 vext2 <0,4,1,u>, <4,0,u,1>
+ 2620042237U, // <1,u,4,1>: Cost 3 vext2 <0,4,1,u>, <4,1,u,0>
+ 2263217967U, // <1,u,4,2>: Cost 3 vrev <u,1,2,4>
+ 2569341224U, // <1,u,4,3>: Cost 3 vext1 <3,1,u,4>, <3,1,u,4>
+ 2569342262U, // <1,u,4,4>: Cost 3 vext1 <3,1,u,4>, RHS
+ 1546300726U, // <1,u,4,5>: Cost 2 vext2 <0,4,1,u>, RHS
+ 2819449180U, // <1,u,4,6>: Cost 3 vuzpr LHS, <0,4,2,6>
+ 2724845649U, // <1,u,4,7>: Cost 3 vext3 <6,7,0,1>, <u,4,7,6>
+ 1546300969U, // <1,u,4,u>: Cost 2 vext2 <0,4,1,u>, RHS
+ 2551431270U, // <1,u,5,0>: Cost 3 vext1 <0,1,u,5>, LHS
+ 2551432192U, // <1,u,5,1>: Cost 3 vext1 <0,1,u,5>, <1,3,5,7>
+ 3028293422U, // <1,u,5,2>: Cost 3 vtrnl <1,3,5,7>, LHS
+ 2955559068U, // <1,u,5,3>: Cost 3 vzipr <0,4,1,5>, LHS
+ 2551434550U, // <1,u,5,4>: Cost 3 vext1 <0,1,u,5>, RHS
+ 2895255706U, // <1,u,5,5>: Cost 3 vzipl <1,5,3,7>, RHS
+ 1616009370U, // <1,u,5,6>: Cost 2 vext3 <0,u,1,1>, RHS
+ 1745710390U, // <1,u,5,7>: Cost 2 vuzpr LHS, RHS
+ 1745710391U, // <1,u,5,u>: Cost 2 vuzpr LHS, RHS
+ 2653221159U, // <1,u,6,0>: Cost 3 vext2 <6,0,1,u>, <6,0,1,u>
+ 2725509303U, // <1,u,6,1>: Cost 3 vext3 <6,u,0,1>, <u,6,1,0>
+ 2659193338U, // <1,u,6,2>: Cost 3 vext2 <7,0,1,u>, <6,2,7,3>
+ 2689751248U, // <1,u,6,3>: Cost 3 vext3 <0,u,1,1>, <u,6,3,7>
+ 2867228774U, // <1,u,6,4>: Cost 3 vuzpr LHS, <5,6,7,4>
+ 3764820194U, // <1,u,6,5>: Cost 4 vext3 <1,1,1,1>, <u,6,5,7>
+ 2657202957U, // <1,u,6,6>: Cost 3 vext2 <6,6,1,u>, <6,6,1,u>
+ 2819450810U, // <1,u,6,7>: Cost 3 vuzpr LHS, <2,6,3,7>
+ 2819450811U, // <1,u,6,u>: Cost 3 vuzpr LHS, <2,6,3,u>
+ 1585452032U, // <1,u,7,0>: Cost 2 vext2 <7,0,1,u>, <7,0,1,u>
+ 2557420340U, // <1,u,7,1>: Cost 3 vext1 <1,1,u,7>, <1,1,1,1>
+ 2569365158U, // <1,u,7,2>: Cost 3 vext1 <3,1,u,7>, <2,3,0,1>
+ 2569365803U, // <1,u,7,3>: Cost 3 vext1 <3,1,u,7>, <3,1,u,7>
+ 2557422902U, // <1,u,7,4>: Cost 3 vext1 <1,1,u,7>, RHS
+ 2662512021U, // <1,u,7,5>: Cost 3 vext2 <7,5,1,u>, <7,5,1,u>
+ 2724845884U, // <1,u,7,6>: Cost 3 vext3 <6,7,0,1>, <u,7,6,7>
+ 2659194476U, // <1,u,7,7>: Cost 3 vext2 <7,0,1,u>, <7,7,7,7>
+ 1590761096U, // <1,u,7,u>: Cost 2 vext2 <7,u,1,u>, <7,u,1,u>
+ 403972257U, // <1,u,u,0>: Cost 1 vext1 LHS, LHS
+ 202162278U, // <1,u,u,1>: Cost 1 vdup1 LHS
+ 115767091U, // <1,u,u,2>: Cost 1 vrev LHS
+ 1745707677U, // <1,u,u,3>: Cost 2 vuzpr LHS, LHS
+ 403975478U, // <1,u,u,4>: Cost 1 vext1 LHS, RHS
+ 1546303642U, // <1,u,u,5>: Cost 2 vext2 <0,4,1,u>, RHS
+ 1616009613U, // <1,u,u,6>: Cost 2 vext3 <0,u,1,1>, RHS
+ 1745710633U, // <1,u,u,7>: Cost 2 vuzpr LHS, RHS
+ 403978030U, // <1,u,u,u>: Cost 1 vext1 LHS, LHS
+ 2551463936U, // <2,0,0,0>: Cost 3 vext1 <0,2,0,0>, <0,0,0,0>
+ 2685698058U, // <2,0,0,1>: Cost 3 vext3 <0,2,0,2>, <0,0,1,1>
+ 1610776596U, // <2,0,0,2>: Cost 2 vext3 <0,0,2,2>, <0,0,2,2>
+ 2619384069U, // <2,0,0,3>: Cost 3 vext2 <0,3,2,0>, <0,3,2,0>
+ 2551467318U, // <2,0,0,4>: Cost 3 vext1 <0,2,0,0>, RHS
+ 3899836596U, // <2,0,0,5>: Cost 4 vuzpr <1,2,3,0>, <3,0,4,5>
+ 2621374968U, // <2,0,0,6>: Cost 3 vext2 <0,6,2,0>, <0,6,2,0>
+ 4168271334U, // <2,0,0,7>: Cost 4 vtrnr <1,2,3,0>, <2,0,5,7>
+ 1611219018U, // <2,0,0,u>: Cost 2 vext3 <0,0,u,2>, <0,0,u,2>
+ 2551472138U, // <2,0,1,0>: Cost 3 vext1 <0,2,0,1>, <0,0,1,1>
+ 2690564186U, // <2,0,1,1>: Cost 3 vext3 <1,0,3,2>, <0,1,1,0>
+ 1611956326U, // <2,0,1,2>: Cost 2 vext3 <0,2,0,2>, LHS
+ 2826092646U, // <2,0,1,3>: Cost 3 vuzpr <1,2,3,0>, LHS
+ 2551475510U, // <2,0,1,4>: Cost 3 vext1 <0,2,0,1>, RHS
+ 3692463248U, // <2,0,1,5>: Cost 4 vext2 <0,2,2,0>, <1,5,3,7>
+ 2587308473U, // <2,0,1,6>: Cost 3 vext1 <6,2,0,1>, <6,2,0,1>
+ 3661050874U, // <2,0,1,7>: Cost 4 vext1 <6,2,0,1>, <7,0,1,2>
+ 1611956380U, // <2,0,1,u>: Cost 2 vext3 <0,2,0,2>, LHS
+ 1477738598U, // <2,0,2,0>: Cost 2 vext1 <0,2,0,2>, LHS
+ 2551481078U, // <2,0,2,1>: Cost 3 vext1 <0,2,0,2>, <1,0,3,2>
+ 2551481796U, // <2,0,2,2>: Cost 3 vext1 <0,2,0,2>, <2,0,2,0>
+ 2551482518U, // <2,0,2,3>: Cost 3 vext1 <0,2,0,2>, <3,0,1,2>
+ 1477741878U, // <2,0,2,4>: Cost 2 vext1 <0,2,0,2>, RHS
+ 2551484112U, // <2,0,2,5>: Cost 3 vext1 <0,2,0,2>, <5,1,7,3>
+ 2551484759U, // <2,0,2,6>: Cost 3 vext1 <0,2,0,2>, <6,0,7,2>
+ 2551485434U, // <2,0,2,7>: Cost 3 vext1 <0,2,0,2>, <7,0,1,2>
+ 1477744430U, // <2,0,2,u>: Cost 2 vext1 <0,2,0,2>, LHS
+ 2953625600U, // <2,0,3,0>: Cost 3 vzipr LHS, <0,0,0,0>
+ 2953627302U, // <2,0,3,1>: Cost 3 vzipr LHS, <2,3,0,1>
+ 2953625764U, // <2,0,3,2>: Cost 3 vzipr LHS, <0,2,0,2>
+ 4027369695U, // <2,0,3,3>: Cost 4 vzipr LHS, <3,1,0,3>
+ 3625233718U, // <2,0,3,4>: Cost 4 vext1 <0,2,0,3>, RHS
+ 3899836110U, // <2,0,3,5>: Cost 4 vuzpr <1,2,3,0>, <2,3,4,5>
+ 4032012618U, // <2,0,3,6>: Cost 4 vzipr LHS, <0,4,0,6>
+ 3899835392U, // <2,0,3,7>: Cost 4 vuzpr <1,2,3,0>, <1,3,5,7>
+ 2953625770U, // <2,0,3,u>: Cost 3 vzipr LHS, <0,2,0,u>
+ 2551496806U, // <2,0,4,0>: Cost 3 vext1 <0,2,0,4>, LHS
+ 2685698386U, // <2,0,4,1>: Cost 3 vext3 <0,2,0,2>, <0,4,1,5>
+ 2685698396U, // <2,0,4,2>: Cost 3 vext3 <0,2,0,2>, <0,4,2,6>
+ 3625240726U, // <2,0,4,3>: Cost 4 vext1 <0,2,0,4>, <3,0,1,2>
+ 2551500086U, // <2,0,4,4>: Cost 3 vext1 <0,2,0,4>, RHS
+ 2618723638U, // <2,0,4,5>: Cost 3 vext2 <0,2,2,0>, RHS
+ 2765409590U, // <2,0,4,6>: Cost 3 vuzpl <2,3,0,1>, RHS
+ 3799990664U, // <2,0,4,7>: Cost 4 vext3 <7,0,1,2>, <0,4,7,5>
+ 2685698450U, // <2,0,4,u>: Cost 3 vext3 <0,2,0,2>, <0,4,u,6>
+ 3625246822U, // <2,0,5,0>: Cost 4 vext1 <0,2,0,5>, LHS
+ 3289776304U, // <2,0,5,1>: Cost 4 vrev <0,2,1,5>
+ 2690564526U, // <2,0,5,2>: Cost 3 vext3 <1,0,3,2>, <0,5,2,7>
+ 3289923778U, // <2,0,5,3>: Cost 4 vrev <0,2,3,5>
+ 2216255691U, // <2,0,5,4>: Cost 3 vrev <0,2,4,5>
+ 3726307332U, // <2,0,5,5>: Cost 4 vext2 <5,u,2,0>, <5,5,5,5>
+ 3726307426U, // <2,0,5,6>: Cost 4 vext2 <5,u,2,0>, <5,6,7,0>
+ 2826095926U, // <2,0,5,7>: Cost 3 vuzpr <1,2,3,0>, RHS
+ 2216550639U, // <2,0,5,u>: Cost 3 vrev <0,2,u,5>
+ 4162420736U, // <2,0,6,0>: Cost 4 vtrnr <0,2,4,6>, <0,0,0,0>
+ 2901885030U, // <2,0,6,1>: Cost 3 vzipl <2,6,3,7>, LHS
+ 2685698559U, // <2,0,6,2>: Cost 3 vext3 <0,2,0,2>, <0,6,2,7>
+ 3643173171U, // <2,0,6,3>: Cost 4 vext1 <3,2,0,6>, <3,2,0,6>
+ 2216263884U, // <2,0,6,4>: Cost 3 vrev <0,2,4,6>
+ 3730289341U, // <2,0,6,5>: Cost 4 vext2 <6,5,2,0>, <6,5,2,0>
+ 3726308152U, // <2,0,6,6>: Cost 4 vext2 <5,u,2,0>, <6,6,6,6>
+ 3899836346U, // <2,0,6,7>: Cost 4 vuzpr <1,2,3,0>, <2,6,3,7>
+ 2216558832U, // <2,0,6,u>: Cost 3 vrev <0,2,u,6>
+ 2659202049U, // <2,0,7,0>: Cost 3 vext2 <7,0,2,0>, <7,0,2,0>
+ 3726308437U, // <2,0,7,1>: Cost 4 vext2 <5,u,2,0>, <7,1,2,3>
+ 2726249034U, // <2,0,7,2>: Cost 3 vext3 <7,0,1,2>, <0,7,2,1>
+ 3734934772U, // <2,0,7,3>: Cost 4 vext2 <7,3,2,0>, <7,3,2,0>
+ 3726308710U, // <2,0,7,4>: Cost 4 vext2 <5,u,2,0>, <7,4,5,6>
+ 3726308814U, // <2,0,7,5>: Cost 4 vext2 <5,u,2,0>, <7,5,u,2>
+ 3736925671U, // <2,0,7,6>: Cost 4 vext2 <7,6,2,0>, <7,6,2,0>
+ 3726308972U, // <2,0,7,7>: Cost 4 vext2 <5,u,2,0>, <7,7,7,7>
+ 2659202049U, // <2,0,7,u>: Cost 3 vext2 <7,0,2,0>, <7,0,2,0>
+ 1477787750U, // <2,0,u,0>: Cost 2 vext1 <0,2,0,u>, LHS
+ 2953668262U, // <2,0,u,1>: Cost 3 vzipr LHS, <2,3,0,1>
+ 1611956893U, // <2,0,u,2>: Cost 2 vext3 <0,2,0,2>, LHS
+ 2551531670U, // <2,0,u,3>: Cost 3 vext1 <0,2,0,u>, <3,0,1,2>
+ 1477791030U, // <2,0,u,4>: Cost 2 vext1 <0,2,0,u>, RHS
+ 2618726554U, // <2,0,u,5>: Cost 3 vext2 <0,2,2,0>, RHS
+ 2765412506U, // <2,0,u,6>: Cost 3 vuzpl <2,3,0,1>, RHS
+ 2826096169U, // <2,0,u,7>: Cost 3 vuzpr <1,2,3,0>, RHS
+ 1611956947U, // <2,0,u,u>: Cost 2 vext3 <0,2,0,2>, LHS
+ 2569453670U, // <2,1,0,0>: Cost 3 vext1 <3,2,1,0>, LHS
+ 2619392102U, // <2,1,0,1>: Cost 3 vext2 <0,3,2,1>, LHS
+ 3759440619U, // <2,1,0,2>: Cost 4 vext3 <0,2,0,2>, <1,0,2,0>
+ 1616823030U, // <2,1,0,3>: Cost 2 vext3 <1,0,3,2>, <1,0,3,2>
+ 2569456950U, // <2,1,0,4>: Cost 3 vext1 <3,2,1,0>, RHS
+ 2690712328U, // <2,1,0,5>: Cost 3 vext3 <1,0,5,2>, <1,0,5,2>
+ 3661115841U, // <2,1,0,6>: Cost 4 vext1 <6,2,1,0>, <6,2,1,0>
+ 2622046794U, // <2,1,0,7>: Cost 3 vext2 <0,7,2,1>, <0,7,2,1>
+ 1617191715U, // <2,1,0,u>: Cost 2 vext3 <1,0,u,2>, <1,0,u,2>
+ 2551545958U, // <2,1,1,0>: Cost 3 vext1 <0,2,1,1>, LHS
+ 2685698868U, // <2,1,1,1>: Cost 3 vext3 <0,2,0,2>, <1,1,1,1>
+ 2628682646U, // <2,1,1,2>: Cost 3 vext2 <1,u,2,1>, <1,2,3,0>
+ 2685698888U, // <2,1,1,3>: Cost 3 vext3 <0,2,0,2>, <1,1,3,3>
+ 2551549238U, // <2,1,1,4>: Cost 3 vext1 <0,2,1,1>, RHS
+ 3693134992U, // <2,1,1,5>: Cost 4 vext2 <0,3,2,1>, <1,5,3,7>
+ 3661124034U, // <2,1,1,6>: Cost 4 vext1 <6,2,1,1>, <6,2,1,1>
+ 3625292794U, // <2,1,1,7>: Cost 4 vext1 <0,2,1,1>, <7,0,1,2>
+ 2685698933U, // <2,1,1,u>: Cost 3 vext3 <0,2,0,2>, <1,1,u,3>
+ 2551554150U, // <2,1,2,0>: Cost 3 vext1 <0,2,1,2>, LHS
+ 3893649571U, // <2,1,2,1>: Cost 4 vuzpr <0,2,0,1>, <0,2,0,1>
+ 2551555688U, // <2,1,2,2>: Cost 3 vext1 <0,2,1,2>, <2,2,2,2>
+ 2685698966U, // <2,1,2,3>: Cost 3 vext3 <0,2,0,2>, <1,2,3,0>
+ 2551557430U, // <2,1,2,4>: Cost 3 vext1 <0,2,1,2>, RHS
+ 3763422123U, // <2,1,2,5>: Cost 4 vext3 <0,u,0,2>, <1,2,5,3>
+ 3693135802U, // <2,1,2,6>: Cost 4 vext2 <0,3,2,1>, <2,6,3,7>
+ 2726249402U, // <2,1,2,7>: Cost 3 vext3 <7,0,1,2>, <1,2,7,0>
+ 2685699011U, // <2,1,2,u>: Cost 3 vext3 <0,2,0,2>, <1,2,u,0>
+ 2551562342U, // <2,1,3,0>: Cost 3 vext1 <0,2,1,3>, LHS
+ 2953625610U, // <2,1,3,1>: Cost 3 vzipr LHS, <0,0,1,1>
+ 2953627798U, // <2,1,3,2>: Cost 3 vzipr LHS, <3,0,1,2>
+ 2953626584U, // <2,1,3,3>: Cost 3 vzipr LHS, <1,3,1,3>
+ 2551565622U, // <2,1,3,4>: Cost 3 vext1 <0,2,1,3>, RHS
+ 2953625938U, // <2,1,3,5>: Cost 3 vzipr LHS, <0,4,1,5>
+ 2587398596U, // <2,1,3,6>: Cost 3 vext1 <6,2,1,3>, <6,2,1,3>
+ 4032013519U, // <2,1,3,7>: Cost 4 vzipr LHS, <1,6,1,7>
+ 2953625617U, // <2,1,3,u>: Cost 3 vzipr LHS, <0,0,1,u>
+ 2690565154U, // <2,1,4,0>: Cost 3 vext3 <1,0,3,2>, <1,4,0,5>
+ 3625313270U, // <2,1,4,1>: Cost 4 vext1 <0,2,1,4>, <1,3,4,6>
+ 3771532340U, // <2,1,4,2>: Cost 4 vext3 <2,2,2,2>, <1,4,2,5>
+ 1148404634U, // <2,1,4,3>: Cost 2 vrev <1,2,3,4>
+ 3625315638U, // <2,1,4,4>: Cost 4 vext1 <0,2,1,4>, RHS
+ 2619395382U, // <2,1,4,5>: Cost 3 vext2 <0,3,2,1>, RHS
+ 3837242678U, // <2,1,4,6>: Cost 4 vuzpl <2,0,1,2>, RHS
+ 3799991394U, // <2,1,4,7>: Cost 4 vext3 <7,0,1,2>, <1,4,7,6>
+ 1148773319U, // <2,1,4,u>: Cost 2 vrev <1,2,u,4>
+ 2551578726U, // <2,1,5,0>: Cost 3 vext1 <0,2,1,5>, LHS
+ 2551579648U, // <2,1,5,1>: Cost 3 vext1 <0,2,1,5>, <1,3,5,7>
+ 3625321952U, // <2,1,5,2>: Cost 4 vext1 <0,2,1,5>, <2,0,5,1>
+ 2685699216U, // <2,1,5,3>: Cost 3 vext3 <0,2,0,2>, <1,5,3,7>
+ 2551582006U, // <2,1,5,4>: Cost 3 vext1 <0,2,1,5>, RHS
+ 3740913668U, // <2,1,5,5>: Cost 4 vext2 <u,3,2,1>, <5,5,5,5>
+ 3661156806U, // <2,1,5,6>: Cost 4 vext1 <6,2,1,5>, <6,2,1,5>
+ 3893652790U, // <2,1,5,7>: Cost 4 vuzpr <0,2,0,1>, RHS
+ 2685699261U, // <2,1,5,u>: Cost 3 vext3 <0,2,0,2>, <1,5,u,7>
+ 2551586918U, // <2,1,6,0>: Cost 3 vext1 <0,2,1,6>, LHS
+ 3625329398U, // <2,1,6,1>: Cost 4 vext1 <0,2,1,6>, <1,0,3,2>
+ 2551588794U, // <2,1,6,2>: Cost 3 vext1 <0,2,1,6>, <2,6,3,7>
+ 3088679014U, // <2,1,6,3>: Cost 3 vtrnr <0,2,4,6>, LHS
+ 2551590198U, // <2,1,6,4>: Cost 3 vext1 <0,2,1,6>, RHS
+ 4029382994U, // <2,1,6,5>: Cost 4 vzipr <0,4,2,6>, <0,4,1,5>
+ 3625333560U, // <2,1,6,6>: Cost 4 vext1 <0,2,1,6>, <6,6,6,6>
+ 3731624800U, // <2,1,6,7>: Cost 4 vext2 <6,7,2,1>, <6,7,2,1>
+ 2551592750U, // <2,1,6,u>: Cost 3 vext1 <0,2,1,6>, LHS
+ 2622051322U, // <2,1,7,0>: Cost 3 vext2 <0,7,2,1>, <7,0,1,2>
+ 3733615699U, // <2,1,7,1>: Cost 4 vext2 <7,1,2,1>, <7,1,2,1>
+ 3795125538U, // <2,1,7,2>: Cost 4 vext3 <6,1,7,2>, <1,7,2,0>
+ 2222171037U, // <2,1,7,3>: Cost 3 vrev <1,2,3,7>
+ 3740915046U, // <2,1,7,4>: Cost 4 vext2 <u,3,2,1>, <7,4,5,6>
+ 3296060335U, // <2,1,7,5>: Cost 4 vrev <1,2,5,7>
+ 3736933864U, // <2,1,7,6>: Cost 4 vext2 <7,6,2,1>, <7,6,2,1>
+ 3805300055U, // <2,1,7,7>: Cost 4 vext3 <7,u,1,2>, <1,7,7,u>
+ 2669827714U, // <2,1,7,u>: Cost 3 vext2 <u,7,2,1>, <7,u,1,2>
+ 2551603302U, // <2,1,u,0>: Cost 3 vext1 <0,2,1,u>, LHS
+ 2953666570U, // <2,1,u,1>: Cost 3 vzipr LHS, <0,0,1,1>
+ 2953668758U, // <2,1,u,2>: Cost 3 vzipr LHS, <3,0,1,2>
+ 1148437406U, // <2,1,u,3>: Cost 2 vrev <1,2,3,u>
+ 2551606582U, // <2,1,u,4>: Cost 3 vext1 <0,2,1,u>, RHS
+ 2953666898U, // <2,1,u,5>: Cost 3 vzipr LHS, <0,4,1,5>
+ 2587398596U, // <2,1,u,6>: Cost 3 vext1 <6,2,1,3>, <6,2,1,3>
+ 2669828370U, // <2,1,u,7>: Cost 3 vext2 <u,7,2,1>, <u,7,2,1>
+ 1148806091U, // <2,1,u,u>: Cost 2 vrev <1,2,u,u>
+ 1543667732U, // <2,2,0,0>: Cost 2 vext2 <0,0,2,2>, <0,0,2,2>
+ 1548976230U, // <2,2,0,1>: Cost 2 vext2 <0,u,2,2>, LHS
+ 2685699524U, // <2,2,0,2>: Cost 3 vext3 <0,2,0,2>, <2,0,2,0>
+ 2685699535U, // <2,2,0,3>: Cost 3 vext3 <0,2,0,2>, <2,0,3,2>
+ 2551614774U, // <2,2,0,4>: Cost 3 vext1 <0,2,2,0>, RHS
+ 3704422830U, // <2,2,0,5>: Cost 4 vext2 <2,2,2,2>, <0,5,2,7>
+ 3893657642U, // <2,2,0,6>: Cost 4 vuzpr <0,2,0,2>, <0,0,4,6>
+ 3770574323U, // <2,2,0,7>: Cost 4 vext3 <2,0,7,2>, <2,0,7,2>
+ 1548976796U, // <2,2,0,u>: Cost 2 vext2 <0,u,2,2>, <0,u,2,2>
+ 2622718710U, // <2,2,1,0>: Cost 3 vext2 <0,u,2,2>, <1,0,3,2>
+ 2622718772U, // <2,2,1,1>: Cost 3 vext2 <0,u,2,2>, <1,1,1,1>
+ 2622718870U, // <2,2,1,2>: Cost 3 vext2 <0,u,2,2>, <1,2,3,0>
+ 2819915878U, // <2,2,1,3>: Cost 3 vuzpr <0,2,0,2>, LHS
+ 3625364790U, // <2,2,1,4>: Cost 4 vext1 <0,2,2,1>, RHS
+ 2622719120U, // <2,2,1,5>: Cost 3 vext2 <0,u,2,2>, <1,5,3,7>
+ 3760031292U, // <2,2,1,6>: Cost 4 vext3 <0,2,u,2>, <2,1,6,3>
+ 3667170468U, // <2,2,1,7>: Cost 4 vext1 <7,2,2,1>, <7,2,2,1>
+ 2819915883U, // <2,2,1,u>: Cost 3 vuzpr <0,2,0,2>, LHS
+ 1489829990U, // <2,2,2,0>: Cost 2 vext1 <2,2,2,2>, LHS
+ 2563572470U, // <2,2,2,1>: Cost 3 vext1 <2,2,2,2>, <1,0,3,2>
+ 269271142U, // <2,2,2,2>: Cost 1 vdup2 LHS
+ 2685699698U, // <2,2,2,3>: Cost 3 vext3 <0,2,0,2>, <2,2,3,3>
+ 1489833270U, // <2,2,2,4>: Cost 2 vext1 <2,2,2,2>, RHS
+ 2685699720U, // <2,2,2,5>: Cost 3 vext3 <0,2,0,2>, <2,2,5,7>
+ 2622719930U, // <2,2,2,6>: Cost 3 vext2 <0,u,2,2>, <2,6,3,7>
+ 2593436837U, // <2,2,2,7>: Cost 3 vext1 <7,2,2,2>, <7,2,2,2>
+ 269271142U, // <2,2,2,u>: Cost 1 vdup2 LHS
+ 2685699750U, // <2,2,3,0>: Cost 3 vext3 <0,2,0,2>, <2,3,0,1>
+ 2690565806U, // <2,2,3,1>: Cost 3 vext3 <1,0,3,2>, <2,3,1,0>
+ 2953627240U, // <2,2,3,2>: Cost 3 vzipr LHS, <2,2,2,2>
+ 1879883878U, // <2,2,3,3>: Cost 2 vzipr LHS, LHS
+ 2685699790U, // <2,2,3,4>: Cost 3 vext3 <0,2,0,2>, <2,3,4,5>
+ 3893659342U, // <2,2,3,5>: Cost 4 vuzpr <0,2,0,2>, <2,3,4,5>
+ 2958270812U, // <2,2,3,6>: Cost 3 vzipr LHS, <0,4,2,6>
+ 2593445030U, // <2,2,3,7>: Cost 3 vext1 <7,2,2,3>, <7,2,2,3>
+ 1879883883U, // <2,2,3,u>: Cost 2 vzipr LHS, LHS
+ 2551644262U, // <2,2,4,0>: Cost 3 vext1 <0,2,2,4>, LHS
+ 3625386742U, // <2,2,4,1>: Cost 4 vext1 <0,2,2,4>, <1,0,3,2>
+ 2551645902U, // <2,2,4,2>: Cost 3 vext1 <0,2,2,4>, <2,3,4,5>
+ 3759441686U, // <2,2,4,3>: Cost 4 vext3 <0,2,0,2>, <2,4,3,5>
+ 2551647542U, // <2,2,4,4>: Cost 3 vext1 <0,2,2,4>, RHS
+ 1548979510U, // <2,2,4,5>: Cost 2 vext2 <0,u,2,2>, RHS
+ 2764901686U, // <2,2,4,6>: Cost 3 vuzpl <2,2,2,2>, RHS
+ 3667195047U, // <2,2,4,7>: Cost 4 vext1 <7,2,2,4>, <7,2,2,4>
+ 1548979753U, // <2,2,4,u>: Cost 2 vext2 <0,u,2,2>, RHS
+ 3696463432U, // <2,2,5,0>: Cost 4 vext2 <0,u,2,2>, <5,0,1,2>
+ 2617413328U, // <2,2,5,1>: Cost 3 vext2 <0,0,2,2>, <5,1,7,3>
+ 2685699936U, // <2,2,5,2>: Cost 3 vext3 <0,2,0,2>, <2,5,2,7>
+ 4027383910U, // <2,2,5,3>: Cost 4 vzipr <0,1,2,5>, LHS
+ 2228201085U, // <2,2,5,4>: Cost 3 vrev <2,2,4,5>
+ 2617413636U, // <2,2,5,5>: Cost 3 vext2 <0,0,2,2>, <5,5,5,5>
+ 2617413730U, // <2,2,5,6>: Cost 3 vext2 <0,0,2,2>, <5,6,7,0>
+ 2819919158U, // <2,2,5,7>: Cost 3 vuzpr <0,2,0,2>, RHS
+ 2819919159U, // <2,2,5,u>: Cost 3 vuzpr <0,2,0,2>, RHS
+ 3625402554U, // <2,2,6,0>: Cost 4 vext1 <0,2,2,6>, <0,2,2,6>
+ 3760031652U, // <2,2,6,1>: Cost 4 vext3 <0,2,u,2>, <2,6,1,3>
+ 2617414138U, // <2,2,6,2>: Cost 3 vext2 <0,0,2,2>, <6,2,7,3>
+ 2685700026U, // <2,2,6,3>: Cost 3 vext3 <0,2,0,2>, <2,6,3,7>
+ 3625405750U, // <2,2,6,4>: Cost 4 vext1 <0,2,2,6>, RHS
+ 3760031692U, // <2,2,6,5>: Cost 4 vext3 <0,2,u,2>, <2,6,5,7>
+ 3088679116U, // <2,2,6,6>: Cost 3 vtrnr <0,2,4,6>, <0,2,4,6>
+ 2657891169U, // <2,2,6,7>: Cost 3 vext2 <6,7,2,2>, <6,7,2,2>
+ 2685700071U, // <2,2,6,u>: Cost 3 vext3 <0,2,0,2>, <2,6,u,7>
+ 2726250474U, // <2,2,7,0>: Cost 3 vext3 <7,0,1,2>, <2,7,0,1>
+ 3704427616U, // <2,2,7,1>: Cost 4 vext2 <2,2,2,2>, <7,1,3,5>
+ 2660545701U, // <2,2,7,2>: Cost 3 vext2 <7,2,2,2>, <7,2,2,2>
+ 4030718054U, // <2,2,7,3>: Cost 4 vzipr <0,6,2,7>, LHS
+ 2617415014U, // <2,2,7,4>: Cost 3 vext2 <0,0,2,2>, <7,4,5,6>
+ 3302033032U, // <2,2,7,5>: Cost 4 vrev <2,2,5,7>
+ 3661246929U, // <2,2,7,6>: Cost 4 vext1 <6,2,2,7>, <6,2,2,7>
+ 2617415276U, // <2,2,7,7>: Cost 3 vext2 <0,0,2,2>, <7,7,7,7>
+ 2731558962U, // <2,2,7,u>: Cost 3 vext3 <7,u,1,2>, <2,7,u,1>
+ 1489829990U, // <2,2,u,0>: Cost 2 vext1 <2,2,2,2>, LHS
+ 1548982062U, // <2,2,u,1>: Cost 2 vext2 <0,u,2,2>, LHS
+ 269271142U, // <2,2,u,2>: Cost 1 vdup2 LHS
+ 1879924838U, // <2,2,u,3>: Cost 2 vzipr LHS, LHS
+ 1489833270U, // <2,2,u,4>: Cost 2 vext1 <2,2,2,2>, RHS
+ 1548982426U, // <2,2,u,5>: Cost 2 vext2 <0,u,2,2>, RHS
+ 2953666908U, // <2,2,u,6>: Cost 3 vzipr LHS, <0,4,2,6>
+ 2819919401U, // <2,2,u,7>: Cost 3 vuzpr <0,2,0,2>, RHS
+ 269271142U, // <2,2,u,u>: Cost 1 vdup2 LHS
+ 1544339456U, // <2,3,0,0>: Cost 2 vext2 LHS, <0,0,0,0>
+ 470597734U, // <2,3,0,1>: Cost 1 vext2 LHS, LHS
+ 1548984484U, // <2,3,0,2>: Cost 2 vext2 LHS, <0,2,0,2>
+ 2619408648U, // <2,3,0,3>: Cost 3 vext2 <0,3,2,3>, <0,3,2,3>
+ 1548984658U, // <2,3,0,4>: Cost 2 vext2 LHS, <0,4,1,5>
+ 2665857454U, // <2,3,0,5>: Cost 3 vext2 LHS, <0,5,2,7>
+ 2622726655U, // <2,3,0,6>: Cost 3 vext2 LHS, <0,6,2,7>
+ 2593494188U, // <2,3,0,7>: Cost 3 vext1 <7,2,3,0>, <7,2,3,0>
+ 470598301U, // <2,3,0,u>: Cost 1 vext2 LHS, LHS
+ 1544340214U, // <2,3,1,0>: Cost 2 vext2 LHS, <1,0,3,2>
+ 1544340276U, // <2,3,1,1>: Cost 2 vext2 LHS, <1,1,1,1>
+ 1544340374U, // <2,3,1,2>: Cost 2 vext2 LHS, <1,2,3,0>
+ 1548985304U, // <2,3,1,3>: Cost 2 vext2 LHS, <1,3,1,3>
+ 2551696694U, // <2,3,1,4>: Cost 3 vext1 <0,2,3,1>, RHS
+ 1548985488U, // <2,3,1,5>: Cost 2 vext2 LHS, <1,5,3,7>
+ 2622727375U, // <2,3,1,6>: Cost 3 vext2 LHS, <1,6,1,7>
+ 2665858347U, // <2,3,1,7>: Cost 3 vext2 LHS, <1,7,3,0>
+ 1548985709U, // <2,3,1,u>: Cost 2 vext2 LHS, <1,u,1,3>
+ 2622727613U, // <2,3,2,0>: Cost 3 vext2 LHS, <2,0,1,2>
+ 2622727711U, // <2,3,2,1>: Cost 3 vext2 LHS, <2,1,3,1>
+ 1544341096U, // <2,3,2,2>: Cost 2 vext2 LHS, <2,2,2,2>
+ 1544341158U, // <2,3,2,3>: Cost 2 vext2 LHS, <2,3,0,1>
+ 2622727958U, // <2,3,2,4>: Cost 3 vext2 LHS, <2,4,3,5>
+ 2622728032U, // <2,3,2,5>: Cost 3 vext2 LHS, <2,5,2,7>
+ 1548986298U, // <2,3,2,6>: Cost 2 vext2 LHS, <2,6,3,7>
+ 2665859050U, // <2,3,2,7>: Cost 3 vext2 LHS, <2,7,0,1>
+ 1548986427U, // <2,3,2,u>: Cost 2 vext2 LHS, <2,u,0,1>
+ 1548986518U, // <2,3,3,0>: Cost 2 vext2 LHS, <3,0,1,2>
+ 2622728415U, // <2,3,3,1>: Cost 3 vext2 LHS, <3,1,0,3>
+ 1489913458U, // <2,3,3,2>: Cost 2 vext1 <2,2,3,3>, <2,2,3,3>
+ 1544341916U, // <2,3,3,3>: Cost 2 vext2 LHS, <3,3,3,3>
+ 1548986882U, // <2,3,3,4>: Cost 2 vext2 LHS, <3,4,5,6>
+ 2665859632U, // <2,3,3,5>: Cost 3 vext2 LHS, <3,5,1,7>
+ 2234304870U, // <2,3,3,6>: Cost 3 vrev <3,2,6,3>
+ 2958271632U, // <2,3,3,7>: Cost 3 vzipr LHS, <1,5,3,7>
+ 1548987166U, // <2,3,3,u>: Cost 2 vext2 LHS, <3,u,1,2>
+ 1483948134U, // <2,3,4,0>: Cost 2 vext1 <1,2,3,4>, LHS
+ 1483948954U, // <2,3,4,1>: Cost 2 vext1 <1,2,3,4>, <1,2,3,4>
+ 2622729276U, // <2,3,4,2>: Cost 3 vext2 LHS, <4,2,6,0>
+ 2557692054U, // <2,3,4,3>: Cost 3 vext1 <1,2,3,4>, <3,0,1,2>
+ 1483951414U, // <2,3,4,4>: Cost 2 vext1 <1,2,3,4>, RHS
+ 470601014U, // <2,3,4,5>: Cost 1 vext2 LHS, RHS
+ 1592118644U, // <2,3,4,6>: Cost 2 vext2 LHS, <4,6,4,6>
+ 2593526960U, // <2,3,4,7>: Cost 3 vext1 <7,2,3,4>, <7,2,3,4>
+ 470601257U, // <2,3,4,u>: Cost 1 vext2 LHS, RHS
+ 2551726182U, // <2,3,5,0>: Cost 3 vext1 <0,2,3,5>, LHS
+ 1592118992U, // <2,3,5,1>: Cost 2 vext2 LHS, <5,1,7,3>
+ 2665860862U, // <2,3,5,2>: Cost 3 vext2 LHS, <5,2,3,4>
+ 2551728642U, // <2,3,5,3>: Cost 3 vext1 <0,2,3,5>, <3,4,5,6>
+ 1592119238U, // <2,3,5,4>: Cost 2 vext2 LHS, <5,4,7,6>
+ 1592119300U, // <2,3,5,5>: Cost 2 vext2 LHS, <5,5,5,5>
+ 1592119394U, // <2,3,5,6>: Cost 2 vext2 LHS, <5,6,7,0>
+ 1592119464U, // <2,3,5,7>: Cost 2 vext2 LHS, <5,7,5,7>
+ 1592119545U, // <2,3,5,u>: Cost 2 vext2 LHS, <5,u,5,7>
+ 2622730529U, // <2,3,6,0>: Cost 3 vext2 LHS, <6,0,1,2>
+ 2557707164U, // <2,3,6,1>: Cost 3 vext1 <1,2,3,6>, <1,2,3,6>
+ 1592119802U, // <2,3,6,2>: Cost 2 vext2 LHS, <6,2,7,3>
+ 2665861682U, // <2,3,6,3>: Cost 3 vext2 LHS, <6,3,4,5>
+ 2622730893U, // <2,3,6,4>: Cost 3 vext2 LHS, <6,4,5,6>
+ 2665861810U, // <2,3,6,5>: Cost 3 vext2 LHS, <6,5,0,7>
+ 1592120120U, // <2,3,6,6>: Cost 2 vext2 LHS, <6,6,6,6>
+ 1592120142U, // <2,3,6,7>: Cost 2 vext2 LHS, <6,7,0,1>
+ 1592120223U, // <2,3,6,u>: Cost 2 vext2 LHS, <6,u,0,1>
+ 1592120314U, // <2,3,7,0>: Cost 2 vext2 LHS, <7,0,1,2>
+ 2659890261U, // <2,3,7,1>: Cost 3 vext2 <7,1,2,3>, <7,1,2,3>
+ 2660553894U, // <2,3,7,2>: Cost 3 vext2 <7,2,2,3>, <7,2,2,3>
+ 2665862371U, // <2,3,7,3>: Cost 3 vext2 LHS, <7,3,0,1>
+ 1592120678U, // <2,3,7,4>: Cost 2 vext2 LHS, <7,4,5,6>
+ 2665862534U, // <2,3,7,5>: Cost 3 vext2 LHS, <7,5,0,2>
+ 2665862614U, // <2,3,7,6>: Cost 3 vext2 LHS, <7,6,0,1>
+ 1592120940U, // <2,3,7,7>: Cost 2 vext2 LHS, <7,7,7,7>
+ 1592120962U, // <2,3,7,u>: Cost 2 vext2 LHS, <7,u,1,2>
+ 1548990163U, // <2,3,u,0>: Cost 2 vext2 LHS, <u,0,1,2>
+ 470603566U, // <2,3,u,1>: Cost 1 vext2 LHS, LHS
+ 1548990341U, // <2,3,u,2>: Cost 2 vext2 LHS, <u,2,3,0>
+ 1548990396U, // <2,3,u,3>: Cost 2 vext2 LHS, <u,3,0,1>
+ 1548990527U, // <2,3,u,4>: Cost 2 vext2 LHS, <u,4,5,6>
+ 470603930U, // <2,3,u,5>: Cost 1 vext2 LHS, RHS
+ 1548990672U, // <2,3,u,6>: Cost 2 vext2 LHS, <u,6,3,7>
+ 1592121600U, // <2,3,u,7>: Cost 2 vext2 LHS, <u,7,0,1>
+ 470604133U, // <2,3,u,u>: Cost 1 vext2 LHS, LHS
+ 2617425942U, // <2,4,0,0>: Cost 3 vext2 <0,0,2,4>, <0,0,2,4>
+ 2618753126U, // <2,4,0,1>: Cost 3 vext2 <0,2,2,4>, LHS
+ 2618753208U, // <2,4,0,2>: Cost 3 vext2 <0,2,2,4>, <0,2,2,4>
+ 2619416841U, // <2,4,0,3>: Cost 3 vext2 <0,3,2,4>, <0,3,2,4>
+ 2587593628U, // <2,4,0,4>: Cost 3 vext1 <6,2,4,0>, <4,0,6,2>
+ 2712832914U, // <2,4,0,5>: Cost 3 vext3 <4,6,u,2>, <4,0,5,1>
+ 1634962332U, // <2,4,0,6>: Cost 2 vext3 <4,0,6,2>, <4,0,6,2>
+ 3799993252U, // <2,4,0,7>: Cost 4 vext3 <7,0,1,2>, <4,0,7,1>
+ 1634962332U, // <2,4,0,u>: Cost 2 vext3 <4,0,6,2>, <4,0,6,2>
+ 2619417334U, // <2,4,1,0>: Cost 3 vext2 <0,3,2,4>, <1,0,3,2>
+ 3692495668U, // <2,4,1,1>: Cost 4 vext2 <0,2,2,4>, <1,1,1,1>
+ 2625389466U, // <2,4,1,2>: Cost 3 vext2 <1,3,2,4>, <1,2,3,4>
+ 2826125414U, // <2,4,1,3>: Cost 3 vuzpr <1,2,3,4>, LHS
+ 3699794995U, // <2,4,1,4>: Cost 4 vext2 <1,4,2,4>, <1,4,2,4>
+ 3692496016U, // <2,4,1,5>: Cost 4 vext2 <0,2,2,4>, <1,5,3,7>
+ 3763424238U, // <2,4,1,6>: Cost 4 vext3 <0,u,0,2>, <4,1,6,3>
+ 3667317942U, // <2,4,1,7>: Cost 4 vext1 <7,2,4,1>, <7,2,4,1>
+ 2826125419U, // <2,4,1,u>: Cost 3 vuzpr <1,2,3,4>, LHS
+ 2629371336U, // <2,4,2,0>: Cost 3 vext2 <2,0,2,4>, <2,0,2,4>
+ 3699131946U, // <2,4,2,1>: Cost 4 vext2 <1,3,2,4>, <2,1,4,3>
+ 2630698602U, // <2,4,2,2>: Cost 3 vext2 <2,2,2,4>, <2,2,2,4>
+ 2618754766U, // <2,4,2,3>: Cost 3 vext2 <0,2,2,4>, <2,3,4,5>
+ 2826126234U, // <2,4,2,4>: Cost 3 vuzpr <1,2,3,4>, <1,2,3,4>
+ 2899119414U, // <2,4,2,5>: Cost 3 vzipl <2,2,2,2>, RHS
+ 3033337142U, // <2,4,2,6>: Cost 3 vtrnl <2,2,2,2>, RHS
+ 3800214597U, // <2,4,2,7>: Cost 4 vext3 <7,0,4,2>, <4,2,7,0>
+ 2899119657U, // <2,4,2,u>: Cost 3 vzipl <2,2,2,2>, RHS
+ 2635344033U, // <2,4,3,0>: Cost 3 vext2 <3,0,2,4>, <3,0,2,4>
+ 4032012325U, // <2,4,3,1>: Cost 4 vzipr LHS, <0,0,4,1>
+ 3692497228U, // <2,4,3,2>: Cost 4 vext2 <0,2,2,4>, <3,2,3,4>
+ 3692497308U, // <2,4,3,3>: Cost 4 vext2 <0,2,2,4>, <3,3,3,3>
+ 3001404624U, // <2,4,3,4>: Cost 3 vzipr LHS, <4,4,4,4>
+ 2953627342U, // <2,4,3,5>: Cost 3 vzipr LHS, <2,3,4,5>
+ 2953625804U, // <2,4,3,6>: Cost 3 vzipr LHS, <0,2,4,6>
+ 3899868160U, // <2,4,3,7>: Cost 4 vuzpr <1,2,3,4>, <1,3,5,7>
+ 2953625806U, // <2,4,3,u>: Cost 3 vzipr LHS, <0,2,4,u>
+ 2710916266U, // <2,4,4,0>: Cost 3 vext3 <4,4,0,2>, <4,4,0,2>
+ 3899869648U, // <2,4,4,1>: Cost 4 vuzpr <1,2,3,4>, <3,4,0,1>
+ 3899869658U, // <2,4,4,2>: Cost 4 vuzpr <1,2,3,4>, <3,4,1,2>
+ 3899868930U, // <2,4,4,3>: Cost 4 vuzpr <1,2,3,4>, <2,4,1,3>
+ 2712833232U, // <2,4,4,4>: Cost 3 vext3 <4,6,u,2>, <4,4,4,4>
+ 2618756406U, // <2,4,4,5>: Cost 3 vext2 <0,2,2,4>, RHS
+ 2765737270U, // <2,4,4,6>: Cost 3 vuzpl <2,3,4,5>, RHS
+ 4168304426U, // <2,4,4,7>: Cost 4 vtrnr <1,2,3,4>, <2,4,5,7>
+ 2618756649U, // <2,4,4,u>: Cost 3 vext2 <0,2,2,4>, RHS
+ 2551800011U, // <2,4,5,0>: Cost 3 vext1 <0,2,4,5>, <0,2,4,5>
+ 2569716470U, // <2,4,5,1>: Cost 3 vext1 <3,2,4,5>, <1,0,3,2>
+ 2563745405U, // <2,4,5,2>: Cost 3 vext1 <2,2,4,5>, <2,2,4,5>
+ 2569718102U, // <2,4,5,3>: Cost 3 vext1 <3,2,4,5>, <3,2,4,5>
+ 2551803190U, // <2,4,5,4>: Cost 3 vext1 <0,2,4,5>, RHS
+ 3625545732U, // <2,4,5,5>: Cost 4 vext1 <0,2,4,5>, <5,5,5,5>
+ 1611959606U, // <2,4,5,6>: Cost 2 vext3 <0,2,0,2>, RHS
+ 2826128694U, // <2,4,5,7>: Cost 3 vuzpr <1,2,3,4>, RHS
+ 1611959624U, // <2,4,5,u>: Cost 2 vext3 <0,2,0,2>, RHS
+ 1478066278U, // <2,4,6,0>: Cost 2 vext1 <0,2,4,6>, LHS
+ 2551808758U, // <2,4,6,1>: Cost 3 vext1 <0,2,4,6>, <1,0,3,2>
+ 2551809516U, // <2,4,6,2>: Cost 3 vext1 <0,2,4,6>, <2,0,6,4>
+ 2551810198U, // <2,4,6,3>: Cost 3 vext1 <0,2,4,6>, <3,0,1,2>
+ 1478069558U, // <2,4,6,4>: Cost 2 vext1 <0,2,4,6>, RHS
+ 2901888310U, // <2,4,6,5>: Cost 3 vzipl <2,6,3,7>, RHS
+ 2551812920U, // <2,4,6,6>: Cost 3 vext1 <0,2,4,6>, <6,6,6,6>
+ 2726251914U, // <2,4,6,7>: Cost 3 vext3 <7,0,1,2>, <4,6,7,1>
+ 1478072110U, // <2,4,6,u>: Cost 2 vext1 <0,2,4,6>, LHS
+ 2659234821U, // <2,4,7,0>: Cost 3 vext2 <7,0,2,4>, <7,0,2,4>
+ 3786722726U, // <2,4,7,1>: Cost 4 vext3 <4,7,1,2>, <4,7,1,2>
+ 3734303911U, // <2,4,7,2>: Cost 4 vext2 <7,2,2,4>, <7,2,2,4>
+ 3734967544U, // <2,4,7,3>: Cost 4 vext2 <7,3,2,4>, <7,3,2,4>
+ 3727005030U, // <2,4,7,4>: Cost 4 vext2 <6,0,2,4>, <7,4,5,6>
+ 2726251976U, // <2,4,7,5>: Cost 3 vext3 <7,0,1,2>, <4,7,5,0>
+ 2726251986U, // <2,4,7,6>: Cost 3 vext3 <7,0,1,2>, <4,7,6,1>
+ 3727005292U, // <2,4,7,7>: Cost 4 vext2 <6,0,2,4>, <7,7,7,7>
+ 2659234821U, // <2,4,7,u>: Cost 3 vext2 <7,0,2,4>, <7,0,2,4>
+ 1478082662U, // <2,4,u,0>: Cost 2 vext1 <0,2,4,u>, LHS
+ 2618758958U, // <2,4,u,1>: Cost 3 vext2 <0,2,2,4>, LHS
+ 2551826024U, // <2,4,u,2>: Cost 3 vext1 <0,2,4,u>, <2,2,2,2>
+ 2551826582U, // <2,4,u,3>: Cost 3 vext1 <0,2,4,u>, <3,0,1,2>
+ 1478085942U, // <2,4,u,4>: Cost 2 vext1 <0,2,4,u>, RHS
+ 2953668302U, // <2,4,u,5>: Cost 3 vzipr LHS, <2,3,4,5>
+ 1611959849U, // <2,4,u,6>: Cost 2 vext3 <0,2,0,2>, RHS
+ 2826128937U, // <2,4,u,7>: Cost 3 vuzpr <1,2,3,4>, RHS
+ 1611959867U, // <2,4,u,u>: Cost 2 vext3 <0,2,0,2>, RHS
+ 3691839488U, // <2,5,0,0>: Cost 4 vext2 <0,1,2,5>, <0,0,0,0>
+ 2618097766U, // <2,5,0,1>: Cost 3 vext2 <0,1,2,5>, LHS
+ 2620088484U, // <2,5,0,2>: Cost 3 vext2 <0,4,2,5>, <0,2,0,2>
+ 2619425034U, // <2,5,0,3>: Cost 3 vext2 <0,3,2,5>, <0,3,2,5>
+ 2620088667U, // <2,5,0,4>: Cost 3 vext2 <0,4,2,5>, <0,4,2,5>
+ 2620752300U, // <2,5,0,5>: Cost 3 vext2 <0,5,2,5>, <0,5,2,5>
+ 3693830655U, // <2,5,0,6>: Cost 4 vext2 <0,4,2,5>, <0,6,2,7>
+ 3094531382U, // <2,5,0,7>: Cost 3 vtrnr <1,2,3,0>, RHS
+ 2618098333U, // <2,5,0,u>: Cost 3 vext2 <0,1,2,5>, LHS
+ 3691840246U, // <2,5,1,0>: Cost 4 vext2 <0,1,2,5>, <1,0,3,2>
+ 3691840308U, // <2,5,1,1>: Cost 4 vext2 <0,1,2,5>, <1,1,1,1>
+ 2626061206U, // <2,5,1,2>: Cost 3 vext2 <1,4,2,5>, <1,2,3,0>
+ 2618098688U, // <2,5,1,3>: Cost 3 vext2 <0,1,2,5>, <1,3,5,7>
+ 2626061364U, // <2,5,1,4>: Cost 3 vext2 <1,4,2,5>, <1,4,2,5>
+ 3691840656U, // <2,5,1,5>: Cost 4 vext2 <0,1,2,5>, <1,5,3,7>
+ 3789082310U, // <2,5,1,6>: Cost 4 vext3 <5,1,6,2>, <5,1,6,2>
+ 2712833744U, // <2,5,1,7>: Cost 3 vext3 <4,6,u,2>, <5,1,7,3>
+ 2628715896U, // <2,5,1,u>: Cost 3 vext2 <1,u,2,5>, <1,u,2,5>
+ 3693831613U, // <2,5,2,0>: Cost 4 vext2 <0,4,2,5>, <2,0,1,2>
+ 4026698642U, // <2,5,2,1>: Cost 4 vzipr <0,0,2,2>, <4,0,5,1>
+ 2632033896U, // <2,5,2,2>: Cost 3 vext2 <2,4,2,5>, <2,2,2,2>
+ 3691841190U, // <2,5,2,3>: Cost 4 vext2 <0,1,2,5>, <2,3,0,1>
+ 2632034061U, // <2,5,2,4>: Cost 3 vext2 <2,4,2,5>, <2,4,2,5>
+ 3691841352U, // <2,5,2,5>: Cost 4 vext2 <0,1,2,5>, <2,5,0,1>
+ 3691841466U, // <2,5,2,6>: Cost 4 vext2 <0,1,2,5>, <2,6,3,7>
+ 3088354614U, // <2,5,2,7>: Cost 3 vtrnr <0,2,0,2>, RHS
+ 3088354615U, // <2,5,2,u>: Cost 3 vtrnr <0,2,0,2>, RHS
+ 2557829222U, // <2,5,3,0>: Cost 3 vext1 <1,2,5,3>, LHS
+ 2557830059U, // <2,5,3,1>: Cost 3 vext1 <1,2,5,3>, <1,2,5,3>
+ 2575746766U, // <2,5,3,2>: Cost 3 vext1 <4,2,5,3>, <2,3,4,5>
+ 3691841948U, // <2,5,3,3>: Cost 4 vext2 <0,1,2,5>, <3,3,3,3>
+ 2619427330U, // <2,5,3,4>: Cost 3 vext2 <0,3,2,5>, <3,4,5,6>
+ 2581720847U, // <2,5,3,5>: Cost 3 vext1 <5,2,5,3>, <5,2,5,3>
+ 2953628162U, // <2,5,3,6>: Cost 3 vzipr LHS, <3,4,5,6>
+ 2953626624U, // <2,5,3,7>: Cost 3 vzipr LHS, <1,3,5,7>
+ 2953626625U, // <2,5,3,u>: Cost 3 vzipr LHS, <1,3,5,u>
+ 2569781350U, // <2,5,4,0>: Cost 3 vext1 <3,2,5,4>, LHS
+ 3631580076U, // <2,5,4,1>: Cost 4 vext1 <1,2,5,4>, <1,2,5,4>
+ 2569782990U, // <2,5,4,2>: Cost 3 vext1 <3,2,5,4>, <2,3,4,5>
+ 2569783646U, // <2,5,4,3>: Cost 3 vext1 <3,2,5,4>, <3,2,5,4>
+ 2569784630U, // <2,5,4,4>: Cost 3 vext1 <3,2,5,4>, RHS
+ 2618101046U, // <2,5,4,5>: Cost 3 vext2 <0,1,2,5>, RHS
+ 3893905922U, // <2,5,4,6>: Cost 4 vuzpr <0,2,3,5>, <3,4,5,6>
+ 3094564150U, // <2,5,4,7>: Cost 3 vtrnr <1,2,3,4>, RHS
+ 2618101289U, // <2,5,4,u>: Cost 3 vext2 <0,1,2,5>, RHS
+ 2551873638U, // <2,5,5,0>: Cost 3 vext1 <0,2,5,5>, LHS
+ 3637560320U, // <2,5,5,1>: Cost 4 vext1 <2,2,5,5>, <1,3,5,7>
+ 3637560966U, // <2,5,5,2>: Cost 4 vext1 <2,2,5,5>, <2,2,5,5>
+ 3723030343U, // <2,5,5,3>: Cost 4 vext2 <5,3,2,5>, <5,3,2,5>
+ 2551876918U, // <2,5,5,4>: Cost 3 vext1 <0,2,5,5>, RHS
+ 2712834052U, // <2,5,5,5>: Cost 3 vext3 <4,6,u,2>, <5,5,5,5>
+ 4028713474U, // <2,5,5,6>: Cost 4 vzipr <0,3,2,5>, <3,4,5,6>
+ 2712834072U, // <2,5,5,7>: Cost 3 vext3 <4,6,u,2>, <5,5,7,7>
+ 2712834081U, // <2,5,5,u>: Cost 3 vext3 <4,6,u,2>, <5,5,u,7>
+ 2575769702U, // <2,5,6,0>: Cost 3 vext1 <4,2,5,6>, LHS
+ 3631596462U, // <2,5,6,1>: Cost 4 vext1 <1,2,5,6>, <1,2,5,6>
+ 2655924730U, // <2,5,6,2>: Cost 3 vext2 <6,4,2,5>, <6,2,7,3>
+ 3643541856U, // <2,5,6,3>: Cost 4 vext1 <3,2,5,6>, <3,2,5,6>
+ 2655924849U, // <2,5,6,4>: Cost 3 vext2 <6,4,2,5>, <6,4,2,5>
+ 3787755607U, // <2,5,6,5>: Cost 4 vext3 <4,u,6,2>, <5,6,5,7>
+ 4029385218U, // <2,5,6,6>: Cost 4 vzipr <0,4,2,6>, <3,4,5,6>
+ 3088682294U, // <2,5,6,7>: Cost 3 vtrnr <0,2,4,6>, RHS
+ 3088682295U, // <2,5,6,u>: Cost 3 vtrnr <0,2,4,6>, RHS
+ 2563833958U, // <2,5,7,0>: Cost 3 vext1 <2,2,5,7>, LHS
+ 2551890678U, // <2,5,7,1>: Cost 3 vext1 <0,2,5,7>, <1,0,3,2>
+ 2563835528U, // <2,5,7,2>: Cost 3 vext1 <2,2,5,7>, <2,2,5,7>
+ 3637577878U, // <2,5,7,3>: Cost 4 vext1 <2,2,5,7>, <3,0,1,2>
+ 2563837238U, // <2,5,7,4>: Cost 3 vext1 <2,2,5,7>, RHS
+ 2712834216U, // <2,5,7,5>: Cost 3 vext3 <4,6,u,2>, <5,7,5,7>
+ 2712834220U, // <2,5,7,6>: Cost 3 vext3 <4,6,u,2>, <5,7,6,2>
+ 4174449974U, // <2,5,7,7>: Cost 4 vtrnr <2,2,5,7>, RHS
+ 2563839790U, // <2,5,7,u>: Cost 3 vext1 <2,2,5,7>, LHS
+ 2563842150U, // <2,5,u,0>: Cost 3 vext1 <2,2,5,u>, LHS
+ 2618103598U, // <2,5,u,1>: Cost 3 vext2 <0,1,2,5>, LHS
+ 2563843721U, // <2,5,u,2>: Cost 3 vext1 <2,2,5,u>, <2,2,5,u>
+ 2569816418U, // <2,5,u,3>: Cost 3 vext1 <3,2,5,u>, <3,2,5,u>
+ 2622748735U, // <2,5,u,4>: Cost 3 vext2 <0,u,2,5>, <u,4,5,6>
+ 2618103962U, // <2,5,u,5>: Cost 3 vext2 <0,1,2,5>, RHS
+ 2953669122U, // <2,5,u,6>: Cost 3 vzipr LHS, <3,4,5,6>
+ 2953667584U, // <2,5,u,7>: Cost 3 vzipr LHS, <1,3,5,7>
+ 2618104165U, // <2,5,u,u>: Cost 3 vext2 <0,1,2,5>, LHS
+ 2620096512U, // <2,6,0,0>: Cost 3 vext2 <0,4,2,6>, <0,0,0,0>
+ 1546354790U, // <2,6,0,1>: Cost 2 vext2 <0,4,2,6>, LHS
+ 2620096676U, // <2,6,0,2>: Cost 3 vext2 <0,4,2,6>, <0,2,0,2>
+ 3693838588U, // <2,6,0,3>: Cost 4 vext2 <0,4,2,6>, <0,3,1,0>
+ 1546355036U, // <2,6,0,4>: Cost 2 vext2 <0,4,2,6>, <0,4,2,6>
+ 3694502317U, // <2,6,0,5>: Cost 4 vext2 <0,5,2,6>, <0,5,2,6>
+ 2551911246U, // <2,6,0,6>: Cost 3 vext1 <0,2,6,0>, <6,7,0,1>
+ 2720723287U, // <2,6,0,7>: Cost 3 vext3 <6,0,7,2>, <6,0,7,2>
+ 1546355357U, // <2,6,0,u>: Cost 2 vext2 <0,4,2,6>, LHS
+ 2620097270U, // <2,6,1,0>: Cost 3 vext2 <0,4,2,6>, <1,0,3,2>
+ 2620097332U, // <2,6,1,1>: Cost 3 vext2 <0,4,2,6>, <1,1,1,1>
+ 2620097430U, // <2,6,1,2>: Cost 3 vext2 <0,4,2,6>, <1,2,3,0>
+ 2820243558U, // <2,6,1,3>: Cost 3 vuzpr <0,2,4,6>, LHS
+ 2620097598U, // <2,6,1,4>: Cost 3 vext2 <0,4,2,6>, <1,4,3,6>
+ 2620097680U, // <2,6,1,5>: Cost 3 vext2 <0,4,2,6>, <1,5,3,7>
+ 3693839585U, // <2,6,1,6>: Cost 4 vext2 <0,4,2,6>, <1,6,3,7>
+ 2721386920U, // <2,6,1,7>: Cost 3 vext3 <6,1,7,2>, <6,1,7,2>
+ 2820243563U, // <2,6,1,u>: Cost 3 vuzpr <0,2,4,6>, LHS
+ 2714014137U, // <2,6,2,0>: Cost 3 vext3 <4,u,6,2>, <6,2,0,1>
+ 2712834500U, // <2,6,2,1>: Cost 3 vext3 <4,6,u,2>, <6,2,1,3>
+ 2620098152U, // <2,6,2,2>: Cost 3 vext2 <0,4,2,6>, <2,2,2,2>
+ 2620098214U, // <2,6,2,3>: Cost 3 vext2 <0,4,2,6>, <2,3,0,1>
+ 2632042254U, // <2,6,2,4>: Cost 3 vext2 <2,4,2,6>, <2,4,2,6>
+ 2712834540U, // <2,6,2,5>: Cost 3 vext3 <4,6,u,2>, <6,2,5,7>
+ 2820243660U, // <2,6,2,6>: Cost 3 vuzpr <0,2,4,6>, <0,2,4,6>
+ 2958265654U, // <2,6,2,7>: Cost 3 vzipr <0,u,2,2>, RHS
+ 2620098619U, // <2,6,2,u>: Cost 3 vext2 <0,4,2,6>, <2,u,0,1>
+ 2620098710U, // <2,6,3,0>: Cost 3 vext2 <0,4,2,6>, <3,0,1,2>
+ 3893986982U, // <2,6,3,1>: Cost 4 vuzpr <0,2,4,6>, <2,3,0,1>
+ 2569848762U, // <2,6,3,2>: Cost 3 vext1 <3,2,6,3>, <2,6,3,7>
+ 2620098972U, // <2,6,3,3>: Cost 3 vext2 <0,4,2,6>, <3,3,3,3>
+ 2620099074U, // <2,6,3,4>: Cost 3 vext2 <0,4,2,6>, <3,4,5,6>
+ 3893987022U, // <2,6,3,5>: Cost 4 vuzpr <0,2,4,6>, <2,3,4,5>
+ 3001404644U, // <2,6,3,6>: Cost 3 vzipr LHS, <4,4,6,6>
+ 1879887158U, // <2,6,3,7>: Cost 2 vzipr LHS, RHS
+ 1879887159U, // <2,6,3,u>: Cost 2 vzipr LHS, RHS
+ 2620099484U, // <2,6,4,0>: Cost 3 vext2 <0,4,2,6>, <4,0,6,2>
+ 2620099566U, // <2,6,4,1>: Cost 3 vext2 <0,4,2,6>, <4,1,6,3>
+ 2620099644U, // <2,6,4,2>: Cost 3 vext2 <0,4,2,6>, <4,2,6,0>
+ 3643599207U, // <2,6,4,3>: Cost 4 vext1 <3,2,6,4>, <3,2,6,4>
+ 2575830080U, // <2,6,4,4>: Cost 3 vext1 <4,2,6,4>, <4,2,6,4>
+ 1546358070U, // <2,6,4,5>: Cost 2 vext2 <0,4,2,6>, RHS
+ 2667875700U, // <2,6,4,6>: Cost 3 vext2 <u,4,2,6>, <4,6,4,6>
+ 4028042550U, // <2,6,4,7>: Cost 4 vzipr <0,2,2,4>, RHS
+ 1546358313U, // <2,6,4,u>: Cost 2 vext2 <0,4,2,6>, RHS
+ 3693841992U, // <2,6,5,0>: Cost 4 vext2 <0,4,2,6>, <5,0,1,2>
+ 2667876048U, // <2,6,5,1>: Cost 3 vext2 <u,4,2,6>, <5,1,7,3>
+ 2712834756U, // <2,6,5,2>: Cost 3 vext3 <4,6,u,2>, <6,5,2,7>
+ 3643607400U, // <2,6,5,3>: Cost 4 vext1 <3,2,6,5>, <3,2,6,5>
+ 2252091873U, // <2,6,5,4>: Cost 3 vrev <6,2,4,5>
+ 2667876356U, // <2,6,5,5>: Cost 3 vext2 <u,4,2,6>, <5,5,5,5>
+ 2667876450U, // <2,6,5,6>: Cost 3 vext2 <u,4,2,6>, <5,6,7,0>
+ 2820246838U, // <2,6,5,7>: Cost 3 vuzpr <0,2,4,6>, RHS
+ 2820246839U, // <2,6,5,u>: Cost 3 vuzpr <0,2,4,6>, RHS
+ 2563899494U, // <2,6,6,0>: Cost 3 vext1 <2,2,6,6>, LHS
+ 3893988683U, // <2,6,6,1>: Cost 4 vuzpr <0,2,4,6>, <4,6,0,1>
+ 2563901072U, // <2,6,6,2>: Cost 3 vext1 <2,2,6,6>, <2,2,6,6>
+ 3893987236U, // <2,6,6,3>: Cost 4 vuzpr <0,2,4,6>, <2,6,1,3>
+ 2563902774U, // <2,6,6,4>: Cost 3 vext1 <2,2,6,6>, RHS
+ 3893988723U, // <2,6,6,5>: Cost 4 vuzpr <0,2,4,6>, <4,6,4,5>
+ 2712834872U, // <2,6,6,6>: Cost 3 vext3 <4,6,u,2>, <6,6,6,6>
+ 2955644214U, // <2,6,6,7>: Cost 3 vzipr <0,4,2,6>, RHS
+ 2955644215U, // <2,6,6,u>: Cost 3 vzipr <0,4,2,6>, RHS
+ 2712834894U, // <2,6,7,0>: Cost 3 vext3 <4,6,u,2>, <6,7,0,1>
+ 2724926296U, // <2,6,7,1>: Cost 3 vext3 <6,7,1,2>, <6,7,1,2>
+ 2725000033U, // <2,6,7,2>: Cost 3 vext3 <6,7,2,2>, <6,7,2,2>
+ 2702365544U, // <2,6,7,3>: Cost 3 vext3 <3,0,1,2>, <6,7,3,0>
+ 2712834934U, // <2,6,7,4>: Cost 3 vext3 <4,6,u,2>, <6,7,4,5>
+ 3776107393U, // <2,6,7,5>: Cost 4 vext3 <3,0,1,2>, <6,7,5,7>
+ 2725294981U, // <2,6,7,6>: Cost 3 vext3 <6,7,6,2>, <6,7,6,2>
+ 2726253452U, // <2,6,7,7>: Cost 3 vext3 <7,0,1,2>, <6,7,7,0>
+ 2712834966U, // <2,6,7,u>: Cost 3 vext3 <4,6,u,2>, <6,7,u,1>
+ 2620102355U, // <2,6,u,0>: Cost 3 vext2 <0,4,2,6>, <u,0,1,2>
+ 1546360622U, // <2,6,u,1>: Cost 2 vext2 <0,4,2,6>, LHS
+ 2620102536U, // <2,6,u,2>: Cost 3 vext2 <0,4,2,6>, <u,2,3,3>
+ 2820244125U, // <2,6,u,3>: Cost 3 vuzpr <0,2,4,6>, LHS
+ 1594136612U, // <2,6,u,4>: Cost 2 vext2 <u,4,2,6>, <u,4,2,6>
+ 1546360986U, // <2,6,u,5>: Cost 2 vext2 <0,4,2,6>, RHS
+ 2620102864U, // <2,6,u,6>: Cost 3 vext2 <0,4,2,6>, <u,6,3,7>
+ 1879928118U, // <2,6,u,7>: Cost 2 vzipr LHS, RHS
+ 1879928119U, // <2,6,u,u>: Cost 2 vzipr LHS, RHS
+ 2726179825U, // <2,7,0,0>: Cost 3 vext3 <7,0,0,2>, <7,0,0,2>
+ 1652511738U, // <2,7,0,1>: Cost 2 vext3 <7,0,1,2>, <7,0,1,2>
+ 2621431972U, // <2,7,0,2>: Cost 3 vext2 <0,6,2,7>, <0,2,0,2>
+ 2257949868U, // <2,7,0,3>: Cost 3 vrev <7,2,3,0>
+ 2726474773U, // <2,7,0,4>: Cost 3 vext3 <7,0,4,2>, <7,0,4,2>
+ 2620768686U, // <2,7,0,5>: Cost 3 vext2 <0,5,2,7>, <0,5,2,7>
+ 2621432319U, // <2,7,0,6>: Cost 3 vext2 <0,6,2,7>, <0,6,2,7>
+ 2599760953U, // <2,7,0,7>: Cost 3 vext1 <u,2,7,0>, <7,0,u,2>
+ 1653027897U, // <2,7,0,u>: Cost 2 vext3 <7,0,u,2>, <7,0,u,2>
+ 2639348470U, // <2,7,1,0>: Cost 3 vext2 <3,6,2,7>, <1,0,3,2>
+ 3695174452U, // <2,7,1,1>: Cost 4 vext2 <0,6,2,7>, <1,1,1,1>
+ 3695174550U, // <2,7,1,2>: Cost 4 vext2 <0,6,2,7>, <1,2,3,0>
+ 3694511104U, // <2,7,1,3>: Cost 4 vext2 <0,5,2,7>, <1,3,5,7>
+ 3713090594U, // <2,7,1,4>: Cost 4 vext2 <3,6,2,7>, <1,4,0,5>
+ 3693184144U, // <2,7,1,5>: Cost 4 vext2 <0,3,2,7>, <1,5,3,7>
+ 2627405016U, // <2,7,1,6>: Cost 3 vext2 <1,6,2,7>, <1,6,2,7>
+ 3799995519U, // <2,7,1,7>: Cost 4 vext3 <7,0,1,2>, <7,1,7,0>
+ 2639348470U, // <2,7,1,u>: Cost 3 vext2 <3,6,2,7>, <1,0,3,2>
+ 3695175101U, // <2,7,2,0>: Cost 4 vext2 <0,6,2,7>, <2,0,1,2>
+ 3643655168U, // <2,7,2,1>: Cost 4 vext1 <3,2,7,2>, <1,3,5,7>
+ 2257892517U, // <2,7,2,2>: Cost 3 vrev <7,2,2,2>
+ 3695175334U, // <2,7,2,3>: Cost 4 vext2 <0,6,2,7>, <2,3,0,1>
+ 3695175465U, // <2,7,2,4>: Cost 4 vext2 <0,6,2,7>, <2,4,5,6>
+ 2632714080U, // <2,7,2,5>: Cost 3 vext2 <2,5,2,7>, <2,5,2,7>
+ 2633377713U, // <2,7,2,6>: Cost 3 vext2 <2,6,2,7>, <2,6,2,7>
+ 3695175658U, // <2,7,2,7>: Cost 4 vext2 <0,6,2,7>, <2,7,0,1>
+ 2634704979U, // <2,7,2,u>: Cost 3 vext2 <2,u,2,7>, <2,u,2,7>
+ 1514094694U, // <2,7,3,0>: Cost 2 vext1 <6,2,7,3>, LHS
+ 2569921680U, // <2,7,3,1>: Cost 3 vext1 <3,2,7,3>, <1,5,3,7>
+ 2587838056U, // <2,7,3,2>: Cost 3 vext1 <6,2,7,3>, <2,2,2,2>
+ 2569922927U, // <2,7,3,3>: Cost 3 vext1 <3,2,7,3>, <3,2,7,3>
+ 1514097974U, // <2,7,3,4>: Cost 2 vext1 <6,2,7,3>, RHS
+ 2581868321U, // <2,7,3,5>: Cost 3 vext1 <5,2,7,3>, <5,2,7,3>
+ 1514099194U, // <2,7,3,6>: Cost 2 vext1 <6,2,7,3>, <6,2,7,3>
+ 2587841530U, // <2,7,3,7>: Cost 3 vext1 <6,2,7,3>, <7,0,1,2>
+ 1514100526U, // <2,7,3,u>: Cost 2 vext1 <6,2,7,3>, LHS
+ 2708706617U, // <2,7,4,0>: Cost 3 vext3 <4,0,6,2>, <7,4,0,6>
+ 3649643418U, // <2,7,4,1>: Cost 4 vext1 <4,2,7,4>, <1,2,3,4>
+ 3649644330U, // <2,7,4,2>: Cost 4 vext1 <4,2,7,4>, <2,4,5,7>
+ 2257982640U, // <2,7,4,3>: Cost 3 vrev <7,2,3,4>
+ 3649645641U, // <2,7,4,4>: Cost 4 vext1 <4,2,7,4>, <4,2,7,4>
+ 2621435190U, // <2,7,4,5>: Cost 3 vext2 <0,6,2,7>, RHS
+ 2712835441U, // <2,7,4,6>: Cost 3 vext3 <4,6,u,2>, <7,4,6,u>
+ 3799995762U, // <2,7,4,7>: Cost 4 vext3 <7,0,1,2>, <7,4,7,0>
+ 2621435433U, // <2,7,4,u>: Cost 3 vext2 <0,6,2,7>, RHS
+ 2729497990U, // <2,7,5,0>: Cost 3 vext3 <7,5,0,2>, <7,5,0,2>
+ 3643679744U, // <2,7,5,1>: Cost 4 vext1 <3,2,7,5>, <1,3,5,7>
+ 3637708424U, // <2,7,5,2>: Cost 4 vext1 <2,2,7,5>, <2,2,5,7>
+ 3643681137U, // <2,7,5,3>: Cost 4 vext1 <3,2,7,5>, <3,2,7,5>
+ 2599800118U, // <2,7,5,4>: Cost 3 vext1 <u,2,7,5>, RHS
+ 3786577334U, // <2,7,5,5>: Cost 4 vext3 <4,6,u,2>, <7,5,5,5>
+ 3786577345U, // <2,7,5,6>: Cost 4 vext3 <4,6,u,2>, <7,5,6,7>
+ 2599802214U, // <2,7,5,7>: Cost 3 vext1 <u,2,7,5>, <7,4,5,6>
+ 2599802670U, // <2,7,5,u>: Cost 3 vext1 <u,2,7,5>, LHS
+ 2581889126U, // <2,7,6,0>: Cost 3 vext1 <5,2,7,6>, LHS
+ 3643687936U, // <2,7,6,1>: Cost 4 vext1 <3,2,7,6>, <1,3,5,7>
+ 2663240186U, // <2,7,6,2>: Cost 3 vext2 <7,6,2,7>, <6,2,7,3>
+ 3643689330U, // <2,7,6,3>: Cost 4 vext1 <3,2,7,6>, <3,2,7,6>
+ 2581892406U, // <2,7,6,4>: Cost 3 vext1 <5,2,7,6>, RHS
+ 2581892900U, // <2,7,6,5>: Cost 3 vext1 <5,2,7,6>, <5,2,7,6>
+ 2587865597U, // <2,7,6,6>: Cost 3 vext1 <6,2,7,6>, <6,2,7,6>
+ 3786577428U, // <2,7,6,7>: Cost 4 vext3 <4,6,u,2>, <7,6,7,0>
+ 2581894958U, // <2,7,6,u>: Cost 3 vext1 <5,2,7,6>, LHS
+ 2726254119U, // <2,7,7,0>: Cost 3 vext3 <7,0,1,2>, <7,7,0,1>
+ 3804640817U, // <2,7,7,1>: Cost 4 vext3 <7,7,1,2>, <7,7,1,2>
+ 3637724826U, // <2,7,7,2>: Cost 4 vext1 <2,2,7,7>, <2,2,7,7>
+ 3734992123U, // <2,7,7,3>: Cost 4 vext2 <7,3,2,7>, <7,3,2,7>
+ 2552040758U, // <2,7,7,4>: Cost 3 vext1 <0,2,7,7>, RHS
+ 3799995992U, // <2,7,7,5>: Cost 4 vext3 <7,0,1,2>, <7,7,5,5>
+ 2663241198U, // <2,7,7,6>: Cost 3 vext2 <7,6,2,7>, <7,6,2,7>
+ 2712835692U, // <2,7,7,7>: Cost 3 vext3 <4,6,u,2>, <7,7,7,7>
+ 2731562607U, // <2,7,7,u>: Cost 3 vext3 <7,u,1,2>, <7,7,u,1>
+ 1514135654U, // <2,7,u,0>: Cost 2 vext1 <6,2,7,u>, LHS
+ 1657820802U, // <2,7,u,1>: Cost 2 vext3 <7,u,1,2>, <7,u,1,2>
+ 2587879016U, // <2,7,u,2>: Cost 3 vext1 <6,2,7,u>, <2,2,2,2>
+ 2569963892U, // <2,7,u,3>: Cost 3 vext1 <3,2,7,u>, <3,2,7,u>
+ 1514138934U, // <2,7,u,4>: Cost 2 vext1 <6,2,7,u>, RHS
+ 2621438106U, // <2,7,u,5>: Cost 3 vext2 <0,6,2,7>, RHS
+ 1514140159U, // <2,7,u,6>: Cost 2 vext1 <6,2,7,u>, <6,2,7,u>
+ 2587882490U, // <2,7,u,7>: Cost 3 vext1 <6,2,7,u>, <7,0,1,2>
+ 1514141486U, // <2,7,u,u>: Cost 2 vext1 <6,2,7,u>, LHS
+ 1544380416U, // <2,u,0,0>: Cost 2 vext2 LHS, <0,0,0,0>
+ 470638699U, // <2,u,0,1>: Cost 1 vext2 LHS, LHS
+ 1544380580U, // <2,u,0,2>: Cost 2 vext2 LHS, <0,2,0,2>
+ 1658631909U, // <2,u,0,3>: Cost 2 vext3 <u,0,3,2>, <u,0,3,2>
+ 1544380754U, // <2,u,0,4>: Cost 2 vext2 LHS, <0,4,1,5>
+ 2665898414U, // <2,u,0,5>: Cost 3 vext2 LHS, <0,5,2,7>
+ 1658853120U, // <2,u,0,6>: Cost 2 vext3 <u,0,6,2>, <u,0,6,2>
+ 3094531625U, // <2,u,0,7>: Cost 3 vtrnr <1,2,3,0>, RHS
+ 470639261U, // <2,u,0,u>: Cost 1 vext2 LHS, LHS
+ 1544381174U, // <2,u,1,0>: Cost 2 vext2 LHS, <1,0,3,2>
+ 1544381236U, // <2,u,1,1>: Cost 2 vext2 LHS, <1,1,1,1>
+ 1544381334U, // <2,u,1,2>: Cost 2 vext2 LHS, <1,2,3,0>
+ 1544381400U, // <2,u,1,3>: Cost 2 vext2 LHS, <1,3,1,3>
+ 2618123325U, // <2,u,1,4>: Cost 3 vext2 LHS, <1,4,3,5>
+ 1544381584U, // <2,u,1,5>: Cost 2 vext2 LHS, <1,5,3,7>
+ 2618123489U, // <2,u,1,6>: Cost 3 vext2 LHS, <1,6,3,7>
+ 2726254427U, // <2,u,1,7>: Cost 3 vext3 <7,0,1,2>, <u,1,7,3>
+ 1544381823U, // <2,u,1,u>: Cost 2 vext2 LHS, <1,u,3,3>
+ 1478328422U, // <2,u,2,0>: Cost 2 vext1 <0,2,u,2>, LHS
+ 2618123807U, // <2,u,2,1>: Cost 3 vext2 LHS, <2,1,3,1>
+ 269271142U, // <2,u,2,2>: Cost 1 vdup2 LHS
+ 1544382118U, // <2,u,2,3>: Cost 2 vext2 LHS, <2,3,0,1>
+ 1478331702U, // <2,u,2,4>: Cost 2 vext1 <0,2,u,2>, RHS
+ 2618124136U, // <2,u,2,5>: Cost 3 vext2 LHS, <2,5,3,6>
+ 1544382394U, // <2,u,2,6>: Cost 2 vext2 LHS, <2,6,3,7>
+ 3088354857U, // <2,u,2,7>: Cost 3 vtrnr <0,2,0,2>, RHS
+ 269271142U, // <2,u,2,u>: Cost 1 vdup2 LHS
+ 1544382614U, // <2,u,3,0>: Cost 2 vext2 LHS, <3,0,1,2>
+ 2953627374U, // <2,u,3,1>: Cost 3 vzipr LHS, <2,3,u,1>
+ 1490282143U, // <2,u,3,2>: Cost 2 vext1 <2,2,u,3>, <2,2,u,3>
+ 1879883932U, // <2,u,3,3>: Cost 2 vzipr LHS, LHS
+ 1544382978U, // <2,u,3,4>: Cost 2 vext2 LHS, <3,4,5,6>
+ 2953627378U, // <2,u,3,5>: Cost 3 vzipr LHS, <2,3,u,5>
+ 1514172931U, // <2,u,3,6>: Cost 2 vext1 <6,2,u,3>, <6,2,u,3>
+ 1879887176U, // <2,u,3,7>: Cost 2 vzipr LHS, RHS
+ 1879883937U, // <2,u,3,u>: Cost 2 vzipr LHS, LHS
+ 1484316774U, // <2,u,4,0>: Cost 2 vext1 <1,2,u,4>, LHS
+ 1484317639U, // <2,u,4,1>: Cost 2 vext1 <1,2,u,4>, <1,2,u,4>
+ 2552088270U, // <2,u,4,2>: Cost 3 vext1 <0,2,u,4>, <2,3,4,5>
+ 1190213513U, // <2,u,4,3>: Cost 2 vrev <u,2,3,4>
+ 1484320054U, // <2,u,4,4>: Cost 2 vext1 <1,2,u,4>, RHS
+ 470641974U, // <2,u,4,5>: Cost 1 vext2 LHS, RHS
+ 1592159604U, // <2,u,4,6>: Cost 2 vext2 LHS, <4,6,4,6>
+ 3094564393U, // <2,u,4,7>: Cost 3 vtrnr <1,2,3,4>, RHS
+ 470642217U, // <2,u,4,u>: Cost 1 vext2 LHS, RHS
+ 2552094959U, // <2,u,5,0>: Cost 3 vext1 <0,2,u,5>, <0,2,u,5>
+ 1592159952U, // <2,u,5,1>: Cost 2 vext2 LHS, <5,1,7,3>
+ 2564040353U, // <2,u,5,2>: Cost 3 vext1 <2,2,u,5>, <2,2,u,5>
+ 2690275455U, // <2,u,5,3>: Cost 3 vext3 <0,u,u,2>, <u,5,3,7>
+ 1592160198U, // <2,u,5,4>: Cost 2 vext2 LHS, <5,4,7,6>
+ 1592160260U, // <2,u,5,5>: Cost 2 vext2 LHS, <5,5,5,5>
+ 1611962522U, // <2,u,5,6>: Cost 2 vext3 <0,2,0,2>, RHS
+ 1592160424U, // <2,u,5,7>: Cost 2 vext2 LHS, <5,7,5,7>
+ 1611962540U, // <2,u,5,u>: Cost 2 vext3 <0,2,0,2>, RHS
+ 1478361190U, // <2,u,6,0>: Cost 2 vext1 <0,2,u,6>, LHS
+ 2552103670U, // <2,u,6,1>: Cost 3 vext1 <0,2,u,6>, <1,0,3,2>
+ 1592160762U, // <2,u,6,2>: Cost 2 vext2 LHS, <6,2,7,3>
+ 2685704400U, // <2,u,6,3>: Cost 3 vext3 <0,2,0,2>, <u,6,3,7>
+ 1478364470U, // <2,u,6,4>: Cost 2 vext1 <0,2,u,6>, RHS
+ 2901891226U, // <2,u,6,5>: Cost 3 vzipl <2,6,3,7>, RHS
+ 1592161080U, // <2,u,6,6>: Cost 2 vext2 LHS, <6,6,6,6>
+ 1592161102U, // <2,u,6,7>: Cost 2 vext2 LHS, <6,7,0,1>
+ 1478367022U, // <2,u,6,u>: Cost 2 vext1 <0,2,u,6>, LHS
+ 1592161274U, // <2,u,7,0>: Cost 2 vext2 LHS, <7,0,1,2>
+ 2659931226U, // <2,u,7,1>: Cost 3 vext2 <7,1,2,u>, <7,1,2,u>
+ 2564056739U, // <2,u,7,2>: Cost 3 vext1 <2,2,u,7>, <2,2,u,7>
+ 2665903331U, // <2,u,7,3>: Cost 3 vext2 LHS, <7,3,0,1>
+ 1592161638U, // <2,u,7,4>: Cost 2 vext2 LHS, <7,4,5,6>
+ 2665903494U, // <2,u,7,5>: Cost 3 vext2 LHS, <7,5,0,2>
+ 2587947527U, // <2,u,7,6>: Cost 3 vext1 <6,2,u,7>, <6,2,u,7>
+ 1592161900U, // <2,u,7,7>: Cost 2 vext2 LHS, <7,7,7,7>
+ 1592161922U, // <2,u,7,u>: Cost 2 vext2 LHS, <7,u,1,2>
+ 1478377574U, // <2,u,u,0>: Cost 2 vext1 <0,2,u,u>, LHS
+ 470644526U, // <2,u,u,1>: Cost 1 vext2 LHS, LHS
+ 269271142U, // <2,u,u,2>: Cost 1 vdup2 LHS
+ 1879924892U, // <2,u,u,3>: Cost 2 vzipr LHS, LHS
+ 1478380854U, // <2,u,u,4>: Cost 2 vext1 <0,2,u,u>, RHS
+ 470644890U, // <2,u,u,5>: Cost 1 vext2 LHS, RHS
+ 1611962765U, // <2,u,u,6>: Cost 2 vext3 <0,2,0,2>, RHS
+ 1879928136U, // <2,u,u,7>: Cost 2 vzipr LHS, RHS
+ 470645093U, // <2,u,u,u>: Cost 1 vext2 LHS, LHS
+ 1611448320U, // <3,0,0,0>: Cost 2 vext3 LHS, <0,0,0,0>
+ 1611890698U, // <3,0,0,1>: Cost 2 vext3 LHS, <0,0,1,1>
+ 1611890708U, // <3,0,0,2>: Cost 2 vext3 LHS, <0,0,2,2>
+ 3763576860U, // <3,0,0,3>: Cost 4 vext3 LHS, <0,0,3,1>
+ 2689835045U, // <3,0,0,4>: Cost 3 vext3 LHS, <0,0,4,1>
+ 3698508206U, // <3,0,0,5>: Cost 4 vext2 <1,2,3,0>, <0,5,2,7>
+ 3763576887U, // <3,0,0,6>: Cost 4 vext3 LHS, <0,0,6,1>
+ 3667678434U, // <3,0,0,7>: Cost 4 vext1 <7,3,0,0>, <7,3,0,0>
+ 1616093258U, // <3,0,0,u>: Cost 2 vext3 LHS, <0,0,u,2>
+ 1490337894U, // <3,0,1,0>: Cost 2 vext1 <2,3,0,1>, LHS
+ 2685632602U, // <3,0,1,1>: Cost 3 vext3 LHS, <0,1,1,0>
+ 537706598U, // <3,0,1,2>: Cost 1 vext3 LHS, LHS
+ 2624766936U, // <3,0,1,3>: Cost 3 vext2 <1,2,3,0>, <1,3,1,3>
+ 1490341174U, // <3,0,1,4>: Cost 2 vext1 <2,3,0,1>, RHS
+ 2624767120U, // <3,0,1,5>: Cost 3 vext2 <1,2,3,0>, <1,5,3,7>
+ 2732966030U, // <3,0,1,6>: Cost 3 vext3 LHS, <0,1,6,7>
+ 2593944803U, // <3,0,1,7>: Cost 3 vext1 <7,3,0,1>, <7,3,0,1>
+ 537706652U, // <3,0,1,u>: Cost 1 vext3 LHS, LHS
+ 1611890852U, // <3,0,2,0>: Cost 2 vext3 LHS, <0,2,0,2>
+ 2685632684U, // <3,0,2,1>: Cost 3 vext3 LHS, <0,2,1,1>
+ 2685632692U, // <3,0,2,2>: Cost 3 vext3 LHS, <0,2,2,0>
+ 2685632702U, // <3,0,2,3>: Cost 3 vext3 LHS, <0,2,3,1>
+ 1611890892U, // <3,0,2,4>: Cost 2 vext3 LHS, <0,2,4,6>
+ 2732966102U, // <3,0,2,5>: Cost 3 vext3 LHS, <0,2,5,7>
+ 2624767930U, // <3,0,2,6>: Cost 3 vext2 <1,2,3,0>, <2,6,3,7>
+ 2685632744U, // <3,0,2,7>: Cost 3 vext3 LHS, <0,2,7,7>
+ 1611890924U, // <3,0,2,u>: Cost 2 vext3 LHS, <0,2,u,2>
+ 2624768150U, // <3,0,3,0>: Cost 3 vext2 <1,2,3,0>, <3,0,1,2>
+ 2685632764U, // <3,0,3,1>: Cost 3 vext3 LHS, <0,3,1,0>
+ 2685632774U, // <3,0,3,2>: Cost 3 vext3 LHS, <0,3,2,1>
+ 2624768412U, // <3,0,3,3>: Cost 3 vext2 <1,2,3,0>, <3,3,3,3>
+ 2624768514U, // <3,0,3,4>: Cost 3 vext2 <1,2,3,0>, <3,4,5,6>
+ 3702491714U, // <3,0,3,5>: Cost 4 vext2 <1,u,3,0>, <3,5,3,7>
+ 2624768632U, // <3,0,3,6>: Cost 3 vext2 <1,2,3,0>, <3,6,0,7>
+ 3702491843U, // <3,0,3,7>: Cost 4 vext2 <1,u,3,0>, <3,7,0,1>
+ 2686959934U, // <3,0,3,u>: Cost 3 vext3 <0,3,u,3>, <0,3,u,3>
+ 2689835336U, // <3,0,4,0>: Cost 3 vext3 LHS, <0,4,0,4>
+ 1611891026U, // <3,0,4,1>: Cost 2 vext3 LHS, <0,4,1,5>
+ 1611891036U, // <3,0,4,2>: Cost 2 vext3 LHS, <0,4,2,6>
+ 3763577184U, // <3,0,4,3>: Cost 4 vext3 LHS, <0,4,3,1>
+ 2689835374U, // <3,0,4,4>: Cost 3 vext3 LHS, <0,4,4,6>
+ 1551027510U, // <3,0,4,5>: Cost 2 vext2 <1,2,3,0>, RHS
+ 2666573172U, // <3,0,4,6>: Cost 3 vext2 <u,2,3,0>, <4,6,4,6>
+ 3667711206U, // <3,0,4,7>: Cost 4 vext1 <7,3,0,4>, <7,3,0,4>
+ 1616093586U, // <3,0,4,u>: Cost 2 vext3 LHS, <0,4,u,6>
+ 2685190556U, // <3,0,5,0>: Cost 3 vext3 LHS, <0,5,0,7>
+ 2666573520U, // <3,0,5,1>: Cost 3 vext2 <u,2,3,0>, <5,1,7,3>
+ 3040886886U, // <3,0,5,2>: Cost 3 vtrnl <3,4,5,6>, LHS
+ 3625912834U, // <3,0,5,3>: Cost 4 vext1 <0,3,0,5>, <3,4,5,6>
+ 2666573766U, // <3,0,5,4>: Cost 3 vext2 <u,2,3,0>, <5,4,7,6>
+ 2666573828U, // <3,0,5,5>: Cost 3 vext2 <u,2,3,0>, <5,5,5,5>
+ 2732966354U, // <3,0,5,6>: Cost 3 vext3 LHS, <0,5,6,7>
+ 2666573992U, // <3,0,5,7>: Cost 3 vext2 <u,2,3,0>, <5,7,5,7>
+ 3040886940U, // <3,0,5,u>: Cost 3 vtrnl <3,4,5,6>, LHS
+ 2685190637U, // <3,0,6,0>: Cost 3 vext3 LHS, <0,6,0,7>
+ 2732966390U, // <3,0,6,1>: Cost 3 vext3 LHS, <0,6,1,7>
+ 2689835519U, // <3,0,6,2>: Cost 3 vext3 LHS, <0,6,2,7>
+ 3667724438U, // <3,0,6,3>: Cost 4 vext1 <7,3,0,6>, <3,0,1,2>
+ 3763577355U, // <3,0,6,4>: Cost 4 vext3 LHS, <0,6,4,1>
+ 3806708243U, // <3,0,6,5>: Cost 4 vext3 LHS, <0,6,5,0>
+ 2666574648U, // <3,0,6,6>: Cost 3 vext2 <u,2,3,0>, <6,6,6,6>
+ 2657948520U, // <3,0,6,7>: Cost 3 vext2 <6,7,3,0>, <6,7,3,0>
+ 2689835573U, // <3,0,6,u>: Cost 3 vext3 LHS, <0,6,u,7>
+ 2666574842U, // <3,0,7,0>: Cost 3 vext2 <u,2,3,0>, <7,0,1,2>
+ 2685633095U, // <3,0,7,1>: Cost 3 vext3 LHS, <0,7,1,7>
+ 2660603052U, // <3,0,7,2>: Cost 3 vext2 <7,2,3,0>, <7,2,3,0>
+ 3643844997U, // <3,0,7,3>: Cost 4 vext1 <3,3,0,7>, <3,3,0,7>
+ 2666575206U, // <3,0,7,4>: Cost 3 vext2 <u,2,3,0>, <7,4,5,6>
+ 3655790391U, // <3,0,7,5>: Cost 4 vext1 <5,3,0,7>, <5,3,0,7>
+ 3731690968U, // <3,0,7,6>: Cost 4 vext2 <6,7,3,0>, <7,6,0,3>
+ 2666575468U, // <3,0,7,7>: Cost 3 vext2 <u,2,3,0>, <7,7,7,7>
+ 2664584850U, // <3,0,7,u>: Cost 3 vext2 <7,u,3,0>, <7,u,3,0>
+ 1616093834U, // <3,0,u,0>: Cost 2 vext3 LHS, <0,u,0,2>
+ 1611891346U, // <3,0,u,1>: Cost 2 vext3 LHS, <0,u,1,1>
+ 537707165U, // <3,0,u,2>: Cost 1 vext3 LHS, LHS
+ 2689835684U, // <3,0,u,3>: Cost 3 vext3 LHS, <0,u,3,1>
+ 1616093874U, // <3,0,u,4>: Cost 2 vext3 LHS, <0,u,4,6>
+ 1551030426U, // <3,0,u,5>: Cost 2 vext2 <1,2,3,0>, RHS
+ 2624772304U, // <3,0,u,6>: Cost 3 vext2 <1,2,3,0>, <u,6,3,7>
+ 2594002154U, // <3,0,u,7>: Cost 3 vext1 <7,3,0,u>, <7,3,0,u>
+ 537707219U, // <3,0,u,u>: Cost 1 vext3 LHS, LHS
+ 2552201318U, // <3,1,0,0>: Cost 3 vext1 <0,3,1,0>, LHS
+ 2618802278U, // <3,1,0,1>: Cost 3 vext2 <0,2,3,1>, LHS
+ 2618802366U, // <3,1,0,2>: Cost 3 vext2 <0,2,3,1>, <0,2,3,1>
+ 1611449078U, // <3,1,0,3>: Cost 2 vext3 LHS, <1,0,3,2>
+ 2552204598U, // <3,1,0,4>: Cost 3 vext1 <0,3,1,0>, RHS
+ 2732966663U, // <3,1,0,5>: Cost 3 vext3 LHS, <1,0,5,1>
+ 3906258396U, // <3,1,0,6>: Cost 4 vuzpr <2,3,0,1>, <2,0,4,6>
+ 3667752171U, // <3,1,0,7>: Cost 4 vext1 <7,3,1,0>, <7,3,1,0>
+ 1611891491U, // <3,1,0,u>: Cost 2 vext3 LHS, <1,0,u,2>
+ 2689835819U, // <3,1,1,0>: Cost 3 vext3 LHS, <1,1,0,1>
+ 1611449140U, // <3,1,1,1>: Cost 2 vext3 LHS, <1,1,1,1>
+ 2624775063U, // <3,1,1,2>: Cost 3 vext2 <1,2,3,1>, <1,2,3,1>
+ 1611891528U, // <3,1,1,3>: Cost 2 vext3 LHS, <1,1,3,3>
+ 2689835859U, // <3,1,1,4>: Cost 3 vext3 LHS, <1,1,4,5>
+ 2689835868U, // <3,1,1,5>: Cost 3 vext3 LHS, <1,1,5,5>
+ 3763577701U, // <3,1,1,6>: Cost 4 vext3 LHS, <1,1,6,5>
+ 3765273452U, // <3,1,1,7>: Cost 4 vext3 <1,1,7,3>, <1,1,7,3>
+ 1611891573U, // <3,1,1,u>: Cost 2 vext3 LHS, <1,1,u,3>
+ 2629420494U, // <3,1,2,0>: Cost 3 vext2 <2,0,3,1>, <2,0,3,1>
+ 2689835911U, // <3,1,2,1>: Cost 3 vext3 LHS, <1,2,1,3>
+ 2564163248U, // <3,1,2,2>: Cost 3 vext1 <2,3,1,2>, <2,3,1,2>
+ 1611449238U, // <3,1,2,3>: Cost 2 vext3 LHS, <1,2,3,0>
+ 2564164918U, // <3,1,2,4>: Cost 3 vext1 <2,3,1,2>, RHS
+ 2689835947U, // <3,1,2,5>: Cost 3 vext3 LHS, <1,2,5,3>
+ 3692545978U, // <3,1,2,6>: Cost 4 vext2 <0,2,3,1>, <2,6,3,7>
+ 2732966842U, // <3,1,2,7>: Cost 3 vext3 LHS, <1,2,7,0>
+ 1611891651U, // <3,1,2,u>: Cost 2 vext3 LHS, <1,2,u,0>
+ 1484456038U, // <3,1,3,0>: Cost 2 vext1 <1,3,1,3>, LHS
+ 1611891672U, // <3,1,3,1>: Cost 2 vext3 LHS, <1,3,1,3>
+ 2685633502U, // <3,1,3,2>: Cost 3 vext3 LHS, <1,3,2,0>
+ 2685633512U, // <3,1,3,3>: Cost 3 vext3 LHS, <1,3,3,1>
+ 1484459318U, // <3,1,3,4>: Cost 2 vext1 <1,3,1,3>, RHS
+ 1611891712U, // <3,1,3,5>: Cost 2 vext3 LHS, <1,3,5,7>
+ 2689836041U, // <3,1,3,6>: Cost 3 vext3 LHS, <1,3,6,7>
+ 2733409294U, // <3,1,3,7>: Cost 3 vext3 LHS, <1,3,7,3>
+ 1611891735U, // <3,1,3,u>: Cost 2 vext3 LHS, <1,3,u,3>
+ 2552234086U, // <3,1,4,0>: Cost 3 vext1 <0,3,1,4>, LHS
+ 2732966955U, // <3,1,4,1>: Cost 3 vext3 LHS, <1,4,1,5>
+ 2732966964U, // <3,1,4,2>: Cost 3 vext3 LHS, <1,4,2,5>
+ 2685633597U, // <3,1,4,3>: Cost 3 vext3 LHS, <1,4,3,5>
+ 2552237366U, // <3,1,4,4>: Cost 3 vext1 <0,3,1,4>, RHS
+ 2618805558U, // <3,1,4,5>: Cost 3 vext2 <0,2,3,1>, RHS
+ 2769472822U, // <3,1,4,6>: Cost 3 vuzpl <3,0,1,2>, RHS
+ 3667784943U, // <3,1,4,7>: Cost 4 vext1 <7,3,1,4>, <7,3,1,4>
+ 2685633642U, // <3,1,4,u>: Cost 3 vext3 LHS, <1,4,u,5>
+ 2689836143U, // <3,1,5,0>: Cost 3 vext3 LHS, <1,5,0,1>
+ 2564187280U, // <3,1,5,1>: Cost 3 vext1 <2,3,1,5>, <1,5,3,7>
+ 2564187827U, // <3,1,5,2>: Cost 3 vext1 <2,3,1,5>, <2,3,1,5>
+ 1611891856U, // <3,1,5,3>: Cost 2 vext3 LHS, <1,5,3,7>
+ 2689836183U, // <3,1,5,4>: Cost 3 vext3 LHS, <1,5,4,5>
+ 3759375522U, // <3,1,5,5>: Cost 4 vext3 LHS, <1,5,5,7>
+ 3720417378U, // <3,1,5,6>: Cost 4 vext2 <4,u,3,1>, <5,6,7,0>
+ 2832518454U, // <3,1,5,7>: Cost 3 vuzpr <2,3,0,1>, RHS
+ 1611891901U, // <3,1,5,u>: Cost 2 vext3 LHS, <1,5,u,7>
+ 3763578048U, // <3,1,6,0>: Cost 4 vext3 LHS, <1,6,0,1>
+ 2689836239U, // <3,1,6,1>: Cost 3 vext3 LHS, <1,6,1,7>
+ 2732967128U, // <3,1,6,2>: Cost 3 vext3 LHS, <1,6,2,7>
+ 2685633761U, // <3,1,6,3>: Cost 3 vext3 LHS, <1,6,3,7>
+ 3763578088U, // <3,1,6,4>: Cost 4 vext3 LHS, <1,6,4,5>
+ 2689836275U, // <3,1,6,5>: Cost 3 vext3 LHS, <1,6,5,7>
+ 3763578108U, // <3,1,6,6>: Cost 4 vext3 LHS, <1,6,6,7>
+ 2732967166U, // <3,1,6,7>: Cost 3 vext3 LHS, <1,6,7,0>
+ 2685633806U, // <3,1,6,u>: Cost 3 vext3 LHS, <1,6,u,7>
+ 3631972454U, // <3,1,7,0>: Cost 4 vext1 <1,3,1,7>, LHS
+ 2659947612U, // <3,1,7,1>: Cost 3 vext2 <7,1,3,1>, <7,1,3,1>
+ 4036102294U, // <3,1,7,2>: Cost 4 vzipr <1,5,3,7>, <3,0,1,2>
+ 3095396454U, // <3,1,7,3>: Cost 3 vtrnr <1,3,5,7>, LHS
+ 3631975734U, // <3,1,7,4>: Cost 4 vext1 <1,3,1,7>, RHS
+ 2222982144U, // <3,1,7,5>: Cost 3 vrev <1,3,5,7>
+ 3296797705U, // <3,1,7,6>: Cost 4 vrev <1,3,6,7>
+ 3720418924U, // <3,1,7,7>: Cost 4 vext2 <4,u,3,1>, <7,7,7,7>
+ 3095396459U, // <3,1,7,u>: Cost 3 vtrnr <1,3,5,7>, LHS
+ 1484496998U, // <3,1,u,0>: Cost 2 vext1 <1,3,1,u>, LHS
+ 1611892077U, // <3,1,u,1>: Cost 2 vext3 LHS, <1,u,1,3>
+ 2685633907U, // <3,1,u,2>: Cost 3 vext3 LHS, <1,u,2,0>
+ 1611892092U, // <3,1,u,3>: Cost 2 vext3 LHS, <1,u,3,0>
+ 1484500278U, // <3,1,u,4>: Cost 2 vext1 <1,3,1,u>, RHS
+ 1611892117U, // <3,1,u,5>: Cost 2 vext3 LHS, <1,u,5,7>
+ 2685633950U, // <3,1,u,6>: Cost 3 vext3 LHS, <1,u,6,7>
+ 2832518697U, // <3,1,u,7>: Cost 3 vuzpr <2,3,0,1>, RHS
+ 1611892140U, // <3,1,u,u>: Cost 2 vext3 LHS, <1,u,u,3>
+ 2623455232U, // <3,2,0,0>: Cost 3 vext2 <1,0,3,2>, <0,0,0,0>
+ 1549713510U, // <3,2,0,1>: Cost 2 vext2 <1,0,3,2>, LHS
+ 2689836484U, // <3,2,0,2>: Cost 3 vext3 LHS, <2,0,2,0>
+ 2685633997U, // <3,2,0,3>: Cost 3 vext3 LHS, <2,0,3,0>
+ 2623455570U, // <3,2,0,4>: Cost 3 vext2 <1,0,3,2>, <0,4,1,5>
+ 2732967398U, // <3,2,0,5>: Cost 3 vext3 LHS, <2,0,5,7>
+ 2689836524U, // <3,2,0,6>: Cost 3 vext3 LHS, <2,0,6,4>
+ 2229044964U, // <3,2,0,7>: Cost 3 vrev <2,3,7,0>
+ 1549714077U, // <3,2,0,u>: Cost 2 vext2 <1,0,3,2>, LHS
+ 1549714166U, // <3,2,1,0>: Cost 2 vext2 <1,0,3,2>, <1,0,3,2>
+ 2623456052U, // <3,2,1,1>: Cost 3 vext2 <1,0,3,2>, <1,1,1,1>
+ 2623456150U, // <3,2,1,2>: Cost 3 vext2 <1,0,3,2>, <1,2,3,0>
+ 2685634079U, // <3,2,1,3>: Cost 3 vext3 LHS, <2,1,3,1>
+ 2552286518U, // <3,2,1,4>: Cost 3 vext1 <0,3,2,1>, RHS
+ 2623456400U, // <3,2,1,5>: Cost 3 vext2 <1,0,3,2>, <1,5,3,7>
+ 2689836604U, // <3,2,1,6>: Cost 3 vext3 LHS, <2,1,6,3>
+ 3667834101U, // <3,2,1,7>: Cost 4 vext1 <7,3,2,1>, <7,3,2,1>
+ 1155385070U, // <3,2,1,u>: Cost 2 vrev <2,3,u,1>
+ 2689836629U, // <3,2,2,0>: Cost 3 vext3 LHS, <2,2,0,1>
+ 2689836640U, // <3,2,2,1>: Cost 3 vext3 LHS, <2,2,1,3>
+ 1611449960U, // <3,2,2,2>: Cost 2 vext3 LHS, <2,2,2,2>
+ 1611892338U, // <3,2,2,3>: Cost 2 vext3 LHS, <2,2,3,3>
+ 2689836669U, // <3,2,2,4>: Cost 3 vext3 LHS, <2,2,4,5>
+ 2689836680U, // <3,2,2,5>: Cost 3 vext3 LHS, <2,2,5,7>
+ 2689836688U, // <3,2,2,6>: Cost 3 vext3 LHS, <2,2,6,6>
+ 3763578518U, // <3,2,2,7>: Cost 4 vext3 LHS, <2,2,7,3>
+ 1611892383U, // <3,2,2,u>: Cost 2 vext3 LHS, <2,2,u,3>
+ 1611450022U, // <3,2,3,0>: Cost 2 vext3 LHS, <2,3,0,1>
+ 2685191854U, // <3,2,3,1>: Cost 3 vext3 LHS, <2,3,1,0>
+ 2685191865U, // <3,2,3,2>: Cost 3 vext3 LHS, <2,3,2,2>
+ 2685191875U, // <3,2,3,3>: Cost 3 vext3 LHS, <2,3,3,3>
+ 1611450062U, // <3,2,3,4>: Cost 2 vext3 LHS, <2,3,4,5>
+ 2732967635U, // <3,2,3,5>: Cost 3 vext3 LHS, <2,3,5,1>
+ 2732967645U, // <3,2,3,6>: Cost 3 vext3 LHS, <2,3,6,2>
+ 2732967652U, // <3,2,3,7>: Cost 3 vext3 LHS, <2,3,7,0>
+ 1611450094U, // <3,2,3,u>: Cost 2 vext3 LHS, <2,3,u,1>
+ 2558279782U, // <3,2,4,0>: Cost 3 vext1 <1,3,2,4>, LHS
+ 2558280602U, // <3,2,4,1>: Cost 3 vext1 <1,3,2,4>, <1,2,3,4>
+ 2732967692U, // <3,2,4,2>: Cost 3 vext3 LHS, <2,4,2,4>
+ 2685634326U, // <3,2,4,3>: Cost 3 vext3 LHS, <2,4,3,5>
+ 2558283062U, // <3,2,4,4>: Cost 3 vext1 <1,3,2,4>, RHS
+ 1549716790U, // <3,2,4,5>: Cost 2 vext2 <1,0,3,2>, RHS
+ 2689836844U, // <3,2,4,6>: Cost 3 vext3 LHS, <2,4,6,0>
+ 2229077736U, // <3,2,4,7>: Cost 3 vrev <2,3,7,4>
+ 1549717033U, // <3,2,4,u>: Cost 2 vext2 <1,0,3,2>, RHS
+ 2552316006U, // <3,2,5,0>: Cost 3 vext1 <0,3,2,5>, LHS
+ 2228643507U, // <3,2,5,1>: Cost 3 vrev <2,3,1,5>
+ 2689836896U, // <3,2,5,2>: Cost 3 vext3 LHS, <2,5,2,7>
+ 2685634408U, // <3,2,5,3>: Cost 3 vext3 LHS, <2,5,3,6>
+ 1155122894U, // <3,2,5,4>: Cost 2 vrev <2,3,4,5>
+ 2665263108U, // <3,2,5,5>: Cost 3 vext2 <u,0,3,2>, <5,5,5,5>
+ 2689836932U, // <3,2,5,6>: Cost 3 vext3 LHS, <2,5,6,7>
+ 2665263272U, // <3,2,5,7>: Cost 3 vext2 <u,0,3,2>, <5,7,5,7>
+ 1155417842U, // <3,2,5,u>: Cost 2 vrev <2,3,u,5>
+ 2689836953U, // <3,2,6,0>: Cost 3 vext3 LHS, <2,6,0,1>
+ 2689836964U, // <3,2,6,1>: Cost 3 vext3 LHS, <2,6,1,3>
+ 2689836976U, // <3,2,6,2>: Cost 3 vext3 LHS, <2,6,2,6>
+ 1611892666U, // <3,2,6,3>: Cost 2 vext3 LHS, <2,6,3,7>
+ 2689836993U, // <3,2,6,4>: Cost 3 vext3 LHS, <2,6,4,5>
+ 2689837004U, // <3,2,6,5>: Cost 3 vext3 LHS, <2,6,5,7>
+ 2689837013U, // <3,2,6,6>: Cost 3 vext3 LHS, <2,6,6,7>
+ 2665263950U, // <3,2,6,7>: Cost 3 vext2 <u,0,3,2>, <6,7,0,1>
+ 1611892711U, // <3,2,6,u>: Cost 2 vext3 LHS, <2,6,u,7>
+ 2665264122U, // <3,2,7,0>: Cost 3 vext2 <u,0,3,2>, <7,0,1,2>
+ 2623460419U, // <3,2,7,1>: Cost 3 vext2 <1,0,3,2>, <7,1,0,3>
+ 4169138340U, // <3,2,7,2>: Cost 4 vtrnr <1,3,5,7>, <0,2,0,2>
+ 2962358374U, // <3,2,7,3>: Cost 3 vzipr <1,5,3,7>, LHS
+ 2665264486U, // <3,2,7,4>: Cost 3 vext2 <u,0,3,2>, <7,4,5,6>
+ 2228954841U, // <3,2,7,5>: Cost 3 vrev <2,3,5,7>
+ 2229028578U, // <3,2,7,6>: Cost 3 vrev <2,3,6,7>
+ 2665264748U, // <3,2,7,7>: Cost 3 vext2 <u,0,3,2>, <7,7,7,7>
+ 2962358379U, // <3,2,7,u>: Cost 3 vzipr <1,5,3,7>, LHS
+ 1611892795U, // <3,2,u,0>: Cost 2 vext3 LHS, <2,u,0,1>
+ 1549719342U, // <3,2,u,1>: Cost 2 vext2 <1,0,3,2>, LHS
+ 1611449960U, // <3,2,u,2>: Cost 2 vext3 LHS, <2,2,2,2>
+ 1611892824U, // <3,2,u,3>: Cost 2 vext3 LHS, <2,u,3,3>
+ 1611892835U, // <3,2,u,4>: Cost 2 vext3 LHS, <2,u,4,5>
+ 1549719706U, // <3,2,u,5>: Cost 2 vext2 <1,0,3,2>, RHS
+ 2689837168U, // <3,2,u,6>: Cost 3 vext3 LHS, <2,u,6,0>
+ 2665265408U, // <3,2,u,7>: Cost 3 vext2 <u,0,3,2>, <u,7,0,1>
+ 1611892867U, // <3,2,u,u>: Cost 2 vext3 LHS, <2,u,u,1>
+ 2685192331U, // <3,3,0,0>: Cost 3 vext3 LHS, <3,0,0,0>
+ 1611450518U, // <3,3,0,1>: Cost 2 vext3 LHS, <3,0,1,2>
+ 2685634717U, // <3,3,0,2>: Cost 3 vext3 LHS, <3,0,2,0>
+ 2564294806U, // <3,3,0,3>: Cost 3 vext1 <2,3,3,0>, <3,0,1,2>
+ 2685634736U, // <3,3,0,4>: Cost 3 vext3 LHS, <3,0,4,1>
+ 2732968122U, // <3,3,0,5>: Cost 3 vext3 LHS, <3,0,5,2>
+ 3763579075U, // <3,3,0,6>: Cost 4 vext3 LHS, <3,0,6,2>
+ 4034053264U, // <3,3,0,7>: Cost 4 vzipr <1,2,3,0>, <1,5,3,7>
+ 1611450581U, // <3,3,0,u>: Cost 2 vext3 LHS, <3,0,u,2>
+ 2685192415U, // <3,3,1,0>: Cost 3 vext3 LHS, <3,1,0,3>
+ 1550385992U, // <3,3,1,1>: Cost 2 vext2 <1,1,3,3>, <1,1,3,3>
+ 2685192433U, // <3,3,1,2>: Cost 3 vext3 LHS, <3,1,2,3>
+ 2685634808U, // <3,3,1,3>: Cost 3 vext3 LHS, <3,1,3,1>
+ 2558332214U, // <3,3,1,4>: Cost 3 vext1 <1,3,3,1>, RHS
+ 2685634828U, // <3,3,1,5>: Cost 3 vext3 LHS, <3,1,5,3>
+ 3759376661U, // <3,3,1,6>: Cost 4 vext3 LHS, <3,1,6,3>
+ 2703477022U, // <3,3,1,7>: Cost 3 vext3 <3,1,7,3>, <3,1,7,3>
+ 1555031423U, // <3,3,1,u>: Cost 2 vext2 <1,u,3,3>, <1,u,3,3>
+ 2564309094U, // <3,3,2,0>: Cost 3 vext1 <2,3,3,2>, LHS
+ 2630100513U, // <3,3,2,1>: Cost 3 vext2 <2,1,3,3>, <2,1,3,3>
+ 1557022322U, // <3,3,2,2>: Cost 2 vext2 <2,2,3,3>, <2,2,3,3>
+ 2685192520U, // <3,3,2,3>: Cost 3 vext3 LHS, <3,2,3,0>
+ 2564312374U, // <3,3,2,4>: Cost 3 vext1 <2,3,3,2>, RHS
+ 2732968286U, // <3,3,2,5>: Cost 3 vext3 LHS, <3,2,5,4>
+ 2685634918U, // <3,3,2,6>: Cost 3 vext3 LHS, <3,2,6,3>
+ 2704140655U, // <3,3,2,7>: Cost 3 vext3 <3,2,7,3>, <3,2,7,3>
+ 1561004120U, // <3,3,2,u>: Cost 2 vext2 <2,u,3,3>, <2,u,3,3>
+ 1496547430U, // <3,3,3,0>: Cost 2 vext1 <3,3,3,3>, LHS
+ 2624129256U, // <3,3,3,1>: Cost 3 vext2 <1,1,3,3>, <3,1,1,3>
+ 2630764866U, // <3,3,3,2>: Cost 3 vext2 <2,2,3,3>, <3,2,2,3>
+ 336380006U, // <3,3,3,3>: Cost 1 vdup3 LHS
+ 1496550710U, // <3,3,3,4>: Cost 2 vext1 <3,3,3,3>, RHS
+ 2732968368U, // <3,3,3,5>: Cost 3 vext3 LHS, <3,3,5,5>
+ 2624129683U, // <3,3,3,6>: Cost 3 vext2 <1,1,3,3>, <3,6,3,7>
+ 2594182400U, // <3,3,3,7>: Cost 3 vext1 <7,3,3,3>, <7,3,3,3>
+ 336380006U, // <3,3,3,u>: Cost 1 vdup3 LHS
+ 2558353510U, // <3,3,4,0>: Cost 3 vext1 <1,3,3,4>, LHS
+ 2558354411U, // <3,3,4,1>: Cost 3 vext1 <1,3,3,4>, <1,3,3,4>
+ 2564327108U, // <3,3,4,2>: Cost 3 vext1 <2,3,3,4>, <2,3,3,4>
+ 2564327938U, // <3,3,4,3>: Cost 3 vext1 <2,3,3,4>, <3,4,5,6>
+ 2960343962U, // <3,3,4,4>: Cost 3 vzipr <1,2,3,4>, <1,2,3,4>
+ 1611893250U, // <3,3,4,5>: Cost 2 vext3 LHS, <3,4,5,6>
+ 2771619126U, // <3,3,4,6>: Cost 3 vuzpl <3,3,3,3>, RHS
+ 4034086032U, // <3,3,4,7>: Cost 4 vzipr <1,2,3,4>, <1,5,3,7>
+ 1611893277U, // <3,3,4,u>: Cost 2 vext3 LHS, <3,4,u,6>
+ 2558361702U, // <3,3,5,0>: Cost 3 vext1 <1,3,3,5>, LHS
+ 2558362604U, // <3,3,5,1>: Cost 3 vext1 <1,3,3,5>, <1,3,3,5>
+ 2558363342U, // <3,3,5,2>: Cost 3 vext1 <1,3,3,5>, <2,3,4,5>
+ 2732968512U, // <3,3,5,3>: Cost 3 vext3 LHS, <3,5,3,5>
+ 2558364982U, // <3,3,5,4>: Cost 3 vext1 <1,3,3,5>, RHS
+ 3101279950U, // <3,3,5,5>: Cost 3 vtrnr <2,3,4,5>, <2,3,4,5>
+ 2665934946U, // <3,3,5,6>: Cost 3 vext2 <u,1,3,3>, <5,6,7,0>
+ 2826636598U, // <3,3,5,7>: Cost 3 vuzpr <1,3,1,3>, RHS
+ 2826636599U, // <3,3,5,u>: Cost 3 vuzpr <1,3,1,3>, RHS
+ 2732968568U, // <3,3,6,0>: Cost 3 vext3 LHS, <3,6,0,7>
+ 3763579521U, // <3,3,6,1>: Cost 4 vext3 LHS, <3,6,1,7>
+ 2732968586U, // <3,3,6,2>: Cost 3 vext3 LHS, <3,6,2,7>
+ 2732968595U, // <3,3,6,3>: Cost 3 vext3 LHS, <3,6,3,7>
+ 2732968604U, // <3,3,6,4>: Cost 3 vext3 LHS, <3,6,4,7>
+ 3763579557U, // <3,3,6,5>: Cost 4 vext3 LHS, <3,6,5,7>
+ 2732968621U, // <3,3,6,6>: Cost 3 vext3 LHS, <3,6,6,6>
+ 2657973099U, // <3,3,6,7>: Cost 3 vext2 <6,7,3,3>, <6,7,3,3>
+ 2658636732U, // <3,3,6,u>: Cost 3 vext2 <6,u,3,3>, <6,u,3,3>
+ 2558378086U, // <3,3,7,0>: Cost 3 vext1 <1,3,3,7>, LHS
+ 2558378990U, // <3,3,7,1>: Cost 3 vext1 <1,3,3,7>, <1,3,3,7>
+ 2564351687U, // <3,3,7,2>: Cost 3 vext1 <2,3,3,7>, <2,3,3,7>
+ 2661291264U, // <3,3,7,3>: Cost 3 vext2 <7,3,3,3>, <7,3,3,3>
+ 2558381366U, // <3,3,7,4>: Cost 3 vext1 <1,3,3,7>, RHS
+ 2732968694U, // <3,3,7,5>: Cost 3 vext3 LHS, <3,7,5,7>
+ 3781126907U, // <3,3,7,6>: Cost 4 vext3 <3,7,6,3>, <3,7,6,3>
+ 3095397376U, // <3,3,7,7>: Cost 3 vtrnr <1,3,5,7>, <1,3,5,7>
+ 2558383918U, // <3,3,7,u>: Cost 3 vext1 <1,3,3,7>, LHS
+ 1496547430U, // <3,3,u,0>: Cost 2 vext1 <3,3,3,3>, LHS
+ 1611893534U, // <3,3,u,1>: Cost 2 vext3 LHS, <3,u,1,2>
+ 1592858504U, // <3,3,u,2>: Cost 2 vext2 <u,2,3,3>, <u,2,3,3>
+ 336380006U, // <3,3,u,3>: Cost 1 vdup3 LHS
+ 1496550710U, // <3,3,u,4>: Cost 2 vext1 <3,3,3,3>, RHS
+ 1611893574U, // <3,3,u,5>: Cost 2 vext3 LHS, <3,u,5,6>
+ 2690280268U, // <3,3,u,6>: Cost 3 vext3 LHS, <3,u,6,3>
+ 2826636841U, // <3,3,u,7>: Cost 3 vuzpr <1,3,1,3>, RHS
+ 336380006U, // <3,3,u,u>: Cost 1 vdup3 LHS
+ 2624798720U, // <3,4,0,0>: Cost 3 vext2 <1,2,3,4>, <0,0,0,0>
+ 1551056998U, // <3,4,0,1>: Cost 2 vext2 <1,2,3,4>, LHS
+ 2624798884U, // <3,4,0,2>: Cost 3 vext2 <1,2,3,4>, <0,2,0,2>
+ 3693232384U, // <3,4,0,3>: Cost 4 vext2 <0,3,3,4>, <0,3,1,4>
+ 2624799058U, // <3,4,0,4>: Cost 3 vext2 <1,2,3,4>, <0,4,1,5>
+ 1659227026U, // <3,4,0,5>: Cost 2 vext3 LHS, <4,0,5,1>
+ 1659227036U, // <3,4,0,6>: Cost 2 vext3 LHS, <4,0,6,2>
+ 3667973382U, // <3,4,0,7>: Cost 4 vext1 <7,3,4,0>, <7,3,4,0>
+ 1551057565U, // <3,4,0,u>: Cost 2 vext2 <1,2,3,4>, LHS
+ 2624799478U, // <3,4,1,0>: Cost 3 vext2 <1,2,3,4>, <1,0,3,2>
+ 2624799540U, // <3,4,1,1>: Cost 3 vext2 <1,2,3,4>, <1,1,1,1>
+ 1551057818U, // <3,4,1,2>: Cost 2 vext2 <1,2,3,4>, <1,2,3,4>
+ 2624799704U, // <3,4,1,3>: Cost 3 vext2 <1,2,3,4>, <1,3,1,3>
+ 2564377910U, // <3,4,1,4>: Cost 3 vext1 <2,3,4,1>, RHS
+ 2689838050U, // <3,4,1,5>: Cost 3 vext3 LHS, <4,1,5,0>
+ 2689838062U, // <3,4,1,6>: Cost 3 vext3 LHS, <4,1,6,3>
+ 2628117807U, // <3,4,1,7>: Cost 3 vext2 <1,7,3,4>, <1,7,3,4>
+ 1555039616U, // <3,4,1,u>: Cost 2 vext2 <1,u,3,4>, <1,u,3,4>
+ 3626180710U, // <3,4,2,0>: Cost 4 vext1 <0,3,4,2>, LHS
+ 2624800298U, // <3,4,2,1>: Cost 3 vext2 <1,2,3,4>, <2,1,4,3>
+ 2624800360U, // <3,4,2,2>: Cost 3 vext2 <1,2,3,4>, <2,2,2,2>
+ 2624800422U, // <3,4,2,3>: Cost 3 vext2 <1,2,3,4>, <2,3,0,1>
+ 2624800514U, // <3,4,2,4>: Cost 3 vext2 <1,2,3,4>, <2,4,1,3>
+ 2709965878U, // <3,4,2,5>: Cost 3 vext3 <4,2,5,3>, <4,2,5,3>
+ 2689838140U, // <3,4,2,6>: Cost 3 vext3 LHS, <4,2,6,0>
+ 2634090504U, // <3,4,2,7>: Cost 3 vext2 <2,7,3,4>, <2,7,3,4>
+ 2689838158U, // <3,4,2,u>: Cost 3 vext3 LHS, <4,2,u,0>
+ 2624800918U, // <3,4,3,0>: Cost 3 vext2 <1,2,3,4>, <3,0,1,2>
+ 2636081403U, // <3,4,3,1>: Cost 3 vext2 <3,1,3,4>, <3,1,3,4>
+ 2636745036U, // <3,4,3,2>: Cost 3 vext2 <3,2,3,4>, <3,2,3,4>
+ 2624801180U, // <3,4,3,3>: Cost 3 vext2 <1,2,3,4>, <3,3,3,3>
+ 2624801232U, // <3,4,3,4>: Cost 3 vext2 <1,2,3,4>, <3,4,0,1>
+ 2905836854U, // <3,4,3,5>: Cost 3 vzipl <3,3,3,3>, RHS
+ 3040054582U, // <3,4,3,6>: Cost 3 vtrnl <3,3,3,3>, RHS
+ 3702524611U, // <3,4,3,7>: Cost 4 vext2 <1,u,3,4>, <3,7,0,1>
+ 2624801566U, // <3,4,3,u>: Cost 3 vext2 <1,2,3,4>, <3,u,1,2>
+ 2564399206U, // <3,4,4,0>: Cost 3 vext1 <2,3,4,4>, LHS
+ 2564400026U, // <3,4,4,1>: Cost 3 vext1 <2,3,4,4>, <1,2,3,4>
+ 2564400845U, // <3,4,4,2>: Cost 3 vext1 <2,3,4,4>, <2,3,4,4>
+ 2570373542U, // <3,4,4,3>: Cost 3 vext1 <3,3,4,4>, <3,3,4,4>
+ 1659227344U, // <3,4,4,4>: Cost 2 vext3 LHS, <4,4,4,4>
+ 1551060278U, // <3,4,4,5>: Cost 2 vext2 <1,2,3,4>, RHS
+ 1659227364U, // <3,4,4,6>: Cost 2 vext3 LHS, <4,4,6,6>
+ 3668006154U, // <3,4,4,7>: Cost 4 vext1 <7,3,4,4>, <7,3,4,4>
+ 1551060521U, // <3,4,4,u>: Cost 2 vext2 <1,2,3,4>, RHS
+ 1490665574U, // <3,4,5,0>: Cost 2 vext1 <2,3,4,5>, LHS
+ 2689838341U, // <3,4,5,1>: Cost 3 vext3 LHS, <4,5,1,3>
+ 1490667214U, // <3,4,5,2>: Cost 2 vext1 <2,3,4,5>, <2,3,4,5>
+ 2564409494U, // <3,4,5,3>: Cost 3 vext1 <2,3,4,5>, <3,0,1,2>
+ 1490668854U, // <3,4,5,4>: Cost 2 vext1 <2,3,4,5>, RHS
+ 2689838381U, // <3,4,5,5>: Cost 3 vext3 LHS, <4,5,5,7>
+ 537709878U, // <3,4,5,6>: Cost 1 vext3 LHS, RHS
+ 2594272523U, // <3,4,5,7>: Cost 3 vext1 <7,3,4,5>, <7,3,4,5>
+ 537709896U, // <3,4,5,u>: Cost 1 vext3 LHS, RHS
+ 2689838411U, // <3,4,6,0>: Cost 3 vext3 LHS, <4,6,0,1>
+ 2558444534U, // <3,4,6,1>: Cost 3 vext1 <1,3,4,6>, <1,3,4,6>
+ 2666607098U, // <3,4,6,2>: Cost 3 vext2 <u,2,3,4>, <6,2,7,3>
+ 2558446082U, // <3,4,6,3>: Cost 3 vext1 <1,3,4,6>, <3,4,5,6>
+ 1659227508U, // <3,4,6,4>: Cost 2 vext3 LHS, <4,6,4,6>
+ 2689838462U, // <3,4,6,5>: Cost 3 vext3 LHS, <4,6,5,7>
+ 2689838471U, // <3,4,6,6>: Cost 3 vext3 LHS, <4,6,6,7>
+ 2657981292U, // <3,4,6,7>: Cost 3 vext2 <6,7,3,4>, <6,7,3,4>
+ 1659227540U, // <3,4,6,u>: Cost 2 vext3 LHS, <4,6,u,2>
+ 2666607610U, // <3,4,7,0>: Cost 3 vext2 <u,2,3,4>, <7,0,1,2>
+ 3702527072U, // <3,4,7,1>: Cost 4 vext2 <1,u,3,4>, <7,1,3,5>
+ 2660635824U, // <3,4,7,2>: Cost 3 vext2 <7,2,3,4>, <7,2,3,4>
+ 3644139945U, // <3,4,7,3>: Cost 4 vext1 <3,3,4,7>, <3,3,4,7>
+ 2666607974U, // <3,4,7,4>: Cost 3 vext2 <u,2,3,4>, <7,4,5,6>
+ 2732969416U, // <3,4,7,5>: Cost 3 vext3 LHS, <4,7,5,0>
+ 2732969425U, // <3,4,7,6>: Cost 3 vext3 LHS, <4,7,6,0>
+ 2666608236U, // <3,4,7,7>: Cost 3 vext2 <u,2,3,4>, <7,7,7,7>
+ 2664617622U, // <3,4,7,u>: Cost 3 vext2 <7,u,3,4>, <7,u,3,4>
+ 1490690150U, // <3,4,u,0>: Cost 2 vext1 <2,3,4,u>, LHS
+ 1551062830U, // <3,4,u,1>: Cost 2 vext2 <1,2,3,4>, LHS
+ 1490691793U, // <3,4,u,2>: Cost 2 vext1 <2,3,4,u>, <2,3,4,u>
+ 2624804796U, // <3,4,u,3>: Cost 3 vext2 <1,2,3,4>, <u,3,0,1>
+ 1490693430U, // <3,4,u,4>: Cost 2 vext1 <2,3,4,u>, RHS
+ 1551063194U, // <3,4,u,5>: Cost 2 vext2 <1,2,3,4>, RHS
+ 537710121U, // <3,4,u,6>: Cost 1 vext3 LHS, RHS
+ 2594297102U, // <3,4,u,7>: Cost 3 vext1 <7,3,4,u>, <7,3,4,u>
+ 537710139U, // <3,4,u,u>: Cost 1 vext3 LHS, RHS
+ 3692576768U, // <3,5,0,0>: Cost 4 vext2 <0,2,3,5>, <0,0,0,0>
+ 2618835046U, // <3,5,0,1>: Cost 3 vext2 <0,2,3,5>, LHS
+ 2618835138U, // <3,5,0,2>: Cost 3 vext2 <0,2,3,5>, <0,2,3,5>
+ 3692577024U, // <3,5,0,3>: Cost 4 vext2 <0,2,3,5>, <0,3,1,4>
+ 2689838690U, // <3,5,0,4>: Cost 3 vext3 LHS, <5,0,4,1>
+ 2732969579U, // <3,5,0,5>: Cost 3 vext3 LHS, <5,0,5,1>
+ 2732969588U, // <3,5,0,6>: Cost 3 vext3 LHS, <5,0,6,1>
+ 2246963055U, // <3,5,0,7>: Cost 3 vrev <5,3,7,0>
+ 2618835613U, // <3,5,0,u>: Cost 3 vext2 <0,2,3,5>, LHS
+ 2594308198U, // <3,5,1,0>: Cost 3 vext1 <7,3,5,1>, LHS
+ 3692577588U, // <3,5,1,1>: Cost 4 vext2 <0,2,3,5>, <1,1,1,1>
+ 2624807835U, // <3,5,1,2>: Cost 3 vext2 <1,2,3,5>, <1,2,3,5>
+ 2625471468U, // <3,5,1,3>: Cost 3 vext2 <1,3,3,5>, <1,3,3,5>
+ 2626135101U, // <3,5,1,4>: Cost 3 vext2 <1,4,3,5>, <1,4,3,5>
+ 2594311888U, // <3,5,1,5>: Cost 3 vext1 <7,3,5,1>, <5,1,7,3>
+ 3699877107U, // <3,5,1,6>: Cost 4 vext2 <1,4,3,5>, <1,6,5,7>
+ 1641680592U, // <3,5,1,7>: Cost 2 vext3 <5,1,7,3>, <5,1,7,3>
+ 1641754329U, // <3,5,1,u>: Cost 2 vext3 <5,1,u,3>, <5,1,u,3>
+ 3692578274U, // <3,5,2,0>: Cost 4 vext2 <0,2,3,5>, <2,0,5,3>
+ 2630116899U, // <3,5,2,1>: Cost 3 vext2 <2,1,3,5>, <2,1,3,5>
+ 3692578408U, // <3,5,2,2>: Cost 4 vext2 <0,2,3,5>, <2,2,2,2>
+ 2625472206U, // <3,5,2,3>: Cost 3 vext2 <1,3,3,5>, <2,3,4,5>
+ 2632107798U, // <3,5,2,4>: Cost 3 vext2 <2,4,3,5>, <2,4,3,5>
+ 2715938575U, // <3,5,2,5>: Cost 3 vext3 <5,2,5,3>, <5,2,5,3>
+ 3692578746U, // <3,5,2,6>: Cost 4 vext2 <0,2,3,5>, <2,6,3,7>
+ 2716086049U, // <3,5,2,7>: Cost 3 vext3 <5,2,7,3>, <5,2,7,3>
+ 2634762330U, // <3,5,2,u>: Cost 3 vext2 <2,u,3,5>, <2,u,3,5>
+ 3692578966U, // <3,5,3,0>: Cost 4 vext2 <0,2,3,5>, <3,0,1,2>
+ 2636089596U, // <3,5,3,1>: Cost 3 vext2 <3,1,3,5>, <3,1,3,5>
+ 3699214668U, // <3,5,3,2>: Cost 4 vext2 <1,3,3,5>, <3,2,3,4>
+ 2638080412U, // <3,5,3,3>: Cost 3 vext2 <3,4,3,5>, <3,3,3,3>
+ 2618837506U, // <3,5,3,4>: Cost 3 vext2 <0,2,3,5>, <3,4,5,6>
+ 2832844494U, // <3,5,3,5>: Cost 3 vuzpr <2,3,4,5>, <2,3,4,5>
+ 4033415682U, // <3,5,3,6>: Cost 4 vzipr <1,1,3,3>, <3,4,5,6>
+ 3095072054U, // <3,5,3,7>: Cost 3 vtrnr <1,3,1,3>, RHS
+ 3095072055U, // <3,5,3,u>: Cost 3 vtrnr <1,3,1,3>, RHS
+ 2600304742U, // <3,5,4,0>: Cost 3 vext1 <u,3,5,4>, LHS
+ 3763580815U, // <3,5,4,1>: Cost 4 vext3 LHS, <5,4,1,5>
+ 2564474582U, // <3,5,4,2>: Cost 3 vext1 <2,3,5,4>, <2,3,5,4>
+ 3699879044U, // <3,5,4,3>: Cost 4 vext2 <1,4,3,5>, <4,3,5,0>
+ 2600308022U, // <3,5,4,4>: Cost 3 vext1 <u,3,5,4>, RHS
+ 2618838326U, // <3,5,4,5>: Cost 3 vext2 <0,2,3,5>, RHS
+ 2772454710U, // <3,5,4,6>: Cost 3 vuzpl <3,4,5,6>, RHS
+ 1659228102U, // <3,5,4,7>: Cost 2 vext3 LHS, <5,4,7,6>
+ 1659228111U, // <3,5,4,u>: Cost 2 vext3 LHS, <5,4,u,6>
+ 2570453094U, // <3,5,5,0>: Cost 3 vext1 <3,3,5,5>, LHS
+ 2624810704U, // <3,5,5,1>: Cost 3 vext2 <1,2,3,5>, <5,1,7,3>
+ 2570454734U, // <3,5,5,2>: Cost 3 vext1 <3,3,5,5>, <2,3,4,5>
+ 2570455472U, // <3,5,5,3>: Cost 3 vext1 <3,3,5,5>, <3,3,5,5>
+ 2570456374U, // <3,5,5,4>: Cost 3 vext1 <3,3,5,5>, RHS
+ 1659228164U, // <3,5,5,5>: Cost 2 vext3 LHS, <5,5,5,5>
+ 2732969998U, // <3,5,5,6>: Cost 3 vext3 LHS, <5,5,6,6>
+ 1659228184U, // <3,5,5,7>: Cost 2 vext3 LHS, <5,5,7,7>
+ 1659228193U, // <3,5,5,u>: Cost 2 vext3 LHS, <5,5,u,7>
+ 2732970020U, // <3,5,6,0>: Cost 3 vext3 LHS, <5,6,0,1>
+ 2732970035U, // <3,5,6,1>: Cost 3 vext3 LHS, <5,6,1,7>
+ 2564490968U, // <3,5,6,2>: Cost 3 vext1 <2,3,5,6>, <2,3,5,6>
+ 2732970050U, // <3,5,6,3>: Cost 3 vext3 LHS, <5,6,3,4>
+ 2732970060U, // <3,5,6,4>: Cost 3 vext3 LHS, <5,6,4,5>
+ 2732970071U, // <3,5,6,5>: Cost 3 vext3 LHS, <5,6,5,7>
+ 2732970080U, // <3,5,6,6>: Cost 3 vext3 LHS, <5,6,6,7>
+ 1659228258U, // <3,5,6,7>: Cost 2 vext3 LHS, <5,6,7,0>
+ 1659228267U, // <3,5,6,u>: Cost 2 vext3 LHS, <5,6,u,0>
+ 1484783718U, // <3,5,7,0>: Cost 2 vext1 <1,3,5,7>, LHS
+ 1484784640U, // <3,5,7,1>: Cost 2 vext1 <1,3,5,7>, <1,3,5,7>
+ 2558527080U, // <3,5,7,2>: Cost 3 vext1 <1,3,5,7>, <2,2,2,2>
+ 2558527638U, // <3,5,7,3>: Cost 3 vext1 <1,3,5,7>, <3,0,1,2>
+ 1484786998U, // <3,5,7,4>: Cost 2 vext1 <1,3,5,7>, RHS
+ 1659228328U, // <3,5,7,5>: Cost 2 vext3 LHS, <5,7,5,7>
+ 2732970154U, // <3,5,7,6>: Cost 3 vext3 LHS, <5,7,6,0>
+ 2558531180U, // <3,5,7,7>: Cost 3 vext1 <1,3,5,7>, <7,7,7,7>
+ 1484789550U, // <3,5,7,u>: Cost 2 vext1 <1,3,5,7>, LHS
+ 1484791910U, // <3,5,u,0>: Cost 2 vext1 <1,3,5,u>, LHS
+ 1484792833U, // <3,5,u,1>: Cost 2 vext1 <1,3,5,u>, <1,3,5,u>
+ 2558535272U, // <3,5,u,2>: Cost 3 vext1 <1,3,5,u>, <2,2,2,2>
+ 2558535830U, // <3,5,u,3>: Cost 3 vext1 <1,3,5,u>, <3,0,1,2>
+ 1484795190U, // <3,5,u,4>: Cost 2 vext1 <1,3,5,u>, RHS
+ 1659228409U, // <3,5,u,5>: Cost 2 vext3 LHS, <5,u,5,7>
+ 2772457626U, // <3,5,u,6>: Cost 3 vuzpl <3,4,5,6>, RHS
+ 1646326023U, // <3,5,u,7>: Cost 2 vext3 <5,u,7,3>, <5,u,7,3>
+ 1484797742U, // <3,5,u,u>: Cost 2 vext1 <1,3,5,u>, LHS
+ 2558541926U, // <3,6,0,0>: Cost 3 vext1 <1,3,6,0>, LHS
+ 2689839393U, // <3,6,0,1>: Cost 3 vext3 LHS, <6,0,1,2>
+ 2689839404U, // <3,6,0,2>: Cost 3 vext3 LHS, <6,0,2,4>
+ 3706519808U, // <3,6,0,3>: Cost 4 vext2 <2,5,3,6>, <0,3,1,4>
+ 2689839420U, // <3,6,0,4>: Cost 3 vext3 LHS, <6,0,4,2>
+ 2732970314U, // <3,6,0,5>: Cost 3 vext3 LHS, <6,0,5,7>
+ 2732970316U, // <3,6,0,6>: Cost 3 vext3 LHS, <6,0,6,0>
+ 2960313654U, // <3,6,0,7>: Cost 3 vzipr <1,2,3,0>, RHS
+ 2689839456U, // <3,6,0,u>: Cost 3 vext3 LHS, <6,0,u,2>
+ 3763581290U, // <3,6,1,0>: Cost 4 vext3 LHS, <6,1,0,3>
+ 3763581297U, // <3,6,1,1>: Cost 4 vext3 LHS, <6,1,1,1>
+ 2624816028U, // <3,6,1,2>: Cost 3 vext2 <1,2,3,6>, <1,2,3,6>
+ 3763581315U, // <3,6,1,3>: Cost 4 vext3 LHS, <6,1,3,1>
+ 2626143294U, // <3,6,1,4>: Cost 3 vext2 <1,4,3,6>, <1,4,3,6>
+ 3763581335U, // <3,6,1,5>: Cost 4 vext3 LHS, <6,1,5,3>
+ 2721321376U, // <3,6,1,6>: Cost 3 vext3 <6,1,6,3>, <6,1,6,3>
+ 2721395113U, // <3,6,1,7>: Cost 3 vext3 <6,1,7,3>, <6,1,7,3>
+ 2628797826U, // <3,6,1,u>: Cost 3 vext2 <1,u,3,6>, <1,u,3,6>
+ 2594390118U, // <3,6,2,0>: Cost 3 vext1 <7,3,6,2>, LHS
+ 2721616324U, // <3,6,2,1>: Cost 3 vext3 <6,2,1,3>, <6,2,1,3>
+ 2630788725U, // <3,6,2,2>: Cost 3 vext2 <2,2,3,6>, <2,2,3,6>
+ 3763581395U, // <3,6,2,3>: Cost 4 vext3 LHS, <6,2,3,0>
+ 2632115991U, // <3,6,2,4>: Cost 3 vext2 <2,4,3,6>, <2,4,3,6>
+ 2632779624U, // <3,6,2,5>: Cost 3 vext2 <2,5,3,6>, <2,5,3,6>
+ 2594394618U, // <3,6,2,6>: Cost 3 vext1 <7,3,6,2>, <6,2,7,3>
+ 1648316922U, // <3,6,2,7>: Cost 2 vext3 <6,2,7,3>, <6,2,7,3>
+ 1648390659U, // <3,6,2,u>: Cost 2 vext3 <6,2,u,3>, <6,2,u,3>
+ 3693914262U, // <3,6,3,0>: Cost 4 vext2 <0,4,3,6>, <3,0,1,2>
+ 3638281176U, // <3,6,3,1>: Cost 4 vext1 <2,3,6,3>, <1,3,1,3>
+ 3696568678U, // <3,6,3,2>: Cost 4 vext2 <0,u,3,6>, <3,2,6,3>
+ 2638088604U, // <3,6,3,3>: Cost 3 vext2 <3,4,3,6>, <3,3,3,3>
+ 2632780290U, // <3,6,3,4>: Cost 3 vext2 <2,5,3,6>, <3,4,5,6>
+ 3712494145U, // <3,6,3,5>: Cost 4 vext2 <3,5,3,6>, <3,5,3,6>
+ 3698559612U, // <3,6,3,6>: Cost 4 vext2 <1,2,3,6>, <3,6,1,2>
+ 2959674678U, // <3,6,3,7>: Cost 3 vzipr <1,1,3,3>, RHS
+ 2959674679U, // <3,6,3,u>: Cost 3 vzipr <1,1,3,3>, RHS
+ 3763581536U, // <3,6,4,0>: Cost 4 vext3 LHS, <6,4,0,6>
+ 2722943590U, // <3,6,4,1>: Cost 3 vext3 <6,4,1,3>, <6,4,1,3>
+ 2732970609U, // <3,6,4,2>: Cost 3 vext3 LHS, <6,4,2,5>
+ 3698560147U, // <3,6,4,3>: Cost 4 vext2 <1,2,3,6>, <4,3,6,6>
+ 2732970628U, // <3,6,4,4>: Cost 3 vext3 LHS, <6,4,4,6>
+ 2689839757U, // <3,6,4,5>: Cost 3 vext3 LHS, <6,4,5,6>
+ 2732970640U, // <3,6,4,6>: Cost 3 vext3 LHS, <6,4,6,0>
+ 2960346422U, // <3,6,4,7>: Cost 3 vzipr <1,2,3,4>, RHS
+ 2689839784U, // <3,6,4,u>: Cost 3 vext3 LHS, <6,4,u,6>
+ 2576498790U, // <3,6,5,0>: Cost 3 vext1 <4,3,6,5>, LHS
+ 3650241270U, // <3,6,5,1>: Cost 4 vext1 <4,3,6,5>, <1,0,3,2>
+ 2732970692U, // <3,6,5,2>: Cost 3 vext3 LHS, <6,5,2,7>
+ 2576501250U, // <3,6,5,3>: Cost 3 vext1 <4,3,6,5>, <3,4,5,6>
+ 2576501906U, // <3,6,5,4>: Cost 3 vext1 <4,3,6,5>, <4,3,6,5>
+ 3650244622U, // <3,6,5,5>: Cost 4 vext1 <4,3,6,5>, <5,5,6,6>
+ 4114633528U, // <3,6,5,6>: Cost 4 vtrnl <3,4,5,6>, <6,6,6,6>
+ 2732970735U, // <3,6,5,7>: Cost 3 vext3 LHS, <6,5,7,5>
+ 2576504622U, // <3,6,5,u>: Cost 3 vext1 <4,3,6,5>, LHS
+ 2732970749U, // <3,6,6,0>: Cost 3 vext3 LHS, <6,6,0,1>
+ 2724270856U, // <3,6,6,1>: Cost 3 vext3 <6,6,1,3>, <6,6,1,3>
+ 2624819706U, // <3,6,6,2>: Cost 3 vext2 <1,2,3,6>, <6,2,7,3>
+ 3656223234U, // <3,6,6,3>: Cost 4 vext1 <5,3,6,6>, <3,4,5,6>
+ 2732970788U, // <3,6,6,4>: Cost 3 vext3 LHS, <6,6,4,4>
+ 2732970800U, // <3,6,6,5>: Cost 3 vext3 LHS, <6,6,5,7>
+ 1659228984U, // <3,6,6,6>: Cost 2 vext3 LHS, <6,6,6,6>
+ 1659228994U, // <3,6,6,7>: Cost 2 vext3 LHS, <6,6,7,7>
+ 1659229003U, // <3,6,6,u>: Cost 2 vext3 LHS, <6,6,u,7>
+ 1659229006U, // <3,6,7,0>: Cost 2 vext3 LHS, <6,7,0,1>
+ 2558600201U, // <3,6,7,1>: Cost 3 vext1 <1,3,6,7>, <1,3,6,7>
+ 2558601146U, // <3,6,7,2>: Cost 3 vext1 <1,3,6,7>, <2,6,3,7>
+ 2725081963U, // <3,6,7,3>: Cost 3 vext3 <6,7,3,3>, <6,7,3,3>
+ 1659229046U, // <3,6,7,4>: Cost 2 vext3 LHS, <6,7,4,5>
+ 2715423611U, // <3,6,7,5>: Cost 3 vext3 <5,1,7,3>, <6,7,5,1>
+ 2722059141U, // <3,6,7,6>: Cost 3 vext3 <6,2,7,3>, <6,7,6,2>
+ 2962361654U, // <3,6,7,7>: Cost 3 vzipr <1,5,3,7>, RHS
+ 1659229078U, // <3,6,7,u>: Cost 2 vext3 LHS, <6,7,u,1>
+ 1659229087U, // <3,6,u,0>: Cost 2 vext3 LHS, <6,u,0,1>
+ 2689840041U, // <3,6,u,1>: Cost 3 vext3 LHS, <6,u,1,2>
+ 2558609339U, // <3,6,u,2>: Cost 3 vext1 <1,3,6,u>, <2,6,3,u>
+ 2576525853U, // <3,6,u,3>: Cost 3 vext1 <4,3,6,u>, <3,4,u,6>
+ 1659229127U, // <3,6,u,4>: Cost 2 vext3 LHS, <6,u,4,5>
+ 2689840081U, // <3,6,u,5>: Cost 3 vext3 LHS, <6,u,5,6>
+ 1659228984U, // <3,6,u,6>: Cost 2 vext3 LHS, <6,6,6,6>
+ 1652298720U, // <3,6,u,7>: Cost 2 vext3 <6,u,7,3>, <6,u,7,3>
+ 1659229159U, // <3,6,u,u>: Cost 2 vext3 LHS, <6,u,u,1>
+ 2626813952U, // <3,7,0,0>: Cost 3 vext2 <1,5,3,7>, <0,0,0,0>
+ 1553072230U, // <3,7,0,1>: Cost 2 vext2 <1,5,3,7>, LHS
+ 2626814116U, // <3,7,0,2>: Cost 3 vext2 <1,5,3,7>, <0,2,0,2>
+ 3700556028U, // <3,7,0,3>: Cost 4 vext2 <1,5,3,7>, <0,3,1,0>
+ 2626814290U, // <3,7,0,4>: Cost 3 vext2 <1,5,3,7>, <0,4,1,5>
+ 2582507375U, // <3,7,0,5>: Cost 3 vext1 <5,3,7,0>, <5,3,7,0>
+ 2588480072U, // <3,7,0,6>: Cost 3 vext1 <6,3,7,0>, <6,3,7,0>
+ 2732971055U, // <3,7,0,7>: Cost 3 vext3 LHS, <7,0,7,1>
+ 1553072797U, // <3,7,0,u>: Cost 2 vext2 <1,5,3,7>, LHS
+ 2626814710U, // <3,7,1,0>: Cost 3 vext2 <1,5,3,7>, <1,0,3,2>
+ 2626814772U, // <3,7,1,1>: Cost 3 vext2 <1,5,3,7>, <1,1,1,1>
+ 2626814870U, // <3,7,1,2>: Cost 3 vext2 <1,5,3,7>, <1,2,3,0>
+ 2625487854U, // <3,7,1,3>: Cost 3 vext2 <1,3,3,7>, <1,3,3,7>
+ 2582514998U, // <3,7,1,4>: Cost 3 vext1 <5,3,7,1>, RHS
+ 1553073296U, // <3,7,1,5>: Cost 2 vext2 <1,5,3,7>, <1,5,3,7>
+ 2627478753U, // <3,7,1,6>: Cost 3 vext2 <1,6,3,7>, <1,6,3,7>
+ 2727367810U, // <3,7,1,7>: Cost 3 vext3 <7,1,7,3>, <7,1,7,3>
+ 1555064195U, // <3,7,1,u>: Cost 2 vext2 <1,u,3,7>, <1,u,3,7>
+ 2588491878U, // <3,7,2,0>: Cost 3 vext1 <6,3,7,2>, LHS
+ 3700557318U, // <3,7,2,1>: Cost 4 vext2 <1,5,3,7>, <2,1,0,3>
+ 2626815592U, // <3,7,2,2>: Cost 3 vext2 <1,5,3,7>, <2,2,2,2>
+ 2626815654U, // <3,7,2,3>: Cost 3 vext2 <1,5,3,7>, <2,3,0,1>
+ 2588495158U, // <3,7,2,4>: Cost 3 vext1 <6,3,7,2>, RHS
+ 2632787817U, // <3,7,2,5>: Cost 3 vext2 <2,5,3,7>, <2,5,3,7>
+ 1559709626U, // <3,7,2,6>: Cost 2 vext2 <2,6,3,7>, <2,6,3,7>
+ 2728031443U, // <3,7,2,7>: Cost 3 vext3 <7,2,7,3>, <7,2,7,3>
+ 1561036892U, // <3,7,2,u>: Cost 2 vext2 <2,u,3,7>, <2,u,3,7>
+ 2626816150U, // <3,7,3,0>: Cost 3 vext2 <1,5,3,7>, <3,0,1,2>
+ 2626816268U, // <3,7,3,1>: Cost 3 vext2 <1,5,3,7>, <3,1,5,3>
+ 2633451878U, // <3,7,3,2>: Cost 3 vext2 <2,6,3,7>, <3,2,6,3>
+ 2626816412U, // <3,7,3,3>: Cost 3 vext2 <1,5,3,7>, <3,3,3,3>
+ 2626816514U, // <3,7,3,4>: Cost 3 vext2 <1,5,3,7>, <3,4,5,6>
+ 2638760514U, // <3,7,3,5>: Cost 3 vext2 <3,5,3,7>, <3,5,3,7>
+ 2639424147U, // <3,7,3,6>: Cost 3 vext2 <3,6,3,7>, <3,6,3,7>
+ 2826961920U, // <3,7,3,7>: Cost 3 vuzpr <1,3,5,7>, <1,3,5,7>
+ 2626816798U, // <3,7,3,u>: Cost 3 vext2 <1,5,3,7>, <3,u,1,2>
+ 2582536294U, // <3,7,4,0>: Cost 3 vext1 <5,3,7,4>, LHS
+ 2582537360U, // <3,7,4,1>: Cost 3 vext1 <5,3,7,4>, <1,5,3,7>
+ 2588510138U, // <3,7,4,2>: Cost 3 vext1 <6,3,7,4>, <2,6,3,7>
+ 3700558996U, // <3,7,4,3>: Cost 4 vext2 <1,5,3,7>, <4,3,6,7>
+ 2582539574U, // <3,7,4,4>: Cost 3 vext1 <5,3,7,4>, RHS
+ 1553075510U, // <3,7,4,5>: Cost 2 vext2 <1,5,3,7>, RHS
+ 2588512844U, // <3,7,4,6>: Cost 3 vext1 <6,3,7,4>, <6,3,7,4>
+ 2564625766U, // <3,7,4,7>: Cost 3 vext1 <2,3,7,4>, <7,4,5,6>
+ 1553075753U, // <3,7,4,u>: Cost 2 vext2 <1,5,3,7>, RHS
+ 2732971398U, // <3,7,5,0>: Cost 3 vext3 LHS, <7,5,0,2>
+ 2626817744U, // <3,7,5,1>: Cost 3 vext2 <1,5,3,7>, <5,1,7,3>
+ 3700559649U, // <3,7,5,2>: Cost 4 vext2 <1,5,3,7>, <5,2,7,3>
+ 2626817903U, // <3,7,5,3>: Cost 3 vext2 <1,5,3,7>, <5,3,7,0>
+ 2258728203U, // <3,7,5,4>: Cost 3 vrev <7,3,4,5>
+ 2732971446U, // <3,7,5,5>: Cost 3 vext3 LHS, <7,5,5,5>
+ 2732971457U, // <3,7,5,6>: Cost 3 vext3 LHS, <7,5,6,7>
+ 2826964278U, // <3,7,5,7>: Cost 3 vuzpr <1,3,5,7>, RHS
+ 2826964279U, // <3,7,5,u>: Cost 3 vuzpr <1,3,5,7>, RHS
+ 2732971478U, // <3,7,6,0>: Cost 3 vext3 LHS, <7,6,0,1>
+ 2732971486U, // <3,7,6,1>: Cost 3 vext3 LHS, <7,6,1,0>
+ 2633454074U, // <3,7,6,2>: Cost 3 vext2 <2,6,3,7>, <6,2,7,3>
+ 2633454152U, // <3,7,6,3>: Cost 3 vext2 <2,6,3,7>, <6,3,7,0>
+ 2732971518U, // <3,7,6,4>: Cost 3 vext3 LHS, <7,6,4,5>
+ 2732971526U, // <3,7,6,5>: Cost 3 vext3 LHS, <7,6,5,4>
+ 2732971537U, // <3,7,6,6>: Cost 3 vext3 LHS, <7,6,6,6>
+ 2732971540U, // <3,7,6,7>: Cost 3 vext3 LHS, <7,6,7,0>
+ 2726041124U, // <3,7,6,u>: Cost 3 vext3 <6,u,7,3>, <7,6,u,7>
+ 2570616934U, // <3,7,7,0>: Cost 3 vext1 <3,3,7,7>, LHS
+ 2570617856U, // <3,7,7,1>: Cost 3 vext1 <3,3,7,7>, <1,3,5,7>
+ 2564646635U, // <3,7,7,2>: Cost 3 vext1 <2,3,7,7>, <2,3,7,7>
+ 2570619332U, // <3,7,7,3>: Cost 3 vext1 <3,3,7,7>, <3,3,7,7>
+ 2570620214U, // <3,7,7,4>: Cost 3 vext1 <3,3,7,7>, RHS
+ 2582564726U, // <3,7,7,5>: Cost 3 vext1 <5,3,7,7>, <5,3,7,7>
+ 2588537423U, // <3,7,7,6>: Cost 3 vext1 <6,3,7,7>, <6,3,7,7>
+ 1659229804U, // <3,7,7,7>: Cost 2 vext3 LHS, <7,7,7,7>
+ 1659229804U, // <3,7,7,u>: Cost 2 vext3 LHS, <7,7,7,7>
+ 2626819795U, // <3,7,u,0>: Cost 3 vext2 <1,5,3,7>, <u,0,1,2>
+ 1553078062U, // <3,7,u,1>: Cost 2 vext2 <1,5,3,7>, LHS
+ 2626819973U, // <3,7,u,2>: Cost 3 vext2 <1,5,3,7>, <u,2,3,0>
+ 2826961565U, // <3,7,u,3>: Cost 3 vuzpr <1,3,5,7>, LHS
+ 2626820159U, // <3,7,u,4>: Cost 3 vext2 <1,5,3,7>, <u,4,5,6>
+ 1553078426U, // <3,7,u,5>: Cost 2 vext2 <1,5,3,7>, RHS
+ 1595545808U, // <3,7,u,6>: Cost 2 vext2 <u,6,3,7>, <u,6,3,7>
+ 1659229804U, // <3,7,u,7>: Cost 2 vext3 LHS, <7,7,7,7>
+ 1553078629U, // <3,7,u,u>: Cost 2 vext2 <1,5,3,7>, LHS
+ 1611448320U, // <3,u,0,0>: Cost 2 vext3 LHS, <0,0,0,0>
+ 1611896531U, // <3,u,0,1>: Cost 2 vext3 LHS, <u,0,1,2>
+ 1659672284U, // <3,u,0,2>: Cost 2 vext3 LHS, <u,0,2,2>
+ 1616099045U, // <3,u,0,3>: Cost 2 vext3 LHS, <u,0,3,2>
+ 2685638381U, // <3,u,0,4>: Cost 3 vext3 LHS, <u,0,4,1>
+ 1663874806U, // <3,u,0,5>: Cost 2 vext3 LHS, <u,0,5,1>
+ 1663874816U, // <3,u,0,6>: Cost 2 vext3 LHS, <u,0,6,2>
+ 2960313672U, // <3,u,0,7>: Cost 3 vzipr <1,2,3,0>, RHS
+ 1611896594U, // <3,u,0,u>: Cost 2 vext3 LHS, <u,0,u,2>
+ 1549763324U, // <3,u,1,0>: Cost 2 vext2 <1,0,3,u>, <1,0,3,u>
+ 1550426957U, // <3,u,1,1>: Cost 2 vext2 <1,1,3,u>, <1,1,3,u>
+ 537712430U, // <3,u,1,2>: Cost 1 vext3 LHS, LHS
+ 1616541495U, // <3,u,1,3>: Cost 2 vext3 LHS, <u,1,3,3>
+ 1490930998U, // <3,u,1,4>: Cost 2 vext1 <2,3,u,1>, RHS
+ 1553081489U, // <3,u,1,5>: Cost 2 vext2 <1,5,3,u>, <1,5,3,u>
+ 2627486946U, // <3,u,1,6>: Cost 3 vext2 <1,6,3,u>, <1,6,3,u>
+ 1659230043U, // <3,u,1,7>: Cost 2 vext3 LHS, <u,1,7,3>
+ 537712484U, // <3,u,1,u>: Cost 1 vext3 LHS, LHS
+ 1611890852U, // <3,u,2,0>: Cost 2 vext3 LHS, <0,2,0,2>
+ 2624833102U, // <3,u,2,1>: Cost 3 vext2 <1,2,3,u>, <2,1,u,3>
+ 1557063287U, // <3,u,2,2>: Cost 2 vext2 <2,2,3,u>, <2,2,3,u>
+ 1616099205U, // <3,u,2,3>: Cost 2 vext3 LHS, <u,2,3,0>
+ 1611890892U, // <3,u,2,4>: Cost 2 vext3 LHS, <0,2,4,6>
+ 2689841054U, // <3,u,2,5>: Cost 3 vext3 LHS, <u,2,5,7>
+ 1559717819U, // <3,u,2,6>: Cost 2 vext2 <2,6,3,u>, <2,6,3,u>
+ 1659230124U, // <3,u,2,7>: Cost 2 vext3 LHS, <u,2,7,3>
+ 1616541618U, // <3,u,2,u>: Cost 2 vext3 LHS, <u,2,u,0>
+ 1611896764U, // <3,u,3,0>: Cost 2 vext3 LHS, <u,3,0,1>
+ 1484973079U, // <3,u,3,1>: Cost 2 vext1 <1,3,u,3>, <1,3,u,3>
+ 2685638607U, // <3,u,3,2>: Cost 3 vext3 LHS, <u,3,2,2>
+ 336380006U, // <3,u,3,3>: Cost 1 vdup3 LHS
+ 1611896804U, // <3,u,3,4>: Cost 2 vext3 LHS, <u,3,4,5>
+ 1616541679U, // <3,u,3,5>: Cost 2 vext3 LHS, <u,3,5,7>
+ 2690283512U, // <3,u,3,6>: Cost 3 vext3 LHS, <u,3,6,7>
+ 2959674696U, // <3,u,3,7>: Cost 3 vzipr <1,1,3,3>, RHS
+ 336380006U, // <3,u,3,u>: Cost 1 vdup3 LHS
+ 2558722150U, // <3,u,4,0>: Cost 3 vext1 <1,3,u,4>, LHS
+ 1659672602U, // <3,u,4,1>: Cost 2 vext3 LHS, <u,4,1,5>
+ 1659672612U, // <3,u,4,2>: Cost 2 vext3 LHS, <u,4,2,6>
+ 2689841196U, // <3,u,4,3>: Cost 3 vext3 LHS, <u,4,3,5>
+ 1659227344U, // <3,u,4,4>: Cost 2 vext3 LHS, <4,4,4,4>
+ 1611896895U, // <3,u,4,5>: Cost 2 vext3 LHS, <u,4,5,6>
+ 1663875144U, // <3,u,4,6>: Cost 2 vext3 LHS, <u,4,6,6>
+ 1659230289U, // <3,u,4,7>: Cost 2 vext3 LHS, <u,4,7,6>
+ 1611896922U, // <3,u,4,u>: Cost 2 vext3 LHS, <u,4,u,6>
+ 1490960486U, // <3,u,5,0>: Cost 2 vext1 <2,3,u,5>, LHS
+ 2689841261U, // <3,u,5,1>: Cost 3 vext3 LHS, <u,5,1,7>
+ 1490962162U, // <3,u,5,2>: Cost 2 vext1 <2,3,u,5>, <2,3,u,5>
+ 1616541823U, // <3,u,5,3>: Cost 2 vext3 LHS, <u,5,3,7>
+ 1490963766U, // <3,u,5,4>: Cost 2 vext1 <2,3,u,5>, RHS
+ 1659228164U, // <3,u,5,5>: Cost 2 vext3 LHS, <5,5,5,5>
+ 537712794U, // <3,u,5,6>: Cost 1 vext3 LHS, RHS
+ 1659230371U, // <3,u,5,7>: Cost 2 vext3 LHS, <u,5,7,7>
+ 537712812U, // <3,u,5,u>: Cost 1 vext3 LHS, RHS
+ 2689841327U, // <3,u,6,0>: Cost 3 vext3 LHS, <u,6,0,1>
+ 2558739482U, // <3,u,6,1>: Cost 3 vext1 <1,3,u,6>, <1,3,u,6>
+ 2689841351U, // <3,u,6,2>: Cost 3 vext3 LHS, <u,6,2,7>
+ 1616099536U, // <3,u,6,3>: Cost 2 vext3 LHS, <u,6,3,7>
+ 1659227508U, // <3,u,6,4>: Cost 2 vext3 LHS, <4,6,4,6>
+ 2690283746U, // <3,u,6,5>: Cost 3 vext3 LHS, <u,6,5,7>
+ 1659228984U, // <3,u,6,6>: Cost 2 vext3 LHS, <6,6,6,6>
+ 1659230445U, // <3,u,6,7>: Cost 2 vext3 LHS, <u,6,7,0>
+ 1616099581U, // <3,u,6,u>: Cost 2 vext3 LHS, <u,6,u,7>
+ 1485004902U, // <3,u,7,0>: Cost 2 vext1 <1,3,u,7>, LHS
+ 1485005851U, // <3,u,7,1>: Cost 2 vext1 <1,3,u,7>, <1,3,u,7>
+ 2558748264U, // <3,u,7,2>: Cost 3 vext1 <1,3,u,7>, <2,2,2,2>
+ 3095397021U, // <3,u,7,3>: Cost 3 vtrnr <1,3,5,7>, LHS
+ 1485008182U, // <3,u,7,4>: Cost 2 vext1 <1,3,u,7>, RHS
+ 1659228328U, // <3,u,7,5>: Cost 2 vext3 LHS, <5,7,5,7>
+ 2722060599U, // <3,u,7,6>: Cost 3 vext3 <6,2,7,3>, <u,7,6,2>
+ 1659229804U, // <3,u,7,7>: Cost 2 vext3 LHS, <7,7,7,7>
+ 1485010734U, // <3,u,7,u>: Cost 2 vext1 <1,3,u,7>, LHS
+ 1616099665U, // <3,u,u,0>: Cost 2 vext3 LHS, <u,u,0,1>
+ 1611897179U, // <3,u,u,1>: Cost 2 vext3 LHS, <u,u,1,2>
+ 537712997U, // <3,u,u,2>: Cost 1 vext3 LHS, LHS
+ 336380006U, // <3,u,u,3>: Cost 1 vdup3 LHS
+ 1616099705U, // <3,u,u,4>: Cost 2 vext3 LHS, <u,u,4,5>
+ 1611897219U, // <3,u,u,5>: Cost 2 vext3 LHS, <u,u,5,6>
+ 537713037U, // <3,u,u,6>: Cost 1 vext3 LHS, RHS
+ 1659230607U, // <3,u,u,7>: Cost 2 vext3 LHS, <u,u,7,0>
+ 537713051U, // <3,u,u,u>: Cost 1 vext3 LHS, LHS
+ 2691907584U, // <4,0,0,0>: Cost 3 vext3 <1,2,3,4>, <0,0,0,0>
+ 2691907594U, // <4,0,0,1>: Cost 3 vext3 <1,2,3,4>, <0,0,1,1>
+ 2691907604U, // <4,0,0,2>: Cost 3 vext3 <1,2,3,4>, <0,0,2,2>
+ 3709862144U, // <4,0,0,3>: Cost 4 vext2 <3,1,4,0>, <0,3,1,4>
+ 2684682280U, // <4,0,0,4>: Cost 3 vext3 <0,0,4,4>, <0,0,4,4>
+ 3694600633U, // <4,0,0,5>: Cost 4 vext2 <0,5,4,0>, <0,5,4,0>
+ 3291431290U, // <4,0,0,6>: Cost 4 vrev <0,4,6,0>
+ 3668342067U, // <4,0,0,7>: Cost 4 vext1 <7,4,0,0>, <7,4,0,0>
+ 2691907657U, // <4,0,0,u>: Cost 3 vext3 <1,2,3,4>, <0,0,u,1>
+ 2570715238U, // <4,0,1,0>: Cost 3 vext1 <3,4,0,1>, LHS
+ 2570716058U, // <4,0,1,1>: Cost 3 vext1 <3,4,0,1>, <1,2,3,4>
+ 1618165862U, // <4,0,1,2>: Cost 2 vext3 <1,2,3,4>, LHS
+ 2570717648U, // <4,0,1,3>: Cost 3 vext1 <3,4,0,1>, <3,4,0,1>
+ 2570718518U, // <4,0,1,4>: Cost 3 vext1 <3,4,0,1>, RHS
+ 2594607206U, // <4,0,1,5>: Cost 3 vext1 <7,4,0,1>, <5,6,7,4>
+ 3662377563U, // <4,0,1,6>: Cost 4 vext1 <6,4,0,1>, <6,4,0,1>
+ 2594608436U, // <4,0,1,7>: Cost 3 vext1 <7,4,0,1>, <7,4,0,1>
+ 1618165916U, // <4,0,1,u>: Cost 2 vext3 <1,2,3,4>, LHS
+ 2685714598U, // <4,0,2,0>: Cost 3 vext3 <0,2,0,4>, <0,2,0,4>
+ 3759530159U, // <4,0,2,1>: Cost 4 vext3 <0,2,1,4>, <0,2,1,4>
+ 2685862072U, // <4,0,2,2>: Cost 3 vext3 <0,2,2,4>, <0,2,2,4>
+ 2631476937U, // <4,0,2,3>: Cost 3 vext2 <2,3,4,0>, <2,3,4,0>
+ 2685714636U, // <4,0,2,4>: Cost 3 vext3 <0,2,0,4>, <0,2,4,6>
+ 3765649622U, // <4,0,2,5>: Cost 4 vext3 <1,2,3,4>, <0,2,5,7>
+ 2686157020U, // <4,0,2,6>: Cost 3 vext3 <0,2,6,4>, <0,2,6,4>
+ 3668358453U, // <4,0,2,7>: Cost 4 vext1 <7,4,0,2>, <7,4,0,2>
+ 2686304494U, // <4,0,2,u>: Cost 3 vext3 <0,2,u,4>, <0,2,u,4>
+ 3632529510U, // <4,0,3,0>: Cost 4 vext1 <1,4,0,3>, LHS
+ 2686451968U, // <4,0,3,1>: Cost 3 vext3 <0,3,1,4>, <0,3,1,4>
+ 2686525705U, // <4,0,3,2>: Cost 3 vext3 <0,3,2,4>, <0,3,2,4>
+ 3760341266U, // <4,0,3,3>: Cost 4 vext3 <0,3,3,4>, <0,3,3,4>
+ 3632532790U, // <4,0,3,4>: Cost 4 vext1 <1,4,0,3>, RHS
+ 3913254606U, // <4,0,3,5>: Cost 4 vuzpr <3,4,5,0>, <2,3,4,5>
+ 3705219740U, // <4,0,3,6>: Cost 4 vext2 <2,3,4,0>, <3,6,4,7>
+ 3713845990U, // <4,0,3,7>: Cost 4 vext2 <3,7,4,0>, <3,7,4,0>
+ 2686451968U, // <4,0,3,u>: Cost 3 vext3 <0,3,1,4>, <0,3,1,4>
+ 2552823910U, // <4,0,4,0>: Cost 3 vext1 <0,4,0,4>, LHS
+ 2691907922U, // <4,0,4,1>: Cost 3 vext3 <1,2,3,4>, <0,4,1,5>
+ 2691907932U, // <4,0,4,2>: Cost 3 vext3 <1,2,3,4>, <0,4,2,6>
+ 3626567830U, // <4,0,4,3>: Cost 4 vext1 <0,4,0,4>, <3,0,1,2>
+ 2552827190U, // <4,0,4,4>: Cost 3 vext1 <0,4,0,4>, RHS
+ 2631478582U, // <4,0,4,5>: Cost 3 vext2 <2,3,4,0>, RHS
+ 3626570017U, // <4,0,4,6>: Cost 4 vext1 <0,4,0,4>, <6,0,1,2>
+ 3668374839U, // <4,0,4,7>: Cost 4 vext1 <7,4,0,4>, <7,4,0,4>
+ 2552829742U, // <4,0,4,u>: Cost 3 vext1 <0,4,0,4>, LHS
+ 2558804070U, // <4,0,5,0>: Cost 3 vext1 <1,4,0,5>, LHS
+ 1839644774U, // <4,0,5,1>: Cost 2 vzipl RHS, LHS
+ 2913386660U, // <4,0,5,2>: Cost 3 vzipl RHS, <0,2,0,2>
+ 2570750420U, // <4,0,5,3>: Cost 3 vext1 <3,4,0,5>, <3,4,0,5>
+ 2558807350U, // <4,0,5,4>: Cost 3 vext1 <1,4,0,5>, RHS
+ 3987128750U, // <4,0,5,5>: Cost 4 vzipl RHS, <0,5,2,7>
+ 3987128822U, // <4,0,5,6>: Cost 4 vzipl RHS, <0,6,1,7>
+ 2594641208U, // <4,0,5,7>: Cost 3 vext1 <7,4,0,5>, <7,4,0,5>
+ 1839645341U, // <4,0,5,u>: Cost 2 vzipl RHS, LHS
+ 2552840294U, // <4,0,6,0>: Cost 3 vext1 <0,4,0,6>, LHS
+ 3047604234U, // <4,0,6,1>: Cost 3 vtrnl RHS, <0,0,1,1>
+ 1973862502U, // <4,0,6,2>: Cost 2 vtrnl RHS, LHS
+ 2570758613U, // <4,0,6,3>: Cost 3 vext1 <3,4,0,6>, <3,4,0,6>
+ 2552843574U, // <4,0,6,4>: Cost 3 vext1 <0,4,0,6>, RHS
+ 2217664887U, // <4,0,6,5>: Cost 3 vrev <0,4,5,6>
+ 3662418528U, // <4,0,6,6>: Cost 4 vext1 <6,4,0,6>, <6,4,0,6>
+ 2658022257U, // <4,0,6,7>: Cost 3 vext2 <6,7,4,0>, <6,7,4,0>
+ 1973862556U, // <4,0,6,u>: Cost 2 vtrnl RHS, LHS
+ 3731764218U, // <4,0,7,0>: Cost 4 vext2 <6,7,4,0>, <7,0,1,2>
+ 3988324454U, // <4,0,7,1>: Cost 4 vzipl <4,7,5,0>, LHS
+ 4122034278U, // <4,0,7,2>: Cost 4 vtrnl <4,6,7,1>, LHS
+ 3735082246U, // <4,0,7,3>: Cost 4 vext2 <7,3,4,0>, <7,3,4,0>
+ 3731764536U, // <4,0,7,4>: Cost 4 vext2 <6,7,4,0>, <7,4,0,5>
+ 3937145718U, // <4,0,7,5>: Cost 4 vuzpr <7,4,5,0>, <6,7,4,5>
+ 3737073145U, // <4,0,7,6>: Cost 4 vext2 <7,6,4,0>, <7,6,4,0>
+ 3731764844U, // <4,0,7,7>: Cost 4 vext2 <6,7,4,0>, <7,7,7,7>
+ 4122034332U, // <4,0,7,u>: Cost 4 vtrnl <4,6,7,1>, LHS
+ 2552856678U, // <4,0,u,0>: Cost 3 vext1 <0,4,0,u>, LHS
+ 1841635430U, // <4,0,u,1>: Cost 2 vzipl RHS, LHS
+ 1618166429U, // <4,0,u,2>: Cost 2 vext3 <1,2,3,4>, LHS
+ 2570774999U, // <4,0,u,3>: Cost 3 vext1 <3,4,0,u>, <3,4,0,u>
+ 2552859958U, // <4,0,u,4>: Cost 3 vext1 <0,4,0,u>, RHS
+ 2631481498U, // <4,0,u,5>: Cost 3 vext2 <2,3,4,0>, RHS
+ 2686157020U, // <4,0,u,6>: Cost 3 vext3 <0,2,6,4>, <0,2,6,4>
+ 2594665787U, // <4,0,u,7>: Cost 3 vext1 <7,4,0,u>, <7,4,0,u>
+ 1618166483U, // <4,0,u,u>: Cost 2 vext3 <1,2,3,4>, LHS
+ 2617548837U, // <4,1,0,0>: Cost 3 vext2 <0,0,4,1>, <0,0,4,1>
+ 2622857318U, // <4,1,0,1>: Cost 3 vext2 <0,u,4,1>, LHS
+ 3693281484U, // <4,1,0,2>: Cost 4 vext2 <0,3,4,1>, <0,2,4,6>
+ 2691908342U, // <4,1,0,3>: Cost 3 vext3 <1,2,3,4>, <1,0,3,2>
+ 2622857554U, // <4,1,0,4>: Cost 3 vext2 <0,u,4,1>, <0,4,1,5>
+ 3764470538U, // <4,1,0,5>: Cost 4 vext3 <1,0,5,4>, <1,0,5,4>
+ 3695272459U, // <4,1,0,6>: Cost 4 vext2 <0,6,4,1>, <0,6,4,1>
+ 3733094980U, // <4,1,0,7>: Cost 4 vext2 <7,0,4,1>, <0,7,1,4>
+ 2622857885U, // <4,1,0,u>: Cost 3 vext2 <0,u,4,1>, LHS
+ 3696599798U, // <4,1,1,0>: Cost 4 vext2 <0,u,4,1>, <1,0,3,2>
+ 2691097399U, // <4,1,1,1>: Cost 3 vext3 <1,1,1,4>, <1,1,1,4>
+ 2631484314U, // <4,1,1,2>: Cost 3 vext2 <2,3,4,1>, <1,2,3,4>
+ 2691908424U, // <4,1,1,3>: Cost 3 vext3 <1,2,3,4>, <1,1,3,3>
+ 3696600125U, // <4,1,1,4>: Cost 4 vext2 <0,u,4,1>, <1,4,3,5>
+ 3696600175U, // <4,1,1,5>: Cost 4 vext2 <0,u,4,1>, <1,5,0,1>
+ 3696600307U, // <4,1,1,6>: Cost 4 vext2 <0,u,4,1>, <1,6,5,7>
+ 3668423997U, // <4,1,1,7>: Cost 4 vext1 <7,4,1,1>, <7,4,1,1>
+ 2691908469U, // <4,1,1,u>: Cost 3 vext3 <1,2,3,4>, <1,1,u,3>
+ 2570797158U, // <4,1,2,0>: Cost 3 vext1 <3,4,1,2>, LHS
+ 2570797978U, // <4,1,2,1>: Cost 3 vext1 <3,4,1,2>, <1,2,3,4>
+ 3696600680U, // <4,1,2,2>: Cost 4 vext2 <0,u,4,1>, <2,2,2,2>
+ 1618166682U, // <4,1,2,3>: Cost 2 vext3 <1,2,3,4>, <1,2,3,4>
+ 2570800438U, // <4,1,2,4>: Cost 3 vext1 <3,4,1,2>, RHS
+ 3765650347U, // <4,1,2,5>: Cost 4 vext3 <1,2,3,4>, <1,2,5,3>
+ 3696601018U, // <4,1,2,6>: Cost 4 vext2 <0,u,4,1>, <2,6,3,7>
+ 3668432190U, // <4,1,2,7>: Cost 4 vext1 <7,4,1,2>, <7,4,1,2>
+ 1618535367U, // <4,1,2,u>: Cost 2 vext3 <1,2,u,4>, <1,2,u,4>
+ 2564833382U, // <4,1,3,0>: Cost 3 vext1 <2,4,1,3>, LHS
+ 2691908568U, // <4,1,3,1>: Cost 3 vext3 <1,2,3,4>, <1,3,1,3>
+ 2691908578U, // <4,1,3,2>: Cost 3 vext3 <1,2,3,4>, <1,3,2,4>
+ 2692572139U, // <4,1,3,3>: Cost 3 vext3 <1,3,3,4>, <1,3,3,4>
+ 2564836662U, // <4,1,3,4>: Cost 3 vext1 <2,4,1,3>, RHS
+ 2691908608U, // <4,1,3,5>: Cost 3 vext3 <1,2,3,4>, <1,3,5,7>
+ 2588725862U, // <4,1,3,6>: Cost 3 vext1 <6,4,1,3>, <6,4,1,3>
+ 3662468090U, // <4,1,3,7>: Cost 4 vext1 <6,4,1,3>, <7,0,1,2>
+ 2691908631U, // <4,1,3,u>: Cost 3 vext3 <1,2,3,4>, <1,3,u,3>
+ 3760194590U, // <4,1,4,0>: Cost 4 vext3 <0,3,1,4>, <1,4,0,1>
+ 3693947874U, // <4,1,4,1>: Cost 4 vext2 <0,4,4,1>, <4,1,5,0>
+ 3765650484U, // <4,1,4,2>: Cost 4 vext3 <1,2,3,4>, <1,4,2,5>
+ 3113877606U, // <4,1,4,3>: Cost 3 vtrnr <4,4,4,4>, LHS
+ 3760194630U, // <4,1,4,4>: Cost 4 vext3 <0,3,1,4>, <1,4,4,5>
+ 2622860598U, // <4,1,4,5>: Cost 3 vext2 <0,u,4,1>, RHS
+ 3297436759U, // <4,1,4,6>: Cost 4 vrev <1,4,6,4>
+ 3800007772U, // <4,1,4,7>: Cost 4 vext3 <7,0,1,4>, <1,4,7,0>
+ 2622860841U, // <4,1,4,u>: Cost 3 vext2 <0,u,4,1>, RHS
+ 1479164006U, // <4,1,5,0>: Cost 2 vext1 <0,4,1,5>, LHS
+ 2552906486U, // <4,1,5,1>: Cost 3 vext1 <0,4,1,5>, <1,0,3,2>
+ 2552907299U, // <4,1,5,2>: Cost 3 vext1 <0,4,1,5>, <2,1,3,5>
+ 2552907926U, // <4,1,5,3>: Cost 3 vext1 <0,4,1,5>, <3,0,1,2>
+ 1479167286U, // <4,1,5,4>: Cost 2 vext1 <0,4,1,5>, RHS
+ 2913387664U, // <4,1,5,5>: Cost 3 vzipl RHS, <1,5,3,7>
+ 2600686074U, // <4,1,5,6>: Cost 3 vext1 <u,4,1,5>, <6,2,7,3>
+ 2600686586U, // <4,1,5,7>: Cost 3 vext1 <u,4,1,5>, <7,0,1,2>
+ 1479169838U, // <4,1,5,u>: Cost 2 vext1 <0,4,1,5>, LHS
+ 2552914022U, // <4,1,6,0>: Cost 3 vext1 <0,4,1,6>, LHS
+ 2558886708U, // <4,1,6,1>: Cost 3 vext1 <1,4,1,6>, <1,1,1,1>
+ 4028205206U, // <4,1,6,2>: Cost 4 vzipr <0,2,4,6>, <3,0,1,2>
+ 3089858662U, // <4,1,6,3>: Cost 3 vtrnr <0,4,2,6>, LHS
+ 2552917302U, // <4,1,6,4>: Cost 3 vext1 <0,4,1,6>, RHS
+ 2223637584U, // <4,1,6,5>: Cost 3 vrev <1,4,5,6>
+ 4121347081U, // <4,1,6,6>: Cost 4 vtrnl RHS, <1,3,6,7>
+ 3721155406U, // <4,1,6,7>: Cost 4 vext2 <5,0,4,1>, <6,7,0,1>
+ 2552919854U, // <4,1,6,u>: Cost 3 vext1 <0,4,1,6>, LHS
+ 2659357716U, // <4,1,7,0>: Cost 3 vext2 <7,0,4,1>, <7,0,4,1>
+ 3733763173U, // <4,1,7,1>: Cost 4 vext2 <7,1,4,1>, <7,1,4,1>
+ 3734426806U, // <4,1,7,2>: Cost 4 vext2 <7,2,4,1>, <7,2,4,1>
+ 2695226671U, // <4,1,7,3>: Cost 3 vext3 <1,7,3,4>, <1,7,3,4>
+ 3721155942U, // <4,1,7,4>: Cost 4 vext2 <5,0,4,1>, <7,4,5,6>
+ 3721155976U, // <4,1,7,5>: Cost 4 vext2 <5,0,4,1>, <7,5,0,4>
+ 3662500458U, // <4,1,7,6>: Cost 4 vext1 <6,4,1,7>, <6,4,1,7>
+ 3721156204U, // <4,1,7,7>: Cost 4 vext2 <5,0,4,1>, <7,7,7,7>
+ 2659357716U, // <4,1,7,u>: Cost 3 vext2 <7,0,4,1>, <7,0,4,1>
+ 1479188582U, // <4,1,u,0>: Cost 2 vext1 <0,4,1,u>, LHS
+ 2552931062U, // <4,1,u,1>: Cost 3 vext1 <0,4,1,u>, <1,0,3,2>
+ 2552931944U, // <4,1,u,2>: Cost 3 vext1 <0,4,1,u>, <2,2,2,2>
+ 1622148480U, // <4,1,u,3>: Cost 2 vext3 <1,u,3,4>, <1,u,3,4>
+ 1479191862U, // <4,1,u,4>: Cost 2 vext1 <0,4,1,u>, RHS
+ 2622863514U, // <4,1,u,5>: Cost 3 vext2 <0,u,4,1>, RHS
+ 2588725862U, // <4,1,u,6>: Cost 3 vext1 <6,4,1,3>, <6,4,1,3>
+ 2600686586U, // <4,1,u,7>: Cost 3 vext1 <u,4,1,5>, <7,0,1,2>
+ 1479194414U, // <4,1,u,u>: Cost 2 vext1 <0,4,1,u>, LHS
+ 2617557030U, // <4,2,0,0>: Cost 3 vext2 <0,0,4,2>, <0,0,4,2>
+ 2622865510U, // <4,2,0,1>: Cost 3 vext2 <0,u,4,2>, LHS
+ 2622865612U, // <4,2,0,2>: Cost 3 vext2 <0,u,4,2>, <0,2,4,6>
+ 3693289753U, // <4,2,0,3>: Cost 4 vext2 <0,3,4,2>, <0,3,4,2>
+ 2635473244U, // <4,2,0,4>: Cost 3 vext2 <3,0,4,2>, <0,4,2,6>
+ 3765650918U, // <4,2,0,5>: Cost 4 vext3 <1,2,3,4>, <2,0,5,7>
+ 2696775148U, // <4,2,0,6>: Cost 3 vext3 <2,0,6,4>, <2,0,6,4>
+ 3695944285U, // <4,2,0,7>: Cost 4 vext2 <0,7,4,2>, <0,7,4,2>
+ 2622866077U, // <4,2,0,u>: Cost 3 vext2 <0,u,4,2>, LHS
+ 3696607990U, // <4,2,1,0>: Cost 4 vext2 <0,u,4,2>, <1,0,3,2>
+ 3696608052U, // <4,2,1,1>: Cost 4 vext2 <0,u,4,2>, <1,1,1,1>
+ 3696608150U, // <4,2,1,2>: Cost 4 vext2 <0,u,4,2>, <1,2,3,0>
+ 3895574630U, // <4,2,1,3>: Cost 4 vuzpr <0,4,u,2>, LHS
+ 2691909162U, // <4,2,1,4>: Cost 3 vext3 <1,2,3,4>, <2,1,4,3>
+ 3696608400U, // <4,2,1,5>: Cost 4 vext2 <0,u,4,2>, <1,5,3,7>
+ 3760784956U, // <4,2,1,6>: Cost 4 vext3 <0,4,0,4>, <2,1,6,3>
+ 3773908549U, // <4,2,1,7>: Cost 5 vext3 <2,5,7,4>, <2,1,7,3>
+ 2691909162U, // <4,2,1,u>: Cost 3 vext3 <1,2,3,4>, <2,1,4,3>
+ 3696608748U, // <4,2,2,0>: Cost 4 vext2 <0,u,4,2>, <2,0,6,4>
+ 3696608828U, // <4,2,2,1>: Cost 4 vext2 <0,u,4,2>, <2,1,6,3>
+ 2691909224U, // <4,2,2,2>: Cost 3 vext3 <1,2,3,4>, <2,2,2,2>
+ 2691909234U, // <4,2,2,3>: Cost 3 vext3 <1,2,3,4>, <2,2,3,3>
+ 3759605368U, // <4,2,2,4>: Cost 4 vext3 <0,2,2,4>, <2,2,4,0>
+ 3696609156U, // <4,2,2,5>: Cost 4 vext2 <0,u,4,2>, <2,5,6,7>
+ 3760785040U, // <4,2,2,6>: Cost 4 vext3 <0,4,0,4>, <2,2,6,6>
+ 3668505927U, // <4,2,2,7>: Cost 4 vext1 <7,4,2,2>, <7,4,2,2>
+ 2691909279U, // <4,2,2,u>: Cost 3 vext3 <1,2,3,4>, <2,2,u,3>
+ 2691909286U, // <4,2,3,0>: Cost 3 vext3 <1,2,3,4>, <2,3,0,1>
+ 3764840111U, // <4,2,3,1>: Cost 4 vext3 <1,1,1,4>, <2,3,1,1>
+ 3765651129U, // <4,2,3,2>: Cost 4 vext3 <1,2,3,4>, <2,3,2,2>
+ 2698544836U, // <4,2,3,3>: Cost 3 vext3 <2,3,3,4>, <2,3,3,4>
+ 2685863630U, // <4,2,3,4>: Cost 3 vext3 <0,2,2,4>, <2,3,4,5>
+ 2698692310U, // <4,2,3,5>: Cost 3 vext3 <2,3,5,4>, <2,3,5,4>
+ 3772507871U, // <4,2,3,6>: Cost 4 vext3 <2,3,6,4>, <2,3,6,4>
+ 2698839784U, // <4,2,3,7>: Cost 3 vext3 <2,3,7,4>, <2,3,7,4>
+ 2691909358U, // <4,2,3,u>: Cost 3 vext3 <1,2,3,4>, <2,3,u,1>
+ 2564915302U, // <4,2,4,0>: Cost 3 vext1 <2,4,2,4>, LHS
+ 2564916122U, // <4,2,4,1>: Cost 3 vext1 <2,4,2,4>, <1,2,3,4>
+ 2564917004U, // <4,2,4,2>: Cost 3 vext1 <2,4,2,4>, <2,4,2,4>
+ 2699208469U, // <4,2,4,3>: Cost 3 vext3 <2,4,3,4>, <2,4,3,4>
+ 2564918582U, // <4,2,4,4>: Cost 3 vext1 <2,4,2,4>, RHS
+ 2622868790U, // <4,2,4,5>: Cost 3 vext2 <0,u,4,2>, RHS
+ 2229667632U, // <4,2,4,6>: Cost 3 vrev <2,4,6,4>
+ 3800082229U, // <4,2,4,7>: Cost 4 vext3 <7,0,2,4>, <2,4,7,0>
+ 2622869033U, // <4,2,4,u>: Cost 3 vext2 <0,u,4,2>, RHS
+ 2552979558U, // <4,2,5,0>: Cost 3 vext1 <0,4,2,5>, LHS
+ 2558952342U, // <4,2,5,1>: Cost 3 vext1 <1,4,2,5>, <1,2,3,0>
+ 2564925032U, // <4,2,5,2>: Cost 3 vext1 <2,4,2,5>, <2,2,2,2>
+ 2967060582U, // <4,2,5,3>: Cost 3 vzipr <2,3,4,5>, LHS
+ 2552982838U, // <4,2,5,4>: Cost 3 vext1 <0,4,2,5>, RHS
+ 3987130190U, // <4,2,5,5>: Cost 4 vzipl RHS, <2,5,0,7>
+ 2913388474U, // <4,2,5,6>: Cost 3 vzipl RHS, <2,6,3,7>
+ 3895577910U, // <4,2,5,7>: Cost 4 vuzpr <0,4,u,2>, RHS
+ 2552985390U, // <4,2,5,u>: Cost 3 vext1 <0,4,2,5>, LHS
+ 1479245926U, // <4,2,6,0>: Cost 2 vext1 <0,4,2,6>, LHS
+ 2552988406U, // <4,2,6,1>: Cost 3 vext1 <0,4,2,6>, <1,0,3,2>
+ 2552989288U, // <4,2,6,2>: Cost 3 vext1 <0,4,2,6>, <2,2,2,2>
+ 2954461286U, // <4,2,6,3>: Cost 3 vzipr <0,2,4,6>, LHS
+ 1479249206U, // <4,2,6,4>: Cost 2 vext1 <0,4,2,6>, RHS
+ 2229610281U, // <4,2,6,5>: Cost 3 vrev <2,4,5,6>
+ 2600767994U, // <4,2,6,6>: Cost 3 vext1 <u,4,2,6>, <6,2,7,3>
+ 2600768506U, // <4,2,6,7>: Cost 3 vext1 <u,4,2,6>, <7,0,1,2>
+ 1479251758U, // <4,2,6,u>: Cost 2 vext1 <0,4,2,6>, LHS
+ 2659365909U, // <4,2,7,0>: Cost 3 vext2 <7,0,4,2>, <7,0,4,2>
+ 3733771366U, // <4,2,7,1>: Cost 4 vext2 <7,1,4,2>, <7,1,4,2>
+ 3734434999U, // <4,2,7,2>: Cost 4 vext2 <7,2,4,2>, <7,2,4,2>
+ 2701199368U, // <4,2,7,3>: Cost 3 vext3 <2,7,3,4>, <2,7,3,4>
+ 4175774618U, // <4,2,7,4>: Cost 4 vtrnr <2,4,5,7>, <1,2,3,4>
+ 3303360298U, // <4,2,7,5>: Cost 4 vrev <2,4,5,7>
+ 3727136217U, // <4,2,7,6>: Cost 4 vext2 <6,0,4,2>, <7,6,0,4>
+ 3727136364U, // <4,2,7,7>: Cost 4 vext2 <6,0,4,2>, <7,7,7,7>
+ 2659365909U, // <4,2,7,u>: Cost 3 vext2 <7,0,4,2>, <7,0,4,2>
+ 1479262310U, // <4,2,u,0>: Cost 2 vext1 <0,4,2,u>, LHS
+ 2553004790U, // <4,2,u,1>: Cost 3 vext1 <0,4,2,u>, <1,0,3,2>
+ 2553005672U, // <4,2,u,2>: Cost 3 vext1 <0,4,2,u>, <2,2,2,2>
+ 2954477670U, // <4,2,u,3>: Cost 3 vzipr <0,2,4,u>, LHS
+ 1479265590U, // <4,2,u,4>: Cost 2 vext1 <0,4,2,u>, RHS
+ 2622871706U, // <4,2,u,5>: Cost 3 vext2 <0,u,4,2>, RHS
+ 2229700404U, // <4,2,u,6>: Cost 3 vrev <2,4,6,u>
+ 2600784890U, // <4,2,u,7>: Cost 3 vext1 <u,4,2,u>, <7,0,1,2>
+ 1479268142U, // <4,2,u,u>: Cost 2 vext1 <0,4,2,u>, LHS
+ 3765651595U, // <4,3,0,0>: Cost 4 vext3 <1,2,3,4>, <3,0,0,0>
+ 2691909782U, // <4,3,0,1>: Cost 3 vext3 <1,2,3,4>, <3,0,1,2>
+ 2702452897U, // <4,3,0,2>: Cost 3 vext3 <3,0,2,4>, <3,0,2,4>
+ 3693297946U, // <4,3,0,3>: Cost 4 vext2 <0,3,4,3>, <0,3,4,3>
+ 3760711856U, // <4,3,0,4>: Cost 4 vext3 <0,3,u,4>, <3,0,4,1>
+ 2235533820U, // <4,3,0,5>: Cost 3 vrev <3,4,5,0>
+ 3309349381U, // <4,3,0,6>: Cost 4 vrev <3,4,6,0>
+ 3668563278U, // <4,3,0,7>: Cost 4 vext1 <7,4,3,0>, <7,4,3,0>
+ 2691909845U, // <4,3,0,u>: Cost 3 vext3 <1,2,3,4>, <3,0,u,2>
+ 2235173328U, // <4,3,1,0>: Cost 3 vrev <3,4,0,1>
+ 3764840678U, // <4,3,1,1>: Cost 4 vext3 <1,1,1,4>, <3,1,1,1>
+ 2630173594U, // <4,3,1,2>: Cost 3 vext2 <2,1,4,3>, <1,2,3,4>
+ 2703190267U, // <4,3,1,3>: Cost 3 vext3 <3,1,3,4>, <3,1,3,4>
+ 3760195840U, // <4,3,1,4>: Cost 4 vext3 <0,3,1,4>, <3,1,4,0>
+ 3765651724U, // <4,3,1,5>: Cost 4 vext3 <1,2,3,4>, <3,1,5,3>
+ 3309357574U, // <4,3,1,6>: Cost 4 vrev <3,4,6,1>
+ 3769633054U, // <4,3,1,7>: Cost 4 vext3 <1,u,3,4>, <3,1,7,3>
+ 2703558952U, // <4,3,1,u>: Cost 3 vext3 <3,1,u,4>, <3,1,u,4>
+ 3626770534U, // <4,3,2,0>: Cost 4 vext1 <0,4,3,2>, LHS
+ 2630174250U, // <4,3,2,1>: Cost 3 vext2 <2,1,4,3>, <2,1,4,3>
+ 3765651777U, // <4,3,2,2>: Cost 4 vext3 <1,2,3,4>, <3,2,2,2>
+ 2703853900U, // <4,3,2,3>: Cost 3 vext3 <3,2,3,4>, <3,2,3,4>
+ 3626773814U, // <4,3,2,4>: Cost 4 vext1 <0,4,3,2>, RHS
+ 2704001374U, // <4,3,2,5>: Cost 3 vext3 <3,2,5,4>, <3,2,5,4>
+ 3765651814U, // <4,3,2,6>: Cost 4 vext3 <1,2,3,4>, <3,2,6,3>
+ 3769633135U, // <4,3,2,7>: Cost 4 vext3 <1,u,3,4>, <3,2,7,3>
+ 2634819681U, // <4,3,2,u>: Cost 3 vext2 <2,u,4,3>, <2,u,4,3>
+ 3765651839U, // <4,3,3,0>: Cost 4 vext3 <1,2,3,4>, <3,3,0,1>
+ 3765651848U, // <4,3,3,1>: Cost 4 vext3 <1,2,3,4>, <3,3,1,1>
+ 3710552404U, // <4,3,3,2>: Cost 4 vext2 <3,2,4,3>, <3,2,4,3>
+ 2691910044U, // <4,3,3,3>: Cost 3 vext3 <1,2,3,4>, <3,3,3,3>
+ 2704591270U, // <4,3,3,4>: Cost 3 vext3 <3,3,4,4>, <3,3,4,4>
+ 3769633202U, // <4,3,3,5>: Cost 4 vext3 <1,u,3,4>, <3,3,5,7>
+ 3703917212U, // <4,3,3,6>: Cost 4 vext2 <2,1,4,3>, <3,6,4,7>
+ 3769633220U, // <4,3,3,7>: Cost 4 vext3 <1,u,3,4>, <3,3,7,7>
+ 2691910044U, // <4,3,3,u>: Cost 3 vext3 <1,2,3,4>, <3,3,3,3>
+ 2691910096U, // <4,3,4,0>: Cost 3 vext3 <1,2,3,4>, <3,4,0,1>
+ 2691910106U, // <4,3,4,1>: Cost 3 vext3 <1,2,3,4>, <3,4,1,2>
+ 2564990741U, // <4,3,4,2>: Cost 3 vext1 <2,4,3,4>, <2,4,3,4>
+ 3765651946U, // <4,3,4,3>: Cost 4 vext3 <1,2,3,4>, <3,4,3,0>
+ 2691910136U, // <4,3,4,4>: Cost 3 vext3 <1,2,3,4>, <3,4,4,5>
+ 2686454274U, // <4,3,4,5>: Cost 3 vext3 <0,3,1,4>, <3,4,5,6>
+ 2235640329U, // <4,3,4,6>: Cost 3 vrev <3,4,6,4>
+ 3801483792U, // <4,3,4,7>: Cost 4 vext3 <7,2,3,4>, <3,4,7,2>
+ 2691910168U, // <4,3,4,u>: Cost 3 vext3 <1,2,3,4>, <3,4,u,1>
+ 2559025254U, // <4,3,5,0>: Cost 3 vext1 <1,4,3,5>, LHS
+ 2559026237U, // <4,3,5,1>: Cost 3 vext1 <1,4,3,5>, <1,4,3,5>
+ 2564998862U, // <4,3,5,2>: Cost 3 vext1 <2,4,3,5>, <2,3,4,5>
+ 2570971548U, // <4,3,5,3>: Cost 3 vext1 <3,4,3,5>, <3,3,3,3>
+ 2559028534U, // <4,3,5,4>: Cost 3 vext1 <1,4,3,5>, RHS
+ 4163519477U, // <4,3,5,5>: Cost 4 vtrnr <0,4,1,5>, <1,3,4,5>
+ 3309390346U, // <4,3,5,6>: Cost 4 vrev <3,4,6,5>
+ 2706139747U, // <4,3,5,7>: Cost 3 vext3 <3,5,7,4>, <3,5,7,4>
+ 2559031086U, // <4,3,5,u>: Cost 3 vext1 <1,4,3,5>, LHS
+ 2559033446U, // <4,3,6,0>: Cost 3 vext1 <1,4,3,6>, LHS
+ 2559034430U, // <4,3,6,1>: Cost 3 vext1 <1,4,3,6>, <1,4,3,6>
+ 2565007127U, // <4,3,6,2>: Cost 3 vext1 <2,4,3,6>, <2,4,3,6>
+ 2570979740U, // <4,3,6,3>: Cost 3 vext1 <3,4,3,6>, <3,3,3,3>
+ 2559036726U, // <4,3,6,4>: Cost 3 vext1 <1,4,3,6>, RHS
+ 1161841154U, // <4,3,6,5>: Cost 2 vrev <3,4,5,6>
+ 4028203932U, // <4,3,6,6>: Cost 4 vzipr <0,2,4,6>, <1,2,3,6>
+ 2706803380U, // <4,3,6,7>: Cost 3 vext3 <3,6,7,4>, <3,6,7,4>
+ 1162062365U, // <4,3,6,u>: Cost 2 vrev <3,4,u,6>
+ 3769633475U, // <4,3,7,0>: Cost 4 vext3 <1,u,3,4>, <3,7,0,1>
+ 3769633488U, // <4,3,7,1>: Cost 4 vext3 <1,u,3,4>, <3,7,1,5>
+ 3638757144U, // <4,3,7,2>: Cost 4 vext1 <2,4,3,7>, <2,4,3,7>
+ 3769633508U, // <4,3,7,3>: Cost 4 vext3 <1,u,3,4>, <3,7,3,7>
+ 3769633515U, // <4,3,7,4>: Cost 4 vext3 <1,u,3,4>, <3,7,4,5>
+ 3769633526U, // <4,3,7,5>: Cost 4 vext3 <1,u,3,4>, <3,7,5,7>
+ 3662647932U, // <4,3,7,6>: Cost 4 vext1 <6,4,3,7>, <6,4,3,7>
+ 3781208837U, // <4,3,7,7>: Cost 4 vext3 <3,7,7,4>, <3,7,7,4>
+ 3769633547U, // <4,3,7,u>: Cost 4 vext3 <1,u,3,4>, <3,7,u,1>
+ 2559049830U, // <4,3,u,0>: Cost 3 vext1 <1,4,3,u>, LHS
+ 2691910430U, // <4,3,u,1>: Cost 3 vext3 <1,2,3,4>, <3,u,1,2>
+ 2565023513U, // <4,3,u,2>: Cost 3 vext1 <2,4,3,u>, <2,4,3,u>
+ 2707835698U, // <4,3,u,3>: Cost 3 vext3 <3,u,3,4>, <3,u,3,4>
+ 2559053110U, // <4,3,u,4>: Cost 3 vext1 <1,4,3,u>, RHS
+ 1161857540U, // <4,3,u,5>: Cost 2 vrev <3,4,5,u>
+ 2235673101U, // <4,3,u,6>: Cost 3 vrev <3,4,6,u>
+ 2708130646U, // <4,3,u,7>: Cost 3 vext3 <3,u,7,4>, <3,u,7,4>
+ 1162078751U, // <4,3,u,u>: Cost 2 vrev <3,4,u,u>
+ 2617573416U, // <4,4,0,0>: Cost 3 vext2 <0,0,4,4>, <0,0,4,4>
+ 1570373734U, // <4,4,0,1>: Cost 2 vext2 <4,4,4,4>, LHS
+ 2779676774U, // <4,4,0,2>: Cost 3 vuzpl <4,6,4,6>, LHS
+ 3760196480U, // <4,4,0,3>: Cost 4 vext3 <0,3,1,4>, <4,0,3,1>
+ 2576977100U, // <4,4,0,4>: Cost 3 vext1 <4,4,4,0>, <4,4,4,0>
+ 2718747538U, // <4,4,0,5>: Cost 3 vext3 <5,6,7,4>, <4,0,5,1>
+ 2718747548U, // <4,4,0,6>: Cost 3 vext3 <5,6,7,4>, <4,0,6,2>
+ 3668637015U, // <4,4,0,7>: Cost 4 vext1 <7,4,4,0>, <7,4,4,0>
+ 1570374301U, // <4,4,0,u>: Cost 2 vext2 <4,4,4,4>, LHS
+ 2644116214U, // <4,4,1,0>: Cost 3 vext2 <4,4,4,4>, <1,0,3,2>
+ 2644116276U, // <4,4,1,1>: Cost 3 vext2 <4,4,4,4>, <1,1,1,1>
+ 2691910602U, // <4,4,1,2>: Cost 3 vext3 <1,2,3,4>, <4,1,2,3>
+ 2644116440U, // <4,4,1,3>: Cost 3 vext2 <4,4,4,4>, <1,3,1,3>
+ 2711227356U, // <4,4,1,4>: Cost 3 vext3 <4,4,4,4>, <4,1,4,3>
+ 2709310438U, // <4,4,1,5>: Cost 3 vext3 <4,1,5,4>, <4,1,5,4>
+ 3765652462U, // <4,4,1,6>: Cost 4 vext3 <1,2,3,4>, <4,1,6,3>
+ 3768970231U, // <4,4,1,7>: Cost 4 vext3 <1,7,3,4>, <4,1,7,3>
+ 2695891968U, // <4,4,1,u>: Cost 3 vext3 <1,u,3,4>, <4,1,u,3>
+ 3703260634U, // <4,4,2,0>: Cost 4 vext2 <2,0,4,4>, <2,0,4,4>
+ 3765652499U, // <4,4,2,1>: Cost 4 vext3 <1,2,3,4>, <4,2,1,4>
+ 2644117096U, // <4,4,2,2>: Cost 3 vext2 <4,4,4,4>, <2,2,2,2>
+ 2631509709U, // <4,4,2,3>: Cost 3 vext2 <2,3,4,4>, <2,3,4,4>
+ 2644117269U, // <4,4,2,4>: Cost 3 vext2 <4,4,4,4>, <2,4,3,4>
+ 3705251698U, // <4,4,2,5>: Cost 4 vext2 <2,3,4,4>, <2,5,4,7>
+ 2710047808U, // <4,4,2,6>: Cost 3 vext3 <4,2,6,4>, <4,2,6,4>
+ 3783863369U, // <4,4,2,7>: Cost 4 vext3 <4,2,7,4>, <4,2,7,4>
+ 2634827874U, // <4,4,2,u>: Cost 3 vext2 <2,u,4,4>, <2,u,4,4>
+ 2644117654U, // <4,4,3,0>: Cost 3 vext2 <4,4,4,4>, <3,0,1,2>
+ 3638797210U, // <4,4,3,1>: Cost 4 vext1 <2,4,4,3>, <1,2,3,4>
+ 3638798082U, // <4,4,3,2>: Cost 4 vext1 <2,4,4,3>, <2,4,1,3>
+ 2637482406U, // <4,4,3,3>: Cost 3 vext2 <3,3,4,4>, <3,3,4,4>
+ 2638146039U, // <4,4,3,4>: Cost 3 vext2 <3,4,4,4>, <3,4,4,4>
+ 3913287374U, // <4,4,3,5>: Cost 4 vuzpr <3,4,5,4>, <2,3,4,5>
+ 3765652625U, // <4,4,3,6>: Cost 4 vext3 <1,2,3,4>, <4,3,6,4>
+ 3713878762U, // <4,4,3,7>: Cost 4 vext2 <3,7,4,4>, <3,7,4,4>
+ 2637482406U, // <4,4,3,u>: Cost 3 vext2 <3,3,4,4>, <3,3,4,4>
+ 1503264870U, // <4,4,4,0>: Cost 2 vext1 <4,4,4,4>, LHS
+ 2577007514U, // <4,4,4,1>: Cost 3 vext1 <4,4,4,4>, <1,2,3,4>
+ 2577008232U, // <4,4,4,2>: Cost 3 vext1 <4,4,4,4>, <2,2,2,2>
+ 2571037175U, // <4,4,4,3>: Cost 3 vext1 <3,4,4,4>, <3,4,4,4>
+ 161926454U, // <4,4,4,4>: Cost 1 vdup0 RHS
+ 1570377014U, // <4,4,4,5>: Cost 2 vext2 <4,4,4,4>, RHS
+ 2779680054U, // <4,4,4,6>: Cost 3 vuzpl <4,6,4,6>, RHS
+ 2594927963U, // <4,4,4,7>: Cost 3 vext1 <7,4,4,4>, <7,4,4,4>
+ 161926454U, // <4,4,4,u>: Cost 1 vdup0 RHS
+ 2571042918U, // <4,4,5,0>: Cost 3 vext1 <3,4,4,5>, LHS
+ 2571043738U, // <4,4,5,1>: Cost 3 vext1 <3,4,4,5>, <1,2,3,4>
+ 3638814495U, // <4,4,5,2>: Cost 4 vext1 <2,4,4,5>, <2,4,4,5>
+ 2571045368U, // <4,4,5,3>: Cost 3 vext1 <3,4,4,5>, <3,4,4,5>
+ 2571046198U, // <4,4,5,4>: Cost 3 vext1 <3,4,4,5>, RHS
+ 1839648054U, // <4,4,5,5>: Cost 2 vzipl RHS, RHS
+ 1618169142U, // <4,4,5,6>: Cost 2 vext3 <1,2,3,4>, RHS
+ 2594936156U, // <4,4,5,7>: Cost 3 vext1 <7,4,4,5>, <7,4,4,5>
+ 1618169160U, // <4,4,5,u>: Cost 2 vext3 <1,2,3,4>, RHS
+ 2553135206U, // <4,4,6,0>: Cost 3 vext1 <0,4,4,6>, LHS
+ 3626877686U, // <4,4,6,1>: Cost 4 vext1 <0,4,4,6>, <1,0,3,2>
+ 2565080782U, // <4,4,6,2>: Cost 3 vext1 <2,4,4,6>, <2,3,4,5>
+ 2571053561U, // <4,4,6,3>: Cost 3 vext1 <3,4,4,6>, <3,4,4,6>
+ 2553138486U, // <4,4,6,4>: Cost 3 vext1 <0,4,4,6>, RHS
+ 2241555675U, // <4,4,6,5>: Cost 3 vrev <4,4,5,6>
+ 1973865782U, // <4,4,6,6>: Cost 2 vtrnl RHS, RHS
+ 2658055029U, // <4,4,6,7>: Cost 3 vext2 <6,7,4,4>, <6,7,4,4>
+ 1973865800U, // <4,4,6,u>: Cost 2 vtrnl RHS, RHS
+ 2644120570U, // <4,4,7,0>: Cost 3 vext2 <4,4,4,4>, <7,0,1,2>
+ 3638829978U, // <4,4,7,1>: Cost 4 vext1 <2,4,4,7>, <1,2,3,4>
+ 3638830881U, // <4,4,7,2>: Cost 4 vext1 <2,4,4,7>, <2,4,4,7>
+ 3735115018U, // <4,4,7,3>: Cost 4 vext2 <7,3,4,4>, <7,3,4,4>
+ 2662036827U, // <4,4,7,4>: Cost 3 vext2 <7,4,4,4>, <7,4,4,4>
+ 2713292236U, // <4,4,7,5>: Cost 3 vext3 <4,7,5,4>, <4,7,5,4>
+ 2713365973U, // <4,4,7,6>: Cost 3 vext3 <4,7,6,4>, <4,7,6,4>
+ 2644121196U, // <4,4,7,7>: Cost 3 vext2 <4,4,4,4>, <7,7,7,7>
+ 2662036827U, // <4,4,7,u>: Cost 3 vext2 <7,4,4,4>, <7,4,4,4>
+ 1503297638U, // <4,4,u,0>: Cost 2 vext1 <4,4,4,u>, LHS
+ 1570379566U, // <4,4,u,1>: Cost 2 vext2 <4,4,4,4>, LHS
+ 2779682606U, // <4,4,u,2>: Cost 3 vuzpl <4,6,4,6>, LHS
+ 2571069947U, // <4,4,u,3>: Cost 3 vext1 <3,4,4,u>, <3,4,4,u>
+ 161926454U, // <4,4,u,4>: Cost 1 vdup0 RHS
+ 1841638710U, // <4,4,u,5>: Cost 2 vzipl RHS, RHS
+ 1618169385U, // <4,4,u,6>: Cost 2 vext3 <1,2,3,4>, RHS
+ 2594960735U, // <4,4,u,7>: Cost 3 vext1 <7,4,4,u>, <7,4,4,u>
+ 161926454U, // <4,4,u,u>: Cost 1 vdup0 RHS
+ 2631516160U, // <4,5,0,0>: Cost 3 vext2 <2,3,4,5>, <0,0,0,0>
+ 1557774438U, // <4,5,0,1>: Cost 2 vext2 <2,3,4,5>, LHS
+ 2618908875U, // <4,5,0,2>: Cost 3 vext2 <0,2,4,5>, <0,2,4,5>
+ 2571078140U, // <4,5,0,3>: Cost 3 vext1 <3,4,5,0>, <3,4,5,0>
+ 2626871634U, // <4,5,0,4>: Cost 3 vext2 <1,5,4,5>, <0,4,1,5>
+ 3705258414U, // <4,5,0,5>: Cost 4 vext2 <2,3,4,5>, <0,5,2,7>
+ 2594968438U, // <4,5,0,6>: Cost 3 vext1 <7,4,5,0>, <6,7,4,5>
+ 2594968928U, // <4,5,0,7>: Cost 3 vext1 <7,4,5,0>, <7,4,5,0>
+ 1557775005U, // <4,5,0,u>: Cost 2 vext2 <2,3,4,5>, LHS
+ 2631516918U, // <4,5,1,0>: Cost 3 vext2 <2,3,4,5>, <1,0,3,2>
+ 2624217939U, // <4,5,1,1>: Cost 3 vext2 <1,1,4,5>, <1,1,4,5>
+ 2631517078U, // <4,5,1,2>: Cost 3 vext2 <2,3,4,5>, <1,2,3,0>
+ 2821341286U, // <4,5,1,3>: Cost 3 vuzpr <0,4,1,5>, LHS
+ 3895086054U, // <4,5,1,4>: Cost 4 vuzpr <0,4,1,5>, <4,1,5,4>
+ 2626872471U, // <4,5,1,5>: Cost 3 vext2 <1,5,4,5>, <1,5,4,5>
+ 3895083131U, // <4,5,1,6>: Cost 4 vuzpr <0,4,1,5>, <0,1,4,6>
+ 2718748368U, // <4,5,1,7>: Cost 3 vext3 <5,6,7,4>, <5,1,7,3>
+ 2821341291U, // <4,5,1,u>: Cost 3 vuzpr <0,4,1,5>, LHS
+ 2571092070U, // <4,5,2,0>: Cost 3 vext1 <3,4,5,2>, LHS
+ 3699287585U, // <4,5,2,1>: Cost 4 vext2 <1,3,4,5>, <2,1,3,3>
+ 2630854269U, // <4,5,2,2>: Cost 3 vext2 <2,2,4,5>, <2,2,4,5>
+ 1557776078U, // <4,5,2,3>: Cost 2 vext2 <2,3,4,5>, <2,3,4,5>
+ 2631517974U, // <4,5,2,4>: Cost 3 vext2 <2,3,4,5>, <2,4,3,5>
+ 3692652384U, // <4,5,2,5>: Cost 4 vext2 <0,2,4,5>, <2,5,2,7>
+ 2631518138U, // <4,5,2,6>: Cost 3 vext2 <2,3,4,5>, <2,6,3,7>
+ 4164013366U, // <4,5,2,7>: Cost 4 vtrnr <0,4,u,2>, RHS
+ 1561094243U, // <4,5,2,u>: Cost 2 vext2 <2,u,4,5>, <2,u,4,5>
+ 2631518358U, // <4,5,3,0>: Cost 3 vext2 <2,3,4,5>, <3,0,1,2>
+ 3895084710U, // <4,5,3,1>: Cost 4 vuzpr <0,4,1,5>, <2,3,0,1>
+ 2631518540U, // <4,5,3,2>: Cost 3 vext2 <2,3,4,5>, <3,2,3,4>
+ 2631518620U, // <4,5,3,3>: Cost 3 vext2 <2,3,4,5>, <3,3,3,3>
+ 2631518716U, // <4,5,3,4>: Cost 3 vext2 <2,3,4,5>, <3,4,5,0>
+ 2631518784U, // <4,5,3,5>: Cost 3 vext2 <2,3,4,5>, <3,5,3,5>
+ 2658060980U, // <4,5,3,6>: Cost 3 vext2 <6,7,4,5>, <3,6,7,4>
+ 2640145131U, // <4,5,3,7>: Cost 3 vext2 <3,7,4,5>, <3,7,4,5>
+ 2631519006U, // <4,5,3,u>: Cost 3 vext2 <2,3,4,5>, <3,u,1,2>
+ 2571108454U, // <4,5,4,0>: Cost 3 vext1 <3,4,5,4>, LHS
+ 3632907342U, // <4,5,4,1>: Cost 4 vext1 <1,4,5,4>, <1,4,5,4>
+ 2571110094U, // <4,5,4,2>: Cost 3 vext1 <3,4,5,4>, <2,3,4,5>
+ 2571110912U, // <4,5,4,3>: Cost 3 vext1 <3,4,5,4>, <3,4,5,4>
+ 2571111734U, // <4,5,4,4>: Cost 3 vext1 <3,4,5,4>, RHS
+ 1557777718U, // <4,5,4,5>: Cost 2 vext2 <2,3,4,5>, RHS
+ 2645454195U, // <4,5,4,6>: Cost 3 vext2 <4,6,4,5>, <4,6,4,5>
+ 2718748614U, // <4,5,4,7>: Cost 3 vext3 <5,6,7,4>, <5,4,7,6>
+ 1557777961U, // <4,5,4,u>: Cost 2 vext2 <2,3,4,5>, RHS
+ 1503346790U, // <4,5,5,0>: Cost 2 vext1 <4,4,5,5>, LHS
+ 2913398480U, // <4,5,5,1>: Cost 3 vzipl RHS, <5,1,7,3>
+ 2631519998U, // <4,5,5,2>: Cost 3 vext2 <2,3,4,5>, <5,2,3,4>
+ 2577090710U, // <4,5,5,3>: Cost 3 vext1 <4,4,5,5>, <3,0,1,2>
+ 1503349978U, // <4,5,5,4>: Cost 2 vext1 <4,4,5,5>, <4,4,5,5>
+ 2631520260U, // <4,5,5,5>: Cost 3 vext2 <2,3,4,5>, <5,5,5,5>
+ 2913390690U, // <4,5,5,6>: Cost 3 vzipl RHS, <5,6,7,0>
+ 2821344566U, // <4,5,5,7>: Cost 3 vuzpr <0,4,1,5>, RHS
+ 1503352622U, // <4,5,5,u>: Cost 2 vext1 <4,4,5,5>, LHS
+ 1497383014U, // <4,5,6,0>: Cost 2 vext1 <3,4,5,6>, LHS
+ 2559181904U, // <4,5,6,1>: Cost 3 vext1 <1,4,5,6>, <1,4,5,6>
+ 2565154601U, // <4,5,6,2>: Cost 3 vext1 <2,4,5,6>, <2,4,5,6>
+ 1497385474U, // <4,5,6,3>: Cost 2 vext1 <3,4,5,6>, <3,4,5,6>
+ 1497386294U, // <4,5,6,4>: Cost 2 vext1 <3,4,5,6>, RHS
+ 3047608324U, // <4,5,6,5>: Cost 3 vtrnl RHS, <5,5,5,5>
+ 2571129656U, // <4,5,6,6>: Cost 3 vext1 <3,4,5,6>, <6,6,6,6>
+ 27705344U, // <4,5,6,7>: Cost 0 copy RHS
+ 27705344U, // <4,5,6,u>: Cost 0 copy RHS
+ 2565161062U, // <4,5,7,0>: Cost 3 vext1 <2,4,5,7>, LHS
+ 2565161882U, // <4,5,7,1>: Cost 3 vext1 <2,4,5,7>, <1,2,3,4>
+ 2565162794U, // <4,5,7,2>: Cost 3 vext1 <2,4,5,7>, <2,4,5,7>
+ 2661381387U, // <4,5,7,3>: Cost 3 vext2 <7,3,4,5>, <7,3,4,5>
+ 2565164342U, // <4,5,7,4>: Cost 3 vext1 <2,4,5,7>, RHS
+ 2718748840U, // <4,5,7,5>: Cost 3 vext3 <5,6,7,4>, <5,7,5,7>
+ 2718748846U, // <4,5,7,6>: Cost 3 vext3 <5,6,7,4>, <5,7,6,4>
+ 2719412407U, // <4,5,7,7>: Cost 3 vext3 <5,7,7,4>, <5,7,7,4>
+ 2565166894U, // <4,5,7,u>: Cost 3 vext1 <2,4,5,7>, LHS
+ 1497399398U, // <4,5,u,0>: Cost 2 vext1 <3,4,5,u>, LHS
+ 1557780270U, // <4,5,u,1>: Cost 2 vext2 <2,3,4,5>, LHS
+ 2631522181U, // <4,5,u,2>: Cost 3 vext2 <2,3,4,5>, <u,2,3,0>
+ 1497401860U, // <4,5,u,3>: Cost 2 vext1 <3,4,5,u>, <3,4,5,u>
+ 1497402678U, // <4,5,u,4>: Cost 2 vext1 <3,4,5,u>, RHS
+ 1557780634U, // <4,5,u,5>: Cost 2 vext2 <2,3,4,5>, RHS
+ 2631522512U, // <4,5,u,6>: Cost 3 vext2 <2,3,4,5>, <u,6,3,7>
+ 27705344U, // <4,5,u,7>: Cost 0 copy RHS
+ 27705344U, // <4,5,u,u>: Cost 0 copy RHS
+ 2618916864U, // <4,6,0,0>: Cost 3 vext2 <0,2,4,6>, <0,0,0,0>
+ 1545175142U, // <4,6,0,1>: Cost 2 vext2 <0,2,4,6>, LHS
+ 1545175244U, // <4,6,0,2>: Cost 2 vext2 <0,2,4,6>, <0,2,4,6>
+ 3692658940U, // <4,6,0,3>: Cost 4 vext2 <0,2,4,6>, <0,3,1,0>
+ 2618917202U, // <4,6,0,4>: Cost 3 vext2 <0,2,4,6>, <0,4,1,5>
+ 3852910806U, // <4,6,0,5>: Cost 4 vuzpl RHS, <0,2,5,7>
+ 2253525648U, // <4,6,0,6>: Cost 3 vrev <6,4,6,0>
+ 4040764726U, // <4,6,0,7>: Cost 4 vzipr <2,3,4,0>, RHS
+ 1545175709U, // <4,6,0,u>: Cost 2 vext2 <0,2,4,6>, LHS
+ 2618917622U, // <4,6,1,0>: Cost 3 vext2 <0,2,4,6>, <1,0,3,2>
+ 2618917684U, // <4,6,1,1>: Cost 3 vext2 <0,2,4,6>, <1,1,1,1>
+ 2618917782U, // <4,6,1,2>: Cost 3 vext2 <0,2,4,6>, <1,2,3,0>
+ 2618917848U, // <4,6,1,3>: Cost 3 vext2 <0,2,4,6>, <1,3,1,3>
+ 3692659773U, // <4,6,1,4>: Cost 4 vext2 <0,2,4,6>, <1,4,3,5>
+ 2618918032U, // <4,6,1,5>: Cost 3 vext2 <0,2,4,6>, <1,5,3,7>
+ 3692659937U, // <4,6,1,6>: Cost 4 vext2 <0,2,4,6>, <1,6,3,7>
+ 4032146742U, // <4,6,1,7>: Cost 4 vzipr <0,u,4,1>, RHS
+ 2618918253U, // <4,6,1,u>: Cost 3 vext2 <0,2,4,6>, <1,u,1,3>
+ 2618918380U, // <4,6,2,0>: Cost 3 vext2 <0,2,4,6>, <2,0,6,4>
+ 2618918460U, // <4,6,2,1>: Cost 3 vext2 <0,2,4,6>, <2,1,6,3>
+ 2618918504U, // <4,6,2,2>: Cost 3 vext2 <0,2,4,6>, <2,2,2,2>
+ 2618918566U, // <4,6,2,3>: Cost 3 vext2 <0,2,4,6>, <2,3,0,1>
+ 2618918679U, // <4,6,2,4>: Cost 3 vext2 <0,2,4,6>, <2,4,3,6>
+ 2618918788U, // <4,6,2,5>: Cost 3 vext2 <0,2,4,6>, <2,5,6,7>
+ 2618918842U, // <4,6,2,6>: Cost 3 vext2 <0,2,4,6>, <2,6,3,7>
+ 2718749178U, // <4,6,2,7>: Cost 3 vext3 <5,6,7,4>, <6,2,7,3>
+ 2618918971U, // <4,6,2,u>: Cost 3 vext2 <0,2,4,6>, <2,u,0,1>
+ 2618919062U, // <4,6,3,0>: Cost 3 vext2 <0,2,4,6>, <3,0,1,2>
+ 2636171526U, // <4,6,3,1>: Cost 3 vext2 <3,1,4,6>, <3,1,4,6>
+ 3692661057U, // <4,6,3,2>: Cost 4 vext2 <0,2,4,6>, <3,2,2,2>
+ 2618919324U, // <4,6,3,3>: Cost 3 vext2 <0,2,4,6>, <3,3,3,3>
+ 2618919426U, // <4,6,3,4>: Cost 3 vext2 <0,2,4,6>, <3,4,5,6>
+ 2638826058U, // <4,6,3,5>: Cost 3 vext2 <3,5,4,6>, <3,5,4,6>
+ 3913303030U, // <4,6,3,6>: Cost 4 vuzpr <3,4,5,6>, <1,3,4,6>
+ 2722730572U, // <4,6,3,7>: Cost 3 vext3 <6,3,7,4>, <6,3,7,4>
+ 2618919710U, // <4,6,3,u>: Cost 3 vext2 <0,2,4,6>, <3,u,1,2>
+ 2565210214U, // <4,6,4,0>: Cost 3 vext1 <2,4,6,4>, LHS
+ 2718749286U, // <4,6,4,1>: Cost 3 vext3 <5,6,7,4>, <6,4,1,3>
+ 2565211952U, // <4,6,4,2>: Cost 3 vext1 <2,4,6,4>, <2,4,6,4>
+ 2571184649U, // <4,6,4,3>: Cost 3 vext1 <3,4,6,4>, <3,4,6,4>
+ 2565213494U, // <4,6,4,4>: Cost 3 vext1 <2,4,6,4>, RHS
+ 1545178422U, // <4,6,4,5>: Cost 2 vext2 <0,2,4,6>, RHS
+ 1705430326U, // <4,6,4,6>: Cost 2 vuzpl RHS, RHS
+ 2595075437U, // <4,6,4,7>: Cost 3 vext1 <7,4,6,4>, <7,4,6,4>
+ 1545178665U, // <4,6,4,u>: Cost 2 vext2 <0,2,4,6>, RHS
+ 2565218406U, // <4,6,5,0>: Cost 3 vext1 <2,4,6,5>, LHS
+ 2645462736U, // <4,6,5,1>: Cost 3 vext2 <4,6,4,6>, <5,1,7,3>
+ 2913399290U, // <4,6,5,2>: Cost 3 vzipl RHS, <6,2,7,3>
+ 3913305394U, // <4,6,5,3>: Cost 4 vuzpr <3,4,5,6>, <4,5,6,3>
+ 2645462982U, // <4,6,5,4>: Cost 3 vext2 <4,6,4,6>, <5,4,7,6>
+ 2779172868U, // <4,6,5,5>: Cost 3 vuzpl RHS, <5,5,5,5>
+ 2913391416U, // <4,6,5,6>: Cost 3 vzipl RHS, <6,6,6,6>
+ 2821426486U, // <4,6,5,7>: Cost 3 vuzpr <0,4,2,6>, RHS
+ 2821426487U, // <4,6,5,u>: Cost 3 vuzpr <0,4,2,6>, RHS
+ 1503428710U, // <4,6,6,0>: Cost 2 vext1 <4,4,6,6>, LHS
+ 2577171190U, // <4,6,6,1>: Cost 3 vext1 <4,4,6,6>, <1,0,3,2>
+ 2645463546U, // <4,6,6,2>: Cost 3 vext2 <4,6,4,6>, <6,2,7,3>
+ 2577172630U, // <4,6,6,3>: Cost 3 vext1 <4,4,6,6>, <3,0,1,2>
+ 1503431908U, // <4,6,6,4>: Cost 2 vext1 <4,4,6,6>, <4,4,6,6>
+ 2253501069U, // <4,6,6,5>: Cost 3 vrev <6,4,5,6>
+ 2618921784U, // <4,6,6,6>: Cost 3 vext2 <0,2,4,6>, <6,6,6,6>
+ 2954464566U, // <4,6,6,7>: Cost 3 vzipr <0,2,4,6>, RHS
+ 1503434542U, // <4,6,6,u>: Cost 2 vext1 <4,4,6,6>, LHS
+ 2645464058U, // <4,6,7,0>: Cost 3 vext2 <4,6,4,6>, <7,0,1,2>
+ 2779173882U, // <4,6,7,1>: Cost 3 vuzpl RHS, <7,0,1,2>
+ 3638978355U, // <4,6,7,2>: Cost 4 vext1 <2,4,6,7>, <2,4,6,7>
+ 2725090156U, // <4,6,7,3>: Cost 3 vext3 <6,7,3,4>, <6,7,3,4>
+ 2645464422U, // <4,6,7,4>: Cost 3 vext2 <4,6,4,6>, <7,4,5,6>
+ 2779174246U, // <4,6,7,5>: Cost 3 vuzpl RHS, <7,4,5,6>
+ 3852915914U, // <4,6,7,6>: Cost 4 vuzpl RHS, <7,2,6,3>
+ 2779174508U, // <4,6,7,7>: Cost 3 vuzpl RHS, <7,7,7,7>
+ 2779173945U, // <4,6,7,u>: Cost 3 vuzpl RHS, <7,0,u,2>
+ 1503445094U, // <4,6,u,0>: Cost 2 vext1 <4,4,6,u>, LHS
+ 1545180974U, // <4,6,u,1>: Cost 2 vext2 <0,2,4,6>, LHS
+ 1705432878U, // <4,6,u,2>: Cost 2 vuzpl RHS, LHS
+ 2618922940U, // <4,6,u,3>: Cost 3 vext2 <0,2,4,6>, <u,3,0,1>
+ 1503448294U, // <4,6,u,4>: Cost 2 vext1 <4,4,6,u>, <4,4,6,u>
+ 1545181338U, // <4,6,u,5>: Cost 2 vext2 <0,2,4,6>, RHS
+ 1705433242U, // <4,6,u,6>: Cost 2 vuzpl RHS, RHS
+ 2954480950U, // <4,6,u,7>: Cost 3 vzipr <0,2,4,u>, RHS
+ 1545181541U, // <4,6,u,u>: Cost 2 vext2 <0,2,4,6>, LHS
+ 3706601472U, // <4,7,0,0>: Cost 4 vext2 <2,5,4,7>, <0,0,0,0>
+ 2632859750U, // <4,7,0,1>: Cost 3 vext2 <2,5,4,7>, LHS
+ 2726343685U, // <4,7,0,2>: Cost 3 vext3 <7,0,2,4>, <7,0,2,4>
+ 3701293312U, // <4,7,0,3>: Cost 4 vext2 <1,6,4,7>, <0,3,1,4>
+ 3706601810U, // <4,7,0,4>: Cost 4 vext2 <2,5,4,7>, <0,4,1,5>
+ 2259424608U, // <4,7,0,5>: Cost 3 vrev <7,4,5,0>
+ 3695321617U, // <4,7,0,6>: Cost 4 vext2 <0,6,4,7>, <0,6,4,7>
+ 3800454194U, // <4,7,0,7>: Cost 4 vext3 <7,0,7,4>, <7,0,7,4>
+ 2632860317U, // <4,7,0,u>: Cost 3 vext2 <2,5,4,7>, LHS
+ 2259064116U, // <4,7,1,0>: Cost 3 vrev <7,4,0,1>
+ 3700630324U, // <4,7,1,1>: Cost 4 vext2 <1,5,4,7>, <1,1,1,1>
+ 2632860570U, // <4,7,1,2>: Cost 3 vext2 <2,5,4,7>, <1,2,3,4>
+ 3769635936U, // <4,7,1,3>: Cost 4 vext3 <1,u,3,4>, <7,1,3,5>
+ 3656920374U, // <4,7,1,4>: Cost 4 vext1 <5,4,7,1>, RHS
+ 3700630681U, // <4,7,1,5>: Cost 4 vext2 <1,5,4,7>, <1,5,4,7>
+ 3701294314U, // <4,7,1,6>: Cost 4 vext2 <1,6,4,7>, <1,6,4,7>
+ 3793818754U, // <4,7,1,7>: Cost 4 vext3 <5,u,7,4>, <7,1,7,3>
+ 2259654012U, // <4,7,1,u>: Cost 3 vrev <7,4,u,1>
+ 3656925286U, // <4,7,2,0>: Cost 4 vext1 <5,4,7,2>, LHS
+ 3706603050U, // <4,7,2,1>: Cost 4 vext2 <2,5,4,7>, <2,1,4,3>
+ 3706603112U, // <4,7,2,2>: Cost 4 vext2 <2,5,4,7>, <2,2,2,2>
+ 2727744688U, // <4,7,2,3>: Cost 3 vext3 <7,2,3,4>, <7,2,3,4>
+ 3705939745U, // <4,7,2,4>: Cost 4 vext2 <2,4,4,7>, <2,4,4,7>
+ 2632861554U, // <4,7,2,5>: Cost 3 vext2 <2,5,4,7>, <2,5,4,7>
+ 3706603450U, // <4,7,2,6>: Cost 4 vext2 <2,5,4,7>, <2,6,3,7>
+ 3792491731U, // <4,7,2,7>: Cost 4 vext3 <5,6,7,4>, <7,2,7,3>
+ 2634852453U, // <4,7,2,u>: Cost 3 vext2 <2,u,4,7>, <2,u,4,7>
+ 3706603670U, // <4,7,3,0>: Cost 4 vext2 <2,5,4,7>, <3,0,1,2>
+ 3662906266U, // <4,7,3,1>: Cost 4 vext1 <6,4,7,3>, <1,2,3,4>
+ 3725183326U, // <4,7,3,2>: Cost 4 vext2 <5,6,4,7>, <3,2,5,4>
+ 3706603932U, // <4,7,3,3>: Cost 4 vext2 <2,5,4,7>, <3,3,3,3>
+ 3701295618U, // <4,7,3,4>: Cost 4 vext2 <1,6,4,7>, <3,4,5,6>
+ 2638834251U, // <4,7,3,5>: Cost 3 vext2 <3,5,4,7>, <3,5,4,7>
+ 2639497884U, // <4,7,3,6>: Cost 3 vext2 <3,6,4,7>, <3,6,4,7>
+ 3802445093U, // <4,7,3,7>: Cost 4 vext3 <7,3,7,4>, <7,3,7,4>
+ 2640825150U, // <4,7,3,u>: Cost 3 vext2 <3,u,4,7>, <3,u,4,7>
+ 2718750004U, // <4,7,4,0>: Cost 3 vext3 <5,6,7,4>, <7,4,0,1>
+ 3706604490U, // <4,7,4,1>: Cost 4 vext2 <2,5,4,7>, <4,1,2,3>
+ 3656943474U, // <4,7,4,2>: Cost 4 vext1 <5,4,7,4>, <2,5,4,7>
+ 3779884371U, // <4,7,4,3>: Cost 4 vext3 <3,5,7,4>, <7,4,3,5>
+ 2259383643U, // <4,7,4,4>: Cost 3 vrev <7,4,4,4>
+ 2632863030U, // <4,7,4,5>: Cost 3 vext2 <2,5,4,7>, RHS
+ 2259531117U, // <4,7,4,6>: Cost 3 vrev <7,4,6,4>
+ 3907340074U, // <4,7,4,7>: Cost 4 vuzpr <2,4,5,7>, <2,4,5,7>
+ 2632863273U, // <4,7,4,u>: Cost 3 vext2 <2,5,4,7>, RHS
+ 2913391610U, // <4,7,5,0>: Cost 3 vzipl RHS, <7,0,1,2>
+ 3645006848U, // <4,7,5,1>: Cost 4 vext1 <3,4,7,5>, <1,3,5,7>
+ 2589181646U, // <4,7,5,2>: Cost 3 vext1 <6,4,7,5>, <2,3,4,5>
+ 3645008403U, // <4,7,5,3>: Cost 4 vext1 <3,4,7,5>, <3,4,7,5>
+ 2913391974U, // <4,7,5,4>: Cost 3 vzipl RHS, <7,4,5,6>
+ 2583211973U, // <4,7,5,5>: Cost 3 vext1 <5,4,7,5>, <5,4,7,5>
+ 2589184670U, // <4,7,5,6>: Cost 3 vext1 <6,4,7,5>, <6,4,7,5>
+ 2913392236U, // <4,7,5,7>: Cost 3 vzipl RHS, <7,7,7,7>
+ 2913392258U, // <4,7,5,u>: Cost 3 vzipl RHS, <7,u,1,2>
+ 1509474406U, // <4,7,6,0>: Cost 2 vext1 <5,4,7,6>, LHS
+ 3047609338U, // <4,7,6,1>: Cost 3 vtrnl RHS, <7,0,1,2>
+ 2583217768U, // <4,7,6,2>: Cost 3 vext1 <5,4,7,6>, <2,2,2,2>
+ 2583218326U, // <4,7,6,3>: Cost 3 vext1 <5,4,7,6>, <3,0,1,2>
+ 1509477686U, // <4,7,6,4>: Cost 2 vext1 <5,4,7,6>, RHS
+ 1509478342U, // <4,7,6,5>: Cost 2 vext1 <5,4,7,6>, <5,4,7,6>
+ 2583220730U, // <4,7,6,6>: Cost 3 vext1 <5,4,7,6>, <6,2,7,3>
+ 3047609964U, // <4,7,6,7>: Cost 3 vtrnl RHS, <7,7,7,7>
+ 1509480238U, // <4,7,6,u>: Cost 2 vext1 <5,4,7,6>, LHS
+ 3650994278U, // <4,7,7,0>: Cost 4 vext1 <4,4,7,7>, LHS
+ 3650995098U, // <4,7,7,1>: Cost 4 vext1 <4,4,7,7>, <1,2,3,4>
+ 3650996010U, // <4,7,7,2>: Cost 4 vext1 <4,4,7,7>, <2,4,5,7>
+ 3804804677U, // <4,7,7,3>: Cost 4 vext3 <7,7,3,4>, <7,7,3,4>
+ 3650997486U, // <4,7,7,4>: Cost 4 vext1 <4,4,7,7>, <4,4,7,7>
+ 2662725039U, // <4,7,7,5>: Cost 3 vext2 <7,5,4,7>, <7,5,4,7>
+ 3662942880U, // <4,7,7,6>: Cost 4 vext1 <6,4,7,7>, <6,4,7,7>
+ 2718750316U, // <4,7,7,7>: Cost 3 vext3 <5,6,7,4>, <7,7,7,7>
+ 2664715938U, // <4,7,7,u>: Cost 3 vext2 <7,u,4,7>, <7,u,4,7>
+ 1509490790U, // <4,7,u,0>: Cost 2 vext1 <5,4,7,u>, LHS
+ 2632865582U, // <4,7,u,1>: Cost 3 vext2 <2,5,4,7>, LHS
+ 2583234152U, // <4,7,u,2>: Cost 3 vext1 <5,4,7,u>, <2,2,2,2>
+ 2583234710U, // <4,7,u,3>: Cost 3 vext1 <5,4,7,u>, <3,0,1,2>
+ 1509494070U, // <4,7,u,4>: Cost 2 vext1 <5,4,7,u>, RHS
+ 1509494728U, // <4,7,u,5>: Cost 2 vext1 <5,4,7,u>, <5,4,7,u>
+ 2583237114U, // <4,7,u,6>: Cost 3 vext1 <5,4,7,u>, <6,2,7,3>
+ 3047757420U, // <4,7,u,7>: Cost 3 vtrnl RHS, <7,7,7,7>
+ 1509496622U, // <4,7,u,u>: Cost 2 vext1 <5,4,7,u>, LHS
+ 2618933248U, // <4,u,0,0>: Cost 3 vext2 <0,2,4,u>, <0,0,0,0>
+ 1545191526U, // <4,u,0,1>: Cost 2 vext2 <0,2,4,u>, LHS
+ 1545191630U, // <4,u,0,2>: Cost 2 vext2 <0,2,4,u>, <0,2,4,u>
+ 2691913445U, // <4,u,0,3>: Cost 3 vext3 <1,2,3,4>, <u,0,3,2>
+ 2618933586U, // <4,u,0,4>: Cost 3 vext2 <0,2,4,u>, <0,4,1,5>
+ 2265397305U, // <4,u,0,5>: Cost 3 vrev <u,4,5,0>
+ 2595189625U, // <4,u,0,6>: Cost 3 vext1 <7,4,u,0>, <6,7,4,u>
+ 2595190139U, // <4,u,0,7>: Cost 3 vext1 <7,4,u,0>, <7,4,u,0>
+ 1545192093U, // <4,u,0,u>: Cost 2 vext2 <0,2,4,u>, LHS
+ 2618934006U, // <4,u,1,0>: Cost 3 vext2 <0,2,4,u>, <1,0,3,2>
+ 2618934068U, // <4,u,1,1>: Cost 3 vext2 <0,2,4,u>, <1,1,1,1>
+ 1618171694U, // <4,u,1,2>: Cost 2 vext3 <1,2,3,4>, LHS
+ 2618934232U, // <4,u,1,3>: Cost 3 vext2 <0,2,4,u>, <1,3,1,3>
+ 2695894848U, // <4,u,1,4>: Cost 3 vext3 <1,u,3,4>, <u,1,4,3>
+ 2618934416U, // <4,u,1,5>: Cost 3 vext2 <0,2,4,u>, <1,5,3,7>
+ 3692676321U, // <4,u,1,6>: Cost 4 vext2 <0,2,4,u>, <1,6,3,7>
+ 2718750555U, // <4,u,1,7>: Cost 3 vext3 <5,6,7,4>, <u,1,7,3>
+ 1618171748U, // <4,u,1,u>: Cost 2 vext3 <1,2,3,4>, LHS
+ 2553397350U, // <4,u,2,0>: Cost 3 vext1 <0,4,u,2>, LHS
+ 2630215215U, // <4,u,2,1>: Cost 3 vext2 <2,1,4,u>, <2,1,4,u>
+ 2618934888U, // <4,u,2,2>: Cost 3 vext2 <0,2,4,u>, <2,2,2,2>
+ 1557800657U, // <4,u,2,3>: Cost 2 vext2 <2,3,4,u>, <2,3,4,u>
+ 2618935065U, // <4,u,2,4>: Cost 3 vext2 <0,2,4,u>, <2,4,3,u>
+ 2733864859U, // <4,u,2,5>: Cost 3 vext3 <u,2,5,4>, <u,2,5,4>
+ 2618935226U, // <4,u,2,6>: Cost 3 vext2 <0,2,4,u>, <2,6,3,7>
+ 2718750636U, // <4,u,2,7>: Cost 3 vext3 <5,6,7,4>, <u,2,7,3>
+ 1561118822U, // <4,u,2,u>: Cost 2 vext2 <2,u,4,u>, <2,u,4,u>
+ 2618935446U, // <4,u,3,0>: Cost 3 vext2 <0,2,4,u>, <3,0,1,2>
+ 2779318422U, // <4,u,3,1>: Cost 3 vuzpl RHS, <3,0,1,2>
+ 2636851545U, // <4,u,3,2>: Cost 3 vext2 <3,2,4,u>, <3,2,4,u>
+ 2618935708U, // <4,u,3,3>: Cost 3 vext2 <0,2,4,u>, <3,3,3,3>
+ 2618935810U, // <4,u,3,4>: Cost 3 vext2 <0,2,4,u>, <3,4,5,6>
+ 2691913711U, // <4,u,3,5>: Cost 3 vext3 <1,2,3,4>, <u,3,5,7>
+ 2588725862U, // <4,u,3,6>: Cost 3 vext1 <6,4,1,3>, <6,4,1,3>
+ 2640169710U, // <4,u,3,7>: Cost 3 vext2 <3,7,4,u>, <3,7,4,u>
+ 2618936094U, // <4,u,3,u>: Cost 3 vext2 <0,2,4,u>, <3,u,1,2>
+ 1503559782U, // <4,u,4,0>: Cost 2 vext1 <4,4,u,4>, LHS
+ 2692282391U, // <4,u,4,1>: Cost 3 vext3 <1,2,u,4>, <u,4,1,2>
+ 2565359426U, // <4,u,4,2>: Cost 3 vext1 <2,4,u,4>, <2,4,u,4>
+ 2571332123U, // <4,u,4,3>: Cost 3 vext1 <3,4,u,4>, <3,4,u,4>
+ 161926454U, // <4,u,4,4>: Cost 1 vdup0 RHS
+ 1545194806U, // <4,u,4,5>: Cost 2 vext2 <0,2,4,u>, RHS
+ 1705577782U, // <4,u,4,6>: Cost 2 vuzpl RHS, RHS
+ 2718750801U, // <4,u,4,7>: Cost 3 vext3 <5,6,7,4>, <u,4,7,6>
+ 161926454U, // <4,u,4,u>: Cost 1 vdup0 RHS
+ 1479164006U, // <4,u,5,0>: Cost 2 vext1 <0,4,1,5>, LHS
+ 1839650606U, // <4,u,5,1>: Cost 2 vzipl RHS, LHS
+ 2565367502U, // <4,u,5,2>: Cost 3 vext1 <2,4,u,5>, <2,3,4,5>
+ 3089777309U, // <4,u,5,3>: Cost 3 vtrnr <0,4,1,5>, LHS
+ 1479167286U, // <4,u,5,4>: Cost 2 vext1 <0,4,1,5>, RHS
+ 1839650970U, // <4,u,5,5>: Cost 2 vzipl RHS, RHS
+ 1618172058U, // <4,u,5,6>: Cost 2 vext3 <1,2,3,4>, RHS
+ 3089780265U, // <4,u,5,7>: Cost 3 vtrnr <0,4,1,5>, RHS
+ 1618172076U, // <4,u,5,u>: Cost 2 vext3 <1,2,3,4>, RHS
+ 1479688294U, // <4,u,6,0>: Cost 2 vext1 <0,4,u,6>, LHS
+ 2553430774U, // <4,u,6,1>: Cost 3 vext1 <0,4,u,6>, <1,0,3,2>
+ 1973868334U, // <4,u,6,2>: Cost 2 vtrnl RHS, LHS
+ 1497606685U, // <4,u,6,3>: Cost 2 vext1 <3,4,u,6>, <3,4,u,6>
+ 1479691574U, // <4,u,6,4>: Cost 2 vext1 <0,4,u,6>, RHS
+ 1509552079U, // <4,u,6,5>: Cost 2 vext1 <5,4,u,6>, <5,4,u,6>
+ 1973868698U, // <4,u,6,6>: Cost 2 vtrnl RHS, RHS
+ 27705344U, // <4,u,6,7>: Cost 0 copy RHS
+ 27705344U, // <4,u,6,u>: Cost 0 copy RHS
+ 2565382246U, // <4,u,7,0>: Cost 3 vext1 <2,4,u,7>, LHS
+ 2565383066U, // <4,u,7,1>: Cost 3 vext1 <2,4,u,7>, <1,2,3,4>
+ 2565384005U, // <4,u,7,2>: Cost 3 vext1 <2,4,u,7>, <2,4,u,7>
+ 2661405966U, // <4,u,7,3>: Cost 3 vext2 <7,3,4,u>, <7,3,4,u>
+ 2565385526U, // <4,u,7,4>: Cost 3 vext1 <2,4,u,7>, RHS
+ 2779321702U, // <4,u,7,5>: Cost 3 vuzpl RHS, <7,4,5,6>
+ 2589274793U, // <4,u,7,6>: Cost 3 vext1 <6,4,u,7>, <6,4,u,7>
+ 2779321964U, // <4,u,7,7>: Cost 3 vuzpl RHS, <7,7,7,7>
+ 2565388078U, // <4,u,7,u>: Cost 3 vext1 <2,4,u,7>, LHS
+ 1479704678U, // <4,u,u,0>: Cost 2 vext1 <0,4,u,u>, LHS
+ 1545197358U, // <4,u,u,1>: Cost 2 vext2 <0,2,4,u>, LHS
+ 1618172261U, // <4,u,u,2>: Cost 2 vext3 <1,2,3,4>, LHS
+ 1497623071U, // <4,u,u,3>: Cost 2 vext1 <3,4,u,u>, <3,4,u,u>
+ 161926454U, // <4,u,u,4>: Cost 1 vdup0 RHS
+ 1545197722U, // <4,u,u,5>: Cost 2 vext2 <0,2,4,u>, RHS
+ 1618172301U, // <4,u,u,6>: Cost 2 vext3 <1,2,3,4>, RHS
+ 27705344U, // <4,u,u,7>: Cost 0 copy RHS
+ 27705344U, // <4,u,u,u>: Cost 0 copy RHS
+ 2687123456U, // <5,0,0,0>: Cost 3 vext3 <0,4,1,5>, <0,0,0,0>
+ 2687123466U, // <5,0,0,1>: Cost 3 vext3 <0,4,1,5>, <0,0,1,1>
+ 2687123476U, // <5,0,0,2>: Cost 3 vext3 <0,4,1,5>, <0,0,2,2>
+ 3710599434U, // <5,0,0,3>: Cost 4 vext2 <3,2,5,0>, <0,3,2,5>
+ 2642166098U, // <5,0,0,4>: Cost 3 vext2 <4,1,5,0>, <0,4,1,5>
+ 3657060306U, // <5,0,0,5>: Cost 4 vext1 <5,5,0,0>, <5,5,0,0>
+ 3292094923U, // <5,0,0,6>: Cost 4 vrev <0,5,6,0>
+ 3669005700U, // <5,0,0,7>: Cost 4 vext1 <7,5,0,0>, <7,5,0,0>
+ 2687123530U, // <5,0,0,u>: Cost 3 vext3 <0,4,1,5>, <0,0,u,2>
+ 2559434854U, // <5,0,1,0>: Cost 3 vext1 <1,5,0,1>, LHS
+ 2559435887U, // <5,0,1,1>: Cost 3 vext1 <1,5,0,1>, <1,5,0,1>
+ 1613381734U, // <5,0,1,2>: Cost 2 vext3 <0,4,1,5>, LHS
+ 3698656256U, // <5,0,1,3>: Cost 4 vext2 <1,2,5,0>, <1,3,5,7>
+ 2559438134U, // <5,0,1,4>: Cost 3 vext1 <1,5,0,1>, RHS
+ 2583326675U, // <5,0,1,5>: Cost 3 vext1 <5,5,0,1>, <5,5,0,1>
+ 3715908851U, // <5,0,1,6>: Cost 4 vext2 <4,1,5,0>, <1,6,5,7>
+ 3657069562U, // <5,0,1,7>: Cost 4 vext1 <5,5,0,1>, <7,0,1,2>
+ 1613381788U, // <5,0,1,u>: Cost 2 vext3 <0,4,1,5>, LHS
+ 2686017700U, // <5,0,2,0>: Cost 3 vext3 <0,2,4,5>, <0,2,0,2>
+ 2685796528U, // <5,0,2,1>: Cost 3 vext3 <0,2,1,5>, <0,2,1,5>
+ 2698625208U, // <5,0,2,2>: Cost 3 vext3 <2,3,4,5>, <0,2,2,4>
+ 2685944002U, // <5,0,2,3>: Cost 3 vext3 <0,2,3,5>, <0,2,3,5>
+ 2686017739U, // <5,0,2,4>: Cost 3 vext3 <0,2,4,5>, <0,2,4,5>
+ 2686091476U, // <5,0,2,5>: Cost 3 vext3 <0,2,5,5>, <0,2,5,5>
+ 2725167324U, // <5,0,2,6>: Cost 3 vext3 <6,7,4,5>, <0,2,6,4>
+ 2595280230U, // <5,0,2,7>: Cost 3 vext1 <7,5,0,2>, <7,4,5,6>
+ 2686312687U, // <5,0,2,u>: Cost 3 vext3 <0,2,u,5>, <0,2,u,5>
+ 3760128248U, // <5,0,3,0>: Cost 4 vext3 <0,3,0,5>, <0,3,0,5>
+ 3759685888U, // <5,0,3,1>: Cost 4 vext3 <0,2,3,5>, <0,3,1,4>
+ 2686533898U, // <5,0,3,2>: Cost 3 vext3 <0,3,2,5>, <0,3,2,5>
+ 3760349459U, // <5,0,3,3>: Cost 4 vext3 <0,3,3,5>, <0,3,3,5>
+ 2638187004U, // <5,0,3,4>: Cost 3 vext2 <3,4,5,0>, <3,4,5,0>
+ 3776348452U, // <5,0,3,5>: Cost 4 vext3 <3,0,4,5>, <0,3,5,4>
+ 3713256094U, // <5,0,3,6>: Cost 4 vext2 <3,6,5,0>, <3,6,5,0>
+ 3914064896U, // <5,0,3,7>: Cost 4 vuzpr <3,5,7,0>, <1,3,5,7>
+ 2686976320U, // <5,0,3,u>: Cost 3 vext3 <0,3,u,5>, <0,3,u,5>
+ 2559459430U, // <5,0,4,0>: Cost 3 vext1 <1,5,0,4>, LHS
+ 1613381970U, // <5,0,4,1>: Cost 2 vext3 <0,4,1,5>, <0,4,1,5>
+ 2687123804U, // <5,0,4,2>: Cost 3 vext3 <0,4,1,5>, <0,4,2,6>
+ 3761013092U, // <5,0,4,3>: Cost 4 vext3 <0,4,3,5>, <0,4,3,5>
+ 2559462710U, // <5,0,4,4>: Cost 3 vext1 <1,5,0,4>, RHS
+ 2638187830U, // <5,0,4,5>: Cost 3 vext2 <3,4,5,0>, RHS
+ 3761234303U, // <5,0,4,6>: Cost 4 vext3 <0,4,6,5>, <0,4,6,5>
+ 2646150600U, // <5,0,4,7>: Cost 3 vext2 <4,7,5,0>, <4,7,5,0>
+ 1613381970U, // <5,0,4,u>: Cost 2 vext3 <0,4,1,5>, <0,4,1,5>
+ 3766763926U, // <5,0,5,0>: Cost 4 vext3 <1,4,0,5>, <0,5,0,1>
+ 2919268454U, // <5,0,5,1>: Cost 3 vzipl <5,5,5,5>, LHS
+ 3053486182U, // <5,0,5,2>: Cost 3 vtrnl <5,5,5,5>, LHS
+ 3723210589U, // <5,0,5,3>: Cost 4 vext2 <5,3,5,0>, <5,3,5,0>
+ 3766763966U, // <5,0,5,4>: Cost 4 vext3 <1,4,0,5>, <0,5,4,5>
+ 2650796031U, // <5,0,5,5>: Cost 3 vext2 <5,5,5,0>, <5,5,5,0>
+ 3719893090U, // <5,0,5,6>: Cost 4 vext2 <4,7,5,0>, <5,6,7,0>
+ 3914067254U, // <5,0,5,7>: Cost 4 vuzpr <3,5,7,0>, RHS
+ 2919269021U, // <5,0,5,u>: Cost 3 vzipl <5,5,5,5>, LHS
+ 4047519744U, // <5,0,6,0>: Cost 4 vzipr <3,4,5,6>, <0,0,0,0>
+ 2920038502U, // <5,0,6,1>: Cost 3 vzipl <5,6,7,0>, LHS
+ 3759759871U, // <5,0,6,2>: Cost 4 vext3 <0,2,4,5>, <0,6,2,7>
+ 3645164070U, // <5,0,6,3>: Cost 4 vext1 <3,5,0,6>, <3,5,0,6>
+ 3762414095U, // <5,0,6,4>: Cost 4 vext3 <0,6,4,5>, <0,6,4,5>
+ 3993780690U, // <5,0,6,5>: Cost 4 vzipl <5,6,7,0>, <0,5,6,7>
+ 3719893816U, // <5,0,6,6>: Cost 4 vext2 <4,7,5,0>, <6,6,6,6>
+ 2662077302U, // <5,0,6,7>: Cost 3 vext2 <7,4,5,0>, <6,7,4,5>
+ 2920039069U, // <5,0,6,u>: Cost 3 vzipl <5,6,7,0>, LHS
+ 2565455974U, // <5,0,7,0>: Cost 3 vext1 <2,5,0,7>, LHS
+ 2565456790U, // <5,0,7,1>: Cost 3 vext1 <2,5,0,7>, <1,2,3,0>
+ 2565457742U, // <5,0,7,2>: Cost 3 vext1 <2,5,0,7>, <2,5,0,7>
+ 3639199894U, // <5,0,7,3>: Cost 4 vext1 <2,5,0,7>, <3,0,1,2>
+ 2565459254U, // <5,0,7,4>: Cost 3 vext1 <2,5,0,7>, RHS
+ 2589347938U, // <5,0,7,5>: Cost 3 vext1 <6,5,0,7>, <5,6,7,0>
+ 2589348530U, // <5,0,7,6>: Cost 3 vext1 <6,5,0,7>, <6,5,0,7>
+ 4188456422U, // <5,0,7,7>: Cost 4 vtrnr RHS, <2,0,5,7>
+ 2565461806U, // <5,0,7,u>: Cost 3 vext1 <2,5,0,7>, LHS
+ 2687124106U, // <5,0,u,0>: Cost 3 vext3 <0,4,1,5>, <0,u,0,2>
+ 1616036502U, // <5,0,u,1>: Cost 2 vext3 <0,u,1,5>, <0,u,1,5>
+ 1613382301U, // <5,0,u,2>: Cost 2 vext3 <0,4,1,5>, LHS
+ 2689925800U, // <5,0,u,3>: Cost 3 vext3 <0,u,3,5>, <0,u,3,5>
+ 2687124146U, // <5,0,u,4>: Cost 3 vext3 <0,4,1,5>, <0,u,4,6>
+ 2638190746U, // <5,0,u,5>: Cost 3 vext2 <3,4,5,0>, RHS
+ 2589356723U, // <5,0,u,6>: Cost 3 vext1 <6,5,0,u>, <6,5,0,u>
+ 2595280230U, // <5,0,u,7>: Cost 3 vext1 <7,5,0,2>, <7,4,5,6>
+ 1613382355U, // <5,0,u,u>: Cost 2 vext3 <0,4,1,5>, LHS
+ 2646818816U, // <5,1,0,0>: Cost 3 vext2 <4,u,5,1>, <0,0,0,0>
+ 1573077094U, // <5,1,0,1>: Cost 2 vext2 <4,u,5,1>, LHS
+ 2646818980U, // <5,1,0,2>: Cost 3 vext2 <4,u,5,1>, <0,2,0,2>
+ 2687124214U, // <5,1,0,3>: Cost 3 vext3 <0,4,1,5>, <1,0,3,2>
+ 2641510738U, // <5,1,0,4>: Cost 3 vext2 <4,0,5,1>, <0,4,1,5>
+ 2641510814U, // <5,1,0,5>: Cost 3 vext2 <4,0,5,1>, <0,5,1,0>
+ 3720561142U, // <5,1,0,6>: Cost 4 vext2 <4,u,5,1>, <0,6,1,7>
+ 3298141357U, // <5,1,0,7>: Cost 4 vrev <1,5,7,0>
+ 1573077661U, // <5,1,0,u>: Cost 2 vext2 <4,u,5,1>, LHS
+ 2223891567U, // <5,1,1,0>: Cost 3 vrev <1,5,0,1>
+ 2687124276U, // <5,1,1,1>: Cost 3 vext3 <0,4,1,5>, <1,1,1,1>
+ 2646819734U, // <5,1,1,2>: Cost 3 vext2 <4,u,5,1>, <1,2,3,0>
+ 2687124296U, // <5,1,1,3>: Cost 3 vext3 <0,4,1,5>, <1,1,3,3>
+ 2691326803U, // <5,1,1,4>: Cost 3 vext3 <1,1,4,5>, <1,1,4,5>
+ 2691400540U, // <5,1,1,5>: Cost 3 vext3 <1,1,5,5>, <1,1,5,5>
+ 3765216101U, // <5,1,1,6>: Cost 4 vext3 <1,1,6,5>, <1,1,6,5>
+ 3765289838U, // <5,1,1,7>: Cost 4 vext3 <1,1,7,5>, <1,1,7,5>
+ 2687124341U, // <5,1,1,u>: Cost 3 vext3 <0,4,1,5>, <1,1,u,3>
+ 3297641584U, // <5,1,2,0>: Cost 4 vrev <1,5,0,2>
+ 3763520391U, // <5,1,2,1>: Cost 4 vext3 <0,u,1,5>, <1,2,1,3>
+ 2646820456U, // <5,1,2,2>: Cost 3 vext2 <4,u,5,1>, <2,2,2,2>
+ 2687124374U, // <5,1,2,3>: Cost 3 vext3 <0,4,1,5>, <1,2,3,0>
+ 2691990436U, // <5,1,2,4>: Cost 3 vext3 <1,2,4,5>, <1,2,4,5>
+ 2687124395U, // <5,1,2,5>: Cost 3 vext3 <0,4,1,5>, <1,2,5,3>
+ 2646820794U, // <5,1,2,6>: Cost 3 vext2 <4,u,5,1>, <2,6,3,7>
+ 3808199610U, // <5,1,2,7>: Cost 4 vext3 <u,3,4,5>, <1,2,7,0>
+ 2687124419U, // <5,1,2,u>: Cost 3 vext3 <0,4,1,5>, <1,2,u,0>
+ 2577440870U, // <5,1,3,0>: Cost 3 vext1 <4,5,1,3>, LHS
+ 2687124440U, // <5,1,3,1>: Cost 3 vext3 <0,4,1,5>, <1,3,1,3>
+ 3759686627U, // <5,1,3,2>: Cost 4 vext3 <0,2,3,5>, <1,3,2,5>
+ 2692580332U, // <5,1,3,3>: Cost 3 vext3 <1,3,3,5>, <1,3,3,5>
+ 2687124469U, // <5,1,3,4>: Cost 3 vext3 <0,4,1,5>, <1,3,4,5>
+ 2685207552U, // <5,1,3,5>: Cost 3 vext3 <0,1,2,5>, <1,3,5,7>
+ 3760866313U, // <5,1,3,6>: Cost 4 vext3 <0,4,1,5>, <1,3,6,7>
+ 2692875280U, // <5,1,3,7>: Cost 3 vext3 <1,3,7,5>, <1,3,7,5>
+ 2687124503U, // <5,1,3,u>: Cost 3 vext3 <0,4,1,5>, <1,3,u,3>
+ 1567771538U, // <5,1,4,0>: Cost 2 vext2 <4,0,5,1>, <4,0,5,1>
+ 2693096491U, // <5,1,4,1>: Cost 3 vext3 <1,4,1,5>, <1,4,1,5>
+ 2693170228U, // <5,1,4,2>: Cost 3 vext3 <1,4,2,5>, <1,4,2,5>
+ 2687124541U, // <5,1,4,3>: Cost 3 vext3 <0,4,1,5>, <1,4,3,5>
+ 2646822096U, // <5,1,4,4>: Cost 3 vext2 <4,u,5,1>, <4,4,4,4>
+ 1573080374U, // <5,1,4,5>: Cost 2 vext2 <4,u,5,1>, RHS
+ 2646822260U, // <5,1,4,6>: Cost 3 vext2 <4,u,5,1>, <4,6,4,6>
+ 3298174129U, // <5,1,4,7>: Cost 4 vrev <1,5,7,4>
+ 1573080602U, // <5,1,4,u>: Cost 2 vext2 <4,u,5,1>, <4,u,5,1>
+ 2687124591U, // <5,1,5,0>: Cost 3 vext3 <0,4,1,5>, <1,5,0,1>
+ 2646822543U, // <5,1,5,1>: Cost 3 vext2 <4,u,5,1>, <5,1,0,1>
+ 3760866433U, // <5,1,5,2>: Cost 4 vext3 <0,4,1,5>, <1,5,2,1>
+ 2687124624U, // <5,1,5,3>: Cost 3 vext3 <0,4,1,5>, <1,5,3,7>
+ 2687124631U, // <5,1,5,4>: Cost 3 vext3 <0,4,1,5>, <1,5,4,5>
+ 2646822916U, // <5,1,5,5>: Cost 3 vext2 <4,u,5,1>, <5,5,5,5>
+ 2646823010U, // <5,1,5,6>: Cost 3 vext2 <4,u,5,1>, <5,6,7,0>
+ 2646823080U, // <5,1,5,7>: Cost 3 vext2 <4,u,5,1>, <5,7,5,7>
+ 2687124663U, // <5,1,5,u>: Cost 3 vext3 <0,4,1,5>, <1,5,u,1>
+ 2553577574U, // <5,1,6,0>: Cost 3 vext1 <0,5,1,6>, LHS
+ 3763520719U, // <5,1,6,1>: Cost 4 vext3 <0,u,1,5>, <1,6,1,7>
+ 2646823418U, // <5,1,6,2>: Cost 3 vext2 <4,u,5,1>, <6,2,7,3>
+ 3760866529U, // <5,1,6,3>: Cost 4 vext3 <0,4,1,5>, <1,6,3,7>
+ 2553580854U, // <5,1,6,4>: Cost 3 vext1 <0,5,1,6>, RHS
+ 2687124723U, // <5,1,6,5>: Cost 3 vext3 <0,4,1,5>, <1,6,5,7>
+ 2646823736U, // <5,1,6,6>: Cost 3 vext2 <4,u,5,1>, <6,6,6,6>
+ 2646823758U, // <5,1,6,7>: Cost 3 vext2 <4,u,5,1>, <6,7,0,1>
+ 2646823839U, // <5,1,6,u>: Cost 3 vext2 <4,u,5,1>, <6,u,0,1>
+ 2559557734U, // <5,1,7,0>: Cost 3 vext1 <1,5,1,7>, LHS
+ 2559558452U, // <5,1,7,1>: Cost 3 vext1 <1,5,1,7>, <1,1,1,1>
+ 2571503270U, // <5,1,7,2>: Cost 3 vext1 <3,5,1,7>, <2,3,0,1>
+ 2040971366U, // <5,1,7,3>: Cost 2 vtrnr RHS, LHS
+ 2559561014U, // <5,1,7,4>: Cost 3 vext1 <1,5,1,7>, RHS
+ 2595393232U, // <5,1,7,5>: Cost 3 vext1 <7,5,1,7>, <5,1,7,3>
+ 4188455035U, // <5,1,7,6>: Cost 4 vtrnr RHS, <0,1,4,6>
+ 2646824556U, // <5,1,7,7>: Cost 3 vext2 <4,u,5,1>, <7,7,7,7>
+ 2040971371U, // <5,1,7,u>: Cost 2 vtrnr RHS, LHS
+ 1591662326U, // <5,1,u,0>: Cost 2 vext2 <u,0,5,1>, <u,0,5,1>
+ 1573082926U, // <5,1,u,1>: Cost 2 vext2 <4,u,5,1>, LHS
+ 2695824760U, // <5,1,u,2>: Cost 3 vext3 <1,u,2,5>, <1,u,2,5>
+ 2040979558U, // <5,1,u,3>: Cost 2 vtrnr RHS, LHS
+ 2687124874U, // <5,1,u,4>: Cost 3 vext3 <0,4,1,5>, <1,u,4,5>
+ 1573083290U, // <5,1,u,5>: Cost 2 vext2 <4,u,5,1>, RHS
+ 2646825168U, // <5,1,u,6>: Cost 3 vext2 <4,u,5,1>, <u,6,3,7>
+ 2646825216U, // <5,1,u,7>: Cost 3 vext2 <4,u,5,1>, <u,7,0,1>
+ 2040979563U, // <5,1,u,u>: Cost 2 vtrnr RHS, LHS
+ 3702652928U, // <5,2,0,0>: Cost 4 vext2 <1,u,5,2>, <0,0,0,0>
+ 2628911206U, // <5,2,0,1>: Cost 3 vext2 <1,u,5,2>, LHS
+ 2641518756U, // <5,2,0,2>: Cost 3 vext2 <4,0,5,2>, <0,2,0,2>
+ 3759760847U, // <5,2,0,3>: Cost 4 vext3 <0,2,4,5>, <2,0,3,2>
+ 3760866775U, // <5,2,0,4>: Cost 4 vext3 <0,4,1,5>, <2,0,4,1>
+ 3759539680U, // <5,2,0,5>: Cost 4 vext3 <0,2,1,5>, <2,0,5,1>
+ 3760866796U, // <5,2,0,6>: Cost 4 vext3 <0,4,1,5>, <2,0,6,4>
+ 3304114054U, // <5,2,0,7>: Cost 4 vrev <2,5,7,0>
+ 2628911773U, // <5,2,0,u>: Cost 3 vext2 <1,u,5,2>, LHS
+ 2623603464U, // <5,2,1,0>: Cost 3 vext2 <1,0,5,2>, <1,0,5,2>
+ 3698008921U, // <5,2,1,1>: Cost 4 vext2 <1,1,5,2>, <1,1,5,2>
+ 3633325603U, // <5,2,1,2>: Cost 4 vext1 <1,5,2,1>, <2,1,3,5>
+ 2687125027U, // <5,2,1,3>: Cost 3 vext3 <0,4,1,5>, <2,1,3,5>
+ 3633327414U, // <5,2,1,4>: Cost 4 vext1 <1,5,2,1>, RHS
+ 3759539760U, // <5,2,1,5>: Cost 4 vext3 <0,2,1,5>, <2,1,5,0>
+ 3760866876U, // <5,2,1,6>: Cost 4 vext3 <0,4,1,5>, <2,1,6,3>
+ 3304122247U, // <5,2,1,7>: Cost 4 vrev <2,5,7,1>
+ 2687125072U, // <5,2,1,u>: Cost 3 vext3 <0,4,1,5>, <2,1,u,5>
+ 3633332326U, // <5,2,2,0>: Cost 4 vext1 <1,5,2,2>, LHS
+ 3759760992U, // <5,2,2,1>: Cost 4 vext3 <0,2,4,5>, <2,2,1,3>
+ 2687125096U, // <5,2,2,2>: Cost 3 vext3 <0,4,1,5>, <2,2,2,2>
+ 2687125106U, // <5,2,2,3>: Cost 3 vext3 <0,4,1,5>, <2,2,3,3>
+ 2697963133U, // <5,2,2,4>: Cost 3 vext3 <2,2,4,5>, <2,2,4,5>
+ 3759466120U, // <5,2,2,5>: Cost 4 vext3 <0,2,0,5>, <2,2,5,7>
+ 3760866960U, // <5,2,2,6>: Cost 4 vext3 <0,4,1,5>, <2,2,6,6>
+ 3771926168U, // <5,2,2,7>: Cost 4 vext3 <2,2,7,5>, <2,2,7,5>
+ 2687125151U, // <5,2,2,u>: Cost 3 vext3 <0,4,1,5>, <2,2,u,3>
+ 2687125158U, // <5,2,3,0>: Cost 3 vext3 <0,4,1,5>, <2,3,0,1>
+ 2698405555U, // <5,2,3,1>: Cost 3 vext3 <2,3,1,5>, <2,3,1,5>
+ 2577516238U, // <5,2,3,2>: Cost 3 vext1 <4,5,2,3>, <2,3,4,5>
+ 3759687365U, // <5,2,3,3>: Cost 4 vext3 <0,2,3,5>, <2,3,3,5>
+ 1624884942U, // <5,2,3,4>: Cost 2 vext3 <2,3,4,5>, <2,3,4,5>
+ 2698700503U, // <5,2,3,5>: Cost 3 vext3 <2,3,5,5>, <2,3,5,5>
+ 3772368608U, // <5,2,3,6>: Cost 4 vext3 <2,3,4,5>, <2,3,6,5>
+ 3702655716U, // <5,2,3,7>: Cost 4 vext2 <1,u,5,2>, <3,7,3,7>
+ 1625179890U, // <5,2,3,u>: Cost 2 vext3 <2,3,u,5>, <2,3,u,5>
+ 2641521555U, // <5,2,4,0>: Cost 3 vext2 <4,0,5,2>, <4,0,5,2>
+ 3772368642U, // <5,2,4,1>: Cost 4 vext3 <2,3,4,5>, <2,4,1,3>
+ 2699142925U, // <5,2,4,2>: Cost 3 vext3 <2,4,2,5>, <2,4,2,5>
+ 2698626838U, // <5,2,4,3>: Cost 3 vext3 <2,3,4,5>, <2,4,3,5>
+ 2698626848U, // <5,2,4,4>: Cost 3 vext3 <2,3,4,5>, <2,4,4,6>
+ 2628914486U, // <5,2,4,5>: Cost 3 vext2 <1,u,5,2>, RHS
+ 2645503353U, // <5,2,4,6>: Cost 3 vext2 <4,6,5,2>, <4,6,5,2>
+ 3304146826U, // <5,2,4,7>: Cost 4 vrev <2,5,7,4>
+ 2628914729U, // <5,2,4,u>: Cost 3 vext2 <1,u,5,2>, RHS
+ 2553643110U, // <5,2,5,0>: Cost 3 vext1 <0,5,2,5>, LHS
+ 3758950227U, // <5,2,5,1>: Cost 4 vext3 <0,1,2,5>, <2,5,1,3>
+ 3759761248U, // <5,2,5,2>: Cost 4 vext3 <0,2,4,5>, <2,5,2,7>
+ 2982396006U, // <5,2,5,3>: Cost 3 vzipr <4,u,5,5>, LHS
+ 2553646390U, // <5,2,5,4>: Cost 3 vext1 <0,5,2,5>, RHS
+ 2553647108U, // <5,2,5,5>: Cost 3 vext1 <0,5,2,5>, <5,5,5,5>
+ 3760867204U, // <5,2,5,6>: Cost 4 vext3 <0,4,1,5>, <2,5,6,7>
+ 3702657141U, // <5,2,5,7>: Cost 4 vext2 <1,u,5,2>, <5,7,0,1>
+ 2982396011U, // <5,2,5,u>: Cost 3 vzipr <4,u,5,5>, LHS
+ 3627393126U, // <5,2,6,0>: Cost 4 vext1 <0,5,2,6>, LHS
+ 3760867236U, // <5,2,6,1>: Cost 4 vext3 <0,4,1,5>, <2,6,1,3>
+ 2645504506U, // <5,2,6,2>: Cost 3 vext2 <4,6,5,2>, <6,2,7,3>
+ 2687125434U, // <5,2,6,3>: Cost 3 vext3 <0,4,1,5>, <2,6,3,7>
+ 2700617665U, // <5,2,6,4>: Cost 3 vext3 <2,6,4,5>, <2,6,4,5>
+ 3760867276U, // <5,2,6,5>: Cost 4 vext3 <0,4,1,5>, <2,6,5,7>
+ 3763521493U, // <5,2,6,6>: Cost 4 vext3 <0,u,1,5>, <2,6,6,7>
+ 3719246670U, // <5,2,6,7>: Cost 4 vext2 <4,6,5,2>, <6,7,0,1>
+ 2687125479U, // <5,2,6,u>: Cost 3 vext3 <0,4,1,5>, <2,6,u,7>
+ 2565603430U, // <5,2,7,0>: Cost 3 vext1 <2,5,2,7>, LHS
+ 2553660150U, // <5,2,7,1>: Cost 3 vext1 <0,5,2,7>, <1,0,3,2>
+ 2565605216U, // <5,2,7,2>: Cost 3 vext1 <2,5,2,7>, <2,5,2,7>
+ 2961178726U, // <5,2,7,3>: Cost 3 vzipr <1,3,5,7>, LHS
+ 2565606710U, // <5,2,7,4>: Cost 3 vext1 <2,5,2,7>, RHS
+ 4034920552U, // <5,2,7,5>: Cost 4 vzipr <1,3,5,7>, <0,1,2,5>
+ 3114713292U, // <5,2,7,6>: Cost 3 vtrnr RHS, <0,2,4,6>
+ 3702658668U, // <5,2,7,7>: Cost 4 vext2 <1,u,5,2>, <7,7,7,7>
+ 2961178731U, // <5,2,7,u>: Cost 3 vzipr <1,3,5,7>, LHS
+ 2687125563U, // <5,2,u,0>: Cost 3 vext3 <0,4,1,5>, <2,u,0,1>
+ 2628917038U, // <5,2,u,1>: Cost 3 vext2 <1,u,5,2>, LHS
+ 2565613409U, // <5,2,u,2>: Cost 3 vext1 <2,5,2,u>, <2,5,2,u>
+ 2687125592U, // <5,2,u,3>: Cost 3 vext3 <0,4,1,5>, <2,u,3,3>
+ 1628203107U, // <5,2,u,4>: Cost 2 vext3 <2,u,4,5>, <2,u,4,5>
+ 2628917402U, // <5,2,u,5>: Cost 3 vext2 <1,u,5,2>, RHS
+ 2702092405U, // <5,2,u,6>: Cost 3 vext3 <2,u,6,5>, <2,u,6,5>
+ 3304179598U, // <5,2,u,7>: Cost 4 vrev <2,5,7,u>
+ 1628498055U, // <5,2,u,u>: Cost 2 vext3 <2,u,u,5>, <2,u,u,5>
+ 3760867467U, // <5,3,0,0>: Cost 4 vext3 <0,4,1,5>, <3,0,0,0>
+ 2687125654U, // <5,3,0,1>: Cost 3 vext3 <0,4,1,5>, <3,0,1,2>
+ 3759761565U, // <5,3,0,2>: Cost 4 vext3 <0,2,4,5>, <3,0,2,0>
+ 3633391766U, // <5,3,0,3>: Cost 4 vext1 <1,5,3,0>, <3,0,1,2>
+ 2687125680U, // <5,3,0,4>: Cost 3 vext3 <0,4,1,5>, <3,0,4,1>
+ 3760277690U, // <5,3,0,5>: Cost 4 vext3 <0,3,2,5>, <3,0,5,2>
+ 3310013014U, // <5,3,0,6>: Cost 4 vrev <3,5,6,0>
+ 2236344927U, // <5,3,0,7>: Cost 3 vrev <3,5,7,0>
+ 2687125717U, // <5,3,0,u>: Cost 3 vext3 <0,4,1,5>, <3,0,u,2>
+ 3760867551U, // <5,3,1,0>: Cost 4 vext3 <0,4,1,5>, <3,1,0,3>
+ 3760867558U, // <5,3,1,1>: Cost 4 vext3 <0,4,1,5>, <3,1,1,1>
+ 2624938923U, // <5,3,1,2>: Cost 3 vext2 <1,2,5,3>, <1,2,5,3>
+ 2703198460U, // <5,3,1,3>: Cost 3 vext3 <3,1,3,5>, <3,1,3,5>
+ 3760867587U, // <5,3,1,4>: Cost 4 vext3 <0,4,1,5>, <3,1,4,3>
+ 2636219536U, // <5,3,1,5>: Cost 3 vext2 <3,1,5,3>, <1,5,3,7>
+ 3698681075U, // <5,3,1,6>: Cost 4 vext2 <1,2,5,3>, <1,6,5,7>
+ 2703493408U, // <5,3,1,7>: Cost 3 vext3 <3,1,7,5>, <3,1,7,5>
+ 2628920721U, // <5,3,1,u>: Cost 3 vext2 <1,u,5,3>, <1,u,5,3>
+ 3766765870U, // <5,3,2,0>: Cost 4 vext3 <1,4,0,5>, <3,2,0,1>
+ 3698681379U, // <5,3,2,1>: Cost 4 vext2 <1,2,5,3>, <2,1,3,5>
+ 3760867649U, // <5,3,2,2>: Cost 4 vext3 <0,4,1,5>, <3,2,2,2>
+ 2698627404U, // <5,3,2,3>: Cost 3 vext3 <2,3,4,5>, <3,2,3,4>
+ 2703935830U, // <5,3,2,4>: Cost 3 vext3 <3,2,4,5>, <3,2,4,5>
+ 2698627422U, // <5,3,2,5>: Cost 3 vext3 <2,3,4,5>, <3,2,5,4>
+ 3760867686U, // <5,3,2,6>: Cost 4 vext3 <0,4,1,5>, <3,2,6,3>
+ 3769788783U, // <5,3,2,7>: Cost 4 vext3 <1,u,5,5>, <3,2,7,3>
+ 2701945209U, // <5,3,2,u>: Cost 3 vext3 <2,u,4,5>, <3,2,u,4>
+ 3760867711U, // <5,3,3,0>: Cost 4 vext3 <0,4,1,5>, <3,3,0,1>
+ 2636220684U, // <5,3,3,1>: Cost 3 vext2 <3,1,5,3>, <3,1,5,3>
+ 3772369298U, // <5,3,3,2>: Cost 4 vext3 <2,3,4,5>, <3,3,2,2>
+ 2687125916U, // <5,3,3,3>: Cost 3 vext3 <0,4,1,5>, <3,3,3,3>
+ 2704599463U, // <5,3,3,4>: Cost 3 vext3 <3,3,4,5>, <3,3,4,5>
+ 2704673200U, // <5,3,3,5>: Cost 3 vext3 <3,3,5,5>, <3,3,5,5>
+ 3709962935U, // <5,3,3,6>: Cost 4 vext2 <3,1,5,3>, <3,6,7,7>
+ 3772369346U, // <5,3,3,7>: Cost 4 vext3 <2,3,4,5>, <3,3,7,5>
+ 2704894411U, // <5,3,3,u>: Cost 3 vext3 <3,3,u,5>, <3,3,u,5>
+ 2704968148U, // <5,3,4,0>: Cost 3 vext3 <3,4,0,5>, <3,4,0,5>
+ 3698682850U, // <5,3,4,1>: Cost 4 vext2 <1,2,5,3>, <4,1,5,0>
+ 2642857014U, // <5,3,4,2>: Cost 3 vext2 <4,2,5,3>, <4,2,5,3>
+ 2705189359U, // <5,3,4,3>: Cost 3 vext3 <3,4,3,5>, <3,4,3,5>
+ 2705263096U, // <5,3,4,4>: Cost 3 vext3 <3,4,4,5>, <3,4,4,5>
+ 2685946370U, // <5,3,4,5>: Cost 3 vext3 <0,2,3,5>, <3,4,5,6>
+ 3779152394U, // <5,3,4,6>: Cost 4 vext3 <3,4,6,5>, <3,4,6,5>
+ 2236377699U, // <5,3,4,7>: Cost 3 vrev <3,5,7,4>
+ 2687126045U, // <5,3,4,u>: Cost 3 vext3 <0,4,1,5>, <3,4,u,6>
+ 2571632742U, // <5,3,5,0>: Cost 3 vext1 <3,5,3,5>, LHS
+ 2559689870U, // <5,3,5,1>: Cost 3 vext1 <1,5,3,5>, <1,5,3,5>
+ 2571634382U, // <5,3,5,2>: Cost 3 vext1 <3,5,3,5>, <2,3,4,5>
+ 2571635264U, // <5,3,5,3>: Cost 3 vext1 <3,5,3,5>, <3,5,3,5>
+ 2571636022U, // <5,3,5,4>: Cost 3 vext1 <3,5,3,5>, RHS
+ 2559692804U, // <5,3,5,5>: Cost 3 vext1 <1,5,3,5>, <5,5,5,5>
+ 3720581218U, // <5,3,5,6>: Cost 4 vext2 <4,u,5,3>, <5,6,7,0>
+ 2236385892U, // <5,3,5,7>: Cost 3 vrev <3,5,7,5>
+ 2571638574U, // <5,3,5,u>: Cost 3 vext1 <3,5,3,5>, LHS
+ 2565668966U, // <5,3,6,0>: Cost 3 vext1 <2,5,3,6>, LHS
+ 3633439887U, // <5,3,6,1>: Cost 4 vext1 <1,5,3,6>, <1,5,3,6>
+ 2565670760U, // <5,3,6,2>: Cost 3 vext1 <2,5,3,6>, <2,5,3,6>
+ 2565671426U, // <5,3,6,3>: Cost 3 vext1 <2,5,3,6>, <3,4,5,6>
+ 2565672246U, // <5,3,6,4>: Cost 3 vext1 <2,5,3,6>, RHS
+ 3639414630U, // <5,3,6,5>: Cost 4 vext1 <2,5,3,6>, <5,3,6,0>
+ 4047521640U, // <5,3,6,6>: Cost 4 vzipr <3,4,5,6>, <2,5,3,6>
+ 2725169844U, // <5,3,6,7>: Cost 3 vext3 <6,7,4,5>, <3,6,7,4>
+ 2565674798U, // <5,3,6,u>: Cost 3 vext1 <2,5,3,6>, LHS
+ 1485963366U, // <5,3,7,0>: Cost 2 vext1 <1,5,3,7>, LHS
+ 1485964432U, // <5,3,7,1>: Cost 2 vext1 <1,5,3,7>, <1,5,3,7>
+ 2559706728U, // <5,3,7,2>: Cost 3 vext1 <1,5,3,7>, <2,2,2,2>
+ 2559707286U, // <5,3,7,3>: Cost 3 vext1 <1,5,3,7>, <3,0,1,2>
+ 1485966646U, // <5,3,7,4>: Cost 2 vext1 <1,5,3,7>, RHS
+ 2559708880U, // <5,3,7,5>: Cost 3 vext1 <1,5,3,7>, <5,1,7,3>
+ 2601513466U, // <5,3,7,6>: Cost 3 vext1 <u,5,3,7>, <6,2,7,3>
+ 3114714112U, // <5,3,7,7>: Cost 3 vtrnr RHS, <1,3,5,7>
+ 1485969198U, // <5,3,7,u>: Cost 2 vext1 <1,5,3,7>, LHS
+ 1485971558U, // <5,3,u,0>: Cost 2 vext1 <1,5,3,u>, LHS
+ 1485972625U, // <5,3,u,1>: Cost 2 vext1 <1,5,3,u>, <1,5,3,u>
+ 2559714920U, // <5,3,u,2>: Cost 3 vext1 <1,5,3,u>, <2,2,2,2>
+ 2559715478U, // <5,3,u,3>: Cost 3 vext1 <1,5,3,u>, <3,0,1,2>
+ 1485974838U, // <5,3,u,4>: Cost 2 vext1 <1,5,3,u>, RHS
+ 2687126342U, // <5,3,u,5>: Cost 3 vext3 <0,4,1,5>, <3,u,5,6>
+ 2601521658U, // <5,3,u,6>: Cost 3 vext1 <u,5,3,u>, <6,2,7,3>
+ 2236410471U, // <5,3,u,7>: Cost 3 vrev <3,5,7,u>
+ 1485977390U, // <5,3,u,u>: Cost 2 vext1 <1,5,3,u>, LHS
+ 3627491430U, // <5,4,0,0>: Cost 4 vext1 <0,5,4,0>, LHS
+ 2636890214U, // <5,4,0,1>: Cost 3 vext2 <3,2,5,4>, LHS
+ 3703333028U, // <5,4,0,2>: Cost 4 vext2 <2,0,5,4>, <0,2,0,2>
+ 3782249348U, // <5,4,0,3>: Cost 4 vext3 <4,0,3,5>, <4,0,3,5>
+ 2642198866U, // <5,4,0,4>: Cost 3 vext2 <4,1,5,4>, <0,4,1,5>
+ 2687126418U, // <5,4,0,5>: Cost 3 vext3 <0,4,1,5>, <4,0,5,1>
+ 2242243887U, // <5,4,0,6>: Cost 3 vrev <4,5,6,0>
+ 3316059448U, // <5,4,0,7>: Cost 4 vrev <4,5,7,0>
+ 2636890781U, // <5,4,0,u>: Cost 3 vext2 <3,2,5,4>, LHS
+ 2241809658U, // <5,4,1,0>: Cost 3 vrev <4,5,0,1>
+ 3698025307U, // <5,4,1,1>: Cost 4 vext2 <1,1,5,4>, <1,1,5,4>
+ 3698688940U, // <5,4,1,2>: Cost 4 vext2 <1,2,5,4>, <1,2,5,4>
+ 3698689024U, // <5,4,1,3>: Cost 4 vext2 <1,2,5,4>, <1,3,5,7>
+ 3700016206U, // <5,4,1,4>: Cost 4 vext2 <1,4,5,4>, <1,4,5,4>
+ 2687126498U, // <5,4,1,5>: Cost 3 vext3 <0,4,1,5>, <4,1,5,0>
+ 3760868336U, // <5,4,1,6>: Cost 4 vext3 <0,4,1,5>, <4,1,6,5>
+ 3316067641U, // <5,4,1,7>: Cost 4 vrev <4,5,7,1>
+ 2242399554U, // <5,4,1,u>: Cost 3 vrev <4,5,u,1>
+ 3703334371U, // <5,4,2,0>: Cost 4 vext2 <2,0,5,4>, <2,0,5,4>
+ 3703998004U, // <5,4,2,1>: Cost 4 vext2 <2,1,5,4>, <2,1,5,4>
+ 3704661637U, // <5,4,2,2>: Cost 4 vext2 <2,2,5,4>, <2,2,5,4>
+ 2636891854U, // <5,4,2,3>: Cost 3 vext2 <3,2,5,4>, <2,3,4,5>
+ 3705988903U, // <5,4,2,4>: Cost 4 vext2 <2,4,5,4>, <2,4,5,4>
+ 2698628150U, // <5,4,2,5>: Cost 3 vext3 <2,3,4,5>, <4,2,5,3>
+ 3760868415U, // <5,4,2,6>: Cost 4 vext3 <0,4,1,5>, <4,2,6,3>
+ 3783871562U, // <5,4,2,7>: Cost 4 vext3 <4,2,7,5>, <4,2,7,5>
+ 2666752099U, // <5,4,2,u>: Cost 3 vext2 <u,2,5,4>, <2,u,4,5>
+ 3639459942U, // <5,4,3,0>: Cost 4 vext1 <2,5,4,3>, LHS
+ 3709970701U, // <5,4,3,1>: Cost 4 vext2 <3,1,5,4>, <3,1,5,4>
+ 2636892510U, // <5,4,3,2>: Cost 3 vext2 <3,2,5,4>, <3,2,5,4>
+ 3710634396U, // <5,4,3,3>: Cost 4 vext2 <3,2,5,4>, <3,3,3,3>
+ 2638219776U, // <5,4,3,4>: Cost 3 vext2 <3,4,5,4>, <3,4,5,4>
+ 3766987908U, // <5,4,3,5>: Cost 4 vext3 <1,4,3,5>, <4,3,5,0>
+ 2710719634U, // <5,4,3,6>: Cost 3 vext3 <4,3,6,5>, <4,3,6,5>
+ 3914097664U, // <5,4,3,7>: Cost 4 vuzpr <3,5,7,4>, <1,3,5,7>
+ 2640874308U, // <5,4,3,u>: Cost 3 vext2 <3,u,5,4>, <3,u,5,4>
+ 2583642214U, // <5,4,4,0>: Cost 3 vext1 <5,5,4,4>, LHS
+ 2642201574U, // <5,4,4,1>: Cost 3 vext2 <4,1,5,4>, <4,1,5,4>
+ 3710635062U, // <5,4,4,2>: Cost 4 vext2 <3,2,5,4>, <4,2,5,3>
+ 3717270664U, // <5,4,4,3>: Cost 4 vext2 <4,3,5,4>, <4,3,5,4>
+ 2713963728U, // <5,4,4,4>: Cost 3 vext3 <4,u,5,5>, <4,4,4,4>
+ 1637567706U, // <5,4,4,5>: Cost 2 vext3 <4,4,5,5>, <4,4,5,5>
+ 2242276659U, // <5,4,4,6>: Cost 3 vrev <4,5,6,4>
+ 2646183372U, // <5,4,4,7>: Cost 3 vext2 <4,7,5,4>, <4,7,5,4>
+ 1637788917U, // <5,4,4,u>: Cost 2 vext3 <4,4,u,5>, <4,4,u,5>
+ 2559762534U, // <5,4,5,0>: Cost 3 vext1 <1,5,4,5>, LHS
+ 2559763607U, // <5,4,5,1>: Cost 3 vext1 <1,5,4,5>, <1,5,4,5>
+ 2698628366U, // <5,4,5,2>: Cost 3 vext3 <2,3,4,5>, <4,5,2,3>
+ 3633506454U, // <5,4,5,3>: Cost 4 vext1 <1,5,4,5>, <3,0,1,2>
+ 2559765814U, // <5,4,5,4>: Cost 3 vext1 <1,5,4,5>, RHS
+ 2583654395U, // <5,4,5,5>: Cost 3 vext1 <5,5,4,5>, <5,5,4,5>
+ 1613385014U, // <5,4,5,6>: Cost 2 vext3 <0,4,1,5>, RHS
+ 3901639990U, // <5,4,5,7>: Cost 4 vuzpr <1,5,0,4>, RHS
+ 1613385032U, // <5,4,5,u>: Cost 2 vext3 <0,4,1,5>, RHS
+ 2559770726U, // <5,4,6,0>: Cost 3 vext1 <1,5,4,6>, LHS
+ 2559771648U, // <5,4,6,1>: Cost 3 vext1 <1,5,4,6>, <1,3,5,7>
+ 3633514088U, // <5,4,6,2>: Cost 4 vext1 <1,5,4,6>, <2,2,2,2>
+ 2571717122U, // <5,4,6,3>: Cost 3 vext1 <3,5,4,6>, <3,4,5,6>
+ 2559774006U, // <5,4,6,4>: Cost 3 vext1 <1,5,4,6>, RHS
+ 2712636796U, // <5,4,6,5>: Cost 3 vext3 <4,6,5,5>, <4,6,5,5>
+ 3760868743U, // <5,4,6,6>: Cost 4 vext3 <0,4,1,5>, <4,6,6,7>
+ 2712784270U, // <5,4,6,7>: Cost 3 vext3 <4,6,7,5>, <4,6,7,5>
+ 2559776558U, // <5,4,6,u>: Cost 3 vext1 <1,5,4,6>, LHS
+ 2565750886U, // <5,4,7,0>: Cost 3 vext1 <2,5,4,7>, LHS
+ 2565751706U, // <5,4,7,1>: Cost 3 vext1 <2,5,4,7>, <1,2,3,4>
+ 2565752690U, // <5,4,7,2>: Cost 3 vext1 <2,5,4,7>, <2,5,4,7>
+ 2571725387U, // <5,4,7,3>: Cost 3 vext1 <3,5,4,7>, <3,5,4,7>
+ 2565754166U, // <5,4,7,4>: Cost 3 vext1 <2,5,4,7>, RHS
+ 3114713426U, // <5,4,7,5>: Cost 3 vtrnr RHS, <0,4,1,5>
+ 94817590U, // <5,4,7,6>: Cost 1 vrev RHS
+ 2595616175U, // <5,4,7,7>: Cost 3 vext1 <7,5,4,7>, <7,5,4,7>
+ 94965064U, // <5,4,7,u>: Cost 1 vrev RHS
+ 2559787110U, // <5,4,u,0>: Cost 3 vext1 <1,5,4,u>, LHS
+ 2559788186U, // <5,4,u,1>: Cost 3 vext1 <1,5,4,u>, <1,5,4,u>
+ 2242014483U, // <5,4,u,2>: Cost 3 vrev <4,5,2,u>
+ 2667419628U, // <5,4,u,3>: Cost 3 vext2 <u,3,5,4>, <u,3,5,4>
+ 2559790390U, // <5,4,u,4>: Cost 3 vext1 <1,5,4,u>, RHS
+ 1640222238U, // <5,4,u,5>: Cost 2 vext3 <4,u,5,5>, <4,u,5,5>
+ 94825783U, // <5,4,u,6>: Cost 1 vrev RHS
+ 2714111536U, // <5,4,u,7>: Cost 3 vext3 <4,u,7,5>, <4,u,7,5>
+ 94973257U, // <5,4,u,u>: Cost 1 vrev RHS
+ 2646851584U, // <5,5,0,0>: Cost 3 vext2 <4,u,5,5>, <0,0,0,0>
+ 1573109862U, // <5,5,0,1>: Cost 2 vext2 <4,u,5,5>, LHS
+ 2646851748U, // <5,5,0,2>: Cost 3 vext2 <4,u,5,5>, <0,2,0,2>
+ 3760279130U, // <5,5,0,3>: Cost 4 vext3 <0,3,2,5>, <5,0,3,2>
+ 2687127138U, // <5,5,0,4>: Cost 3 vext3 <0,4,1,5>, <5,0,4,1>
+ 2248142847U, // <5,5,0,5>: Cost 3 vrev <5,5,5,0>
+ 3720593910U, // <5,5,0,6>: Cost 4 vext2 <4,u,5,5>, <0,6,1,7>
+ 4182502710U, // <5,5,0,7>: Cost 4 vtrnr <3,5,7,0>, RHS
+ 1573110429U, // <5,5,0,u>: Cost 2 vext2 <4,u,5,5>, LHS
+ 2646852342U, // <5,5,1,0>: Cost 3 vext2 <4,u,5,5>, <1,0,3,2>
+ 2624291676U, // <5,5,1,1>: Cost 3 vext2 <1,1,5,5>, <1,1,5,5>
+ 2646852502U, // <5,5,1,2>: Cost 3 vext2 <4,u,5,5>, <1,2,3,0>
+ 2646852568U, // <5,5,1,3>: Cost 3 vext2 <4,u,5,5>, <1,3,1,3>
+ 2715217591U, // <5,5,1,4>: Cost 3 vext3 <5,1,4,5>, <5,1,4,5>
+ 2628936848U, // <5,5,1,5>: Cost 3 vext2 <1,u,5,5>, <1,5,3,7>
+ 3698033907U, // <5,5,1,6>: Cost 4 vext2 <1,1,5,5>, <1,6,5,7>
+ 2713964240U, // <5,5,1,7>: Cost 3 vext3 <4,u,5,5>, <5,1,7,3>
+ 2628937107U, // <5,5,1,u>: Cost 3 vext2 <1,u,5,5>, <1,u,5,5>
+ 3645497446U, // <5,5,2,0>: Cost 4 vext1 <3,5,5,2>, LHS
+ 3760869099U, // <5,5,2,1>: Cost 4 vext3 <0,4,1,5>, <5,2,1,3>
+ 2646853224U, // <5,5,2,2>: Cost 3 vext2 <4,u,5,5>, <2,2,2,2>
+ 2698628862U, // <5,5,2,3>: Cost 3 vext3 <2,3,4,5>, <5,2,3,4>
+ 3772370694U, // <5,5,2,4>: Cost 4 vext3 <2,3,4,5>, <5,2,4,3>
+ 2713964303U, // <5,5,2,5>: Cost 3 vext3 <4,u,5,5>, <5,2,5,3>
+ 2646853562U, // <5,5,2,6>: Cost 3 vext2 <4,u,5,5>, <2,6,3,7>
+ 4038198272U, // <5,5,2,7>: Cost 4 vzipr <1,u,5,2>, <1,3,5,7>
+ 2701946667U, // <5,5,2,u>: Cost 3 vext3 <2,u,4,5>, <5,2,u,4>
+ 2646853782U, // <5,5,3,0>: Cost 3 vext2 <4,u,5,5>, <3,0,1,2>
+ 3698034922U, // <5,5,3,1>: Cost 4 vext2 <1,1,5,5>, <3,1,1,5>
+ 3702679919U, // <5,5,3,2>: Cost 4 vext2 <1,u,5,5>, <3,2,7,3>
+ 2637564336U, // <5,5,3,3>: Cost 3 vext2 <3,3,5,5>, <3,3,5,5>
+ 2646854146U, // <5,5,3,4>: Cost 3 vext2 <4,u,5,5>, <3,4,5,6>
+ 2638891602U, // <5,5,3,5>: Cost 3 vext2 <3,5,5,5>, <3,5,5,5>
+ 3702680247U, // <5,5,3,6>: Cost 4 vext2 <1,u,5,5>, <3,6,7,7>
+ 3702680259U, // <5,5,3,7>: Cost 4 vext2 <1,u,5,5>, <3,7,0,1>
+ 2646854430U, // <5,5,3,u>: Cost 3 vext2 <4,u,5,5>, <3,u,1,2>
+ 2646854546U, // <5,5,4,0>: Cost 3 vext2 <4,u,5,5>, <4,0,5,1>
+ 2642209767U, // <5,5,4,1>: Cost 3 vext2 <4,1,5,5>, <4,1,5,5>
+ 3711306806U, // <5,5,4,2>: Cost 4 vext2 <3,3,5,5>, <4,2,5,3>
+ 3645516369U, // <5,5,4,3>: Cost 4 vext1 <3,5,5,4>, <3,5,5,4>
+ 1570458842U, // <5,5,4,4>: Cost 2 vext2 <4,4,5,5>, <4,4,5,5>
+ 1573113142U, // <5,5,4,5>: Cost 2 vext2 <4,u,5,5>, RHS
+ 2645527932U, // <5,5,4,6>: Cost 3 vext2 <4,6,5,5>, <4,6,5,5>
+ 2713964486U, // <5,5,4,7>: Cost 3 vext3 <4,u,5,5>, <5,4,7,6>
+ 1573113374U, // <5,5,4,u>: Cost 2 vext2 <4,u,5,5>, <4,u,5,5>
+ 1509982310U, // <5,5,5,0>: Cost 2 vext1 <5,5,5,5>, LHS
+ 2646855376U, // <5,5,5,1>: Cost 3 vext2 <4,u,5,5>, <5,1,7,3>
+ 2583725672U, // <5,5,5,2>: Cost 3 vext1 <5,5,5,5>, <2,2,2,2>
+ 2583726230U, // <5,5,5,3>: Cost 3 vext1 <5,5,5,5>, <3,0,1,2>
+ 1509985590U, // <5,5,5,4>: Cost 2 vext1 <5,5,5,5>, RHS
+ 229035318U, // <5,5,5,5>: Cost 1 vdup1 RHS
+ 2646855778U, // <5,5,5,6>: Cost 3 vext2 <4,u,5,5>, <5,6,7,0>
+ 2646855848U, // <5,5,5,7>: Cost 3 vext2 <4,u,5,5>, <5,7,5,7>
+ 229035318U, // <5,5,5,u>: Cost 1 vdup1 RHS
+ 2577760358U, // <5,5,6,0>: Cost 3 vext1 <4,5,5,6>, LHS
+ 3633587361U, // <5,5,6,1>: Cost 4 vext1 <1,5,5,6>, <1,5,5,6>
+ 2646856186U, // <5,5,6,2>: Cost 3 vext2 <4,u,5,5>, <6,2,7,3>
+ 3633588738U, // <5,5,6,3>: Cost 4 vext1 <1,5,5,6>, <3,4,5,6>
+ 2718535756U, // <5,5,6,4>: Cost 3 vext3 <5,6,4,5>, <5,6,4,5>
+ 2644202223U, // <5,5,6,5>: Cost 3 vext2 <4,4,5,5>, <6,5,7,5>
+ 2973780482U, // <5,5,6,6>: Cost 3 vzipr <3,4,5,6>, <3,4,5,6>
+ 2646856526U, // <5,5,6,7>: Cost 3 vext2 <4,u,5,5>, <6,7,0,1>
+ 2646856607U, // <5,5,6,u>: Cost 3 vext2 <4,u,5,5>, <6,u,0,1>
+ 2571796582U, // <5,5,7,0>: Cost 3 vext1 <3,5,5,7>, LHS
+ 3633595392U, // <5,5,7,1>: Cost 4 vext1 <1,5,5,7>, <1,3,5,7>
+ 2571798222U, // <5,5,7,2>: Cost 3 vext1 <3,5,5,7>, <2,3,4,5>
+ 2571799124U, // <5,5,7,3>: Cost 3 vext1 <3,5,5,7>, <3,5,5,7>
+ 2571799862U, // <5,5,7,4>: Cost 3 vext1 <3,5,5,7>, RHS
+ 3114717188U, // <5,5,7,5>: Cost 3 vtrnr RHS, <5,5,5,5>
+ 4034923010U, // <5,5,7,6>: Cost 4 vzipr <1,3,5,7>, <3,4,5,6>
+ 2040974646U, // <5,5,7,7>: Cost 2 vtrnr RHS, RHS
+ 2040974647U, // <5,5,7,u>: Cost 2 vtrnr RHS, RHS
+ 1509982310U, // <5,5,u,0>: Cost 2 vext1 <5,5,5,5>, LHS
+ 1573115694U, // <5,5,u,1>: Cost 2 vext2 <4,u,5,5>, LHS
+ 2571806414U, // <5,5,u,2>: Cost 3 vext1 <3,5,5,u>, <2,3,4,5>
+ 2571807317U, // <5,5,u,3>: Cost 3 vext1 <3,5,5,u>, <3,5,5,u>
+ 1509985590U, // <5,5,u,4>: Cost 2 vext1 <5,5,5,5>, RHS
+ 229035318U, // <5,5,u,5>: Cost 1 vdup1 RHS
+ 2646857936U, // <5,5,u,6>: Cost 3 vext2 <4,u,5,5>, <u,6,3,7>
+ 2040982838U, // <5,5,u,7>: Cost 2 vtrnr RHS, RHS
+ 229035318U, // <5,5,u,u>: Cost 1 vdup1 RHS
+ 2638233600U, // <5,6,0,0>: Cost 3 vext2 <3,4,5,6>, <0,0,0,0>
+ 1564491878U, // <5,6,0,1>: Cost 2 vext2 <3,4,5,6>, LHS
+ 2632261796U, // <5,6,0,2>: Cost 3 vext2 <2,4,5,6>, <0,2,0,2>
+ 2638233856U, // <5,6,0,3>: Cost 3 vext2 <3,4,5,6>, <0,3,1,4>
+ 2638233938U, // <5,6,0,4>: Cost 3 vext2 <3,4,5,6>, <0,4,1,5>
+ 3706003885U, // <5,6,0,5>: Cost 4 vext2 <2,4,5,6>, <0,5,2,6>
+ 3706003967U, // <5,6,0,6>: Cost 4 vext2 <2,4,5,6>, <0,6,2,7>
+ 4047473974U, // <5,6,0,7>: Cost 4 vzipr <3,4,5,0>, RHS
+ 1564492445U, // <5,6,0,u>: Cost 2 vext2 <3,4,5,6>, LHS
+ 2638234358U, // <5,6,1,0>: Cost 3 vext2 <3,4,5,6>, <1,0,3,2>
+ 2638234420U, // <5,6,1,1>: Cost 3 vext2 <3,4,5,6>, <1,1,1,1>
+ 2638234518U, // <5,6,1,2>: Cost 3 vext2 <3,4,5,6>, <1,2,3,0>
+ 2638234584U, // <5,6,1,3>: Cost 3 vext2 <3,4,5,6>, <1,3,1,3>
+ 2626290768U, // <5,6,1,4>: Cost 3 vext2 <1,4,5,6>, <1,4,5,6>
+ 2638234768U, // <5,6,1,5>: Cost 3 vext2 <3,4,5,6>, <1,5,3,7>
+ 3700032719U, // <5,6,1,6>: Cost 4 vext2 <1,4,5,6>, <1,6,1,7>
+ 2982366518U, // <5,6,1,7>: Cost 3 vzipr <4,u,5,1>, RHS
+ 2628945300U, // <5,6,1,u>: Cost 3 vext2 <1,u,5,6>, <1,u,5,6>
+ 3706004925U, // <5,6,2,0>: Cost 4 vext2 <2,4,5,6>, <2,0,1,2>
+ 3711976966U, // <5,6,2,1>: Cost 4 vext2 <3,4,5,6>, <2,1,0,3>
+ 2638235240U, // <5,6,2,2>: Cost 3 vext2 <3,4,5,6>, <2,2,2,2>
+ 2638235302U, // <5,6,2,3>: Cost 3 vext2 <3,4,5,6>, <2,3,0,1>
+ 2632263465U, // <5,6,2,4>: Cost 3 vext2 <2,4,5,6>, <2,4,5,6>
+ 2638235496U, // <5,6,2,5>: Cost 3 vext2 <3,4,5,6>, <2,5,3,6>
+ 2638235578U, // <5,6,2,6>: Cost 3 vext2 <3,4,5,6>, <2,6,3,7>
+ 2713965050U, // <5,6,2,7>: Cost 3 vext3 <4,u,5,5>, <6,2,7,3>
+ 2634917997U, // <5,6,2,u>: Cost 3 vext2 <2,u,5,6>, <2,u,5,6>
+ 2638235798U, // <5,6,3,0>: Cost 3 vext2 <3,4,5,6>, <3,0,1,2>
+ 3711977695U, // <5,6,3,1>: Cost 4 vext2 <3,4,5,6>, <3,1,0,3>
+ 3710650720U, // <5,6,3,2>: Cost 4 vext2 <3,2,5,6>, <3,2,5,6>
+ 2638236060U, // <5,6,3,3>: Cost 3 vext2 <3,4,5,6>, <3,3,3,3>
+ 1564494338U, // <5,6,3,4>: Cost 2 vext2 <3,4,5,6>, <3,4,5,6>
+ 2638236234U, // <5,6,3,5>: Cost 3 vext2 <3,4,5,6>, <3,5,4,6>
+ 3711978104U, // <5,6,3,6>: Cost 4 vext2 <3,4,5,6>, <3,6,0,7>
+ 4034227510U, // <5,6,3,7>: Cost 4 vzipr <1,2,5,3>, RHS
+ 1567148870U, // <5,6,3,u>: Cost 2 vext2 <3,u,5,6>, <3,u,5,6>
+ 2577817702U, // <5,6,4,0>: Cost 3 vext1 <4,5,6,4>, LHS
+ 3700034544U, // <5,6,4,1>: Cost 4 vext2 <1,4,5,6>, <4,1,6,5>
+ 2723033713U, // <5,6,4,2>: Cost 3 vext3 <6,4,2,5>, <6,4,2,5>
+ 2638236818U, // <5,6,4,3>: Cost 3 vext2 <3,4,5,6>, <4,3,6,5>
+ 2644208859U, // <5,6,4,4>: Cost 3 vext2 <4,4,5,6>, <4,4,5,6>
+ 1564495158U, // <5,6,4,5>: Cost 2 vext2 <3,4,5,6>, RHS
+ 2645536125U, // <5,6,4,6>: Cost 3 vext2 <4,6,5,6>, <4,6,5,6>
+ 2723402398U, // <5,6,4,7>: Cost 3 vext3 <6,4,7,5>, <6,4,7,5>
+ 1564495401U, // <5,6,4,u>: Cost 2 vext2 <3,4,5,6>, RHS
+ 2577825894U, // <5,6,5,0>: Cost 3 vext1 <4,5,6,5>, LHS
+ 2662125264U, // <5,6,5,1>: Cost 3 vext2 <7,4,5,6>, <5,1,7,3>
+ 3775836867U, // <5,6,5,2>: Cost 4 vext3 <2,u,6,5>, <6,5,2,6>
+ 3711979343U, // <5,6,5,3>: Cost 4 vext2 <3,4,5,6>, <5,3,3,4>
+ 2650181556U, // <5,6,5,4>: Cost 3 vext2 <5,4,5,6>, <5,4,5,6>
+ 2662125572U, // <5,6,5,5>: Cost 3 vext2 <7,4,5,6>, <5,5,5,5>
+ 2638237732U, // <5,6,5,6>: Cost 3 vext2 <3,4,5,6>, <5,6,0,1>
+ 2982399286U, // <5,6,5,7>: Cost 3 vzipr <4,u,5,5>, RHS
+ 2982399287U, // <5,6,5,u>: Cost 3 vzipr <4,u,5,5>, RHS
+ 2583806054U, // <5,6,6,0>: Cost 3 vext1 <5,5,6,6>, LHS
+ 3711979910U, // <5,6,6,1>: Cost 4 vext2 <3,4,5,6>, <6,1,3,4>
+ 2662126074U, // <5,6,6,2>: Cost 3 vext2 <7,4,5,6>, <6,2,7,3>
+ 2583808514U, // <5,6,6,3>: Cost 3 vext1 <5,5,6,6>, <3,4,5,6>
+ 2583809334U, // <5,6,6,4>: Cost 3 vext1 <5,5,6,6>, RHS
+ 2583810062U, // <5,6,6,5>: Cost 3 vext1 <5,5,6,6>, <5,5,6,6>
+ 2638238520U, // <5,6,6,6>: Cost 3 vext2 <3,4,5,6>, <6,6,6,6>
+ 2973781302U, // <5,6,6,7>: Cost 3 vzipr <3,4,5,6>, RHS
+ 2973781303U, // <5,6,6,u>: Cost 3 vzipr <3,4,5,6>, RHS
+ 430358630U, // <5,6,7,0>: Cost 1 vext1 RHS, LHS
+ 1504101110U, // <5,6,7,1>: Cost 2 vext1 RHS, <1,0,3,2>
+ 1504101992U, // <5,6,7,2>: Cost 2 vext1 RHS, <2,2,2,2>
+ 1504102550U, // <5,6,7,3>: Cost 2 vext1 RHS, <3,0,1,2>
+ 430361910U, // <5,6,7,4>: Cost 1 vext1 RHS, RHS
+ 1504104390U, // <5,6,7,5>: Cost 2 vext1 RHS, <5,4,7,6>
+ 1504105272U, // <5,6,7,6>: Cost 2 vext1 RHS, <6,6,6,6>
+ 1504106092U, // <5,6,7,7>: Cost 2 vext1 RHS, <7,7,7,7>
+ 430364462U, // <5,6,7,u>: Cost 1 vext1 RHS, LHS
+ 430366822U, // <5,6,u,0>: Cost 1 vext1 RHS, LHS
+ 1564497710U, // <5,6,u,1>: Cost 2 vext2 <3,4,5,6>, LHS
+ 1504110184U, // <5,6,u,2>: Cost 2 vext1 RHS, <2,2,2,2>
+ 1504110742U, // <5,6,u,3>: Cost 2 vext1 RHS, <3,0,1,2>
+ 430370103U, // <5,6,u,4>: Cost 1 vext1 RHS, RHS
+ 1564498074U, // <5,6,u,5>: Cost 2 vext2 <3,4,5,6>, RHS
+ 1504113146U, // <5,6,u,6>: Cost 2 vext1 RHS, <6,2,7,3>
+ 1504113658U, // <5,6,u,7>: Cost 2 vext1 RHS, <7,0,1,2>
+ 430372654U, // <5,6,u,u>: Cost 1 vext1 RHS, LHS
+ 2625634304U, // <5,7,0,0>: Cost 3 vext2 <1,3,5,7>, <0,0,0,0>
+ 1551892582U, // <5,7,0,1>: Cost 2 vext2 <1,3,5,7>, LHS
+ 2625634468U, // <5,7,0,2>: Cost 3 vext2 <1,3,5,7>, <0,2,0,2>
+ 2571889247U, // <5,7,0,3>: Cost 3 vext1 <3,5,7,0>, <3,5,7,0>
+ 2625634642U, // <5,7,0,4>: Cost 3 vext2 <1,3,5,7>, <0,4,1,5>
+ 2595778728U, // <5,7,0,5>: Cost 3 vext1 <7,5,7,0>, <5,7,5,7>
+ 3699376639U, // <5,7,0,6>: Cost 4 vext2 <1,3,5,7>, <0,6,2,7>
+ 2260235715U, // <5,7,0,7>: Cost 3 vrev <7,5,7,0>
+ 1551893149U, // <5,7,0,u>: Cost 2 vext2 <1,3,5,7>, LHS
+ 2625635062U, // <5,7,1,0>: Cost 3 vext2 <1,3,5,7>, <1,0,3,2>
+ 2624308020U, // <5,7,1,1>: Cost 3 vext2 <1,1,5,7>, <1,1,1,1>
+ 2625635222U, // <5,7,1,2>: Cost 3 vext2 <1,3,5,7>, <1,2,3,0>
+ 1551893504U, // <5,7,1,3>: Cost 2 vext2 <1,3,5,7>, <1,3,5,7>
+ 2571898166U, // <5,7,1,4>: Cost 3 vext1 <3,5,7,1>, RHS
+ 2625635472U, // <5,7,1,5>: Cost 3 vext2 <1,3,5,7>, <1,5,3,7>
+ 2627626227U, // <5,7,1,6>: Cost 3 vext2 <1,6,5,7>, <1,6,5,7>
+ 3702031684U, // <5,7,1,7>: Cost 4 vext2 <1,7,5,7>, <1,7,5,7>
+ 1555211669U, // <5,7,1,u>: Cost 2 vext2 <1,u,5,7>, <1,u,5,7>
+ 2629617126U, // <5,7,2,0>: Cost 3 vext2 <2,0,5,7>, <2,0,5,7>
+ 3699377670U, // <5,7,2,1>: Cost 4 vext2 <1,3,5,7>, <2,1,0,3>
+ 2625635944U, // <5,7,2,2>: Cost 3 vext2 <1,3,5,7>, <2,2,2,2>
+ 2625636006U, // <5,7,2,3>: Cost 3 vext2 <1,3,5,7>, <2,3,0,1>
+ 2632271658U, // <5,7,2,4>: Cost 3 vext2 <2,4,5,7>, <2,4,5,7>
+ 2625636201U, // <5,7,2,5>: Cost 3 vext2 <1,3,5,7>, <2,5,3,7>
+ 2625636282U, // <5,7,2,6>: Cost 3 vext2 <1,3,5,7>, <2,6,3,7>
+ 3708004381U, // <5,7,2,7>: Cost 4 vext2 <2,7,5,7>, <2,7,5,7>
+ 2625636411U, // <5,7,2,u>: Cost 3 vext2 <1,3,5,7>, <2,u,0,1>
+ 2625636502U, // <5,7,3,0>: Cost 3 vext2 <1,3,5,7>, <3,0,1,2>
+ 2625636604U, // <5,7,3,1>: Cost 3 vext2 <1,3,5,7>, <3,1,3,5>
+ 3699378478U, // <5,7,3,2>: Cost 4 vext2 <1,3,5,7>, <3,2,0,1>
+ 2625636764U, // <5,7,3,3>: Cost 3 vext2 <1,3,5,7>, <3,3,3,3>
+ 2625636866U, // <5,7,3,4>: Cost 3 vext2 <1,3,5,7>, <3,4,5,6>
+ 2625636959U, // <5,7,3,5>: Cost 3 vext2 <1,3,5,7>, <3,5,7,0>
+ 3699378808U, // <5,7,3,6>: Cost 4 vext2 <1,3,5,7>, <3,6,0,7>
+ 2640235254U, // <5,7,3,7>: Cost 3 vext2 <3,7,5,7>, <3,7,5,7>
+ 2625637150U, // <5,7,3,u>: Cost 3 vext2 <1,3,5,7>, <3,u,1,2>
+ 2571919462U, // <5,7,4,0>: Cost 3 vext1 <3,5,7,4>, LHS
+ 2571920384U, // <5,7,4,1>: Cost 3 vext1 <3,5,7,4>, <1,3,5,7>
+ 3699379260U, // <5,7,4,2>: Cost 4 vext2 <1,3,5,7>, <4,2,6,0>
+ 2571922019U, // <5,7,4,3>: Cost 3 vext1 <3,5,7,4>, <3,5,7,4>
+ 2571922742U, // <5,7,4,4>: Cost 3 vext1 <3,5,7,4>, RHS
+ 1551895862U, // <5,7,4,5>: Cost 2 vext2 <1,3,5,7>, RHS
+ 2846277980U, // <5,7,4,6>: Cost 3 vuzpr RHS, <0,4,2,6>
+ 2646207951U, // <5,7,4,7>: Cost 3 vext2 <4,7,5,7>, <4,7,5,7>
+ 1551896105U, // <5,7,4,u>: Cost 2 vext2 <1,3,5,7>, RHS
+ 2583871590U, // <5,7,5,0>: Cost 3 vext1 <5,5,7,5>, LHS
+ 2652180176U, // <5,7,5,1>: Cost 3 vext2 <5,7,5,7>, <5,1,7,3>
+ 2625638177U, // <5,7,5,2>: Cost 3 vext2 <1,3,5,7>, <5,2,7,3>
+ 2625638262U, // <5,7,5,3>: Cost 3 vext2 <1,3,5,7>, <5,3,7,7>
+ 2583874870U, // <5,7,5,4>: Cost 3 vext1 <5,5,7,5>, RHS
+ 2846281732U, // <5,7,5,5>: Cost 3 vuzpr RHS, <5,5,5,5>
+ 2651517015U, // <5,7,5,6>: Cost 3 vext2 <5,6,5,7>, <5,6,5,7>
+ 1772539190U, // <5,7,5,7>: Cost 2 vuzpr RHS, RHS
+ 1772539191U, // <5,7,5,u>: Cost 2 vuzpr RHS, RHS
+ 2846281826U, // <5,7,6,0>: Cost 3 vuzpr RHS, <5,6,7,0>
+ 3699380615U, // <5,7,6,1>: Cost 4 vext2 <1,3,5,7>, <6,1,3,5>
+ 2846281108U, // <5,7,6,2>: Cost 3 vuzpr RHS, <4,6,u,2>
+ 2589854210U, // <5,7,6,3>: Cost 3 vext1 <6,5,7,6>, <3,4,5,6>
+ 2846281830U, // <5,7,6,4>: Cost 3 vuzpr RHS, <5,6,7,4>
+ 2725467658U, // <5,7,6,5>: Cost 3 vext3 <6,7,u,5>, <7,6,5,u>
+ 2846281076U, // <5,7,6,6>: Cost 3 vuzpr RHS, <4,6,4,6>
+ 2846279610U, // <5,7,6,7>: Cost 3 vuzpr RHS, <2,6,3,7>
+ 2846279611U, // <5,7,6,u>: Cost 3 vuzpr RHS, <2,6,3,u>
+ 1510146150U, // <5,7,7,0>: Cost 2 vext1 <5,5,7,7>, LHS
+ 2846282574U, // <5,7,7,1>: Cost 3 vuzpr RHS, <6,7,0,1>
+ 2583889512U, // <5,7,7,2>: Cost 3 vext1 <5,5,7,7>, <2,2,2,2>
+ 2846281919U, // <5,7,7,3>: Cost 3 vuzpr RHS, <5,7,u,3>
+ 1510149430U, // <5,7,7,4>: Cost 2 vext1 <5,5,7,7>, RHS
+ 1510150168U, // <5,7,7,5>: Cost 2 vext1 <5,5,7,7>, <5,5,7,7>
+ 2583892474U, // <5,7,7,6>: Cost 3 vext1 <5,5,7,7>, <6,2,7,3>
+ 2625640044U, // <5,7,7,7>: Cost 3 vext2 <1,3,5,7>, <7,7,7,7>
+ 1510151982U, // <5,7,7,u>: Cost 2 vext1 <5,5,7,7>, LHS
+ 1510154342U, // <5,7,u,0>: Cost 2 vext1 <5,5,7,u>, LHS
+ 1551898414U, // <5,7,u,1>: Cost 2 vext2 <1,3,5,7>, LHS
+ 2625640325U, // <5,7,u,2>: Cost 3 vext2 <1,3,5,7>, <u,2,3,0>
+ 1772536477U, // <5,7,u,3>: Cost 2 vuzpr RHS, LHS
+ 1510157622U, // <5,7,u,4>: Cost 2 vext1 <5,5,7,u>, RHS
+ 1551898778U, // <5,7,u,5>: Cost 2 vext2 <1,3,5,7>, RHS
+ 2625640656U, // <5,7,u,6>: Cost 3 vext2 <1,3,5,7>, <u,6,3,7>
+ 1772539433U, // <5,7,u,7>: Cost 2 vuzpr RHS, RHS
+ 1551898981U, // <5,7,u,u>: Cost 2 vext2 <1,3,5,7>, LHS
+ 2625642496U, // <5,u,0,0>: Cost 3 vext2 <1,3,5,u>, <0,0,0,0>
+ 1551900774U, // <5,u,0,1>: Cost 2 vext2 <1,3,5,u>, LHS
+ 2625642660U, // <5,u,0,2>: Cost 3 vext2 <1,3,5,u>, <0,2,0,2>
+ 2698630885U, // <5,u,0,3>: Cost 3 vext3 <2,3,4,5>, <u,0,3,2>
+ 2687129325U, // <5,u,0,4>: Cost 3 vext3 <0,4,1,5>, <u,0,4,1>
+ 2689783542U, // <5,u,0,5>: Cost 3 vext3 <0,u,1,5>, <u,0,5,1>
+ 2266134675U, // <5,u,0,6>: Cost 3 vrev <u,5,6,0>
+ 2595853772U, // <5,u,0,7>: Cost 3 vext1 <7,5,u,0>, <7,5,u,0>
+ 1551901341U, // <5,u,0,u>: Cost 2 vext2 <1,3,5,u>, LHS
+ 2625643254U, // <5,u,1,0>: Cost 3 vext2 <1,3,5,u>, <1,0,3,2>
+ 2625643316U, // <5,u,1,1>: Cost 3 vext2 <1,3,5,u>, <1,1,1,1>
+ 1613387566U, // <5,u,1,2>: Cost 2 vext3 <0,4,1,5>, LHS
+ 1551901697U, // <5,u,1,3>: Cost 2 vext2 <1,3,5,u>, <1,3,5,u>
+ 2626307154U, // <5,u,1,4>: Cost 3 vext2 <1,4,5,u>, <1,4,5,u>
+ 2689783622U, // <5,u,1,5>: Cost 3 vext3 <0,u,1,5>, <u,1,5,0>
+ 2627634420U, // <5,u,1,6>: Cost 3 vext2 <1,6,5,u>, <1,6,5,u>
+ 2982366536U, // <5,u,1,7>: Cost 3 vzipr <4,u,5,1>, RHS
+ 1613387620U, // <5,u,1,u>: Cost 2 vext3 <0,4,1,5>, LHS
+ 2846286742U, // <5,u,2,0>: Cost 3 vuzpr RHS, <1,2,3,0>
+ 2685796528U, // <5,u,2,1>: Cost 3 vext3 <0,2,1,5>, <0,2,1,5>
+ 2625644136U, // <5,u,2,2>: Cost 3 vext2 <1,3,5,u>, <2,2,2,2>
+ 2687129480U, // <5,u,2,3>: Cost 3 vext3 <0,4,1,5>, <u,2,3,3>
+ 2632279851U, // <5,u,2,4>: Cost 3 vext2 <2,4,5,u>, <2,4,5,u>
+ 2625644394U, // <5,u,2,5>: Cost 3 vext2 <1,3,5,u>, <2,5,3,u>
+ 2625644474U, // <5,u,2,6>: Cost 3 vext2 <1,3,5,u>, <2,6,3,7>
+ 2713966508U, // <5,u,2,7>: Cost 3 vext3 <4,u,5,5>, <u,2,7,3>
+ 2625644603U, // <5,u,2,u>: Cost 3 vext2 <1,3,5,u>, <2,u,0,1>
+ 2687129532U, // <5,u,3,0>: Cost 3 vext3 <0,4,1,5>, <u,3,0,1>
+ 2636261649U, // <5,u,3,1>: Cost 3 vext2 <3,1,5,u>, <3,1,5,u>
+ 2636925282U, // <5,u,3,2>: Cost 3 vext2 <3,2,5,u>, <3,2,5,u>
+ 2625644956U, // <5,u,3,3>: Cost 3 vext2 <1,3,5,u>, <3,3,3,3>
+ 1564510724U, // <5,u,3,4>: Cost 2 vext2 <3,4,5,u>, <3,4,5,u>
+ 2625645160U, // <5,u,3,5>: Cost 3 vext2 <1,3,5,u>, <3,5,u,0>
+ 2734610422U, // <5,u,3,6>: Cost 3 vext3 <u,3,6,5>, <u,3,6,5>
+ 2640243447U, // <5,u,3,7>: Cost 3 vext2 <3,7,5,u>, <3,7,5,u>
+ 1567165256U, // <5,u,3,u>: Cost 2 vext2 <3,u,5,u>, <3,u,5,u>
+ 1567828889U, // <5,u,4,0>: Cost 2 vext2 <4,0,5,u>, <4,0,5,u>
+ 1661163546U, // <5,u,4,1>: Cost 2 vext3 <u,4,1,5>, <u,4,1,5>
+ 2734463012U, // <5,u,4,2>: Cost 3 vext3 <u,3,4,5>, <u,4,2,6>
+ 2698631212U, // <5,u,4,3>: Cost 3 vext3 <2,3,4,5>, <u,4,3,5>
+ 1570458842U, // <5,u,4,4>: Cost 2 vext2 <4,4,5,5>, <4,4,5,5>
+ 1551904054U, // <5,u,4,5>: Cost 2 vext2 <1,3,5,u>, RHS
+ 2846286172U, // <5,u,4,6>: Cost 3 vuzpr RHS, <0,4,2,6>
+ 2646216144U, // <5,u,4,7>: Cost 3 vext2 <4,7,5,u>, <4,7,5,u>
+ 1551904297U, // <5,u,4,u>: Cost 2 vext2 <1,3,5,u>, RHS
+ 1509982310U, // <5,u,5,0>: Cost 2 vext1 <5,5,5,5>, LHS
+ 2560058555U, // <5,u,5,1>: Cost 3 vext1 <1,5,u,5>, <1,5,u,5>
+ 2698926194U, // <5,u,5,2>: Cost 3 vext3 <2,3,u,5>, <u,5,2,3>
+ 2698631295U, // <5,u,5,3>: Cost 3 vext3 <2,3,4,5>, <u,5,3,7>
+ 1509985590U, // <5,u,5,4>: Cost 2 vext1 <5,5,5,5>, RHS
+ 229035318U, // <5,u,5,5>: Cost 1 vdup1 RHS
+ 1613387930U, // <5,u,5,6>: Cost 2 vext3 <0,4,1,5>, RHS
+ 1772547382U, // <5,u,5,7>: Cost 2 vuzpr RHS, RHS
+ 229035318U, // <5,u,5,u>: Cost 1 vdup1 RHS
+ 2566037606U, // <5,u,6,0>: Cost 3 vext1 <2,5,u,6>, LHS
+ 2920044334U, // <5,u,6,1>: Cost 3 vzipl <5,6,7,0>, LHS
+ 2566039445U, // <5,u,6,2>: Cost 3 vext1 <2,5,u,6>, <2,5,u,6>
+ 2687129808U, // <5,u,6,3>: Cost 3 vext3 <0,4,1,5>, <u,6,3,7>
+ 2566040886U, // <5,u,6,4>: Cost 3 vext1 <2,5,u,6>, RHS
+ 2920044698U, // <5,u,6,5>: Cost 3 vzipl <5,6,7,0>, RHS
+ 2846289268U, // <5,u,6,6>: Cost 3 vuzpr RHS, <4,6,4,6>
+ 2973781320U, // <5,u,6,7>: Cost 3 vzipr <3,4,5,6>, RHS
+ 2687129853U, // <5,u,6,u>: Cost 3 vext3 <0,4,1,5>, <u,6,u,7>
+ 430506086U, // <5,u,7,0>: Cost 1 vext1 RHS, LHS
+ 1486333117U, // <5,u,7,1>: Cost 2 vext1 <1,5,u,7>, <1,5,u,7>
+ 1504249448U, // <5,u,7,2>: Cost 2 vext1 RHS, <2,2,2,2>
+ 2040971933U, // <5,u,7,3>: Cost 2 vtrnr RHS, LHS
+ 430509384U, // <5,u,7,4>: Cost 1 vext1 RHS, RHS
+ 1504251600U, // <5,u,7,5>: Cost 2 vext1 RHS, <5,1,7,3>
+ 118708378U, // <5,u,7,6>: Cost 1 vrev RHS
+ 2040974889U, // <5,u,7,7>: Cost 2 vtrnr RHS, RHS
+ 430511918U, // <5,u,7,u>: Cost 1 vext1 RHS, LHS
+ 430514278U, // <5,u,u,0>: Cost 1 vext1 RHS, LHS
+ 1551906606U, // <5,u,u,1>: Cost 2 vext2 <1,3,5,u>, LHS
+ 1613388133U, // <5,u,u,2>: Cost 2 vext3 <0,4,1,5>, LHS
+ 1772544669U, // <5,u,u,3>: Cost 2 vuzpr RHS, LHS
+ 430517577U, // <5,u,u,4>: Cost 1 vext1 RHS, RHS
+ 229035318U, // <5,u,u,5>: Cost 1 vdup1 RHS
+ 118716571U, // <5,u,u,6>: Cost 1 vrev RHS
+ 1772547625U, // <5,u,u,7>: Cost 2 vuzpr RHS, RHS
+ 430520110U, // <5,u,u,u>: Cost 1 vext1 RHS, LHS
+ 2686025728U, // <6,0,0,0>: Cost 3 vext3 <0,2,4,6>, <0,0,0,0>
+ 2686025738U, // <6,0,0,1>: Cost 3 vext3 <0,2,4,6>, <0,0,1,1>
+ 2686025748U, // <6,0,0,2>: Cost 3 vext3 <0,2,4,6>, <0,0,2,2>
+ 3779084320U, // <6,0,0,3>: Cost 4 vext3 <3,4,5,6>, <0,0,3,5>
+ 2642903388U, // <6,0,0,4>: Cost 3 vext2 <4,2,6,0>, <0,4,2,6>
+ 3657723939U, // <6,0,0,5>: Cost 4 vext1 <5,6,0,0>, <5,6,0,0>
+ 3926676514U, // <6,0,0,6>: Cost 4 vuzpr <5,6,7,0>, <7,0,5,6>
+ 3926675786U, // <6,0,0,7>: Cost 4 vuzpr <5,6,7,0>, <6,0,5,7>
+ 2686025802U, // <6,0,0,u>: Cost 3 vext3 <0,2,4,6>, <0,0,u,2>
+ 2566070374U, // <6,0,1,0>: Cost 3 vext1 <2,6,0,1>, LHS
+ 3759767642U, // <6,0,1,1>: Cost 4 vext3 <0,2,4,6>, <0,1,1,0>
+ 1612284006U, // <6,0,1,2>: Cost 2 vext3 <0,2,4,6>, LHS
+ 2583988738U, // <6,0,1,3>: Cost 3 vext1 <5,6,0,1>, <3,4,5,6>
+ 2566073654U, // <6,0,1,4>: Cost 3 vext1 <2,6,0,1>, RHS
+ 2583990308U, // <6,0,1,5>: Cost 3 vext1 <5,6,0,1>, <5,6,0,1>
+ 2589963005U, // <6,0,1,6>: Cost 3 vext1 <6,6,0,1>, <6,6,0,1>
+ 2595935702U, // <6,0,1,7>: Cost 3 vext1 <7,6,0,1>, <7,6,0,1>
+ 1612284060U, // <6,0,1,u>: Cost 2 vext3 <0,2,4,6>, LHS
+ 2686025892U, // <6,0,2,0>: Cost 3 vext3 <0,2,4,6>, <0,2,0,2>
+ 2685804721U, // <6,0,2,1>: Cost 3 vext3 <0,2,1,6>, <0,2,1,6>
+ 3759620282U, // <6,0,2,2>: Cost 4 vext3 <0,2,2,6>, <0,2,2,6>
+ 2705342658U, // <6,0,2,3>: Cost 3 vext3 <3,4,5,6>, <0,2,3,5>
+ 1612284108U, // <6,0,2,4>: Cost 2 vext3 <0,2,4,6>, <0,2,4,6>
+ 3706029956U, // <6,0,2,5>: Cost 4 vext2 <2,4,6,0>, <2,5,6,7>
+ 2686173406U, // <6,0,2,6>: Cost 3 vext3 <0,2,6,6>, <0,2,6,6>
+ 3651769338U, // <6,0,2,7>: Cost 4 vext1 <4,6,0,2>, <7,0,1,2>
+ 1612579056U, // <6,0,2,u>: Cost 2 vext3 <0,2,u,6>, <0,2,u,6>
+ 3706030230U, // <6,0,3,0>: Cost 4 vext2 <2,4,6,0>, <3,0,1,2>
+ 2705342720U, // <6,0,3,1>: Cost 3 vext3 <3,4,5,6>, <0,3,1,4>
+ 2705342730U, // <6,0,3,2>: Cost 3 vext3 <3,4,5,6>, <0,3,2,5>
+ 3706030492U, // <6,0,3,3>: Cost 4 vext2 <2,4,6,0>, <3,3,3,3>
+ 2644896258U, // <6,0,3,4>: Cost 3 vext2 <4,5,6,0>, <3,4,5,6>
+ 3718638154U, // <6,0,3,5>: Cost 4 vext2 <4,5,6,0>, <3,5,4,6>
+ 3729918619U, // <6,0,3,6>: Cost 4 vext2 <6,4,6,0>, <3,6,4,6>
+ 3926672384U, // <6,0,3,7>: Cost 4 vuzpr <5,6,7,0>, <1,3,5,7>
+ 2705342784U, // <6,0,3,u>: Cost 3 vext3 <3,4,5,6>, <0,3,u,5>
+ 2687058250U, // <6,0,4,0>: Cost 3 vext3 <0,4,0,6>, <0,4,0,6>
+ 2686026066U, // <6,0,4,1>: Cost 3 vext3 <0,2,4,6>, <0,4,1,5>
+ 1613463900U, // <6,0,4,2>: Cost 2 vext3 <0,4,2,6>, <0,4,2,6>
+ 3761021285U, // <6,0,4,3>: Cost 4 vext3 <0,4,3,6>, <0,4,3,6>
+ 2687353198U, // <6,0,4,4>: Cost 3 vext3 <0,4,4,6>, <0,4,4,6>
+ 2632289590U, // <6,0,4,5>: Cost 3 vext2 <2,4,6,0>, RHS
+ 2645560704U, // <6,0,4,6>: Cost 3 vext2 <4,6,6,0>, <4,6,6,0>
+ 2646224337U, // <6,0,4,7>: Cost 3 vext2 <4,7,6,0>, <4,7,6,0>
+ 1613906322U, // <6,0,4,u>: Cost 2 vext3 <0,4,u,6>, <0,4,u,6>
+ 3651788902U, // <6,0,5,0>: Cost 4 vext1 <4,6,0,5>, LHS
+ 2687795620U, // <6,0,5,1>: Cost 3 vext3 <0,5,1,6>, <0,5,1,6>
+ 3761611181U, // <6,0,5,2>: Cost 4 vext3 <0,5,2,6>, <0,5,2,6>
+ 3723284326U, // <6,0,5,3>: Cost 4 vext2 <5,3,6,0>, <5,3,6,0>
+ 2646224838U, // <6,0,5,4>: Cost 3 vext2 <4,7,6,0>, <5,4,7,6>
+ 3718639630U, // <6,0,5,5>: Cost 4 vext2 <4,5,6,0>, <5,5,6,6>
+ 2652196962U, // <6,0,5,6>: Cost 3 vext2 <5,7,6,0>, <5,6,7,0>
+ 2852932918U, // <6,0,5,7>: Cost 3 vuzpr <5,6,7,0>, RHS
+ 2852932919U, // <6,0,5,u>: Cost 3 vuzpr <5,6,7,0>, RHS
+ 2852933730U, // <6,0,6,0>: Cost 3 vuzpr <5,6,7,0>, <5,6,7,0>
+ 2925985894U, // <6,0,6,1>: Cost 3 vzipl <6,6,6,6>, LHS
+ 3060203622U, // <6,0,6,2>: Cost 3 vtrnl <6,6,6,6>, LHS
+ 3718640178U, // <6,0,6,3>: Cost 4 vext2 <4,5,6,0>, <6,3,4,5>
+ 2656178832U, // <6,0,6,4>: Cost 3 vext2 <6,4,6,0>, <6,4,6,0>
+ 3725939378U, // <6,0,6,5>: Cost 4 vext2 <5,7,6,0>, <6,5,0,7>
+ 2657506098U, // <6,0,6,6>: Cost 3 vext2 <6,6,6,0>, <6,6,6,0>
+ 2619020110U, // <6,0,6,7>: Cost 3 vext2 <0,2,6,0>, <6,7,0,1>
+ 2925986461U, // <6,0,6,u>: Cost 3 vzipl <6,6,6,6>, LHS
+ 2572091494U, // <6,0,7,0>: Cost 3 vext1 <3,6,0,7>, LHS
+ 2572092310U, // <6,0,7,1>: Cost 3 vext1 <3,6,0,7>, <1,2,3,0>
+ 2980495524U, // <6,0,7,2>: Cost 3 vzipr RHS, <0,2,0,2>
+ 2572094072U, // <6,0,7,3>: Cost 3 vext1 <3,6,0,7>, <3,6,0,7>
+ 2572094774U, // <6,0,7,4>: Cost 3 vext1 <3,6,0,7>, RHS
+ 4054238242U, // <6,0,7,5>: Cost 4 vzipr RHS, <1,4,0,5>
+ 3645837653U, // <6,0,7,6>: Cost 4 vext1 <3,6,0,7>, <6,0,7,0>
+ 4054239054U, // <6,0,7,7>: Cost 4 vzipr RHS, <2,5,0,7>
+ 2572097326U, // <6,0,7,u>: Cost 3 vext1 <3,6,0,7>, LHS
+ 2686026378U, // <6,0,u,0>: Cost 3 vext3 <0,2,4,6>, <0,u,0,2>
+ 2686026386U, // <6,0,u,1>: Cost 3 vext3 <0,2,4,6>, <0,u,1,1>
+ 1612284573U, // <6,0,u,2>: Cost 2 vext3 <0,2,4,6>, LHS
+ 2705343144U, // <6,0,u,3>: Cost 3 vext3 <3,4,5,6>, <0,u,3,5>
+ 1616265906U, // <6,0,u,4>: Cost 2 vext3 <0,u,4,6>, <0,u,4,6>
+ 2632292506U, // <6,0,u,5>: Cost 3 vext2 <2,4,6,0>, RHS
+ 2590020356U, // <6,0,u,6>: Cost 3 vext1 <6,6,0,u>, <6,6,0,u>
+ 2852933161U, // <6,0,u,7>: Cost 3 vuzpr <5,6,7,0>, RHS
+ 1612284627U, // <6,0,u,u>: Cost 2 vext3 <0,2,4,6>, LHS
+ 2595995750U, // <6,1,0,0>: Cost 3 vext1 <7,6,1,0>, LHS
+ 2646229094U, // <6,1,0,1>: Cost 3 vext2 <4,7,6,1>, LHS
+ 3694092492U, // <6,1,0,2>: Cost 4 vext2 <0,4,6,1>, <0,2,4,6>
+ 2686026486U, // <6,1,0,3>: Cost 3 vext3 <0,2,4,6>, <1,0,3,2>
+ 2595999030U, // <6,1,0,4>: Cost 3 vext1 <7,6,1,0>, RHS
+ 3767730952U, // <6,1,0,5>: Cost 4 vext3 <1,5,4,6>, <1,0,5,2>
+ 2596000590U, // <6,1,0,6>: Cost 3 vext1 <7,6,1,0>, <6,7,0,1>
+ 2596001246U, // <6,1,0,7>: Cost 3 vext1 <7,6,1,0>, <7,6,1,0>
+ 2686026531U, // <6,1,0,u>: Cost 3 vext3 <0,2,4,6>, <1,0,u,2>
+ 3763602219U, // <6,1,1,0>: Cost 4 vext3 <0,u,2,6>, <1,1,0,1>
+ 2686026548U, // <6,1,1,1>: Cost 3 vext3 <0,2,4,6>, <1,1,1,1>
+ 3764929346U, // <6,1,1,2>: Cost 4 vext3 <1,1,2,6>, <1,1,2,6>
+ 2686026568U, // <6,1,1,3>: Cost 3 vext3 <0,2,4,6>, <1,1,3,3>
+ 2691334996U, // <6,1,1,4>: Cost 3 vext3 <1,1,4,6>, <1,1,4,6>
+ 3760874332U, // <6,1,1,5>: Cost 4 vext3 <0,4,1,6>, <1,1,5,5>
+ 3765224294U, // <6,1,1,6>: Cost 4 vext3 <1,1,6,6>, <1,1,6,6>
+ 3669751263U, // <6,1,1,7>: Cost 4 vext1 <7,6,1,1>, <7,6,1,1>
+ 2686026613U, // <6,1,1,u>: Cost 3 vext3 <0,2,4,6>, <1,1,u,3>
+ 2554208358U, // <6,1,2,0>: Cost 3 vext1 <0,6,1,2>, LHS
+ 3763602311U, // <6,1,2,1>: Cost 4 vext3 <0,u,2,6>, <1,2,1,3>
+ 3639895971U, // <6,1,2,2>: Cost 4 vext1 <2,6,1,2>, <2,6,1,2>
+ 2686026646U, // <6,1,2,3>: Cost 3 vext3 <0,2,4,6>, <1,2,3,0>
+ 2554211638U, // <6,1,2,4>: Cost 3 vext1 <0,6,1,2>, RHS
+ 3760874411U, // <6,1,2,5>: Cost 4 vext3 <0,4,1,6>, <1,2,5,3>
+ 2554212858U, // <6,1,2,6>: Cost 3 vext1 <0,6,1,2>, <6,2,7,3>
+ 3802973114U, // <6,1,2,7>: Cost 4 vext3 <7,4,5,6>, <1,2,7,0>
+ 2686026691U, // <6,1,2,u>: Cost 3 vext3 <0,2,4,6>, <1,2,u,0>
+ 2566160486U, // <6,1,3,0>: Cost 3 vext1 <2,6,1,3>, LHS
+ 2686026712U, // <6,1,3,1>: Cost 3 vext3 <0,2,4,6>, <1,3,1,3>
+ 2686026724U, // <6,1,3,2>: Cost 3 vext3 <0,2,4,6>, <1,3,2,6>
+ 3759768552U, // <6,1,3,3>: Cost 4 vext3 <0,2,4,6>, <1,3,3,1>
+ 2692662262U, // <6,1,3,4>: Cost 3 vext3 <1,3,4,6>, <1,3,4,6>
+ 2686026752U, // <6,1,3,5>: Cost 3 vext3 <0,2,4,6>, <1,3,5,7>
+ 2590053128U, // <6,1,3,6>: Cost 3 vext1 <6,6,1,3>, <6,6,1,3>
+ 3663795194U, // <6,1,3,7>: Cost 4 vext1 <6,6,1,3>, <7,0,1,2>
+ 2686026775U, // <6,1,3,u>: Cost 3 vext3 <0,2,4,6>, <1,3,u,3>
+ 2641587099U, // <6,1,4,0>: Cost 3 vext2 <4,0,6,1>, <4,0,6,1>
+ 2693104684U, // <6,1,4,1>: Cost 3 vext3 <1,4,1,6>, <1,4,1,6>
+ 3639912357U, // <6,1,4,2>: Cost 4 vext1 <2,6,1,4>, <2,6,1,4>
+ 2687206462U, // <6,1,4,3>: Cost 3 vext3 <0,4,2,6>, <1,4,3,6>
+ 3633941814U, // <6,1,4,4>: Cost 4 vext1 <1,6,1,4>, RHS
+ 2693399632U, // <6,1,4,5>: Cost 3 vext3 <1,4,5,6>, <1,4,5,6>
+ 3765077075U, // <6,1,4,6>: Cost 4 vext3 <1,1,4,6>, <1,4,6,0>
+ 2646232530U, // <6,1,4,7>: Cost 3 vext2 <4,7,6,1>, <4,7,6,1>
+ 2687206507U, // <6,1,4,u>: Cost 3 vext3 <0,4,2,6>, <1,4,u,6>
+ 2647559796U, // <6,1,5,0>: Cost 3 vext2 <5,0,6,1>, <5,0,6,1>
+ 3765077118U, // <6,1,5,1>: Cost 4 vext3 <1,1,4,6>, <1,5,1,7>
+ 3767583878U, // <6,1,5,2>: Cost 4 vext3 <1,5,2,6>, <1,5,2,6>
+ 2686026896U, // <6,1,5,3>: Cost 3 vext3 <0,2,4,6>, <1,5,3,7>
+ 2693989528U, // <6,1,5,4>: Cost 3 vext3 <1,5,4,6>, <1,5,4,6>
+ 3767805089U, // <6,1,5,5>: Cost 4 vext3 <1,5,5,6>, <1,5,5,6>
+ 2652868706U, // <6,1,5,6>: Cost 3 vext2 <5,u,6,1>, <5,6,7,0>
+ 3908250934U, // <6,1,5,7>: Cost 4 vuzpr <2,6,0,1>, RHS
+ 2686026941U, // <6,1,5,u>: Cost 3 vext3 <0,2,4,6>, <1,5,u,7>
+ 2554241126U, // <6,1,6,0>: Cost 3 vext1 <0,6,1,6>, LHS
+ 3763602639U, // <6,1,6,1>: Cost 4 vext3 <0,u,2,6>, <1,6,1,7>
+ 3759547607U, // <6,1,6,2>: Cost 4 vext3 <0,2,1,6>, <1,6,2,6>
+ 3115221094U, // <6,1,6,3>: Cost 3 vtrnr <4,6,4,6>, LHS
+ 2554244406U, // <6,1,6,4>: Cost 3 vext1 <0,6,1,6>, RHS
+ 3760874739U, // <6,1,6,5>: Cost 4 vext3 <0,4,1,6>, <1,6,5,7>
+ 2554245944U, // <6,1,6,6>: Cost 3 vext1 <0,6,1,6>, <6,6,6,6>
+ 3719975758U, // <6,1,6,7>: Cost 4 vext2 <4,7,6,1>, <6,7,0,1>
+ 3115221099U, // <6,1,6,u>: Cost 3 vtrnr <4,6,4,6>, LHS
+ 2560221286U, // <6,1,7,0>: Cost 3 vext1 <1,6,1,7>, LHS
+ 2560222415U, // <6,1,7,1>: Cost 3 vext1 <1,6,1,7>, <1,6,1,7>
+ 2980497558U, // <6,1,7,2>: Cost 3 vzipr RHS, <3,0,1,2>
+ 3103211622U, // <6,1,7,3>: Cost 3 vtrnr <2,6,3,7>, LHS
+ 2560224566U, // <6,1,7,4>: Cost 3 vext1 <1,6,1,7>, RHS
+ 2980495698U, // <6,1,7,5>: Cost 3 vzipr RHS, <0,4,1,5>
+ 3633967526U, // <6,1,7,6>: Cost 4 vext1 <1,6,1,7>, <6,1,7,0>
+ 4054237686U, // <6,1,7,7>: Cost 4 vzipr RHS, <0,6,1,7>
+ 2560227118U, // <6,1,7,u>: Cost 3 vext1 <1,6,1,7>, LHS
+ 2560229478U, // <6,1,u,0>: Cost 3 vext1 <1,6,1,u>, LHS
+ 2686027117U, // <6,1,u,1>: Cost 3 vext3 <0,2,4,6>, <1,u,1,3>
+ 2686027129U, // <6,1,u,2>: Cost 3 vext3 <0,2,4,6>, <1,u,2,6>
+ 2686027132U, // <6,1,u,3>: Cost 3 vext3 <0,2,4,6>, <1,u,3,0>
+ 2687206795U, // <6,1,u,4>: Cost 3 vext3 <0,4,2,6>, <1,u,4,6>
+ 2686027157U, // <6,1,u,5>: Cost 3 vext3 <0,2,4,6>, <1,u,5,7>
+ 2590094093U, // <6,1,u,6>: Cost 3 vext1 <6,6,1,u>, <6,6,1,u>
+ 2596066790U, // <6,1,u,7>: Cost 3 vext1 <7,6,1,u>, <7,6,1,u>
+ 2686027177U, // <6,1,u,u>: Cost 3 vext3 <0,2,4,6>, <1,u,u,0>
+ 2646900736U, // <6,2,0,0>: Cost 3 vext2 <4,u,6,2>, <0,0,0,0>
+ 1573159014U, // <6,2,0,1>: Cost 2 vext2 <4,u,6,2>, LHS
+ 2646900900U, // <6,2,0,2>: Cost 3 vext2 <4,u,6,2>, <0,2,0,2>
+ 3759769037U, // <6,2,0,3>: Cost 4 vext3 <0,2,4,6>, <2,0,3,0>
+ 2641592668U, // <6,2,0,4>: Cost 3 vext2 <4,0,6,2>, <0,4,2,6>
+ 3779085794U, // <6,2,0,5>: Cost 4 vext3 <3,4,5,6>, <2,0,5,3>
+ 2686027244U, // <6,2,0,6>: Cost 3 vext3 <0,2,4,6>, <2,0,6,4>
+ 3669816807U, // <6,2,0,7>: Cost 4 vext1 <7,6,2,0>, <7,6,2,0>
+ 1573159581U, // <6,2,0,u>: Cost 2 vext2 <4,u,6,2>, LHS
+ 2230527897U, // <6,2,1,0>: Cost 3 vrev <2,6,0,1>
+ 2646901556U, // <6,2,1,1>: Cost 3 vext2 <4,u,6,2>, <1,1,1,1>
+ 2646901654U, // <6,2,1,2>: Cost 3 vext2 <4,u,6,2>, <1,2,3,0>
+ 2847047782U, // <6,2,1,3>: Cost 3 vuzpr <4,6,u,2>, LHS
+ 3771049517U, // <6,2,1,4>: Cost 4 vext3 <2,1,4,6>, <2,1,4,6>
+ 2646901904U, // <6,2,1,5>: Cost 3 vext2 <4,u,6,2>, <1,5,3,7>
+ 2686027324U, // <6,2,1,6>: Cost 3 vext3 <0,2,4,6>, <2,1,6,3>
+ 3669825000U, // <6,2,1,7>: Cost 4 vext1 <7,6,2,1>, <7,6,2,1>
+ 2231117793U, // <6,2,1,u>: Cost 3 vrev <2,6,u,1>
+ 3763603029U, // <6,2,2,0>: Cost 4 vext3 <0,u,2,6>, <2,2,0,1>
+ 3759769184U, // <6,2,2,1>: Cost 4 vext3 <0,2,4,6>, <2,2,1,3>
+ 2686027368U, // <6,2,2,2>: Cost 3 vext3 <0,2,4,6>, <2,2,2,2>
+ 2686027378U, // <6,2,2,3>: Cost 3 vext3 <0,2,4,6>, <2,2,3,3>
+ 2697971326U, // <6,2,2,4>: Cost 3 vext3 <2,2,4,6>, <2,2,4,6>
+ 3759769224U, // <6,2,2,5>: Cost 4 vext3 <0,2,4,6>, <2,2,5,7>
+ 2698118800U, // <6,2,2,6>: Cost 3 vext3 <2,2,6,6>, <2,2,6,6>
+ 3920794092U, // <6,2,2,7>: Cost 4 vuzpr <4,6,u,2>, <6,2,5,7>
+ 2686027423U, // <6,2,2,u>: Cost 3 vext3 <0,2,4,6>, <2,2,u,3>
+ 2686027430U, // <6,2,3,0>: Cost 3 vext3 <0,2,4,6>, <2,3,0,1>
+ 3759769262U, // <6,2,3,1>: Cost 4 vext3 <0,2,4,6>, <2,3,1,0>
+ 2698487485U, // <6,2,3,2>: Cost 3 vext3 <2,3,2,6>, <2,3,2,6>
+ 2705344196U, // <6,2,3,3>: Cost 3 vext3 <3,4,5,6>, <2,3,3,4>
+ 2686027470U, // <6,2,3,4>: Cost 3 vext3 <0,2,4,6>, <2,3,4,5>
+ 2698708696U, // <6,2,3,5>: Cost 3 vext3 <2,3,5,6>, <2,3,5,6>
+ 2724660961U, // <6,2,3,6>: Cost 3 vext3 <6,6,6,6>, <2,3,6,6>
+ 2729232104U, // <6,2,3,7>: Cost 3 vext3 <7,4,5,6>, <2,3,7,4>
+ 2686027502U, // <6,2,3,u>: Cost 3 vext3 <0,2,4,6>, <2,3,u,1>
+ 1567853468U, // <6,2,4,0>: Cost 2 vext2 <4,0,6,2>, <4,0,6,2>
+ 3759769351U, // <6,2,4,1>: Cost 4 vext3 <0,2,4,6>, <2,4,1,u>
+ 2699151118U, // <6,2,4,2>: Cost 3 vext3 <2,4,2,6>, <2,4,2,6>
+ 2686027543U, // <6,2,4,3>: Cost 3 vext3 <0,2,4,6>, <2,4,3,6>
+ 2699298592U, // <6,2,4,4>: Cost 3 vext3 <2,4,4,6>, <2,4,4,6>
+ 1573162294U, // <6,2,4,5>: Cost 2 vext2 <4,u,6,2>, RHS
+ 2686027564U, // <6,2,4,6>: Cost 3 vext3 <0,2,4,6>, <2,4,6,0>
+ 3719982547U, // <6,2,4,7>: Cost 4 vext2 <4,7,6,2>, <4,7,6,2>
+ 1573162532U, // <6,2,4,u>: Cost 2 vext2 <4,u,6,2>, <4,u,6,2>
+ 3779086154U, // <6,2,5,0>: Cost 4 vext3 <3,4,5,6>, <2,5,0,3>
+ 2646904528U, // <6,2,5,1>: Cost 3 vext2 <4,u,6,2>, <5,1,7,3>
+ 3759769440U, // <6,2,5,2>: Cost 4 vext3 <0,2,4,6>, <2,5,2,7>
+ 2699888488U, // <6,2,5,3>: Cost 3 vext3 <2,5,3,6>, <2,5,3,6>
+ 2230855617U, // <6,2,5,4>: Cost 3 vrev <2,6,4,5>
+ 2646904836U, // <6,2,5,5>: Cost 3 vext2 <4,u,6,2>, <5,5,5,5>
+ 2646904930U, // <6,2,5,6>: Cost 3 vext2 <4,u,6,2>, <5,6,7,0>
+ 2847051062U, // <6,2,5,7>: Cost 3 vuzpr <4,6,u,2>, RHS
+ 2700257173U, // <6,2,5,u>: Cost 3 vext3 <2,5,u,6>, <2,5,u,6>
+ 2687207321U, // <6,2,6,0>: Cost 3 vext3 <0,4,2,6>, <2,6,0,1>
+ 2686027684U, // <6,2,6,1>: Cost 3 vext3 <0,2,4,6>, <2,6,1,3>
+ 2566260656U, // <6,2,6,2>: Cost 3 vext1 <2,6,2,6>, <2,6,2,6>
+ 2685806522U, // <6,2,6,3>: Cost 3 vext3 <0,2,1,6>, <2,6,3,7>
+ 2687207361U, // <6,2,6,4>: Cost 3 vext3 <0,4,2,6>, <2,6,4,5>
+ 2686027724U, // <6,2,6,5>: Cost 3 vext3 <0,2,4,6>, <2,6,5,7>
+ 2646905656U, // <6,2,6,6>: Cost 3 vext2 <4,u,6,2>, <6,6,6,6>
+ 2646905678U, // <6,2,6,7>: Cost 3 vext2 <4,u,6,2>, <6,7,0,1>
+ 2686027751U, // <6,2,6,u>: Cost 3 vext3 <0,2,4,6>, <2,6,u,7>
+ 2554323046U, // <6,2,7,0>: Cost 3 vext1 <0,6,2,7>, LHS
+ 2572239606U, // <6,2,7,1>: Cost 3 vext1 <3,6,2,7>, <1,0,3,2>
+ 2566268849U, // <6,2,7,2>: Cost 3 vext1 <2,6,2,7>, <2,6,2,7>
+ 1906753638U, // <6,2,7,3>: Cost 2 vzipr RHS, LHS
+ 2554326326U, // <6,2,7,4>: Cost 3 vext1 <0,6,2,7>, RHS
+ 3304687564U, // <6,2,7,5>: Cost 4 vrev <2,6,5,7>
+ 2980495708U, // <6,2,7,6>: Cost 3 vzipr RHS, <0,4,2,6>
+ 2646906476U, // <6,2,7,7>: Cost 3 vext2 <4,u,6,2>, <7,7,7,7>
+ 1906753643U, // <6,2,7,u>: Cost 2 vzipr RHS, LHS
+ 1591744256U, // <6,2,u,0>: Cost 2 vext2 <u,0,6,2>, <u,0,6,2>
+ 1573164846U, // <6,2,u,1>: Cost 2 vext2 <4,u,6,2>, LHS
+ 2701805650U, // <6,2,u,2>: Cost 3 vext3 <2,u,2,6>, <2,u,2,6>
+ 1906761830U, // <6,2,u,3>: Cost 2 vzipr RHS, LHS
+ 2686027875U, // <6,2,u,4>: Cost 3 vext3 <0,2,4,6>, <2,u,4,5>
+ 1573165210U, // <6,2,u,5>: Cost 2 vext2 <4,u,6,2>, RHS
+ 2686322800U, // <6,2,u,6>: Cost 3 vext3 <0,2,u,6>, <2,u,6,0>
+ 2847051305U, // <6,2,u,7>: Cost 3 vuzpr <4,6,u,2>, RHS
+ 1906761835U, // <6,2,u,u>: Cost 2 vzipr RHS, LHS
+ 3759769739U, // <6,3,0,0>: Cost 4 vext3 <0,2,4,6>, <3,0,0,0>
+ 2686027926U, // <6,3,0,1>: Cost 3 vext3 <0,2,4,6>, <3,0,1,2>
+ 2686027937U, // <6,3,0,2>: Cost 3 vext3 <0,2,4,6>, <3,0,2,4>
+ 3640027286U, // <6,3,0,3>: Cost 4 vext1 <2,6,3,0>, <3,0,1,2>
+ 2687207601U, // <6,3,0,4>: Cost 3 vext3 <0,4,2,6>, <3,0,4,2>
+ 2705344698U, // <6,3,0,5>: Cost 3 vext3 <3,4,5,6>, <3,0,5,2>
+ 3663917847U, // <6,3,0,6>: Cost 4 vext1 <6,6,3,0>, <6,6,3,0>
+ 2237008560U, // <6,3,0,7>: Cost 3 vrev <3,6,7,0>
+ 2686027989U, // <6,3,0,u>: Cost 3 vext3 <0,2,4,6>, <3,0,u,2>
+ 3759769823U, // <6,3,1,0>: Cost 4 vext3 <0,2,4,6>, <3,1,0,3>
+ 3759769830U, // <6,3,1,1>: Cost 4 vext3 <0,2,4,6>, <3,1,1,1>
+ 3759769841U, // <6,3,1,2>: Cost 4 vext3 <0,2,4,6>, <3,1,2,3>
+ 3759769848U, // <6,3,1,3>: Cost 4 vext3 <0,2,4,6>, <3,1,3,1>
+ 2703280390U, // <6,3,1,4>: Cost 3 vext3 <3,1,4,6>, <3,1,4,6>
+ 3759769868U, // <6,3,1,5>: Cost 4 vext3 <0,2,4,6>, <3,1,5,3>
+ 3704063194U, // <6,3,1,6>: Cost 4 vext2 <2,1,6,3>, <1,6,3,0>
+ 3767732510U, // <6,3,1,7>: Cost 4 vext3 <1,5,4,6>, <3,1,7,3>
+ 2703280390U, // <6,3,1,u>: Cost 3 vext3 <3,1,4,6>, <3,1,4,6>
+ 3704063468U, // <6,3,2,0>: Cost 4 vext2 <2,1,6,3>, <2,0,6,4>
+ 2630321724U, // <6,3,2,1>: Cost 3 vext2 <2,1,6,3>, <2,1,6,3>
+ 3759769921U, // <6,3,2,2>: Cost 4 vext3 <0,2,4,6>, <3,2,2,2>
+ 3759769928U, // <6,3,2,3>: Cost 4 vext3 <0,2,4,6>, <3,2,3,0>
+ 3704063767U, // <6,3,2,4>: Cost 4 vext2 <2,1,6,3>, <2,4,3,6>
+ 3704063876U, // <6,3,2,5>: Cost 4 vext2 <2,1,6,3>, <2,5,6,7>
+ 2636957626U, // <6,3,2,6>: Cost 3 vext2 <3,2,6,3>, <2,6,3,7>
+ 3777907058U, // <6,3,2,7>: Cost 4 vext3 <3,2,7,6>, <3,2,7,6>
+ 2630321724U, // <6,3,2,u>: Cost 3 vext2 <2,1,6,3>, <2,1,6,3>
+ 3759769983U, // <6,3,3,0>: Cost 4 vext3 <0,2,4,6>, <3,3,0,1>
+ 3710036245U, // <6,3,3,1>: Cost 4 vext2 <3,1,6,3>, <3,1,6,3>
+ 2636958054U, // <6,3,3,2>: Cost 3 vext2 <3,2,6,3>, <3,2,6,3>
+ 2686028188U, // <6,3,3,3>: Cost 3 vext3 <0,2,4,6>, <3,3,3,3>
+ 2704607656U, // <6,3,3,4>: Cost 3 vext3 <3,3,4,6>, <3,3,4,6>
+ 3773041072U, // <6,3,3,5>: Cost 4 vext3 <2,4,4,6>, <3,3,5,5>
+ 3711363731U, // <6,3,3,6>: Cost 4 vext2 <3,3,6,3>, <3,6,3,7>
+ 3767732676U, // <6,3,3,7>: Cost 4 vext3 <1,5,4,6>, <3,3,7,7>
+ 2707999179U, // <6,3,3,u>: Cost 3 vext3 <3,u,5,6>, <3,3,u,5>
+ 2584232038U, // <6,3,4,0>: Cost 3 vext1 <5,6,3,4>, LHS
+ 2642267118U, // <6,3,4,1>: Cost 3 vext2 <4,1,6,3>, <4,1,6,3>
+ 2642930751U, // <6,3,4,2>: Cost 3 vext2 <4,2,6,3>, <4,2,6,3>
+ 2705197552U, // <6,3,4,3>: Cost 3 vext3 <3,4,3,6>, <3,4,3,6>
+ 2584235318U, // <6,3,4,4>: Cost 3 vext1 <5,6,3,4>, RHS
+ 1631603202U, // <6,3,4,5>: Cost 2 vext3 <3,4,5,6>, <3,4,5,6>
+ 2654211444U, // <6,3,4,6>: Cost 3 vext2 <6,1,6,3>, <4,6,4,6>
+ 2237041332U, // <6,3,4,7>: Cost 3 vrev <3,6,7,4>
+ 1631824413U, // <6,3,4,u>: Cost 2 vext3 <3,4,u,6>, <3,4,u,6>
+ 3640066150U, // <6,3,5,0>: Cost 4 vext1 <2,6,3,5>, LHS
+ 3772746288U, // <6,3,5,1>: Cost 4 vext3 <2,4,0,6>, <3,5,1,7>
+ 3640067790U, // <6,3,5,2>: Cost 4 vext1 <2,6,3,5>, <2,3,4,5>
+ 3773041216U, // <6,3,5,3>: Cost 4 vext3 <2,4,4,6>, <3,5,3,5>
+ 2705934922U, // <6,3,5,4>: Cost 3 vext3 <3,5,4,6>, <3,5,4,6>
+ 3773041236U, // <6,3,5,5>: Cost 4 vext3 <2,4,4,6>, <3,5,5,7>
+ 3779086940U, // <6,3,5,6>: Cost 4 vext3 <3,4,5,6>, <3,5,6,6>
+ 3767732831U, // <6,3,5,7>: Cost 4 vext3 <1,5,4,6>, <3,5,7,0>
+ 2706229870U, // <6,3,5,u>: Cost 3 vext3 <3,5,u,6>, <3,5,u,6>
+ 2602164326U, // <6,3,6,0>: Cost 3 vext1 <u,6,3,6>, LHS
+ 2654212512U, // <6,3,6,1>: Cost 3 vext2 <6,1,6,3>, <6,1,6,3>
+ 2566334393U, // <6,3,6,2>: Cost 3 vext1 <2,6,3,6>, <2,6,3,6>
+ 3704066588U, // <6,3,6,3>: Cost 4 vext2 <2,1,6,3>, <6,3,2,1>
+ 2602167524U, // <6,3,6,4>: Cost 3 vext1 <u,6,3,6>, <4,4,6,6>
+ 3710702321U, // <6,3,6,5>: Cost 4 vext2 <3,2,6,3>, <6,5,7,7>
+ 2724661933U, // <6,3,6,6>: Cost 3 vext3 <6,6,6,6>, <3,6,6,6>
+ 3710702465U, // <6,3,6,7>: Cost 4 vext2 <3,2,6,3>, <6,7,5,7>
+ 2602170158U, // <6,3,6,u>: Cost 3 vext1 <u,6,3,6>, LHS
+ 1492598886U, // <6,3,7,0>: Cost 2 vext1 <2,6,3,7>, LHS
+ 2560369889U, // <6,3,7,1>: Cost 3 vext1 <1,6,3,7>, <1,6,3,7>
+ 1492600762U, // <6,3,7,2>: Cost 2 vext1 <2,6,3,7>, <2,6,3,7>
+ 2566342806U, // <6,3,7,3>: Cost 3 vext1 <2,6,3,7>, <3,0,1,2>
+ 1492602166U, // <6,3,7,4>: Cost 2 vext1 <2,6,3,7>, RHS
+ 2602176208U, // <6,3,7,5>: Cost 3 vext1 <u,6,3,7>, <5,1,7,3>
+ 2566345210U, // <6,3,7,6>: Cost 3 vext1 <2,6,3,7>, <6,2,7,3>
+ 2980496528U, // <6,3,7,7>: Cost 3 vzipr RHS, <1,5,3,7>
+ 1492604718U, // <6,3,7,u>: Cost 2 vext1 <2,6,3,7>, LHS
+ 1492607078U, // <6,3,u,0>: Cost 2 vext1 <2,6,3,u>, LHS
+ 2686028574U, // <6,3,u,1>: Cost 3 vext3 <0,2,4,6>, <3,u,1,2>
+ 1492608955U, // <6,3,u,2>: Cost 2 vext1 <2,6,3,u>, <2,6,3,u>
+ 2566350998U, // <6,3,u,3>: Cost 3 vext1 <2,6,3,u>, <3,0,1,2>
+ 1492610358U, // <6,3,u,4>: Cost 2 vext1 <2,6,3,u>, RHS
+ 1634257734U, // <6,3,u,5>: Cost 2 vext3 <3,u,5,6>, <3,u,5,6>
+ 2566353489U, // <6,3,u,6>: Cost 3 vext1 <2,6,3,u>, <6,3,u,0>
+ 2980504720U, // <6,3,u,7>: Cost 3 vzipr RHS, <1,5,3,7>
+ 1492612910U, // <6,3,u,u>: Cost 2 vext1 <2,6,3,u>, LHS
+ 3703406592U, // <6,4,0,0>: Cost 4 vext2 <2,0,6,4>, <0,0,0,0>
+ 2629664870U, // <6,4,0,1>: Cost 3 vext2 <2,0,6,4>, LHS
+ 2629664972U, // <6,4,0,2>: Cost 3 vext2 <2,0,6,4>, <0,2,4,6>
+ 3779087232U, // <6,4,0,3>: Cost 4 vext3 <3,4,5,6>, <4,0,3,1>
+ 2642936156U, // <6,4,0,4>: Cost 3 vext2 <4,2,6,4>, <0,4,2,6>
+ 2712570770U, // <6,4,0,5>: Cost 3 vext3 <4,6,4,6>, <4,0,5,1>
+ 2687208348U, // <6,4,0,6>: Cost 3 vext3 <0,4,2,6>, <4,0,6,2>
+ 3316723081U, // <6,4,0,7>: Cost 4 vrev <4,6,7,0>
+ 2629665437U, // <6,4,0,u>: Cost 3 vext2 <2,0,6,4>, LHS
+ 2242473291U, // <6,4,1,0>: Cost 3 vrev <4,6,0,1>
+ 3700089652U, // <6,4,1,1>: Cost 4 vext2 <1,4,6,4>, <1,1,1,1>
+ 3703407510U, // <6,4,1,2>: Cost 4 vext2 <2,0,6,4>, <1,2,3,0>
+ 2852962406U, // <6,4,1,3>: Cost 3 vuzpr <5,6,7,4>, LHS
+ 3628166454U, // <6,4,1,4>: Cost 4 vext1 <0,6,4,1>, RHS
+ 3760876514U, // <6,4,1,5>: Cost 4 vext3 <0,4,1,6>, <4,1,5,0>
+ 2687208430U, // <6,4,1,6>: Cost 3 vext3 <0,4,2,6>, <4,1,6,3>
+ 3316731274U, // <6,4,1,7>: Cost 4 vrev <4,6,7,1>
+ 2243063187U, // <6,4,1,u>: Cost 3 vrev <4,6,u,1>
+ 2629666284U, // <6,4,2,0>: Cost 3 vext2 <2,0,6,4>, <2,0,6,4>
+ 3703408188U, // <6,4,2,1>: Cost 4 vext2 <2,0,6,4>, <2,1,6,3>
+ 3703408232U, // <6,4,2,2>: Cost 4 vext2 <2,0,6,4>, <2,2,2,2>
+ 3703408294U, // <6,4,2,3>: Cost 4 vext2 <2,0,6,4>, <2,3,0,1>
+ 2632320816U, // <6,4,2,4>: Cost 3 vext2 <2,4,6,4>, <2,4,6,4>
+ 2923384118U, // <6,4,2,5>: Cost 3 vzipl <6,2,7,3>, RHS
+ 2687208508U, // <6,4,2,6>: Cost 3 vext3 <0,4,2,6>, <4,2,6,0>
+ 3760950341U, // <6,4,2,7>: Cost 4 vext3 <0,4,2,6>, <4,2,7,0>
+ 2634975348U, // <6,4,2,u>: Cost 3 vext2 <2,u,6,4>, <2,u,6,4>
+ 3703408790U, // <6,4,3,0>: Cost 4 vext2 <2,0,6,4>, <3,0,1,2>
+ 3316305238U, // <6,4,3,1>: Cost 4 vrev <4,6,1,3>
+ 3703408947U, // <6,4,3,2>: Cost 4 vext2 <2,0,6,4>, <3,2,0,6>
+ 3703409052U, // <6,4,3,3>: Cost 4 vext2 <2,0,6,4>, <3,3,3,3>
+ 2644929026U, // <6,4,3,4>: Cost 3 vext2 <4,5,6,4>, <3,4,5,6>
+ 3718670922U, // <6,4,3,5>: Cost 4 vext2 <4,5,6,4>, <3,5,4,6>
+ 2705345682U, // <6,4,3,6>: Cost 3 vext3 <3,4,5,6>, <4,3,6,5>
+ 3926705152U, // <6,4,3,7>: Cost 4 vuzpr <5,6,7,4>, <1,3,5,7>
+ 2668817222U, // <6,4,3,u>: Cost 3 vext2 <u,5,6,4>, <3,u,5,6>
+ 2590277734U, // <6,4,4,0>: Cost 3 vext1 <6,6,4,4>, LHS
+ 3716017135U, // <6,4,4,1>: Cost 4 vext2 <4,1,6,4>, <4,1,6,4>
+ 2642938944U, // <6,4,4,2>: Cost 3 vext2 <4,2,6,4>, <4,2,6,4>
+ 3717344401U, // <6,4,4,3>: Cost 4 vext2 <4,3,6,4>, <4,3,6,4>
+ 2712571088U, // <6,4,4,4>: Cost 3 vext3 <4,6,4,6>, <4,4,4,4>
+ 2629668150U, // <6,4,4,5>: Cost 3 vext2 <2,0,6,4>, RHS
+ 1637649636U, // <6,4,4,6>: Cost 2 vext3 <4,4,6,6>, <4,4,6,6>
+ 2646257109U, // <6,4,4,7>: Cost 3 vext2 <4,7,6,4>, <4,7,6,4>
+ 1637649636U, // <6,4,4,u>: Cost 2 vext3 <4,4,6,6>, <4,4,6,6>
+ 2566398054U, // <6,4,5,0>: Cost 3 vext1 <2,6,4,5>, LHS
+ 3760876805U, // <6,4,5,1>: Cost 4 vext3 <0,4,1,6>, <4,5,1,3>
+ 2566399937U, // <6,4,5,2>: Cost 3 vext1 <2,6,4,5>, <2,6,4,5>
+ 2584316418U, // <6,4,5,3>: Cost 3 vext1 <5,6,4,5>, <3,4,5,6>
+ 2566401334U, // <6,4,5,4>: Cost 3 vext1 <2,6,4,5>, RHS
+ 2584318028U, // <6,4,5,5>: Cost 3 vext1 <5,6,4,5>, <5,6,4,5>
+ 1612287286U, // <6,4,5,6>: Cost 2 vext3 <0,2,4,6>, RHS
+ 2852965686U, // <6,4,5,7>: Cost 3 vuzpr <5,6,7,4>, RHS
+ 1612287304U, // <6,4,5,u>: Cost 2 vext3 <0,2,4,6>, RHS
+ 1504608358U, // <6,4,6,0>: Cost 2 vext1 <4,6,4,6>, LHS
+ 2578350838U, // <6,4,6,1>: Cost 3 vext1 <4,6,4,6>, <1,0,3,2>
+ 2578351720U, // <6,4,6,2>: Cost 3 vext1 <4,6,4,6>, <2,2,2,2>
+ 2578352278U, // <6,4,6,3>: Cost 3 vext1 <4,6,4,6>, <3,0,1,2>
+ 1504611638U, // <6,4,6,4>: Cost 2 vext1 <4,6,4,6>, RHS
+ 2578353872U, // <6,4,6,5>: Cost 3 vext1 <4,6,4,6>, <5,1,7,3>
+ 2578354682U, // <6,4,6,6>: Cost 3 vext1 <4,6,4,6>, <6,2,7,3>
+ 2578355194U, // <6,4,6,7>: Cost 3 vext1 <4,6,4,6>, <7,0,1,2>
+ 1504614190U, // <6,4,6,u>: Cost 2 vext1 <4,6,4,6>, LHS
+ 2572386406U, // <6,4,7,0>: Cost 3 vext1 <3,6,4,7>, LHS
+ 2572387226U, // <6,4,7,1>: Cost 3 vext1 <3,6,4,7>, <1,2,3,4>
+ 3640157902U, // <6,4,7,2>: Cost 4 vext1 <2,6,4,7>, <2,3,4,5>
+ 2572389020U, // <6,4,7,3>: Cost 3 vext1 <3,6,4,7>, <3,6,4,7>
+ 2572389686U, // <6,4,7,4>: Cost 3 vext1 <3,6,4,7>, RHS
+ 2980497102U, // <6,4,7,5>: Cost 3 vzipr RHS, <2,3,4,5>
+ 2980495564U, // <6,4,7,6>: Cost 3 vzipr RHS, <0,2,4,6>
+ 4054239090U, // <6,4,7,7>: Cost 4 vzipr RHS, <2,5,4,7>
+ 2572392238U, // <6,4,7,u>: Cost 3 vext1 <3,6,4,7>, LHS
+ 1504608358U, // <6,4,u,0>: Cost 2 vext1 <4,6,4,6>, LHS
+ 2629670702U, // <6,4,u,1>: Cost 3 vext2 <2,0,6,4>, LHS
+ 2566424516U, // <6,4,u,2>: Cost 3 vext1 <2,6,4,u>, <2,6,4,u>
+ 2584340994U, // <6,4,u,3>: Cost 3 vext1 <5,6,4,u>, <3,4,5,6>
+ 1640156694U, // <6,4,u,4>: Cost 2 vext3 <4,u,4,6>, <4,u,4,6>
+ 2629671066U, // <6,4,u,5>: Cost 3 vext2 <2,0,6,4>, RHS
+ 1612287529U, // <6,4,u,6>: Cost 2 vext3 <0,2,4,6>, RHS
+ 2852965929U, // <6,4,u,7>: Cost 3 vuzpr <5,6,7,4>, RHS
+ 1612287547U, // <6,4,u,u>: Cost 2 vext3 <0,2,4,6>, RHS
+ 3708723200U, // <6,5,0,0>: Cost 4 vext2 <2,u,6,5>, <0,0,0,0>
+ 2634981478U, // <6,5,0,1>: Cost 3 vext2 <2,u,6,5>, LHS
+ 3694125260U, // <6,5,0,2>: Cost 4 vext2 <0,4,6,5>, <0,2,4,6>
+ 3779087962U, // <6,5,0,3>: Cost 4 vext3 <3,4,5,6>, <5,0,3,2>
+ 3760877154U, // <6,5,0,4>: Cost 4 vext3 <0,4,1,6>, <5,0,4,1>
+ 4195110916U, // <6,5,0,5>: Cost 4 vtrnr <5,6,7,0>, <5,5,5,5>
+ 3696779775U, // <6,5,0,6>: Cost 4 vext2 <0,u,6,5>, <0,6,2,7>
+ 1175212130U, // <6,5,0,7>: Cost 2 vrev <5,6,7,0>
+ 1175285867U, // <6,5,0,u>: Cost 2 vrev <5,6,u,0>
+ 2248445988U, // <6,5,1,0>: Cost 3 vrev <5,6,0,1>
+ 3698107237U, // <6,5,1,1>: Cost 4 vext2 <1,1,6,5>, <1,1,6,5>
+ 3708724118U, // <6,5,1,2>: Cost 4 vext2 <2,u,6,5>, <1,2,3,0>
+ 3908575334U, // <6,5,1,3>: Cost 4 vuzpr <2,6,4,5>, LHS
+ 3716023376U, // <6,5,1,4>: Cost 4 vext2 <4,1,6,5>, <1,4,5,6>
+ 3708724368U, // <6,5,1,5>: Cost 4 vext2 <2,u,6,5>, <1,5,3,7>
+ 3767733960U, // <6,5,1,6>: Cost 4 vext3 <1,5,4,6>, <5,1,6,4>
+ 2712571600U, // <6,5,1,7>: Cost 3 vext3 <4,6,4,6>, <5,1,7,3>
+ 2712571609U, // <6,5,1,u>: Cost 3 vext3 <4,6,4,6>, <5,1,u,3>
+ 2578391142U, // <6,5,2,0>: Cost 3 vext1 <4,6,5,2>, LHS
+ 3704079934U, // <6,5,2,1>: Cost 4 vext2 <2,1,6,5>, <2,1,6,5>
+ 3708724840U, // <6,5,2,2>: Cost 4 vext2 <2,u,6,5>, <2,2,2,2>
+ 3705407182U, // <6,5,2,3>: Cost 4 vext2 <2,3,6,5>, <2,3,4,5>
+ 2578394422U, // <6,5,2,4>: Cost 3 vext1 <4,6,5,2>, RHS
+ 3717351272U, // <6,5,2,5>: Cost 4 vext2 <4,3,6,5>, <2,5,3,6>
+ 2634983354U, // <6,5,2,6>: Cost 3 vext2 <2,u,6,5>, <2,6,3,7>
+ 3115486518U, // <6,5,2,7>: Cost 3 vtrnr <4,6,u,2>, RHS
+ 2634983541U, // <6,5,2,u>: Cost 3 vext2 <2,u,6,5>, <2,u,6,5>
+ 3708725398U, // <6,5,3,0>: Cost 4 vext2 <2,u,6,5>, <3,0,1,2>
+ 3710052631U, // <6,5,3,1>: Cost 4 vext2 <3,1,6,5>, <3,1,6,5>
+ 3708725606U, // <6,5,3,2>: Cost 4 vext2 <2,u,6,5>, <3,2,6,3>
+ 3708725660U, // <6,5,3,3>: Cost 4 vext2 <2,u,6,5>, <3,3,3,3>
+ 2643610114U, // <6,5,3,4>: Cost 3 vext2 <4,3,6,5>, <3,4,5,6>
+ 3717352010U, // <6,5,3,5>: Cost 4 vext2 <4,3,6,5>, <3,5,4,6>
+ 3773632358U, // <6,5,3,6>: Cost 4 vext3 <2,5,3,6>, <5,3,6,0>
+ 2248978533U, // <6,5,3,7>: Cost 3 vrev <5,6,7,3>
+ 2249052270U, // <6,5,3,u>: Cost 3 vrev <5,6,u,3>
+ 2596323430U, // <6,5,4,0>: Cost 3 vext1 <7,6,5,4>, LHS
+ 3716025328U, // <6,5,4,1>: Cost 4 vext2 <4,1,6,5>, <4,1,6,5>
+ 3716688961U, // <6,5,4,2>: Cost 4 vext2 <4,2,6,5>, <4,2,6,5>
+ 2643610770U, // <6,5,4,3>: Cost 3 vext2 <4,3,6,5>, <4,3,6,5>
+ 2596326710U, // <6,5,4,4>: Cost 3 vext1 <7,6,5,4>, RHS
+ 2634984758U, // <6,5,4,5>: Cost 3 vext2 <2,u,6,5>, RHS
+ 3767734199U, // <6,5,4,6>: Cost 4 vext3 <1,5,4,6>, <5,4,6,0>
+ 1643696070U, // <6,5,4,7>: Cost 2 vext3 <5,4,7,6>, <5,4,7,6>
+ 1643769807U, // <6,5,4,u>: Cost 2 vext3 <5,4,u,6>, <5,4,u,6>
+ 2578415718U, // <6,5,5,0>: Cost 3 vext1 <4,6,5,5>, LHS
+ 3652158198U, // <6,5,5,1>: Cost 4 vext1 <4,6,5,5>, <1,0,3,2>
+ 3652159080U, // <6,5,5,2>: Cost 4 vext1 <4,6,5,5>, <2,2,2,2>
+ 3652159638U, // <6,5,5,3>: Cost 4 vext1 <4,6,5,5>, <3,0,1,2>
+ 2578418998U, // <6,5,5,4>: Cost 3 vext1 <4,6,5,5>, RHS
+ 2712571908U, // <6,5,5,5>: Cost 3 vext3 <4,6,4,6>, <5,5,5,5>
+ 2718027790U, // <6,5,5,6>: Cost 3 vext3 <5,5,6,6>, <5,5,6,6>
+ 2712571928U, // <6,5,5,7>: Cost 3 vext3 <4,6,4,6>, <5,5,7,7>
+ 2712571937U, // <6,5,5,u>: Cost 3 vext3 <4,6,4,6>, <5,5,u,7>
+ 2705346596U, // <6,5,6,0>: Cost 3 vext3 <3,4,5,6>, <5,6,0,1>
+ 3767144496U, // <6,5,6,1>: Cost 4 vext3 <1,4,5,6>, <5,6,1,4>
+ 3773116473U, // <6,5,6,2>: Cost 4 vext3 <2,4,5,6>, <5,6,2,4>
+ 2705346626U, // <6,5,6,3>: Cost 3 vext3 <3,4,5,6>, <5,6,3,4>
+ 2705346636U, // <6,5,6,4>: Cost 3 vext3 <3,4,5,6>, <5,6,4,5>
+ 3908577217U, // <6,5,6,5>: Cost 4 vuzpr <2,6,4,5>, <2,6,4,5>
+ 2578428728U, // <6,5,6,6>: Cost 3 vext1 <4,6,5,6>, <6,6,6,6>
+ 2712572002U, // <6,5,6,7>: Cost 3 vext3 <4,6,4,6>, <5,6,7,0>
+ 2705346668U, // <6,5,6,u>: Cost 3 vext3 <3,4,5,6>, <5,6,u,1>
+ 2560516198U, // <6,5,7,0>: Cost 3 vext1 <1,6,5,7>, LHS
+ 2560517363U, // <6,5,7,1>: Cost 3 vext1 <1,6,5,7>, <1,6,5,7>
+ 2566490060U, // <6,5,7,2>: Cost 3 vext1 <2,6,5,7>, <2,6,5,7>
+ 3634260118U, // <6,5,7,3>: Cost 4 vext1 <1,6,5,7>, <3,0,1,2>
+ 2560519478U, // <6,5,7,4>: Cost 3 vext1 <1,6,5,7>, RHS
+ 2980498650U, // <6,5,7,5>: Cost 3 vzipr RHS, <4,4,5,5>
+ 2980497922U, // <6,5,7,6>: Cost 3 vzipr RHS, <3,4,5,6>
+ 3103214902U, // <6,5,7,7>: Cost 3 vtrnr <2,6,3,7>, RHS
+ 2560522030U, // <6,5,7,u>: Cost 3 vext1 <1,6,5,7>, LHS
+ 2560524390U, // <6,5,u,0>: Cost 3 vext1 <1,6,5,u>, LHS
+ 2560525556U, // <6,5,u,1>: Cost 3 vext1 <1,6,5,u>, <1,6,5,u>
+ 2566498253U, // <6,5,u,2>: Cost 3 vext1 <2,6,5,u>, <2,6,5,u>
+ 2646931439U, // <6,5,u,3>: Cost 3 vext2 <4,u,6,5>, <u,3,5,7>
+ 2560527670U, // <6,5,u,4>: Cost 3 vext1 <1,6,5,u>, RHS
+ 2634987674U, // <6,5,u,5>: Cost 3 vext2 <2,u,6,5>, RHS
+ 2980506114U, // <6,5,u,6>: Cost 3 vzipr RHS, <3,4,5,6>
+ 1175277674U, // <6,5,u,7>: Cost 2 vrev <5,6,7,u>
+ 1175351411U, // <6,5,u,u>: Cost 2 vrev <5,6,u,u>
+ 2578448486U, // <6,6,0,0>: Cost 3 vext1 <4,6,6,0>, LHS
+ 1573191782U, // <6,6,0,1>: Cost 2 vext2 <4,u,6,6>, LHS
+ 2686030124U, // <6,6,0,2>: Cost 3 vext3 <0,2,4,6>, <6,0,2,4>
+ 3779088690U, // <6,6,0,3>: Cost 4 vext3 <3,4,5,6>, <6,0,3,1>
+ 2687209788U, // <6,6,0,4>: Cost 3 vext3 <0,4,2,6>, <6,0,4,2>
+ 3652194000U, // <6,6,0,5>: Cost 4 vext1 <4,6,6,0>, <5,1,7,3>
+ 2254852914U, // <6,6,0,6>: Cost 3 vrev <6,6,6,0>
+ 4041575734U, // <6,6,0,7>: Cost 4 vzipr <2,4,6,0>, RHS
+ 1573192349U, // <6,6,0,u>: Cost 2 vext2 <4,u,6,6>, LHS
+ 2646934262U, // <6,6,1,0>: Cost 3 vext2 <4,u,6,6>, <1,0,3,2>
+ 2646934324U, // <6,6,1,1>: Cost 3 vext2 <4,u,6,6>, <1,1,1,1>
+ 2646934422U, // <6,6,1,2>: Cost 3 vext2 <4,u,6,6>, <1,2,3,0>
+ 2846785638U, // <6,6,1,3>: Cost 3 vuzpr <4,6,4,6>, LHS
+ 3760951694U, // <6,6,1,4>: Cost 4 vext3 <0,4,2,6>, <6,1,4,3>
+ 2646934672U, // <6,6,1,5>: Cost 3 vext2 <4,u,6,6>, <1,5,3,7>
+ 2712572320U, // <6,6,1,6>: Cost 3 vext3 <4,6,4,6>, <6,1,6,3>
+ 3775549865U, // <6,6,1,7>: Cost 4 vext3 <2,u,2,6>, <6,1,7,3>
+ 2846785643U, // <6,6,1,u>: Cost 3 vuzpr <4,6,4,6>, LHS
+ 3759772094U, // <6,6,2,0>: Cost 4 vext3 <0,2,4,6>, <6,2,0,6>
+ 3704751676U, // <6,6,2,1>: Cost 4 vext2 <2,2,6,6>, <2,1,6,3>
+ 2631009936U, // <6,6,2,2>: Cost 3 vext2 <2,2,6,6>, <2,2,6,6>
+ 2646935206U, // <6,6,2,3>: Cost 3 vext2 <4,u,6,6>, <2,3,0,1>
+ 3759772127U, // <6,6,2,4>: Cost 4 vext3 <0,2,4,6>, <6,2,4,3>
+ 3704752004U, // <6,6,2,5>: Cost 4 vext2 <2,2,6,6>, <2,5,6,7>
+ 2646935482U, // <6,6,2,6>: Cost 3 vext2 <4,u,6,6>, <2,6,3,7>
+ 2712572410U, // <6,6,2,7>: Cost 3 vext3 <4,6,4,6>, <6,2,7,3>
+ 2712572419U, // <6,6,2,u>: Cost 3 vext3 <4,6,4,6>, <6,2,u,3>
+ 2646935702U, // <6,6,3,0>: Cost 3 vext2 <4,u,6,6>, <3,0,1,2>
+ 3777024534U, // <6,6,3,1>: Cost 4 vext3 <3,1,4,6>, <6,3,1,4>
+ 3704752453U, // <6,6,3,2>: Cost 4 vext2 <2,2,6,6>, <3,2,2,6>
+ 2646935964U, // <6,6,3,3>: Cost 3 vext2 <4,u,6,6>, <3,3,3,3>
+ 2705347122U, // <6,6,3,4>: Cost 3 vext3 <3,4,5,6>, <6,3,4,5>
+ 3779678778U, // <6,6,3,5>: Cost 4 vext3 <3,5,4,6>, <6,3,5,4>
+ 2657553069U, // <6,6,3,6>: Cost 3 vext2 <6,6,6,6>, <3,6,6,6>
+ 4039609654U, // <6,6,3,7>: Cost 4 vzipr <2,1,6,3>, RHS
+ 2708001366U, // <6,6,3,u>: Cost 3 vext3 <3,u,5,6>, <6,3,u,5>
+ 2578481254U, // <6,6,4,0>: Cost 3 vext1 <4,6,6,4>, LHS
+ 3652223734U, // <6,6,4,1>: Cost 4 vext1 <4,6,6,4>, <1,0,3,2>
+ 3760951922U, // <6,6,4,2>: Cost 4 vext3 <0,4,2,6>, <6,4,2,6>
+ 3779089019U, // <6,6,4,3>: Cost 4 vext3 <3,4,5,6>, <6,4,3,6>
+ 1570540772U, // <6,6,4,4>: Cost 2 vext2 <4,4,6,6>, <4,4,6,6>
+ 1573195062U, // <6,6,4,5>: Cost 2 vext2 <4,u,6,6>, RHS
+ 2712572560U, // <6,6,4,6>: Cost 3 vext3 <4,6,4,6>, <6,4,6,0>
+ 2723410591U, // <6,6,4,7>: Cost 3 vext3 <6,4,7,6>, <6,4,7,6>
+ 1573195304U, // <6,6,4,u>: Cost 2 vext2 <4,u,6,6>, <4,u,6,6>
+ 3640287334U, // <6,6,5,0>: Cost 4 vext1 <2,6,6,5>, LHS
+ 2646937296U, // <6,6,5,1>: Cost 3 vext2 <4,u,6,6>, <5,1,7,3>
+ 3640289235U, // <6,6,5,2>: Cost 4 vext1 <2,6,6,5>, <2,6,6,5>
+ 3720679279U, // <6,6,5,3>: Cost 4 vext2 <4,u,6,6>, <5,3,7,0>
+ 2646937542U, // <6,6,5,4>: Cost 3 vext2 <4,u,6,6>, <5,4,7,6>
+ 2646937604U, // <6,6,5,5>: Cost 3 vext2 <4,u,6,6>, <5,5,5,5>
+ 2646937698U, // <6,6,5,6>: Cost 3 vext2 <4,u,6,6>, <5,6,7,0>
+ 2846788918U, // <6,6,5,7>: Cost 3 vuzpr <4,6,4,6>, RHS
+ 2846788919U, // <6,6,5,u>: Cost 3 vuzpr <4,6,4,6>, RHS
+ 1516699750U, // <6,6,6,0>: Cost 2 vext1 <6,6,6,6>, LHS
+ 2590442230U, // <6,6,6,1>: Cost 3 vext1 <6,6,6,6>, <1,0,3,2>
+ 2646938106U, // <6,6,6,2>: Cost 3 vext2 <4,u,6,6>, <6,2,7,3>
+ 2590443670U, // <6,6,6,3>: Cost 3 vext1 <6,6,6,6>, <3,0,1,2>
+ 1516703030U, // <6,6,6,4>: Cost 2 vext1 <6,6,6,6>, RHS
+ 2590445264U, // <6,6,6,5>: Cost 3 vext1 <6,6,6,6>, <5,1,7,3>
+ 296144182U, // <6,6,6,6>: Cost 1 vdup2 RHS
+ 2712572738U, // <6,6,6,7>: Cost 3 vext3 <4,6,4,6>, <6,6,7,7>
+ 296144182U, // <6,6,6,u>: Cost 1 vdup2 RHS
+ 2566561894U, // <6,6,7,0>: Cost 3 vext1 <2,6,6,7>, LHS
+ 3634332924U, // <6,6,7,1>: Cost 4 vext1 <1,6,6,7>, <1,6,6,7>
+ 2566563797U, // <6,6,7,2>: Cost 3 vext1 <2,6,6,7>, <2,6,6,7>
+ 2584480258U, // <6,6,7,3>: Cost 3 vext1 <5,6,6,7>, <3,4,5,6>
+ 2566565174U, // <6,6,7,4>: Cost 3 vext1 <2,6,6,7>, RHS
+ 2717438846U, // <6,6,7,5>: Cost 3 vext3 <5,4,7,6>, <6,7,5,4>
+ 2980500280U, // <6,6,7,6>: Cost 3 vzipr RHS, <6,6,6,6>
+ 1906756918U, // <6,6,7,7>: Cost 2 vzipr RHS, RHS
+ 1906756919U, // <6,6,7,u>: Cost 2 vzipr RHS, RHS
+ 1516699750U, // <6,6,u,0>: Cost 2 vext1 <6,6,6,6>, LHS
+ 1573197614U, // <6,6,u,1>: Cost 2 vext2 <4,u,6,6>, LHS
+ 2566571990U, // <6,6,u,2>: Cost 3 vext1 <2,6,6,u>, <2,6,6,u>
+ 2846786205U, // <6,6,u,3>: Cost 3 vuzpr <4,6,4,6>, LHS
+ 1516703030U, // <6,6,u,4>: Cost 2 vext1 <6,6,6,6>, RHS
+ 1573197978U, // <6,6,u,5>: Cost 2 vext2 <4,u,6,6>, RHS
+ 296144182U, // <6,6,u,6>: Cost 1 vdup2 RHS
+ 1906765110U, // <6,6,u,7>: Cost 2 vzipr RHS, RHS
+ 296144182U, // <6,6,u,u>: Cost 1 vdup2 RHS
+ 1571209216U, // <6,7,0,0>: Cost 2 vext2 RHS, <0,0,0,0>
+ 497467494U, // <6,7,0,1>: Cost 1 vext2 RHS, LHS
+ 1571209380U, // <6,7,0,2>: Cost 2 vext2 RHS, <0,2,0,2>
+ 2644951292U, // <6,7,0,3>: Cost 3 vext2 RHS, <0,3,1,0>
+ 1571209554U, // <6,7,0,4>: Cost 2 vext2 RHS, <0,4,1,5>
+ 1510756450U, // <6,7,0,5>: Cost 2 vext1 <5,6,7,0>, <5,6,7,0>
+ 2644951542U, // <6,7,0,6>: Cost 3 vext2 RHS, <0,6,1,7>
+ 2584499194U, // <6,7,0,7>: Cost 3 vext1 <5,6,7,0>, <7,0,1,2>
+ 497468061U, // <6,7,0,u>: Cost 1 vext2 RHS, LHS
+ 1571209974U, // <6,7,1,0>: Cost 2 vext2 RHS, <1,0,3,2>
+ 1571210036U, // <6,7,1,1>: Cost 2 vext2 RHS, <1,1,1,1>
+ 1571210134U, // <6,7,1,2>: Cost 2 vext2 RHS, <1,2,3,0>
+ 1571210200U, // <6,7,1,3>: Cost 2 vext2 RHS, <1,3,1,3>
+ 2644952098U, // <6,7,1,4>: Cost 3 vext2 RHS, <1,4,0,5>
+ 1571210384U, // <6,7,1,5>: Cost 2 vext2 RHS, <1,5,3,7>
+ 2644952271U, // <6,7,1,6>: Cost 3 vext2 RHS, <1,6,1,7>
+ 2578535418U, // <6,7,1,7>: Cost 3 vext1 <4,6,7,1>, <7,0,1,2>
+ 1571210605U, // <6,7,1,u>: Cost 2 vext2 RHS, <1,u,1,3>
+ 2644952509U, // <6,7,2,0>: Cost 3 vext2 RHS, <2,0,1,2>
+ 2644952582U, // <6,7,2,1>: Cost 3 vext2 RHS, <2,1,0,3>
+ 1571210856U, // <6,7,2,2>: Cost 2 vext2 RHS, <2,2,2,2>
+ 1571210918U, // <6,7,2,3>: Cost 2 vext2 RHS, <2,3,0,1>
+ 2644952828U, // <6,7,2,4>: Cost 3 vext2 RHS, <2,4,0,6>
+ 2633009028U, // <6,7,2,5>: Cost 3 vext2 <2,5,6,7>, <2,5,6,7>
+ 1571211194U, // <6,7,2,6>: Cost 2 vext2 RHS, <2,6,3,7>
+ 2668840938U, // <6,7,2,7>: Cost 3 vext2 RHS, <2,7,0,1>
+ 1571211323U, // <6,7,2,u>: Cost 2 vext2 RHS, <2,u,0,1>
+ 1571211414U, // <6,7,3,0>: Cost 2 vext2 RHS, <3,0,1,2>
+ 2644953311U, // <6,7,3,1>: Cost 3 vext2 RHS, <3,1,0,3>
+ 2644953390U, // <6,7,3,2>: Cost 3 vext2 RHS, <3,2,0,1>
+ 1571211676U, // <6,7,3,3>: Cost 2 vext2 RHS, <3,3,3,3>
+ 1571211778U, // <6,7,3,4>: Cost 2 vext2 RHS, <3,4,5,6>
+ 2644953648U, // <6,7,3,5>: Cost 3 vext2 RHS, <3,5,1,7>
+ 2644953720U, // <6,7,3,6>: Cost 3 vext2 RHS, <3,6,0,7>
+ 2644953795U, // <6,7,3,7>: Cost 3 vext2 RHS, <3,7,0,1>
+ 1571212062U, // <6,7,3,u>: Cost 2 vext2 RHS, <3,u,1,2>
+ 1573202834U, // <6,7,4,0>: Cost 2 vext2 RHS, <4,0,5,1>
+ 2644954058U, // <6,7,4,1>: Cost 3 vext2 RHS, <4,1,2,3>
+ 2644954166U, // <6,7,4,2>: Cost 3 vext2 RHS, <4,2,5,3>
+ 2644954258U, // <6,7,4,3>: Cost 3 vext2 RHS, <4,3,6,5>
+ 1571212496U, // <6,7,4,4>: Cost 2 vext2 RHS, <4,4,4,4>
+ 497470774U, // <6,7,4,5>: Cost 1 vext2 RHS, RHS
+ 1573203316U, // <6,7,4,6>: Cost 2 vext2 RHS, <4,6,4,6>
+ 2646281688U, // <6,7,4,7>: Cost 3 vext2 <4,7,6,7>, <4,7,6,7>
+ 497471017U, // <6,7,4,u>: Cost 1 vext2 RHS, RHS
+ 2644954696U, // <6,7,5,0>: Cost 3 vext2 RHS, <5,0,1,2>
+ 1573203664U, // <6,7,5,1>: Cost 2 vext2 RHS, <5,1,7,3>
+ 2644954878U, // <6,7,5,2>: Cost 3 vext2 RHS, <5,2,3,4>
+ 2644954991U, // <6,7,5,3>: Cost 3 vext2 RHS, <5,3,7,0>
+ 1571213254U, // <6,7,5,4>: Cost 2 vext2 RHS, <5,4,7,6>
+ 1571213316U, // <6,7,5,5>: Cost 2 vext2 RHS, <5,5,5,5>
+ 1571213410U, // <6,7,5,6>: Cost 2 vext2 RHS, <5,6,7,0>
+ 1573204136U, // <6,7,5,7>: Cost 2 vext2 RHS, <5,7,5,7>
+ 1573204217U, // <6,7,5,u>: Cost 2 vext2 RHS, <5,u,5,7>
+ 2644955425U, // <6,7,6,0>: Cost 3 vext2 RHS, <6,0,1,2>
+ 2644955561U, // <6,7,6,1>: Cost 3 vext2 RHS, <6,1,7,3>
+ 1573204474U, // <6,7,6,2>: Cost 2 vext2 RHS, <6,2,7,3>
+ 2644955698U, // <6,7,6,3>: Cost 3 vext2 RHS, <6,3,4,5>
+ 2644955789U, // <6,7,6,4>: Cost 3 vext2 RHS, <6,4,5,6>
+ 2644955889U, // <6,7,6,5>: Cost 3 vext2 RHS, <6,5,7,7>
+ 1571214136U, // <6,7,6,6>: Cost 2 vext2 RHS, <6,6,6,6>
+ 1571214158U, // <6,7,6,7>: Cost 2 vext2 RHS, <6,7,0,1>
+ 1573204895U, // <6,7,6,u>: Cost 2 vext2 RHS, <6,u,0,1>
+ 1573204986U, // <6,7,7,0>: Cost 2 vext2 RHS, <7,0,1,2>
+ 2572608656U, // <6,7,7,1>: Cost 3 vext1 <3,6,7,7>, <1,5,3,7>
+ 2644956362U, // <6,7,7,2>: Cost 3 vext2 RHS, <7,2,6,3>
+ 2572610231U, // <6,7,7,3>: Cost 3 vext1 <3,6,7,7>, <3,6,7,7>
+ 1573205350U, // <6,7,7,4>: Cost 2 vext2 RHS, <7,4,5,6>
+ 2646947220U, // <6,7,7,5>: Cost 3 vext2 RHS, <7,5,1,7>
+ 1516786498U, // <6,7,7,6>: Cost 2 vext1 <6,6,7,7>, <6,6,7,7>
+ 1571214956U, // <6,7,7,7>: Cost 2 vext2 RHS, <7,7,7,7>
+ 1573205634U, // <6,7,7,u>: Cost 2 vext2 RHS, <7,u,1,2>
+ 1571215059U, // <6,7,u,0>: Cost 2 vext2 RHS, <u,0,1,2>
+ 497473326U, // <6,7,u,1>: Cost 1 vext2 RHS, LHS
+ 1571215237U, // <6,7,u,2>: Cost 2 vext2 RHS, <u,2,3,0>
+ 1571215292U, // <6,7,u,3>: Cost 2 vext2 RHS, <u,3,0,1>
+ 1571215423U, // <6,7,u,4>: Cost 2 vext2 RHS, <u,4,5,6>
+ 497473690U, // <6,7,u,5>: Cost 1 vext2 RHS, RHS
+ 1571215568U, // <6,7,u,6>: Cost 2 vext2 RHS, <u,6,3,7>
+ 1573206272U, // <6,7,u,7>: Cost 2 vext2 RHS, <u,7,0,1>
+ 497473893U, // <6,7,u,u>: Cost 1 vext2 RHS, LHS
+ 1571217408U, // <6,u,0,0>: Cost 2 vext2 RHS, <0,0,0,0>
+ 497475686U, // <6,u,0,1>: Cost 1 vext2 RHS, LHS
+ 1571217572U, // <6,u,0,2>: Cost 2 vext2 RHS, <0,2,0,2>
+ 2689865445U, // <6,u,0,3>: Cost 3 vext3 <0,u,2,6>, <u,0,3,2>
+ 1571217746U, // <6,u,0,4>: Cost 2 vext2 RHS, <0,4,1,5>
+ 1510830187U, // <6,u,0,5>: Cost 2 vext1 <5,6,u,0>, <5,6,u,0>
+ 2644959734U, // <6,u,0,6>: Cost 3 vext2 RHS, <0,6,1,7>
+ 1193130221U, // <6,u,0,7>: Cost 2 vrev <u,6,7,0>
+ 497476253U, // <6,u,0,u>: Cost 1 vext2 RHS, LHS
+ 1571218166U, // <6,u,1,0>: Cost 2 vext2 RHS, <1,0,3,2>
+ 1571218228U, // <6,u,1,1>: Cost 2 vext2 RHS, <1,1,1,1>
+ 1612289838U, // <6,u,1,2>: Cost 2 vext3 <0,2,4,6>, LHS
+ 1571218392U, // <6,u,1,3>: Cost 2 vext2 RHS, <1,3,1,3>
+ 2566663478U, // <6,u,1,4>: Cost 3 vext1 <2,6,u,1>, RHS
+ 1571218576U, // <6,u,1,5>: Cost 2 vext2 RHS, <1,5,3,7>
+ 2644960463U, // <6,u,1,6>: Cost 3 vext2 RHS, <1,6,1,7>
+ 2717439835U, // <6,u,1,7>: Cost 3 vext3 <5,4,7,6>, <u,1,7,3>
+ 1612289892U, // <6,u,1,u>: Cost 2 vext3 <0,2,4,6>, LHS
+ 1504870502U, // <6,u,2,0>: Cost 2 vext1 <4,6,u,2>, LHS
+ 2644960774U, // <6,u,2,1>: Cost 3 vext2 RHS, <2,1,0,3>
+ 1571219048U, // <6,u,2,2>: Cost 2 vext2 RHS, <2,2,2,2>
+ 1571219110U, // <6,u,2,3>: Cost 2 vext2 RHS, <2,3,0,1>
+ 1504873782U, // <6,u,2,4>: Cost 2 vext1 <4,6,u,2>, RHS
+ 2633017221U, // <6,u,2,5>: Cost 3 vext2 <2,5,6,u>, <2,5,6,u>
+ 1571219386U, // <6,u,2,6>: Cost 2 vext2 RHS, <2,6,3,7>
+ 2712573868U, // <6,u,2,7>: Cost 3 vext3 <4,6,4,6>, <u,2,7,3>
+ 1571219515U, // <6,u,2,u>: Cost 2 vext2 RHS, <2,u,0,1>
+ 1571219606U, // <6,u,3,0>: Cost 2 vext2 RHS, <3,0,1,2>
+ 2644961503U, // <6,u,3,1>: Cost 3 vext2 RHS, <3,1,0,3>
+ 2566678499U, // <6,u,3,2>: Cost 3 vext1 <2,6,u,3>, <2,6,u,3>
+ 1571219868U, // <6,u,3,3>: Cost 2 vext2 RHS, <3,3,3,3>
+ 1571219970U, // <6,u,3,4>: Cost 2 vext2 RHS, <3,4,5,6>
+ 2689865711U, // <6,u,3,5>: Cost 3 vext3 <0,u,2,6>, <u,3,5,7>
+ 2708002806U, // <6,u,3,6>: Cost 3 vext3 <3,u,5,6>, <u,3,6,5>
+ 2644961987U, // <6,u,3,7>: Cost 3 vext2 RHS, <3,7,0,1>
+ 1571220254U, // <6,u,3,u>: Cost 2 vext2 RHS, <3,u,1,2>
+ 1571220370U, // <6,u,4,0>: Cost 2 vext2 RHS, <4,0,5,1>
+ 2644962250U, // <6,u,4,1>: Cost 3 vext2 RHS, <4,1,2,3>
+ 1661245476U, // <6,u,4,2>: Cost 2 vext3 <u,4,2,6>, <u,4,2,6>
+ 2686031917U, // <6,u,4,3>: Cost 3 vext3 <0,2,4,6>, <u,4,3,6>
+ 1571220688U, // <6,u,4,4>: Cost 2 vext2 RHS, <4,4,4,4>
+ 497478967U, // <6,u,4,5>: Cost 1 vext2 RHS, RHS
+ 1571220852U, // <6,u,4,6>: Cost 2 vext2 RHS, <4,6,4,6>
+ 1661614161U, // <6,u,4,7>: Cost 2 vext3 <u,4,7,6>, <u,4,7,6>
+ 497479209U, // <6,u,4,u>: Cost 1 vext2 RHS, RHS
+ 2566692966U, // <6,u,5,0>: Cost 3 vext1 <2,6,u,5>, LHS
+ 1571221200U, // <6,u,5,1>: Cost 2 vext2 RHS, <5,1,7,3>
+ 2566694885U, // <6,u,5,2>: Cost 3 vext1 <2,6,u,5>, <2,6,u,5>
+ 2689865855U, // <6,u,5,3>: Cost 3 vext3 <0,u,2,6>, <u,5,3,7>
+ 1571221446U, // <6,u,5,4>: Cost 2 vext2 RHS, <5,4,7,6>
+ 1571221508U, // <6,u,5,5>: Cost 2 vext2 RHS, <5,5,5,5>
+ 1612290202U, // <6,u,5,6>: Cost 2 vext3 <0,2,4,6>, RHS
+ 1571221672U, // <6,u,5,7>: Cost 2 vext2 RHS, <5,7,5,7>
+ 1612290220U, // <6,u,5,u>: Cost 2 vext3 <0,2,4,6>, RHS
+ 1504903270U, // <6,u,6,0>: Cost 2 vext1 <4,6,u,6>, LHS
+ 2644963752U, // <6,u,6,1>: Cost 3 vext2 RHS, <6,1,7,2>
+ 1571222010U, // <6,u,6,2>: Cost 2 vext2 RHS, <6,2,7,3>
+ 2686032080U, // <6,u,6,3>: Cost 3 vext3 <0,2,4,6>, <u,6,3,7>
+ 1504906550U, // <6,u,6,4>: Cost 2 vext1 <4,6,u,6>, RHS
+ 2644964079U, // <6,u,6,5>: Cost 3 vext2 RHS, <6,5,7,5>
+ 296144182U, // <6,u,6,6>: Cost 1 vdup2 RHS
+ 1571222350U, // <6,u,6,7>: Cost 2 vext2 RHS, <6,7,0,1>
+ 296144182U, // <6,u,6,u>: Cost 1 vdup2 RHS
+ 1492967526U, // <6,u,7,0>: Cost 2 vext1 <2,6,u,7>, LHS
+ 2560738574U, // <6,u,7,1>: Cost 3 vext1 <1,6,u,7>, <1,6,u,7>
+ 1492969447U, // <6,u,7,2>: Cost 2 vext1 <2,6,u,7>, <2,6,u,7>
+ 1906753692U, // <6,u,7,3>: Cost 2 vzipr RHS, LHS
+ 1492970806U, // <6,u,7,4>: Cost 2 vext1 <2,6,u,7>, RHS
+ 2980495761U, // <6,u,7,5>: Cost 3 vzipr RHS, <0,4,u,5>
+ 1516860235U, // <6,u,7,6>: Cost 2 vext1 <6,6,u,7>, <6,6,u,7>
+ 1906756936U, // <6,u,7,7>: Cost 2 vzipr RHS, RHS
+ 1492973358U, // <6,u,7,u>: Cost 2 vext1 <2,6,u,7>, LHS
+ 1492975718U, // <6,u,u,0>: Cost 2 vext1 <2,6,u,u>, LHS
+ 497481518U, // <6,u,u,1>: Cost 1 vext2 RHS, LHS
+ 1612290405U, // <6,u,u,2>: Cost 2 vext3 <0,2,4,6>, LHS
+ 1571223484U, // <6,u,u,3>: Cost 2 vext2 RHS, <u,3,0,1>
+ 1492978998U, // <6,u,u,4>: Cost 2 vext1 <2,6,u,u>, RHS
+ 497481882U, // <6,u,u,5>: Cost 1 vext2 RHS, RHS
+ 296144182U, // <6,u,u,6>: Cost 1 vdup2 RHS
+ 1906765128U, // <6,u,u,7>: Cost 2 vzipr RHS, RHS
+ 497482085U, // <6,u,u,u>: Cost 1 vext2 RHS, LHS
+ 1638318080U, // <7,0,0,0>: Cost 2 vext3 RHS, <0,0,0,0>
+ 1638318090U, // <7,0,0,1>: Cost 2 vext3 RHS, <0,0,1,1>
+ 1638318100U, // <7,0,0,2>: Cost 2 vext3 RHS, <0,0,2,2>
+ 3646442178U, // <7,0,0,3>: Cost 4 vext1 <3,7,0,0>, <3,7,0,0>
+ 2712059941U, // <7,0,0,4>: Cost 3 vext3 RHS, <0,0,4,1>
+ 2651603364U, // <7,0,0,5>: Cost 3 vext2 <5,6,7,0>, <0,5,1,6>
+ 2590618445U, // <7,0,0,6>: Cost 3 vext1 <6,7,0,0>, <6,7,0,0>
+ 3785801798U, // <7,0,0,7>: Cost 4 vext3 RHS, <0,0,7,7>
+ 1638318153U, // <7,0,0,u>: Cost 2 vext3 RHS, <0,0,u,1>
+ 1516879974U, // <7,0,1,0>: Cost 2 vext1 <6,7,0,1>, LHS
+ 2693922911U, // <7,0,1,1>: Cost 3 vext3 <1,5,3,7>, <0,1,1,5>
+ 564576358U, // <7,0,1,2>: Cost 1 vext3 RHS, LHS
+ 2638996480U, // <7,0,1,3>: Cost 3 vext2 <3,5,7,0>, <1,3,5,7>
+ 1516883254U, // <7,0,1,4>: Cost 2 vext1 <6,7,0,1>, RHS
+ 2649613456U, // <7,0,1,5>: Cost 3 vext2 <5,3,7,0>, <1,5,3,7>
+ 1516884814U, // <7,0,1,6>: Cost 2 vext1 <6,7,0,1>, <6,7,0,1>
+ 2590626808U, // <7,0,1,7>: Cost 3 vext1 <6,7,0,1>, <7,0,1,0>
+ 564576412U, // <7,0,1,u>: Cost 1 vext3 RHS, LHS
+ 1638318244U, // <7,0,2,0>: Cost 2 vext3 RHS, <0,2,0,2>
+ 2692743344U, // <7,0,2,1>: Cost 3 vext3 <1,3,5,7>, <0,2,1,5>
+ 2712060084U, // <7,0,2,2>: Cost 3 vext3 RHS, <0,2,2,0>
+ 2712060094U, // <7,0,2,3>: Cost 3 vext3 RHS, <0,2,3,1>
+ 1638318284U, // <7,0,2,4>: Cost 2 vext3 RHS, <0,2,4,6>
+ 2712060118U, // <7,0,2,5>: Cost 3 vext3 RHS, <0,2,5,7>
+ 2651604922U, // <7,0,2,6>: Cost 3 vext2 <5,6,7,0>, <2,6,3,7>
+ 2686255336U, // <7,0,2,7>: Cost 3 vext3 <0,2,7,7>, <0,2,7,7>
+ 1638318316U, // <7,0,2,u>: Cost 2 vext3 RHS, <0,2,u,2>
+ 2651605142U, // <7,0,3,0>: Cost 3 vext2 <5,6,7,0>, <3,0,1,2>
+ 2712060156U, // <7,0,3,1>: Cost 3 vext3 RHS, <0,3,1,0>
+ 2712060165U, // <7,0,3,2>: Cost 3 vext3 RHS, <0,3,2,0>
+ 2651605404U, // <7,0,3,3>: Cost 3 vext2 <5,6,7,0>, <3,3,3,3>
+ 2651605506U, // <7,0,3,4>: Cost 3 vext2 <5,6,7,0>, <3,4,5,6>
+ 2638998111U, // <7,0,3,5>: Cost 3 vext2 <3,5,7,0>, <3,5,7,0>
+ 2639661744U, // <7,0,3,6>: Cost 3 vext2 <3,6,7,0>, <3,6,7,0>
+ 3712740068U, // <7,0,3,7>: Cost 4 vext2 <3,5,7,0>, <3,7,3,7>
+ 2640989010U, // <7,0,3,u>: Cost 3 vext2 <3,u,7,0>, <3,u,7,0>
+ 2712060232U, // <7,0,4,0>: Cost 3 vext3 RHS, <0,4,0,4>
+ 1638318418U, // <7,0,4,1>: Cost 2 vext3 RHS, <0,4,1,5>
+ 1638318428U, // <7,0,4,2>: Cost 2 vext3 RHS, <0,4,2,6>
+ 3646474950U, // <7,0,4,3>: Cost 4 vext1 <3,7,0,4>, <3,7,0,4>
+ 2712060270U, // <7,0,4,4>: Cost 3 vext3 RHS, <0,4,4,6>
+ 1577864502U, // <7,0,4,5>: Cost 2 vext2 <5,6,7,0>, RHS
+ 2651606388U, // <7,0,4,6>: Cost 3 vext2 <5,6,7,0>, <4,6,4,6>
+ 3787792776U, // <7,0,4,7>: Cost 4 vext3 RHS, <0,4,7,5>
+ 1638318481U, // <7,0,4,u>: Cost 2 vext3 RHS, <0,4,u,5>
+ 2590654566U, // <7,0,5,0>: Cost 3 vext1 <6,7,0,5>, LHS
+ 2651606736U, // <7,0,5,1>: Cost 3 vext2 <5,6,7,0>, <5,1,7,3>
+ 2712060334U, // <7,0,5,2>: Cost 3 vext3 RHS, <0,5,2,7>
+ 2649616239U, // <7,0,5,3>: Cost 3 vext2 <5,3,7,0>, <5,3,7,0>
+ 2651606982U, // <7,0,5,4>: Cost 3 vext2 <5,6,7,0>, <5,4,7,6>
+ 2651607044U, // <7,0,5,5>: Cost 3 vext2 <5,6,7,0>, <5,5,5,5>
+ 1577865314U, // <7,0,5,6>: Cost 2 vext2 <5,6,7,0>, <5,6,7,0>
+ 2651607208U, // <7,0,5,7>: Cost 3 vext2 <5,6,7,0>, <5,7,5,7>
+ 1579192580U, // <7,0,5,u>: Cost 2 vext2 <5,u,7,0>, <5,u,7,0>
+ 2688393709U, // <7,0,6,0>: Cost 3 vext3 <0,6,0,7>, <0,6,0,7>
+ 2712060406U, // <7,0,6,1>: Cost 3 vext3 RHS, <0,6,1,7>
+ 2688541183U, // <7,0,6,2>: Cost 3 vext3 <0,6,2,7>, <0,6,2,7>
+ 2655588936U, // <7,0,6,3>: Cost 3 vext2 <6,3,7,0>, <6,3,7,0>
+ 3762430481U, // <7,0,6,4>: Cost 4 vext3 <0,6,4,7>, <0,6,4,7>
+ 2651607730U, // <7,0,6,5>: Cost 3 vext2 <5,6,7,0>, <6,5,0,7>
+ 2651607864U, // <7,0,6,6>: Cost 3 vext2 <5,6,7,0>, <6,6,6,6>
+ 2651607886U, // <7,0,6,7>: Cost 3 vext2 <5,6,7,0>, <6,7,0,1>
+ 2688983605U, // <7,0,6,u>: Cost 3 vext3 <0,6,u,7>, <0,6,u,7>
+ 2651608058U, // <7,0,7,0>: Cost 3 vext2 <5,6,7,0>, <7,0,1,2>
+ 2932703334U, // <7,0,7,1>: Cost 3 vzipl <7,7,7,7>, LHS
+ 3066921062U, // <7,0,7,2>: Cost 3 vtrnl <7,7,7,7>, LHS
+ 3712742678U, // <7,0,7,3>: Cost 4 vext2 <3,5,7,0>, <7,3,5,7>
+ 2651608422U, // <7,0,7,4>: Cost 3 vext2 <5,6,7,0>, <7,4,5,6>
+ 2651608513U, // <7,0,7,5>: Cost 3 vext2 <5,6,7,0>, <7,5,6,7>
+ 2663552532U, // <7,0,7,6>: Cost 3 vext2 <7,6,7,0>, <7,6,7,0>
+ 2651608684U, // <7,0,7,7>: Cost 3 vext2 <5,6,7,0>, <7,7,7,7>
+ 2651608706U, // <7,0,7,u>: Cost 3 vext2 <5,6,7,0>, <7,u,1,2>
+ 1638318730U, // <7,0,u,0>: Cost 2 vext3 RHS, <0,u,0,2>
+ 1638318738U, // <7,0,u,1>: Cost 2 vext3 RHS, <0,u,1,1>
+ 564576925U, // <7,0,u,2>: Cost 1 vext3 RHS, LHS
+ 2572765898U, // <7,0,u,3>: Cost 3 vext1 <3,7,0,u>, <3,7,0,u>
+ 1638318770U, // <7,0,u,4>: Cost 2 vext3 RHS, <0,u,4,6>
+ 1577867418U, // <7,0,u,5>: Cost 2 vext2 <5,6,7,0>, RHS
+ 1516942165U, // <7,0,u,6>: Cost 2 vext1 <6,7,0,u>, <6,7,0,u>
+ 2651609344U, // <7,0,u,7>: Cost 3 vext2 <5,6,7,0>, <u,7,0,1>
+ 564576979U, // <7,0,u,u>: Cost 1 vext3 RHS, LHS
+ 2590687334U, // <7,1,0,0>: Cost 3 vext1 <6,7,1,0>, LHS
+ 2639003750U, // <7,1,0,1>: Cost 3 vext2 <3,5,7,1>, LHS
+ 2793357414U, // <7,1,0,2>: Cost 3 vuzpl <7,0,1,2>, LHS
+ 1638318838U, // <7,1,0,3>: Cost 2 vext3 RHS, <1,0,3,2>
+ 2590690614U, // <7,1,0,4>: Cost 3 vext1 <6,7,1,0>, RHS
+ 2712060679U, // <7,1,0,5>: Cost 3 vext3 RHS, <1,0,5,1>
+ 2590692182U, // <7,1,0,6>: Cost 3 vext1 <6,7,1,0>, <6,7,1,0>
+ 3785802521U, // <7,1,0,7>: Cost 4 vext3 RHS, <1,0,7,1>
+ 1638318883U, // <7,1,0,u>: Cost 2 vext3 RHS, <1,0,u,2>
+ 2712060715U, // <7,1,1,0>: Cost 3 vext3 RHS, <1,1,0,1>
+ 1638318900U, // <7,1,1,1>: Cost 2 vext3 RHS, <1,1,1,1>
+ 3774300994U, // <7,1,1,2>: Cost 4 vext3 <2,6,3,7>, <1,1,2,6>
+ 1638318920U, // <7,1,1,3>: Cost 2 vext3 RHS, <1,1,3,3>
+ 2712060755U, // <7,1,1,4>: Cost 3 vext3 RHS, <1,1,4,5>
+ 2691416926U, // <7,1,1,5>: Cost 3 vext3 <1,1,5,7>, <1,1,5,7>
+ 2590700375U, // <7,1,1,6>: Cost 3 vext1 <6,7,1,1>, <6,7,1,1>
+ 3765158766U, // <7,1,1,7>: Cost 4 vext3 <1,1,5,7>, <1,1,7,5>
+ 1638318965U, // <7,1,1,u>: Cost 2 vext3 RHS, <1,1,u,3>
+ 2712060796U, // <7,1,2,0>: Cost 3 vext3 RHS, <1,2,0,1>
+ 2712060807U, // <7,1,2,1>: Cost 3 vext3 RHS, <1,2,1,3>
+ 3712747112U, // <7,1,2,2>: Cost 4 vext2 <3,5,7,1>, <2,2,2,2>
+ 1638318998U, // <7,1,2,3>: Cost 2 vext3 RHS, <1,2,3,0>
+ 2712060836U, // <7,1,2,4>: Cost 3 vext3 RHS, <1,2,4,5>
+ 2712060843U, // <7,1,2,5>: Cost 3 vext3 RHS, <1,2,5,3>
+ 2590708568U, // <7,1,2,6>: Cost 3 vext1 <6,7,1,2>, <6,7,1,2>
+ 2735948730U, // <7,1,2,7>: Cost 3 vext3 RHS, <1,2,7,0>
+ 1638319043U, // <7,1,2,u>: Cost 2 vext3 RHS, <1,2,u,0>
+ 2712060876U, // <7,1,3,0>: Cost 3 vext3 RHS, <1,3,0,0>
+ 1638319064U, // <7,1,3,1>: Cost 2 vext3 RHS, <1,3,1,3>
+ 2712060894U, // <7,1,3,2>: Cost 3 vext3 RHS, <1,3,2,0>
+ 2692596718U, // <7,1,3,3>: Cost 3 vext3 <1,3,3,7>, <1,3,3,7>
+ 2712060917U, // <7,1,3,4>: Cost 3 vext3 RHS, <1,3,4,5>
+ 1619002368U, // <7,1,3,5>: Cost 2 vext3 <1,3,5,7>, <1,3,5,7>
+ 2692817929U, // <7,1,3,6>: Cost 3 vext3 <1,3,6,7>, <1,3,6,7>
+ 2735948814U, // <7,1,3,7>: Cost 3 vext3 RHS, <1,3,7,3>
+ 1619223579U, // <7,1,3,u>: Cost 2 vext3 <1,3,u,7>, <1,3,u,7>
+ 2712060962U, // <7,1,4,0>: Cost 3 vext3 RHS, <1,4,0,5>
+ 2712060971U, // <7,1,4,1>: Cost 3 vext3 RHS, <1,4,1,5>
+ 2712060980U, // <7,1,4,2>: Cost 3 vext3 RHS, <1,4,2,5>
+ 2712060989U, // <7,1,4,3>: Cost 3 vext3 RHS, <1,4,3,5>
+ 3785802822U, // <7,1,4,4>: Cost 4 vext3 RHS, <1,4,4,5>
+ 2639007030U, // <7,1,4,5>: Cost 3 vext2 <3,5,7,1>, RHS
+ 2645642634U, // <7,1,4,6>: Cost 3 vext2 <4,6,7,1>, <4,6,7,1>
+ 3719384520U, // <7,1,4,7>: Cost 4 vext2 <4,6,7,1>, <4,7,5,0>
+ 2639007273U, // <7,1,4,u>: Cost 3 vext2 <3,5,7,1>, RHS
+ 2572812390U, // <7,1,5,0>: Cost 3 vext1 <3,7,1,5>, LHS
+ 2693776510U, // <7,1,5,1>: Cost 3 vext3 <1,5,1,7>, <1,5,1,7>
+ 3774301318U, // <7,1,5,2>: Cost 4 vext3 <2,6,3,7>, <1,5,2,6>
+ 1620182160U, // <7,1,5,3>: Cost 2 vext3 <1,5,3,7>, <1,5,3,7>
+ 2572815670U, // <7,1,5,4>: Cost 3 vext1 <3,7,1,5>, RHS
+ 3766486178U, // <7,1,5,5>: Cost 4 vext3 <1,3,5,7>, <1,5,5,7>
+ 2651615331U, // <7,1,5,6>: Cost 3 vext2 <5,6,7,1>, <5,6,7,1>
+ 2652278964U, // <7,1,5,7>: Cost 3 vext2 <5,7,7,1>, <5,7,7,1>
+ 1620550845U, // <7,1,5,u>: Cost 2 vext3 <1,5,u,7>, <1,5,u,7>
+ 3768108230U, // <7,1,6,0>: Cost 4 vext3 <1,6,0,7>, <1,6,0,7>
+ 2694440143U, // <7,1,6,1>: Cost 3 vext3 <1,6,1,7>, <1,6,1,7>
+ 2712061144U, // <7,1,6,2>: Cost 3 vext3 RHS, <1,6,2,7>
+ 2694587617U, // <7,1,6,3>: Cost 3 vext3 <1,6,3,7>, <1,6,3,7>
+ 3768403178U, // <7,1,6,4>: Cost 4 vext3 <1,6,4,7>, <1,6,4,7>
+ 2694735091U, // <7,1,6,5>: Cost 3 vext3 <1,6,5,7>, <1,6,5,7>
+ 3768550652U, // <7,1,6,6>: Cost 4 vext3 <1,6,6,7>, <1,6,6,7>
+ 2652279630U, // <7,1,6,7>: Cost 3 vext2 <5,7,7,1>, <6,7,0,1>
+ 2694956302U, // <7,1,6,u>: Cost 3 vext3 <1,6,u,7>, <1,6,u,7>
+ 2645644282U, // <7,1,7,0>: Cost 3 vext2 <4,6,7,1>, <7,0,1,2>
+ 2859062094U, // <7,1,7,1>: Cost 3 vuzpr <6,7,0,1>, <6,7,0,1>
+ 3779462437U, // <7,1,7,2>: Cost 4 vext3 <3,5,1,7>, <1,7,2,3>
+ 3121938534U, // <7,1,7,3>: Cost 3 vtrnr <5,7,5,7>, LHS
+ 2554916150U, // <7,1,7,4>: Cost 3 vext1 <0,7,1,7>, RHS
+ 3769140548U, // <7,1,7,5>: Cost 4 vext3 <1,7,5,7>, <1,7,5,7>
+ 3726022164U, // <7,1,7,6>: Cost 4 vext2 <5,7,7,1>, <7,6,7,0>
+ 2554918508U, // <7,1,7,7>: Cost 3 vext1 <0,7,1,7>, <7,7,7,7>
+ 3121938539U, // <7,1,7,u>: Cost 3 vtrnr <5,7,5,7>, LHS
+ 2572836966U, // <7,1,u,0>: Cost 3 vext1 <3,7,1,u>, LHS
+ 1638319469U, // <7,1,u,1>: Cost 2 vext3 RHS, <1,u,1,3>
+ 2712061299U, // <7,1,u,2>: Cost 3 vext3 RHS, <1,u,2,0>
+ 1622173059U, // <7,1,u,3>: Cost 2 vext3 <1,u,3,7>, <1,u,3,7>
+ 2572840246U, // <7,1,u,4>: Cost 3 vext1 <3,7,1,u>, RHS
+ 1622320533U, // <7,1,u,5>: Cost 2 vext3 <1,u,5,7>, <1,u,5,7>
+ 2696136094U, // <7,1,u,6>: Cost 3 vext3 <1,u,6,7>, <1,u,6,7>
+ 2859060777U, // <7,1,u,7>: Cost 3 vuzpr <6,7,0,1>, RHS
+ 1622541744U, // <7,1,u,u>: Cost 2 vext3 <1,u,u,7>, <1,u,u,7>
+ 2712061364U, // <7,2,0,0>: Cost 3 vext3 RHS, <2,0,0,2>
+ 2712061373U, // <7,2,0,1>: Cost 3 vext3 RHS, <2,0,1,2>
+ 2712061380U, // <7,2,0,2>: Cost 3 vext3 RHS, <2,0,2,0>
+ 2712061389U, // <7,2,0,3>: Cost 3 vext3 RHS, <2,0,3,0>
+ 2712061404U, // <7,2,0,4>: Cost 3 vext3 RHS, <2,0,4,6>
+ 2696725990U, // <7,2,0,5>: Cost 3 vext3 <2,0,5,7>, <2,0,5,7>
+ 2712061417U, // <7,2,0,6>: Cost 3 vext3 RHS, <2,0,6,1>
+ 3785803251U, // <7,2,0,7>: Cost 4 vext3 RHS, <2,0,7,2>
+ 2696947201U, // <7,2,0,u>: Cost 3 vext3 <2,0,u,7>, <2,0,u,7>
+ 2712061446U, // <7,2,1,0>: Cost 3 vext3 RHS, <2,1,0,3>
+ 3785803276U, // <7,2,1,1>: Cost 4 vext3 RHS, <2,1,1,0>
+ 3785803285U, // <7,2,1,2>: Cost 4 vext3 RHS, <2,1,2,0>
+ 2712061471U, // <7,2,1,3>: Cost 3 vext3 RHS, <2,1,3,1>
+ 2712061482U, // <7,2,1,4>: Cost 3 vext3 RHS, <2,1,4,3>
+ 3766486576U, // <7,2,1,5>: Cost 4 vext3 <1,3,5,7>, <2,1,5,0>
+ 2712061500U, // <7,2,1,6>: Cost 3 vext3 RHS, <2,1,6,3>
+ 2602718850U, // <7,2,1,7>: Cost 3 vext1 <u,7,2,1>, <7,u,1,2>
+ 2712061516U, // <7,2,1,u>: Cost 3 vext3 RHS, <2,1,u,1>
+ 2712061525U, // <7,2,2,0>: Cost 3 vext3 RHS, <2,2,0,1>
+ 2712061536U, // <7,2,2,1>: Cost 3 vext3 RHS, <2,2,1,3>
+ 1638319720U, // <7,2,2,2>: Cost 2 vext3 RHS, <2,2,2,2>
+ 1638319730U, // <7,2,2,3>: Cost 2 vext3 RHS, <2,2,3,3>
+ 2712061565U, // <7,2,2,4>: Cost 3 vext3 RHS, <2,2,4,5>
+ 2698053256U, // <7,2,2,5>: Cost 3 vext3 <2,2,5,7>, <2,2,5,7>
+ 2712061584U, // <7,2,2,6>: Cost 3 vext3 RHS, <2,2,6,6>
+ 3771795096U, // <7,2,2,7>: Cost 4 vext3 <2,2,5,7>, <2,2,7,5>
+ 1638319775U, // <7,2,2,u>: Cost 2 vext3 RHS, <2,2,u,3>
+ 1638319782U, // <7,2,3,0>: Cost 2 vext3 RHS, <2,3,0,1>
+ 2693924531U, // <7,2,3,1>: Cost 3 vext3 <1,5,3,7>, <2,3,1,5>
+ 2700560061U, // <7,2,3,2>: Cost 3 vext3 <2,6,3,7>, <2,3,2,6>
+ 2693924551U, // <7,2,3,3>: Cost 3 vext3 <1,5,3,7>, <2,3,3,7>
+ 1638319822U, // <7,2,3,4>: Cost 2 vext3 RHS, <2,3,4,5>
+ 2698716889U, // <7,2,3,5>: Cost 3 vext3 <2,3,5,7>, <2,3,5,7>
+ 2712061665U, // <7,2,3,6>: Cost 3 vext3 RHS, <2,3,6,6>
+ 2735949540U, // <7,2,3,7>: Cost 3 vext3 RHS, <2,3,7,0>
+ 1638319854U, // <7,2,3,u>: Cost 2 vext3 RHS, <2,3,u,1>
+ 2712061692U, // <7,2,4,0>: Cost 3 vext3 RHS, <2,4,0,6>
+ 2712061698U, // <7,2,4,1>: Cost 3 vext3 RHS, <2,4,1,3>
+ 2712061708U, // <7,2,4,2>: Cost 3 vext3 RHS, <2,4,2,4>
+ 2712061718U, // <7,2,4,3>: Cost 3 vext3 RHS, <2,4,3,5>
+ 2712061728U, // <7,2,4,4>: Cost 3 vext3 RHS, <2,4,4,6>
+ 2699380522U, // <7,2,4,5>: Cost 3 vext3 <2,4,5,7>, <2,4,5,7>
+ 2712061740U, // <7,2,4,6>: Cost 3 vext3 RHS, <2,4,6,0>
+ 3809691445U, // <7,2,4,7>: Cost 4 vext3 RHS, <2,4,7,0>
+ 2699601733U, // <7,2,4,u>: Cost 3 vext3 <2,4,u,7>, <2,4,u,7>
+ 2699675470U, // <7,2,5,0>: Cost 3 vext3 <2,5,0,7>, <2,5,0,7>
+ 3766486867U, // <7,2,5,1>: Cost 4 vext3 <1,3,5,7>, <2,5,1,3>
+ 2699822944U, // <7,2,5,2>: Cost 3 vext3 <2,5,2,7>, <2,5,2,7>
+ 2692745065U, // <7,2,5,3>: Cost 3 vext3 <1,3,5,7>, <2,5,3,7>
+ 2699970418U, // <7,2,5,4>: Cost 3 vext3 <2,5,4,7>, <2,5,4,7>
+ 3766486907U, // <7,2,5,5>: Cost 4 vext3 <1,3,5,7>, <2,5,5,7>
+ 2700117892U, // <7,2,5,6>: Cost 3 vext3 <2,5,6,7>, <2,5,6,7>
+ 3771795334U, // <7,2,5,7>: Cost 4 vext3 <2,2,5,7>, <2,5,7,0>
+ 2692745110U, // <7,2,5,u>: Cost 3 vext3 <1,3,5,7>, <2,5,u,7>
+ 2572894310U, // <7,2,6,0>: Cost 3 vext1 <3,7,2,6>, LHS
+ 2712061860U, // <7,2,6,1>: Cost 3 vext3 RHS, <2,6,1,3>
+ 2700486577U, // <7,2,6,2>: Cost 3 vext3 <2,6,2,7>, <2,6,2,7>
+ 1626818490U, // <7,2,6,3>: Cost 2 vext3 <2,6,3,7>, <2,6,3,7>
+ 2572897590U, // <7,2,6,4>: Cost 3 vext1 <3,7,2,6>, RHS
+ 2700707788U, // <7,2,6,5>: Cost 3 vext3 <2,6,5,7>, <2,6,5,7>
+ 2700781525U, // <7,2,6,6>: Cost 3 vext3 <2,6,6,7>, <2,6,6,7>
+ 3774597086U, // <7,2,6,7>: Cost 4 vext3 <2,6,7,7>, <2,6,7,7>
+ 1627187175U, // <7,2,6,u>: Cost 2 vext3 <2,6,u,7>, <2,6,u,7>
+ 2735949802U, // <7,2,7,0>: Cost 3 vext3 RHS, <2,7,0,1>
+ 3780200434U, // <7,2,7,1>: Cost 4 vext3 <3,6,2,7>, <2,7,1,0>
+ 3773564928U, // <7,2,7,2>: Cost 4 vext3 <2,5,2,7>, <2,7,2,5>
+ 2986541158U, // <7,2,7,3>: Cost 3 vzipr <5,5,7,7>, LHS
+ 2554989878U, // <7,2,7,4>: Cost 3 vext1 <0,7,2,7>, RHS
+ 3775113245U, // <7,2,7,5>: Cost 4 vext3 <2,7,5,7>, <2,7,5,7>
+ 4060283228U, // <7,2,7,6>: Cost 4 vzipr <5,5,7,7>, <0,4,2,6>
+ 2554992236U, // <7,2,7,7>: Cost 3 vext1 <0,7,2,7>, <7,7,7,7>
+ 2986541163U, // <7,2,7,u>: Cost 3 vzipr <5,5,7,7>, LHS
+ 1638320187U, // <7,2,u,0>: Cost 2 vext3 RHS, <2,u,0,1>
+ 2693924936U, // <7,2,u,1>: Cost 3 vext3 <1,5,3,7>, <2,u,1,5>
+ 1638319720U, // <7,2,u,2>: Cost 2 vext3 RHS, <2,2,2,2>
+ 1628145756U, // <7,2,u,3>: Cost 2 vext3 <2,u,3,7>, <2,u,3,7>
+ 1638320227U, // <7,2,u,4>: Cost 2 vext3 RHS, <2,u,4,5>
+ 2702035054U, // <7,2,u,5>: Cost 3 vext3 <2,u,5,7>, <2,u,5,7>
+ 2702108791U, // <7,2,u,6>: Cost 3 vext3 <2,u,6,7>, <2,u,6,7>
+ 2735949945U, // <7,2,u,7>: Cost 3 vext3 RHS, <2,u,7,0>
+ 1628514441U, // <7,2,u,u>: Cost 2 vext3 <2,u,u,7>, <2,u,u,7>
+ 2712062091U, // <7,3,0,0>: Cost 3 vext3 RHS, <3,0,0,0>
+ 1638320278U, // <7,3,0,1>: Cost 2 vext3 RHS, <3,0,1,2>
+ 2712062109U, // <7,3,0,2>: Cost 3 vext3 RHS, <3,0,2,0>
+ 2590836886U, // <7,3,0,3>: Cost 3 vext1 <6,7,3,0>, <3,0,1,2>
+ 2712062128U, // <7,3,0,4>: Cost 3 vext3 RHS, <3,0,4,1>
+ 2712062138U, // <7,3,0,5>: Cost 3 vext3 RHS, <3,0,5,2>
+ 2590839656U, // <7,3,0,6>: Cost 3 vext1 <6,7,3,0>, <6,7,3,0>
+ 3311414017U, // <7,3,0,7>: Cost 4 vrev <3,7,7,0>
+ 1638320341U, // <7,3,0,u>: Cost 2 vext3 RHS, <3,0,u,2>
+ 2237164227U, // <7,3,1,0>: Cost 3 vrev <3,7,0,1>
+ 2712062182U, // <7,3,1,1>: Cost 3 vext3 RHS, <3,1,1,1>
+ 2712062193U, // <7,3,1,2>: Cost 3 vext3 RHS, <3,1,2,3>
+ 2692745468U, // <7,3,1,3>: Cost 3 vext3 <1,3,5,7>, <3,1,3,5>
+ 2712062214U, // <7,3,1,4>: Cost 3 vext3 RHS, <3,1,4,6>
+ 2693925132U, // <7,3,1,5>: Cost 3 vext3 <1,5,3,7>, <3,1,5,3>
+ 3768183059U, // <7,3,1,6>: Cost 4 vext3 <1,6,1,7>, <3,1,6,1>
+ 2692745504U, // <7,3,1,7>: Cost 3 vext3 <1,3,5,7>, <3,1,7,5>
+ 2696063273U, // <7,3,1,u>: Cost 3 vext3 <1,u,5,7>, <3,1,u,5>
+ 2712062254U, // <7,3,2,0>: Cost 3 vext3 RHS, <3,2,0,1>
+ 2712062262U, // <7,3,2,1>: Cost 3 vext3 RHS, <3,2,1,0>
+ 2712062273U, // <7,3,2,2>: Cost 3 vext3 RHS, <3,2,2,2>
+ 2712062280U, // <7,3,2,3>: Cost 3 vext3 RHS, <3,2,3,0>
+ 2712062294U, // <7,3,2,4>: Cost 3 vext3 RHS, <3,2,4,5>
+ 2712062302U, // <7,3,2,5>: Cost 3 vext3 RHS, <3,2,5,4>
+ 2700560742U, // <7,3,2,6>: Cost 3 vext3 <2,6,3,7>, <3,2,6,3>
+ 2712062319U, // <7,3,2,7>: Cost 3 vext3 RHS, <3,2,7,3>
+ 2712062325U, // <7,3,2,u>: Cost 3 vext3 RHS, <3,2,u,0>
+ 2712062335U, // <7,3,3,0>: Cost 3 vext3 RHS, <3,3,0,1>
+ 2636368158U, // <7,3,3,1>: Cost 3 vext2 <3,1,7,3>, <3,1,7,3>
+ 2637031791U, // <7,3,3,2>: Cost 3 vext2 <3,2,7,3>, <3,2,7,3>
+ 1638320540U, // <7,3,3,3>: Cost 2 vext3 RHS, <3,3,3,3>
+ 2712062374U, // <7,3,3,4>: Cost 3 vext3 RHS, <3,3,4,4>
+ 2704689586U, // <7,3,3,5>: Cost 3 vext3 <3,3,5,7>, <3,3,5,7>
+ 2590864235U, // <7,3,3,6>: Cost 3 vext1 <6,7,3,3>, <6,7,3,3>
+ 2704837060U, // <7,3,3,7>: Cost 3 vext3 <3,3,7,7>, <3,3,7,7>
+ 1638320540U, // <7,3,3,u>: Cost 2 vext3 RHS, <3,3,3,3>
+ 2712062416U, // <7,3,4,0>: Cost 3 vext3 RHS, <3,4,0,1>
+ 2712062426U, // <7,3,4,1>: Cost 3 vext3 RHS, <3,4,1,2>
+ 2566981640U, // <7,3,4,2>: Cost 3 vext1 <2,7,3,4>, <2,7,3,4>
+ 2712062447U, // <7,3,4,3>: Cost 3 vext3 RHS, <3,4,3,5>
+ 2712062456U, // <7,3,4,4>: Cost 3 vext3 RHS, <3,4,4,5>
+ 1638320642U, // <7,3,4,5>: Cost 2 vext3 RHS, <3,4,5,6>
+ 2648313204U, // <7,3,4,6>: Cost 3 vext2 <5,1,7,3>, <4,6,4,6>
+ 3311446789U, // <7,3,4,7>: Cost 4 vrev <3,7,7,4>
+ 1638320669U, // <7,3,4,u>: Cost 2 vext3 RHS, <3,4,u,6>
+ 2602819686U, // <7,3,5,0>: Cost 3 vext1 <u,7,3,5>, LHS
+ 1574571728U, // <7,3,5,1>: Cost 2 vext2 <5,1,7,3>, <5,1,7,3>
+ 2648977185U, // <7,3,5,2>: Cost 3 vext2 <5,2,7,3>, <5,2,7,3>
+ 2705869378U, // <7,3,5,3>: Cost 3 vext3 <3,5,3,7>, <3,5,3,7>
+ 2237491947U, // <7,3,5,4>: Cost 3 vrev <3,7,4,5>
+ 2706016852U, // <7,3,5,5>: Cost 3 vext3 <3,5,5,7>, <3,5,5,7>
+ 2648313954U, // <7,3,5,6>: Cost 3 vext2 <5,1,7,3>, <5,6,7,0>
+ 2692745823U, // <7,3,5,7>: Cost 3 vext3 <1,3,5,7>, <3,5,7,0>
+ 1579217159U, // <7,3,5,u>: Cost 2 vext2 <5,u,7,3>, <5,u,7,3>
+ 2706311800U, // <7,3,6,0>: Cost 3 vext3 <3,6,0,7>, <3,6,0,7>
+ 2654286249U, // <7,3,6,1>: Cost 3 vext2 <6,1,7,3>, <6,1,7,3>
+ 1581208058U, // <7,3,6,2>: Cost 2 vext2 <6,2,7,3>, <6,2,7,3>
+ 2706533011U, // <7,3,6,3>: Cost 3 vext3 <3,6,3,7>, <3,6,3,7>
+ 2706606748U, // <7,3,6,4>: Cost 3 vext3 <3,6,4,7>, <3,6,4,7>
+ 3780422309U, // <7,3,6,5>: Cost 4 vext3 <3,6,5,7>, <3,6,5,7>
+ 2712062637U, // <7,3,6,6>: Cost 3 vext3 RHS, <3,6,6,6>
+ 2706827959U, // <7,3,6,7>: Cost 3 vext3 <3,6,7,7>, <3,6,7,7>
+ 1585189856U, // <7,3,6,u>: Cost 2 vext2 <6,u,7,3>, <6,u,7,3>
+ 2693925571U, // <7,3,7,0>: Cost 3 vext3 <1,5,3,7>, <3,7,0,1>
+ 2693925584U, // <7,3,7,1>: Cost 3 vext3 <1,5,3,7>, <3,7,1,5>
+ 2700561114U, // <7,3,7,2>: Cost 3 vext3 <2,6,3,7>, <3,7,2,6>
+ 2572978916U, // <7,3,7,3>: Cost 3 vext1 <3,7,3,7>, <3,7,3,7>
+ 2693925611U, // <7,3,7,4>: Cost 3 vext3 <1,5,3,7>, <3,7,4,5>
+ 2707344118U, // <7,3,7,5>: Cost 3 vext3 <3,7,5,7>, <3,7,5,7>
+ 2654950894U, // <7,3,7,6>: Cost 3 vext2 <6,2,7,3>, <7,6,2,7>
+ 2648315500U, // <7,3,7,7>: Cost 3 vext2 <5,1,7,3>, <7,7,7,7>
+ 2693925643U, // <7,3,7,u>: Cost 3 vext3 <1,5,3,7>, <3,7,u,1>
+ 2237221578U, // <7,3,u,0>: Cost 3 vrev <3,7,0,u>
+ 1638320926U, // <7,3,u,1>: Cost 2 vext3 RHS, <3,u,1,2>
+ 1593153452U, // <7,3,u,2>: Cost 2 vext2 <u,2,7,3>, <u,2,7,3>
+ 1638320540U, // <7,3,u,3>: Cost 2 vext3 RHS, <3,3,3,3>
+ 2237516526U, // <7,3,u,4>: Cost 3 vrev <3,7,4,u>
+ 1638320966U, // <7,3,u,5>: Cost 2 vext3 RHS, <3,u,5,6>
+ 2712062796U, // <7,3,u,6>: Cost 3 vext3 RHS, <3,u,6,3>
+ 2692967250U, // <7,3,u,7>: Cost 3 vext3 <1,3,u,7>, <3,u,7,0>
+ 1638320989U, // <7,3,u,u>: Cost 2 vext3 RHS, <3,u,u,2>
+ 2651635712U, // <7,4,0,0>: Cost 3 vext2 <5,6,7,4>, <0,0,0,0>
+ 1577893990U, // <7,4,0,1>: Cost 2 vext2 <5,6,7,4>, LHS
+ 2651635876U, // <7,4,0,2>: Cost 3 vext2 <5,6,7,4>, <0,2,0,2>
+ 3785804672U, // <7,4,0,3>: Cost 4 vext3 RHS, <4,0,3,1>
+ 2651636050U, // <7,4,0,4>: Cost 3 vext2 <5,6,7,4>, <0,4,1,5>
+ 1638468498U, // <7,4,0,5>: Cost 2 vext3 RHS, <4,0,5,1>
+ 1638468508U, // <7,4,0,6>: Cost 2 vext3 RHS, <4,0,6,2>
+ 3787795364U, // <7,4,0,7>: Cost 4 vext3 RHS, <4,0,7,1>
+ 1640459181U, // <7,4,0,u>: Cost 2 vext3 RHS, <4,0,u,1>
+ 2651636470U, // <7,4,1,0>: Cost 3 vext2 <5,6,7,4>, <1,0,3,2>
+ 2651636532U, // <7,4,1,1>: Cost 3 vext2 <5,6,7,4>, <1,1,1,1>
+ 2712062922U, // <7,4,1,2>: Cost 3 vext3 RHS, <4,1,2,3>
+ 2639029248U, // <7,4,1,3>: Cost 3 vext2 <3,5,7,4>, <1,3,5,7>
+ 2712062940U, // <7,4,1,4>: Cost 3 vext3 RHS, <4,1,4,3>
+ 2712062946U, // <7,4,1,5>: Cost 3 vext3 RHS, <4,1,5,0>
+ 2712062958U, // <7,4,1,6>: Cost 3 vext3 RHS, <4,1,6,3>
+ 3785804791U, // <7,4,1,7>: Cost 4 vext3 RHS, <4,1,7,3>
+ 2712062973U, // <7,4,1,u>: Cost 3 vext3 RHS, <4,1,u,0>
+ 3785804807U, // <7,4,2,0>: Cost 4 vext3 RHS, <4,2,0,1>
+ 3785804818U, // <7,4,2,1>: Cost 4 vext3 RHS, <4,2,1,3>
+ 2651637352U, // <7,4,2,2>: Cost 3 vext2 <5,6,7,4>, <2,2,2,2>
+ 2651637414U, // <7,4,2,3>: Cost 3 vext2 <5,6,7,4>, <2,3,0,1>
+ 3716753194U, // <7,4,2,4>: Cost 4 vext2 <4,2,7,4>, <2,4,5,7>
+ 2712063030U, // <7,4,2,5>: Cost 3 vext3 RHS, <4,2,5,3>
+ 2712063036U, // <7,4,2,6>: Cost 3 vext3 RHS, <4,2,6,0>
+ 3773123658U, // <7,4,2,7>: Cost 4 vext3 <2,4,5,7>, <4,2,7,5>
+ 2712063054U, // <7,4,2,u>: Cost 3 vext3 RHS, <4,2,u,0>
+ 2651637910U, // <7,4,3,0>: Cost 3 vext2 <5,6,7,4>, <3,0,1,2>
+ 3712772348U, // <7,4,3,1>: Cost 4 vext2 <3,5,7,4>, <3,1,3,5>
+ 3785804906U, // <7,4,3,2>: Cost 4 vext3 RHS, <4,3,2,1>
+ 2651638172U, // <7,4,3,3>: Cost 3 vext2 <5,6,7,4>, <3,3,3,3>
+ 2651638274U, // <7,4,3,4>: Cost 3 vext2 <5,6,7,4>, <3,4,5,6>
+ 2639030883U, // <7,4,3,5>: Cost 3 vext2 <3,5,7,4>, <3,5,7,4>
+ 2712063122U, // <7,4,3,6>: Cost 3 vext3 RHS, <4,3,6,5>
+ 3712772836U, // <7,4,3,7>: Cost 4 vext2 <3,5,7,4>, <3,7,3,7>
+ 2641021782U, // <7,4,3,u>: Cost 3 vext2 <3,u,7,4>, <3,u,7,4>
+ 2714053802U, // <7,4,4,0>: Cost 3 vext3 RHS, <4,4,0,2>
+ 3785804978U, // <7,4,4,1>: Cost 4 vext3 RHS, <4,4,1,1>
+ 3716754505U, // <7,4,4,2>: Cost 4 vext2 <4,2,7,4>, <4,2,7,4>
+ 3785804998U, // <7,4,4,3>: Cost 4 vext3 RHS, <4,4,3,3>
+ 1638321360U, // <7,4,4,4>: Cost 2 vext3 RHS, <4,4,4,4>
+ 1638468826U, // <7,4,4,5>: Cost 2 vext3 RHS, <4,4,5,5>
+ 1638468836U, // <7,4,4,6>: Cost 2 vext3 RHS, <4,4,6,6>
+ 3785215214U, // <7,4,4,7>: Cost 4 vext3 <4,4,7,7>, <4,4,7,7>
+ 1640459509U, // <7,4,4,u>: Cost 2 vext3 RHS, <4,4,u,5>
+ 1517207654U, // <7,4,5,0>: Cost 2 vext1 <6,7,4,5>, LHS
+ 2573034640U, // <7,4,5,1>: Cost 3 vext1 <3,7,4,5>, <1,5,3,7>
+ 2712063246U, // <7,4,5,2>: Cost 3 vext3 RHS, <4,5,2,3>
+ 2573036267U, // <7,4,5,3>: Cost 3 vext1 <3,7,4,5>, <3,7,4,5>
+ 1517210934U, // <7,4,5,4>: Cost 2 vext1 <6,7,4,5>, RHS
+ 2711989549U, // <7,4,5,5>: Cost 3 vext3 <4,5,5,7>, <4,5,5,7>
+ 564579638U, // <7,4,5,6>: Cost 1 vext3 RHS, RHS
+ 2651639976U, // <7,4,5,7>: Cost 3 vext2 <5,6,7,4>, <5,7,5,7>
+ 564579656U, // <7,4,5,u>: Cost 1 vext3 RHS, RHS
+ 2712063307U, // <7,4,6,0>: Cost 3 vext3 RHS, <4,6,0,1>
+ 3767668056U, // <7,4,6,1>: Cost 4 vext3 <1,5,3,7>, <4,6,1,5>
+ 2651640314U, // <7,4,6,2>: Cost 3 vext2 <5,6,7,4>, <6,2,7,3>
+ 2655621708U, // <7,4,6,3>: Cost 3 vext2 <6,3,7,4>, <6,3,7,4>
+ 1638468980U, // <7,4,6,4>: Cost 2 vext3 RHS, <4,6,4,6>
+ 2712063358U, // <7,4,6,5>: Cost 3 vext3 RHS, <4,6,5,7>
+ 2712063367U, // <7,4,6,6>: Cost 3 vext3 RHS, <4,6,6,7>
+ 2712210826U, // <7,4,6,7>: Cost 3 vext3 RHS, <4,6,7,1>
+ 1638469012U, // <7,4,6,u>: Cost 2 vext3 RHS, <4,6,u,2>
+ 2651640826U, // <7,4,7,0>: Cost 3 vext2 <5,6,7,4>, <7,0,1,2>
+ 3773713830U, // <7,4,7,1>: Cost 4 vext3 <2,5,4,7>, <4,7,1,2>
+ 3773713842U, // <7,4,7,2>: Cost 4 vext3 <2,5,4,7>, <4,7,2,5>
+ 3780349372U, // <7,4,7,3>: Cost 4 vext3 <3,6,4,7>, <4,7,3,6>
+ 2651641140U, // <7,4,7,4>: Cost 3 vext2 <5,6,7,4>, <7,4,0,1>
+ 2712210888U, // <7,4,7,5>: Cost 3 vext3 RHS, <4,7,5,0>
+ 2712210898U, // <7,4,7,6>: Cost 3 vext3 RHS, <4,7,6,1>
+ 2651641452U, // <7,4,7,7>: Cost 3 vext2 <5,6,7,4>, <7,7,7,7>
+ 2713538026U, // <7,4,7,u>: Cost 3 vext3 <4,7,u,7>, <4,7,u,7>
+ 1517232230U, // <7,4,u,0>: Cost 2 vext1 <6,7,4,u>, LHS
+ 1577899822U, // <7,4,u,1>: Cost 2 vext2 <5,6,7,4>, LHS
+ 2712063489U, // <7,4,u,2>: Cost 3 vext3 RHS, <4,u,2,3>
+ 2573060846U, // <7,4,u,3>: Cost 3 vext1 <3,7,4,u>, <3,7,4,u>
+ 1640312342U, // <7,4,u,4>: Cost 2 vext3 RHS, <4,u,4,6>
+ 1638469146U, // <7,4,u,5>: Cost 2 vext3 RHS, <4,u,5,1>
+ 564579881U, // <7,4,u,6>: Cost 1 vext3 RHS, RHS
+ 2714054192U, // <7,4,u,7>: Cost 3 vext3 RHS, <4,u,7,5>
+ 564579899U, // <7,4,u,u>: Cost 1 vext3 RHS, RHS
+ 2579038310U, // <7,5,0,0>: Cost 3 vext1 <4,7,5,0>, LHS
+ 2636382310U, // <7,5,0,1>: Cost 3 vext2 <3,1,7,5>, LHS
+ 2796339302U, // <7,5,0,2>: Cost 3 vuzpl <7,4,5,6>, LHS
+ 3646810719U, // <7,5,0,3>: Cost 4 vext1 <3,7,5,0>, <3,5,7,0>
+ 2712063586U, // <7,5,0,4>: Cost 3 vext3 RHS, <5,0,4,1>
+ 2735951467U, // <7,5,0,5>: Cost 3 vext3 RHS, <5,0,5,1>
+ 2735951476U, // <7,5,0,6>: Cost 3 vext3 RHS, <5,0,6,1>
+ 2579043322U, // <7,5,0,7>: Cost 3 vext1 <4,7,5,0>, <7,0,1,2>
+ 2636382877U, // <7,5,0,u>: Cost 3 vext2 <3,1,7,5>, LHS
+ 2712211087U, // <7,5,1,0>: Cost 3 vext3 RHS, <5,1,0,1>
+ 3698180916U, // <7,5,1,1>: Cost 4 vext2 <1,1,7,5>, <1,1,1,1>
+ 3710124950U, // <7,5,1,2>: Cost 4 vext2 <3,1,7,5>, <1,2,3,0>
+ 2636383232U, // <7,5,1,3>: Cost 3 vext2 <3,1,7,5>, <1,3,5,7>
+ 2712211127U, // <7,5,1,4>: Cost 3 vext3 RHS, <5,1,4,5>
+ 2590994128U, // <7,5,1,5>: Cost 3 vext1 <6,7,5,1>, <5,1,7,3>
+ 2590995323U, // <7,5,1,6>: Cost 3 vext1 <6,7,5,1>, <6,7,5,1>
+ 1638469328U, // <7,5,1,7>: Cost 2 vext3 RHS, <5,1,7,3>
+ 1638469337U, // <7,5,1,u>: Cost 2 vext3 RHS, <5,1,u,3>
+ 3785805536U, // <7,5,2,0>: Cost 4 vext3 RHS, <5,2,0,1>
+ 3785805544U, // <7,5,2,1>: Cost 4 vext3 RHS, <5,2,1,0>
+ 3704817288U, // <7,5,2,2>: Cost 4 vext2 <2,2,7,5>, <2,2,5,7>
+ 2712063742U, // <7,5,2,3>: Cost 3 vext3 RHS, <5,2,3,4>
+ 3716761386U, // <7,5,2,4>: Cost 4 vext2 <4,2,7,5>, <2,4,5,7>
+ 2714054415U, // <7,5,2,5>: Cost 3 vext3 RHS, <5,2,5,3>
+ 3774304024U, // <7,5,2,6>: Cost 4 vext3 <2,6,3,7>, <5,2,6,3>
+ 2712063777U, // <7,5,2,7>: Cost 3 vext3 RHS, <5,2,7,3>
+ 2712063787U, // <7,5,2,u>: Cost 3 vext3 RHS, <5,2,u,4>
+ 3634888806U, // <7,5,3,0>: Cost 4 vext1 <1,7,5,3>, LHS
+ 2636384544U, // <7,5,3,1>: Cost 3 vext2 <3,1,7,5>, <3,1,7,5>
+ 3710790001U, // <7,5,3,2>: Cost 4 vext2 <3,2,7,5>, <3,2,7,5>
+ 3710126492U, // <7,5,3,3>: Cost 4 vext2 <3,1,7,5>, <3,3,3,3>
+ 3634892086U, // <7,5,3,4>: Cost 4 vext1 <1,7,5,3>, RHS
+ 2639039076U, // <7,5,3,5>: Cost 3 vext2 <3,5,7,5>, <3,5,7,5>
+ 3713444533U, // <7,5,3,6>: Cost 4 vext2 <3,6,7,5>, <3,6,7,5>
+ 2693926767U, // <7,5,3,7>: Cost 3 vext3 <1,5,3,7>, <5,3,7,0>
+ 2712063864U, // <7,5,3,u>: Cost 3 vext3 RHS, <5,3,u,0>
+ 2579071078U, // <7,5,4,0>: Cost 3 vext1 <4,7,5,4>, LHS
+ 3646841856U, // <7,5,4,1>: Cost 4 vext1 <3,7,5,4>, <1,3,5,7>
+ 3716762698U, // <7,5,4,2>: Cost 4 vext2 <4,2,7,5>, <4,2,7,5>
+ 3646843491U, // <7,5,4,3>: Cost 4 vext1 <3,7,5,4>, <3,5,7,4>
+ 2579074358U, // <7,5,4,4>: Cost 3 vext1 <4,7,5,4>, RHS
+ 2636385590U, // <7,5,4,5>: Cost 3 vext2 <3,1,7,5>, RHS
+ 2645675406U, // <7,5,4,6>: Cost 3 vext2 <4,6,7,5>, <4,6,7,5>
+ 1638322118U, // <7,5,4,7>: Cost 2 vext3 RHS, <5,4,7,6>
+ 1638469583U, // <7,5,4,u>: Cost 2 vext3 RHS, <5,4,u,6>
+ 2714054611U, // <7,5,5,0>: Cost 3 vext3 RHS, <5,5,0,1>
+ 2652974800U, // <7,5,5,1>: Cost 3 vext2 <5,u,7,5>, <5,1,7,3>
+ 3710127905U, // <7,5,5,2>: Cost 4 vext2 <3,1,7,5>, <5,2,7,3>
+ 3785805808U, // <7,5,5,3>: Cost 4 vext3 RHS, <5,5,3,3>
+ 2712211450U, // <7,5,5,4>: Cost 3 vext3 RHS, <5,5,4,4>
+ 1638322180U, // <7,5,5,5>: Cost 2 vext3 RHS, <5,5,5,5>
+ 2712064014U, // <7,5,5,6>: Cost 3 vext3 RHS, <5,5,6,6>
+ 1638469656U, // <7,5,5,7>: Cost 2 vext3 RHS, <5,5,7,7>
+ 1638469665U, // <7,5,5,u>: Cost 2 vext3 RHS, <5,5,u,7>
+ 2712064036U, // <7,5,6,0>: Cost 3 vext3 RHS, <5,6,0,1>
+ 2714054707U, // <7,5,6,1>: Cost 3 vext3 RHS, <5,6,1,7>
+ 3785805879U, // <7,5,6,2>: Cost 4 vext3 RHS, <5,6,2,2>
+ 2712064066U, // <7,5,6,3>: Cost 3 vext3 RHS, <5,6,3,4>
+ 2712064076U, // <7,5,6,4>: Cost 3 vext3 RHS, <5,6,4,5>
+ 2714054743U, // <7,5,6,5>: Cost 3 vext3 RHS, <5,6,5,7>
+ 2712064096U, // <7,5,6,6>: Cost 3 vext3 RHS, <5,6,6,7>
+ 1638322274U, // <7,5,6,7>: Cost 2 vext3 RHS, <5,6,7,0>
+ 1638469739U, // <7,5,6,u>: Cost 2 vext3 RHS, <5,6,u,0>
+ 1511325798U, // <7,5,7,0>: Cost 2 vext1 <5,7,5,7>, LHS
+ 2692747392U, // <7,5,7,1>: Cost 3 vext3 <1,3,5,7>, <5,7,1,3>
+ 2585069160U, // <7,5,7,2>: Cost 3 vext1 <5,7,5,7>, <2,2,2,2>
+ 2573126390U, // <7,5,7,3>: Cost 3 vext1 <3,7,5,7>, <3,7,5,7>
+ 1511329078U, // <7,5,7,4>: Cost 2 vext1 <5,7,5,7>, RHS
+ 1638469800U, // <7,5,7,5>: Cost 2 vext3 RHS, <5,7,5,7>
+ 2712211626U, // <7,5,7,6>: Cost 3 vext3 RHS, <5,7,6,0>
+ 2712211636U, // <7,5,7,7>: Cost 3 vext3 RHS, <5,7,7,1>
+ 1638469823U, // <7,5,7,u>: Cost 2 vext3 RHS, <5,7,u,3>
+ 1511333990U, // <7,5,u,0>: Cost 2 vext1 <5,7,5,u>, LHS
+ 2636388142U, // <7,5,u,1>: Cost 3 vext2 <3,1,7,5>, LHS
+ 2712211671U, // <7,5,u,2>: Cost 3 vext3 RHS, <5,u,2,0>
+ 2573134583U, // <7,5,u,3>: Cost 3 vext1 <3,7,5,u>, <3,7,5,u>
+ 1511337270U, // <7,5,u,4>: Cost 2 vext1 <5,7,5,u>, RHS
+ 1638469881U, // <7,5,u,5>: Cost 2 vext3 RHS, <5,u,5,7>
+ 2712064258U, // <7,5,u,6>: Cost 3 vext3 RHS, <5,u,6,7>
+ 1638469892U, // <7,5,u,7>: Cost 2 vext3 RHS, <5,u,7,0>
+ 1638469904U, // <7,5,u,u>: Cost 2 vext3 RHS, <5,u,u,3>
+ 2650324992U, // <7,6,0,0>: Cost 3 vext2 <5,4,7,6>, <0,0,0,0>
+ 1576583270U, // <7,6,0,1>: Cost 2 vext2 <5,4,7,6>, LHS
+ 2712064300U, // <7,6,0,2>: Cost 3 vext3 RHS, <6,0,2,4>
+ 2255295336U, // <7,6,0,3>: Cost 3 vrev <6,7,3,0>
+ 2712064316U, // <7,6,0,4>: Cost 3 vext3 RHS, <6,0,4,2>
+ 2585088098U, // <7,6,0,5>: Cost 3 vext1 <5,7,6,0>, <5,6,7,0>
+ 2735952204U, // <7,6,0,6>: Cost 3 vext3 RHS, <6,0,6,0>
+ 2712211799U, // <7,6,0,7>: Cost 3 vext3 RHS, <6,0,7,2>
+ 1576583837U, // <7,6,0,u>: Cost 2 vext2 <5,4,7,6>, LHS
+ 1181340494U, // <7,6,1,0>: Cost 2 vrev <6,7,0,1>
+ 2650325812U, // <7,6,1,1>: Cost 3 vext2 <5,4,7,6>, <1,1,1,1>
+ 2650325910U, // <7,6,1,2>: Cost 3 vext2 <5,4,7,6>, <1,2,3,0>
+ 2650325976U, // <7,6,1,3>: Cost 3 vext2 <5,4,7,6>, <1,3,1,3>
+ 2579123510U, // <7,6,1,4>: Cost 3 vext1 <4,7,6,1>, RHS
+ 2650326160U, // <7,6,1,5>: Cost 3 vext2 <5,4,7,6>, <1,5,3,7>
+ 2714055072U, // <7,6,1,6>: Cost 3 vext3 RHS, <6,1,6,3>
+ 2712064425U, // <7,6,1,7>: Cost 3 vext3 RHS, <6,1,7,3>
+ 1181930390U, // <7,6,1,u>: Cost 2 vrev <6,7,u,1>
+ 2712211897U, // <7,6,2,0>: Cost 3 vext3 RHS, <6,2,0,1>
+ 2714055108U, // <7,6,2,1>: Cost 3 vext3 RHS, <6,2,1,3>
+ 2650326632U, // <7,6,2,2>: Cost 3 vext2 <5,4,7,6>, <2,2,2,2>
+ 2650326694U, // <7,6,2,3>: Cost 3 vext2 <5,4,7,6>, <2,3,0,1>
+ 2714055137U, // <7,6,2,4>: Cost 3 vext3 RHS, <6,2,4,5>
+ 2714055148U, // <7,6,2,5>: Cost 3 vext3 RHS, <6,2,5,7>
+ 2650326970U, // <7,6,2,6>: Cost 3 vext2 <5,4,7,6>, <2,6,3,7>
+ 1638470138U, // <7,6,2,7>: Cost 2 vext3 RHS, <6,2,7,3>
+ 1638470147U, // <7,6,2,u>: Cost 2 vext3 RHS, <6,2,u,3>
+ 2650327190U, // <7,6,3,0>: Cost 3 vext2 <5,4,7,6>, <3,0,1,2>
+ 2255172441U, // <7,6,3,1>: Cost 3 vrev <6,7,1,3>
+ 2255246178U, // <7,6,3,2>: Cost 3 vrev <6,7,2,3>
+ 2650327452U, // <7,6,3,3>: Cost 3 vext2 <5,4,7,6>, <3,3,3,3>
+ 2712064562U, // <7,6,3,4>: Cost 3 vext3 RHS, <6,3,4,5>
+ 2650327627U, // <7,6,3,5>: Cost 3 vext2 <5,4,7,6>, <3,5,4,7>
+ 3713452726U, // <7,6,3,6>: Cost 4 vext2 <3,6,7,6>, <3,6,7,6>
+ 2700563016U, // <7,6,3,7>: Cost 3 vext3 <2,6,3,7>, <6,3,7,0>
+ 2712064593U, // <7,6,3,u>: Cost 3 vext3 RHS, <6,3,u,0>
+ 2650327954U, // <7,6,4,0>: Cost 3 vext2 <5,4,7,6>, <4,0,5,1>
+ 2735952486U, // <7,6,4,1>: Cost 3 vext3 RHS, <6,4,1,3>
+ 2735952497U, // <7,6,4,2>: Cost 3 vext3 RHS, <6,4,2,5>
+ 2255328108U, // <7,6,4,3>: Cost 3 vrev <6,7,3,4>
+ 2712212100U, // <7,6,4,4>: Cost 3 vext3 RHS, <6,4,4,6>
+ 1576586550U, // <7,6,4,5>: Cost 2 vext2 <5,4,7,6>, RHS
+ 2714055312U, // <7,6,4,6>: Cost 3 vext3 RHS, <6,4,6,0>
+ 2712212126U, // <7,6,4,7>: Cost 3 vext3 RHS, <6,4,7,5>
+ 1576586793U, // <7,6,4,u>: Cost 2 vext2 <5,4,7,6>, RHS
+ 2579152998U, // <7,6,5,0>: Cost 3 vext1 <4,7,6,5>, LHS
+ 2650328784U, // <7,6,5,1>: Cost 3 vext2 <5,4,7,6>, <5,1,7,3>
+ 2714055364U, // <7,6,5,2>: Cost 3 vext3 RHS, <6,5,2,7>
+ 3785806538U, // <7,6,5,3>: Cost 4 vext3 RHS, <6,5,3,4>
+ 1576587206U, // <7,6,5,4>: Cost 2 vext2 <5,4,7,6>, <5,4,7,6>
+ 2650329092U, // <7,6,5,5>: Cost 3 vext2 <5,4,7,6>, <5,5,5,5>
+ 2650329186U, // <7,6,5,6>: Cost 3 vext2 <5,4,7,6>, <5,6,7,0>
+ 2712064753U, // <7,6,5,7>: Cost 3 vext3 RHS, <6,5,7,7>
+ 1181963162U, // <7,6,5,u>: Cost 2 vrev <6,7,u,5>
+ 2714055421U, // <7,6,6,0>: Cost 3 vext3 RHS, <6,6,0,1>
+ 2714055432U, // <7,6,6,1>: Cost 3 vext3 RHS, <6,6,1,3>
+ 2650329594U, // <7,6,6,2>: Cost 3 vext2 <5,4,7,6>, <6,2,7,3>
+ 3785806619U, // <7,6,6,3>: Cost 4 vext3 RHS, <6,6,3,4>
+ 2712212260U, // <7,6,6,4>: Cost 3 vext3 RHS, <6,6,4,4>
+ 2714055472U, // <7,6,6,5>: Cost 3 vext3 RHS, <6,6,5,7>
+ 1638323000U, // <7,6,6,6>: Cost 2 vext3 RHS, <6,6,6,6>
+ 1638470466U, // <7,6,6,7>: Cost 2 vext3 RHS, <6,6,7,7>
+ 1638470475U, // <7,6,6,u>: Cost 2 vext3 RHS, <6,6,u,7>
+ 1638323022U, // <7,6,7,0>: Cost 2 vext3 RHS, <6,7,0,1>
+ 2712064854U, // <7,6,7,1>: Cost 3 vext3 RHS, <6,7,1,0>
+ 2712064865U, // <7,6,7,2>: Cost 3 vext3 RHS, <6,7,2,2>
+ 2712064872U, // <7,6,7,3>: Cost 3 vext3 RHS, <6,7,3,0>
+ 1638323062U, // <7,6,7,4>: Cost 2 vext3 RHS, <6,7,4,5>
+ 2712064894U, // <7,6,7,5>: Cost 3 vext3 RHS, <6,7,5,4>
+ 2712064905U, // <7,6,7,6>: Cost 3 vext3 RHS, <6,7,6,6>
+ 2712064915U, // <7,6,7,7>: Cost 3 vext3 RHS, <6,7,7,7>
+ 1638323094U, // <7,6,7,u>: Cost 2 vext3 RHS, <6,7,u,1>
+ 1638470559U, // <7,6,u,0>: Cost 2 vext3 RHS, <6,u,0,1>
+ 1576589102U, // <7,6,u,1>: Cost 2 vext2 <5,4,7,6>, LHS
+ 2712212402U, // <7,6,u,2>: Cost 3 vext3 RHS, <6,u,2,2>
+ 2712212409U, // <7,6,u,3>: Cost 3 vext3 RHS, <6,u,3,0>
+ 1638470599U, // <7,6,u,4>: Cost 2 vext3 RHS, <6,u,4,5>
+ 1576589466U, // <7,6,u,5>: Cost 2 vext2 <5,4,7,6>, RHS
+ 1638323000U, // <7,6,u,6>: Cost 2 vext3 RHS, <6,6,6,6>
+ 1638470624U, // <7,6,u,7>: Cost 2 vext3 RHS, <6,u,7,3>
+ 1638470631U, // <7,6,u,u>: Cost 2 vext3 RHS, <6,u,u,1>
+ 2712065007U, // <7,7,0,0>: Cost 3 vext3 RHS, <7,0,0,0>
+ 1638323194U, // <7,7,0,1>: Cost 2 vext3 RHS, <7,0,1,2>
+ 2712065025U, // <7,7,0,2>: Cost 3 vext3 RHS, <7,0,2,0>
+ 3646958337U, // <7,7,0,3>: Cost 4 vext1 <3,7,7,0>, <3,7,7,0>
+ 2712065044U, // <7,7,0,4>: Cost 3 vext3 RHS, <7,0,4,1>
+ 2585161907U, // <7,7,0,5>: Cost 3 vext1 <5,7,7,0>, <5,7,7,0>
+ 2591134604U, // <7,7,0,6>: Cost 3 vext1 <6,7,7,0>, <6,7,7,0>
+ 2591134714U, // <7,7,0,7>: Cost 3 vext1 <6,7,7,0>, <7,0,1,2>
+ 1638323257U, // <7,7,0,u>: Cost 2 vext3 RHS, <7,0,u,2>
+ 2712065091U, // <7,7,1,0>: Cost 3 vext3 RHS, <7,1,0,3>
+ 2712065098U, // <7,7,1,1>: Cost 3 vext3 RHS, <7,1,1,1>
+ 2712065109U, // <7,7,1,2>: Cost 3 vext3 RHS, <7,1,2,3>
+ 2692748384U, // <7,7,1,3>: Cost 3 vext3 <1,3,5,7>, <7,1,3,5>
+ 2585169206U, // <7,7,1,4>: Cost 3 vext1 <5,7,7,1>, RHS
+ 2693928048U, // <7,7,1,5>: Cost 3 vext3 <1,5,3,7>, <7,1,5,3>
+ 2585170766U, // <7,7,1,6>: Cost 3 vext1 <5,7,7,1>, <6,7,0,1>
+ 2735953024U, // <7,7,1,7>: Cost 3 vext3 RHS, <7,1,7,1>
+ 2695918731U, // <7,7,1,u>: Cost 3 vext3 <1,u,3,7>, <7,1,u,3>
+ 3770471574U, // <7,7,2,0>: Cost 4 vext3 <2,0,5,7>, <7,2,0,5>
+ 3785807002U, // <7,7,2,1>: Cost 4 vext3 RHS, <7,2,1,0>
+ 2712065189U, // <7,7,2,2>: Cost 3 vext3 RHS, <7,2,2,2>
+ 2712065196U, // <7,7,2,3>: Cost 3 vext3 RHS, <7,2,3,0>
+ 3773125818U, // <7,7,2,4>: Cost 4 vext3 <2,4,5,7>, <7,2,4,5>
+ 3766490305U, // <7,7,2,5>: Cost 4 vext3 <1,3,5,7>, <7,2,5,3>
+ 2700563658U, // <7,7,2,6>: Cost 3 vext3 <2,6,3,7>, <7,2,6,3>
+ 2735953107U, // <7,7,2,7>: Cost 3 vext3 RHS, <7,2,7,3>
+ 2701890780U, // <7,7,2,u>: Cost 3 vext3 <2,u,3,7>, <7,2,u,3>
+ 2712065251U, // <7,7,3,0>: Cost 3 vext3 RHS, <7,3,0,1>
+ 3766490350U, // <7,7,3,1>: Cost 4 vext3 <1,3,5,7>, <7,3,1,3>
+ 3774305530U, // <7,7,3,2>: Cost 4 vext3 <2,6,3,7>, <7,3,2,6>
+ 2637728196U, // <7,7,3,3>: Cost 3 vext2 <3,3,7,7>, <3,3,7,7>
+ 2712065291U, // <7,7,3,4>: Cost 3 vext3 RHS, <7,3,4,5>
+ 2585186486U, // <7,7,3,5>: Cost 3 vext1 <5,7,7,3>, <5,7,7,3>
+ 2639719095U, // <7,7,3,6>: Cost 3 vext2 <3,6,7,7>, <3,6,7,7>
+ 2640382728U, // <7,7,3,7>: Cost 3 vext2 <3,7,7,7>, <3,7,7,7>
+ 2641046361U, // <7,7,3,u>: Cost 3 vext2 <3,u,7,7>, <3,u,7,7>
+ 2712212792U, // <7,7,4,0>: Cost 3 vext3 RHS, <7,4,0,5>
+ 3646989312U, // <7,7,4,1>: Cost 4 vext1 <3,7,7,4>, <1,3,5,7>
+ 3785807176U, // <7,7,4,2>: Cost 4 vext3 RHS, <7,4,2,3>
+ 3646991109U, // <7,7,4,3>: Cost 4 vext1 <3,7,7,4>, <3,7,7,4>
+ 2712065371U, // <7,7,4,4>: Cost 3 vext3 RHS, <7,4,4,4>
+ 1638323558U, // <7,7,4,5>: Cost 2 vext3 RHS, <7,4,5,6>
+ 2712212845U, // <7,7,4,6>: Cost 3 vext3 RHS, <7,4,6,4>
+ 2591167846U, // <7,7,4,7>: Cost 3 vext1 <6,7,7,4>, <7,4,5,6>
+ 1638323585U, // <7,7,4,u>: Cost 2 vext3 RHS, <7,4,u,6>
+ 2585198694U, // <7,7,5,0>: Cost 3 vext1 <5,7,7,5>, LHS
+ 2712212884U, // <7,7,5,1>: Cost 3 vext3 RHS, <7,5,1,7>
+ 3711471393U, // <7,7,5,2>: Cost 4 vext2 <3,3,7,7>, <5,2,7,3>
+ 2649673590U, // <7,7,5,3>: Cost 3 vext2 <5,3,7,7>, <5,3,7,7>
+ 2712065455U, // <7,7,5,4>: Cost 3 vext3 RHS, <7,5,4,7>
+ 1577259032U, // <7,7,5,5>: Cost 2 vext2 <5,5,7,7>, <5,5,7,7>
+ 2712065473U, // <7,7,5,6>: Cost 3 vext3 RHS, <7,5,6,7>
+ 2712212936U, // <7,7,5,7>: Cost 3 vext3 RHS, <7,5,7,5>
+ 1579249931U, // <7,7,5,u>: Cost 2 vext2 <5,u,7,7>, <5,u,7,7>
+ 2591178854U, // <7,7,6,0>: Cost 3 vext1 <6,7,7,6>, LHS
+ 2735953374U, // <7,7,6,1>: Cost 3 vext3 RHS, <7,6,1,0>
+ 2712212974U, // <7,7,6,2>: Cost 3 vext3 RHS, <7,6,2,7>
+ 2655646287U, // <7,7,6,3>: Cost 3 vext2 <6,3,7,7>, <6,3,7,7>
+ 2591182134U, // <7,7,6,4>: Cost 3 vext1 <6,7,7,6>, RHS
+ 2656973553U, // <7,7,6,5>: Cost 3 vext2 <6,5,7,7>, <6,5,7,7>
+ 1583895362U, // <7,7,6,6>: Cost 2 vext2 <6,6,7,7>, <6,6,7,7>
+ 2712065556U, // <7,7,6,7>: Cost 3 vext3 RHS, <7,6,7,0>
+ 1585222628U, // <7,7,6,u>: Cost 2 vext2 <6,u,7,7>, <6,u,7,7>
+ 1523417190U, // <7,7,7,0>: Cost 2 vext1 <7,7,7,7>, LHS
+ 2597159670U, // <7,7,7,1>: Cost 3 vext1 <7,7,7,7>, <1,0,3,2>
+ 2597160552U, // <7,7,7,2>: Cost 3 vext1 <7,7,7,7>, <2,2,2,2>
+ 2597161110U, // <7,7,7,3>: Cost 3 vext1 <7,7,7,7>, <3,0,1,2>
+ 1523420470U, // <7,7,7,4>: Cost 2 vext1 <7,7,7,7>, RHS
+ 2651002296U, // <7,7,7,5>: Cost 3 vext2 <5,5,7,7>, <7,5,5,7>
+ 2657637906U, // <7,7,7,6>: Cost 3 vext2 <6,6,7,7>, <7,6,6,7>
+ 363253046U, // <7,7,7,7>: Cost 1 vdup3 RHS
+ 363253046U, // <7,7,7,u>: Cost 1 vdup3 RHS
+ 1523417190U, // <7,7,u,0>: Cost 2 vext1 <7,7,7,7>, LHS
+ 1638471298U, // <7,7,u,1>: Cost 2 vext3 RHS, <7,u,1,2>
+ 2712213132U, // <7,7,u,2>: Cost 3 vext3 RHS, <7,u,2,3>
+ 2712213138U, // <7,7,u,3>: Cost 3 vext3 RHS, <7,u,3,0>
+ 1523420470U, // <7,7,u,4>: Cost 2 vext1 <7,7,7,7>, RHS
+ 1638471338U, // <7,7,u,5>: Cost 2 vext3 RHS, <7,u,5,6>
+ 1595840756U, // <7,7,u,6>: Cost 2 vext2 <u,6,7,7>, <u,6,7,7>
+ 363253046U, // <7,7,u,7>: Cost 1 vdup3 RHS
+ 363253046U, // <7,7,u,u>: Cost 1 vdup3 RHS
+ 1638318080U, // <7,u,0,0>: Cost 2 vext3 RHS, <0,0,0,0>
+ 1638323923U, // <7,u,0,1>: Cost 2 vext3 RHS, <u,0,1,2>
+ 1662211804U, // <7,u,0,2>: Cost 2 vext3 RHS, <u,0,2,2>
+ 1638323941U, // <7,u,0,3>: Cost 2 vext3 RHS, <u,0,3,2>
+ 2712065773U, // <7,u,0,4>: Cost 3 vext3 RHS, <u,0,4,1>
+ 1662359286U, // <7,u,0,5>: Cost 2 vext3 RHS, <u,0,5,1>
+ 1662359296U, // <7,u,0,6>: Cost 2 vext3 RHS, <u,0,6,2>
+ 2987150664U, // <7,u,0,7>: Cost 3 vzipr <5,6,7,0>, RHS
+ 1638323986U, // <7,u,0,u>: Cost 2 vext3 RHS, <u,0,u,2>
+ 1517469798U, // <7,u,1,0>: Cost 2 vext1 <6,7,u,1>, LHS
+ 1638318900U, // <7,u,1,1>: Cost 2 vext3 RHS, <1,1,1,1>
+ 564582190U, // <7,u,1,2>: Cost 1 vext3 RHS, LHS
+ 1638324023U, // <7,u,1,3>: Cost 2 vext3 RHS, <u,1,3,3>
+ 1517473078U, // <7,u,1,4>: Cost 2 vext1 <6,7,u,1>, RHS
+ 2693928777U, // <7,u,1,5>: Cost 3 vext3 <1,5,3,7>, <u,1,5,3>
+ 1517474710U, // <7,u,1,6>: Cost 2 vext1 <6,7,u,1>, <6,7,u,1>
+ 1640462171U, // <7,u,1,7>: Cost 2 vext3 RHS, <u,1,7,3>
+ 564582244U, // <7,u,1,u>: Cost 1 vext3 RHS, LHS
+ 1638318244U, // <7,u,2,0>: Cost 2 vext3 RHS, <0,2,0,2>
+ 2712065907U, // <7,u,2,1>: Cost 3 vext3 RHS, <u,2,1,0>
+ 1638319720U, // <7,u,2,2>: Cost 2 vext3 RHS, <2,2,2,2>
+ 1638324101U, // <7,u,2,3>: Cost 2 vext3 RHS, <u,2,3,0>
+ 1638318284U, // <7,u,2,4>: Cost 2 vext3 RHS, <0,2,4,6>
+ 2712065947U, // <7,u,2,5>: Cost 3 vext3 RHS, <u,2,5,4>
+ 2700564387U, // <7,u,2,6>: Cost 3 vext3 <2,6,3,7>, <u,2,6,3>
+ 1640314796U, // <7,u,2,7>: Cost 2 vext3 RHS, <u,2,7,3>
+ 1638324146U, // <7,u,2,u>: Cost 2 vext3 RHS, <u,2,u,0>
+ 1638324156U, // <7,u,3,0>: Cost 2 vext3 RHS, <u,3,0,1>
+ 1638319064U, // <7,u,3,1>: Cost 2 vext3 RHS, <1,3,1,3>
+ 2700564435U, // <7,u,3,2>: Cost 3 vext3 <2,6,3,7>, <u,3,2,6>
+ 1638320540U, // <7,u,3,3>: Cost 2 vext3 RHS, <3,3,3,3>
+ 1638324196U, // <7,u,3,4>: Cost 2 vext3 RHS, <u,3,4,5>
+ 1638324207U, // <7,u,3,5>: Cost 2 vext3 RHS, <u,3,5,7>
+ 2700564472U, // <7,u,3,6>: Cost 3 vext3 <2,6,3,7>, <u,3,6,7>
+ 2695919610U, // <7,u,3,7>: Cost 3 vext3 <1,u,3,7>, <u,3,7,0>
+ 1638324228U, // <7,u,3,u>: Cost 2 vext3 RHS, <u,3,u,1>
+ 2712066061U, // <7,u,4,0>: Cost 3 vext3 RHS, <u,4,0,1>
+ 1662212122U, // <7,u,4,1>: Cost 2 vext3 RHS, <u,4,1,5>
+ 1662212132U, // <7,u,4,2>: Cost 2 vext3 RHS, <u,4,2,6>
+ 2712066092U, // <7,u,4,3>: Cost 3 vext3 RHS, <u,4,3,5>
+ 1638321360U, // <7,u,4,4>: Cost 2 vext3 RHS, <4,4,4,4>
+ 1638324287U, // <7,u,4,5>: Cost 2 vext3 RHS, <u,4,5,6>
+ 1662359624U, // <7,u,4,6>: Cost 2 vext3 RHS, <u,4,6,6>
+ 1640314961U, // <7,u,4,7>: Cost 2 vext3 RHS, <u,4,7,6>
+ 1638324314U, // <7,u,4,u>: Cost 2 vext3 RHS, <u,4,u,6>
+ 1517502566U, // <7,u,5,0>: Cost 2 vext1 <6,7,u,5>, LHS
+ 1574612693U, // <7,u,5,1>: Cost 2 vext2 <5,1,7,u>, <5,1,7,u>
+ 2712066162U, // <7,u,5,2>: Cost 3 vext3 RHS, <u,5,2,3>
+ 1638324351U, // <7,u,5,3>: Cost 2 vext3 RHS, <u,5,3,7>
+ 1576603592U, // <7,u,5,4>: Cost 2 vext2 <5,4,7,u>, <5,4,7,u>
+ 1577267225U, // <7,u,5,5>: Cost 2 vext2 <5,5,7,u>, <5,5,7,u>
+ 564582554U, // <7,u,5,6>: Cost 1 vext3 RHS, RHS
+ 1640462499U, // <7,u,5,7>: Cost 2 vext3 RHS, <u,5,7,7>
+ 564582572U, // <7,u,5,u>: Cost 1 vext3 RHS, RHS
+ 2712066223U, // <7,u,6,0>: Cost 3 vext3 RHS, <u,6,0,1>
+ 2712066238U, // <7,u,6,1>: Cost 3 vext3 RHS, <u,6,1,7>
+ 1581249023U, // <7,u,6,2>: Cost 2 vext2 <6,2,7,u>, <6,2,7,u>
+ 1638324432U, // <7,u,6,3>: Cost 2 vext3 RHS, <u,6,3,7>
+ 1638468980U, // <7,u,6,4>: Cost 2 vext3 RHS, <4,6,4,6>
+ 2712066274U, // <7,u,6,5>: Cost 3 vext3 RHS, <u,6,5,7>
+ 1583903555U, // <7,u,6,6>: Cost 2 vext2 <6,6,7,u>, <6,6,7,u>
+ 1640315117U, // <7,u,6,7>: Cost 2 vext3 RHS, <u,6,7,0>
+ 1638324477U, // <7,u,6,u>: Cost 2 vext3 RHS, <u,6,u,7>
+ 1638471936U, // <7,u,7,0>: Cost 2 vext3 RHS, <u,7,0,1>
+ 2692970763U, // <7,u,7,1>: Cost 3 vext3 <1,3,u,7>, <u,7,1,3>
+ 2700933399U, // <7,u,7,2>: Cost 3 vext3 <2,6,u,7>, <u,7,2,6>
+ 2573347601U, // <7,u,7,3>: Cost 3 vext1 <3,7,u,7>, <3,7,u,7>
+ 1638471976U, // <7,u,7,4>: Cost 2 vext3 RHS, <u,7,4,5>
+ 1511551171U, // <7,u,7,5>: Cost 2 vext1 <5,7,u,7>, <5,7,u,7>
+ 2712213815U, // <7,u,7,6>: Cost 3 vext3 RHS, <u,7,6,2>
+ 363253046U, // <7,u,7,7>: Cost 1 vdup3 RHS
+ 363253046U, // <7,u,7,u>: Cost 1 vdup3 RHS
+ 1638324561U, // <7,u,u,0>: Cost 2 vext3 RHS, <u,u,0,1>
+ 1638324571U, // <7,u,u,1>: Cost 2 vext3 RHS, <u,u,1,2>
+ 564582757U, // <7,u,u,2>: Cost 1 vext3 RHS, LHS
+ 1638324587U, // <7,u,u,3>: Cost 2 vext3 RHS, <u,u,3,0>
+ 1638324601U, // <7,u,u,4>: Cost 2 vext3 RHS, <u,u,4,5>
+ 1638324611U, // <7,u,u,5>: Cost 2 vext3 RHS, <u,u,5,6>
+ 564582797U, // <7,u,u,6>: Cost 1 vext3 RHS, RHS
+ 363253046U, // <7,u,u,7>: Cost 1 vdup3 RHS
+ 564582811U, // <7,u,u,u>: Cost 1 vext3 RHS, LHS
+ 135053414U, // <u,0,0,0>: Cost 1 vdup0 LHS
+ 1611489290U, // <u,0,0,1>: Cost 2 vext3 LHS, <0,0,1,1>
+ 1611489300U, // <u,0,0,2>: Cost 2 vext3 LHS, <0,0,2,2>
+ 2568054923U, // <u,0,0,3>: Cost 3 vext1 <3,0,0,0>, <3,0,0,0>
+ 1481706806U, // <u,0,0,4>: Cost 2 vext1 <0,u,0,0>, RHS
+ 2555449040U, // <u,0,0,5>: Cost 3 vext1 <0,u,0,0>, <5,1,7,3>
+ 2591282078U, // <u,0,0,6>: Cost 3 vext1 <6,u,0,0>, <6,u,0,0>
+ 2591945711U, // <u,0,0,7>: Cost 3 vext1 <7,0,0,0>, <7,0,0,0>
+ 135053414U, // <u,0,0,u>: Cost 1 vdup0 LHS
+ 1493655654U, // <u,0,1,0>: Cost 2 vext1 <2,u,0,1>, LHS
+ 1860550758U, // <u,0,1,1>: Cost 2 vzipl LHS, LHS
+ 537747563U, // <u,0,1,2>: Cost 1 vext3 LHS, LHS
+ 2625135576U, // <u,0,1,3>: Cost 3 vext2 <1,2,u,0>, <1,3,1,3>
+ 1493658934U, // <u,0,1,4>: Cost 2 vext1 <2,u,0,1>, RHS
+ 2625135760U, // <u,0,1,5>: Cost 3 vext2 <1,2,u,0>, <1,5,3,7>
+ 1517548447U, // <u,0,1,6>: Cost 2 vext1 <6,u,0,1>, <6,u,0,1>
+ 2591290362U, // <u,0,1,7>: Cost 3 vext1 <6,u,0,1>, <7,0,1,2>
+ 537747612U, // <u,0,1,u>: Cost 1 vext3 LHS, LHS
+ 1611489444U, // <u,0,2,0>: Cost 2 vext3 LHS, <0,2,0,2>
+ 2685231276U, // <u,0,2,1>: Cost 3 vext3 LHS, <0,2,1,1>
+ 1994768486U, // <u,0,2,2>: Cost 2 vtrnl LHS, LHS
+ 2685231294U, // <u,0,2,3>: Cost 3 vext3 LHS, <0,2,3,1>
+ 1611489484U, // <u,0,2,4>: Cost 2 vext3 LHS, <0,2,4,6>
+ 2712068310U, // <u,0,2,5>: Cost 3 vext3 RHS, <0,2,5,7>
+ 2625136570U, // <u,0,2,6>: Cost 3 vext2 <1,2,u,0>, <2,6,3,7>
+ 2591962097U, // <u,0,2,7>: Cost 3 vext1 <7,0,0,2>, <7,0,0,2>
+ 1611489516U, // <u,0,2,u>: Cost 2 vext3 LHS, <0,2,u,2>
+ 2954067968U, // <u,0,3,0>: Cost 3 vzipr LHS, <0,0,0,0>
+ 2685231356U, // <u,0,3,1>: Cost 3 vext3 LHS, <0,3,1,0>
+ 72589981U, // <u,0,3,2>: Cost 1 vrev LHS
+ 2625137052U, // <u,0,3,3>: Cost 3 vext2 <1,2,u,0>, <3,3,3,3>
+ 2625137154U, // <u,0,3,4>: Cost 3 vext2 <1,2,u,0>, <3,4,5,6>
+ 2639071848U, // <u,0,3,5>: Cost 3 vext2 <3,5,u,0>, <3,5,u,0>
+ 2639735481U, // <u,0,3,6>: Cost 3 vext2 <3,6,u,0>, <3,6,u,0>
+ 2597279354U, // <u,0,3,7>: Cost 3 vext1 <7,u,0,3>, <7,u,0,3>
+ 73032403U, // <u,0,3,u>: Cost 1 vrev LHS
+ 2687074636U, // <u,0,4,0>: Cost 3 vext3 <0,4,0,u>, <0,4,0,u>
+ 1611489618U, // <u,0,4,1>: Cost 2 vext3 LHS, <0,4,1,5>
+ 1611489628U, // <u,0,4,2>: Cost 2 vext3 LHS, <0,4,2,6>
+ 3629222038U, // <u,0,4,3>: Cost 4 vext1 <0,u,0,4>, <3,0,1,2>
+ 2555481398U, // <u,0,4,4>: Cost 3 vext1 <0,u,0,4>, RHS
+ 1551396150U, // <u,0,4,5>: Cost 2 vext2 <1,2,u,0>, RHS
+ 2651680116U, // <u,0,4,6>: Cost 3 vext2 <5,6,u,0>, <4,6,4,6>
+ 2646150600U, // <u,0,4,7>: Cost 3 vext2 <4,7,5,0>, <4,7,5,0>
+ 1611932050U, // <u,0,4,u>: Cost 2 vext3 LHS, <0,4,u,6>
+ 2561458278U, // <u,0,5,0>: Cost 3 vext1 <1,u,0,5>, LHS
+ 1863532646U, // <u,0,5,1>: Cost 2 vzipl RHS, LHS
+ 2712068526U, // <u,0,5,2>: Cost 3 vext3 RHS, <0,5,2,7>
+ 2649689976U, // <u,0,5,3>: Cost 3 vext2 <5,3,u,0>, <5,3,u,0>
+ 2220237489U, // <u,0,5,4>: Cost 3 vrev <0,u,4,5>
+ 2651680772U, // <u,0,5,5>: Cost 3 vext2 <5,6,u,0>, <5,5,5,5>
+ 1577939051U, // <u,0,5,6>: Cost 2 vext2 <5,6,u,0>, <5,6,u,0>
+ 2830077238U, // <u,0,5,7>: Cost 3 vuzpr <1,u,3,0>, RHS
+ 1579266317U, // <u,0,5,u>: Cost 2 vext2 <5,u,u,0>, <5,u,u,0>
+ 2555494502U, // <u,0,6,0>: Cost 3 vext1 <0,u,0,6>, LHS
+ 2712068598U, // <u,0,6,1>: Cost 3 vext3 RHS, <0,6,1,7>
+ 1997750374U, // <u,0,6,2>: Cost 2 vtrnl RHS, LHS
+ 2655662673U, // <u,0,6,3>: Cost 3 vext2 <6,3,u,0>, <6,3,u,0>
+ 2555497782U, // <u,0,6,4>: Cost 3 vext1 <0,u,0,6>, RHS
+ 2651681459U, // <u,0,6,5>: Cost 3 vext2 <5,6,u,0>, <6,5,0,u>
+ 2651681592U, // <u,0,6,6>: Cost 3 vext2 <5,6,u,0>, <6,6,6,6>
+ 2651681614U, // <u,0,6,7>: Cost 3 vext2 <5,6,u,0>, <6,7,0,1>
+ 1997750428U, // <u,0,6,u>: Cost 2 vtrnl RHS, LHS
+ 2567446630U, // <u,0,7,0>: Cost 3 vext1 <2,u,0,7>, LHS
+ 2567447446U, // <u,0,7,1>: Cost 3 vext1 <2,u,0,7>, <1,2,3,0>
+ 2567448641U, // <u,0,7,2>: Cost 3 vext1 <2,u,0,7>, <2,u,0,7>
+ 2573421338U, // <u,0,7,3>: Cost 3 vext1 <3,u,0,7>, <3,u,0,7>
+ 2567449910U, // <u,0,7,4>: Cost 3 vext1 <2,u,0,7>, RHS
+ 2651682242U, // <u,0,7,5>: Cost 3 vext2 <5,6,u,0>, <7,5,6,u>
+ 2591339429U, // <u,0,7,6>: Cost 3 vext1 <6,u,0,7>, <6,u,0,7>
+ 2651682412U, // <u,0,7,7>: Cost 3 vext2 <5,6,u,0>, <7,7,7,7>
+ 2567452462U, // <u,0,7,u>: Cost 3 vext1 <2,u,0,7>, LHS
+ 135053414U, // <u,0,u,0>: Cost 1 vdup0 LHS
+ 1611489938U, // <u,0,u,1>: Cost 2 vext3 LHS, <0,u,1,1>
+ 537748125U, // <u,0,u,2>: Cost 1 vext3 LHS, LHS
+ 2685674148U, // <u,0,u,3>: Cost 3 vext3 LHS, <0,u,3,1>
+ 1611932338U, // <u,0,u,4>: Cost 2 vext3 LHS, <0,u,4,6>
+ 1551399066U, // <u,0,u,5>: Cost 2 vext2 <1,2,u,0>, RHS
+ 1517605798U, // <u,0,u,6>: Cost 2 vext1 <6,u,0,u>, <6,u,0,u>
+ 2830077481U, // <u,0,u,7>: Cost 3 vuzpr <1,u,3,0>, RHS
+ 537748179U, // <u,0,u,u>: Cost 1 vext3 LHS, LHS
+ 1544101961U, // <u,1,0,0>: Cost 2 vext2 <0,0,u,1>, <0,0,u,1>
+ 1558036582U, // <u,1,0,1>: Cost 2 vext2 <2,3,u,1>, LHS
+ 2619171051U, // <u,1,0,2>: Cost 3 vext2 <0,2,u,1>, <0,2,u,1>
+ 1611490038U, // <u,1,0,3>: Cost 2 vext3 LHS, <1,0,3,2>
+ 2555522358U, // <u,1,0,4>: Cost 3 vext1 <0,u,1,0>, RHS
+ 2712068871U, // <u,1,0,5>: Cost 3 vext3 RHS, <1,0,5,1>
+ 2591355815U, // <u,1,0,6>: Cost 3 vext1 <6,u,1,0>, <6,u,1,0>
+ 2597328512U, // <u,1,0,7>: Cost 3 vext1 <7,u,1,0>, <7,u,1,0>
+ 1611490083U, // <u,1,0,u>: Cost 2 vext3 LHS, <1,0,u,2>
+ 1481785446U, // <u,1,1,0>: Cost 2 vext1 <0,u,1,1>, LHS
+ 202162278U, // <u,1,1,1>: Cost 1 vdup1 LHS
+ 2555528808U, // <u,1,1,2>: Cost 3 vext1 <0,u,1,1>, <2,2,2,2>
+ 1611490120U, // <u,1,1,3>: Cost 2 vext3 LHS, <1,1,3,3>
+ 1481788726U, // <u,1,1,4>: Cost 2 vext1 <0,u,1,1>, RHS
+ 2689876828U, // <u,1,1,5>: Cost 3 vext3 LHS, <1,1,5,5>
+ 2591364008U, // <u,1,1,6>: Cost 3 vext1 <6,u,1,1>, <6,u,1,1>
+ 2592691274U, // <u,1,1,7>: Cost 3 vext1 <7,1,1,1>, <7,1,1,1>
+ 202162278U, // <u,1,1,u>: Cost 1 vdup1 LHS
+ 1499709542U, // <u,1,2,0>: Cost 2 vext1 <3,u,1,2>, LHS
+ 2689876871U, // <u,1,2,1>: Cost 3 vext3 LHS, <1,2,1,3>
+ 2631116445U, // <u,1,2,2>: Cost 3 vext2 <2,2,u,1>, <2,2,u,1>
+ 835584U, // <u,1,2,3>: Cost 0 copy LHS
+ 1499712822U, // <u,1,2,4>: Cost 2 vext1 <3,u,1,2>, RHS
+ 2689876907U, // <u,1,2,5>: Cost 3 vext3 LHS, <1,2,5,3>
+ 2631780282U, // <u,1,2,6>: Cost 3 vext2 <2,3,u,1>, <2,6,3,7>
+ 1523603074U, // <u,1,2,7>: Cost 2 vext1 <7,u,1,2>, <7,u,1,2>
+ 835584U, // <u,1,2,u>: Cost 0 copy LHS
+ 1487773798U, // <u,1,3,0>: Cost 2 vext1 <1,u,1,3>, LHS
+ 1611490264U, // <u,1,3,1>: Cost 2 vext3 LHS, <1,3,1,3>
+ 2685232094U, // <u,1,3,2>: Cost 3 vext3 LHS, <1,3,2,0>
+ 2018746470U, // <u,1,3,3>: Cost 2 vtrnr LHS, LHS
+ 1487777078U, // <u,1,3,4>: Cost 2 vext1 <1,u,1,3>, RHS
+ 1611490304U, // <u,1,3,5>: Cost 2 vext3 LHS, <1,3,5,7>
+ 2685674505U, // <u,1,3,6>: Cost 3 vext3 LHS, <1,3,6,7>
+ 2640407307U, // <u,1,3,7>: Cost 3 vext2 <3,7,u,1>, <3,7,u,1>
+ 1611490327U, // <u,1,3,u>: Cost 2 vext3 LHS, <1,3,u,3>
+ 1567992749U, // <u,1,4,0>: Cost 2 vext2 <4,0,u,1>, <4,0,u,1>
+ 2693121070U, // <u,1,4,1>: Cost 3 vext3 <1,4,1,u>, <1,4,1,u>
+ 2693194807U, // <u,1,4,2>: Cost 3 vext3 <1,4,2,u>, <1,4,2,u>
+ 1152386432U, // <u,1,4,3>: Cost 2 vrev <1,u,3,4>
+ 2555555126U, // <u,1,4,4>: Cost 3 vext1 <0,u,1,4>, RHS
+ 1558039862U, // <u,1,4,5>: Cost 2 vext2 <2,3,u,1>, RHS
+ 2645716371U, // <u,1,4,6>: Cost 3 vext2 <4,6,u,1>, <4,6,u,1>
+ 2597361284U, // <u,1,4,7>: Cost 3 vext1 <7,u,1,4>, <7,u,1,4>
+ 1152755117U, // <u,1,4,u>: Cost 2 vrev <1,u,u,4>
+ 1481818214U, // <u,1,5,0>: Cost 2 vext1 <0,u,1,5>, LHS
+ 2555560694U, // <u,1,5,1>: Cost 3 vext1 <0,u,1,5>, <1,0,3,2>
+ 2555561576U, // <u,1,5,2>: Cost 3 vext1 <0,u,1,5>, <2,2,2,2>
+ 1611490448U, // <u,1,5,3>: Cost 2 vext3 LHS, <1,5,3,7>
+ 1481821494U, // <u,1,5,4>: Cost 2 vext1 <0,u,1,5>, RHS
+ 2651025435U, // <u,1,5,5>: Cost 3 vext2 <5,5,u,1>, <5,5,u,1>
+ 2651689068U, // <u,1,5,6>: Cost 3 vext2 <5,6,u,1>, <5,6,u,1>
+ 2823966006U, // <u,1,5,7>: Cost 3 vuzpr <0,u,1,1>, RHS
+ 1611932861U, // <u,1,5,u>: Cost 2 vext3 LHS, <1,5,u,7>
+ 2555568230U, // <u,1,6,0>: Cost 3 vext1 <0,u,1,6>, LHS
+ 2689877199U, // <u,1,6,1>: Cost 3 vext3 LHS, <1,6,1,7>
+ 2712069336U, // <u,1,6,2>: Cost 3 vext3 RHS, <1,6,2,7>
+ 2685232353U, // <u,1,6,3>: Cost 3 vext3 LHS, <1,6,3,7>
+ 2555571510U, // <u,1,6,4>: Cost 3 vext1 <0,u,1,6>, RHS
+ 2689877235U, // <u,1,6,5>: Cost 3 vext3 LHS, <1,6,5,7>
+ 2657661765U, // <u,1,6,6>: Cost 3 vext2 <6,6,u,1>, <6,6,u,1>
+ 1584583574U, // <u,1,6,7>: Cost 2 vext2 <6,7,u,1>, <6,7,u,1>
+ 1585247207U, // <u,1,6,u>: Cost 2 vext2 <6,u,u,1>, <6,u,u,1>
+ 2561548390U, // <u,1,7,0>: Cost 3 vext1 <1,u,1,7>, LHS
+ 2561549681U, // <u,1,7,1>: Cost 3 vext1 <1,u,1,7>, <1,u,1,7>
+ 2573493926U, // <u,1,7,2>: Cost 3 vext1 <3,u,1,7>, <2,3,0,1>
+ 2042962022U, // <u,1,7,3>: Cost 2 vtrnr RHS, LHS
+ 2561551670U, // <u,1,7,4>: Cost 3 vext1 <1,u,1,7>, RHS
+ 2226300309U, // <u,1,7,5>: Cost 3 vrev <1,u,5,7>
+ 2658325990U, // <u,1,7,6>: Cost 3 vext2 <6,7,u,1>, <7,6,1,u>
+ 2658326124U, // <u,1,7,7>: Cost 3 vext2 <6,7,u,1>, <7,7,7,7>
+ 2042962027U, // <u,1,7,u>: Cost 2 vtrnr RHS, LHS
+ 1481842790U, // <u,1,u,0>: Cost 2 vext1 <0,u,1,u>, LHS
+ 202162278U, // <u,1,u,1>: Cost 1 vdup1 LHS
+ 2685674867U, // <u,1,u,2>: Cost 3 vext3 LHS, <1,u,2,0>
+ 835584U, // <u,1,u,3>: Cost 0 copy LHS
+ 1481846070U, // <u,1,u,4>: Cost 2 vext1 <0,u,1,u>, RHS
+ 1611933077U, // <u,1,u,5>: Cost 2 vext3 LHS, <1,u,5,7>
+ 2685674910U, // <u,1,u,6>: Cost 3 vext3 LHS, <1,u,6,7>
+ 1523652232U, // <u,1,u,7>: Cost 2 vext1 <7,u,1,u>, <7,u,1,u>
+ 835584U, // <u,1,u,u>: Cost 0 copy LHS
+ 1544110154U, // <u,2,0,0>: Cost 2 vext2 <0,0,u,2>, <0,0,u,2>
+ 1545437286U, // <u,2,0,1>: Cost 2 vext2 <0,2,u,2>, LHS
+ 1545437420U, // <u,2,0,2>: Cost 2 vext2 <0,2,u,2>, <0,2,u,2>
+ 2685232589U, // <u,2,0,3>: Cost 3 vext3 LHS, <2,0,3,0>
+ 2619179346U, // <u,2,0,4>: Cost 3 vext2 <0,2,u,2>, <0,4,1,5>
+ 2712069606U, // <u,2,0,5>: Cost 3 vext3 RHS, <2,0,5,7>
+ 2689877484U, // <u,2,0,6>: Cost 3 vext3 LHS, <2,0,6,4>
+ 2659656273U, // <u,2,0,7>: Cost 3 vext2 <7,0,u,2>, <0,7,2,u>
+ 1545437853U, // <u,2,0,u>: Cost 2 vext2 <0,2,u,2>, LHS
+ 1550082851U, // <u,2,1,0>: Cost 2 vext2 <1,0,u,2>, <1,0,u,2>
+ 2619179828U, // <u,2,1,1>: Cost 3 vext2 <0,2,u,2>, <1,1,1,1>
+ 2619179926U, // <u,2,1,2>: Cost 3 vext2 <0,2,u,2>, <1,2,3,0>
+ 2685232671U, // <u,2,1,3>: Cost 3 vext3 LHS, <2,1,3,1>
+ 2555604278U, // <u,2,1,4>: Cost 3 vext1 <0,u,2,1>, RHS
+ 2619180176U, // <u,2,1,5>: Cost 3 vext2 <0,2,u,2>, <1,5,3,7>
+ 2689877564U, // <u,2,1,6>: Cost 3 vext3 LHS, <2,1,6,3>
+ 2602718850U, // <u,2,1,7>: Cost 3 vext1 <u,7,2,1>, <7,u,1,2>
+ 1158703235U, // <u,2,1,u>: Cost 2 vrev <2,u,u,1>
+ 1481867366U, // <u,2,2,0>: Cost 2 vext1 <0,u,2,2>, LHS
+ 2555609846U, // <u,2,2,1>: Cost 3 vext1 <0,u,2,2>, <1,0,3,2>
+ 269271142U, // <u,2,2,2>: Cost 1 vdup2 LHS
+ 1611490930U, // <u,2,2,3>: Cost 2 vext3 LHS, <2,2,3,3>
+ 1481870646U, // <u,2,2,4>: Cost 2 vext1 <0,u,2,2>, RHS
+ 2689877640U, // <u,2,2,5>: Cost 3 vext3 LHS, <2,2,5,7>
+ 2619180986U, // <u,2,2,6>: Cost 3 vext2 <0,2,u,2>, <2,6,3,7>
+ 2593436837U, // <u,2,2,7>: Cost 3 vext1 <7,2,2,2>, <7,2,2,2>
+ 269271142U, // <u,2,2,u>: Cost 1 vdup2 LHS
+ 408134301U, // <u,2,3,0>: Cost 1 vext1 LHS, LHS
+ 1481876214U, // <u,2,3,1>: Cost 2 vext1 LHS, <1,0,3,2>
+ 1481877096U, // <u,2,3,2>: Cost 2 vext1 LHS, <2,2,2,2>
+ 1880326246U, // <u,2,3,3>: Cost 2 vzipr LHS, LHS
+ 408137014U, // <u,2,3,4>: Cost 1 vext1 LHS, RHS
+ 1529654992U, // <u,2,3,5>: Cost 2 vext1 LHS, <5,1,7,3>
+ 1529655802U, // <u,2,3,6>: Cost 2 vext1 LHS, <6,2,7,3>
+ 1529656314U, // <u,2,3,7>: Cost 2 vext1 LHS, <7,0,1,2>
+ 408139566U, // <u,2,3,u>: Cost 1 vext1 LHS, LHS
+ 1567853468U, // <u,2,4,0>: Cost 2 vext2 <4,0,6,2>, <4,0,6,2>
+ 2561598362U, // <u,2,4,1>: Cost 3 vext1 <1,u,2,4>, <1,2,3,4>
+ 2555627214U, // <u,2,4,2>: Cost 3 vext1 <0,u,2,4>, <2,3,4,5>
+ 2685232918U, // <u,2,4,3>: Cost 3 vext3 LHS, <2,4,3,5>
+ 2555628854U, // <u,2,4,4>: Cost 3 vext1 <0,u,2,4>, RHS
+ 1545440566U, // <u,2,4,5>: Cost 2 vext2 <0,2,u,2>, RHS
+ 1571982740U, // <u,2,4,6>: Cost 2 vext2 <4,6,u,2>, <4,6,u,2>
+ 2592125957U, // <u,2,4,7>: Cost 3 vext1 <7,0,2,4>, <7,0,2,4>
+ 1545440809U, // <u,2,4,u>: Cost 2 vext2 <0,2,u,2>, RHS
+ 2555633766U, // <u,2,5,0>: Cost 3 vext1 <0,u,2,5>, LHS
+ 2561606550U, // <u,2,5,1>: Cost 3 vext1 <1,u,2,5>, <1,2,3,0>
+ 2689877856U, // <u,2,5,2>: Cost 3 vext3 LHS, <2,5,2,7>
+ 2685233000U, // <u,2,5,3>: Cost 3 vext3 LHS, <2,5,3,6>
+ 1158441059U, // <u,2,5,4>: Cost 2 vrev <2,u,4,5>
+ 2645725188U, // <u,2,5,5>: Cost 3 vext2 <4,6,u,2>, <5,5,5,5>
+ 2689877892U, // <u,2,5,6>: Cost 3 vext3 LHS, <2,5,6,7>
+ 2823900470U, // <u,2,5,7>: Cost 3 vuzpr <0,u,0,2>, RHS
+ 1158736007U, // <u,2,5,u>: Cost 2 vrev <2,u,u,5>
+ 1481900134U, // <u,2,6,0>: Cost 2 vext1 <0,u,2,6>, LHS
+ 2555642614U, // <u,2,6,1>: Cost 3 vext1 <0,u,2,6>, <1,0,3,2>
+ 2555643496U, // <u,2,6,2>: Cost 3 vext1 <0,u,2,6>, <2,2,2,2>
+ 1611491258U, // <u,2,6,3>: Cost 2 vext3 LHS, <2,6,3,7>
+ 1481903414U, // <u,2,6,4>: Cost 2 vext1 <0,u,2,6>, RHS
+ 2689877964U, // <u,2,6,5>: Cost 3 vext3 LHS, <2,6,5,7>
+ 2689877973U, // <u,2,6,6>: Cost 3 vext3 LHS, <2,6,6,7>
+ 2645726030U, // <u,2,6,7>: Cost 3 vext2 <4,6,u,2>, <6,7,0,1>
+ 1611933671U, // <u,2,6,u>: Cost 2 vext3 LHS, <2,6,u,7>
+ 1585919033U, // <u,2,7,0>: Cost 2 vext2 <7,0,u,2>, <7,0,u,2>
+ 2573566710U, // <u,2,7,1>: Cost 3 vext1 <3,u,2,7>, <1,0,3,2>
+ 2567596115U, // <u,2,7,2>: Cost 3 vext1 <2,u,2,7>, <2,u,2,7>
+ 1906901094U, // <u,2,7,3>: Cost 2 vzipr RHS, LHS
+ 2555653430U, // <u,2,7,4>: Cost 3 vext1 <0,u,2,7>, RHS
+ 2800080230U, // <u,2,7,5>: Cost 3 vuzpl LHS, <7,4,5,6>
+ 2980643164U, // <u,2,7,6>: Cost 3 vzipr RHS, <0,4,2,6>
+ 2645726828U, // <u,2,7,7>: Cost 3 vext2 <4,6,u,2>, <7,7,7,7>
+ 1906901099U, // <u,2,7,u>: Cost 2 vzipr RHS, LHS
+ 408175266U, // <u,2,u,0>: Cost 1 vext1 LHS, LHS
+ 1545443118U, // <u,2,u,1>: Cost 2 vext2 <0,2,u,2>, LHS
+ 269271142U, // <u,2,u,2>: Cost 1 vdup2 LHS
+ 1611491416U, // <u,2,u,3>: Cost 2 vext3 LHS, <2,u,3,3>
+ 408177974U, // <u,2,u,4>: Cost 1 vext1 LHS, RHS
+ 1545443482U, // <u,2,u,5>: Cost 2 vext2 <0,2,u,2>, RHS
+ 1726339226U, // <u,2,u,6>: Cost 2 vuzpl LHS, RHS
+ 1529697274U, // <u,2,u,7>: Cost 2 vext1 LHS, <7,0,1,2>
+ 408180526U, // <u,2,u,u>: Cost 1 vext1 LHS, LHS
+ 1544781824U, // <u,3,0,0>: Cost 2 vext2 LHS, <0,0,0,0>
+ 471040156U, // <u,3,0,1>: Cost 1 vext2 LHS, LHS
+ 1544781988U, // <u,3,0,2>: Cost 2 vext2 LHS, <0,2,0,2>
+ 2618523900U, // <u,3,0,3>: Cost 3 vext2 LHS, <0,3,1,0>
+ 1544782162U, // <u,3,0,4>: Cost 2 vext2 LHS, <0,4,1,5>
+ 2238188352U, // <u,3,0,5>: Cost 3 vrev <3,u,5,0>
+ 2623169023U, // <u,3,0,6>: Cost 3 vext2 LHS, <0,6,2,7>
+ 2238335826U, // <u,3,0,7>: Cost 3 vrev <3,u,7,0>
+ 471040669U, // <u,3,0,u>: Cost 1 vext2 LHS, LHS
+ 1544782582U, // <u,3,1,0>: Cost 2 vext2 LHS, <1,0,3,2>
+ 1544782644U, // <u,3,1,1>: Cost 2 vext2 LHS, <1,1,1,1>
+ 1544782742U, // <u,3,1,2>: Cost 2 vext2 LHS, <1,2,3,0>
+ 1544782808U, // <u,3,1,3>: Cost 2 vext2 LHS, <1,3,1,3>
+ 2618524733U, // <u,3,1,4>: Cost 3 vext2 LHS, <1,4,3,5>
+ 1544782992U, // <u,3,1,5>: Cost 2 vext2 LHS, <1,5,3,7>
+ 2618524897U, // <u,3,1,6>: Cost 3 vext2 LHS, <1,6,3,7>
+ 2703517987U, // <u,3,1,7>: Cost 3 vext3 <3,1,7,u>, <3,1,7,u>
+ 1544783213U, // <u,3,1,u>: Cost 2 vext2 LHS, <1,u,1,3>
+ 1529716838U, // <u,3,2,0>: Cost 2 vext1 <u,u,3,2>, LHS
+ 1164167966U, // <u,3,2,1>: Cost 2 vrev <3,u,1,2>
+ 1544783464U, // <u,3,2,2>: Cost 2 vext2 LHS, <2,2,2,2>
+ 1544783526U, // <u,3,2,3>: Cost 2 vext2 LHS, <2,3,0,1>
+ 1529720118U, // <u,3,2,4>: Cost 2 vext1 <u,u,3,2>, RHS
+ 2618525544U, // <u,3,2,5>: Cost 3 vext2 LHS, <2,5,3,6>
+ 1544783802U, // <u,3,2,6>: Cost 2 vext2 LHS, <2,6,3,7>
+ 2704181620U, // <u,3,2,7>: Cost 3 vext3 <3,2,7,u>, <3,2,7,u>
+ 1544783931U, // <u,3,2,u>: Cost 2 vext2 LHS, <2,u,0,1>
+ 1544784022U, // <u,3,3,0>: Cost 2 vext2 LHS, <3,0,1,2>
+ 1487922559U, // <u,3,3,1>: Cost 2 vext1 <1,u,3,3>, <1,u,3,3>
+ 1493895256U, // <u,3,3,2>: Cost 2 vext1 <2,u,3,3>, <2,u,3,3>
+ 336380006U, // <u,3,3,3>: Cost 1 vdup3 LHS
+ 1544784386U, // <u,3,3,4>: Cost 2 vext2 LHS, <3,4,5,6>
+ 2824054478U, // <u,3,3,5>: Cost 3 vuzpr LHS, <2,3,4,5>
+ 2238286668U, // <u,3,3,6>: Cost 3 vrev <3,u,6,3>
+ 2954069136U, // <u,3,3,7>: Cost 3 vzipr LHS, <1,5,3,7>
+ 336380006U, // <u,3,3,u>: Cost 1 vdup3 LHS
+ 1487929446U, // <u,3,4,0>: Cost 2 vext1 <1,u,3,4>, LHS
+ 1487930752U, // <u,3,4,1>: Cost 2 vext1 <1,u,3,4>, <1,u,3,4>
+ 2623171644U, // <u,3,4,2>: Cost 3 vext2 LHS, <4,2,6,0>
+ 2561673366U, // <u,3,4,3>: Cost 3 vext1 <1,u,3,4>, <3,0,1,2>
+ 1487932726U, // <u,3,4,4>: Cost 2 vext1 <1,u,3,4>, RHS
+ 471043382U, // <u,3,4,5>: Cost 1 vext2 LHS, RHS
+ 1592561012U, // <u,3,4,6>: Cost 2 vext2 LHS, <4,6,4,6>
+ 2238368598U, // <u,3,4,7>: Cost 3 vrev <3,u,7,4>
+ 471043625U, // <u,3,4,u>: Cost 1 vext2 LHS, RHS
+ 2555707494U, // <u,3,5,0>: Cost 3 vext1 <0,u,3,5>, LHS
+ 1574645465U, // <u,3,5,1>: Cost 2 vext2 <5,1,u,3>, <5,1,u,3>
+ 2567653106U, // <u,3,5,2>: Cost 3 vext1 <2,u,3,5>, <2,3,u,5>
+ 2555709954U, // <u,3,5,3>: Cost 3 vext1 <0,u,3,5>, <3,4,5,6>
+ 1592561606U, // <u,3,5,4>: Cost 2 vext2 LHS, <5,4,7,6>
+ 1592561668U, // <u,3,5,5>: Cost 2 vext2 LHS, <5,5,5,5>
+ 1592561762U, // <u,3,5,6>: Cost 2 vext2 LHS, <5,6,7,0>
+ 1750314294U, // <u,3,5,7>: Cost 2 vuzpr LHS, RHS
+ 1750314295U, // <u,3,5,u>: Cost 2 vuzpr LHS, RHS
+ 2623172897U, // <u,3,6,0>: Cost 3 vext2 LHS, <6,0,1,2>
+ 2561688962U, // <u,3,6,1>: Cost 3 vext1 <1,u,3,6>, <1,u,3,6>
+ 1581281795U, // <u,3,6,2>: Cost 2 vext2 <6,2,u,3>, <6,2,u,3>
+ 2706541204U, // <u,3,6,3>: Cost 3 vext3 <3,6,3,u>, <3,6,3,u>
+ 2623173261U, // <u,3,6,4>: Cost 3 vext2 LHS, <6,4,5,6>
+ 1164495686U, // <u,3,6,5>: Cost 2 vrev <3,u,5,6>
+ 1592562488U, // <u,3,6,6>: Cost 2 vext2 LHS, <6,6,6,6>
+ 1592562510U, // <u,3,6,7>: Cost 2 vext2 LHS, <6,7,0,1>
+ 1164716897U, // <u,3,6,u>: Cost 2 vrev <3,u,u,6>
+ 1487954022U, // <u,3,7,0>: Cost 2 vext1 <1,u,3,7>, LHS
+ 1487955331U, // <u,3,7,1>: Cost 2 vext1 <1,u,3,7>, <1,u,3,7>
+ 1493928028U, // <u,3,7,2>: Cost 2 vext1 <2,u,3,7>, <2,u,3,7>
+ 2561697942U, // <u,3,7,3>: Cost 3 vext1 <1,u,3,7>, <3,0,1,2>
+ 1487957302U, // <u,3,7,4>: Cost 2 vext1 <1,u,3,7>, RHS
+ 2707352311U, // <u,3,7,5>: Cost 3 vext3 <3,7,5,u>, <3,7,5,u>
+ 2655024623U, // <u,3,7,6>: Cost 3 vext2 <6,2,u,3>, <7,6,2,u>
+ 1592563308U, // <u,3,7,7>: Cost 2 vext2 LHS, <7,7,7,7>
+ 1487959854U, // <u,3,7,u>: Cost 2 vext1 <1,u,3,7>, LHS
+ 1544787667U, // <u,3,u,0>: Cost 2 vext2 LHS, <u,0,1,2>
+ 471045934U, // <u,3,u,1>: Cost 1 vext2 LHS, LHS
+ 1549432709U, // <u,3,u,2>: Cost 2 vext2 LHS, <u,2,3,0>
+ 336380006U, // <u,3,u,3>: Cost 1 vdup3 LHS
+ 1544788031U, // <u,3,u,4>: Cost 2 vext2 LHS, <u,4,5,6>
+ 471046298U, // <u,3,u,5>: Cost 1 vext2 LHS, RHS
+ 1549433040U, // <u,3,u,6>: Cost 2 vext2 LHS, <u,6,3,7>
+ 1750314537U, // <u,3,u,7>: Cost 2 vuzpr LHS, RHS
+ 471046501U, // <u,3,u,u>: Cost 1 vext2 LHS, LHS
+ 2625167360U, // <u,4,0,0>: Cost 3 vext2 <1,2,u,4>, <0,0,0,0>
+ 1551425638U, // <u,4,0,1>: Cost 2 vext2 <1,2,u,4>, LHS
+ 2619195630U, // <u,4,0,2>: Cost 3 vext2 <0,2,u,4>, <0,2,u,4>
+ 2619343104U, // <u,4,0,3>: Cost 3 vext2 <0,3,1,4>, <0,3,1,4>
+ 2625167698U, // <u,4,0,4>: Cost 3 vext2 <1,2,u,4>, <0,4,1,5>
+ 1638329234U, // <u,4,0,5>: Cost 2 vext3 RHS, <4,0,5,1>
+ 1638329244U, // <u,4,0,6>: Cost 2 vext3 RHS, <4,0,6,2>
+ 3787803556U, // <u,4,0,7>: Cost 4 vext3 RHS, <4,0,7,1>
+ 1551426205U, // <u,4,0,u>: Cost 2 vext2 <1,2,u,4>, LHS
+ 2555748454U, // <u,4,1,0>: Cost 3 vext1 <0,u,4,1>, LHS
+ 2625168180U, // <u,4,1,1>: Cost 3 vext2 <1,2,u,4>, <1,1,1,1>
+ 1551426503U, // <u,4,1,2>: Cost 2 vext2 <1,2,u,4>, <1,2,u,4>
+ 2625168344U, // <u,4,1,3>: Cost 3 vext2 <1,2,u,4>, <1,3,1,3>
+ 2555751734U, // <u,4,1,4>: Cost 3 vext1 <0,u,4,1>, RHS
+ 1860554038U, // <u,4,1,5>: Cost 2 vzipl LHS, RHS
+ 2689879022U, // <u,4,1,6>: Cost 3 vext3 LHS, <4,1,6,3>
+ 2592248852U, // <u,4,1,7>: Cost 3 vext1 <7,0,4,1>, <7,0,4,1>
+ 1555408301U, // <u,4,1,u>: Cost 2 vext2 <1,u,u,4>, <1,u,u,4>
+ 2555756646U, // <u,4,2,0>: Cost 3 vext1 <0,u,4,2>, LHS
+ 2625168943U, // <u,4,2,1>: Cost 3 vext2 <1,2,u,4>, <2,1,4,u>
+ 2625169000U, // <u,4,2,2>: Cost 3 vext2 <1,2,u,4>, <2,2,2,2>
+ 2619197134U, // <u,4,2,3>: Cost 3 vext2 <0,2,u,4>, <2,3,4,5>
+ 2555759926U, // <u,4,2,4>: Cost 3 vext1 <0,u,4,2>, RHS
+ 2712071222U, // <u,4,2,5>: Cost 3 vext3 RHS, <4,2,5,3>
+ 1994771766U, // <u,4,2,6>: Cost 2 vtrnl LHS, RHS
+ 2592257045U, // <u,4,2,7>: Cost 3 vext1 <7,0,4,2>, <7,0,4,2>
+ 1994771784U, // <u,4,2,u>: Cost 2 vtrnl LHS, RHS
+ 2625169558U, // <u,4,3,0>: Cost 3 vext2 <1,2,u,4>, <3,0,1,2>
+ 2567709594U, // <u,4,3,1>: Cost 3 vext1 <2,u,4,3>, <1,2,3,4>
+ 2567710817U, // <u,4,3,2>: Cost 3 vext1 <2,u,4,3>, <2,u,4,3>
+ 2625169820U, // <u,4,3,3>: Cost 3 vext2 <1,2,u,4>, <3,3,3,3>
+ 2625169922U, // <u,4,3,4>: Cost 3 vext2 <1,2,u,4>, <3,4,5,6>
+ 2954069710U, // <u,4,3,5>: Cost 3 vzipr LHS, <2,3,4,5>
+ 2954068172U, // <u,4,3,6>: Cost 3 vzipr LHS, <0,2,4,6>
+ 3903849472U, // <u,4,3,7>: Cost 4 vuzpr <1,u,3,4>, <1,3,5,7>
+ 2954068174U, // <u,4,3,u>: Cost 3 vzipr LHS, <0,2,4,u>
+ 1505919078U, // <u,4,4,0>: Cost 2 vext1 <4,u,4,4>, LHS
+ 2567717831U, // <u,4,4,1>: Cost 3 vext1 <2,u,4,4>, <1,2,u,4>
+ 2567719010U, // <u,4,4,2>: Cost 3 vext1 <2,u,4,4>, <2,u,4,4>
+ 2570373542U, // <u,4,4,3>: Cost 3 vext1 <3,3,4,4>, <3,3,4,4>
+ 161926454U, // <u,4,4,4>: Cost 1 vdup0 RHS
+ 1551428918U, // <u,4,4,5>: Cost 2 vext2 <1,2,u,4>, RHS
+ 1638329572U, // <u,4,4,6>: Cost 2 vext3 RHS, <4,4,6,6>
+ 2594927963U, // <u,4,4,7>: Cost 3 vext1 <7,4,4,4>, <7,4,4,4>
+ 161926454U, // <u,4,4,u>: Cost 1 vdup0 RHS
+ 1493983334U, // <u,4,5,0>: Cost 2 vext1 <2,u,4,5>, LHS
+ 2689879301U, // <u,4,5,1>: Cost 3 vext3 LHS, <4,5,1,3>
+ 1493985379U, // <u,4,5,2>: Cost 2 vext1 <2,u,4,5>, <2,u,4,5>
+ 2567727254U, // <u,4,5,3>: Cost 3 vext1 <2,u,4,5>, <3,0,1,2>
+ 1493986614U, // <u,4,5,4>: Cost 2 vext1 <2,u,4,5>, RHS
+ 1863535926U, // <u,4,5,5>: Cost 2 vzipl RHS, RHS
+ 537750838U, // <u,4,5,6>: Cost 1 vext3 LHS, RHS
+ 2830110006U, // <u,4,5,7>: Cost 3 vuzpr <1,u,3,4>, RHS
+ 537750856U, // <u,4,5,u>: Cost 1 vext3 LHS, RHS
+ 1482047590U, // <u,4,6,0>: Cost 2 vext1 <0,u,4,6>, LHS
+ 2555790070U, // <u,4,6,1>: Cost 3 vext1 <0,u,4,6>, <1,0,3,2>
+ 2555790952U, // <u,4,6,2>: Cost 3 vext1 <0,u,4,6>, <2,2,2,2>
+ 2555791510U, // <u,4,6,3>: Cost 3 vext1 <0,u,4,6>, <3,0,1,2>
+ 1482050870U, // <u,4,6,4>: Cost 2 vext1 <0,u,4,6>, RHS
+ 2689879422U, // <u,4,6,5>: Cost 3 vext3 LHS, <4,6,5,7>
+ 1997753654U, // <u,4,6,6>: Cost 2 vtrnl RHS, RHS
+ 2712071562U, // <u,4,6,7>: Cost 3 vext3 RHS, <4,6,7,1>
+ 1482053422U, // <u,4,6,u>: Cost 2 vext1 <0,u,4,6>, LHS
+ 2567741542U, // <u,4,7,0>: Cost 3 vext1 <2,u,4,7>, LHS
+ 2567742362U, // <u,4,7,1>: Cost 3 vext1 <2,u,4,7>, <1,2,3,4>
+ 2567743589U, // <u,4,7,2>: Cost 3 vext1 <2,u,4,7>, <2,u,4,7>
+ 2573716286U, // <u,4,7,3>: Cost 3 vext1 <3,u,4,7>, <3,u,4,7>
+ 2567744822U, // <u,4,7,4>: Cost 3 vext1 <2,u,4,7>, RHS
+ 2712071624U, // <u,4,7,5>: Cost 3 vext3 RHS, <4,7,5,0>
+ 96808489U, // <u,4,7,6>: Cost 1 vrev RHS
+ 2651715180U, // <u,4,7,7>: Cost 3 vext2 <5,6,u,4>, <7,7,7,7>
+ 96955963U, // <u,4,7,u>: Cost 1 vrev RHS
+ 1482063974U, // <u,4,u,0>: Cost 2 vext1 <0,u,4,u>, LHS
+ 1551431470U, // <u,4,u,1>: Cost 2 vext2 <1,2,u,4>, LHS
+ 1494009958U, // <u,4,u,2>: Cost 2 vext1 <2,u,4,u>, <2,u,4,u>
+ 2555807894U, // <u,4,u,3>: Cost 3 vext1 <0,u,4,u>, <3,0,1,2>
+ 161926454U, // <u,4,u,4>: Cost 1 vdup0 RHS
+ 1551431834U, // <u,4,u,5>: Cost 2 vext2 <1,2,u,4>, RHS
+ 537751081U, // <u,4,u,6>: Cost 1 vext3 LHS, RHS
+ 2830110249U, // <u,4,u,7>: Cost 3 vuzpr <1,u,3,4>, RHS
+ 537751099U, // <u,4,u,u>: Cost 1 vext3 LHS, RHS
+ 2631811072U, // <u,5,0,0>: Cost 3 vext2 <2,3,u,5>, <0,0,0,0>
+ 1558069350U, // <u,5,0,1>: Cost 2 vext2 <2,3,u,5>, LHS
+ 2619203823U, // <u,5,0,2>: Cost 3 vext2 <0,2,u,5>, <0,2,u,5>
+ 2619867456U, // <u,5,0,3>: Cost 3 vext2 <0,3,u,5>, <0,3,u,5>
+ 1546273106U, // <u,5,0,4>: Cost 2 vext2 <0,4,1,5>, <0,4,1,5>
+ 2733010539U, // <u,5,0,5>: Cost 3 vext3 LHS, <5,0,5,1>
+ 2597622682U, // <u,5,0,6>: Cost 3 vext1 <7,u,5,0>, <6,7,u,5>
+ 1176539396U, // <u,5,0,7>: Cost 2 vrev <5,u,7,0>
+ 1558069917U, // <u,5,0,u>: Cost 2 vext2 <2,3,u,5>, LHS
+ 1505968230U, // <u,5,1,0>: Cost 2 vext1 <4,u,5,1>, LHS
+ 2624512887U, // <u,5,1,1>: Cost 3 vext2 <1,1,u,5>, <1,1,u,5>
+ 2631811990U, // <u,5,1,2>: Cost 3 vext2 <2,3,u,5>, <1,2,3,0>
+ 2618541056U, // <u,5,1,3>: Cost 3 vext2 <0,1,u,5>, <1,3,5,7>
+ 1505971510U, // <u,5,1,4>: Cost 2 vext1 <4,u,5,1>, RHS
+ 2627167419U, // <u,5,1,5>: Cost 3 vext2 <1,5,u,5>, <1,5,u,5>
+ 2579714554U, // <u,5,1,6>: Cost 3 vext1 <4,u,5,1>, <6,2,7,3>
+ 1638330064U, // <u,5,1,7>: Cost 2 vext3 RHS, <5,1,7,3>
+ 1638477529U, // <u,5,1,u>: Cost 2 vext3 RHS, <5,1,u,3>
+ 2561802342U, // <u,5,2,0>: Cost 3 vext1 <1,u,5,2>, LHS
+ 2561803264U, // <u,5,2,1>: Cost 3 vext1 <1,u,5,2>, <1,3,5,7>
+ 2631149217U, // <u,5,2,2>: Cost 3 vext2 <2,2,u,5>, <2,2,u,5>
+ 1558071026U, // <u,5,2,3>: Cost 2 vext2 <2,3,u,5>, <2,3,u,5>
+ 2561805622U, // <u,5,2,4>: Cost 3 vext1 <1,u,5,2>, RHS
+ 2714062607U, // <u,5,2,5>: Cost 3 vext3 RHS, <5,2,5,3>
+ 2631813050U, // <u,5,2,6>: Cost 3 vext2 <2,3,u,5>, <2,6,3,7>
+ 3092335926U, // <u,5,2,7>: Cost 3 vtrnr <0,u,0,2>, RHS
+ 1561389191U, // <u,5,2,u>: Cost 2 vext2 <2,u,u,5>, <2,u,u,5>
+ 2561810534U, // <u,5,3,0>: Cost 3 vext1 <1,u,5,3>, LHS
+ 2561811857U, // <u,5,3,1>: Cost 3 vext1 <1,u,5,3>, <1,u,5,3>
+ 2631813474U, // <u,5,3,2>: Cost 3 vext2 <2,3,u,5>, <3,2,5,u>
+ 2631813532U, // <u,5,3,3>: Cost 3 vext2 <2,3,u,5>, <3,3,3,3>
+ 2619869698U, // <u,5,3,4>: Cost 3 vext2 <0,3,u,5>, <3,4,5,6>
+ 3001847002U, // <u,5,3,5>: Cost 3 vzipr LHS, <4,4,5,5>
+ 2954070530U, // <u,5,3,6>: Cost 3 vzipr LHS, <3,4,5,6>
+ 2018749750U, // <u,5,3,7>: Cost 2 vtrnr LHS, RHS
+ 2018749751U, // <u,5,3,u>: Cost 2 vtrnr LHS, RHS
+ 2573762662U, // <u,5,4,0>: Cost 3 vext1 <3,u,5,4>, LHS
+ 2620017634U, // <u,5,4,1>: Cost 3 vext2 <0,4,1,5>, <4,1,5,0>
+ 2573764338U, // <u,5,4,2>: Cost 3 vext1 <3,u,5,4>, <2,3,u,5>
+ 2573765444U, // <u,5,4,3>: Cost 3 vext1 <3,u,5,4>, <3,u,5,4>
+ 1570680053U, // <u,5,4,4>: Cost 2 vext2 <4,4,u,5>, <4,4,u,5>
+ 1558072630U, // <u,5,4,5>: Cost 2 vext2 <2,3,u,5>, RHS
+ 2645749143U, // <u,5,4,6>: Cost 3 vext2 <4,6,u,5>, <4,6,u,5>
+ 1638330310U, // <u,5,4,7>: Cost 2 vext3 RHS, <5,4,7,6>
+ 1558072873U, // <u,5,4,u>: Cost 2 vext2 <2,3,u,5>, RHS
+ 1506000998U, // <u,5,5,0>: Cost 2 vext1 <4,u,5,5>, LHS
+ 2561827984U, // <u,5,5,1>: Cost 3 vext1 <1,u,5,5>, <1,5,3,7>
+ 2579744360U, // <u,5,5,2>: Cost 3 vext1 <4,u,5,5>, <2,2,2,2>
+ 2579744918U, // <u,5,5,3>: Cost 3 vext1 <4,u,5,5>, <3,0,1,2>
+ 1506004278U, // <u,5,5,4>: Cost 2 vext1 <4,u,5,5>, RHS
+ 229035318U, // <u,5,5,5>: Cost 1 vdup1 RHS
+ 2712072206U, // <u,5,5,6>: Cost 3 vext3 RHS, <5,5,6,6>
+ 1638330392U, // <u,5,5,7>: Cost 2 vext3 RHS, <5,5,7,7>
+ 229035318U, // <u,5,5,u>: Cost 1 vdup1 RHS
+ 1500037222U, // <u,5,6,0>: Cost 2 vext1 <3,u,5,6>, LHS
+ 2561836436U, // <u,5,6,1>: Cost 3 vext1 <1,u,5,6>, <1,u,5,6>
+ 2567809133U, // <u,5,6,2>: Cost 3 vext1 <2,u,5,6>, <2,u,5,6>
+ 1500040006U, // <u,5,6,3>: Cost 2 vext1 <3,u,5,6>, <3,u,5,6>
+ 1500040502U, // <u,5,6,4>: Cost 2 vext1 <3,u,5,6>, RHS
+ 2714062935U, // <u,5,6,5>: Cost 3 vext3 RHS, <5,6,5,7>
+ 2712072288U, // <u,5,6,6>: Cost 3 vext3 RHS, <5,6,6,7>
+ 27705344U, // <u,5,6,7>: Cost 0 copy RHS
+ 27705344U, // <u,5,6,u>: Cost 0 copy RHS
+ 1488101478U, // <u,5,7,0>: Cost 2 vext1 <1,u,5,7>, LHS
+ 1488102805U, // <u,5,7,1>: Cost 2 vext1 <1,u,5,7>, <1,u,5,7>
+ 2561844840U, // <u,5,7,2>: Cost 3 vext1 <1,u,5,7>, <2,2,2,2>
+ 2561845398U, // <u,5,7,3>: Cost 3 vext1 <1,u,5,7>, <3,0,1,2>
+ 1488104758U, // <u,5,7,4>: Cost 2 vext1 <1,u,5,7>, RHS
+ 1638330536U, // <u,5,7,5>: Cost 2 vext3 RHS, <5,7,5,7>
+ 2712072362U, // <u,5,7,6>: Cost 3 vext3 RHS, <5,7,6,0>
+ 2042965302U, // <u,5,7,7>: Cost 2 vtrnr RHS, RHS
+ 1488107310U, // <u,5,7,u>: Cost 2 vext1 <1,u,5,7>, LHS
+ 1488109670U, // <u,5,u,0>: Cost 2 vext1 <1,u,5,u>, LHS
+ 1488110998U, // <u,5,u,1>: Cost 2 vext1 <1,u,5,u>, <1,u,5,u>
+ 2561853032U, // <u,5,u,2>: Cost 3 vext1 <1,u,5,u>, <2,2,2,2>
+ 1500056392U, // <u,5,u,3>: Cost 2 vext1 <3,u,5,u>, <3,u,5,u>
+ 1488112950U, // <u,5,u,4>: Cost 2 vext1 <1,u,5,u>, RHS
+ 229035318U, // <u,5,u,5>: Cost 1 vdup1 RHS
+ 2954111490U, // <u,5,u,6>: Cost 3 vzipr LHS, <3,4,5,6>
+ 27705344U, // <u,5,u,7>: Cost 0 copy RHS
+ 27705344U, // <u,5,u,u>: Cost 0 copy RHS
+ 2619211776U, // <u,6,0,0>: Cost 3 vext2 <0,2,u,6>, <0,0,0,0>
+ 1545470054U, // <u,6,0,1>: Cost 2 vext2 <0,2,u,6>, LHS
+ 1545470192U, // <u,6,0,2>: Cost 2 vext2 <0,2,u,6>, <0,2,u,6>
+ 2255958969U, // <u,6,0,3>: Cost 3 vrev <6,u,3,0>
+ 1546797458U, // <u,6,0,4>: Cost 2 vext2 <0,4,u,6>, <0,4,u,6>
+ 2720624971U, // <u,6,0,5>: Cost 3 vext3 <6,0,5,u>, <6,0,5,u>
+ 2256180180U, // <u,6,0,6>: Cost 3 vrev <6,u,6,0>
+ 2960682294U, // <u,6,0,7>: Cost 3 vzipr <1,2,u,0>, RHS
+ 1545470621U, // <u,6,0,u>: Cost 2 vext2 <0,2,u,6>, LHS
+ 1182004127U, // <u,6,1,0>: Cost 2 vrev <6,u,0,1>
+ 2619212596U, // <u,6,1,1>: Cost 3 vext2 <0,2,u,6>, <1,1,1,1>
+ 2619212694U, // <u,6,1,2>: Cost 3 vext2 <0,2,u,6>, <1,2,3,0>
+ 2619212760U, // <u,6,1,3>: Cost 3 vext2 <0,2,u,6>, <1,3,1,3>
+ 2626511979U, // <u,6,1,4>: Cost 3 vext2 <1,4,u,6>, <1,4,u,6>
+ 2619212944U, // <u,6,1,5>: Cost 3 vext2 <0,2,u,6>, <1,5,3,7>
+ 2714063264U, // <u,6,1,6>: Cost 3 vext3 RHS, <6,1,6,3>
+ 2967326006U, // <u,6,1,7>: Cost 3 vzipr <2,3,u,1>, RHS
+ 1182594023U, // <u,6,1,u>: Cost 2 vrev <6,u,u,1>
+ 1506050150U, // <u,6,2,0>: Cost 2 vext1 <4,u,6,2>, LHS
+ 2579792630U, // <u,6,2,1>: Cost 3 vext1 <4,u,6,2>, <1,0,3,2>
+ 2619213416U, // <u,6,2,2>: Cost 3 vext2 <0,2,u,6>, <2,2,2,2>
+ 2619213478U, // <u,6,2,3>: Cost 3 vext2 <0,2,u,6>, <2,3,0,1>
+ 1506053430U, // <u,6,2,4>: Cost 2 vext1 <4,u,6,2>, RHS
+ 2633148309U, // <u,6,2,5>: Cost 3 vext2 <2,5,u,6>, <2,5,u,6>
+ 2619213754U, // <u,6,2,6>: Cost 3 vext2 <0,2,u,6>, <2,6,3,7>
+ 1638330874U, // <u,6,2,7>: Cost 2 vext3 RHS, <6,2,7,3>
+ 1638478339U, // <u,6,2,u>: Cost 2 vext3 RHS, <6,2,u,3>
+ 2619213974U, // <u,6,3,0>: Cost 3 vext2 <0,2,u,6>, <3,0,1,2>
+ 2255836074U, // <u,6,3,1>: Cost 3 vrev <6,u,1,3>
+ 2255909811U, // <u,6,3,2>: Cost 3 vrev <6,u,2,3>
+ 2619214236U, // <u,6,3,3>: Cost 3 vext2 <0,2,u,6>, <3,3,3,3>
+ 1564715549U, // <u,6,3,4>: Cost 2 vext2 <3,4,u,6>, <3,4,u,6>
+ 2639121006U, // <u,6,3,5>: Cost 3 vext2 <3,5,u,6>, <3,5,u,6>
+ 3001847012U, // <u,6,3,6>: Cost 3 vzipr LHS, <4,4,6,6>
+ 1880329526U, // <u,6,3,7>: Cost 2 vzipr LHS, RHS
+ 1880329527U, // <u,6,3,u>: Cost 2 vzipr LHS, RHS
+ 2567864422U, // <u,6,4,0>: Cost 3 vext1 <2,u,6,4>, LHS
+ 2733011558U, // <u,6,4,1>: Cost 3 vext3 LHS, <6,4,1,3>
+ 2567866484U, // <u,6,4,2>: Cost 3 vext1 <2,u,6,4>, <2,u,6,4>
+ 2638458005U, // <u,6,4,3>: Cost 3 vext2 <3,4,u,6>, <4,3,6,u>
+ 1570540772U, // <u,6,4,4>: Cost 2 vext2 <4,4,6,6>, <4,4,6,6>
+ 1545473334U, // <u,6,4,5>: Cost 2 vext2 <0,2,u,6>, RHS
+ 1572015512U, // <u,6,4,6>: Cost 2 vext2 <4,6,u,6>, <4,6,u,6>
+ 2960715062U, // <u,6,4,7>: Cost 3 vzipr <1,2,u,4>, RHS
+ 1545473577U, // <u,6,4,u>: Cost 2 vext2 <0,2,u,6>, RHS
+ 2567872614U, // <u,6,5,0>: Cost 3 vext1 <2,u,6,5>, LHS
+ 2645757648U, // <u,6,5,1>: Cost 3 vext2 <4,6,u,6>, <5,1,7,3>
+ 2567874490U, // <u,6,5,2>: Cost 3 vext1 <2,u,6,5>, <2,6,3,7>
+ 2576501250U, // <u,6,5,3>: Cost 3 vext1 <4,3,6,5>, <3,4,5,6>
+ 1576660943U, // <u,6,5,4>: Cost 2 vext2 <5,4,u,6>, <5,4,u,6>
+ 2645757956U, // <u,6,5,5>: Cost 3 vext2 <4,6,u,6>, <5,5,5,5>
+ 2645758050U, // <u,6,5,6>: Cost 3 vext2 <4,6,u,6>, <5,6,7,0>
+ 2824080694U, // <u,6,5,7>: Cost 3 vuzpr <0,u,2,6>, RHS
+ 1182626795U, // <u,6,5,u>: Cost 2 vrev <6,u,u,5>
+ 1506082918U, // <u,6,6,0>: Cost 2 vext1 <4,u,6,6>, LHS
+ 2579825398U, // <u,6,6,1>: Cost 3 vext1 <4,u,6,6>, <1,0,3,2>
+ 2645758458U, // <u,6,6,2>: Cost 3 vext2 <4,6,u,6>, <6,2,7,3>
+ 2579826838U, // <u,6,6,3>: Cost 3 vext1 <4,u,6,6>, <3,0,1,2>
+ 1506086198U, // <u,6,6,4>: Cost 2 vext1 <4,u,6,6>, RHS
+ 2579828432U, // <u,6,6,5>: Cost 3 vext1 <4,u,6,6>, <5,1,7,3>
+ 296144182U, // <u,6,6,6>: Cost 1 vdup2 RHS
+ 1638331202U, // <u,6,6,7>: Cost 2 vext3 RHS, <6,6,7,7>
+ 296144182U, // <u,6,6,u>: Cost 1 vdup2 RHS
+ 432349286U, // <u,6,7,0>: Cost 1 vext1 RHS, LHS
+ 1506091766U, // <u,6,7,1>: Cost 2 vext1 RHS, <1,0,3,2>
+ 1506092648U, // <u,6,7,2>: Cost 2 vext1 RHS, <2,2,2,2>
+ 1506093206U, // <u,6,7,3>: Cost 2 vext1 RHS, <3,0,1,2>
+ 432352809U, // <u,6,7,4>: Cost 1 vext1 RHS, RHS
+ 1506094800U, // <u,6,7,5>: Cost 2 vext1 RHS, <5,1,7,3>
+ 1506095610U, // <u,6,7,6>: Cost 2 vext1 RHS, <6,2,7,3>
+ 1906904374U, // <u,6,7,7>: Cost 2 vzipr RHS, RHS
+ 432355118U, // <u,6,7,u>: Cost 1 vext1 RHS, LHS
+ 432357478U, // <u,6,u,0>: Cost 1 vext1 RHS, LHS
+ 1545475886U, // <u,6,u,1>: Cost 2 vext2 <0,2,u,6>, LHS
+ 1506100840U, // <u,6,u,2>: Cost 2 vext1 RHS, <2,2,2,2>
+ 1506101398U, // <u,6,u,3>: Cost 2 vext1 RHS, <3,0,1,2>
+ 432361002U, // <u,6,u,4>: Cost 1 vext1 RHS, RHS
+ 1545476250U, // <u,6,u,5>: Cost 2 vext2 <0,2,u,6>, RHS
+ 296144182U, // <u,6,u,6>: Cost 1 vdup2 RHS
+ 1880370486U, // <u,6,u,7>: Cost 2 vzipr LHS, RHS
+ 432363310U, // <u,6,u,u>: Cost 1 vext1 RHS, LHS
+ 1571356672U, // <u,7,0,0>: Cost 2 vext2 RHS, <0,0,0,0>
+ 497614950U, // <u,7,0,1>: Cost 1 vext2 RHS, LHS
+ 1571356836U, // <u,7,0,2>: Cost 2 vext2 RHS, <0,2,0,2>
+ 2573880146U, // <u,7,0,3>: Cost 3 vext1 <3,u,7,0>, <3,u,7,0>
+ 1571357010U, // <u,7,0,4>: Cost 2 vext2 RHS, <0,4,1,5>
+ 1512083716U, // <u,7,0,5>: Cost 2 vext1 <5,u,7,0>, <5,u,7,0>
+ 2621874741U, // <u,7,0,6>: Cost 3 vext2 <0,6,u,7>, <0,6,u,7>
+ 2585826298U, // <u,7,0,7>: Cost 3 vext1 <5,u,7,0>, <7,0,1,2>
+ 497615517U, // <u,7,0,u>: Cost 1 vext2 RHS, LHS
+ 1571357430U, // <u,7,1,0>: Cost 2 vext2 RHS, <1,0,3,2>
+ 1571357492U, // <u,7,1,1>: Cost 2 vext2 RHS, <1,1,1,1>
+ 1571357590U, // <u,7,1,2>: Cost 2 vext2 RHS, <1,2,3,0>
+ 1552114715U, // <u,7,1,3>: Cost 2 vext2 <1,3,u,7>, <1,3,u,7>
+ 2573888822U, // <u,7,1,4>: Cost 3 vext1 <3,u,7,1>, RHS
+ 1553441981U, // <u,7,1,5>: Cost 2 vext2 <1,5,u,7>, <1,5,u,7>
+ 2627847438U, // <u,7,1,6>: Cost 3 vext2 <1,6,u,7>, <1,6,u,7>
+ 2727408775U, // <u,7,1,7>: Cost 3 vext3 <7,1,7,u>, <7,1,7,u>
+ 1555432880U, // <u,7,1,u>: Cost 2 vext2 <1,u,u,7>, <1,u,u,7>
+ 2629838337U, // <u,7,2,0>: Cost 3 vext2 <2,0,u,7>, <2,0,u,7>
+ 1188058754U, // <u,7,2,1>: Cost 2 vrev <7,u,1,2>
+ 1571358312U, // <u,7,2,2>: Cost 2 vext2 RHS, <2,2,2,2>
+ 1571358374U, // <u,7,2,3>: Cost 2 vext2 RHS, <2,3,0,1>
+ 2632492869U, // <u,7,2,4>: Cost 3 vext2 <2,4,u,7>, <2,4,u,7>
+ 2633156502U, // <u,7,2,5>: Cost 3 vext2 <2,5,u,7>, <2,5,u,7>
+ 1560078311U, // <u,7,2,6>: Cost 2 vext2 <2,6,u,7>, <2,6,u,7>
+ 2728072408U, // <u,7,2,7>: Cost 3 vext3 <7,2,7,u>, <7,2,7,u>
+ 1561405577U, // <u,7,2,u>: Cost 2 vext2 <2,u,u,7>, <2,u,u,7>
+ 1571358870U, // <u,7,3,0>: Cost 2 vext2 RHS, <3,0,1,2>
+ 2627184913U, // <u,7,3,1>: Cost 3 vext2 <1,5,u,7>, <3,1,5,u>
+ 2633820523U, // <u,7,3,2>: Cost 3 vext2 <2,6,u,7>, <3,2,6,u>
+ 1571359132U, // <u,7,3,3>: Cost 2 vext2 RHS, <3,3,3,3>
+ 1571359234U, // <u,7,3,4>: Cost 2 vext2 RHS, <3,4,5,6>
+ 1512108295U, // <u,7,3,5>: Cost 2 vext1 <5,u,7,3>, <5,u,7,3>
+ 1518080992U, // <u,7,3,6>: Cost 2 vext1 <6,u,7,3>, <6,u,7,3>
+ 2640456465U, // <u,7,3,7>: Cost 3 vext2 <3,7,u,7>, <3,7,u,7>
+ 1571359518U, // <u,7,3,u>: Cost 2 vext2 RHS, <3,u,1,2>
+ 1571359634U, // <u,7,4,0>: Cost 2 vext2 RHS, <4,0,5,1>
+ 2573911067U, // <u,7,4,1>: Cost 3 vext1 <3,u,7,4>, <1,3,u,7>
+ 2645101622U, // <u,7,4,2>: Cost 3 vext2 RHS, <4,2,5,3>
+ 2573912918U, // <u,7,4,3>: Cost 3 vext1 <3,u,7,4>, <3,u,7,4>
+ 1571359952U, // <u,7,4,4>: Cost 2 vext2 RHS, <4,4,4,4>
+ 497618248U, // <u,7,4,5>: Cost 1 vext2 RHS, RHS
+ 1571360116U, // <u,7,4,6>: Cost 2 vext2 RHS, <4,6,4,6>
+ 2645102024U, // <u,7,4,7>: Cost 3 vext2 RHS, <4,7,5,0>
+ 497618473U, // <u,7,4,u>: Cost 1 vext2 RHS, RHS
+ 2645102152U, // <u,7,5,0>: Cost 3 vext2 RHS, <5,0,1,2>
+ 1571360464U, // <u,7,5,1>: Cost 2 vext2 RHS, <5,1,7,3>
+ 2645102334U, // <u,7,5,2>: Cost 3 vext2 RHS, <5,2,3,4>
+ 2645102447U, // <u,7,5,3>: Cost 3 vext2 RHS, <5,3,7,0>
+ 1571360710U, // <u,7,5,4>: Cost 2 vext2 RHS, <5,4,7,6>
+ 1571360772U, // <u,7,5,5>: Cost 2 vext2 RHS, <5,5,5,5>
+ 1571360866U, // <u,7,5,6>: Cost 2 vext2 RHS, <5,6,7,0>
+ 1571360936U, // <u,7,5,7>: Cost 2 vext2 RHS, <5,7,5,7>
+ 1571361017U, // <u,7,5,u>: Cost 2 vext2 RHS, <5,u,5,7>
+ 1530044518U, // <u,7,6,0>: Cost 2 vext1 <u,u,7,6>, LHS
+ 2645103016U, // <u,7,6,1>: Cost 3 vext2 RHS, <6,1,7,2>
+ 1571361274U, // <u,7,6,2>: Cost 2 vext2 RHS, <6,2,7,3>
+ 2645103154U, // <u,7,6,3>: Cost 3 vext2 RHS, <6,3,4,5>
+ 1530047798U, // <u,7,6,4>: Cost 2 vext1 <u,u,7,6>, RHS
+ 1188386474U, // <u,7,6,5>: Cost 2 vrev <7,u,5,6>
+ 1571361592U, // <u,7,6,6>: Cost 2 vext2 RHS, <6,6,6,6>
+ 1571361614U, // <u,7,6,7>: Cost 2 vext2 RHS, <6,7,0,1>
+ 1571361695U, // <u,7,6,u>: Cost 2 vext2 RHS, <6,u,0,1>
+ 1571361786U, // <u,7,7,0>: Cost 2 vext2 RHS, <7,0,1,2>
+ 2573935616U, // <u,7,7,1>: Cost 3 vext1 <3,u,7,7>, <1,3,5,7>
+ 2645103781U, // <u,7,7,2>: Cost 3 vext2 RHS, <7,2,2,2>
+ 2573937497U, // <u,7,7,3>: Cost 3 vext1 <3,u,7,7>, <3,u,7,7>
+ 1571362150U, // <u,7,7,4>: Cost 2 vext2 RHS, <7,4,5,6>
+ 1512141067U, // <u,7,7,5>: Cost 2 vext1 <5,u,7,7>, <5,u,7,7>
+ 1518113764U, // <u,7,7,6>: Cost 2 vext1 <6,u,7,7>, <6,u,7,7>
+ 363253046U, // <u,7,7,7>: Cost 1 vdup3 RHS
+ 363253046U, // <u,7,7,u>: Cost 1 vdup3 RHS
+ 1571362515U, // <u,7,u,0>: Cost 2 vext2 RHS, <u,0,1,2>
+ 497620782U, // <u,7,u,1>: Cost 1 vext2 RHS, LHS
+ 1571362693U, // <u,7,u,2>: Cost 2 vext2 RHS, <u,2,3,0>
+ 1571362748U, // <u,7,u,3>: Cost 2 vext2 RHS, <u,3,0,1>
+ 1571362879U, // <u,7,u,4>: Cost 2 vext2 RHS, <u,4,5,6>
+ 497621146U, // <u,7,u,5>: Cost 1 vext2 RHS, RHS
+ 1571363024U, // <u,7,u,6>: Cost 2 vext2 RHS, <u,6,3,7>
+ 363253046U, // <u,7,u,7>: Cost 1 vdup3 RHS
+ 497621349U, // <u,7,u,u>: Cost 1 vext2 RHS, LHS
+ 135053414U, // <u,u,0,0>: Cost 1 vdup0 LHS
+ 471081121U, // <u,u,0,1>: Cost 1 vext2 LHS, LHS
+ 1544822948U, // <u,u,0,2>: Cost 2 vext2 LHS, <0,2,0,2>
+ 1616140005U, // <u,u,0,3>: Cost 2 vext3 LHS, <u,0,3,2>
+ 1544823122U, // <u,u,0,4>: Cost 2 vext2 LHS, <0,4,1,5>
+ 1512157453U, // <u,u,0,5>: Cost 2 vext1 <5,u,u,0>, <5,u,u,0>
+ 1662220032U, // <u,u,0,6>: Cost 2 vext3 RHS, <u,0,6,2>
+ 1194457487U, // <u,u,0,7>: Cost 2 vrev <u,u,7,0>
+ 471081629U, // <u,u,0,u>: Cost 1 vext2 LHS, LHS
+ 1544823542U, // <u,u,1,0>: Cost 2 vext2 LHS, <1,0,3,2>
+ 202162278U, // <u,u,1,1>: Cost 1 vdup1 LHS
+ 537753390U, // <u,u,1,2>: Cost 1 vext3 LHS, LHS
+ 1544823768U, // <u,u,1,3>: Cost 2 vext2 LHS, <1,3,1,3>
+ 1494248758U, // <u,u,1,4>: Cost 2 vext1 <2,u,u,1>, RHS
+ 1544823952U, // <u,u,1,5>: Cost 2 vext2 LHS, <1,5,3,7>
+ 1518138343U, // <u,u,1,6>: Cost 2 vext1 <6,u,u,1>, <6,u,u,1>
+ 1640322907U, // <u,u,1,7>: Cost 2 vext3 RHS, <u,1,7,3>
+ 537753444U, // <u,u,1,u>: Cost 1 vext3 LHS, LHS
+ 1482309734U, // <u,u,2,0>: Cost 2 vext1 <0,u,u,2>, LHS
+ 1194031451U, // <u,u,2,1>: Cost 2 vrev <u,u,1,2>
+ 269271142U, // <u,u,2,2>: Cost 1 vdup2 LHS
+ 835584U, // <u,u,2,3>: Cost 0 copy LHS
+ 1482313014U, // <u,u,2,4>: Cost 2 vext1 <0,u,u,2>, RHS
+ 2618566504U, // <u,u,2,5>: Cost 3 vext2 LHS, <2,5,3,6>
+ 1544824762U, // <u,u,2,6>: Cost 2 vext2 LHS, <2,6,3,7>
+ 1638479788U, // <u,u,2,7>: Cost 2 vext3 RHS, <u,2,7,3>
+ 835584U, // <u,u,2,u>: Cost 0 copy LHS
+ 408576723U, // <u,u,3,0>: Cost 1 vext1 LHS, LHS
+ 1482318582U, // <u,u,3,1>: Cost 2 vext1 LHS, <1,0,3,2>
+ 120371557U, // <u,u,3,2>: Cost 1 vrev LHS
+ 336380006U, // <u,u,3,3>: Cost 1 vdup3 LHS
+ 408579382U, // <u,u,3,4>: Cost 1 vext1 LHS, RHS
+ 1616140271U, // <u,u,3,5>: Cost 2 vext3 LHS, <u,3,5,7>
+ 1530098170U, // <u,u,3,6>: Cost 2 vext1 LHS, <6,2,7,3>
+ 1880329544U, // <u,u,3,7>: Cost 2 vzipr LHS, RHS
+ 408581934U, // <u,u,3,u>: Cost 1 vext1 LHS, LHS
+ 1488298086U, // <u,u,4,0>: Cost 2 vext1 <1,u,u,4>, LHS
+ 1488299437U, // <u,u,4,1>: Cost 2 vext1 <1,u,u,4>, <1,u,u,4>
+ 1659271204U, // <u,u,4,2>: Cost 2 vext3 LHS, <u,4,2,6>
+ 1194195311U, // <u,u,4,3>: Cost 2 vrev <u,u,3,4>
+ 161926454U, // <u,u,4,4>: Cost 1 vdup0 RHS
+ 471084342U, // <u,u,4,5>: Cost 1 vext2 LHS, RHS
+ 1571368308U, // <u,u,4,6>: Cost 2 vext2 RHS, <4,6,4,6>
+ 1640323153U, // <u,u,4,7>: Cost 2 vext3 RHS, <u,4,7,6>
+ 471084585U, // <u,u,4,u>: Cost 1 vext2 LHS, RHS
+ 1494278246U, // <u,u,5,0>: Cost 2 vext1 <2,u,u,5>, LHS
+ 1571368656U, // <u,u,5,1>: Cost 2 vext2 RHS, <5,1,7,3>
+ 1494280327U, // <u,u,5,2>: Cost 2 vext1 <2,u,u,5>, <2,u,u,5>
+ 1616140415U, // <u,u,5,3>: Cost 2 vext3 LHS, <u,5,3,7>
+ 1494281526U, // <u,u,5,4>: Cost 2 vext1 <2,u,u,5>, RHS
+ 229035318U, // <u,u,5,5>: Cost 1 vdup1 RHS
+ 537753754U, // <u,u,5,6>: Cost 1 vext3 LHS, RHS
+ 1750355254U, // <u,u,5,7>: Cost 2 vuzpr LHS, RHS
+ 537753772U, // <u,u,5,u>: Cost 1 vext3 LHS, RHS
+ 1482342502U, // <u,u,6,0>: Cost 2 vext1 <0,u,u,6>, LHS
+ 2556084982U, // <u,u,6,1>: Cost 3 vext1 <0,u,u,6>, <1,0,3,2>
+ 1571369466U, // <u,u,6,2>: Cost 2 vext2 RHS, <6,2,7,3>
+ 1611938000U, // <u,u,6,3>: Cost 2 vext3 LHS, <u,6,3,7>
+ 1482345782U, // <u,u,6,4>: Cost 2 vext1 <0,u,u,6>, RHS
+ 1194359171U, // <u,u,6,5>: Cost 2 vrev <u,u,5,6>
+ 296144182U, // <u,u,6,6>: Cost 1 vdup2 RHS
+ 27705344U, // <u,u,6,7>: Cost 0 copy RHS
+ 27705344U, // <u,u,6,u>: Cost 0 copy RHS
+ 432496742U, // <u,u,7,0>: Cost 1 vext1 RHS, LHS
+ 1488324016U, // <u,u,7,1>: Cost 2 vext1 <1,u,u,7>, <1,u,u,7>
+ 1494296713U, // <u,u,7,2>: Cost 2 vext1 <2,u,u,7>, <2,u,u,7>
+ 1906901148U, // <u,u,7,3>: Cost 2 vzipr RHS, LHS
+ 432500283U, // <u,u,7,4>: Cost 1 vext1 RHS, RHS
+ 1506242256U, // <u,u,7,5>: Cost 2 vext1 RHS, <5,1,7,3>
+ 120699277U, // <u,u,7,6>: Cost 1 vrev RHS
+ 363253046U, // <u,u,7,7>: Cost 1 vdup3 RHS
+ 432502574U, // <u,u,7,u>: Cost 1 vext1 RHS, LHS
+ 408617688U, // <u,u,u,0>: Cost 1 vext1 LHS, LHS
+ 471086894U, // <u,u,u,1>: Cost 1 vext2 LHS, LHS
+ 537753957U, // <u,u,u,2>: Cost 1 vext3 LHS, LHS
+ 835584U, // <u,u,u,3>: Cost 0 copy LHS
+ 408620342U, // <u,u,u,4>: Cost 1 vext1 LHS, RHS
+ 471087258U, // <u,u,u,5>: Cost 1 vext2 LHS, RHS
+ 537753997U, // <u,u,u,6>: Cost 1 vext3 LHS, RHS
+ 27705344U, // <u,u,u,7>: Cost 0 copy RHS
+ 835584U, // <u,u,u,u>: Cost 0 copy LHS
0
};
diff --git a/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td b/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td
index 54bf82a..99418733 100644
--- a/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td
+++ b/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td
@@ -30,18 +30,6 @@ def ssub_0 : SubRegIndex;
def ssub_1 : SubRegIndex;
def ssub_2 : SubRegIndex; // In a Q reg.
def ssub_3 : SubRegIndex;
-def ssub_4 : SubRegIndex; // In a QQ reg.
-def ssub_5 : SubRegIndex;
-def ssub_6 : SubRegIndex;
-def ssub_7 : SubRegIndex;
-def ssub_8 : SubRegIndex; // In a QQQQ reg.
-def ssub_9 : SubRegIndex;
-def ssub_10 : SubRegIndex;
-def ssub_11 : SubRegIndex;
-def ssub_12 : SubRegIndex;
-def ssub_13 : SubRegIndex;
-def ssub_14 : SubRegIndex;
-def ssub_15 : SubRegIndex;
def dsub_0 : SubRegIndex;
def dsub_1 : SubRegIndex;
@@ -169,43 +157,28 @@ def Q15 : ARMReg<15, "q15", [D30, D31]>;
// starting D register number doesn't have to be multiple of 4, e.g.,
// D1, D2, D3, D4 would be a legal quad, but that would make the subregister
// stuff very messy.
-let SubRegIndices = [qsub_0, qsub_1] in {
-let CompositeIndices = [(dsub_2 qsub_1, dsub_0), (dsub_3 qsub_1, dsub_1),
- (ssub_4 qsub_1, ssub_0), (ssub_5 qsub_1, ssub_1),
- (ssub_6 qsub_1, ssub_2), (ssub_7 qsub_1, ssub_3)] in {
+let SubRegIndices = [qsub_0, qsub_1],
+ CompositeIndices = [(dsub_2 qsub_1, dsub_0), (dsub_3 qsub_1, dsub_1)] in {
def QQ0 : ARMReg<0, "qq0", [Q0, Q1]>;
def QQ1 : ARMReg<1, "qq1", [Q2, Q3]>;
def QQ2 : ARMReg<2, "qq2", [Q4, Q5]>;
def QQ3 : ARMReg<3, "qq3", [Q6, Q7]>;
-}
-let CompositeIndices = [(dsub_2 qsub_1, dsub_0), (dsub_3 qsub_1, dsub_1)] in {
def QQ4 : ARMReg<4, "qq4", [Q8, Q9]>;
def QQ5 : ARMReg<5, "qq5", [Q10, Q11]>;
def QQ6 : ARMReg<6, "qq6", [Q12, Q13]>;
def QQ7 : ARMReg<7, "qq7", [Q14, Q15]>;
}
-}
// Pseudo 512-bit registers to represent four consecutive Q registers.
-let SubRegIndices = [qqsub_0, qqsub_1] in {
-let CompositeIndices = [(qsub_2 qqsub_1, qsub_0), (qsub_3 qqsub_1, qsub_1),
- (dsub_4 qqsub_1, dsub_0), (dsub_5 qqsub_1, dsub_1),
- (dsub_6 qqsub_1, dsub_2), (dsub_7 qqsub_1, dsub_3),
- (ssub_8 qqsub_1, ssub_0), (ssub_9 qqsub_1, ssub_1),
- (ssub_10 qqsub_1, ssub_2), (ssub_11 qqsub_1, ssub_3),
- (ssub_12 qqsub_1, ssub_4), (ssub_13 qqsub_1, ssub_5),
- (ssub_14 qqsub_1, ssub_6), (ssub_15 qqsub_1, ssub_7)] in
-{
+let SubRegIndices = [qqsub_0, qqsub_1],
+ CompositeIndices = [(qsub_2 qqsub_1, qsub_0), (qsub_3 qqsub_1, qsub_1),
+ (dsub_4 qqsub_1, dsub_0), (dsub_5 qqsub_1, dsub_1),
+ (dsub_6 qqsub_1, dsub_2), (dsub_7 qqsub_1, dsub_3)] in {
def QQQQ0 : ARMReg<0, "qqqq0", [QQ0, QQ1]>;
def QQQQ1 : ARMReg<1, "qqqq1", [QQ2, QQ3]>;
-}
-let CompositeIndices = [(qsub_2 qqsub_1, qsub_0), (qsub_3 qqsub_1, qsub_1),
- (dsub_4 qqsub_1, dsub_0), (dsub_5 qqsub_1, dsub_1),
- (dsub_6 qqsub_1, dsub_2), (dsub_7 qqsub_1, dsub_3)] in {
def QQQQ2 : ARMReg<2, "qqqq2", [QQ4, QQ5]>;
def QQQQ3 : ARMReg<3, "qqqq3", [QQ6, QQ7]>;
}
-}
// Current Program Status Register.
def CPSR : ARMReg<0, "cpsr">;
@@ -567,4 +540,6 @@ def QQQQPR : RegisterClass<"ARM", [v8i64],
}
// Condition code registers.
-def CCR : RegisterClass<"ARM", [i32], 32, [CPSR]>;
+def CCR : RegisterClass<"ARM", [i32], 32, [CPSR]> {
+ let isAllocatable = 0;
+}
diff --git a/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp b/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp
index aa1e398..ef0aaf2 100644
--- a/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp
+++ b/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp
@@ -13,6 +13,8 @@
#define DEBUG_TYPE "arm-selectiondag-info"
#include "ARMTargetMachine.h"
+#include "llvm/DerivedTypes.h"
+#include "llvm/CodeGen/SelectionDAG.h"
using namespace llvm;
ARMSelectionDAGInfo::ARMSelectionDAGInfo(const TargetMachine &TM)
@@ -132,3 +134,65 @@ ARMSelectionDAGInfo::EmitTargetCodeForMemcpy(SelectionDAG &DAG, DebugLoc dl,
}
return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, &TFOps[0], i);
}
+
+// Adjust parameters for memset, EABI uses format (ptr, size, value),
+// GNU library uses (ptr, value, size)
+// See RTABI section 4.3.4
+SDValue
+ARMSelectionDAGInfo::EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl,
+ SDValue Chain, SDValue Dst,
+ SDValue Src, SDValue Size,
+ unsigned Align, bool isVolatile,
+ MachinePointerInfo DstPtrInfo) const
+{
+ // Use default for non AAPCS subtargets
+ if (!Subtarget->isAAPCS_ABI())
+ return SDValue();
+
+ const ARMTargetLowering &TLI =
+ *static_cast<const ARMTargetLowering*>(DAG.getTarget().getTargetLowering());
+ TargetLowering::ArgListTy Args;
+ TargetLowering::ArgListEntry Entry;
+
+ // First argument: data pointer
+ const Type *IntPtrTy = TLI.getTargetData()->getIntPtrType(*DAG.getContext());
+ Entry.Node = Dst;
+ Entry.Ty = IntPtrTy;
+ Args.push_back(Entry);
+
+ // Second argument: buffer size
+ Entry.Node = Size;
+ Entry.Ty = IntPtrTy;
+ Entry.isSExt = false;
+ Args.push_back(Entry);
+
+ // Extend or truncate the argument to be an i32 value for the call.
+ if (Src.getValueType().bitsGT(MVT::i32))
+ Src = DAG.getNode(ISD::TRUNCATE, dl, MVT::i32, Src);
+ else
+ Src = DAG.getNode(ISD::ZERO_EXTEND, dl, MVT::i32, Src);
+
+ // Third argument: value to fill
+ Entry.Node = Src;
+ Entry.Ty = Type::getInt32Ty(*DAG.getContext());
+ Entry.isSExt = true;
+ Args.push_back(Entry);
+
+ // Emit __eabi_memset call
+ std::pair<SDValue,SDValue> CallResult =
+ TLI.LowerCallTo(Chain,
+ Type::getVoidTy(*DAG.getContext()), // return type
+ false, // return sign ext
+ false, // return zero ext
+ false, // is var arg
+ false, // is in regs
+ 0, // number of fixed arguments
+ TLI.getLibcallCallingConv(RTLIB::MEMSET), // call conv
+ false, // is tail call
+ false, // is return val used
+ DAG.getExternalSymbol(TLI.getLibcallName(RTLIB::MEMSET),
+ TLI.getPointerTy()), // callee
+ Args, DAG, dl); // arg list, DAG and debug
+
+ return CallResult.second;
+}
diff --git a/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h b/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h
index 7533690..ec1bf5c 100644
--- a/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h
+++ b/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h
@@ -35,6 +35,15 @@ public:
bool isVolatile, bool AlwaysInline,
MachinePointerInfo DstPtrInfo,
MachinePointerInfo SrcPtrInfo) const;
+
+ // Adjust parameters for memset, see RTABI section 4.3.4
+ virtual
+ SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl,
+ SDValue Chain,
+ SDValue Op1, SDValue Op2,
+ SDValue Op3, unsigned Align,
+ bool isVolatile,
+ MachinePointerInfo DstPtrInfo) const;
};
}
diff --git a/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 29ecc18..4bc12c9 100644
--- a/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -15,6 +15,7 @@
#include "llvm/MC/MCParser/MCAsmLexer.h"
#include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
+#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCExpr.h"
@@ -1240,6 +1241,8 @@ tryParseMSRMaskOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
FlagsVal = 0; // No flag
}
} else if (SpecReg == "cpsr" || SpecReg == "spsr") {
+ if (Flags == "all") // cpsr_all is an alias for cpsr_fc
+ Flags = "fc";
for (int i = 0, e = Flags.size(); i != e; ++i) {
unsigned Flag = StringSwitch<unsigned>(Flags.substr(i, 1))
.Case("c", 1)
@@ -1827,10 +1830,11 @@ GetMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
Mnemonic == "rrx" || Mnemonic == "ror" || Mnemonic == "sub" ||
Mnemonic == "smull" || Mnemonic == "add" || Mnemonic == "adc" ||
Mnemonic == "mul" || Mnemonic == "bic" || Mnemonic == "asr" ||
- Mnemonic == "umlal" || Mnemonic == "orr" || Mnemonic == "mov" ||
+ Mnemonic == "umlal" || Mnemonic == "orr" || Mnemonic == "mvn" ||
Mnemonic == "rsb" || Mnemonic == "rsc" || Mnemonic == "orn" ||
Mnemonic == "sbc" || Mnemonic == "mla" || Mnemonic == "umull" ||
- Mnemonic == "eor" || Mnemonic == "smlal" || Mnemonic == "mvn") {
+ Mnemonic == "eor" || Mnemonic == "smlal" ||
+ (Mnemonic == "mov" && !isThumb)) {
CanAcceptCarrySet = true;
} else {
CanAcceptCarrySet = false;
@@ -1849,7 +1853,8 @@ GetMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
if (isThumb)
if (Mnemonic == "bkpt" || Mnemonic == "mcr" || Mnemonic == "mcrr" ||
- Mnemonic == "mrc" || Mnemonic == "mrrc" || Mnemonic == "cdp")
+ Mnemonic == "mrc" || Mnemonic == "mrrc" || Mnemonic == "cdp" ||
+ Mnemonic == "mov")
CanAcceptPredicationCode = false;
}
@@ -2099,15 +2104,29 @@ bool ARMAsmParser::ParseDirectiveThumb(SMLoc L) {
/// ParseDirectiveThumbFunc
/// ::= .thumbfunc symbol_name
bool ARMAsmParser::ParseDirectiveThumbFunc(SMLoc L) {
- const AsmToken &Tok = Parser.getTok();
- if (Tok.isNot(AsmToken::Identifier) && Tok.isNot(AsmToken::String))
- return Error(L, "unexpected token in .thumb_func directive");
- StringRef Name = Tok.getString();
- Parser.Lex(); // Consume the identifier token.
+ const MCAsmInfo &MAI = getParser().getStreamer().getContext().getAsmInfo();
+ bool isMachO = MAI.hasSubsectionsViaSymbols();
+ StringRef Name;
+
+ // Darwin asm has function name after .thumb_func direction
+ // ELF doesn't
+ if (isMachO) {
+ const AsmToken &Tok = Parser.getTok();
+ if (Tok.isNot(AsmToken::Identifier) && Tok.isNot(AsmToken::String))
+ return Error(L, "unexpected token in .thumb_func directive");
+ Name = Tok.getString();
+ Parser.Lex(); // Consume the identifier token.
+ }
+
if (getLexer().isNot(AsmToken::EndOfStatement))
return Error(L, "unexpected token in directive");
Parser.Lex();
+ // FIXME: assuming function name will be the line following .thumb_func
+ if (!isMachO) {
+ Name = Parser.getTok().getString();
+ }
+
// Mark symbol as a thumb symbol.
MCSymbol *Func = getParser().getContext().GetOrCreateSymbol(Name);
getParser().getStreamer().EmitThumbFunc(Func);
diff --git a/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp b/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
index 642829c..271ca8c 100644
--- a/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
+++ b/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp
@@ -895,8 +895,9 @@ static bool DisassembleBrFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
}
// Misc. Branch Instructions.
-// BLX, BLXi, BX
-// BX, BX_RET
+// BX_RET, MOVPCLR
+// BLX, BLX_pred, BX, BX_pred
+// BLXi
static bool DisassembleBrMiscFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
unsigned short NumOps, unsigned &NumOpsAdded, BO B) {
@@ -913,7 +914,7 @@ static bool DisassembleBrMiscFrm(MCInst &MI, unsigned Opcode, uint32_t insn,
// BLX and BX take one GPR reg.
if (Opcode == ARM::BLX || Opcode == ARM::BLX_pred ||
- Opcode == ARM::BX) {
+ Opcode == ARM::BX || Opcode == ARM::BX_pred) {
assert(NumOps >= 1 && OpInfo[OpIdx].RegClass == ARM::GPRRegClassID &&
"Reg operand expected");
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
diff --git a/contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h b/contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
index 8d39982..9639c8a 100644
--- a/contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
+++ b/contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h
@@ -476,6 +476,7 @@ static bool DisassembleThumb1DP(MCInst &MI, unsigned Opcode, uint32_t insn,
// tADDhirr: Rd Rd(TIED_TO) Rm
// tCMPhir: Rd Rm
// tMOVr, tMOVgpr2gpr, tMOVgpr2tgpr, tMOVtgpr2gpr: Rd|tRd Rm|tRn
+// tBX: Rm
// tBX_RET: 0 operand
// tBX_RET_vararg: Rm
// tBLXr_r9: Rm
@@ -488,16 +489,25 @@ static bool DisassembleThumb1Special(MCInst &MI, unsigned Opcode, uint32_t insn,
return true;
// BX/BLX/tBRIND (indirect branch, i.e, mov pc, Rm) has 1 reg operand: Rm.
- if (Opcode==ARM::tBLXr_r9 || Opcode==ARM::tBX_Rm || Opcode==ARM::tBRIND) {
- if (Opcode != ARM::tBRIND) {
+ if (Opcode==ARM::tBLXr_r9 || Opcode==ARM::tBX || Opcode==ARM::tBRIND) {
+ if (Opcode == ARM::tBLXr_r9) {
// Handling the two predicate operands before the reg operand.
if (!B->DoPredicateOperands(MI, Opcode, insn, NumOps))
return false;
NumOpsAdded += 2;
}
+
MI.addOperand(MCOperand::CreateReg(getRegisterEnum(B, ARM::GPRRegClassID,
getT1Rm(insn))));
NumOpsAdded += 1;
+
+ if (Opcode == ARM::tBX) {
+ // Handling the two predicate operands after the reg operand.
+ if (!B->DoPredicateOperands(MI, Opcode, insn, NumOps))
+ return false;
+ NumOpsAdded += 2;
+ }
+
return true;
}
@@ -957,7 +967,7 @@ static bool DisassembleThumb1CondBr(MCInst &MI, unsigned Opcode, uint32_t insn,
unsigned Imm8 = getT1Imm8(insn);
MI.addOperand(MCOperand::CreateImm(
- Opcode == ARM::tBcc ? SignExtend32<9>(Imm8 << 1) + 4
+ Opcode == ARM::tBcc ? SignExtend32<9>(Imm8 << 1)
: (int)Imm8));
// Predicate operands by ARMBasicMCBuilder::TryPredicateAndSBitModifier().
diff --git a/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
index fc2aa75..8ae87f8 100644
--- a/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
+++ b/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
@@ -29,8 +29,8 @@ StringRef ARMInstPrinter::getOpcodeName(unsigned Opcode) const {
return getInstructionName(Opcode);
}
-StringRef ARMInstPrinter::getRegName(unsigned RegNo) const {
- return getRegisterName(RegNo);
+void ARMInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
+ OS << getRegisterName(RegNo);
}
void ARMInstPrinter::printInst(const MCInst *MI, raw_ostream &O) {
diff --git a/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h b/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h
index b3ac03a..bde0eb9 100644
--- a/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h
+++ b/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h
@@ -28,7 +28,7 @@ public:
virtual void printInst(const MCInst *MI, raw_ostream &O);
virtual StringRef getOpcodeName(unsigned Opcode) const;
- virtual StringRef getRegName(unsigned RegNo) const;
+ virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
static const char *getInstructionName(unsigned Opcode);
diff --git a/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp b/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp
index 33cefb6..6bf5650 100644
--- a/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp
@@ -49,7 +49,7 @@ Thumb1RegisterInfo::Thumb1RegisterInfo(const ARMBaseInstrInfo &tii,
const TargetRegisterClass*
Thumb1RegisterInfo::getLargestLegalSuperClass(const TargetRegisterClass *RC)
const {
- if (RC == ARM::tGPRRegisterClass || RC->hasSuperClass(ARM::tGPRRegisterClass))
+ if (ARM::tGPRRegClass.hasSubClassEq(RC))
return ARM::tGPRRegisterClass;
return ARMBaseRegisterInfo::getLargestLegalSuperClass(RC);
}
diff --git a/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.cpp b/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.cpp
index ee404f0..0875cfd 100644
--- a/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.cpp
+++ b/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.cpp
@@ -155,6 +155,8 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM)
setJumpBufSize(272);
setJumpBufAlignment(16);
+ setMinFunctionAlignment(4);
+
computeRegisterProperties();
}
@@ -180,11 +182,6 @@ const char *AlphaTargetLowering::getTargetNodeName(unsigned Opcode) const {
}
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned AlphaTargetLowering::getFunctionAlignment(const Function *F) const {
- return 4;
-}
-
static SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) {
EVT PtrVT = Op.getValueType();
JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
@@ -233,8 +230,8 @@ AlphaTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeCallOperands(Outs, CC_Alpha);
@@ -347,8 +344,8 @@ AlphaTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), RVLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_Alpha);
diff --git a/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h b/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h
index cb98f92..d38c314 100644
--- a/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h
+++ b/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h
@@ -104,9 +104,6 @@ namespace llvm {
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
/// isFPImmLegal - Returns true if the target can instruction select the
/// specified FP immediate natively. If false, the legalizer will
/// materialize the FP immediate as a load from a constant pool.
diff --git a/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp b/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp
index 7667fd8..d6c3809 100644
--- a/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp
@@ -69,6 +69,7 @@ const unsigned* AlphaRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
BitVector AlphaRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
BitVector Reserved(getNumRegs());
Reserved.set(Alpha::R15);
+ Reserved.set(Alpha::R29);
Reserved.set(Alpha::R30);
Reserved.set(Alpha::R31);
return Reserved;
@@ -198,6 +199,11 @@ int AlphaRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
return -1;
}
+int AlphaRegisterInfo::getLLVMRegNum(unsigned DwarfRegNum, bool isEH) const {
+ llvm_unreachable("What is the dwarf register number");
+ return -1;
+}
+
#include "AlphaGenRegisterInfo.inc"
std::string AlphaRegisterInfo::getPrettyName(unsigned reg)
diff --git a/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h b/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h
index b0d4dd0..ffe6cf1 100644
--- a/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h
+++ b/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h
@@ -48,6 +48,7 @@ struct AlphaRegisterInfo : public AlphaGenRegisterInfo {
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
static std::string getPrettyName(unsigned reg);
};
diff --git a/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.td b/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.td
index 35e6804..d644f05 100644
--- a/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.td
+++ b/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.td
@@ -121,51 +121,18 @@ def GPRC : RegisterClass<"Alpha", [i64], 64,
// Non-volatile
R9, R10, R11, R12, R13, R14,
// Don't allocate 15, 30, 31
- R15, R30, R31 ]> //zero
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GPRCClass::iterator
- GPRCClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3;
- }
- }];
-}
+ R15, R30, R31 ]>; //zero
def F4RC : RegisterClass<"Alpha", [f32], 64, [F0, F1,
F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30,
// Saved:
F2, F3, F4, F5, F6, F7, F8, F9,
- F31 ]> //zero
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- F4RCClass::iterator
- F4RCClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-1;
- }
- }];
-}
+ F31 ]>; //zero
def F8RC : RegisterClass<"Alpha", [f64], 64, [F0, F1,
F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30,
// Saved:
F2, F3, F4, F5, F6, F7, F8, F9,
- F31 ]> //zero
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- F8RCClass::iterator
- F8RCClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-1;
- }
- }];
-}
+ F31 ]>; //zero
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.cpp b/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.cpp
index 08bb952..0b0984d 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.cpp
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.cpp
@@ -31,6 +31,12 @@ bool BlackfinFrameLowering::hasFP(const MachineFunction &MF) const {
MFI->adjustsStack() || MFI->hasVarSizedObjects();
}
+// Always reserve a call frame. We dont have enough registers to adjust SP.
+bool BlackfinFrameLowering::
+hasReservedCallFrame(const MachineFunction &MF) const {
+ return true;
+}
+
// Emit a prologue that sets up a stack frame.
// On function entry, R0-R2 and P0 may hold arguments.
// R3, P1, and P2 may be used as scratch registers
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.h b/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.h
index 3d2ee25..726fa2c 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.h
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.h
@@ -36,6 +36,7 @@ public:
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
bool hasFP(const MachineFunction &MF) const;
+ bool hasReservedCallFrame(const MachineFunction &MF) const;
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
RegScavenger *RS) const;
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinISelDAGToDAG.cpp b/contrib/llvm/lib/Target/Blackfin/BlackfinISelDAGToDAG.cpp
index 9df2aee..42659ae 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinISelDAGToDAG.cpp
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinISelDAGToDAG.cpp
@@ -117,11 +117,11 @@ bool BlackfinDAGToDAGISel::SelectADDRspii(SDValue Addr,
}
static inline bool isCC(const TargetRegisterClass *RC) {
- return RC == &BF::AnyCCRegClass || BF::AnyCCRegClass.hasSubClass(RC);
+ return BF::AnyCCRegClass.hasSubClassEq(RC);
}
static inline bool isDCC(const TargetRegisterClass *RC) {
- return RC == &BF::DRegClass || BF::DRegClass.hasSubClass(RC) || isCC(RC);
+ return BF::DRegClass.hasSubClassEq(RC) || isCC(RC);
}
static void UpdateNodeOperand(SelectionDAG &DAG,
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp b/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp
index 1e1f8c9..588d9bd 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp
@@ -121,6 +121,8 @@ BlackfinTargetLowering::BlackfinTargetLowering(TargetMachine &TM)
setOperationAction(ISD::VAEND, MVT::Other, Expand);
setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
+
+ setMinFunctionAlignment(2);
}
const char *BlackfinTargetLowering::getTargetNodeName(unsigned Opcode) const {
@@ -169,8 +171,8 @@ BlackfinTargetLowering::LowerFormalArguments(SDValue Chain,
MachineFrameInfo *MFI = MF.getFrameInfo();
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AllocateStack(12, 4); // ABI requires 12 bytes stack space
CCInfo.AnalyzeFormalArguments(Ins, CC_Blackfin);
@@ -227,8 +229,8 @@ BlackfinTargetLowering::LowerReturn(SDValue Chain,
SmallVector<CCValAssign, 16> RVLocs;
// CCState - Info about the registers and stack slot.
- CCState CCInfo(CallConv, isVarArg, DAG.getTarget(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ DAG.getTarget(), RVLocs, *DAG.getContext());
// Analize return values.
CCInfo.AnalyzeReturn(Outs, RetCC_Blackfin);
@@ -288,8 +290,8 @@ BlackfinTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, DAG.getTarget(), ArgLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ DAG.getTarget(), ArgLocs, *DAG.getContext());
CCInfo.AllocateStack(12, 4); // ABI requires 12 bytes stack space
CCInfo.AnalyzeCallOperands(Outs, CC_Blackfin);
@@ -376,8 +378,8 @@ BlackfinTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState RVInfo(CallConv, isVarArg, DAG.getTarget(), RVLocs,
- *DAG.getContext());
+ CCState RVInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ DAG.getTarget(), RVLocs, *DAG.getContext());
RVInfo.AnalyzeCallResult(Ins, RetCC_Blackfin);
@@ -497,11 +499,6 @@ BlackfinTargetLowering::ReplaceNodeResults(SDNode *N,
}
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned BlackfinTargetLowering::getFunctionAlignment(const Function *F) const {
- return 2;
-}
-
//===----------------------------------------------------------------------===//
// Blackfin Inline Assembly Support
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h b/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h
index 102c830..9a54557 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h
@@ -53,7 +53,6 @@ namespace llvm {
EVT VT) const;
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
const char *getTargetNodeName(unsigned Opcode) const;
- unsigned getFunctionAlignment(const Function *F) const;
private:
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp b/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp
index e50d57a..598cf2a 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp
@@ -160,7 +160,7 @@ static bool inClass(const TargetRegisterClass &Test,
if (TargetRegisterInfo::isPhysicalRegister(Reg))
return Test.contains(Reg);
else
- return &Test==RC || Test.hasSubClass(RC);
+ return Test.hasSubClassEq(RC);
}
void
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp b/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp
index b4a9b84..6ca460e 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp
@@ -351,5 +351,11 @@ int BlackfinRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
return -1;
}
+int BlackfinRegisterInfo::getLLVMRegNum(unsigned DwarfRegNum,
+ bool isEH) const {
+ llvm_unreachable("What is the dwarf register number");
+ return -1;
+}
+
#include "BlackfinGenRegisterInfo.inc"
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h b/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h
index 642b8ad..375d277 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h
@@ -41,8 +41,6 @@ namespace llvm {
return &BF::PRegClass;
}
- // bool hasReservedCallFrame(MachineFunction &MF) const;
-
bool requiresRegisterScavenging(const MachineFunction &MF) const;
void eliminateCallFramePseudoInstr(MachineFunction &MF,
@@ -60,6 +58,7 @@ namespace llvm {
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
// Utility functions
void adjustRegister(MachineBasicBlock &MBB,
diff --git a/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.td b/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.td
index f5dd439..d8fd302 100644
--- a/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.td
+++ b/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.td
@@ -245,18 +245,6 @@ def D : RegisterClass<"BF", [i32], 32, [R0, R1, R2, R3, R4, R5, R6, R7]> {
def P : RegisterClass<"BF", [i32], 32, [P0, P1, P2, P3, P4, P5, FP, SP]> {
let SubRegClasses = [(P16L lo16), (P16H hi16)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- PClass::iterator
- PClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- return allocation_order_begin(MF)
- + (TFI->hasFP(MF) ? 7 : 6);
- }
- }];
}
def I : RegisterClass<"BF", [i32], 32, [I0, I1, I2, I3]>;
@@ -268,18 +256,6 @@ def DP : RegisterClass<"BF", [i32], 32,
[R0, R1, R2, R3, R4, R5, R6, R7,
P0, P1, P2, P3, P4, P5, FP, SP]> {
let SubRegClasses = [(DP16L lo16), (DP16H hi16)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- DPClass::iterator
- DPClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- return allocation_order_begin(MF)
- + (TFI->hasFP(MF) ? 15 : 14);
- }
- }];
}
def GR : RegisterClass<"BF", [i32], 32,
@@ -287,20 +263,7 @@ def GR : RegisterClass<"BF", [i32], 32,
P0, P1, P2, P3, P4, P5,
I0, I1, I2, I3, M0, M1, M2, M3,
B0, B1, B2, B3, L0, L1, L2, L3,
- FP, SP]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GRClass::iterator
- GRClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- return allocation_order_begin(MF)
- + (TFI->hasFP(MF) ? 31 : 30);
- }
- }];
-}
+ FP, SP]>;
def ALL : RegisterClass<"BF", [i32], 32,
[R0, R1, R2, R3, R4, R5, R6, R7,
@@ -310,36 +273,10 @@ def ALL : RegisterClass<"BF", [i32], 32,
FP, SP,
A0X, A0W, A1X, A1W, ASTAT, RETS,
LC0, LT0, LB0, LC1, LT1, LB1, CYCLES, CYCLES2,
- USP, SEQSTAT, SYSCFG, RETI, RETX, RETN, RETE, EMUDAT]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- ALLClass::iterator
- ALLClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- return allocation_order_begin(MF)
- + (TFI->hasFP(MF) ? 31 : 30);
- }
- }];
-}
+ USP, SEQSTAT, SYSCFG, RETI, RETX, RETN, RETE, EMUDAT]>;
def PI : RegisterClass<"BF", [i32], 32,
- [P0, P1, P2, P3, P4, P5, I0, I1, I2, I3, FP, SP]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- PIClass::iterator
- PIClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- return allocation_order_begin(MF)
- + (TFI->hasFP(MF) ? 11 : 10);
- }
- }];
-}
+ [P0, P1, P2, P3, P4, P5, I0, I1, I2, I3, FP, SP]>;
// We are going to pretend that CC and !CC are 32-bit registers, even though
// they only can hold 1 bit.
diff --git a/contrib/llvm/lib/Target/CBackend/CBackend.cpp b/contrib/llvm/lib/Target/CBackend/CBackend.cpp
index 358d1b3..fde2e29 100644
--- a/contrib/llvm/lib/Target/CBackend/CBackend.cpp
+++ b/contrib/llvm/lib/Target/CBackend/CBackend.cpp
@@ -373,7 +373,7 @@ static std::string CBEMangle(const std::string &S) {
///
bool CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(Module &M) {
// Get a set of types that are used by the program...
- std::set<const Type *> UT = getAnalysis<FindUsedTypes>().getTypes();
+ SetVector<const Type *> UT = getAnalysis<FindUsedTypes>().getTypes();
// Loop over the module symbol table, removing types from UT that are
// already named, and removing names for types that are not used.
@@ -390,11 +390,10 @@ bool CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(Module &M) {
TST.remove(I);
} else {
// If this is not used, remove it from the symbol table.
- std::set<const Type *>::iterator UTI = UT.find(I->second);
- if (UTI == UT.end())
+ if (!UT.count(I->second))
TST.remove(I);
else
- UT.erase(UTI); // Only keep one name for this type.
+ UT.remove(I->second); // Only keep one name for this type.
}
}
@@ -403,7 +402,7 @@ bool CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(Module &M) {
//
bool Changed = false;
unsigned RenameCounter = 0;
- for (std::set<const Type *>::const_iterator I = UT.begin(), E = UT.end();
+ for (SetVector<const Type *>::const_iterator I = UT.begin(), E = UT.end();
I != E; ++I)
if ((*I)->isStructTy() || (*I)->isArrayTy()) {
while (M.addTypeName("unnamed"+utostr(RenameCounter), *I))
diff --git a/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp b/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp
index 8668da3..f9b5041 100644
--- a/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp
+++ b/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp
@@ -445,6 +445,8 @@ SPUTargetLowering::SPUTargetLowering(SPUTargetMachine &TM)
setTargetDAGCombine(ISD::SIGN_EXTEND);
setTargetDAGCombine(ISD::ANY_EXTEND);
+ setMinFunctionAlignment(3);
+
computeRegisterProperties();
// Set pre-RA register scheduler default to BURR, which produces slightly
@@ -489,11 +491,6 @@ SPUTargetLowering::getTargetNodeName(unsigned Opcode) const
return ((i != node_names.end()) ? i->second : 0);
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned SPUTargetLowering::getFunctionAlignment(const Function *) const {
- return 3;
-}
-
//===----------------------------------------------------------------------===//
// Return the Cell SPU's SETCC result type
//===----------------------------------------------------------------------===//
@@ -1120,8 +1117,8 @@ SPUTargetLowering::LowerFormalArguments(SDValue Chain,
EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
// FIXME: allow for other calling conventions
CCInfo.AnalyzeFormalArguments(Ins, CCC_SPU);
@@ -1218,7 +1215,7 @@ SPUTargetLowering::LowerFormalArguments(SDValue Chain,
FuncInfo->setVarArgsFrameIndex(
MFI->CreateFixedObject(StackSlotSize, ArgOffset, true));
SDValue FIN = DAG.getFrameIndex(FuncInfo->getVarArgsFrameIndex(), PtrVT);
- unsigned VReg = MF.addLiveIn(ArgRegs[ArgRegIdx], &SPU::R32CRegClass);
+ unsigned VReg = MF.addLiveIn(ArgRegs[ArgRegIdx], &SPU::VECREGRegClass);
SDValue ArgVal = DAG.getRegister(VReg, MVT::v16i8);
SDValue Store = DAG.getStore(Chain, dl, ArgVal, FIN, MachinePointerInfo(),
false, false, 0);
@@ -1267,8 +1264,8 @@ SPUTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
unsigned StackSlotSize = SPUFrameLowering::stackSlotSize();
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
// FIXME: allow for other calling conventions
CCInfo.AnalyzeCallOperands(Outs, CCC_SPU);
@@ -1428,8 +1425,8 @@ SPUTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Now handle the return value(s)
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCRetInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCRetInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCRetInfo.AnalyzeCallResult(Ins, CCC_SPU);
@@ -1455,8 +1452,8 @@ SPUTargetLowering::LowerReturn(SDValue Chain,
DebugLoc dl, SelectionDAG &DAG) const {
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeReturn(Outs, RetCC_SPU);
// If this is the first return lowered for this function, add the regs to the
@@ -3207,11 +3204,11 @@ SPUTargetLowering::ComputeNumSignBitsForTargetNode(SDValue Op,
// LowerAsmOperandForConstraint
void
SPUTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
- char ConstraintLetter,
+ std::string &Constraint,
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const {
// Default, for the time being, to the base class handler
- TargetLowering::LowerAsmOperandForConstraint(Op, ConstraintLetter, Ops, DAG);
+ TargetLowering::LowerAsmOperandForConstraint(Op, Constraint, Ops, DAG);
}
/// isLegalAddressImmediate - Return true if the integer value can be used
diff --git a/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h b/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h
index cf883e2..d23f6cc 100644
--- a/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h
+++ b/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h
@@ -141,7 +141,7 @@ namespace llvm {
getRegForInlineAsmConstraint(const std::string &Constraint,
EVT VT) const;
- void LowerAsmOperandForConstraint(SDValue Op, char ConstraintLetter,
+ void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint,
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const;
@@ -152,9 +152,6 @@ namespace llvm {
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
virtual SDValue
LowerFormalArguments(SDValue Chain,
CallingConv::ID CallConv, bool isVarArg,
diff --git a/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp b/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp
index 0bdd50a..623ae76 100644
--- a/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp
@@ -328,6 +328,10 @@ SPURegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
return SPUGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
+int SPURegisterInfo::getLLVMRegNum(unsigned RegNum, bool isEH) const {
+ return SPUGenRegisterInfo::getLLVMRegNumFull(RegNum, 0);
+}
+
int
SPURegisterInfo::convertDFormToXForm(int dFormOpcode) const
{
diff --git a/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h b/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h
index 1708c59..6ecf0f2 100644
--- a/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h
+++ b/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h
@@ -83,6 +83,7 @@ namespace llvm {
//! Get DWARF debugging register number
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
//! Convert D-form load/store to X-form load/store
/*!
diff --git a/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.td b/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.td
index 3e8f097..cce0c82 100644
--- a/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.td
+++ b/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.td
@@ -170,23 +170,7 @@ def GPRC : RegisterClass<"SPU", [i128], 128,
R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
R86, R85, R84, R83, R82, R81, R80,
/* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GPRCClass::iterator
- GPRCClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- GPRCClass::iterator
- GPRCClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
+ R2, R1, R0 ]>;
// The SPU's registers as 64-bit wide (double word integer) "preferred slot":
def R64C : RegisterClass<"SPU", [i64], 128,
@@ -204,23 +188,7 @@ def R64C : RegisterClass<"SPU", [i64], 128,
R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
R86, R85, R84, R83, R82, R81, R80,
/* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R64CClass::iterator
- R64CClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R64CClass::iterator
- R64CClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
+ R2, R1, R0 ]>;
// The SPU's registers as 64-bit wide (double word) FP "preferred slot":
def R64FP : RegisterClass<"SPU", [f64], 128,
@@ -238,23 +206,7 @@ def R64FP : RegisterClass<"SPU", [f64], 128,
R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
R86, R85, R84, R83, R82, R81, R80,
/* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R64FPClass::iterator
- R64FPClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R64FPClass::iterator
- R64FPClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
+ R2, R1, R0 ]>;
// The SPU's registers as 32-bit wide (word) "preferred slot":
def R32C : RegisterClass<"SPU", [i32], 128,
@@ -272,23 +224,7 @@ def R32C : RegisterClass<"SPU", [i32], 128,
R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
R86, R85, R84, R83, R82, R81, R80,
/* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R32CClass::iterator
- R32CClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R32CClass::iterator
- R32CClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
+ R2, R1, R0 ]>;
// The SPU's registers as single precision floating point "preferred slot":
def R32FP : RegisterClass<"SPU", [f32], 128,
@@ -306,23 +242,7 @@ def R32FP : RegisterClass<"SPU", [f32], 128,
R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
R86, R85, R84, R83, R82, R81, R80,
/* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R32FPClass::iterator
- R32FPClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R32FPClass::iterator
- R32FPClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
+ R2, R1, R0 ]>;
// The SPU's registers as 16-bit wide (halfword) "preferred slot":
def R16C : RegisterClass<"SPU", [i16], 128,
@@ -340,23 +260,7 @@ def R16C : RegisterClass<"SPU", [i16], 128,
R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
R86, R85, R84, R83, R82, R81, R80,
/* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R16CClass::iterator
- R16CClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R16CClass::iterator
- R16CClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
+ R2, R1, R0 ]>;
// The SPU's registers as 8-bit wide (byte) "preferred slot":
def R8C : RegisterClass<"SPU", [i8], 128,
@@ -374,23 +278,7 @@ def R8C : RegisterClass<"SPU", [i8], 128,
R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
R86, R85, R84, R83, R82, R81, R80,
/* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- R8CClass::iterator
- R8CClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- R8CClass::iterator
- R8CClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
+ R2, R1, R0 ]>;
// The SPU's registers as vector registers:
def VECREG : RegisterClass<"SPU",
@@ -410,20 +298,4 @@ def VECREG : RegisterClass<"SPU",
R101, R100, R99, R98, R97, R96, R95, R94, R93, R92, R91, R90, R89, R88, R87,
R86, R85, R84, R83, R82, R81, R80,
/* environment ptr, SP, LR */
- R2, R1, R0 ]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- VECREGClass::iterator
- VECREGClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- VECREGClass::iterator
- VECREGClass::allocation_order_end(const MachineFunction &MF) const {
- return end()-3; // don't allocate R2, R1, or R0 (envp, sp, lr)
- }
- }];
-}
+ R2, R1, R0 ]>;
diff --git a/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp b/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp
index 21a5988..c5e0a89 100644
--- a/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp
+++ b/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp
@@ -180,6 +180,8 @@ MBlazeTargetLowering::MBlazeTargetLowering(MBlazeTargetMachine &TM)
setLoadExtAction(ISD::EXTLOAD, MVT::f32, Expand);
setTruncStoreAction(MVT::f64, MVT::f32, Expand);
+ setMinFunctionAlignment(2);
+
setStackPointerRegisterToSaveRestore(MBlaze::R1);
computeRegisterProperties();
}
@@ -188,11 +190,6 @@ MVT::SimpleValueType MBlazeTargetLowering::getSetCCResultType(EVT VT) const {
return MVT::i32;
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned MBlazeTargetLowering::getFunctionAlignment(const Function *) const {
- return 2;
-}
-
SDValue MBlazeTargetLowering::LowerOperation(SDValue Op,
SelectionDAG &DAG) const {
switch (Op.getOpcode())
@@ -420,7 +417,7 @@ MBlazeTargetLowering::EmitCustomAtomic(MachineInstr *MI,
// All atomic instructions on the Microblaze are implemented using the
// load-linked / store-conditional style atomic instruction sequences.
// Thus, all operations will look something like the following:
- //
+ //
// start:
// lwx RV, RP, 0
// <do stuff>
@@ -701,8 +698,8 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeCallOperands(Outs, CC_MBlaze);
// Get a count of how many bytes are to be pushed on the stack.
@@ -840,8 +837,8 @@ LowerCallResult(SDValue Chain, SDValue InFlag, CallingConv::ID CallConv,
SmallVectorImpl<SDValue> &InVals) const {
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_MBlaze);
@@ -883,8 +880,8 @@ LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeFormalArguments(Ins, CC_MBlaze);
SDValue StackPtr;
@@ -1015,8 +1012,8 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
SmallVector<CCValAssign, 16> RVLocs;
// CCState - Info about the registers and stack slot.
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
// Analize return values.
CCInfo.AnalyzeReturn(Outs, RetCC_MBlaze);
@@ -1046,9 +1043,9 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
// If this function is using the interrupt_handler calling convention
// then use "rtid r14, 0" otherwise use "rtsd r15, 8"
- unsigned Ret = (CallConv == llvm::CallingConv::MBLAZE_INTR) ? MBlazeISD::IRet
+ unsigned Ret = (CallConv == llvm::CallingConv::MBLAZE_INTR) ? MBlazeISD::IRet
: MBlazeISD::Ret;
- unsigned Reg = (CallConv == llvm::CallingConv::MBLAZE_INTR) ? MBlaze::R14
+ unsigned Reg = (CallConv == llvm::CallingConv::MBLAZE_INTR) ? MBlaze::R14
: MBlaze::R15;
SDValue DReg = DAG.getRegister(Reg, MVT::i32);
diff --git a/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h b/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h
index 91649bc..265c1a7 100644
--- a/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h
+++ b/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h
@@ -104,7 +104,6 @@ namespace llvm {
/// getSetCCResultType - get the ISD::SETCC result ValueType
MVT::SimpleValueType getSetCCResultType(EVT VT) const;
- virtual unsigned getFunctionAlignment(const Function *F) const;
private:
// Subtarget Info
const MBlazeSubtarget *Subtarget;
diff --git a/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td b/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td
index 896e8ea..950f2d7 100644
--- a/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td
+++ b/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td
@@ -245,20 +245,25 @@ class PatCmp<bits<6> op, bits<11> flags, string instr_asm> :
//===----------------------------------------------------------------------===//
// Memory Access Instructions
//===----------------------------------------------------------------------===//
+
+let mayLoad = 1 in {
class LoadM<bits<6> op, bits<11> flags, string instr_asm> :
TA<op, flags, (outs GPR:$dst), (ins memrr:$addr),
!strconcat(instr_asm, " $dst, $addr"),
[], IIC_MEMl>;
+}
class LoadMI<bits<6> op, string instr_asm, PatFrag OpNode> :
TB<op, (outs GPR:$dst), (ins memri:$addr),
!strconcat(instr_asm, " $dst, $addr"),
[(set (i32 GPR:$dst), (OpNode iaddr:$addr))], IIC_MEMl>;
+let mayStore = 1 in {
class StoreM<bits<6> op, bits<11> flags, string instr_asm> :
TA<op, flags, (outs), (ins GPR:$dst, memrr:$addr),
!strconcat(instr_asm, " $dst, $addr"),
[], IIC_MEMs>;
+}
class StoreMI<bits<6> op, string instr_asm, PatFrag OpNode> :
TB<op, (outs), (ins GPR:$dst, memri:$addr),
diff --git a/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp b/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp
index ed8511d..517279f 100644
--- a/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp
@@ -356,5 +356,9 @@ int MBlazeRegisterInfo::getDwarfRegNum(unsigned RegNo, bool isEH) const {
return MBlazeGenRegisterInfo::getDwarfRegNumFull(RegNo,0);
}
+int MBlazeRegisterInfo::getLLVMRegNum(unsigned DwarfRegNo, bool isEH) const {
+ return MBlazeGenRegisterInfo::getLLVMRegNumFull(DwarfRegNo,0);
+}
+
#include "MBlazeGenRegisterInfo.inc"
diff --git a/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h b/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h
index 69ec5aa..3807839 100644
--- a/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h
+++ b/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h
@@ -75,6 +75,7 @@ struct MBlazeRegisterInfo : public MBlazeGenRegisterInfo {
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
diff --git a/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.td b/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.td
index 1a695a7..bd396ed 100644
--- a/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.td
+++ b/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.td
@@ -43,7 +43,7 @@ let Namespace = "MBlaze" in {
def R1 : MBlazeGPRReg< 1, "r1">, DwarfRegNum<[1]>;
def R2 : MBlazeGPRReg< 2, "r2">, DwarfRegNum<[2]>;
def R3 : MBlazeGPRReg< 3, "r3">, DwarfRegNum<[3]>;
- def R4 : MBlazeGPRReg< 4, "r4">, DwarfRegNum<[5]>;
+ def R4 : MBlazeGPRReg< 4, "r4">, DwarfRegNum<[4]>;
def R5 : MBlazeGPRReg< 5, "r5">, DwarfRegNum<[5]>;
def R6 : MBlazeGPRReg< 6, "r6">, DwarfRegNum<[6]>;
def R7 : MBlazeGPRReg< 7, "r7">, DwarfRegNum<[7]>;
@@ -102,7 +102,7 @@ let Namespace = "MBlaze" in {
// The carry bit. In the Microblaze this is really bit 29 of the
// MSR register but this is the only bit of that register that we
// are interested in modeling.
- def CARRY : MBlazeSPRReg<0x0000, "rmsr[c]">, DwarfRegNum<[33]>;
+ def CARRY : MBlazeSPRReg<0x0000, "rmsr[c]">;
}
//===----------------------------------------------------------------------===//
@@ -131,19 +131,7 @@ def GPR : RegisterClass<"MBlaze", [i32,f32], 32,
R17, // Return address for exceptions
R18, // Reserved for assembler
R19 // The frame-pointer
- ]>
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GPRClass::iterator
- GPRClass::allocation_order_end(const MachineFunction &MF) const {
- // The last 10 registers on the list above are reserved
- return end()-10;
- }
- }];
-}
+ ]>;
def SPR : RegisterClass<"MBlaze", [i32], 32,
[
@@ -174,16 +162,8 @@ def SPR : RegisterClass<"MBlaze", [i32], 32,
RPVR11
]>
{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- SPRClass::iterator
- SPRClass::allocation_order_end(const MachineFunction &MF) const {
- // None of the special purpose registers are allocatable.
- return end()-24;
- }
- }];
+ // None of the special purpose registers are allocatable.
+ let isAllocatable = 0;
}
def CRC : RegisterClass<"MBlaze", [i32], 32, [CARRY]> {
diff --git a/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp b/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
index 006785b..0a3eab1 100644
--- a/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
+++ b/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
@@ -170,6 +170,9 @@ MSP430TargetLowering::MSP430TargetLowering(MSP430TargetMachine &tm) :
setLibcallName(RTLIB::MUL_I8, "__mulqi3hw_noint");
setLibcallName(RTLIB::MUL_I16, "__mulhi3hw_noint");
}
+
+ setMinFunctionAlignment(1);
+ setPrefFunctionAlignment(2);
}
SDValue MSP430TargetLowering::LowerOperation(SDValue Op,
@@ -193,11 +196,6 @@ SDValue MSP430TargetLowering::LowerOperation(SDValue Op,
}
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned MSP430TargetLowering::getFunctionAlignment(const Function *F) const {
- return F->hasFnAttr(Attribute::OptimizeForSize) ? 1 : 2;
-}
-
//===----------------------------------------------------------------------===//
// MSP430 Inline Assembly Support
//===----------------------------------------------------------------------===//
@@ -314,8 +312,8 @@ MSP430TargetLowering::LowerCCCArguments(SDValue Chain,
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeFormalArguments(Ins, CC_MSP430);
assert(!isVarArg && "Varargs not supported yet");
@@ -397,8 +395,8 @@ MSP430TargetLowering::LowerReturn(SDValue Chain,
}
// CCState - Info about the registers and stack slot.
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
// Analize return values.
CCInfo.AnalyzeReturn(Outs, RetCC_MSP430);
@@ -451,8 +449,8 @@ MSP430TargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
SmallVectorImpl<SDValue> &InVals) const {
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeCallOperands(Outs, CC_MSP430);
@@ -574,8 +572,8 @@ MSP430TargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_MSP430);
diff --git a/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h b/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h
index 19c9eac..bd660a0 100644
--- a/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h
+++ b/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h
@@ -82,9 +82,6 @@ namespace llvm {
/// DAG node.
virtual const char *getTargetNodeName(unsigned Opcode) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
SDValue LowerShifts(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
diff --git a/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp b/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp
index 1da6d8d..53f4c2e 100644
--- a/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp
@@ -76,7 +76,11 @@ BitVector MSP430RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
BitVector Reserved(getNumRegs());
const TargetFrameLowering *TFI = MF.getTarget().getFrameLowering();
- // Mark 4 special registers as reserved.
+ // Mark 4 special registers with subregisters as reserved.
+ Reserved.set(MSP430::PCB);
+ Reserved.set(MSP430::SPB);
+ Reserved.set(MSP430::SRB);
+ Reserved.set(MSP430::CGB);
Reserved.set(MSP430::PCW);
Reserved.set(MSP430::SPW);
Reserved.set(MSP430::SRW);
@@ -242,4 +246,9 @@ int MSP430RegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
return 0;
}
+int MSP430RegisterInfo::getLLVMRegNum(unsigned RegNum, bool isEH) const {
+ llvm_unreachable("Not implemented yet!");
+ return 0;
+}
+
#include "MSP430GenRegisterInfo.inc"
diff --git a/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h b/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h
index 56744fa..e820558 100644
--- a/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h
+++ b/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h
@@ -39,6 +39,13 @@ public:
BitVector getReservedRegs(const MachineFunction &MF) const;
const TargetRegisterClass* getPointerRegClass(unsigned Kind = 0) const;
+ const TargetRegisterClass *
+ getMatchingSuperRegClass(const TargetRegisterClass *A,
+ const TargetRegisterClass *B, unsigned Idx) const {
+ // No sub-classes makes this really easy.
+ return A;
+ }
+
void eliminateCallFramePseudoInstr(MachineFunction &MF,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const;
@@ -54,6 +61,7 @@ public:
//! Get DWARF debugging register number
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
diff --git a/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td b/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td
index ab7b59b..3ef6ab2 100644
--- a/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td
+++ b/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td
@@ -70,25 +70,7 @@ def GR8 : RegisterClass<"MSP430", [i8], 8,
// Frame pointer, sometimes allocable
FPB,
// Volatile, but not allocable
- PCB, SPB, SRB, CGB]>
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR8Class::iterator
- GR8Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- // Depending on whether the function uses frame pointer or not, last 5 or 4
- // registers on the list above are reserved
- if (TFI->hasFP(MF))
- return end()-5;
- else
- return end()-4;
- }
- }];
-}
+ PCB, SPB, SRB, CGB]>;
def GR16 : RegisterClass<"MSP430", [i16], 16,
// Volatile registers
@@ -99,21 +81,5 @@ def GR16 : RegisterClass<"MSP430", [i16], 16,
PCW, SPW, SRW, CGW]>
{
let SubRegClasses = [(GR8 subreg_8bit)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR16Class::iterator
- GR16Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- // Depending on whether the function uses frame pointer or not, last 5 or 4
- // registers on the list above are reserved
- if (TFI->hasFP(MF))
- return end()-5;
- else
- return end()-4;
- }
- }];
}
diff --git a/contrib/llvm/lib/Target/Mips/Mips.h b/contrib/llvm/lib/Target/Mips/Mips.h
index 05b4c5a..76a26a9 100644
--- a/contrib/llvm/lib/Target/Mips/Mips.h
+++ b/contrib/llvm/lib/Target/Mips/Mips.h
@@ -26,6 +26,7 @@ namespace llvm {
FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
FunctionPass *createMipsExpandPseudoPass(MipsTargetMachine &TM);
+ FunctionPass *createMipsEmitGPRestorePass(MipsTargetMachine &TM);
extern Target TheMipsTarget;
extern Target TheMipselTarget;
diff --git a/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp b/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
index 502f744..8caa7cd 100644
--- a/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -126,44 +126,60 @@ namespace {
// Create a bitmask with all callee saved registers for CPU or Floating Point
// registers. For CPU registers consider RA, GP and FP for saving if necessary.
void MipsAsmPrinter::printSavedRegsBitmask(raw_ostream &O) {
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const TargetRegisterInfo *RI = TM.getRegisterInfo();
- const MipsFunctionInfo *MipsFI = MF->getInfo<MipsFunctionInfo>();
-
// CPU and FPU Saved Registers Bitmasks
- unsigned int CPUBitmask = 0;
- unsigned int FPUBitmask = 0;
+ unsigned CPUBitmask = 0, FPUBitmask = 0;
+ int CPUTopSavedRegOff, FPUTopSavedRegOff;
// Set the CPU and FPU Bitmasks
const MachineFrameInfo *MFI = MF->getFrameInfo();
const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
- for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
+ // size of stack area to which FP callee-saved regs are saved.
+ unsigned CPURegSize = Mips::CPURegsRegisterClass->getSize();
+ unsigned FGR32RegSize = Mips::FGR32RegisterClass->getSize();
+ unsigned AFGR64RegSize = Mips::AFGR64RegisterClass->getSize();
+ bool HasAFGR64Reg = false;
+ unsigned CSFPRegsSize = 0;
+ unsigned i, e = CSI.size();
+
+ // Set FPU Bitmask.
+ for (i = 0; i != e; ++i) {
unsigned Reg = CSI[i].getReg();
- unsigned RegNum = MipsRegisterInfo::getRegisterNumbering(Reg);
if (Mips::CPURegsRegisterClass->contains(Reg))
- CPUBitmask |= (1 << RegNum);
- else
- FPUBitmask |= (1 << RegNum);
+ break;
+
+ unsigned RegNum = MipsRegisterInfo::getRegisterNumbering(Reg);
+ if (Mips::AFGR64RegisterClass->contains(Reg)) {
+ FPUBitmask |= (3 << RegNum);
+ CSFPRegsSize += AFGR64RegSize;
+ HasAFGR64Reg = true;
+ continue;
+ }
+
+ FPUBitmask |= (1 << RegNum);
+ CSFPRegsSize += FGR32RegSize;
+ }
+
+ // Set CPU Bitmask.
+ for (; i != e; ++i) {
+ unsigned Reg = CSI[i].getReg();
+ unsigned RegNum = MipsRegisterInfo::getRegisterNumbering(Reg);
+ CPUBitmask |= (1 << RegNum);
}
- // Return Address and Frame registers must also be set in CPUBitmask.
- // FIXME: Do we really need hasFP() call here? When no FP is present SP is
- // just returned -- will it be ok?
- if (TFI->hasFP(*MF))
- CPUBitmask |= (1 << MipsRegisterInfo::
- getRegisterNumbering(RI->getFrameRegister(*MF)));
+ // FP Regs are saved right below where the virtual frame pointer points to.
+ FPUTopSavedRegOff = FPUBitmask ?
+ (HasAFGR64Reg ? -AFGR64RegSize : -FGR32RegSize) : 0;
- if (MFI->adjustsStack())
- CPUBitmask |= (1 << MipsRegisterInfo::
- getRegisterNumbering(RI->getRARegister()));
+ // CPU Regs are saved below FP Regs.
+ CPUTopSavedRegOff = CPUBitmask ? -CSFPRegsSize - CPURegSize : 0;
// Print CPUBitmask
O << "\t.mask \t"; printHex32(CPUBitmask, O);
- O << ',' << MipsFI->getCPUTopSavedRegOff() << '\n';
+ O << ',' << CPUTopSavedRegOff << '\n';
// Print FPUBitmask
- O << "\t.fmask\t"; printHex32(FPUBitmask, O); O << ","
- << MipsFI->getFPUTopSavedRegOff() << '\n';
+ O << "\t.fmask\t"; printHex32(FPUBitmask, O);
+ O << "," << FPUTopSavedRegOff << '\n';
}
// Print a 32 bit hex number with all numbers.
@@ -302,6 +318,10 @@ void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
case MipsII::MO_GOT: O << "%got("; break;
case MipsII::MO_ABS_HI: O << "%hi("; break;
case MipsII::MO_ABS_LO: O << "%lo("; break;
+ case MipsII::MO_TLSGD: O << "%tlsgd("; break;
+ case MipsII::MO_GOTTPREL: O << "%gottprel("; break;
+ case MipsII::MO_TPREL_HI: O << "%tprel_hi("; break;
+ case MipsII::MO_TPREL_LO: O << "%tprel_lo("; break;
}
switch (MO.getType()) {
@@ -310,7 +330,7 @@ void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
break;
case MachineOperand::MO_Immediate:
- O << (short int)MO.getImm();
+ O << MO.getImm();
break;
case MachineOperand::MO_MachineBasicBlock:
diff --git a/contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp b/contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp
new file mode 100644
index 0000000..f49d490
--- /dev/null
+++ b/contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp
@@ -0,0 +1,94 @@
+//===-- MipsEmitGPRestore.cpp - Emit GP restore instruction----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This pass emits instructions that restore $gp right
+// after jalr instructions.
+//
+//===----------------------------------------------------------------------===//
+
+#define DEBUG_TYPE "emit-gp-restore"
+
+#include "Mips.h"
+#include "MipsTargetMachine.h"
+#include "MipsMachineFunction.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/Target/TargetInstrInfo.h"
+#include "llvm/ADT/Statistic.h"
+
+using namespace llvm;
+
+namespace {
+ struct Inserter : public MachineFunctionPass {
+
+ TargetMachine &TM;
+ const TargetInstrInfo *TII;
+
+ static char ID;
+ Inserter(TargetMachine &tm)
+ : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { }
+
+ virtual const char *getPassName() const {
+ return "Mips Emit GP Restore";
+ }
+
+ bool runOnMachineFunction(MachineFunction &F);
+ };
+ char Inserter::ID = 0;
+} // end of anonymous namespace
+
+bool Inserter::runOnMachineFunction(MachineFunction &F) {
+ if (TM.getRelocationModel() != Reloc::PIC_)
+ return false;
+
+ bool Changed = false;
+ int FI = F.getInfo<MipsFunctionInfo>()->getGPFI();
+
+ for (MachineFunction::iterator MFI = F.begin(), MFE = F.end();
+ MFI != MFE; ++MFI) {
+ MachineBasicBlock& MBB = *MFI;
+ MachineBasicBlock::iterator I = MFI->begin();
+
+ // If MBB is a landing pad, insert instruction that restores $gp after
+ // EH_LABEL.
+ if (MBB.isLandingPad()) {
+ // Find EH_LABEL first.
+ for (; I->getOpcode() != TargetOpcode::EH_LABEL; ++I) ;
+
+ // Insert lw.
+ ++I;
+ DebugLoc dl = I != MBB.end() ? I->getDebugLoc() : DebugLoc();
+ BuildMI(MBB, I, dl, TII->get(Mips::LW), Mips::GP).addImm(0)
+ .addFrameIndex(FI);
+ Changed = true;
+ }
+
+ while (I != MFI->end()) {
+ if (I->getOpcode() != Mips::JALR) {
+ ++I;
+ continue;
+ }
+
+ DebugLoc dl = I->getDebugLoc();
+ // emit lw $gp, ($gp save slot on stack) after jalr
+ BuildMI(MBB, ++I, dl, TII->get(Mips::LW), Mips::GP).addImm(0)
+ .addFrameIndex(FI);
+ Changed = true;
+ }
+ }
+
+ return Changed;
+}
+
+/// createMipsEmitGPRestorePass - Returns a pass that emits instructions that
+/// restores $gp clobbered by jalr instructions.
+FunctionPass *llvm::createMipsEmitGPRestorePass(MipsTargetMachine &tm) {
+ return new Inserter(tm);
+}
+
diff --git a/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp b/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp
index 21e3314..a0f90a0 100644
--- a/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp
@@ -84,125 +84,17 @@ using namespace llvm;
// if frame pointer elimination is disabled.
bool MipsFrameLowering::hasFP(const MachineFunction &MF) const {
const MachineFrameInfo *MFI = MF.getFrameInfo();
- return DisableFramePointerElim(MF) || MFI->hasVarSizedObjects();
+ return DisableFramePointerElim(MF) || MFI->hasVarSizedObjects()
+ || MFI->isFrameAddressTaken();
}
-void MipsFrameLowering::adjustMipsStackFrame(MachineFunction &MF) const {
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
- const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
- unsigned StackAlign = getStackAlignment();
- unsigned RegSize = STI.isGP32bit() ? 4 : 8;
- bool HasGP = MipsFI->needGPSaveRestore();
-
- // Min and Max CSI FrameIndex.
- int MinCSFI = -1, MaxCSFI = -1;
-
- // See the description at MipsMachineFunction.h
- int TopCPUSavedRegOff = -1, TopFPUSavedRegOff = -1;
-
- // Replace the dummy '0' SPOffset by the negative offsets, as explained on
- // LowerFormalArguments. Leaving '0' for while is necessary to avoid the
- // approach done by calculateFrameObjectOffsets to the stack frame.
- MipsFI->adjustLoadArgsFI(MFI);
- MipsFI->adjustStoreVarArgsFI(MFI);
-
- // It happens that the default stack frame allocation order does not directly
- // map to the convention used for mips. So we must fix it. We move the callee
- // save register slots after the local variables area, as described in the
- // stack frame above.
- unsigned CalleeSavedAreaSize = 0;
- if (!CSI.empty()) {
- MinCSFI = CSI[0].getFrameIdx();
- MaxCSFI = CSI[CSI.size()-1].getFrameIdx();
- }
- for (unsigned i = 0, e = CSI.size(); i != e; ++i)
- CalleeSavedAreaSize += MFI->getObjectAlignment(CSI[i].getFrameIdx());
-
- unsigned StackOffset = HasGP ? (MipsFI->getGPStackOffset()+RegSize)
- : (STI.isABI_O32() ? 16 : 0);
-
- // Adjust local variables. They should come on the stack right
- // after the arguments.
- int LastOffsetFI = -1;
- for (int i = 0, e = MFI->getObjectIndexEnd(); i != e; ++i) {
- if (i >= MinCSFI && i <= MaxCSFI)
- continue;
- if (MFI->isDeadObjectIndex(i))
- continue;
- unsigned Offset =
- StackOffset + MFI->getObjectOffset(i) - CalleeSavedAreaSize;
- if (LastOffsetFI == -1)
- LastOffsetFI = i;
- if (Offset > MFI->getObjectOffset(LastOffsetFI))
- LastOffsetFI = i;
- MFI->setObjectOffset(i, Offset);
- }
-
- // Adjust CPU Callee Saved Registers Area. Registers RA and FP must
- // be saved in this CPU Area. This whole area must be aligned to the
- // default Stack Alignment requirements.
- if (LastOffsetFI >= 0)
- StackOffset = MFI->getObjectOffset(LastOffsetFI)+
- MFI->getObjectSize(LastOffsetFI);
- StackOffset = ((StackOffset+StackAlign-1)/StackAlign*StackAlign);
-
- for (unsigned i = 0, e = CSI.size(); i != e ; ++i) {
- unsigned Reg = CSI[i].getReg();
- if (!Mips::CPURegsRegisterClass->contains(Reg))
- break;
- MFI->setObjectOffset(CSI[i].getFrameIdx(), StackOffset);
- TopCPUSavedRegOff = StackOffset;
- StackOffset += MFI->getObjectAlignment(CSI[i].getFrameIdx());
- }
-
- // Stack locations for FP and RA. If only one of them is used,
- // the space must be allocated for both, otherwise no space at all.
- if (hasFP(MF) || MFI->adjustsStack()) {
- // FP stack location
- MFI->setObjectOffset(MFI->CreateStackObject(RegSize, RegSize, true),
- StackOffset);
- MipsFI->setFPStackOffset(StackOffset);
- TopCPUSavedRegOff = StackOffset;
- StackOffset += RegSize;
-
- // SP stack location
- MFI->setObjectOffset(MFI->CreateStackObject(RegSize, RegSize, true),
- StackOffset);
- MipsFI->setRAStackOffset(StackOffset);
- StackOffset += RegSize;
-
- if (MFI->adjustsStack())
- TopCPUSavedRegOff += RegSize;
- }
-
- StackOffset = ((StackOffset+StackAlign-1)/StackAlign*StackAlign);
-
- // Adjust FPU Callee Saved Registers Area. This Area must be
- // aligned to the default Stack Alignment requirements.
- for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
- unsigned Reg = CSI[i].getReg();
- if (Mips::CPURegsRegisterClass->contains(Reg))
- continue;
- MFI->setObjectOffset(CSI[i].getFrameIdx(), StackOffset);
- TopFPUSavedRegOff = StackOffset;
- StackOffset += MFI->getObjectAlignment(CSI[i].getFrameIdx());
- }
- StackOffset = ((StackOffset+StackAlign-1)/StackAlign*StackAlign);
-
- // Update frame info
- MFI->setStackSize(StackOffset);
-
- // Recalculate the final tops offset. The final values must be '0'
- // if there isn't a callee saved register for CPU or FPU, otherwise
- // a negative offset is needed.
- if (TopCPUSavedRegOff >= 0)
- MipsFI->setCPUTopSavedRegOff(TopCPUSavedRegOff-StackOffset);
-
- if (TopFPUSavedRegOff >= 0)
- MipsFI->setFPUTopSavedRegOff(TopFPUSavedRegOff-StackOffset);
+bool MipsFrameLowering::targetHandlesStackFrameRounding() const {
+ return true;
}
+static unsigned AlignOffset(unsigned Offset, unsigned Align) {
+ return (Offset + Align - 1) / Align * Align;
+}
// expand pair of register and immediate if the immediate doesn't fit in the
// 16-bit offset field.
@@ -228,7 +120,7 @@ static bool expandRegLargeImmPair(unsigned OrigReg, int OrigImm,
MachineFunction* MF = MBB.getParent();
const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();
DebugLoc DL = I->getDebugLoc();
- int ImmLo = OrigImm & 0xffff;
+ int ImmLo = (short)(OrigImm & 0xffff);
int ImmHi = (((unsigned)OrigImm & 0xffff0000) >> 16) +
((OrigImm & 0x8000) != 0);
@@ -258,18 +150,18 @@ void MipsFrameLowering::emitPrologue(MachineFunction &MF) const {
int NewImm = 0;
bool ATUsed;
- // Get the right frame order for Mips.
- adjustMipsStackFrame(MF);
-
- // Get the number of bytes to allocate from the FrameInfo.
- unsigned StackSize = MFI->getStackSize();
-
- // No need to allocate space on the stack.
- if (StackSize == 0 && !MFI->adjustsStack()) return;
-
- int FPOffset = MipsFI->getFPStackOffset();
- int RAOffset = MipsFI->getRAStackOffset();
-
+ // First, compute final stack size.
+ unsigned RegSize = STI.isGP32bit() ? 4 : 8;
+ unsigned StackAlign = getStackAlignment();
+ unsigned LocalVarAreaOffset = MipsFI->needGPSaveRestore() ?
+ (MFI->getObjectOffset(MipsFI->getGPFI()) + RegSize) :
+ MipsFI->getMaxCallFrameSize();
+ unsigned StackSize = AlignOffset(LocalVarAreaOffset, StackAlign) +
+ AlignOffset(MFI->getStackSize(), StackAlign);
+
+ // Update stack size
+ MFI->setStackSize(StackSize);
+
BuildMI(MBB, MBBI, dl, TII.get(Mips::NOREORDER));
// TODO: check need from GP here.
@@ -278,6 +170,13 @@ void MipsFrameLowering::emitPrologue(MachineFunction &MF) const {
.addReg(RegInfo->getPICCallReg());
BuildMI(MBB, MBBI, dl, TII.get(Mips::NOMACRO));
+ // No need to allocate space on the stack.
+ if (StackSize == 0 && !MFI->adjustsStack()) return;
+
+ MachineModuleInfo &MMI = MF.getMMI();
+ std::vector<MachineMove> &Moves = MMI.getFrameMoves();
+ MachineLocation DstML, SrcML;
+
// Adjust stack : addi sp, sp, (-imm)
ATUsed = expandRegLargeImmPair(Mips::SP, -StackSize, NewReg, NewImm, MBB,
MBBI);
@@ -288,97 +187,109 @@ void MipsFrameLowering::emitPrologue(MachineFunction &MF) const {
if (ATUsed)
BuildMI(MBB, MBBI, dl, TII.get(Mips::ATMACRO));
- // Save the return address only if the function isn't a leaf one.
- // sw $ra, stack_loc($sp)
- if (MFI->adjustsStack()) {
- ATUsed = expandRegLargeImmPair(Mips::SP, RAOffset, NewReg, NewImm, MBB,
- MBBI);
- BuildMI(MBB, MBBI, dl, TII.get(Mips::SW))
- .addReg(Mips::RA).addImm(NewImm).addReg(NewReg);
+ // emit ".cfi_def_cfa_offset StackSize"
+ MCSymbol *AdjustSPLabel = MMI.getContext().CreateTempSymbol();
+ BuildMI(MBB, MBBI, dl,
+ TII.get(TargetOpcode::PROLOG_LABEL)).addSym(AdjustSPLabel);
+ DstML = MachineLocation(MachineLocation::VirtualFP);
+ SrcML = MachineLocation(MachineLocation::VirtualFP, -StackSize);
+ Moves.push_back(MachineMove(AdjustSPLabel, DstML, SrcML));
- // FIXME: change this when mips goes MC".
- if (ATUsed)
- BuildMI(MBB, MBBI, dl, TII.get(Mips::ATMACRO));
- }
+ const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
- // if framepointer enabled, save it and set it
- // to point to the stack pointer
+ if (CSI.size()) {
+ // Find the instruction past the last instruction that saves a callee-saved
+ // register to the stack.
+ for (unsigned i = 0; i < CSI.size(); ++i)
+ ++MBBI;
+
+ // Iterate over list of callee-saved registers and emit .cfi_offset
+ // directives.
+ MCSymbol *CSLabel = MMI.getContext().CreateTempSymbol();
+ BuildMI(MBB, MBBI, dl,
+ TII.get(TargetOpcode::PROLOG_LABEL)).addSym(CSLabel);
+
+ for (std::vector<CalleeSavedInfo>::const_iterator I = CSI.begin(),
+ E = CSI.end(); I != E; ++I) {
+ int64_t Offset = MFI->getObjectOffset(I->getFrameIdx());
+ unsigned Reg = I->getReg();
+
+ // If Reg is a double precision register, emit two cfa_offsets,
+ // one for each of the paired single precision registers.
+ if (Mips::AFGR64RegisterClass->contains(Reg)) {
+ const unsigned *SubRegs = RegInfo->getSubRegisters(Reg);
+ MachineLocation DstML0(MachineLocation::VirtualFP, Offset);
+ MachineLocation DstML1(MachineLocation::VirtualFP, Offset + 4);
+ MachineLocation SrcML0(*SubRegs);
+ MachineLocation SrcML1(*(SubRegs + 1));
+
+ if (!STI.isLittle())
+ std::swap(SrcML0, SrcML1);
+
+ Moves.push_back(MachineMove(CSLabel, DstML0, SrcML0));
+ Moves.push_back(MachineMove(CSLabel, DstML1, SrcML1));
+ }
+ else {
+ // Reg is either in CPURegs or FGR32.
+ DstML = MachineLocation(MachineLocation::VirtualFP, Offset);
+ SrcML = MachineLocation(Reg);
+ Moves.push_back(MachineMove(CSLabel, DstML, SrcML));
+ }
+ }
+ }
+
+ // if framepointer enabled, set it to point to the stack pointer.
if (hasFP(MF)) {
- // sw $fp,stack_loc($sp)
- ATUsed = expandRegLargeImmPair(Mips::SP, FPOffset, NewReg, NewImm, MBB,
- MBBI);
- BuildMI(MBB, MBBI, dl, TII.get(Mips::SW))
- .addReg(Mips::FP).addImm(NewImm).addReg(NewReg);
-
- // FIXME: change this when mips goes MC".
- if (ATUsed)
- BuildMI(MBB, MBBI, dl, TII.get(Mips::ATMACRO));
-
- // move $fp, $sp
+ // Insert instruction "move $fp, $sp" at this location.
BuildMI(MBB, MBBI, dl, TII.get(Mips::ADDu), Mips::FP)
.addReg(Mips::SP).addReg(Mips::ZERO);
+
+ // emit ".cfi_def_cfa_register $fp"
+ MCSymbol *SetFPLabel = MMI.getContext().CreateTempSymbol();
+ BuildMI(MBB, MBBI, dl,
+ TII.get(TargetOpcode::PROLOG_LABEL)).addSym(SetFPLabel);
+ DstML = MachineLocation(Mips::FP);
+ SrcML = MachineLocation(MachineLocation::VirtualFP);
+ Moves.push_back(MachineMove(SetFPLabel, DstML, SrcML));
}
// Restore GP from the saved stack location
if (MipsFI->needGPSaveRestore())
BuildMI(MBB, MBBI, dl, TII.get(Mips::CPRESTORE))
- .addImm(MipsFI->getGPStackOffset());
+ .addImm(MFI->getObjectOffset(MipsFI->getGPFI()));
}
void MipsFrameLowering::emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const {
MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
MachineFrameInfo *MFI = MF.getFrameInfo();
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
const MipsInstrInfo &TII =
*static_cast<const MipsInstrInfo*>(MF.getTarget().getInstrInfo());
DebugLoc dl = MBBI->getDebugLoc();
// Get the number of bytes from FrameInfo
- int NumBytes = (int) MFI->getStackSize();
-
- // Get the FI's where RA and FP are saved.
- int FPOffset = MipsFI->getFPStackOffset();
- int RAOffset = MipsFI->getRAStackOffset();
+ unsigned StackSize = MFI->getStackSize();
unsigned NewReg = 0;
int NewImm = 0;
bool ATUsed = false;
- // if framepointer enabled, restore it and restore the
- // stack pointer
+ // if framepointer enabled, restore the stack pointer.
if (hasFP(MF)) {
- // move $sp, $fp
- BuildMI(MBB, MBBI, dl, TII.get(Mips::ADDu), Mips::SP)
+ // Find the first instruction that restores a callee-saved register.
+ MachineBasicBlock::iterator I = MBBI;
+
+ for (unsigned i = 0; i < MFI->getCalleeSavedInfo().size(); ++i)
+ --I;
+
+ // Insert instruction "move $sp, $fp" at this location.
+ BuildMI(MBB, I, dl, TII.get(Mips::ADDu), Mips::SP)
.addReg(Mips::FP).addReg(Mips::ZERO);
-
- // lw $fp,stack_loc($sp)
- ATUsed = expandRegLargeImmPair(Mips::SP, FPOffset, NewReg, NewImm, MBB,
- MBBI);
- BuildMI(MBB, MBBI, dl, TII.get(Mips::LW), Mips::FP)
- .addImm(NewImm).addReg(NewReg);
-
- // FIXME: change this when mips goes MC".
- if (ATUsed)
- BuildMI(MBB, MBBI, dl, TII.get(Mips::ATMACRO));
- }
-
- // Restore the return address only if the function isn't a leaf one.
- // lw $ra, stack_loc($sp)
- if (MFI->adjustsStack()) {
- ATUsed = expandRegLargeImmPair(Mips::SP, RAOffset, NewReg, NewImm, MBB,
- MBBI);
- BuildMI(MBB, MBBI, dl, TII.get(Mips::LW), Mips::RA)
- .addImm(NewImm).addReg(NewReg);
-
- // FIXME: change this when mips goes MC".
- if (ATUsed)
- BuildMI(MBB, MBBI, dl, TII.get(Mips::ATMACRO));
}
// adjust stack : insert addi sp, sp, (imm)
- if (NumBytes) {
- ATUsed = expandRegLargeImmPair(Mips::SP, NumBytes, NewReg, NewImm, MBB,
+ if (StackSize) {
+ ATUsed = expandRegLargeImmPair(Mips::SP, StackSize, NewReg, NewImm, MBB,
MBBI);
BuildMI(MBB, MBBI, dl, TII.get(Mips::ADDiu), Mips::SP)
.addReg(NewReg).addImm(NewImm);
@@ -389,9 +300,32 @@ void MipsFrameLowering::emitEpilogue(MachineFunction &MF,
}
}
+void
+MipsFrameLowering::getInitialFrameState(std::vector<MachineMove> &Moves) const {
+ MachineLocation Dst(MachineLocation::VirtualFP);
+ MachineLocation Src(Mips::SP, 0);
+ Moves.push_back(MachineMove(0, Dst, Src));
+}
+
void MipsFrameLowering::
-processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
- const MipsRegisterInfo *RegInfo =
- static_cast<const MipsRegisterInfo*>(MF.getTarget().getRegisterInfo());
- RegInfo->processFunctionBeforeFrameFinalized(MF);
+processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
+ RegScavenger *RS) const {
+ MachineRegisterInfo& MRI = MF.getRegInfo();
+
+ // FIXME: remove this code if register allocator can correctly mark
+ // $fp and $ra used or unused.
+
+ // Mark $fp and $ra as used or unused.
+ if (hasFP(MF))
+ MRI.setPhysRegUsed(Mips::FP);
+
+ // The register allocator might determine $ra is used after seeing
+ // instruction "jr $ra", but we do not want PrologEpilogInserter to insert
+ // instructions to save/restore $ra unless there is a function call.
+ // To correct this, $ra is explicitly marked unused if there is no
+ // function call.
+ if (MF.getFrameInfo()->hasCalls())
+ MRI.setPhysRegUsed(Mips::RA);
+ else
+ MRI.setPhysRegUnused(Mips::RA);
}
diff --git a/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h b/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h
index 34647df..78c78ee 100644
--- a/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h
+++ b/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h
@@ -27,11 +27,10 @@ protected:
public:
explicit MipsFrameLowering(const MipsSubtarget &sti)
- // FIXME: Is this correct at all?
- : TargetFrameLowering(StackGrowsUp, 8, 0), STI(sti) {
+ : TargetFrameLowering(StackGrowsDown, 8, 0), STI(sti) {
}
- void adjustMipsStackFrame(MachineFunction &MF) const;
+ bool targetHandlesStackFrameRounding() const;
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
/// the function.
@@ -40,7 +39,10 @@ public:
bool hasFP(const MachineFunction &MF) const;
- void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
+ void getInitialFrameState(std::vector<MachineMove> &Moves) const;
+
+ void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
+ RegScavenger *RS) const;
};
} // End llvm namespace
diff --git a/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp b/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp
index 0382964..d8a84ce 100644
--- a/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp
@@ -119,39 +119,41 @@ SelectAddr(SDValue Addr, SDValue &Offset, SDValue &Base) {
// on PIC code Load GA
if (TM.getRelocationModel() == Reloc::PIC_) {
- if ((Addr.getOpcode() == ISD::TargetGlobalAddress) ||
- (Addr.getOpcode() == ISD::TargetConstantPool) ||
- (Addr.getOpcode() == ISD::TargetJumpTable) ||
- (Addr.getOpcode() == ISD::TargetBlockAddress) ||
- (Addr.getOpcode() == ISD::TargetExternalSymbol)) {
+ if (Addr.getOpcode() == MipsISD::WrapperPIC) {
Base = CurDAG->getRegister(Mips::GP, MVT::i32);
- Offset = Addr;
+ Offset = Addr.getOperand(0);
return true;
}
} else {
if ((Addr.getOpcode() == ISD::TargetExternalSymbol ||
Addr.getOpcode() == ISD::TargetGlobalAddress))
return false;
+ else if (Addr.getOpcode() == ISD::TargetGlobalTLSAddress) {
+ Base = CurDAG->getRegister(Mips::GP, MVT::i32);
+ Offset = Addr;
+ return true;
+ }
}
- // Operand is a result from an ADD.
- if (Addr.getOpcode() == ISD::ADD) {
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1))) {
- if (isInt<16>(CN->getSExtValue())) {
-
- // If the first operand is a FI, get the TargetFI Node
- if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>
- (Addr.getOperand(0))) {
- Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
- } else {
- Base = Addr.getOperand(0);
- }
-
- Offset = CurDAG->getTargetConstant(CN->getZExtValue(), MVT::i32);
- return true;
- }
+ // Addresses of the form FI+const or FI|const
+ if (CurDAG->isBaseWithConstantOffset(Addr)) {
+ ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1));
+ if (isInt<16>(CN->getSExtValue())) {
+
+ // If the first operand is a FI, get the TargetFI Node
+ if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>
+ (Addr.getOperand(0)))
+ Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
+ else
+ Base = Addr.getOperand(0);
+
+ Offset = CurDAG->getTargetConstant(CN->getZExtValue(), MVT::i32);
+ return true;
}
+ }
+ // Operand is a result from an ADD.
+ if (Addr.getOpcode() == ISD::ADD) {
// When loading from constant pools, load the lower address part in
// the instruction itself. Example, instead of:
// lui $2, %hi($CPI1_0)
@@ -321,7 +323,6 @@ SDNode* MipsDAGToDAGISel::Select(SDNode *Node) {
// tablegen selection should be handled here.
///
switch(Opcode) {
-
default: break;
case ISD::SUBE:
@@ -355,10 +356,7 @@ SDNode* MipsDAGToDAGISel::Select(SDNode *Node) {
LHS, SDValue(AddCarry,0));
}
- /// Mul/Div with two results
- case ISD::SDIVREM:
- case ISD::UDIVREM:
- break;
+ /// Mul with two results
case ISD::SMUL_LOHI:
case ISD::UMUL_LOHI: {
SDValue Op1 = Node->getOperand(0);
@@ -405,13 +403,6 @@ SDNode* MipsDAGToDAGISel::Select(SDNode *Node) {
return CurDAG->getMachineNode(Mips::MFHI, dl, MVT::i32, InFlag);
}
- /// Div/Rem operations
- case ISD::SREM:
- case ISD::UREM:
- case ISD::SDIV:
- case ISD::UDIV:
- break;
-
// Get target GOT address.
case ISD::GLOBAL_OFFSET_TABLE:
return getGlobalBaseReg();
@@ -445,6 +436,18 @@ SDNode* MipsDAGToDAGISel::Select(SDNode *Node) {
return ResNode;
// Other cases are autogenerated.
break;
+
+ case MipsISD::ThreadPointer: {
+ unsigned SrcReg = Mips::HWR29;
+ unsigned DestReg = Mips::V1;
+ SDNode *Rdhwr = CurDAG->getMachineNode(Mips::RDHWR, Node->getDebugLoc(),
+ Node->getValueType(0), CurDAG->getRegister(SrcReg, MVT::i32));
+ SDValue Chain = CurDAG->getCopyToReg(CurDAG->getEntryNode(), dl, DestReg,
+ SDValue(Rdhwr, 0));
+ SDValue ResNode = CurDAG->getCopyFromReg(Chain, dl, DestReg, MVT::i32);
+ ReplaceUses(SDValue(Node, 0), ResNode);
+ return ResNode.getNode();
+ }
}
// Select the default instruction
diff --git a/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp b/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp
index 1f1220f..fd90731 100644
--- a/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -36,25 +36,30 @@ using namespace llvm;
const char *MipsTargetLowering::getTargetNodeName(unsigned Opcode) const {
switch (Opcode) {
- case MipsISD::JmpLink : return "MipsISD::JmpLink";
- case MipsISD::Hi : return "MipsISD::Hi";
- case MipsISD::Lo : return "MipsISD::Lo";
- case MipsISD::GPRel : return "MipsISD::GPRel";
- case MipsISD::Ret : return "MipsISD::Ret";
- case MipsISD::FPBrcond : return "MipsISD::FPBrcond";
- case MipsISD::FPCmp : return "MipsISD::FPCmp";
- case MipsISD::CMovFP_T : return "MipsISD::CMovFP_T";
- case MipsISD::CMovFP_F : return "MipsISD::CMovFP_F";
- case MipsISD::FPRound : return "MipsISD::FPRound";
- case MipsISD::MAdd : return "MipsISD::MAdd";
- case MipsISD::MAddu : return "MipsISD::MAddu";
- case MipsISD::MSub : return "MipsISD::MSub";
- case MipsISD::MSubu : return "MipsISD::MSubu";
- case MipsISD::DivRem : return "MipsISD::DivRem";
- case MipsISD::DivRemU : return "MipsISD::DivRemU";
- case MipsISD::BuildPairF64: return "MipsISD::BuildPairF64";
- case MipsISD::ExtractElementF64: return "MipsISD::ExtractElementF64";
- default : return NULL;
+ case MipsISD::JmpLink: return "MipsISD::JmpLink";
+ case MipsISD::Hi: return "MipsISD::Hi";
+ case MipsISD::Lo: return "MipsISD::Lo";
+ case MipsISD::GPRel: return "MipsISD::GPRel";
+ case MipsISD::TlsGd: return "MipsISD::TlsGd";
+ case MipsISD::TprelHi: return "MipsISD::TprelHi";
+ case MipsISD::TprelLo: return "MipsISD::TprelLo";
+ case MipsISD::ThreadPointer: return "MipsISD::ThreadPointer";
+ case MipsISD::Ret: return "MipsISD::Ret";
+ case MipsISD::FPBrcond: return "MipsISD::FPBrcond";
+ case MipsISD::FPCmp: return "MipsISD::FPCmp";
+ case MipsISD::CMovFP_T: return "MipsISD::CMovFP_T";
+ case MipsISD::CMovFP_F: return "MipsISD::CMovFP_F";
+ case MipsISD::FPRound: return "MipsISD::FPRound";
+ case MipsISD::MAdd: return "MipsISD::MAdd";
+ case MipsISD::MAddu: return "MipsISD::MAddu";
+ case MipsISD::MSub: return "MipsISD::MSub";
+ case MipsISD::MSubu: return "MipsISD::MSubu";
+ case MipsISD::DivRem: return "MipsISD::DivRem";
+ case MipsISD::DivRemU: return "MipsISD::DivRemU";
+ case MipsISD::BuildPairF64: return "MipsISD::BuildPairF64";
+ case MipsISD::ExtractElementF64: return "MipsISD::ExtractElementF64";
+ case MipsISD::WrapperPIC: return "MipsISD::WrapperPIC";
+ default: return NULL;
}
}
@@ -102,7 +107,6 @@ MipsTargetLowering(MipsTargetMachine &TM)
setOperationAction(ISD::SELECT, MVT::i32, Custom);
setOperationAction(ISD::BRCOND, MVT::Other, Custom);
setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Custom);
- setOperationAction(ISD::FP_TO_SINT, MVT::i32, Custom);
setOperationAction(ISD::VASTART, MVT::Other, Custom);
setOperationAction(ISD::SDIV, MVT::i32, Expand);
@@ -127,20 +131,22 @@ MipsTargetLowering(MipsTargetMachine &TM)
setOperationAction(ISD::SHL_PARTS, MVT::i32, Expand);
setOperationAction(ISD::SRA_PARTS, MVT::i32, Expand);
setOperationAction(ISD::SRL_PARTS, MVT::i32, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f32, Expand);
- setOperationAction(ISD::FCOPYSIGN, MVT::f64, Expand);
+ setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
+ setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom);
setOperationAction(ISD::FSIN, MVT::f32, Expand);
setOperationAction(ISD::FSIN, MVT::f64, Expand);
setOperationAction(ISD::FCOS, MVT::f32, Expand);
setOperationAction(ISD::FCOS, MVT::f64, Expand);
setOperationAction(ISD::FPOWI, MVT::f32, Expand);
setOperationAction(ISD::FPOW, MVT::f32, Expand);
+ setOperationAction(ISD::FPOW, MVT::f64, Expand);
setOperationAction(ISD::FLOG, MVT::f32, Expand);
setOperationAction(ISD::FLOG2, MVT::f32, Expand);
setOperationAction(ISD::FLOG10, MVT::f32, Expand);
setOperationAction(ISD::FEXP, MVT::f32, Expand);
- setOperationAction(ISD::EH_LABEL, MVT::Other, Expand);
+ setOperationAction(ISD::EXCEPTIONADDR, MVT::i32, Expand);
+ setOperationAction(ISD::EHSELECTION, MVT::i32, Expand);
setOperationAction(ISD::VAARG, MVT::Other, Expand);
setOperationAction(ISD::VACOPY, MVT::Other, Expand);
@@ -171,19 +177,19 @@ MipsTargetLowering(MipsTargetMachine &TM)
setTargetDAGCombine(ISD::UDIVREM);
setTargetDAGCombine(ISD::SETCC);
+ setMinFunctionAlignment(2);
+
setStackPointerRegisterToSaveRestore(Mips::SP);
computeRegisterProperties();
+
+ setExceptionPointerRegister(Mips::A0);
+ setExceptionSelectorRegister(Mips::A1);
}
MVT::SimpleValueType MipsTargetLowering::getSetCCResultType(EVT VT) const {
return MVT::i32;
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned MipsTargetLowering::getFunctionAlignment(const Function *) const {
- return 2;
-}
-
// SelectMadd -
// Transforms a subgraph in CurDAG if the following pattern is found:
// (addc multLo, Lo0), (adde multHi, Hi0),
@@ -383,7 +389,7 @@ static SDValue PerformDivRemCombine(SDNode *N, SelectionDAG& DAG,
// insert MFHI
if (N->hasAnyUseOfValue(1)) {
SDValue CopyFromHi = DAG.getCopyFromReg(InChain, dl,
- Mips::HI, MVT::i32, InGlue);
+ Mips::HI, MVT::i32, InGlue);
DAG.ReplaceAllUsesOfValueWith(SDValue(N, 1), CopyFromHi);
}
@@ -509,13 +515,14 @@ LowerOperation(SDValue Op, SelectionDAG &DAG) const
case ISD::BRCOND: return LowerBRCOND(Op, DAG);
case ISD::ConstantPool: return LowerConstantPool(Op, DAG);
case ISD::DYNAMIC_STACKALLOC: return LowerDYNAMIC_STACKALLOC(Op, DAG);
- case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG);
case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
case ISD::BlockAddress: return LowerBlockAddress(Op, DAG);
case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
case ISD::JumpTable: return LowerJumpTable(Op, DAG);
case ISD::SELECT: return LowerSELECT(Op, DAG);
case ISD::VASTART: return LowerVASTART(Op, DAG);
+ case ISD::FCOPYSIGN: return LowerFCOPYSIGN(Op, DAG);
+ case ISD::FRAMEADDR: return LowerFRAMEADDR(Op, DAG);
}
return SDValue();
}
@@ -547,45 +554,16 @@ static Mips::FPBranchCode GetFPBranchCodeFromCond(Mips::CondCode CC) {
return Mips::BRANCH_INVALID;
}
-MachineBasicBlock *
-MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
- MachineBasicBlock *BB) const {
+static MachineBasicBlock* ExpandCondMov(MachineInstr *MI, MachineBasicBlock *BB,
+ DebugLoc dl,
+ const MipsSubtarget* Subtarget,
+ const TargetInstrInfo *TII,
+ bool isFPCmp, unsigned Opc) {
// There is no need to expand CMov instructions if target has
// conditional moves.
if (Subtarget->hasCondMov())
return BB;
- const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
- bool isFPCmp = false;
- DebugLoc dl = MI->getDebugLoc();
- unsigned Opc;
-
- switch (MI->getOpcode()) {
- default: assert(false && "Unexpected instr type to insert");
- case Mips::MOVT:
- case Mips::MOVT_S:
- case Mips::MOVT_D:
- isFPCmp = true;
- Opc = Mips::BC1F;
- break;
- case Mips::MOVF:
- case Mips::MOVF_S:
- case Mips::MOVF_D:
- isFPCmp = true;
- Opc = Mips::BC1T;
- break;
- case Mips::MOVZ_I:
- case Mips::MOVZ_S:
- case Mips::MOVZ_D:
- Opc = Mips::BNE;
- break;
- case Mips::MOVN_I:
- case Mips::MOVN_S:
- case Mips::MOVN_D:
- Opc = Mips::BEQ;
- break;
- }
-
// To "insert" a SELECT_CC instruction, we actually have to insert the
// diamond control-flow pattern. The incoming instruction knows the
// destination vreg to set, the condition code register to branch on, the
@@ -624,7 +602,6 @@ MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
BuildMI(BB, dl, TII->get(Opc)).addReg(MI->getOperand(2).getReg())
.addReg(Mips::ZERO).addMBB(sinkMBB);
-
// copy0MBB:
// %FalseValue = ...
// # fallthrough to sinkMBB
@@ -653,46 +630,572 @@ MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
return BB;
}
-//===----------------------------------------------------------------------===//
-// Misc Lower Operation implementation
-//===----------------------------------------------------------------------===//
+MachineBasicBlock *
+MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
+ MachineBasicBlock *BB) const {
+ const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
+ DebugLoc dl = MI->getDebugLoc();
-SDValue MipsTargetLowering::
-LowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const
-{
- if (!Subtarget->isMips1())
- return Op;
+ switch (MI->getOpcode()) {
+ default:
+ assert(false && "Unexpected instr type to insert");
+ return NULL;
+ case Mips::MOVT:
+ case Mips::MOVT_S:
+ case Mips::MOVT_D:
+ return ExpandCondMov(MI, BB, dl, Subtarget, TII, true, Mips::BC1F);
+ case Mips::MOVF:
+ case Mips::MOVF_S:
+ case Mips::MOVF_D:
+ return ExpandCondMov(MI, BB, dl, Subtarget, TII, true, Mips::BC1T);
+ case Mips::MOVZ_I:
+ case Mips::MOVZ_S:
+ case Mips::MOVZ_D:
+ return ExpandCondMov(MI, BB, dl, Subtarget, TII, false, Mips::BNE);
+ case Mips::MOVN_I:
+ case Mips::MOVN_S:
+ case Mips::MOVN_D:
+ return ExpandCondMov(MI, BB, dl, Subtarget, TII, false, Mips::BEQ);
+
+ case Mips::ATOMIC_LOAD_ADD_I8:
+ return EmitAtomicBinaryPartword(MI, BB, 1, Mips::ADDu);
+ case Mips::ATOMIC_LOAD_ADD_I16:
+ return EmitAtomicBinaryPartword(MI, BB, 2, Mips::ADDu);
+ case Mips::ATOMIC_LOAD_ADD_I32:
+ return EmitAtomicBinary(MI, BB, 4, Mips::ADDu);
+
+ case Mips::ATOMIC_LOAD_AND_I8:
+ return EmitAtomicBinaryPartword(MI, BB, 1, Mips::AND);
+ case Mips::ATOMIC_LOAD_AND_I16:
+ return EmitAtomicBinaryPartword(MI, BB, 2, Mips::AND);
+ case Mips::ATOMIC_LOAD_AND_I32:
+ return EmitAtomicBinary(MI, BB, 4, Mips::AND);
+
+ case Mips::ATOMIC_LOAD_OR_I8:
+ return EmitAtomicBinaryPartword(MI, BB, 1, Mips::OR);
+ case Mips::ATOMIC_LOAD_OR_I16:
+ return EmitAtomicBinaryPartword(MI, BB, 2, Mips::OR);
+ case Mips::ATOMIC_LOAD_OR_I32:
+ return EmitAtomicBinary(MI, BB, 4, Mips::OR);
+
+ case Mips::ATOMIC_LOAD_XOR_I8:
+ return EmitAtomicBinaryPartword(MI, BB, 1, Mips::XOR);
+ case Mips::ATOMIC_LOAD_XOR_I16:
+ return EmitAtomicBinaryPartword(MI, BB, 2, Mips::XOR);
+ case Mips::ATOMIC_LOAD_XOR_I32:
+ return EmitAtomicBinary(MI, BB, 4, Mips::XOR);
+
+ case Mips::ATOMIC_LOAD_NAND_I8:
+ return EmitAtomicBinaryPartword(MI, BB, 1, 0, true);
+ case Mips::ATOMIC_LOAD_NAND_I16:
+ return EmitAtomicBinaryPartword(MI, BB, 2, 0, true);
+ case Mips::ATOMIC_LOAD_NAND_I32:
+ return EmitAtomicBinary(MI, BB, 4, 0, true);
+
+ case Mips::ATOMIC_LOAD_SUB_I8:
+ return EmitAtomicBinaryPartword(MI, BB, 1, Mips::SUBu);
+ case Mips::ATOMIC_LOAD_SUB_I16:
+ return EmitAtomicBinaryPartword(MI, BB, 2, Mips::SUBu);
+ case Mips::ATOMIC_LOAD_SUB_I32:
+ return EmitAtomicBinary(MI, BB, 4, Mips::SUBu);
+
+ case Mips::ATOMIC_SWAP_I8:
+ return EmitAtomicBinaryPartword(MI, BB, 1, 0);
+ case Mips::ATOMIC_SWAP_I16:
+ return EmitAtomicBinaryPartword(MI, BB, 2, 0);
+ case Mips::ATOMIC_SWAP_I32:
+ return EmitAtomicBinary(MI, BB, 4, 0);
+
+ case Mips::ATOMIC_CMP_SWAP_I8:
+ return EmitAtomicCmpSwapPartword(MI, BB, 1);
+ case Mips::ATOMIC_CMP_SWAP_I16:
+ return EmitAtomicCmpSwapPartword(MI, BB, 2);
+ case Mips::ATOMIC_CMP_SWAP_I32:
+ return EmitAtomicCmpSwap(MI, BB, 4);
+ }
+}
- MachineFunction &MF = DAG.getMachineFunction();
- unsigned CCReg = AddLiveIn(MF, Mips::FCR31, Mips::CCRRegisterClass);
+// This function also handles Mips::ATOMIC_SWAP_I32 (when BinOpcode == 0), and
+// Mips::ATOMIC_LOAD_NAND_I32 (when Nand == true)
+MachineBasicBlock *
+MipsTargetLowering::EmitAtomicBinary(MachineInstr *MI, MachineBasicBlock *BB,
+ unsigned Size, unsigned BinOpcode,
+ bool Nand) const {
+ assert(Size == 4 && "Unsupported size for EmitAtomicBinary.");
+
+ MachineFunction *MF = BB->getParent();
+ MachineRegisterInfo &RegInfo = MF->getRegInfo();
+ const TargetRegisterClass *RC = getRegClassFor(MVT::i32);
+ const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
+ DebugLoc dl = MI->getDebugLoc();
- SDValue Chain = DAG.getEntryNode();
- DebugLoc dl = Op.getDebugLoc();
- SDValue Src = Op.getOperand(0);
-
- // Set the condition register
- SDValue CondReg = DAG.getCopyFromReg(Chain, dl, CCReg, MVT::i32);
- CondReg = DAG.getCopyToReg(Chain, dl, Mips::AT, CondReg);
- CondReg = DAG.getCopyFromReg(CondReg, dl, Mips::AT, MVT::i32);
-
- SDValue Cst = DAG.getConstant(3, MVT::i32);
- SDValue Or = DAG.getNode(ISD::OR, dl, MVT::i32, CondReg, Cst);
- Cst = DAG.getConstant(2, MVT::i32);
- SDValue Xor = DAG.getNode(ISD::XOR, dl, MVT::i32, Or, Cst);
-
- SDValue InFlag(0, 0);
- CondReg = DAG.getCopyToReg(Chain, dl, Mips::FCR31, Xor, InFlag);
-
- // Emit the round instruction and bit convert to integer
- SDValue Trunc = DAG.getNode(MipsISD::FPRound, dl, MVT::f32,
- Src, CondReg.getValue(1));
- SDValue BitCvt = DAG.getNode(ISD::BITCAST, dl, MVT::i32, Trunc);
- return BitCvt;
+ unsigned Dest = MI->getOperand(0).getReg();
+ unsigned Ptr = MI->getOperand(1).getReg();
+ unsigned Incr = MI->getOperand(2).getReg();
+
+ unsigned Oldval = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp1 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp2 = RegInfo.createVirtualRegister(RC);
+
+ // insert new blocks after the current block
+ const BasicBlock *LLVM_BB = BB->getBasicBlock();
+ MachineBasicBlock *loopMBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineBasicBlock *exitMBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineFunction::iterator It = BB;
+ ++It;
+ MF->insert(It, loopMBB);
+ MF->insert(It, exitMBB);
+
+ // Transfer the remainder of BB and its successor edges to exitMBB.
+ exitMBB->splice(exitMBB->begin(), BB,
+ llvm::next(MachineBasicBlock::iterator(MI)),
+ BB->end());
+ exitMBB->transferSuccessorsAndUpdatePHIs(BB);
+
+ // thisMBB:
+ // ...
+ // sw incr, fi(sp) // store incr to stack (when BinOpcode == 0)
+ // fallthrough --> loopMBB
+
+ // Note: for atomic.swap (when BinOpcode == 0), storing incr to stack before
+ // the loop and then loading it from stack in block loopMBB is necessary to
+ // prevent MachineLICM pass to hoist "or" instruction out of the block
+ // loopMBB.
+
+ int fi = 0;
+ if (BinOpcode == 0 && !Nand) {
+ // Get or create a temporary stack location.
+ MipsFunctionInfo *MipsFI = MF->getInfo<MipsFunctionInfo>();
+ fi = MipsFI->getAtomicFrameIndex();
+ if (fi == -1) {
+ fi = MF->getFrameInfo()->CreateStackObject(Size, Size, false);
+ MipsFI->setAtomicFrameIndex(fi);
+ }
+
+ BuildMI(BB, dl, TII->get(Mips::SW))
+ .addReg(Incr).addImm(0).addFrameIndex(fi);
+ }
+ BB->addSuccessor(loopMBB);
+
+ // loopMBB:
+ // ll oldval, 0(ptr)
+ // or dest, $0, oldval
+ // <binop> tmp1, oldval, incr
+ // sc tmp1, 0(ptr)
+ // beq tmp1, $0, loopMBB
+ BB = loopMBB;
+ BuildMI(BB, dl, TII->get(Mips::LL), Oldval).addImm(0).addReg(Ptr);
+ BuildMI(BB, dl, TII->get(Mips::OR), Dest).addReg(Mips::ZERO).addReg(Oldval);
+ if (Nand) {
+ // and tmp2, oldval, incr
+ // nor tmp1, $0, tmp2
+ BuildMI(BB, dl, TII->get(Mips::AND), Tmp2).addReg(Oldval).addReg(Incr);
+ BuildMI(BB, dl, TII->get(Mips::NOR), Tmp1).addReg(Mips::ZERO).addReg(Tmp2);
+ } else if (BinOpcode) {
+ // <binop> tmp1, oldval, incr
+ BuildMI(BB, dl, TII->get(BinOpcode), Tmp1).addReg(Oldval).addReg(Incr);
+ } else {
+ // lw tmp2, fi(sp) // load incr from stack
+ // or tmp1, $zero, tmp2
+ BuildMI(BB, dl, TII->get(Mips::LW), Tmp2).addImm(0).addFrameIndex(fi);;
+ BuildMI(BB, dl, TII->get(Mips::OR), Tmp1).addReg(Mips::ZERO).addReg(Tmp2);
+ }
+ BuildMI(BB, dl, TII->get(Mips::SC), Tmp1).addReg(Tmp1).addImm(0).addReg(Ptr);
+ BuildMI(BB, dl, TII->get(Mips::BEQ))
+ .addReg(Tmp1).addReg(Mips::ZERO).addMBB(loopMBB);
+ BB->addSuccessor(loopMBB);
+ BB->addSuccessor(exitMBB);
+
+ MI->eraseFromParent(); // The instruction is gone now.
+
+ return BB;
}
+MachineBasicBlock *
+MipsTargetLowering::EmitAtomicBinaryPartword(MachineInstr *MI,
+ MachineBasicBlock *BB,
+ unsigned Size, unsigned BinOpcode,
+ bool Nand) const {
+ assert((Size == 1 || Size == 2) &&
+ "Unsupported size for EmitAtomicBinaryPartial.");
+
+ MachineFunction *MF = BB->getParent();
+ MachineRegisterInfo &RegInfo = MF->getRegInfo();
+ const TargetRegisterClass *RC = getRegClassFor(MVT::i32);
+ const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
+ DebugLoc dl = MI->getDebugLoc();
+
+ unsigned Dest = MI->getOperand(0).getReg();
+ unsigned Ptr = MI->getOperand(1).getReg();
+ unsigned Incr = MI->getOperand(2).getReg();
+
+ unsigned Addr = RegInfo.createVirtualRegister(RC);
+ unsigned Shift = RegInfo.createVirtualRegister(RC);
+ unsigned Mask = RegInfo.createVirtualRegister(RC);
+ unsigned Mask2 = RegInfo.createVirtualRegister(RC);
+ unsigned Newval = RegInfo.createVirtualRegister(RC);
+ unsigned Oldval = RegInfo.createVirtualRegister(RC);
+ unsigned Incr2 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp1 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp2 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp3 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp4 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp5 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp6 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp7 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp8 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp9 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp10 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp11 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp12 = RegInfo.createVirtualRegister(RC);
+
+ // insert new blocks after the current block
+ const BasicBlock *LLVM_BB = BB->getBasicBlock();
+ MachineBasicBlock *loopMBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineBasicBlock *exitMBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineFunction::iterator It = BB;
+ ++It;
+ MF->insert(It, loopMBB);
+ MF->insert(It, exitMBB);
+
+ // Transfer the remainder of BB and its successor edges to exitMBB.
+ exitMBB->splice(exitMBB->begin(), BB,
+ llvm::next(MachineBasicBlock::iterator(MI)),
+ BB->end());
+ exitMBB->transferSuccessorsAndUpdatePHIs(BB);
+
+ // thisMBB:
+ // addiu tmp1,$0,-4 # 0xfffffffc
+ // and addr,ptr,tmp1
+ // andi tmp2,ptr,3
+ // sll shift,tmp2,3
+ // ori tmp3,$0,255 # 0xff
+ // sll mask,tmp3,shift
+ // nor mask2,$0,mask
+ // andi tmp4,incr,255
+ // sll incr2,tmp4,shift
+ // sw incr2, fi(sp) // store incr2 to stack (when BinOpcode == 0)
+
+ // Note: for atomic.swap (when BinOpcode == 0), storing incr2 to stack before
+ // the loop and then loading it from stack in block loopMBB is necessary to
+ // prevent MachineLICM pass to hoist "or" instruction out of the block
+ // loopMBB.
+
+ int64_t MaskImm = (Size == 1) ? 255 : 65535;
+ BuildMI(BB, dl, TII->get(Mips::ADDiu), Tmp1).addReg(Mips::ZERO).addImm(-4);
+ BuildMI(BB, dl, TII->get(Mips::AND), Addr).addReg(Ptr).addReg(Tmp1);
+ BuildMI(BB, dl, TII->get(Mips::ANDi), Tmp2).addReg(Ptr).addImm(3);
+ BuildMI(BB, dl, TII->get(Mips::SLL), Shift).addReg(Tmp2).addImm(3);
+ BuildMI(BB, dl, TII->get(Mips::ORi), Tmp3).addReg(Mips::ZERO).addImm(MaskImm);
+ BuildMI(BB, dl, TII->get(Mips::SLL), Mask).addReg(Tmp3).addReg(Shift);
+ BuildMI(BB, dl, TII->get(Mips::NOR), Mask2).addReg(Mips::ZERO).addReg(Mask);
+ if (BinOpcode != Mips::SUBu) {
+ BuildMI(BB, dl, TII->get(Mips::ANDi), Tmp4).addReg(Incr).addImm(MaskImm);
+ BuildMI(BB, dl, TII->get(Mips::SLL), Incr2).addReg(Tmp4).addReg(Shift);
+ } else {
+ BuildMI(BB, dl, TII->get(Mips::SUBu), Tmp4).addReg(Mips::ZERO).addReg(Incr);
+ BuildMI(BB, dl, TII->get(Mips::ANDi), Tmp5).addReg(Tmp4).addImm(MaskImm);
+ BuildMI(BB, dl, TII->get(Mips::SLL), Incr2).addReg(Tmp5).addReg(Shift);
+ }
+
+ int fi = 0;
+ if (BinOpcode == 0 && !Nand) {
+ // Get or create a temporary stack location.
+ MipsFunctionInfo *MipsFI = MF->getInfo<MipsFunctionInfo>();
+ fi = MipsFI->getAtomicFrameIndex();
+ if (fi == -1) {
+ fi = MF->getFrameInfo()->CreateStackObject(Size, Size, false);
+ MipsFI->setAtomicFrameIndex(fi);
+ }
+
+ BuildMI(BB, dl, TII->get(Mips::SW))
+ .addReg(Incr2).addImm(0).addFrameIndex(fi);
+ }
+ BB->addSuccessor(loopMBB);
+
+ // loopMBB:
+ // ll oldval,0(addr)
+ // binop tmp7,oldval,incr2
+ // and newval,tmp7,mask
+ // and tmp8,oldval,mask2
+ // or tmp9,tmp8,newval
+ // sc tmp9,0(addr)
+ // beq tmp9,$0,loopMBB
+ BB = loopMBB;
+ BuildMI(BB, dl, TII->get(Mips::LL), Oldval).addImm(0).addReg(Addr);
+ if (Nand) {
+ // and tmp6, oldval, incr2
+ // nor tmp7, $0, tmp6
+ BuildMI(BB, dl, TII->get(Mips::AND), Tmp6).addReg(Oldval).addReg(Incr2);
+ BuildMI(BB, dl, TII->get(Mips::NOR), Tmp7).addReg(Mips::ZERO).addReg(Tmp6);
+ } else if (BinOpcode == Mips::SUBu) {
+ // addu tmp7, oldval, incr2
+ BuildMI(BB, dl, TII->get(Mips::ADDu), Tmp7).addReg(Oldval).addReg(Incr2);
+ } else if (BinOpcode) {
+ // <binop> tmp7, oldval, incr2
+ BuildMI(BB, dl, TII->get(BinOpcode), Tmp7).addReg(Oldval).addReg(Incr2);
+ } else {
+ // lw tmp6, fi(sp) // load incr2 from stack
+ // or tmp7, $zero, tmp6
+ BuildMI(BB, dl, TII->get(Mips::LW), Tmp6).addImm(0).addFrameIndex(fi);;
+ BuildMI(BB, dl, TII->get(Mips::OR), Tmp7).addReg(Mips::ZERO).addReg(Tmp6);
+ }
+ BuildMI(BB, dl, TII->get(Mips::AND), Newval).addReg(Tmp7).addReg(Mask);
+ BuildMI(BB, dl, TII->get(Mips::AND), Tmp8).addReg(Oldval).addReg(Mask2);
+ BuildMI(BB, dl, TII->get(Mips::OR), Tmp9).addReg(Tmp8).addReg(Newval);
+ BuildMI(BB, dl, TII->get(Mips::SC), Tmp9).addReg(Tmp9).addImm(0).addReg(Addr);
+ BuildMI(BB, dl, TII->get(Mips::BEQ))
+ .addReg(Tmp9).addReg(Mips::ZERO).addMBB(loopMBB);
+ BB->addSuccessor(loopMBB);
+ BB->addSuccessor(exitMBB);
+
+ // exitMBB:
+ // and tmp10,oldval,mask
+ // srl tmp11,tmp10,shift
+ // sll tmp12,tmp11,24
+ // sra dest,tmp12,24
+ BB = exitMBB;
+ int64_t ShiftImm = (Size == 1) ? 24 : 16;
+ // reverse order
+ BuildMI(*BB, BB->begin(), dl, TII->get(Mips::SRA), Dest)
+ .addReg(Tmp12).addImm(ShiftImm);
+ BuildMI(*BB, BB->begin(), dl, TII->get(Mips::SLL), Tmp12)
+ .addReg(Tmp11).addImm(ShiftImm);
+ BuildMI(*BB, BB->begin(), dl, TII->get(Mips::SRL), Tmp11)
+ .addReg(Tmp10).addReg(Shift);
+ BuildMI(*BB, BB->begin(), dl, TII->get(Mips::AND), Tmp10)
+ .addReg(Oldval).addReg(Mask);
+
+ MI->eraseFromParent(); // The instruction is gone now.
+
+ return BB;
+}
+
+MachineBasicBlock *
+MipsTargetLowering::EmitAtomicCmpSwap(MachineInstr *MI,
+ MachineBasicBlock *BB,
+ unsigned Size) const {
+ assert(Size == 4 && "Unsupported size for EmitAtomicCmpSwap.");
+
+ MachineFunction *MF = BB->getParent();
+ MachineRegisterInfo &RegInfo = MF->getRegInfo();
+ const TargetRegisterClass *RC = getRegClassFor(MVT::i32);
+ const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
+ DebugLoc dl = MI->getDebugLoc();
+
+ unsigned Dest = MI->getOperand(0).getReg();
+ unsigned Ptr = MI->getOperand(1).getReg();
+ unsigned Oldval = MI->getOperand(2).getReg();
+ unsigned Newval = MI->getOperand(3).getReg();
+
+ unsigned Tmp1 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp2 = RegInfo.createVirtualRegister(RC);
+
+ // insert new blocks after the current block
+ const BasicBlock *LLVM_BB = BB->getBasicBlock();
+ MachineBasicBlock *loop1MBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineBasicBlock *loop2MBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineBasicBlock *exitMBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineFunction::iterator It = BB;
+ ++It;
+ MF->insert(It, loop1MBB);
+ MF->insert(It, loop2MBB);
+ MF->insert(It, exitMBB);
+
+ // Transfer the remainder of BB and its successor edges to exitMBB.
+ exitMBB->splice(exitMBB->begin(), BB,
+ llvm::next(MachineBasicBlock::iterator(MI)),
+ BB->end());
+ exitMBB->transferSuccessorsAndUpdatePHIs(BB);
+
+ // Get or create a temporary stack location.
+ MipsFunctionInfo *MipsFI = MF->getInfo<MipsFunctionInfo>();
+ int fi = MipsFI->getAtomicFrameIndex();
+ if (fi == -1) {
+ fi = MF->getFrameInfo()->CreateStackObject(Size, Size, false);
+ MipsFI->setAtomicFrameIndex(fi);
+ }
+
+ // thisMBB:
+ // ...
+ // sw newval, fi(sp) // store newval to stack
+ // fallthrough --> loop1MBB
+
+ // Note: storing newval to stack before the loop and then loading it from
+ // stack in block loop2MBB is necessary to prevent MachineLICM pass to
+ // hoist "or" instruction out of the block loop2MBB.
+
+ BuildMI(BB, dl, TII->get(Mips::SW))
+ .addReg(Newval).addImm(0).addFrameIndex(fi);
+ BB->addSuccessor(loop1MBB);
+
+ // loop1MBB:
+ // ll dest, 0(ptr)
+ // bne dest, oldval, exitMBB
+ BB = loop1MBB;
+ BuildMI(BB, dl, TII->get(Mips::LL), Dest).addImm(0).addReg(Ptr);
+ BuildMI(BB, dl, TII->get(Mips::BNE))
+ .addReg(Dest).addReg(Oldval).addMBB(exitMBB);
+ BB->addSuccessor(exitMBB);
+ BB->addSuccessor(loop2MBB);
+
+ // loop2MBB:
+ // lw tmp2, fi(sp) // load newval from stack
+ // or tmp1, $0, tmp2
+ // sc tmp1, 0(ptr)
+ // beq tmp1, $0, loop1MBB
+ BB = loop2MBB;
+ BuildMI(BB, dl, TII->get(Mips::LW), Tmp2).addImm(0).addFrameIndex(fi);;
+ BuildMI(BB, dl, TII->get(Mips::OR), Tmp1).addReg(Mips::ZERO).addReg(Tmp2);
+ BuildMI(BB, dl, TII->get(Mips::SC), Tmp1).addReg(Tmp1).addImm(0).addReg(Ptr);
+ BuildMI(BB, dl, TII->get(Mips::BEQ))
+ .addReg(Tmp1).addReg(Mips::ZERO).addMBB(loop1MBB);
+ BB->addSuccessor(loop1MBB);
+ BB->addSuccessor(exitMBB);
+
+ MI->eraseFromParent(); // The instruction is gone now.
+
+ return BB;
+}
+
+MachineBasicBlock *
+MipsTargetLowering::EmitAtomicCmpSwapPartword(MachineInstr *MI,
+ MachineBasicBlock *BB,
+ unsigned Size) const {
+ assert((Size == 1 || Size == 2) &&
+ "Unsupported size for EmitAtomicCmpSwapPartial.");
+
+ MachineFunction *MF = BB->getParent();
+ MachineRegisterInfo &RegInfo = MF->getRegInfo();
+ const TargetRegisterClass *RC = getRegClassFor(MVT::i32);
+ const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
+ DebugLoc dl = MI->getDebugLoc();
+
+ unsigned Dest = MI->getOperand(0).getReg();
+ unsigned Ptr = MI->getOperand(1).getReg();
+ unsigned Oldval = MI->getOperand(2).getReg();
+ unsigned Newval = MI->getOperand(3).getReg();
+
+ unsigned Addr = RegInfo.createVirtualRegister(RC);
+ unsigned Shift = RegInfo.createVirtualRegister(RC);
+ unsigned Mask = RegInfo.createVirtualRegister(RC);
+ unsigned Mask2 = RegInfo.createVirtualRegister(RC);
+ unsigned Oldval2 = RegInfo.createVirtualRegister(RC);
+ unsigned Oldval3 = RegInfo.createVirtualRegister(RC);
+ unsigned Oldval4 = RegInfo.createVirtualRegister(RC);
+ unsigned Newval2 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp1 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp2 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp3 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp4 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp5 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp6 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp7 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp8 = RegInfo.createVirtualRegister(RC);
+ unsigned Tmp9 = RegInfo.createVirtualRegister(RC);
+
+ // insert new blocks after the current block
+ const BasicBlock *LLVM_BB = BB->getBasicBlock();
+ MachineBasicBlock *loop1MBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineBasicBlock *loop2MBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineBasicBlock *exitMBB = MF->CreateMachineBasicBlock(LLVM_BB);
+ MachineFunction::iterator It = BB;
+ ++It;
+ MF->insert(It, loop1MBB);
+ MF->insert(It, loop2MBB);
+ MF->insert(It, exitMBB);
+
+ // Transfer the remainder of BB and its successor edges to exitMBB.
+ exitMBB->splice(exitMBB->begin(), BB,
+ llvm::next(MachineBasicBlock::iterator(MI)),
+ BB->end());
+ exitMBB->transferSuccessorsAndUpdatePHIs(BB);
+
+ // thisMBB:
+ // addiu tmp1,$0,-4 # 0xfffffffc
+ // and addr,ptr,tmp1
+ // andi tmp2,ptr,3
+ // sll shift,tmp2,3
+ // ori tmp3,$0,255 # 0xff
+ // sll mask,tmp3,shift
+ // nor mask2,$0,mask
+ // andi tmp4,oldval,255
+ // sll oldval2,tmp4,shift
+ // andi tmp5,newval,255
+ // sll newval2,tmp5,shift
+ int64_t MaskImm = (Size == 1) ? 255 : 65535;
+ BuildMI(BB, dl, TII->get(Mips::ADDiu), Tmp1).addReg(Mips::ZERO).addImm(-4);
+ BuildMI(BB, dl, TII->get(Mips::AND), Addr).addReg(Ptr).addReg(Tmp1);
+ BuildMI(BB, dl, TII->get(Mips::ANDi), Tmp2).addReg(Ptr).addImm(3);
+ BuildMI(BB, dl, TII->get(Mips::SLL), Shift).addReg(Tmp2).addImm(3);
+ BuildMI(BB, dl, TII->get(Mips::ORi), Tmp3).addReg(Mips::ZERO).addImm(MaskImm);
+ BuildMI(BB, dl, TII->get(Mips::SLL), Mask).addReg(Tmp3).addReg(Shift);
+ BuildMI(BB, dl, TII->get(Mips::NOR), Mask2).addReg(Mips::ZERO).addReg(Mask);
+ BuildMI(BB, dl, TII->get(Mips::ANDi), Tmp4).addReg(Oldval).addImm(MaskImm);
+ BuildMI(BB, dl, TII->get(Mips::SLL), Oldval2).addReg(Tmp4).addReg(Shift);
+ BuildMI(BB, dl, TII->get(Mips::ANDi), Tmp5).addReg(Newval).addImm(MaskImm);
+ BuildMI(BB, dl, TII->get(Mips::SLL), Newval2).addReg(Tmp5).addReg(Shift);
+ BB->addSuccessor(loop1MBB);
+
+ // loop1MBB:
+ // ll oldval3,0(addr)
+ // and oldval4,oldval3,mask
+ // bne oldval4,oldval2,exitMBB
+ BB = loop1MBB;
+ BuildMI(BB, dl, TII->get(Mips::LL), Oldval3).addImm(0).addReg(Addr);
+ BuildMI(BB, dl, TII->get(Mips::AND), Oldval4).addReg(Oldval3).addReg(Mask);
+ BuildMI(BB, dl, TII->get(Mips::BNE))
+ .addReg(Oldval4).addReg(Oldval2).addMBB(exitMBB);
+ BB->addSuccessor(exitMBB);
+ BB->addSuccessor(loop2MBB);
+
+ // loop2MBB:
+ // and tmp6,oldval3,mask2
+ // or tmp7,tmp6,newval2
+ // sc tmp7,0(addr)
+ // beq tmp7,$0,loop1MBB
+ BB = loop2MBB;
+ BuildMI(BB, dl, TII->get(Mips::AND), Tmp6).addReg(Oldval3).addReg(Mask2);
+ BuildMI(BB, dl, TII->get(Mips::OR), Tmp7).addReg(Tmp6).addReg(Newval2);
+ BuildMI(BB, dl, TII->get(Mips::SC), Tmp7)
+ .addReg(Tmp7).addImm(0).addReg(Addr);
+ BuildMI(BB, dl, TII->get(Mips::BEQ))
+ .addReg(Tmp7).addReg(Mips::ZERO).addMBB(loop1MBB);
+ BB->addSuccessor(loop1MBB);
+ BB->addSuccessor(exitMBB);
+
+ // exitMBB:
+ // srl tmp8,oldval4,shift
+ // sll tmp9,tmp8,24
+ // sra dest,tmp9,24
+ BB = exitMBB;
+ int64_t ShiftImm = (Size == 1) ? 24 : 16;
+ // reverse order
+ BuildMI(*BB, BB->begin(), dl, TII->get(Mips::SRA), Dest)
+ .addReg(Tmp9).addImm(ShiftImm);
+ BuildMI(*BB, BB->begin(), dl, TII->get(Mips::SLL), Tmp9)
+ .addReg(Tmp8).addImm(ShiftImm);
+ BuildMI(*BB, BB->begin(), dl, TII->get(Mips::SRL), Tmp8)
+ .addReg(Oldval4).addReg(Shift);
+
+ MI->eraseFromParent(); // The instruction is gone now.
+
+ return BB;
+}
+
+//===----------------------------------------------------------------------===//
+// Misc Lower Operation implementation
+//===----------------------------------------------------------------------===//
SDValue MipsTargetLowering::
LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const
{
+ unsigned StackAlignment =
+ getTargetMachine().getFrameLowering()->getStackAlignment();
+ assert(StackAlignment >=
+ cast<ConstantSDNode>(Op.getOperand(2).getNode())->getZExtValue() &&
+ "Cannot lower if the alignment of the allocated space is larger than \
+ that of the stack.");
+
SDValue Chain = Op.getOperand(0);
SDValue Size = Op.getOperand(1);
DebugLoc dl = Op.getDebugLoc();
@@ -706,11 +1209,25 @@ LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const
// The Sub result contains the new stack start address, so it
// must be placed in the stack pointer register.
- Chain = DAG.getCopyToReg(StackPointer.getValue(1), dl, Mips::SP, Sub);
+ Chain = DAG.getCopyToReg(StackPointer.getValue(1), dl, Mips::SP, Sub,
+ SDValue());
+ // Retrieve updated $sp. There is a glue input to prevent instructions that
+ // clobber $sp from being inserted between copytoreg and copyfromreg.
+ SDValue NewSP = DAG.getCopyFromReg(Chain, dl, Mips::SP, MVT::i32,
+ Chain.getValue(1));
+
+ // The stack space reserved by alloca is located right above the argument
+ // area. It is aligned on a boundary that is a multiple of StackAlignment.
+ MachineFunction &MF = DAG.getMachineFunction();
+ MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
+ unsigned SPOffset = (MipsFI->getMaxCallFrameSize() + StackAlignment - 1) /
+ StackAlignment * StackAlignment;
+ SDValue AllocPtr = DAG.getNode(ISD::ADD, dl, MVT::i32, NewSP,
+ DAG.getConstant(SPOffset, MVT::i32));
// This node always has two return values: a new stack pointer
// value and a chain
- SDValue Ops[2] = { Sub, Chain };
+ SDValue Ops[2] = { AllocPtr, NewSP.getValue(1) };
return DAG.getMergeValues(Ops, 2, dl);
}
@@ -778,25 +1295,23 @@ SDValue MipsTargetLowering::LowerGlobalAddress(SDValue Op,
SDValue HiPart = DAG.getNode(MipsISD::Hi, dl, VTs, &GAHi, 1);
SDValue Lo = DAG.getNode(MipsISD::Lo, dl, MVT::i32, GALo);
return DAG.getNode(ISD::ADD, dl, MVT::i32, HiPart, Lo);
- } else {
- SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0,
- MipsII::MO_GOT);
- SDValue ResNode = DAG.getLoad(MVT::i32, dl,
- DAG.getEntryNode(), GA, MachinePointerInfo(),
- false, false, 0);
- // On functions and global targets not internal linked only
- // a load from got/GP is necessary for PIC to work.
- if (!GV->hasInternalLinkage() &&
- (!GV->hasLocalLinkage() || isa<Function>(GV)))
- return ResNode;
- SDValue GALo = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0,
- MipsII::MO_ABS_LO);
- SDValue Lo = DAG.getNode(MipsISD::Lo, dl, MVT::i32, GALo);
- return DAG.getNode(ISD::ADD, dl, MVT::i32, ResNode, Lo);
}
- llvm_unreachable("Dont know how to handle GlobalAddress");
- return SDValue(0,0);
+ SDValue GA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0,
+ MipsII::MO_GOT);
+ GA = DAG.getNode(MipsISD::WrapperPIC, dl, MVT::i32, GA);
+ SDValue ResNode = DAG.getLoad(MVT::i32, dl,
+ DAG.getEntryNode(), GA, MachinePointerInfo(),
+ false, false, 0);
+ // On functions and global targets not internal linked only
+ // a load from got/GP is necessary for PIC to work.
+ if (!GV->hasInternalLinkage() &&
+ (!GV->hasLocalLinkage() || isa<Function>(GV)))
+ return ResNode;
+ SDValue GALo = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0,
+ MipsII::MO_ABS_LO);
+ SDValue Lo = DAG.getNode(MipsISD::Lo, dl, MVT::i32, GALo);
+ return DAG.getNode(ISD::ADD, dl, MVT::i32, ResNode, Lo);
}
SDValue MipsTargetLowering::LowerBlockAddress(SDValue Op,
@@ -818,6 +1333,7 @@ SDValue MipsTargetLowering::LowerBlockAddress(SDValue Op,
SDValue BAGOTOffset = DAG.getBlockAddress(BA, MVT::i32, true,
MipsII::MO_GOT);
+ BAGOTOffset = DAG.getNode(MipsISD::WrapperPIC, dl, MVT::i32, BAGOTOffset);
SDValue BALOOffset = DAG.getBlockAddress(BA, MVT::i32, true,
MipsII::MO_ABS_LO);
SDValue Load = DAG.getLoad(MVT::i32, dl,
@@ -830,8 +1346,60 @@ SDValue MipsTargetLowering::LowerBlockAddress(SDValue Op,
SDValue MipsTargetLowering::
LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const
{
- llvm_unreachable("TLS not implemented for MIPS.");
- return SDValue(); // Not reached
+ // If the relocation model is PIC, use the General Dynamic TLS Model,
+ // otherwise use the Initial Exec or Local Exec TLS Model.
+ // TODO: implement Local Dynamic TLS model
+
+ GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
+ DebugLoc dl = GA->getDebugLoc();
+ const GlobalValue *GV = GA->getGlobal();
+ EVT PtrVT = getPointerTy();
+
+ if (getTargetMachine().getRelocationModel() == Reloc::PIC_) {
+ // General Dynamic TLS Model
+ SDValue TGA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32,
+ 0, MipsII::MO_TLSGD);
+ SDValue Tlsgd = DAG.getNode(MipsISD::TlsGd, dl, MVT::i32, TGA);
+ SDValue GP = DAG.getRegister(Mips::GP, MVT::i32);
+ SDValue Argument = DAG.getNode(ISD::ADD, dl, MVT::i32, GP, Tlsgd);
+
+ ArgListTy Args;
+ ArgListEntry Entry;
+ Entry.Node = Argument;
+ Entry.Ty = (const Type *) Type::getInt32Ty(*DAG.getContext());
+ Args.push_back(Entry);
+ std::pair<SDValue, SDValue> CallResult =
+ LowerCallTo(DAG.getEntryNode(),
+ (const Type *) Type::getInt32Ty(*DAG.getContext()),
+ false, false, false, false,
+ 0, CallingConv::C, false, true,
+ DAG.getExternalSymbol("__tls_get_addr", PtrVT), Args, DAG, dl);
+
+ return CallResult.first;
+ } else {
+ SDValue Offset;
+ if (GV->isDeclaration()) {
+ // Initial Exec TLS Model
+ SDValue TGA = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0,
+ MipsII::MO_GOTTPREL);
+ Offset = DAG.getLoad(MVT::i32, dl,
+ DAG.getEntryNode(), TGA, MachinePointerInfo(),
+ false, false, 0);
+ } else {
+ // Local Exec TLS Model
+ SDVTList VTs = DAG.getVTList(MVT::i32);
+ SDValue TGAHi = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0,
+ MipsII::MO_TPREL_HI);
+ SDValue TGALo = DAG.getTargetGlobalAddress(GV, dl, MVT::i32, 0,
+ MipsII::MO_TPREL_LO);
+ SDValue Hi = DAG.getNode(MipsISD::TprelHi, dl, VTs, &TGAHi, 1);
+ SDValue Lo = DAG.getNode(MipsISD::TprelLo, dl, MVT::i32, TGALo);
+ Offset = DAG.getNode(ISD::ADD, dl, MVT::i32, Hi, Lo);
+ }
+
+ SDValue ThreadPointer = DAG.getNode(MipsISD::ThreadPointer, dl, PtrVT);
+ return DAG.getNode(ISD::ADD, dl, PtrVT, ThreadPointer, Offset);
+ }
}
SDValue MipsTargetLowering::
@@ -852,10 +1420,12 @@ LowerJumpTable(SDValue Op, SelectionDAG &DAG) const
if (!IsPIC) {
SDValue Ops[] = { JTI };
HiPart = DAG.getNode(MipsISD::Hi, dl, DAG.getVTList(MVT::i32), Ops, 1);
- } else // Emit Load from Global Pointer
+ } else {// Emit Load from Global Pointer
+ JTI = DAG.getNode(MipsISD::WrapperPIC, dl, MVT::i32, JTI);
HiPart = DAG.getLoad(MVT::i32, dl, DAG.getEntryNode(), JTI,
MachinePointerInfo(),
false, false, 0);
+ }
SDValue JTILo = DAG.getTargetJumpTable(JT->getIndex(), PtrVT,
MipsII::MO_ABS_LO);
@@ -895,6 +1465,7 @@ LowerConstantPool(SDValue Op, SelectionDAG &DAG) const
} else {
SDValue CP = DAG.getTargetConstantPool(C, MVT::i32, N->getAlignment(),
N->getOffset(), MipsII::MO_GOT);
+ CP = DAG.getNode(MipsISD::WrapperPIC, dl, MVT::i32, CP);
SDValue Load = DAG.getLoad(MVT::i32, dl, DAG.getEntryNode(),
CP, MachinePointerInfo::getConstantPool(),
false, false, 0);
@@ -923,6 +1494,74 @@ SDValue MipsTargetLowering::LowerVASTART(SDValue Op, SelectionDAG &DAG) const {
false, false, 0);
}
+static SDValue LowerFCOPYSIGN32(SDValue Op, SelectionDAG &DAG) {
+ // FIXME: Use ext/ins instructions if target architecture is Mips32r2.
+ DebugLoc dl = Op.getDebugLoc();
+ SDValue Op0 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, Op.getOperand(0));
+ SDValue Op1 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, Op.getOperand(1));
+ SDValue And0 = DAG.getNode(ISD::AND, dl, MVT::i32, Op0,
+ DAG.getConstant(0x7fffffff, MVT::i32));
+ SDValue And1 = DAG.getNode(ISD::AND, dl, MVT::i32, Op1,
+ DAG.getConstant(0x80000000, MVT::i32));
+ SDValue Result = DAG.getNode(ISD::OR, dl, MVT::i32, And0, And1);
+ return DAG.getNode(ISD::BITCAST, dl, MVT::f32, Result);
+}
+
+static SDValue LowerFCOPYSIGN64(SDValue Op, SelectionDAG &DAG, bool isLittle) {
+ // FIXME:
+ // Use ext/ins instructions if target architecture is Mips32r2.
+ // Eliminate redundant mfc1 and mtc1 instructions.
+ unsigned LoIdx = 0, HiIdx = 1;
+
+ if (!isLittle)
+ std::swap(LoIdx, HiIdx);
+
+ DebugLoc dl = Op.getDebugLoc();
+ SDValue Word0 = DAG.getNode(MipsISD::ExtractElementF64, dl, MVT::i32,
+ Op.getOperand(0),
+ DAG.getConstant(LoIdx, MVT::i32));
+ SDValue Hi0 = DAG.getNode(MipsISD::ExtractElementF64, dl, MVT::i32,
+ Op.getOperand(0), DAG.getConstant(HiIdx, MVT::i32));
+ SDValue Hi1 = DAG.getNode(MipsISD::ExtractElementF64, dl, MVT::i32,
+ Op.getOperand(1), DAG.getConstant(HiIdx, MVT::i32));
+ SDValue And0 = DAG.getNode(ISD::AND, dl, MVT::i32, Hi0,
+ DAG.getConstant(0x7fffffff, MVT::i32));
+ SDValue And1 = DAG.getNode(ISD::AND, dl, MVT::i32, Hi1,
+ DAG.getConstant(0x80000000, MVT::i32));
+ SDValue Word1 = DAG.getNode(ISD::OR, dl, MVT::i32, And0, And1);
+
+ if (!isLittle)
+ std::swap(Word0, Word1);
+
+ return DAG.getNode(MipsISD::BuildPairF64, dl, MVT::f64, Word0, Word1);
+}
+
+SDValue MipsTargetLowering::LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG)
+ const {
+ EVT Ty = Op.getValueType();
+
+ assert(Ty == MVT::f32 || Ty == MVT::f64);
+
+ if (Ty == MVT::f32)
+ return LowerFCOPYSIGN32(Op, DAG);
+ else
+ return LowerFCOPYSIGN64(Op, DAG, Subtarget->isLittle());
+}
+
+SDValue MipsTargetLowering::
+LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const {
+ unsigned Depth = cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue();
+ assert((Depth == 0) &&
+ "Frame address can only be determined for current frame.");
+
+ MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
+ MFI->setFrameAddressIsTaken(true);
+ EVT VT = Op.getValueType();
+ DebugLoc dl = Op.getDebugLoc();
+ SDValue FrameAddr = DAG.getCopyFromReg(DAG.getEntryNode(), dl, Mips::FP, VT);
+ return FrameAddr;
+}
+
//===----------------------------------------------------------------------===//
// Calling Convention Implementation
//===----------------------------------------------------------------------===//
@@ -940,6 +1579,8 @@ SDValue MipsTargetLowering::LowerVASTART(SDValue Op, SelectionDAG &DAG) const {
// yet to hold an argument. Otherwise, use A2, A3 and stack. If A1 is
// not used, it must be shadowed. If only A3 is avaiable, shadow it and
// go to stack.
+//
+// For vararg functions, all arguments are passed in A0, A1, A2, A3 and stack.
//===----------------------------------------------------------------------===//
static bool CC_MipsO32(unsigned ValNo, MVT ValVT,
@@ -958,90 +1599,17 @@ static bool CC_MipsO32(unsigned ValNo, MVT ValVT,
Mips::D6, Mips::D7
};
- unsigned Reg = 0;
- static bool IntRegUsed = false;
-
- // This must be the first arg of the call if no regs have been allocated.
- // Initialize IntRegUsed in that case.
- if (IntRegs[State.getFirstUnallocated(IntRegs, IntRegsSize)] == Mips::A0 &&
- F32Regs[State.getFirstUnallocated(F32Regs, FloatRegsSize)] == Mips::F12 &&
- F64Regs[State.getFirstUnallocated(F64Regs, FloatRegsSize)] == Mips::D6)
- IntRegUsed = false;
-
- // Promote i8 and i16
- if (LocVT == MVT::i8 || LocVT == MVT::i16) {
- LocVT = MVT::i32;
- if (ArgFlags.isSExt())
- LocInfo = CCValAssign::SExt;
- else if (ArgFlags.isZExt())
- LocInfo = CCValAssign::ZExt;
- else
- LocInfo = CCValAssign::AExt;
+ // ByVal Args
+ if (ArgFlags.isByVal()) {
+ State.HandleByVal(ValNo, ValVT, LocVT, LocInfo,
+ 1 /*MinSize*/, 4 /*MinAlign*/, ArgFlags);
+ unsigned NextReg = (State.getNextStackOffset() + 3) / 4;
+ for (unsigned r = State.getFirstUnallocated(IntRegs, IntRegsSize);
+ r < std::min(IntRegsSize, NextReg); ++r)
+ State.AllocateReg(IntRegs[r]);
+ return false;
}
- if (ValVT == MVT::i32) {
- Reg = State.AllocateReg(IntRegs, IntRegsSize);
- IntRegUsed = true;
- } else if (ValVT == MVT::f32) {
- // An int reg has to be marked allocated regardless of whether or not
- // IntRegUsed is true.
- Reg = State.AllocateReg(IntRegs, IntRegsSize);
-
- if (IntRegUsed) {
- if (Reg) // Int reg is available
- LocVT = MVT::i32;
- } else {
- unsigned FReg = State.AllocateReg(F32Regs, FloatRegsSize);
- if (FReg) // F32 reg is available
- Reg = FReg;
- else if (Reg) // No F32 regs are available, but an int reg is available.
- LocVT = MVT::i32;
- }
- } else if (ValVT == MVT::f64) {
- // Int regs have to be marked allocated regardless of whether or not
- // IntRegUsed is true.
- Reg = State.AllocateReg(IntRegs, IntRegsSize);
- if (Reg == Mips::A1)
- Reg = State.AllocateReg(IntRegs, IntRegsSize);
- else if (Reg == Mips::A3)
- Reg = 0;
- State.AllocateReg(IntRegs, IntRegsSize);
-
- // At this point, Reg is A0, A2 or 0, and all the unavailable integer regs
- // are marked as allocated.
- if (IntRegUsed) {
- if (Reg)// if int reg is available
- LocVT = MVT::i32;
- } else {
- unsigned FReg = State.AllocateReg(F64Regs, FloatRegsSize);
- if (FReg) // F64 reg is available.
- Reg = FReg;
- else if (Reg) // No F64 regs are available, but an int reg is available.
- LocVT = MVT::i32;
- }
- } else
- assert(false && "cannot handle this ValVT");
-
- if (!Reg) {
- unsigned SizeInBytes = ValVT.getSizeInBits() >> 3;
- unsigned Offset = State.AllocateStack(SizeInBytes, SizeInBytes);
- State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
- } else
- State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
-
- return false; // CC must always match
-}
-
-static bool CC_MipsO32_VarArgs(unsigned ValNo, MVT ValVT,
- MVT LocVT, CCValAssign::LocInfo LocInfo,
- ISD::ArgFlagsTy ArgFlags, CCState &State) {
-
- static const unsigned IntRegsSize=4;
-
- static const unsigned IntRegs[] = {
- Mips::A0, Mips::A1, Mips::A2, Mips::A3
- };
-
// Promote i8 and i16
if (LocVT == MVT::i8 || LocVT == MVT::i16) {
LocVT = MVT::i32;
@@ -1055,23 +1623,52 @@ static bool CC_MipsO32_VarArgs(unsigned ValNo, MVT ValVT,
unsigned Reg;
- if (ValVT == MVT::i32 || ValVT == MVT::f32) {
+ // f32 and f64 are allocated in A0, A1, A2, A3 when either of the following
+ // is true: function is vararg, argument is 3rd or higher, there is previous
+ // argument which is not f32 or f64.
+ bool AllocateFloatsInIntReg = State.isVarArg() || ValNo > 1
+ || State.getFirstUnallocated(F32Regs, FloatRegsSize) != ValNo;
+ unsigned OrigAlign = ArgFlags.getOrigAlign();
+ bool isI64 = (ValVT == MVT::i32 && OrigAlign == 8);
+
+ if (ValVT == MVT::i32 || (ValVT == MVT::f32 && AllocateFloatsInIntReg)) {
Reg = State.AllocateReg(IntRegs, IntRegsSize);
+ // If this is the first part of an i64 arg,
+ // the allocated register must be either A0 or A2.
+ if (isI64 && (Reg == Mips::A1 || Reg == Mips::A3))
+ Reg = State.AllocateReg(IntRegs, IntRegsSize);
LocVT = MVT::i32;
- } else if (ValVT == MVT::f64) {
+ } else if (ValVT == MVT::f64 && AllocateFloatsInIntReg) {
+ // Allocate int register and shadow next int register. If first
+ // available register is Mips::A1 or Mips::A3, shadow it too.
Reg = State.AllocateReg(IntRegs, IntRegsSize);
if (Reg == Mips::A1 || Reg == Mips::A3)
Reg = State.AllocateReg(IntRegs, IntRegsSize);
State.AllocateReg(IntRegs, IntRegsSize);
LocVT = MVT::i32;
+ } else if (ValVT.isFloatingPoint() && !AllocateFloatsInIntReg) {
+ // we are guaranteed to find an available float register
+ if (ValVT == MVT::f32) {
+ Reg = State.AllocateReg(F32Regs, FloatRegsSize);
+ // Shadow int register
+ State.AllocateReg(IntRegs, IntRegsSize);
+ } else {
+ Reg = State.AllocateReg(F64Regs, FloatRegsSize);
+ // Shadow int registers
+ unsigned Reg2 = State.AllocateReg(IntRegs, IntRegsSize);
+ if (Reg2 == Mips::A1 || Reg2 == Mips::A3)
+ State.AllocateReg(IntRegs, IntRegsSize);
+ State.AllocateReg(IntRegs, IntRegsSize);
+ }
} else
llvm_unreachable("Cannot handle this ValVT.");
- if (!Reg) {
- unsigned SizeInBytes = ValVT.getSizeInBits() >> 3;
- unsigned Offset = State.AllocateStack(SizeInBytes, SizeInBytes);
+ unsigned SizeInBytes = ValVT.getSizeInBits() >> 3;
+ unsigned Offset = State.AllocateStack(SizeInBytes, OrigAlign);
+
+ if (!Reg)
State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
- } else
+ else
State.addLoc(CCValAssign::getReg(ValNo, ValVT, Reg, LocVT, LocInfo));
return false; // CC must always match
@@ -1081,6 +1678,56 @@ static bool CC_MipsO32_VarArgs(unsigned ValNo, MVT ValVT,
// Call Calling Convention Implementation
//===----------------------------------------------------------------------===//
+static const unsigned O32IntRegsSize = 4;
+
+static const unsigned O32IntRegs[] = {
+ Mips::A0, Mips::A1, Mips::A2, Mips::A3
+};
+
+// Write ByVal Arg to arg registers and stack.
+static void
+WriteByValArg(SDValue& Chain, DebugLoc dl,
+ SmallVector<std::pair<unsigned, SDValue>, 16>& RegsToPass,
+ SmallVector<SDValue, 8>& MemOpChains, int& LastFI,
+ MachineFrameInfo *MFI, SelectionDAG &DAG, SDValue Arg,
+ const CCValAssign &VA, const ISD::ArgFlagsTy& Flags,
+ MVT PtrType) {
+ unsigned FirstWord = VA.getLocMemOffset() / 4;
+ unsigned NumWords = (Flags.getByValSize() + 3) / 4;
+ unsigned LastWord = FirstWord + NumWords;
+ unsigned CurWord;
+
+ // copy the first 4 words of byval arg to registers A0 - A3
+ for (CurWord = FirstWord; CurWord < std::min(LastWord, O32IntRegsSize);
+ ++CurWord) {
+ SDValue LoadPtr = DAG.getNode(ISD::ADD, dl, MVT::i32, Arg,
+ DAG.getConstant((CurWord - FirstWord) * 4,
+ MVT::i32));
+ SDValue LoadVal = DAG.getLoad(MVT::i32, dl, Chain, LoadPtr,
+ MachinePointerInfo(),
+ false, false, 0);
+ MemOpChains.push_back(LoadVal.getValue(1));
+ unsigned DstReg = O32IntRegs[CurWord];
+ RegsToPass.push_back(std::make_pair(DstReg, LoadVal));
+ }
+
+ // copy remaining part of byval arg to stack.
+ if (CurWord < LastWord) {
+ unsigned SizeInBytes = (LastWord - CurWord) * 4;
+ SDValue Src = DAG.getNode(ISD::ADD, dl, MVT::i32, Arg,
+ DAG.getConstant((CurWord - FirstWord) * 4,
+ MVT::i32));
+ LastFI = MFI->CreateFixedObject(SizeInBytes, CurWord * 4, true);
+ SDValue Dst = DAG.getFrameIndex(LastFI, PtrType);
+ Chain = DAG.getMemcpy(Chain, dl, Dst, Src,
+ DAG.getConstant(SizeInBytes, MVT::i32),
+ /*Align*/4,
+ /*isVolatile=*/false, /*AlwaysInline=*/false,
+ MachinePointerInfo(0), MachinePointerInfo(0));
+ MemOpChains.push_back(Chain);
+ }
+}
+
/// LowerCall - functions arguments are copied from virtual regs to
/// (physical regs)/(stack frame), CALLSEQ_START and CALLSEQ_END are emitted.
/// TODO: isTailCall.
@@ -1098,35 +1745,57 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
MachineFunction &MF = DAG.getMachineFunction();
MachineFrameInfo *MFI = MF.getFrameInfo();
+ const TargetFrameLowering *TFL = MF.getTarget().getFrameLowering();
bool IsPIC = getTargetMachine().getRelocationModel() == Reloc::PIC_;
+ MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
- *DAG.getContext());
-
- // To meet O32 ABI, Mips must always allocate 16 bytes on
- // the stack (even if less than 4 are used as arguments)
- if (Subtarget->isABI_O32()) {
- int VTsize = MVT(MVT::i32).getSizeInBits()/8;
- MFI->CreateFixedObject(VTsize, (VTsize*3), true);
- CCInfo.AnalyzeCallOperands(Outs,
- isVarArg ? CC_MipsO32_VarArgs : CC_MipsO32);
- } else
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
+
+ if (Subtarget->isABI_O32())
+ CCInfo.AnalyzeCallOperands(Outs, CC_MipsO32);
+ else
CCInfo.AnalyzeCallOperands(Outs, CC_Mips);
// Get a count of how many bytes are to be pushed on the stack.
- unsigned NumBytes = CCInfo.getNextStackOffset();
- Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes, true));
+ unsigned NextStackOffset = CCInfo.getNextStackOffset();
+
+ Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NextStackOffset,
+ true));
+
+ // If this is the first call, create a stack frame object that points to
+ // a location to which .cprestore saves $gp.
+ if (IsPIC && !MipsFI->getGPFI())
+ MipsFI->setGPFI(MFI->CreateFixedObject(4, 0, true));
+
+ // Update size of the maximum argument space.
+ // For O32, a minimum of four words (16 bytes) of argument space is
+ // allocated.
+ if (Subtarget->isABI_O32())
+ NextStackOffset = std::max(NextStackOffset, (unsigned)16);
+
+ unsigned MaxCallFrameSize = MipsFI->getMaxCallFrameSize();
+
+ if (MaxCallFrameSize < NextStackOffset) {
+ MipsFI->setMaxCallFrameSize(NextStackOffset);
+
+ if (IsPIC) {
+ // $gp restore slot must be aligned.
+ unsigned StackAlignment = TFL->getStackAlignment();
+ NextStackOffset = (NextStackOffset + StackAlignment - 1) /
+ StackAlignment * StackAlignment;
+ int GPFI = MipsFI->getGPFI();
+ MFI->setObjectOffset(GPFI, NextStackOffset);
+ }
+ }
// With EABI is it possible to have 16 args on registers.
SmallVector<std::pair<unsigned, SDValue>, 16> RegsToPass;
SmallVector<SDValue, 8> MemOpChains;
- // First/LastArgStackLoc contains the first/last
- // "at stack" argument location.
- int LastArgStackLoc = 0;
- unsigned FirstStackArgLoc = (Subtarget->isABI_EABI() ? 0 : 16);
+ int FirstFI = -MFI->getNumFixedObjects() - 1, LastFI = 0;
// Walk the register/memloc assignments, inserting copies/loads.
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
@@ -1174,15 +1843,22 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Register can't get to this point...
assert(VA.isMemLoc());
- // Create the frame index object for this incoming parameter
- // This guarantees that when allocating Local Area the firsts
- // 16 bytes which are alwayes reserved won't be overwritten
- // if O32 ABI is used. For EABI the first address is zero.
- LastArgStackLoc = (FirstStackArgLoc + VA.getLocMemOffset());
- int FI = MFI->CreateFixedObject(VA.getValVT().getSizeInBits()/8,
- LastArgStackLoc, true);
+ // ByVal Arg.
+ ISD::ArgFlagsTy Flags = Outs[i].Flags;
+ if (Flags.isByVal()) {
+ assert(Subtarget->isABI_O32() &&
+ "No support for ByVal args by ABIs other than O32 yet.");
+ assert(Flags.getByValSize() &&
+ "ByVal args of size 0 should have been ignored by front-end.");
+ WriteByValArg(Chain, dl, RegsToPass, MemOpChains, LastFI, MFI, DAG, Arg,
+ VA, Flags, getPointerTy());
+ continue;
+ }
- SDValue PtrOff = DAG.getFrameIndex(FI,getPointerTy());
+ // Create the frame index object for this incoming parameter
+ LastFI = MFI->CreateFixedObject(VA.getValVT().getSizeInBits()/8,
+ VA.getLocMemOffset(), true);
+ SDValue PtrOff = DAG.getFrameIndex(LastFI, getPointerTy());
// emit ISD::STORE whichs stores the
// parameter value to a stack Location
@@ -1191,23 +1867,18 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
false, false, 0));
}
+ // Extend range of indices of frame objects for outgoing arguments that were
+ // created during this function call. Skip this step if no such objects were
+ // created.
+ if (LastFI)
+ MipsFI->extendOutArgFIRange(FirstFI, LastFI);
+
// Transform all store nodes into one single node because all store
// nodes are independent of each other.
if (!MemOpChains.empty())
Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
&MemOpChains[0], MemOpChains.size());
- // Build a sequence of copy-to-reg nodes chained together with token
- // chain and flag operands which copy the outgoing args into registers.
- // The InFlag in necessary since all emitted instructions must be
- // stuck together.
- SDValue InFlag;
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
- Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first,
- RegsToPass[i].second, InFlag);
- InFlag = Chain.getValue(1);
- }
-
// If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
// direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
// node so that legalize doesn't hack it.
@@ -1234,10 +1905,13 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
LoadSymAddr = true;
}
+ SDValue InFlag;
+
// Create nodes that load address of callee and copy it to T9
if (IsPIC) {
if (LoadSymAddr) {
// Load callee address
+ Callee = DAG.getNode(MipsISD::WrapperPIC, dl, MVT::i32, Callee);
SDValue LoadValue = DAG.getLoad(MVT::i32, dl, Chain, Callee,
MachinePointerInfo::getGOT(),
false, false, 0);
@@ -1249,7 +1923,7 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
} else
Callee = LoadValue;
- // Use chain output from LoadValue
+ // Use chain output from LoadValue
Chain = LoadValue.getValue(1);
}
@@ -1259,6 +1933,16 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
Callee = DAG.getRegister(Mips::T9, MVT::i32);
}
+ // Build a sequence of copy-to-reg nodes chained together with token
+ // chain and flag operands which copy the outgoing args into registers.
+ // The InFlag in necessary since all emitted instructions must be
+ // stuck together.
+ for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
+ Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first,
+ RegsToPass[i].second, InFlag);
+ InFlag = Chain.getValue(1);
+ }
+
// MipsJmpLink = #chain, #target_address, #opt_in_flags...
// = Chain, Callee, Reg#1, Reg#2, ...
//
@@ -1280,39 +1964,8 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
Chain = DAG.getNode(MipsISD::JmpLink, dl, NodeTys, &Ops[0], Ops.size());
InFlag = Chain.getValue(1);
- // Create a stack location to hold GP when PIC is used. This stack
- // location is used on function prologue to save GP and also after all
- // emitted CALL's to restore GP.
- if (IsPIC) {
- // Function can have an arbitrary number of calls, so
- // hold the LastArgStackLoc with the biggest offset.
- int FI;
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
- if (LastArgStackLoc >= MipsFI->getGPStackOffset()) {
- LastArgStackLoc = (!LastArgStackLoc) ? (16) : (LastArgStackLoc+4);
- // Create the frame index only once. SPOffset here can be anything
- // (this will be fixed on processFunctionBeforeFrameFinalized)
- if (MipsFI->getGPStackOffset() == -1) {
- FI = MFI->CreateFixedObject(4, 0, true);
- MipsFI->setGPFI(FI);
- }
- MipsFI->setGPStackOffset(LastArgStackLoc);
- }
-
- // Reload GP value.
- FI = MipsFI->getGPFI();
- SDValue FIN = DAG.getFrameIndex(FI, getPointerTy());
- SDValue GPLoad = DAG.getLoad(MVT::i32, dl, Chain, FIN,
- MachinePointerInfo::getFixedStack(FI),
- false, false, 0);
- Chain = GPLoad.getValue(1);
- Chain = DAG.getCopyToReg(Chain, dl, DAG.getRegister(Mips::GP, MVT::i32),
- GPLoad, SDValue(0,0));
- InFlag = Chain.getValue(1);
- }
-
// Create the CALLSEQ_END node.
- Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, true),
+ Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NextStackOffset, true),
DAG.getIntPtrConstant(0, true), InFlag);
InFlag = Chain.getValue(1);
@@ -1330,11 +1983,10 @@ MipsTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
const SmallVectorImpl<ISD::InputArg> &Ins,
DebugLoc dl, SelectionDAG &DAG,
SmallVectorImpl<SDValue> &InVals) const {
-
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_Mips);
@@ -1352,6 +2004,29 @@ MipsTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
//===----------------------------------------------------------------------===//
// Formal Arguments Calling Convention Implementation
//===----------------------------------------------------------------------===//
+static void ReadByValArg(MachineFunction &MF, SDValue Chain, DebugLoc dl,
+ std::vector<SDValue>& OutChains,
+ SelectionDAG &DAG, unsigned NumWords, SDValue FIN,
+ const CCValAssign &VA, const ISD::ArgFlagsTy& Flags) {
+ unsigned LocMem = VA.getLocMemOffset();
+ unsigned FirstWord = LocMem / 4;
+
+ // copy register A0 - A3 to frame object
+ for (unsigned i = 0; i < NumWords; ++i) {
+ unsigned CurWord = FirstWord + i;
+ if (CurWord >= O32IntRegsSize)
+ break;
+
+ unsigned SrcReg = O32IntRegs[CurWord];
+ unsigned Reg = AddLiveIn(MF, SrcReg, Mips::CPURegsRegisterClass);
+ SDValue StorePtr = DAG.getNode(ISD::ADD, dl, MVT::i32, FIN,
+ DAG.getConstant(i * 4, MVT::i32));
+ SDValue Store = DAG.getStore(Chain, dl, DAG.getRegister(Reg, MVT::i32),
+ StorePtr, MachinePointerInfo(), false,
+ false, 0);
+ OutChains.push_back(Store);
+ }
+}
/// LowerFormalArguments - transform physical registers into virtual registers
/// and generate load operations for arguments places on the stack.
@@ -1364,7 +2039,6 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
DebugLoc dl, SelectionDAG &DAG,
SmallVectorImpl<SDValue> &InVals)
const {
-
MachineFunction &MF = DAG.getMachineFunction();
MachineFrameInfo *MFI = MF.getFrameInfo();
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
@@ -1374,23 +2048,17 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
// Used with vargs to acumulate store chains.
std::vector<SDValue> OutChains;
- // Keep track of the last register used for arguments
- unsigned ArgRegEnd = 0;
-
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
if (Subtarget->isABI_O32())
- CCInfo.AnalyzeFormalArguments(Ins,
- isVarArg ? CC_MipsO32_VarArgs : CC_MipsO32);
+ CCInfo.AnalyzeFormalArguments(Ins, CC_MipsO32);
else
CCInfo.AnalyzeFormalArguments(Ins, CC_Mips);
- unsigned FirstStackArgLoc = (Subtarget->isABI_EABI() ? 0 : 16);
- unsigned LastStackArgEndOffset = 0;
- EVT LastRegArgValVT;
+ int LastFI = 0;// MipsFI->LastInArgFI is 0 at the entry of this function.
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
CCValAssign &VA = ArgLocs[i];
@@ -1398,8 +2066,7 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
// Arguments stored on registers
if (VA.isRegLoc()) {
EVT RegVT = VA.getLocVT();
- ArgRegEnd = VA.getLocReg();
- LastRegArgValVT = VA.getValVT();
+ unsigned ArgReg = VA.getLocReg();
TargetRegisterClass *RC = 0;
if (RegVT == MVT::i32)
@@ -1414,7 +2081,7 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
// Transform the arguments stored on
// physical registers into virtual ones
- unsigned Reg = AddLiveIn(DAG.getMachineFunction(), ArgRegEnd, RC);
+ unsigned Reg = AddLiveIn(DAG.getMachineFunction(), ArgReg, RC);
SDValue ArgValue = DAG.getCopyFromReg(Chain, dl, Reg, RegVT);
// If this is an 8 or 16-bit value, it has been passed promoted
@@ -1453,26 +2120,31 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
// sanity check
assert(VA.isMemLoc());
- // The last argument is not a register anymore
- ArgRegEnd = 0;
+ ISD::ArgFlagsTy Flags = Ins[i].Flags;
+
+ if (Flags.isByVal()) {
+ assert(Subtarget->isABI_O32() &&
+ "No support for ByVal args by ABIs other than O32 yet.");
+ assert(Flags.getByValSize() &&
+ "ByVal args of size 0 should have been ignored by front-end.");
+ unsigned NumWords = (Flags.getByValSize() + 3) / 4;
+ LastFI = MFI->CreateFixedObject(NumWords * 4, VA.getLocMemOffset(),
+ true);
+ SDValue FIN = DAG.getFrameIndex(LastFI, getPointerTy());
+ InVals.push_back(FIN);
+ ReadByValArg(MF, Chain, dl, OutChains, DAG, NumWords, FIN, VA, Flags);
+
+ continue;
+ }
// The stack pointer offset is relative to the caller stack frame.
- // Since the real stack size is unknown here, a negative SPOffset
- // is used so there's a way to adjust these offsets when the stack
- // size get known (on EliminateFrameIndex). A dummy SPOffset is
- // used instead of a direct negative address (which is recorded to
- // be used on emitPrologue) to avoid mis-calc of the first stack
- // offset on PEI::calculateFrameObjectOffsets.
- unsigned ArgSize = VA.getValVT().getSizeInBits()/8;
- LastStackArgEndOffset = FirstStackArgLoc + VA.getLocMemOffset() + ArgSize;
- int FI = MFI->CreateFixedObject(ArgSize, 0, true);
- MipsFI->recordLoadArgsFI(FI, -(4 +
- (FirstStackArgLoc + VA.getLocMemOffset())));
+ LastFI = MFI->CreateFixedObject(VA.getValVT().getSizeInBits()/8,
+ VA.getLocMemOffset(), true);
// Create load nodes to retrieve arguments from the stack
- SDValue FIN = DAG.getFrameIndex(FI, getPointerTy());
+ SDValue FIN = DAG.getFrameIndex(LastFI, getPointerTy());
InVals.push_back(DAG.getLoad(VA.getValVT(), dl, Chain, FIN,
- MachinePointerInfo::getFixedStack(FI),
+ MachinePointerInfo::getFixedStack(LastFI),
false, false, 0));
}
}
@@ -1490,58 +2162,33 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Copy, Chain);
}
- // To meet ABI, when VARARGS are passed on registers, the registers
- // must have their values written to the caller stack frame. If the last
- // argument was placed in the stack, there's no need to save any register.
if (isVarArg && Subtarget->isABI_O32()) {
- if (ArgRegEnd) {
- // Last named formal argument is passed in register.
-
- // The last register argument that must be saved is Mips::A3
+ // Record the frame index of the first variable argument
+ // which is a value necessary to VASTART.
+ unsigned NextStackOffset = CCInfo.getNextStackOffset();
+ assert(NextStackOffset % 4 == 0 &&
+ "NextStackOffset must be aligned to 4-byte boundaries.");
+ LastFI = MFI->CreateFixedObject(4, NextStackOffset, true);
+ MipsFI->setVarArgsFrameIndex(LastFI);
+
+ // If NextStackOffset is smaller than o32's 16-byte reserved argument area,
+ // copy the integer registers that have not been used for argument passing
+ // to the caller's stack frame.
+ for (; NextStackOffset < 16; NextStackOffset += 4) {
TargetRegisterClass *RC = Mips::CPURegsRegisterClass;
- if (LastRegArgValVT == MVT::f64)
- ArgRegEnd++;
-
- if (ArgRegEnd < Mips::A3) {
- // Both the last named formal argument and the first variable
- // argument are passed in registers.
- for (++ArgRegEnd; ArgRegEnd <= Mips::A3; ++ArgRegEnd) {
- unsigned Reg = AddLiveIn(DAG.getMachineFunction(), ArgRegEnd, RC);
- SDValue ArgValue = DAG.getCopyFromReg(Chain, dl, Reg, MVT::i32);
-
- int FI = MFI->CreateFixedObject(4, 0, true);
- MipsFI->recordStoreVarArgsFI(FI, -(4+(ArgRegEnd-Mips::A0)*4));
- SDValue PtrOff = DAG.getFrameIndex(FI, getPointerTy());
- OutChains.push_back(DAG.getStore(Chain, dl, ArgValue, PtrOff,
- MachinePointerInfo(),
- false, false, 0));
-
- // Record the frame index of the first variable argument
- // which is a value necessary to VASTART.
- if (!MipsFI->getVarArgsFrameIndex()) {
- MFI->setObjectAlignment(FI, 4);
- MipsFI->setVarArgsFrameIndex(FI);
- }
- }
- } else {
- // Last named formal argument is in register Mips::A3, and the first
- // variable argument is on stack. Record the frame index of the first
- // variable argument.
- int FI = MFI->CreateFixedObject(4, 0, true);
- MFI->setObjectAlignment(FI, 4);
- MipsFI->recordStoreVarArgsFI(FI, -20);
- MipsFI->setVarArgsFrameIndex(FI);
- }
- } else {
- // Last named formal argument and all the variable arguments are passed
- // on stack. Record the frame index of the first variable argument.
- int FI = MFI->CreateFixedObject(4, 0, true);
- MFI->setObjectAlignment(FI, 4);
- MipsFI->recordStoreVarArgsFI(FI, -(4+LastStackArgEndOffset));
- MipsFI->setVarArgsFrameIndex(FI);
+ unsigned Idx = NextStackOffset / 4;
+ unsigned Reg = AddLiveIn(DAG.getMachineFunction(), O32IntRegs[Idx], RC);
+ SDValue ArgValue = DAG.getCopyFromReg(Chain, dl, Reg, MVT::i32);
+ LastFI = MFI->CreateFixedObject(4, NextStackOffset, true);
+ SDValue PtrOff = DAG.getFrameIndex(LastFI, getPointerTy());
+ OutChains.push_back(DAG.getStore(Chain, dl, ArgValue, PtrOff,
+ MachinePointerInfo(),
+ false, false, 0));
}
}
+ MipsFI->setLastInArgFI(LastFI);
+
// All stores are grouped in one node to allow the matching between
// the size of Ins and InVals. This only happens when on varg functions
if (!OutChains.empty()) {
@@ -1569,8 +2216,8 @@ MipsTargetLowering::LowerReturn(SDValue Chain,
SmallVector<CCValAssign, 16> RVLocs;
// CCState - Info about the registers and stack slot.
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
// Analize return values.
CCInfo.AnalyzeReturn(Outs, RetCC_Mips);
diff --git a/contrib/llvm/lib/Target/Mips/MipsISelLowering.h b/contrib/llvm/lib/Target/Mips/MipsISelLowering.h
index e4d0c3d..fbcedfd 100644
--- a/contrib/llvm/lib/Target/Mips/MipsISelLowering.h
+++ b/contrib/llvm/lib/Target/Mips/MipsISelLowering.h
@@ -40,6 +40,16 @@ namespace llvm {
// Handle gp_rel (small data/bss sections) relocation.
GPRel,
+ // General Dynamic TLS
+ TlsGd,
+
+ // Local Exec TLS
+ TprelHi,
+ TprelLo,
+
+ // Thread Pointer
+ ThreadPointer,
+
// Floating Point Branch Conditional
FPBrcond,
@@ -67,7 +77,9 @@ namespace llvm {
DivRemU,
BuildPairF64,
- ExtractElementF64
+ ExtractElementF64,
+
+ WrapperPIC
};
}
@@ -89,9 +101,6 @@ namespace llvm {
/// getSetCCResultType - get the ISD::SETCC result ValueType
MVT::SimpleValueType getSetCCResultType(EVT VT) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
private:
// Subtarget Info
@@ -109,13 +118,14 @@ namespace llvm {
SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
- SDValue LowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG) const;
+ SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const;
+ SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
virtual SDValue
LowerFormalArguments(SDValue Chain,
@@ -167,6 +177,16 @@ namespace llvm {
/// specified FP immediate natively. If false, the legalizer will
/// materialize the FP immediate as a load from a constant pool.
virtual bool isFPImmLegal(const APFloat &Imm, EVT VT) const;
+
+ MachineBasicBlock *EmitAtomicBinary(MachineInstr *MI, MachineBasicBlock *BB,
+ unsigned Size, unsigned BinOpcode, bool Nand = false) const;
+ MachineBasicBlock *EmitAtomicBinaryPartword(MachineInstr *MI,
+ MachineBasicBlock *BB, unsigned Size, unsigned BinOpcode,
+ bool Nand = false) const;
+ MachineBasicBlock *EmitAtomicCmpSwap(MachineInstr *MI,
+ MachineBasicBlock *BB, unsigned Size) const;
+ MachineBasicBlock *EmitAtomicCmpSwapPartword(MachineInstr *MI,
+ MachineBasicBlock *BB, unsigned Size) const;
};
}
diff --git a/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td b/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td
index a86c5c7..021c167 100644
--- a/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td
+++ b/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file contains the Mips implementation of the TargetInstrInfo class.
+// This file describes the Mips FPU instruction set.
//
//===----------------------------------------------------------------------===//
@@ -77,40 +77,42 @@ def IsNotMipsI : Predicate<"!Subtarget.isMips1()">;
multiclass FFR1_1<bits<6> funct, string asmstr>
{
def _S32 : FFR<0x11, funct, 0x0, (outs FGR32:$fd), (ins FGR32:$fs),
- !strconcat(asmstr, ".s $fd, $fs"), []>;
+ !strconcat(asmstr, ".s\t$fd, $fs"), []>;
def _D32 : FFR<0x11, funct, 0x1, (outs FGR32:$fd), (ins AFGR64:$fs),
- !strconcat(asmstr, ".d $fd, $fs"), []>, Requires<[In32BitMode]>;
+ !strconcat(asmstr, ".d\t$fd, $fs"), []>, Requires<[In32BitMode]>;
}
multiclass FFR1_2<bits<6> funct, string asmstr, SDNode FOp>
{
def _S32 : FFR<0x11, funct, 0x0, (outs FGR32:$fd), (ins FGR32:$fs),
- !strconcat(asmstr, ".s $fd, $fs"),
+ !strconcat(asmstr, ".s\t$fd, $fs"),
[(set FGR32:$fd, (FOp FGR32:$fs))]>;
def _D32 : FFR<0x11, funct, 0x1, (outs AFGR64:$fd), (ins AFGR64:$fs),
- !strconcat(asmstr, ".d $fd, $fs"),
+ !strconcat(asmstr, ".d\t$fd, $fs"),
[(set AFGR64:$fd, (FOp AFGR64:$fs))]>, Requires<[In32BitMode]>;
}
class FFR1_3<bits<6> funct, bits<5> fmt, RegisterClass RcSrc,
RegisterClass RcDst, string asmstr>:
FFR<0x11, funct, fmt, (outs RcSrc:$fd), (ins RcDst:$fs),
- !strconcat(asmstr, " $fd, $fs"), []>;
+ !strconcat(asmstr, "\t$fd, $fs"), []>;
-multiclass FFR1_4<bits<6> funct, string asmstr, SDNode FOp> {
+multiclass FFR1_4<bits<6> funct, string asmstr, SDNode FOp, bit isComm = 0> {
+ let isCommutable = isComm in {
def _S32 : FFR<0x11, funct, 0x0, (outs FGR32:$fd),
(ins FGR32:$fs, FGR32:$ft),
- !strconcat(asmstr, ".s $fd, $fs, $ft"),
+ !strconcat(asmstr, ".s\t$fd, $fs, $ft"),
[(set FGR32:$fd, (FOp FGR32:$fs, FGR32:$ft))]>;
def _D32 : FFR<0x11, funct, 0x1, (outs AFGR64:$fd),
(ins AFGR64:$fs, AFGR64:$ft),
- !strconcat(asmstr, ".d $fd, $fs, $ft"),
+ !strconcat(asmstr, ".d\t$fd, $fs, $ft"),
[(set AFGR64:$fd, (FOp AFGR64:$fs, AFGR64:$ft))]>,
Requires<[In32BitMode]>;
+ }
}
//===----------------------------------------------------------------------===//
@@ -170,42 +172,42 @@ let ft = 0 in {
let fd = 0 in {
/// Move Control Registers From/To CPU Registers
def CFC1 : FFR<0x11, 0x0, 0x2, (outs CPURegs:$rt), (ins CCR:$fs),
- "cfc1 $rt, $fs", []>;
+ "cfc1\t$rt, $fs", []>;
def CTC1 : FFR<0x11, 0x0, 0x6, (outs CCR:$rt), (ins CPURegs:$fs),
- "ctc1 $fs, $rt", []>;
+ "ctc1\t$fs, $rt", []>;
def MFC1 : FFR<0x11, 0x00, 0x00, (outs CPURegs:$rt), (ins FGR32:$fs),
- "mfc1 $rt, $fs", []>;
+ "mfc1\t$rt, $fs", []>;
def MTC1 : FFR<0x11, 0x00, 0x04, (outs FGR32:$fs), (ins CPURegs:$rt),
- "mtc1 $rt, $fs", []>;
+ "mtc1\t$rt, $fs", []>;
}
def FMOV_S32 : FFR<0x11, 0b000110, 0x0, (outs FGR32:$fd), (ins FGR32:$fs),
- "mov.s $fd, $fs", []>;
+ "mov.s\t$fd, $fs", []>;
def FMOV_D32 : FFR<0x11, 0b000110, 0x1, (outs AFGR64:$fd), (ins AFGR64:$fs),
- "mov.d $fd, $fs", []>;
+ "mov.d\t$fd, $fs", []>;
/// Floating Point Memory Instructions
let Predicates = [IsNotSingleFloat, IsNotMipsI] in {
def LDC1 : FFI<0b110101, (outs AFGR64:$ft), (ins mem:$addr),
- "ldc1 $ft, $addr", [(set AFGR64:$ft, (load addr:$addr))]>;
+ "ldc1\t$ft, $addr", [(set AFGR64:$ft, (load addr:$addr))]>;
def SDC1 : FFI<0b111101, (outs), (ins AFGR64:$ft, mem:$addr),
- "sdc1 $ft, $addr", [(store AFGR64:$ft, addr:$addr)]>;
+ "sdc1\t$ft, $addr", [(store AFGR64:$ft, addr:$addr)]>;
}
// LWC1 and SWC1 can always be emitted with odd registers.
-def LWC1 : FFI<0b110001, (outs FGR32:$ft), (ins mem:$addr), "lwc1 $ft, $addr",
+def LWC1 : FFI<0b110001, (outs FGR32:$ft), (ins mem:$addr), "lwc1\t$ft, $addr",
[(set FGR32:$ft, (load addr:$addr))]>;
-def SWC1 : FFI<0b111001, (outs), (ins FGR32:$ft, mem:$addr), "swc1 $ft, $addr",
- [(store FGR32:$ft, addr:$addr)]>;
+def SWC1 : FFI<0b111001, (outs), (ins FGR32:$ft, mem:$addr),
+ "swc1\t$ft, $addr", [(store FGR32:$ft, addr:$addr)]>;
/// Floating-point Aritmetic
-defm FADD : FFR1_4<0x10, "add", fadd>;
+defm FADD : FFR1_4<0x10, "add", fadd, 1>;
defm FDIV : FFR1_4<0x03, "div", fdiv>;
-defm FMUL : FFR1_4<0x02, "mul", fmul>;
+defm FMUL : FFR1_4<0x02, "mul", fmul, 1>;
defm FSUB : FFR1_4<0x01, "sub", fsub>;
//===----------------------------------------------------------------------===//
@@ -221,7 +223,7 @@ def MIPS_BRANCH_TL : PatLeaf<(i32 3)>;
/// Floating Point Branch of False/True (Likely)
let isBranch=1, isTerminator=1, hasDelaySlot=1, base=0x8, Uses=[FCR31] in
class FBRANCH<PatLeaf op, string asmstr> : FFI<0x11, (outs),
- (ins brtarget:$dst), !strconcat(asmstr, " $dst"),
+ (ins brtarget:$dst), !strconcat(asmstr, "\t$dst"),
[(MipsFPBrcond op, bb:$dst)]>;
def BC1F : FBRANCH<MIPS_BRANCH_F, "bc1f">;
@@ -254,11 +256,11 @@ def MIPS_FCOND_NGT : PatLeaf<(i32 15)>;
/// Floating Point Compare
let hasDelaySlot = 1, Defs=[FCR31] in {
def FCMP_S32 : FCC<0x0, (outs), (ins FGR32:$fs, FGR32:$ft, condcode:$cc),
- "c.$cc.s $fs, $ft",
+ "c.$cc.s\t$fs, $ft",
[(MipsFPCmp FGR32:$fs, FGR32:$ft, imm:$cc)]>;
def FCMP_D32 : FCC<0x1, (outs), (ins AFGR64:$fs, AFGR64:$ft, condcode:$cc),
- "c.$cc.d $fs, $ft",
+ "c.$cc.d\t$fs, $ft",
[(MipsFPCmp AFGR64:$fs, AFGR64:$ft, imm:$cc)]>,
Requires<[In32BitMode]>;
}
@@ -357,6 +359,7 @@ def : Pat<(f32 (sint_to_fp CPURegs:$src)), (CVTS_W32 (MTC1 CPURegs:$src))>;
def : Pat<(f64 (sint_to_fp CPURegs:$src)), (CVTD_W32 (MTC1 CPURegs:$src))>;
def : Pat<(i32 (fp_to_sint FGR32:$src)), (MFC1 (TRUNC_W_S32 FGR32:$src))>;
+def : Pat<(i32 (fp_to_sint AFGR64:$src)), (MFC1 (TRUNC_W_D32 AFGR64:$src))>;
def : Pat<(i32 (bitconvert FGR32:$src)), (MFC1 FGR32:$src)>;
def : Pat<(f32 (bitconvert CPURegs:$src)), (MTC1 CPURegs:$src)>;
diff --git a/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td b/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td
index 9dfcdfb..9f55fb3 100644
--- a/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td
+++ b/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td
@@ -1,4 +1,4 @@
-//===- MipsRegisterInfo.td - Mips Register defs ------------*- tablegen -*-===//
+//===- MipsInstrFormats.td - Mips Instruction Formats ------*- tablegen -*-===//
//
// The LLVM Compiler Infrastructure
//
diff --git a/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h b/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h
index 5fdbf1f..abf6773 100644
--- a/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h
+++ b/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h
@@ -146,7 +146,21 @@ namespace MipsII {
/// MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol
/// address.
MO_ABS_HI,
- MO_ABS_LO
+ MO_ABS_LO,
+
+ /// MO_TLSGD - Represents the offset into the global offset table at which
+ // the module ID and TSL block offset reside during execution (General
+ // Dynamic TLS).
+ MO_TLSGD,
+
+ /// MO_GOTTPREL - Represents the offset from the thread pointer (Initial
+ // Exec TLS).
+ MO_GOTTPREL,
+
+ /// MO_TPREL_HI/LO - Represents the hi and low part of the offset from
+ // the thread pointer (Local Exec TLS).
+ MO_TPREL_HI,
+ MO_TPREL_LO
};
}
diff --git a/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td b/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td
index 19b9c35..329a002 100644
--- a/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td
+++ b/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td
@@ -1,4 +1,4 @@
-//===- MipsInstrInfo.td - Mips Register defs ---------------*- tablegen -*-===//
+//===- MipsInstrInfo.td - Target Description for Mips Target -*- tablegen -*-=//
//
// The LLVM Compiler Infrastructure
//
@@ -6,6 +6,10 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// This file contains the Mips implementation of the TargetInstrInfo class.
+//
+//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
// Instruction format superclass
@@ -33,6 +37,8 @@ def SDT_MipsDivRem : SDTypeProfile<0, 2,
[SDTCisVT<0, i32>,
SDTCisSameAs<0, 1>]>;
+def SDT_MipsThreadPointer : SDTypeProfile<1, 0, [SDTCisPtrTy<0>]>;
+
// Call
def MipsJmpLink : SDNode<"MipsISD::JmpLink",SDT_MipsJmpLink,
[SDNPHasChain, SDNPOutGlue, SDNPOptInGlue,
@@ -45,6 +51,16 @@ def MipsHi : SDNode<"MipsISD::Hi", SDTIntUnaryOp>;
def MipsLo : SDNode<"MipsISD::Lo", SDTIntUnaryOp>;
def MipsGPRel : SDNode<"MipsISD::GPRel", SDTIntUnaryOp>;
+// TlsGd node is used to handle General Dynamic TLS
+def MipsTlsGd : SDNode<"MipsISD::TlsGd", SDTIntUnaryOp>;
+
+// TprelHi and TprelLo nodes are used to handle Local Exec TLS
+def MipsTprelHi : SDNode<"MipsISD::TprelHi", SDTIntUnaryOp>;
+def MipsTprelLo : SDNode<"MipsISD::TprelLo", SDTIntUnaryOp>;
+
+// Thread pointer
+def MipsThreadPointer: SDNode<"MipsISD::ThreadPointer", SDT_MipsThreadPointer>;
+
// Return
def MipsRet : SDNode<"MipsISD::Ret", SDT_MipsRet, [SDNPHasChain,
SDNPOptInGlue]>;
@@ -71,6 +87,18 @@ def MipsDivRem : SDNode<"MipsISD::DivRem", SDT_MipsDivRem,
def MipsDivRemU : SDNode<"MipsISD::DivRemU", SDT_MipsDivRem,
[SDNPOutGlue]>;
+// Target constant nodes that are not part of any isel patterns and remain
+// unchanged can cause instructions with illegal operands to be emitted.
+// Wrapper node patterns give the instruction selector a chance to replace
+// target constant nodes that would otherwise remain unchanged with ADDiu
+// nodes. Without these wrapper node patterns, the following conditional move
+// instrucion is emitted when function cmov2 in test/CodeGen/Mips/cmov.ll is
+// compiled:
+// movn %got(d)($gp), %got(c)($gp), $4
+// This instruction is illegal since movn can take only register operands.
+
+def MipsWrapperPIC : SDNode<"MipsISD::WrapperPIC", SDTIntUnaryOp>;
+
//===----------------------------------------------------------------------===//
// Mips Instruction Predicate Definitions.
//===----------------------------------------------------------------------===//
@@ -141,17 +169,20 @@ def addr : ComplexPattern<iPTR, 2, "SelectAddr", [frameindex], []>;
//===----------------------------------------------------------------------===//
// Arithmetic 3 register operands
-let isCommutable = 1 in
class ArithR<bits<6> op, bits<6> func, string instr_asm, SDNode OpNode,
- InstrItinClass itin>:
+ InstrItinClass itin, bit isComm = 0>:
FR<op, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
!strconcat(instr_asm, "\t$dst, $b, $c"),
- [(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], itin>;
+ [(set CPURegs:$dst, (OpNode CPURegs:$b, CPURegs:$c))], itin> {
+ let isCommutable = isComm;
+}
-let isCommutable = 1 in
-class ArithOverflowR<bits<6> op, bits<6> func, string instr_asm>:
+class ArithOverflowR<bits<6> op, bits<6> func, string instr_asm,
+ bit isComm = 0>:
FR<op, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
- !strconcat(instr_asm, "\t$dst, $b, $c"), [], IIAlu>;
+ !strconcat(instr_asm, "\t$dst, $b, $c"), [], IIAlu> {
+ let isCommutable = isComm;
+}
// Arithmetic 2 register operands
class ArithI<bits<6> op, string instr_asm, SDNode OpNode,
@@ -167,12 +198,15 @@ class ArithOverflowI<bits<6> op, string instr_asm, SDNode OpNode,
// Arithmetic Multiply ADD/SUB
let rd = 0, shamt = 0, Defs = [HI, LO], Uses = [HI, LO] in
-class MArithR<bits<6> func, string instr_asm, SDNode op> :
+class MArithR<bits<6> func, string instr_asm, SDNode op, bit isComm = 0> :
FR<0x1c, func, (outs), (ins CPURegs:$rs, CPURegs:$rt),
!strconcat(instr_asm, "\t$rs, $rt"),
- [(op CPURegs:$rs, CPURegs:$rt, LO, HI)], IIImul>;
+ [(op CPURegs:$rs, CPURegs:$rt, LO, HI)], IIImul> {
+ let isCommutable = isComm;
+}
// Logical
+let isCommutable = 1 in
class LogicR<bits<6> func, string instr_asm, SDNode OpNode>:
FR<0x00, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
!strconcat(instr_asm, "\t$dst, $b, $c"),
@@ -183,6 +217,7 @@ class LogicI<bits<6> op, string instr_asm, SDNode OpNode>:
!strconcat(instr_asm, "\t$dst, $b, $c"),
[(set CPURegs:$dst, (OpNode CPURegs:$b, immZExt16:$c))], IIAlu>;
+let isCommutable = 1 in
class LogicNOR<bits<6> op, bits<6> func, string instr_asm>:
FR<op, func, (outs CPURegs:$dst), (ins CPURegs:$b, CPURegs:$c),
!strconcat(instr_asm, "\t$dst, $b, $c"),
@@ -288,6 +323,7 @@ let isCall=1, hasDelaySlot=1,
// Mul, Div
let Defs = [HI, LO] in {
+ let isCommutable = 1 in
class Mul<bits<6> func, string instr_asm, InstrItinClass itin>:
FR<0x00, func, (outs), (ins CPURegs:$a, CPURegs:$b),
!strconcat(instr_asm, "\t$a, $b"), [], itin>;
@@ -338,6 +374,13 @@ class CondMov<bits<6> func, string instr_asm, PatLeaf MovCode>:
CPURegs:$cond), !strconcat(instr_asm, "\t$dst, $T, $cond"),
[], NoItinerary>;
+// Read Hardware
+class ReadHardware: FR<0x1f, 0x3b, (outs CPURegs:$dst), (ins HWRegs:$src),
+ "rdhwr\t$dst, $src", [], IIAlu> {
+ let rs = 0;
+ let shamt = 0;
+}
+
//===----------------------------------------------------------------------===//
// Pseudo instructions
//===----------------------------------------------------------------------===//
@@ -369,7 +412,116 @@ def ATMACRO : MipsPseudo<(outs), (ins), ".set\tat", []>;
// are used, we have the same behavior, but get also a bunch of warnings
// from the assembler.
def CPLOAD : MipsPseudo<(outs), (ins CPURegs:$picreg), ".cpload\t$picreg", []>;
-def CPRESTORE : MipsPseudo<(outs), (ins uimm16:$loc), ".cprestore\t$loc\n", []>;
+def CPRESTORE : MipsPseudo<(outs), (ins i32imm:$loc), ".cprestore\t$loc\n", []>;
+
+let usesCustomInserter = 1 in {
+ def ATOMIC_LOAD_ADD_I8 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_add_8\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_add_8 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_ADD_I16 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_add_16\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_add_16 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_ADD_I32 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_add_32\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_add_32 CPURegs:$ptr, CPURegs:$incr))]>;
+
+ def ATOMIC_LOAD_SUB_I8 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_sub_8\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_sub_8 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_SUB_I16 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_sub_16\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_sub_16 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_SUB_I32 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_sub_32\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_sub_32 CPURegs:$ptr, CPURegs:$incr))]>;
+
+ def ATOMIC_LOAD_AND_I8 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_and_8\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_and_8 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_AND_I16 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_and_16\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_and_16 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_AND_I32 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_and_32\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_and_32 CPURegs:$ptr, CPURegs:$incr))]>;
+
+ def ATOMIC_LOAD_OR_I8 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_or_8\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_or_8 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_OR_I16 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_or_16\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_or_16 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_OR_I32 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_or_32\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_or_32 CPURegs:$ptr, CPURegs:$incr))]>;
+
+ def ATOMIC_LOAD_XOR_I8 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_xor_8\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_xor_8 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_XOR_I16 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_xor_16\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_xor_16 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_XOR_I32 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_xor_32\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_xor_32 CPURegs:$ptr, CPURegs:$incr))]>;
+
+ def ATOMIC_LOAD_NAND_I8 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_nand_8\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_nand_8 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_NAND_I16 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_nand_16\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_nand_16 CPURegs:$ptr, CPURegs:$incr))]>;
+ def ATOMIC_LOAD_NAND_I32 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$incr),
+ "atomic_load_nand_32\t$dst, $ptr, $incr",
+ [(set CPURegs:$dst, (atomic_load_nand_32 CPURegs:$ptr, CPURegs:$incr))]>;
+
+ def ATOMIC_SWAP_I8 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$val),
+ "atomic_swap_8\t$dst, $ptr, $val",
+ [(set CPURegs:$dst, (atomic_swap_8 CPURegs:$ptr, CPURegs:$val))]>;
+ def ATOMIC_SWAP_I16 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$val),
+ "atomic_swap_16\t$dst, $ptr, $val",
+ [(set CPURegs:$dst, (atomic_swap_16 CPURegs:$ptr, CPURegs:$val))]>;
+ def ATOMIC_SWAP_I32 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$val),
+ "atomic_swap_32\t$dst, $ptr, $val",
+ [(set CPURegs:$dst, (atomic_swap_32 CPURegs:$ptr, CPURegs:$val))]>;
+
+ def ATOMIC_CMP_SWAP_I8 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$oldval, CPURegs:$newval),
+ "atomic_cmp_swap_8\t$dst, $ptr, $oldval, $newval",
+ [(set CPURegs:$dst,
+ (atomic_cmp_swap_8 CPURegs:$ptr, CPURegs:$oldval, CPURegs:$newval))]>;
+ def ATOMIC_CMP_SWAP_I16 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$oldval, CPURegs:$newval),
+ "atomic_cmp_swap_16\t$dst, $ptr, $oldval, $newval",
+ [(set CPURegs:$dst,
+ (atomic_cmp_swap_16 CPURegs:$ptr, CPURegs:$oldval, CPURegs:$newval))]>;
+ def ATOMIC_CMP_SWAP_I32 : MipsPseudo<
+ (outs CPURegs:$dst), (ins CPURegs:$ptr, CPURegs:$oldval, CPURegs:$newval),
+ "atomic_cmp_swap_32\t$dst, $ptr, $oldval, $newval",
+ [(set CPURegs:$dst,
+ (atomic_cmp_swap_32 CPURegs:$ptr, CPURegs:$oldval, CPURegs:$newval))]>;
+}
//===----------------------------------------------------------------------===//
// Instruction definition
@@ -390,9 +542,9 @@ def XORi : LogicI<0x0e, "xori", xor>;
def LUi : LoadUpper<0x0f, "lui">;
/// Arithmetic Instructions (3-Operand, R-Type)
-def ADDu : ArithR<0x00, 0x21, "addu", add, IIAlu>;
+def ADDu : ArithR<0x00, 0x21, "addu", add, IIAlu, 1>;
def SUBu : ArithR<0x00, 0x23, "subu", sub, IIAlu>;
-def ADD : ArithOverflowR<0x00, 0x20, "add">;
+def ADD : ArithOverflowR<0x00, 0x20, "add", 1>;
def SUB : ArithOverflowR<0x00, 0x22, "sub">;
def SLT : SetCC_R<0x00, 0x2a, "slt", setlt>;
def SLTu : SetCC_R<0x00, 0x2b, "sltu", setult>;
@@ -425,6 +577,14 @@ def SB : StoreM<0x28, "sb", truncstorei8>;
def SH : StoreM<0x29, "sh", truncstorei16>;
def SW : StoreM<0x2b, "sw", store>;
+/// Load-linked, Store-conditional
+let hasDelaySlot = 1 in
+ def LL : FI<0x30, (outs CPURegs:$dst), (ins mem:$addr),
+ "ll\t$dst, $addr", [], IILoad>;
+let Constraints = "$src = $dst" in
+ def SC : FI<0x38, (outs CPURegs:$dst), (ins CPURegs:$src, mem:$addr),
+ "sc\t$src, $addr", [], IIStore>;
+
/// Jump and Branch Instructions
def J : JumpFJ<0x02, "j">;
def JR : JumpFR<0x00, 0x08, "jr">;
@@ -516,14 +676,16 @@ let addr=0 in
def LEA_ADDiu : EffectiveAddress<"addiu\t$dst, ${addr:stackloc}">;
// MADD*/MSUB*
-def MADD : MArithR<0, "madd", MipsMAdd>;
-def MADDU : MArithR<1, "maddu", MipsMAddu>;
+def MADD : MArithR<0, "madd", MipsMAdd, 1>;
+def MADDU : MArithR<1, "maddu", MipsMAddu, 1>;
def MSUB : MArithR<4, "msub", MipsMSub>;
def MSUBU : MArithR<5, "msubu", MipsMSubu>;
// MUL is a assembly macro in the current used ISAs. In recent ISA's
// it is a real instruction.
-def MUL : ArithR<0x1c, 0x02, "mul", mul, IIImul>, Requires<[IsMips32]>;
+def MUL : ArithR<0x1c, 0x02, "mul", mul, IIImul, 1>, Requires<[IsMips32]>;
+
+def RDHWR : ReadHardware;
//===----------------------------------------------------------------------===//
// Arbitrary patterns that map to one or more instructions
@@ -577,6 +739,26 @@ def : Pat<(add CPURegs:$gp, (MipsGPRel tglobaladdr:$in)),
def : Pat<(add CPURegs:$gp, (MipsGPRel tconstpool:$in)),
(ADDiu CPURegs:$gp, tconstpool:$in)>;
+// tlsgd
+def : Pat<(add CPURegs:$gp, (MipsTlsGd tglobaltlsaddr:$in)),
+ (ADDiu CPURegs:$gp, tglobaltlsaddr:$in)>;
+
+// tprel hi/lo
+def : Pat<(MipsTprelHi tglobaltlsaddr:$in), (LUi tglobaltlsaddr:$in)>;
+def : Pat<(add CPURegs:$hi, (MipsTprelLo tglobaltlsaddr:$lo)),
+ (ADDiu CPURegs:$hi, tglobaltlsaddr:$lo)>;
+
+// wrapper_pic
+class WrapperPICPat<SDNode node>:
+ Pat<(MipsWrapperPIC node:$in),
+ (ADDiu GP, node:$in)>;
+
+def : WrapperPICPat<tglobaladdr>;
+def : WrapperPICPat<tconstpool>;
+def : WrapperPICPat<texternalsym>;
+def : WrapperPICPat<tblockaddress>;
+def : WrapperPICPat<tjumptable>;
+
// Mips does not have "not", so we expand our way
def : Pat<(not CPURegs:$in),
(NOR CPURegs:$in, ZERO)>;
@@ -644,13 +826,6 @@ multiclass MovnPats<RegisterClass RC, Instruction MOVNInst> {
defm : MovzPats<CPURegs, MOVZ_I>;
defm : MovnPats<CPURegs, MOVN_I>;
-// select patterns with got access
-let AddedComplexity = 10 in
- def : Pat<(select (setne CPURegs:$lhs, CPURegs:$rhs),
- (i32 tglobaladdr:$T), CPURegs:$F),
- (MOVN_I CPURegs:$F, (ADDiu GP, tglobaladdr:$T),
- (XOR CPURegs:$lhs, CPURegs:$rhs))>;
-
// setcc patterns
def : Pat<(seteq CPURegs:$lhs, CPURegs:$rhs),
(SLTu (XOR CPURegs:$lhs, CPURegs:$rhs), 1)>;
diff --git a/contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp b/contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp
index fe48ab7..c86bf405 100644
--- a/contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp
@@ -17,11 +17,15 @@ using namespace llvm;
MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, StringRef TT) {
AlignmentIsInBytes = false;
Data16bitsDirective = "\t.half\t";
- Data32bitsDirective = "\t.word\t";
+ Data32bitsDirective = "\t.4byte\t";
Data64bitsDirective = 0;
PrivateGlobalPrefix = "$";
CommentString = "#";
ZeroDirective = "\t.space\t";
GPRel32Directive = "\t.gpword\t";
- HasSetDirective = false;
+ WeakRefDirective = "\t.weak\t";
+
+ SupportsDebugInformation = true;
+ ExceptionsType = ExceptionHandling::DwarfCFI;
+ HasLEB128 = true;
}
diff --git a/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h b/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h
index 1e8e4fe..df40e6c 100644
--- a/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h
+++ b/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h
@@ -14,6 +14,7 @@
#ifndef MIPS_MACHINE_FUNCTION_INFO_H
#define MIPS_MACHINE_FUNCTION_INFO_H
+#include <utility>
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/VectorExtras.h"
#include "llvm/CodeGen/MachineFunction.h"
@@ -26,50 +27,6 @@ namespace llvm {
class MipsFunctionInfo : public MachineFunctionInfo {
private:
- /// Holds for each function where on the stack the Frame Pointer must be
- /// saved. This is used on Prologue and Epilogue to emit FP save/restore
- int FPStackOffset;
-
- /// Holds for each function where on the stack the Return Address must be
- /// saved. This is used on Prologue and Epilogue to emit RA save/restore
- int RAStackOffset;
-
- /// At each function entry, two special bitmask directives must be emitted
- /// to help debugging, for CPU and FPU callee saved registers. Both need
- /// the negative offset from the final stack size and its higher registers
- /// location on the stack.
- int CPUTopSavedRegOff;
- int FPUTopSavedRegOff;
-
- /// MipsFIHolder - Holds a FrameIndex and it's Stack Pointer Offset
- struct MipsFIHolder {
-
- int FI;
- int SPOffset;
-
- MipsFIHolder(int FrameIndex, int StackPointerOffset)
- : FI(FrameIndex), SPOffset(StackPointerOffset) {}
- };
-
- /// When PIC is used the GP must be saved on the stack on the function
- /// prologue and must be reloaded from this stack location after every
- /// call. A reference to its stack location and frame index must be kept
- /// to be used on emitPrologue and processFunctionBeforeFrameFinalized.
- MipsFIHolder GPHolder;
-
- /// On LowerFormalArguments the stack size is unknown, so the Stack
- /// Pointer Offset calculation of "not in register arguments" must be
- /// postponed to emitPrologue.
- SmallVector<MipsFIHolder, 16> FnLoadArgs;
- bool HasLoadArgs;
-
- // When VarArgs, we must write registers back to caller stack, preserving
- // on register arguments. Since the stack size is unknown on
- // LowerFormalArguments, the Stack Pointer Offset calculation must be
- // postponed to emitPrologue.
- SmallVector<MipsFIHolder, 4> FnStoreVarArgs;
- bool HasStoreVarArgs;
-
/// SRetReturnReg - Some subtargets require that sret lowering includes
/// returning the value of the returned struct in a register. This field
/// holds the virtual register into which the sret argument is passed.
@@ -83,55 +40,47 @@ private:
/// VarArgsFrameIndex - FrameIndex for start of varargs area.
int VarArgsFrameIndex;
+ // Range of frame object indices.
+ // InArgFIRange: Range of indices of all frame objects created during call to
+ // LowerFormalArguments.
+ // OutArgFIRange: Range of indices of all frame objects created during call to
+ // LowerCall except for the frame object for restoring $gp.
+ std::pair<int, int> InArgFIRange, OutArgFIRange;
+ int GPFI; // Index of the frame object for restoring $gp
+ unsigned MaxCallFrameSize;
+
+ /// AtomicFrameIndex - To implement atomic.swap and atomic.cmp.swap
+ /// intrinsics, it is necessary to use a temporary stack location.
+ /// This field holds the frame index of this location.
+ int AtomicFrameIndex;
public:
MipsFunctionInfo(MachineFunction& MF)
- : FPStackOffset(0), RAStackOffset(0), CPUTopSavedRegOff(0),
- FPUTopSavedRegOff(0), GPHolder(-1,-1), HasLoadArgs(false),
- HasStoreVarArgs(false), SRetReturnReg(0), GlobalBaseReg(0),
- VarArgsFrameIndex(0)
+ : SRetReturnReg(0), GlobalBaseReg(0),
+ VarArgsFrameIndex(0), InArgFIRange(std::make_pair(-1, 0)),
+ OutArgFIRange(std::make_pair(-1, 0)), GPFI(0), MaxCallFrameSize(0),
+ AtomicFrameIndex(-1)
{}
- int getFPStackOffset() const { return FPStackOffset; }
- void setFPStackOffset(int Off) { FPStackOffset = Off; }
-
- int getRAStackOffset() const { return RAStackOffset; }
- void setRAStackOffset(int Off) { RAStackOffset = Off; }
-
- int getCPUTopSavedRegOff() const { return CPUTopSavedRegOff; }
- void setCPUTopSavedRegOff(int Off) { CPUTopSavedRegOff = Off; }
-
- int getFPUTopSavedRegOff() const { return FPUTopSavedRegOff; }
- void setFPUTopSavedRegOff(int Off) { FPUTopSavedRegOff = Off; }
-
- int getGPStackOffset() const { return GPHolder.SPOffset; }
- int getGPFI() const { return GPHolder.FI; }
- void setGPStackOffset(int Off) { GPHolder.SPOffset = Off; }
- void setGPFI(int FI) { GPHolder.FI = FI; }
- bool needGPSaveRestore() const { return GPHolder.SPOffset != -1; }
-
- bool hasLoadArgs() const { return HasLoadArgs; }
- bool hasStoreVarArgs() const { return HasStoreVarArgs; }
-
- void recordLoadArgsFI(int FI, int SPOffset) {
- if (!HasLoadArgs) HasLoadArgs=true;
- FnLoadArgs.push_back(MipsFIHolder(FI, SPOffset));
- }
- void recordStoreVarArgsFI(int FI, int SPOffset) {
- if (!HasStoreVarArgs) HasStoreVarArgs=true;
- FnStoreVarArgs.push_back(MipsFIHolder(FI, SPOffset));
+ bool isInArgFI(int FI) const {
+ return FI <= InArgFIRange.first && FI >= InArgFIRange.second;
}
+ void setLastInArgFI(int FI) { InArgFIRange.second = FI; }
- void adjustLoadArgsFI(MachineFrameInfo *MFI) const {
- if (!hasLoadArgs()) return;
- for (unsigned i = 0, e = FnLoadArgs.size(); i != e; ++i)
- MFI->setObjectOffset( FnLoadArgs[i].FI, FnLoadArgs[i].SPOffset );
+ bool isOutArgFI(int FI) const {
+ return FI <= OutArgFIRange.first && FI >= OutArgFIRange.second;
}
- void adjustStoreVarArgsFI(MachineFrameInfo *MFI) const {
- if (!hasStoreVarArgs()) return;
- for (unsigned i = 0, e = FnStoreVarArgs.size(); i != e; ++i)
- MFI->setObjectOffset( FnStoreVarArgs[i].FI, FnStoreVarArgs[i].SPOffset );
+ void extendOutArgFIRange(int FirstFI, int LastFI) {
+ if (!OutArgFIRange.second)
+ // this must be the first time this function was called.
+ OutArgFIRange.first = FirstFI;
+ OutArgFIRange.second = LastFI;
}
+ int getGPFI() const { return GPFI; }
+ void setGPFI(int FI) { GPFI = FI; }
+ bool needGPSaveRestore() const { return getGPFI(); }
+ bool isGPFI(int FI) const { return GPFI && GPFI == FI; }
+
unsigned getSRetReturnReg() const { return SRetReturnReg; }
void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
@@ -140,6 +89,12 @@ public:
int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
+
+ unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
+ void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
+
+ int getAtomicFrameIndex() const { return AtomicFrameIndex; }
+ void setAtomicFrameIndex(int Index) { AtomicFrameIndex = Index; }
};
} // end of namespace llvm
diff --git a/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp b/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
index c09b129..b0984af 100644
--- a/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp
@@ -65,16 +65,16 @@ getRegisterNumbering(unsigned RegEnum)
case Mips::T5 : case Mips::F13: return 13;
case Mips::T6 : case Mips::F14: case Mips::D7: return 14;
case Mips::T7 : case Mips::F15: return 15;
- case Mips::T8 : case Mips::F16: case Mips::D8: return 16;
- case Mips::T9 : case Mips::F17: return 17;
- case Mips::S0 : case Mips::F18: case Mips::D9: return 18;
- case Mips::S1 : case Mips::F19: return 19;
- case Mips::S2 : case Mips::F20: case Mips::D10: return 20;
- case Mips::S3 : case Mips::F21: return 21;
- case Mips::S4 : case Mips::F22: case Mips::D11: return 22;
- case Mips::S5 : case Mips::F23: return 23;
- case Mips::S6 : case Mips::F24: case Mips::D12: return 24;
- case Mips::S7 : case Mips::F25: return 25;
+ case Mips::S0 : case Mips::F16: case Mips::D8: return 16;
+ case Mips::S1 : case Mips::F17: return 17;
+ case Mips::S2 : case Mips::F18: case Mips::D9: return 18;
+ case Mips::S3 : case Mips::F19: return 19;
+ case Mips::S4 : case Mips::F20: case Mips::D10: return 20;
+ case Mips::S5 : case Mips::F21: return 21;
+ case Mips::S6 : case Mips::F22: case Mips::D11: return 22;
+ case Mips::S7 : case Mips::F23: return 23;
+ case Mips::T8 : case Mips::F24: case Mips::D12: return 24;
+ case Mips::T9 : case Mips::F25: return 25;
case Mips::K0 : case Mips::F26: case Mips::D13: return 26;
case Mips::K1 : case Mips::F27: return 27;
case Mips::GP : case Mips::F28: case Mips::D14: return 28;
@@ -98,22 +98,22 @@ getCalleeSavedRegs(const MachineFunction *MF) const
{
// Mips callee-save register range is $16-$23, $f20-$f30
static const unsigned SingleFloatOnlyCalleeSavedRegs[] = {
- Mips::S0, Mips::S1, Mips::S2, Mips::S3,
- Mips::S4, Mips::S5, Mips::S6, Mips::S7,
- Mips::F20, Mips::F21, Mips::F22, Mips::F23, Mips::F24, Mips::F25,
- Mips::F26, Mips::F27, Mips::F28, Mips::F29, Mips::F30, 0
+ Mips::F30, Mips::F29, Mips::F28, Mips::F27, Mips::F26,
+ Mips::F25, Mips::F24, Mips::F23, Mips::F22, Mips::F21, Mips::F20,
+ Mips::RA, Mips::FP, Mips::S7, Mips::S6, Mips::S5, Mips::S4,
+ Mips::S3, Mips::S2, Mips::S1, Mips::S0, 0
};
- static const unsigned BitMode32CalleeSavedRegs[] = {
- Mips::S0, Mips::S1, Mips::S2, Mips::S3,
- Mips::S4, Mips::S5, Mips::S6, Mips::S7,
- Mips::F20, Mips::F22, Mips::F24, Mips::F26, Mips::F28, Mips::F30, 0
+ static const unsigned Mips32CalleeSavedRegs[] = {
+ Mips::D15, Mips::D14, Mips::D13, Mips::D12, Mips::D11, Mips::D10,
+ Mips::RA, Mips::FP, Mips::S7, Mips::S6, Mips::S5, Mips::S4,
+ Mips::S3, Mips::S2, Mips::S1, Mips::S0, 0
};
if (Subtarget.isSingleFloat())
return SingleFloatOnlyCalleeSavedRegs;
else
- return BitMode32CalleeSavedRegs;
+ return Mips32CalleeSavedRegs;
}
BitVector MipsRegisterInfo::
@@ -127,9 +127,11 @@ getReservedRegs(const MachineFunction &MF) const {
Reserved.set(Mips::SP);
Reserved.set(Mips::FP);
Reserved.set(Mips::RA);
+ Reserved.set(Mips::F31);
+ Reserved.set(Mips::D15);
// SRV4 requires that odd register can't be used.
- if (!Subtarget.isSingleFloat())
+ if (!Subtarget.isSingleFloat() && !Subtarget.isMips32())
for (unsigned FReg=(Mips::F0)+1; FReg < Mips::F30; FReg+=2)
Reserved.set(FReg);
@@ -153,6 +155,8 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
RegScavenger *RS) const {
MachineInstr &MI = *II;
MachineFunction &MF = *MI.getParent()->getParent();
+ MachineFrameInfo *MFI = MF.getFrameInfo();
+ MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
unsigned i = 0;
while (!MI.getOperand(i).isFI()) {
@@ -172,9 +176,19 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
<< "spOffset : " << spOffset << "\n"
<< "stackSize : " << stackSize << "\n");
- // as explained on LowerFormalArguments, detect negative offsets
- // and adjust SPOffsets considering the final stack size.
- int Offset = ((spOffset < 0) ? (stackSize + (-(spOffset+4))) : (spOffset));
+ int Offset;
+
+ // Calculate final offset.
+ // - There is no need to change the offset if the frame object is an outgoing
+ // argument or a $gp restore location,
+ // - If the frame object is any of the following, its offset must be adjusted
+ // by adding the size of the stack:
+ // incoming argument, callee-saved register location or local variable.
+ if (MipsFI->isOutArgFI(FrameIndex) || MipsFI->isGPFI(FrameIndex))
+ Offset = spOffset;
+ else
+ Offset = spOffset + stackSize;
+
Offset += MI.getOperand(i-1).getImm();
DEBUG(errs() << "Offset : " << Offset << "\n" << "<--------->\n");
@@ -183,26 +197,45 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
int NewImm = 0;
MachineBasicBlock &MBB = *MI.getParent();
bool ATUsed;
- unsigned OrigReg = getFrameRegister(MF);
- int OrigImm = Offset;
+ unsigned FrameReg;
+ const std::vector<CalleeSavedInfo> &CSI = MFI->getCalleeSavedInfo();
+ int MinCSFI = 0;
+ int MaxCSFI = -1;
+
+ if (CSI.size()) {
+ MinCSFI = CSI[0].getFrameIdx();
+ MaxCSFI = CSI[CSI.size() - 1].getFrameIdx();
+ }
-// OrigImm fits in the 16-bit field
- if (OrigImm < 0x8000 && OrigImm >= -0x8000) {
- NewReg = OrigReg;
- NewImm = OrigImm;
+ // The following stack frame objects are always referenced relative to $sp:
+ // 1. Outgoing arguments.
+ // 2. Pointer to dynamically allocated stack space.
+ // 3. Locations for callee-saved registers.
+ // Everything else is referenced relative to whatever register
+ // getFrameRegister() returns.
+ if (MipsFI->isOutArgFI(FrameIndex) ||
+ (FrameIndex >= MinCSFI && FrameIndex <= MaxCSFI))
+ FrameReg = Mips::SP;
+ else
+ FrameReg = getFrameRegister(MF);
+
+ // Offset fits in the 16-bit field
+ if (Offset < 0x8000 && Offset >= -0x8000) {
+ NewReg = FrameReg;
+ NewImm = Offset;
ATUsed = false;
}
else {
const TargetInstrInfo *TII = MF.getTarget().getInstrInfo();
DebugLoc DL = II->getDebugLoc();
- int ImmLo = OrigImm & 0xffff;
- int ImmHi = (((unsigned)OrigImm & 0xffff0000) >> 16) +
- ((OrigImm & 0x8000) != 0);
+ int ImmLo = (short)(Offset & 0xffff);
+ int ImmHi = (((unsigned)Offset & 0xffff0000) >> 16) +
+ ((Offset & 0x8000) != 0);
// FIXME: change this when mips goes MC".
BuildMI(MBB, II, DL, TII->get(Mips::NOAT));
BuildMI(MBB, II, DL, TII->get(Mips::LUi), Mips::AT).addImm(ImmHi);
- BuildMI(MBB, II, DL, TII->get(Mips::ADDu), Mips::AT).addReg(OrigReg)
+ BuildMI(MBB, II, DL, TII->get(Mips::ADDu), Mips::AT).addReg(FrameReg)
.addReg(Mips::AT);
NewReg = Mips::AT;
NewImm = ImmLo;
@@ -218,15 +251,6 @@ eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj,
MI.getOperand(i-1).ChangeToImmediate(NewImm);
}
-void MipsRegisterInfo::
-processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
- // Set the stack offset where GP must be saved/loaded from.
- MachineFrameInfo *MFI = MF.getFrameInfo();
- MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
- if (MipsFI->needGPSaveRestore())
- MFI->setObjectOffset(MipsFI->getGPFI(), MipsFI->getGPStackOffset());
-}
-
unsigned MipsRegisterInfo::
getRARegister() const {
return Mips::RA;
@@ -253,8 +277,11 @@ getEHHandlerRegister() const {
int MipsRegisterInfo::
getDwarfRegNum(unsigned RegNum, bool isEH) const {
- llvm_unreachable("What is the dwarf register number");
- return -1;
+ return MipsGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
+}
+
+int MipsRegisterInfo::getLLVMRegNum(unsigned DwarfRegNo, bool isEH) const {
+ return MipsGenRegisterInfo::getLLVMRegNumFull(DwarfRegNo,0);
}
#include "MipsGenRegisterInfo.inc"
diff --git a/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h b/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h
index 767359f..76b0035 100644
--- a/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h
+++ b/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h
@@ -63,6 +63,7 @@ struct MipsRegisterInfo : public MipsGenRegisterInfo {
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
diff --git a/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td b/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td
index 9f9cae7..e97d450 100644
--- a/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td
+++ b/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td
@@ -44,6 +44,11 @@ class AFPR<bits<5> num, string n, list<Register> subregs>
let SubRegIndices = [sub_fpeven, sub_fpodd];
}
+// Mips Hardware Registers
+class HWR<bits<5> num, string n> : MipsReg<n> {
+ let Num = num;
+}
+
//===----------------------------------------------------------------------===//
// Registers
//===----------------------------------------------------------------------===//
@@ -55,7 +60,7 @@ let Namespace = "Mips" in {
def AT : MipsGPRReg< 1, "AT">, DwarfRegNum<[1]>;
def V0 : MipsGPRReg< 2, "2">, DwarfRegNum<[2]>;
def V1 : MipsGPRReg< 3, "3">, DwarfRegNum<[3]>;
- def A0 : MipsGPRReg< 4, "4">, DwarfRegNum<[5]>;
+ def A0 : MipsGPRReg< 4, "4">, DwarfRegNum<[4]>;
def A1 : MipsGPRReg< 5, "5">, DwarfRegNum<[5]>;
def A2 : MipsGPRReg< 6, "6">, DwarfRegNum<[6]>;
def A3 : MipsGPRReg< 7, "7">, DwarfRegNum<[7]>;
@@ -120,22 +125,22 @@ let Namespace = "Mips" in {
/// Mips Double point precision FPU Registers (aliased
/// with the single precision to hold 64 bit values)
- def D0 : AFPR< 0, "F0", [F0, F1]>, DwarfRegNum<[32]>;
- def D1 : AFPR< 2, "F2", [F2, F3]>, DwarfRegNum<[34]>;
- def D2 : AFPR< 4, "F4", [F4, F5]>, DwarfRegNum<[36]>;
- def D3 : AFPR< 6, "F6", [F6, F7]>, DwarfRegNum<[38]>;
- def D4 : AFPR< 8, "F8", [F8, F9]>, DwarfRegNum<[40]>;
- def D5 : AFPR<10, "F10", [F10, F11]>, DwarfRegNum<[42]>;
- def D6 : AFPR<12, "F12", [F12, F13]>, DwarfRegNum<[44]>;
- def D7 : AFPR<14, "F14", [F14, F15]>, DwarfRegNum<[46]>;
- def D8 : AFPR<16, "F16", [F16, F17]>, DwarfRegNum<[48]>;
- def D9 : AFPR<18, "F18", [F18, F19]>, DwarfRegNum<[50]>;
- def D10 : AFPR<20, "F20", [F20, F21]>, DwarfRegNum<[52]>;
- def D11 : AFPR<22, "F22", [F22, F23]>, DwarfRegNum<[54]>;
- def D12 : AFPR<24, "F24", [F24, F25]>, DwarfRegNum<[56]>;
- def D13 : AFPR<26, "F26", [F26, F27]>, DwarfRegNum<[58]>;
- def D14 : AFPR<28, "F28", [F28, F29]>, DwarfRegNum<[60]>;
- def D15 : AFPR<30, "F30", [F30, F31]>, DwarfRegNum<[62]>;
+ def D0 : AFPR< 0, "F0", [F0, F1]>;
+ def D1 : AFPR< 2, "F2", [F2, F3]>;
+ def D2 : AFPR< 4, "F4", [F4, F5]>;
+ def D3 : AFPR< 6, "F6", [F6, F7]>;
+ def D4 : AFPR< 8, "F8", [F8, F9]>;
+ def D5 : AFPR<10, "F10", [F10, F11]>;
+ def D6 : AFPR<12, "F12", [F12, F13]>;
+ def D7 : AFPR<14, "F14", [F14, F15]>;
+ def D8 : AFPR<16, "F16", [F16, F17]>;
+ def D9 : AFPR<18, "F18", [F18, F19]>;
+ def D10 : AFPR<20, "F20", [F20, F21]>;
+ def D11 : AFPR<22, "F22", [F22, F23]>;
+ def D12 : AFPR<24, "F24", [F24, F25]>;
+ def D13 : AFPR<26, "F26", [F26, F27]>;
+ def D14 : AFPR<28, "F28", [F28, F29]>;
+ def D15 : AFPR<30, "F30", [F30, F31]>;
// Hi/Lo registers
def HI : Register<"hi">, DwarfRegNum<[64]>;
@@ -143,6 +148,9 @@ let Namespace = "Mips" in {
// Status flags register
def FCR31 : Register<"31">;
+
+ // Hardware register $29
+ def HWR29 : Register<"29">;
}
//===----------------------------------------------------------------------===//
@@ -157,19 +165,7 @@ def CPURegs : RegisterClass<"Mips", [i32], 32,
// Callee save
S0, S1, S2, S3, S4, S5, S6, S7,
// Reserved
- ZERO, AT, K0, K1, GP, SP, FP, RA]>
-{
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- CPURegsClass::iterator
- CPURegsClass::allocation_order_end(const MachineFunction &MF) const {
- // The last 8 registers on the list above are reserved
- return end()-8;
- }
- }];
-}
+ ZERO, AT, K0, K1, GP, SP, FP, RA]>;
// 64bit fp:
// * FGR64 - 32 64-bit registers
@@ -186,52 +182,7 @@ def FGR32 : RegisterClass<"Mips", [f32], 32,
// Callee save
F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30,
// Reserved
- F31]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
-
- static const unsigned MIPS_FGR32[] = {
- Mips::F0, Mips::F1, Mips::F2, Mips::F3, Mips::F12, Mips::F13,
- Mips::F14, Mips::F15, Mips::F4, Mips::F5, Mips::F6, Mips::F7,
- Mips::F8, Mips::F9, Mips::F10, Mips::F11, Mips::F16, Mips::F17,
- Mips::F18, Mips::F19, Mips::F20, Mips::F21, Mips::F22, Mips::F23,
- Mips::F24, Mips::F25, Mips::F26, Mips::F27, Mips::F28, Mips::F29,
- Mips::F30
- };
-
- static const unsigned MIPS_SVR4_FGR32[] = {
- Mips::F0, Mips::F2, Mips::F12, Mips::F14, Mips::F4,
- Mips::F6, Mips::F8, Mips::F10, Mips::F16, Mips::F18,
- Mips::F20, Mips::F22, Mips::F24, Mips::F26, Mips::F28, Mips::F30,
- };
-
- FGR32Class::iterator
- FGR32Class::allocation_order_begin(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const MipsSubtarget &Subtarget = TM.getSubtarget<MipsSubtarget>();
-
- if (Subtarget.isSingleFloat())
- return MIPS_FGR32;
- else
- return MIPS_SVR4_FGR32;
- }
-
- FGR32Class::iterator
- FGR32Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const MipsSubtarget &Subtarget = TM.getSubtarget<MipsSubtarget>();
-
- if (Subtarget.isSingleFloat())
- return MIPS_FGR32 + (sizeof(MIPS_FGR32) / sizeof(unsigned));
- else
- return MIPS_SVR4_FGR32 + (sizeof(MIPS_SVR4_FGR32) / sizeof(unsigned));
- }
- }];
-}
+ F31]>;
def AFGR64 : RegisterClass<"Mips", [f64], 64,
// Return Values and Arguments
@@ -241,19 +192,8 @@ def AFGR64 : RegisterClass<"Mips", [f64], 64,
// Callee save
D10, D11, D12, D13, D14,
// Reserved
- D15]>
-{
+ D15]> {
let SubRegClasses = [(FGR32 sub_fpeven, sub_fpodd)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- AFGR64Class::iterator
- AFGR64Class::allocation_order_end(const MachineFunction &MF) const {
- // The last register on the list above is reserved
- return end()-1;
- }
- }];
}
// Condition Register for floating point operations
@@ -262,3 +202,5 @@ def CCR : RegisterClass<"Mips", [i32], 32, [FCR31]>;
// Hi/Lo Registers
def HILO : RegisterClass<"Mips", [i32], 32, [HI, LO]>;
+// Hardware registers
+def HWRegs : RegisterClass<"Mips", [i32], 32, [HWR29]>;
diff --git a/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp
index 53190b4..cfbb92c 100644
--- a/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp
+++ b/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp
@@ -38,8 +38,9 @@ MipsTargetMachine(const Target &T, const std::string &TT, const std::string &FS,
bool isLittle=false):
LLVMTargetMachine(T, TT),
Subtarget(TT, FS, isLittle),
- DataLayout(isLittle ? std::string("e-p:32:32:32-i8:8:32-i16:16:32-n32") :
- std::string("E-p:32:32:32-i8:8:32-i16:16:32-n32")),
+ DataLayout(isLittle ?
+ std::string("e-p:32:32:32-i8:8:32-i16:16:32-i64:64:64-n32") :
+ std::string("E-p:32:32:32-i8:8:32-i16:16:32-i64:64:64-n32")),
InstrInfo(*this),
FrameLowering(Subtarget),
TLInfo(*this), TSInfo(*this) {
@@ -77,6 +78,12 @@ addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel)
}
bool MipsTargetMachine::
+addPreRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) {
+ PM.add(createMipsEmitGPRestorePass(*this));
+ return true;
+}
+
+bool MipsTargetMachine::
addPostRegAlloc(PassManagerBase &PM, CodeGenOpt::Level OptLevel) {
PM.add(createMipsExpandPseudoPass(*this));
return true;
diff --git a/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h b/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h
index badb652..102dd85 100644
--- a/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h
+++ b/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h
@@ -63,6 +63,8 @@ namespace llvm {
CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM,
CodeGenOpt::Level OptLevel);
+ virtual bool addPreRegAlloc(PassManagerBase &PM,
+ CodeGenOpt::Level OptLevel);
virtual bool addPostRegAlloc(PassManagerBase &, CodeGenOpt::Level);
};
diff --git a/contrib/llvm/lib/Target/PTX/PTX.td b/contrib/llvm/lib/Target/PTX/PTX.td
index ae8326e..231866a 100644
--- a/contrib/llvm/lib/Target/PTX/PTX.td
+++ b/contrib/llvm/lib/Target/PTX/PTX.td
@@ -24,6 +24,9 @@ include "llvm/Target/Target.td"
def FeatureDouble : SubtargetFeature<"double", "SupportsDouble", "true",
"Do not demote .f64 to .f32">;
+def FeatureNoFMA : SubtargetFeature<"no-fma","SupportsFMA", "false",
+ "Disable Fused-Multiply Add">;
+
//===- PTX Version --------------------------------------------------------===//
def FeaturePTX20 : SubtargetFeature<"ptx20", "PTXVersion", "PTX_VERSION_2_0",
@@ -38,6 +41,10 @@ def FeaturePTX22 : SubtargetFeature<"ptx22", "PTXVersion", "PTX_VERSION_2_2",
"Use PTX Language Version 2.2",
[FeaturePTX21]>;
+def FeaturePTX23 : SubtargetFeature<"ptx23", "PTXVersion", "PTX_VERSION_2_3",
+ "Use PTX Language Version 2.3",
+ [FeaturePTX22]>;
+
//===- PTX Shader Model ---------------------------------------------------===//
def FeatureSM10 : SubtargetFeature<"sm10", "PTXShaderModel", "PTX_SM_1_0",
diff --git a/contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp b/contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp
index 23b93da..e9b1d8c 100644
--- a/contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp
+++ b/contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp
@@ -65,7 +65,9 @@ PTXTargetLowering::PTXTargetLowering(TargetMachine &TM)
// need to lower SETCC of Preds into bitwise logic
setOperationAction(ISD::SETCC, MVT::i1, Custom);
-
+
+ setMinFunctionAlignment(2);
+
// Compute derived properties from the register classes
computeRegisterProperties();
}
diff --git a/contrib/llvm/lib/Target/PTX/PTXISelLowering.h b/contrib/llvm/lib/Target/PTX/PTXISelLowering.h
index 6a7e3e6..225c000 100644
--- a/contrib/llvm/lib/Target/PTX/PTXISelLowering.h
+++ b/contrib/llvm/lib/Target/PTX/PTXISelLowering.h
@@ -37,9 +37,6 @@ class PTXTargetLowering : public TargetLowering {
virtual const char *getTargetNodeName(unsigned Opcode) const;
- virtual unsigned getFunctionAlignment(const Function *F) const {
- return 2; }
-
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
virtual SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
diff --git a/contrib/llvm/lib/Target/PTX/PTXInstrInfo.td b/contrib/llvm/lib/Target/PTX/PTXInstrInfo.td
index 1ac9d3f..d5d08be 100644
--- a/contrib/llvm/lib/Target/PTX/PTXInstrInfo.td
+++ b/contrib/llvm/lib/Target/PTX/PTXInstrInfo.td
@@ -36,6 +36,12 @@ def SupportsPTX21 : Predicate<"getSubtarget().supportsPTX21()">;
def DoesNotSupportPTX21 : Predicate<"!getSubtarget().supportsPTX21()">;
def SupportsPTX22 : Predicate<"getSubtarget().supportsPTX22()">;
def DoesNotSupportPTX22 : Predicate<"!getSubtarget().supportsPTX22()">;
+def SupportsPTX23 : Predicate<"getSubtarget().supportsPTX23()">;
+def DoesNotSupportPTX23 : Predicate<"!getSubtarget().supportsPTX23()">;
+
+// Fused-Multiply Add
+def SupportsFMA : Predicate<"getSubtarget().supportsFMA()">;
+def DoesNotSupportFMA : Predicate<"!getSubtarget().supportsFMA()">;
//===----------------------------------------------------------------------===//
// Instruction Pattern Stuff
@@ -627,8 +633,8 @@ def FDIVri64SM10 : InstPTX<(outs RRegf64:$d),
// In the short term, mad is supported on all PTX versions and we use a
// default rounding mode no matter what shader model or PTX version.
// TODO: Allow the rounding mode to be selectable through llc.
-defm FMADSM13 : PTX_FLOAT_4OP<"mad.rn", fmul, fadd>, Requires<[SupportsSM13]>;
-defm FMAD : PTX_FLOAT_4OP<"mad", fmul, fadd>, Requires<[DoesNotSupportSM13]>;
+defm FMADSM13 : PTX_FLOAT_4OP<"mad.rn", fmul, fadd>, Requires<[SupportsSM13, SupportsFMA]>;
+defm FMAD : PTX_FLOAT_4OP<"mad", fmul, fadd>, Requires<[DoesNotSupportSM13, SupportsFMA]>;
///===- Floating-Point Intrinsic Instructions -----------------------------===//
@@ -665,6 +671,8 @@ def FCOS64 : InstPTX<(outs RRegf64:$d),
///===- Comparison and Selection Instructions -----------------------------===//
+// .setp
+
// Compare u16
defm SETPEQu16 : PTX_SETP_I<RRegu16, "u16", i16imm, SETEQ, "eq">;
diff --git a/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h b/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h
index 67e130f..dc56352 100644
--- a/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h
+++ b/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h
@@ -57,6 +57,9 @@ struct PTXRegisterInfo : public PTXGenRegisterInfo {
virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const {
return PTXGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
+ virtual int getLLVMRegNum(unsigned RegNum, bool isEH) const {
+ return PTXGenRegisterInfo::getLLVMRegNumFull(RegNum, 0);
+ }
}; // struct PTXRegisterInfo
} // namespace llvm
diff --git a/contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp b/contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp
index a224f2b..e8a1dfe 100644
--- a/contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp
+++ b/contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp
@@ -21,7 +21,8 @@ PTXSubtarget::PTXSubtarget(const std::string &TT, const std::string &FS,
: PTXShaderModel(PTX_SM_1_0),
PTXVersion(PTX_VERSION_2_0),
SupportsDouble(false),
- Is64Bit(is64Bit) {
+ SupportsFMA(true),
+ Is64Bit(is64Bit) {
std::string TARGET = "generic";
ParseSubtargetFeatures(FS, TARGET);
}
@@ -41,6 +42,7 @@ std::string PTXSubtarget::getPTXVersionString() const {
case PTX_VERSION_2_0: return "2.0";
case PTX_VERSION_2_1: return "2.1";
case PTX_VERSION_2_2: return "2.2";
+ case PTX_VERSION_2_3: return "2.3";
}
}
diff --git a/contrib/llvm/lib/Target/PTX/PTXSubtarget.h b/contrib/llvm/lib/Target/PTX/PTXSubtarget.h
index 47d9842..59fa696 100644
--- a/contrib/llvm/lib/Target/PTX/PTXSubtarget.h
+++ b/contrib/llvm/lib/Target/PTX/PTXSubtarget.h
@@ -37,7 +37,8 @@ namespace llvm {
enum PTXVersionEnum {
PTX_VERSION_2_0, /*< PTX Version 2.0 */
PTX_VERSION_2_1, /*< PTX Version 2.1 */
- PTX_VERSION_2_2 /*< PTX Version 2.2 */
+ PTX_VERSION_2_2, /*< PTX Version 2.2 */
+ PTX_VERSION_2_3 /*< PTX Version 2.3 */
};
/// Shader Model supported on the target GPU.
@@ -48,7 +49,10 @@ namespace llvm {
// The native .f64 type is supported on the hardware.
bool SupportsDouble;
-
+
+ // Support the fused-multiply add (FMA) and multiply-add (MAD) instructions
+ bool SupportsFMA;
+
// Use .u64 instead of .u32 for addresses.
bool Is64Bit;
@@ -63,6 +67,8 @@ namespace llvm {
bool is64Bit() const { return Is64Bit; }
+ bool supportsFMA() const { return SupportsFMA; }
+
bool supportsSM13() const { return PTXShaderModel >= PTX_SM_1_3; }
bool supportsSM20() const { return PTXShaderModel >= PTX_SM_2_0; }
@@ -71,6 +77,8 @@ namespace llvm {
bool supportsPTX22() const { return PTXVersion >= PTX_VERSION_2_2; }
+ bool supportsPTX23() const { return PTXVersion >= PTX_VERSION_2_3; }
+
std::string ParseSubtargetFeatures(const std::string &FS,
const std::string &CPU);
}; // class PTXSubtarget
diff --git a/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp b/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
index c8db0c4..1a9bd76 100644
--- a/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
@@ -26,6 +26,9 @@ StringRef PPCInstPrinter::getOpcodeName(unsigned Opcode) const {
return getInstructionName(Opcode);
}
+void PPCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
+ OS << getRegisterName(RegNo);
+}
void PPCInstPrinter::printInst(const MCInst *MI, raw_ostream &O) {
// Check for slwi/srwi mnemonics.
diff --git a/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h b/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h
index 9cf9db9..adfa0aa 100644
--- a/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h
+++ b/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h
@@ -33,6 +33,7 @@ public:
return SyntaxVariant == 1;
}
+ virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
virtual void printInst(const MCInst *MI, raw_ostream &O);
virtual StringRef getOpcodeName(unsigned Opcode) const;
diff --git a/contrib/llvm/lib/Target/PowerPC/PPC.h b/contrib/llvm/lib/Target/PowerPC/PPC.h
index 7242f3a..92672b5 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPC.h
+++ b/contrib/llvm/lib/Target/PowerPC/PPC.h
@@ -43,7 +43,7 @@ namespace llvm {
TargetAsmBackend *createPPCAsmBackend(const Target &, const std::string &);
void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
- AsmPrinter &AP);
+ AsmPrinter &AP, bool isDarwin);
extern Target ThePPC32Target;
extern Target ThePPC64Target;
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 09a9be9..b795db9 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -344,7 +344,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
}
case PPC::LDtoc: {
// Transform %X3 = LDtoc <ga:@min1>, %X2
- LowerPPCMachineInstrToMCInst(MI, TmpInst, *this);
+ LowerPPCMachineInstrToMCInst(MI, TmpInst, *this, Subtarget.isDarwin());
// Change the opcode to LD, and the global address operand to be a
// reference to the TOC entry we will synthesize later.
@@ -376,7 +376,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
return;
}
- LowerPPCMachineInstrToMCInst(MI, TmpInst, *this);
+ LowerPPCMachineInstrToMCInst(MI, TmpInst, *this, Subtarget.isDarwin());
OutStreamer.EmitInstruction(TmpInst);
}
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
index 6aca6b0..375e000 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
@@ -259,8 +259,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF) const {
MachineModuleInfo &MMI = MF.getMMI();
DebugLoc dl;
bool needsFrameMoves = MMI.hasDebugInfo() ||
- !MF.getFunction()->doesNotThrow() ||
- UnwindTablesMandatory;
+ MF.getFunction()->needsUnwindTableEntry();
// Prepare for frame info.
MCSymbol *FrameLabel = 0;
@@ -488,6 +487,14 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF) const {
int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx());
unsigned Reg = CSI[I].getReg();
if (Reg == PPC::LR || Reg == PPC::LR8 || Reg == PPC::RM) continue;
+
+ // This is a bit of a hack: CR2LT, CR2GT, CR2EQ and CR2UN are just
+ // subregisters of CR2. We just need to emit a move of CR2.
+ if (Reg == PPC::CR2LT || Reg == PPC::CR2GT || Reg == PPC::CR2EQ)
+ continue;
+ if (Reg == PPC::CR2UN)
+ Reg = PPC::CR2;
+
MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
MachineLocation CSSrc(Reg);
Moves.push_back(MachineMove(Label, CSDst, CSSrc));
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp b/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp
index 0de5844..74ecff5 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp
@@ -233,7 +233,7 @@ void PPCHazardRecognizer970::EmitInstruction(SUnit *SU) {
unsigned Opcode = Node->getMachineOpcode();
// Update structural hazard information.
- if (Opcode == PPC::MTCTR) HasCTRSet = true;
+ if (Opcode == PPC::MTCTR || Opcode == PPC::MTCTR8) HasCTRSet = true;
// Track the address stored to.
if (isStore) {
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index faae9b2..511bb22 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -240,11 +240,11 @@ SDNode *PPCDAGToDAGISel::getGlobalBaseReg() {
if (PPCLowering.getPointerTy() == MVT::i32) {
GlobalBaseReg = RegInfo->createVirtualRegister(PPC::GPRCRegisterClass);
- BuildMI(FirstMBB, MBBI, dl, TII.get(PPC::MovePCtoLR), PPC::LR);
+ BuildMI(FirstMBB, MBBI, dl, TII.get(PPC::MovePCtoLR));
BuildMI(FirstMBB, MBBI, dl, TII.get(PPC::MFLR), GlobalBaseReg);
} else {
GlobalBaseReg = RegInfo->createVirtualRegister(PPC::G8RCRegisterClass);
- BuildMI(FirstMBB, MBBI, dl, TII.get(PPC::MovePCtoLR8), PPC::LR8);
+ BuildMI(FirstMBB, MBBI, dl, TII.get(PPC::MovePCtoLR8));
BuildMI(FirstMBB, MBBI, dl, TII.get(PPC::MFLR8), GlobalBaseReg);
}
}
@@ -1057,9 +1057,10 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
SDValue Chain = N->getOperand(0);
SDValue Target = N->getOperand(1);
unsigned Opc = Target.getValueType() == MVT::i32 ? PPC::MTCTR : PPC::MTCTR8;
+ unsigned Reg = Target.getValueType() == MVT::i32 ? PPC::BCTR : PPC::BCTR8;
Chain = SDValue(CurDAG->getMachineNode(Opc, dl, MVT::Other, Target,
Chain), 0);
- return CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain);
+ return CurDAG->SelectNodeTo(N, Reg, MVT::Other, Chain);
}
}
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 128522c..dbb184c 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -394,6 +394,10 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM)
setLibcallName(RTLIB::EXP2_PPCF128, "exp2l$LDBL128");
}
+ setMinFunctionAlignment(2);
+ if (PPCSubTarget.isDarwin())
+ setPrefFunctionAlignment(4);
+
computeRegisterProperties();
}
@@ -460,14 +464,6 @@ MVT::SimpleValueType PPCTargetLowering::getSetCCResultType(EVT VT) const {
return MVT::i32;
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned PPCTargetLowering::getFunctionAlignment(const Function *F) const {
- if (getTargetMachine().getSubtarget<PPCSubtarget>().isDarwin())
- return F->hasFnAttr(Attribute::OptimizeForSize) ? 2 : 4;
- else
- return 2;
-}
-
//===----------------------------------------------------------------------===//
// Node matching predicates, for use by the tblgen matching code.
//===----------------------------------------------------------------------===//
@@ -1014,7 +1010,8 @@ bool PPCTargetLowering::SelectAddressRegImmShift(SDValue N, SDValue &Disp,
short Imm;
if (isIntS16Immediate(CN, Imm)) {
Disp = DAG.getTargetConstant((unsigned short)Imm >> 2, getPointerTy());
- Base = DAG.getRegister(PPC::R0, CN->getValueType(0));
+ Base = DAG.getRegister(PPCSubTarget.isPPC64() ? PPC::X0 : PPC::R0,
+ CN->getValueType(0));
return true;
}
@@ -1561,8 +1558,8 @@ PPCTargetLowering::LowerFormalArguments_SVR4(
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
// Reserve space for the linkage area on the stack.
CCInfo.AllocateStack(PPCFrameLowering::getLinkageSize(false, false), PtrByteSize);
@@ -1622,8 +1619,8 @@ PPCTargetLowering::LowerFormalArguments_SVR4(
// Aggregates passed by value are stored in the local variable space of the
// caller's stack frame, right above the parameter list area.
SmallVector<CCValAssign, 16> ByValArgLocs;
- CCState CCByValInfo(CallConv, isVarArg, getTargetMachine(),
- ByValArgLocs, *DAG.getContext());
+ CCState CCByValInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ByValArgLocs, *DAG.getContext());
// Reserve stack space for the allocations in CCInfo.
CCByValInfo.AllocateStack(CCInfo.getNextStackOffset(), PtrByteSize);
@@ -2565,7 +2562,7 @@ unsigned PrepareCall(SelectionDAG &DAG, SDValue &Callee, SDValue &InFlag,
Callee.setNode(0);
// Add CTR register as callee so a bctr can be emitted later.
if (isTailCall)
- Ops.push_back(DAG.getRegister(PPC::CTR, PtrVT));
+ Ops.push_back(DAG.getRegister(isPPC64 ? PPC::CTR8 : PPC::CTR, PtrVT));
}
// If this is a direct call, pass the chain and the callee.
@@ -2594,8 +2591,8 @@ PPCTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
SmallVectorImpl<SDValue> &InVals) const {
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCRetInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCRetInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCRetInfo.AnalyzeCallResult(Ins, RetCC_PPC);
// Copy all of the result registers out of their specified physreg.
@@ -2644,8 +2641,8 @@ PPCTargetLowering::FinishCall(CallingConv::ID CallConv, DebugLoc dl,
// to the liveout set for the function.
if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), RVLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_PPC);
for (unsigned i = 0; i != RVLocs.size(); ++i)
DAG.getMachineFunction().getRegInfo().addLiveOut(RVLocs[i].getLocReg());
@@ -2758,8 +2755,8 @@ PPCTargetLowering::LowerCall_SVR4(SDValue Chain, SDValue Callee,
// Assign locations to all of the outgoing arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
// Reserve space for the linkage area on the stack.
CCInfo.AllocateStack(PPCFrameLowering::getLinkageSize(false, false), PtrByteSize);
@@ -2798,8 +2795,8 @@ PPCTargetLowering::LowerCall_SVR4(SDValue Chain, SDValue Callee,
// Assign locations to all of the outgoing aggregate by value arguments.
SmallVector<CCValAssign, 16> ByValArgLocs;
- CCState CCByValInfo(CallConv, isVarArg, getTargetMachine(), ByValArgLocs,
- *DAG.getContext());
+ CCState CCByValInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ByValArgLocs, *DAG.getContext());
// Reserve stack space for the allocations in CCInfo.
CCByValInfo.AllocateStack(CCInfo.getNextStackOffset(), PtrByteSize);
@@ -3306,8 +3303,8 @@ PPCTargetLowering::LowerReturn(SDValue Chain,
DebugLoc dl, SelectionDAG &DAG) const {
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeReturn(Outs, RetCC_PPC);
// If this is the first return lowered for this function, add the regs to the
@@ -5442,10 +5439,16 @@ PPCTargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint,
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
-void PPCTargetLowering::LowerAsmOperandForConstraint(SDValue Op, char Letter,
+void PPCTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
+ std::string &Constraint,
std::vector<SDValue>&Ops,
SelectionDAG &DAG) const {
SDValue Result(0,0);
+
+ // Only support length 1 constraints.
+ if (Constraint.length() > 1) return;
+
+ char Letter = Constraint[0];
switch (Letter) {
default: break;
case 'I':
@@ -5501,7 +5504,7 @@ void PPCTargetLowering::LowerAsmOperandForConstraint(SDValue Op, char Letter,
}
// Handle standard constraint letters.
- TargetLowering::LowerAsmOperandForConstraint(Op, Letter, Ops, DAG);
+ TargetLowering::LowerAsmOperandForConstraint(Op, Constraint, Ops, DAG);
}
// isLegalAddressingMode - Return true if the addressing mode represented
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h b/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h
index 33daae9..986b4e7 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h
+++ b/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h
@@ -328,7 +328,7 @@ namespace llvm {
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
virtual void LowerAsmOperandForConstraint(SDValue Op,
- char ConstraintLetter,
+ std::string &Constraint,
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const;
@@ -364,9 +364,6 @@ namespace llvm {
bool NonScalarIntSafe, bool MemcpyStrSrc,
MachineFunction &MF) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
private:
SDValue getFramePointerFrameIndex(SelectionDAG & DAG) const;
SDValue getReturnAddrFrameIndex(SelectionDAG & DAG) const;
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td b/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td
index 9f0fae5..e88ad37 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td
+++ b/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td
@@ -60,7 +60,7 @@ def HI48_64 : SDNodeXForm<imm, [{
//
let Defs = [LR8] in
- def MovePCtoLR8 : Pseudo<(outs), (ins piclabel:$label), "", []>,
+ def MovePCtoLR8 : Pseudo<(outs), (ins), "", []>,
PPC970_Unit_BRU;
// Darwin ABI Calls.
@@ -190,10 +190,15 @@ def TCRETURNri8 : Pseudo<(outs), (ins CTRRC8:$dst, i32imm:$offset, variable_ops)
let isTerminator = 1, isBarrier = 1, PPC970_Unit = 7, isBranch = 1,
- isIndirectBranch = 1, isCall = 1, isReturn = 1, Uses = [CTR, RM] in
-def TAILBCTR8 : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>,
- Requires<[In64BitMode]>;
+ isIndirectBranch = 1, isCall = 1, Uses = [CTR8, RM] in {
+ let isReturn = 1 in {
+ def TAILBCTR8 : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>,
+ Requires<[In64BitMode]>;
+ }
+ def BCTR8 : XLForm_2_ext<19, 528, 20, 0, 0, (outs), (ins), "bctr", BrB, []>,
+ Requires<[In64BitMode]>;
+}
let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7,
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td
index 24071b7..773578c 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td
@@ -300,7 +300,6 @@ def calltarget : Operand<iPTR> {
def aaddr : Operand<iPTR> {
let PrintMethod = "printAbsAddrOperand";
}
-def piclabel: Operand<iPTR> {}
def symbolHi: Operand<i32> {
let PrintMethod = "printSymbolHi";
let EncoderMethod = "getHA16Encoding";
@@ -413,7 +412,7 @@ let isTerminator = 1, isBarrier = 1, PPC970_Unit = 7 in {
}
let Defs = [LR] in
- def MovePCtoLR : Pseudo<(outs), (ins piclabel:$label), "", []>,
+ def MovePCtoLR : Pseudo<(outs), (ins), "", []>,
PPC970_Unit_BRU;
let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7 in {
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp b/contrib/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp
index 9e508cc..2d5c880 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp
@@ -48,7 +48,7 @@ PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
// Exceptions handling
if (!is64Bit)
- ExceptionsType = ExceptionHandling::DwarfTable;
+ ExceptionsType = ExceptionHandling::DwarfCFI;
ZeroDirective = "\t.space\t";
Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp b/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
index 6082587..33af426 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
@@ -95,14 +95,14 @@ static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){
}
static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
- AsmPrinter &Printer) {
+ AsmPrinter &Printer, bool isDarwin) {
MCContext &Ctx = Printer.OutContext;
MCSymbolRefExpr::VariantKind RefKind = MCSymbolRefExpr::VK_None;
if (MO.getTargetFlags() & PPCII::MO_LO16)
- RefKind = MCSymbolRefExpr::VK_PPC_LO16;
+ RefKind = isDarwin ? MCSymbolRefExpr::VK_PPC_DARWIN_LO16 : MCSymbolRefExpr::VK_PPC_GAS_LO16;
else if (MO.getTargetFlags() & PPCII::MO_HA16)
- RefKind = MCSymbolRefExpr::VK_PPC_HA16;
+ RefKind = isDarwin ? MCSymbolRefExpr::VK_PPC_DARWIN_HA16 : MCSymbolRefExpr::VK_PPC_GAS_HA16;
// FIXME: This isn't right, but we don't have a good way to express this in
// the MC Level, see below.
@@ -130,7 +130,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
}
void llvm::LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
- AsmPrinter &AP) {
+ AsmPrinter &AP, bool isDarwin) {
OutMI.setOpcode(MI->getOpcode());
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
@@ -154,16 +154,17 @@ void llvm::LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
break;
case MachineOperand::MO_GlobalAddress:
case MachineOperand::MO_ExternalSymbol:
- MCOp = GetSymbolRef(MO, GetSymbolFromOperand(MO, AP), AP);
+ MCOp = GetSymbolRef(MO, GetSymbolFromOperand(MO, AP), AP, isDarwin);
break;
case MachineOperand::MO_JumpTableIndex:
- MCOp = GetSymbolRef(MO, AP.GetJTISymbol(MO.getIndex()), AP);
+ MCOp = GetSymbolRef(MO, AP.GetJTISymbol(MO.getIndex()), AP, isDarwin);
break;
case MachineOperand::MO_ConstantPoolIndex:
- MCOp = GetSymbolRef(MO, AP.GetCPISymbol(MO.getIndex()), AP);
+ MCOp = GetSymbolRef(MO, AP.GetCPISymbol(MO.getIndex()), AP, isDarwin);
break;
case MachineOperand::MO_BlockAddress:
- MCOp = GetSymbolRef(MO,AP.GetBlockAddressSymbol(MO.getBlockAddress()),AP);
+ MCOp = GetSymbolRef(MO,AP.GetBlockAddressSymbol(MO.getBlockAddress()),AP,
+ isDarwin);
break;
}
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp b/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
index 45d8b6b..3374e9b 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
@@ -686,9 +686,28 @@ unsigned PPCRegisterInfo::getEHHandlerRegister() const {
return !Subtarget.isPPC64() ? PPC::R4 : PPC::X4;
}
+/// DWARFFlavour - Flavour of dwarf regnumbers
+///
+namespace DWARFFlavour {
+ enum {
+ PPC64 = 0, PPC32 = 1
+ };
+}
+
int PPCRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
// FIXME: Most probably dwarf numbers differs for Linux and Darwin
- return PPCGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
+ unsigned Flavour = Subtarget.isPPC64() ?
+ DWARFFlavour::PPC64 : DWARFFlavour::PPC32;
+
+ return PPCGenRegisterInfo::getDwarfRegNumFull(RegNum, Flavour);
+}
+
+int PPCRegisterInfo::getLLVMRegNum(unsigned RegNum, bool isEH) const {
+ // FIXME: Most probably dwarf numbers differs for Linux and Darwin
+ unsigned Flavour = Subtarget.isPPC64() ?
+ DWARFFlavour::PPC64 : DWARFFlavour::PPC32;
+
+ return PPCGenRegisterInfo::getLLVMRegNumFull(RegNum, Flavour);
}
#include "PPCGenRegisterInfo.inc"
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h b/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h
index aa29ffe..48c2562 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h
+++ b/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h
@@ -68,6 +68,7 @@ public:
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td b/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td
index 2639165..3c01901 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td
+++ b/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td
@@ -65,203 +65,203 @@ class CRBIT<bits<5> num, string n> : PPCReg<n> {
// General-purpose registers
-def R0 : GPR< 0, "r0">, DwarfRegNum<[0]>;
-def R1 : GPR< 1, "r1">, DwarfRegNum<[1]>;
-def R2 : GPR< 2, "r2">, DwarfRegNum<[2]>;
-def R3 : GPR< 3, "r3">, DwarfRegNum<[3]>;
-def R4 : GPR< 4, "r4">, DwarfRegNum<[4]>;
-def R5 : GPR< 5, "r5">, DwarfRegNum<[5]>;
-def R6 : GPR< 6, "r6">, DwarfRegNum<[6]>;
-def R7 : GPR< 7, "r7">, DwarfRegNum<[7]>;
-def R8 : GPR< 8, "r8">, DwarfRegNum<[8]>;
-def R9 : GPR< 9, "r9">, DwarfRegNum<[9]>;
-def R10 : GPR<10, "r10">, DwarfRegNum<[10]>;
-def R11 : GPR<11, "r11">, DwarfRegNum<[11]>;
-def R12 : GPR<12, "r12">, DwarfRegNum<[12]>;
-def R13 : GPR<13, "r13">, DwarfRegNum<[13]>;
-def R14 : GPR<14, "r14">, DwarfRegNum<[14]>;
-def R15 : GPR<15, "r15">, DwarfRegNum<[15]>;
-def R16 : GPR<16, "r16">, DwarfRegNum<[16]>;
-def R17 : GPR<17, "r17">, DwarfRegNum<[17]>;
-def R18 : GPR<18, "r18">, DwarfRegNum<[18]>;
-def R19 : GPR<19, "r19">, DwarfRegNum<[19]>;
-def R20 : GPR<20, "r20">, DwarfRegNum<[20]>;
-def R21 : GPR<21, "r21">, DwarfRegNum<[21]>;
-def R22 : GPR<22, "r22">, DwarfRegNum<[22]>;
-def R23 : GPR<23, "r23">, DwarfRegNum<[23]>;
-def R24 : GPR<24, "r24">, DwarfRegNum<[24]>;
-def R25 : GPR<25, "r25">, DwarfRegNum<[25]>;
-def R26 : GPR<26, "r26">, DwarfRegNum<[26]>;
-def R27 : GPR<27, "r27">, DwarfRegNum<[27]>;
-def R28 : GPR<28, "r28">, DwarfRegNum<[28]>;
-def R29 : GPR<29, "r29">, DwarfRegNum<[29]>;
-def R30 : GPR<30, "r30">, DwarfRegNum<[30]>;
-def R31 : GPR<31, "r31">, DwarfRegNum<[31]>;
+def R0 : GPR< 0, "r0">, DwarfRegNum<[-2, 0]>;
+def R1 : GPR< 1, "r1">, DwarfRegNum<[-2, 1]>;
+def R2 : GPR< 2, "r2">, DwarfRegNum<[-2, 2]>;
+def R3 : GPR< 3, "r3">, DwarfRegNum<[-2, 3]>;
+def R4 : GPR< 4, "r4">, DwarfRegNum<[-2, 4]>;
+def R5 : GPR< 5, "r5">, DwarfRegNum<[-2, 5]>;
+def R6 : GPR< 6, "r6">, DwarfRegNum<[-2, 6]>;
+def R7 : GPR< 7, "r7">, DwarfRegNum<[-2, 7]>;
+def R8 : GPR< 8, "r8">, DwarfRegNum<[-2, 8]>;
+def R9 : GPR< 9, "r9">, DwarfRegNum<[-2, 9]>;
+def R10 : GPR<10, "r10">, DwarfRegNum<[-2, 10]>;
+def R11 : GPR<11, "r11">, DwarfRegNum<[-2, 11]>;
+def R12 : GPR<12, "r12">, DwarfRegNum<[-2, 12]>;
+def R13 : GPR<13, "r13">, DwarfRegNum<[-2, 13]>;
+def R14 : GPR<14, "r14">, DwarfRegNum<[-2, 14]>;
+def R15 : GPR<15, "r15">, DwarfRegNum<[-2, 15]>;
+def R16 : GPR<16, "r16">, DwarfRegNum<[-2, 16]>;
+def R17 : GPR<17, "r17">, DwarfRegNum<[-2, 17]>;
+def R18 : GPR<18, "r18">, DwarfRegNum<[-2, 18]>;
+def R19 : GPR<19, "r19">, DwarfRegNum<[-2, 19]>;
+def R20 : GPR<20, "r20">, DwarfRegNum<[-2, 20]>;
+def R21 : GPR<21, "r21">, DwarfRegNum<[-2, 21]>;
+def R22 : GPR<22, "r22">, DwarfRegNum<[-2, 22]>;
+def R23 : GPR<23, "r23">, DwarfRegNum<[-2, 23]>;
+def R24 : GPR<24, "r24">, DwarfRegNum<[-2, 24]>;
+def R25 : GPR<25, "r25">, DwarfRegNum<[-2, 25]>;
+def R26 : GPR<26, "r26">, DwarfRegNum<[-2, 26]>;
+def R27 : GPR<27, "r27">, DwarfRegNum<[-2, 27]>;
+def R28 : GPR<28, "r28">, DwarfRegNum<[-2, 28]>;
+def R29 : GPR<29, "r29">, DwarfRegNum<[-2, 29]>;
+def R30 : GPR<30, "r30">, DwarfRegNum<[-2, 30]>;
+def R31 : GPR<31, "r31">, DwarfRegNum<[-2, 31]>;
// 64-bit General-purpose registers
-def X0 : GP8< R0, "r0">, DwarfRegNum<[0]>;
-def X1 : GP8< R1, "r1">, DwarfRegNum<[1]>;
-def X2 : GP8< R2, "r2">, DwarfRegNum<[2]>;
-def X3 : GP8< R3, "r3">, DwarfRegNum<[3]>;
-def X4 : GP8< R4, "r4">, DwarfRegNum<[4]>;
-def X5 : GP8< R5, "r5">, DwarfRegNum<[5]>;
-def X6 : GP8< R6, "r6">, DwarfRegNum<[6]>;
-def X7 : GP8< R7, "r7">, DwarfRegNum<[7]>;
-def X8 : GP8< R8, "r8">, DwarfRegNum<[8]>;
-def X9 : GP8< R9, "r9">, DwarfRegNum<[9]>;
-def X10 : GP8<R10, "r10">, DwarfRegNum<[10]>;
-def X11 : GP8<R11, "r11">, DwarfRegNum<[11]>;
-def X12 : GP8<R12, "r12">, DwarfRegNum<[12]>;
-def X13 : GP8<R13, "r13">, DwarfRegNum<[13]>;
-def X14 : GP8<R14, "r14">, DwarfRegNum<[14]>;
-def X15 : GP8<R15, "r15">, DwarfRegNum<[15]>;
-def X16 : GP8<R16, "r16">, DwarfRegNum<[16]>;
-def X17 : GP8<R17, "r17">, DwarfRegNum<[17]>;
-def X18 : GP8<R18, "r18">, DwarfRegNum<[18]>;
-def X19 : GP8<R19, "r19">, DwarfRegNum<[19]>;
-def X20 : GP8<R20, "r20">, DwarfRegNum<[20]>;
-def X21 : GP8<R21, "r21">, DwarfRegNum<[21]>;
-def X22 : GP8<R22, "r22">, DwarfRegNum<[22]>;
-def X23 : GP8<R23, "r23">, DwarfRegNum<[23]>;
-def X24 : GP8<R24, "r24">, DwarfRegNum<[24]>;
-def X25 : GP8<R25, "r25">, DwarfRegNum<[25]>;
-def X26 : GP8<R26, "r26">, DwarfRegNum<[26]>;
-def X27 : GP8<R27, "r27">, DwarfRegNum<[27]>;
-def X28 : GP8<R28, "r28">, DwarfRegNum<[28]>;
-def X29 : GP8<R29, "r29">, DwarfRegNum<[29]>;
-def X30 : GP8<R30, "r30">, DwarfRegNum<[30]>;
-def X31 : GP8<R31, "r31">, DwarfRegNum<[31]>;
+def X0 : GP8< R0, "r0">, DwarfRegNum<[0, -2]>;
+def X1 : GP8< R1, "r1">, DwarfRegNum<[1, -2]>;
+def X2 : GP8< R2, "r2">, DwarfRegNum<[2, -2]>;
+def X3 : GP8< R3, "r3">, DwarfRegNum<[3, -2]>;
+def X4 : GP8< R4, "r4">, DwarfRegNum<[4, -2]>;
+def X5 : GP8< R5, "r5">, DwarfRegNum<[5, -2]>;
+def X6 : GP8< R6, "r6">, DwarfRegNum<[6, -2]>;
+def X7 : GP8< R7, "r7">, DwarfRegNum<[7, -2]>;
+def X8 : GP8< R8, "r8">, DwarfRegNum<[8, -2]>;
+def X9 : GP8< R9, "r9">, DwarfRegNum<[9, -2]>;
+def X10 : GP8<R10, "r10">, DwarfRegNum<[10, -2]>;
+def X11 : GP8<R11, "r11">, DwarfRegNum<[11, -2]>;
+def X12 : GP8<R12, "r12">, DwarfRegNum<[12, -2]>;
+def X13 : GP8<R13, "r13">, DwarfRegNum<[13, -2]>;
+def X14 : GP8<R14, "r14">, DwarfRegNum<[14, -2]>;
+def X15 : GP8<R15, "r15">, DwarfRegNum<[15, -2]>;
+def X16 : GP8<R16, "r16">, DwarfRegNum<[16, -2]>;
+def X17 : GP8<R17, "r17">, DwarfRegNum<[17, -2]>;
+def X18 : GP8<R18, "r18">, DwarfRegNum<[18, -2]>;
+def X19 : GP8<R19, "r19">, DwarfRegNum<[19, -2]>;
+def X20 : GP8<R20, "r20">, DwarfRegNum<[20, -2]>;
+def X21 : GP8<R21, "r21">, DwarfRegNum<[21, -2]>;
+def X22 : GP8<R22, "r22">, DwarfRegNum<[22, -2]>;
+def X23 : GP8<R23, "r23">, DwarfRegNum<[23, -2]>;
+def X24 : GP8<R24, "r24">, DwarfRegNum<[24, -2]>;
+def X25 : GP8<R25, "r25">, DwarfRegNum<[25, -2]>;
+def X26 : GP8<R26, "r26">, DwarfRegNum<[26, -2]>;
+def X27 : GP8<R27, "r27">, DwarfRegNum<[27, -2]>;
+def X28 : GP8<R28, "r28">, DwarfRegNum<[28, -2]>;
+def X29 : GP8<R29, "r29">, DwarfRegNum<[29, -2]>;
+def X30 : GP8<R30, "r30">, DwarfRegNum<[30, -2]>;
+def X31 : GP8<R31, "r31">, DwarfRegNum<[31, -2]>;
// Floating-point registers
-def F0 : FPR< 0, "f0">, DwarfRegNum<[32]>;
-def F1 : FPR< 1, "f1">, DwarfRegNum<[33]>;
-def F2 : FPR< 2, "f2">, DwarfRegNum<[34]>;
-def F3 : FPR< 3, "f3">, DwarfRegNum<[35]>;
-def F4 : FPR< 4, "f4">, DwarfRegNum<[36]>;
-def F5 : FPR< 5, "f5">, DwarfRegNum<[37]>;
-def F6 : FPR< 6, "f6">, DwarfRegNum<[38]>;
-def F7 : FPR< 7, "f7">, DwarfRegNum<[39]>;
-def F8 : FPR< 8, "f8">, DwarfRegNum<[40]>;
-def F9 : FPR< 9, "f9">, DwarfRegNum<[41]>;
-def F10 : FPR<10, "f10">, DwarfRegNum<[42]>;
-def F11 : FPR<11, "f11">, DwarfRegNum<[43]>;
-def F12 : FPR<12, "f12">, DwarfRegNum<[44]>;
-def F13 : FPR<13, "f13">, DwarfRegNum<[45]>;
-def F14 : FPR<14, "f14">, DwarfRegNum<[46]>;
-def F15 : FPR<15, "f15">, DwarfRegNum<[47]>;
-def F16 : FPR<16, "f16">, DwarfRegNum<[48]>;
-def F17 : FPR<17, "f17">, DwarfRegNum<[49]>;
-def F18 : FPR<18, "f18">, DwarfRegNum<[50]>;
-def F19 : FPR<19, "f19">, DwarfRegNum<[51]>;
-def F20 : FPR<20, "f20">, DwarfRegNum<[52]>;
-def F21 : FPR<21, "f21">, DwarfRegNum<[53]>;
-def F22 : FPR<22, "f22">, DwarfRegNum<[54]>;
-def F23 : FPR<23, "f23">, DwarfRegNum<[55]>;
-def F24 : FPR<24, "f24">, DwarfRegNum<[56]>;
-def F25 : FPR<25, "f25">, DwarfRegNum<[57]>;
-def F26 : FPR<26, "f26">, DwarfRegNum<[58]>;
-def F27 : FPR<27, "f27">, DwarfRegNum<[59]>;
-def F28 : FPR<28, "f28">, DwarfRegNum<[60]>;
-def F29 : FPR<29, "f29">, DwarfRegNum<[61]>;
-def F30 : FPR<30, "f30">, DwarfRegNum<[62]>;
-def F31 : FPR<31, "f31">, DwarfRegNum<[63]>;
+def F0 : FPR< 0, "f0">, DwarfRegNum<[32, 32]>;
+def F1 : FPR< 1, "f1">, DwarfRegNum<[33, 33]>;
+def F2 : FPR< 2, "f2">, DwarfRegNum<[34, 34]>;
+def F3 : FPR< 3, "f3">, DwarfRegNum<[35, 35]>;
+def F4 : FPR< 4, "f4">, DwarfRegNum<[36, 36]>;
+def F5 : FPR< 5, "f5">, DwarfRegNum<[37, 37]>;
+def F6 : FPR< 6, "f6">, DwarfRegNum<[38, 38]>;
+def F7 : FPR< 7, "f7">, DwarfRegNum<[39, 39]>;
+def F8 : FPR< 8, "f8">, DwarfRegNum<[40, 40]>;
+def F9 : FPR< 9, "f9">, DwarfRegNum<[41, 41]>;
+def F10 : FPR<10, "f10">, DwarfRegNum<[42, 42]>;
+def F11 : FPR<11, "f11">, DwarfRegNum<[43, 43]>;
+def F12 : FPR<12, "f12">, DwarfRegNum<[44, 44]>;
+def F13 : FPR<13, "f13">, DwarfRegNum<[45, 45]>;
+def F14 : FPR<14, "f14">, DwarfRegNum<[46, 46]>;
+def F15 : FPR<15, "f15">, DwarfRegNum<[47, 47]>;
+def F16 : FPR<16, "f16">, DwarfRegNum<[48, 48]>;
+def F17 : FPR<17, "f17">, DwarfRegNum<[49, 49]>;
+def F18 : FPR<18, "f18">, DwarfRegNum<[50, 50]>;
+def F19 : FPR<19, "f19">, DwarfRegNum<[51, 51]>;
+def F20 : FPR<20, "f20">, DwarfRegNum<[52, 52]>;
+def F21 : FPR<21, "f21">, DwarfRegNum<[53, 53]>;
+def F22 : FPR<22, "f22">, DwarfRegNum<[54, 54]>;
+def F23 : FPR<23, "f23">, DwarfRegNum<[55, 55]>;
+def F24 : FPR<24, "f24">, DwarfRegNum<[56, 56]>;
+def F25 : FPR<25, "f25">, DwarfRegNum<[57, 57]>;
+def F26 : FPR<26, "f26">, DwarfRegNum<[58, 58]>;
+def F27 : FPR<27, "f27">, DwarfRegNum<[59, 59]>;
+def F28 : FPR<28, "f28">, DwarfRegNum<[60, 60]>;
+def F29 : FPR<29, "f29">, DwarfRegNum<[61, 61]>;
+def F30 : FPR<30, "f30">, DwarfRegNum<[62, 62]>;
+def F31 : FPR<31, "f31">, DwarfRegNum<[63, 63]>;
// Vector registers
-def V0 : VR< 0, "v0">, DwarfRegNum<[77]>;
-def V1 : VR< 1, "v1">, DwarfRegNum<[78]>;
-def V2 : VR< 2, "v2">, DwarfRegNum<[79]>;
-def V3 : VR< 3, "v3">, DwarfRegNum<[80]>;
-def V4 : VR< 4, "v4">, DwarfRegNum<[81]>;
-def V5 : VR< 5, "v5">, DwarfRegNum<[82]>;
-def V6 : VR< 6, "v6">, DwarfRegNum<[83]>;
-def V7 : VR< 7, "v7">, DwarfRegNum<[84]>;
-def V8 : VR< 8, "v8">, DwarfRegNum<[85]>;
-def V9 : VR< 9, "v9">, DwarfRegNum<[86]>;
-def V10 : VR<10, "v10">, DwarfRegNum<[87]>;
-def V11 : VR<11, "v11">, DwarfRegNum<[88]>;
-def V12 : VR<12, "v12">, DwarfRegNum<[89]>;
-def V13 : VR<13, "v13">, DwarfRegNum<[90]>;
-def V14 : VR<14, "v14">, DwarfRegNum<[91]>;
-def V15 : VR<15, "v15">, DwarfRegNum<[92]>;
-def V16 : VR<16, "v16">, DwarfRegNum<[93]>;
-def V17 : VR<17, "v17">, DwarfRegNum<[94]>;
-def V18 : VR<18, "v18">, DwarfRegNum<[95]>;
-def V19 : VR<19, "v19">, DwarfRegNum<[96]>;
-def V20 : VR<20, "v20">, DwarfRegNum<[97]>;
-def V21 : VR<21, "v21">, DwarfRegNum<[98]>;
-def V22 : VR<22, "v22">, DwarfRegNum<[99]>;
-def V23 : VR<23, "v23">, DwarfRegNum<[100]>;
-def V24 : VR<24, "v24">, DwarfRegNum<[101]>;
-def V25 : VR<25, "v25">, DwarfRegNum<[102]>;
-def V26 : VR<26, "v26">, DwarfRegNum<[103]>;
-def V27 : VR<27, "v27">, DwarfRegNum<[104]>;
-def V28 : VR<28, "v28">, DwarfRegNum<[105]>;
-def V29 : VR<29, "v29">, DwarfRegNum<[106]>;
-def V30 : VR<30, "v30">, DwarfRegNum<[107]>;
-def V31 : VR<31, "v31">, DwarfRegNum<[108]>;
+def V0 : VR< 0, "v0">, DwarfRegNum<[77, 77]>;
+def V1 : VR< 1, "v1">, DwarfRegNum<[78, 78]>;
+def V2 : VR< 2, "v2">, DwarfRegNum<[79, 79]>;
+def V3 : VR< 3, "v3">, DwarfRegNum<[80, 80]>;
+def V4 : VR< 4, "v4">, DwarfRegNum<[81, 81]>;
+def V5 : VR< 5, "v5">, DwarfRegNum<[82, 82]>;
+def V6 : VR< 6, "v6">, DwarfRegNum<[83, 83]>;
+def V7 : VR< 7, "v7">, DwarfRegNum<[84, 84]>;
+def V8 : VR< 8, "v8">, DwarfRegNum<[85, 85]>;
+def V9 : VR< 9, "v9">, DwarfRegNum<[86, 86]>;
+def V10 : VR<10, "v10">, DwarfRegNum<[87, 87]>;
+def V11 : VR<11, "v11">, DwarfRegNum<[88, 88]>;
+def V12 : VR<12, "v12">, DwarfRegNum<[89, 89]>;
+def V13 : VR<13, "v13">, DwarfRegNum<[90, 90]>;
+def V14 : VR<14, "v14">, DwarfRegNum<[91, 91]>;
+def V15 : VR<15, "v15">, DwarfRegNum<[92, 92]>;
+def V16 : VR<16, "v16">, DwarfRegNum<[93, 93]>;
+def V17 : VR<17, "v17">, DwarfRegNum<[94, 94]>;
+def V18 : VR<18, "v18">, DwarfRegNum<[95, 95]>;
+def V19 : VR<19, "v19">, DwarfRegNum<[96, 96]>;
+def V20 : VR<20, "v20">, DwarfRegNum<[97, 97]>;
+def V21 : VR<21, "v21">, DwarfRegNum<[98, 98]>;
+def V22 : VR<22, "v22">, DwarfRegNum<[99, 99]>;
+def V23 : VR<23, "v23">, DwarfRegNum<[100, 100]>;
+def V24 : VR<24, "v24">, DwarfRegNum<[101, 101]>;
+def V25 : VR<25, "v25">, DwarfRegNum<[102, 102]>;
+def V26 : VR<26, "v26">, DwarfRegNum<[103, 103]>;
+def V27 : VR<27, "v27">, DwarfRegNum<[104, 104]>;
+def V28 : VR<28, "v28">, DwarfRegNum<[105, 105]>;
+def V29 : VR<29, "v29">, DwarfRegNum<[106, 106]>;
+def V30 : VR<30, "v30">, DwarfRegNum<[107, 107]>;
+def V31 : VR<31, "v31">, DwarfRegNum<[108, 108]>;
// Condition register bits
-def CR0LT : CRBIT< 0, "0">, DwarfRegNum<[0]>;
-def CR0GT : CRBIT< 1, "1">, DwarfRegNum<[0]>;
-def CR0EQ : CRBIT< 2, "2">, DwarfRegNum<[0]>;
-def CR0UN : CRBIT< 3, "3">, DwarfRegNum<[0]>;
-def CR1LT : CRBIT< 4, "4">, DwarfRegNum<[0]>;
-def CR1GT : CRBIT< 5, "5">, DwarfRegNum<[0]>;
-def CR1EQ : CRBIT< 6, "6">, DwarfRegNum<[0]>;
-def CR1UN : CRBIT< 7, "7">, DwarfRegNum<[0]>;
-def CR2LT : CRBIT< 8, "8">, DwarfRegNum<[0]>;
-def CR2GT : CRBIT< 9, "9">, DwarfRegNum<[0]>;
-def CR2EQ : CRBIT<10, "10">, DwarfRegNum<[0]>;
-def CR2UN : CRBIT<11, "11">, DwarfRegNum<[0]>;
-def CR3LT : CRBIT<12, "12">, DwarfRegNum<[0]>;
-def CR3GT : CRBIT<13, "13">, DwarfRegNum<[0]>;
-def CR3EQ : CRBIT<14, "14">, DwarfRegNum<[0]>;
-def CR3UN : CRBIT<15, "15">, DwarfRegNum<[0]>;
-def CR4LT : CRBIT<16, "16">, DwarfRegNum<[0]>;
-def CR4GT : CRBIT<17, "17">, DwarfRegNum<[0]>;
-def CR4EQ : CRBIT<18, "18">, DwarfRegNum<[0]>;
-def CR4UN : CRBIT<19, "19">, DwarfRegNum<[0]>;
-def CR5LT : CRBIT<20, "20">, DwarfRegNum<[0]>;
-def CR5GT : CRBIT<21, "21">, DwarfRegNum<[0]>;
-def CR5EQ : CRBIT<22, "22">, DwarfRegNum<[0]>;
-def CR5UN : CRBIT<23, "23">, DwarfRegNum<[0]>;
-def CR6LT : CRBIT<24, "24">, DwarfRegNum<[0]>;
-def CR6GT : CRBIT<25, "25">, DwarfRegNum<[0]>;
-def CR6EQ : CRBIT<26, "26">, DwarfRegNum<[0]>;
-def CR6UN : CRBIT<27, "27">, DwarfRegNum<[0]>;
-def CR7LT : CRBIT<28, "28">, DwarfRegNum<[0]>;
-def CR7GT : CRBIT<29, "29">, DwarfRegNum<[0]>;
-def CR7EQ : CRBIT<30, "30">, DwarfRegNum<[0]>;
-def CR7UN : CRBIT<31, "31">, DwarfRegNum<[0]>;
+def CR0LT : CRBIT< 0, "0">;
+def CR0GT : CRBIT< 1, "1">;
+def CR0EQ : CRBIT< 2, "2">;
+def CR0UN : CRBIT< 3, "3">;
+def CR1LT : CRBIT< 4, "4">;
+def CR1GT : CRBIT< 5, "5">;
+def CR1EQ : CRBIT< 6, "6">;
+def CR1UN : CRBIT< 7, "7">;
+def CR2LT : CRBIT< 8, "8">;
+def CR2GT : CRBIT< 9, "9">;
+def CR2EQ : CRBIT<10, "10">;
+def CR2UN : CRBIT<11, "11">;
+def CR3LT : CRBIT<12, "12">;
+def CR3GT : CRBIT<13, "13">;
+def CR3EQ : CRBIT<14, "14">;
+def CR3UN : CRBIT<15, "15">;
+def CR4LT : CRBIT<16, "16">;
+def CR4GT : CRBIT<17, "17">;
+def CR4EQ : CRBIT<18, "18">;
+def CR4UN : CRBIT<19, "19">;
+def CR5LT : CRBIT<20, "20">;
+def CR5GT : CRBIT<21, "21">;
+def CR5EQ : CRBIT<22, "22">;
+def CR5UN : CRBIT<23, "23">;
+def CR6LT : CRBIT<24, "24">;
+def CR6GT : CRBIT<25, "25">;
+def CR6EQ : CRBIT<26, "26">;
+def CR6UN : CRBIT<27, "27">;
+def CR7LT : CRBIT<28, "28">;
+def CR7GT : CRBIT<29, "29">;
+def CR7EQ : CRBIT<30, "30">;
+def CR7UN : CRBIT<31, "31">;
// Condition registers
let SubRegIndices = [sub_lt, sub_gt, sub_eq, sub_un] in {
-def CR0 : CR<0, "cr0", [CR0LT, CR0GT, CR0EQ, CR0UN]>, DwarfRegNum<[68]>;
-def CR1 : CR<1, "cr1", [CR1LT, CR1GT, CR1EQ, CR1UN]>, DwarfRegNum<[69]>;
-def CR2 : CR<2, "cr2", [CR2LT, CR2GT, CR2EQ, CR2UN]>, DwarfRegNum<[70]>;
-def CR3 : CR<3, "cr3", [CR3LT, CR3GT, CR3EQ, CR3UN]>, DwarfRegNum<[71]>;
-def CR4 : CR<4, "cr4", [CR4LT, CR4GT, CR4EQ, CR4UN]>, DwarfRegNum<[72]>;
-def CR5 : CR<5, "cr5", [CR5LT, CR5GT, CR5EQ, CR5UN]>, DwarfRegNum<[73]>;
-def CR6 : CR<6, "cr6", [CR6LT, CR6GT, CR6EQ, CR6UN]>, DwarfRegNum<[74]>;
-def CR7 : CR<7, "cr7", [CR7LT, CR7GT, CR7EQ, CR7UN]>, DwarfRegNum<[75]>;
+def CR0 : CR<0, "cr0", [CR0LT, CR0GT, CR0EQ, CR0UN]>, DwarfRegNum<[68, 68]>;
+def CR1 : CR<1, "cr1", [CR1LT, CR1GT, CR1EQ, CR1UN]>, DwarfRegNum<[69, 69]>;
+def CR2 : CR<2, "cr2", [CR2LT, CR2GT, CR2EQ, CR2UN]>, DwarfRegNum<[70, 70]>;
+def CR3 : CR<3, "cr3", [CR3LT, CR3GT, CR3EQ, CR3UN]>, DwarfRegNum<[71, 71]>;
+def CR4 : CR<4, "cr4", [CR4LT, CR4GT, CR4EQ, CR4UN]>, DwarfRegNum<[72, 72]>;
+def CR5 : CR<5, "cr5", [CR5LT, CR5GT, CR5EQ, CR5UN]>, DwarfRegNum<[73, 73]>;
+def CR6 : CR<6, "cr6", [CR6LT, CR6GT, CR6EQ, CR6UN]>, DwarfRegNum<[74, 74]>;
+def CR7 : CR<7, "cr7", [CR7LT, CR7GT, CR7EQ, CR7UN]>, DwarfRegNum<[75, 75]>;
}
// Link register
-def LR : SPR<8, "lr">, DwarfRegNum<[65]>;
+def LR : SPR<8, "lr">, DwarfRegNum<[-2, 65]>;
//let Aliases = [LR] in
-def LR8 : SPR<8, "lr">, DwarfRegNum<[65]>;
+def LR8 : SPR<8, "lr">, DwarfRegNum<[65, -2]>;
// Count register
-def CTR : SPR<9, "ctr">, DwarfRegNum<[66]>;
-def CTR8 : SPR<9, "ctr">, DwarfRegNum<[66]>;
+def CTR : SPR<9, "ctr">, DwarfRegNum<[-2, 66]>;
+def CTR8 : SPR<9, "ctr">, DwarfRegNum<[66, -2]>;
// VRsave register
-def VRSAVE: SPR<256, "VRsave">, DwarfRegNum<[107]>;
+def VRSAVE: SPR<256, "VRsave">, DwarfRegNum<[109]>;
// Carry bit. In the architecture this is really bit 0 of the XER register
// (which really is SPR register 1); this is the only bit interesting to a
// compiler.
-def CARRY: SPR<1, "ca">, DwarfRegNum<[0]>;
+def CARRY: SPR<1, "ca">;
// FP rounding mode: bits 30 and 31 of the FP status and control register
// This is not allocated as a normal register; it appears only in
@@ -271,7 +271,7 @@ def CARRY: SPR<1, "ca">, DwarfRegNum<[0]>;
// return and call instructions are described as Uses of RM, so instructions
// that do nothing but change RM will not get deleted.
// Also, in the architecture it is not really a SPR; 512 is arbitrary.
-def RM: SPR<512, "**ROUNDING MODE**">, DwarfRegNum<[0]>;
+def RM: SPR<512, "**ROUNDING MODE**">;
/// Register classes
// Allocate volatiles first
@@ -279,68 +279,12 @@ def RM: SPR<512, "**ROUNDING MODE**">, DwarfRegNum<[0]>;
def GPRC : RegisterClass<"PPC", [i32], 32,
[R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12,
R30, R29, R28, R27, R26, R25, R24, R23, R22, R21, R20, R19, R18, R17,
- R16, R15, R14, R13, R31, R0, R1, LR]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GPRCClass::iterator
- GPRCClass::allocation_order_begin(const MachineFunction &MF) const {
- // 32-bit SVR4 ABI: r2 is reserved for the OS.
- // 64-bit SVR4 ABI: r2 is reserved for the TOC pointer.
- // Darwin: R2 is reserved for CR save/restore sequence.
- return begin()+1;
- }
- GPRCClass::iterator
- GPRCClass::allocation_order_end(const MachineFunction &MF) const {
- // On PPC64, r13 is the thread pointer. Never allocate this register.
- // Note that this is overconservative, as it also prevents allocation of
- // R31 when the FP is not needed.
- // When using the 32-bit SVR4 ABI, r13 is reserved for the Small Data Area
- // pointer.
- const PPCSubtarget &Subtarget = MF.getTarget().getSubtarget<PPCSubtarget>();
- const PPCFrameLowering *PPCFI =
- static_cast<const PPCFrameLowering*>(MF.getTarget().getFrameLowering());
-
- if (Subtarget.isPPC64() || Subtarget.isSVR4ABI())
- return end()-5; // don't allocate R13, R31, R0, R1, LR
-
- if (PPCFI->needsFP(MF))
- return end()-4; // don't allocate R31, R0, R1, LR
- else
- return end()-3; // don't allocate R0, R1, LR
- }
- }];
-}
+ R16, R15, R14, R13, R31, R0, R1, LR]>;
+
def G8RC : RegisterClass<"PPC", [i64], 64,
[X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12,
X30, X29, X28, X27, X26, X25, X24, X23, X22, X21, X20, X19, X18, X17,
- X16, X15, X14, X31, X13, X0, X1, LR8]>
-{
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- G8RCClass::iterator
- G8RCClass::allocation_order_begin(const MachineFunction &MF) const {
- // 64-bit SVR4 ABI: r2 is reserved for the TOC pointer.
- // Darwin: r2 is reserved for CR save/restore sequence.
- return begin()+1;
- }
- G8RCClass::iterator
- G8RCClass::allocation_order_end(const MachineFunction &MF) const {
- const PPCFrameLowering *PPCFI =
- static_cast<const PPCFrameLowering*>(MF.getTarget().getFrameLowering());
- if (PPCFI->needsFP(MF))
- return end()-5;
- else
- return end()-4;
- }
- }];
-}
+ X16, X15, X14, X31, X13, X0, X1, LR8]>;
// Allocate volatiles first, then non-volatiles in reverse order. With the SVR4
// ABI the size of the Floating-point register save area is determined by the
diff --git a/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp b/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp
index edb62fa..0b4612d 100644
--- a/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp
+++ b/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp
@@ -91,8 +91,8 @@ SparcTargetLowering::LowerReturn(SDValue Chain,
SmallVector<CCValAssign, 16> RVLocs;
// CCState - Info about the registers and stack slot.
- CCState CCInfo(CallConv, isVarArg, DAG.getTarget(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ DAG.getTarget(), RVLocs, *DAG.getContext());
// Analize return values.
CCInfo.AnalyzeReturn(Outs, RetCC_Sparc32);
@@ -139,7 +139,7 @@ SparcTargetLowering::LowerReturn(SDValue Chain,
if (Flag.getNode())
return DAG.getNode(SPISD::RET_FLAG, dl, MVT::Other, Chain,
RetAddrOffsetNode, Flag);
- return DAG.getNode(SPISD::RET_FLAG, dl, MVT::Other, Chain,
+ return DAG.getNode(SPISD::RET_FLAG, dl, MVT::Other, Chain,
RetAddrOffsetNode);
}
@@ -161,8 +161,8 @@ SparcTargetLowering::LowerFormalArguments(SDValue Chain,
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeFormalArguments(Ins, CC_Sparc32);
const unsigned StackOffset = 92;
@@ -182,8 +182,6 @@ SparcTargetLowering::LowerFormalArguments(SDValue Chain,
}
if (VA.isRegLoc()) {
- EVT RegVT = VA.getLocVT();
-
if (VA.needsCustom()) {
assert(VA.getLocVT() == MVT::f64);
unsigned VRegHi = RegInfo.createVirtualRegister(&SP::IntRegsRegClass);
@@ -362,8 +360,8 @@ SparcTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, DAG.getTarget(), ArgLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ DAG.getTarget(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeCallOperands(Outs, CC_Sparc32);
// Get the size of the outgoing arguments stack space requirement.
@@ -593,8 +591,8 @@ SparcTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState RVInfo(CallConv, isVarArg, DAG.getTarget(),
- RVLocs, *DAG.getContext());
+ CCState RVInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ DAG.getTarget(), RVLocs, *DAG.getContext());
RVInfo.AnalyzeCallResult(Ins, RetCC_Sparc32);
@@ -801,6 +799,8 @@ SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
if (TM.getSubtarget<SparcSubtarget>().isV9())
setOperationAction(ISD::CTPOP, MVT::i32, Legal);
+ setMinFunctionAlignment(2);
+
computeRegisterProperties();
}
@@ -1290,8 +1290,3 @@ SparcTargetLowering::isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const {
// The Sparc target isn't yet aware of offsets.
return false;
}
-
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned SparcTargetLowering::getFunctionAlignment(const Function *) const {
- return 2;
-}
diff --git a/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h b/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h
index 7d02df8..9ea6e16 100644
--- a/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h
+++ b/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h
@@ -71,9 +71,6 @@ namespace llvm {
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
virtual SDValue
LowerFormalArguments(SDValue Chain,
CallingConv::ID CallConv,
diff --git a/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp b/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
index b010d04..9fcf028 100644
--- a/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
@@ -39,6 +39,8 @@ const unsigned* SparcRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
BitVector SparcRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
BitVector Reserved(getNumRegs());
+ // FIXME: G1 reserved for now for large imm generation by frame code.
+ Reserved.set(SP::G1);
Reserved.set(SP::G2);
Reserved.set(SP::G3);
Reserved.set(SP::G4);
@@ -130,5 +132,9 @@ int SparcRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
return SparcGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
+int SparcRegisterInfo::getLLVMRegNum(unsigned DwarfRegNo, bool isEH) const {
+ return SparcGenRegisterInfo::getLLVMRegNumFull(DwarfRegNo,0);
+}
+
#include "SparcGenRegisterInfo.inc"
diff --git a/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h b/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h
index d930b53..56c8068 100644
--- a/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h
+++ b/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h
@@ -52,6 +52,7 @@ struct SparcRegisterInfo : public SparcGenRegisterInfo {
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
diff --git a/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td b/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td
index 5ef4dae..0729818 100644
--- a/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td
+++ b/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td
@@ -117,22 +117,22 @@ def F30 : Rf<30, "F30">, DwarfRegNum<[62]>;
def F31 : Rf<31, "F31">, DwarfRegNum<[63]>;
// Aliases of the F* registers used to hold 64-bit fp values (doubles)
-def D0 : Rd< 0, "F0", [F0, F1]>, DwarfRegNum<[32]>;
-def D1 : Rd< 2, "F2", [F2, F3]>, DwarfRegNum<[34]>;
-def D2 : Rd< 4, "F4", [F4, F5]>, DwarfRegNum<[36]>;
-def D3 : Rd< 6, "F6", [F6, F7]>, DwarfRegNum<[38]>;
-def D4 : Rd< 8, "F8", [F8, F9]>, DwarfRegNum<[40]>;
-def D5 : Rd<10, "F10", [F10, F11]>, DwarfRegNum<[42]>;
-def D6 : Rd<12, "F12", [F12, F13]>, DwarfRegNum<[44]>;
-def D7 : Rd<14, "F14", [F14, F15]>, DwarfRegNum<[46]>;
-def D8 : Rd<16, "F16", [F16, F17]>, DwarfRegNum<[48]>;
-def D9 : Rd<18, "F18", [F18, F19]>, DwarfRegNum<[50]>;
-def D10 : Rd<20, "F20", [F20, F21]>, DwarfRegNum<[52]>;
-def D11 : Rd<22, "F22", [F22, F23]>, DwarfRegNum<[54]>;
-def D12 : Rd<24, "F24", [F24, F25]>, DwarfRegNum<[56]>;
-def D13 : Rd<26, "F26", [F26, F27]>, DwarfRegNum<[58]>;
-def D14 : Rd<28, "F28", [F28, F29]>, DwarfRegNum<[60]>;
-def D15 : Rd<30, "F30", [F30, F31]>, DwarfRegNum<[62]>;
+def D0 : Rd< 0, "F0", [F0, F1]>, DwarfRegNum<[72]>;
+def D1 : Rd< 2, "F2", [F2, F3]>, DwarfRegNum<[73]>;
+def D2 : Rd< 4, "F4", [F4, F5]>, DwarfRegNum<[74]>;
+def D3 : Rd< 6, "F6", [F6, F7]>, DwarfRegNum<[75]>;
+def D4 : Rd< 8, "F8", [F8, F9]>, DwarfRegNum<[76]>;
+def D5 : Rd<10, "F10", [F10, F11]>, DwarfRegNum<[77]>;
+def D6 : Rd<12, "F12", [F12, F13]>, DwarfRegNum<[78]>;
+def D7 : Rd<14, "F14", [F14, F15]>, DwarfRegNum<[79]>;
+def D8 : Rd<16, "F16", [F16, F17]>, DwarfRegNum<[80]>;
+def D9 : Rd<18, "F18", [F18, F19]>, DwarfRegNum<[81]>;
+def D10 : Rd<20, "F20", [F20, F21]>, DwarfRegNum<[82]>;
+def D11 : Rd<22, "F22", [F22, F23]>, DwarfRegNum<[83]>;
+def D12 : Rd<24, "F24", [F24, F25]>, DwarfRegNum<[84]>;
+def D13 : Rd<26, "F26", [F26, F27]>, DwarfRegNum<[85]>;
+def D14 : Rd<28, "F28", [F28, F29]>, DwarfRegNum<[86]>;
+def D15 : Rd<30, "F30", [F30, F31]>, DwarfRegNum<[87]>;
// Register classes.
//
@@ -142,8 +142,6 @@ def D15 : Rd<30, "F30", [F30, F31]>, DwarfRegNum<[62]>;
def IntRegs : RegisterClass<"SP", [i32], 32, [L0, L1, L2, L3, L4, L5, L6, L7,
I0, I1, I2, I3, I4, I5,
O0, O1, O2, O3, O4, O5, O7,
-
- // FIXME: G1 reserved for now for large imm generation by frame code.
G1,
// Non-allocatable regs:
G2, G3, G4, // FIXME: OK for use only in
@@ -153,19 +151,7 @@ def IntRegs : RegisterClass<"SP", [i32], 32, [L0, L1, L2, L3, L4, L5, L6, L7,
I7, // return address
G0, // constant zero
G5, G6, G7 // reserved for kernel
- ]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- IntRegsClass::iterator
- IntRegsClass::allocation_order_end(const MachineFunction &MF) const {
- // FIXME: These special regs should be taken out of the regclass!
- return end()-10 // Don't allocate special registers
- -1; // FIXME: G1 reserved for large imm generation by frame code.
- }
- }];
-}
+ ]>;
def FPRegs : RegisterClass<"SP", [f32], 32, [F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22,
diff --git a/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index d331614..af85df5 100644
--- a/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -153,6 +153,8 @@ SystemZTargetLowering::SystemZTargetLowering(SystemZTargetMachine &tm) :
setOperationAction(ISD::FP_TO_UINT, MVT::i64, Expand);
setTruncStoreAction(MVT::f64, MVT::f32, Expand);
+
+ setMinFunctionAlignment(1);
}
SDValue SystemZTargetLowering::LowerOperation(SDValue Op,
@@ -289,8 +291,8 @@ SystemZTargetLowering::LowerCCCArguments(SDValue Chain,
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeFormalArguments(Ins, CC_SystemZ);
if (isVarArg)
@@ -382,8 +384,8 @@ SystemZTargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeCallOperands(Outs, CC_SystemZ);
@@ -511,8 +513,8 @@ SystemZTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(), RVLocs,
- *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_SystemZ);
@@ -556,8 +558,8 @@ SystemZTargetLowering::LowerReturn(SDValue Chain,
SmallVector<CCValAssign, 16> RVLocs;
// CCState - Info about the registers and stack slot.
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
// Analize return values.
CCInfo.AnalyzeReturn(Outs, RetCC_SystemZ);
diff --git a/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h b/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h
index 3019242..bab3dc2 100644
--- a/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h
+++ b/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h
@@ -66,11 +66,6 @@ namespace llvm {
/// DAG node.
virtual const char *getTargetNodeName(unsigned Opcode) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const {
- return 1;
- }
-
std::pair<unsigned, const TargetRegisterClass*>
getRegForInlineAsmConstraint(const std::string &Constraint, EVT VT) const;
TargetLowering::ConstraintType
diff --git a/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp b/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp
index 28f94f4..ed62cff 100644
--- a/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp
@@ -58,6 +58,20 @@ BitVector SystemZRegisterInfo::getReservedRegs(const MachineFunction &MF) const
return Reserved;
}
+const TargetRegisterClass*
+SystemZRegisterInfo::getMatchingSuperRegClass(const TargetRegisterClass *A,
+ const TargetRegisterClass *B,
+ unsigned Idx) const {
+ switch(Idx) {
+ // Exact sub-classes don't exist for the other sub-register indexes.
+ default: return 0;
+ case SystemZ::subreg_32bit:
+ if (B == SystemZ::ADDR32RegisterClass)
+ return A->getSize() == 8 ? SystemZ::ADDR64RegisterClass : 0;
+ return A;
+ }
+}
+
void SystemZRegisterInfo::
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const {
@@ -125,4 +139,10 @@ int SystemZRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
return -1;
}
+int SystemZRegisterInfo::getLLVMRegNum(unsigned DwarfRegNo, bool isEH) const {
+ assert(0 && "What is the dwarf register number");
+ return -1;
+}
+
+
#include "SystemZGenRegisterInfo.inc"
diff --git a/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h b/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h
index b450798..cd8f20f 100644
--- a/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h
+++ b/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h
@@ -34,6 +34,10 @@ struct SystemZRegisterInfo : public SystemZGenRegisterInfo {
BitVector getReservedRegs(const MachineFunction &MF) const;
+ const TargetRegisterClass*
+ getMatchingSuperRegClass(const TargetRegisterClass *A,
+ const TargetRegisterClass *B, unsigned Idx) const;
+
void eliminateCallFramePseudoInstr(MachineFunction &MF,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const;
@@ -50,6 +54,7 @@ struct SystemZRegisterInfo : public SystemZGenRegisterInfo {
unsigned getEHHandlerRegister() const;
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
diff --git a/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td b/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td
index 0028c85..9313ffd 100644
--- a/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td
+++ b/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td
@@ -61,22 +61,22 @@ def subreg_odd : SubRegIndex;
}
// General-purpose registers
-def R0W : GPR32< 0, "r0">, DwarfRegNum<[0]>;
-def R1W : GPR32< 1, "r1">, DwarfRegNum<[1]>;
-def R2W : GPR32< 2, "r2">, DwarfRegNum<[2]>;
-def R3W : GPR32< 3, "r3">, DwarfRegNum<[3]>;
-def R4W : GPR32< 4, "r4">, DwarfRegNum<[4]>;
-def R5W : GPR32< 5, "r5">, DwarfRegNum<[5]>;
-def R6W : GPR32< 6, "r6">, DwarfRegNum<[6]>;
-def R7W : GPR32< 7, "r7">, DwarfRegNum<[7]>;
-def R8W : GPR32< 8, "r8">, DwarfRegNum<[8]>;
-def R9W : GPR32< 9, "r9">, DwarfRegNum<[9]>;
-def R10W : GPR32<10, "r10">, DwarfRegNum<[10]>;
-def R11W : GPR32<11, "r11">, DwarfRegNum<[11]>;
-def R12W : GPR32<12, "r12">, DwarfRegNum<[12]>;
-def R13W : GPR32<13, "r13">, DwarfRegNum<[13]>;
-def R14W : GPR32<14, "r14">, DwarfRegNum<[14]>;
-def R15W : GPR32<15, "r15">, DwarfRegNum<[15]>;
+def R0W : GPR32< 0, "r0">;
+def R1W : GPR32< 1, "r1">;
+def R2W : GPR32< 2, "r2">;
+def R3W : GPR32< 3, "r3">;
+def R4W : GPR32< 4, "r4">;
+def R5W : GPR32< 5, "r5">;
+def R6W : GPR32< 6, "r6">;
+def R7W : GPR32< 7, "r7">;
+def R8W : GPR32< 8, "r8">;
+def R9W : GPR32< 9, "r9">;
+def R10W : GPR32<10, "r10">;
+def R11W : GPR32<11, "r11">;
+def R12W : GPR32<12, "r12">;
+def R13W : GPR32<13, "r13">;
+def R14W : GPR32<14, "r14">;
+def R15W : GPR32<15, "r15">;
let SubRegIndices = [subreg_32bit] in {
def R0D : GPR64< 0, "r0", [R0W]>, DwarfRegNum<[0]>;
@@ -99,26 +99,26 @@ def R15D : GPR64<15, "r15", [R15W]>, DwarfRegNum<[15]>;
// Register pairs
let SubRegIndices = [subreg_32bit, subreg_odd32] in {
-def R0P : GPR64< 0, "r0", [R0W, R1W], [R0D, R1D]>, DwarfRegNum<[0]>;
-def R2P : GPR64< 2, "r2", [R2W, R3W], [R2D, R3D]>, DwarfRegNum<[2]>;
-def R4P : GPR64< 4, "r4", [R4W, R5W], [R4D, R5D]>, DwarfRegNum<[4]>;
-def R6P : GPR64< 6, "r6", [R6W, R7W], [R6D, R7D]>, DwarfRegNum<[6]>;
-def R8P : GPR64< 8, "r8", [R8W, R9W], [R8D, R9D]>, DwarfRegNum<[8]>;
-def R10P : GPR64<10, "r10", [R10W, R11W], [R10D, R11D]>, DwarfRegNum<[10]>;
-def R12P : GPR64<12, "r12", [R12W, R13W], [R12D, R13D]>, DwarfRegNum<[12]>;
-def R14P : GPR64<14, "r14", [R14W, R15W], [R14D, R15D]>, DwarfRegNum<[14]>;
+def R0P : GPR64< 0, "r0", [R0W, R1W], [R0D, R1D]>;
+def R2P : GPR64< 2, "r2", [R2W, R3W], [R2D, R3D]>;
+def R4P : GPR64< 4, "r4", [R4W, R5W], [R4D, R5D]>;
+def R6P : GPR64< 6, "r6", [R6W, R7W], [R6D, R7D]>;
+def R8P : GPR64< 8, "r8", [R8W, R9W], [R8D, R9D]>;
+def R10P : GPR64<10, "r10", [R10W, R11W], [R10D, R11D]>;
+def R12P : GPR64<12, "r12", [R12W, R13W], [R12D, R13D]>;
+def R14P : GPR64<14, "r14", [R14W, R15W], [R14D, R15D]>;
}
let SubRegIndices = [subreg_even, subreg_odd],
CompositeIndices = [(subreg_odd32 subreg_odd, subreg_32bit)] in {
-def R0Q : GPR128< 0, "r0", [R0D, R1D], [R0P]>, DwarfRegNum<[0]>;
-def R2Q : GPR128< 2, "r2", [R2D, R3D], [R2P]>, DwarfRegNum<[2]>;
-def R4Q : GPR128< 4, "r4", [R4D, R5D], [R4P]>, DwarfRegNum<[4]>;
-def R6Q : GPR128< 6, "r6", [R6D, R7D], [R6P]>, DwarfRegNum<[6]>;
-def R8Q : GPR128< 8, "r8", [R8D, R9D], [R8P]>, DwarfRegNum<[8]>;
-def R10Q : GPR128<10, "r10", [R10D, R11D], [R10P]>, DwarfRegNum<[10]>;
-def R12Q : GPR128<12, "r12", [R12D, R13D], [R12P]>, DwarfRegNum<[12]>;
-def R14Q : GPR128<14, "r14", [R14D, R15D], [R14P]>, DwarfRegNum<[14]>;
+def R0Q : GPR128< 0, "r0", [R0D, R1D], [R0P]>;
+def R2Q : GPR128< 2, "r2", [R2D, R3D], [R2P]>;
+def R4Q : GPR128< 4, "r4", [R4D, R5D], [R4P]>;
+def R6Q : GPR128< 6, "r6", [R6D, R7D], [R6P]>;
+def R8Q : GPR128< 8, "r8", [R8D, R9D], [R8P]>;
+def R10Q : GPR128<10, "r10", [R10D, R11D], [R10P]>;
+def R12Q : GPR128<12, "r12", [R12D, R13D], [R12P]>;
+def R14Q : GPR128<14, "r14", [R14D, R15D], [R14P]>;
}
// Floating-point registers
@@ -140,22 +140,22 @@ def F14S : FPRS<14, "f14">, DwarfRegNum<[30]>;
def F15S : FPRS<15, "f15">, DwarfRegNum<[31]>;
let SubRegIndices = [subreg_32bit] in {
-def F0L : FPRL< 0, "f0", [F0S]>, DwarfRegNum<[16]>;
-def F1L : FPRL< 1, "f1", [F1S]>, DwarfRegNum<[17]>;
-def F2L : FPRL< 2, "f2", [F2S]>, DwarfRegNum<[18]>;
-def F3L : FPRL< 3, "f3", [F3S]>, DwarfRegNum<[19]>;
-def F4L : FPRL< 4, "f4", [F4S]>, DwarfRegNum<[20]>;
-def F5L : FPRL< 5, "f5", [F5S]>, DwarfRegNum<[21]>;
-def F6L : FPRL< 6, "f6", [F6S]>, DwarfRegNum<[22]>;
-def F7L : FPRL< 7, "f7", [F7S]>, DwarfRegNum<[23]>;
-def F8L : FPRL< 8, "f8", [F8S]>, DwarfRegNum<[24]>;
-def F9L : FPRL< 9, "f9", [F9S]>, DwarfRegNum<[25]>;
-def F10L : FPRL<10, "f10", [F10S]>, DwarfRegNum<[26]>;
-def F11L : FPRL<11, "f11", [F11S]>, DwarfRegNum<[27]>;
-def F12L : FPRL<12, "f12", [F12S]>, DwarfRegNum<[28]>;
-def F13L : FPRL<13, "f13", [F13S]>, DwarfRegNum<[29]>;
-def F14L : FPRL<14, "f14", [F14S]>, DwarfRegNum<[30]>;
-def F15L : FPRL<15, "f15", [F15S]>, DwarfRegNum<[31]>;
+def F0L : FPRL< 0, "f0", [F0S]>;
+def F1L : FPRL< 1, "f1", [F1S]>;
+def F2L : FPRL< 2, "f2", [F2S]>;
+def F3L : FPRL< 3, "f3", [F3S]>;
+def F4L : FPRL< 4, "f4", [F4S]>;
+def F5L : FPRL< 5, "f5", [F5S]>;
+def F6L : FPRL< 6, "f6", [F6S]>;
+def F7L : FPRL< 7, "f7", [F7S]>;
+def F8L : FPRL< 8, "f8", [F8S]>;
+def F9L : FPRL< 9, "f9", [F9S]>;
+def F10L : FPRL<10, "f10", [F10S]>;
+def F11L : FPRL<11, "f11", [F11S]>;
+def F12L : FPRL<12, "f12", [F12S]>;
+def F13L : FPRL<13, "f13", [F13S]>;
+def F14L : FPRL<14, "f14", [F14S]>;
+def F15L : FPRL<15, "f15", [F15S]>;
}
// Status register
diff --git a/contrib/llvm/lib/Target/TargetLibraryInfo.cpp b/contrib/llvm/lib/Target/TargetLibraryInfo.cpp
index e336b09..709dfd2 100644
--- a/contrib/llvm/lib/Target/TargetLibraryInfo.cpp
+++ b/contrib/llvm/lib/Target/TargetLibraryInfo.cpp
@@ -38,8 +38,8 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T) {
TLI.setUnavailable(LibFunc::memset_pattern16);
}
- // iprintf and friends are only available on XCore.
- if (T.getArch() != Triple::xcore) {
+ // iprintf and friends are only available on XCore and TCE.
+ if (T.getArch() != Triple::xcore && T.getArch() != Triple::tce) {
TLI.setUnavailable(LibFunc::iprintf);
TLI.setUnavailable(LibFunc::siprintf);
TLI.setUnavailable(LibFunc::fiprintf);
@@ -61,6 +61,12 @@ TargetLibraryInfo::TargetLibraryInfo(const Triple &T) : ImmutablePass(ID) {
initialize(*this, T);
}
+TargetLibraryInfo::TargetLibraryInfo(const TargetLibraryInfo &TLI)
+ : ImmutablePass(ID) {
+ memcpy(AvailableArray, TLI.AvailableArray, sizeof(AvailableArray));
+}
+
+
/// disableAllFunctions - This disables all builtins, which is used for options
/// like -fno-builtin.
void TargetLibraryInfo::disableAllFunctions() {
diff --git a/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp b/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp
index 717ad41..3343384 100644
--- a/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp
@@ -58,7 +58,6 @@ TargetLoweringObjectFile::TargetLoweringObjectFile() : Ctx(0) {
DwarfRangesSection = 0;
DwarfMacroInfoSection = 0;
- IsFunctionEHSymbolGlobal = false;
IsFunctionEHFrameSymbolPrivate = true;
SupportsWeakOmittedEHFrame = true;
}
diff --git a/contrib/llvm/lib/Target/TargetMachine.cpp b/contrib/llvm/lib/Target/TargetMachine.cpp
index 76ccc09..863b811 100644
--- a/contrib/llvm/lib/Target/TargetMachine.cpp
+++ b/contrib/llvm/lib/Target/TargetMachine.cpp
@@ -40,7 +40,6 @@ namespace llvm {
bool JITExceptionHandling;
bool JITEmitDebugInfo;
bool JITEmitDebugInfoToDisk;
- bool UnwindTablesMandatory;
Reloc::Model RelocationModel;
CodeModel::Model CMModel;
bool GuaranteedTailCallOpt;
@@ -143,11 +142,6 @@ EmitJitDebugInfoToDisk("jit-emit-debug-to-disk",
cl::desc("Emit debug info objfiles to disk"),
cl::location(JITEmitDebugInfoToDisk),
cl::init(false));
-static cl::opt<bool, true>
-EnableUnwindTables("unwind-tables",
- cl::desc("Generate unwinding tables for all functions"),
- cl::location(UnwindTablesMandatory),
- cl::init(false));
static cl::opt<llvm::Reloc::Model, true>
DefRelocationModel("relocation-model",
diff --git a/contrib/llvm/lib/Target/TargetRegisterInfo.cpp b/contrib/llvm/lib/Target/TargetRegisterInfo.cpp
index 4811ba5..1c3f2dd 100644
--- a/contrib/llvm/lib/Target/TargetRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/TargetRegisterInfo.cpp
@@ -96,7 +96,8 @@ BitVector TargetRegisterInfo::getAllocatableSet(const MachineFunction &MF,
} else {
for (TargetRegisterInfo::regclass_iterator I = regclass_begin(),
E = regclass_end(); I != E; ++I)
- getAllocatableSetForRC(MF, *I, Allocatable);
+ if ((*I)->isAllocatable())
+ getAllocatableSetForRC(MF, *I, Allocatable);
}
// Mask out the reserved registers
diff --git a/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp b/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
index dd6e353..68247d2 100644
--- a/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
+++ b/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
@@ -41,6 +41,11 @@ X86ATTInstPrinter::X86ATTInstPrinter(TargetMachine &TM, const MCAsmInfo &MAI)
&TM.getSubtarget<X86Subtarget>()));
}
+void X86ATTInstPrinter::printRegName(raw_ostream &OS,
+ unsigned RegNo) const {
+ OS << '%' << getRegisterName(RegNo);
+}
+
void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS) {
// Try to print any aliases first.
if (!printAliasInstr(MI, OS))
diff --git a/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h b/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
index 8d69391..5f939b6 100644
--- a/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
+++ b/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
@@ -26,6 +26,7 @@ class X86ATTInstPrinter : public MCInstPrinter {
public:
X86ATTInstPrinter(TargetMachine &TM, const MCAsmInfo &MAI);
+ virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
virtual void printInst(const MCInst *MI, raw_ostream &OS);
virtual StringRef getOpcodeName(unsigned Opcode) const;
diff --git a/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp b/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
index 47253eb..5f581ba 100644
--- a/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
+++ b/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
@@ -29,6 +29,10 @@ using namespace llvm;
#define GET_INSTRUCTION_NAME
#include "X86GenAsmWriter1.inc"
+void X86IntelInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
+ OS << getRegisterName(RegNo);
+}
+
void X86IntelInstPrinter::printInst(const MCInst *MI, raw_ostream &OS) {
printInstruction(MI, OS);
diff --git a/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h b/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
index ca99dc0..c8030c3 100644
--- a/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
+++ b/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
@@ -27,6 +27,7 @@ public:
X86IntelInstPrinter(TargetMachine &TM, const MCAsmInfo &MAI)
: MCInstPrinter(MAI) {}
+ virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
virtual void printInst(const MCInst *MI, raw_ostream &OS);
virtual StringRef getOpcodeName(unsigned Opcode) const;
diff --git a/contrib/llvm/lib/Target/X86/X86.td b/contrib/llvm/lib/Target/X86/X86.td
index 25b8d3e..7bb9676 100644
--- a/contrib/llvm/lib/Target/X86/X86.td
+++ b/contrib/llvm/lib/Target/X86/X86.td
@@ -101,8 +101,10 @@ def : Proc<"i686", []>;
def : Proc<"pentiumpro", [FeatureCMOV]>;
def : Proc<"pentium2", [FeatureMMX, FeatureCMOV]>;
def : Proc<"pentium3", [FeatureSSE1]>;
+def : Proc<"pentium3m", [FeatureSSE1, FeatureSlowBTMem]>;
def : Proc<"pentium-m", [FeatureSSE2, FeatureSlowBTMem]>;
def : Proc<"pentium4", [FeatureSSE2]>;
+def : Proc<"pentium4m", [FeatureSSE2, FeatureSlowBTMem]>;
def : Proc<"x86-64", [FeatureSSE2, Feature64Bit, FeatureSlowBTMem]>;
def : Proc<"yonah", [FeatureSSE3, FeatureSlowBTMem]>;
def : Proc<"prescott", [FeatureSSE3, FeatureSlowBTMem]>;
@@ -122,7 +124,7 @@ def : Proc<"westmere", [FeatureSSE42, Feature64Bit, FeatureSlowBTMem,
// SSE is not listed here since llvm treats AVX as a reimplementation of SSE,
// rather than a superset.
// FIXME: Disabling AVX for now since it's not ready.
-def : Proc<"sandybridge", [FeatureSSE42, Feature64Bit,
+def : Proc<"corei7-avx", [FeatureSSE42, Feature64Bit,
FeatureAES, FeatureCLMUL]>;
def : Proc<"k6", [FeatureMMX]>;
diff --git a/contrib/llvm/lib/Target/X86/X86FastISel.cpp b/contrib/llvm/lib/Target/X86/X86FastISel.cpp
index 1382f18..f1b9972 100644
--- a/contrib/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/contrib/llvm/lib/Target/X86/X86FastISel.cpp
@@ -108,11 +108,11 @@ private:
bool X86SelectFPExt(const Instruction *I);
bool X86SelectFPTrunc(const Instruction *I);
- bool X86SelectExtractValue(const Instruction *I);
-
bool X86VisitIntrinsicCall(const IntrinsicInst &I);
bool X86SelectCall(const Instruction *I);
+ bool DoSelectCall(const Instruction *I, const char *MemIntName);
+
const X86InstrInfo *getInstrInfo() const {
return getTargetMachine()->getInstrInfo();
}
@@ -135,6 +135,8 @@ private:
bool isTypeLegal(const Type *Ty, MVT &VT, bool AllowI1 = false);
+ bool IsMemcpySmall(uint64_t Len);
+
bool TryEmitSmallMemcpy(X86AddressMode DestAM,
X86AddressMode SrcAM, uint64_t Len);
};
@@ -401,7 +403,7 @@ bool X86FastISel::X86SelectAddress(const Value *V, X86AddressMode &AM) {
Disp += SL->getElementOffset(cast<ConstantInt>(Op)->getZExtValue());
continue;
}
-
+
// A array/variable index is always of the form i*S where S is the
// constant scale size. See if we can push the scale into immediates.
uint64_t S = TD.getTypeAllocSize(GTI.getIndexedType());
@@ -469,7 +471,7 @@ bool X86FastISel::X86SelectAddress(const Value *V, X86AddressMode &AM) {
if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
if (GVar->isThreadLocal())
return false;
-
+
// RIP-relative addresses can't have additional register operands, so if
// we've already folded stuff into the addressing mode, just force the
// global value into its own register, which we can use as the basereg.
@@ -704,7 +706,8 @@ bool X86FastISel::X86SelectRet(const Instruction *I) {
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ValLocs;
- CCState CCInfo(CC, F.isVarArg(), TM, ValLocs, I->getContext());
+ CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, TM, ValLocs,
+ I->getContext());
CCInfo.AnalyzeReturn(Outs, RetCC_X86);
const Value *RV = Ret->getOperand(0);
@@ -724,18 +727,38 @@ bool X86FastISel::X86SelectRet(const Instruction *I) {
// Only handle register returns for now.
if (!VA.isRegLoc())
return false;
- // TODO: For now, don't try to handle cases where getLocInfo()
- // says Full but the types don't match.
- if (TLI.getValueType(RV->getType()) != VA.getValVT())
- return false;
// The calling-convention tables for x87 returns don't tell
// the whole story.
if (VA.getLocReg() == X86::ST0 || VA.getLocReg() == X86::ST1)
return false;
- // Make the copy.
unsigned SrcReg = Reg + VA.getValNo();
+ EVT SrcVT = TLI.getValueType(RV->getType());
+ EVT DstVT = VA.getValVT();
+ // Special handling for extended integers.
+ if (SrcVT != DstVT) {
+ if (SrcVT != MVT::i1 && SrcVT != MVT::i8 && SrcVT != MVT::i16)
+ return false;
+
+ if (!Outs[0].Flags.isZExt() && !Outs[0].Flags.isSExt())
+ return false;
+
+ assert(DstVT == MVT::i32 && "X86 should always ext to i32");
+
+ if (SrcVT == MVT::i1) {
+ if (Outs[0].Flags.isSExt())
+ return false;
+ SrcReg = FastEmitZExtFromI1(MVT::i8, SrcReg, /*TODO: Kill=*/false);
+ SrcVT = MVT::i8;
+ }
+ unsigned Op = Outs[0].Flags.isZExt() ? ISD::ZERO_EXTEND :
+ ISD::SIGN_EXTEND;
+ SrcReg = FastEmit_r(SrcVT.getSimpleVT(), DstVT.getSimpleVT(), Op,
+ SrcReg, /*TODO: Kill=*/false);
+ }
+
+ // Make the copy.
unsigned DstReg = VA.getLocReg();
const TargetRegisterClass* SrcRC = MRI.getRegClass(SrcReg);
// Avoid a cross-class copy. This is very unlikely.
@@ -916,18 +939,31 @@ bool X86FastISel::X86SelectCmp(const Instruction *I) {
bool X86FastISel::X86SelectZExt(const Instruction *I) {
// Handle zero-extension from i1 to i8, which is common.
- if (I->getType()->isIntegerTy(8) &&
- I->getOperand(0)->getType()->isIntegerTy(1)) {
- unsigned ResultReg = getRegForValue(I->getOperand(0));
- if (ResultReg == 0) return false;
- // Set the high bits to zero.
- ResultReg = FastEmitZExtFromI1(MVT::i8, ResultReg, /*TODO: Kill=*/false);
- if (ResultReg == 0) return false;
- UpdateValueMap(I, ResultReg);
- return true;
+ if (!I->getOperand(0)->getType()->isIntegerTy(1))
+ return false;
+
+ EVT DstVT = TLI.getValueType(I->getType());
+ if (!TLI.isTypeLegal(DstVT))
+ return false;
+
+ unsigned ResultReg = getRegForValue(I->getOperand(0));
+ if (ResultReg == 0)
+ return false;
+
+ // Set the high bits to zero.
+ ResultReg = FastEmitZExtFromI1(MVT::i8, ResultReg, /*TODO: Kill=*/false);
+ if (ResultReg == 0)
+ return false;
+
+ if (DstVT != MVT::i8) {
+ ResultReg = FastEmit_r(MVT::i8, DstVT.getSimpleVT(), ISD::ZERO_EXTEND,
+ ResultReg, /*Kill=*/true);
+ if (ResultReg == 0)
+ return false;
}
- return false;
+ UpdateValueMap(I, ResultReg);
+ return true;
}
@@ -1010,63 +1046,6 @@ bool X86FastISel::X86SelectBranch(const Instruction *I) {
FuncInfo.MBB->addSuccessor(TrueMBB);
return true;
}
- } else if (ExtractValueInst *EI =
- dyn_cast<ExtractValueInst>(BI->getCondition())) {
- // Check to see if the branch instruction is from an "arithmetic with
- // overflow" intrinsic. The main way these intrinsics are used is:
- //
- // %t = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2)
- // %sum = extractvalue { i32, i1 } %t, 0
- // %obit = extractvalue { i32, i1 } %t, 1
- // br i1 %obit, label %overflow, label %normal
- //
- // The %sum and %obit are converted in an ADD and a SETO/SETB before
- // reaching the branch. Therefore, we search backwards through the MBB
- // looking for the SETO/SETB instruction. If an instruction modifies the
- // EFLAGS register before we reach the SETO/SETB instruction, then we can't
- // convert the branch into a JO/JB instruction.
- if (const IntrinsicInst *CI =
- dyn_cast<IntrinsicInst>(EI->getAggregateOperand())){
- if (CI->getIntrinsicID() == Intrinsic::sadd_with_overflow ||
- CI->getIntrinsicID() == Intrinsic::uadd_with_overflow) {
- const MachineInstr *SetMI = 0;
- unsigned Reg = getRegForValue(EI);
-
- for (MachineBasicBlock::const_reverse_iterator
- RI = FuncInfo.MBB->rbegin(), RE = FuncInfo.MBB->rend();
- RI != RE; ++RI) {
- const MachineInstr &MI = *RI;
-
- if (MI.definesRegister(Reg)) {
- if (MI.isCopy()) {
- Reg = MI.getOperand(1).getReg();
- continue;
- }
-
- SetMI = &MI;
- break;
- }
-
- const TargetInstrDesc &TID = MI.getDesc();
- if (TID.hasImplicitDefOfPhysReg(X86::EFLAGS) ||
- MI.hasUnmodeledSideEffects())
- break;
- }
-
- if (SetMI) {
- unsigned OpCode = SetMI->getOpcode();
-
- if (OpCode == X86::SETOr || OpCode == X86::SETBr) {
- BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
- TII.get(OpCode == X86::SETOr ? X86::JO_4 : X86::JB_4))
- .addMBB(TrueMBB);
- FastEmitBranch(FalseMBB, DL);
- FuncInfo.MBB->addSuccessor(TrueMBB);
- return true;
- }
- }
- }
- }
} else if (TruncInst *TI = dyn_cast<TruncInst>(BI->getCondition())) {
// Handle things like "%cond = trunc i32 %X to i1 / br i1 %cond", which
// typically happen for _Bool and C++ bools.
@@ -1086,13 +1065,13 @@ bool X86FastISel::X86SelectBranch(const Instruction *I) {
if (OpReg == 0) return false;
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TestOpc))
.addReg(OpReg).addImm(1);
-
+
unsigned JmpOpc = X86::JNE_4;
if (FuncInfo.MBB->isLayoutSuccessor(TrueMBB)) {
std::swap(TrueMBB, FalseMBB);
JmpOpc = X86::JE_4;
}
-
+
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(JmpOpc))
.addMBB(TrueMBB);
FastEmitBranch(FalseMBB, DL);
@@ -1266,18 +1245,13 @@ bool X86FastISel::X86SelectFPTrunc(const Instruction *I) {
}
bool X86FastISel::X86SelectTrunc(const Instruction *I) {
- if (Subtarget->is64Bit())
- // All other cases should be handled by the tblgen generated code.
- return false;
EVT SrcVT = TLI.getValueType(I->getOperand(0)->getType());
EVT DstVT = TLI.getValueType(I->getType());
- // This code only handles truncation to byte right now.
+ // This code only handles truncation to byte.
if (DstVT != MVT::i8 && DstVT != MVT::i1)
- // All other cases should be handled by the tblgen generated code.
return false;
- if (SrcVT != MVT::i16 && SrcVT != MVT::i32)
- // All other cases should be handled by the tblgen generated code.
+ if (!TLI.isTypeLegal(SrcVT))
return false;
unsigned InputReg = getRegForValue(I->getOperand(0));
@@ -1285,16 +1259,26 @@ bool X86FastISel::X86SelectTrunc(const Instruction *I) {
// Unhandled operand. Halt "fast" selection and bail.
return false;
- // First issue a copy to GR16_ABCD or GR32_ABCD.
- const TargetRegisterClass *CopyRC = (SrcVT == MVT::i16)
- ? X86::GR16_ABCDRegisterClass : X86::GR32_ABCDRegisterClass;
- unsigned CopyReg = createResultReg(CopyRC);
- BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY),
- CopyReg).addReg(InputReg);
+ if (SrcVT == MVT::i8) {
+ // Truncate from i8 to i1; no code needed.
+ UpdateValueMap(I, InputReg);
+ return true;
+ }
+
+ if (!Subtarget->is64Bit()) {
+ // If we're on x86-32; we can't extract an i8 from a general register.
+ // First issue a copy to GR16_ABCD or GR32_ABCD.
+ const TargetRegisterClass *CopyRC = (SrcVT == MVT::i16)
+ ? X86::GR16_ABCDRegisterClass : X86::GR32_ABCDRegisterClass;
+ unsigned CopyReg = createResultReg(CopyRC);
+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY),
+ CopyReg).addReg(InputReg);
+ InputReg = CopyReg;
+ }
- // Then issue an extract_subreg.
+ // Issue an extract_subreg.
unsigned ResultReg = FastEmitInst_extractsubreg(MVT::i8,
- CopyReg, /*Kill=*/true,
+ InputReg, /*Kill=*/true,
X86::sub_8bit);
if (!ResultReg)
return false;
@@ -1303,36 +1287,18 @@ bool X86FastISel::X86SelectTrunc(const Instruction *I) {
return true;
}
-bool X86FastISel::X86SelectExtractValue(const Instruction *I) {
- const ExtractValueInst *EI = cast<ExtractValueInst>(I);
- const Value *Agg = EI->getAggregateOperand();
-
- if (const IntrinsicInst *CI = dyn_cast<IntrinsicInst>(Agg)) {
- switch (CI->getIntrinsicID()) {
- default: break;
- case Intrinsic::sadd_with_overflow:
- case Intrinsic::uadd_with_overflow: {
- // Cheat a little. We know that the registers for "add" and "seto" are
- // allocated sequentially. However, we only keep track of the register
- // for "add" in the value map. Use extractvalue's index to get the
- // correct register for "seto".
- unsigned OpReg = getRegForValue(Agg);
- if (OpReg == 0)
- return false;
- UpdateValueMap(I, OpReg + *EI->idx_begin());
- return true;
- }
- }
- }
-
- return false;
+bool X86FastISel::IsMemcpySmall(uint64_t Len) {
+ return Len <= (Subtarget->is64Bit() ? 32 : 16);
}
bool X86FastISel::TryEmitSmallMemcpy(X86AddressMode DestAM,
X86AddressMode SrcAM, uint64_t Len) {
+
// Make sure we don't bloat code by inlining very large memcpy's.
- bool i64Legal = TLI.isTypeLegal(MVT::i64);
- if (Len > (i64Legal ? 32 : 16)) return false;
+ if (!IsMemcpySmall(Len))
+ return false;
+
+ bool i64Legal = Subtarget->is64Bit();
// We don't care about alignment here since we just emit integer accesses.
while (Len) {
@@ -1369,20 +1335,44 @@ bool X86FastISel::X86VisitIntrinsicCall(const IntrinsicInst &I) {
case Intrinsic::memcpy: {
const MemCpyInst &MCI = cast<MemCpyInst>(I);
// Don't handle volatile or variable length memcpys.
- if (MCI.isVolatile() || !isa<ConstantInt>(MCI.getLength()))
+ if (MCI.isVolatile())
+ return false;
+
+ if (isa<ConstantInt>(MCI.getLength())) {
+ // Small memcpy's are common enough that we want to do them
+ // without a call if possible.
+ uint64_t Len = cast<ConstantInt>(MCI.getLength())->getZExtValue();
+ if (IsMemcpySmall(Len)) {
+ X86AddressMode DestAM, SrcAM;
+ if (!X86SelectAddress(MCI.getRawDest(), DestAM) ||
+ !X86SelectAddress(MCI.getRawSource(), SrcAM))
+ return false;
+ TryEmitSmallMemcpy(DestAM, SrcAM, Len);
+ return true;
+ }
+ }
+
+ unsigned SizeWidth = Subtarget->is64Bit() ? 64 : 32;
+ if (!MCI.getLength()->getType()->isIntegerTy(SizeWidth))
return false;
- uint64_t Len = cast<ConstantInt>(MCI.getLength())->getZExtValue();
-
- // Get the address of the dest and source addresses.
- X86AddressMode DestAM, SrcAM;
- if (!X86SelectAddress(MCI.getRawDest(), DestAM) ||
- !X86SelectAddress(MCI.getRawSource(), SrcAM))
+ if (MCI.getSourceAddressSpace() > 255 || MCI.getDestAddressSpace() > 255)
return false;
- return TryEmitSmallMemcpy(DestAM, SrcAM, Len);
+ return DoSelectCall(&I, "memcpy");
+ }
+ case Intrinsic::memset: {
+ const MemSetInst &MSI = cast<MemSetInst>(I);
+
+ unsigned SizeWidth = Subtarget->is64Bit() ? 64 : 32;
+ if (!MSI.getLength()->getType()->isIntegerTy(SizeWidth))
+ return false;
+
+ if (MSI.getDestAddressSpace() > 255)
+ return false;
+
+ return DoSelectCall(&I, "memset");
}
-
case Intrinsic::stackprotector: {
// Emit code inline code to store the stack guard onto the stack.
EVT PtrTy = TLI.getPointerTy();
@@ -1396,29 +1386,6 @@ bool X86FastISel::X86VisitIntrinsicCall(const IntrinsicInst &I) {
if (!X86FastEmitStore(PtrTy, Op1, AM)) return false;
return true;
}
- case Intrinsic::objectsize: {
- // FIXME: This should be moved to generic code!
- ConstantInt *CI = cast<ConstantInt>(I.getArgOperand(1));
- const Type *Ty = I.getCalledFunction()->getReturnType();
-
- MVT VT;
- if (!isTypeLegal(Ty, VT))
- return false;
-
- unsigned OpC = 0;
- if (VT == MVT::i32)
- OpC = X86::MOV32ri;
- else if (VT == MVT::i64)
- OpC = X86::MOV64ri;
- else
- return false;
-
- unsigned ResultReg = createResultReg(TLI.getRegClassFor(VT));
- BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpC), ResultReg).
- addImm(CI->isZero() ? -1ULL : 0);
- UpdateValueMap(&I, ResultReg);
- return true;
- }
case Intrinsic::dbg_declare: {
const DbgDeclareInst *DI = cast<DbgDeclareInst>(&I);
X86AddressMode AM;
@@ -1439,12 +1406,9 @@ bool X86FastISel::X86VisitIntrinsicCall(const IntrinsicInst &I) {
case Intrinsic::sadd_with_overflow:
case Intrinsic::uadd_with_overflow: {
// FIXME: Should fold immediates.
-
+
// Replace "add with overflow" intrinsics with an "add" instruction followed
- // by a seto/setc instruction. Later on, when the "extractvalue"
- // instructions are encountered, we use the fact that two registers were
- // created sequentially to get the correct registers for the "sum" and the
- // "overflow bit".
+ // by a seto/setc instruction.
const Function *Callee = I.getCalledFunction();
const Type *RetTy =
cast<StructType>(Callee->getReturnType())->getTypeAtIndex(unsigned(0));
@@ -1470,27 +1434,18 @@ bool X86FastISel::X86VisitIntrinsicCall(const IntrinsicInst &I) {
else
return false;
- unsigned ResultReg = createResultReg(TLI.getRegClassFor(VT));
+ // The call to CreateRegs builds two sequential registers, to store the
+ // both the the returned values.
+ unsigned ResultReg = FuncInfo.CreateRegs(I.getType());
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(OpC), ResultReg)
.addReg(Reg1).addReg(Reg2);
- unsigned DestReg1 = UpdateValueMap(&I, ResultReg);
-
- // If the add with overflow is an intra-block value then we just want to
- // create temporaries for it like normal. If it is a cross-block value then
- // UpdateValueMap will return the cross-block register used. Since we
- // *really* want the value to be live in the register pair known by
- // UpdateValueMap, we have to use DestReg1+1 as the destination register in
- // the cross block case. In the non-cross-block case, we should just make
- // another register for the value.
- if (DestReg1 != ResultReg)
- ResultReg = DestReg1+1;
- else
- ResultReg = createResultReg(TLI.getRegClassFor(MVT::i8));
unsigned Opc = X86::SETBr;
if (I.getIntrinsicID() == Intrinsic::sadd_with_overflow)
Opc = X86::SETOr;
- BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc), ResultReg);
+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(Opc), ResultReg+1);
+
+ UpdateValueMap(&I, ResultReg, 2);
return true;
}
}
@@ -1508,6 +1463,14 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(CI))
return X86VisitIntrinsicCall(*II);
+ return DoSelectCall(I, 0);
+}
+
+// Select either a call, or an llvm.memcpy/memmove/memset intrinsic
+bool X86FastISel::DoSelectCall(const Instruction *I, const char *MemIntName) {
+ const CallInst *CI = cast<CallInst>(I);
+ const Value *Callee = CI->getCalledValue();
+
// Handle only C and fastcc calling conventions for now.
ImmutableCallSite CS(CI);
CallingConv::ID CC = CS.getCallingConv();
@@ -1533,12 +1496,15 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
if (Subtarget->IsCalleePop(isVarArg, CC))
return false;
- // Handle *simple* calls for now.
- const Type *RetTy = CS.getType();
- MVT RetVT;
- if (RetTy->isVoidTy())
- RetVT = MVT::isVoid;
- else if (!isTypeLegal(RetTy, RetVT, true))
+ // Check whether the function can return without sret-demotion.
+ SmallVector<ISD::OutputArg, 4> Outs;
+ SmallVector<uint64_t, 4> Offsets;
+ GetReturnInfo(I->getType(), CS.getAttributes().getRetAttributes(),
+ Outs, TLI, &Offsets);
+ bool CanLowerReturn = TLI.CanLowerReturn(CS.getCallingConv(),
+ *FuncInfo.MF, FTy->isVarArg(),
+ Outs, FTy->getContext());
+ if (!CanLowerReturn)
return false;
// Materialize callee address in a register. FIXME: GV address can be
@@ -1555,13 +1521,6 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
} else
return false;
- // Allow calls which produce i1 results.
- bool AndToI1 = false;
- if (RetVT == MVT::i1) {
- RetVT = MVT::i8;
- AndToI1 = true;
- }
-
// Deal with call operands first.
SmallVector<const Value *, 8> ArgVals;
SmallVector<unsigned, 8> Args;
@@ -1573,6 +1532,10 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
ArgFlags.reserve(CS.arg_size());
for (ImmutableCallSite::arg_iterator i = CS.arg_begin(), e = CS.arg_end();
i != e; ++i) {
+ // If we're lowering a mem intrinsic instead of a regular call, skip the
+ // last two arguments, which should not passed to the underlying functions.
+ if (MemIntName && e-i <= 2)
+ break;
Value *ArgVal = *i;
ISD::ArgFlagsTy Flags;
unsigned AttrInd = i - CS.arg_begin() + 1;
@@ -1581,6 +1544,25 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
if (CS.paramHasAttr(AttrInd, Attribute::ZExt))
Flags.setZExt();
+ if (CS.paramHasAttr(AttrInd, Attribute::ByVal)) {
+ const PointerType *Ty = cast<PointerType>(ArgVal->getType());
+ const Type *ElementTy = Ty->getElementType();
+ unsigned FrameSize = TD.getTypeAllocSize(ElementTy);
+ unsigned FrameAlign = CS.getParamAlignment(AttrInd);
+ if (!FrameAlign)
+ FrameAlign = TLI.getByValTypeAlignment(ElementTy);
+ Flags.setByVal();
+ Flags.setByValSize(FrameSize);
+ Flags.setByValAlign(FrameAlign);
+ if (!IsMemcpySmall(FrameSize))
+ return false;
+ }
+
+ if (CS.paramHasAttr(AttrInd, Attribute::InReg))
+ Flags.setInReg();
+ if (CS.paramHasAttr(AttrInd, Attribute::Nest))
+ Flags.setNest();
+
// If this is an i1/i8/i16 argument, promote to i32 to avoid an extra
// instruction. This is safe because it is common to all fastisel supported
// calling conventions on x86.
@@ -1593,9 +1575,9 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
ArgVal = ConstantExpr::getZExt(CI,Type::getInt32Ty(CI->getContext()));
}
}
-
+
unsigned ArgReg;
-
+
// Passing bools around ends up doing a trunc to i1 and passing it.
// Codegen this as an argument + "and 1".
if (ArgVal->getType()->isIntegerTy(1) && isa<TruncInst>(ArgVal) &&
@@ -1604,10 +1586,10 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
ArgVal = cast<TruncInst>(ArgVal)->getOperand(0);
ArgReg = getRegForValue(ArgVal);
if (ArgReg == 0) return false;
-
+
MVT ArgVT;
if (!isTypeLegal(ArgVal->getType(), ArgVT)) return false;
-
+
ArgReg = FastEmit_ri(ArgVT, ArgVT, ISD::AND, ArgReg,
ArgVal->hasOneUse(), 1);
} else {
@@ -1616,16 +1598,12 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
if (ArgReg == 0) return false;
- // FIXME: Only handle *easy* calls for now.
- if (CS.paramHasAttr(AttrInd, Attribute::InReg) ||
- CS.paramHasAttr(AttrInd, Attribute::Nest) ||
- CS.paramHasAttr(AttrInd, Attribute::ByVal))
- return false;
-
const Type *ArgTy = ArgVal->getType();
MVT ArgVT;
if (!isTypeLegal(ArgTy, ArgVT))
return false;
+ if (ArgVT == MVT::x86mmx)
+ return false;
unsigned OriginalAlignment = TD.getABITypeAlignment(ArgTy);
Flags.setOrigAlign(OriginalAlignment);
@@ -1637,7 +1615,8 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CC, isVarArg, TM, ArgLocs, I->getParent()->getContext());
+ CCState CCInfo(CC, isVarArg, *FuncInfo.MF, TM, ArgLocs,
+ I->getParent()->getContext());
// Allocate shadow area for Win64
if (Subtarget->isTargetWin64())
@@ -1666,6 +1645,8 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
default: llvm_unreachable("Unknown loc info!");
case CCValAssign::Full: break;
case CCValAssign::SExt: {
+ assert(VA.getLocVT().isInteger() && !VA.getLocVT().isVector() &&
+ "Unexpected extend");
bool Emitted = X86FastEmitExtend(ISD::SIGN_EXTEND, VA.getLocVT(),
Arg, ArgVT, Arg);
assert(Emitted && "Failed to emit a sext!"); (void)Emitted;
@@ -1673,6 +1654,8 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
break;
}
case CCValAssign::ZExt: {
+ assert(VA.getLocVT().isInteger() && !VA.getLocVT().isVector() &&
+ "Unexpected extend");
bool Emitted = X86FastEmitExtend(ISD::ZERO_EXTEND, VA.getLocVT(),
Arg, ArgVT, Arg);
assert(Emitted && "Failed to emit a zext!"); (void)Emitted;
@@ -1680,9 +1663,8 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
break;
}
case CCValAssign::AExt: {
- // We don't handle MMX parameters yet.
- if (VA.getLocVT().isVector() && VA.getLocVT().getSizeInBits() == 128)
- return false;
+ assert(VA.getLocVT().isInteger() && !VA.getLocVT().isVector() &&
+ "Unexpected extend");
bool Emitted = X86FastEmitExtend(ISD::ANY_EXTEND, VA.getLocVT(),
Arg, ArgVT, Arg);
if (!Emitted)
@@ -1716,14 +1698,21 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
AM.Base.Reg = StackPtr;
AM.Disp = LocMemOffset;
const Value *ArgVal = ArgVals[VA.getValNo()];
-
- // If this is a really simple value, emit this with the Value* version of
- // X86FastEmitStore. If it isn't simple, we don't want to do this, as it
- // can cause us to reevaluate the argument.
- if (isa<ConstantInt>(ArgVal) || isa<ConstantPointerNull>(ArgVal))
+ ISD::ArgFlagsTy Flags = ArgFlags[VA.getValNo()];
+
+ if (Flags.isByVal()) {
+ X86AddressMode SrcAM;
+ SrcAM.Base.Reg = Arg;
+ bool Res = TryEmitSmallMemcpy(AM, SrcAM, Flags.getByValSize());
+ assert(Res && "memcpy length already checked!"); (void)Res;
+ } else if (isa<ConstantInt>(ArgVal) || isa<ConstantPointerNull>(ArgVal)) {
+ // If this is a really simple value, emit this with the Value* version
+ //of X86FastEmitStore. If it isn't simple, we don't want to do this,
+ // as it can cause us to reevaluate the argument.
X86FastEmitStore(ArgVT, ArgVal, AM);
- else
+ } else {
X86FastEmitStore(ArgVT, Arg, AM);
+ }
}
}
@@ -1793,8 +1782,11 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
}
- MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc))
- .addGlobalAddress(GV, 0, OpFlags);
+ MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc));
+ if (MemIntName)
+ MIB.addExternalSymbol(MemIntName, OpFlags);
+ else
+ MIB.addGlobalAddress(GV, 0, OpFlags);
}
// Add an implicit use GOT pointer in EBX.
@@ -1816,63 +1808,74 @@ bool X86FastISel::X86SelectCall(const Instruction *I) {
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(AdjStackUp))
.addImm(NumBytes).addImm(NumBytesCallee);
- // Now handle call return value (if any).
- SmallVector<unsigned, 4> UsedRegs;
- if (RetVT != MVT::isVoid) {
- SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CC, false, TM, RVLocs, I->getParent()->getContext());
- CCInfo.AnalyzeCallResult(RetVT, RetCC_X86);
+ // Build info for return calling conv lowering code.
+ // FIXME: This is practically a copy-paste from TargetLowering::LowerCallTo.
+ SmallVector<ISD::InputArg, 32> Ins;
+ SmallVector<EVT, 4> RetTys;
+ ComputeValueVTs(TLI, I->getType(), RetTys);
+ for (unsigned i = 0, e = RetTys.size(); i != e; ++i) {
+ EVT VT = RetTys[i];
+ EVT RegisterVT = TLI.getRegisterType(I->getParent()->getContext(), VT);
+ unsigned NumRegs = TLI.getNumRegisters(I->getParent()->getContext(), VT);
+ for (unsigned j = 0; j != NumRegs; ++j) {
+ ISD::InputArg MyFlags;
+ MyFlags.VT = RegisterVT.getSimpleVT();
+ MyFlags.Used = !CS.getInstruction()->use_empty();
+ if (CS.paramHasAttr(0, Attribute::SExt))
+ MyFlags.Flags.setSExt();
+ if (CS.paramHasAttr(0, Attribute::ZExt))
+ MyFlags.Flags.setZExt();
+ if (CS.paramHasAttr(0, Attribute::InReg))
+ MyFlags.Flags.setInReg();
+ Ins.push_back(MyFlags);
+ }
+ }
- // Copy all of the result registers out of their specified physreg.
- assert(RVLocs.size() == 1 && "Can't handle multi-value calls!");
- EVT CopyVT = RVLocs[0].getValVT();
- TargetRegisterClass* DstRC = TLI.getRegClassFor(CopyVT);
+ // Now handle call return values.
+ SmallVector<unsigned, 4> UsedRegs;
+ SmallVector<CCValAssign, 16> RVLocs;
+ CCState CCRetInfo(CC, false, *FuncInfo.MF, TM, RVLocs,
+ I->getParent()->getContext());
+ unsigned ResultReg = FuncInfo.CreateRegs(I->getType());
+ CCRetInfo.AnalyzeCallResult(Ins, RetCC_X86);
+ for (unsigned i = 0; i != RVLocs.size(); ++i) {
+ EVT CopyVT = RVLocs[i].getValVT();
+ unsigned CopyReg = ResultReg + i;
// If this is a call to a function that returns an fp value on the x87 fp
// stack, but where we prefer to use the value in xmm registers, copy it
// out as F80 and use a truncate to move it from fp stack reg to xmm reg.
- if ((RVLocs[0].getLocReg() == X86::ST0 ||
- RVLocs[0].getLocReg() == X86::ST1) &&
+ if ((RVLocs[i].getLocReg() == X86::ST0 ||
+ RVLocs[i].getLocReg() == X86::ST1) &&
isScalarFPTypeInSSEReg(RVLocs[0].getValVT())) {
CopyVT = MVT::f80;
- DstRC = X86::RFP80RegisterClass;
+ CopyReg = createResultReg(X86::RFP80RegisterClass);
}
- unsigned ResultReg = createResultReg(DstRC);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY),
- ResultReg).addReg(RVLocs[0].getLocReg());
- UsedRegs.push_back(RVLocs[0].getLocReg());
+ CopyReg).addReg(RVLocs[i].getLocReg());
+ UsedRegs.push_back(RVLocs[i].getLocReg());
- if (CopyVT != RVLocs[0].getValVT()) {
+ if (CopyVT != RVLocs[i].getValVT()) {
// Round the F80 the right size, which also moves to the appropriate xmm
// register. This is accomplished by storing the F80 value in memory and
// then loading it back. Ewww...
- EVT ResVT = RVLocs[0].getValVT();
+ EVT ResVT = RVLocs[i].getValVT();
unsigned Opc = ResVT == MVT::f32 ? X86::ST_Fp80m32 : X86::ST_Fp80m64;
unsigned MemSize = ResVT.getSizeInBits()/8;
int FI = MFI.CreateStackObject(MemSize, MemSize, false);
addFrameReference(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(Opc)), FI)
- .addReg(ResultReg);
- DstRC = ResVT == MVT::f32
- ? X86::FR32RegisterClass : X86::FR64RegisterClass;
+ .addReg(CopyReg);
Opc = ResVT == MVT::f32 ? X86::MOVSSrm : X86::MOVSDrm;
- ResultReg = createResultReg(DstRC);
addFrameReference(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
- TII.get(Opc), ResultReg), FI);
+ TII.get(Opc), ResultReg + i), FI);
}
-
- if (AndToI1) {
- // Mask out all but lowest bit for some call which produces an i1.
- unsigned AndResult = createResultReg(X86::GR8RegisterClass);
- BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
- TII.get(X86::AND8ri), AndResult).addReg(ResultReg).addImm(1);
- ResultReg = AndResult;
- }
-
- UpdateValueMap(I, ResultReg);
}
+ if (RVLocs.size())
+ UpdateValueMap(I, ResultReg, RVLocs.size());
+
// Set all unused physreg defs as dead.
static_cast<MachineInstr *>(MIB)->setPhysRegsDeadExcept(UsedRegs, TRI);
@@ -1911,8 +1914,6 @@ X86FastISel::TargetSelectInstruction(const Instruction *I) {
return X86SelectFPExt(I);
case Instruction::FPTrunc:
return X86SelectFPTrunc(I);
- case Instruction::ExtractValue:
- return X86SelectExtractValue(I);
case Instruction::IntToPtr: // Deliberate fall-through.
case Instruction::PtrToInt: {
EVT SrcVT = TLI.getValueType(I->getOperand(0)->getType());
@@ -1990,7 +1991,7 @@ unsigned X86FastISel::TargetMaterializeConstant(const Constant *C) {
if (AM.BaseType == X86AddressMode::RegBase &&
AM.IndexReg == 0 && AM.Disp == 0 && AM.GV == 0)
return AM.Base.Reg;
-
+
Opc = TLI.getPointerTy() == MVT::i32 ? X86::LEA32r : X86::LEA64r;
unsigned ResultReg = createResultReg(RC);
addFullAddress(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
diff --git a/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp b/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp
index 06d12fc..2e95300 100644
--- a/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -355,7 +355,7 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF) const {
MachineModuleInfo &MMI = MF.getMMI();
X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
bool needsFrameMoves = MMI.hasDebugInfo() ||
- !Fn->doesNotThrow() || UnwindTablesMandatory;
+ Fn->needsUnwindTableEntry();
uint64_t MaxAlign = MFI->getMaxAlignment(); // Desired stack alignment.
uint64_t StackSize = MFI->getStackSize(); // Number of bytes to allocate.
bool HasFP = hasFP(MF);
diff --git a/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index 4534e85..1fcc274 100644
--- a/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -189,6 +189,7 @@ namespace {
SDNode *Select(SDNode *N);
SDNode *SelectAtomic64(SDNode *Node, unsigned Opc);
SDNode *SelectAtomicLoadAdd(SDNode *Node, EVT NVT);
+ SDNode *SelectAtomicLoadArith(SDNode *Node, EVT NVT);
bool MatchLoadInAddress(LoadSDNode *N, X86ISelAddressMode &AM);
bool MatchWrapper(SDValue N, X86ISelAddressMode &AM);
@@ -1329,6 +1330,8 @@ SDNode *X86DAGToDAGISel::SelectAtomic64(SDNode *Node, unsigned Opc) {
return ResNode;
}
+// FIXME: Figure out some way to unify this with the 'or' and other code
+// below.
SDNode *X86DAGToDAGISel::SelectAtomicLoadAdd(SDNode *Node, EVT NVT) {
if (Node->hasAnyUseOfValue(0))
return 0;
@@ -1479,6 +1482,158 @@ SDNode *X86DAGToDAGISel::SelectAtomicLoadAdd(SDNode *Node, EVT NVT) {
}
}
+enum AtomicOpc {
+ OR,
+ AND,
+ XOR,
+ AtomicOpcEnd
+};
+
+enum AtomicSz {
+ ConstantI8,
+ I8,
+ SextConstantI16,
+ ConstantI16,
+ I16,
+ SextConstantI32,
+ ConstantI32,
+ I32,
+ SextConstantI64,
+ ConstantI64,
+ I64,
+ AtomicSzEnd
+};
+
+static const unsigned int AtomicOpcTbl[AtomicOpcEnd][AtomicSzEnd] = {
+ {
+ X86::LOCK_OR8mi,
+ X86::LOCK_OR8mr,
+ X86::LOCK_OR16mi8,
+ X86::LOCK_OR16mi,
+ X86::LOCK_OR16mr,
+ X86::LOCK_OR32mi8,
+ X86::LOCK_OR32mi,
+ X86::LOCK_OR32mr,
+ X86::LOCK_OR64mi8,
+ X86::LOCK_OR64mi32,
+ X86::LOCK_OR64mr
+ },
+ {
+ X86::LOCK_AND8mi,
+ X86::LOCK_AND8mr,
+ X86::LOCK_AND16mi8,
+ X86::LOCK_AND16mi,
+ X86::LOCK_AND16mr,
+ X86::LOCK_AND32mi8,
+ X86::LOCK_AND32mi,
+ X86::LOCK_AND32mr,
+ X86::LOCK_AND64mi8,
+ X86::LOCK_AND64mi32,
+ X86::LOCK_AND64mr
+ },
+ {
+ X86::LOCK_XOR8mi,
+ X86::LOCK_XOR8mr,
+ X86::LOCK_XOR16mi8,
+ X86::LOCK_XOR16mi,
+ X86::LOCK_XOR16mr,
+ X86::LOCK_XOR32mi8,
+ X86::LOCK_XOR32mi,
+ X86::LOCK_XOR32mr,
+ X86::LOCK_XOR64mi8,
+ X86::LOCK_XOR64mi32,
+ X86::LOCK_XOR64mr
+ }
+};
+
+SDNode *X86DAGToDAGISel::SelectAtomicLoadArith(SDNode *Node, EVT NVT) {
+ if (Node->hasAnyUseOfValue(0))
+ return 0;
+
+ // Optimize common patterns for __sync_or_and_fetch and similar arith
+ // operations where the result is not used. This allows us to use the "lock"
+ // version of the arithmetic instruction.
+ // FIXME: Same as for 'add' and 'sub', try to merge those down here.
+ SDValue Chain = Node->getOperand(0);
+ SDValue Ptr = Node->getOperand(1);
+ SDValue Val = Node->getOperand(2);
+ SDValue Tmp0, Tmp1, Tmp2, Tmp3, Tmp4;
+ if (!SelectAddr(Node, Ptr, Tmp0, Tmp1, Tmp2, Tmp3, Tmp4))
+ return 0;
+
+ // Which index into the table.
+ enum AtomicOpc Op;
+ switch (Node->getOpcode()) {
+ case ISD::ATOMIC_LOAD_OR:
+ Op = OR;
+ break;
+ case ISD::ATOMIC_LOAD_AND:
+ Op = AND;
+ break;
+ case ISD::ATOMIC_LOAD_XOR:
+ Op = XOR;
+ break;
+ default:
+ return 0;
+ }
+
+ bool isCN = false;
+ ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Val);
+ if (CN) {
+ isCN = true;
+ Val = CurDAG->getTargetConstant(CN->getSExtValue(), NVT);
+ }
+
+ unsigned Opc = 0;
+ switch (NVT.getSimpleVT().SimpleTy) {
+ default: return 0;
+ case MVT::i8:
+ if (isCN)
+ Opc = AtomicOpcTbl[Op][ConstantI8];
+ else
+ Opc = AtomicOpcTbl[Op][I8];
+ break;
+ case MVT::i16:
+ if (isCN) {
+ if (immSext8(Val.getNode()))
+ Opc = AtomicOpcTbl[Op][SextConstantI16];
+ else
+ Opc = AtomicOpcTbl[Op][ConstantI16];
+ } else
+ Opc = AtomicOpcTbl[Op][I16];
+ break;
+ case MVT::i32:
+ if (isCN) {
+ if (immSext8(Val.getNode()))
+ Opc = AtomicOpcTbl[Op][SextConstantI32];
+ else
+ Opc = AtomicOpcTbl[Op][ConstantI32];
+ } else
+ Opc = AtomicOpcTbl[Op][I32];
+ break;
+ case MVT::i64:
+ if (isCN) {
+ if (immSext8(Val.getNode()))
+ Opc = AtomicOpcTbl[Op][SextConstantI64];
+ else if (i64immSExt32(Val.getNode()))
+ Opc = AtomicOpcTbl[Op][ConstantI64];
+ } else
+ Opc = AtomicOpcTbl[Op][I64];
+ break;
+ }
+
+ DebugLoc dl = Node->getDebugLoc();
+ SDValue Undef = SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF,
+ dl, NVT), 0);
+ MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1);
+ MemOp[0] = cast<MemSDNode>(Node)->getMemOperand();
+ SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, Tmp4, Val, Chain };
+ SDValue Ret = SDValue(CurDAG->getMachineNode(Opc, dl, MVT::Other, Ops, 7), 0);
+ cast<MachineSDNode>(Ret)->setMemRefs(MemOp, MemOp + 1);
+ SDValue RetVals[] = { Undef, Ret };
+ return CurDAG->getMergeValues(RetVals, 2, dl).getNode();
+}
+
/// HasNoSignedComparisonUses - Test whether the given X86ISD::CMP node has
/// any uses which require the SF or OF bits to be accurate.
static bool HasNoSignedComparisonUses(SDNode *N) {
@@ -1580,6 +1735,14 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
return RetVal;
break;
}
+ case ISD::ATOMIC_LOAD_XOR:
+ case ISD::ATOMIC_LOAD_AND:
+ case ISD::ATOMIC_LOAD_OR: {
+ SDNode *RetVal = SelectAtomicLoadArith(Node, NVT);
+ if (RetVal)
+ return RetVal;
+ break;
+ }
case ISD::AND:
case ISD::OR:
case ISD::XOR: {
@@ -1843,17 +2006,17 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
if (TryFoldLoad(Node, N0, Tmp0, Tmp1, Tmp2, Tmp3, Tmp4)) {
SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, Tmp4, N0.getOperand(0) };
Move =
- SDValue(CurDAG->getMachineNode(X86::MOVZX16rm8, dl, MVT::i16,
+ SDValue(CurDAG->getMachineNode(X86::MOVZX32rm8, dl, MVT::i32,
MVT::Other, Ops,
array_lengthof(Ops)), 0);
Chain = Move.getValue(1);
ReplaceUses(N0.getValue(1), Chain);
} else {
Move =
- SDValue(CurDAG->getMachineNode(X86::MOVZX16rr8, dl, MVT::i16, N0),0);
+ SDValue(CurDAG->getMachineNode(X86::MOVZX32rr8, dl, MVT::i32, N0),0);
Chain = CurDAG->getEntryNode();
}
- Chain = CurDAG->getCopyToReg(Chain, dl, X86::AX, Move, SDValue());
+ Chain = CurDAG->getCopyToReg(Chain, dl, X86::EAX, Move, SDValue());
InFlag = Chain.getValue(1);
} else {
InFlag =
diff --git a/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
index 703c01d..294a6a7 100644
--- a/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -222,7 +222,7 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
// X86 is weird, it always uses i8 for shift amounts and setcc results.
setBooleanContents(ZeroOrOneBooleanContent);
-
+
// For 64-bit since we have so many registers use the ILP scheduler, for
// 32-bit code use the register pressure specific scheduling.
if (Subtarget->is64Bit())
@@ -574,6 +574,10 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
setOperationAction(ISD::FCOPYSIGN, MVT::f64, Custom);
setOperationAction(ISD::FCOPYSIGN, MVT::f32, Custom);
+ // Lower this to FGETSIGNx86 plus an AND.
+ setOperationAction(ISD::FGETSIGN, MVT::i64, Custom);
+ setOperationAction(ISD::FGETSIGN, MVT::i32, Custom);
+
// We don't support sin/cos/fmod
setOperationAction(ISD::FSIN , MVT::f64, Expand);
setOperationAction(ISD::FCOS , MVT::f64, Expand);
@@ -927,7 +931,6 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
// Can turn SHL into an integer multiply.
setOperationAction(ISD::SHL, MVT::v4i32, Custom);
setOperationAction(ISD::SHL, MVT::v16i8, Custom);
- setOperationAction(ISD::SRL, MVT::v4i32, Legal);
// i8 and i16 vectors are custom , because the source register and source
// source memory operand types are not the same width. f32 vectors are
@@ -949,6 +952,19 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
}
}
+ if (Subtarget->hasSSE2()) {
+ setOperationAction(ISD::SRL, MVT::v2i64, Custom);
+ setOperationAction(ISD::SRL, MVT::v4i32, Custom);
+ setOperationAction(ISD::SRL, MVT::v16i8, Custom);
+
+ setOperationAction(ISD::SHL, MVT::v2i64, Custom);
+ setOperationAction(ISD::SHL, MVT::v4i32, Custom);
+ setOperationAction(ISD::SHL, MVT::v8i16, Custom);
+
+ setOperationAction(ISD::SRA, MVT::v4i32, Custom);
+ setOperationAction(ISD::SRA, MVT::v8i16, Custom);
+ }
+
if (Subtarget->hasSSE42())
setOperationAction(ISD::VSETCC, MVT::v2i64, Custom);
@@ -1081,6 +1097,7 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
setTargetDAGCombine(ISD::SUB);
setTargetDAGCombine(ISD::STORE);
setTargetDAGCombine(ISD::ZERO_EXTEND);
+ setTargetDAGCombine(ISD::SINT_TO_FP);
if (Subtarget->is64Bit())
setTargetDAGCombine(ISD::MUL);
@@ -1096,6 +1113,8 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
maxStoresPerMemmoveOptSize = Subtarget->isTargetDarwin() ? 8 : 4;
setPrefLoopAlignment(16);
benefitFromCodePlacementOpt = true;
+
+ setPrefFunctionAlignment(4);
}
@@ -1247,11 +1266,6 @@ getPICJumpTableRelocBaseExpr(const MachineFunction *MF, unsigned JTI,
return MCSymbolRefExpr::Create(MF->getPICBaseSymbol(), Ctx);
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned X86TargetLowering::getFunctionAlignment(const Function *F) const {
- return F->hasFnAttr(Attribute::OptimizeForSize) ? 0 : 4;
-}
-
// FIXME: Why this routine is here? Move to RegInfo!
std::pair<const TargetRegisterClass*, uint8_t>
X86TargetLowering::findRepresentativeClass(EVT VT) const{
@@ -1306,11 +1320,12 @@ bool X86TargetLowering::getStackCookieLocation(unsigned &AddressSpace,
#include "X86GenCallingConv.inc"
bool
-X86TargetLowering::CanLowerReturn(CallingConv::ID CallConv, bool isVarArg,
+X86TargetLowering::CanLowerReturn(CallingConv::ID CallConv,
+ MachineFunction &MF, bool isVarArg,
const SmallVectorImpl<ISD::OutputArg> &Outs,
LLVMContext &Context) const {
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
+ CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(),
RVLocs, Context);
return CCInfo.CheckReturn(Outs, RetCC_X86);
}
@@ -1325,7 +1340,7 @@ X86TargetLowering::LowerReturn(SDValue Chain,
X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
+ CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(),
RVLocs, *DAG.getContext());
CCInfo.AnalyzeReturn(Outs, RetCC_X86);
@@ -1476,8 +1491,8 @@ X86TargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
bool Is64Bit = Subtarget->is64Bit();
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_X86);
// Copy all of the result registers out of their specified physreg.
@@ -1518,20 +1533,6 @@ X86TargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
Val = DAG.getNode(ISD::FP_ROUND, dl, VA.getValVT(), Val,
// This truncation won't change the value.
DAG.getIntPtrConstant(1));
- } else if (Is64Bit && CopyVT.isVector() && CopyVT.getSizeInBits() == 64) {
- // For x86-64, MMX values are returned in XMM0 / XMM1 except for v1i64.
- if (VA.getLocReg() == X86::XMM0 || VA.getLocReg() == X86::XMM1) {
- Chain = DAG.getCopyFromReg(Chain, dl, VA.getLocReg(),
- MVT::v2i64, InFlag).getValue(1);
- Val = Chain.getValue(0);
- Val = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, MVT::i64,
- Val, DAG.getConstant(0, MVT::i64));
- } else {
- Chain = DAG.getCopyFromReg(Chain, dl, VA.getLocReg(),
- MVT::i64, InFlag).getValue(1);
- Val = Chain.getValue(0);
- }
- Val = DAG.getNode(ISD::BITCAST, dl, CopyVT, Val);
} else {
Chain = DAG.getCopyFromReg(Chain, dl, VA.getLocReg(),
CopyVT, InFlag).getValue(1);
@@ -1680,7 +1681,7 @@ X86TargetLowering::LowerFormalArguments(SDValue Chain,
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
+ CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(),
ArgLocs, *DAG.getContext());
// Allocate shadow area for Win64
@@ -2007,7 +2008,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
+ CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(),
ArgLocs, *DAG.getContext());
// Allocate shadow area for Win64
@@ -2530,16 +2531,30 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
if (RegInfo->needsStackRealignment(MF))
return false;
- // Do not sibcall optimize vararg calls unless the call site is not passing
- // any arguments.
- if (isVarArg && !Outs.empty())
- return false;
-
// Also avoid sibcall optimization if either caller or callee uses struct
// return semantics.
if (isCalleeStructRet || isCallerStructRet)
return false;
+ // Do not sibcall optimize vararg calls unless all arguments are passed via
+ // registers.
+ if (isVarArg && !Outs.empty()) {
+
+ // Optimizing for varargs on Win64 is unlikely to be safe without
+ // additional testing.
+ if (Subtarget->isTargetWin64())
+ return false;
+
+ SmallVector<CCValAssign, 16> ArgLocs;
+ CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
+
+ CCInfo.AnalyzeCallOperands(Outs, CC_X86);
+ for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i)
+ if (!ArgLocs[i].isRegLoc())
+ return false;
+ }
+
// If the call result is in ST0 / ST1, it needs to be popped off the x87 stack.
// Therefore if it's not used by the call it is not safe to optimize this into
// a sibcall.
@@ -2552,8 +2567,8 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
}
if (Unused) {
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CalleeCC, false, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CalleeCC, false, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_X86);
for (unsigned i = 0, e = RVLocs.size(); i != e; ++i) {
CCValAssign &VA = RVLocs[i];
@@ -2566,13 +2581,13 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
// results are returned in the same way as what the caller expects.
if (!CCMatch) {
SmallVector<CCValAssign, 16> RVLocs1;
- CCState CCInfo1(CalleeCC, false, getTargetMachine(),
- RVLocs1, *DAG.getContext());
+ CCState CCInfo1(CalleeCC, false, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs1, *DAG.getContext());
CCInfo1.AnalyzeCallResult(Ins, RetCC_X86);
SmallVector<CCValAssign, 16> RVLocs2;
- CCState CCInfo2(CallerCC, false, getTargetMachine(),
- RVLocs2, *DAG.getContext());
+ CCState CCInfo2(CallerCC, false, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs2, *DAG.getContext());
CCInfo2.AnalyzeCallResult(Ins, RetCC_X86);
if (RVLocs1.size() != RVLocs2.size())
@@ -2598,8 +2613,8 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
// Check if stack adjustment is needed. For now, do not do this if any
// argument is passed on the stack.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CalleeCC, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
// Allocate shadow area for Win64
if (Subtarget->isTargetWin64()) {
@@ -6619,9 +6634,9 @@ X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
}
-/// LowerShift - Lower SRA_PARTS and friends, which return two i32 values and
+/// LowerShiftParts - Lower SRA_PARTS and friends, which return two i32 values and
/// take a 2 x i32 value to shift plus a shift amount.
-SDValue X86TargetLowering::LowerShift(SDValue Op, SelectionDAG &DAG) const {
+SDValue X86TargetLowering::LowerShiftParts(SDValue Op, SelectionDAG &DAG) const {
assert(Op.getNumOperands() == 3 && "Not a double-shift!");
EVT VT = Op.getValueType();
unsigned VTBits = VT.getSizeInBits();
@@ -6710,12 +6725,18 @@ SDValue X86TargetLowering::BuildFILD(SDValue Op, EVT SrcVT, SDValue Chain,
unsigned ByteSize = SrcVT.getSizeInBits()/8;
- int SSFI = cast<FrameIndexSDNode>(StackSlot)->getIndex();
- MachineMemOperand *MMO =
- DAG.getMachineFunction()
- .getMachineMemOperand(MachinePointerInfo::getFixedStack(SSFI),
- MachineMemOperand::MOLoad, ByteSize, ByteSize);
-
+ FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(StackSlot);
+ MachineMemOperand *MMO;
+ if (FI) {
+ int SSFI = FI->getIndex();
+ MMO =
+ DAG.getMachineFunction()
+ .getMachineMemOperand(MachinePointerInfo::getFixedStack(SSFI),
+ MachineMemOperand::MOLoad, ByteSize, ByteSize);
+ } else {
+ MMO = cast<LoadSDNode>(StackSlot)->getMemOperand();
+ StackSlot = StackSlot.getOperand(1);
+ }
SDValue Ops[] = { Chain, StackSlot, DAG.getValueType(SrcVT) };
SDValue Result = DAG.getMemIntrinsicNode(useSSE ? X86ISD::FILD_FLAG :
X86ISD::FILD, DL,
@@ -7206,6 +7227,17 @@ SDValue X86TargetLowering::LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const {
return DAG.getNode(X86ISD::FOR, dl, VT, Val, SignBit);
}
+SDValue X86TargetLowering::LowerFGETSIGN(SDValue Op, SelectionDAG &DAG) const {
+ SDValue N0 = Op.getOperand(0);
+ DebugLoc dl = Op.getDebugLoc();
+ EVT VT = Op.getValueType();
+
+ // Lower ISD::FGETSIGN to (AND (X86ISD::FGETSIGNx86 ...) 1).
+ SDValue xFGETSIGN = DAG.getNode(X86ISD::FGETSIGNx86, dl, VT, N0,
+ DAG.getConstant(1, VT));
+ return DAG.getNode(ISD::AND, dl, VT, xFGETSIGN, DAG.getConstant(1, VT));
+}
+
/// Emit nodes that will be selected as "test Op0,Op0", or something
/// equivalent.
SDValue X86TargetLowering::EmitTest(SDValue Op, unsigned X86CC,
@@ -8781,16 +8813,71 @@ SDValue X86TargetLowering::LowerMUL_V2I64(SDValue Op, SelectionDAG &DAG) const {
return Res;
}
-SDValue X86TargetLowering::LowerSHL(SDValue Op, SelectionDAG &DAG) const {
+SDValue X86TargetLowering::LowerShift(SDValue Op, SelectionDAG &DAG) const {
+
EVT VT = Op.getValueType();
DebugLoc dl = Op.getDebugLoc();
SDValue R = Op.getOperand(0);
+ SDValue Amt = Op.getOperand(1);
LLVMContext *Context = DAG.getContext();
- assert(Subtarget->hasSSE41() && "Cannot lower SHL without SSE4.1 or later");
+ // Must have SSE2.
+ if (!Subtarget->hasSSE2()) return SDValue();
+
+ // Optimize shl/srl/sra with constant shift amount.
+ if (isSplatVector(Amt.getNode())) {
+ SDValue SclrAmt = Amt->getOperand(0);
+ if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(SclrAmt)) {
+ uint64_t ShiftAmt = C->getZExtValue();
+
+ if (VT == MVT::v2i64 && Op.getOpcode() == ISD::SHL)
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
+ DAG.getConstant(Intrinsic::x86_sse2_pslli_q, MVT::i32),
+ R, DAG.getConstant(ShiftAmt, MVT::i32));
+
+ if (VT == MVT::v4i32 && Op.getOpcode() == ISD::SHL)
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
+ DAG.getConstant(Intrinsic::x86_sse2_pslli_d, MVT::i32),
+ R, DAG.getConstant(ShiftAmt, MVT::i32));
+
+ if (VT == MVT::v8i16 && Op.getOpcode() == ISD::SHL)
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
+ DAG.getConstant(Intrinsic::x86_sse2_pslli_w, MVT::i32),
+ R, DAG.getConstant(ShiftAmt, MVT::i32));
+
+ if (VT == MVT::v2i64 && Op.getOpcode() == ISD::SRL)
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
+ DAG.getConstant(Intrinsic::x86_sse2_psrli_q, MVT::i32),
+ R, DAG.getConstant(ShiftAmt, MVT::i32));
+
+ if (VT == MVT::v4i32 && Op.getOpcode() == ISD::SRL)
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
+ DAG.getConstant(Intrinsic::x86_sse2_psrli_d, MVT::i32),
+ R, DAG.getConstant(ShiftAmt, MVT::i32));
+
+ if (VT == MVT::v8i16 && Op.getOpcode() == ISD::SRL)
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
+ DAG.getConstant(Intrinsic::x86_sse2_psrli_w, MVT::i32),
+ R, DAG.getConstant(ShiftAmt, MVT::i32));
+
+ if (VT == MVT::v4i32 && Op.getOpcode() == ISD::SRA)
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
+ DAG.getConstant(Intrinsic::x86_sse2_psrai_d, MVT::i32),
+ R, DAG.getConstant(ShiftAmt, MVT::i32));
+
+ if (VT == MVT::v8i16 && Op.getOpcode() == ISD::SRA)
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
+ DAG.getConstant(Intrinsic::x86_sse2_psrai_w, MVT::i32),
+ R, DAG.getConstant(ShiftAmt, MVT::i32));
+ }
+ }
+
+ // Lower SHL with variable shift amount.
+ // Cannot lower SHL without SSE4.1 or later.
+ if (!Subtarget->hasSSE41()) return SDValue();
- if (VT == MVT::v4i32) {
+ if (VT == MVT::v4i32 && Op->getOpcode() == ISD::SHL) {
Op = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
DAG.getConstant(Intrinsic::x86_sse2_pslli_d, MVT::i32),
Op.getOperand(1), DAG.getConstant(23, MVT::i32));
@@ -8809,7 +8896,7 @@ SDValue X86TargetLowering::LowerSHL(SDValue Op, SelectionDAG &DAG) const {
Op = DAG.getNode(ISD::FP_TO_SINT, dl, VT, Op);
return DAG.getNode(ISD::MUL, dl, VT, Op, R);
}
- if (VT == MVT::v16i8) {
+ if (VT == MVT::v16i8 && Op->getOpcode() == ISD::SHL) {
// a = a << 5;
Op = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, VT,
DAG.getConstant(Intrinsic::x86_sse2_pslli_w, MVT::i32),
@@ -9114,7 +9201,7 @@ SDValue X86TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
case ISD::BlockAddress: return LowerBlockAddress(Op, DAG);
case ISD::SHL_PARTS:
case ISD::SRA_PARTS:
- case ISD::SRL_PARTS: return LowerShift(Op, DAG);
+ case ISD::SRL_PARTS: return LowerShiftParts(Op, DAG);
case ISD::SINT_TO_FP: return LowerSINT_TO_FP(Op, DAG);
case ISD::UINT_TO_FP: return LowerUINT_TO_FP(Op, DAG);
case ISD::FP_TO_SINT: return LowerFP_TO_SINT(Op, DAG);
@@ -9122,6 +9209,7 @@ SDValue X86TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
case ISD::FABS: return LowerFABS(Op, DAG);
case ISD::FNEG: return LowerFNEG(Op, DAG);
case ISD::FCOPYSIGN: return LowerFCOPYSIGN(Op, DAG);
+ case ISD::FGETSIGN: return LowerFGETSIGN(Op, DAG);
case ISD::SETCC: return LowerSETCC(Op, DAG);
case ISD::VSETCC: return LowerVSETCC(Op, DAG);
case ISD::SELECT: return LowerSELECT(Op, DAG);
@@ -9142,7 +9230,9 @@ SDValue X86TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
case ISD::CTLZ: return LowerCTLZ(Op, DAG);
case ISD::CTTZ: return LowerCTTZ(Op, DAG);
case ISD::MUL: return LowerMUL_V2I64(Op, DAG);
- case ISD::SHL: return LowerSHL(Op, DAG);
+ case ISD::SRA:
+ case ISD::SRL:
+ case ISD::SHL: return LowerShift(Op, DAG);
case ISD::SADDO:
case ISD::UADDO:
case ISD::SSUBO:
@@ -9309,6 +9399,8 @@ const char *X86TargetLowering::getTargetNodeName(unsigned Opcode) const {
case X86ISD::UCOMI: return "X86ISD::UCOMI";
case X86ISD::SETCC: return "X86ISD::SETCC";
case X86ISD::SETCC_CARRY: return "X86ISD::SETCC_CARRY";
+ case X86ISD::FSETCCsd: return "X86ISD::FSETCCsd";
+ case X86ISD::FSETCCss: return "X86ISD::FSETCCss";
case X86ISD::CMOV: return "X86ISD::CMOV";
case X86ISD::BRCOND: return "X86ISD::BRCOND";
case X86ISD::RET_FLAG: return "X86ISD::RET_FLAG";
@@ -10986,14 +11078,14 @@ static SDValue PerformEXTRACT_VECTOR_ELTCombine(SDNode *N, SelectionDAG &DAG,
UE = Uses.end(); UI != UE; ++UI) {
SDNode *Extract = *UI;
- // Compute the element's address.
+ // cOMpute the element's address.
SDValue Idx = Extract->getOperand(1);
unsigned EltSize =
InputVector.getValueType().getVectorElementType().getSizeInBits()/8;
uint64_t Offset = EltSize * cast<ConstantSDNode>(Idx)->getZExtValue();
SDValue OffsetVal = DAG.getConstant(Offset, TLI.getPointerTy());
- SDValue ScalarAddr = DAG.getNode(ISD::ADD, dl, Idx.getValueType(),
+ SDValue ScalarAddr = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(),
StackPtr, OffsetVal);
// Load the scalar.
@@ -11266,15 +11358,28 @@ static SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG,
if (N->getNumValues() == 2 && !SDValue(N, 1).use_empty())
return SDValue();
+ SDValue FalseOp = N->getOperand(0);
+ SDValue TrueOp = N->getOperand(1);
+ X86::CondCode CC = (X86::CondCode)N->getConstantOperandVal(2);
+ SDValue Cond = N->getOperand(3);
+ if (CC == X86::COND_E || CC == X86::COND_NE) {
+ switch (Cond.getOpcode()) {
+ default: break;
+ case X86ISD::BSR:
+ case X86ISD::BSF:
+ // If operand of BSR / BSF are proven never zero, then ZF cannot be set.
+ if (DAG.isKnownNeverZero(Cond.getOperand(0)))
+ return (CC == X86::COND_E) ? FalseOp : TrueOp;
+ }
+ }
+
// If this is a select between two integer constants, try to do some
// optimizations. Note that the operands are ordered the opposite of SELECT
// operands.
- if (ConstantSDNode *TrueC = dyn_cast<ConstantSDNode>(N->getOperand(1))) {
- if (ConstantSDNode *FalseC = dyn_cast<ConstantSDNode>(N->getOperand(0))) {
+ if (ConstantSDNode *TrueC = dyn_cast<ConstantSDNode>(TrueOp)) {
+ if (ConstantSDNode *FalseC = dyn_cast<ConstantSDNode>(FalseOp)) {
// Canonicalize the TrueC/FalseC values so that TrueC (the true value) is
// larger than FalseC (the false value).
- X86::CondCode CC = (X86::CondCode)N->getConstantOperandVal(2);
-
if (TrueC->getAPIntValue().ult(FalseC->getAPIntValue())) {
CC = X86::GetOppositeBranchCondition(CC);
std::swap(TrueC, FalseC);
@@ -11284,7 +11389,6 @@ static SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG,
// This is efficient for any integer data type (including i8/i16) and
// shift amount.
if (FalseC->getAPIntValue() == 0 && TrueC->getAPIntValue().isPowerOf2()) {
- SDValue Cond = N->getOperand(3);
Cond = DAG.getNode(X86ISD::SETCC, DL, MVT::i8,
DAG.getConstant(CC, MVT::i8), Cond);
@@ -11302,7 +11406,6 @@ static SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG,
// Optimize Cond ? cst+1 : cst -> zext(setcc(C)+cst. This is efficient
// for any integer data type, including i8/i16.
if (FalseC->getAPIntValue()+1 == TrueC->getAPIntValue()) {
- SDValue Cond = N->getOperand(3);
Cond = DAG.getNode(X86ISD::SETCC, DL, MVT::i8,
DAG.getConstant(CC, MVT::i8), Cond);
@@ -11341,7 +11444,6 @@ static SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG,
if (isFastMultiplier) {
APInt Diff = TrueC->getAPIntValue()-FalseC->getAPIntValue();
- SDValue Cond = N->getOperand(3);
Cond = DAG.getNode(X86ISD::SETCC, DL, MVT::i8,
DAG.getConstant(CC, MVT::i8), Cond);
// Zero extend the condition if needed.
@@ -11576,12 +11678,94 @@ static SDValue PerformShiftCombine(SDNode* N, SelectionDAG &DAG,
}
+// CMPEQCombine - Recognize the distinctive (AND (setcc ...) (setcc ..))
+// where both setccs reference the same FP CMP, and rewrite for CMPEQSS
+// and friends. Likewise for OR -> CMPNEQSS.
+static SDValue CMPEQCombine(SDNode *N, SelectionDAG &DAG,
+ TargetLowering::DAGCombinerInfo &DCI,
+ const X86Subtarget *Subtarget) {
+ unsigned opcode;
+
+ // SSE1 supports CMP{eq|ne}SS, and SSE2 added CMP{eq|ne}SD, but
+ // we're requiring SSE2 for both.
+ if (Subtarget->hasSSE2() && isAndOrOfSetCCs(SDValue(N, 0U), opcode)) {
+ SDValue N0 = N->getOperand(0);
+ SDValue N1 = N->getOperand(1);
+ SDValue CMP0 = N0->getOperand(1);
+ SDValue CMP1 = N1->getOperand(1);
+ DebugLoc DL = N->getDebugLoc();
+
+ // The SETCCs should both refer to the same CMP.
+ if (CMP0.getOpcode() != X86ISD::CMP || CMP0 != CMP1)
+ return SDValue();
+
+ SDValue CMP00 = CMP0->getOperand(0);
+ SDValue CMP01 = CMP0->getOperand(1);
+ EVT VT = CMP00.getValueType();
+
+ if (VT == MVT::f32 || VT == MVT::f64) {
+ bool ExpectingFlags = false;
+ // Check for any users that want flags:
+ for (SDNode::use_iterator UI = N->use_begin(),
+ UE = N->use_end();
+ !ExpectingFlags && UI != UE; ++UI)
+ switch (UI->getOpcode()) {
+ default:
+ case ISD::BR_CC:
+ case ISD::BRCOND:
+ case ISD::SELECT:
+ ExpectingFlags = true;
+ break;
+ case ISD::CopyToReg:
+ case ISD::SIGN_EXTEND:
+ case ISD::ZERO_EXTEND:
+ case ISD::ANY_EXTEND:
+ break;
+ }
+
+ if (!ExpectingFlags) {
+ enum X86::CondCode cc0 = (enum X86::CondCode)N0.getConstantOperandVal(0);
+ enum X86::CondCode cc1 = (enum X86::CondCode)N1.getConstantOperandVal(0);
+
+ if (cc1 == X86::COND_E || cc1 == X86::COND_NE) {
+ X86::CondCode tmp = cc0;
+ cc0 = cc1;
+ cc1 = tmp;
+ }
+
+ if ((cc0 == X86::COND_E && cc1 == X86::COND_NP) ||
+ (cc0 == X86::COND_NE && cc1 == X86::COND_P)) {
+ bool is64BitFP = (CMP00.getValueType() == MVT::f64);
+ X86ISD::NodeType NTOperator = is64BitFP ?
+ X86ISD::FSETCCsd : X86ISD::FSETCCss;
+ // FIXME: need symbolic constants for these magic numbers.
+ // See X86ATTInstPrinter.cpp:printSSECC().
+ unsigned x86cc = (cc0 == X86::COND_E) ? 0 : 4;
+ SDValue OnesOrZeroesF = DAG.getNode(NTOperator, DL, MVT::f32, CMP00, CMP01,
+ DAG.getConstant(x86cc, MVT::i8));
+ SDValue OnesOrZeroesI = DAG.getNode(ISD::BITCAST, DL, MVT::i32,
+ OnesOrZeroesF);
+ SDValue ANDed = DAG.getNode(ISD::AND, DL, MVT::i32, OnesOrZeroesI,
+ DAG.getConstant(1, MVT::i32));
+ SDValue OneBitOfTruth = DAG.getNode(ISD::TRUNCATE, DL, MVT::i8, ANDed);
+ return OneBitOfTruth;
+ }
+ }
+ }
+ }
+ return SDValue();
+}
+
static SDValue PerformAndCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI,
const X86Subtarget *Subtarget) {
if (DCI.isBeforeLegalizeOps())
return SDValue();
+ SDValue R = CMPEQCombine(N, DAG, DCI, Subtarget);
+ if (R.getNode())
+ return R;
+
// Want to form PANDN nodes, in the hopes of then easily combining them with
// OR and AND nodes to form PBLEND/PSIGN.
EVT VT = N->getValueType(0);
@@ -11611,6 +11795,10 @@ static SDValue PerformOrCombine(SDNode *N, SelectionDAG &DAG,
if (DCI.isBeforeLegalizeOps())
return SDValue();
+ SDValue R = CMPEQCombine(N, DAG, DCI, Subtarget);
+ if (R.getNode())
+ return R;
+
EVT VT = N->getValueType(0);
if (VT != MVT::i16 && VT != MVT::i32 && VT != MVT::i64 && VT != MVT::v2i64)
return SDValue();
@@ -11978,6 +12166,26 @@ static SDValue PerformSETCCCombine(SDNode *N, SelectionDAG &DAG) {
return SDValue();
}
+static SDValue PerformSINT_TO_FPCombine(SDNode *N, SelectionDAG &DAG, const X86TargetLowering *XTLI) {
+ DebugLoc dl = N->getDebugLoc();
+ SDValue Op0 = N->getOperand(0);
+ // Transform (SINT_TO_FP (i64 ...)) into an x87 operation if we have
+ // a 32-bit target where SSE doesn't support i64->FP operations.
+ if (Op0.getOpcode() == ISD::LOAD) {
+ LoadSDNode *Ld = cast<LoadSDNode>(Op0.getNode());
+ EVT VT = Ld->getValueType(0);
+ if (!Ld->isVolatile() && !N->getValueType(0).isVector() &&
+ ISD::isNON_EXTLoad(Op0.getNode()) && Op0.hasOneUse() &&
+ !XTLI->getSubtarget()->is64Bit() &&
+ !DAG.getTargetLoweringInfo().isTypeLegal(VT)) {
+ SDValue FILDChain = XTLI->BuildFILD(SDValue(N, 0), Ld->getValueType(0), Ld->getChain(), Op0, DAG);
+ DAG.ReplaceAllUsesOfValueWith(Op0.getValue(1), FILDChain.getValue(1));
+ return FILDChain;
+ }
+ }
+ return SDValue();
+}
+
// Optimize RES, EFLAGS = X86ISD::ADC LHS, RHS, EFLAGS
static SDValue PerformADCCombine(SDNode *N, SelectionDAG &DAG,
X86TargetLowering::DAGCombinerInfo &DCI) {
@@ -12062,6 +12270,7 @@ SDValue X86TargetLowering::PerformDAGCombine(SDNode *N,
case ISD::AND: return PerformAndCombine(N, DAG, DCI, Subtarget);
case ISD::OR: return PerformOrCombine(N, DAG, DCI, Subtarget);
case ISD::STORE: return PerformSTORECombine(N, DAG, Subtarget);
+ case ISD::SINT_TO_FP: return PerformSINT_TO_FPCombine(N, DAG, this);
case X86ISD::FXOR:
case X86ISD::FOR: return PerformFORCombine(N, DAG);
case X86ISD::FAND: return PerformFANDCombine(N, DAG);
@@ -12491,12 +12700,16 @@ LowerXConstraint(EVT ConstraintVT) const {
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
/// vector. If it is invalid, don't add anything to Ops.
void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
- char Constraint,
+ std::string &Constraint,
std::vector<SDValue>&Ops,
SelectionDAG &DAG) const {
SDValue Result(0, 0);
- switch (Constraint) {
+ // Only support length 1 constraints for now.
+ if (Constraint.length() > 1) return;
+
+ char ConstraintLetter = Constraint[0];
+ switch (ConstraintLetter) {
default: break;
case 'I':
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
@@ -12688,7 +12901,7 @@ X86TargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint,
return std::make_pair(0U, X86::GR8RegisterClass);
if (VT == MVT::i16)
return std::make_pair(0U, X86::GR16RegisterClass);
- if (VT == MVT::i32 || !Subtarget->is64Bit())
+ if (VT == MVT::i32 || VT == MVT::f32 || !Subtarget->is64Bit())
return std::make_pair(0U, X86::GR32RegisterClass);
return std::make_pair(0U, X86::GR64RegisterClass);
case 'R': // LEGACY_REGS
diff --git a/contrib/llvm/lib/Target/X86/X86ISelLowering.h b/contrib/llvm/lib/Target/X86/X86ISelLowering.h
index 6301057..d61a125 100644
--- a/contrib/llvm/lib/Target/X86/X86ISelLowering.h
+++ b/contrib/llvm/lib/Target/X86/X86ISelLowering.h
@@ -94,6 +94,15 @@ namespace llvm {
// one's or all zero's.
SETCC_CARRY, // R = carry_bit ? ~0 : 0
+ /// X86 FP SETCC, implemented with CMP{cc}SS/CMP{cc}SD.
+ /// Operands are two FP values to compare; result is a mask of
+ /// 0s or 1s. Generally DTRT for C/C++ with NaNs.
+ FSETCCss, FSETCCsd,
+
+ /// X86 MOVMSK{pd|ps}, extracts sign bits of two or four FP values,
+ /// result in an integer GPR. Needs masking for scalar result.
+ FGETSIGNx86,
+
/// X86 conditional moves. Operand 0 and operand 1 are the two values
/// to select from. Operand 2 is the condition code, and operand 3 is the
/// flag operand produced by a CMP or TEST instruction. It also writes a
@@ -592,7 +601,7 @@ namespace llvm {
/// true it means one of the asm constraint of the inline asm instruction
/// being processed is 'm'.
virtual void LowerAsmOperandForConstraint(SDValue Op,
- char ConstraintLetter,
+ std::string &Constraint,
std::vector<SDValue> &Ops,
SelectionDAG &DAG) const;
@@ -674,15 +683,15 @@ namespace llvm {
/// or null if the target does not support "fast" ISel.
virtual FastISel *createFastISel(FunctionLoweringInfo &funcInfo) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
/// getStackCookieLocation - Return true if the target stores stack
/// protector cookies at a fixed offset in some non-standard address
/// space, and populates the address space and offset as
/// appropriate.
virtual bool getStackCookieLocation(unsigned &AddressSpace, unsigned &Offset) const;
+ SDValue BuildFILD(SDValue Op, EVT SrcVT, SDValue Chain, SDValue StackSlot,
+ SelectionDAG &DAG) const;
+
protected:
std::pair<const TargetRegisterClass*, uint8_t>
findRepresentativeClass(EVT VT) const;
@@ -773,9 +782,7 @@ namespace llvm {
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerExternalSymbol(SDValue Op, SelectionDAG &DAG) const;
- SDValue LowerShift(SDValue Op, SelectionDAG &DAG) const;
- SDValue BuildFILD(SDValue Op, EVT SrcVT, SDValue Chain, SDValue StackSlot,
- SelectionDAG &DAG) const;
+ SDValue LowerShiftParts(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerBITCAST(SDValue op, SelectionDAG &DAG) const;
SDValue LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
@@ -786,6 +793,7 @@ namespace llvm {
SDValue LowerFABS(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerFNEG(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const;
+ SDValue LowerFGETSIGN(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerToBT(SDValue And, ISD::CondCode CC,
DebugLoc dl, SelectionDAG &DAG) const;
SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
@@ -808,7 +816,7 @@ namespace llvm {
SDValue LowerCTLZ(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerCTTZ(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerMUL_V2I64(SDValue Op, SelectionDAG &DAG) const;
- SDValue LowerSHL(SDValue Op, SelectionDAG &DAG) const;
+ SDValue LowerShift(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerXALUO(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerCMP_SWAP(SDValue Op, SelectionDAG &DAG) const;
@@ -850,9 +858,10 @@ namespace llvm {
ISD::NodeType ExtendKind) const;
virtual bool
- CanLowerReturn(CallingConv::ID CallConv, bool isVarArg,
- const SmallVectorImpl<ISD::OutputArg> &Outs,
- LLVMContext &Context) const;
+ CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
+ bool isVarArg,
+ const SmallVectorImpl<ISD::OutputArg> &Outs,
+ LLVMContext &Context) const;
void ReplaceATOMIC_BINARY_64(SDNode *N, SmallVectorImpl<SDValue> &Results,
SelectionDAG &DAG, unsigned NewOp) const;
diff --git a/contrib/llvm/lib/Target/X86/X86InstrCompiler.td b/contrib/llvm/lib/Target/X86/X86InstrCompiler.td
index 4c915d9..33534cd 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrCompiler.td
+++ b/contrib/llvm/lib/Target/X86/X86InstrCompiler.td
@@ -214,6 +214,30 @@ def : Pat<(i64 (sext (i8 (X86setcc_c X86_COND_B, EFLAGS)))),
def : Pat<(and (i8 (X86setcc_c X86_COND_B, EFLAGS)), 1),
(SETBr)>;
+// (add OP, SETB) -> (adc OP, 0)
+def : Pat<(add (and (i8 (X86setcc_c X86_COND_B, EFLAGS)), 1), GR8:$op),
+ (ADC8ri GR8:$op, 0)>;
+def : Pat<(add (and (i32 (X86setcc_c X86_COND_B, EFLAGS)), 1), GR32:$op),
+ (ADC32ri8 GR32:$op, 0)>;
+def : Pat<(add (and (i64 (X86setcc_c X86_COND_B, EFLAGS)), 1), GR64:$op),
+ (ADC64ri8 GR64:$op, 0)>;
+
+// (sub OP, SETB) -> (sbb OP, 0)
+def : Pat<(sub GR8:$op, (and (i8 (X86setcc_c X86_COND_B, EFLAGS)), 1)),
+ (SBB8ri GR8:$op, 0)>;
+def : Pat<(sub GR32:$op, (and (i32 (X86setcc_c X86_COND_B, EFLAGS)), 1)),
+ (SBB32ri8 GR32:$op, 0)>;
+def : Pat<(sub GR64:$op, (and (i64 (X86setcc_c X86_COND_B, EFLAGS)), 1)),
+ (SBB64ri8 GR64:$op, 0)>;
+
+// (sub OP, SETCC_CARRY) -> (adc OP, 0)
+def : Pat<(sub GR8:$op, (i8 (X86setcc_c X86_COND_B, EFLAGS))),
+ (ADC8ri GR8:$op, 0)>;
+def : Pat<(sub GR32:$op, (i32 (X86setcc_c X86_COND_B, EFLAGS))),
+ (ADC32ri8 GR32:$op, 0)>;
+def : Pat<(sub GR64:$op, (i64 (X86setcc_c X86_COND_B, EFLAGS))),
+ (ADC64ri8 GR64:$op, 0)>;
+
//===----------------------------------------------------------------------===//
// String Pseudo Instructions
//
@@ -519,85 +543,98 @@ def Int_MemBarrierNoSSE64 : RI<0x09, MRM1r, (outs), (ins GR64:$zero),
Requires<[In64BitMode]>, LOCK;
-// Optimized codegen when the non-memory output is not used.
+// RegOpc corresponds to the mr version of the instruction
+// ImmOpc corresponds to the mi version of the instruction
+// ImmOpc8 corresponds to the mi8 version of the instruction
+// ImmMod corresponds to the instruction format of the mi and mi8 versions
+multiclass LOCK_ArithBinOp<bits<8> RegOpc, bits<8> ImmOpc, bits<8> ImmOpc8,
+ Format ImmMod, string mnemonic> {
let Defs = [EFLAGS], mayLoad = 1, mayStore = 1, isCodeGenOnly = 1 in {
-def LOCK_ADD8mr : I<0x00, MRMDestMem, (outs), (ins i8mem:$dst, GR8:$src2),
- "lock\n\t"
- "add{b}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_ADD16mr : I<0x01, MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src2),
- "lock\n\t"
- "add{w}\t{$src2, $dst|$dst, $src2}", []>, OpSize, LOCK;
-def LOCK_ADD32mr : I<0x01, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
- "lock\n\t"
- "add{l}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_ADD64mr : RI<0x01, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
- "lock\n\t"
- "add{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_ADD8mi : Ii8<0x80, MRM0m, (outs), (ins i8mem :$dst, i8imm :$src2),
- "lock\n\t"
- "add{b}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_ADD16mi : Ii16<0x81, MRM0m, (outs), (ins i16mem:$dst, i16imm:$src2),
- "lock\n\t"
- "add{w}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_ADD32mi : Ii32<0x81, MRM0m, (outs), (ins i32mem:$dst, i32imm:$src2),
- "lock\n\t"
- "add{l}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_ADD64mi32 : RIi32<0x81, MRM0m, (outs),
- (ins i64mem:$dst, i64i32imm :$src2),
- "lock\n\t"
- "add{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-
-def LOCK_ADD16mi8 : Ii8<0x83, MRM0m, (outs), (ins i16mem:$dst, i16i8imm :$src2),
- "lock\n\t"
- "add{w}\t{$src2, $dst|$dst, $src2}", []>, OpSize, LOCK;
-def LOCK_ADD32mi8 : Ii8<0x83, MRM0m, (outs), (ins i32mem:$dst, i32i8imm :$src2),
- "lock\n\t"
- "add{l}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_ADD64mi8 : RIi8<0x83, MRM0m, (outs),
- (ins i64mem:$dst, i64i8imm :$src2),
- "lock\n\t"
- "add{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-
-def LOCK_SUB8mr : I<0x28, MRMDestMem, (outs), (ins i8mem :$dst, GR8 :$src2),
- "lock\n\t"
- "sub{b}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_SUB16mr : I<0x29, MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src2),
- "lock\n\t"
- "sub{w}\t{$src2, $dst|$dst, $src2}", []>, OpSize, LOCK;
-def LOCK_SUB32mr : I<0x29, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
- "lock\n\t"
- "sub{l}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_SUB64mr : RI<0x29, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
- "lock\n\t"
- "sub{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
+def #NAME#8mr : I<{RegOpc{7}, RegOpc{6}, RegOpc{5}, RegOpc{4},
+ RegOpc{3}, RegOpc{2}, RegOpc{1}, 0 },
+ MRMDestMem, (outs), (ins i8mem:$dst, GR8:$src2),
+ !strconcat("lock\n\t", mnemonic, "{b}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+def #NAME#16mr : I<{RegOpc{7}, RegOpc{6}, RegOpc{5}, RegOpc{4},
+ RegOpc{3}, RegOpc{2}, RegOpc{1}, 1 },
+ MRMDestMem, (outs), (ins i16mem:$dst, GR16:$src2),
+ !strconcat("lock\n\t", mnemonic, "{w}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, OpSize, LOCK;
+def #NAME#32mr : I<{RegOpc{7}, RegOpc{6}, RegOpc{5}, RegOpc{4},
+ RegOpc{3}, RegOpc{2}, RegOpc{1}, 1 },
+ MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src2),
+ !strconcat("lock\n\t", mnemonic, "{l}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+def #NAME#64mr : RI<{RegOpc{7}, RegOpc{6}, RegOpc{5}, RegOpc{4},
+ RegOpc{3}, RegOpc{2}, RegOpc{1}, 1 },
+ MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src2),
+ !strconcat("lock\n\t", mnemonic, "{q}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+
+def #NAME#8mi : Ii8<{ImmOpc{7}, ImmOpc{6}, ImmOpc{5}, ImmOpc{4},
+ ImmOpc{3}, ImmOpc{2}, ImmOpc{1}, 0 },
+ ImmMod, (outs), (ins i8mem :$dst, i8imm :$src2),
+ !strconcat("lock\n\t", mnemonic, "{b}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+
+def #NAME#16mi : Ii16<{ImmOpc{7}, ImmOpc{6}, ImmOpc{5}, ImmOpc{4},
+ ImmOpc{3}, ImmOpc{2}, ImmOpc{1}, 1 },
+ ImmMod, (outs), (ins i16mem :$dst, i16imm :$src2),
+ !strconcat("lock\n\t", mnemonic, "{w}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+
+def #NAME#32mi : Ii32<{ImmOpc{7}, ImmOpc{6}, ImmOpc{5}, ImmOpc{4},
+ ImmOpc{3}, ImmOpc{2}, ImmOpc{1}, 1 },
+ ImmMod, (outs), (ins i32mem :$dst, i32imm :$src2),
+ !strconcat("lock\n\t", mnemonic, "{l}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+
+def #NAME#64mi32 : RIi32<{ImmOpc{7}, ImmOpc{6}, ImmOpc{5}, ImmOpc{4},
+ ImmOpc{3}, ImmOpc{2}, ImmOpc{1}, 1 },
+ ImmMod, (outs), (ins i64mem :$dst, i64i32imm :$src2),
+ !strconcat("lock\n\t", mnemonic, "{q}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+
+def #NAME#16mi8 : Ii8<{ImmOpc8{7}, ImmOpc8{6}, ImmOpc8{5}, ImmOpc8{4},
+ ImmOpc8{3}, ImmOpc8{2}, ImmOpc8{1}, 1 },
+ ImmMod, (outs), (ins i16mem :$dst, i16i8imm :$src2),
+ !strconcat("lock\n\t", mnemonic, "{w}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+def #NAME#32mi8 : Ii8<{ImmOpc8{7}, ImmOpc8{6}, ImmOpc8{5}, ImmOpc8{4},
+ ImmOpc8{3}, ImmOpc8{2}, ImmOpc8{1}, 1 },
+ ImmMod, (outs), (ins i32mem :$dst, i32i8imm :$src2),
+ !strconcat("lock\n\t", mnemonic, "{l}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+def #NAME#64mi8 : RIi8<{ImmOpc8{7}, ImmOpc8{6}, ImmOpc8{5}, ImmOpc8{4},
+ ImmOpc8{3}, ImmOpc8{2}, ImmOpc8{1}, 1 },
+ ImmMod, (outs), (ins i64mem :$dst, i64i8imm :$src2),
+ !strconcat("lock\n\t", mnemonic, "{q}\t",
+ "{$src2, $dst|$dst, $src2}"),
+ []>, LOCK;
+}
-def LOCK_SUB8mi : Ii8<0x80, MRM5m, (outs), (ins i8mem :$dst, i8imm:$src2),
- "lock\n\t"
- "sub{b}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_SUB16mi : Ii16<0x81, MRM5m, (outs), (ins i16mem:$dst, i16imm:$src2),
- "lock\n\t"
- "sub{w}\t{$src2, $dst|$dst, $src2}", []>, OpSize, LOCK;
-def LOCK_SUB32mi : Ii32<0x81, MRM5m, (outs), (ins i32mem:$dst, i32imm:$src2),
- "lock\n\t"
- "sub{l}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_SUB64mi32 : RIi32<0x81, MRM5m, (outs),
- (ins i64mem:$dst, i64i32imm:$src2),
- "lock\n\t"
- "sub{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
+}
+defm LOCK_ADD : LOCK_ArithBinOp<0x00, 0x80, 0x83, MRM0m, "add">;
+defm LOCK_SUB : LOCK_ArithBinOp<0x28, 0x80, 0x83, MRM5m, "sub">;
+defm LOCK_OR : LOCK_ArithBinOp<0x08, 0x80, 0x83, MRM1m, "or">;
+defm LOCK_AND : LOCK_ArithBinOp<0x08, 0x80, 0x83, MRM4m, "and">;
+defm LOCK_XOR : LOCK_ArithBinOp<0x08, 0x80, 0x83, MRM6m, "xor">;
-def LOCK_SUB16mi8 : Ii8<0x83, MRM5m, (outs), (ins i16mem:$dst, i16i8imm :$src2),
- "lock\n\t"
- "sub{w}\t{$src2, $dst|$dst, $src2}", []>, OpSize, LOCK;
-def LOCK_SUB32mi8 : Ii8<0x83, MRM5m, (outs), (ins i32mem:$dst, i32i8imm :$src2),
- "lock\n\t"
- "sub{l}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
-def LOCK_SUB64mi8 : RIi8<0x83, MRM5m, (outs),
- (ins i64mem:$dst, i64i8imm :$src2),
- "lock\n\t"
- "sub{q}\t{$src2, $dst|$dst, $src2}", []>, LOCK;
+// Optimized codegen when the non-memory output is not used.
+let Defs = [EFLAGS], mayLoad = 1, mayStore = 1, isCodeGenOnly = 1 in {
def LOCK_INC8m : I<0xFE, MRM0m, (outs), (ins i8mem :$dst),
"lock\n\t"
@@ -960,7 +997,8 @@ def : Pat<(extloadi64i32 addr:$src),
// anyext. Define these to do an explicit zero-extend to
// avoid partial-register updates.
-def : Pat<(i16 (anyext GR8 :$src)), (MOVZX16rr8 GR8 :$src)>;
+def : Pat<(i16 (anyext GR8 :$src)), (EXTRACT_SUBREG
+ (MOVZX32rr8 GR8 :$src), sub_16bit)>;
def : Pat<(i32 (anyext GR8 :$src)), (MOVZX32rr8 GR8 :$src)>;
// Except for i16 -> i32 since isel expect i16 ops to be promoted to i32.
@@ -1127,9 +1165,9 @@ def : Pat<(and GR32:$src1, 0xff),
Requires<[In32BitMode]>;
// r & (2^8-1) ==> movz
def : Pat<(and GR16:$src1, 0xff),
- (MOVZX16rr8 (EXTRACT_SUBREG (i16 (COPY_TO_REGCLASS GR16:$src1,
- GR16_ABCD)),
- sub_8bit))>,
+ (EXTRACT_SUBREG (MOVZX32rr8 (EXTRACT_SUBREG
+ (i16 (COPY_TO_REGCLASS GR16:$src1, GR16_ABCD)), sub_8bit)),
+ sub_16bit)>,
Requires<[In32BitMode]>;
// r & (2^32-1) ==> movz
@@ -1147,7 +1185,8 @@ def : Pat<(and GR32:$src1, 0xff),
Requires<[In64BitMode]>;
// r & (2^8-1) ==> movz
def : Pat<(and GR16:$src1, 0xff),
- (MOVZX16rr8 (i8 (EXTRACT_SUBREG GR16:$src1, sub_8bit)))>,
+ (EXTRACT_SUBREG (MOVZX32rr8 (i8
+ (EXTRACT_SUBREG GR16:$src1, sub_8bit))), sub_16bit)>,
Requires<[In64BitMode]>;
@@ -1159,10 +1198,11 @@ def : Pat<(sext_inreg GR32:$src, i8),
GR32_ABCD)),
sub_8bit))>,
Requires<[In32BitMode]>;
+
def : Pat<(sext_inreg GR16:$src, i8),
- (MOVSX16rr8 (EXTRACT_SUBREG (i16 (COPY_TO_REGCLASS GR16:$src,
- GR16_ABCD)),
- sub_8bit))>,
+ (EXTRACT_SUBREG (i32 (MOVSX32rr8 (EXTRACT_SUBREG
+ (i32 (COPY_TO_REGCLASS GR16:$src, GR16_ABCD)), sub_8bit))),
+ sub_16bit)>,
Requires<[In32BitMode]>;
def : Pat<(sext_inreg GR64:$src, i32),
@@ -1175,9 +1215,19 @@ def : Pat<(sext_inreg GR32:$src, i8),
(MOVSX32rr8 (EXTRACT_SUBREG GR32:$src, sub_8bit))>,
Requires<[In64BitMode]>;
def : Pat<(sext_inreg GR16:$src, i8),
- (MOVSX16rr8 (i8 (EXTRACT_SUBREG GR16:$src, sub_8bit)))>,
+ (EXTRACT_SUBREG (MOVSX32rr8
+ (EXTRACT_SUBREG GR16:$src, sub_8bit)), sub_16bit)>,
Requires<[In64BitMode]>;
+// sext, sext_load, zext, zext_load
+def: Pat<(i16 (sext GR8:$src)),
+ (EXTRACT_SUBREG (MOVSX32rr8 GR8:$src), sub_16bit)>;
+def: Pat<(sextloadi16i8 addr:$src),
+ (EXTRACT_SUBREG (MOVSX32rm8 addr:$src), sub_16bit)>;
+def: Pat<(i16 (zext GR8:$src)),
+ (EXTRACT_SUBREG (MOVZX32rr8 GR8:$src), sub_16bit)>;
+def: Pat<(zextloadi16i8 addr:$src),
+ (EXTRACT_SUBREG (MOVZX32rm8 addr:$src), sub_16bit)>;
// trunc patterns
def : Pat<(i16 (trunc GR32:$src)),
@@ -1474,12 +1524,6 @@ def : Pat<(mul (loadi16 addr:$src1), i16immSExt8:$src2),
def : Pat<(mul (loadi32 addr:$src1), i32immSExt8:$src2),
(IMUL32rmi8 addr:$src1, i32immSExt8:$src2)>;
-// Optimize multiply by 2 with EFLAGS result.
-let AddedComplexity = 2 in {
-def : Pat<(X86smul_flag GR16:$src1, 2), (ADD16rr GR16:$src1, GR16:$src1)>;
-def : Pat<(X86smul_flag GR32:$src1, 2), (ADD32rr GR32:$src1, GR32:$src1)>;
-}
-
// Patterns for nodes that do not produce flags, for instructions that do.
// addition
diff --git a/contrib/llvm/lib/Target/X86/X86InstrExtension.td b/contrib/llvm/lib/Target/X86/X86InstrExtension.td
index 867c0f8..2e1d523 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrExtension.td
+++ b/contrib/llvm/lib/Target/X86/X86InstrExtension.td
@@ -38,22 +38,11 @@ let neverHasSideEffects = 1 in {
// Sign/Zero extenders
-// Use movsbl intead of movsbw; we don't care about the high 16 bits
-// of the register here. This has a smaller encoding and avoids a
-// partial-register update. Actual movsbw included for the disassembler.
-def MOVSX16rr8W : I<0xBE, MRMSrcReg, (outs GR16:$dst), (ins GR8:$src),
- "movs{bw|x}\t{$src, $dst|$dst, $src}", []>, TB, OpSize;
-def MOVSX16rm8W : I<0xBE, MRMSrcMem, (outs GR16:$dst), (ins i8mem:$src),
- "movs{bw|x}\t{$src, $dst|$dst, $src}", []>, TB, OpSize;
-
-// FIXME: Use a pat pattern or define a syntax here.
-let isCodeGenOnly=1 in {
-def MOVSX16rr8 : I<0xBE, MRMSrcReg, (outs GR16:$dst), (ins GR8 :$src),
- "", [(set GR16:$dst, (sext GR8:$src))]>, TB;
-def MOVSX16rm8 : I<0xBE, MRMSrcMem, (outs GR16:$dst), (ins i8mem :$src),
- "", [(set GR16:$dst, (sextloadi16i8 addr:$src))]>, TB;
-}
-def MOVSX32rr8 : I<0xBE, MRMSrcReg, (outs GR32:$dst), (ins GR8 :$src),
+def MOVSX16rr8 : I<0xBE, MRMSrcReg, (outs GR16:$dst), (ins GR8:$src),
+ "movs{bw|x}\t{$src, $dst|$dst, $src}", []>, TB, OpSize;
+def MOVSX16rm8 : I<0xBE, MRMSrcMem, (outs GR16:$dst), (ins i8mem:$src),
+ "movs{bw|x}\t{$src, $dst|$dst, $src}", []>, TB, OpSize;
+def MOVSX32rr8 : I<0xBE, MRMSrcReg, (outs GR32:$dst), (ins GR8:$src),
"movs{bl|x}\t{$src, $dst|$dst, $src}",
[(set GR32:$dst, (sext GR8:$src))]>, TB;
def MOVSX32rm8 : I<0xBE, MRMSrcMem, (outs GR32:$dst), (ins i8mem :$src),
@@ -66,20 +55,10 @@ def MOVSX32rm16: I<0xBF, MRMSrcMem, (outs GR32:$dst), (ins i16mem:$src),
"movs{wl|x}\t{$src, $dst|$dst, $src}",
[(set GR32:$dst, (sextloadi32i16 addr:$src))]>, TB;
-// Use movzbl intead of movzbw; we don't care about the high 16 bits
-// of the register here. This has a smaller encoding and avoids a
-// partial-register update. Actual movzbw included for the disassembler.
-def MOVZX16rr8W : I<0xB6, MRMSrcReg, (outs GR16:$dst), (ins GR8:$src),
- "movz{bw|x}\t{$src, $dst|$dst, $src}", []>, TB, OpSize;
-def MOVZX16rm8W : I<0xB6, MRMSrcMem, (outs GR16:$dst), (ins i8mem:$src),
- "movz{bw|x}\t{$src, $dst|$dst, $src}", []>, TB, OpSize;
-// FIXME: Use a pat pattern or define a syntax here.
-let isCodeGenOnly=1 in {
-def MOVZX16rr8 : I<0xB6, MRMSrcReg, (outs GR16:$dst), (ins GR8 :$src),
- "", [(set GR16:$dst, (zext GR8:$src))]>, TB;
-def MOVZX16rm8 : I<0xB6, MRMSrcMem, (outs GR16:$dst), (ins i8mem :$src),
- "", [(set GR16:$dst, (zextloadi16i8 addr:$src))]>, TB;
-}
+def MOVZX16rr8 : I<0xB6, MRMSrcReg, (outs GR16:$dst), (ins GR8:$src),
+ "movz{bw|x}\t{$src, $dst|$dst, $src}", []>, TB, OpSize;
+def MOVZX16rm8 : I<0xB6, MRMSrcMem, (outs GR16:$dst), (ins i8mem:$src),
+ "movz{bw|x}\t{$src, $dst|$dst, $src}", []>, TB, OpSize;
def MOVZX32rr8 : I<0xB6, MRMSrcReg, (outs GR32:$dst), (ins GR8 :$src),
"movz{bl|x}\t{$src, $dst|$dst, $src}",
[(set GR32:$dst, (zext GR8:$src))]>, TB;
diff --git a/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td b/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td
index 3cbfac1..7c9a9f7 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td
+++ b/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td
@@ -38,8 +38,11 @@ def X86fxor : SDNode<"X86ISD::FXOR", SDTFPBinOp,
def X86frsqrt : SDNode<"X86ISD::FRSQRT", SDTFPUnaryOp>;
def X86frcp : SDNode<"X86ISD::FRCP", SDTFPUnaryOp>;
def X86fsrl : SDNode<"X86ISD::FSRL", SDTX86FPShiftOp>;
+def X86fgetsign: SDNode<"X86ISD::FGETSIGNx86",SDTFPToIntOp>;
def X86comi : SDNode<"X86ISD::COMI", SDTX86CmpTest>;
def X86ucomi : SDNode<"X86ISD::UCOMI", SDTX86CmpTest>;
+def X86cmpss : SDNode<"X86ISD::FSETCCss", SDTX86Cmpss>;
+def X86cmpsd : SDNode<"X86ISD::FSETCCsd", SDTX86Cmpsd>;
def X86pshufb : SDNode<"X86ISD::PSHUFB",
SDTypeProfile<1, 2, [SDTCisVT<0, v16i8>, SDTCisSameAs<0,1>,
SDTCisSameAs<0,2>]>>;
diff --git a/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp b/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp
index 83f0260..e2016eb 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -2015,62 +2015,48 @@ static unsigned getLoadStoreRegOpcode(unsigned Reg,
bool isStackAligned,
const TargetMachine &TM,
bool load) {
- switch (RC->getID()) {
+ switch (RC->getSize()) {
default:
- llvm_unreachable("Unknown regclass");
- case X86::GR64RegClassID:
- case X86::GR64_ABCDRegClassID:
- case X86::GR64_NOREXRegClassID:
- case X86::GR64_NOREX_NOSPRegClassID:
- case X86::GR64_NOSPRegClassID:
- case X86::GR64_TCRegClassID:
- case X86::GR64_TCW64RegClassID:
- return load ? X86::MOV64rm : X86::MOV64mr;
- case X86::GR32RegClassID:
- case X86::GR32_ABCDRegClassID:
- case X86::GR32_ADRegClassID:
- case X86::GR32_NOREXRegClassID:
- case X86::GR32_NOSPRegClassID:
- case X86::GR32_TCRegClassID:
- return load ? X86::MOV32rm : X86::MOV32mr;
- case X86::GR16RegClassID:
- case X86::GR16_ABCDRegClassID:
- case X86::GR16_NOREXRegClassID:
- return load ? X86::MOV16rm : X86::MOV16mr;
- case X86::GR8RegClassID:
- // Copying to or from a physical H register on x86-64 requires a NOREX
- // move. Otherwise use a normal move.
- if (isHReg(Reg) &&
- TM.getSubtarget<X86Subtarget>().is64Bit())
- return load ? X86::MOV8rm_NOREX : X86::MOV8mr_NOREX;
- else
- return load ? X86::MOV8rm : X86::MOV8mr;
- case X86::GR8_ABCD_LRegClassID:
- case X86::GR8_NOREXRegClassID:
- return load ? X86::MOV8rm :X86::MOV8mr;
- case X86::GR8_ABCD_HRegClassID:
+ llvm_unreachable("Unknown spill size");
+ case 1:
+ assert(X86::GR8RegClass.hasSubClassEq(RC) && "Unknown 1-byte regclass");
if (TM.getSubtarget<X86Subtarget>().is64Bit())
- return load ? X86::MOV8rm_NOREX : X86::MOV8mr_NOREX;
- else
- return load ? X86::MOV8rm : X86::MOV8mr;
- case X86::RFP80RegClassID:
+ // Copying to or from a physical H register on x86-64 requires a NOREX
+ // move. Otherwise use a normal move.
+ if (isHReg(Reg) || X86::GR8_ABCD_HRegClass.hasSubClassEq(RC))
+ return load ? X86::MOV8rm_NOREX : X86::MOV8mr_NOREX;
+ return load ? X86::MOV8rm : X86::MOV8mr;
+ case 2:
+ assert(X86::GR16RegClass.hasSubClassEq(RC) && "Unknown 2-byte regclass");
+ return load ? X86::MOV16rm : X86::MOV16mr;
+ case 4:
+ if (X86::GR32RegClass.hasSubClassEq(RC))
+ return load ? X86::MOV32rm : X86::MOV32mr;
+ if (X86::FR32RegClass.hasSubClassEq(RC))
+ return load ? X86::MOVSSrm : X86::MOVSSmr;
+ if (X86::RFP32RegClass.hasSubClassEq(RC))
+ return load ? X86::LD_Fp32m : X86::ST_Fp32m;
+ llvm_unreachable("Unknown 4-byte regclass");
+ case 8:
+ if (X86::GR64RegClass.hasSubClassEq(RC))
+ return load ? X86::MOV64rm : X86::MOV64mr;
+ if (X86::FR64RegClass.hasSubClassEq(RC))
+ return load ? X86::MOVSDrm : X86::MOVSDmr;
+ if (X86::VR64RegClass.hasSubClassEq(RC))
+ return load ? X86::MMX_MOVQ64rm : X86::MMX_MOVQ64mr;
+ if (X86::RFP64RegClass.hasSubClassEq(RC))
+ return load ? X86::LD_Fp64m : X86::ST_Fp64m;
+ llvm_unreachable("Unknown 8-byte regclass");
+ case 10:
+ assert(X86::RFP80RegClass.hasSubClassEq(RC) && "Unknown 10-byte regclass");
return load ? X86::LD_Fp80m : X86::ST_FpP80m;
- case X86::RFP64RegClassID:
- return load ? X86::LD_Fp64m : X86::ST_Fp64m;
- case X86::RFP32RegClassID:
- return load ? X86::LD_Fp32m : X86::ST_Fp32m;
- case X86::FR32RegClassID:
- return load ? X86::MOVSSrm : X86::MOVSSmr;
- case X86::FR64RegClassID:
- return load ? X86::MOVSDrm : X86::MOVSDmr;
- case X86::VR128RegClassID:
+ case 16:
+ assert(X86::VR128RegClass.hasSubClassEq(RC) && "Unknown 16-byte regclass");
// If stack is realigned we can use aligned stores.
if (isStackAligned)
return load ? X86::MOVAPSrm : X86::MOVAPSmr;
else
return load ? X86::MOVUPSrm : X86::MOVUPSmr;
- case X86::VR64RegClassID:
- return load ? X86::MMX_MOVQ64rm : X86::MMX_MOVQ64mr;
}
}
@@ -2434,7 +2420,7 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
Alignment = 4;
break;
default:
- llvm_unreachable("Don't know how to fold this instruction!");
+ return 0;
}
if (Ops.size() == 2 && Ops[0] == 0 && Ops[1] == 1) {
unsigned NewOpc = 0;
diff --git a/contrib/llvm/lib/Target/X86/X86InstrInfo.h b/contrib/llvm/lib/Target/X86/X86InstrInfo.h
index 8da68b5..d895023 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrInfo.h
+++ b/contrib/llvm/lib/Target/X86/X86InstrInfo.h
@@ -449,7 +449,6 @@ namespace X86II {
SSEDomainShift = SegOvrShift + 2,
OpcodeShift = SSEDomainShift + 2,
- OpcodeMask = 0xFFULL << OpcodeShift,
//===------------------------------------------------------------------===//
/// VEX - The opcode prefix used by AVX instructions
diff --git a/contrib/llvm/lib/Target/X86/X86InstrInfo.td b/contrib/llvm/lib/Target/X86/X86InstrInfo.td
index 03a0b0c..8cab808 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrInfo.td
+++ b/contrib/llvm/lib/Target/X86/X86InstrInfo.td
@@ -23,6 +23,9 @@ def SDTIntShiftDOp: SDTypeProfile<1, 3,
def SDTX86CmpTest : SDTypeProfile<1, 2, [SDTCisVT<0, i32>, SDTCisSameAs<1, 2>]>;
+def SDTX86Cmpsd : SDTypeProfile<1, 3, [SDTCisVT<0, f64>, SDTCisSameAs<1, 2>, SDTCisVT<3, i8>]>;
+def SDTX86Cmpss : SDTypeProfile<1, 3, [SDTCisVT<0, f32>, SDTCisSameAs<1, 2>, SDTCisVT<3, i8>]>;
+
def SDTX86Cmov : SDTypeProfile<1, 4,
[SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>,
SDTCisVT<3, i8>, SDTCisVT<4, i32>]>;
@@ -1485,6 +1488,7 @@ defm : FpUnaryAlias<"fucompi", UCOM_FIPr>;
// solely because gas supports it.
def : InstAlias<"faddp %st(0), $op", (ADD_FPrST0 RST:$op), 0>;
def : InstAlias<"fmulp %st(0), $op", (MUL_FPrST0 RST:$op)>;
+def : InstAlias<"fsubp %st(0), $op", (SUBR_FPrST0 RST:$op)>;
def : InstAlias<"fsubrp %st(0), $op", (SUB_FPrST0 RST:$op)>;
def : InstAlias<"fdivp %st(0), $op", (DIVR_FPrST0 RST:$op)>;
def : InstAlias<"fdivrp %st(0), $op", (DIV_FPrST0 RST:$op)>;
@@ -1546,8 +1550,8 @@ def : InstAlias<"movq $src, $dst",
def : InstAlias<"movsd", (MOVSD)>;
// movsx aliases
-def : InstAlias<"movsx $src, $dst", (MOVSX16rr8W GR16:$dst, GR8:$src), 0>;
-def : InstAlias<"movsx $src, $dst", (MOVSX16rm8W GR16:$dst, i8mem:$src), 0>;
+def : InstAlias<"movsx $src, $dst", (MOVSX16rr8 GR16:$dst, GR8:$src), 0>;
+def : InstAlias<"movsx $src, $dst", (MOVSX16rm8 GR16:$dst, i8mem:$src), 0>;
def : InstAlias<"movsx $src, $dst", (MOVSX32rr8 GR32:$dst, GR8:$src), 0>;
def : InstAlias<"movsx $src, $dst", (MOVSX32rr16 GR32:$dst, GR16:$src), 0>;
def : InstAlias<"movsx $src, $dst", (MOVSX64rr8 GR64:$dst, GR8:$src), 0>;
@@ -1555,8 +1559,8 @@ def : InstAlias<"movsx $src, $dst", (MOVSX64rr16 GR64:$dst, GR16:$src), 0>;
def : InstAlias<"movsx $src, $dst", (MOVSX64rr32 GR64:$dst, GR32:$src), 0>;
// movzx aliases
-def : InstAlias<"movzx $src, $dst", (MOVZX16rr8W GR16:$dst, GR8:$src), 0>;
-def : InstAlias<"movzx $src, $dst", (MOVZX16rm8W GR16:$dst, i8mem:$src), 0>;
+def : InstAlias<"movzx $src, $dst", (MOVZX16rr8 GR16:$dst, GR8:$src), 0>;
+def : InstAlias<"movzx $src, $dst", (MOVZX16rm8 GR16:$dst, i8mem:$src), 0>;
def : InstAlias<"movzx $src, $dst", (MOVZX32rr8 GR32:$dst, GR8:$src), 0>;
def : InstAlias<"movzx $src, $dst", (MOVZX32rr16 GR32:$dst, GR16:$src), 0>;
def : InstAlias<"movzx $src, $dst", (MOVZX64rr8_Q GR64:$dst, GR8:$src), 0>;
diff --git a/contrib/llvm/lib/Target/X86/X86InstrMMX.td b/contrib/llvm/lib/Target/X86/X86InstrMMX.td
index bb2165a..b2d9fca 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrMMX.td
+++ b/contrib/llvm/lib/Target/X86/X86InstrMMX.td
@@ -285,7 +285,7 @@ let Constraints = "$src1 = $dst" in
defm MMX_PAND : MMXI_binop_rm_int<0xDB, "pand", int_x86_mmx_pand, 1>;
defm MMX_POR : MMXI_binop_rm_int<0xEB, "por" , int_x86_mmx_por, 1>;
defm MMX_PXOR : MMXI_binop_rm_int<0xEF, "pxor", int_x86_mmx_pxor, 1>;
-defm MMX_PANDN : MMXI_binop_rm_int<0xDF, "pandn", int_x86_mmx_pandn, 1>;
+defm MMX_PANDN : MMXI_binop_rm_int<0xDF, "pandn", int_x86_mmx_pandn>;
// Shift Instructions
defm MMX_PSRLW : MMXI_binop_rmi_int<0xD1, 0x71, MRM2r, "psrlw",
diff --git a/contrib/llvm/lib/Target/X86/X86InstrSSE.td b/contrib/llvm/lib/Target/X86/X86InstrSSE.td
index cde3f6b..b64c03a 100644
--- a/contrib/llvm/lib/Target/X86/X86InstrSSE.td
+++ b/contrib/llvm/lib/Target/X86/X86InstrSSE.td
@@ -1056,13 +1056,37 @@ let neverHasSideEffects = 1 in {
XD, VEX_4V;
}
+let Constraints = "$src1 = $dst" in {
+def CMPSSrr : SIi8<0xC2, MRMSrcReg,
+ (outs FR32:$dst), (ins FR32:$src1, FR32:$src2, SSECC:$cc),
+ "cmp${cc}ss\t{$src2, $dst|$dst, $src2}",
+ [(set FR32:$dst, (X86cmpss (f32 FR32:$src1), FR32:$src2, imm:$cc))]>, XS;
+def CMPSSrm : SIi8<0xC2, MRMSrcMem,
+ (outs FR32:$dst), (ins FR32:$src1, f32mem:$src2, SSECC:$cc),
+ "cmp${cc}ss\t{$src2, $dst|$dst, $src2}",
+ [(set FR32:$dst, (X86cmpss (f32 FR32:$src1), (loadf32 addr:$src2), imm:$cc))]>, XS;
+def CMPSDrr : SIi8<0xC2, MRMSrcReg,
+ (outs FR64:$dst), (ins FR64:$src1, FR64:$src2, SSECC:$cc),
+ "cmp${cc}sd\t{$src2, $dst|$dst, $src2}",
+ [(set FR64:$dst, (X86cmpsd (f64 FR64:$src1), FR64:$src2, imm:$cc))]>, XD;
+def CMPSDrm : SIi8<0xC2, MRMSrcMem,
+ (outs FR64:$dst), (ins FR64:$src1, f64mem:$src2, SSECC:$cc),
+ "cmp${cc}sd\t{$src2, $dst|$dst, $src2}",
+ [(set FR64:$dst, (X86cmpsd (f64 FR64:$src1), (loadf64 addr:$src2), imm:$cc))]>, XD;
+}
let Constraints = "$src1 = $dst", neverHasSideEffects = 1 in {
- defm CMPSS : sse12_cmp_scalar<FR32, f32mem,
- "cmp${cc}ss\t{$src, $dst|$dst, $src}",
- "cmpss\t{$src2, $src, $dst|$dst, $src, $src2}">, XS;
- defm CMPSD : sse12_cmp_scalar<FR64, f64mem,
- "cmp${cc}sd\t{$src, $dst|$dst, $src}",
- "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}">, XD;
+def CMPSSrr_alt : SIi8<0xC2, MRMSrcReg,
+ (outs FR32:$dst), (ins FR32:$src1, FR32:$src, i8imm:$src2),
+ "cmpss\t{$src2, $src, $dst|$dst, $src, $src2}", []>, XS;
+def CMPSSrm_alt : SIi8<0xC2, MRMSrcMem,
+ (outs FR32:$dst), (ins FR32:$src1, f32mem:$src, i8imm:$src2),
+ "cmpss\t{$src2, $src, $dst|$dst, $src, $src2}", []>, XS;
+def CMPSDrr_alt : SIi8<0xC2, MRMSrcReg,
+ (outs FR64:$dst), (ins FR64:$src1, FR64:$src, i8imm:$src2),
+ "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}", []>, XD;
+def CMPSDrm_alt : SIi8<0xC2, MRMSrcMem,
+ (outs FR64:$dst), (ins FR64:$src1, f64mem:$src, i8imm:$src2),
+ "cmpsd\t{$src2, $src, $dst|$dst, $src, $src2}", []>, XD;
}
multiclass sse12_cmp_scalar_int<RegisterClass RC, X86MemOperand x86memop,
@@ -1327,11 +1351,6 @@ multiclass sse12_extr_sign_mask<RegisterClass RC, Intrinsic Int, string asm,
}
// Mask creation
-defm MOVMSKPS : sse12_extr_sign_mask<VR128, int_x86_sse_movmsk_ps, "movmskps",
- SSEPackedSingle>, TB;
-defm MOVMSKPD : sse12_extr_sign_mask<VR128, int_x86_sse2_movmsk_pd, "movmskpd",
- SSEPackedDouble>, TB, OpSize;
-
defm VMOVMSKPS : sse12_extr_sign_mask<VR128, int_x86_sse_movmsk_ps,
"movmskps", SSEPackedSingle>, VEX;
defm VMOVMSKPD : sse12_extr_sign_mask<VR128, int_x86_sse2_movmsk_pd,
@@ -1342,6 +1361,24 @@ defm VMOVMSKPSY : sse12_extr_sign_mask<VR256, int_x86_avx_movmsk_ps_256,
defm VMOVMSKPDY : sse12_extr_sign_mask<VR256, int_x86_avx_movmsk_pd_256,
"movmskpd", SSEPackedDouble>, OpSize,
VEX;
+defm MOVMSKPS : sse12_extr_sign_mask<VR128, int_x86_sse_movmsk_ps, "movmskps",
+ SSEPackedSingle>, TB;
+defm MOVMSKPD : sse12_extr_sign_mask<VR128, int_x86_sse2_movmsk_pd, "movmskpd",
+ SSEPackedDouble>, TB, OpSize;
+
+// X86fgetsign
+def MOVMSKPDrr32_alt : PI<0x50, MRMSrcReg, (outs GR32:$dst), (ins FR64:$src),
+ "movmskpd\t{$src, $dst|$dst, $src}",
+ [(set GR32:$dst, (X86fgetsign FR64:$src))], SSEPackedDouble>, TB, OpSize;
+def MOVMSKPDrr64_alt : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins FR64:$src),
+ "movmskpd\t{$src, $dst|$dst, $src}",
+ [(set GR64:$dst, (X86fgetsign FR64:$src))], SSEPackedDouble>, TB, OpSize;
+def MOVMSKPSrr32_alt : PI<0x50, MRMSrcReg, (outs GR32:$dst), (ins FR32:$src),
+ "movmskps\t{$src, $dst|$dst, $src}",
+ [(set GR32:$dst, (X86fgetsign FR32:$src))], SSEPackedSingle>, TB;
+def MOVMSKPSrr64_alt : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins FR32:$src),
+ "movmskps\t{$src, $dst|$dst, $src}",
+ [(set GR64:$dst, (X86fgetsign FR32:$src))], SSEPackedSingle>, TB;
// Assembler Only
def VMOVMSKPSr64r : PI<0x50, MRMSrcReg, (outs GR64:$dst), (ins VR128:$src),
@@ -1875,21 +1912,6 @@ defm RCP : sse1_fp_unop_s<0x53, "rcp", X86frcp, int_x86_sse_rcp_ss>,
// SSE 1 & 2 - Non-temporal stores
//===----------------------------------------------------------------------===//
-def VMOVNTPSmr_Int : VPSI<0x2B, MRMDestMem, (outs),
- (ins i128mem:$dst, VR128:$src),
- "movntps\t{$src, $dst|$dst, $src}",
- [(int_x86_sse_movnt_ps addr:$dst, VR128:$src)]>, VEX;
-def VMOVNTPDmr_Int : VPDI<0x2B, MRMDestMem, (outs),
- (ins i128mem:$dst, VR128:$src),
- "movntpd\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_movnt_pd addr:$dst, VR128:$src)]>, VEX;
-
-let ExeDomain = SSEPackedInt in
- def VMOVNTDQmr_Int : VPDI<0xE7, MRMDestMem, (outs),
- (ins f128mem:$dst, VR128:$src),
- "movntdq\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_movnt_dq addr:$dst, VR128:$src)]>, VEX;
-
let AddedComplexity = 400 in { // Prefer non-temporal versions
def VMOVNTPSmr : VPSI<0x2B, MRMDestMem, (outs),
(ins f128mem:$dst, VR128:$src),
@@ -1906,12 +1928,16 @@ let AddedComplexity = 400 in { // Prefer non-temporal versions
"movntdq\t{$src, $dst|$dst, $src}",
[(alignednontemporalstore (v2f64 VR128:$src),
addr:$dst)]>, VEX;
+
let ExeDomain = SSEPackedInt in
- def VMOVNTDQmr : VPDI<0xE7, MRMDestMem, (outs),
- (ins f128mem:$dst, VR128:$src),
- "movntdq\t{$src, $dst|$dst, $src}",
- [(alignednontemporalstore (v4f32 VR128:$src),
- addr:$dst)]>, VEX;
+ def VMOVNTDQmr : VPDI<0xE7, MRMDestMem, (outs),
+ (ins f128mem:$dst, VR128:$src),
+ "movntdq\t{$src, $dst|$dst, $src}",
+ [(alignednontemporalstore (v4f32 VR128:$src),
+ addr:$dst)]>, VEX;
+
+ def : Pat<(alignednontemporalstore (v2i64 VR128:$src), addr:$dst),
+ (VMOVNTDQmr addr:$dst, VR128:$src)>, Requires<[HasAVX]>;
def VMOVNTPSYmr : VPSI<0x2B, MRMDestMem, (outs),
(ins f256mem:$dst, VR256:$src),
@@ -1943,18 +1969,6 @@ def : Pat<(int_x86_avx_movnt_pd_256 addr:$dst, VR256:$src),
def : Pat<(int_x86_avx_movnt_ps_256 addr:$dst, VR256:$src),
(VMOVNTPSYmr addr:$dst, VR256:$src)>;
-def MOVNTPSmr_Int : PSI<0x2B, MRMDestMem, (outs), (ins i128mem:$dst, VR128:$src),
- "movntps\t{$src, $dst|$dst, $src}",
- [(int_x86_sse_movnt_ps addr:$dst, VR128:$src)]>;
-def MOVNTPDmr_Int : PDI<0x2B, MRMDestMem, (outs), (ins i128mem:$dst, VR128:$src),
- "movntpd\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_movnt_pd addr:$dst, VR128:$src)]>;
-
-let ExeDomain = SSEPackedInt in
-def MOVNTDQmr_Int : PDI<0xE7, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
- "movntdq\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_movnt_dq addr:$dst, VR128:$src)]>;
-
let AddedComplexity = 400 in { // Prefer non-temporal versions
def MOVNTPSmr : PSI<0x2B, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
"movntps\t{$src, $dst|$dst, $src}",
@@ -1972,22 +1986,19 @@ def MOVNTDQmr : PDI<0xE7, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
"movntdq\t{$src, $dst|$dst, $src}",
[(alignednontemporalstore (v4f32 VR128:$src), addr:$dst)]>;
+def : Pat<(alignednontemporalstore (v2i64 VR128:$src), addr:$dst),
+ (MOVNTDQmr addr:$dst, VR128:$src)>;
+
// There is no AVX form for instructions below this point
def MOVNTImr : I<0xC3, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src),
"movnti\t{$src, $dst|$dst, $src}",
[(nontemporalstore (i32 GR32:$src), addr:$dst)]>,
TB, Requires<[HasSSE2]>;
-
def MOVNTI_64mr : RI<0xC3, MRMDestMem, (outs), (ins i64mem:$dst, GR64:$src),
"movnti\t{$src, $dst|$dst, $src}",
[(nontemporalstore (i64 GR64:$src), addr:$dst)]>,
TB, Requires<[HasSSE2]>;
-
}
-def MOVNTImr_Int : I<0xC3, MRMDestMem, (outs), (ins i32mem:$dst, GR32:$src),
- "movnti\t{$src, $dst|$dst, $src}",
- [(int_x86_sse2_movnt_i addr:$dst, GR32:$src)]>,
- TB, Requires<[HasSSE2]>;
//===----------------------------------------------------------------------===//
// SSE 1 & 2 - Misc Instructions (No AVX form)
@@ -4733,14 +4744,14 @@ let Uses = [XMM0], Constraints = "$src1 = $dst" in {
def rr0 : SS48I<opc, MRMSrcReg, (outs VR128:$dst),
(ins VR128:$src1, VR128:$src2),
!strconcat(OpcodeStr,
- "\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}"),
+ "\t{$src2, $dst|$dst, $src2}"),
[(set VR128:$dst, (IntId VR128:$src1, VR128:$src2, XMM0))]>,
OpSize;
def rm0 : SS48I<opc, MRMSrcMem, (outs VR128:$dst),
(ins VR128:$src1, i128mem:$src2),
!strconcat(OpcodeStr,
- "\t{%xmm0, $src2, $dst|$dst, $src2, %xmm0}"),
+ "\t{$src2, $dst|$dst, $src2}"),
[(set VR128:$dst,
(IntId VR128:$src1,
(bitconvert (memopv16i8 addr:$src2)), XMM0))]>, OpSize;
@@ -4961,66 +4972,66 @@ defm PCMPESTRIZ : SS42AI_pcmpestri<int_x86_sse42_pcmpestriz128>;
// This set of instructions are only rm, the only difference is the size
// of r and m.
let Constraints = "$src1 = $dst" in {
- def CRC32m8 : SS42FI<0xF0, MRMSrcMem, (outs GR32:$dst),
+ def CRC32r32m8 : SS42FI<0xF0, MRMSrcMem, (outs GR32:$dst),
(ins GR32:$src1, i8mem:$src2),
"crc32{b} \t{$src2, $src1|$src1, $src2}",
[(set GR32:$dst,
- (int_x86_sse42_crc32_8 GR32:$src1,
+ (int_x86_sse42_crc32_32_8 GR32:$src1,
(load addr:$src2)))]>;
- def CRC32r8 : SS42FI<0xF0, MRMSrcReg, (outs GR32:$dst),
+ def CRC32r32r8 : SS42FI<0xF0, MRMSrcReg, (outs GR32:$dst),
(ins GR32:$src1, GR8:$src2),
"crc32{b} \t{$src2, $src1|$src1, $src2}",
[(set GR32:$dst,
- (int_x86_sse42_crc32_8 GR32:$src1, GR8:$src2))]>;
- def CRC32m16 : SS42FI<0xF1, MRMSrcMem, (outs GR32:$dst),
+ (int_x86_sse42_crc32_32_8 GR32:$src1, GR8:$src2))]>;
+ def CRC32r32m16 : SS42FI<0xF1, MRMSrcMem, (outs GR32:$dst),
(ins GR32:$src1, i16mem:$src2),
"crc32{w} \t{$src2, $src1|$src1, $src2}",
[(set GR32:$dst,
- (int_x86_sse42_crc32_16 GR32:$src1,
+ (int_x86_sse42_crc32_32_16 GR32:$src1,
(load addr:$src2)))]>,
OpSize;
- def CRC32r16 : SS42FI<0xF1, MRMSrcReg, (outs GR32:$dst),
+ def CRC32r32r16 : SS42FI<0xF1, MRMSrcReg, (outs GR32:$dst),
(ins GR32:$src1, GR16:$src2),
"crc32{w} \t{$src2, $src1|$src1, $src2}",
[(set GR32:$dst,
- (int_x86_sse42_crc32_16 GR32:$src1, GR16:$src2))]>,
+ (int_x86_sse42_crc32_32_16 GR32:$src1, GR16:$src2))]>,
OpSize;
- def CRC32m32 : SS42FI<0xF1, MRMSrcMem, (outs GR32:$dst),
+ def CRC32r32m32 : SS42FI<0xF1, MRMSrcMem, (outs GR32:$dst),
(ins GR32:$src1, i32mem:$src2),
"crc32{l} \t{$src2, $src1|$src1, $src2}",
[(set GR32:$dst,
- (int_x86_sse42_crc32_32 GR32:$src1,
+ (int_x86_sse42_crc32_32_32 GR32:$src1,
(load addr:$src2)))]>;
- def CRC32r32 : SS42FI<0xF1, MRMSrcReg, (outs GR32:$dst),
+ def CRC32r32r32 : SS42FI<0xF1, MRMSrcReg, (outs GR32:$dst),
(ins GR32:$src1, GR32:$src2),
"crc32{l} \t{$src2, $src1|$src1, $src2}",
[(set GR32:$dst,
- (int_x86_sse42_crc32_32 GR32:$src1, GR32:$src2))]>;
- def CRC64m8 : SS42FI<0xF0, MRMSrcMem, (outs GR64:$dst),
+ (int_x86_sse42_crc32_32_32 GR32:$src1, GR32:$src2))]>;
+ def CRC32r64m8 : SS42FI<0xF0, MRMSrcMem, (outs GR64:$dst),
(ins GR64:$src1, i8mem:$src2),
"crc32{b} \t{$src2, $src1|$src1, $src2}",
[(set GR64:$dst,
- (int_x86_sse42_crc64_8 GR64:$src1,
+ (int_x86_sse42_crc32_64_8 GR64:$src1,
(load addr:$src2)))]>,
REX_W;
- def CRC64r8 : SS42FI<0xF0, MRMSrcReg, (outs GR64:$dst),
+ def CRC32r64r8 : SS42FI<0xF0, MRMSrcReg, (outs GR64:$dst),
(ins GR64:$src1, GR8:$src2),
"crc32{b} \t{$src2, $src1|$src1, $src2}",
[(set GR64:$dst,
- (int_x86_sse42_crc64_8 GR64:$src1, GR8:$src2))]>,
+ (int_x86_sse42_crc32_64_8 GR64:$src1, GR8:$src2))]>,
REX_W;
- def CRC64m64 : SS42FI<0xF1, MRMSrcMem, (outs GR64:$dst),
+ def CRC32r64m64 : SS42FI<0xF1, MRMSrcMem, (outs GR64:$dst),
(ins GR64:$src1, i64mem:$src2),
"crc32{q} \t{$src2, $src1|$src1, $src2}",
[(set GR64:$dst,
- (int_x86_sse42_crc64_64 GR64:$src1,
+ (int_x86_sse42_crc32_64_64 GR64:$src1,
(load addr:$src2)))]>,
REX_W;
- def CRC64r64 : SS42FI<0xF1, MRMSrcReg, (outs GR64:$dst),
+ def CRC32r64r64 : SS42FI<0xF1, MRMSrcReg, (outs GR64:$dst),
(ins GR64:$src1, GR64:$src2),
"crc32{q} \t{$src2, $src1|$src1, $src2}",
[(set GR64:$dst,
- (int_x86_sse42_crc64_64 GR64:$src1, GR64:$src2))]>,
+ (int_x86_sse42_crc32_64_64 GR64:$src1, GR64:$src2))]>,
REX_W;
}
diff --git a/contrib/llvm/lib/Target/X86/X86MCAsmInfo.cpp b/contrib/llvm/lib/Target/X86/X86MCAsmInfo.cpp
index 83bba52..2e1ec63 100644
--- a/contrib/llvm/lib/Target/X86/X86MCAsmInfo.cpp
+++ b/contrib/llvm/lib/Target/X86/X86MCAsmInfo.cpp
@@ -108,8 +108,6 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
// Exceptions handling
ExceptionsType = ExceptionHandling::DwarfCFI;
- DwarfRequiresFrameSection = false;
-
// OpenBSD has buggy support for .quad in 32-bit mode, just split into two
// .words.
if (T.getOS() == Triple::OpenBSD && T.getArch() == Triple::x86)
diff --git a/contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp b/contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
index f195a67..55aceba 100644
--- a/contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
+++ b/contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
@@ -1015,7 +1015,8 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
} else {
unsigned FixupKind;
// FIXME: Is there a better way to know that we need a signed relocation?
- if (MI.getOpcode() == X86::MOV64ri32 ||
+ if (MI.getOpcode() == X86::ADD64ri32 ||
+ MI.getOpcode() == X86::MOV64ri32 ||
MI.getOpcode() == X86::MOV64mi32 ||
MI.getOpcode() == X86::PUSH64i32)
FixupKind = X86::reloc_signed_4byte;
diff --git a/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp b/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp
index cbe6db2..793156f 100644
--- a/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp
+++ b/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -355,10 +355,6 @@ ReSimplify:
assert(OutMI.getOperand(1+X86::AddrSegmentReg).getReg() == 0 &&
"LEA has segment specified!");
break;
- case X86::MOVZX16rr8: LowerSubReg32_Op0(OutMI, X86::MOVZX32rr8); break;
- case X86::MOVZX16rm8: LowerSubReg32_Op0(OutMI, X86::MOVZX32rm8); break;
- case X86::MOVSX16rr8: LowerSubReg32_Op0(OutMI, X86::MOVSX32rr8); break;
- case X86::MOVSX16rm8: LowerSubReg32_Op0(OutMI, X86::MOVSX32rm8); break;
case X86::MOVZX64rr32: LowerSubReg32_Op0(OutMI, X86::MOV32rr); break;
case X86::MOVZX64rm32: LowerSubReg32_Op0(OutMI, X86::MOV32rm); break;
case X86::MOV64ri64i32: LowerSubReg32_Op0(OutMI, X86::MOV32ri); break;
diff --git a/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp b/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp
index 37fb0fe..1ad6203 100644
--- a/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp
@@ -73,29 +73,61 @@ X86RegisterInfo::X86RegisterInfo(X86TargetMachine &tm,
}
}
-/// getDwarfRegNum - This function maps LLVM register identifiers to the DWARF
-/// specific numbering, used in debug info and exception tables.
-int X86RegisterInfo::getDwarfRegNum(unsigned RegNo, bool isEH) const {
- const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
- unsigned Flavour = DWARFFlavour::X86_64;
-
+static unsigned getFlavour(const X86Subtarget *Subtarget, bool isEH) {
if (!Subtarget->is64Bit()) {
if (Subtarget->isTargetDarwin()) {
if (isEH)
- Flavour = DWARFFlavour::X86_32_DarwinEH;
+ return DWARFFlavour::X86_32_DarwinEH;
else
- Flavour = DWARFFlavour::X86_32_Generic;
+ return DWARFFlavour::X86_32_Generic;
} else if (Subtarget->isTargetCygMing()) {
// Unsupported by now, just quick fallback
- Flavour = DWARFFlavour::X86_32_Generic;
+ return DWARFFlavour::X86_32_Generic;
} else {
- Flavour = DWARFFlavour::X86_32_Generic;
+ return DWARFFlavour::X86_32_Generic;
}
}
+ return DWARFFlavour::X86_64;
+}
+
+/// getDwarfRegNum - This function maps LLVM register identifiers to the DWARF
+/// specific numbering, used in debug info and exception tables.
+int X86RegisterInfo::getDwarfRegNum(unsigned RegNo, bool isEH) const {
+ const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
+ unsigned Flavour = getFlavour(Subtarget, isEH);
return X86GenRegisterInfo::getDwarfRegNumFull(RegNo, Flavour);
}
+/// getLLVMRegNum - This function maps DWARF register numbers to LLVM register.
+int X86RegisterInfo::getLLVMRegNum(unsigned DwarfRegNo, bool isEH) const {
+ const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
+ unsigned Flavour = getFlavour(Subtarget, isEH);
+
+ return X86GenRegisterInfo::getLLVMRegNumFull(DwarfRegNo, Flavour);
+}
+
+int
+X86RegisterInfo::getSEHRegNum(unsigned i) const {
+ int reg = getX86RegNum(i);
+ switch (i) {
+ case X86::R8: case X86::R8D: case X86::R8W: case X86::R8B:
+ case X86::R9: case X86::R9D: case X86::R9W: case X86::R9B:
+ case X86::R10: case X86::R10D: case X86::R10W: case X86::R10B:
+ case X86::R11: case X86::R11D: case X86::R11W: case X86::R11B:
+ case X86::R12: case X86::R12D: case X86::R12W: case X86::R12B:
+ case X86::R13: case X86::R13D: case X86::R13W: case X86::R13B:
+ case X86::R14: case X86::R14D: case X86::R14W: case X86::R14B:
+ case X86::R15: case X86::R15D: case X86::R15W: case X86::R15B:
+ case X86::XMM8: case X86::XMM9: case X86::XMM10: case X86::XMM11:
+ case X86::XMM12: case X86::XMM13: case X86::XMM14: case X86::XMM15:
+ case X86::YMM8: case X86::YMM9: case X86::YMM10: case X86::YMM11:
+ case X86::YMM12: case X86::YMM13: case X86::YMM14: case X86::YMM15:
+ reg += 8;
+ }
+ return reg;
+}
+
/// getX86RegNum - This function maps LLVM register identifiers to their X86
/// specific numbering, which is used in various places encoding instructions.
unsigned X86RegisterInfo::getX86RegNum(unsigned RegNo) {
@@ -229,19 +261,13 @@ X86RegisterInfo::getMatchingSuperRegClass(const TargetRegisterClass *A,
}
break;
case X86::sub_8bit_hi:
- if (B == &X86::GR8_ABCD_HRegClass) {
- if (A == &X86::GR64RegClass || A == &X86::GR64_ABCDRegClass ||
- A == &X86::GR64_NOREXRegClass ||
- A == &X86::GR64_NOSPRegClass ||
- A == &X86::GR64_NOREX_NOSPRegClass)
- return &X86::GR64_ABCDRegClass;
- else if (A == &X86::GR32RegClass || A == &X86::GR32_ABCDRegClass ||
- A == &X86::GR32_NOREXRegClass || A == &X86::GR32_NOSPRegClass)
- return &X86::GR32_ABCDRegClass;
- else if (A == &X86::GR16RegClass || A == &X86::GR16_ABCDRegClass ||
- A == &X86::GR16_NOREXRegClass)
- return &X86::GR16_ABCDRegClass;
- }
+ if (B->hasSubClassEq(&X86::GR8_ABCD_HRegClass))
+ switch (A->getSize()) {
+ case 2: return getCommonSubClass(A, &X86::GR16_ABCDRegClass);
+ case 4: return getCommonSubClass(A, &X86::GR32_ABCDRegClass);
+ case 8: return getCommonSubClass(A, &X86::GR64_ABCDRegClass);
+ default: return 0;
+ }
break;
case X86::sub_16bit:
if (B == &X86::GR16RegClass) {
@@ -285,9 +311,16 @@ X86RegisterInfo::getMatchingSuperRegClass(const TargetRegisterClass *A,
A == &X86::GR64_NOREX_NOSPRegClass)
return &X86::GR64_ABCDRegClass;
} else if (B == &X86::GR32_NOREXRegClass) {
+ if (A == &X86::GR64RegClass || A == &X86::GR64_NOREXRegClass)
+ return &X86::GR64_NOREXRegClass;
+ else if (A == &X86::GR64_NOSPRegClass || A == &X86::GR64_NOREX_NOSPRegClass)
+ return &X86::GR64_NOREX_NOSPRegClass;
+ else if (A == &X86::GR64_ABCDRegClass)
+ return &X86::GR64_ABCDRegClass;
+ } else if (B == &X86::GR32_NOREX_NOSPRegClass) {
if (A == &X86::GR64RegClass || A == &X86::GR64_NOREXRegClass ||
A == &X86::GR64_NOSPRegClass || A == &X86::GR64_NOREX_NOSPRegClass)
- return &X86::GR64_NOREXRegClass;
+ return &X86::GR64_NOREX_NOSPRegClass;
else if (A == &X86::GR64_ABCDRegClass)
return &X86::GR64_ABCDRegClass;
}
@@ -473,6 +506,34 @@ BitVector X86RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
Reserved.set(X86::ST5);
Reserved.set(X86::ST6);
Reserved.set(X86::ST7);
+
+ // Mark the segment registers as reserved.
+ Reserved.set(X86::CS);
+ Reserved.set(X86::SS);
+ Reserved.set(X86::DS);
+ Reserved.set(X86::ES);
+ Reserved.set(X86::FS);
+ Reserved.set(X86::GS);
+
+ // Reserve the registers that only exist in 64-bit mode.
+ if (!Is64Bit) {
+ for (unsigned n = 0; n != 8; ++n) {
+ const unsigned GPR64[] = {
+ X86::R8, X86::R9, X86::R10, X86::R11,
+ X86::R12, X86::R13, X86::R14, X86::R15
+ };
+ for (const unsigned *AI = getOverlaps(GPR64[n]); unsigned Reg = *AI;
+ ++AI)
+ Reserved.set(Reg);
+
+ // XMM8, XMM9, ...
+ assert(X86::XMM15 == X86::XMM8+7);
+ for (const unsigned *AI = getOverlaps(X86::XMM8 + n); unsigned Reg = *AI;
+ ++AI)
+ Reserved.set(Reg);
+ }
+ }
+
return Reserved;
}
diff --git a/contrib/llvm/lib/Target/X86/X86RegisterInfo.h b/contrib/llvm/lib/Target/X86/X86RegisterInfo.h
index 9970c52..dd3d3dc 100644
--- a/contrib/llvm/lib/Target/X86/X86RegisterInfo.h
+++ b/contrib/llvm/lib/Target/X86/X86RegisterInfo.h
@@ -80,6 +80,10 @@ public:
/// getDwarfRegNum - allows modification of X86GenRegisterInfo::getDwarfRegNum
/// (created by TableGen) for target dependencies.
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
+
+ // FIXME: This should be tablegen'd like getDwarfRegNum is
+ int getSEHRegNum(unsigned i) const;
/// Code Generation virtual methods...
///
diff --git a/contrib/llvm/lib/Target/X86/X86RegisterInfo.td b/contrib/llvm/lib/Target/X86/X86RegisterInfo.td
index fd7a247..f1d149c 100644
--- a/contrib/llvm/lib/Target/X86/X86RegisterInfo.td
+++ b/contrib/llvm/lib/Target/X86/X86RegisterInfo.td
@@ -41,82 +41,82 @@ let Namespace = "X86" in {
// 8-bit registers
// Low registers
- def AL : Register<"al">, DwarfRegNum<[0, 0, 0]>;
- def DL : Register<"dl">, DwarfRegNum<[1, 2, 2]>;
- def CL : Register<"cl">, DwarfRegNum<[2, 1, 1]>;
- def BL : Register<"bl">, DwarfRegNum<[3, 3, 3]>;
+ def AL : Register<"al">;
+ def DL : Register<"dl">;
+ def CL : Register<"cl">;
+ def BL : Register<"bl">;
// X86-64 only, requires REX.
let CostPerUse = 1 in {
- def SIL : Register<"sil">, DwarfRegNum<[4, 6, 6]>;
- def DIL : Register<"dil">, DwarfRegNum<[5, 7, 7]>;
- def BPL : Register<"bpl">, DwarfRegNum<[6, 4, 5]>;
- def SPL : Register<"spl">, DwarfRegNum<[7, 5, 4]>;
- def R8B : Register<"r8b">, DwarfRegNum<[8, -2, -2]>;
- def R9B : Register<"r9b">, DwarfRegNum<[9, -2, -2]>;
- def R10B : Register<"r10b">, DwarfRegNum<[10, -2, -2]>;
- def R11B : Register<"r11b">, DwarfRegNum<[11, -2, -2]>;
- def R12B : Register<"r12b">, DwarfRegNum<[12, -2, -2]>;
- def R13B : Register<"r13b">, DwarfRegNum<[13, -2, -2]>;
- def R14B : Register<"r14b">, DwarfRegNum<[14, -2, -2]>;
- def R15B : Register<"r15b">, DwarfRegNum<[15, -2, -2]>;
+ def SIL : Register<"sil">;
+ def DIL : Register<"dil">;
+ def BPL : Register<"bpl">;
+ def SPL : Register<"spl">;
+ def R8B : Register<"r8b">;
+ def R9B : Register<"r9b">;
+ def R10B : Register<"r10b">;
+ def R11B : Register<"r11b">;
+ def R12B : Register<"r12b">;
+ def R13B : Register<"r13b">;
+ def R14B : Register<"r14b">;
+ def R15B : Register<"r15b">;
}
// High registers. On x86-64, these cannot be used in any instruction
// with a REX prefix.
- def AH : Register<"ah">, DwarfRegNum<[0, 0, 0]>;
- def DH : Register<"dh">, DwarfRegNum<[1, 2, 2]>;
- def CH : Register<"ch">, DwarfRegNum<[2, 1, 1]>;
- def BH : Register<"bh">, DwarfRegNum<[3, 3, 3]>;
+ def AH : Register<"ah">;
+ def DH : Register<"dh">;
+ def CH : Register<"ch">;
+ def BH : Register<"bh">;
// 16-bit registers
let SubRegIndices = [sub_8bit, sub_8bit_hi] in {
- def AX : RegisterWithSubRegs<"ax", [AL,AH]>, DwarfRegNum<[0, 0, 0]>;
- def DX : RegisterWithSubRegs<"dx", [DL,DH]>, DwarfRegNum<[1, 2, 2]>;
- def CX : RegisterWithSubRegs<"cx", [CL,CH]>, DwarfRegNum<[2, 1, 1]>;
- def BX : RegisterWithSubRegs<"bx", [BL,BH]>, DwarfRegNum<[3, 3, 3]>;
+ def AX : RegisterWithSubRegs<"ax", [AL,AH]>;
+ def DX : RegisterWithSubRegs<"dx", [DL,DH]>;
+ def CX : RegisterWithSubRegs<"cx", [CL,CH]>;
+ def BX : RegisterWithSubRegs<"bx", [BL,BH]>;
}
let SubRegIndices = [sub_8bit] in {
- def SI : RegisterWithSubRegs<"si", [SIL]>, DwarfRegNum<[4, 6, 6]>;
- def DI : RegisterWithSubRegs<"di", [DIL]>, DwarfRegNum<[5, 7, 7]>;
- def BP : RegisterWithSubRegs<"bp", [BPL]>, DwarfRegNum<[6, 4, 5]>;
- def SP : RegisterWithSubRegs<"sp", [SPL]>, DwarfRegNum<[7, 5, 4]>;
+ def SI : RegisterWithSubRegs<"si", [SIL]>;
+ def DI : RegisterWithSubRegs<"di", [DIL]>;
+ def BP : RegisterWithSubRegs<"bp", [BPL]>;
+ def SP : RegisterWithSubRegs<"sp", [SPL]>;
}
- def IP : Register<"ip">, DwarfRegNum<[16]>;
+ def IP : Register<"ip">;
// X86-64 only, requires REX.
let SubRegIndices = [sub_8bit], CostPerUse = 1 in {
- def R8W : RegisterWithSubRegs<"r8w", [R8B]>, DwarfRegNum<[8, -2, -2]>;
- def R9W : RegisterWithSubRegs<"r9w", [R9B]>, DwarfRegNum<[9, -2, -2]>;
- def R10W : RegisterWithSubRegs<"r10w", [R10B]>, DwarfRegNum<[10, -2, -2]>;
- def R11W : RegisterWithSubRegs<"r11w", [R11B]>, DwarfRegNum<[11, -2, -2]>;
- def R12W : RegisterWithSubRegs<"r12w", [R12B]>, DwarfRegNum<[12, -2, -2]>;
- def R13W : RegisterWithSubRegs<"r13w", [R13B]>, DwarfRegNum<[13, -2, -2]>;
- def R14W : RegisterWithSubRegs<"r14w", [R14B]>, DwarfRegNum<[14, -2, -2]>;
- def R15W : RegisterWithSubRegs<"r15w", [R15B]>, DwarfRegNum<[15, -2, -2]>;
+ def R8W : RegisterWithSubRegs<"r8w", [R8B]>;
+ def R9W : RegisterWithSubRegs<"r9w", [R9B]>;
+ def R10W : RegisterWithSubRegs<"r10w", [R10B]>;
+ def R11W : RegisterWithSubRegs<"r11w", [R11B]>;
+ def R12W : RegisterWithSubRegs<"r12w", [R12B]>;
+ def R13W : RegisterWithSubRegs<"r13w", [R13B]>;
+ def R14W : RegisterWithSubRegs<"r14w", [R14B]>;
+ def R15W : RegisterWithSubRegs<"r15w", [R15B]>;
}
// 32-bit registers
let SubRegIndices = [sub_16bit] in {
- def EAX : RegisterWithSubRegs<"eax", [AX]>, DwarfRegNum<[0, 0, 0]>;
- def EDX : RegisterWithSubRegs<"edx", [DX]>, DwarfRegNum<[1, 2, 2]>;
- def ECX : RegisterWithSubRegs<"ecx", [CX]>, DwarfRegNum<[2, 1, 1]>;
- def EBX : RegisterWithSubRegs<"ebx", [BX]>, DwarfRegNum<[3, 3, 3]>;
- def ESI : RegisterWithSubRegs<"esi", [SI]>, DwarfRegNum<[4, 6, 6]>;
- def EDI : RegisterWithSubRegs<"edi", [DI]>, DwarfRegNum<[5, 7, 7]>;
- def EBP : RegisterWithSubRegs<"ebp", [BP]>, DwarfRegNum<[6, 4, 5]>;
- def ESP : RegisterWithSubRegs<"esp", [SP]>, DwarfRegNum<[7, 5, 4]>;
- def EIP : RegisterWithSubRegs<"eip", [IP]>, DwarfRegNum<[16, 8, 8]>;
+ def EAX : RegisterWithSubRegs<"eax", [AX]>, DwarfRegNum<[-2, 0, 0]>;
+ def EDX : RegisterWithSubRegs<"edx", [DX]>, DwarfRegNum<[-2, 2, 2]>;
+ def ECX : RegisterWithSubRegs<"ecx", [CX]>, DwarfRegNum<[-2, 1, 1]>;
+ def EBX : RegisterWithSubRegs<"ebx", [BX]>, DwarfRegNum<[-2, 3, 3]>;
+ def ESI : RegisterWithSubRegs<"esi", [SI]>, DwarfRegNum<[-2, 6, 6]>;
+ def EDI : RegisterWithSubRegs<"edi", [DI]>, DwarfRegNum<[-2, 7, 7]>;
+ def EBP : RegisterWithSubRegs<"ebp", [BP]>, DwarfRegNum<[-2, 4, 5]>;
+ def ESP : RegisterWithSubRegs<"esp", [SP]>, DwarfRegNum<[-2, 5, 4]>;
+ def EIP : RegisterWithSubRegs<"eip", [IP]>, DwarfRegNum<[-2, 8, 8]>;
// X86-64 only, requires REX
let CostPerUse = 1 in {
- def R8D : RegisterWithSubRegs<"r8d", [R8W]>, DwarfRegNum<[8, -2, -2]>;
- def R9D : RegisterWithSubRegs<"r9d", [R9W]>, DwarfRegNum<[9, -2, -2]>;
- def R10D : RegisterWithSubRegs<"r10d", [R10W]>, DwarfRegNum<[10, -2, -2]>;
- def R11D : RegisterWithSubRegs<"r11d", [R11W]>, DwarfRegNum<[11, -2, -2]>;
- def R12D : RegisterWithSubRegs<"r12d", [R12W]>, DwarfRegNum<[12, -2, -2]>;
- def R13D : RegisterWithSubRegs<"r13d", [R13W]>, DwarfRegNum<[13, -2, -2]>;
- def R14D : RegisterWithSubRegs<"r14d", [R14W]>, DwarfRegNum<[14, -2, -2]>;
- def R15D : RegisterWithSubRegs<"r15d", [R15W]>, DwarfRegNum<[15, -2, -2]>;
+ def R8D : RegisterWithSubRegs<"r8d", [R8W]>;
+ def R9D : RegisterWithSubRegs<"r9d", [R9W]>;
+ def R10D : RegisterWithSubRegs<"r10d", [R10W]>;
+ def R11D : RegisterWithSubRegs<"r11d", [R11W]>;
+ def R12D : RegisterWithSubRegs<"r12d", [R12W]>;
+ def R13D : RegisterWithSubRegs<"r13d", [R13W]>;
+ def R14D : RegisterWithSubRegs<"r14d", [R14W]>;
+ def R15D : RegisterWithSubRegs<"r15d", [R15W]>;
}}
// 64-bit registers, X86-64 only
@@ -188,22 +188,22 @@ let Namespace = "X86" in {
// YMM Registers, used by AVX instructions
let SubRegIndices = [sub_xmm] in {
- def YMM0: RegisterWithSubRegs<"ymm0", [XMM0]>, DwarfRegNum<[17, 21, 21]>;
- def YMM1: RegisterWithSubRegs<"ymm1", [XMM1]>, DwarfRegNum<[18, 22, 22]>;
- def YMM2: RegisterWithSubRegs<"ymm2", [XMM2]>, DwarfRegNum<[19, 23, 23]>;
- def YMM3: RegisterWithSubRegs<"ymm3", [XMM3]>, DwarfRegNum<[20, 24, 24]>;
- def YMM4: RegisterWithSubRegs<"ymm4", [XMM4]>, DwarfRegNum<[21, 25, 25]>;
- def YMM5: RegisterWithSubRegs<"ymm5", [XMM5]>, DwarfRegNum<[22, 26, 26]>;
- def YMM6: RegisterWithSubRegs<"ymm6", [XMM6]>, DwarfRegNum<[23, 27, 27]>;
- def YMM7: RegisterWithSubRegs<"ymm7", [XMM7]>, DwarfRegNum<[24, 28, 28]>;
- def YMM8: RegisterWithSubRegs<"ymm8", [XMM8]>, DwarfRegNum<[25, -2, -2]>;
- def YMM9: RegisterWithSubRegs<"ymm9", [XMM9]>, DwarfRegNum<[26, -2, -2]>;
- def YMM10: RegisterWithSubRegs<"ymm10", [XMM10]>, DwarfRegNum<[27, -2, -2]>;
- def YMM11: RegisterWithSubRegs<"ymm11", [XMM11]>, DwarfRegNum<[28, -2, -2]>;
- def YMM12: RegisterWithSubRegs<"ymm12", [XMM12]>, DwarfRegNum<[29, -2, -2]>;
- def YMM13: RegisterWithSubRegs<"ymm13", [XMM13]>, DwarfRegNum<[30, -2, -2]>;
- def YMM14: RegisterWithSubRegs<"ymm14", [XMM14]>, DwarfRegNum<[31, -2, -2]>;
- def YMM15: RegisterWithSubRegs<"ymm15", [XMM15]>, DwarfRegNum<[32, -2, -2]>;
+ def YMM0: RegisterWithSubRegs<"ymm0", [XMM0]>, DwarfRegAlias<XMM0>;
+ def YMM1: RegisterWithSubRegs<"ymm1", [XMM1]>, DwarfRegAlias<XMM1>;
+ def YMM2: RegisterWithSubRegs<"ymm2", [XMM2]>, DwarfRegAlias<XMM2>;
+ def YMM3: RegisterWithSubRegs<"ymm3", [XMM3]>, DwarfRegAlias<XMM3>;
+ def YMM4: RegisterWithSubRegs<"ymm4", [XMM4]>, DwarfRegAlias<XMM4>;
+ def YMM5: RegisterWithSubRegs<"ymm5", [XMM5]>, DwarfRegAlias<XMM5>;
+ def YMM6: RegisterWithSubRegs<"ymm6", [XMM6]>, DwarfRegAlias<XMM6>;
+ def YMM7: RegisterWithSubRegs<"ymm7", [XMM7]>, DwarfRegAlias<XMM7>;
+ def YMM8: RegisterWithSubRegs<"ymm8", [XMM8]>, DwarfRegAlias<XMM8>;
+ def YMM9: RegisterWithSubRegs<"ymm9", [XMM9]>, DwarfRegAlias<XMM9>;
+ def YMM10: RegisterWithSubRegs<"ymm10", [XMM10]>, DwarfRegAlias<XMM10>;
+ def YMM11: RegisterWithSubRegs<"ymm11", [XMM11]>, DwarfRegAlias<XMM11>;
+ def YMM12: RegisterWithSubRegs<"ymm12", [XMM12]>, DwarfRegAlias<XMM12>;
+ def YMM13: RegisterWithSubRegs<"ymm13", [XMM13]>, DwarfRegAlias<XMM13>;
+ def YMM14: RegisterWithSubRegs<"ymm14", [XMM14]>, DwarfRegAlias<XMM14>;
+ def YMM15: RegisterWithSubRegs<"ymm15", [XMM15]>, DwarfRegAlias<XMM15>;
}
// Floating point stack registers
@@ -326,104 +326,12 @@ def GR16 : RegisterClass<"X86", [i16], 16,
[AX, CX, DX, SI, DI, BX, BP, SP,
R8W, R9W, R10W, R11W, R14W, R15W, R12W, R13W]> {
let SubRegClasses = [(GR8 sub_8bit, sub_8bit_hi)];
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- static const unsigned X86_GR16_AO_64[] = {
- X86::AX, X86::CX, X86::DX, X86::SI, X86::DI,
- X86::R8W, X86::R9W, X86::R10W, X86::R11W,
- X86::BX, X86::R14W, X86::R15W, X86::R12W, X86::R13W, X86::BP
- };
-
- GR16Class::iterator
- GR16Class::allocation_order_begin(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (Subtarget.is64Bit())
- return X86_GR16_AO_64;
- else
- return begin();
- }
-
- GR16Class::iterator
- GR16Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- if (Subtarget.is64Bit()) {
- // Does the function dedicate RBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate SP or BP.
- return array_endof(X86_GR16_AO_64) - 1;
- else
- // If not, just don't allocate SP.
- return array_endof(X86_GR16_AO_64);
- } else {
- // Does the function dedicate EBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate SP or BP.
- return begin() + 6;
- else
- // If not, just don't allocate SP.
- return begin() + 7;
- }
- }
- }];
}
def GR32 : RegisterClass<"X86", [i32], 32,
[EAX, ECX, EDX, ESI, EDI, EBX, EBP, ESP,
R8D, R9D, R10D, R11D, R14D, R15D, R12D, R13D]> {
let SubRegClasses = [(GR8 sub_8bit, sub_8bit_hi), (GR16 sub_16bit)];
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- static const unsigned X86_GR32_AO_64[] = {
- X86::EAX, X86::ECX, X86::EDX, X86::ESI, X86::EDI,
- X86::R8D, X86::R9D, X86::R10D, X86::R11D,
- X86::EBX, X86::R14D, X86::R15D, X86::R12D, X86::R13D, X86::EBP
- };
-
- GR32Class::iterator
- GR32Class::allocation_order_begin(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (Subtarget.is64Bit())
- return X86_GR32_AO_64;
- else
- return begin();
- }
-
- GR32Class::iterator
- GR32Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- if (Subtarget.is64Bit()) {
- // Does the function dedicate RBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate ESP or EBP.
- return array_endof(X86_GR32_AO_64) - 1;
- else
- // If not, just don't allocate ESP.
- return array_endof(X86_GR32_AO_64);
- } else {
- // Does the function dedicate EBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate ESP or EBP.
- return begin() + 6;
- else
- // If not, just don't allocate ESP.
- return begin() + 7;
- }
- }
- }];
}
// GR64 - 64-bit GPRs. This oddly includes RIP, which isn't accurate, since
@@ -435,25 +343,6 @@ def GR64 : RegisterClass<"X86", [i64], 64,
let SubRegClasses = [(GR8 sub_8bit, sub_8bit_hi),
(GR16 sub_16bit),
(GR32 sub_32bit)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR64Class::iterator
- GR64Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- if (!Subtarget.is64Bit())
- return begin(); // None of these are allocatable in 32-bit.
- // Does the function dedicate RBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- return end()-3; // If so, don't allocate RIP, RSP or RBP
- else
- return end()-2; // If not, just don't allocate RIP or RSP
- }
- }];
}
// Segment registers for use by MOV instructions (and others) that have a
@@ -496,7 +385,7 @@ def GR32_TC : RegisterClass<"X86", [i32], 32, [EAX, ECX, EDX]> {
let SubRegClasses = [(GR8 sub_8bit, sub_8bit_hi), (GR16 sub_16bit)];
}
def GR64_TC : RegisterClass<"X86", [i64], 64, [RAX, RCX, RDX, RSI, RDI,
- R8, R9, R11]> {
+ R8, R9, R11, RIP]> {
let SubRegClasses = [(GR8 sub_8bit, sub_8bit_hi),
(GR16 sub_16bit),
(GR32_TC sub_32bit)];
@@ -543,48 +432,12 @@ def GR8_NOREX : RegisterClass<"X86", [i8], 8,
def GR16_NOREX : RegisterClass<"X86", [i16], 16,
[AX, CX, DX, SI, DI, BX, BP, SP]> {
let SubRegClasses = [(GR8_NOREX sub_8bit, sub_8bit_hi)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR16_NOREXClass::iterator
- GR16_NOREXClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- // Does the function dedicate RBP / EBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate SP or BP.
- return end() - 2;
- else
- // If not, just don't allocate SP.
- return end() - 1;
- }
- }];
}
// GR32_NOREX - GR32 registers which do not require a REX prefix.
def GR32_NOREX : RegisterClass<"X86", [i32], 32,
[EAX, ECX, EDX, ESI, EDI, EBX, EBP, ESP]> {
let SubRegClasses = [(GR8_NOREX sub_8bit, sub_8bit_hi),
(GR16_NOREX sub_16bit)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR32_NOREXClass::iterator
- GR32_NOREXClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- // Does the function dedicate RBP / EBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate ESP or EBP.
- return end() - 2;
- else
- // If not, just don't allocate ESP.
- return end() - 1;
- }
- }];
}
// GR64_NOREX - GR64 registers which do not require a REX prefix.
def GR64_NOREX : RegisterClass<"X86", [i64], 64,
@@ -592,24 +445,6 @@ def GR64_NOREX : RegisterClass<"X86", [i64], 64,
let SubRegClasses = [(GR8_NOREX sub_8bit, sub_8bit_hi),
(GR16_NOREX sub_16bit),
(GR32_NOREX sub_32bit)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR64_NOREXClass::iterator
- GR64_NOREXClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- // Does the function dedicate RBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate RIP, RSP or RBP.
- return end() - 3;
- else
- // If not, just don't allocate RIP or RSP.
- return end() - 2;
- }
- }];
}
// GR32_NOSP - GR32 registers except ESP.
@@ -617,52 +452,6 @@ def GR32_NOSP : RegisterClass<"X86", [i32], 32,
[EAX, ECX, EDX, ESI, EDI, EBX, EBP,
R8D, R9D, R10D, R11D, R14D, R15D, R12D, R13D]> {
let SubRegClasses = [(GR8 sub_8bit, sub_8bit_hi), (GR16 sub_16bit)];
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- static const unsigned X86_GR32_NOSP_AO_64[] = {
- X86::EAX, X86::ECX, X86::EDX, X86::ESI, X86::EDI,
- X86::R8D, X86::R9D, X86::R10D, X86::R11D,
- X86::EBX, X86::R14D, X86::R15D, X86::R12D, X86::R13D, X86::EBP
- };
-
- GR32_NOSPClass::iterator
- GR32_NOSPClass::allocation_order_begin(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (Subtarget.is64Bit())
- return X86_GR32_NOSP_AO_64;
- else
- return begin();
- }
-
- GR32_NOSPClass::iterator
- GR32_NOSPClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- if (Subtarget.is64Bit()) {
- // Does the function dedicate RBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate EBP.
- return array_endof(X86_GR32_NOSP_AO_64) - 1;
- else
- // If not, any reg in this class is ok.
- return array_endof(X86_GR32_NOSP_AO_64);
- } else {
- // Does the function dedicate EBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate EBP.
- return begin() + 6;
- else
- // If not, any reg in this class is ok.
- return begin() + 7;
- }
- }
- }];
}
// GR64_NOSP - GR64 registers except RSP (and RIP).
@@ -672,25 +461,14 @@ def GR64_NOSP : RegisterClass<"X86", [i64], 64,
let SubRegClasses = [(GR8 sub_8bit, sub_8bit_hi),
(GR16 sub_16bit),
(GR32_NOSP sub_32bit)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR64_NOSPClass::iterator
- GR64_NOSPClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- if (!Subtarget.is64Bit())
- return begin(); // None of these are allocatable in 32-bit.
- // Does the function dedicate RBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- return end()-1; // If so, don't allocate RBP
- else
- return end(); // If not, any reg in this class is ok.
- }
- }];
+}
+
+// GR32_NOREX_NOSP - GR32 registers which do not require a REX prefix except
+// ESP.
+def GR32_NOREX_NOSP : RegisterClass<"X86", [i32], 32,
+ [EAX, ECX, EDX, ESI, EDI, EBX, EBP]> {
+ let SubRegClasses = [(GR8_NOREX sub_8bit, sub_8bit_hi),
+ (GR16_NOREX sub_16bit)];
}
// GR64_NOREX_NOSP - GR64_NOREX registers except RSP.
@@ -698,26 +476,7 @@ def GR64_NOREX_NOSP : RegisterClass<"X86", [i64], 64,
[RAX, RCX, RDX, RSI, RDI, RBX, RBP]> {
let SubRegClasses = [(GR8_NOREX sub_8bit, sub_8bit_hi),
(GR16_NOREX sub_16bit),
- (GR32_NOREX sub_32bit)];
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GR64_NOREX_NOSPClass::iterator
- GR64_NOREX_NOSPClass::allocation_order_end(const MachineFunction &MF) const
- {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- const X86MachineFunctionInfo *MFI = MF.getInfo<X86MachineFunctionInfo>();
- // Does the function dedicate RBP to being a frame ptr?
- if (TFI->hasFP(MF) || MFI->getReserveFP())
- // If so, don't allocate RBP.
- return end() - 1;
- else
- // If not, any reg in this class is ok.
- return end();
- }
- }];
+ (GR32_NOREX_NOSP sub_32bit)];
}
// A class to support the 'A' assembler constraint: EAX then EDX.
@@ -731,42 +490,12 @@ def GR32_AD : RegisterClass<"X86", [i32], 32, [EAX, EDX]> {
def FR32 : RegisterClass<"X86", [f32], 32,
[XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
XMM8, XMM9, XMM10, XMM11,
- XMM12, XMM13, XMM14, XMM15]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- FR32Class::iterator
- FR32Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return end()-8; // Only XMM0 to XMM7 are available in 32-bit mode.
- else
- return end();
- }
- }];
-}
+ XMM12, XMM13, XMM14, XMM15]>;
def FR64 : RegisterClass<"X86", [f64], 64,
[XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
XMM8, XMM9, XMM10, XMM11,
- XMM12, XMM13, XMM14, XMM15]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- FR64Class::iterator
- FR64Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return end()-8; // Only XMM0 to XMM7 are available in 32-bit mode.
- else
- return end();
- }
- }];
-}
+ XMM12, XMM13, XMM14, XMM15]>;
// FIXME: This sets up the floating point register files as though they are f64
@@ -784,15 +513,7 @@ def RFP80 : RegisterClass<"X86",[f80], 32, [FP0, FP1, FP2, FP3, FP4, FP5, FP6]>;
// for transforming FPn allocations to STn registers)
def RST : RegisterClass<"X86", [f80, f64, f32], 32,
[ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7]> {
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- RSTClass::iterator
- RSTClass::allocation_order_end(const MachineFunction &MF) const {
- return begin();
- }
- }];
+ let isAllocatable = 0;
}
// Generic vector registers: VR64 and VR128.
@@ -803,21 +524,6 @@ def VR128 : RegisterClass<"X86", [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],128,
XMM8, XMM9, XMM10, XMM11,
XMM12, XMM13, XMM14, XMM15]> {
let SubRegClasses = [(FR32 sub_ss), (FR64 sub_sd)];
-
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- VR128Class::iterator
- VR128Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return end()-8; // Only XMM0 to XMM7 are available in 32-bit mode.
- else
- return end();
- }
- }];
}
def VR256 : RegisterClass<"X86", [v32i8, v8i32, v4i64, v8f32, v4f64], 256,
@@ -825,35 +531,10 @@ def VR256 : RegisterClass<"X86", [v32i8, v8i32, v4i64, v8f32, v4f64], 256,
YMM8, YMM9, YMM10, YMM11,
YMM12, YMM13, YMM14, YMM15]> {
let SubRegClasses = [(FR32 sub_ss), (FR64 sub_sd), (VR128 sub_xmm)];
-
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- VR256Class::iterator
- VR256Class::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
- if (!Subtarget.is64Bit())
- return end()-8; // Only YMM0 to YMM7 are available in 32-bit mode.
- else
- return end();
- }
- }];
}
// Status flags registers.
def CCR : RegisterClass<"X86", [i32], 32, [EFLAGS]> {
let CopyCost = -1; // Don't allow copying of status registers.
-
- // EFLAGS is not allocatable.
- let MethodProtos = [{
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- CCRClass::iterator
- CCRClass::allocation_order_end(const MachineFunction &MF) const {
- return allocation_order_begin(MF);
- }
- }];
+ let isAllocatable = 0;
}
diff --git a/contrib/llvm/lib/Target/X86/X86Subtarget.cpp b/contrib/llvm/lib/Target/X86/X86Subtarget.cpp
index ba5864e..481e821 100644
--- a/contrib/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/contrib/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -265,6 +265,7 @@ void X86Subtarget::AutoDetectSubtargetFeatures() {
HasCLMUL = IsIntel && ((ECX >> 1) & 0x1);
HasFMA3 = IsIntel && ((ECX >> 12) & 0x1);
+ HasPOPCNT = IsIntel && ((ECX >> 23) & 0x1);
HasAES = IsIntel && ((ECX >> 25) & 0x1);
if (IsIntel || IsAMD) {
diff --git a/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp b/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp
index 6bec9f9..a8dd847 100644
--- a/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp
+++ b/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp
@@ -205,6 +205,16 @@ SDNode *XCoreDAGToDAGISel::Select(SDNode *N) {
return CurDAG->getMachineNode(XCore::LMUL_l6r, dl, MVT::i32, MVT::i32,
Ops, 4);
}
+ case ISD::INTRINSIC_WO_CHAIN: {
+ unsigned IntNo = cast<ConstantSDNode>(N->getOperand(0))->getZExtValue();
+ switch (IntNo) {
+ case Intrinsic::xcore_crc8:
+ SDValue Ops[] = { N->getOperand(1), N->getOperand(2), N->getOperand(3) };
+ return CurDAG->getMachineNode(XCore::CRC8_l4r, dl, MVT::i32, MVT::i32,
+ Ops, 3);
+ }
+ break;
+ }
case ISD::BRIND:
if (SDNode *ResNode = SelectBRIND(N))
return ResNode;
diff --git a/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp b/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp
index 5987e8b..8cabbbf 100644
--- a/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp
@@ -156,6 +156,8 @@ XCoreTargetLowering::XCoreTargetLowering(XCoreTargetMachine &XTM)
// We have target-specific dag combine patterns for the following nodes:
setTargetDAGCombine(ISD::STORE);
setTargetDAGCombine(ISD::ADD);
+
+ setMinFunctionAlignment(1);
}
SDValue XCoreTargetLowering::
@@ -201,12 +203,6 @@ void XCoreTargetLowering::ReplaceNodeResults(SDNode *N,
}
}
-/// getFunctionAlignment - Return the Log2 alignment of this function.
-unsigned XCoreTargetLowering::
-getFunctionAlignment(const Function *) const {
- return 1;
-}
-
//===----------------------------------------------------------------------===//
// Misc Lower Operation implementation
//===----------------------------------------------------------------------===//
@@ -248,9 +244,6 @@ LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const
{
const GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
SDValue GA = DAG.getTargetGlobalAddress(GV, Op.getDebugLoc(), MVT::i32);
- // If it's a debug information descriptor, don't mess with it.
- if (DAG.isVerifiedDebugInfoDesc(Op))
- return GA;
return getGlobalAddressWrapper(GA, GV, DAG);
}
@@ -904,8 +897,8 @@ XCoreTargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
// The ABI dictates there should be one stack slot available to the callee
// on function entry (for saving lr).
@@ -1027,8 +1020,8 @@ XCoreTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
// Assign locations to each value returned by this call.
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
CCInfo.AnalyzeCallResult(Ins, RetCC_XCore);
@@ -1087,8 +1080,8 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- ArgLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), ArgLocs, *DAG.getContext());
CCInfo.AnalyzeFormalArguments(Ins, CC_XCore);
@@ -1192,12 +1185,12 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,
//===----------------------------------------------------------------------===//
bool XCoreTargetLowering::
-CanLowerReturn(CallingConv::ID CallConv, bool isVarArg,
+CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
+ bool isVarArg,
const SmallVectorImpl<ISD::OutputArg> &Outs,
LLVMContext &Context) const {
SmallVector<CCValAssign, 16> RVLocs;
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, Context);
+ CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(), RVLocs, Context);
return CCInfo.CheckReturn(Outs, RetCC_XCore);
}
@@ -1213,10 +1206,10 @@ XCoreTargetLowering::LowerReturn(SDValue Chain,
SmallVector<CCValAssign, 16> RVLocs;
// CCState - Info about the registers and stack slot.
- CCState CCInfo(CallConv, isVarArg, getTargetMachine(),
- RVLocs, *DAG.getContext());
+ CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
+ getTargetMachine(), RVLocs, *DAG.getContext());
- // Analize return values.
+ // Analyze return values.
CCInfo.AnalyzeReturn(Outs, RetCC_XCore);
// If this is the first return lowered for this function, add
diff --git a/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h b/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h
index bb3f2cc..a8d67d4 100644
--- a/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h
+++ b/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h
@@ -103,9 +103,6 @@ namespace llvm {
virtual bool isLegalAddressingMode(const AddrMode &AM,
const Type *Ty) const;
- /// getFunctionAlignment - Return the Log2 alignment of this function.
- virtual unsigned getFunctionAlignment(const Function *F) const;
-
private:
const XCoreTargetMachine &TM;
const XCoreSubtarget &Subtarget;
@@ -194,7 +191,8 @@ namespace llvm {
DebugLoc dl, SelectionDAG &DAG) const;
virtual bool
- CanLowerReturn(CallingConv::ID CallConv, bool isVarArg,
+ CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
+ bool isVarArg,
const SmallVectorImpl<ISD::OutputArg> &ArgsFlags,
LLVMContext &Context) const;
};
diff --git a/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td b/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td
index 789546e..55c7527 100644
--- a/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td
+++ b/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td
@@ -472,7 +472,16 @@ def REMU_l3r : FL3R<"remu", urem>;
}
def XOR_l3r : FL3R<"xor", xor>;
defm ASHR : FL3R_L2RBITP<"ashr", sra>;
-// TODO crc32, crc8, inpw, outpw
+
+let Constraints = "$src1 = $dst" in
+def CRC_l3r : _FL3R<(outs GRRegs:$dst),
+ (ins GRRegs:$src1, GRRegs:$src2, GRRegs:$src3),
+ "crc32 $dst, $src2, $src3",
+ [(set GRRegs:$dst,
+ (int_xcore_crc32 GRRegs:$src1, GRRegs:$src2,
+ GRRegs:$src3))]>;
+
+// TODO inpw, outpw
let mayStore=1 in {
def ST16_l3r : _FL3R<(outs), (ins GRRegs:$val, GRRegs:$addr, GRRegs:$offset),
"st16 $val, $addr[$offset]",
@@ -498,6 +507,12 @@ def MACCS_l4r : _L4R<(outs GRRegs:$dst1, GRRegs:$dst2),
[]>;
}
+let Constraints = "$src1 = $dst1" in
+def CRC8_l4r : _L4R<(outs GRRegs:$dst1, GRRegs:$dst2),
+ (ins GRRegs:$src1, GRRegs:$src2, GRRegs:$src3),
+ "crc8 $dst1, $dst2, $src2, $src3",
+ []>;
+
// Five operand long
def LADD_l5r : _L5R<(outs GRRegs:$dst1, GRRegs:$dst2),
diff --git a/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp b/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp
index 0287a51..46c9e57 100644
--- a/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp
+++ b/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp
@@ -68,8 +68,8 @@ unsigned XCoreRegisterInfo::getNumArgRegs(const MachineFunction *MF)
}
bool XCoreRegisterInfo::needsFrameMoves(const MachineFunction &MF) {
- return MF.getMMI().hasDebugInfo() || !MF.getFunction()->doesNotThrow() ||
- UnwindTablesMandatory;
+ return MF.getMMI().hasDebugInfo() ||
+ MF.getFunction()->needsUnwindTableEntry();
}
const unsigned* XCoreRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
@@ -315,6 +315,10 @@ int XCoreRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
return XCoreGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
}
+int XCoreRegisterInfo::getLLVMRegNum(unsigned DwarfRegNo, bool isEH) const {
+ return XCoreGenRegisterInfo::getLLVMRegNumFull(DwarfRegNo,0);
+}
+
unsigned XCoreRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
const TargetFrameLowering *TFI = MF.getTarget().getFrameLowering();
diff --git a/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h b/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h
index 770483b..7a9bc9f 100644
--- a/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h
+++ b/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h
@@ -75,6 +75,7 @@ public:
//! Get DWARF debugging register number
int getDwarfRegNum(unsigned RegNum, bool isEH) const;
+ int getLLVMRegNum(unsigned RegNum, bool isEH) const;
};
} // end namespace llvm
diff --git a/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td b/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td
index 765f717..0951097 100644
--- a/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td
+++ b/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td
@@ -48,44 +48,9 @@ def GRRegs : RegisterClass<"XCore", [i32], 32,
// Not preserved across procedure calls
R11,
// Callee save
- R4, R5, R6, R7, R8, R9, R10]> {
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- GRRegsClass::iterator
- GRRegsClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- GRRegsClass::iterator
- GRRegsClass::allocation_order_end(const MachineFunction &MF) const {
- const TargetMachine &TM = MF.getTarget();
- const TargetFrameLowering *TFI = TM.getFrameLowering();
- if (TFI->hasFP(MF))
- return end()-1; // don't allocate R10
- else
- return end();
- }
- }];
-}
+ R4, R5, R6, R7, R8, R9, R10]>;
-def RRegs : RegisterClass<"XCore", [i32], 32,
- // Reserved
- [CP, DP, SP, LR]> {
- let MethodProtos = [{
- iterator allocation_order_begin(const MachineFunction &MF) const;
- iterator allocation_order_end(const MachineFunction &MF) const;
- }];
- let MethodBodies = [{
- RRegsClass::iterator
- RRegsClass::allocation_order_begin(const MachineFunction &MF) const {
- return begin();
- }
- RRegsClass::iterator
- RRegsClass::allocation_order_end(const MachineFunction &MF) const {
- // No allocatable registers
- return begin();
- }
- }];
+// Reserved
+def RRegs : RegisterClass<"XCore", [i32], 32, [CP, DP, SP, LR]> {
+ let isAllocatable = 0;
}
diff --git a/contrib/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp b/contrib/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
index a509931..d3d4963 100644
--- a/contrib/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/contrib/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -83,7 +83,8 @@ bool DTE::runOnModule(Module &M) {
bool Changed = false;
TypeSymbolTable &ST = M.getTypeSymbolTable();
- std::set<const Type *> UsedTypes = getAnalysis<FindUsedTypes>().getTypes();
+ const SetVector<const Type*> &T = getAnalysis<FindUsedTypes>().getTypes();
+ std::set<const Type*> UsedTypes(T.begin(), T.end());
// Check the symbol table for superfluous type entries...
//
diff --git a/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp b/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp
index 9d432de..d9911bf 100644
--- a/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp
+++ b/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp
@@ -51,20 +51,32 @@ namespace {
// Visit the GlobalVariables.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I) {
+ if (deleteStuff == (bool)Named.count(I) && !I->isDeclaration()) {
+ I->setInitializer(0);
+ } else {
+ if (I->hasAvailableExternallyLinkage())
+ continue;
+ if (I->getName() == "llvm.global_ctors")
+ continue;
+ }
+
if (I->hasLocalLinkage())
I->setVisibility(GlobalValue::HiddenVisibility);
I->setLinkage(GlobalValue::ExternalLinkage);
- if (deleteStuff == (bool)Named.count(I) && !I->isDeclaration())
- I->setInitializer(0);
}
// Visit the Functions.
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
+ if (deleteStuff == (bool)Named.count(I) && !I->isDeclaration()) {
+ I->deleteBody();
+ } else {
+ if (I->hasAvailableExternallyLinkage())
+ continue;
+ }
+
if (I->hasLocalLinkage())
I->setVisibility(GlobalValue::HiddenVisibility);
I->setLinkage(GlobalValue::ExternalLinkage);
- if (deleteStuff == (bool)Named.count(I) && !I->isDeclaration())
- I->deleteBody();
}
return true;
diff --git a/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index ded58ac..cdf7b76 100644
--- a/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -241,15 +241,15 @@ static bool AnalyzeGlobal(const Value *V, GlobalStatus &GS,
GS.HasPHIUser = true;
} else if (isa<CmpInst>(I)) {
GS.isCompared = true;
- } else if (isa<MemTransferInst>(I)) {
- const MemTransferInst *MTI = cast<MemTransferInst>(I);
+ } else if (const MemTransferInst *MTI = dyn_cast<MemTransferInst>(I)) {
+ if (MTI->isVolatile()) return true;
if (MTI->getArgOperand(0) == V)
GS.StoredType = GlobalStatus::isStored;
if (MTI->getArgOperand(1) == V)
GS.isLoaded = true;
- } else if (isa<MemSetInst>(I)) {
- assert(cast<MemSetInst>(I)->getArgOperand(0) == V &&
- "Memset only takes one pointer!");
+ } else if (const MemSetInst *MSI = dyn_cast<MemSetInst>(I)) {
+ assert(MSI->getArgOperand(0) == V && "Memset only takes one pointer!");
+ if (MSI->isVolatile()) return true;
GS.StoredType = GlobalStatus::isStored;
} else {
return true; // Any other non-load instruction might take address!
@@ -799,7 +799,8 @@ static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV) {
// If we get here we could have other crazy uses that are transitively
// loaded.
assert((isa<PHINode>(GlobalUser) || isa<SelectInst>(GlobalUser) ||
- isa<ConstantExpr>(GlobalUser)) && "Only expect load and stores!");
+ isa<ConstantExpr>(GlobalUser) || isa<CmpInst>(GlobalUser)) &&
+ "Only expect load and stores!");
}
}
@@ -1589,8 +1590,7 @@ static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
GV->getInitializer()->isNullValue()) {
if (Constant *SOVC = dyn_cast<Constant>(StoredOnceVal)) {
if (GV->getInitializer()->getType() != SOVC->getType())
- SOVC =
- ConstantExpr::getBitCast(SOVC, GV->getInitializer()->getType());
+ SOVC = ConstantExpr::getBitCast(SOVC, GV->getInitializer()->getType());
// Optimize away any trapping uses of the loaded value.
if (OptimizeAwayTrappingUsesOfLoads(GV, SOVC))
@@ -2438,6 +2438,20 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
// Cannot handle inline asm.
if (isa<InlineAsm>(CI->getCalledValue())) return false;
+ if (MemSetInst *MSI = dyn_cast<MemSetInst>(CI)) {
+ if (MSI->isVolatile()) return false;
+ Constant *Ptr = getVal(Values, MSI->getDest());
+ Constant *Val = getVal(Values, MSI->getValue());
+ Constant *DestVal = ComputeLoadResult(getVal(Values, Ptr),
+ MutatedMemory);
+ if (Val->isNullValue() && DestVal && DestVal->isNullValue()) {
+ // This memset is a no-op.
+ ++CurInst;
+ continue;
+ }
+ return false;
+ }
+
// Resolve function pointers.
Function *Callee = dyn_cast<Function>(getVal(Values,
CI->getCalledValue()));
diff --git a/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp b/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp
index 9470180..2f3baeb 100644
--- a/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp
+++ b/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp
@@ -180,6 +180,7 @@ bool PruneEH::SimplifyFunction(Function *F) {
Call->takeName(II);
Call->setCallingConv(II->getCallingConv());
Call->setAttributes(II->getAttributes());
+ Call->setDebugLoc(II->getDebugLoc());
// Anything that used the value produced by the invoke instruction
// now uses the value produced by the call instruction. Note that we
@@ -238,7 +239,7 @@ void PruneEH::DeleteBasicBlock(BasicBlock *BB) {
for (BasicBlock::iterator I = BB->end(), E = BB->begin(); I != E; ) {
--I;
if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (!isa<DbgInfoIntrinsic>(I))
+ if (!isa<IntrinsicInst>(I))
CGN->removeCallEdgeFor(CI);
} else if (InvokeInst *II = dyn_cast<InvokeInst>(I))
CGN->removeCallEdgeFor(II);
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h b/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h
index 9c70cf8..8257d6b 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h
@@ -233,7 +233,15 @@ public:
Worklist.Add(New);
return New;
}
-
+
+ // InsertNewInstWith - same as InsertNewInstBefore, but also sets the
+ // debug loc.
+ //
+ Instruction *InsertNewInstWith(Instruction *New, Instruction &Old) {
+ New->setDebugLoc(Old.getDebugLoc());
+ return InsertNewInstBefore(New, Old);
+ }
+
// ReplaceInstUsesWith - This method is to be used when an instruction is
// found to be dead, replacable with another preexisting expression. Here
// we add all uses of I to the worklist, replace all uses of I with the new
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 726105f..ef67701 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -111,10 +111,10 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
Value *Src = Builder->CreateBitCast(MI->getArgOperand(1), NewSrcPtrTy);
Value *Dest = Builder->CreateBitCast(MI->getArgOperand(0), NewDstPtrTy);
- Instruction *L = new LoadInst(Src, "tmp", MI->isVolatile(), SrcAlign);
- InsertNewInstBefore(L, *MI);
- InsertNewInstBefore(new StoreInst(L, Dest, MI->isVolatile(), DstAlign),
- *MI);
+ LoadInst *L = Builder->CreateLoad(Src, MI->isVolatile());
+ L->setAlignment(SrcAlign);
+ StoreInst *S = Builder->CreateStore(L, Dest, MI->isVolatile());
+ S->setAlignment(DstAlign);
// Set the size of the copy to 0, it will be deleted on the next iteration.
MI->setArgOperand(2, Constant::getNullValue(MemOpLength->getType()));
@@ -154,8 +154,9 @@ Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
// Extract the fill value and store.
uint64_t Fill = FillC->getZExtValue()*0x0101010101010101ULL;
- InsertNewInstBefore(new StoreInst(ConstantInt::get(ITy, Fill),
- Dest, false, Alignment), *MI);
+ StoreInst *S = Builder->CreateStore(ConstantInt::get(ITy, Fill), Dest,
+ MI->isVolatile());
+ S->setAlignment(Alignment);
// Set the size of the copy to 0, it will be deleted on the next iteration.
MI->setLength(Constant::getNullValue(LenC->getType()));
@@ -405,20 +406,21 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
if (LHSKnownNegative && RHSKnownNegative) {
// The sign bit is set in both cases: this MUST overflow.
// Create a simple add instruction, and insert it into the struct.
- Instruction *Add = BinaryOperator::CreateAdd(LHS, RHS, "", &CI);
- Worklist.Add(Add);
+ Value *Add = Builder->CreateAdd(LHS, RHS);
+ Add->takeName(&CI);
Constant *V[] = {
- UndefValue::get(LHS->getType()),ConstantInt::getTrue(II->getContext())
+ UndefValue::get(LHS->getType()),
+ ConstantInt::getTrue(II->getContext())
};
Constant *Struct = ConstantStruct::get(II->getContext(), V, 2, false);
return InsertValueInst::Create(Struct, Add, 0);
}
-
+
if (LHSKnownPositive && RHSKnownPositive) {
// The sign bit is clear in both cases: this CANNOT overflow.
// Create a simple add instruction, and insert it into the struct.
- Instruction *Add = BinaryOperator::CreateNUWAdd(LHS, RHS, "", &CI);
- Worklist.Add(Add);
+ Value *Add = Builder->CreateNUWAdd(LHS, RHS);
+ Add->takeName(&CI);
Constant *V[] = {
UndefValue::get(LHS->getType()),
ConstantInt::getFalse(II->getContext())
@@ -588,6 +590,28 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
break;
}
+
+ case Intrinsic::x86_sse41_pmovsxbw:
+ case Intrinsic::x86_sse41_pmovsxwd:
+ case Intrinsic::x86_sse41_pmovsxdq:
+ case Intrinsic::x86_sse41_pmovzxbw:
+ case Intrinsic::x86_sse41_pmovzxwd:
+ case Intrinsic::x86_sse41_pmovzxdq: {
+ // pmov{s|z}x ignores the upper half of their input vectors.
+ unsigned VWidth =
+ cast<VectorType>(II->getArgOperand(0)->getType())->getNumElements();
+ unsigned LowHalfElts = VWidth / 2;
+ APInt InputDemandedElts(APInt::getBitsSet(VWidth, 0, LowHalfElts));
+ APInt UndefElts(VWidth, 0);
+ if (Value *TmpV = SimplifyDemandedVectorElts(II->getArgOperand(0),
+ InputDemandedElts,
+ UndefElts)) {
+ II->setArgOperand(0, TmpV);
+ return II;
+ }
+ break;
+ }
+
case Intrinsic::ppc_altivec_vperm:
// Turn vperm(V1,V2,mask) -> shuffle(V1,V2,mask) if mask is a constant.
if (ConstantVector *Mask = dyn_cast<ConstantVector>(II->getArgOperand(2))) {
@@ -813,7 +837,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) {
// If OldCall dues not return void then replaceAllUsesWith undef.
// This allows ValueHandlers and custom metadata to adjust itself.
if (!OldCall->getType()->isVoidTy())
- OldCall->replaceAllUsesWith(UndefValue::get(OldCall->getType()));
+ ReplaceInstUsesWith(*OldCall, UndefValue::get(OldCall->getType()));
if (isa<CallInst>(OldCall))
return EraseInstFromFunction(*OldCall);
@@ -835,8 +859,8 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) {
// If CS does not return void then replaceAllUsesWith undef.
// This allows ValueHandlers and custom metadata to adjust itself.
if (!CS.getInstruction()->getType()->isVoidTy())
- CS.getInstruction()->
- replaceAllUsesWith(UndefValue::get(CS.getInstruction()->getType()));
+ ReplaceInstUsesWith(*CS.getInstruction(),
+ UndefValue::get(CS.getInstruction()->getType()));
if (InvokeInst *II = dyn_cast<InvokeInst>(CS.getInstruction())) {
// Don't break the CFG, insert a dummy cond branch.
@@ -1084,15 +1108,15 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
Instruction *NC;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
- NC = InvokeInst::Create(Callee, II->getNormalDest(), II->getUnwindDest(),
- Args.begin(), Args.end(),
- Caller->getName(), Caller);
+ NC = Builder->CreateInvoke(Callee, II->getNormalDest(),
+ II->getUnwindDest(), Args.begin(), Args.end());
+ NC->takeName(II);
cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv());
cast<InvokeInst>(NC)->setAttributes(NewCallerPAL);
} else {
- NC = CallInst::Create(Callee, Args.begin(), Args.end(),
- Caller->getName(), Caller);
CallInst *CI = cast<CallInst>(Caller);
+ NC = Builder->CreateCall(Callee, Args.begin(), Args.end());
+ NC->takeName(CI);
if (CI->isTailCall())
cast<CallInst>(NC)->setTailCall();
cast<CallInst>(NC)->setCallingConv(CI->getCallingConv());
@@ -1106,6 +1130,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
Instruction::CastOps opcode =
CastInst::getCastOpcode(NC, false, OldRetTy, false);
NV = NC = CastInst::Create(opcode, NC, OldRetTy, "tmp");
+ NC->setDebugLoc(Caller->getDebugLoc());
// If this is an invoke instruction, we should insert it after the first
// non-phi, instruction in the normal successor block.
@@ -1123,8 +1148,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
}
if (!Caller->use_empty())
- Caller->replaceAllUsesWith(NV);
-
+ ReplaceInstUsesWith(*Caller, NV);
+
EraseInstFromFunction(*Caller);
return true;
}
@@ -1189,7 +1214,7 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
// Add the chain argument and attributes.
Value *NestVal = Tramp->getArgOperand(2);
if (NestVal->getType() != NestTy)
- NestVal = new BitCastInst(NestVal, NestTy, "nest", Caller);
+ NestVal = Builder->CreateBitCast(NestVal, NestTy, "nest");
NewArgs.push_back(NestVal);
NewAttrs.push_back(AttributeWithIndex::get(NestIdx, NestAttr));
}
@@ -1255,24 +1280,19 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
NewCaller = InvokeInst::Create(NewCallee,
II->getNormalDest(), II->getUnwindDest(),
- NewArgs.begin(), NewArgs.end(),
- Caller->getName(), Caller);
+ NewArgs.begin(), NewArgs.end());
cast<InvokeInst>(NewCaller)->setCallingConv(II->getCallingConv());
cast<InvokeInst>(NewCaller)->setAttributes(NewPAL);
} else {
- NewCaller = CallInst::Create(NewCallee, NewArgs.begin(), NewArgs.end(),
- Caller->getName(), Caller);
+ NewCaller = CallInst::Create(NewCallee, NewArgs.begin(), NewArgs.end());
if (cast<CallInst>(Caller)->isTailCall())
cast<CallInst>(NewCaller)->setTailCall();
cast<CallInst>(NewCaller)->
setCallingConv(cast<CallInst>(Caller)->getCallingConv());
cast<CallInst>(NewCaller)->setAttributes(NewPAL);
}
- if (!Caller->getType()->isVoidTy())
- Caller->replaceAllUsesWith(NewCaller);
- Caller->eraseFromParent();
- Worklist.Remove(Caller);
- return 0;
+
+ return NewCaller;
}
}
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
index 6f70de8..199902a 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -133,7 +133,7 @@ Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI,
// New is the allocation instruction, pointer typed. AI is the original
// allocation instruction, also pointer typed. Thus, cast to use is BitCast.
Value *NewCast = AllocaBuilder.CreateBitCast(New, AI.getType(), "tmpcast");
- AI.replaceAllUsesWith(NewCast);
+ ReplaceInstUsesWith(AI, NewCast);
}
return ReplaceInstUsesWith(CI, New);
}
@@ -211,7 +211,7 @@ Value *InstCombiner::EvaluateInDifferentType(Value *V, const Type *Ty,
}
Res->takeName(I);
- return InsertNewInstBefore(Res, *I);
+ return InsertNewInstWith(Res, *I);
}
@@ -1228,7 +1228,7 @@ Instruction *InstCombiner::visitFPTrunc(FPTruncInst &CI) {
// Remove the old Call. With -fmath-errno, it won't get marked readnone.
- Call->replaceAllUsesWith(UndefValue::get(Call->getType()));
+ ReplaceInstUsesWith(*Call, UndefValue::get(Call->getType()));
EraseInstFromFunction(*Call);
return ret;
}
@@ -1684,8 +1684,7 @@ Instruction *InstCombiner::visitBitCast(BitCastInst &CI) {
// If we found a path from the src to dest, create the getelementptr now.
if (SrcElTy == DstElTy) {
SmallVector<Value*, 8> Idxs(NumZeros+1, ZeroUInt);
- return GetElementPtrInst::CreateInBounds(Src, Idxs.begin(), Idxs.end(),"",
- ((Instruction*)NULL));
+ return GetElementPtrInst::CreateInBounds(Src, Idxs.begin(), Idxs.end());
}
}
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index bb9b88b..c7ed098 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -469,8 +469,7 @@ FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, GlobalVariable *GV,
///
/// If we can't emit an optimized form for this expression, this returns null.
///
-static Value *EvaluateGEPOffsetExpression(User *GEP, Instruction &I,
- InstCombiner &IC) {
+static Value *EvaluateGEPOffsetExpression(User *GEP, InstCombiner &IC) {
TargetData &TD = *IC.getTargetData();
gep_type_iterator GTI = gep_type_begin(GEP);
@@ -533,10 +532,10 @@ static Value *EvaluateGEPOffsetExpression(User *GEP, Instruction &I,
// Cast to intptrty in case a truncation occurs. If an extension is needed,
// we don't need to bother extending: the extension won't affect where the
// computation crosses zero.
- if (VariableIdx->getType()->getPrimitiveSizeInBits() > IntPtrWidth)
- VariableIdx = new TruncInst(VariableIdx,
- TD.getIntPtrType(VariableIdx->getContext()),
- VariableIdx->getName(), &I);
+ if (VariableIdx->getType()->getPrimitiveSizeInBits() > IntPtrWidth) {
+ const Type *IntPtrTy = TD.getIntPtrType(VariableIdx->getContext());
+ VariableIdx = IC.Builder->CreateTrunc(VariableIdx, IntPtrTy);
+ }
return VariableIdx;
}
@@ -558,11 +557,10 @@ static Value *EvaluateGEPOffsetExpression(User *GEP, Instruction &I,
// Okay, we can do this evaluation. Start by converting the index to intptr.
const Type *IntPtrTy = TD.getIntPtrType(VariableIdx->getContext());
if (VariableIdx->getType() != IntPtrTy)
- VariableIdx = CastInst::CreateIntegerCast(VariableIdx, IntPtrTy,
- true /*SExt*/,
- VariableIdx->getName(), &I);
+ VariableIdx = IC.Builder->CreateIntCast(VariableIdx, IntPtrTy,
+ true /*Signed*/);
Constant *OffsetVal = ConstantInt::get(IntPtrTy, NewOffs);
- return BinaryOperator::CreateAdd(VariableIdx, OffsetVal, "offset", &I);
+ return IC.Builder->CreateAdd(VariableIdx, OffsetVal, "offset");
}
/// FoldGEPICmp - Fold comparisons between a GEP instruction and something
@@ -580,7 +578,7 @@ Instruction *InstCombiner::FoldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
// This transformation (ignoring the base and scales) is valid because we
// know pointers can't overflow since the gep is inbounds. See if we can
// output an optimized form.
- Value *Offset = EvaluateGEPOffsetExpression(GEPLHS, I, *this);
+ Value *Offset = EvaluateGEPOffsetExpression(GEPLHS, *this);
// If not, synthesize the offset the hard way.
if (Offset == 0)
@@ -634,6 +632,7 @@ Instruction *InstCombiner::FoldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
if (AllZeros)
return FoldGEPICmp(GEPLHS, GEPRHS->getOperand(0), Cond, I);
+ bool GEPsInBounds = GEPLHS->isInBounds() && GEPRHS->isInBounds();
if (GEPLHS->getNumOperands() == GEPRHS->getNumOperands()) {
// If the GEPs only differ by one index, compare it.
unsigned NumDifferences = 0; // Keep track of # differences.
@@ -656,7 +655,7 @@ Instruction *InstCombiner::FoldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
ConstantInt::get(Type::getInt1Ty(I.getContext()),
ICmpInst::isTrueWhenEqual(Cond)));
- else if (NumDifferences == 1) {
+ else if (NumDifferences == 1 && GEPsInBounds) {
Value *LHSV = GEPLHS->getOperand(DiffOperand);
Value *RHSV = GEPRHS->getOperand(DiffOperand);
// Make sure we do a signed comparison here.
@@ -667,6 +666,7 @@ Instruction *InstCombiner::FoldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
// Only lower this if the icmp is the only user of the GEP or if we expect
// the result to fold to a constant!
if (TD &&
+ GEPsInBounds &&
(isa<ConstantExpr>(GEPLHS) || GEPLHS->hasOneUse()) &&
(isa<ConstantExpr>(GEPRHS) || GEPRHS->hasOneUse())) {
// ((gep Ptr, OFFSET1) cmp (gep Ptr, OFFSET2) ---> (OFFSET1 cmp OFFSET2)
@@ -919,11 +919,11 @@ Instruction *InstCombiner::FoldICmpShrCst(ICmpInst &ICI, BinaryOperator *Shr,
if (ICI.isSigned() != (Shr->getOpcode() == Instruction::AShr))
return 0;
- // Otherwise, all lshr and all exact ashr's are equivalent to a udiv/sdiv by
- // a power of 2. Since we already have logic to simplify these, transform
- // to div and then simplify the resultant comparison.
+ // Otherwise, all lshr and most exact ashr's are equivalent to a udiv/sdiv
+ // by a power of 2. Since we already have logic to simplify these,
+ // transform to div and then simplify the resultant comparison.
if (Shr->getOpcode() == Instruction::AShr &&
- !Shr->isExact())
+ (!Shr->isExact() || ShAmtVal == TypeBits - 1))
return 0;
// Revisit the shift (to delete it).
@@ -2400,7 +2400,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
// fall-through
case Instruction::SDiv:
case Instruction::AShr:
- if (!BO0->isExact() && !BO1->isExact())
+ if (!BO0->isExact() || !BO1->isExact())
break;
return new ICmpInst(I.getPredicate(), BO0->getOperand(0),
BO1->getOperand(0));
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 432adc9..f499290 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -57,12 +57,14 @@ Instruction *InstCombiner::visitAllocaInst(AllocaInst &AI) {
Value *Idx[2];
Idx[0] = NullIdx;
Idx[1] = NullIdx;
- Value *V = GetElementPtrInst::CreateInBounds(New, Idx, Idx + 2,
- New->getName()+".sub", It);
+ Instruction *GEP =
+ GetElementPtrInst::CreateInBounds(New, Idx, Idx + 2,
+ New->getName()+".sub");
+ InsertNewInstBefore(GEP, *It);
// Now make everything use the getelementptr instead of the original
// allocation.
- return ReplaceInstUsesWith(AI, V);
+ return ReplaceInstUsesWith(AI, GEP);
} else if (isa<UndefValue>(AI.getArraySize())) {
return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
}
@@ -600,10 +602,12 @@ bool InstCombiner::SimplifyStoreAtEndOfBlock(StoreInst &SI) {
// Advance to a place where it is safe to insert the new store and
// insert it.
BBI = DestBB->getFirstNonPHI();
- InsertNewInstBefore(new StoreInst(MergedVal, SI.getOperand(1),
- OtherStore->isVolatile(),
- SI.getAlignment()), *BBI);
-
+ StoreInst *NewSI = new StoreInst(MergedVal, SI.getOperand(1),
+ OtherStore->isVolatile(),
+ SI.getAlignment());
+ InsertNewInstBefore(NewSI, *BBI);
+ NewSI->setDebugLoc(OtherStore->getDebugLoc());
+
// Nuke the old stores.
EraseInstFromFunction(SI);
EraseInstFromFunction(*OtherStore);
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 57fb08a..2d29403 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -19,6 +19,60 @@
using namespace llvm;
using namespace PatternMatch;
+
+/// simplifyValueKnownNonZero - The specific integer value is used in a context
+/// where it is known to be non-zero. If this allows us to simplify the
+/// computation, do so and return the new operand, otherwise return null.
+static Value *simplifyValueKnownNonZero(Value *V, InstCombiner &IC) {
+ // If V has multiple uses, then we would have to do more analysis to determine
+ // if this is safe. For example, the use could be in dynamically unreached
+ // code.
+ if (!V->hasOneUse()) return 0;
+
+ bool MadeChange = false;
+
+ // ((1 << A) >>u B) --> (1 << (A-B))
+ // Because V cannot be zero, we know that B is less than A.
+ Value *A = 0, *B = 0, *PowerOf2 = 0;
+ if (match(V, m_LShr(m_OneUse(m_Shl(m_Value(PowerOf2), m_Value(A))),
+ m_Value(B))) &&
+ // The "1" can be any value known to be a power of 2.
+ isPowerOfTwo(PowerOf2, IC.getTargetData())) {
+ A = IC.Builder->CreateSub(A, B, "tmp");
+ return IC.Builder->CreateShl(PowerOf2, A);
+ }
+
+ // (PowerOfTwo >>u B) --> isExact since shifting out the result would make it
+ // inexact. Similarly for <<.
+ if (BinaryOperator *I = dyn_cast<BinaryOperator>(V))
+ if (I->isLogicalShift() &&
+ isPowerOfTwo(I->getOperand(0), IC.getTargetData())) {
+ // We know that this is an exact/nuw shift and that the input is a
+ // non-zero context as well.
+ if (Value *V2 = simplifyValueKnownNonZero(I->getOperand(0), IC)) {
+ I->setOperand(0, V2);
+ MadeChange = true;
+ }
+
+ if (I->getOpcode() == Instruction::LShr && !I->isExact()) {
+ I->setIsExact();
+ MadeChange = true;
+ }
+
+ if (I->getOpcode() == Instruction::Shl && !I->hasNoUnsignedWrap()) {
+ I->setHasNoUnsignedWrap();
+ MadeChange = true;
+ }
+ }
+
+ // TODO: Lots more we could do here:
+ // If V is a phi node, we can call this on each of its operands.
+ // "select cond, X, 0" can simplify to "X".
+
+ return MadeChange ? V : 0;
+}
+
+
/// MultiplyOverflows - True if the multiply can not be expressed in an int
/// this size.
static bool MultiplyOverflows(ConstantInt *C1, ConstantInt *C2, bool sign) {
@@ -81,6 +135,29 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
return BinaryOperator::CreateAdd(Add, Builder->CreateMul(C1, CI));
}
}
+
+ // (Y - X) * (-(2**n)) -> (X - Y) * (2**n), for positive nonzero n
+ // (Y + const) * (-(2**n)) -> (-constY) * (2**n), for positive nonzero n
+ // The "* (2**n)" thus becomes a potential shifting opportunity.
+ {
+ const APInt & Val = CI->getValue();
+ const APInt &PosVal = Val.abs();
+ if (Val.isNegative() && PosVal.isPowerOf2()) {
+ Value *X = 0, *Y = 0;
+ if (Op0->hasOneUse()) {
+ ConstantInt *C1;
+ Value *Sub = 0;
+ if (match(Op0, m_Sub(m_Value(Y), m_Value(X))))
+ Sub = Builder->CreateSub(X, Y, "suba");
+ else if (match(Op0, m_Add(m_Value(Y), m_ConstantInt(C1))))
+ Sub = Builder->CreateSub(Builder->CreateNeg(C1), Y, "subc");
+ if (Sub)
+ return
+ BinaryOperator::CreateMul(Sub,
+ ConstantInt::get(Y->getType(), PosVal));
+ }
+ }
+ }
}
// Simplify mul instructions with a constant RHS.
@@ -293,6 +370,12 @@ bool InstCombiner::SimplifyDivRemOfSelect(BinaryOperator &I) {
Instruction *InstCombiner::commonIDivTransforms(BinaryOperator &I) {
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
+ // The RHS is known non-zero.
+ if (Value *V = simplifyValueKnownNonZero(I.getOperand(1), *this)) {
+ I.setOperand(1, V);
+ return &I;
+ }
+
// Handle cases involving: [su]div X, (select Cond, Y, Z)
// This does not apply for fdiv.
if (isa<SelectInst>(Op1) && SimplifyDivRemOfSelect(I))
@@ -499,11 +582,17 @@ Instruction *InstCombiner::visitFDiv(BinaryOperator &I) {
Instruction *InstCombiner::commonIRemTransforms(BinaryOperator &I) {
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
+ // The RHS is known non-zero.
+ if (Value *V = simplifyValueKnownNonZero(I.getOperand(1), *this)) {
+ I.setOperand(1, V);
+ return &I;
+ }
+
// Handle cases involving: rem X, (select Cond, Y, Z)
if (isa<SelectInst>(Op1) && SimplifyDivRemOfSelect(I))
return &I;
- if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
+ if (isa<ConstantInt>(Op1)) {
if (Instruction *Op0I = dyn_cast<Instruction>(Op0)) {
if (SelectInst *SI = dyn_cast<SelectInst>(Op0I)) {
if (Instruction *R = FoldOpIntoSelect(I, SI))
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
index abf61bb..3777340 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
@@ -110,16 +110,20 @@ Instruction *InstCombiner::FoldPHIArgBinOpIntoPHI(PHINode &PN) {
}
}
- if (CmpInst *CIOp = dyn_cast<CmpInst>(FirstInst))
- return CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(),
- LHSVal, RHSVal);
-
+ if (CmpInst *CIOp = dyn_cast<CmpInst>(FirstInst)) {
+ CmpInst *NewCI = CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(),
+ LHSVal, RHSVal);
+ NewCI->setDebugLoc(FirstInst->getDebugLoc());
+ return NewCI;
+ }
+
BinaryOperator *BinOp = cast<BinaryOperator>(FirstInst);
BinaryOperator *NewBinOp =
BinaryOperator::Create(BinOp->getOpcode(), LHSVal, RHSVal);
if (isNUW) NewBinOp->setHasNoUnsignedWrap();
if (isNSW) NewBinOp->setHasNoSignedWrap();
if (isExact) NewBinOp->setIsExact();
+ NewBinOp->setDebugLoc(FirstInst->getDebugLoc());
return NewBinOp;
}
@@ -228,6 +232,7 @@ Instruction *InstCombiner::FoldPHIArgGEPIntoPHI(PHINode &PN) {
GetElementPtrInst::Create(Base, FixedOperands.begin()+1,
FixedOperands.end());
if (AllInBounds) NewGEP->setIsInBounds();
+ NewGEP->setDebugLoc(FirstInst->getDebugLoc());
return NewGEP;
}
@@ -369,7 +374,9 @@ Instruction *InstCombiner::FoldPHIArgLoadIntoPHI(PHINode &PN) {
for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
cast<LoadInst>(PN.getIncomingValue(i))->setVolatile(false);
- return new LoadInst(PhiVal, "", isVolatile, LoadAlignment);
+ LoadInst *NewLI = new LoadInst(PhiVal, "", isVolatile, LoadAlignment);
+ NewLI->setDebugLoc(FirstLI->getDebugLoc());
+ return NewLI;
}
@@ -469,20 +476,27 @@ Instruction *InstCombiner::FoldPHIArgOpIntoPHI(PHINode &PN) {
}
// Insert and return the new operation.
- if (CastInst *FirstCI = dyn_cast<CastInst>(FirstInst))
- return CastInst::Create(FirstCI->getOpcode(), PhiVal, PN.getType());
+ if (CastInst *FirstCI = dyn_cast<CastInst>(FirstInst)) {
+ CastInst *NewCI = CastInst::Create(FirstCI->getOpcode(), PhiVal,
+ PN.getType());
+ NewCI->setDebugLoc(FirstInst->getDebugLoc());
+ return NewCI;
+ }
if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(FirstInst)) {
BinOp = BinaryOperator::Create(BinOp->getOpcode(), PhiVal, ConstantOp);
if (isNUW) BinOp->setHasNoUnsignedWrap();
if (isNSW) BinOp->setHasNoSignedWrap();
if (isExact) BinOp->setIsExact();
+ BinOp->setDebugLoc(FirstInst->getDebugLoc());
return BinOp;
}
CmpInst *CIOp = cast<CmpInst>(FirstInst);
- return CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(),
- PhiVal, ConstantOp);
+ CmpInst *NewCI = CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(),
+ PhiVal, ConstantOp);
+ NewCI->setDebugLoc(FirstInst->getDebugLoc());
+ return NewCI;
}
/// DeadPHICycle - Return true if this PHI node is only used by a PHI node cycle
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 61a433a..aeb3c3e 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -133,9 +133,8 @@ Instruction *InstCombiner::FoldSelectOpOp(SelectInst &SI, Instruction *TI,
}
// Fold this by inserting a select from the input values.
- SelectInst *NewSI = SelectInst::Create(SI.getCondition(), TI->getOperand(0),
- FI->getOperand(0), SI.getName()+".v");
- InsertNewInstBefore(NewSI, SI);
+ Value *NewSI = Builder->CreateSelect(SI.getCondition(), TI->getOperand(0),
+ FI->getOperand(0), SI.getName()+".v");
return CastInst::Create(Instruction::CastOps(TI->getOpcode()), NewSI,
TI->getType());
}
@@ -174,9 +173,8 @@ Instruction *InstCombiner::FoldSelectOpOp(SelectInst &SI, Instruction *TI,
}
// If we reach here, they do have operations in common.
- SelectInst *NewSI = SelectInst::Create(SI.getCondition(), OtherOpT,
- OtherOpF, SI.getName()+".v");
- InsertNewInstBefore(NewSI, SI);
+ Value *NewSI = Builder->CreateSelect(SI.getCondition(), OtherOpT,
+ OtherOpF, SI.getName()+".v");
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TI)) {
if (MatchIsOpZero)
@@ -224,8 +222,7 @@ Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal,
// Avoid creating select between 2 constants unless it's selecting
// between 0, 1 and -1.
if (!isa<Constant>(OOp) || isSelect01(C, cast<Constant>(OOp))) {
- Instruction *NewSel = SelectInst::Create(SI.getCondition(), OOp, C);
- InsertNewInstBefore(NewSel, SI);
+ Value *NewSel = Builder->CreateSelect(SI.getCondition(), OOp, C);
NewSel->takeName(TVI);
BinaryOperator *TVI_BO = cast<BinaryOperator>(TVI);
BinaryOperator *BO = BinaryOperator::Create(TVI_BO->getOpcode(),
@@ -260,8 +257,7 @@ Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal,
// Avoid creating select between 2 constants unless it's selecting
// between 0, 1 and -1.
if (!isa<Constant>(OOp) || isSelect01(C, cast<Constant>(OOp))) {
- Instruction *NewSel = SelectInst::Create(SI.getCondition(), C, OOp);
- InsertNewInstBefore(NewSel, SI);
+ Value *NewSel = Builder->CreateSelect(SI.getCondition(), C, OOp);
NewSel->takeName(FVI);
BinaryOperator *FVI_BO = cast<BinaryOperator>(FVI);
BinaryOperator *BO = BinaryOperator::Create(FVI_BO->getOpcode(),
@@ -282,6 +278,59 @@ Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal,
return 0;
}
+/// SimplifyWithOpReplaced - See if V simplifies when its operand Op is
+/// replaced with RepOp.
+static Value *SimplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
+ const TargetData *TD) {
+ // Trivial replacement.
+ if (V == Op)
+ return RepOp;
+
+ Instruction *I = dyn_cast<Instruction>(V);
+ if (!I)
+ return 0;
+
+ // If this is a binary operator, try to simplify it with the replaced op.
+ if (BinaryOperator *B = dyn_cast<BinaryOperator>(I)) {
+ if (B->getOperand(0) == Op)
+ return SimplifyBinOp(B->getOpcode(), RepOp, B->getOperand(1), TD);
+ if (B->getOperand(1) == Op)
+ return SimplifyBinOp(B->getOpcode(), B->getOperand(0), RepOp, TD);
+ }
+
+ // Same for CmpInsts.
+ if (CmpInst *C = dyn_cast<CmpInst>(I)) {
+ if (C->getOperand(0) == Op)
+ return SimplifyCmpInst(C->getPredicate(), RepOp, C->getOperand(1), TD);
+ if (C->getOperand(1) == Op)
+ return SimplifyCmpInst(C->getPredicate(), C->getOperand(0), RepOp, TD);
+ }
+
+ // TODO: We could hand off more cases to instsimplify here.
+
+ // If all operands are constant after substituting Op for RepOp then we can
+ // constant fold the instruction.
+ if (Constant *CRepOp = dyn_cast<Constant>(RepOp)) {
+ // Build a list of all constant operands.
+ SmallVector<Constant*, 8> ConstOps;
+ for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
+ if (I->getOperand(i) == Op)
+ ConstOps.push_back(CRepOp);
+ else if (Constant *COp = dyn_cast<Constant>(I->getOperand(i)))
+ ConstOps.push_back(COp);
+ else
+ break;
+ }
+
+ // All operands were constants, fold it.
+ if (ConstOps.size() == I->getNumOperands())
+ return ConstantFoldInstOperands(I->getOpcode(), I->getType(),
+ ConstOps.data(), ConstOps.size(), TD);
+ }
+
+ return 0;
+}
+
/// visitSelectInstWithICmp - Visit a SelectInst that has an
/// ICmpInst as its first operand.
///
@@ -420,25 +469,21 @@ Instruction *InstCombiner::visitSelectInstWithICmp(SelectInst &SI,
}
}
- if (CmpLHS == TrueVal && CmpRHS == FalseVal) {
- // Transform (X == Y) ? X : Y -> Y
- if (Pred == ICmpInst::ICMP_EQ)
+ // If we have an equality comparison then we know the value in one of the
+ // arms of the select. See if substituting this value into the arm and
+ // simplifying the result yields the same value as the other arm.
+ if (Pred == ICmpInst::ICMP_EQ) {
+ if (SimplifyWithOpReplaced(FalseVal, CmpLHS, CmpRHS, TD) == TrueVal ||
+ SimplifyWithOpReplaced(FalseVal, CmpRHS, CmpLHS, TD) == TrueVal)
return ReplaceInstUsesWith(SI, FalseVal);
- // Transform (X != Y) ? X : Y -> X
- if (Pred == ICmpInst::ICMP_NE)
+ } else if (Pred == ICmpInst::ICMP_NE) {
+ if (SimplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, TD) == FalseVal ||
+ SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, TD) == FalseVal)
return ReplaceInstUsesWith(SI, TrueVal);
- /// NOTE: if we wanted to, this is where to detect integer MIN/MAX
-
- } else if (CmpLHS == FalseVal && CmpRHS == TrueVal) {
- // Transform (X == Y) ? Y : X -> X
- if (Pred == ICmpInst::ICMP_EQ)
- return ReplaceInstUsesWith(SI, FalseVal);
- // Transform (X != Y) ? Y : X -> Y
- if (Pred == ICmpInst::ICMP_NE)
- return ReplaceInstUsesWith(SI, TrueVal);
- /// NOTE: if we wanted to, this is where to detect integer MIN/MAX
}
+ // NOTE: if we wanted to, this is where to detect integer MIN/MAX
+
if (isa<Constant>(CmpRHS)) {
if (CmpLHS == TrueVal && Pred == ICmpInst::ICMP_EQ) {
// Transform (X == C) ? X : Y -> (X == C) ? C : Y
@@ -604,9 +649,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
return BinaryOperator::CreateOr(CondVal, FalseVal);
}
// Change: A = select B, false, C --> A = and !B, C
- Value *NotCond =
- InsertNewInstBefore(BinaryOperator::CreateNot(CondVal,
- "not."+CondVal->getName()), SI);
+ Value *NotCond = Builder->CreateNot(CondVal, "not."+CondVal->getName());
return BinaryOperator::CreateAnd(NotCond, FalseVal);
} else if (ConstantInt *C = dyn_cast<ConstantInt>(FalseVal)) {
if (C->getZExtValue() == false) {
@@ -614,9 +657,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
return BinaryOperator::CreateAnd(CondVal, TrueVal);
}
// Change: A = select B, C, true --> A = or !B, C
- Value *NotCond =
- InsertNewInstBefore(BinaryOperator::CreateNot(CondVal,
- "not."+CondVal->getName()), SI);
+ Value *NotCond = Builder->CreateNot(CondVal, "not."+CondVal->getName());
return BinaryOperator::CreateOr(NotCond, TrueVal);
}
@@ -755,27 +796,20 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
// So at this point we know we have (Y -> OtherAddOp):
// select C, (add X, Y), (sub X, Z)
Value *NegVal; // Compute -Z
- if (Constant *C = dyn_cast<Constant>(SubOp->getOperand(1))) {
- NegVal = ConstantExpr::getNeg(C);
- } else if (SI.getType()->isFloatingPointTy()) {
- NegVal = InsertNewInstBefore(
- BinaryOperator::CreateFNeg(SubOp->getOperand(1),
- "tmp"), SI);
+ if (SI.getType()->isFloatingPointTy()) {
+ NegVal = Builder->CreateFNeg(SubOp->getOperand(1));
} else {
- NegVal = InsertNewInstBefore(
- BinaryOperator::CreateNeg(SubOp->getOperand(1),
- "tmp"), SI);
+ NegVal = Builder->CreateNeg(SubOp->getOperand(1));
}
Value *NewTrueOp = OtherAddOp;
Value *NewFalseOp = NegVal;
if (AddOp != TI)
std::swap(NewTrueOp, NewFalseOp);
- Instruction *NewSel =
- SelectInst::Create(CondVal, NewTrueOp,
- NewFalseOp, SI.getName() + ".p");
+ Value *NewSel =
+ Builder->CreateSelect(CondVal, NewTrueOp,
+ NewFalseOp, SI.getName() + ".p");
- NewSel = InsertNewInstBefore(NewSel, SI);
if (SI.getType()->isFloatingPointTy())
return BinaryOperator::CreateFAdd(SubOp->getOperand(0), NewSel);
else
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
index 6e727ce..8fea8eb 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
@@ -313,7 +313,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
Instruction *Or =
BinaryOperator::CreateOr(I->getOperand(0), I->getOperand(1),
I->getName());
- return InsertNewInstBefore(Or, *I);
+ return InsertNewInstWith(Or, *I);
}
// If all of the demanded bits on one side are known, and all of the set
@@ -327,7 +327,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
~RHSKnownOne & DemandedMask);
Instruction *And =
BinaryOperator::CreateAnd(I->getOperand(0), AndC, "tmp");
- return InsertNewInstBefore(And, *I);
+ return InsertNewInstWith(And, *I);
}
}
@@ -353,13 +353,13 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
ConstantInt::get(I->getType(), NewMask & AndRHS->getValue());
Instruction *NewAnd =
BinaryOperator::CreateAnd(I->getOperand(0), AndC, "tmp");
- InsertNewInstBefore(NewAnd, *I);
+ InsertNewInstWith(NewAnd, *I);
Constant *XorC =
ConstantInt::get(I->getType(), NewMask & XorRHS->getValue());
Instruction *NewXor =
BinaryOperator::CreateXor(NewAnd, XorC, "tmp");
- return InsertNewInstBefore(NewXor, *I);
+ return InsertNewInstWith(NewXor, *I);
}
// Output known-0 bits are known if clear or set in both the LHS & RHS.
@@ -472,7 +472,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
if (KnownZero[SrcBitWidth-1] || (NewBits & ~DemandedMask) == NewBits) {
// Convert to ZExt cast
CastInst *NewCast = new ZExtInst(I->getOperand(0), VTy, I->getName());
- return InsertNewInstBefore(NewCast, *I);
+ return InsertNewInstWith(NewCast, *I);
} else if (KnownOne[SrcBitWidth-1]) { // Input sign bit known set
KnownOne |= NewBits;
}
@@ -515,7 +515,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
Instruction *Or =
BinaryOperator::CreateOr(I->getOperand(0), I->getOperand(1),
I->getName());
- return InsertNewInstBefore(Or, *I);
+ return InsertNewInstWith(Or, *I);
}
// We can say something about the output known-zero and known-one bits,
@@ -632,7 +632,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
// Perform the logical shift right.
Instruction *NewVal = BinaryOperator::CreateLShr(
I->getOperand(0), I->getOperand(1), I->getName());
- return InsertNewInstBefore(NewVal, *I);
+ return InsertNewInstWith(NewVal, *I);
}
// If the sign bit is the only bit demanded by this ashr, then there is no
@@ -676,7 +676,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
// Perform the logical shift right.
Instruction *NewVal = BinaryOperator::CreateLShr(
I->getOperand(0), SA, I->getName());
- return InsertNewInstBefore(NewVal, *I);
+ return InsertNewInstWith(NewVal, *I);
} else if ((KnownOne & SignBit) != 0) { // New bits are known one.
KnownOne |= HighBits;
}
@@ -774,12 +774,16 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
NewVal = BinaryOperator::CreateShl(II->getArgOperand(0),
ConstantInt::get(I->getType(), ResultBit-InputBit));
NewVal->takeName(I);
- return InsertNewInstBefore(NewVal, *I);
+ return InsertNewInstWith(NewVal, *I);
}
// TODO: Could compute known zero/one bits based on the input.
break;
}
+ case Intrinsic::x86_sse42_crc32_64_8:
+ case Intrinsic::x86_sse42_crc32_64_64:
+ KnownZero = APInt::getHighBitsSet(64, 32);
+ return 0;
}
}
ComputeMaskedBits(V, DemandedMask, KnownZero, KnownOne, Depth);
@@ -867,7 +871,7 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
if (Depth == 10)
return 0;
- // If multiple users are using the root value, procede with
+ // If multiple users are using the root value, proceed with
// simplification conservatively assuming that all elements
// are needed.
if (!V->hasOneUse()) {
@@ -1108,21 +1112,21 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
Value *LHS = II->getArgOperand(0);
Value *RHS = II->getArgOperand(1);
// Extract the element as scalars.
- LHS = InsertNewInstBefore(ExtractElementInst::Create(LHS,
+ LHS = InsertNewInstWith(ExtractElementInst::Create(LHS,
ConstantInt::get(Type::getInt32Ty(I->getContext()), 0U)), *II);
- RHS = InsertNewInstBefore(ExtractElementInst::Create(RHS,
+ RHS = InsertNewInstWith(ExtractElementInst::Create(RHS,
ConstantInt::get(Type::getInt32Ty(I->getContext()), 0U)), *II);
switch (II->getIntrinsicID()) {
default: llvm_unreachable("Case stmts out of sync!");
case Intrinsic::x86_sse_sub_ss:
case Intrinsic::x86_sse2_sub_sd:
- TmpV = InsertNewInstBefore(BinaryOperator::CreateFSub(LHS, RHS,
+ TmpV = InsertNewInstWith(BinaryOperator::CreateFSub(LHS, RHS,
II->getName()), *II);
break;
case Intrinsic::x86_sse_mul_ss:
case Intrinsic::x86_sse2_mul_sd:
- TmpV = InsertNewInstBefore(BinaryOperator::CreateFMul(LHS, RHS,
+ TmpV = InsertNewInstWith(BinaryOperator::CreateFMul(LHS, RHS,
II->getName()), *II);
break;
}
@@ -1132,7 +1136,7 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
UndefValue::get(II->getType()), TmpV,
ConstantInt::get(Type::getInt32Ty(I->getContext()), 0U, false),
II->getName());
- InsertNewInstBefore(New, *II);
+ InsertNewInstWith(New, *II);
return New;
}
}
diff --git a/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 7a84598..92c10f5 100644
--- a/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -240,9 +240,9 @@ bool InstCombiner::SimplifyAssociativeOrCommutative(BinaryOperator &I) {
Constant *C2 = cast<Constant>(Op1->getOperand(1));
Constant *Folded = ConstantExpr::get(Opcode, C1, C2);
- Instruction *New = BinaryOperator::Create(Opcode, A, B, Op1->getName(),
- &I);
- Worklist.Add(New);
+ Instruction *New = BinaryOperator::Create(Opcode, A, B);
+ InsertNewInstWith(New, I);
+ New->takeName(Op1);
I.setOperand(0, New);
I.setOperand(1, Folded);
// Conservatively clear the optional flags, since they may not be
@@ -599,7 +599,7 @@ Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I) {
}
// Okay, we can do the transformation: create the new PHI node.
- PHINode *NewPN = PHINode::Create(I.getType(), PN->getNumIncomingValues(), "");
+ PHINode *NewPN = PHINode::Create(I.getType(), PN->getNumIncomingValues());
InsertNewInstBefore(NewPN, *PN);
NewPN->takeName(PN);
@@ -1088,8 +1088,8 @@ Instruction *InstCombiner::visitFree(CallInst &FI) {
// free undef -> unreachable.
if (isa<UndefValue>(Op)) {
// Insert a new store to null because we cannot modify the CFG here.
- new StoreInst(ConstantInt::getTrue(FI.getContext()),
- UndefValue::get(Type::getInt1PtrTy(FI.getContext())), &FI);
+ Builder->CreateStore(ConstantInt::getTrue(FI.getContext()),
+ UndefValue::get(Type::getInt1PtrTy(FI.getContext())));
return EraseInstFromFunction(FI);
}
@@ -1261,7 +1261,7 @@ Instruction *InstCombiner::visitExtractValueInst(ExtractValueInst &EV) {
case Intrinsic::sadd_with_overflow:
if (*EV.idx_begin() == 0) { // Normal result.
Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
- II->replaceAllUsesWith(UndefValue::get(II->getType()));
+ ReplaceInstUsesWith(*II, UndefValue::get(II->getType()));
EraseInstFromFunction(*II);
return BinaryOperator::CreateAdd(LHS, RHS);
}
@@ -1278,7 +1278,7 @@ Instruction *InstCombiner::visitExtractValueInst(ExtractValueInst &EV) {
case Intrinsic::ssub_with_overflow:
if (*EV.idx_begin() == 0) { // Normal result.
Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
- II->replaceAllUsesWith(UndefValue::get(II->getType()));
+ ReplaceInstUsesWith(*II, UndefValue::get(II->getType()));
EraseInstFromFunction(*II);
return BinaryOperator::CreateSub(LHS, RHS);
}
@@ -1287,7 +1287,7 @@ Instruction *InstCombiner::visitExtractValueInst(ExtractValueInst &EV) {
case Intrinsic::smul_with_overflow:
if (*EV.idx_begin() == 0) { // Normal result.
Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
- II->replaceAllUsesWith(UndefValue::get(II->getType()));
+ ReplaceInstUsesWith(*II, UndefValue::get(II->getType()));
EraseInstFromFunction(*II);
return BinaryOperator::CreateMul(LHS, RHS);
}
@@ -1385,8 +1385,8 @@ static bool AddReachableCodeToWorklist(BasicBlock *BB,
Worklist.push_back(BB);
SmallVector<Instruction*, 128> InstrsForInstCombineWorklist;
- SmallPtrSet<ConstantExpr*, 64> FoldedConstants;
-
+ DenseMap<ConstantExpr*, Constant*> FoldedConstants;
+
do {
BB = Worklist.pop_back_val();
@@ -1421,14 +1421,15 @@ static bool AddReachableCodeToWorklist(BasicBlock *BB,
i != e; ++i) {
ConstantExpr *CE = dyn_cast<ConstantExpr>(i);
if (CE == 0) continue;
-
- // If we already folded this constant, don't try again.
- if (!FoldedConstants.insert(CE))
- continue;
-
- Constant *NewC = ConstantFoldConstantExpression(CE, TD);
- if (NewC && NewC != CE) {
- *i = NewC;
+
+ Constant*& FoldRes = FoldedConstants[CE];
+ if (!FoldRes)
+ FoldRes = ConstantFoldConstantExpression(CE, TD);
+ if (!FoldRes)
+ FoldRes = CE;
+
+ if (FoldRes != CE) {
+ *i = FoldRes;
MadeIRChange = true;
}
}
@@ -1575,6 +1576,7 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
// Now that we have an instruction, try combining it to simplify it.
Builder->SetInsertPoint(I->getParent(), I);
+ Builder->SetCurrentDebugLocation(I->getDebugLoc());
#ifndef NDEBUG
std::string OrigI;
@@ -1589,7 +1591,8 @@ bool InstCombiner::DoOneIteration(Function &F, unsigned Iteration) {
DEBUG(errs() << "IC: Old = " << *I << '\n'
<< " New = " << *Result << '\n');
- Result->setDebugLoc(I->getDebugLoc());
+ if (!I->getDebugLoc().isUnknown())
+ Result->setDebugLoc(I->getDebugLoc());
// Everything uses the new instruction now.
I->replaceAllUsesWith(Result);
diff --git a/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
index 2425342..b902213 100644
--- a/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+++ b/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
@@ -40,15 +40,15 @@ using namespace llvm;
namespace {
class GCOVProfiler : public ModulePass {
- bool runOnModule(Module &M);
public:
static char ID;
GCOVProfiler()
- : ModulePass(ID), EmitNotes(true), EmitData(true) {
+ : ModulePass(ID), EmitNotes(true), EmitData(true), Use402Format(false) {
initializeGCOVProfilerPass(*PassRegistry::getPassRegistry());
}
- GCOVProfiler(bool EmitNotes, bool EmitData)
- : ModulePass(ID), EmitNotes(EmitNotes), EmitData(EmitData) {
+ GCOVProfiler(bool EmitNotes, bool EmitData, bool use402Format = false)
+ : ModulePass(ID), EmitNotes(EmitNotes), EmitData(EmitData),
+ Use402Format(use402Format) {
assert((EmitNotes || EmitData) && "GCOVProfiler asked to do nothing?");
initializeGCOVProfilerPass(*PassRegistry::getPassRegistry());
}
@@ -57,6 +57,8 @@ namespace {
}
private:
+ bool runOnModule(Module &M);
+
// Create the GCNO files for the Module based on DebugInfo.
void emitGCNO(DebugInfoFinder &DIF);
@@ -86,10 +88,13 @@ namespace {
// list.
void insertCounterWriteout(DebugInfoFinder &,
SmallVector<std::pair<GlobalVariable *,
- uint32_t>, 8> &);
+ MDNode *>, 8> &);
+
+ std::string mangleName(DICompileUnit CU, std::string NewStem);
bool EmitNotes;
bool EmitData;
+ bool Use402Format;
Module *M;
LLVMContext *Ctx;
@@ -100,8 +105,9 @@ char GCOVProfiler::ID = 0;
INITIALIZE_PASS(GCOVProfiler, "insert-gcov-profiling",
"Insert instrumentation for GCOV profiling", false, false)
-ModulePass *llvm::createGCOVProfilerPass(bool EmitNotes, bool EmitData) {
- return new GCOVProfiler(EmitNotes, EmitData);
+ModulePass *llvm::createGCOVProfilerPass(bool EmitNotes, bool EmitData,
+ bool Use402Format) {
+ return new GCOVProfiler(EmitNotes, EmitData, Use402Format);
}
static DISubprogram findSubprogram(DIScope Scope) {
@@ -137,7 +143,7 @@ namespace {
// A GCOV string is a length, followed by a NUL, then between 0 and 3 NULs
// padding out to the next 4-byte word. The length is measured in 4-byte
// words including padding, not bytes of actual string.
- return (s.size() + 5) / 4;
+ return (s.size() / 4) + 1;
}
void writeGCOVString(StringRef s) {
@@ -247,7 +253,7 @@ namespace {
// object users can construct, the blocks and lines will be rooted here.
class GCOVFunction : public GCOVRecord {
public:
- GCOVFunction(DISubprogram SP, raw_ostream *os) {
+ GCOVFunction(DISubprogram SP, raw_ostream *os, bool Use402Format) {
this->os = os;
Function *F = SP.getFunction();
@@ -260,10 +266,14 @@ namespace {
writeBytes(FunctionTag, 4);
uint32_t BlockLen = 1 + 1 + 1 + lengthOfGCOVString(SP.getName()) +
1 + lengthOfGCOVString(SP.getFilename()) + 1;
+ if (!Use402Format)
+ ++BlockLen; // For second checksum.
write(BlockLen);
uint32_t Ident = reinterpret_cast<intptr_t>((MDNode*)SP);
write(Ident);
- write(0); // checksum
+ write(0); // checksum #1
+ if (!Use402Format)
+ write(0); // checksum #2
writeGCOVString(SP.getName());
writeGCOVString(SP.getFilename());
write(SP.getLineNumber());
@@ -318,9 +328,25 @@ namespace {
};
}
-// Replace the stem of a file, or add one if missing.
-static std::string replaceStem(std::string OrigFilename, std::string NewStem) {
- return (sys::path::stem(OrigFilename) + "." + NewStem).str();
+std::string GCOVProfiler::mangleName(DICompileUnit CU, std::string NewStem) {
+ if (NamedMDNode *GCov = M->getNamedMetadata("llvm.gcov")) {
+ for (int i = 0, e = GCov->getNumOperands(); i != e; ++i) {
+ MDNode *N = GCov->getOperand(i);
+ if (N->getNumOperands() != 2) continue;
+ MDString *GCovFile = dyn_cast<MDString>(N->getOperand(0));
+ MDNode *CompileUnit = dyn_cast<MDNode>(N->getOperand(1));
+ if (!GCovFile || !CompileUnit) continue;
+ if (CompileUnit == CU) {
+ SmallString<128> Filename = GCovFile->getString();
+ sys::path::replace_extension(Filename, NewStem);
+ return Filename.str();
+ }
+ }
+ }
+
+ SmallString<128> Filename = CU.getFilename();
+ sys::path::replace_extension(Filename, NewStem);
+ return sys::path::filename(Filename.str());
}
bool GCOVProfiler::runOnModule(Module &M) {
@@ -346,9 +372,12 @@ void GCOVProfiler::emitGCNO(DebugInfoFinder &DIF) {
DICompileUnit CU(*I);
raw_fd_ostream *&out = GcnoFiles[CU];
std::string ErrorInfo;
- out = new raw_fd_ostream(replaceStem(CU.getFilename(), "gcno").c_str(),
- ErrorInfo, raw_fd_ostream::F_Binary);
- out->write("oncg*404MVLL", 12);
+ out = new raw_fd_ostream(mangleName(CU, "gcno").c_str(), ErrorInfo,
+ raw_fd_ostream::F_Binary);
+ if (!Use402Format)
+ out->write("oncg*404MVLL", 12);
+ else
+ out->write("oncg*402MVLL", 12);
}
for (DebugInfoFinder::iterator SPI = DIF.subprogram_begin(),
@@ -358,7 +387,7 @@ void GCOVProfiler::emitGCNO(DebugInfoFinder &DIF) {
Function *F = SP.getFunction();
if (!F) continue;
- GCOVFunction Func(SP, os);
+ GCOVFunction Func(SP, os, Use402Format);
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
GCOVBlock &Block = Func.getBlock(BB);
@@ -399,7 +428,7 @@ bool GCOVProfiler::emitProfileArcs(DebugInfoFinder &DIF) {
if (DIF.subprogram_begin() == DIF.subprogram_end())
return false;
- SmallVector<std::pair<GlobalVariable *, uint32_t>, 8> CountersByIdent;
+ SmallVector<std::pair<GlobalVariable *, MDNode *>, 8> CountersBySP;
for (DebugInfoFinder::iterator SPI = DIF.subprogram_begin(),
SPE = DIF.subprogram_end(); SPI != SPE; ++SPI) {
DISubprogram SP(*SPI);
@@ -422,8 +451,7 @@ bool GCOVProfiler::emitProfileArcs(DebugInfoFinder &DIF) {
GlobalValue::InternalLinkage,
Constant::getNullValue(CounterTy),
"__llvm_gcov_ctr", 0, false, 0);
- CountersByIdent.push_back(
- std::make_pair(Counters, reinterpret_cast<intptr_t>((MDNode*)SP)));
+ CountersBySP.push_back(std::make_pair(Counters, (MDNode*)SP));
UniqueVector<BasicBlock *> ComplexEdgePreds;
UniqueVector<BasicBlock *> ComplexEdgeSuccs;
@@ -490,7 +518,7 @@ bool GCOVProfiler::emitProfileArcs(DebugInfoFinder &DIF) {
}
}
- insertCounterWriteout(DIF, CountersByIdent);
+ insertCounterWriteout(DIF, CountersBySP);
return true;
}
@@ -561,7 +589,10 @@ Constant *GCOVProfiler::getIncrementIndirectCounterFunc() {
}
Constant *GCOVProfiler::getEmitFunctionFunc() {
- const Type *Args[] = { Type::getInt32Ty(*Ctx) };
+ const Type *Args[2] = {
+ Type::getInt32Ty(*Ctx), // uint32_t ident
+ Type::getInt8PtrTy(*Ctx), // const char *function_name
+ };
const FunctionType *FTy = FunctionType::get(Type::getVoidTy(*Ctx),
Args, false);
return M->getOrInsertFunction("llvm_gcda_emit_function", FTy);
@@ -597,7 +628,7 @@ GlobalVariable *GCOVProfiler::getEdgeStateValue() {
void GCOVProfiler::insertCounterWriteout(
DebugInfoFinder &DIF,
- SmallVector<std::pair<GlobalVariable *, uint32_t>, 8> &CountersByIdent) {
+ SmallVector<std::pair<GlobalVariable *, MDNode *>, 8> &CountersBySP) {
const FunctionType *WriteoutFTy =
FunctionType::get(Type::getVoidTy(*Ctx), false);
Function *WriteoutF = Function::Create(WriteoutFTy,
@@ -615,14 +646,18 @@ void GCOVProfiler::insertCounterWriteout(
for (DebugInfoFinder::iterator CUI = DIF.compile_unit_begin(),
CUE = DIF.compile_unit_end(); CUI != CUE; ++CUI) {
DICompileUnit compile_unit(*CUI);
- std::string FilenameGcda = replaceStem(compile_unit.getFilename(), "gcda");
+ std::string FilenameGcda = mangleName(compile_unit, "gcda");
Builder.CreateCall(StartFile,
Builder.CreateGlobalStringPtr(FilenameGcda));
- for (SmallVector<std::pair<GlobalVariable *, uint32_t>, 8>::iterator
- I = CountersByIdent.begin(), E = CountersByIdent.end();
+ for (SmallVector<std::pair<GlobalVariable *, MDNode *>, 8>::iterator
+ I = CountersBySP.begin(), E = CountersBySP.end();
I != E; ++I) {
- Builder.CreateCall(EmitFunction, ConstantInt::get(Type::getInt32Ty(*Ctx),
- I->second));
+ DISubprogram SP(I->second);
+ intptr_t ident = reinterpret_cast<intptr_t>(I->second);
+ Builder.CreateCall2(EmitFunction,
+ ConstantInt::get(Type::getInt32Ty(*Ctx), ident),
+ Builder.CreateGlobalStringPtr(SP.getName()));
+
GlobalVariable *GV = I->first;
unsigned Arcs =
cast<ArrayType>(GV->getType()->getElementType())->getNumElements();
diff --git a/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp b/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp
index 6b3f12d..182a43d 100644
--- a/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp
+++ b/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp
@@ -1351,8 +1351,6 @@ bool PathProfiler::runOnModule(Module &M) {
return false;
}
- BasicBlock::iterator insertPoint = Main->getEntryBlock().getFirstNonPHI();
-
llvmIncrementHashFunction = M.getOrInsertFunction(
"llvm_increment_path_count",
Type::getVoidTy(*Context), // return type
diff --git a/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 0184390..0af14ed 100644
--- a/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -147,7 +147,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
if (!DisableBranchOpts) {
MadeChange = false;
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
- MadeChange |= ConstantFoldTerminator(BB);
+ MadeChange |= ConstantFoldTerminator(BB, true);
if (MadeChange)
ModifiedDT = true;
@@ -371,9 +371,11 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){
// If these values will be promoted, find out what they will be promoted
// to. This helps us consider truncates on PPC as noop copies when they
// are.
- if (TLI.getTypeAction(SrcVT) == TargetLowering::Promote)
+ if (TLI.getTypeAction(CI->getContext(), SrcVT) ==
+ TargetLowering::TypePromoteInteger)
SrcVT = TLI.getTypeToTransformTo(CI->getContext(), SrcVT);
- if (TLI.getTypeAction(DstVT) == TargetLowering::Promote)
+ if (TLI.getTypeAction(CI->getContext(), DstVT) ==
+ TargetLowering::TypePromoteInteger)
DstVT = TLI.getTypeToTransformTo(CI->getContext(), DstVT);
// If, after promotion, these are the same types, this is a noop copy.
@@ -548,7 +550,23 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) {
// From here on out we're working with named functions.
if (CI->getCalledFunction() == 0) return false;
-
+
+ // llvm.dbg.value is far away from the value then iSel may not be able
+ // handle it properly. iSel will drop llvm.dbg.value if it can not
+ // find a node corresponding to the value.
+ if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(CI))
+ if (Instruction *VI = dyn_cast_or_null<Instruction>(DVI->getValue()))
+ if (!VI->isTerminator() &&
+ (DVI->getParent() != VI->getParent() || DT->dominates(DVI, VI))) {
+ DEBUG(dbgs() << "Moving Debug Value before :\n" << *DVI << ' ' << *VI);
+ DVI->removeFromParent();
+ if (isa<PHINode>(VI))
+ DVI->insertBefore(VI->getParent()->getFirstNonPHI());
+ else
+ DVI->insertAfter(VI);
+ return true;
+ }
+
// We'll need TargetData from here on out.
const TargetData *TD = TLI ? TLI->getTargetData() : 0;
if (!TD) return false;
diff --git a/contrib/llvm/lib/Transforms/Scalar/GVN.cpp b/contrib/llvm/lib/Transforms/Scalar/GVN.cpp
index efecb97..2515fd1 100644
--- a/contrib/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -952,12 +952,12 @@ static Value *GetLoadValueForLoad(LoadInst *SrcVal, unsigned Offset,
IntegerType::get(LoadTy->getContext(), NewLoadSize*8);
DestPTy = PointerType::get(DestPTy,
cast<PointerType>(PtrVal->getType())->getAddressSpace());
-
+ Builder.SetCurrentDebugLocation(SrcVal->getDebugLoc());
PtrVal = Builder.CreateBitCast(PtrVal, DestPTy);
LoadInst *NewLoad = Builder.CreateLoad(PtrVal);
NewLoad->takeName(SrcVal);
NewLoad->setAlignment(SrcVal->getAlignment());
-
+
DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n");
DEBUG(dbgs() << "TO: " << *NewLoad << "\n");
@@ -1576,6 +1576,9 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
if (MDNode *Tag = LI->getMetadata(LLVMContext::MD_tbaa))
NewLoad->setMetadata(LLVMContext::MD_tbaa, Tag);
+ // Transfer DebugLoc.
+ NewLoad->setDebugLoc(LI->getDebugLoc());
+
// Add the newly created load.
ValuesPerBlock.push_back(AvailableValueInBlock::get(UnavailablePred,
NewLoad));
@@ -1604,6 +1607,11 @@ bool GVN::processLoad(LoadInst *L) {
if (L->isVolatile())
return false;
+ if (L->use_empty()) {
+ markInstructionForDeletion(L);
+ return true;
+ }
+
// ... to a pointer that has been loaded from before...
MemDepResult Dep = MD->getDependency(L);
@@ -2099,6 +2107,7 @@ bool GVN::performPRE(Function &F) {
PREInstr->insertBefore(PREPred->getTerminator());
PREInstr->setName(CurInst->getName() + ".pre");
+ PREInstr->setDebugLoc(CurInst->getDebugLoc());
predMap[PREPred] = PREInstr;
VN.add(PREInstr, ValNo);
++NumGVNPRE;
@@ -2118,7 +2127,7 @@ bool GVN::performPRE(Function &F) {
VN.add(Phi, ValNo);
addToLeaderTable(ValNo, Phi, CurrentBlock);
-
+ Phi->setDebugLoc(CurInst->getDebugLoc());
CurInst->replaceAllUsesWith(Phi);
if (Phi->getType()->isPointerTy()) {
// Because we have added a PHI-use of the pointer value, it has now
diff --git a/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 09d569a..04ee7c8 100644
--- a/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -52,20 +52,30 @@
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Support/CFG.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
+#include "llvm/Target/TargetData.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
using namespace llvm;
STATISTIC(NumRemoved , "Number of aux indvars removed");
+STATISTIC(NumWidened , "Number of indvars widened");
STATISTIC(NumInserted, "Number of canonical indvars added");
STATISTIC(NumReplaced, "Number of exit values replaced");
STATISTIC(NumLFTR , "Number of loop exit tests replaced");
+STATISTIC(NumElimExt , "Number of IV sign/zero extends eliminated");
+STATISTIC(NumElimRem , "Number of IV remainder operations eliminated");
+STATISTIC(NumElimCmp , "Number of IV comparisons eliminated");
+
+// DisableIVRewrite mode currently affects IVUsers, so is defined in libAnalysis
+// and referenced here.
+namespace llvm {
+ extern bool DisableIVRewrite;
+}
namespace {
class IndVarSimplify : public LoopPass {
@@ -73,12 +83,13 @@ namespace {
LoopInfo *LI;
ScalarEvolution *SE;
DominatorTree *DT;
+ TargetData *TD;
SmallVector<WeakVH, 16> DeadInsts;
bool Changed;
public:
static char ID; // Pass identification, replacement for typeid
- IndVarSimplify() : LoopPass(ID) {
+ IndVarSimplify() : LoopPass(ID), IU(0), LI(0), SE(0), DT(0), TD(0) {
initializeIndVarSimplifyPass(*PassRegistry::getPassRegistry());
}
@@ -101,15 +112,18 @@ namespace {
private:
bool isValidRewrite(Value *FromVal, Value *ToVal);
- void EliminateIVComparisons();
- void EliminateIVRemainders();
+ void SimplifyIVUsers(SCEVExpander &Rewriter);
+ void EliminateIVComparison(ICmpInst *ICmp, Value *IVOperand);
+ void EliminateIVRemainder(BinaryOperator *Rem,
+ Value *IVOperand,
+ bool IsSigned,
+ PHINode *IVPhi);
void RewriteNonIntegerIVs(Loop *L);
ICmpInst *LinearFunctionTestReplace(Loop *L, const SCEV *BackedgeTakenCount,
- PHINode *IndVar,
- BasicBlock *ExitingBlock,
- BranchInst *BI,
- SCEVExpander &Rewriter);
+ PHINode *IndVar,
+ SCEVExpander &Rewriter);
+
void RewriteLoopExitValues(Loop *L, SCEVExpander &Rewriter);
void RewriteIVExpressions(Loop *L, SCEVExpander &Rewriter);
@@ -122,7 +136,7 @@ namespace {
char IndVarSimplify::ID = 0;
INITIALIZE_PASS_BEGIN(IndVarSimplify, "indvars",
- "Canonicalize Induction Variables", false, false)
+ "Induction Variable Simplification", false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTree)
INITIALIZE_PASS_DEPENDENCY(LoopInfo)
INITIALIZE_PASS_DEPENDENCY(ScalarEvolution)
@@ -130,7 +144,7 @@ INITIALIZE_PASS_DEPENDENCY(LoopSimplify)
INITIALIZE_PASS_DEPENDENCY(LCSSA)
INITIALIZE_PASS_DEPENDENCY(IVUsers)
INITIALIZE_PASS_END(IndVarSimplify, "indvars",
- "Canonicalize Induction Variables", false, false)
+ "Induction Variable Simplification", false, false)
Pass *llvm::createIndVarSimplifyPass() {
return new IndVarSimplify();
@@ -183,17 +197,23 @@ bool IndVarSimplify::isValidRewrite(Value *FromVal, Value *ToVal) {
return true;
}
-/// LinearFunctionTestReplace - This method rewrites the exit condition of the
-/// loop to be a canonical != comparison against the incremented loop induction
-/// variable. This pass is able to rewrite the exit tests of any loop where the
-/// SCEV analysis can determine a loop-invariant trip count of the loop, which
-/// is actually a much broader range than just linear tests.
-ICmpInst *IndVarSimplify::LinearFunctionTestReplace(Loop *L,
- const SCEV *BackedgeTakenCount,
- PHINode *IndVar,
- BasicBlock *ExitingBlock,
- BranchInst *BI,
- SCEVExpander &Rewriter) {
+/// canExpandBackedgeTakenCount - Return true if this loop's backedge taken
+/// count expression can be safely and cheaply expanded into an instruction
+/// sequence that can be used by LinearFunctionTestReplace.
+static bool canExpandBackedgeTakenCount(Loop *L, ScalarEvolution *SE) {
+ const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L);
+ if (isa<SCEVCouldNotCompute>(BackedgeTakenCount) ||
+ BackedgeTakenCount->isZero())
+ return false;
+
+ if (!L->getExitingBlock())
+ return false;
+
+ // Can't rewrite non-branch yet.
+ BranchInst *BI = dyn_cast<BranchInst>(L->getExitingBlock()->getTerminator());
+ if (!BI)
+ return false;
+
// Special case: If the backedge-taken count is a UDiv, it's very likely a
// UDiv that ScalarEvolution produced in order to compute a precise
// expression, rather than a UDiv from the user's code. If we can't find a
@@ -201,23 +221,68 @@ ICmpInst *IndVarSimplify::LinearFunctionTestReplace(Loop *L,
// rewriting the loop.
if (isa<SCEVUDivExpr>(BackedgeTakenCount)) {
ICmpInst *OrigCond = dyn_cast<ICmpInst>(BI->getCondition());
- if (!OrigCond) return 0;
+ if (!OrigCond) return false;
const SCEV *R = SE->getSCEV(OrigCond->getOperand(1));
R = SE->getMinusSCEV(R, SE->getConstant(R->getType(), 1));
if (R != BackedgeTakenCount) {
const SCEV *L = SE->getSCEV(OrigCond->getOperand(0));
L = SE->getMinusSCEV(L, SE->getConstant(L->getType(), 1));
if (L != BackedgeTakenCount)
- return 0;
+ return false;
}
}
+ return true;
+}
+
+/// getBackedgeIVType - Get the widest type used by the loop test after peeking
+/// through Truncs.
+///
+/// TODO: Unnecessary once LinearFunctionTestReplace is removed.
+static const Type *getBackedgeIVType(Loop *L) {
+ if (!L->getExitingBlock())
+ return 0;
+
+ // Can't rewrite non-branch yet.
+ BranchInst *BI = dyn_cast<BranchInst>(L->getExitingBlock()->getTerminator());
+ if (!BI)
+ return 0;
+
+ ICmpInst *Cond = dyn_cast<ICmpInst>(BI->getCondition());
+ if (!Cond)
+ return 0;
+
+ const Type *Ty = 0;
+ for(User::op_iterator OI = Cond->op_begin(), OE = Cond->op_end();
+ OI != OE; ++OI) {
+ assert((!Ty || Ty == (*OI)->getType()) && "bad icmp operand types");
+ TruncInst *Trunc = dyn_cast<TruncInst>(*OI);
+ if (!Trunc)
+ continue;
+
+ return Trunc->getSrcTy();
+ }
+ return Ty;
+}
+
+/// LinearFunctionTestReplace - This method rewrites the exit condition of the
+/// loop to be a canonical != comparison against the incremented loop induction
+/// variable. This pass is able to rewrite the exit tests of any loop where the
+/// SCEV analysis can determine a loop-invariant trip count of the loop, which
+/// is actually a much broader range than just linear tests.
+ICmpInst *IndVarSimplify::
+LinearFunctionTestReplace(Loop *L,
+ const SCEV *BackedgeTakenCount,
+ PHINode *IndVar,
+ SCEVExpander &Rewriter) {
+ assert(canExpandBackedgeTakenCount(L, SE) && "precondition");
+ BranchInst *BI = cast<BranchInst>(L->getExitingBlock()->getTerminator());
// If the exiting block is not the same as the backedge block, we must compare
// against the preincremented value, otherwise we prefer to compare against
// the post-incremented value.
Value *CmpIndVar;
const SCEV *RHS = BackedgeTakenCount;
- if (ExitingBlock == L->getLoopLatch()) {
+ if (L->getExitingBlock() == L->getLoopLatch()) {
// Add one to the "backedge-taken" count to get the trip count.
// If this addition may overflow, we have to be more pessimistic and
// cast the induction variable before doing the add.
@@ -240,7 +305,7 @@ ICmpInst *IndVarSimplify::LinearFunctionTestReplace(Loop *L,
// The BackedgeTaken expression contains the number of times that the
// backedge branches to the loop header. This is one less than the
// number of times the loop executes, so use the incremented indvar.
- CmpIndVar = IndVar->getIncomingValueForBlock(ExitingBlock);
+ CmpIndVar = IndVar->getIncomingValueForBlock(L->getExitingBlock());
} else {
// We have to use the preincremented value...
RHS = SE->getTruncateOrZeroExtend(BackedgeTakenCount,
@@ -418,96 +483,519 @@ void IndVarSimplify::RewriteNonIntegerIVs(Loop *L) {
SE->forgetLoop(L);
}
-void IndVarSimplify::EliminateIVComparisons() {
- // Look for ICmp users.
- for (IVUsers::iterator I = IU->begin(), E = IU->end(); I != E; ++I) {
- IVStrideUse &UI = *I;
- ICmpInst *ICmp = dyn_cast<ICmpInst>(UI.getUser());
- if (!ICmp) continue;
-
- bool Swapped = UI.getOperandValToReplace() == ICmp->getOperand(1);
- ICmpInst::Predicate Pred = ICmp->getPredicate();
- if (Swapped) Pred = ICmpInst::getSwappedPredicate(Pred);
-
- // Get the SCEVs for the ICmp operands.
- const SCEV *S = IU->getReplacementExpr(UI);
- const SCEV *X = SE->getSCEV(ICmp->getOperand(!Swapped));
-
- // Simplify unnecessary loops away.
- const Loop *ICmpLoop = LI->getLoopFor(ICmp->getParent());
- S = SE->getSCEVAtScope(S, ICmpLoop);
- X = SE->getSCEVAtScope(X, ICmpLoop);
-
- // If the condition is always true or always false, replace it with
- // a constant value.
- if (SE->isKnownPredicate(Pred, S, X))
- ICmp->replaceAllUsesWith(ConstantInt::getTrue(ICmp->getContext()));
- else if (SE->isKnownPredicate(ICmpInst::getInversePredicate(Pred), S, X))
- ICmp->replaceAllUsesWith(ConstantInt::getFalse(ICmp->getContext()));
- else
- continue;
+namespace {
+ // Collect information about induction variables that are used by sign/zero
+ // extend operations. This information is recorded by CollectExtend and
+ // provides the input to WidenIV.
+ struct WideIVInfo {
+ const Type *WidestNativeType; // Widest integer type created [sz]ext
+ bool IsSigned; // Was an sext user seen before a zext?
+
+ WideIVInfo() : WidestNativeType(0), IsSigned(false) {}
+ };
+ typedef std::map<PHINode *, WideIVInfo> WideIVMap;
+}
+
+/// CollectExtend - Update information about the induction variable that is
+/// extended by this sign or zero extend operation. This is used to determine
+/// the final width of the IV before actually widening it.
+static void CollectExtend(CastInst *Cast, PHINode *Phi, bool IsSigned,
+ WideIVMap &IVMap, ScalarEvolution *SE,
+ const TargetData *TD) {
+ const Type *Ty = Cast->getType();
+ uint64_t Width = SE->getTypeSizeInBits(Ty);
+ if (TD && !TD->isLegalInteger(Width))
+ return;
- DEBUG(dbgs() << "INDVARS: Eliminated comparison: " << *ICmp << '\n');
- DeadInsts.push_back(ICmp);
+ WideIVInfo &IVInfo = IVMap[Phi];
+ if (!IVInfo.WidestNativeType) {
+ IVInfo.WidestNativeType = SE->getEffectiveSCEVType(Ty);
+ IVInfo.IsSigned = IsSigned;
+ return;
}
+
+ // We extend the IV to satisfy the sign of its first user, arbitrarily.
+ if (IVInfo.IsSigned != IsSigned)
+ return;
+
+ if (Width > SE->getTypeSizeInBits(IVInfo.WidestNativeType))
+ IVInfo.WidestNativeType = SE->getEffectiveSCEVType(Ty);
}
-void IndVarSimplify::EliminateIVRemainders() {
- // Look for SRem and URem users.
- for (IVUsers::iterator I = IU->begin(), E = IU->end(); I != E; ++I) {
- IVStrideUse &UI = *I;
- BinaryOperator *Rem = dyn_cast<BinaryOperator>(UI.getUser());
- if (!Rem) continue;
+namespace {
+/// WidenIV - The goal of this transform is to remove sign and zero extends
+/// without creating any new induction variables. To do this, it creates a new
+/// phi of the wider type and redirects all users, either removing extends or
+/// inserting truncs whenever we stop propagating the type.
+///
+class WidenIV {
+ PHINode *OrigPhi;
+ const Type *WideType;
+ bool IsSigned;
+
+ IVUsers *IU;
+ LoopInfo *LI;
+ Loop *L;
+ ScalarEvolution *SE;
+ DominatorTree *DT;
+ SmallVectorImpl<WeakVH> &DeadInsts;
+
+ PHINode *WidePhi;
+ Instruction *WideInc;
+ const SCEV *WideIncExpr;
+
+ SmallPtrSet<Instruction*,16> Processed;
+
+public:
+ WidenIV(PHINode *PN, const WideIVInfo &IVInfo, IVUsers *IUsers,
+ LoopInfo *LInfo, ScalarEvolution *SEv, DominatorTree *DTree,
+ SmallVectorImpl<WeakVH> &DI) :
+ OrigPhi(PN),
+ WideType(IVInfo.WidestNativeType),
+ IsSigned(IVInfo.IsSigned),
+ IU(IUsers),
+ LI(LInfo),
+ L(LI->getLoopFor(OrigPhi->getParent())),
+ SE(SEv),
+ DT(DTree),
+ DeadInsts(DI),
+ WidePhi(0),
+ WideInc(0),
+ WideIncExpr(0) {
+ assert(L->getHeader() == OrigPhi->getParent() && "Phi must be an IV");
+ }
- bool isSigned = Rem->getOpcode() == Instruction::SRem;
- if (!isSigned && Rem->getOpcode() != Instruction::URem)
- continue;
+ bool CreateWideIV(SCEVExpander &Rewriter);
- // We're only interested in the case where we know something about
- // the numerator.
- if (UI.getOperandValToReplace() != Rem->getOperand(0))
- continue;
+protected:
+ Instruction *CloneIVUser(Instruction *NarrowUse,
+ Instruction *NarrowDef,
+ Instruction *WideDef);
- // Get the SCEVs for the ICmp operands.
- const SCEV *S = SE->getSCEV(Rem->getOperand(0));
- const SCEV *X = SE->getSCEV(Rem->getOperand(1));
-
- // Simplify unnecessary loops away.
- const Loop *ICmpLoop = LI->getLoopFor(Rem->getParent());
- S = SE->getSCEVAtScope(S, ICmpLoop);
- X = SE->getSCEVAtScope(X, ICmpLoop);
-
- // i % n --> i if i is in [0,n).
- if ((!isSigned || SE->isKnownNonNegative(S)) &&
- SE->isKnownPredicate(isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- S, X))
- Rem->replaceAllUsesWith(Rem->getOperand(0));
- else {
- // (i+1) % n --> (i+1)==n?0:(i+1) if i is in [0,n).
- const SCEV *LessOne =
- SE->getMinusSCEV(S, SE->getConstant(S->getType(), 1));
- if ((!isSigned || SE->isKnownNonNegative(LessOne)) &&
- SE->isKnownPredicate(isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
- LessOne, X)) {
- ICmpInst *ICmp = new ICmpInst(Rem, ICmpInst::ICMP_EQ,
- Rem->getOperand(0), Rem->getOperand(1),
- "tmp");
- SelectInst *Sel =
- SelectInst::Create(ICmp,
- ConstantInt::get(Rem->getType(), 0),
- Rem->getOperand(0), "tmp", Rem);
- Rem->replaceAllUsesWith(Sel);
- } else
+ const SCEVAddRecExpr *GetWideRecurrence(Instruction *NarrowUse);
+
+ Instruction *WidenIVUse(Instruction *NarrowUse,
+ Instruction *NarrowDef,
+ Instruction *WideDef);
+};
+} // anonymous namespace
+
+/// SimplifyIVUsers - Iteratively perform simplification on IVUsers within this
+/// loop. IVUsers is treated as a worklist. Each successive simplification may
+/// push more users which may themselves be candidates for simplification.
+///
+void IndVarSimplify::SimplifyIVUsers(SCEVExpander &Rewriter) {
+ WideIVMap IVMap;
+
+ // Each round of simplification involves a round of eliminating operations
+ // followed by a round of widening IVs. A single IVUsers worklist is used
+ // across all rounds. The inner loop advances the user. If widening exposes
+ // more uses, then another pass through the outer loop is triggered.
+ for (IVUsers::iterator I = IU->begin(), E = IU->end(); I != E;) {
+ for(; I != E; ++I) {
+ Instruction *UseInst = I->getUser();
+ Value *IVOperand = I->getOperandValToReplace();
+
+ if (DisableIVRewrite) {
+ if (CastInst *Cast = dyn_cast<CastInst>(UseInst)) {
+ bool IsSigned = Cast->getOpcode() == Instruction::SExt;
+ if (IsSigned || Cast->getOpcode() == Instruction::ZExt) {
+ CollectExtend(Cast, I->getPhi(), IsSigned, IVMap, SE, TD);
+ continue;
+ }
+ }
+ }
+ if (ICmpInst *ICmp = dyn_cast<ICmpInst>(UseInst)) {
+ EliminateIVComparison(ICmp, IVOperand);
continue;
+ }
+ if (BinaryOperator *Rem = dyn_cast<BinaryOperator>(UseInst)) {
+ bool IsSigned = Rem->getOpcode() == Instruction::SRem;
+ if (IsSigned || Rem->getOpcode() == Instruction::URem) {
+ EliminateIVRemainder(Rem, IVOperand, IsSigned, I->getPhi());
+ continue;
+ }
+ }
+ }
+ for (WideIVMap::const_iterator I = IVMap.begin(), E = IVMap.end();
+ I != E; ++I) {
+ WidenIV Widener(I->first, I->second, IU, LI, SE, DT, DeadInsts);
+ if (Widener.CreateWideIV(Rewriter))
+ Changed = true;
}
+ }
+}
- // Inform IVUsers about the new users.
- if (Instruction *I = dyn_cast<Instruction>(Rem->getOperand(0)))
- IU->AddUsersIfInteresting(I);
+static Value *getExtend( Value *NarrowOper, const Type *WideType,
+ bool IsSigned, IRBuilder<> &Builder) {
+ return IsSigned ? Builder.CreateSExt(NarrowOper, WideType) :
+ Builder.CreateZExt(NarrowOper, WideType);
+}
- DEBUG(dbgs() << "INDVARS: Simplified rem: " << *Rem << '\n');
- DeadInsts.push_back(Rem);
+/// CloneIVUser - Instantiate a wide operation to replace a narrow
+/// operation. This only needs to handle operations that can evaluation to
+/// SCEVAddRec. It can safely return 0 for any operation we decide not to clone.
+Instruction *WidenIV::CloneIVUser(Instruction *NarrowUse,
+ Instruction *NarrowDef,
+ Instruction *WideDef) {
+ unsigned Opcode = NarrowUse->getOpcode();
+ switch (Opcode) {
+ default:
+ return 0;
+ case Instruction::Add:
+ case Instruction::Mul:
+ case Instruction::UDiv:
+ case Instruction::Sub:
+ case Instruction::And:
+ case Instruction::Or:
+ case Instruction::Xor:
+ case Instruction::Shl:
+ case Instruction::LShr:
+ case Instruction::AShr:
+ DEBUG(dbgs() << "Cloning IVUser: " << *NarrowUse << "\n");
+
+ IRBuilder<> Builder(NarrowUse);
+
+ // Replace NarrowDef operands with WideDef. Otherwise, we don't know
+ // anything about the narrow operand yet so must insert a [sz]ext. It is
+ // probably loop invariant and will be folded or hoisted. If it actually
+ // comes from a widened IV, it should be removed during a future call to
+ // WidenIVUse.
+ Value *LHS = (NarrowUse->getOperand(0) == NarrowDef) ? WideDef :
+ getExtend(NarrowUse->getOperand(0), WideType, IsSigned, Builder);
+ Value *RHS = (NarrowUse->getOperand(1) == NarrowDef) ? WideDef :
+ getExtend(NarrowUse->getOperand(1), WideType, IsSigned, Builder);
+
+ BinaryOperator *NarrowBO = cast<BinaryOperator>(NarrowUse);
+ BinaryOperator *WideBO = BinaryOperator::Create(NarrowBO->getOpcode(),
+ LHS, RHS,
+ NarrowBO->getName());
+ Builder.Insert(WideBO);
+ if (NarrowBO->hasNoUnsignedWrap()) WideBO->setHasNoUnsignedWrap();
+ if (NarrowBO->hasNoSignedWrap()) WideBO->setHasNoSignedWrap();
+
+ return WideBO;
}
+ llvm_unreachable(0);
+}
+
+// GetWideRecurrence - Is this instruction potentially interesting from IVUsers'
+// perspective after widening it's type? In other words, can the extend be
+// safely hoisted out of the loop with SCEV reducing the value to a recurrence
+// on the same loop. If so, return the sign or zero extended
+// recurrence. Otherwise return NULL.
+const SCEVAddRecExpr *WidenIV::GetWideRecurrence(Instruction *NarrowUse) {
+ if (!SE->isSCEVable(NarrowUse->getType()))
+ return 0;
+
+ const SCEV *NarrowExpr = SE->getSCEV(NarrowUse);
+ const SCEV *WideExpr = IsSigned ?
+ SE->getSignExtendExpr(NarrowExpr, WideType) :
+ SE->getZeroExtendExpr(NarrowExpr, WideType);
+ const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(WideExpr);
+ if (!AddRec || AddRec->getLoop() != L)
+ return 0;
+
+ return AddRec;
+}
+
+/// HoistStep - Attempt to hoist an IV increment above a potential use.
+///
+/// To successfully hoist, two criteria must be met:
+/// - IncV operands dominate InsertPos and
+/// - InsertPos dominates IncV
+///
+/// Meeting the second condition means that we don't need to check all of IncV's
+/// existing uses (it's moving up in the domtree).
+///
+/// This does not yet recursively hoist the operands, although that would
+/// not be difficult.
+static bool HoistStep(Instruction *IncV, Instruction *InsertPos,
+ const DominatorTree *DT)
+{
+ if (DT->dominates(IncV, InsertPos))
+ return true;
+
+ if (!DT->dominates(InsertPos->getParent(), IncV->getParent()))
+ return false;
+
+ if (IncV->mayHaveSideEffects())
+ return false;
+
+ // Attempt to hoist IncV
+ for (User::op_iterator OI = IncV->op_begin(), OE = IncV->op_end();
+ OI != OE; ++OI) {
+ Instruction *OInst = dyn_cast<Instruction>(OI);
+ if (OInst && !DT->dominates(OInst, InsertPos))
+ return false;
+ }
+ IncV->moveBefore(InsertPos);
+ return true;
+}
+
+/// WidenIVUse - Determine whether an individual user of the narrow IV can be
+/// widened. If so, return the wide clone of the user.
+Instruction *WidenIV::WidenIVUse(Instruction *NarrowUse,
+ Instruction *NarrowDef,
+ Instruction *WideDef) {
+ // To be consistent with IVUsers, stop traversing the def-use chain at
+ // inner-loop phis or post-loop phis.
+ if (isa<PHINode>(NarrowUse) && LI->getLoopFor(NarrowUse->getParent()) != L)
+ return 0;
+
+ // Handle data flow merges and bizarre phi cycles.
+ if (!Processed.insert(NarrowUse))
+ return 0;
+
+ // Our raison d'etre! Eliminate sign and zero extension.
+ if (IsSigned ? isa<SExtInst>(NarrowUse) : isa<ZExtInst>(NarrowUse)) {
+ Value *NewDef = WideDef;
+ if (NarrowUse->getType() != WideType) {
+ unsigned CastWidth = SE->getTypeSizeInBits(NarrowUse->getType());
+ unsigned IVWidth = SE->getTypeSizeInBits(WideType);
+ if (CastWidth < IVWidth) {
+ // The cast isn't as wide as the IV, so insert a Trunc.
+ IRBuilder<> Builder(NarrowUse);
+ NewDef = Builder.CreateTrunc(WideDef, NarrowUse->getType());
+ }
+ else {
+ // A wider extend was hidden behind a narrower one. This may induce
+ // another round of IV widening in which the intermediate IV becomes
+ // dead. It should be very rare.
+ DEBUG(dbgs() << "INDVARS: New IV " << *WidePhi
+ << " not wide enough to subsume " << *NarrowUse << "\n");
+ NarrowUse->replaceUsesOfWith(NarrowDef, WideDef);
+ NewDef = NarrowUse;
+ }
+ }
+ if (NewDef != NarrowUse) {
+ DEBUG(dbgs() << "INDVARS: eliminating " << *NarrowUse
+ << " replaced by " << *WideDef << "\n");
+ ++NumElimExt;
+ NarrowUse->replaceAllUsesWith(NewDef);
+ DeadInsts.push_back(NarrowUse);
+ }
+ // Now that the extend is gone, expose it's uses to IVUsers for potential
+ // further simplification within SimplifyIVUsers.
+ IU->AddUsersIfInteresting(WideDef, WidePhi);
+
+ // No further widening is needed. The deceased [sz]ext had done it for us.
+ return 0;
+ }
+ const SCEVAddRecExpr *WideAddRec = GetWideRecurrence(NarrowUse);
+ if (!WideAddRec) {
+ // This user does not evaluate to a recurence after widening, so don't
+ // follow it. Instead insert a Trunc to kill off the original use,
+ // eventually isolating the original narrow IV so it can be removed.
+ IRBuilder<> Builder(NarrowUse);
+ Value *Trunc = Builder.CreateTrunc(WideDef, NarrowDef->getType());
+ NarrowUse->replaceUsesOfWith(NarrowDef, Trunc);
+ return 0;
+ }
+ // Reuse the IV increment that SCEVExpander created as long as it dominates
+ // NarrowUse.
+ Instruction *WideUse = 0;
+ if (WideAddRec == WideIncExpr && HoistStep(WideInc, NarrowUse, DT)) {
+ WideUse = WideInc;
+ }
+ else {
+ WideUse = CloneIVUser(NarrowUse, NarrowDef, WideDef);
+ if (!WideUse)
+ return 0;
+ }
+ // GetWideRecurrence ensured that the narrow expression could be extended
+ // outside the loop without overflow. This suggests that the wide use
+ // evaluates to the same expression as the extended narrow use, but doesn't
+ // absolutely guarantee it. Hence the following failsafe check. In rare cases
+ // where it fails, we simple throw away the newly created wide use.
+ if (WideAddRec != SE->getSCEV(WideUse)) {
+ DEBUG(dbgs() << "Wide use expression mismatch: " << *WideUse
+ << ": " << *SE->getSCEV(WideUse) << " != " << *WideAddRec << "\n");
+ DeadInsts.push_back(WideUse);
+ return 0;
+ }
+
+ // Returning WideUse pushes it on the worklist.
+ return WideUse;
+}
+
+/// CreateWideIV - Process a single induction variable. First use the
+/// SCEVExpander to create a wide induction variable that evaluates to the same
+/// recurrence as the original narrow IV. Then use a worklist to forward
+/// traverse the narrow IV's def-use chain. After WidenIVUse as processed all
+/// interesting IV users, the narrow IV will be isolated for removal by
+/// DeleteDeadPHIs.
+///
+/// It would be simpler to delete uses as they are processed, but we must avoid
+/// invalidating SCEV expressions.
+///
+bool WidenIV::CreateWideIV(SCEVExpander &Rewriter) {
+ // Is this phi an induction variable?
+ const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(SE->getSCEV(OrigPhi));
+ if (!AddRec)
+ return false;
+
+ // Widen the induction variable expression.
+ const SCEV *WideIVExpr = IsSigned ?
+ SE->getSignExtendExpr(AddRec, WideType) :
+ SE->getZeroExtendExpr(AddRec, WideType);
+
+ assert(SE->getEffectiveSCEVType(WideIVExpr->getType()) == WideType &&
+ "Expect the new IV expression to preserve its type");
+
+ // Can the IV be extended outside the loop without overflow?
+ AddRec = dyn_cast<SCEVAddRecExpr>(WideIVExpr);
+ if (!AddRec || AddRec->getLoop() != L)
+ return false;
+
+ // An AddRec must have loop-invariant operands. Since this AddRec it
+ // materialized by a loop header phi, the expression cannot have any post-loop
+ // operands, so they must dominate the loop header.
+ assert(SE->properlyDominates(AddRec->getStart(), L->getHeader()) &&
+ SE->properlyDominates(AddRec->getStepRecurrence(*SE), L->getHeader())
+ && "Loop header phi recurrence inputs do not dominate the loop");
+
+ // The rewriter provides a value for the desired IV expression. This may
+ // either find an existing phi or materialize a new one. Either way, we
+ // expect a well-formed cyclic phi-with-increments. i.e. any operand not part
+ // of the phi-SCC dominates the loop entry.
+ Instruction *InsertPt = L->getHeader()->begin();
+ WidePhi = cast<PHINode>(Rewriter.expandCodeFor(AddRec, WideType, InsertPt));
+
+ // Remembering the WideIV increment generated by SCEVExpander allows
+ // WidenIVUse to reuse it when widening the narrow IV's increment. We don't
+ // employ a general reuse mechanism because the call above is the only call to
+ // SCEVExpander. Henceforth, we produce 1-to-1 narrow to wide uses.
+ if (BasicBlock *LatchBlock = L->getLoopLatch()) {
+ WideInc =
+ cast<Instruction>(WidePhi->getIncomingValueForBlock(LatchBlock));
+ WideIncExpr = SE->getSCEV(WideInc);
+ }
+
+ DEBUG(dbgs() << "Wide IV: " << *WidePhi << "\n");
+ ++NumWidened;
+
+ // Traverse the def-use chain using a worklist starting at the original IV.
+ assert(Processed.empty() && "expect initial state" );
+
+ // Each worklist entry has a Narrow def-use link and Wide def.
+ SmallVector<std::pair<Use *, Instruction *>, 8> NarrowIVUsers;
+ for (Value::use_iterator UI = OrigPhi->use_begin(),
+ UE = OrigPhi->use_end(); UI != UE; ++UI) {
+ NarrowIVUsers.push_back(std::make_pair(&UI.getUse(), WidePhi));
+ }
+ while (!NarrowIVUsers.empty()) {
+ Use *NarrowDefUse;
+ Instruction *WideDef;
+ tie(NarrowDefUse, WideDef) = NarrowIVUsers.pop_back_val();
+
+ // Process a def-use edge. This may replace the use, so don't hold a
+ // use_iterator across it.
+ Instruction *NarrowDef = cast<Instruction>(NarrowDefUse->get());
+ Instruction *NarrowUse = cast<Instruction>(NarrowDefUse->getUser());
+ Instruction *WideUse = WidenIVUse(NarrowUse, NarrowDef, WideDef);
+
+ // Follow all def-use edges from the previous narrow use.
+ if (WideUse) {
+ for (Value::use_iterator UI = NarrowUse->use_begin(),
+ UE = NarrowUse->use_end(); UI != UE; ++UI) {
+ NarrowIVUsers.push_back(std::make_pair(&UI.getUse(), WideUse));
+ }
+ }
+ // WidenIVUse may have removed the def-use edge.
+ if (NarrowDef->use_empty())
+ DeadInsts.push_back(NarrowDef);
+ }
+ return true;
+}
+
+void IndVarSimplify::EliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) {
+ unsigned IVOperIdx = 0;
+ ICmpInst::Predicate Pred = ICmp->getPredicate();
+ if (IVOperand != ICmp->getOperand(0)) {
+ // Swapped
+ assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand");
+ IVOperIdx = 1;
+ Pred = ICmpInst::getSwappedPredicate(Pred);
+ }
+
+ // Get the SCEVs for the ICmp operands.
+ const SCEV *S = SE->getSCEV(ICmp->getOperand(IVOperIdx));
+ const SCEV *X = SE->getSCEV(ICmp->getOperand(1 - IVOperIdx));
+
+ // Simplify unnecessary loops away.
+ const Loop *ICmpLoop = LI->getLoopFor(ICmp->getParent());
+ S = SE->getSCEVAtScope(S, ICmpLoop);
+ X = SE->getSCEVAtScope(X, ICmpLoop);
+
+ // If the condition is always true or always false, replace it with
+ // a constant value.
+ if (SE->isKnownPredicate(Pred, S, X))
+ ICmp->replaceAllUsesWith(ConstantInt::getTrue(ICmp->getContext()));
+ else if (SE->isKnownPredicate(ICmpInst::getInversePredicate(Pred), S, X))
+ ICmp->replaceAllUsesWith(ConstantInt::getFalse(ICmp->getContext()));
+ else
+ return;
+
+ DEBUG(dbgs() << "INDVARS: Eliminated comparison: " << *ICmp << '\n');
+ ++NumElimCmp;
+ Changed = true;
+ DeadInsts.push_back(ICmp);
+}
+
+void IndVarSimplify::EliminateIVRemainder(BinaryOperator *Rem,
+ Value *IVOperand,
+ bool IsSigned,
+ PHINode *IVPhi) {
+ // We're only interested in the case where we know something about
+ // the numerator.
+ if (IVOperand != Rem->getOperand(0))
+ return;
+
+ // Get the SCEVs for the ICmp operands.
+ const SCEV *S = SE->getSCEV(Rem->getOperand(0));
+ const SCEV *X = SE->getSCEV(Rem->getOperand(1));
+
+ // Simplify unnecessary loops away.
+ const Loop *ICmpLoop = LI->getLoopFor(Rem->getParent());
+ S = SE->getSCEVAtScope(S, ICmpLoop);
+ X = SE->getSCEVAtScope(X, ICmpLoop);
+
+ // i % n --> i if i is in [0,n).
+ if ((!IsSigned || SE->isKnownNonNegative(S)) &&
+ SE->isKnownPredicate(IsSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
+ S, X))
+ Rem->replaceAllUsesWith(Rem->getOperand(0));
+ else {
+ // (i+1) % n --> (i+1)==n?0:(i+1) if i is in [0,n).
+ const SCEV *LessOne =
+ SE->getMinusSCEV(S, SE->getConstant(S->getType(), 1));
+ if (IsSigned && !SE->isKnownNonNegative(LessOne))
+ return;
+
+ if (!SE->isKnownPredicate(IsSigned ?
+ ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
+ LessOne, X))
+ return;
+
+ ICmpInst *ICmp = new ICmpInst(Rem, ICmpInst::ICMP_EQ,
+ Rem->getOperand(0), Rem->getOperand(1),
+ "tmp");
+ SelectInst *Sel =
+ SelectInst::Create(ICmp,
+ ConstantInt::get(Rem->getType(), 0),
+ Rem->getOperand(0), "tmp", Rem);
+ Rem->replaceAllUsesWith(Sel);
+ }
+
+ // Inform IVUsers about the new users.
+ if (Instruction *I = dyn_cast<Instruction>(Rem->getOperand(0)))
+ IU->AddUsersIfInteresting(I, IVPhi);
+
+ DEBUG(dbgs() << "INDVARS: Simplified rem: " << *Rem << '\n');
+ ++NumElimRem;
+ Changed = true;
+ DeadInsts.push_back(Rem);
}
bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
@@ -526,6 +1014,8 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
LI = &getAnalysis<LoopInfo>();
SE = &getAnalysis<ScalarEvolution>();
DT = &getAnalysis<DominatorTree>();
+ TD = getAnalysisIfAvailable<TargetData>();
+
DeadInsts.clear();
Changed = false;
@@ -533,11 +1023,12 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// transform them to use integer recurrences.
RewriteNonIntegerIVs(L);
- BasicBlock *ExitingBlock = L->getExitingBlock(); // may be null
const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L);
// Create a rewriter object which we'll use to transform the code with.
SCEVExpander Rewriter(*SE);
+ if (DisableIVRewrite)
+ Rewriter.disableCanonicalMode();
// Check to see if this loop has a computable loop-invariant execution count.
// If so, this means that we can compute the final value of any expressions
@@ -548,33 +1039,42 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
if (!isa<SCEVCouldNotCompute>(BackedgeTakenCount))
RewriteLoopExitValues(L, Rewriter);
- // Simplify ICmp IV users.
- EliminateIVComparisons();
-
- // Simplify SRem and URem IV users.
- EliminateIVRemainders();
+ // Eliminate redundant IV users.
+ SimplifyIVUsers(Rewriter);
// Compute the type of the largest recurrence expression, and decide whether
// a canonical induction variable should be inserted.
const Type *LargestType = 0;
bool NeedCannIV = false;
- if (!isa<SCEVCouldNotCompute>(BackedgeTakenCount)) {
- LargestType = BackedgeTakenCount->getType();
- LargestType = SE->getEffectiveSCEVType(LargestType);
+ bool ExpandBECount = canExpandBackedgeTakenCount(L, SE);
+ if (ExpandBECount) {
// If we have a known trip count and a single exit block, we'll be
// rewriting the loop exit test condition below, which requires a
// canonical induction variable.
- if (ExitingBlock)
- NeedCannIV = true;
- }
- for (IVUsers::const_iterator I = IU->begin(), E = IU->end(); I != E; ++I) {
- const Type *Ty =
- SE->getEffectiveSCEVType(I->getOperandValToReplace()->getType());
+ NeedCannIV = true;
+ const Type *Ty = BackedgeTakenCount->getType();
+ if (DisableIVRewrite) {
+ // In this mode, SimplifyIVUsers may have already widened the IV used by
+ // the backedge test and inserted a Trunc on the compare's operand. Get
+ // the wider type to avoid creating a redundant narrow IV only used by the
+ // loop test.
+ LargestType = getBackedgeIVType(L);
+ }
if (!LargestType ||
SE->getTypeSizeInBits(Ty) >
+ SE->getTypeSizeInBits(LargestType))
+ LargestType = SE->getEffectiveSCEVType(Ty);
+ }
+ if (!DisableIVRewrite) {
+ for (IVUsers::const_iterator I = IU->begin(), E = IU->end(); I != E; ++I) {
+ NeedCannIV = true;
+ const Type *Ty =
+ SE->getEffectiveSCEVType(I->getOperandValToReplace()->getType());
+ if (!LargestType ||
+ SE->getTypeSizeInBits(Ty) >
SE->getTypeSizeInBits(LargestType))
- LargestType = Ty;
- NeedCannIV = true;
+ LargestType = Ty;
+ }
}
// Now that we know the largest of the induction variable expressions
@@ -614,19 +1114,17 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// If we have a trip count expression, rewrite the loop's exit condition
// using it. We can currently only handle loops with a single exit.
ICmpInst *NewICmp = 0;
- if (!isa<SCEVCouldNotCompute>(BackedgeTakenCount) &&
- !BackedgeTakenCount->isZero() &&
- ExitingBlock) {
+ if (ExpandBECount) {
+ assert(canExpandBackedgeTakenCount(L, SE) &&
+ "canonical IV disrupted BackedgeTaken expansion");
assert(NeedCannIV &&
"LinearFunctionTestReplace requires a canonical induction variable");
- // Can't rewrite non-branch yet.
- if (BranchInst *BI = dyn_cast<BranchInst>(ExitingBlock->getTerminator()))
- NewICmp = LinearFunctionTestReplace(L, BackedgeTakenCount, IndVar,
- ExitingBlock, BI, Rewriter);
+ NewICmp = LinearFunctionTestReplace(L, BackedgeTakenCount, IndVar,
+ Rewriter);
}
-
// Rewrite IV-derived expressions.
- RewriteIVExpressions(L, Rewriter);
+ if (!DisableIVRewrite)
+ RewriteIVExpressions(L, Rewriter);
// Clear the rewriter cache, because values that are in the rewriter's cache
// can be deleted in the loop below, causing the AssertingVH in the cache to
@@ -649,7 +1147,8 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// For completeness, inform IVUsers of the IV use in the newly-created
// loop exit test instruction.
if (NewICmp)
- IU->AddUsersIfInteresting(cast<Instruction>(NewICmp->getOperand(0)));
+ IU->AddUsersIfInteresting(cast<Instruction>(NewICmp->getOperand(0)),
+ IndVar);
// Clean up dead instructions.
Changed |= DeleteDeadPHIs(L->getHeader());
@@ -1080,5 +1579,5 @@ void IndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PN) {
}
// Add a new IVUsers entry for the newly-created integer PHI.
- IU->AddUsersIfInteresting(NewPHI);
+ IU->AddUsersIfInteresting(NewPHI, NewPHI);
}
diff --git a/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index 7168177..cf18ff0 100644
--- a/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -706,7 +706,7 @@ bool JumpThreading::ProcessBlock(BasicBlock *BB) {
DEBUG(dbgs() << " In block '" << BB->getName()
<< "' folding terminator: " << *BB->getTerminator() << '\n');
++NumFolds;
- ConstantFoldTerminator(BB);
+ ConstantFoldTerminator(BB, true);
return true;
}
@@ -929,9 +929,10 @@ bool JumpThreading::SimplifyPartiallyRedundantLoad(LoadInst *LI) {
if (UnavailablePred) {
assert(UnavailablePred->getTerminator()->getNumSuccessors() == 1 &&
"Can't handle critical edge here!");
- Value *NewVal = new LoadInst(LoadedPtr, LI->getName()+".pr", false,
+ LoadInst *NewVal = new LoadInst(LoadedPtr, LI->getName()+".pr", false,
LI->getAlignment(),
UnavailablePred->getTerminator());
+ NewVal->setDebugLoc(LI->getDebugLoc());
AvailablePreds.push_back(std::make_pair(UnavailablePred, NewVal));
}
@@ -944,6 +945,7 @@ bool JumpThreading::SimplifyPartiallyRedundantLoad(LoadInst *LI) {
PHINode *PN = PHINode::Create(LI->getType(), std::distance(PB, PE), "",
LoadBB->begin());
PN->takeName(LI);
+ PN->setDebugLoc(LI->getDebugLoc());
// Insert new entries into the PHI for each predecessor. A single block may
// have multiple entries here.
@@ -1375,7 +1377,8 @@ bool JumpThreading::ThreadEdge(BasicBlock *BB,
// We didn't copy the terminator from BB over to NewBB, because there is now
// an unconditional jump to SuccBB. Insert the unconditional jump.
- BranchInst::Create(SuccBB, NewBB);
+ BranchInst *NewBI =BranchInst::Create(SuccBB, NewBB);
+ NewBI->setDebugLoc(BB->getTerminator()->getDebugLoc());
// Check to see if SuccBB has PHI nodes. If so, we need to add entries to the
// PHI nodes for NewBB now.
diff --git a/contrib/llvm/lib/Transforms/Scalar/LICM.cpp b/contrib/llvm/lib/Transforms/Scalar/LICM.cpp
index 93de9cf..13bd022 100644
--- a/contrib/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -372,7 +372,11 @@ bool LICM::canSinkOrHoistInst(Instruction &I) {
return !pointerInvalidatedByLoop(LI->getOperand(0), Size,
LI->getMetadata(LLVMContext::MD_tbaa));
} else if (CallInst *CI = dyn_cast<CallInst>(&I)) {
- // Handle obvious cases efficiently.
+ // Don't sink or hoist dbg info; it's legal, but not useful.
+ if (isa<DbgInfoIntrinsic>(I))
+ return false;
+
+ // Handle simple cases by querying alias analysis.
AliasAnalysis::ModRefBehavior Behavior = AA->getModRefBehavior(CI);
if (Behavior == AliasAnalysis::DoesNotAccessMemory)
return true;
@@ -445,8 +449,7 @@ void LICM::sink(Instruction &I) {
// enough that we handle it as a special (more efficient) case. It is more
// efficient to handle because there are no PHI nodes that need to be placed.
if (ExitBlocks.size() == 1) {
- if (!isa<DbgInfoIntrinsic>(I) &&
- !DT->dominates(I.getParent(), ExitBlocks[0])) {
+ if (!DT->dominates(I.getParent(), ExitBlocks[0])) {
// Instruction is not used, just delete it.
CurAST->deleteValue(&I);
// If I has users in unreachable blocks, eliminate.
@@ -602,13 +605,15 @@ namespace {
SmallPtrSet<Value*, 4> &PointerMustAliases;
SmallVectorImpl<BasicBlock*> &LoopExitBlocks;
AliasSetTracker &AST;
+ DebugLoc DL;
public:
LoopPromoter(Value *SP,
const SmallVectorImpl<Instruction*> &Insts, SSAUpdater &S,
SmallPtrSet<Value*, 4> &PMA,
- SmallVectorImpl<BasicBlock*> &LEB, AliasSetTracker &ast)
- : LoadAndStorePromoter(Insts, S), SomePtr(SP), PointerMustAliases(PMA),
- LoopExitBlocks(LEB), AST(ast) {}
+ SmallVectorImpl<BasicBlock*> &LEB, AliasSetTracker &ast,
+ DebugLoc dl)
+ : LoadAndStorePromoter(Insts, S, 0, 0), SomePtr(SP),
+ PointerMustAliases(PMA), LoopExitBlocks(LEB), AST(ast), DL(dl) {}
virtual bool isInstInList(Instruction *I,
const SmallVectorImpl<Instruction*> &) const {
@@ -629,7 +634,8 @@ namespace {
BasicBlock *ExitBlock = LoopExitBlocks[i];
Value *LiveInValue = SSA.GetValueInMiddleOfBlock(ExitBlock);
Instruction *InsertPos = ExitBlock->getFirstNonPHI();
- new StoreInst(LiveInValue, SomePtr, InsertPos);
+ StoreInst *NewSI = new StoreInst(LiveInValue, SomePtr, InsertPos);
+ NewSI->setDebugLoc(DL);
}
}
@@ -727,6 +733,12 @@ void LICM::PromoteAliasSet(AliasSet &AS) {
Changed = true;
++NumPromoted;
+ // Grab a debug location for the inserted loads/stores; given that the
+ // inserted loads/stores have little relation to the original loads/stores,
+ // this code just arbitrarily picks a location from one, since any debug
+ // location is better than none.
+ DebugLoc DL = LoopUses[0]->getDebugLoc();
+
SmallVector<BasicBlock*, 8> ExitBlocks;
CurLoop->getUniqueExitBlocks(ExitBlocks);
@@ -734,13 +746,14 @@ void LICM::PromoteAliasSet(AliasSet &AS) {
SmallVector<PHINode*, 16> NewPHIs;
SSAUpdater SSA(&NewPHIs);
LoopPromoter Promoter(SomePtr, LoopUses, SSA, PointerMustAliases, ExitBlocks,
- *CurAST);
+ *CurAST, DL);
// Set up the preheader to have a definition of the value. It is the live-out
// value from the preheader that uses in the loop will use.
LoadInst *PreheaderLoad =
new LoadInst(SomePtr, SomePtr->getName()+".promoted",
Preheader->getTerminator());
+ PreheaderLoad->setDebugLoc(DL);
SSA.AddAvailableValue(Preheader, PreheaderLoad);
// Rewrite all the loads in the loop and remember all the definitions from
diff --git a/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 1366231..dbf6eec 100644
--- a/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -128,11 +128,11 @@ INITIALIZE_PASS_END(LoopIdiomRecognize, "loop-idiom", "Recognize loop idioms",
Pass *llvm::createLoopIdiomPass() { return new LoopIdiomRecognize(); }
-/// DeleteDeadInstruction - Delete this instruction. Before we do, go through
+/// deleteDeadInstruction - Delete this instruction. Before we do, go through
/// and zero out all the operands of this instruction. If any of them become
/// dead, delete them and the computation tree that feeds them.
///
-static void DeleteDeadInstruction(Instruction *I, ScalarEvolution &SE) {
+static void deleteDeadInstruction(Instruction *I, ScalarEvolution &SE) {
SmallVector<Instruction*, 32> NowDeadInsts;
NowDeadInsts.push_back(I);
@@ -162,6 +162,14 @@ static void DeleteDeadInstruction(Instruction *I, ScalarEvolution &SE) {
} while (!NowDeadInsts.empty());
}
+/// deleteIfDeadInstruction - If the specified value is a dead instruction,
+/// delete it and any recursively used instructions.
+static void deleteIfDeadInstruction(Value *V, ScalarEvolution &SE) {
+ if (Instruction *I = dyn_cast<Instruction>(V))
+ if (isInstructionTriviallyDead(I))
+ deleteDeadInstruction(I, SE);
+}
+
bool LoopIdiomRecognize::runOnLoop(Loop *L, LPPassManager &LPM) {
CurLoop = L;
@@ -454,31 +462,35 @@ processLoopStridedStore(Value *DestPtr, unsigned StoreSize,
return false;
}
-
- // Okay, we have a strided store "p[i]" of a splattable value. We can turn
- // this into a memset in the loop preheader now if we want. However, this
- // would be unsafe to do if there is anything else in the loop that may read
- // or write to the aliased location. Check for an alias.
- if (mayLoopAccessLocation(DestPtr, AliasAnalysis::ModRef,
- CurLoop, BECount,
- StoreSize, getAnalysis<AliasAnalysis>(), TheStore))
- return false;
-
- // Okay, everything looks good, insert the memset.
- BasicBlock *Preheader = CurLoop->getLoopPreheader();
-
- IRBuilder<> Builder(Preheader->getTerminator());
-
// The trip count of the loop and the base pointer of the addrec SCEV is
// guaranteed to be loop invariant, which means that it should dominate the
- // header. Just insert code for it in the preheader.
+ // header. This allows us to insert code for it in the preheader.
+ BasicBlock *Preheader = CurLoop->getLoopPreheader();
+ IRBuilder<> Builder(Preheader->getTerminator());
SCEVExpander Expander(*SE);
-
+
+ // Okay, we have a strided store "p[i]" of a splattable value. We can turn
+ // this into a memset in the loop preheader now if we want. However, this
+ // would be unsafe to do if there is anything else in the loop that may read
+ // or write to the aliased location. Check for any overlap by generating the
+ // base pointer and checking the region.
unsigned AddrSpace = cast<PointerType>(DestPtr->getType())->getAddressSpace();
Value *BasePtr =
Expander.expandCodeFor(Ev->getStart(), Builder.getInt8PtrTy(AddrSpace),
Preheader->getTerminator());
+
+ if (mayLoopAccessLocation(BasePtr, AliasAnalysis::ModRef,
+ CurLoop, BECount,
+ StoreSize, getAnalysis<AliasAnalysis>(), TheStore)){
+ Expander.clear();
+ // If we generated new code for the base pointer, clean up.
+ deleteIfDeadInstruction(BasePtr, *SE);
+ return false;
+ }
+
+ // Okay, everything looks good, insert the memset.
+
// The # stored bytes is (BECount+1)*Size. Expand the trip count out to
// pointer size if it isn't already.
const Type *IntPtr = TD->getIntPtrType(DestPtr->getContext());
@@ -521,7 +533,7 @@ processLoopStridedStore(Value *DestPtr, unsigned StoreSize,
// Okay, the memset has been formed. Zap the original store and anything that
// feeds into it.
- DeleteDeadInstruction(TheStore, *SE);
+ deleteDeadInstruction(TheStore, *SE);
++NumMemSet;
return true;
}
@@ -539,41 +551,51 @@ processLoopStoreOfLoopLoad(StoreInst *SI, unsigned StoreSize,
LoadInst *LI = cast<LoadInst>(SI->getValueOperand());
+ // The trip count of the loop and the base pointer of the addrec SCEV is
+ // guaranteed to be loop invariant, which means that it should dominate the
+ // header. This allows us to insert code for it in the preheader.
+ BasicBlock *Preheader = CurLoop->getLoopPreheader();
+ IRBuilder<> Builder(Preheader->getTerminator());
+ SCEVExpander Expander(*SE);
+
// Okay, we have a strided store "p[i]" of a loaded value. We can turn
// this into a memcpy in the loop preheader now if we want. However, this
// would be unsafe to do if there is anything else in the loop that may read
- // or write to the stored location (including the load feeding the stores).
- // Check for an alias.
- if (mayLoopAccessLocation(SI->getPointerOperand(), AliasAnalysis::ModRef,
+ // or write the memory region we're storing to. This includes the load that
+ // feeds the stores. Check for an alias by generating the base address and
+ // checking everything.
+ Value *StoreBasePtr =
+ Expander.expandCodeFor(StoreEv->getStart(),
+ Builder.getInt8PtrTy(SI->getPointerAddressSpace()),
+ Preheader->getTerminator());
+
+ if (mayLoopAccessLocation(StoreBasePtr, AliasAnalysis::ModRef,
CurLoop, BECount, StoreSize,
- getAnalysis<AliasAnalysis>(), SI))
+ getAnalysis<AliasAnalysis>(), SI)) {
+ Expander.clear();
+ // If we generated new code for the base pointer, clean up.
+ deleteIfDeadInstruction(StoreBasePtr, *SE);
return false;
+ }
// For a memcpy, we have to make sure that the input array is not being
// mutated by the loop.
- if (mayLoopAccessLocation(LI->getPointerOperand(), AliasAnalysis::Mod,
- CurLoop, BECount, StoreSize,
- getAnalysis<AliasAnalysis>(), SI))
- return false;
-
- // Okay, everything looks good, insert the memcpy.
- BasicBlock *Preheader = CurLoop->getLoopPreheader();
-
- IRBuilder<> Builder(Preheader->getTerminator());
-
- // The trip count of the loop and the base pointer of the addrec SCEV is
- // guaranteed to be loop invariant, which means that it should dominate the
- // header. Just insert code for it in the preheader.
- SCEVExpander Expander(*SE);
-
Value *LoadBasePtr =
Expander.expandCodeFor(LoadEv->getStart(),
Builder.getInt8PtrTy(LI->getPointerAddressSpace()),
Preheader->getTerminator());
- Value *StoreBasePtr =
- Expander.expandCodeFor(StoreEv->getStart(),
- Builder.getInt8PtrTy(SI->getPointerAddressSpace()),
- Preheader->getTerminator());
+
+ if (mayLoopAccessLocation(LoadBasePtr, AliasAnalysis::Mod, CurLoop, BECount,
+ StoreSize, getAnalysis<AliasAnalysis>(), SI)) {
+ Expander.clear();
+ // If we generated new code for the base pointer, clean up.
+ deleteIfDeadInstruction(LoadBasePtr, *SE);
+ deleteIfDeadInstruction(StoreBasePtr, *SE);
+ return false;
+ }
+
+ // Okay, everything is safe, we can transform this!
+
// The # stored bytes is (BECount+1)*Size. Expand the trip count out to
// pointer size if it isn't already.
@@ -589,18 +611,19 @@ processLoopStoreOfLoopLoad(StoreInst *SI, unsigned StoreSize,
Value *NumBytes =
Expander.expandCodeFor(NumBytesS, IntPtr, Preheader->getTerminator());
- Value *NewCall =
+ CallInst *NewCall =
Builder.CreateMemCpy(StoreBasePtr, LoadBasePtr, NumBytes,
std::min(SI->getAlignment(), LI->getAlignment()));
+ NewCall->setDebugLoc(SI->getDebugLoc());
DEBUG(dbgs() << " Formed memcpy: " << *NewCall << "\n"
<< " from load ptr=" << *LoadEv << " at: " << *LI << "\n"
<< " from store ptr=" << *StoreEv << " at: " << *SI << "\n");
- (void)NewCall;
+
// Okay, the memset has been formed. Zap the original store and anything that
// feeds into it.
- DeleteDeadInstruction(SI, *SE);
+ deleteDeadInstruction(SI, *SE);
++NumMemCpy;
return true;
}
diff --git a/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 5abc790..73ebd61 100644
--- a/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -209,7 +209,12 @@ struct Formula {
/// when AM.Scale is not zero.
const SCEV *ScaledReg;
- Formula() : ScaledReg(0) {}
+ /// UnfoldedOffset - An additional constant offset which added near the
+ /// use. This requires a temporary register, but the offset itself can
+ /// live in an add immediate field rather than a register.
+ int64_t UnfoldedOffset;
+
+ Formula() : ScaledReg(0), UnfoldedOffset(0) {}
void InitialMatch(const SCEV *S, Loop *L, ScalarEvolution &SE);
@@ -379,6 +384,10 @@ void Formula::print(raw_ostream &OS) const {
OS << "<unknown>";
OS << ')';
}
+ if (UnfoldedOffset != 0) {
+ if (!First) OS << " + "; else First = false;
+ OS << "imm(" << UnfoldedOffset << ')';
+ }
}
void Formula::dump() const {
@@ -771,8 +780,10 @@ void Cost::RateFormula(const Formula &F,
RatePrimaryRegister(BaseReg, Regs, L, SE, DT);
}
- if (F.BaseRegs.size() > 1)
- NumBaseAdds += F.BaseRegs.size() - 1;
+ // Determine how many (unfolded) adds we'll need inside the loop.
+ size_t NumBaseParts = F.BaseRegs.size() + (F.UnfoldedOffset != 0);
+ if (NumBaseParts > 1)
+ NumBaseAdds += NumBaseParts - 1;
// Tally up the non-zero immediates.
for (SmallVectorImpl<int64_t>::const_iterator I = Offsets.begin(),
@@ -1793,7 +1804,8 @@ LSRInstance::OptimizeLoopTermCond() {
ExitingBlock->getInstList().insert(TermBr, Cond);
// Clone the IVUse, as the old use still exists!
- CondUse = &IU.AddUser(Cond, CondUse->getOperandValToReplace());
+ CondUse = &IU.AddUser(Cond, CondUse->getOperandValToReplace(),
+ CondUse->getPhi());
TermBr->replaceUsesOfWith(OldCond, Cond);
}
}
@@ -1945,7 +1957,8 @@ LSRInstance::FindUseWithSimilarFormula(const Formula &OrigF,
if (F.BaseRegs == OrigF.BaseRegs &&
F.ScaledReg == OrigF.ScaledReg &&
F.AM.BaseGV == OrigF.AM.BaseGV &&
- F.AM.Scale == OrigF.AM.Scale) {
+ F.AM.Scale == OrigF.AM.Scale &&
+ F.UnfoldedOffset == OrigF.UnfoldedOffset) {
if (F.AM.BaseOffs == 0)
return &LU;
// This is the formula where all the registers and symbols matched;
@@ -2061,6 +2074,10 @@ void LSRInstance::CollectFixupsAndInitialFormulae() {
// x == y --> x - y == 0
const SCEV *N = SE.getSCEV(NV);
if (SE.isLoopInvariant(N, L)) {
+ // S is normalized, so normalize N before folding it into S
+ // to keep the result normalized.
+ N = TransformForPostIncUse(Normalize, N, CI, 0,
+ LF.PostIncLoops, SE, DT);
Kind = LSRUse::ICmpZero;
S = SE.getMinusSCEV(N, S);
}
@@ -2313,8 +2330,29 @@ void LSRInstance::GenerateReassociations(LSRUse &LU, unsigned LUIdx,
if (InnerSum->isZero())
continue;
Formula F = Base;
- F.BaseRegs[i] = InnerSum;
- F.BaseRegs.push_back(*J);
+
+ // Add the remaining pieces of the add back into the new formula.
+ const SCEVConstant *InnerSumSC = dyn_cast<SCEVConstant>(InnerSum);
+ if (TLI && InnerSumSC &&
+ SE.getTypeSizeInBits(InnerSumSC->getType()) <= 64 &&
+ TLI->isLegalAddImmediate((uint64_t)F.UnfoldedOffset +
+ InnerSumSC->getValue()->getZExtValue())) {
+ F.UnfoldedOffset = (uint64_t)F.UnfoldedOffset +
+ InnerSumSC->getValue()->getZExtValue();
+ F.BaseRegs.erase(F.BaseRegs.begin() + i);
+ } else
+ F.BaseRegs[i] = InnerSum;
+
+ // Add J as its own register, or an unfolded immediate.
+ const SCEVConstant *SC = dyn_cast<SCEVConstant>(*J);
+ if (TLI && SC && SE.getTypeSizeInBits(SC->getType()) <= 64 &&
+ TLI->isLegalAddImmediate((uint64_t)F.UnfoldedOffset +
+ SC->getValue()->getZExtValue()))
+ F.UnfoldedOffset = (uint64_t)F.UnfoldedOffset +
+ SC->getValue()->getZExtValue();
+ else
+ F.BaseRegs.push_back(*J);
+
if (InsertFormula(LU, LUIdx, F))
// If that formula hadn't been seen before, recurse to find more like
// it.
@@ -2482,6 +2520,15 @@ void LSRInstance::GenerateICmpZeroScales(LSRUse &LU, unsigned LUIdx,
continue;
}
+ // Check that multiplying with the unfolded offset doesn't overflow.
+ if (F.UnfoldedOffset != 0) {
+ if (F.UnfoldedOffset == INT64_MIN && Factor == -1)
+ continue;
+ F.UnfoldedOffset = (uint64_t)F.UnfoldedOffset * Factor;
+ if (F.UnfoldedOffset / Factor != Base.UnfoldedOffset)
+ continue;
+ }
+
// If we make it here and it's legal, add it.
(void)InsertFormula(LU, LUIdx, F);
next:;
@@ -2664,7 +2711,7 @@ void LSRInstance::GenerateCrossUseConstantOffsets() {
// other orig regs.
ImmMapTy::const_iterator OtherImms[] = {
Imms.begin(), prior(Imms.end()),
- Imms.upper_bound((Imms.begin()->first + prior(Imms.end())->first) / 2)
+ Imms.lower_bound((Imms.begin()->first + prior(Imms.end())->first) / 2)
};
for (size_t i = 0, e = array_lengthof(OtherImms); i != e; ++i) {
ImmMapTy::const_iterator M = OtherImms[i];
@@ -2738,8 +2785,13 @@ void LSRInstance::GenerateCrossUseConstantOffsets() {
Formula NewF = F;
NewF.AM.BaseOffs = (uint64_t)NewF.AM.BaseOffs + Imm;
if (!isLegalUse(NewF.AM, LU.MinOffset, LU.MaxOffset,
- LU.Kind, LU.AccessTy, TLI))
- continue;
+ LU.Kind, LU.AccessTy, TLI)) {
+ if (!TLI ||
+ !TLI->isLegalAddImmediate((uint64_t)NewF.UnfoldedOffset + Imm))
+ continue;
+ NewF = F;
+ NewF.UnfoldedOffset = (uint64_t)NewF.UnfoldedOffset + Imm;
+ }
NewF.BaseRegs[N] = SE.getAddExpr(NegImmS, BaseReg);
// If the new formula has a constant in a register, and adding the
@@ -3488,6 +3540,14 @@ Value *LSRInstance::Expand(const LSRFixup &LF,
}
}
+ // Expand the unfolded offset portion.
+ int64_t UnfoldedOffset = F.UnfoldedOffset;
+ if (UnfoldedOffset != 0) {
+ // Just add the immediate values.
+ Ops.push_back(SE.getUnknown(ConstantInt::getSigned(IntTy,
+ UnfoldedOffset)));
+ }
+
// Emit instructions summing all the operands.
const SCEV *FullS = Ops.empty() ?
SE.getConstant(IntTy, 0) :
diff --git a/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
index b4e3d31..e05f29c 100644
--- a/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -258,6 +258,7 @@ bool LoopUnswitch::processCurrentLoop() {
if (LoopCond && SI->getNumCases() > 1) {
// Find a value to unswitch on:
// FIXME: this should chose the most expensive case!
+ // FIXME: scan for a case with a non-critical edge?
Constant *UnswitchVal = SI->getCaseValue(1);
// Do not process same value again and again.
if (!UnswitchedVals.insert(UnswitchVal))
@@ -560,6 +561,8 @@ void LoopUnswitch::SplitExitEdges(Loop *L,
BasicBlock *ExitBlock = ExitBlocks[i];
SmallVector<BasicBlock *, 4> Preds(pred_begin(ExitBlock),
pred_end(ExitBlock));
+ // Although SplitBlockPredecessors doesn't preserve loop-simplify in
+ // general, if we call it on all predecessors of all exits then it does.
SplitBlockPredecessors(ExitBlock, Preds.data(), Preds.size(),
".us-lcssa", this);
}
@@ -786,8 +789,13 @@ void LoopUnswitch::RemoveBlockIfDead(BasicBlock *BB,
// If this is the edge to the header block for a loop, remove the loop and
// promote all subloops.
if (Loop *BBLoop = LI->getLoopFor(BB)) {
- if (BBLoop->getLoopLatch() == BB)
+ if (BBLoop->getLoopLatch() == BB) {
RemoveLoopFromHierarchy(BBLoop);
+ if (currentLoop == BBLoop) {
+ currentLoop = 0;
+ redoLoop = false;
+ }
+ }
}
// Remove the block from the loop info, which removes it from any loops it
@@ -859,7 +867,6 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
// FOLD boolean conditions (X|LIC), (X&LIC). Fold conditional branches,
// selects, switches.
- std::vector<User*> Users(LIC->use_begin(), LIC->use_end());
std::vector<Instruction*> Worklist;
LLVMContext &Context = Val->getContext();
@@ -875,13 +882,14 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
Replacement = ConstantInt::get(Type::getInt1Ty(Val->getContext()),
!cast<ConstantInt>(Val)->getZExtValue());
- for (unsigned i = 0, e = Users.size(); i != e; ++i)
- if (Instruction *U = cast<Instruction>(Users[i])) {
- if (!L->contains(U))
- continue;
- U->replaceUsesOfWith(LIC, Replacement);
- Worklist.push_back(U);
- }
+ for (Value::use_iterator UI = LIC->use_begin(), E = LIC->use_end();
+ UI != E; ++UI) {
+ Instruction *U = dyn_cast<Instruction>(*UI);
+ if (!U || !L->contains(U))
+ continue;
+ U->replaceUsesOfWith(LIC, Replacement);
+ Worklist.push_back(U);
+ }
SimplifyCode(Worklist, L);
return;
}
@@ -889,9 +897,10 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
// Otherwise, we don't know the precise value of LIC, but we do know that it
// is certainly NOT "Val". As such, simplify any uses in the loop that we
// can. This case occurs when we unswitch switch statements.
- for (unsigned i = 0, e = Users.size(); i != e; ++i) {
- Instruction *U = cast<Instruction>(Users[i]);
- if (!L->contains(U))
+ for (Value::use_iterator UI = LIC->use_begin(), E = LIC->use_end();
+ UI != E; ++UI) {
+ Instruction *U = dyn_cast<Instruction>(*UI);
+ if (!U || !L->contains(U))
continue;
Worklist.push_back(U);
@@ -909,13 +918,22 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
// Found a dead case value. Don't remove PHI nodes in the
// successor if they become single-entry, those PHI nodes may
// be in the Users list.
-
+
+ BasicBlock *Switch = SI->getParent();
+ BasicBlock *SISucc = SI->getSuccessor(DeadCase);
+ BasicBlock *Latch = L->getLoopLatch();
+ if (!SI->findCaseDest(SISucc)) continue; // Edge is critical.
+ // If the DeadCase successor dominates the loop latch, then the
+ // transformation isn't safe since it will delete the sole predecessor edge
+ // to the latch.
+ if (Latch && DT->dominates(SISucc, Latch))
+ continue;
+
// FIXME: This is a hack. We need to keep the successor around
// and hooked up so as to preserve the loop structure, because
// trying to update it is complicated. So instead we preserve the
// loop structure and put the block on a dead code path.
- BasicBlock *Switch = SI->getParent();
- SplitEdge(Switch, SI->getSuccessor(DeadCase), this);
+ SplitEdge(Switch, SISucc, this);
// Compute the successors instead of relying on the return value
// of SplitEdge, since it may have split the switch successor
// after PHI nodes.
diff --git a/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index a3035cb..be5aa2e 100644
--- a/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -23,6 +23,7 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/Analysis/ValueTracking.h"
+#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/IRBuilder.h"
@@ -459,7 +460,10 @@ Instruction *MemCpyOpt::tryMergingIntoMemset(Instruction *StartInst,
for (unsigned i = 0, e = Range.TheStores.size(); i != e; ++i)
dbgs() << *Range.TheStores[i] << '\n';
dbgs() << "With: " << *AMemSet << '\n');
-
+
+ if (!Range.TheStores.empty())
+ AMemSet->setDebugLoc(Range.TheStores[0]->getDebugLoc());
+
// Zap all the stores.
for (SmallVector<Instruction*, 16>::const_iterator
SI = Range.TheStores.begin(),
@@ -484,11 +488,28 @@ bool MemCpyOpt::processStore(StoreInst *SI, BasicBlock::iterator &BBI) {
// a memcpy.
if (LoadInst *LI = dyn_cast<LoadInst>(SI->getOperand(0))) {
if (!LI->isVolatile() && LI->hasOneUse()) {
- MemDepResult dep = MD->getDependency(LI);
+ MemDepResult ldep = MD->getDependency(LI);
CallInst *C = 0;
- if (dep.isClobber() && !isa<MemCpyInst>(dep.getInst()))
- C = dyn_cast<CallInst>(dep.getInst());
-
+ if (ldep.isClobber() && !isa<MemCpyInst>(ldep.getInst()))
+ C = dyn_cast<CallInst>(ldep.getInst());
+
+ if (C) {
+ // Check that nothing touches the dest of the "copy" between
+ // the call and the store.
+ MemDepResult sdep = MD->getDependency(SI);
+ if (!sdep.isNonLocal()) {
+ bool FoundCall = false;
+ for (BasicBlock::iterator I = SI, E = sdep.getInst(); I != E; --I) {
+ if (&*I == C) {
+ FoundCall = true;
+ break;
+ }
+ }
+ if (!FoundCall)
+ C = 0;
+ }
+ }
+
if (C) {
bool changed = performCallSlotOptzn(LI,
SI->getPointerOperand()->stripPointerCasts(),
@@ -863,12 +884,16 @@ bool MemCpyOpt::processByValArgument(CallSite CS, unsigned ArgNo) {
if (C1 == 0 || C1->getValue().getZExtValue() < ByValSize)
return false;
- // Get the alignment of the byval. If it is greater than the memcpy, then we
- // can't do the substitution. If the call doesn't specify the alignment, then
- // it is some target specific value that we can't know.
+ // Get the alignment of the byval. If the call doesn't specify the alignment,
+ // then it is some target specific value that we can't know.
unsigned ByValAlign = CS.getParamAlignment(ArgNo+1);
- if (ByValAlign == 0 || MDep->getAlignment() < ByValAlign)
- return false;
+ if (ByValAlign == 0) return false;
+
+ // If it is greater than the memcpy, then we check to see if we can force the
+ // source of the memcpy to the alignment we need. If we fail, we bail out.
+ if (MDep->getAlignment() < ByValAlign &&
+ getOrEnforceKnownAlignment(MDep->getSource(),ByValAlign, TD) < ByValAlign)
+ return false;
// Verify that the copied-from memory doesn't change in between the memcpy and
// the byval call.
diff --git a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
index db8eb85..083412e 100644
--- a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -655,7 +655,7 @@ bool SCCPSolver::isEdgeFeasible(BasicBlock *From, BasicBlock *To) {
// Just mark all destinations executable!
// TODO: This could be improved if the operand is a [cast of a] BlockAddress.
- if (isa<IndirectBrInst>(&TI))
+ if (isa<IndirectBrInst>(TI))
return true;
#ifndef NDEBUG
diff --git a/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 8178c27..8938b28 100644
--- a/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -30,6 +30,7 @@
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
+#include "llvm/Analysis/DIBuilder.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/Loads.h"
#include "llvm/Analysis/ValueTracking.h"
@@ -341,7 +342,8 @@ void ConvertToScalarInfo::MergeInType(const Type *In, uint64_t Offset,
// If we're accessing something that could be an element of a vector, see
// if the implied vector agrees with what we already have and if Offset is
// compatible with it.
- if (Offset % EltSize == 0 && AllocaSize % EltSize == 0) {
+ if (Offset % EltSize == 0 && AllocaSize % EltSize == 0 &&
+ (!VectorTy || Offset * 8 < VectorTy->getPrimitiveSizeInBits())) {
if (!VectorTy) {
VectorTy = VectorType::get(In, AllocaSize/EltSize);
return;
@@ -741,8 +743,9 @@ ConvertScalar_ExtractValue(Value *FromVal, const Type *ToType,
// If the result alloca is a vector type, this is either an element
// access or a bitcast to another vector type of the same size.
if (const VectorType *VTy = dyn_cast<VectorType>(FromType)) {
+ unsigned FromTypeSize = TD.getTypeAllocSize(FromType);
unsigned ToTypeSize = TD.getTypeAllocSize(ToType);
- if (ToTypeSize == AllocaSize) {
+ if (FromTypeSize == ToTypeSize) {
// If the two types have the same primitive size, use a bit cast.
// Otherwise, it is two vectors with the same element type that has
// the same allocation size but different number of elements so use
@@ -754,13 +757,13 @@ ConvertScalar_ExtractValue(Value *FromVal, const Type *ToType,
return CreateShuffleVectorCast(FromVal, ToType, Builder);
}
- if (isPowerOf2_64(AllocaSize / ToTypeSize)) {
+ if (isPowerOf2_64(FromTypeSize / ToTypeSize)) {
assert(!(ToType->isVectorTy() && Offset != 0) && "Can't extract a value "
"of a smaller vector type at a nonzero offset.");
const Type *CastElementTy = getScaledElementType(FromType, ToType,
ToTypeSize * 8);
- unsigned NumCastVectorElements = AllocaSize / ToTypeSize;
+ unsigned NumCastVectorElements = FromTypeSize / ToTypeSize;
LLVMContext &Context = FromVal->getContext();
const Type *CastTy = VectorType::get(CastElementTy,
@@ -1051,8 +1054,9 @@ namespace {
class AllocaPromoter : public LoadAndStorePromoter {
AllocaInst *AI;
public:
- AllocaPromoter(const SmallVectorImpl<Instruction*> &Insts, SSAUpdater &S)
- : LoadAndStorePromoter(Insts, S), AI(0) {}
+ AllocaPromoter(const SmallVectorImpl<Instruction*> &Insts, SSAUpdater &S,
+ DbgDeclareInst *DD, DIBuilder *&DB)
+ : LoadAndStorePromoter(Insts, S, DD, DB), AI(0) {}
void run(AllocaInst *AI, const SmallVectorImpl<Instruction*> &Insts) {
// Remember which alloca we're promoting (for isInstInList).
@@ -1329,7 +1333,6 @@ static bool tryToMakeAllocaBePromotable(AllocaInst *AI, const TargetData *TD) {
return true;
}
-
bool SROA::performPromotion(Function &F) {
std::vector<AllocaInst*> Allocas;
DominatorTree *DT = 0;
@@ -1340,6 +1343,7 @@ bool SROA::performPromotion(Function &F) {
bool Changed = false;
SmallVector<Instruction*, 64> Insts;
+ DIBuilder *DIB = 0;
while (1) {
Allocas.clear();
@@ -1363,8 +1367,11 @@ bool SROA::performPromotion(Function &F) {
for (Value::use_iterator UI = AI->use_begin(), E = AI->use_end();
UI != E; ++UI)
Insts.push_back(cast<Instruction>(*UI));
-
- AllocaPromoter(Insts, SSA).run(AI, Insts);
+
+ DbgDeclareInst *DDI = FindAllocaDbgDeclare(AI);
+ if (DDI && !DIB)
+ DIB = new DIBuilder(*AI->getParent()->getParent()->getParent());
+ AllocaPromoter(Insts, SSA, DDI, DIB).run(AI, Insts);
Insts.clear();
}
}
@@ -1372,6 +1379,10 @@ bool SROA::performPromotion(Function &F) {
Changed = true;
}
+ // FIXME: Is there a better way to handle the lazy initialization of DIB
+ // so that there doesn't need to be an explicit delete?
+ delete DIB;
+
return Changed;
}
@@ -1831,9 +1842,10 @@ void SROA::RewriteForScalarRepl(Instruction *I, AllocaInst *AI, uint64_t Offset,
// %insert = insertvalue { i32, i32 } %insert.0, i32 %load.1, 1
// (Also works for arrays instead of structs)
Value *Insert = UndefValue::get(LIType);
+ IRBuilder<> Builder(LI);
for (unsigned i = 0, e = NewElts.size(); i != e; ++i) {
- Value *Load = new LoadInst(NewElts[i], "load", LI);
- Insert = InsertValueInst::Create(Insert, Load, i, "insert", LI);
+ Value *Load = Builder.CreateLoad(NewElts[i], "load");
+ Insert = Builder.CreateInsertValue(Insert, Load, i, "insert");
}
LI->replaceAllUsesWith(Insert);
DeadInsts.push_back(LI);
@@ -1858,9 +1870,10 @@ void SROA::RewriteForScalarRepl(Instruction *I, AllocaInst *AI, uint64_t Offset,
// %val.1 = extractvalue { i32, i32 } %val, 1
// store i32 %val.1, i32* %alloc.1
// (Also works for arrays instead of structs)
+ IRBuilder<> Builder(SI);
for (unsigned i = 0, e = NewElts.size(); i != e; ++i) {
- Value *Extract = ExtractValueInst::Create(Val, i, Val->getName(), SI);
- new StoreInst(Extract, NewElts[i], SI);
+ Value *Extract = Builder.CreateExtractValue(Val, i, Val->getName());
+ Builder.CreateStore(Extract, NewElts[i]);
}
DeadInsts.push_back(SI);
} else if (SIType->isIntegerTy() &&
@@ -2481,19 +2494,22 @@ static bool isOnlyCopiedFromConstantGlobal(Value *V, MemTransferInst *&TheCopy,
}
if (CallSite CS = U) {
- // If this is a readonly/readnone call site, then we know it is just a
- // load and we can ignore it.
- if (CS.onlyReadsMemory())
- continue;
-
// If this is the function being called then we treat it like a load and
// ignore it.
if (CS.isCallee(UI))
continue;
+ // If this is a readonly/readnone call site, then we know it is just a
+ // load (but one that potentially returns the value itself), so we can
+ // ignore it if we know that the value isn't captured.
+ unsigned ArgNo = CS.getArgumentNo(UI);
+ if (CS.onlyReadsMemory() &&
+ (CS.getInstruction()->use_empty() ||
+ CS.paramHasAttr(ArgNo+1, Attribute::NoCapture)))
+ continue;
+
// If this is being passed as a byval argument, the caller is making a
// copy, so it is only a read of the alloca.
- unsigned ArgNo = CS.getArgumentNo(UI);
if (CS.paramHasAttr(ArgNo+1, Attribute::ByVal))
continue;
}
diff --git a/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index 1137c2b..7e9cc80 100644
--- a/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -96,6 +96,7 @@ static void ChangeToCall(InvokeInst *II) {
NewCall->takeName(II);
NewCall->setCallingConv(II->getCallingConv());
NewCall->setAttributes(II->getAttributes());
+ NewCall->setDebugLoc(II->getDebugLoc());
II->replaceAllUsesWith(NewCall);
// Follow the call by a branch to the normal destination.
@@ -163,7 +164,7 @@ static bool MarkAliveBlocks(BasicBlock *BB,
Changed = true;
}
- Changed |= ConstantFoldTerminator(BB);
+ Changed |= ConstantFoldTerminator(BB, true);
for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI)
Worklist.push_back(*SI);
} while (!Worklist.empty());
diff --git a/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 539cc6f..e21eb9d 100644
--- a/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -59,6 +59,7 @@
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
+#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Analysis/CaptureTracking.h"
#include "llvm/Analysis/InlineCost.h"
@@ -209,10 +210,10 @@ bool TailCallElim::runOnFunction(Function &F) {
}
}
- // Finally, if this function contains no non-escaping allocas, mark all calls
- // in the function as eligible for tail calls (there is no stack memory for
- // them to access).
- if (!FunctionContainsEscapingAllocas)
+ // Finally, if this function contains no non-escaping allocas, or calls
+ // setjmp, mark all calls in the function as eligible for tail calls
+ //(there is no stack memory for them to access).
+ if (!FunctionContainsEscapingAllocas && !F.callsFunctionThatReturnsTwice())
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
if (CallInst *CI = dyn_cast<CallInst>(I)) {
diff --git a/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index c705cc5..92464e8 100644
--- a/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -542,11 +542,9 @@ ReturnInst *llvm::FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB,
/// GetFirstDebugLocInBasicBlock - Return first valid DebugLoc entry in a
/// given basic block.
DebugLoc llvm::GetFirstDebugLocInBasicBlock(const BasicBlock *BB) {
- for (BasicBlock::const_iterator BI = BB->begin(), BE = BB->end();
- BI != BE; ++BI) {
- DebugLoc DL = BI->getDebugLoc();
- if (!DL.isUnknown())
- return DL;
- }
+ if (const Instruction *I = BB->getFirstNonPHI())
+ return I->getDebugLoc();
+ // Scanning entire block may be too expensive, if the first instruction
+ // does not have valid location info.
return DebugLoc();
}
diff --git a/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp b/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
index caf2aeb..d6206a3 100644
--- a/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -180,7 +180,8 @@ BasicBlock *llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
BasicBlock *NewBB = BasicBlock::Create(TI->getContext(),
TIBB->getName() + "." + DestBB->getName() + "_crit_edge");
// Create our unconditional branch.
- BranchInst::Create(DestBB, NewBB);
+ BranchInst *NewBI = BranchInst::Create(DestBB, NewBB);
+ NewBI->setDebugLoc(TI->getDebugLoc());
// Branch to the new block, breaking the edge.
TI->setSuccessor(SuccNum, NewBB);
diff --git a/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
index 4a90751..14bb17f 100644
--- a/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
@@ -362,12 +362,8 @@ bool SimplifyFortifiedLibCalls::fold(CallInst *CI, const TargetData *TD) {
Function *Callee = CI->getCalledFunction();
StringRef Name = Callee->getName();
const FunctionType *FT = Callee->getFunctionType();
- BasicBlock *BB = CI->getParent();
LLVMContext &Context = CI->getParent()->getContext();
- IRBuilder<> B(Context);
-
- // Set the builder to the instruction after the call.
- B.SetInsertPoint(BB, CI);
+ IRBuilder<> B(CI);
if (Name == "__memcpy_chk") {
// Check if this has the right signature.
diff --git a/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp b/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 7d17909..8416170 100644
--- a/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -10,6 +10,13 @@
// This file implements inlining of a function into a call site, resolving
// parameters and the return value as appropriate.
//
+// The code in this file for handling inlines through invoke
+// instructions preserves semantics only under some assumptions about
+// the behavior of unwinders which correspond to gcc-style libUnwind
+// exception personality functions. Eventually the IR will be
+// improved to make this unnecessary, but until then, this code is
+// marked [LIBUNWIND].
+//
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Utils/Cloning.h"
@@ -28,6 +35,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CallSite.h"
+#include "llvm/Support/IRBuilder.h"
using namespace llvm;
bool llvm::InlineFunction(CallInst *CI, InlineFunctionInfo &IFI) {
@@ -37,6 +45,372 @@ bool llvm::InlineFunction(InvokeInst *II, InlineFunctionInfo &IFI) {
return InlineFunction(CallSite(II), IFI);
}
+/// [LIBUNWIND] Look for an llvm.eh.exception call in the given block.
+static EHExceptionInst *findExceptionInBlock(BasicBlock *bb) {
+ for (BasicBlock::iterator i = bb->begin(), e = bb->end(); i != e; i++) {
+ EHExceptionInst *exn = dyn_cast<EHExceptionInst>(i);
+ if (exn) return exn;
+ }
+
+ return 0;
+}
+
+/// [LIBUNWIND] Look for the 'best' llvm.eh.selector instruction for
+/// the given llvm.eh.exception call.
+static EHSelectorInst *findSelectorForException(EHExceptionInst *exn) {
+ BasicBlock *exnBlock = exn->getParent();
+
+ EHSelectorInst *outOfBlockSelector = 0;
+ for (Instruction::use_iterator
+ ui = exn->use_begin(), ue = exn->use_end(); ui != ue; ++ui) {
+ EHSelectorInst *sel = dyn_cast<EHSelectorInst>(*ui);
+ if (!sel) continue;
+
+ // Immediately accept an eh.selector in the same block as the
+ // excepton call.
+ if (sel->getParent() == exnBlock) return sel;
+
+ // Otherwise, use the first selector we see.
+ if (!outOfBlockSelector) outOfBlockSelector = sel;
+ }
+
+ return outOfBlockSelector;
+}
+
+/// [LIBUNWIND] Find the (possibly absent) call to @llvm.eh.selector
+/// in the given landing pad. In principle, llvm.eh.exception is
+/// required to be in the landing pad; in practice, SplitCriticalEdge
+/// can break that invariant, and then inlining can break it further.
+/// There's a real need for a reliable solution here, but until that
+/// happens, we have some fragile workarounds here.
+static EHSelectorInst *findSelectorForLandingPad(BasicBlock *lpad) {
+ // Look for an exception call in the actual landing pad.
+ EHExceptionInst *exn = findExceptionInBlock(lpad);
+ if (exn) return findSelectorForException(exn);
+
+ // Okay, if that failed, look for one in an obvious successor. If
+ // we find one, we'll fix the IR by moving things back to the
+ // landing pad.
+
+ bool dominates = true; // does the lpad dominate the exn call
+ BasicBlock *nonDominated = 0; // if not, the first non-dominated block
+ BasicBlock *lastDominated = 0; // and the block which branched to it
+
+ BasicBlock *exnBlock = lpad;
+
+ // We need to protect against lpads that lead into infinite loops.
+ SmallPtrSet<BasicBlock*,4> visited;
+ visited.insert(exnBlock);
+
+ do {
+ // We're not going to apply this hack to anything more complicated
+ // than a series of unconditional branches, so if the block
+ // doesn't terminate in an unconditional branch, just fail. More
+ // complicated cases can arise when, say, sinking a call into a
+ // split unwind edge and then inlining it; but that can do almost
+ // *anything* to the CFG, including leaving the selector
+ // completely unreachable. The only way to fix that properly is
+ // to (1) prohibit transforms which move the exception or selector
+ // values away from the landing pad, e.g. by producing them with
+ // instructions that are pinned to an edge like a phi, or
+ // producing them with not-really-instructions, and (2) making
+ // transforms which split edges deal with that.
+ BranchInst *branch = dyn_cast<BranchInst>(&exnBlock->back());
+ if (!branch || branch->isConditional()) return 0;
+
+ BasicBlock *successor = branch->getSuccessor(0);
+
+ // Fail if we found an infinite loop.
+ if (!visited.insert(successor)) return 0;
+
+ // If the successor isn't dominated by exnBlock:
+ if (!successor->getSinglePredecessor()) {
+ // We don't want to have to deal with threading the exception
+ // through multiple levels of phi, so give up if we've already
+ // followed a non-dominating edge.
+ if (!dominates) return 0;
+
+ // Otherwise, remember this as a non-dominating edge.
+ dominates = false;
+ nonDominated = successor;
+ lastDominated = exnBlock;
+ }
+
+ exnBlock = successor;
+
+ // Can we stop here?
+ exn = findExceptionInBlock(exnBlock);
+ } while (!exn);
+
+ // Look for a selector call for the exception we found.
+ EHSelectorInst *selector = findSelectorForException(exn);
+ if (!selector) return 0;
+
+ // The easy case is when the landing pad still dominates the
+ // exception call, in which case we can just move both calls back to
+ // the landing pad.
+ if (dominates) {
+ selector->moveBefore(lpad->getFirstNonPHI());
+ exn->moveBefore(selector);
+ return selector;
+ }
+
+ // Otherwise, we have to split at the first non-dominating block.
+ // The CFG looks basically like this:
+ // lpad:
+ // phis_0
+ // insnsAndBranches_1
+ // br label %nonDominated
+ // nonDominated:
+ // phis_2
+ // insns_3
+ // %exn = call i8* @llvm.eh.exception()
+ // insnsAndBranches_4
+ // %selector = call @llvm.eh.selector(i8* %exn, ...
+ // We need to turn this into:
+ // lpad:
+ // phis_0
+ // %exn0 = call i8* @llvm.eh.exception()
+ // %selector0 = call @llvm.eh.selector(i8* %exn0, ...
+ // insnsAndBranches_1
+ // br label %split // from lastDominated
+ // nonDominated:
+ // phis_2 (without edge from lastDominated)
+ // %exn1 = call i8* @llvm.eh.exception()
+ // %selector1 = call i8* @llvm.eh.selector(i8* %exn1, ...
+ // br label %split
+ // split:
+ // phis_2 (edge from lastDominated, edge from split)
+ // %exn = phi ...
+ // %selector = phi ...
+ // insns_3
+ // insnsAndBranches_4
+
+ assert(nonDominated);
+ assert(lastDominated);
+
+ // First, make clones of the intrinsics to go in lpad.
+ EHExceptionInst *lpadExn = cast<EHExceptionInst>(exn->clone());
+ EHSelectorInst *lpadSelector = cast<EHSelectorInst>(selector->clone());
+ lpadSelector->setArgOperand(0, lpadExn);
+ lpadSelector->insertBefore(lpad->getFirstNonPHI());
+ lpadExn->insertBefore(lpadSelector);
+
+ // Split the non-dominated block.
+ BasicBlock *split =
+ nonDominated->splitBasicBlock(nonDominated->getFirstNonPHI(),
+ nonDominated->getName() + ".lpad-fix");
+
+ // Redirect the last dominated branch there.
+ cast<BranchInst>(lastDominated->back()).setSuccessor(0, split);
+
+ // Move the existing intrinsics to the end of the old block.
+ selector->moveBefore(&nonDominated->back());
+ exn->moveBefore(selector);
+
+ Instruction *splitIP = &split->front();
+
+ // For all the phis in nonDominated, make a new phi in split to join
+ // that phi with the edge from lastDominated.
+ for (BasicBlock::iterator
+ i = nonDominated->begin(), e = nonDominated->end(); i != e; ++i) {
+ PHINode *phi = dyn_cast<PHINode>(i);
+ if (!phi) break;
+
+ PHINode *splitPhi = PHINode::Create(phi->getType(), 2, phi->getName(),
+ splitIP);
+ phi->replaceAllUsesWith(splitPhi);
+ splitPhi->addIncoming(phi, nonDominated);
+ splitPhi->addIncoming(phi->removeIncomingValue(lastDominated),
+ lastDominated);
+ }
+
+ // Make new phis for the exception and selector.
+ PHINode *exnPhi = PHINode::Create(exn->getType(), 2, "", splitIP);
+ exn->replaceAllUsesWith(exnPhi);
+ selector->setArgOperand(0, exn); // except for this use
+ exnPhi->addIncoming(exn, nonDominated);
+ exnPhi->addIncoming(lpadExn, lastDominated);
+
+ PHINode *selectorPhi = PHINode::Create(selector->getType(), 2, "", splitIP);
+ selector->replaceAllUsesWith(selectorPhi);
+ selectorPhi->addIncoming(selector, nonDominated);
+ selectorPhi->addIncoming(lpadSelector, lastDominated);
+
+ return lpadSelector;
+}
+
+namespace {
+ /// A class for recording information about inlining through an invoke.
+ class InvokeInliningInfo {
+ BasicBlock *OuterUnwindDest;
+ EHSelectorInst *OuterSelector;
+ BasicBlock *InnerUnwindDest;
+ PHINode *InnerExceptionPHI;
+ PHINode *InnerSelectorPHI;
+ SmallVector<Value*, 8> UnwindDestPHIValues;
+
+ public:
+ InvokeInliningInfo(InvokeInst *II) :
+ OuterUnwindDest(II->getUnwindDest()), OuterSelector(0),
+ InnerUnwindDest(0), InnerExceptionPHI(0), InnerSelectorPHI(0) {
+
+ // If there are PHI nodes in the unwind destination block, we
+ // need to keep track of which values came into them from the
+ // invoke before removing the edge from this block.
+ llvm::BasicBlock *invokeBB = II->getParent();
+ for (BasicBlock::iterator I = OuterUnwindDest->begin();
+ isa<PHINode>(I); ++I) {
+ // Save the value to use for this edge.
+ PHINode *phi = cast<PHINode>(I);
+ UnwindDestPHIValues.push_back(phi->getIncomingValueForBlock(invokeBB));
+ }
+ }
+
+ /// The outer unwind destination is the target of unwind edges
+ /// introduced for calls within the inlined function.
+ BasicBlock *getOuterUnwindDest() const {
+ return OuterUnwindDest;
+ }
+
+ EHSelectorInst *getOuterSelector() {
+ if (!OuterSelector)
+ OuterSelector = findSelectorForLandingPad(OuterUnwindDest);
+ return OuterSelector;
+ }
+
+ BasicBlock *getInnerUnwindDest();
+
+ bool forwardEHResume(CallInst *call, BasicBlock *src);
+
+ /// Add incoming-PHI values to the unwind destination block for
+ /// the given basic block, using the values for the original
+ /// invoke's source block.
+ void addIncomingPHIValuesFor(BasicBlock *BB) const {
+ addIncomingPHIValuesForInto(BB, OuterUnwindDest);
+ }
+
+ void addIncomingPHIValuesForInto(BasicBlock *src, BasicBlock *dest) const {
+ BasicBlock::iterator I = dest->begin();
+ for (unsigned i = 0, e = UnwindDestPHIValues.size(); i != e; ++i, ++I) {
+ PHINode *phi = cast<PHINode>(I);
+ phi->addIncoming(UnwindDestPHIValues[i], src);
+ }
+ }
+ };
+}
+
+/// Get or create a target for the branch out of rewritten calls to
+/// llvm.eh.resume.
+BasicBlock *InvokeInliningInfo::getInnerUnwindDest() {
+ if (InnerUnwindDest) return InnerUnwindDest;
+
+ // Find and hoist the llvm.eh.exception and llvm.eh.selector calls
+ // in the outer landing pad to immediately following the phis.
+ EHSelectorInst *selector = getOuterSelector();
+ if (!selector) return 0;
+
+ // The call to llvm.eh.exception *must* be in the landing pad.
+ Instruction *exn = cast<Instruction>(selector->getArgOperand(0));
+ assert(exn->getParent() == OuterUnwindDest);
+
+ // TODO: recognize when we've already done this, so that we don't
+ // get a linear number of these when inlining calls into lots of
+ // invokes with the same landing pad.
+
+ // Do the hoisting.
+ Instruction *splitPoint = exn->getParent()->getFirstNonPHI();
+ assert(splitPoint != selector && "selector-on-exception dominance broken!");
+ if (splitPoint == exn) {
+ selector->removeFromParent();
+ selector->insertAfter(exn);
+ splitPoint = selector->getNextNode();
+ } else {
+ exn->moveBefore(splitPoint);
+ selector->moveBefore(splitPoint);
+ }
+
+ // Split the landing pad.
+ InnerUnwindDest = OuterUnwindDest->splitBasicBlock(splitPoint,
+ OuterUnwindDest->getName() + ".body");
+
+ // The number of incoming edges we expect to the inner landing pad.
+ const unsigned phiCapacity = 2;
+
+ // Create corresponding new phis for all the phis in the outer landing pad.
+ BasicBlock::iterator insertPoint = InnerUnwindDest->begin();
+ BasicBlock::iterator I = OuterUnwindDest->begin();
+ for (unsigned i = 0, e = UnwindDestPHIValues.size(); i != e; ++i, ++I) {
+ PHINode *outerPhi = cast<PHINode>(I);
+ PHINode *innerPhi = PHINode::Create(outerPhi->getType(), phiCapacity,
+ outerPhi->getName() + ".lpad-body",
+ insertPoint);
+ outerPhi->replaceAllUsesWith(innerPhi);
+ innerPhi->addIncoming(outerPhi, OuterUnwindDest);
+ }
+
+ // Create a phi for the exception value...
+ InnerExceptionPHI = PHINode::Create(exn->getType(), phiCapacity,
+ "exn.lpad-body", insertPoint);
+ exn->replaceAllUsesWith(InnerExceptionPHI);
+ selector->setArgOperand(0, exn); // restore this use
+ InnerExceptionPHI->addIncoming(exn, OuterUnwindDest);
+
+ // ...and the selector.
+ InnerSelectorPHI = PHINode::Create(selector->getType(), phiCapacity,
+ "selector.lpad-body", insertPoint);
+ selector->replaceAllUsesWith(InnerSelectorPHI);
+ InnerSelectorPHI->addIncoming(selector, OuterUnwindDest);
+
+ // All done.
+ return InnerUnwindDest;
+}
+
+/// [LIBUNWIND] Try to forward the given call, which logically occurs
+/// at the end of the given block, as a branch to the inner unwind
+/// block. Returns true if the call was forwarded.
+bool InvokeInliningInfo::forwardEHResume(CallInst *call, BasicBlock *src) {
+ // First, check whether this is a call to the intrinsic.
+ Function *fn = dyn_cast<Function>(call->getCalledValue());
+ if (!fn || fn->getName() != "llvm.eh.resume")
+ return false;
+
+ // At this point, we need to return true on all paths, because
+ // otherwise we'll construct an invoke of the intrinsic, which is
+ // not well-formed.
+
+ // Try to find or make an inner unwind dest, which will fail if we
+ // can't find a selector call for the outer unwind dest.
+ BasicBlock *dest = getInnerUnwindDest();
+ bool hasSelector = (dest != 0);
+
+ // If we failed, just use the outer unwind dest, dropping the
+ // exception and selector on the floor.
+ if (!hasSelector)
+ dest = OuterUnwindDest;
+
+ // Make a branch.
+ BranchInst::Create(dest, src);
+
+ // Update the phis in the destination. They were inserted in an
+ // order which makes this work.
+ addIncomingPHIValuesForInto(src, dest);
+
+ if (hasSelector) {
+ InnerExceptionPHI->addIncoming(call->getArgOperand(0), src);
+ InnerSelectorPHI->addIncoming(call->getArgOperand(1), src);
+ }
+
+ return true;
+}
+
+/// [LIBUNWIND] Check whether this selector is "only cleanups":
+/// call i32 @llvm.eh.selector(blah, blah, i32 0)
+static bool isCleanupOnlySelector(EHSelectorInst *selector) {
+ if (selector->getNumArgOperands() != 3) return false;
+ ConstantInt *val = dyn_cast<ConstantInt>(selector->getArgOperand(2));
+ return (val && val->isZero());
+}
/// HandleCallsInBlockInlinedThroughInvoke - When we inline a basic block into
/// an invoke, we have to turn all of the calls that can throw into
@@ -44,9 +418,9 @@ bool llvm::InlineFunction(InvokeInst *II, InlineFunctionInfo &IFI) {
/// it rewrites them to be invokes that jump to InvokeDest and fills in the PHI
/// nodes in that block with the values specified in InvokeDestPHIValues.
///
-static void HandleCallsInBlockInlinedThroughInvoke(BasicBlock *BB,
- BasicBlock *InvokeDest,
- const SmallVectorImpl<Value*> &InvokeDestPHIValues) {
+/// Returns true to indicate that the next block should be skipped.
+static bool HandleCallsInBlockInlinedThroughInvoke(BasicBlock *BB,
+ InvokeInliningInfo &Invoke) {
for (BasicBlock::iterator BBI = BB->begin(), E = BB->end(); BBI != E; ) {
Instruction *I = BBI++;
@@ -54,6 +428,38 @@ static void HandleCallsInBlockInlinedThroughInvoke(BasicBlock *BB,
// instructions require no special handling.
CallInst *CI = dyn_cast<CallInst>(I);
if (CI == 0) continue;
+
+ // LIBUNWIND: merge selector instructions.
+ if (EHSelectorInst *Inner = dyn_cast<EHSelectorInst>(CI)) {
+ EHSelectorInst *Outer = Invoke.getOuterSelector();
+ if (!Outer) continue;
+
+ bool innerIsOnlyCleanup = isCleanupOnlySelector(Inner);
+ bool outerIsOnlyCleanup = isCleanupOnlySelector(Outer);
+
+ // If both selectors contain only cleanups, we don't need to do
+ // anything. TODO: this is really just a very specific instance
+ // of a much more general optimization.
+ if (innerIsOnlyCleanup && outerIsOnlyCleanup) continue;
+
+ // Otherwise, we just append the outer selector to the inner selector.
+ SmallVector<Value*, 16> NewSelector;
+ for (unsigned i = 0, e = Inner->getNumArgOperands(); i != e; ++i)
+ NewSelector.push_back(Inner->getArgOperand(i));
+ for (unsigned i = 2, e = Outer->getNumArgOperands(); i != e; ++i)
+ NewSelector.push_back(Outer->getArgOperand(i));
+
+ CallInst *NewInner = CallInst::Create(Inner->getCalledValue(),
+ NewSelector.begin(),
+ NewSelector.end(),
+ "",
+ Inner);
+ // No need to copy attributes, calling convention, etc.
+ NewInner->takeName(Inner);
+ Inner->replaceAllUsesWith(NewInner);
+ Inner->eraseFromParent();
+ continue;
+ }
// If this call cannot unwind, don't convert it to an invoke.
if (CI->doesNotThrow())
@@ -62,37 +468,45 @@ static void HandleCallsInBlockInlinedThroughInvoke(BasicBlock *BB,
// Convert this function call into an invoke instruction.
// First, split the basic block.
BasicBlock *Split = BB->splitBasicBlock(CI, CI->getName()+".noexc");
-
- // Next, create the new invoke instruction, inserting it at the end
- // of the old basic block.
+
+ // Delete the unconditional branch inserted by splitBasicBlock
+ BB->getInstList().pop_back();
+
+ // LIBUNWIND: If this is a call to @llvm.eh.resume, just branch
+ // directly to the new landing pad.
+ if (Invoke.forwardEHResume(CI, BB)) {
+ // TODO: 'Split' is now unreachable; clean it up.
+
+ // We want to leave the original call intact so that the call
+ // graph and other structures won't get misled. We also have to
+ // avoid processing the next block, or we'll iterate here forever.
+ return true;
+ }
+
+ // Otherwise, create the new invoke instruction.
ImmutableCallSite CS(CI);
SmallVector<Value*, 8> InvokeArgs(CS.arg_begin(), CS.arg_end());
InvokeInst *II =
- InvokeInst::Create(CI->getCalledValue(), Split, InvokeDest,
+ InvokeInst::Create(CI->getCalledValue(), Split,
+ Invoke.getOuterUnwindDest(),
InvokeArgs.begin(), InvokeArgs.end(),
- CI->getName(), BB->getTerminator());
+ CI->getName(), BB);
II->setCallingConv(CI->getCallingConv());
II->setAttributes(CI->getAttributes());
// Make sure that anything using the call now uses the invoke! This also
// updates the CallGraph if present, because it uses a WeakVH.
CI->replaceAllUsesWith(II);
-
- // Delete the unconditional branch inserted by splitBasicBlock
- BB->getInstList().pop_back();
+
Split->getInstList().pop_front(); // Delete the original call
-
+
// Update any PHI nodes in the exceptional block to indicate that
// there is now a new entry in them.
- unsigned i = 0;
- for (BasicBlock::iterator I = InvokeDest->begin();
- isa<PHINode>(I); ++I, ++i)
- cast<PHINode>(I)->addIncoming(InvokeDestPHIValues[i], BB);
-
- // This basic block is now complete, the caller will continue scanning the
- // next one.
- return;
+ Invoke.addIncomingPHIValuesFor(BB);
+ return false;
}
+
+ return false;
}
@@ -106,17 +520,6 @@ static void HandleCallsInBlockInlinedThroughInvoke(BasicBlock *BB,
static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
ClonedCodeInfo &InlinedCodeInfo) {
BasicBlock *InvokeDest = II->getUnwindDest();
- SmallVector<Value*, 8> InvokeDestPHIValues;
-
- // If there are PHI nodes in the unwind destination block, we need to
- // keep track of which values came into them from this invoke, then remove
- // the entry for this block.
- BasicBlock *InvokeBlock = II->getParent();
- for (BasicBlock::iterator I = InvokeDest->begin(); isa<PHINode>(I); ++I) {
- PHINode *PN = cast<PHINode>(I);
- // Save the value to use for this edge.
- InvokeDestPHIValues.push_back(PN->getIncomingValueForBlock(InvokeBlock));
- }
Function *Caller = FirstNewBlock->getParent();
@@ -132,11 +535,17 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
InvokeDest->removePredecessor(II->getParent());
return;
}
+
+ InvokeInliningInfo Invoke(II);
for (Function::iterator BB = FirstNewBlock, E = Caller->end(); BB != E; ++BB){
if (InlinedCodeInfo.ContainsCalls)
- HandleCallsInBlockInlinedThroughInvoke(BB, InvokeDest,
- InvokeDestPHIValues);
+ if (HandleCallsInBlockInlinedThroughInvoke(BB, Invoke)) {
+ // Honor a request to skip the next block. We don't need to
+ // consider UnwindInsts in this case either.
+ ++BB;
+ continue;
+ }
if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
// An UnwindInst requires special handling when it gets inlined into an
@@ -150,12 +559,7 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock,
// Update any PHI nodes in the exceptional block to indicate that
// there is now a new entry in them.
- unsigned i = 0;
- for (BasicBlock::iterator I = InvokeDest->begin();
- isa<PHINode>(I); ++I, ++i) {
- PHINode *PN = cast<PHINode>(I);
- PN->addIncoming(InvokeDestPHIValues[i], BB);
- }
+ Invoke.addIncomingPHIValuesFor(BB);
}
}
@@ -299,21 +703,48 @@ static Value *HandleByValArgument(Value *Arg, Instruction *TheCall,
ConstantInt::get(Type::getInt32Ty(Context), 1),
ConstantInt::getFalse(Context) // isVolatile
};
- CallInst *TheMemCpy =
- CallInst::Create(MemCpyFn, CallArgs, CallArgs+5, "", TheCall);
-
- // If we have a call graph, update it.
- if (CallGraph *CG = IFI.CG) {
- CallGraphNode *MemCpyCGN = CG->getOrInsertFunction(MemCpyFn);
- CallGraphNode *CallerNode = (*CG)[Caller];
- CallerNode->addCalledFunction(TheMemCpy, MemCpyCGN);
- }
+ CallInst::Create(MemCpyFn, CallArgs, CallArgs+5, "", TheCall);
// Uses of the argument in the function should use our new alloca
// instead.
return NewAlloca;
}
+// isUsedByLifetimeMarker - Check whether this Value is used by a lifetime
+// intrinsic.
+static bool isUsedByLifetimeMarker(Value *V) {
+ for (Value::use_iterator UI = V->use_begin(), UE = V->use_end(); UI != UE;
+ ++UI) {
+ if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(*UI)) {
+ switch (II->getIntrinsicID()) {
+ default: break;
+ case Intrinsic::lifetime_start:
+ case Intrinsic::lifetime_end:
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+// hasLifetimeMarkers - Check whether the given alloca already has
+// lifetime.start or lifetime.end intrinsics.
+static bool hasLifetimeMarkers(AllocaInst *AI) {
+ const Type *Int8PtrTy = Type::getInt8PtrTy(AI->getType()->getContext());
+ if (AI->getType() == Int8PtrTy)
+ return isUsedByLifetimeMarker(AI);
+
+ // Do a scan to find all the bitcasts to i8*.
+ for (Value::use_iterator I = AI->use_begin(), E = AI->use_end(); I != E;
+ ++I) {
+ if (I->getType() != Int8PtrTy) continue;
+ if (!isa<BitCastInst>(*I)) continue;
+ if (isUsedByLifetimeMarker(*I))
+ return true;
+ }
+ return false;
+}
+
// InlineFunction - This function inlines the called function into the basic
// block of the caller. This returns false if it is not possible to inline this
// call. The program is still in a well defined state if this occurs though.
@@ -460,6 +891,26 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI) {
}
}
+ // Leave lifetime markers for the static alloca's, scoping them to the
+ // function we just inlined.
+ if (!IFI.StaticAllocas.empty()) {
+ IRBuilder<> builder(FirstNewBlock->begin());
+ for (unsigned ai = 0, ae = IFI.StaticAllocas.size(); ai != ae; ++ai) {
+ AllocaInst *AI = IFI.StaticAllocas[ai];
+
+ // If the alloca is already scoped to something smaller than the whole
+ // function then there's no need to add redundant, less accurate markers.
+ if (hasLifetimeMarkers(AI))
+ continue;
+
+ builder.CreateLifetimeStart(AI);
+ for (unsigned ri = 0, re = Returns.size(); ri != re; ++ri) {
+ IRBuilder<> builder(Returns[ri]);
+ builder.CreateLifetimeEnd(AI);
+ }
+ }
+ }
+
// If the inlined code contained dynamic alloca instructions, wrap the inlined
// code with llvm.stacksave/llvm.stackrestore intrinsics.
if (InlinedFunctionInfo.ContainsDynamicAllocas) {
@@ -468,25 +919,14 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI) {
Function *StackSave = Intrinsic::getDeclaration(M, Intrinsic::stacksave);
Function *StackRestore=Intrinsic::getDeclaration(M,Intrinsic::stackrestore);
- // If we are preserving the callgraph, add edges to the stacksave/restore
- // functions for the calls we insert.
- CallGraphNode *StackSaveCGN = 0, *StackRestoreCGN = 0, *CallerNode = 0;
- if (CallGraph *CG = IFI.CG) {
- StackSaveCGN = CG->getOrInsertFunction(StackSave);
- StackRestoreCGN = CG->getOrInsertFunction(StackRestore);
- CallerNode = (*CG)[Caller];
- }
-
// Insert the llvm.stacksave.
CallInst *SavedPtr = CallInst::Create(StackSave, "savedstack",
FirstNewBlock->begin());
- if (IFI.CG) CallerNode->addCalledFunction(SavedPtr, StackSaveCGN);
// Insert a call to llvm.stackrestore before any return instructions in the
// inlined function.
for (unsigned i = 0, e = Returns.size(); i != e; ++i) {
- CallInst *CI = CallInst::Create(StackRestore, SavedPtr, "", Returns[i]);
- if (IFI.CG) CallerNode->addCalledFunction(CI, StackRestoreCGN);
+ CallInst::Create(StackRestore, SavedPtr, "", Returns[i]);
}
// Count the number of StackRestore calls we insert.
@@ -498,8 +938,7 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI) {
for (Function::iterator BB = FirstNewBlock, E = Caller->end();
BB != E; ++BB)
if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
- CallInst *CI = CallInst::Create(StackRestore, SavedPtr, "", UI);
- if (IFI.CG) CallerNode->addCalledFunction(CI, StackRestoreCGN);
+ CallInst::Create(StackRestore, SavedPtr, "", UI);
++NumStackRestores;
}
}
diff --git a/contrib/llvm/lib/Transforms/Utils/Local.cpp b/contrib/llvm/lib/Transforms/Utils/Local.cpp
index 4bca2fc..3bdbaa5 100644
--- a/contrib/llvm/lib/Transforms/Utils/Local.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/Local.cpp
@@ -20,6 +20,7 @@
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/IntrinsicInst.h"
+#include "llvm/Metadata.h"
#include "llvm/Operator.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
@@ -34,6 +35,7 @@
#include "llvm/Support/CFG.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/Support/IRBuilder.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/ValueHandle.h"
#include "llvm/Support/raw_ostream.h"
@@ -43,12 +45,16 @@ using namespace llvm;
// Local constant propagation.
//
-// ConstantFoldTerminator - If a terminator instruction is predicated on a
-// constant value, convert it into an unconditional branch to the constant
-// destination.
-//
-bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
+/// ConstantFoldTerminator - If a terminator instruction is predicated on a
+/// constant value, convert it into an unconditional branch to the constant
+/// destination. This is a nontrivial operation because the successors of this
+/// basic block must have their PHI nodes updated.
+/// Also calls RecursivelyDeleteTriviallyDeadInstructions() on any branch/switch
+/// conditions and indirectbr addresses this might make dead if
+/// DeleteDeadConditions is true.
+bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions) {
TerminatorInst *T = BB->getTerminator();
+ IRBuilder<> Builder(T);
// Branch - See if we are conditional jumping on constant
if (BranchInst *BI = dyn_cast<BranchInst>(T)) {
@@ -71,7 +77,7 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
OldDest->removePredecessor(BB);
// Replace the conditional branch with an unconditional one.
- BranchInst::Create(Destination, BI);
+ Builder.CreateBr(Destination);
BI->eraseFromParent();
return true;
}
@@ -86,8 +92,11 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
Dest1->removePredecessor(BI->getParent());
// Replace the conditional branch with an unconditional one.
- BranchInst::Create(Dest1, BI);
+ Builder.CreateBr(Dest1);
+ Value *Cond = BI->getCondition();
BI->eraseFromParent();
+ if (DeleteDeadConditions)
+ RecursivelyDeleteTriviallyDeadInstructions(Cond);
return true;
}
return false;
@@ -136,7 +145,7 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
// now.
if (TheOnlyDest) {
// Insert the new branch.
- BranchInst::Create(TheOnlyDest, SI);
+ Builder.CreateBr(TheOnlyDest);
BasicBlock *BB = SI->getParent();
// Remove entries from PHI nodes which we no longer branch to...
@@ -150,17 +159,21 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
}
// Delete the old switch.
- BB->getInstList().erase(SI);
+ Value *Cond = SI->getCondition();
+ SI->eraseFromParent();
+ if (DeleteDeadConditions)
+ RecursivelyDeleteTriviallyDeadInstructions(Cond);
return true;
}
if (SI->getNumSuccessors() == 2) {
// Otherwise, we can fold this switch into a conditional branch
// instruction if it has only one non-default destination.
- Value *Cond = new ICmpInst(SI, ICmpInst::ICMP_EQ, SI->getCondition(),
- SI->getSuccessorValue(1), "cond");
+ Value *Cond = Builder.CreateICmpEQ(SI->getCondition(),
+ SI->getSuccessorValue(1), "cond");
+
// Insert the new branch.
- BranchInst::Create(SI->getSuccessor(1), SI->getSuccessor(0), Cond, SI);
+ Builder.CreateCondBr(Cond, SI->getSuccessor(1), SI->getSuccessor(0));
// Delete the old switch.
SI->eraseFromParent();
@@ -175,7 +188,7 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
dyn_cast<BlockAddress>(IBI->getAddress()->stripPointerCasts())) {
BasicBlock *TheOnlyDest = BA->getBasicBlock();
// Insert the new branch.
- BranchInst::Create(TheOnlyDest, IBI);
+ Builder.CreateBr(TheOnlyDest);
for (unsigned i = 0, e = IBI->getNumDestinations(); i != e; ++i) {
if (IBI->getDestination(i) == TheOnlyDest)
@@ -183,7 +196,10 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB) {
else
IBI->getDestination(i)->removePredecessor(IBI->getParent());
}
+ Value *Address = IBI->getAddress();
IBI->eraseFromParent();
+ if (DeleteDeadConditions)
+ RecursivelyDeleteTriviallyDeadInstructions(Address);
// If we didn't find our destination in the IBI successor list, then we
// have undefined behavior. Replace the unconditional branch with an
@@ -785,10 +801,19 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
if (!DIVar.Verify())
return false;
- Instruction *DbgVal =
- Builder.insertDbgValueIntrinsic(SI->getOperand(0), 0,
- DIVar, SI);
-
+ Instruction *DbgVal = NULL;
+ // If an argument is zero extended then use argument directly. The ZExt
+ // may be zapped by an optimization pass in future.
+ Argument *ExtendedArg = NULL;
+ if (ZExtInst *ZExt = dyn_cast<ZExtInst>(SI->getOperand(0)))
+ ExtendedArg = dyn_cast<Argument>(ZExt->getOperand(0));
+ if (SExtInst *SExt = dyn_cast<SExtInst>(SI->getOperand(0)))
+ ExtendedArg = dyn_cast<Argument>(SExt->getOperand(0));
+ if (ExtendedArg)
+ DbgVal = Builder.insertDbgValueIntrinsic(ExtendedArg, 0, DIVar, SI);
+ else
+ DbgVal = Builder.insertDbgValueIntrinsic(SI->getOperand(0), 0, DIVar, SI);
+
// Propagate any debug metadata from the store onto the dbg.value.
DebugLoc SIDL = SI->getDebugLoc();
if (!SIDL.isUnknown())
@@ -853,3 +878,15 @@ bool llvm::LowerDbgDeclare(Function &F) {
}
return true;
}
+
+/// FindAllocaDbgDeclare - Finds the llvm.dbg.declare intrinsic describing the
+/// alloca 'V', if any.
+DbgDeclareInst *llvm::FindAllocaDbgDeclare(Value *V) {
+ if (MDNode *DebugNode = MDNode::getIfExists(V->getContext(), V))
+ for (Value::use_iterator UI = DebugNode->use_begin(),
+ E = DebugNode->use_end(); UI != E; ++UI)
+ if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(*UI))
+ return DDI;
+
+ return 0;
+}
diff --git a/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index 50c9ae2..a1736b9 100644
--- a/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -100,18 +100,6 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) {
return true;
}
-/// FindAllocaDbgDeclare - Finds the llvm.dbg.declare intrinsic describing the
-/// alloca 'V', if any.
-static DbgDeclareInst *FindAllocaDbgDeclare(Value *V) {
- if (MDNode *DebugNode = MDNode::getIfExists(V->getContext(), V))
- for (Value::use_iterator UI = DebugNode->use_begin(),
- E = DebugNode->use_end(); UI != E; ++UI)
- if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(*UI))
- return DDI;
-
- return 0;
-}
-
namespace {
struct AllocaInfo;
diff --git a/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp
index 2860c3e..b336194 100644
--- a/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp
@@ -14,7 +14,9 @@
#define DEBUG_TYPE "ssaupdater"
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
+#include "llvm/IntrinsicInst.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/Analysis/DIBuilder.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Allocator.h"
@@ -22,6 +24,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
+#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/SSAUpdater.h"
#include "llvm/Transforms/Utils/SSAUpdaterImpl.h"
@@ -355,7 +358,8 @@ Value *SSAUpdater::GetValueAtEndOfBlockInternal(BasicBlock *BB) {
LoadAndStorePromoter::
LoadAndStorePromoter(const SmallVectorImpl<Instruction*> &Insts,
- SSAUpdater &S, StringRef BaseName) : SSA(S) {
+ SSAUpdater &S, DbgDeclareInst *DD, DIBuilder *DB,
+ StringRef BaseName) : SSA(S), DDI(DD), DIB(DB) {
if (Insts.empty()) return;
Value *SomeVal;
@@ -402,9 +406,11 @@ run(const SmallVectorImpl<Instruction*> &Insts) const {
// single user in it, we can rewrite it trivially.
if (BlockUses.size() == 1) {
// If it is a store, it is a trivial def of the value in the block.
- if (StoreInst *SI = dyn_cast<StoreInst>(User))
+ if (StoreInst *SI = dyn_cast<StoreInst>(User)) {
+ if (DDI)
+ ConvertDebugDeclareToDebugValue(DDI, SI, *DIB);
SSA.AddAvailableValue(BB, SI->getOperand(0));
- else
+ } else
// Otherwise it is a load, queue it to rewrite as a live-in load.
LiveInLoads.push_back(cast<LoadInst>(User));
BlockUses.clear();
@@ -453,12 +459,15 @@ run(const SmallVectorImpl<Instruction*> &Insts) const {
continue;
}
- if (StoreInst *S = dyn_cast<StoreInst>(II)) {
+ if (StoreInst *SI = dyn_cast<StoreInst>(II)) {
// If this is a store to an unrelated pointer, ignore it.
- if (!isInstInList(S, Insts)) continue;
-
+ if (!isInstInList(SI, Insts)) continue;
+
+ if (DDI)
+ ConvertDebugDeclareToDebugValue(DDI, SI, *DIB);
+
// Remember that this is the active value in the block.
- StoredValue = S->getOperand(0);
+ StoredValue = SI->getOperand(0);
}
}
@@ -513,4 +522,7 @@ run(const SmallVectorImpl<Instruction*> &Insts) const {
instructionDeleted(User);
User->eraseFromParent();
}
+
+ if (DDI)
+ DDI->eraseFromParent();
}
diff --git a/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 18b8573..6df846c 100644
--- a/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -20,6 +20,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalVariable.h"
#include "llvm/Analysis/InstructionSimplify.h"
+#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/ADT/DenseMap.h"
@@ -31,6 +32,8 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/IRBuilder.h"
+#include "llvm/Support/NoFolder.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <set>
@@ -55,16 +58,18 @@ class SimplifyCFGOpt {
BasicBlock *GetValueEqualityComparisonCases(TerminatorInst *TI,
std::vector<std::pair<ConstantInt*, BasicBlock*> > &Cases);
bool SimplifyEqualityComparisonWithOnlyPredecessor(TerminatorInst *TI,
- BasicBlock *Pred);
- bool FoldValueComparisonIntoPredecessors(TerminatorInst *TI);
+ BasicBlock *Pred,
+ IRBuilder<> &Builder);
+ bool FoldValueComparisonIntoPredecessors(TerminatorInst *TI,
+ IRBuilder<> &Builder);
- bool SimplifyReturn(ReturnInst *RI);
- bool SimplifyUnwind(UnwindInst *UI);
+ bool SimplifyReturn(ReturnInst *RI, IRBuilder<> &Builder);
+ bool SimplifyUnwind(UnwindInst *UI, IRBuilder<> &Builder);
bool SimplifyUnreachable(UnreachableInst *UI);
- bool SimplifySwitch(SwitchInst *SI);
+ bool SimplifySwitch(SwitchInst *SI, IRBuilder<> &Builder);
bool SimplifyIndirectBr(IndirectBrInst *IBI);
- bool SimplifyUncondBranch(BranchInst *BI);
- bool SimplifyCondBranch(BranchInst *BI);
+ bool SimplifyUncondBranch(BranchInst *BI, IRBuilder <> &Builder);
+ bool SimplifyCondBranch(BranchInst *BI, IRBuilder <>&Builder);
public:
explicit SimplifyCFGOpt(const TargetData *td) : TD(td) {}
@@ -541,7 +546,8 @@ ValuesOverlap(std::vector<std::pair<ConstantInt*, BasicBlock*> > &C1,
/// form of jump threading.
bool SimplifyCFGOpt::
SimplifyEqualityComparisonWithOnlyPredecessor(TerminatorInst *TI,
- BasicBlock *Pred) {
+ BasicBlock *Pred,
+ IRBuilder<> &Builder) {
Value *PredVal = isValueEqualityComparison(Pred->getTerminator());
if (!PredVal) return false; // Not a value comparison in predecessor.
@@ -574,7 +580,7 @@ SimplifyEqualityComparisonWithOnlyPredecessor(TerminatorInst *TI,
// uncond br.
assert(ThisCases.size() == 1 && "Branch can only have one case!");
// Insert the new branch.
- Instruction *NI = BranchInst::Create(ThisDef, TI);
+ Instruction *NI = Builder.CreateBr(ThisDef);
(void) NI;
// Remove PHI node entries for the dead edge.
@@ -639,7 +645,7 @@ SimplifyEqualityComparisonWithOnlyPredecessor(TerminatorInst *TI,
CheckEdge = 0;
// Insert the new branch.
- Instruction *NI = BranchInst::Create(TheRealDest, TI);
+ Instruction *NI = Builder.CreateBr(TheRealDest);
(void) NI;
DEBUG(dbgs() << "Threading pred instr: " << *Pred->getTerminator()
@@ -674,7 +680,8 @@ static int ConstantIntSortPredicate(const void *P1, const void *P2) {
/// equality comparison instruction (either a switch or a branch on "X == c").
/// See if any of the predecessors of the terminator block are value comparisons
/// on the same value. If so, and if safe to do so, fold them together.
-bool SimplifyCFGOpt::FoldValueComparisonIntoPredecessors(TerminatorInst *TI) {
+bool SimplifyCFGOpt::FoldValueComparisonIntoPredecessors(TerminatorInst *TI,
+ IRBuilder<> &Builder) {
BasicBlock *BB = TI->getParent();
Value *CV = isValueEqualityComparison(TI); // CondVal
assert(CV && "Not a comparison?");
@@ -767,16 +774,18 @@ bool SimplifyCFGOpt::FoldValueComparisonIntoPredecessors(TerminatorInst *TI) {
for (unsigned i = 0, e = NewSuccessors.size(); i != e; ++i)
AddPredecessorToBlock(NewSuccessors[i], Pred, BB);
+ Builder.SetInsertPoint(PTI);
// Convert pointer to int before we switch.
if (CV->getType()->isPointerTy()) {
assert(TD && "Cannot switch on pointer without TargetData");
- CV = new PtrToIntInst(CV, TD->getIntPtrType(CV->getContext()),
- "magicptr", PTI);
+ CV = Builder.CreatePtrToInt(CV, TD->getIntPtrType(CV->getContext()),
+ "magicptr");
}
// Now that the successors are updated, create the new Switch instruction.
- SwitchInst *NewSI = SwitchInst::Create(CV, PredDefault,
- PredCases.size(), PTI);
+ SwitchInst *NewSI = Builder.CreateSwitch(CV, PredDefault,
+ PredCases.size());
+ NewSI->setDebugLoc(PTI->getDebugLoc());
for (unsigned i = 0, e = PredCases.size(); i != e; ++i)
NewSI->addCase(PredCases[i].first, PredCases[i].second);
@@ -900,6 +909,7 @@ HoistTerminator:
NT->takeName(I1);
}
+ IRBuilder<true, NoFolder> Builder(NT);
// Hoisting one of the terminators from our successor is a great thing.
// Unfortunately, the successors of the if/else blocks may have PHI nodes in
// them. If they do, all PHI entries for BB1/BB2 must agree for all PHI
@@ -916,9 +926,11 @@ HoistTerminator:
// These values do not agree. Insert a select instruction before NT
// that determines the right value.
SelectInst *&SI = InsertedSelects[std::make_pair(BB1V, BB2V)];
- if (SI == 0)
- SI = SelectInst::Create(BI->getCondition(), BB1V, BB2V,
- BB1V->getName()+"."+BB2V->getName(), NT);
+ if (SI == 0)
+ SI = cast<SelectInst>
+ (Builder.CreateSelect(BI->getCondition(), BB1V, BB2V,
+ BB1V->getName()+"."+BB2V->getName()));
+
// Make the PHI node use the select for all incoming values for BB1/BB2
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
if (PN->getIncomingBlock(i) == BB1 || PN->getIncomingBlock(i) == BB2)
@@ -1076,13 +1088,16 @@ static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *BB1) {
// Create a select whose true value is the speculatively executed value and
// false value is the previously determined FalseV.
+ IRBuilder<true, NoFolder> Builder(BI);
SelectInst *SI;
if (Invert)
- SI = SelectInst::Create(BrCond, FalseV, HInst,
- FalseV->getName() + "." + HInst->getName(), BI);
+ SI = cast<SelectInst>
+ (Builder.CreateSelect(BrCond, FalseV, HInst,
+ FalseV->getName() + "." + HInst->getName()));
else
- SI = SelectInst::Create(BrCond, HInst, FalseV,
- HInst->getName() + "." + FalseV->getName(), BI);
+ SI = cast<SelectInst>
+ (Builder.CreateSelect(BrCond, HInst, FalseV,
+ HInst->getName() + "." + FalseV->getName()));
// Make the PHI node use the select for all incoming values for "then" and
// "if" blocks.
@@ -1156,6 +1171,8 @@ static bool FoldCondBranchOnPHI(BranchInst *BI, const TargetData *TD) {
BasicBlock *RealDest = BI->getSuccessor(!CB->getZExtValue());
if (RealDest == BB) continue; // Skip self loops.
+ // Skip if the predecessor's terminator is an indirect branch.
+ if (isa<IndirectBrInst>(PredBB->getTerminator())) continue;
// The dest block might have PHI nodes, other predecessors and other
// difficult cases. Instead of being smart about this, just insert a new
@@ -1211,7 +1228,7 @@ static bool FoldCondBranchOnPHI(BranchInst *BI, const TargetData *TD) {
BB->removePredecessor(PredBB);
PredBBTI->setSuccessor(i, EdgeBB);
}
-
+
// Recurse, simplifying any other constants.
return FoldCondBranchOnPHI(BI, TD) | true;
}
@@ -1320,6 +1337,7 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) {
// If we can still promote the PHI nodes after this gauntlet of tests,
// do all of the PHI's now.
Instruction *InsertPt = DomBlock->getTerminator();
+ IRBuilder<true, NoFolder> Builder(InsertPt);
// Move all 'aggressive' instructions, which are defined in the
// conditional parts of the if's up to the dominating block.
@@ -1337,7 +1355,8 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) {
Value *TrueVal = PN->getIncomingValue(PN->getIncomingBlock(0) == IfFalse);
Value *FalseVal = PN->getIncomingValue(PN->getIncomingBlock(0) == IfTrue);
- Value *NV = SelectInst::Create(IfCond, TrueVal, FalseVal, "", InsertPt);
+ SelectInst *NV =
+ cast<SelectInst>(Builder.CreateSelect(IfCond, TrueVal, FalseVal, ""));
PN->replaceAllUsesWith(NV);
NV->takeName(PN);
PN->eraseFromParent();
@@ -1347,7 +1366,8 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) {
// has been flattened. Change DomBlock to jump directly to our new block to
// avoid other simplifycfg's kicking in on the diamond.
TerminatorInst *OldTI = DomBlock->getTerminator();
- BranchInst::Create(BB, OldTI);
+ Builder.SetInsertPoint(OldTI);
+ Builder.CreateBr(BB);
OldTI->eraseFromParent();
return true;
}
@@ -1355,7 +1375,8 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) {
/// SimplifyCondBranchToTwoReturns - If we found a conditional branch that goes
/// to two returning blocks, try to merge them together into one return,
/// introducing a select if the return values disagree.
-static bool SimplifyCondBranchToTwoReturns(BranchInst *BI) {
+static bool SimplifyCondBranchToTwoReturns(BranchInst *BI,
+ IRBuilder<> &Builder) {
assert(BI->isConditional() && "Must be a conditional branch");
BasicBlock *TrueSucc = BI->getSuccessor(0);
BasicBlock *FalseSucc = BI->getSuccessor(1);
@@ -1370,13 +1391,14 @@ static bool SimplifyCondBranchToTwoReturns(BranchInst *BI) {
if (!FalseSucc->getFirstNonPHIOrDbg()->isTerminator())
return false;
+ Builder.SetInsertPoint(BI);
// Okay, we found a branch that is going to two return nodes. If
// there is no return value for this function, just change the
// branch into a return.
if (FalseRet->getNumOperands() == 0) {
TrueSucc->removePredecessor(BI->getParent());
FalseSucc->removePredecessor(BI->getParent());
- ReturnInst::Create(BI->getContext(), 0, BI);
+ Builder.CreateRetVoid();
EraseTerminatorInstAndDCECond(BI);
return true;
}
@@ -1419,14 +1441,14 @@ static bool SimplifyCondBranchToTwoReturns(BranchInst *BI) {
} else if (isa<UndefValue>(TrueValue)) {
TrueValue = FalseValue;
} else {
- TrueValue = SelectInst::Create(BrCond, TrueValue,
- FalseValue, "retval", BI);
+ TrueValue = Builder.CreateSelect(BrCond, TrueValue,
+ FalseValue, "retval");
}
}
- Value *RI = !TrueValue ?
- ReturnInst::Create(BI->getContext(), BI) :
- ReturnInst::Create(BI->getContext(), TrueValue, BI);
+ Value *RI = !TrueValue ?
+ Builder.CreateRetVoid() : Builder.CreateRet(TrueValue);
+
(void) RI;
DEBUG(dbgs() << "\nCHANGING BRANCH TO TWO RETURNS INTO SELECT:"
@@ -1443,6 +1465,7 @@ static bool SimplifyCondBranchToTwoReturns(BranchInst *BI) {
/// the predecessor and use logical operations to pick the right destination.
bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
BasicBlock *BB = BI->getParent();
+
Instruction *Cond = dyn_cast<Instruction>(BI->getCondition());
if (Cond == 0 || (!isa<CmpInst>(Cond) && !isa<BinaryOperator>(Cond)) ||
Cond->getParent() != BB || !Cond->hasOneUse())
@@ -1563,7 +1586,8 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
}
DEBUG(dbgs() << "FOLDING BRANCH TO COMMON DEST:\n" << *PBI << *BB);
-
+ IRBuilder<> Builder(PBI);
+
// If we need to invert the condition in the pred block to match, do so now.
if (InvertPredCond) {
Value *NewCond = PBI->getCondition();
@@ -1572,8 +1596,8 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
CmpInst *CI = cast<CmpInst>(NewCond);
CI->setPredicate(CI->getInversePredicate());
} else {
- NewCond = BinaryOperator::CreateNot(NewCond,
- PBI->getCondition()->getName()+".not", PBI);
+ NewCond = Builder.CreateNot(NewCond,
+ PBI->getCondition()->getName()+".not");
}
PBI->setCondition(NewCond);
@@ -1600,8 +1624,9 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
New->takeName(Cond);
Cond->setName(New->getName()+".old");
- Value *NewCond = BinaryOperator::Create(Opc, PBI->getCondition(),
- New, "or.cond", PBI);
+ Instruction *NewCond =
+ cast<Instruction>(Builder.CreateBinOp(Opc, PBI->getCondition(),
+ New, "or.cond"));
PBI->setCondition(NewCond);
if (PBI->getSuccessor(0) == BB) {
AddPredecessorToBlock(TrueDest, PredBlock, BB);
@@ -1744,23 +1769,22 @@ static bool SimplifyCondBranchToCondBranch(BranchInst *PBI, BranchInst *BI) {
}
DEBUG(dbgs() << *PBI->getParent()->getParent());
-
+
// BI may have other predecessors. Because of this, we leave
// it alone, but modify PBI.
// Make sure we get to CommonDest on True&True directions.
Value *PBICond = PBI->getCondition();
+ IRBuilder<true, NoFolder> Builder(PBI);
if (PBIOp)
- PBICond = BinaryOperator::CreateNot(PBICond,
- PBICond->getName()+".not",
- PBI);
+ PBICond = Builder.CreateNot(PBICond, PBICond->getName()+".not");
+
Value *BICond = BI->getCondition();
if (BIOp)
- BICond = BinaryOperator::CreateNot(BICond,
- BICond->getName()+".not",
- PBI);
+ BICond = Builder.CreateNot(BICond, BICond->getName()+".not");
+
// Merge the conditions.
- Value *Cond = BinaryOperator::CreateOr(PBICond, BICond, "brmerge", PBI);
+ Value *Cond = Builder.CreateOr(PBICond, BICond, "brmerge");
// Modify PBI to branch on the new condition to the new dests.
PBI->setCondition(Cond);
@@ -1783,8 +1807,8 @@ static bool SimplifyCondBranchToCondBranch(BranchInst *PBI, BranchInst *BI) {
Value *PBIV = PN->getIncomingValue(PBBIdx);
if (BIV != PBIV) {
// Insert a select in PBI to pick the right value.
- Value *NV = SelectInst::Create(PBICond, PBIV, BIV,
- PBIV->getName()+".mux", PBI);
+ Value *NV = cast<SelectInst>
+ (Builder.CreateSelect(PBICond, PBIV, BIV, PBIV->getName()+".mux"));
PN->setIncomingValue(PBBIdx, NV);
}
}
@@ -1823,16 +1847,19 @@ static bool SimplifyTerminatorOnSelect(TerminatorInst *OldTerm, Value *Cond,
Succ->removePredecessor(OldTerm->getParent());
}
+ IRBuilder<> Builder(OldTerm);
+ Builder.SetCurrentDebugLocation(OldTerm->getDebugLoc());
+
// Insert an appropriate new terminator.
if ((KeepEdge1 == 0) && (KeepEdge2 == 0)) {
if (TrueBB == FalseBB)
// We were only looking for one successor, and it was present.
// Create an unconditional branch to it.
- BranchInst::Create(TrueBB, OldTerm);
+ Builder.CreateBr(TrueBB);
else
// We found both of the successors we were looking for.
// Create a conditional branch sharing the condition of the select.
- BranchInst::Create(TrueBB, FalseBB, Cond, OldTerm);
+ Builder.CreateCondBr(Cond, TrueBB, FalseBB);
} else if (KeepEdge1 && (KeepEdge2 || TrueBB == FalseBB)) {
// Neither of the selected blocks were successors, so this
// terminator must be unreachable.
@@ -1843,10 +1870,10 @@ static bool SimplifyTerminatorOnSelect(TerminatorInst *OldTerm, Value *Cond,
// the edge to the one that wasn't must be unreachable.
if (KeepEdge1 == 0)
// Only TrueBB was found.
- BranchInst::Create(TrueBB, OldTerm);
+ Builder.CreateBr(TrueBB);
else
// Only FalseBB was found.
- BranchInst::Create(FalseBB, OldTerm);
+ Builder.CreateBr(FalseBB);
}
EraseTerminatorInstAndDCECond(OldTerm);
@@ -1911,8 +1938,10 @@ static bool SimplifyIndirectBrOnSelect(IndirectBrInst *IBI, SelectInst *SI) {
/// We prefer to split the edge to 'end' so that there is a true/false entry to
/// the PHI, merging the third icmp into the switch.
static bool TryToSimplifyUncondBranchWithICmpInIt(ICmpInst *ICI,
- const TargetData *TD) {
+ const TargetData *TD,
+ IRBuilder<> &Builder) {
BasicBlock *BB = ICI->getParent();
+
// If the block has any PHIs in it or the icmp has multiple uses, it is too
// complex.
if (isa<PHINode>(BB->begin()) || !ICI->hasOneUse()) return false;
@@ -1990,7 +2019,9 @@ static bool TryToSimplifyUncondBranchWithICmpInIt(ICmpInst *ICI,
SI->addCase(Cst, NewBB);
// NewBB branches to the phi block, add the uncond branch and the phi entry.
- BranchInst::Create(SuccBlock, NewBB);
+ Builder.SetInsertPoint(NewBB);
+ Builder.SetCurrentDebugLocation(SI->getDebugLoc());
+ Builder.CreateBr(SuccBlock);
PHIUse->addIncoming(NewCst, NewBB);
return true;
}
@@ -1998,7 +2029,8 @@ static bool TryToSimplifyUncondBranchWithICmpInIt(ICmpInst *ICI,
/// SimplifyBranchOnICmpChain - The specified branch is a conditional branch.
/// Check to see if it is branching on an or/and chain of icmp instructions, and
/// fold it into a switch instruction if so.
-static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD) {
+static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD,
+ IRBuilder<> &Builder) {
Instruction *Cond = dyn_cast<Instruction>(BI->getCondition());
if (Cond == 0) return false;
@@ -2054,11 +2086,12 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD) {
BasicBlock *NewBB = BB->splitBasicBlock(BI, "switch.early.test");
// Remove the uncond branch added to the old block.
TerminatorInst *OldTI = BB->getTerminator();
-
+ Builder.SetInsertPoint(OldTI);
+
if (TrueWhenEqual)
- BranchInst::Create(EdgeBB, NewBB, ExtraCase, OldTI);
+ Builder.CreateCondBr(ExtraCase, EdgeBB, NewBB);
else
- BranchInst::Create(NewBB, EdgeBB, ExtraCase, OldTI);
+ Builder.CreateCondBr(ExtraCase, NewBB, EdgeBB);
OldTI->eraseFromParent();
@@ -2070,18 +2103,19 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD) {
<< "\nEXTRABB = " << *BB);
BB = NewBB;
}
-
+
+ Builder.SetInsertPoint(BI);
// Convert pointer to int before we switch.
if (CompVal->getType()->isPointerTy()) {
assert(TD && "Cannot switch on pointer without TargetData");
- CompVal = new PtrToIntInst(CompVal,
- TD->getIntPtrType(CompVal->getContext()),
- "magicptr", BI);
+ CompVal = Builder.CreatePtrToInt(CompVal,
+ TD->getIntPtrType(CompVal->getContext()),
+ "magicptr");
}
// Create the new switch instruction now.
- SwitchInst *New = SwitchInst::Create(CompVal, DefaultBB, Values.size(), BI);
-
+ SwitchInst *New = Builder.CreateSwitch(CompVal, DefaultBB, Values.size());
+
// Add all of the 'cases' to the switch instruction.
for (unsigned i = 0, e = Values.size(); i != e; ++i)
New->addCase(Values[i], EdgeBB);
@@ -2104,7 +2138,7 @@ static bool SimplifyBranchOnICmpChain(BranchInst *BI, const TargetData *TD) {
return true;
}
-bool SimplifyCFGOpt::SimplifyReturn(ReturnInst *RI) {
+bool SimplifyCFGOpt::SimplifyReturn(ReturnInst *RI, IRBuilder<> &Builder) {
BasicBlock *BB = RI->getParent();
if (!BB->getFirstNonPHIOrDbg()->isTerminator()) return false;
@@ -2148,13 +2182,13 @@ bool SimplifyCFGOpt::SimplifyReturn(ReturnInst *RI) {
// Check to see if the non-BB successor is also a return block.
if (isa<ReturnInst>(BI->getSuccessor(0)->getTerminator()) &&
isa<ReturnInst>(BI->getSuccessor(1)->getTerminator()) &&
- SimplifyCondBranchToTwoReturns(BI))
+ SimplifyCondBranchToTwoReturns(BI, Builder))
return true;
}
return false;
}
-bool SimplifyCFGOpt::SimplifyUnwind(UnwindInst *UI) {
+bool SimplifyCFGOpt::SimplifyUnwind(UnwindInst *UI, IRBuilder<> &Builder) {
// Check to see if the first instruction in this block is just an unwind.
// If so, replace any invoke instructions which use this as an exception
// destination with call instructions.
@@ -2169,14 +2203,16 @@ bool SimplifyCFGOpt::SimplifyUnwind(UnwindInst *UI) {
if (II && II->getUnwindDest() == BB) {
// Insert a new branch instruction before the invoke, because this
// is now a fall through.
- BranchInst *BI = BranchInst::Create(II->getNormalDest(), II);
+ Builder.SetInsertPoint(II);
+ BranchInst *BI = Builder.CreateBr(II->getNormalDest());
Pred->getInstList().remove(II); // Take out of symbol table
// Insert the call now.
SmallVector<Value*,8> Args(II->op_begin(), II->op_end()-3);
- CallInst *CI = CallInst::Create(II->getCalledValue(),
- Args.begin(), Args.end(),
- II->getName(), BI);
+ Builder.SetInsertPoint(BI);
+ CallInst *CI = Builder.CreateCall(II->getCalledValue(),
+ Args.begin(), Args.end(),
+ II->getName());
CI->setCallingConv(II->getCallingConv());
CI->setAttributes(II->getAttributes());
// If the invoke produced a value, the Call now does instead.
@@ -2235,7 +2271,7 @@ bool SimplifyCFGOpt::SimplifyUnreachable(UnreachableInst *UI) {
SmallVector<BasicBlock*, 8> Preds(pred_begin(BB), pred_end(BB));
for (unsigned i = 0, e = Preds.size(); i != e; ++i) {
TerminatorInst *TI = Preds[i]->getTerminator();
-
+ IRBuilder<> Builder(TI);
if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
if (BI->isUnconditional()) {
if (BI->getSuccessor(0) == BB) {
@@ -2245,10 +2281,10 @@ bool SimplifyCFGOpt::SimplifyUnreachable(UnreachableInst *UI) {
}
} else {
if (BI->getSuccessor(0) == BB) {
- BranchInst::Create(BI->getSuccessor(1), BI);
+ Builder.CreateBr(BI->getSuccessor(1));
EraseTerminatorInstAndDCECond(BI);
} else if (BI->getSuccessor(1) == BB) {
- BranchInst::Create(BI->getSuccessor(0), BI);
+ Builder.CreateBr(BI->getSuccessor(0));
EraseTerminatorInstAndDCECond(BI);
Changed = true;
}
@@ -2312,14 +2348,15 @@ bool SimplifyCFGOpt::SimplifyUnreachable(UnreachableInst *UI) {
if (II->getUnwindDest() == BB) {
// Convert the invoke to a call instruction. This would be a good
// place to note that the call does not throw though.
- BranchInst *BI = BranchInst::Create(II->getNormalDest(), II);
+ BranchInst *BI = Builder.CreateBr(II->getNormalDest());
II->removeFromParent(); // Take out of symbol table
// Insert the call now...
SmallVector<Value*, 8> Args(II->op_begin(), II->op_end()-3);
- CallInst *CI = CallInst::Create(II->getCalledValue(),
- Args.begin(), Args.end(),
- II->getName(), BI);
+ Builder.SetInsertPoint(BI);
+ CallInst *CI = Builder.CreateCall(II->getCalledValue(),
+ Args.begin(), Args.end(),
+ II->getName());
CI->setCallingConv(II->getCallingConv());
CI->setAttributes(II->getAttributes());
// If the invoke produced a value, the call does now instead.
@@ -2343,7 +2380,7 @@ bool SimplifyCFGOpt::SimplifyUnreachable(UnreachableInst *UI) {
/// TurnSwitchRangeIntoICmp - Turns a switch with that contains only a
/// integer range comparison into a sub, an icmp and a branch.
-static bool TurnSwitchRangeIntoICmp(SwitchInst *SI) {
+static bool TurnSwitchRangeIntoICmp(SwitchInst *SI, IRBuilder<> &Builder) {
assert(SI->getNumCases() > 2 && "Degenerate switch?");
// Make sure all cases point to the same destination and gather the values.
@@ -2368,9 +2405,9 @@ static bool TurnSwitchRangeIntoICmp(SwitchInst *SI) {
Value *Sub = SI->getCondition();
if (!Offset->isNullValue())
- Sub = BinaryOperator::CreateAdd(Sub, Offset, Sub->getName()+".off", SI);
- Value *Cmp = new ICmpInst(SI, ICmpInst::ICMP_ULT, Sub, NumCases, "switch");
- BranchInst::Create(SI->getSuccessor(1), SI->getDefaultDest(), Cmp, SI);
+ Sub = Builder.CreateAdd(Sub, Offset, Sub->getName()+".off");
+ Value *Cmp = Builder.CreateICmpULT(Sub, NumCases, "switch");
+ Builder.CreateCondBr(Cmp, SI->getSuccessor(1), SI->getDefaultDest());
// Prune obsolete incoming values off the successor's PHI nodes.
for (BasicBlock::iterator BBI = SI->getSuccessor(1)->begin();
@@ -2383,7 +2420,37 @@ static bool TurnSwitchRangeIntoICmp(SwitchInst *SI) {
return true;
}
-bool SimplifyCFGOpt::SimplifySwitch(SwitchInst *SI) {
+/// EliminateDeadSwitchCases - Compute masked bits for the condition of a switch
+/// and use it to remove dead cases.
+static bool EliminateDeadSwitchCases(SwitchInst *SI) {
+ Value *Cond = SI->getCondition();
+ unsigned Bits = cast<IntegerType>(Cond->getType())->getBitWidth();
+ APInt KnownZero(Bits, 0), KnownOne(Bits, 0);
+ ComputeMaskedBits(Cond, APInt::getAllOnesValue(Bits), KnownZero, KnownOne);
+
+ // Gather dead cases.
+ SmallVector<ConstantInt*, 8> DeadCases;
+ for (unsigned I = 1, E = SI->getNumCases(); I != E; ++I) {
+ if ((SI->getCaseValue(I)->getValue() & KnownZero) != 0 ||
+ (SI->getCaseValue(I)->getValue() & KnownOne) != KnownOne) {
+ DeadCases.push_back(SI->getCaseValue(I));
+ DEBUG(dbgs() << "SimplifyCFG: switch case '"
+ << SI->getCaseValue(I)->getValue() << "' is dead.\n");
+ }
+ }
+
+ // Remove dead cases from the switch.
+ for (unsigned I = 0, E = DeadCases.size(); I != E; ++I) {
+ unsigned Case = SI->findCaseValue(DeadCases[I]);
+ // Prune unused values from PHI nodes.
+ SI->getSuccessor(Case)->removePredecessor(SI->getParent());
+ SI->removeCase(Case);
+ }
+
+ return !DeadCases.empty();
+}
+
+bool SimplifyCFGOpt::SimplifySwitch(SwitchInst *SI, IRBuilder<> &Builder) {
// If this switch is too complex to want to look at, ignore it.
if (!isValueEqualityComparison(SI))
return false;
@@ -2393,7 +2460,7 @@ bool SimplifyCFGOpt::SimplifySwitch(SwitchInst *SI) {
// If we only have one predecessor, and if it is a branch on this value,
// see if that predecessor totally determines the outcome of this switch.
if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
- if (SimplifyEqualityComparisonWithOnlyPredecessor(SI, OnlyPred))
+ if (SimplifyEqualityComparisonWithOnlyPredecessor(SI, OnlyPred, Builder))
return SimplifyCFG(BB) | true;
Value *Cond = SI->getCondition();
@@ -2408,13 +2475,17 @@ bool SimplifyCFGOpt::SimplifySwitch(SwitchInst *SI) {
while (isa<DbgInfoIntrinsic>(BBI))
++BBI;
if (SI == &*BBI)
- if (FoldValueComparisonIntoPredecessors(SI))
+ if (FoldValueComparisonIntoPredecessors(SI, Builder))
return SimplifyCFG(BB) | true;
// Try to transform the switch into an icmp and a branch.
- if (TurnSwitchRangeIntoICmp(SI))
+ if (TurnSwitchRangeIntoICmp(SI, Builder))
return SimplifyCFG(BB) | true;
-
+
+ // Remove unreachable cases.
+ if (EliminateDeadSwitchCases(SI))
+ return SimplifyCFG(BB) | true;
+
return false;
}
@@ -2455,7 +2526,7 @@ bool SimplifyCFGOpt::SimplifyIndirectBr(IndirectBrInst *IBI) {
return Changed;
}
-bool SimplifyCFGOpt::SimplifyUncondBranch(BranchInst *BI) {
+bool SimplifyCFGOpt::SimplifyUncondBranch(BranchInst *BI, IRBuilder<> &Builder){
BasicBlock *BB = BI->getParent();
// If the Terminator is the only non-phi instruction, simplify the block.
@@ -2470,7 +2541,8 @@ bool SimplifyCFGOpt::SimplifyUncondBranch(BranchInst *BI) {
if (ICI->isEquality() && isa<ConstantInt>(ICI->getOperand(1))) {
for (++I; isa<DbgInfoIntrinsic>(I); ++I)
;
- if (I->isTerminator() && TryToSimplifyUncondBranchWithICmpInIt(ICI, TD))
+ if (I->isTerminator()
+ && TryToSimplifyUncondBranchWithICmpInIt(ICI, TD, Builder))
return true;
}
@@ -2478,7 +2550,7 @@ bool SimplifyCFGOpt::SimplifyUncondBranch(BranchInst *BI) {
}
-bool SimplifyCFGOpt::SimplifyCondBranch(BranchInst *BI) {
+bool SimplifyCFGOpt::SimplifyCondBranch(BranchInst *BI, IRBuilder<> &Builder) {
BasicBlock *BB = BI->getParent();
// Conditional branch
@@ -2487,7 +2559,7 @@ bool SimplifyCFGOpt::SimplifyCondBranch(BranchInst *BI) {
// see if that predecessor totally determines the outcome of this
// switch.
if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
- if (SimplifyEqualityComparisonWithOnlyPredecessor(BI, OnlyPred))
+ if (SimplifyEqualityComparisonWithOnlyPredecessor(BI, OnlyPred, Builder))
return SimplifyCFG(BB) | true;
// This block must be empty, except for the setcond inst, if it exists.
@@ -2497,20 +2569,20 @@ bool SimplifyCFGOpt::SimplifyCondBranch(BranchInst *BI) {
while (isa<DbgInfoIntrinsic>(I))
++I;
if (&*I == BI) {
- if (FoldValueComparisonIntoPredecessors(BI))
+ if (FoldValueComparisonIntoPredecessors(BI, Builder))
return SimplifyCFG(BB) | true;
} else if (&*I == cast<Instruction>(BI->getCondition())){
++I;
// Ignore dbg intrinsics.
while (isa<DbgInfoIntrinsic>(I))
++I;
- if (&*I == BI && FoldValueComparisonIntoPredecessors(BI))
+ if (&*I == BI && FoldValueComparisonIntoPredecessors(BI, Builder))
return SimplifyCFG(BB) | true;
}
}
// Try to turn "br (X == 0 | X == 1), T, F" into a switch instruction.
- if (SimplifyBranchOnICmpChain(BI, TD))
+ if (SimplifyBranchOnICmpChain(BI, TD, Builder))
return true;
// We have a conditional branch to two blocks that are only reachable
@@ -2581,7 +2653,7 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) {
// Check to see if we can constant propagate this terminator instruction
// away...
- Changed |= ConstantFoldTerminator(BB);
+ Changed |= ConstantFoldTerminator(BB, true);
// Check for and eliminate duplicate PHI nodes in this block.
Changed |= EliminateDuplicatePHINodes(BB);
@@ -2593,27 +2665,30 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) {
if (MergeBlockIntoPredecessor(BB))
return true;
+ IRBuilder<> Builder(BB);
+
// If there is a trivial two-entry PHI node in this basic block, and we can
// eliminate it, do so now.
if (PHINode *PN = dyn_cast<PHINode>(BB->begin()))
if (PN->getNumIncomingValues() == 2)
Changed |= FoldTwoEntryPHINode(PN, TD);
+ Builder.SetInsertPoint(BB->getTerminator());
if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator())) {
if (BI->isUnconditional()) {
- if (SimplifyUncondBranch(BI)) return true;
+ if (SimplifyUncondBranch(BI, Builder)) return true;
} else {
- if (SimplifyCondBranch(BI)) return true;
+ if (SimplifyCondBranch(BI, Builder)) return true;
}
} else if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
- if (SimplifyReturn(RI)) return true;
+ if (SimplifyReturn(RI, Builder)) return true;
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
- if (SimplifySwitch(SI)) return true;
+ if (SimplifySwitch(SI, Builder)) return true;
} else if (UnreachableInst *UI =
dyn_cast<UnreachableInst>(BB->getTerminator())) {
if (SimplifyUnreachable(UI)) return true;
} else if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
- if (SimplifyUnwind(UI)) return true;
+ if (SimplifyUnwind(UI, Builder)) return true;
} else if (IndirectBrInst *IBI =
dyn_cast<IndirectBrInst>(BB->getTerminator())) {
if (SimplifyIndirectBr(IBI)) return true;
diff --git a/contrib/llvm/lib/VMCore/Attributes.cpp b/contrib/llvm/lib/VMCore/Attributes.cpp
index 92152a3..ee257db 100644
--- a/contrib/llvm/lib/VMCore/Attributes.cpp
+++ b/contrib/llvm/lib/VMCore/Attributes.cpp
@@ -36,6 +36,8 @@ std::string Attribute::getAsString(Attributes Attrs) {
Result += "noreturn ";
if (Attrs & Attribute::NoUnwind)
Result += "nounwind ";
+ if (Attrs & Attribute::UWTable)
+ Result += "uwtable ";
if (Attrs & Attribute::InReg)
Result += "inreg ";
if (Attrs & Attribute::NoAlias)
diff --git a/contrib/llvm/lib/VMCore/AutoUpgrade.cpp b/contrib/llvm/lib/VMCore/AutoUpgrade.cpp
index 4541f38..f8f15ca 100644
--- a/contrib/llvm/lib/VMCore/AutoUpgrade.cpp
+++ b/contrib/llvm/lib/VMCore/AutoUpgrade.cpp
@@ -285,7 +285,33 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
}
break;
- case 'x':
+ case 'x':
+ // This fixes the poorly named crc32 intrinsics
+ if (Name.compare(5, 13, "x86.sse42.crc", 13) == 0) {
+ const char* NewFnName = NULL;
+ if (Name.compare(18, 2, "32", 2) == 0) {
+ if (Name.compare(20, 2, ".8") == 0 && Name.length() == 22) {
+ NewFnName = "llvm.x86.sse42.crc32.32.8";
+ } else if (Name.compare(20, 3, ".16") == 0 && Name.length() == 23) {
+ NewFnName = "llvm.x86.sse42.crc32.32.16";
+ } else if (Name.compare(20, 3, ".32") == 0 && Name.length() == 23) {
+ NewFnName = "llvm.x86.sse42.crc32.32.32";
+ }
+ }
+ else if (Name.compare(18, 2, "64", 2) == 0) {
+ if (Name.compare(20, 2, ".8") == 0 && Name.length() == 22) {
+ NewFnName = "llvm.x86.sse42.crc32.64.8";
+ } else if (Name.compare(20, 3, ".64") == 0 && Name.length() == 23) {
+ NewFnName = "llvm.x86.sse42.crc32.64.64";
+ }
+ }
+ if (NewFnName) {
+ F->setName(NewFnName);
+ NewFn = F;
+ return true;
+ }
+ }
+
// This fixes all MMX shift intrinsic instructions to take a
// x86_mmx instead of a v1i64, v2i32, v4i16, or v8i8.
if (Name.compare(5, 8, "x86.mmx.", 8) == 0) {
@@ -533,6 +559,13 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
// Calls to these instructions are transformed into unaligned loads.
NewFn = 0;
return true;
+ } else if (Name.compare(5, 16, "x86.sse.movnt.ps", 16) == 0 ||
+ Name.compare(5, 17, "x86.sse2.movnt.dq", 17) == 0 ||
+ Name.compare(5, 17, "x86.sse2.movnt.pd", 17) == 0 ||
+ Name.compare(5, 17, "x86.sse2.movnt.i", 16) == 0) {
+ // Calls to these instructions are transformed into nontemporal stores.
+ NewFn = 0;
+ return true;
} else if (Name.compare(5, 17, "x86.ssse3.pshuf.w", 17) == 0) {
// This is an SSE/MMX instruction.
const Type *X86_MMXTy = VectorType::getX86_MMXTy(FTy->getContext());
@@ -975,6 +1008,31 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
// Remove intrinsic.
CI->eraseFromParent();
+ } else if (F->getName() == "llvm.x86.sse.movnt.ps" ||
+ F->getName() == "llvm.x86.sse2.movnt.dq" ||
+ F->getName() == "llvm.x86.sse2.movnt.pd" ||
+ F->getName() == "llvm.x86.sse2.movnt.i") {
+ IRBuilder<> Builder(C);
+ Builder.SetInsertPoint(CI->getParent(), CI);
+
+ Module *M = F->getParent();
+ SmallVector<Value *, 1> Elts;
+ Elts.push_back(ConstantInt::get(Type::getInt32Ty(C), 1));
+ MDNode *Node = MDNode::get(C, Elts);
+
+ Value *Arg0 = CI->getArgOperand(0);
+ Value *Arg1 = CI->getArgOperand(1);
+
+ // Convert the type of the pointer to a pointer to the stored type.
+ Value *BC = Builder.CreateBitCast(Arg0,
+ PointerType::getUnqual(Arg1->getType()),
+ "cast");
+ StoreInst *SI = Builder.CreateStore(Arg1, BC);
+ SI->setMetadata(M->getMDKindID("nontemporal"), Node);
+ SI->setAlignment(16);
+
+ // Remove intrinsic.
+ CI->eraseFromParent();
} else {
llvm_unreachable("Unknown function for CallInst upgrade.");
}
diff --git a/contrib/llvm/lib/VMCore/DebugInfoProbe.cpp b/contrib/llvm/lib/VMCore/DebugInfoProbe.cpp
index 334c3d8..d1275ff 100644
--- a/contrib/llvm/lib/VMCore/DebugInfoProbe.cpp
+++ b/contrib/llvm/lib/VMCore/DebugInfoProbe.cpp
@@ -51,7 +51,6 @@ namespace llvm {
unsigned NumDbgLineLost, NumDbgValueLost;
std::string PassName;
Function *TheFn;
- std::set<unsigned> LineNos;
std::set<MDNode *> DbgVariables;
std::set<Instruction *> MissingDebugLoc;
};
@@ -60,37 +59,19 @@ namespace llvm {
//===----------------------------------------------------------------------===//
// DebugInfoProbeImpl
-static void collect(Function &F, std::set<unsigned> &Lines) {
- for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
- for (BasicBlock::iterator BI = FI->begin(), BE = FI->end();
- BI != BE; ++BI) {
- const DebugLoc &DL = BI->getDebugLoc();
- unsigned LineNo = 0;
- if (!DL.isUnknown()) {
- if (MDNode *N = DL.getInlinedAt(F.getContext()))
- LineNo = DebugLoc::getFromDILocation(N).getLine();
- else
- LineNo = DL.getLine();
-
- Lines.insert(LineNo);
- }
- }
-}
-
/// initialize - Collect information before running an optimization pass.
void DebugInfoProbeImpl::initialize(StringRef PName, Function &F) {
if (!EnableDebugInfoProbe) return;
PassName = PName;
- LineNos.clear();
DbgVariables.clear();
+ MissingDebugLoc.clear();
TheFn = &F;
- collect(F, LineNos);
for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
for (BasicBlock::iterator BI = FI->begin(), BE = FI->end();
BI != BE; ++BI) {
- if (BI->getDebugLoc().isUnknown())
+ if (!isa<PHINode>(BI) && BI->getDebugLoc().isUnknown())
MissingDebugLoc.insert(BI);
if (!isa<DbgInfoIntrinsic>(BI)) continue;
Value *Addr = NULL;
@@ -130,30 +111,16 @@ void DebugInfoProbeImpl::report() {
/// must be used after initialization.
void DebugInfoProbeImpl::finalize(Function &F) {
if (!EnableDebugInfoProbe) return;
- std::set<unsigned> LineNos2;
- collect(F, LineNos2);
assert (TheFn == &F && "Invalid function to measure!");
- for (std::set<unsigned>::iterator I = LineNos.begin(),
- E = LineNos.end(); I != E; ++I) {
- unsigned LineNo = *I;
- if (LineNos2.count(LineNo) == 0) {
- DEBUG(dbgs()
- << "DebugInfoProbe("
- << PassName
- << "): Losing dbg info for source line "
- << LineNo << "\n");
- ++NumDbgLineLost;
- }
- }
-
std::set<MDNode *>DbgVariables2;
for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI)
for (BasicBlock::iterator BI = FI->begin(), BE = FI->end();
BI != BE; ++BI) {
- if (BI->getDebugLoc().isUnknown() &&
+ if (!isa<PHINode>(BI) && BI->getDebugLoc().isUnknown() &&
MissingDebugLoc.count(BI) == 0) {
- DEBUG(dbgs() << "DebugInfoProbe(" << PassName << "): --- ");
+ ++NumDbgLineLost;
+ DEBUG(dbgs() << "DebugInfoProbe (" << PassName << "): --- ");
DEBUG(BI->print(dbgs()));
DEBUG(dbgs() << "\n");
}
diff --git a/contrib/llvm/lib/VMCore/Function.cpp b/contrib/llvm/lib/VMCore/Function.cpp
index 013c458..0ae0bdb 100644
--- a/contrib/llvm/lib/VMCore/Function.cpp
+++ b/contrib/llvm/lib/VMCore/Function.cpp
@@ -24,6 +24,7 @@
#include "llvm/Support/Threading.h"
#include "SymbolTableListTraitsImpl.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
using namespace llvm;
@@ -78,6 +79,12 @@ bool Argument::hasByValAttr() const {
return getParent()->paramHasAttr(getArgNo()+1, Attribute::ByVal);
}
+unsigned Argument::getParamAlignment() const {
+ assert(getType()->isPointerTy() && "Only pointers have alignments");
+ return getParent()->getParamAlignment(getArgNo()+1);
+
+}
+
/// hasNestAttr - Return true if this argument has the nest attribute on
/// it in its containing function.
bool Argument::hasNestAttr() const {
@@ -406,4 +413,36 @@ bool Function::hasAddressTaken(const User* *PutOffender) const {
return false;
}
+/// callsFunctionThatReturnsTwice - Return true if the function has a call to
+/// setjmp or other function that gcc recognizes as "returning twice".
+///
+/// FIXME: Remove after <rdar://problem/8031714> is fixed.
+/// FIXME: Is the obove FIXME valid?
+bool Function::callsFunctionThatReturnsTwice() const {
+ const Module *M = this->getParent();
+ static const char *ReturnsTwiceFns[] = {
+ "_setjmp",
+ "setjmp",
+ "sigsetjmp",
+ "setjmp_syscall",
+ "savectx",
+ "qsetjmp",
+ "vfork",
+ "getcontext"
+ };
+
+ for (unsigned I = 0; I < array_lengthof(ReturnsTwiceFns); ++I)
+ if (const Function *Callee = M->getFunction(ReturnsTwiceFns[I])) {
+ if (!Callee->use_empty())
+ for (Value::const_use_iterator
+ I = Callee->use_begin(), E = Callee->use_end();
+ I != E; ++I)
+ if (const CallInst *CI = dyn_cast<CallInst>(*I))
+ if (CI->getParent()->getParent() == this)
+ return true;
+ }
+
+ return false;
+}
+
// vim: sw=2 ai
diff --git a/contrib/llvm/lib/VMCore/IRBuilder.cpp b/contrib/llvm/lib/VMCore/IRBuilder.cpp
index 2149155..f2d469a 100644
--- a/contrib/llvm/lib/VMCore/IRBuilder.cpp
+++ b/contrib/llvm/lib/VMCore/IRBuilder.cpp
@@ -60,7 +60,6 @@ static CallInst *createCallHelper(Value *Callee, Value *const* Ops,
return CI;
}
-
CallInst *IRBuilderBase::
CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align,
bool isVolatile, MDNode *TBAATag) {
@@ -118,3 +117,33 @@ CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align,
return CI;
}
+
+CallInst *IRBuilderBase::CreateLifetimeStart(Value *Ptr, ConstantInt *Size) {
+ assert(isa<PointerType>(Ptr->getType()) &&
+ "lifetime.start only applies to pointers.");
+ Ptr = getCastedInt8PtrValue(Ptr);
+ if (!Size)
+ Size = getInt64(-1);
+ else
+ assert(Size->getType() == getInt64Ty() &&
+ "lifetime.start requires the size to be an i64");
+ Value *Ops[] = { Size, Ptr };
+ Module *M = BB->getParent()->getParent();
+ Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::lifetime_start);
+ return createCallHelper(TheFn, Ops, 2, this);
+}
+
+CallInst *IRBuilderBase::CreateLifetimeEnd(Value *Ptr, ConstantInt *Size) {
+ assert(isa<PointerType>(Ptr->getType()) &&
+ "lifetime.end only applies to pointers.");
+ Ptr = getCastedInt8PtrValue(Ptr);
+ if (!Size)
+ Size = getInt64(-1);
+ else
+ assert(Size->getType() == getInt64Ty() &&
+ "lifetime.end requires the size to be an i64");
+ Value *Ops[] = { Size, Ptr };
+ Module *M = BB->getParent()->getParent();
+ Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::lifetime_end);
+ return createCallHelper(TheFn, Ops, 2, this);
+}
diff --git a/contrib/llvm/lib/VMCore/InlineAsm.cpp b/contrib/llvm/lib/VMCore/InlineAsm.cpp
index e4f99f0..bd3667d 100644
--- a/contrib/llvm/lib/VMCore/InlineAsm.cpp
+++ b/contrib/llvm/lib/VMCore/InlineAsm.cpp
@@ -181,6 +181,11 @@ bool InlineAsm::ConstraintInfo::Parse(StringRef Str,
multipleAlternativeIndex++;
pCodes = &multipleAlternatives[multipleAlternativeIndex].Codes;
++I;
+ } else if (*I == '^') {
+ // Multi-letter constraint
+ // FIXME: For now assuming these are 2-character constraints.
+ pCodes->push_back(std::string(I+1, I+3));
+ I += 3;
} else {
// Single letter constraint.
pCodes->push_back(std::string(I, I+1));
diff --git a/contrib/llvm/lib/VMCore/Instructions.cpp b/contrib/llvm/lib/VMCore/Instructions.cpp
index 61da9b6..8f4eabe 100644
--- a/contrib/llvm/lib/VMCore/Instructions.cpp
+++ b/contrib/llvm/lib/VMCore/Instructions.cpp
@@ -2076,6 +2076,7 @@ unsigned CastInst::isEliminableCastPair(
CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty,
const Twine &Name, Instruction *InsertBefore) {
+ assert(castIsValid(op, S, Ty) && "Invalid cast!");
// Construct and return the appropriate CastInst subclass
switch (op) {
case Trunc: return new TruncInst (S, Ty, Name, InsertBefore);
@@ -2098,6 +2099,7 @@ CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty,
CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty,
const Twine &Name, BasicBlock *InsertAtEnd) {
+ assert(castIsValid(op, S, Ty) && "Invalid cast!");
// Construct and return the appropriate CastInst subclass
switch (op) {
case Trunc: return new TruncInst (S, Ty, Name, InsertAtEnd);
@@ -2254,60 +2256,56 @@ bool CastInst::isCastable(const Type *SrcTy, const Type *DestTy) {
if (SrcTy == DestTy)
return true;
+ if (const VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy))
+ if (const VectorType *DestVecTy = dyn_cast<VectorType>(DestTy))
+ if (SrcVecTy->getNumElements() == DestVecTy->getNumElements()) {
+ // An element by element cast. Valid if casting the elements is valid.
+ SrcTy = SrcVecTy->getElementType();
+ DestTy = DestVecTy->getElementType();
+ }
+
// Get the bit sizes, we'll need these
- unsigned SrcBits = SrcTy->getScalarSizeInBits(); // 0 for ptr
- unsigned DestBits = DestTy->getScalarSizeInBits(); // 0 for ptr
+ unsigned SrcBits = SrcTy->getPrimitiveSizeInBits(); // 0 for ptr
+ unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr
// Run through the possibilities ...
- if (DestTy->isIntegerTy()) { // Casting to integral
- if (SrcTy->isIntegerTy()) { // Casting from integral
+ if (DestTy->isIntegerTy()) { // Casting to integral
+ if (SrcTy->isIntegerTy()) { // Casting from integral
return true;
- } else if (SrcTy->isFloatingPointTy()) { // Casting from floating pt
+ } else if (SrcTy->isFloatingPointTy()) { // Casting from floating pt
return true;
- } else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
- return DestBits == PTy->getBitWidth();
+ } else if (SrcTy->isVectorTy()) { // Casting from vector
+ return DestBits == SrcBits;
} else { // Casting from something else
return SrcTy->isPointerTy();
}
- } else if (DestTy->isFloatingPointTy()) { // Casting to floating pt
- if (SrcTy->isIntegerTy()) { // Casting from integral
+ } else if (DestTy->isFloatingPointTy()) { // Casting to floating pt
+ if (SrcTy->isIntegerTy()) { // Casting from integral
return true;
- } else if (SrcTy->isFloatingPointTy()) { // Casting from floating pt
+ } else if (SrcTy->isFloatingPointTy()) { // Casting from floating pt
return true;
- } else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
- return DestBits == PTy->getBitWidth();
+ } else if (SrcTy->isVectorTy()) { // Casting from vector
+ return DestBits == SrcBits;
} else { // Casting from something else
return false;
}
- } else if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
- // Casting to vector
- if (const VectorType *SrcPTy = dyn_cast<VectorType>(SrcTy)) {
- // Casting from vector
- return DestPTy->getBitWidth() == SrcPTy->getBitWidth();
- } else if (DestPTy->getBitWidth() == SrcBits) {
- return true; // float/int -> vector
- } else if (SrcTy->isX86_MMXTy()) {
- return DestPTy->getBitWidth() == 64; // MMX to 64-bit vector
- } else {
- return false;
- }
+ } else if (DestTy->isVectorTy()) { // Casting to vector
+ return DestBits == SrcBits;
} else if (DestTy->isPointerTy()) { // Casting to pointer
- if (SrcTy->isPointerTy()) { // Casting from pointer
+ if (SrcTy->isPointerTy()) { // Casting from pointer
return true;
- } else if (SrcTy->isIntegerTy()) { // Casting from integral
+ } else if (SrcTy->isIntegerTy()) { // Casting from integral
return true;
- } else { // Casting from something else
+ } else { // Casting from something else
return false;
}
} else if (DestTy->isX86_MMXTy()) {
- if (const VectorType *SrcPTy = dyn_cast<VectorType>(SrcTy)) {
- return SrcPTy->getBitWidth() == 64; // 64-bit vector to MMX
+ if (SrcTy->isVectorTy()) {
+ return DestBits == SrcBits; // 64-bit vector to MMX
} else {
return false;
}
- } else { // Casting to something else
+ } else { // Casting to something else
return false;
}
}
@@ -2322,14 +2320,27 @@ bool CastInst::isCastable(const Type *SrcTy, const Type *DestTy) {
Instruction::CastOps
CastInst::getCastOpcode(
const Value *Src, bool SrcIsSigned, const Type *DestTy, bool DestIsSigned) {
- // Get the bit sizes, we'll need these
const Type *SrcTy = Src->getType();
- unsigned SrcBits = SrcTy->getScalarSizeInBits(); // 0 for ptr
- unsigned DestBits = DestTy->getScalarSizeInBits(); // 0 for ptr
assert(SrcTy->isFirstClassType() && DestTy->isFirstClassType() &&
"Only first class types are castable!");
+ if (SrcTy == DestTy)
+ return BitCast;
+
+ if (const VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy))
+ if (const VectorType *DestVecTy = dyn_cast<VectorType>(DestTy))
+ if (SrcVecTy->getNumElements() == DestVecTy->getNumElements()) {
+ // An element by element cast. Find the appropriate opcode based on the
+ // element types.
+ SrcTy = SrcVecTy->getElementType();
+ DestTy = DestVecTy->getElementType();
+ }
+
+ // Get the bit sizes, we'll need these
+ unsigned SrcBits = SrcTy->getPrimitiveSizeInBits(); // 0 for ptr
+ unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr
+
// Run through the possibilities ...
if (DestTy->isIntegerTy()) { // Casting to integral
if (SrcTy->isIntegerTy()) { // Casting from integral
@@ -2348,10 +2359,9 @@ CastInst::getCastOpcode(
return FPToSI; // FP -> sint
else
return FPToUI; // FP -> uint
- } else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- assert(DestBits == PTy->getBitWidth() &&
- "Casting vector to integer of different width");
- PTy = NULL;
+ } else if (SrcTy->isVectorTy()) {
+ assert(DestBits == SrcBits &&
+ "Casting vector to integer of different width");
return BitCast; // Same size, no-op cast
} else {
assert(SrcTy->isPointerTy() &&
@@ -2372,29 +2382,17 @@ CastInst::getCastOpcode(
} else {
return BitCast; // same size, no-op cast
}
- } else if (const VectorType *PTy = dyn_cast<VectorType>(SrcTy)) {
- assert(DestBits == PTy->getBitWidth() &&
+ } else if (SrcTy->isVectorTy()) {
+ assert(DestBits == SrcBits &&
"Casting vector to floating point of different width");
- PTy = NULL;
return BitCast; // same size, no-op cast
} else {
llvm_unreachable("Casting pointer or non-first class to float");
}
- } else if (const VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
- if (const VectorType *SrcPTy = dyn_cast<VectorType>(SrcTy)) {
- assert(DestPTy->getBitWidth() == SrcPTy->getBitWidth() &&
- "Casting vector to vector of different widths");
- SrcPTy = NULL;
- return BitCast; // vector -> vector
- } else if (DestPTy->getBitWidth() == SrcBits) {
- return BitCast; // float/int -> vector
- } else if (SrcTy->isX86_MMXTy()) {
- assert(DestPTy->getBitWidth()==64 &&
- "Casting X86_MMX to vector of wrong width");
- return BitCast; // MMX to 64-bit vector
- } else {
- assert(!"Illegal cast to vector (wrong type or size)");
- }
+ } else if (DestTy->isVectorTy()) {
+ assert(DestBits == SrcBits &&
+ "Illegal cast to vector (wrong type or size)");
+ return BitCast;
} else if (DestTy->isPointerTy()) {
if (SrcTy->isPointerTy()) {
return BitCast; // ptr -> ptr
@@ -2404,9 +2402,8 @@ CastInst::getCastOpcode(
assert(!"Casting pointer to other than pointer or int");
}
} else if (DestTy->isX86_MMXTy()) {
- if (isa<VectorType>(SrcTy)) {
- assert(cast<VectorType>(SrcTy)->getBitWidth() == 64 &&
- "Casting vector of wrong width to X86_MMX");
+ if (SrcTy->isVectorTy()) {
+ assert(DestBits == SrcBits && "Casting vector of wrong width to X86_MMX");
return BitCast; // 64-bit vector to MMX
} else {
assert(!"Illegal cast to X86_MMX");
@@ -2442,46 +2439,40 @@ CastInst::castIsValid(Instruction::CastOps op, Value *S, const Type *DstTy) {
unsigned SrcBitSize = SrcTy->getScalarSizeInBits();
unsigned DstBitSize = DstTy->getScalarSizeInBits();
+ // If these are vector types, get the lengths of the vectors (using zero for
+ // scalar types means that checking that vector lengths match also checks that
+ // scalars are not being converted to vectors or vectors to scalars).
+ unsigned SrcLength = SrcTy->isVectorTy() ?
+ cast<VectorType>(SrcTy)->getNumElements() : 0;
+ unsigned DstLength = DstTy->isVectorTy() ?
+ cast<VectorType>(DstTy)->getNumElements() : 0;
+
// Switch on the opcode provided
switch (op) {
default: return false; // This is an input error
case Instruction::Trunc:
- return SrcTy->isIntOrIntVectorTy() &&
- DstTy->isIntOrIntVectorTy()&& SrcBitSize > DstBitSize;
+ return SrcTy->isIntOrIntVectorTy() && DstTy->isIntOrIntVectorTy() &&
+ SrcLength == DstLength && SrcBitSize > DstBitSize;
case Instruction::ZExt:
- return SrcTy->isIntOrIntVectorTy() &&
- DstTy->isIntOrIntVectorTy()&& SrcBitSize < DstBitSize;
+ return SrcTy->isIntOrIntVectorTy() && DstTy->isIntOrIntVectorTy() &&
+ SrcLength == DstLength && SrcBitSize < DstBitSize;
case Instruction::SExt:
- return SrcTy->isIntOrIntVectorTy() &&
- DstTy->isIntOrIntVectorTy()&& SrcBitSize < DstBitSize;
+ return SrcTy->isIntOrIntVectorTy() && DstTy->isIntOrIntVectorTy() &&
+ SrcLength == DstLength && SrcBitSize < DstBitSize;
case Instruction::FPTrunc:
- return SrcTy->isFPOrFPVectorTy() &&
- DstTy->isFPOrFPVectorTy() &&
- SrcBitSize > DstBitSize;
+ return SrcTy->isFPOrFPVectorTy() && DstTy->isFPOrFPVectorTy() &&
+ SrcLength == DstLength && SrcBitSize > DstBitSize;
case Instruction::FPExt:
- return SrcTy->isFPOrFPVectorTy() &&
- DstTy->isFPOrFPVectorTy() &&
- SrcBitSize < DstBitSize;
+ return SrcTy->isFPOrFPVectorTy() && DstTy->isFPOrFPVectorTy() &&
+ SrcLength == DstLength && SrcBitSize < DstBitSize;
case Instruction::UIToFP:
case Instruction::SIToFP:
- if (const VectorType *SVTy = dyn_cast<VectorType>(SrcTy)) {
- if (const VectorType *DVTy = dyn_cast<VectorType>(DstTy)) {
- return SVTy->getElementType()->isIntOrIntVectorTy() &&
- DVTy->getElementType()->isFPOrFPVectorTy() &&
- SVTy->getNumElements() == DVTy->getNumElements();
- }
- }
- return SrcTy->isIntOrIntVectorTy() && DstTy->isFPOrFPVectorTy();
+ return SrcTy->isIntOrIntVectorTy() && DstTy->isFPOrFPVectorTy() &&
+ SrcLength == DstLength;
case Instruction::FPToUI:
case Instruction::FPToSI:
- if (const VectorType *SVTy = dyn_cast<VectorType>(SrcTy)) {
- if (const VectorType *DVTy = dyn_cast<VectorType>(DstTy)) {
- return SVTy->getElementType()->isFPOrFPVectorTy() &&
- DVTy->getElementType()->isIntOrIntVectorTy() &&
- SVTy->getNumElements() == DVTy->getNumElements();
- }
- }
- return SrcTy->isFPOrFPVectorTy() && DstTy->isIntOrIntVectorTy();
+ return SrcTy->isFPOrFPVectorTy() && DstTy->isIntOrIntVectorTy() &&
+ SrcLength == DstLength;
case Instruction::PtrToInt:
return SrcTy->isPointerTy() && DstTy->isIntegerTy();
case Instruction::IntToPtr:
diff --git a/contrib/llvm/lib/VMCore/PassManager.cpp b/contrib/llvm/lib/VMCore/PassManager.cpp
index 637fa79..5cf2905 100644
--- a/contrib/llvm/lib/VMCore/PassManager.cpp
+++ b/contrib/llvm/lib/VMCore/PassManager.cpp
@@ -449,9 +449,9 @@ namespace {
static DebugInfoProbeInfo *TheDebugProbe;
static void createDebugInfoProbe() {
if (TheDebugProbe) return;
-
- // Constructed the first time this is called. This guarantees that the
- // object will be constructed, if -enable-debug-info-probe is set,
+
+ // Constructed the first time this is called. This guarantees that the
+ // object will be constructed, if -enable-debug-info-probe is set,
// before static globals, thus it will be destroyed before them.
static ManagedStatic<DebugInfoProbeInfo> DIP;
TheDebugProbe = &*DIP;
@@ -632,6 +632,7 @@ void PMTopLevelManager::schedulePass(Pass *P) {
Pass *AnalysisPass = findAnalysisPass(*I);
if (!AnalysisPass) {
const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I);
+ assert(PI && "Expected required passes to be initialized");
AnalysisPass = PI->createPass();
if (P->getPotentialPassManagerType () ==
AnalysisPass->getPotentialPassManagerType())
@@ -686,6 +687,7 @@ Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) {
// If Pass not found then check the interfaces implemented by Immutable Pass
const PassInfo *PassInf =
PassRegistry::getPassRegistry()->getPassInfo(PI);
+ assert(PassInf && "Expected all immutable passes to be initialized");
const std::vector<const PassInfo*> &ImmPI =
PassInf->getInterfacesImplemented();
for (std::vector<const PassInfo*>::const_iterator II = ImmPI.begin(),
@@ -727,9 +729,11 @@ void PMTopLevelManager::dumpArguments() const {
for (SmallVector<ImmutablePass *, 8>::const_iterator I =
ImmutablePasses.begin(), E = ImmutablePasses.end(); I != E; ++I)
if (const PassInfo *PI =
- PassRegistry::getPassRegistry()->getPassInfo((*I)->getPassID()))
+ PassRegistry::getPassRegistry()->getPassInfo((*I)->getPassID())) {
+ assert(PI && "Expected all immutable passes to be initialized");
if (!PI->isAnalysisGroup())
dbgs() << " -" << PI->getPassArgument();
+ }
for (SmallVector<PMDataManager *, 8>::const_iterator I = PassManagers.begin(),
E = PassManagers.end(); I != E; ++I)
(*I)->dumpPassArguments();
@@ -1183,6 +1187,12 @@ void PMDataManager::dumpAnalysisUsage(StringRef Msg, const Pass *P,
for (unsigned i = 0; i != Set.size(); ++i) {
if (i) dbgs() << ',';
const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(Set[i]);
+ if (!PInf) {
+ // Some preserved passes, such as AliasAnalysis, may not be initialized by
+ // all drivers.
+ dbgs() << " Uninitialized Pass";
+ continue;
+ }
dbgs() << ' ' << PInf->getPassName();
}
dbgs() << '\n';
diff --git a/contrib/llvm/lib/VMCore/Type.cpp b/contrib/llvm/lib/VMCore/Type.cpp
index b15304c..e4496db 100644
--- a/contrib/llvm/lib/VMCore/Type.cpp
+++ b/contrib/llvm/lib/VMCore/Type.cpp
@@ -197,6 +197,25 @@ bool Type::canLosslesslyBitCastTo(const Type *Ty) const {
return false; // Other types have no identity values
}
+bool Type::isEmptyTy() const {
+ const ArrayType *ATy = dyn_cast<ArrayType>(this);
+ if (ATy) {
+ unsigned NumElements = ATy->getNumElements();
+ return NumElements == 0 || ATy->getElementType()->isEmptyTy();
+ }
+
+ const StructType *STy = dyn_cast<StructType>(this);
+ if (STy) {
+ unsigned NumElements = STy->getNumElements();
+ for (unsigned i = 0; i < NumElements; ++i)
+ if (!STy->getElementType(i)->isEmptyTy())
+ return false;
+ return true;
+ }
+
+ return false;
+}
+
unsigned Type::getPrimitiveSizeInBits() const {
switch (getTypeID()) {
case Type::FloatTyID: return 32;
diff --git a/contrib/llvm/lib/VMCore/Verifier.cpp b/contrib/llvm/lib/VMCore/Verifier.cpp
index 8b89110..139e035 100644
--- a/contrib/llvm/lib/VMCore/Verifier.cpp
+++ b/contrib/llvm/lib/VMCore/Verifier.cpp
@@ -1645,6 +1645,9 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
Assert1(isa<ConstantInt>(CI.getArgOperand(3)),
"alignment argument of memory intrinsics must be a constant int",
&CI);
+ Assert1(isa<ConstantInt>(CI.getArgOperand(4)),
+ "isvolatile argument of memory intrinsics must be a constant int",
+ &CI);
break;
case Intrinsic::gcroot:
case Intrinsic::gcwrite:
diff --git a/contrib/llvm/tools/clang/include/clang-c/Index.h b/contrib/llvm/tools/clang/include/clang-c/Index.h
index d89a903..cb0b3c1 100644
--- a/contrib/llvm/tools/clang/include/clang-c/Index.h
+++ b/contrib/llvm/tools/clang/include/clang-c/Index.h
@@ -222,6 +222,14 @@ CINDEX_LINKAGE CXString clang_getFileName(CXFile SFile);
CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile);
/**
+ * \brief Determine whether the given header is guarded against
+ * multiple inclusions, either with the conventional
+ * #ifndef/#define/#endif macro guards or with #pragma once.
+ */
+CINDEX_LINKAGE unsigned
+clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file);
+
+/**
* \brief Retrieve a file handle within the given translation unit.
*
* \param tu the translation unit
@@ -821,7 +829,18 @@ enum CXTranslationUnit_Flags {
* Note: this is a *temporary* option that is available only while
* we are testing C++ precompiled preamble support.
*/
- CXTranslationUnit_CXXChainedPCH = 0x20
+ CXTranslationUnit_CXXChainedPCH = 0x20,
+
+ /**
+ * \brief Used to indicate that the "detailed" preprocessing record,
+ * if requested, should also contain nested macro instantiations.
+ *
+ * Nested macro instantiations (i.e., macro instantiations that occur
+ * inside another macro instantiation) can, in some code bases, require
+ * a large amount of storage to due preprocessor metaprogramming. Moreover,
+ * its fairly rare that this information is useful for libclang clients.
+ */
+ CXTranslationUnit_NestedMacroInstantiations = 0x40
};
/**
@@ -1027,12 +1046,14 @@ enum CXTUResourceUsageKind {
CXTUResourceUsage_SourceManager_Membuffer_MMap = 8,
CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
+ CXTUResourceUsage_Preprocessor = 11,
+ CXTUResourceUsage_PreprocessingRecord = 12,
CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN = CXTUResourceUsage_AST,
CXTUResourceUsage_MEMORY_IN_BYTES_END =
- CXTUResourceUsage_ExternalASTSource_Membuffer_MMap,
+ CXTUResourceUsage_PreprocessingRecord,
CXTUResourceUsage_First = CXTUResourceUsage_AST,
- CXTUResourceUsage_Last = CXTUResourceUsage_ExternalASTSource_Membuffer_MMap
+ CXTUResourceUsage_Last = CXTUResourceUsage_PreprocessingRecord
};
/**
@@ -1166,8 +1187,12 @@ enum CXCursorKind {
CXCursor_UsingDeclaration = 35,
/** \brief A C++ alias declaration */
CXCursor_TypeAliasDecl = 36,
+ /** \brief An Objective-C @synthesize definition. */
+ CXCursor_ObjCSynthesizeDecl = 37,
+ /** \brief An Objective-C @dynamic definition. */
+ CXCursor_ObjCDynamicDecl = 38,
CXCursor_FirstDecl = CXCursor_UnexposedDecl,
- CXCursor_LastDecl = CXCursor_TypeAliasDecl,
+ CXCursor_LastDecl = CXCursor_ObjCDynamicDecl,
/* References */
CXCursor_FirstRef = 40, /* Decl references */
@@ -2246,6 +2271,13 @@ CINDEX_LINKAGE CXCursor clang_getCanonicalCursor(CXCursor);
CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C);
/**
+ * \brief Determine if a C++ member function or member function template is
+ * explicitly declared 'virtual' or if it overrides a virtual method from
+ * one of the base classes.
+ */
+CINDEX_LINKAGE unsigned clang_CXXMethod_isVirtual(CXCursor C);
+
+/**
* \brief Given a cursor that represents a template, determine
* the cursor kind of the specializations would be generated by instantiating
* the template.
diff --git a/contrib/llvm/tools/clang/include/clang/AST/APValue.h b/contrib/llvm/tools/clang/include/clang/AST/APValue.h
index 5effa90..fec7d29 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/APValue.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/APValue.h
@@ -85,10 +85,10 @@ public:
APValue(const APValue &RHS) : Kind(Uninitialized) {
*this = RHS;
}
- APValue(Expr* B, const CharUnits &O) : Kind(Uninitialized) {
+ APValue(const Expr* B, const CharUnits &O) : Kind(Uninitialized) {
MakeLValue(); setLValue(B, O);
}
- APValue(Expr* B);
+ APValue(const Expr* B);
~APValue() {
MakeUninit();
@@ -167,7 +167,7 @@ public:
return const_cast<APValue*>(this)->getComplexFloatImag();
}
- Expr* getLValueBase() const;
+ const Expr* getLValueBase() const;
CharUnits getLValueOffset() const;
void setInt(const APSInt &I) {
@@ -199,7 +199,7 @@ public:
((ComplexAPFloat*)(char*)Data)->Real = R;
((ComplexAPFloat*)(char*)Data)->Imag = I;
}
- void setLValue(Expr *B, const CharUnits &O);
+ void setLValue(const Expr *B, const CharUnits &O);
const APValue &operator=(const APValue &RHS);
diff --git a/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h b/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h
index 28ec8cf..517c25d 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h
@@ -406,6 +406,21 @@ public:
/// bitfield which follows the bitfield 'LastFD'.
bool ZeroBitfieldFollowsBitfield(const FieldDecl *FD,
const FieldDecl *LastFD) const;
+
+ /// BitfieldFollowsBitfield - return 'true" if 'FD' is a
+ /// bitfield which follows the bitfield 'LastFD'.
+ bool BitfieldFollowsBitfield(const FieldDecl *FD,
+ const FieldDecl *LastFD) const;
+
+ /// NoneBitfieldFollowsBitfield - return 'true" if 'FD' is not a
+ /// bitfield which follows the bitfield 'LastFD'.
+ bool NoneBitfieldFollowsBitfield(const FieldDecl *FD,
+ const FieldDecl *LastFD) const;
+
+ /// BitfieldFollowsNoneBitfield - return 'true" if 'FD' is a
+ /// bitfield which follows the none bitfield 'LastFD'.
+ bool BitfieldFollowsNoneBitfield(const FieldDecl *FD,
+ const FieldDecl *LastFD) const;
// Access to the set of methods overridden by the given C++ method.
typedef CXXMethodVector::iterator overridden_cxx_method_iterator;
@@ -764,6 +779,10 @@ public:
/// getDecltypeType - C++0x decltype.
QualType getDecltypeType(Expr *e) const;
+ /// getUnaryTransformType - unary type transforms
+ QualType getUnaryTransformType(QualType BaseType, QualType UnderlyingType,
+ UnaryTransformType::UTTKind UKind) const;
+
/// getAutoType - C++0x deduced auto type.
QualType getAutoType(QualType DeducedType) const;
@@ -895,12 +914,18 @@ public:
std::string &S) const;
/// getObjCEncodingForFunctionDecl - Returns the encoded type for this
- //function. This is in the same format as Objective-C method encodings.
- void getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, std::string& S);
+ /// function. This is in the same format as Objective-C method encodings.
+ ///
+ /// \returns true if an error occurred (e.g., because one of the parameter
+ /// types is incomplete), false otherwise.
+ bool getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, std::string& S);
/// getObjCEncodingForMethodDecl - Return the encoded type for this method
/// declaration.
- void getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S)
+ ///
+ /// \returns true if an error occurred (e.g., because one of the parameter
+ /// types is incomplete), false otherwise.
+ bool getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, std::string &S)
const;
/// getObjCEncodingForBlock - Return the encoded type for this block
@@ -1438,7 +1463,8 @@ public:
/// MakeIntValue - Make an APSInt of the appropriate width and
/// signedness for the given \arg Value and integer \arg Type.
llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) const {
- llvm::APSInt Res(getIntWidth(Type), !Type->isSignedIntegerType());
+ llvm::APSInt Res(getIntWidth(Type),
+ !Type->isSignedIntegerOrEnumerationType());
Res = Value;
return Res;
}
@@ -1526,6 +1552,13 @@ public:
/// which declarations were built.
static unsigned NumImplicitCopyConstructorsDeclared;
+ /// \brief The number of implicitly-declared move constructors.
+ static unsigned NumImplicitMoveConstructors;
+
+ /// \brief The number of implicitly-declared move constructors for
+ /// which declarations were built.
+ static unsigned NumImplicitMoveConstructorsDeclared;
+
/// \brief The number of implicitly-declared copy assignment operators.
static unsigned NumImplicitCopyAssignmentOperators;
@@ -1533,6 +1566,13 @@ public:
/// which declarations were built.
static unsigned NumImplicitCopyAssignmentOperatorsDeclared;
+ /// \brief The number of implicitly-declared move assignment operators.
+ static unsigned NumImplicitMoveAssignmentOperators;
+
+ /// \brief The number of implicitly-declared move assignment operators for
+ /// which declarations were built.
+ static unsigned NumImplicitMoveAssignmentOperatorsDeclared;
+
/// \brief The number of implicitly-declared destructors.
static unsigned NumImplicitDestructors;
@@ -1553,7 +1593,13 @@ private:
bool ExpandStructures,
const FieldDecl *Field,
bool OutermostType = false,
- bool EncodingProperty = false) const;
+ bool EncodingProperty = false,
+ bool StructField = false) const;
+
+ // Adds the encoding of the structure's members.
+ void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,
+ const FieldDecl *Field,
+ bool includeVBases = true) const;
const ASTRecordLayout &
getObjCLayout(const ObjCInterfaceDecl *D,
diff --git a/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h b/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h
index b3550f8..2518814 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h
@@ -291,6 +291,8 @@ public:
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isPromotableIntegerType)
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isSignedIntegerType)
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isUnsignedIntegerType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isSignedIntegerOrEnumerationType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isUnsignedIntegerOrEnumerationType)
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isConstantSizeType)
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isSpecifierType)
@@ -630,6 +632,14 @@ struct CanProxyAdaptor<DecltypeType> : public CanProxyBase<DecltypeType> {
LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getUnderlyingType)
};
+template <>
+struct CanProxyAdaptor<UnaryTransformType>
+ : public CanProxyBase<UnaryTransformType> {
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getBaseType)
+ LLVM_CLANG_CANPROXY_TYPE_ACCESSOR(getUnderlyingType)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(UnaryTransformType::UTTKind, getUTTKind)
+};
+
template<>
struct CanProxyAdaptor<TagType> : public CanProxyBase<TagType> {
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(TagDecl *, getDecl)
diff --git a/contrib/llvm/tools/clang/include/clang/AST/Decl.h b/contrib/llvm/tools/clang/include/clang/AST/Decl.h
index ef49205..d993d34 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/Decl.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/Decl.h
@@ -1365,6 +1365,8 @@ private:
bool HasWrittenPrototype : 1;
bool IsDeleted : 1;
bool IsTrivial : 1; // sunk from CXXMethodDecl
+ bool IsDefaulted : 1; // sunk from CXXMethoDecl
+ bool IsExplicitlyDefaulted : 1; //sunk from CXXMethodDecl
bool HasImplicitReturnZero : 1;
bool IsLateTemplateParsed : 1;
@@ -1448,6 +1450,7 @@ protected:
IsInline(isInlineSpecified), IsInlineSpecified(isInlineSpecified),
IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false),
HasWrittenPrototype(true), IsDeleted(false), IsTrivial(false),
+ IsDefaulted(false), IsExplicitlyDefaulted(false),
HasImplicitReturnZero(false), IsLateTemplateParsed(false),
EndRangeLoc(NameInfo.getEndLoc()),
TemplateOrSpecialization(),
@@ -1512,6 +1515,20 @@ public:
return hasBody(Definition);
}
+ /// hasTrivialBody - Returns whether the function has a trivial body that does
+ /// not require any specific codegen.
+ bool hasTrivialBody() const;
+
+ /// isDefined - Returns true if the function is defined at all, including
+ /// a deleted definition. Except for the behavior when the function is
+ /// deleted, behaves like hasBody.
+ bool isDefined(const FunctionDecl *&Definition) const;
+
+ virtual bool isDefined() const {
+ const FunctionDecl* Definition;
+ return isDefined(Definition);
+ }
+
/// getBody - Retrieve the body (definition) of the function. The
/// function body might be in any of the (re-)declarations of this
/// function. The variant that accepts a FunctionDecl pointer will
@@ -1529,10 +1546,17 @@ public:
/// isThisDeclarationADefinition - Returns whether this specific
/// declaration of the function is also a definition. This does not
/// determine whether the function has been defined (e.g., in a
- /// previous definition); for that information, use getBody.
- /// FIXME: Should return true if function is deleted or defaulted. However,
- /// CodeGenModule.cpp uses it, and I don't know if this would break it.
+ /// previous definition); for that information, use isDefined. Note
+ /// that this returns false for a defaulted function unless that function
+ /// has been implicitly defined (possibly as deleted).
bool isThisDeclarationADefinition() const {
+ return IsDeleted || Body || IsLateTemplateParsed;
+ }
+
+ /// doesThisDeclarationHaveABody - Returns whether this specific
+ /// declaration of the function has a body - that is, if it is a non-
+ /// deleted definition.
+ bool doesThisDeclarationHaveABody() const {
return Body || IsLateTemplateParsed;
}
@@ -1566,6 +1590,16 @@ public:
bool isTrivial() const { return IsTrivial; }
void setTrivial(bool IT) { IsTrivial = IT; }
+ /// Whether this function is defaulted per C++0x. Only valid for
+ /// special member functions.
+ bool isDefaulted() const { return IsDefaulted; }
+ void setDefaulted(bool D = true) { IsDefaulted = D; }
+
+ /// Whether this function is explicitly defaulted per C++0x. Only valid
+ /// for special member functions.
+ bool isExplicitlyDefaulted() const { return IsExplicitlyDefaulted; }
+ void setExplicitlyDefaulted(bool ED = true) { IsExplicitlyDefaulted = ED; }
+
/// Whether falling off this function implicitly returns null/zero.
/// If a more specific implicit return value is required, front-ends
/// should synthesize the appropriate return statements.
@@ -1605,13 +1639,30 @@ public:
/// Integer(long double) = delete; // no construction from long double
/// };
/// @endcode
- bool isDeleted() const { return IsDeleted; }
- void setDeleted(bool D = true) { IsDeleted = D; }
+ // If a function is deleted, its first declaration must be.
+ bool isDeleted() const { return getCanonicalDecl()->IsDeleted; }
+ bool isDeletedAsWritten() const { return IsDeleted && !IsDefaulted; }
+ void setDeletedAsWritten(bool D = true) { IsDeleted = D; }
- /// \brief Determines whether this is a function "main", which is
- /// the entry point into an executable program.
+ /// \brief Determines whether this function is "main", which is the
+ /// entry point into an executable program.
bool isMain() const;
+ /// \brief Determines whether this operator new or delete is one
+ /// of the reserved global placement operators:
+ /// void *operator new(size_t, void *);
+ /// void *operator new[](size_t, void *);
+ /// void operator delete(void *, void *);
+ /// void operator delete[](void *, void *);
+ /// These functions have special behavior under [new.delete.placement]:
+ /// These functions are reserved, a C++ program may not define
+ /// functions that displace the versions in the Standard C++ library.
+ /// The provisions of [basic.stc.dynamic] do not apply to these
+ /// reserved placement forms of operator new and operator delete.
+ ///
+ /// This function must be an allocation or deallocation function.
+ bool isReservedGlobalPlacementOperator() const;
+
/// \brief Determines whether this function is a function with
/// external, C linkage.
bool isExternC() const;
@@ -1902,20 +1953,33 @@ class FieldDecl : public DeclaratorDecl {
bool Mutable : 1;
mutable unsigned CachedFieldIndex : 31;
- Expr *BitWidth;
+ /// \brief A pointer to either the in-class initializer for this field (if
+ /// the boolean value is false), or the bit width expression for this bit
+ /// field (if the boolean value is true).
+ ///
+ /// We can safely combine these two because in-class initializers are not
+ /// permitted for bit-fields.
+ ///
+ /// If the boolean is false and the initializer is null, then this field has
+ /// an in-class initializer which has not yet been parsed and attached.
+ llvm::PointerIntPair<Expr *, 1, bool> InitializerOrBitWidth;
protected:
FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc,
SourceLocation IdLoc, IdentifierInfo *Id,
- QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable)
+ QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
+ bool HasInit)
: DeclaratorDecl(DK, DC, IdLoc, Id, T, TInfo, StartLoc),
- Mutable(Mutable), CachedFieldIndex(0), BitWidth(BW) {
+ Mutable(Mutable), CachedFieldIndex(0),
+ InitializerOrBitWidth(BW, !HasInit) {
+ assert(!(BW && HasInit) && "got initializer for bitfield");
}
public:
static FieldDecl *Create(const ASTContext &C, DeclContext *DC,
SourceLocation StartLoc, SourceLocation IdLoc,
IdentifierInfo *Id, QualType T,
- TypeSourceInfo *TInfo, Expr *BW, bool Mutable);
+ TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
+ bool HasInit);
/// getFieldIndex - Returns the index of this field within its record,
/// as appropriate for passing to ASTRecordLayout::getFieldOffset.
@@ -1928,10 +1992,12 @@ public:
void setMutable(bool M) { Mutable = M; }
/// isBitfield - Determines whether this field is a bitfield.
- bool isBitField() const { return BitWidth != NULL; }
+ bool isBitField() const {
+ return InitializerOrBitWidth.getInt() && InitializerOrBitWidth.getPointer();
+ }
/// @brief Determines whether this is an unnamed bitfield.
- bool isUnnamedBitfield() const { return BitWidth != NULL && !getDeclName(); }
+ bool isUnnamedBitfield() const { return isBitField() && !getDeclName(); }
/// isAnonymousStructOrUnion - Determines whether this field is a
/// representative for an anonymous struct or union. Such fields are
@@ -1939,8 +2005,37 @@ public:
/// store the data for the anonymous union or struct.
bool isAnonymousStructOrUnion() const;
- Expr *getBitWidth() const { return BitWidth; }
- void setBitWidth(Expr *BW) { BitWidth = BW; }
+ Expr *getBitWidth() const {
+ return isBitField() ? InitializerOrBitWidth.getPointer() : 0;
+ }
+ void setBitWidth(Expr *BW) {
+ assert(!InitializerOrBitWidth.getPointer() &&
+ "bit width or initializer already set");
+ InitializerOrBitWidth.setPointer(BW);
+ InitializerOrBitWidth.setInt(1);
+ }
+
+ /// hasInClassInitializer - Determine whether this member has a C++0x in-class
+ /// initializer.
+ bool hasInClassInitializer() const {
+ return !InitializerOrBitWidth.getInt();
+ }
+ /// getInClassInitializer - Get the C++0x in-class initializer for this
+ /// member, or null if one has not been set. If a valid declaration has an
+ /// in-class initializer, but this returns null, then we have not parsed and
+ /// attached it yet.
+ Expr *getInClassInitializer() const {
+ return hasInClassInitializer() ? InitializerOrBitWidth.getPointer() : 0;
+ }
+ /// setInClassInitializer - Set the C++0x in-class initializer for this member.
+ void setInClassInitializer(Expr *Init);
+ /// removeInClassInitializer - Remove the C++0x in-class initializer from this
+ /// member.
+ void removeInClassInitializer() {
+ assert(!InitializerOrBitWidth.getInt() && "no initializer to remove");
+ InitializerOrBitWidth.setPointer(0);
+ InitializerOrBitWidth.setInt(1);
+ }
/// getParent - Returns the parent of this field declaration, which
/// is the struct in which this method is defined.
diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h b/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h
index ce48187..b5047b9 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h
@@ -1355,17 +1355,12 @@ struct cast_convert_decl_context<ToTy, true> {
namespace llvm {
/// isa<T>(DeclContext*)
-template<class ToTy>
-struct isa_impl_wrap<ToTy,
- const ::clang::DeclContext,const ::clang::DeclContext> {
+template <typename To>
+struct isa_impl<To, ::clang::DeclContext> {
static bool doit(const ::clang::DeclContext &Val) {
- return ToTy::classofKind(Val.getDeclKind());
+ return To::classofKind(Val.getDeclKind());
}
};
-template<class ToTy>
-struct isa_impl_wrap<ToTy, ::clang::DeclContext, ::clang::DeclContext>
- : public isa_impl_wrap<ToTy,
- const ::clang::DeclContext,const ::clang::DeclContext> {};
/// cast<T>(DeclContext*)
template<class ToTy>
diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h b/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h
index 8c819e3..42a12eb 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h
@@ -278,10 +278,18 @@ class CXXRecordDecl : public RecordDecl {
/// user-declared copy constructor.
bool UserDeclaredCopyConstructor : 1;
+ /// UserDeclareMoveConstructor - True when this class has a
+ /// user-declared move constructor.
+ bool UserDeclaredMoveConstructor : 1;
+
/// UserDeclaredCopyAssignment - True when this class has a
/// user-declared copy assignment operator.
bool UserDeclaredCopyAssignment : 1;
+ /// UserDeclareMoveAssignment - True when this class has a
+ /// user-declared move assignment.
+ bool UserDeclaredMoveAssignment : 1;
+
/// UserDeclaredDestructor - True when this class has a
/// user-declared destructor.
bool UserDeclaredDestructor : 1;
@@ -337,15 +345,24 @@ class CXXRecordDecl : public RecordDecl {
/// HasPublicFields - True when there are private non-static data members.
bool HasPublicFields : 1;
- /// HasTrivialConstructor - True when this class has a trivial constructor.
+ /// \brief True if this class (or any subobject) has mutable fields.
+ bool HasMutableFields : 1;
+
+ /// HasTrivialDefaultConstructor - True when, if this class has a default
+ /// constructor, this default constructor is trivial.
///
- /// C++ [class.ctor]p5. A constructor is trivial if it is an
- /// implicitly-declared default constructor and if:
- /// * its class has no virtual functions and no virtual base classes, and
- /// * all the direct base classes of its class have trivial constructors, and
- /// * for all the nonstatic data members of its class that are of class type
- /// (or array thereof), each such class has a trivial constructor.
- bool HasTrivialConstructor : 1;
+ /// C++0x [class.ctor]p5
+ /// A default constructor is trivial if it is not user-provided and if
+ /// -- its class has no virtual functions and no virtual base classes,
+ /// and
+ /// -- no non-static data member of its class has a
+ /// brace-or-equal-initializer, and
+ /// -- all the direct base classes of its class have trivial
+ /// default constructors, and
+ /// -- for all the nonstatic data members of its class that are of class
+ /// type (or array thereof), each such class has a trivial
+ /// default constructor.
+ bool HasTrivialDefaultConstructor : 1;
/// HasConstExprNonCopyMoveConstructor - True when this class has at least
/// one constexpr constructor which is neither the copy nor move
@@ -357,7 +374,7 @@ class CXXRecordDecl : public RecordDecl {
///
/// C++0x [class.copy]p13:
/// A copy/move constructor for class X is trivial if it is neither
- /// user-provided nor deleted and if
+ /// user-provided and if
/// -- class X has no virtual functions and no virtual base classes, and
/// -- the constructor selected to copy/move each direct base class
/// subobject is trivial, and
@@ -372,7 +389,7 @@ class CXXRecordDecl : public RecordDecl {
///
/// C++0x [class.copy]p13:
/// A copy/move constructor for class X is trivial if it is neither
- /// user-provided nor deleted and if
+ /// user-provided and if
/// -- class X has no virtual functions and no virtual base classes, and
/// -- the constructor selected to copy/move each direct base class
/// subobject is trivial, and
@@ -430,15 +447,24 @@ class CXXRecordDecl : public RecordDecl {
/// already computed and are available.
bool ComputedVisibleConversions : 1;
- /// \brief Whether we have already declared the default constructor or
- /// do not need to have one declared.
+ /// \brief Whether we have a C++0x user-provided default constructor (not
+ /// explicitly deleted or defaulted).
+ bool UserProvidedDefaultConstructor : 1;
+
+ /// \brief Whether we have already declared the default constructor.
bool DeclaredDefaultConstructor : 1;
/// \brief Whether we have already declared the copy constructor.
bool DeclaredCopyConstructor : 1;
+
+ /// \brief Whether we have already declared the move constructor.
+ bool DeclaredMoveConstructor : 1;
/// \brief Whether we have already declared the copy-assignment operator.
bool DeclaredCopyAssignment : 1;
+
+ /// \brief Whether we have already declared the move-assignment operator.
+ bool DeclaredMoveAssignment : 1;
/// \brief Whether we have already declared a destructor within the class.
bool DeclaredDestructor : 1;
@@ -666,21 +692,30 @@ public:
return data().FirstFriend != 0;
}
- /// \brief Determine whether this class has had its default constructor
- /// declared implicitly or does not need one declared implicitly.
+ /// \brief Determine if we need to declare a default constructor for
+ /// this class.
///
/// This value is used for lazy creation of default constructors.
+ bool needsImplicitDefaultConstructor() const {
+ return !data().UserDeclaredConstructor &&
+ !data().DeclaredDefaultConstructor;
+ }
+
+ /// hasDeclaredDefaultConstructor - Whether this class's default constructor
+ /// has been declared (either explicitly or implicitly).
bool hasDeclaredDefaultConstructor() const {
return data().DeclaredDefaultConstructor;
}
-
+
/// hasConstCopyConstructor - Determines whether this class has a
/// copy constructor that accepts a const-qualified argument.
- bool hasConstCopyConstructor(const ASTContext &Context) const;
+ bool hasConstCopyConstructor() const;
/// getCopyConstructor - Returns the copy constructor for this class
- CXXConstructorDecl *getCopyConstructor(const ASTContext &Context,
- unsigned TypeQuals) const;
+ CXXConstructorDecl *getCopyConstructor(unsigned TypeQuals) const;
+
+ /// getMoveConstructor - Returns the move constructor for this class
+ CXXConstructorDecl *getMoveConstructor() const;
/// \brief Retrieve the copy-assignment operator for this class, if available.
///
@@ -693,6 +728,10 @@ public:
/// \returns The copy-assignment operator that can be invoked, or NULL if
/// a unique copy-assignment operator could not be found.
CXXMethodDecl *getCopyAssignmentOperator(bool ArgIsConst) const;
+
+ /// getMoveAssignmentOperator - Returns the move assignment operator for this
+ /// class
+ CXXMethodDecl *getMoveAssignmentOperator() const;
/// hasUserDeclaredConstructor - Whether this class has any
/// user-declared constructors. When true, a default constructor
@@ -701,6 +740,12 @@ public:
return data().UserDeclaredConstructor;
}
+ /// hasUserProvidedDefaultconstructor - Whether this class has a
+ /// user-provided default constructor per C++0x.
+ bool hasUserProvidedDefaultConstructor() const {
+ return data().UserProvidedDefaultConstructor;
+ }
+
/// hasUserDeclaredCopyConstructor - Whether this class has a
/// user-declared copy constructor. When false, a copy constructor
/// will be implicitly declared.
@@ -715,7 +760,27 @@ public:
bool hasDeclaredCopyConstructor() const {
return data().DeclaredCopyConstructor;
}
-
+
+ /// hasUserDeclaredMoveOperation - Whether this class has a user-
+ /// declared move constructor or assignment operator. When false, a
+ /// move constructor and assignment operator may be implicitly declared.
+ bool hasUserDeclaredMoveOperation() const {
+ return data().UserDeclaredMoveConstructor ||
+ data().UserDeclaredMoveAssignment;
+ }
+
+ /// \brief Determine whether this class has had a move constructor
+ /// declared by the user.
+ bool hasUserDeclaredMoveConstructor() const {
+ return data().UserDeclaredMoveConstructor;
+ }
+
+ /// \brief Determine whether this class has had a move constructor
+ /// declared.
+ bool hasDeclaredMoveConstructor() const {
+ return data().DeclaredMoveConstructor;
+ }
+
/// hasUserDeclaredCopyAssignment - Whether this class has a
/// user-declared copy assignment operator. When false, a copy
/// assigment operator will be implicitly declared.
@@ -730,7 +795,19 @@ public:
bool hasDeclaredCopyAssignment() const {
return data().DeclaredCopyAssignment;
}
-
+
+ /// \brief Determine whether this class has had a move assignment
+ /// declared by the user.
+ bool hasUserDeclaredMoveAssignment() const {
+ return data().UserDeclaredMoveAssignment;
+ }
+
+ /// hasDeclaredMoveAssignment - Whether this class has a
+ /// declared move assignment operator.
+ bool hasDeclaredMoveAssignment() const {
+ return data().DeclaredMoveAssignment;
+ }
+
/// hasUserDeclaredDestructor - Whether this class has a
/// user-declared destructor. When false, a destructor will be
/// implicitly declared.
@@ -800,9 +877,18 @@ public:
/// (C++ [class]p7)
bool isStandardLayout() const { return data().IsStandardLayout; }
- // hasTrivialConstructor - Whether this class has a trivial constructor
- // (C++ [class.ctor]p5)
- bool hasTrivialConstructor() const { return data().HasTrivialConstructor; }
+ /// \brief Whether this class, or any of its class subobjects, contains a
+ /// mutable field.
+ bool hasMutableFields() const { return data().HasMutableFields; }
+
+ // hasTrivialDefaultConstructor - Whether this class has a trivial default
+ // constructor
+ // (C++0x [class.ctor]p5)
+ bool hasTrivialDefaultConstructor() const {
+ return data().HasTrivialDefaultConstructor &&
+ (!data().UserDeclaredConstructor ||
+ data().DeclaredDefaultConstructor);
+ }
// hasConstExprNonCopyMoveConstructor - Whether this class has at least one
// constexpr constructor other than the copy or move constructors
@@ -845,9 +931,18 @@ public:
}
// isTriviallyCopyable - Whether this class is considered trivially copyable
- // (C++0x [class]p5).
+ // (C++0x [class]p6).
bool isTriviallyCopyable() const;
+ // isTrivial - Whether this class is considered trivial
+ //
+ // C++0x [class]p6
+ // A trivial class is a class that has a trivial default constructor and
+ // is trivially copiable.
+ bool isTrivial() const {
+ return isTriviallyCopyable() && hasTrivialDefaultConstructor();
+ }
+
/// \brief If this record is an instantiation of a member class,
/// retrieves the member class from which it was instantiated.
///
@@ -1182,6 +1277,9 @@ public:
/// \brief Determine whether this is a copy-assignment operator, regardless
/// of whether it was declared implicitly or explicitly.
bool isCopyAssignmentOperator() const;
+
+ /// \brief Determine whether this is a move assignment operator.
+ bool isMoveAssignmentOperator() const;
const CXXMethodDecl *getCanonicalDecl() const {
return cast<CXXMethodDecl>(FunctionDecl::getCanonicalDecl());
@@ -1189,6 +1287,12 @@ public:
CXXMethodDecl *getCanonicalDecl() {
return cast<CXXMethodDecl>(FunctionDecl::getCanonicalDecl());
}
+
+ /// isUserProvided - True if it is either an implicit constructor or
+ /// if it was defaulted or deleted on first declaration.
+ bool isUserProvided() const {
+ return !(isDeleted() || getCanonicalDecl()->isDefaulted());
+ }
///
void addOverriddenMethod(const CXXMethodDecl *MD);
@@ -1274,6 +1378,8 @@ class CXXCtorInitializer {
/// \brief The argument used to initialize the base or member, which may
/// end up constructing an object (when multiple arguments are involved).
+ /// If 0, this is a field initializer, and the in-class member initializer
+ /// will be used.
Stmt *Init;
/// LParenLoc - Location of the left paren of the ctor-initializer.
@@ -1348,6 +1454,13 @@ public:
return Initializee.is<IndirectFieldDecl*>();
}
+ /// isInClassMemberInitializer - Returns true when this initializer is an
+ /// implicit ctor initializer generated for a field with an initializer
+ /// defined on the member declaration.
+ bool isInClassMemberInitializer() const {
+ return !Init;
+ }
+
/// isDelegatingInitializer - Returns true when this initializer is creating
/// a delegating constructor.
bool isDelegatingInitializer() const {
@@ -1476,7 +1589,14 @@ public:
reinterpret_cast<VarDecl **>(this + 1)[I] = Index;
}
- Expr *getInit() const { return static_cast<Expr *>(Init); }
+ /// \brief Get the initializer. This is 0 if this is an in-class initializer
+ /// for a non-static data member which has not yet been parsed.
+ Expr *getInit() const {
+ if (!Init)
+ return getAnyMember()->getInClassInitializer();
+
+ return static_cast<Expr*>(Init);
+ }
};
/// CXXConstructorDecl - Represents a C++ constructor within a
@@ -1619,10 +1739,9 @@ public:
/// getTargetConstructor - When this constructor delegates to
/// another, retrieve the target
CXXConstructorDecl *getTargetConstructor() const {
- if (isDelegatingConstructor())
- return CtorInitializers[0]->getTargetConstructor();
- else
- return 0;
+ assert(isDelegatingConstructor() &&
+ "A non-delegating constructor has no target");
+ return CtorInitializers[0]->getTargetConstructor();
}
/// isDefaultConstructor - Whether this constructor is a default
@@ -1693,6 +1812,13 @@ public:
/// \brief Set the constructor that this inheriting constructor is based on.
void setInheritedConstructor(const CXXConstructorDecl *BaseCtor);
+
+ const CXXConstructorDecl *getCanonicalDecl() const {
+ return cast<CXXConstructorDecl>(FunctionDecl::getCanonicalDecl());
+ }
+ CXXConstructorDecl *getCanonicalDecl() {
+ return cast<CXXConstructorDecl>(FunctionDecl::getCanonicalDecl());
+ }
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h b/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h
index 0a4d864..74ceb43 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h
@@ -135,6 +135,9 @@ private:
/// in, inout, etc.
unsigned objcDeclQualifier : 6;
+ /// \brief Indicates whether this method has a related result type.
+ unsigned RelatedResultType : 1;
+
// Number of args separated by ':' in a method declaration.
unsigned NumSelectorArgs;
@@ -171,6 +174,7 @@ private:
bool isSynthesized = false,
bool isDefined = false,
ImplementationControl impControl = None,
+ bool HasRelatedResultType = false,
unsigned numSelectorArgs = 0)
: NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo),
DeclContext(ObjCMethod), Family(InvalidObjCMethodFamily),
@@ -178,8 +182,8 @@ private:
IsSynthesized(isSynthesized),
IsDefined(isDefined),
DeclImplementation(impControl), objcDeclQualifier(OBJC_TQ_None),
- NumSelectorArgs(numSelectorArgs), MethodDeclType(T),
- ResultTInfo(ResultTInfo),
+ RelatedResultType(HasRelatedResultType), NumSelectorArgs(numSelectorArgs),
+ MethodDeclType(T), ResultTInfo(ResultTInfo),
EndLoc(endLoc), Body(0), SelfDecl(0), CmdDecl(0) {}
/// \brief A definition will return its interface declaration.
@@ -199,6 +203,7 @@ public:
bool isSynthesized = false,
bool isDefined = false,
ImplementationControl impControl = None,
+ bool HasRelatedResultType = false,
unsigned numSelectorArgs = 0);
virtual ObjCMethodDecl *getCanonicalDecl();
@@ -211,6 +216,13 @@ public:
}
void setObjCDeclQualifier(ObjCDeclQualifier QV) { objcDeclQualifier = QV; }
+ /// \brief Determine whether this method has a result type that is related
+ /// to the message receiver's type.
+ bool hasRelatedResultType() const { return RelatedResultType; }
+
+ /// \brief Note whether this method has a related result type.
+ void SetRelatedResultType(bool RRT = true) { RelatedResultType = RRT; }
+
unsigned getNumSelectorArgs() const { return NumSelectorArgs; }
void setNumSelectorArgs(unsigned numSelectorArgs) {
NumSelectorArgs = numSelectorArgs;
@@ -712,7 +724,7 @@ private:
QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW,
bool synthesized)
: FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
- /*Mutable=*/false),
+ /*Mutable=*/false, /*HasInit=*/false),
NextIvar(0), DeclAccess(ac), Synthesized(synthesized) {}
public:
@@ -767,7 +779,7 @@ private:
QualType T, Expr *BW)
: FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
/*TInfo=*/0, // FIXME: Do ObjCAtDefs have declarators ?
- BW, /*Mutable=*/false) {}
+ BW, /*Mutable=*/false, /*HasInit=*/false) {}
public:
static ObjCAtDefsFieldDecl *Create(ASTContext &C, DeclContext *DC,
diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h b/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h
index ddbe344..dc50d61 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h
@@ -30,6 +30,7 @@ class ClassTemplatePartialSpecializationDecl;
class TemplateTypeParmDecl;
class NonTypeTemplateParmDecl;
class TemplateTemplateParmDecl;
+class TypeAliasTemplateDecl;
/// \brief Stores a template parameter of any kind.
typedef llvm::PointerUnion3<TemplateTypeParmDecl*, NonTypeTemplateParmDecl*,
@@ -230,6 +231,7 @@ public:
static bool classof(const FunctionTemplateDecl *D) { return true; }
static bool classof(const ClassTemplateDecl *D) { return true; }
static bool classof(const TemplateTemplateParmDecl *D) { return true; }
+ static bool classof(const TypeAliasTemplateDecl *D) { return true; }
static bool classofKind(Kind K) {
return K >= firstTemplate && K <= lastTemplate;
}
@@ -672,6 +674,7 @@ public:
static bool classof(const RedeclarableTemplateDecl *D) { return true; }
static bool classof(const FunctionTemplateDecl *D) { return true; }
static bool classof(const ClassTemplateDecl *D) { return true; }
+ static bool classof(const TypeAliasTemplateDecl *D) { return true; }
static bool classofKind(Kind K) {
return K >= firstRedeclarableTemplate && K <= lastRedeclarableTemplate;
}
@@ -2014,6 +2017,78 @@ public:
friend class ASTDeclReader;
};
+/// Declaration of an alias template. For example:
+///
+/// template <typename T> using V = std::map<T*, int, MyCompare<T>>;
+class TypeAliasTemplateDecl : public RedeclarableTemplateDecl,
+ public RedeclarableTemplate<TypeAliasTemplateDecl> {
+ static void DeallocateCommon(void *Ptr);
+
+protected:
+ typedef RedeclarableTemplate<TypeAliasTemplateDecl> redeclarable_base;
+
+ typedef CommonBase Common;
+
+ TypeAliasTemplateDecl(DeclContext *DC, SourceLocation L, DeclarationName Name,
+ TemplateParameterList *Params, NamedDecl *Decl)
+ : RedeclarableTemplateDecl(TypeAliasTemplate, DC, L, Name, Params, Decl) { }
+
+ CommonBase *newCommon(ASTContext &C);
+
+ Common *getCommonPtr() {
+ return static_cast<Common *>(RedeclarableTemplateDecl::getCommonPtr());
+ }
+
+public:
+ /// Get the underlying function declaration of the template.
+ TypeAliasDecl *getTemplatedDecl() const {
+ return static_cast<TypeAliasDecl*>(TemplatedDecl);
+ }
+
+
+ TypeAliasTemplateDecl *getCanonicalDecl() {
+ return redeclarable_base::getCanonicalDecl();
+ }
+ const TypeAliasTemplateDecl *getCanonicalDecl() const {
+ return redeclarable_base::getCanonicalDecl();
+ }
+
+ /// \brief Retrieve the previous declaration of this function template, or
+ /// NULL if no such declaration exists.
+ TypeAliasTemplateDecl *getPreviousDeclaration() {
+ return redeclarable_base::getPreviousDeclaration();
+ }
+
+ /// \brief Retrieve the previous declaration of this function template, or
+ /// NULL if no such declaration exists.
+ const TypeAliasTemplateDecl *getPreviousDeclaration() const {
+ return redeclarable_base::getPreviousDeclaration();
+ }
+
+ TypeAliasTemplateDecl *getInstantiatedFromMemberTemplate() {
+ return redeclarable_base::getInstantiatedFromMemberTemplate();
+ }
+
+
+ /// \brief Create a function template node.
+ static TypeAliasTemplateDecl *Create(ASTContext &C, DeclContext *DC,
+ SourceLocation L,
+ DeclarationName Name,
+ TemplateParameterList *Params,
+ NamedDecl *Decl);
+
+ /// \brief Create an empty alias template node.
+ static TypeAliasTemplateDecl *Create(ASTContext &C, EmptyShell);
+
+ // Implement isa/cast/dyncast support
+ static bool classof(const Decl *D) { return classofKind(D->getKind()); }
+ static bool classof(const TypeAliasTemplateDecl *D) { return true; }
+ static bool classofKind(Kind K) { return K == TypeAliasTemplate; }
+
+ friend class ASTDeclReader;
+ friend class ASTDeclWriter;
+};
+
/// Implementation of inline functions that require the template declarations
inline AnyFunctionDecl::AnyFunctionDecl(FunctionTemplateDecl *FTD)
: Function(FTD) { }
diff --git a/contrib/llvm/tools/clang/include/clang/AST/Expr.h b/contrib/llvm/tools/clang/include/clang/AST/Expr.h
index 5f2d144..ce86458e 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/Expr.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/Expr.h
@@ -515,6 +515,14 @@ public:
/// ParenExpr or ImplicitCastExprs, returning their operand.
Expr *IgnoreParenImpCasts();
+ /// IgnoreConversionOperator - Ignore conversion operator. If this Expr is a
+ /// call to a conversion operator, return the argument.
+ Expr *IgnoreConversionOperator();
+
+ const Expr *IgnoreConversionOperator() const {
+ return const_cast<Expr*>(this)->IgnoreConversionOperator();
+ }
+
const Expr *IgnoreParenImpCasts() const {
return const_cast<Expr*>(this)->IgnoreParenImpCasts();
}
@@ -1018,13 +1026,18 @@ public:
false),
Loc(l) {
assert(type->isIntegerType() && "Illegal type in IntegerLiteral");
+ assert(V.getBitWidth() == C.getIntWidth(type) &&
+ "Integer type is not the correct size for constant.");
setValue(C, V);
}
- // type should be IntTy, LongTy, LongLongTy, UnsignedIntTy, UnsignedLongTy,
- // or UnsignedLongLongTy
+ /// \brief Returns a new integer literal with value 'V' and type 'type'.
+ /// \param type - either IntTy, LongTy, LongLongTy, UnsignedIntTy,
+ /// UnsignedLongTy, or UnsignedLongLongTy which should match the size of V
+ /// \param V - the value that the returned integer literal contains.
static IntegerLiteral *Create(ASTContext &C, const llvm::APInt &V,
QualType type, SourceLocation l);
+ /// \brief Returns a new empty integer literal.
static IntegerLiteral *Create(ASTContext &C, EmptyShell Empty);
llvm::APInt getValue() const { return Num.getValue(); }
@@ -1555,9 +1568,9 @@ public:
TSInfo = tsi;
}
- const OffsetOfNode &getComponent(unsigned Idx) {
+ const OffsetOfNode &getComponent(unsigned Idx) const {
assert(Idx < NumComps && "Subscript out of range");
- return reinterpret_cast<OffsetOfNode *> (this + 1)[Idx];
+ return reinterpret_cast<const OffsetOfNode *> (this + 1)[Idx];
}
void setComponent(unsigned Idx, OffsetOfNode ON) {
@@ -1574,6 +1587,9 @@ public:
return reinterpret_cast<Expr **>(
reinterpret_cast<OffsetOfNode *>(this+1) + NumComps)[Idx];
}
+ const Expr *getIndexExpr(unsigned Idx) const {
+ return const_cast<OffsetOfExpr*>(this)->getIndexExpr(Idx);
+ }
void setIndexExpr(unsigned Idx, Expr* E) {
assert(Idx < NumComps && "Subscript out of range");
@@ -3299,6 +3315,9 @@ public:
Expr *getArrayFiller() {
return ArrayFillerOrUnionFieldInit.dyn_cast<Expr *>();
}
+ const Expr *getArrayFiller() const {
+ return const_cast<InitListExpr *>(this)->getArrayFiller();
+ }
void setArrayFiller(Expr *filler);
/// \brief If this initializes a union, specifies which field in the
@@ -3310,6 +3329,9 @@ public:
FieldDecl *getInitializedFieldInUnion() {
return ArrayFillerOrUnionFieldInit.dyn_cast<FieldDecl *>();
}
+ const FieldDecl *getInitializedFieldInUnion() const {
+ return const_cast<InitListExpr *>(this)->getInitializedFieldInUnion();
+ }
void setInitializedFieldInUnion(FieldDecl *FD) {
ArrayFillerOrUnionFieldInit = FD;
}
@@ -4012,6 +4034,42 @@ public:
child_range children() { return child_range(); }
};
+/// AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2]
+/// This AST node provides support for reinterpreting a type to another
+/// type of the same size.
+class AsTypeExpr : public Expr {
+private:
+ Expr* SrcExpr;
+ QualType DstType;
+ SourceLocation BuiltinLoc, RParenLoc;
+
+public:
+ AsTypeExpr(Expr* SrcExpr, QualType DstType,
+ ExprValueKind VK, ExprObjectKind OK,
+ SourceLocation BuiltinLoc, SourceLocation RParenLoc)
+ : Expr(AsTypeExprClass, DstType, VK, OK, false, false, false),
+ SrcExpr(SrcExpr), DstType(DstType),
+ BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
+
+ /// \brief Build an empty __builtin_astype
+ explicit AsTypeExpr(EmptyShell Empty) : Expr(AsTypeExprClass, Empty) {}
+
+ /// getSrcExpr - Return the Expr to be converted.
+ Expr *getSrcExpr() const { return SrcExpr; }
+ QualType getDstType() const { return DstType; }
+
+ SourceRange getSourceRange() const {
+ return SourceRange(BuiltinLoc, RParenLoc);
+ }
+
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == AsTypeExprClass;
+ }
+ static bool classof(const AsTypeExpr *) { return true; }
+
+ // Iterators
+ child_range children() { return child_range(); }
+};
} // end namespace clang
#endif
diff --git a/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h b/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h
index 6db2336..846813a 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h
@@ -211,7 +211,7 @@ public:
return sizes;
}
- virtual void getMemoryBufferSizes(MemoryBufferSizes &sizes) const = 0;
+ virtual void getMemoryBufferSizes(MemoryBufferSizes &sizes) const;
protected:
static DeclContextLookupResult
diff --git a/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h b/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h
index 930d193..a8f182a 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h
@@ -750,6 +750,11 @@ DEF_TRAVERSE_TYPE(DecltypeType, {
TRY_TO(TraverseStmt(T->getUnderlyingExpr()));
})
+DEF_TRAVERSE_TYPE(UnaryTransformType, {
+ TRY_TO(TraverseType(T->getBaseType()));
+ TRY_TO(TraverseType(T->getUnderlyingType()));
+ })
+
DEF_TRAVERSE_TYPE(AutoType, {
TRY_TO(TraverseType(T->getDeducedType()));
})
@@ -966,6 +971,10 @@ DEF_TRAVERSE_TYPELOC(DecltypeType, {
TRY_TO(TraverseStmt(TL.getTypePtr()->getUnderlyingExpr()));
})
+DEF_TRAVERSE_TYPELOC(UnaryTransformType, {
+ TRY_TO(TraverseTypeLoc(TL.getUnderlyingTInfo()->getTypeLoc()));
+ })
+
DEF_TRAVERSE_TYPELOC(AutoType, {
TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType()));
})
@@ -1368,6 +1377,11 @@ DEF_TRAVERSE_DECL(TypeAliasDecl, {
// source.
})
+DEF_TRAVERSE_DECL(TypeAliasTemplateDecl, {
+ TRY_TO(TraverseDecl(D->getTemplatedDecl()));
+ TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));
+ })
+
DEF_TRAVERSE_DECL(UnresolvedUsingTypenameDecl, {
// A dependent using declaration which was marked with 'typename'.
// template<class T> class A : public B<T> { using typename B<T>::foo; };
@@ -1967,6 +1981,9 @@ DEF_TRAVERSE_STMT(FloatingLiteral, { })
DEF_TRAVERSE_STMT(ImaginaryLiteral, { })
DEF_TRAVERSE_STMT(StringLiteral, { })
DEF_TRAVERSE_STMT(ObjCStringLiteral, { })
+
+// Traverse OpenCL: AsType, Convert.
+DEF_TRAVERSE_STMT(AsTypeExpr, { })
// FIXME: look at the following tricky-seeming exprs to see if we
// need to recurse on anything. These are ones that have methods
diff --git a/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h b/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h
index b8c141d..29d2347 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file defines the StmtVisitor interface.
+// This file defines the StmtVisitor and ConstStmtVisitor interfaces.
//
//===----------------------------------------------------------------------===//
@@ -21,20 +21,26 @@
namespace clang {
-#define DISPATCH(NAME, CLASS) \
- return static_cast<ImplClass*>(this)->Visit ## NAME(static_cast<CLASS*>(S))
+template <typename T> struct make_ptr { typedef T *type; };
+template <typename T> struct make_const_ptr { typedef const T *type; };
-/// StmtVisitor - This class implements a simple visitor for Stmt subclasses.
-/// Since Expr derives from Stmt, this also includes support for visiting Exprs.
-template<typename ImplClass, typename RetTy=void>
-class StmtVisitor {
+/// StmtVisitorBase - This class implements a simple visitor for Stmt
+/// subclasses. Since Expr derives from Stmt, this also includes support for
+/// visiting Exprs.
+template<template <typename> class Ptr, typename ImplClass, typename RetTy=void>
+class StmtVisitorBase {
public:
- RetTy Visit(Stmt *S) {
+
+#define PTR(CLASS) typename Ptr<CLASS>::type
+#define DISPATCH(NAME, CLASS) \
+ return static_cast<ImplClass*>(this)->Visit ## NAME(static_cast<PTR(CLASS)>(S))
+
+ RetTy Visit(PTR(Stmt) S) {
// If we have a binary expr, dispatch to the subcode of the binop. A smart
// optimizer (e.g. LLVM) will fold this comparison into the switch stmt
// below.
- if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(S)) {
+ if (PTR(BinaryOperator) BinOp = dyn_cast<BinaryOperator>(S)) {
switch (BinOp->getOpcode()) {
default: assert(0 && "Unknown binary operator!");
case BO_PtrMemD: DISPATCH(BinPtrMemD, BinaryOperator);
@@ -72,7 +78,7 @@ public:
case BO_XorAssign: DISPATCH(BinXorAssign, CompoundAssignOperator);
case BO_Comma: DISPATCH(BinComma, BinaryOperator);
}
- } else if (UnaryOperator *UnOp = dyn_cast<UnaryOperator>(S)) {
+ } else if (PTR(UnaryOperator) UnOp = dyn_cast<UnaryOperator>(S)) {
switch (UnOp->getOpcode()) {
default: assert(0 && "Unknown unary operator!");
case UO_PostInc: DISPATCH(UnaryPostInc, UnaryOperator);
@@ -104,13 +110,13 @@ public:
// If the implementation chooses not to implement a certain visit method, fall
// back on VisitExpr or whatever else is the superclass.
#define STMT(CLASS, PARENT) \
- RetTy Visit ## CLASS(CLASS *S) { DISPATCH(PARENT, PARENT); }
+ RetTy Visit ## CLASS(PTR(CLASS) S) { DISPATCH(PARENT, PARENT); }
#include "clang/AST/StmtNodes.inc"
// If the implementation doesn't implement binary operator methods, fall back
// on VisitBinaryOperator.
#define BINOP_FALLBACK(NAME) \
- RetTy VisitBin ## NAME(BinaryOperator *S) { \
+ RetTy VisitBin ## NAME(PTR(BinaryOperator) S) { \
DISPATCH(BinaryOperator, BinaryOperator); \
}
BINOP_FALLBACK(PtrMemD) BINOP_FALLBACK(PtrMemI)
@@ -130,7 +136,7 @@ public:
// If the implementation doesn't implement compound assignment operator
// methods, fall back on VisitCompoundAssignOperator.
#define CAO_FALLBACK(NAME) \
- RetTy VisitBin ## NAME(CompoundAssignOperator *S) { \
+ RetTy VisitBin ## NAME(PTR(CompoundAssignOperator) S) { \
DISPATCH(CompoundAssignOperator, CompoundAssignOperator); \
}
CAO_FALLBACK(MulAssign) CAO_FALLBACK(DivAssign) CAO_FALLBACK(RemAssign)
@@ -142,7 +148,7 @@ public:
// If the implementation doesn't implement unary operator methods, fall back
// on VisitUnaryOperator.
#define UNARYOP_FALLBACK(NAME) \
- RetTy VisitUnary ## NAME(UnaryOperator *S) { \
+ RetTy VisitUnary ## NAME(PTR(UnaryOperator) S) { \
DISPATCH(UnaryOperator, UnaryOperator); \
}
UNARYOP_FALLBACK(PostInc) UNARYOP_FALLBACK(PostDec)
@@ -156,10 +162,29 @@ public:
#undef UNARYOP_FALLBACK
// Base case, ignore it. :)
- RetTy VisitStmt(Stmt *Node) { return RetTy(); }
-};
+ RetTy VisitStmt(PTR(Stmt) Node) { return RetTy(); }
+#undef PTR
#undef DISPATCH
+};
+
+/// StmtVisitor - This class implements a simple visitor for Stmt subclasses.
+/// Since Expr derives from Stmt, this also includes support for visiting Exprs.
+///
+/// This class does not preserve constness of Stmt pointers (see also
+/// ConstStmtVisitor).
+template<typename ImplClass, typename RetTy=void>
+class StmtVisitor
+ : public StmtVisitorBase<make_ptr, ImplClass, RetTy> {};
+
+/// ConstStmtVisitor - This class implements a simple visitor for Stmt
+/// subclasses. Since Expr derives from Stmt, this also includes support for
+/// visiting Exprs.
+///
+/// This class preserves constness of Stmt pointers (see also StmtVisitor).
+template<typename ImplClass, typename RetTy=void>
+class ConstStmtVisitor
+ : public StmtVisitorBase<make_const_ptr, ImplClass, RetTy> {};
} // end namespace clang
diff --git a/contrib/llvm/tools/clang/include/clang/AST/Type.h b/contrib/llvm/tools/clang/include/clang/AST/Type.h
index 975a66f..7763383 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/Type.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/Type.h
@@ -294,9 +294,15 @@ public:
/// Generally this answers the question of whether an object with the other
/// qualifiers can be safely used as an object with these qualifiers.
bool compatiblyIncludes(Qualifiers other) const {
- // Non-CVR qualifiers must match exactly. CVR qualifiers may subset.
- return ((Mask & ~CVRMask) == (other.Mask & ~CVRMask)) &&
- (((Mask & CVRMask) | (other.Mask & CVRMask)) == (Mask & CVRMask));
+ return
+ // Address spaces must match exactly.
+ getAddressSpace() == other.getAddressSpace() &&
+ // ObjC GC qualifiers can match, be added, or be removed, but can't be
+ // changed.
+ (getObjCGCAttr() == other.getObjCGCAttr() ||
+ !hasObjCGCAttr() || !other.hasObjCGCAttr()) &&
+ // CVR qualifiers may subset.
+ (((Mask & CVRMask) | (other.Mask & CVRMask)) == (Mask & CVRMask));
}
/// \brief Determine whether this set of qualifiers is a strict superset of
@@ -532,6 +538,14 @@ public:
return withFastQualifiers(Qualifiers::Const);
}
+ /// addVolatile - add the specified type qualifier to this QualType.
+ void addVolatile() {
+ addFastQualifiers(Qualifiers::Volatile);
+ }
+ QualType withVolatile() const {
+ return withFastQualifiers(Qualifiers::Volatile);
+ }
+
void addFastQualifiers(unsigned TQs) {
assert(!(TQs & ~Qualifiers::FastMask)
&& "non-fast qualifier bits set in mask!");
@@ -1183,6 +1197,10 @@ public:
/// (C++0x [basic.types]p9)
bool isTrivialType() const;
+ /// isTriviallyCopyableType - Return true if this is a trivially copyable type
+ /// (C++0x [basic.types]p9
+ bool isTriviallyCopyableType() const;
+
/// \brief Test if this type is a standard-layout type.
/// (C++0x [basic.type]p9)
bool isStandardLayoutType() const;
@@ -1418,16 +1436,22 @@ public:
/// isSignedIntegerType - Return true if this is an integer type that is
/// signed, according to C99 6.2.5p4 [char, signed char, short, int, long..],
- /// an enum decl which has a signed representation, or a vector of signed
- /// integer element type.
+ /// or an enum decl which has a signed representation.
bool isSignedIntegerType() const;
/// isUnsignedIntegerType - Return true if this is an integer type that is
- /// unsigned, according to C99 6.2.5p6 [which returns true for _Bool], an enum
- /// decl which has an unsigned representation, or a vector of unsigned integer
- /// element type.
+ /// unsigned, according to C99 6.2.5p6 [which returns true for _Bool],
+ /// or an enum decl which has an unsigned representation.
bool isUnsignedIntegerType() const;
+ /// Determines whether this is an integer type that is signed or an
+ /// enumeration types whose underlying type is a signed integer type.
+ bool isSignedIntegerOrEnumerationType() const;
+
+ /// Determines whether this is an integer type that is unsigned or an
+ /// enumeration types whose underlying type is a unsigned integer type.
+ bool isUnsignedIntegerOrEnumerationType() const;
+
/// isConstantSizeType - Return true if this is not a variable sized type,
/// according to the rules of C99 6.7.5p3. It is not legal to call this on
/// incomplete types.
@@ -2580,6 +2604,7 @@ public:
}
bool isNothrow(ASTContext &Ctx) const {
ExceptionSpecificationType EST = getExceptionSpecType();
+ assert(EST != EST_Delayed);
if (EST == EST_DynamicNone || EST == EST_BasicNoexcept)
return true;
if (EST != EST_ComputedNoexcept)
@@ -2809,6 +2834,39 @@ public:
Expr *E);
};
+/// \brief A unary type transform, which is a type constructed from another
+class UnaryTransformType : public Type {
+public:
+ enum UTTKind {
+ EnumUnderlyingType
+ };
+
+private:
+ /// The untransformed type.
+ QualType BaseType;
+ /// The transformed type if not dependent, otherwise the same as BaseType.
+ QualType UnderlyingType;
+
+ UTTKind UKind;
+protected:
+ UnaryTransformType(QualType BaseTy, QualType UnderlyingTy, UTTKind UKind,
+ QualType CanonicalTy);
+ friend class ASTContext;
+public:
+ bool isSugared() const { return !isDependentType(); }
+ QualType desugar() const { return UnderlyingType; }
+
+ QualType getUnderlyingType() const { return UnderlyingType; }
+ QualType getBaseType() const { return BaseType; }
+
+ UTTKind getUTTKind() const { return UKind; }
+
+ static bool classof(const Type *T) {
+ return T->getTypeClass() == UnaryTransform;
+ }
+ static bool classof(const UnaryTransformType *) { return true; }
+};
+
class TagType : public Type {
/// Stores the TagDecl associated with this type. The decl may point to any
/// TagDecl that declares the entity.
@@ -3201,6 +3259,10 @@ public:
/// Other template specialization types, for which the template name
/// is dependent, may be canonical types. These types are always
/// dependent.
+///
+/// An instance of this type is followed by an array of TemplateArgument*s,
+/// then, if the template specialization type is for a type alias template,
+/// a QualType representing the non-canonical aliased type.
class TemplateSpecializationType
: public Type, public llvm::FoldingSetNode {
/// \brief The name of the template being specialized.
@@ -3212,7 +3274,8 @@ class TemplateSpecializationType
TemplateSpecializationType(TemplateName T,
const TemplateArgument *Args,
- unsigned NumArgs, QualType Canon);
+ unsigned NumArgs, QualType Canon,
+ QualType Aliased);
friend class ASTContext; // ASTContext creates these
@@ -3247,6 +3310,16 @@ public:
return isa<InjectedClassNameType>(getCanonicalTypeInternal());
}
+ /// True if this template specialization type is for a type alias
+ /// template.
+ bool isTypeAlias() const;
+ /// Get the aliased type, if this is a specialization of a type alias
+ /// template.
+ QualType getAliasedType() const {
+ assert(isTypeAlias() && "not a type alias template specialization");
+ return *reinterpret_cast<const QualType*>(end());
+ }
+
typedef const TemplateArgument * iterator;
iterator begin() const { return getArgs(); }
@@ -3268,12 +3341,14 @@ public:
const TemplateArgument &getArg(unsigned Idx) const; // in TemplateBase.h
bool isSugared() const {
- return !isDependentType() || isCurrentInstantiation();
+ return !isDependentType() || isCurrentInstantiation() || isTypeAlias();
}
QualType desugar() const { return getCanonicalTypeInternal(); }
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx) {
Profile(ID, Template, getArgs(), NumArgs, Ctx);
+ if (isTypeAlias())
+ getAliasedType().Profile(ID);
}
static void Profile(llvm::FoldingSetNodeID &ID, TemplateName T,
diff --git a/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h b/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h
index a1df744..f5669f7 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h
+++ b/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h
@@ -1410,6 +1410,53 @@ class DecltypeTypeLoc : public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
DecltypeType> {
};
+struct UnaryTransformTypeLocInfo {
+ // FIXME: While there's only one unary transform right now, future ones may
+ // need different representations
+ SourceLocation KWLoc, LParenLoc, RParenLoc;
+ TypeSourceInfo *UnderlyingTInfo;
+};
+
+class UnaryTransformTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
+ UnaryTransformTypeLoc,
+ UnaryTransformType,
+ UnaryTransformTypeLocInfo> {
+public:
+ SourceLocation getKWLoc() const { return getLocalData()->KWLoc; }
+ void setKWLoc(SourceLocation Loc) { getLocalData()->KWLoc = Loc; }
+
+ SourceLocation getLParenLoc() const { return getLocalData()->LParenLoc; }
+ void setLParenLoc(SourceLocation Loc) { getLocalData()->LParenLoc = Loc; }
+
+ SourceLocation getRParenLoc() const { return getLocalData()->RParenLoc; }
+ void setRParenLoc(SourceLocation Loc) { getLocalData()->RParenLoc = Loc; }
+
+ TypeSourceInfo* getUnderlyingTInfo() const {
+ return getLocalData()->UnderlyingTInfo;
+ }
+ void setUnderlyingTInfo(TypeSourceInfo *TInfo) {
+ getLocalData()->UnderlyingTInfo = TInfo;
+ }
+
+ SourceRange getLocalSourceRange() const {
+ return SourceRange(getKWLoc(), getRParenLoc());
+ }
+
+ SourceRange getParensRange() const {
+ return SourceRange(getLParenLoc(), getRParenLoc());
+ }
+ void setParensRange(SourceRange Range) {
+ setLParenLoc(Range.getBegin());
+ setRParenLoc(Range.getEnd());
+ }
+
+ void initializeLocal(ASTContext &Context, SourceLocation Loc) {
+ setKWLoc(Loc);
+ setRParenLoc(Loc);
+ setLParenLoc(Loc);
+ }
+};
+
class AutoTypeLoc : public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
AutoTypeLoc,
AutoType> {
diff --git a/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def b/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def
index b2591cc..0792d0d 100644
--- a/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def
+++ b/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def
@@ -84,6 +84,7 @@ NON_CANONICAL_TYPE(Typedef, Type)
NON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOfExpr, Type)
NON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOf, Type)
NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Decltype, Type)
+NON_CANONICAL_UNLESS_DEPENDENT_TYPE(UnaryTransform, Type)
ABSTRACT_TYPE(Tag, Type)
TYPE(Record, TagType)
TYPE(Enum, TagType)
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def b/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def
index 080d17f..888e529 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def
+++ b/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def
@@ -24,12 +24,26 @@ BUILTIN(__builtin_arm_qsub, "iii", "nc")
BUILTIN(__builtin_arm_ssat, "iiUi", "nc")
BUILTIN(__builtin_arm_usat, "UiUiUi", "nc")
+// Store and load exclusive doubleword
+BUILTIN(__builtin_arm_ldrexd, "LLUiv*", "")
+BUILTIN(__builtin_arm_strexd, "iLLUiv*", "")
+
// VFP
BUILTIN(__builtin_arm_get_fpscr, "Ui", "nc")
BUILTIN(__builtin_arm_set_fpscr, "vUi", "nc")
BUILTIN(__builtin_arm_vcvtr_f, "ffi", "nc")
BUILTIN(__builtin_arm_vcvtr_d, "fdi", "nc")
+// Coprocessor
+BUILTIN(__builtin_arm_mcr, "vUiUiUiUiUiUi", "")
+BUILTIN(__builtin_arm_mcr2, "vUiUiUiUiUiUi", "")
+BUILTIN(__builtin_arm_mrc, "UiUiUiUiUiUi", "")
+BUILTIN(__builtin_arm_mrc2, "UiUiUiUiUiUi", "")
+BUILTIN(__builtin_arm_cdp, "vUiUiUiUiUiUi", "")
+BUILTIN(__builtin_arm_cdp2, "vUiUiUiUiUiUi", "")
+BUILTIN(__builtin_arm_mcrr, "vUiUiUiUiUi", "")
+BUILTIN(__builtin_arm_mcrr2, "vUiUiUiUiUi", "")
+
// NEON
#define GET_NEON_BUILTINS
#include "clang/Basic/arm_neon.inc"
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def b/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def
index 2c2a84a..6ef667d 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def
+++ b/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def
@@ -278,7 +278,6 @@ BUILTIN(__builtin_ia32_cvttps2dq, "V4iV4f", "")
BUILTIN(__builtin_ia32_clflush, "vvC*", "")
BUILTIN(__builtin_ia32_lfence, "v", "")
BUILTIN(__builtin_ia32_mfence, "v", "")
-BUILTIN(__builtin_ia32_loaddqu, "V16ccC*", "")
BUILTIN(__builtin_ia32_storedqu, "vc*V16c", "")
BUILTIN(__builtin_ia32_pmuludq128, "V2LLiV4iV4i", "")
BUILTIN(__builtin_ia32_psraw128, "V8sV8sV8s", "")
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td b/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td
index 9e69492..ddd0827 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td
@@ -50,6 +50,7 @@ def Named : Decl<1>;
def RedeclarableTemplate : DDecl<Template, 1>;
def FunctionTemplate : DDecl<RedeclarableTemplate>;
def ClassTemplate : DDecl<RedeclarableTemplate>;
+ def TypeAliasTemplate : DDecl<RedeclarableTemplate>;
def TemplateTemplateParm : DDecl<Template>;
def Using : DDecl<Named>;
def UsingShadow : DDecl<Named>;
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h b/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h
index 7fc400f..fa76324 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h
@@ -32,6 +32,7 @@ namespace clang {
class LangOptions;
class Preprocessor;
class DiagnosticErrorTrap;
+ class StoredDiagnostic;
/// \brief Annotates a diagnostic with some code that should be
/// inserted, removed, or replaced to fix the problem.
@@ -400,6 +401,7 @@ public:
void setExtensionHandlingBehavior(ExtensionHandling H) {
ExtBehavior = H;
}
+ ExtensionHandling getExtensionHandlingBehavior() const { return ExtBehavior; }
/// AllExtensionsSilenced - This is a counter bumped when an __extension__
/// block is encountered. When non-zero, all extension diagnostics are
@@ -423,7 +425,7 @@ public:
///
/// 'Loc' is the source location that this change of diagnostic state should
/// take affect. It can be null if we are setting the state from command-line.
- bool setDiagnosticGroupMapping(const char *Group, diag::Mapping Map,
+ bool setDiagnosticGroupMapping(llvm::StringRef Group, diag::Mapping Map,
SourceLocation Loc = SourceLocation()) {
return Diags->setDiagnosticGroupMapping(Group, Map, Loc, *this);
}
@@ -487,6 +489,8 @@ public:
inline DiagnosticBuilder Report(SourceLocation Pos, unsigned DiagID);
inline DiagnosticBuilder Report(unsigned DiagID);
+ void Report(const StoredDiagnostic &storedDiag);
+
/// \brief Determine whethere there is already a diagnostic in flight.
bool isDiagnosticInFlight() const { return CurDiagID != ~0U; }
@@ -839,8 +843,11 @@ inline DiagnosticBuilder Diagnostic::Report(unsigned DiagID) {
/// about the currently in-flight diagnostic.
class DiagnosticInfo {
const Diagnostic *DiagObj;
+ llvm::StringRef StoredDiagMessage;
public:
explicit DiagnosticInfo(const Diagnostic *DO) : DiagObj(DO) {}
+ DiagnosticInfo(const Diagnostic *DO, llvm::StringRef storedDiagMessage)
+ : DiagObj(DO), StoredDiagMessage(storedDiagMessage) {}
const Diagnostic *getDiags() const { return DiagObj; }
unsigned getID() const { return DiagObj->CurDiagID; }
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td
index 0b0bca0..50110fb 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -52,6 +52,12 @@ def err_invalid_storage_class_in_func_decl : Error<
def err_expected_namespace_name : Error<"expected namespace name">;
def ext_variadic_templates : ExtWarn<
"variadic templates are a C++0x extension">, InGroup<CXX0x>;
+def err_default_special_members : Error<
+ "only special member functions may be defaulted">;
+def err_friends_define_only_namespace_scope : Error<
+ "cannot define a function with non-namespace scope in a friend declaration">;
+def err_deleted_non_function : Error<
+ "only functions can have deleted definitions">;
// Sema && Lex
def ext_longlong : Extension<
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td
index 67fc22e..4aa8513 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -281,6 +281,9 @@ def err_not_a_pch_file : Error<
def warn_unknown_warning_option : Warning<
"unknown warning option '%0'">,
InGroup<DiagGroup<"unknown-warning-option"> >;
+def warn_unknown_negative_warning_option : Warning<
+ "unknown warning option '%0'">,
+ InGroup<DiagGroup<"unknown-warning-option"> >, DefaultIgnore;
def warn_unknown_warning_specifier : Warning<
"unknown %0 warning specifier: '%1'">,
InGroup<DiagGroup<"unknown-warning-option"> >;
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td
index c85acc5..9abd6d3 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td
@@ -33,8 +33,11 @@ def : DiagGroup<"char-align">;
def Comment : DiagGroup<"comment">;
def : DiagGroup<"ctor-dtor-privacy">;
def : DiagGroup<"declaration-after-statement">;
+def DefaultArgSpecialMember : DiagGroup<"default-arg-special-member">;
def GNUDesignator : DiagGroup<"gnu-designator">;
+def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
+
def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings">;
def Deprecated : DiagGroup<"deprecated", [ DeprecatedDeclarations] >,
@@ -144,7 +147,7 @@ def : DiagGroup<"type-limits">;
def Uninitialized : DiagGroup<"uninitialized">;
def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
def UnknownPragmas : DiagGroup<"unknown-pragmas">;
-def UnknownAttributes : DiagGroup<"unknown-attributes">;
+def UnknownAttributes : DiagGroup<"attributes">;
def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args">;
def UnusedArgument : DiagGroup<"unused-argument">;
def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
@@ -235,6 +238,7 @@ def Extra : DiagGroup<"extra", [
def Most : DiagGroup<"most", [
CharSubscript,
Comment,
+ DeleteNonVirtualDtor,
Format,
Implicit,
MismatchedTags,
@@ -271,6 +275,8 @@ def NonGCC : DiagGroup<"non-gcc",
def CXX0xStaticNonIntegralInitializer :
DiagGroup<"c++0x-static-nonintegral-init">;
def CXX0x : DiagGroup<"c++0x-extensions", [CXX0xStaticNonIntegralInitializer]>;
+def DelegatingCtorCycles :
+ DiagGroup<"delegating-ctor-cycles">;
// A warning group for warnings about GCC extensions.
def GNU : DiagGroup<"gnu", [GNUDesignator, VLA]>;
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h
index 0296b96..fa816de 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h
@@ -101,7 +101,7 @@ public:
/// getDescription - Given a diagnostic ID, return a description of the
/// issue.
- const char *getDescription(unsigned DiagID) const;
+ llvm::StringRef getDescription(unsigned DiagID) const;
/// isBuiltinWarningOrExtension - Return true if the unmapped diagnostic
/// level of the specified diagnostic ID is a Warning or Extension.
@@ -132,15 +132,18 @@ public:
/// getWarningOptionForDiag - Return the lowest-level warning option that
/// enables the specified diagnostic. If there is no -Wfoo flag that controls
/// the diagnostic, this returns null.
- static const char *getWarningOptionForDiag(unsigned DiagID);
-
+ static llvm::StringRef getWarningOptionForDiag(unsigned DiagID);
+
/// getCategoryNumberForDiag - Return the category number that a specified
/// DiagID belongs to, or 0 if no category.
static unsigned getCategoryNumberForDiag(unsigned DiagID);
+ /// getNumberOfCategories - Return the number of categories
+ static unsigned getNumberOfCategories();
+
/// getCategoryNameFromID - Given a category ID, return the name of the
/// category.
- static const char *getCategoryNameFromID(unsigned CategoryID);
+ static llvm::StringRef getCategoryNameFromID(unsigned CategoryID);
/// \brief Enumeration describing how the the emission of a diagnostic should
/// be treated when it occurs during C++ template argument deduction.
@@ -179,24 +182,24 @@ public:
static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID);
/// getName - Given a diagnostic ID, return its name
- static const char *getName(unsigned DiagID);
+ static llvm::StringRef getName(unsigned DiagID);
/// getIdFromName - Given a diagnostic name, return its ID, or 0
- static unsigned getIdFromName(char const *Name);
+ static unsigned getIdFromName(llvm::StringRef Name);
/// getBriefExplanation - Given a diagnostic ID, return a brief explanation
/// of the issue
- static const char *getBriefExplanation(unsigned DiagID);
+ static llvm::StringRef getBriefExplanation(unsigned DiagID);
/// getFullExplanation - Given a diagnostic ID, return a full explanation
/// of the issue
- static const char *getFullExplanation(unsigned DiagID);
+ static llvm::StringRef getFullExplanation(unsigned DiagID);
private:
/// setDiagnosticGroupMapping - Change an entire diagnostic group (e.g.
/// "unknown-pragmas" to have the specified mapping. This returns true and
/// ignores the request if "Group" was unknown, false otherwise.
- bool setDiagnosticGroupMapping(const char *Group, diag::Mapping Map,
+ bool setDiagnosticGroupMapping(llvm::StringRef Group, diag::Mapping Map,
SourceLocation Loc, Diagnostic &Diag) const;
/// \brief Based on the way the client configured the Diagnostic
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td
index c37e510..fb1c909 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -108,6 +108,7 @@ def err_expected_ident_lparen : Error<"expected identifier or '('">;
def err_expected_ident_lbrace : Error<"expected identifier or '{'">;
def err_expected_lbrace : Error<"expected '{'">;
def err_expected_lparen : Error<"expected '('">;
+def err_expected_lparen_or_lbrace : Error<"expected '('or '{'">;
def err_expected_rparen : Error<"expected ')'">;
def err_expected_lsquare : Error<"expected '['">;
def err_expected_rsquare : Error<"expected ']'">;
@@ -161,6 +162,8 @@ def err_unexpected_namespace_attributes_alias : Error<
def err_inline_namespace_alias : Error<"namespace alias cannot be inline">;
def err_namespace_nonnamespace_scope : Error<
"namespaces can only be defined in global or namespace scope">;
+def err_nested_namespaces_with_double_colon : Error<
+ "nested namespace definition must define each namespace separately">;
def err_expected_semi_after_attribute_list : Error<
"expected ';' after attribute list">;
def err_expected_semi_after_static_assert : Error<
@@ -190,6 +193,8 @@ def ext_ref_qualifier : ExtWarn<
"reference qualifiers on functions are a C++0x extension">, InGroup<CXX0x>;
def ext_inline_namespace : ExtWarn<
"inline namespaces are a C++0x feature">, InGroup<CXX0x>;
+def err_generalized_initializer_lists : Error<
+ "generalized initializer lists are a C++0x extension unsupported in Clang">;
def ext_generalized_initializer_lists : ExtWarn<
"generalized initializer lists are a C++0x extension unsupported in Clang">,
InGroup<CXX0x>;
@@ -343,6 +348,9 @@ def err_operator_string_not_empty : Error<
// Classes.
def err_anon_type_definition : Error<
"declaration of anonymous %0 must be a definition">;
+def err_default_delete_in_multiple_declaration : Error<
+ "'= %select{default|delete}0' is a function definition and must occur in a "
+ "standalone declaration">;
def err_cxx0x_attribute_forbids_arguments : Error<
"C++0x attribute '%0' cannot have an argument list">;
@@ -434,12 +442,26 @@ def err_missing_whitespace_digraph : Error<
def warn_deleted_function_accepted_as_extension: ExtWarn<
"deleted function definition accepted as a C++0x extension">, InGroup<CXX0x>;
+def warn_defaulted_function_accepted_as_extension: ExtWarn<
+ "defaulted function definition accepted as a C++0x extension">,
+ InGroup<CXX0x>;
+
+// C++0x in-class member initialization
+def warn_nonstatic_member_init_accepted_as_extension: ExtWarn<
+ "in-class initialization of non-static data member accepted as a C++0x extension">,
+ InGroup<CXX0x>;
+def err_bitfield_member_init: Error<
+ "bitfield member cannot have an in-class initializer">;
+def err_incomplete_array_member_init: Error<
+ "array bound cannot be deduced from an in-class initializer">;
// C++0x alias-declaration
def ext_alias_declaration : ExtWarn<
"alias declarations accepted as a C++0x extension">, InGroup<CXX0x>;
def err_alias_declaration_not_identifier : Error<
"name defined in alias declaration must be an identifier">;
+def err_alias_declaration_specialization : Error<
+ "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">;
// C++0x override control
def ext_override_control_keyword : Extension<
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 0a0c91a..5cfa61b 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -261,10 +261,11 @@ def err_builtin_definition : Error<"definition of builtin function %0">;
def err_types_compatible_p_in_cplusplus : Error<
"__builtin_types_compatible_p is not valid in C++">;
def warn_builtin_unknown : Warning<"use of unknown builtin %0">, DefaultError;
-def warn_non_pod_memset : Warning<
- "destination for this memset call is a pointer to a non-POD type %0">,
- InGroup<DiagGroup<"non-pod-memset">>, DefaultIgnore;
-def note_non_pod_memset_silence : Note<
+def warn_dyn_class_memaccess : Warning<
+ "%select{destination for|source of}0 this %1 call is a pointer to dynamic "
+ "class %2; vtable pointer will be overwritten">,
+ InGroup<DiagGroup<"dynamic-class-memaccess">>;
+def note_bad_memaccess_silence : Note<
"explicitly cast the pointer to silence this warning">;
/// main()
@@ -371,7 +372,8 @@ def warn_conflicting_ret_types : Warning<
"conflicting return type in implementation of %0: %1 vs %2">;
def warn_conflicting_ret_type_modifiers : Warning<
"conflicting distributed object modifiers on return type "
- "in implementation of %0">;
+ "in implementation of %0">,
+ InGroup<DiagGroup<"distributed-object-modifiers">>;
def warn_non_covariant_ret_types : Warning<
"conflicting return type in implementation of %0: %1 vs %2">,
InGroup<DiagGroup<"method-signatures">>, DefaultIgnore;
@@ -380,7 +382,8 @@ def warn_conflicting_param_types : Warning<
"conflicting parameter types in implementation of %0: %1 vs %2">;
def warn_conflicting_param_modifiers : Warning<
"conflicting distributed object modifiers on parameter type "
- "in implementation of %0">;
+ "in implementation of %0">,
+ InGroup<DiagGroup<"distributed-object-modifiers">>;
def warn_non_contravariant_param_types : Warning<
"conflicting parameter types in implementation of %0: %1 vs %2">,
InGroup<DiagGroup<"method-signatures">>, DefaultIgnore;
@@ -495,6 +498,8 @@ def err_static_assert_expression_is_not_constant : Error<
"static_assert expression is not an integral constant expression">;
def err_static_assert_failed : Error<"static_assert failed \"%0\"">;
+def warn_inline_namespace_reopened_noninline : Warning<
+ "inline namespace cannot be re-opened as a non-inline namespace">;
def err_inline_namespace_mismatch : Error<
"%select{|non-}0inline namespace "
"cannot be reopened as %select{non-|}0inline">;
@@ -504,11 +509,12 @@ def err_unexpected_friend : Error<
def ext_enum_friend : ExtWarn<
"enumeration type %0 cannot be a friend">;
def ext_nonclass_type_friend : ExtWarn<
- "non-class type %0 cannot be a friend">;
+ "non-class friend type %0 is a C++0x extension">, InGroup<CXX0x>;
def err_friend_is_member : Error<
"friends cannot be members of the declaring class">;
def ext_unelaborated_friend_type : ExtWarn<
- "must specify '%select{struct|union|class|enum}0' to befriend %1">;
+ "specify '%select{struct|union|class|enum}0' to befriend %1; accepted "
+ "as a C++0x extension">, InGroup<CXX0x>;
def err_qualified_friend_not_found : Error<
"no function named %0 with type %1 was found in the specified scope">;
def err_introducing_special_friend : Error<
@@ -539,12 +545,12 @@ def err_type_defined_in_result_type : Error<
"%0 can not be defined in the result type of a function">;
def err_type_defined_in_param_type : Error<
"%0 can not be defined in a parameter type">;
+def err_type_defined_in_alias_template : Error<
+ "%0 can not be defined in a type alias template">;
def note_pure_virtual_function : Note<
"unimplemented pure virtual method %0 in %1">;
-def err_deleted_non_function : Error<
- "only functions can have deleted definitions">;
def err_deleted_decl_not_first : Error<
"deleted definition must be first declaration">;
@@ -572,6 +578,9 @@ def warn_mismatched_exception_spec : ExtWarn<
def err_override_exception_spec : Error<
"exception specification of overriding function is more lax than "
"base version">;
+def warn_override_exception_spec : ExtWarn<
+ "exception specification of overriding function is more lax than "
+ "base version">, InGroup<Microsoft>;
def err_incompatible_exception_specs : Error<
"target exception specification is not superset of source">;
def err_deep_exception_specs_differ : Error<
@@ -580,12 +589,18 @@ def warn_missing_exception_specification : Warning<
"%0 is missing exception specification '%1'">;
def err_noexcept_needs_constant_expression : Error<
"argument to noexcept specifier must be a constant expression">;
+def err_exception_spec_unknown : Error<
+ "exception specification is not available until end of class definition">;
// C++ access checking
def err_class_redeclared_with_different_access : Error<
"%0 redeclared with '%1' access">;
def err_access : Error<
"%1 is a %select{private|protected}0 member of %3">, AccessControl;
+def war_ms_using_declaration_inaccessible : ExtWarn<
+ "using declaration refers to inaccessible member '%0', which refers "
+ "to accessible member '%1', accepted for Microsoft compatibility">,
+ AccessControl, InGroup<Microsoft>;
def err_access_ctor : Error<
"calling a %select{private|protected}0 constructor of class %2">,
AccessControl;
@@ -593,13 +608,18 @@ def ext_rvalue_to_reference_access_ctor : ExtWarn<
"C++98 requires an accessible copy constructor for class %2 when binding "
"a reference to a temporary; was %select{private|protected}0">,
AccessControl, InGroup<BindToTemporaryCopy>;
-def err_access_base : Error<
+def err_access_base_ctor : Error<
+ // The ERRORs represent other special members that aren't constructors, in
+ // hopes that someone will bother noticing and reporting if they appear
"%select{base class|inherited virtual base class}0 %1 has %select{private|"
- "protected}3 %select{constructor|copy constructor|copy assignment operator|"
- "destructor}2">, AccessControl;
-def err_access_field: Error<
- "field of type %0 has %select{private|protected}2 %select{constructor|copy "
- "constructor|copy assignment operator|destructor}1">, AccessControl;
+ "protected}3 %select{default |copy |move |*ERROR* |*ERROR* "
+ "|*ERROR*|}2constructor">, AccessControl;
+def err_access_field_ctor : Error<
+ // The ERRORs represent other special members that aren't constructors, in
+ // hopes that someone will bother noticing and reporting if they appear
+ "field of type %0 has %select{private|protected}2 "
+ "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">,
+ AccessControl;
def err_access_ctor_field :
Error<"field of type %1 has %select{private|protected}2 constructor">,
@@ -715,39 +735,52 @@ def err_member_function_initialization : Error<
"initializer on function does not look like a pure-specifier">;
def err_non_virtual_pure : Error<
"%0 is not virtual and cannot be declared pure">;
+def warn_pure_function_definition : ExtWarn<
+ "function definition with pure-specifier is a Microsoft extension">,
+ InGroup<Microsoft>;
def err_implicit_object_parameter_init : Error<
"cannot initialize object parameter of type %0 with an expression "
"of type %1">;
def err_qualified_member_of_unrelated : Error<
"%q0 is not a member of class %1">;
+def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning<
+ "call to pure virtual member function %0; overrides of %0 in subclasses are "
+ "not available in the %select{constructor|destructor}1 of %2">;
+
def note_field_decl : Note<"member is declared here">;
def note_ivar_decl : Note<"ivar is declared here">;
def note_bitfield_decl : Note<"bit-field is declared here">;
def note_previous_decl : Note<"%0 declared here">;
def note_member_synthesized_at : Note<
- "implicit default %select{constructor|copy constructor|"
- "copy assignment operator|destructor}0 for %1 first required here">;
+ "implicit default %select{constructor|copy constructor|move constructor|copy "
+ "assignment operator|move assignment operator|destructor}0 for %1 first "
+ "required here">;
def err_missing_default_ctor : Error<
"%select{|implicit default }0constructor for %1 must explicitly initialize "
"the %select{base class|member}2 %3 which does not have a default "
"constructor">;
def err_illegal_union_or_anon_struct_member : Error<
"%select{anonymous struct|union}0 member %1 has a non-trivial "
- "%select{constructor|copy constructor|copy assignment operator|destructor}2">;
+ "%select{constructor|copy constructor|move constructor|copy assignment "
+ "operator|move assignment operator|destructor}2">;
def note_nontrivial_has_virtual : Note<
"because type %0 has a virtual %select{member function|base class}1">;
def note_nontrivial_has_nontrivial : Note<
"because type %0 has a %select{member|base class}1 with a non-trivial "
- "%select{constructor|copy constructor|copy assignment operator|destructor}2">;
+ "%select{constructor|copy constructor|move constructor|copy assignment "
+ "operator|move assignment operator|destructor}2">;
def note_nontrivial_user_defined : Note<
"because type %0 has a user-declared %select{constructor|copy constructor|"
- "copy assignment operator|destructor}1">;
+ "move constructor|copy assignment operator|move assignment operator|"
+ "destructor}1">;
def err_static_data_member_not_allowed_in_union_or_anon_struct : Error<
"static data member %0 not allowed in %select{anonymous struct|union}1">;
def err_union_member_of_reference_type : Error<
"union member %0 has reference type %1">;
-
+def ext_anonymous_struct_union_qualified : Extension<
+ "anonymous %select{struct|union}0 cannot be '%select{const|volatile|"
+ "restrict}1'">;
def err_different_return_type_for_overriding_virtual_function : Error<
"virtual function %0 has a different return type (%1) than the "
"function it overrides (which has return type %2)">;
@@ -942,8 +975,8 @@ def err_illegal_decl_array_of_auto : Error<
def err_new_array_of_auto : Error<
"cannot allocate array of 'auto'">;
def err_auto_not_allowed : Error<
- "'auto' not allowed %select{in function prototype|in struct member"
- "|in union member|in class member|in exception declaration"
+ "'auto' not allowed %select{in function prototype|in non-static struct member"
+ "|in non-static union member|in non-static class member|in exception declaration"
"|in template parameter|in block literal|in template argument"
"|in typedef|in type alias|in function return type|here}0">;
def err_auto_var_requires_init : Error<
@@ -1000,16 +1033,23 @@ def err_enum_redeclare_fixed_mismatch : Error<
"enumeration previously declared with %select{non|}0fixed underlying type">;
def err_enum_redeclare_scoped_mismatch : Error<
"enumeration previously declared as %select{un|}0scoped">;
+def err_only_enums_have_underlying_types : Error<
+ "only enumeration types have underlying types">;
+def err_incomplete_type_no_underlying_type : Error<
+ "an incomplete enumeration type has no underlying type yet">;
// C++0x delegating constructors
def err_delegation_0x_only : Error<
"delegating constructors are permitted only in C++0x">;
-def err_delegation_unimplemented : Error<
- "delegating constructors are not fully implemented">;
def err_delegating_initializer_alone : Error<
"an initializer for a delegating constructor must appear alone">;
-def err_delegating_ctor_loop : Error<
- "constructor %0 delegates to itself (possibly indirectly)">;
+def warn_delegating_ctor_cycle : Warning<
+ "constructor for %0 creates a delegation cycle">, DefaultError,
+ InGroup<DelegatingCtorCycles>;
+def note_it_delegates_to : Note<
+ "it delegates to">, InGroup<DelegatingCtorCycles>;
+def note_which_delegates_to : Note<
+ "which delegates to">, InGroup<DelegatingCtorCycles>;
def err_delegating_codegen_not_implemented : Error<
"code generation for delegating constructors not implemented">;
@@ -1140,6 +1180,8 @@ def warn_attribute_void_function_method : Warning<
"%select{functions|Objective-C method}1 without return value">;
def warn_attribute_weak_on_field : Warning<
"__weak attribute cannot be specified on a field declaration">;
+def warn_gc_attribute_weak_on_local : Warning<
+ "Objective-C GC does not allow weak variables on the stack">;
def warn_attribute_weak_on_local : Warning<
"__weak attribute cannot be specified on an automatic variable">;
def warn_weak_identifier_undeclared : Warning<
@@ -1242,7 +1284,9 @@ def warn_impcast_different_enum_types : Warning<
def warn_impcast_bool_to_null_pointer : Warning<
"initialization of pointer of type %0 to NULL from a constant boolean "
"expression">, InGroup<BoolConversions>;
-
+def warn_impcast_null_pointer_to_integer : Warning<
+ "implicit conversion of NULL constant to integer">,
+ InGroup<DiagGroup<"conversion">>, DefaultIgnore;
def warn_cast_align : Warning<
"cast from %0 to %1 increases required alignment from %2 to %3">,
@@ -1374,6 +1418,13 @@ def note_first_required_here : Note<
def err_uninitialized_member_in_ctor : Error<
"%select{|implicit default }0constructor for %1 must explicitly initialize "
"the %select{reference|const}2 member %3">;
+def warn_default_arg_makes_ctor_special : Warning<
+ "addition of default argument on redeclaration makes this constructor a "
+ "%select{default|copy|move}0 constructor">, InGroup<DefaultArgSpecialMember>;
+def note_previous_declaration_special : Note<
+ // The ERRORs are in hopes that if they occur, they'll get reported.
+ "previous declaration was %select{*ERROR*|a copy constructor|a move "
+ "constructor|*ERROR*|*ERROR*|*ERROR*|not a special member function}0">;
def err_use_of_default_argument_to_function_declared_later : Error<
"use of default argument to function %0 that is declared later in class %1">;
@@ -1412,7 +1463,9 @@ def note_ovl_candidate : Note<"candidate "
"function |function |constructor |"
"is the implicit default constructor|"
"is the implicit copy constructor|"
+ "is the implicit move constructor|"
"is the implicit copy assignment operator|"
+ "is the implicit move assignment operator|"
"is an inherited constructor}0%1">;
def note_ovl_candidate_inherited_constructor : Note<"inherited from here">;
@@ -1443,7 +1496,9 @@ def note_ovl_candidate_arity : Note<"candidate "
"%select{function|function|constructor|function|function|constructor|"
"constructor (the implicit default constructor)|"
"constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
"function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
"constructor (inherited)}0 %select{|template }1"
"not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
"%plural{1:was|:were}4 provided">;
@@ -1463,7 +1518,9 @@ def note_ovl_candidate_bad_conv_incomplete : Note<"candidate "
"function |function |constructor |"
"constructor (the implicit default constructor)|"
"constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
"function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
"constructor (inherited)}0%1 "
"not viable: cannot convert argument of incomplete type %2 to %3">;
def note_ovl_candidate_bad_overload : Note<"candidate "
@@ -1471,7 +1528,9 @@ def note_ovl_candidate_bad_overload : Note<"candidate "
"function |function |constructor |"
"constructor (the implicit default constructor)|"
"constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
"function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
"constructor (inherited)}0%1"
" not viable: no overload of %3 matching %2 for %ordinal4 argument">;
def note_ovl_candidate_bad_conv : Note<"candidate "
@@ -1479,7 +1538,9 @@ def note_ovl_candidate_bad_conv : Note<"candidate "
"function |function |constructor |"
"constructor (the implicit default constructor)|"
"constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
"function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
"constructor (inherited)}0%1"
" not viable: no known conversion from %2 to %3 for "
"%select{%ordinal5 argument|object argument}4">;
@@ -1488,7 +1549,9 @@ def note_ovl_candidate_bad_addrspace : Note<"candidate "
"function |function |constructor |"
"constructor (the implicit default constructor)|"
"constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
"function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
"constructor (inherited)}0%1 not viable: "
"%select{%ordinal6|'this'}5 argument (%2) is in "
"address space %3, but parameter must be in address space %4">;
@@ -1497,7 +1560,9 @@ def note_ovl_candidate_bad_gc : Note<"candidate "
"function |function |constructor |"
"constructor (the implicit default constructor)|"
"constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
"function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
"constructor (inherited)}0%1 not viable: "
"%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 "
"lifetime, but parameter has %select{no|__weak|__strong}4 lifetime">;
@@ -1512,7 +1577,9 @@ def note_ovl_candidate_bad_cvr : Note<"candidate "
"function |function |constructor |"
"constructor (the implicit default constructor)|"
"constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
"function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
"constructor (inherited)}0%1 not viable: "
"%ordinal4 argument (%2) would lose "
"%select{const|restrict|const and restrict|volatile|const and volatile|"
@@ -1523,7 +1590,9 @@ def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate "
"function |function |constructor |"
"constructor (the implicit default constructor)|"
"constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
"function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
"constructor (inherited)}0%1"
" not viable: cannot %select{convert from|convert from|bind}2 "
"%select{base class pointer|superclass|base class object of type}2 %3 to "
@@ -1666,7 +1735,7 @@ def err_template_arg_must_be_expr : Error<
def err_template_arg_nontype_ambig : Error<
"template argument for non-type template parameter is treated as type %0">;
def err_template_arg_must_be_template : Error<
- "template argument for template template parameter must be a class template">;
+ "template argument for template template parameter must be a class template%select{| or type alias template}0">;
def ext_template_arg_local_type : ExtWarn<
"template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>;
def ext_template_arg_unnamed_type : ExtWarn<
@@ -1802,6 +1871,8 @@ def err_not_class_template_specialization : Error<
"parameter}0">;
def err_function_specialization_in_class : Error<
"cannot specialize a function %0 within class scope">;
+def err_explicit_specialization_storage_class : Error<
+ "explicit specialization cannot have a storage class">;
// C++ class template specializations and out-of-line definitions
def err_template_spec_needs_header : Error<
@@ -1812,6 +1883,8 @@ def err_template_spec_needs_template_parameters : Error<
def err_template_param_list_matches_nontemplate : Error<
"template parameter list matching the non-templated nested type %0 should "
"be empty ('template<>')">;
+def err_alias_template_extra_headers : Error<
+ "extraneous template parameter list in alias template declaration">;
def err_template_spec_extra_headers : Error<
"extraneous template parameter list in template specialization or "
"out-of-line template definition">;
@@ -1823,6 +1896,9 @@ def note_explicit_template_spec_does_not_need_header : Note<
def err_template_qualified_declarator_no_match : Error<
"nested name specifier '%0' for declaration does not refer into a class, "
"class template or class template partial specialization">;
+def err_specialize_member_of_template : Error<
+ "cannot specialize (with 'template<>') a member of an unspecialized "
+ "template">;
// C++ Class Template Partial Specialization
def err_default_arg_in_partial_spec : Error<
@@ -1889,6 +1965,8 @@ def note_function_template_spec_here : Note<
"in instantiation of function template specialization %q0 requested here">;
def note_template_static_data_member_def_here : Note<
"in instantiation of static data member %q0 requested here">;
+def note_template_type_alias_instantiation_here : Note<
+ "in instantiation of template type alias %0 requested here">;
def note_default_arg_instantiation_here : Note<
"in instantiation of default argument for '%0' required here">;
@@ -1954,6 +2032,8 @@ def err_explicit_instantiation_requires_name : Error<
"explicit instantiation declaration requires a name">;
def err_explicit_instantiation_of_typedef : Error<
"explicit instantiation of typedef %0">;
+def err_explicit_instantiation_storage_class : Error<
+ "explicit instantiation cannot have a storage class">;
def err_explicit_instantiation_not_known : Error<
"explicit instantiation of %0 does not refer to a function template, member "
"function, member class, or static data member">;
@@ -1971,7 +2051,7 @@ def note_explicit_instantiation_candidate : Note<
"explicit instantiation candidate function template here %0">;
def err_explicit_instantiation_inline : Error<
"explicit instantiation cannot be 'inline'">;
-def ext_explicit_instantiation_without_qualified_id : ExtWarn<
+def ext_explicit_instantiation_without_qualified_id : Extension<
"qualifier in explicit instantiation of %q0 requires a template-id "
"(a typedef is not permitted)">;
def err_explicit_instantiation_unqualified_wrong_namespace : Error<
@@ -2026,7 +2106,7 @@ def err_non_type_template_in_nested_name_specifier : Error<
def err_template_id_not_a_type : Error<
"template name refers to non-type template '%0'">;
def note_template_declared_here : Note<
- "%select{function template|class template|template template parameter}0 "
+ "%select{function template|class template|type alias template|template template parameter}0 "
"%1 declared here">;
// C++0x Variadic Templates
@@ -2099,6 +2179,10 @@ def err_unexpected_namespace : Error<
def err_undeclared_var_use : Error<"use of undeclared identifier %0">;
def note_dependent_var_use : Note<"must qualify identifier to find this "
"declaration in dependent base class">;
+def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither "
+ "visible in the template definition nor found by argument dependent lookup">;
+def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the "
+ "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">;
def err_undeclared_use : Error<"use of undeclared %0">;
def warn_deprecated : Warning<"%0 is deprecated">,
InGroup<DeprecatedDeclarations>;
@@ -2115,7 +2199,8 @@ def err_unavailable_message : Error<"%0 is unavailable: %1">;
def warn_unavailable_fwdclass_message : Warning<
"%0 maybe unavailable because receiver type is unknown">;
def note_unavailable_here : Note<
- "function has been explicitly marked %select{unavailable|deleted|deprecated}0 here">;
+ "function has been explicitly marked "
+ "%select{unavailable|deleted|deprecated}0 here">;
def warn_not_enough_argument : Warning<
"not enough variable arguments in %0 declaration to fit a sentinel">;
def warn_missing_sentinel : Warning <
@@ -2127,8 +2212,13 @@ def warn_missing_prototype : Warning<
InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
def err_redefinition : Error<"redefinition of %0">;
def err_definition_of_implicitly_declared_member : Error<
- "definition of implicitly declared %select{constructor|copy constructor|"
- "copy assignment operator|destructor}1">;
+ "definition of implicitly declared %select{default constructor|copy "
+ "constructor|move constructor|copy assignment operator|move assignment "
+ "operator|destructor}1">;
+def err_definition_of_explicitly_defaulted_member : Error<
+ "definition of explicitly defaulted %select{default constructor|copy "
+ "constructor|move constructor|copy assignment operator|move assignment "
+ "operator|destructor}0">;
def err_redefinition_extern_inline : Error<
"redefinition of a 'extern inline' function %0 is not supported in "
"%select{C99 mode|C++}1">;
@@ -2164,9 +2254,9 @@ def err_redefinition_different_type : Error<
def err_redefinition_different_kind : Error<
"redefinition of %0 as different kind of symbol">;
def err_redefinition_different_typedef : Error<
- "%select{typedef|type alias}0 redefinition with different types (%1 vs %2)">;
+ "%select{typedef|type alias|type alias template}0 redefinition with different types (%1 vs %2)">;
def err_tag_reference_non_tag : Error<
- "elaborated type refers to %select{a non-tag type|a typedef|a type alias|a template}0">;
+ "elaborated type refers to %select{a non-tag type|a typedef|a type alias|a template|a type alias template}0">;
def err_tag_reference_conflict : Error<
"implicit declaration introduced by elaborated type conflicts with "
"%select{a declaration|a typedef|a type alias|a template}0 of the same name">;
@@ -2180,9 +2270,15 @@ def err_nested_redefinition : Error<"nested redefinition of %0">;
def err_use_with_wrong_tag : Error<
"use of %0 with tag type that does not match previous declaration">;
def warn_struct_class_tag_mismatch : Warning<
- "%select{struct|class}0 %select{|template}1 %2 was previously declared "
- "as a %select{class|struct}0 %select{|template}1">,
+ "%select{struct|class}0%select{| template}1 %2 was previously declared "
+ "as a %select{class|struct}0%select{| template}1">,
InGroup<MismatchedTags>, DefaultIgnore;
+def warn_struct_class_previous_tag_mismatch : Warning<
+ "%2 defined as a %select{struct|class}0%select{| template}1 here but "
+ "previously declared as a %select{class|struct}0%select{| template}1">,
+ InGroup<MismatchedTags>, DefaultIgnore;
+def note_struct_class_suggestion : Note<
+ "did you mean %select{struct|class}0 here?">;
def ext_forward_ref_enum : Extension<
"ISO C forbids forward references to 'enum' types">;
def err_forward_ref_enum : Error<
@@ -2482,6 +2578,14 @@ def note_precedence_bitwise_first : Note<
def note_precedence_bitwise_silence : Note<
"place parentheses around the %0 expression to silence this warning">;
+def warn_precedence_conditional : Warning<
+ "?: has lower precedence than %0; %0 will be evaluated first">,
+ InGroup<Parentheses>;
+def note_precedence_conditional_first : Note<
+ "place parentheses around the ?: expression to evaluate it first">;
+def note_precedence_conditional_silence : Note<
+ "place parentheses around the %0 expression to silence this warning">;
+
def warn_logical_instead_of_bitwise : Warning<
"use of logical %0 with constant operand; switch to bitwise %1 or "
"remove constant">, InGroup<DiagGroup<"constant-logical-operand">>;
@@ -2641,6 +2745,10 @@ def warn_indirection_through_null : Warning<
"indirection of non-volatile null pointer will be deleted, not trap">, InGroup<NullDereference>;
def note_indirection_through_null : Note<
"consider using __builtin_trap() or qualifying pointer with 'volatile'">;
+def warn_pointer_indirection_from_incompatible_type : Warning<
+ "dereference of type %1 that was reinterpret_cast from type %0 has undefined "
+ "behavior.">,
+ InGroup<DiagGroup<"undefined-reinterpret-cast">>, DefaultIgnore;
def err_assignment_requires_nonfragile_object : Error<
"cannot assign to class object in non-fragile ABI (%0 invalid)">;
@@ -2839,6 +2947,8 @@ def err_objc_pointer_cxx_catch_fragile : Error<
"exception model">;
def err_objc_object_catch : Error<
"can't catch an Objective C object by value">;
+def err_incomplete_type_objc_at_encode : Error<
+ "'@encode' of incomplete type %0">;
def warn_setter_getter_impl_required : Warning<
"property %0 requires method %1 to be defined - "
@@ -2904,6 +3014,9 @@ def err_bad_cxx_cast_member_pointer_size : Error<
def err_bad_static_cast_incomplete : Error<"%0 is an incomplete type">;
def err_bad_reinterpret_cast_reference : Error<
"reinterpret_cast of a %0 to %1 needs its address which is not allowed">;
+def warn_undefined_reinterpret_cast : Warning<
+ "reinterpret_cast from %0 to %1 has undefined behavior.">,
+ InGroup<DiagGroup<"undefined-reinterpret-cast">>, DefaultIgnore;
// These messages don't adhere to the pattern.
// FIXME: Display the path somehow better.
@@ -3016,6 +3129,9 @@ def err_objc_exceptions_disabled : Error<
def warn_non_virtual_dtor : Warning<
"%0 has virtual functions but non-virtual destructor">,
InGroup<NonVirtualDtor>, DefaultIgnore;
+def warn_delete_non_virtual_dtor : Warning<
+ "delete called on %0 that has virtual functions but non-virtual destructor">,
+ InGroup<DeleteNonVirtualDtor>, DefaultIgnore;
def warn_overloaded_virtual : Warning<
"%q0 hides overloaded virtual %select{function|functions}1">,
InGroup<OverloadedVirtual>, DefaultIgnore;
@@ -3170,7 +3286,8 @@ def ext_typecheck_convert_incompatible_pointer : ExtWarn<
"%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
" %0 "
"%select{from|to parameter of type|from a function with result type|to type|"
- "with an expression of type|to parameter of type|to type}2 %1">;
+ "with an expression of type|to parameter of type|to type}2 %1">,
+ InGroup<DiagGroup<"incompatible-pointer-types">>;
def ext_typecheck_convert_discards_qualifiers : ExtWarn<
"%select{assigning to|passing|returning|converting|initializing|sending|casting}2"
" %0 "
@@ -3281,8 +3398,8 @@ def err_cannot_pass_objc_interface_to_vararg : Error<
"%select{function|block|method}1">;
def warn_cannot_pass_non_pod_arg_to_vararg : Warning<
- "cannot pass object of non-POD type %0 through variadic "
- "%select{function|block|method|constructor}1; call will abort at runtime">,
+ "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic"
+ " %select{function|block|method|constructor}2; call will abort at runtime">,
InGroup<DiagGroup<"non-pod-varargs">>, DefaultError;
def err_typecheck_call_invalid_ordered_compare : Error<
@@ -3591,6 +3708,47 @@ def warn_not_compound_assign : Warning<
def warn_explicit_conversion_functions : Warning<
"explicit conversion functions are a C++0x extension">, InGroup<CXX0x>;
+// C++0x defaulted functions
+def err_defaulted_default_ctor_params : Error<
+ "an explicitly-defaulted default constructor must have no parameters">;
+def err_defaulted_copy_ctor_params : Error<
+ "an explicitly-defaulted copy constructor must have exactly one parameter">;
+def err_defaulted_copy_ctor_volatile_param : Error<
+ "the parameter for an explicitly-defaulted copy constructor may not be "
+ "volatile">;
+def err_defaulted_copy_ctor_const_param : Error<
+ "the parameter for this explicitly-defaulted copy constructor is const, but "
+ "a member or base requires it to be non-const">;
+def err_defaulted_copy_assign_params : Error<
+ "an explicitly-defaulted copy assignment operator must have exactly one "
+ "parameter">;
+def err_defaulted_copy_assign_return_type : Error<
+ "an explicitly-defaulted copy assignment operator must return an unqualified "
+ "lvalue reference to its class type">;
+def err_defaulted_copy_assign_not_ref : Error<
+ "the parameter for an explicitly-defaulted copy assignment operator must be an "
+ "lvalue reference type">;
+def err_defaulted_copy_assign_volatile_param : Error<
+ "the parameter for an explicitly-defaulted copy assignment operator may not "
+ "be volatile">;
+def err_defaulted_copy_assign_const_param : Error<
+ "the parameter for this explicitly-defaulted copy assignment operator is "
+ "const, but a member or base requires it to be non-const">;
+def err_defaulted_copy_assign_quals : Error<
+ "an explicitly-defaulted copy assignment operator may not have 'const' "
+ "or 'volatile' qualifiers">;
+def err_incorrect_defaulted_exception_spec : Error<
+ "exception specification of explicitly defaulted %select{default constructor|"
+ "copy constructor|move constructor|copy assignment operator|move assignment "
+ "operator|destructor}0 does not match the "
+ "calculated one">;
+def err_out_of_line_default_deletes : Error<
+ "defaulting this %select{default constructor|copy constructor|move "
+ "constructor|copy assignment operator|move assignment operator|destructor}0 "
+ "would delete it after its first declaration">;
+def err_defaulted_move_unsupported : Error<
+ "defaulting move functions not yet supported">;
+
def warn_array_index_precedes_bounds : Warning<
"array index of '%0' indexes before the beginning of the array">,
InGroup<DiagGroup<"array-bounds">>;
@@ -3955,7 +4113,28 @@ def err_unknown_any_var_function_type : Error<
def err_filter_expression_integral : Error<
"filter expression type should be an integral value not %0">;
+// OpenCL warnings and errors.
+def err_invalid_astype_of_different_size : Error<
+ "invalid reinterpretation: sizes of %0 and %1 must match">;
+
} // end of sema category
+let CategoryName = "Related Result Type Issue" in {
+// Objective-C related result type compatibility
+def warn_related_result_type_compatibility_class : Warning<
+ "method is expected to return an instance of its class type %0, but "
+ "is declared to return %1">;
+def warn_related_result_type_compatibility_protocol : Warning<
+ "protocol method is expected to return an instance of the implementing "
+ "class, but is declared to return %0">;
+def note_related_result_type_overridden : Note<
+ "overridden method is part of the '%select{|alloc|copy|init|mutableCopy|"
+ "new|autorelease|dealloc|release|retain|retainCount|self}0' method family">;
+def note_related_result_type_inferred : Note<
+ "%select{class|instance}0 method %1 is assumed to return an instance of "
+ "its receiver type (%2)">;
+
+}
+
} // end of sema component.
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationType.h b/contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationType.h
index aecf6eb..98cfd29 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationType.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationType.h
@@ -18,12 +18,13 @@ namespace clang {
/// \brief The various types of exception specifications that exist in C++0x.
enum ExceptionSpecificationType {
- EST_None, ///< no exception specification
- EST_DynamicNone, ///< throw()
- EST_Dynamic, ///< throw(T1, T2)
- EST_MSAny, ///< Microsoft throw(...) extension
- EST_BasicNoexcept, ///< noexcept
- EST_ComputedNoexcept ///< noexcept(expression)
+ EST_None, ///< no exception specification
+ EST_DynamicNone, ///< throw()
+ EST_Dynamic, ///< throw(T1, T2)
+ EST_MSAny, ///< Microsoft throw(...) extension
+ EST_BasicNoexcept, ///< noexcept
+ EST_ComputedNoexcept, ///< noexcept(expression)
+ EST_Delayed ///< not known yet
};
inline bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType) {
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h b/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h
index 683ec83..b4eca6d 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h
@@ -498,7 +498,8 @@ enum ObjCMethodFamily {
OMF_dealloc,
OMF_release,
OMF_retain,
- OMF_retainCount
+ OMF_retainCount,
+ OMF_self
};
/// Enough bits to store any enumerator in ObjCMethodFamily or
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h b/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h
index ff13fe0..74a3fbe 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h
@@ -46,6 +46,8 @@ public:
unsigned ObjCNonFragileABI : 1; // Objective-C modern abi enabled
unsigned ObjCNonFragileABI2 : 1; // Objective-C enhanced modern abi enabled
unsigned ObjCDefaultSynthProperties : 1; // Objective-C auto-synthesized properties.
+ unsigned ObjCInferRelatedResultType : 1; // Infer Objective-C related return
+ // types
unsigned AppleKext : 1; // Allow apple kext features.
unsigned PascalStrings : 1; // Allow Pascal strings
@@ -174,6 +176,7 @@ public:
GC = ObjC1 = ObjC2 = ObjCNonFragileABI = ObjCNonFragileABI2 = 0;
AppleKext = 0;
ObjCDefaultSynthProperties = 0;
+ ObjCInferRelatedResultType = 0;
NoConstantCFStrings = 0; InlineVisibilityHidden = 0;
C99 = C1X = Microsoft = Borland = CPlusPlus = CPlusPlus0x = 0;
CXXOperatorNames = PascalStrings = WritableStrings = ConstStrings = 0;
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h b/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h
index 14bb2b7..ee5f96f 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h
@@ -54,6 +54,9 @@ public:
private:
friend class SourceManager;
+ friend class ASTWriter;
+ friend class ASTReader;
+
static FileID get(unsigned V) {
FileID F;
F.ID = V;
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h b/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h
index c121bbb..df5074c 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h
@@ -831,6 +831,14 @@ public:
return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem;
}
+ /// \brief Returns true if the given MacroID location points at the first
+ /// token of the macro instantiation.
+ bool isAtStartOfMacroInstantiation(SourceLocation Loc) const;
+
+ /// \brief Returns true if the given MacroID location points at the last
+ /// token of the macro instantiation.
+ bool isAtEndOfMacroInstantiation(SourceLocation Loc) const;
+
//===--------------------------------------------------------------------===//
// Line Table Manipulation Routines
//===--------------------------------------------------------------------===//
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h b/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h
index 2f0ad9f..d21bda7 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h
@@ -54,6 +54,7 @@ namespace clang {
TST_typeofType,
TST_typeofExpr,
TST_decltype, // C++0x decltype
+ TST_underlyingType, // __underlying_type for C++0x
TST_auto, // C++0x auto
TST_unknown_anytype, // __unknown_anytype extension
TST_error // erroneous type
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td b/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td
index 15ac760..03f4cc3 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td
@@ -146,3 +146,5 @@ def SEHTryStmt : Stmt;
def SEHExceptStmt : Stmt;
def SEHFinallyStmt : Stmt;
+// OpenCL Extensions.
+def AsTypeExpr : DStmt<Expr>;
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h b/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h
index b830bf2..76006d4 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h
@@ -368,11 +368,14 @@ public:
ConstraintInfo *OutputConstraints,
unsigned NumOutputs, unsigned &Index) const;
- virtual std::string convertConstraint(const char Constraint) const {
+ // Constraint parm will be left pointing at the last character of
+ // the constraint. In practice, it won't be changed unless the
+ // constraint is longer than one character.
+ virtual std::string convertConstraint(const char *&Constraint) const {
// 'p' defaults to 'r', but can be overridden by targets.
- if (Constraint == 'p')
+ if (*Constraint == 'p')
return std::string("r");
- return std::string(1, Constraint);
+ return std::string(1, *Constraint);
}
// Returns a string of target-specific clobbers, in LLVM format.
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def b/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def
index f9d1f4e..dfba7ee 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def
+++ b/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def
@@ -346,6 +346,10 @@ KEYWORD(__is_polymorphic , KEYCXX)
KEYWORD(__is_trivial , KEYCXX)
KEYWORD(__is_union , KEYCXX)
+// Clang-only C++ Type Traits
+KEYWORD(__is_trivially_copyable , KEYCXX)
+KEYWORD(__underlying_type , KEYCXX)
+
// Embarcadero Expression Traits
KEYWORD(__is_lvalue_expr , KEYCXX)
KEYWORD(__is_rvalue_expr , KEYCXX)
@@ -409,6 +413,7 @@ KEYWORD(__read_write , KEYOPENCL)
ALIAS("read_only", __read_only , KEYOPENCL)
ALIAS("write_only", __write_only , KEYOPENCL)
ALIAS("read_write", __read_write , KEYOPENCL)
+KEYWORD(__builtin_astype , KEYOPENCL)
// Borland Extensions.
KEYWORD(__pascal , KEYALL)
@@ -451,6 +456,8 @@ KEYWORD(__except , KEYMS | KEYBORLAND)
KEYWORD(__finally , KEYMS | KEYBORLAND)
KEYWORD(__leave , KEYMS | KEYBORLAND)
KEYWORD(__int64 , KEYMS)
+KEYWORD(__if_exists , KEYMS)
+KEYWORD(__if_not_exists , KEYMS)
ALIAS("__int8" , char , KEYMS)
ALIAS("__int16" , short , KEYMS)
ALIAS("__int32" , int , KEYMS)
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h b/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h
index 4a2a2c6..a7a45bd 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h
+++ b/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h
@@ -23,7 +23,7 @@ namespace clang {
UTT_HasNothrowConstructor,
UTT_HasTrivialAssign,
UTT_HasTrivialCopy,
- UTT_HasTrivialConstructor,
+ UTT_HasTrivialDefaultConstructor,
UTT_HasTrivialDestructor,
UTT_HasVirtualDestructor,
UTT_IsAbstract,
@@ -54,6 +54,7 @@ namespace clang {
UTT_IsSigned,
UTT_IsStandardLayout,
UTT_IsTrivial,
+ UTT_IsTriviallyCopyable,
UTT_IsUnion,
UTT_IsUnsigned,
UTT_IsVoid,
diff --git a/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td b/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td
index 6d6c7c7..b3da122 100644
--- a/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td
+++ b/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td
@@ -75,6 +75,7 @@ class Inst <string n, string p, string t, Op o> {
string Types = t;
Op Operand = o;
bit isShift = 0;
+ bit isVCVT_N = 0;
}
// Used to generate Builtins.def:
@@ -297,11 +298,13 @@ def VGET_LOW : Inst<"vget_low", "dk", "csilhfUcUsUiUlPcPs", OP_LO>;
def VCVT_S32 : SInst<"vcvt_s32", "xd", "fQf">;
def VCVT_U32 : SInst<"vcvt_u32", "ud", "fQf">;
def VCVT_F16 : SInst<"vcvt_f16", "hk", "f">;
-def VCVT_N_S32 : SInst<"vcvt_n_s32", "xdi", "fQf">;
-def VCVT_N_U32 : SInst<"vcvt_n_u32", "udi", "fQf">;
def VCVT_F32 : SInst<"vcvt_f32", "fd", "iUiQiQUi">;
def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "fd", "h">;
+let isVCVT_N = 1 in {
+def VCVT_N_S32 : SInst<"vcvt_n_s32", "xdi", "fQf">;
+def VCVT_N_U32 : SInst<"vcvt_n_u32", "udi", "fQf">;
def VCVT_N_F32 : SInst<"vcvt_n_f32", "fdi", "iUiQiQUi">;
+}
def VMOVN : IInst<"vmovn", "hk", "silUsUiUl">;
def VMOVL : SInst<"vmovl", "wd", "csiUcUsUi">;
def VQMOVN : SInst<"vqmovn", "hk", "silUsUiUl">;
diff --git a/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td b/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td
index 2643c4f..b1067b7 100644
--- a/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td
+++ b/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td
@@ -77,3 +77,6 @@ def relax_all : Flag<"-relax-all">,
def no_exec_stack : Flag<"--noexecstack">,
HelpText<"Mark the file as not needing an executable stack">;
+
+def fatal_warnings : Flag<"--fatal-warnings">,
+ HelpText<"Consider warnings as errors">;
diff --git a/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td b/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td
index 258ae15..2c35ea1 100644
--- a/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td
+++ b/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td
@@ -140,6 +140,9 @@ def femit_coverage_notes : Flag<"-femit-coverage-notes">,
HelpText<"Emit a gcov coverage notes file when compiling.">;
def femit_coverage_data: Flag<"-femit-coverage-data">,
HelpText<"Instrument the program to emit gcov coverage data when run.">;
+def coverage_file : Separate<"-coverage-file">,
+ HelpText<"Emit coverage data to this filename. The extension will be replaced.">;
+def coverage_file_EQ : Joined<"-coverage-file=">, Alias<coverage_file>;
def relaxed_aliasing : Flag<"-relaxed-aliasing">,
HelpText<"Turn off Type Based Alias Analysis">;
def masm_verbose : Flag<"-masm-verbose">,
@@ -178,6 +181,8 @@ def mconstructor_aliases : Flag<"-mconstructor-aliases">,
HelpText<"Emit complete constructors and destructors as aliases when possible">;
def mms_bitfields : Flag<"-mms-bitfields">,
HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard.">;
+def mstackrealign : Flag<"-mstackrealign">,
+ HelpText<"Force realign the stack at entry to every function.">;
def O : Joined<"-O">, HelpText<"Optimization level">;
def Os : Flag<"-Os">, HelpText<"Optimize for size">;
def Oz : Flag<"-Oz">, HelpText<"Optimize for size, regardless of performance">;
@@ -211,6 +216,8 @@ def diagnostic_log_file : Separate<"-diagnostic-log-file">,
HelpText<"Filename (or -) to log diagnostics to">;
def fno_show_column : Flag<"-fno-show-column">,
HelpText<"Do not include column number on diagnostics">;
+def fshow_column : Flag<"-fshow-column">,
+ HelpText<"Include column number on diagnostics">;
def fno_show_source_location : Flag<"-fno-show-source-location">,
HelpText<"Do not include source location information with diagnostics">;
def fshow_overloads_EQ : Joined<"-fshow-overloads=">,
@@ -240,6 +247,8 @@ def fdiagnostics_show_name : Flag<"-fdiagnostics-show-name">,
HelpText<"Print diagnostic name">;
def fdiagnostics_show_option : Flag<"-fdiagnostics-show-option">,
HelpText<"Print option name with mappable diagnostics">;
+def fdiagnostics_format : Separate<"-fdiagnostics-format">,
+ HelpText<"Change diagnostic formatting to match IDE and command line tools">;
def fdiagnostics_show_category : Separate<"-fdiagnostics-show-category">,
HelpText<"Print diagnostic category">;
def fdiagnostics_show_note_include_stack :
@@ -414,6 +423,8 @@ def fno_assume_sane_operator_new : Flag<"-fno-assume-sane-operator-new">,
HelpText<"Don't assume that C++'s global operator new can't alias any pointer">;
def fgnu_keywords : Flag<"-fgnu-keywords">,
HelpText<"Allow GNU-extension keywords regardless of language standard">;
+def fgnu89_inline : Flag<"-fgnu89-inline">,
+ HelpText<"Use the gnu89 inline semantics">;
def fno_gnu_keywords : Flag<"-fno-gnu-keywords">,
HelpText<"Disallow GNU-extension keywords regardless of language standard">;
def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">,
@@ -484,6 +495,8 @@ def print_ivar_layout : Flag<"-print-ivar-layout">,
HelpText<"Enable Objective-C Ivar layout bitmap print trace">;
def fobjc_nonfragile_abi : Flag<"-fobjc-nonfragile-abi">,
HelpText<"enable objective-c's nonfragile abi">;
+def fobjc_infer_related_result_type : Flag<"-fobjc-infer-related-result-type">,
+ HelpText<"infer Objective-C related result type based on method family">;
def ftrapv : Flag<"-ftrapv">,
HelpText<"Trap on integer overflow">;
def ftrapv_handler : Separate<"-ftrapv-handler">,
diff --git a/contrib/llvm/tools/clang/include/clang/Driver/Options.td b/contrib/llvm/tools/clang/include/clang/Driver/Options.td
index 2cff623..456aa56 100644
--- a/contrib/llvm/tools/clang/include/clang/Driver/Options.td
+++ b/contrib/llvm/tools/clang/include/clang/Driver/Options.td
@@ -238,8 +238,8 @@ def emit_llvm : Flag<"-emit-llvm">,
def exported__symbols__list : Separate<"-exported_symbols_list">;
def e : JoinedOrSeparate<"-e">;
def fPIC : Flag<"-fPIC">, Group<f_Group>;
-def fPIE : Flag<"-fPIE">, Group<f_Group>;
-def fno_PIE : Flag<"-fno-PIE">, Group<f_Group>;
+def fPIE : Flag<"-fPIE">, Group<f_Group>, Flags<[NoArgumentUnused]>;
+def fno_PIE : Flag<"-fno-PIE">, Group<f_Group>, Flags<[NoArgumentUnused]>;
def faccess_control : Flag<"-faccess-control">, Group<f_Group>;
def fallow_unsupported : Flag<"-fallow-unsupported">, Group<f_Group>;
def fapple_kext : Flag<"-fapple-kext">, Group<f_Group>;
@@ -278,6 +278,7 @@ def fdiagnostics_parseable_fixits : Flag<"-fdiagnostics-parseable-fixits">, Grou
def fdiagnostics_show_option : Flag<"-fdiagnostics-show-option">, Group<f_Group>;
def fdiagnostics_show_name : Flag<"-fdiagnostics-show-name">, Group<f_Group>;
def fdiagnostics_show_note_include_stack : Flag<"-fdiagnostics-show-note-include-stack">, Group<f_Group>;
+def fdiagnostics_format_EQ : Joined<"-fdiagnostics-format=">, Group<f_clang_Group>;
def fdiagnostics_show_category_EQ : Joined<"-fdiagnostics-show-category=">, Group<f_clang_Group>;
def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">, Group<f_Group>;
def fdwarf2_cfi_asm : Flag<"-fdwarf2-cfi-asm">, Group<f_Group>;
@@ -299,6 +300,8 @@ def fno_for_scope : Flag<"-fno-for-scope">, Group<f_Group>;
def ffreestanding : Flag<"-ffreestanding">, Group<f_Group>;
def fformat_extensions: Flag<"-fformat-extensions">;
def fgnu_keywords : Flag<"-fgnu-keywords">, Group<f_Group>;
+def fgnu89_inline : Flag<"-fgnu89-inline">, Group<f_Group>;
+def fno_gnu89_inline : Flag<"-fno-gnu89-inline">, Group<f_Group>;
def fgnu_runtime : Flag<"-fgnu-runtime">, Group<f_Group>;
def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">;
def filelist : Separate<"-filelist">, Flags<[LinkerInput]>;
@@ -390,6 +393,10 @@ def fobjc_gc_only : Flag<"-fobjc-gc-only">, Group<f_Group>;
def fobjc_gc : Flag<"-fobjc-gc">, Group<f_Group>;
def fobjc_legacy_dispatch : Flag<"-fobjc-legacy-dispatch">, Group<f_Group>;
def fobjc_new_property : Flag<"-fobjc-new-property">, Group<clang_ignored_f_Group>;
+def fobjc_infer_related_result_type : Flag<"-fobjc-infer-related-result-type">,
+ Group<f_Group>;
+def fno_objc_infer_related_result_type : Flag<
+ "-fno-objc-infer-related-result-type">, Group<f_Group>;
// Objective-C ABI options.
def fobjc_abi_version_EQ : Joined<"-fobjc-abi-version=">, Group<f_Group>;
@@ -407,8 +414,8 @@ def foutput_class_dir_EQ : Joined<"-foutput-class-dir=">, Group<f_Group>;
def fpascal_strings : Flag<"-fpascal-strings">, Group<f_Group>;
def fpch_preprocess : Flag<"-fpch-preprocess">, Group<f_Group>;
def fpic : Flag<"-fpic">, Group<f_Group>;
-def fpie : Flag<"-fpie">, Group<f_Group>;
-def fno_pie : Flag<"-fno-pie">, Group<f_Group>;
+def fpie : Flag<"-fpie">, Group<f_Group>, Flags<[NoArgumentUnused]>;
+def fno_pie : Flag<"-fno-pie">, Group<f_Group>, Flags<[NoArgumentUnused]>;
def fprofile_arcs : Flag<"-fprofile-arcs">, Group<f_Group>;
def fprofile_generate : Flag<"-fprofile-generate">, Group<f_Group>;
def framework : Separate<"-framework">, Flags<[LinkerInput]>;
@@ -419,6 +426,7 @@ def fshort_enums : Flag<"-fshort-enums">, Group<f_Group>;
def freorder_blocks : Flag<"-freorder-blocks">, Group<clang_ignored_f_Group>;
def fshort_wchar : Flag<"-fshort-wchar">, Group<f_Group>;
def fshow_overloads_EQ : Joined<"-fshow-overloads=">, Group<f_Group>;
+def fshow_column : Flag<"-fshow-column">, Group<f_Group>;
def fshow_source_location : Flag<"-fshow-source-location">, Group<f_Group>;
def fspell_checking : Flag<"-fspell-checking">, Group<f_Group>;
def fsigned_bitfields : Flag<"-fsigned-bitfields">, Group<f_Group>;
@@ -514,6 +522,7 @@ def mlinker_version_EQ : Joined<"-mlinker-version=">, Flags<[NoForward]>;
def mllvm : Separate<"-mllvm">;
def mmacosx_version_min_EQ : Joined<"-mmacosx-version-min=">, Group<m_Group>;
def mms_bitfields : Flag<"-mms-bitfields">, Group<m_Group>;
+def mstackrealign : Flag<"-mstackrealign">, Group<m_Group>;
def mmmx : Flag<"-mmmx">, Group<m_x86_Features_Group>;
def mno_3dnowa : Flag<"-mno-3dnowa">, Group<m_x86_Features_Group>;
def mno_3dnow : Flag<"-mno-3dnow">, Group<m_x86_Features_Group>;
diff --git a/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h b/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h
index da6949f..626d54c 100644
--- a/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h
+++ b/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h
@@ -157,7 +157,7 @@ public:
virtual bool SupportsProfiling() const { return true; }
/// Does this tool chain support Objective-C garbage collection.
- virtual bool SupportsObjCGC() const { return false; }
+ virtual bool SupportsObjCGC() const { return true; }
/// UseDwarfDebugFlags - Embed the compile options to clang into the Dwarf
/// compile unit information.
diff --git a/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h b/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h
index 57c59d9..339297e 100644
--- a/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h
+++ b/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h
@@ -51,6 +51,7 @@ class HeaderSearch;
class Preprocessor;
class SourceManager;
class TargetInfo;
+class ASTFrontendAction;
using namespace idx;
@@ -248,6 +249,10 @@ private:
/// \brief Whether we should be caching code-completion results.
bool ShouldCacheCodeCompletionResults;
+ /// \brief Whether we want to include nested macro instantiations in the
+ /// detailed preprocessing record.
+ bool NestedMacroInstantiations;
+
static void ConfigureDiags(llvm::IntrusiveRefCntPtr<Diagnostic> &Diags,
const char **ArgBegin, const char **ArgEnd,
ASTUnit &AST, bool CaptureDiagnostics);
@@ -574,6 +579,21 @@ private:
public:
+ /// \brief Create an ASTUnit from a source file, via a CompilerInvocation
+ /// object, by invoking the optionally provided ASTFrontendAction.
+ ///
+ /// \param CI - The compiler invocation to use; it must have exactly one input
+ /// source file. The ASTUnit takes ownership of the CompilerInvocation object.
+ ///
+ /// \param Diags - The diagnostics engine to use for reporting errors; its
+ /// lifetime is expected to extend past that of the returned ASTUnit.
+ ///
+ /// \param Action - The ASTFrontendAction to invoke. Its ownership is not
+ /// transfered.
+ static ASTUnit *LoadFromCompilerInvocationAction(CompilerInvocation *CI,
+ llvm::IntrusiveRefCntPtr<Diagnostic> Diags,
+ ASTFrontendAction *Action = 0);
+
/// LoadFromCompilerInvocation - Create an ASTUnit from a source file, via a
/// CompilerInvocation object.
///
@@ -591,7 +611,8 @@ public:
bool CaptureDiagnostics = false,
bool PrecompilePreamble = false,
bool CompleteTranslationUnit = true,
- bool CacheCodeCompletionResults = false);
+ bool CacheCodeCompletionResults = false,
+ bool NestedMacroInstantiations = true);
/// LoadFromCommandLine - Create an ASTUnit from a vector of command line
/// arguments, which must specify exactly one source file.
@@ -620,7 +641,8 @@ public:
bool CompleteTranslationUnit = true,
bool CacheCodeCompletionResults = false,
bool CXXPrecompilePreamble = false,
- bool CXXChainedPCH = false);
+ bool CXXChainedPCH = false,
+ bool NestedMacroInstantiations = true);
/// \brief Reparse the source files using the same command-line options that
/// were originally used to produce this translation unit.
diff --git a/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h b/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h
index 8bef6a3..1c686c7 100644
--- a/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h
+++ b/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h
@@ -95,6 +95,10 @@ public:
/// The code model to use (-mcmodel).
std::string CodeModel;
+ /// The filename with path we use for coverage files. The extension will be
+ /// replaced.
+ std::string CoverageFile;
+
/// Enable additional debugging information.
std::string DebugPass;
diff --git a/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h b/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h
index ff92058..56093c3 100644
--- a/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h
+++ b/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h
@@ -37,6 +37,10 @@ public:
unsigned ShowNoteIncludeStack : 1; /// Show include stacks for notes.
unsigned ShowCategories : 2; /// Show categories: 0 -> none, 1 -> Number,
/// 2 -> Full Name.
+
+ unsigned Format : 2; /// Format for diagnostics:
+ enum TextDiagnosticFormat { Clang, Msvc, Vi };
+
unsigned ShowColors : 1; /// Show diagnostics with ANSI color sequences.
unsigned ShowOverloads : 1; /// Overload candidates to show. Values from
/// Diagnostic::OverloadsShown
@@ -86,6 +90,7 @@ public:
ShowNames = 0;
ShowOptionNames = 0;
ShowCategories = 0;
+ Format = Clang;
ShowSourceRanges = 0;
ShowParseableFixits = 0;
VerifyDiagnostics = 0;
diff --git a/contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h b/contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h
index 74ca519..ea37bdd 100644
--- a/contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h
+++ b/contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h
@@ -18,14 +18,15 @@ namespace frontend {
enum LangFeatures {
BCPLComment = (1 << 0),
- C99 = (1 << 1),
- C1X = (1 << 2),
- CPlusPlus = (1 << 3),
- CPlusPlus0x = (1 << 4),
- Digraphs = (1 << 5),
- GNUMode = (1 << 6),
- HexFloat = (1 << 7),
- ImplicitInt = (1 << 8)
+ C89 = (1 << 1),
+ C99 = (1 << 2),
+ C1X = (1 << 3),
+ CPlusPlus = (1 << 4),
+ CPlusPlus0x = (1 << 5),
+ Digraphs = (1 << 6),
+ GNUMode = (1 << 7),
+ HexFloat = (1 << 8),
+ ImplicitInt = (1 << 9)
};
}
@@ -54,6 +55,9 @@ public:
/// hasBCPLComments - Language supports '//' comments.
bool hasBCPLComments() const { return Flags & frontend::BCPLComment; }
+ /// isC89 - Language is a superset of C89.
+ bool isC89() const { return Flags & frontend::C89; }
+
/// isC99 - Language is a superset of C99.
bool isC99() const { return Flags & frontend::C99; }
diff --git a/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def b/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def
index 586e5c8..6055ad5 100644
--- a/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def
+++ b/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def
@@ -22,21 +22,21 @@
// C89-ish modes.
LANGSTANDARD(c89, "c89",
"ISO C 1990",
- ImplicitInt)
+ C89 | ImplicitInt)
LANGSTANDARD(c90, "c90",
"ISO C 1990",
- ImplicitInt)
+ C89 | ImplicitInt)
LANGSTANDARD(iso9899_1990, "iso9899:1990",
"ISO C 1990",
- ImplicitInt)
+ C89 | ImplicitInt)
LANGSTANDARD(c94, "iso9899:199409",
"ISO C 1990 with amendment 1",
- Digraphs | ImplicitInt)
+ C89 | Digraphs | ImplicitInt)
LANGSTANDARD(gnu89, "gnu89",
"ISO C 1990 with GNU extensions",
- BCPLComment | Digraphs | GNUMode | ImplicitInt)
+ BCPLComment | C89 | Digraphs | GNUMode | ImplicitInt)
// C99-ish modes
LANGSTANDARD(c99, "c99",
@@ -87,7 +87,6 @@ LANGSTANDARD(gnucxx0x, "gnu++0x",
BCPLComment | CPlusPlus | CPlusPlus0x | Digraphs | GNUMode)
// OpenCL
-
LANGSTANDARD(opencl, "cl",
"OpenCL 1.0",
BCPLComment | C99 | Digraphs | HexFloat)
diff --git a/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOptions.h b/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOptions.h
index e875ec1..e471c5c 100644
--- a/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOptions.h
+++ b/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOptions.h
@@ -41,6 +41,10 @@ public:
/// record of all macro definitions and
/// instantiations.
+ /// \brief Whether the detailed preprocessing record includes nested macro
+ /// instantiations.
+ unsigned DetailedRecordIncludesNestedMacroInstantiations : 1;
+
/// The implicit PCH included at the start of the translation unit, or empty.
std::string ImplicitPCHInclude;
@@ -136,6 +140,7 @@ public:
public:
PreprocessorOptions() : UsePredefines(true), DetailedRecord(false),
+ DetailedRecordIncludesNestedMacroInstantiations(true),
DisablePCHValidation(false), DisableStatCache(false),
DumpDeserializedPCHDecls(false),
PrecompiledPreambleBytes(0, true),
diff --git a/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h b/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h
index e499716..3c34c2d 100644
--- a/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h
+++ b/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h
@@ -71,9 +71,6 @@ void ProcessWarningOptions(Diagnostic &Diags, const DiagnosticOptions &Opts);
void DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream* OS,
const PreprocessorOutputOptions &Opts);
-/// CheckDiagnostics - Gather the expected diagnostics and check them.
-bool CheckDiagnostics(Preprocessor &PP);
-
/// AttachDependencyFileGen - Create a dependency file generator, and attach
/// it to the given preprocessor. This takes ownership of the output stream.
void AttachDependencyFileGen(Preprocessor &PP,
diff --git a/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h b/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h
index fec4dad..5e36d8e 100644
--- a/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h
+++ b/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h
@@ -31,6 +31,9 @@ struct HeaderFileInfo {
/// isImport - True if this is a #import'd or #pragma once file.
unsigned isImport : 1;
+ /// isPragmaOnce - True if this is #pragma once file.
+ unsigned isPragmaOnce : 1;
+
/// DirInfo - Keep track of whether this is a system header, and if so,
/// whether it is C++ clean or not. This can be set by the include paths or
/// by #pragma gcc system_header. This is an instance of
@@ -66,8 +69,8 @@ struct HeaderFileInfo {
const IdentifierInfo *ControllingMacro;
HeaderFileInfo()
- : isImport(false), DirInfo(SrcMgr::C_User), External(false),
- Resolved(false), NumIncludes(0), ControllingMacroID(0),
+ : isImport(false), isPragmaOnce(false), DirInfo(SrcMgr::C_User),
+ External(false), Resolved(false), NumIncludes(0), ControllingMacroID(0),
ControllingMacro(0) {}
/// \brief Retrieve the controlling macro for this header file, if
@@ -77,7 +80,8 @@ struct HeaderFileInfo {
/// \brief Determine whether this is a non-default header file info, e.g.,
/// it corresponds to an actual header we've included or tried to include.
bool isNonDefault() const {
- return isImport || NumIncludes || ControllingMacro || ControllingMacroID;
+ return isImport || isPragmaOnce || NumIncludes || ControllingMacro ||
+ ControllingMacroID;
}
};
@@ -101,11 +105,12 @@ class HeaderSearch {
FileManager &FileMgr;
/// #include search path information. Requests for #include "x" search the
/// directory of the #including file first, then each directory in SearchDirs
- /// consequtively. Requests for <x> search the current dir first, then each
- /// directory in SearchDirs, starting at SystemDirIdx, consequtively. If
+ /// consecutively. Requests for <x> search the current dir first, then each
+ /// directory in SearchDirs, starting at AngledDirIdx, consecutively. If
/// NoCurDirSearch is true, then the check for the file in the current
/// directory is suppressed.
std::vector<DirectoryLookup> SearchDirs;
+ unsigned AngledDirIdx;
unsigned SystemDirIdx;
bool NoCurDirSearch;
@@ -156,8 +161,12 @@ public:
/// SetSearchPaths - Interface for setting the file search paths.
///
void SetSearchPaths(const std::vector<DirectoryLookup> &dirs,
- unsigned systemDirIdx, bool noCurDirSearch) {
+ unsigned angledDirIdx, unsigned systemDirIdx,
+ bool noCurDirSearch) {
+ assert(angledDirIdx <= systemDirIdx && systemDirIdx <= dirs.size() &&
+ "Directory indicies are unordered");
SearchDirs = dirs;
+ AngledDirIdx = angledDirIdx;
SystemDirIdx = systemDirIdx;
NoCurDirSearch = noCurDirSearch;
//LookupFileCache.clear();
@@ -242,7 +251,9 @@ public:
/// MarkFileIncludeOnce - Mark the specified file as a "once only" file, e.g.
/// due to #pragma once.
void MarkFileIncludeOnce(const FileEntry *File) {
- getFileInfo(File).isImport = true;
+ HeaderFileInfo &FI = getFileInfo(File);
+ FI.isImport = true;
+ FI.isPragmaOnce = true;
}
/// MarkFileSystemHeader - Mark the specified file as a system header, e.g.
@@ -265,6 +276,13 @@ public:
getFileInfo(File).ControllingMacro = ControllingMacro;
}
+ /// \brief Determine whether this file is intended to be safe from
+ /// multiple inclusions, e.g., it has #pragma once or a controlling
+ /// macro.
+ ///
+ /// This routine does not consider the effect of #import
+ bool isFileMultipleIncludeGuarded(const FileEntry *File);
+
/// CreateHeaderMap - This method returns a HeaderMap for the specified
/// FileEntry, uniquing them through the the 'HeaderMaps' datastructure.
const HeaderMap *CreateHeaderMap(const FileEntry *FE);
@@ -285,6 +303,20 @@ public:
search_dir_iterator search_dir_end() const { return SearchDirs.end(); }
unsigned search_dir_size() const { return SearchDirs.size(); }
+ search_dir_iterator quoted_dir_begin() const {
+ return SearchDirs.begin();
+ }
+ search_dir_iterator quoted_dir_end() const {
+ return SearchDirs.begin() + AngledDirIdx;
+ }
+
+ search_dir_iterator angled_dir_begin() const {
+ return SearchDirs.begin() + AngledDirIdx;
+ }
+ search_dir_iterator angled_dir_end() const {
+ return SearchDirs.begin() + SystemDirIdx;
+ }
+
search_dir_iterator system_dir_begin() const {
return SearchDirs.begin() + SystemDirIdx;
}
diff --git a/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h b/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h
index dcaf445..ec3d9c5 100644
--- a/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h
+++ b/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h
@@ -156,7 +156,9 @@ public:
StringLiteralParser(const Token *StringToks, unsigned NumStringToks,
const SourceManager &sm, const LangOptions &features,
const TargetInfo &target, Diagnostic *diags = 0)
- : SM(sm), Features(features), Target(target), Diags(diags) {
+ : SM(sm), Features(features), Target(target), Diags(diags),
+ MaxTokenLength(0), SizeBound(0), wchar_tByteWidth(0),
+ ResultPtr(ResultBuf.data()), hadError(false), AnyWide(false), Pascal(false) {
init(StringToks, NumStringToks);
}
@@ -165,8 +167,8 @@ public:
bool AnyWide;
bool Pascal;
- const char *GetString() { return &ResultBuf[0]; }
- unsigned GetStringLength() const { return ResultPtr-&ResultBuf[0]; }
+ const char *GetString() { return ResultBuf.data(); }
+ unsigned GetStringLength() const { return ResultPtr-ResultBuf.data(); }
unsigned GetNumStringChars() const {
if (AnyWide)
diff --git a/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h b/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h
index 7be8455..e498e9d 100644
--- a/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h
+++ b/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h
@@ -258,6 +258,10 @@ namespace clang {
/// including the various preprocessing directives processed, macros
/// instantiated, etc.
class PreprocessingRecord : public PPCallbacks {
+ /// \brief Whether we should include nested macro instantiations in
+ /// the preprocessing record.
+ bool IncludeNestedMacroInstantiations;
+
/// \brief Allocator used to store preprocessing objects.
llvm::BumpPtrAllocator BumpAlloc;
@@ -281,7 +285,8 @@ namespace clang {
void MaybeLoadPreallocatedEntities() const ;
public:
- PreprocessingRecord();
+ /// \brief Construct
+ explicit PreprocessingRecord(bool IncludeNestedMacroInstantiations);
/// \brief Allocate memory in the preprocessing record.
void *Allocate(unsigned Size, unsigned Align = 8) {
@@ -291,6 +296,10 @@ namespace clang {
/// \brief Deallocate memory in the preprocessing record.
void Deallocate(void *Ptr) { }
+ size_t getTotalMemory() const {
+ return BumpAlloc.getTotalMemory();
+ }
+
// Iteration over the preprocessed entities.
typedef std::vector<PreprocessedEntity *>::iterator iterator;
typedef std::vector<PreprocessedEntity *>::const_iterator const_iterator;
diff --git a/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h b/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h
index 616507a..76e3f59 100644
--- a/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h
+++ b/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h
@@ -84,6 +84,7 @@ class Preprocessor : public llvm::RefCountedBase<Preprocessor> {
IdentifierInfo *Ident_Pragma, *Ident__pragma; // _Pragma, __pragma
IdentifierInfo *Ident__VA_ARGS__; // __VA_ARGS__
IdentifierInfo *Ident__has_feature; // __has_feature
+ IdentifierInfo *Ident__has_extension; // __has_extension
IdentifierInfo *Ident__has_builtin; // __has_builtin
IdentifierInfo *Ident__has_attribute; // __has_attribute
IdentifierInfo *Ident__has_include; // __has_include
@@ -441,7 +442,7 @@ public:
/// \brief Create a new preprocessing record, which will keep track of
/// all macro expansions, macro definitions, etc.
- void createPreprocessingRecord();
+ void createPreprocessingRecord(bool IncludeNestedMacroInstantiations);
/// EnterMainSourceFile - Enter the specified FileID as the main source file,
/// which implicitly adds the builtin defines etc.
diff --git a/contrib/llvm/tools/clang/include/clang/Parse/Parser.h b/contrib/llvm/tools/clang/include/clang/Parse/Parser.h
index 3fd9844..e4cdc27 100644
--- a/contrib/llvm/tools/clang/include/clang/Parse/Parser.h
+++ b/contrib/llvm/tools/clang/include/clang/Parse/Parser.h
@@ -580,6 +580,18 @@ private:
/// ExitScope - Pop a scope off the scope stack.
void ExitScope();
+ /// \brief RAII object used to modify the scope flags for the current scope.
+ class ParseScopeFlags {
+ Scope *CurScope;
+ unsigned OldFlags;
+ ParseScopeFlags(const ParseScopeFlags &); // do not implement
+ void operator=(const ParseScopeFlags &); // do not implement
+
+ public:
+ ParseScopeFlags(Parser *Self, unsigned ScopeFlags, bool ManageFlags = true);
+ ~ParseScopeFlags();
+ };
+
//===--------------------------------------------------------------------===//
// Diagnostic Emission and Error recovery.
@@ -621,8 +633,8 @@ private:
/// - function bodies
/// - default arguments
/// - exception-specifications (TODO: C++0x)
- /// - and brace-or-equal-initializers (TODO: C++0x)
- /// for non-static data members (including such things in nested classes)."
+ /// - and brace-or-equal-initializers for non-static data members
+ /// (including such things in nested classes)."
/// LateParsedDeclarations build the tree of those elements so they can
/// be parsed after parsing the top-level class.
class LateParsedDeclaration {
@@ -630,6 +642,7 @@ private:
virtual ~LateParsedDeclaration();
virtual void ParseLexedMethodDeclarations();
+ virtual void ParseLexedMemberInitializers();
virtual void ParseLexedMethodDefs();
};
@@ -641,6 +654,7 @@ private:
virtual ~LateParsedClass();
virtual void ParseLexedMethodDeclarations();
+ virtual void ParseLexedMemberInitializers();
virtual void ParseLexedMethodDefs();
private:
@@ -714,6 +728,25 @@ private:
llvm::SmallVector<LateParsedDefaultArgument, 8> DefaultArgs;
};
+ /// LateParsedMemberInitializer - An initializer for a non-static class data
+ /// member whose parsing must to be delayed until the class is completely
+ /// defined (C++11 [class.mem]p2).
+ struct LateParsedMemberInitializer : public LateParsedDeclaration {
+ LateParsedMemberInitializer(Parser *P, Decl *FD)
+ : Self(P), Field(FD) { }
+
+ virtual void ParseLexedMemberInitializers();
+
+ Parser *Self;
+
+ /// Field - The field declaration.
+ Decl *Field;
+
+ /// CachedTokens - The sequence of tokens that comprises the initializer,
+ /// including any leading '='.
+ CachedTokens Toks;
+ };
+
/// LateParsedDeclarationsContainer - During parsing of a top (non-nested)
/// C++ class, its method declarations that contain parts that won't be
/// parsed until after the definition is completed (C++ [class.mem]p2),
@@ -973,11 +1006,14 @@ private:
Decl *ParseCXXInlineMethodDef(AccessSpecifier AS, ParsingDeclarator &D,
const ParsedTemplateInfo &TemplateInfo,
- const VirtSpecifiers& VS);
+ const VirtSpecifiers& VS, ExprResult& Init);
+ void ParseCXXNonStaticMemberInitializer(Decl *VarD);
void ParseLexedMethodDeclarations(ParsingClass &Class);
void ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM);
void ParseLexedMethodDefs(ParsingClass &Class);
void ParseLexedMethodDef(LexedMethod &LM);
+ void ParseLexedMemberInitializers(ParsingClass &Class);
+ void ParseLexedMemberInitializer(LateParsedMemberInitializer &MI);
bool ConsumeAndStoreUntil(tok::TokenKind T1,
CachedTokens &Toks,
bool StopAtSemi = true,
@@ -1000,7 +1036,7 @@ private:
DeclGroupPtrTy ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
ParsingDeclSpec *DS = 0);
- bool isDeclarationAfterDeclarator() const;
+ bool isDeclarationAfterDeclarator();
bool isStartOfFunctionDefinition(const ParsingDeclarator &Declarator);
DeclGroupPtrTy ParseDeclarationOrFunctionDefinition(ParsedAttributes &attrs,
AccessSpecifier AS = AS_none);
@@ -1308,7 +1344,12 @@ private:
StmtResult ParseReturnStatement(ParsedAttributes &Attr);
StmtResult ParseAsmStatement(bool &msAsm);
StmtResult FuzzyParseMicrosoftAsmStatement(SourceLocation AsmLoc);
- bool ParseAsmOperandsOpt(llvm::SmallVectorImpl<IdentifierInfo *> &Names,
+ bool ParseMicrosoftIfExistsCondition(bool& Result);
+ void ParseMicrosoftIfExistsStatement(StmtVector &Stmts);
+ void ParseMicrosoftIfExistsExternalDeclaration();
+ void ParseMicrosoftIfExistsClassDeclaration(DeclSpec::TST TagType,
+ AccessSpecifier& CurAS);
+bool ParseAsmOperandsOpt(llvm::SmallVectorImpl<IdentifierInfo *> &Names,
llvm::SmallVectorImpl<ExprTy *> &Constraints,
llvm::SmallVectorImpl<ExprTy *> &Exprs);
@@ -1645,6 +1686,7 @@ private:
void ParseTypeofSpecifier(DeclSpec &DS);
void ParseDecltypeSpecifier(DeclSpec &DS);
+ void ParseUnderlyingTypeSpecifier(DeclSpec &DS);
ExprResult ParseCXX0XAlignArgument(SourceLocation Start);
@@ -1714,6 +1756,12 @@ private:
Decl *ParseNamespace(unsigned Context, SourceLocation &DeclEnd,
SourceLocation InlineLoc = SourceLocation());
+ void ParseInnerNamespace(std::vector<SourceLocation>& IdentLoc,
+ std::vector<IdentifierInfo*>& Ident,
+ std::vector<SourceLocation>& NamespaceLoc,
+ unsigned int index, SourceLocation& InlineLoc,
+ SourceLocation& LBrace, ParsedAttributes& attrs,
+ SourceLocation& RBraceLoc);
Decl *ParseLinkage(ParsingDeclSpec &DS, unsigned Context);
Decl *ParseUsingDirectiveOrDeclaration(unsigned Context,
const ParsedTemplateInfo &TemplateInfo,
@@ -1743,6 +1791,8 @@ private:
bool SuppressDeclarations = false);
void ParseCXXMemberSpecification(SourceLocation StartLoc, unsigned TagType,
Decl *TagDecl);
+ ExprResult ParseCXXMemberInitializer(bool IsFunction,
+ SourceLocation &EqualLoc);
void ParseCXXClassMemberDeclaration(AccessSpecifier AS,
const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo(),
ParsingDeclRAIIObject *DiagsFromTParams = 0);
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h b/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h
index 882440b..d322180 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h
@@ -88,7 +88,10 @@ enum {
/// \brief Adjustment for KVC code pattern priorities when it doesn't look
/// like the
- CCD_ProbablyNotObjCCollection = 15
+ CCD_ProbablyNotObjCCollection = 15,
+
+ /// \brief An Objective-C method being used as a property.
+ CCD_MethodAsProperty = 2
};
/// \brief Priority value factors by which we will divide or multiply the
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h b/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h
index 708c9b2..7ce4e00 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h
@@ -249,6 +249,7 @@ public:
static const TST TST_typeofType = clang::TST_typeofType;
static const TST TST_typeofExpr = clang::TST_typeofExpr;
static const TST TST_decltype = clang::TST_decltype;
+ static const TST TST_underlyingType = clang::TST_underlyingType;
static const TST TST_auto = clang::TST_auto;
static const TST TST_unknown_anytype = clang::TST_unknown_anytype;
static const TST TST_error = clang::TST_error;
@@ -344,7 +345,8 @@ private:
void SaveStorageSpecifierAsWritten();
static bool isTypeRep(TST T) {
- return (T == TST_typename || T == TST_typeofType);
+ return (T == TST_typename || T == TST_typeofType ||
+ T == TST_underlyingType);
}
static bool isExprRep(TST T) {
return (T == TST_typeofExpr || T == TST_decltype);
@@ -462,6 +464,14 @@ public:
SourceLocation getRestrictSpecLoc() const { return TQ_restrictLoc; }
SourceLocation getVolatileSpecLoc() const { return TQ_volatileLoc; }
+ /// \brief Clear out all of the type qualifiers.
+ void ClearTypeQualifiers() {
+ TypeQualifiers = 0;
+ TQ_constLoc = SourceLocation();
+ TQ_restrictLoc = SourceLocation();
+ TQ_volatileLoc = SourceLocation();
+ }
+
// function-specifier
bool isInlineSpecified() const { return FS_inline_specified; }
SourceLocation getInlineSpecLoc() const { return FS_inlineLoc; }
@@ -1068,8 +1078,8 @@ struct DeclaratorChunk {
/// If this is an invalid location, there is no ref-qualifier.
unsigned RefQualifierLoc;
- /// \brief When ExceptionSpecType isn't EST_None, the location of the
- /// keyword introducing the spec.
+ /// \brief When ExceptionSpecType isn't EST_None or EST_Delayed, the
+ /// location of the keyword introducing the spec.
unsigned ExceptionSpecLoc;
/// ArgInfo - This is a pointer to a new[]'d array of ParamInfo objects that
@@ -1332,7 +1342,8 @@ public:
CXXCatchContext, // C++ catch exception-declaration
BlockLiteralContext, // Block literal declarator.
TemplateTypeArgContext, // Template type argument.
- AliasDeclContext // C++0x alias-declaration.
+ AliasDeclContext, // C++0x alias-declaration.
+ AliasTemplateContext // C++0x alias-declaration template.
};
private:
@@ -1474,6 +1485,7 @@ public:
case TypeNameContext:
case AliasDeclContext:
+ case AliasTemplateContext:
case PrototypeContext:
case ObjCPrototypeContext:
case TemplateParamContext:
@@ -1503,6 +1515,7 @@ public:
case TypeNameContext:
case AliasDeclContext:
+ case AliasTemplateContext:
case ObjCPrototypeContext:
case BlockLiteralContext:
case TemplateTypeArgContext:
@@ -1531,6 +1544,7 @@ public:
case CXXCatchContext:
case TypeNameContext:
case AliasDeclContext:
+ case AliasTemplateContext:
case BlockLiteralContext:
case TemplateTypeArgContext:
return false;
@@ -1602,6 +1616,29 @@ public:
DeclTypeInfo.erase(DeclTypeInfo.begin());
}
+ /// isArrayOfUnknownBound - This method returns true if the declarator
+ /// is a declarator for an array of unknown bound (looking through
+ /// parentheses).
+ bool isArrayOfUnknownBound() const {
+ for (unsigned i = 0, i_end = DeclTypeInfo.size(); i < i_end; ++i) {
+ switch (DeclTypeInfo[i].Kind) {
+ case DeclaratorChunk::Paren:
+ continue;
+ case DeclaratorChunk::Function:
+ case DeclaratorChunk::Pointer:
+ case DeclaratorChunk::Reference:
+ case DeclaratorChunk::BlockPointer:
+ case DeclaratorChunk::MemberPointer:
+ return false;
+ case DeclaratorChunk::Array:
+ return !DeclTypeInfo[i].Arr.NumElts;
+ }
+ llvm_unreachable("Invalid type chunk");
+ return false;
+ }
+ return false;
+ }
+
/// isFunctionDeclarator - This method returns true if the declarator
/// is a function declarator (looking through parentheses).
/// If true is returned, then the reference type parameter idx is
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h b/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h
index e83e5c0..5dc4438 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h
@@ -101,7 +101,8 @@ private:
/// the temporary is being created.
unsigned Location;
- /// \brief Whether the
+ /// \brief Whether the entity being initialized may end up using the
+ /// named return value optimization (NRVO).
bool NRVO;
} LocAndNRVO;
@@ -436,48 +437,21 @@ public:
class InitializationSequence {
public:
/// \brief Describes the kind of initialization sequence computed.
- ///
- /// FIXME: Much of this information is in the initialization steps... why is
- /// it duplicated here?
enum SequenceKind {
/// \brief A failed initialization sequence. The failure kind tells what
/// happened.
FailedSequence = 0,
-
+
/// \brief A dependent initialization, which could not be
/// type-checked due to the presence of dependent types or
- /// dependently-type expressions.
+ /// dependently-typed expressions.
DependentSequence,
- /// \brief A user-defined conversion sequence.
- UserDefinedConversion,
-
- /// \brief A constructor call.
- ConstructorInitialization,
-
- /// \brief A reference binding.
- ReferenceBinding,
-
- /// \brief List initialization
- ListInitialization,
-
- /// \brief Zero-initialization.
- ZeroInitialization,
-
- /// \brief No initialization required.
- NoInitialization,
-
- /// \brief Standard conversion sequence.
- StandardConversion,
-
- /// \brief C conversion sequence.
- CAssignment,
+ /// \brief A normal sequence.
+ NormalSequence,
- /// \brief String initialization
- StringInit,
-
- /// \brief Array initialization from another array (GNU C extension).
- ArrayInit
+ /// \brief A reference binding.
+ ReferenceBinding // FIXME: Still looks redundant, but complicated.
};
/// \brief Describes the kind of a particular step in an initialization
@@ -697,7 +671,10 @@ public:
void setSequenceKind(enum SequenceKind SK) { SequenceKind = SK; }
/// \brief Determine whether the initialization sequence is valid.
- operator bool() const { return SequenceKind != FailedSequence; }
+ operator bool() const { return !Failed(); }
+
+ /// \brief Determine whether the initialization sequence is invalid.
+ bool Failed() const { return SequenceKind == FailedSequence; }
typedef llvm::SmallVector<Step, 4>::const_iterator step_iterator;
step_iterator step_begin() const { return Steps.begin(); }
@@ -821,7 +798,7 @@ public:
/// \brief Determine why initialization failed.
FailureKind getFailureKind() const {
- assert(getKind() == FailedSequence && "Not an initialization failure!");
+ assert(Failed() && "Not an initialization failure!");
return Failure;
}
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h b/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h
index 400a7cc..dceed4e 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h
@@ -282,6 +282,18 @@ public:
return NamingClass != 0;
}
+ /// \brief Set whether the name lookup is triggered by a
+ /// using declaration.
+ void setUsingDeclaration(bool U) {
+ UsingDeclaration = U;
+ }
+
+ /// \brief Returns whether the name lookup is triggered by a
+ /// using declaration.
+ bool isUsingDeclaration() const {
+ return UsingDeclaration;
+ }
+
/// \brief Returns the 'naming class' for this lookup, i.e. the
/// class which was looked into to find these results.
///
@@ -603,6 +615,10 @@ private:
bool HideTags;
bool Diagnose;
+
+ /// \brief True if the lookup is triggered by a using declaration.
+ /// Necessary to handle a MSVC bug.
+ bool UsingDeclaration;
};
/// \brief Consumes visible declarations found when searching for
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/Overload.h b/contrib/llvm/tools/clang/include/clang/Sema/Overload.h
index e196e83..55931f2 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/Overload.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/Overload.h
@@ -202,8 +202,7 @@ namespace clang {
void setAsIdentityConversion();
bool isIdentityConversion() const {
- return First == ICK_Identity && Second == ICK_Identity &&
- Third == ICK_Identity;
+ return Second == ICK_Identity && Third == ICK_Identity;
}
ImplicitConversionRank getRank() const;
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/Scope.h b/contrib/llvm/tools/clang/include/clang/Sema/Scope.h
index 6588a1d..7514633 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/Scope.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/Scope.h
@@ -79,7 +79,12 @@ public:
ObjCMethodScope = 0x400,
/// SwitchScope - This is a scope that corresponds to a switch statement.
- SwitchScope = 0x800
+ SwitchScope = 0x800,
+
+ /// ThisScope - This is the scope of a struct/union/class definition,
+ /// outside of any member function definition, where 'this' is nonetheless
+ /// usable.
+ ThisScope = 0x1000
};
private:
/// The parent scope for this scope. This is null for the translation-unit
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/Sema.h b/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
index 07a14d2..6dd0d3c 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/Sema.h
@@ -312,6 +312,17 @@ public:
/// and must warn if not used. Only contains the first declaration.
llvm::SmallVector<const DeclaratorDecl*, 4> UnusedFileScopedDecls;
+ /// \brief All the delegating constructors seen so far in the file, used for
+ /// cycle detection at the end of the TU.
+ llvm::SmallVector<CXXConstructorDecl*, 4> DelegatingCtorDecls;
+
+ /// \brief All the overriding destructors seen during a class definition
+ /// (there could be multiple due to nested classes) that had their exception
+ /// spec checks delayed, plus the overridden destructor.
+ llvm::SmallVector<std::pair<const CXXDestructorDecl*,
+ const CXXDestructorDecl*>, 2>
+ DelayedDestructorExceptionSpecChecks;
+
/// \brief Callback to the parser to parse templated functions when needed.
typedef void LateTemplateParserCB(void *P, const FunctionDecl *FD);
LateTemplateParserCB *LateTemplateParser;
@@ -589,6 +600,44 @@ public:
/// A stack of expression evaluation contexts.
llvm::SmallVector<ExpressionEvaluationContextRecord, 8> ExprEvalContexts;
+ /// SpecialMemberOverloadResult - The overloading result for a special member
+ /// function.
+ ///
+ /// This is basically a wrapper around PointerIntPair. The lowest bit of the
+ /// integer is used to determine whether we have a parameter qualification
+ /// match, the second-lowest is whether we had success in resolving the
+ /// overload to a unique non-deleted function.
+ ///
+ /// The ConstParamMatch bit represents whether, when looking up a copy
+ /// constructor or assignment operator, we found a potential copy
+ /// constructor/assignment operator whose first parameter is const-qualified.
+ /// This is used for determining parameter types of other objects and is
+ /// utterly meaningless on other types of special members.
+ class SpecialMemberOverloadResult : public llvm::FastFoldingSetNode {
+ llvm::PointerIntPair<CXXMethodDecl*, 2> Pair;
+ public:
+ SpecialMemberOverloadResult(const llvm::FoldingSetNodeID &ID)
+ : FastFoldingSetNode(ID)
+ {}
+
+ CXXMethodDecl *getMethod() const { return Pair.getPointer(); }
+ void setMethod(CXXMethodDecl *MD) { Pair.setPointer(MD); }
+
+ bool hasSuccess() const { return Pair.getInt() & 0x1; }
+ void setSuccess(bool B) {
+ Pair.setInt(unsigned(B) | hasConstParamMatch() << 1);
+ }
+
+ bool hasConstParamMatch() const { return Pair.getInt() & 0x2; }
+ void setConstParamMatch(bool B) {
+ Pair.setInt(B << 1 | unsigned(hasSuccess()));
+ }
+ };
+
+ /// \brief A cache of special member function overload resolution results
+ /// for C++ records.
+ llvm::FoldingSet<SpecialMemberOverloadResult> SpecialMemberCache;
+
/// \brief Whether the code handled by Sema should be considered a
/// complete translation unit or not.
///
@@ -704,6 +753,8 @@ public:
void ActOnEndOfTranslationUnit();
+ void CheckDelegatingCtorCycles();
+
Scope *getScopeForContext(DeclContext *Ctx);
void PushFunctionScope();
@@ -795,12 +846,19 @@ public:
const PartialDiagnostic &PD);
bool RequireCompleteType(SourceLocation Loc, QualType T,
unsigned DiagID);
+ bool RequireCompleteExprType(Expr *E, const PartialDiagnostic &PD,
+ std::pair<SourceLocation,
+ PartialDiagnostic> Note);
+
QualType getElaboratedType(ElaboratedTypeKeyword Keyword,
const CXXScopeSpec &SS, QualType T);
QualType BuildTypeofExprType(Expr *E, SourceLocation Loc);
QualType BuildDecltypeType(Expr *E, SourceLocation Loc);
+ QualType BuildUnaryTransformType(QualType BaseType,
+ UnaryTransformType::UTTKind UKind,
+ SourceLocation Loc);
//===--------------------------------------------------------------------===//
// Symbol table / Decl tracking callbacks: SemaDecl.cpp.
@@ -925,7 +983,8 @@ public:
SourceLocation NameLoc,
const Token &NextToken);
- Decl *ActOnDeclarator(Scope *S, Declarator &D);
+ Decl *ActOnDeclarator(Scope *S, Declarator &D,
+ bool IsFunctionDefintion = false);
Decl *HandleDeclarator(Scope *S, Declarator &D,
MultiTemplateParamsArg TemplateParameterLists,
@@ -938,6 +997,7 @@ public:
void CheckShadow(Scope *S, VarDecl *D, const LookupResult& R);
void CheckShadow(Scope *S, VarDecl *D);
void CheckCastAlign(Expr *Op, QualType T, SourceRange TRange);
+ void CheckTypedefForVariablyModifiedType(Scope *S, TypedefNameDecl *D);
NamedDecl* ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
QualType R, TypeSourceInfo *TInfo,
LookupResult &Previous, bool &Redeclaration);
@@ -988,6 +1048,7 @@ public:
void ActOnInitializerError(Decl *Dcl);
void ActOnCXXForRangeDecl(Decl *D);
void SetDeclDeleted(Decl *dcl, SourceLocation DelLoc);
+ void SetDeclDefaulted(Decl *dcl, SourceLocation DefaultLoc);
void FinalizeDeclaration(Decl *D);
DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS,
Decl **Group,
@@ -1026,10 +1087,11 @@ public:
void ActOnPopScope(SourceLocation Loc, Scope *S);
void ActOnTranslationUnitScope(Scope *S);
- /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
- /// no declarator (e.g. "struct foo;") is parsed.
Decl *ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
DeclSpec &DS);
+ Decl *ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
+ DeclSpec &DS,
+ MultiTemplateParamsArg TemplateParams);
StmtResult ActOnVlaStmt(const DeclSpec &DS);
@@ -1041,7 +1103,7 @@ public:
RecordDecl *Record);
bool isAcceptableTagRedeclaration(const TagDecl *Previous,
- TagTypeKind NewTag,
+ TagTypeKind NewTag, bool isDefinition,
SourceLocation NewTagLoc,
const IdentifierInfo &Name);
@@ -1082,23 +1144,25 @@ public:
Declarator &D, Expr *BitfieldWidth);
FieldDecl *HandleField(Scope *S, RecordDecl *TagD, SourceLocation DeclStart,
- Declarator &D, Expr *BitfieldWidth,
+ Declarator &D, Expr *BitfieldWidth, bool HasInit,
AccessSpecifier AS);
FieldDecl *CheckFieldDecl(DeclarationName Name, QualType T,
TypeSourceInfo *TInfo,
RecordDecl *Record, SourceLocation Loc,
- bool Mutable, Expr *BitfieldWidth,
+ bool Mutable, Expr *BitfieldWidth, bool HasInit,
SourceLocation TSSL,
AccessSpecifier AS, NamedDecl *PrevDecl,
Declarator *D = 0);
enum CXXSpecialMember {
- CXXInvalid = -1,
- CXXConstructor = 0,
- CXXCopyConstructor = 1,
- CXXCopyAssignment = 2,
- CXXDestructor = 3
+ CXXDefaultConstructor,
+ CXXCopyConstructor,
+ CXXMoveConstructor,
+ CXXCopyAssignment,
+ CXXMoveAssignment,
+ CXXDestructor,
+ CXXInvalid
};
bool CheckNontrivialField(FieldDecl *FD);
void DiagnoseNontrivial(const RecordType* Record, CXXSpecialMember mem);
@@ -1283,6 +1347,8 @@ public:
QualType ResultType,
Expr *Value);
+ bool CanPerformCopyInitialization(const InitializedEntity &Entity,
+ ExprResult Init);
ExprResult PerformCopyInitialization(const InitializedEntity &Entity,
SourceLocation EqualLoc,
ExprResult Init);
@@ -1566,6 +1632,14 @@ public:
private:
bool CppLookupName(LookupResult &R, Scope *S);
+ SpecialMemberOverloadResult *LookupSpecialMember(CXXRecordDecl *D,
+ CXXSpecialMember SM,
+ bool ConstArg,
+ bool VolatileArg,
+ bool RValueThis,
+ bool ConstThis,
+ bool VolatileThis);
+
public:
/// \brief Look up a name, looking for a single declaration. Return
/// null if the results were absent, ambiguous, or overloaded.
@@ -1594,6 +1668,10 @@ public:
SourceLocation GnuLabelLoc = SourceLocation());
DeclContextLookupResult LookupConstructors(CXXRecordDecl *Class);
+ CXXConstructorDecl *LookupDefaultConstructor(CXXRecordDecl *Class);
+ CXXConstructorDecl *LookupCopyConstructor(CXXRecordDecl *Class,
+ unsigned Quals,
+ bool *ConstParam = 0);
CXXDestructorDecl *LookupDestructor(CXXRecordDecl *Class);
void ArgumentDependentLookup(DeclarationName Name, bool Operator,
@@ -1645,6 +1723,10 @@ public:
AssociatedNamespaceSet &AssociatedNamespaces,
AssociatedClassSet &AssociatedClasses);
+ void FilterLookupForScope(LookupResult &R, DeclContext *Ctx, Scope *S,
+ bool ConsiderLinkage,
+ bool ExplicitInstantiationOrSpecialization);
+
bool DiagnoseAmbiguousLookup(LookupResult &Result);
//@}
@@ -2067,7 +2149,14 @@ public:
void MarkDeclarationReferenced(SourceLocation Loc, Decl *D);
void MarkDeclarationsReferencedInType(SourceLocation Loc, QualType T);
void MarkDeclarationsReferencedInExpr(Expr *E);
-
+
+ /// \brief Figure out if an expression could be turned into a call.
+ bool isExprCallable(const Expr &E, QualType &ZeroArgCallReturnTy,
+ UnresolvedSetImpl &NonTemplateOverloads);
+ /// \brief Give notes for a set of overloads.
+ void NoteOverloads(const UnresolvedSetImpl &Overloads,
+ const SourceLocation FinalNoteLoc);
+
/// \brief Conditionally issue a diagnostic based on the current
/// evaluation context.
///
@@ -2177,8 +2266,7 @@ public:
UnaryExprOrTypeTrait ExprKind,
SourceRange R);
ExprResult CreateUnaryExprOrTypeTraitExpr(Expr *E, SourceLocation OpLoc,
- UnaryExprOrTypeTrait ExprKind,
- SourceRange R);
+ UnaryExprOrTypeTrait ExprKind);
ExprResult
ActOnUnaryExprOrTypeTraitExpr(SourceLocation OpLoc,
UnaryExprOrTypeTrait ExprKind,
@@ -2186,8 +2274,9 @@ public:
const SourceRange &ArgRange);
ExprResult CheckPlaceholderExpr(Expr *E);
- bool CheckVecStepExpr(Expr *E, SourceLocation OpLoc, SourceRange R);
+ bool CheckVecStepExpr(Expr *E);
+ bool CheckUnaryExprOrTypeTraitOperand(Expr *E, UnaryExprOrTypeTrait ExprKind);
bool CheckUnaryExprOrTypeTraitOperand(QualType type, SourceLocation OpLoc,
SourceRange R,
UnaryExprOrTypeTrait ExprKind);
@@ -2364,6 +2453,8 @@ public:
bool CheckCaseExpression(Expr *expr);
+ bool CheckMicrosoftIfExistsSymbol(CXXScopeSpec &SS, UnqualifiedId &Name);
+
//===------------------------- "Block" Extension ------------------------===//
/// ActOnBlockStart - This callback is invoked when a block literal is
@@ -2383,6 +2474,13 @@ public:
ExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
Stmt *Body, Scope *CurScope);
+ //===---------------------------- OpenCL Features -----------------------===//
+
+ /// __builtin_astype(...)
+ ExprResult ActOnAsTypeExpr(Expr *expr, ParsedType DestTy,
+ SourceLocation BuiltinLoc,
+ SourceLocation RParenLoc);
+
//===---------------------------- C++ Features --------------------------===//
// Act on C++ namespaces
@@ -2454,6 +2552,7 @@ public:
SourceLocation TypenameLoc);
Decl *ActOnAliasDeclaration(Scope *CurScope,
AccessSpecifier AS,
+ MultiTemplateParamsArg TemplateParams,
SourceLocation UsingLoc,
UnqualifiedId &Name,
TypeResult Type);
@@ -2502,6 +2601,111 @@ public:
/// constructed variable.
void FinalizeVarWithDestructor(VarDecl *VD, const RecordType *DeclInitType);
+ /// \brief Helper class that collects exception specifications for
+ /// implicitly-declared special member functions.
+ class ImplicitExceptionSpecification {
+ // Pointer to allow copying
+ ASTContext *Context;
+ // We order exception specifications thus:
+ // noexcept is the most restrictive, but is only used in C++0x.
+ // throw() comes next.
+ // Then a throw(collected exceptions)
+ // Finally no specification.
+ // throw(...) is used instead if any called function uses it.
+ //
+ // If this exception specification cannot be known yet (for instance,
+ // because this is the exception specification for a defaulted default
+ // constructor and we haven't finished parsing the deferred parts of the
+ // class yet), the C++0x standard does not specify how to behave. We
+ // record this as an 'unknown' exception specification, which overrules
+ // any other specification (even 'none', to keep this rule simple).
+ ExceptionSpecificationType ComputedEST;
+ llvm::SmallPtrSet<CanQualType, 4> ExceptionsSeen;
+ llvm::SmallVector<QualType, 4> Exceptions;
+
+ void ClearExceptions() {
+ ExceptionsSeen.clear();
+ Exceptions.clear();
+ }
+
+ public:
+ explicit ImplicitExceptionSpecification(ASTContext &Context)
+ : Context(&Context), ComputedEST(EST_BasicNoexcept) {
+ if (!Context.getLangOptions().CPlusPlus0x)
+ ComputedEST = EST_DynamicNone;
+ }
+
+ /// \brief Get the computed exception specification type.
+ ExceptionSpecificationType getExceptionSpecType() const {
+ assert(ComputedEST != EST_ComputedNoexcept &&
+ "noexcept(expr) should not be a possible result");
+ return ComputedEST;
+ }
+
+ /// \brief The number of exceptions in the exception specification.
+ unsigned size() const { return Exceptions.size(); }
+
+ /// \brief The set of exceptions in the exception specification.
+ const QualType *data() const { return Exceptions.data(); }
+
+ /// \brief Integrate another called method into the collected data.
+ void CalledDecl(CXXMethodDecl *Method);
+
+ /// \brief Integrate an invoked expression into the collected data.
+ void CalledExpr(Expr *E);
+
+ /// \brief Specify that the exception specification can't be detemined yet.
+ void SetDelayed() {
+ ClearExceptions();
+ ComputedEST = EST_Delayed;
+ }
+
+ FunctionProtoType::ExtProtoInfo getEPI() const {
+ FunctionProtoType::ExtProtoInfo EPI;
+ EPI.ExceptionSpecType = getExceptionSpecType();
+ EPI.NumExceptions = size();
+ EPI.Exceptions = data();
+ return EPI;
+ }
+ };
+
+ /// \brief Determine what sort of exception specification a defaulted
+ /// copy constructor of a class will have.
+ ImplicitExceptionSpecification
+ ComputeDefaultedDefaultCtorExceptionSpec(CXXRecordDecl *ClassDecl);
+
+ /// \brief Determine what sort of exception specification a defaulted
+ /// default constructor of a class will have, and whether the parameter
+ /// will be const.
+ std::pair<ImplicitExceptionSpecification, bool>
+ ComputeDefaultedCopyCtorExceptionSpecAndConst(CXXRecordDecl *ClassDecl);
+
+ /// \brief Determine what sort of exception specification a defautled
+ /// copy assignment operator of a class will have, and whether the
+ /// parameter will be const.
+ std::pair<ImplicitExceptionSpecification, bool>
+ ComputeDefaultedCopyAssignmentExceptionSpecAndConst(CXXRecordDecl *ClassDecl);
+
+ /// \brief Determine what sort of exception specification a defaulted
+ /// destructor of a class will have.
+ ImplicitExceptionSpecification
+ ComputeDefaultedDtorExceptionSpec(CXXRecordDecl *ClassDecl);
+
+ /// \brief Determine if a defaulted default constructor ought to be
+ /// deleted.
+ bool ShouldDeleteDefaultConstructor(CXXConstructorDecl *CD);
+
+ /// \brief Determine if a defaulted copy constructor ought to be
+ /// deleted.
+ bool ShouldDeleteCopyConstructor(CXXConstructorDecl *CD);
+
+ /// \brief Determine if a defaulted copy assignment operator ought to be
+ /// deleted.
+ bool ShouldDeleteCopyAssignmentOperator(CXXMethodDecl *MD);
+
+ /// \brief Determine if a defaulted destructor ought to be deleted.
+ bool ShouldDeleteDestructor(CXXDestructorDecl *DD);
+
/// \brief Declare the implicit default constructor for the given class.
///
/// \param ClassDecl The class declaration into which the implicit
@@ -2529,6 +2733,13 @@ public:
void DefineImplicitDestructor(SourceLocation CurrentLocation,
CXXDestructorDecl *Destructor);
+ /// \brief Build an exception spec for destructors that don't have one.
+ ///
+ /// C++11 says that user-defined destructors with no exception spec get one
+ /// that looks as if the destructor was implicitly declared.
+ void AdjustDestructorExceptionSpec(CXXRecordDecl *ClassDecl,
+ CXXDestructorDecl *Destructor);
+
/// \brief Declare all inherited constructors for the given class.
///
/// \param ClassDecl The class declaration into which the inherited
@@ -2549,8 +2760,7 @@ public:
/// DefineImplicitCopyConstructor - Checks for feasibility of
/// defining this constructor as the copy constructor.
void DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
- CXXConstructorDecl *Constructor,
- unsigned TypeQuals);
+ CXXConstructorDecl *Constructor);
/// \brief Declare the implicit copy assignment operator for the given class.
///
@@ -2587,6 +2797,10 @@ public:
ParsedType ObjectType,
bool EnteringContext);
+ // Checks that reinterpret casts don't have undefined behavior.
+ void CheckCompatibleReinterpretCast(QualType SrcType, QualType DestType,
+ bool IsDereference, SourceRange Range);
+
/// ActOnCXXNamedCast - Parse {dynamic,static,reinterpret,const}_cast's.
ExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
tok::TokenKind Kind,
@@ -2638,10 +2852,9 @@ public:
//// ActOnCXXThis - Parse 'this' pointer.
ExprResult ActOnCXXThis(SourceLocation loc);
- /// tryCaptureCXXThis - Try to capture a 'this' pointer. Returns a
- /// pointer to an instance method whose 'this' pointer is
- /// capturable, or null if this is not possible.
- CXXMethodDecl *tryCaptureCXXThis();
+ /// getAndCaptureCurrentThisType - Try to capture a 'this' pointer. Returns
+ /// the type of the 'this' pointer, or a null type if this is not possible.
+ QualType getAndCaptureCurrentThisType();
/// ActOnCXXBoolLiteral - Parse {true,false} literals.
ExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind);
@@ -2699,14 +2912,16 @@ public:
bool FindAllocationOverload(SourceLocation StartLoc, SourceRange Range,
DeclarationName Name, Expr** Args,
unsigned NumArgs, DeclContext *Ctx,
- bool AllowMissing, FunctionDecl *&Operator);
+ bool AllowMissing, FunctionDecl *&Operator,
+ bool Diagnose = true);
void DeclareGlobalNewDelete();
void DeclareGlobalAllocationFunction(DeclarationName Name, QualType Return,
QualType Argument,
bool addMallocAttr = false);
bool FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD,
- DeclarationName Name, FunctionDecl* &Operator);
+ DeclarationName Name, FunctionDecl* &Operator,
+ bool Diagnose = true);
/// ActOnCXXDelete - Parsed a C++ 'delete' expression
ExprResult ActOnCXXDelete(SourceLocation StartLoc,
@@ -2985,7 +3200,7 @@ public:
Expr **Strings,
unsigned NumStrings);
- Expr *BuildObjCEncodeExpression(SourceLocation AtLoc,
+ ExprResult BuildObjCEncodeExpression(SourceLocation AtLoc,
TypeSourceInfo *EncodedTypeInfo,
SourceLocation RParenLoc);
ExprResult BuildCXXMemberCallExpr(Expr *Exp, NamedDecl *FoundDecl,
@@ -3038,8 +3253,10 @@ public:
Declarator &D,
MultiTemplateParamsArg TemplateParameterLists,
Expr *BitfieldWidth, const VirtSpecifiers &VS,
- Expr *Init, bool IsDefinition,
- bool Deleted = false);
+ Expr *Init, bool HasDeferredInit,
+ bool IsDefinition);
+ void ActOnCXXInClassMemberInitializer(Decl *VarDecl, SourceLocation EqualLoc,
+ Expr *Init);
MemInitResult ActOnMemInitializer(Decl *ConstructorD,
Scope *S,
@@ -3143,8 +3360,9 @@ public:
void ActOnStartDelayedMemberDeclarations(Scope *S, Decl *Record);
void ActOnStartDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
void ActOnDelayedCXXMethodParameter(Scope *S, Decl *Param);
- void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
void ActOnFinishDelayedMemberDeclarations(Scope *S, Decl *Record);
+ void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
+ void ActOnFinishDelayedMemberInitializers(Decl *Record);
void MarkAsLateParsedTemplate(FunctionDecl *FD, bool Flag = true);
bool IsInsideALocalClassWithinATemplateFunction();
@@ -3170,6 +3388,12 @@ public:
StorageClass& SC);
Decl *ActOnConversionDeclarator(CXXConversionDecl *Conversion);
+ void CheckExplicitlyDefaultedMethods(CXXRecordDecl *Record);
+ void CheckExplicitlyDefaultedDefaultConstructor(CXXConstructorDecl *Ctor);
+ void CheckExplicitlyDefaultedCopyConstructor(CXXConstructorDecl *Ctor);
+ void CheckExplicitlyDefaultedCopyAssignment(CXXMethodDecl *Method);
+ void CheckExplicitlyDefaultedDestructor(CXXDestructorDecl *Dtor);
+
//===--------------------------------------------------------------------===//
// C++ Derived Classes
//
@@ -3257,12 +3481,17 @@ public:
AccessResult CheckAllocationAccess(SourceLocation OperatorLoc,
SourceRange PlacementRange,
CXXRecordDecl *NamingClass,
- DeclAccessPair FoundDecl);
+ DeclAccessPair FoundDecl,
+ bool Diagnose = true);
AccessResult CheckConstructorAccess(SourceLocation Loc,
CXXConstructorDecl *D,
const InitializedEntity &Entity,
AccessSpecifier Access,
bool IsCopyBindingRefToTemp = false);
+ AccessResult CheckConstructorAccess(SourceLocation Loc,
+ CXXConstructorDecl *D,
+ AccessSpecifier Access,
+ PartialDiagnostic PD);
AccessResult CheckDestructorAccess(SourceLocation Loc,
CXXDestructorDecl *Dtor,
const PartialDiagnostic &PDiag);
@@ -3394,7 +3623,8 @@ public:
TPC_FunctionTemplate,
TPC_ClassTemplateMember,
TPC_FriendFunctionTemplate,
- TPC_FriendFunctionTemplateDefinition
+ TPC_FriendFunctionTemplateDefinition,
+ TPC_TypeAliasTemplate
};
bool CheckTemplateParameterList(TemplateParameterList *NewParams,
@@ -3402,6 +3632,7 @@ public:
TemplateParamListContext TPC);
TemplateParameterList *
MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc,
+ SourceLocation DeclLoc,
const CXXScopeSpec &SS,
TemplateParameterList **ParamLists,
unsigned NumParamLists,
@@ -4507,7 +4738,7 @@ public:
/// types, static variables, enumerators, etc.
std::deque<PendingImplicitInstantiation> PendingLocalImplicitInstantiations;
- bool PerformPendingInstantiations(bool LocalOnly = false);
+ void PerformPendingInstantiations(bool LocalOnly = false);
TypeSourceInfo *SubstType(TypeSourceInfo *T,
const MultiLevelTemplateArgumentList &TemplateArgs,
@@ -4644,7 +4875,7 @@ public:
IdentifierInfo *AliasName, SourceLocation AliasLocation,
IdentifierInfo *ClassName, SourceLocation ClassLocation);
- void CheckForwardProtocolDeclarationForCircularDependency(
+ bool CheckForwardProtocolDeclarationForCircularDependency(
IdentifierInfo *PName,
SourceLocation &PLoc, SourceLocation PrevLoc,
const ObjCList<ObjCProtocolDecl> &PList);
@@ -4769,7 +5000,7 @@ public:
SourceLocation EndLoc, // location of the ; or {.
tok::TokenKind MethodType,
Decl *ClassDecl, ObjCDeclSpec &ReturnQT, ParsedType ReturnType,
- Selector Sel,
+ SourceLocation SelectorStartLoc, Selector Sel,
// optional arguments. The number of types/arguments is obtained
// from the Sel.getNumArgs().
ObjCArgInfo *ArgInfo,
@@ -4867,7 +5098,18 @@ public:
SourceLocation RBracLoc,
MultiExprArg Args);
-
+ /// \brief Check whether the given new method is a valid override of the
+ /// given overridden method, and set any properties that should be inherited.
+ ///
+ /// \returns True if an error occurred.
+ bool CheckObjCMethodOverride(ObjCMethodDecl *NewMethod,
+ const ObjCMethodDecl *Overridden,
+ bool IsImplementation);
+
+ /// \brief Check whether the given method overrides any methods in its class,
+ /// calling \c CheckObjCMethodOverride for each overridden method.
+ bool CheckObjCMethodOverrides(ObjCMethodDecl *NewMethod, DeclContext *DC);
+
enum PragmaOptionsAlignKind {
POAK_Native, // #pragma options align=native
POAK_Natural, // #pragma options align=natural
@@ -5289,11 +5531,24 @@ public:
/// \param Method - May be null.
/// \param [out] ReturnType - The return type of the send.
/// \return true iff there were any incompatible types.
- bool CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs, Selector Sel,
+ bool CheckMessageArgumentTypes(QualType ReceiverType,
+ Expr **Args, unsigned NumArgs, Selector Sel,
ObjCMethodDecl *Method, bool isClassMessage,
+ bool isSuperMessage,
SourceLocation lbrac, SourceLocation rbrac,
QualType &ReturnType, ExprValueKind &VK);
+ /// \brief Determine the result of a message send expression based on
+ /// the type of the receiver, the method expected to receive the message,
+ /// and the form of the message send.
+ QualType getMessageSendResultType(QualType ReceiverType,
+ ObjCMethodDecl *Method,
+ bool isClassMessage, bool isSuperMessage);
+
+ /// \brief If the given expression involves a message send to a method
+ /// with a related result type, emit a note describing what happened.
+ void EmitRelatedResultTypeNote(const Expr *E);
+
/// CheckBooleanCondition - Diagnose problems involving the use of
/// the given expression as a boolean condition (e.g. in an if
/// statement). Also performs the standard function and array
@@ -5547,7 +5802,8 @@ private:
unsigned format_idx, unsigned firstDataArg,
bool isPrintf);
- void CheckMemsetArguments(const CallExpr *Call);
+ void CheckMemsetcpymoveArguments(const CallExpr *Call,
+ const IdentifierInfo *FnName);
void CheckReturnStackAddr(Expr *RetValExp, QualType lhsType,
SourceLocation ReturnLoc);
diff --git a/contrib/llvm/tools/clang/include/clang/Sema/Template.h b/contrib/llvm/tools/clang/include/clang/Sema/Template.h
index 4d97f9b..a257772 100644
--- a/contrib/llvm/tools/clang/include/clang/Sema/Template.h
+++ b/contrib/llvm/tools/clang/include/clang/Sema/Template.h
@@ -335,9 +335,9 @@ namespace clang {
Decl *VisitLabelDecl(LabelDecl *D);
Decl *VisitNamespaceDecl(NamespaceDecl *D);
Decl *VisitNamespaceAliasDecl(NamespaceAliasDecl *D);
- Decl *VisitTypedefNameDecl(TypedefNameDecl *D, bool IsTypeAlias);
Decl *VisitTypedefDecl(TypedefDecl *D);
Decl *VisitTypeAliasDecl(TypeAliasDecl *D);
+ Decl *VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);
Decl *VisitVarDecl(VarDecl *D);
Decl *VisitAccessSpecDecl(AccessSpecDecl *D);
Decl *VisitFieldDecl(FieldDecl *D);
@@ -415,6 +415,7 @@ namespace clang {
bool SubstQualifier(const TagDecl *OldDecl,
TagDecl *NewDecl);
+ Decl *InstantiateTypedefNameDecl(TypedefNameDecl *D, bool IsTypeAlias);
ClassTemplatePartialSpecializationDecl *
InstantiateClassTemplatePartialSpecialization(
ClassTemplateDecl *ClassTemplate,
diff --git a/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h b/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h
index 1cfd458..c881b23 100644
--- a/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h
+++ b/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h
@@ -279,7 +279,9 @@ namespace clang {
/// generate the AST file.
ORIGINAL_FILE_NAME = 19,
- /// Record #20 intentionally left blank.
+ /// \brief Record code for the file ID of the original file used to
+ /// generate the AST file.
+ ORIGINAL_FILE_ID = 20,
/// \brief Record code for the version control branch and revision
/// information of the compiler used to build this AST file.
@@ -362,7 +364,15 @@ namespace clang {
FP_PRAGMA_OPTIONS = 42,
/// \brief Record code for enabled OpenCL extensions.
- OPENCL_EXTENSIONS = 43
+ OPENCL_EXTENSIONS = 43,
+
+ /// \brief The list of delegating constructor declarations.
+ DELEGATING_CTORS = 44,
+
+ /// \brief Record code for the table of offsets into the block
+ /// of file source-location information.
+ FILE_SOURCE_LOCATION_OFFSETS = 45
+
};
/// \brief Record types used within a source manager block.
@@ -504,6 +514,9 @@ namespace clang {
/// NUM_PREDEF_TYPE_IDs.
const unsigned NUM_PREDEF_TYPE_IDS = 100;
+ /// \brief The number of allowed abbreviations in bits
+ const unsigned NUM_ALLOWED_ABBREVS_SIZE = 4;
+
/// \brief Record codes for each kind of type.
///
/// These constants describe the type records that can occur within a
@@ -584,7 +597,9 @@ namespace clang {
/// \brief A SubstTemplateTypeParmPackType record.
TYPE_SUBST_TEMPLATE_TYPE_PARM_PACK = 37,
/// \brief A AutoType record.
- TYPE_AUTO = 38
+ TYPE_AUTO = 38,
+ /// \brief A UnaryTransformType record.
+ TYPE_UNARY_TRANSFORM = 39
};
/// \brief The type IDs for special types constructed by semantic
@@ -758,6 +773,8 @@ namespace clang {
DECL_NON_TYPE_TEMPLATE_PARM,
/// \brief A TemplateTemplateParmDecl record.
DECL_TEMPLATE_TEMPLATE_PARM,
+ /// \brief A TypeAliasTemplateDecl record.
+ DECL_TYPE_ALIAS_TEMPLATE,
/// \brief A StaticAssertDecl record.
DECL_STATIC_ASSERT,
/// \brief A record containing CXXBaseSpecifiers.
@@ -986,7 +1003,10 @@ namespace clang {
// CUDA
- EXPR_CUDA_KERNEL_CALL // CUDAKernelCallExpr
+ EXPR_CUDA_KERNEL_CALL, // CUDAKernelCallExpr
+
+ // OpenCL
+ EXPR_ASTYPE // An AsTypeExpr record.
};
/// \brief The kinds of designators that can occur in a
@@ -1003,6 +1023,15 @@ namespace clang {
DESIG_ARRAY_RANGE = 3
};
+ /// \brief The different kinds of data that can occur in a
+ /// CtorInitializer.
+ enum CtorInitializerType {
+ CTOR_INITIALIZER_BASE,
+ CTOR_INITIALIZER_DELEGATING,
+ CTOR_INITIALIZER_MEMBER,
+ CTOR_INITIALIZER_INDIRECT_MEMBER
+ };
+
/// @}
}
} // end namespace clang
diff --git a/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h b/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h
index da018ab..8923e2a 100644
--- a/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h
+++ b/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h
@@ -54,6 +54,7 @@ class Decl;
class DeclContext;
class NestedNameSpecifier;
class CXXBaseSpecifier;
+class CXXConstructorDecl;
class CXXCtorInitializer;
class GotoStmt;
class MacroDefinition;
@@ -256,6 +257,13 @@ private:
/// AST file.
const uint32_t *SLocOffsets;
+ /// \brief The number of source location file entries in this AST file.
+ unsigned LocalNumSLocFileEntries;
+
+ /// \brief Offsets for all of the source location file entries in the
+ /// AST file.
+ const uint32_t *SLocFileOffsets;
+
/// \brief The entire size of this module's source location offset range.
unsigned LocalSLocSize;
@@ -564,6 +572,10 @@ private:
/// generating warnings.
llvm::SmallVector<uint64_t, 16> UnusedFileScopedDecls;
+ /// \brief A list of all the delegating constructors we've seen, to diagnose
+ /// cycles.
+ llvm::SmallVector<uint64_t, 4> DelegatingCtorDecls;
+
/// \brief A snapshot of Sema's weak undeclared identifier tracking, for
/// generating warnings.
llvm::SmallVector<uint64_t, 64> WeakUndeclaredIdentifiers;
@@ -626,6 +638,10 @@ private:
/// AST file.
std::string ActualOriginalFileName;
+ /// \brief The file ID for the original file that was used to build the
+ /// primary AST file.
+ FileID OriginalFileID;
+
/// \brief The directory that the PCH was originally created in. Used to
/// allow resolving headers even after headers+PCH was moved to a new path.
std::string OriginalDir;
@@ -780,6 +796,10 @@ private:
/// \brief Reads a statement from the specified cursor.
Stmt *ReadStmtFromStream(PerFileData &F);
+ /// \brief Get a FileEntry out of stored-in-PCH filename, making sure we take
+ /// into account all the necessary relocations.
+ const FileEntry *getFileEntry(llvm::StringRef filename);
+
void MaybeAddSystemRootToFilename(std::string &Filename);
ASTReadResult ReadASTCore(llvm::StringRef FileName, ASTFileType Type);
@@ -879,6 +899,10 @@ public:
/// name.
ASTReadResult ReadAST(const std::string &FileName, ASTFileType Type);
+ /// \brief Checks that no file that is stored in PCH is out-of-sync with
+ /// the actual file in the file system.
+ ASTReadResult validateFileEntries();
+
/// \brief Set the AST callbacks listener.
void setListener(ASTReaderListener *listener) {
Listener.reset(listener);
diff --git a/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h b/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h
index 1a79b31..78a63ab 100644
--- a/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h
+++ b/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h
@@ -338,10 +338,20 @@ private:
void WriteFPPragmaOptions(const FPOptions &Opts);
void WriteOpenCLExtensions(Sema &SemaRef);
- unsigned ParmVarDeclAbbrev;
+ unsigned DeclParmVarAbbrev;
unsigned DeclContextLexicalAbbrev;
unsigned DeclContextVisibleLookupAbbrev;
unsigned UpdateVisibleAbbrev;
+ unsigned DeclRefExprAbbrev;
+ unsigned CharacterLiteralAbbrev;
+ unsigned DeclRecordAbbrev;
+ unsigned IntegerLiteralAbbrev;
+ unsigned DeclTypedefAbbrev;
+ unsigned DeclVarAbbrev;
+ unsigned DeclFieldAbbrev;
+ unsigned DeclEnumAbbrev;
+ unsigned DeclObjCIvarAbbrev;
+
void WriteDeclsBlockAbbrevs();
void WriteDecl(ASTContext &Context, Decl *D);
@@ -568,7 +578,16 @@ public:
/// \brief Retrieve the ID for the given opaque value expression.
unsigned getOpaqueValueID(OpaqueValueExpr *e);
- unsigned getParmVarDeclAbbrev() const { return ParmVarDeclAbbrev; }
+ unsigned getDeclParmVarAbbrev() const { return DeclParmVarAbbrev; }
+ unsigned getDeclRefExprAbbrev() const { return DeclRefExprAbbrev; }
+ unsigned getCharacterLiteralAbbrev() const { return CharacterLiteralAbbrev; }
+ unsigned getDeclRecordAbbrev() const { return DeclRecordAbbrev; }
+ unsigned getIntegerLiteralAbbrev() const { return IntegerLiteralAbbrev; }
+ unsigned getDeclTypedefAbbrev() const { return DeclTypedefAbbrev; }
+ unsigned getDeclVarAbbrev() const { return DeclVarAbbrev; }
+ unsigned getDeclFieldAbbrev() const { return DeclFieldAbbrev; }
+ unsigned getDeclEnumAbbrev() const { return DeclEnumAbbrev; }
+ unsigned getDeclObjCIvarAbbrev() const { return DeclObjCIvarAbbrev; }
bool hasChain() const { return Chain; }
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h
index 8c2ffc6..eb38bd8 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h
@@ -63,6 +63,24 @@ public:
}
};
+class EndOfTranslationUnit {
+ template <typename CHECKER>
+ static void _checkEndOfTranslationUnit(void *checker,
+ const TranslationUnitDecl *TU,
+ AnalysisManager& mgr,
+ BugReporter &BR) {
+ ((const CHECKER *)checker)->checkEndOfTranslationUnit(TU, mgr, BR);
+ }
+
+public:
+ template <typename CHECKER>
+ static void _register(CHECKER *checker, CheckerManager &mgr){
+ mgr._registerForEndOfTranslationUnit(
+ CheckerManager::CheckEndOfTranslationUnit(checker,
+ _checkEndOfTranslationUnit<CHECKER>));
+ }
+};
+
template <typename STMT>
class PreStmt {
template <typename CHECKER>
@@ -240,9 +258,11 @@ public:
class RegionChanges {
template <typename CHECKER>
static const GRState *_checkRegionChanges(void *checker, const GRState *state,
+ const StoreManager::InvalidatedSymbols *invalidated,
const MemRegion * const *Begin,
const MemRegion * const *End) {
- return ((const CHECKER *)checker)->checkRegionChanges(state, Begin, End);
+ return ((const CHECKER *)checker)->checkRegionChanges(state, invalidated,
+ Begin, End);
}
template <typename CHECKER>
static bool _wantsRegionChangeUpdate(void *checker, const GRState *state) {
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
index 92ec038..45d38fb 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h
@@ -18,6 +18,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/Store.h"
#include <vector>
namespace clang {
@@ -49,6 +50,18 @@ public:
template <typename T> class CheckerFn;
+template <typename RET, typename P1, typename P2, typename P3, typename P4>
+class CheckerFn<RET(P1, P2, P3, P4)> {
+ typedef RET (*Func)(void *, P1, P2, P3, P4);
+ Func Fn;
+public:
+ void *Checker;
+ CheckerFn(void *checker, Func fn) : Fn(fn), Checker(checker) { }
+ RET operator()(P1 p1, P2 p2, P3 p3, P4 p4) const {
+ return Fn(Checker, p1, p2, p3, p4);
+ }
+};
+
template <typename RET, typename P1, typename P2, typename P3>
class CheckerFn<RET(P1, P2, P3)> {
typedef RET (*Func)(void *, P1, P2, P3);
@@ -224,9 +237,11 @@ public:
bool wantsRegionChangeUpdate(const GRState *state);
/// \brief Run checkers for region changes.
- const GRState *runCheckersForRegionChanges(const GRState *state,
- const MemRegion * const *Begin,
- const MemRegion * const *End);
+ const GRState *
+ runCheckersForRegionChanges(const GRState *state,
+ const StoreManager::InvalidatedSymbols *invalidated,
+ const MemRegion * const *Begin,
+ const MemRegion * const *End);
/// \brief Run checkers for handling assumptions on symbolic values.
const GRState *runCheckersForEvalAssume(const GRState *state,
@@ -237,6 +252,11 @@ public:
const ExplodedNodeSet &Src,
const CallExpr *CE, ExprEngine &Eng,
GraphExpander *defaultEval = 0);
+
+ /// \brief Run checkers for the entire Translation Unit.
+ void runCheckersOnEndOfTranslationUnit(const TranslationUnitDecl* TU,
+ AnalysisManager &mgr,
+ BugReporter &BR);
//===----------------------------------------------------------------------===//
// Internal registration functions for AST traversing.
@@ -283,6 +303,7 @@ public:
typedef CheckerFn<void (const GRState *,SymbolReaper &)> CheckLiveSymbolsFunc;
typedef CheckerFn<const GRState * (const GRState *,
+ const StoreManager::InvalidatedSymbols *symbols,
const MemRegion * const *begin,
const MemRegion * const *end)>
CheckRegionChangesFunc;
@@ -296,6 +317,10 @@ public:
typedef CheckerFn<bool (const CallExpr *, CheckerContext &)>
EvalCallFunc;
+ typedef CheckerFn<void (const TranslationUnitDecl *,
+ AnalysisManager&, BugReporter &)>
+ CheckEndOfTranslationUnit;
+
typedef bool (*HandlesStmtFunc)(const Stmt *D);
void _registerForPreStmt(CheckStmtFunc checkfn,
HandlesStmtFunc isForStmtFn);
@@ -326,6 +351,8 @@ public:
void _registerForEvalCall(EvalCallFunc checkfn);
+ void _registerForEndOfTranslationUnit(CheckEndOfTranslationUnit checkfn);
+
//===----------------------------------------------------------------------===//
// Internal registration functions for events.
//===----------------------------------------------------------------------===//
@@ -446,6 +473,8 @@ private:
std::vector<EvalCallFunc> EvalCallCheckers;
+ std::vector<CheckEndOfTranslationUnit> EndOfTranslationUnitCheckers;
+
struct EventInfo {
llvm::SmallVector<CheckEventFunc, 4> Checkers;
bool HasDispatcher;
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
index 65fbfcc..69495be 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
@@ -108,7 +108,8 @@ public:
const llvm::APSInt &Convert(QualType T, const llvm::APSInt &From) {
assert(T->isIntegerType() || Loc::isLocType(T));
unsigned bitwidth = Ctx.getTypeSize(T);
- bool isUnsigned = T->isUnsignedIntegerType() || Loc::isLocType(T);
+ bool isUnsigned
+ = T->isUnsignedIntegerOrEnumerationType() || Loc::isLocType(T);
if (isUnsigned == From.isUnsigned() && bitwidth == From.getBitWidth())
return From;
@@ -131,13 +132,15 @@ public:
inline const llvm::APSInt& getMaxValue(QualType T) {
assert(T->isIntegerType() || Loc::isLocType(T));
- bool isUnsigned = T->isUnsignedIntegerType() || Loc::isLocType(T);
+ bool isUnsigned
+ = T->isUnsignedIntegerOrEnumerationType() || Loc::isLocType(T);
return getValue(llvm::APSInt::getMaxValue(Ctx.getTypeSize(T), isUnsigned));
}
inline const llvm::APSInt& getMinValue(QualType T) {
assert(T->isIntegerType() || Loc::isLocType(T));
- bool isUnsigned = T->isUnsignedIntegerType() || Loc::isLocType(T);
+ bool isUnsigned
+ = T->isUnsignedIntegerOrEnumerationType() || Loc::isLocType(T);
return getValue(llvm::APSInt::getMinValue(Ctx.getTypeSize(T), isUnsigned));
}
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
index 8cd743f..d24036c 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
@@ -21,6 +21,7 @@
#include "clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/TransferFuncs.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
#include "clang/AST/Type.h"
#include "clang/AST/ExprObjC.h"
@@ -188,9 +189,11 @@ public:
/// processRegionChanges - Called by GRStateManager whenever a change is made
/// to the store. Used to update checkers that track region values.
- const GRState* processRegionChanges(const GRState *state,
- const MemRegion * const *Begin,
- const MemRegion * const *End);
+ const GRState *
+ processRegionChanges(const GRState *state,
+ const StoreManager::InvalidatedSymbols *invalidated,
+ const MemRegion * const *Begin,
+ const MemRegion * const *End);
virtual GRStateManager& getStateManager() { return StateMgr; }
@@ -458,6 +461,13 @@ private:
const void *tag, bool isLoad);
bool InlineCall(ExplodedNodeSet &Dst, const CallExpr *CE, ExplodedNode *Pred);
+
+
+public:
+ /// Returns true if calling the specific function or method would possibly
+ /// cause global variables to be invalidated.
+ bool doesInvalidateGlobals(const CallOrObjCMessage &callOrMessage) const;
+
};
} // end ento namespace
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h
index a957c89..0d61d0e 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h
@@ -368,6 +368,12 @@ private:
assert(refCount > 0);
--refCount;
}
+
+ const GRState *invalidateRegionsImpl(const MemRegion * const *Begin,
+ const MemRegion * const *End,
+ const Expr *E, unsigned BlockCount,
+ StoreManager::InvalidatedSymbols &IS,
+ bool invalidateGlobals) const;
};
class GRStateSet {
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h
index 6d8fc89..734024c 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h
@@ -187,6 +187,7 @@ public:
return CallE && isa<CXXMemberCallExpr>(CallE);
}
+ SVal getFunctionCallee() const;
SVal getCXXCallee() const;
unsigned getNumArgs() const {
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
index 0f9e56a..65eabea 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
@@ -172,7 +172,7 @@ public:
nonloc::ConcreteInt makeIntVal(const IntegerLiteral* integer) {
return nonloc::ConcreteInt(
BasicVals.getValue(integer->getValue(),
- integer->getType()->isUnsignedIntegerType()));
+ integer->getType()->isUnsignedIntegerOrEnumerationType()));
}
nonloc::ConcreteInt makeBoolVal(const CXXBoolLiteralExpr *boolean) {
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h
index 21c6ae7..cdbdf64 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h
@@ -188,7 +188,7 @@ public:
const MemRegion * const *Begin,
const MemRegion * const *End,
const Expr *E, unsigned Count,
- InvalidatedSymbols *IS,
+ InvalidatedSymbols &IS,
bool invalidateGlobals,
InvalidatedRegions *Regions) = 0;
diff --git a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h
index 3d6f9fa..1f6ea3d 100644
--- a/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h
+++ b/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h
@@ -15,6 +15,7 @@
#include "clang/Analysis/ProgramPoint.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/Store.h"
namespace clang {
@@ -95,13 +96,17 @@ public:
/// processRegionChanges - Called by GRStateManager whenever a change is made
/// to the store. Used to update checkers that track region values.
- virtual const GRState* processRegionChanges(const GRState* state,
- const MemRegion* const *Begin,
- const MemRegion* const *End) = 0;
+ virtual const GRState *
+ processRegionChanges(const GRState *state,
+ const StoreManager::InvalidatedSymbols *invalidated,
+ const MemRegion* const *Begin,
+ const MemRegion* const *End) = 0;
- inline const GRState* processRegionChange(const GRState* state,
- const MemRegion* MR) {
- return processRegionChanges(state, &MR, &MR+1);
+
+ inline const GRState *
+ processRegionChange(const GRState* state,
+ const MemRegion* MR) {
+ return processRegionChanges(state, 0, &MR, &MR+1);
}
/// Called by CoreEngine when the analysis worklist is either empty or the
diff --git a/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h b/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h
deleted file mode 100644
index 6ccccd0..0000000
--- a/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//===--- Tooling.h - Framework for standalone Clang tools -------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements functions to run clang tools standalone instead
-// of running them as a plugin.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_TOOLING_TOOLING_H
-#define LLVM_CLANG_TOOLING_TOOLING_H
-
-#include "llvm/ADT/StringRef.h"
-#include <string>
-#include <vector>
-
-namespace clang {
-
-class FrontendAction;
-
-namespace tooling {
-
-/// \brief Runs (and deletes) the tool on 'Code' with the -fsynatx-only flag.
-///
-/// \param ToolAction The action to run over the code.
-/// \param Code C++ code.
-///
-/// \return - True if 'ToolAction' was successfully executed.
-bool RunSyntaxOnlyToolOnCode(
- clang::FrontendAction *ToolAction, llvm::StringRef Code);
-
-/// \brief Runs (and deletes) the tool with the given Clang flags.
-///
-/// \param ToolAction The action to run over the code.
-/// \param Argc The number of elements in Argv.
-/// \param Argv The command line arguments, including the path the binary
-/// was started with (Argv[0]).
-bool RunToolWithFlags(
- clang::FrontendAction* ToolAction, int Argc, char *Argv[]);
-
-/// \brief Converts a vector<string> into a vector<char*> suitable to pass
-/// to main-style functions taking (int Argc, char *Argv[]).
-std::vector<char*> CommandLineToArgv(const std::vector<std::string>* Command);
-
-/// \brief Specifies the working directory and command of a compilation.
-struct CompileCommand {
- /// \brief The working directory the command was executed from.
- std::string Directory;
-
- /// \brief The command line that was executed.
- std::vector<std::string> CommandLine;
-};
-
-/// \brief Looks up the compile command for 'FileName' in 'JsonDatabase'.
-///
-/// \param FileName The path to an input file for which we want the compile
-/// command line. If the 'JsonDatabase' was created by CMake, this must be
-/// an absolute path inside the CMake source directory which does not have
-/// symlinks resolved.
-///
-/// \param JsonDatabase A JSON formatted list of compile commands. This lookup
-/// command supports only a subset of the JSON standard as written by CMake.
-///
-/// \param ErrorMessage If non-empty, an error occurred and 'ErrorMessage' will
-/// be set to contain the error message. In this case CompileCommand will
-/// contain an empty directory and command line.
-///
-/// \see JsonCompileCommandLineDatabase
-CompileCommand FindCompileArgsInJsonDatabase(
- llvm::StringRef FileName, llvm::StringRef JsonDatabase,
- std::string &ErrorMessage);
-
-} // end namespace tooling
-} // end namespace clang
-
-#endif // LLVM_CLANG_TOOLING_TOOLING_H
diff --git a/contrib/llvm/tools/clang/lib/AST/APValue.cpp b/contrib/llvm/tools/clang/lib/AST/APValue.cpp
index 731d5e0..ebe99b1 100644
--- a/contrib/llvm/tools/clang/lib/AST/APValue.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/APValue.cpp
@@ -18,12 +18,12 @@ using namespace clang;
namespace {
struct LV {
- Expr* Base;
+ const Expr* Base;
CharUnits Offset;
};
}
-APValue::APValue(Expr* B) : Kind(Uninitialized) {
+APValue::APValue(const Expr* B) : Kind(Uninitialized) {
MakeLValue(); setLValue(B, CharUnits::Zero());
}
@@ -118,7 +118,7 @@ void APValue::print(llvm::raw_ostream &OS) const {
}
}
-Expr* APValue::getLValueBase() const {
+const Expr* APValue::getLValueBase() const {
assert(isLValue() && "Invalid accessor");
return ((const LV*)(const void*)Data)->Base;
}
@@ -128,7 +128,7 @@ CharUnits APValue::getLValueOffset() const {
return ((const LV*)(const void*)Data)->Offset;
}
-void APValue::setLValue(Expr *B, const CharUnits &O) {
+void APValue::setLValue(const Expr *B, const CharUnits &O) {
assert(isLValue() && "Invalid accessor");
((LV*)(char*)Data)->Base = B;
((LV*)(char*)Data)->Offset = O;
diff --git a/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp b/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp
index 8316ea6..9094aba 100644
--- a/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp
@@ -31,6 +31,7 @@
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "CXXABI.h"
+#include <map>
using namespace clang;
@@ -38,8 +39,12 @@ unsigned ASTContext::NumImplicitDefaultConstructors;
unsigned ASTContext::NumImplicitDefaultConstructorsDeclared;
unsigned ASTContext::NumImplicitCopyConstructors;
unsigned ASTContext::NumImplicitCopyConstructorsDeclared;
+unsigned ASTContext::NumImplicitMoveConstructors;
+unsigned ASTContext::NumImplicitMoveConstructorsDeclared;
unsigned ASTContext::NumImplicitCopyAssignmentOperators;
unsigned ASTContext::NumImplicitCopyAssignmentOperatorsDeclared;
+unsigned ASTContext::NumImplicitMoveAssignmentOperators;
+unsigned ASTContext::NumImplicitMoveAssignmentOperatorsDeclared;
unsigned ASTContext::NumImplicitDestructors;
unsigned ASTContext::NumImplicitDestructorsDeclared;
@@ -317,9 +322,17 @@ void ASTContext::PrintStats() const {
fprintf(stderr, " %u/%u implicit copy constructors created\n",
NumImplicitCopyConstructorsDeclared,
NumImplicitCopyConstructors);
+ if (getLangOptions().CPlusPlus)
+ fprintf(stderr, " %u/%u implicit move constructors created\n",
+ NumImplicitMoveConstructorsDeclared,
+ NumImplicitMoveConstructors);
fprintf(stderr, " %u/%u implicit copy assignment operators created\n",
NumImplicitCopyAssignmentOperatorsDeclared,
NumImplicitCopyAssignmentOperators);
+ if (getLangOptions().CPlusPlus)
+ fprintf(stderr, " %u/%u implicit move assignment operators created\n",
+ NumImplicitMoveAssignmentOperatorsDeclared,
+ NumImplicitMoveAssignmentOperators);
fprintf(stderr, " %u/%u implicit destructors created\n",
NumImplicitDestructorsDeclared, NumImplicitDestructors);
@@ -546,8 +559,28 @@ bool ASTContext::ZeroBitfieldFollowsNonBitfield(const FieldDecl *FD,
bool ASTContext::ZeroBitfieldFollowsBitfield(const FieldDecl *FD,
const FieldDecl *LastFD) const {
return (FD->isBitField() && LastFD && LastFD->isBitField() &&
- FD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue() == 0);
+ FD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue() == 0 &&
+ LastFD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue() != 0);
+
+}
+bool ASTContext::BitfieldFollowsBitfield(const FieldDecl *FD,
+ const FieldDecl *LastFD) const {
+ return (FD->isBitField() && LastFD && LastFD->isBitField() &&
+ FD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue() &&
+ LastFD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue());
+}
+
+bool ASTContext::NoneBitfieldFollowsBitfield(const FieldDecl *FD,
+ const FieldDecl *LastFD) const {
+ return (!FD->isBitField() && LastFD && LastFD->isBitField() &&
+ LastFD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue());
+}
+
+bool ASTContext::BitfieldFollowsNoneBitfield(const FieldDecl *FD,
+ const FieldDecl *LastFD) const {
+ return (FD->isBitField() && LastFD && !LastFD->isBitField() &&
+ FD->getBitWidth()-> EvaluateAsInt(*this).getZExtValue());
}
ASTContext::overridden_cxx_method_iterator
@@ -627,6 +660,10 @@ CharUnits ASTContext::getDeclAlign(const Decl *D, bool RefAsPointee) const {
UseAlignAttrOnly = true;
}
}
+ else if (isa<FieldDecl>(D))
+ UseAlignAttrOnly =
+ D->hasAttr<PackedAttr>() ||
+ cast<FieldDecl>(D)->getParent()->hasAttr<PackedAttr>();
// If we're using the align attribute only, just ignore everything
// else about the declaration and its type.
@@ -950,6 +987,9 @@ ASTContext::getTypeInfo(const Type *T) const {
return getTypeInfo(cast<DecltypeType>(T)->getUnderlyingExpr()->getType()
.getTypePtr());
+ case Type::UnaryTransform:
+ return getTypeInfo(cast<UnaryTransformType>(T)->getUnderlyingType());
+
case Type::Elaborated:
return getTypeInfo(cast<ElaboratedType>(T)->getNamedType().getTypePtr());
@@ -957,13 +997,18 @@ ASTContext::getTypeInfo(const Type *T) const {
return getTypeInfo(
cast<AttributedType>(T)->getEquivalentType().getTypePtr());
- case Type::TemplateSpecialization:
+ case Type::TemplateSpecialization: {
assert(getCanonicalType(T) != T &&
"Cannot request the size of a dependent type");
- // FIXME: this is likely to be wrong once we support template
- // aliases, since a template alias could refer to a typedef that
- // has an __aligned__ attribute on it.
- return getTypeInfo(getCanonicalType(T));
+ const TemplateSpecializationType *TST = cast<TemplateSpecializationType>(T);
+ // A type alias template specialization may refer to a typedef with the
+ // aligned attribute on it.
+ if (TST->isTypeAlias())
+ return getTypeInfo(TST->getAliasedType().getTypePtr());
+ else
+ return getTypeInfo(getCanonicalType(T));
+ }
+
}
assert(Align && (Align & (Align-1)) == 0 && "Alignment must be power of 2");
@@ -1393,6 +1438,9 @@ QualType ASTContext::getBlockPointerType(QualType T) const {
/// lvalue reference to the specified type.
QualType
ASTContext::getLValueReferenceType(QualType T, bool SpelledAsLValue) const {
+ assert(getCanonicalType(T) != OverloadTy &&
+ "Unresolved overloaded function type");
+
// Unique pointers, to guarantee there is only one pointer of a particular
// structure.
llvm::FoldingSetNodeID ID;
@@ -1572,6 +1620,7 @@ QualType ASTContext::getVariableArrayDecayedType(QualType type) const {
case Type::TypeOfExpr:
case Type::TypeOf:
case Type::Decltype:
+ case Type::UnaryTransform:
case Type::DependentName:
case Type::InjectedClassName:
case Type::TemplateSpecialization:
@@ -2235,10 +2284,10 @@ TypeSourceInfo *
ASTContext::getTemplateSpecializationTypeInfo(TemplateName Name,
SourceLocation NameLoc,
const TemplateArgumentListInfo &Args,
- QualType CanonType) const {
+ QualType Underlying) const {
assert(!Name.getAsDependentTemplateName() &&
"No dependent template names here!");
- QualType TST = getTemplateSpecializationType(Name, Args, CanonType);
+ QualType TST = getTemplateSpecializationType(Name, Args, Underlying);
TypeSourceInfo *DI = CreateTypeSourceInfo(TST);
TemplateSpecializationTypeLoc TL
@@ -2254,7 +2303,7 @@ ASTContext::getTemplateSpecializationTypeInfo(TemplateName Name,
QualType
ASTContext::getTemplateSpecializationType(TemplateName Template,
const TemplateArgumentListInfo &Args,
- QualType Canon) const {
+ QualType Underlying) const {
assert(!Template.getAsDependentTemplateName() &&
"No dependent template names here!");
@@ -2266,35 +2315,46 @@ ASTContext::getTemplateSpecializationType(TemplateName Template,
ArgVec.push_back(Args[i].getArgument());
return getTemplateSpecializationType(Template, ArgVec.data(), NumArgs,
- Canon);
+ Underlying);
}
QualType
ASTContext::getTemplateSpecializationType(TemplateName Template,
const TemplateArgument *Args,
unsigned NumArgs,
- QualType Canon) const {
+ QualType Underlying) const {
assert(!Template.getAsDependentTemplateName() &&
"No dependent template names here!");
// Look through qualified template names.
if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
Template = TemplateName(QTN->getTemplateDecl());
- if (!Canon.isNull())
- Canon = getCanonicalType(Canon);
- else
- Canon = getCanonicalTemplateSpecializationType(Template, Args, NumArgs);
+ bool isTypeAlias =
+ Template.getAsTemplateDecl() &&
+ isa<TypeAliasTemplateDecl>(Template.getAsTemplateDecl());
+
+ QualType CanonType;
+ if (!Underlying.isNull())
+ CanonType = getCanonicalType(Underlying);
+ else {
+ assert(!isTypeAlias &&
+ "Underlying type for template alias must be computed by caller");
+ CanonType = getCanonicalTemplateSpecializationType(Template, Args,
+ NumArgs);
+ }
// Allocate the (non-canonical) template specialization type, but don't
// try to unique it: these types typically have location information that
// we don't unique and don't want to lose.
- void *Mem = Allocate((sizeof(TemplateSpecializationType) +
- sizeof(TemplateArgument) * NumArgs),
+ void *Mem = Allocate(sizeof(TemplateSpecializationType) +
+ sizeof(TemplateArgument) * NumArgs +
+ (isTypeAlias ? sizeof(QualType) : 0),
TypeAlignment);
TemplateSpecializationType *Spec
= new (Mem) TemplateSpecializationType(Template,
Args, NumArgs,
- Canon);
+ CanonType,
+ isTypeAlias ? Underlying : QualType());
Types.push_back(Spec);
return QualType(Spec, 0);
@@ -2306,6 +2366,10 @@ ASTContext::getCanonicalTemplateSpecializationType(TemplateName Template,
unsigned NumArgs) const {
assert(!Template.getAsDependentTemplateName() &&
"No dependent template names here!");
+ assert((!Template.getAsTemplateDecl() ||
+ !isa<TypeAliasTemplateDecl>(Template.getAsTemplateDecl())) &&
+ "Underlying type for template alias must be computed by caller");
+
// Look through qualified template names.
if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName())
Template = TemplateName(QTN->getTemplateDecl());
@@ -2334,7 +2398,7 @@ ASTContext::getCanonicalTemplateSpecializationType(TemplateName Template,
TypeAlignment);
Spec = new (Mem) TemplateSpecializationType(CanonTemplate,
CanonArgs.data(), NumArgs,
- QualType());
+ QualType(), QualType());
Types.push_back(Spec);
TemplateSpecializationTypes.InsertNode(Spec, InsertPos);
}
@@ -2754,6 +2818,21 @@ QualType ASTContext::getDecltypeType(Expr *e) const {
return QualType(dt, 0);
}
+/// getUnaryTransformationType - We don't unique these, since the memory
+/// savings are minimal and these are rare.
+QualType ASTContext::getUnaryTransformType(QualType BaseType,
+ QualType UnderlyingType,
+ UnaryTransformType::UTTKind Kind)
+ const {
+ UnaryTransformType *Ty =
+ new (*this, TypeAlignment) UnaryTransformType (BaseType, UnderlyingType,
+ Kind,
+ UnderlyingType->isDependentType() ?
+ QualType() : UnderlyingType);
+ Types.push_back(Ty);
+ return QualType(Ty, 0);
+}
+
/// getAutoType - We only unique auto types after they've been deduced.
QualType ASTContext::getAutoType(QualType DeducedType) const {
void *InsertPos = 0;
@@ -3457,7 +3536,8 @@ QualType ASTContext::getCFConstantStringType() const {
SourceLocation(), 0,
FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
- /*Mutable=*/false);
+ /*Mutable=*/false,
+ /*HasInit=*/false);
Field->setAccess(AS_public);
CFConstantStringTypeDecl->addDecl(Field);
}
@@ -3498,7 +3578,8 @@ QualType ASTContext::getNSConstantStringType() const {
SourceLocation(), 0,
FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
- /*Mutable=*/false);
+ /*Mutable=*/false,
+ /*HasInit=*/false);
Field->setAccess(AS_public);
NSConstantStringTypeDecl->addDecl(Field);
}
@@ -3537,7 +3618,8 @@ QualType ASTContext::getObjCFastEnumerationStateType() const {
SourceLocation(), 0,
FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
- /*Mutable=*/false);
+ /*Mutable=*/false,
+ /*HasInit=*/false);
Field->setAccess(AS_public);
ObjCFastEnumerationStateTypeDecl->addDecl(Field);
}
@@ -3574,7 +3656,8 @@ QualType ASTContext::getBlockDescriptorType() const {
&Idents.get(FieldNames[i]),
FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
- /*Mutable=*/false);
+ /*Mutable=*/false,
+ /*HasInit=*/false);
Field->setAccess(AS_public);
T->addDecl(Field);
}
@@ -3622,7 +3705,8 @@ QualType ASTContext::getBlockDescriptorExtendedType() const {
&Idents.get(FieldNames[i]),
FieldTypes[i], /*TInfo=*/0,
/*BitWidth=*/0,
- /*Mutable=*/false);
+ /*Mutable=*/false,
+ /*HasInit=*/false);
Field->setAccess(AS_public);
T->addDecl(Field);
}
@@ -3650,7 +3734,7 @@ bool ASTContext::BlockRequiresCopying(QualType Ty) const {
if (getLangOptions().CPlusPlus) {
if (const RecordType *RT = Ty->getAs<RecordType>()) {
CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
- return RD->hasConstCopyConstructor(*this);
+ return RD->hasConstCopyConstructor();
}
}
@@ -3707,7 +3791,8 @@ ASTContext::BuildByRefType(llvm::StringRef DeclName, QualType Ty) const {
SourceLocation(),
&Idents.get(FieldNames[i]),
FieldTypes[i], /*TInfo=*/0,
- /*BitWidth=*/0, /*Mutable=*/false);
+ /*BitWidth=*/0, /*Mutable=*/false,
+ /*HasInit=*/false);
Field->setAccess(AS_public);
T->addDecl(Field);
}
@@ -3736,6 +3821,9 @@ static bool isTypeTypedefedAsBOOL(QualType T) {
/// getObjCEncodingTypeSize returns size of type for objective-c encoding
/// purpose.
CharUnits ASTContext::getObjCEncodingTypeSize(QualType type) const {
+ if (!type->isIncompleteArrayType() && type->isIncompleteType())
+ return CharUnits::Zero();
+
CharUnits sz = getTypeSizeInChars(type);
// Make all integer and enum types at least as large as an int
@@ -3803,7 +3891,7 @@ std::string ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr) const {
return S;
}
-void ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl,
+bool ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl,
std::string& S) {
// Encode result type.
getObjCEncodingForType(Decl->getResultType(), S);
@@ -3813,8 +3901,11 @@ void ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl,
E = Decl->param_end(); PI != E; ++PI) {
QualType PType = (*PI)->getType();
CharUnits sz = getObjCEncodingTypeSize(PType);
+ if (sz.isZero())
+ return true;
+
assert (sz.isPositive() &&
- "getObjCEncodingForMethodDecl - Incomplete param type");
+ "getObjCEncodingForFunctionDecl - Incomplete param type");
ParmOffset += sz;
}
S += charUnitsToString(ParmOffset);
@@ -3837,11 +3928,13 @@ void ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl,
S += charUnitsToString(ParmOffset);
ParmOffset += getObjCEncodingTypeSize(PType);
}
+
+ return false;
}
/// getObjCEncodingForMethodDecl - Return the encoded type for this method
/// declaration.
-void ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl,
+bool ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl,
std::string& S) const {
// FIXME: This is not very efficient.
// Encode type qualifer, 'in', 'inout', etc. for the return type.
@@ -3860,6 +3953,9 @@ void ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl,
E = Decl->sel_param_end(); PI != E; ++PI) {
QualType PType = (*PI)->getType();
CharUnits sz = getObjCEncodingTypeSize(PType);
+ if (sz.isZero())
+ return true;
+
assert (sz.isPositive() &&
"getObjCEncodingForMethodDecl - Incomplete param type");
ParmOffset += sz;
@@ -3889,6 +3985,8 @@ void ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl,
S += charUnitsToString(ParmOffset);
ParmOffset += getObjCEncodingTypeSize(PType);
}
+
+ return false;
}
/// getObjCEncodingForPropertyDecl - Return the encoded type for this
@@ -4108,7 +4206,8 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
bool ExpandStructures,
const FieldDecl *FD,
bool OutermostType,
- bool EncodingProperty) const {
+ bool EncodingProperty,
+ bool StructField) const {
if (T->getAs<BuiltinType>()) {
if (FD && FD->isBitField())
return EncodeBitField(this, S, T, FD);
@@ -4193,7 +4292,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
if (const ArrayType *AT =
// Ignore type qualifiers etc.
dyn_cast<ArrayType>(T->getCanonicalTypeInternal())) {
- if (isa<IncompleteArrayType>(AT)) {
+ if (isa<IncompleteArrayType>(AT) && !StructField) {
// Incomplete arrays are encoded as a pointer to the array element.
S += '^';
@@ -4202,11 +4301,15 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
} else {
S += '[';
- if (const ConstantArrayType *CAT = dyn_cast<ConstantArrayType>(AT))
- S += llvm::utostr(CAT->getSize().getZExtValue());
- else {
+ if (const ConstantArrayType *CAT = dyn_cast<ConstantArrayType>(AT)) {
+ if (getTypeSize(CAT->getElementType()) == 0)
+ S += '0';
+ else
+ S += llvm::utostr(CAT->getSize().getZExtValue());
+ } else {
//Variable length arrays are encoded as a regular array with 0 elements.
- assert(isa<VariableArrayType>(AT) && "Unknown array type!");
+ assert((isa<VariableArrayType>(AT) || isa<IncompleteArrayType>(AT)) &&
+ "Unknown array type!");
S += '0';
}
@@ -4244,24 +4347,30 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
}
if (ExpandStructures) {
S += '=';
- for (RecordDecl::field_iterator Field = RDecl->field_begin(),
- FieldEnd = RDecl->field_end();
- Field != FieldEnd; ++Field) {
- if (FD) {
- S += '"';
- S += Field->getNameAsString();
- S += '"';
- }
+ if (!RDecl->isUnion()) {
+ getObjCEncodingForStructureImpl(RDecl, S, FD);
+ } else {
+ for (RecordDecl::field_iterator Field = RDecl->field_begin(),
+ FieldEnd = RDecl->field_end();
+ Field != FieldEnd; ++Field) {
+ if (FD) {
+ S += '"';
+ S += Field->getNameAsString();
+ S += '"';
+ }
- // Special case bit-fields.
- if (Field->isBitField()) {
- getObjCEncodingForTypeImpl(Field->getType(), S, false, true,
- (*Field));
- } else {
- QualType qt = Field->getType();
- getLegacyIntegralTypeEncoding(qt);
- getObjCEncodingForTypeImpl(qt, S, false, true,
- FD);
+ // Special case bit-fields.
+ if (Field->isBitField()) {
+ getObjCEncodingForTypeImpl(Field->getType(), S, false, true,
+ (*Field));
+ } else {
+ QualType qt = Field->getType();
+ getLegacyIntegralTypeEncoding(qt);
+ getObjCEncodingForTypeImpl(qt, S, false, true,
+ FD, /*OutermostType*/false,
+ /*EncodingProperty*/false,
+ /*StructField*/true);
+ }
}
}
}
@@ -4382,6 +4491,135 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
assert(0 && "@encode for type not implemented!");
}
+void ASTContext::getObjCEncodingForStructureImpl(RecordDecl *RDecl,
+ std::string &S,
+ const FieldDecl *FD,
+ bool includeVBases) const {
+ assert(RDecl && "Expected non-null RecordDecl");
+ assert(!RDecl->isUnion() && "Should not be called for unions");
+ if (!RDecl->getDefinition())
+ return;
+
+ CXXRecordDecl *CXXRec = dyn_cast<CXXRecordDecl>(RDecl);
+ std::multimap<uint64_t, NamedDecl *> FieldOrBaseOffsets;
+ const ASTRecordLayout &layout = getASTRecordLayout(RDecl);
+
+ if (CXXRec) {
+ for (CXXRecordDecl::base_class_iterator
+ BI = CXXRec->bases_begin(),
+ BE = CXXRec->bases_end(); BI != BE; ++BI) {
+ if (!BI->isVirtual()) {
+ CXXRecordDecl *base = BI->getType()->getAsCXXRecordDecl();
+ uint64_t offs = layout.getBaseClassOffsetInBits(base);
+ FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
+ std::make_pair(offs, base));
+ }
+ }
+ }
+
+ unsigned i = 0;
+ for (RecordDecl::field_iterator Field = RDecl->field_begin(),
+ FieldEnd = RDecl->field_end();
+ Field != FieldEnd; ++Field, ++i) {
+ uint64_t offs = layout.getFieldOffset(i);
+ FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
+ std::make_pair(offs, *Field));
+ }
+
+ if (CXXRec && includeVBases) {
+ for (CXXRecordDecl::base_class_iterator
+ BI = CXXRec->vbases_begin(),
+ BE = CXXRec->vbases_end(); BI != BE; ++BI) {
+ CXXRecordDecl *base = BI->getType()->getAsCXXRecordDecl();
+ uint64_t offs = layout.getVBaseClassOffsetInBits(base);
+ FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
+ std::make_pair(offs, base));
+ }
+ }
+
+ CharUnits size;
+ if (CXXRec) {
+ size = includeVBases ? layout.getSize() : layout.getNonVirtualSize();
+ } else {
+ size = layout.getSize();
+ }
+
+ uint64_t CurOffs = 0;
+ std::multimap<uint64_t, NamedDecl *>::iterator
+ CurLayObj = FieldOrBaseOffsets.begin();
+
+ if (CurLayObj != FieldOrBaseOffsets.end() && CurLayObj->first != 0) {
+ assert(CXXRec && CXXRec->isDynamicClass() &&
+ "Offset 0 was empty but no VTable ?");
+ if (FD) {
+ S += "\"_vptr$";
+ std::string recname = CXXRec->getNameAsString();
+ if (recname.empty()) recname = "?";
+ S += recname;
+ S += '"';
+ }
+ S += "^^?";
+ CurOffs += getTypeSize(VoidPtrTy);
+ }
+
+ if (!RDecl->hasFlexibleArrayMember()) {
+ // Mark the end of the structure.
+ uint64_t offs = toBits(size);
+ FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
+ std::make_pair(offs, (NamedDecl*)0));
+ }
+
+ for (; CurLayObj != FieldOrBaseOffsets.end(); ++CurLayObj) {
+ assert(CurOffs <= CurLayObj->first);
+
+ if (CurOffs < CurLayObj->first) {
+ uint64_t padding = CurLayObj->first - CurOffs;
+ // FIXME: There doesn't seem to be a way to indicate in the encoding that
+ // packing/alignment of members is different that normal, in which case
+ // the encoding will be out-of-sync with the real layout.
+ // If the runtime switches to just consider the size of types without
+ // taking into account alignment, we could make padding explicit in the
+ // encoding (e.g. using arrays of chars). The encoding strings would be
+ // longer then though.
+ CurOffs += padding;
+ }
+
+ NamedDecl *dcl = CurLayObj->second;
+ if (dcl == 0)
+ break; // reached end of structure.
+
+ if (CXXRecordDecl *base = dyn_cast<CXXRecordDecl>(dcl)) {
+ // We expand the bases without their virtual bases since those are going
+ // in the initial structure. Note that this differs from gcc which
+ // expands virtual bases each time one is encountered in the hierarchy,
+ // making the encoding type bigger than it really is.
+ getObjCEncodingForStructureImpl(base, S, FD, /*includeVBases*/false);
+ if (!base->isEmpty())
+ CurOffs += toBits(getASTRecordLayout(base).getNonVirtualSize());
+ } else {
+ FieldDecl *field = cast<FieldDecl>(dcl);
+ if (FD) {
+ S += '"';
+ S += field->getNameAsString();
+ S += '"';
+ }
+
+ if (field->isBitField()) {
+ EncodeBitField(this, S, field->getType(), field);
+ CurOffs += field->getBitWidth()->EvaluateAsInt(*this).getZExtValue();
+ } else {
+ QualType qt = field->getType();
+ getLegacyIntegralTypeEncoding(qt);
+ getObjCEncodingForTypeImpl(qt, S, false, true, FD,
+ /*OutermostType*/false,
+ /*EncodingProperty*/false,
+ /*StructField*/true);
+ CurOffs += getTypeSize(field->getType());
+ }
+ }
+ }
+}
+
void ASTContext::getObjCEncodingForTypeQualifier(Decl::ObjCDeclQualifier QT,
std::string& S) const {
if (QT & Decl::OBJC_TQ_In)
@@ -6068,7 +6306,7 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
// Forward declarations aren't required.
- if (!FD->isThisDeclarationADefinition())
+ if (!FD->doesThisDeclarationHaveABody())
return false;
// Constructors and destructors are required.
@@ -6105,10 +6343,13 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
// Structs that have non-trivial constructors or destructors are required.
// FIXME: Handle references.
+ // FIXME: Be more selective about which constructors we care about.
if (const RecordType *RT = VD->getType()->getAs<RecordType>()) {
if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(RT->getDecl())) {
- if (RD->hasDefinition() &&
- (!RD->hasTrivialConstructor() || !RD->hasTrivialDestructor()))
+ if (RD->hasDefinition() && !(RD->hasTrivialDefaultConstructor() &&
+ RD->hasTrivialCopyConstructor() &&
+ RD->hasTrivialMoveConstructor() &&
+ RD->hasTrivialDestructor()))
return true;
}
}
diff --git a/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp b/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp
index 897b4a4..16d2f85 100644
--- a/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp
@@ -56,9 +56,11 @@ static QualType Desugar(ASTContext &Context, QualType QT, bool &ShouldAKA) {
continue;
}
- // Don't desugar template specializations.
- if (isa<TemplateSpecializationType>(Ty))
- break;
+ // Don't desugar template specializations, unless it's an alias template.
+ if (const TemplateSpecializationType *TST
+ = dyn_cast<TemplateSpecializationType>(Ty))
+ if (!TST->isTypeAlias())
+ break;
// Don't desugar magic Objective-C types.
if (QualType(Ty,0) == Context.getObjCIdType() ||
diff --git a/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp b/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp
index dc881ba..100e604 100644
--- a/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp
@@ -64,6 +64,7 @@ namespace {
// FIXME: DependentTypeOfExprType
QualType VisitTypeOfType(const TypeOfType *T);
QualType VisitDecltypeType(const DecltypeType *T);
+ QualType VisitUnaryTransformType(const UnaryTransformType *T);
QualType VisitAutoType(const AutoType *T);
// FIXME: DependentDecltypeType
QualType VisitRecordType(const RecordType *T);
@@ -604,7 +605,14 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
cast<TypeOfType>(T2)->getUnderlyingType()))
return false;
break;
-
+
+ case Type::UnaryTransform:
+ if (!IsStructurallyEquivalent(Context,
+ cast<UnaryTransformType>(T1)->getUnderlyingType(),
+ cast<UnaryTransformType>(T1)->getUnderlyingType()))
+ return false;
+ break;
+
case Type::Decltype:
if (!IsStructurallyEquivalent(Context,
cast<DecltypeType>(T1)->getUnderlyingExpr(),
@@ -1572,6 +1580,17 @@ QualType ASTNodeImporter::VisitDecltypeType(const DecltypeType *T) {
return Importer.getToContext().getDecltypeType(ToExpr);
}
+QualType ASTNodeImporter::VisitUnaryTransformType(const UnaryTransformType *T) {
+ QualType ToBaseType = Importer.Import(T->getBaseType());
+ QualType ToUnderlyingType = Importer.Import(T->getUnderlyingType());
+ if (ToBaseType.isNull() || ToUnderlyingType.isNull())
+ return QualType();
+
+ return Importer.getToContext().getUnaryTransformType(ToBaseType,
+ ToUnderlyingType,
+ T->getUTTKind());
+}
+
QualType ASTNodeImporter::VisitAutoType(const AutoType *T) {
// FIXME: Make sure that the "to" context supports C++0x!
QualType FromDeduced = T->getDeducedType();
@@ -2493,9 +2512,12 @@ Decl *ASTNodeImporter::VisitFieldDecl(FieldDecl *D) {
FieldDecl *ToField = FieldDecl::Create(Importer.getToContext(), DC,
Importer.Import(D->getInnerLocStart()),
Loc, Name.getAsIdentifierInfo(),
- T, TInfo, BitWidth, D->isMutable());
+ T, TInfo, BitWidth, D->isMutable(),
+ D->hasInClassInitializer());
ToField->setAccess(D->getAccess());
ToField->setLexicalDeclContext(LexicalDC);
+ if (ToField->hasInClassInitializer())
+ ToField->setInClassInitializer(D->getInClassInitializer());
Importer.Imported(D, ToField);
LexicalDC->addDecl(ToField);
return ToField;
@@ -2851,7 +2873,8 @@ Decl *ASTNodeImporter::VisitObjCMethodDecl(ObjCMethodDecl *D) {
D->isVariadic(),
D->isSynthesized(),
D->isDefined(),
- D->getImplementationControl());
+ D->getImplementationControl(),
+ D->hasRelatedResultType());
// FIXME: When we decide to merge method definitions, we'll need to
// deal with implicit parameters.
diff --git a/contrib/llvm/tools/clang/lib/AST/Decl.cpp b/contrib/llvm/tools/clang/lib/AST/Decl.cpp
index b21ba9a..12357c0 100644
--- a/contrib/llvm/tools/clang/lib/AST/Decl.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/Decl.cpp
@@ -1422,6 +1422,31 @@ bool FunctionDecl::hasBody(const FunctionDecl *&Definition) const {
return false;
}
+bool FunctionDecl::hasTrivialBody() const
+{
+ Stmt *S = getBody();
+ if (!S) {
+ // Since we don't have a body for this function, we don't know if it's
+ // trivial or not.
+ return false;
+ }
+
+ if (isa<CompoundStmt>(S) && cast<CompoundStmt>(S)->body_empty())
+ return true;
+ return false;
+}
+
+bool FunctionDecl::isDefined(const FunctionDecl *&Definition) const {
+ for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) {
+ if (I->IsDeleted || I->IsDefaulted || I->Body || I->IsLateTemplateParsed) {
+ Definition = I->IsDeleted ? I->getCanonicalDecl() : *I;
+ return true;
+ }
+ }
+
+ return false;
+}
+
Stmt *FunctionDecl::getBody(const FunctionDecl *&Definition) const {
for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) {
if (I->Body) {
@@ -1450,10 +1475,34 @@ void FunctionDecl::setPure(bool P) {
}
bool FunctionDecl::isMain() const {
- ASTContext &Context = getASTContext();
- return !Context.getLangOptions().Freestanding &&
- getDeclContext()->getRedeclContext()->isTranslationUnit() &&
- getIdentifier() && getIdentifier()->isStr("main");
+ const TranslationUnitDecl *tunit =
+ dyn_cast<TranslationUnitDecl>(getDeclContext()->getRedeclContext());
+ return tunit &&
+ !tunit->getASTContext().getLangOptions().Freestanding &&
+ getIdentifier() &&
+ getIdentifier()->isStr("main");
+}
+
+bool FunctionDecl::isReservedGlobalPlacementOperator() const {
+ assert(getDeclName().getNameKind() == DeclarationName::CXXOperatorName);
+ assert(getDeclName().getCXXOverloadedOperator() == OO_New ||
+ getDeclName().getCXXOverloadedOperator() == OO_Delete ||
+ getDeclName().getCXXOverloadedOperator() == OO_Array_New ||
+ getDeclName().getCXXOverloadedOperator() == OO_Array_Delete);
+
+ if (isa<CXXRecordDecl>(getDeclContext())) return false;
+ assert(getDeclContext()->getRedeclContext()->isTranslationUnit());
+
+ const FunctionProtoType *proto = getType()->castAs<FunctionProtoType>();
+ if (proto->getNumArgs() != 2 || proto->isVariadic()) return false;
+
+ ASTContext &Context =
+ cast<TranslationUnitDecl>(getDeclContext()->getRedeclContext())
+ ->getASTContext();
+
+ // The result type and first argument type are constant across all
+ // these operators. The second argument must be exactly void*.
+ return (proto->getArgType(1).getCanonicalType() == Context.VoidPtrTy);
}
bool FunctionDecl::isExternC() const {
@@ -1690,11 +1739,11 @@ bool FunctionDecl::isInlined() const {
/// an externally visible symbol, but "extern inline" will not create an
/// externally visible symbol.
bool FunctionDecl::isInlineDefinitionExternallyVisible() const {
- assert(isThisDeclarationADefinition() && "Must have the function definition");
+ assert(doesThisDeclarationHaveABody() && "Must have the function definition");
assert(isInlined() && "Function must be inline");
ASTContext &Context = getASTContext();
- if (!Context.getLangOptions().C99 || hasAttr<GNUInlineAttr>()) {
+ if (Context.getLangOptions().GNUInline || hasAttr<GNUInlineAttr>()) {
// If it's not the case that both 'inline' and 'extern' are
// specified on the definition, then this inline definition is
// externally visible.
@@ -2028,9 +2077,10 @@ SourceRange FunctionDecl::getSourceRange() const {
FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
SourceLocation StartLoc, SourceLocation IdLoc,
IdentifierInfo *Id, QualType T,
- TypeSourceInfo *TInfo, Expr *BW, bool Mutable) {
+ TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
+ bool HasInit) {
return new (C) FieldDecl(Decl::Field, DC, StartLoc, IdLoc, Id, T, TInfo,
- BW, Mutable);
+ BW, Mutable, HasInit);
}
bool FieldDecl::isAnonymousStructOrUnion() const {
@@ -2059,8 +2109,7 @@ unsigned FieldDecl::getFieldIndex() const {
if (IsMsStruct) {
// Zero-length bitfields following non-bitfield members are ignored.
- if (getASTContext().ZeroBitfieldFollowsNonBitfield((*i), LastFD) ||
- getASTContext().ZeroBitfieldFollowsBitfield((*i), LastFD)) {
+ if (getASTContext().ZeroBitfieldFollowsNonBitfield((*i), LastFD)) {
++i;
continue;
}
@@ -2076,10 +2125,17 @@ unsigned FieldDecl::getFieldIndex() const {
SourceRange FieldDecl::getSourceRange() const {
if (isBitField())
- return SourceRange(getInnerLocStart(), BitWidth->getLocEnd());
+ return SourceRange(getInnerLocStart(), getBitWidth()->getLocEnd());
return DeclaratorDecl::getSourceRange();
}
+void FieldDecl::setInClassInitializer(Expr *Init) {
+ assert(!InitializerOrBitWidth.getPointer() &&
+ "bit width or initializer already set");
+ InitializerOrBitWidth.setPointer(Init);
+ InitializerOrBitWidth.setInt(0);
+}
+
//===----------------------------------------------------------------------===//
// TagDecl Implementation
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp b/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp
index 6d517c5..1766d39 100644
--- a/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp
@@ -439,6 +439,7 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) {
case Typedef:
case TypeAlias:
+ case TypeAliasTemplate:
case UnresolvedUsingTypename:
case TemplateTypeParm:
return IDNS_Ordinary | IDNS_Type;
@@ -1165,10 +1166,10 @@ void DeclContext::makeDeclVisibleInContextImpl(NamedDecl *D) {
if (!D->getDeclName())
return;
- // FIXME: This feels like a hack. Should DeclarationName support
- // template-ids, or is there a better way to keep specializations
- // from being visible?
- if (isa<ClassTemplateSpecializationDecl>(D) || D->isTemplateParameter())
+ // Skip entities that can't be found by name lookup into a particular
+ // context.
+ if ((D->getIdentifierNamespace() == 0 && !isa<UsingDirectiveDecl>(D)) ||
+ D->isTemplateParameter())
return;
ASTContext *C = 0;
diff --git a/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp b/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp
index 9099cd5..08ac2a5 100644
--- a/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp
@@ -29,19 +29,21 @@ using namespace clang;
CXXRecordDecl::DefinitionData::DefinitionData(CXXRecordDecl *D)
: UserDeclaredConstructor(false), UserDeclaredCopyConstructor(false),
- UserDeclaredCopyAssignment(false), UserDeclaredDestructor(false),
+ UserDeclaredMoveConstructor(false), UserDeclaredCopyAssignment(false),
+ UserDeclaredMoveAssignment(false), UserDeclaredDestructor(false),
Aggregate(true), PlainOldData(true), Empty(true), Polymorphic(false),
Abstract(false), IsStandardLayout(true), HasNoNonEmptyBases(true),
HasPrivateFields(false), HasProtectedFields(false), HasPublicFields(false),
- HasTrivialConstructor(true), HasConstExprNonCopyMoveConstructor(false),
- HasTrivialCopyConstructor(true), HasTrivialMoveConstructor(true),
- HasTrivialCopyAssignment(true), HasTrivialMoveAssignment(true),
- HasTrivialDestructor(true), HasNonLiteralTypeFieldsOrBases(false),
- ComputedVisibleConversions(false),
- DeclaredDefaultConstructor(false), DeclaredCopyConstructor(false),
- DeclaredCopyAssignment(false), DeclaredDestructor(false),
- NumBases(0), NumVBases(0), Bases(), VBases(),
- Definition(D), FirstFriend(0) {
+ HasMutableFields(false), HasTrivialDefaultConstructor(true),
+ HasConstExprNonCopyMoveConstructor(false), HasTrivialCopyConstructor(true),
+ HasTrivialMoveConstructor(true), HasTrivialCopyAssignment(true),
+ HasTrivialMoveAssignment(true), HasTrivialDestructor(true),
+ HasNonLiteralTypeFieldsOrBases(false), ComputedVisibleConversions(false),
+ UserProvidedDefaultConstructor(false), DeclaredDefaultConstructor(false),
+ DeclaredCopyConstructor(false), DeclaredMoveConstructor(false),
+ DeclaredCopyAssignment(false), DeclaredMoveAssignment(false),
+ DeclaredDestructor(false), NumBases(0), NumVBases(0), Bases(), VBases(),
+ Definition(D), FirstFriend(0) {
}
CXXRecordDecl::CXXRecordDecl(Kind K, TagKind TK, DeclContext *DC,
@@ -165,8 +167,9 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,
data().Empty = false;
// C++ [class.ctor]p5:
- // A constructor is trivial if its class has no virtual base classes.
- data().HasTrivialConstructor = false;
+ // A default constructor is trivial [...] if:
+ // -- its class has [...] no virtual bases
+ data().HasTrivialDefaultConstructor = false;
// C++0x [class.copy]p13:
// A copy/move constructor for class X is trivial if it is neither
@@ -188,10 +191,11 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,
data().IsStandardLayout = false;
} else {
// C++ [class.ctor]p5:
- // A constructor is trivial if all the direct base classes of its
- // class have trivial constructors.
- if (!BaseClassDecl->hasTrivialConstructor())
- data().HasTrivialConstructor = false;
+ // A default constructor is trivial [...] if:
+ // -- all the direct base classes of its class have trivial default
+ // constructors.
+ if (!BaseClassDecl->hasTrivialDefaultConstructor())
+ data().HasTrivialDefaultConstructor = false;
// C++0x [class.copy]p13:
// A copy/move constructor for class X is trivial if [...]
@@ -223,6 +227,10 @@ CXXRecordDecl::setBases(CXXBaseSpecifier const * const *Bases,
// have trivial destructors.
if (!BaseClassDecl->hasTrivialDestructor())
data().HasTrivialDestructor = false;
+
+ // Keep track of the presence of mutable fields.
+ if (BaseClassDecl->hasMutableFields())
+ data().HasMutableFields = true;
}
if (VBases.empty())
@@ -262,8 +270,8 @@ bool CXXRecordDecl::hasAnyDependentBases() const {
return !forallBases(SawBase, 0);
}
-bool CXXRecordDecl::hasConstCopyConstructor(const ASTContext &Context) const {
- return getCopyConstructor(Context, Qualifiers::Const) != 0;
+bool CXXRecordDecl::hasConstCopyConstructor() const {
+ return getCopyConstructor(Qualifiers::Const) != 0;
}
bool CXXRecordDecl::isTriviallyCopyable() const {
@@ -306,8 +314,8 @@ GetBestOverloadCandidateSimple(
return Cands[Best].first;
}
-CXXConstructorDecl *CXXRecordDecl::getCopyConstructor(const ASTContext &Context,
- unsigned TypeQuals) const{
+CXXConstructorDecl *CXXRecordDecl::getCopyConstructor(unsigned TypeQuals) const{
+ ASTContext &Context = getASTContext();
QualType ClassType
= Context.getTypeDeclType(const_cast<CXXRecordDecl*>(this));
DeclarationName ConstructorName
@@ -337,6 +345,14 @@ CXXConstructorDecl *CXXRecordDecl::getCopyConstructor(const ASTContext &Context,
GetBestOverloadCandidateSimple(Found));
}
+CXXConstructorDecl *CXXRecordDecl::getMoveConstructor() const {
+ for (ctor_iterator I = ctor_begin(), E = ctor_end(); I != E; ++I)
+ if (I->isMoveConstructor())
+ return *I;
+
+ return 0;
+}
+
CXXMethodDecl *CXXRecordDecl::getCopyAssignmentOperator(bool ArgIsConst) const {
ASTContext &Context = getASTContext();
QualType Class = Context.getTypeDeclType(const_cast<CXXRecordDecl *>(this));
@@ -387,6 +403,14 @@ CXXMethodDecl *CXXRecordDecl::getCopyAssignmentOperator(bool ArgIsConst) const {
return GetBestOverloadCandidateSimple(Found);
}
+CXXMethodDecl *CXXRecordDecl::getMoveAssignmentOperator() const {
+ for (method_iterator I = method_begin(), E = method_end(); I != E; ++I)
+ if (I->isMoveAssignmentOperator())
+ return *I;
+
+ return 0;
+}
+
void CXXRecordDecl::markedVirtualFunctionPure() {
// C++ [class.abstract]p2:
// A class is abstract if it has at least one pure virtual function.
@@ -421,8 +445,10 @@ void CXXRecordDecl::addedMember(Decl *D) {
// polymorphic class.
data().Polymorphic = true;
- // None of the special member functions are trivial.
- data().HasTrivialConstructor = false;
+ // C++0x [class.ctor]p5
+ // A default constructor is trivial [...] if:
+ // -- its class has no virtual functions [...]
+ data().HasTrivialDefaultConstructor = false;
// C++0x [class.copy]p13:
// A copy/move constructor for class X is trivial if [...]
@@ -451,32 +477,32 @@ void CXXRecordDecl::addedMember(Decl *D) {
if (ASTMutationListener *L = getASTMutationListener())
L->AddedCXXImplicitMember(data().Definition, D);
+ // If this is a special member function, note that it was added and then
+ // return early.
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(D)) {
- // If this is the implicit default constructor, note that we have now
- // declared it.
if (Constructor->isDefaultConstructor())
data().DeclaredDefaultConstructor = true;
- // If this is the implicit copy constructor, note that we have now
- // declared it.
else if (Constructor->isCopyConstructor())
data().DeclaredCopyConstructor = true;
+ else if (Constructor->isMoveConstructor())
+ data().DeclaredMoveConstructor = true;
+ else
+ goto NotASpecialMember;
return;
- }
-
- if (isa<CXXDestructorDecl>(D)) {
+ } else if (isa<CXXDestructorDecl>(D)) {
data().DeclaredDestructor = true;
return;
- }
-
- if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) {
- // If this is the implicit copy constructor, note that we have now
- // declared it.
- // FIXME: Move constructors
- if (Method->getOverloadedOperator() == OO_Equal)
+ } else if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) {
+ if (Method->isCopyAssignmentOperator())
data().DeclaredCopyAssignment = true;
+ else if (Method->isMoveAssignmentOperator())
+ data().DeclaredMoveAssignment = true;
+ else
+ goto NotASpecialMember;
return;
}
+NotASpecialMember:;
// Any other implicit declarations are handled like normal declarations.
}
@@ -485,23 +511,20 @@ void CXXRecordDecl::addedMember(Decl *D) {
// Note that we have a user-declared constructor.
data().UserDeclaredConstructor = true;
- // Note that we have no need of an implicitly-declared default constructor.
- data().DeclaredDefaultConstructor = true;
-
- // C++ [dcl.init.aggr]p1:
- // An aggregate is an array or a class (clause 9) with no
- // user-declared constructors (12.1) [...].
- data().Aggregate = false;
-
- // C++ [class]p4:
- // A POD-struct is an aggregate class [...]
- data().PlainOldData = false;
-
- // C++ [class.ctor]p5:
- // A constructor is trivial if it is an implicitly-declared default
- // constructor.
- // FIXME: C++0x: don't do this for "= default" default constructors.
- data().HasTrivialConstructor = false;
+ // FIXME: Under C++0x, /only/ special member functions may be user-provided.
+ // This is probably a defect.
+ bool UserProvided = false;
+
+ // C++0x [class.ctor]p5:
+ // A default constructor is trivial if it is not user-provided [...]
+ if (Constructor->isDefaultConstructor()) {
+ data().DeclaredDefaultConstructor = true;
+ if (Constructor->isUserProvided()) {
+ data().HasTrivialDefaultConstructor = false;
+ data().UserProvidedDefaultConstructor = true;
+ UserProvided = true;
+ }
+ }
// Note when we have a user-declared copy or move constructor, which will
// suppress the implicit declaration of those constructors.
@@ -511,16 +534,23 @@ void CXXRecordDecl::addedMember(Decl *D) {
data().DeclaredCopyConstructor = true;
// C++0x [class.copy]p13:
- // A copy/move constructor for class X is trivial if it is neither
- // user-provided nor deleted
- // FIXME: C++0x: don't do this for "= default" copy constructors.
- data().HasTrivialCopyConstructor = false;
+ // A copy/move constructor for class X is trivial if it is not
+ // user-provided [...]
+ if (Constructor->isUserProvided()) {
+ data().HasTrivialCopyConstructor = false;
+ UserProvided = true;
+ }
} else if (Constructor->isMoveConstructor()) {
+ data().UserDeclaredMoveConstructor = true;
+ data().DeclaredMoveConstructor = true;
+
// C++0x [class.copy]p13:
- // A copy/move constructor for class X is trivial if it is neither
- // user-provided nor deleted
- // FIXME: C++0x: don't do this for "= default" move constructors.
- data().HasTrivialMoveConstructor = false;
+ // A copy/move constructor for class X is trivial if it is not
+ // user-provided [...]
+ if (Constructor->isUserProvided()) {
+ data().HasTrivialMoveConstructor = false;
+ UserProvided = true;
+ }
}
}
if (Constructor->isConstExpr() &&
@@ -530,88 +560,81 @@ void CXXRecordDecl::addedMember(Decl *D) {
data().HasConstExprNonCopyMoveConstructor = true;
}
+ // C++ [dcl.init.aggr]p1:
+ // An aggregate is an array or a class with no user-declared
+ // constructors [...].
+ // C++0x [dcl.init.aggr]p1:
+ // An aggregate is an array or a class with no user-provided
+ // constructors [...].
+ if (!getASTContext().getLangOptions().CPlusPlus0x || UserProvided)
+ data().Aggregate = false;
+
+ // C++ [class]p4:
+ // A POD-struct is an aggregate class [...]
+ // Since the POD bit is meant to be C++03 POD-ness, clear it even if the
+ // type is technically an aggregate in C++0x since it wouldn't be in 03.
+ data().PlainOldData = false;
+
return;
}
// Handle (user-declared) destructors.
- if (isa<CXXDestructorDecl>(D)) {
+ if (CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(D)) {
data().DeclaredDestructor = true;
data().UserDeclaredDestructor = true;
// C++ [class]p4:
// A POD-struct is an aggregate class that has [...] no user-defined
// destructor.
+ // This bit is the C++03 POD bit, not the 0x one.
data().PlainOldData = false;
- // C++ [class.dtor]p3:
- // A destructor is trivial if it is an implicitly-declared destructor and
- // [...].
- //
- // FIXME: C++0x: don't do this for "= default" destructors
- data().HasTrivialDestructor = false;
+ // C++0x [class.dtor]p5:
+ // A destructor is trivial if it is not user-provided and [...]
+ if (DD->isUserProvided())
+ data().HasTrivialDestructor = false;
return;
}
// Handle (user-declared) member functions.
if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) {
- if (Method->getOverloadedOperator() == OO_Equal) {
- // We're interested specifically in copy assignment operators.
- const FunctionProtoType *FnType
- = Method->getType()->getAs<FunctionProtoType>();
- assert(FnType && "Overloaded operator has no proto function type.");
- assert(FnType->getNumArgs() == 1 && !FnType->isVariadic());
-
- // Copy assignment operators must be non-templates.
- if (Method->getPrimaryTemplate() || FunTmpl)
- return;
-
- ASTContext &Context = getASTContext();
- QualType ClassType = Context.getCanonicalType(Context.getTypeDeclType(
- const_cast<CXXRecordDecl*>(this)));
-
- bool isRValueRefArg = false;
- QualType ArgType = FnType->getArgType(0);
- if (const LValueReferenceType *Ref =
- ArgType->getAs<LValueReferenceType>()) {
- ArgType = Ref->getPointeeType();
- } else if (const RValueReferenceType *Ref =
- ArgType->getAs<RValueReferenceType>()) {
- ArgType = Ref->getPointeeType();
- isRValueRefArg = true;
- }
- if (!Context.hasSameUnqualifiedType(ClassType, ArgType))
- return;
-
+ if (Method->isCopyAssignmentOperator()) {
// C++ [class]p4:
// A POD-struct is an aggregate class that [...] has no user-defined
// copy assignment operator [...].
- // FIXME: This should be probably determined dynamically in terms of
- // other more precise attributes to correctly model how it is specified
- // in C++0x. Setting it here happens to do the right thing.
+ // This is the C++03 bit only.
data().PlainOldData = false;
- if (!isRValueRefArg) {
- // This is a copy assignment operator.
+ // This is a copy assignment operator.
- // Suppress the implicit declaration of a copy constructor.
- data().UserDeclaredCopyAssignment = true;
- data().DeclaredCopyAssignment = true;
+ // Suppress the implicit declaration of a copy constructor.
+ data().UserDeclaredCopyAssignment = true;
+ data().DeclaredCopyAssignment = true;
- // C++0x [class.copy]p27:
- // A copy/move assignment operator for class X is trivial if it is
- // neither user-provided nor deleted [...]
- // FIXME: C++0x: don't do this for "= default" copy operators.
+ // C++0x [class.copy]p27:
+ // A copy/move assignment operator for class X is trivial if it is
+ // neither user-provided nor deleted [...]
+ if (Method->isUserProvided())
data().HasTrivialCopyAssignment = false;
- } else {
- // This is a move assignment operator.
- // C++0x [class.copy]p27:
- // A copy/move assignment operator for class X is trivial if it is
- // neither user-provided nor deleted [...]
- // FIXME: C++0x: don't do this for "= default" copy operators.
+ return;
+ }
+
+ if (Method->isMoveAssignmentOperator()) {
+ // This is an extension in C++03 mode, but we'll keep consistency by
+ // taking a move assignment operator to induce non-POD-ness
+ data().PlainOldData = false;
+
+ // This is a move assignment operator.
+ data().UserDeclaredMoveAssignment = true;
+ data().DeclaredMoveAssignment = true;
+
+ // C++0x [class.copy]p27:
+ // A copy/move assignment operator for class X is trivial if it is
+ // neither user-provided nor deleted [...]
+ if (Method->isUserProvided())
data().HasTrivialMoveAssignment = false;
- }
}
// Keep the list of conversion functions up-to-date.
@@ -667,6 +690,10 @@ void CXXRecordDecl::addedMember(Decl *D) {
data().HasPublicFields) > 1)
data().IsStandardLayout = false;
+ // Keep track of the presence of mutable fields.
+ if (Field->isMutable())
+ data().HasMutableFields = true;
+
// C++0x [class]p9:
// A POD struct is a class that is both a trivial class and a
// standard-layout class, and has no non-static data members of type
@@ -676,7 +703,7 @@ void CXXRecordDecl::addedMember(Decl *D) {
if (!T->isPODType())
data().PlainOldData = false;
if (T->isReferenceType()) {
- data().HasTrivialConstructor = false;
+ data().HasTrivialDefaultConstructor = false;
// C++0x [class]p7:
// A standard-layout class is a class that:
@@ -688,11 +715,32 @@ void CXXRecordDecl::addedMember(Decl *D) {
if (!hasNonLiteralTypeFieldsOrBases() && !T->isLiteralType())
data().HasNonLiteralTypeFieldsOrBases = true;
+ if (Field->hasInClassInitializer()) {
+ // C++0x [class]p5:
+ // A default constructor is trivial if [...] no non-static data member
+ // of its class has a brace-or-equal-initializer.
+ data().HasTrivialDefaultConstructor = false;
+
+ // C++0x [dcl.init.aggr]p1:
+ // An aggregate is a [...] class with [...] no
+ // brace-or-equal-initializers for non-static data members.
+ data().Aggregate = false;
+
+ // C++0x [class]p10:
+ // A POD struct is [...] a trivial class.
+ data().PlainOldData = false;
+ }
+
if (const RecordType *RecordTy = T->getAs<RecordType>()) {
CXXRecordDecl* FieldRec = cast<CXXRecordDecl>(RecordTy->getDecl());
if (FieldRec->getDefinition()) {
- if (!FieldRec->hasTrivialConstructor())
- data().HasTrivialConstructor = false;
+ // C++0x [class.ctor]p5:
+ // A defulat constructor is trivial [...] if:
+ // -- for all the non-static data members of its class that are of
+ // class type (or array thereof), each such class has a trivial
+ // default constructor.
+ if (!FieldRec->hasTrivialDefaultConstructor())
+ data().HasTrivialDefaultConstructor = false;
// C++0x [class.copy]p13:
// A copy/move constructor for class X is trivial if [...]
@@ -753,6 +801,10 @@ void CXXRecordDecl::addedMember(Decl *D) {
}
}
}
+
+ // Keep track of the presence of mutable fields.
+ if (FieldRec->hasMutableFields())
+ data().HasMutableFields = true;
}
}
@@ -1135,14 +1187,13 @@ bool CXXMethodDecl::isUsualDeallocationFunction() const {
}
bool CXXMethodDecl::isCopyAssignmentOperator() const {
- // C++0x [class.copy]p19:
+ // C++0x [class.copy]p17:
// A user-declared copy assignment operator X::operator= is a non-static
// non-template member function of class X with exactly one parameter of
// type X, X&, const X&, volatile X& or const volatile X&.
if (/*operator=*/getOverloadedOperator() != OO_Equal ||
/*non-static*/ isStatic() ||
- /*non-template*/getPrimaryTemplate() || getDescribedFunctionTemplate() ||
- /*exactly one parameter*/getNumParams() != 1)
+ /*non-template*/getPrimaryTemplate() || getDescribedFunctionTemplate())
return false;
QualType ParamType = getParamDecl(0)->getType();
@@ -1155,6 +1206,26 @@ bool CXXMethodDecl::isCopyAssignmentOperator() const {
return Context.hasSameUnqualifiedType(ClassType, ParamType);
}
+bool CXXMethodDecl::isMoveAssignmentOperator() const {
+ // C++0x [class.copy]p19:
+ // A user-declared move assignment operator X::operator= is a non-static
+ // non-template member function of class X with exactly one parameter of type
+ // X&&, const X&&, volatile X&&, or const volatile X&&.
+ if (getOverloadedOperator() != OO_Equal || isStatic() ||
+ getPrimaryTemplate() || getDescribedFunctionTemplate())
+ return false;
+
+ QualType ParamType = getParamDecl(0)->getType();
+ if (!isa<RValueReferenceType>(ParamType))
+ return false;
+ ParamType = ParamType->getPointeeType();
+
+ ASTContext &Context = getASTContext();
+ QualType ClassType
+ = Context.getCanonicalType(Context.getTypeDeclType(getParent()));
+ return Context.hasSameUnqualifiedType(ClassType, ParamType);
+}
+
void CXXMethodDecl::addOverriddenMethod(const CXXMethodDecl *MD) {
assert(MD->isCanonicalDecl() && "Method is not canonical!");
assert(!MD->getParent()->isDependentContext() &&
@@ -1290,11 +1361,21 @@ const Type *CXXCtorInitializer::getBaseClass() const {
SourceLocation CXXCtorInitializer::getSourceLocation() const {
if (isAnyMemberInitializer() || isDelegatingInitializer())
return getMemberLocation();
+
+ if (isInClassMemberInitializer())
+ return getAnyMember()->getLocation();
return getBaseClassLoc().getLocalSourceRange().getBegin();
}
SourceRange CXXCtorInitializer::getSourceRange() const {
+ if (isInClassMemberInitializer()) {
+ FieldDecl *D = getAnyMember();
+ if (Expr *I = D->getInClassInitializer())
+ return I->getSourceRange();
+ return SourceRange();
+ }
+
return SourceRange(getSourceLocation(), getRParenLoc());
}
diff --git a/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp b/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp
index 24d281e..e2c4f38 100644
--- a/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp
@@ -339,12 +339,14 @@ ObjCMethodDecl *ObjCMethodDecl::Create(ASTContext &C,
bool isSynthesized,
bool isDefined,
ImplementationControl impControl,
+ bool HasRelatedResultType,
unsigned numSelectorArgs) {
return new (C) ObjCMethodDecl(beginLoc, endLoc,
SelInfo, T, ResultTInfo, contextDecl,
isInstance,
isVariadic, isSynthesized, isDefined,
impControl,
+ HasRelatedResultType,
numSelectorArgs);
}
@@ -446,6 +448,7 @@ ObjCMethodFamily ObjCMethodDecl::getMethodFamily() const {
case OMF_release:
case OMF_autorelease:
case OMF_retainCount:
+ case OMF_self:
if (!isInstanceMethod())
family = OMF_None;
break;
diff --git a/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp b/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp
index 2fd88d7..421770e 100644
--- a/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp
@@ -400,7 +400,7 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
if (D->getNumParams()) POut << ", ";
POut << "...";
}
- } else if (D->isThisDeclarationADefinition() && !D->hasPrototype()) {
+ } else if (D->doesThisDeclarationHaveABody() && !D->hasPrototype()) {
for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) {
if (i)
Proto += ", ";
@@ -450,62 +450,67 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
if (D->hasAttr<NoReturnAttr>())
Proto += " __attribute((noreturn))";
if (CXXConstructorDecl *CDecl = dyn_cast<CXXConstructorDecl>(D)) {
- if (CDecl->getNumCtorInitializers() > 0) {
- Proto += " : ";
- Out << Proto;
- Proto.clear();
- for (CXXConstructorDecl::init_const_iterator B = CDecl->init_begin(),
- E = CDecl->init_end();
- B != E; ++B) {
- CXXCtorInitializer * BMInitializer = (*B);
- if (B != CDecl->init_begin())
- Out << ", ";
- if (BMInitializer->isAnyMemberInitializer()) {
- FieldDecl *FD = BMInitializer->getAnyMember();
- Out << FD;
- } else {
- Out << QualType(BMInitializer->getBaseClass(),
- 0).getAsString(Policy);
- }
+ bool HasInitializerList = false;
+ for (CXXConstructorDecl::init_const_iterator B = CDecl->init_begin(),
+ E = CDecl->init_end();
+ B != E; ++B) {
+ CXXCtorInitializer * BMInitializer = (*B);
+ if (BMInitializer->isInClassMemberInitializer())
+ continue;
+
+ if (!HasInitializerList) {
+ Proto += " : ";
+ Out << Proto;
+ Proto.clear();
+ HasInitializerList = true;
+ } else
+ Out << ", ";
+
+ if (BMInitializer->isAnyMemberInitializer()) {
+ FieldDecl *FD = BMInitializer->getAnyMember();
+ Out << FD;
+ } else {
+ Out << QualType(BMInitializer->getBaseClass(),
+ 0).getAsString(Policy);
+ }
+
+ Out << "(";
+ if (!BMInitializer->getInit()) {
+ // Nothing to print
+ } else {
+ Expr *Init = BMInitializer->getInit();
+ if (ExprWithCleanups *Tmp = dyn_cast<ExprWithCleanups>(Init))
+ Init = Tmp->getSubExpr();
+
+ Init = Init->IgnoreParens();
- Out << "(";
- if (!BMInitializer->getInit()) {
- // Nothing to print
- } else {
- Expr *Init = BMInitializer->getInit();
- if (ExprWithCleanups *Tmp = dyn_cast<ExprWithCleanups>(Init))
- Init = Tmp->getSubExpr();
-
- Init = Init->IgnoreParens();
-
- Expr *SimpleInit = 0;
- Expr **Args = 0;
- unsigned NumArgs = 0;
- if (ParenListExpr *ParenList = dyn_cast<ParenListExpr>(Init)) {
- Args = ParenList->getExprs();
- NumArgs = ParenList->getNumExprs();
- } else if (CXXConstructExpr *Construct
- = dyn_cast<CXXConstructExpr>(Init)) {
- Args = Construct->getArgs();
- NumArgs = Construct->getNumArgs();
- } else
- SimpleInit = Init;
-
- if (SimpleInit)
- SimpleInit->printPretty(Out, Context, 0, Policy, Indentation);
- else {
- for (unsigned I = 0; I != NumArgs; ++I) {
- if (isa<CXXDefaultArgExpr>(Args[I]))
- break;
-
- if (I)
- Out << ", ";
- Args[I]->printPretty(Out, Context, 0, Policy, Indentation);
- }
+ Expr *SimpleInit = 0;
+ Expr **Args = 0;
+ unsigned NumArgs = 0;
+ if (ParenListExpr *ParenList = dyn_cast<ParenListExpr>(Init)) {
+ Args = ParenList->getExprs();
+ NumArgs = ParenList->getNumExprs();
+ } else if (CXXConstructExpr *Construct
+ = dyn_cast<CXXConstructExpr>(Init)) {
+ Args = Construct->getArgs();
+ NumArgs = Construct->getNumArgs();
+ } else
+ SimpleInit = Init;
+
+ if (SimpleInit)
+ SimpleInit->printPretty(Out, Context, 0, Policy, Indentation);
+ else {
+ for (unsigned I = 0; I != NumArgs; ++I) {
+ if (isa<CXXDefaultArgExpr>(Args[I]))
+ break;
+
+ if (I)
+ Out << ", ";
+ Args[I]->printPretty(Out, Context, 0, Policy, Indentation);
}
}
- Out << ")";
}
+ Out << ")";
}
}
else
@@ -518,9 +523,9 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
if (D->isPure())
Out << " = 0";
- else if (D->isDeleted())
+ else if (D->isDeletedAsWritten())
Out << " = delete";
- else if (D->isThisDeclarationADefinition()) {
+ else if (D->doesThisDeclarationHaveABody()) {
if (!D->hasPrototype() && D->getNumParams()) {
// This is a K&R function definition, so we need to print the
// parameters.
@@ -553,6 +558,12 @@ void DeclPrinter::VisitFieldDecl(FieldDecl *D) {
Out << " : ";
D->getBitWidth()->printPretty(Out, Context, 0, Policy, Indentation);
}
+
+ Expr *Init = D->getInClassInitializer();
+ if (!Policy.SuppressInitializers && Init) {
+ Out << " = ";
+ Init->printPretty(Out, Context, 0, Policy, Indentation);
+ }
}
void DeclPrinter::VisitLabelDecl(LabelDecl *D) {
@@ -932,6 +943,11 @@ void DeclPrinter::VisitObjCPropertyDecl(ObjCPropertyDecl *PDecl) {
Out << (first ? ' ' : ',') << "nonatomic";
first = false;
}
+ if (PDecl->getPropertyAttributes() &
+ ObjCPropertyDecl::OBJC_PR_atomic) {
+ Out << (first ? ' ' : ',') << "atomic";
+ first = false;
+ }
Out << " )";
}
Out << ' ' << PDecl->getType().getAsString(Policy) << ' ' << PDecl;
diff --git a/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp b/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp
index 6272340..bc375d0a 100644
--- a/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp
@@ -735,3 +735,34 @@ FriendTemplateDecl *FriendTemplateDecl::Create(ASTContext &Context,
EmptyShell Empty) {
return new (Context) FriendTemplateDecl(Empty);
}
+
+//===----------------------------------------------------------------------===//
+// TypeAliasTemplateDecl Implementation
+//===----------------------------------------------------------------------===//
+
+TypeAliasTemplateDecl *TypeAliasTemplateDecl::Create(ASTContext &C,
+ DeclContext *DC,
+ SourceLocation L,
+ DeclarationName Name,
+ TemplateParameterList *Params,
+ NamedDecl *Decl) {
+ AdoptTemplateParameterList(Params, DC);
+ return new (C) TypeAliasTemplateDecl(DC, L, Name, Params, Decl);
+}
+
+TypeAliasTemplateDecl *TypeAliasTemplateDecl::Create(ASTContext &C,
+ EmptyShell) {
+ return new (C) TypeAliasTemplateDecl(0, SourceLocation(), DeclarationName(),
+ 0, 0);
+}
+
+void TypeAliasTemplateDecl::DeallocateCommon(void *Ptr) {
+ static_cast<Common *>(Ptr)->~Common();
+}
+RedeclarableTemplateDecl::CommonBase *
+TypeAliasTemplateDecl::newCommon(ASTContext &C) {
+ Common *CommonPtr = new (C) Common;
+ C.AddDeallocation(DeallocateCommon, CommonPtr);
+ return CommonPtr;
+}
+
diff --git a/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp b/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp
index 7d593bc..dfe0119 100644
--- a/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp
@@ -482,18 +482,20 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>,
setFlag("trivial", D->isTrivial());
setFlag("returnzero", D->hasImplicitReturnZero());
setFlag("prototype", D->hasWrittenPrototype());
- setFlag("deleted", D->isDeleted());
+ setFlag("deleted", D->isDeletedAsWritten());
if (D->getStorageClass() != SC_None)
set("storage",
VarDecl::getStorageClassSpecifierString(D->getStorageClass()));
setFlag("inline", D->isInlineSpecified());
+ if (const AsmLabelAttr *ALA = D->getAttr<AsmLabelAttr>())
+ set("asmlabel", ALA->getLabel());
// TODO: instantiation, etc.
}
void visitFunctionDeclChildren(FunctionDecl *D) {
for (FunctionDecl::param_iterator
I = D->param_begin(), E = D->param_end(); I != E; ++I)
dispatch(*I);
- if (D->isThisDeclarationADefinition())
+ if (D->doesThisDeclarationHaveABody())
dispatch(D->getBody());
}
@@ -619,7 +621,8 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>,
// TemplateDecl
void visitTemplateDeclChildren(TemplateDecl *D) {
visitTemplateParameters(D->getTemplateParameters());
- dispatch(D->getTemplatedDecl());
+ if (D->getTemplatedDecl())
+ dispatch(D->getTemplatedDecl());
}
// FunctionTemplateDecl
@@ -845,6 +848,7 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>,
setFlag("variadic", D->isVariadic());
setFlag("synthesized", D->isSynthesized());
setFlag("defined", D->isDefined());
+ setFlag("related_result_type", D->hasRelatedResultType());
}
void visitObjCMethodDeclChildren(ObjCMethodDecl *D) {
dispatch(D->getResultType());
diff --git a/contrib/llvm/tools/clang/lib/AST/Expr.cpp b/contrib/llvm/tools/clang/lib/AST/Expr.cpp
index 6499f32..9872139 100644
--- a/contrib/llvm/tools/clang/lib/AST/Expr.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/Expr.cpp
@@ -22,6 +22,7 @@
#include "clang/AST/StmtVisitor.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Lex/Lexer.h"
+#include "clang/Sema/SemaDiagnostic.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
@@ -1653,7 +1654,8 @@ static Expr::CanThrowResult CanSubExprsThrow(ASTContext &C, const Expr *CE) {
return R;
}
-static Expr::CanThrowResult CanCalleeThrow(ASTContext &Ctx, const Decl *D,
+static Expr::CanThrowResult CanCalleeThrow(ASTContext &Ctx, const Expr *E,
+ const Decl *D,
bool NullThrows = true) {
if (!D)
return NullThrows ? Expr::CT_Can : Expr::CT_Cannot;
@@ -1683,6 +1685,15 @@ static Expr::CanThrowResult CanCalleeThrow(ASTContext &Ctx, const Decl *D,
if (!FT)
return Expr::CT_Can;
+ if (FT->getExceptionSpecType() == EST_Delayed) {
+ assert(isa<CXXConstructorDecl>(D) &&
+ "only constructor exception specs can be unknown");
+ Ctx.getDiagnostics().Report(E->getLocStart(),
+ diag::err_exception_spec_unknown)
+ << E->getSourceRange();
+ return Expr::CT_Can;
+ }
+
return FT->isNothrow(Ctx) ? Expr::CT_Cannot : Expr::CT_Can;
}
@@ -1693,6 +1704,9 @@ static Expr::CanThrowResult CanDynamicCastThrow(const CXXDynamicCastExpr *DC) {
if (!DC->getTypeAsWritten()->isReferenceType())
return Expr::CT_Cannot;
+ if (DC->getSubExpr()->isTypeDependent())
+ return Expr::CT_Dependent;
+
return DC->getCastKind() == clang::CK_Dynamic? Expr::CT_Can : Expr::CT_Cannot;
}
@@ -1747,7 +1761,14 @@ Expr::CanThrowResult Expr::CanThrow(ASTContext &C) const {
case CallExprClass:
case CXXOperatorCallExprClass:
case CXXMemberCallExprClass: {
- CanThrowResult CT = CanCalleeThrow(C,cast<CallExpr>(this)->getCalleeDecl());
+ const CallExpr *CE = cast<CallExpr>(this);
+ CanThrowResult CT;
+ if (isTypeDependent())
+ CT = CT_Dependent;
+ else if (isa<CXXPseudoDestructorExpr>(CE->getCallee()->IgnoreParens()))
+ CT = CT_Cannot;
+ else
+ CT = CanCalleeThrow(C, this, CE->getCalleeDecl());
if (CT == CT_Can)
return CT;
return MergeCanThrow(CT, CanSubExprsThrow(C, this));
@@ -1755,7 +1776,7 @@ Expr::CanThrowResult Expr::CanThrow(ASTContext &C) const {
case CXXConstructExprClass:
case CXXTemporaryObjectExprClass: {
- CanThrowResult CT = CanCalleeThrow(C,
+ CanThrowResult CT = CanCalleeThrow(C, this,
cast<CXXConstructExpr>(this)->getConstructor());
if (CT == CT_Can)
return CT;
@@ -1763,9 +1784,13 @@ Expr::CanThrowResult Expr::CanThrow(ASTContext &C) const {
}
case CXXNewExprClass: {
- CanThrowResult CT = MergeCanThrow(
- CanCalleeThrow(C, cast<CXXNewExpr>(this)->getOperatorNew()),
- CanCalleeThrow(C, cast<CXXNewExpr>(this)->getConstructor(),
+ CanThrowResult CT;
+ if (isTypeDependent())
+ CT = CT_Dependent;
+ else
+ CT = MergeCanThrow(
+ CanCalleeThrow(C, this, cast<CXXNewExpr>(this)->getOperatorNew()),
+ CanCalleeThrow(C, this, cast<CXXNewExpr>(this)->getConstructor(),
/*NullThrows*/false));
if (CT == CT_Can)
return CT;
@@ -1773,29 +1798,26 @@ Expr::CanThrowResult Expr::CanThrow(ASTContext &C) const {
}
case CXXDeleteExprClass: {
- CanThrowResult CT = CanCalleeThrow(C,
- cast<CXXDeleteExpr>(this)->getOperatorDelete());
- if (CT == CT_Can)
- return CT;
- const Expr *Arg = cast<CXXDeleteExpr>(this)->getArgument();
- // Unwrap exactly one implicit cast, which converts all pointers to void*.
- if (const ImplicitCastExpr *Cast = dyn_cast<ImplicitCastExpr>(Arg))
- Arg = Cast->getSubExpr();
- if (const PointerType *PT = Arg->getType()->getAs<PointerType>()) {
- if (const RecordType *RT = PT->getPointeeType()->getAs<RecordType>()) {
- CanThrowResult CT2 = CanCalleeThrow(C,
- cast<CXXRecordDecl>(RT->getDecl())->getDestructor());
- if (CT2 == CT_Can)
- return CT2;
- CT = MergeCanThrow(CT, CT2);
+ CanThrowResult CT;
+ QualType DTy = cast<CXXDeleteExpr>(this)->getDestroyedType();
+ if (DTy.isNull() || DTy->isDependentType()) {
+ CT = CT_Dependent;
+ } else {
+ CT = CanCalleeThrow(C, this,
+ cast<CXXDeleteExpr>(this)->getOperatorDelete());
+ if (const RecordType *RT = DTy->getAs<RecordType>()) {
+ const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
+ CT = MergeCanThrow(CT, CanCalleeThrow(C, this, RD->getDestructor()));
}
+ if (CT == CT_Can)
+ return CT;
}
return MergeCanThrow(CT, CanSubExprsThrow(C, this));
}
case CXXBindTemporaryExprClass: {
// The bound temporary has to be destroyed again, which might throw.
- CanThrowResult CT = CanCalleeThrow(C,
+ CanThrowResult CT = CanCalleeThrow(C, this,
cast<CXXBindTemporaryExpr>(this)->getTemporary()->getDestructor());
if (CT == CT_Can)
return CT;
@@ -1978,6 +2000,14 @@ Expr *Expr::IgnoreParenImpCasts() {
}
}
+Expr *Expr::IgnoreConversionOperator() {
+ if (CXXMemberCallExpr *MCE = dyn_cast<CXXMemberCallExpr>(this)) {
+ if (isa<CXXConversionDecl>(MCE->getMethodDecl()))
+ return MCE->getImplicitObjectArgument();
+ }
+ return this;
+}
+
/// IgnoreParenNoopCasts - Ignore parentheses and casts that do not change the
/// value (including ptr->int casts of the same size). Strip off any
/// ParenExpr or CastExprs, returning their operand.
@@ -3013,4 +3043,3 @@ BlockDeclRefExpr::BlockDeclRefExpr(VarDecl *d, QualType t, ExprValueKind VK,
ExprBits.TypeDependent = TypeDependent;
ExprBits.ValueDependent = ValueDependent;
}
-
diff --git a/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp b/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp
index 888a93c..d177cb5 100644
--- a/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp
@@ -161,6 +161,7 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
case Expr::InitListExprClass:
case Expr::SizeOfPackExprClass:
case Expr::SubstNonTypeTemplateParmPackExprClass:
+ case Expr::AsTypeExprClass:
return Cl::CL_PRValue;
// Next come the complicated cases.
@@ -465,14 +466,16 @@ static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) {
// is a pointer to a data member is of the same value category as its first
// operand.
if (E->getOpcode() == BO_PtrMemD)
- return E->getType()->isFunctionType() ? Cl::CL_MemberFunction :
- ClassifyInternal(Ctx, E->getLHS());
+ return (E->getType()->isFunctionType() || E->getType() == Ctx.BoundMemberTy)
+ ? Cl::CL_MemberFunction
+ : ClassifyInternal(Ctx, E->getLHS());
// C++ [expr.mptr.oper]p6: The result of an ->* expression is an lvalue if its
// second operand is a pointer to data member and a prvalue otherwise.
if (E->getOpcode() == BO_PtrMemI)
- return E->getType()->isFunctionType() ?
- Cl::CL_MemberFunction : Cl::CL_LValue;
+ return (E->getType()->isFunctionType() || E->getType() == Ctx.BoundMemberTy)
+ ? Cl::CL_MemberFunction
+ : Cl::CL_LValue;
// All other binary operations are prvalues.
return Cl::CL_PRValue;
diff --git a/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp b/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp
index c2caf8d4..06c5645 100644
--- a/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp
@@ -102,10 +102,10 @@ namespace {
};
struct LValue {
- Expr *Base;
+ const Expr *Base;
CharUnits Offset;
- Expr *getLValueBase() { return Base; }
+ const Expr *getLValueBase() { return Base; }
CharUnits getLValueOffset() { return Offset; }
void moveInto(APValue &v) const {
@@ -221,7 +221,7 @@ static APSInt HandleFloatToIntCast(QualType DestType, QualType SrcType,
APFloat &Value, const ASTContext &Ctx) {
unsigned DestWidth = Ctx.getIntWidth(DestType);
// Determine whether we are converting to unsigned or signed.
- bool DestSigned = DestType->isSignedIntegerType();
+ bool DestSigned = DestType->isSignedIntegerOrEnumerationType();
// FIXME: Warning for overflow.
uint64_t Space[4];
@@ -247,7 +247,7 @@ static APSInt HandleIntToIntCast(QualType DestType, QualType SrcType,
// Figure out if this is a truncate, extend or noop cast.
// If the input is signed, do a sign extend, noop, or truncate.
Result = Result.extOrTrunc(DestWidth);
- Result.setIsUnsigned(DestType->isUnsignedIntegerType());
+ Result.setIsUnsigned(DestType->isUnsignedIntegerOrEnumerationType());
return Result;
}
@@ -262,69 +262,69 @@ static APFloat HandleIntToFloatCast(QualType DestType, QualType SrcType,
namespace {
class HasSideEffect
- : public StmtVisitor<HasSideEffect, bool> {
+ : public ConstStmtVisitor<HasSideEffect, bool> {
EvalInfo &Info;
public:
HasSideEffect(EvalInfo &info) : Info(info) {}
// Unhandled nodes conservatively default to having side effects.
- bool VisitStmt(Stmt *S) {
+ bool VisitStmt(const Stmt *S) {
return true;
}
- bool VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); }
- bool VisitGenericSelectionExpr(GenericSelectionExpr *E) {
+ bool VisitParenExpr(const ParenExpr *E) { return Visit(E->getSubExpr()); }
+ bool VisitGenericSelectionExpr(const GenericSelectionExpr *E) {
return Visit(E->getResultExpr());
}
- bool VisitDeclRefExpr(DeclRefExpr *E) {
+ bool VisitDeclRefExpr(const DeclRefExpr *E) {
if (Info.Ctx.getCanonicalType(E->getType()).isVolatileQualified())
return true;
return false;
}
// We don't want to evaluate BlockExprs multiple times, as they generate
// a ton of code.
- bool VisitBlockExpr(BlockExpr *E) { return true; }
- bool VisitPredefinedExpr(PredefinedExpr *E) { return false; }
- bool VisitCompoundLiteralExpr(CompoundLiteralExpr *E)
+ bool VisitBlockExpr(const BlockExpr *E) { return true; }
+ bool VisitPredefinedExpr(const PredefinedExpr *E) { return false; }
+ bool VisitCompoundLiteralExpr(const CompoundLiteralExpr *E)
{ return Visit(E->getInitializer()); }
- bool VisitMemberExpr(MemberExpr *E) { return Visit(E->getBase()); }
- bool VisitIntegerLiteral(IntegerLiteral *E) { return false; }
- bool VisitFloatingLiteral(FloatingLiteral *E) { return false; }
- bool VisitStringLiteral(StringLiteral *E) { return false; }
- bool VisitCharacterLiteral(CharacterLiteral *E) { return false; }
- bool VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E)
+ bool VisitMemberExpr(const MemberExpr *E) { return Visit(E->getBase()); }
+ bool VisitIntegerLiteral(const IntegerLiteral *E) { return false; }
+ bool VisitFloatingLiteral(const FloatingLiteral *E) { return false; }
+ bool VisitStringLiteral(const StringLiteral *E) { return false; }
+ bool VisitCharacterLiteral(const CharacterLiteral *E) { return false; }
+ bool VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *E)
{ return false; }
- bool VisitArraySubscriptExpr(ArraySubscriptExpr *E)
+ bool VisitArraySubscriptExpr(const ArraySubscriptExpr *E)
{ return Visit(E->getLHS()) || Visit(E->getRHS()); }
- bool VisitChooseExpr(ChooseExpr *E)
+ bool VisitChooseExpr(const ChooseExpr *E)
{ return Visit(E->getChosenSubExpr(Info.Ctx)); }
- bool VisitCastExpr(CastExpr *E) { return Visit(E->getSubExpr()); }
- bool VisitBinAssign(BinaryOperator *E) { return true; }
- bool VisitCompoundAssignOperator(BinaryOperator *E) { return true; }
- bool VisitBinaryOperator(BinaryOperator *E)
+ bool VisitCastExpr(const CastExpr *E) { return Visit(E->getSubExpr()); }
+ bool VisitBinAssign(const BinaryOperator *E) { return true; }
+ bool VisitCompoundAssignOperator(const BinaryOperator *E) { return true; }
+ bool VisitBinaryOperator(const BinaryOperator *E)
{ return Visit(E->getLHS()) || Visit(E->getRHS()); }
- bool VisitUnaryPreInc(UnaryOperator *E) { return true; }
- bool VisitUnaryPostInc(UnaryOperator *E) { return true; }
- bool VisitUnaryPreDec(UnaryOperator *E) { return true; }
- bool VisitUnaryPostDec(UnaryOperator *E) { return true; }
- bool VisitUnaryDeref(UnaryOperator *E) {
+ bool VisitUnaryPreInc(const UnaryOperator *E) { return true; }
+ bool VisitUnaryPostInc(const UnaryOperator *E) { return true; }
+ bool VisitUnaryPreDec(const UnaryOperator *E) { return true; }
+ bool VisitUnaryPostDec(const UnaryOperator *E) { return true; }
+ bool VisitUnaryDeref(const UnaryOperator *E) {
if (Info.Ctx.getCanonicalType(E->getType()).isVolatileQualified())
return true;
return Visit(E->getSubExpr());
}
- bool VisitUnaryOperator(UnaryOperator *E) { return Visit(E->getSubExpr()); }
+ bool VisitUnaryOperator(const UnaryOperator *E) { return Visit(E->getSubExpr()); }
// Has side effects if any element does.
- bool VisitInitListExpr(InitListExpr *E) {
+ bool VisitInitListExpr(const InitListExpr *E) {
for (unsigned i = 0, e = E->getNumInits(); i != e; ++i)
if (Visit(E->getInit(i))) return true;
- if (Expr *filler = E->getArrayFiller())
+ if (const Expr *filler = E->getArrayFiller())
return Visit(filler);
return false;
}
- bool VisitSizeOfPackExpr(SizeOfPackExpr *) { return false; }
+ bool VisitSizeOfPackExpr(const SizeOfPackExpr *) { return false; }
};
class OpaqueValueEvaluation {
@@ -354,15 +354,89 @@ public:
} // end anonymous namespace
//===----------------------------------------------------------------------===//
+// Generic Evaluation
+//===----------------------------------------------------------------------===//
+namespace {
+
+template <class Derived, typename RetTy=void>
+class ExprEvaluatorBase
+ : public ConstStmtVisitor<Derived, RetTy> {
+private:
+ RetTy DerivedSuccess(const APValue &V, const Expr *E) {
+ return static_cast<Derived*>(this)->Success(V, E);
+ }
+ RetTy DerivedError(const Expr *E) {
+ return static_cast<Derived*>(this)->Error(E);
+ }
+
+protected:
+ EvalInfo &Info;
+ typedef ConstStmtVisitor<Derived, RetTy> StmtVisitorTy;
+ typedef ExprEvaluatorBase ExprEvaluatorBaseTy;
+
+public:
+ ExprEvaluatorBase(EvalInfo &Info) : Info(Info) {}
+
+ RetTy VisitStmt(const Stmt *) {
+ assert(0 && "Expression evaluator should not be called on stmts");
+ return DerivedError(0);
+ }
+ RetTy VisitExpr(const Expr *E) {
+ return DerivedError(E);
+ }
+
+ RetTy VisitParenExpr(const ParenExpr *E)
+ { return StmtVisitorTy::Visit(E->getSubExpr()); }
+ RetTy VisitUnaryExtension(const UnaryOperator *E)
+ { return StmtVisitorTy::Visit(E->getSubExpr()); }
+ RetTy VisitUnaryPlus(const UnaryOperator *E)
+ { return StmtVisitorTy::Visit(E->getSubExpr()); }
+ RetTy VisitChooseExpr(const ChooseExpr *E)
+ { return StmtVisitorTy::Visit(E->getChosenSubExpr(Info.Ctx)); }
+ RetTy VisitGenericSelectionExpr(const GenericSelectionExpr *E)
+ { return StmtVisitorTy::Visit(E->getResultExpr()); }
+
+ RetTy VisitBinaryConditionalOperator(const BinaryConditionalOperator *E) {
+ OpaqueValueEvaluation opaque(Info, E->getOpaqueValue(), E->getCommon());
+ if (opaque.hasError())
+ return DerivedError(E);
+
+ bool cond;
+ if (!HandleConversionToBool(E->getCond(), cond, Info))
+ return DerivedError(E);
+
+ return StmtVisitorTy::Visit(cond ? E->getTrueExpr() : E->getFalseExpr());
+ }
+
+ RetTy VisitConditionalOperator(const ConditionalOperator *E) {
+ bool BoolResult;
+ if (!HandleConversionToBool(E->getCond(), BoolResult, Info))
+ return DerivedError(E);
+
+ Expr* EvalExpr = BoolResult ? E->getTrueExpr() : E->getFalseExpr();
+ return StmtVisitorTy::Visit(EvalExpr);
+ }
+
+ RetTy VisitOpaqueValueExpr(const OpaqueValueExpr *E) {
+ const APValue *value = Info.getOpaqueValue(E);
+ if (!value)
+ return (E->getSourceExpr() ? StmtVisitorTy::Visit(E->getSourceExpr())
+ : DerivedError(E));
+ return DerivedSuccess(*value, E);
+ }
+};
+
+}
+
+//===----------------------------------------------------------------------===//
// LValue Evaluation
//===----------------------------------------------------------------------===//
namespace {
class LValueExprEvaluator
- : public StmtVisitor<LValueExprEvaluator, bool> {
- EvalInfo &Info;
+ : public ExprEvaluatorBase<LValueExprEvaluator, bool> {
LValue &Result;
- bool Success(Expr *E) {
+ bool Success(const Expr *E) {
Result.Base = E;
Result.Offset = CharUnits::Zero();
return true;
@@ -370,30 +444,26 @@ class LValueExprEvaluator
public:
LValueExprEvaluator(EvalInfo &info, LValue &Result) :
- Info(info), Result(Result) {}
+ ExprEvaluatorBaseTy(info), Result(Result) {}
- bool VisitStmt(Stmt *S) {
+ bool Success(const APValue &V, const Expr *E) {
+ Result.setFrom(V);
+ return true;
+ }
+ bool Error(const Expr *E) {
return false;
}
- bool VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); }
- bool VisitGenericSelectionExpr(GenericSelectionExpr *E) {
- return Visit(E->getResultExpr());
- }
- bool VisitDeclRefExpr(DeclRefExpr *E);
- bool VisitPredefinedExpr(PredefinedExpr *E) { return Success(E); }
- bool VisitCompoundLiteralExpr(CompoundLiteralExpr *E);
- bool VisitMemberExpr(MemberExpr *E);
- bool VisitStringLiteral(StringLiteral *E) { return Success(E); }
- bool VisitObjCEncodeExpr(ObjCEncodeExpr *E) { return Success(E); }
- bool VisitArraySubscriptExpr(ArraySubscriptExpr *E);
- bool VisitUnaryDeref(UnaryOperator *E);
- bool VisitUnaryExtension(const UnaryOperator *E)
- { return Visit(E->getSubExpr()); }
- bool VisitChooseExpr(const ChooseExpr *E)
- { return Visit(E->getChosenSubExpr(Info.Ctx)); }
-
- bool VisitCastExpr(CastExpr *E) {
+ bool VisitDeclRefExpr(const DeclRefExpr *E);
+ bool VisitPredefinedExpr(const PredefinedExpr *E) { return Success(E); }
+ bool VisitCompoundLiteralExpr(const CompoundLiteralExpr *E);
+ bool VisitMemberExpr(const MemberExpr *E);
+ bool VisitStringLiteral(const StringLiteral *E) { return Success(E); }
+ bool VisitObjCEncodeExpr(const ObjCEncodeExpr *E) { return Success(E); }
+ bool VisitArraySubscriptExpr(const ArraySubscriptExpr *E);
+ bool VisitUnaryDeref(const UnaryOperator *E);
+
+ bool VisitCastExpr(const CastExpr *E) {
switch (E->getCastKind()) {
default:
return false;
@@ -403,36 +473,37 @@ public:
}
}
// FIXME: Missing: __real__, __imag__
+
};
} // end anonymous namespace
static bool EvaluateLValue(const Expr* E, LValue& Result, EvalInfo &Info) {
- return LValueExprEvaluator(Info, Result).Visit(const_cast<Expr*>(E));
+ return LValueExprEvaluator(Info, Result).Visit(E);
}
-bool LValueExprEvaluator::VisitDeclRefExpr(DeclRefExpr *E) {
+bool LValueExprEvaluator::VisitDeclRefExpr(const DeclRefExpr *E) {
if (isa<FunctionDecl>(E->getDecl())) {
return Success(E);
- } else if (VarDecl* VD = dyn_cast<VarDecl>(E->getDecl())) {
+ } else if (const VarDecl* VD = dyn_cast<VarDecl>(E->getDecl())) {
if (!VD->getType()->isReferenceType())
return Success(E);
// Reference parameters can refer to anything even if they have an
// "initializer" in the form of a default argument.
- if (isa<ParmVarDecl>(VD))
- return false;
- // FIXME: Check whether VD might be overridden!
- if (const Expr *Init = VD->getAnyInitializer())
- return Visit(const_cast<Expr *>(Init));
+ if (!isa<ParmVarDecl>(VD))
+ // FIXME: Check whether VD might be overridden!
+ if (const Expr *Init = VD->getAnyInitializer())
+ return Visit(Init);
}
- return false;
+ return ExprEvaluatorBaseTy::VisitDeclRefExpr(E);
}
-bool LValueExprEvaluator::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
+bool
+LValueExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) {
return Success(E);
}
-bool LValueExprEvaluator::VisitMemberExpr(MemberExpr *E) {
+bool LValueExprEvaluator::VisitMemberExpr(const MemberExpr *E) {
QualType Ty;
if (E->isArrow()) {
if (!EvaluatePointer(E->getBase(), Result, Info))
@@ -444,10 +515,10 @@ bool LValueExprEvaluator::VisitMemberExpr(MemberExpr *E) {
Ty = E->getBase()->getType();
}
- RecordDecl *RD = Ty->getAs<RecordType>()->getDecl();
+ const RecordDecl *RD = Ty->getAs<RecordType>()->getDecl();
const ASTRecordLayout &RL = Info.Ctx.getASTRecordLayout(RD);
- FieldDecl *FD = dyn_cast<FieldDecl>(E->getMemberDecl());
+ const FieldDecl *FD = dyn_cast<FieldDecl>(E->getMemberDecl());
if (!FD) // FIXME: deal with other kinds of member expressions
return false;
@@ -467,7 +538,7 @@ bool LValueExprEvaluator::VisitMemberExpr(MemberExpr *E) {
return true;
}
-bool LValueExprEvaluator::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
+bool LValueExprEvaluator::VisitArraySubscriptExpr(const ArraySubscriptExpr *E) {
if (!EvaluatePointer(E->getBase(), Result, Info))
return false;
@@ -480,7 +551,7 @@ bool LValueExprEvaluator::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
return true;
}
-bool LValueExprEvaluator::VisitUnaryDeref(UnaryOperator *E) {
+bool LValueExprEvaluator::VisitUnaryDeref(const UnaryOperator *E) {
return EvaluatePointer(E->getSubExpr(), Result, Info);
}
@@ -490,11 +561,10 @@ bool LValueExprEvaluator::VisitUnaryDeref(UnaryOperator *E) {
namespace {
class PointerExprEvaluator
- : public StmtVisitor<PointerExprEvaluator, bool> {
- EvalInfo &Info;
+ : public ExprEvaluatorBase<PointerExprEvaluator, bool> {
LValue &Result;
- bool Success(Expr *E) {
+ bool Success(const Expr *E) {
Result.Base = E;
Result.Offset = CharUnits::Zero();
return true;
@@ -502,49 +572,41 @@ class PointerExprEvaluator
public:
PointerExprEvaluator(EvalInfo &info, LValue &Result)
- : Info(info), Result(Result) {}
+ : ExprEvaluatorBaseTy(info), Result(Result) {}
- bool VisitStmt(Stmt *S) {
- return false;
+ bool Success(const APValue &V, const Expr *E) {
+ Result.setFrom(V);
+ return true;
}
-
- bool VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); }
- bool VisitGenericSelectionExpr(GenericSelectionExpr *E) {
- return Visit(E->getResultExpr());
+ bool Error(const Stmt *S) {
+ return false;
}
bool VisitBinaryOperator(const BinaryOperator *E);
- bool VisitCastExpr(CastExpr* E);
- bool VisitUnaryExtension(const UnaryOperator *E)
- { return Visit(E->getSubExpr()); }
+ bool VisitCastExpr(const CastExpr* E);
bool VisitUnaryAddrOf(const UnaryOperator *E);
- bool VisitObjCStringLiteral(ObjCStringLiteral *E)
+ bool VisitObjCStringLiteral(const ObjCStringLiteral *E)
{ return Success(E); }
- bool VisitAddrLabelExpr(AddrLabelExpr *E)
+ bool VisitAddrLabelExpr(const AddrLabelExpr *E)
{ return Success(E); }
- bool VisitCallExpr(CallExpr *E);
- bool VisitBlockExpr(BlockExpr *E) {
+ bool VisitCallExpr(const CallExpr *E);
+ bool VisitBlockExpr(const BlockExpr *E) {
if (!E->getBlockDecl()->hasCaptures())
return Success(E);
return false;
}
- bool VisitImplicitValueInitExpr(ImplicitValueInitExpr *E)
+ bool VisitImplicitValueInitExpr(const ImplicitValueInitExpr *E)
{ return Success((Expr*)0); }
- bool VisitBinaryConditionalOperator(BinaryConditionalOperator *E);
- bool VisitConditionalOperator(ConditionalOperator *E);
- bool VisitChooseExpr(ChooseExpr *E)
- { return Visit(E->getChosenSubExpr(Info.Ctx)); }
- bool VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E)
+ bool VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *E)
{ return Success((Expr*)0); }
- bool VisitOpaqueValueExpr(OpaqueValueExpr *E);
// FIXME: Missing: @protocol, @selector
};
} // end anonymous namespace
static bool EvaluatePointer(const Expr* E, LValue& Result, EvalInfo &Info) {
assert(E->getType()->hasPointerRepresentation());
- return PointerExprEvaluator(Info, Result).Visit(const_cast<Expr*>(E));
+ return PointerExprEvaluator(Info, Result).Visit(E);
}
bool PointerExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {
@@ -592,8 +654,8 @@ bool PointerExprEvaluator::VisitUnaryAddrOf(const UnaryOperator *E) {
}
-bool PointerExprEvaluator::VisitCastExpr(CastExpr* E) {
- Expr* SubExpr = E->getSubExpr();
+bool PointerExprEvaluator::VisitCastExpr(const CastExpr* E) {
+ const Expr* SubExpr = E->getSubExpr();
switch (E->getCastKind()) {
default:
@@ -671,42 +733,14 @@ bool PointerExprEvaluator::VisitCastExpr(CastExpr* E) {
return false;
}
-bool PointerExprEvaluator::VisitCallExpr(CallExpr *E) {
+bool PointerExprEvaluator::VisitCallExpr(const CallExpr *E) {
if (E->isBuiltinCall(Info.Ctx) ==
Builtin::BI__builtin___CFStringMakeConstantString ||
E->isBuiltinCall(Info.Ctx) ==
Builtin::BI__builtin___NSStringMakeConstantString)
return Success(E);
- return false;
-}
-
-bool PointerExprEvaluator::VisitOpaqueValueExpr(OpaqueValueExpr *e) {
- const APValue *value = Info.getOpaqueValue(e);
- if (!value)
- return (e->getSourceExpr() ? Visit(e->getSourceExpr()) : false);
- Result.setFrom(*value);
- return true;
-}
-
-bool PointerExprEvaluator::
-VisitBinaryConditionalOperator(BinaryConditionalOperator *e) {
- OpaqueValueEvaluation opaque(Info, e->getOpaqueValue(), e->getCommon());
- if (opaque.hasError()) return false;
- bool cond;
- if (!HandleConversionToBool(e->getCond(), cond, Info))
- return false;
-
- return Visit(cond ? e->getTrueExpr() : e->getFalseExpr());
-}
-
-bool PointerExprEvaluator::VisitConditionalOperator(ConditionalOperator *E) {
- bool BoolResult;
- if (!HandleConversionToBool(E->getCond(), BoolResult, Info))
- return false;
-
- Expr* EvalExpr = BoolResult ? E->getTrueExpr() : E->getFalseExpr();
- return Visit(EvalExpr);
+ return ExprEvaluatorBaseTy::VisitCallExpr(E);
}
//===----------------------------------------------------------------------===//
@@ -715,25 +749,15 @@ bool PointerExprEvaluator::VisitConditionalOperator(ConditionalOperator *E) {
namespace {
class VectorExprEvaluator
- : public StmtVisitor<VectorExprEvaluator, APValue> {
- EvalInfo &Info;
+ : public ExprEvaluatorBase<VectorExprEvaluator, APValue> {
APValue GetZeroVector(QualType VecType);
public:
- VectorExprEvaluator(EvalInfo &info) : Info(info) {}
+ VectorExprEvaluator(EvalInfo &info) : ExprEvaluatorBaseTy(info) {}
- APValue VisitStmt(Stmt *S) {
- return APValue();
- }
+ APValue Success(const APValue &V, const Expr *E) { return V; }
+ APValue Error(const Expr *E) { return APValue(); }
- APValue VisitParenExpr(ParenExpr *E)
- { return Visit(E->getSubExpr()); }
- APValue VisitGenericSelectionExpr(GenericSelectionExpr *E)
- { return Visit(E->getResultExpr()); }
- APValue VisitUnaryExtension(const UnaryOperator *E)
- { return Visit(E->getSubExpr()); }
- APValue VisitUnaryPlus(const UnaryOperator *E)
- { return Visit(E->getSubExpr()); }
APValue VisitUnaryReal(const UnaryOperator *E)
{ return Visit(E->getSubExpr()); }
APValue VisitImplicitValueInitExpr(const ImplicitValueInitExpr *E)
@@ -741,9 +765,6 @@ namespace {
APValue VisitCastExpr(const CastExpr* E);
APValue VisitCompoundLiteralExpr(const CompoundLiteralExpr *E);
APValue VisitInitListExpr(const InitListExpr *E);
- APValue VisitConditionalOperator(const ConditionalOperator *E);
- APValue VisitChooseExpr(const ChooseExpr *E)
- { return Visit(E->getChosenSubExpr(Info.Ctx)); }
APValue VisitUnaryImag(const UnaryOperator *E);
// FIXME: Missing: unary -, unary ~, binary add/sub/mul/div,
// binary comparisons, binary and/or/xor,
@@ -756,7 +777,7 @@ namespace {
static bool EvaluateVector(const Expr* E, APValue& Result, EvalInfo &Info) {
if (!E->getType()->isVectorType())
return false;
- Result = VectorExprEvaluator(Info).Visit(const_cast<Expr*>(E));
+ Result = VectorExprEvaluator(Info).Visit(E);
return !Result.isUninit();
}
@@ -792,7 +813,7 @@ APValue VectorExprEvaluator::VisitCastExpr(const CastExpr* E) {
}
case CK_BitCast: {
if (SETy->isVectorType())
- return Visit(const_cast<Expr*>(SE));
+ return Visit(SE);
if (!SETy->isIntegerType())
return APValue();
@@ -819,7 +840,7 @@ APValue VectorExprEvaluator::VisitCastExpr(const CastExpr* E) {
}
case CK_LValueToRValue:
case CK_NoOp:
- return Visit(const_cast<Expr*>(SE));
+ return Visit(SE);
default:
return APValue();
}
@@ -827,7 +848,7 @@ APValue VectorExprEvaluator::VisitCastExpr(const CastExpr* E) {
APValue
VectorExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) {
- return this->Visit(const_cast<Expr*>(E->getInitializer()));
+ return this->Visit(E->getInitializer());
}
APValue
@@ -905,19 +926,6 @@ VectorExprEvaluator::GetZeroVector(QualType T) {
return APValue(&Elements[0], Elements.size());
}
-APValue VectorExprEvaluator::VisitConditionalOperator(const ConditionalOperator *E) {
- bool BoolResult;
- if (!HandleConversionToBool(E->getCond(), BoolResult, Info))
- return APValue();
-
- Expr* EvalExpr = BoolResult ? E->getTrueExpr() : E->getFalseExpr();
-
- APValue Result;
- if (EvaluateVector(EvalExpr, Result, Info))
- return Result;
- return APValue();
-}
-
APValue VectorExprEvaluator::VisitUnaryImag(const UnaryOperator *E) {
if (!E->getSubExpr()->isEvaluatable(Info.Ctx))
Info.EvalResult.HasSideEffects = true;
@@ -930,17 +938,16 @@ APValue VectorExprEvaluator::VisitUnaryImag(const UnaryOperator *E) {
namespace {
class IntExprEvaluator
- : public StmtVisitor<IntExprEvaluator, bool> {
- EvalInfo &Info;
+ : public ExprEvaluatorBase<IntExprEvaluator, bool> {
APValue &Result;
public:
IntExprEvaluator(EvalInfo &info, APValue &result)
- : Info(info), Result(result) {}
+ : ExprEvaluatorBaseTy(info), Result(result) {}
bool Success(const llvm::APSInt &SI, const Expr *E) {
assert(E->getType()->isIntegralOrEnumerationType() &&
"Invalid evaluation result.");
- assert(SI.isSigned() == E->getType()->isSignedIntegerType() &&
+ assert(SI.isSigned() == E->getType()->isSignedIntegerOrEnumerationType() &&
"Invalid evaluation result.");
assert(SI.getBitWidth() == Info.Ctx.getIntWidth(E->getType()) &&
"Invalid evaluation result.");
@@ -954,7 +961,8 @@ public:
assert(I.getBitWidth() == Info.Ctx.getIntWidth(E->getType()) &&
"Invalid evaluation result.");
Result = APValue(APSInt(I));
- Result.getInt().setIsUnsigned(E->getType()->isUnsignedIntegerType());
+ Result.getInt().setIsUnsigned(
+ E->getType()->isUnsignedIntegerOrEnumerationType());
return true;
}
@@ -980,23 +988,16 @@ public:
return false;
}
- //===--------------------------------------------------------------------===//
- // Visitor Methods
- //===--------------------------------------------------------------------===//
-
- bool VisitStmt(Stmt *) {
- assert(0 && "This should be called on integers, stmts are not integers");
- return false;
+ bool Success(const APValue &V, const Expr *E) {
+ return Success(V.getInt(), E);
}
-
- bool VisitExpr(Expr *E) {
+ bool Error(const Expr *E) {
return Error(E->getLocStart(), diag::note_invalid_subexpr_in_ice, E);
}
- bool VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); }
- bool VisitGenericSelectionExpr(GenericSelectionExpr *E) {
- return Visit(E->getResultExpr());
- }
+ //===--------------------------------------------------------------------===//
+ // Visitor Methods
+ //===--------------------------------------------------------------------===//
bool VisitIntegerLiteral(const IntegerLiteral *E) {
return Success(E->getValue(), E);
@@ -1005,18 +1006,12 @@ public:
return Success(E->getValue(), E);
}
- bool VisitOpaqueValueExpr(OpaqueValueExpr *e) {
- const APValue *value = Info.getOpaqueValue(e);
- if (!value) {
- if (e->getSourceExpr()) return Visit(e->getSourceExpr());
- return Error(e->getExprLoc(), diag::note_invalid_subexpr_in_ice, e);
- }
- return Success(value->getInt(), e);
- }
-
bool CheckReferencedDecl(const Expr *E, const Decl *D);
bool VisitDeclRefExpr(const DeclRefExpr *E) {
- return CheckReferencedDecl(E, E->getDecl());
+ if (CheckReferencedDecl(E, E->getDecl()))
+ return true;
+
+ return ExprEvaluatorBaseTy::VisitDeclRefExpr(E);
}
bool VisitMemberExpr(const MemberExpr *E) {
if (CheckReferencedDecl(E, E->getMemberDecl())) {
@@ -1024,17 +1019,16 @@ public:
Info.EvalResult.HasSideEffects = true;
return true;
}
- return false;
+
+ return ExprEvaluatorBaseTy::VisitMemberExpr(E);
}
- bool VisitCallExpr(CallExpr *E);
+ bool VisitCallExpr(const CallExpr *E);
bool VisitBinaryOperator(const BinaryOperator *E);
bool VisitOffsetOfExpr(const OffsetOfExpr *E);
bool VisitUnaryOperator(const UnaryOperator *E);
- bool VisitConditionalOperator(const ConditionalOperator *E);
- bool VisitBinaryConditionalOperator(const BinaryConditionalOperator *E);
- bool VisitCastExpr(CastExpr* E);
+ bool VisitCastExpr(const CastExpr* E);
bool VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *E);
bool VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *E) {
@@ -1069,10 +1063,6 @@ public:
return Success(E->getValue(), E);
}
- bool VisitChooseExpr(const ChooseExpr *E) {
- return Visit(E->getChosenSubExpr(Info.Ctx));
- }
-
bool VisitUnaryReal(const UnaryOperator *E);
bool VisitUnaryImag(const UnaryOperator *E);
@@ -1083,14 +1073,14 @@ private:
CharUnits GetAlignOfExpr(const Expr *E);
CharUnits GetAlignOfType(QualType T);
static QualType GetObjectType(const Expr *E);
- bool TryEvaluateBuiltinObjectSize(CallExpr *E);
+ bool TryEvaluateBuiltinObjectSize(const CallExpr *E);
// FIXME: Missing: array subscript of vector, member of vector
};
} // end anonymous namespace
static bool EvaluateIntegerOrLValue(const Expr* E, APValue &Result, EvalInfo &Info) {
assert(E->getType()->isIntegralOrEnumerationType());
- return IntExprEvaluator(Info, Result).Visit(const_cast<Expr*>(E));
+ return IntExprEvaluator(Info, Result).Visit(E);
}
static bool EvaluateInteger(const Expr* E, APSInt &Result, EvalInfo &Info) {
@@ -1114,18 +1104,18 @@ bool IntExprEvaluator::CheckReferencedDecl(const Expr* E, const Decl* D) {
== Qualifiers::Const) {
if (isa<ParmVarDecl>(D))
- return Error(E->getLocStart(), diag::note_invalid_subexpr_in_ice, E);
+ return false;
if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {
if (const Expr *Init = VD->getAnyInitializer()) {
if (APValue *V = VD->getEvaluatedValue()) {
if (V->isInt())
return Success(V->getInt(), E);
- return Error(E->getLocStart(), diag::note_invalid_subexpr_in_ice, E);
+ return false;
}
if (VD->isEvaluatingValue())
- return Error(E->getLocStart(), diag::note_invalid_subexpr_in_ice, E);
+ return false;
VD->setEvaluatingValue();
@@ -1144,7 +1134,7 @@ bool IntExprEvaluator::CheckReferencedDecl(const Expr* E, const Decl* D) {
}
// Otherwise, random variable references are not constants.
- return Error(E->getLocStart(), diag::note_invalid_subexpr_in_ice, E);
+ return false;
}
/// EvaluateBuiltinClassifyType - Evaluate __builtin_classify_type the same way
@@ -1216,7 +1206,7 @@ QualType IntExprEvaluator::GetObjectType(const Expr *E) {
return QualType();
}
-bool IntExprEvaluator::TryEvaluateBuiltinObjectSize(CallExpr *E) {
+bool IntExprEvaluator::TryEvaluateBuiltinObjectSize(const CallExpr *E) {
// TODO: Perhaps we should let LLVM lower this?
LValue Base;
if (!EvaluatePointer(E->getArg(0), Base, Info))
@@ -1244,10 +1234,10 @@ bool IntExprEvaluator::TryEvaluateBuiltinObjectSize(CallExpr *E) {
return Success(Size, E);
}
-bool IntExprEvaluator::VisitCallExpr(CallExpr *E) {
+bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) {
switch (E->isBuiltinCall(Info.Ctx)) {
default:
- return Error(E->getLocStart(), diag::note_invalid_subexpr_in_ice, E);
+ return ExprEvaluatorBaseTy::VisitCallExpr(E);
case Builtin::BI__builtin_object_size: {
if (TryEvaluateBuiltinObjectSize(E))
@@ -1285,7 +1275,7 @@ bool IntExprEvaluator::VisitCallExpr(CallExpr *E) {
case Builtin::BI__builtin_strlen:
// As an extension, we support strlen() and __builtin_strlen() as constant
// expressions when the argument is a string literal.
- if (StringLiteral *S
+ if (const StringLiteral *S
= dyn_cast<StringLiteral>(E->getArg(0)->IgnoreParenImpCasts())) {
// The string literal may have embedded null characters. Find the first
// one and truncate there.
@@ -1574,26 +1564,6 @@ bool IntExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {
}
}
-bool IntExprEvaluator::
-VisitBinaryConditionalOperator(const BinaryConditionalOperator *e) {
- OpaqueValueEvaluation opaque(Info, e->getOpaqueValue(), e->getCommon());
- if (opaque.hasError()) return false;
-
- bool cond;
- if (!HandleConversionToBool(e->getCond(), cond, Info))
- return false;
-
- return Visit(cond ? e->getTrueExpr() : e->getFalseExpr());
-}
-
-bool IntExprEvaluator::VisitConditionalOperator(const ConditionalOperator *E) {
- bool Cond;
- if (!HandleConversionToBool(E->getCond(), Cond, Info))
- return false;
-
- return Visit(Cond ? E->getTrueExpr() : E->getFalseExpr());
-}
-
CharUnits IntExprEvaluator::GetAlignOfType(QualType T) {
// C++ [expr.sizeof]p2: "When applied to a reference or a reference type,
// the result is the size of the referenced type."
@@ -1679,18 +1649,17 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr(
return false;
}
-bool IntExprEvaluator::VisitOffsetOfExpr(const OffsetOfExpr *E) {
+bool IntExprEvaluator::VisitOffsetOfExpr(const OffsetOfExpr *OOE) {
CharUnits Result;
- unsigned n = E->getNumComponents();
- OffsetOfExpr* OOE = const_cast<OffsetOfExpr*>(E);
+ unsigned n = OOE->getNumComponents();
if (n == 0)
return false;
- QualType CurrentType = E->getTypeSourceInfo()->getType();
+ QualType CurrentType = OOE->getTypeSourceInfo()->getType();
for (unsigned i = 0; i != n; ++i) {
OffsetOfExpr::OffsetOfNode ON = OOE->getComponent(i);
switch (ON.getKind()) {
case OffsetOfExpr::OffsetOfNode::Array: {
- Expr *Idx = OOE->getIndexExpr(ON.getArrayExprIndex());
+ const Expr *Idx = OOE->getIndexExpr(ON.getArrayExprIndex());
APSInt IdxResult;
if (!EvaluateInteger(Idx, IdxResult, Info))
return false;
@@ -1745,7 +1714,7 @@ bool IntExprEvaluator::VisitOffsetOfExpr(const OffsetOfExpr *E) {
}
}
}
- return Success(Result, E);
+ return Success(Result, OOE);
}
bool IntExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) {
@@ -1788,8 +1757,8 @@ bool IntExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) {
/// HandleCast - This is used to evaluate implicit or explicit casts where the
/// result type is integer.
-bool IntExprEvaluator::VisitCastExpr(CastExpr *E) {
- Expr *SubExpr = E->getSubExpr();
+bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
+ const Expr *SubExpr = E->getSubExpr();
QualType DestType = E->getType();
QualType SrcType = SubExpr->getType();
@@ -1936,48 +1905,33 @@ bool IntExprEvaluator::VisitCXXNoexceptExpr(const CXXNoexceptExpr *E) {
namespace {
class FloatExprEvaluator
- : public StmtVisitor<FloatExprEvaluator, bool> {
- EvalInfo &Info;
+ : public ExprEvaluatorBase<FloatExprEvaluator, bool> {
APFloat &Result;
public:
FloatExprEvaluator(EvalInfo &info, APFloat &result)
- : Info(info), Result(result) {}
+ : ExprEvaluatorBaseTy(info), Result(result) {}
- bool VisitStmt(Stmt *S) {
+ bool Success(const APValue &V, const Expr *e) {
+ Result = V.getFloat();
+ return true;
+ }
+ bool Error(const Stmt *S) {
return false;
}
- bool VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); }
- bool VisitGenericSelectionExpr(GenericSelectionExpr *E) {
- return Visit(E->getResultExpr());
- }
bool VisitCallExpr(const CallExpr *E);
bool VisitUnaryOperator(const UnaryOperator *E);
bool VisitBinaryOperator(const BinaryOperator *E);
bool VisitFloatingLiteral(const FloatingLiteral *E);
- bool VisitCastExpr(CastExpr *E);
- bool VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E);
- bool VisitConditionalOperator(ConditionalOperator *E);
- bool VisitBinaryConditionalOperator(BinaryConditionalOperator *E);
+ bool VisitCastExpr(const CastExpr *E);
+ bool VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *E);
- bool VisitChooseExpr(const ChooseExpr *E)
- { return Visit(E->getChosenSubExpr(Info.Ctx)); }
- bool VisitUnaryExtension(const UnaryOperator *E)
- { return Visit(E->getSubExpr()); }
bool VisitUnaryReal(const UnaryOperator *E);
bool VisitUnaryImag(const UnaryOperator *E);
bool VisitDeclRefExpr(const DeclRefExpr *E);
- bool VisitOpaqueValueExpr(const OpaqueValueExpr *e) {
- const APValue *value = Info.getOpaqueValue(e);
- if (!value)
- return (e->getSourceExpr() ? Visit(e->getSourceExpr()) : false);
- Result = value->getFloat();
- return true;
- }
-
// FIXME: Missing: array subscript of vector, member of vector,
// ImplicitValueInitExpr
};
@@ -1985,7 +1939,7 @@ public:
static bool EvaluateFloat(const Expr* E, APFloat& Result, EvalInfo &Info) {
assert(E->getType()->isRealFloatingType());
- return FloatExprEvaluator(Info, Result).Visit(const_cast<Expr*>(E));
+ return FloatExprEvaluator(Info, Result).Visit(E);
}
static bool TryEvaluateBuiltinNaN(const ASTContext &Context,
@@ -2015,7 +1969,9 @@ static bool TryEvaluateBuiltinNaN(const ASTContext &Context,
bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) {
switch (E->isBuiltinCall(Info.Ctx)) {
- default: return false;
+ default:
+ return ExprEvaluatorBaseTy::VisitCallExpr(E);
+
case Builtin::BI__builtin_huge_val:
case Builtin::BI__builtin_huge_valf:
case Builtin::BI__builtin_huge_vall:
@@ -2066,6 +2022,9 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) {
}
bool FloatExprEvaluator::VisitDeclRefExpr(const DeclRefExpr *E) {
+ if (ExprEvaluatorBaseTy::VisitDeclRefExpr(E))
+ return true;
+
const Decl *D = E->getDecl();
if (!isa<VarDecl>(D) || isa<ParmVarDecl>(D)) return false;
const VarDecl *VD = cast<VarDecl>(D);
@@ -2196,8 +2155,8 @@ bool FloatExprEvaluator::VisitFloatingLiteral(const FloatingLiteral *E) {
return true;
}
-bool FloatExprEvaluator::VisitCastExpr(CastExpr *E) {
- Expr* SubExpr = E->getSubExpr();
+bool FloatExprEvaluator::VisitCastExpr(const CastExpr *E) {
+ const Expr* SubExpr = E->getSubExpr();
switch (E->getCastKind()) {
default:
@@ -2236,77 +2195,42 @@ bool FloatExprEvaluator::VisitCastExpr(CastExpr *E) {
return false;
}
-bool FloatExprEvaluator::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
+bool FloatExprEvaluator::VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *E) {
Result = APFloat::getZero(Info.Ctx.getFloatTypeSemantics(E->getType()));
return true;
}
-bool FloatExprEvaluator::
-VisitBinaryConditionalOperator(BinaryConditionalOperator *e) {
- OpaqueValueEvaluation opaque(Info, e->getOpaqueValue(), e->getCommon());
- if (opaque.hasError()) return false;
-
- bool cond;
- if (!HandleConversionToBool(e->getCond(), cond, Info))
- return false;
-
- return Visit(cond ? e->getTrueExpr() : e->getFalseExpr());
-}
-
-bool FloatExprEvaluator::VisitConditionalOperator(ConditionalOperator *E) {
- bool Cond;
- if (!HandleConversionToBool(E->getCond(), Cond, Info))
- return false;
-
- return Visit(Cond ? E->getTrueExpr() : E->getFalseExpr());
-}
-
//===----------------------------------------------------------------------===//
// Complex Evaluation (for float and integer)
//===----------------------------------------------------------------------===//
namespace {
class ComplexExprEvaluator
- : public StmtVisitor<ComplexExprEvaluator, bool> {
- EvalInfo &Info;
+ : public ExprEvaluatorBase<ComplexExprEvaluator, bool> {
ComplexValue &Result;
public:
ComplexExprEvaluator(EvalInfo &info, ComplexValue &Result)
- : Info(info), Result(Result) {}
+ : ExprEvaluatorBaseTy(info), Result(Result) {}
- //===--------------------------------------------------------------------===//
- // Visitor Methods
- //===--------------------------------------------------------------------===//
-
- bool VisitStmt(Stmt *S) {
+ bool Success(const APValue &V, const Expr *e) {
+ Result.setFrom(V);
+ return true;
+ }
+ bool Error(const Expr *E) {
return false;
}
- bool VisitParenExpr(ParenExpr *E) { return Visit(E->getSubExpr()); }
- bool VisitGenericSelectionExpr(GenericSelectionExpr *E) {
- return Visit(E->getResultExpr());
- }
+ //===--------------------------------------------------------------------===//
+ // Visitor Methods
+ //===--------------------------------------------------------------------===//
- bool VisitImaginaryLiteral(ImaginaryLiteral *E);
+ bool VisitImaginaryLiteral(const ImaginaryLiteral *E);
- bool VisitCastExpr(CastExpr *E);
+ bool VisitCastExpr(const CastExpr *E);
bool VisitBinaryOperator(const BinaryOperator *E);
bool VisitUnaryOperator(const UnaryOperator *E);
- bool VisitConditionalOperator(const ConditionalOperator *E);
- bool VisitBinaryConditionalOperator(const BinaryConditionalOperator *E);
- bool VisitChooseExpr(const ChooseExpr *E)
- { return Visit(E->getChosenSubExpr(Info.Ctx)); }
- bool VisitUnaryExtension(const UnaryOperator *E)
- { return Visit(E->getSubExpr()); }
- bool VisitOpaqueValueExpr(const OpaqueValueExpr *e) {
- const APValue *value = Info.getOpaqueValue(e);
- if (!value)
- return (e->getSourceExpr() ? Visit(e->getSourceExpr()) : false);
- Result.setFrom(*value);
- return true;
- }
// FIXME Missing: ImplicitValueInitExpr
};
} // end anonymous namespace
@@ -2314,11 +2238,11 @@ public:
static bool EvaluateComplex(const Expr *E, ComplexValue &Result,
EvalInfo &Info) {
assert(E->getType()->isAnyComplexType());
- return ComplexExprEvaluator(Info, Result).Visit(const_cast<Expr*>(E));
+ return ComplexExprEvaluator(Info, Result).Visit(E);
}
-bool ComplexExprEvaluator::VisitImaginaryLiteral(ImaginaryLiteral *E) {
- Expr* SubExpr = E->getSubExpr();
+bool ComplexExprEvaluator::VisitImaginaryLiteral(const ImaginaryLiteral *E) {
+ const Expr* SubExpr = E->getSubExpr();
if (SubExpr->getType()->isRealFloatingType()) {
Result.makeComplexFloat();
@@ -2342,7 +2266,7 @@ bool ComplexExprEvaluator::VisitImaginaryLiteral(ImaginaryLiteral *E) {
}
}
-bool ComplexExprEvaluator::VisitCastExpr(CastExpr *E) {
+bool ComplexExprEvaluator::VisitCastExpr(const CastExpr *E) {
switch (E->getCastKind()) {
case CK_BitCast:
@@ -2627,26 +2551,6 @@ bool ComplexExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) {
}
}
-bool ComplexExprEvaluator::
-VisitBinaryConditionalOperator(const BinaryConditionalOperator *e) {
- OpaqueValueEvaluation opaque(Info, e->getOpaqueValue(), e->getCommon());
- if (opaque.hasError()) return false;
-
- bool cond;
- if (!HandleConversionToBool(e->getCond(), cond, Info))
- return false;
-
- return Visit(cond ? e->getTrueExpr() : e->getFalseExpr());
-}
-
-bool ComplexExprEvaluator::VisitConditionalOperator(const ConditionalOperator *E) {
- bool Cond;
- if (!HandleConversionToBool(E->getCond(), Cond, Info))
- return false;
-
- return Visit(Cond ? E->getTrueExpr() : E->getFalseExpr());
-}
-
//===----------------------------------------------------------------------===//
// Top level Expr::Evaluate method.
//===----------------------------------------------------------------------===//
@@ -2655,8 +2559,8 @@ static bool Evaluate(EvalInfo &Info, const Expr *E) {
if (E->getType()->isVectorType()) {
if (!EvaluateVector(E, Info.EvalResult.Val, Info))
return false;
- } else if (E->getType()->isIntegerType()) {
- if (!IntExprEvaluator(Info, Info.EvalResult.Val).Visit(const_cast<Expr*>(E)))
+ } else if (E->getType()->isIntegralOrEnumerationType()) {
+ if (!IntExprEvaluator(Info, Info.EvalResult.Val).Visit(E))
return false;
if (Info.EvalResult.Val.isLValue() &&
!IsGlobalLValue(Info.EvalResult.Val.getLValueBase()))
@@ -2737,7 +2641,7 @@ bool Expr::isEvaluatable(const ASTContext &Ctx) const {
bool Expr::HasSideEffects(const ASTContext &Ctx) const {
Expr::EvalResult Result;
EvalInfo Info(Ctx, Result);
- return HasSideEffect(Info).Visit(const_cast<Expr*>(this));
+ return HasSideEffect(Info).Visit(this);
}
APSInt Expr::EvaluateAsInt(const ASTContext &Ctx) const {
@@ -2866,6 +2770,7 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) {
case Expr::OpaqueValueExprClass:
case Expr::PackExpansionExprClass:
case Expr::SubstNonTypeTemplateParmPackExprClass:
+ case Expr::AsTypeExprClass:
return ICEDiag(2, E->getLocStart());
case Expr::SizeOfPackExprClass:
@@ -3053,6 +2958,21 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) {
case BO_LAnd:
case BO_LOr: {
ICEDiag LHSResult = CheckICE(Exp->getLHS(), Ctx);
+
+ // C++0x [expr.const]p2:
+ // [...] subexpressions of logical AND (5.14), logical OR
+ // (5.15), and condi- tional (5.16) operations that are not
+ // evaluated are not considered.
+ if (Ctx.getLangOptions().CPlusPlus0x && LHSResult.Val == 0) {
+ if (Exp->getOpcode() == BO_LAnd &&
+ Exp->getLHS()->EvaluateAsInt(Ctx) == 0)
+ return LHSResult;
+
+ if (Exp->getOpcode() == BO_LOr &&
+ Exp->getLHS()->EvaluateAsInt(Ctx) != 0)
+ return LHSResult;
+ }
+
ICEDiag RHSResult = CheckICE(Exp->getRHS(), Ctx);
if (LHSResult.Val == 0 && RHSResult.Val == 1) {
// Rare case where the RHS has a comma "side-effect"; we need
@@ -3111,10 +3031,22 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) {
return NoDiag();
}
ICEDiag CondResult = CheckICE(Exp->getCond(), Ctx);
- ICEDiag TrueResult = CheckICE(Exp->getTrueExpr(), Ctx);
- ICEDiag FalseResult = CheckICE(Exp->getFalseExpr(), Ctx);
if (CondResult.Val == 2)
return CondResult;
+
+ // C++0x [expr.const]p2:
+ // subexpressions of [...] conditional (5.16) operations that
+ // are not evaluated are not considered
+ bool TrueBranch = Ctx.getLangOptions().CPlusPlus0x
+ ? Exp->getCond()->EvaluateAsInt(Ctx) != 0
+ : false;
+ ICEDiag TrueResult = NoDiag();
+ if (!Ctx.getLangOptions().CPlusPlus0x || TrueBranch)
+ TrueResult = CheckICE(Exp->getTrueExpr(), Ctx);
+ ICEDiag FalseResult = NoDiag();
+ if (!Ctx.getLangOptions().CPlusPlus0x || !TrueBranch)
+ FalseResult = CheckICE(Exp->getFalseExpr(), Ctx);
+
if (TrueResult.Val == 2)
return TrueResult;
if (FalseResult.Val == 2)
diff --git a/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp b/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp
index 89bf56d..f428318 100644
--- a/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp
@@ -57,3 +57,5 @@ ExternalASTSource::FindExternalLexicalDecls(const DeclContext *DC,
llvm::SmallVectorImpl<Decl*> &Result) {
return true;
}
+
+void ExternalASTSource::getMemoryBufferSizes(MemoryBufferSizes &sizes) const { }
diff --git a/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp b/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp
index c460929..e81ec7e 100644
--- a/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp
@@ -255,7 +255,8 @@ private:
DeclarationName name,
unsigned KnownArity = UnknownArity);
- void mangleUnresolvedType(QualType type);
+ static bool isUnresolvedType(const Type *type);
+ void mangleUnresolvedType(const Type *type);
void mangleName(const TemplateDecl *TD,
const TemplateArgument *TemplateArgs,
@@ -277,6 +278,7 @@ private:
unsigned NumTemplateArgs);
void manglePrefix(NestedNameSpecifier *qualifier);
void manglePrefix(const DeclContext *DC, bool NoFunction=false);
+ void manglePrefix(QualType type);
void mangleTemplatePrefix(const TemplateDecl *ND);
void mangleTemplatePrefix(TemplateName Template);
void mangleOperatorName(OverloadedOperatorKind OO, unsigned Arity);
@@ -317,6 +319,8 @@ private:
void mangleTemplateArgs(const TemplateParameterList &PL,
const TemplateArgumentList &AL);
void mangleTemplateArg(const NamedDecl *P, const TemplateArgument &A);
+ void mangleUnresolvedTemplateArgs(const TemplateArgument *args,
+ unsigned numArgs);
void mangleTemplateParameter(unsigned Index);
@@ -667,7 +671,7 @@ void CXXNameMangler::mangleCallOffset(int64_t NonVirtual, int64_t Virtual) {
Out << '_';
}
-void CXXNameMangler::mangleUnresolvedType(QualType type) {
+void CXXNameMangler::manglePrefix(QualType type) {
if (const TemplateSpecializationType *TST =
type->getAs<TemplateSpecializationType>()) {
if (!mangleSubstitution(QualType(TST, 0))) {
@@ -698,6 +702,31 @@ void CXXNameMangler::mangleUnresolvedType(QualType type) {
}
}
+/// Returns true if the given type, appearing within an
+/// unresolved-name, should be mangled as an unresolved-type.
+bool CXXNameMangler::isUnresolvedType(const Type *type) {
+ // <unresolved-type> ::= <template-param>
+ // ::= <decltype>
+ // ::= <template-template-param> <template-args>
+ // (this last is not official yet)
+
+ if (isa<TemplateTypeParmType>(type)) return true;
+ if (isa<DecltypeType>(type)) return true;
+ // typeof?
+ if (const TemplateSpecializationType *tst =
+ dyn_cast<TemplateSpecializationType>(type)) {
+ TemplateDecl *temp = tst->getTemplateName().getAsTemplateDecl();
+ if (temp && isa<TemplateTemplateParmDecl>(temp))
+ return true;
+ }
+ return false;
+}
+
+void CXXNameMangler::mangleUnresolvedType(const Type *type) {
+ // This seems to be do everything we want.
+ mangleType(QualType(type, 0));
+}
+
/// Mangle everything prior to the base-unresolved-name in an unresolved-name.
///
/// \param firstQualifierLookup - the entity found by unqualified lookup
@@ -752,17 +781,60 @@ void CXXNameMangler::mangleUnresolvedPrefix(NestedNameSpecifier *qualifier,
case NestedNameSpecifier::TypeSpec:
case NestedNameSpecifier::TypeSpecWithTemplate: {
- // Both cases want this.
- Out << "sr";
+ const Type *type = qualifier->getAsType();
- // We only get here recursively if we're followed by identifiers.
- if (recursive) Out << 'N';
+ // We only want to use an unresolved-type encoding if this is one of:
+ // - a decltype
+ // - a template type parameter
+ // - a template template parameter with arguments
+ // In all of these cases, we should have no prefix.
+ if (qualifier->getPrefix()) {
+ mangleUnresolvedPrefix(qualifier->getPrefix(), firstQualifierLookup,
+ /*recursive*/ true);
+ } else {
+ // Otherwise, all the cases want this.
+ Out << "sr";
- mangleUnresolvedType(QualType(qualifier->getAsType(), 0));
+ if (isUnresolvedType(type)) {
+ // We only get here recursively if we're followed by identifiers.
+ if (recursive) Out << 'N';
+ mangleUnresolvedType(type);
- // We never want to print 'E' directly after an unresolved-type,
- // so we return directly.
- return;
+ // We never want to print 'E' directly after an unresolved-type,
+ // so we return directly.
+ return;
+ }
+ }
+
+ assert(!isUnresolvedType(type));
+
+ // Only certain other types are valid as prefixes; enumerate them.
+ // FIXME: can we get ElaboratedTypes here?
+ // FIXME: SubstTemplateTypeParmType?
+ if (const TagType *t = dyn_cast<TagType>(type)) {
+ mangleSourceName(t->getDecl()->getIdentifier());
+ } else if (const TypedefType *t = dyn_cast<TypedefType>(type)) {
+ mangleSourceName(t->getDecl()->getIdentifier());
+ } else if (const UnresolvedUsingType *t
+ = dyn_cast<UnresolvedUsingType>(type)) {
+ mangleSourceName(t->getDecl()->getIdentifier());
+ } else if (const DependentNameType *t
+ = dyn_cast<DependentNameType>(type)) {
+ mangleSourceName(t->getIdentifier());
+ } else if (const TemplateSpecializationType *tst
+ = dyn_cast<TemplateSpecializationType>(type)) {
+ TemplateDecl *temp = tst->getTemplateName().getAsTemplateDecl();
+ assert(temp && "no template for template specialization type");
+ mangleSourceName(temp->getIdentifier());
+ mangleUnresolvedTemplateArgs(tst->getArgs(), tst->getNumArgs());
+ } else if (const DependentTemplateSpecializationType *tst
+ = dyn_cast<DependentTemplateSpecializationType>(type)) {
+ mangleSourceName(tst->getIdentifier());
+ mangleUnresolvedTemplateArgs(tst->getArgs(), tst->getNumArgs());
+ } else {
+ llvm_unreachable("unexpected type in nested name specifier!");
+ }
+ break;
}
case NestedNameSpecifier::Identifier:
@@ -1050,6 +1122,12 @@ void CXXNameMangler::mangleLocalName(const NamedDecl *ND) {
// := Z <function encoding> E s [<discriminator>]
// <discriminator> := _ <non-negative number>
const DeclContext *DC = ND->getDeclContext();
+ if (isa<ObjCMethodDecl>(DC) && isa<FunctionDecl>(ND)) {
+ // Don't add objc method name mangling to locally declared function
+ mangleUnqualifiedName(ND);
+ return;
+ }
+
Out << 'Z';
if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(DC)) {
@@ -1097,7 +1175,7 @@ void CXXNameMangler::manglePrefix(NestedNameSpecifier *qualifier) {
case NestedNameSpecifier::TypeSpec:
case NestedNameSpecifier::TypeSpecWithTemplate:
- mangleUnresolvedType(QualType(qualifier->getAsType(), 0));
+ manglePrefix(QualType(qualifier->getAsType(), 0));
return;
case NestedNameSpecifier::Identifier:
@@ -1867,6 +1945,22 @@ void CXXNameMangler::mangleType(const DecltypeType *T) {
Out << 'E';
}
+void CXXNameMangler::mangleType(const UnaryTransformType *T) {
+ // If this is dependent, we need to record that. If not, we simply
+ // mangle it as the underlying type since they are equivalent.
+ if (T->isDependentType()) {
+ Out << 'U';
+
+ switch (T->getUTTKind()) {
+ case UnaryTransformType::EnumUnderlyingType:
+ Out << "3eut";
+ break;
+ }
+ }
+
+ mangleType(T->getUnderlyingType());
+}
+
void CXXNameMangler::mangleType(const AutoType *T) {
QualType D = T->getDeducedType();
// <builtin-type> ::= Da # dependent auto
@@ -1951,6 +2045,7 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
// ::= <function-param>
// ::= sr <type> <unqualified-name> # dependent name
// ::= sr <type> <unqualified-name> <template-args> # dependent template-id
+ // ::= ds <expression> <expression> # expr.*expr
// ::= sZ <template-param> # size of a parameter pack
// ::= sZ <function-param> # size of a function parameter pack
// ::= <expr-primary>
@@ -2005,7 +2100,9 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
case Expr::VAArgExprClass:
case Expr::CXXUuidofExprClass:
case Expr::CXXNoexceptExprClass:
- case Expr::CUDAKernelCallExprClass: {
+ case Expr::CUDAKernelCallExprClass:
+ case Expr::AsTypeExprClass:
+ {
// As bad as this diagnostic is, it's better than crashing.
Diagnostic &Diags = Context.getDiags();
unsigned DiagID = Diags.getCustomDiagID(Diagnostic::Error,
@@ -2227,8 +2324,11 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
case Expr::CompoundAssignOperatorClass: // fallthrough
case Expr::BinaryOperatorClass: {
const BinaryOperator *BO = cast<BinaryOperator>(E);
- mangleOperatorName(BinaryOperator::getOverloadedOperator(BO->getOpcode()),
- /*Arity=*/2);
+ if (BO->getOpcode() == BO_PtrMemD)
+ Out << "ds";
+ else
+ mangleOperatorName(BinaryOperator::getOverloadedOperator(BO->getOpcode()),
+ /*Arity=*/2);
mangleExpression(BO->getLHS());
mangleExpression(BO->getRHS());
break;
@@ -2552,8 +2652,8 @@ void CXXNameMangler::mangleTemplateArgs(
const ExplicitTemplateArgumentList &TemplateArgs) {
// <template-args> ::= I <template-arg>+ E
Out << 'I';
- for (unsigned I = 0, E = TemplateArgs.NumTemplateArgs; I != E; ++I)
- mangleTemplateArg(0, TemplateArgs.getTemplateArgs()[I].getArgument());
+ for (unsigned i = 0, e = TemplateArgs.NumTemplateArgs; i != e; ++i)
+ mangleTemplateArg(0, TemplateArgs.getTemplateArgs()[i].getArgument());
Out << 'E';
}
@@ -2564,10 +2664,15 @@ void CXXNameMangler::mangleTemplateArgs(TemplateName Template,
return mangleTemplateArgs(*TD->getTemplateParameters(), TemplateArgs,
NumTemplateArgs);
+ mangleUnresolvedTemplateArgs(TemplateArgs, NumTemplateArgs);
+}
+
+void CXXNameMangler::mangleUnresolvedTemplateArgs(const TemplateArgument *args,
+ unsigned numArgs) {
// <template-args> ::= I <template-arg>+ E
Out << 'I';
- for (unsigned i = 0; i != NumTemplateArgs; ++i)
- mangleTemplateArg(0, TemplateArgs[i]);
+ for (unsigned i = 0; i != numArgs; ++i)
+ mangleTemplateArg(0, args[i]);
Out << 'E';
}
diff --git a/contrib/llvm/tools/clang/lib/AST/Mangle.cpp b/contrib/llvm/tools/clang/lib/AST/Mangle.cpp
index 3a0b909..c3f3b11 100644
--- a/contrib/llvm/tools/clang/lib/AST/Mangle.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/Mangle.cpp
@@ -48,6 +48,11 @@ static void checkMangleDC(const DeclContext *DC, const BlockDecl *BD) {
const DeclContext *ExpectedDC = BD->getDeclContext();
while (isa<BlockDecl>(ExpectedDC) || isa<EnumDecl>(ExpectedDC))
ExpectedDC = ExpectedDC->getParent();
+ // In-class initializers for non-static data members are lexically defined
+ // within the class, but are mangled as if they were specified as constructor
+ // member initializers.
+ if (isa<CXXRecordDecl>(ExpectedDC) && DC != ExpectedDC)
+ DC = DC->getParent();
assert(DC == ExpectedDC && "Given decl context did not match expected!");
#endif
}
diff --git a/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp b/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp
index 5424beb..4f920f9 100644
--- a/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp
@@ -1113,6 +1113,10 @@ void MicrosoftCXXNameMangler::mangleType(const DecltypeType *T) {
assert(false && "Don't know how to mangle DecltypeTypes yet!");
}
+void MicrosoftCXXNameMangler::mangleType(const UnaryTransformType *T) {
+ assert(false && "Don't know how to mangle UnaryTransformationTypes yet!");
+}
+
void MicrosoftCXXNameMangler::mangleType(const AutoType *T) {
assert(false && "Don't know how to mangle AutoTypes yet!");
}
diff --git a/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp b/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp
index 0770e1f..de0b1d0 100644
--- a/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -582,7 +582,7 @@ protected:
CharUnits NonVirtualSize;
CharUnits NonVirtualAlignment;
- CharUnits ZeroLengthBitfieldAlignment;
+ FieldDecl *ZeroLengthBitfield;
/// PrimaryBase - the primary base class (if one exists) of the class
/// we're laying out.
@@ -621,7 +621,7 @@ protected:
UnfilledBitsInLastByte(0), MaxFieldAlignment(CharUnits::Zero()),
DataSize(0), NonVirtualSize(CharUnits::Zero()),
NonVirtualAlignment(CharUnits::One()),
- ZeroLengthBitfieldAlignment(CharUnits::Zero()), PrimaryBase(0),
+ ZeroLengthBitfield(0), PrimaryBase(0),
PrimaryBaseIsVirtual(false), FirstNearlyEmptyVBase(0) { }
void Layout(const RecordDecl *D);
@@ -1258,27 +1258,112 @@ void RecordLayoutBuilder::LayoutFields(const RecordDecl *D) {
// Layout each field, for now, just sequentially, respecting alignment. In
// the future, this will need to be tweakable by targets.
const FieldDecl *LastFD = 0;
+ ZeroLengthBitfield = 0;
+ unsigned RemainingInAlignment = 0;
for (RecordDecl::field_iterator Field = D->field_begin(),
FieldEnd = D->field_end(); Field != FieldEnd; ++Field) {
if (IsMsStruct) {
- const FieldDecl *FD = (*Field);
- if (Context.ZeroBitfieldFollowsBitfield(FD, LastFD)) {
- // FIXME. Multiple zero bitfields may follow a bitfield.
- // set ZeroLengthBitfieldAlignment to max. of its
- // currrent and alignment of 'FD'.
- std::pair<CharUnits, CharUnits> FieldInfo =
- Context.getTypeInfoInChars(FD->getType());
- ZeroLengthBitfieldAlignment = FieldInfo.second;
- continue;
- }
+ FieldDecl *FD = (*Field);
+ if (Context.ZeroBitfieldFollowsBitfield(FD, LastFD))
+ ZeroLengthBitfield = FD;
// Zero-length bitfields following non-bitfield members are
// ignored:
- if (Context.ZeroBitfieldFollowsNonBitfield(FD, LastFD))
+ else if (Context.ZeroBitfieldFollowsNonBitfield(FD, LastFD))
continue;
+ // FIXME. streamline these conditions into a simple one.
+ else if (Context.BitfieldFollowsBitfield(FD, LastFD) ||
+ Context.BitfieldFollowsNoneBitfield(FD, LastFD) ||
+ Context.NoneBitfieldFollowsBitfield(FD, LastFD)) {
+ // 1) Adjacent bit fields are packed into the same 1-, 2-, or
+ // 4-byte allocation unit if the integral types are the same
+ // size and if the next bit field fits into the current
+ // allocation unit without crossing the boundary imposed by the
+ // common alignment requirements of the bit fields.
+ // 2) Establish a new alignment for a bitfield following
+ // a non-bitfield if size of their types differ.
+ // 3) Establish a new alignment for a non-bitfield following
+ // a bitfield if size of their types differ.
+ std::pair<uint64_t, unsigned> FieldInfo =
+ Context.getTypeInfo(FD->getType());
+ uint64_t TypeSize = FieldInfo.first;
+ unsigned FieldAlign = FieldInfo.second;
+ // This check is needed for 'long long' in -m32 mode.
+ if (TypeSize > FieldAlign)
+ FieldAlign = TypeSize;
+ FieldInfo = Context.getTypeInfo(LastFD->getType());
+ uint64_t TypeSizeLastFD = FieldInfo.first;
+ unsigned FieldAlignLastFD = FieldInfo.second;
+ // This check is needed for 'long long' in -m32 mode.
+ if (TypeSizeLastFD > FieldAlignLastFD)
+ FieldAlignLastFD = TypeSizeLastFD;
+
+ if (TypeSizeLastFD != TypeSize) {
+ if (RemainingInAlignment &&
+ LastFD && LastFD->isBitField() &&
+ LastFD->getBitWidth()->EvaluateAsInt(Context).getZExtValue()) {
+ // If previous field was a bitfield with some remaining unfilled
+ // bits, pad the field so current field starts on its type boundary.
+ uint64_t FieldOffset =
+ getDataSizeInBits() - UnfilledBitsInLastByte;
+ uint64_t NewSizeInBits = RemainingInAlignment + FieldOffset;
+ setDataSize(llvm::RoundUpToAlignment(NewSizeInBits,
+ Context.Target.getCharAlign()));
+ setSize(std::max(getSizeInBits(), getDataSizeInBits()));
+ RemainingInAlignment = 0;
+ }
+
+ uint64_t UnpaddedFieldOffset =
+ getDataSizeInBits() - UnfilledBitsInLastByte;
+ FieldAlign = std::max(FieldAlign, FieldAlignLastFD);
+
+ // The maximum field alignment overrides the aligned attribute.
+ if (!MaxFieldAlignment.isZero()) {
+ unsigned MaxFieldAlignmentInBits =
+ Context.toBits(MaxFieldAlignment);
+ FieldAlign = std::min(FieldAlign, MaxFieldAlignmentInBits);
+ }
+
+ uint64_t NewSizeInBits =
+ llvm::RoundUpToAlignment(UnpaddedFieldOffset, FieldAlign);
+ setDataSize(llvm::RoundUpToAlignment(NewSizeInBits,
+ Context.Target.getCharAlign()));
+ UnfilledBitsInLastByte = getDataSizeInBits() - NewSizeInBits;
+ setSize(std::max(getSizeInBits(), getDataSizeInBits()));
+ }
+ if (FD->isBitField()) {
+ uint64_t FieldSize =
+ FD->getBitWidth()->EvaluateAsInt(Context).getZExtValue();
+ assert (FieldSize > 0 && "LayoutFields - ms_struct layout");
+ if (RemainingInAlignment < FieldSize)
+ RemainingInAlignment = TypeSize - FieldSize;
+ else
+ RemainingInAlignment -= FieldSize;
+ }
+ }
+ else if (FD->isBitField()) {
+ uint64_t FieldSize =
+ FD->getBitWidth()->EvaluateAsInt(Context).getZExtValue();
+ std::pair<uint64_t, unsigned> FieldInfo =
+ Context.getTypeInfo(FD->getType());
+ uint64_t TypeSize = FieldInfo.first;
+ RemainingInAlignment = TypeSize - FieldSize;
+ }
LastFD = FD;
}
LayoutField(*Field);
}
+ if (IsMsStruct && RemainingInAlignment &&
+ LastFD && LastFD->isBitField() &&
+ LastFD->getBitWidth()->EvaluateAsInt(Context).getZExtValue()) {
+ // If we ended a bitfield before the full length of the type then
+ // pad the struct out to the full length of the last type.
+ uint64_t FieldOffset =
+ getDataSizeInBits() - UnfilledBitsInLastByte;
+ uint64_t NewSizeInBits = RemainingInAlignment + FieldOffset;
+ setDataSize(llvm::RoundUpToAlignment(NewSizeInBits,
+ Context.Target.getCharAlign()));
+ setSize(std::max(getSizeInBits(), getDataSizeInBits()));
+ }
}
void RecordLayoutBuilder::LayoutWideBitField(uint64_t FieldSize,
@@ -1355,6 +1440,27 @@ void RecordLayoutBuilder::LayoutBitField(const FieldDecl *D) {
std::pair<uint64_t, unsigned> FieldInfo = Context.getTypeInfo(D->getType());
uint64_t TypeSize = FieldInfo.first;
unsigned FieldAlign = FieldInfo.second;
+
+ // This check is needed for 'long long' in -m32 mode.
+ if (IsMsStruct && (TypeSize > FieldAlign))
+ FieldAlign = TypeSize;
+
+ if (ZeroLengthBitfield) {
+ // If a zero-length bitfield is inserted after a bitfield,
+ // and the alignment of the zero-length bitfield is
+ // greater than the member that follows it, `bar', `bar'
+ // will be aligned as the type of the zero-length bitfield.
+ if (ZeroLengthBitfield != D) {
+ std::pair<uint64_t, unsigned> FieldInfo =
+ Context.getTypeInfo(ZeroLengthBitfield->getType());
+ unsigned ZeroLengthBitfieldAlignment = FieldInfo.second;
+ // Ignore alignment of subsequent zero-length bitfields.
+ if ((ZeroLengthBitfieldAlignment > FieldAlign) || (FieldSize == 0))
+ FieldAlign = ZeroLengthBitfieldAlignment;
+ if (FieldSize)
+ ZeroLengthBitfield = 0;
+ }
+ }
if (FieldSize > TypeSize) {
LayoutWideBitField(FieldSize, TypeSize, FieldPacked, D);
@@ -1455,11 +1561,21 @@ void RecordLayoutBuilder::LayoutField(const FieldDecl *D) {
Context.getTypeInfoInChars(D->getType());
FieldSize = FieldInfo.first;
FieldAlign = FieldInfo.second;
- if (ZeroLengthBitfieldAlignment > FieldAlign)
- FieldAlign = ZeroLengthBitfieldAlignment;
- ZeroLengthBitfieldAlignment = CharUnits::Zero();
+
+ if (ZeroLengthBitfield) {
+ // If a zero-length bitfield is inserted after a bitfield,
+ // and the alignment of the zero-length bitfield is
+ // greater than the member that follows it, `bar', `bar'
+ // will be aligned as the type of the zero-length bitfield.
+ std::pair<CharUnits, CharUnits> FieldInfo =
+ Context.getTypeInfoInChars(ZeroLengthBitfield->getType());
+ CharUnits ZeroLengthBitfieldAlignment = FieldInfo.second;
+ if (ZeroLengthBitfieldAlignment > FieldAlign)
+ FieldAlign = ZeroLengthBitfieldAlignment;
+ ZeroLengthBitfield = 0;
+ }
- if (Context.getLangOptions().MSBitfields) {
+ if (Context.getLangOptions().MSBitfields || IsMsStruct) {
// If MS bitfield layout is required, figure out what type is being
// laid out and align the field to the width of that type.
@@ -1641,10 +1757,10 @@ RecordLayoutBuilder::ComputeKeyFunction(const CXXRecordDecl *RD) {
if (!RD->isPolymorphic())
return 0;
- // A class inside an anonymous namespace doesn't have a key function. (Or
+ // A class that is not externally visible doesn't have a key function. (Or
// at least, there's no point to assigning a key function to such a class;
// this doesn't affect the ABI.)
- if (RD->isInAnonymousNamespace())
+ if (RD->getLinkage() != ExternalLinkage)
return 0;
// Template instantiations don't have key functions,see Itanium C++ ABI 5.2.6.
diff --git a/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp b/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp
index 0d13502..87588e4 100644
--- a/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp
@@ -1297,7 +1297,7 @@ static const char *getTypeTraitName(UnaryTypeTrait UTT) {
case UTT_HasNothrowConstructor: return "__has_nothrow_constructor";
case UTT_HasNothrowCopy: return "__has_nothrow_copy";
case UTT_HasTrivialAssign: return "__has_trivial_assign";
- case UTT_HasTrivialConstructor: return "__has_trivial_constructor";
+ case UTT_HasTrivialDefaultConstructor: return "__has_trivial_constructor";
case UTT_HasTrivialCopy: return "__has_trivial_copy";
case UTT_HasTrivialDestructor: return "__has_trivial_destructor";
case UTT_HasVirtualDestructor: return "__has_virtual_destructor";
@@ -1329,6 +1329,7 @@ static const char *getTypeTraitName(UnaryTypeTrait UTT) {
case UTT_IsSigned: return "__is_signed";
case UTT_IsStandardLayout: return "__is_standard_layout";
case UTT_IsTrivial: return "__is_trivial";
+ case UTT_IsTriviallyCopyable: return "__is_trivially_copyable";
case UTT_IsUnion: return "__is_union";
case UTT_IsUnsigned: return "__is_unsigned";
case UTT_IsVoid: return "__is_void";
@@ -1498,6 +1499,13 @@ void StmtPrinter::VisitBlockDeclRefExpr(BlockDeclRefExpr *Node) {
void StmtPrinter::VisitOpaqueValueExpr(OpaqueValueExpr *Node) {}
+void StmtPrinter::VisitAsTypeExpr(AsTypeExpr *Node) {
+ OS << "__builtin_astype(";
+ PrintExpr(Node->getSrcExpr());
+ OS << ", " << Node->getType().getAsString();
+ OS << ")";
+}
+
//===----------------------------------------------------------------------===//
// Stmt method implementations
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp b/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp
index 44818e8..b117cd9 100644
--- a/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp
@@ -679,6 +679,10 @@ void StmtProfiler::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *S) {
VisitCallExpr(S);
}
+void StmtProfiler::VisitAsTypeExpr(AsTypeExpr *S) {
+ VisitExpr(S);
+}
+
void StmtProfiler::VisitCXXNamedCastExpr(CXXNamedCastExpr *S) {
VisitExplicitCastExpr(S);
}
diff --git a/contrib/llvm/tools/clang/lib/AST/Type.cpp b/contrib/llvm/tools/clang/lib/AST/Type.cpp
index 9eb497b..d2875528 100644
--- a/contrib/llvm/tools/clang/lib/AST/Type.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/Type.cpp
@@ -517,7 +517,7 @@ bool Type::isIntegerType() const {
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
// Incomplete enum types are not treated as integer types.
// FIXME: In C++, enum types are never integer types.
- return ET->getDecl()->isComplete();
+ return ET->getDecl()->isComplete() && !ET->getDecl()->isScoped();
return false;
}
@@ -641,13 +641,27 @@ bool Type::isSignedIntegerType() const {
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) {
// Incomplete enum types are not treated as integer types.
// FIXME: In C++, enum types are never integer types.
- if (ET->getDecl()->isComplete())
+ if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
return ET->getDecl()->getIntegerType()->isSignedIntegerType();
}
return false;
}
+bool Type::isSignedIntegerOrEnumerationType() const {
+ if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType)) {
+ return BT->getKind() >= BuiltinType::Char_S &&
+ BT->getKind() <= BuiltinType::Int128;
+ }
+
+ if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) {
+ if (ET->getDecl()->isComplete())
+ return ET->getDecl()->getIntegerType()->isSignedIntegerType();
+ }
+
+ return false;
+}
+
bool Type::hasSignedIntegerRepresentation() const {
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isSignedIntegerType();
@@ -667,13 +681,27 @@ bool Type::isUnsignedIntegerType() const {
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) {
// Incomplete enum types are not treated as integer types.
// FIXME: In C++, enum types are never integer types.
- if (ET->getDecl()->isComplete())
+ if (ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
}
return false;
}
+bool Type::isUnsignedIntegerOrEnumerationType() const {
+ if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType)) {
+ return BT->getKind() >= BuiltinType::Bool &&
+ BT->getKind() <= BuiltinType::UInt128;
+ }
+
+ if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) {
+ if (ET->getDecl()->isComplete())
+ return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
+ }
+
+ return false;
+}
+
bool Type::hasUnsignedIntegerRepresentation() const {
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isUnsignedIntegerType();
@@ -954,10 +982,37 @@ bool Type::isTrivialType() const {
if (const RecordType *RT = BaseTy->getAs<RecordType>()) {
if (const CXXRecordDecl *ClassDecl =
dyn_cast<CXXRecordDecl>(RT->getDecl())) {
- // C++0x [class]p5:
- // A trivial class is a class that has a trivial default constructor
- if (!ClassDecl->hasTrivialConstructor()) return false;
- // and is trivially copyable.
+ if (!ClassDecl->isTrivial()) return false;
+ }
+
+ return true;
+ }
+
+ // No other types can match.
+ return false;
+}
+
+bool Type::isTriviallyCopyableType() const {
+ if (isDependentType())
+ return false;
+
+ // C++0x [basic.types]p9
+ // Scalar types, trivially copyable class types, arrays of such types, and
+ // cv-qualified versions of these types are collectively called trivial
+ // types.
+ const Type *BaseTy = getBaseElementTypeUnsafe();
+ assert(BaseTy && "NULL element type");
+
+ // Return false for incomplete types after skipping any incomplete array types
+ // which are expressly allowed by the standard and thus our API.
+ if (BaseTy->isIncompleteType())
+ return false;
+
+ // As an extension, Clang treats vector types as Scalar types.
+ if (BaseTy->isScalarType() || BaseTy->isVectorType()) return true;
+ if (const RecordType *RT = BaseTy->getAs<RecordType>()) {
+ if (const CXXRecordDecl *ClassDecl =
+ dyn_cast<CXXRecordDecl>(RT->getDecl())) {
if (!ClassDecl->isTriviallyCopyable()) return false;
}
@@ -1027,11 +1082,7 @@ bool Type::isCXX11PODType() const {
dyn_cast<CXXRecordDecl>(RT->getDecl())) {
// C++11 [class]p10:
// A POD struct is a non-union class that is both a trivial class [...]
- // C++11 [class]p5:
- // A trivial class is a class that has a trivial default constructor
- if (!ClassDecl->hasTrivialConstructor()) return false;
- // and is trivially copyable.
- if (!ClassDecl->isTriviallyCopyable()) return false;
+ if (!ClassDecl->isTrivial()) return false;
// C++11 [class]p10:
// A POD struct is a non-union class that is both a trivial class and
@@ -1484,6 +1535,16 @@ static TagDecl *getInterestingTagDecl(TagDecl *decl) {
return decl;
}
+UnaryTransformType::UnaryTransformType(QualType BaseType,
+ QualType UnderlyingType,
+ UTTKind UKind,
+ QualType CanonicalType)
+ : Type(UnaryTransform, CanonicalType, UnderlyingType->isDependentType(),
+ UnderlyingType->isVariablyModifiedType(),
+ BaseType->containsUnexpandedParameterPack())
+ , BaseType(BaseType), UnderlyingType(UnderlyingType), UKind(UKind)
+{}
+
TagDecl *TagType::getDecl() const {
return getInterestingTagDecl(decl);
}
@@ -1559,13 +1620,13 @@ anyDependentTemplateArguments(const TemplateArgument *Args, unsigned N) {
TemplateSpecializationType::
TemplateSpecializationType(TemplateName T,
- const TemplateArgument *Args,
- unsigned NumArgs, QualType Canon)
+ const TemplateArgument *Args, unsigned NumArgs,
+ QualType Canon, QualType AliasedType)
: Type(TemplateSpecialization,
Canon.isNull()? QualType(this, 0) : Canon,
- T.isDependent(), false, T.containsUnexpandedParameterPack()),
- Template(T), NumArgs(NumArgs)
-{
+ Canon.isNull()? T.isDependent() : Canon->isDependentType(),
+ false, T.containsUnexpandedParameterPack()),
+ Template(T), NumArgs(NumArgs) {
assert(!T.getAsDependentTemplateName() &&
"Use DependentTemplateSpecializationType for dependent template-name");
assert((!Canon.isNull() ||
@@ -1576,7 +1637,12 @@ TemplateSpecializationType(TemplateName T,
= reinterpret_cast<TemplateArgument *>(this + 1);
for (unsigned Arg = 0; Arg < NumArgs; ++Arg) {
// Update dependent and variably-modified bits.
- if (Args[Arg].isDependent())
+ // If the canonical type exists and is non-dependent, the template
+ // specialization type can be non-dependent even if one of the type
+ // arguments is. Given:
+ // template<typename T> using U = int;
+ // U<T> is always non-dependent, irrespective of the type T.
+ if (Canon.isNull() && Args[Arg].isDependent())
setDependent();
if (Args[Arg].getKind() == TemplateArgument::Type &&
Args[Arg].getAsType()->isVariablyModifiedType())
@@ -1586,6 +1652,15 @@ TemplateSpecializationType(TemplateName T,
new (&TemplateArgs[Arg]) TemplateArgument(Args[Arg]);
}
+
+ // Store the aliased type if this is a type alias template specialization.
+ bool IsTypeAlias = !AliasedType.isNull();
+ assert(IsTypeAlias == isTypeAlias() &&
+ "allocated wrong size for type alias");
+ if (IsTypeAlias) {
+ TemplateArgument *Begin = reinterpret_cast<TemplateArgument *>(this + 1);
+ *reinterpret_cast<QualType*>(Begin + getNumArgs()) = AliasedType;
+ }
}
void
@@ -1599,6 +1674,11 @@ TemplateSpecializationType::Profile(llvm::FoldingSetNodeID &ID,
Args[Idx].Profile(ID, Context);
}
+bool TemplateSpecializationType::isTypeAlias() const {
+ TemplateDecl *D = Template.getAsTemplateDecl();
+ return D && isa<TypeAliasTemplateDecl>(D);
+}
+
QualType
QualifierCollector::apply(const ASTContext &Context, QualType QT) const {
if (!hasNonFastQualifiers())
diff --git a/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp b/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp
index 0c5df7f..4519606 100644
--- a/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp
@@ -94,6 +94,7 @@ void TypePrinter::print(const Type *T, Qualifiers Quals, std::string &buffer) {
case Type::TypeOfExpr:
case Type::TypeOf:
case Type::Decltype:
+ case Type::UnaryTransform:
case Type::Record:
case Type::Enum:
case Type::Elaborated:
@@ -512,6 +513,20 @@ void TypePrinter::printDecltype(const DecltypeType *T, std::string &S) {
S = "decltype(" + s.str() + ")" + S;
}
+void TypePrinter::printUnaryTransform(const UnaryTransformType *T,
+ std::string &S) {
+ if (!S.empty())
+ S = ' ' + S;
+ std::string Str;
+ print(T->getBaseType(), Str);
+
+ switch (T->getUTTKind()) {
+ case UnaryTransformType::EnumUnderlyingType:
+ S = "__underlying_type(" + Str + ")" + S;
+ break;
+ }
+}
+
void TypePrinter::printAuto(const AutoType *T, std::string &S) {
// If the type has been deduced, do not print 'auto'.
if (T->isDeduced()) {
@@ -963,7 +978,7 @@ TemplateSpecializationType::PrintTemplateArgumentList(
SpecString += '<';
for (unsigned Arg = 0; Arg < NumArgs; ++Arg) {
- if (SpecString.size() > !SkipBrackets)
+ if (SpecString.size() > unsigned(!SkipBrackets))
SpecString += ", ";
// Print the argument into a string.
diff --git a/contrib/llvm/tools/clang/lib/Analysis/AnalysisContext.cpp b/contrib/llvm/tools/clang/lib/Analysis/AnalysisContext.cpp
index ddc5e88..678f02f 100644
--- a/contrib/llvm/tools/clang/lib/Analysis/AnalysisContext.cpp
+++ b/contrib/llvm/tools/clang/lib/Analysis/AnalysisContext.cpp
@@ -78,16 +78,16 @@ void AnalysisContext::registerForcedBlockExpression(const Stmt *stmt) {
if (!forcedBlkExprs)
forcedBlkExprs = new CFG::BuildOptions::ForcedBlkExprs();
// Default construct an entry for 'stmt'.
- if (const ParenExpr *pe = dyn_cast<ParenExpr>(stmt))
- stmt = pe->IgnoreParens();
+ if (const Expr *e = dyn_cast<Expr>(stmt))
+ stmt = e->IgnoreParens();
(void) (*forcedBlkExprs)[stmt];
}
const CFGBlock *
AnalysisContext::getBlockForRegisteredExpression(const Stmt *stmt) {
assert(forcedBlkExprs);
- if (const ParenExpr *pe = dyn_cast<ParenExpr>(stmt))
- stmt = pe->IgnoreParens();
+ if (const Expr *e = dyn_cast<Expr>(stmt))
+ stmt = e->IgnoreParens();
CFG::BuildOptions::ForcedBlkExprs::const_iterator itr =
forcedBlkExprs->find(stmt);
assert(itr != forcedBlkExprs->end());
diff --git a/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp b/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp
index de16334..3e54020 100644
--- a/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp
+++ b/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp
@@ -320,7 +320,6 @@ private:
AddStmtChoice asc);
CFGBlock *VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *C,
AddStmtChoice asc);
- CFGBlock *VisitCXXMemberCallExpr(CXXMemberCallExpr *C, AddStmtChoice asc);
CFGBlock *VisitCallExpr(CallExpr *C, AddStmtChoice asc);
CFGBlock *VisitCaseStmt(CaseStmt *C);
CFGBlock *VisitChooseExpr(ChooseExpr *C, AddStmtChoice asc);
@@ -398,6 +397,8 @@ private:
if (alwaysAdd(S))
cachedEntry->second = B;
+ // All block-level expressions should have already been IgnoreParens()ed.
+ assert(!isa<Expr>(S) || cast<Expr>(S)->IgnoreParens() == S);
B->appendStmt(const_cast<Stmt*>(S), cfg->getBumpVectorContext());
}
void appendInitializer(CFGBlock *B, CXXCtorInitializer *I) {
@@ -444,7 +445,7 @@ private:
return Result.Val.getInt().getBoolValue();
if (Result.Val.isLValue()) {
- Expr *e = Result.Val.getLValueBase();
+ const Expr *e = Result.Val.getLValueBase();
const CharUnits &c = Result.Val.getLValueOffset();
if (!e && c.isZero())
return false;
@@ -842,11 +843,14 @@ void CFGBuilder::prependAutomaticObjDtorsWithTerminator(CFGBlock* Blk,
/// blocks for ternary operators, &&, and ||. We also process "," and
/// DeclStmts (which may contain nested control-flow).
CFGBlock* CFGBuilder::Visit(Stmt * S, AddStmtChoice asc) {
-tryAgain:
if (!S) {
badCFG = true;
return 0;
}
+
+ if (Expr *E = dyn_cast<Expr>(S))
+ S = E->IgnoreParens();
+
switch (S->getStmtClass()) {
default:
return VisitStmt(S, asc);
@@ -868,6 +872,7 @@ tryAgain:
case Stmt::CallExprClass:
case Stmt::CXXOperatorCallExprClass:
+ case Stmt::CXXMemberCallExprClass:
return VisitCallExpr(cast<CallExpr>(S), asc);
case Stmt::CaseStmtClass:
@@ -903,9 +908,6 @@ tryAgain:
case Stmt::CXXTemporaryObjectExprClass:
return VisitCXXTemporaryObjectExpr(cast<CXXTemporaryObjectExpr>(S), asc);
- case Stmt::CXXMemberCallExprClass:
- return VisitCXXMemberCallExpr(cast<CXXMemberCallExpr>(S), asc);
-
case Stmt::CXXThrowExprClass:
return VisitCXXThrowExpr(cast<CXXThrowExpr>(S));
@@ -960,10 +962,6 @@ tryAgain:
case Stmt::ObjCForCollectionStmtClass:
return VisitObjCForCollectionStmt(cast<ObjCForCollectionStmt>(S));
- case Stmt::ParenExprClass:
- S = cast<ParenExpr>(S)->getSubExpr();
- goto tryAgain;
-
case Stmt::NullStmtClass:
return Block;
@@ -1153,12 +1151,19 @@ static bool CanThrow(Expr *E, ASTContext &Ctx) {
}
CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) {
- // If this is a call to a no-return function, this stops the block here.
- bool NoReturn = false;
- if (getFunctionExtInfo(*C->getCallee()->getType()).getNoReturn()) {
- NoReturn = true;
+ // Compute the callee type.
+ QualType calleeType = C->getCallee()->getType();
+ if (calleeType == Context->BoundMemberTy) {
+ QualType boundType = Expr::findBoundMemberType(C->getCallee());
+
+ // We should only get a null bound type if processing a dependent
+ // CFG. Recover by assuming nothing.
+ if (!boundType.isNull()) calleeType = boundType;
}
+ // If this is a call to a no-return function, this stops the block here.
+ bool NoReturn = getFunctionExtInfo(*calleeType).getNoReturn();
+
bool AddEHEdge = false;
// Languages without exceptions are assumed to not throw.
@@ -1314,6 +1319,12 @@ CFGBlock *CFGBuilder::VisitConditionalOperator(AbstractConditionalOperator *C,
}
CFGBlock *CFGBuilder::VisitDeclStmt(DeclStmt *DS) {
+ // Check if the Decl is for an __label__. If so, elide it from the
+ // CFG entirely.
+ if (isa<LabelDecl>(*DS->decl_begin()))
+ return Block;
+
+ // This case also handles static_asserts.
if (DS->isSingleDecl())
return VisitDeclSubExpr(DS);
@@ -1346,7 +1357,14 @@ CFGBlock *CFGBuilder::VisitDeclStmt(DeclStmt *DS) {
/// DeclStmts and initializers in them.
CFGBlock *CFGBuilder::VisitDeclSubExpr(DeclStmt* DS) {
assert(DS->isSingleDecl() && "Can handle single declarations only.");
-
+ Decl *D = DS->getSingleDecl();
+
+ if (isa<StaticAssertDecl>(D)) {
+ // static_asserts aren't added to the CFG because they do not impact
+ // runtime semantics.
+ return Block;
+ }
+
VarDecl *VD = dyn_cast<VarDecl>(DS->getSingleDecl());
if (!VD) {
@@ -2686,13 +2704,6 @@ CFGBlock *CFGBuilder::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *C,
return VisitChildren(C);
}
-CFGBlock *CFGBuilder::VisitCXXMemberCallExpr(CXXMemberCallExpr *C,
- AddStmtChoice asc) {
- autoCreateBlock();
- appendStmt(Block, C);
- return VisitChildren(C);
-}
-
CFGBlock *CFGBuilder::VisitImplicitCastExpr(ImplicitCastExpr *E,
AddStmtChoice asc) {
if (asc.alwaysAdd(*this, E)) {
@@ -3039,6 +3050,7 @@ static BlkExprMapTy* PopulateBlkExprMap(CFG& cfg) {
if (!CS)
continue;
if (Expr* Exp = dyn_cast<Expr>(CS->getStmt())) {
+ assert((Exp->IgnoreParens() == Exp) && "No parens on block-level exps");
if (BinaryOperator* B = dyn_cast<BinaryOperator>(Exp)) {
// Assignment expressions that are not nested within another
@@ -3046,13 +3058,16 @@ static BlkExprMapTy* PopulateBlkExprMap(CFG& cfg) {
// another expression.
if (B->isAssignmentOp() && !SubExprAssignments.count(Exp))
continue;
- } else if (const StmtExpr* Terminator = dyn_cast<StmtExpr>(Exp)) {
+ } else if (const StmtExpr* SE = dyn_cast<StmtExpr>(Exp)) {
// Special handling for statement expressions. The last statement in
// the statement expression is also a block-level expr.
- const CompoundStmt* C = Terminator->getSubStmt();
+ const CompoundStmt* C = SE->getSubStmt();
if (!C->body_empty()) {
+ const Stmt *Last = C->body_back();
+ if (const Expr *LastEx = dyn_cast<Expr>(Last))
+ Last = LastEx->IgnoreParens();
unsigned x = M->size();
- (*M)[C->body_back()] = x;
+ (*M)[Last] = x;
}
}
@@ -3066,8 +3081,8 @@ static BlkExprMapTy* PopulateBlkExprMap(CFG& cfg) {
Stmt* S = (*I)->getTerminatorCondition();
if (S && M->find(S) == M->end()) {
- unsigned x = M->size();
- (*M)[S] = x;
+ unsigned x = M->size();
+ (*M)[S] = x;
}
}
diff --git a/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp b/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp
index 4c62f36..946c38c 100644
--- a/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp
+++ b/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp
@@ -44,6 +44,7 @@ cocoa::NamingConvention cocoa::deriveNamingConvention(Selector S) {
case OMF_release:
case OMF_retain:
case OMF_retainCount:
+ case OMF_self:
return NoConvention;
case OMF_init:
diff --git a/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp b/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp
index 303dc0f..7b36f85 100644
--- a/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp
+++ b/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp
@@ -157,7 +157,7 @@ void TransferFuncs::Visit(Stmt *S) {
}
else {
// For block-level expressions, mark that they are live.
- LiveState(S,AD) = Alive;
+ LiveState(S, AD) = Alive;
}
}
diff --git a/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp b/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp
index 88a2db7..e80e282 100644
--- a/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp
+++ b/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp
@@ -14,7 +14,7 @@
#include <utility>
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/PackedVector.h"
#include "llvm/ADT/DenseMap.h"
#include "clang/AST/Decl.h"
#include "clang/Analysis/CFG.h"
@@ -93,39 +93,8 @@ static bool isAlwaysUninit(const Value v) {
}
namespace {
-class ValueVector {
- llvm::BitVector vec;
-public:
- ValueVector() {}
- ValueVector(unsigned size) : vec(size << 1) {}
- void resize(unsigned n) { vec.resize(n << 1); }
- void merge(const ValueVector &rhs) { vec |= rhs.vec; }
- bool operator!=(const ValueVector &rhs) const { return vec != rhs.vec; }
- void reset() { vec.reset(); }
-
- class reference {
- ValueVector &vv;
- const unsigned idx;
-
- reference(); // Undefined
- public:
- reference(ValueVector &vv, unsigned idx) : vv(vv), idx(idx) {}
- ~reference() {}
-
- reference &operator=(Value v) {
- vv.vec[idx << 1] = (((unsigned) v) & 0x1) ? true : false;
- vv.vec[(idx << 1) | 1] = (((unsigned) v) & 0x2) ? true : false;
- return *this;
- }
- operator Value() {
- unsigned x = (vv.vec[idx << 1] ? 1 : 0) | (vv.vec[(idx << 1) | 1] ? 2 :0);
- return (Value) x;
- }
- };
-
- reference operator[](unsigned idx) { return reference(*this, idx); }
-};
+typedef llvm::PackedVector<Value, 2> ValueVector;
typedef std::pair<ValueVector *, ValueVector *> BVPair;
class CFGBlockValues {
@@ -214,11 +183,15 @@ static BinaryOperator *getLogicalOperatorInChain(const CFGBlock *block) {
if (!b || !b->isLogicalOp())
return 0;
- if (block->pred_size() == 2 &&
- ((block->succ_size() == 2 && block->getTerminatorCondition() == b) ||
- block->size() == 1))
- return b;
-
+ if (block->pred_size() == 2) {
+ if (block->getTerminatorCondition() == b) {
+ if (block->succ_size() == 2)
+ return b;
+ }
+ else if (block->size() == 1)
+ return b;
+ }
+
return 0;
}
@@ -255,7 +228,7 @@ void CFGBlockValues::mergeIntoScratch(ValueVector const &source,
if (isFirst)
scratch = source;
else
- scratch.merge(source);
+ scratch |= source;
}
#if 0
static void printVector(const CFGBlock *block, ValueVector &bv,
diff --git a/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp b/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp
index e8cd218..11887ab 100644
--- a/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp
@@ -212,6 +212,42 @@ void Diagnostic::setDiagnosticMapping(diag::kind Diag, diag::Mapping Map,
FullSourceLoc(Loc, *SourceMgr)));
}
+void Diagnostic::Report(const StoredDiagnostic &storedDiag) {
+ assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!");
+
+ CurDiagLoc = storedDiag.getLocation();
+ CurDiagID = storedDiag.getID();
+ NumDiagArgs = 0;
+
+ NumDiagRanges = storedDiag.range_size();
+ assert(NumDiagRanges < sizeof(DiagRanges)/sizeof(DiagRanges[0]) &&
+ "Too many arguments to diagnostic!");
+ unsigned i = 0;
+ for (StoredDiagnostic::range_iterator
+ RI = storedDiag.range_begin(),
+ RE = storedDiag.range_end(); RI != RE; ++RI)
+ DiagRanges[i++] = *RI;
+
+ NumFixItHints = storedDiag.fixit_size();
+ assert(NumFixItHints < Diagnostic::MaxFixItHints && "Too many fix-it hints!");
+ i = 0;
+ for (StoredDiagnostic::fixit_iterator
+ FI = storedDiag.fixit_begin(),
+ FE = storedDiag.fixit_end(); FI != FE; ++FI)
+ FixItHints[i++] = *FI;
+
+ assert(Client && "DiagnosticClient not set!");
+ Level DiagLevel = storedDiag.getLevel();
+ DiagnosticInfo Info(this, storedDiag.getMessage());
+ Client->HandleDiagnostic(DiagLevel, Info);
+ if (Client->IncludeInDiagnosticCounts()) {
+ if (DiagLevel == Diagnostic::Warning)
+ ++NumWarnings;
+ }
+
+ CurDiagID = ~0U;
+}
+
void DiagnosticBuilder::FlushCounts() {
DiagObj->NumDiagArgs = NumArgs;
DiagObj->NumDiagRanges = NumRanges;
@@ -486,10 +522,15 @@ static void HandlePluralModifier(const DiagnosticInfo &DInfo, unsigned ValNo,
/// array.
void DiagnosticInfo::
FormatDiagnostic(llvm::SmallVectorImpl<char> &OutStr) const {
- const char *DiagStr = getDiags()->getDiagnosticIDs()->getDescription(getID());
- const char *DiagEnd = DiagStr+strlen(DiagStr);
+ if (!StoredDiagMessage.empty()) {
+ OutStr.append(StoredDiagMessage.begin(), StoredDiagMessage.end());
+ return;
+ }
+
+ llvm::StringRef Diag =
+ getDiags()->getDiagnosticIDs()->getDescription(getID());
- FormatDiagnostic(DiagStr, DiagEnd, OutStr);
+ FormatDiagnostic(Diag.begin(), Diag.end(), OutStr);
}
void DiagnosticInfo::
diff --git a/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp b/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp
index b4dd575..6d7e320 100644
--- a/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp
@@ -45,14 +45,37 @@ struct StaticDiagInfoRec {
unsigned SFINAE : 1;
unsigned AccessControl : 1;
unsigned Category : 5;
-
- const char *Name;
-
- const char *Description;
- const char *OptionGroup;
- const char *BriefExplanation;
- const char *FullExplanation;
+ uint8_t NameLen;
+ uint8_t OptionGroupLen;
+
+ uint16_t DescriptionLen;
+ uint16_t BriefExplanationLen;
+ uint16_t FullExplanationLen;
+
+ const char *NameStr;
+ const char *OptionGroupStr;
+
+ const char *DescriptionStr;
+ const char *BriefExplanationStr;
+ const char *FullExplanationStr;
+
+ llvm::StringRef getName() const {
+ return llvm::StringRef(NameStr, NameLen);
+ }
+ llvm::StringRef getOptionGroup() const {
+ return llvm::StringRef(OptionGroupStr, OptionGroupLen);
+ }
+
+ llvm::StringRef getDescription() const {
+ return llvm::StringRef(DescriptionStr, DescriptionLen);
+ }
+ llvm::StringRef getBriefExplanation() const {
+ return llvm::StringRef(BriefExplanationStr, BriefExplanationLen);
+ }
+ llvm::StringRef getFullExplanation() const {
+ return llvm::StringRef(FullExplanationStr, FullExplanationLen);
+ }
bool operator<(const StaticDiagInfoRec &RHS) const {
return DiagID < RHS.DiagID;
@@ -60,27 +83,42 @@ struct StaticDiagInfoRec {
};
struct StaticDiagNameIndexRec {
- const char *Name;
+ const char *NameStr;
unsigned short DiagID;
-
+ uint8_t NameLen;
+
+ llvm::StringRef getName() const {
+ return llvm::StringRef(NameStr, NameLen);
+ }
+
bool operator<(const StaticDiagNameIndexRec &RHS) const {
- assert(Name && RHS.Name && "Null Diagnostic Name");
- return strcmp(Name, RHS.Name) == -1;
+ return getName() < RHS.getName();
}
bool operator==(const StaticDiagNameIndexRec &RHS) const {
- assert(Name && RHS.Name && "Null Diagnostic Name");
- return strcmp(Name, RHS.Name) == 0;
+ return getName() == RHS.getName();
}
};
-}
+template <size_t SizeOfStr, typename FieldType>
+class StringSizerHelper {
+ char FIELD_TOO_SMALL[SizeOfStr <= FieldType(~0U) ? 1 : -1];
+public:
+ enum { Size = SizeOfStr };
+};
+
+} // namespace anonymous
+
+#define STR_SIZE(str, fieldTy) StringSizerHelper<sizeof(str)-1, fieldTy>::Size
static const StaticDiagInfoRec StaticDiagInfo[] = {
-#define DIAG(ENUM,CLASS,DEFAULT_MAPPING,DESC,GROUP, \
- SFINAE,ACCESS,CATEGORY,BRIEF,FULL) \
- { diag::ENUM, DEFAULT_MAPPING, CLASS, SFINAE, \
- ACCESS, CATEGORY, #ENUM, DESC, GROUP, BRIEF, FULL },
+#define DIAG(ENUM,CLASS,DEFAULT_MAPPING,DESC,GROUP, \
+ SFINAE,ACCESS,CATEGORY,BRIEF,FULL) \
+ { diag::ENUM, DEFAULT_MAPPING, CLASS, SFINAE, ACCESS, CATEGORY, \
+ STR_SIZE(#ENUM, uint8_t), STR_SIZE(GROUP, uint8_t), \
+ STR_SIZE(DESC, uint16_t), STR_SIZE(BRIEF, uint16_t), \
+ STR_SIZE(FULL, uint16_t), \
+ #ENUM, GROUP, DESC, BRIEF, FULL },
#include "clang/Basic/DiagnosticCommonKinds.inc"
#include "clang/Basic/DiagnosticDriverKinds.inc"
#include "clang/Basic/DiagnosticFrontendKinds.inc"
@@ -90,7 +128,7 @@ static const StaticDiagInfoRec StaticDiagInfo[] = {
#include "clang/Basic/DiagnosticSemaKinds.inc"
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
#undef DIAG
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
static const unsigned StaticDiagInfoSize =
@@ -98,10 +136,10 @@ static const unsigned StaticDiagInfoSize =
/// To be sorted before first use (since it's splitted among multiple files)
static StaticDiagNameIndexRec StaticDiagNameIndex[] = {
-#define DIAG_NAME_INDEX(ENUM) { #ENUM, diag::ENUM },
+#define DIAG_NAME_INDEX(ENUM) { #ENUM, diag::ENUM, STR_SIZE(#ENUM, uint8_t) },
#include "clang/Basic/DiagnosticIndexName.inc"
#undef DIAG_NAME_INDEX
- { 0, 0 }
+ { 0, 0, 0 }
};
static const unsigned StaticDiagNameIndexSize =
@@ -127,7 +165,7 @@ static const StaticDiagInfoRec *GetDiagInfo(unsigned DiagID) {
#endif
// Search the diagnostic table with a binary search.
- StaticDiagInfoRec Find = { DiagID, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ StaticDiagInfoRec Find = { DiagID, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0 };
const StaticDiagInfoRec *Found =
std::lower_bound(StaticDiagInfo, StaticDiagInfo + StaticDiagInfoSize, Find);
@@ -147,10 +185,10 @@ static unsigned GetDefaultDiagMapping(unsigned DiagID) {
/// getWarningOptionForDiag - Return the lowest-level warning option that
/// enables the specified diagnostic. If there is no -Wfoo flag that controls
/// the diagnostic, this returns null.
-const char *DiagnosticIDs::getWarningOptionForDiag(unsigned DiagID) {
+llvm::StringRef DiagnosticIDs::getWarningOptionForDiag(unsigned DiagID) {
if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID))
- return Info->OptionGroup;
- return 0;
+ return Info->getOptionGroup();
+ return llvm::StringRef();
}
/// getCategoryNumberForDiag - Return the category number that a specified
@@ -161,23 +199,36 @@ unsigned DiagnosticIDs::getCategoryNumberForDiag(unsigned DiagID) {
return 0;
}
-/// getCategoryNameFromID - Given a category ID, return the name of the
-/// category, an empty string if CategoryID is zero, or null if CategoryID is
-/// invalid.
-const char *DiagnosticIDs::getCategoryNameFromID(unsigned CategoryID) {
- // Second the table of options, sorted by name for fast binary lookup.
- static const char *CategoryNameTable[] = {
+// The diagnostic category names.
+struct StaticDiagCategoryRec {
+ const char *NameStr;
+ uint8_t NameLen;
+
+ llvm::StringRef getName() const {
+ return llvm::StringRef(NameStr, NameLen);
+ }
+};
+
+static StaticDiagCategoryRec CategoryNameTable[] = {
#define GET_CATEGORY_TABLE
-#define CATEGORY(X) X,
+#define CATEGORY(X) { X, STR_SIZE(X, uint8_t) },
#include "clang/Basic/DiagnosticGroups.inc"
#undef GET_CATEGORY_TABLE
- "<<END>>"
- };
- static const size_t CategoryNameTableSize =
- sizeof(CategoryNameTable) / sizeof(CategoryNameTable[0])-1;
-
- if (CategoryID >= CategoryNameTableSize) return 0;
- return CategoryNameTable[CategoryID];
+ { 0, 0 }
+};
+
+/// getNumberOfCategories - Return the number of categories
+unsigned DiagnosticIDs::getNumberOfCategories() {
+ return sizeof(CategoryNameTable) / sizeof(CategoryNameTable[0])-1;
+}
+
+/// getCategoryNameFromID - Given a category ID, return the name of the
+/// category, an empty string if CategoryID is zero, or null if CategoryID is
+/// invalid.
+llvm::StringRef DiagnosticIDs::getCategoryNameFromID(unsigned CategoryID) {
+ if (CategoryID >= getNumberOfCategories())
+ return llvm::StringRef();
+ return CategoryNameTable[CategoryID].getName();
}
@@ -202,25 +253,25 @@ DiagnosticIDs::getDiagnosticSFINAEResponse(unsigned DiagID) {
}
/// getName - Given a diagnostic ID, return its name
-const char *DiagnosticIDs::getName(unsigned DiagID) {
+llvm::StringRef DiagnosticIDs::getName(unsigned DiagID) {
if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID))
- return Info->Name;
- return 0;
+ return Info->getName();
+ return llvm::StringRef();
}
/// getIdFromName - Given a diagnostic name, return its ID, or 0
-unsigned DiagnosticIDs::getIdFromName(char const *Name) {
+unsigned DiagnosticIDs::getIdFromName(llvm::StringRef Name) {
StaticDiagNameIndexRec *StaticDiagNameIndexEnd =
StaticDiagNameIndex + StaticDiagNameIndexSize;
- if (Name == 0) { return diag::DIAG_UPPER_LIMIT; }
+ if (Name.empty()) { return diag::DIAG_UPPER_LIMIT; }
- StaticDiagNameIndexRec Find = { Name, 0 };
+ StaticDiagNameIndexRec Find = { Name.data(), 0, Name.size() };
const StaticDiagNameIndexRec *Found =
std::lower_bound( StaticDiagNameIndex, StaticDiagNameIndexEnd, Find);
if (Found == StaticDiagNameIndexEnd ||
- strcmp(Found->Name, Name) != 0)
+ Found->getName() != Name)
return diag::DIAG_UPPER_LIMIT;
return Found->DiagID;
@@ -228,18 +279,18 @@ unsigned DiagnosticIDs::getIdFromName(char const *Name) {
/// getBriefExplanation - Given a diagnostic ID, return a brief explanation
/// of the issue
-const char *DiagnosticIDs::getBriefExplanation(unsigned DiagID) {
+llvm::StringRef DiagnosticIDs::getBriefExplanation(unsigned DiagID) {
if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID))
- return Info->BriefExplanation;
- return 0;
+ return Info->getBriefExplanation();
+ return llvm::StringRef();
}
/// getFullExplanation - Given a diagnostic ID, return a full explanation
/// of the issue
-const char *DiagnosticIDs::getFullExplanation(unsigned DiagID) {
+llvm::StringRef DiagnosticIDs::getFullExplanation(unsigned DiagID) {
if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID))
- return Info->FullExplanation;
- return 0;
+ return Info->getFullExplanation();
+ return llvm::StringRef();
}
/// getBuiltinDiagClass - Return the class field of the diagnostic.
@@ -264,10 +315,10 @@ namespace clang {
/// getDescription - Return the description of the specified custom
/// diagnostic.
- const char *getDescription(unsigned DiagID) const {
+ llvm::StringRef getDescription(unsigned DiagID) const {
assert(this && DiagID-DIAG_UPPER_LIMIT < DiagInfo.size() &&
"Invalid diagnosic ID");
- return DiagInfo[DiagID-DIAG_UPPER_LIMIT].second.c_str();
+ return DiagInfo[DiagID-DIAG_UPPER_LIMIT].second;
}
/// getLevel - Return the level of the specified custom diagnostic.
@@ -352,9 +403,9 @@ bool DiagnosticIDs::isBuiltinExtensionDiag(unsigned DiagID,
/// getDescription - Given a diagnostic ID, return a description of the
/// issue.
-const char *DiagnosticIDs::getDescription(unsigned DiagID) const {
+llvm::StringRef DiagnosticIDs::getDescription(unsigned DiagID) const {
if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID))
- return Info->Description;
+ return Info->getDescription();
return CustomDiagInfo->getDescription(DiagID);
}
@@ -493,9 +544,15 @@ DiagnosticIDs::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass,
}
struct WarningOption {
- const char *Name;
+ // Be safe with the size of 'NameLen' because we don't statically check if the
+ // size will fit in the field; the struct size won't decrease with a shorter
+ // type anyway.
+ size_t NameLen;
+ const char *NameStr;
const short *Members;
const short *SubGroups;
+
+ llvm::StringRef getName() const { return llvm::StringRef(NameStr, NameLen); }
};
#define GET_DIAG_ARRAYS
@@ -513,7 +570,7 @@ sizeof(OptionTable) / sizeof(OptionTable[0]);
static bool WarningOptionCompare(const WarningOption &LHS,
const WarningOption &RHS) {
- return strcmp(LHS.Name, RHS.Name) < 0;
+ return LHS.getName() < RHS.getName();
}
static void MapGroupMembers(const WarningOption *Group, diag::Mapping Mapping,
@@ -534,10 +591,10 @@ static void MapGroupMembers(const WarningOption *Group, diag::Mapping Mapping,
/// setDiagnosticGroupMapping - Change an entire diagnostic group (e.g.
/// "unknown-pragmas" to have the specified mapping. This returns true and
/// ignores the request if "Group" was unknown, false otherwise.
-bool DiagnosticIDs::setDiagnosticGroupMapping(const char *Group,
- diag::Mapping Map,
- SourceLocation Loc,
- Diagnostic &Diag) const {
+bool DiagnosticIDs::setDiagnosticGroupMapping(llvm::StringRef Group,
+ diag::Mapping Map,
+ SourceLocation Loc,
+ Diagnostic &Diag) const {
assert((Loc.isValid() ||
Diag.DiagStatePoints.empty() ||
Diag.DiagStatePoints.back().Loc.isInvalid()) &&
@@ -548,12 +605,12 @@ bool DiagnosticIDs::setDiagnosticGroupMapping(const char *Group,
Diag.DiagStatePoints.back().Loc)) &&
"Source location of new mapping is before the previous one!");
- WarningOption Key = { Group, 0, 0 };
+ WarningOption Key = { Group.size(), Group.data(), 0, 0 };
const WarningOption *Found =
std::lower_bound(OptionTable, OptionTable + OptionTableSize, Key,
WarningOptionCompare);
if (Found == OptionTable + OptionTableSize ||
- strcmp(Found->Name, Group) != 0)
+ Found->getName() != Group)
return true; // Option not found.
MapGroupMembers(Found, Map, Loc, Diag);
diff --git a/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp b/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp
index 4e5a129..f747c53 100644
--- a/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp
@@ -264,10 +264,6 @@ void FileManager::addAncestorsAsVirtualDirs(llvm::StringRef Path) {
/// exist.
///
const DirectoryEntry *FileManager::getDirectory(llvm::StringRef DirName) {
- // stat doesn't like trailing separators (at least on Windows).
- if (DirName.size() > 1 && llvm::sys::path::is_separator(DirName.back()))
- DirName = DirName.substr(0, DirName.size()-1);
-
++NumDirLookups;
llvm::StringMapEntry<DirectoryEntry *> &NamedDirEnt =
SeenDirEntries.GetOrCreateValue(DirName);
diff --git a/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp b/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp
index cb1f55b..4711faa 100644
--- a/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp
@@ -392,6 +392,7 @@ ObjCMethodFamily Selector::getMethodFamilyImpl(Selector sel) {
if (name == "release") return OMF_release;
if (name == "retain") return OMF_retain;
if (name == "retainCount") return OMF_retainCount;
+ if (name == "self") return OMF_self;
}
// The other method families may begin with a prefix of underscores.
diff --git a/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp b/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
index c3e0393..2de8ab7 100644
--- a/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp
@@ -961,6 +961,12 @@ static void ComputeLineNumbers(Diagnostic &Diag, ContentCache *FI,
/// about to emit a diagnostic.
unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos,
bool *Invalid) const {
+ if (FID.isInvalid()) {
+ if (Invalid)
+ *Invalid = true;
+ return 1;
+ }
+
ContentCache *Content;
if (LastLineNoFileIDQuery == FID)
Content = LastLineNoContentCache;
@@ -1207,6 +1213,73 @@ PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc) const {
return PresumedLoc(Filename, LineNo, ColNo, IncludeLoc);
}
+/// \brief Returns true if the given MacroID location points at the first
+/// token of the macro instantiation.
+bool SourceManager::isAtStartOfMacroInstantiation(SourceLocation loc) const {
+ assert(loc.isValid() && loc.isMacroID() && "Expected a valid macro loc");
+
+ unsigned FID = getFileID(loc).ID;
+ assert(FID > 1);
+ std::pair<SourceLocation, SourceLocation>
+ instRange = getImmediateInstantiationRange(loc);
+
+ bool invalid = false;
+ const SrcMgr::SLocEntry &Entry = getSLocEntry(FID-1, &invalid);
+ if (invalid)
+ return false;
+
+ // If the FileID immediately before it is a file then this is the first token
+ // in the macro.
+ if (Entry.isFile())
+ return true;
+
+ // If the FileID immediately before it (which is a macro token) is the
+ // immediate instantiated macro, check this macro token's location.
+ if (getFileID(instRange.second).ID == FID-1)
+ return isAtStartOfMacroInstantiation(instRange.first);
+
+ // If the FileID immediately before it (which is a macro token) came from a
+ // different instantiation, then this is the first token in the macro.
+ if (getInstantiationLoc(Entry.getInstantiation().getInstantiationLocStart())
+ != getInstantiationLoc(loc))
+ return true;
+
+ // It is inside the macro or the last token in the macro.
+ return false;
+}
+
+/// \brief Returns true if the given MacroID location points at the last
+/// token of the macro instantiation.
+bool SourceManager::isAtEndOfMacroInstantiation(SourceLocation loc) const {
+ assert(loc.isValid() && loc.isMacroID() && "Expected a valid macro loc");
+
+ unsigned FID = getFileID(loc).ID;
+ assert(FID > 1);
+ std::pair<SourceLocation, SourceLocation>
+ instRange = getInstantiationRange(loc);
+
+ // If there's no FileID after it, it is the last token in the macro.
+ if (FID+1 == sloc_entry_size())
+ return true;
+
+ bool invalid = false;
+ const SrcMgr::SLocEntry &Entry = getSLocEntry(FID+1, &invalid);
+ if (invalid)
+ return false;
+
+ // If the FileID immediately after it is a file or a macro token which
+ // came from a different instantiation, then this is the last token in the
+ // macro.
+ if (Entry.isFile())
+ return true;
+ if (getInstantiationLoc(Entry.getInstantiation().getInstantiationLocStart())
+ != instRange.first)
+ return true;
+
+ // It is inside the macro or the first token in the macro.
+ return false;
+}
+
//===----------------------------------------------------------------------===//
// Other miscellaneous methods.
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
index 97109ca..dd167dc 100644
--- a/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
+++ b/contrib/llvm/tools/clang/lib/Basic/Targets.cpp
@@ -1121,7 +1121,7 @@ public:
}
virtual bool validateAsmConstraint(const char *&Name,
TargetInfo::ConstraintInfo &info) const;
- virtual std::string convertConstraint(const char Constraint) const;
+ virtual std::string convertConstraint(const char *&Constraint) const;
virtual const char *getClobbers() const {
return "~{dirflag},~{fpsr},~{flags}";
}
@@ -1180,7 +1180,7 @@ void X86TargetInfo::getDefaultFeatures(const std::string &CPU,
else if (CPU == "corei7") {
setFeatureEnabled(Features, "sse4", true);
setFeatureEnabled(Features, "aes", true);
- } else if (CPU == "sandybridge") {
+ } else if (CPU == "corei7-avx") {
setFeatureEnabled(Features, "sse4", true);
setFeatureEnabled(Features, "aes", true);
// setFeatureEnabled(Features, "avx", true);
@@ -1449,8 +1449,8 @@ X86TargetInfo::validateAsmConstraint(const char *&Name,
std::string
-X86TargetInfo::convertConstraint(const char Constraint) const {
- switch (Constraint) {
+X86TargetInfo::convertConstraint(const char *&Constraint) const {
+ switch (*Constraint) {
case 'a': return std::string("{ax}");
case 'b': return std::string("{bx}");
case 'c': return std::string("{cx}");
@@ -1464,7 +1464,7 @@ X86TargetInfo::convertConstraint(const char Constraint) const {
case 'u': // second from top of floating point stack.
return std::string("{st(1)}"); // second from top of floating point stack.
default:
- return std::string(1, Constraint);
+ return std::string(1, *Constraint);
}
}
} // end anonymous namespace
@@ -1993,11 +1993,11 @@ public:
if (CPU == "xscale")
Builder.defineMacro("__XSCALE__");
- bool IsThumb2 = IsThumb && (CPUArch == "6T2" || CPUArch.startswith("7"));
+ bool IsARMv7 = CPUArch.startswith("7");
if (IsThumb) {
Builder.defineMacro("__THUMBEL__");
Builder.defineMacro("__thumb__");
- if (IsThumb2)
+ if (CPUArch == "6T2" || IsARMv7)
Builder.defineMacro("__thumb2__");
}
@@ -2011,7 +2011,7 @@ public:
// the VFP define, hence the soft float and arch check. This is subtly
// different from gcc, we follow the intent which was that it should be set
// when Neon instructions are actually available.
- if (FPU == NeonFPU && !SoftFloat && IsThumb2)
+ if (FPU == NeonFPU && !SoftFloat && IsARMv7)
Builder.defineMacro("__ARM_NEON__");
}
virtual void getTargetBuiltins(const Builtin::Info *&Records,
@@ -2020,7 +2020,7 @@ public:
NumRecords = clang::ARM::LastTSBuiltin-Builtin::FirstTSBuiltin;
}
virtual const char *getVAListDeclaration() const {
- return "typedef char* __builtin_va_list;";
+ return "typedef void* __builtin_va_list;";
}
virtual void getGCCRegNames(const char * const *&Names,
unsigned &NumNames) const;
@@ -2037,9 +2037,31 @@ public:
case 'P': // VFP Floating point register double precision
Info.setAllowsRegister();
return true;
+ case 'U': // a memory reference...
+ switch (Name[1]) {
+ case 'q': // ...ARMV4 ldrsb
+ case 'v': // ...VFP load/store (reg+constant offset)
+ case 'y': // ...iWMMXt load/store
+ Info.setAllowsMemory();
+ Name++;
+ return true;
+ }
}
return false;
}
+ std::string
+ virtual convertConstraint(const char *&Constraint) const {
+ std::string R;
+ switch (*Constraint) {
+ case 'U': // Two-character constraint; add "^" hint for later parsing.
+ R = std::string("^") + std::string(Constraint, 2);
+ Constraint++;
+ break;
+ default:
+ return std::string(1, *Constraint);
+ }
+ return R;
+ }
virtual const char *getClobbers() const {
// FIXME: Is this really right?
return "";
@@ -2531,7 +2553,9 @@ class MipsTargetInfo : public TargetInfo {
public:
MipsTargetInfo(const std::string& triple) : TargetInfo(triple), ABI("o32") {
DescriptionString = "E-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-"
- "i64:32:64-f32:32:32-f64:64:64-v64:64:64-n32";
+ "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32";
+ SizeType = UnsignedInt;
+ PtrDiffType = SignedInt;
}
virtual const char *getABI() const { return ABI.c_str(); }
virtual bool setABI(const std::string &Name) {
@@ -2663,7 +2687,7 @@ class MipselTargetInfo : public MipsTargetInfo {
public:
MipselTargetInfo(const std::string& triple) : MipsTargetInfo(triple) {
DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-"
- "i64:32:64-f32:32:32-f64:64:64-v64:64:64-n32";
+ "i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32";
}
virtual void getTargetDefines(const LangOptions &Opts,
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp b/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp
index 1264473..01d15ff 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp
@@ -21,12 +21,11 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/StandardPasses.h"
+#include "llvm/Support/PassManagerBuilder.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/SubtargetFeature.h"
#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetLibraryInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetRegistry.h"
@@ -109,67 +108,62 @@ void EmitAssemblyHelper::CreatePasses() {
OptLevel = 0;
Inlining = CodeGenOpts.NoInlining;
}
-
- FunctionPassManager *FPM = getPerFunctionPasses();
-
- TargetLibraryInfo *TLI =
- new TargetLibraryInfo(Triple(TheModule->getTargetTriple()));
+
+ PassManagerBuilder PMBuilder;
+ PMBuilder.OptLevel = OptLevel;
+ PMBuilder.SizeLevel = CodeGenOpts.OptimizeSize;
+
+ PMBuilder.DisableSimplifyLibCalls = !CodeGenOpts.SimplifyLibCalls;
+ PMBuilder.DisableUnitAtATime = !CodeGenOpts.UnitAtATime;
+ PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops;
+
+ // Figure out TargetLibraryInfo.
+ Triple TargetTriple(TheModule->getTargetTriple());
+ PMBuilder.LibraryInfo = new TargetLibraryInfo(TargetTriple);
if (!CodeGenOpts.SimplifyLibCalls)
- TLI->disableAllFunctions();
- FPM->add(TLI);
-
- // In -O0 if checking is disabled, we don't even have per-function passes.
- if (CodeGenOpts.VerifyModule)
- FPM->add(createVerifierPass());
-
- // Assume that standard function passes aren't run for -O0.
- if (OptLevel > 0)
- llvm::createStandardFunctionPasses(FPM, OptLevel);
-
- llvm::Pass *InliningPass = 0;
+ PMBuilder.LibraryInfo->disableAllFunctions();
+
switch (Inlining) {
case CodeGenOptions::NoInlining: break;
case CodeGenOptions::NormalInlining: {
- // Set the inline threshold following llvm-gcc.
- //
// FIXME: Derive these constants in a principled fashion.
unsigned Threshold = 225;
- if (CodeGenOpts.OptimizeSize == 1) //-Os
+ if (CodeGenOpts.OptimizeSize == 1) // -Os
Threshold = 75;
- else if (CodeGenOpts.OptimizeSize == 2) //-Oz
+ else if (CodeGenOpts.OptimizeSize == 2) // -Oz
Threshold = 25;
else if (OptLevel > 2)
Threshold = 275;
- InliningPass = createFunctionInliningPass(Threshold);
+ PMBuilder.Inliner = createFunctionInliningPass(Threshold);
break;
}
case CodeGenOptions::OnlyAlwaysInlining:
- InliningPass = createAlwaysInlinerPass(); // Respect always_inline
+ // Respect always_inline.
+ PMBuilder.Inliner = createAlwaysInlinerPass();
break;
}
- PassManager *MPM = getPerModulePasses();
+
+ // Set up the per-function pass manager.
+ FunctionPassManager *FPM = getPerFunctionPasses();
+ if (CodeGenOpts.VerifyModule)
+ FPM->add(createVerifierPass());
+ PMBuilder.populateFunctionPassManager(*FPM);
- TLI = new TargetLibraryInfo(Triple(TheModule->getTargetTriple()));
- if (!CodeGenOpts.SimplifyLibCalls)
- TLI->disableAllFunctions();
- MPM->add(TLI);
+ // Set up the per-module pass manager.
+ PassManager *MPM = getPerModulePasses();
if (CodeGenOpts.EmitGcovArcs || CodeGenOpts.EmitGcovNotes) {
MPM->add(createGCOVProfilerPass(CodeGenOpts.EmitGcovNotes,
- CodeGenOpts.EmitGcovArcs));
+ CodeGenOpts.EmitGcovArcs,
+ TargetTriple.isMacOSX()));
+
if (!CodeGenOpts.DebugInfo)
MPM->add(createStripSymbolsPass(true));
}
-
- // For now we always create per module passes.
- llvm::createStandardModulePasses(MPM, OptLevel,
- CodeGenOpts.OptimizeSize,
- CodeGenOpts.UnitAtATime,
- CodeGenOpts.UnrollLoops,
- CodeGenOpts.SimplifyLibCalls,
- /*HaveExceptions=*/true,
- InliningPass);
+
+
+ PMBuilder.populateModulePassManager(*MPM);
}
bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
@@ -215,7 +209,6 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
NoZerosInBSS = CodeGenOpts.NoZeroInitializedInBSS;
llvm::UnsafeFPMath = CodeGenOpts.UnsafeFPMath;
llvm::UseSoftFloat = CodeGenOpts.SoftFloat;
- UnwindTablesMandatory = CodeGenOpts.UnwindTables;
TargetMachine::setAsmVerbosityDefault(CodeGenOpts.AsmVerbose);
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp
index 99a69a4..e5da703 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp
@@ -189,23 +189,6 @@ namespace {
}
}
-/// Determines if the given record type has a mutable field.
-static bool hasMutableField(const CXXRecordDecl *record) {
- for (CXXRecordDecl::field_iterator
- i = record->field_begin(), e = record->field_end(); i != e; ++i)
- if ((*i)->isMutable())
- return true;
-
- for (CXXRecordDecl::base_class_const_iterator
- i = record->bases_begin(), e = record->bases_end(); i != e; ++i) {
- const RecordType *record = i->getType()->castAs<RecordType>();
- if (hasMutableField(cast<CXXRecordDecl>(record->getDecl())))
- return true;
- }
-
- return false;
-}
-
/// Determines if the given type is safe for constant capture in C++.
static bool isSafeForCXXConstantCapture(QualType type) {
const RecordType *recordType =
@@ -222,7 +205,7 @@ static bool isSafeForCXXConstantCapture(QualType type) {
// Otherwise, we just have to make sure there aren't any mutable
// fields that might have changed since initialization.
- return !hasMutableField(record);
+ return !record->hasMutableFields();
}
/// It is illegal to modify a const object after initialization.
@@ -262,7 +245,7 @@ static CharUnits getLowBit(CharUnits v) {
}
static void initializeForBlockHeader(CodeGenModule &CGM, CGBlockInfo &info,
- std::vector<const llvm::Type*> &elementTypes) {
+ llvm::SmallVectorImpl<const llvm::Type*> &elementTypes) {
ASTContext &C = CGM.getContext();
// The header is basically a 'struct { void *; int; int; void *; void *; }'.
@@ -299,7 +282,7 @@ static void computeBlockInfo(CodeGenModule &CGM, CGBlockInfo &info) {
ASTContext &C = CGM.getContext();
const BlockDecl *block = info.getBlockDecl();
- std::vector<const llvm::Type*> elementTypes;
+ llvm::SmallVector<const llvm::Type*, 8> elementTypes;
initializeForBlockHeader(CGM, info, elementTypes);
if (!block->hasCaptures()) {
@@ -321,7 +304,11 @@ static void computeBlockInfo(CodeGenModule &CGM, CGBlockInfo &info) {
const DeclContext *DC = block->getDeclContext();
for (; isa<BlockDecl>(DC); DC = cast<BlockDecl>(DC)->getDeclContext())
;
- QualType thisType = cast<CXXMethodDecl>(DC)->getThisType(C);
+ QualType thisType;
+ if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC))
+ thisType = C.getPointerType(C.getRecordType(RD));
+ else
+ thisType = cast<CXXMethodDecl>(DC)->getThisType(C);
const llvm::Type *llvmType = CGM.getTypes().ConvertType(thisType);
std::pair<CharUnits,CharUnits> tinfo
@@ -720,9 +707,8 @@ RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr* E,
BlockLiteral = Builder.CreateBitCast(BlockLiteral, VoidPtrTy, "tmp");
// Add the block literal.
- QualType VoidPtrTy = getContext().getPointerType(getContext().VoidTy);
CallArgList Args;
- Args.add(RValue::get(BlockLiteral), VoidPtrTy);
+ Args.add(RValue::get(BlockLiteral), getContext().VoidPtrTy);
QualType FnType = BPT->getPointeeType();
@@ -1063,6 +1049,10 @@ CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo) {
IdentifierInfo *II
= &CGM.getContext().Idents.get("__copy_helper_block_");
+ // Check if we should generate debug info for this block helper function.
+ if (CGM.getModuleDebugInfo())
+ DebugInfo = CGM.getModuleDebugInfo();
+
FunctionDecl *FD = FunctionDecl::Create(C,
C.getTranslationUnitDecl(),
SourceLocation(),
@@ -1150,6 +1140,10 @@ CodeGenFunction::GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo) {
llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage,
"__destroy_helper_block_", &CGM.getModule());
+ // Check if we should generate debug info for this block destroy function.
+ if (CGM.getModuleDebugInfo())
+ DebugInfo = CGM.getModuleDebugInfo();
+
IdentifierInfo *II
= &CGM.getContext().Idents.get("__destroy_helper_block_");
@@ -1508,29 +1502,29 @@ const llvm::Type *CodeGenFunction::BuildByRefType(const VarDecl *D) {
QualType Ty = D->getType();
- std::vector<const llvm::Type *> Types;
+ llvm::SmallVector<const llvm::Type *, 8> types;
llvm::PATypeHolder ByRefTypeHolder = llvm::OpaqueType::get(getLLVMContext());
// void *__isa;
- Types.push_back(Int8PtrTy);
+ types.push_back(Int8PtrTy);
// void *__forwarding;
- Types.push_back(llvm::PointerType::getUnqual(ByRefTypeHolder));
+ types.push_back(llvm::PointerType::getUnqual(ByRefTypeHolder));
// int32_t __flags;
- Types.push_back(Int32Ty);
+ types.push_back(Int32Ty);
// int32_t __size;
- Types.push_back(Int32Ty);
+ types.push_back(Int32Ty);
bool HasCopyAndDispose = getContext().BlockRequiresCopying(Ty);
if (HasCopyAndDispose) {
/// void *__copy_helper;
- Types.push_back(Int8PtrTy);
+ types.push_back(Int8PtrTy);
/// void *__destroy_helper;
- Types.push_back(Int8PtrTy);
+ types.push_back(Int8PtrTy);
}
bool Packed = false;
@@ -1553,11 +1547,11 @@ const llvm::Type *CodeGenFunction::BuildByRefType(const VarDecl *D) {
if (NumPaddingBytes > 0) {
const llvm::Type *Ty = llvm::Type::getInt8Ty(getLLVMContext());
// FIXME: We need a sema error for alignment larger than the minimum of
- // the maximal stack alignmint and the alignment of malloc on the system.
+ // the maximal stack alignment and the alignment of malloc on the system.
if (NumPaddingBytes > 1)
Ty = llvm::ArrayType::get(Ty, NumPaddingBytes);
- Types.push_back(Ty);
+ types.push_back(Ty);
// We want a packed struct.
Packed = true;
@@ -1565,9 +1559,9 @@ const llvm::Type *CodeGenFunction::BuildByRefType(const VarDecl *D) {
}
// T x;
- Types.push_back(ConvertTypeForMem(Ty));
+ types.push_back(ConvertTypeForMem(Ty));
- const llvm::Type *T = llvm::StructType::get(getLLVMContext(), Types, Packed);
+ const llvm::Type *T = llvm::StructType::get(getLLVMContext(), types, Packed);
cast<llvm::OpaqueType>(ByRefTypeHolder.get())->refineAbstractTypeTo(T);
CGM.getModule().addTypeName("struct.__block_byref_" + D->getNameAsString(),
@@ -1575,7 +1569,7 @@ const llvm::Type *CodeGenFunction::BuildByRefType(const VarDecl *D) {
Info.first = ByRefTypeHolder.get();
- Info.second = Types.size() - 1;
+ Info.second = types.size() - 1;
return Info.first;
}
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp
index 7a0c8da..14bebaf 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp
@@ -164,9 +164,8 @@ static Value *EmitFAbs(CodeGenFunction &CGF, Value *V, QualType ValTy) {
}
// The prototype is something that takes and returns whatever V's type is.
- std::vector<const llvm::Type*> Args;
- Args.push_back(V->getType());
- llvm::FunctionType *FT = llvm::FunctionType::get(V->getType(), Args, false);
+ llvm::FunctionType *FT = llvm::FunctionType::get(V->getType(), V->getType(),
+ false);
llvm::Value *Fn = CGF.CGM.CreateRuntimeFunction(FT, FnName);
return CGF.Builder.CreateCall(Fn, V, "abs");
@@ -1186,6 +1185,41 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
Ops.begin(), Ops.end());
}
+ if (BuiltinID == ARM::BI__builtin_arm_ldrexd) {
+ Function *F = CGM.getIntrinsic(Intrinsic::arm_ldrexd);
+
+ Value *LdPtr = EmitScalarExpr(E->getArg(0));
+ Value *Val = Builder.CreateCall(F, LdPtr, "ldrexd");
+
+ Value *Val0 = Builder.CreateExtractValue(Val, 1);
+ Value *Val1 = Builder.CreateExtractValue(Val, 0);
+ Val0 = Builder.CreateZExt(Val0, Int64Ty);
+ Val1 = Builder.CreateZExt(Val1, Int64Ty);
+
+ Value *ShiftCst = llvm::ConstantInt::get(Int64Ty, 32);
+ Val = Builder.CreateShl(Val0, ShiftCst, "shl", true /* nuw */);
+ return Builder.CreateOr(Val, Val1);
+ }
+
+ if (BuiltinID == ARM::BI__builtin_arm_strexd) {
+ Function *F = CGM.getIntrinsic(Intrinsic::arm_strexd);
+ llvm::Type *STy = llvm::StructType::get(getLLVMContext(), Int32Ty, Int32Ty,
+ NULL);
+
+ Value *One = llvm::ConstantInt::get(Int32Ty, 1);
+ Value *Tmp = Builder.CreateAlloca(Int64Ty, One, "tmp");
+ Value *Val = EmitScalarExpr(E->getArg(0));
+ Builder.CreateStore(Val, Tmp);
+
+ Value *LdPtr = Builder.CreateBitCast(Tmp,llvm::PointerType::getUnqual(STy));
+ Val = Builder.CreateLoad(LdPtr);
+
+ Value *Arg0 = Builder.CreateExtractValue(Val, 0);
+ Value *Arg1 = Builder.CreateExtractValue(Val, 1);
+ Value *StPtr = EmitScalarExpr(E->getArg(1));
+ return Builder.CreateCall3(F, Arg0, Arg1, StPtr, "strexd");
+ }
+
llvm::SmallVector<Value*, 4> Ops;
for (unsigned i = 0, e = E->getNumArgs() - 1; i != e; i++)
Ops.push_back(EmitScalarExpr(E->getArg(i)));
@@ -2143,16 +2177,21 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
// If palignr is shifting the pair of vectors more than 32 bytes, emit zero.
return llvm::Constant::getNullValue(ConvertType(E->getType()));
}
- case X86::BI__builtin_ia32_loaddqu: {
- const llvm::Type *VecTy = ConvertType(E->getType());
- const llvm::Type *IntTy = llvm::IntegerType::get(getLLVMContext(), 128);
+ case X86::BI__builtin_ia32_movntps:
+ case X86::BI__builtin_ia32_movntpd:
+ case X86::BI__builtin_ia32_movntdq:
+ case X86::BI__builtin_ia32_movnti: {
+ llvm::MDNode *Node = llvm::MDNode::get(getLLVMContext(),
+ Builder.getInt32(1));
+ // Convert the type of the pointer to a pointer to the stored type.
Value *BC = Builder.CreateBitCast(Ops[0],
- llvm::PointerType::getUnqual(IntTy),
+ llvm::PointerType::getUnqual(Ops[1]->getType()),
"cast");
- LoadInst *LI = Builder.CreateLoad(BC);
- LI->setAlignment(1); // Unaligned load.
- return Builder.CreateBitCast(LI, VecTy, "loadu.cast");
+ StoreInst *SI = Builder.CreateStore(Ops[1], BC);
+ SI->setMetadata(CGM.getModule().getMDKindID("nontemporal"), Node);
+ SI->setAlignment(16);
+ return SI;
}
// 3DNow!
case X86::BI__builtin_ia32_pavgusb:
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp
index 184147c..f6fc202 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp
@@ -28,17 +28,6 @@
using namespace clang;
using namespace CodeGen;
-/// Determines whether the given function has a trivial body that does
-/// not require any specific codegen.
-static bool HasTrivialBody(const FunctionDecl *FD) {
- Stmt *S = FD->getBody();
- if (!S)
- return true;
- if (isa<CompoundStmt>(S) && cast<CompoundStmt>(S)->body_empty())
- return true;
- return false;
-}
-
/// Try to emit a base destructor as an alias to its primary
/// base-class destructor.
bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
@@ -47,7 +36,7 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
// If the destructor doesn't have a trivial body, we have to emit it
// separately.
- if (!HasTrivialBody(D))
+ if (!D->hasTrivialBody())
return true;
const CXXRecordDecl *Class = D->getParent();
@@ -187,7 +176,10 @@ bool CodeGenModule::TryEmitDefinitionAsAlias(GlobalDecl AliasDecl,
void CodeGenModule::EmitCXXConstructors(const CXXConstructorDecl *D) {
// The constructor used for constructing this as a complete class;
// constucts the virtual bases, then calls the base constructor.
- EmitGlobal(GlobalDecl(D, Ctor_Complete));
+ if (!D->getParent()->isAbstract()) {
+ // We don't need to emit the complete ctor if the class is abstract.
+ EmitGlobal(GlobalDecl(D, Ctor_Complete));
+ }
// The constructor used for constructing this as a base class;
// ignores virtual bases.
@@ -244,7 +236,11 @@ void CodeGenModule::EmitCXXDestructors(const CXXDestructorDecl *D) {
// The destructor used for destructing this as a most-derived class;
// call the base destructor and then destructs any virtual bases.
- EmitGlobal(GlobalDecl(D, Dtor_Complete));
+ if (!D->getParent()->isAbstract() || D->isVirtual()) {
+ // We don't need to emit the complete ctor if the class is abstract,
+ // unless the destructor is virtual and needs to be in the vtable.
+ EmitGlobal(GlobalDecl(D, Dtor_Complete));
+ }
// The destructor used for destructing this as a base class; ignores
// virtual bases.
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp
index a765f0f..712ae89 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp
@@ -309,10 +309,10 @@ CGFunctionInfo::CGFunctionInfo(unsigned _CallingConvention,
/***/
-void CodeGenTypes::GetExpandedTypes(QualType Ty,
- std::vector<const llvm::Type*> &ArgTys,
- bool IsRecursive) {
- const RecordType *RT = Ty->getAsStructureType();
+void CodeGenTypes::GetExpandedTypes(QualType type,
+ llvm::SmallVectorImpl<const llvm::Type*> &expandedTypes,
+ bool isRecursive) {
+ const RecordType *RT = type->getAsStructureType();
assert(RT && "Can only expand structure types.");
const RecordDecl *RD = RT->getDecl();
assert(!RD->hasFlexibleArrayMember() &&
@@ -324,11 +324,11 @@ void CodeGenTypes::GetExpandedTypes(QualType Ty,
assert(!FD->isBitField() &&
"Cannot expand structure with bit-field members.");
- QualType FT = FD->getType();
- if (CodeGenFunction::hasAggregateLLVMType(FT))
- GetExpandedTypes(FT, ArgTys, IsRecursive);
+ QualType fieldType = FD->getType();
+ if (fieldType->isRecordType())
+ GetExpandedTypes(fieldType, expandedTypes, isRecursive);
else
- ArgTys.push_back(ConvertType(FT, IsRecursive));
+ expandedTypes.push_back(ConvertType(fieldType, isRecursive));
}
}
@@ -513,6 +513,29 @@ static llvm::Value *CreateCoercedLoad(llvm::Value *SrcPtr,
return CGF.Builder.CreateLoad(Tmp);
}
+// Function to store a first-class aggregate into memory. We prefer to
+// store the elements rather than the aggregate to be more friendly to
+// fast-isel.
+// FIXME: Do we need to recurse here?
+static void BuildAggStore(CodeGenFunction &CGF, llvm::Value *Val,
+ llvm::Value *DestPtr, bool DestIsVolatile,
+ bool LowAlignment) {
+ // Prefer scalar stores to first-class aggregate stores.
+ if (const llvm::StructType *STy =
+ dyn_cast<llvm::StructType>(Val->getType())) {
+ for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
+ llvm::Value *EltPtr = CGF.Builder.CreateConstGEP2_32(DestPtr, 0, i);
+ llvm::Value *Elt = CGF.Builder.CreateExtractValue(Val, i);
+ llvm::StoreInst *SI = CGF.Builder.CreateStore(Elt, EltPtr,
+ DestIsVolatile);
+ if (LowAlignment)
+ SI->setAlignment(1);
+ }
+ } else {
+ CGF.Builder.CreateStore(Val, DestPtr, DestIsVolatile);
+ }
+}
+
/// CreateCoercedStore - Create a store to \arg DstPtr from \arg Src,
/// where the source and destination may have different types.
///
@@ -553,7 +576,7 @@ static void CreateCoercedStore(llvm::Value *Src,
llvm::Value *Casted =
CGF.Builder.CreateBitCast(DstPtr, llvm::PointerType::getUnqual(SrcTy));
// FIXME: Use better alignment / avoid requiring aligned store.
- CGF.Builder.CreateStore(Src, Casted, DstIsVolatile)->setAlignment(1);
+ BuildAggStore(CGF, Src, Casted, DstIsVolatile, true);
} else {
// Otherwise do coercion through memory. This is stupid, but
// simple.
@@ -612,49 +635,49 @@ const llvm::FunctionType *CodeGenTypes::GetFunctionType(GlobalDecl GD) {
}
const llvm::FunctionType *
-CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI, bool IsVariadic,
- bool IsRecursive) {
- std::vector<const llvm::Type*> ArgTys;
+CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI, bool isVariadic,
+ bool isRecursive) {
+ llvm::SmallVector<const llvm::Type*, 8> argTypes;
+ const llvm::Type *resultType = 0;
- const llvm::Type *ResultType = 0;
-
- QualType RetTy = FI.getReturnType();
- const ABIArgInfo &RetAI = FI.getReturnInfo();
- switch (RetAI.getKind()) {
+ const ABIArgInfo &retAI = FI.getReturnInfo();
+ switch (retAI.getKind()) {
case ABIArgInfo::Expand:
- assert(0 && "Invalid ABI kind for return argument");
+ llvm_unreachable("Invalid ABI kind for return argument");
case ABIArgInfo::Extend:
case ABIArgInfo::Direct:
- ResultType = RetAI.getCoerceToType();
+ resultType = retAI.getCoerceToType();
break;
case ABIArgInfo::Indirect: {
- assert(!RetAI.getIndirectAlign() && "Align unused on indirect return.");
- ResultType = llvm::Type::getVoidTy(getLLVMContext());
- const llvm::Type *STy = ConvertType(RetTy, IsRecursive);
- unsigned AS = Context.getTargetAddressSpace(RetTy);
- ArgTys.push_back(llvm::PointerType::get(STy, AS));
+ assert(!retAI.getIndirectAlign() && "Align unused on indirect return.");
+ resultType = llvm::Type::getVoidTy(getLLVMContext());
+
+ QualType ret = FI.getReturnType();
+ const llvm::Type *ty = ConvertType(ret, isRecursive);
+ unsigned addressSpace = Context.getTargetAddressSpace(ret);
+ argTypes.push_back(llvm::PointerType::get(ty, addressSpace));
break;
}
case ABIArgInfo::Ignore:
- ResultType = llvm::Type::getVoidTy(getLLVMContext());
+ resultType = llvm::Type::getVoidTy(getLLVMContext());
break;
}
for (CGFunctionInfo::const_arg_iterator it = FI.arg_begin(),
ie = FI.arg_end(); it != ie; ++it) {
- const ABIArgInfo &AI = it->info;
+ const ABIArgInfo &argAI = it->info;
- switch (AI.getKind()) {
+ switch (argAI.getKind()) {
case ABIArgInfo::Ignore:
break;
case ABIArgInfo::Indirect: {
// indirect arguments are always on the stack, which is addr space #0.
- const llvm::Type *LTy = ConvertTypeForMem(it->type, IsRecursive);
- ArgTys.push_back(llvm::PointerType::getUnqual(LTy));
+ const llvm::Type *LTy = ConvertTypeForMem(it->type, isRecursive);
+ argTypes.push_back(LTy->getPointerTo());
break;
}
@@ -663,23 +686,23 @@ CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI, bool IsVariadic,
// If the coerce-to type is a first class aggregate, flatten it. Either
// way is semantically identical, but fast-isel and the optimizer
// generally likes scalar values better than FCAs.
- const llvm::Type *ArgTy = AI.getCoerceToType();
- if (const llvm::StructType *STy = dyn_cast<llvm::StructType>(ArgTy)) {
- for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i)
- ArgTys.push_back(STy->getElementType(i));
+ const llvm::Type *argType = argAI.getCoerceToType();
+ if (const llvm::StructType *st = dyn_cast<llvm::StructType>(argType)) {
+ for (unsigned i = 0, e = st->getNumElements(); i != e; ++i)
+ argTypes.push_back(st->getElementType(i));
} else {
- ArgTys.push_back(ArgTy);
+ argTypes.push_back(argType);
}
break;
}
case ABIArgInfo::Expand:
- GetExpandedTypes(it->type, ArgTys, IsRecursive);
+ GetExpandedTypes(it->type, argTypes, isRecursive);
break;
}
}
- return llvm::FunctionType::get(ResultType, ArgTys, IsVariadic);
+ return llvm::FunctionType::get(resultType, argTypes, isVariadic);
}
const llvm::Type *CodeGenTypes::GetFunctionTypeForVTable(GlobalDecl GD) {
@@ -786,9 +809,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
// sense to do it here because parameters are so messed up.
switch (AI.getKind()) {
case ABIArgInfo::Extend:
- if (ParamType->isSignedIntegerType())
+ if (ParamType->isSignedIntegerOrEnumerationType())
Attributes |= llvm::Attribute::SExt;
- else if (ParamType->isUnsignedIntegerType())
+ else if (ParamType->isUnsignedIntegerOrEnumerationType())
Attributes |= llvm::Attribute::ZExt;
// FALL THROUGH
case ABIArgInfo::Direct:
@@ -822,12 +845,12 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
continue;
case ABIArgInfo::Expand: {
- std::vector<const llvm::Type*> Tys;
+ llvm::SmallVector<const llvm::Type*, 8> types;
// FIXME: This is rather inefficient. Do we ever actually need to do
// anything here? The result should be just reconstructed on the other
// side, so extension should be a non-issue.
- getTypes().GetExpandedTypes(ParamType, Tys, false);
- Index += Tys.size();
+ getTypes().GetExpandedTypes(ParamType, types, false);
+ Index += types.size();
continue;
}
}
@@ -1166,6 +1189,15 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
return args.add(EmitReferenceBindingToExpr(E, /*InitializedDecl=*/0),
type);
+ if (hasAggregateLLVMType(type) && isa<ImplicitCastExpr>(E) &&
+ cast<CastExpr>(E)->getCastKind() == CK_LValueToRValue) {
+ LValue L = EmitLValue(cast<CastExpr>(E)->getSubExpr());
+ assert(L.isSimple());
+ args.add(RValue::getAggregate(L.getAddress(), L.isVolatileQualified()),
+ type, /*NeedsCopy*/true);
+ return;
+ }
+
args.add(EmitAnyExprToTemp(E), type);
}
@@ -1231,6 +1263,10 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
Alignment, I->Ty);
else
StoreComplexToAddr(RV.getComplexVal(), Args.back(), false);
+ } else if (I->NeedsCopy && !ArgInfo.getIndirectByVal()) {
+ Args.push_back(CreateMemTemp(I->Ty));
+ EmitAggregateCopy(Args.back(), RV.getAggregateAddr(), I->Ty,
+ RV.isVolatileQualified());
} else {
Args.push_back(RV.getAggregateAddr());
}
@@ -1409,7 +1445,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
DestPtr = CreateMemTemp(RetTy, "agg.tmp");
DestIsVolatile = false;
}
- Builder.CreateStore(CI, DestPtr, DestIsVolatile);
+ BuildAggStore(*this, CI, DestPtr, DestIsVolatile, false);
return RValue::getAggregate(DestPtr);
}
return RValue::get(CI);
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h b/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h
index 3f600c0..160a62e 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h
@@ -47,8 +47,9 @@ namespace CodeGen {
struct CallArg {
RValue RV;
QualType Ty;
- CallArg(RValue rv, QualType ty)
- : RV(rv), Ty(ty)
+ bool NeedsCopy;
+ CallArg(RValue rv, QualType ty, bool needscopy)
+ : RV(rv), Ty(ty), NeedsCopy(needscopy)
{ }
};
@@ -57,8 +58,8 @@ namespace CodeGen {
class CallArgList :
public llvm::SmallVector<CallArg, 16> {
public:
- void add(RValue rvalue, QualType type) {
- push_back(CallArg(rvalue, type));
+ void add(RValue rvalue, QualType type, bool needscopy = false) {
+ push_back(CallArg(rvalue, type, needscopy));
}
};
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp
index ca8b657..5725d80 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp
@@ -520,6 +520,7 @@ static void EmitMemberInitializer(CodeGenFunction &CGF,
FunctionArgList &Args) {
assert(MemberInit->isAnyMemberInitializer() &&
"Must have member initializer!");
+ assert(MemberInit->getInit() && "Must have initializer!");
// non-static data member initializers.
FieldDecl *Field = MemberInit->getAnyMember();
@@ -726,12 +727,13 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD,
B != E; ++B) {
CXXCtorInitializer *Member = (*B);
- if (Member->isBaseInitializer())
+ if (Member->isBaseInitializer()) {
EmitBaseInitializer(*this, ClassDecl, Member, CtorType);
- else if (Member->isAnyMemberInitializer())
+ } else {
+ assert(Member->isAnyMemberInitializer() &&
+ "Delegating initializer on non-delegating constructor");
MemberInitializers.push_back(Member);
- else
- llvm_unreachable("Delegating initializer on non-delegating constructor");
+ }
}
InitializeVTablePointers(ClassDecl);
@@ -740,6 +742,94 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD,
EmitMemberInitializer(*this, ClassDecl, MemberInitializers[I], CD, Args);
}
+static bool
+FieldHasTrivialDestructorBody(ASTContext &Context, const FieldDecl *Field);
+
+static bool
+HasTrivialDestructorBody(ASTContext &Context,
+ const CXXRecordDecl *BaseClassDecl,
+ const CXXRecordDecl *MostDerivedClassDecl)
+{
+ // If the destructor is trivial we don't have to check anything else.
+ if (BaseClassDecl->hasTrivialDestructor())
+ return true;
+
+ if (!BaseClassDecl->getDestructor()->hasTrivialBody())
+ return false;
+
+ // Check fields.
+ for (CXXRecordDecl::field_iterator I = BaseClassDecl->field_begin(),
+ E = BaseClassDecl->field_end(); I != E; ++I) {
+ const FieldDecl *Field = *I;
+
+ if (!FieldHasTrivialDestructorBody(Context, Field))
+ return false;
+ }
+
+ // Check non-virtual bases.
+ for (CXXRecordDecl::base_class_const_iterator I =
+ BaseClassDecl->bases_begin(), E = BaseClassDecl->bases_end();
+ I != E; ++I) {
+ if (I->isVirtual())
+ continue;
+
+ const CXXRecordDecl *NonVirtualBase =
+ cast<CXXRecordDecl>(I->getType()->castAs<RecordType>()->getDecl());
+ if (!HasTrivialDestructorBody(Context, NonVirtualBase,
+ MostDerivedClassDecl))
+ return false;
+ }
+
+ if (BaseClassDecl == MostDerivedClassDecl) {
+ // Check virtual bases.
+ for (CXXRecordDecl::base_class_const_iterator I =
+ BaseClassDecl->vbases_begin(), E = BaseClassDecl->vbases_end();
+ I != E; ++I) {
+ const CXXRecordDecl *VirtualBase =
+ cast<CXXRecordDecl>(I->getType()->castAs<RecordType>()->getDecl());
+ if (!HasTrivialDestructorBody(Context, VirtualBase,
+ MostDerivedClassDecl))
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static bool
+FieldHasTrivialDestructorBody(ASTContext &Context,
+ const FieldDecl *Field)
+{
+ QualType FieldBaseElementType = Context.getBaseElementType(Field->getType());
+
+ const RecordType *RT = FieldBaseElementType->getAs<RecordType>();
+ if (!RT)
+ return true;
+
+ CXXRecordDecl *FieldClassDecl = cast<CXXRecordDecl>(RT->getDecl());
+ return HasTrivialDestructorBody(Context, FieldClassDecl, FieldClassDecl);
+}
+
+/// CanSkipVTablePointerInitialization - Check whether we need to initialize
+/// any vtable pointers before calling this destructor.
+static bool CanSkipVTablePointerInitialization(ASTContext &Context,
+ const CXXDestructorDecl *Dtor) {
+ if (!Dtor->hasTrivialBody())
+ return false;
+
+ // Check the fields.
+ const CXXRecordDecl *ClassDecl = Dtor->getParent();
+ for (CXXRecordDecl::field_iterator I = ClassDecl->field_begin(),
+ E = ClassDecl->field_end(); I != E; ++I) {
+ const FieldDecl *Field = *I;
+
+ if (!FieldHasTrivialDestructorBody(Context, Field))
+ return false;
+ }
+
+ return true;
+}
+
/// EmitDestructorBody - Emits the body of the current destructor.
void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) {
const CXXDestructorDecl *Dtor = cast<CXXDestructorDecl>(CurGD.getDecl());
@@ -791,7 +881,8 @@ void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) {
EnterDtorCleanups(Dtor, Dtor_Base);
// Initialize the vtable pointers before entering the body.
- InitializeVTablePointers(Dtor->getParent());
+ if (!CanSkipVTablePointerInitialization(getContext(), Dtor))
+ InitializeVTablePointers(Dtor->getParent());
if (isTryBody)
EmitStmt(cast<CXXTryStmt>(Body)->getTryBlock());
@@ -1269,6 +1360,23 @@ CodeGenFunction::EmitDelegateCXXConstructorCall(const CXXConstructorDecl *Ctor,
ReturnValueSlot(), DelegateArgs, Ctor);
}
+namespace {
+ struct CallDelegatingCtorDtor : EHScopeStack::Cleanup {
+ const CXXDestructorDecl *Dtor;
+ llvm::Value *Addr;
+ CXXDtorType Type;
+
+ CallDelegatingCtorDtor(const CXXDestructorDecl *D, llvm::Value *Addr,
+ CXXDtorType Type)
+ : Dtor(D), Addr(Addr), Type(Type) {}
+
+ void Emit(CodeGenFunction &CGF, bool IsForEH) {
+ CGF.EmitCXXDestructorCall(Dtor, Type, /*ForVirtualBase=*/false,
+ Addr);
+ }
+ };
+}
+
void
CodeGenFunction::EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor,
const FunctionArgList &Args) {
@@ -1279,8 +1387,17 @@ CodeGenFunction::EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor
AggValueSlot AggSlot = AggValueSlot::forAddr(ThisPtr, false, /*Lifetime*/ true);
EmitAggExpr(Ctor->init_begin()[0]->getInit(), AggSlot);
-}
+ const CXXRecordDecl *ClassDecl = Ctor->getParent();
+ if (CGM.getLangOptions().Exceptions && !ClassDecl->hasTrivialDestructor()) {
+ CXXDtorType Type =
+ CurGD.getCtorType() == Ctor_Complete ? Dtor_Complete : Dtor_Base;
+
+ EHStack.pushCleanup<CallDelegatingCtorDtor>(EHCleanup,
+ ClassDecl->getDestructor(),
+ ThisPtr, Type);
+ }
+}
void CodeGenFunction::EmitCXXDestructorCall(const CXXDestructorDecl *DD,
CXXDtorType Type,
@@ -1494,3 +1611,136 @@ llvm::Value *CodeGenFunction::GetVTablePtr(llvm::Value *This,
llvm::Value *VTablePtrSrc = Builder.CreateBitCast(This, Ty->getPointerTo());
return Builder.CreateLoad(VTablePtrSrc, "vtable");
}
+
+static const CXXRecordDecl *getMostDerivedClassDecl(const Expr *Base) {
+ const Expr *E = Base;
+
+ while (true) {
+ E = E->IgnoreParens();
+ if (const CastExpr *CE = dyn_cast<CastExpr>(E)) {
+ if (CE->getCastKind() == CK_DerivedToBase ||
+ CE->getCastKind() == CK_UncheckedDerivedToBase ||
+ CE->getCastKind() == CK_NoOp) {
+ E = CE->getSubExpr();
+ continue;
+ }
+ }
+
+ break;
+ }
+
+ QualType DerivedType = E->getType();
+ if (const PointerType *PTy = DerivedType->getAs<PointerType>())
+ DerivedType = PTy->getPointeeType();
+
+ return cast<CXXRecordDecl>(DerivedType->castAs<RecordType>()->getDecl());
+}
+
+// FIXME: Ideally Expr::IgnoreParenNoopCasts should do this, but it doesn't do
+// quite what we want.
+static const Expr *skipNoOpCastsAndParens(const Expr *E) {
+ while (true) {
+ if (const ParenExpr *PE = dyn_cast<ParenExpr>(E)) {
+ E = PE->getSubExpr();
+ continue;
+ }
+
+ if (const CastExpr *CE = dyn_cast<CastExpr>(E)) {
+ if (CE->getCastKind() == CK_NoOp) {
+ E = CE->getSubExpr();
+ continue;
+ }
+ }
+ if (const UnaryOperator *UO = dyn_cast<UnaryOperator>(E)) {
+ if (UO->getOpcode() == UO_Extension) {
+ E = UO->getSubExpr();
+ continue;
+ }
+ }
+ return E;
+ }
+}
+
+/// canDevirtualizeMemberFunctionCall - Checks whether the given virtual member
+/// function call on the given expr can be devirtualized.
+/// expr can be devirtualized.
+static bool canDevirtualizeMemberFunctionCall(const Expr *Base,
+ const CXXMethodDecl *MD) {
+ // If the most derived class is marked final, we know that no subclass can
+ // override this member function and so we can devirtualize it. For example:
+ //
+ // struct A { virtual void f(); }
+ // struct B final : A { };
+ //
+ // void f(B *b) {
+ // b->f();
+ // }
+ //
+ const CXXRecordDecl *MostDerivedClassDecl = getMostDerivedClassDecl(Base);
+ if (MostDerivedClassDecl->hasAttr<FinalAttr>())
+ return true;
+
+ // If the member function is marked 'final', we know that it can't be
+ // overridden and can therefore devirtualize it.
+ if (MD->hasAttr<FinalAttr>())
+ return true;
+
+ // Similarly, if the class itself is marked 'final' it can't be overridden
+ // and we can therefore devirtualize the member function call.
+ if (MD->getParent()->hasAttr<FinalAttr>())
+ return true;
+
+ Base = skipNoOpCastsAndParens(Base);
+ if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Base)) {
+ if (const VarDecl *VD = dyn_cast<VarDecl>(DRE->getDecl())) {
+ // This is a record decl. We know the type and can devirtualize it.
+ return VD->getType()->isRecordType();
+ }
+
+ return false;
+ }
+
+ // We can always devirtualize calls on temporary object expressions.
+ if (isa<CXXConstructExpr>(Base))
+ return true;
+
+ // And calls on bound temporaries.
+ if (isa<CXXBindTemporaryExpr>(Base))
+ return true;
+
+ // Check if this is a call expr that returns a record type.
+ if (const CallExpr *CE = dyn_cast<CallExpr>(Base))
+ return CE->getCallReturnType()->isRecordType();
+
+ // We can't devirtualize the call.
+ return false;
+}
+
+static bool UseVirtualCall(ASTContext &Context,
+ const CXXOperatorCallExpr *CE,
+ const CXXMethodDecl *MD) {
+ if (!MD->isVirtual())
+ return false;
+
+ // When building with -fapple-kext, all calls must go through the vtable since
+ // the kernel linker can do runtime patching of vtables.
+ if (Context.getLangOptions().AppleKext)
+ return true;
+
+ return !canDevirtualizeMemberFunctionCall(CE->getArg(0), MD);
+}
+
+llvm::Value *
+CodeGenFunction::EmitCXXOperatorMemberCallee(const CXXOperatorCallExpr *E,
+ const CXXMethodDecl *MD,
+ llvm::Value *This) {
+ const FunctionProtoType *FPT = MD->getType()->castAs<FunctionProtoType>();
+ const llvm::Type *Ty =
+ CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD),
+ FPT->isVariadic());
+
+ if (UseVirtualCall(getContext(), E, MD))
+ return BuildVirtualCall(MD, This, Ty);
+
+ return CGM.GetAddrOfFunction(MD, Ty);
+}
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
index f2e1c02..98d30db 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -335,10 +335,12 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
case BuiltinType::SChar: Encoding = llvm::dwarf::DW_ATE_signed_char; break;
case BuiltinType::UShort:
case BuiltinType::UInt:
+ case BuiltinType::UInt128:
case BuiltinType::ULong:
case BuiltinType::ULongLong: Encoding = llvm::dwarf::DW_ATE_unsigned; break;
case BuiltinType::Short:
case BuiltinType::Int:
+ case BuiltinType::Int128:
case BuiltinType::Long:
case BuiltinType::LongLong: Encoding = llvm::dwarf::DW_ATE_signed; break;
case BuiltinType::Bool: Encoding = llvm::dwarf::DW_ATE_boolean; break;
@@ -553,9 +555,12 @@ llvm::DIType CGDebugInfo::CreateType(const TypedefType *Ty,
// We don't set size information, but do specify where the typedef was
// declared.
unsigned Line = getLineNumber(Ty->getDecl()->getLocation());
- llvm::DIType DbgTy = DBuilder.createTypedef(Src, Ty->getDecl()->getName(),
- Unit, Line);
- return DbgTy;
+ const TypedefNameDecl *TyDecl = Ty->getDecl();
+ llvm::DIDescriptor TydefContext =
+ getContextDescriptor(cast<Decl>(Ty->getDecl()->getDeclContext()));
+
+ return
+ DBuilder.createTypedef(Src, TyDecl->getName(), Unit, Line, TydefContext);
}
llvm::DIType CGDebugInfo::CreateType(const FunctionType *Ty,
@@ -628,8 +633,7 @@ CollectRecordFields(const RecordDecl *record, llvm::DIFile tunit,
FieldDecl *field = *I;
if (IsMsStruct) {
// Zero-length bitfields following non-bitfield members are ignored
- if (CGM.getContext().ZeroBitfieldFollowsNonBitfield((field), LastFD) ||
- CGM.getContext().ZeroBitfieldFollowsBitfield((field), LastFD)) {
+ if (CGM.getContext().ZeroBitfieldFollowsNonBitfield((field), LastFD)) {
--fieldNo;
continue;
}
@@ -1240,9 +1244,13 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
uint64_t Size = CGM.getContext().getTypeSize(Ty);
uint64_t Align = CGM.getContext().getTypeAlign(Ty);
+ unsigned Flags = 0;
+ if (ID->getImplementation())
+ Flags |= llvm::DIDescriptor::FlagObjcClassComplete;
+
llvm::DIType RealDecl =
DBuilder.createStructType(Unit, ID->getName(), DefUnit,
- Line, Size, Align, 0,
+ Line, Size, Align, Flags,
Elements, RuntimeLang);
// Now that we have a real decl for the struct, replace anything using the
@@ -1439,6 +1447,9 @@ static QualType UnwrapTypeForDebugInfo(QualType T) {
case Type::Decltype:
T = cast<DecltypeType>(T)->getUnderlyingType();
break;
+ case Type::UnaryTransform:
+ T = cast<UnaryTransformType>(T)->getUnderlyingType();
+ break;
case Type::Attributed:
T = cast<AttributedType>(T)->getEquivalentType();
break;
@@ -1554,6 +1565,7 @@ llvm::DIType CGDebugInfo::CreateTypeNode(QualType Ty,
case Type::TypeOfExpr:
case Type::TypeOf:
case Type::Decltype:
+ case Type::UnaryTransform:
case Type::Auto:
llvm_unreachable("type should have been unwrapped!");
return llvm::DIType();
@@ -1612,6 +1624,33 @@ llvm::DISubprogram CGDebugInfo::getFunctionDeclaration(const Decl *D) {
return llvm::DISubprogram();
}
+// getOrCreateFunctionType - Construct DIType. If it is a c++ method, include
+// implicit parameter "this".
+llvm::DIType CGDebugInfo::getOrCreateFunctionType(const Decl * D, QualType FnType,
+ llvm::DIFile F) {
+ if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D))
+ return getOrCreateMethodType(Method, F);
+ else if (const ObjCMethodDecl *OMethod = dyn_cast<ObjCMethodDecl>(D)) {
+ // Add "self" and "_cmd"
+ llvm::SmallVector<llvm::Value *, 16> Elts;
+
+ // First element is always return type. For 'void' functions it is NULL.
+ Elts.push_back(getOrCreateType(OMethod->getResultType(), F));
+ // "self" pointer is always first argument.
+ Elts.push_back(getOrCreateType(OMethod->getSelfDecl()->getType(), F));
+ // "cmd" pointer is always second argument.
+ Elts.push_back(getOrCreateType(OMethod->getCmdDecl()->getType(), F));
+ // Get rest of the arguments.
+ for (ObjCMethodDecl::param_iterator PI = OMethod->param_begin(),
+ PE = OMethod->param_end(); PI != PE; ++PI)
+ Elts.push_back(getOrCreateType((*PI)->getType(), F));
+
+ llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(Elts);
+ return DBuilder.createSubroutineType(F, EltTypeArray);
+ }
+ return getOrCreateType(FnType, F);
+}
+
/// EmitFunctionStart - Constructs the debug code for entering a function -
/// "llvm.dbg.func.start.".
void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
@@ -1644,7 +1683,8 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
}
Name = getFunctionName(FD);
// Use mangled name as linkage name for c/c++ functions.
- LinkageName = CGM.getMangledName(GD);
+ if (!Fn->hasInternalLinkage())
+ LinkageName = CGM.getMangledName(GD);
if (LinkageName == Name)
LinkageName = llvm::StringRef();
if (FD->hasPrototype())
@@ -1652,6 +1692,9 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
if (const NamespaceDecl *NSDecl =
dyn_cast_or_null<NamespaceDecl>(FD->getDeclContext()))
FDContext = getOrCreateNameSpace(NSDecl);
+ else if (const RecordDecl *RDecl =
+ dyn_cast_or_null<RecordDecl>(FD->getDeclContext()))
+ FDContext = getContextDescriptor(cast<Decl>(RDecl->getDeclContext()));
// Collect template parameters.
TParamsArray = CollectFunctionTemplateParams(FD, Unit);
@@ -1672,11 +1715,10 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
unsigned LineNo = getLineNumber(CurLoc);
if (D->isImplicit())
Flags |= llvm::DIDescriptor::FlagArtificial;
- llvm::DIType SPTy = getOrCreateType(FnType, Unit);
llvm::DISubprogram SPDecl = getFunctionDeclaration(D);
llvm::DISubprogram SP =
DBuilder.createFunction(FDContext, Name, LinkageName, Unit,
- LineNo, SPTy,
+ LineNo, getOrCreateFunctionType(D, FnType, Unit),
Fn->hasInternalLinkage(), true/*definition*/,
Flags, CGM.getLangOptions().Optimize, Fn,
TParamsArray, SPDecl);
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h b/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h
index 27d991b..6ec6b65 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h
@@ -98,6 +98,8 @@ class CGDebugInfo {
llvm::DIType CreateEnumType(const EnumDecl *ED);
llvm::DIType getOrCreateMethodType(const CXXMethodDecl *Method,
llvm::DIFile F);
+ llvm::DIType getOrCreateFunctionType(const Decl *D, QualType FnType,
+ llvm::DIFile F);
llvm::DIType getOrCreateVTablePtrType(llvm::DIFile F);
llvm::DINameSpace getOrCreateNameSpace(const NamespaceDecl *N);
llvm::DIType CreatePointeeType(QualType PointeeTy, llvm::DIFile F);
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp
index c027375..8a1a853 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp
@@ -51,6 +51,7 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
case Decl::ImplicitParam:
case Decl::ClassTemplate:
case Decl::FunctionTemplate:
+ case Decl::TypeAliasTemplate:
case Decl::TemplateTemplateParm:
case Decl::ObjCMethod:
case Decl::ObjCCategory:
@@ -628,15 +629,14 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) {
emission.Address = DeclPtr;
// Emit debug info for local var declaration.
- if (CGDebugInfo *DI = getDebugInfo()) {
- assert(HaveInsertPoint() && "Unexpected unreachable point!");
-
- DI->setLocation(D.getLocation());
- if (Target.useGlobalsForAutomaticVariables()) {
- DI->EmitGlobalVariable(static_cast<llvm::GlobalVariable *>(DeclPtr), &D);
- } else
- DI->EmitDeclareOfAutoVariable(&D, DeclPtr, Builder);
- }
+ if (HaveInsertPoint())
+ if (CGDebugInfo *DI = getDebugInfo()) {
+ DI->setLocation(D.getLocation());
+ if (Target.useGlobalsForAutomaticVariables()) {
+ DI->EmitGlobalVariable(static_cast<llvm::GlobalVariable *>(DeclPtr), &D);
+ } else
+ DI->EmitDeclareOfAutoVariable(&D, DeclPtr, Builder);
+ }
return emission;
}
@@ -741,6 +741,7 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) {
llvm::GlobalValue::InternalLinkage,
constant, Name, 0, false, 0);
GV->setAlignment(alignment.getQuantity());
+ GV->setUnnamedAddr(true);
llvm::Value *SrcPtr = GV;
if (SrcPtr->getType() != BP)
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp
index 45b0b96..178badd 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp
@@ -117,19 +117,13 @@ CodeGenFunction::EmitCXXGlobalDtorRegistration(llvm::Constant *DtorFn,
return;
}
- std::vector<const llvm::Type *> Params;
- Params.push_back(Int8PtrTy);
-
// Get the destructor function type
const llvm::Type *DtorFnTy =
llvm::FunctionType::get(llvm::Type::getVoidTy(getLLVMContext()),
- Params, false);
+ Int8PtrTy, false);
DtorFnTy = llvm::PointerType::getUnqual(DtorFnTy);
- Params.clear();
- Params.push_back(DtorFnTy);
- Params.push_back(Int8PtrTy);
- Params.push_back(Int8PtrTy);
+ const llvm::Type *Params[] = { DtorFnTy, Int8PtrTy, Int8PtrTy };
// Get the __cxa_atexit function type
// extern "C" int __cxa_atexit ( void (*f)(void *), void *p, void *d );
@@ -248,6 +242,8 @@ CodeGenModule::EmitCXXGlobalInitFunc() {
&CXXGlobalInits[0],
CXXGlobalInits.size());
AddGlobalCtor(Fn);
+ CXXGlobalInits.clear();
+ PrioritizedCXXGlobalInits.clear();
}
void CodeGenModule::EmitCXXGlobalDtorFunc() {
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp
index 6cb9599..e8ad6da 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp
@@ -112,11 +112,18 @@ static llvm::Constant *getUnexpectedFn(CodeGenFunction &CGF) {
return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_call_unexpected");
}
+llvm::Constant *CodeGenFunction::getUnwindResumeFn() {
+ const llvm::FunctionType *FTy =
+ llvm::FunctionType::get(VoidTy, Int8PtrTy, /*IsVarArgs=*/false);
+
+ if (CGM.getLangOptions().SjLjExceptions)
+ return CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume");
+ return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume");
+}
+
llvm::Constant *CodeGenFunction::getUnwindResumeOrRethrowFn() {
- const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(getLLVMContext());
const llvm::FunctionType *FTy =
- llvm::FunctionType::get(llvm::Type::getVoidTy(getLLVMContext()), Int8PtrTy,
- /*IsVarArgs=*/false);
+ llvm::FunctionType::get(VoidTy, Int8PtrTy, /*IsVarArgs=*/false);
if (CGM.getLangOptions().SjLjExceptions)
return CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume_or_Rethrow");
@@ -354,13 +361,17 @@ static void EmitAnyExprToExn(CodeGenFunction &CGF, const Expr *e,
}
llvm::Value *CodeGenFunction::getExceptionSlot() {
- if (!ExceptionSlot) {
- const llvm::Type *i8p = llvm::Type::getInt8PtrTy(getLLVMContext());
- ExceptionSlot = CreateTempAlloca(i8p, "exn.slot");
- }
+ if (!ExceptionSlot)
+ ExceptionSlot = CreateTempAlloca(Int8PtrTy, "exn.slot");
return ExceptionSlot;
}
+llvm::Value *CodeGenFunction::getEHSelectorSlot() {
+ if (!EHSelectorSlot)
+ EHSelectorSlot = CreateTempAlloca(Int32Ty, "ehselector.slot");
+ return EHSelectorSlot;
+}
+
void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) {
if (!E->getSubExpr()) {
if (getInvokeDest()) {
@@ -563,47 +574,59 @@ llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() {
return LP;
}
+// This code contains a hack to work around a design flaw in
+// LLVM's EH IR which breaks semantics after inlining. This same
+// hack is implemented in llvm-gcc.
+//
+// The LLVM EH abstraction is basically a thin veneer over the
+// traditional GCC zero-cost design: for each range of instructions
+// in the function, there is (at most) one "landing pad" with an
+// associated chain of EH actions. A language-specific personality
+// function interprets this chain of actions and (1) decides whether
+// or not to resume execution at the landing pad and (2) if so,
+// provides an integer indicating why it's stopping. In LLVM IR,
+// the association of a landing pad with a range of instructions is
+// achieved via an invoke instruction, the chain of actions becomes
+// the arguments to the @llvm.eh.selector call, and the selector
+// call returns the integer indicator. Other than the required
+// presence of two intrinsic function calls in the landing pad,
+// the IR exactly describes the layout of the output code.
+//
+// A principal advantage of this design is that it is completely
+// language-agnostic; in theory, the LLVM optimizers can treat
+// landing pads neutrally, and targets need only know how to lower
+// the intrinsics to have a functioning exceptions system (assuming
+// that platform exceptions follow something approximately like the
+// GCC design). Unfortunately, landing pads cannot be combined in a
+// language-agnostic way: given selectors A and B, there is no way
+// to make a single landing pad which faithfully represents the
+// semantics of propagating an exception first through A, then
+// through B, without knowing how the personality will interpret the
+// (lowered form of the) selectors. This means that inlining has no
+// choice but to crudely chain invokes (i.e., to ignore invokes in
+// the inlined function, but to turn all unwindable calls into
+// invokes), which is only semantically valid if every unwind stops
+// at every landing pad.
+//
+// Therefore, the invoke-inline hack is to guarantee that every
+// landing pad has a catch-all.
+enum CleanupHackLevel_t {
+ /// A level of hack that requires that all landing pads have
+ /// catch-alls.
+ CHL_MandatoryCatchall,
+
+ /// A level of hack that requires that all landing pads handle
+ /// cleanups.
+ CHL_MandatoryCleanup,
+
+ /// No hacks at all; ideal IR generation.
+ CHL_Ideal
+};
+const CleanupHackLevel_t CleanupHackLevel = CHL_MandatoryCleanup;
+
llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
assert(EHStack.requiresLandingPad());
- // This function contains a hack to work around a design flaw in
- // LLVM's EH IR which breaks semantics after inlining. This same
- // hack is implemented in llvm-gcc.
- //
- // The LLVM EH abstraction is basically a thin veneer over the
- // traditional GCC zero-cost design: for each range of instructions
- // in the function, there is (at most) one "landing pad" with an
- // associated chain of EH actions. A language-specific personality
- // function interprets this chain of actions and (1) decides whether
- // or not to resume execution at the landing pad and (2) if so,
- // provides an integer indicating why it's stopping. In LLVM IR,
- // the association of a landing pad with a range of instructions is
- // achieved via an invoke instruction, the chain of actions becomes
- // the arguments to the @llvm.eh.selector call, and the selector
- // call returns the integer indicator. Other than the required
- // presence of two intrinsic function calls in the landing pad,
- // the IR exactly describes the layout of the output code.
- //
- // A principal advantage of this design is that it is completely
- // language-agnostic; in theory, the LLVM optimizers can treat
- // landing pads neutrally, and targets need only know how to lower
- // the intrinsics to have a functioning exceptions system (assuming
- // that platform exceptions follow something approximately like the
- // GCC design). Unfortunately, landing pads cannot be combined in a
- // language-agnostic way: given selectors A and B, there is no way
- // to make a single landing pad which faithfully represents the
- // semantics of propagating an exception first through A, then
- // through B, without knowing how the personality will interpret the
- // (lowered form of the) selectors. This means that inlining has no
- // choice but to crudely chain invokes (i.e., to ignore invokes in
- // the inlined function, but to turn all unwindable calls into
- // invokes), which is only semantically valid if every unwind stops
- // at every landing pad.
- //
- // Therefore, the invoke-inline hack is to guarantee that every
- // landing pad has a catch-all.
- const bool UseInvokeInlineHack = true;
-
for (EHScopeStack::iterator ir = EHStack.begin(); ; ) {
assert(ir != EHStack.end() &&
"stack requiring landing pad is nothing but non-EH scopes?");
@@ -736,16 +759,23 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
EHSelector.append(EHFilters.begin(), EHFilters.end());
// Also check whether we need a cleanup.
- if (UseInvokeInlineHack || HasEHCleanup)
- EHSelector.push_back(UseInvokeInlineHack
+ if (CleanupHackLevel == CHL_MandatoryCatchall || HasEHCleanup)
+ EHSelector.push_back(CleanupHackLevel == CHL_MandatoryCatchall
? getCatchAllValue(*this)
: getCleanupValue(*this));
// Otherwise, signal that we at least have cleanups.
- } else if (UseInvokeInlineHack || HasEHCleanup) {
- EHSelector.push_back(UseInvokeInlineHack
+ } else if (CleanupHackLevel == CHL_MandatoryCatchall || HasEHCleanup) {
+ EHSelector.push_back(CleanupHackLevel == CHL_MandatoryCatchall
? getCatchAllValue(*this)
: getCleanupValue(*this));
+
+ // At the MandatoryCleanup hack level, we don't need to actually
+ // spuriously tell the unwinder that we have cleanups, but we do
+ // need to always be prepared to handle cleanups.
+ } else if (CleanupHackLevel == CHL_MandatoryCleanup) {
+ // Just don't decrement LastToEmitInLoop.
+
} else {
assert(LastToEmitInLoop > 2);
LastToEmitInLoop--;
@@ -758,6 +788,10 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::eh_selector),
EHSelector.begin(), EHSelector.end(), "eh.selector");
Selection->setDoesNotThrow();
+
+ // Save the selector value in mandatory-cleanup mode.
+ if (CleanupHackLevel == CHL_MandatoryCleanup)
+ Builder.CreateStore(Selection, getEHSelectorSlot());
// Select the right handler.
llvm::Value *llvm_eh_typeid_for =
@@ -833,22 +867,13 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
// If there was a cleanup, we'll need to actually check whether we
// landed here because the filter triggered.
- if (UseInvokeInlineHack || HasEHCleanup) {
- llvm::BasicBlock *RethrowBB = createBasicBlock("cleanup");
+ if (CleanupHackLevel != CHL_Ideal || HasEHCleanup) {
llvm::BasicBlock *UnexpectedBB = createBasicBlock("ehspec.unexpected");
- llvm::Constant *Zero = llvm::ConstantInt::get(Builder.getInt32Ty(), 0);
+ llvm::Constant *Zero = llvm::ConstantInt::get(Int32Ty, 0);
llvm::Value *FailsFilter =
Builder.CreateICmpSLT(SavedSelection, Zero, "ehspec.fails");
- Builder.CreateCondBr(FailsFilter, UnexpectedBB, RethrowBB);
-
- // The rethrow block is where we land if this was a cleanup.
- // TODO: can this be _Unwind_Resume if the InvokeInlineHack is off?
- EmitBlock(RethrowBB);
- Builder.CreateCall(getUnwindResumeOrRethrowFn(),
- Builder.CreateLoad(getExceptionSlot()))
- ->setDoesNotReturn();
- Builder.CreateUnreachable();
+ Builder.CreateCondBr(FailsFilter, UnexpectedBB, getRethrowDest().getBlock());
EmitBlock(UnexpectedBB);
}
@@ -863,7 +888,7 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
Builder.CreateUnreachable();
// ...or a normal catch handler...
- } else if (!UseInvokeInlineHack && !HasEHCleanup) {
+ } else if (CleanupHackLevel == CHL_Ideal && !HasEHCleanup) {
llvm::Value *Type = EHSelector.back();
EmitBranchThroughEHCleanup(EHHandlers[Type]);
@@ -1440,14 +1465,39 @@ CodeGenFunction::UnwindDest CodeGenFunction::getRethrowDest() {
// This can always be a call because we necessarily didn't find
// anything on the EH stack which needs our help.
llvm::StringRef RethrowName = Personality.getCatchallRethrowFnName();
- llvm::Constant *RethrowFn;
- if (!RethrowName.empty())
- RethrowFn = getCatchallRethrowFn(*this, RethrowName);
- else
- RethrowFn = getUnwindResumeOrRethrowFn();
+ if (!RethrowName.empty()) {
+ Builder.CreateCall(getCatchallRethrowFn(*this, RethrowName),
+ Builder.CreateLoad(getExceptionSlot()))
+ ->setDoesNotReturn();
+ } else {
+ llvm::Value *Exn = Builder.CreateLoad(getExceptionSlot());
+
+ switch (CleanupHackLevel) {
+ case CHL_MandatoryCatchall:
+ // In mandatory-catchall mode, we need to use
+ // _Unwind_Resume_or_Rethrow, or whatever the personality's
+ // equivalent is.
+ Builder.CreateCall(getUnwindResumeOrRethrowFn(), Exn)
+ ->setDoesNotReturn();
+ break;
+ case CHL_MandatoryCleanup: {
+ // In mandatory-cleanup mode, we should use llvm.eh.resume.
+ llvm::Value *Selector = Builder.CreateLoad(getEHSelectorSlot());
+ Builder.CreateCall2(CGM.getIntrinsic(llvm::Intrinsic::eh_resume),
+ Exn, Selector)
+ ->setDoesNotReturn();
+ break;
+ }
+ case CHL_Ideal:
+ // In an idealized mode where we don't have to worry about the
+ // optimizer combining landing pads, we should just use
+ // _Unwind_Resume (or the personality's equivalent).
+ Builder.CreateCall(getUnwindResumeFn(), Exn)
+ ->setDoesNotReturn();
+ break;
+ }
+ }
- Builder.CreateCall(RethrowFn, Builder.CreateLoad(getExceptionSlot()))
- ->setDoesNotReturn();
Builder.CreateUnreachable();
Builder.restoreIP(SavedIP);
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
index bc2cd35..2f6b55b 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp
@@ -1390,7 +1390,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
// The index must always be an integer, which is not an aggregate. Emit it.
llvm::Value *Idx = EmitScalarExpr(E->getIdx());
QualType IdxTy = E->getIdx()->getType();
- bool IdxSigned = IdxTy->isSignedIntegerType();
+ bool IdxSigned = IdxTy->isSignedIntegerOrEnumerationType();
// If the base is a vector type, then we are forming a vector element lvalue
// with this subscript.
@@ -1635,7 +1635,8 @@ LValue CodeGenFunction::EmitLValueForAnonRecordField(llvm::Value *BaseValue,
IndirectFieldDecl::chain_iterator I = Field->chain_begin(),
IEnd = Field->chain_end();
while (true) {
- LValue LV = EmitLValueForField(BaseValue, cast<FieldDecl>(*I), CVRQualifiers);
+ LValue LV = EmitLValueForField(BaseValue, cast<FieldDecl>(*I),
+ CVRQualifiers);
if (++I == IEnd) return LV;
assert(LV.isSimple());
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp
index 29c7688..d8da642 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp
@@ -642,7 +642,7 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
if (const RecordType *RT = CGF.getContext()
.getBaseElementType(ElementType)->getAs<RecordType>()) {
const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
- hasNonTrivialCXXConstructor = !RD->hasTrivialConstructor();
+ hasNonTrivialCXXConstructor = !RD->hasTrivialDefaultConstructor();
}
// FIXME: were we intentionally ignoring address spaces and GC attributes?
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp
index bdaa873..81fee67 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp
@@ -345,18 +345,7 @@ CodeGenFunction::EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E,
}
}
- const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>();
- const llvm::Type *Ty =
- CGM.getTypes().GetFunctionType(CGM.getTypes().getFunctionInfo(MD),
- FPT->isVariadic());
- llvm::Value *Callee;
- if (MD->isVirtual() &&
- !canDevirtualizeMemberFunctionCalls(getContext(),
- E->getArg(0), MD))
- Callee = BuildVirtualCall(MD, This, Ty);
- else
- Callee = CGM.GetAddrOfFunction(MD, Ty);
-
+ llvm::Value *Callee = EmitCXXOperatorMemberCallee(E, MD, This);
return EmitCXXMemberCall(MD, Callee, ReturnValue, This, /*VTT=*/0,
E->arg_begin() + 1, E->arg_end());
}
@@ -403,18 +392,26 @@ CodeGenFunction::EmitCXXConstructExpr(const CXXConstructExpr *E,
E->arg_begin(), E->arg_end());
}
else {
- CXXCtorType Type;
- CXXConstructExpr::ConstructionKind K = E->getConstructionKind();
- if (K == CXXConstructExpr::CK_Delegating) {
+ CXXCtorType Type = Ctor_Complete;
+ bool ForVirtualBase = false;
+
+ switch (E->getConstructionKind()) {
+ case CXXConstructExpr::CK_Delegating:
// We should be emitting a constructor; GlobalDecl will assert this
Type = CurGD.getCtorType();
- } else {
- Type = (E->getConstructionKind() == CXXConstructExpr::CK_Complete)
- ? Ctor_Complete : Ctor_Base;
- }
+ break;
+
+ case CXXConstructExpr::CK_Complete:
+ Type = Ctor_Complete;
+ break;
+
+ case CXXConstructExpr::CK_VirtualBase:
+ ForVirtualBase = true;
+ // fall-through
- bool ForVirtualBase =
- E->getConstructionKind() == CXXConstructExpr::CK_VirtualBase;
+ case CXXConstructExpr::CK_NonVirtualBase:
+ Type = Ctor_Base;
+ }
// Call the constructor.
EmitCXXConstructorCall(CD, Type, ForVirtualBase, Dest.getAddr(),
@@ -447,204 +444,256 @@ CodeGenFunction::EmitSynthesizedCXXCopyCtor(llvm::Value *Dest,
E->arg_begin(), E->arg_end());
}
-/// Check whether the given operator new[] is the global placement
-/// operator new[].
-static bool IsPlacementOperatorNewArray(ASTContext &Ctx,
- const FunctionDecl *Fn) {
- // Must be in global scope. Note that allocation functions can't be
- // declared in namespaces.
- if (!Fn->getDeclContext()->getRedeclContext()->isFileContext())
- return false;
-
- // Signature must be void *operator new[](size_t, void*).
- // The size_t is common to all operator new[]s.
- if (Fn->getNumParams() != 2)
- return false;
-
- CanQualType ParamType = Ctx.getCanonicalType(Fn->getParamDecl(1)->getType());
- return (ParamType == Ctx.VoidPtrTy);
-}
-
static CharUnits CalculateCookiePadding(CodeGenFunction &CGF,
const CXXNewExpr *E) {
if (!E->isArray())
return CharUnits::Zero();
- // No cookie is required if the new operator being used is
- // ::operator new[](size_t, void*).
- const FunctionDecl *OperatorNew = E->getOperatorNew();
- if (IsPlacementOperatorNewArray(CGF.getContext(), OperatorNew))
+ // No cookie is required if the operator new[] being used is the
+ // reserved placement operator new[].
+ if (E->getOperatorNew()->isReservedGlobalPlacementOperator())
return CharUnits::Zero();
return CGF.CGM.getCXXABI().GetArrayCookieSize(E);
}
-static llvm::Value *EmitCXXNewAllocSize(ASTContext &Context,
- CodeGenFunction &CGF,
- const CXXNewExpr *E,
- llvm::Value *&NumElements,
- llvm::Value *&SizeWithoutCookie) {
- QualType ElemType = E->getAllocatedType();
-
- const llvm::IntegerType *SizeTy =
- cast<llvm::IntegerType>(CGF.ConvertType(CGF.getContext().getSizeType()));
-
- CharUnits TypeSize = CGF.getContext().getTypeSizeInChars(ElemType);
-
- if (!E->isArray()) {
- SizeWithoutCookie = llvm::ConstantInt::get(SizeTy, TypeSize.getQuantity());
- return SizeWithoutCookie;
+static llvm::Value *EmitCXXNewAllocSize(CodeGenFunction &CGF,
+ const CXXNewExpr *e,
+ llvm::Value *&numElements,
+ llvm::Value *&sizeWithoutCookie) {
+ QualType type = e->getAllocatedType();
+
+ if (!e->isArray()) {
+ CharUnits typeSize = CGF.getContext().getTypeSizeInChars(type);
+ sizeWithoutCookie
+ = llvm::ConstantInt::get(CGF.SizeTy, typeSize.getQuantity());
+ return sizeWithoutCookie;
}
+ // The width of size_t.
+ unsigned sizeWidth = CGF.SizeTy->getBitWidth();
+
// Figure out the cookie size.
- CharUnits CookieSize = CalculateCookiePadding(CGF, E);
+ llvm::APInt cookieSize(sizeWidth,
+ CalculateCookiePadding(CGF, e).getQuantity());
// Emit the array size expression.
// We multiply the size of all dimensions for NumElements.
// e.g for 'int[2][3]', ElemType is 'int' and NumElements is 6.
- NumElements = CGF.EmitScalarExpr(E->getArraySize());
- assert(NumElements->getType() == SizeTy && "element count not a size_t");
-
- uint64_t ArraySizeMultiplier = 1;
+ numElements = CGF.EmitScalarExpr(e->getArraySize());
+ assert(isa<llvm::IntegerType>(numElements->getType()));
+
+ // The number of elements can be have an arbitrary integer type;
+ // essentially, we need to multiply it by a constant factor, add a
+ // cookie size, and verify that the result is representable as a
+ // size_t. That's just a gloss, though, and it's wrong in one
+ // important way: if the count is negative, it's an error even if
+ // the cookie size would bring the total size >= 0.
+ bool isSigned
+ = e->getArraySize()->getType()->isSignedIntegerOrEnumerationType();
+ const llvm::IntegerType *numElementsType
+ = cast<llvm::IntegerType>(numElements->getType());
+ unsigned numElementsWidth = numElementsType->getBitWidth();
+
+ // Compute the constant factor.
+ llvm::APInt arraySizeMultiplier(sizeWidth, 1);
while (const ConstantArrayType *CAT
- = CGF.getContext().getAsConstantArrayType(ElemType)) {
- ElemType = CAT->getElementType();
- ArraySizeMultiplier *= CAT->getSize().getZExtValue();
+ = CGF.getContext().getAsConstantArrayType(type)) {
+ type = CAT->getElementType();
+ arraySizeMultiplier *= CAT->getSize();
}
- llvm::Value *Size;
+ CharUnits typeSize = CGF.getContext().getTypeSizeInChars(type);
+ llvm::APInt typeSizeMultiplier(sizeWidth, typeSize.getQuantity());
+ typeSizeMultiplier *= arraySizeMultiplier;
+
+ // This will be a size_t.
+ llvm::Value *size;
// If someone is doing 'new int[42]' there is no need to do a dynamic check.
// Don't bloat the -O0 code.
- if (llvm::ConstantInt *NumElementsC =
- dyn_cast<llvm::ConstantInt>(NumElements)) {
- llvm::APInt NEC = NumElementsC->getValue();
- unsigned SizeWidth = NEC.getBitWidth();
-
- // Determine if there is an overflow here by doing an extended multiply.
- NEC = NEC.zext(SizeWidth*2);
- llvm::APInt SC(SizeWidth*2, TypeSize.getQuantity());
- SC *= NEC;
-
- if (!CookieSize.isZero()) {
- // Save the current size without a cookie. We don't care if an
- // overflow's already happened because SizeWithoutCookie isn't
- // used if the allocator returns null or throws, as it should
- // always do on an overflow.
- llvm::APInt SWC = SC.trunc(SizeWidth);
- SizeWithoutCookie = llvm::ConstantInt::get(SizeTy, SWC);
-
- // Add the cookie size.
- SC += llvm::APInt(SizeWidth*2, CookieSize.getQuantity());
+ if (llvm::ConstantInt *numElementsC =
+ dyn_cast<llvm::ConstantInt>(numElements)) {
+ const llvm::APInt &count = numElementsC->getValue();
+
+ bool hasAnyOverflow = false;
+
+ // If 'count' was a negative number, it's an overflow.
+ if (isSigned && count.isNegative())
+ hasAnyOverflow = true;
+
+ // We want to do all this arithmetic in size_t. If numElements is
+ // wider than that, check whether it's already too big, and if so,
+ // overflow.
+ else if (numElementsWidth > sizeWidth &&
+ numElementsWidth - sizeWidth > count.countLeadingZeros())
+ hasAnyOverflow = true;
+
+ // Okay, compute a count at the right width.
+ llvm::APInt adjustedCount = count.zextOrTrunc(sizeWidth);
+
+ // Scale numElements by that. This might overflow, but we don't
+ // care because it only overflows if allocationSize does, too, and
+ // if that overflows then we shouldn't use this.
+ numElements = llvm::ConstantInt::get(CGF.SizeTy,
+ adjustedCount * arraySizeMultiplier);
+
+ // Compute the size before cookie, and track whether it overflowed.
+ bool overflow;
+ llvm::APInt allocationSize
+ = adjustedCount.umul_ov(typeSizeMultiplier, overflow);
+ hasAnyOverflow |= overflow;
+
+ // Add in the cookie, and check whether it's overflowed.
+ if (cookieSize != 0) {
+ // Save the current size without a cookie. This shouldn't be
+ // used if there was overflow.
+ sizeWithoutCookie = llvm::ConstantInt::get(CGF.SizeTy, allocationSize);
+
+ allocationSize = allocationSize.uadd_ov(cookieSize, overflow);
+ hasAnyOverflow |= overflow;
}
-
- if (SC.countLeadingZeros() >= SizeWidth) {
- SC = SC.trunc(SizeWidth);
- Size = llvm::ConstantInt::get(SizeTy, SC);
+
+ // On overflow, produce a -1 so operator new will fail.
+ if (hasAnyOverflow) {
+ size = llvm::Constant::getAllOnesValue(CGF.SizeTy);
} else {
- // On overflow, produce a -1 so operator new throws.
- Size = llvm::Constant::getAllOnesValue(SizeTy);
+ size = llvm::ConstantInt::get(CGF.SizeTy, allocationSize);
}
- // Scale NumElements while we're at it.
- uint64_t N = NEC.getZExtValue() * ArraySizeMultiplier;
- NumElements = llvm::ConstantInt::get(SizeTy, N);
-
- // Otherwise, we don't need to do an overflow-checked multiplication if
- // we're multiplying by one.
- } else if (TypeSize.isOne()) {
- assert(ArraySizeMultiplier == 1);
-
- Size = NumElements;
-
- // If we need a cookie, add its size in with an overflow check.
- // This is maybe a little paranoid.
- if (!CookieSize.isZero()) {
- SizeWithoutCookie = Size;
+ // Otherwise, we might need to use the overflow intrinsics.
+ } else {
+ // There are up to four conditions we need to test for:
+ // 1) if isSigned, we need to check whether numElements is negative;
+ // 2) if numElementsWidth > sizeWidth, we need to check whether
+ // numElements is larger than something representable in size_t;
+ // 3) we need to compute
+ // sizeWithoutCookie := numElements * typeSizeMultiplier
+ // and check whether it overflows; and
+ // 4) if we need a cookie, we need to compute
+ // size := sizeWithoutCookie + cookieSize
+ // and check whether it overflows.
+
+ llvm::Value *hasOverflow = 0;
+
+ // If numElementsWidth > sizeWidth, then one way or another, we're
+ // going to have to do a comparison for (2), and this happens to
+ // take care of (1), too.
+ if (numElementsWidth > sizeWidth) {
+ llvm::APInt threshold(numElementsWidth, 1);
+ threshold <<= sizeWidth;
+
+ llvm::Value *thresholdV
+ = llvm::ConstantInt::get(numElementsType, threshold);
+
+ hasOverflow = CGF.Builder.CreateICmpUGE(numElements, thresholdV);
+ numElements = CGF.Builder.CreateTrunc(numElements, CGF.SizeTy);
+
+ // Otherwise, if we're signed, we want to sext up to size_t.
+ } else if (isSigned) {
+ if (numElementsWidth < sizeWidth)
+ numElements = CGF.Builder.CreateSExt(numElements, CGF.SizeTy);
+
+ // If there's a non-1 type size multiplier, then we can do the
+ // signedness check at the same time as we do the multiply
+ // because a negative number times anything will cause an
+ // unsigned overflow. Otherwise, we have to do it here.
+ if (typeSizeMultiplier == 1)
+ hasOverflow = CGF.Builder.CreateICmpSLT(numElements,
+ llvm::ConstantInt::get(CGF.SizeTy, 0));
+
+ // Otherwise, zext up to size_t if necessary.
+ } else if (numElementsWidth < sizeWidth) {
+ numElements = CGF.Builder.CreateZExt(numElements, CGF.SizeTy);
+ }
- llvm::Value *CookieSizeV
- = llvm::ConstantInt::get(SizeTy, CookieSize.getQuantity());
+ assert(numElements->getType() == CGF.SizeTy);
- const llvm::Type *Types[] = { SizeTy };
- llvm::Value *UAddF
- = CGF.CGM.getIntrinsic(llvm::Intrinsic::uadd_with_overflow, Types, 1);
- llvm::Value *AddRes
- = CGF.Builder.CreateCall2(UAddF, Size, CookieSizeV);
+ size = numElements;
- Size = CGF.Builder.CreateExtractValue(AddRes, 0);
- llvm::Value *DidOverflow = CGF.Builder.CreateExtractValue(AddRes, 1);
- Size = CGF.Builder.CreateSelect(DidOverflow,
- llvm::ConstantInt::get(SizeTy, -1),
- Size);
+ // Multiply by the type size if necessary. This multiplier
+ // includes all the factors for nested arrays.
+ //
+ // This step also causes numElements to be scaled up by the
+ // nested-array factor if necessary. Overflow on this computation
+ // can be ignored because the result shouldn't be used if
+ // allocation fails.
+ if (typeSizeMultiplier != 1) {
+ const llvm::Type *intrinsicTypes[] = { CGF.SizeTy };
+ llvm::Value *umul_with_overflow
+ = CGF.CGM.getIntrinsic(llvm::Intrinsic::umul_with_overflow,
+ intrinsicTypes, 1);
+
+ llvm::Value *tsmV =
+ llvm::ConstantInt::get(CGF.SizeTy, typeSizeMultiplier);
+ llvm::Value *result =
+ CGF.Builder.CreateCall2(umul_with_overflow, size, tsmV);
+
+ llvm::Value *overflowed = CGF.Builder.CreateExtractValue(result, 1);
+ if (hasOverflow)
+ hasOverflow = CGF.Builder.CreateOr(hasOverflow, overflowed);
+ else
+ hasOverflow = overflowed;
+
+ size = CGF.Builder.CreateExtractValue(result, 0);
+
+ // Also scale up numElements by the array size multiplier.
+ if (arraySizeMultiplier != 1) {
+ // If the base element type size is 1, then we can re-use the
+ // multiply we just did.
+ if (typeSize.isOne()) {
+ assert(arraySizeMultiplier == typeSizeMultiplier);
+ numElements = size;
+
+ // Otherwise we need a separate multiply.
+ } else {
+ llvm::Value *asmV =
+ llvm::ConstantInt::get(CGF.SizeTy, arraySizeMultiplier);
+ numElements = CGF.Builder.CreateMul(numElements, asmV);
+ }
+ }
+ } else {
+ // numElements doesn't need to be scaled.
+ assert(arraySizeMultiplier == 1);
}
+
+ // Add in the cookie size if necessary.
+ if (cookieSize != 0) {
+ sizeWithoutCookie = size;
+
+ const llvm::Type *intrinsicTypes[] = { CGF.SizeTy };
+ llvm::Value *uadd_with_overflow
+ = CGF.CGM.getIntrinsic(llvm::Intrinsic::uadd_with_overflow,
+ intrinsicTypes, 1);
+
+ llvm::Value *cookieSizeV = llvm::ConstantInt::get(CGF.SizeTy, cookieSize);
+ llvm::Value *result =
+ CGF.Builder.CreateCall2(uadd_with_overflow, size, cookieSizeV);
+
+ llvm::Value *overflowed = CGF.Builder.CreateExtractValue(result, 1);
+ if (hasOverflow)
+ hasOverflow = CGF.Builder.CreateOr(hasOverflow, overflowed);
+ else
+ hasOverflow = overflowed;
- // Otherwise use the int.umul.with.overflow intrinsic.
- } else {
- llvm::Value *OutermostElementSize
- = llvm::ConstantInt::get(SizeTy, TypeSize.getQuantity());
-
- llvm::Value *NumOutermostElements = NumElements;
-
- // Scale NumElements by the array size multiplier. This might
- // overflow, but only if the multiplication below also overflows,
- // in which case this multiplication isn't used.
- if (ArraySizeMultiplier != 1)
- NumElements = CGF.Builder.CreateMul(NumElements,
- llvm::ConstantInt::get(SizeTy, ArraySizeMultiplier));
-
- // The requested size of the outermost array is non-constant.
- // Multiply that by the static size of the elements of that array;
- // on unsigned overflow, set the size to -1 to trigger an
- // exception from the allocation routine. This is sufficient to
- // prevent buffer overruns from the allocator returning a
- // seemingly valid pointer to insufficient space. This idea comes
- // originally from MSVC, and GCC has an open bug requesting
- // similar behavior:
- // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19351
- //
- // This will not be sufficient for C++0x, which requires a
- // specific exception class (std::bad_array_new_length).
- // That will require ABI support that has not yet been specified.
- const llvm::Type *Types[] = { SizeTy };
- llvm::Value *UMulF
- = CGF.CGM.getIntrinsic(llvm::Intrinsic::umul_with_overflow, Types, 1);
- llvm::Value *MulRes = CGF.Builder.CreateCall2(UMulF, NumOutermostElements,
- OutermostElementSize);
-
- // The overflow bit.
- llvm::Value *DidOverflow = CGF.Builder.CreateExtractValue(MulRes, 1);
-
- // The result of the multiplication.
- Size = CGF.Builder.CreateExtractValue(MulRes, 0);
-
- // If we have a cookie, we need to add that size in, too.
- if (!CookieSize.isZero()) {
- SizeWithoutCookie = Size;
-
- llvm::Value *CookieSizeV
- = llvm::ConstantInt::get(SizeTy, CookieSize.getQuantity());
- llvm::Value *UAddF
- = CGF.CGM.getIntrinsic(llvm::Intrinsic::uadd_with_overflow, Types, 1);
- llvm::Value *AddRes
- = CGF.Builder.CreateCall2(UAddF, SizeWithoutCookie, CookieSizeV);
-
- Size = CGF.Builder.CreateExtractValue(AddRes, 0);
-
- llvm::Value *AddDidOverflow = CGF.Builder.CreateExtractValue(AddRes, 1);
- DidOverflow = CGF.Builder.CreateOr(DidOverflow, AddDidOverflow);
+ size = CGF.Builder.CreateExtractValue(result, 0);
}
- Size = CGF.Builder.CreateSelect(DidOverflow,
- llvm::ConstantInt::get(SizeTy, -1),
- Size);
+ // If we had any possibility of dynamic overflow, make a select to
+ // overwrite 'size' with an all-ones value, which should cause
+ // operator new to throw.
+ if (hasOverflow)
+ size = CGF.Builder.CreateSelect(hasOverflow,
+ llvm::Constant::getAllOnesValue(CGF.SizeTy),
+ size);
}
- if (CookieSize.isZero())
- SizeWithoutCookie = Size;
+ if (cookieSize == 0)
+ sizeWithoutCookie = size;
else
- assert(SizeWithoutCookie && "didn't set SizeWithoutCookie?");
+ assert(sizeWithoutCookie && "didn't set sizeWithoutCookie?");
- return Size;
+ return size;
}
static void StoreAnyExprIntoOneUnit(CodeGenFunction &CGF, const CXXNewExpr *E,
@@ -741,7 +790,7 @@ static void EmitNewInitializer(CodeGenFunction &CGF, const CXXNewExpr *E,
if (E->isArray()) {
if (CXXConstructorDecl *Ctor = E->getConstructor()) {
bool RequiresZeroInitialization = false;
- if (Ctor->getParent()->hasTrivialConstructor()) {
+ if (Ctor->getParent()->hasTrivialDefaultConstructor()) {
// If new expression did not specify value-initialization, then there
// is no initialization.
if (!E->hasInitializer() || Ctor->getParent()->isEmpty())
@@ -972,8 +1021,7 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
llvm::Value *numElements = 0;
llvm::Value *allocSizeWithoutCookie = 0;
llvm::Value *allocSize =
- EmitCXXNewAllocSize(getContext(), *this, E, numElements,
- allocSizeWithoutCookie);
+ EmitCXXNewAllocSize(*this, E, numElements, allocSizeWithoutCookie);
allocatorArgs.add(RValue::get(allocSize), sizeType);
@@ -1007,11 +1055,19 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
EmitCallArg(allocatorArgs, *placementArg, placementArg->getType());
}
- // Emit the allocation call.
- RValue RV =
- EmitCall(CGM.getTypes().getFunctionInfo(allocatorArgs, allocatorType),
- CGM.GetAddrOfFunction(allocator), ReturnValueSlot(),
- allocatorArgs, allocator);
+ // Emit the allocation call. If the allocator is a global placement
+ // operator, just "inline" it directly.
+ RValue RV;
+ if (allocator->isReservedGlobalPlacementOperator()) {
+ assert(allocatorArgs.size() == 2);
+ RV = allocatorArgs[1].RV;
+ // TODO: kill any unnecessary computations done for the size
+ // argument.
+ } else {
+ RV = EmitCall(CGM.getTypes().getFunctionInfo(allocatorArgs, allocatorType),
+ CGM.GetAddrOfFunction(allocator), ReturnValueSlot(),
+ allocatorArgs, allocator);
+ }
// Emit a null check on the allocation result if the allocation
// function is allowed to return null (because it has a non-throwing
@@ -1056,7 +1112,8 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
// If there's an operator delete, enter a cleanup to call it if an
// exception is thrown.
EHScopeStack::stable_iterator operatorDeleteCleanup;
- if (E->getOperatorDelete()) {
+ if (E->getOperatorDelete() &&
+ !E->getOperatorDelete()->isReservedGlobalPlacementOperator()) {
EnterNewDeleteCleanup(*this, E, allocation, allocSize, allocatorArgs);
operatorDeleteCleanup = EHStack.stable_begin();
}
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp
index 463b913..da37bd5 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp
@@ -352,8 +352,7 @@ bool ConstStructBuilder::Build(InitListExpr *ILE) {
if (IsMsStruct) {
// Zero-length bitfields following non-bitfield members are
// ignored:
- if (CGM.getContext().ZeroBitfieldFollowsNonBitfield((*Field), LastFD) ||
- CGM.getContext().ZeroBitfieldFollowsBitfield((*Field), LastFD)) {
+ if (CGM.getContext().ZeroBitfieldFollowsNonBitfield((*Field), LastFD)) {
--FieldNo;
continue;
}
@@ -611,12 +610,12 @@ public:
return llvm::ConstantPointerNull::get(cast<llvm::PointerType>(destType));
case CK_IntegralCast: {
- bool isSigned = subExpr->getType()->isSignedIntegerType();
+ bool isSigned = subExpr->getType()->isSignedIntegerOrEnumerationType();
return llvm::ConstantExpr::getIntegerCast(C, destType, isSigned);
}
case CK_IntegralToPointer: {
- bool isSigned = subExpr->getType()->isSignedIntegerType();
+ bool isSigned = subExpr->getType()->isSignedIntegerOrEnumerationType();
C = llvm::ConstantExpr::getIntegerCast(C, CGM.IntPtrTy, isSigned);
return llvm::ConstantExpr::getIntToPtr(C, destType);
}
@@ -626,13 +625,13 @@ public:
llvm::Constant::getNullValue(C->getType()));
case CK_IntegralToFloating:
- if (subExpr->getType()->isSignedIntegerType())
+ if (subExpr->getType()->isSignedIntegerOrEnumerationType())
return llvm::ConstantExpr::getSIToFP(C, destType);
else
return llvm::ConstantExpr::getUIToFP(C, destType);
case CK_FloatingToIntegral:
- if (E->getType()->isSignedIntegerType())
+ if (E->getType()->isSignedIntegerOrEnumerationType())
return llvm::ConstantExpr::getFPToSI(C, destType);
else
return llvm::ConstantExpr::getFPToUI(C, destType);
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp
index 6bcc425..dff7bf4 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp
@@ -400,7 +400,7 @@ public:
// Binary Operators.
Value *EmitMul(const BinOpInfo &Ops) {
- if (Ops.Ty->hasSignedIntegerRepresentation()) {
+ if (Ops.Ty->isSignedIntegerOrEnumerationType()) {
switch (CGF.getContext().getLangOptions().getSignedOverflowBehavior()) {
case LangOptions::SOB_Undefined:
return Builder.CreateNSWMul(Ops.LHS, Ops.RHS, "mul");
@@ -508,6 +508,7 @@ public:
Value *VisitObjCStringLiteral(const ObjCStringLiteral *E) {
return CGF.EmitObjCStringLiteral(E);
}
+ Value *VisitAsTypeExpr(AsTypeExpr *CE);
};
} // end anonymous namespace.
@@ -568,7 +569,7 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType,
// First, convert to the correct width so that we control the kind of
// extension.
const llvm::Type *MiddleTy = CGF.IntPtrTy;
- bool InputSigned = SrcType->isSignedIntegerType();
+ bool InputSigned = SrcType->isSignedIntegerOrEnumerationType();
llvm::Value* IntResult =
Builder.CreateIntCast(Src, MiddleTy, InputSigned, "conv");
// Then, cast to pointer.
@@ -610,7 +611,7 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType,
// Finally, we have the arithmetic types: real int/float.
if (isa<llvm::IntegerType>(Src->getType())) {
- bool InputSigned = SrcType->isSignedIntegerType();
+ bool InputSigned = SrcType->isSignedIntegerOrEnumerationType();
if (isa<llvm::IntegerType>(DstTy))
return Builder.CreateIntCast(Src, DstTy, InputSigned, "conv");
else if (InputSigned)
@@ -621,7 +622,7 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType,
assert(Src->getType()->isFloatingPointTy() && "Unknown real conversion");
if (isa<llvm::IntegerType>(DstTy)) {
- if (DstType->isSignedIntegerType())
+ if (DstType->isSignedIntegerOrEnumerationType())
return Builder.CreateFPToSI(Src, DstTy, "conv");
else
return Builder.CreateFPToUI(Src, DstTy, "conv");
@@ -758,19 +759,13 @@ Value *ScalarExprEmitter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
Value* V2 = CGF.EmitScalarExpr(E->getExpr(1));
// Handle vec3 special since the index will be off by one for the RHS.
+ const llvm::VectorType *VTy = cast<llvm::VectorType>(V1->getType());
llvm::SmallVector<llvm::Constant*, 32> indices;
for (unsigned i = 2; i < E->getNumSubExprs(); i++) {
- llvm::Constant *C = cast<llvm::Constant>(CGF.EmitScalarExpr(E->getExpr(i)));
- const llvm::VectorType *VTy = cast<llvm::VectorType>(V1->getType());
- if (VTy->getNumElements() == 3) {
- if (llvm::ConstantInt *CI = dyn_cast<llvm::ConstantInt>(C)) {
- uint64_t cVal = CI->getZExtValue();
- if (cVal > 3) {
- C = llvm::ConstantInt::get(C->getType(), cVal-1);
- }
- }
- }
- indices.push_back(C);
+ unsigned Idx = E->getShuffleMaskIdx(CGF.getContext(), i-2);
+ if (VTy->getNumElements() == 3 && Idx > 3)
+ Idx -= 1;
+ indices.push_back(Builder.getInt32(Idx));
}
Value *SV = llvm::ConstantVector::get(indices);
@@ -813,7 +808,7 @@ Value *ScalarExprEmitter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
// integer value.
Value *Base = Visit(E->getBase());
Value *Idx = Visit(E->getIdx());
- bool IdxSigned = E->getIdx()->getType()->isSignedIntegerType();
+ bool IdxSigned = E->getIdx()->getType()->isSignedIntegerOrEnumerationType();
Idx = Builder.CreateIntCast(Idx, CGF.Int32Ty, IdxSigned, "vecidxcast");
return Builder.CreateExtractElement(Base, Idx, "vecext");
}
@@ -1142,7 +1137,7 @@ Value *ScalarExprEmitter::EmitCastExpr(CastExpr *CE) {
// First, convert to the correct width so that we control the kind of
// extension.
const llvm::Type *MiddleTy = CGF.IntPtrTy;
- bool InputSigned = E->getType()->isSignedIntegerType();
+ bool InputSigned = E->getType()->isSignedIntegerOrEnumerationType();
llvm::Value* IntResult =
Builder.CreateIntCast(Src, MiddleTy, InputSigned, "conv");
@@ -1285,7 +1280,7 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
// Note that signed integer inc/dec with width less than int can't
// overflow because of promotion rules; we're just eliding a few steps here.
- if (type->isSignedIntegerType() &&
+ if (type->isSignedIntegerOrEnumerationType() &&
value->getType()->getPrimitiveSizeInBits() >=
CGF.CGM.IntTy->getBitWidth())
value = EmitAddConsiderOverflowBehavior(E, value, amt, isInc);
@@ -1333,10 +1328,7 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
if (type->hasIntegerRepresentation()) {
llvm::Value *amt = llvm::ConstantInt::get(value->getType(), amount);
- if (type->hasSignedIntegerRepresentation())
- value = EmitAddConsiderOverflowBehavior(E, value, amt, isInc);
- else
- value = Builder.CreateAdd(value, amt, isInc ? "inc" : "dec");
+ value = Builder.CreateAdd(value, amt, isInc ? "inc" : "dec");
} else {
value = Builder.CreateFAdd(
value,
@@ -1447,7 +1439,7 @@ Value *ScalarExprEmitter::VisitOffsetOfExpr(OffsetOfExpr *E) {
// Compute the index
Expr *IdxExpr = E->getIndexExpr(ON.getArrayExprIndex());
llvm::Value* Idx = CGF.EmitScalarExpr(IdxExpr);
- bool IdxSigned = IdxExpr->getType()->isSignedIntegerType();
+ bool IdxSigned = IdxExpr->getType()->isSignedIntegerOrEnumerationType();
Idx = Builder.CreateIntCast(Idx, ResultType, IdxSigned, "conv");
// Save the element type
@@ -1797,9 +1789,7 @@ Value *ScalarExprEmitter::EmitOverflowCheckedBinOp(const BinOpInfo &Ops) {
// Get the overflow handler.
const llvm::Type *Int8Ty = llvm::Type::getInt8Ty(VMContext);
- std::vector<const llvm::Type*> argTypes;
- argTypes.push_back(CGF.Int64Ty); argTypes.push_back(CGF.Int64Ty);
- argTypes.push_back(Int8Ty); argTypes.push_back(Int8Ty);
+ const llvm::Type *argTypes[] = { CGF.Int64Ty, CGF.Int64Ty, Int8Ty, Int8Ty };
llvm::FunctionType *handlerTy =
llvm::FunctionType::get(CGF.Int64Ty, argTypes, true);
llvm::Value *handler = CGF.CGM.CreateRuntimeFunction(handlerTy, *handlerName);
@@ -1829,7 +1819,7 @@ Value *ScalarExprEmitter::EmitOverflowCheckedBinOp(const BinOpInfo &Ops) {
Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) {
if (!Ops.Ty->isAnyPointerType()) {
- if (Ops.Ty->hasSignedIntegerRepresentation()) {
+ if (Ops.Ty->isSignedIntegerOrEnumerationType()) {
switch (CGF.getContext().getLangOptions().getSignedOverflowBehavior()) {
case LangOptions::SOB_Undefined:
return Builder.CreateNSWAdd(Ops.LHS, Ops.RHS, "add");
@@ -1879,7 +1869,7 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) {
// Zero or sign extend the pointer value based on whether the index is
// signed or not.
const llvm::Type *IdxType = CGF.IntPtrTy;
- if (IdxExp->getType()->isSignedIntegerType())
+ if (IdxExp->getType()->isSignedIntegerOrEnumerationType())
Idx = Builder.CreateSExt(Idx, IdxType, "idx.ext");
else
Idx = Builder.CreateZExt(Idx, IdxType, "idx.ext");
@@ -1914,7 +1904,7 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &Ops) {
Value *ScalarExprEmitter::EmitSub(const BinOpInfo &Ops) {
if (!isa<llvm::PointerType>(Ops.LHS->getType())) {
- if (Ops.Ty->hasSignedIntegerRepresentation()) {
+ if (Ops.Ty->isSignedIntegerOrEnumerationType()) {
switch (CGF.getContext().getLangOptions().getSignedOverflowBehavior()) {
case LangOptions::SOB_Undefined:
return Builder.CreateNSWSub(Ops.LHS, Ops.RHS, "sub");
@@ -1954,7 +1944,7 @@ Value *ScalarExprEmitter::EmitSub(const BinOpInfo &Ops) {
// Zero or sign extend the pointer value based on whether the index is
// signed or not.
const llvm::Type *IdxType = CGF.IntPtrTy;
- if (BinOp->getRHS()->getType()->isSignedIntegerType())
+ if (BinOp->getRHS()->getType()->isSignedIntegerOrEnumerationType())
Idx = Builder.CreateSExt(Idx, IdxType, "idx.ext");
else
Idx = Builder.CreateZExt(Idx, IdxType, "idx.ext");
@@ -2556,6 +2546,56 @@ Value *ScalarExprEmitter::VisitBlockExpr(const BlockExpr *block) {
return CGF.EmitBlockLiteral(block);
}
+Value *ScalarExprEmitter::VisitAsTypeExpr(AsTypeExpr *E) {
+ Value *Src = CGF.EmitScalarExpr(E->getSrcExpr());
+ const llvm::Type * DstTy = ConvertType(E->getDstType());
+
+ // Going from vec4->vec3 or vec3->vec4 is a special case and requires
+ // a shuffle vector instead of a bitcast.
+ const llvm::Type *SrcTy = Src->getType();
+ if (isa<llvm::VectorType>(DstTy) && isa<llvm::VectorType>(SrcTy)) {
+ unsigned numElementsDst = cast<llvm::VectorType>(DstTy)->getNumElements();
+ unsigned numElementsSrc = cast<llvm::VectorType>(SrcTy)->getNumElements();
+ if ((numElementsDst == 3 && numElementsSrc == 4)
+ || (numElementsDst == 4 && numElementsSrc == 3)) {
+
+
+ // In the case of going from int4->float3, a bitcast is needed before
+ // doing a shuffle.
+ const llvm::Type *srcElemTy =
+ cast<llvm::VectorType>(SrcTy)->getElementType();
+ const llvm::Type *dstElemTy =
+ cast<llvm::VectorType>(DstTy)->getElementType();
+
+ if ((srcElemTy->isIntegerTy() && dstElemTy->isFloatTy())
+ || (srcElemTy->isFloatTy() && dstElemTy->isIntegerTy())) {
+ // Create a float type of the same size as the source or destination.
+ const llvm::VectorType *newSrcTy = llvm::VectorType::get(dstElemTy,
+ numElementsSrc);
+
+ Src = Builder.CreateBitCast(Src, newSrcTy, "astypeCast");
+ }
+
+ llvm::Value *UnV = llvm::UndefValue::get(Src->getType());
+
+ llvm::SmallVector<llvm::Constant*, 3> Args;
+ Args.push_back(Builder.getInt32(0));
+ Args.push_back(Builder.getInt32(1));
+ Args.push_back(Builder.getInt32(2));
+
+ if (numElementsDst == 4)
+ Args.push_back(llvm::UndefValue::get(
+ llvm::Type::getInt32Ty(CGF.getLLVMContext())));
+
+ llvm::Constant *Mask = llvm::ConstantVector::get(Args);
+
+ return Builder.CreateShuffleVector(Src, UnV, Mask, "astype");
+ }
+ }
+
+ return Builder.CreateBitCast(Src, DstTy, "astype");
+}
+
//===----------------------------------------------------------------------===//
// Entry Point into this File
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp
index 5b0d41e..fa42cd1 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp
@@ -47,6 +47,23 @@ llvm::Value *CodeGenFunction::EmitObjCProtocolExpr(const ObjCProtocolExpr *E) {
return CGM.getObjCRuntime().GenerateProtocolRef(Builder, E->getProtocol());
}
+/// \brief Adjust the type of the result of an Objective-C message send
+/// expression when the method has a related result type.
+static RValue AdjustRelatedResultType(CodeGenFunction &CGF,
+ const Expr *E,
+ const ObjCMethodDecl *Method,
+ RValue Result) {
+ if (!Method)
+ return Result;
+ if (!Method->hasRelatedResultType() ||
+ CGF.getContext().hasSameType(E->getType(), Method->getResultType()) ||
+ !Result.isScalar())
+ return Result;
+
+ // We have applied a related result type. Cast the rvalue appropriately.
+ return RValue::get(CGF.Builder.CreateBitCast(Result.getScalarVal(),
+ CGF.ConvertType(E->getType())));
+}
RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E,
ReturnValueSlot Return) {
@@ -59,15 +76,17 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E,
bool isClassMessage = false;
ObjCInterfaceDecl *OID = 0;
// Find the receiver
+ QualType ReceiverType;
llvm::Value *Receiver = 0;
switch (E->getReceiverKind()) {
case ObjCMessageExpr::Instance:
Receiver = EmitScalarExpr(E->getInstanceReceiver());
+ ReceiverType = E->getInstanceReceiver()->getType();
break;
case ObjCMessageExpr::Class: {
- const ObjCObjectType *ObjTy
- = E->getClassReceiver()->getAs<ObjCObjectType>();
+ ReceiverType = E->getClassReceiver();
+ const ObjCObjectType *ObjTy = ReceiverType->getAs<ObjCObjectType>();
assert(ObjTy && "Invalid Objective-C class message send");
OID = ObjTy->getInterface();
assert(OID && "Invalid Objective-C class message send");
@@ -77,11 +96,13 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E,
}
case ObjCMessageExpr::SuperInstance:
+ ReceiverType = E->getSuperType();
Receiver = LoadObjCSelf();
isSuperMessage = true;
break;
case ObjCMessageExpr::SuperClass:
+ ReceiverType = E->getSuperType();
Receiver = LoadObjCSelf();
isSuperMessage = true;
isClassMessage = true;
@@ -94,31 +115,35 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E,
QualType ResultType =
E->getMethodDecl() ? E->getMethodDecl()->getResultType() : E->getType();
+ RValue result;
if (isSuperMessage) {
// super is only valid in an Objective-C method
const ObjCMethodDecl *OMD = cast<ObjCMethodDecl>(CurFuncDecl);
bool isCategoryImpl = isa<ObjCCategoryImplDecl>(OMD->getDeclContext());
- return Runtime.GenerateMessageSendSuper(*this, Return, ResultType,
- E->getSelector(),
- OMD->getClassInterface(),
- isCategoryImpl,
- Receiver,
- isClassMessage,
- Args,
- E->getMethodDecl());
+ result = Runtime.GenerateMessageSendSuper(*this, Return, ResultType,
+ E->getSelector(),
+ OMD->getClassInterface(),
+ isCategoryImpl,
+ Receiver,
+ isClassMessage,
+ Args,
+ E->getMethodDecl());
+ } else {
+ result = Runtime.GenerateMessageSend(*this, Return, ResultType,
+ E->getSelector(),
+ Receiver, Args, OID,
+ E->getMethodDecl());
}
-
- return Runtime.GenerateMessageSend(*this, Return, ResultType,
- E->getSelector(),
- Receiver, Args, OID,
- E->getMethodDecl());
+
+ return AdjustRelatedResultType(*this, E, E->getMethodDecl(), result);
}
/// StartObjCMethod - Begin emission of an ObjCMethod. This generates
/// the LLVM function and sets the other context used by
/// CodeGenFunction.
void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD,
- const ObjCContainerDecl *CD) {
+ const ObjCContainerDecl *CD,
+ SourceLocation StartLoc) {
FunctionArgList args;
// Check if we should generate debug info for this method.
if (CGM.getModuleDebugInfo() && !OMD->hasAttr<NoDebugAttr>())
@@ -138,7 +163,7 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD,
CurGD = OMD;
- StartFunction(OMD, OMD->getResultType(), Fn, FI, args, OMD->getLocStart());
+ StartFunction(OMD, OMD->getResultType(), Fn, FI, args, StartLoc);
}
void CodeGenFunction::GenerateObjCGetterBody(ObjCIvarDecl *Ivar,
@@ -151,16 +176,14 @@ void CodeGenFunction::GenerateObjCGetterBody(ObjCIvarDecl *Ivar,
// objc_copyStruct (ReturnValue, &structIvar,
// sizeof (Type of Ivar), isAtomic, false);
CallArgList Args;
- RValue RV = RValue::get(Builder.CreateBitCast(ReturnValue,
- Types.ConvertType(getContext().VoidPtrTy)));
+ RValue RV = RValue::get(Builder.CreateBitCast(ReturnValue, VoidPtrTy));
Args.add(RV, getContext().VoidPtrTy);
- RV = RValue::get(Builder.CreateBitCast(LV.getAddress(),
- Types.ConvertType(getContext().VoidPtrTy)));
+ RV = RValue::get(Builder.CreateBitCast(LV.getAddress(), VoidPtrTy));
Args.add(RV, getContext().VoidPtrTy);
// sizeof (Type of Ivar)
CharUnits Size = getContext().getTypeSizeInChars(Ivar->getType());
llvm::Value *SizeVal =
- llvm::ConstantInt::get(Types.ConvertType(getContext().LongTy),
+ llvm::ConstantInt::get(Types.ConvertType(getContext().LongTy),
Size.getQuantity());
Args.add(RValue::get(SizeVal), getContext().LongTy);
llvm::Value *isAtomic =
@@ -179,7 +202,7 @@ void CodeGenFunction::GenerateObjCGetterBody(ObjCIvarDecl *Ivar,
/// Generate an Objective-C method. An Objective-C method is a C function with
/// its pointer, name, and types registered in the class struture.
void CodeGenFunction::GenerateObjCMethod(const ObjCMethodDecl *OMD) {
- StartObjCMethod(OMD, OMD->getClassInterface());
+ StartObjCMethod(OMD, OMD->getClassInterface(), OMD->getLocStart());
EmitStmt(OMD->getBody());
FinishFunction(OMD->getBodyRBrace());
}
@@ -199,7 +222,7 @@ void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP,
!(PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_nonatomic);
ObjCMethodDecl *OMD = PD->getGetterMethodDecl();
assert(OMD && "Invalid call to generate getter (empty method)");
- StartObjCMethod(OMD, IMP->getClassInterface());
+ StartObjCMethod(OMD, IMP->getClassInterface(), PID->getLocStart());
// Determine if we should use an objc_getProperty call for
// this. Non-atomic properties are directly evaluated.
@@ -292,7 +315,7 @@ void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP,
const CXXRecordDecl *classDecl = IVART->getAsCXXRecordDecl();
if (PID->getGetterCXXConstructor() &&
- classDecl && !classDecl->hasTrivialConstructor()) {
+ classDecl && !classDecl->hasTrivialDefaultConstructor()) {
ReturnStmt *Stmt =
new (getContext()) ReturnStmt(SourceLocation(),
PID->getGetterCXXConstructor(),
@@ -398,7 +421,7 @@ void CodeGenFunction::GenerateObjCSetter(ObjCImplementationDecl *IMP,
const ObjCPropertyDecl *PD = PID->getPropertyDecl();
ObjCMethodDecl *OMD = PD->getSetterMethodDecl();
assert(OMD && "Invalid call to generate setter (empty method)");
- StartObjCMethod(OMD, IMP->getClassInterface());
+ StartObjCMethod(OMD, IMP->getClassInterface(), PID->getLocStart());
const llvm::Triple &Triple = getContext().Target.getTriple();
QualType IVART = Ivar->getType();
bool IsCopy = PD->getSetterKind() == ObjCPropertyDecl::Copy;
@@ -496,7 +519,7 @@ void CodeGenFunction::GenerateObjCSetter(ObjCImplementationDecl *IMP,
}
else {
// FIXME: Find a clean way to avoid AST node creation.
- SourceLocation Loc = PD->getLocation();
+ SourceLocation Loc = PID->getLocStart();
ValueDecl *Self = OMD->getSelfDecl();
ObjCIvarDecl *Ivar = PID->getPropertyIvarDecl();
DeclRefExpr Base(Self, Self->getType(), VK_RValue, Loc);
@@ -618,7 +641,7 @@ void CodeGenFunction::GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP,
ObjCMethodDecl *MD,
bool ctor) {
MD->createImplicitParams(CGM.getContext(), IMP->getClassInterface());
- StartObjCMethod(MD, IMP->getClassInterface());
+ StartObjCMethod(MD, IMP->getClassInterface(), MD->getLocStart());
// Emit .cxx_construct.
if (ctor) {
@@ -712,26 +735,31 @@ RValue CodeGenFunction::EmitLoadOfPropertyRefLValue(LValue LV,
const ObjCPropertyRefExpr *E = LV.getPropertyRefExpr();
QualType ResultType = E->getGetterResultType();
Selector S;
+ const ObjCMethodDecl *method;
if (E->isExplicitProperty()) {
const ObjCPropertyDecl *Property = E->getExplicitProperty();
S = Property->getGetterName();
+ method = Property->getGetterMethodDecl();
} else {
- const ObjCMethodDecl *Getter = E->getImplicitPropertyGetter();
- S = Getter->getSelector();
+ method = E->getImplicitPropertyGetter();
+ S = method->getSelector();
}
llvm::Value *Receiver = LV.getPropertyRefBaseAddr();
// Accesses to 'super' follow a different code path.
if (E->isSuperReceiver())
- return GenerateMessageSendSuper(*this, Return, ResultType,
- S, Receiver, CallArgList());
-
+ return AdjustRelatedResultType(*this, E, method,
+ GenerateMessageSendSuper(*this, Return,
+ ResultType,
+ S, Receiver,
+ CallArgList()));
const ObjCInterfaceDecl *ReceiverClass
= (E->isClassReceiver() ? E->getClassReceiver() : 0);
- return CGM.getObjCRuntime().
- GenerateMessageSend(*this, Return, ResultType, S,
- Receiver, CallArgList(), ReceiverClass);
+ return AdjustRelatedResultType(*this, E, method,
+ CGM.getObjCRuntime().
+ GenerateMessageSend(*this, Return, ResultType, S,
+ Receiver, CallArgList(), ReceiverClass));
}
void CodeGenFunction::EmitStoreThroughPropertyRefLValue(RValue Src,
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp
index c4dc4c4..f0993c5 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -52,7 +52,7 @@ class LazyRuntimeFunction {
CodeGenModule *CGM;
std::vector<const llvm::Type*> ArgTys;
const char *FunctionName;
- llvm::Function *Function;
+ llvm::Constant *Function;
public:
/// Constructor leaves this class uninitialized, because it is intended to
/// be used as a field in another class and not all of the types that are
@@ -78,7 +78,7 @@ class LazyRuntimeFunction {
}
/// Overloaded cast operator, allows the class to be implicitly cast to an
/// LLVM constant.
- operator llvm::Function*() {
+ operator llvm::Constant*() {
if (!Function) {
if (0 == FunctionName) return 0;
// We put the return type on the end of the vector, so pop it back off
@@ -86,13 +86,17 @@ class LazyRuntimeFunction {
ArgTys.pop_back();
llvm::FunctionType *FTy = llvm::FunctionType::get(RetTy, ArgTys, false);
Function =
- cast<llvm::Function>(CGM->CreateRuntimeFunction(FTy, FunctionName));
+ cast<llvm::Constant>(CGM->CreateRuntimeFunction(FTy, FunctionName));
// We won't need to use the types again, so we may as well clean up the
// vector now
ArgTys.resize(0);
}
return Function;
}
+ operator llvm::Function*() {
+ return cast<llvm::Function>((llvm::Constant*)*this);
+ }
+
};
@@ -314,7 +318,7 @@ private:
/// The version of the runtime that this class targets. Must match the
/// version in the runtime.
- const int RuntimeVersion;
+ int RuntimeVersion;
/// The version of the protocol class. Used to differentiate between ObjC1
/// and ObjC2 protocols. Objective-C 1 protocols can not contain optional
/// components and can not contain declared properties. We always emit
@@ -444,10 +448,10 @@ public:
const ObjCProtocolDecl *PD);
virtual void GenerateProtocol(const ObjCProtocolDecl *PD);
virtual llvm::Function *ModuleInitFunction();
- virtual llvm::Function *GetPropertyGetFunction();
- virtual llvm::Function *GetPropertySetFunction();
- virtual llvm::Function *GetSetStructFunction();
- virtual llvm::Function *GetGetStructFunction();
+ virtual llvm::Constant *GetPropertyGetFunction();
+ virtual llvm::Constant *GetPropertySetFunction();
+ virtual llvm::Constant *GetSetStructFunction();
+ virtual llvm::Constant *GetGetStructFunction();
virtual llvm::Constant *EnumerationMutationFunction();
virtual void EmitTryStmt(CodeGenFunction &CGF,
@@ -484,6 +488,10 @@ public:
const CGBlockInfo &blockInfo) {
return NULLPtr;
}
+
+ virtual llvm::GlobalVariable *GetClassGlobal(const std::string &Name) {
+ return 0;
+ }
};
/// Class representing the legacy GCC Objective-C ABI. This is the default when
/// -fobjc-nonfragile-abi is not specified.
@@ -654,7 +662,6 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
: CGM(cgm), TheModule(CGM.getModule()), VMContext(cgm.getLLVMContext()),
ClassPtrAlias(0), MetaClassPtrAlias(0), RuntimeVersion(runtimeABIVersion),
ProtocolVersion(protocolClassVersion) {
-
msgSendMDKind = VMContext.getMDKindID("GNUObjCMessageSend");
@@ -729,14 +736,16 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
PtrDiffTy, BoolTy, BoolTy, NULL);
// IMP type
- std::vector<const llvm::Type*> IMPArgs;
- IMPArgs.push_back(IdTy);
- IMPArgs.push_back(SelectorTy);
+ const llvm::Type *IMPArgs[] = { IdTy, SelectorTy };
IMPTy = llvm::PointerType::getUnqual(llvm::FunctionType::get(IdTy, IMPArgs,
true));
// Don't bother initialising the GC stuff unless we're compiling in GC mode
if (CGM.getLangOptions().getGCMode() != LangOptions::NonGC) {
+ // This is a bit of an hack. We should sort this out by having a proper
+ // CGObjCGNUstep subclass for GC, but we may want to really support the old
+ // ABI and GC added in ObjectiveC2.framework, so we fudge it a bit for now
+ RuntimeVersion = 10;
// Get selectors needed in GC mode
RetainSel = GetNullarySelector("retain", CGM.getContext());
ReleaseSel = GetNullarySelector("release", CGM.getContext());
@@ -775,11 +784,8 @@ llvm::Value *CGObjCGNU::GetClass(CGBuilderTy &Builder,
EmitClassRef(OID->getNameAsString());
ClassName = Builder.CreateStructGEP(ClassName, 0);
- std::vector<const llvm::Type*> Params(1, PtrToInt8Ty);
llvm::Constant *ClassLookupFn =
- CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy,
- Params,
- true),
+ CGM.CreateRuntimeFunction(llvm::FunctionType::get(IdTy, PtrToInt8Ty, true),
"objc_lookup_class");
return Builder.CreateCall(ClassLookupFn, ClassName);
}
@@ -945,16 +951,17 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGenFunction &CGF,
bool IsClassMessage,
const CallArgList &CallArgs,
const ObjCMethodDecl *Method) {
- if (CGM.getLangOptions().getGCMode() != LangOptions::NonGC) {
+ CGBuilderTy &Builder = CGF.Builder;
+ if (CGM.getLangOptions().getGCMode() == LangOptions::GCOnly) {
if (Sel == RetainSel || Sel == AutoreleaseSel) {
- return RValue::get(Receiver);
+ return RValue::get(EnforceType(Builder, Receiver,
+ CGM.getTypes().ConvertType(ResultType)));
}
if (Sel == ReleaseSel) {
return RValue::get(0);
}
}
- CGBuilderTy &Builder = CGF.Builder;
llvm::Value *cmd = GetSelector(Builder, Sel);
@@ -971,14 +978,12 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGenFunction &CGF,
llvm::Value *ReceiverClass = 0;
if (isCategoryImpl) {
llvm::Constant *classLookupFunction = 0;
- std::vector<const llvm::Type*> Params;
- Params.push_back(PtrTy);
if (IsClassMessage) {
classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
- IdTy, Params, true), "objc_get_meta_class");
+ IdTy, PtrTy, true), "objc_get_meta_class");
} else {
classLookupFunction = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
- IdTy, Params, true), "objc_get_class");
+ IdTy, PtrTy, true), "objc_get_class");
}
ReceiverClass = Builder.CreateCall(classLookupFunction,
MakeConstantString(Class->getNameAsString()));
@@ -1052,18 +1057,19 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF,
const CallArgList &CallArgs,
const ObjCInterfaceDecl *Class,
const ObjCMethodDecl *Method) {
+ CGBuilderTy &Builder = CGF.Builder;
+
// Strip out message sends to retain / release in GC mode
- if (CGM.getLangOptions().getGCMode() != LangOptions::NonGC) {
+ if (CGM.getLangOptions().getGCMode() == LangOptions::GCOnly) {
if (Sel == RetainSel || Sel == AutoreleaseSel) {
- return RValue::get(Receiver);
+ return RValue::get(EnforceType(Builder, Receiver,
+ CGM.getTypes().ConvertType(ResultType)));
}
if (Sel == ReleaseSel) {
return RValue::get(0);
}
}
- CGBuilderTy &Builder = CGF.Builder;
-
// If the return type is something that goes in an integer register, the
// runtime will handle 0 returns. For other cases, we fill in the 0 value
// ourselves.
@@ -2127,7 +2133,9 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
// The symbol table is contained in a module which has some version-checking
// constants
llvm::StructType * ModuleTy = llvm::StructType::get(VMContext, LongTy, LongTy,
- PtrToInt8Ty, llvm::PointerType::getUnqual(SymTabTy), NULL);
+ PtrToInt8Ty, llvm::PointerType::getUnqual(SymTabTy),
+ (CGM.getLangOptions().getGCMode() == LangOptions::NonGC) ? NULL : IntTy,
+ NULL);
Elements.clear();
// Runtime version, used for ABI compatibility checking.
Elements.push_back(llvm::ConstantInt::get(LongTy, RuntimeVersion));
@@ -2144,8 +2152,17 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
std::string path =
std::string(mainFile->getDir()->getName()) + '/' + mainFile->getName();
Elements.push_back(MakeConstantString(path, ".objc_source_file_name"));
-
Elements.push_back(SymTab);
+
+ switch (CGM.getLangOptions().getGCMode()) {
+ case LangOptions::GCOnly:
+ Elements.push_back(llvm::ConstantInt::get(IntTy, 2));
+ case LangOptions::NonGC:
+ break;
+ case LangOptions::HybridGC:
+ Elements.push_back(llvm::ConstantInt::get(IntTy, 1));
+ }
+
llvm::Value *Module = MakeGlobal(ModuleTy, Elements);
// Create the load function calling the runtime entry point with the module
@@ -2159,10 +2176,10 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
CGBuilderTy Builder(VMContext);
Builder.SetInsertPoint(EntryBB);
- std::vector<const llvm::Type*> Params(1,
- llvm::PointerType::getUnqual(ModuleTy));
- llvm::Value *Register = CGM.CreateRuntimeFunction(llvm::FunctionType::get(
- llvm::Type::getVoidTy(VMContext), Params, true), "__objc_exec_class");
+ llvm::FunctionType *FT =
+ llvm::FunctionType::get(Builder.getVoidTy(),
+ llvm::PointerType::getUnqual(ModuleTy), true);
+ llvm::Value *Register = CGM.CreateRuntimeFunction(FT, "__objc_exec_class");
Builder.CreateCall(Register, Module);
Builder.CreateRetVoid();
@@ -2192,18 +2209,18 @@ llvm::Function *CGObjCGNU::GenerateMethod(const ObjCMethodDecl *OMD,
return Method;
}
-llvm::Function *CGObjCGNU::GetPropertyGetFunction() {
+llvm::Constant *CGObjCGNU::GetPropertyGetFunction() {
return GetPropertyFn;
}
-llvm::Function *CGObjCGNU::GetPropertySetFunction() {
+llvm::Constant *CGObjCGNU::GetPropertySetFunction() {
return SetPropertyFn;
}
-llvm::Function *CGObjCGNU::GetGetStructFunction() {
+llvm::Constant *CGObjCGNU::GetGetStructFunction() {
return GetStructPropertyFn;
}
-llvm::Function *CGObjCGNU::GetSetStructFunction() {
+llvm::Constant *CGObjCGNU::GetSetStructFunction() {
return SetStructPropertyFn;
}
@@ -2273,7 +2290,7 @@ void CGObjCGNU::EmitThrowStmt(CodeGenFunction &CGF,
llvm::Value * CGObjCGNU::EmitObjCWeakRead(CodeGenFunction &CGF,
llvm::Value *AddrWeakObj) {
CGBuilderTy B = CGF.Builder;
- AddrWeakObj = EnforceType(B, AddrWeakObj, IdTy);
+ AddrWeakObj = EnforceType(B, AddrWeakObj, PtrToIdTy);
return B.CreateCall(WeakReadFn, AddrWeakObj);
}
@@ -2303,7 +2320,7 @@ void CGObjCGNU::EmitObjCIvarAssign(CodeGenFunction &CGF,
llvm::Value *ivarOffset) {
CGBuilderTy B = CGF.Builder;
src = EnforceType(B, src, IdTy);
- dst = EnforceType(B, dst, PtrToIdTy);
+ dst = EnforceType(B, dst, IdTy);
B.CreateCall3(IvarAssignFn, src, dst, ivarOffset);
}
@@ -2320,8 +2337,8 @@ void CGObjCGNU::EmitGCMemmoveCollectable(CodeGenFunction &CGF,
llvm::Value *SrcPtr,
llvm::Value *Size) {
CGBuilderTy B = CGF.Builder;
- DestPtr = EnforceType(B, DestPtr, IdTy);
- SrcPtr = EnforceType(B, SrcPtr, PtrToIdTy);
+ DestPtr = EnforceType(B, DestPtr, PtrTy);
+ SrcPtr = EnforceType(B, SrcPtr, PtrTy);
B.CreateCall3(MemMoveFn, DestPtr, SrcPtr, Size);
}
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp
index 2b1cfe3..8c3e9a3 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp
@@ -43,18 +43,6 @@ using namespace clang;
using namespace CodeGen;
-static void EmitNullReturnInitialization(CodeGenFunction &CGF,
- ReturnValueSlot &returnSlot,
- QualType resultType) {
- // Force the return slot to exist.
- if (!returnSlot.getValue())
- returnSlot = ReturnValueSlot(CGF.CreateMemTemp(resultType), false);
- CGF.EmitNullInitialization(returnSlot.getValue(), resultType);
-}
-
-
-///
-
namespace {
typedef std::vector<llvm::Constant*> ConstantVector;
@@ -67,89 +55,89 @@ protected:
llvm::LLVMContext &VMContext;
private:
+ // The types of these functions don't really matter because we
+ // should always bitcast before calling them.
+
+ /// id objc_msgSend (id, SEL, ...)
+ ///
+ /// The default messenger, used for sends whose ABI is unchanged from
+ /// the all-integer/pointer case.
llvm::Constant *getMessageSendFn() const {
- // id objc_msgSend (id, SEL, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(ObjectPtrTy);
- Params.push_back(SelectorPtrTy);
- return
- CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, true),
- "objc_msgSend");
+ const llvm::Type *params[] = { ObjectPtrTy, SelectorPtrTy };
+ return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
+ params, true),
+ "objc_msgSend");
}
+ /// void objc_msgSend_stret (id, SEL, ...)
+ ///
+ /// The messenger used when the return value is an aggregate returned
+ /// by indirect reference in the first argument, and therefore the
+ /// self and selector parameters are shifted over by one.
llvm::Constant *getMessageSendStretFn() const {
- // id objc_msgSend_stret (id, SEL, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(ObjectPtrTy);
- Params.push_back(SelectorPtrTy);
- return
- CGM.CreateRuntimeFunction(llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext),
- Params, true),
- "objc_msgSend_stret");
+ const llvm::Type *params[] = { ObjectPtrTy, SelectorPtrTy };
+ return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.VoidTy,
+ params, true),
+ "objc_msgSend_stret");
}
+ /// [double | long double] objc_msgSend_fpret(id self, SEL op, ...)
+ ///
+ /// The messenger used when the return value is returned on the x87
+ /// floating-point stack; without a special entrypoint, the nil case
+ /// would be unbalanced.
llvm::Constant *getMessageSendFpretFn() const {
- // FIXME: This should be long double on x86_64?
- // [double | long double] objc_msgSend_fpret(id self, SEL op, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(ObjectPtrTy);
- Params.push_back(SelectorPtrTy);
- return
- CGM.CreateRuntimeFunction(llvm::FunctionType::get(
+ const llvm::Type *params[] = { ObjectPtrTy, SelectorPtrTy };
+ return CGM.CreateRuntimeFunction(llvm::FunctionType::get(
llvm::Type::getDoubleTy(VMContext),
- Params,
- true),
- "objc_msgSend_fpret");
+ params, true),
+ "objc_msgSend_fpret");
}
+ /// id objc_msgSendSuper(struct objc_super *super, SEL op, ...)
+ ///
+ /// The messenger used for super calls, which have different dispatch
+ /// semantics. The class passed is the superclass of the current
+ /// class.
llvm::Constant *getMessageSendSuperFn() const {
- // id objc_msgSendSuper(struct objc_super *super, SEL op, ...)
- const char *SuperName = "objc_msgSendSuper";
- std::vector<const llvm::Type*> Params;
- Params.push_back(SuperPtrTy);
- Params.push_back(SelectorPtrTy);
+ const llvm::Type *params[] = { SuperPtrTy, SelectorPtrTy };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, true),
- SuperName);
+ params, true),
+ "objc_msgSendSuper");
}
+ /// id objc_msgSendSuper2(struct objc_super *super, SEL op, ...)
+ ///
+ /// A slightly different messenger used for super calls. The class
+ /// passed is the current class.
llvm::Constant *getMessageSendSuperFn2() const {
- // id objc_msgSendSuper2(struct objc_super *super, SEL op, ...)
- const char *SuperName = "objc_msgSendSuper2";
- std::vector<const llvm::Type*> Params;
- Params.push_back(SuperPtrTy);
- Params.push_back(SelectorPtrTy);
+ const llvm::Type *params[] = { SuperPtrTy, SelectorPtrTy };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, true),
- SuperName);
+ params, true),
+ "objc_msgSendSuper2");
}
+ /// void objc_msgSendSuper_stret(void *stretAddr, struct objc_super *super,
+ /// SEL op, ...)
+ ///
+ /// The messenger used for super calls which return an aggregate indirectly.
llvm::Constant *getMessageSendSuperStretFn() const {
- // void objc_msgSendSuper_stret(void * stretAddr, struct objc_super *super,
- // SEL op, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(Int8PtrTy);
- Params.push_back(SuperPtrTy);
- Params.push_back(SelectorPtrTy);
+ const llvm::Type *params[] = { Int8PtrTy, SuperPtrTy, SelectorPtrTy };
return CGM.CreateRuntimeFunction(
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext),
- Params, true),
+ llvm::FunctionType::get(CGM.VoidTy, params, true),
"objc_msgSendSuper_stret");
}
+ /// void objc_msgSendSuper2_stret(void * stretAddr, struct objc_super *super,
+ /// SEL op, ...)
+ ///
+ /// objc_msgSendSuper_stret with the super2 semantics.
llvm::Constant *getMessageSendSuperStretFn2() const {
- // void objc_msgSendSuper2_stret(void * stretAddr, struct objc_super *super,
- // SEL op, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(Int8PtrTy);
- Params.push_back(SuperPtrTy);
- Params.push_back(SelectorPtrTy);
+ const llvm::Type *params[] = { Int8PtrTy, SuperPtrTy, SelectorPtrTy };
return CGM.CreateRuntimeFunction(
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext),
- Params, true),
+ llvm::FunctionType::get(CGM.VoidTy, params, true),
"objc_msgSendSuper2_stret");
}
@@ -282,107 +270,97 @@ public:
/// GcReadWeakFn -- LLVM objc_read_weak (id *src) function.
llvm::Constant *getGcReadWeakFn() {
// id objc_read_weak (id *)
- std::vector<const llvm::Type*> Args;
- Args.push_back(ObjectPtrTy->getPointerTo());
+ const llvm::Type *args[] = { ObjectPtrTy->getPointerTo() };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(ObjectPtrTy, Args, false);
+ llvm::FunctionType::get(ObjectPtrTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_read_weak");
}
/// GcAssignWeakFn -- LLVM objc_assign_weak function.
llvm::Constant *getGcAssignWeakFn() {
// id objc_assign_weak (id, id *)
- std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
- Args.push_back(ObjectPtrTy->getPointerTo());
+ const llvm::Type *args[] = { ObjectPtrTy, ObjectPtrTy->getPointerTo() };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(ObjectPtrTy, Args, false);
+ llvm::FunctionType::get(ObjectPtrTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_assign_weak");
}
/// GcAssignGlobalFn -- LLVM objc_assign_global function.
llvm::Constant *getGcAssignGlobalFn() {
// id objc_assign_global(id, id *)
- std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
- Args.push_back(ObjectPtrTy->getPointerTo());
+ const llvm::Type *args[] = { ObjectPtrTy, ObjectPtrTy->getPointerTo() };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(ObjectPtrTy, Args, false);
+ llvm::FunctionType::get(ObjectPtrTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_assign_global");
}
/// GcAssignThreadLocalFn -- LLVM objc_assign_threadlocal function.
llvm::Constant *getGcAssignThreadLocalFn() {
// id objc_assign_threadlocal(id src, id * dest)
- std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
- Args.push_back(ObjectPtrTy->getPointerTo());
+ const llvm::Type *args[] = { ObjectPtrTy, ObjectPtrTy->getPointerTo() };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(ObjectPtrTy, Args, false);
+ llvm::FunctionType::get(ObjectPtrTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_assign_threadlocal");
}
/// GcAssignIvarFn -- LLVM objc_assign_ivar function.
llvm::Constant *getGcAssignIvarFn() {
// id objc_assign_ivar(id, id *, ptrdiff_t)
- std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
- Args.push_back(ObjectPtrTy->getPointerTo());
- Args.push_back(LongTy);
+ const llvm::Type *args[] = { ObjectPtrTy, ObjectPtrTy->getPointerTo(),
+ CGM.PtrDiffTy };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(ObjectPtrTy, Args, false);
+ llvm::FunctionType::get(ObjectPtrTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_assign_ivar");
}
/// GcMemmoveCollectableFn -- LLVM objc_memmove_collectable function.
llvm::Constant *GcMemmoveCollectableFn() {
// void *objc_memmove_collectable(void *dst, const void *src, size_t size)
- std::vector<const llvm::Type*> Args(1, Int8PtrTy);
- Args.push_back(Int8PtrTy);
- Args.push_back(LongTy);
- llvm::FunctionType *FTy = llvm::FunctionType::get(Int8PtrTy, Args, false);
+ const llvm::Type *args[] = { Int8PtrTy, Int8PtrTy, LongTy };
+ llvm::FunctionType *FTy = llvm::FunctionType::get(Int8PtrTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_memmove_collectable");
}
/// GcAssignStrongCastFn -- LLVM objc_assign_strongCast function.
llvm::Constant *getGcAssignStrongCastFn() {
// id objc_assign_strongCast(id, id *)
- std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
- Args.push_back(ObjectPtrTy->getPointerTo());
+ const llvm::Type *args[] = { ObjectPtrTy, ObjectPtrTy->getPointerTo() };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(ObjectPtrTy, Args, false);
+ llvm::FunctionType::get(ObjectPtrTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_assign_strongCast");
}
/// ExceptionThrowFn - LLVM objc_exception_throw function.
llvm::Constant *getExceptionThrowFn() {
// void objc_exception_throw(id)
- std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
+ const llvm::Type *args[] = { ObjectPtrTy };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext), Args, false);
+ llvm::FunctionType::get(CGM.VoidTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_exception_throw");
}
/// ExceptionRethrowFn - LLVM objc_exception_rethrow function.
llvm::Constant *getExceptionRethrowFn() {
// void objc_exception_rethrow(void)
- std::vector<const llvm::Type*> Args;
- llvm::FunctionType *FTy =
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext), Args, false);
+ llvm::FunctionType *FTy = llvm::FunctionType::get(CGM.VoidTy, false);
return CGM.CreateRuntimeFunction(FTy, "objc_exception_rethrow");
}
/// SyncEnterFn - LLVM object_sync_enter function.
llvm::Constant *getSyncEnterFn() {
// void objc_sync_enter (id)
- std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
+ const llvm::Type *args[] = { ObjectPtrTy };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext), Args, false);
+ llvm::FunctionType::get(CGM.VoidTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_sync_enter");
}
/// SyncExitFn - LLVM object_sync_exit function.
llvm::Constant *getSyncExitFn() {
// void objc_sync_exit (id)
- std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
+ const llvm::Type *args[] = { ObjectPtrTy };
llvm::FunctionType *FTy =
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext), Args, false);
+ llvm::FunctionType::get(CGM.VoidTy, args, false);
return CGM.CreateRuntimeFunction(FTy, "objc_sync_exit");
}
@@ -474,55 +452,44 @@ public:
/// ExceptionTryEnterFn - LLVM objc_exception_try_enter function.
llvm::Constant *getExceptionTryEnterFn() {
- std::vector<const llvm::Type*> Params;
- Params.push_back(llvm::PointerType::getUnqual(ExceptionDataTy));
+ const llvm::Type *params[] = { ExceptionDataTy->getPointerTo() };
return CGM.CreateRuntimeFunction(
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext),
- Params, false),
+ llvm::FunctionType::get(CGM.VoidTy, params, false),
"objc_exception_try_enter");
}
/// ExceptionTryExitFn - LLVM objc_exception_try_exit function.
llvm::Constant *getExceptionTryExitFn() {
- std::vector<const llvm::Type*> Params;
- Params.push_back(llvm::PointerType::getUnqual(ExceptionDataTy));
+ const llvm::Type *params[] = { ExceptionDataTy->getPointerTo() };
return CGM.CreateRuntimeFunction(
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext),
- Params, false),
+ llvm::FunctionType::get(CGM.VoidTy, params, false),
"objc_exception_try_exit");
}
/// ExceptionExtractFn - LLVM objc_exception_extract function.
llvm::Constant *getExceptionExtractFn() {
- std::vector<const llvm::Type*> Params;
- Params.push_back(llvm::PointerType::getUnqual(ExceptionDataTy));
+ const llvm::Type *params[] = { ExceptionDataTy->getPointerTo() };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, false),
+ params, false),
"objc_exception_extract");
-
}
/// ExceptionMatchFn - LLVM objc_exception_match function.
llvm::Constant *getExceptionMatchFn() {
- std::vector<const llvm::Type*> Params;
- Params.push_back(ClassPtrTy);
- Params.push_back(ObjectPtrTy);
+ const llvm::Type *params[] = { ClassPtrTy, ObjectPtrTy };
return CGM.CreateRuntimeFunction(
- llvm::FunctionType::get(llvm::Type::getInt32Ty(VMContext),
- Params, false),
+ llvm::FunctionType::get(CGM.Int32Ty, params, false),
"objc_exception_match");
}
/// SetJmpFn - LLVM _setjmp function.
llvm::Constant *getSetJmpFn() {
- std::vector<const llvm::Type*> Params;
- Params.push_back(llvm::Type::getInt32PtrTy(VMContext));
- return
- CGM.CreateRuntimeFunction(llvm::FunctionType::get(llvm::Type::getInt32Ty(VMContext),
- Params, false),
- "_setjmp");
-
+ // This is specifically the prototype for x86.
+ const llvm::Type *params[] = { CGM.Int32Ty->getPointerTo() };
+ return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty,
+ params, false),
+ "_setjmp");
}
public:
@@ -608,68 +575,56 @@ public:
llvm::Constant *getMessageSendFixupFn() {
// id objc_msgSend_fixup(id, struct message_ref_t*, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(ObjectPtrTy);
- Params.push_back(MessageRefPtrTy);
+ const llvm::Type *params[] = { ObjectPtrTy, MessageRefPtrTy };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, true),
+ params, true),
"objc_msgSend_fixup");
}
llvm::Constant *getMessageSendFpretFixupFn() {
// id objc_msgSend_fpret_fixup(id, struct message_ref_t*, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(ObjectPtrTy);
- Params.push_back(MessageRefPtrTy);
+ const llvm::Type *params[] = { ObjectPtrTy, MessageRefPtrTy };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, true),
+ params, true),
"objc_msgSend_fpret_fixup");
}
llvm::Constant *getMessageSendStretFixupFn() {
// id objc_msgSend_stret_fixup(id, struct message_ref_t*, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(ObjectPtrTy);
- Params.push_back(MessageRefPtrTy);
+ const llvm::Type *params[] = { ObjectPtrTy, MessageRefPtrTy };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, true),
+ params, true),
"objc_msgSend_stret_fixup");
}
llvm::Constant *getMessageSendSuper2FixupFn() {
// id objc_msgSendSuper2_fixup (struct objc_super *,
// struct _super_message_ref_t*, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(SuperPtrTy);
- Params.push_back(SuperMessageRefPtrTy);
+ const llvm::Type *params[] = { SuperPtrTy, SuperMessageRefPtrTy };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, true),
+ params, true),
"objc_msgSendSuper2_fixup");
}
llvm::Constant *getMessageSendSuper2StretFixupFn() {
// id objc_msgSendSuper2_stret_fixup(struct objc_super *,
// struct _super_message_ref_t*, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(SuperPtrTy);
- Params.push_back(SuperMessageRefPtrTy);
+ const llvm::Type *params[] = { SuperPtrTy, SuperMessageRefPtrTy };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
- Params, true),
+ params, true),
"objc_msgSendSuper2_stret_fixup");
}
llvm::Constant *getObjCEndCatchFn() {
- return CGM.CreateRuntimeFunction(llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext),
- false),
+ return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.VoidTy, false),
"objc_end_catch");
}
llvm::Constant *getObjCBeginCatchFn() {
- std::vector<const llvm::Type*> Params;
- Params.push_back(Int8PtrTy);
+ const llvm::Type *params[] = { Int8PtrTy };
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(Int8PtrTy,
- Params, false),
+ params, false),
"objc_begin_catch");
}
@@ -865,16 +820,16 @@ protected:
unsigned Align,
bool AddToUsed);
- CodeGen::RValue EmitLegacyMessageSend(CodeGen::CodeGenFunction &CGF,
- ReturnValueSlot Return,
- QualType ResultType,
- llvm::Value *Sel,
- llvm::Value *Arg0,
- QualType Arg0Ty,
- bool IsSuper,
- const CallArgList &CallArgs,
- const ObjCMethodDecl *OMD,
- const ObjCCommonTypesHelper &ObjCTypes);
+ CodeGen::RValue EmitMessageSend(CodeGen::CodeGenFunction &CGF,
+ ReturnValueSlot Return,
+ QualType ResultType,
+ llvm::Value *Sel,
+ llvm::Value *Arg0,
+ QualType Arg0Ty,
+ bool IsSuper,
+ const CallArgList &CallArgs,
+ const ObjCMethodDecl *OMD,
+ const ObjCCommonTypesHelper &ObjCTypes);
/// EmitImageInfo - Emit the image info marker used to encode some module
/// level information.
@@ -1093,6 +1048,13 @@ public:
virtual llvm::Value *EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
const ObjCInterfaceDecl *Interface,
const ObjCIvarDecl *Ivar);
+
+ /// GetClassGlobal - Return the global variable for the Objective-C
+ /// class of the given name.
+ virtual llvm::GlobalVariable *GetClassGlobal(const std::string &Name) {
+ assert(false && "CGObjCMac::GetClassGlobal");
+ return 0;
+ }
};
class CGObjCNonFragileABIMac : public CGObjCCommonMac {
@@ -1110,16 +1072,16 @@ private:
/// EHTypeReferences - uniqued class ehtype references.
llvm::DenseMap<IdentifierInfo*, llvm::GlobalVariable*> EHTypeReferences;
- /// NonLegacyDispatchMethods - List of methods for which we do *not* generate
- /// legacy messaging dispatch.
- llvm::DenseSet<Selector> NonLegacyDispatchMethods;
+ /// VTableDispatchMethods - List of methods for which we generate
+ /// vtable-based message dispatch.
+ llvm::DenseSet<Selector> VTableDispatchMethods;
/// DefinedMetaClasses - List of defined meta-classes.
std::vector<llvm::GlobalValue*> DefinedMetaClasses;
- /// LegacyDispatchedSelector - Returns true if SEL is not in the list of
- /// NonLegacyDispatchMethods; false otherwise.
- bool LegacyDispatchedSelector(Selector Sel);
+ /// isVTableDispatchedSelector - Returns true if SEL is a
+ /// vtable-based selector.
+ bool isVTableDispatchedSelector(Selector Sel);
/// FinishNonFragileABIModule - Write out global data structures at the end of
/// processing a translation unit.
@@ -1178,20 +1140,20 @@ private:
ObjCProtocolDecl::protocol_iterator begin,
ObjCProtocolDecl::protocol_iterator end);
- CodeGen::RValue EmitMessageSend(CodeGen::CodeGenFunction &CGF,
- ReturnValueSlot Return,
- QualType ResultType,
- Selector Sel,
- llvm::Value *Receiver,
- QualType Arg0Ty,
- bool IsSuper,
- const CallArgList &CallArgs,
- const ObjCMethodDecl *Method);
-
+ CodeGen::RValue EmitVTableMessageSend(CodeGen::CodeGenFunction &CGF,
+ ReturnValueSlot Return,
+ QualType ResultType,
+ Selector Sel,
+ llvm::Value *Receiver,
+ QualType Arg0Ty,
+ bool IsSuper,
+ const CallArgList &CallArgs,
+ const ObjCMethodDecl *Method);
+
/// GetClassGlobal - Return the global variable for the Objective-C
/// class of the given name.
llvm::GlobalVariable *GetClassGlobal(const std::string &Name);
-
+
/// EmitClassRef - Return a Value*, of type ObjCTypes.ClassPtrTy,
/// for the given class reference.
llvm::Value *EmitClassRef(CGBuilderTy &Builder,
@@ -1347,6 +1309,46 @@ public:
const ObjCIvarDecl *Ivar);
};
+/// A helper class for performing the null-initialization of a return
+/// value.
+struct NullReturnState {
+ llvm::BasicBlock *NullBB;
+
+ NullReturnState() : NullBB(0) {}
+
+ void init(CodeGenFunction &CGF, llvm::Value *receiver) {
+ // Make blocks for the null-init and call edges.
+ NullBB = CGF.createBasicBlock("msgSend.nullinit");
+ llvm::BasicBlock *callBB = CGF.createBasicBlock("msgSend.call");
+
+ // Check for a null receiver and, if there is one, jump to the
+ // null-init test.
+ llvm::Value *isNull = CGF.Builder.CreateIsNull(receiver);
+ CGF.Builder.CreateCondBr(isNull, NullBB, callBB);
+
+ // Otherwise, start performing the call.
+ CGF.EmitBlock(callBB);
+ }
+
+ RValue complete(CodeGenFunction &CGF, RValue result, QualType resultType) {
+ if (!NullBB) return result;
+
+ // Finish the call path.
+ llvm::BasicBlock *contBB = CGF.createBasicBlock("msgSend.cont");
+ if (CGF.HaveInsertPoint()) CGF.Builder.CreateBr(contBB);
+
+ // Emit the null-init block and perform the null-initialization there.
+ CGF.EmitBlock(NullBB);
+ assert(result.isAggregate() && "null init of non-aggregate result?");
+ CGF.EmitNullInitialization(result.getAggregateAddr(), resultType);
+
+ // Jump to the continuation block.
+ CGF.EmitBlock(contBB);
+
+ return result;
+ }
+};
+
} // end anonymous namespace
/* *** Helper Functions *** */
@@ -1487,10 +1489,10 @@ CGObjCMac::GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,
Target = CGF.Builder.CreateBitCast(Target, ClassTy);
CGF.Builder.CreateStore(Target,
CGF.Builder.CreateStructGEP(ObjCSuper, 1));
- return EmitLegacyMessageSend(CGF, Return, ResultType,
- EmitSelector(CGF.Builder, Sel),
- ObjCSuper, ObjCTypes.SuperPtrCTy,
- true, CallArgs, Method, ObjCTypes);
+ return EmitMessageSend(CGF, Return, ResultType,
+ EmitSelector(CGF.Builder, Sel),
+ ObjCSuper, ObjCTypes.SuperPtrCTy,
+ true, CallArgs, Method, ObjCTypes);
}
/// Generate code for a message send expression.
@@ -1502,23 +1504,23 @@ CodeGen::RValue CGObjCMac::GenerateMessageSend(CodeGen::CodeGenFunction &CGF,
const CallArgList &CallArgs,
const ObjCInterfaceDecl *Class,
const ObjCMethodDecl *Method) {
- return EmitLegacyMessageSend(CGF, Return, ResultType,
- EmitSelector(CGF.Builder, Sel),
- Receiver, CGF.getContext().getObjCIdType(),
- false, CallArgs, Method, ObjCTypes);
+ return EmitMessageSend(CGF, Return, ResultType,
+ EmitSelector(CGF.Builder, Sel),
+ Receiver, CGF.getContext().getObjCIdType(),
+ false, CallArgs, Method, ObjCTypes);
}
CodeGen::RValue
-CGObjCCommonMac::EmitLegacyMessageSend(CodeGen::CodeGenFunction &CGF,
- ReturnValueSlot Return,
- QualType ResultType,
- llvm::Value *Sel,
- llvm::Value *Arg0,
- QualType Arg0Ty,
- bool IsSuper,
- const CallArgList &CallArgs,
- const ObjCMethodDecl *Method,
- const ObjCCommonTypesHelper &ObjCTypes) {
+CGObjCCommonMac::EmitMessageSend(CodeGen::CodeGenFunction &CGF,
+ ReturnValueSlot Return,
+ QualType ResultType,
+ llvm::Value *Sel,
+ llvm::Value *Arg0,
+ QualType Arg0Ty,
+ bool IsSuper,
+ const CallArgList &CallArgs,
+ const ObjCMethodDecl *Method,
+ const ObjCCommonTypesHelper &ObjCTypes) {
CallArgList ActualArgs;
if (!IsSuper)
Arg0 = CGF.Builder.CreateBitCast(Arg0, ObjCTypes.ObjectPtrTy, "tmp");
@@ -1537,9 +1539,11 @@ CGObjCCommonMac::EmitLegacyMessageSend(CodeGen::CodeGenFunction &CGF,
CGM.getContext().getCanonicalType(ResultType) &&
"Result type mismatch!");
+ NullReturnState nullReturn;
+
llvm::Constant *Fn = NULL;
if (CGM.ReturnTypeUsesSRet(FnInfo)) {
- EmitNullReturnInitialization(CGF, Return, ResultType);
+ if (!IsSuper) nullReturn.init(CGF, Arg0);
Fn = (ObjCABI == 2) ? ObjCTypes.getSendStretFn2(IsSuper)
: ObjCTypes.getSendStretFn(IsSuper);
} else if (CGM.ReturnTypeUsesFPRet(ResultType)) {
@@ -1550,7 +1554,8 @@ CGObjCCommonMac::EmitLegacyMessageSend(CodeGen::CodeGenFunction &CGF,
: ObjCTypes.getSendFn(IsSuper);
}
Fn = llvm::ConstantExpr::getBitCast(Fn, llvm::PointerType::getUnqual(FTy));
- return CGF.EmitCall(FnInfo, Fn, Return, ActualArgs);
+ RValue rvalue = CGF.EmitCall(FnInfo, Fn, Return, ActualArgs);
+ return nullReturn.complete(CGF, rvalue, ResultType);
}
static Qualifiers::GC GetGCAttrTypeForType(ASTContext &Ctx, QualType FQT) {
@@ -1681,6 +1686,7 @@ void CGObjCCommonMac::GenerateProtocol(const ObjCProtocolDecl *PD) {
llvm::Constant *CGObjCCommonMac::GetProtocolRef(const ObjCProtocolDecl *PD) {
if (DefinedProtocols.count(PD->getIdentifier()))
return GetOrEmitProtocol(PD);
+
return GetOrEmitProtocolRef(PD);
}
@@ -1714,6 +1720,9 @@ llvm::Constant *CGObjCMac::GetOrEmitProtocol(const ObjCProtocolDecl *PD) {
i = PD->instmeth_begin(), e = PD->instmeth_end(); i != e; ++i) {
ObjCMethodDecl *MD = *i;
llvm::Constant *C = GetMethodDescriptionConstant(MD);
+ if (!C)
+ return GetOrEmitProtocolRef(PD);
+
if (MD->getImplementationControl() == ObjCMethodDecl::Optional) {
OptInstanceMethods.push_back(C);
} else {
@@ -1725,6 +1734,9 @@ llvm::Constant *CGObjCMac::GetOrEmitProtocol(const ObjCProtocolDecl *PD) {
i = PD->classmeth_begin(), e = PD->classmeth_end(); i != e; ++i) {
ObjCMethodDecl *MD = *i;
llvm::Constant *C = GetMethodDescriptionConstant(MD);
+ if (!C)
+ return GetOrEmitProtocolRef(PD);
+
if (MD->getImplementationControl() == ObjCMethodDecl::Optional) {
OptClassMethods.push_back(C);
} else {
@@ -1968,6 +1980,9 @@ CGObjCMac::GetMethodDescriptionConstant(const ObjCMethodDecl *MD) {
llvm::ConstantExpr::getBitCast(GetMethodVarName(MD->getSelector()),
ObjCTypes.SelectorPtrTy);
Desc[1] = GetMethodVarType(MD);
+ if (!Desc[1])
+ return 0;
+
return llvm::ConstantStruct::get(ObjCTypes.MethodDescriptionTy,
Desc);
}
@@ -2730,10 +2745,10 @@ void FragileHazards::collectLocals() {
}
llvm::FunctionType *FragileHazards::GetAsmFnType() {
- std::vector<const llvm::Type *> Tys(Locals.size());
- for (unsigned I = 0, E = Locals.size(); I != E; ++I)
- Tys[I] = Locals[I]->getType();
- return llvm::FunctionType::get(CGF.Builder.getVoidTy(), Tys, false);
+ llvm::SmallVector<const llvm::Type *, 16> tys(Locals.size());
+ for (unsigned i = 0, e = Locals.size(); i != e; ++i)
+ tys[i] = Locals[i]->getType();
+ return llvm::FunctionType::get(CGF.VoidTy, tys, false);
}
/*
@@ -3930,8 +3945,10 @@ llvm::Constant *CGObjCCommonMac::GetMethodVarType(const FieldDecl *Field) {
llvm::Constant *CGObjCCommonMac::GetMethodVarType(const ObjCMethodDecl *D) {
std::string TypeStr;
- CGM.getContext().getObjCEncodingForMethodDecl(const_cast<ObjCMethodDecl*>(D),
- TypeStr);
+ if (CGM.getContext().getObjCEncodingForMethodDecl(
+ const_cast<ObjCMethodDecl*>(D),
+ TypeStr))
+ return 0;
llvm::GlobalVariable *&Entry = MethodVarTypes[TypeStr];
@@ -4081,9 +4098,9 @@ ObjCCommonTypesHelper::ObjCCommonTypesHelper(CodeGen::CodeGenModule &cgm)
SourceLocation(), SourceLocation(),
&Ctx.Idents.get("_objc_super"));
RD->addDecl(FieldDecl::Create(Ctx, RD, SourceLocation(), SourceLocation(), 0,
- Ctx.getObjCIdType(), 0, 0, false));
+ Ctx.getObjCIdType(), 0, 0, false, false));
RD->addDecl(FieldDecl::Create(Ctx, RD, SourceLocation(), SourceLocation(), 0,
- Ctx.getObjCClassType(), 0, 0, false));
+ Ctx.getObjCClassType(), 0, 0, false, false));
RD->completeDefinition();
SuperCTy = Ctx.getTagDeclType(RD);
@@ -4480,11 +4497,9 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
ClassRonfABITy);
// ImpnfABITy - LLVM for id (*)(id, SEL, ...)
- std::vector<const llvm::Type*> Params;
- Params.push_back(ObjectPtrTy);
- Params.push_back(SelectorPtrTy);
- ImpnfABITy = llvm::PointerType::getUnqual(
- llvm::FunctionType::get(ObjectPtrTy, Params, false));
+ const llvm::Type *params[] = { ObjectPtrTy, SelectorPtrTy };
+ ImpnfABITy = llvm::FunctionType::get(ObjectPtrTy, params, false)
+ ->getPointerTo();
// struct _class_t {
// struct _class_t *isa;
@@ -4544,9 +4559,9 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(CodeGen::CodeGenModul
SourceLocation(), SourceLocation(),
&Ctx.Idents.get("_message_ref_t"));
RD->addDecl(FieldDecl::Create(Ctx, RD, SourceLocation(), SourceLocation(), 0,
- Ctx.VoidPtrTy, 0, 0, false));
+ Ctx.VoidPtrTy, 0, 0, false, false));
RD->addDecl(FieldDecl::Create(Ctx, RD, SourceLocation(), SourceLocation(), 0,
- Ctx.getObjCSelType(), 0, 0, false));
+ Ctx.getObjCSelType(), 0, 0, false, false));
RD->completeDefinition();
MessageRefCTy = Ctx.getTagDeclType(RD);
@@ -4658,56 +4673,68 @@ void CGObjCNonFragileABIMac::FinishNonFragileABIModule() {
EmitImageInfo();
}
-/// LegacyDispatchedSelector - Returns true if SEL is not in the list of
-/// NonLegacyDispatchMethods; false otherwise. What this means is that
+/// isVTableDispatchedSelector - Returns true if SEL is not in the list of
+/// VTableDispatchMethods; false otherwise. What this means is that
/// except for the 19 selectors in the list, we generate 32bit-style
/// message dispatch call for all the rest.
-///
-bool CGObjCNonFragileABIMac::LegacyDispatchedSelector(Selector Sel) {
+bool CGObjCNonFragileABIMac::isVTableDispatchedSelector(Selector Sel) {
+ // At various points we've experimented with using vtable-based
+ // dispatch for all methods.
switch (CGM.getCodeGenOpts().getObjCDispatchMethod()) {
default:
- assert(0 && "Invalid dispatch method!");
+ llvm_unreachable("Invalid dispatch method!");
case CodeGenOptions::Legacy:
- return true;
- case CodeGenOptions::NonLegacy:
return false;
+ case CodeGenOptions::NonLegacy:
+ return true;
case CodeGenOptions::Mixed:
break;
}
// If so, see whether this selector is in the white-list of things which must
// use the new dispatch convention. We lazily build a dense set for this.
- if (NonLegacyDispatchMethods.empty()) {
- NonLegacyDispatchMethods.insert(GetNullarySelector("alloc"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("class"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("self"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("isFlipped"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("length"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("count"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("retain"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("release"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("autorelease"));
- NonLegacyDispatchMethods.insert(GetNullarySelector("hash"));
-
- NonLegacyDispatchMethods.insert(GetUnarySelector("allocWithZone"));
- NonLegacyDispatchMethods.insert(GetUnarySelector("isKindOfClass"));
- NonLegacyDispatchMethods.insert(GetUnarySelector("respondsToSelector"));
- NonLegacyDispatchMethods.insert(GetUnarySelector("objectForKey"));
- NonLegacyDispatchMethods.insert(GetUnarySelector("objectAtIndex"));
- NonLegacyDispatchMethods.insert(GetUnarySelector("isEqualToString"));
- NonLegacyDispatchMethods.insert(GetUnarySelector("isEqual"));
- NonLegacyDispatchMethods.insert(GetUnarySelector("addObject"));
- // "countByEnumeratingWithState:objects:count"
- IdentifierInfo *KeyIdents[] = {
- &CGM.getContext().Idents.get("countByEnumeratingWithState"),
- &CGM.getContext().Idents.get("objects"),
- &CGM.getContext().Idents.get("count")
- };
- NonLegacyDispatchMethods.insert(
- CGM.getContext().Selectors.getSelector(3, KeyIdents));
- }
-
- return (NonLegacyDispatchMethods.count(Sel) == 0);
+ if (VTableDispatchMethods.empty()) {
+ VTableDispatchMethods.insert(GetNullarySelector("alloc"));
+ VTableDispatchMethods.insert(GetNullarySelector("class"));
+ VTableDispatchMethods.insert(GetNullarySelector("self"));
+ VTableDispatchMethods.insert(GetNullarySelector("isFlipped"));
+ VTableDispatchMethods.insert(GetNullarySelector("length"));
+ VTableDispatchMethods.insert(GetNullarySelector("count"));
+
+ // These are vtable-based if GC is disabled.
+ // Optimistically use vtable dispatch for hybrid compiles.
+ if (CGM.getLangOptions().getGCMode() != LangOptions::GCOnly) {
+ VTableDispatchMethods.insert(GetNullarySelector("retain"));
+ VTableDispatchMethods.insert(GetNullarySelector("release"));
+ VTableDispatchMethods.insert(GetNullarySelector("autorelease"));
+ }
+
+ VTableDispatchMethods.insert(GetUnarySelector("allocWithZone"));
+ VTableDispatchMethods.insert(GetUnarySelector("isKindOfClass"));
+ VTableDispatchMethods.insert(GetUnarySelector("respondsToSelector"));
+ VTableDispatchMethods.insert(GetUnarySelector("objectForKey"));
+ VTableDispatchMethods.insert(GetUnarySelector("objectAtIndex"));
+ VTableDispatchMethods.insert(GetUnarySelector("isEqualToString"));
+ VTableDispatchMethods.insert(GetUnarySelector("isEqual"));
+
+ // These are vtable-based if GC is enabled.
+ // Optimistically use vtable dispatch for hybrid compiles.
+ if (CGM.getLangOptions().getGCMode() != LangOptions::NonGC) {
+ VTableDispatchMethods.insert(GetNullarySelector("hash"));
+ VTableDispatchMethods.insert(GetUnarySelector("addObject"));
+
+ // "countByEnumeratingWithState:objects:count"
+ IdentifierInfo *KeyIdents[] = {
+ &CGM.getContext().Idents.get("countByEnumeratingWithState"),
+ &CGM.getContext().Idents.get("objects"),
+ &CGM.getContext().Idents.get("count")
+ };
+ VTableDispatchMethods.insert(
+ CGM.getContext().Selectors.getSelector(3, KeyIdents));
+ }
+ }
+
+ return VTableDispatchMethods.count(Sel);
}
// Metadata flags
@@ -5209,7 +5236,7 @@ CGObjCNonFragileABIMac::EmitIvarOffsetVar(const ObjCInterfaceDecl *ID,
IvarOffsetGV->setVisibility(llvm::GlobalValue::HiddenVisibility);
else
IvarOffsetGV->setVisibility(llvm::GlobalValue::DefaultVisibility);
- IvarOffsetGV->setSection("__DATA, __objc_const");
+ IvarOffsetGV->setSection("__DATA, __objc_ivar");
return IvarOffsetGV;
}
@@ -5344,6 +5371,9 @@ llvm::Constant *CGObjCNonFragileABIMac::GetOrEmitProtocol(
i = PD->instmeth_begin(), e = PD->instmeth_end(); i != e; ++i) {
ObjCMethodDecl *MD = *i;
llvm::Constant *C = GetMethodDescriptionConstant(MD);
+ if (!C)
+ return GetOrEmitProtocolRef(PD);
+
if (MD->getImplementationControl() == ObjCMethodDecl::Optional) {
OptInstanceMethods.push_back(C);
} else {
@@ -5355,6 +5385,9 @@ llvm::Constant *CGObjCNonFragileABIMac::GetOrEmitProtocol(
i = PD->classmeth_begin(), e = PD->classmeth_end(); i != e; ++i) {
ObjCMethodDecl *MD = *i;
llvm::Constant *C = GetMethodDescriptionConstant(MD);
+ if (!C)
+ return GetOrEmitProtocolRef(PD);
+
if (MD->getImplementationControl() == ObjCMethodDecl::Optional) {
OptClassMethods.push_back(C);
} else {
@@ -5494,6 +5527,9 @@ CGObjCNonFragileABIMac::GetMethodDescriptionConstant(const ObjCMethodDecl *MD) {
llvm::ConstantExpr::getBitCast(GetMethodVarName(MD->getSelector()),
ObjCTypes.SelectorPtrTy);
Desc[1] = GetMethodVarType(MD);
+ if (!Desc[1])
+ return 0;
+
// Protocol methods have no implementation. So, this entry is always NULL.
Desc[2] = llvm::Constant::getNullValue(ObjCTypes.Int8PtrTy);
return llvm::ConstantStruct::get(ObjCTypes.MethodTy, Desc);
@@ -5523,90 +5559,131 @@ llvm::Value *CGObjCNonFragileABIMac::EmitIvarOffset(
return CGF.Builder.CreateLoad(ObjCIvarOffsetVariable(Interface, Ivar),"ivar");
}
-CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
- CodeGen::CodeGenFunction &CGF,
- ReturnValueSlot Return,
- QualType ResultType,
- Selector Sel,
- llvm::Value *Receiver,
- QualType Arg0Ty,
- bool IsSuper,
- const CallArgList &CallArgs,
- const ObjCMethodDecl *Method) {
- // FIXME. Even though IsSuper is passes. This function doese not handle calls
- // to 'super' receivers.
- CodeGenTypes &Types = CGM.getTypes();
- llvm::Value *Arg0 = Receiver;
- if (!IsSuper)
- Arg0 = CGF.Builder.CreateBitCast(Arg0, ObjCTypes.ObjectPtrTy, "tmp");
+static void appendSelectorForMessageRefTable(std::string &buffer,
+ Selector selector) {
+ if (selector.isUnarySelector()) {
+ buffer += selector.getNameForSlot(0);
+ return;
+ }
- // Find the message function name.
- // FIXME. This is too much work to get the ABI-specific result type needed to
- // find the message name.
- const CGFunctionInfo &FnInfo
- = Types.getFunctionInfo(ResultType, CallArgList(),
- FunctionType::ExtInfo());
- llvm::Constant *Fn = 0;
- std::string Name("\01l_");
- if (CGM.ReturnTypeUsesSRet(FnInfo)) {
- EmitNullReturnInitialization(CGF, Return, ResultType);
- if (IsSuper) {
- Fn = ObjCTypes.getMessageSendSuper2StretFixupFn();
- Name += "objc_msgSendSuper2_stret_fixup";
+ for (unsigned i = 0, e = selector.getNumArgs(); i != e; ++i) {
+ buffer += selector.getNameForSlot(i);
+ buffer += '_';
+ }
+}
+
+/// Emit a "v-table" message send. We emit a weak hidden-visibility
+/// struct, initially containing the selector pointer and a pointer to
+/// a "fixup" variant of the appropriate objc_msgSend. To call, we
+/// load and call the function pointer, passing the address of the
+/// struct as the second parameter. The runtime determines whether
+/// the selector is currently emitted using vtable dispatch; if so, it
+/// substitutes a stub function which simply tail-calls through the
+/// appropriate vtable slot, and if not, it substitues a stub function
+/// which tail-calls objc_msgSend. Both stubs adjust the selector
+/// argument to correctly point to the selector.
+RValue
+CGObjCNonFragileABIMac::EmitVTableMessageSend(CodeGenFunction &CGF,
+ ReturnValueSlot returnSlot,
+ QualType resultType,
+ Selector selector,
+ llvm::Value *arg0,
+ QualType arg0Type,
+ bool isSuper,
+ const CallArgList &formalArgs,
+ const ObjCMethodDecl *method) {
+ // Compute the actual arguments.
+ CallArgList args;
+
+ // First argument: the receiver / super-call structure.
+ if (!isSuper)
+ arg0 = CGF.Builder.CreateBitCast(arg0, ObjCTypes.ObjectPtrTy);
+ args.add(RValue::get(arg0), arg0Type);
+
+ // Second argument: a pointer to the message ref structure. Leave
+ // the actual argument value blank for now.
+ args.add(RValue::get(0), ObjCTypes.MessageRefCPtrTy);
+
+ args.insert(args.end(), formalArgs.begin(), formalArgs.end());
+
+ const CGFunctionInfo &fnInfo =
+ CGM.getTypes().getFunctionInfo(resultType, args,
+ FunctionType::ExtInfo());
+
+ NullReturnState nullReturn;
+
+ // Find the function to call and the mangled name for the message
+ // ref structure. Using a different mangled name wouldn't actually
+ // be a problem; it would just be a waste.
+ //
+ // The runtime currently never uses vtable dispatch for anything
+ // except normal, non-super message-sends.
+ // FIXME: don't use this for that.
+ llvm::Constant *fn = 0;
+ std::string messageRefName("\01l_");
+ if (CGM.ReturnTypeUsesSRet(fnInfo)) {
+ if (isSuper) {
+ fn = ObjCTypes.getMessageSendSuper2StretFixupFn();
+ messageRefName += "objc_msgSendSuper2_stret_fixup";
} else {
- Fn = ObjCTypes.getMessageSendStretFixupFn();
- Name += "objc_msgSend_stret_fixup";
+ nullReturn.init(CGF, arg0);
+ fn = ObjCTypes.getMessageSendStretFixupFn();
+ messageRefName += "objc_msgSend_stret_fixup";
}
- } else if (!IsSuper && CGM.ReturnTypeUsesFPRet(ResultType)) {
- Fn = ObjCTypes.getMessageSendFpretFixupFn();
- Name += "objc_msgSend_fpret_fixup";
+ } else if (!isSuper && CGM.ReturnTypeUsesFPRet(resultType)) {
+ fn = ObjCTypes.getMessageSendFpretFixupFn();
+ messageRefName += "objc_msgSend_fpret_fixup";
} else {
- if (IsSuper) {
- Fn = ObjCTypes.getMessageSendSuper2FixupFn();
- Name += "objc_msgSendSuper2_fixup";
+ if (isSuper) {
+ fn = ObjCTypes.getMessageSendSuper2FixupFn();
+ messageRefName += "objc_msgSendSuper2_fixup";
} else {
- Fn = ObjCTypes.getMessageSendFixupFn();
- Name += "objc_msgSend_fixup";
+ fn = ObjCTypes.getMessageSendFixupFn();
+ messageRefName += "objc_msgSend_fixup";
}
}
- assert(Fn && "CGObjCNonFragileABIMac::EmitMessageSend");
- Name += '_';
- std::string SelName(Sel.getAsString());
- // Replace all ':' in selector name with '_' ouch!
- for (unsigned i = 0; i < SelName.size(); i++)
- if (SelName[i] == ':')
- SelName[i] = '_';
- Name += SelName;
- llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
- if (!GV) {
- // Build message ref table entry.
- std::vector<llvm::Constant*> Values(2);
- Values[0] = Fn;
- Values[1] = GetMethodVarName(Sel);
- llvm::Constant *Init = llvm::ConstantStruct::get(VMContext, Values, false);
- GV = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), false,
- llvm::GlobalValue::WeakAnyLinkage,
- Init,
- Name);
- GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
- GV->setAlignment(16);
- GV->setSection("__DATA, __objc_msgrefs, coalesced");
- }
- llvm::Value *Arg1 = CGF.Builder.CreateBitCast(GV, ObjCTypes.MessageRefPtrTy);
-
- CallArgList ActualArgs;
- ActualArgs.add(RValue::get(Arg0), Arg0Ty);
- ActualArgs.add(RValue::get(Arg1), ObjCTypes.MessageRefCPtrTy);
- ActualArgs.insert(ActualArgs.end(), CallArgs.begin(), CallArgs.end());
- const CGFunctionInfo &FnInfo1 = Types.getFunctionInfo(ResultType, ActualArgs,
- FunctionType::ExtInfo());
- llvm::Value *Callee = CGF.Builder.CreateStructGEP(Arg1, 0);
- Callee = CGF.Builder.CreateLoad(Callee);
- const llvm::FunctionType *FTy =
- Types.GetFunctionType(FnInfo1, Method ? Method->isVariadic() : false);
- Callee = CGF.Builder.CreateBitCast(Callee,
- llvm::PointerType::getUnqual(FTy));
- return CGF.EmitCall(FnInfo1, Callee, Return, ActualArgs);
+ assert(fn && "CGObjCNonFragileABIMac::EmitMessageSend");
+ messageRefName += '_';
+
+ // Append the selector name, except use underscores anywhere we
+ // would have used colons.
+ appendSelectorForMessageRefTable(messageRefName, selector);
+
+ llvm::GlobalVariable *messageRef
+ = CGM.getModule().getGlobalVariable(messageRefName);
+ if (!messageRef) {
+ // Build the message ref structure.
+ llvm::Constant *values[] = { fn, GetMethodVarName(selector) };
+ llvm::Constant *init =
+ llvm::ConstantStruct::get(VMContext, values, 2, false);
+ messageRef = new llvm::GlobalVariable(CGM.getModule(),
+ init->getType(),
+ /*constant*/ false,
+ llvm::GlobalValue::WeakAnyLinkage,
+ init,
+ messageRefName);
+ messageRef->setVisibility(llvm::GlobalValue::HiddenVisibility);
+ messageRef->setAlignment(16);
+ messageRef->setSection("__DATA, __objc_msgrefs, coalesced");
+ }
+ llvm::Value *mref =
+ CGF.Builder.CreateBitCast(messageRef, ObjCTypes.MessageRefPtrTy);
+
+ // Update the message ref argument.
+ args[1].RV = RValue::get(mref);
+
+ // Load the function to call from the message ref table.
+ llvm::Value *callee = CGF.Builder.CreateStructGEP(mref, 0);
+ callee = CGF.Builder.CreateLoad(callee, "msgSend_fn");
+
+ bool variadic = method ? method->isVariadic() : false;
+ const llvm::FunctionType *fnType =
+ CGF.getTypes().GetFunctionType(fnInfo, variadic);
+ callee = CGF.Builder.CreateBitCast(callee,
+ llvm::PointerType::getUnqual(fnType));
+
+ RValue result = CGF.EmitCall(fnInfo, callee, returnSlot, args);
+ return nullReturn.complete(CGF, result, resultType);
}
/// Generate code for a message send expression in the nonfragile abi.
@@ -5619,14 +5696,14 @@ CGObjCNonFragileABIMac::GenerateMessageSend(CodeGen::CodeGenFunction &CGF,
const CallArgList &CallArgs,
const ObjCInterfaceDecl *Class,
const ObjCMethodDecl *Method) {
- return LegacyDispatchedSelector(Sel)
- ? EmitLegacyMessageSend(CGF, Return, ResultType,
- EmitSelector(CGF.Builder, Sel),
+ return isVTableDispatchedSelector(Sel)
+ ? EmitVTableMessageSend(CGF, Return, ResultType, Sel,
Receiver, CGF.getContext().getObjCIdType(),
- false, CallArgs, Method, ObjCTypes)
- : EmitMessageSend(CGF, Return, ResultType, Sel,
+ false, CallArgs, Method)
+ : EmitMessageSend(CGF, Return, ResultType,
+ EmitSelector(CGF.Builder, Sel),
Receiver, CGF.getContext().getObjCIdType(),
- false, CallArgs, Method);
+ false, CallArgs, Method, ObjCTypes);
}
llvm::GlobalVariable *
@@ -5773,14 +5850,14 @@ CGObjCNonFragileABIMac::GenerateMessageSendSuper(CodeGen::CodeGenFunction &CGF,
CGF.Builder.CreateStore(Target,
CGF.Builder.CreateStructGEP(ObjCSuper, 1));
- return (LegacyDispatchedSelector(Sel))
- ? EmitLegacyMessageSend(CGF, Return, ResultType,
- EmitSelector(CGF.Builder, Sel),
+ return (isVTableDispatchedSelector(Sel))
+ ? EmitVTableMessageSend(CGF, Return, ResultType, Sel,
ObjCSuper, ObjCTypes.SuperPtrCTy,
- true, CallArgs, Method, ObjCTypes)
- : EmitMessageSend(CGF, Return, ResultType, Sel,
+ true, CallArgs, Method)
+ : EmitMessageSend(CGF, Return, ResultType,
+ EmitSelector(CGF.Builder, Sel),
ObjCSuper, ObjCTypes.SuperPtrCTy,
- true, CallArgs, Method);
+ true, CallArgs, Method, ObjCTypes);
}
llvm::Value *CGObjCNonFragileABIMac::EmitSelector(CGBuilderTy &Builder,
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp
index 3d854d4..21150f1 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp
@@ -165,9 +165,9 @@ namespace {
void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF,
const ObjCAtTryStmt &S,
- llvm::Function *beginCatchFn,
- llvm::Function *endCatchFn,
- llvm::Function *exceptionRethrowFn) {
+ llvm::Constant *beginCatchFn,
+ llvm::Constant *endCatchFn,
+ llvm::Constant *exceptionRethrowFn) {
// Jump destination for falling out of catch bodies.
CodeGenFunction::JumpDest Cont;
if (S.getNumCatchStmts())
@@ -233,6 +233,8 @@ void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF,
cast<llvm::CallInst>(Exn)->setDoesNotThrow();
}
+ CodeGenFunction::RunCleanupsScope cleanups(CGF);
+
if (endCatchFn) {
// Add a cleanup to leave the catch.
bool EndCatchMightThrow = (Handler.Variable == 0);
@@ -255,9 +257,8 @@ void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF,
CGF.EmitStmt(Handler.Body);
CGF.ObjCEHValueStack.pop_back();
- // Leave the earlier cleanup.
- if (endCatchFn)
- CGF.PopCleanupBlock();
+ // Leave any cleanups associated with the catch.
+ cleanups.ForceCleanup();
CGF.EmitBranchThroughCleanup(Cont);
}
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h b/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h
index 0cc2d82..866d5d8 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h
@@ -95,9 +95,9 @@ protected:
/// thrown object directly.
void EmitTryCatchStmt(CodeGenFunction &CGF,
const ObjCAtTryStmt &S,
- llvm::Function *beginCatchFn,
- llvm::Function *endCatchFn,
- llvm::Function *exceptionRethrowFn);
+ llvm::Constant *beginCatchFn,
+ llvm::Constant *endCatchFn,
+ llvm::Constant *exceptionRethrowFn);
/// Emits an @synchronize() statement, using the syncEnterFn and syncExitFn
/// arguments as the functions called to lock and unlock the object. This
/// function can be called by subclasses that use zero-cost exception
@@ -243,6 +243,7 @@ public:
llvm::Value *Size) = 0;
virtual llvm::Constant *BuildGCBlockLayout(CodeGen::CodeGenModule &CGM,
const CodeGen::CGBlockInfo &blockInfo) = 0;
+ virtual llvm::GlobalVariable *GetClassGlobal(const std::string &Name) = 0;
};
/// Creates an instance of an Objective-C runtime class.
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
index a4ac390..0d72f85 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
@@ -234,7 +234,7 @@ CGBitFieldInfo CGBitFieldInfo::MakeInfo(CodeGenTypes &Types,
CharUnits::fromQuantity(Types.getTargetData().getTypeAllocSize(Ty));
uint64_t TypeSizeInBits = Types.getContext().toBits(TypeSizeInBytes);
- bool IsSigned = FD->getType()->isSignedIntegerType();
+ bool IsSigned = FD->getType()->isSignedIntegerOrEnumerationType();
if (FieldSize > TypeSizeInBits) {
// We have a wide bit-field. The extra bits are only used for padding, so
@@ -753,8 +753,7 @@ bool CGRecordLayoutBuilder::LayoutFields(const RecordDecl *D) {
// Zero-length bitfields following non-bitfield members are
// ignored:
const FieldDecl *FD = (*Field);
- if (Types.getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD) ||
- Types.getContext().ZeroBitfieldFollowsBitfield(FD, LastFD)) {
+ if (Types.getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD)) {
--FieldNo;
continue;
}
@@ -997,8 +996,7 @@ CGRecordLayout *CodeGenTypes::ComputeRecordLayout(const RecordDecl *D) {
if (IsMsStruct) {
// Zero-length bitfields following non-bitfield members are
// ignored:
- if (getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD) ||
- getContext().ZeroBitfieldFollowsBitfield(FD, LastFD)) {
+ if (getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD)) {
--i;
continue;
}
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp
index 99bc3f4..a982621 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp
@@ -773,10 +773,8 @@ void CodeGenFunction::EmitReturnStmt(const ReturnStmt &S) {
void CodeGenFunction::EmitDeclStmt(const DeclStmt &S) {
// As long as debug info is modeled with instructions, we have to ensure we
// have a place to insert here and write the stop point here.
- if (getDebugInfo()) {
- EnsureInsertPoint();
+ if (getDebugInfo() && HaveInsertPoint())
EmitStopPoint(&S);
- }
for (DeclStmt::const_decl_iterator I = S.decl_begin(), E = S.decl_end();
I != E; ++I)
@@ -999,7 +997,7 @@ static CSFC_Result CollectStatementsForCase(const Stmt *S,
// If we're looking for the case, just see if we can skip each of the
// substatements.
for (; Case && I != E; ++I) {
- HadSkippedDecl |= isa<DeclStmt>(I);
+ HadSkippedDecl |= isa<DeclStmt>(*I);
switch (CollectStatementsForCase(*I, Case, FoundCase, ResultStmts)) {
case CSFC_Failure: return CSFC_Failure;
@@ -1224,7 +1222,7 @@ SimplifyConstraint(const char *Constraint, const TargetInfo &Target,
while (*Constraint) {
switch (*Constraint) {
default:
- Result += Target.convertConstraint(*Constraint);
+ Result += Target.convertConstraint(Constraint);
break;
// Ignore these
case '*':
@@ -1422,8 +1420,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
const Expr *OutExpr = S.getOutputExpr(i);
OutExpr = OutExpr->IgnoreParenNoopCasts(getContext());
- OutputConstraint = AddVariableConstraints(OutputConstraint, *OutExpr, Target,
- CGM, S);
+ OutputConstraint = AddVariableConstraints(OutputConstraint, *OutExpr,
+ Target, CGM, S);
LValue Dest = EmitLValue(OutExpr);
if (!Constraints.empty())
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp
index a6849f8..aefc41e 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp
@@ -411,6 +411,8 @@ llvm::GlobalVariable *CodeGenVTables::GetAddrOfVTT(const CXXRecordDecl *RD) {
Out.flush();
llvm::StringRef Name = OutName.str();
+ ComputeVTableRelatedInformation(RD, /*VTableRequired=*/true);
+
VTTBuilder Builder(CGM, RD, /*GenerateDefinition=*/false);
const llvm::Type *Int8PtrTy =
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp
index 581467c..9ac5e67 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp
@@ -21,6 +21,7 @@
#include "llvm/ADT/SetVector.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Format.h"
+#include "llvm/Transforms/Utils/Cloning.h"
#include <algorithm>
#include <cstdio>
@@ -2636,6 +2637,131 @@ static bool similar(const ABIArgInfo &infoL, CanQualType typeL,
}
#endif
+static RValue PerformReturnAdjustment(CodeGenFunction &CGF,
+ QualType ResultType, RValue RV,
+ const ThunkInfo &Thunk) {
+ // Emit the return adjustment.
+ bool NullCheckValue = !ResultType->isReferenceType();
+
+ llvm::BasicBlock *AdjustNull = 0;
+ llvm::BasicBlock *AdjustNotNull = 0;
+ llvm::BasicBlock *AdjustEnd = 0;
+
+ llvm::Value *ReturnValue = RV.getScalarVal();
+
+ if (NullCheckValue) {
+ AdjustNull = CGF.createBasicBlock("adjust.null");
+ AdjustNotNull = CGF.createBasicBlock("adjust.notnull");
+ AdjustEnd = CGF.createBasicBlock("adjust.end");
+
+ llvm::Value *IsNull = CGF.Builder.CreateIsNull(ReturnValue);
+ CGF.Builder.CreateCondBr(IsNull, AdjustNull, AdjustNotNull);
+ CGF.EmitBlock(AdjustNotNull);
+ }
+
+ ReturnValue = PerformTypeAdjustment(CGF, ReturnValue,
+ Thunk.Return.NonVirtual,
+ Thunk.Return.VBaseOffsetOffset);
+
+ if (NullCheckValue) {
+ CGF.Builder.CreateBr(AdjustEnd);
+ CGF.EmitBlock(AdjustNull);
+ CGF.Builder.CreateBr(AdjustEnd);
+ CGF.EmitBlock(AdjustEnd);
+
+ llvm::PHINode *PHI = CGF.Builder.CreatePHI(ReturnValue->getType(), 2);
+ PHI->addIncoming(ReturnValue, AdjustNotNull);
+ PHI->addIncoming(llvm::Constant::getNullValue(ReturnValue->getType()),
+ AdjustNull);
+ ReturnValue = PHI;
+ }
+
+ return RValue::get(ReturnValue);
+}
+
+// This function does roughly the same thing as GenerateThunk, but in a
+// very different way, so that va_start and va_end work correctly.
+// FIXME: This function assumes "this" is the first non-sret LLVM argument of
+// a function, and that there is an alloca built in the entry block
+// for all accesses to "this".
+// FIXME: This function assumes there is only one "ret" statement per function.
+// FIXME: Cloning isn't correct in the presence of indirect goto!
+// FIXME: This implementation of thunks bloats codesize by duplicating the
+// function definition. There are alternatives:
+// 1. Add some sort of stub support to LLVM for cases where we can
+// do a this adjustment, then a sibcall.
+// 2. We could transform the definition to take a va_list instead of an
+// actual variable argument list, then have the thunks (including a
+// no-op thunk for the regular definition) call va_start/va_end.
+// There's a bit of per-call overhead for this solution, but it's
+// better for codesize if the definition is long.
+void CodeGenFunction::GenerateVarArgsThunk(
+ llvm::Function *Fn,
+ const CGFunctionInfo &FnInfo,
+ GlobalDecl GD, const ThunkInfo &Thunk) {
+ const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
+ const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>();
+ QualType ResultType = FPT->getResultType();
+
+ // Get the original function
+ const llvm::Type *Ty =
+ CGM.getTypes().GetFunctionType(FnInfo, /*IsVariadic*/true);
+ llvm::Value *Callee = CGM.GetAddrOfFunction(GD, Ty, /*ForVTable=*/true);
+ llvm::Function *BaseFn = cast<llvm::Function>(Callee);
+
+ // Clone to thunk.
+ llvm::Function *NewFn = llvm::CloneFunction(BaseFn);
+ CGM.getModule().getFunctionList().push_back(NewFn);
+ Fn->replaceAllUsesWith(NewFn);
+ NewFn->takeName(Fn);
+ Fn->eraseFromParent();
+ Fn = NewFn;
+
+ // "Initialize" CGF (minimally).
+ CurFn = Fn;
+
+ // Get the "this" value
+ llvm::Function::arg_iterator AI = Fn->arg_begin();
+ if (CGM.ReturnTypeUsesSRet(FnInfo))
+ ++AI;
+
+ // Find the first store of "this", which will be to the alloca associated
+ // with "this".
+ llvm::Value *ThisPtr = &*AI;
+ llvm::BasicBlock *EntryBB = Fn->begin();
+ llvm::Instruction *ThisStore = 0;
+ for (llvm::BasicBlock::iterator I = EntryBB->begin(), E = EntryBB->end();
+ I != E; I++) {
+ if (isa<llvm::StoreInst>(I) && I->getOperand(0) == ThisPtr) {
+ ThisStore = cast<llvm::StoreInst>(I);
+ break;
+ }
+ }
+ assert(ThisStore && "Store of this should be in entry block?");
+ // Adjust "this", if necessary.
+ Builder.SetInsertPoint(ThisStore);
+ llvm::Value *AdjustedThisPtr =
+ PerformTypeAdjustment(*this, ThisPtr,
+ Thunk.This.NonVirtual,
+ Thunk.This.VCallOffsetOffset);
+ ThisStore->setOperand(0, AdjustedThisPtr);
+
+ if (!Thunk.Return.isEmpty()) {
+ // Fix up the returned value, if necessary.
+ for (llvm::Function::iterator I = Fn->begin(), E = Fn->end(); I != E; I++) {
+ llvm::Instruction *T = I->getTerminator();
+ if (isa<llvm::ReturnInst>(T)) {
+ RValue RV = RValue::get(T->getOperand(0));
+ T->eraseFromParent();
+ Builder.SetInsertPoint(&*I);
+ RV = PerformReturnAdjustment(*this, ResultType, RV, Thunk);
+ Builder.CreateRet(RV.getScalarVal());
+ break;
+ }
+ }
+ }
+}
+
void CodeGenFunction::GenerateThunk(llvm::Function *Fn,
const CGFunctionInfo &FnInfo,
GlobalDecl GD, const ThunkInfo &Thunk) {
@@ -2715,45 +2841,8 @@ void CodeGenFunction::GenerateThunk(llvm::Function *Fn,
// Now emit our call.
RValue RV = EmitCall(FnInfo, Callee, Slot, CallArgs, MD);
- if (!Thunk.Return.isEmpty()) {
- // Emit the return adjustment.
- bool NullCheckValue = !ResultType->isReferenceType();
-
- llvm::BasicBlock *AdjustNull = 0;
- llvm::BasicBlock *AdjustNotNull = 0;
- llvm::BasicBlock *AdjustEnd = 0;
-
- llvm::Value *ReturnValue = RV.getScalarVal();
-
- if (NullCheckValue) {
- AdjustNull = createBasicBlock("adjust.null");
- AdjustNotNull = createBasicBlock("adjust.notnull");
- AdjustEnd = createBasicBlock("adjust.end");
-
- llvm::Value *IsNull = Builder.CreateIsNull(ReturnValue);
- Builder.CreateCondBr(IsNull, AdjustNull, AdjustNotNull);
- EmitBlock(AdjustNotNull);
- }
-
- ReturnValue = PerformTypeAdjustment(*this, ReturnValue,
- Thunk.Return.NonVirtual,
- Thunk.Return.VBaseOffsetOffset);
-
- if (NullCheckValue) {
- Builder.CreateBr(AdjustEnd);
- EmitBlock(AdjustNull);
- Builder.CreateBr(AdjustEnd);
- EmitBlock(AdjustEnd);
-
- llvm::PHINode *PHI = Builder.CreatePHI(ReturnValue->getType(), 2);
- PHI->addIncoming(ReturnValue, AdjustNotNull);
- PHI->addIncoming(llvm::Constant::getNullValue(ReturnValue->getType()),
- AdjustNull);
- ReturnValue = PHI;
- }
-
- RV = RValue::get(ReturnValue);
- }
+ if (!Thunk.Return.isEmpty())
+ RV = PerformReturnAdjustment(*this, ResultType, RV, Thunk);
if (!ResultType->isVoidType() && Slot.isNull())
CGM.getCXXABI().EmitReturnFromThunk(*this, RV, ResultType);
@@ -2823,8 +2912,18 @@ void CodeGenVTables::EmitThunk(GlobalDecl GD, const ThunkInfo &Thunk,
return;
}
- // Actually generate the thunk body.
- CodeGenFunction(CGM).GenerateThunk(ThunkFn, FnInfo, GD, Thunk);
+ if (ThunkFn->isVarArg()) {
+ // Varargs thunks are special; we can't just generate a call because
+ // we can't copy the varargs. Our implementation is rather
+ // expensive/sucky at the moment, so don't generate the thunk unless
+ // we have to.
+ // FIXME: Do something better here; GenerateVarArgsThunk is extremely ugly.
+ if (!UseAvailableExternallyLinkage)
+ CodeGenFunction(CGM).GenerateVarArgsThunk(ThunkFn, FnInfo, GD, Thunk);
+ } else {
+ // Normal thunk body generation.
+ CodeGenFunction(CGM).GenerateThunk(ThunkFn, FnInfo, GD, Thunk);
+ }
if (UseAvailableExternallyLinkage)
ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage);
@@ -3076,7 +3175,7 @@ llvm::GlobalVariable *CodeGenVTables::GetAddrOfVTable(const CXXRecordDecl *RD) {
Out.flush();
llvm::StringRef Name = OutName.str();
- ComputeVTableRelatedInformation(RD, true);
+ ComputeVTableRelatedInformation(RD, /*VTableRequired=*/true);
const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext());
llvm::ArrayType *ArrayType =
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp
index 626c2b0..150cb69 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -33,9 +33,9 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
Target(CGM.getContext().Target), Builder(cgm.getModule().getContext()),
BlockInfo(0), BlockPointer(0),
NormalCleanupDest(0), EHCleanupDest(0), NextCleanupDestIndex(1),
- ExceptionSlot(0), DebugInfo(0), DisableDebugInfo(false), IndirectBranch(0),
- SwitchInsn(0), CaseRangeBlock(0),
- DidCallStackSave(false), UnreachableBlock(0),
+ ExceptionSlot(0), EHSelectorSlot(0),
+ DebugInfo(0), DisableDebugInfo(false), DidCallStackSave(false),
+ IndirectBranch(0), SwitchInsn(0), CaseRangeBlock(0), UnreachableBlock(0),
CXXThisDecl(0), CXXThisValue(0), CXXVTTDecl(0), CXXVTTValue(0),
OutermostConditional(0), TerminateLandingPad(0), TerminateHandler(0),
TrapBB(0) {
@@ -44,10 +44,6 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
CGM.getCXXABI().getMangleContext().startNewFunction();
}
-ASTContext &CodeGenFunction::getContext() const {
- return CGM.getContext();
-}
-
const llvm::Type *CodeGenFunction::ConvertTypeForMem(QualType T) {
return CGM.getTypes().ConvertTypeForMem(T);
@@ -57,9 +53,41 @@ const llvm::Type *CodeGenFunction::ConvertType(QualType T) {
return CGM.getTypes().ConvertType(T);
}
-bool CodeGenFunction::hasAggregateLLVMType(QualType T) {
- return T->isRecordType() || T->isArrayType() || T->isAnyComplexType() ||
- T->isObjCObjectType();
+bool CodeGenFunction::hasAggregateLLVMType(QualType type) {
+ switch (type.getCanonicalType()->getTypeClass()) {
+#define TYPE(name, parent)
+#define ABSTRACT_TYPE(name, parent)
+#define NON_CANONICAL_TYPE(name, parent) case Type::name:
+#define DEPENDENT_TYPE(name, parent) case Type::name:
+#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(name, parent) case Type::name:
+#include "clang/AST/TypeNodes.def"
+ llvm_unreachable("non-canonical or dependent type in IR-generation");
+
+ case Type::Builtin:
+ case Type::Pointer:
+ case Type::BlockPointer:
+ case Type::LValueReference:
+ case Type::RValueReference:
+ case Type::MemberPointer:
+ case Type::Vector:
+ case Type::ExtVector:
+ case Type::FunctionProto:
+ case Type::FunctionNoProto:
+ case Type::Enum:
+ case Type::ObjCObjectPointer:
+ return false;
+
+ // Complexes, arrays, records, and Objective-C objects.
+ case Type::Complex:
+ case Type::ConstantArray:
+ case Type::IncompleteArray:
+ case Type::VariableArray:
+ case Type::Record:
+ case Type::ObjCObject:
+ case Type::ObjCInterface:
+ return true;
+ }
+ llvm_unreachable("unknown type kind!");
}
void CodeGenFunction::EmitReturnBlock() {
@@ -168,7 +196,7 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
bool CodeGenFunction::ShouldInstrumentFunction() {
if (!CGM.getCodeGenOpts().InstrumentFunctions)
return false;
- if (CurFuncDecl->hasAttr<NoInstrumentFunctionAttr>())
+ if (!CurFuncDecl || CurFuncDecl->hasAttr<NoInstrumentFunctionAttr>())
return false;
return true;
}
@@ -177,16 +205,12 @@ bool CodeGenFunction::ShouldInstrumentFunction() {
/// instrumentation function with the current function and the call site, if
/// function instrumentation is enabled.
void CodeGenFunction::EmitFunctionInstrumentation(const char *Fn) {
- const llvm::PointerType *PointerTy;
- const llvm::FunctionType *FunctionTy;
- std::vector<const llvm::Type*> ProfileFuncArgs;
-
// void __cyg_profile_func_{enter,exit} (void *this_fn, void *call_site);
- PointerTy = Int8PtrTy;
- ProfileFuncArgs.push_back(PointerTy);
- ProfileFuncArgs.push_back(PointerTy);
- FunctionTy = llvm::FunctionType::get(llvm::Type::getVoidTy(getLLVMContext()),
- ProfileFuncArgs, false);
+ const llvm::PointerType *PointerTy = Int8PtrTy;
+ const llvm::Type *ProfileFuncArgs[] = { PointerTy, PointerTy };
+ const llvm::FunctionType *FunctionTy =
+ llvm::FunctionType::get(llvm::Type::getVoidTy(getLLVMContext()),
+ ProfileFuncArgs, false);
llvm::Constant *F = CGM.CreateRuntimeFunction(FunctionTy, Fn);
llvm::CallInst *CallSite = Builder.CreateCall(
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h
index 169c576..bb8fd8e 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h
@@ -603,6 +603,10 @@ public:
/// exception pointer into this alloca.
llvm::Value *ExceptionSlot;
+ /// The selector slot. Under the MandatoryCleanup model, all
+ /// landing pads write the current selector value into this alloca.
+ llvm::AllocaInst *EHSelectorSlot;
+
/// Emits a landing pad for the current EH stack.
llvm::BasicBlock *EmitLandingPad();
@@ -951,6 +955,10 @@ private:
CGDebugInfo *DebugInfo;
bool DisableDebugInfo;
+ /// DidCallStackSave - Whether llvm.stacksave has been called. Used to avoid
+ /// calling llvm.stacksave for multiple VLAs in the same scope.
+ bool DidCallStackSave;
+
/// IndirectBranch - The first time an indirect goto is seen we create a block
/// with an indirect branch. Every time we see the address of a label taken,
/// we add the label to the indirect goto. Every subsequent indirect goto is
@@ -997,10 +1005,6 @@ private:
// enter/leave scopes.
llvm::DenseMap<const Expr*, llvm::Value*> VLASizeMap;
- /// DidCallStackSave - Whether llvm.stacksave has been called. Used to avoid
- /// calling llvm.stacksave for multiple VLAs in the same scope.
- bool DidCallStackSave;
-
/// A block containing a single 'unreachable' instruction. Created
/// lazily by getUnreachableBlock().
llvm::BasicBlock *UnreachableBlock;
@@ -1035,7 +1039,7 @@ public:
CodeGenFunction(CodeGenModule &cgm);
CodeGenTypes &getTypes() const { return CGM.getTypes(); }
- ASTContext &getContext() const;
+ ASTContext &getContext() const { return CGM.getContext(); }
CGDebugInfo *getDebugInfo() {
if (DisableDebugInfo)
return NULL;
@@ -1050,6 +1054,7 @@ public:
/// Returns a pointer to the function's exception object slot, which
/// is assigned in every landing pad.
llvm::Value *getExceptionSlot();
+ llvm::Value *getEHSelectorSlot();
llvm::Value *getNormalCleanupDestSlot();
llvm::Value *getEHCleanupDestSlot();
@@ -1076,7 +1081,8 @@ public:
void GenerateObjCMethod(const ObjCMethodDecl *OMD);
void StartObjCMethod(const ObjCMethodDecl *MD,
- const ObjCContainerDecl *CD);
+ const ObjCContainerDecl *CD,
+ SourceLocation StartLoc);
/// GenerateObjCGetter - Synthesize an Objective-C property getter function.
void GenerateObjCGetter(ObjCImplementationDecl *IMP,
@@ -1157,6 +1163,9 @@ public:
void GenerateThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo,
GlobalDecl GD, const ThunkInfo &Thunk);
+ void GenerateVarArgsThunk(llvm::Function *Fn, const CGFunctionInfo &FnInfo,
+ GlobalDecl GD, const ThunkInfo &Thunk);
+
void EmitCtorPrologue(const CXXConstructorDecl *CD, CXXCtorType Type,
FunctionArgList &Args);
@@ -1701,6 +1710,7 @@ public:
void EmitObjCAtThrowStmt(const ObjCAtThrowStmt &S);
void EmitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt &S);
+ llvm::Constant *getUnwindResumeFn();
llvm::Constant *getUnwindResumeOrRethrowFn();
void EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock = false);
void ExitCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock = false);
@@ -1915,6 +1925,9 @@ public:
RValue EmitCXXMemberPointerCallExpr(const CXXMemberCallExpr *E,
ReturnValueSlot ReturnValue);
+ llvm::Value *EmitCXXOperatorMemberCallee(const CXXOperatorCallExpr *E,
+ const CXXMethodDecl *MD,
+ llvm::Value *This);
RValue EmitCXXOperatorMemberCallExpr(const CXXOperatorCallExpr *E,
const CXXMethodDecl *MD,
ReturnValueSlot ReturnValue);
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
index 83e927f..7a1a968 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
@@ -90,9 +90,10 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
// Initialize the type cache.
llvm::LLVMContext &LLVMContext = M.getContext();
- Int8Ty = llvm::Type::getInt8Ty(LLVMContext);
- Int32Ty = llvm::Type::getInt32Ty(LLVMContext);
- Int64Ty = llvm::Type::getInt64Ty(LLVMContext);
+ VoidTy = llvm::Type::getVoidTy(LLVMContext);
+ Int8Ty = llvm::Type::getInt8Ty(LLVMContext);
+ Int32Ty = llvm::Type::getInt32Ty(LLVMContext);
+ Int64Ty = llvm::Type::getInt64Ty(LLVMContext);
PointerWidthInBits = C.Target.getPointerWidth(0);
PointerAlignInBytes =
C.toCharUnitsFromBits(C.Target.getPointerAlign(0)).getQuantity();
@@ -132,6 +133,9 @@ void CodeGenModule::Release() {
if (getCodeGenOpts().EmitDeclMetadata)
EmitDeclMetadata();
+
+ if (getCodeGenOpts().EmitGcovArcs || getCodeGenOpts().EmitGcovNotes)
+ EmitCoverageFile();
}
void CodeGenModule::UpdateCompletedType(const TagDecl *TD) {
@@ -339,8 +343,7 @@ void CodeGenModule::AddGlobalDtor(llvm::Function * Dtor, int Priority) {
void CodeGenModule::EmitCtorList(const CtorList &Fns, const char *GlobalName) {
// Ctor function type is void()*.
- llvm::FunctionType* CtorFTy =
- llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext), false);
+ llvm::FunctionType* CtorFTy = llvm::FunctionType::get(VoidTy, false);
llvm::Type *CtorPFTy = llvm::PointerType::getUnqual(CtorFTy);
// Get the type of a ctor entry, { i32, void ()* }.
@@ -449,6 +452,9 @@ void CodeGenModule::SetLLVMFunctionAttributes(const Decl *D,
void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
llvm::Function *F) {
+ if (CodeGenOpts.UnwindTables)
+ F->setHasUWTable();
+
if (!Features.Exceptions && !Features.ObjCNonFragileABI)
F->addFnAttr(llvm::Attribute::NoUnwind);
@@ -724,7 +730,7 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
}
// Forward declarations are emitted lazily on first use.
- if (!FD->isThisDeclarationADefinition())
+ if (!FD->doesThisDeclarationHaveABody())
return;
} else {
const VarDecl *VD = cast<VarDecl>(Global);
@@ -790,14 +796,19 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) {
return;
if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D)) {
+ // Make sure to emit the definition(s) before we emit the thunks.
+ // This is necessary for the generation of certain thunks.
+ if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(Method))
+ EmitCXXConstructor(CD, GD.getCtorType());
+ else if (const CXXDestructorDecl *DD =dyn_cast<CXXDestructorDecl>(Method))
+ EmitCXXDestructor(DD, GD.getDtorType());
+ else
+ EmitGlobalFunctionDefinition(GD);
+
if (Method->isVirtual())
getVTables().EmitThunks(GD);
- if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(Method))
- return EmitCXXConstructor(CD, GD.getCtorType());
-
- if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(Method))
- return EmitCXXDestructor(DD, GD.getDtorType());
+ return;
}
return EmitGlobalFunctionDefinition(GD);
@@ -848,7 +859,7 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName,
if (isa<llvm::FunctionType>(Ty)) {
FTy = cast<llvm::FunctionType>(Ty);
} else {
- FTy = llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext), false);
+ FTy = llvm::FunctionType::get(VoidTy, false);
IsIncompleteFunction = true;
}
@@ -889,7 +900,7 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName,
assert(FD->isUsed() && "Sema didn't mark implicit function as used!");
DeferredDeclsToEmit.push_back(D.getWithDecl(FD));
break;
- } else if (FD->isThisDeclarationADefinition()) {
+ } else if (FD->doesThisDeclarationHaveABody()) {
DeferredDeclsToEmit.push_back(D.getWithDecl(FD));
break;
}
@@ -930,14 +941,19 @@ CodeGenModule::CreateRuntimeFunction(const llvm::FunctionType *FTy,
return GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(), /*ForVTable=*/false);
}
-static bool DeclIsConstantGlobal(ASTContext &Context, const VarDecl *D) {
+static bool DeclIsConstantGlobal(ASTContext &Context, const VarDecl *D,
+ bool ConstantInit) {
if (!D->getType().isConstant(Context) && !D->getType()->isReferenceType())
return false;
- if (Context.getLangOptions().CPlusPlus &&
- Context.getBaseElementType(D->getType())->getAs<RecordType>()) {
- // FIXME: We should do something fancier here!
- return false;
+
+ if (Context.getLangOptions().CPlusPlus) {
+ if (const RecordType *Record
+ = Context.getBaseElementType(D->getType())->getAs<RecordType>())
+ return ConstantInit &&
+ cast<CXXRecordDecl>(Record->getDecl())->isPOD() &&
+ !cast<CXXRecordDecl>(Record->getDecl())->hasMutableFields();
}
+
return true;
}
@@ -994,7 +1010,7 @@ CodeGenModule::GetOrCreateLLVMGlobal(llvm::StringRef MangledName,
if (D) {
// FIXME: This code is overly simple and should be merged with other global
// handling.
- GV->setConstant(DeclIsConstantGlobal(Context, D));
+ GV->setConstant(DeclIsConstantGlobal(Context, D, false));
// Set linkage and visibility in case we never see a definition.
NamedDecl::LinkageInfo LV = D->getLinkageAndVisibility();
@@ -1109,7 +1125,7 @@ void CodeGenModule::EmitVTable(CXXRecordDecl *Class, bool DefinitionRequired) {
llvm::GlobalVariable::LinkageTypes
CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) {
- if (RD->isInAnonymousNamespace() || !RD->hasLinkage())
+ if (RD->getLinkage() != ExternalLinkage)
return llvm::GlobalVariable::InternalLinkage;
if (const CXXMethodDecl *KeyFunction
@@ -1276,7 +1292,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
// If it is safe to mark the global 'constant', do so now.
GV->setConstant(false);
- if (!NonConstInit && DeclIsConstantGlobal(Context, D))
+ if (!NonConstInit && DeclIsConstantGlobal(Context, D, true))
GV->setConstant(true);
GV->setAlignment(getContext().getDeclAlign(D).getQuantity());
@@ -1561,14 +1577,24 @@ llvm::Value *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
"isn't a lib fn");
// Get the name, skip over the __builtin_ prefix (if necessary).
- const char *Name = Context.BuiltinInfo.GetName(BuiltinID);
- if (Context.BuiltinInfo.isLibFunction(BuiltinID))
- Name += 10;
+ llvm::StringRef Name;
+ GlobalDecl D(FD);
+
+ // If the builtin has been declared explicitly with an assembler label,
+ // use the mangled name. This differs from the plain label on platforms
+ // that prefix labels.
+ if (FD->hasAttr<AsmLabelAttr>())
+ Name = getMangledName(D);
+ else if (Context.BuiltinInfo.isLibFunction(BuiltinID))
+ Name = Context.BuiltinInfo.GetName(BuiltinID) + 10;
+ else
+ Name = Context.BuiltinInfo.GetName(BuiltinID);
+
const llvm::FunctionType *Ty =
cast<llvm::FunctionType>(getTypes().ConvertType(FD->getType()));
- return GetOrCreateLLVMFunction(Name, Ty, GlobalDecl(FD), /*ForVTable=*/false);
+ return GetOrCreateLLVMFunction(Name, Ty, D, /*ForVTable=*/false);
}
llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,const llvm::Type **Tys,
@@ -1628,6 +1654,16 @@ GetConstantCFStringEntry(llvm::StringMap<llvm::Constant*> &Map,
return Map.GetOrCreateValue(llvm::StringRef(AsBytes.data(), AsBytes.size()));
}
+static llvm::StringMapEntry<llvm::Constant*> &
+GetConstantStringEntry(llvm::StringMap<llvm::Constant*> &Map,
+ const StringLiteral *Literal,
+ unsigned &StringLength)
+{
+ llvm::StringRef String = Literal->getString();
+ StringLength = String.size();
+ return Map.GetOrCreateValue(String);
+}
+
llvm::Constant *
CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) {
unsigned StringLength = 0;
@@ -1721,11 +1757,8 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) {
llvm::Constant *
CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) {
unsigned StringLength = 0;
- bool isUTF16 = false;
llvm::StringMapEntry<llvm::Constant*> &Entry =
- GetConstantCFStringEntry(CFConstantStringMap, Literal,
- getTargetData().isLittleEndian(),
- isUTF16, StringLength);
+ GetConstantStringEntry(CFConstantStringMap, Literal, StringLength);
if (llvm::Constant *C = Entry.getValue())
return C;
@@ -1738,24 +1771,26 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) {
if (!ConstantStringClassRef) {
std::string StringClass(getLangOptions().ObjCConstantStringClass);
const llvm::Type *Ty = getTypes().ConvertType(getContext().IntTy);
- Ty = llvm::ArrayType::get(Ty, 0);
llvm::Constant *GV;
- if (StringClass.empty())
- GV = CreateRuntimeVariable(Ty,
- Features.ObjCNonFragileABI ?
- "OBJC_CLASS_$_NSConstantString" :
- "_NSConstantStringClassReference");
- else {
- std::string str;
- if (Features.ObjCNonFragileABI)
- str = "OBJC_CLASS_$_" + StringClass;
- else
- str = "_" + StringClass + "ClassReference";
- GV = CreateRuntimeVariable(Ty, str);
+ if (Features.ObjCNonFragileABI) {
+ std::string str =
+ StringClass.empty() ? "OBJC_CLASS_$_NSConstantString"
+ : "OBJC_CLASS_$_" + StringClass;
+ GV = getObjCRuntime().GetClassGlobal(str);
+ // Make sure the result is of the correct type.
+ const llvm::Type *PTy = llvm::PointerType::getUnqual(Ty);
+ ConstantStringClassRef =
+ llvm::ConstantExpr::getBitCast(GV, PTy);
+ } else {
+ std::string str =
+ StringClass.empty() ? "_NSConstantStringClassReference"
+ : "_" + StringClass + "ClassReference";
+ const llvm::Type *PTy = llvm::ArrayType::get(Ty, 0);
+ GV = CreateRuntimeVariable(PTy, str);
+ // Decay array -> ptr
+ ConstantStringClassRef =
+ llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2);
}
- // Decay array -> ptr
- ConstantStringClassRef =
- llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2);
}
QualType NSTy = getContext().getNSConstantStringType();
@@ -1773,28 +1808,15 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) {
llvm::GlobalValue::LinkageTypes Linkage;
bool isConstant;
- if (isUTF16) {
- // FIXME: why do utf strings get "_" labels instead of "L" labels?
- Linkage = llvm::GlobalValue::InternalLinkage;
- // Note: -fwritable-strings doesn't make unicode NSStrings writable, but
- // does make plain ascii ones writable.
- isConstant = true;
- } else {
- Linkage = llvm::GlobalValue::PrivateLinkage;
- isConstant = !Features.WritableStrings;
- }
+ Linkage = llvm::GlobalValue::PrivateLinkage;
+ isConstant = !Features.WritableStrings;
llvm::GlobalVariable *GV =
new llvm::GlobalVariable(getModule(), C->getType(), isConstant, Linkage, C,
".str");
GV->setUnnamedAddr(true);
- if (isUTF16) {
- CharUnits Align = getContext().getTypeAlignInChars(getContext().ShortTy);
- GV->setAlignment(Align.getQuantity());
- } else {
- CharUnits Align = getContext().getTypeAlignInChars(getContext().CharTy);
- GV->setAlignment(Align.getQuantity());
- }
+ CharUnits Align = getContext().getTypeAlignInChars(getContext().CharTy);
+ GV->setAlignment(Align.getQuantity());
Fields[1] = llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2);
// String length.
@@ -1877,6 +1899,7 @@ static llvm::Constant *GenerateStringLiteral(llvm::StringRef str,
new llvm::GlobalVariable(CGM.getModule(), C->getType(), constant,
llvm::GlobalValue::PrivateLinkage,
C, GlobalName);
+ GV->setAlignment(1);
GV->setUnnamedAddr(true);
return GV;
}
@@ -2057,7 +2080,9 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
case Decl::UsingDirective:
case Decl::ClassTemplate:
case Decl::FunctionTemplate:
+ case Decl::TypeAliasTemplate:
case Decl::NamespaceAlias:
+ case Decl::Block:
break;
case Decl::CXXConstructor:
// Skip function templates
@@ -2216,6 +2241,23 @@ void CodeGenFunction::EmitDeclMetadata() {
}
}
+void CodeGenModule::EmitCoverageFile() {
+ if (!getCodeGenOpts().CoverageFile.empty()) {
+ if (llvm::NamedMDNode *CUNode = TheModule.getNamedMetadata("llvm.dbg.cu")) {
+ llvm::NamedMDNode *GCov = TheModule.getOrInsertNamedMetadata("llvm.gcov");
+ llvm::LLVMContext &Ctx = TheModule.getContext();
+ llvm::MDString *CoverageFile =
+ llvm::MDString::get(Ctx, getCodeGenOpts().CoverageFile);
+ for (int i = 0, e = CUNode->getNumOperands(); i != e; ++i) {
+ llvm::MDNode *CU = CUNode->getOperand(i);
+ llvm::Value *node[] = { CoverageFile, CU };
+ llvm::MDNode *N = llvm::MDNode::get(Ctx, node);
+ GCov->addOperand(N);
+ }
+ }
+ }
+}
+
///@name Custom Runtime Function Interfaces
///@{
//
@@ -2234,14 +2276,11 @@ llvm::Constant *CodeGenModule::getBlockObjectDispose() {
}
// Otherwise construct the function by hand.
- const llvm::FunctionType *FTy;
- std::vector<const llvm::Type*> ArgTys;
- const llvm::Type *ResultType = llvm::Type::getVoidTy(VMContext);
- ArgTys.push_back(Int8PtrTy);
- ArgTys.push_back(llvm::Type::getInt32Ty(VMContext));
- FTy = llvm::FunctionType::get(ResultType, ArgTys, false);
+ const llvm::Type *args[] = { Int8PtrTy, Int32Ty };
+ const llvm::FunctionType *fty
+ = llvm::FunctionType::get(VoidTy, args, false);
return BlockObjectDispose =
- CreateRuntimeFunction(FTy, "_Block_object_dispose");
+ CreateRuntimeFunction(fty, "_Block_object_dispose");
}
llvm::Constant *CodeGenModule::getBlockObjectAssign() {
@@ -2256,15 +2295,11 @@ llvm::Constant *CodeGenModule::getBlockObjectAssign() {
}
// Otherwise construct the function by hand.
- const llvm::FunctionType *FTy;
- std::vector<const llvm::Type*> ArgTys;
- const llvm::Type *ResultType = llvm::Type::getVoidTy(VMContext);
- ArgTys.push_back(Int8PtrTy);
- ArgTys.push_back(Int8PtrTy);
- ArgTys.push_back(llvm::Type::getInt32Ty(VMContext));
- FTy = llvm::FunctionType::get(ResultType, ArgTys, false);
+ const llvm::Type *args[] = { Int8PtrTy, Int8PtrTy, Int32Ty };
+ const llvm::FunctionType *fty
+ = llvm::FunctionType::get(VoidTy, args, false);
return BlockObjectAssign =
- CreateRuntimeFunction(FTy, "_Block_object_assign");
+ CreateRuntimeFunction(fty, "_Block_object_assign");
}
llvm::Constant *CodeGenModule::getNSConcreteGlobalBlock() {
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h
index 99c973c..779a352 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h
@@ -97,16 +97,20 @@ namespace CodeGen {
};
struct CodeGenTypeCache {
+ /// void
+ const llvm::Type *VoidTy;
+
/// i8, i32, and i64
const llvm::IntegerType *Int8Ty, *Int32Ty, *Int64Ty;
/// int
const llvm::IntegerType *IntTy;
- /// intptr_t and size_t, which we assume are the same
+ /// intptr_t, size_t, and ptrdiff_t, which we assume are the same size.
union {
const llvm::IntegerType *IntPtrTy;
const llvm::IntegerType *SizeTy;
+ const llvm::IntegerType *PtrDiffTy;
};
/// void* in address space 0
@@ -735,6 +739,10 @@ private:
void EmitDeclMetadata();
+ /// EmitCoverageFile - Emit the llvm.gcov metadata used to tell LLVM where
+ /// to emit the .gcno and .gcda files in a way that persists in .bc files.
+ void EmitCoverageFile();
+
/// MayDeferGeneration - Determine if the given decl can be emitted
/// lazily; this is only relevant for definitions. The given decl
/// must be either a function or var decl.
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h
index dc383cb..ff1eb4c 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h
@@ -220,8 +220,9 @@ public: // These are internal details of CGT that shouldn't be used externally.
/// GetExpandedTypes - Expand the type \arg Ty into the LLVM
/// argument types it would be passed as on the provided vector \arg
/// ArgTys. See ABIArgInfo::Expand.
- void GetExpandedTypes(QualType Ty, std::vector<const llvm::Type*> &ArgTys,
- bool IsRecursive);
+ void GetExpandedTypes(QualType type,
+ llvm::SmallVectorImpl<const llvm::Type*> &expanded,
+ bool isRecursive);
/// IsZeroInitializable - Return whether a type can be
/// zero-initialized (in the C++ sense) with an LLVM zeroinitializer.
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp b/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 33abf3a..12ef9bd 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -1007,11 +1007,9 @@ void ARMCXXABI::ReadArrayCookie(CodeGenFunction &CGF,
static llvm::Constant *getGuardAcquireFn(CodeGenModule &CGM,
const llvm::PointerType *GuardPtrTy) {
// int __cxa_guard_acquire(__guard *guard_object);
-
- std::vector<const llvm::Type*> Args(1, GuardPtrTy);
const llvm::FunctionType *FTy =
llvm::FunctionType::get(CGM.getTypes().ConvertType(CGM.getContext().IntTy),
- Args, /*isVarArg=*/false);
+ GuardPtrTy, /*isVarArg=*/false);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_acquire");
}
@@ -1019,12 +1017,9 @@ static llvm::Constant *getGuardAcquireFn(CodeGenModule &CGM,
static llvm::Constant *getGuardReleaseFn(CodeGenModule &CGM,
const llvm::PointerType *GuardPtrTy) {
// void __cxa_guard_release(__guard *guard_object);
-
- std::vector<const llvm::Type*> Args(1, GuardPtrTy);
-
const llvm::FunctionType *FTy =
llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()),
- Args, /*isVarArg=*/false);
+ GuardPtrTy, /*isVarArg=*/false);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_release");
}
@@ -1032,12 +1027,9 @@ static llvm::Constant *getGuardReleaseFn(CodeGenModule &CGM,
static llvm::Constant *getGuardAbortFn(CodeGenModule &CGM,
const llvm::PointerType *GuardPtrTy) {
// void __cxa_guard_abort(__guard *guard_object);
-
- std::vector<const llvm::Type*> Args(1, GuardPtrTy);
-
const llvm::FunctionType *FTy =
llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()),
- Args, /*isVarArg=*/false);
+ GuardPtrTy, /*isVarArg=*/false);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_abort");
}
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp b/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp
index 8945028..4a2c4abbe 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp
@@ -79,7 +79,7 @@ namespace {
MEnd = D->decls_end();
M != MEnd; ++M)
if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(*M))
- if (Method->isThisDeclarationADefinition() &&
+ if (Method->doesThisDeclarationHaveABody() &&
(Method->hasAttr<UsedAttr>() ||
Method->hasAttr<ConstructorAttr>()))
Builder->EmitTopLevelDecl(Method);
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp b/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp
index bc2472c..043ead7 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp
@@ -648,7 +648,7 @@ ABIArgInfo X86_32ABIInfo::getIndirectResult(QualType Ty, bool ByVal) const {
unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8;
unsigned StackAlign = getTypeStackAlignInBytes(Ty, TypeAlign);
if (StackAlign == 0)
- return ABIArgInfo::getIndirect(0);
+ return ABIArgInfo::getIndirect(4);
// If the stack alignment is less than the type alignment, realign the
// argument.
@@ -1315,13 +1315,10 @@ ABIArgInfo X86_64ABIInfo::getIndirectResult(QualType Ty) const {
if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
return ABIArgInfo::getIndirect(0, /*ByVal=*/false);
- // Compute the byval alignment. We trust the back-end to honor the
- // minimum ABI alignment for byval, to make cleaner IR.
- const unsigned MinABIAlign = 8;
- unsigned Align = getContext().getTypeAlign(Ty) / 8;
- if (Align > MinABIAlign)
- return ABIArgInfo::getIndirect(Align);
- return ABIArgInfo::getIndirect(0);
+ // Compute the byval alignment. We specify the alignment of the byval in all
+ // cases so that the mid-level optimizer knows the alignment of the byval.
+ unsigned Align = std::max(getContext().getTypeAlign(Ty) / 8, 8U);
+ return ABIArgInfo::getIndirect(Align);
}
/// Get16ByteVectorType - The ABI specifies that a value should be passed in an
@@ -2279,6 +2276,22 @@ public:
int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const {
return 13;
}
+
+ bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
+ llvm::Value *Address) const {
+ CodeGen::CGBuilderTy &Builder = CGF.Builder;
+ llvm::LLVMContext &Context = CGF.getLLVMContext();
+
+ const llvm::IntegerType *i8 = llvm::Type::getInt8Ty(Context);
+ llvm::Value *Four8 = llvm::ConstantInt::get(i8, 4);
+
+ // 0-15 are the 16 integer registers.
+ AssignToArrayRange(Builder, Address, Four8, 0, 15);
+
+ return false;
+ }
+
+
};
}
@@ -2845,10 +2858,21 @@ void MSP430TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
//===----------------------------------------------------------------------===//
namespace {
+class MipsABIInfo : public ABIInfo {
+public:
+ MipsABIInfo(CodeGenTypes &CGT) : ABIInfo(CGT) {}
+
+ ABIArgInfo classifyReturnType(QualType RetTy) const;
+ ABIArgInfo classifyArgumentType(QualType RetTy) const;
+ virtual void computeInfo(CGFunctionInfo &FI) const;
+ virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
+ CodeGenFunction &CGF) const;
+};
+
class MIPSTargetCodeGenInfo : public TargetCodeGenInfo {
public:
MIPSTargetCodeGenInfo(CodeGenTypes &CGT)
- : TargetCodeGenInfo(new DefaultABIInfo(CGT)) {}
+ : TargetCodeGenInfo(new MipsABIInfo(CGT)) {}
int getDwarfEHStackPointer(CodeGen::CodeGenModule &CGM) const {
return 29;
@@ -2859,6 +2883,54 @@ public:
};
}
+ABIArgInfo MipsABIInfo::classifyArgumentType(QualType Ty) const {
+ if (isAggregateTypeForABI(Ty)) {
+ // Ignore empty aggregates.
+ if (getContext().getTypeSize(Ty) == 0)
+ return ABIArgInfo::getIgnore();
+
+ return ABIArgInfo::getIndirect(0);
+ }
+
+ // Treat an enum type as its underlying type.
+ if (const EnumType *EnumTy = Ty->getAs<EnumType>())
+ Ty = EnumTy->getDecl()->getIntegerType();
+
+ return (Ty->isPromotableIntegerType() ?
+ ABIArgInfo::getExtend() : ABIArgInfo::getDirect());
+}
+
+ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const {
+ if (RetTy->isVoidType())
+ return ABIArgInfo::getIgnore();
+
+ if (isAggregateTypeForABI(RetTy)) {
+ if (RetTy->isAnyComplexType())
+ return ABIArgInfo::getDirect();
+
+ return ABIArgInfo::getIndirect(0);
+ }
+
+ // Treat an enum type as its underlying type.
+ if (const EnumType *EnumTy = RetTy->getAs<EnumType>())
+ RetTy = EnumTy->getDecl()->getIntegerType();
+
+ return (RetTy->isPromotableIntegerType() ?
+ ABIArgInfo::getExtend() : ABIArgInfo::getDirect());
+}
+
+void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const {
+ FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
+ for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
+ it != ie; ++it)
+ it->info = classifyArgumentType(it->type);
+}
+
+llvm::Value* MipsABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
+ CodeGenFunction &CGF) const {
+ return 0;
+}
+
bool
MIPSTargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
llvm::Value *Address) const {
diff --git a/contrib/llvm/tools/clang/lib/Driver/Driver.cpp b/contrib/llvm/tools/clang/lib/Driver/Driver.cpp
index 302779b..20bc495 100644
--- a/contrib/llvm/tools/clang/lib/Driver/Driver.cpp
+++ b/contrib/llvm/tools/clang/lib/Driver/Driver.cpp
@@ -46,14 +46,14 @@
using namespace clang::driver;
using namespace clang;
-Driver::Driver(llvm::StringRef _ClangExecutable,
- llvm::StringRef _DefaultHostTriple,
- llvm::StringRef _DefaultImageName,
+Driver::Driver(llvm::StringRef ClangExecutable,
+ llvm::StringRef DefaultHostTriple,
+ llvm::StringRef DefaultImageName,
bool IsProduction, bool CXXIsProduction,
- Diagnostic &_Diags)
- : Opts(createDriverOptTable()), Diags(_Diags),
- ClangExecutable(_ClangExecutable), UseStdLib(true),
- DefaultHostTriple(_DefaultHostTriple), DefaultImageName(_DefaultImageName),
+ Diagnostic &Diags)
+ : Opts(createDriverOptTable()), Diags(Diags),
+ ClangExecutable(ClangExecutable), UseStdLib(true),
+ DefaultHostTriple(DefaultHostTriple), DefaultImageName(DefaultImageName),
DriverTitle("clang \"gcc-compatible\" driver"),
Host(0),
CCPrintOptionsFilename(0), CCPrintHeadersFilename(0),
@@ -398,9 +398,10 @@ void Driver::PrintVersion(const Compilation &C, llvm::raw_ostream &OS) const {
/// PrintDiagnosticCategories - Implement the --print-diagnostic-categories
/// option.
static void PrintDiagnosticCategories(llvm::raw_ostream &OS) {
- for (unsigned i = 1; // Skip the empty category.
- const char *CategoryName = DiagnosticIDs::getCategoryNameFromID(i); ++i)
- OS << i << ',' << CategoryName << '\n';
+ // Skip the empty category.
+ for (unsigned i = 1, max = DiagnosticIDs::getNumberOfCategories();
+ i != max; ++i)
+ OS << i << ',' << DiagnosticIDs::getCategoryNameFromID(i) << '\n';
}
bool Driver::HandleImmediateArgs(const Compilation &C) {
@@ -569,14 +570,14 @@ void Driver::PrintActions(const Compilation &C) const {
PrintActions1(C, *it, Ids);
}
-/// \brief Check whether the given input tree contains any compilation (or
-/// assembly) actions.
-static bool ContainsCompileAction(const Action *A) {
+/// \brief Check whether the given input tree contains any compilation or
+/// assembly actions.
+static bool ContainsCompileOrAssembleAction(const Action *A) {
if (isa<CompileJobAction>(A) || isa<AssembleJobAction>(A))
return true;
for (Action::const_iterator it = A->begin(), ie = A->end(); it != ie; ++it)
- if (ContainsCompileAction(*it))
+ if (ContainsCompileOrAssembleAction(*it))
return true;
return false;
@@ -667,7 +668,7 @@ void Driver::BuildUniversalActions(const ToolChain &TC,
Arg *A = Args.getLastArg(options::OPT_g_Group);
if (A && !A->getOption().matches(options::OPT_g0) &&
!A->getOption().matches(options::OPT_gstabs) &&
- ContainsCompileAction(Actions.back())) {
+ ContainsCompileOrAssembleAction(Actions.back())) {
ActionList Inputs;
Inputs.push_back(Actions.back());
Actions.pop_back();
diff --git a/contrib/llvm/tools/clang/lib/Driver/HostInfo.cpp b/contrib/llvm/tools/clang/lib/Driver/HostInfo.cpp
index 198af54..3b1c2c7 100644
--- a/contrib/llvm/tools/clang/lib/Driver/HostInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/Driver/HostInfo.cpp
@@ -414,15 +414,20 @@ ToolChain *NetBSDHostInfo::CreateToolChain(const ArgList &Args,
(A->getOption().matches(options::OPT_m32)) ? "powerpc" : "powerpc64";
}
}
+ llvm::Triple TargetTriple(getTriple());
+ TargetTriple.setArchName(ArchName);
- ToolChain *&TC = ToolChains[ArchName];
- if (!TC) {
- llvm::Triple TCTriple(getTriple());
- TCTriple.setArchName(ArchName);
+ ToolChain *TC;
- TC = new toolchains::NetBSD(*this, TCTriple);
+ // XXX Cache toolchain even if -m32 is used
+ if (Arch == ArchName) {
+ TC = ToolChains[ArchName];
+ if (TC)
+ return TC;
}
+ TC = new toolchains::NetBSD(*this, TargetTriple, getTriple());
+
return TC;
}
diff --git a/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp b/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
index 499587a..2f7bd75 100644
--- a/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
+++ b/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
@@ -9,6 +9,10 @@
#include "ToolChains.h"
+#ifdef HAVE_CLANG_CONFIG_H
+# include "clang/Config/config.h"
+#endif
+
#include "clang/Driver/Arg.h"
#include "clang/Driver/ArgList.h"
#include "clang/Driver/Compilation.h"
@@ -119,7 +123,7 @@ llvm::StringRef Darwin::getDarwinArchName(const ArgList &Args) const {
switch (getTriple().getArch()) {
default:
return getArchName();
-
+
case llvm::Triple::thumb:
case llvm::Triple::arm: {
if (const Arg *A = Args.getLastArg(options::OPT_march_EQ))
@@ -149,10 +153,10 @@ std::string Darwin::ComputeEffectiveClangTriple(const ArgList &Args) const {
// the default triple).
if (!isTargetInitialized())
return Triple.getTriple();
-
+
unsigned Version[3];
getTargetVersion(Version);
-
+
llvm::SmallString<16> Str;
llvm::raw_svector_ostream(Str)
<< (isTargetIPhoneOS() ? "ios" : "macosx")
@@ -562,7 +566,7 @@ void DarwinClang::AddCCKextLibArgs(const ArgList &Args,
P.appendComponent("lib");
P.appendComponent("darwin");
P.appendComponent("libclang_rt.cc_kext.a");
-
+
// For now, allow missing resource libraries to support developers who may
// not have compiler-rt checked out or integrated into their build.
bool Exists;
@@ -628,7 +632,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
DAL->AddSeparateArg(OriginalArg,
Opts.getOption(options::OPT_Zlinker_input),
A->getValue(Args, i));
-
+
}
continue;
}
@@ -919,8 +923,8 @@ TCEToolChain::~TCEToolChain() {
delete it->second;
}
-bool TCEToolChain::IsMathErrnoDefault() const {
- return true;
+bool TCEToolChain::IsMathErrnoDefault() const {
+ return true;
}
bool TCEToolChain::IsUnwindTablesDefault() const {
@@ -935,7 +939,7 @@ const char *TCEToolChain::GetForcedPicModel() const {
return 0;
}
-Tool &TCEToolChain::SelectTool(const Compilation &C,
+Tool &TCEToolChain::SelectTool(const Compilation &C,
const JobAction &JA,
const ActionList &Inputs) const {
Action::ActionClass Key;
@@ -1006,7 +1010,12 @@ FreeBSD::FreeBSD(const HostInfo &Host, const llvm::Triple& Triple)
llvm::Triple(getDriver().DefaultHostTriple).getArch() ==
llvm::Triple::x86_64)
Lib32 = true;
-
+
+ if (Triple.getArch() == llvm::Triple::ppc &&
+ llvm::Triple(getDriver().DefaultHostTriple).getArch() ==
+ llvm::Triple::ppc64)
+ Lib32 = true;
+
if (Lib32) {
getFilePaths().push_back(CLANG_PREFIX "/usr/lib32");
} else {
@@ -1047,14 +1056,14 @@ Tool &FreeBSD::SelectTool(const Compilation &C, const JobAction &JA,
/// NetBSD - NetBSD tool chain which can call as(1) and ld(1) directly.
-NetBSD::NetBSD(const HostInfo &Host, const llvm::Triple& Triple)
- : Generic_ELF(Host, Triple) {
+NetBSD::NetBSD(const HostInfo &Host, const llvm::Triple& Triple,
+ const llvm::Triple& ToolTriple)
+ : Generic_ELF(Host, Triple), ToolTriple(ToolTriple) {
// Determine if we are compiling 32-bit code on an x86_64 platform.
bool Lib32 = false;
- if (Triple.getArch() == llvm::Triple::x86 &&
- llvm::Triple(getDriver().DefaultHostTriple).getArch() ==
- llvm::Triple::x86_64)
+ if (ToolTriple.getArch() == llvm::Triple::x86_64 &&
+ Triple.getArch() == llvm::Triple::x86)
Lib32 = true;
if (getDriver().UseStdLib) {
@@ -1084,10 +1093,11 @@ Tool &NetBSD::SelectTool(const Compilation &C, const JobAction &JA,
if (UseIntegratedAs)
T = new tools::ClangAs(*this);
else
- T = new tools::netbsd::Assemble(*this);
+ T = new tools::netbsd::Assemble(*this, ToolTriple);
break;
case Action::LinkJobClass:
- T = new tools::netbsd::Link(*this); break;
+ T = new tools::netbsd::Link(*this, ToolTriple);
+ break;
default:
T = &Generic_GCC::SelectTool(C, JA, Inputs);
}
@@ -1176,12 +1186,18 @@ enum LinuxDistro {
ArchLinux,
DebianLenny,
DebianSqueeze,
+ DebianWheezy,
Exherbo,
+ RHEL4,
+ RHEL5,
+ RHEL6,
Fedora13,
Fedora14,
Fedora15,
FedoraRawhide,
OpenSuse11_3,
+ OpenSuse11_4,
+ OpenSuse12_1,
UbuntuHardy,
UbuntuIntrepid,
UbuntuJaunty,
@@ -1189,27 +1205,31 @@ enum LinuxDistro {
UbuntuLucid,
UbuntuMaverick,
UbuntuNatty,
+ UbuntuOneiric,
UnknownDistro
};
-static bool IsFedora(enum LinuxDistro Distro) {
+static bool IsRedhat(enum LinuxDistro Distro) {
return Distro == Fedora13 || Distro == Fedora14 ||
- Distro == Fedora15 || Distro == FedoraRawhide;
+ Distro == Fedora15 || Distro == FedoraRawhide ||
+ Distro == RHEL4 || Distro == RHEL5 || Distro == RHEL6;
}
static bool IsOpenSuse(enum LinuxDistro Distro) {
- return Distro == OpenSuse11_3;
+ return Distro == OpenSuse11_3 || Distro == OpenSuse11_4 ||
+ Distro == OpenSuse12_1;
}
static bool IsDebian(enum LinuxDistro Distro) {
- return Distro == DebianLenny || Distro == DebianSqueeze;
+ return Distro == DebianLenny || Distro == DebianSqueeze ||
+ Distro == DebianWheezy;
}
static bool IsUbuntu(enum LinuxDistro Distro) {
return Distro == UbuntuHardy || Distro == UbuntuIntrepid ||
- Distro == UbuntuLucid || Distro == UbuntuMaverick ||
+ Distro == UbuntuLucid || Distro == UbuntuMaverick ||
Distro == UbuntuJaunty || Distro == UbuntuKarmic ||
- Distro == UbuntuNatty;
+ Distro == UbuntuNatty || Distro == UbuntuOneiric;
}
static bool IsDebianBased(enum LinuxDistro Distro) {
@@ -1227,7 +1247,8 @@ static bool HasMultilib(llvm::Triple::ArchType Arch, enum LinuxDistro Distro) {
}
if (Arch == llvm::Triple::ppc64)
return true;
- if ((Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc) && IsDebianBased(Distro))
+ if ((Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc) &&
+ IsDebianBased(Distro))
return true;
return false;
}
@@ -1253,6 +1274,8 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
return UbuntuMaverick;
else if (Lines[i] == "DISTRIB_CODENAME=natty")
return UbuntuNatty;
+ else if (Lines[i] == "DISTRIB_CODENAME=oneiric")
+ return UbuntuOneiric;
}
return UnknownDistro;
}
@@ -1268,6 +1291,17 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
else if (Data.startswith("Fedora release") &&
Data.find("Rawhide") != llvm::StringRef::npos)
return FedoraRawhide;
+ else if (Data.startswith("Red Hat Enterprise Linux") &&
+ Data.find("release 6") != llvm::StringRef::npos)
+ return RHEL6;
+ else if ((Data.startswith("Red Hat Enterprise Linux") ||
+ Data.startswith("CentOS")) &&
+ Data.find("release 5") != llvm::StringRef::npos)
+ return RHEL5;
+ else if ((Data.startswith("Red Hat Enterprise Linux") ||
+ Data.startswith("CentOS")) &&
+ Data.find("release 4") != llvm::StringRef::npos)
+ return RHEL4;
return UnknownDistro;
}
@@ -1277,6 +1311,8 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
return DebianLenny;
else if (Data.startswith("squeeze/sid"))
return DebianSqueeze;
+ else if (Data.startswith("wheezy/sid"))
+ return DebianWheezy;
return UnknownDistro;
}
@@ -1284,6 +1320,10 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
llvm::StringRef Data = File.get()->getBuffer();
if (Data.startswith("openSUSE 11.3"))
return OpenSuse11_3;
+ else if (Data.startswith("openSUSE 11.4"))
+ return OpenSuse11_4;
+ else if (Data.startswith("openSUSE 12.1"))
+ return OpenSuse12_1;
return UnknownDistro;
}
@@ -1297,6 +1337,54 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
return UnknownDistro;
}
+static std::string findGCCBaseLibDir(const std::string &GccTriple) {
+ // FIXME: Using CXX_INCLUDE_ROOT is here is a bit of a hack, but
+ // avoids adding yet another option to configure/cmake.
+ // It would probably be cleaner to break it in two variables
+ // CXX_GCC_ROOT with just /foo/bar
+ // CXX_GCC_VER with 4.5.2
+ // Then we would have
+ // CXX_INCLUDE_ROOT = CXX_GCC_ROOT/include/c++/CXX_GCC_VER
+ // and this function would return
+ // CXX_GCC_ROOT/lib/gcc/CXX_INCLUDE_ARCH/CXX_GCC_VER
+ llvm::SmallString<128> CxxIncludeRoot(CXX_INCLUDE_ROOT);
+ if (CxxIncludeRoot != "") {
+ // This is of the form /foo/bar/include/c++/4.5.2/
+ if (CxxIncludeRoot.back() == '/')
+ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the /
+ llvm::StringRef Version = llvm::sys::path::filename(CxxIncludeRoot);
+ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the version
+ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the c++
+ llvm::sys::path::remove_filename(CxxIncludeRoot); // remove the include
+ std::string ret(CxxIncludeRoot.c_str());
+ ret.append("/lib/gcc/");
+ ret.append(CXX_INCLUDE_ARCH);
+ ret.append("/");
+ ret.append(Version);
+ return ret;
+ }
+ static const char* GccVersions[] = {"4.6.0", "4.6",
+ "4.5.2", "4.5.1", "4.5",
+ "4.4.5", "4.4.4", "4.4.3", "4.4",
+ "4.3.4", "4.3.3", "4.3.2", "4.3",
+ "4.2.4", "4.2.3", "4.2.2", "4.2.1",
+ "4.2", "4.1.1"};
+ bool Exists;
+ for (unsigned i = 0; i < sizeof(GccVersions)/sizeof(char*); ++i) {
+ std::string Suffix = GccTriple + "/" + GccVersions[i];
+ std::string t1 = "/usr/lib/gcc/" + Suffix;
+ if (!llvm::sys::fs::exists(t1 + "/crtbegin.o", Exists) && Exists)
+ return t1;
+ std::string t2 = "/usr/lib64/gcc/" + Suffix;
+ if (!llvm::sys::fs::exists(t2 + "/crtbegin.o", Exists) && Exists)
+ return t2;
+ std::string t3 = "/usr/lib/" + GccTriple + "/gcc/" + Suffix;
+ if (!llvm::sys::fs::exists(t3 + "/crtbegin.o", Exists) && Exists)
+ return t3;
+ }
+ return "";
+}
+
Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
: Generic_ELF(Host, Triple) {
llvm::Triple::ArchType Arch =
@@ -1370,42 +1458,23 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
} else if (Arch == llvm::Triple::ppc) {
if (!llvm::sys::fs::exists("/usr/lib/powerpc-linux-gnu", Exists) && Exists)
GccTriple = "powerpc-linux-gnu";
- else if (!llvm::sys::fs::exists("/usr/lib/gcc/powerpc-unknown-linux-gnu", Exists) && Exists)
+ else if (!llvm::sys::fs::exists("/usr/lib/gcc/powerpc-unknown-linux-gnu",
+ Exists) && Exists)
GccTriple = "powerpc-unknown-linux-gnu";
} else if (Arch == llvm::Triple::ppc64) {
- if (!llvm::sys::fs::exists("/usr/lib/gcc/powerpc64-unknown-linux-gnu", Exists) && Exists)
+ if (!llvm::sys::fs::exists("/usr/lib/gcc/powerpc64-unknown-linux-gnu",
+ Exists) && Exists)
GccTriple = "powerpc64-unknown-linux-gnu";
- else if (!llvm::sys::fs::exists("/usr/lib64/gcc/powerpc64-unknown-linux-gnu", Exists) && Exists)
+ else if (!llvm::sys::fs::exists("/usr/lib64/gcc/"
+ "powerpc64-unknown-linux-gnu", Exists) &&
+ Exists)
GccTriple = "powerpc64-unknown-linux-gnu";
}
- const char* GccVersions[] = {"4.6.0",
- "4.5.2", "4.5.1", "4.5",
- "4.4.5", "4.4.4", "4.4.3", "4.4",
- "4.3.4", "4.3.3", "4.3.2", "4.3",
- "4.2.4", "4.2.3", "4.2.2", "4.2.1", "4.2"};
- std::string Base = "";
- for (unsigned i = 0; i < sizeof(GccVersions)/sizeof(char*); ++i) {
- std::string Suffix = GccTriple + "/" + GccVersions[i];
- std::string t1 = "/usr/lib/gcc/" + Suffix;
- if (!llvm::sys::fs::exists(t1 + "/crtbegin.o", Exists) && Exists) {
- Base = t1;
- break;
- }
- std::string t2 = "/usr/lib64/gcc/" + Suffix;
- if (!llvm::sys::fs::exists(t2 + "/crtbegin.o", Exists) && Exists) {
- Base = t2;
- break;
- }
- std::string t3 = "/usr/lib/" + GccTriple + "/gcc/" + Suffix;
- if (!llvm::sys::fs::exists(t3 + "/crtbegin.o", Exists) && Exists) {
- Base = t3;
- break;
- }
- }
-
+ std::string Base = findGCCBaseLibDir(GccTriple);
path_list &Paths = getFilePaths();
- bool Is32Bits = (getArch() == llvm::Triple::x86 || getArch() == llvm::Triple::ppc);
+ bool Is32Bits = (getArch() == llvm::Triple::x86 ||
+ getArch() == llvm::Triple::ppc);
std::string Suffix;
std::string Lib;
@@ -1426,7 +1495,7 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
LinuxDistro Distro = DetectLinuxDistro(Arch);
- if (IsUbuntu(Distro)) {
+ if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
ExtraOpts.push_back("-z");
ExtraOpts.push_back("relro");
}
@@ -1434,21 +1503,28 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
ExtraOpts.push_back("-X");
- if (IsFedora(Distro) || Distro == UbuntuMaverick || Distro == UbuntuNatty)
+ if (IsRedhat(Distro) || IsOpenSuse(Distro) || Distro == UbuntuMaverick ||
+ Distro == UbuntuNatty || Distro == UbuntuOneiric)
ExtraOpts.push_back("--hash-style=gnu");
- if (IsDebian(Distro) || Distro == UbuntuLucid || Distro == UbuntuJaunty ||
- Distro == UbuntuKarmic)
+ if (IsDebian(Distro) || IsOpenSuse(Distro) || Distro == UbuntuLucid ||
+ Distro == UbuntuJaunty || Distro == UbuntuKarmic)
ExtraOpts.push_back("--hash-style=both");
- if (IsFedora(Distro))
+ if (IsRedhat(Distro))
ExtraOpts.push_back("--no-add-needed");
- if (Distro == DebianSqueeze || IsOpenSuse(Distro) ||
- IsFedora(Distro) || Distro == UbuntuLucid || Distro == UbuntuMaverick ||
- Distro == UbuntuKarmic || Distro == UbuntuNatty)
+ if (Distro == DebianSqueeze || Distro == DebianWheezy ||
+ IsOpenSuse(Distro) ||
+ (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
+ Distro == UbuntuLucid ||
+ Distro == UbuntuMaverick || Distro == UbuntuKarmic ||
+ Distro == UbuntuNatty || Distro == UbuntuOneiric)
ExtraOpts.push_back("--build-id");
+ if (IsOpenSuse(Distro))
+ ExtraOpts.push_back("--enable-new-dtags");
+
if (Distro == ArchLinux)
Lib = "lib";
@@ -1457,9 +1533,14 @@ Linux::Linux(const HostInfo &Host, const llvm::Triple &Triple)
if (IsOpenSuse(Distro) && Is32Bits)
Paths.push_back(Base + "/../../../../" + GccTriple + "/lib/../lib");
Paths.push_back(Base + "/../../../../" + Lib);
- Paths.push_back("/lib/../" + Lib);
- Paths.push_back("/usr/lib/../" + Lib);
}
+
+ // FIXME: This is in here to find crt1.o. It is provided by libc, and
+ // libc (like gcc), can be installed in any directory. Once we are
+ // fetching this from a config file, we should have a libc prefix.
+ Paths.push_back("/lib/../" + Lib);
+ Paths.push_back("/usr/lib/../" + Lib);
+
if (!Suffix.empty())
Paths.push_back(Base);
if (IsOpenSuse(Distro))
diff --git a/contrib/llvm/tools/clang/lib/Driver/ToolChains.h b/contrib/llvm/tools/clang/lib/Driver/ToolChains.h
index 7a1a050..ace9b84 100644
--- a/contrib/llvm/tools/clang/lib/Driver/ToolChains.h
+++ b/contrib/llvm/tools/clang/lib/Driver/ToolChains.h
@@ -308,8 +308,11 @@ public:
};
class LLVM_LIBRARY_VISIBILITY NetBSD : public Generic_ELF {
+ const llvm::Triple ToolTriple;
+
public:
- NetBSD(const HostInfo &Host, const llvm::Triple& Triple);
+ NetBSD(const HostInfo &Host, const llvm::Triple& Triple,
+ const llvm::Triple& ToolTriple);
virtual Tool &SelectTool(const Compilation &C, const JobAction &JA,
const ActionList &Inputs) const;
diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
index 7b78cd5..b7f0f83 100644
--- a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
+++ b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
@@ -47,8 +47,9 @@ using namespace clang::driver::tools;
/// FindTargetProgramPath - Return path of the target specific version of
/// ProgName. If it doesn't exist, return path of ProgName itself.
static std::string FindTargetProgramPath(const ToolChain &TheToolChain,
+ const std::string TripleString,
const char *ProgName) {
- std::string Executable(TheToolChain.getTripleString() + "-" + ProgName);
+ std::string Executable(TripleString + "-" + ProgName);
std::string Path(TheToolChain.GetProgramPath(Executable.c_str()));
if (Path != Executable)
return Path;
@@ -146,6 +147,22 @@ static void AddLinkerInputs(const ToolChain &TC,
}
}
+static void addProfileRT(const ToolChain &TC, const ArgList &Args,
+ ArgStringList &CmdArgs) {
+ if (Args.hasArg(options::OPT_fprofile_arcs) ||
+ Args.hasArg(options::OPT_fprofile_generate) ||
+ Args.hasArg(options::OPT_fcreate_profile) ||
+ Args.hasArg(options::OPT_coverage)) {
+ // GCC links libgcov.a by adding -L<inst>/gcc/lib/gcc/<triple>/<ver> -lgcov
+ // to the link line. We cannot do the same thing because unlike gcov
+ // there is a libprofile_rt.so. We used to use the -l:libprofile_rt.a
+ // syntax, but that is not supported by old linkers.
+ const char *lib = Args.MakeArgString(TC.getDriver().Dir + "/../lib/" +
+ "libprofile_rt.a");
+ CmdArgs.push_back(lib);
+ }
+}
+
void Clang::AddPreprocessingOptions(const Driver &D,
const ArgList &Args,
ArgStringList &CmdArgs,
@@ -428,6 +445,7 @@ static bool isSignedCharDefault(const llvm::Triple &Triple) {
default:
return true;
+ case llvm::Triple::arm:
case llvm::Triple::ppc:
case llvm::Triple::ppc64:
if (Triple.getOS() == llvm::Triple::Darwin)
@@ -652,7 +670,7 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args,
else if (MArch == "r6000")
CmdArgs.push_back("mips2");
else
- CmdArgs.push_back(MArch.str().c_str());
+ CmdArgs.push_back(Args.MakeArgString(MArch));
}
// Select the float ABI as determined by -msoft-float, -mhard-float, and
@@ -761,34 +779,34 @@ void Clang::AddX86TargetArgs(const ArgList &Args,
if (!CPUName) {
// FIXME: Need target hooks.
if (getToolChain().getOS().startswith("darwin")) {
- if (getToolChain().getArchName() == "x86_64")
+ if (getToolChain().getArch() == llvm::Triple::x86_64)
CPUName = "core2";
- else if (getToolChain().getArchName() == "i386")
+ else if (getToolChain().getArch() == llvm::Triple::x86)
CPUName = "yonah";
} else if (getToolChain().getOS().startswith("haiku")) {
- if (getToolChain().getArchName() == "x86_64")
+ if (getToolChain().getArch() == llvm::Triple::x86_64)
CPUName = "x86-64";
- else if (getToolChain().getArchName() == "i386")
+ else if (getToolChain().getArch() == llvm::Triple::x86)
CPUName = "i586";
} else if (getToolChain().getOS().startswith("openbsd")) {
- if (getToolChain().getArchName() == "x86_64")
+ if (getToolChain().getArch() == llvm::Triple::x86_64)
CPUName = "x86-64";
- else if (getToolChain().getArchName() == "i386")
+ else if (getToolChain().getArch() == llvm::Triple::x86)
CPUName = "i486";
} else if (getToolChain().getOS().startswith("freebsd")) {
- if (getToolChain().getArchName() == "x86_64")
+ if (getToolChain().getArch() == llvm::Triple::x86_64)
CPUName = "x86-64";
- else if (getToolChain().getArchName() == "i386")
+ else if (getToolChain().getArch() == llvm::Triple::x86)
CPUName = "i486";
} else if (getToolChain().getOS().startswith("netbsd")) {
- if (getToolChain().getArchName() == "x86_64")
+ if (getToolChain().getArch() == llvm::Triple::x86_64)
CPUName = "x86-64";
- else if (getToolChain().getArchName() == "i386")
+ else if (getToolChain().getArch() == llvm::Triple::x86)
CPUName = "i486";
} else {
- if (getToolChain().getArchName() == "x86_64")
+ if (getToolChain().getArch() == llvm::Triple::x86_64)
CPUName = "x86-64";
- else if (getToolChain().getArchName() == "i386")
+ else if (getToolChain().getArch() == llvm::Triple::x86)
CPUName = "pentium4";
}
}
@@ -907,21 +925,63 @@ static void addExceptionArgs(const ArgList &Args, types::ID InputType,
static bool ShouldDisableCFI(const ArgList &Args,
const ToolChain &TC) {
+ if (TC.getTriple().getOS() == llvm::Triple::Darwin) {
+ // The native darwin assembler doesn't support cfi directives, so
+ // we disable them if we think the .s file will be passed to it.
+
+ // FIXME: Duplicated code with ToolChains.cpp
+ // FIXME: This doesn't belong here, but ideally we will support static soon
+ // anyway.
+ bool HasStatic = (Args.hasArg(options::OPT_mkernel) ||
+ Args.hasArg(options::OPT_static) ||
+ Args.hasArg(options::OPT_fapple_kext));
+ bool IsIADefault = TC.IsIntegratedAssemblerDefault() && !HasStatic;
+ bool UseIntegratedAs = Args.hasFlag(options::OPT_integrated_as,
+ options::OPT_no_integrated_as,
+ IsIADefault);
+ bool UseCFI = Args.hasFlag(options::OPT_fdwarf2_cfi_asm,
+ options::OPT_fno_dwarf2_cfi_asm,
+ UseIntegratedAs);
+ return !UseCFI;
+ }
+
+ // For now we assume that every other assembler support CFI.
+ return false;
+}
+
+/// \brief Check whether the given input tree contains any compilation actions.
+static bool ContainsCompileAction(const Action *A) {
+ if (isa<CompileJobAction>(A))
+ return true;
+
+ for (Action::const_iterator it = A->begin(), ie = A->end(); it != ie; ++it)
+ if (ContainsCompileAction(*it))
+ return true;
- // FIXME: Duplicated code with ToolChains.cpp
- // FIXME: This doesn't belong here, but ideally we will support static soon
- // anyway.
- bool HasStatic = (Args.hasArg(options::OPT_mkernel) ||
- Args.hasArg(options::OPT_static) ||
- Args.hasArg(options::OPT_fapple_kext));
- bool IsIADefault = TC.IsIntegratedAssemblerDefault() && !HasStatic;
- bool UseIntegratedAs = Args.hasFlag(options::OPT_integrated_as,
- options::OPT_no_integrated_as,
- IsIADefault);
- bool UseCFI = Args.hasFlag(options::OPT_fdwarf2_cfi_asm,
- options::OPT_fno_dwarf2_cfi_asm,
- UseIntegratedAs);
- return !UseCFI;
+ return false;
+}
+
+/// \brief Check if -relax-all should be passed to the internal assembler.
+/// This is done by default when compiling non-assembler source with -O0.
+static bool UseRelaxAll(Compilation &C, const ArgList &Args) {
+ bool RelaxDefault = true;
+
+ if (Arg *A = Args.getLastArg(options::OPT_O_Group))
+ RelaxDefault = A->getOption().matches(options::OPT_O0);
+
+ if (RelaxDefault) {
+ RelaxDefault = false;
+ for (ActionList::const_iterator it = C.getActions().begin(),
+ ie = C.getActions().end(); it != ie; ++it) {
+ if (ContainsCompileAction(*it)) {
+ RelaxDefault = true;
+ break;
+ }
+ }
+ }
+
+ return Args.hasFlag(options::OPT_mrelax_all, options::OPT_mno_relax_all,
+ RelaxDefault);
}
void Clang::ConstructJob(Compilation &C, const JobAction &JA,
@@ -959,13 +1019,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
} else if (isa<AssembleJobAction>(JA)) {
CmdArgs.push_back("-emit-obj");
- // At -O0, we use -mrelax-all by default.
- bool IsOpt = false;
- if (Arg *A = Args.getLastArg(options::OPT_O_Group))
- IsOpt = !A->getOption().matches(options::OPT_O0);
- if (Args.hasFlag(options::OPT_mrelax_all,
- options::OPT_mno_relax_all,
- !IsOpt))
+ if (UseRelaxAll(C, Args))
CmdArgs.push_back("-mrelax-all");
// When using an integrated assembler, translate -Wa, and -Xassembler
@@ -983,6 +1037,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// Do nothing, this is the default and we don't support anything else.
} else if (Value == "-L") {
CmdArgs.push_back("-msave-temp-labels");
+ } else if (Value == "--fatal-warnings") {
+ CmdArgs.push_back("-mllvm");
+ CmdArgs.push_back("-fatal-assembler-warnings");
} else {
D.Diag(clang::diag::err_drv_unsupported_option_argument)
<< A->getOption().getName() << Value;
@@ -1303,6 +1360,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.hasArg(options::OPT_coverage))
CmdArgs.push_back("-femit-coverage-data");
+ if (C.getArgs().hasArg(options::OPT_c) ||
+ C.getArgs().hasArg(options::OPT_S)) {
+ if (Output.isFilename()) {
+ CmdArgs.push_back("-coverage-file");
+ CmdArgs.push_back(Args.MakeArgString(Output.getFilename()));
+ }
+ }
+
Args.AddLastArg(CmdArgs, options::OPT_nostdinc);
Args.AddLastArg(CmdArgs, options::OPT_nostdincxx);
Args.AddLastArg(CmdArgs, options::OPT_nobuiltininc);
@@ -1478,6 +1543,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_lax_vector_conversions))
CmdArgs.push_back("-fno-lax-vector-conversions");
+ // -fobjc-infer-related-result-type is the default.
+ if (Args.hasFlag(options::OPT_fobjc_infer_related_result_type,
+ options::OPT_fno_objc_infer_related_result_type,
+ /*Default=*/true))
+ CmdArgs.push_back("-fobjc-infer-related-result-type");
+
// Handle -fobjc-gc and -fobjc-gc-only. They are exclusive, and -fobjc-gc-only
// takes precedence.
const Arg *GCArg = Args.getLastArg(options::OPT_fobjc_gc_only);
@@ -1496,7 +1567,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (Args.getLastArg(options::OPT_fapple_kext))
CmdArgs.push_back("-fapple-kext");
- Args.AddLastArg(CmdArgs, options::OPT_fno_show_column);
Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch);
Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info);
Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_parseable_fixits);
@@ -1547,6 +1617,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(Args.MakeArgString(llvm::Twine(StackProtectorLevel)));
}
+ // Translate -mstackrealign
+ if (Args.hasArg(options::OPT_mstackrealign)) {
+ CmdArgs.push_back("-backend-option");
+ CmdArgs.push_back("-force-align-stack");
+ }
+
// Forward -f options with positive and negative forms; we translate
// these by hand.
@@ -1654,6 +1730,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_gnu_keywords))
A->render(Args, CmdArgs);
+ if (Args.hasFlag(options::OPT_fgnu89_inline,
+ options::OPT_fno_gnu89_inline,
+ false))
+ CmdArgs.push_back("-fgnu89-inline");
+
// -fnext-runtime defaults to on Darwin and when rewriting Objective-C, and is
// -the -cc1 default.
bool NeXTRuntimeIsDefault =
@@ -1816,6 +1897,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(A->getValue(Args));
}
+ if (const Arg *A =
+ Args.getLastArg(options::OPT_fdiagnostics_format_EQ)) {
+ CmdArgs.push_back("-fdiagnostics-format");
+ CmdArgs.push_back(A->getValue(Args));
+ }
+
if (Arg *A = Args.getLastArg(
options::OPT_fdiagnostics_show_note_include_stack,
options::OPT_fno_diagnostics_show_note_include_stack)) {
@@ -1837,6 +1924,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_show_source_location))
CmdArgs.push_back("-fno-show-source-location");
+ if (!Args.hasFlag(options::OPT_fshow_column,
+ options::OPT_fno_show_column,
+ true))
+ CmdArgs.push_back("-fno-show-column");
+
if (!Args.hasFlag(options::OPT_fspell_checking,
options::OPT_fno_spell_checking))
CmdArgs.push_back("-fno-spell-checking");
@@ -2006,13 +2098,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-filetype");
CmdArgs.push_back("obj");
- // At -O0, we use -mrelax-all by default.
- bool IsOpt = false;
- if (Arg *A = Args.getLastArg(options::OPT_O_Group))
- IsOpt = !A->getOption().matches(options::OPT_O0);
- if (Args.hasFlag(options::OPT_mrelax_all,
- options::OPT_mno_relax_all,
- !IsOpt))
+ if (UseRelaxAll(C, Args))
CmdArgs.push_back("-relax-all");
// Ignore explicit -force_cpusubtype_ALL option.
@@ -2894,12 +2980,17 @@ void darwin::Link::AddLinkArgs(Compilation &C,
Args.AddAllArgs(CmdArgs, options::OPT_sub__library);
Args.AddAllArgs(CmdArgs, options::OPT_sub__umbrella);
- Args.AddAllArgsTranslated(CmdArgs, options::OPT_isysroot, "-syslibroot");
- if (getDarwinToolChain().isTargetIPhoneOS()) {
- if (!Args.hasArg(options::OPT_isysroot)) {
- CmdArgs.push_back("-syslibroot");
- CmdArgs.push_back("/Developer/SDKs/Extra");
- }
+ // Give --sysroot= preference, over the Apple specific behavior to also use
+ // --isysroot as the syslibroot.
+ if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ)) {
+ CmdArgs.push_back("-syslibroot");
+ CmdArgs.push_back(A->getValue(Args));
+ } else if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) {
+ CmdArgs.push_back("-syslibroot");
+ CmdArgs.push_back(A->getValue(Args));
+ } else if (getDarwinToolChain().isTargetIPhoneOS()) {
+ CmdArgs.push_back("-syslibroot");
+ CmdArgs.push_back("/Developer/SDKs/Extra");
}
Args.AddLastArg(CmdArgs, options::OPT_twolevel__namespace);
@@ -3060,12 +3151,6 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back(LinkingOutput);
}
- if (Args.hasArg(options::OPT_fprofile_arcs) ||
- Args.hasArg(options::OPT_fprofile_generate) ||
- Args.hasArg(options::OPT_fcreate_profile) ||
- Args.hasArg(options::OPT_coverage))
- CmdArgs.push_back("-lgcov");
-
if (Args.hasArg(options::OPT_fnested_functions))
CmdArgs.push_back("-allow_stack_execute");
@@ -3086,6 +3171,8 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA,
// endfile_spec is empty.
}
+ addProfileRT(getToolChain(), Args, CmdArgs);
+
Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
Args.AddAllArgs(CmdArgs, options::OPT_F);
@@ -3125,14 +3212,14 @@ void darwin::Dsymutil::ConstructJob(Compilation &C, const JobAction &JA,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
+ CmdArgs.push_back("-o");
+ CmdArgs.push_back(Output.getFilename());
+
assert(Inputs.size() == 1 && "Unable to handle multiple inputs.");
const InputInfo &Input = Inputs[0];
assert(Input.isFilename() && "Unexpected dsymutil input.");
CmdArgs.push_back(Input.getFilename());
- CmdArgs.push_back("-o");
- CmdArgs.push_back(Output.getFilename());
-
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("dsymutil"));
C.addCommand(new Command(JA, *this, Exec, CmdArgs));
@@ -3243,6 +3330,8 @@ void auroraux::Link::ConstructJob(Compilation &C, const JobAction &JA,
getToolChain().GetFilePath("crtend.o")));
}
+ addProfileRT(getToolChain(), Args, CmdArgs);
+
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("ld"));
C.addCommand(new Command(JA, *this, Exec, CmdArgs));
@@ -3378,6 +3467,8 @@ void freebsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
if (getToolChain().getArchName() == "i386")
CmdArgs.push_back("--32");
+ if (getToolChain().getArchName() == "powerpc")
+ CmdArgs.push_back("-a32");
// Set byte order explicitly
if (getToolChain().getArchName() == "mips")
@@ -3434,6 +3525,11 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("elf_i386_fbsd");
}
+ if (getToolChain().getArchName() == "powerpc") {
+ CmdArgs.push_back("-m");
+ CmdArgs.push_back("elf32ppc");
+ }
+
if (Output.isFilename()) {
CmdArgs.push_back("-o");
CmdArgs.push_back(Output.getFilename());
@@ -3542,6 +3638,8 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
"crtn.o")));
}
+ addProfileRT(getToolChain(), Args, CmdArgs);
+
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("ld"));
C.addCommand(new Command(JA, *this, Exec, CmdArgs));
@@ -3556,7 +3654,8 @@ void netbsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
// When building 32-bit code on NetBSD/amd64, we have to explicitly
// instruct as in the base system to assemble 32-bit code.
- if (getToolChain().getArchName() == "i386")
+ if (ToolTriple.getArch() == llvm::Triple::x86_64 &&
+ getToolChain().getArch() == llvm::Triple::x86)
CmdArgs.push_back("--32");
@@ -3579,7 +3678,8 @@ void netbsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
}
const char *Exec = Args.MakeArgString(FindTargetProgramPath(getToolChain(),
- "as"));
+ ToolTriple.getTriple(),
+ "as"));
C.addCommand(new Command(JA, *this, Exec, CmdArgs));
}
@@ -3610,7 +3710,8 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
// When building 32-bit code on NetBSD/amd64, we have to explicitly
// instruct ld in the base system to link 32-bit code.
- if (getToolChain().getArchName() == "i386") {
+ if (ToolTriple.getArch() == llvm::Triple::x86_64 &&
+ getToolChain().getArch() == llvm::Triple::x86) {
CmdArgs.push_back("-m");
CmdArgs.push_back("elf_i386");
}
@@ -3657,7 +3758,6 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
}
// FIXME: For some reason GCC passes -lgcc and -lgcc_s before adding
// the default system libraries. Just mimic this for now.
- CmdArgs.push_back("-lgcc");
if (Args.hasArg(options::OPT_static)) {
CmdArgs.push_back("-lgcc_eh");
} else {
@@ -3665,6 +3765,7 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-lgcc_s");
CmdArgs.push_back("--no-as-needed");
}
+ CmdArgs.push_back("-lgcc");
if (Args.hasArg(options::OPT_pthread))
CmdArgs.push_back("-lpthread");
@@ -3692,8 +3793,11 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
"crtn.o")));
}
+ addProfileRT(getToolChain(), Args, CmdArgs);
+
const char *Exec = Args.MakeArgString(FindTargetProgramPath(getToolChain(),
- "ld"));
+ ToolTriple.getTriple(),
+ "ld"));
C.addCommand(new Command(JA, *this, Exec, CmdArgs));
}
@@ -3855,10 +3959,10 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-lm");
}
- if (Args.hasArg(options::OPT_static))
- CmdArgs.push_back("--start-group");
-
if (!Args.hasArg(options::OPT_nostdlib)) {
+ if (Args.hasArg(options::OPT_static))
+ CmdArgs.push_back("--start-group");
+
if (!D.CCCIsCXX)
CmdArgs.push_back("-lgcc");
@@ -3913,6 +4017,8 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA,
}
}
+ addProfileRT(getToolChain(), Args, CmdArgs);
+
if (Args.hasArg(options::OPT_use_gold_plugin)) {
CmdArgs.push_back("-plugin");
std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
@@ -3995,6 +4101,8 @@ void minix::Link::ConstructJob(Compilation &C, const JobAction &JA,
"/usr/gnu/lib/libend.a")));
}
+ addProfileRT(getToolChain(), Args, CmdArgs);
+
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("/usr/gnu/bin/gld"));
C.addCommand(new Command(JA, *this, Exec, CmdArgs));
@@ -4150,6 +4258,8 @@ void dragonfly::Link::ConstructJob(Compilation &C, const JobAction &JA,
getToolChain().GetFilePath("crtn.o")));
}
+ addProfileRT(getToolChain(), Args, CmdArgs);
+
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("ld"));
C.addCommand(new Command(JA, *this, Exec, CmdArgs));
diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.h b/contrib/llvm/tools/clang/lib/Driver/Tools.h
index 93abf75..4a5a7e4 100644
--- a/contrib/llvm/tools/clang/lib/Driver/Tools.h
+++ b/contrib/llvm/tools/clang/lib/Driver/Tools.h
@@ -14,6 +14,7 @@
#include "clang/Driver/Types.h"
#include "clang/Driver/Util.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/Support/Compiler.h"
namespace clang {
@@ -338,9 +339,12 @@ namespace freebsd {
/// netbsd -- Directly call GNU Binutils assembler and linker
namespace netbsd {
class LLVM_LIBRARY_VISIBILITY Assemble : public Tool {
+ private:
+ const llvm::Triple ToolTriple;
+
public:
- Assemble(const ToolChain &TC) : Tool("netbsd::Assemble", "assembler",
- TC) {}
+ Assemble(const ToolChain &TC, const llvm::Triple &ToolTriple)
+ : Tool("netbsd::Assemble", "assembler", TC), ToolTriple(ToolTriple) {}
virtual bool hasIntegratedCPP() const { return false; }
@@ -351,8 +355,12 @@ namespace netbsd {
const char *LinkingOutput) const;
};
class LLVM_LIBRARY_VISIBILITY Link : public Tool {
+ private:
+ const llvm::Triple ToolTriple;
+
public:
- Link(const ToolChain &TC) : Tool("netbsd::Link", "linker", TC) {}
+ Link(const ToolChain &TC, const llvm::Triple &ToolTriple)
+ : Tool("netbsd::Ling", "linker", TC), ToolTriple(ToolTriple) {}
virtual bool hasIntegratedCPP() const { return false; }
diff --git a/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp b/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp
index ecd6ef4..28d312a 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp
@@ -173,7 +173,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
break;
case Decl::Function: {
const FunctionDecl* FD = cast<FunctionDecl>(DC);
- if (FD->isThisDeclarationADefinition())
+ if (FD->doesThisDeclarationHaveABody())
Out << "[function] ";
else
Out << "<function> ";
diff --git a/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp b/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp
index 2a12448..8827116 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp
@@ -102,6 +102,7 @@ ASTUnit::ASTUnit(bool _MainFileIsAST)
ConcurrencyCheckValue(CheckUnlocked),
PreambleRebuildCounter(0), SavedMainFileBuffer(0), PreambleBuffer(0),
ShouldCacheCodeCompletionResults(false),
+ NestedMacroInstantiations(true),
CompletionCacheTopLevelHashValue(0),
PreambleTopLevelHashValue(0),
CurrentTopLevelHashValue(0),
@@ -579,6 +580,11 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
Reader.reset(new ASTReader(AST->getSourceManager(), AST->getFileManager(),
AST->getDiagnostics()));
+
+ // Recover resources if we crash before exiting this method.
+ llvm::CrashRecoveryContextCleanupRegistrar<ASTReader>
+ ReaderCleanup(Reader.get());
+
Reader->setListener(new ASTInfoCollector(LangInfo, HeaderInfo, TargetTriple,
Predefines, Counter));
@@ -633,6 +639,11 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
// AST file as needed.
ASTReader *ReaderPtr = Reader.get();
llvm::OwningPtr<ExternalASTSource> Source(Reader.take());
+
+ // Unregister the cleanup for ASTReader. It will get cleaned up
+ // by the ASTUnit cleanup.
+ ReaderCleanup.unregister();
+
Context.setExternalSource(Source);
// Create an AST consumer, even though it isn't used.
@@ -917,6 +928,8 @@ bool ASTUnit::Parse(llvm::MemoryBuffer *OverrideMainBuffer) {
// If the main file has been overridden due to the use of a preamble,
// make that override happen and introduce the preamble.
PreprocessorOptions &PreprocessorOpts = Clang->getPreprocessorOpts();
+ PreprocessorOpts.DetailedRecordIncludesNestedMacroInstantiations
+ = NestedMacroInstantiations;
std::string PriorImplicitPCHInclude;
if (OverrideMainBuffer) {
PreprocessorOpts.addRemappedFile(OriginalSourceFile, OverrideMainBuffer);
@@ -1554,6 +1567,119 @@ ASTUnit *ASTUnit::create(CompilerInvocation *CI,
return AST.take();
}
+ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(CompilerInvocation *CI,
+ llvm::IntrusiveRefCntPtr<Diagnostic> Diags,
+ ASTFrontendAction *Action) {
+ assert(CI && "A CompilerInvocation is required");
+
+ // Create the AST unit.
+ llvm::OwningPtr<ASTUnit> AST;
+ AST.reset(new ASTUnit(false));
+ ConfigureDiags(Diags, 0, 0, *AST, /*CaptureDiagnostics*/false);
+ AST->Diagnostics = Diags;
+ AST->OnlyLocalDecls = false;
+ AST->CaptureDiagnostics = false;
+ AST->CompleteTranslationUnit = Action ? Action->usesCompleteTranslationUnit()
+ : true;
+ AST->ShouldCacheCodeCompletionResults = false;
+ AST->Invocation = CI;
+
+ // Recover resources if we crash before exiting this method.
+ llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit>
+ ASTUnitCleanup(AST.get());
+ llvm::CrashRecoveryContextCleanupRegistrar<Diagnostic,
+ llvm::CrashRecoveryContextReleaseRefCleanup<Diagnostic> >
+ DiagCleanup(Diags.getPtr());
+
+ // We'll manage file buffers ourselves.
+ CI->getPreprocessorOpts().RetainRemappedFileBuffers = true;
+ CI->getFrontendOpts().DisableFree = false;
+ ProcessWarningOptions(AST->getDiagnostics(), CI->getDiagnosticOpts());
+
+ // Save the target features.
+ AST->TargetFeatures = CI->getTargetOpts().Features;
+
+ // Create the compiler instance to use for building the AST.
+ llvm::OwningPtr<CompilerInstance> Clang(new CompilerInstance());
+
+ // Recover resources if we crash before exiting this method.
+ llvm::CrashRecoveryContextCleanupRegistrar<CompilerInstance>
+ CICleanup(Clang.get());
+
+ Clang->setInvocation(CI);
+ AST->OriginalSourceFile = Clang->getFrontendOpts().Inputs[0].second;
+
+ // Set up diagnostics, capturing any diagnostics that would
+ // otherwise be dropped.
+ Clang->setDiagnostics(&AST->getDiagnostics());
+
+ // Create the target instance.
+ Clang->getTargetOpts().Features = AST->TargetFeatures;
+ Clang->setTarget(TargetInfo::CreateTargetInfo(Clang->getDiagnostics(),
+ Clang->getTargetOpts()));
+ if (!Clang->hasTarget())
+ return 0;
+
+ // Inform the target of the language options.
+ //
+ // FIXME: We shouldn't need to do this, the target should be immutable once
+ // created. This complexity should be lifted elsewhere.
+ Clang->getTarget().setForcedLangOptions(Clang->getLangOpts());
+
+ assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
+ "Invocation must have exactly one source file!");
+ assert(Clang->getFrontendOpts().Inputs[0].first != IK_AST &&
+ "FIXME: AST inputs not yet supported here!");
+ assert(Clang->getFrontendOpts().Inputs[0].first != IK_LLVM_IR &&
+ "IR inputs not supported here!");
+
+ // Configure the various subsystems.
+ AST->FileSystemOpts = Clang->getFileSystemOpts();
+ AST->FileMgr = new FileManager(AST->FileSystemOpts);
+ AST->SourceMgr = new SourceManager(AST->getDiagnostics(), *AST->FileMgr);
+ AST->TheSema.reset();
+ AST->Ctx = 0;
+ AST->PP = 0;
+
+ // Create a file manager object to provide access to and cache the filesystem.
+ Clang->setFileManager(&AST->getFileManager());
+
+ // Create the source manager.
+ Clang->setSourceManager(&AST->getSourceManager());
+
+ ASTFrontendAction *Act = Action;
+
+ llvm::OwningPtr<TopLevelDeclTrackerAction> TrackerAct;
+ if (!Act) {
+ TrackerAct.reset(new TopLevelDeclTrackerAction(*AST));
+ Act = TrackerAct.get();
+ }
+
+ // Recover resources if we crash before exiting this method.
+ llvm::CrashRecoveryContextCleanupRegistrar<TopLevelDeclTrackerAction>
+ ActCleanup(TrackerAct.get());
+
+ if (!Act->BeginSourceFile(*Clang.get(),
+ Clang->getFrontendOpts().Inputs[0].second,
+ Clang->getFrontendOpts().Inputs[0].first))
+ return 0;
+
+ Act->Execute();
+
+ // Steal the created target, context, and preprocessor.
+ AST->TheSema.reset(Clang->takeSema());
+ AST->Consumer.reset(Clang->takeASTConsumer());
+ AST->Ctx = &Clang->getASTContext();
+ AST->PP = &Clang->getPreprocessor();
+ Clang->setSourceManager(0);
+ Clang->setFileManager(0);
+ AST->Target = &Clang->getTarget();
+
+ Act->EndSourceFile();
+
+ return AST.take();
+}
+
bool ASTUnit::LoadFromCompilerInvocation(bool PrecompilePreamble) {
if (!Invocation)
return true;
@@ -1589,7 +1715,8 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
bool CaptureDiagnostics,
bool PrecompilePreamble,
bool CompleteTranslationUnit,
- bool CacheCodeCompletionResults) {
+ bool CacheCodeCompletionResults,
+ bool NestedMacroInstantiations) {
// Create the AST unit.
llvm::OwningPtr<ASTUnit> AST;
AST.reset(new ASTUnit(false));
@@ -1600,6 +1727,7 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocation(CompilerInvocation *CI,
AST->CompleteTranslationUnit = CompleteTranslationUnit;
AST->ShouldCacheCodeCompletionResults = CacheCodeCompletionResults;
AST->Invocation = CI;
+ AST->NestedMacroInstantiations = NestedMacroInstantiations;
// Recover resources if we crash before exiting this method.
llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit>
@@ -1624,7 +1752,8 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
bool CompleteTranslationUnit,
bool CacheCodeCompletionResults,
bool CXXPrecompilePreamble,
- bool CXXChainedPCH) {
+ bool CXXChainedPCH,
+ bool NestedMacroInstantiations) {
if (!Diags.getPtr()) {
// No diagnostics engine was provided, so create our own diagnostics object
// with the default options.
@@ -1691,6 +1820,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
AST->NumStoredDiagnosticsInPreamble = StoredDiagnostics.size();
AST->StoredDiagnostics.swap(StoredDiagnostics);
AST->Invocation = CI;
+ AST->NestedMacroInstantiations = NestedMacroInstantiations;
// Recover resources if we crash before exiting this method.
llvm::CrashRecoveryContextCleanupRegistrar<ASTUnit>
@@ -2142,6 +2272,9 @@ void ASTUnit::CodeComplete(llvm::StringRef File, unsigned Line, unsigned Column,
PreprocessorOpts.PrecompiledPreambleBytes.second = false;
}
+ // Disable the preprocessing record
+ PreprocessorOpts.DetailedRecord = false;
+
llvm::OwningPtr<SyntaxOnlyAction> Act;
Act.reset(new SyntaxOnlyAction);
if (Act->BeginSourceFile(*Clang.get(), Clang->getFrontendOpts().Inputs[0].second,
diff --git a/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp b/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp
index ace3c5a..38fcfe3 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp
@@ -227,7 +227,8 @@ CompilerInstance::createPreprocessor(Diagnostic &Diags,
}
if (PPOpts.DetailedRecord)
- PP->createPreprocessingRecord();
+ PP->createPreprocessingRecord(
+ PPOpts.DetailedRecordIncludesNestedMacroInstantiations);
InitializePreprocessor(*PP, PPOpts, HSOpts, FEOpts);
diff --git a/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp b/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
index 495c6a8..a4a656f 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
@@ -277,6 +277,14 @@ static void DiagnosticOptsToArgs(const DiagnosticOptions &Opts,
Res.push_back("-fdiagnostics-show-category=id");
else if (Opts.ShowCategories == 2)
Res.push_back("-fdiagnostics-show-category=name");
+ switch (Opts.Format) {
+ case DiagnosticOptions::Clang:
+ Res.push_back("-fdiagnostics-format=clang"); break;
+ case DiagnosticOptions::Msvc:
+ Res.push_back("-fdiagnostics-format=msvc"); break;
+ case DiagnosticOptions::Vi:
+ Res.push_back("-fdiagnostics-format=vi"); break;
+ }
if (Opts.ErrorLimit) {
Res.push_back("-ferror-limit");
Res.push_back(llvm::utostr(Opts.ErrorLimit));
@@ -664,6 +672,9 @@ static void LangOptsToArgs(const LangOptions &Opts,
Res.push_back("-fobjc-gc-only");
}
}
+ if (Opts.ObjCInferRelatedResultType)
+ Res.push_back("-fobjc-infer-related-result-type");
+
if (Opts.AppleKext)
Res.push_back("-fapple-kext");
@@ -976,6 +987,7 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.InstrumentForProfiling = Args.hasArg(OPT_pg);
Opts.EmitGcovArcs = Args.hasArg(OPT_femit_coverage_data);
Opts.EmitGcovNotes = Args.hasArg(OPT_femit_coverage_notes);
+ Opts.CoverageFile = Args.getLastArgValue(OPT_coverage_file);
if (Arg *A = Args.getLastArg(OPT_fobjc_dispatch_method_EQ)) {
llvm::StringRef Name = A->getValue(Args);
@@ -1012,7 +1024,9 @@ static void ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
Opts.PedanticErrors = Args.hasArg(OPT_pedantic_errors);
Opts.ShowCarets = !Args.hasArg(OPT_fno_caret_diagnostics);
Opts.ShowColors = Args.hasArg(OPT_fcolor_diagnostics);
- Opts.ShowColumn = !Args.hasArg(OPT_fno_show_column);
+ Opts.ShowColumn = Args.hasFlag(OPT_fshow_column,
+ OPT_fno_show_column,
+ /*Default=*/true);
Opts.ShowFixits = !Args.hasArg(OPT_fno_diagnostics_fixit_info);
Opts.ShowLocation = !Args.hasArg(OPT_fno_show_source_location);
Opts.ShowNames = Args.hasArg(OPT_fdiagnostics_show_name);
@@ -1049,6 +1063,19 @@ static void ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
<< Args.getLastArg(OPT_fdiagnostics_show_category)->getAsString(Args)
<< ShowCategory;
+ llvm::StringRef Format =
+ Args.getLastArgValue(OPT_fdiagnostics_format, "clang");
+ if (Format == "clang")
+ Opts.Format = DiagnosticOptions::Clang;
+ else if (Format == "msvc")
+ Opts.Format = DiagnosticOptions::Msvc;
+ else if (Format == "vi")
+ Opts.Format = DiagnosticOptions::Vi;
+ else
+ Diags.Report(diag::err_drv_invalid_value)
+ << Args.getLastArg(OPT_fdiagnostics_format)->getAsString(Args)
+ << Format;
+
Opts.ShowSourceRanges = Args.hasArg(OPT_fdiagnostics_print_source_range_info);
Opts.ShowParseableFixits = Args.hasArg(OPT_fdiagnostics_parseable_fixits);
Opts.VerifyDiagnostics = Args.hasArg(OPT_verify);
@@ -1399,6 +1426,40 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
if (LangStd == LangStandard::lang_unspecified)
Diags.Report(diag::err_drv_invalid_value)
<< A->getAsString(Args) << A->getValue(Args);
+ else {
+ // Valid standard, check to make sure language and standard are compatable.
+ const LangStandard &Std = LangStandard::getLangStandardForKind(LangStd);
+ switch (IK) {
+ case IK_C:
+ case IK_ObjC:
+ case IK_PreprocessedC:
+ case IK_PreprocessedObjC:
+ if (!(Std.isC89() || Std.isC99()))
+ Diags.Report(diag::err_drv_argument_not_allowed_with)
+ << A->getAsString(Args) << "C/ObjC";
+ break;
+ case IK_CXX:
+ case IK_ObjCXX:
+ case IK_PreprocessedCXX:
+ case IK_PreprocessedObjCXX:
+ if (!Std.isCPlusPlus())
+ Diags.Report(diag::err_drv_argument_not_allowed_with)
+ << A->getAsString(Args) << "C++/ObjC++";
+ break;
+ case IK_OpenCL:
+ if (!Std.isC99())
+ Diags.Report(diag::err_drv_argument_not_allowed_with)
+ << A->getAsString(Args) << "OpenCL";
+ break;
+ case IK_CUDA:
+ if (!Std.isCPlusPlus())
+ Diags.Report(diag::err_drv_argument_not_allowed_with)
+ << A->getAsString(Args) << "CUDA";
+ break;
+ default:
+ break;
+ }
+ }
}
if (const Arg *A = Args.getLastArg(OPT_cl_std_EQ)) {
@@ -1421,11 +1482,17 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
if (Args.hasArg(OPT_fno_operator_names))
Opts.CXXOperatorNames = 0;
+ if (Args.hasArg(OPT_fgnu89_inline))
+ Opts.GNUInline = 1;
+
if (Args.hasArg(OPT_fobjc_gc_only))
Opts.setGCMode(LangOptions::GCOnly);
else if (Args.hasArg(OPT_fobjc_gc))
Opts.setGCMode(LangOptions::HybridGC);
+ if (Args.hasArg(OPT_fobjc_infer_related_result_type))
+ Opts.ObjCInferRelatedResultType = 1;
+
if (Args.hasArg(OPT_fapple_kext)) {
if (!Opts.CPlusPlus)
Diags.Report(diag::warn_c_kext);
diff --git a/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
index 0005f91..42b648a 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
@@ -65,7 +65,7 @@ clang::createInvocationFromCommandLine(llvm::ArrayRef<const char *> ArgList,
// We expect to get back exactly one command job, if we didn't something
// failed.
const driver::JobList &Jobs = C->getJobs();
- if (Jobs.size() != 1 || !isa<driver::Command>(Jobs.begin())) {
+ if (Jobs.size() != 1 || !isa<driver::Command>(*Jobs.begin())) {
llvm::SmallString<256> Msg;
llvm::raw_svector_ostream OS(Msg);
C->PrintJob(OS, C->getJobs(), "; ", true);
diff --git a/contrib/llvm/tools/clang/lib/Frontend/DiagChecker.cpp b/contrib/llvm/tools/clang/lib/Frontend/DiagChecker.cpp
deleted file mode 100644
index 66d7ed7..0000000
--- a/contrib/llvm/tools/clang/lib/Frontend/DiagChecker.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-//===--- DiagChecker.cpp - Diagnostic Checking Functions ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Process the input files and check that the diagnostic messages are expected.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Frontend/Utils.h"
-#include "clang/Frontend/TextDiagnosticBuffer.h"
-#include "clang/Parse/ParseAST.h"
-#include "clang/AST/ASTConsumer.h"
-#include "clang/Basic/SourceManager.h"
-#include "clang/Lex/Preprocessor.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace clang;
-
-typedef TextDiagnosticBuffer::DiagList DiagList;
-typedef TextDiagnosticBuffer::const_iterator const_diag_iterator;
-
-static void EmitError(Preprocessor &PP, SourceLocation Pos, const char *String){
- unsigned ID = PP.getDiagnostics().getCustomDiagID(Diagnostic::Error, String);
- PP.Diag(Pos, ID);
-}
-
-
-// USING THE DIAGNOSTIC CHECKER:
-//
-// Indicating that a line expects an error or a warning is simple. Put a comment
-// on the line that has the diagnostic, use "expected-{error,warning}" to tag
-// if it's an expected error or warning, and place the expected text between {{
-// and }} markers. The full text doesn't have to be included, only enough to
-// ensure that the correct diagnostic was emitted.
-//
-// Here's an example:
-//
-// int A = B; // expected-error {{use of undeclared identifier 'B'}}
-//
-// You can place as many diagnostics on one line as you wish. To make the code
-// more readable, you can use slash-newline to separate out the diagnostics.
-//
-// The simple syntax above allows each specification to match exactly one error.
-// You can use the extended syntax to customize this. The extended syntax is
-// "expected-<type> <n> {{diag text}}", where <type> is one of "error",
-// "warning" or "note", and <n> is a positive integer. This allows the
-// diagnostic to appear as many times as specified. Example:
-//
-// void f(); // expected-note 2 {{previous declaration is here}}
-//
-
-/// FindDiagnostics - Go through the comment and see if it indicates expected
-/// diagnostics. If so, then put them in a diagnostic list.
-///
-static void FindDiagnostics(const char *CommentStart, unsigned CommentLen,
- DiagList &ExpectedDiags,
- Preprocessor &PP, SourceLocation Pos,
- const char *ExpectedStr) {
- const char *CommentEnd = CommentStart+CommentLen;
- unsigned ExpectedStrLen = strlen(ExpectedStr);
-
- // Find all expected-foo diagnostics in the string and add them to
- // ExpectedDiags.
- while (CommentStart != CommentEnd) {
- CommentStart = std::find(CommentStart, CommentEnd, 'e');
- if (unsigned(CommentEnd-CommentStart) < ExpectedStrLen) return;
-
- // If this isn't expected-foo, ignore it.
- if (memcmp(CommentStart, ExpectedStr, ExpectedStrLen)) {
- ++CommentStart;
- continue;
- }
-
- CommentStart += ExpectedStrLen;
-
- // Skip whitespace.
- while (CommentStart != CommentEnd &&
- isspace(CommentStart[0]))
- ++CommentStart;
-
- // Default, if we find the '{' now, is 1 time.
- int Times = 1;
- int Temp = 0;
- // In extended syntax, there could be a digit now.
- while (CommentStart != CommentEnd &&
- CommentStart[0] >= '0' && CommentStart[0] <= '9') {
- Temp *= 10;
- Temp += CommentStart[0] - '0';
- ++CommentStart;
- }
- if (Temp > 0)
- Times = Temp;
-
- // Skip whitespace again.
- while (CommentStart != CommentEnd &&
- isspace(CommentStart[0]))
- ++CommentStart;
-
- // We should have a {{ now.
- if (CommentEnd-CommentStart < 2 ||
- CommentStart[0] != '{' || CommentStart[1] != '{') {
- if (std::find(CommentStart, CommentEnd, '{') != CommentEnd)
- EmitError(PP, Pos, "bogus characters before '{{' in expected string");
- else
- EmitError(PP, Pos, "cannot find start ('{{') of expected string");
- return;
- }
- CommentStart += 2;
-
- // Find the }}.
- const char *ExpectedEnd = CommentStart;
- while (1) {
- ExpectedEnd = std::find(ExpectedEnd, CommentEnd, '}');
- if (CommentEnd-ExpectedEnd < 2) {
- EmitError(PP, Pos, "cannot find end ('}}') of expected string");
- return;
- }
-
- if (ExpectedEnd[1] == '}')
- break;
-
- ++ExpectedEnd; // Skip over singular }'s
- }
-
- std::string Msg(CommentStart, ExpectedEnd);
- std::string::size_type FindPos;
- while ((FindPos = Msg.find("\\n")) != std::string::npos)
- Msg.replace(FindPos, 2, "\n");
- // Add is possibly multiple times.
- for (int i = 0; i < Times; ++i)
- ExpectedDiags.push_back(std::make_pair(Pos, Msg));
-
- CommentStart = ExpectedEnd;
- }
-}
-
-/// FindExpectedDiags - Lex the main source file to find all of the
-// expected errors and warnings.
-static void FindExpectedDiags(Preprocessor &PP,
- DiagList &ExpectedErrors,
- DiagList &ExpectedWarnings,
- DiagList &ExpectedNotes) {
- // Create a raw lexer to pull all the comments out of the main file. We don't
- // want to look in #include'd headers for expected-error strings.
- FileID FID = PP.getSourceManager().getMainFileID();
-
- // Create a lexer to lex all the tokens of the main file in raw mode.
- const llvm::MemoryBuffer *FromFile = PP.getSourceManager().getBuffer(FID);
- Lexer RawLex(FID, FromFile, PP.getSourceManager(), PP.getLangOptions());
-
- // Return comments as tokens, this is how we find expected diagnostics.
- RawLex.SetCommentRetentionState(true);
-
- Token Tok;
- Tok.setKind(tok::comment);
- while (Tok.isNot(tok::eof)) {
- RawLex.Lex(Tok);
- if (!Tok.is(tok::comment)) continue;
-
- std::string Comment = PP.getSpelling(Tok);
- if (Comment.empty()) continue;
-
-
- // Find all expected errors.
- FindDiagnostics(&Comment[0], Comment.size(), ExpectedErrors, PP,
- Tok.getLocation(), "expected-error");
-
- // Find all expected warnings.
- FindDiagnostics(&Comment[0], Comment.size(), ExpectedWarnings, PP,
- Tok.getLocation(), "expected-warning");
-
- // Find all expected notes.
- FindDiagnostics(&Comment[0], Comment.size(), ExpectedNotes, PP,
- Tok.getLocation(), "expected-note");
- };
-}
-
-/// PrintProblem - This takes a diagnostic map of the delta between expected and
-/// seen diagnostics. If there's anything in it, then something unexpected
-/// happened. Print the map out in a nice format and return "true". If the map
-/// is empty and we're not going to print things, then return "false".
-///
-static bool PrintProblem(SourceManager &SourceMgr,
- const_diag_iterator diag_begin,
- const_diag_iterator diag_end,
- const char *Msg) {
- if (diag_begin == diag_end) return false;
-
- llvm::errs() << Msg << "\n";
- for (const_diag_iterator I = diag_begin, E = diag_end; I != E; ++I)
- llvm::errs() << " Line " << SourceMgr.getInstantiationLineNumber(I->first)
- << " " << I->second << "\n";
-
- return true;
-}
-
-/// CompareDiagLists - Compare two diagnostic lists and return the difference
-/// between them.
-///
-static bool CompareDiagLists(SourceManager &SourceMgr,
- const_diag_iterator d1_begin,
- const_diag_iterator d1_end,
- const_diag_iterator d2_begin,
- const_diag_iterator d2_end,
- const char *MsgLeftOnly,
- const char *MsgRightOnly) {
- DiagList LeftOnly;
- DiagList Left(d1_begin, d1_end);
- DiagList Right(d2_begin, d2_end);
-
- for (const_diag_iterator I = Left.begin(), E = Left.end(); I != E; ++I) {
- unsigned LineNo1 = SourceMgr.getInstantiationLineNumber(I->first);
- const std::string &Diag1 = I->second;
-
- DiagList::iterator II, IE;
- for (II = Right.begin(), IE = Right.end(); II != IE; ++II) {
- unsigned LineNo2 = SourceMgr.getInstantiationLineNumber(II->first);
- if (LineNo1 != LineNo2) continue;
-
- const std::string &Diag2 = II->second;
- if (Diag2.find(Diag1) != std::string::npos ||
- Diag1.find(Diag2) != std::string::npos) {
- break;
- }
- }
- if (II == IE) {
- // Not found.
- LeftOnly.push_back(*I);
- } else {
- // Found. The same cannot be found twice.
- Right.erase(II);
- }
- }
- // Now all that's left in Right are those that were not matched.
-
- return PrintProblem(SourceMgr, LeftOnly.begin(), LeftOnly.end(), MsgLeftOnly)
- | PrintProblem(SourceMgr, Right.begin(), Right.end(), MsgRightOnly);
-}
-
-/// CheckResults - This compares the expected results to those that
-/// were actually reported. It emits any discrepencies. Return "true" if there
-/// were problems. Return "false" otherwise.
-///
-static bool CheckResults(Preprocessor &PP,
- const DiagList &ExpectedErrors,
- const DiagList &ExpectedWarnings,
- const DiagList &ExpectedNotes) {
- const DiagnosticClient *DiagClient = PP.getDiagnostics().getClient();
- assert(DiagClient != 0 &&
- "DiagChecker requires a valid TextDiagnosticBuffer");
- const TextDiagnosticBuffer &Diags =
- static_cast<const TextDiagnosticBuffer&>(*DiagClient);
- SourceManager &SourceMgr = PP.getSourceManager();
-
- // We want to capture the delta between what was expected and what was
- // seen.
- //
- // Expected \ Seen - set expected but not seen
- // Seen \ Expected - set seen but not expected
- bool HadProblem = false;
-
- // See if there are error mismatches.
- HadProblem |= CompareDiagLists(SourceMgr,
- ExpectedErrors.begin(), ExpectedErrors.end(),
- Diags.err_begin(), Diags.err_end(),
- "Errors expected but not seen:",
- "Errors seen but not expected:");
-
- // See if there are warning mismatches.
- HadProblem |= CompareDiagLists(SourceMgr,
- ExpectedWarnings.begin(),
- ExpectedWarnings.end(),
- Diags.warn_begin(), Diags.warn_end(),
- "Warnings expected but not seen:",
- "Warnings seen but not expected:");
-
- // See if there are note mismatches.
- HadProblem |= CompareDiagLists(SourceMgr,
- ExpectedNotes.begin(),
- ExpectedNotes.end(),
- Diags.note_begin(), Diags.note_end(),
- "Notes expected but not seen:",
- "Notes seen but not expected:");
-
- return HadProblem;
-}
-
-
-/// CheckDiagnostics - Gather the expected diagnostics and check them.
-bool clang::CheckDiagnostics(Preprocessor &PP) {
- // Gather the set of expected diagnostics.
- DiagList ExpectedErrors, ExpectedWarnings, ExpectedNotes;
- FindExpectedDiags(PP, ExpectedErrors, ExpectedWarnings, ExpectedNotes);
-
- // Check that the expected diagnostics occurred.
- return CheckResults(PP, ExpectedErrors, ExpectedWarnings, ExpectedNotes);
-}
diff --git a/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp b/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
index 3795c65..2e5ad17 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
@@ -567,6 +567,19 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
AddPath(CLANG_PREFIX "/usr/include/clang/" CLANG_VERSION_STRING,
System, false, false, false);
break;
+ case llvm::Triple::Linux:
+ // Generic Debian multiarch support:
+ if (triple.getArch() == llvm::Triple::x86_64) {
+ AddPath("/usr/include/x86_64-linux-gnu", System, false, false, false);
+ AddPath("/usr/include/i686-linux-gnu/64", System, false, false, false);
+ AddPath("/usr/include/i486-linux-gnu/64", System, false, false, false);
+ } else if (triple.getArch() == llvm::Triple::x86) {
+ AddPath("/usr/include/x86_64-linux-gnu/32", System, false, false, false);
+ AddPath("/usr/include/i686-linux-gnu", System, false, false, false);
+ AddPath("/usr/include/i486-linux-gnu", System, false, false, false);
+ } else if (triple.getArch() == llvm::Triple::arm) {
+ AddPath("/usr/include/arm-linux-gnueabi", System, false, false, false);
+ }
default:
break;
}
@@ -659,6 +672,27 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) {
// Debian based distros.
// Note: these distros symlink /usr/include/c++/X.Y.Z -> X.Y
//===------------------------------------------------------------------===//
+
+ // Ubuntu 11.11 "Oneiric Ocelot" -- gcc-4.6.0
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.6",
+ "x86_64-linux-gnu", "32", "", triple);
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.6",
+ "i686-linux-gnu", "", "64", triple);
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.6",
+ "i486-linux-gnu", "", "64", triple);
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.6",
+ "arm-linux-gnueabi", "", "", triple);
+
+ // Ubuntu 11.04 "Natty Narwhal" -- gcc-4.5.2
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5",
+ "x86_64-linux-gnu", "32", "", triple);
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5",
+ "i686-linux-gnu", "", "64", triple);
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5",
+ "i486-linux-gnu", "", "64", triple);
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5",
+ "arm-linux-gnueabi", "", "", triple);
+
// Ubuntu 10.10 "Maverick Meerkat" -- gcc-4.4.5
AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.4",
"i686-linux-gnu", "", "64", triple);
@@ -742,6 +776,13 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) {
"x86_64-redhat-linux", "", "", triple);
AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.2",
"i386-redhat-linux", "", "", triple);
+
+ // RHEL 5
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.1",
+ "x86_64-redhat-linux", "32", "", triple);
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.1.1",
+ "i386-redhat-linux", "", "", triple);
+
//===------------------------------------------------------------------===//
@@ -769,6 +810,11 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) {
AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5",
"x86_64-suse-linux", "", "", triple);
+ // openSUSE 12.1
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.6",
+ "i586-suse-linux", "", "", triple);
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.6",
+ "x86_64-suse-linux", "", "", triple);
// Arch Linux 2008-06-24
AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1",
"i686-pc-linux-gnu", "", "", triple);
@@ -997,6 +1043,8 @@ void InitHeaderSearch::Realize(const LangOptions &Lang) {
if (it->first == Angled)
SearchList.push_back(it->second);
}
+ RemoveDuplicates(SearchList, quoted, Verbose);
+ unsigned angled = SearchList.size();
for (path_iterator it = IncludePath.begin(), ie = IncludePath.end();
it != ie; ++it) {
@@ -1010,10 +1058,10 @@ void InitHeaderSearch::Realize(const LangOptions &Lang) {
SearchList.push_back(it->second);
}
- RemoveDuplicates(SearchList, quoted, Verbose);
+ RemoveDuplicates(SearchList, angled, Verbose);
bool DontSearchCurDir = false; // TODO: set to true if -I- is set?
- Headers.SetSearchPaths(SearchList, quoted, DontSearchCurDir);
+ Headers.SetSearchPaths(SearchList, quoted, angled, DontSearchCurDir);
// If verbose, print the list of directories that will be searched.
if (Verbose) {
diff --git a/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp b/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp
index abe251d..147a8df0 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp
@@ -221,6 +221,40 @@ static void DefineExactWidthIntType(TargetInfo::IntType Ty,
ConstSuffix);
}
+static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
+ const LangOptions &LangOpts,
+ const FrontendOptions &FEOpts,
+ MacroBuilder &Builder) {
+ if (!LangOpts.Microsoft && !LangOpts.TraditionalCPP)
+ Builder.defineMacro("__STDC__");
+ if (LangOpts.Freestanding)
+ Builder.defineMacro("__STDC_HOSTED__", "0");
+ else
+ Builder.defineMacro("__STDC_HOSTED__");
+
+ if (!LangOpts.CPlusPlus) {
+ if (LangOpts.C99)
+ Builder.defineMacro("__STDC_VERSION__", "199901L");
+ else if (!LangOpts.GNUMode && LangOpts.Digraphs)
+ Builder.defineMacro("__STDC_VERSION__", "199409L");
+ } else {
+ if (LangOpts.GNUMode)
+ Builder.defineMacro("__cplusplus");
+ else
+ // C++ [cpp.predefined]p1:
+ // The name_ _cplusplus is defined to the value 199711L when compiling a
+ // C++ translation unit.
+ Builder.defineMacro("__cplusplus", "199711L");
+ }
+
+ if (LangOpts.ObjC1)
+ Builder.defineMacro("__OBJC__");
+
+ // Not "standard" per se, but available even with the -undef flag.
+ if (LangOpts.AsmPreprocessor)
+ Builder.defineMacro("__ASSEMBLER__");
+}
+
static void InitializePredefinedMacros(const TargetInfo &TI,
const LangOptions &LangOpts,
const FrontendOptions &FEOpts,
@@ -256,20 +290,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
// Initialize language-specific preprocessor defines.
- // These should all be defined in the preprocessor according to the
- // current language configuration.
- if (!LangOpts.Microsoft && !LangOpts.TraditionalCPP)
- Builder.defineMacro("__STDC__");
- if (LangOpts.AsmPreprocessor)
- Builder.defineMacro("__ASSEMBLER__");
-
- if (!LangOpts.CPlusPlus) {
- if (LangOpts.C99)
- Builder.defineMacro("__STDC_VERSION__", "199901L");
- else if (!LangOpts.GNUMode && LangOpts.Digraphs)
- Builder.defineMacro("__STDC_VERSION__", "199409L");
- }
-
// Standard conforming mode?
if (!LangOpts.GNUMode)
Builder.defineMacro("__STRICT_ANSI__");
@@ -277,13 +297,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
if (LangOpts.CPlusPlus0x)
Builder.defineMacro("__GXX_EXPERIMENTAL_CXX0X__");
- if (LangOpts.Freestanding)
- Builder.defineMacro("__STDC_HOSTED__", "0");
- else
- Builder.defineMacro("__STDC_HOSTED__");
-
if (LangOpts.ObjC1) {
- Builder.defineMacro("__OBJC__");
if (LangOpts.ObjCNonFragileABI) {
Builder.defineMacro("__OBJC2__");
Builder.defineMacro("OBJC_ZEROCOST_EXCEPTIONS");
@@ -324,13 +338,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
if (LangOpts.CPlusPlus) {
Builder.defineMacro("__GNUG__", "4");
Builder.defineMacro("__GXX_WEAK__");
- if (LangOpts.GNUMode)
- Builder.defineMacro("__cplusplus");
- else
- // C++ [cpp.predefined]p1:
- // The name_ _cplusplusis defined to the value 199711L when compiling a
- // C++ translation unit.
- Builder.defineMacro("__cplusplus", "199711L");
Builder.defineMacro("__private_extern__", "extern");
}
@@ -343,6 +350,8 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
// Since we define wchar_t in C++ mode.
Builder.defineMacro("_WCHAR_T_DEFINED");
Builder.defineMacro("_NATIVE_WCHAR_T_DEFINED");
+ // FIXME: Support Microsoft's __identifier extension in the lexer.
+ Builder.append("#define __identifier(x) x");
Builder.append("class type_info;");
}
@@ -570,6 +579,12 @@ void clang::InitializePreprocessor(Preprocessor &PP,
InitializePredefinedMacros(PP.getTargetInfo(), PP.getLangOptions(),
FEOpts, Builder);
+ // Even with predefines off, some macros are still predefined.
+ // These should all be defined in the preprocessor according to the
+ // current language configuration.
+ InitializeStandardPredefinedMacros(PP.getTargetInfo(), PP.getLangOptions(),
+ FEOpts, Builder);
+
// Add on the predefines from the driver. Wrap in a #line directive to report
// that they come from the command line.
if (!PP.getLangOptions().AsmPreprocessor)
diff --git a/contrib/llvm/tools/clang/lib/Frontend/LogDiagnosticPrinter.cpp b/contrib/llvm/tools/clang/lib/Frontend/LogDiagnosticPrinter.cpp
index 954bad4..78eb1b2 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/LogDiagnosticPrinter.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/LogDiagnosticPrinter.cpp
@@ -99,7 +99,7 @@ void LogDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
DiagnosticClient::HandleDiagnostic(Level, Info);
// Initialize the main file name, if we haven't already fetched it.
- if (MainFilename.empty()) {
+ if (MainFilename.empty() && Info.hasSourceManager()) {
const SourceManager &SM = Info.getSourceManager();
FileID FID = SM.getMainFileID();
if (!FID.isInvalid()) {
@@ -122,7 +122,7 @@ void LogDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
// Set the location information.
DE.Filename = "";
DE.Line = DE.Column = 0;
- if (Info.getLocation().isValid()) {
+ if (Info.getLocation().isValid() && Info.hasSourceManager()) {
const SourceManager &SM = Info.getSourceManager();
PresumedLoc PLoc = SM.getPresumedLoc(Info.getLocation());
diff --git a/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp
index 47c942c..1c47bf7 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -343,7 +343,7 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(Diagnostic::Level Level,
// "included from" lines.
if (LastWarningLoc != PLoc.getIncludeLoc()) {
LastWarningLoc = PLoc.getIncludeLoc();
- PrintIncludeStack(Level, LastWarningLoc, SM);
+ PrintIncludeStack(Diagnostic::Note, LastWarningLoc, SM);
}
if (DiagOpts->ShowLocation) {
@@ -819,16 +819,28 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
if (DiagOpts->ShowColors)
OS.changeColor(savedColor, true);
- // Emit a Visual Studio compatible line number syntax.
- if (LangOpts && LangOpts->Microsoft) {
- OS << PLoc.getFilename() << '(' << LineNo << ')';
- OS << " : ";
- } else {
- OS << PLoc.getFilename() << ':' << LineNo << ':';
- if (DiagOpts->ShowColumn)
- if (unsigned ColNo = PLoc.getColumn())
- OS << ColNo << ':';
+ OS << PLoc.getFilename();
+ switch (DiagOpts->Format) {
+ case DiagnosticOptions::Clang: OS << ':' << LineNo; break;
+ case DiagnosticOptions::Msvc: OS << '(' << LineNo; break;
+ case DiagnosticOptions::Vi: OS << " +" << LineNo; break;
+ }
+ if (DiagOpts->ShowColumn)
+ if (unsigned ColNo = PLoc.getColumn()) {
+ if (DiagOpts->Format == DiagnosticOptions::Msvc) {
+ OS << ',';
+ ColNo--;
+ } else
+ OS << ':';
+ OS << ColNo;
+ }
+ switch (DiagOpts->Format) {
+ case DiagnosticOptions::Clang:
+ case DiagnosticOptions::Vi: OS << ':'; break;
+ case DiagnosticOptions::Msvc: OS << ") : "; break;
}
+
+
if (DiagOpts->ShowSourceRanges && Info.getNumRanges()) {
FileID CaretFileID =
SM.getFileID(SM.getInstantiationLoc(Info.getLocation()));
@@ -927,8 +939,8 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,
OptionName += "-Werror";
}
- if (const char *
- Opt = DiagnosticIDs::getWarningOptionForDiag(Info.getID())) {
+ llvm::StringRef Opt = DiagnosticIDs::getWarningOptionForDiag(Info.getID());
+ if (!Opt.empty()) {
if (!OptionName.empty())
OptionName += ',';
OptionName += "-W";
diff --git a/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp b/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp
index 8cc5616..f12b484 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp
@@ -55,17 +55,14 @@ void clang::ProcessWarningOptions(Diagnostic &Diags,
Diags.setExtensionHandlingBehavior(Diagnostic::Ext_Ignore);
for (unsigned i = 0, e = Opts.Warnings.size(); i != e; ++i) {
- const std::string &Opt = Opts.Warnings[i];
- const char *OptStart = &Opt[0];
- const char *OptEnd = OptStart+Opt.size();
- assert(*OptEnd == 0 && "Expect null termination for lower-bound search");
+ llvm::StringRef Opt = Opts.Warnings[i];
// Check to see if this warning starts with "no-", if so, this is a negative
// form of the option.
bool isPositive = true;
- if (OptEnd-OptStart > 3 && memcmp(OptStart, "no-", 3) == 0) {
+ if (Opt.startswith("no-")) {
isPositive = false;
- OptStart += 3;
+ Opt = Opt.substr(3);
}
// Figure out how this option affects the warning. If -Wfoo, map the
@@ -74,49 +71,47 @@ void clang::ProcessWarningOptions(Diagnostic &Diags,
// -Wsystem-headers is a special case, not driven by the option table. It
// cannot be controlled with -Werror.
- if (OptEnd-OptStart == 14 && memcmp(OptStart, "system-headers", 14) == 0) {
+ if (Opt == "system-headers") {
Diags.setSuppressSystemWarnings(!isPositive);
continue;
}
// -Werror/-Wno-error is a special case, not controlled by the option table.
// It also has the "specifier" form of -Werror=foo and -Werror-foo.
- if (OptEnd-OptStart >= 5 && memcmp(OptStart, "error", 5) == 0) {
- const char *Specifier = 0;
- if (OptEnd-OptStart != 5) { // Specifier must be present.
- if ((OptStart[5] != '=' && OptStart[5] != '-') ||
- OptEnd-OptStart == 6) {
+ if (Opt.startswith("error")) {
+ llvm::StringRef Specifier;
+ if (Opt.size() > 5) { // Specifier must be present.
+ if ((Opt[5] != '=' && Opt[5] != '-') || Opt.size() == 6) {
Diags.Report(diag::warn_unknown_warning_specifier)
- << "-Werror" << ("-W" + Opt);
+ << "-Werror" << ("-W" + Opt.str());
continue;
}
- Specifier = OptStart+6;
+ Specifier = Opt.substr(6);
}
- if (Specifier == 0) {
+ if (Specifier.empty()) {
Diags.setWarningsAsErrors(isPositive);
continue;
}
// -Werror=foo maps foo to Error, -Wno-error=foo maps it to Warning.
Mapping = isPositive ? diag::MAP_ERROR : diag::MAP_WARNING_NO_WERROR;
- OptStart = Specifier;
+ Opt = Specifier;
}
// -Wfatal-errors is yet another special case.
- if (OptEnd-OptStart >= 12 && memcmp(OptStart, "fatal-errors", 12) == 0) {
- const char* Specifier = 0;
- if (OptEnd-OptStart != 12) {
- if ((OptStart[12] != '=' && OptStart[12] != '-') ||
- OptEnd-OptStart == 13) {
+ if (Opt.startswith("fatal-errors")) {
+ llvm::StringRef Specifier;
+ if (Opt.size() != 12) {
+ if ((Opt[12] != '=' && Opt[12] != '-') || Opt.size() == 13) {
Diags.Report(diag::warn_unknown_warning_specifier)
- << "-Wfatal-errors" << ("-W" + Opt);
+ << "-Wfatal-errors" << ("-W" + Opt.str());
continue;
}
- Specifier = OptStart + 13;
+ Specifier = Opt.substr(13);
}
- if (Specifier == 0) {
+ if (Specifier.empty()) {
Diags.setErrorsAsFatal(isPositive);
continue;
}
@@ -124,10 +119,12 @@ void clang::ProcessWarningOptions(Diagnostic &Diags,
// -Wfatal-errors=foo maps foo to Fatal, -Wno-fatal-errors=foo
// maps it to Error.
Mapping = isPositive ? diag::MAP_FATAL : diag::MAP_ERROR_NO_WFATAL;
- OptStart = Specifier;
+ Opt = Specifier;
}
- if (Diags.setDiagnosticGroupMapping(OptStart, Mapping))
- Diags.Report(diag::warn_unknown_warning_option) << ("-W" + Opt);
+ if (Diags.setDiagnosticGroupMapping(Opt, Mapping))
+ Diags.Report(isPositive ? diag::warn_unknown_warning_option :
+ diag::warn_unknown_negative_warning_option)
+ << ("-W" + Opt.str());
}
}
diff --git a/contrib/llvm/tools/clang/lib/Headers/emmintrin.h b/contrib/llvm/tools/clang/lib/Headers/emmintrin.h
index 0c1d730..ee12d3c 100644
--- a/contrib/llvm/tools/clang/lib/Headers/emmintrin.h
+++ b/contrib/llvm/tools/clang/lib/Headers/emmintrin.h
@@ -466,7 +466,10 @@ _mm_loadr_pd(double const *dp)
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
_mm_loadu_pd(double const *dp)
{
- return (__m128d){ dp[0], dp[1] };
+ struct __loadu_pd {
+ __m128d v;
+ } __attribute__((packed, may_alias));
+ return ((struct __loadu_pd*)dp)->v;
}
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
@@ -478,13 +481,13 @@ _mm_load_sd(double const *dp)
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
_mm_loadh_pd(__m128d a, double const *dp)
{
- return __builtin_shufflevector(a, *(__m128d *)dp, 0, 2);
+ return (__m128d){ a[0], *dp };
}
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
_mm_loadl_pd(__m128d a, double const *dp)
{
- return __builtin_shufflevector(a, *(__m128d *)dp, 2, 1);
+ return (__m128d){ *dp, a[1] };
}
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
@@ -1011,7 +1014,10 @@ _mm_load_si128(__m128i const *p)
static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
_mm_loadu_si128(__m128i const *p)
{
- return (__m128i)__builtin_ia32_loaddqu((char const *)p);
+ struct __loadu_si128 {
+ __m128i v;
+ } __attribute__((packed, may_alias));
+ return ((struct __loadu_si128*)p)->v;
}
static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
diff --git a/contrib/llvm/tools/clang/lib/Headers/mmintrin.h b/contrib/llvm/tools/clang/lib/Headers/mmintrin.h
index fefb42f..986870a 100644
--- a/contrib/llvm/tools/clang/lib/Headers/mmintrin.h
+++ b/contrib/llvm/tools/clang/lib/Headers/mmintrin.h
@@ -421,20 +421,20 @@ _mm_set1_pi8(char __b)
}
static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
-_mm_setr_pi32(int __i1, int __i0)
+_mm_setr_pi32(int __i0, int __i1)
{
return _mm_set_pi32(__i1, __i0);
}
static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
-_mm_setr_pi16(short __w3, short __w2, short __w1, short __w0)
+_mm_setr_pi16(short __w0, short __w1, short __w2, short __w3)
{
return _mm_set_pi16(__w3, __w2, __w1, __w0);
}
static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
-_mm_setr_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2,
- char __b1, char __b0)
+_mm_setr_pi8(char __b0, char __b1, char __b2, char __b3, char __b4, char __b5,
+ char __b6, char __b7)
{
return _mm_set_pi8(__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
}
diff --git a/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h b/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h
index 00760ed..50f275d 100644
--- a/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h
+++ b/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h
@@ -539,7 +539,10 @@ _mm_load_ps(const float *p)
static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
_mm_loadu_ps(const float *p)
{
- return (__m128){ p[0], p[1], p[2], p[3] };
+ struct __loadu_ps {
+ __m128 v;
+ } __attribute__((packed, may_alias));
+ return ((struct __loadu_ps*)p)->v;
}
static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
diff --git a/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp b/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp
index bf3f5a8..94790b8 100644
--- a/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp
+++ b/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp
@@ -74,7 +74,7 @@ void CallGraph::addTU(ASTContext& Ctx) {
I != E; ++I) {
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(*I)) {
- if (FD->isThisDeclarationADefinition()) {
+ if (FD->doesThisDeclarationHaveABody()) {
// Set caller's ASTContext.
Entity Ent = Entity::get(FD, Prog);
CallGraphNode *Node = getOrInsertFunction(Ent);
diff --git a/contrib/llvm/tools/clang/lib/Index/Indexer.cpp b/contrib/llvm/tools/clang/lib/Index/Indexer.cpp
index 7f21c4f..ebba43c 100644
--- a/contrib/llvm/tools/clang/lib/Index/Indexer.cpp
+++ b/contrib/llvm/tools/clang/lib/Index/Indexer.cpp
@@ -39,7 +39,7 @@ public:
Decl *D = Ent.getDecl(TU->getASTContext());
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
- if (FD->isThisDeclarationADefinition())
+ if (FD->doesThisDeclarationHaveABody())
DefMap[Ent] = std::make_pair(FD, TU);
}
};
diff --git a/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp b/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp
index 372078c..bb43881 100644
--- a/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp
@@ -37,6 +37,7 @@ ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() {}
HeaderSearch::HeaderSearch(FileManager &FM)
: FileMgr(FM), FrameworkMap(64) {
+ AngledDirIdx = 0;
SystemDirIdx = 0;
NoCurDirSearch = false;
@@ -317,7 +318,7 @@ const FileEntry *HeaderSearch::LookupFile(
CurDir = 0;
// If this is a system #include, ignore the user #include locs.
- unsigned i = isAngled ? SystemDirIdx : 0;
+ unsigned i = isAngled ? AngledDirIdx : 0;
// If this is a #include_next request, start searching after the directory the
// file was found in.
@@ -482,6 +483,21 @@ HeaderFileInfo &HeaderSearch::getFileInfo(const FileEntry *FE) {
return HFI;
}
+bool HeaderSearch::isFileMultipleIncludeGuarded(const FileEntry *File) {
+ // Check if we've ever seen this file as a header.
+ if (File->getUID() >= FileInfo.size())
+ return false;
+
+ // Resolve header file info from the external source, if needed.
+ HeaderFileInfo &HFI = FileInfo[File->getUID()];
+ if (ExternalSource && !HFI.Resolved) {
+ HFI = ExternalSource->GetHeaderFileInfo(File);
+ HFI.Resolved = true;
+ }
+
+ return HFI.isPragmaOnce || HFI.ControllingMacro || HFI.ControllingMacroID;
+}
+
void HeaderSearch::setHeaderFileInfoForUID(HeaderFileInfo HFI, unsigned UID) {
if (UID >= FileInfo.size())
FileInfo.resize(UID+1);
diff --git a/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp b/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp
index 16cc4f8..3b1149c 100644
--- a/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp
@@ -76,7 +76,8 @@ void Lexer::InitLexer(const char *BufStart, const char *BufPtr,
// skip the UTF-8 BOM if it's present.
if (BufferStart == BufferPtr) {
// Determine the size of the BOM.
- size_t BOMLength = llvm::StringSwitch<size_t>(BufferStart)
+ llvm::StringRef Buf(BufferStart, BufferEnd - BufferStart);
+ size_t BOMLength = llvm::StringSwitch<size_t>(Buf)
.StartsWith("\xEF\xBB\xBF", 3) // UTF-8 BOM
.Default(0);
diff --git a/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp b/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp
index 37e7bf4..2c96c4d 100644
--- a/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp
@@ -840,16 +840,27 @@ StringLiteralParser::
StringLiteralParser(const Token *StringToks, unsigned NumStringToks,
Preprocessor &PP, bool Complain)
: SM(PP.getSourceManager()), Features(PP.getLangOptions()),
- Target(PP.getTargetInfo()), Diags(Complain ? &PP.getDiagnostics() : 0) {
+ Target(PP.getTargetInfo()), Diags(Complain ? &PP.getDiagnostics() : 0),
+ MaxTokenLength(0), SizeBound(0), wchar_tByteWidth(0),
+ ResultPtr(ResultBuf.data()), hadError(false), AnyWide(false), Pascal(false) {
init(StringToks, NumStringToks);
}
void StringLiteralParser::init(const Token *StringToks, unsigned NumStringToks){
+ // The literal token may have come from an invalid source location (e.g. due
+ // to a PCH error), in which case the token length will be 0.
+ if (NumStringToks == 0 || StringToks[0].getLength() < 2) {
+ hadError = true;
+ return;
+ }
+
// Scan all of the string portions, remember the max individual token length,
// computing a bound on the concatenated string length, and see whether any
// piece is a wide-string. If any of the string portions is a wide-string
// literal, the result is a wide-string literal [C99 6.4.5p4].
+ assert(NumStringToks && "expected at least one token");
MaxTokenLength = StringToks[0].getLength();
+ assert(StringToks[0].getLength() >= 2 && "literal token is invalid!");
SizeBound = StringToks[0].getLength()-2; // -2 for "".
AnyWide = StringToks[0].is(tok::wide_string_literal);
@@ -858,8 +869,14 @@ void StringLiteralParser::init(const Token *StringToks, unsigned NumStringToks){
// Implement Translation Phase #6: concatenation of string literals
/// (C99 5.1.1.2p1). The common case is only one string fragment.
for (unsigned i = 1; i != NumStringToks; ++i) {
+ if (StringToks[i].getLength() < 2) {
+ hadError = true;
+ return;
+ }
+
// The string could be shorter than this if it needs cleaning, but this is a
// reasonable bound, which is all we need.
+ assert(StringToks[i].getLength() >= 2 && "literal token is invalid!");
SizeBound += StringToks[i].getLength()-2; // -2 for "".
// Remember maximum string piece length.
diff --git a/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp b/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp
index c819011..66d87a1 100644
--- a/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp
@@ -42,6 +42,7 @@ MacroInfo::MacroInfo(const MacroInfo &MI, llvm::BumpPtrAllocator &PPAllocator) {
IsDisabled = MI.IsDisabled;
IsUsed = MI.IsUsed;
IsAllowRedefinitionsWithoutWarning = MI.IsAllowRedefinitionsWithoutWarning;
+ IsWarnIfUnused = MI.IsWarnIfUnused;
ArgumentList = 0;
NumArguments = 0;
setArgumentList(MI.ArgumentList, MI.NumArguments, PPAllocator);
diff --git a/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp b/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp
index af3fa6e..66e44bb 100644
--- a/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp
@@ -323,7 +323,6 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation IfTokenLoc,
// #else directive in a skipping conditional. If not in some other
// skipping conditional, and if #else hasn't already been seen, enter it
// as a non-skipping conditional.
- DiscardUntilEndOfDirective(); // C99 6.10p4.
PPConditionalInfo &CondInfo = CurPPLexer->peekConditionalLevel();
// If this is a #else with a #else before it, report the error.
@@ -339,7 +338,10 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation IfTokenLoc,
// entered, enter the #else block now.
if (!CondInfo.WasSkipping && !CondInfo.FoundNonSkip) {
CondInfo.FoundNonSkip = true;
+ CheckEndOfDirective("else");
break;
+ } else {
+ DiscardUntilEndOfDirective(); // C99 6.10p4.
}
} else if (Sub == "lif") { // "elif".
PPConditionalInfo &CondInfo = CurPPLexer->peekConditionalLevel();
diff --git a/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp b/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp
index d6e0d3a..01cd75f 100644
--- a/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp
@@ -85,6 +85,7 @@ void Preprocessor::RegisterBuiltinMacros() {
// Clang Extensions.
Ident__has_feature = RegisterBuiltinMacro(*this, "__has_feature");
+ Ident__has_extension = RegisterBuiltinMacro(*this, "__has_extension");
Ident__has_builtin = RegisterBuiltinMacro(*this, "__has_builtin");
Ident__has_attribute = RegisterBuiltinMacro(*this, "__has_attribute");
Ident__has_include = RegisterBuiltinMacro(*this, "__has_include");
@@ -525,8 +526,8 @@ static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc,
}
-/// HasFeature - Return true if we recognize and implement the specified feature
-/// specified by the identifier.
+/// HasFeature - Return true if we recognize and implement the feature
+/// specified by the identifier as a standard language feature.
static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
const LangOptions &LangOpts = PP.getLangOptions();
@@ -550,13 +551,17 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("cxx_exceptions", LangOpts.Exceptions)
.Case("cxx_rtti", LangOpts.RTTI)
.Case("enumerator_attributes", true)
- .Case("generic_selections", true)
.Case("objc_nonfragile_abi", LangOpts.ObjCNonFragileABI)
.Case("objc_weak_class", LangOpts.ObjCNonFragileABI)
.Case("ownership_holds", true)
.Case("ownership_returns", true)
.Case("ownership_takes", true)
+ // C1X features
+ .Case("c_generic_selections", LangOpts.C1X)
+ .Case("c_static_assert", LangOpts.C1X)
// C++0x features
+ .Case("cxx_access_control_sfinae", LangOpts.CPlusPlus0x)
+ .Case("cxx_alias_templates", LangOpts.CPlusPlus0x)
.Case("cxx_attributes", LangOpts.CPlusPlus0x)
.Case("cxx_auto_type", LangOpts.CPlusPlus0x)
.Case("cxx_decltype", LangOpts.CPlusPlus0x)
@@ -566,7 +571,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("cxx_inline_namespaces", LangOpts.CPlusPlus0x)
//.Case("cxx_lambdas", false)
.Case("cxx_noexcept", LangOpts.CPlusPlus0x)
- //.Case("cxx_nullptr", false)
+ .Case("cxx_nullptr", LangOpts.CPlusPlus0x)
.Case("cxx_override_control", LangOpts.CPlusPlus0x)
.Case("cxx_range_for", LangOpts.CPlusPlus0x)
.Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus0x)
@@ -591,14 +596,45 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("is_empty", LangOpts.CPlusPlus)
.Case("is_enum", LangOpts.CPlusPlus)
.Case("is_literal", LangOpts.CPlusPlus)
+ .Case("is_standard_layout", LangOpts.CPlusPlus)
.Case("is_pod", LangOpts.CPlusPlus)
.Case("is_polymorphic", LangOpts.CPlusPlus)
.Case("is_trivial", LangOpts.CPlusPlus)
+ .Case("is_trivially_copyable", LangOpts.CPlusPlus)
.Case("is_union", LangOpts.CPlusPlus)
.Case("tls", PP.getTargetInfo().isTLSSupported())
.Default(false);
}
+/// HasExtension - Return true if we recognize and implement the feature
+/// specified by the identifier, either as an extension or a standard language
+/// feature.
+static bool HasExtension(const Preprocessor &PP, const IdentifierInfo *II) {
+ if (HasFeature(PP, II))
+ return true;
+
+ // If the use of an extension results in an error diagnostic, extensions are
+ // effectively unavailable, so just return false here.
+ if (PP.getDiagnostics().getExtensionHandlingBehavior()==Diagnostic::Ext_Error)
+ return false;
+
+ const LangOptions &LangOpts = PP.getLangOptions();
+
+ // Because we inherit the feature list from HasFeature, this string switch
+ // must be less restrictive than HasFeature's.
+ return llvm::StringSwitch<bool>(II->getName())
+ // C1X features supported by other languages as extensions.
+ .Case("c_generic_selections", true)
+ .Case("c_static_assert", true)
+ // C++0x features supported by other languages as extensions.
+ .Case("cxx_deleted_functions", LangOpts.CPlusPlus)
+ .Case("cxx_inline_namespaces", LangOpts.CPlusPlus)
+ .Case("cxx_override_control", LangOpts.CPlusPlus)
+ .Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus)
+ .Case("cxx_rvalue_references", LangOpts.CPlusPlus)
+ .Default(false);
+}
+
/// HasAttribute - Return true if we recognize and implement the attribute
/// specified by the given identifier.
static bool HasAttribute(const IdentifierInfo *II) {
@@ -847,10 +883,11 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
// __COUNTER__ expands to a simple numeric value.
OS << CounterValue++;
Tok.setKind(tok::numeric_constant);
- } else if (II == Ident__has_feature ||
- II == Ident__has_builtin ||
+ } else if (II == Ident__has_feature ||
+ II == Ident__has_extension ||
+ II == Ident__has_builtin ||
II == Ident__has_attribute) {
- // The argument to these two builtins should be a parenthesized identifier.
+ // The argument to these builtins should be a parenthesized identifier.
SourceLocation StartLoc = Tok.getLocation();
bool IsValid = false;
@@ -879,6 +916,8 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
Value = FeatureII->getBuiltinID() != 0;
} else if (II == Ident__has_attribute)
Value = HasAttribute(FeatureII);
+ else if (II == Ident__has_extension)
+ Value = HasExtension(*this, FeatureII);
else {
assert(II == Ident__has_feature && "Must be feature check");
Value = HasFeature(*this, FeatureII);
diff --git a/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp b/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp
index 0c18091..23855d4 100644
--- a/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp
@@ -330,16 +330,16 @@ void Preprocessor::HandlePragmaSystemHeader(Token &SysHeaderTok) {
unsigned FilenameID = SourceMgr.getLineTableFilenameID(PLoc.getFilename(),
FilenameLen);
+ // Notify the client, if desired, that we are in a new source file.
+ if (Callbacks)
+ Callbacks->FileChanged(SysHeaderTok.getLocation(),
+ PPCallbacks::SystemHeaderPragma, SrcMgr::C_System);
+
// Emit a line marker. This will change any source locations from this point
// forward to realize they are in a system header.
// Create a line note with this information.
SourceMgr.AddLineNote(SysHeaderTok.getLocation(), PLoc.getLine(), FilenameID,
false, false, true, false);
-
- // Notify the client, if desired, that we are in a new source file.
- if (Callbacks)
- Callbacks->FileChanged(SysHeaderTok.getLocation(),
- PPCallbacks::SystemHeaderPragma, SrcMgr::C_System);
}
/// HandlePragmaDependency - Handle #pragma GCC dependency "foo" blah.
@@ -824,9 +824,17 @@ struct PragmaDebugHandler : public PragmaHandler {
}
}
+// Disable MSVC warning about runtime stack overflow.
+#ifdef _MSC_VER
+ #pragma warning(disable : 4717)
+#endif
void DebugOverflowStack() {
DebugOverflowStack();
}
+#ifdef _MSC_VER
+ #pragma warning(default : 4717)
+#endif
+
};
/// PragmaDiagnosticHandler - e.g. '#pragma GCC diagnostic ignored "-Wformat"'
@@ -898,8 +906,7 @@ public:
return;
}
- std::string WarningName(Literal.GetString(),
- Literal.GetString()+Literal.GetStringLength());
+ llvm::StringRef WarningName(Literal.GetString(), Literal.GetStringLength());
if (WarningName.size() < 3 || WarningName[0] != '-' ||
WarningName[1] != 'W') {
@@ -908,7 +915,7 @@ public:
return;
}
- if (PP.getDiagnostics().setDiagnosticGroupMapping(WarningName.c_str()+2,
+ if (PP.getDiagnostics().setDiagnosticGroupMapping(WarningName.substr(2),
Map, DiagLoc))
PP.Diag(StrToks[0].getLocation(),
diag::warn_pragma_diagnostic_unknown_warning) << WarningName;
diff --git a/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp b/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp
index 9555611..0c8d948 100644
--- a/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp
@@ -45,8 +45,9 @@ void PreprocessingRecord::MaybeLoadPreallocatedEntities() const {
ExternalSource->ReadPreprocessedEntities();
}
-PreprocessingRecord::PreprocessingRecord()
- : ExternalSource(0), NumPreallocatedEntities(0),
+PreprocessingRecord::PreprocessingRecord(bool IncludeNestedMacroInstantiations)
+ : IncludeNestedMacroInstantiations(IncludeNestedMacroInstantiations),
+ ExternalSource(0), NumPreallocatedEntities(0),
LoadedPreallocatedEntities(false)
{
}
@@ -120,6 +121,9 @@ MacroDefinition *PreprocessingRecord::findMacroDefinition(const MacroInfo *MI) {
}
void PreprocessingRecord::MacroExpands(const Token &Id, const MacroInfo* MI) {
+ if (!IncludeNestedMacroInstantiations && Id.getLocation().isMacroID())
+ return;
+
if (MacroDefinition *Def = findMacroDefinition(MI))
PreprocessedEntities.push_back(
new (*this) MacroInstantiation(Id.getIdentifierInfo(),
diff --git a/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp b/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp
index 31fd667..fdc18f8 100644
--- a/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp
+++ b/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp
@@ -527,10 +527,11 @@ CommentHandler::~CommentHandler() { }
CodeCompletionHandler::~CodeCompletionHandler() { }
-void Preprocessor::createPreprocessingRecord() {
+void Preprocessor::createPreprocessingRecord(
+ bool IncludeNestedMacroInstantiations) {
if (Record)
return;
- Record = new PreprocessingRecord;
+ Record = new PreprocessingRecord(IncludeNestedMacroInstantiations);
addPPCallbacks(Record);
}
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 87e2f34..f5c6998 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -23,10 +23,11 @@ using namespace clang;
/// and store its tokens for parsing after the C++ class is complete.
Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, ParsingDeclarator &D,
const ParsedTemplateInfo &TemplateInfo,
- const VirtSpecifiers& VS) {
+ const VirtSpecifiers& VS, ExprResult& Init) {
assert(D.isFunctionDeclarator() && "This isn't a function declarator!");
- assert((Tok.is(tok::l_brace) || Tok.is(tok::colon) || Tok.is(tok::kw_try)) &&
- "Current token not a '{', ':' or 'try'!");
+ assert((Tok.is(tok::l_brace) || Tok.is(tok::colon) || Tok.is(tok::kw_try) ||
+ Tok.is(tok::equal)) &&
+ "Current token not a '{', ':', '=', or 'try'!");
MultiTemplateParamsArg TemplateParams(Actions,
TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->data() : 0,
@@ -40,13 +41,49 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, ParsingDeclarator &D,
else { // FIXME: pass template information through
FnD = Actions.ActOnCXXMemberDeclarator(getCurScope(), AS, D,
move(TemplateParams), 0,
- VS, 0, /*IsDefinition*/true);
+ VS, Init.release(),
+ /*HasInit=*/false,
+ /*IsDefinition*/true);
}
HandleMemberFunctionDefaultArgs(D, FnD);
D.complete(FnD);
+ if (Tok.is(tok::equal)) {
+ ConsumeToken();
+
+ bool Delete = false;
+ SourceLocation KWLoc;
+ if (Tok.is(tok::kw_delete)) {
+ if (!getLang().CPlusPlus0x)
+ Diag(Tok, diag::warn_deleted_function_accepted_as_extension);
+
+ KWLoc = ConsumeToken();
+ Actions.SetDeclDeleted(FnD, KWLoc);
+ Delete = true;
+ } else if (Tok.is(tok::kw_default)) {
+ if (!getLang().CPlusPlus0x)
+ Diag(Tok, diag::warn_defaulted_function_accepted_as_extension);
+
+ KWLoc = ConsumeToken();
+ Actions.SetDeclDefaulted(FnD, KWLoc);
+ } else {
+ llvm_unreachable("function definition after = not 'delete' or 'default'");
+ }
+
+ if (Tok.is(tok::comma)) {
+ Diag(KWLoc, diag::err_default_delete_in_multiple_declaration)
+ << Delete;
+ SkipUntil(tok::semi);
+ } else {
+ ExpectAndConsume(tok::semi, diag::err_expected_semi_after,
+ Delete ? "delete" : "default", tok::semi);
+ }
+
+ return FnD;
+ }
+
// In delayed template parsing mode, if we are within a class template
// or if we are about to parse function member template then consume
// the tokens and store them for parsing at the end of the translation unit.
@@ -130,8 +167,50 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, ParsingDeclarator &D,
return FnD;
}
+/// ParseCXXNonStaticMemberInitializer - We parsed and verified that the
+/// specified Declarator is a well formed C++ non-static data member
+/// declaration. Now lex its initializer and store its tokens for parsing
+/// after the class is complete.
+void Parser::ParseCXXNonStaticMemberInitializer(Decl *VarD) {
+ assert((Tok.is(tok::l_brace) || Tok.is(tok::equal)) &&
+ "Current token not a '{' or '='!");
+
+ LateParsedMemberInitializer *MI =
+ new LateParsedMemberInitializer(this, VarD);
+ getCurrentClass().LateParsedDeclarations.push_back(MI);
+ CachedTokens &Toks = MI->Toks;
+
+ tok::TokenKind kind = Tok.getKind();
+ if (kind == tok::equal) {
+ Toks.push_back(Tok);
+ ConsumeAnyToken();
+ }
+
+ if (kind == tok::l_brace) {
+ // Begin by storing the '{' token.
+ Toks.push_back(Tok);
+ ConsumeBrace();
+
+ // Consume everything up to (and including) the matching right brace.
+ ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/true);
+ } else {
+ // Consume everything up to (but excluding) the comma or semicolon.
+ ConsumeAndStoreUntil(tok::comma, Toks, /*StopAtSemi=*/true,
+ /*ConsumeFinalToken=*/false);
+ }
+
+ // Store an artificial EOF token to ensure that we don't run off the end of
+ // the initializer when we come to parse it.
+ Token Eof;
+ Eof.startToken();
+ Eof.setKind(tok::eof);
+ Eof.setLocation(Tok.getLocation());
+ Toks.push_back(Eof);
+}
+
Parser::LateParsedDeclaration::~LateParsedDeclaration() {}
void Parser::LateParsedDeclaration::ParseLexedMethodDeclarations() {}
+void Parser::LateParsedDeclaration::ParseLexedMemberInitializers() {}
void Parser::LateParsedDeclaration::ParseLexedMethodDefs() {}
Parser::LateParsedClass::LateParsedClass(Parser *P, ParsingClass *C)
@@ -145,6 +224,10 @@ void Parser::LateParsedClass::ParseLexedMethodDeclarations() {
Self->ParseLexedMethodDeclarations(*Class);
}
+void Parser::LateParsedClass::ParseLexedMemberInitializers() {
+ Self->ParseLexedMemberInitializers(*Class);
+}
+
void Parser::LateParsedClass::ParseLexedMethodDefs() {
Self->ParseLexedMethodDefs(*Class);
}
@@ -157,6 +240,10 @@ void Parser::LexedMethod::ParseLexedMethodDefs() {
Self->ParseLexedMethodDef(*this);
}
+void Parser::LateParsedMemberInitializer::ParseLexedMemberInitializers() {
+ Self->ParseLexedMemberInitializer(*this);
+}
+
/// ParseLexedMethodDeclarations - We finished parsing the member
/// specification of a top (non-nested) C++ class. Now go over the
/// stack of method declarations with some parts for which parsing was
@@ -328,8 +415,70 @@ void Parser::ParseLexedMethodDef(LexedMethod &LM) {
origLoc))
while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof))
ConsumeAnyToken();
+ }
+}
+
+/// ParseLexedMemberInitializers - We finished parsing the member specification
+/// of a top (non-nested) C++ class. Now go over the stack of lexed data member
+/// initializers that were collected during its parsing and parse them all.
+void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
+ bool HasTemplateScope = !Class.TopLevelClass && Class.TemplateScope;
+ ParseScope ClassTemplateScope(this, Scope::TemplateParamScope,
+ HasTemplateScope);
+ if (HasTemplateScope)
+ Actions.ActOnReenterTemplateScope(getCurScope(), Class.TagOrTemplate);
+ // Set or update the scope flags to include Scope::ThisScope.
+ bool AlreadyHasClassScope = Class.TopLevelClass;
+ unsigned ScopeFlags = Scope::ClassScope|Scope::DeclScope|Scope::ThisScope;
+ ParseScope ClassScope(this, ScopeFlags, !AlreadyHasClassScope);
+ ParseScopeFlags ClassScopeFlags(this, ScopeFlags, AlreadyHasClassScope);
+
+ if (!AlreadyHasClassScope)
+ Actions.ActOnStartDelayedMemberDeclarations(getCurScope(),
+ Class.TagOrTemplate);
+
+ for (size_t i = 0; i < Class.LateParsedDeclarations.size(); ++i) {
+ Class.LateParsedDeclarations[i]->ParseLexedMemberInitializers();
}
+
+ if (!AlreadyHasClassScope)
+ Actions.ActOnFinishDelayedMemberDeclarations(getCurScope(),
+ Class.TagOrTemplate);
+
+ Actions.ActOnFinishDelayedMemberInitializers(Class.TagOrTemplate);
+}
+
+void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
+ if (MI.Field->isInvalidDecl())
+ return;
+
+ // Append the current token at the end of the new token stream so that it
+ // doesn't get lost.
+ MI.Toks.push_back(Tok);
+ PP.EnterTokenStream(MI.Toks.data(), MI.Toks.size(), true, false);
+
+ // Consume the previously pushed token.
+ ConsumeAnyToken();
+
+ SourceLocation EqualLoc;
+ ExprResult Init = ParseCXXMemberInitializer(/*IsFunction=*/false, EqualLoc);
+
+ Actions.ActOnCXXInClassMemberInitializer(MI.Field, EqualLoc, Init.release());
+
+ // The next token should be our artificial terminating EOF token.
+ if (Tok.isNot(tok::eof)) {
+ SourceLocation EndLoc = PP.getLocForEndOfToken(PrevTokLocation);
+ if (!EndLoc.isValid())
+ EndLoc = Tok.getLocation();
+ // No fixit; we can't recover as if there were a semicolon here.
+ Diag(EndLoc, diag::err_expected_semi_decl_list);
+
+ // Consume tokens until we hit the artificial EOF.
+ while (Tok.isNot(tok::eof))
+ ConsumeAnyToken();
+ }
+ ConsumeAnyToken();
}
/// ConsumeAndStoreUntil - Consume and store the token at the passed token
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp
index a20e90b..ad3fcfe 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp
@@ -253,9 +253,17 @@ void Parser::ParseMicrosoftDeclSpec(ParsedAttributes &attrs) {
SkipUntil(tok::r_paren, true); // skip until ) or ;
return;
}
+
while (Tok.getIdentifierInfo()) {
IdentifierInfo *AttrName = Tok.getIdentifierInfo();
SourceLocation AttrNameLoc = ConsumeToken();
+
+ // FIXME: Remove this when we have proper __declspec(property()) support.
+ // Just skip everything inside property().
+ if (AttrName->getName() == "property") {
+ ConsumeParen();
+ SkipUntil(tok::r_paren);
+ }
if (Tok.is(tok::l_paren)) {
ConsumeParen();
// FIXME: This doesn't parse __declspec(property(get=get_func_name))
@@ -806,8 +814,10 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS,
// analyzed.
if (FRI && Tok.is(tok::colon)) {
FRI->ColonLoc = ConsumeToken();
- // FIXME: handle braced-init-list here.
- FRI->RangeExpr = ParseExpression();
+ if (Tok.is(tok::l_brace))
+ FRI->RangeExpr = ParseBraceInitializer();
+ else
+ FRI->RangeExpr = ParseExpression();
Decl *ThisDecl = Actions.ActOnDeclarator(getCurScope(), D);
Actions.ActOnCXXForRangeDecl(ThisDecl);
Actions.FinalizeDeclaration(ThisDecl);
@@ -906,6 +916,7 @@ bool Parser::ParseAttributesAfterDeclarator(Declarator &D) {
/// [C++] '(' expression-list ')'
/// [C++0x] '=' 'default' [TODO]
/// [C++0x] '=' 'delete'
+/// [C++0x] braced-init-list
///
/// According to the standard grammar, =default and =delete are function
/// definitions, but that definitely doesn't fit with the parser here.
@@ -960,12 +971,17 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
diag::err_invalid_equalequal_after_declarator)) {
ConsumeToken();
if (Tok.is(tok::kw_delete)) {
- SourceLocation DelLoc = ConsumeToken();
-
- if (!getLang().CPlusPlus0x)
- Diag(DelLoc, diag::warn_deleted_function_accepted_as_extension);
-
- Actions.SetDeclDeleted(ThisDecl, DelLoc);
+ if (D.isFunctionDeclarator())
+ Diag(ConsumeToken(), diag::err_default_delete_in_multiple_declaration)
+ << 1 /* delete */;
+ else
+ Diag(ConsumeToken(), diag::err_deleted_non_function);
+ } else if (Tok.is(tok::kw_default)) {
+ if (D.isFunctionDeclarator())
+ Diag(Tok, diag::err_default_delete_in_multiple_declaration)
+ << 1 /* delete */;
+ else
+ Diag(ConsumeToken(), diag::err_default_special_members);
} else {
if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) {
EnterScope(0);
@@ -1028,6 +1044,26 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
RParenLoc,
TypeContainsAuto);
}
+ } else if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
+ // Parse C++0x braced-init-list.
+ if (D.getCXXScopeSpec().isSet()) {
+ EnterScope(0);
+ Actions.ActOnCXXEnterDeclInitializer(getCurScope(), ThisDecl);
+ }
+
+ ExprResult Init(ParseBraceInitializer());
+
+ if (D.getCXXScopeSpec().isSet()) {
+ Actions.ActOnCXXExitDeclInitializer(getCurScope(), ThisDecl);
+ ExitScope();
+ }
+
+ if (Init.isInvalid()) {
+ Actions.ActOnInitializerError(ThisDecl);
+ } else
+ Actions.AddInitializerToDecl(ThisDecl, Init.take(),
+ /*DirectInit=*/true, TypeContainsAuto);
+
} else {
Actions.ActOnUninitializedDecl(ThisDecl, TypeContainsAuto);
}
@@ -1846,6 +1882,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
ParseDecltypeSpecifier(DS);
continue;
+ case tok::kw___underlying_type:
+ ParseUnderlyingTypeSpecifier(DS);
+
// OpenCL qualifiers:
case tok::kw_private:
if (!getLang().OpenCL)
@@ -2116,6 +2155,11 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid,
ParseDecltypeSpecifier(DS);
return true;
+ // C++0x type traits support.
+ case tok::kw___underlying_type:
+ ParseUnderlyingTypeSpecifier(DS);
+ return true;
+
// OpenCL qualifiers:
case tok::kw_private:
if (!getLang().OpenCL)
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
index 8c0aa1b..51aa010 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
@@ -60,12 +60,20 @@ Decl *Parser::ParseNamespace(unsigned Context,
SourceLocation IdentLoc;
IdentifierInfo *Ident = 0;
+ std::vector<SourceLocation> ExtraIdentLoc;
+ std::vector<IdentifierInfo*> ExtraIdent;
+ std::vector<SourceLocation> ExtraNamespaceLoc;
Token attrTok;
if (Tok.is(tok::identifier)) {
Ident = Tok.getIdentifierInfo();
IdentLoc = ConsumeToken(); // eat the identifier.
+ while (Tok.is(tok::coloncolon) && NextToken().is(tok::identifier)) {
+ ExtraNamespaceLoc.push_back(ConsumeToken());
+ ExtraIdent.push_back(Tok.getIdentifierInfo());
+ ExtraIdentLoc.push_back(ConsumeToken());
+ }
}
// Read label attributes, if present.
@@ -85,7 +93,12 @@ Decl *Parser::ParseNamespace(unsigned Context,
return ParseNamespaceAlias(NamespaceLoc, IdentLoc, Ident, DeclEnd);
}
+
if (Tok.isNot(tok::l_brace)) {
+ if (!ExtraIdent.empty()) {
+ Diag(ExtraNamespaceLoc[0], diag::err_nested_namespaces_with_double_colon)
+ << SourceRange(ExtraNamespaceLoc.front(), ExtraIdentLoc.back());
+ }
Diag(Tok, Ident ? diag::err_expected_lbrace :
diag::err_expected_ident_lbrace);
return 0;
@@ -96,11 +109,44 @@ Decl *Parser::ParseNamespace(unsigned Context,
if (getCurScope()->isClassScope() || getCurScope()->isTemplateParamScope() ||
getCurScope()->isInObjcMethodScope() || getCurScope()->getBlockParent() ||
getCurScope()->getFnParent()) {
+ if (!ExtraIdent.empty()) {
+ Diag(ExtraNamespaceLoc[0], diag::err_nested_namespaces_with_double_colon)
+ << SourceRange(ExtraNamespaceLoc.front(), ExtraIdentLoc.back());
+ }
Diag(LBrace, diag::err_namespace_nonnamespace_scope);
SkipUntil(tok::r_brace, false);
return 0;
}
+ if (!ExtraIdent.empty()) {
+ TentativeParsingAction TPA(*this);
+ SkipUntil(tok::r_brace, /*StopAtSemi*/false, /*DontConsume*/true);
+ Token rBraceToken = Tok;
+ TPA.Revert();
+
+ if (!rBraceToken.is(tok::r_brace)) {
+ Diag(ExtraNamespaceLoc[0], diag::err_nested_namespaces_with_double_colon)
+ << SourceRange(ExtraNamespaceLoc.front(), ExtraIdentLoc.back());
+ } else {
+ std::string NamespaceFix;
+ for (std::vector<IdentifierInfo*>::iterator I = ExtraIdent.begin(),
+ E = ExtraIdent.end(); I != E; ++I) {
+ NamespaceFix += " { namespace ";
+ NamespaceFix += (*I)->getName();
+ }
+
+ std::string RBraces;
+ for (unsigned i = 0, e = ExtraIdent.size(); i != e; ++i)
+ RBraces += "} ";
+
+ Diag(ExtraNamespaceLoc[0], diag::err_nested_namespaces_with_double_colon)
+ << FixItHint::CreateReplacement(SourceRange(ExtraNamespaceLoc.front(),
+ ExtraIdentLoc.back()),
+ NamespaceFix)
+ << FixItHint::CreateInsertion(rBraceToken.getLocation(), RBraces);
+ }
+ }
+
// If we're still good, complain about inline namespaces in non-C++0x now.
if (!getLang().CPlusPlus0x && InlineLoc.isValid())
Diag(InlineLoc, diag::ext_inline_namespace);
@@ -115,23 +161,56 @@ Decl *Parser::ParseNamespace(unsigned Context,
PrettyDeclStackTraceEntry CrashInfo(Actions, NamespcDecl, NamespaceLoc,
"parsing namespace");
- while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
- ParsedAttributesWithRange attrs(AttrFactory);
- MaybeParseCXX0XAttributes(attrs);
- MaybeParseMicrosoftAttributes(attrs);
- ParseExternalDeclaration(attrs);
- }
+ SourceLocation RBraceLoc;
+ // Parse the contents of the namespace. This includes parsing recovery on
+ // any improperly nested namespaces.
+ ParseInnerNamespace(ExtraIdentLoc, ExtraIdent, ExtraNamespaceLoc, 0,
+ InlineLoc, LBrace, attrs, RBraceLoc);
// Leave the namespace scope.
NamespaceScope.Exit();
- SourceLocation RBraceLoc = MatchRHSPunctuation(tok::r_brace, LBrace);
Actions.ActOnFinishNamespaceDef(NamespcDecl, RBraceLoc);
DeclEnd = RBraceLoc;
return NamespcDecl;
}
+/// ParseInnerNamespace - Parse the contents of a namespace.
+void Parser::ParseInnerNamespace(std::vector<SourceLocation>& IdentLoc,
+ std::vector<IdentifierInfo*>& Ident,
+ std::vector<SourceLocation>& NamespaceLoc,
+ unsigned int index, SourceLocation& InlineLoc,
+ SourceLocation& LBrace,
+ ParsedAttributes& attrs,
+ SourceLocation& RBraceLoc) {
+ if (index == Ident.size()) {
+ while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
+ ParsedAttributesWithRange attrs(AttrFactory);
+ MaybeParseCXX0XAttributes(attrs);
+ MaybeParseMicrosoftAttributes(attrs);
+ ParseExternalDeclaration(attrs);
+ }
+ RBraceLoc = MatchRHSPunctuation(tok::r_brace, LBrace);
+
+ return;
+ }
+
+ // Parse improperly nested namespaces.
+ ParseScope NamespaceScope(this, Scope::DeclScope);
+ Decl *NamespcDecl =
+ Actions.ActOnStartNamespaceDef(getCurScope(), SourceLocation(),
+ NamespaceLoc[index], IdentLoc[index],
+ Ident[index], LBrace, attrs.getList());
+
+ ParseInnerNamespace(IdentLoc, Ident, NamespaceLoc, ++index, InlineLoc,
+ LBrace, attrs, RBraceLoc);
+
+ NamespaceScope.Exit();
+
+ Actions.ActOnFinishNamespaceDef(NamespcDecl, RBraceLoc);
+}
+
/// ParseNamespaceAlias - Parse the part after the '=' in a namespace
/// alias definition.
///
@@ -387,13 +466,35 @@ Decl *Parser::ParseUsingDeclaration(unsigned Context,
bool IsAliasDecl = Tok.is(tok::equal);
TypeResult TypeAlias;
if (IsAliasDecl) {
- // TODO: Do we want to support attributes somewhere in an alias declaration?
- // Can't follow GCC since it doesn't support them yet!
+ // TODO: Attribute support. C++0x attributes may appear before the equals.
+ // Where can GNU attributes appear?
ConsumeToken();
if (!getLang().CPlusPlus0x)
Diag(Tok.getLocation(), diag::ext_alias_declaration);
+ // Type alias templates cannot be specialized.
+ int SpecKind = -1;
+ if (TemplateInfo.Kind == ParsedTemplateInfo::Template &&
+ Name.getKind() == UnqualifiedId::IK_TemplateId)
+ SpecKind = 0;
+ if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitSpecialization)
+ SpecKind = 1;
+ if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation)
+ SpecKind = 2;
+ if (SpecKind != -1) {
+ SourceRange Range;
+ if (SpecKind == 0)
+ Range = SourceRange(Name.TemplateId->LAngleLoc,
+ Name.TemplateId->RAngleLoc);
+ else
+ Range = TemplateInfo.getSourceRange();
+ Diag(Range.getBegin(), diag::err_alias_declaration_specialization)
+ << SpecKind << Range;
+ SkipUntil(tok::semi);
+ return 0;
+ }
+
// Name must be an identifier.
if (Name.getKind() != UnqualifiedId::IK_Identifier) {
Diag(Name.StartLocation, diag::err_alias_declaration_not_identifier);
@@ -408,7 +509,9 @@ Decl *Parser::ParseUsingDeclaration(unsigned Context,
Diag(SS.getBeginLoc(), diag::err_alias_declaration_not_identifier)
<< FixItHint::CreateRemoval(SS.getRange());
- TypeAlias = ParseTypeName(0, Declarator::AliasDeclContext);
+ TypeAlias = ParseTypeName(0, TemplateInfo.Kind ?
+ Declarator::AliasTemplateContext :
+ Declarator::AliasDeclContext);
} else
// Parse (optional) attributes (most likely GNU strong-using extension).
MaybeParseGNUAttributes(attrs);
@@ -421,9 +524,9 @@ Decl *Parser::ParseUsingDeclaration(unsigned Context,
tok::semi);
// Diagnose an attempt to declare a templated using-declaration.
- // TODO: in C++0x, alias-declarations can be templates:
+ // In C++0x, alias-declarations can be templates:
// template <...> using id = type;
- if (TemplateInfo.Kind) {
+ if (TemplateInfo.Kind && !IsAliasDecl) {
SourceRange R = TemplateInfo.getSourceRange();
Diag(UsingLoc, diag::err_templated_using_declaration)
<< R << FixItHint::CreateRemoval(R);
@@ -434,9 +537,14 @@ Decl *Parser::ParseUsingDeclaration(unsigned Context,
return 0;
}
- if (IsAliasDecl)
- return Actions.ActOnAliasDeclaration(getCurScope(), AS, UsingLoc, Name,
- TypeAlias);
+ if (IsAliasDecl) {
+ TemplateParameterLists *TemplateParams = TemplateInfo.TemplateParams;
+ MultiTemplateParamsArg TemplateParamsArg(Actions,
+ TemplateParams ? TemplateParams->data() : 0,
+ TemplateParams ? TemplateParams->size() : 0);
+ return Actions.ActOnAliasDeclaration(getCurScope(), AS, TemplateParamsArg,
+ UsingLoc, Name, TypeAlias);
+ }
return Actions.ActOnUsingDeclaration(getCurScope(), AS, true, UsingLoc, SS,
Name, attrs.getList(),
@@ -543,6 +651,42 @@ void Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
Diag(StartLoc, DiagID) << PrevSpec;
}
+void Parser::ParseUnderlyingTypeSpecifier(DeclSpec &DS) {
+ assert(Tok.is(tok::kw___underlying_type) &&
+ "Not an underlying type specifier");
+
+ SourceLocation StartLoc = ConsumeToken();
+ SourceLocation LParenLoc = Tok.getLocation();
+
+ if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after,
+ "__underlying_type")) {
+ SkipUntil(tok::r_paren);
+ return;
+ }
+
+ TypeResult Result = ParseTypeName();
+ if (Result.isInvalid()) {
+ SkipUntil(tok::r_paren);
+ return;
+ }
+
+ // Match the ')'
+ SourceLocation RParenLoc;
+ if (Tok.is(tok::r_paren))
+ RParenLoc = ConsumeParen();
+ else
+ MatchRHSPunctuation(tok::r_paren, LParenLoc);
+
+ if (RParenLoc.isInvalid())
+ return;
+
+ const char *PrevSpec = 0;
+ unsigned DiagID;
+ if (DS.SetTypeSpecType(DeclSpec::TST_underlyingType, StartLoc, PrevSpec,
+ DiagID, Result.release()))
+ Diag(StartLoc, DiagID) << PrevSpec;
+}
+
/// ParseClassName - Parse a C++ class-name, which names a class. Note
/// that we only check that the result names a type; semantic analysis
/// will need to verify that the type names a class. The result is
@@ -1409,6 +1553,7 @@ bool Parser::isCXX0XFinalKeyword() const {
/// member-declarator:
/// declarator virt-specifier-seq[opt] pure-specifier[opt]
/// declarator constant-initializer[opt]
+/// [C++11] declarator brace-or-equal-initializer[opt]
/// identifier[opt] ':' constant-expression
///
/// virt-specifier-seq:
@@ -1515,8 +1660,6 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
MaybeParseMicrosoftAttributes(attrs);
if (Tok.is(tok::kw_using)) {
- // FIXME: Check for template aliases
-
ProhibitAttributes(attrs);
// Eat 'using'.
@@ -1527,7 +1670,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
SkipUntil(tok::semi, true, true);
} else {
SourceLocation DeclEnd;
- // Otherwise, it must be using-declaration.
+ // Otherwise, it must be a using-declaration or an alias-declaration.
ParseUsingDeclaration(Declarator::MemberContext, TemplateInfo,
UsingLoc, DeclEnd, AS);
}
@@ -1547,13 +1690,14 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
if (Tok.is(tok::semi)) {
ConsumeToken();
Decl *TheDecl =
- Actions.ParsedFreeStandingDeclSpec(getCurScope(), AS, DS);
+ Actions.ParsedFreeStandingDeclSpec(getCurScope(), AS, DS, TemplateParams);
DS.complete(TheDecl);
return;
}
ParsingDeclarator DeclaratorInfo(*this, DS, Declarator::MemberContext);
VirtSpecifiers VS;
+ ExprResult Init;
if (Tok.isNot(tok::colon)) {
// Don't parse FOO:BAR as if it were a typo for FOO::BAR.
@@ -1575,10 +1719,36 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
// If attributes exist after the declarator, but before an '{', parse them.
MaybeParseGNUAttributes(DeclaratorInfo);
+ // MSVC permits pure specifier on inline functions declared at class scope.
+ // Hence check for =0 before checking for function definition.
+ if (getLang().Microsoft && Tok.is(tok::equal) &&
+ DeclaratorInfo.isFunctionDeclarator() &&
+ NextToken().is(tok::numeric_constant)) {
+ ConsumeToken();
+ Init = ParseInitializer();
+ if (Init.isInvalid())
+ SkipUntil(tok::comma, true, true);
+ }
+
+ bool IsDefinition = false;
// function-definition:
- if (Tok.is(tok::l_brace)
- || (DeclaratorInfo.isFunctionDeclarator() &&
- (Tok.is(tok::colon) || Tok.is(tok::kw_try)))) {
+ //
+ // In C++11, a non-function declarator followed by an open brace is a
+ // braced-init-list for an in-class member initialization, not an
+ // erroneous function definition.
+ if (Tok.is(tok::l_brace) && !getLang().CPlusPlus0x) {
+ IsDefinition = true;
+ } else if (DeclaratorInfo.isFunctionDeclarator()) {
+ if (Tok.is(tok::l_brace) || Tok.is(tok::colon) || Tok.is(tok::kw_try)) {
+ IsDefinition = true;
+ } else if (Tok.is(tok::equal)) {
+ const Token &KW = NextToken();
+ if (KW.is(tok::kw_default) || KW.is(tok::kw_delete))
+ IsDefinition = true;
+ }
+ }
+
+ if (IsDefinition) {
if (!DeclaratorInfo.isFunctionDeclarator()) {
Diag(Tok, diag::err_func_def_no_params);
ConsumeBrace();
@@ -1604,10 +1774,12 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
return;
}
- ParseCXXInlineMethodDef(AS, DeclaratorInfo, TemplateInfo, VS);
- // Consume the optional ';'
- if (Tok.is(tok::semi))
+ ParseCXXInlineMethodDef(AS, DeclaratorInfo, TemplateInfo, VS, Init);
+
+ // Consume the ';' - it's optional unless we have a delete or default
+ if (Tok.is(tok::semi)) {
ConsumeToken();
+ }
return;
}
@@ -1619,13 +1791,11 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
llvm::SmallVector<Decl *, 8> DeclsInGroup;
ExprResult BitfieldSize;
- ExprResult Init;
- bool Deleted = false;
while (1) {
// member-declarator:
// declarator pure-specifier[opt]
- // declarator constant-initializer[opt]
+ // declarator brace-or-equal-initializer[opt]
// identifier[opt] ':' constant-expression
if (Tok.is(tok::colon)) {
ConsumeToken();
@@ -1634,31 +1804,6 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
SkipUntil(tok::comma, true, true);
}
- ParseOptionalCXX0XVirtSpecifierSeq(VS);
-
- // pure-specifier:
- // '= 0'
- //
- // constant-initializer:
- // '=' constant-expression
- //
- // defaulted/deleted function-definition:
- // '=' 'default' [TODO]
- // '=' 'delete'
- if (Tok.is(tok::equal)) {
- ConsumeToken();
- if (Tok.is(tok::kw_delete)) {
- if (!getLang().CPlusPlus0x)
- Diag(Tok, diag::warn_deleted_function_accepted_as_extension);
- ConsumeToken();
- Deleted = true;
- } else {
- Init = ParseInitializer();
- if (Init.isInvalid())
- SkipUntil(tok::comma, true, true);
- }
- }
-
// If a simple-asm-expr is present, parse it.
if (Tok.is(tok::kw_asm)) {
SourceLocation Loc;
@@ -1673,6 +1818,30 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
// If attributes exist after the declarator, parse them.
MaybeParseGNUAttributes(DeclaratorInfo);
+ // FIXME: When g++ adds support for this, we'll need to check whether it
+ // goes before or after the GNU attributes and __asm__.
+ ParseOptionalCXX0XVirtSpecifierSeq(VS);
+
+ bool HasDeferredInitializer = false;
+ if (Tok.is(tok::equal) || Tok.is(tok::l_brace)) {
+ if (BitfieldSize.get()) {
+ Diag(Tok, diag::err_bitfield_member_init);
+ SkipUntil(tok::comma, true, true);
+ } else {
+ HasDeferredInitializer = !DeclaratorInfo.isFunctionDeclarator() &&
+ DeclaratorInfo.getDeclSpec().getStorageClassSpec()
+ != DeclSpec::SCS_static;
+
+ if (!HasDeferredInitializer) {
+ SourceLocation EqualLoc;
+ Init = ParseCXXMemberInitializer(
+ DeclaratorInfo.isFunctionDeclarator(), EqualLoc);
+ if (Init.isInvalid())
+ SkipUntil(tok::comma, true, true);
+ }
+ }
+ }
+
// NOTE: If Sema is the Action module and declarator is an instance field,
// this call will *not* return the created decl; It will return null.
// See Sema::ActOnCXXMemberDeclarator for details.
@@ -1689,8 +1858,8 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
move(TemplateParams),
BitfieldSize.release(),
VS, Init.release(),
- /*IsDefinition*/Deleted,
- Deleted);
+ HasDeferredInitializer,
+ /*IsDefinition*/ false);
}
if (ThisDecl)
DeclsInGroup.push_back(ThisDecl);
@@ -1703,6 +1872,24 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
DeclaratorInfo.complete(ThisDecl);
+ if (HasDeferredInitializer) {
+ if (!getLang().CPlusPlus0x)
+ Diag(Tok, diag::warn_nonstatic_member_init_accepted_as_extension);
+
+ if (DeclaratorInfo.isArrayOfUnknownBound()) {
+ // C++0x [dcl.array]p3: An array bound may also be omitted when the
+ // declarator is followed by an initializer.
+ //
+ // A brace-or-equal-initializer for a member-declarator is not an
+ // initializer in the gramamr, so this is ill-formed.
+ Diag(Tok, diag::err_incomplete_array_member_init);
+ SkipUntil(tok::comma, true, true);
+ // Avoid later warnings about a class member of incomplete type.
+ ThisDecl->setInvalidDecl();
+ } else
+ ParseCXXNonStaticMemberInitializer(ThisDecl);
+ }
+
// If we don't have a comma, it is either the end of the list (a ';')
// or an error, bail out.
if (Tok.isNot(tok::comma))
@@ -1716,7 +1903,6 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
VS.clear();
BitfieldSize = 0;
Init = 0;
- Deleted = false;
// Attributes are only allowed on the second declarator.
MaybeParseGNUAttributes(DeclaratorInfo);
@@ -1737,6 +1923,66 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
DeclsInGroup.size());
}
+/// ParseCXXMemberInitializer - Parse the brace-or-equal-initializer or
+/// pure-specifier. Also detect and reject any attempted defaulted/deleted
+/// function definition. The location of the '=', if any, will be placed in
+/// EqualLoc.
+///
+/// pure-specifier:
+/// '= 0'
+///
+/// brace-or-equal-initializer:
+/// '=' initializer-expression
+/// braced-init-list [TODO]
+///
+/// initializer-clause:
+/// assignment-expression
+/// braced-init-list [TODO]
+///
+/// defaulted/deleted function-definition:
+/// '=' 'default'
+/// '=' 'delete'
+///
+/// Prior to C++0x, the assignment-expression in an initializer-clause must
+/// be a constant-expression.
+ExprResult Parser::ParseCXXMemberInitializer(bool IsFunction,
+ SourceLocation &EqualLoc) {
+ assert((Tok.is(tok::equal) || Tok.is(tok::l_brace))
+ && "Data member initializer not starting with '=' or '{'");
+
+ if (Tok.is(tok::equal)) {
+ EqualLoc = ConsumeToken();
+ if (Tok.is(tok::kw_delete)) {
+ // In principle, an initializer of '= delete p;' is legal, but it will
+ // never type-check. It's better to diagnose it as an ill-formed expression
+ // than as an ill-formed deleted non-function member.
+ // An initializer of '= delete p, foo' will never be parsed, because
+ // a top-level comma always ends the initializer expression.
+ const Token &Next = NextToken();
+ if (IsFunction || Next.is(tok::semi) || Next.is(tok::comma) ||
+ Next.is(tok::eof)) {
+ if (IsFunction)
+ Diag(ConsumeToken(), diag::err_default_delete_in_multiple_declaration)
+ << 1 /* delete */;
+ else
+ Diag(ConsumeToken(), diag::err_deleted_non_function);
+ return ExprResult();
+ }
+ } else if (Tok.is(tok::kw_default)) {
+ Diag(ConsumeToken(), diag::err_default_special_members);
+ if (IsFunction)
+ Diag(Tok, diag::err_default_delete_in_multiple_declaration)
+ << 0 /* default */;
+ else
+ Diag(ConsumeToken(), diag::err_default_special_members);
+ return ExprResult();
+ }
+
+ return ParseInitializer();
+ } else
+ return ExprError(Diag(Tok, diag::err_generalized_initializer_lists));
+}
+
/// ParseCXXMemberSpecification - Parse the class definition.
///
/// member-specification:
@@ -1839,6 +2085,12 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
// Each iteration of this loop reads one member-declaration.
+ if (getLang().Microsoft && (Tok.is(tok::kw___if_exists) ||
+ Tok.is(tok::kw___if_not_exists))) {
+ ParseMicrosoftIfExistsClassDeclaration((DeclSpec::TST)TagType, CurAS);
+ continue;
+ }
+
// Check for extraneous top-level semicolon.
if (Tok.is(tok::semi)) {
Diag(Tok, diag::ext_extra_struct_semi)
@@ -1882,19 +2134,20 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
LBraceLoc, RBraceLoc,
attrs.getList());
- // C++ 9.2p2: Within the class member-specification, the class is regarded as
- // complete within function bodies, default arguments,
- // exception-specifications, and constructor ctor-initializers (including
- // such things in nested classes).
+ // C++0x [class.mem]p2: Within the class member-specification, the class is
+ // regarded as complete within function bodies, default arguments, exception-
+ // specifications, and brace-or-equal-initializers for non-static data
+ // members (including such things in nested classes).
//
- // FIXME: Only function bodies and constructor ctor-initializers are
- // parsed correctly, fix the rest.
+ // FIXME: Only function bodies and brace-or-equal-initializers are currently
+ // handled. Fix the others!
if (TagDecl && NonNestedClass) {
// We are not inside a nested class. This class and its nested classes
// are complete and we can parse the delayed portions of method
// declarations and the lexed inline method definitions.
SourceLocation SavedPrevTokLocation = PrevTokLocation;
ParseLexedMethodDeclarations(getCurrentClass());
+ ParseLexedMemberInitializers(getCurrentClass());
ParseLexedMethodDefs(getCurrentClass());
PrevTokLocation = SavedPrevTokLocation;
}
@@ -1982,6 +2235,7 @@ void Parser::ParseConstructorInitializer(Decl *ConstructorDecl) {
///
/// [C++] mem-initializer:
/// mem-initializer-id '(' expression-list[opt] ')'
+/// [C++0x] mem-initializer-id braced-init-list
///
/// [C++] mem-initializer-id:
/// '::'[opt] nested-name-specifier[opt] class-name
@@ -2012,31 +2266,37 @@ Parser::MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
SourceLocation IdLoc = ConsumeToken();
// Parse the '('.
- if (Tok.isNot(tok::l_paren)) {
- Diag(Tok, diag::err_expected_lparen);
+ if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
+ // FIXME: Do something with the braced-init-list.
+ ParseBraceInitializer();
return true;
- }
- SourceLocation LParenLoc = ConsumeParen();
+ } else if(Tok.is(tok::l_paren)) {
+ SourceLocation LParenLoc = ConsumeParen();
- // Parse the optional expression-list.
- ExprVector ArgExprs(Actions);
- CommaLocsTy CommaLocs;
- if (Tok.isNot(tok::r_paren) && ParseExpressionList(ArgExprs, CommaLocs)) {
- SkipUntil(tok::r_paren);
- return true;
- }
+ // Parse the optional expression-list.
+ ExprVector ArgExprs(Actions);
+ CommaLocsTy CommaLocs;
+ if (Tok.isNot(tok::r_paren) && ParseExpressionList(ArgExprs, CommaLocs)) {
+ SkipUntil(tok::r_paren);
+ return true;
+ }
- SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
+ SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
- SourceLocation EllipsisLoc;
- if (Tok.is(tok::ellipsis))
- EllipsisLoc = ConsumeToken();
-
- return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II,
- TemplateTypeTy, IdLoc,
- LParenLoc, ArgExprs.take(),
- ArgExprs.size(), RParenLoc,
- EllipsisLoc);
+ SourceLocation EllipsisLoc;
+ if (Tok.is(tok::ellipsis))
+ EllipsisLoc = ConsumeToken();
+
+ return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II,
+ TemplateTypeTy, IdLoc,
+ LParenLoc, ArgExprs.take(),
+ ArgExprs.size(), RParenLoc,
+ EllipsisLoc);
+ }
+
+ Diag(Tok, getLang().CPlusPlus0x ? diag::err_expected_lparen_or_lbrace
+ : diag::err_expected_lparen);
+ return true;
}
/// \brief Parse a C++ exception-specification if present (C++0x [except.spec]).
@@ -2438,3 +2698,64 @@ void Parser::ParseMicrosoftAttributes(ParsedAttributes &attrs,
ExpectAndConsume(tok::r_square, diag::err_expected_rsquare);
}
}
+
+void Parser::ParseMicrosoftIfExistsClassDeclaration(DeclSpec::TST TagType,
+ AccessSpecifier& CurAS) {
+ bool Result;
+ if (ParseMicrosoftIfExistsCondition(Result))
+ return;
+
+ if (Tok.isNot(tok::l_brace)) {
+ Diag(Tok, diag::err_expected_lbrace);
+ return;
+ }
+ ConsumeBrace();
+
+ // Condition is false skip all inside the {}.
+ if (!Result) {
+ SkipUntil(tok::r_brace, false);
+ return;
+ }
+
+ // Condition is true, parse the declaration.
+ while (Tok.isNot(tok::r_brace)) {
+
+ // __if_exists, __if_not_exists can nest.
+ if ((Tok.is(tok::kw___if_exists) || Tok.is(tok::kw___if_not_exists))) {
+ ParseMicrosoftIfExistsClassDeclaration((DeclSpec::TST)TagType, CurAS);
+ continue;
+ }
+
+ // Check for extraneous top-level semicolon.
+ if (Tok.is(tok::semi)) {
+ Diag(Tok, diag::ext_extra_struct_semi)
+ << DeclSpec::getSpecifierName((DeclSpec::TST)TagType)
+ << FixItHint::CreateRemoval(Tok.getLocation());
+ ConsumeToken();
+ continue;
+ }
+
+ AccessSpecifier AS = getAccessSpecifierIfPresent();
+ if (AS != AS_none) {
+ // Current token is a C++ access specifier.
+ CurAS = AS;
+ SourceLocation ASLoc = Tok.getLocation();
+ ConsumeToken();
+ if (Tok.is(tok::colon))
+ Actions.ActOnAccessSpecifier(AS, ASLoc, Tok.getLocation());
+ else
+ Diag(Tok, diag::err_expected_colon);
+ ConsumeToken();
+ continue;
+ }
+
+ // Parse all the comma separated declarators.
+ ParseCXXClassMemberDeclaration(CurAS);
+ }
+
+ if (Tok.isNot(tok::r_brace)) {
+ Diag(Tok, diag::err_expected_rbrace);
+ return;
+ }
+ ConsumeBrace();
+}
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp
index 91fe1e1..4e94ed9 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp
@@ -480,7 +480,9 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
/// [OBJC] '@encode' '(' type-name ')'
/// [OBJC] objc-string-literal
/// [C++] simple-type-specifier '(' expression-list[opt] ')' [C++ 5.2.3]
+/// [C++0x] simple-type-specifier braced-init-list [C++ 5.2.3]
/// [C++] typename-specifier '(' expression-list[opt] ')' [C++ 5.2.3]
+/// [C++0x] typename-specifier braced-init-list [C++ 5.2.3]
/// [C++] 'const_cast' '<' type-name '>' '(' expression ')' [C++ 5.2p1]
/// [C++] 'dynamic_cast' '<' type-name '>' '(' expression ')' [C++ 5.2p1]
/// [C++] 'reinterpret_cast' '<' type-name '>' '(' expression ')' [C++ 5.2p1]
@@ -566,6 +568,9 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
/// '__is_trivial'
/// '__is_union'
///
+/// [Clang] unary-type-trait:
+/// '__trivially_copyable'
+///
/// binary-type-trait:
/// [GNU] '__is_base_of'
/// [MS] '__is_convertible_to'
@@ -782,6 +787,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
case tok::kw___builtin_va_arg:
case tok::kw___builtin_offsetof:
case tok::kw___builtin_choose_expr:
+ case tok::kw___builtin_astype: // primary-expression: [OCL] as_type()
return ParseBuiltinPrimaryExpression();
case tok::kw___null:
return Actions.ActOnGNUNullExpr(ConsumeToken());
@@ -919,15 +925,18 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
if (SavedKind == tok::kw_typename) {
// postfix-expression: typename-specifier '(' expression-list[opt] ')'
+ // typename-specifier braced-init-list
if (TryAnnotateTypeOrScopeToken())
return ExprError();
}
// postfix-expression: simple-type-specifier '(' expression-list[opt] ')'
+ // simple-type-specifier braced-init-list
//
DeclSpec DS(AttrFactory);
ParseCXXSimpleTypeSpecifier(DS);
- if (Tok.isNot(tok::l_paren))
+ if (Tok.isNot(tok::l_paren) &&
+ (!getLang().CPlusPlus0x || Tok.isNot(tok::l_brace)))
return ExprError(Diag(Tok, diag::err_expected_lparen_after_type)
<< DS.getSourceRange());
@@ -1060,6 +1069,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
case tok::kw___is_pod:
case tok::kw___is_polymorphic:
case tok::kw___is_trivial:
+ case tok::kw___is_trivially_copyable:
case tok::kw___is_union:
case tok::kw___has_trivial_constructor:
case tok::kw___has_trivial_copy:
@@ -1117,6 +1127,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
/// postfix-expression: [C99 6.5.2]
/// primary-expression
/// postfix-expression '[' expression ']'
+/// postfix-expression '[' braced-init-list ']'
/// postfix-expression '(' argument-expression-list[opt] ')'
/// postfix-expression '.' identifier
/// postfix-expression '->' identifier
@@ -1172,7 +1183,11 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
return move(LHS);
Loc = ConsumeBracket();
- ExprResult Idx(ParseExpression());
+ ExprResult Idx;
+ if (getLang().CPlusPlus0x && Tok.is(tok::l_brace))
+ Idx = ParseBraceInitializer();
+ else
+ Idx = ParseExpression();
SourceLocation RLoc = Tok.getLocation();
@@ -1529,6 +1544,7 @@ ExprResult Parser::ParseUnaryExprOrTypeTraitExpression() {
/// [GNU] '__builtin_choose_expr' '(' assign-expr ',' assign-expr ','
/// assign-expr ')'
/// [GNU] '__builtin_types_compatible_p' '(' type-name ',' type-name ')'
+/// [OCL] '__builtin_astype' '(' type-name expr ')'
///
/// [GNU] offsetof-member-designator:
/// [GNU] identifier
@@ -1673,7 +1689,35 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() {
Expr2.take(), ConsumeParen());
break;
}
+ case tok::kw___builtin_astype: {
+ // The first argument is an expression to be converted, followed by a comma.
+ ExprResult Expr(ParseAssignmentExpression());
+ if (Expr.isInvalid()) {
+ SkipUntil(tok::r_paren);
+ return ExprError();
+ }
+
+ if (ExpectAndConsume(tok::comma, diag::err_expected_comma, "",
+ tok::r_paren))
+ return ExprError();
+
+ // Second argument is the type to bitcast to.
+ TypeResult DestTy = ParseTypeName();
+ if (DestTy.isInvalid())
+ return ExprError();
+
+ // Attempt to consume the r-paren.
+ if (Tok.isNot(tok::r_paren)) {
+ Diag(Tok, diag::err_expected_rparen);
+ SkipUntil(tok::r_paren);
+ return ExprError();
+ }
+
+ Res = Actions.ActOnAsTypeExpr(Expr.take(), DestTy.get(), StartLoc,
+ ConsumeParen());
+ break;
}
+}
if (Res.isInvalid())
return ExprError();
@@ -1987,8 +2031,19 @@ ExprResult Parser::ParseGenericSelectionExpression() {
/// argument-expression-list , assignment-expression
///
/// [C++] expression-list:
-/// [C++] assignment-expression ...[opt]
-/// [C++] expression-list , assignment-expression ...[opt]
+/// [C++] assignment-expression
+/// [C++] expression-list , assignment-expression
+///
+/// [C++0x] expression-list:
+/// [C++0x] initializer-list
+///
+/// [C++0x] initializer-list
+/// [C++0x] initializer-clause ...[opt]
+/// [C++0x] initializer-list , initializer-clause ...[opt]
+///
+/// [C++0x] initializer-clause:
+/// [C++0x] assignment-expression
+/// [C++0x] braced-init-list
///
bool Parser::ParseExpressionList(llvm::SmallVectorImpl<Expr*> &Exprs,
llvm::SmallVectorImpl<SourceLocation> &CommaLocs,
@@ -2005,8 +2060,13 @@ bool Parser::ParseExpressionList(llvm::SmallVectorImpl<Expr*> &Exprs,
Actions.CodeCompleteOrdinaryName(getCurScope(), Sema::PCC_Expression);
ConsumeCodeCompletionToken();
}
-
- ExprResult Expr(ParseAssignmentExpression());
+
+ ExprResult Expr;
+ if (getLang().CPlusPlus0x && Tok.is(tok::l_brace))
+ Expr = ParseBraceInitializer();
+ else
+ Expr = ParseAssignmentExpression();
+
if (Tok.is(tok::ellipsis))
Expr = Actions.ActOnPackExpansion(Expr.get(), ConsumeToken());
if (Expr.isInvalid())
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp
index 8bf6f63..eab7114 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp
@@ -280,8 +280,11 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
: TemplateId->TemplateNameLoc;
SS.SetInvalid(SourceRange(StartLoc, CCLoc));
}
-
- TemplateId->Destroy();
+
+ // If we are caching tokens we will process the TemplateId again,
+ // otherwise destroy it.
+ if (!PP.isBacktrackEnabled())
+ TemplateId->Destroy();
continue;
}
@@ -806,42 +809,55 @@ ExprResult Parser::ParseCXXThis() {
/// Can be interpreted either as function-style casting ("int(x)")
/// or class type construction ("ClassType(x,y,z)")
/// or creation of a value-initialized type ("int()").
+/// See [C++ 5.2.3].
///
/// postfix-expression: [C++ 5.2p1]
-/// simple-type-specifier '(' expression-list[opt] ')' [C++ 5.2.3]
-/// typename-specifier '(' expression-list[opt] ')' [TODO]
+/// simple-type-specifier '(' expression-list[opt] ')'
+/// [C++0x] simple-type-specifier braced-init-list
+/// typename-specifier '(' expression-list[opt] ')'
+/// [C++0x] typename-specifier braced-init-list
///
ExprResult
Parser::ParseCXXTypeConstructExpression(const DeclSpec &DS) {
Declarator DeclaratorInfo(DS, Declarator::TypeNameContext);
ParsedType TypeRep = Actions.ActOnTypeName(getCurScope(), DeclaratorInfo).get();
- assert(Tok.is(tok::l_paren) && "Expected '('!");
- GreaterThanIsOperatorScope G(GreaterThanIsOperator, true);
+ assert((Tok.is(tok::l_paren) ||
+ (getLang().CPlusPlus0x && Tok.is(tok::l_brace)))
+ && "Expected '(' or '{'!");
- SourceLocation LParenLoc = ConsumeParen();
+ if (Tok.is(tok::l_brace)) {
- ExprVector Exprs(Actions);
- CommaLocsTy CommaLocs;
+ // FIXME: Convert to a proper type construct expression.
+ return ParseBraceInitializer();
- if (Tok.isNot(tok::r_paren)) {
- if (ParseExpressionList(Exprs, CommaLocs)) {
- SkipUntil(tok::r_paren);
- return ExprError();
+ } else {
+ GreaterThanIsOperatorScope G(GreaterThanIsOperator, true);
+
+ SourceLocation LParenLoc = ConsumeParen();
+
+ ExprVector Exprs(Actions);
+ CommaLocsTy CommaLocs;
+
+ if (Tok.isNot(tok::r_paren)) {
+ if (ParseExpressionList(Exprs, CommaLocs)) {
+ SkipUntil(tok::r_paren);
+ return ExprError();
+ }
}
- }
- // Match the ')'.
- SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
+ // Match the ')'.
+ SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
- // TypeRep could be null, if it references an invalid typedef.
- if (!TypeRep)
- return ExprError();
+ // TypeRep could be null, if it references an invalid typedef.
+ if (!TypeRep)
+ return ExprError();
- assert((Exprs.size() == 0 || Exprs.size()-1 == CommaLocs.size())&&
- "Unexpected number of commas!");
- return Actions.ActOnCXXTypeConstructExpr(TypeRep, LParenLoc, move_arg(Exprs),
- RParenLoc);
+ assert((Exprs.size() == 0 || Exprs.size()-1 == CommaLocs.size())&&
+ "Unexpected number of commas!");
+ return Actions.ActOnCXXTypeConstructExpr(TypeRep, LParenLoc, move_arg(Exprs),
+ RParenLoc);
+ }
}
/// ParseCXXCondition - if/switch/while condition expression.
@@ -959,6 +975,7 @@ bool Parser::isCXXSimpleTypeSpecifier() const {
case tok::kw_bool:
case tok::kw_decltype:
case tok::kw_typeof:
+ case tok::kw___underlying_type:
return true;
default:
@@ -1723,7 +1740,7 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext,
///
/// new-initializer:
/// '(' expression-list[opt] ')'
-/// [C++0x] braced-init-list [TODO]
+/// [C++0x] braced-init-list
///
ExprResult
Parser::ParseCXXNewExpression(bool UseGlobal, SourceLocation Start) {
@@ -1812,6 +1829,9 @@ Parser::ParseCXXNewExpression(bool UseGlobal, SourceLocation Start) {
SkipUntil(tok::semi, /*StopAtSemi=*/true, /*DontConsume=*/true);
return ExprError();
}
+ } else if (Tok.is(tok::l_brace)) {
+ // FIXME: Have to communicate the init-list to ActOnCXXNew.
+ ParseBraceInitializer();
}
return Actions.ActOnCXXNew(Start, UseGlobal, PlacementLParen,
@@ -1921,7 +1941,8 @@ static UnaryTypeTrait UnaryTypeTraitFromTokKind(tok::TokenKind kind) {
case tok::kw___has_nothrow_constructor: return UTT_HasNothrowConstructor;
case tok::kw___has_nothrow_copy: return UTT_HasNothrowCopy;
case tok::kw___has_trivial_assign: return UTT_HasTrivialAssign;
- case tok::kw___has_trivial_constructor: return UTT_HasTrivialConstructor;
+ case tok::kw___has_trivial_constructor:
+ return UTT_HasTrivialDefaultConstructor;
case tok::kw___has_trivial_copy: return UTT_HasTrivialCopy;
case tok::kw___has_trivial_destructor: return UTT_HasTrivialDestructor;
case tok::kw___has_virtual_destructor: return UTT_HasVirtualDestructor;
@@ -1954,6 +1975,7 @@ static UnaryTypeTrait UnaryTypeTraitFromTokKind(tok::TokenKind kind) {
case tok::kw___is_signed: return UTT_IsSigned;
case tok::kw___is_standard_layout: return UTT_IsStandardLayout;
case tok::kw___is_trivial: return UTT_IsTrivial;
+ case tok::kw___is_trivially_copyable: return UTT_IsTriviallyCopyable;
case tok::kw___is_union: return UTT_IsUnion;
case tok::kw___is_unsigned: return UTT_IsUnsigned;
case tok::kw___is_void: return UTT_IsVoid;
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp
index fdbedc5..a8c18c0 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp
@@ -874,8 +874,8 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
Selector Sel = PP.getSelectorTable().getNullarySelector(SelIdent);
Decl *Result
= Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(),
- mType, IDecl, DSRet, ReturnType, Sel,
- 0,
+ mType, IDecl, DSRet, ReturnType,
+ selLoc, Sel, 0,
CParamInfo.data(), CParamInfo.size(),
methodAttrs.getList(), MethodImplKind,
false, MethodDefinition);
@@ -1000,8 +1000,8 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
&KeyIdents[0]);
Decl *Result
= Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(),
- mType, IDecl, DSRet, ReturnType, Sel,
- &ArgInfos[0],
+ mType, IDecl, DSRet, ReturnType,
+ selLoc, Sel, &ArgInfos[0],
CParamInfo.data(), CParamInfo.size(),
methodAttrs.getList(),
MethodImplKind, isVariadic, MethodDefinition);
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp b/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp
index 46225c8..c30ab75 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp
@@ -295,7 +295,6 @@ void PragmaUnusedHandler::HandlePragma(Preprocessor &PP,
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "unused";
return;
}
- SourceLocation LParenLoc = Tok.getLocation();
// Lex the declaration reference(s).
llvm::SmallVector<Token, 5> Identifiers;
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp
index f0ab531..6cc8b57 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp
@@ -741,6 +741,12 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
continue;
}
+ if (getLang().Microsoft && (Tok.is(tok::kw___if_exists) ||
+ Tok.is(tok::kw___if_not_exists))) {
+ ParseMicrosoftIfExistsStatement(Stmts);
+ continue;
+ }
+
StmtResult R;
if (Tok.isNot(tok::kw___extension__)) {
R = ParseStatementOrDeclaration(Stmts, false);
@@ -2000,3 +2006,34 @@ StmtResult Parser::ParseCXXCatchBlock() {
return Actions.ActOnCXXCatchBlock(CatchLoc, ExceptionDecl, Block.take());
}
+
+void Parser::ParseMicrosoftIfExistsStatement(StmtVector &Stmts) {
+ bool Result;
+ if (ParseMicrosoftIfExistsCondition(Result))
+ return;
+
+ if (Tok.isNot(tok::l_brace)) {
+ Diag(Tok, diag::err_expected_lbrace);
+ return;
+ }
+ ConsumeBrace();
+
+ // Condition is false skip all inside the {}.
+ if (!Result) {
+ SkipUntil(tok::r_brace, false);
+ return;
+ }
+
+ // Condition is true, parse the statements.
+ while (Tok.isNot(tok::r_brace)) {
+ StmtResult R = ParseStatementOrDeclaration(Stmts, false);
+ if (R.isUsable())
+ Stmts.push_back(R.release());
+ }
+
+ if (Tok.isNot(tok::r_brace)) {
+ Diag(Tok, diag::err_expected_rbrace);
+ return;
+ }
+ ConsumeBrace();
+}
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp
index 12e38da..aa89d75 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp
@@ -905,10 +905,10 @@ ParsedTemplateArgument Parser::ParseTemplateTemplateArgument() {
// C++0x [temp.arg.template]p1:
// A template-argument for a template template-parameter shall be the name
- // of a class template or a template alias, expressed as id-expression.
+ // of a class template or an alias template, expressed as id-expression.
//
- // We parse an id-expression that refers to a class template or template
- // alias. The grammar we parse is:
+ // We parse an id-expression that refers to a class template or alias
+ // template. The grammar we parse is:
//
// nested-name-specifier[opt] template[opt] identifier ...[opt]
//
@@ -969,7 +969,7 @@ ParsedTemplateArgument Parser::ParseTemplateTemplateArgument() {
MemberOfUnknownSpecialization);
if (TNK == TNK_Dependent_template_name || TNK == TNK_Type_template) {
// We have an id-expression that refers to a class template or
- // (C++0x) template alias.
+ // (C++0x) alias template.
Result = ParsedTemplateArgument(SS, Template, Name.StartLocation);
}
}
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp
index 1c4e2b3..78d2c90 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp
@@ -664,6 +664,7 @@ Parser::isExpressionOrTypeSpecifierSimple(tok::TokenKind Kind) {
case tok::kw___is_pod:
case tok::kw___is_polymorphic:
case tok::kw___is_trivial:
+ case tok::kw___is_trivially_copyable:
case tok::kw___is_union:
case tok::kw___uuidof:
return TPResult::True();
@@ -693,6 +694,7 @@ Parser::isExpressionOrTypeSpecifierSimple(tok::TokenKind Kind) {
case tok::kw_char16_t:
case tok::kw_char32_t:
case tok::kw_decltype:
+ case tok::kw___underlying_type:
case tok::kw_thread_local:
case tok::kw__Decimal32:
case tok::kw__Decimal64:
@@ -1011,6 +1013,10 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
case tok::kw_decltype:
return TPResult::True();
+ // C++0x type traits support
+ case tok::kw___underlying_type:
+ return TPResult::True();
+
default:
return TPResult::False();
}
diff --git a/contrib/llvm/tools/clang/lib/Parse/Parser.cpp b/contrib/llvm/tools/clang/lib/Parse/Parser.cpp
index 4d08699..f19472c 100644
--- a/contrib/llvm/tools/clang/lib/Parse/Parser.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/Parser.cpp
@@ -20,6 +20,7 @@
#include "RAIIObjectsForParser.h"
#include "ParsePragma.h"
#include "clang/AST/DeclTemplate.h"
+#include "clang/AST/ASTConsumer.h"
using namespace clang;
Parser::Parser(Preprocessor &pp, Sema &actions)
@@ -350,7 +351,23 @@ void Parser::ExitScope() {
ScopeCache[NumCachedScopes++] = OldScope;
}
+/// Set the flags for the current scope to ScopeFlags. If ManageFlags is false,
+/// this object does nothing.
+Parser::ParseScopeFlags::ParseScopeFlags(Parser *Self, unsigned ScopeFlags,
+ bool ManageFlags)
+ : CurScope(ManageFlags ? Self->getCurScope() : 0) {
+ if (CurScope) {
+ OldFlags = CurScope->getFlags();
+ CurScope->setFlags(ScopeFlags);
+ }
+}
+/// Restore the flags for the current scope to what they were before this
+/// object overrode them.
+Parser::ParseScopeFlags::~ParseScopeFlags() {
+ if (CurScope)
+ CurScope->setFlags(OldFlags);
+}
//===----------------------------------------------------------------------===//
@@ -653,6 +670,11 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
// FIXME: Detect C++ linkage specifications here?
goto dont_know;
+ case tok::kw___if_exists:
+ case tok::kw___if_not_exists:
+ ParseMicrosoftIfExistsExternalDeclaration();
+ return DeclGroupPtrTy();
+
default:
dont_know:
// We can't tell whether this is a function-definition or declaration yet.
@@ -671,7 +693,14 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
/// \brief Determine whether the current token, if it occurs after a
/// declarator, continues a declaration or declaration list.
-bool Parser::isDeclarationAfterDeclarator() const {
+bool Parser::isDeclarationAfterDeclarator() {
+ // Check for '= delete' or '= default'
+ if (getLang().CPlusPlus && Tok.is(tok::equal)) {
+ const Token &KW = NextToken();
+ if (KW.is(tok::kw_default) || KW.is(tok::kw_delete))
+ return false;
+ }
+
return Tok.is(tok::equal) || // int X()= -> not a function def
Tok.is(tok::comma) || // int X(), -> not a function def
Tok.is(tok::semi) || // int X(); -> not a function def
@@ -692,6 +721,11 @@ bool Parser::isStartOfFunctionDefinition(const ParsingDeclarator &Declarator) {
if (!getLang().CPlusPlus &&
Declarator.getFunctionTypeInfo().isKNRPrototype())
return isDeclarationSpecifier();
+
+ if (getLang().CPlusPlus && Tok.is(tok::equal)) {
+ const Token &KW = NextToken();
+ return KW.is(tok::kw_default) || KW.is(tok::kw_delete);
+ }
return Tok.is(tok::colon) || // X() : Base() {} (used for ctors)
Tok.is(tok::kw_try); // X() try { ... }
@@ -814,11 +848,13 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
if (FTI.isKNRPrototype())
ParseKNRParamDeclarations(D);
+
// We should have either an opening brace or, in a C++ constructor,
// we may have a colon.
if (Tok.isNot(tok::l_brace) &&
(!getLang().CPlusPlus ||
- (Tok.isNot(tok::colon) && Tok.isNot(tok::kw_try)))) {
+ (Tok.isNot(tok::colon) && Tok.isNot(tok::kw_try) &&
+ Tok.isNot(tok::equal)))) {
Diag(Tok, diag::err_expected_fn_body);
// Skip over garbage, until we get to '{'. Don't eat the '{'.
@@ -866,7 +902,6 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
return DP;
}
-
// Enter a scope for the function body.
ParseScope BodyScope(this, Scope::FnScope|Scope::DeclScope);
@@ -887,6 +922,43 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
// safe because we're always the sole owner.
D.getMutableDeclSpec().abort();
+ if (Tok.is(tok::equal)) {
+ assert(getLang().CPlusPlus && "Only C++ function definitions have '='");
+ ConsumeToken();
+
+ Actions.ActOnFinishFunctionBody(Res, 0, false);
+
+ bool Delete = false;
+ SourceLocation KWLoc;
+ if (Tok.is(tok::kw_delete)) {
+ if (!getLang().CPlusPlus0x)
+ Diag(Tok, diag::warn_deleted_function_accepted_as_extension);
+
+ KWLoc = ConsumeToken();
+ Actions.SetDeclDeleted(Res, KWLoc);
+ Delete = true;
+ } else if (Tok.is(tok::kw_default)) {
+ if (!getLang().CPlusPlus0x)
+ Diag(Tok, diag::warn_defaulted_function_accepted_as_extension);
+
+ KWLoc = ConsumeToken();
+ Actions.SetDeclDefaulted(Res, KWLoc);
+ } else {
+ llvm_unreachable("function definition after = not 'delete' or 'default'");
+ }
+
+ if (Tok.is(tok::comma)) {
+ Diag(KWLoc, diag::err_default_delete_in_multiple_declaration)
+ << Delete;
+ SkipUntil(tok::semi);
+ } else {
+ ExpectAndConsume(tok::semi, diag::err_expected_semi_after,
+ Delete ? "delete" : "default", tok::semi);
+ }
+
+ return Res;
+ }
+
if (Tok.is(tok::kw_try))
return ParseFunctionTryBlock(Res, BodyScope);
@@ -1374,3 +1446,80 @@ void Parser::CodeCompleteMacroArgument(IdentifierInfo *Macro,
void Parser::CodeCompleteNaturalLanguage() {
Actions.CodeCompleteNaturalLanguage();
}
+
+bool Parser::ParseMicrosoftIfExistsCondition(bool& Result) {
+ assert((Tok.is(tok::kw___if_exists) || Tok.is(tok::kw___if_not_exists)) &&
+ "Expected '__if_exists' or '__if_not_exists'");
+ Token Condition = Tok;
+ SourceLocation IfExistsLoc = ConsumeToken();
+
+ SourceLocation LParenLoc = Tok.getLocation();
+ if (Tok.isNot(tok::l_paren)) {
+ Diag(Tok, diag::err_expected_lparen_after) << IfExistsLoc;
+ SkipUntil(tok::semi);
+ return true;
+ }
+ ConsumeParen(); // eat the '('.
+
+ // Parse nested-name-specifier.
+ CXXScopeSpec SS;
+ ParseOptionalCXXScopeSpecifier(SS, ParsedType(), false);
+
+ // Check nested-name specifier.
+ if (SS.isInvalid()) {
+ SkipUntil(tok::semi);
+ return true;
+ }
+
+ // Parse the unqualified-id.
+ UnqualifiedId Name;
+ if (ParseUnqualifiedId(SS, false, true, true, ParsedType(), Name)) {
+ SkipUntil(tok::semi);
+ return true;
+ }
+
+ if (MatchRHSPunctuation(tok::r_paren, LParenLoc).isInvalid())
+ return true;
+
+ // Check if the symbol exists.
+ bool Exist = Actions.CheckMicrosoftIfExistsSymbol(SS, Name);
+
+ Result = ((Condition.is(tok::kw___if_exists) && Exist) ||
+ (Condition.is(tok::kw___if_not_exists) && !Exist));
+
+ return false;
+}
+
+void Parser::ParseMicrosoftIfExistsExternalDeclaration() {
+ bool Result;
+ if (ParseMicrosoftIfExistsCondition(Result))
+ return;
+
+ if (Tok.isNot(tok::l_brace)) {
+ Diag(Tok, diag::err_expected_lbrace);
+ return;
+ }
+ ConsumeBrace();
+
+ // Condition is false skip all inside the {}.
+ if (!Result) {
+ SkipUntil(tok::r_brace, false);
+ return;
+ }
+
+ // Condition is true, parse the declaration.
+ while (Tok.isNot(tok::r_brace)) {
+ ParsedAttributesWithRange attrs(AttrFactory);
+ MaybeParseCXX0XAttributes(attrs);
+ MaybeParseMicrosoftAttributes(attrs);
+ DeclGroupPtrTy Result = ParseExternalDeclaration(attrs);
+ if (Result && !getCurScope()->getParent())
+ Actions.getASTConsumer().HandleTopLevelDecl(Result.get());
+ }
+
+ if (Tok.isNot(tok::r_brace)) {
+ Diag(Tok, diag::err_expected_rbrace);
+ return;
+ }
+ ConsumeBrace();
+}
diff --git a/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp b/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp
index d6e34ef..8cdb55a 100644
--- a/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp
+++ b/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp
@@ -2695,7 +2695,8 @@ QualType RewriteObjC::getSuperStructType() {
SourceLocation(), 0,
FieldTypes[i], 0,
/*BitWidth=*/0,
- /*Mutable=*/false));
+ /*Mutable=*/false,
+ /*HasInit=*/false));
}
SuperStructDecl->completeDefinition();
@@ -2727,7 +2728,8 @@ QualType RewriteObjC::getConstantStringStructType() {
SourceLocation(), 0,
FieldTypes[i], 0,
/*BitWidth=*/0,
- /*Mutable=*/true));
+ /*Mutable=*/true,
+ /*HasInit=*/false));
}
ConstantStringDecl->completeDefinition();
@@ -4709,7 +4711,8 @@ Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
SourceLocation(),
&Context->Idents.get("FuncPtr"),
Context->VoidPtrTy, 0,
- /*BitWidth=*/0, /*Mutable=*/true);
+ /*BitWidth=*/0, /*Mutable=*/true,
+ /*HasInit=*/false);
MemberExpr *ME = new (Context) MemberExpr(PE, true, FD, SourceLocation(),
FD->getType(), VK_LValue,
OK_Ordinary);
@@ -4763,7 +4766,8 @@ Stmt *RewriteObjC::RewriteBlockDeclRefExpr(Expr *DeclRefExp) {
SourceLocation(),
&Context->Idents.get("__forwarding"),
Context->VoidPtrTy, 0,
- /*BitWidth=*/0, /*Mutable=*/true);
+ /*BitWidth=*/0, /*Mutable=*/true,
+ /*HasInit=*/false);
MemberExpr *ME = new (Context) MemberExpr(DeclRefExp, isArrow,
FD, SourceLocation(),
FD->getType(), VK_LValue,
@@ -4773,7 +4777,8 @@ Stmt *RewriteObjC::RewriteBlockDeclRefExpr(Expr *DeclRefExp) {
FD = FieldDecl::Create(*Context, 0, SourceLocation(), SourceLocation(),
&Context->Idents.get(Name),
Context->VoidPtrTy, 0,
- /*BitWidth=*/0, /*Mutable=*/true);
+ /*BitWidth=*/0, /*Mutable=*/true,
+ /*HasInit=*/false);
ME = new (Context) MemberExpr(ME, true, FD, SourceLocation(),
DeclRefExp->getType(), VK_LValue, OK_Ordinary);
diff --git a/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp b/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp
index e482172..9efae61 100644
--- a/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -196,7 +196,12 @@ static ControlFlowKind CheckFallThrough(AnalysisContext &AC) {
continue;
}
Expr *CEE = C->getCallee()->IgnoreParenCasts();
- if (getFunctionExtInfo(CEE->getType()).getNoReturn()) {
+ QualType calleeType = CEE->getType();
+ if (calleeType == AC.getASTContext().BoundMemberTy) {
+ calleeType = Expr::findBoundMemberType(CEE);
+ assert(!calleeType.isNull() && "analyzing unresolved call?");
+ }
+ if (getFunctionExtInfo(calleeType).getNoReturn()) {
NoReturnEdge = true;
HasFakeEdge = true;
} else if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(CEE)) {
diff --git a/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp b/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp
index 0f20d10..5be16e7 100644
--- a/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp
@@ -309,6 +309,7 @@ const char *DeclSpec::getSpecifierName(DeclSpec::TST T) {
case DeclSpec::TST_typeofExpr: return "typeof";
case DeclSpec::TST_auto: return "auto";
case DeclSpec::TST_decltype: return "(decltype)";
+ case DeclSpec::TST_underlyingType: return "__underlying_type";
case DeclSpec::TST_unknown_anytype: return "__unknown_anytype";
case DeclSpec::TST_error: return "(error)";
}
diff --git a/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp b/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp
index 867d78f..ae154aa 100644
--- a/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp
@@ -15,6 +15,7 @@
#include "clang/Sema/SemaInternal.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/Expr.h"
+#include "clang/AST/ExprCXX.h"
#include "clang/AST/StmtObjC.h"
#include "clang/AST/StmtCXX.h"
#include "llvm/ADT/BitVector.h"
@@ -126,18 +127,45 @@ static std::pair<unsigned,unsigned>
InDiag = diag::note_protected_by_cleanup;
OutDiag = diag::note_exits_cleanup;
} else if (isCPlusPlus) {
- // FIXME: In C++0x, we have to check more conditions than "did we
- // just give it an initializer?". See 6.7p3.
- if (VD->hasLocalStorage() && VD->hasInit())
- InDiag = diag::note_protected_by_variable_init;
-
- CanQualType T = VD->getType()->getCanonicalTypeUnqualified();
+ if (!VD->hasLocalStorage())
+ return std::make_pair(InDiag, OutDiag);
+
+ ASTContext &Context = D->getASTContext();
+ QualType T = Context.getBaseElementType(VD->getType());
if (!T->isDependentType()) {
- while (CanQual<ArrayType> AT = T->getAs<ArrayType>())
- T = AT->getElementType();
- if (CanQual<RecordType> RT = T->getAs<RecordType>())
- if (!cast<CXXRecordDecl>(RT->getDecl())->hasTrivialDestructor())
- OutDiag = diag::note_exits_dtor;
+ // C++0x [stmt.dcl]p3:
+ // A program that jumps from a point where a variable with automatic
+ // storage duration is not in scope to a point where it is in scope
+ // is ill-formed unless the variable has scalar type, class type with
+ // a trivial default constructor and a trivial destructor, a
+ // cv-qualified version of one of these types, or an array of one of
+ // the preceding types and is declared without an initializer (8.5).
+ // Check whether this is a C++ class.
+ CXXRecordDecl *Record = T->getAsCXXRecordDecl();
+
+ if (const Expr *Init = VD->getInit()) {
+ bool CallsTrivialConstructor = false;
+ if (Record) {
+ // FIXME: With generalized initializer lists, this may
+ // classify "X x{};" as having no initializer.
+ if (const CXXConstructExpr *Construct
+ = dyn_cast<CXXConstructExpr>(Init))
+ if (const CXXConstructorDecl *Constructor
+ = Construct->getConstructor())
+ if ((Context.getLangOptions().CPlusPlus0x
+ ? Record->hasTrivialDefaultConstructor()
+ : Record->isPOD()) &&
+ Constructor->isDefaultConstructor())
+ CallsTrivialConstructor = true;
+ }
+
+ if (!CallsTrivialConstructor)
+ InDiag = diag::note_protected_by_variable_init;
+ }
+
+ // Note whether we have a class with a non-trivial destructor.
+ if (Record && !Record->hasTrivialDestructor())
+ OutDiag = diag::note_exits_dtor;
}
}
diff --git a/contrib/llvm/tools/clang/lib/Sema/Sema.cpp b/contrib/llvm/tools/clang/lib/Sema/Sema.cpp
index 7707fb1..8297b31 100644
--- a/contrib/llvm/tools/clang/lib/Sema/Sema.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/Sema.cpp
@@ -31,6 +31,7 @@
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
+#include "clang/AST/ExprCXX.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Basic/PartialDiagnostic.h"
@@ -377,30 +378,22 @@ void Sema::ActOnEndOfTranslationUnit() {
}
}
- bool SomethingChanged;
- do {
- SomethingChanged = false;
-
- // If DefinedUsedVTables ends up marking any virtual member functions it
- // might lead to more pending template instantiations, which we then need
- // to instantiate.
- if (DefineUsedVTables())
- SomethingChanged = true;
-
- // C++: Perform implicit template instantiations.
- //
- // FIXME: When we perform these implicit instantiations, we do not
- // carefully keep track of the point of instantiation (C++ [temp.point]).
- // This means that name lookup that occurs within the template
- // instantiation will always happen at the end of the translation unit,
- // so it will find some names that should not be found. Although this is
- // common behavior for C++ compilers, it is technically wrong. In the
- // future, we either need to be able to filter the results of name lookup
- // or we need to perform template instantiations earlier.
- if (PerformPendingInstantiations())
- SomethingChanged = true;
-
- } while (SomethingChanged);
+ // If DefinedUsedVTables ends up marking any virtual member functions it
+ // might lead to more pending template instantiations, which we then need
+ // to instantiate.
+ DefineUsedVTables();
+
+ // C++: Perform implicit template instantiations.
+ //
+ // FIXME: When we perform these implicit instantiations, we do not
+ // carefully keep track of the point of instantiation (C++ [temp.point]).
+ // This means that name lookup that occurs within the template
+ // instantiation will always happen at the end of the translation unit,
+ // so it will find some names that should not be found. Although this is
+ // common behavior for C++ compilers, it is technically wrong. In the
+ // future, we either need to be able to filter the results of name lookup
+ // or we need to perform template instantiations earlier.
+ PerformPendingInstantiations();
}
// Remove file scoped decls that turned out to be used.
@@ -473,6 +466,12 @@ void Sema::ActOnEndOfTranslationUnit() {
}
+ if (LangOpts.CPlusPlus0x &&
+ Diags.getDiagnosticLevel(diag::warn_delegating_ctor_cycle,
+ SourceLocation())
+ != Diagnostic::Ignored)
+ CheckDelegatingCtorCycles();
+
// If there were errors, disable 'unused' warnings since they will mostly be
// noise.
if (!Diags.hasErrorOccurred()) {
@@ -570,9 +569,12 @@ Sema::SemaDiagnosticBuilder::~SemaDiagnosticBuilder() {
break;
case DiagnosticIDs::SFINAE_AccessControl:
- // Unless access checking is specifically called out as a SFINAE
- // error, report this diagnostic.
- if (!SemaRef.AccessCheckingSFINAE)
+ // Per C++ Core Issue 1170, access control is part of SFINAE.
+ // Additionally, the AccessCheckingSFINAE flag can be used to temporary
+ // make access control a part of SFINAE for the purposes of checking
+ // type traits.
+ if (!SemaRef.AccessCheckingSFINAE &&
+ !SemaRef.getLangOptions().CPlusPlus0x)
break;
case DiagnosticIDs::SFINAE_SubstitutionFailure:
@@ -763,3 +765,101 @@ void PrettyDeclStackTraceEntry::print(llvm::raw_ostream &OS) const {
OS << '\n';
}
+
+/// \brief Figure out if an expression could be turned into a call.
+///
+/// Use this when trying to recover from an error where the programmer may have
+/// written just the name of a function instead of actually calling it.
+///
+/// \param E - The expression to examine.
+/// \param ZeroArgCallReturnTy - If the expression can be turned into a call
+/// with no arguments, this parameter is set to the type returned by such a
+/// call; otherwise, it is set to an empty QualType.
+/// \param NonTemplateOverloads - If the expression is an overloaded function
+/// name, this parameter is populated with the decls of the various overloads.
+bool Sema::isExprCallable(const Expr &E, QualType &ZeroArgCallReturnTy,
+ UnresolvedSetImpl &NonTemplateOverloads) {
+ ZeroArgCallReturnTy = QualType();
+ NonTemplateOverloads.clear();
+ if (const OverloadExpr *Overloads = dyn_cast<OverloadExpr>(&E)) {
+ for (OverloadExpr::decls_iterator it = Overloads->decls_begin(),
+ DeclsEnd = Overloads->decls_end(); it != DeclsEnd; ++it) {
+ // Our overload set may include TemplateDecls, which we'll ignore for our
+ // present purpose.
+ if (const FunctionDecl *OverloadDecl = dyn_cast<FunctionDecl>(*it)) {
+ NonTemplateOverloads.addDecl(*it);
+ if (OverloadDecl->getMinRequiredArguments() == 0)
+ ZeroArgCallReturnTy = OverloadDecl->getResultType();
+ }
+ }
+ return true;
+ }
+
+ if (const DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(&E)) {
+ if (const FunctionDecl *Fun = dyn_cast<FunctionDecl>(DeclRef->getDecl())) {
+ if (Fun->getMinRequiredArguments() == 0)
+ ZeroArgCallReturnTy = Fun->getResultType();
+ return true;
+ }
+ }
+
+ // We don't have an expression that's convenient to get a FunctionDecl from,
+ // but we can at least check if the type is "function of 0 arguments".
+ QualType ExprTy = E.getType();
+ const FunctionType *FunTy = NULL;
+ QualType PointeeTy = ExprTy->getPointeeType();
+ if (!PointeeTy.isNull())
+ FunTy = PointeeTy->getAs<FunctionType>();
+ if (!FunTy)
+ FunTy = ExprTy->getAs<FunctionType>();
+ if (!FunTy && ExprTy == Context.BoundMemberTy) {
+ // Look for the bound-member type. If it's still overloaded, give up,
+ // although we probably should have fallen into the OverloadExpr case above
+ // if we actually have an overloaded bound member.
+ QualType BoundMemberTy = Expr::findBoundMemberType(&E);
+ if (!BoundMemberTy.isNull())
+ FunTy = BoundMemberTy->castAs<FunctionType>();
+ }
+
+ if (const FunctionProtoType *FPT =
+ dyn_cast_or_null<FunctionProtoType>(FunTy)) {
+ if (FPT->getNumArgs() == 0)
+ ZeroArgCallReturnTy = FunTy->getResultType();
+ return true;
+ }
+ return false;
+}
+
+/// \brief Give notes for a set of overloads.
+///
+/// A companion to isExprCallable. In cases when the name that the programmer
+/// wrote was an overloaded function, we may be able to make some guesses about
+/// plausible overloads based on their return types; such guesses can be handed
+/// off to this method to be emitted as notes.
+///
+/// \param Overloads - The overloads to note.
+/// \param FinalNoteLoc - If we've suppressed printing some overloads due to
+/// -fshow-overloads=best, this is the location to attach to the note about too
+/// many candidates. Typically this will be the location of the original
+/// ill-formed expression.
+void Sema::NoteOverloads(const UnresolvedSetImpl &Overloads,
+ const SourceLocation FinalNoteLoc) {
+ int ShownOverloads = 0;
+ int SuppressedOverloads = 0;
+ for (UnresolvedSetImpl::iterator It = Overloads.begin(),
+ DeclsEnd = Overloads.end(); It != DeclsEnd; ++It) {
+ // FIXME: Magic number for max shown overloads stolen from
+ // OverloadCandidateSet::NoteCandidates.
+ if (ShownOverloads >= 4 &&
+ Diags.getShowOverloads() == Diagnostic::Ovl_Best) {
+ ++SuppressedOverloads;
+ continue;
+ }
+ Diag(cast<FunctionDecl>(*It)->getSourceRange().getBegin(),
+ diag::note_member_ref_possible_intended_overload);
+ ++ShownOverloads;
+ }
+ if (SuppressedOverloads)
+ Diag(FinalNoteLoc, diag::note_ovl_too_many_candidates)
+ << SuppressedOverloads;
+}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp
index 411d424..a26737e 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp
@@ -146,8 +146,10 @@ struct AccessTarget : public AccessedEntity {
MemberNonce _,
CXXRecordDecl *NamingClass,
DeclAccessPair FoundDecl,
- QualType BaseObjectType)
- : AccessedEntity(Context, Member, NamingClass, FoundDecl, BaseObjectType) {
+ QualType BaseObjectType,
+ bool IsUsingDecl = false)
+ : AccessedEntity(Context, Member, NamingClass, FoundDecl, BaseObjectType),
+ IsUsingDeclaration(IsUsingDecl) {
initialize();
}
@@ -216,6 +218,7 @@ private:
DeclaringClass = DeclaringClass->getCanonicalDecl();
}
+ bool IsUsingDeclaration : 1;
bool HasInstanceContext : 1;
mutable bool CalculatedInstanceContext : 1;
mutable const CXXRecordDecl *InstanceContext;
@@ -445,8 +448,8 @@ static AccessResult MatchesFriend(Sema &S,
continue;
// If the template names don't match, it can't be a dependent
- // match. This isn't true in C++0x because of template aliases.
- if (!S.LangOpts.CPlusPlus0x && CTD->getDeclName() != Friend->getDeclName())
+ // match.
+ if (CTD->getDeclName() != Friend->getDeclName())
continue;
// If the class's context can't instantiate to the friend's
@@ -1129,6 +1132,44 @@ static void DiagnoseBadAccess(Sema &S, SourceLocation Loc,
DiagnoseAccessPath(S, EC, Entity);
}
+/// MSVC has a bug where if during an using declaration name lookup,
+/// the declaration found is unaccessible (private) and that declaration
+/// was bring into scope via another using declaration whose target
+/// declaration is accessible (public) then no error is generated.
+/// Example:
+/// class A {
+/// public:
+/// int f();
+/// };
+/// class B : public A {
+/// private:
+/// using A::f;
+/// };
+/// class C : public B {
+/// private:
+/// using B::f;
+/// };
+///
+/// Here, B::f is private so this should fail in Standard C++, but
+/// because B::f refers to A::f which is public MSVC accepts it.
+static bool IsMicrosoftUsingDeclarationAccessBug(Sema& S,
+ SourceLocation AccessLoc,
+ AccessTarget &Entity) {
+ if (UsingShadowDecl *Shadow =
+ dyn_cast<UsingShadowDecl>(Entity.getTargetDecl())) {
+ const NamedDecl *OrigDecl = Entity.getTargetDecl()->getUnderlyingDecl();
+ if (Entity.getTargetDecl()->getAccess() == AS_private &&
+ (OrigDecl->getAccess() == AS_public ||
+ OrigDecl->getAccess() == AS_protected)) {
+ S.Diag(AccessLoc, diag::war_ms_using_declaration_inaccessible)
+ << Shadow->getUsingDecl()->getQualifiedNameAsString()
+ << OrigDecl->getQualifiedNameAsString();
+ return true;
+ }
+ }
+ return false;
+}
+
/// Determines whether the accessed entity is accessible. Public members
/// have been weeded out by this point.
static AccessResult IsAccessible(Sema &S,
@@ -1232,6 +1273,10 @@ static AccessResult CheckEffectiveAccess(Sema &S,
AccessTarget &Entity) {
assert(Entity.getAccess() != AS_public && "called for public access!");
+ if (S.getLangOptions().Microsoft &&
+ IsMicrosoftUsingDeclarationAccessBug(S, Loc, Entity))
+ return AR_accessible;
+
switch (IsAccessible(S, EC, Entity)) {
case AR_dependent:
DelayDependentAccess(S, EC, Loc, Entity);
@@ -1415,30 +1460,48 @@ Sema::AccessResult Sema::CheckConstructorAccess(SourceLocation UseLoc,
AccessTarget AccessEntity(Context, AccessTarget::Member, NamingClass,
DeclAccessPair::make(Constructor, Access),
QualType());
+ PartialDiagnostic PD(PDiag());
switch (Entity.getKind()) {
default:
- AccessEntity.setDiag(IsCopyBindingRefToTemp
- ? diag::ext_rvalue_to_reference_access_ctor
- : diag::err_access_ctor);
+ PD = PDiag(IsCopyBindingRefToTemp
+ ? diag::ext_rvalue_to_reference_access_ctor
+ : diag::err_access_ctor);
+
break;
case InitializedEntity::EK_Base:
- AccessEntity.setDiag(PDiag(diag::err_access_base)
- << Entity.isInheritedVirtualBase()
- << Entity.getBaseSpecifier()->getType()
- << getSpecialMember(Constructor));
+ PD = PDiag(diag::err_access_base_ctor);
+ PD << Entity.isInheritedVirtualBase()
+ << Entity.getBaseSpecifier()->getType() << getSpecialMember(Constructor);
break;
case InitializedEntity::EK_Member: {
const FieldDecl *Field = cast<FieldDecl>(Entity.getDecl());
- AccessEntity.setDiag(PDiag(diag::err_access_field)
- << Field->getType()
- << getSpecialMember(Constructor));
+ PD = PDiag(diag::err_access_field_ctor);
+ PD << Field->getType() << getSpecialMember(Constructor);
break;
}
}
+ return CheckConstructorAccess(UseLoc, Constructor, Access, PD);
+}
+
+/// Checks access to a constructor.
+Sema::AccessResult Sema::CheckConstructorAccess(SourceLocation UseLoc,
+ CXXConstructorDecl *Constructor,
+ AccessSpecifier Access,
+ PartialDiagnostic PD) {
+ if (!getLangOptions().AccessControl ||
+ Access == AS_public)
+ return AR_accessible;
+
+ CXXRecordDecl *NamingClass = Constructor->getParent();
+ AccessTarget AccessEntity(Context, AccessTarget::Member, NamingClass,
+ DeclAccessPair::make(Constructor, Access),
+ QualType());
+ AccessEntity.setDiag(PD);
+
return CheckAccess(*this, UseLoc, AccessEntity);
}
@@ -1465,7 +1528,8 @@ Sema::AccessResult Sema::CheckDirectMemberAccess(SourceLocation UseLoc,
Sema::AccessResult Sema::CheckAllocationAccess(SourceLocation OpLoc,
SourceRange PlacementRange,
CXXRecordDecl *NamingClass,
- DeclAccessPair Found) {
+ DeclAccessPair Found,
+ bool Diagnose) {
if (!getLangOptions().AccessControl ||
!NamingClass ||
Found.getAccess() == AS_public)
@@ -1473,8 +1537,9 @@ Sema::AccessResult Sema::CheckAllocationAccess(SourceLocation OpLoc,
AccessTarget Entity(Context, AccessTarget::Member, NamingClass, Found,
QualType());
- Entity.setDiag(diag::err_access)
- << PlacementRange;
+ if (Diagnose)
+ Entity.setDiag(diag::err_access)
+ << PlacementRange;
return CheckAccess(*this, OpLoc, Entity);
}
@@ -1573,9 +1638,8 @@ void Sema::CheckLookupAccess(const LookupResult &R) {
if (I.getAccess() != AS_public) {
AccessTarget Entity(Context, AccessedEntity::Member,
R.getNamingClass(), I.getPair(),
- R.getBaseObjectType());
+ R.getBaseObjectType(), R.isUsingDeclaration());
Entity.setDiag(diag::err_access);
-
CheckAccess(*this, R.getNameLoc(), Entity);
}
}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp
index ed54f0f..e46ad5b 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp
@@ -252,8 +252,7 @@ static bool tryDiagnoseOverloadedCast(Sema &S, CastType CT,
(CT == CT_CStyle || CT == CT_Functional));
InitializationSequence sequence(S, entity, initKind, &src, 1);
- assert(sequence.getKind() == InitializationSequence::FailedSequence &&
- "initialization succeeded on second try?");
+ assert(sequence.Failed() && "initialization succeeded on second try?");
switch (sequence.getFailureKind()) {
default: return false;
@@ -1195,8 +1194,7 @@ TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr, QualType DestType,
// On the other hand, if we're checking a C-style cast, we've still got
// the reinterpret_cast way.
- if (InitSeq.getKind() == InitializationSequence::FailedSequence &&
- (CStyle || !DestType->isReferenceType()))
+ if (InitSeq.Failed() && (CStyle || !DestType->isReferenceType()))
return TC_NotApplicable;
ExprResult Result
@@ -1288,6 +1286,62 @@ static TryCastResult TryConstCast(Sema &Self, Expr *SrcExpr, QualType DestType,
return TC_Success;
}
+// Checks for undefined behavior in reinterpret_cast.
+// The cases that is checked for is:
+// *reinterpret_cast<T*>(&a)
+// reinterpret_cast<T&>(a)
+// where accessing 'a' as type 'T' will result in undefined behavior.
+void Sema::CheckCompatibleReinterpretCast(QualType SrcType, QualType DestType,
+ bool IsDereference,
+ SourceRange Range) {
+ unsigned DiagID = IsDereference ?
+ diag::warn_pointer_indirection_from_incompatible_type :
+ diag::warn_undefined_reinterpret_cast;
+
+ if (Diags.getDiagnosticLevel(DiagID, Range.getBegin()) ==
+ Diagnostic::Ignored) {
+ return;
+ }
+
+ QualType SrcTy, DestTy;
+ if (IsDereference) {
+ if (!SrcType->getAs<PointerType>() || !DestType->getAs<PointerType>()) {
+ return;
+ }
+ SrcTy = SrcType->getPointeeType();
+ DestTy = DestType->getPointeeType();
+ } else {
+ if (!DestType->getAs<ReferenceType>()) {
+ return;
+ }
+ SrcTy = SrcType;
+ DestTy = DestType->getPointeeType();
+ }
+
+ // Cast is compatible if the types are the same.
+ if (Context.hasSameUnqualifiedType(DestTy, SrcTy)) {
+ return;
+ }
+ // or one of the types is a char or void type
+ if (DestTy->isAnyCharacterType() || DestTy->isVoidType() ||
+ SrcTy->isAnyCharacterType() || SrcTy->isVoidType()) {
+ return;
+ }
+ // or one of the types is a tag type.
+ if (SrcTy->getAs<TagType>() || DestTy->getAs<TagType>()) {
+ return;
+ }
+
+ // FIXME: Scoped enums?
+ if ((SrcTy->isUnsignedIntegerType() && DestTy->isSignedIntegerType()) ||
+ (SrcTy->isSignedIntegerType() && DestTy->isUnsignedIntegerType())) {
+ if (Context.getTypeSize(DestTy) == Context.getTypeSize(SrcTy)) {
+ return;
+ }
+ }
+
+ Diag(Range.getBegin(), DiagID) << SrcType << DestType << Range;
+}
static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
QualType DestType, bool CStyle,
@@ -1324,6 +1378,11 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
return TC_NotApplicable;
}
+ if (!CStyle) {
+ Self.CheckCompatibleReinterpretCast(SrcType, DestType,
+ /*isDereference=*/false, OpRange);
+ }
+
// C++ 5.2.10p10: [...] a reference cast reinterpret_cast<T&>(x) has the
// same effect as the conversion *reinterpret_cast<T*>(&x) with the
// built-in & and * operators.
@@ -1454,9 +1513,11 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
if (DestType->isIntegralType(Self.Context)) {
assert(srcIsPtr && "One type must be a pointer");
// C++ 5.2.10p4: A pointer can be explicitly converted to any integral
- // type large enough to hold it.
- if (Self.Context.getTypeSize(SrcType) >
- Self.Context.getTypeSize(DestType)) {
+ // type large enough to hold it; except in Microsoft mode, where the
+ // integral type size doesn't matter.
+ if ((Self.Context.getTypeSize(SrcType) >
+ Self.Context.getTypeSize(DestType)) &&
+ !Self.getLangOptions().Microsoft) {
msg = diag::err_bad_reinterpret_cast_small_int;
return TC_Failed;
}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp
index 7049f6b..61d9e93 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp
@@ -94,9 +94,13 @@ DeclContext *Sema::computeDeclContext(const CXXScopeSpec &SS,
if (EnteringContext) {
const Type *NNSType = NNS->getAsType();
if (!NNSType) {
- // do nothing, fall out
- } else if (const TemplateSpecializationType *SpecType
- = NNSType->getAs<TemplateSpecializationType>()) {
+ return 0;
+ }
+
+ // Look through type alias templates, per C++0x [temp.dep.type]p1.
+ NNSType = Context.getCanonicalType(NNSType);
+ if (const TemplateSpecializationType *SpecType
+ = NNSType->getAs<TemplateSpecializationType>()) {
// We are entering the context of the nested name specifier, so try to
// match the nested name specifier to either a primary class template
// or a class template partial specialization.
@@ -382,7 +386,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S,
isDependent = ObjectType->isDependentType();
} else if (SS.isSet()) {
// This nested-name-specifier occurs after another nested-name-specifier,
- // so long into the context associated with the prior nested-name-specifier.
+ // so look into the context associated with the prior nested-name-specifier.
LookupCtx = computeDeclContext(SS, EnteringContext);
isDependent = isDependentScopeSpecifier(SS);
Found.setContextRange(SS.getRange());
@@ -419,7 +423,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S,
// class-name or namespace-name. [...]
//
// Qualified name lookup into a class will not find a namespace-name,
- // so we do not need to diagnoste that case specifically. However,
+ // so we do not need to diagnose that case specifically. However,
// this qualified name lookup may find nothing. In that case, perform
// unqualified name lookup in the given scope (if available) or
// reconstruct the result from when name lookup was performed at template
@@ -546,25 +550,33 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S,
InjectedClassNameTypeLoc InjectedTL
= TLB.push<InjectedClassNameTypeLoc>(T);
InjectedTL.setNameLoc(IdentifierLoc);
- } else if (isa<RecordDecl>(SD)) {
+ } else if (isa<RecordType>(T)) {
RecordTypeLoc RecordTL = TLB.push<RecordTypeLoc>(T);
RecordTL.setNameLoc(IdentifierLoc);
- } else if (isa<TypedefNameDecl>(SD)) {
+ } else if (isa<TypedefType>(T)) {
TypedefTypeLoc TypedefTL = TLB.push<TypedefTypeLoc>(T);
TypedefTL.setNameLoc(IdentifierLoc);
- } else if (isa<EnumDecl>(SD)) {
+ } else if (isa<EnumType>(T)) {
EnumTypeLoc EnumTL = TLB.push<EnumTypeLoc>(T);
EnumTL.setNameLoc(IdentifierLoc);
- } else if (isa<TemplateTypeParmDecl>(SD)) {
+ } else if (isa<TemplateTypeParmType>(T)) {
TemplateTypeParmTypeLoc TemplateTypeTL
= TLB.push<TemplateTypeParmTypeLoc>(T);
TemplateTypeTL.setNameLoc(IdentifierLoc);
- } else {
- assert(isa<UnresolvedUsingTypenameDecl>(SD) &&
- "Unhandled TypeDecl node in nested-name-specifier");
+ } else if (isa<UnresolvedUsingType>(T)) {
UnresolvedUsingTypeLoc UnresolvedTL
= TLB.push<UnresolvedUsingTypeLoc>(T);
UnresolvedTL.setNameLoc(IdentifierLoc);
+ } else if (isa<SubstTemplateTypeParmType>(T)) {
+ SubstTemplateTypeParmTypeLoc TL
+ = TLB.push<SubstTemplateTypeParmTypeLoc>(T);
+ TL.setNameLoc(IdentifierLoc);
+ } else if (isa<SubstTemplateTypeParmPackType>(T)) {
+ SubstTemplateTypeParmPackTypeLoc TL
+ = TLB.push<SubstTemplateTypeParmPackTypeLoc>(T);
+ TL.setNameLoc(IdentifierLoc);
+ } else {
+ llvm_unreachable("Unhandled TypeDecl node in nested-name-specifier");
}
SS.Extend(Context, SourceLocation(), TLB.getTypeLocInContext(Context, T),
@@ -704,8 +716,13 @@ bool Sema::ActOnCXXNestedNameSpecifier(Scope *S,
if (T.isNull())
return true;
- // FIXME: Template aliases will need to check the resulting type to make
- // sure that it's either dependent or a tag type.
+ // Alias template specializations can produce types which are not valid
+ // nested name specifiers.
+ if (!T->isDependentType() && !T->getAs<TagType>()) {
+ Diag(TemplateNameLoc, diag::err_nested_name_spec_non_tag) << T;
+ NoteAllFoundTemplates(Template.get());
+ return true;
+ }
// Provide source-location information for the template specialization
// type.
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
index 5b645df..7e22b33 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp
@@ -318,9 +318,13 @@ bool Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall) {
TheCall->getCallee()->getLocStart());
}
- // Memset handling
- if (FnInfo->isStr("memset"))
- CheckMemsetArguments(TheCall);
+ // Memset/memcpy/memmove handling
+ if (FDecl->getLinkage() == ExternalLinkage &&
+ (!getLangOptions().CPlusPlus || FDecl->isExternC())) {
+ if (FnInfo->isStr("memset") || FnInfo->isStr("memcpy") ||
+ FnInfo->isStr("memmove"))
+ CheckMemsetcpymoveArguments(TheCall, FnInfo);
+ }
return false;
}
@@ -1832,49 +1836,59 @@ void Sema::CheckFormatString(const StringLiteral *FExpr,
//===--- CHECK: Standard memory functions ---------------------------------===//
+/// \brief Determine whether the given type is a dynamic class type (e.g.,
+/// whether it has a vtable).
+static bool isDynamicClassType(QualType T) {
+ if (CXXRecordDecl *Record = T->getAsCXXRecordDecl())
+ if (CXXRecordDecl *Definition = Record->getDefinition())
+ if (Definition->isDynamicClass())
+ return true;
+
+ return false;
+}
+
/// \brief Check for dangerous or invalid arguments to memset().
///
-/// This issues warnings on known problematic or dangerous or unspecified
-/// arguments to the standard 'memset' function call.
+/// This issues warnings on known problematic, dangerous or unspecified
+/// arguments to the standard 'memset', 'memcpy', and 'memmove' function calls.
///
/// \param Call The call expression to diagnose.
-void Sema::CheckMemsetArguments(const CallExpr *Call) {
+void Sema::CheckMemsetcpymoveArguments(const CallExpr *Call,
+ const IdentifierInfo *FnName) {
// It is possible to have a non-standard definition of memset. Validate
// we have the proper number of arguments, and if not, abort further
// checking.
if (Call->getNumArgs() != 3)
return;
- const Expr *Dest = Call->getArg(0)->IgnoreParenImpCasts();
-
- // The type checking for this warning is moderately expensive, only do it
- // when enabled.
- if (getDiagnostics().getDiagnosticLevel(diag::warn_non_pod_memset,
- Dest->getExprLoc()) ==
- Diagnostic::Ignored)
- return;
-
- QualType DestTy = Dest->getType();
- if (const PointerType *DestPtrTy = DestTy->getAs<PointerType>()) {
- QualType PointeeTy = DestPtrTy->getPointeeType();
- if (PointeeTy->isVoidType())
- return;
-
- // Check the C++11 POD definition regardless of language mode; it is more
- // relaxed than earlier definitions and we don't want spurrious warnings.
- if (PointeeTy->isCXX11PODType())
- return;
-
- DiagRuntimeBehavior(
- Dest->getExprLoc(), Dest,
- PDiag(diag::warn_non_pod_memset)
- << PointeeTy << Call->getCallee()->getSourceRange());
+ unsigned LastArg = FnName->isStr("memset")? 1 : 2;
+ for (unsigned ArgIdx = 0; ArgIdx != LastArg; ++ArgIdx) {
+ const Expr *Dest = Call->getArg(ArgIdx)->IgnoreParenImpCasts();
+
+ QualType DestTy = Dest->getType();
+ if (const PointerType *DestPtrTy = DestTy->getAs<PointerType>()) {
+ QualType PointeeTy = DestPtrTy->getPointeeType();
+ if (PointeeTy->isVoidType())
+ continue;
+
+ // Always complain about dynamic classes.
+ if (isDynamicClassType(PointeeTy)) {
+ DiagRuntimeBehavior(
+ Dest->getExprLoc(), Dest,
+ PDiag(diag::warn_dyn_class_memaccess)
+ << ArgIdx << FnName << PointeeTy
+ << Call->getCallee()->getSourceRange());
+ } else {
+ continue;
+ }
- SourceRange ArgRange = Call->getArg(0)->getSourceRange();
- DiagRuntimeBehavior(
- Dest->getExprLoc(), Dest,
- PDiag(diag::note_non_pod_memset_silence)
- << FixItHint::CreateInsertion(ArgRange.getBegin(), "(void*)"));
+ SourceRange ArgRange = Call->getArg(0)->getSourceRange();
+ DiagRuntimeBehavior(
+ Dest->getExprLoc(), Dest,
+ PDiag(diag::note_bad_memaccess_silence)
+ << FixItHint::CreateInsertion(ArgRange.getBegin(), "(void*)"));
+ break;
+ }
}
}
@@ -2391,7 +2405,7 @@ IntRange GetValueRange(ASTContext &C, APValue &result, QualType Ty,
// the sign right on this one case. It would be nice if APValue
// preserved this.
assert(result.isLValue());
- return IntRange(MaxWidth, Ty->isUnsignedIntegerType());
+ return IntRange(MaxWidth, Ty->isUnsignedIntegerOrEnumerationType());
}
/// Pseudo-evaluate the given integer expression, estimating the
@@ -2565,7 +2579,8 @@ IntRange GetExprRange(ASTContext &C, Expr *E, unsigned MaxWidth) {
llvm::APSInt BitWidthAP = BitField->getBitWidth()->EvaluateAsInt(C);
unsigned BitWidth = BitWidthAP.getZExtValue();
- return IntRange(BitWidth, BitField->getType()->isUnsignedIntegerType());
+ return IntRange(BitWidth,
+ BitField->getType()->isUnsignedIntegerOrEnumerationType());
}
return IntRange::forValueOfType(C, E->getType());
@@ -2982,6 +2997,13 @@ void CheckImplicitConversion(Sema &S, Expr *E, QualType T,
if (!Source->isIntegerType() || !Target->isIntegerType())
return;
+ if ((E->isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull)
+ == Expr::NPCK_GNUNull) && Target->isIntegerType()) {
+ S.Diag(E->getExprLoc(), diag::warn_impcast_null_pointer_to_integer)
+ << E->getSourceRange() << clang::SourceRange(CC);
+ return;
+ }
+
IntRange SourceRange = GetExprRange(S.Context, E);
IntRange TargetRange = IntRange::forTargetOfCanonicalType(S.Context, Target);
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
index cc8726d..e328eeb 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
@@ -2658,6 +2658,16 @@ CXCursorKind clang::getCursorKindForDecl(Decl *D) {
case Decl::UnresolvedUsingTypename:
return CXCursor_UsingDeclaration;
+ case Decl::ObjCPropertyImpl:
+ switch (cast<ObjCPropertyImplDecl>(D)->getPropertyImplementation()) {
+ case ObjCPropertyImplDecl::Dynamic:
+ return CXCursor_ObjCDynamicDecl;
+
+ case ObjCPropertyImplDecl::Synthesize:
+ return CXCursor_ObjCSynthesizeDecl;
+ }
+ break;
+
default:
if (TagDecl *TD = dyn_cast<TagDecl>(D)) {
switch (TD->getTagKind()) {
@@ -3078,6 +3088,7 @@ typedef llvm::SmallPtrSet<IdentifierInfo*, 16> AddedPropertiesSet;
static void AddObjCProperties(ObjCContainerDecl *Container,
bool AllowCategories,
+ bool AllowNullaryMethods,
DeclContext *CurContext,
AddedPropertiesSet &AddedProperties,
ResultBuilder &Results) {
@@ -3092,32 +3103,75 @@ static void AddObjCProperties(ObjCContainerDecl *Container,
Results.MaybeAddResult(Result(*P, 0), CurContext);
}
+ // Add nullary methods
+ if (AllowNullaryMethods) {
+ ASTContext &Context = Container->getASTContext();
+ for (ObjCContainerDecl::method_iterator M = Container->meth_begin(),
+ MEnd = Container->meth_end();
+ M != MEnd; ++M) {
+ if (M->getSelector().isUnarySelector())
+ if (IdentifierInfo *Name = M->getSelector().getIdentifierInfoForSlot(0))
+ if (AddedProperties.insert(Name)) {
+ CodeCompletionBuilder Builder(Results.getAllocator());
+ AddResultTypeChunk(Context, *M, Builder);
+ Builder.AddTypedTextChunk(
+ Results.getAllocator().CopyString(Name->getName()));
+
+ CXAvailabilityKind Availability = CXAvailability_Available;
+ switch (M->getAvailability()) {
+ case AR_Available:
+ case AR_NotYetIntroduced:
+ Availability = CXAvailability_Available;
+ break;
+
+ case AR_Deprecated:
+ Availability = CXAvailability_Deprecated;
+ break;
+
+ case AR_Unavailable:
+ Availability = CXAvailability_NotAvailable;
+ break;
+ }
+
+ Results.MaybeAddResult(Result(Builder.TakeString(),
+ CCP_MemberDeclaration + CCD_MethodAsProperty,
+ M->isInstanceMethod()
+ ? CXCursor_ObjCInstanceMethodDecl
+ : CXCursor_ObjCClassMethodDecl,
+ Availability),
+ CurContext);
+ }
+ }
+ }
+
+
// Add properties in referenced protocols.
if (ObjCProtocolDecl *Protocol = dyn_cast<ObjCProtocolDecl>(Container)) {
for (ObjCProtocolDecl::protocol_iterator P = Protocol->protocol_begin(),
PEnd = Protocol->protocol_end();
P != PEnd; ++P)
- AddObjCProperties(*P, AllowCategories, CurContext, AddedProperties,
- Results);
+ AddObjCProperties(*P, AllowCategories, AllowNullaryMethods, CurContext,
+ AddedProperties, Results);
} else if (ObjCInterfaceDecl *IFace = dyn_cast<ObjCInterfaceDecl>(Container)){
if (AllowCategories) {
// Look through categories.
for (ObjCCategoryDecl *Category = IFace->getCategoryList();
Category; Category = Category->getNextClassCategory())
- AddObjCProperties(Category, AllowCategories, CurContext,
- AddedProperties, Results);
+ AddObjCProperties(Category, AllowCategories, AllowNullaryMethods,
+ CurContext, AddedProperties, Results);
}
// Look through protocols.
for (ObjCInterfaceDecl::all_protocol_iterator
I = IFace->all_referenced_protocol_begin(),
E = IFace->all_referenced_protocol_end(); I != E; ++I)
- AddObjCProperties(*I, AllowCategories, CurContext, AddedProperties,
- Results);
+ AddObjCProperties(*I, AllowCategories, AllowNullaryMethods, CurContext,
+ AddedProperties, Results);
// Look in the superclass.
if (IFace->getSuperClass())
- AddObjCProperties(IFace->getSuperClass(), AllowCategories, CurContext,
+ AddObjCProperties(IFace->getSuperClass(), AllowCategories,
+ AllowNullaryMethods, CurContext,
AddedProperties, Results);
} else if (const ObjCCategoryDecl *Category
= dyn_cast<ObjCCategoryDecl>(Container)) {
@@ -3125,8 +3179,8 @@ static void AddObjCProperties(ObjCContainerDecl *Container,
for (ObjCCategoryDecl::protocol_iterator P = Category->protocol_begin(),
PEnd = Category->protocol_end();
P != PEnd; ++P)
- AddObjCProperties(*P, AllowCategories, CurContext, AddedProperties,
- Results);
+ AddObjCProperties(*P, AllowCategories, AllowNullaryMethods, CurContext,
+ AddedProperties, Results);
}
}
@@ -3192,14 +3246,16 @@ void Sema::CodeCompleteMemberReferenceExpr(Scope *S, ExprTy *BaseE,
const ObjCObjectPointerType *ObjCPtr
= BaseType->getAsObjCInterfacePointerType();
assert(ObjCPtr && "Non-NULL pointer guaranteed above!");
- AddObjCProperties(ObjCPtr->getInterfaceDecl(), true, CurContext,
+ AddObjCProperties(ObjCPtr->getInterfaceDecl(), true,
+ /*AllowNullaryMethods=*/true, CurContext,
AddedProperties, Results);
// Add properties from the protocols in a qualified interface.
for (ObjCObjectPointerType::qual_iterator I = ObjCPtr->qual_begin(),
E = ObjCPtr->qual_end();
I != E; ++I)
- AddObjCProperties(*I, true, CurContext, AddedProperties, Results);
+ AddObjCProperties(*I, true, /*AllowNullaryMethods=*/true, CurContext,
+ AddedProperties, Results);
} else if ((IsArrow && BaseType->isObjCObjectPointerType()) ||
(!IsArrow && BaseType->isObjCObjectType())) {
// Objective-C instance variable access.
@@ -4109,6 +4165,8 @@ void Sema::CodeCompleteObjCPropertyFlags(Scope *S, ObjCDeclSpec &ODS) {
Results.AddResult(CodeCompletionResult("copy"));
if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_nonatomic))
Results.AddResult(CodeCompletionResult("nonatomic"));
+ if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_atomic))
+ Results.AddResult(CodeCompletionResult("atomic"));
if (!ObjCPropertyFlagConflicts(Attributes, ObjCDeclSpec::DQ_PR_setter)) {
CodeCompletionBuilder Setter(Results.getAllocator());
Setter.AddTypedTextChunk("setter");
@@ -5334,11 +5392,13 @@ void Sema::CodeCompleteObjCPropertyDefinition(Scope *S, Decl *ObjCImpDecl) {
Results.EnterNewScope();
if (ObjCImplementationDecl *ClassImpl
= dyn_cast<ObjCImplementationDecl>(Container))
- AddObjCProperties(ClassImpl->getClassInterface(), false, CurContext,
+ AddObjCProperties(ClassImpl->getClassInterface(), false,
+ /*AllowNullaryMethods=*/false, CurContext,
AddedProperties, Results);
else
AddObjCProperties(cast<ObjCCategoryImplDecl>(Container)->getCategoryDecl(),
- false, CurContext, AddedProperties, Results);
+ false, /*AllowNullaryMethods=*/false, CurContext,
+ AddedProperties, Results);
Results.ExitScope();
HandleCodeCompleteResults(this, CodeCompleter,
@@ -5549,7 +5609,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
bool IsInstanceMethod,
QualType ReturnType,
ASTContext &Context,
- const KnownMethodsMap &KnownMethods,
+ VisitedSelectorSet &KnownSelectors,
ResultBuilder &Results) {
IdentifierInfo *PropName = Property->getIdentifier();
if (!PropName || PropName->getLength() == 0)
@@ -5595,7 +5655,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
// Add the normal accessor -(type)key.
if (IsInstanceMethod &&
- !KnownMethods.count(Selectors.getNullarySelector(PropName)) &&
+ KnownSelectors.insert(Selectors.getNullarySelector(PropName)) &&
ReturnTypeMatchesProperty && !Property->getGetterMethodDecl()) {
if (ReturnType.isNull())
AddObjCPassingTypeChunk(Property->getType(), Context, Builder);
@@ -5615,7 +5675,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
Property->getType()->isBooleanType())))) {
std::string SelectorName = (llvm::Twine("is") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getNullarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getNullarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("BOOL");
@@ -5634,7 +5694,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
!Property->getSetterMethodDecl()) {
std::string SelectorName = (llvm::Twine("set") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -5685,7 +5745,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
(ReturnType.isNull() || ReturnType->isIntegerType())) {
std::string SelectorName = (llvm::Twine("countOf") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getNullarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getNullarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("NSUInteger");
@@ -5708,7 +5768,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
std::string SelectorName
= (llvm::Twine("objectIn") + UpperKey + "AtIndex").str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("id");
@@ -5735,7 +5795,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
std::string SelectorName
= (llvm::Twine(Property->getName()) + "AtIndexes").str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("NSArray *");
@@ -5760,7 +5820,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
&Context.Idents.get("range")
};
- if (!KnownMethods.count(Selectors.getSelector(2, SelectorIds))) {
+ if (KnownSelectors.insert(Selectors.getSelector(2, SelectorIds))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -5794,7 +5854,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
&Context.Idents.get(SelectorName)
};
- if (!KnownMethods.count(Selectors.getSelector(2, SelectorIds))) {
+ if (KnownSelectors.insert(Selectors.getSelector(2, SelectorIds))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -5826,7 +5886,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
&Context.Idents.get("atIndexes")
};
- if (!KnownMethods.count(Selectors.getSelector(2, SelectorIds))) {
+ if (KnownSelectors.insert(Selectors.getSelector(2, SelectorIds))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -5854,7 +5914,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
std::string SelectorName
= (llvm::Twine("removeObjectFrom") + UpperKey + "AtIndex").str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -5876,7 +5936,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
std::string SelectorName
= (llvm::Twine("remove") + UpperKey + "AtIndexes").str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -5902,7 +5962,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
&Context.Idents.get("withObject")
};
- if (!KnownMethods.count(Selectors.getSelector(2, SelectorIds))) {
+ if (KnownSelectors.insert(Selectors.getSelector(2, SelectorIds))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -5935,7 +5995,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
&Context.Idents.get(SelectorName2)
};
- if (!KnownMethods.count(Selectors.getSelector(2, SelectorIds))) {
+ if (KnownSelectors.insert(Selectors.getSelector(2, SelectorIds))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -5968,7 +6028,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
->getName() == "NSEnumerator"))) {
std::string SelectorName = (llvm::Twine("enumeratorOf") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getNullarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getNullarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("NSEnumerator *");
@@ -5986,7 +6046,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
(ReturnType.isNull() || ReturnType->isObjCObjectPointerType())) {
std::string SelectorName = (llvm::Twine("memberOf") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddPlaceholderChunk("object-type");
@@ -6016,7 +6076,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
std::string SelectorName
= (llvm::Twine("add") + UpperKey + llvm::Twine("Object")).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -6038,7 +6098,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
if (IsInstanceMethod && ReturnTypeMatchesVoid) {
std::string SelectorName = (llvm::Twine("add") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -6060,7 +6120,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
std::string SelectorName
= (llvm::Twine("remove") + UpperKey + llvm::Twine("Object")).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -6082,7 +6142,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
if (IsInstanceMethod && ReturnTypeMatchesVoid) {
std::string SelectorName = (llvm::Twine("remove") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -6103,7 +6163,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
if (IsInstanceMethod && ReturnTypeMatchesVoid) {
std::string SelectorName = (llvm::Twine("intersect") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getUnarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getUnarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("void");
@@ -6131,7 +6191,7 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
std::string SelectorName
= (llvm::Twine("keyPathsForValuesAffecting") + UpperKey).str();
IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
- if (!KnownMethods.count(Selectors.getNullarySelector(SelectorId))) {
+ if (KnownSelectors.insert(Selectors.getNullarySelector(SelectorId))) {
if (ReturnType.isNull()) {
Builder.AddChunk(CodeCompletionString::CK_LeftParen);
Builder.AddTextChunk("NSSet *");
@@ -6140,7 +6200,28 @@ static void AddObjCKeyValueCompletions(ObjCPropertyDecl *Property,
Builder.AddTypedTextChunk(Allocator.CopyString(SelectorName));
Results.AddResult(Result(Builder.TakeString(), CCP_CodePattern,
- CXCursor_ObjCInstanceMethodDecl));
+ CXCursor_ObjCClassMethodDecl));
+ }
+ }
+
+ // + (BOOL)automaticallyNotifiesObserversForKey
+ if (!IsInstanceMethod &&
+ (ReturnType.isNull() ||
+ ReturnType->isIntegerType() ||
+ ReturnType->isBooleanType())) {
+ std::string SelectorName
+ = (llvm::Twine("automaticallyNotifiesObserversOf") + UpperKey).str();
+ IdentifierInfo *SelectorId = &Context.Idents.get(SelectorName);
+ if (KnownSelectors.insert(Selectors.getNullarySelector(SelectorId))) {
+ if (ReturnType.isNull()) {
+ Builder.AddChunk(CodeCompletionString::CK_LeftParen);
+ Builder.AddTextChunk("BOOL");
+ Builder.AddChunk(CodeCompletionString::CK_RightParen);
+ }
+
+ Builder.AddTypedTextChunk(Allocator.CopyString(SelectorName));
+ Results.AddResult(Result(Builder.TakeString(), CCP_CodePattern,
+ CXCursor_ObjCClassMethodDecl));
}
}
}
@@ -6271,6 +6352,13 @@ void Sema::CodeCompleteObjCMethodDecl(Scope *S,
llvm::SmallVector<ObjCContainerDecl *, 4> Containers;
Containers.push_back(SearchDecl);
+ VisitedSelectorSet KnownSelectors;
+ for (KnownMethodsMap::iterator M = KnownMethods.begin(),
+ MEnd = KnownMethods.end();
+ M != MEnd; ++M)
+ KnownSelectors.insert(M->first);
+
+
ObjCInterfaceDecl *IFace = dyn_cast<ObjCInterfaceDecl>(SearchDecl);
if (!IFace)
if (ObjCCategoryDecl *Category = dyn_cast<ObjCCategoryDecl>(SearchDecl))
@@ -6287,7 +6375,7 @@ void Sema::CodeCompleteObjCMethodDecl(Scope *S,
PEnd = Containers[I]->prop_end();
P != PEnd; ++P) {
AddObjCKeyValueCompletions(*P, IsInstanceMethod, ReturnType, Context,
- KnownMethods, Results);
+ KnownSelectors, Results);
}
}
}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
index 7214988..9446c0e 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
@@ -891,19 +891,19 @@ static bool isOutOfScopePreviousDeclaration(NamedDecl *,
/// Filters out lookup results that don't fall within the given scope
/// as determined by isDeclInScope.
-static void FilterLookupForScope(Sema &SemaRef, LookupResult &R,
- DeclContext *Ctx, Scope *S,
- bool ConsiderLinkage,
- bool ExplicitInstantiationOrSpecialization) {
+void Sema::FilterLookupForScope(LookupResult &R,
+ DeclContext *Ctx, Scope *S,
+ bool ConsiderLinkage,
+ bool ExplicitInstantiationOrSpecialization) {
LookupResult::Filter F = R.makeFilter();
while (F.hasNext()) {
NamedDecl *D = F.next();
- if (SemaRef.isDeclInScope(D, Ctx, S, ExplicitInstantiationOrSpecialization))
+ if (isDeclInScope(D, Ctx, S, ExplicitInstantiationOrSpecialization))
continue;
if (ConsiderLinkage &&
- isOutOfScopePreviousDeclaration(D, Ctx, SemaRef.Context))
+ isOutOfScopePreviousDeclaration(D, Ctx, Context))
continue;
F.erase();
@@ -938,7 +938,7 @@ static void RemoveUsingDecls(LookupResult &R) {
static bool IsDisallowedCopyOrAssign(const CXXMethodDecl *D) {
// FIXME: Should check for private access too but access is set after we get
// the decl here.
- if (D->isThisDeclarationADefinition())
+ if (D->doesThisDeclarationHaveABody())
return false;
if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(D))
@@ -973,10 +973,9 @@ bool Sema::ShouldWarnIfUnusedFileScopedDecl(const DeclaratorDecl *D) const {
return false;
}
- if (FD->isThisDeclarationADefinition() &&
+ if (FD->doesThisDeclarationHaveABody() &&
Context.DeclMustBeEmitted(FD))
return false;
-
} else if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {
if (!VD->isFileVarDecl() ||
VD->getType().isConstant(Context) ||
@@ -1506,18 +1505,21 @@ struct GNUCompatibleParamWarning {
/// getSpecialMember - get the special member enum for a method.
Sema::CXXSpecialMember Sema::getSpecialMember(const CXXMethodDecl *MD) {
if (const CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(MD)) {
+ if (Ctor->isDefaultConstructor())
+ return Sema::CXXDefaultConstructor;
+
if (Ctor->isCopyConstructor())
return Sema::CXXCopyConstructor;
-
- return Sema::CXXConstructor;
- }
-
- if (isa<CXXDestructorDecl>(MD))
+
+ if (Ctor->isMoveConstructor())
+ return Sema::CXXMoveConstructor;
+ } else if (isa<CXXDestructorDecl>(MD)) {
return Sema::CXXDestructor;
-
- assert(MD->isCopyAssignmentOperator() &&
- "Must have copy assignment operator");
- return Sema::CXXCopyAssignment;
+ } else if (MD->isCopyAssignmentOperator()) {
+ return Sema::CXXCopyAssignment;
+ }
+
+ return Sema::CXXInvalid;
}
/// canRedefineFunction - checks if a function can be redefined. Currently,
@@ -1525,7 +1527,7 @@ Sema::CXXSpecialMember Sema::getSpecialMember(const CXXMethodDecl *MD) {
/// GNU89 mode.
static bool canRedefineFunction(const FunctionDecl *FD,
const LangOptions& LangOpts) {
- return (LangOpts.GNUMode && !LangOpts.C99 && !LangOpts.CPlusPlus &&
+ return (LangOpts.GNUInline && !LangOpts.CPlusPlus &&
FD->isInlineSpecified() &&
FD->getStorageClass() == SC_Extern);
}
@@ -1728,6 +1730,11 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
<< New << getSpecialMember(OldMethod);
return true;
}
+ } else if (OldMethod->isExplicitlyDefaulted()) {
+ Diag(NewMethod->getLocation(),
+ diag::err_definition_of_explicitly_defaulted_member)
+ << getSpecialMember(OldMethod);
+ return true;
}
}
@@ -1907,10 +1914,6 @@ bool Sema::MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old) {
if (Old->isPure())
New->setPure();
- // Merge the "deleted" flag.
- if (Old->isDeleted())
- New->setDeleted();
-
// Merge attributes from the parameters. These can mismatch with K&R
// declarations.
if (New->getNumParams() == Old->getNumParams())
@@ -1933,7 +1936,9 @@ void Sema::mergeObjCMethodDecls(ObjCMethodDecl *newMethod,
for (ObjCMethodDecl::param_iterator oi = oldMethod->param_begin(),
ni = newMethod->param_begin(), ne = newMethod->param_end();
ni != ne; ++ni, ++oi)
- mergeParamDeclAttributes(*ni, *oi, Context);
+ mergeParamDeclAttributes(*ni, *oi, Context);
+
+ CheckObjCMethodOverride(newMethod, oldMethod, true);
}
/// MergeVarDeclTypes - We parsed a variable 'New' which has the same name and
@@ -2132,6 +2137,16 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
/// no declarator (e.g. "struct foo;") is parsed.
Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
DeclSpec &DS) {
+ return ParsedFreeStandingDeclSpec(S, AS, DS,
+ MultiTemplateParamsArg(*this, 0, 0));
+}
+
+/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
+/// no declarator (e.g. "struct foo;") is parsed. It also accopts template
+/// parameters to cope with template friend declarations.
+Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
+ DeclSpec &DS,
+ MultiTemplateParamsArg TemplateParams) {
Decl *TagD = 0;
TagDecl *Tag = 0;
if (DS.getTypeSpecType() == DeclSpec::TST_class ||
@@ -2163,7 +2178,7 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
// whatever routines created it handled the friendship aspect.
if (TagD && !Tag)
return 0;
- return ActOnFriendTypeDecl(S, DS, MultiTemplateParamsArg(*this, 0, 0));
+ return ActOnFriendTypeDecl(S, DS, TemplateParams);
}
// Track whether we warned about the fact that there aren't any
@@ -2484,6 +2499,24 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
PrevSpec, DiagID, getLangOptions());
}
+ // Ignore const/volatile/restrict qualifiers.
+ if (DS.getTypeQualifiers()) {
+ if (DS.getTypeQualifiers() & DeclSpec::TQ_const)
+ Diag(DS.getConstSpecLoc(), diag::ext_anonymous_struct_union_qualified)
+ << Record->isUnion() << 0
+ << FixItHint::CreateRemoval(DS.getConstSpecLoc());
+ if (DS.getTypeQualifiers() & DeclSpec::TQ_volatile)
+ Diag(DS.getVolatileSpecLoc(), diag::ext_anonymous_struct_union_qualified)
+ << Record->isUnion() << 1
+ << FixItHint::CreateRemoval(DS.getVolatileSpecLoc());
+ if (DS.getTypeQualifiers() & DeclSpec::TQ_restrict)
+ Diag(DS.getRestrictSpecLoc(), diag::ext_anonymous_struct_union_qualified)
+ << Record->isUnion() << 2
+ << FixItHint::CreateRemoval(DS.getRestrictSpecLoc());
+
+ DS.ClearTypeQualifiers();
+ }
+
// C++ [class.union]p2:
// The member-specification of an anonymous union shall only
// define non-static data members. [Note: nested types and
@@ -2502,7 +2535,12 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
Invalid = true;
}
- if (CheckNontrivialField(FD))
+ // C++ [class.union]p1
+ // An object of a class with a non-trivial constructor, a non-trivial
+ // copy constructor, a non-trivial destructor, or a non-trivial copy
+ // assignment operator cannot be a member of a union, nor can an
+ // array of such objects.
+ if (!getLangOptions().CPlusPlus0x && CheckNontrivialField(FD))
Invalid = true;
} else if ((*Mem)->isImplicit()) {
// Any implicit members are fine.
@@ -2572,7 +2610,8 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS,
/*IdentifierInfo=*/0,
Context.getTypeDeclType(Record),
TInfo,
- /*BitWidth=*/0, /*Mutable=*/false);
+ /*BitWidth=*/0, /*Mutable=*/false,
+ /*HasInit=*/false);
Anon->setAccess(AS);
if (getLangOptions().CPlusPlus)
FieldCollector->Add(cast<FieldDecl>(Anon));
@@ -2662,7 +2701,8 @@ Decl *Sema::BuildMicrosoftCAnonymousStruct(Scope *S, DeclSpec &DS,
/*IdentifierInfo=*/0,
Context.getTypeDeclType(Record),
TInfo,
- /*BitWidth=*/0, /*Mutable=*/false);
+ /*BitWidth=*/0, /*Mutable=*/false,
+ /*HasInit=*/false);
Anon->setImplicit();
// Add the anonymous struct object to the current context.
@@ -2829,7 +2869,8 @@ static bool RebuildDeclaratorInCurrentInstantiation(Sema &S, Declarator &D,
switch (DS.getTypeSpecType()) {
case DeclSpec::TST_typename:
case DeclSpec::TST_typeofType:
- case DeclSpec::TST_decltype: {
+ case DeclSpec::TST_decltype:
+ case DeclSpec::TST_underlyingType: {
// Grab the type from the parser.
TypeSourceInfo *TSI = 0;
QualType T = S.GetTypeFromParser(DS.getRepAsType(), &TSI);
@@ -2883,8 +2924,10 @@ static bool RebuildDeclaratorInCurrentInstantiation(Sema &S, Declarator &D,
return false;
}
-Decl *Sema::ActOnDeclarator(Scope *S, Declarator &D) {
- return HandleDeclarator(S, D, MultiTemplateParamsArg(*this), false);
+Decl *Sema::ActOnDeclarator(Scope *S, Declarator &D,
+ bool IsFunctionDefinition) {
+ return HandleDeclarator(S, D, MultiTemplateParamsArg(*this),
+ IsFunctionDefinition);
}
/// DiagnoseClassNameShadow - Implement C++ [class.mem]p13:
@@ -2952,7 +2995,6 @@ Decl *Sema::HandleDeclarator(Scope *S, Declarator &D,
<< D.getCXXScopeSpec().getRange();
return 0;
}
-
bool IsDependentContext = DC->isDependentContext();
if (!IsDependentContext &&
@@ -3294,15 +3336,13 @@ Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// Handle attributes prior to checking for duplicates in MergeVarDecl
ProcessDeclAttributes(S, NewTD, D);
+ CheckTypedefForVariablyModifiedType(S, NewTD);
+
return ActOnTypedefNameDecl(S, DC, NewTD, Previous, Redeclaration);
}
-/// ActOnTypedefNameDecl - Perform semantic checking for a declaration which
-/// declares a typedef-name, either using the 'typedef' type specifier or via
-/// a C++0x [dcl.typedef]p2 alias-declaration: 'using T = A;'.
-NamedDecl*
-Sema::ActOnTypedefNameDecl(Scope *S, DeclContext *DC, TypedefNameDecl *NewTD,
- LookupResult &Previous, bool &Redeclaration) {
+void
+Sema::CheckTypedefForVariablyModifiedType(Scope *S, TypedefNameDecl *NewTD) {
// C99 6.7.7p2: If a typedef name specifies a variably modified type
// then it shall have block scope.
// Note that variably modified types must be fixed before merging the decl so
@@ -3333,10 +3373,18 @@ Sema::ActOnTypedefNameDecl(Scope *S, DeclContext *DC, TypedefNameDecl *NewTD,
}
}
}
+}
+
+/// ActOnTypedefNameDecl - Perform semantic checking for a declaration which
+/// declares a typedef-name, either using the 'typedef' type specifier or via
+/// a C++0x [dcl.typedef]p2 alias-declaration: 'using T = A;'.
+NamedDecl*
+Sema::ActOnTypedefNameDecl(Scope *S, DeclContext *DC, TypedefNameDecl *NewTD,
+ LookupResult &Previous, bool &Redeclaration) {
// Merge the decl with the existing one if appropriate. If the decl is
// in an outer scope, it isn't the same thing.
- FilterLookupForScope(*this, Previous, DC, S, /*ConsiderLinkage*/ false,
+ FilterLookupForScope(Previous, DC, S, /*ConsiderLinkage*/ false,
/*ExplicitInstantiationOrSpecialization=*/false);
if (!Previous.empty()) {
Redeclaration = true;
@@ -3518,7 +3566,8 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
bool Invalid = false;
if (TemplateParameterList *TemplateParams
= MatchTemplateParametersToScopeSpecifier(
- D.getDeclSpec().getSourceRange().getBegin(),
+ D.getDeclSpec().getSourceRange().getBegin(),
+ D.getIdentifierLoc(),
D.getCXXScopeSpec(),
TemplateParamLists.get(),
TemplateParamLists.size(),
@@ -3540,7 +3589,6 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
<< II
<< SourceRange(TemplateParams->getTemplateLoc(),
TemplateParams->getRAngleLoc());
- isExplicitSpecialization = true;
}
}
@@ -3615,7 +3663,7 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
// Don't consider existing declarations that are in a different
// scope and are out-of-semantic-context declarations (if the new
// declaration has linkage).
- FilterLookupForScope(*this, Previous, DC, S, NewVD->hasLinkage(),
+ FilterLookupForScope(Previous, DC, S, NewVD->hasLinkage(),
isExplicitSpecialization);
if (!getLangOptions().CPlusPlus)
@@ -3806,8 +3854,12 @@ void Sema::CheckVariableDeclaration(VarDecl *NewVD,
}
if (NewVD->hasLocalStorage() && T.isObjCGCWeak()
- && !NewVD->hasAttr<BlocksAttr>())
- Diag(NewVD->getLocation(), diag::warn_attribute_weak_on_local);
+ && !NewVD->hasAttr<BlocksAttr>()) {
+ if (getLangOptions().getGCMode() != LangOptions::NonGC)
+ Diag(NewVD->getLocation(), diag::warn_gc_attribute_weak_on_local);
+ else
+ Diag(NewVD->getLocation(), diag::warn_attribute_weak_on_local);
+ }
bool isVM = T->isVariablyModifiedType();
if (isVM || NewVD->hasAttr<CleanupAttr>() ||
@@ -4062,7 +4114,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// Set the lexical context.
NewFD->setLexicalDeclContext(CurContext);
// Filter out previous declarations that don't match the scope.
- FilterLookupForScope(*this, Previous, DC, S, NewFD->hasLinkage(),
+ FilterLookupForScope(Previous, DC, S, NewFD->hasLinkage(),
/*ExplicitInstantiationOrSpecialization=*/false);
} else {
isFriend = D.getDeclSpec().isFriendSpecified();
@@ -4088,24 +4140,38 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
R = CheckConstructorDeclarator(D, R, SC);
// Create the new declaration
- NewFD = CXXConstructorDecl::Create(Context,
+ CXXConstructorDecl *NewCD = CXXConstructorDecl::Create(
+ Context,
cast<CXXRecordDecl>(DC),
D.getSourceRange().getBegin(),
NameInfo, R, TInfo,
isExplicit, isInline,
/*isImplicitlyDeclared=*/false);
+
+ NewFD = NewCD;
} else if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
// This is a C++ destructor declaration.
if (DC->isRecord()) {
R = CheckDestructorDeclarator(D, R, SC);
+ CXXRecordDecl *Record = cast<CXXRecordDecl>(DC);
- NewFD = CXXDestructorDecl::Create(Context,
- cast<CXXRecordDecl>(DC),
+ CXXDestructorDecl *NewDD = CXXDestructorDecl::Create(Context, Record,
D.getSourceRange().getBegin(),
NameInfo, R, TInfo,
isInline,
/*isImplicitlyDeclared=*/false);
+ NewFD = NewDD;
isVirtualOkay = true;
+
+ // If the class is complete, then we now create the implicit exception
+ // specification. If the class is incomplete or dependent, we can't do
+ // it yet.
+ if (getLangOptions().CPlusPlus0x && !Record->isDependentType() &&
+ Record->getDefinition() && !Record->isBeingDefined() &&
+ R->getAs<FunctionProtoType>()->getExceptionSpecType() == EST_None) {
+ AdjustDestructorExceptionSpec(Record, NewDD);
+ }
+
} else {
Diag(D.getIdentifierLoc(), diag::err_destructor_not_member);
@@ -4162,11 +4228,13 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
isStatic = true;
// This is a C++ method declaration.
- NewFD = CXXMethodDecl::Create(Context, cast<CXXRecordDecl>(DC),
- D.getSourceRange().getBegin(),
- NameInfo, R, TInfo,
- isStatic, SCAsWritten, isInline,
- SourceLocation());
+ CXXMethodDecl *NewMD = CXXMethodDecl::Create(
+ Context, cast<CXXRecordDecl>(DC),
+ D.getSourceRange().getBegin(),
+ NameInfo, R, TInfo,
+ isStatic, SCAsWritten, isInline,
+ SourceLocation());
+ NewFD = NewMD;
isVirtualOkay = !isStatic;
} else {
@@ -4202,6 +4270,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
if (TemplateParameterList *TemplateParams
= MatchTemplateParametersToScopeSpecifier(
D.getDeclSpec().getSourceRange().getBegin(),
+ D.getIdentifierLoc(),
D.getCXXScopeSpec(),
TemplateParamLists.get(),
TemplateParamLists.size(),
@@ -4339,7 +4408,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
}
// Filter out previous declarations that don't match the scope.
- FilterLookupForScope(*this, Previous, DC, S, NewFD->hasLinkage(),
+ FilterLookupForScope(Previous, DC, S, NewFD->hasLinkage(),
isExplicitSpecialization ||
isFunctionTemplateSpecialization);
@@ -4406,6 +4475,9 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
bool IsTypeAlias = false;
if (const TypedefType *TT = Param->getType()->getAs<TypedefType>())
IsTypeAlias = isa<TypeAliasDecl>(TT->getDecl());
+ else if (const TemplateSpecializationType *TST =
+ Param->getType()->getAs<TemplateSpecializationType>())
+ IsTypeAlias = TST->isTypeAlias();
Diag(Param->getLocation(), diag::err_param_typedef_of_void)
<< IsTypeAlias;
}
@@ -4452,8 +4524,8 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
if (!getLangOptions().CPlusPlus) {
// Perform semantic checking on the function declaration.
- bool isExplctSpecialization=false;
- CheckFunctionDeclaration(S, NewFD, Previous, isExplctSpecialization,
+ bool isExplicitSpecialization=false;
+ CheckFunctionDeclaration(S, NewFD, Previous, isExplicitSpecialization,
Redeclaration);
assert((NewFD->isInvalidDecl() || !Redeclaration ||
Previous.getResultKind() != LookupResult::FoundOverloaded) &&
@@ -4476,7 +4548,9 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
HasExplicitTemplateArgs = true;
- if (FunctionTemplate) {
+ if (NewFD->isInvalidDecl()) {
+ HasExplicitTemplateArgs = false;
+ } else if (FunctionTemplate) {
// Function template with explicit template arguments.
Diag(D.getIdentifierLoc(), diag::err_function_template_partial_spec)
<< SourceRange(TemplateId->LAngleLoc, TemplateId->RAngleLoc);
@@ -4532,6 +4606,16 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
(HasExplicitTemplateArgs ? &TemplateArgs : 0),
Previous))
NewFD->setInvalidDecl();
+
+ // C++ [dcl.stc]p1:
+ // A storage-class-specifier shall not be specified in an explicit
+ // specialization (14.7.3)
+ if (SC != SC_None) {
+ Diag(NewFD->getLocation(),
+ diag::err_explicit_specialization_storage_class)
+ << FixItHint::CreateRemoval(D.getDeclSpec().getStorageClassSpecLoc());
+ }
+
} else if (isExplicitSpecialization && isa<CXXMethodDecl>(NewFD)) {
if (CheckMemberSpecialization(NewFD, Previous))
NewFD->setInvalidDecl();
@@ -4647,8 +4731,8 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
<< D.getCXXScopeSpec().getRange();
}
}
-
-
+
+
// Handle attributes. We need to have merged decls when handling attributes
// (for example to check for conflicts, etc).
// FIXME: This needs to happen before we merge declarations. Then,
@@ -4661,7 +4745,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
if (Redeclaration && Previous.isSingleResult()) {
const FunctionDecl *Def;
FunctionDecl *PrevFD = dyn_cast<FunctionDecl>(Previous.getFoundDecl());
- if (PrevFD && PrevFD->hasBody(Def) && D.hasAttributes()) {
+ if (PrevFD && PrevFD->isDefined(Def) && D.hasAttributes()) {
Diag(NewFD->getLocation(), diag::warn_attribute_precede_definition);
Diag(Def->getLocation(), diag::note_previous_definition);
}
@@ -5076,9 +5160,11 @@ namespace {
if (OrigDecl != ReferenceDecl) return;
LookupResult Result(S, DRE->getNameInfo(), Sema::LookupOrdinaryName,
Sema::NotForRedeclaration);
- S.Diag(SubExpr->getLocStart(), diag::warn_uninit_self_reference_in_init)
- << Result.getLookupName() << OrigDecl->getLocation()
- << SubExpr->getSourceRange();
+ S.DiagRuntimeBehavior(SubExpr->getLocStart(), SubExpr,
+ S.PDiag(diag::warn_uninit_self_reference_in_init)
+ << Result.getLookupName()
+ << OrigDecl->getLocation()
+ << SubExpr->getSourceRange());
}
};
}
@@ -5553,40 +5639,53 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl,
return;
}
- const RecordType *Record
- = Context.getBaseElementType(Type)->getAs<RecordType>();
- if (Record && getLangOptions().CPlusPlus &&
- cast<CXXRecordDecl>(Record->getDecl())->isPOD()) {
- // C++03 [dcl.init]p9:
- // If no initializer is specified for an object, and the
- // object is of (possibly cv-qualified) non-POD class type (or
- // array thereof), the object shall be default-initialized; if
- // the object is of const-qualified type, the underlying class
- // type shall have a user-declared default
- // constructor. Otherwise, if no initializer is specified for
- // a non- static object, the object and its subobjects, if
- // any, have an indeterminate initial value); if the object
- // or any of its subobjects are of const-qualified type, the
- // program is ill-formed.
- } else {
- // Check for jumps past the implicit initializer. C++0x
- // clarifies that this applies to a "variable with automatic
- // storage duration", not a "local variable".
- if (getLangOptions().CPlusPlus && Var->hasLocalStorage())
- getCurFunction()->setHasBranchProtectedScope();
-
- InitializedEntity Entity = InitializedEntity::InitializeVariable(Var);
- InitializationKind Kind
- = InitializationKind::CreateDefault(Var->getLocation());
-
- InitializationSequence InitSeq(*this, Entity, Kind, 0, 0);
- ExprResult Init = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, 0, 0));
- if (Init.isInvalid())
- Var->setInvalidDecl();
- else if (Init.get())
- Var->setInit(MaybeCreateExprWithCleanups(Init.get()));
+ // Check for jumps past the implicit initializer. C++0x
+ // clarifies that this applies to a "variable with automatic
+ // storage duration", not a "local variable".
+ // C++0x [stmt.dcl]p3
+ // A program that jumps from a point where a variable with automatic
+ // storage duration is not in scope to a point where it is in scope is
+ // ill-formed unless the variable has scalar type, class type with a
+ // trivial default constructor and a trivial destructor, a cv-qualified
+ // version of one of these types, or an array of one of the preceding
+ // types and is declared without an initializer.
+ if (getLangOptions().CPlusPlus && Var->hasLocalStorage()) {
+ if (const RecordType *Record
+ = Context.getBaseElementType(Type)->getAs<RecordType>()) {
+ CXXRecordDecl *CXXRecord = cast<CXXRecordDecl>(Record->getDecl());
+ if ((!getLangOptions().CPlusPlus0x && !CXXRecord->isPOD()) ||
+ (getLangOptions().CPlusPlus0x &&
+ (!CXXRecord->hasTrivialDefaultConstructor() ||
+ !CXXRecord->hasTrivialDestructor())))
+ getCurFunction()->setHasBranchProtectedScope();
+ }
}
+
+ // C++03 [dcl.init]p9:
+ // If no initializer is specified for an object, and the
+ // object is of (possibly cv-qualified) non-POD class type (or
+ // array thereof), the object shall be default-initialized; if
+ // the object is of const-qualified type, the underlying class
+ // type shall have a user-declared default
+ // constructor. Otherwise, if no initializer is specified for
+ // a non- static object, the object and its subobjects, if
+ // any, have an indeterminate initial value); if the object
+ // or any of its subobjects are of const-qualified type, the
+ // program is ill-formed.
+ // C++0x [dcl.init]p11:
+ // If no initializer is specified for an object, the object is
+ // default-initialized; [...].
+ InitializedEntity Entity = InitializedEntity::InitializeVariable(Var);
+ InitializationKind Kind
+ = InitializationKind::CreateDefault(Var->getLocation());
+
+ InitializationSequence InitSeq(*this, Entity, Kind, 0, 0);
+ ExprResult Init = InitSeq.Perform(*this, Entity, Kind,
+ MultiExprArg(*this, 0, 0));
+ if (Init.isInvalid())
+ Var->setInvalidDecl();
+ else if (Init.get())
+ Var->setInit(MaybeCreateExprWithCleanups(Init.get()));
CheckCompleteVariableDeclaration(Var);
}
@@ -6056,7 +6155,7 @@ void Sema::CheckForFunctionRedefinition(FunctionDecl *FD) {
// Don't complain if we're in GNU89 mode and the previous definition
// was an extern inline function.
const FunctionDecl *Definition;
- if (FD->hasBody(Definition) &&
+ if (FD->isDefined(Definition) &&
!canRedefineFunction(Definition, getLangOptions())) {
if (getLangOptions().GNUMode && Definition->isInlineSpecified() &&
Definition->getStorageClass() == SC_Extern)
@@ -6221,6 +6320,11 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
WP.disableCheckFallThrough();
}
+ // MSVC permits the use of pure specifier (=0) on function definition,
+ // defined at class scope, warn about this non standard construct.
+ if (getLangOptions().Microsoft && FD->isPure())
+ Diag(FD->getLocation(), diag::warn_pure_function_definition);
+
if (!FD->isInvalidDecl()) {
DiagnoseUnusedParameters(FD->param_begin(), FD->param_end());
DiagnoseSizeOfParametersAndReturnValue(FD->param_begin(), FD->param_end(),
@@ -6499,7 +6603,7 @@ TypedefDecl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, QualType T,
///
/// \returns true if the new tag kind is acceptable, false otherwise.
bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous,
- TagTypeKind NewTag,
+ TagTypeKind NewTag, bool isDefinition,
SourceLocation NewTagLoc,
const IdentifierInfo &Name) {
// C++ [dcl.type.elab]p3:
@@ -6516,8 +6620,9 @@ bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous,
// struct class-key shall be used to refer to a class (clause 9)
// declared using the class or struct class-key.
TagTypeKind OldTag = Previous->getTagKind();
- if (OldTag == NewTag)
- return true;
+ if (!isDefinition || (NewTag != TTK_Class && NewTag != TTK_Struct))
+ if (OldTag == NewTag)
+ return true;
if ((OldTag == TTK_Struct || OldTag == TTK_Class) &&
(NewTag == TTK_Struct || NewTag == TTK_Class)) {
@@ -6526,12 +6631,63 @@ bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous,
if (const CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(Previous))
isTemplate = Record->getDescribedClassTemplate();
+ if (!ActiveTemplateInstantiations.empty()) {
+ // In a template instantiation, do not offer fix-its for tag mismatches
+ // since they usually mess up the template instead of fixing the problem.
+ Diag(NewTagLoc, diag::warn_struct_class_tag_mismatch)
+ << (NewTag == TTK_Class) << isTemplate << &Name;
+ return true;
+ }
+
+ if (isDefinition) {
+ // On definitions, check previous tags and issue a fix-it for each
+ // one that doesn't match the current tag.
+ if (Previous->getDefinition()) {
+ // Don't suggest fix-its for redefinitions.
+ return true;
+ }
+
+ bool previousMismatch = false;
+ for (TagDecl::redecl_iterator I(Previous->redecls_begin()),
+ E(Previous->redecls_end()); I != E; ++I) {
+ if (I->getTagKind() != NewTag) {
+ if (!previousMismatch) {
+ previousMismatch = true;
+ Diag(NewTagLoc, diag::warn_struct_class_previous_tag_mismatch)
+ << (NewTag == TTK_Class) << isTemplate << &Name;
+ }
+ Diag(I->getInnerLocStart(), diag::note_struct_class_suggestion)
+ << (NewTag == TTK_Class)
+ << FixItHint::CreateReplacement(I->getInnerLocStart(),
+ NewTag == TTK_Class?
+ "class" : "struct");
+ }
+ }
+ return true;
+ }
+
+ // Check for a previous definition. If current tag and definition
+ // are same type, do nothing. If no definition, but disagree with
+ // with previous tag type, give a warning, but no fix-it.
+ const TagDecl *Redecl = Previous->getDefinition() ?
+ Previous->getDefinition() : Previous;
+ if (Redecl->getTagKind() == NewTag) {
+ return true;
+ }
+
Diag(NewTagLoc, diag::warn_struct_class_tag_mismatch)
<< (NewTag == TTK_Class)
- << isTemplate << &Name
- << FixItHint::CreateReplacement(SourceRange(NewTagLoc),
- OldTag == TTK_Class? "class" : "struct");
- Diag(Previous->getLocation(), diag::note_previous_use);
+ << isTemplate << &Name;
+ Diag(Redecl->getLocation(), diag::note_previous_use);
+
+ // If there is a previous defintion, suggest a fix-it.
+ if (Previous->getDefinition()) {
+ Diag(NewTagLoc, diag::note_struct_class_suggestion)
+ << (Redecl->getTagKind() == TTK_Class)
+ << FixItHint::CreateReplacement(SourceRange(NewTagLoc),
+ Redecl->getTagKind() == TTK_Class? "class" : "struct");
+ }
+
return true;
}
return false;
@@ -6567,7 +6723,7 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
if (TemplateParameterLists.size() > 0 ||
(SS.isNotEmpty() && TUK != TUK_Reference)) {
if (TemplateParameterList *TemplateParams
- = MatchTemplateParametersToScopeSpecifier(KWLoc, SS,
+ = MatchTemplateParametersToScopeSpecifier(KWLoc, NameLoc, SS,
TemplateParameterLists.get(),
TemplateParameterLists.size(),
TUK == TUK_Friend,
@@ -6705,6 +6861,17 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
// shouldn't be diagnosing.
LookupName(Previous, S);
+ if (Previous.isAmbiguous() &&
+ (TUK == TUK_Definition || TUK == TUK_Declaration)) {
+ LookupResult::Filter F = Previous.makeFilter();
+ while (F.hasNext()) {
+ NamedDecl *ND = F.next();
+ if (ND->getDeclContext()->getRedeclContext() != SearchDC)
+ F.erase();
+ }
+ F.done();
+ }
+
// Note: there used to be some attempt at recovery here.
if (Previous.isAmbiguous())
return 0;
@@ -6846,7 +7013,9 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
isDeclInScope(PrevDecl, SearchDC, S, isExplicitSpecialization)) {
// Make sure that this wasn't declared as an enum and now used as a
// struct or something similar.
- if (!isAcceptableTagRedeclaration(PrevTagDecl, Kind, KWLoc, *Name)) {
+ if (!isAcceptableTagRedeclaration(PrevTagDecl, Kind,
+ TUK == TUK_Definition, KWLoc,
+ *Name)) {
bool SafeToContinue
= (PrevTagDecl->getTagKind() != TTK_Enum &&
Kind != TTK_Enum);
@@ -6911,8 +7080,8 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
// for the consumer of this Decl to know it doesn't own it.
// For our current ASTs this shouldn't be a problem, but will
// need to be changed with DeclGroups.
- if ((TUK == TUK_Reference && !PrevTagDecl->getFriendObjectKind()) ||
- TUK == TUK_Friend)
+ if ((TUK == TUK_Reference && (!PrevTagDecl->getFriendObjectKind() ||
+ getLangOptions().Microsoft)) || TUK == TUK_Friend)
return PrevTagDecl;
// Diagnose attempts to redefine a tag.
@@ -7154,8 +7323,12 @@ CreateNewDecl:
New->setLexicalDeclContext(CurContext);
// Mark this as a friend decl if applicable.
+ // In Microsoft mode, a friend declaration also acts as a forward
+ // declaration so we always pass true to setObjectOfFriendDecl to make
+ // the tag name visible.
if (TUK == TUK_Friend)
- New->setObjectOfFriendDecl(/* PreviouslyDeclared = */ !Previous.empty());
+ New->setObjectOfFriendDecl(/* PreviouslyDeclared = */ !Previous.empty() ||
+ getLangOptions().Microsoft);
// Set the access specifier.
if (!Invalid && SearchDC->isRecord())
@@ -7341,14 +7514,13 @@ bool Sema::VerifyBitField(SourceLocation FieldLoc, IdentifierInfo *FieldName,
return false;
}
-/// ActOnField - Each field of a struct/union/class is passed into this in order
+/// ActOnField - Each field of a C struct/union is passed into this in order
/// to create a FieldDecl object for it.
-Decl *Sema::ActOnField(Scope *S, Decl *TagD,
- SourceLocation DeclStart,
- Declarator &D, ExprTy *BitfieldWidth) {
+Decl *Sema::ActOnField(Scope *S, Decl *TagD, SourceLocation DeclStart,
+ Declarator &D, ExprTy *BitfieldWidth) {
FieldDecl *Res = HandleField(S, cast_or_null<RecordDecl>(TagD),
DeclStart, D, static_cast<Expr*>(BitfieldWidth),
- AS_public);
+ /*HasInit=*/false, AS_public);
return Res;
}
@@ -7356,7 +7528,7 @@ Decl *Sema::ActOnField(Scope *S, Decl *TagD,
///
FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
SourceLocation DeclStart,
- Declarator &D, Expr *BitWidth,
+ Declarator &D, Expr *BitWidth, bool HasInit,
AccessSpecifier AS) {
IdentifierInfo *II = D.getIdentifier();
SourceLocation Loc = DeclStart;
@@ -7405,8 +7577,8 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
= (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_mutable);
SourceLocation TSSL = D.getSourceRange().getBegin();
FieldDecl *NewFD
- = CheckFieldDecl(II, T, TInfo, Record, Loc, Mutable, BitWidth, TSSL,
- AS, PrevDecl, &D);
+ = CheckFieldDecl(II, T, TInfo, Record, Loc, Mutable, BitWidth, HasInit,
+ TSSL, AS, PrevDecl, &D);
if (NewFD->isInvalidDecl())
Record->setInvalidDecl();
@@ -7435,7 +7607,7 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
TypeSourceInfo *TInfo,
RecordDecl *Record, SourceLocation Loc,
- bool Mutable, Expr *BitWidth,
+ bool Mutable, Expr *BitWidth, bool HasInit,
SourceLocation TSSL,
AccessSpecifier AS, NamedDecl *PrevDecl,
Declarator *D) {
@@ -7515,7 +7687,7 @@ FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
}
FieldDecl *NewFD = FieldDecl::Create(Context, Record, TSSL, Loc, II, T, TInfo,
- BitWidth, Mutable);
+ BitWidth, Mutable, HasInit);
if (InvalidDecl)
NewFD->setInvalidDecl();
@@ -7535,8 +7707,7 @@ FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T,
// destructor, or a non-trivial copy assignment operator
// cannot be a member of a union, nor can an array of such
// objects.
- // TODO: C++0x alters this restriction significantly.
- if (CheckNontrivialField(NewFD))
+ if (!getLangOptions().CPlusPlus0x && CheckNontrivialField(NewFD))
NewFD->setInvalidDecl();
}
}
@@ -7582,8 +7753,8 @@ bool Sema::CheckNontrivialField(FieldDecl *FD) {
CXXSpecialMember member = CXXInvalid;
if (!RDecl->hasTrivialCopyConstructor())
member = CXXCopyConstructor;
- else if (!RDecl->hasTrivialConstructor())
- member = CXXConstructor;
+ else if (!RDecl->hasTrivialDefaultConstructor())
+ member = CXXDefaultConstructor;
else if (!RDecl->hasTrivialCopyAssignment())
member = CXXCopyAssignment;
else if (!RDecl->hasTrivialDestructor())
@@ -7612,7 +7783,7 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) {
case CXXInvalid:
break;
- case CXXConstructor:
+ case CXXDefaultConstructor:
if (RD->hasUserDeclaredConstructor()) {
typedef CXXRecordDecl::ctor_iterator ctor_iter;
for (ctor_iter ci = RD->ctor_begin(), ce = RD->ctor_end(); ci != ce;++ci){
@@ -7633,7 +7804,15 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) {
case CXXCopyConstructor:
if (RD->hasUserDeclaredCopyConstructor()) {
SourceLocation CtorLoc =
- RD->getCopyConstructor(Context, 0)->getLocation();
+ RD->getCopyConstructor(0)->getLocation();
+ Diag(CtorLoc, diag::note_nontrivial_user_defined) << QT << member;
+ return;
+ }
+ break;
+
+ case CXXMoveConstructor:
+ if (RD->hasUserDeclaredMoveConstructor()) {
+ SourceLocation CtorLoc = RD->getMoveConstructor()->getLocation();
Diag(CtorLoc, diag::note_nontrivial_user_defined) << QT << member;
return;
}
@@ -7649,6 +7828,14 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) {
}
break;
+ case CXXMoveAssignment:
+ if (RD->hasUserDeclaredMoveAssignment()) {
+ SourceLocation AssignLoc = RD->getMoveAssignmentOperator()->getLocation();
+ Diag(AssignLoc, diag::note_nontrivial_user_defined) << QT << member;
+ return;
+ }
+ break;
+
case CXXDestructor:
if (RD->hasUserDeclaredDestructor()) {
SourceLocation DtorLoc = LookupDestructor(RD)->getLocation();
@@ -7686,8 +7873,8 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) {
bool (CXXRecordDecl::*hasTrivial)() const;
switch (member) {
- case CXXConstructor:
- hasTrivial = &CXXRecordDecl::hasTrivialConstructor; break;
+ case CXXDefaultConstructor:
+ hasTrivial = &CXXRecordDecl::hasTrivialDefaultConstructor; break;
case CXXCopyConstructor:
hasTrivial = &CXXRecordDecl::hasTrivialCopyConstructor; break;
case CXXCopyAssignment:
@@ -8047,6 +8234,11 @@ void Sema::ActOnFields(Scope* S,
Convs->setAccess(I, (*I)->getAccess());
if (!CXXRecord->isDependentType()) {
+ // Adjust user-defined destructor exception spec.
+ if (getLangOptions().CPlusPlus0x &&
+ CXXRecord->hasUserDeclaredDestructor())
+ AdjustDestructorExceptionSpec(CXXRecord,CXXRecord->getDestructor());
+
// Add any implicitly-declared members to this class.
AddImplicitlyDeclaredMembersToClass(CXXRecord);
@@ -8095,6 +8287,22 @@ void Sema::ActOnFields(Scope* S,
if (!Completed)
Record->completeDefinition();
+
+ // Now that the record is complete, do any delayed exception spec checks
+ // we were missing.
+ while (!DelayedDestructorExceptionSpecChecks.empty()) {
+ const CXXDestructorDecl *Dtor =
+ DelayedDestructorExceptionSpecChecks.back().first;
+ if (Dtor->getParent() != Record)
+ break;
+
+ assert(!Dtor->getParent()->isDependentType() &&
+ "Should not ever add destructors of templates into the list.");
+ CheckOverridingFunctionExceptionSpec(Dtor,
+ DelayedDestructorExceptionSpecChecks.back().second);
+ DelayedDestructorExceptionSpecChecks.pop_back();
+ }
+
} else {
ObjCIvarDecl **ClsFields =
reinterpret_cast<ObjCIvarDecl**>(RecFields.data());
@@ -8149,7 +8357,7 @@ static bool isRepresentableIntegerValue(ASTContext &Context,
unsigned BitWidth = Context.getIntWidth(T);
if (Value.isUnsigned() || Value.isNonNegative()) {
- if (T->isSignedIntegerType())
+ if (T->isSignedIntegerOrEnumerationType())
--BitWidth;
return Value.getActiveBits() <= BitWidth;
}
@@ -8172,8 +8380,8 @@ static QualType getNextLargerIntegralType(ASTContext &Context, QualType T) {
};
unsigned BitWidth = Context.getTypeSize(T);
- QualType *Types = T->isSignedIntegerType()? SignedIntegralTypes
- : UnsignedIntegralTypes;
+ QualType *Types = T->isSignedIntegerOrEnumerationType()? SignedIntegralTypes
+ : UnsignedIntegralTypes;
for (unsigned I = 0; I != NumTypes; ++I)
if (Context.getTypeSize(Types[I]) > BitWidth)
return Types[I];
@@ -8307,7 +8515,7 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum,
// type that is supposed to be large enough to represent the incremented
// value, then increment.
EnumVal = LastEnumConst->getInitVal();
- EnumVal.setIsSigned(EltTy->isSignedIntegerType());
+ EnumVal.setIsSigned(EltTy->isSignedIntegerOrEnumerationType());
EnumVal = EnumVal.zextOrTrunc(Context.getIntWidth(EltTy));
++EnumVal;
@@ -8331,7 +8539,7 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum,
// Make the enumerator value match the signedness and size of the
// enumerator's type.
EnumVal = EnumVal.zextOrTrunc(Context.getIntWidth(EltTy));
- EnumVal.setIsSigned(EltTy->isSignedIntegerType());
+ EnumVal.setIsSigned(EltTy->isSignedIntegerOrEnumerationType());
}
return EnumConstantDecl::Create(Context, Enum, IdLoc, Id, EltTy,
@@ -8589,7 +8797,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
} else {
NewTy = BestType;
NewWidth = BestWidth;
- NewSign = BestType->isSignedIntegerType();
+ NewSign = BestType->isSignedIntegerOrEnumerationType();
}
// Adjust the APSInt value.
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp
index 27632a1..ce99efb 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp
@@ -111,6 +111,102 @@ namespace {
}
}
+void Sema::ImplicitExceptionSpecification::CalledDecl(CXXMethodDecl *Method) {
+ assert(Context && "ImplicitExceptionSpecification without an ASTContext");
+ // If we have an MSAny or unknown spec already, don't bother.
+ if (!Method || ComputedEST == EST_MSAny || ComputedEST == EST_Delayed)
+ return;
+
+ const FunctionProtoType *Proto
+ = Method->getType()->getAs<FunctionProtoType>();
+
+ ExceptionSpecificationType EST = Proto->getExceptionSpecType();
+
+ // If this function can throw any exceptions, make a note of that.
+ if (EST == EST_Delayed || EST == EST_MSAny || EST == EST_None) {
+ ClearExceptions();
+ ComputedEST = EST;
+ return;
+ }
+
+ // FIXME: If the call to this decl is using any of its default arguments, we
+ // need to search them for potentially-throwing calls.
+
+ // If this function has a basic noexcept, it doesn't affect the outcome.
+ if (EST == EST_BasicNoexcept)
+ return;
+
+ // If we have a throw-all spec at this point, ignore the function.
+ if (ComputedEST == EST_None)
+ return;
+
+ // If we're still at noexcept(true) and there's a nothrow() callee,
+ // change to that specification.
+ if (EST == EST_DynamicNone) {
+ if (ComputedEST == EST_BasicNoexcept)
+ ComputedEST = EST_DynamicNone;
+ return;
+ }
+
+ // Check out noexcept specs.
+ if (EST == EST_ComputedNoexcept) {
+ FunctionProtoType::NoexceptResult NR = Proto->getNoexceptSpec(*Context);
+ assert(NR != FunctionProtoType::NR_NoNoexcept &&
+ "Must have noexcept result for EST_ComputedNoexcept.");
+ assert(NR != FunctionProtoType::NR_Dependent &&
+ "Should not generate implicit declarations for dependent cases, "
+ "and don't know how to handle them anyway.");
+
+ // noexcept(false) -> no spec on the new function
+ if (NR == FunctionProtoType::NR_Throw) {
+ ClearExceptions();
+ ComputedEST = EST_None;
+ }
+ // noexcept(true) won't change anything either.
+ return;
+ }
+
+ assert(EST == EST_Dynamic && "EST case not considered earlier.");
+ assert(ComputedEST != EST_None &&
+ "Shouldn't collect exceptions when throw-all is guaranteed.");
+ ComputedEST = EST_Dynamic;
+ // Record the exceptions in this function's exception specification.
+ for (FunctionProtoType::exception_iterator E = Proto->exception_begin(),
+ EEnd = Proto->exception_end();
+ E != EEnd; ++E)
+ if (ExceptionsSeen.insert(Context->getCanonicalType(*E)))
+ Exceptions.push_back(*E);
+}
+
+void Sema::ImplicitExceptionSpecification::CalledExpr(Expr *E) {
+ if (!E || ComputedEST == EST_MSAny || ComputedEST == EST_Delayed)
+ return;
+
+ // FIXME:
+ //
+ // C++0x [except.spec]p14:
+ // [An] implicit exception-specification specifies the type-id T if and
+ // only if T is allowed by the exception-specification of a function directly
+ // invoked by f’s implicit definition; f shall allow all exceptions if any
+ // function it directly invokes allows all exceptions, and f shall allow no
+ // exceptions if every function it directly invokes allows no exceptions.
+ //
+ // Note in particular that if an implicit exception-specification is generated
+ // for a function containing a throw-expression, that specification can still
+ // be noexcept(true).
+ //
+ // Note also that 'directly invoked' is not defined in the standard, and there
+ // is no indication that we should only consider potentially-evaluated calls.
+ //
+ // Ultimately we should implement the intent of the standard: the exception
+ // specification should be the set of exceptions which can be thrown by the
+ // implicit definition. For now, we assume that any non-nothrow expression can
+ // throw any exception.
+
+ if (E->CanThrow(*Context))
+ ComputedEST = EST_None;
+}
+
bool
Sema::SetParamDefaultArgument(ParmVarDecl *Param, Expr *Arg,
SourceLocation EqualLoc) {
@@ -393,6 +489,15 @@ bool Sema::MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old) {
diag::err_param_default_argument_member_template_redecl)
<< WhichKind
<< NewParam->getDefaultArgRange();
+ } else if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(New)) {
+ CXXSpecialMember NewSM = getSpecialMember(Ctor),
+ OldSM = getSpecialMember(cast<CXXConstructorDecl>(Old));
+ if (NewSM != OldSM) {
+ Diag(NewParam->getLocation(),diag::warn_default_arg_makes_ctor_special)
+ << NewParam->getDefaultArgRange() << NewSM;
+ Diag(Old->getLocation(), diag::note_previous_declaration_special)
+ << OldSM;
+ }
}
}
}
@@ -956,14 +1061,15 @@ bool Sema::CheckIfOverriddenFunctionIsMarkedFinal(const CXXMethodDecl *New,
/// ActOnCXXMemberDeclarator - This is invoked when a C++ class member
/// declarator is parsed. 'AS' is the access specifier, 'BW' specifies the
-/// bitfield width if there is one and 'InitExpr' specifies the initializer if
-/// any.
+/// bitfield width if there is one, 'InitExpr' specifies the initializer if
+/// one has been parsed, and 'HasDeferredInit' is true if an initializer is
+/// present but parsing it has been deferred.
Decl *
Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
MultiTemplateParamsArg TemplateParameterLists,
ExprTy *BW, const VirtSpecifiers &VS,
- ExprTy *InitExpr, bool IsDefinition,
- bool Deleted) {
+ ExprTy *InitExpr, bool HasDeferredInit,
+ bool IsDefinition) {
const DeclSpec &DS = D.getDeclSpec();
DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
DeclarationName Name = NameInfo.getName();
@@ -978,6 +1084,7 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
assert(isa<CXXRecordDecl>(CurContext));
assert(!DS.isFriendSpecified());
+ assert(!Init || !HasDeferredInit);
bool isFunc = false;
if (D.isFunctionDeclarator())
@@ -1028,7 +1135,6 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
if (isInstField) {
CXXScopeSpec &SS = D.getCXXScopeSpec();
-
if (SS.isSet() && !SS.isInvalid()) {
// The user provided a superfluous scope specifier inside a class
// definition:
@@ -1050,9 +1156,11 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
// FIXME: Check for template parameters!
// FIXME: Check that the name is an identifier!
Member = HandleField(S, cast<CXXRecordDecl>(CurContext), Loc, D, BitWidth,
- AS);
+ HasDeferredInit, AS);
assert(Member && "HandleField never returns null");
} else {
+ assert(!HasDeferredInit);
+
Member = HandleDeclarator(S, D, move(TemplateParameterLists), IsDefinition);
if (!Member) {
return 0;
@@ -1123,8 +1231,14 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
if (Init)
AddInitializerToDecl(Member, Init, false,
DS.getTypeSpecType() == DeclSpec::TST_auto);
- if (Deleted) // FIXME: Source location is not very good.
- SetDeclDeleted(Member, D.getSourceRange().getBegin());
+ else if (DS.getTypeSpecType() == DeclSpec::TST_auto &&
+ DS.getStorageClassSpec() == DeclSpec::SCS_static) {
+ // C++0x [dcl.spec.auto]p4: 'auto' can only be used in the type of a static
+ // data member if a brace-or-equal-initializer is provided.
+ Diag(Loc, diag::err_auto_var_requires_init)
+ << Name << cast<ValueDecl>(Member)->getType();
+ Member->setInvalidDecl();
+ }
FinalizeDeclaration(Member);
@@ -1133,6 +1247,47 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D,
return Member;
}
+/// ActOnCXXInClassMemberInitializer - This is invoked after parsing an
+/// in-class initializer for a non-static C++ class member. Such parsing
+/// is deferred until the class is complete.
+void
+Sema::ActOnCXXInClassMemberInitializer(Decl *D, SourceLocation EqualLoc,
+ Expr *InitExpr) {
+ FieldDecl *FD = cast<FieldDecl>(D);
+
+ if (!InitExpr) {
+ FD->setInvalidDecl();
+ FD->removeInClassInitializer();
+ return;
+ }
+
+ ExprResult Init = InitExpr;
+ if (!FD->getType()->isDependentType() && !InitExpr->isTypeDependent()) {
+ // FIXME: if there is no EqualLoc, this is list-initialization.
+ Init = PerformCopyInitialization(
+ InitializedEntity::InitializeMember(FD), EqualLoc, InitExpr);
+ if (Init.isInvalid()) {
+ FD->setInvalidDecl();
+ return;
+ }
+
+ CheckImplicitConversions(Init.get(), EqualLoc);
+ }
+
+ // C++0x [class.base.init]p7:
+ // The initialization of each base and member constitutes a
+ // full-expression.
+ Init = MaybeCreateExprWithCleanups(Init);
+ if (Init.isInvalid()) {
+ FD->setInvalidDecl();
+ return;
+ }
+
+ InitExpr = Init.release();
+
+ FD->setInClassInitializer(InitExpr);
+}
+
/// \brief Find the direct and/or virtual base specifiers that
/// correspond to the given base type, for use in base initialization
/// within a constructor.
@@ -1547,7 +1702,8 @@ Sema::BuildDelegatingInitializer(TypeSourceInfo *TInfo,
return true;
CXXConstructExpr *ConExpr = cast<CXXConstructExpr>(DelegationInit.get());
- CXXConstructorDecl *Constructor = ConExpr->getConstructor();
+ CXXConstructorDecl *Constructor
+ = ConExpr->getConstructor();
assert(Constructor && "Delegating constructor with no target?");
CheckImplicitConversions(DelegationInit.get(), LParenLoc);
@@ -1956,24 +2112,26 @@ BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor,
return false;
}
- if (FieldBaseElementType->isReferenceType()) {
- SemaRef.Diag(Constructor->getLocation(),
- diag::err_uninitialized_member_in_ctor)
- << (int)Constructor->isImplicit()
- << SemaRef.Context.getTagDeclType(Constructor->getParent())
- << 0 << Field->getDeclName();
- SemaRef.Diag(Field->getLocation(), diag::note_declared_at);
- return true;
- }
+ if (!Field->getParent()->isUnion()) {
+ if (FieldBaseElementType->isReferenceType()) {
+ SemaRef.Diag(Constructor->getLocation(),
+ diag::err_uninitialized_member_in_ctor)
+ << (int)Constructor->isImplicit()
+ << SemaRef.Context.getTagDeclType(Constructor->getParent())
+ << 0 << Field->getDeclName();
+ SemaRef.Diag(Field->getLocation(), diag::note_declared_at);
+ return true;
+ }
- if (FieldBaseElementType.isConstQualified()) {
- SemaRef.Diag(Constructor->getLocation(),
- diag::err_uninitialized_member_in_ctor)
- << (int)Constructor->isImplicit()
- << SemaRef.Context.getTagDeclType(Constructor->getParent())
- << 1 << Field->getDeclName();
- SemaRef.Diag(Field->getLocation(), diag::note_declared_at);
- return true;
+ if (FieldBaseElementType.isConstQualified()) {
+ SemaRef.Diag(Constructor->getLocation(),
+ diag::err_uninitialized_member_in_ctor)
+ << (int)Constructor->isImplicit()
+ << SemaRef.Context.getTagDeclType(Constructor->getParent())
+ << 1 << Field->getDeclName();
+ SemaRef.Diag(Field->getLocation(), diag::note_declared_at);
+ return true;
+ }
}
// Nothing to initialize.
@@ -2001,7 +2159,7 @@ struct BaseAndFieldInfo {
};
}
-static bool CollectFieldInitializer(BaseAndFieldInfo &Info,
+static bool CollectFieldInitializer(Sema &SemaRef, BaseAndFieldInfo &Info,
FieldDecl *Top, FieldDecl *Field) {
// Overwhelmingly common case: we have a direct initializer for this field.
@@ -2010,6 +2168,18 @@ static bool CollectFieldInitializer(BaseAndFieldInfo &Info,
return false;
}
+ // C++0x [class.base.init]p8: if the entity is a non-static data member that
+ // has a brace-or-equal-initializer, the entity is initialized as specified
+ // in [dcl.init].
+ if (Field->hasInClassInitializer()) {
+ Info.AllToInit.push_back(
+ new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context, Field,
+ SourceLocation(),
+ SourceLocation(), 0,
+ SourceLocation()));
+ return false;
+ }
+
if (Info.IIK == IIK_Default && Field->isAnonymousStructOrUnion()) {
const RecordType *FieldClassType = Field->getType()->getAs<RecordType>();
assert(FieldClassType && "anonymous struct/union without record type");
@@ -2032,7 +2202,7 @@ static bool CollectFieldInitializer(BaseAndFieldInfo &Info,
// field in the class is also initialized, so exit immediately.
return false;
} else if ((*FA)->isAnonymousStructOrUnion()) {
- if (CollectFieldInitializer(Info, Top, *FA))
+ if (CollectFieldInitializer(SemaRef, Info, Top, *FA))
return true;
}
}
@@ -2047,7 +2217,7 @@ static bool CollectFieldInitializer(BaseAndFieldInfo &Info,
// necessary.
for (RecordDecl::field_iterator FA = FieldClassDecl->field_begin(),
EA = FieldClassDecl->field_end(); FA != EA; FA++) {
- if (CollectFieldInitializer(Info, Top, *FA))
+ if (CollectFieldInitializer(SemaRef, Info, Top, *FA))
return true;
}
}
@@ -2056,7 +2226,7 @@ static bool CollectFieldInitializer(BaseAndFieldInfo &Info,
// Don't try to build an implicit initializer if there were semantic
// errors in any of the initializers (and therefore we might be
// missing some that the user actually wrote).
- if (Info.AnyErrorsInInits)
+ if (Info.AnyErrorsInInits || Field->isInvalidDecl())
return false;
CXXCtorInitializer *Init = 0;
@@ -2072,26 +2242,22 @@ static bool CollectFieldInitializer(BaseAndFieldInfo &Info,
bool
Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor,
CXXCtorInitializer *Initializer) {
+ assert(Initializer->isDelegatingInitializer());
Constructor->setNumCtorInitializers(1);
CXXCtorInitializer **initializer =
new (Context) CXXCtorInitializer*[1];
memcpy(initializer, &Initializer, sizeof (CXXCtorInitializer*));
Constructor->setCtorInitializers(initializer);
- // FIXME: This doesn't catch indirect loops yet
- CXXConstructorDecl *Target = Initializer->getTargetConstructor();
- while (Target) {
- if (Target == Constructor) {
- Diag(Initializer->getSourceLocation(), diag::err_delegating_ctor_loop)
- << Constructor;
- return true;
- }
- Target = Target->getTargetConstructor();
+ if (CXXDestructorDecl *Dtor = LookupDestructor(Constructor->getParent())) {
+ MarkDeclarationReferenced(Initializer->getSourceLocation(), Dtor);
+ DiagnoseUseOfDecl(Dtor, Initializer->getSourceLocation());
}
+ DelegatingCtorDecls.push_back(Constructor);
+
return false;
}
-
bool
Sema::SetCtorInitializers(CXXConstructorDecl *Constructor,
@@ -2192,7 +2358,7 @@ Sema::SetCtorInitializers(CXXConstructorDecl *Constructor,
"Incomplete array type is not valid");
continue;
}
- if (CollectFieldInitializer(Info, *Field, *Field))
+ if (CollectFieldInitializer(*this, Info, *Field, *Field))
HadError = true;
}
@@ -2468,7 +2634,7 @@ void Sema::ActOnMemInitializers(Decl *ConstructorDecl,
HadError = true;
// We will treat this as being the only initializer.
}
- SetDelegatingInitializer(Constructor, *MemInits);
+ SetDelegatingInitializer(Constructor, MemInits[i]);
// Return immediately as the initializer is set.
return;
}
@@ -2805,7 +2971,7 @@ static void CheckAbstractClassUsage(AbstractUsageInfo &Info,
CXXMethodDecl *MD) {
// No need to do the check on definitions, which require that
// the return/param types be complete.
- if (MD->isThisDeclarationADefinition())
+ if (MD->doesThisDeclarationHaveABody())
return;
// For safety's sake, just ignore it if we don't have type source
@@ -2871,6 +3037,9 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
for (RecordDecl::field_iterator F = Record->field_begin(),
FEnd = Record->field_end();
F != FEnd; ++F) {
+ if (F->hasInClassInitializer())
+ continue;
+
if (F->getType()->isReferenceType() ||
(F->getType().isConstQualified() && F->getType()->isScalarType())) {
if (!Complained) {
@@ -2937,6 +3106,953 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) {
// instantiated (e.g. meta-functions). This doesn't apply to classes that
// have inherited constructors.
DeclareInheritedConstructors(Record);
+
+ if (!Record->isDependentType())
+ CheckExplicitlyDefaultedMethods(Record);
+}
+
+void Sema::CheckExplicitlyDefaultedMethods(CXXRecordDecl *Record) {
+ for (CXXRecordDecl::method_iterator MI = Record->method_begin(),
+ ME = Record->method_end();
+ MI != ME; ++MI) {
+ if (!MI->isInvalidDecl() && MI->isExplicitlyDefaulted()) {
+ switch (getSpecialMember(*MI)) {
+ case CXXDefaultConstructor:
+ CheckExplicitlyDefaultedDefaultConstructor(
+ cast<CXXConstructorDecl>(*MI));
+ break;
+
+ case CXXDestructor:
+ CheckExplicitlyDefaultedDestructor(cast<CXXDestructorDecl>(*MI));
+ break;
+
+ case CXXCopyConstructor:
+ CheckExplicitlyDefaultedCopyConstructor(cast<CXXConstructorDecl>(*MI));
+ break;
+
+ case CXXCopyAssignment:
+ CheckExplicitlyDefaultedCopyAssignment(*MI);
+ break;
+
+ case CXXMoveConstructor:
+ case CXXMoveAssignment:
+ Diag(MI->getLocation(), diag::err_defaulted_move_unsupported);
+ break;
+
+ default:
+ // FIXME: Do moves once they exist
+ llvm_unreachable("non-special member explicitly defaulted!");
+ }
+ }
+ }
+
+}
+
+void Sema::CheckExplicitlyDefaultedDefaultConstructor(CXXConstructorDecl *CD) {
+ assert(CD->isExplicitlyDefaulted() && CD->isDefaultConstructor());
+
+ // Whether this was the first-declared instance of the constructor.
+ // This affects whether we implicitly add an exception spec (and, eventually,
+ // constexpr). It is also ill-formed to explicitly default a constructor such
+ // that it would be deleted. (C++0x [decl.fct.def.default])
+ bool First = CD == CD->getCanonicalDecl();
+
+ bool HadError = false;
+ if (CD->getNumParams() != 0) {
+ Diag(CD->getLocation(), diag::err_defaulted_default_ctor_params)
+ << CD->getSourceRange();
+ HadError = true;
+ }
+
+ ImplicitExceptionSpecification Spec
+ = ComputeDefaultedDefaultCtorExceptionSpec(CD->getParent());
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
+ if (EPI.ExceptionSpecType == EST_Delayed) {
+ // Exception specification depends on some deferred part of the class. We'll
+ // try again when the class's definition has been fully processed.
+ return;
+ }
+ const FunctionProtoType *CtorType = CD->getType()->getAs<FunctionProtoType>(),
+ *ExceptionType = Context.getFunctionType(
+ Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
+
+ if (CtorType->hasExceptionSpec()) {
+ if (CheckEquivalentExceptionSpec(
+ PDiag(diag::err_incorrect_defaulted_exception_spec)
+ << CXXDefaultConstructor,
+ PDiag(),
+ ExceptionType, SourceLocation(),
+ CtorType, CD->getLocation())) {
+ HadError = true;
+ }
+ } else if (First) {
+ // We set the declaration to have the computed exception spec here.
+ // We know there are no parameters.
+ EPI.ExtInfo = CtorType->getExtInfo();
+ CD->setType(Context.getFunctionType(Context.VoidTy, 0, 0, EPI));
+ }
+
+ if (HadError) {
+ CD->setInvalidDecl();
+ return;
+ }
+
+ if (ShouldDeleteDefaultConstructor(CD)) {
+ if (First) {
+ CD->setDeletedAsWritten();
+ } else {
+ Diag(CD->getLocation(), diag::err_out_of_line_default_deletes)
+ << CXXDefaultConstructor;
+ CD->setInvalidDecl();
+ }
+ }
+}
+
+void Sema::CheckExplicitlyDefaultedCopyConstructor(CXXConstructorDecl *CD) {
+ assert(CD->isExplicitlyDefaulted() && CD->isCopyConstructor());
+
+ // Whether this was the first-declared instance of the constructor.
+ bool First = CD == CD->getCanonicalDecl();
+
+ bool HadError = false;
+ if (CD->getNumParams() != 1) {
+ Diag(CD->getLocation(), diag::err_defaulted_copy_ctor_params)
+ << CD->getSourceRange();
+ HadError = true;
+ }
+
+ ImplicitExceptionSpecification Spec(Context);
+ bool Const;
+ llvm::tie(Spec, Const) =
+ ComputeDefaultedCopyCtorExceptionSpecAndConst(CD->getParent());
+
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
+ const FunctionProtoType *CtorType = CD->getType()->getAs<FunctionProtoType>(),
+ *ExceptionType = Context.getFunctionType(
+ Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
+
+ // Check for parameter type matching.
+ // This is a copy ctor so we know it's a cv-qualified reference to T.
+ QualType ArgType = CtorType->getArgType(0);
+ if (ArgType->getPointeeType().isVolatileQualified()) {
+ Diag(CD->getLocation(), diag::err_defaulted_copy_ctor_volatile_param);
+ HadError = true;
+ }
+ if (ArgType->getPointeeType().isConstQualified() && !Const) {
+ Diag(CD->getLocation(), diag::err_defaulted_copy_ctor_const_param);
+ HadError = true;
+ }
+
+ if (CtorType->hasExceptionSpec()) {
+ if (CheckEquivalentExceptionSpec(
+ PDiag(diag::err_incorrect_defaulted_exception_spec)
+ << CXXCopyConstructor,
+ PDiag(),
+ ExceptionType, SourceLocation(),
+ CtorType, CD->getLocation())) {
+ HadError = true;
+ }
+ } else if (First) {
+ // We set the declaration to have the computed exception spec here.
+ // We duplicate the one parameter type.
+ EPI.ExtInfo = CtorType->getExtInfo();
+ CD->setType(Context.getFunctionType(Context.VoidTy, &ArgType, 1, EPI));
+ }
+
+ if (HadError) {
+ CD->setInvalidDecl();
+ return;
+ }
+
+ if (ShouldDeleteCopyConstructor(CD)) {
+ if (First) {
+ CD->setDeletedAsWritten();
+ } else {
+ Diag(CD->getLocation(), diag::err_out_of_line_default_deletes)
+ << CXXCopyConstructor;
+ CD->setInvalidDecl();
+ }
+ }
+}
+
+void Sema::CheckExplicitlyDefaultedCopyAssignment(CXXMethodDecl *MD) {
+ assert(MD->isExplicitlyDefaulted());
+
+ // Whether this was the first-declared instance of the operator
+ bool First = MD == MD->getCanonicalDecl();
+
+ bool HadError = false;
+ if (MD->getNumParams() != 1) {
+ Diag(MD->getLocation(), diag::err_defaulted_copy_assign_params)
+ << MD->getSourceRange();
+ HadError = true;
+ }
+
+ QualType ReturnType =
+ MD->getType()->getAs<FunctionType>()->getResultType();
+ if (!ReturnType->isLValueReferenceType() ||
+ !Context.hasSameType(
+ Context.getCanonicalType(ReturnType->getPointeeType()),
+ Context.getCanonicalType(Context.getTypeDeclType(MD->getParent())))) {
+ Diag(MD->getLocation(), diag::err_defaulted_copy_assign_return_type);
+ HadError = true;
+ }
+
+ ImplicitExceptionSpecification Spec(Context);
+ bool Const;
+ llvm::tie(Spec, Const) =
+ ComputeDefaultedCopyCtorExceptionSpecAndConst(MD->getParent());
+
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
+ const FunctionProtoType *OperType = MD->getType()->getAs<FunctionProtoType>(),
+ *ExceptionType = Context.getFunctionType(
+ Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
+
+ QualType ArgType = OperType->getArgType(0);
+ if (!ArgType->isReferenceType()) {
+ Diag(MD->getLocation(), diag::err_defaulted_copy_assign_not_ref);
+ HadError = true;
+ } else {
+ if (ArgType->getPointeeType().isVolatileQualified()) {
+ Diag(MD->getLocation(), diag::err_defaulted_copy_assign_volatile_param);
+ HadError = true;
+ }
+ if (ArgType->getPointeeType().isConstQualified() && !Const) {
+ Diag(MD->getLocation(), diag::err_defaulted_copy_assign_const_param);
+ HadError = true;
+ }
+ }
+
+ if (OperType->getTypeQuals()) {
+ Diag(MD->getLocation(), diag::err_defaulted_copy_assign_quals);
+ HadError = true;
+ }
+
+ if (OperType->hasExceptionSpec()) {
+ if (CheckEquivalentExceptionSpec(
+ PDiag(diag::err_incorrect_defaulted_exception_spec)
+ << CXXCopyAssignment,
+ PDiag(),
+ ExceptionType, SourceLocation(),
+ OperType, MD->getLocation())) {
+ HadError = true;
+ }
+ } else if (First) {
+ // We set the declaration to have the computed exception spec here.
+ // We duplicate the one parameter type.
+ EPI.RefQualifier = OperType->getRefQualifier();
+ EPI.ExtInfo = OperType->getExtInfo();
+ MD->setType(Context.getFunctionType(ReturnType, &ArgType, 1, EPI));
+ }
+
+ if (HadError) {
+ MD->setInvalidDecl();
+ return;
+ }
+
+ if (ShouldDeleteCopyAssignmentOperator(MD)) {
+ if (First) {
+ MD->setDeletedAsWritten();
+ } else {
+ Diag(MD->getLocation(), diag::err_out_of_line_default_deletes)
+ << CXXCopyAssignment;
+ MD->setInvalidDecl();
+ }
+ }
+}
+
+void Sema::CheckExplicitlyDefaultedDestructor(CXXDestructorDecl *DD) {
+ assert(DD->isExplicitlyDefaulted());
+
+ // Whether this was the first-declared instance of the destructor.
+ bool First = DD == DD->getCanonicalDecl();
+
+ ImplicitExceptionSpecification Spec
+ = ComputeDefaultedDtorExceptionSpec(DD->getParent());
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
+ const FunctionProtoType *DtorType = DD->getType()->getAs<FunctionProtoType>(),
+ *ExceptionType = Context.getFunctionType(
+ Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
+
+ if (DtorType->hasExceptionSpec()) {
+ if (CheckEquivalentExceptionSpec(
+ PDiag(diag::err_incorrect_defaulted_exception_spec)
+ << CXXDestructor,
+ PDiag(),
+ ExceptionType, SourceLocation(),
+ DtorType, DD->getLocation())) {
+ DD->setInvalidDecl();
+ return;
+ }
+ } else if (First) {
+ // We set the declaration to have the computed exception spec here.
+ // There are no parameters.
+ EPI.ExtInfo = DtorType->getExtInfo();
+ DD->setType(Context.getFunctionType(Context.VoidTy, 0, 0, EPI));
+ }
+
+ if (ShouldDeleteDestructor(DD)) {
+ if (First) {
+ DD->setDeletedAsWritten();
+ } else {
+ Diag(DD->getLocation(), diag::err_out_of_line_default_deletes)
+ << CXXDestructor;
+ DD->setInvalidDecl();
+ }
+ }
+}
+
+bool Sema::ShouldDeleteDefaultConstructor(CXXConstructorDecl *CD) {
+ CXXRecordDecl *RD = CD->getParent();
+ assert(!RD->isDependentType() && "do deletion after instantiation");
+ if (!LangOpts.CPlusPlus0x)
+ return false;
+
+ SourceLocation Loc = CD->getLocation();
+
+ // Do access control from the constructor
+ ContextRAII CtorContext(*this, CD);
+
+ bool Union = RD->isUnion();
+ bool AllConst = true;
+
+ // We do this because we should never actually use an anonymous
+ // union's constructor.
+ if (Union && RD->isAnonymousStructOrUnion())
+ return false;
+
+ // FIXME: We should put some diagnostic logic right into this function.
+
+ // C++0x [class.ctor]/5
+ // A defaulted default constructor for class X is defined as deleted if:
+
+ for (CXXRecordDecl::base_class_iterator BI = RD->bases_begin(),
+ BE = RD->bases_end();
+ BI != BE; ++BI) {
+ // We'll handle this one later
+ if (BI->isVirtual())
+ continue;
+
+ CXXRecordDecl *BaseDecl = BI->getType()->getAsCXXRecordDecl();
+ assert(BaseDecl && "base isn't a CXXRecordDecl");
+
+ // -- any [direct base class] has a type with a destructor that is
+ // deleted or inaccessible from the defaulted default constructor
+ CXXDestructorDecl *BaseDtor = LookupDestructor(BaseDecl);
+ if (BaseDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, BaseDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+
+ // -- any [direct base class either] has no default constructor or
+ // overload resolution as applied to [its] default constructor
+ // results in an ambiguity or in a function that is deleted or
+ // inaccessible from the defaulted default constructor
+ CXXConstructorDecl *BaseDefault = LookupDefaultConstructor(BaseDecl);
+ if (!BaseDefault || BaseDefault->isDeleted())
+ return true;
+
+ if (CheckConstructorAccess(Loc, BaseDefault, BaseDefault->getAccess(),
+ PDiag()) != AR_accessible)
+ return true;
+ }
+
+ for (CXXRecordDecl::base_class_iterator BI = RD->vbases_begin(),
+ BE = RD->vbases_end();
+ BI != BE; ++BI) {
+ CXXRecordDecl *BaseDecl = BI->getType()->getAsCXXRecordDecl();
+ assert(BaseDecl && "base isn't a CXXRecordDecl");
+
+ // -- any [virtual base class] has a type with a destructor that is
+ // delete or inaccessible from the defaulted default constructor
+ CXXDestructorDecl *BaseDtor = LookupDestructor(BaseDecl);
+ if (BaseDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, BaseDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+
+ // -- any [virtual base class either] has no default constructor or
+ // overload resolution as applied to [its] default constructor
+ // results in an ambiguity or in a function that is deleted or
+ // inaccessible from the defaulted default constructor
+ CXXConstructorDecl *BaseDefault = LookupDefaultConstructor(BaseDecl);
+ if (!BaseDefault || BaseDefault->isDeleted())
+ return true;
+
+ if (CheckConstructorAccess(Loc, BaseDefault, BaseDefault->getAccess(),
+ PDiag()) != AR_accessible)
+ return true;
+ }
+
+ for (CXXRecordDecl::field_iterator FI = RD->field_begin(),
+ FE = RD->field_end();
+ FI != FE; ++FI) {
+ if (FI->isInvalidDecl())
+ continue;
+
+ QualType FieldType = Context.getBaseElementType(FI->getType());
+ CXXRecordDecl *FieldRecord = FieldType->getAsCXXRecordDecl();
+
+ // -- any non-static data member with no brace-or-equal-initializer is of
+ // reference type
+ if (FieldType->isReferenceType() && !FI->hasInClassInitializer())
+ return true;
+
+ // -- X is a union and all its variant members are of const-qualified type
+ // (or array thereof)
+ if (Union && !FieldType.isConstQualified())
+ AllConst = false;
+
+ if (FieldRecord) {
+ // -- X is a union-like class that has a variant member with a non-trivial
+ // default constructor
+ if (Union && !FieldRecord->hasTrivialDefaultConstructor())
+ return true;
+
+ CXXDestructorDecl *FieldDtor = LookupDestructor(FieldRecord);
+ if (FieldDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, FieldDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+
+ // -- any non-variant non-static data member of const-qualified type (or
+ // array thereof) with no brace-or-equal-initializer does not have a
+ // user-provided default constructor
+ if (FieldType.isConstQualified() &&
+ !FI->hasInClassInitializer() &&
+ !FieldRecord->hasUserProvidedDefaultConstructor())
+ return true;
+
+ if (!Union && FieldRecord->isUnion() &&
+ FieldRecord->isAnonymousStructOrUnion()) {
+ // We're okay to reuse AllConst here since we only care about the
+ // value otherwise if we're in a union.
+ AllConst = true;
+
+ for (CXXRecordDecl::field_iterator UI = FieldRecord->field_begin(),
+ UE = FieldRecord->field_end();
+ UI != UE; ++UI) {
+ QualType UnionFieldType = Context.getBaseElementType(UI->getType());
+ CXXRecordDecl *UnionFieldRecord =
+ UnionFieldType->getAsCXXRecordDecl();
+
+ if (!UnionFieldType.isConstQualified())
+ AllConst = false;
+
+ if (UnionFieldRecord &&
+ !UnionFieldRecord->hasTrivialDefaultConstructor())
+ return true;
+ }
+
+ if (AllConst)
+ return true;
+
+ // Don't try to initialize the anonymous union
+ // This is technically non-conformant, but sanity demands it.
+ continue;
+ }
+
+ // -- any non-static data member with no brace-or-equal-initializer has
+ // class type M (or array thereof) and either M has no default
+ // constructor or overload resolution as applied to M's default
+ // constructor results in an ambiguity or in a function that is deleted
+ // or inaccessible from the defaulted default constructor.
+ if (!FI->hasInClassInitializer()) {
+ CXXConstructorDecl *FieldDefault = LookupDefaultConstructor(FieldRecord);
+ if (!FieldDefault || FieldDefault->isDeleted())
+ return true;
+ if (CheckConstructorAccess(Loc, FieldDefault, FieldDefault->getAccess(),
+ PDiag()) != AR_accessible)
+ return true;
+ }
+ } else if (!Union && FieldType.isConstQualified() &&
+ !FI->hasInClassInitializer()) {
+ // -- any non-variant non-static data member of const-qualified type (or
+ // array thereof) with no brace-or-equal-initializer does not have a
+ // user-provided default constructor
+ return true;
+ }
+ }
+
+ if (Union && AllConst)
+ return true;
+
+ return false;
+}
+
+bool Sema::ShouldDeleteCopyConstructor(CXXConstructorDecl *CD) {
+ CXXRecordDecl *RD = CD->getParent();
+ assert(!RD->isDependentType() && "do deletion after instantiation");
+ if (!LangOpts.CPlusPlus0x)
+ return false;
+
+ SourceLocation Loc = CD->getLocation();
+
+ // Do access control from the constructor
+ ContextRAII CtorContext(*this, CD);
+
+ bool Union = RD->isUnion();
+
+ assert(!CD->getParamDecl(0)->getType()->getPointeeType().isNull() &&
+ "copy assignment arg has no pointee type");
+ unsigned ArgQuals =
+ CD->getParamDecl(0)->getType()->getPointeeType().isConstQualified() ?
+ Qualifiers::Const : 0;
+
+ // We do this because we should never actually use an anonymous
+ // union's constructor.
+ if (Union && RD->isAnonymousStructOrUnion())
+ return false;
+
+ // FIXME: We should put some diagnostic logic right into this function.
+
+ // C++0x [class.copy]/11
+ // A defaulted [copy] constructor for class X is defined as delete if X has:
+
+ for (CXXRecordDecl::base_class_iterator BI = RD->bases_begin(),
+ BE = RD->bases_end();
+ BI != BE; ++BI) {
+ // We'll handle this one later
+ if (BI->isVirtual())
+ continue;
+
+ QualType BaseType = BI->getType();
+ CXXRecordDecl *BaseDecl = BaseType->getAsCXXRecordDecl();
+ assert(BaseDecl && "base isn't a CXXRecordDecl");
+
+ // -- any [direct base class] of a type with a destructor that is deleted or
+ // inaccessible from the defaulted constructor
+ CXXDestructorDecl *BaseDtor = LookupDestructor(BaseDecl);
+ if (BaseDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, BaseDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+
+ // -- a [direct base class] B that cannot be [copied] because overload
+ // resolution, as applied to B's [copy] constructor, results in an
+ // ambiguity or a function that is deleted or inaccessible from the
+ // defaulted constructor
+ CXXConstructorDecl *BaseCtor = LookupCopyConstructor(BaseDecl, ArgQuals);
+ if (!BaseCtor || BaseCtor->isDeleted())
+ return true;
+ if (CheckConstructorAccess(Loc, BaseCtor, BaseCtor->getAccess(), PDiag()) !=
+ AR_accessible)
+ return true;
+ }
+
+ for (CXXRecordDecl::base_class_iterator BI = RD->vbases_begin(),
+ BE = RD->vbases_end();
+ BI != BE; ++BI) {
+ QualType BaseType = BI->getType();
+ CXXRecordDecl *BaseDecl = BaseType->getAsCXXRecordDecl();
+ assert(BaseDecl && "base isn't a CXXRecordDecl");
+
+ // -- any [virtual base class] of a type with a destructor that is deleted or
+ // inaccessible from the defaulted constructor
+ CXXDestructorDecl *BaseDtor = LookupDestructor(BaseDecl);
+ if (BaseDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, BaseDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+
+ // -- a [virtual base class] B that cannot be [copied] because overload
+ // resolution, as applied to B's [copy] constructor, results in an
+ // ambiguity or a function that is deleted or inaccessible from the
+ // defaulted constructor
+ CXXConstructorDecl *BaseCtor = LookupCopyConstructor(BaseDecl, ArgQuals);
+ if (!BaseCtor || BaseCtor->isDeleted())
+ return true;
+ if (CheckConstructorAccess(Loc, BaseCtor, BaseCtor->getAccess(), PDiag()) !=
+ AR_accessible)
+ return true;
+ }
+
+ for (CXXRecordDecl::field_iterator FI = RD->field_begin(),
+ FE = RD->field_end();
+ FI != FE; ++FI) {
+ QualType FieldType = Context.getBaseElementType(FI->getType());
+
+ // -- for a copy constructor, a non-static data member of rvalue reference
+ // type
+ if (FieldType->isRValueReferenceType())
+ return true;
+
+ CXXRecordDecl *FieldRecord = FieldType->getAsCXXRecordDecl();
+
+ if (FieldRecord) {
+ // This is an anonymous union
+ if (FieldRecord->isUnion() && FieldRecord->isAnonymousStructOrUnion()) {
+ // Anonymous unions inside unions do not variant members create
+ if (!Union) {
+ for (CXXRecordDecl::field_iterator UI = FieldRecord->field_begin(),
+ UE = FieldRecord->field_end();
+ UI != UE; ++UI) {
+ QualType UnionFieldType = Context.getBaseElementType(UI->getType());
+ CXXRecordDecl *UnionFieldRecord =
+ UnionFieldType->getAsCXXRecordDecl();
+
+ // -- a variant member with a non-trivial [copy] constructor and X
+ // is a union-like class
+ if (UnionFieldRecord &&
+ !UnionFieldRecord->hasTrivialCopyConstructor())
+ return true;
+ }
+ }
+
+ // Don't try to initalize an anonymous union
+ continue;
+ } else {
+ // -- a variant member with a non-trivial [copy] constructor and X is a
+ // union-like class
+ if (Union && !FieldRecord->hasTrivialCopyConstructor())
+ return true;
+
+ // -- any [non-static data member] of a type with a destructor that is
+ // deleted or inaccessible from the defaulted constructor
+ CXXDestructorDecl *FieldDtor = LookupDestructor(FieldRecord);
+ if (FieldDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, FieldDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+ }
+
+ // -- a [non-static data member of class type (or array thereof)] B that
+ // cannot be [copied] because overload resolution, as applied to B's
+ // [copy] constructor, results in an ambiguity or a function that is
+ // deleted or inaccessible from the defaulted constructor
+ CXXConstructorDecl *FieldCtor = LookupCopyConstructor(FieldRecord,
+ ArgQuals);
+ if (!FieldCtor || FieldCtor->isDeleted())
+ return true;
+ if (CheckConstructorAccess(Loc, FieldCtor, FieldCtor->getAccess(),
+ PDiag()) != AR_accessible)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool Sema::ShouldDeleteCopyAssignmentOperator(CXXMethodDecl *MD) {
+ CXXRecordDecl *RD = MD->getParent();
+ assert(!RD->isDependentType() && "do deletion after instantiation");
+ if (!LangOpts.CPlusPlus0x)
+ return false;
+
+ SourceLocation Loc = MD->getLocation();
+
+ // Do access control from the constructor
+ ContextRAII MethodContext(*this, MD);
+
+ bool Union = RD->isUnion();
+
+ bool ConstArg =
+ MD->getParamDecl(0)->getType()->getPointeeType().isConstQualified();
+
+ // We do this because we should never actually use an anonymous
+ // union's constructor.
+ if (Union && RD->isAnonymousStructOrUnion())
+ return false;
+
+ DeclarationName OperatorName =
+ Context.DeclarationNames.getCXXOperatorName(OO_Equal);
+ LookupResult R(*this, OperatorName, Loc, LookupOrdinaryName);
+ R.suppressDiagnostics();
+
+ // FIXME: We should put some diagnostic logic right into this function.
+
+ // C++0x [class.copy]/11
+ // A defaulted [copy] assignment operator for class X is defined as deleted
+ // if X has:
+
+ for (CXXRecordDecl::base_class_iterator BI = RD->bases_begin(),
+ BE = RD->bases_end();
+ BI != BE; ++BI) {
+ // We'll handle this one later
+ if (BI->isVirtual())
+ continue;
+
+ QualType BaseType = BI->getType();
+ CXXRecordDecl *BaseDecl = BaseType->getAsCXXRecordDecl();
+ assert(BaseDecl && "base isn't a CXXRecordDecl");
+
+ // -- a [direct base class] B that cannot be [copied] because overload
+ // resolution, as applied to B's [copy] assignment operator, results in
+ // an ambiguity or a function that is deleted or inaccessible from the
+ // assignment operator
+
+ LookupQualifiedName(R, BaseDecl, false);
+
+ // Filter out any result that isn't a copy-assignment operator.
+ LookupResult::Filter F = R.makeFilter();
+ while (F.hasNext()) {
+ NamedDecl *D = F.next();
+ if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D))
+ if (Method->isCopyAssignmentOperator())
+ continue;
+
+ F.erase();
+ }
+ F.done();
+
+ // Build a fake argument expression
+ QualType ArgType = BaseType;
+ QualType ThisType = BaseType;
+ if (ConstArg)
+ ArgType.addConst();
+ Expr *Args[] = { new (Context) OpaqueValueExpr(Loc, ThisType, VK_LValue)
+ , new (Context) OpaqueValueExpr(Loc, ArgType, VK_LValue)
+ };
+
+ OverloadCandidateSet OCS((Loc));
+ OverloadCandidateSet::iterator Best;
+
+ AddFunctionCandidates(R.asUnresolvedSet(), Args, 2, OCS);
+
+ if (OCS.BestViableFunction(*this, Loc, Best, false) !=
+ OR_Success)
+ return true;
+ }
+
+ for (CXXRecordDecl::base_class_iterator BI = RD->vbases_begin(),
+ BE = RD->vbases_end();
+ BI != BE; ++BI) {
+ QualType BaseType = BI->getType();
+ CXXRecordDecl *BaseDecl = BaseType->getAsCXXRecordDecl();
+ assert(BaseDecl && "base isn't a CXXRecordDecl");
+
+ // -- a [virtual base class] B that cannot be [copied] because overload
+ // resolution, as applied to B's [copy] assignment operator, results in
+ // an ambiguity or a function that is deleted or inaccessible from the
+ // assignment operator
+
+ LookupQualifiedName(R, BaseDecl, false);
+
+ // Filter out any result that isn't a copy-assignment operator.
+ LookupResult::Filter F = R.makeFilter();
+ while (F.hasNext()) {
+ NamedDecl *D = F.next();
+ if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D))
+ if (Method->isCopyAssignmentOperator())
+ continue;
+
+ F.erase();
+ }
+ F.done();
+
+ // Build a fake argument expression
+ QualType ArgType = BaseType;
+ QualType ThisType = BaseType;
+ if (ConstArg)
+ ArgType.addConst();
+ Expr *Args[] = { new (Context) OpaqueValueExpr(Loc, ThisType, VK_LValue)
+ , new (Context) OpaqueValueExpr(Loc, ArgType, VK_LValue)
+ };
+
+ OverloadCandidateSet OCS((Loc));
+ OverloadCandidateSet::iterator Best;
+
+ AddFunctionCandidates(R.asUnresolvedSet(), Args, 2, OCS);
+
+ if (OCS.BestViableFunction(*this, Loc, Best, false) !=
+ OR_Success)
+ return true;
+ }
+
+ for (CXXRecordDecl::field_iterator FI = RD->field_begin(),
+ FE = RD->field_end();
+ FI != FE; ++FI) {
+ QualType FieldType = Context.getBaseElementType(FI->getType());
+
+ // -- a non-static data member of reference type
+ if (FieldType->isReferenceType())
+ return true;
+
+ // -- a non-static data member of const non-class type (or array thereof)
+ if (FieldType.isConstQualified() && !FieldType->isRecordType())
+ return true;
+
+ CXXRecordDecl *FieldRecord = FieldType->getAsCXXRecordDecl();
+
+ if (FieldRecord) {
+ // This is an anonymous union
+ if (FieldRecord->isUnion() && FieldRecord->isAnonymousStructOrUnion()) {
+ // Anonymous unions inside unions do not variant members create
+ if (!Union) {
+ for (CXXRecordDecl::field_iterator UI = FieldRecord->field_begin(),
+ UE = FieldRecord->field_end();
+ UI != UE; ++UI) {
+ QualType UnionFieldType = Context.getBaseElementType(UI->getType());
+ CXXRecordDecl *UnionFieldRecord =
+ UnionFieldType->getAsCXXRecordDecl();
+
+ // -- a variant member with a non-trivial [copy] assignment operator
+ // and X is a union-like class
+ if (UnionFieldRecord &&
+ !UnionFieldRecord->hasTrivialCopyAssignment())
+ return true;
+ }
+ }
+
+ // Don't try to initalize an anonymous union
+ continue;
+ // -- a variant member with a non-trivial [copy] assignment operator
+ // and X is a union-like class
+ } else if (Union && !FieldRecord->hasTrivialCopyAssignment()) {
+ return true;
+ }
+
+ LookupQualifiedName(R, FieldRecord, false);
+
+ // Filter out any result that isn't a copy-assignment operator.
+ LookupResult::Filter F = R.makeFilter();
+ while (F.hasNext()) {
+ NamedDecl *D = F.next();
+ if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D))
+ if (Method->isCopyAssignmentOperator())
+ continue;
+
+ F.erase();
+ }
+ F.done();
+
+ // Build a fake argument expression
+ QualType ArgType = FieldType;
+ QualType ThisType = FieldType;
+ if (ConstArg)
+ ArgType.addConst();
+ Expr *Args[] = { new (Context) OpaqueValueExpr(Loc, ThisType, VK_LValue)
+ , new (Context) OpaqueValueExpr(Loc, ArgType, VK_LValue)
+ };
+
+ OverloadCandidateSet OCS((Loc));
+ OverloadCandidateSet::iterator Best;
+
+ AddFunctionCandidates(R.asUnresolvedSet(), Args, 2, OCS);
+
+ if (OCS.BestViableFunction(*this, Loc, Best, false) !=
+ OR_Success)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool Sema::ShouldDeleteDestructor(CXXDestructorDecl *DD) {
+ CXXRecordDecl *RD = DD->getParent();
+ assert(!RD->isDependentType() && "do deletion after instantiation");
+ if (!LangOpts.CPlusPlus0x)
+ return false;
+
+ SourceLocation Loc = DD->getLocation();
+
+ // Do access control from the destructor
+ ContextRAII CtorContext(*this, DD);
+
+ bool Union = RD->isUnion();
+
+ // We do this because we should never actually use an anonymous
+ // union's destructor.
+ if (Union && RD->isAnonymousStructOrUnion())
+ return false;
+
+ // C++0x [class.dtor]p5
+ // A defaulted destructor for a class X is defined as deleted if:
+ for (CXXRecordDecl::base_class_iterator BI = RD->bases_begin(),
+ BE = RD->bases_end();
+ BI != BE; ++BI) {
+ // We'll handle this one later
+ if (BI->isVirtual())
+ continue;
+
+ CXXRecordDecl *BaseDecl = BI->getType()->getAsCXXRecordDecl();
+ CXXDestructorDecl *BaseDtor = LookupDestructor(BaseDecl);
+ assert(BaseDtor && "base has no destructor");
+
+ // -- any direct or virtual base class has a deleted destructor or
+ // a destructor that is inaccessible from the defaulted destructor
+ if (BaseDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, BaseDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+ }
+
+ for (CXXRecordDecl::base_class_iterator BI = RD->vbases_begin(),
+ BE = RD->vbases_end();
+ BI != BE; ++BI) {
+ CXXRecordDecl *BaseDecl = BI->getType()->getAsCXXRecordDecl();
+ CXXDestructorDecl *BaseDtor = LookupDestructor(BaseDecl);
+ assert(BaseDtor && "base has no destructor");
+
+ // -- any direct or virtual base class has a deleted destructor or
+ // a destructor that is inaccessible from the defaulted destructor
+ if (BaseDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, BaseDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+ }
+
+ for (CXXRecordDecl::field_iterator FI = RD->field_begin(),
+ FE = RD->field_end();
+ FI != FE; ++FI) {
+ QualType FieldType = Context.getBaseElementType(FI->getType());
+ CXXRecordDecl *FieldRecord = FieldType->getAsCXXRecordDecl();
+ if (FieldRecord) {
+ if (FieldRecord->isUnion() && FieldRecord->isAnonymousStructOrUnion()) {
+ for (CXXRecordDecl::field_iterator UI = FieldRecord->field_begin(),
+ UE = FieldRecord->field_end();
+ UI != UE; ++UI) {
+ QualType UnionFieldType = Context.getBaseElementType(FI->getType());
+ CXXRecordDecl *UnionFieldRecord =
+ UnionFieldType->getAsCXXRecordDecl();
+
+ // -- X is a union-like class that has a variant member with a non-
+ // trivial destructor.
+ if (UnionFieldRecord && !UnionFieldRecord->hasTrivialDestructor())
+ return true;
+ }
+ // Technically we are supposed to do this next check unconditionally.
+ // But that makes absolutely no sense.
+ } else {
+ CXXDestructorDecl *FieldDtor = LookupDestructor(FieldRecord);
+
+ // -- any of the non-static data members has class type M (or array
+ // thereof) and M has a deleted destructor or a destructor that is
+ // inaccessible from the defaulted destructor
+ if (FieldDtor->isDeleted())
+ return true;
+ if (CheckDestructorAccess(Loc, FieldDtor, PDiag()) !=
+ AR_accessible)
+ return true;
+
+ // -- X is a union-like class that has a variant member with a non-
+ // trivial destructor.
+ if (Union && !FieldDtor->isTrivial())
+ return true;
+ }
+ }
+ }
+
+ if (DD->isVirtual()) {
+ FunctionDecl *OperatorDelete = 0;
+ DeclarationName Name =
+ Context.DeclarationNames.getCXXOperatorName(OO_Delete);
+ if (FindDeallocationFunction(Loc, RD, Name, OperatorDelete,
+ false))
+ return true;
+ }
+
+
+ return false;
}
/// \brief Data used with FindHiddenVirtualMethod
@@ -3053,113 +4169,6 @@ void Sema::ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc,
dyn_cast_or_null<CXXRecordDecl>(TagDecl));
}
-namespace {
- /// \brief Helper class that collects exception specifications for
- /// implicitly-declared special member functions.
- class ImplicitExceptionSpecification {
- ASTContext &Context;
- // We order exception specifications thus:
- // noexcept is the most restrictive, but is only used in C++0x.
- // throw() comes next.
- // Then a throw(collected exceptions)
- // Finally no specification.
- // throw(...) is used instead if any called function uses it.
- ExceptionSpecificationType ComputedEST;
- llvm::SmallPtrSet<CanQualType, 4> ExceptionsSeen;
- llvm::SmallVector<QualType, 4> Exceptions;
-
- void ClearExceptions() {
- ExceptionsSeen.clear();
- Exceptions.clear();
- }
-
- public:
- explicit ImplicitExceptionSpecification(ASTContext &Context)
- : Context(Context), ComputedEST(EST_BasicNoexcept) {
- if (!Context.getLangOptions().CPlusPlus0x)
- ComputedEST = EST_DynamicNone;
- }
-
- /// \brief Get the computed exception specification type.
- ExceptionSpecificationType getExceptionSpecType() const {
- assert(ComputedEST != EST_ComputedNoexcept &&
- "noexcept(expr) should not be a possible result");
- return ComputedEST;
- }
-
- /// \brief The number of exceptions in the exception specification.
- unsigned size() const { return Exceptions.size(); }
-
- /// \brief The set of exceptions in the exception specification.
- const QualType *data() const { return Exceptions.data(); }
-
- /// \brief Integrate another called method into the collected data.
- void CalledDecl(CXXMethodDecl *Method) {
- // If we have an MSAny spec already, don't bother.
- if (!Method || ComputedEST == EST_MSAny)
- return;
-
- const FunctionProtoType *Proto
- = Method->getType()->getAs<FunctionProtoType>();
-
- ExceptionSpecificationType EST = Proto->getExceptionSpecType();
-
- // If this function can throw any exceptions, make a note of that.
- if (EST == EST_MSAny || EST == EST_None) {
- ClearExceptions();
- ComputedEST = EST;
- return;
- }
-
- // If this function has a basic noexcept, it doesn't affect the outcome.
- if (EST == EST_BasicNoexcept)
- return;
-
- // If we have a throw-all spec at this point, ignore the function.
- if (ComputedEST == EST_None)
- return;
-
- // If we're still at noexcept(true) and there's a nothrow() callee,
- // change to that specification.
- if (EST == EST_DynamicNone) {
- if (ComputedEST == EST_BasicNoexcept)
- ComputedEST = EST_DynamicNone;
- return;
- }
-
- // Check out noexcept specs.
- if (EST == EST_ComputedNoexcept) {
- FunctionProtoType::NoexceptResult NR = Proto->getNoexceptSpec(Context);
- assert(NR != FunctionProtoType::NR_NoNoexcept &&
- "Must have noexcept result for EST_ComputedNoexcept.");
- assert(NR != FunctionProtoType::NR_Dependent &&
- "Should not generate implicit declarations for dependent cases, "
- "and don't know how to handle them anyway.");
-
- // noexcept(false) -> no spec on the new function
- if (NR == FunctionProtoType::NR_Throw) {
- ClearExceptions();
- ComputedEST = EST_None;
- }
- // noexcept(true) won't change anything either.
- return;
- }
-
- assert(EST == EST_Dynamic && "EST case not considered earlier.");
- assert(ComputedEST != EST_None &&
- "Shouldn't collect exceptions when throw-all is guaranteed.");
- ComputedEST = EST_Dynamic;
- // Record the exceptions in this function's exception specification.
- for (FunctionProtoType::exception_iterator E = Proto->exception_begin(),
- EEnd = Proto->exception_end();
- E != EEnd; ++E)
- if (ExceptionsSeen.insert(Context.getCanonicalType(*E)))
- Exceptions.push_back(*E);
- }
- };
-}
-
-
/// AddImplicitlyDeclaredMembersToClass - Adds any implicitly-declared
/// special functions, such as the default constructor, copy
/// constructor, or destructor, to the given C++ class (C++
@@ -3467,6 +4476,11 @@ QualType Sema::CheckDestructorDeclarator(Declarator &D, QualType R,
if (const TypedefType *TT = DeclaratorType->getAs<TypedefType>())
Diag(D.getIdentifierLoc(), diag::err_destructor_typedef_name)
<< DeclaratorType << isa<TypeAliasDecl>(TT->getDecl());
+ else if (const TemplateSpecializationType *TST =
+ DeclaratorType->getAs<TemplateSpecializationType>())
+ if (TST->isTypeAlias())
+ Diag(D.getIdentifierLoc(), diag::err_destructor_typedef_name)
+ << DeclaratorType << 1;
// C++ [class.dtor]p2:
// A destructor is used to destroy objects of its class type. A
@@ -3725,18 +4739,37 @@ Decl *Sema::ActOnStartNamespaceDef(Scope *NamespcScope,
// treated as an original-namespace-name.
//
// Since namespace names are unique in their scope, and we don't
- // look through using directives, just
- DeclContext::lookup_result R = CurContext->getRedeclContext()->lookup(II);
- NamedDecl *PrevDecl = R.first == R.second? 0 : *R.first;
-
+ // look through using directives, just look for any ordinary names.
+
+ const unsigned IDNS = Decl::IDNS_Ordinary | Decl::IDNS_Member |
+ Decl::IDNS_Type | Decl::IDNS_Using | Decl::IDNS_Tag |
+ Decl::IDNS_Namespace;
+ NamedDecl *PrevDecl = 0;
+ for (DeclContext::lookup_result R
+ = CurContext->getRedeclContext()->lookup(II);
+ R.first != R.second; ++R.first) {
+ if ((*R.first)->getIdentifierNamespace() & IDNS) {
+ PrevDecl = *R.first;
+ break;
+ }
+ }
+
if (NamespaceDecl *OrigNS = dyn_cast_or_null<NamespaceDecl>(PrevDecl)) {
// This is an extended namespace definition.
if (Namespc->isInline() != OrigNS->isInline()) {
// inline-ness must match
- Diag(Namespc->getLocation(), diag::err_inline_namespace_mismatch)
- << Namespc->isInline();
+ if (OrigNS->isInline()) {
+ // The user probably just forgot the 'inline', so suggest that it
+ // be added back.
+ Diag(Namespc->getLocation(),
+ diag::warn_inline_namespace_reopened_noninline)
+ << FixItHint::CreateInsertion(NamespaceLoc, "inline ");
+ } else {
+ Diag(Namespc->getLocation(), diag::err_inline_namespace_mismatch)
+ << Namespc->isInline();
+ }
Diag(OrigNS->getLocation(), diag::note_previous_definition);
- Namespc->setInvalidDecl();
+
// Recover by ignoring the new namespace's inline status.
Namespc->setInline(OrigNS->isInline());
}
@@ -4408,6 +5441,7 @@ NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS,
// Otherwise, look up the target name.
LookupResult R(*this, NameInfo, LookupOrdinaryName);
+ R.setUsingDeclaration(true);
// Unlike most lookups, we don't always want to hide tag
// declarations: tag names are visible through the using declaration
@@ -4701,9 +5735,13 @@ bool Sema::CheckUsingDeclQualifier(SourceLocation UsingLoc,
Decl *Sema::ActOnAliasDeclaration(Scope *S,
AccessSpecifier AS,
+ MultiTemplateParamsArg TemplateParamLists,
SourceLocation UsingLoc,
UnqualifiedId &Name,
TypeResult Type) {
+ // Skip up to the relevant declaration scope.
+ while (S->getFlags() & Scope::TemplateParamScope)
+ S = S->getParent();
assert((S->getFlags() & Scope::DeclScope) &&
"got alias-declaration outside of declaration scope");
@@ -4719,8 +5757,11 @@ Decl *Sema::ActOnAliasDeclaration(Scope *S,
return 0;
if (DiagnoseUnexpandedParameterPack(Name.StartLocation, TInfo,
- UPPC_DeclarationType))
+ UPPC_DeclarationType)) {
Invalid = true;
+ TInfo = Context.getTrivialTypeSourceInfo(Context.IntTy,
+ TInfo->getTypeLoc().getBeginLoc());
+ }
LookupResult Previous(*this, NameInfo, LookupOrdinaryName, ForRedeclaration);
LookupName(Previous, S);
@@ -4745,13 +5786,93 @@ Decl *Sema::ActOnAliasDeclaration(Scope *S,
if (Invalid)
NewTD->setInvalidDecl();
+ CheckTypedefForVariablyModifiedType(S, NewTD);
+ Invalid |= NewTD->isInvalidDecl();
+
bool Redeclaration = false;
- ActOnTypedefNameDecl(S, CurContext, NewTD, Previous, Redeclaration);
+
+ NamedDecl *NewND;
+ if (TemplateParamLists.size()) {
+ TypeAliasTemplateDecl *OldDecl = 0;
+ TemplateParameterList *OldTemplateParams = 0;
+
+ if (TemplateParamLists.size() != 1) {
+ Diag(UsingLoc, diag::err_alias_template_extra_headers)
+ << SourceRange(TemplateParamLists.get()[1]->getTemplateLoc(),
+ TemplateParamLists.get()[TemplateParamLists.size()-1]->getRAngleLoc());
+ }
+ TemplateParameterList *TemplateParams = TemplateParamLists.get()[0];
+
+ // Only consider previous declarations in the same scope.
+ FilterLookupForScope(Previous, CurContext, S, /*ConsiderLinkage*/false,
+ /*ExplicitInstantiationOrSpecialization*/false);
+ if (!Previous.empty()) {
+ Redeclaration = true;
+
+ OldDecl = Previous.getAsSingle<TypeAliasTemplateDecl>();
+ if (!OldDecl && !Invalid) {
+ Diag(UsingLoc, diag::err_redefinition_different_kind)
+ << Name.Identifier;
+
+ NamedDecl *OldD = Previous.getRepresentativeDecl();
+ if (OldD->getLocation().isValid())
+ Diag(OldD->getLocation(), diag::note_previous_definition);
+
+ Invalid = true;
+ }
+
+ if (!Invalid && OldDecl && !OldDecl->isInvalidDecl()) {
+ if (TemplateParameterListsAreEqual(TemplateParams,
+ OldDecl->getTemplateParameters(),
+ /*Complain=*/true,
+ TPL_TemplateMatch))
+ OldTemplateParams = OldDecl->getTemplateParameters();
+ else
+ Invalid = true;
+
+ TypeAliasDecl *OldTD = OldDecl->getTemplatedDecl();
+ if (!Invalid &&
+ !Context.hasSameType(OldTD->getUnderlyingType(),
+ NewTD->getUnderlyingType())) {
+ // FIXME: The C++0x standard does not clearly say this is ill-formed,
+ // but we can't reasonably accept it.
+ Diag(NewTD->getLocation(), diag::err_redefinition_different_typedef)
+ << 2 << NewTD->getUnderlyingType() << OldTD->getUnderlyingType();
+ if (OldTD->getLocation().isValid())
+ Diag(OldTD->getLocation(), diag::note_previous_definition);
+ Invalid = true;
+ }
+ }
+ }
+
+ // Merge any previous default template arguments into our parameters,
+ // and check the parameter list.
+ if (CheckTemplateParameterList(TemplateParams, OldTemplateParams,
+ TPC_TypeAliasTemplate))
+ return 0;
+
+ TypeAliasTemplateDecl *NewDecl =
+ TypeAliasTemplateDecl::Create(Context, CurContext, UsingLoc,
+ Name.Identifier, TemplateParams,
+ NewTD);
+
+ NewDecl->setAccess(AS);
+
+ if (Invalid)
+ NewDecl->setInvalidDecl();
+ else if (OldDecl)
+ NewDecl->setPreviousDeclaration(OldDecl);
+
+ NewND = NewDecl;
+ } else {
+ ActOnTypedefNameDecl(S, CurContext, NewTD, Previous, Redeclaration);
+ NewND = NewTD;
+ }
if (!Redeclaration)
- PushOnScopeChains(NewTD, S);
+ PushOnScopeChains(NewND, S);
- return NewTD;
+ return NewND;
}
Decl *Sema::ActOnNamespaceAliasDef(Scope *S,
@@ -4855,39 +5976,8 @@ namespace {
};
}
-static CXXConstructorDecl *getDefaultConstructorUnsafe(Sema &Self,
- CXXRecordDecl *D) {
- ASTContext &Context = Self.Context;
- QualType ClassType = Context.getTypeDeclType(D);
- DeclarationName ConstructorName
- = Context.DeclarationNames.getCXXConstructorName(
- Context.getCanonicalType(ClassType.getUnqualifiedType()));
-
- DeclContext::lookup_const_iterator Con, ConEnd;
- for (llvm::tie(Con, ConEnd) = D->lookup(ConstructorName);
- Con != ConEnd; ++Con) {
- // FIXME: In C++0x, a constructor template can be a default constructor.
- if (isa<FunctionTemplateDecl>(*Con))
- continue;
-
- CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con);
- if (Constructor->isDefaultConstructor())
- return Constructor;
- }
- return 0;
-}
-
-CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor(
- CXXRecordDecl *ClassDecl) {
- // C++ [class.ctor]p5:
- // A default constructor for a class X is a constructor of class X
- // that can be called without an argument. If there is no
- // user-declared constructor for class X, a default constructor is
- // implicitly declared. An implicitly-declared default constructor
- // is an inline public member of its class.
- assert(!ClassDecl->hasUserDeclaredConstructor() &&
- "Should not build implicit default constructor!");
-
+Sema::ImplicitExceptionSpecification
+Sema::ComputeDefaultedDefaultCtorExceptionSpec(CXXRecordDecl *ClassDecl) {
// C++ [except.spec]p14:
// An implicitly declared special member function (Clause 12) shall have an
// exception-specification. [...]
@@ -4902,10 +5992,10 @@ CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor(
if (const RecordType *BaseType = B->getType()->getAs<RecordType>()) {
CXXRecordDecl *BaseClassDecl = cast<CXXRecordDecl>(BaseType->getDecl());
- if (!BaseClassDecl->hasDeclaredDefaultConstructor())
- ExceptSpec.CalledDecl(DeclareImplicitDefaultConstructor(BaseClassDecl));
- else if (CXXConstructorDecl *Constructor
- = getDefaultConstructorUnsafe(*this, BaseClassDecl))
+ CXXConstructorDecl *Constructor = LookupDefaultConstructor(BaseClassDecl);
+ // If this is a deleted function, add it anyway. This might be conformant
+ // with the standard. This might not. I'm not sure. It might not matter.
+ if (Constructor)
ExceptSpec.CalledDecl(Constructor);
}
}
@@ -4916,10 +6006,10 @@ CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor(
B != BEnd; ++B) {
if (const RecordType *BaseType = B->getType()->getAs<RecordType>()) {
CXXRecordDecl *BaseClassDecl = cast<CXXRecordDecl>(BaseType->getDecl());
- if (!BaseClassDecl->hasDeclaredDefaultConstructor())
- ExceptSpec.CalledDecl(DeclareImplicitDefaultConstructor(BaseClassDecl));
- else if (CXXConstructorDecl *Constructor
- = getDefaultConstructorUnsafe(*this, BaseClassDecl))
+ CXXConstructorDecl *Constructor = LookupDefaultConstructor(BaseClassDecl);
+ // If this is a deleted function, add it anyway. This might be conformant
+ // with the standard. This might not. I'm not sure. It might not matter.
+ if (Constructor)
ExceptSpec.CalledDecl(Constructor);
}
}
@@ -4928,22 +6018,42 @@ CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor(
for (RecordDecl::field_iterator F = ClassDecl->field_begin(),
FEnd = ClassDecl->field_end();
F != FEnd; ++F) {
- if (const RecordType *RecordTy
+ if (F->hasInClassInitializer()) {
+ if (Expr *E = F->getInClassInitializer())
+ ExceptSpec.CalledExpr(E);
+ else if (!F->isInvalidDecl())
+ ExceptSpec.SetDelayed();
+ } else if (const RecordType *RecordTy
= Context.getBaseElementType(F->getType())->getAs<RecordType>()) {
- CXXRecordDecl *FieldClassDecl = cast<CXXRecordDecl>(RecordTy->getDecl());
- if (!FieldClassDecl->hasDeclaredDefaultConstructor())
- ExceptSpec.CalledDecl(
- DeclareImplicitDefaultConstructor(FieldClassDecl));
- else if (CXXConstructorDecl *Constructor
- = getDefaultConstructorUnsafe(*this, FieldClassDecl))
+ CXXRecordDecl *FieldRecDecl = cast<CXXRecordDecl>(RecordTy->getDecl());
+ CXXConstructorDecl *Constructor = LookupDefaultConstructor(FieldRecDecl);
+ // If this is a deleted function, add it anyway. This might be conformant
+ // with the standard. This might not. I'm not sure. It might not matter.
+ // In particular, the problem is that this function never gets called. It
+ // might just be ill-formed because this function attempts to refer to
+ // a deleted function here.
+ if (Constructor)
ExceptSpec.CalledDecl(Constructor);
}
}
- FunctionProtoType::ExtProtoInfo EPI;
- EPI.ExceptionSpecType = ExceptSpec.getExceptionSpecType();
- EPI.NumExceptions = ExceptSpec.size();
- EPI.Exceptions = ExceptSpec.data();
+ return ExceptSpec;
+}
+
+CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor(
+ CXXRecordDecl *ClassDecl) {
+ // C++ [class.ctor]p5:
+ // A default constructor for a class X is a constructor of class X
+ // that can be called without an argument. If there is no
+ // user-declared constructor for class X, a default constructor is
+ // implicitly declared. An implicitly-declared default constructor
+ // is an inline public member of its class.
+ assert(!ClassDecl->hasUserDeclaredConstructor() &&
+ "Should not build implicit default constructor!");
+
+ ImplicitExceptionSpecification Spec =
+ ComputeDefaultedDefaultCtorExceptionSpec(ClassDecl);
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
// Create the actual constructor declaration.
CanQualType ClassType
@@ -4961,8 +6071,9 @@ CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor(
/*isInline=*/true,
/*isImplicitlyDeclared=*/true);
DefaultCon->setAccess(AS_public);
+ DefaultCon->setDefaulted();
DefaultCon->setImplicit();
- DefaultCon->setTrivial(ClassDecl->hasTrivialConstructor());
+ DefaultCon->setTrivial(ClassDecl->hasTrivialDefaultConstructor());
// Note that we have declared this constructor.
++ASTContext::NumImplicitDefaultConstructorsDeclared;
@@ -4970,14 +6081,18 @@ CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor(
if (Scope *S = getScopeForContext(ClassDecl))
PushOnScopeChains(DefaultCon, S, false);
ClassDecl->addDecl(DefaultCon);
+
+ if (ShouldDeleteDefaultConstructor(DefaultCon))
+ DefaultCon->setDeletedAsWritten();
return DefaultCon;
}
void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
CXXConstructorDecl *Constructor) {
- assert((Constructor->isImplicit() && Constructor->isDefaultConstructor() &&
- !Constructor->isUsed(false)) &&
+ assert((Constructor->isDefaulted() && Constructor->isDefaultConstructor() &&
+ !Constructor->doesThisDeclarationHaveABody() &&
+ !Constructor->isDeleted()) &&
"DefineImplicitDefaultConstructor - call it for implicit default ctor");
CXXRecordDecl *ClassDecl = Constructor->getParent();
@@ -4988,7 +6103,7 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
if (SetCtorInitializers(Constructor, 0, 0, /*AnyErrors=*/false) ||
Trap.hasErrorOccurred()) {
Diag(CurrentLocation, diag::note_member_synthesized_at)
- << CXXConstructor << Context.getTagDeclType(ClassDecl);
+ << CXXDefaultConstructor << Context.getTagDeclType(ClassDecl);
Constructor->setInvalidDecl();
return;
}
@@ -5004,6 +6119,59 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
}
}
+/// Get any existing defaulted default constructor for the given class. Do not
+/// implicitly define one if it does not exist.
+static CXXConstructorDecl *getDefaultedDefaultConstructorUnsafe(Sema &Self,
+ CXXRecordDecl *D) {
+ ASTContext &Context = Self.Context;
+ QualType ClassType = Context.getTypeDeclType(D);
+ DeclarationName ConstructorName
+ = Context.DeclarationNames.getCXXConstructorName(
+ Context.getCanonicalType(ClassType.getUnqualifiedType()));
+
+ DeclContext::lookup_const_iterator Con, ConEnd;
+ for (llvm::tie(Con, ConEnd) = D->lookup(ConstructorName);
+ Con != ConEnd; ++Con) {
+ // A function template cannot be defaulted.
+ if (isa<FunctionTemplateDecl>(*Con))
+ continue;
+
+ CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con);
+ if (Constructor->isDefaultConstructor())
+ return Constructor->isDefaulted() ? Constructor : 0;
+ }
+ return 0;
+}
+
+void Sema::ActOnFinishDelayedMemberInitializers(Decl *D) {
+ if (!D) return;
+ AdjustDeclIfTemplate(D);
+
+ CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(D);
+ CXXConstructorDecl *CtorDecl
+ = getDefaultedDefaultConstructorUnsafe(*this, ClassDecl);
+
+ if (!CtorDecl) return;
+
+ // Compute the exception specification for the default constructor.
+ const FunctionProtoType *CtorTy =
+ CtorDecl->getType()->castAs<FunctionProtoType>();
+ if (CtorTy->getExceptionSpecType() == EST_Delayed) {
+ ImplicitExceptionSpecification Spec =
+ ComputeDefaultedDefaultCtorExceptionSpec(ClassDecl);
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
+ assert(EPI.ExceptionSpecType != EST_Delayed);
+
+ CtorDecl->setType(Context.getFunctionType(Context.VoidTy, 0, 0, EPI));
+ }
+
+ // If the default constructor is explicitly defaulted, checking the exception
+ // specification is deferred until now.
+ if (!CtorDecl->isInvalidDecl() && CtorDecl->isExplicitlyDefaulted() &&
+ !ClassDecl->isDependentType())
+ CheckExplicitlyDefaultedDefaultConstructor(CtorDecl);
+}
+
void Sema::DeclareInheritedConstructors(CXXRecordDecl *ClassDecl) {
// We start with an initial pass over the base classes to collect those that
// inherit constructors from. If there are none, we can forgo all further
@@ -5097,7 +6265,9 @@ void Sema::DeclareInheritedConstructors(CXXRecordDecl *ClassDecl) {
// Build up a function type for this particular constructor.
// FIXME: The working paper does not consider that the exception spec
// for the inheriting constructor might be larger than that of the
- // source. This code doesn't yet, either.
+ // source. This code doesn't yet, either. When it does, this code will
+ // need to be delayed until after exception specifications and in-class
+ // member initializers are attached.
const Type *NewCtorType;
if (params == maxParams)
NewCtorType = BaseCtorType;
@@ -5179,12 +6349,8 @@ void Sema::DeclareInheritedConstructors(CXXRecordDecl *ClassDecl) {
}
}
-CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) {
- // C++ [class.dtor]p2:
- // If a class has no user-declared destructor, a destructor is
- // declared implicitly. An implicitly-declared destructor is an
- // inline public member of its class.
-
+Sema::ImplicitExceptionSpecification
+Sema::ComputeDefaultedDtorExceptionSpec(CXXRecordDecl *ClassDecl) {
// C++ [except.spec]p14:
// An implicitly declared special member function (Clause 12) shall have
// an exception-specification.
@@ -5199,18 +6365,18 @@ CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) {
if (const RecordType *BaseType = B->getType()->getAs<RecordType>())
ExceptSpec.CalledDecl(
- LookupDestructor(cast<CXXRecordDecl>(BaseType->getDecl())));
+ LookupDestructor(cast<CXXRecordDecl>(BaseType->getDecl())));
}
-
+
// Virtual base-class destructors.
for (CXXRecordDecl::base_class_iterator B = ClassDecl->vbases_begin(),
BEnd = ClassDecl->vbases_end();
B != BEnd; ++B) {
if (const RecordType *BaseType = B->getType()->getAs<RecordType>())
ExceptSpec.CalledDecl(
- LookupDestructor(cast<CXXRecordDecl>(BaseType->getDecl())));
+ LookupDestructor(cast<CXXRecordDecl>(BaseType->getDecl())));
}
-
+
// Field destructors.
for (RecordDecl::field_iterator F = ClassDecl->field_begin(),
FEnd = ClassDecl->field_end();
@@ -5218,14 +6384,23 @@ CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) {
if (const RecordType *RecordTy
= Context.getBaseElementType(F->getType())->getAs<RecordType>())
ExceptSpec.CalledDecl(
- LookupDestructor(cast<CXXRecordDecl>(RecordTy->getDecl())));
+ LookupDestructor(cast<CXXRecordDecl>(RecordTy->getDecl())));
}
+ return ExceptSpec;
+}
+
+CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) {
+ // C++ [class.dtor]p2:
+ // If a class has no user-declared destructor, a destructor is
+ // declared implicitly. An implicitly-declared destructor is an
+ // inline public member of its class.
+
+ ImplicitExceptionSpecification Spec =
+ ComputeDefaultedDtorExceptionSpec(ClassDecl);
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
+
// Create the actual destructor declaration.
- FunctionProtoType::ExtProtoInfo EPI;
- EPI.ExceptionSpecType = ExceptSpec.getExceptionSpecType();
- EPI.NumExceptions = ExceptSpec.size();
- EPI.Exceptions = ExceptSpec.data();
QualType Ty = Context.getFunctionType(Context.VoidTy, 0, 0, EPI);
CanQualType ClassType
@@ -5239,6 +6414,7 @@ CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) {
/*isInline=*/true,
/*isImplicitlyDeclared=*/true);
Destructor->setAccess(AS_public);
+ Destructor->setDefaulted();
Destructor->setImplicit();
Destructor->setTrivial(ClassDecl->hasTrivialDestructor());
@@ -5252,6 +6428,9 @@ CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) {
// This could be uniqued if it ever proves significant.
Destructor->setTypeSourceInfo(Context.getTrivialTypeSourceInfo(Ty));
+
+ if (ShouldDeleteDestructor(Destructor))
+ Destructor->setDeletedAsWritten();
AddOverriddenMethods(ClassDecl, Destructor);
@@ -5260,7 +6439,8 @@ CXXDestructorDecl *Sema::DeclareImplicitDestructor(CXXRecordDecl *ClassDecl) {
void Sema::DefineImplicitDestructor(SourceLocation CurrentLocation,
CXXDestructorDecl *Destructor) {
- assert((Destructor->isImplicit() && !Destructor->isUsed(false)) &&
+ assert((Destructor->isDefaulted() &&
+ !Destructor->doesThisDeclarationHaveABody()) &&
"DefineImplicitDestructor - call it for implicit default dtor");
CXXRecordDecl *ClassDecl = Destructor->getParent();
assert(ClassDecl && "DefineImplicitDestructor - invalid destructor");
@@ -5293,6 +6473,35 @@ void Sema::DefineImplicitDestructor(SourceLocation CurrentLocation,
}
}
+void Sema::AdjustDestructorExceptionSpec(CXXRecordDecl *classDecl,
+ CXXDestructorDecl *destructor) {
+ // C++11 [class.dtor]p3:
+ // A declaration of a destructor that does not have an exception-
+ // specification is implicitly considered to have the same exception-
+ // specification as an implicit declaration.
+ const FunctionProtoType *dtorType = destructor->getType()->
+ getAs<FunctionProtoType>();
+ if (dtorType->hasExceptionSpec())
+ return;
+
+ ImplicitExceptionSpecification exceptSpec =
+ ComputeDefaultedDtorExceptionSpec(classDecl);
+
+ // Replace the destructor's type.
+ FunctionProtoType::ExtProtoInfo epi;
+ epi.ExceptionSpecType = exceptSpec.getExceptionSpecType();
+ epi.NumExceptions = exceptSpec.size();
+ epi.Exceptions = exceptSpec.data();
+ QualType ty = Context.getFunctionType(Context.VoidTy, 0, 0, epi);
+
+ destructor->setType(ty);
+
+ // FIXME: If the destructor has a body that could throw, and the newly created
+ // spec doesn't allow exceptions, we should emit a warning, because this
+ // change in behavior can break conforming C++03 programs at runtime.
+ // However, we don't have a body yet, so it needs to be done somewhere else.
+}
+
/// \brief Builds a statement that copies the given entity from \p From to
/// \c To.
///
@@ -5530,13 +6739,9 @@ static bool hasConstCopyAssignment(Sema &S, const CXXRecordDecl *CClass) {
return false;
}
-CXXMethodDecl *Sema::DeclareImplicitCopyAssignment(CXXRecordDecl *ClassDecl) {
- // Note: The following rules are largely analoguous to the copy
- // constructor rules. Note that virtual bases are not taken into account
- // for determining the argument type of the operator. Note also that
- // operators taking an object instead of a reference are allowed.
-
-
+std::pair<Sema::ImplicitExceptionSpecification, bool>
+Sema::ComputeDefaultedCopyAssignmentExceptionSpecAndConst(
+ CXXRecordDecl *ClassDecl) {
// C++ [class.copy]p10:
// If the class definition does not explicitly declare a copy
// assignment operator, one is declared implicitly.
@@ -5581,11 +6786,6 @@ CXXMethodDecl *Sema::DeclareImplicitCopyAssignment(CXXRecordDecl *ClassDecl) {
// have the form
//
// X& X::operator=(X&)
- QualType ArgType = Context.getTypeDeclType(ClassDecl);
- QualType RetType = Context.getLValueReferenceType(ArgType);
- if (HasConstCopyAssignment)
- ArgType = ArgType.withConst();
- ArgType = Context.getLValueReferenceType(ArgType);
// C++ [except.spec]p14:
// An implicitly declared special member function (Clause 12) shall have an
@@ -5622,12 +6822,29 @@ CXXMethodDecl *Sema::DeclareImplicitCopyAssignment(CXXRecordDecl *ClassDecl) {
}
}
+ return std::make_pair(ExceptSpec, HasConstCopyAssignment);
+}
+
+CXXMethodDecl *Sema::DeclareImplicitCopyAssignment(CXXRecordDecl *ClassDecl) {
+ // Note: The following rules are largely analoguous to the copy
+ // constructor rules. Note that virtual bases are not taken into account
+ // for determining the argument type of the operator. Note also that
+ // operators taking an object instead of a reference are allowed.
+
+ ImplicitExceptionSpecification Spec(Context);
+ bool Const;
+ llvm::tie(Spec, Const) =
+ ComputeDefaultedCopyAssignmentExceptionSpecAndConst(ClassDecl);
+
+ QualType ArgType = Context.getTypeDeclType(ClassDecl);
+ QualType RetType = Context.getLValueReferenceType(ArgType);
+ if (Const)
+ ArgType = ArgType.withConst();
+ ArgType = Context.getLValueReferenceType(ArgType);
+
// An implicitly-declared copy assignment operator is an inline public
// member of its class.
- FunctionProtoType::ExtProtoInfo EPI;
- EPI.ExceptionSpecType = ExceptSpec.getExceptionSpecType();
- EPI.NumExceptions = ExceptSpec.size();
- EPI.Exceptions = ExceptSpec.data();
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
DeclarationName Name = Context.DeclarationNames.getCXXOperatorName(OO_Equal);
SourceLocation ClassLoc = ClassDecl->getLocation();
DeclarationNameInfo NameInfo(Name, ClassLoc);
@@ -5639,6 +6856,7 @@ CXXMethodDecl *Sema::DeclareImplicitCopyAssignment(CXXRecordDecl *ClassDecl) {
/*isInline=*/true,
SourceLocation());
CopyAssignment->setAccess(AS_public);
+ CopyAssignment->setDefaulted();
CopyAssignment->setImplicit();
CopyAssignment->setTrivial(ClassDecl->hasTrivialCopyAssignment());
@@ -5652,21 +6870,24 @@ CXXMethodDecl *Sema::DeclareImplicitCopyAssignment(CXXRecordDecl *ClassDecl) {
// Note that we have added this copy-assignment operator.
++ASTContext::NumImplicitCopyAssignmentOperatorsDeclared;
-
+
if (Scope *S = getScopeForContext(ClassDecl))
PushOnScopeChains(CopyAssignment, S, false);
ClassDecl->addDecl(CopyAssignment);
+ if (ShouldDeleteCopyAssignmentOperator(CopyAssignment))
+ CopyAssignment->setDeletedAsWritten();
+
AddOverriddenMethods(ClassDecl, CopyAssignment);
return CopyAssignment;
}
void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation,
CXXMethodDecl *CopyAssignOperator) {
- assert((CopyAssignOperator->isImplicit() &&
+ assert((CopyAssignOperator->isDefaulted() &&
CopyAssignOperator->isOverloadedOperator() &&
CopyAssignOperator->getOverloadedOperator() == OO_Equal &&
- !CopyAssignOperator->isUsed(false)) &&
+ !CopyAssignOperator->doesThisDeclarationHaveABody()) &&
"DefineImplicitCopyAssignment called for wrong function");
CXXRecordDecl *ClassDecl = CopyAssignOperator->getParent();
@@ -5956,12 +7177,8 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation,
}
}
-CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
- CXXRecordDecl *ClassDecl) {
- // C++ [class.copy]p4:
- // If the class definition does not explicitly declare a copy
- // constructor, one is declared implicitly.
-
+std::pair<Sema::ImplicitExceptionSpecification, bool>
+Sema::ComputeDefaultedCopyCtorExceptionSpecAndConst(CXXRecordDecl *ClassDecl) {
// C++ [class.copy]p5:
// The implicitly-declared copy constructor for a class X will
// have the form
@@ -5969,6 +7186,7 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
// X::X(const X&)
//
// if
+ // FIXME: It ought to be possible to store this on the record.
bool HasConstCopyConstructor = true;
// -- each direct or virtual base class B of X has a copy
@@ -5984,11 +7202,8 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
- if (!BaseClassDecl->hasDeclaredCopyConstructor())
- DeclareImplicitCopyConstructor(BaseClassDecl);
-
- HasConstCopyConstructor
- = BaseClassDecl->hasConstCopyConstructor(Context);
+ LookupCopyConstructor(BaseClassDecl, Qualifiers::Const,
+ &HasConstCopyConstructor);
}
for (CXXRecordDecl::base_class_iterator Base = ClassDecl->vbases_begin(),
@@ -5997,11 +7212,8 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
++Base) {
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
- if (!BaseClassDecl->hasDeclaredCopyConstructor())
- DeclareImplicitCopyConstructor(BaseClassDecl);
-
- HasConstCopyConstructor
- = BaseClassDecl->hasConstCopyConstructor(Context);
+ LookupCopyConstructor(BaseClassDecl, Qualifiers::Const,
+ &HasConstCopyConstructor);
}
// -- for all the nonstatic data members of X that are of a
@@ -6013,27 +7225,16 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
HasConstCopyConstructor && Field != FieldEnd;
++Field) {
QualType FieldType = Context.getBaseElementType((*Field)->getType());
- if (const RecordType *FieldClassType = FieldType->getAs<RecordType>()) {
- CXXRecordDecl *FieldClassDecl
- = cast<CXXRecordDecl>(FieldClassType->getDecl());
- if (!FieldClassDecl->hasDeclaredCopyConstructor())
- DeclareImplicitCopyConstructor(FieldClassDecl);
-
- HasConstCopyConstructor
- = FieldClassDecl->hasConstCopyConstructor(Context);
+ if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
+ LookupCopyConstructor(FieldClassDecl, Qualifiers::Const,
+ &HasConstCopyConstructor);
}
}
-
// Otherwise, the implicitly declared copy constructor will have
// the form
//
// X::X(X&)
- QualType ClassType = Context.getTypeDeclType(ClassDecl);
- QualType ArgType = ClassType;
- if (HasConstCopyConstructor)
- ArgType = ArgType.withConst();
- ArgType = Context.getLValueReferenceType(ArgType);
-
+
// C++ [except.spec]p14:
// An implicitly declared special member function (Clause 12) shall have an
// exception-specification. [...]
@@ -6049,11 +7250,8 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
- if (!BaseClassDecl->hasDeclaredCopyConstructor())
- DeclareImplicitCopyConstructor(BaseClassDecl);
-
- if (CXXConstructorDecl *CopyConstructor
- = BaseClassDecl->getCopyConstructor(Context, Quals))
+ if (CXXConstructorDecl *CopyConstructor =
+ LookupCopyConstructor(BaseClassDecl, Quals))
ExceptSpec.CalledDecl(CopyConstructor);
}
for (CXXRecordDecl::base_class_iterator Base = ClassDecl->vbases_begin(),
@@ -6062,11 +7260,8 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
++Base) {
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
- if (!BaseClassDecl->hasDeclaredCopyConstructor())
- DeclareImplicitCopyConstructor(BaseClassDecl);
-
- if (CXXConstructorDecl *CopyConstructor
- = BaseClassDecl->getCopyConstructor(Context, Quals))
+ if (CXXConstructorDecl *CopyConstructor =
+ LookupCopyConstructor(BaseClassDecl, Quals))
ExceptSpec.CalledDecl(CopyConstructor);
}
for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(),
@@ -6074,29 +7269,43 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
Field != FieldEnd;
++Field) {
QualType FieldType = Context.getBaseElementType((*Field)->getType());
- if (const RecordType *FieldClassType = FieldType->getAs<RecordType>()) {
- CXXRecordDecl *FieldClassDecl
- = cast<CXXRecordDecl>(FieldClassType->getDecl());
- if (!FieldClassDecl->hasDeclaredCopyConstructor())
- DeclareImplicitCopyConstructor(FieldClassDecl);
-
- if (CXXConstructorDecl *CopyConstructor
- = FieldClassDecl->getCopyConstructor(Context, Quals))
- ExceptSpec.CalledDecl(CopyConstructor);
+ if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
+ if (CXXConstructorDecl *CopyConstructor =
+ LookupCopyConstructor(FieldClassDecl, Quals))
+ ExceptSpec.CalledDecl(CopyConstructor);
}
}
- // An implicitly-declared copy constructor is an inline public
- // member of its class.
- FunctionProtoType::ExtProtoInfo EPI;
- EPI.ExceptionSpecType = ExceptSpec.getExceptionSpecType();
- EPI.NumExceptions = ExceptSpec.size();
- EPI.Exceptions = ExceptSpec.data();
+ return std::make_pair(ExceptSpec, HasConstCopyConstructor);
+}
+
+CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
+ CXXRecordDecl *ClassDecl) {
+ // C++ [class.copy]p4:
+ // If the class definition does not explicitly declare a copy
+ // constructor, one is declared implicitly.
+
+ ImplicitExceptionSpecification Spec(Context);
+ bool Const;
+ llvm::tie(Spec, Const) =
+ ComputeDefaultedCopyCtorExceptionSpecAndConst(ClassDecl);
+
+ QualType ClassType = Context.getTypeDeclType(ClassDecl);
+ QualType ArgType = ClassType;
+ if (Const)
+ ArgType = ArgType.withConst();
+ ArgType = Context.getLValueReferenceType(ArgType);
+
+ FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
+
DeclarationName Name
= Context.DeclarationNames.getCXXConstructorName(
Context.getCanonicalType(ClassType));
SourceLocation ClassLoc = ClassDecl->getLocation();
DeclarationNameInfo NameInfo(Name, ClassLoc);
+
+ // An implicitly-declared copy constructor is an inline public
+ // member of its class.
CXXConstructorDecl *CopyConstructor
= CXXConstructorDecl::Create(Context, ClassDecl, ClassLoc, NameInfo,
Context.getFunctionType(Context.VoidTy,
@@ -6106,6 +7315,7 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
/*isInline=*/true,
/*isImplicitlyDeclared=*/true);
CopyConstructor->setAccess(AS_public);
+ CopyConstructor->setDefaulted();
CopyConstructor->setTrivial(ClassDecl->hasTrivialCopyConstructor());
// Note that we have declared this constructor.
@@ -6119,19 +7329,22 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
SC_None,
SC_None, 0);
CopyConstructor->setParams(&FromParam, 1);
+
if (Scope *S = getScopeForContext(ClassDecl))
PushOnScopeChains(CopyConstructor, S, false);
ClassDecl->addDecl(CopyConstructor);
+
+ if (ShouldDeleteCopyConstructor(CopyConstructor))
+ CopyConstructor->setDeletedAsWritten();
return CopyConstructor;
}
void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
- CXXConstructorDecl *CopyConstructor,
- unsigned TypeQuals) {
- assert((CopyConstructor->isImplicit() &&
- CopyConstructor->isCopyConstructor(TypeQuals) &&
- !CopyConstructor->isUsed(false)) &&
+ CXXConstructorDecl *CopyConstructor) {
+ assert((CopyConstructor->isDefaulted() &&
+ CopyConstructor->isCopyConstructor() &&
+ !CopyConstructor->doesThisDeclarationHaveABody()) &&
"DefineImplicitCopyConstructor - call it for implicit copy ctor");
CXXRecordDecl *ClassDecl = CopyConstructor->getParent();
@@ -7138,7 +8351,7 @@ Decl *Sema::ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc,
bool Invalid = false;
if (TemplateParameterList *TemplateParams
- = MatchTemplateParametersToScopeSpecifier(TagLoc, SS,
+ = MatchTemplateParametersToScopeSpecifier(TagLoc, NameLoc, SS,
TempParamLists.get(),
TempParamLists.size(),
/*friend*/ true,
@@ -7554,7 +8767,83 @@ void Sema::SetDeclDeleted(Decl *Dcl, SourceLocation DelLoc) {
// If the declaration wasn't the first, we delete the function anyway for
// recovery.
}
- Fn->setDeleted();
+ Fn->setDeletedAsWritten();
+}
+
+void Sema::SetDeclDefaulted(Decl *Dcl, SourceLocation DefaultLoc) {
+ CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(Dcl);
+
+ if (MD) {
+ if (MD->getParent()->isDependentType()) {
+ MD->setDefaulted();
+ MD->setExplicitlyDefaulted();
+ return;
+ }
+
+ CXXSpecialMember Member = getSpecialMember(MD);
+ if (Member == CXXInvalid) {
+ Diag(DefaultLoc, diag::err_default_special_members);
+ return;
+ }
+
+ MD->setDefaulted();
+ MD->setExplicitlyDefaulted();
+
+ // If this definition appears within the record, do the checking when
+ // the record is complete.
+ const FunctionDecl *Primary = MD;
+ if (MD->getTemplatedKind() != FunctionDecl::TK_NonTemplate)
+ // Find the uninstantiated declaration that actually had the '= default'
+ // on it.
+ MD->getTemplateInstantiationPattern()->isDefined(Primary);
+
+ if (Primary == Primary->getCanonicalDecl())
+ return;
+
+ switch (Member) {
+ case CXXDefaultConstructor: {
+ CXXConstructorDecl *CD = cast<CXXConstructorDecl>(MD);
+ CheckExplicitlyDefaultedDefaultConstructor(CD);
+ if (!CD->isInvalidDecl())
+ DefineImplicitDefaultConstructor(DefaultLoc, CD);
+ break;
+ }
+
+ case CXXCopyConstructor: {
+ CXXConstructorDecl *CD = cast<CXXConstructorDecl>(MD);
+ CheckExplicitlyDefaultedCopyConstructor(CD);
+ if (!CD->isInvalidDecl())
+ DefineImplicitCopyConstructor(DefaultLoc, CD);
+ break;
+ }
+
+ case CXXCopyAssignment: {
+ CheckExplicitlyDefaultedCopyAssignment(MD);
+ if (!MD->isInvalidDecl())
+ DefineImplicitCopyAssignment(DefaultLoc, MD);
+ break;
+ }
+
+ case CXXDestructor: {
+ CXXDestructorDecl *DD = cast<CXXDestructorDecl>(MD);
+ CheckExplicitlyDefaultedDestructor(DD);
+ if (!DD->isInvalidDecl())
+ DefineImplicitDestructor(DefaultLoc, DD);
+ break;
+ }
+
+ case CXXMoveConstructor:
+ case CXXMoveAssignment:
+ Diag(Dcl->getLocation(), diag::err_defaulted_move_unsupported);
+ break;
+
+ default:
+ // FIXME: Do the rest once we have move functions
+ break;
+ }
+ } else {
+ Diag(DefaultLoc, diag::err_default_special_members);
+ }
}
static void SearchForReturnInStmt(Sema &Self, Stmt *S) {
@@ -7946,3 +9235,86 @@ void Sema::SetIvarInitializers(ObjCImplementationDecl *ObjCImplementation) {
AllToInit.data(), AllToInit.size());
}
}
+
+static
+void DelegatingCycleHelper(CXXConstructorDecl* Ctor,
+ llvm::SmallSet<CXXConstructorDecl*, 4> &Valid,
+ llvm::SmallSet<CXXConstructorDecl*, 4> &Invalid,
+ llvm::SmallSet<CXXConstructorDecl*, 4> &Current,
+ Sema &S) {
+ llvm::SmallSet<CXXConstructorDecl*, 4>::iterator CI = Current.begin(),
+ CE = Current.end();
+ if (Ctor->isInvalidDecl())
+ return;
+
+ const FunctionDecl *FNTarget = 0;
+ CXXConstructorDecl *Target;
+
+ // We ignore the result here since if we don't have a body, Target will be
+ // null below.
+ (void)Ctor->getTargetConstructor()->hasBody(FNTarget);
+ Target
+= const_cast<CXXConstructorDecl*>(cast_or_null<CXXConstructorDecl>(FNTarget));
+
+ CXXConstructorDecl *Canonical = Ctor->getCanonicalDecl(),
+ // Avoid dereferencing a null pointer here.
+ *TCanonical = Target ? Target->getCanonicalDecl() : 0;
+
+ if (!Current.insert(Canonical))
+ return;
+
+ // We know that beyond here, we aren't chaining into a cycle.
+ if (!Target || !Target->isDelegatingConstructor() ||
+ Target->isInvalidDecl() || Valid.count(TCanonical)) {
+ for (CI = Current.begin(), CE = Current.end(); CI != CE; ++CI)
+ Valid.insert(*CI);
+ Current.clear();
+ // We've hit a cycle.
+ } else if (TCanonical == Canonical || Invalid.count(TCanonical) ||
+ Current.count(TCanonical)) {
+ // If we haven't diagnosed this cycle yet, do so now.
+ if (!Invalid.count(TCanonical)) {
+ S.Diag((*Ctor->init_begin())->getSourceLocation(),
+ diag::warn_delegating_ctor_cycle)
+ << Ctor;
+
+ // Don't add a note for a function delegating directo to itself.
+ if (TCanonical != Canonical)
+ S.Diag(Target->getLocation(), diag::note_it_delegates_to);
+
+ CXXConstructorDecl *C = Target;
+ while (C->getCanonicalDecl() != Canonical) {
+ (void)C->getTargetConstructor()->hasBody(FNTarget);
+ assert(FNTarget && "Ctor cycle through bodiless function");
+
+ C
+ = const_cast<CXXConstructorDecl*>(cast<CXXConstructorDecl>(FNTarget));
+ S.Diag(C->getLocation(), diag::note_which_delegates_to);
+ }
+ }
+
+ for (CI = Current.begin(), CE = Current.end(); CI != CE; ++CI)
+ Invalid.insert(*CI);
+ Current.clear();
+ } else {
+ DelegatingCycleHelper(Target, Valid, Invalid, Current, S);
+ }
+}
+
+
+void Sema::CheckDelegatingCtorCycles() {
+ llvm::SmallSet<CXXConstructorDecl*, 4> Valid, Invalid, Current;
+
+ llvm::SmallSet<CXXConstructorDecl*, 4>::iterator CI = Current.begin(),
+ CE = Current.end();
+
+ for (llvm::SmallVector<CXXConstructorDecl*, 4>::iterator
+ I = DelegatingCtorDecls.begin(),
+ E = DelegatingCtorDecls.end();
+ I != E; ++I) {
+ DelegatingCycleHelper(*I, Valid, Invalid, Current, *this);
+ }
+
+ for (CI = Invalid.begin(), CE = Invalid.end(); CI != CE; ++CI)
+ (*CI)->setInvalidDecl();
+}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp
index 7b235ba..de9097e 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp
@@ -24,6 +24,141 @@
using namespace clang;
+bool Sema::CheckObjCMethodOverride(ObjCMethodDecl *NewMethod,
+ const ObjCMethodDecl *Overridden,
+ bool IsImplementation) {
+ if (Overridden->hasRelatedResultType() &&
+ !NewMethod->hasRelatedResultType()) {
+ // This can only happen when the method follows a naming convention that
+ // implies a related result type, and the original (overridden) method has
+ // a suitable return type, but the new (overriding) method does not have
+ // a suitable return type.
+ QualType ResultType = NewMethod->getResultType();
+ SourceRange ResultTypeRange;
+ if (const TypeSourceInfo *ResultTypeInfo
+ = NewMethod->getResultTypeSourceInfo())
+ ResultTypeRange = ResultTypeInfo->getTypeLoc().getSourceRange();
+
+ // Figure out which class this method is part of, if any.
+ ObjCInterfaceDecl *CurrentClass
+ = dyn_cast<ObjCInterfaceDecl>(NewMethod->getDeclContext());
+ if (!CurrentClass) {
+ DeclContext *DC = NewMethod->getDeclContext();
+ if (ObjCCategoryDecl *Cat = dyn_cast<ObjCCategoryDecl>(DC))
+ CurrentClass = Cat->getClassInterface();
+ else if (ObjCImplDecl *Impl = dyn_cast<ObjCImplDecl>(DC))
+ CurrentClass = Impl->getClassInterface();
+ else if (ObjCCategoryImplDecl *CatImpl
+ = dyn_cast<ObjCCategoryImplDecl>(DC))
+ CurrentClass = CatImpl->getClassInterface();
+ }
+
+ if (CurrentClass) {
+ Diag(NewMethod->getLocation(),
+ diag::warn_related_result_type_compatibility_class)
+ << Context.getObjCInterfaceType(CurrentClass)
+ << ResultType
+ << ResultTypeRange;
+ } else {
+ Diag(NewMethod->getLocation(),
+ diag::warn_related_result_type_compatibility_protocol)
+ << ResultType
+ << ResultTypeRange;
+ }
+
+ Diag(Overridden->getLocation(), diag::note_related_result_type_overridden)
+ << Overridden->getMethodFamily();
+ }
+
+ return false;
+}
+
+
+static bool CheckObjCMethodOverrides(Sema &S, ObjCMethodDecl *NewMethod,
+ DeclContext *DC,
+ bool SkipCurrent = true) {
+ if (!DC)
+ return false;
+
+ if (!SkipCurrent) {
+ // Look for this method. If we find it, we're done.
+ Selector Sel = NewMethod->getSelector();
+ bool IsInstance = NewMethod->isInstanceMethod();
+ DeclContext::lookup_const_iterator Meth, MethEnd;
+ for (llvm::tie(Meth, MethEnd) = DC->lookup(Sel); Meth != MethEnd; ++Meth) {
+ ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(*Meth);
+ if (MD && MD->isInstanceMethod() == IsInstance)
+ return S.CheckObjCMethodOverride(NewMethod, MD, false);
+ }
+ }
+
+ if (ObjCInterfaceDecl *Class = llvm::dyn_cast<ObjCInterfaceDecl>(DC)) {
+ // Look through categories.
+ for (ObjCCategoryDecl *Category = Class->getCategoryList();
+ Category; Category = Category->getNextClassCategory()) {
+ if (CheckObjCMethodOverrides(S, NewMethod, Category, false))
+ return true;
+ }
+
+ // Look through protocols.
+ for (ObjCList<ObjCProtocolDecl>::iterator I = Class->protocol_begin(),
+ IEnd = Class->protocol_end();
+ I != IEnd; ++I)
+ if (CheckObjCMethodOverrides(S, NewMethod, *I, false))
+ return true;
+
+ // Look in our superclass.
+ return CheckObjCMethodOverrides(S, NewMethod, Class->getSuperClass(),
+ false);
+ }
+
+ if (ObjCCategoryDecl *Category = dyn_cast<ObjCCategoryDecl>(DC)) {
+ // Look through protocols.
+ for (ObjCList<ObjCProtocolDecl>::iterator I = Category->protocol_begin(),
+ IEnd = Category->protocol_end();
+ I != IEnd; ++I)
+ if (CheckObjCMethodOverrides(S, NewMethod, *I, false))
+ return true;
+
+ return false;
+ }
+
+ if (ObjCProtocolDecl *Protocol = dyn_cast<ObjCProtocolDecl>(DC)) {
+ // Look through protocols.
+ for (ObjCList<ObjCProtocolDecl>::iterator I = Protocol->protocol_begin(),
+ IEnd = Protocol->protocol_end();
+ I != IEnd; ++I)
+ if (CheckObjCMethodOverrides(S, NewMethod, *I, false))
+ return true;
+
+ return false;
+ }
+
+ return false;
+}
+
+bool Sema::CheckObjCMethodOverrides(ObjCMethodDecl *NewMethod,
+ DeclContext *DC) {
+ if (ObjCInterfaceDecl *Class = dyn_cast<ObjCInterfaceDecl>(DC))
+ return ::CheckObjCMethodOverrides(*this, NewMethod, Class);
+
+ if (ObjCCategoryDecl *Category = dyn_cast<ObjCCategoryDecl>(DC))
+ return ::CheckObjCMethodOverrides(*this, NewMethod, Category);
+
+ if (ObjCProtocolDecl *Protocol = dyn_cast<ObjCProtocolDecl>(DC))
+ return ::CheckObjCMethodOverrides(*this, NewMethod, Protocol);
+
+ if (ObjCImplementationDecl *Impl = dyn_cast<ObjCImplementationDecl>(DC))
+ return ::CheckObjCMethodOverrides(*this, NewMethod,
+ Impl->getClassInterface());
+
+ if (ObjCCategoryImplDecl *CatImpl = dyn_cast<ObjCCategoryImplDecl>(DC))
+ return ::CheckObjCMethodOverrides(*this, NewMethod,
+ CatImpl->getClassInterface());
+
+ return ::CheckObjCMethodOverrides(*this, NewMethod, CurContext);
+}
+
static void DiagnoseObjCImplementedDeprecations(Sema &S,
NamedDecl *ND,
SourceLocation ImplLoc,
@@ -272,23 +407,27 @@ Decl *Sema::ActOnCompatiblityAlias(SourceLocation AtLoc,
return AliasDecl;
}
-void Sema::CheckForwardProtocolDeclarationForCircularDependency(
+bool Sema::CheckForwardProtocolDeclarationForCircularDependency(
IdentifierInfo *PName,
SourceLocation &Ploc, SourceLocation PrevLoc,
const ObjCList<ObjCProtocolDecl> &PList) {
+
+ bool res = false;
for (ObjCList<ObjCProtocolDecl>::iterator I = PList.begin(),
E = PList.end(); I != E; ++I) {
-
if (ObjCProtocolDecl *PDecl = LookupProtocol((*I)->getIdentifier(),
Ploc)) {
if (PDecl->getIdentifier() == PName) {
Diag(Ploc, diag::err_protocol_has_circular_dependency);
Diag(PrevLoc, diag::note_previous_definition);
+ res = true;
}
- CheckForwardProtocolDeclarationForCircularDependency(PName, Ploc,
- PDecl->getLocation(), PDecl->getReferencedProtocols());
+ if (CheckForwardProtocolDeclarationForCircularDependency(PName, Ploc,
+ PDecl->getLocation(), PDecl->getReferencedProtocols()))
+ res = true;
}
}
+ return res;
}
Decl *
@@ -300,6 +439,7 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc,
const SourceLocation *ProtoLocs,
SourceLocation EndProtoLoc,
AttributeList *AttrList) {
+ bool err = false;
// FIXME: Deal with AttrList.
assert(ProtocolName && "Missing protocol identifier");
ObjCProtocolDecl *PDecl = LookupProtocol(ProtocolName, ProtocolLoc);
@@ -314,8 +454,8 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc,
}
ObjCList<ObjCProtocolDecl> PList;
PList.set((ObjCProtocolDecl *const*)ProtoRefs, NumProtoRefs, Context);
- CheckForwardProtocolDeclarationForCircularDependency(
- ProtocolName, ProtocolLoc, PDecl->getLocation(), PList);
+ err = CheckForwardProtocolDeclarationForCircularDependency(
+ ProtocolName, ProtocolLoc, PDecl->getLocation(), PList);
// Make sure the cached decl gets a valid start location.
PDecl->setLocation(AtProtoInterfaceLoc);
@@ -331,7 +471,7 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc,
}
if (AttrList)
ProcessDeclAttributeList(TUScope, PDecl, AttrList);
- if (NumProtoRefs) {
+ if (!err && NumProtoRefs ) {
/// Check then save referenced protocols.
PDecl->setProtocolList((ObjCProtocolDecl**)ProtoRefs, NumProtoRefs,
ProtoLocs, Context);
@@ -1712,11 +1852,71 @@ bool containsInvalidMethodImplAttribute(const AttrVec &A) {
return false;
}
+/// \brief Check whether the declared result type of the given Objective-C
+/// method declaration is compatible with the method's class.
+///
+static bool
+CheckRelatedResultTypeCompatibility(Sema &S, ObjCMethodDecl *Method,
+ ObjCInterfaceDecl *CurrentClass) {
+ QualType ResultType = Method->getResultType();
+ SourceRange ResultTypeRange;
+ if (const TypeSourceInfo *ResultTypeInfo = Method->getResultTypeSourceInfo())
+ ResultTypeRange = ResultTypeInfo->getTypeLoc().getSourceRange();
+
+ // If an Objective-C method inherits its related result type, then its
+ // declared result type must be compatible with its own class type. The
+ // declared result type is compatible if:
+ if (const ObjCObjectPointerType *ResultObjectType
+ = ResultType->getAs<ObjCObjectPointerType>()) {
+ // - it is id or qualified id, or
+ if (ResultObjectType->isObjCIdType() ||
+ ResultObjectType->isObjCQualifiedIdType())
+ return false;
+
+ if (CurrentClass) {
+ if (ObjCInterfaceDecl *ResultClass
+ = ResultObjectType->getInterfaceDecl()) {
+ // - it is the same as the method's class type, or
+ if (CurrentClass == ResultClass)
+ return false;
+
+ // - it is a superclass of the method's class type
+ if (ResultClass->isSuperClassOf(CurrentClass))
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+/// \brief Determine if any method in the global method pool has an inferred
+/// result type.
+static bool
+anyMethodInfersRelatedResultType(Sema &S, Selector Sel, bool IsInstance) {
+ Sema::GlobalMethodPool::iterator Pos = S.MethodPool.find(Sel);
+ if (Pos == S.MethodPool.end()) {
+ if (S.ExternalSource)
+ Pos = S.ReadMethodPool(Sel);
+ else
+ return 0;
+ }
+
+ ObjCMethodList &List = IsInstance ? Pos->second.first : Pos->second.second;
+ for (ObjCMethodList *M = &List; M; M = M->Next) {
+ if (M->Method && M->Method->hasRelatedResultType())
+ return true;
+ }
+
+ return false;
+}
+
Decl *Sema::ActOnMethodDeclaration(
Scope *S,
SourceLocation MethodLoc, SourceLocation EndLoc,
tok::TokenKind MethodType, Decl *ClassDecl,
ObjCDeclSpec &ReturnQT, ParsedType ReturnType,
+ SourceLocation SelectorStartLoc,
Selector Sel,
// optional arguments. The number of types/arguments is obtained
// from the Sel.getNumArgs().
@@ -1741,7 +1941,7 @@ Decl *Sema::ActOnMethodDeclaration(
Diag(MethodLoc, diag::err_object_cannot_be_passed_returned_by_value)
<< 0 << resultDeclType;
return 0;
- }
+ }
} else // get the type for "id".
resultDeclType = Context.getObjCIdType();
@@ -1751,9 +1951,10 @@ Decl *Sema::ActOnMethodDeclaration(
cast<DeclContext>(ClassDecl),
MethodType == tok::minus, isVariadic,
false, false,
- MethodDeclKind == tok::objc_optional ?
- ObjCMethodDecl::Optional :
- ObjCMethodDecl::Required);
+ MethodDeclKind == tok::objc_optional
+ ? ObjCMethodDecl::Optional
+ : ObjCMethodDecl::Required,
+ false);
llvm::SmallVector<ParmVarDecl*, 16> Params;
@@ -1849,6 +2050,7 @@ Decl *Sema::ActOnMethodDeclaration(
}
InterfaceMD = ImpDecl->getClassInterface()->getMethod(Sel,
MethodType == tok::minus);
+
if (ObjCMethod->hasAttrs() &&
containsInvalidMethodImplAttribute(ObjCMethod->getAttrs()))
Diag(EndLoc, diag::warn_attribute_method_def);
@@ -1861,6 +2063,10 @@ Decl *Sema::ActOnMethodDeclaration(
PrevMethod = CatImpDecl->getClassMethod(Sel);
CatImpDecl->addClassMethod(ObjCMethod);
}
+
+ if (ObjCCategoryDecl *Cat = CatImpDecl->getCategoryDecl())
+ InterfaceMD = Cat->getMethod(Sel, MethodType == tok::minus);
+
if (ObjCMethod->hasAttrs() &&
containsInvalidMethodImplAttribute(ObjCMethod->getAttrs()))
Diag(EndLoc, diag::warn_attribute_method_def);
@@ -1874,10 +2080,65 @@ Decl *Sema::ActOnMethodDeclaration(
Diag(PrevMethod->getLocation(), diag::note_previous_declaration);
}
+ // If this Objective-C method does not have a related result type, but we
+ // are allowed to infer related result types, try to do so based on the
+ // method family.
+ ObjCInterfaceDecl *CurrentClass = dyn_cast<ObjCInterfaceDecl>(ClassDecl);
+ if (!CurrentClass) {
+ if (ObjCCategoryDecl *Cat = dyn_cast<ObjCCategoryDecl>(ClassDecl))
+ CurrentClass = Cat->getClassInterface();
+ else if (ObjCImplDecl *Impl = dyn_cast<ObjCImplDecl>(ClassDecl))
+ CurrentClass = Impl->getClassInterface();
+ else if (ObjCCategoryImplDecl *CatImpl
+ = dyn_cast<ObjCCategoryImplDecl>(ClassDecl))
+ CurrentClass = CatImpl->getClassInterface();
+ }
+
// Merge information down from the interface declaration if we have one.
- if (InterfaceMD)
+ if (InterfaceMD) {
+ // Inherit the related result type, if we can.
+ if (InterfaceMD->hasRelatedResultType() &&
+ !CheckRelatedResultTypeCompatibility(*this, ObjCMethod, CurrentClass))
+ ObjCMethod->SetRelatedResultType();
+
mergeObjCMethodDecls(ObjCMethod, InterfaceMD);
-
+ }
+
+ if (!ObjCMethod->hasRelatedResultType() &&
+ getLangOptions().ObjCInferRelatedResultType) {
+ bool InferRelatedResultType = false;
+ switch (ObjCMethod->getMethodFamily()) {
+ case OMF_None:
+ case OMF_copy:
+ case OMF_dealloc:
+ case OMF_mutableCopy:
+ case OMF_release:
+ case OMF_retainCount:
+ break;
+
+ case OMF_alloc:
+ case OMF_new:
+ InferRelatedResultType = ObjCMethod->isClassMethod();
+ break;
+
+ case OMF_init:
+ case OMF_autorelease:
+ case OMF_retain:
+ case OMF_self:
+ InferRelatedResultType = ObjCMethod->isInstanceMethod();
+ break;
+ }
+
+ if (InferRelatedResultType &&
+ !CheckRelatedResultTypeCompatibility(*this, ObjCMethod, CurrentClass))
+ ObjCMethod->SetRelatedResultType();
+
+ if (!InterfaceMD &&
+ anyMethodInfersRelatedResultType(*this, ObjCMethod->getSelector(),
+ ObjCMethod->isInstanceMethod()))
+ CheckObjCMethodOverrides(ObjCMethod, cast<DeclContext>(ClassDecl));
+ }
+
return ObjCMethod;
}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp
index f1033dc..7bcec31 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp
@@ -298,8 +298,6 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID,
// - both are non-throwing, regardless of their form,
// - both have the form noexcept(constant-expression) and the constant-
// expressions are equivalent,
- // - one exception-specification is a noexcept-specification allowing all
- // exceptions and the other is of the form throw(type-id-list), or
// - both are dynamic-exception-specifications that have the same set of
// adjusted types.
//
@@ -307,8 +305,6 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID,
// of the form throw(), noexcept, or noexcept(constant-expression) where the
// constant-expression yields true.
//
- // CWG 1073 Proposed resolution: Strike the third bullet above.
- //
// C++0x [except.spec]p4: If any declaration of a function has an exception-
// specifier that is not a noexcept-specification allowing all exceptions,
// all declarations [...] of that function shall have a compatible
@@ -320,6 +316,9 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID,
ExceptionSpecificationType OldEST = Old->getExceptionSpecType();
ExceptionSpecificationType NewEST = New->getExceptionSpecType();
+ assert(OldEST != EST_Delayed && NewEST != EST_Delayed &&
+ "Shouldn't see unknown exception specifications here");
+
// Shortcut the case where both have no spec.
if (OldEST == EST_None && NewEST == EST_None)
return false;
@@ -506,6 +505,9 @@ bool Sema::CheckExceptionSpecSubset(
ExceptionSpecificationType SubEST = Subset->getExceptionSpecType();
+ assert(SuperEST != EST_Delayed && SubEST != EST_Delayed &&
+ "Shouldn't see unknown exception specifications here");
+
// It does not. If the subset contains everything, we've failed.
if (SubEST == EST_None || SubEST == EST_MSAny) {
Diag(SubLoc, DiagID);
@@ -701,7 +703,23 @@ bool Sema::CheckExceptionSpecCompatibility(Expr *From, QualType ToType)
bool Sema::CheckOverridingFunctionExceptionSpec(const CXXMethodDecl *New,
const CXXMethodDecl *Old) {
- return CheckExceptionSpecSubset(PDiag(diag::err_override_exception_spec),
+ if (getLangOptions().CPlusPlus0x && isa<CXXDestructorDecl>(New)) {
+ // Don't check uninstantiated template destructors at all. We can only
+ // synthesize correct specs after the template is instantiated.
+ if (New->getParent()->isDependentType())
+ return false;
+ if (New->getParent()->isBeingDefined()) {
+ // The destructor might be updated once the definition is finished. So
+ // remember it and check later.
+ DelayedDestructorExceptionSpecChecks.push_back(std::make_pair(
+ cast<CXXDestructorDecl>(New), cast<CXXDestructorDecl>(Old)));
+ return false;
+ }
+ }
+ unsigned DiagID = diag::err_override_exception_spec;
+ if (getLangOptions().Microsoft)
+ DiagID = diag::warn_override_exception_spec;
+ return CheckExceptionSpecSubset(PDiag(DiagID),
PDiag(diag::note_overridden_virtual_function),
Old->getType()->getAs<FunctionProtoType>(),
Old->getLocation(),
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
index 20b92b8..0549e94 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
@@ -449,18 +449,58 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT,
if (FDecl && FDecl->getBuiltinID() == Builtin::BI__builtin_va_start)
return Owned(E);
+ // Don't allow one to pass an Objective-C interface to a vararg.
if (E->getType()->isObjCObjectType() &&
- DiagRuntimeBehavior(E->getLocStart(), 0,
- PDiag(diag::err_cannot_pass_objc_interface_to_vararg)
- << E->getType() << CT))
+ DiagRuntimeBehavior(E->getLocStart(), 0,
+ PDiag(diag::err_cannot_pass_objc_interface_to_vararg)
+ << E->getType() << CT))
return ExprError();
-
- if (!E->getType()->isPODType() &&
- DiagRuntimeBehavior(E->getLocStart(), 0,
+
+ if (!E->getType()->isPODType()) {
+ // C++0x [expr.call]p7:
+ // Passing a potentially-evaluated argument of class type (Clause 9)
+ // having a non-trivial copy constructor, a non-trivial move constructor,
+ // or a non-trivial destructor, with no corresponding parameter,
+ // is conditionally-supported with implementation-defined semantics.
+ bool TrivialEnough = false;
+ if (getLangOptions().CPlusPlus0x && !E->getType()->isDependentType()) {
+ if (CXXRecordDecl *Record = E->getType()->getAsCXXRecordDecl()) {
+ if (Record->hasTrivialCopyConstructor() &&
+ Record->hasTrivialMoveConstructor() &&
+ Record->hasTrivialDestructor())
+ TrivialEnough = true;
+ }
+ }
+
+ if (TrivialEnough) {
+ // Nothing to diagnose. This is okay.
+ } else if (DiagRuntimeBehavior(E->getLocStart(), 0,
PDiag(diag::warn_cannot_pass_non_pod_arg_to_vararg)
- << E->getType() << CT))
- return ExprError();
+ << getLangOptions().CPlusPlus0x << E->getType()
+ << CT)) {
+ // Turn this into a trap.
+ CXXScopeSpec SS;
+ UnqualifiedId Name;
+ Name.setIdentifier(PP.getIdentifierInfo("__builtin_trap"),
+ E->getLocStart());
+ ExprResult TrapFn = ActOnIdExpression(TUScope, SS, Name, true, false);
+ if (TrapFn.isInvalid())
+ return ExprError();
+ ExprResult Call = ActOnCallExpr(TUScope, TrapFn.get(), E->getLocStart(),
+ MultiExprArg(), E->getLocEnd());
+ if (Call.isInvalid())
+ return ExprError();
+
+ ExprResult Comma = ActOnBinOp(TUScope, E->getLocStart(), tok::comma,
+ Call.get(), E);
+ if (Comma.isInvalid())
+ return ExprError();
+
+ E = Comma.get();
+ }
+ }
+
return Owned(E);
}
@@ -1293,8 +1333,8 @@ Sema::BuildAnonymousStructUnionMemberReference(const CXXScopeSpec &SS,
// We've found a member of an anonymous struct/union that is
// inside a non-anonymous struct/union, so in a well-formed
// program our base object expression is "this".
- CXXMethodDecl *method = tryCaptureCXXThis();
- if (!method) {
+ QualType ThisTy = getAndCaptureCurrentThisType();
+ if (ThisTy.isNull()) {
Diag(loc, diag::err_invalid_member_use_in_static_method)
<< indirectField->getDeclName();
return ExprError();
@@ -1302,10 +1342,9 @@ Sema::BuildAnonymousStructUnionMemberReference(const CXXScopeSpec &SS,
// Our base object expression is "this".
baseObjectExpr =
- new (Context) CXXThisExpr(loc, method->getThisType(Context),
- /*isImplicit=*/ true);
+ new (Context) CXXThisExpr(loc, ThisTy, /*isImplicit=*/ true);
baseObjectIsPointer = true;
- baseQuals = Qualifiers::fromCVRMask(method->getTypeQualifiers());
+ baseQuals = ThisTy->castAs<PointerType>()->getPointeeType().getQualifiers();
}
// Build the implicit member references to the field of the
@@ -1452,14 +1491,23 @@ enum IMAKind {
/// conservatively answer "yes", in which case some errors will simply
/// not be caught until template-instantiation.
static IMAKind ClassifyImplicitMemberAccess(Sema &SemaRef,
+ Scope *CurScope,
const LookupResult &R) {
assert(!R.empty() && (*R.begin())->isCXXClassMember());
DeclContext *DC = SemaRef.getFunctionLevelDeclContext();
+
bool isStaticContext =
(!isa<CXXMethodDecl>(DC) ||
cast<CXXMethodDecl>(DC)->isStatic());
+ // C++0x [expr.prim]p4:
+ // Otherwise, if a member-declarator declares a non-static data member
+ // of a class X, the expression this is a prvalue of type "pointer to X"
+ // within the optional brace-or-equal-initializer.
+ if (CurScope->getFlags() & Scope::ThisScope)
+ isStaticContext = false;
+
if (R.isUnresolvableResult())
return isStaticContext ? IMA_Unresolved_StaticContext : IMA_Unresolved;
@@ -1507,8 +1555,11 @@ static IMAKind ClassifyImplicitMemberAccess(Sema &SemaRef,
return IMA_Error_StaticContext;
}
- CXXRecordDecl *
- contextClass = cast<CXXMethodDecl>(DC)->getParent()->getCanonicalDecl();
+ CXXRecordDecl *contextClass;
+ if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(DC))
+ contextClass = MD->getParent()->getCanonicalDecl();
+ else
+ contextClass = cast<CXXRecordDecl>(DC);
// [class.mfct.non-static]p3:
// ...is used in the body of a non-static member function of class X,
@@ -1986,7 +2037,7 @@ ExprResult
Sema::BuildPossibleImplicitMemberExpr(const CXXScopeSpec &SS,
LookupResult &R,
const TemplateArgumentListInfo *TemplateArgs) {
- switch (ClassifyImplicitMemberAccess(*this, R)) {
+ switch (ClassifyImplicitMemberAccess(*this, CurScope, R)) {
case IMA_Instance:
return BuildImplicitMemberExpr(SS, R, TemplateArgs, true);
@@ -2429,19 +2480,18 @@ Sema::BuildImplicitMemberExpr(const CXXScopeSpec &SS,
// If this is known to be an instance access, go ahead and build an
// implicit 'this' expression now.
// 'this' expression now.
- CXXMethodDecl *method = tryCaptureCXXThis();
- assert(method && "didn't correctly pre-flight capture of 'this'");
+ QualType ThisTy = getAndCaptureCurrentThisType();
+ assert(!ThisTy.isNull() && "didn't correctly pre-flight capture of 'this'");
- QualType thisType = method->getThisType(Context);
Expr *baseExpr = 0; // null signifies implicit access
if (IsKnownInstance) {
SourceLocation Loc = R.getNameLoc();
if (SS.getRange().isValid())
Loc = SS.getRange().getBegin();
- baseExpr = new (Context) CXXThisExpr(loc, thisType, /*isImplicit=*/true);
+ baseExpr = new (Context) CXXThisExpr(loc, ThisTy, /*isImplicit=*/true);
}
- return BuildMemberReferenceExpr(baseExpr, thisType,
+ return BuildMemberReferenceExpr(baseExpr, ThisTy,
/*OpLoc*/ SourceLocation(),
/*IsArrow*/ true,
SS,
@@ -3014,8 +3064,120 @@ ExprResult Sema::ActOnParenExpr(SourceLocation L,
return Owned(new (Context) ParenExpr(L, R, E));
}
+static bool CheckVecStepTraitOperandType(Sema &S, QualType T,
+ SourceLocation Loc,
+ SourceRange ArgRange) {
+ // [OpenCL 1.1 6.11.12] "The vec_step built-in function takes a built-in
+ // scalar or vector data type argument..."
+ // Every built-in scalar type (OpenCL 1.1 6.1.1) is either an arithmetic
+ // type (C99 6.2.5p18) or void.
+ if (!(T->isArithmeticType() || T->isVoidType() || T->isVectorType())) {
+ S.Diag(Loc, diag::err_vecstep_non_scalar_vector_type)
+ << T << ArgRange;
+ return true;
+ }
+
+ assert((T->isVoidType() || !T->isIncompleteType()) &&
+ "Scalar types should always be complete");
+ return false;
+}
+
+static bool CheckExtensionTraitOperandType(Sema &S, QualType T,
+ SourceLocation Loc,
+ SourceRange ArgRange,
+ UnaryExprOrTypeTrait TraitKind) {
+ // C99 6.5.3.4p1:
+ if (T->isFunctionType()) {
+ // alignof(function) is allowed as an extension.
+ if (TraitKind == UETT_SizeOf)
+ S.Diag(Loc, diag::ext_sizeof_function_type) << ArgRange;
+ return false;
+ }
+
+ // Allow sizeof(void)/alignof(void) as an extension.
+ if (T->isVoidType()) {
+ S.Diag(Loc, diag::ext_sizeof_void_type) << TraitKind << ArgRange;
+ return false;
+ }
+
+ return true;
+}
+
+static bool CheckObjCTraitOperandConstraints(Sema &S, QualType T,
+ SourceLocation Loc,
+ SourceRange ArgRange,
+ UnaryExprOrTypeTrait TraitKind) {
+ // Reject sizeof(interface) and sizeof(interface<proto>) in 64-bit mode.
+ if (S.LangOpts.ObjCNonFragileABI && T->isObjCObjectType()) {
+ S.Diag(Loc, diag::err_sizeof_nonfragile_interface)
+ << T << (TraitKind == UETT_SizeOf)
+ << ArgRange;
+ return true;
+ }
+
+ return false;
+}
+
+/// \brief Check the constrains on expression operands to unary type expression
+/// and type traits.
+///
+/// Completes any types necessary and validates the constraints on the operand
+/// expression. The logic mostly mirrors the type-based overload, but may modify
+/// the expression as it completes the type for that expression through template
+/// instantiation, etc.
+bool Sema::CheckUnaryExprOrTypeTraitOperand(Expr *Op,
+ UnaryExprOrTypeTrait ExprKind) {
+ QualType ExprTy = Op->getType();
+
+ // C++ [expr.sizeof]p2: "When applied to a reference or a reference type,
+ // the result is the size of the referenced type."
+ // C++ [expr.alignof]p3: "When alignof is applied to a reference type, the
+ // result shall be the alignment of the referenced type."
+ if (const ReferenceType *Ref = ExprTy->getAs<ReferenceType>())
+ ExprTy = Ref->getPointeeType();
+
+ if (ExprKind == UETT_VecStep)
+ return CheckVecStepTraitOperandType(*this, ExprTy, Op->getExprLoc(),
+ Op->getSourceRange());
+
+ // Whitelist some types as extensions
+ if (!CheckExtensionTraitOperandType(*this, ExprTy, Op->getExprLoc(),
+ Op->getSourceRange(), ExprKind))
+ return false;
+
+ if (RequireCompleteExprType(Op,
+ PDiag(diag::err_sizeof_alignof_incomplete_type)
+ << ExprKind << Op->getSourceRange(),
+ std::make_pair(SourceLocation(), PDiag(0))))
+ return true;
+
+ // Completeing the expression's type may have changed it.
+ ExprTy = Op->getType();
+ if (const ReferenceType *Ref = ExprTy->getAs<ReferenceType>())
+ ExprTy = Ref->getPointeeType();
+
+ if (CheckObjCTraitOperandConstraints(*this, ExprTy, Op->getExprLoc(),
+ Op->getSourceRange(), ExprKind))
+ return true;
+
+ return false;
+}
+
+/// \brief Check the constraints on operands to unary expression and type
+/// traits.
+///
+/// This will complete any types necessary, and validate the various constraints
+/// on those operands.
+///
/// The UsualUnaryConversions() function is *not* called by this routine.
-/// See C99 6.3.2.1p[2-4] for more details.
+/// C99 6.3.2.1p[2-4] all state:
+/// Except when it is the operand of the sizeof operator ...
+///
+/// C++ [expr.sizeof]p4
+/// The lvalue-to-rvalue, array-to-pointer, and function-to-pointer
+/// standard conversions are not applied to the operand of sizeof.
+///
+/// This policy is followed for all of the unary trait expressions.
bool Sema::CheckUnaryExprOrTypeTraitOperand(QualType exprType,
SourceLocation OpLoc,
SourceRange ExprRange,
@@ -3030,55 +3192,27 @@ bool Sema::CheckUnaryExprOrTypeTraitOperand(QualType exprType,
if (const ReferenceType *Ref = exprType->getAs<ReferenceType>())
exprType = Ref->getPointeeType();
- // [OpenCL 1.1 6.11.12] "The vec_step built-in function takes a built-in
- // scalar or vector data type argument..."
- // Every built-in scalar type (OpenCL 1.1 6.1.1) is either an arithmetic
- // type (C99 6.2.5p18) or void.
- if (ExprKind == UETT_VecStep) {
- if (!(exprType->isArithmeticType() || exprType->isVoidType() ||
- exprType->isVectorType())) {
- Diag(OpLoc, diag::err_vecstep_non_scalar_vector_type)
- << exprType << ExprRange;
- return true;
- }
- }
+ if (ExprKind == UETT_VecStep)
+ return CheckVecStepTraitOperandType(*this, exprType, OpLoc, ExprRange);
- // C99 6.5.3.4p1:
- if (exprType->isFunctionType()) {
- // alignof(function) is allowed as an extension.
- if (ExprKind == UETT_SizeOf)
- Diag(OpLoc, diag::ext_sizeof_function_type)
- << ExprRange;
+ // Whitelist some types as extensions
+ if (!CheckExtensionTraitOperandType(*this, exprType, OpLoc, ExprRange,
+ ExprKind))
return false;
- }
-
- // Allow sizeof(void)/alignof(void) as an extension. vec_step(void) is not
- // an extension, as void is a built-in scalar type (OpenCL 1.1 6.1.1).
- if (exprType->isVoidType()) {
- if (ExprKind != UETT_VecStep)
- Diag(OpLoc, diag::ext_sizeof_void_type)
- << ExprKind << ExprRange;
- return false;
- }
if (RequireCompleteType(OpLoc, exprType,
PDiag(diag::err_sizeof_alignof_incomplete_type)
<< ExprKind << ExprRange))
return true;
- // Reject sizeof(interface) and sizeof(interface<proto>) in 64-bit mode.
- if (LangOpts.ObjCNonFragileABI && exprType->isObjCObjectType()) {
- Diag(OpLoc, diag::err_sizeof_nonfragile_interface)
- << exprType << (ExprKind == UETT_SizeOf)
- << ExprRange;
+ if (CheckObjCTraitOperandConstraints(*this, exprType, OpLoc, ExprRange,
+ ExprKind))
return true;
- }
return false;
}
-static bool CheckAlignOfExpr(Sema &S, Expr *E, SourceLocation OpLoc,
- SourceRange ExprRange) {
+static bool CheckAlignOfExpr(Sema &S, Expr *E) {
E = E->IgnoreParens();
// alignof decl is always ok.
@@ -3090,7 +3224,8 @@ static bool CheckAlignOfExpr(Sema &S, Expr *E, SourceLocation OpLoc,
return false;
if (E->getBitField()) {
- S. Diag(OpLoc, diag::err_sizeof_alignof_bitfield) << 1 << ExprRange;
+ S.Diag(E->getExprLoc(), diag::err_sizeof_alignof_bitfield)
+ << 1 << E->getSourceRange();
return true;
}
@@ -3100,20 +3235,17 @@ static bool CheckAlignOfExpr(Sema &S, Expr *E, SourceLocation OpLoc,
if (isa<FieldDecl>(ME->getMemberDecl()))
return false;
- return S.CheckUnaryExprOrTypeTraitOperand(E->getType(), OpLoc, ExprRange,
- UETT_AlignOf);
+ return S.CheckUnaryExprOrTypeTraitOperand(E, UETT_AlignOf);
}
-bool Sema::CheckVecStepExpr(Expr *E, SourceLocation OpLoc,
- SourceRange ExprRange) {
+bool Sema::CheckVecStepExpr(Expr *E) {
E = E->IgnoreParens();
// Cannot know anything else if the expression is dependent.
if (E->isTypeDependent())
return false;
- return CheckUnaryExprOrTypeTraitOperand(E->getType(), OpLoc, ExprRange,
- UETT_VecStep);
+ return CheckUnaryExprOrTypeTraitOperand(E, UETT_VecStep);
}
/// \brief Build a sizeof or alignof expression given a type operand.
@@ -3141,35 +3273,33 @@ Sema::CreateUnaryExprOrTypeTraitExpr(TypeSourceInfo *TInfo,
/// operand.
ExprResult
Sema::CreateUnaryExprOrTypeTraitExpr(Expr *E, SourceLocation OpLoc,
- UnaryExprOrTypeTrait ExprKind,
- SourceRange R) {
+ UnaryExprOrTypeTrait ExprKind) {
// Verify that the operand is valid.
bool isInvalid = false;
if (E->isTypeDependent()) {
// Delay type-checking for type-dependent expressions.
} else if (ExprKind == UETT_AlignOf) {
- isInvalid = CheckAlignOfExpr(*this, E, OpLoc, R);
+ isInvalid = CheckAlignOfExpr(*this, E);
} else if (ExprKind == UETT_VecStep) {
- isInvalid = CheckVecStepExpr(E, OpLoc, R);
+ isInvalid = CheckVecStepExpr(E);
} else if (E->getBitField()) { // C99 6.5.3.4p1.
- Diag(OpLoc, diag::err_sizeof_alignof_bitfield) << 0;
+ Diag(E->getExprLoc(), diag::err_sizeof_alignof_bitfield) << 0;
isInvalid = true;
} else if (E->getType()->isPlaceholderType()) {
ExprResult PE = CheckPlaceholderExpr(E);
if (PE.isInvalid()) return ExprError();
- return CreateUnaryExprOrTypeTraitExpr(PE.take(), OpLoc, ExprKind, R);
+ return CreateUnaryExprOrTypeTraitExpr(PE.take(), OpLoc, ExprKind);
} else {
- isInvalid = CheckUnaryExprOrTypeTraitOperand(E->getType(), OpLoc, R,
- UETT_SizeOf);
+ isInvalid = CheckUnaryExprOrTypeTraitOperand(E, UETT_SizeOf);
}
if (isInvalid)
return ExprError();
// C99 6.5.3.4p4: the type (an unsigned integer type) is size_t.
- return Owned(new (Context) UnaryExprOrTypeTraitExpr(ExprKind, E,
- Context.getSizeType(),
- OpLoc, R.getEnd()));
+ return Owned(new (Context) UnaryExprOrTypeTraitExpr(
+ ExprKind, E, Context.getSizeType(), OpLoc,
+ E->getSourceRange().getEnd()));
}
/// ActOnUnaryExprOrTypeTraitExpr - Handle @c sizeof(type) and @c sizeof @c
@@ -3189,10 +3319,7 @@ Sema::ActOnUnaryExprOrTypeTraitExpr(SourceLocation OpLoc,
}
Expr *ArgEx = (Expr *)TyOrEx;
- ExprResult Result
- = CreateUnaryExprOrTypeTraitExpr(ArgEx, OpLoc, ExprKind,
- ArgEx->getSourceRange());
-
+ ExprResult Result = CreateUnaryExprOrTypeTraitExpr(ArgEx, OpLoc, ExprKind);
return move(Result);
}
@@ -4211,7 +4338,11 @@ Sema::LookupMemberExpr(LookupResult &R, ExprResult &BaseExpr,
if (DiagnoseUseOfDecl(PD, MemberLoc))
return ExprError();
- return Owned(new (Context) ObjCPropertyRefExpr(PD, PD->getType(),
+ QualType T = PD->getType();
+ if (ObjCMethodDecl *Getter = PD->getGetterMethodDecl())
+ T = getMessageSendResultType(BaseType, Getter, false, false);
+
+ return Owned(new (Context) ObjCPropertyRefExpr(PD, T,
VK_LValue,
OK_ObjCProperty,
MemberLoc,
@@ -4229,7 +4360,8 @@ Sema::LookupMemberExpr(LookupResult &R, ExprResult &BaseExpr,
if (Decl *SDecl = FindGetterSetterNameDecl(OPT, /*Property id*/0,
SetterSel, Context))
SMD = dyn_cast<ObjCMethodDecl>(SDecl);
- QualType PType = OMD->getSendResultType();
+ QualType PType = getMessageSendResultType(BaseType, OMD, false,
+ false);
ExprValueKind VK = VK_LValue;
if (!getLangOptions().CPlusPlus &&
@@ -4297,7 +4429,8 @@ Sema::LookupMemberExpr(LookupResult &R, ExprResult &BaseExpr,
ExprValueKind VK = VK_LValue;
if (Getter) {
- PType = Getter->getSendResultType();
+ PType = getMessageSendResultType(QualType(OT, 0), Getter, true,
+ false);
if (!getLangOptions().CPlusPlus &&
IsCForbiddenLValueType(Context, PType))
VK = VK_RValue;
@@ -4377,120 +4510,52 @@ Sema::LookupMemberExpr(LookupResult &R, ExprResult &BaseExpr,
// If the user is trying to apply -> or . to a function name, it's probably
// because they forgot parentheses to call that function.
- bool TryCall = false;
- bool Overloaded = false;
- UnresolvedSet<8> AllOverloads;
- if (const OverloadExpr *Overloads = dyn_cast<OverloadExpr>(BaseExpr.get())) {
- AllOverloads.append(Overloads->decls_begin(), Overloads->decls_end());
- TryCall = true;
- Overloaded = true;
- } else if (DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(BaseExpr.get())) {
- if (FunctionDecl* Fun = dyn_cast<FunctionDecl>(DeclRef->getDecl())) {
- AllOverloads.addDecl(Fun);
- TryCall = true;
- }
- }
-
- if (TryCall) {
- // Plunder the overload set for something that would make the member
- // expression valid.
- UnresolvedSet<4> ViableOverloads;
- bool HasViableZeroArgOverload = false;
- for (OverloadExpr::decls_iterator it = AllOverloads.begin(),
- DeclsEnd = AllOverloads.end(); it != DeclsEnd; ++it) {
- // Our overload set may include TemplateDecls, which we'll ignore for the
- // purposes of determining whether we can issue a '()' fixit.
- if (const FunctionDecl *OverloadDecl = dyn_cast<FunctionDecl>(*it)) {
- QualType ResultTy = OverloadDecl->getResultType();
- if ((!IsArrow && ResultTy->isRecordType()) ||
- (IsArrow && ResultTy->isPointerType() &&
- ResultTy->getPointeeType()->isRecordType())) {
- ViableOverloads.addDecl(*it);
- if (OverloadDecl->getMinRequiredArguments() == 0) {
- HasViableZeroArgOverload = true;
- }
- }
- }
- }
-
- if (!HasViableZeroArgOverload || ViableOverloads.size() != 1) {
+ QualType ZeroArgCallTy;
+ UnresolvedSet<4> Overloads;
+ if (isExprCallable(*BaseExpr.get(), ZeroArgCallTy, Overloads)) {
+ if (ZeroArgCallTy.isNull()) {
Diag(BaseExpr.get()->getExprLoc(), diag::err_member_reference_needs_call)
- << (AllOverloads.size() > 1) << 0
- << BaseExpr.get()->getSourceRange();
- int ViableOverloadCount = ViableOverloads.size();
- int I;
- for (I = 0; I < ViableOverloadCount; ++I) {
- // FIXME: Magic number for max shown overloads stolen from
- // OverloadCandidateSet::NoteCandidates.
- if (I >= 4 && Diags.getShowOverloads() == Diagnostic::Ovl_Best) {
- break;
- }
- Diag(ViableOverloads[I].getDecl()->getSourceRange().getBegin(),
- diag::note_member_ref_possible_intended_overload);
- }
- if (I != ViableOverloadCount) {
- Diag(BaseExpr.get()->getExprLoc(), diag::note_ovl_too_many_candidates)
- << int(ViableOverloadCount - I);
+ << (Overloads.size() > 1) << 0 << BaseExpr.get()->getSourceRange();
+ UnresolvedSet<2> PlausibleOverloads;
+ for (OverloadExpr::decls_iterator It = Overloads.begin(),
+ DeclsEnd = Overloads.end(); It != DeclsEnd; ++It) {
+ const FunctionDecl *OverloadDecl = cast<FunctionDecl>(*It);
+ QualType OverloadResultTy = OverloadDecl->getResultType();
+ if ((!IsArrow && OverloadResultTy->isRecordType()) ||
+ (IsArrow && OverloadResultTy->isPointerType() &&
+ OverloadResultTy->getPointeeType()->isRecordType()))
+ PlausibleOverloads.addDecl(It.getDecl());
}
+ NoteOverloads(PlausibleOverloads, BaseExpr.get()->getExprLoc());
return ExprError();
}
- } else {
- // We don't have an expression that's convenient to get a Decl from, but we
- // can at least check if the type is "function of 0 arguments which returns
- // an acceptable type".
- const FunctionType *Fun = NULL;
- if (const PointerType *Ptr = BaseType->getAs<PointerType>()) {
- if ((Fun = Ptr->getPointeeType()->getAs<FunctionType>())) {
- TryCall = true;
- }
- } else if ((Fun = BaseType->getAs<FunctionType>())) {
- TryCall = true;
- } else if (BaseType == Context.BoundMemberTy) {
- // Look for the bound-member type. If it's still overloaded,
- // give up, although we probably should have fallen into the
- // OverloadExpr case above if we actually have an overloaded
- // bound member.
- QualType fnType = Expr::findBoundMemberType(BaseExpr.get());
- if (!fnType.isNull()) {
- TryCall = true;
- Fun = fnType->castAs<FunctionType>();
- }
- }
-
- if (TryCall) {
- if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(Fun)) {
- if (FPT->getNumArgs() == 0) {
- QualType ResultTy = Fun->getResultType();
- TryCall = (!IsArrow && ResultTy->isRecordType()) ||
- (IsArrow && ResultTy->isPointerType() &&
- ResultTy->getPointeeType()->isRecordType());
- }
- }
+ if ((!IsArrow && ZeroArgCallTy->isRecordType()) ||
+ (IsArrow && ZeroArgCallTy->isPointerType() &&
+ ZeroArgCallTy->getPointeeType()->isRecordType())) {
+ // At this point, we know BaseExpr looks like it's potentially callable
+ // with 0 arguments, and that it returns something of a reasonable type,
+ // so we can emit a fixit and carry on pretending that BaseExpr was
+ // actually a CallExpr.
+ SourceLocation ParenInsertionLoc =
+ PP.getLocForEndOfToken(BaseExpr.get()->getLocEnd());
+ Diag(BaseExpr.get()->getExprLoc(), diag::err_member_reference_needs_call)
+ << (Overloads.size() > 1) << 1 << BaseExpr.get()->getSourceRange()
+ << FixItHint::CreateInsertion(ParenInsertionLoc, "()");
+ // FIXME: Try this before emitting the fixit, and suppress diagnostics
+ // while doing so.
+ ExprResult NewBase =
+ ActOnCallExpr(0, BaseExpr.take(), ParenInsertionLoc,
+ MultiExprArg(*this, 0, 0),
+ ParenInsertionLoc.getFileLocWithOffset(1));
+ if (NewBase.isInvalid())
+ return ExprError();
+ BaseExpr = NewBase;
+ BaseExpr = DefaultFunctionArrayConversion(BaseExpr.take());
+ return LookupMemberExpr(R, BaseExpr, IsArrow, OpLoc, SS,
+ ObjCImpDecl, HasTemplateArgs);
}
}
- if (TryCall) {
- // At this point, we know BaseExpr looks like it's potentially callable with
- // 0 arguments, and that it returns something of a reasonable type, so we
- // can emit a fixit and carry on pretending that BaseExpr was actually a
- // CallExpr.
- SourceLocation ParenInsertionLoc =
- PP.getLocForEndOfToken(BaseExpr.get()->getLocEnd());
- Diag(BaseExpr.get()->getExprLoc(), diag::err_member_reference_needs_call)
- << int(Overloaded) << 1
- << BaseExpr.get()->getSourceRange()
- << FixItHint::CreateInsertion(ParenInsertionLoc, "()");
- ExprResult NewBase = ActOnCallExpr(0, BaseExpr.take(), ParenInsertionLoc,
- MultiExprArg(*this, 0, 0),
- ParenInsertionLoc);
- if (NewBase.isInvalid())
- return ExprError();
- BaseExpr = NewBase;
- BaseExpr = DefaultFunctionArrayConversion(BaseExpr.take());
- return LookupMemberExpr(R, BaseExpr, IsArrow, OpLoc, SS,
- ObjCImpDecl, HasTemplateArgs);
- }
-
Diag(MemberLoc, diag::err_typecheck_member_reference_struct_union)
<< BaseType << BaseExpr.get()->getSourceRange();
@@ -4946,6 +5011,26 @@ Sema::ActOnCUDAExecConfigExpr(Scope *S, SourceLocation LLLLoc,
return ActOnCallExpr(S, ConfigDR, LLLLoc, execConfig, GGGLoc, 0);
}
+/// ActOnAsTypeExpr - create a new asType (bitcast) from the arguments.
+///
+/// __builtin_astype( value, dst type )
+///
+ExprResult Sema::ActOnAsTypeExpr(Expr *expr, ParsedType destty,
+ SourceLocation BuiltinLoc,
+ SourceLocation RParenLoc) {
+ ExprValueKind VK = VK_RValue;
+ ExprObjectKind OK = OK_Ordinary;
+ QualType DstTy = GetTypeFromParser(destty);
+ QualType SrcTy = expr->getType();
+ if (Context.getTypeSize(DstTy) != Context.getTypeSize(SrcTy))
+ return ExprError(Diag(BuiltinLoc,
+ diag::err_invalid_astype_of_different_size)
+ << DstTy
+ << SrcTy
+ << expr->getSourceRange());
+ return Owned(new (Context) AsTypeExpr(expr, DstTy, VK, OK, BuiltinLoc, RParenLoc));
+}
+
/// BuildResolvedCallExpr - Build a call to a resolved expression,
/// i.e. an expression not of \p OverloadTy. The expression should
/// unary-convert to an expression of function-pointer or
@@ -6118,6 +6203,150 @@ QualType Sema::FindCompositeObjCPointerType(ExprResult &LHS, ExprResult &RHS,
return QualType();
}
+/// SuggestParentheses - Emit a diagnostic together with a fixit hint that wraps
+/// ParenRange in parentheses.
+static void SuggestParentheses(Sema &Self, SourceLocation Loc,
+ const PartialDiagnostic &PD,
+ const PartialDiagnostic &FirstNote,
+ SourceRange FirstParenRange,
+ const PartialDiagnostic &SecondNote,
+ SourceRange SecondParenRange) {
+ Self.Diag(Loc, PD);
+
+ if (!FirstNote.getDiagID())
+ return;
+
+ SourceLocation EndLoc = Self.PP.getLocForEndOfToken(FirstParenRange.getEnd());
+ if (!FirstParenRange.getEnd().isFileID() || EndLoc.isInvalid()) {
+ // We can't display the parentheses, so just return.
+ return;
+ }
+
+ Self.Diag(Loc, FirstNote)
+ << FixItHint::CreateInsertion(FirstParenRange.getBegin(), "(")
+ << FixItHint::CreateInsertion(EndLoc, ")");
+
+ if (!SecondNote.getDiagID())
+ return;
+
+ EndLoc = Self.PP.getLocForEndOfToken(SecondParenRange.getEnd());
+ if (!SecondParenRange.getEnd().isFileID() || EndLoc.isInvalid()) {
+ // We can't display the parentheses, so just dig the
+ // warning/error and return.
+ Self.Diag(Loc, SecondNote);
+ return;
+ }
+
+ Self.Diag(Loc, SecondNote)
+ << FixItHint::CreateInsertion(SecondParenRange.getBegin(), "(")
+ << FixItHint::CreateInsertion(EndLoc, ")");
+}
+
+static bool IsArithmeticOp(BinaryOperatorKind Opc) {
+ return Opc >= BO_Mul && Opc <= BO_Shr;
+}
+
+/// IsArithmeticBinaryExpr - Returns true if E is an arithmetic binary
+/// expression, either using a built-in or overloaded operator,
+/// and sets *OpCode to the opcode and *RHS to the right-hand side expression.
+static bool IsArithmeticBinaryExpr(Expr *E, BinaryOperatorKind *Opcode,
+ Expr **RHS) {
+ E = E->IgnoreParenImpCasts();
+ E = E->IgnoreConversionOperator();
+ E = E->IgnoreParenImpCasts();
+
+ // Built-in binary operator.
+ if (BinaryOperator *OP = dyn_cast<BinaryOperator>(E)) {
+ if (IsArithmeticOp(OP->getOpcode())) {
+ *Opcode = OP->getOpcode();
+ *RHS = OP->getRHS();
+ return true;
+ }
+ }
+
+ // Overloaded operator.
+ if (CXXOperatorCallExpr *Call = dyn_cast<CXXOperatorCallExpr>(E)) {
+ if (Call->getNumArgs() != 2)
+ return false;
+
+ // Make sure this is really a binary operator that is safe to pass into
+ // BinaryOperator::getOverloadedOpcode(), e.g. it's not a subscript op.
+ OverloadedOperatorKind OO = Call->getOperator();
+ if (OO < OO_Plus || OO > OO_Arrow)
+ return false;
+
+ BinaryOperatorKind OpKind = BinaryOperator::getOverloadedOpcode(OO);
+ if (IsArithmeticOp(OpKind)) {
+ *Opcode = OpKind;
+ *RHS = Call->getArg(1);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static bool IsLogicOp(BinaryOperatorKind Opc) {
+ return (Opc >= BO_LT && Opc <= BO_NE) || (Opc >= BO_LAnd && Opc <= BO_LOr);
+}
+
+/// ExprLooksBoolean - Returns true if E looks boolean, i.e. it has boolean type
+/// or is a logical expression such as (x==y) which has int type, but is
+/// commonly interpreted as boolean.
+static bool ExprLooksBoolean(Expr *E) {
+ E = E->IgnoreParenImpCasts();
+
+ if (E->getType()->isBooleanType())
+ return true;
+ if (BinaryOperator *OP = dyn_cast<BinaryOperator>(E))
+ return IsLogicOp(OP->getOpcode());
+ if (UnaryOperator *OP = dyn_cast<UnaryOperator>(E))
+ return OP->getOpcode() == UO_LNot;
+
+ return false;
+}
+
+/// DiagnoseConditionalPrecedence - Emit a warning when a conditional operator
+/// and binary operator are mixed in a way that suggests the programmer assumed
+/// the conditional operator has higher precedence, for example:
+/// "int x = a + someBinaryCondition ? 1 : 2".
+static void DiagnoseConditionalPrecedence(Sema &Self,
+ SourceLocation OpLoc,
+ Expr *cond,
+ Expr *lhs,
+ Expr *rhs) {
+ BinaryOperatorKind CondOpcode;
+ Expr *CondRHS;
+
+ if (!IsArithmeticBinaryExpr(cond, &CondOpcode, &CondRHS))
+ return;
+ if (!ExprLooksBoolean(CondRHS))
+ return;
+
+ // The condition is an arithmetic binary expression, with a right-
+ // hand side that looks boolean, so warn.
+
+ PartialDiagnostic Warn = Self.PDiag(diag::warn_precedence_conditional)
+ << cond->getSourceRange()
+ << BinaryOperator::getOpcodeStr(CondOpcode);
+
+ PartialDiagnostic FirstNote =
+ Self.PDiag(diag::note_precedence_conditional_silence)
+ << BinaryOperator::getOpcodeStr(CondOpcode);
+
+ SourceRange FirstParenRange(cond->getLocStart(),
+ cond->getLocEnd());
+
+ PartialDiagnostic SecondNote =
+ Self.PDiag(diag::note_precedence_conditional_first);
+
+ SourceRange SecondParenRange(CondRHS->getLocStart(),
+ rhs->getLocEnd());
+
+ SuggestParentheses(Self, OpLoc, Warn, FirstNote, FirstParenRange,
+ SecondNote, SecondParenRange);
+}
+
/// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
/// in the case of a the GNU conditional expr extension.
ExprResult Sema::ActOnConditionalOp(SourceLocation QuestionLoc,
@@ -6162,6 +6391,9 @@ ExprResult Sema::ActOnConditionalOp(SourceLocation QuestionLoc,
RHS.isInvalid())
return ExprError();
+ DiagnoseConditionalPrecedence(*this, QuestionLoc, Cond.get(), LHS.get(),
+ RHS.get());
+
if (!commonExpr)
return Owned(new (Context) ConditionalOperator(Cond.take(), QuestionLoc,
LHS.take(), ColonLoc,
@@ -7487,7 +7719,7 @@ QualType Sema::CheckCompareOperands(ExprResult &lex, ExprResult &rex, SourceLoca
// Comparison of pointers with null pointer constants and equality
// comparisons of member pointers to null pointer constants.
if (RHSIsNull &&
- ((lType->isPointerType() || lType->isNullPtrType()) ||
+ ((lType->isAnyPointerType() || lType->isNullPtrType()) ||
(!isRelational && lType->isMemberPointerType()))) {
rex = ImpCastExprToType(rex.take(), lType,
lType->isMemberPointerType()
@@ -7496,7 +7728,7 @@ QualType Sema::CheckCompareOperands(ExprResult &lex, ExprResult &rex, SourceLoca
return ResultTy;
}
if (LHSIsNull &&
- ((rType->isPointerType() || rType->isNullPtrType()) ||
+ ((rType->isAnyPointerType() || rType->isNullPtrType()) ||
(!isRelational && rType->isMemberPointerType()))) {
lex = ImpCastExprToType(lex.take(), rType,
rType->isMemberPointerType()
@@ -7748,13 +7980,15 @@ inline QualType Sema::CheckLogicalOperands( // C99 6.5.[13,14]
// If the RHS can be constant folded, and if it constant folds to something
// that isn't 0 or 1 (which indicate a potential logical operation that
// happened to fold to true/false) then warn.
+ // Parens on the RHS are ignored.
Expr::EvalResult Result;
- if (rex.get()->Evaluate(Result, Context) && !Result.HasSideEffects &&
- Result.Val.getInt() != 0 && Result.Val.getInt() != 1) {
- Diag(Loc, diag::warn_logical_instead_of_bitwise)
- << rex.get()->getSourceRange()
- << (Opc == BO_LAnd ? "&&" : "||")
- << (Opc == BO_LAnd ? "&" : "|");
+ if (rex.get()->Evaluate(Result, Context) && !Result.HasSideEffects)
+ if ((getLangOptions().Bool && !rex.get()->getType()->isBooleanType()) ||
+ (Result.Val.getInt() != 0 && Result.Val.getInt() != 1)) {
+ Diag(Loc, diag::warn_logical_instead_of_bitwise)
+ << rex.get()->getSourceRange()
+ << (Opc == BO_LAnd ? "&&" : "||")
+ << (Opc == BO_LAnd ? "&" : "|");
}
}
@@ -8127,20 +8361,31 @@ ExprResult Sema::ConvertPropertyForRValue(Expr *E) {
E->getObjectKind() == OK_ObjCProperty);
const ObjCPropertyRefExpr *PRE = E->getObjCProperty();
+ QualType T = E->getType();
+ QualType ReceiverType;
+ if (PRE->isObjectReceiver())
+ ReceiverType = PRE->getBase()->getType();
+ else if (PRE->isSuperReceiver())
+ ReceiverType = PRE->getSuperReceiverType();
+ else
+ ReceiverType = Context.getObjCInterfaceType(PRE->getClassReceiver());
+
ExprValueKind VK = VK_RValue;
if (PRE->isImplicitProperty()) {
- if (const ObjCMethodDecl *GetterMethod =
+ if (ObjCMethodDecl *GetterMethod =
PRE->getImplicitPropertyGetter()) {
- QualType Result = GetterMethod->getResultType();
- VK = Expr::getValueKindForType(Result);
+ T = getMessageSendResultType(ReceiverType, GetterMethod,
+ PRE->isClassReceiver(),
+ PRE->isSuperReceiver());
+ VK = Expr::getValueKindForType(GetterMethod->getResultType());
}
else {
Diag(PRE->getLocation(), diag::err_getter_not_found)
<< PRE->getBase()->getType();
}
}
-
- E = ImplicitCastExpr::Create(Context, E->getType(), CK_GetObjCProperty,
+
+ E = ImplicitCastExpr::Create(Context, T, CK_GetObjCProperty,
E, 0, VK);
ExprResult Result = MaybeBindToTemporary(E);
@@ -8404,7 +8649,13 @@ static QualType CheckIndirectionOperand(Sema &S, Expr *Op, ExprValueKind &VK,
Op = ConvResult.take();
QualType OpTy = Op->getType();
QualType Result;
-
+
+ if (isa<CXXReinterpretCastExpr>(Op)) {
+ QualType OpOrigType = Op->IgnoreParenCasts()->getType();
+ S.CheckCompatibleReinterpretCast(OpOrigType, OpTy, /*IsDereference*/true,
+ Op->getSourceRange());
+ }
+
// Note that per both C89 and C99, indirection is always legal, even if OpTy
// is an incomplete type or void. It would be possible to warn about
// dereferencing a void pointer, but it's completely well-defined, and such a
@@ -8678,45 +8929,6 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
CompResultTy, OpLoc));
}
-/// SuggestParentheses - Emit a diagnostic together with a fixit hint that wraps
-/// ParenRange in parentheses.
-static void SuggestParentheses(Sema &Self, SourceLocation Loc,
- const PartialDiagnostic &PD,
- const PartialDiagnostic &FirstNote,
- SourceRange FirstParenRange,
- const PartialDiagnostic &SecondNote,
- SourceRange SecondParenRange) {
- Self.Diag(Loc, PD);
-
- if (!FirstNote.getDiagID())
- return;
-
- SourceLocation EndLoc = Self.PP.getLocForEndOfToken(FirstParenRange.getEnd());
- if (!FirstParenRange.getEnd().isFileID() || EndLoc.isInvalid()) {
- // We can't display the parentheses, so just return.
- return;
- }
-
- Self.Diag(Loc, FirstNote)
- << FixItHint::CreateInsertion(FirstParenRange.getBegin(), "(")
- << FixItHint::CreateInsertion(EndLoc, ")");
-
- if (!SecondNote.getDiagID())
- return;
-
- EndLoc = Self.PP.getLocForEndOfToken(SecondParenRange.getEnd());
- if (!SecondParenRange.getEnd().isFileID() || EndLoc.isInvalid()) {
- // We can't display the parentheses, so just dig the
- // warning/error and return.
- Self.Diag(Loc, SecondNote);
- return;
- }
-
- Self.Diag(Loc, SecondNote)
- << FixItHint::CreateInsertion(SecondParenRange.getBegin(), "(")
- << FixItHint::CreateInsertion(EndLoc, ")");
-}
-
/// DiagnoseBitwisePrecedence - Emit a warning when bitwise and comparison
/// operators are mixed in a way that suggests that the programmer forgot that
/// comparison operators have higher precedence. The most typical example of
@@ -9666,6 +9878,7 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
*Complained = false;
// Decode the result (notice that AST's are still created for extensions).
+ bool CheckInferredResultType = false;
bool isInvalid = false;
unsigned DiagKind;
FixItHint Hint;
@@ -9682,6 +9895,8 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
case IncompatiblePointer:
MakeObjCStringLiteralFixItHint(*this, DstType, SrcExpr, Hint);
DiagKind = diag::ext_typecheck_convert_incompatible_pointer;
+ CheckInferredResultType = DstType->isObjCObjectPointerType() &&
+ SrcType->isObjCObjectPointerType();
break;
case IncompatiblePointerSign:
DiagKind = diag::ext_typecheck_convert_incompatible_pointer_sign;
@@ -9763,6 +9978,9 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
Diag(Loc, DiagKind) << FirstType << SecondType << Action
<< SrcExpr->getSourceRange() << Hint;
+ if (CheckInferredResultType)
+ EmitRelatedResultTypeNote(SrcExpr);
+
if (Complained)
*Complained = true;
return isInvalid;
@@ -9914,26 +10132,25 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
// Note that this declaration has been used.
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(D)) {
- unsigned TypeQuals;
- if (Constructor->isImplicit() && Constructor->isDefaultConstructor()) {
- if (Constructor->getParent()->hasTrivialConstructor())
+ if (Constructor->isDefaulted() && Constructor->isDefaultConstructor()) {
+ if (Constructor->isTrivial())
return;
if (!Constructor->isUsed(false))
DefineImplicitDefaultConstructor(Loc, Constructor);
- } else if (Constructor->isImplicit() &&
- Constructor->isCopyConstructor(TypeQuals)) {
+ } else if (Constructor->isDefaulted() &&
+ Constructor->isCopyConstructor()) {
if (!Constructor->isUsed(false))
- DefineImplicitCopyConstructor(Loc, Constructor, TypeQuals);
+ DefineImplicitCopyConstructor(Loc, Constructor);
}
MarkVTableUsed(Loc, Constructor->getParent());
} else if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(D)) {
- if (Destructor->isImplicit() && !Destructor->isUsed(false))
+ if (Destructor->isDefaulted() && !Destructor->isUsed(false))
DefineImplicitDestructor(Loc, Destructor);
if (Destructor->isVirtual())
MarkVTableUsed(Loc, Destructor->getParent());
} else if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(D)) {
- if (MethodDecl->isImplicit() && MethodDecl->isOverloadedOperator() &&
+ if (MethodDecl->isDefaulted() && MethodDecl->isOverloadedOperator() &&
MethodDecl->getOverloadedOperator() == OO_Equal) {
if (!MethodDecl->isUsed(false))
DefineImplicitCopyAssignment(Loc, MethodDecl);
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp
index 7f1bf59..2f5a890 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp
@@ -17,6 +17,7 @@
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/ScopeInfo.h"
+#include "clang/Sema/Scope.h"
#include "clang/Sema/TemplateDeduction.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/CXXInheritance.h"
@@ -385,13 +386,14 @@ static UuidAttr *GetUuidAttrOfType(QualType QT) {
else if (QT->isArrayType())
Ty = cast<ArrayType>(QT)->getElementType().getTypePtr();
- // Loop all class definition and declaration looking for an uuid attribute.
+ // Loop all record redeclaration looking for an uuid attribute.
CXXRecordDecl *RD = Ty->getAsCXXRecordDecl();
- while (RD) {
- if (UuidAttr *Uuid = RD->getAttr<UuidAttr>())
+ for (CXXRecordDecl::redecl_iterator I = RD->redecls_begin(),
+ E = RD->redecls_end(); I != E; ++I) {
+ if (UuidAttr *Uuid = I->getAttr<UuidAttr>())
return Uuid;
- RD = RD->getPreviousDeclaration();
}
+
return 0;
}
@@ -574,42 +576,54 @@ ExprResult Sema::CheckCXXThrowOperand(SourceLocation ThrowLoc, Expr *E) {
return Owned(E);
}
-CXXMethodDecl *Sema::tryCaptureCXXThis() {
+QualType Sema::getAndCaptureCurrentThisType() {
// Ignore block scopes: we can capture through them.
// Ignore nested enum scopes: we'll diagnose non-constant expressions
// where they're invalid, and other uses are legitimate.
// Don't ignore nested class scopes: you can't use 'this' in a local class.
DeclContext *DC = CurContext;
+ unsigned NumBlocks = 0;
while (true) {
- if (isa<BlockDecl>(DC)) DC = cast<BlockDecl>(DC)->getDeclContext();
- else if (isa<EnumDecl>(DC)) DC = cast<EnumDecl>(DC)->getDeclContext();
+ if (isa<BlockDecl>(DC)) {
+ DC = cast<BlockDecl>(DC)->getDeclContext();
+ ++NumBlocks;
+ } else if (isa<EnumDecl>(DC))
+ DC = cast<EnumDecl>(DC)->getDeclContext();
else break;
}
- // If we're not in an instance method, error out.
- CXXMethodDecl *method = dyn_cast<CXXMethodDecl>(DC);
- if (!method || !method->isInstance())
- return 0;
+ QualType ThisTy;
+ if (CXXMethodDecl *method = dyn_cast<CXXMethodDecl>(DC)) {
+ if (method && method->isInstance())
+ ThisTy = method->getThisType(Context);
+ } else if (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC)) {
+ // C++0x [expr.prim]p4:
+ // Otherwise, if a member-declarator declares a non-static data member
+ // of a class X, the expression this is a prvalue of type "pointer to X"
+ // within the optional brace-or-equal-initializer.
+ Scope *S = getScopeForContext(DC);
+ if (!S || S->getFlags() & Scope::ThisScope)
+ ThisTy = Context.getPointerType(Context.getRecordType(RD));
+ }
- // Mark that we're closing on 'this' in all the block scopes, if applicable.
- for (unsigned idx = FunctionScopes.size() - 1;
- isa<BlockScopeInfo>(FunctionScopes[idx]);
- --idx)
- cast<BlockScopeInfo>(FunctionScopes[idx])->CapturesCXXThis = true;
+ // Mark that we're closing on 'this' in all the block scopes we ignored.
+ if (!ThisTy.isNull())
+ for (unsigned idx = FunctionScopes.size() - 1;
+ NumBlocks; --idx, --NumBlocks)
+ cast<BlockScopeInfo>(FunctionScopes[idx])->CapturesCXXThis = true;
- return method;
+ return ThisTy;
}
-ExprResult Sema::ActOnCXXThis(SourceLocation loc) {
+ExprResult Sema::ActOnCXXThis(SourceLocation Loc) {
/// C++ 9.3.2: In the body of a non-static member function, the keyword this
/// is a non-lvalue expression whose value is the address of the object for
/// which the function is called.
- CXXMethodDecl *method = tryCaptureCXXThis();
- if (!method) return Diag(loc, diag::err_invalid_this_use);
+ QualType ThisTy = getAndCaptureCurrentThisType();
+ if (ThisTy.isNull()) return Diag(Loc, diag::err_invalid_this_use);
- return Owned(new (Context) CXXThisExpr(loc, method->getThisType(Context),
- /*isImplicit=*/false));
+ return Owned(new (Context) CXXThisExpr(Loc, ThisTy, /*isImplicit=*/false));
}
ExprResult
@@ -950,8 +964,8 @@ Sema::BuildCXXNew(SourceLocation StartLoc, bool UseGlobal,
}
}
- ArraySize = ImpCastExprToType(ArraySize, Context.getSizeType(),
- CK_IntegralCast).take();
+ // Note that we do *not* convert the argument in any way. It can
+ // be signed, larger than size_t, whatever.
}
FunctionDecl *OperatorNew = 0;
@@ -1326,11 +1340,12 @@ bool Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range,
bool Sema::FindAllocationOverload(SourceLocation StartLoc, SourceRange Range,
DeclarationName Name, Expr** Args,
unsigned NumArgs, DeclContext *Ctx,
- bool AllowMissing, FunctionDecl *&Operator) {
+ bool AllowMissing, FunctionDecl *&Operator,
+ bool Diagnose) {
LookupResult R(*this, Name, StartLoc, LookupOrdinaryName);
LookupQualifiedName(R, Ctx);
if (R.empty()) {
- if (AllowMissing)
+ if (AllowMissing || !Diagnose)
return false;
return Diag(StartLoc, diag::err_ovl_no_viable_function_in_call)
<< Name << Range;
@@ -1374,41 +1389,50 @@ bool Sema::FindAllocationOverload(SourceLocation StartLoc, SourceRange Range,
// Watch out for variadic allocator function.
unsigned NumArgsInFnDecl = FnDecl->getNumParams();
for (unsigned i = 0; (i < NumArgs && i < NumArgsInFnDecl); ++i) {
+ InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
+ FnDecl->getParamDecl(i));
+
+ if (!Diagnose && !CanPerformCopyInitialization(Entity, Owned(Args[i])))
+ return true;
+
ExprResult Result
- = PerformCopyInitialization(InitializedEntity::InitializeParameter(
- Context,
- FnDecl->getParamDecl(i)),
- SourceLocation(),
- Owned(Args[i]));
+ = PerformCopyInitialization(Entity, SourceLocation(), Owned(Args[i]));
if (Result.isInvalid())
return true;
Args[i] = Result.takeAs<Expr>();
}
Operator = FnDecl;
- CheckAllocationAccess(StartLoc, Range, R.getNamingClass(), Best->FoundDecl);
+ CheckAllocationAccess(StartLoc, Range, R.getNamingClass(), Best->FoundDecl,
+ Diagnose);
return false;
}
case OR_No_Viable_Function:
- Diag(StartLoc, diag::err_ovl_no_viable_function_in_call)
- << Name << Range;
- Candidates.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
+ if (Diagnose) {
+ Diag(StartLoc, diag::err_ovl_no_viable_function_in_call)
+ << Name << Range;
+ Candidates.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
+ }
return true;
case OR_Ambiguous:
- Diag(StartLoc, diag::err_ovl_ambiguous_call)
- << Name << Range;
- Candidates.NoteCandidates(*this, OCD_ViableCandidates, Args, NumArgs);
+ if (Diagnose) {
+ Diag(StartLoc, diag::err_ovl_ambiguous_call)
+ << Name << Range;
+ Candidates.NoteCandidates(*this, OCD_ViableCandidates, Args, NumArgs);
+ }
return true;
case OR_Deleted: {
- Diag(StartLoc, diag::err_ovl_deleted_call)
- << Best->Function->isDeleted()
- << Name
- << getDeletedOrUnavailableSuffix(Best->Function)
- << Range;
- Candidates.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
+ if (Diagnose) {
+ Diag(StartLoc, diag::err_ovl_deleted_call)
+ << Best->Function->isDeleted()
+ << Name
+ << getDeletedOrUnavailableSuffix(Best->Function)
+ << Range;
+ Candidates.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
+ }
return true;
}
}
@@ -1568,7 +1592,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD,
DeclarationName Name,
- FunctionDecl* &Operator) {
+ FunctionDecl* &Operator, bool Diagnose) {
LookupResult Found(*this, Name, StartLoc, LookupOrdinaryName);
// Try to find operator delete/operator delete[] in class scope.
LookupQualifiedName(Found, RD);
@@ -1595,33 +1619,45 @@ bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD,
// There's exactly one suitable operator; pick it.
if (Matches.size() == 1) {
Operator = cast<CXXMethodDecl>(Matches[0]->getUnderlyingDecl());
+
+ if (Operator->isDeleted()) {
+ if (Diagnose) {
+ Diag(StartLoc, diag::err_deleted_function_use);
+ Diag(Operator->getLocation(), diag::note_unavailable_here) << true;
+ }
+ return true;
+ }
+
CheckAllocationAccess(StartLoc, SourceRange(), Found.getNamingClass(),
- Matches[0]);
+ Matches[0], Diagnose);
return false;
// We found multiple suitable operators; complain about the ambiguity.
} else if (!Matches.empty()) {
- Diag(StartLoc, diag::err_ambiguous_suitable_delete_member_function_found)
- << Name << RD;
-
- for (llvm::SmallVectorImpl<DeclAccessPair>::iterator
- F = Matches.begin(), FEnd = Matches.end(); F != FEnd; ++F)
- Diag((*F)->getUnderlyingDecl()->getLocation(),
- diag::note_member_declared_here) << Name;
+ if (Diagnose) {
+ Diag(StartLoc, diag::err_ambiguous_suitable_delete_member_function_found)
+ << Name << RD;
+
+ for (llvm::SmallVectorImpl<DeclAccessPair>::iterator
+ F = Matches.begin(), FEnd = Matches.end(); F != FEnd; ++F)
+ Diag((*F)->getUnderlyingDecl()->getLocation(),
+ diag::note_member_declared_here) << Name;
+ }
return true;
}
// We did find operator delete/operator delete[] declarations, but
// none of them were suitable.
if (!Found.empty()) {
- Diag(StartLoc, diag::err_no_suitable_delete_member_function_found)
- << Name << RD;
-
- for (LookupResult::iterator F = Found.begin(), FEnd = Found.end();
- F != FEnd; ++F)
- Diag((*F)->getUnderlyingDecl()->getLocation(),
- diag::note_member_declared_here) << Name;
-
+ if (Diagnose) {
+ Diag(StartLoc, diag::err_no_suitable_delete_member_function_found)
+ << Name << RD;
+
+ for (LookupResult::iterator F = Found.begin(), FEnd = Found.end();
+ F != FEnd; ++F)
+ Diag((*F)->getUnderlyingDecl()->getLocation(),
+ diag::note_member_declared_here) << Name;
+ }
return true;
}
@@ -1633,8 +1669,8 @@ bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD,
Expr* DeallocArgs[1];
DeallocArgs[0] = &Null;
if (FindAllocationOverload(StartLoc, SourceRange(), Name,
- DeallocArgs, 1, TUDecl, /*AllowMissing=*/false,
- Operator))
+ DeallocArgs, 1, TUDecl, !Diagnose,
+ Operator, Diagnose))
return true;
assert(Operator && "Did not find a deallocation function!");
@@ -1780,6 +1816,20 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
const_cast<CXXDestructorDecl*>(Dtor));
DiagnoseUseOfDecl(Dtor, StartLoc);
}
+
+ // C++ [expr.delete]p3:
+ // In the first alternative (delete object), if the static type of the
+ // object to be deleted is different from its dynamic type, the static
+ // type shall be a base class of the dynamic type of the object to be
+ // deleted and the static type shall have a virtual destructor or the
+ // behavior is undefined.
+ //
+ // Note: a final class cannot be derived from, no issue there
+ if (!ArrayForm && RD->isPolymorphic() && !RD->hasAttr<FinalAttr>()) {
+ CXXDestructorDecl *dtor = RD->getDestructor();
+ if (!dtor || !dtor->isVirtual())
+ Diag(StartLoc, diag::warn_delete_non_virtual_dtor) << PointeeElem;
+ }
}
if (!OperatorDelete) {
@@ -2174,7 +2224,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
case ICK_Pointer_Conversion: {
if (SCS.IncompatibleObjC && Action != AA_Casting) {
// Diagnose incompatible Objective-C conversions
- if (Action == AA_Initializing)
+ if (Action == AA_Initializing || Action == AA_Assigning)
Diag(From->getSourceRange().getBegin(),
diag::ext_typecheck_convert_incompatible_pointer)
<< ToType << From->getType() << Action
@@ -2184,6 +2234,10 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
diag::ext_typecheck_convert_incompatible_pointer)
<< From->getType() << ToType << Action
<< From->getSourceRange();
+
+ if (From->getType()->isObjCObjectPointerType() &&
+ ToType->isObjCObjectPointerType())
+ EmitRelatedResultTypeNote(From);
}
CastKind Kind = CK_Invalid;
@@ -2416,6 +2470,7 @@ static bool CheckUnaryTypeTraitTypeCompleteness(Sema &S,
// C++0x [meta.unary.prop] Table 49 requires the following traits to be
// applied to a complete type.
case UTT_IsTrivial:
+ case UTT_IsTriviallyCopyable:
case UTT_IsStandardLayout:
case UTT_IsPOD:
case UTT_IsLiteral:
@@ -2433,7 +2488,7 @@ static bool CheckUnaryTypeTraitTypeCompleteness(Sema &S,
case UTT_HasNothrowConstructor:
case UTT_HasNothrowCopy:
case UTT_HasTrivialAssign:
- case UTT_HasTrivialConstructor:
+ case UTT_HasTrivialDefaultConstructor:
case UTT_HasTrivialCopy:
case UTT_HasTrivialDestructor:
case UTT_HasVirtualDestructor:
@@ -2512,6 +2567,8 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
return T.isVolatileQualified();
case UTT_IsTrivial:
return T->isTrivialType();
+ case UTT_IsTriviallyCopyable:
+ return T->isTriviallyCopyableType();
case UTT_IsStandardLayout:
return T->isStandardLayoutType();
case UTT_IsPOD:
@@ -2543,7 +2600,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
//
// 1: http://gcc.gnu/.org/onlinedocs/gcc/Type-Traits.html
// 2: http://docwiki.embarcadero.com/RADStudio/XE/en/Type_Trait_Functions_(C%2B%2B0x)_Index
- case UTT_HasTrivialConstructor:
+ case UTT_HasTrivialDefaultConstructor:
// http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html:
// If __is_pod (type) is true then the trait is true, else if type is
// a cv class or union type (or array thereof) with a trivial default
@@ -2552,7 +2609,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
return true;
if (const RecordType *RT =
C.getBaseElementType(T)->getAs<RecordType>())
- return cast<CXXRecordDecl>(RT->getDecl())->hasTrivialConstructor();
+ return cast<CXXRecordDecl>(RT->getDecl())->hasTrivialDefaultConstructor();
return false;
case UTT_HasTrivialCopy:
// http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html:
@@ -2619,7 +2676,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
return true;
bool FoundAssign = false;
- bool AllNoThrow = true;
DeclarationName Name = C.DeclarationNames.getCXXOperatorName(OO_Equal);
LookupResult Res(Self, DeclarationNameInfo(Name, KeyLoc),
Sema::LookupOrdinaryName);
@@ -2631,15 +2687,15 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
FoundAssign = true;
const FunctionProtoType *CPT
= Operator->getType()->getAs<FunctionProtoType>();
- if (!CPT->isNothrow(Self.Context)) {
- AllNoThrow = false;
- break;
- }
+ if (CPT->getExceptionSpecType() == EST_Delayed)
+ return false;
+ if (!CPT->isNothrow(Self.Context))
+ return false;
}
}
}
- return FoundAssign && AllNoThrow;
+ return FoundAssign;
}
return false;
case UTT_HasNothrowCopy:
@@ -2656,7 +2712,6 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
return true;
bool FoundConstructor = false;
- bool AllNoThrow = true;
unsigned FoundTQs;
DeclContext::lookup_const_iterator Con, ConEnd;
for (llvm::tie(Con, ConEnd) = Self.LookupConstructors(RD);
@@ -2671,16 +2726,16 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
FoundConstructor = true;
const FunctionProtoType *CPT
= Constructor->getType()->getAs<FunctionProtoType>();
+ if (CPT->getExceptionSpecType() == EST_Delayed)
+ return false;
// FIXME: check whether evaluating default arguments can throw.
// For now, we'll be conservative and assume that they can throw.
- if (!CPT->isNothrow(Self.Context) || CPT->getNumArgs() > 1) {
- AllNoThrow = false;
- break;
- }
+ if (!CPT->isNothrow(Self.Context) || CPT->getNumArgs() > 1)
+ return false;
}
}
- return FoundConstructor && AllNoThrow;
+ return FoundConstructor;
}
return false;
case UTT_HasNothrowConstructor:
@@ -2693,7 +2748,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
return true;
if (const RecordType *RT = C.getBaseElementType(T)->getAs<RecordType>()) {
CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
- if (RD->hasTrivialConstructor())
+ if (RD->hasTrivialDefaultConstructor())
return true;
DeclContext::lookup_const_iterator Con, ConEnd;
@@ -2706,6 +2761,8 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT,
if (Constructor->isDefaultConstructor()) {
const FunctionProtoType *CPT
= Constructor->getType()->getAs<FunctionProtoType>();
+ if (CPT->getExceptionSpecType() == EST_Delayed)
+ return false;
// TODO: check whether evaluating default arguments can throw.
// For now, we'll be conservative and assume that they can throw.
return CPT->isNothrow(Self.Context) && CPT->getNumArgs() == 0;
@@ -2852,7 +2909,7 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, BinaryTypeTrait BTT,
Sema::SFINAETrap SFINAE(Self, /*AccessCheckingSFINAE=*/true);
Sema::ContextRAII TUContext(Self, Self.Context.getTranslationUnitDecl());
InitializationSequence Init(Self, To, Kind, &FromPtr, 1);
- if (Init.getKind() == InitializationSequence::FailedSequence)
+ if (Init.Failed())
return false;
ExprResult Result = Init.Perform(Self, To, Kind, MultiExprArg(&FromPtr, 1));
@@ -3213,7 +3270,7 @@ static bool TryClassUnification(Sema &Self, Expr *From, Expr *To,
if (TTy.isAtLeastAsQualifiedAs(FTy)) {
InitializedEntity Entity = InitializedEntity::InitializeTemporary(TTy);
InitializationSequence InitSeq(Self, Entity, Kind, &From, 1);
- if (InitSeq.getKind() != InitializationSequence::FailedSequence) {
+ if (InitSeq) {
HaveConversion = true;
return false;
}
@@ -3238,7 +3295,7 @@ static bool TryClassUnification(Sema &Self, Expr *From, Expr *To,
InitializedEntity Entity = InitializedEntity::InitializeTemporary(TTy);
InitializationSequence InitSeq(Self, Entity, Kind, &From, 1);
- HaveConversion = InitSeq.getKind() != InitializationSequence::FailedSequence;
+ HaveConversion = !InitSeq.Failed();
ToType = TTy;
if (InitSeq.isAmbiguous())
return InitSeq.Diagnose(Self, Entity, Kind, &From, 1);
@@ -4295,3 +4352,18 @@ StmtResult Sema::ActOnFinishFullStmt(Stmt *FullStmt) {
return MaybeCreateStmtWithCleanups(FullStmt);
}
+
+bool Sema::CheckMicrosoftIfExistsSymbol(CXXScopeSpec &SS,
+ UnqualifiedId &Name) {
+ DeclarationNameInfo TargetNameInfo = GetNameFromUnqualifiedId(Name);
+ DeclarationName TargetName = TargetNameInfo.getName();
+ if (!TargetName)
+ return false;
+
+ // Do the redeclaration lookup in the current scope.
+ LookupResult R(*this, TargetNameInfo, Sema::LookupAnyName,
+ Sema::NotForRedeclaration);
+ R.suppressDiagnostics();
+ LookupParsedName(R, getCurScope(), &SS);
+ return !R.empty();
+}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp
index 2a262f0..cb5c1e0 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp
@@ -119,7 +119,7 @@ ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs,
return new (Context) ObjCStringLiteral(S, Ty, AtLocs[0]);
}
-Expr *Sema::BuildObjCEncodeExpression(SourceLocation AtLoc,
+ExprResult Sema::BuildObjCEncodeExpression(SourceLocation AtLoc,
TypeSourceInfo *EncodedTypeInfo,
SourceLocation RParenLoc) {
QualType EncodedType = EncodedTypeInfo->getType();
@@ -127,6 +127,12 @@ Expr *Sema::BuildObjCEncodeExpression(SourceLocation AtLoc,
if (EncodedType->isDependentType())
StrTy = Context.DependentTy;
else {
+ if (!EncodedType->getAsArrayTypeUnsafe()) // Incomplete array is handled.
+ if (RequireCompleteType(AtLoc, EncodedType,
+ PDiag(diag::err_incomplete_type_objc_at_encode)
+ << EncodedTypeInfo->getTypeLoc().getSourceRange()))
+ return ExprError();
+
std::string Str;
Context.getObjCEncodingForType(EncodedType, Str);
@@ -235,10 +241,72 @@ ObjCMethodDecl *Sema::tryCaptureObjCSelf() {
return method;
}
+QualType Sema::getMessageSendResultType(QualType ReceiverType,
+ ObjCMethodDecl *Method,
+ bool isClassMessage, bool isSuperMessage) {
+ assert(Method && "Must have a method");
+ if (!Method->hasRelatedResultType())
+ return Method->getSendResultType();
+
+ // If a method has a related return type:
+ // - if the method found is an instance method, but the message send
+ // was a class message send, T is the declared return type of the method
+ // found
+ if (Method->isInstanceMethod() && isClassMessage)
+ return Method->getSendResultType();
+
+ // - if the receiver is super, T is a pointer to the class of the
+ // enclosing method definition
+ if (isSuperMessage) {
+ if (ObjCMethodDecl *CurMethod = getCurMethodDecl())
+ if (ObjCInterfaceDecl *Class = CurMethod->getClassInterface())
+ return Context.getObjCObjectPointerType(
+ Context.getObjCInterfaceType(Class));
+ }
+
+ // - if the receiver is the name of a class U, T is a pointer to U
+ if (ReceiverType->getAs<ObjCInterfaceType>() ||
+ ReceiverType->isObjCQualifiedInterfaceType())
+ return Context.getObjCObjectPointerType(ReceiverType);
+ // - if the receiver is of type Class or qualified Class type,
+ // T is the declared return type of the method.
+ if (ReceiverType->isObjCClassType() ||
+ ReceiverType->isObjCQualifiedClassType())
+ return Method->getSendResultType();
+
+ // - if the receiver is id, qualified id, Class, or qualified Class, T
+ // is the receiver type, otherwise
+ // - T is the type of the receiver expression.
+ return ReceiverType;
+}
+
+void Sema::EmitRelatedResultTypeNote(const Expr *E) {
+ E = E->IgnoreParenImpCasts();
+ const ObjCMessageExpr *MsgSend = dyn_cast<ObjCMessageExpr>(E);
+ if (!MsgSend)
+ return;
+
+ const ObjCMethodDecl *Method = MsgSend->getMethodDecl();
+ if (!Method)
+ return;
+
+ if (!Method->hasRelatedResultType())
+ return;
+
+ if (Context.hasSameUnqualifiedType(Method->getResultType()
+ .getNonReferenceType(),
+ MsgSend->getType()))
+ return;
+
+ Diag(Method->getLocation(), diag::note_related_result_type_inferred)
+ << Method->isInstanceMethod() << Method->getSelector()
+ << MsgSend->getType();
+}
-bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs,
+bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
+ Expr **Args, unsigned NumArgs,
Selector Sel, ObjCMethodDecl *Method,
- bool isClassMessage,
+ bool isClassMessage, bool isSuperMessage,
SourceLocation lbrac, SourceLocation rbrac,
QualType &ReturnType, ExprValueKind &VK) {
if (!Method) {
@@ -262,7 +330,8 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs,
return false;
}
- ReturnType = Method->getSendResultType();
+ ReturnType = getMessageSendResultType(ReceiverType, Method, isClassMessage,
+ isSuperMessage);
VK = Expr::getValueKindForType(Method->getResultType());
unsigned NumNamedArgs = Sel.getNumArgs();
@@ -450,9 +519,12 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
ResTy = ResTy.getNonLValueExprType(Context);
Selector Sel = PP.getSelectorTable().getNullarySelector(Member);
ObjCMethodDecl *Getter = IFace->lookupInstanceMethod(Sel);
- if (DiagnosePropertyAccessorMismatch(PD, Getter, MemberLoc))
- ResTy = Getter->getResultType();
-
+ if (Getter &&
+ (Getter->hasRelatedResultType()
+ || DiagnosePropertyAccessorMismatch(PD, Getter, MemberLoc)))
+ ResTy = getMessageSendResultType(QualType(OPT, 0), Getter, false,
+ Super);
+
if (Super)
return Owned(new (Context) ObjCPropertyRefExpr(PD, ResTy,
VK_LValue, OK_ObjCProperty,
@@ -470,14 +542,18 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
// Check whether we can reference this property.
if (DiagnoseUseOfDecl(PD, MemberLoc))
return ExprError();
+
+ QualType T = PD->getType();
+ if (ObjCMethodDecl *Getter = PD->getGetterMethodDecl())
+ T = getMessageSendResultType(QualType(OPT, 0), Getter, false, Super);
if (Super)
- return Owned(new (Context) ObjCPropertyRefExpr(PD, PD->getType(),
+ return Owned(new (Context) ObjCPropertyRefExpr(PD, T,
VK_LValue,
OK_ObjCProperty,
MemberLoc,
SuperLoc, SuperType));
else
- return Owned(new (Context) ObjCPropertyRefExpr(PD, PD->getType(),
+ return Owned(new (Context) ObjCPropertyRefExpr(PD, T,
VK_LValue,
OK_ObjCProperty,
MemberLoc,
@@ -534,7 +610,7 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
if (Getter || Setter) {
QualType PType;
if (Getter)
- PType = Getter->getSendResultType();
+ PType = getMessageSendResultType(QualType(OPT, 0), Getter, false, Super);
else {
ParmVarDecl *ArgDecl = *Setter->param_begin();
PType = ArgDecl->getType();
@@ -608,10 +684,14 @@ ActOnClassPropertyRefExpr(IdentifierInfo &receiverName,
IdentifierInfo *receiverNamePtr = &receiverName;
ObjCInterfaceDecl *IFace = getObjCInterfaceDecl(receiverNamePtr,
receiverNameLoc);
+
+ bool IsSuper = false;
if (IFace == 0) {
// If the "receiver" is 'super' in a method, handle it as an expression-like
// property reference.
if (receiverNamePtr->isStr("super")) {
+ IsSuper = true;
+
if (ObjCMethodDecl *CurMethod = tryCaptureObjCSelf()) {
if (CurMethod->isInstanceMethod()) {
QualType T =
@@ -680,7 +760,9 @@ ActOnClassPropertyRefExpr(IdentifierInfo &receiverName,
ExprValueKind VK = VK_LValue;
if (Getter) {
- PType = Getter->getSendResultType();
+ PType = getMessageSendResultType(Context.getObjCInterfaceType(IFace),
+ Getter, true,
+ receiverNamePtr->isStr("super"));
if (!getLangOptions().CPlusPlus &&
!PType.hasQualifiers() && PType->isVoidType())
VK = VK_RValue;
@@ -693,6 +775,13 @@ ActOnClassPropertyRefExpr(IdentifierInfo &receiverName,
ExprObjectKind OK = (VK == VK_RValue ? OK_Ordinary : OK_ObjCProperty);
+ if (IsSuper)
+ return Owned(new (Context) ObjCPropertyRefExpr(Getter, Setter,
+ PType, VK, OK,
+ propertyNameLoc,
+ receiverNameLoc,
+ Context.getObjCInterfaceType(IFace)));
+
return Owned(new (Context) ObjCPropertyRefExpr(Getter, Setter,
PType, VK, OK,
propertyNameLoc,
@@ -949,8 +1038,9 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
unsigned NumArgs = ArgsIn.size();
Expr **Args = reinterpret_cast<Expr **>(ArgsIn.release());
- if (CheckMessageArgumentTypes(Args, NumArgs, Sel, Method, true,
- LBracLoc, RBracLoc, ReturnType, VK))
+ if (CheckMessageArgumentTypes(ReceiverType, Args, NumArgs, Sel, Method, true,
+ SuperLoc.isValid(), LBracLoc, RBracLoc,
+ ReturnType, VK))
return ExprError();
if (Method && !Method->getResultType()->isVoidType() &&
@@ -1232,7 +1322,8 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
ExprValueKind VK = VK_RValue;
bool ClassMessage = (ReceiverType->isObjCClassType() ||
ReceiverType->isObjCQualifiedClassType());
- if (CheckMessageArgumentTypes(Args, NumArgs, Sel, Method, ClassMessage,
+ if (CheckMessageArgumentTypes(ReceiverType, Args, NumArgs, Sel, Method,
+ ClassMessage, SuperLoc.isValid(),
LBracLoc, RBracLoc, ReturnType, VK))
return ExprError();
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp
index ca3fd6d..a33f5d0 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp
@@ -296,8 +296,7 @@ void InitListChecker::FillInValueInitForField(unsigned Init, FieldDecl *Field,
// Do nothing
} else if (Init < NumInits) {
ILE->setInit(Init, MemberInit.takeAs<Expr>());
- } else if (InitSeq.getKind()
- == InitializationSequence::ConstructorInitialization) {
+ } else if (InitSeq.isConstructorInitialization()) {
// Value-initialization requires a constructor call, so
// extend the initializer list to include the constructor
// call and make a note that we'll need to take another pass
@@ -418,8 +417,7 @@ InitListChecker::FillInValueInitializations(const InitializedEntity &Entity,
return;
}
- if (InitSeq.getKind()
- == InitializationSequence::ConstructorInitialization) {
+ if (InitSeq.isConstructorInitialization()) {
// Value-initialization requires a constructor call, so
// extend the initializer list to include the constructor
// call and make a note that we'll need to take another pass
@@ -2137,7 +2135,7 @@ bool InitializationSequence::isDirectReferenceBinding() const {
}
bool InitializationSequence::isAmbiguous() const {
- if (getKind() != FailedSequence)
+ if (!Failed())
return false;
switch (getFailureKind()) {
@@ -2310,7 +2308,7 @@ void InitializationSequence::AddArrayInitStep(QualType T) {
void InitializationSequence::SetOverloadFailure(FailureKind Failure,
OverloadingResult Result) {
- SequenceKind = FailedSequence;
+ setSequenceKind(FailedSequence);
this->Failure = Failure;
this->FailedOverloadResult = Result;
}
@@ -2331,7 +2329,6 @@ static void TryListInitialization(Sema &S,
// well-formed. When we actually "perform" list initialization, we'll
// do all of the necessary checking. C++0x initializer lists will
// force us to perform more checking here.
- Sequence.setSequenceKind(InitializationSequence::ListInitialization);
QualType DestType = Entity.getType();
@@ -2800,7 +2797,6 @@ static void TryStringLiteralInitialization(Sema &S,
const InitializationKind &Kind,
Expr *Initializer,
InitializationSequence &Sequence) {
- Sequence.setSequenceKind(InitializationSequence::StringInit);
Sequence.AddStringInitStep(Entity.getType());
}
@@ -2813,8 +2809,6 @@ static void TryConstructorInitialization(Sema &S,
Expr **Args, unsigned NumArgs,
QualType DestType,
InitializationSequence &Sequence) {
- Sequence.setSequenceKind(InitializationSequence::ConstructorInitialization);
-
// Build the candidate set directly in the initialization sequence
// structure, so that it will persist if we fail.
OverloadCandidateSet &CandidateSet = Sequence.getFailedCandidateSet();
@@ -2947,7 +2941,6 @@ static void TryValueInitialization(Sema &S,
}
Sequence.AddZeroInitializationStep(Entity.getType());
- Sequence.setSequenceKind(InitializationSequence::ZeroInitialization);
}
/// \brief Attempt default initialization (C++ [dcl.init]p6).
@@ -2973,7 +2966,6 @@ static void TryDefaultInitialization(Sema &S,
}
// - otherwise, no initialization is performed.
- Sequence.setSequenceKind(InitializationSequence::NoInitialization);
// If a program calls for the default initialization of an object of
// a const-qualified type T, T shall be a class type with a user-provided
@@ -2990,8 +2982,6 @@ static void TryUserDefinedConversion(Sema &S,
const InitializationKind &Kind,
Expr *Initializer,
InitializationSequence &Sequence) {
- Sequence.setSequenceKind(InitializationSequence::UserDefinedConversion);
-
QualType DestType = Entity.getType();
assert(!DestType->isReferenceType() && "References are handled elsewhere");
QualType SourceType = Initializer->getType();
@@ -3176,6 +3166,9 @@ InitializationSequence::InitializationSequence(Sema &S,
return;
}
+ // Almost everything is a normal sequence.
+ setSequenceKind(NormalSequence);
+
for (unsigned I = 0; I != NumArgs; ++I)
if (Args[I]->getObjectKind() == OK_ObjCProperty) {
ExprResult Result = S.ConvertPropertyForRValue(Args[I]);
@@ -3252,7 +3245,6 @@ InitializationSequence::InitializationSequence(Sema &S,
else if (Initializer->HasSideEffects(S.Context))
SetFailed(FK_NonConstantArrayInit);
else {
- setSequenceKind(ArrayInit);
AddArrayInitStep(DestType);
}
} else if (DestAT->getElementType()->isAnyCharacterType())
@@ -3265,7 +3257,6 @@ InitializationSequence::InitializationSequence(Sema &S,
// Handle initialization in C
if (!S.getLangOptions().CPlusPlus) {
- setSequenceKind(CAssignment);
AddCAssignmentStep(DestType);
return;
}
@@ -3325,8 +3316,6 @@ InitializationSequence::InitializationSequence(Sema &S,
else
SetFailed(InitializationSequence::FK_ConversionFailed);
}
- else
- setSequenceKind(StandardConversion);
}
InitializationSequence::~InitializationSequence() {
@@ -3650,13 +3639,13 @@ InitializationSequence::Perform(Sema &S,
const InitializationKind &Kind,
MultiExprArg Args,
QualType *ResultType) {
- if (SequenceKind == FailedSequence) {
+ if (Failed()) {
unsigned NumArgs = Args.size();
Diagnose(S, Entity, Kind, (Expr **)Args.release(), NumArgs);
return ExprError();
}
- if (SequenceKind == DependentSequence) {
+ if (getKind() == DependentSequence) {
// If the declaration is a non-dependent, incomplete array type
// that has an initializer, then its type will be completed once
// the initializer is instantiated.
@@ -3710,7 +3699,8 @@ InitializationSequence::Perform(Sema &S,
SourceLocation()));
}
- if (SequenceKind == NoInitialization)
+ // No steps means no initialization.
+ if (Steps.empty())
return S.Owned((Expr *)0);
QualType DestType = Entity.getType().getNonReferenceType();
@@ -3723,8 +3713,6 @@ InitializationSequence::Perform(Sema &S,
ExprResult CurInit = S.Owned((Expr *)0);
- assert(!Steps.empty() && "Cannot have an empty initialization sequence");
-
// For initialization steps that start with a single initializer,
// grab the only argument out the Args and place it into the "current"
// initializer.
@@ -4019,8 +4007,9 @@ InitializationSequence::Perform(Sema &S,
// the definition for completely trivial constructors.
CXXRecordDecl *ClassDecl = Constructor->getParent();
assert(ClassDecl && "No parent class for constructor.");
- if (Constructor->isImplicit() && Constructor->isDefaultConstructor() &&
- ClassDecl->hasTrivialConstructor() && !Constructor->isUsed(false))
+ if (Constructor->isDefaulted() && Constructor->isDefaultConstructor() &&
+ ClassDecl->hasTrivialDefaultConstructor() &&
+ !Constructor->isUsed(false))
S.DefineImplicitDefaultConstructor(Loc, Constructor);
}
@@ -4060,8 +4049,7 @@ InitializationSequence::Perform(Sema &S,
ConstructKind = Entity.getBaseSpecifier()->isVirtual() ?
CXXConstructExpr::CK_VirtualBase :
CXXConstructExpr::CK_NonVirtualBase;
- }
- if (Entity.getKind() == InitializedEntity::EK_Delegating) {
+ } else if (Entity.getKind() == InitializedEntity::EK_Delegating) {
ConstructKind = CXXConstructExpr::CK_Delegating;
}
@@ -4216,7 +4204,7 @@ bool InitializationSequence::Diagnose(Sema &S,
const InitializedEntity &Entity,
const InitializationKind &Kind,
Expr **Args, unsigned NumArgs) {
- if (SequenceKind != FailedSequence)
+ if (!Failed())
return false;
QualType DestType = Entity.getType();
@@ -4334,6 +4322,9 @@ bool InitializationSequence::Diagnose(Sema &S,
<< Args[0]->isLValue()
<< Args[0]->getType()
<< Args[0]->getSourceRange();
+ if (DestType.getNonReferenceType()->isObjCObjectPointerType() &&
+ Args[0]->getType()->isObjCObjectPointerType())
+ S.EmitRelatedResultTypeNote(Args[0]);
break;
case FK_ConversionFailed: {
@@ -4344,6 +4335,9 @@ bool InitializationSequence::Diagnose(Sema &S,
<< Args[0]->isLValue()
<< FromType
<< Args[0]->getSourceRange();
+ if (DestType.getNonReferenceType()->isObjCObjectPointerType() &&
+ Args[0]->getType()->isObjCObjectPointerType())
+ S.EmitRelatedResultTypeNote(Args[0]);
break;
}
@@ -4587,48 +4581,16 @@ void InitializationSequence::dump(llvm::raw_ostream &OS) const {
}
case DependentSequence:
- OS << "Dependent sequence: ";
+ OS << "Dependent sequence\n";
return;
- case UserDefinedConversion:
- OS << "User-defined conversion sequence: ";
- break;
-
- case ConstructorInitialization:
- OS << "Constructor initialization sequence: ";
+ case NormalSequence:
+ OS << "Normal sequence: ";
break;
case ReferenceBinding:
OS << "Reference binding: ";
break;
-
- case ListInitialization:
- OS << "List initialization: ";
- break;
-
- case ZeroInitialization:
- OS << "Zero initialization\n";
- return;
-
- case NoInitialization:
- OS << "No initialization\n";
- return;
-
- case StandardConversion:
- OS << "Standard conversion: ";
- break;
-
- case CAssignment:
- OS << "C assignment: ";
- break;
-
- case StringInit:
- OS << "String initialization: ";
- break;
-
- case ArrayInit:
- OS << "Array initialization: ";
- break;
}
for (step_iterator S = step_begin(), SEnd = step_end(); S != SEnd; ++S) {
@@ -4723,6 +4685,21 @@ void InitializationSequence::dump() const {
//===----------------------------------------------------------------------===//
// Initialization helper functions
//===----------------------------------------------------------------------===//
+bool
+Sema::CanPerformCopyInitialization(const InitializedEntity &Entity,
+ ExprResult Init) {
+ if (Init.isInvalid())
+ return false;
+
+ Expr *InitE = Init.get();
+ assert(InitE && "No initialization expression");
+
+ InitializationKind Kind = InitializationKind::CreateCopy(SourceLocation(),
+ SourceLocation());
+ InitializationSequence Seq(*this, Entity, Kind, &InitE, 1);
+ return !Seq.Failed();
+}
+
ExprResult
Sema::PerformCopyInitialization(const InitializedEntity &Entity,
SourceLocation EqualLoc,
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp
index 309c771..92ade1e 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp
@@ -14,6 +14,7 @@
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/Lookup.h"
+#include "clang/Sema/Overload.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
@@ -534,7 +535,7 @@ void Sema::ForceDeclarationOfImplicitMembers(CXXRecordDecl *Class) {
return;
// If the default constructor has not yet been declared, do so now.
- if (!Class->hasDeclaredDefaultConstructor())
+ if (Class->needsImplicitDefaultConstructor())
DeclareImplicitDefaultConstructor(Class);
// If the copy constructor has not yet been declared, do so now.
@@ -581,7 +582,7 @@ static void DeclareImplicitMemberFunctionsWithName(Sema &S,
if (const CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(DC))
if (Record->getDefinition() &&
CanDeclareSpecialMemberFunction(S.Context, Record)) {
- if (!Record->hasDeclaredDefaultConstructor())
+ if (Record->needsImplicitDefaultConstructor())
S.DeclareImplicitDefaultConstructor(
const_cast<CXXRecordDecl *>(Record));
if (!Record->hasDeclaredCopyConstructor())
@@ -2136,11 +2137,200 @@ void Sema::LookupOverloadedOperatorName(OverloadedOperatorKind Op, Scope *S,
}
}
+Sema::SpecialMemberOverloadResult *Sema::LookupSpecialMember(CXXRecordDecl *D,
+ CXXSpecialMember SM,
+ bool ConstArg,
+ bool VolatileArg,
+ bool RValueThis,
+ bool ConstThis,
+ bool VolatileThis) {
+ D = D->getDefinition();
+ assert((D && !D->isBeingDefined()) &&
+ "doing special member lookup into record that isn't fully complete");
+ if (RValueThis || ConstThis || VolatileThis)
+ assert((SM == CXXCopyAssignment || SM == CXXMoveAssignment) &&
+ "constructors and destructors always have unqualified lvalue this");
+ if (ConstArg || VolatileArg)
+ assert((SM != CXXDefaultConstructor && SM != CXXDestructor) &&
+ "parameter-less special members can't have qualified arguments");
+
+ llvm::FoldingSetNodeID ID;
+ ID.AddPointer(D);
+ ID.AddInteger(SM);
+ ID.AddInteger(ConstArg);
+ ID.AddInteger(VolatileArg);
+ ID.AddInteger(RValueThis);
+ ID.AddInteger(ConstThis);
+ ID.AddInteger(VolatileThis);
+
+ void *InsertPoint;
+ SpecialMemberOverloadResult *Result =
+ SpecialMemberCache.FindNodeOrInsertPos(ID, InsertPoint);
+
+ // This was already cached
+ if (Result)
+ return Result;
+
+ Result = BumpAlloc.Allocate<SpecialMemberOverloadResult>();
+ Result = new (Result) SpecialMemberOverloadResult(ID);
+ SpecialMemberCache.InsertNode(Result, InsertPoint);
+
+ if (SM == CXXDestructor) {
+ if (!D->hasDeclaredDestructor())
+ DeclareImplicitDestructor(D);
+ CXXDestructorDecl *DD = D->getDestructor();
+ assert(DD && "record without a destructor");
+ Result->setMethod(DD);
+ Result->setSuccess(DD->isDeleted());
+ Result->setConstParamMatch(false);
+ return Result;
+ }
+
+ // Prepare for overload resolution. Here we construct a synthetic argument
+ // if necessary and make sure that implicit functions are declared.
+ CanQualType CanTy = Context.getCanonicalType(Context.getTagDeclType(D));
+ DeclarationName Name;
+ Expr *Arg = 0;
+ unsigned NumArgs;
+
+ if (SM == CXXDefaultConstructor) {
+ Name = Context.DeclarationNames.getCXXConstructorName(CanTy);
+ NumArgs = 0;
+ if (D->needsImplicitDefaultConstructor())
+ DeclareImplicitDefaultConstructor(D);
+ } else {
+ if (SM == CXXCopyConstructor || SM == CXXMoveConstructor) {
+ Name = Context.DeclarationNames.getCXXConstructorName(CanTy);
+ if (!D->hasDeclaredCopyConstructor())
+ DeclareImplicitCopyConstructor(D);
+ // TODO: Move constructors
+ } else {
+ Name = Context.DeclarationNames.getCXXOperatorName(OO_Equal);
+ if (!D->hasDeclaredCopyAssignment())
+ DeclareImplicitCopyAssignment(D);
+ // TODO: Move assignment
+ }
+
+ QualType ArgType = CanTy;
+ if (ConstArg)
+ ArgType.addConst();
+ if (VolatileArg)
+ ArgType.addVolatile();
+
+ // This isn't /really/ specified by the standard, but it's implied
+ // we should be working from an RValue in the case of move to ensure
+ // that we prefer to bind to rvalue references, and an LValue in the
+ // case of copy to ensure we don't bind to rvalue references.
+ // Possibly an XValue is actually correct in the case of move, but
+ // there is no semantic difference for class types in this restricted
+ // case.
+ ExprValueKind VK;
+ if (SM == CXXCopyAssignment || SM == CXXMoveAssignment)
+ VK = VK_LValue;
+ else
+ VK = VK_RValue;
+
+ NumArgs = 1;
+ Arg = new (Context) OpaqueValueExpr(SourceLocation(), ArgType, VK);
+ }
+
+ // Create the object argument
+ QualType ThisTy = CanTy;
+ if (ConstThis)
+ ThisTy.addConst();
+ if (VolatileThis)
+ ThisTy.addVolatile();
+ Expr::Classification ObjectClassification =
+ (new (Context) OpaqueValueExpr(SourceLocation(), ThisTy,
+ RValueThis ? VK_RValue : VK_LValue))->
+ Classify(Context);
+
+ // Now we perform lookup on the name we computed earlier and do overload
+ // resolution. Lookup is only performed directly into the class since there
+ // will always be a (possibly implicit) declaration to shadow any others.
+ OverloadCandidateSet OCS((SourceLocation()));
+ DeclContext::lookup_iterator I, E;
+ Result->setConstParamMatch(false);
+
+ llvm::tie(I, E) = D->lookup(Name);
+ assert((I != E) &&
+ "lookup for a constructor or assignment operator was empty");
+ for ( ; I != E; ++I) {
+ if ((*I)->isInvalidDecl())
+ continue;
+
+ if (CXXMethodDecl *M = dyn_cast<CXXMethodDecl>(*I)) {
+ AddOverloadCandidate(M, DeclAccessPair::make(M, AS_public), &Arg, NumArgs,
+ OCS, true);
+
+ // Here we're looking for a const parameter to speed up creation of
+ // implicit copy methods.
+ if ((SM == CXXCopyAssignment && M->isCopyAssignmentOperator()) ||
+ (SM == CXXCopyConstructor &&
+ cast<CXXConstructorDecl>(M)->isCopyConstructor())) {
+ QualType ArgType = M->getType()->getAs<FunctionProtoType>()->getArgType(0);
+ if (ArgType->getPointeeType().isConstQualified())
+ Result->setConstParamMatch(true);
+ }
+ } else {
+ FunctionTemplateDecl *Tmpl = cast<FunctionTemplateDecl>(*I);
+ AddTemplateOverloadCandidate(Tmpl, DeclAccessPair::make(Tmpl, AS_public),
+ 0, &Arg, NumArgs, OCS, true);
+ }
+ }
+
+ OverloadCandidateSet::iterator Best;
+ switch (OCS.BestViableFunction(*this, SourceLocation(), Best)) {
+ case OR_Success:
+ Result->setMethod(cast<CXXMethodDecl>(Best->Function));
+ Result->setSuccess(true);
+ break;
+
+ case OR_Deleted:
+ Result->setMethod(cast<CXXMethodDecl>(Best->Function));
+ Result->setSuccess(false);
+ break;
+
+ case OR_Ambiguous:
+ case OR_No_Viable_Function:
+ Result->setMethod(0);
+ Result->setSuccess(false);
+ break;
+ }
+
+ return Result;
+}
+
+/// \brief Look up the default constructor for the given class.
+CXXConstructorDecl *Sema::LookupDefaultConstructor(CXXRecordDecl *Class) {
+ SpecialMemberOverloadResult *Result =
+ LookupSpecialMember(Class, CXXDefaultConstructor, false, false, false,
+ false, false);
+
+ return cast_or_null<CXXConstructorDecl>(Result->getMethod());
+}
+
+/// \brief Look up the copy constructor for the given class.
+CXXConstructorDecl *Sema::LookupCopyConstructor(CXXRecordDecl *Class,
+ unsigned Quals,
+ bool *ConstParamMatch) {
+ assert(!(Quals & ~(Qualifiers::Const | Qualifiers::Volatile)) &&
+ "non-const, non-volatile qualifiers for copy ctor arg");
+ SpecialMemberOverloadResult *Result =
+ LookupSpecialMember(Class, CXXCopyConstructor, Quals & Qualifiers::Const,
+ Quals & Qualifiers::Volatile, false, false, false);
+
+ if (ConstParamMatch)
+ *ConstParamMatch = Result->hasConstParamMatch();
+
+ return cast_or_null<CXXConstructorDecl>(Result->getMethod());
+}
+
/// \brief Look up the constructors for the given class.
DeclContext::lookup_result Sema::LookupConstructors(CXXRecordDecl *Class) {
- // If the copy constructor has not yet been declared, do so now.
+ // If the implicit constructors have not yet been declared, do so now.
if (CanDeclareSpecialMemberFunction(Context, Class)) {
- if (!Class->hasDeclaredDefaultConstructor())
+ if (Class->needsImplicitDefaultConstructor())
DeclareImplicitDefaultConstructor(Class);
if (!Class->hasDeclaredCopyConstructor())
DeclareImplicitCopyConstructor(Class);
@@ -2158,12 +2348,9 @@ DeclContext::lookup_result Sema::LookupConstructors(CXXRecordDecl *Class) {
///
/// \returns The destructor for this class.
CXXDestructorDecl *Sema::LookupDestructor(CXXRecordDecl *Class) {
- // If the destructor has not yet been declared, do so now.
- if (CanDeclareSpecialMemberFunction(Context, Class) &&
- !Class->hasDeclaredDestructor())
- DeclareImplicitDestructor(Class);
-
- return Class->getDestructor();
+ return cast<CXXDestructorDecl>(LookupSpecialMember(Class, CXXDestructor,
+ false, false, false,
+ false, false)->getMethod());
}
void ADLResult::insert(NamedDecl *New) {
@@ -2410,8 +2597,8 @@ VisibleDeclsRecord::ShadowMapEntry::end() {
if (DeclOrVector.isNull())
return 0;
- if (DeclOrVector.dyn_cast<NamedDecl *>())
- return &reinterpret_cast<NamedDecl*&>(DeclOrVector) + 1;
+ if (DeclOrVector.is<NamedDecl *>())
+ return DeclOrVector.getAddrOf<NamedDecl *>() + 1;
return DeclOrVector.get<DeclVector *>()->end();
}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp
index 3f3ed0e..4bba6f8 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp
@@ -1628,6 +1628,15 @@ bool Sema::IsPointerConversion(Expr *From, QualType FromType, QualType ToType,
return true;
}
+ // MSVC allows implicit function to void* type conversion.
+ if (getLangOptions().Microsoft && FromPointeeType->isFunctionType() &&
+ ToPointeeType->isVoidType()) {
+ ConvertedType = BuildSimilarlyQualifiedPointerType(FromTypePtr,
+ ToPointeeType,
+ ToType, Context);
+ return true;
+ }
+
// When we're overloading in C, we allow a special kind of pointer
// conversion for compatible-but-not-identical pointee types.
if (!getLangOptions().CPlusPlus &&
@@ -2197,6 +2206,13 @@ Sema::IsQualificationConversion(QualType FromType, QualType ToType,
Qualifiers FromQuals = FromType.getQualifiers();
Qualifiers ToQuals = ToType.getQualifiers();
+ // Allow addition/removal of GC attributes but not changing GC attributes.
+ if (FromQuals.getObjCGCAttr() != ToQuals.getObjCGCAttr() &&
+ (!FromQuals.hasObjCGCAttr() || !ToQuals.hasObjCGCAttr())) {
+ FromQuals.removeObjCGCAttr();
+ ToQuals.removeObjCGCAttr();
+ }
+
// -- for every j > 0, if const is in cv 1,j then const is in cv
// 2,j, and similarly for volatile.
if (!CStyle && !ToQuals.compatiblyIncludes(FromQuals))
@@ -2507,12 +2523,10 @@ compareStandardConversionSubsets(ASTContext &Context,
// the identity conversion sequence is considered to be a subsequence of
// any non-identity conversion sequence
- if (SCS1.ReferenceBinding == SCS2.ReferenceBinding) {
- if (SCS1.isIdentityConversion() && !SCS2.isIdentityConversion())
- return ImplicitConversionSequence::Better;
- else if (!SCS1.isIdentityConversion() && SCS2.isIdentityConversion())
- return ImplicitConversionSequence::Worse;
- }
+ if (SCS1.isIdentityConversion() && !SCS2.isIdentityConversion())
+ return ImplicitConversionSequence::Better;
+ else if (!SCS1.isIdentityConversion() && SCS2.isIdentityConversion())
+ return ImplicitConversionSequence::Worse;
if (SCS1.Second != SCS2.Second) {
if (SCS1.Second == ICK_Identity)
@@ -4689,6 +4703,10 @@ class BuiltinCandidateTypeSet {
/// were present in the candidate set.
bool HasArithmeticOrEnumeralTypes;
+ /// \brief A flag indicating whether the nullptr type was present in the
+ /// candidate set.
+ bool HasNullPtrType;
+
/// Sema - The semantic analysis instance where we are building the
/// candidate type set.
Sema &SemaRef;
@@ -4707,6 +4725,7 @@ public:
BuiltinCandidateTypeSet(Sema &SemaRef)
: HasNonRecordTypes(false),
HasArithmeticOrEnumeralTypes(false),
+ HasNullPtrType(false),
SemaRef(SemaRef),
Context(SemaRef.Context) { }
@@ -4739,6 +4758,7 @@ public:
bool hasNonRecordTypes() { return HasNonRecordTypes; }
bool hasArithmeticOrEnumeralTypes() { return HasArithmeticOrEnumeralTypes; }
+ bool hasNullPtrType() const { return HasNullPtrType; }
};
/// AddPointerWithMoreQualifiedTypeVariants - Add the pointer type @p Ty to
@@ -4899,6 +4919,8 @@ BuiltinCandidateTypeSet::AddTypesConvertedFrom(QualType Ty,
// extension.
HasArithmeticOrEnumeralTypes = true;
VectorTypes.insert(Ty);
+ } else if (Ty->isNullPtrType()) {
+ HasNullPtrType = true;
} else if (AllowUserConversions && TyRec) {
// No conversion functions in incomplete types.
if (SemaRef.RequireCompleteType(Loc, Ty, 0))
@@ -5358,8 +5380,8 @@ public:
// C++ [over.built]p15:
//
- // For every pointer or enumeration type T, there exist
- // candidate operator functions of the form
+ // For every T, where T is an enumeration type, a pointer type, or
+ // std::nullptr_t, there exist candidate operator functions of the form
//
// bool operator<(T, T);
// bool operator>(T, T);
@@ -5444,6 +5466,17 @@ public:
S.AddBuiltinCandidate(S.Context.BoolTy, ParamTypes, Args, 2,
CandidateSet);
}
+
+ if (CandidateTypes[ArgIdx].hasNullPtrType()) {
+ CanQualType NullPtrTy = S.Context.getCanonicalType(S.Context.NullPtrTy);
+ if (AddedTypes.insert(NullPtrTy) &&
+ !UserDefinedBinaryOperators.count(std::make_pair(NullPtrTy,
+ NullPtrTy))) {
+ QualType ParamTypes[2] = { NullPtrTy, NullPtrTy };
+ S.AddBuiltinCandidate(S.Context.BoolTy, ParamTypes, Args, 2,
+ CandidateSet);
+ }
+ }
}
}
@@ -6401,7 +6434,9 @@ enum OverloadCandidateKind {
oc_constructor_template,
oc_implicit_default_constructor,
oc_implicit_copy_constructor,
+ oc_implicit_move_constructor,
oc_implicit_copy_assignment,
+ oc_implicit_move_assignment,
oc_implicit_inherited_constructor
};
@@ -6423,8 +6458,15 @@ OverloadCandidateKind ClassifyOverloadCandidate(Sema &S,
if (Ctor->getInheritedConstructor())
return oc_implicit_inherited_constructor;
- return Ctor->isCopyConstructor() ? oc_implicit_copy_constructor
- : oc_implicit_default_constructor;
+ if (Ctor->isDefaultConstructor())
+ return oc_implicit_default_constructor;
+
+ if (Ctor->isMoveConstructor())
+ return oc_implicit_move_constructor;
+
+ assert(Ctor->isCopyConstructor() &&
+ "unexpected sort of implicit constructor");
+ return oc_implicit_copy_constructor;
}
if (CXXMethodDecl *Meth = dyn_cast<CXXMethodDecl>(Fn)) {
@@ -6433,6 +6475,9 @@ OverloadCandidateKind ClassifyOverloadCandidate(Sema &S,
if (!Meth->isImplicit())
return isTemplate ? oc_method_template : oc_method;
+ if (Meth->isMoveAssignmentOperator())
+ return oc_implicit_move_assignment;
+
assert(Meth->isCopyAssignmentOperator()
&& "implicit method is not copy assignment operator?");
return oc_implicit_copy_assignment;
@@ -6676,6 +6721,15 @@ void DiagnoseArityMismatch(Sema &S, OverloadCandidate *Cand,
unsigned MinParams = Fn->getMinRequiredArguments();
+ // With invalid overloaded operators, it's possible that we think we
+ // have an arity mismatch when it fact it looks like we have the
+ // right number of arguments, because only overloaded operators have
+ // the weird behavior of overloading member and non-member functions.
+ // Just don't report anything.
+ if (Fn->isInvalidDecl() &&
+ Fn->getDeclName().getNameKind() == DeclarationName::CXXOperatorName)
+ return;
+
// at least / at most / exactly
unsigned mode, modeCount;
if (NumFormalArgs < MinParams) {
@@ -7772,6 +7826,111 @@ void Sema::AddOverloadedCallCandidates(UnresolvedLookupExpr *ULE,
ULE->isStdAssociatedNamespace());
}
+/// Attempt to recover from an ill-formed use of a non-dependent name in a
+/// template, where the non-dependent name was declared after the template
+/// was defined. This is common in code written for a compilers which do not
+/// correctly implement two-stage name lookup.
+///
+/// Returns true if a viable candidate was found and a diagnostic was issued.
+static bool
+DiagnoseTwoPhaseLookup(Sema &SemaRef, SourceLocation FnLoc,
+ const CXXScopeSpec &SS, LookupResult &R,
+ TemplateArgumentListInfo *ExplicitTemplateArgs,
+ Expr **Args, unsigned NumArgs) {
+ if (SemaRef.ActiveTemplateInstantiations.empty() || !SS.isEmpty())
+ return false;
+
+ for (DeclContext *DC = SemaRef.CurContext; DC; DC = DC->getParent()) {
+ SemaRef.LookupQualifiedName(R, DC);
+
+ if (!R.empty()) {
+ R.suppressDiagnostics();
+
+ if (isa<CXXRecordDecl>(DC)) {
+ // Don't diagnose names we find in classes; we get much better
+ // diagnostics for these from DiagnoseEmptyLookup.
+ R.clear();
+ return false;
+ }
+
+ OverloadCandidateSet Candidates(FnLoc);
+ for (LookupResult::iterator I = R.begin(), E = R.end(); I != E; ++I)
+ AddOverloadedCallCandidate(SemaRef, I.getPair(),
+ ExplicitTemplateArgs, Args, NumArgs,
+ Candidates, false);
+
+ OverloadCandidateSet::iterator Best;
+ if (Candidates.BestViableFunction(SemaRef, FnLoc, Best) != OR_Success)
+ // No viable functions. Don't bother the user with notes for functions
+ // which don't work and shouldn't be found anyway.
+ return false;
+
+ // Find the namespaces where ADL would have looked, and suggest
+ // declaring the function there instead.
+ Sema::AssociatedNamespaceSet AssociatedNamespaces;
+ Sema::AssociatedClassSet AssociatedClasses;
+ SemaRef.FindAssociatedClassesAndNamespaces(Args, NumArgs,
+ AssociatedNamespaces,
+ AssociatedClasses);
+ // Never suggest declaring a function within namespace 'std'.
+ Sema::AssociatedNamespaceSet SuggestedNamespaces;
+ if (DeclContext *Std = SemaRef.getStdNamespace()) {
+ for (Sema::AssociatedNamespaceSet::iterator
+ it = AssociatedNamespaces.begin(),
+ end = AssociatedNamespaces.end(); it != end; ++it) {
+ if (!Std->Encloses(*it))
+ SuggestedNamespaces.insert(*it);
+ }
+ } else {
+ // Lacking the 'std::' namespace, use all of the associated namespaces.
+ SuggestedNamespaces = AssociatedNamespaces;
+ }
+
+ SemaRef.Diag(R.getNameLoc(), diag::err_not_found_by_two_phase_lookup)
+ << R.getLookupName();
+ if (SuggestedNamespaces.empty()) {
+ SemaRef.Diag(Best->Function->getLocation(),
+ diag::note_not_found_by_two_phase_lookup)
+ << R.getLookupName() << 0;
+ } else if (SuggestedNamespaces.size() == 1) {
+ SemaRef.Diag(Best->Function->getLocation(),
+ diag::note_not_found_by_two_phase_lookup)
+ << R.getLookupName() << 1 << *SuggestedNamespaces.begin();
+ } else {
+ // FIXME: It would be useful to list the associated namespaces here,
+ // but the diagnostics infrastructure doesn't provide a way to produce
+ // a localized representation of a list of items.
+ SemaRef.Diag(Best->Function->getLocation(),
+ diag::note_not_found_by_two_phase_lookup)
+ << R.getLookupName() << 2;
+ }
+
+ // Try to recover by calling this function.
+ return true;
+ }
+
+ R.clear();
+ }
+
+ return false;
+}
+
+/// Attempt to recover from ill-formed use of a non-dependent operator in a
+/// template, where the non-dependent operator was declared after the template
+/// was defined.
+///
+/// Returns true if a viable candidate was found and a diagnostic was issued.
+static bool
+DiagnoseTwoPhaseOperatorLookup(Sema &SemaRef, OverloadedOperatorKind Op,
+ SourceLocation OpLoc,
+ Expr **Args, unsigned NumArgs) {
+ DeclarationName OpName =
+ SemaRef.Context.DeclarationNames.getCXXOperatorName(Op);
+ LookupResult R(SemaRef, OpName, OpLoc, Sema::LookupOperatorName);
+ return DiagnoseTwoPhaseLookup(SemaRef, OpLoc, CXXScopeSpec(), R,
+ /*ExplicitTemplateArgs=*/0, Args, NumArgs);
+}
+
/// Attempts to recover from a call where no functions were found.
///
/// Returns true if new candidates were found.
@@ -7780,13 +7939,14 @@ BuildRecoveryCallExpr(Sema &SemaRef, Scope *S, Expr *Fn,
UnresolvedLookupExpr *ULE,
SourceLocation LParenLoc,
Expr **Args, unsigned NumArgs,
- SourceLocation RParenLoc) {
+ SourceLocation RParenLoc,
+ bool EmptyLookup) {
CXXScopeSpec SS;
SS.Adopt(ULE->getQualifierLoc());
TemplateArgumentListInfo TABuffer;
- const TemplateArgumentListInfo *ExplicitTemplateArgs = 0;
+ TemplateArgumentListInfo *ExplicitTemplateArgs = 0;
if (ULE->hasExplicitTemplateArgs()) {
ULE->copyTemplateArgumentsInto(TABuffer);
ExplicitTemplateArgs = &TABuffer;
@@ -7794,7 +7954,10 @@ BuildRecoveryCallExpr(Sema &SemaRef, Scope *S, Expr *Fn,
LookupResult R(SemaRef, ULE->getName(), ULE->getNameLoc(),
Sema::LookupOrdinaryName);
- if (SemaRef.DiagnoseEmptyLookup(S, SS, R, Sema::CTC_Expression))
+ if (!DiagnoseTwoPhaseLookup(SemaRef, Fn->getExprLoc(), SS, R,
+ ExplicitTemplateArgs, Args, NumArgs) &&
+ (!EmptyLookup ||
+ SemaRef.DiagnoseEmptyLookup(S, SS, R, Sema::CTC_Expression)))
return ExprError();
assert(!R.empty() && "lookup results empty despite recovery");
@@ -7814,7 +7977,7 @@ BuildRecoveryCallExpr(Sema &SemaRef, Scope *S, Expr *Fn,
return ExprError();
// This shouldn't cause an infinite loop because we're giving it
- // an expression with non-empty lookup results, which should never
+ // an expression with viable lookup results, which should never
// end up here.
return SemaRef.ActOnCallExpr(/*Scope*/ 0, NewFn.take(), LParenLoc,
MultiExprArg(Args, NumArgs), RParenLoc);
@@ -7860,11 +8023,11 @@ Sema::BuildOverloadedCallExpr(Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE,
AddOverloadedCallCandidates(ULE, Args, NumArgs, CandidateSet);
// If we found nothing, try to recover.
- // AddRecoveryCallCandidates diagnoses the error itself, so we just
- // bailout out if it fails.
+ // BuildRecoveryCallExpr diagnoses the error itself, so we just bail
+ // out if it fails.
if (CandidateSet.empty())
return BuildRecoveryCallExpr(*this, S, Fn, ULE, LParenLoc, Args, NumArgs,
- RParenLoc);
+ RParenLoc, /*EmptyLookup=*/true);
OverloadCandidateSet::iterator Best;
switch (CandidateSet.BestViableFunction(*this, Fn->getLocStart(), Best)) {
@@ -7879,12 +8042,21 @@ Sema::BuildOverloadedCallExpr(Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE,
ExecConfig);
}
- case OR_No_Viable_Function:
+ case OR_No_Viable_Function: {
+ // Try to recover by looking for viable functions which the user might
+ // have meant to call.
+ ExprResult Recovery = BuildRecoveryCallExpr(*this, S, Fn, ULE, LParenLoc,
+ Args, NumArgs, RParenLoc,
+ /*EmptyLookup=*/false);
+ if (!Recovery.isInvalid())
+ return Recovery;
+
Diag(Fn->getSourceRange().getBegin(),
diag::err_ovl_no_viable_function_in_call)
<< ULE->getName() << Fn->getSourceRange();
CandidateSet.NoteCandidates(*this, OCD_AllCandidates, Args, NumArgs);
break;
+ }
case OR_Ambiguous:
Diag(Fn->getSourceRange().getBegin(), diag::err_ovl_ambiguous_call)
@@ -8073,6 +8245,13 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, unsigned OpcIn,
}
case OR_No_Viable_Function:
+ // This is an erroneous use of an operator which can be overloaded by
+ // a non-member function. Check for non-member operators which were
+ // defined too late to be candidates.
+ if (DiagnoseTwoPhaseOperatorLookup(*this, Op, OpLoc, Args, NumArgs))
+ // FIXME: Recover by calling the found function.
+ return ExprError();
+
// No viable function; fall through to handling this as a
// built-in operator, which will produce an error message for us.
break;
@@ -8354,6 +8533,13 @@ Sema::CreateOverloadedBinOp(SourceLocation OpLoc,
<< BinaryOperator::getOpcodeStr(Opc)
<< Args[0]->getSourceRange() << Args[1]->getSourceRange();
} else {
+ // This is an erroneous use of an operator which can be overloaded by
+ // a non-member function. Check for non-member operators which were
+ // defined too late to be candidates.
+ if (DiagnoseTwoPhaseOperatorLookup(*this, Op, OpLoc, Args, 2))
+ // FIXME: Recover by calling the found function.
+ return ExprError();
+
// No viable function; try to create a built-in operation, which will
// produce an error. Then, show the non-viable candidates.
Result = CreateBuiltinBinOp(OpLoc, Opc, Args[0], Args[1]);
@@ -8772,6 +8958,19 @@ Sema::BuildCallToMemberFunction(Scope *S, Expr *MemExprE,
if (CheckFunctionCall(Method, TheCall))
return ExprError();
+ if ((isa<CXXConstructorDecl>(CurContext) ||
+ isa<CXXDestructorDecl>(CurContext)) &&
+ TheCall->getMethodDecl()->isPure()) {
+ const CXXMethodDecl *MD = TheCall->getMethodDecl();
+
+ if (isa<CXXThisExpr>(MemExpr->getBase()->IgnoreParenCasts()))
+ Diag(MemExpr->getLocStart(),
+ diag::warn_call_to_pure_virtual_member_function_from_ctor_dtor)
+ << MD->getDeclName() << isa<CXXDestructorDecl>(CurContext)
+ << MD->getParent()->getDeclName();
+
+ Diag(MD->getLocStart(), diag::note_previous_decl) << MD->getDeclName();
+ }
return MaybeBindToTemporary(TheCall);
}
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp
index 65cea7a..d7c0a54 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp
@@ -501,7 +501,8 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch,
= CondExpr->isTypeDependent() || CondExpr->isValueDependent();
unsigned CondWidth
= HasDependentValue ? 0 : Context.getIntWidth(CondTypeBeforePromotion);
- bool CondIsSigned = CondTypeBeforePromotion->isSignedIntegerType();
+ bool CondIsSigned
+ = CondTypeBeforePromotion->isSignedIntegerOrEnumerationType();
// Accumulate all of the case values in a vector so that we can sort them
// and detect duplicates. This vector contains the APInt for the case after
@@ -723,7 +724,8 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch,
// If switch has default case, then ignore it.
if (!CaseListIsErroneous && !HasConstantCond && ET) {
const EnumDecl *ED = ET->getDecl();
- typedef llvm::SmallVector<std::pair<llvm::APSInt, EnumConstantDecl*>, 64> EnumValsTy;
+ typedef llvm::SmallVector<std::pair<llvm::APSInt, EnumConstantDecl*>, 64>
+ EnumValsTy;
EnumValsTy EnumVals;
// Gather all enum values, set their type and sort them,
@@ -1252,7 +1254,8 @@ Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation ColonLoc,
ExprResult BoundExpr;
if (const ConstantArrayType *CAT = dyn_cast<ConstantArrayType>(UnqAT))
BoundExpr = Owned(IntegerLiteral::Create(Context, CAT->getSize(),
- Context.IntTy, RangeLoc));
+ Context.getPointerDiffType(),
+ RangeLoc));
else if (const VariableArrayType *VAT =
dyn_cast<VariableArrayType>(UnqAT))
BoundExpr = VAT->getSizeExpr();
@@ -1455,7 +1458,10 @@ Sema::ActOnBreakStmt(SourceLocation BreakLoc, Scope *CurScope) {
/// \param E The expression being returned from the function or block, or
/// being thrown.
///
-/// \param AllowFunctionParameter
+/// \param AllowFunctionParameter Whether we allow function parameters to
+/// be considered NRVO candidates. C++ prohibits this for NRVO itself, but
+/// we re-use this logic to determine whether we should try to move as part of
+/// a return or throw (which does allow function parameters).
///
/// \returns The NRVO candidate variable, if the return statement may use the
/// NRVO, or NULL if there is no such candidate.
@@ -1525,12 +1531,11 @@ Sema::PerformMoveOrCopyInitialization(const InitializedEntity &Entity,
// parameter of the selected constructor is not an rvalue reference
// to the object's type (possibly cv-qualified), overload resolution
// is performed again, considering the object as an lvalue.
- if (Seq.getKind() != InitializationSequence::FailedSequence) {
+ if (Seq) {
for (InitializationSequence::step_iterator Step = Seq.step_begin(),
StepEnd = Seq.step_end();
Step != StepEnd; ++Step) {
- if (Step->Kind
- != InitializationSequence::SK_ConstructorInitialization)
+ if (Step->Kind != InitializationSequence::SK_ConstructorInitialization)
continue;
CXXConstructorDecl *Constructor
@@ -1583,14 +1588,18 @@ Sema::ActOnBlockReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
if (Result.isInvalid())
return StmtError();
RetValExp = Result.take();
- CurBlock->ReturnType = RetValExp->getType();
- if (BlockDeclRefExpr *CDRE = dyn_cast<BlockDeclRefExpr>(RetValExp)) {
- // We have to remove a 'const' added to copied-in variable which was
- // part of the implementation spec. and not the actual qualifier for
- // the variable.
- if (CDRE->isConstQualAdded())
- CurBlock->ReturnType.removeLocalConst(); // FIXME: local???
- }
+
+ if (!RetValExp->isTypeDependent()) {
+ CurBlock->ReturnType = RetValExp->getType();
+ if (BlockDeclRefExpr *CDRE = dyn_cast<BlockDeclRefExpr>(RetValExp)) {
+ // We have to remove a 'const' added to copied-in variable which was
+ // part of the implementation spec. and not the actual qualifier for
+ // the variable.
+ if (CDRE->isConstQualAdded())
+ CurBlock->ReturnType.removeLocalConst(); // FIXME: local???
+ }
+ } else
+ CurBlock->ReturnType = Context.DependentTy;
} else
CurBlock->ReturnType = Context.VoidTy;
}
@@ -1607,13 +1616,17 @@ Sema::ActOnBlockReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
// compatibility to worry about here.
ReturnStmt *Result = 0;
if (CurBlock->ReturnType->isVoidType()) {
- if (RetValExp) {
+ if (RetValExp && !RetValExp->isTypeDependent() &&
+ (!getLangOptions().CPlusPlus || !RetValExp->getType()->isVoidType())) {
Diag(ReturnLoc, diag::err_return_block_has_expr);
RetValExp = 0;
}
Result = new (Context) ReturnStmt(ReturnLoc, RetValExp, 0);
} else if (!RetValExp) {
- return StmtError(Diag(ReturnLoc, diag::err_block_return_missing_expr));
+ if (!CurBlock->ReturnType->isDependentType())
+ return StmtError(Diag(ReturnLoc, diag::err_block_return_missing_expr));
+
+ Result = new (Context) ReturnStmt(ReturnLoc, 0, 0);
} else {
const VarDecl *NRVOCandidate = 0;
@@ -1652,7 +1665,7 @@ Sema::ActOnBlockReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
// If we need to check for the named return value optimization, save the
// return statement in our scope for later processing.
- if (getLangOptions().CPlusPlus && FnRetType->isRecordType() &&
+ if (getLangOptions().CPlusPlus && FnRetType->isRecordType() &&
!CurContext->isDependentContext())
FunctionScopes.back()->Returns.push_back(Result);
@@ -1661,44 +1674,62 @@ Sema::ActOnBlockReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
StmtResult
Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
+ // Check for unexpanded parameter packs.
+ if (RetValExp && DiagnoseUnexpandedParameterPack(RetValExp))
+ return StmtError();
+
if (getCurBlock())
return ActOnBlockReturnStmt(ReturnLoc, RetValExp);
QualType FnRetType;
+ QualType DeclaredRetType;
if (const FunctionDecl *FD = getCurFunctionDecl()) {
FnRetType = FD->getResultType();
+ DeclaredRetType = FnRetType;
if (FD->hasAttr<NoReturnAttr>() ||
FD->getType()->getAs<FunctionType>()->getNoReturnAttr())
Diag(ReturnLoc, diag::warn_noreturn_function_has_return_expr)
<< getCurFunctionOrMethodDecl()->getDeclName();
- } else if (ObjCMethodDecl *MD = getCurMethodDecl())
- FnRetType = MD->getResultType();
- else // If we don't have a function/method context, bail.
+ } else if (ObjCMethodDecl *MD = getCurMethodDecl()) {
+ DeclaredRetType = MD->getResultType();
+ if (MD->hasRelatedResultType() && MD->getClassInterface()) {
+ // In the implementation of a method with a related return type, the
+ // type used to type-check the validity of return statements within the
+ // method body is a pointer to the type of the class being implemented.
+ FnRetType = Context.getObjCInterfaceType(MD->getClassInterface());
+ FnRetType = Context.getObjCObjectPointerType(FnRetType);
+ } else {
+ FnRetType = DeclaredRetType;
+ }
+ } else // If we don't have a function/method context, bail.
return StmtError();
ReturnStmt *Result = 0;
if (FnRetType->isVoidType()) {
- if (RetValExp && !RetValExp->isTypeDependent()) {
- // C99 6.8.6.4p1 (ext_ since GCC warns)
- unsigned D = diag::ext_return_has_expr;
- if (RetValExp->getType()->isVoidType())
- D = diag::ext_return_has_void_expr;
- else {
- ExprResult Result = Owned(RetValExp);
- Result = IgnoredValueConversions(Result.take());
- if (Result.isInvalid())
- return StmtError();
- RetValExp = Result.take();
- RetValExp = ImpCastExprToType(RetValExp, Context.VoidTy, CK_ToVoid).take();
- }
+ if (RetValExp) {
+ if (!RetValExp->isTypeDependent()) {
+ // C99 6.8.6.4p1 (ext_ since GCC warns)
+ unsigned D = diag::ext_return_has_expr;
+ if (RetValExp->getType()->isVoidType())
+ D = diag::ext_return_has_void_expr;
+ else {
+ ExprResult Result = Owned(RetValExp);
+ Result = IgnoredValueConversions(Result.take());
+ if (Result.isInvalid())
+ return StmtError();
+ RetValExp = Result.take();
+ RetValExp = ImpCastExprToType(RetValExp,
+ Context.VoidTy, CK_ToVoid).take();
+ }
- // return (some void expression); is legal in C++.
- if (D != diag::ext_return_has_void_expr ||
- !getLangOptions().CPlusPlus) {
- NamedDecl *CurDecl = getCurFunctionOrMethodDecl();
- Diag(ReturnLoc, D)
- << CurDecl->getDeclName() << isa<ObjCMethodDecl>(CurDecl)
- << RetValExp->getSourceRange();
+ // return (some void expression); is legal in C++.
+ if (D != diag::ext_return_has_void_expr ||
+ !getLangOptions().CPlusPlus) {
+ NamedDecl *CurDecl = getCurFunctionOrMethodDecl();
+ Diag(ReturnLoc, D)
+ << CurDecl->getDeclName() << isa<ObjCMethodDecl>(CurDecl)
+ << RetValExp->getSourceRange();
+ }
}
CheckImplicitConversions(RetValExp, ReturnLoc);
@@ -1730,7 +1761,7 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
NRVOCandidate = getCopyElisionCandidate(FnRetType, RetValExp, false);
InitializedEntity Entity = InitializedEntity::InitializeResult(ReturnLoc,
FnRetType,
- NRVOCandidate != 0);
+ NRVOCandidate != 0);
ExprResult Res = PerformMoveOrCopyInitialization(Entity, NRVOCandidate,
FnRetType, RetValExp);
if (Res.isInvalid()) {
@@ -1744,6 +1775,17 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
}
if (RetValExp) {
+ // If we type-checked an Objective-C method's return type based
+ // on a related return type, we may need to adjust the return
+ // type again. Do so now.
+ if (DeclaredRetType != FnRetType) {
+ ExprResult result = PerformImplicitConversion(RetValExp,
+ DeclaredRetType,
+ AA_Returning);
+ if (result.isInvalid()) return StmtError();
+ RetValExp = result.take();
+ }
+
CheckImplicitConversions(RetValExp, ReturnLoc);
RetValExp = MaybeCreateExprWithCleanups(RetValExp);
}
@@ -2015,7 +2057,9 @@ StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, bool IsSimple,
if (InputDomain == AD_Int && OutputDomain == AD_Int &&
!isOperandMentioned(InputOpNo, Pieces) &&
InputExpr->isEvaluatable(Context)) {
- InputExpr = ImpCastExprToType(InputExpr, OutTy, CK_IntegralCast).take();
+ CastKind castKind =
+ (OutTy->isBooleanType() ? CK_IntegralToBoolean : CK_IntegralCast);
+ InputExpr = ImpCastExprToType(InputExpr, OutTy, castKind).take();
Exprs[InputOpNo] = InputExpr;
NS->setInputExpr(i, InputExpr);
continue;
@@ -2251,7 +2295,9 @@ Sema::ActOnSEHExceptBlock(SourceLocation Loc,
assert(FilterExpr && Block);
if(!FilterExpr->getType()->isIntegerType()) {
- return StmtError(Diag(FilterExpr->getExprLoc(), diag::err_filter_expression_integral) << FilterExpr->getType());
+ return StmtError(Diag(FilterExpr->getExprLoc(),
+ diag::err_filter_expression_integral)
+ << FilterExpr->getType());
}
return Owned(SEHExceptStmt::Create(Context,Loc,FilterExpr,Block));
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp
index ef09124..5d4caac 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp
@@ -92,11 +92,9 @@ void Sema::FilterAcceptableTemplateNames(LookupResult &R) {
// ambiguity in certain cases (for example, if it is found in more than
// one base class). If all of the injected-class-names that are found
// refer to specializations of the same class template, and if the name
- // is followed by a template-argument-list, the reference refers to the
- // class template itself and not a specialization thereof, and is not
+ // is used as a template-name, the reference refers to the class
+ // template itself and not a specialization thereof, and is not
// ambiguous.
- //
- // FIXME: Will we eventually have to do the same for alias templates?
if (ClassTemplateDecl *ClassTmpl = dyn_cast<ClassTemplateDecl>(Repl))
if (!ClassTemplates.insert(ClassTmpl)) {
filter.erase();
@@ -199,7 +197,8 @@ TemplateNameKind Sema::isTemplateName(Scope *S,
// We'll do this lookup again later.
R.suppressDiagnostics();
} else {
- assert(isa<ClassTemplateDecl>(TD) || isa<TemplateTemplateParmDecl>(TD));
+ assert(isa<ClassTemplateDecl>(TD) || isa<TemplateTemplateParmDecl>(TD) ||
+ isa<TypeAliasTemplateDecl>(TD));
TemplateKind = TNK_Type_template;
}
}
@@ -603,8 +602,10 @@ Sema::CheckNonTypeTemplateParameterType(QualType T, SourceLocation Loc) {
T->isPointerType() ||
// -- reference to object or reference to function,
T->isReferenceType() ||
- // -- pointer to member.
+ // -- pointer to member,
T->isMemberPointerType() ||
+ // -- std::nullptr_t.
+ T->isNullPtrType() ||
// If T is a dependent type, we can't do the check now, so we
// assume that it is well-formed.
T->isDependentType())
@@ -919,7 +920,8 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK,
// the class-key shall agree in kind with the original class
// template declaration (7.1.5.3).
RecordDecl *PrevRecordDecl = PrevClassTemplate->getTemplatedDecl();
- if (!isAcceptableTagRedeclaration(PrevRecordDecl, Kind, KWLoc, *Name)) {
+ if (!isAcceptableTagRedeclaration(PrevRecordDecl, Kind,
+ TUK == TUK_Definition, KWLoc, *Name)) {
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< Name
<< FixItHint::CreateReplacement(KWLoc, PrevRecordDecl->getKindName());
@@ -1062,6 +1064,7 @@ static bool DiagnoseDefaultTemplateArgument(Sema &S,
SourceRange DefArgRange) {
switch (TPC) {
case Sema::TPC_ClassTemplate:
+ case Sema::TPC_TypeAliasTemplate:
return false;
case Sema::TPC_FunctionTemplate:
@@ -1187,9 +1190,10 @@ bool Sema::CheckTemplateParameterList(TemplateParameterList *NewParams,
bool MissingDefaultArg = false;
// C++0x [temp.param]p11:
- // If a template parameter of a primary class template is a template
- // parameter pack, it shall be the last template parameter.
- if (SawParameterPack && TPC == TPC_ClassTemplate) {
+ // If a template parameter of a primary class template or alias template
+ // is a template parameter pack, it shall be the last template parameter.
+ if (SawParameterPack &&
+ (TPC == TPC_ClassTemplate || TPC == TPC_TypeAliasTemplate)) {
Diag(ParameterPackLoc,
diag::err_template_param_pack_must_be_last_template_parameter);
Invalid = true;
@@ -1429,19 +1433,41 @@ struct DependencyChecker : RecursiveASTVisitor<DependencyChecker> {
}
return super::VisitDeclRefExpr(E);
}
+
+ bool TraverseInjectedClassNameType(const InjectedClassNameType *T) {
+ return TraverseType(T->getInjectedSpecializationType());
+ }
};
}
-/// Determines whether a template-id depends on the given parameter
+/// Determines whether a given type depends on the given parameter
/// list.
static bool
-DependsOnTemplateParameters(const TemplateSpecializationType *TemplateId,
- TemplateParameterList *Params) {
+DependsOnTemplateParameters(QualType T, TemplateParameterList *Params) {
DependencyChecker Checker(Params);
- Checker.TraverseType(QualType(TemplateId, 0));
+ Checker.TraverseType(T);
return Checker.Match;
}
+// Find the source range corresponding to the named type in the given
+// nested-name-specifier, if any.
+static SourceRange getRangeOfTypeInNestedNameSpecifier(ASTContext &Context,
+ QualType T,
+ const CXXScopeSpec &SS) {
+ NestedNameSpecifierLoc NNSLoc(SS.getScopeRep(), SS.location_data());
+ while (NestedNameSpecifier *NNS = NNSLoc.getNestedNameSpecifier()) {
+ if (const Type *CurType = NNS->getAsType()) {
+ if (Context.hasSameUnqualifiedType(T, QualType(CurType, 0)))
+ return NNSLoc.getTypeLoc().getSourceRange();
+ } else
+ break;
+
+ NNSLoc = NNSLoc.getPrefix();
+ }
+
+ return SourceRange();
+}
+
/// \brief Match the given template parameter lists to the given scope
/// specifier, returning the template parameter list that applies to the
/// name.
@@ -1449,6 +1475,8 @@ DependsOnTemplateParameters(const TemplateSpecializationType *TemplateId,
/// \param DeclStartLoc the start of the declaration that has a scope
/// specifier or a template parameter list.
///
+/// \param DeclLoc The location of the declaration itself.
+///
/// \param SS the scope specifier that will be matched to the given template
/// parameter lists. This scope specifier precedes a qualified name that is
/// being declared.
@@ -1473,6 +1501,7 @@ DependsOnTemplateParameters(const TemplateSpecializationType *TemplateId,
/// itself a template).
TemplateParameterList *
Sema::MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc,
+ SourceLocation DeclLoc,
const CXXScopeSpec &SS,
TemplateParameterList **ParamLists,
unsigned NumParamLists,
@@ -1480,138 +1509,268 @@ Sema::MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc,
bool &IsExplicitSpecialization,
bool &Invalid) {
IsExplicitSpecialization = false;
-
- // Find the template-ids that occur within the nested-name-specifier. These
- // template-ids will match up with the template parameter lists.
- llvm::SmallVector<const TemplateSpecializationType *, 4>
- TemplateIdsInSpecifier;
- llvm::SmallVector<ClassTemplateSpecializationDecl *, 4>
- ExplicitSpecializationsInSpecifier;
- for (NestedNameSpecifier *NNS = (NestedNameSpecifier *)SS.getScopeRep();
- NNS; NNS = NNS->getPrefix()) {
- const Type *T = NNS->getAsType();
- if (!T) break;
-
- // C++0x [temp.expl.spec]p17:
- // A member or a member template may be nested within many
- // enclosing class templates. In an explicit specialization for
- // such a member, the member declaration shall be preceded by a
- // template<> for each enclosing class template that is
- // explicitly specialized.
- //
- // Following the existing practice of GNU and EDG, we allow a typedef of a
- // template specialization type.
- while (const TypedefType *TT = dyn_cast<TypedefType>(T))
- T = TT->getDecl()->getUnderlyingType().getTypePtr();
-
- if (const TemplateSpecializationType *SpecType
- = dyn_cast<TemplateSpecializationType>(T)) {
- TemplateDecl *Template = SpecType->getTemplateName().getAsTemplateDecl();
- if (!Template)
- continue; // FIXME: should this be an error? probably...
-
- if (const RecordType *Record = SpecType->getAs<RecordType>()) {
- ClassTemplateSpecializationDecl *SpecDecl
- = cast<ClassTemplateSpecializationDecl>(Record->getDecl());
- // If the nested name specifier refers to an explicit specialization,
- // we don't need a template<> header.
- if (SpecDecl->getSpecializationKind() == TSK_ExplicitSpecialization) {
- ExplicitSpecializationsInSpecifier.push_back(SpecDecl);
- continue;
+ Invalid = false;
+
+ // The sequence of nested types to which we will match up the template
+ // parameter lists. We first build this list by starting with the type named
+ // by the nested-name-specifier and walking out until we run out of types.
+ llvm::SmallVector<QualType, 4> NestedTypes;
+ QualType T;
+ if (SS.getScopeRep()) {
+ if (CXXRecordDecl *Record
+ = dyn_cast_or_null<CXXRecordDecl>(computeDeclContext(SS, true)))
+ T = Context.getTypeDeclType(Record);
+ else
+ T = QualType(SS.getScopeRep()->getAsType(), 0);
+ }
+
+ // If we found an explicit specialization that prevents us from needing
+ // 'template<>' headers, this will be set to the location of that
+ // explicit specialization.
+ SourceLocation ExplicitSpecLoc;
+
+ while (!T.isNull()) {
+ NestedTypes.push_back(T);
+
+ // Retrieve the parent of a record type.
+ if (CXXRecordDecl *Record = T->getAsCXXRecordDecl()) {
+ // If this type is an explicit specialization, we're done.
+ if (ClassTemplateSpecializationDecl *Spec
+ = dyn_cast<ClassTemplateSpecializationDecl>(Record)) {
+ if (!isa<ClassTemplatePartialSpecializationDecl>(Spec) &&
+ Spec->getSpecializationKind() == TSK_ExplicitSpecialization) {
+ ExplicitSpecLoc = Spec->getLocation();
+ break;
}
+ } else if (Record->getTemplateSpecializationKind()
+ == TSK_ExplicitSpecialization) {
+ ExplicitSpecLoc = Record->getLocation();
+ break;
+ }
+
+ if (TypeDecl *Parent = dyn_cast<TypeDecl>(Record->getParent()))
+ T = Context.getTypeDeclType(Parent);
+ else
+ T = QualType();
+ continue;
+ }
+
+ if (const TemplateSpecializationType *TST
+ = T->getAs<TemplateSpecializationType>()) {
+ if (TemplateDecl *Template = TST->getTemplateName().getAsTemplateDecl()) {
+ if (TypeDecl *Parent = dyn_cast<TypeDecl>(Template->getDeclContext()))
+ T = Context.getTypeDeclType(Parent);
+ else
+ T = QualType();
+ continue;
}
-
- TemplateIdsInSpecifier.push_back(SpecType);
}
- }
-
- // Reverse the list of template-ids in the scope specifier, so that we can
- // more easily match up the template-ids and the template parameter lists.
- std::reverse(TemplateIdsInSpecifier.begin(), TemplateIdsInSpecifier.end());
-
- SourceLocation FirstTemplateLoc = DeclStartLoc;
- if (NumParamLists)
- FirstTemplateLoc = ParamLists[0]->getTemplateLoc();
-
- // Match the template-ids found in the specifier to the template parameter
- // lists.
- unsigned ParamIdx = 0, TemplateIdx = 0;
- for (unsigned NumTemplateIds = TemplateIdsInSpecifier.size();
- TemplateIdx != NumTemplateIds; ++TemplateIdx) {
- const TemplateSpecializationType *TemplateId
- = TemplateIdsInSpecifier[TemplateIdx];
- bool DependentTemplateId = TemplateId->isDependentType();
-
- // In friend declarations we can have template-ids which don't
- // depend on the corresponding template parameter lists. But
- // assume that empty parameter lists are supposed to match this
- // template-id.
- if (IsFriend && ParamIdx < NumParamLists && ParamLists[ParamIdx]->size()) {
- if (!DependentTemplateId ||
- !DependsOnTemplateParameters(TemplateId, ParamLists[ParamIdx]))
- continue;
+
+ // Look one step prior in a dependent template specialization type.
+ if (const DependentTemplateSpecializationType *DependentTST
+ = T->getAs<DependentTemplateSpecializationType>()) {
+ if (NestedNameSpecifier *NNS = DependentTST->getQualifier())
+ T = QualType(NNS->getAsType(), 0);
+ else
+ T = QualType();
+ continue;
+ }
+
+ // Look one step prior in a dependent name type.
+ if (const DependentNameType *DependentName = T->getAs<DependentNameType>()){
+ if (NestedNameSpecifier *NNS = DependentName->getQualifier())
+ T = QualType(NNS->getAsType(), 0);
+ else
+ T = QualType();
+ continue;
+ }
+
+ // Retrieve the parent of an enumeration type.
+ if (const EnumType *EnumT = T->getAs<EnumType>()) {
+ // FIXME: Forward-declared enums require a TSK_ExplicitSpecialization
+ // check here.
+ EnumDecl *Enum = EnumT->getDecl();
+
+ // Get to the parent type.
+ if (TypeDecl *Parent = dyn_cast<TypeDecl>(Enum->getParent()))
+ T = Context.getTypeDeclType(Parent);
+ else
+ T = QualType();
+ continue;
}
- if (ParamIdx >= NumParamLists) {
- // We have a template-id without a corresponding template parameter
- // list.
+ T = QualType();
+ }
+ // Reverse the nested types list, since we want to traverse from the outermost
+ // to the innermost while checking template-parameter-lists.
+ std::reverse(NestedTypes.begin(), NestedTypes.end());
+
+ // C++0x [temp.expl.spec]p17:
+ // A member or a member template may be nested within many
+ // enclosing class templates. In an explicit specialization for
+ // such a member, the member declaration shall be preceded by a
+ // template<> for each enclosing class template that is
+ // explicitly specialized.
+ bool SawNonEmptyTemplateParameterList = false;
+ unsigned ParamIdx = 0;
+ for (unsigned TypeIdx = 0, NumTypes = NestedTypes.size(); TypeIdx != NumTypes;
+ ++TypeIdx) {
+ T = NestedTypes[TypeIdx];
+
+ // Whether we expect a 'template<>' header.
+ bool NeedEmptyTemplateHeader = false;
- // ...which is fine if this is a friend declaration.
- if (IsFriend) {
- IsExplicitSpecialization = true;
- break;
+ // Whether we expect a template header with parameters.
+ bool NeedNonemptyTemplateHeader = false;
+
+ // For a dependent type, the set of template parameters that we
+ // expect to see.
+ TemplateParameterList *ExpectedTemplateParams = 0;
+
+ // C++0x [temp.expl.spec]p15:
+ // A member or a member template may be nested within many enclosing
+ // class templates. In an explicit specialization for such a member, the
+ // member declaration shall be preceded by a template<> for each
+ // enclosing class template that is explicitly specialized.
+ if (CXXRecordDecl *Record = T->getAsCXXRecordDecl()) {
+ if (ClassTemplatePartialSpecializationDecl *Partial
+ = dyn_cast<ClassTemplatePartialSpecializationDecl>(Record)) {
+ ExpectedTemplateParams = Partial->getTemplateParameters();
+ NeedNonemptyTemplateHeader = true;
+ } else if (Record->isDependentType()) {
+ if (Record->getDescribedClassTemplate()) {
+ ExpectedTemplateParams = Record->getDescribedClassTemplate()
+ ->getTemplateParameters();
+ NeedNonemptyTemplateHeader = true;
+ }
+ } else if (ClassTemplateSpecializationDecl *Spec
+ = dyn_cast<ClassTemplateSpecializationDecl>(Record)) {
+ // C++0x [temp.expl.spec]p4:
+ // Members of an explicitly specialized class template are defined
+ // in the same manner as members of normal classes, and not using
+ // the template<> syntax.
+ if (Spec->getSpecializationKind() != TSK_ExplicitSpecialization)
+ NeedEmptyTemplateHeader = true;
+ else
+ continue;
+ } else if (Record->getTemplateSpecializationKind()) {
+ if (Record->getTemplateSpecializationKind()
+ != TSK_ExplicitSpecialization &&
+ TypeIdx == NumTypes - 1)
+ IsExplicitSpecialization = true;
+
+ continue;
}
-
- if (DependentTemplateId) {
- // FIXME: the location information here isn't great.
- Diag(SS.getRange().getBegin(),
- diag::err_template_spec_needs_template_parameters)
- << QualType(TemplateId, 0)
- << SS.getRange();
- Invalid = true;
- } else {
- Diag(SS.getRange().getBegin(), diag::err_template_spec_needs_header)
- << SS.getRange()
- << FixItHint::CreateInsertion(FirstTemplateLoc, "template<> ");
- IsExplicitSpecialization = true;
+ } else if (const TemplateSpecializationType *TST
+ = T->getAs<TemplateSpecializationType>()) {
+ if (TemplateDecl *Template = TST->getTemplateName().getAsTemplateDecl()) {
+ ExpectedTemplateParams = Template->getTemplateParameters();
+ NeedNonemptyTemplateHeader = true;
}
- return 0;
+ } else if (T->getAs<DependentTemplateSpecializationType>()) {
+ // FIXME: We actually could/should check the template arguments here
+ // against the corresponding template parameter list.
+ NeedNonemptyTemplateHeader = false;
+ }
+
+ // C++ [temp.expl.spec]p16:
+ // In an explicit specialization declaration for a member of a class
+ // template or a member template that ap- pears in namespace scope, the
+ // member template and some of its enclosing class templates may remain
+ // unspecialized, except that the declaration shall not explicitly
+ // specialize a class member template if its en- closing class templates
+ // are not explicitly specialized as well.
+ if (ParamIdx < NumParamLists) {
+ if (ParamLists[ParamIdx]->size() == 0) {
+ if (SawNonEmptyTemplateParameterList) {
+ Diag(DeclLoc, diag::err_specialize_member_of_template)
+ << ParamLists[ParamIdx]->getSourceRange();
+ Invalid = true;
+ IsExplicitSpecialization = false;
+ return 0;
+ }
+ } else
+ SawNonEmptyTemplateParameterList = true;
}
-
- // Check the template parameter list against its corresponding template-id.
- if (DependentTemplateId) {
- TemplateParameterList *ExpectedTemplateParams = 0;
-
- // Are there cases in (e.g.) friends where this won't match?
- if (const InjectedClassNameType *Injected
- = TemplateId->getAs<InjectedClassNameType>()) {
- CXXRecordDecl *Record = Injected->getDecl();
- if (ClassTemplatePartialSpecializationDecl *Partial =
- dyn_cast<ClassTemplatePartialSpecializationDecl>(Record))
- ExpectedTemplateParams = Partial->getTemplateParameters();
+
+ if (NeedEmptyTemplateHeader) {
+ // If we're on the last of the types, and we need a 'template<>' header
+ // here, then it's an explicit specialization.
+ if (TypeIdx == NumTypes - 1)
+ IsExplicitSpecialization = true;
+
+ if (ParamIdx < NumParamLists) {
+ if (ParamLists[ParamIdx]->size() > 0) {
+ // The header has template parameters when it shouldn't. Complain.
+ Diag(ParamLists[ParamIdx]->getTemplateLoc(),
+ diag::err_template_param_list_matches_nontemplate)
+ << T
+ << SourceRange(ParamLists[ParamIdx]->getLAngleLoc(),
+ ParamLists[ParamIdx]->getRAngleLoc())
+ << getRangeOfTypeInNestedNameSpecifier(Context, T, SS);
+ Invalid = true;
+ return 0;
+ }
+
+ // Consume this template header.
+ ++ParamIdx;
+ continue;
+ }
+
+ if (!IsFriend) {
+ // We don't have a template header, but we should.
+ SourceLocation ExpectedTemplateLoc;
+ if (NumParamLists > 0)
+ ExpectedTemplateLoc = ParamLists[0]->getTemplateLoc();
else
- ExpectedTemplateParams = Record->getDescribedClassTemplate()
- ->getTemplateParameters();
- }
+ ExpectedTemplateLoc = DeclStartLoc;
- if (ExpectedTemplateParams)
- TemplateParameterListsAreEqual(ParamLists[ParamIdx],
- ExpectedTemplateParams,
- true, TPL_TemplateMatch);
-
- CheckTemplateParameterList(ParamLists[ParamIdx], 0,
- TPC_ClassTemplateMember);
- } else if (ParamLists[ParamIdx]->size() > 0)
- Diag(ParamLists[ParamIdx]->getTemplateLoc(),
- diag::err_template_param_list_matches_nontemplate)
- << TemplateId
- << ParamLists[ParamIdx]->getSourceRange();
- else
- IsExplicitSpecialization = true;
+ Diag(DeclLoc, diag::err_template_spec_needs_header)
+ << getRangeOfTypeInNestedNameSpecifier(Context, T, SS)
+ << FixItHint::CreateInsertion(ExpectedTemplateLoc, "template<> ");
+ }
+
+ continue;
+ }
+
+ if (NeedNonemptyTemplateHeader) {
+ // In friend declarations we can have template-ids which don't
+ // depend on the corresponding template parameter lists. But
+ // assume that empty parameter lists are supposed to match this
+ // template-id.
+ if (IsFriend && T->isDependentType()) {
+ if (ParamIdx < NumParamLists &&
+ DependsOnTemplateParameters(T, ParamLists[ParamIdx]))
+ ExpectedTemplateParams = 0;
+ else
+ continue;
+ }
- ++ParamIdx;
+ if (ParamIdx < NumParamLists) {
+ // Check the template parameter list, if we can.
+ if (ExpectedTemplateParams &&
+ !TemplateParameterListsAreEqual(ParamLists[ParamIdx],
+ ExpectedTemplateParams,
+ true, TPL_TemplateMatch))
+ Invalid = true;
+
+ if (!Invalid &&
+ CheckTemplateParameterList(ParamLists[ParamIdx], 0,
+ TPC_ClassTemplateMember))
+ Invalid = true;
+
+ ++ParamIdx;
+ continue;
+ }
+
+ Diag(DeclLoc, diag::err_template_spec_needs_template_parameters)
+ << T
+ << getRangeOfTypeInNestedNameSpecifier(Context, T, SS);
+ Invalid = true;
+ continue;
+ }
}
-
+
// If there were at least as many template-ids as there were template
// parameter lists, then there are no template parameter lists remaining for
// the declaration itself.
@@ -1619,32 +1778,53 @@ Sema::MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc,
return 0;
// If there were too many template parameter lists, complain about that now.
- if (ParamIdx != NumParamLists - 1) {
- while (ParamIdx < NumParamLists - 1) {
- bool isExplicitSpecHeader = ParamLists[ParamIdx]->size() == 0;
- Diag(ParamLists[ParamIdx]->getTemplateLoc(),
- isExplicitSpecHeader? diag::warn_template_spec_extra_headers
- : diag::err_template_spec_extra_headers)
- << SourceRange(ParamLists[ParamIdx]->getTemplateLoc(),
- ParamLists[ParamIdx]->getRAngleLoc());
-
- if (isExplicitSpecHeader && !ExplicitSpecializationsInSpecifier.empty()) {
- Diag(ExplicitSpecializationsInSpecifier.back()->getLocation(),
- diag::note_explicit_template_spec_does_not_need_header)
- << ExplicitSpecializationsInSpecifier.back();
- ExplicitSpecializationsInSpecifier.pop_back();
- }
-
- // We have a template parameter list with no corresponding scope, which
- // means that the resulting template declaration can't be instantiated
- // properly (we'll end up with dependent nodes when we shouldn't).
- if (!isExplicitSpecHeader)
- Invalid = true;
-
- ++ParamIdx;
+ if (ParamIdx < NumParamLists - 1) {
+ bool HasAnyExplicitSpecHeader = false;
+ bool AllExplicitSpecHeaders = true;
+ for (unsigned I = ParamIdx; I != NumParamLists - 1; ++I) {
+ if (ParamLists[I]->size() == 0)
+ HasAnyExplicitSpecHeader = true;
+ else
+ AllExplicitSpecHeaders = false;
}
+
+ Diag(ParamLists[ParamIdx]->getTemplateLoc(),
+ AllExplicitSpecHeaders? diag::warn_template_spec_extra_headers
+ : diag::err_template_spec_extra_headers)
+ << SourceRange(ParamLists[ParamIdx]->getTemplateLoc(),
+ ParamLists[NumParamLists - 2]->getRAngleLoc());
+
+ // If there was a specialization somewhere, such that 'template<>' is
+ // not required, and there were any 'template<>' headers, note where the
+ // specialization occurred.
+ if (ExplicitSpecLoc.isValid() && HasAnyExplicitSpecHeader)
+ Diag(ExplicitSpecLoc,
+ diag::note_explicit_template_spec_does_not_need_header)
+ << NestedTypes.back();
+
+ // We have a template parameter list with no corresponding scope, which
+ // means that the resulting template declaration can't be instantiated
+ // properly (we'll end up with dependent nodes when we shouldn't).
+ if (!AllExplicitSpecHeaders)
+ Invalid = true;
}
+ // C++ [temp.expl.spec]p16:
+ // In an explicit specialization declaration for a member of a class
+ // template or a member template that ap- pears in namespace scope, the
+ // member template and some of its enclosing class templates may remain
+ // unspecialized, except that the declaration shall not explicitly
+ // specialize a class member template if its en- closing class templates
+ // are not explicitly specialized as well.
+ if (ParamLists[NumParamLists - 1]->size() == 0 &&
+ SawNonEmptyTemplateParameterList) {
+ Diag(DeclLoc, diag::err_specialize_member_of_template)
+ << ParamLists[ParamIdx]->getSourceRange();
+ Invalid = true;
+ IsExplicitSpecialization = false;
+ return 0;
+ }
+
// Return the last template parameter list, which corresponds to the
// entity being declared.
return ParamLists[NumParamLists - 1];
@@ -1655,7 +1835,8 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) {
Diag(Template->getLocation(), diag::note_template_declared_here)
<< (isa<FunctionTemplateDecl>(Template)? 0
: isa<ClassTemplateDecl>(Template)? 1
- : 2)
+ : isa<TypeAliasTemplateDecl>(Template)? 2
+ : 3)
<< Template->getDeclName();
return;
}
@@ -1675,13 +1856,24 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) {
QualType Sema::CheckTemplateIdType(TemplateName Name,
SourceLocation TemplateLoc,
TemplateArgumentListInfo &TemplateArgs) {
+ DependentTemplateName *DTN = Name.getAsDependentTemplateName();
+ if (DTN && DTN->isIdentifier())
+ // When building a template-id where the template-name is dependent,
+ // assume the template is a type template. Either our assumption is
+ // correct, or the code is ill-formed and will be diagnosed when the
+ // dependent name is substituted.
+ return Context.getDependentTemplateSpecializationType(ETK_None,
+ DTN->getQualifier(),
+ DTN->getIdentifier(),
+ TemplateArgs);
+
TemplateDecl *Template = Name.getAsTemplateDecl();
if (!Template || isa<FunctionTemplateDecl>(Template)) {
// We might have a substituted template template parameter pack. If so,
// build a template specialization type for it.
if (Name.getAsSubstTemplateTemplateParmPack())
return Context.getTemplateSpecializationType(Name, TemplateArgs);
-
+
Diag(TemplateLoc, diag::err_template_id_not_a_type)
<< Name;
NoteAllFoundTemplates(Name);
@@ -1700,9 +1892,32 @@ QualType Sema::CheckTemplateIdType(TemplateName Name,
QualType CanonType;
- if (Name.isDependent() ||
- TemplateSpecializationType::anyDependentTemplateArguments(
- TemplateArgs)) {
+ if (TypeAliasTemplateDecl *AliasTemplate
+ = dyn_cast<TypeAliasTemplateDecl>(Template)) {
+ // Find the canonical type for this type alias template specialization.
+ TypeAliasDecl *Pattern = AliasTemplate->getTemplatedDecl();
+ if (Pattern->isInvalidDecl())
+ return QualType();
+
+ TemplateArgumentList TemplateArgs(TemplateArgumentList::OnStack,
+ Converted.data(), Converted.size());
+
+ // Only substitute for the innermost template argument list.
+ MultiLevelTemplateArgumentList TemplateArgLists;
+ TemplateArgLists.addOuterTemplateArguments(&TemplateArgs);
+ unsigned Depth = AliasTemplate->getTemplateParameters()->getDepth();
+ for (unsigned I = 0; I < Depth; ++I)
+ TemplateArgLists.addOuterTemplateArguments(0, 0);
+
+ InstantiatingTemplate Inst(*this, TemplateLoc, Template);
+ CanonType = SubstType(Pattern->getUnderlyingType(),
+ TemplateArgLists, AliasTemplate->getLocation(),
+ AliasTemplate->getDeclName());
+ if (CanonType.isNull())
+ return QualType();
+ } else if (Name.isDependent() ||
+ TemplateSpecializationType::anyDependentTemplateArguments(
+ TemplateArgs)) {
// This class template specialization is a dependent
// type. Therefore, its canonical type is another class template
// specialization type that contains all of the converted
@@ -1894,6 +2109,16 @@ TypeResult Sema::ActOnTagTemplateIdType(TagUseKind TUK,
SpecTL.setArgLocInfo(I, TemplateArgs[I].getLocInfo());
return CreateParsedType(T, TLB.getTypeSourceInfo(Context, T));
}
+
+ if (TypeAliasTemplateDecl *TAT =
+ dyn_cast_or_null<TypeAliasTemplateDecl>(Template.getAsTemplateDecl())) {
+ // C++0x [dcl.type.elab]p2:
+ // If the identifier resolves to a typedef-name or the simple-template-id
+ // resolves to an alias template specialization, the
+ // elaborated-type-specifier is ill-formed.
+ Diag(TemplateLoc, diag::err_tag_reference_non_tag) << 4;
+ Diag(TAT->getLocation(), diag::note_declared_at);
+ }
QualType Result = CheckTemplateIdType(Template, TemplateLoc, TemplateArgs);
if (Result.isNull())
@@ -1906,7 +2131,8 @@ TypeResult Sema::ActOnTagTemplateIdType(TagUseKind TUK,
IdentifierInfo *Id = D->getIdentifier();
assert(Id && "templated class must have an identifier");
- if (!isAcceptableTagRedeclaration(D, TagKind, TagLoc, *Id)) {
+ if (!isAcceptableTagRedeclaration(D, TagKind, TUK == TUK_Definition,
+ TagLoc, *Id)) {
Diag(TagLoc, diag::err_use_with_wrong_tag)
<< Result
<< FixItHint::CreateReplacement(SourceRange(TagLoc), D->getKindName());
@@ -2485,7 +2711,7 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param,
}
// We have a template argument that actually does refer to a class
- // template, template alias, or template template parameter, and
+ // template, alias template, or template template parameter, and
// therefore cannot be a non-type template argument.
Diag(Arg.getLocation(), diag::err_template_arg_must_be_expr)
<< Arg.getSourceRange();
@@ -2562,7 +2788,8 @@ bool Sema::CheckTemplateArgument(NamedDecl *Param,
case TemplateArgument::Type:
// We have a template template parameter but the template
// argument does not refer to a template.
- Diag(Arg.getLocation(), diag::err_template_arg_must_be_template);
+ Diag(Arg.getLocation(), diag::err_template_arg_must_be_template)
+ << getLangOptions().CPlusPlus0x;
return true;
case TemplateArgument::Declaration:
@@ -2631,9 +2858,6 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
unsigned ArgIdx = 0;
LocalInstantiationScope InstScope(*this, true);
while (Param != ParamEnd) {
- if (ArgIdx > NumArgs && PartialTemplateArgs)
- break;
-
if (ArgIdx < NumArgs) {
// If we have an expanded parameter pack, make sure we don't have too
// many arguments.
@@ -2674,11 +2898,31 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
continue;
}
+ // If we're checking a partial template argument list, we're done.
+ if (PartialTemplateArgs) {
+ if ((*Param)->isTemplateParameterPack() && !ArgumentPack.empty())
+ Converted.push_back(TemplateArgument::CreatePackCopy(Context,
+ ArgumentPack.data(),
+ ArgumentPack.size()));
+
+ return Invalid;
+ }
+
// If we have a template parameter pack with no more corresponding
// arguments, just break out now and we'll fill in the argument pack below.
if ((*Param)->isTemplateParameterPack())
break;
+ // If our template is a template template parameter that hasn't acquired
+ // its proper context yet (e.g., because we're using the template template
+ // parameter in the signature of a function template, before we've built
+ // the function template itself), don't attempt substitution of default
+ // template arguments at this point: we don't have enough context to
+ // do it properly.
+ if (isTemplateTemplateParameter &&
+ Template->getDeclContext()->isTranslationUnit())
+ break;
+
// We have a default template argument that we will use.
TemplateArgumentLoc Arg;
@@ -2689,7 +2933,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
// the default argument.
if (TemplateTypeParmDecl *TTP = dyn_cast<TemplateTypeParmDecl>(*Param)) {
if (!TTP->hasDefaultArgument()) {
- assert((Invalid || PartialTemplateArgs) && "Missing default argument");
+ assert(Invalid && "Missing default argument");
break;
}
@@ -2707,7 +2951,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
} else if (NonTypeTemplateParmDecl *NTTP
= dyn_cast<NonTypeTemplateParmDecl>(*Param)) {
if (!NTTP->hasDefaultArgument()) {
- assert((Invalid || PartialTemplateArgs) && "Missing default argument");
+ assert(Invalid && "Missing default argument");
break;
}
@@ -2726,7 +2970,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
= cast<TemplateTemplateParmDecl>(*Param);
if (!TempParm->hasDefaultArgument()) {
- assert((Invalid || PartialTemplateArgs) && "Missing default argument");
+ assert(Invalid && "Missing default argument");
break;
}
@@ -2772,9 +3016,7 @@ bool Sema::CheckTemplateArgumentList(TemplateDecl *Template,
// in arguments for non-template parameter packs.
if ((*Param)->isTemplateParameterPack()) {
- if (PartialTemplateArgs && ArgumentPack.empty()) {
- Converted.push_back(TemplateArgument());
- } else if (ArgumentPack.empty())
+ if (ArgumentPack.empty())
Converted.push_back(TemplateArgument(0, 0));
else {
Converted.push_back(TemplateArgument::CreatePackCopy(Context,
@@ -2918,6 +3160,11 @@ bool UnnamedLocalNoLinkageFinder::VisitDecltypeType(const DecltypeType*) {
return false;
}
+bool UnnamedLocalNoLinkageFinder::VisitUnaryTransformType(
+ const UnaryTransformType*) {
+ return false;
+}
+
bool UnnamedLocalNoLinkageFinder::VisitAutoType(const AutoType *T) {
return Visit(T->getDeducedType());
}
@@ -3501,32 +3748,49 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
return ExprError();
}
+ // Add the value of this argument to the list of converted
+ // arguments. We use the bitwidth and signedness of the template
+ // parameter.
+ if (Arg->isValueDependent()) {
+ // The argument is value-dependent. Create a new
+ // TemplateArgument with the converted expression.
+ Converted = TemplateArgument(Arg);
+ return Owned(Arg);
+ }
+
QualType IntegerType = Context.getCanonicalType(ParamType);
if (const EnumType *Enum = IntegerType->getAs<EnumType>())
IntegerType = Context.getCanonicalType(Enum->getDecl()->getIntegerType());
- if (!Arg->isValueDependent()) {
+ if (ParamType->isBooleanType()) {
+ // Value must be zero or one.
+ Value = Value != 0;
+ unsigned AllowedBits = Context.getTypeSize(IntegerType);
+ if (Value.getBitWidth() != AllowedBits)
+ Value = Value.extOrTrunc(AllowedBits);
+ Value.setIsSigned(IntegerType->isSignedIntegerOrEnumerationType());
+ } else {
llvm::APSInt OldValue = Value;
-
+
// Coerce the template argument's value to the value it will have
// based on the template parameter's type.
unsigned AllowedBits = Context.getTypeSize(IntegerType);
if (Value.getBitWidth() != AllowedBits)
Value = Value.extOrTrunc(AllowedBits);
- Value.setIsSigned(IntegerType->isSignedIntegerType());
-
+ Value.setIsSigned(IntegerType->isSignedIntegerOrEnumerationType());
+
// Complain if an unsigned parameter received a negative value.
- if (IntegerType->isUnsignedIntegerType()
- && (OldValue.isSigned() && OldValue.isNegative())) {
+ if (IntegerType->isUnsignedIntegerOrEnumerationType()
+ && (OldValue.isSigned() && OldValue.isNegative())) {
Diag(Arg->getSourceRange().getBegin(), diag::warn_template_arg_negative)
<< OldValue.toString(10) << Value.toString(10) << Param->getType()
<< Arg->getSourceRange();
Diag(Param->getLocation(), diag::note_template_param_here);
}
-
+
// Complain if we overflowed the template parameter's type.
unsigned RequiredBits;
- if (IntegerType->isUnsignedIntegerType())
+ if (IntegerType->isUnsignedIntegerOrEnumerationType())
RequiredBits = OldValue.getActiveBits();
else if (OldValue.isUnsigned())
RequiredBits = OldValue.getActiveBits() + 1;
@@ -3541,16 +3805,6 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
}
}
- // Add the value of this argument to the list of converted
- // arguments. We use the bitwidth and signedness of the template
- // parameter.
- if (Arg->isValueDependent()) {
- // The argument is value-dependent. Create a new
- // TemplateArgument with the converted expression.
- Converted = TemplateArgument(Arg);
- return Owned(Arg);
- }
-
Converted = TemplateArgument(Value,
ParamType->isEnumeralType() ? ParamType
: IntegerType);
@@ -3563,10 +3817,17 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
// from a template argument of type std::nullptr_t to a non-type
// template parameter of type pointer to object, pointer to
// function, or pointer-to-member, respectively.
- if (ArgType->isNullPtrType() &&
- (ParamType->isPointerType() || ParamType->isMemberPointerType())) {
- Converted = TemplateArgument((NamedDecl *)0);
- return Owned(Arg);
+ if (ArgType->isNullPtrType()) {
+ if (ParamType->isPointerType() || ParamType->isMemberPointerType()) {
+ Converted = TemplateArgument((NamedDecl *)0);
+ return Owned(Arg);
+ }
+
+ if (ParamType->isNullPtrType()) {
+ llvm::APSInt Zero(Context.getTypeSize(Context.NullPtrTy), true);
+ Converted = TemplateArgument(Zero, Context.NullPtrTy);
+ return Owned(Arg);
+ }
}
// Handle pointer-to-function, reference-to-function, and
@@ -3715,9 +3976,10 @@ bool Sema::CheckTemplateArgument(TemplateTemplateParmDecl *Param,
return false;
}
- // C++ [temp.arg.template]p1:
+ // C++0x [temp.arg.template]p1:
// A template-argument for a template template-parameter shall be
- // the name of a class template, expressed as id-expression. Only
+ // the name of a class template or an alias template, expressed as an
+ // id-expression. When the template-argument names a class template, only
// primary class templates are considered when matching the
// template template argument with the corresponding parameter;
// partial specializations are not considered even if their
@@ -3727,7 +3989,8 @@ bool Sema::CheckTemplateArgument(TemplateTemplateParmDecl *Param,
// will happen when we are dealing with, e.g., class template
// partial specializations.
if (!isa<ClassTemplateDecl>(Template) &&
- !isa<TemplateTemplateParmDecl>(Template)) {
+ !isa<TemplateTemplateParmDecl>(Template) &&
+ !isa<TypeAliasTemplateDecl>(Template)) {
assert(isa<FunctionTemplateDecl>(Template) &&
"Only function templates are possible here");
Diag(Arg.getLocation(), diag::err_template_arg_not_class_template);
@@ -3858,6 +4121,9 @@ Sema::BuildExpressionFromIntegralTemplateArgument(const TemplateArgument &Arg,
Arg.getAsIntegral()->getBoolValue(),
T, Loc));
+ if (T->isNullPtrType())
+ return Owned(new (Context) CXXNullPtrLiteralExpr(Context.NullPtrTy, Loc));
+
// If this is an enum type that we're instantiating, we need to use an integer
// type the same size as the enumerator. We don't want to build an
// IntegerLiteral with enum type.
@@ -4044,7 +4310,7 @@ Sema::TemplateParameterListsAreEqual(TemplateParameterList *New,
// C++0x [temp.arg.template]p3:
// A template-argument matches a template template-parameter (call it P)
// when each of the template parameters in the template-parameter-list of
- // the template-argument's corresponding class template or template alias
+ // the template-argument's corresponding class template or alias template
// (call it A) matches the corresponding template parameter in the
// template-parameter-list of P. [...]
TemplateParameterList::iterator NewParm = New->begin();
@@ -4442,7 +4708,9 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
// friend declarations.
bool Invalid = false;
TemplateParameterList *TemplateParams
- = MatchTemplateParametersToScopeSpecifier(TemplateNameLoc, SS,
+ = MatchTemplateParametersToScopeSpecifier(TemplateNameLoc,
+ TemplateNameLoc,
+ SS,
(TemplateParameterList**)TemplateParameterLists.get(),
TemplateParameterLists.size(),
TUK == TUK_Friend,
@@ -4509,7 +4777,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
TagTypeKind Kind = TypeWithKeyword::getTagTypeKindForTypeSpec(TagSpec);
assert(Kind != TTK_Enum && "Invalid enum tag in class template spec!");
if (!isAcceptableTagRedeclaration(ClassTemplate->getTemplatedDecl(),
- Kind, KWLoc,
+ Kind, TUK == TUK_Definition, KWLoc,
*ClassTemplate->getIdentifier())) {
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< ClassTemplate
@@ -5180,7 +5448,7 @@ Sema::CheckFunctionTemplateSpecialization(FunctionDecl *FD,
SpecInfo->getPointOfInstantiation(),
HasNoEffect))
return true;
-
+
// Mark the prior declaration as an explicit specialization, so that later
// clients know that this is an explicit specialization.
if (!isFriend) {
@@ -5200,7 +5468,8 @@ Sema::CheckFunctionTemplateSpecialization(FunctionDecl *FD,
TemplArgs, /*InsertPos=*/0,
SpecInfo->getTemplateSpecializationKind(),
TemplArgsAsWritten);
-
+ FD->setStorageClass(Specialization->getStorageClass());
+
// The "previous declaration" for this function template specialization is
// the prior function template specialization.
Previous.clear();
@@ -5479,7 +5748,7 @@ Sema::ActOnExplicitInstantiation(Scope *S,
assert(Kind != TTK_Enum &&
"Invalid enum tag in class template explicit instantiation!");
if (!isAcceptableTagRedeclaration(ClassTemplate->getTemplatedDecl(),
- Kind, KWLoc,
+ Kind, /*isDefinition*/false, KWLoc,
*ClassTemplate->getIdentifier())) {
Diag(KWLoc, diag::err_use_with_wrong_tag)
<< ClassTemplate
@@ -5801,11 +6070,20 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
if (R.isNull())
return true;
+ // C++ [dcl.stc]p1:
+ // A storage-class-specifier shall not be specified in [...] an explicit
+ // instantiation (14.7.2) directive.
if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef) {
- // Cannot explicitly instantiate a typedef.
Diag(D.getIdentifierLoc(), diag::err_explicit_instantiation_of_typedef)
<< Name;
return true;
+ } else if (D.getDeclSpec().getStorageClassSpec()
+ != DeclSpec::SCS_unspecified) {
+ // Complain about then remove the storage class specifier.
+ Diag(D.getIdentifierLoc(), diag::err_explicit_instantiation_storage_class)
+ << FixItHint::CreateRemoval(D.getDeclSpec().getStorageClassSpecLoc());
+
+ D.getMutableDeclSpec().ClearStorageClassSpecs();
}
// C++0x [temp.explicit]p1:
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp
index 235af04..7d0ce8b 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -2314,7 +2314,7 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate,
FunctionTemplate->getLocation(),
FunctionTemplate->getSourceRange().getEnd(),
0, Builder,
- CTAK_Deduced)) {
+ CTAK_Specified)) {
Info.Param = makeTemplateParameter(
const_cast<NamedDecl *>(TemplateParams->getParam(I)));
// FIXME: These template arguments are temporary. Free them!
@@ -2500,6 +2500,12 @@ static bool AdjustFunctionParmAndArgTypesForDeduction(Sema &S,
if (ParamRefType) {
QualType PointeeType = ParamRefType->getPointeeType();
+ // If the argument has incomplete array type, try to complete it's type.
+ if (ArgType->isIncompleteArrayType() &&
+ !S.RequireCompleteExprType(Arg, S.PDiag(),
+ std::make_pair(SourceLocation(), S.PDiag())))
+ ArgType = Arg->getType();
+
// [C++0x] If P is an rvalue reference to a cv-unqualified
// template parameter and the argument is an lvalue, the type
// "lvalue reference to A" is used in place of A for type
@@ -2507,7 +2513,9 @@ static bool AdjustFunctionParmAndArgTypesForDeduction(Sema &S,
if (isa<RValueReferenceType>(ParamType)) {
if (!PointeeType.getQualifiers() &&
isa<TemplateTypeParmType>(PointeeType) &&
- Arg->Classify(S.Context).isLValue())
+ Arg->Classify(S.Context).isLValue() &&
+ Arg->getType() != S.Context.OverloadTy &&
+ Arg->getType() != S.Context.BoundMemberTy)
ArgType = S.Context.getLValueReferenceType(ArgType);
}
@@ -3884,6 +3892,13 @@ MarkUsedTemplateParameters(Sema &SemaRef, QualType T,
OnlyDeduced, Depth, Used);
break;
+ case Type::UnaryTransform:
+ if (!OnlyDeduced)
+ MarkUsedTemplateParameters(SemaRef,
+ cast<UnaryTransformType>(T)->getUnderlyingType(),
+ OnlyDeduced, Depth, Used);
+ break;
+
case Type::PackExpansion:
MarkUsedTemplateParameters(SemaRef,
cast<PackExpansionType>(T)->getPattern(),
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 92ba095..3c19641 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -13,6 +13,7 @@
#include "clang/Sema/SemaInternal.h"
#include "TreeTransform.h"
#include "clang/Sema/DeclSpec.h"
+#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/TemplateDeduction.h"
@@ -58,9 +59,13 @@ Sema::getTemplateInstantiationArgs(NamedDecl *D,
Result.addOuterTemplateArguments(Innermost);
DeclContext *Ctx = dyn_cast<DeclContext>(D);
- if (!Ctx)
+ if (!Ctx) {
Ctx = D->getDeclContext();
-
+
+ assert((!D->isTemplateParameter() || !Ctx->isTranslationUnit()) &&
+ "Template parameter doesn't have its context yet!");
+ }
+
while (!Ctx->isFileContext()) {
// Add template arguments from a class template instantiation.
if (ClassTemplateSpecializationDecl *Spec
@@ -446,10 +451,15 @@ void Sema::PrintInstantiationStack() {
Diags.Report(Active->PointOfInstantiation, DiagID)
<< Function
<< Active->InstantiationRange;
- } else {
+ } else if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
Diags.Report(Active->PointOfInstantiation,
diag::note_template_static_data_member_def_here)
- << cast<VarDecl>(D)
+ << VD
+ << Active->InstantiationRange;
+ } else {
+ Diags.Report(Active->PointOfInstantiation,
+ diag::note_template_type_alias_instantiation_here)
+ << cast<TypeAliasTemplateDecl>(D)
<< Active->InstantiationRange;
}
break;
@@ -918,7 +928,8 @@ TemplateInstantiator::RebuildElaboratedType(SourceLocation KeywordLoc,
// like it's likely to produce a lot of spurious errors.
if (Keyword != ETK_None && Keyword != ETK_Typename) {
TagTypeKind Kind = TypeWithKeyword::getTagTypeKindForKeyword(Keyword);
- if (!SemaRef.isAcceptableTagRedeclaration(TD, Kind, TagLocation, *Id)) {
+ if (!SemaRef.isAcceptableTagRedeclaration(TD, Kind, /*isDefinition*/false,
+ TagLocation, *Id)) {
SemaRef.Diag(TagLocation, diag::err_use_with_wrong_tag)
<< Id
<< FixItHint::CreateReplacement(SourceRange(TagLocation),
@@ -968,8 +979,7 @@ TemplateName TemplateInstantiator::TransformTemplateName(CXXScopeSpec &SS,
}
TemplateName Template = Arg.getAsTemplate();
- assert(!Template.isNull() && Template.getAsTemplateDecl() &&
- "Wrong kind of template template argument");
+ assert(!Template.isNull() && "Null template template argument");
// We don't ever want to substitute for a qualified template name, since
// the qualifier is handled separately. So, look through the qualified
@@ -1384,6 +1394,12 @@ static bool NeedsInstantiationAsFunctionType(TypeSourceInfo *T) {
for (unsigned I = 0, E = FP.getNumArgs(); I != E; ++I) {
ParmVarDecl *P = FP.getArg(I);
+ // The parameter's type as written might be dependent even if the
+ // decayed type was not dependent.
+ if (TypeSourceInfo *TSInfo = P->getTypeSourceInfo())
+ if (TSInfo->getType()->isDependentType())
+ return true;
+
// TODO: currently we always rebuild expressions. When we
// properly get lazier about this, we should use the same
// logic to avoid rebuilding prototypes here.
@@ -1729,6 +1745,8 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
TemplateDeclInstantiator Instantiator(*this, Instantiation, TemplateArgs);
llvm::SmallVector<Decl*, 4> Fields;
+ llvm::SmallVector<std::pair<FieldDecl*, FieldDecl*>, 4>
+ FieldsWithMemberInitializers;
for (RecordDecl::decl_iterator Member = Pattern->decls_begin(),
MemberEnd = Pattern->decls_end();
Member != MemberEnd; ++Member) {
@@ -1751,9 +1769,13 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
Decl *NewMember = Instantiator.Visit(*Member);
if (NewMember) {
- if (FieldDecl *Field = dyn_cast<FieldDecl>(NewMember))
+ if (FieldDecl *Field = dyn_cast<FieldDecl>(NewMember)) {
Fields.push_back(Field);
- else if (NewMember->isInvalidDecl())
+ FieldDecl *OldField = cast<FieldDecl>(*Member);
+ if (OldField->getInClassInitializer())
+ FieldsWithMemberInitializers.push_back(std::make_pair(OldField,
+ Field));
+ } else if (NewMember->isInvalidDecl())
Invalid = true;
} else {
// FIXME: Eventually, a NULL return will mean that one of the
@@ -1767,6 +1789,43 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
Fields.data(), Fields.size(), SourceLocation(), SourceLocation(),
0);
CheckCompletedCXXClass(Instantiation);
+
+ // Attach any in-class member initializers now the class is complete.
+ for (unsigned I = 0, N = FieldsWithMemberInitializers.size(); I != N; ++I) {
+ FieldDecl *OldField = FieldsWithMemberInitializers[I].first;
+ FieldDecl *NewField = FieldsWithMemberInitializers[I].second;
+ Expr *OldInit = OldField->getInClassInitializer();
+ ExprResult NewInit = SubstExpr(OldInit, TemplateArgs);
+
+ // If the initialization is no longer dependent, check it now.
+ if ((OldField->getType()->isDependentType() || OldInit->isTypeDependent())
+ && !NewField->getType()->isDependentType()
+ && !NewInit.get()->isTypeDependent()) {
+ // FIXME: handle list-initialization
+ SourceLocation EqualLoc = NewField->getLocation();
+ NewInit = PerformCopyInitialization(
+ InitializedEntity::InitializeMember(NewField), EqualLoc,
+ NewInit.release());
+
+ if (!NewInit.isInvalid()) {
+ CheckImplicitConversions(NewInit.get(), EqualLoc);
+
+ // C++0x [class.base.init]p7:
+ // The initialization of each base and member constitutes a
+ // full-expression.
+ NewInit = MaybeCreateExprWithCleanups(NewInit);
+ }
+ }
+
+ if (NewInit.isInvalid())
+ NewField->setInvalidDecl();
+ else
+ NewField->setInClassInitializer(NewInit.release());
+ }
+
+ if (!FieldsWithMemberInitializers.empty())
+ ActOnFinishDelayedMemberInitializers(Instantiation);
+
if (Instantiation->isInvalidDecl())
Invalid = true;
else {
@@ -2009,7 +2068,7 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation,
SuppressNew)
continue;
- if (Function->hasBody())
+ if (Function->isDefined())
continue;
if (TSK == TSK_ExplicitInstantiationDefinition) {
@@ -2019,7 +2078,7 @@ Sema::InstantiateClassMembers(SourceLocation PointOfInstantiation,
// specialization and is only an explicit instantiation definition
// of members whose definition is visible at the point of
// instantiation.
- if (!Pattern->hasBody())
+ if (!Pattern->isDefined())
continue;
Function->setTemplateSpecializationKind(TSK, PointOfInstantiation);
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 6e11ef5..e78aa29 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -128,8 +128,8 @@ TemplateDeclInstantiator::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) {
return Inst;
}
-Decl *TemplateDeclInstantiator::VisitTypedefNameDecl(TypedefNameDecl *D,
- bool IsTypeAlias) {
+Decl *TemplateDeclInstantiator::InstantiateTypedefNameDecl(TypedefNameDecl *D,
+ bool IsTypeAlias) {
bool Invalid = false;
TypeSourceInfo *DI = D->getTypeSourceInfo();
if (DI->getType()->isDependentType() ||
@@ -178,17 +178,62 @@ Decl *TemplateDeclInstantiator::VisitTypedefNameDecl(TypedefNameDecl *D,
SemaRef.InstantiateAttrs(TemplateArgs, D, Typedef);
Typedef->setAccess(D->getAccess());
- Owner->addDecl(Typedef);
return Typedef;
}
Decl *TemplateDeclInstantiator::VisitTypedefDecl(TypedefDecl *D) {
- return VisitTypedefNameDecl(D, /*IsTypeAlias=*/false);
+ Decl *Typedef = InstantiateTypedefNameDecl(D, /*IsTypeAlias=*/false);
+ Owner->addDecl(Typedef);
+ return Typedef;
}
Decl *TemplateDeclInstantiator::VisitTypeAliasDecl(TypeAliasDecl *D) {
- return VisitTypedefNameDecl(D, /*IsTypeAlias=*/true);
+ Decl *Typedef = InstantiateTypedefNameDecl(D, /*IsTypeAlias=*/true);
+ Owner->addDecl(Typedef);
+ return Typedef;
+}
+
+Decl *
+TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
+ // Create a local instantiation scope for this type alias template, which
+ // will contain the instantiations of the template parameters.
+ LocalInstantiationScope Scope(SemaRef);
+
+ TemplateParameterList *TempParams = D->getTemplateParameters();
+ TemplateParameterList *InstParams = SubstTemplateParams(TempParams);
+ if (!InstParams)
+ return 0;
+
+ TypeAliasDecl *Pattern = D->getTemplatedDecl();
+
+ TypeAliasTemplateDecl *PrevAliasTemplate = 0;
+ if (Pattern->getPreviousDeclaration()) {
+ DeclContext::lookup_result Found = Owner->lookup(Pattern->getDeclName());
+ if (Found.first != Found.second) {
+ PrevAliasTemplate = dyn_cast<TypeAliasTemplateDecl>(*Found.first);
+ }
+ }
+
+ TypeAliasDecl *AliasInst = cast_or_null<TypeAliasDecl>(
+ InstantiateTypedefNameDecl(Pattern, /*IsTypeAlias=*/true));
+ if (!AliasInst)
+ return 0;
+
+ TypeAliasTemplateDecl *Inst
+ = TypeAliasTemplateDecl::Create(SemaRef.Context, Owner, D->getLocation(),
+ D->getDeclName(), InstParams, AliasInst);
+ if (PrevAliasTemplate)
+ Inst->setPreviousDeclaration(PrevAliasTemplate);
+
+ Inst->setAccess(D->getAccess());
+
+ if (!PrevAliasTemplate)
+ Inst->setInstantiatedFromMemberTemplate(D);
+
+ Owner->addDecl(Inst);
+
+ return Inst;
}
/// \brief Instantiate an initializer, breaking it into separate
@@ -432,6 +477,7 @@ Decl *TemplateDeclInstantiator::VisitFieldDecl(FieldDecl *D) {
D->getLocation(),
D->isMutable(),
BitWidth,
+ D->hasInClassInitializer(),
D->getTypeSpecStartLoc(),
D->getAccess(),
0);
@@ -1171,7 +1217,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D,
D->isThisDeclarationADefinition()) {
// Check for a function body.
const FunctionDecl *Definition = 0;
- if (Function->hasBody(Definition) &&
+ if (Function->isDefined(Definition) &&
Definition->getTemplateSpecializationKind() == TSK_Undeclared) {
SemaRef.Diag(Function->getLocation(), diag::err_redefinition)
<< Function->getDeclName();
@@ -1203,7 +1249,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D,
default:
if (const FunctionDecl *RPattern
= R->getTemplateInstantiationPattern())
- if (RPattern->hasBody(RPattern)) {
+ if (RPattern->isDefined(RPattern)) {
SemaRef.Diag(Function->getLocation(), diag::err_redefinition)
<< Function->getDeclName();
SemaRef.Diag(R->getLocation(), diag::note_previous_definition);
@@ -1219,6 +1265,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D,
PrincipalDecl->isInIdentifierNamespace(Decl::IDNS_Ordinary))
PrincipalDecl->setNonMemberOperator();
+ assert(!D->isDefaulted() && "only methods should be defaulted");
return Function;
}
@@ -1451,7 +1498,14 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D,
else
Owner->addDecl(DeclToAdd);
}
-
+
+ if (D->isExplicitlyDefaulted()) {
+ SemaRef.SetDeclDefaulted(Method, Method->getLocation());
+ } else {
+ assert(!D->isDefaulted() &&
+ "should not implicitly default uninstantiated function");
+ }
+
return Method;
}
@@ -2079,8 +2133,8 @@ TemplateDeclInstantiator::SubstFunctionType(FunctionDecl *D,
bool
TemplateDeclInstantiator::InitFunctionInstantiation(FunctionDecl *New,
FunctionDecl *Tmpl) {
- if (Tmpl->isDeleted())
- New->setDeleted();
+ if (Tmpl->isDeletedAsWritten())
+ New->setDeletedAsWritten();
// If we are performing substituting explicitly-specified template arguments
// or deduced template arguments into a function template and we reach this
@@ -2186,6 +2240,7 @@ TemplateDeclInstantiator::InitFunctionInstantiation(FunctionDecl *New,
}
Expr *NoexceptExpr = 0;
if (Expr *OldNoexceptExpr = Proto->getNoexceptExpr()) {
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult E = SemaRef.SubstExpr(OldNoexceptExpr, TemplateArgs);
if (E.isUsable())
NoexceptExpr = E.take();
@@ -2255,7 +2310,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
FunctionDecl *Function,
bool Recursive,
bool DefinitionRequired) {
- if (Function->isInvalidDecl() || Function->hasBody())
+ if (Function->isInvalidDecl() || Function->isDefined())
return;
// Never instantiate an explicit specialization.
@@ -2264,12 +2319,19 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
// Find the function body that we'll be substituting.
const FunctionDecl *PatternDecl = Function->getTemplateInstantiationPattern();
- Stmt *Pattern = 0;
- if (PatternDecl)
- Pattern = PatternDecl->getBody(PatternDecl);
+ assert(PatternDecl && "instantiating a non-template");
+
+ Stmt *Pattern = PatternDecl->getBody(PatternDecl);
+ assert(PatternDecl && "template definition is not a template");
+ if (!Pattern) {
+ // Try to find a defaulted definition
+ PatternDecl->isDefined(PatternDecl);
+ }
+ assert(PatternDecl && "template definition is not a template");
// Postpone late parsed template instantiations.
- if (PatternDecl->isLateTemplateParsed() && !LateTemplateParser) {
+ if (PatternDecl->isLateTemplateParsed() &&
+ !LateTemplateParser) {
PendingInstantiations.push_back(
std::make_pair(Function, PointOfInstantiation));
return;
@@ -2277,13 +2339,13 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
// Call the LateTemplateParser callback if there a need to late parse
// a templated function definition.
- if (!Pattern && PatternDecl && PatternDecl->isLateTemplateParsed() &&
+ if (!Pattern && PatternDecl->isLateTemplateParsed() &&
LateTemplateParser) {
LateTemplateParser(OpaqueParser, PatternDecl);
Pattern = PatternDecl->getBody(PatternDecl);
}
- if (!Pattern) {
+ if (!Pattern && !PatternDecl->isDefaulted()) {
if (DefinitionRequired) {
if (Function->getPrimaryTemplate())
Diag(PointOfInstantiation,
@@ -2378,21 +2440,27 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
MultiLevelTemplateArgumentList TemplateArgs =
getTemplateInstantiationArgs(Function, 0, false, PatternDecl);
- // If this is a constructor, instantiate the member initializers.
- if (const CXXConstructorDecl *Ctor =
- dyn_cast<CXXConstructorDecl>(PatternDecl)) {
- InstantiateMemInitializers(cast<CXXConstructorDecl>(Function), Ctor,
- TemplateArgs);
- }
+ if (PatternDecl->isDefaulted()) {
+ ActOnFinishFunctionBody(Function, 0, /*IsInstantiation=*/true);
- // Instantiate the function body.
- StmtResult Body = SubstStmt(Pattern, TemplateArgs);
+ SetDeclDefaulted(Function, PatternDecl->getLocation());
+ } else {
+ // If this is a constructor, instantiate the member initializers.
+ if (const CXXConstructorDecl *Ctor =
+ dyn_cast<CXXConstructorDecl>(PatternDecl)) {
+ InstantiateMemInitializers(cast<CXXConstructorDecl>(Function), Ctor,
+ TemplateArgs);
+ }
- if (Body.isInvalid())
- Function->setInvalidDecl();
-
- ActOnFinishFunctionBody(Function, Body.get(),
- /*IsInstantiation=*/true);
+ // Instantiate the function body.
+ StmtResult Body = SubstStmt(Pattern, TemplateArgs);
+
+ if (Body.isInvalid())
+ Function->setInvalidDecl();
+
+ ActOnFinishFunctionBody(Function, Body.get(),
+ /*IsInstantiation=*/true);
+ }
PerformDependentDiagnostics(PatternDecl, TemplateArgs);
@@ -2415,9 +2483,13 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
PerformPendingInstantiations();
// Restore the set of pending vtables.
+ assert(VTableUses.empty() &&
+ "VTableUses should be empty before it is discarded.");
VTableUses.swap(SavedVTableUses);
// Restore the set of pending implicit instantiations.
+ assert(PendingInstantiations.empty() &&
+ "PendingInstantiations should be empty before it is discarded.");
PendingInstantiations.swap(SavedPendingInstantiations);
}
}
@@ -2484,6 +2556,10 @@ void Sema::InstantiateStaticDataMemberDefinition(
== TSK_ExplicitInstantiationDeclaration)
return;
+ // If we already have a definition, we're done.
+ if (Var->getDefinition())
+ return;
+
InstantiatingTemplate Inst(*this, PointOfInstantiation, Var);
if (Inst)
return;
@@ -2491,9 +2567,12 @@ void Sema::InstantiateStaticDataMemberDefinition(
// If we're performing recursive template instantiation, create our own
// queue of pending implicit instantiations that we will instantiate later,
// while we're still within our own instantiation context.
+ llvm::SmallVector<VTableUse, 16> SavedVTableUses;
std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
- if (Recursive)
+ if (Recursive) {
+ VTableUses.swap(SavedVTableUses);
PendingInstantiations.swap(SavedPendingInstantiations);
+ }
// Enter the scope of this instantiation. We don't use
// PushDeclContext because we don't have a scope.
@@ -2515,11 +2594,23 @@ void Sema::InstantiateStaticDataMemberDefinition(
}
if (Recursive) {
+ // Define any newly required vtables.
+ DefineUsedVTables();
+
// Instantiate any pending implicit instantiations found during the
// instantiation of this template.
PerformPendingInstantiations();
+ // Restore the set of pending vtables.
+ assert(VTableUses.empty() &&
+ "VTableUses should be empty before it is discarded, "
+ "while instantiating static data member.");
+ VTableUses.swap(SavedVTableUses);
+
// Restore the set of pending implicit instantiations.
+ assert(PendingInstantiations.empty() &&
+ "PendingInstantiations should be empty before it is discarded, "
+ "while instantiating static data member.");
PendingInstantiations.swap(SavedPendingInstantiations);
}
}
@@ -3115,10 +3206,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D,
/// \brief Performs template instantiation for all implicit template
/// instantiations we have seen until this point.
-///
-/// \returns true if anything was instantiated.
-bool Sema::PerformPendingInstantiations(bool LocalOnly) {
- bool InstantiatedAnything = false;
+void Sema::PerformPendingInstantiations(bool LocalOnly) {
while (!PendingLocalImplicitInstantiations.empty() ||
(!LocalOnly && !PendingInstantiations.empty())) {
PendingImplicitInstantiation Inst;
@@ -3139,7 +3227,6 @@ bool Sema::PerformPendingInstantiations(bool LocalOnly) {
TSK_ExplicitInstantiationDefinition;
InstantiateFunctionDefinition(/*FIXME:*/Inst.second, Function, true,
DefinitionRequired);
- InstantiatedAnything = true;
continue;
}
@@ -3176,10 +3263,7 @@ bool Sema::PerformPendingInstantiations(bool LocalOnly) {
TSK_ExplicitInstantiationDefinition;
InstantiateStaticDataMemberDefinition(/*FIXME:*/Inst.second, Var, true,
DefinitionRequired);
- InstantiatedAnything = true;
}
-
- return InstantiatedAnything;
}
void Sema::PerformDependentDiagnostics(const DeclContext *Pattern,
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp
index 096d353..86d3bc1 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp
@@ -617,7 +617,8 @@ bool Sema::containsUnexpandedParameterPacks(Declarator &D) {
const DeclSpec &DS = D.getDeclSpec();
switch (DS.getTypeSpecType()) {
case TST_typename:
- case TST_typeofType: {
+ case TST_typeofType:
+ case TST_underlyingType: {
QualType T = DS.getRepAsType().get();
if (!T.isNull() && T->containsUnexpandedParameterPack())
return true;
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp
index 00ac1d6..5fd8afa 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp
@@ -15,6 +15,7 @@
#include "clang/Sema/Template.h"
#include "clang/Basic/OpenCL.h"
#include "clang/AST/ASTContext.h"
+#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
@@ -836,6 +837,18 @@ static QualType ConvertDeclSpecToType(Sema &S, TypeProcessingState &state) {
}
break;
}
+ case DeclSpec::TST_underlyingType:
+ Result = S.GetTypeFromParser(DS.getRepAsType());
+ assert(!Result.isNull() && "Didn't get a type for __underlying_type?");
+ Result = S.BuildUnaryTransformType(Result,
+ UnaryTransformType::EnumUnderlyingType,
+ DS.getTypeSpecTypeLoc());
+ if (Result.isNull()) {
+ Result = Context.IntTy;
+ declarator.setInvalidType(true);
+ }
+ break;
+
case DeclSpec::TST_auto: {
// TypeQuals handled by caller.
Result = Context.getAutoType(QualType());
@@ -1048,6 +1061,9 @@ QualType Sema::BuildPointerType(QualType T,
QualType Sema::BuildReferenceType(QualType T, bool SpelledAsLValue,
SourceLocation Loc,
DeclarationName Entity) {
+ assert(Context.getCanonicalType(T) != Context.OverloadTy &&
+ "Unresolved overloaded function type");
+
// C++0x [dcl.ref]p6:
// If a typedef (7.1.3), a type template-parameter (14.3.1), or a
// decltype-specifier (7.1.6.2) denotes a type TR that is a reference to a
@@ -1464,41 +1480,37 @@ static void DiagnoseIgnoredQualifiers(unsigned Quals,
FixItHint VolatileFixIt;
FixItHint RestrictFixIt;
+ const SourceManager &SM = S.getSourceManager();
+
// FIXME: The locations here are set kind of arbitrarily. It'd be nicer to
// find a range and grow it to encompass all the qualifiers, regardless of
// the order in which they textually appear.
if (Quals & Qualifiers::Const) {
ConstFixIt = FixItHint::CreateRemoval(ConstQualLoc);
- Loc = ConstQualLoc;
- ++NumQuals;
QualStr = "const";
+ ++NumQuals;
+ if (!Loc.isValid() || SM.isBeforeInTranslationUnit(ConstQualLoc, Loc))
+ Loc = ConstQualLoc;
}
if (Quals & Qualifiers::Volatile) {
VolatileFixIt = FixItHint::CreateRemoval(VolatileQualLoc);
- if (NumQuals == 0) {
- Loc = VolatileQualLoc;
- QualStr = "volatile";
- } else {
- QualStr += " volatile";
- }
+ QualStr += (NumQuals == 0 ? "volatile" : " volatile");
++NumQuals;
+ if (!Loc.isValid() || SM.isBeforeInTranslationUnit(VolatileQualLoc, Loc))
+ Loc = VolatileQualLoc;
}
if (Quals & Qualifiers::Restrict) {
RestrictFixIt = FixItHint::CreateRemoval(RestrictQualLoc);
- if (NumQuals == 0) {
- Loc = RestrictQualLoc;
- QualStr = "restrict";
- } else {
- QualStr += " restrict";
- }
+ QualStr += (NumQuals == 0 ? "restrict" : " restrict");
++NumQuals;
+ if (!Loc.isValid() || SM.isBeforeInTranslationUnit(RestrictQualLoc, Loc))
+ Loc = RestrictQualLoc;
}
assert(NumQuals > 0 && "No known qualifiers?");
S.Diag(Loc, diag::warn_qual_return_type)
- << QualStr << NumQuals
- << ConstFixIt << VolatileFixIt << RestrictFixIt;
+ << QualStr << NumQuals << ConstFixIt << VolatileFixIt << RestrictFixIt;
}
/// GetTypeForDeclarator - Convert the type for the specified
@@ -1581,6 +1593,8 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
Error = 0; // Function prototype
break;
case Declarator::MemberContext:
+ if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_static)
+ break;
switch (cast<TagDecl>(CurContext)->getTagKind()) {
case TTK_Enum: assert(0 && "unhandled tag kind"); break;
case TTK_Struct: Error = 1; /* Struct member */ break;
@@ -1601,6 +1615,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
Error = 7; // Template type argument
break;
case Declarator::AliasDeclContext:
+ case Declarator::AliasTemplateContext:
Error = 9; // Type alias
break;
case Declarator::TypeNameContext:
@@ -1659,7 +1674,8 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
// Does this declaration declare a typedef-name?
bool IsTypedefName =
D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef ||
- D.getContext() == Declarator::AliasDeclContext;
+ D.getContext() == Declarator::AliasDeclContext ||
+ D.getContext() == Declarator::AliasTemplateContext;
// Walk the DeclTypeInfo, building the recursive type as we go.
// DeclTypeInfos are ordered from the identifier out, which is
@@ -1839,7 +1855,8 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
// anyway.
if (IsTypedefName && FTI.getExceptionSpecType())
Diag(FTI.getExceptionSpecLoc(), diag::err_exception_spec_in_typedef)
- << (D.getContext() == Declarator::AliasDeclContext);
+ << (D.getContext() == Declarator::AliasDeclContext ||
+ D.getContext() == Declarator::AliasTemplateContext);
if (!FTI.NumArgs && !FTI.isVariadic && !getLangOptions().CPlusPlus) {
// Simple void foo(), where the incoming T is the result type.
@@ -2204,6 +2221,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
case Declarator::ObjCPrototypeContext: // FIXME: special diagnostic here?
case Declarator::TypeNameContext:
case Declarator::AliasDeclContext:
+ case Declarator::AliasTemplateContext:
case Declarator::MemberContext:
case Declarator::BlockContext:
case Declarator::ForContext:
@@ -2367,6 +2385,16 @@ namespace {
Sema::GetTypeFromParser(DS.getRepAsType(), &TInfo);
TL.setUnderlyingTInfo(TInfo);
}
+ void VisitUnaryTransformTypeLoc(UnaryTransformTypeLoc TL) {
+ // FIXME: This holds only because we only have one unary transform.
+ assert(DS.getTypeSpecType() == DeclSpec::TST_underlyingType);
+ TL.setKWLoc(DS.getTypeSpecTypeLoc());
+ TL.setParensRange(DS.getTypeofParensRange());
+ assert(DS.getRepAsType());
+ TypeSourceInfo *TInfo = 0;
+ Sema::GetTypeFromParser(DS.getRepAsType(), &TInfo);
+ TL.setUnderlyingTInfo(TInfo);
+ }
void VisitBuiltinTypeLoc(BuiltinTypeLoc TL) {
// By default, use the source location of the type specifier.
TL.setBuiltinLoc(DS.getTypeSpecTypeLoc());
@@ -2640,13 +2668,17 @@ TypeResult Sema::ActOnTypeName(Scope *S, Declarator &D) {
CheckExtraCXXDefaultArguments(D);
// C++0x [dcl.type]p3:
- // A type-specifier-seq shall not define a class or enumeration
- // unless it appears in the type-id of an alias-declaration
- // (7.1.3).
- if (OwnedTag && OwnedTag->isDefinition() &&
- D.getContext() != Declarator::AliasDeclContext)
- Diag(OwnedTag->getLocation(), diag::err_type_defined_in_type_specifier)
- << Context.getTypeDeclType(OwnedTag);
+ // A type-specifier-seq shall not define a class or enumeration unless
+ // it appears in the type-id of an alias-declaration (7.1.3) that is not
+ // the declaration of a template-declaration.
+ if (OwnedTag && OwnedTag->isDefinition()) {
+ if (D.getContext() == Declarator::AliasTemplateContext)
+ Diag(OwnedTag->getLocation(), diag::err_type_defined_in_alias_template)
+ << Context.getTypeDeclType(OwnedTag);
+ else if (D.getContext() != Declarator::AliasDeclContext)
+ Diag(OwnedTag->getLocation(), diag::err_type_defined_in_type_specifier)
+ << Context.getTypeDeclType(OwnedTag);
+ }
}
return CreateParsedType(T, TInfo);
@@ -3213,6 +3245,82 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type,
} while ((attrs = next));
}
+/// \brief Ensure that the type of the given expression is complete.
+///
+/// This routine checks whether the expression \p E has a complete type. If the
+/// expression refers to an instantiable construct, that instantiation is
+/// performed as needed to complete its type. Furthermore
+/// Sema::RequireCompleteType is called for the expression's type (or in the
+/// case of a reference type, the referred-to type).
+///
+/// \param E The expression whose type is required to be complete.
+/// \param PD The partial diagnostic that will be printed out if the type cannot
+/// be completed.
+///
+/// \returns \c true if the type of \p E is incomplete and diagnosed, \c false
+/// otherwise.
+bool Sema::RequireCompleteExprType(Expr *E, const PartialDiagnostic &PD,
+ std::pair<SourceLocation,
+ PartialDiagnostic> Note) {
+ QualType T = E->getType();
+
+ // Fast path the case where the type is already complete.
+ if (!T->isIncompleteType())
+ return false;
+
+ // Incomplete array types may be completed by the initializer attached to
+ // their definitions. For static data members of class templates we need to
+ // instantiate the definition to get this initializer and complete the type.
+ if (T->isIncompleteArrayType()) {
+ if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E->IgnoreParens())) {
+ if (VarDecl *Var = dyn_cast<VarDecl>(DRE->getDecl())) {
+ if (Var->isStaticDataMember() &&
+ Var->getInstantiatedFromStaticDataMember()) {
+
+ MemberSpecializationInfo *MSInfo = Var->getMemberSpecializationInfo();
+ assert(MSInfo && "Missing member specialization information?");
+ if (MSInfo->getTemplateSpecializationKind()
+ != TSK_ExplicitSpecialization) {
+ // If we don't already have a point of instantiation, this is it.
+ if (MSInfo->getPointOfInstantiation().isInvalid()) {
+ MSInfo->setPointOfInstantiation(E->getLocStart());
+
+ // This is a modification of an existing AST node. Notify
+ // listeners.
+ if (ASTMutationListener *L = getASTMutationListener())
+ L->StaticDataMemberInstantiated(Var);
+ }
+
+ InstantiateStaticDataMemberDefinition(E->getExprLoc(), Var);
+
+ // Update the type to the newly instantiated definition's type both
+ // here and within the expression.
+ if (VarDecl *Def = Var->getDefinition()) {
+ DRE->setDecl(Def);
+ T = Def->getType();
+ DRE->setType(T);
+ E->setType(T);
+ }
+ }
+
+ // We still go on to try to complete the type independently, as it
+ // may also require instantiations or diagnostics if it remains
+ // incomplete.
+ }
+ }
+ }
+ }
+
+ // FIXME: Are there other cases which require instantiating something other
+ // than the type to complete the type of an expression?
+
+ // Look through reference types and complete the referred type.
+ if (const ReferenceType *Ref = T->getAs<ReferenceType>())
+ T = Ref->getPointeeType();
+
+ return RequireCompleteType(E->getExprLoc(), T, PD, Note);
+}
+
/// @brief Ensure that the type T is a complete type.
///
/// This routine checks whether the type @p T is complete in any
@@ -3363,3 +3471,27 @@ QualType Sema::BuildDecltypeType(Expr *E, SourceLocation Loc) {
return Context.getDecltypeType(E);
}
+
+QualType Sema::BuildUnaryTransformType(QualType BaseType,
+ UnaryTransformType::UTTKind UKind,
+ SourceLocation Loc) {
+ switch (UKind) {
+ case UnaryTransformType::EnumUnderlyingType:
+ if (!BaseType->isDependentType() && !BaseType->isEnumeralType()) {
+ Diag(Loc, diag::err_only_enums_have_underlying_types);
+ return QualType();
+ } else {
+ QualType Underlying = BaseType;
+ if (!BaseType->isDependentType()) {
+ EnumDecl *ED = BaseType->getAs<EnumType>()->getDecl();
+ assert(ED && "EnumType has no EnumDecl");
+ DiagnoseUseOfDecl(ED, Loc);
+ Underlying = ED->getIntegerType();
+ }
+ assert(!Underlying.isNull());
+ return Context.getUnaryTransformType(BaseType, Underlying,
+ UnaryTransformType::EnumUnderlyingType);
+ }
+ }
+ llvm_unreachable("unknown unary transform type");
+}
diff --git a/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h b/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h
index 2a71e14..ff2e46a 100644
--- a/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h
+++ b/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h
@@ -21,6 +21,7 @@
#include "clang/Sema/ScopeInfo.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclObjC.h"
+#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
@@ -701,6 +702,11 @@ public:
/// By default, builds a new TypeOfType with the given underlying type.
QualType RebuildTypeOfType(QualType Underlying);
+ /// \brief Build a new unary transform type.
+ QualType RebuildUnaryTransformType(QualType BaseType,
+ UnaryTransformType::UTTKind UKind,
+ SourceLocation Loc);
+
/// \brief Build a new C++0x decltype type.
///
/// By default, performs semantic analysis when building the decltype type.
@@ -855,7 +861,7 @@ public:
case LookupResult::Found:
case LookupResult::FoundOverloaded:
case LookupResult::FoundUnresolvedValue: {
- NamedDecl *SomeDecl = Result.getRepresentativeDecl();
+ NamedDecl *SomeDecl = Result.getRepresentativeDecl();
unsigned Kind = 0;
if (isa<TypedefDecl>(SomeDecl)) Kind = 1;
else if (isa<TypeAliasDecl>(SomeDecl)) Kind = 2;
@@ -863,7 +869,7 @@ public:
SemaRef.Diag(IdLoc, diag::err_tag_reference_non_tag) << Kind;
SemaRef.Diag(SomeDecl->getLocation(), diag::note_declared_at);
break;
- }
+ }
default:
// FIXME: Would be nice to highlight just the source range.
SemaRef.Diag(IdLoc, diag::err_not_tag_in_scope)
@@ -873,7 +879,8 @@ public:
return QualType();
}
- if (!SemaRef.isAcceptableTagRedeclaration(Tag, Kind, IdLoc, *Id)) {
+ if (!SemaRef.isAcceptableTagRedeclaration(Tag, Kind, /*isDefinition*/false,
+ IdLoc, *Id)) {
SemaRef.Diag(KeywordLoc, diag::err_use_with_wrong_tag) << Id;
SemaRef.Diag(Tag->getLocation(), diag::note_previous_use);
return QualType();
@@ -1372,7 +1379,7 @@ public:
UnaryExprOrTypeTrait ExprKind,
SourceRange R) {
ExprResult Result
- = getSema().CreateUnaryExprOrTypeTraitExpr(SubExpr, OpLoc, ExprKind, R);
+ = getSema().CreateUnaryExprOrTypeTraitExpr(SubExpr, OpLoc, ExprKind);
if (Result.isInvalid())
return ExprError();
@@ -2567,9 +2574,13 @@ TreeTransform<Derived>::TransformNestedNameSpecifierLoc(
Q.getLocalEndLoc());
break;
}
-
- SemaRef.Diag(TL.getBeginLoc(), diag::err_nested_name_spec_non_tag)
- << TL.getType() << SS.getRange();
+ // If the nested-name-specifier is an invalid type def, don't emit an
+ // error because a previous error should have already been emitted.
+ TypedefTypeLoc* TTL = dyn_cast<TypedefTypeLoc>(&TL);
+ if (!TTL || !TTL->getTypedefNameDecl()->isInvalidDecl()) {
+ SemaRef.Diag(TL.getBeginLoc(), diag::err_nested_name_spec_non_tag)
+ << TL.getType() << SS.getRange();
+ }
return NestedNameSpecifierLoc();
}
}
@@ -4154,6 +4165,29 @@ QualType TreeTransform<Derived>::TransformDecltypeType(TypeLocBuilder &TLB,
}
template<typename Derived>
+QualType TreeTransform<Derived>::TransformUnaryTransformType(
+ TypeLocBuilder &TLB,
+ UnaryTransformTypeLoc TL) {
+ QualType Result = TL.getType();
+ if (Result->isDependentType()) {
+ const UnaryTransformType *T = TL.getTypePtr();
+ QualType NewBase =
+ getDerived().TransformType(TL.getUnderlyingTInfo())->getType();
+ Result = getDerived().RebuildUnaryTransformType(NewBase,
+ T->getUTTKind(),
+ TL.getKWLoc());
+ if (Result.isNull())
+ return QualType();
+ }
+
+ UnaryTransformTypeLoc NewTL = TLB.push<UnaryTransformTypeLoc>(Result);
+ NewTL.setKWLoc(TL.getKWLoc());
+ NewTL.setParensRange(TL.getParensRange());
+ NewTL.setUnderlyingTInfo(TL.getUnderlyingTInfo());
+ return Result;
+}
+
+template<typename Derived>
QualType TreeTransform<Derived>::TransformAutoType(TypeLocBuilder &TLB,
AutoTypeLoc TL) {
const AutoType *T = TL.getTypePtr();
@@ -4389,6 +4423,23 @@ QualType TreeTransform<Derived>::TransformTemplateSpecializationType(
NewTemplateArgs);
if (!Result.isNull()) {
+ // Specializations of template template parameters are represented as
+ // TemplateSpecializationTypes, and substitution of type alias templates
+ // within a dependent context can transform them into
+ // DependentTemplateSpecializationTypes.
+ if (isa<DependentTemplateSpecializationType>(Result)) {
+ DependentTemplateSpecializationTypeLoc NewTL
+ = TLB.push<DependentTemplateSpecializationTypeLoc>(Result);
+ NewTL.setKeywordLoc(TL.getTemplateNameLoc());
+ NewTL.setQualifierLoc(NestedNameSpecifierLoc());
+ NewTL.setNameLoc(TL.getTemplateNameLoc());
+ NewTL.setLAngleLoc(TL.getLAngleLoc());
+ NewTL.setRAngleLoc(TL.getRAngleLoc());
+ for (unsigned i = 0, e = NewTemplateArgs.size(); i != e; ++i)
+ NewTL.setArgLocInfo(i, NewTemplateArgs[i].getLocInfo());
+ return Result;
+ }
+
TemplateSpecializationTypeLoc NewTL
= TLB.push<TemplateSpecializationTypeLoc>(Result);
NewTL.setTemplateNameLoc(TL.getTemplateNameLoc());
@@ -4478,6 +4529,23 @@ TreeTransform<Derived>::TransformElaboratedType(TypeLocBuilder &TLB,
if (NamedT.isNull())
return QualType();
+ // C++0x [dcl.type.elab]p2:
+ // If the identifier resolves to a typedef-name or the simple-template-id
+ // resolves to an alias template specialization, the
+ // elaborated-type-specifier is ill-formed.
+ if (T->getKeyword() != ETK_None && T->getKeyword() != ETK_Typename) {
+ if (const TemplateSpecializationType *TST =
+ NamedT->getAs<TemplateSpecializationType>()) {
+ TemplateName Template = TST->getTemplateName();
+ if (TypeAliasTemplateDecl *TAT =
+ dyn_cast_or_null<TypeAliasTemplateDecl>(Template.getAsTemplateDecl())) {
+ SemaRef.Diag(TL.getNamedTypeLoc().getBeginLoc(),
+ diag::err_tag_reference_non_tag) << 4;
+ SemaRef.Diag(TAT->getLocation(), diag::note_declared_at);
+ }
+ }
+ }
+
QualType Result = TL.getType();
if (getDerived().AlwaysRebuild() ||
QualifierLoc != TL.getQualifierLoc() ||
@@ -6629,8 +6697,12 @@ template<typename Derived>
ExprResult
TreeTransform<Derived>::TransformCXXThisExpr(CXXThisExpr *E) {
DeclContext *DC = getSema().getFunctionLevelDeclContext();
- CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(DC);
- QualType T = MD->getThisType(getSema().Context);
+ QualType T;
+ if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(DC))
+ T = MD->getThisType(getSema().Context);
+ else
+ T = getSema().Context.getPointerType(
+ getSema().Context.getRecordType(cast<CXXRecordDecl>(DC)));
if (!getDerived().AlwaysRebuild() && T == E->getType())
return SemaRef.Owned(E);
@@ -7449,6 +7521,7 @@ TreeTransform<Derived>::TransformUnresolvedMemberExpr(UnresolvedMemberExpr *Old)
template<typename Derived>
ExprResult
TreeTransform<Derived>::TransformCXXNoexceptExpr(CXXNoexceptExpr *E) {
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult SubExpr = getDerived().TransformExpr(E->getOperand());
if (SubExpr.isInvalid())
return ExprError();
@@ -7700,6 +7773,11 @@ TreeTransform<Derived>::TransformBlockExpr(BlockExpr *E) {
BlockScopeInfo *blockScope = SemaRef.getCurBlock();
blockScope->TheDecl->setIsVariadic(oldBlock->isVariadic());
+ // We built a new blockScopeInfo in call to ActOnBlockStart
+ // in above, CapturesCXXThis need be set here from the block
+ // expression.
+ blockScope->CapturesCXXThis = oldBlock->capturesCXXThis();
+
llvm::SmallVector<ParmVarDecl*, 4> params;
llvm::SmallVector<QualType, 4> paramTypes;
@@ -7759,22 +7837,21 @@ TreeTransform<Derived>::TransformBlockExpr(BlockExpr *E) {
#ifndef NDEBUG
// In builds with assertions, make sure that we captured everything we
// captured before.
+ if (!SemaRef.getDiagnostics().hasErrorOccurred()) {
+ for (BlockDecl::capture_iterator i = oldBlock->capture_begin(),
+ e = oldBlock->capture_end(); i != e; ++i) {
+ VarDecl *oldCapture = i->getVariable();
+
+ // Ignore parameter packs.
+ if (isa<ParmVarDecl>(oldCapture) &&
+ cast<ParmVarDecl>(oldCapture)->isParameterPack())
+ continue;
- if (oldBlock->capturesCXXThis()) assert(blockScope->CapturesCXXThis);
-
- for (BlockDecl::capture_iterator i = oldBlock->capture_begin(),
- e = oldBlock->capture_end(); i != e; ++i) {
- VarDecl *oldCapture = i->getVariable();
-
- // Ignore parameter packs.
- if (isa<ParmVarDecl>(oldCapture) &&
- cast<ParmVarDecl>(oldCapture)->isParameterPack())
- continue;
-
- VarDecl *newCapture =
- cast<VarDecl>(getDerived().TransformDecl(E->getCaretLocation(),
- oldCapture));
- assert(blockScope->CaptureMap.count(newCapture));
+ VarDecl *newCapture =
+ cast<VarDecl>(getDerived().TransformDecl(E->getCaretLocation(),
+ oldCapture));
+ assert(blockScope->CaptureMap.count(newCapture));
+ }
}
#endif
@@ -7805,6 +7882,13 @@ TreeTransform<Derived>::TransformBlockDeclRefExpr(BlockDeclRefExpr *E) {
ND, NameInfo, 0);
}
+template<typename Derived>
+ExprResult
+TreeTransform<Derived>::TransformAsTypeExpr(AsTypeExpr *E) {
+ assert(false && "Cannot transform asType expressions yet");
+ return SemaRef.Owned(E);
+}
+
//===----------------------------------------------------------------------===//
// Type reconstruction
//===----------------------------------------------------------------------===//
@@ -8010,6 +8094,13 @@ QualType TreeTransform<Derived>::RebuildDecltypeType(Expr *E,
}
template<typename Derived>
+QualType TreeTransform<Derived>::RebuildUnaryTransformType(QualType BaseType,
+ UnaryTransformType::UTTKind UKind,
+ SourceLocation Loc) {
+ return SemaRef.BuildUnaryTransformType(BaseType, UKind, Loc);
+}
+
+template<typename Derived>
QualType TreeTransform<Derived>::RebuildTemplateSpecializationType(
TemplateName Template,
SourceLocation TemplateNameLoc,
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
index d2e41a9..8fb20d2 100644
--- a/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
+++ b/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp
@@ -92,6 +92,7 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
PARSE_LANGOPT_IMPORTANT(AppleKext, diag::warn_pch_apple_kext);
PARSE_LANGOPT_IMPORTANT(ObjCDefaultSynthProperties,
diag::warn_pch_objc_auto_properties);
+ PARSE_LANGOPT_BENIGN(ObjCInferRelatedResultType)
PARSE_LANGOPT_IMPORTANT(NoConstantCFStrings,
diag::warn_pch_no_constant_cfstrings);
PARSE_LANGOPT_BENIGN(PascalStrings);
@@ -1697,7 +1698,8 @@ namespace {
using namespace clang::io;
HeaderFileInfo HFI;
unsigned Flags = *d++;
- HFI.isImport = (Flags >> 3) & 0x01;
+ HFI.isImport = (Flags >> 4) & 0x01;
+ HFI.isPragmaOnce = (Flags >> 3) & 0x01;
HFI.DirInfo = (Flags >> 1) & 0x03;
HFI.Resolved = Flags & 0x01;
HFI.NumIncludes = ReadUnalignedLE16(d);
@@ -1841,6 +1843,22 @@ MacroDefinition *ASTReader::getMacroDefinition(MacroID ID) {
return MacroDefinitionsLoaded[ID - 1];
}
+const FileEntry *ASTReader::getFileEntry(llvm::StringRef filenameStrRef) {
+ std::string Filename = filenameStrRef;
+ MaybeAddSystemRootToFilename(Filename);
+ const FileEntry *File = FileMgr.getFile(Filename);
+ if (File == 0 && !OriginalDir.empty() && !CurrentDir.empty() &&
+ OriginalDir != CurrentDir) {
+ std::string resolved = resolveFileRelativeToOriginalDir(Filename,
+ OriginalDir,
+ CurrentDir);
+ if (!resolved.empty())
+ File = FileMgr.getFile(resolved);
+ }
+
+ return File;
+}
+
/// \brief If we are loading a relocatable PCH file, and the filename is
/// not an absolute path, add the system root to the beginning of the file
/// name.
@@ -2113,15 +2131,6 @@ ASTReader::ReadASTBlock(PerFileData &F) {
TotalVisibleDeclContexts += Record[3];
break;
- case TENTATIVE_DEFINITIONS:
- // Optimization for the first block.
- if (TentativeDefinitions.empty())
- TentativeDefinitions.swap(Record);
- else
- TentativeDefinitions.insert(TentativeDefinitions.end(),
- Record.begin(), Record.end());
- break;
-
case UNUSED_FILESCOPED_DECLS:
// Optimization for the first block.
if (UnusedFileScopedDecls.empty())
@@ -2131,6 +2140,15 @@ ASTReader::ReadASTBlock(PerFileData &F) {
Record.begin(), Record.end());
break;
+ case DELEGATING_CTORS:
+ // Optimization for the first block.
+ if (DelegatingCtorDecls.empty())
+ DelegatingCtorDecls.swap(Record);
+ else
+ DelegatingCtorDecls.insert(DelegatingCtorDecls.end(),
+ Record.begin(), Record.end());
+ break;
+
case WEAK_UNDECLARED_IDENTIFIERS:
// Later blocks overwrite earlier ones.
WeakUndeclaredIdentifiers.swap(Record);
@@ -2176,6 +2194,11 @@ ASTReader::ReadASTBlock(PerFileData &F) {
F.LocalSLocSize = Record[1];
break;
+ case FILE_SOURCE_LOCATION_OFFSETS:
+ F.SLocFileOffsets = (const uint32_t *)BlobStart;
+ F.LocalNumSLocFileEntries = Record[0];
+ break;
+
case SOURCE_LOCATION_PRELOADS:
if (PreloadSLocEntries.empty())
PreloadSLocEntries.swap(Record);
@@ -2236,6 +2259,10 @@ ASTReader::ReadASTBlock(PerFileData &F) {
MaybeAddSystemRootToFilename(OriginalFileName);
break;
+ case ORIGINAL_FILE_ID:
+ OriginalFileID = FileID::get(Record[0]);
+ break;
+
case ORIGINAL_PCH_DIR:
// The primary AST will be the last to get here, so it will be the one
// that's used.
@@ -2330,6 +2357,15 @@ ASTReader::ReadASTBlock(PerFileData &F) {
// Later tables overwrite earlier ones.
OpenCLExtensions.swap(Record);
break;
+
+ case TENTATIVE_DEFINITIONS:
+ // Optimization for the first block.
+ if (TentativeDefinitions.empty())
+ TentativeDefinitions.swap(Record);
+ else
+ TentativeDefinitions.insert(TentativeDefinitions.end(),
+ Record.begin(), Record.end());
+ break;
}
First = false;
}
@@ -2337,6 +2373,75 @@ ASTReader::ReadASTBlock(PerFileData &F) {
return Failure;
}
+ASTReader::ASTReadResult ASTReader::validateFileEntries() {
+ for (unsigned CI = 0, CN = Chain.size(); CI != CN; ++CI) {
+ PerFileData *F = Chain[CI];
+ llvm::BitstreamCursor &SLocEntryCursor = F->SLocEntryCursor;
+
+ for (unsigned i = 0, e = F->LocalNumSLocFileEntries; i != e; ++i) {
+ SLocEntryCursor.JumpToBit(F->SLocFileOffsets[i]);
+ unsigned Code = SLocEntryCursor.ReadCode();
+ if (Code == llvm::bitc::END_BLOCK ||
+ Code == llvm::bitc::ENTER_SUBBLOCK ||
+ Code == llvm::bitc::DEFINE_ABBREV) {
+ Error("incorrectly-formatted source location entry in AST file");
+ return Failure;
+ }
+
+ RecordData Record;
+ const char *BlobStart;
+ unsigned BlobLen;
+ switch (SLocEntryCursor.ReadRecord(Code, Record, &BlobStart, &BlobLen)) {
+ default:
+ Error("incorrectly-formatted source location entry in AST file");
+ return Failure;
+
+ case SM_SLOC_FILE_ENTRY: {
+ llvm::StringRef Filename(BlobStart, BlobLen);
+ const FileEntry *File = getFileEntry(Filename);
+
+ if (File == 0) {
+ std::string ErrorStr = "could not find file '";
+ ErrorStr += Filename;
+ ErrorStr += "' referenced by AST file";
+ Error(ErrorStr.c_str());
+ return IgnorePCH;
+ }
+
+ if (Record.size() < 6) {
+ Error("source location entry is incorrect");
+ return Failure;
+ }
+
+ // The stat info from the FileEntry came from the cached stat
+ // info of the PCH, so we cannot trust it.
+ struct stat StatBuf;
+ if (::stat(File->getName(), &StatBuf) != 0) {
+ StatBuf.st_size = File->getSize();
+ StatBuf.st_mtime = File->getModificationTime();
+ }
+
+ if (((off_t)Record[4] != StatBuf.st_size
+#if !defined(LLVM_ON_WIN32)
+ // In our regression testing, the Windows file system seems to
+ // have inconsistent modification times that sometimes
+ // erroneously trigger this error-handling path.
+ || (time_t)Record[5] != StatBuf.st_mtime
+#endif
+ )) {
+ Error(diag::err_fe_pch_file_modified, Filename);
+ return IgnorePCH;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ return Success;
+}
+
ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName,
ASTFileType Type) {
switch(ReadASTCore(FileName, Type)) {
@@ -2347,6 +2452,14 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName,
// Here comes stuff that we only do once the entire chain is loaded.
+ if (!DisableValidation) {
+ switch(validateFileEntries()) {
+ case Failure: return Failure;
+ case IgnorePCH: return IgnorePCH;
+ case Success: break;
+ }
+ }
+
// Allocate space for loaded slocentries, identifiers, decls and types.
unsigned TotalNumIdentifiers = 0, TotalNumTypes = 0, TotalNumDecls = 0,
TotalNumPreallocatedPreprocessingEntities = 0, TotalNumMacroDefs = 0,
@@ -2372,7 +2485,7 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName,
PP->getHeaderSearchInfo().SetExternalLookup(this);
if (TotalNumPreallocatedPreprocessingEntities > 0) {
if (!PP->getPreprocessingRecord())
- PP->createPreprocessingRecord();
+ PP->createPreprocessingRecord(true);
PP->getPreprocessingRecord()->SetExternalSource(*this,
TotalNumPreallocatedPreprocessingEntities);
}
@@ -2441,12 +2554,15 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName,
// the source manager to the file source file from which the preamble was
// built. This is the only valid way to use a precompiled preamble.
if (Type == Preamble) {
- SourceLocation Loc
- = SourceMgr.getLocation(FileMgr.getFile(getOriginalSourceFile()), 1, 1);
- if (Loc.isValid()) {
- std::pair<FileID, unsigned> Decomposed = SourceMgr.getDecomposedLoc(Loc);
- SourceMgr.SetPreambleFileID(Decomposed.first);
+ if (OriginalFileID.isInvalid()) {
+ SourceLocation Loc
+ = SourceMgr.getLocation(FileMgr.getFile(getOriginalSourceFile()), 1, 1);
+ if (Loc.isValid())
+ OriginalFileID = SourceMgr.getDecomposedLoc(Loc).first;
}
+
+ if (!OriginalFileID.isInvalid())
+ SourceMgr.SetPreambleFileID(OriginalFileID);
}
return Success;
@@ -2571,7 +2687,7 @@ void ASTReader::setPreprocessor(Preprocessor &pp) {
TotalNum += Chain[I]->NumPreallocatedPreprocessingEntities;
if (TotalNum) {
if (!PP->getPreprocessingRecord())
- PP->createPreprocessingRecord();
+ PP->createPreprocessingRecord(true);
PP->getPreprocessingRecord()->SetExternalSource(*this, TotalNum);
}
}
@@ -2819,6 +2935,7 @@ bool ASTReader::ParseLanguageOptions(
PARSE_LANGOPT(ObjCNonFragileABI2);
PARSE_LANGOPT(AppleKext);
PARSE_LANGOPT(ObjCDefaultSynthProperties);
+ PARSE_LANGOPT(ObjCInferRelatedResultType);
PARSE_LANGOPT(NoConstantCFStrings);
PARSE_LANGOPT(PascalStrings);
PARSE_LANGOPT(WritableStrings);
@@ -3182,6 +3299,13 @@ QualType ASTReader::ReadTypeRecord(unsigned Index) {
case TYPE_DECLTYPE:
return Context->getDecltypeType(ReadExpr(*Loc.F));
+ case TYPE_UNARY_TRANSFORM: {
+ QualType BaseType = GetType(Record[0]);
+ QualType UnderlyingType = GetType(Record[1]);
+ UnaryTransformType::UTTKind UKind = (UnaryTransformType::UTTKind)Record[2];
+ return Context->getUnaryTransformType(BaseType, UnderlyingType, UKind);
+ }
+
case TYPE_AUTO:
return Context->getAutoType(GetType(Record[0]));
@@ -3356,14 +3480,14 @@ QualType ASTReader::ReadTypeRecord(unsigned Index) {
TemplateName Name = ReadTemplateName(*Loc.F, Record, Idx);
llvm::SmallVector<TemplateArgument, 8> Args;
ReadTemplateArgumentList(Args, *Loc.F, Record, Idx);
- QualType Canon = GetType(Record[Idx++]);
+ QualType Underlying = GetType(Record[Idx++]);
QualType T;
- if (Canon.isNull())
+ if (Underlying.isNull())
T = Context->getCanonicalTemplateSpecializationType(Name, Args.data(),
Args.size());
else
T = Context->getTemplateSpecializationType(Name, Args.data(),
- Args.size(), Canon);
+ Args.size(), Underlying);
const_cast<Type*>(T.getTypePtr())->setDependent(IsDependent);
return T;
}
@@ -3498,6 +3622,12 @@ void TypeLocReader::VisitTypeOfTypeLoc(TypeOfTypeLoc TL) {
void TypeLocReader::VisitDecltypeTypeLoc(DecltypeTypeLoc TL) {
TL.setNameLoc(ReadSourceLocation(Record, Idx));
}
+void TypeLocReader::VisitUnaryTransformTypeLoc(UnaryTransformTypeLoc TL) {
+ TL.setKWLoc(ReadSourceLocation(Record, Idx));
+ TL.setLParenLoc(ReadSourceLocation(Record, Idx));
+ TL.setRParenLoc(ReadSourceLocation(Record, Idx));
+ TL.setUnderlyingTInfo(Reader.GetTypeSourceInfo(F, Record, Idx));
+}
void TypeLocReader::VisitAutoTypeLoc(AutoTypeLoc TL) {
TL.setNameLoc(ReadSourceLocation(Record, Idx));
}
@@ -4099,6 +4229,13 @@ void ASTReader::InitializeSema(Sema &S) {
SemaObj->UnusedFileScopedDecls.push_back(D);
}
+ // If there were any delegating constructors, add them to Sema's list
+ for (unsigned I = 0, N = DelegatingCtorDecls.size(); I != N; ++I) {
+ CXXConstructorDecl *D
+ = cast<CXXConstructorDecl>(GetDecl(DelegatingCtorDecls[I]));
+ SemaObj->DelegatingCtorDecls.push_back(D);
+ }
+
// If there were any locally-scoped external declarations,
// deserialize them and add them to Sema's table of locally-scoped
// external declarations.
@@ -4710,18 +4847,28 @@ ASTReader::ReadCXXCtorInitializers(PerFileData &F, const RecordData &Record,
bool IsBaseVirtual = false;
FieldDecl *Member = 0;
IndirectFieldDecl *IndirectMember = 0;
+ CXXConstructorDecl *Target = 0;
- bool IsBaseInitializer = Record[Idx++];
- if (IsBaseInitializer) {
+ CtorInitializerType Type = (CtorInitializerType)Record[Idx++];
+ switch (Type) {
+ case CTOR_INITIALIZER_BASE:
BaseClassInfo = GetTypeSourceInfo(F, Record, Idx);
IsBaseVirtual = Record[Idx++];
- } else {
- bool IsIndirectMemberInitializer = Record[Idx++];
- if (IsIndirectMemberInitializer)
- IndirectMember = cast<IndirectFieldDecl>(GetDecl(Record[Idx++]));
- else
- Member = cast<FieldDecl>(GetDecl(Record[Idx++]));
+ break;
+
+ case CTOR_INITIALIZER_DELEGATING:
+ Target = cast<CXXConstructorDecl>(GetDecl(Record[Idx++]));
+ break;
+
+ case CTOR_INITIALIZER_MEMBER:
+ Member = cast<FieldDecl>(GetDecl(Record[Idx++]));
+ break;
+
+ case CTOR_INITIALIZER_INDIRECT_MEMBER:
+ IndirectMember = cast<IndirectFieldDecl>(GetDecl(Record[Idx++]));
+ break;
}
+
SourceLocation MemberOrEllipsisLoc = ReadSourceLocation(F, Record, Idx);
Expr *Init = ReadExpr(F);
SourceLocation LParenLoc = ReadSourceLocation(F, Record, Idx);
@@ -4739,10 +4886,13 @@ ASTReader::ReadCXXCtorInitializers(PerFileData &F, const RecordData &Record,
}
CXXCtorInitializer *BOMInit;
- if (IsBaseInitializer) {
+ if (Type == CTOR_INITIALIZER_BASE) {
BOMInit = new (C) CXXCtorInitializer(C, BaseClassInfo, IsBaseVirtual,
LParenLoc, Init, RParenLoc,
MemberOrEllipsisLoc);
+ } else if (Type == CTOR_INITIALIZER_DELEGATING) {
+ BOMInit = new (C) CXXCtorInitializer(C, MemberOrEllipsisLoc, LParenLoc,
+ Target, Init, RParenLoc);
} else if (IsWritten) {
if (Member)
BOMInit = new (C) CXXCtorInitializer(C, Member, MemberOrEllipsisLoc,
@@ -5050,7 +5200,8 @@ ASTReader::~ASTReader() {
}
ASTReader::PerFileData::PerFileData(ASTFileType Ty)
- : Type(Ty), SizeInBits(0), LocalNumSLocEntries(0), SLocOffsets(0), LocalSLocSize(0),
+ : Type(Ty), SizeInBits(0), LocalNumSLocEntries(0), SLocOffsets(0),
+ SLocFileOffsets(0), LocalSLocSize(0),
LocalNumIdentifiers(0), IdentifierOffsets(0), IdentifierTableData(0),
IdentifierLookupTable(0), LocalNumMacroDefinitions(0),
MacroDefinitionOffsets(0),
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp
index 3a825de..fab2069 100644
--- a/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -125,6 +125,7 @@ namespace clang {
void VisitClassTemplateDecl(ClassTemplateDecl *D);
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D);
+ void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);
void VisitUsingDecl(UsingDecl *D);
void VisitUsingShadowDecl(UsingShadowDecl *D);
void VisitLinkageSpecDecl(LinkageSpecDecl *D);
@@ -173,6 +174,18 @@ uint64_t ASTDeclReader::GetCurrentCursorOffset() {
void ASTDeclReader::Visit(Decl *D) {
DeclVisitor<ASTDeclReader, void>::Visit(D);
+ if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D)) {
+ if (DD->DeclInfo) {
+ DeclaratorDecl::ExtInfo *Info =
+ DD->DeclInfo.get<DeclaratorDecl::ExtInfo *>();
+ Info->TInfo =
+ GetTypeSourceInfo(Record, Idx);
+ }
+ else {
+ DD->DeclInfo = GetTypeSourceInfo(Record, Idx);
+ }
+ }
+
if (TypeDecl *TD = dyn_cast<TypeDecl>(D)) {
// if we have a fully initialized TypeDecl, we can safely read its type now.
TD->setTypeForDecl(Reader.GetType(TypeIDForTypeDecl).getTypePtrOrNull());
@@ -307,10 +320,8 @@ void ASTDeclReader::VisitDeclaratorDecl(DeclaratorDecl *DD) {
DeclaratorDecl::ExtInfo *Info
= new (*Reader.getContext()) DeclaratorDecl::ExtInfo();
ReadQualifierInfo(*Info, Record, Idx);
- Info->TInfo = GetTypeSourceInfo(Record, Idx);
DD->DeclInfo = Info;
- } else
- DD->DeclInfo = GetTypeSourceInfo(Record, Idx);
+ }
}
void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
@@ -428,6 +439,8 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
FD->HasWrittenPrototype = Record[Idx++];
FD->IsDeleted = Record[Idx++];
FD->IsTrivial = Record[Idx++];
+ FD->IsDefaulted = Record[Idx++];
+ FD->IsExplicitlyDefaulted = Record[Idx++];
FD->HasImplicitReturnZero = Record[Idx++];
FD->EndRangeLoc = ReadSourceLocation(Record, Idx);
@@ -455,6 +468,7 @@ void ASTDeclReader::VisitObjCMethodDecl(ObjCMethodDecl *MD) {
MD->setDefined(Record[Idx++]);
MD->setDeclImplementation((ObjCMethodDecl::ImplementationControl)Record[Idx++]);
MD->setObjCDeclQualifier((Decl::ObjCDeclQualifier)Record[Idx++]);
+ MD->SetRelatedResultType(Record[Idx++]);
MD->setNumSelectorArgs(unsigned(Record[Idx++]));
MD->setResultType(Reader.GetType(Record[Idx++]));
MD->setResultTypeSourceInfo(GetTypeSourceInfo(Record, Idx));
@@ -663,8 +677,11 @@ void ASTDeclReader::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {
void ASTDeclReader::VisitFieldDecl(FieldDecl *FD) {
VisitDeclaratorDecl(FD);
FD->setMutable(Record[Idx++]);
- if (Record[Idx++])
+ int BitWidthOrInitializer = Record[Idx++];
+ if (BitWidthOrInitializer == 1)
FD->setBitWidth(Reader.ReadExpr(F));
+ else if (BitWidthOrInitializer == 2)
+ FD->setInClassInitializer(Reader.ReadExpr(F));
if (!FD->getDeclName()) {
FieldDecl *Tmpl = cast_or_null<FieldDecl>(Reader.GetDecl(Record[Idx++]));
if (Tmpl)
@@ -857,7 +874,8 @@ void ASTDeclReader::ReadCXXDefinitionData(
Data.HasPrivateFields = Record[Idx++];
Data.HasProtectedFields = Record[Idx++];
Data.HasPublicFields = Record[Idx++];
- Data.HasTrivialConstructor = Record[Idx++];
+ Data.HasMutableFields = Record[Idx++];
+ Data.HasTrivialDefaultConstructor = Record[Idx++];
Data.HasConstExprNonCopyMoveConstructor = Record[Idx++];
Data.HasTrivialCopyConstructor = Record[Idx++];
Data.HasTrivialMoveConstructor = Record[Idx++];
@@ -866,6 +884,7 @@ void ASTDeclReader::ReadCXXDefinitionData(
Data.HasTrivialDestructor = Record[Idx++];
Data.HasNonLiteralTypeFieldsOrBases = Record[Idx++];
Data.ComputedVisibleConversions = Record[Idx++];
+ Data.UserProvidedDefaultConstructor = Record[Idx++];
Data.DeclaredDefaultConstructor = Record[Idx++];
Data.DeclaredCopyConstructor = Record[Idx++];
Data.DeclaredCopyAssignment = Record[Idx++];
@@ -1266,6 +1285,10 @@ void ASTDeclReader::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) {
D->ParameterPack = Record[Idx++];
}
+void ASTDeclReader::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
+ VisitRedeclarableTemplateDecl(D);
+}
+
void ASTDeclReader::VisitStaticAssertDecl(StaticAssertDecl *D) {
VisitDecl(D);
D->AssertExpr = Reader.ReadExpr(F);
@@ -1380,7 +1403,7 @@ static bool isConsumerInterestedIn(Decl *D) {
return Var->isFileVarDecl() &&
Var->isThisDeclarationADefinition() == VarDecl::Definition;
if (FunctionDecl *Func = dyn_cast<FunctionDecl>(D))
- return Func->isThisDeclarationADefinition();
+ return Func->doesThisDeclarationHaveABody();
return isa<ObjCProtocolDecl>(D) || isa<ObjCImplementationDecl>(D);
}
@@ -1572,6 +1595,9 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) {
D = TemplateTemplateParmDecl::Create(*Context, 0, SourceLocation(), 0, 0,
false, 0, 0);
break;
+ case DECL_TYPE_ALIAS_TEMPLATE:
+ D = TypeAliasTemplateDecl::Create(*Context, Decl::EmptyShell());
+ break;
case DECL_STATIC_ASSERT:
D = StaticAssertDecl::Create(*Context, 0, SourceLocation(), 0, 0,
SourceLocation());
@@ -1626,7 +1652,7 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) {
break;
case DECL_FIELD:
D = FieldDecl::Create(*Context, 0, SourceLocation(), SourceLocation(), 0,
- QualType(), 0, 0, false);
+ QualType(), 0, 0, false, false);
break;
case DECL_INDIRECTFIELD:
D = IndirectFieldDecl::Create(*Context, 0, SourceLocation(), 0, QualType(),
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp
index 918db7e..f3f67a7 100644
--- a/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -189,7 +189,7 @@ namespace clang {
void VisitOpaqueValueExpr(OpaqueValueExpr *E);
// CUDA Expressions
- void VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E);
+ void VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E);
};
}
@@ -2000,6 +2000,10 @@ Stmt *ASTReader::ReadStmtFromStream(PerFileData &F) {
case EXPR_CUDA_KERNEL_CALL:
S = new (Context) CUDAKernelCallExpr(*Context, Empty);
break;
+
+ case EXPR_ASTYPE:
+ S = new (Context) AsTypeExpr(Empty);
+ break;
}
// We hit a STMT_STOP, so we're done with this expression.
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp
index 6d44fb6..ba9032e 100644
--- a/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp
+++ b/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp
@@ -223,6 +223,13 @@ void ASTTypeWriter::VisitDecltypeType(const DecltypeType *T) {
Code = TYPE_DECLTYPE;
}
+void ASTTypeWriter::VisitUnaryTransformType(const UnaryTransformType *T) {
+ Writer.AddTypeRef(T->getBaseType(), Record);
+ Writer.AddTypeRef(T->getUnderlyingType(), Record);
+ Record.push_back(T->getUTTKind());
+ Code = TYPE_UNARY_TRANSFORM;
+}
+
void ASTTypeWriter::VisitAutoType(const AutoType *T) {
Writer.AddTypeRef(T->getDeducedType(), Record);
Code = TYPE_AUTO;
@@ -277,7 +284,8 @@ ASTTypeWriter::VisitTemplateSpecializationType(
for (TemplateSpecializationType::iterator ArgI = T->begin(), ArgE = T->end();
ArgI != ArgE; ++ArgI)
Writer.AddTemplateArgument(*ArgI, Record);
- Writer.AddTypeRef(T->isCanonicalUnqualified() ? QualType()
+ Writer.AddTypeRef(T->isTypeAlias() ? T->getAliasedType() :
+ T->isCanonicalUnqualified() ? QualType()
: T->getCanonicalTypeInternal(),
Record);
Code = TYPE_TEMPLATE_SPECIALIZATION;
@@ -493,6 +501,12 @@ void TypeLocWriter::VisitTypeOfTypeLoc(TypeOfTypeLoc TL) {
void TypeLocWriter::VisitDecltypeTypeLoc(DecltypeTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
+void TypeLocWriter::VisitUnaryTransformTypeLoc(UnaryTransformTypeLoc TL) {
+ Writer.AddSourceLocation(TL.getKWLoc(), Record);
+ Writer.AddSourceLocation(TL.getLParenLoc(), Record);
+ Writer.AddSourceLocation(TL.getRParenLoc(), Record);
+ Writer.AddTypeSourceInfo(TL.getUnderlyingTInfo(), Record);
+}
void TypeLocWriter::VisitAutoTypeLoc(AutoTypeLoc TL) {
Writer.AddSourceLocation(TL.getNameLoc(), Record);
}
@@ -726,6 +740,7 @@ void ASTWriter::WriteBlockInfoBlock() {
// AST Top-Level Block.
BLOCK(AST_BLOCK);
RECORD(ORIGINAL_FILE_NAME);
+ RECORD(ORIGINAL_FILE_ID);
RECORD(TYPE_OFFSET);
RECORD(DECL_OFFSET);
RECORD(LANGUAGE_OPTIONS);
@@ -764,6 +779,7 @@ void ASTWriter::WriteBlockInfoBlock() {
RECORD(HEADER_SEARCH_TABLE);
RECORD(FP_PRAGMA_OPTIONS);
RECORD(OPENCL_EXTENSIONS);
+ RECORD(DELEGATING_CTORS);
// SourceManager Block.
BLOCK(SOURCE_MANAGER_BLOCK);
@@ -873,13 +889,14 @@ void ASTWriter::WriteBlockInfoBlock() {
RECORD(DECL_INDIRECTFIELD);
RECORD(DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK);
+ // Statements and Exprs can occur in the Decls and Types block.
+ AddStmtsExprs(Stream, Record);
+
BLOCK(PREPROCESSOR_DETAIL_BLOCK);
RECORD(PPD_MACRO_INSTANTIATION);
RECORD(PPD_MACRO_DEFINITION);
RECORD(PPD_INCLUSION_DIRECTIVE);
- // Statements and Exprs can occur in the Decls and Types block.
- AddStmtsExprs(Stream, Record);
#undef RECORD
#undef BLOCK
Stream.ExitBlock();
@@ -951,7 +968,7 @@ void ASTWriter::WriteMetadata(ASTContext &Context, const char *isysroot,
const std::string &BlobStr = Chain ? Chain->getFileName() : Target.getTriple().getTriple();
Stream.EmitRecordWithBlob(MetaAbbrevCode, Record, BlobStr);
- // Original file name
+ // Original file name and file ID
SourceManager &SM = Context.getSourceManager();
if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) {
BitCodeAbbrev *FileAbbrev = new BitCodeAbbrev();
@@ -969,6 +986,10 @@ void ASTWriter::WriteMetadata(ASTContext &Context, const char *isysroot,
RecordData Record;
Record.push_back(ORIGINAL_FILE_NAME);
Stream.EmitRecordWithBlob(FileAbbrevCode, Record, MainFileNameStr);
+
+ Record.clear();
+ Record.push_back(SM.getMainFileID().getOpaqueValue());
+ Stream.EmitRecord(ORIGINAL_FILE_ID, Record);
}
// Original PCH directory
@@ -1029,6 +1050,7 @@ void ASTWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
Record.push_back(LangOpts.AppleKext); // Apple's kernel extensions ABI
Record.push_back(LangOpts.ObjCDefaultSynthProperties); // Objective-C auto-synthesized
// properties enabled.
+ Record.push_back(LangOpts.ObjCInferRelatedResultType);
Record.push_back(LangOpts.NoConstantCFStrings); // non cfstring generation enabled..
Record.push_back(LangOpts.PascalStrings); // Allow Pascal strings
@@ -1280,7 +1302,8 @@ namespace {
using namespace clang::io;
uint64_t Start = Out.tell(); (void)Start;
- unsigned char Flags = (Data.isImport << 3)
+ unsigned char Flags = (Data.isImport << 4)
+ | (Data.isPragmaOnce << 3)
| (Data.DirInfo << 1)
| Data.Resolved;
Emit8(Out, (uint8_t)Flags);
@@ -1428,6 +1451,9 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
// Write out the source location entry table. We skip the first
// entry, which is always the same dummy entry.
std::vector<uint32_t> SLocEntryOffsets;
+ // Write out the offsets of only source location file entries.
+ // We will go through them in ASTReader::validateFileEntries().
+ std::vector<uint32_t> SLocFileEntryOffsets;
RecordData PreloadSLocs;
unsigned BaseSLocID = Chain ? Chain->getTotalNumSLocs() : 0;
SLocEntryOffsets.reserve(SourceMgr.sloc_entry_size() - 1 - BaseSLocID);
@@ -1442,9 +1468,10 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
// Figure out which record code to use.
unsigned Code;
if (SLoc->isFile()) {
- if (SLoc->getFile().getContentCache()->OrigEntry)
+ if (SLoc->getFile().getContentCache()->OrigEntry) {
Code = SM_SLOC_FILE_ENTRY;
- else
+ SLocFileEntryOffsets.push_back(Stream.GetCurrentBitNo());
+ } else
Code = SM_SLOC_BUFFER_ENTRY;
} else
Code = SM_SLOC_INSTANTIATION_ENTRY;
@@ -1544,6 +1571,18 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
Record.push_back(SourceMgr.getNextOffset() - BaseOffset);
Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, data(SLocEntryOffsets));
+ Abbrev = new BitCodeAbbrev();
+ Abbrev->Add(BitCodeAbbrevOp(FILE_SOURCE_LOCATION_OFFSETS));
+ Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 16)); // # of slocs
+ Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // offsets
+ unsigned SLocFileOffsetsAbbrev = Stream.EmitAbbrev(Abbrev);
+
+ Record.clear();
+ Record.push_back(FILE_SOURCE_LOCATION_OFFSETS);
+ Record.push_back(SLocFileEntryOffsets.size());
+ Stream.EmitRecordWithBlob(SLocFileOffsetsAbbrev, Record,
+ data(SLocFileEntryOffsets));
+
// Write the source location entry preloads array, telling the AST
// reader which source locations entries it should load eagerly.
Stream.EmitRecord(SOURCE_LOCATION_PRELOADS, PreloadSLocs);
@@ -2663,8 +2702,15 @@ ASTWriter::ASTWriter(llvm::BitstreamWriter &Stream)
NextSelectorID(FirstSelectorID), FirstMacroID(1), NextMacroID(FirstMacroID),
CollectedStmts(&StmtsToEmit),
NumStatements(0), NumMacros(0), NumLexicalDeclContexts(0),
- NumVisibleDeclContexts(0), FirstCXXBaseSpecifiersID(1),
- NextCXXBaseSpecifiersID(1)
+ NumVisibleDeclContexts(0),
+ FirstCXXBaseSpecifiersID(1), NextCXXBaseSpecifiersID(1),
+ DeclParmVarAbbrev(0), DeclContextLexicalAbbrev(0),
+ DeclContextVisibleLookupAbbrev(0), UpdateVisibleAbbrev(0),
+ DeclRefExprAbbrev(0), CharacterLiteralAbbrev(0),
+ DeclRecordAbbrev(0), IntegerLiteralAbbrev(0),
+ DeclTypedefAbbrev(0),
+ DeclVarAbbrev(0), DeclFieldAbbrev(0),
+ DeclEnumAbbrev(0), DeclObjCIvarAbbrev(0)
{
}
@@ -2722,6 +2768,10 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
for (unsigned i=0, e = SemaRef.UnusedFileScopedDecls.size(); i !=e; ++i)
AddDeclRef(SemaRef.UnusedFileScopedDecls[i], UnusedFileScopedDecls);
+ RecordData DelegatingCtorDecls;
+ for (unsigned i=0, e = SemaRef.DelegatingCtorDecls.size(); i != e; ++i)
+ AddDeclRef(SemaRef.DelegatingCtorDecls[i], DelegatingCtorDecls);
+
RecordData WeakUndeclaredIdentifiers;
if (!SemaRef.WeakUndeclaredIdentifiers.empty()) {
WeakUndeclaredIdentifiers.push_back(
@@ -2826,7 +2876,7 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
// Keep writing types and declarations until all types and
// declarations have been written.
- Stream.EnterSubblock(DECLTYPES_BLOCK_ID, 3);
+ Stream.EnterSubblock(DECLTYPES_BLOCK_ID, NUM_ALLOWED_ABBREVS_SIZE);
WriteDeclsBlockAbbrevs();
while (!DeclTypesToEmit.empty()) {
DeclOrType DOT = DeclTypesToEmit.front();
@@ -2896,6 +2946,10 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
// Write the record containing CUDA-specific declaration references.
if (!CUDASpecialDeclRefs.empty())
Stream.EmitRecord(CUDA_SPECIAL_DECL_REFS, CUDASpecialDeclRefs);
+
+ // Write the delegating constructors.
+ if (!DelegatingCtorDecls.empty())
+ Stream.EmitRecord(DELEGATING_CTORS, DelegatingCtorDecls);
// Some simple statistics
Record.clear();
@@ -2970,6 +3024,14 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
AddDeclRef(SemaRef.UnusedFileScopedDecls[i], UnusedFileScopedDecls);
}
+ // Build a record containing all of the delegating constructor decls in this
+ // file.
+ RecordData DelegatingCtorDecls;
+ for (unsigned i=0, e = SemaRef.DelegatingCtorDecls.size(); i != e; ++i) {
+ if (SemaRef.DelegatingCtorDecls[i]->getPCHLevel() == 0)
+ AddDeclRef(SemaRef.DelegatingCtorDecls[i], DelegatingCtorDecls);
+ }
+
// We write the entire table, overwriting the tables from the chain.
RecordData WeakUndeclaredIdentifiers;
if (!SemaRef.WeakUndeclaredIdentifiers.empty()) {
@@ -3044,7 +3106,7 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
AddDeclRef(SemaRef.getStdBadAlloc(), SemaDeclRefs);
}
- Stream.EnterSubblock(DECLTYPES_BLOCK_ID, 3);
+ Stream.EnterSubblock(DECLTYPES_BLOCK_ID, NUM_ALLOWED_ABBREVS_SIZE);
WriteDeclsBlockAbbrevs();
for (DeclsToRewriteTy::iterator
I = DeclsToRewrite.begin(), E = DeclsToRewrite.end(); I != E; ++I)
@@ -3127,6 +3189,10 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
// Write the record containing declaration references of Sema.
if (!SemaDeclRefs.empty())
Stream.EmitRecord(SEMA_DECL_REFS, SemaDeclRefs);
+
+ // Write the delegating constructors.
+ if (!DelegatingCtorDecls.empty())
+ Stream.EmitRecord(DELEGATING_CTORS, DelegatingCtorDecls);
// Write the updates to DeclContexts.
for (llvm::SmallPtrSet<const DeclContext *, 16>::iterator
@@ -3152,7 +3218,7 @@ void ASTWriter::WriteDeclUpdatesBlocks() {
return;
RecordData OffsetsRecord;
- Stream.EnterSubblock(DECL_UPDATES_BLOCK_ID, 3);
+ Stream.EnterSubblock(DECL_UPDATES_BLOCK_ID, NUM_ALLOWED_ABBREVS_SIZE);
for (DeclUpdateMap::iterator
I = DeclUpdates.begin(), E = DeclUpdates.end(); I != E; ++I) {
const Decl *D = I->first;
@@ -3743,16 +3809,19 @@ void ASTWriter::AddCXXCtorInitializers(
for (unsigned i=0; i != NumCtorInitializers; ++i) {
const CXXCtorInitializer *Init = CtorInitializers[i];
- Record.push_back(Init->isBaseInitializer());
if (Init->isBaseInitializer()) {
+ Record.push_back(CTOR_INITIALIZER_BASE);
AddTypeSourceInfo(Init->getBaseClassInfo(), Record);
Record.push_back(Init->isBaseVirtual());
+ } else if (Init->isDelegatingInitializer()) {
+ Record.push_back(CTOR_INITIALIZER_DELEGATING);
+ AddDeclRef(Init->getTargetConstructor(), Record);
+ } else if (Init->isMemberInitializer()){
+ Record.push_back(CTOR_INITIALIZER_MEMBER);
+ AddDeclRef(Init->getMember(), Record);
} else {
- Record.push_back(Init->isIndirectMemberInitializer());
- if (Init->isIndirectMemberInitializer())
- AddDeclRef(Init->getIndirectMember(), Record);
- else
- AddDeclRef(Init->getMember(), Record);
+ Record.push_back(CTOR_INITIALIZER_INDIRECT_MEMBER);
+ AddDeclRef(Init->getIndirectMember(), Record);
}
AddSourceLocation(Init->getMemberLocation(), Record);
@@ -3787,7 +3856,8 @@ void ASTWriter::AddCXXDefinitionData(const CXXRecordDecl *D, RecordDataImpl &Rec
Record.push_back(Data.HasPrivateFields);
Record.push_back(Data.HasProtectedFields);
Record.push_back(Data.HasPublicFields);
- Record.push_back(Data.HasTrivialConstructor);
+ Record.push_back(Data.HasMutableFields);
+ Record.push_back(Data.HasTrivialDefaultConstructor);
Record.push_back(Data.HasConstExprNonCopyMoveConstructor);
Record.push_back(Data.HasTrivialCopyConstructor);
Record.push_back(Data.HasTrivialMoveConstructor);
@@ -3796,6 +3866,7 @@ void ASTWriter::AddCXXDefinitionData(const CXXRecordDecl *D, RecordDataImpl &Rec
Record.push_back(Data.HasTrivialDestructor);
Record.push_back(Data.HasNonLiteralTypeFieldsOrBases);
Record.push_back(Data.ComputedVisibleConversions);
+ Record.push_back(Data.UserProvidedDefaultConstructor);
Record.push_back(Data.DeclaredDefaultConstructor);
Record.push_back(Data.DeclaredCopyConstructor);
Record.push_back(Data.DeclaredCopyAssignment);
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp
index 1ca00a3..7c24088 100644
--- a/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -86,6 +86,7 @@ namespace clang {
void VisitClassTemplateDecl(ClassTemplateDecl *D);
void VisitFunctionTemplateDecl(FunctionTemplateDecl *D);
void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D);
+ void VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D);
void VisitUsingDecl(UsingDecl *D);
void VisitUsingShadowDecl(UsingShadowDecl *D);
void VisitLinkageSpecDecl(LinkageSpecDecl *D);
@@ -123,12 +124,19 @@ namespace clang {
void ASTDeclWriter::Visit(Decl *D) {
DeclVisitor<ASTDeclWriter>::Visit(D);
+ // Source locations require array (variable-length) abbreviations. The
+ // abbreviation infrastructure requires that arrays are encoded last, so
+ // we handle it here in the case of those classes derived from DeclaratorDecl
+ if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D)){
+ Writer.AddTypeSourceInfo(DD->getTypeSourceInfo(), Record);
+ }
+
// Handle FunctionDecl's body here and write it after all other Stmts/Exprs
// have been written. We want it last because we will not read it back when
// retrieving it from the AST, we'll just lazily set the offset.
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
- Record.push_back(FD->isThisDeclarationADefinition());
- if (FD->isThisDeclarationADefinition())
+ Record.push_back(FD->doesThisDeclarationHaveABody());
+ if (FD->doesThisDeclarationHaveABody())
Writer.AddStmt(FD->getBody());
}
}
@@ -168,6 +176,18 @@ void ASTDeclWriter::VisitTypeDecl(TypeDecl *D) {
void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) {
VisitTypeDecl(D);
Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record);
+
+ if (!D->hasAttrs() &&
+ !D->isImplicit() &&
+ !D->isUsed(false) &&
+ D->getPCHLevel() == 0 &&
+ D->RedeclLink.getNext() == D &&
+ !D->isInvalidDecl() &&
+ !D->isReferenced() &&
+ D->getAccess() == AS_none &&
+ D->getDeclName().getNameKind() == DeclarationName::Identifier)
+ AbbrevToUse = Writer.getDeclTypedefAbbrev();
+
Code = serialization::DECL_TYPEDEF;
}
@@ -204,6 +224,21 @@ void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) {
Record.push_back(D->isScopedUsingClassTag());
Record.push_back(D->isFixed());
Writer.AddDeclRef(D->getInstantiatedFromMemberEnum(), Record);
+
+ if (!D->hasAttrs() &&
+ !D->isImplicit() &&
+ !D->isUsed(false) &&
+ D->getPCHLevel() == 0 &&
+ !D->hasExtInfo() &&
+ D->RedeclLink.getNext() == D &&
+ !D->isInvalidDecl() &&
+ !D->isReferenced() &&
+ D->getAccess() == AS_none &&
+ !CXXRecordDecl::classofKind(D->getKind()) &&
+ !D->getIntegerTypeSourceInfo() &&
+ D->getDeclName().getNameKind() == DeclarationName::Identifier)
+ AbbrevToUse = Writer.getDeclEnumAbbrev();
+
Code = serialization::DECL_ENUM;
}
@@ -212,6 +247,20 @@ void ASTDeclWriter::VisitRecordDecl(RecordDecl *D) {
Record.push_back(D->hasFlexibleArrayMember());
Record.push_back(D->isAnonymousStructOrUnion());
Record.push_back(D->hasObjectMember());
+
+ if (!D->hasAttrs() &&
+ !D->isImplicit() &&
+ !D->isUsed(false) &&
+ D->getPCHLevel() == 0 &&
+ !D->hasExtInfo() &&
+ D->RedeclLink.getNext() == D &&
+ !D->isInvalidDecl() &&
+ !D->isReferenced() &&
+ D->getAccess() == AS_none &&
+ !CXXRecordDecl::classofKind(D->getKind()) &&
+ D->getDeclName().getNameKind() == DeclarationName::Identifier)
+ AbbrevToUse = Writer.getDeclRecordAbbrev();
+
Code = serialization::DECL_RECORD;
}
@@ -226,6 +275,7 @@ void ASTDeclWriter::VisitEnumConstantDecl(EnumConstantDecl *D) {
if (D->getInitExpr())
Writer.AddStmt(D->getInitExpr());
Writer.AddAPSInt(D->getInitVal(), Record);
+
Code = serialization::DECL_ENUM_CONSTANT;
}
@@ -235,7 +285,6 @@ void ASTDeclWriter::VisitDeclaratorDecl(DeclaratorDecl *D) {
Record.push_back(D->hasExtInfo());
if (D->hasExtInfo())
Writer.AddQualifierInfo(*D->getExtInfo(), Record);
- Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record);
}
void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
@@ -321,8 +370,10 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
Record.push_back(D->isPure());
Record.push_back(D->hasInheritedPrototype());
Record.push_back(D->hasWrittenPrototype());
- Record.push_back(D->isDeleted());
+ Record.push_back(D->isDeletedAsWritten());
Record.push_back(D->isTrivial());
+ Record.push_back(D->isDefaulted());
+ Record.push_back(D->isExplicitlyDefaulted());
Record.push_back(D->hasImplicitReturnZero());
Writer.AddSourceLocation(D->getLocEnd(), Record);
@@ -353,6 +404,7 @@ void ASTDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) {
Record.push_back(D->getImplementationControl());
// FIXME: stable encoding for in/out/inout/bycopy/byref/oneway
Record.push_back(D->getObjCDeclQualifier());
+ Record.push_back(D->hasRelatedResultType());
Record.push_back(D->getNumSelectorArgs());
Writer.AddTypeRef(D->getResultType(), Record);
Writer.AddTypeSourceInfo(D->getResultTypeSourceInfo(), Record);
@@ -413,6 +465,18 @@ void ASTDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) {
// FIXME: stable encoding for @public/@private/@protected/@package
Record.push_back(D->getAccessControl());
Record.push_back(D->getSynthesize());
+
+ if (!D->hasAttrs() &&
+ !D->isImplicit() &&
+ !D->isUsed(false) &&
+ !D->isInvalidDecl() &&
+ !D->isReferenced() &&
+ D->getPCHLevel() == 0 &&
+ !D->getBitWidth() &&
+ !D->hasExtInfo() &&
+ D->getDeclName())
+ AbbrevToUse = Writer.getDeclObjCIvarAbbrev();
+
Code = serialization::DECL_OBJC_IVAR;
}
@@ -535,11 +599,28 @@ void ASTDeclWriter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {
void ASTDeclWriter::VisitFieldDecl(FieldDecl *D) {
VisitDeclaratorDecl(D);
Record.push_back(D->isMutable());
- Record.push_back(D->getBitWidth()? 1 : 0);
+ Record.push_back(D->getBitWidth()? 1 : D->hasInClassInitializer() ? 2 : 0);
if (D->getBitWidth())
Writer.AddStmt(D->getBitWidth());
+ else if (D->hasInClassInitializer())
+ Writer.AddStmt(D->getInClassInitializer());
if (!D->getDeclName())
Writer.AddDeclRef(Context.getInstantiatedFromUnnamedFieldDecl(D), Record);
+
+ if (!D->hasAttrs() &&
+ !D->isImplicit() &&
+ !D->isUsed(false) &&
+ !D->isInvalidDecl() &&
+ !D->isReferenced() &&
+ D->getPCHLevel() == 0 &&
+ !D->getBitWidth() &&
+ !D->hasInClassInitializer() &&
+ !D->hasExtInfo() &&
+ !ObjCIvarDecl::classofKind(D->getKind()) &&
+ !ObjCAtDefsFieldDecl::classofKind(D->getKind()) &&
+ D->getDeclName())
+ AbbrevToUse = Writer.getDeclFieldAbbrev();
+
Code = serialization::DECL_FIELD;
}
@@ -577,6 +658,22 @@ void ASTDeclWriter::VisitVarDecl(VarDecl *D) {
Writer.AddSourceLocation(SpecInfo->getPointOfInstantiation(), Record);
}
+ if (!D->hasAttrs() &&
+ !D->isImplicit() &&
+ !D->isUsed(false) &&
+ !D->isInvalidDecl() &&
+ !D->isReferenced() &&
+ D->getAccess() == AS_none &&
+ D->getPCHLevel() == 0 &&
+ D->getDeclName().getNameKind() == DeclarationName::Identifier &&
+ !D->hasExtInfo() &&
+ D->RedeclLink.getNext() == D &&
+ !D->hasCXXDirectInitializer() &&
+ D->getInit() == 0 &&
+ !ParmVarDecl::classofKind(D->getKind()) &&
+ !SpecInfo)
+ AbbrevToUse = Writer.getDeclVarAbbrev();
+
Code = serialization::DECL_VAR;
}
@@ -601,8 +698,8 @@ void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) {
// If the assumptions about the DECL_PARM_VAR abbrev are true, use it. Here
// we dynamically check for the properties that we optimize for, but don't
// know are true of all PARM_VAR_DECLs.
- if (!D->getTypeSourceInfo() &&
- !D->hasAttrs() &&
+ if (!D->hasAttrs() &&
+ !D->hasExtInfo() &&
!D->isImplicit() &&
!D->isUsed(false) &&
D->getAccess() == AS_none &&
@@ -615,7 +712,7 @@ void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) {
!D->hasInheritedDefaultArg() &&
D->getInit() == 0 &&
!D->hasUninstantiatedDefaultArg()) // No default expr.
- AbbrevToUse = Writer.getParmVarDeclAbbrev();
+ AbbrevToUse = Writer.getDeclParmVarAbbrev();
// Check things we know are true of *every* PARM_VAR_DECL, which is more than
// just us assuming it.
@@ -1081,6 +1178,11 @@ void ASTDeclWriter::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) {
Code = serialization::DECL_TEMPLATE_TEMPLATE_PARM;
}
+void ASTDeclWriter::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
+ VisitRedeclarableTemplateDecl(D);
+ Code = serialization::DECL_TYPE_ALIAS_TEMPLATE;
+}
+
void ASTDeclWriter::VisitStaticAssertDecl(StaticAssertDecl *D) {
VisitDecl(D);
Writer.AddStmt(D->getAssertExpr());
@@ -1141,10 +1243,161 @@ void ASTDeclWriter::VisitRedeclarable(Redeclarable<T> *D) {
void ASTWriter::WriteDeclsBlockAbbrevs() {
using namespace llvm;
- // Abbreviation for DECL_PARM_VAR.
- BitCodeAbbrev *Abv = new BitCodeAbbrev();
- Abv->Add(BitCodeAbbrevOp(serialization::DECL_PARM_VAR));
+ BitCodeAbbrev *Abv;
+
+ // Abbreviation for DECL_FIELD
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::DECL_FIELD));
+ // Decl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalDeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl (!?)
+ Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
+ Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
+ Abv->Add(BitCodeAbbrevOp(0)); // isUsed
+ Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // AccessSpecifier
+ Abv->Add(BitCodeAbbrevOp(0)); // PCH level
+ // NamedDecl
+ Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
+ // ValueDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
+ // DeclaratorDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
+ Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
+ // FieldDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isMutable
+ Abv->Add(BitCodeAbbrevOp(0)); //getBitWidth
+ // Type Source Info
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
+ DeclFieldAbbrev = Stream.EmitAbbrev(Abv);
+
+ // Abbreviation for DECL_OBJC_IVAR
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::DECL_OBJC_IVAR));
+ // Decl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalDeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl (!?)
+ Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
+ Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
+ Abv->Add(BitCodeAbbrevOp(0)); // isUsed
+ Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // AccessSpecifier
+ Abv->Add(BitCodeAbbrevOp(0)); // PCH level
+ // NamedDecl
+ Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
+ // ValueDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
+ // DeclaratorDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
+ Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
+ // FieldDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isMutable
+ Abv->Add(BitCodeAbbrevOp(0)); //getBitWidth
+ // ObjC Ivar
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getAccessControl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getSynthesize
+ // Type Source Info
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
+ DeclObjCIvarAbbrev = Stream.EmitAbbrev(Abv);
+
+ // Abbreviation for DECL_ENUM
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::DECL_ENUM));
+ // Decl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalDeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl (!?)
+ Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
+ Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
+ Abv->Add(BitCodeAbbrevOp(0)); // isUsed
+ Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
+ Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
+ Abv->Add(BitCodeAbbrevOp(0)); // PCH level
+ // NamedDecl
+ Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
+ // TypeDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Source Location
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type Ref
+ // Redeclarable
+ Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
+ // TagDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // IdentifierNamespace
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getTagKind
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isDefinition
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // EmbeddedInDeclarator
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SourceLocation
+ Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypedefNameAnonDecl
+ // EnumDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // AddTypeRef
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // IntegerType
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getPromotionType
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getNumPositiveBits
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getNumNegativeBits
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isScoped
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isScopedUsingClassTag
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isFixed
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InstantiatedMembEnum
+ // DC
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalOffset
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // VisibleOffset
+ DeclEnumAbbrev = Stream.EmitAbbrev(Abv);
+
+ // Abbreviation for DECL_RECORD
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::DECL_RECORD));
+ // Decl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalDeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl (!?)
+ Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
+ Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
+ Abv->Add(BitCodeAbbrevOp(0)); // isUsed
+ Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
+ Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
+ Abv->Add(BitCodeAbbrevOp(0)); // PCH level
+ // NamedDecl
+ Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
+ // TypeDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Source Location
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type Ref
+ // Redeclarable
+ Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
+ // TagDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // IdentifierNamespace
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getTagKind
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isDefinition
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // EmbeddedInDeclarator
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // SourceLocation
+ Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypedefNameAnonDecl
+ // RecordDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // FlexibleArrayMember
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // AnonymousStructUnion
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // hasObjectMember
+ // DC
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalOffset
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // VisibleOffset
+ DeclRecordAbbrev = Stream.EmitAbbrev(Abv);
+
+ // Abbreviation for DECL_PARM_VAR
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::DECL_PARM_VAR));
// Decl
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalDeclContext
@@ -1156,7 +1409,6 @@ void ASTWriter::WriteDeclsBlockAbbrevs() {
Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
Abv->Add(BitCodeAbbrevOp(0)); // PCH level
-
// NamedDecl
Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
@@ -1165,7 +1417,6 @@ void ASTWriter::WriteDeclsBlockAbbrevs() {
// DeclaratorDecl
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
- Abv->Add(BitCodeAbbrevOp(serialization::PREDEF_TYPE_NULL_ID)); // InfoType
// VarDecl
Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
Abv->Add(BitCodeAbbrevOp(0)); // StorageClass
@@ -1185,8 +1436,128 @@ void ASTWriter::WriteDeclsBlockAbbrevs() {
Abv->Add(BitCodeAbbrevOp(0)); // KNRPromoted
Abv->Add(BitCodeAbbrevOp(0)); // HasInheritedDefaultArg
Abv->Add(BitCodeAbbrevOp(0)); // HasUninstantiatedDefaultArg
+ // Type Source Info
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
+ DeclParmVarAbbrev = Stream.EmitAbbrev(Abv);
- ParmVarDeclAbbrev = Stream.EmitAbbrev(Abv);
+ // Abbreviation for DECL_TYPEDEF
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::DECL_TYPEDEF));
+ // Decl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalDeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl (!?)
+ Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
+ Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
+ Abv->Add(BitCodeAbbrevOp(0)); // isUsed
+ Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
+ Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
+ Abv->Add(BitCodeAbbrevOp(0)); // PCH level
+ // NamedDecl
+ Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
+ // TypeDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Source Location
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type Ref
+ // TypedefDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
+ DeclTypedefAbbrev = Stream.EmitAbbrev(Abv);
+
+ // Abbreviation for DECL_VAR
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::DECL_VAR));
+ // Decl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // LexicalDeclContext
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ Abv->Add(BitCodeAbbrevOp(0)); // isInvalidDecl (!?)
+ Abv->Add(BitCodeAbbrevOp(0)); // HasAttrs
+ Abv->Add(BitCodeAbbrevOp(0)); // isImplicit
+ Abv->Add(BitCodeAbbrevOp(0)); // isUsed
+ Abv->Add(BitCodeAbbrevOp(0)); // isReferenced
+ Abv->Add(BitCodeAbbrevOp(AS_none)); // C++ AccessSpecifier
+ Abv->Add(BitCodeAbbrevOp(0)); // PCH level
+ // NamedDecl
+ Abv->Add(BitCodeAbbrevOp(0)); // NameKind = Identifier
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Name
+ // ValueDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
+ // DeclaratorDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // InnerStartLoc
+ Abv->Add(BitCodeAbbrevOp(0)); // hasExtInfo
+ // VarDecl
+ Abv->Add(BitCodeAbbrevOp(0)); // No redeclaration
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // StorageClass
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // StorageClassAsWritten
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isThreadSpecified
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // CXXDirectInitializer
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isExceptionVariable
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isNRVOVariable
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isCXXForRangeDecl
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // HasInit
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // HasMemberSpecInfo
+ // Type Source Info
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Array));
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // TypeLoc
+ DeclVarAbbrev = Stream.EmitAbbrev(Abv);
+
+ // Abbreviation for EXPR_DECL_REF
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::EXPR_DECL_REF));
+ //Stmt
+ //Expr
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsTypeDependent
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsValueDependent
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //UnexpandedParamPack
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetValueKind
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetObjectKind
+ //DeclRefExpr
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //HasQualifier
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //GetDeclFound
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //ExplicitTemplateArgs
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclRef
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ DeclRefExprAbbrev = Stream.EmitAbbrev(Abv);
+
+ // Abbreviation for EXPR_INTEGER_LITERAL
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::EXPR_INTEGER_LITERAL));
+ //Stmt
+ //Expr
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsTypeDependent
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsValueDependent
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //UnexpandedParamPack
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetValueKind
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetObjectKind
+ //Integer Literal
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ Abv->Add(BitCodeAbbrevOp(32)); // Bit Width
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Value
+ IntegerLiteralAbbrev = Stream.EmitAbbrev(Abv);
+
+ // Abbreviation for EXPR_CHARACTER_LITERAL
+ Abv = new BitCodeAbbrev();
+ Abv->Add(BitCodeAbbrevOp(serialization::EXPR_CHARACTER_LITERAL));
+ //Stmt
+ //Expr
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsTypeDependent
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsValueDependent
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //UnexpandedParamPack
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetValueKind
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); //GetObjectKind
+ //Character Literal
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getValue
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsWide
+ CharacterLiteralAbbrev = Stream.EmitAbbrev(Abv);
Abv = new BitCodeAbbrev();
Abv->Add(BitCodeAbbrevOp(serialization::DECL_CONTEXT_LEXICAL));
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp b/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp
index bd5889a..00e2404 100644
--- a/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -30,6 +30,7 @@ namespace clang {
public:
serialization::StmtCode Code;
+ unsigned AbbrevToUse;
ASTStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
: Writer(Writer), Record(Record) { }
@@ -164,6 +165,8 @@ namespace clang {
// CUDA Expressions
void VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E);
+
+ void VisitAsTypeExpr(AsTypeExpr *E);
};
}
@@ -392,6 +395,14 @@ void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
Record.push_back(NumTemplateArgs);
}
+ DeclarationName::NameKind nk = (E->getDecl()->getDeclName().getNameKind());
+
+ if ((!E->hasExplicitTemplateArgs()) && (!E->hasQualifier()) &&
+ (E->getDecl() == E->getFoundDecl()) &&
+ nk == DeclarationName::Identifier) {
+ AbbrevToUse = Writer.getDeclRefExprAbbrev();
+ }
+
if (E->hasQualifier())
Writer.AddNestedNameSpecifierLoc(E->getQualifierLoc(), Record);
@@ -411,6 +422,11 @@ void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
VisitExpr(E);
Writer.AddSourceLocation(E->getLocation(), Record);
Writer.AddAPInt(E->getValue(), Record);
+
+ if (E->getValue().getBitWidth() == 32) {
+ AbbrevToUse = Writer.getIntegerLiteralAbbrev();
+ }
+
Code = serialization::EXPR_INTEGER_LITERAL;
}
@@ -449,6 +465,9 @@ void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
Record.push_back(E->getValue());
Writer.AddSourceLocation(E->getLocation(), Record);
Record.push_back(E->isWide());
+
+ AbbrevToUse = Writer.getCharacterLiteralAbbrev();
+
Code = serialization::EXPR_CHARACTER_LITERAL;
}
@@ -1416,6 +1435,15 @@ void ASTStmtWriter::VisitCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
}
//===----------------------------------------------------------------------===//
+// OpenCL Expressions and Statements.
+//===----------------------------------------------------------------------===//
+void ASTStmtWriter::VisitAsTypeExpr(AsTypeExpr *E) {
+ VisitExpr(E);
+ Writer.AddStmt(E->getSrcExpr());
+ Code = serialization::EXPR_ASTYPE;
+}
+
+//===----------------------------------------------------------------------===//
// ASTWriter Implementation
//===----------------------------------------------------------------------===//
@@ -1460,6 +1488,7 @@ void ASTWriter::WriteSubStmt(Stmt *S) {
CollectedStmts = &SubStmts;
Writer.Code = serialization::STMT_NULL_PTR;
+ Writer.AbbrevToUse = 0;
Writer.Visit(S);
#ifndef NDEBUG
@@ -1481,7 +1510,7 @@ void ASTWriter::WriteSubStmt(Stmt *S) {
while (!SubStmts.empty())
WriteSubStmt(SubStmts.pop_back_val());
- Stream.EmitRecord(Writer.Code, Record);
+ Stream.EmitRecord(Writer.Code, Record, Writer.AbbrevToUse);
}
/// \brief Flush all of the statements that have been added to the
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
index a6a256a..f2f5c1e 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
@@ -42,6 +42,7 @@ public:
bool wantsRegionChangeUpdate(const GRState *state) const;
const GRState *checkRegionChanges(const GRState *state,
+ const StoreManager::InvalidatedSymbols *,
const MemRegion * const *Begin,
const MemRegion * const *End) const;
@@ -77,6 +78,7 @@ public:
void evalStrcmp(CheckerContext &C, const CallExpr *CE) const;
void evalStrncmp(CheckerContext &C, const CallExpr *CE) const;
void evalStrcasecmp(CheckerContext &C, const CallExpr *CE) const;
+ void evalStrncasecmp(CheckerContext &C, const CallExpr *CE) const;
void evalStrcmpCommon(CheckerContext &C, const CallExpr *CE,
bool isBounded = false, bool ignoreCase = false) const;
@@ -711,16 +713,13 @@ void CStringChecker::evalCopyCommon(CheckerContext &C,
// If the size is zero, there won't be any actual memory access, so
// just bind the return value to the destination buffer and return.
if (stateZeroSize) {
+ stateZeroSize = stateZeroSize->BindExpr(CE, destVal);
C.addTransition(stateZeroSize);
- if (IsMempcpy)
- state->BindExpr(CE, destVal);
- else
- state->BindExpr(CE, sizeVal);
- return;
}
// If the size can be nonzero, we have to check the other arguments.
if (stateNonZeroSize) {
+ state = stateNonZeroSize;
// Ensure the destination is not null. If it is NULL there will be a
// NULL pointer dereference.
@@ -737,42 +736,55 @@ void CStringChecker::evalCopyCommon(CheckerContext &C,
if (!state)
return;
- // Ensure the buffers do not overlap.
- state = stateNonZeroSize;
+ // Ensure the accesses are valid and that the buffers do not overlap.
state = CheckBufferAccess(C, state, Size, Dest, Source,
/* FirstIsDst = */ true);
if (Restricted)
state = CheckOverlap(C, state, Size, Dest, Source);
- if (state) {
-
- // If this is mempcpy, get the byte after the last byte copied and
- // bind the expr.
- if (IsMempcpy) {
- loc::MemRegionVal *destRegVal = dyn_cast<loc::MemRegionVal>(&destVal);
-
- // Get the length to copy.
- SVal lenVal = state->getSVal(Size);
- NonLoc *lenValNonLoc = dyn_cast<NonLoc>(&lenVal);
-
+ if (!state)
+ return;
+
+ // If this is mempcpy, get the byte after the last byte copied and
+ // bind the expr.
+ if (IsMempcpy) {
+ loc::MemRegionVal *destRegVal = dyn_cast<loc::MemRegionVal>(&destVal);
+ assert(destRegVal && "Destination should be a known MemRegionVal here");
+
+ // Get the length to copy.
+ NonLoc *lenValNonLoc = dyn_cast<NonLoc>(&sizeVal);
+
+ if (lenValNonLoc) {
// Get the byte after the last byte copied.
SVal lastElement = C.getSValBuilder().evalBinOpLN(state, BO_Add,
*destRegVal,
*lenValNonLoc,
Dest->getType());
-
+
// The byte after the last byte copied is the return value.
state = state->BindExpr(CE, lastElement);
+ } else {
+ // If we don't know how much we copied, we can at least
+ // conjure a return value for later.
+ unsigned Count = C.getNodeBuilder().getCurrentBlockCount();
+ SVal result =
+ C.getSValBuilder().getConjuredSymbolVal(NULL, CE, Count);
+ state = state->BindExpr(CE, result);
}
- // Invalidate the destination.
- // FIXME: Even if we can't perfectly model the copy, we should see if we
- // can use LazyCompoundVals to copy the source values into the destination.
- // This would probably remove any existing bindings past the end of the
- // copied region, but that's still an improvement over blank invalidation.
- state = InvalidateBuffer(C, state, Dest, state->getSVal(Dest));
- C.addTransition(state);
+ } else {
+ // All other copies return the destination buffer.
+ // (Well, bcopy() has a void return type, but this won't hurt.)
+ state = state->BindExpr(CE, destVal);
}
+
+ // Invalidate the destination.
+ // FIXME: Even if we can't perfectly model the copy, we should see if we
+ // can use LazyCompoundVals to copy the source values into the destination.
+ // This would probably remove any existing bindings past the end of the
+ // copied region, but that's still an improvement over blank invalidation.
+ state = InvalidateBuffer(C, state, Dest, state->getSVal(Dest));
+ C.addTransition(state);
}
}
@@ -782,7 +794,7 @@ void CStringChecker::evalMemcpy(CheckerContext &C, const CallExpr *CE) const {
// The return value is the address of the destination buffer.
const Expr *Dest = CE->getArg(0);
const GRState *state = C.getState();
- state = state->BindExpr(CE, state->getSVal(Dest));
+
evalCopyCommon(C, CE, state, CE->getArg(2), Dest, CE->getArg(1), true);
}
@@ -800,7 +812,7 @@ void CStringChecker::evalMemmove(CheckerContext &C, const CallExpr *CE) const {
// The return value is the address of the destination buffer.
const Expr *Dest = CE->getArg(0);
const GRState *state = C.getState();
- state = state->BindExpr(CE, state->getSVal(Dest));
+
evalCopyCommon(C, CE, state, CE->getArg(2), Dest, CE->getArg(1));
}
@@ -953,7 +965,7 @@ void CStringChecker::evalStrcpy(CheckerContext &C, const CallExpr *CE) const {
}
void CStringChecker::evalStrncpy(CheckerContext &C, const CallExpr *CE) const {
- // char *strcpy(char *restrict dst, const char *restrict src);
+ // char *strncpy(char *restrict dst, const char *restrict src, size_t n);
evalStrcpyCommon(C, CE,
/* returnEnd = */ false,
/* isBounded = */ true,
@@ -1128,6 +1140,12 @@ void CStringChecker::evalStrcasecmp(CheckerContext &C,
evalStrcmpCommon(C, CE, /* isBounded = */ false, /* ignoreCase = */ true);
}
+void CStringChecker::evalStrncasecmp(CheckerContext &C,
+ const CallExpr *CE) const {
+ //int strncasecmp(const char *restrict s1, const char *restrict s2, size_t n);
+ evalStrcmpCommon(C, CE, /* isBounded = */ true, /* ignoreCase = */ true);
+}
+
void CStringChecker::evalStrcmpCommon(CheckerContext &C, const CallExpr *CE,
bool isBounded, bool ignoreCase) const {
const GRState *state = C.getState();
@@ -1181,31 +1199,17 @@ void CStringChecker::evalStrcmpCommon(CheckerContext &C, const CallExpr *CE,
return;
llvm::APSInt lenInt(CI->getValue());
- // Compare using the bounds provided like strncmp() does.
- if (ignoreCase) {
- // TODO Implement compare_lower(RHS, n) in LLVM StringRef.
- // result = s1StrRef.compare_lower(s2StrRef,
- // (size_t)lenInt.getLimitedValue());
+ // Create substrings of each to compare the prefix.
+ s1StrRef = s1StrRef.substr(0, (size_t)lenInt.getLimitedValue());
+ s2StrRef = s2StrRef.substr(0, (size_t)lenInt.getLimitedValue());
+ }
- // For now, give up.
- return;
- } else {
- // Create substrings of each to compare the prefix.
- llvm::StringRef s1SubStr =
- s1StrRef.substr(0, (size_t)lenInt.getLimitedValue());
- llvm::StringRef s2SubStr =
- s2StrRef.substr(0, (size_t)lenInt.getLimitedValue());
-
- // Compare the substrings.
- result = s1SubStr.compare(s2SubStr);
- }
+ if (ignoreCase) {
+ // Compare string 1 to string 2 the same way strcasecmp() does.
+ result = s1StrRef.compare_lower(s2StrRef);
} else {
// Compare string 1 to string 2 the same way strcmp() does.
- if (ignoreCase) {
- result = s1StrRef.compare_lower(s2StrRef);
- } else {
- result = s1StrRef.compare(s2StrRef);
- }
+ result = s1StrRef.compare(s2StrRef);
}
// Build the SVal of the comparison to bind the return value.
@@ -1243,11 +1247,11 @@ bool CStringChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
FnCheck evalFunction = llvm::StringSwitch<FnCheck>(Name)
.Cases("memcpy", "__memcpy_chk", &CStringChecker::evalMemcpy)
- .Case("mempcpy", &CStringChecker::evalMempcpy)
+ .Cases("mempcpy", "__mempcpy_chk", &CStringChecker::evalMempcpy)
.Cases("memcmp", "bcmp", &CStringChecker::evalMemcmp)
.Cases("memmove", "__memmove_chk", &CStringChecker::evalMemmove)
.Cases("strcpy", "__strcpy_chk", &CStringChecker::evalStrcpy)
- .Cases("strncpy", "__strncpy_chk", &CStringChecker::evalStrncpy)
+ //.Cases("strncpy", "__strncpy_chk", &CStringChecker::evalStrncpy)
.Cases("stpcpy", "__stpcpy_chk", &CStringChecker::evalStpcpy)
.Cases("strcat", "__strcat_chk", &CStringChecker::evalStrcat)
.Cases("strncat", "__strncat_chk", &CStringChecker::evalStrncat)
@@ -1256,6 +1260,7 @@ bool CStringChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
.Case("strcmp", &CStringChecker::evalStrcmp)
.Case("strncmp", &CStringChecker::evalStrncmp)
.Case("strcasecmp", &CStringChecker::evalStrcasecmp)
+ .Case("strncasecmp", &CStringChecker::evalStrncasecmp)
.Case("bcopy", &CStringChecker::evalBcopy)
.Default(NULL);
@@ -1311,6 +1316,7 @@ bool CStringChecker::wantsRegionChangeUpdate(const GRState *state) const {
const GRState *
CStringChecker::checkRegionChanges(const GRState *state,
+ const StoreManager::InvalidatedSymbols *,
const MemRegion * const *Begin,
const MemRegion * const *End) const {
CStringLength::EntryMap Entries = state->get<CStringLength>();
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
index 63a5917..a51d8e0 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
@@ -97,7 +97,7 @@ public:
void CFErrorFunctionChecker::checkASTDecl(const FunctionDecl *D,
AnalysisManager &mgr,
BugReporter &BR) const {
- if (!D->isThisDeclarationADefinition())
+ if (!D->doesThisDeclarationHaveABody())
return;
if (!D->getResultType()->isVoidType())
return;
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicStore.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicStore.cpp
index 4faa84c..7c9f45a 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicStore.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicStore.cpp
@@ -49,11 +49,11 @@ public:
SVal Retrieve(Store store, Loc loc, QualType T = QualType());
StoreRef invalidateRegion(Store store, const MemRegion *R, const Expr *E,
- unsigned Count, InvalidatedSymbols *IS);
+ unsigned Count, InvalidatedSymbols &IS);
StoreRef invalidateRegions(Store store, const MemRegion * const *Begin,
const MemRegion * const *End, const Expr *E,
- unsigned Count, InvalidatedSymbols *IS,
+ unsigned Count, InvalidatedSymbols &IS,
bool invalidateGlobals,
InvalidatedRegions *Regions);
@@ -538,7 +538,7 @@ StoreRef BasicStoreManager::invalidateRegions(Store store,
const MemRegion * const *I,
const MemRegion * const *End,
const Expr *E, unsigned Count,
- InvalidatedSymbols *IS,
+ InvalidatedSymbols &IS,
bool invalidateGlobals,
InvalidatedRegions *Regions) {
StoreRef newStore(store, *this);
@@ -587,18 +587,16 @@ StoreRef BasicStoreManager::invalidateRegion(Store store,
const MemRegion *R,
const Expr *E,
unsigned Count,
- InvalidatedSymbols *IS) {
+ InvalidatedSymbols &IS) {
R = R->StripCasts();
if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
return StoreRef(store, *this);
- if (IS) {
- BindingsTy B = GetBindings(store);
- if (BindingsTy::data_type *Val = B.lookup(R)) {
- if (SymbolRef Sym = Val->getAsSymbol())
- IS->insert(Sym);
- }
+ BindingsTy B = GetBindings(store);
+ if (BindingsTy::data_type *Val = B.lookup(R)) {
+ if (SymbolRef Sym = Val->getAsSymbol())
+ IS.insert(Sym);
}
QualType T = cast<TypedRegion>(R)->getValueType();
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
index ae8a04c..0ed4ff1 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
@@ -101,7 +101,8 @@ const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, unsigned BitWidth,
const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, QualType T) {
unsigned bits = Ctx.getTypeSize(T);
- llvm::APSInt V(bits, T->isUnsignedIntegerType() || Loc::isLocType(T));
+ llvm::APSInt V(bits,
+ T->isUnsignedIntegerOrEnumerationType() || Loc::isLocType(T));
V = X;
return getValue(V);
}
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
index d9b1ce8..0512e2f 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp
@@ -930,6 +930,13 @@ RetainSummary* RetainSummaryManager::getSummary(const FunctionDecl* FD) {
S = getPersistentStopSummary();
break;
}
+ // For C++ methods, generate an implicit "stop" summary as well. We
+ // can relax this once we have a clear policy for C++ methods and
+ // ownership attributes.
+ if (isa<CXXMethodDecl>(FD)) {
+ S = getPersistentStopSummary();
+ break;
+ }
// [PR 3337] Use 'getAs<FunctionType>' to strip away any typedefs on the
// function's type.
@@ -1111,15 +1118,11 @@ RetainSummary* RetainSummaryManager::getSummary(const FunctionDecl* FD) {
RetainSummary*
RetainSummaryManager::getCFCreateGetRuleSummary(const FunctionDecl* FD,
StringRef FName) {
-
if (FName.find("Create") != StringRef::npos ||
FName.find("Copy") != StringRef::npos)
return getCFSummaryCreateRule(FD);
- if (FName.find("Get") != StringRef::npos)
- return getCFSummaryGetRule(FD);
-
- return getDefaultSummary();
+ return getCFSummaryGetRule(FD);
}
RetainSummary*
@@ -1233,6 +1236,9 @@ RetainSummaryManager::updateSummaryFromAnnotations(RetainSummary &Summ,
if (FD->getAttr<CFReturnsRetainedAttr>()) {
Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
}
+ else if (FD->getAttr<CFReturnsNotRetainedAttr>()) {
+ Summ.setRetEffect(RetEffect::MakeNotOwned(RetEffect::CF));
+ }
}
}
@@ -1758,6 +1764,15 @@ public:
StmtNodeBuilder& Builder,
const ReturnStmt* S,
ExplodedNode* Pred);
+
+ void evalReturnWithRetEffect(ExplodedNodeSet& Dst,
+ ExprEngine& Engine,
+ StmtNodeBuilder& Builder,
+ const ReturnStmt* S,
+ ExplodedNode* Pred,
+ RetEffect RE, RefVal X,
+ SymbolRef Sym, const GRState *state);
+
// Assumptions.
@@ -2075,7 +2090,7 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode* N,
}
if (CurrV.isOwned()) {
- os << "+1 retain count (owning reference).";
+ os << "+1 retain count";
if (static_cast<CFRefBug&>(getBugType()).getTF().isGCEnabled()) {
assert(CurrV.getObjKind() == RetEffect::CF);
@@ -2085,7 +2100,7 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode* N,
}
else {
assert (CurrV.isNotOwned());
- os << "+0 retain count (non-owning reference).";
+ os << "+0 retain count";
}
PathDiagnosticLocation Pos(S, BRC.getSourceManager());
@@ -2217,11 +2232,11 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode* N,
case RefVal::ReturnedOwned:
os << "Object returned to caller as an owning reference (single retain "
- "count transferred to caller).";
+ "count transferred to caller)";
break;
case RefVal::ReturnedNotOwned:
- os << "Object returned to caller with a +0 (non-owning) retain count.";
+ os << "Object returned to caller with a +0 retain count";
break;
default:
@@ -2354,12 +2369,7 @@ CFRefLeakReport::getEndPath(BugReporterContext& BRC,
llvm::tie(AllocNode, FirstBinding) =
GetAllocationSite(BRC.getStateManager(), EndN, Sym);
- // Get the allocate site.
- assert(AllocNode);
- const Stmt* FirstStmt = cast<PostStmt>(AllocNode->getLocation()).getStmt();
-
SourceManager& SMgr = BRC.getSourceManager();
- unsigned AllocLine =SMgr.getInstantiationLineNumber(FirstStmt->getLocStart());
// Compute an actual location for the leak. Sometimes a leak doesn't
// occur at an actual statement (e.g., transition between blocks; end
@@ -2392,10 +2402,14 @@ CFRefLeakReport::getEndPath(BugReporterContext& BRC,
std::string sbuf;
llvm::raw_string_ostream os(sbuf);
- os << "Object allocated on line " << AllocLine;
+ os << "Object leaked: ";
- if (FirstBinding)
- os << " and stored into '" << FirstBinding->getString() << '\'';
+ if (FirstBinding) {
+ os << "object allocated and stored into '"
+ << FirstBinding->getString() << '\'';
+ }
+ else
+ os << "allocated object";
// Get the retain count.
const RefVal* RV = EndN->getState()->get<RefBindings>(Sym);
@@ -2404,12 +2418,22 @@ CFRefLeakReport::getEndPath(BugReporterContext& BRC,
// FIXME: Per comments in rdar://6320065, "create" only applies to CF
// ojbects. Only "copy", "alloc", "retain" and "new" transfer ownership
// to the caller for NS objects.
- ObjCMethodDecl& MD = cast<ObjCMethodDecl>(EndN->getCodeDecl());
- os << " is returned from a method whose name ('"
- << MD.getSelector().getAsString()
- << "') does not contain 'copy' or otherwise starts with"
- " 'new' or 'alloc'. This violates the naming convention rules given"
- " in the Memory Management Guide for Cocoa (object leaked)";
+ const Decl *D = &EndN->getCodeDecl();
+ if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D)) {
+ os << " is returned from a method whose name ('"
+ << MD->getSelector().getAsString()
+ << "') does not start with 'copy', 'mutableCopy', 'alloc' or 'new'."
+ " This violates the naming convention rules "
+ " given in the Memory Management Guide for Cocoa";
+ }
+ else {
+ const FunctionDecl *FD = cast<FunctionDecl>(D);
+ os << " is return from a function whose name ('"
+ << FD->getNameAsString()
+ << "') does not contain 'Copy' or 'Create'. This violates the naming"
+ " convention rules given the Memory Management Guide for Core "
+ " Foundation";
+ }
}
else if (RV->getKind() == RefVal::ErrorGCLeakReturned) {
ObjCMethodDecl& MD = cast<ObjCMethodDecl>(EndN->getCodeDecl());
@@ -2421,7 +2445,7 @@ CFRefLeakReport::getEndPath(BugReporterContext& BRC,
}
else
os << " is not referenced later in this execution path and has a retain "
- "count of +" << RV->getCount() << " (object leaked)";
+ "count of +" << RV->getCount();
return new PathDiagnosticEventPiece(L, os.str());
}
@@ -2494,6 +2518,23 @@ static QualType GetReturnType(const Expr* RetE, ASTContext& Ctx) {
return RetTy;
}
+
+// HACK: Symbols that have ref-count state that are referenced directly
+// (not as structure or array elements, or via bindings) by an argument
+// should not have their ref-count state stripped after we have
+// done an invalidation pass.
+//
+// FIXME: This is a global to currently share between CFRefCount and
+// RetainReleaseChecker. Eventually all functionality in CFRefCount should
+// be migrated to RetainReleaseChecker, and we can make this a non-global.
+llvm::DenseSet<SymbolRef> WhitelistedSymbols;
+namespace {
+struct ResetWhiteList {
+ ResetWhiteList() {}
+ ~ResetWhiteList() { WhitelistedSymbols.clear(); }
+};
+}
+
void CFRefCount::evalSummary(ExplodedNodeSet& Dst,
ExprEngine& Eng,
StmtNodeBuilder& Builder,
@@ -2510,12 +2551,9 @@ void CFRefCount::evalSummary(ExplodedNodeSet& Dst,
SymbolRef ErrorSym = 0;
llvm::SmallVector<const MemRegion*, 10> RegionsToInvalidate;
-
- // HACK: Symbols that have ref-count state that are referenced directly
- // (not as structure or array elements, or via bindings) by an argument
- // should not have their ref-count state stripped after we have
- // done an invalidation pass.
- llvm::DenseSet<SymbolRef> WhitelistedSymbols;
+
+ // Use RAII to make sure the whitelist is properly cleared.
+ ResetWhiteList resetWhiteList;
// Invalidate all instance variables of the receiver of a message.
// FIXME: We should be able to do better with inter-procedural analysis.
@@ -2624,20 +2662,14 @@ void CFRefCount::evalSummary(ExplodedNodeSet& Dst,
// NOTE: Even if RegionsToInvalidate is empty, we must still invalidate
// global variables.
- state = state->invalidateRegions(RegionsToInvalidate.data(),
- RegionsToInvalidate.data() +
- RegionsToInvalidate.size(),
- Ex, Count, &IS,
- /* invalidateGlobals = */ true);
-
- for (StoreManager::InvalidatedSymbols::iterator I = IS.begin(),
- E = IS.end(); I!=E; ++I) {
- SymbolRef sym = *I;
- if (WhitelistedSymbols.count(sym))
- continue;
- // Remove any existing reference-count binding.
- state = state->remove<RefBindings>(*I);
- }
+ // NOTE: RetainReleaseChecker handles the actual invalidation of symbols.
+ state =
+ state->invalidateRegions(RegionsToInvalidate.data(),
+ RegionsToInvalidate.data() +
+ RegionsToInvalidate.size(),
+ Ex, Count, &IS,
+ /* invalidateGlobals = */
+ Eng.doesInvalidateGlobals(callOrMsg));
// Evaluate the effect on the message receiver.
if (!ErrorRange.isValid() && Receiver) {
@@ -2946,30 +2978,50 @@ void CFRefCount::evalReturn(ExplodedNodeSet& Dst,
assert(T);
X = *T;
+ // Consult the summary of the enclosing method.
+ Decl const *CD = &Pred->getCodeDecl();
+
+ if (const ObjCMethodDecl* MD = dyn_cast<ObjCMethodDecl>(CD)) {
+ const RetainSummary &Summ = *Summaries.getMethodSummary(MD);
+ return evalReturnWithRetEffect(Dst, Eng, Builder, S,
+ Pred, Summ.getRetEffect(), X,
+ Sym, state);
+ }
+
+ if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(CD)) {
+ if (!isa<CXXMethodDecl>(FD))
+ if (const RetainSummary *Summ = Summaries.getSummary(FD))
+ return evalReturnWithRetEffect(Dst, Eng, Builder, S,
+ Pred, Summ->getRetEffect(), X,
+ Sym, state);
+ }
+}
+
+void CFRefCount::evalReturnWithRetEffect(ExplodedNodeSet &Dst,
+ ExprEngine &Eng,
+ StmtNodeBuilder &Builder,
+ const ReturnStmt *S,
+ ExplodedNode *Pred,
+ RetEffect RE, RefVal X,
+ SymbolRef Sym, const GRState *state) {
// Any leaks or other errors?
if (X.isReturnedOwned() && X.getCount() == 0) {
- Decl const *CD = &Pred->getCodeDecl();
- if (const ObjCMethodDecl* MD = dyn_cast<ObjCMethodDecl>(CD)) {
- const RetainSummary &Summ = *Summaries.getMethodSummary(MD);
- RetEffect RE = Summ.getRetEffect();
+ if (RE.getKind() != RetEffect::NoRet) {
bool hasError = false;
-
- if (RE.getKind() != RetEffect::NoRet) {
- if (isGCEnabled() && RE.getObjKind() == RetEffect::ObjC) {
- // Things are more complicated with garbage collection. If the
- // returned object is suppose to be an Objective-C object, we have
- // a leak (as the caller expects a GC'ed object) because no
- // method should return ownership unless it returns a CF object.
- hasError = true;
- X = X ^ RefVal::ErrorGCLeakReturned;
- }
- else if (!RE.isOwned()) {
- // Either we are using GC and the returned object is a CF type
- // or we aren't using GC. In either case, we expect that the
- // enclosing method is expected to return ownership.
- hasError = true;
- X = X ^ RefVal::ErrorLeakReturned;
- }
+ if (isGCEnabled() && RE.getObjKind() == RetEffect::ObjC) {
+ // Things are more complicated with garbage collection. If the
+ // returned object is suppose to be an Objective-C object, we have
+ // a leak (as the caller expects a GC'ed object) because no
+ // method should return ownership unless it returns a CF object.
+ hasError = true;
+ X = X ^ RefVal::ErrorGCLeakReturned;
+ }
+ else if (!RE.isOwned()) {
+ // Either we are using GC and the returned object is a CF type
+ // or we aren't using GC. In either case, we expect that the
+ // enclosing method is expected to return ownership.
+ hasError = true;
+ X = X ^ RefVal::ErrorLeakReturned;
}
if (hasError) {
@@ -2987,26 +3039,24 @@ void CFRefCount::evalReturn(ExplodedNodeSet& Dst,
}
}
}
+ return;
}
- else if (X.isReturnedNotOwned()) {
- Decl const *CD = &Pred->getCodeDecl();
- if (const ObjCMethodDecl* MD = dyn_cast<ObjCMethodDecl>(CD)) {
- const RetainSummary &Summ = *Summaries.getMethodSummary(MD);
- if (Summ.getRetEffect().isOwned()) {
- // Trying to return a not owned object to a caller expecting an
- // owned object.
-
- static int ReturnNotOwnedForOwnedTag = 0;
- state = state->set<RefBindings>(Sym, X ^ RefVal::ErrorReturnedNotOwned);
- if (ExplodedNode *N =
- Builder.generateNode(PostStmt(S, Pred->getLocationContext(),
- &ReturnNotOwnedForOwnedTag),
- state, Pred)) {
- CFRefReport *report =
- new CFRefReport(*static_cast<CFRefBug*>(returnNotOwnedForOwned),
- *this, N, Sym);
- BR->EmitReport(report);
- }
+
+ if (X.isReturnedNotOwned()) {
+ if (RE.isOwned()) {
+ // Trying to return a not owned object to a caller expecting an
+ // owned object.
+
+ static int ReturnNotOwnedForOwnedTag = 0;
+ state = state->set<RefBindings>(Sym, X ^ RefVal::ErrorReturnedNotOwned);
+ if (ExplodedNode *N =
+ Builder.generateNode(PostStmt(S, Pred->getLocationContext(),
+ &ReturnNotOwnedForOwnedTag),
+ state, Pred)) {
+ CFRefReport *report =
+ new CFRefReport(*static_cast<CFRefBug*>(returnNotOwnedForOwned),
+ *this, N, Sym);
+ BR->EmitReport(report);
}
}
}
@@ -3418,12 +3468,43 @@ void CFRefCount::ProcessNonLeakError(ExplodedNodeSet& Dst,
namespace {
class RetainReleaseChecker
- : public Checker< check::PostStmt<BlockExpr> > {
+ : public Checker< check::PostStmt<BlockExpr>, check::RegionChanges > {
public:
+ bool wantsRegionUpdate;
+
+ RetainReleaseChecker() : wantsRegionUpdate(true) {}
+
+
void checkPostStmt(const BlockExpr *BE, CheckerContext &C) const;
+ const GRState *checkRegionChanges(const GRState *state,
+ const StoreManager::InvalidatedSymbols *invalidated,
+ const MemRegion * const *begin,
+ const MemRegion * const *end) const;
+
+ bool wantsRegionChangeUpdate(const GRState *state) const {
+ return wantsRegionUpdate;
+ }
};
} // end anonymous namespace
+const GRState *
+RetainReleaseChecker::checkRegionChanges(const GRState *state,
+ const StoreManager::InvalidatedSymbols *invalidated,
+ const MemRegion * const *begin,
+ const MemRegion * const *end) const {
+ if (!invalidated)
+ return state;
+
+ for (StoreManager::InvalidatedSymbols::const_iterator I=invalidated->begin(),
+ E = invalidated->end(); I!=E; ++I) {
+ SymbolRef sym = *I;
+ if (WhitelistedSymbols.count(sym))
+ continue;
+ // Remove any existing reference-count binding.
+ state = state->remove<RefBindings>(sym);
+ }
+ return state;
+}
void RetainReleaseChecker::checkPostStmt(const BlockExpr *BE,
CheckerContext &C) const {
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp
index 54cbca0..ef7bc20 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp
@@ -132,7 +132,7 @@ void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E,
assert(CD);
#if 0
- if (!(CD->isThisDeclarationADefinition() && AMgr.shouldInlineCall()))
+ if (!(CD->doesThisDeclarationHaveABody() && AMgr.shouldInlineCall()))
// FIXME: invalidate the object.
return;
#endif
@@ -246,7 +246,7 @@ void ExprEngine::VisitCXXDestructor(const CXXDestructorDecl *DD,
const Stmt *S,
ExplodedNode *Pred,
ExplodedNodeSet &Dst) {
- if (!(DD->isThisDeclarationADefinition() && AMgr.shouldInlineCall()))
+ if (!(DD->doesThisDeclarationHaveABody() && AMgr.shouldInlineCall()))
return;
// Create the context for 'this' region.
const StackFrameContext *SFC = AMgr.getStackFrame(DD,
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
index 4a25490..ba7c384 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
@@ -345,6 +345,7 @@ bool CheckerManager::wantsRegionChangeUpdate(const GRState *state) {
/// \brief Run checkers for region changes.
const GRState *
CheckerManager::runCheckersForRegionChanges(const GRState *state,
+ const StoreManager::InvalidatedSymbols *invalidated,
const MemRegion * const *Begin,
const MemRegion * const *End) {
for (unsigned i = 0, e = RegionChangesCheckers.size(); i != e; ++i) {
@@ -352,7 +353,7 @@ CheckerManager::runCheckersForRegionChanges(const GRState *state,
// bail out.
if (!state)
return NULL;
- state = RegionChangesCheckers[i].CheckFn(state, Begin, End);
+ state = RegionChangesCheckers[i].CheckFn(state, invalidated, Begin, End);
}
return state;
}
@@ -415,6 +416,15 @@ void CheckerManager::runCheckersForEvalCall(ExplodedNodeSet &Dst,
}
}
+/// \brief Run checkers for the entire Translation Unit.
+void CheckerManager::runCheckersOnEndOfTranslationUnit(
+ const TranslationUnitDecl *TU,
+ AnalysisManager &mgr,
+ BugReporter &BR) {
+ for (unsigned i = 0, e = EndOfTranslationUnitCheckers.size(); i != e; ++i)
+ EndOfTranslationUnitCheckers[i](TU, mgr, BR);
+}
+
//===----------------------------------------------------------------------===//
// Internal registration functions for AST traversing.
//===----------------------------------------------------------------------===//
@@ -494,6 +504,11 @@ void CheckerManager::_registerForEvalCall(EvalCallFunc checkfn) {
EvalCallCheckers.push_back(checkfn);
}
+void CheckerManager::_registerForEndOfTranslationUnit(
+ CheckEndOfTranslationUnit checkfn) {
+ EndOfTranslationUnitCheckers.push_back(checkfn);
+}
+
//===----------------------------------------------------------------------===//
// Implementation details.
//===----------------------------------------------------------------------===//
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp
index a00f9dc1..48f126b 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp
@@ -39,6 +39,9 @@ SVal Environment::getSVal(const Stmt *E, SValBuilder& svalBuilder,
}
for (;;) {
+ if (const Expr *Ex = dyn_cast<Expr>(E))
+ E = Ex->IgnoreParens();
+
switch (E->getStmtClass()) {
case Stmt::AddrLabelExprClass:
return svalBuilder.makeLoc(cast<AddrLabelExpr>(E));
@@ -48,13 +51,10 @@ SVal Environment::getSVal(const Stmt *E, SValBuilder& svalBuilder,
continue;
}
case Stmt::ParenExprClass:
- // ParenExprs are no-ops.
- E = cast<ParenExpr>(E)->getSubExpr();
- continue;
case Stmt::GenericSelectionExprClass:
- // GenericSelectionExprs are no-ops.
- E = cast<GenericSelectionExpr>(E)->getResultExpr();
- continue;
+ llvm_unreachable("ParenExprs and GenericSelectionExprs should "
+ "have been handled by IgnoreParens()");
+ return UnknownVal();
case Stmt::CharacterLiteralClass: {
const CharacterLiteral* C = cast<CharacterLiteral>(E);
return svalBuilder.makeIntVal(C->getValue(), C->getType());
@@ -77,21 +77,6 @@ SVal Environment::getSVal(const Stmt *E, SValBuilder& svalBuilder,
// For special C0xx nullptr case, make a null pointer SVal.
case Stmt::CXXNullPtrLiteralExprClass:
return svalBuilder.makeNull();
- case Stmt::ImplicitCastExprClass:
- case Stmt::CXXFunctionalCastExprClass:
- case Stmt::CStyleCastExprClass: {
- // We blast through no-op casts to get the descendant
- // subexpression that has a value.
- const CastExpr* C = cast<CastExpr>(E);
- QualType CT = C->getType();
- if (CT->isVoidType())
- return UnknownVal();
- if (C->getCastKind() == CK_NoOp) {
- E = C->getSubExpr();
- continue;
- }
- break;
- }
case Stmt::ExprWithCleanupsClass:
E = cast<ExprWithCleanups>(E)->getSubExpr();
continue;
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 657420d..aed39eb 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -156,6 +156,27 @@ const GRState* ExprEngine::getInitialState(const LocationContext *InitLoc) {
return state;
}
+bool
+ExprEngine::doesInvalidateGlobals(const CallOrObjCMessage &callOrMessage) const
+{
+ if (callOrMessage.isFunctionCall() && !callOrMessage.isCXXCall()) {
+ SVal calleeV = callOrMessage.getFunctionCallee();
+ if (const FunctionTextRegion *codeR =
+ llvm::dyn_cast_or_null<FunctionTextRegion>(calleeV.getAsRegion())) {
+
+ const FunctionDecl *fd = codeR->getDecl();
+ if (const IdentifierInfo *ii = fd->getIdentifier()) {
+ llvm::StringRef fname = ii->getName();
+ if (fname == "strlen")
+ return false;
+ }
+ }
+ }
+
+ // The conservative answer: invalidates globals.
+ return true;
+}
+
//===----------------------------------------------------------------------===//
// Top-level transfer function logic (Dispatcher).
//===----------------------------------------------------------------------===//
@@ -179,9 +200,11 @@ bool ExprEngine::wantsRegionChangeUpdate(const GRState* state) {
const GRState *
ExprEngine::processRegionChanges(const GRState *state,
- const MemRegion * const *Begin,
- const MemRegion * const *End) {
- return getCheckerManager().runCheckersForRegionChanges(state, Begin, End);
+ const StoreManager::InvalidatedSymbols *invalidated,
+ const MemRegion * const *Begin,
+ const MemRegion * const *End) {
+ return getCheckerManager().runCheckersForRegionChanges(state, invalidated,
+ Begin, End);
}
void ExprEngine::processEndWorklist(bool hasWorkRemaining) {
@@ -516,6 +539,7 @@ void ExprEngine::Visit(const Stmt* S, ExplodedNode* Pred,
case Stmt::VAArgExprClass:
case Stmt::CUDAKernelCallExprClass:
case Stmt::OpaqueValueExprClass:
+ case Stmt::AsTypeExprClass:
// Fall through.
// Cases we intentionally don't evaluate, since they don't need
@@ -2462,7 +2486,7 @@ void ExprEngine::VisitOffsetOfExpr(const OffsetOfExpr* OOE,
const APSInt &IV = Res.Val.getInt();
assert(IV.getBitWidth() == getContext().getTypeSize(OOE->getType()));
assert(OOE->getType()->isIntegerType());
- assert(IV.isSigned() == OOE->getType()->isSignedIntegerType());
+ assert(IV.isSigned() == OOE->getType()->isSignedIntegerOrEnumerationType());
SVal X = svalBuilder.makeIntVal(IV);
MakeNode(Dst, OOE, Pred, GetState(Pred)->BindExpr(OOE, X));
return;
@@ -2701,7 +2725,7 @@ void ExprEngine::VisitUnaryOperator(const UnaryOperator* U,
if (U->isLValue())
state = state->BindExpr(U, loc);
else
- state = state->BindExpr(U, V2);
+ state = state->BindExpr(U, U->isPostfix() ? V2 : Result);
// Perform the store.
evalStore(Dst, NULL, U, *I2, state, loc, Result);
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FlatStore.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FlatStore.cpp
index 7bdca6b..ca867ae 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FlatStore.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FlatStore.cpp
@@ -59,7 +59,7 @@ public:
StoreRef invalidateRegions(Store store, const MemRegion * const *I,
const MemRegion * const *E, const Expr *Ex,
- unsigned Count, InvalidatedSymbols *IS,
+ unsigned Count, InvalidatedSymbols &IS,
bool invalidateGlobals,
InvalidatedRegions *Regions);
@@ -175,7 +175,7 @@ StoreRef FlatStoreManager::invalidateRegions(Store store,
const MemRegion * const *I,
const MemRegion * const *E,
const Expr *Ex, unsigned Count,
- InvalidatedSymbols *IS,
+ InvalidatedSymbols &IS,
bool invalidateGlobals,
InvalidatedRegions *Regions) {
assert(false && "Not implemented");
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/GRState.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/GRState.cpp
index 7b21677..0f6ff1e 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/GRState.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/GRState.cpp
@@ -141,6 +141,20 @@ const GRState *GRState::invalidateRegions(const MemRegion * const *Begin,
const Expr *E, unsigned Count,
StoreManager::InvalidatedSymbols *IS,
bool invalidateGlobals) const {
+ if (!IS) {
+ StoreManager::InvalidatedSymbols invalidated;
+ return invalidateRegionsImpl(Begin, End, E, Count,
+ invalidated, invalidateGlobals);
+ }
+ return invalidateRegionsImpl(Begin, End, E, Count, *IS, invalidateGlobals);
+}
+
+const GRState *
+GRState::invalidateRegionsImpl(const MemRegion * const *Begin,
+ const MemRegion * const *End,
+ const Expr *E, unsigned Count,
+ StoreManager::InvalidatedSymbols &IS,
+ bool invalidateGlobals) const {
GRStateManager &Mgr = getStateManager();
SubEngine* Eng = Mgr.getOwningEngine();
@@ -150,7 +164,7 @@ const GRState *GRState::invalidateRegions(const MemRegion * const *Begin,
= Mgr.StoreMgr->invalidateRegions(getStore(), Begin, End, E, Count, IS,
invalidateGlobals, &Regions);
const GRState *newState = makeWithStore(newStore);
- return Eng->processRegionChanges(newState,
+ return Eng->processRegionChanges(newState, &IS,
&Regions.front(),
&Regions.back()+1);
}
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ObjCMessage.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ObjCMessage.cpp
index c005819..c000600 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ObjCMessage.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ObjCMessage.cpp
@@ -141,6 +141,13 @@ SVal CallOrObjCMessage::getArgSValAsScalarOrLoc(unsigned i) const {
return UnknownVal();
}
+SVal CallOrObjCMessage::getFunctionCallee() const {
+ assert(isFunctionCall());
+ assert(!isCXXCall());
+ const Expr *callee = CallE->getCallee()->IgnoreParenCasts();
+ return State->getSVal(callee);
+}
+
SVal CallOrObjCMessage::getCXXCallee() const {
assert(isCXXCall());
const Expr *callee =
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 4522f97..d0d8f60 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -240,7 +240,7 @@ public:
const MemRegion * const *Begin,
const MemRegion * const *End,
const Expr *E, unsigned Count,
- InvalidatedSymbols *IS,
+ InvalidatedSymbols &IS,
bool invalidateGlobals,
InvalidatedRegions *Regions);
@@ -586,14 +586,14 @@ class invalidateRegionsWorker : public ClusterAnalysis<invalidateRegionsWorker>
{
const Expr *Ex;
unsigned Count;
- StoreManager::InvalidatedSymbols *IS;
+ StoreManager::InvalidatedSymbols &IS;
StoreManager::InvalidatedRegions *Regions;
public:
invalidateRegionsWorker(RegionStoreManager &rm,
GRStateManager &stateMgr,
RegionBindings b,
const Expr *ex, unsigned count,
- StoreManager::InvalidatedSymbols *is,
+ StoreManager::InvalidatedSymbols &is,
StoreManager::InvalidatedRegions *r,
bool includeGlobals)
: ClusterAnalysis<invalidateRegionsWorker>(rm, stateMgr, b, includeGlobals),
@@ -609,9 +609,8 @@ private:
void invalidateRegionsWorker::VisitBinding(SVal V) {
// A symbol? Mark it touched by the invalidation.
- if (IS)
- if (SymbolRef Sym = V.getAsSymbol())
- IS->insert(Sym);
+ if (SymbolRef Sym = V.getAsSymbol())
+ IS.insert(Sym);
if (const MemRegion *R = V.getAsRegion()) {
AddToWorkList(R);
@@ -648,11 +647,9 @@ void invalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
}
void invalidateRegionsWorker::VisitBaseRegion(const MemRegion *baseR) {
- if (IS) {
- // Symbolic region? Mark that symbol touched by the invalidation.
- if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(baseR))
- IS->insert(SR->getSymbol());
- }
+ // Symbolic region? Mark that symbol touched by the invalidation.
+ if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(baseR))
+ IS.insert(SR->getSymbol());
// BlockDataRegion? If so, invalidate captured variables that are passed
// by reference.
@@ -724,7 +721,7 @@ StoreRef RegionStoreManager::invalidateRegions(Store store,
const MemRegion * const *I,
const MemRegion * const *E,
const Expr *Ex, unsigned Count,
- InvalidatedSymbols *IS,
+ InvalidatedSymbols &IS,
bool invalidateGlobals,
InvalidatedRegions *Regions) {
invalidateRegionsWorker W(*this, StateMgr,
@@ -1066,6 +1063,11 @@ SVal RegionStoreManager::RetrieveElement(Store store,
// return *y;
// FIXME: This is a hack, and doesn't do anything really intelligent yet.
const RegionRawOffset &O = R->getAsArrayOffset();
+
+ // If we cannot reason about the offset, return an unknown value.
+ if (!O.getRegion())
+ return UnknownVal();
+
if (const TypedRegion *baseR = dyn_cast_or_null<TypedRegion>(O.getRegion())) {
QualType baseT = baseR->getValueType();
if (baseT->isScalarType()) {
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
index 1ee694e..20762e0 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
@@ -262,7 +262,8 @@ const GRState *SimpleConstraintManager::assumeSymRel(const GRState *state,
QualType T = Sym->getType(Ctx);
assert(T->isIntegerType() || Loc::isLocType(T));
unsigned bitwidth = Ctx.getTypeSize(T);
- bool isSymUnsigned = T->isUnsignedIntegerType() || Loc::isLocType(T);
+ bool isSymUnsigned
+ = T->isUnsignedIntegerOrEnumerationType() || Loc::isLocType(T);
// Convert the adjustment.
Adjustment.setIsUnsigned(isSymUnsigned);
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
index 5d80251..197442b 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
@@ -97,7 +97,8 @@ SVal SimpleSValBuilder::evalCastFromNonLoc(NonLoc val, QualType castTy) {
return UnknownVal();
llvm::APSInt i = cast<nonloc::ConcreteInt>(val).getValue();
- i.setIsUnsigned(castTy->isUnsignedIntegerType() || Loc::isLocType(castTy));
+ i.setIsUnsigned(castTy->isUnsignedIntegerOrEnumerationType() ||
+ Loc::isLocType(castTy));
i = i.extOrTrunc(Context.getTypeSize(castTy));
if (isLocType)
@@ -129,7 +130,8 @@ SVal SimpleSValBuilder::evalCastFromLoc(Loc val, QualType castTy) {
return makeLocAsInteger(val, BitWidth);
llvm::APSInt i = cast<loc::ConcreteInt>(val).getValue();
- i.setIsUnsigned(castTy->isUnsignedIntegerType() || Loc::isLocType(castTy));
+ i.setIsUnsigned(castTy->isUnsignedIntegerOrEnumerationType() ||
+ Loc::isLocType(castTy));
i = i.extOrTrunc(BitWidth);
return makeIntVal(i);
}
diff --git a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
index fe6e1fd..b8dbb54 100644
--- a/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ b/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -200,18 +200,20 @@ void AnalysisConsumer::HandleDeclContext(ASTContext &C, DeclContext *dc) {
}
break;
}
-
+
+ case Decl::ObjCCategoryImpl:
case Decl::ObjCImplementation: {
- ObjCImplementationDecl* ID = cast<ObjCImplementationDecl>(*I);
+ ObjCImplDecl* ID = cast<ObjCImplDecl>(*I);
HandleCode(ID);
- for (ObjCImplementationDecl::method_iterator MI = ID->meth_begin(),
+ for (ObjCContainerDecl::method_iterator MI = ID->meth_begin(),
ME = ID->meth_end(); MI != ME; ++MI) {
checkerMgr->runCheckersOnASTDecl(*MI, *Mgr, BR);
if ((*MI)->isThisDeclarationADefinition()) {
if (!Opts.AnalyzeSpecificFunction.empty() &&
- Opts.AnalyzeSpecificFunction != (*MI)->getSelector().getAsString())
+ Opts.AnalyzeSpecificFunction !=
+ (*MI)->getSelector().getAsString())
break;
DisplayFunction(*MI);
HandleCode(*MI);
@@ -232,6 +234,9 @@ void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
checkerMgr->runCheckersOnASTDecl(TU, *Mgr, BR);
HandleDeclContext(C, TU);
+ // After all decls handled, run checkers on the entire TranslationUnit.
+ checkerMgr->runCheckersOnEndOfTranslationUnit(TU, *Mgr, BR);
+
// Explicitly destroy the PathDiagnosticClient. This will flush its output.
// FIXME: This should be replaced with something that doesn't rely on
// side-effects in PathDiagnosticClient's destructor. This is required when
diff --git a/contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.cpp b/contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.cpp
deleted file mode 100644
index 7f027cf..0000000
--- a/contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-//===--- JsonCompileCommandLineDatabase.cpp - Simple JSON database --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements reading a compile command line database, as written
-// out for example by CMake.
-//
-//===----------------------------------------------------------------------===//
-
-#include "JsonCompileCommandLineDatabase.h"
-#include "llvm/ADT/Twine.h"
-
-namespace clang {
-namespace tooling {
-
-namespace {
-
-// A parser for JSON escaped strings of command line arguments with \-escaping
-// for quoted arguments (see the documentation of UnescapeJsonCommandLine(...)).
-class CommandLineArgumentParser {
- public:
- CommandLineArgumentParser(llvm::StringRef CommandLine)
- : Input(CommandLine), Position(Input.begin()-1) {}
-
- std::vector<std::string> Parse() {
- bool HasMoreInput = true;
- while (HasMoreInput && NextNonWhitespace()) {
- std::string Argument;
- HasMoreInput = ParseStringInto(Argument);
- CommandLine.push_back(Argument);
- }
- return CommandLine;
- }
-
- private:
- // All private methods return true if there is more input available.
-
- bool ParseStringInto(std::string &String) {
- do {
- if (*Position == '"') {
- if (!ParseQuotedStringInto(String)) return false;
- } else {
- if (!ParseFreeStringInto(String)) return false;
- }
- } while (*Position != ' ');
- return true;
- }
-
- bool ParseQuotedStringInto(std::string &String) {
- if (!Next()) return false;
- while (*Position != '"') {
- if (!SkipEscapeCharacter()) return false;
- String.push_back(*Position);
- if (!Next()) return false;
- }
- return Next();
- }
-
- bool ParseFreeStringInto(std::string &String) {
- do {
- if (!SkipEscapeCharacter()) return false;
- String.push_back(*Position);
- if (!Next()) return false;
- } while (*Position != ' ' && *Position != '"');
- return true;
- }
-
- bool SkipEscapeCharacter() {
- if (*Position == '\\') {
- return Next();
- }
- return true;
- }
-
- bool NextNonWhitespace() {
- do {
- if (!Next()) return false;
- } while (*Position == ' ');
- return true;
- }
-
- bool Next() {
- ++Position;
- if (Position == Input.end()) return false;
- // Remove the JSON escaping first. This is done unconditionally.
- if (*Position == '\\') ++Position;
- return Position != Input.end();
- }
-
- const llvm::StringRef Input;
- llvm::StringRef::iterator Position;
- std::vector<std::string> CommandLine;
-};
-
-} // end namespace
-
-std::vector<std::string> UnescapeJsonCommandLine(
- llvm::StringRef JsonEscapedCommandLine) {
- CommandLineArgumentParser parser(JsonEscapedCommandLine);
- return parser.Parse();
-}
-
-JsonCompileCommandLineParser::JsonCompileCommandLineParser(
- const llvm::StringRef Input, CompileCommandHandler *CommandHandler)
- : Input(Input), Position(Input.begin()-1), CommandHandler(CommandHandler) {}
-
-bool JsonCompileCommandLineParser::Parse() {
- NextNonWhitespace();
- return ParseTranslationUnits();
-}
-
-std::string JsonCompileCommandLineParser::GetErrorMessage() const {
- return ErrorMessage;
-}
-
-bool JsonCompileCommandLineParser::ParseTranslationUnits() {
- if (!ConsumeOrError('[', "at start of compile command file")) return false;
- if (!ParseTranslationUnit(/*First=*/true)) return false;
- while (Consume(',')) {
- if (!ParseTranslationUnit(/*First=*/false)) return false;
- }
- if (!ConsumeOrError(']', "at end of array")) return false;
- if (CommandHandler != NULL) {
- CommandHandler->EndTranslationUnits();
- }
- return true;
-}
-
-bool JsonCompileCommandLineParser::ParseTranslationUnit(bool First) {
- if (First) {
- if (!Consume('{')) return true;
- } else {
- if (!ConsumeOrError('{', "at start of object")) return false;
- }
- if (!Consume('}')) {
- if (!ParseObjectKeyValuePairs()) return false;
- if (!ConsumeOrError('}', "at end of object")) return false;
- }
- if (CommandHandler != NULL) {
- CommandHandler->EndTranslationUnit();
- }
- return true;
-}
-
-bool JsonCompileCommandLineParser::ParseObjectKeyValuePairs() {
- do {
- llvm::StringRef Key;
- if (!ParseString(Key)) return false;
- if (!ConsumeOrError(':', "between name and value")) return false;
- llvm::StringRef Value;
- if (!ParseString(Value)) return false;
- if (CommandHandler != NULL) {
- CommandHandler->HandleKeyValue(Key, Value);
- }
- } while (Consume(','));
- return true;
-}
-
-bool JsonCompileCommandLineParser::ParseString(llvm::StringRef &String) {
- if (!ConsumeOrError('"', "at start of string")) return false;
- llvm::StringRef::iterator First = Position;
- llvm::StringRef::iterator Last = Position;
- while (!Consume('"')) {
- Consume('\\');
- ++Position;
- // We need to store Position, as Consume will change Last before leaving
- // the loop.
- Last = Position;
- }
- String = llvm::StringRef(First, Last - First);
- return true;
-}
-
-bool JsonCompileCommandLineParser::Consume(char C) {
- if (Position == Input.end()) return false;
- if (*Position != C) return false;
- NextNonWhitespace();
- return true;
-}
-
-bool JsonCompileCommandLineParser::ConsumeOrError(
- char C, llvm::StringRef Message) {
- if (!Consume(C)) {
- SetExpectError(C, Message);
- return false;
- }
- return true;
-}
-
-void JsonCompileCommandLineParser::SetExpectError(
- char C, llvm::StringRef Message) {
- ErrorMessage = (llvm::Twine("'") + llvm::StringRef(&C, 1) +
- "' expected " + Message + ".").str();
-}
-
-void JsonCompileCommandLineParser::NextNonWhitespace() {
- do {
- ++Position;
- } while (IsWhitespace());
-}
-
-bool JsonCompileCommandLineParser::IsWhitespace() {
- if (Position == Input.end()) return false;
- return (*Position == ' ' || *Position == '\t' ||
- *Position == '\n' || *Position == '\r');
-}
-
-} // end namespace tooling
-} // end namespace clang
diff --git a/contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.h b/contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.h
deleted file mode 100644
index 9e776d6..0000000
--- a/contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.h
+++ /dev/null
@@ -1,107 +0,0 @@
-//===--- JsonCompileCommandLineDatabase - Simple JSON database --*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements reading a compile command line database, as written
-// out for example by CMake. It only supports the subset of the JSON standard
-// that is needed to parse the CMake output.
-// See http://www.json.org/ for the full standard.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_TOOLING_JSON_COMPILE_COMMAND_LINE_DATABASE_H
-#define LLVM_CLANG_TOOLING_JSON_COMPILE_COMMAND_LINE_DATABASE_H
-
-#include "llvm/ADT/StringRef.h"
-#include <string>
-#include <vector>
-
-namespace clang {
-namespace tooling {
-
-/// \brief Converts a JSON escaped command line to a vector of arguments.
-///
-/// \param JsonEscapedCommandLine The escaped command line as a string. This
-/// is assumed to be escaped as a JSON string (e.g. " and \ are escaped).
-/// In addition, any arguments containing spaces are assumed to be \-escaped
-///
-/// For example, the input (|| denoting non C-escaped strings):
-/// |./call a \"b \\\" c \\\\ \" d|
-/// would yield:
-/// [ |./call|, |a|, |b " c \ |, |d| ].
-std::vector<std::string> UnescapeJsonCommandLine(
- llvm::StringRef JsonEscapedCommandLine);
-
-/// \brief Interface for users of the JsonCompileCommandLineParser.
-class CompileCommandHandler {
- public:
- virtual ~CompileCommandHandler() {}
-
- /// \brief Called after all translation units are parsed.
- virtual void EndTranslationUnits() {}
-
- /// \brief Called at the end of a single translation unit.
- virtual void EndTranslationUnit() {}
-
- /// \brief Called for every (Key, Value) pair in a translation unit
- /// description.
- virtual void HandleKeyValue(llvm::StringRef Key, llvm::StringRef Value) {}
-};
-
-/// \brief A JSON parser that supports the subset of JSON needed to parse
-/// JSON compile command line databases as written out by CMake.
-///
-/// The supported subset describes a list of compile command lines for
-/// each processed translation unit. The translation units are stored in a
-/// JSON array, where each translation unit is described by a JSON object
-/// containing (Key, Value) pairs for the working directory the compile command
-/// line was executed from, the main C/C++ input file of the translation unit
-/// and the actual compile command line, for example:
-/// [
-/// {
-/// "file":"/file.cpp",
-/// "directory":"/",
-/// "command":"/cc /file.cpp"
-/// }
-/// ]
-class JsonCompileCommandLineParser {
- public:
- /// \brief Create a parser on 'Input', calling 'CommandHandler' to handle the
- /// parsed constructs. 'CommandHandler' may be NULL in order to just check
- /// the validity of 'Input'.
- JsonCompileCommandLineParser(const llvm::StringRef Input,
- CompileCommandHandler *CommandHandler);
-
- /// \brief Parses the specified input. Returns true if no parsing errors were
- /// foudn.
- bool Parse();
-
- /// \brief Returns an error message if Parse() returned false previously.
- std::string GetErrorMessage() const;
-
- private:
- bool ParseTranslationUnits();
- bool ParseTranslationUnit(bool First);
- bool ParseObjectKeyValuePairs();
- bool ParseString(llvm::StringRef &String);
- bool Consume(char C);
- bool ConsumeOrError(char C, llvm::StringRef Message);
- void NextNonWhitespace();
- bool IsWhitespace();
- void SetExpectError(char C, llvm::StringRef Message);
-
- const llvm::StringRef Input;
- llvm::StringRef::iterator Position;
- std::string ErrorMessage;
- CompileCommandHandler * const CommandHandler;
-};
-
-} // end namespace tooling
-} // end namespace clang
-
-#endif // LLVM_CLANG_TOOLING_JSON_COMPILE_COMMAND_LINE_DATABASE_H
diff --git a/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp b/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp
deleted file mode 100644
index c1714a9..0000000
--- a/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp
+++ /dev/null
@@ -1,322 +0,0 @@
-//===--- Tooling.cpp - Running clang standalone tools --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements functions to run clang tools standalone instead
-// of running them as a plugin.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Tooling/Tooling.h"
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/SmallString.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Host.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Path.h"
-#include "llvm/Support/raw_ostream.h"
-#include "clang/Basic/DiagnosticIDs.h"
-#include "clang/Driver/Compilation.h"
-#include "clang/Driver/Driver.h"
-#include "clang/Driver/Tool.h"
-#include "clang/Frontend/CompilerInstance.h"
-#include "clang/Frontend/FrontendAction.h"
-#include "clang/Frontend/FrontendDiagnostic.h"
-#include "clang/Frontend/TextDiagnosticPrinter.h"
-#include "JsonCompileCommandLineDatabase.h"
-#include <map>
-#include <cstdio>
-
-namespace clang {
-namespace tooling {
-
-namespace {
-
-// Checks that the input conforms to the argv[] convention as in
-// main(). Namely:
-// - it must contain at least a program path,
-// - argv[0], ..., and argv[argc - 1] mustn't be NULL, and
-// - argv[argc] must be NULL.
-void ValidateArgv(int argc, char* argv[]) {
- if (argc < 1) {
- fprintf(stderr, "ERROR: argc is %d. It must be >= 1.\n", argc);
- abort();
- }
-
- for (int i = 0; i < argc; ++i) {
- if (argv[i] == NULL) {
- fprintf(stderr, "ERROR: argv[%d] is NULL.\n", i);
- abort();
- }
- }
-
- if (argv[argc] != NULL) {
- fprintf(stderr, "ERROR: argv[argc] isn't NULL.\n");
- abort();
- }
-}
-
-} // end namespace
-
-// FIXME: This file contains structural duplication with other parts of the
-// code that sets up a compiler to run tools on it, and we should refactor
-// it to be based on the same framework.
-
-static clang::Diagnostic* NewTextDiagnostics() {
- llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> DiagIDs(
- new clang::DiagnosticIDs());
- clang::TextDiagnosticPrinter *DiagClient = new clang::TextDiagnosticPrinter(
- llvm::errs(), clang::DiagnosticOptions());
- return new clang::Diagnostic(DiagIDs, DiagClient);
-}
-
-// Exists solely for the purpose of lookup of the main executable.
-static int StaticSymbol;
-
-/// \brief Builds a clang driver initialized for running clang tools.
-static clang::driver::Driver* NewDriver(clang::Diagnostic* Diagnostics,
- const char* BinaryName) {
- // This just needs to be some symbol in the binary.
- void* const SymbolAddr = &StaticSymbol;
- const llvm::sys::Path ExePath =
- llvm::sys::Path::GetMainExecutable(BinaryName, SymbolAddr);
-
- const std::string DefaultOutputName = "a.out";
- clang::driver::Driver* CompilerDriver = new clang::driver::Driver(
- ExePath.str(), llvm::sys::getHostTriple(),
- DefaultOutputName, false, false, *Diagnostics);
- CompilerDriver->setTitle("clang_based_tool");
- return CompilerDriver;
-}
-
-/// \brief Retrieves the clang CC1 specific flags out of the compilation's jobs.
-/// Returns NULL on error.
-static const clang::driver::ArgStringList* GetCC1Arguments(
- clang::Diagnostic* Diagnostics, clang::driver::Compilation* Compilation) {
- // We expect to get back exactly one Command job, if we didn't something
- // failed. Extract that job from the Compilation.
- const clang::driver::JobList &Jobs = Compilation->getJobs();
- if (Jobs.size() != 1 || !isa<clang::driver::Command>(*Jobs.begin())) {
- llvm::SmallString<256> error_msg;
- llvm::raw_svector_ostream error_stream(error_msg);
- Compilation->PrintJob(error_stream, Compilation->getJobs(), "; ", true);
- Diagnostics->Report(clang::diag::err_fe_expected_compiler_job)
- << error_stream.str();
- return NULL;
- }
-
- // The one job we find should be to invoke clang again.
- const clang::driver::Command *Cmd =
- cast<clang::driver::Command>(*Jobs.begin());
- if (llvm::StringRef(Cmd->getCreator().getName()) != "clang") {
- Diagnostics->Report(clang::diag::err_fe_expected_clang_command);
- return NULL;
- }
-
- return &Cmd->getArguments();
-}
-
-/// \brief Returns a clang build invocation initialized from the CC1 flags.
-static clang::CompilerInvocation* NewInvocation(
- clang::Diagnostic* Diagnostics,
- const clang::driver::ArgStringList& CC1Args) {
- clang::CompilerInvocation* Invocation = new clang::CompilerInvocation;
- clang::CompilerInvocation::CreateFromArgs(
- *Invocation, CC1Args.data(), CC1Args.data() + CC1Args.size(),
- *Diagnostics);
- Invocation->getFrontendOpts().DisableFree = false;
- return Invocation;
-}
-
-/// \brief Runs the specified clang tool action and returns whether it executed
-/// successfully.
-static bool RunInvocation(const char* BinaryName,
- clang::driver::Compilation* Compilation,
- clang::CompilerInvocation* Invocation,
- const clang::driver::ArgStringList& CC1Args,
- clang::FrontendAction* ToolAction) {
- llvm::OwningPtr<clang::FrontendAction> ScopedToolAction(ToolAction);
- // Show the invocation, with -v.
- if (Invocation->getHeaderSearchOpts().Verbose) {
- llvm::errs() << "clang Invocation:\n";
- Compilation->PrintJob(llvm::errs(), Compilation->getJobs(), "\n", true);
- llvm::errs() << "\n";
- }
-
- // Create a compiler instance to handle the actual work.
- clang::CompilerInstance Compiler;
- Compiler.setInvocation(Invocation);
-
- // Create the compilers actual diagnostics engine.
- Compiler.createDiagnostics(CC1Args.size(),
- const_cast<char**>(CC1Args.data()));
- if (!Compiler.hasDiagnostics())
- return false;
-
- // Infer the builtin include path if unspecified.
- if (Compiler.getHeaderSearchOpts().UseBuiltinIncludes &&
- Compiler.getHeaderSearchOpts().ResourceDir.empty()) {
- // This just needs to be some symbol in the binary.
- void* const SymbolAddr = &StaticSymbol;
- Compiler.getHeaderSearchOpts().ResourceDir =
- clang::CompilerInvocation::GetResourcesPath(BinaryName, SymbolAddr);
- }
-
- const bool Success = Compiler.ExecuteAction(*ToolAction);
- return Success;
-}
-
-/// \brief Converts a string vector representing a Command line into a C
-/// string vector representing the Argv (including the trailing NULL).
-std::vector<char*> CommandLineToArgv(const std::vector<std::string>* Command) {
- std::vector<char*> Result(Command->size() + 1);
- for (std::vector<char*>::size_type I = 0; I < Command->size(); ++I) {
- Result[I] = const_cast<char*>((*Command)[I].c_str());
- }
- Result[Command->size()] = NULL;
- return Result;
-}
-
-bool RunToolWithFlags(
- clang::FrontendAction* ToolAction, int Args, char* Argv[]) {
- ValidateArgv(Args, Argv);
- const llvm::OwningPtr<clang::Diagnostic> Diagnostics(NewTextDiagnostics());
- const llvm::OwningPtr<clang::driver::Driver> Driver(
- NewDriver(Diagnostics.get(), Argv[0]));
- const llvm::OwningPtr<clang::driver::Compilation> Compilation(
- Driver->BuildCompilation(llvm::ArrayRef<const char*>(Argv, Args)));
- const clang::driver::ArgStringList* const CC1Args = GetCC1Arguments(
- Diagnostics.get(), Compilation.get());
- if (CC1Args == NULL) {
- return false;
- }
- llvm::OwningPtr<clang::CompilerInvocation> Invocation(
- NewInvocation(Diagnostics.get(), *CC1Args));
- return RunInvocation(Argv[0], Compilation.get(), Invocation.take(),
- *CC1Args, ToolAction);
-}
-
-/// \brief Runs 'ToolAction' on the code specified by 'FileContents'.
-///
-/// \param FileContents A mapping from file name to source code. For each
-/// entry a virtual file mapping will be created when running the tool.
-bool RunToolWithFlagsOnCode(
- const std::vector<std::string>& CommandLine,
- const std::map<std::string, std::string>& FileContents,
- clang::FrontendAction* ToolAction) {
- const std::vector<char*> Argv = CommandLineToArgv(&CommandLine);
- const char* const BinaryName = Argv[0];
-
- const llvm::OwningPtr<clang::Diagnostic> Diagnostics(NewTextDiagnostics());
- const llvm::OwningPtr<clang::driver::Driver> Driver(
- NewDriver(Diagnostics.get(), BinaryName));
-
- // Since the Input is only virtual, don't check whether it exists.
- Driver->setCheckInputsExist(false);
-
- const llvm::OwningPtr<clang::driver::Compilation> Compilation(
- Driver->BuildCompilation(llvm::ArrayRef<const char*>(&Argv[0],
- Argv.size() - 1)));
- const clang::driver::ArgStringList* const CC1Args = GetCC1Arguments(
- Diagnostics.get(), Compilation.get());
- if (CC1Args == NULL) {
- return false;
- }
- llvm::OwningPtr<clang::CompilerInvocation> Invocation(
- NewInvocation(Diagnostics.get(), *CC1Args));
-
- for (std::map<std::string, std::string>::const_iterator
- It = FileContents.begin(), End = FileContents.end();
- It != End; ++It) {
- // Inject the code as the given file name into the preprocessor options.
- const llvm::MemoryBuffer* Input =
- llvm::MemoryBuffer::getMemBuffer(It->second.c_str());
- Invocation->getPreprocessorOpts().addRemappedFile(It->first.c_str(), Input);
- }
-
- return RunInvocation(BinaryName, Compilation.get(),
- Invocation.take(), *CC1Args, ToolAction);
-}
-
-bool RunSyntaxOnlyToolOnCode(
- clang::FrontendAction *ToolAction, llvm::StringRef Code) {
- const char* const FileName = "input.cc";
- const char* const CommandLine[] = {
- "clang-tool", "-fsyntax-only", FileName
- };
- std::map<std::string, std::string> FileContents;
- FileContents[FileName] = Code;
- return RunToolWithFlagsOnCode(
- std::vector<std::string>(
- CommandLine,
- CommandLine + sizeof(CommandLine)/sizeof(CommandLine[0])),
- FileContents, ToolAction);
-}
-
-namespace {
-
-// A CompileCommandHandler implementation that finds compile commands for a
-// specific input file.
-//
-// FIXME: Implement early exit when JsonCompileCommandLineParser supports it.
-class FindHandler : public clang::tooling::CompileCommandHandler {
- public:
- explicit FindHandler(llvm::StringRef File)
- : FileToMatch(File), FoundMatchingCommand(false) {}
-
- virtual void EndTranslationUnits() {
- if (!FoundMatchingCommand && ErrorMessage.empty()) {
- ErrorMessage = "ERROR: No matching command found.";
- }
- }
-
- virtual void EndTranslationUnit() {
- if (File == FileToMatch) {
- FoundMatchingCommand = true;
- MatchingCommand.Directory = Directory;
- MatchingCommand.CommandLine = UnescapeJsonCommandLine(Command);
- }
- }
-
- virtual void HandleKeyValue(llvm::StringRef Key, llvm::StringRef Value) {
- if (Key == "directory") { Directory = Value; }
- else if (Key == "file") { File = Value; }
- else if (Key == "command") { Command = Value; }
- else {
- ErrorMessage = (llvm::Twine("Unknown key: \"") + Key + "\"").str();
- }
- }
-
- const llvm::StringRef FileToMatch;
- bool FoundMatchingCommand;
- CompileCommand MatchingCommand;
- std::string ErrorMessage;
-
- llvm::StringRef Directory;
- llvm::StringRef File;
- llvm::StringRef Command;
-};
-
-} // end namespace
-
-CompileCommand FindCompileArgsInJsonDatabase(
- llvm::StringRef FileName, llvm::StringRef JsonDatabase,
- std::string &ErrorMessage) {
- FindHandler find_handler(FileName);
- JsonCompileCommandLineParser parser(JsonDatabase, &find_handler);
- if (!parser.Parse()) {
- ErrorMessage = parser.GetErrorMessage();
- return CompileCommand();
- }
- return find_handler.MatchingCommand;
-}
-
-} // end namespace tooling
-} // end namespace clang
-
diff --git a/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp b/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp
index ec6ce65..f449235 100644
--- a/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp
+++ b/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp
@@ -172,6 +172,8 @@ void AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
}
}
Opts.LLVMArgs = Args->getAllArgValues(OPT_mllvm);
+ if (Args->hasArg(OPT_fatal_warnings))
+ Opts.LLVMArgs.push_back("-fatal-assembler-warnings");
Opts.OutputPath = Args->getLastArgValue(OPT_o);
if (Arg *A = Args->getLastArg(OPT_filetype)) {
StringRef Name = A->getValue(*Args);
diff --git a/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 1d14037..bbe4349 100644
--- a/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -2321,7 +2321,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
OS << " for (unsigned i = 0; i != " << MaxNumOperands << "; ++i) {\n";
OS << " if (i + 1 >= Operands.size()) {\n";
OS << " OperandsValid = (it->Classes[i] == " <<"InvalidMatchClass);\n";
- OS << " break;";
+ OS << " break;\n";
OS << " }\n";
OS << " if (ValidateOperandClass(Operands[i+1], it->Classes[i]))\n";
OS << " continue;\n";
diff --git a/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp b/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp
index 2b1a4cc..e6deb69 100644
--- a/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp
@@ -670,8 +670,8 @@ public:
for (std::map<StringRef, unsigned>::iterator
I = OpMap.begin(), E = OpMap.end(); I != E; ++I)
- O.indent(6) << "OpMap[\"" << I->first << "\"] = "
- << I->second << ";\n";
+ O.indent(6) << "OpMap.push_back(std::make_pair(\"" << I->first << "\", "
+ << I->second << "));\n";
O.indent(6) << "break;\n";
O.indent(4) << '}';
@@ -754,6 +754,20 @@ static void EmitComputeAvailableFeatures(AsmWriterInfo &Info,
O << "}\n\n";
}
+static void EmitGetMapOperandNumber(raw_ostream &O) {
+ O << "static unsigned getMapOperandNumber("
+ << "const SmallVectorImpl<std::pair<StringRef, unsigned> > &OpMap,\n";
+ O << " StringRef Name) {\n";
+ O << " for (SmallVectorImpl<std::pair<StringRef, unsigned> >::"
+ << "const_iterator\n";
+ O << " I = OpMap.begin(), E = OpMap.end(); I != E; ++I)\n";
+ O << " if (I->first == Name)\n";
+ O << " return I->second;\n";
+ O << " assert(false && \"Operand not in map!\");\n";
+ O << " return 0;\n";
+ O << "}\n\n";
+}
+
void AsmWriterEmitter::EmitRegIsInRegClass(raw_ostream &O) {
CodeGenTarget Target(Records);
@@ -934,9 +948,12 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
EmitSubtargetFeatureFlagEnumeration(AWI, O);
EmitComputeAvailableFeatures(AWI, AsmWriter, Target, O);
- O << "bool " << Target.getName() << ClassName
- << "::printAliasInstr(const " << MachineInstrClassName
- << " *MI, raw_ostream &OS) {\n";
+ std::string Header;
+ raw_string_ostream HeaderO(Header);
+
+ HeaderO << "bool " << Target.getName() << ClassName
+ << "::printAliasInstr(const " << MachineInstrClassName
+ << " *MI, raw_ostream &OS) {\n";
std::string Cases;
raw_string_ostream CasesO(Cases);
@@ -979,14 +996,18 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
}
if (CasesO.str().empty() || !isMC) {
+ O << HeaderO.str();
O << " return false;\n";
O << "}\n\n";
O << "#endif // PRINT_ALIAS_INSTR\n";
return;
}
+ EmitGetMapOperandNumber(O);
+
+ O << HeaderO.str();
O.indent(2) << "StringRef AsmString;\n";
- O.indent(2) << "std::map<StringRef, unsigned> OpMap;\n";
+ O.indent(2) << "SmallVector<std::pair<StringRef, unsigned>, 4> OpMap;\n";
if (NeedAvailableFeatures)
O.indent(2) << "unsigned AvailableFeatures = getAvailableFeatures();\n\n";
O.indent(2) << "switch (MI->getOpcode()) {\n";
@@ -1012,7 +1033,7 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
O << " *I == '_'))\n";
O << " ++I;\n";
O << " StringRef Name(Start, I - Start);\n";
- O << " printOperand(MI, OpMap[Name], OS);\n";
+ O << " printOperand(MI, getMapOperandNumber(OpMap, Name), OS);\n";
O << " } else {\n";
O << " OS << *I++;\n";
O << " }\n";
diff --git a/contrib/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp b/contrib/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp
index 0f4b606..acaa1f8 100644
--- a/contrib/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp
@@ -162,7 +162,7 @@ void ClangDiagsDefsEmitter::run(raw_ostream &OS) {
OS << ", \"";
OS.write_escaped(DI->getDef()->getValueAsString("GroupName")) << '"';
} else {
- OS << ", 0";
+ OS << ", \"\"";
}
// SFINAE bit
@@ -275,7 +275,9 @@ void ClangDiagGroupsEmitter::run(raw_ostream &OS) {
for (std::map<std::string, GroupInfo>::iterator
I = DiagsInGroup.begin(), E = DiagsInGroup.end(); I != E; ++I) {
// Group option string.
- OS << " { \"";
+ OS << " { ";
+ OS << I->first.size() << ", ";
+ OS << "\"";
OS.write_escaped(I->first) << "\","
<< std::string(MaxLen-I->first.size()+1, ' ');
diff --git a/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h b/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h
index 3208c0d..3f6ba61 100644
--- a/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h
+++ b/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h
@@ -69,6 +69,9 @@ namespace llvm {
/// isCommutative - True if the intrinsic is commutative.
bool isCommutative;
+
+ /// canThrow - True if the intrinsic can throw.
+ bool canThrow;
enum ArgAttribute {
NoCapture
diff --git a/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp b/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp
new file mode 100644
index 0000000..a4504e4
--- /dev/null
+++ b/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp
@@ -0,0 +1,312 @@
+//===- CodeGenRegisters.cpp - Register and RegisterClass Info -------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines structures to encapsulate information gleaned from the
+// target register and register class definitions.
+//
+//===----------------------------------------------------------------------===//
+
+#include "CodeGenRegisters.h"
+#include "CodeGenTarget.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringExtras.h"
+
+using namespace llvm;
+
+//===----------------------------------------------------------------------===//
+// CodeGenRegister
+//===----------------------------------------------------------------------===//
+
+CodeGenRegister::CodeGenRegister(Record *R, unsigned Enum)
+ : TheDef(R),
+ EnumValue(Enum),
+ CostPerUse(R->getValueAsInt("CostPerUse")),
+ SubRegsComplete(false)
+{}
+
+const std::string &CodeGenRegister::getName() const {
+ return TheDef->getName();
+}
+
+namespace {
+ struct Orphan {
+ CodeGenRegister *SubReg;
+ Record *First, *Second;
+ Orphan(CodeGenRegister *r, Record *a, Record *b)
+ : SubReg(r), First(a), Second(b) {}
+ };
+}
+
+const CodeGenRegister::SubRegMap &
+CodeGenRegister::getSubRegs(CodeGenRegBank &RegBank) {
+ // Only compute this map once.
+ if (SubRegsComplete)
+ return SubRegs;
+ SubRegsComplete = true;
+
+ std::vector<Record*> SubList = TheDef->getValueAsListOfDefs("SubRegs");
+ std::vector<Record*> Indices = TheDef->getValueAsListOfDefs("SubRegIndices");
+ if (SubList.size() != Indices.size())
+ throw TGError(TheDef->getLoc(), "Register " + getName() +
+ " SubRegIndices doesn't match SubRegs");
+
+ // First insert the direct subregs and make sure they are fully indexed.
+ for (unsigned i = 0, e = SubList.size(); i != e; ++i) {
+ CodeGenRegister *SR = RegBank.getReg(SubList[i]);
+ if (!SubRegs.insert(std::make_pair(Indices[i], SR)).second)
+ throw TGError(TheDef->getLoc(), "SubRegIndex " + Indices[i]->getName() +
+ " appears twice in Register " + getName());
+ }
+
+ // Keep track of inherited subregs and how they can be reached.
+ SmallVector<Orphan, 8> Orphans;
+
+ // Clone inherited subregs and place duplicate entries on Orphans.
+ // Here the order is important - earlier subregs take precedence.
+ for (unsigned i = 0, e = SubList.size(); i != e; ++i) {
+ CodeGenRegister *SR = RegBank.getReg(SubList[i]);
+ const SubRegMap &Map = SR->getSubRegs(RegBank);
+ for (SubRegMap::const_iterator SI = Map.begin(), SE = Map.end(); SI != SE;
+ ++SI)
+ if (!SubRegs.insert(*SI).second)
+ Orphans.push_back(Orphan(SI->second, Indices[i], SI->first));
+ }
+
+ // Process the composites.
+ ListInit *Comps = TheDef->getValueAsListInit("CompositeIndices");
+ for (unsigned i = 0, e = Comps->size(); i != e; ++i) {
+ DagInit *Pat = dynamic_cast<DagInit*>(Comps->getElement(i));
+ if (!Pat)
+ throw TGError(TheDef->getLoc(), "Invalid dag '" +
+ Comps->getElement(i)->getAsString() +
+ "' in CompositeIndices");
+ DefInit *BaseIdxInit = dynamic_cast<DefInit*>(Pat->getOperator());
+ if (!BaseIdxInit || !BaseIdxInit->getDef()->isSubClassOf("SubRegIndex"))
+ throw TGError(TheDef->getLoc(), "Invalid SubClassIndex in " +
+ Pat->getAsString());
+
+ // Resolve list of subreg indices into R2.
+ CodeGenRegister *R2 = this;
+ for (DagInit::const_arg_iterator di = Pat->arg_begin(),
+ de = Pat->arg_end(); di != de; ++di) {
+ DefInit *IdxInit = dynamic_cast<DefInit*>(*di);
+ if (!IdxInit || !IdxInit->getDef()->isSubClassOf("SubRegIndex"))
+ throw TGError(TheDef->getLoc(), "Invalid SubClassIndex in " +
+ Pat->getAsString());
+ const SubRegMap &R2Subs = R2->getSubRegs(RegBank);
+ SubRegMap::const_iterator ni = R2Subs.find(IdxInit->getDef());
+ if (ni == R2Subs.end())
+ throw TGError(TheDef->getLoc(), "Composite " + Pat->getAsString() +
+ " refers to bad index in " + R2->getName());
+ R2 = ni->second;
+ }
+
+ // Insert composite index. Allow overriding inherited indices etc.
+ SubRegs[BaseIdxInit->getDef()] = R2;
+
+ // R2 is no longer an orphan.
+ for (unsigned j = 0, je = Orphans.size(); j != je; ++j)
+ if (Orphans[j].SubReg == R2)
+ Orphans[j].SubReg = 0;
+ }
+
+ // Now Orphans contains the inherited subregisters without a direct index.
+ // Create inferred indexes for all missing entries.
+ for (unsigned i = 0, e = Orphans.size(); i != e; ++i) {
+ Orphan &O = Orphans[i];
+ if (!O.SubReg)
+ continue;
+ SubRegs[RegBank.getCompositeSubRegIndex(O.First, O.Second, true)] =
+ O.SubReg;
+ }
+ return SubRegs;
+}
+
+//===----------------------------------------------------------------------===//
+// CodeGenRegisterClass
+//===----------------------------------------------------------------------===//
+
+CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
+ // Rename anonymous register classes.
+ if (R->getName().size() > 9 && R->getName()[9] == '.') {
+ static unsigned AnonCounter = 0;
+ R->setName("AnonRegClass_"+utostr(AnonCounter++));
+ }
+
+ std::vector<Record*> TypeList = R->getValueAsListOfDefs("RegTypes");
+ for (unsigned i = 0, e = TypeList.size(); i != e; ++i) {
+ Record *Type = TypeList[i];
+ if (!Type->isSubClassOf("ValueType"))
+ throw "RegTypes list member '" + Type->getName() +
+ "' does not derive from the ValueType class!";
+ VTs.push_back(getValueType(Type));
+ }
+ assert(!VTs.empty() && "RegisterClass must contain at least one ValueType!");
+
+ std::vector<Record*> RegList = R->getValueAsListOfDefs("MemberList");
+ for (unsigned i = 0, e = RegList.size(); i != e; ++i) {
+ Record *Reg = RegList[i];
+ if (!Reg->isSubClassOf("Register"))
+ throw "Register Class member '" + Reg->getName() +
+ "' does not derive from the Register class!";
+ Elements.push_back(Reg);
+ }
+
+ // SubRegClasses is a list<dag> containing (RC, subregindex, ...) dags.
+ ListInit *SRC = R->getValueAsListInit("SubRegClasses");
+ for (ListInit::const_iterator i = SRC->begin(), e = SRC->end(); i != e; ++i) {
+ DagInit *DAG = dynamic_cast<DagInit*>(*i);
+ if (!DAG) throw "SubRegClasses must contain DAGs";
+ DefInit *DAGOp = dynamic_cast<DefInit*>(DAG->getOperator());
+ Record *RCRec;
+ if (!DAGOp || !(RCRec = DAGOp->getDef())->isSubClassOf("RegisterClass"))
+ throw "Operator '" + DAG->getOperator()->getAsString() +
+ "' in SubRegClasses is not a RegisterClass";
+ // Iterate over args, all SubRegIndex instances.
+ for (DagInit::const_arg_iterator ai = DAG->arg_begin(), ae = DAG->arg_end();
+ ai != ae; ++ai) {
+ DefInit *Idx = dynamic_cast<DefInit*>(*ai);
+ Record *IdxRec;
+ if (!Idx || !(IdxRec = Idx->getDef())->isSubClassOf("SubRegIndex"))
+ throw "Argument '" + (*ai)->getAsString() +
+ "' in SubRegClasses is not a SubRegIndex";
+ if (!SubRegClasses.insert(std::make_pair(IdxRec, RCRec)).second)
+ throw "SubRegIndex '" + IdxRec->getName() + "' mentioned twice";
+ }
+ }
+
+ // Allow targets to override the size in bits of the RegisterClass.
+ unsigned Size = R->getValueAsInt("Size");
+
+ Namespace = R->getValueAsString("Namespace");
+ SpillSize = Size ? Size : EVT(VTs[0]).getSizeInBits();
+ SpillAlignment = R->getValueAsInt("Alignment");
+ CopyCost = R->getValueAsInt("CopyCost");
+ Allocatable = R->getValueAsBit("isAllocatable");
+ MethodBodies = R->getValueAsCode("MethodBodies");
+ MethodProtos = R->getValueAsCode("MethodProtos");
+}
+
+const std::string &CodeGenRegisterClass::getName() const {
+ return TheDef->getName();
+}
+
+//===----------------------------------------------------------------------===//
+// CodeGenRegBank
+//===----------------------------------------------------------------------===//
+
+CodeGenRegBank::CodeGenRegBank(RecordKeeper &Records) : Records(Records) {
+ // Read in the user-defined (named) sub-register indices.
+ // More indices will be synthesized later.
+ SubRegIndices = Records.getAllDerivedDefinitions("SubRegIndex");
+ std::sort(SubRegIndices.begin(), SubRegIndices.end(), LessRecord());
+ NumNamedIndices = SubRegIndices.size();
+
+ // Read in the register definitions.
+ std::vector<Record*> Regs = Records.getAllDerivedDefinitions("Register");
+ std::sort(Regs.begin(), Regs.end(), LessRecord());
+ Registers.reserve(Regs.size());
+ // Assign the enumeration values.
+ for (unsigned i = 0, e = Regs.size(); i != e; ++i)
+ Registers.push_back(CodeGenRegister(Regs[i], i + 1));
+}
+
+CodeGenRegister *CodeGenRegBank::getReg(Record *Def) {
+ if (Def2Reg.empty())
+ for (unsigned i = 0, e = Registers.size(); i != e; ++i)
+ Def2Reg[Registers[i].TheDef] = &Registers[i];
+
+ if (CodeGenRegister *Reg = Def2Reg[Def])
+ return Reg;
+
+ throw TGError(Def->getLoc(), "Not a known Register!");
+}
+
+Record *CodeGenRegBank::getCompositeSubRegIndex(Record *A, Record *B,
+ bool create) {
+ // Look for an existing entry.
+ Record *&Comp = Composite[std::make_pair(A, B)];
+ if (Comp || !create)
+ return Comp;
+
+ // None exists, synthesize one.
+ std::string Name = A->getName() + "_then_" + B->getName();
+ Comp = new Record(Name, SMLoc(), Records);
+ Records.addDef(Comp);
+ SubRegIndices.push_back(Comp);
+ return Comp;
+}
+
+unsigned CodeGenRegBank::getSubRegIndexNo(Record *idx) {
+ std::vector<Record*>::const_iterator i =
+ std::find(SubRegIndices.begin(), SubRegIndices.end(), idx);
+ assert(i != SubRegIndices.end() && "Not a SubRegIndex");
+ return (i - SubRegIndices.begin()) + 1;
+}
+
+void CodeGenRegBank::computeComposites() {
+ // Precompute all sub-register maps. This will create Composite entries for
+ // all inferred sub-register indices.
+ for (unsigned i = 0, e = Registers.size(); i != e; ++i)
+ Registers[i].getSubRegs(*this);
+
+ for (unsigned i = 0, e = Registers.size(); i != e; ++i) {
+ CodeGenRegister *Reg1 = &Registers[i];
+ const CodeGenRegister::SubRegMap &SRM1 = Reg1->getSubRegs(*this);
+ for (CodeGenRegister::SubRegMap::const_iterator i1 = SRM1.begin(),
+ e1 = SRM1.end(); i1 != e1; ++i1) {
+ Record *Idx1 = i1->first;
+ CodeGenRegister *Reg2 = i1->second;
+ // Ignore identity compositions.
+ if (Reg1 == Reg2)
+ continue;
+ const CodeGenRegister::SubRegMap &SRM2 = Reg2->getSubRegs(*this);
+ // Try composing Idx1 with another SubRegIndex.
+ for (CodeGenRegister::SubRegMap::const_iterator i2 = SRM2.begin(),
+ e2 = SRM2.end(); i2 != e2; ++i2) {
+ std::pair<Record*, Record*> IdxPair(Idx1, i2->first);
+ CodeGenRegister *Reg3 = i2->second;
+ // Ignore identity compositions.
+ if (Reg2 == Reg3)
+ continue;
+ // OK Reg1:IdxPair == Reg3. Find the index with Reg:Idx == Reg3.
+ for (CodeGenRegister::SubRegMap::const_iterator i1d = SRM1.begin(),
+ e1d = SRM1.end(); i1d != e1d; ++i1d) {
+ if (i1d->second == Reg3) {
+ std::pair<CompositeMap::iterator, bool> Ins =
+ Composite.insert(std::make_pair(IdxPair, i1d->first));
+ // Conflicting composition? Emit a warning but allow it.
+ if (!Ins.second && Ins.first->second != i1d->first) {
+ errs() << "Warning: SubRegIndex " << getQualifiedName(Idx1)
+ << " and " << getQualifiedName(IdxPair.second)
+ << " compose ambiguously as "
+ << getQualifiedName(Ins.first->second) << " or "
+ << getQualifiedName(i1d->first) << "\n";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // We don't care about the difference between (Idx1, Idx2) -> Idx2 and invalid
+ // compositions, so remove any mappings of that form.
+ for (CompositeMap::iterator i = Composite.begin(), e = Composite.end();
+ i != e;) {
+ CompositeMap::iterator j = i;
+ ++i;
+ if (j->first.second == j->second)
+ Composite.erase(j);
+ }
+}
+
+void CodeGenRegBank::computeDerivedInfo() {
+ computeComposites();
+}
+
diff --git a/contrib/llvm/utils/TableGen/CodeGenRegisters.h b/contrib/llvm/utils/TableGen/CodeGenRegisters.h
index 39b92c5..09341f0 100644
--- a/contrib/llvm/utils/TableGen/CodeGenRegisters.h
+++ b/contrib/llvm/utils/TableGen/CodeGenRegisters.h
@@ -15,23 +15,43 @@
#ifndef CODEGEN_REGISTERS_H
#define CODEGEN_REGISTERS_H
+#include "Record.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/ADT/DenseMap.h"
+#include <cstdlib>
+#include <map>
#include <string>
-#include <vector>
#include <set>
-#include <cstdlib>
+#include <vector>
namespace llvm {
- class Record;
+ class CodeGenRegBank;
/// CodeGenRegister - Represents a register definition.
struct CodeGenRegister {
Record *TheDef;
- const std::string &getName() const;
unsigned EnumValue;
unsigned CostPerUse;
- CodeGenRegister(Record *R);
+
+ // Map SubRegIndex -> Register.
+ typedef std::map<Record*, CodeGenRegister*, LessRecord> SubRegMap;
+
+ CodeGenRegister(Record *R, unsigned Enum);
+
+ const std::string &getName() const;
+
+ // Get a map of sub-registers computed lazily.
+ // This includes unique entries for all sub-sub-registers.
+ const SubRegMap &getSubRegs(CodeGenRegBank&);
+
+ const SubRegMap &getSubRegs() const {
+ assert(SubRegsComplete && "Must precompute sub-registers");
+ return SubRegs;
+ }
+
+ private:
+ bool SubRegsComplete;
+ SubRegMap SubRegs;
};
@@ -43,6 +63,7 @@ namespace llvm {
unsigned SpillSize;
unsigned SpillAlignment;
int CopyCost;
+ bool Allocatable;
// Map SubRegIndex -> RegisterClass
DenseMap<Record*,Record*> SubRegClasses;
std::string MethodProtos, MethodBodies;
@@ -97,6 +118,47 @@ namespace llvm {
CodeGenRegisterClass(Record *R);
};
+
+ // CodeGenRegBank - Represent a target's registers and the relations between
+ // them.
+ class CodeGenRegBank {
+ RecordKeeper &Records;
+ std::vector<Record*> SubRegIndices;
+ unsigned NumNamedIndices;
+ std::vector<CodeGenRegister> Registers;
+ DenseMap<Record*, CodeGenRegister*> Def2Reg;
+
+ // Composite SubRegIndex instances.
+ // Map (SubRegIndex, SubRegIndex) -> SubRegIndex.
+ typedef DenseMap<std::pair<Record*, Record*>, Record*> CompositeMap;
+ CompositeMap Composite;
+
+ // Populate the Composite map from sub-register relationships.
+ void computeComposites();
+
+ public:
+ CodeGenRegBank(RecordKeeper&);
+
+ // Sub-register indices. The first NumNamedIndices are defined by the user
+ // in the .td files. The rest are synthesized such that all sub-registers
+ // have a unique name.
+ const std::vector<Record*> &getSubRegIndices() { return SubRegIndices; }
+ unsigned getNumNamedIndices() { return NumNamedIndices; }
+
+ // Map a SubRegIndex Record to its enum value.
+ unsigned getSubRegIndexNo(Record *idx);
+
+ // Find or create a sub-register index representing the A+B composition.
+ Record *getCompositeSubRegIndex(Record *A, Record *B, bool create = false);
+
+ const std::vector<CodeGenRegister> &getRegisters() { return Registers; }
+
+ // Find a register from its Record def.
+ CodeGenRegister *getReg(Record*);
+
+ // Computed derived records such as missing sub-register indices.
+ void computeDerivedInfo();
+ };
}
#endif
diff --git a/contrib/llvm/utils/TableGen/CodeGenTarget.cpp b/contrib/llvm/utils/TableGen/CodeGenTarget.cpp
index 57f7fdc..a0c64ff 100644
--- a/contrib/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/contrib/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -98,17 +98,18 @@ std::string llvm::getEnumName(MVT::SimpleValueType T) {
/// namespace qualifier if the record contains one.
///
std::string llvm::getQualifiedName(const Record *R) {
- std::string Namespace = R->getValueAsString("Namespace");
+ std::string Namespace;
+ if (R->getValue("Namespace"))
+ Namespace = R->getValueAsString("Namespace");
if (Namespace.empty()) return R->getName();
return Namespace + "::" + R->getName();
}
-
-
/// getTarget - Return the current instance of the Target class.
///
-CodeGenTarget::CodeGenTarget(RecordKeeper &records) : Records(records) {
+CodeGenTarget::CodeGenTarget(RecordKeeper &records)
+ : Records(records), RegBank(0) {
std::vector<Record*> Targets = Records.getAllDerivedDefinitions("Target");
if (Targets.size() == 0)
throw std::string("ERROR: No 'Target' subclasses defined!");
@@ -156,30 +157,10 @@ Record *CodeGenTarget::getAsmWriter() const {
return LI[AsmWriterNum];
}
-void CodeGenTarget::ReadRegisters() const {
- std::vector<Record*> Regs = Records.getAllDerivedDefinitions("Register");
- if (Regs.empty())
- throw std::string("No 'Register' subclasses defined!");
- std::sort(Regs.begin(), Regs.end(), LessRecord());
-
- Registers.reserve(Regs.size());
- Registers.assign(Regs.begin(), Regs.end());
- // Assign the enumeration values.
- for (unsigned i = 0, e = Registers.size(); i != e; ++i)
- Registers[i].EnumValue = i + 1;
-}
-
-CodeGenRegister::CodeGenRegister(Record *R) : TheDef(R) {
- CostPerUse = R->getValueAsInt("CostPerUse");
-}
-
-const std::string &CodeGenRegister::getName() const {
- return TheDef->getName();
-}
-
-void CodeGenTarget::ReadSubRegIndices() const {
- SubRegIndices = Records.getAllDerivedDefinitions("SubRegIndex");
- std::sort(SubRegIndices.begin(), SubRegIndices.end(), LessRecord());
+CodeGenRegBank &CodeGenTarget::getRegBank() const {
+ if (!RegBank)
+ RegBank = new CodeGenRegBank(Records);
+ return *RegBank;
}
void CodeGenTarget::ReadRegisterClasses() const {
@@ -195,7 +176,7 @@ void CodeGenTarget::ReadRegisterClasses() const {
/// getRegisterByName - If there is a register with the specific AsmName,
/// return it.
const CodeGenRegister *CodeGenTarget::getRegisterByName(StringRef Name) const {
- const std::vector<CodeGenRegister> &Regs = getRegisters();
+ const std::vector<CodeGenRegister> &Regs = getRegBank().getRegisters();
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
const CodeGenRegister &Reg = Regs[i];
if (Reg.TheDef->getValueAsString("AsmName") == Name)
@@ -226,70 +207,6 @@ getRegisterVTs(Record *R) const {
}
-CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
- // Rename anonymous register classes.
- if (R->getName().size() > 9 && R->getName()[9] == '.') {
- static unsigned AnonCounter = 0;
- R->setName("AnonRegClass_"+utostr(AnonCounter++));
- }
-
- std::vector<Record*> TypeList = R->getValueAsListOfDefs("RegTypes");
- for (unsigned i = 0, e = TypeList.size(); i != e; ++i) {
- Record *Type = TypeList[i];
- if (!Type->isSubClassOf("ValueType"))
- throw "RegTypes list member '" + Type->getName() +
- "' does not derive from the ValueType class!";
- VTs.push_back(getValueType(Type));
- }
- assert(!VTs.empty() && "RegisterClass must contain at least one ValueType!");
-
- std::vector<Record*> RegList = R->getValueAsListOfDefs("MemberList");
- for (unsigned i = 0, e = RegList.size(); i != e; ++i) {
- Record *Reg = RegList[i];
- if (!Reg->isSubClassOf("Register"))
- throw "Register Class member '" + Reg->getName() +
- "' does not derive from the Register class!";
- Elements.push_back(Reg);
- }
-
- // SubRegClasses is a list<dag> containing (RC, subregindex, ...) dags.
- ListInit *SRC = R->getValueAsListInit("SubRegClasses");
- for (ListInit::const_iterator i = SRC->begin(), e = SRC->end(); i != e; ++i) {
- DagInit *DAG = dynamic_cast<DagInit*>(*i);
- if (!DAG) throw "SubRegClasses must contain DAGs";
- DefInit *DAGOp = dynamic_cast<DefInit*>(DAG->getOperator());
- Record *RCRec;
- if (!DAGOp || !(RCRec = DAGOp->getDef())->isSubClassOf("RegisterClass"))
- throw "Operator '" + DAG->getOperator()->getAsString() +
- "' in SubRegClasses is not a RegisterClass";
- // Iterate over args, all SubRegIndex instances.
- for (DagInit::const_arg_iterator ai = DAG->arg_begin(), ae = DAG->arg_end();
- ai != ae; ++ai) {
- DefInit *Idx = dynamic_cast<DefInit*>(*ai);
- Record *IdxRec;
- if (!Idx || !(IdxRec = Idx->getDef())->isSubClassOf("SubRegIndex"))
- throw "Argument '" + (*ai)->getAsString() +
- "' in SubRegClasses is not a SubRegIndex";
- if (!SubRegClasses.insert(std::make_pair(IdxRec, RCRec)).second)
- throw "SubRegIndex '" + IdxRec->getName() + "' mentioned twice";
- }
- }
-
- // Allow targets to override the size in bits of the RegisterClass.
- unsigned Size = R->getValueAsInt("Size");
-
- Namespace = R->getValueAsString("Namespace");
- SpillSize = Size ? Size : EVT(VTs[0]).getSizeInBits();
- SpillAlignment = R->getValueAsInt("Alignment");
- CopyCost = R->getValueAsInt("CopyCost");
- MethodBodies = R->getValueAsCode("MethodBodies");
- MethodProtos = R->getValueAsCode("MethodProtos");
-}
-
-const std::string &CodeGenRegisterClass::getName() const {
- return TheDef->getName();
-}
-
void CodeGenTarget::ReadLegalValueTypes() const {
const std::vector<CodeGenRegisterClass> &RCs = getRegisterClasses();
for (unsigned i = 0, e = RCs.size(); i != e; ++i)
@@ -453,6 +370,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
ModRef = ReadWriteMem;
isOverloaded = false;
isCommutative = false;
+ canThrow = false;
if (DefName.size() <= 4 ||
std::string(DefName.begin(), DefName.begin() + 4) != "int_")
@@ -575,10 +493,15 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
ModRef = ReadWriteArgMem;
else if (Property->getName() == "Commutative")
isCommutative = true;
+ else if (Property->getName() == "Throws")
+ canThrow = true;
else if (Property->isSubClassOf("NoCapture")) {
unsigned ArgNo = Property->getValueAsInt("ArgNo");
ArgumentAttributes.push_back(std::make_pair(ArgNo, NoCapture));
} else
assert(0 && "Unknown property!");
}
+
+ // Sort the argument attributes for later benefit.
+ std::sort(ArgumentAttributes.begin(), ArgumentAttributes.end());
}
diff --git a/contrib/llvm/utils/TableGen/CodeGenTarget.h b/contrib/llvm/utils/TableGen/CodeGenTarget.h
index 4e04154..1f1c34c 100644
--- a/contrib/llvm/utils/TableGen/CodeGenTarget.h
+++ b/contrib/llvm/utils/TableGen/CodeGenTarget.h
@@ -65,12 +65,9 @@ class CodeGenTarget {
Record *TargetRec;
mutable DenseMap<const Record*, CodeGenInstruction*> Instructions;
- mutable std::vector<CodeGenRegister> Registers;
- mutable std::vector<Record*> SubRegIndices;
+ mutable CodeGenRegBank *RegBank;
mutable std::vector<CodeGenRegisterClass> RegisterClasses;
mutable std::vector<MVT::SimpleValueType> LegalValueTypes;
- void ReadRegisters() const;
- void ReadSubRegIndices() const;
void ReadRegisterClasses() const;
void ReadInstructions() const;
void ReadLegalValueTypes() const;
@@ -98,29 +95,17 @@ public:
///
Record *getAsmWriter() const;
+ /// getRegBank - Return the register bank description.
+ CodeGenRegBank &getRegBank() const;
+
const std::vector<CodeGenRegister> &getRegisters() const {
- if (Registers.empty()) ReadRegisters();
- return Registers;
+ return getRegBank().getRegisters();
}
/// getRegisterByName - If there is a register with the specific AsmName,
/// return it.
const CodeGenRegister *getRegisterByName(StringRef Name) const;
- const std::vector<Record*> &getSubRegIndices() const {
- if (SubRegIndices.empty()) ReadSubRegIndices();
- return SubRegIndices;
- }
-
- // Map a SubRegIndex Record to its number.
- unsigned getSubRegIndexNo(Record *idx) const {
- if (SubRegIndices.empty()) ReadSubRegIndices();
- std::vector<Record*>::const_iterator i =
- std::find(SubRegIndices.begin(), SubRegIndices.end(), idx);
- assert(i != SubRegIndices.end() && "Not a SubRegIndex");
- return (i - SubRegIndices.begin()) + 1;
- }
-
const std::vector<CodeGenRegisterClass> &getRegisterClasses() const {
if (RegisterClasses.empty()) ReadRegisterClasses();
return RegisterClasses;
diff --git a/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index 393ac69..402a239 100644
--- a/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp
@@ -646,6 +646,35 @@ GetInstPatternNode(const DAGInstruction &Inst, const TreePatternNode *N) {
return InstPatNode;
}
+static bool
+mayInstNodeLoadOrStore(const TreePatternNode *N,
+ const CodeGenDAGPatterns &CGP) {
+ Record *Op = N->getOperator();
+ const CodeGenTarget &CGT = CGP.getTargetInfo();
+ CodeGenInstruction &II = CGT.getInstruction(Op);
+ return II.mayLoad || II.mayStore;
+}
+
+static unsigned
+numNodesThatMayLoadOrStore(const TreePatternNode *N,
+ const CodeGenDAGPatterns &CGP) {
+ if (N->isLeaf())
+ return 0;
+
+ Record *OpRec = N->getOperator();
+ if (!OpRec->isSubClassOf("Instruction"))
+ return 0;
+
+ unsigned Count = 0;
+ if (mayInstNodeLoadOrStore(N, CGP))
+ ++Count;
+
+ for (unsigned i = 0, e = N->getNumChildren(); i != e; ++i)
+ Count += numNodesThatMayLoadOrStore(N->getChild(i), CGP);
+
+ return Count;
+}
+
void MatcherGen::
EmitResultInstructionAsOperand(const TreePatternNode *N,
SmallVectorImpl<unsigned> &OutputOps) {
@@ -772,21 +801,26 @@ EmitResultInstructionAsOperand(const TreePatternNode *N,
(Pattern.getSrcPattern()->NodeHasProperty(SDNPVariadic, CGP)))
NumFixedArityOperands = Pattern.getSrcPattern()->getNumChildren();
- // If this is the root node and any of the nodes matched nodes in the input
- // pattern have MemRefs in them, have the interpreter collect them and plop
- // them onto this node.
- //
- // FIXME3: This is actively incorrect for result patterns where the root of
- // the pattern is not the memory reference and is also incorrect when the
- // result pattern has multiple memory-referencing instructions. For example,
- // in the X86 backend, this pattern causes the memrefs to get attached to the
- // CVTSS2SDrr instead of the MOVSSrm:
+ // If this is the root node and multiple matched nodes in the input pattern
+ // have MemRefs in them, have the interpreter collect them and plop them onto
+ // this node. If there is just one node with MemRefs, leave them on that node
+ // even if it is not the root.
//
- // def : Pat<(extloadf32 addr:$src),
- // (CVTSS2SDrr (MOVSSrm addr:$src))>;
- //
- bool NodeHasMemRefs =
- isRoot && Pattern.getSrcPattern()->TreeHasProperty(SDNPMemOperand, CGP);
+ // FIXME3: This is actively incorrect for result patterns with multiple
+ // memory-referencing instructions.
+ bool PatternHasMemOperands =
+ Pattern.getSrcPattern()->TreeHasProperty(SDNPMemOperand, CGP);
+
+ bool NodeHasMemRefs = false;
+ if (PatternHasMemOperands) {
+ unsigned NumNodesThatLoadOrStore =
+ numNodesThatMayLoadOrStore(Pattern.getDstPattern(), CGP);
+ bool NodeIsUniqueLoadOrStore = mayInstNodeLoadOrStore(N, CGP) &&
+ NumNodesThatLoadOrStore == 1;
+ NodeHasMemRefs =
+ NodeIsUniqueLoadOrStore || (isRoot && (mayInstNodeLoadOrStore(N, CGP) ||
+ NumNodesThatLoadOrStore != 1));
+ }
assert((!ResultVTs.empty() || TreeHasOutGlue || NodeHasChain) &&
"Node has no result");
diff --git a/contrib/llvm/utils/TableGen/EDEmitter.cpp b/contrib/llvm/utils/TableGen/EDEmitter.cpp
index 5358c0c..daf9617 100644
--- a/contrib/llvm/utils/TableGen/EDEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/EDEmitter.cpp
@@ -596,6 +596,7 @@ static int ARMFlagFromOpName(LiteralConstantEmitter *type,
IMM("t_adrlabel");
IMM("t2adrlabel");
IMM("shift_imm");
+ IMM("ssat_imm");
IMM("neon_vcvt_imm32");
IMM("shr_imm8");
IMM("shr_imm16");
@@ -635,6 +636,7 @@ static int ARMFlagFromOpName(LiteralConstantEmitter *type,
MISC("addrmode6", "kOperandTypeARMAddrMode6"); // R, R, I, I
MISC("am6offset", "kOperandTypeARMAddrMode6Offset"); // R, I, I
MISC("addrmode6dup", "kOperandTypeARMAddrMode6"); // R, R, I, I
+ MISC("addrmode6oneL32", "kOperandTypeARMAddrMode6"); // R, R, I, I
MISC("addrmodepc", "kOperandTypeARMAddrModePC"); // R, I
MISC("addrmode7", "kOperandTypeARMAddrMode7"); // R
MISC("reglist", "kOperandTypeARMRegisterList"); // I, R, ...
diff --git a/contrib/llvm/utils/TableGen/FastISelEmitter.cpp b/contrib/llvm/utils/TableGen/FastISelEmitter.cpp
index 9c11bf6..78ac556 100644
--- a/contrib/llvm/utils/TableGen/FastISelEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/FastISelEmitter.cpp
@@ -19,9 +19,10 @@
#include "FastISelEmitter.h"
#include "Record.h"
-#include "llvm/Support/Debug.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/VectorExtras.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
using namespace llvm;
namespace {
@@ -278,8 +279,7 @@ struct OperandsSignature {
} else if (Operands[i].isFP()) {
OS << "ConstantFP *f" << i;
} else {
- assert("Unknown operand kind!");
- abort();
+ llvm_unreachable("Unknown operand kind!");
}
if (i + 1 != e)
OS << ", ";
@@ -307,8 +307,7 @@ struct OperandsSignature {
OS << "f" << i;
PrintedArg = true;
} else {
- assert("Unknown operand kind!");
- abort();
+ llvm_unreachable("Unknown operand kind!");
}
}
}
@@ -322,8 +321,7 @@ struct OperandsSignature {
} else if (Operands[i].isFP()) {
OS << "f" << i;
} else {
- assert("Unknown operand kind!");
- abort();
+ llvm_unreachable("Unknown operand kind!");
}
if (i + 1 != e)
OS << ", ";
diff --git a/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp b/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp
index 08f6728..39eb3bd 100644
--- a/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp
@@ -465,6 +465,46 @@ void IntrinsicEmitter::EmitGenerator(const std::vector<CodeGenIntrinsic> &Ints,
OS << "#endif\n\n";
}
+namespace {
+ enum ModRefKind {
+ MRK_none,
+ MRK_readonly,
+ MRK_readnone
+ };
+
+ ModRefKind getModRefKind(const CodeGenIntrinsic &intrinsic) {
+ switch (intrinsic.ModRef) {
+ case CodeGenIntrinsic::NoMem:
+ return MRK_readnone;
+ case CodeGenIntrinsic::ReadArgMem:
+ case CodeGenIntrinsic::ReadMem:
+ return MRK_readonly;
+ case CodeGenIntrinsic::ReadWriteArgMem:
+ case CodeGenIntrinsic::ReadWriteMem:
+ return MRK_none;
+ }
+ assert(0 && "bad mod-ref kind");
+ return MRK_none;
+ }
+
+ struct AttributeComparator {
+ bool operator()(const CodeGenIntrinsic *L, const CodeGenIntrinsic *R) const {
+ // Sort throwing intrinsics after non-throwing intrinsics.
+ if (L->canThrow != R->canThrow)
+ return R->canThrow;
+
+ // Try to order by readonly/readnone attribute.
+ ModRefKind LK = getModRefKind(*L);
+ ModRefKind RK = getModRefKind(*R);
+ if (LK != RK) return (LK > RK);
+
+ // Order by argument attributes.
+ // This is reliable because each side is already sorted internally.
+ return (L->ArgumentAttributes < R->ArgumentAttributes);
+ }
+ };
+}
+
/// EmitAttributes - This emits the Intrinsic::getAttributes method.
void IntrinsicEmitter::
EmitAttributes(const std::vector<CodeGenIntrinsic> &Ints, raw_ostream &OS) {
@@ -472,84 +512,96 @@ EmitAttributes(const std::vector<CodeGenIntrinsic> &Ints, raw_ostream &OS) {
OS << "#ifdef GET_INTRINSIC_ATTRIBUTES\n";
if (TargetOnly)
OS << "static AttrListPtr getAttributes(" << TargetPrefix
- << "Intrinsic::ID id) {";
+ << "Intrinsic::ID id) {\n";
else
- OS << "AttrListPtr Intrinsic::getAttributes(ID id) {";
- OS << " // No intrinsic can throw exceptions.\n";
- OS << " Attributes Attr = Attribute::NoUnwind;\n";
- OS << " switch (id) {\n";
- OS << " default: break;\n";
- unsigned MaxArgAttrs = 0;
+ OS << "AttrListPtr Intrinsic::getAttributes(ID id) {\n";
+
+ // Compute the maximum number of attribute arguments.
+ std::vector<const CodeGenIntrinsic*> sortedIntrinsics(Ints.size());
+ unsigned maxArgAttrs = 0;
for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
- MaxArgAttrs =
- std::max(MaxArgAttrs, unsigned(Ints[i].ArgumentAttributes.size()));
- switch (Ints[i].ModRef) {
- default: break;
- case CodeGenIntrinsic::NoMem:
- OS << " case " << TargetPrefix << "Intrinsic::" << Ints[i].EnumName
- << ":\n";
- break;
- }
+ const CodeGenIntrinsic &intrinsic = Ints[i];
+ sortedIntrinsics[i] = &intrinsic;
+ maxArgAttrs =
+ std::max(maxArgAttrs, unsigned(intrinsic.ArgumentAttributes.size()));
}
- OS << " Attr |= Attribute::ReadNone; // These do not access memory.\n";
- OS << " break;\n";
- for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
- switch (Ints[i].ModRef) {
- default: break;
- case CodeGenIntrinsic::ReadArgMem:
- case CodeGenIntrinsic::ReadMem:
- OS << " case " << TargetPrefix << "Intrinsic::" << Ints[i].EnumName
- << ":\n";
- break;
- }
- }
- OS << " Attr |= Attribute::ReadOnly; // These do not write memory.\n";
- OS << " break;\n";
- OS << " }\n";
- OS << " AttributeWithIndex AWI[" << MaxArgAttrs+1 << "];\n";
+
+ // Emit an array of AttributeWithIndex. Most intrinsics will have
+ // at least one entry, for the function itself (index ~1), which is
+ // usually nounwind.
+ OS << " AttributeWithIndex AWI[" << maxArgAttrs+1 << "];\n";
OS << " unsigned NumAttrs = 0;\n";
OS << " switch (id) {\n";
- OS << " default: break;\n";
-
- // Add argument attributes for any intrinsics that have them.
- for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
- if (Ints[i].ArgumentAttributes.empty()) continue;
-
- OS << " case " << TargetPrefix << "Intrinsic::" << Ints[i].EnumName
- << ":\n";
+ OS << " default: break;\n";
+
+ AttributeComparator precedes;
- std::vector<std::pair<unsigned, CodeGenIntrinsic::ArgAttribute> > ArgAttrs =
- Ints[i].ArgumentAttributes;
- // Sort by argument index.
- std::sort(ArgAttrs.begin(), ArgAttrs.end());
+ std::stable_sort(sortedIntrinsics.begin(), sortedIntrinsics.end(), precedes);
+
+ for (unsigned i = 0, e = sortedIntrinsics.size(); i != e; ++i) {
+ const CodeGenIntrinsic &intrinsic = *sortedIntrinsics[i];
+ OS << " case " << TargetPrefix << "Intrinsic::"
+ << intrinsic.EnumName << ":\n";
+
+ // Fill out the case if this is the last case for this range of
+ // intrinsics.
+ if (i + 1 != e && !precedes(&intrinsic, sortedIntrinsics[i + 1]))
+ continue;
- unsigned NumArgsWithAttrs = 0;
+ // Keep track of the number of attributes we're writing out.
+ unsigned numAttrs = 0;
- while (!ArgAttrs.empty()) {
- unsigned ArgNo = ArgAttrs[0].first;
+ // The argument attributes are alreadys sorted by argument index.
+ for (unsigned ai = 0, ae = intrinsic.ArgumentAttributes.size(); ai != ae;) {
+ unsigned argNo = intrinsic.ArgumentAttributes[ai].first;
- OS << " AWI[" << NumArgsWithAttrs++ << "] = AttributeWithIndex::get("
- << ArgNo+1 << ", 0";
+ OS << " AWI[" << numAttrs++ << "] = AttributeWithIndex::get("
+ << argNo+1 << ", ";
- while (!ArgAttrs.empty() && ArgAttrs[0].first == ArgNo) {
- switch (ArgAttrs[0].second) {
- default: assert(0 && "Unknown arg attribute");
+ bool moreThanOne = false;
+
+ do {
+ if (moreThanOne) OS << '|';
+
+ switch (intrinsic.ArgumentAttributes[ai].second) {
case CodeGenIntrinsic::NoCapture:
- OS << "|Attribute::NoCapture";
+ OS << "Attribute::NoCapture";
break;
}
- ArgAttrs.erase(ArgAttrs.begin());
+
+ ++ai;
+ moreThanOne = true;
+ } while (ai != ae && intrinsic.ArgumentAttributes[ai].first == argNo);
+
+ OS << ");\n";
+ }
+
+ ModRefKind modRef = getModRefKind(intrinsic);
+
+ if (!intrinsic.canThrow || modRef) {
+ OS << " AWI[" << numAttrs++ << "] = AttributeWithIndex::get(~0, ";
+ if (!intrinsic.canThrow) {
+ OS << "Attribute::NoUnwind";
+ if (modRef) OS << '|';
+ }
+ switch (modRef) {
+ case MRK_none: break;
+ case MRK_readonly: OS << "Attribute::ReadOnly"; break;
+ case MRK_readnone: OS << "Attribute::ReadNone"; break;
}
OS << ");\n";
}
-
- OS << " NumAttrs = " << NumArgsWithAttrs << ";\n";
- OS << " break;\n";
+
+ if (numAttrs) {
+ OS << " NumAttrs = " << numAttrs << ";\n";
+ OS << " break;\n";
+ } else {
+ OS << " return AttrListPtr();\n";
+ }
}
OS << " }\n";
- OS << " AWI[NumAttrs] = AttributeWithIndex::get(~0, Attr);\n";
- OS << " return AttrListPtr::get(AWI, NumAttrs+1);\n";
+ OS << " return AttrListPtr::get(AWI, NumAttrs);\n";
OS << "}\n";
OS << "#endif // GET_INTRINSIC_ATTRIBUTES\n\n";
}
diff --git a/contrib/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp b/contrib/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
index 6572595..090faf5 100644
--- a/contrib/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -74,6 +74,25 @@ int InitPtrToInt(const Init* ptr) {
return val.getValue();
}
+bool InitPtrToBool(const Init* ptr) {
+ bool ret = false;
+ const DefInit& val = dynamic_cast<const DefInit&>(*ptr);
+ const std::string& str = val.getAsString();
+
+ if (str == "true") {
+ ret = true;
+ }
+ else if (str == "false") {
+ ret = false;
+ }
+ else {
+ throw "Incorrect boolean value: '" + str +
+ "': must be either 'true' or 'false'";
+ }
+
+ return ret;
+}
+
const std::string& InitPtrToString(const Init* ptr) {
const StringInit& val = dynamic_cast<const StringInit&>(*ptr);
return val.getValue();
@@ -95,13 +114,7 @@ const std::string GetOperatorName(const DagInit& D) {
/// CheckBooleanConstant - Check that the provided value is a boolean constant.
void CheckBooleanConstant(const Init* I) {
- const DefInit& val = dynamic_cast<const DefInit&>(*I);
- const std::string& str = val.getAsString();
-
- if (str != "true" && str != "false") {
- throw "Incorrect boolean value: '" + str +
- "': must be either 'true' or 'false'";
- }
+ InitPtrToBool(I);
}
// CheckNumberOfArguments - Ensure that the number of args in d is
@@ -935,8 +948,22 @@ private:
}
void onJoin (const DagInit& d) {
- CheckNumberOfArguments(d, 0);
- toolDesc_.setJoin();
+ bool isReallyJoin = false;
+
+ if (d.getNumArgs() == 0) {
+ isReallyJoin = true;
+ }
+ else {
+ Init* I = d.getArg(0);
+ isReallyJoin = InitPtrToBool(I);
+ }
+
+ // Is this *really* a join tool? We allow (join false) for generating two
+ // tool descriptions from a single generic one.
+ // TOFIX: come up with a cleaner solution.
+ if (isReallyJoin) {
+ toolDesc_.setJoin();
+ }
}
void onOutLanguage (const DagInit& d) {
diff --git a/contrib/llvm/utils/TableGen/NeonEmitter.cpp b/contrib/llvm/utils/TableGen/NeonEmitter.cpp
index 123abef..23fdbde 100644
--- a/contrib/llvm/utils/TableGen/NeonEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/NeonEmitter.cpp
@@ -1398,9 +1398,14 @@ void NeonEmitter::runHeader(raw_ostream &OS) {
for (unsigned ti = 0, te = TypeVec.size(); ti != te; ++ti) {
std::string namestr, shiftstr, rangestr;
- // Builtins which are overloaded by type will need to have their upper
- // bound computed at Sema time based on the type constant.
- if (Proto.find('s') == std::string::npos) {
+ if (R->getValueAsBit("isVCVT_N")) {
+ // VCVT between floating- and fixed-point values takes an immediate
+ // in the range 1 to 32.
+ ck = ClassB;
+ rangestr = "l = 1; u = 31"; // upper bound = l + u
+ } else if (Proto.find('s') == std::string::npos) {
+ // Builtins which are overloaded by type will need to have their upper
+ // bound computed at Sema time based on the type constant.
ck = ClassB;
if (R->getValueAsBit("isShift")) {
shiftstr = ", true";
diff --git a/contrib/llvm/utils/TableGen/Record.cpp b/contrib/llvm/utils/TableGen/Record.cpp
index abbbafe..8ac8cd9 100644
--- a/contrib/llvm/utils/TableGen/Record.cpp
+++ b/contrib/llvm/utils/TableGen/Record.cpp
@@ -68,14 +68,9 @@ Init *BitsRecTy::convertValue(BitInit *UI) {
/// canFitInBitfield - Return true if the number of bits is large enough to hold
/// the integer value.
static bool canFitInBitfield(int64_t Value, unsigned NumBits) {
- if (Value >= 0) {
- if (Value & ~((1LL << NumBits) - 1))
- return false;
- } else if ((Value >> NumBits) != -1 || (Value & (1LL << (NumBits-1))) == 0) {
- return false;
- }
-
- return true;
+ // For example, with NumBits == 4, we permit Values from [-7 .. 15].
+ return (NumBits >= sizeof(Value) * 8) ||
+ (Value >> NumBits == 0) || (Value >> (NumBits-1) == -1);
}
/// convertValue from Int initializer to bits type: Split the integer up into the
@@ -583,9 +578,7 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) {
if (Record *D = (CurRec->getRecords()).getDef(Name))
return new DefInit(D);
- errs() << "Variable not defined: '" + Name + "'\n";
- assert(0 && "Variable not found");
- return 0;
+ throw TGError(CurRec->getLoc(), "Undefined reference:'" + Name + "'\n");
}
}
break;
@@ -813,15 +806,13 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
OpInit *RHSo = dynamic_cast<OpInit*>(RHS);
if (!RHSo) {
- errs() << "!foreach requires an operator\n";
- assert(0 && "No operator for !foreach");
+ throw TGError(CurRec->getLoc(), "!foreach requires an operator\n");
}
TypedInit *LHSt = dynamic_cast<TypedInit*>(LHS);
if (!LHSt) {
- errs() << "!foreach requires typed variable\n";
- assert(0 && "No typed variable for !foreach");
+ throw TGError(CurRec->getLoc(), "!foreach requires typed variable\n");
}
if ((MHSd && DagType) || (MHSl && ListType)) {
diff --git a/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp b/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp
index 4ddc47d..5a441e2 100644
--- a/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp
+++ b/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp
@@ -26,6 +26,7 @@ using namespace llvm;
// runEnums - Print out enum values for all of the registers.
void RegisterInfoEmitter::runEnums(raw_ostream &OS) {
CodeGenTarget Target(Records);
+ CodeGenRegBank &Bank = Target.getRegBank();
const std::vector<CodeGenRegister> &Registers = Target.getRegisters();
std::string Namespace = Registers[0].TheDef->getValueAsString("Namespace");
@@ -47,16 +48,16 @@ void RegisterInfoEmitter::runEnums(raw_ostream &OS) {
if (!Namespace.empty())
OS << "}\n";
- const std::vector<Record*> SubRegIndices = Target.getSubRegIndices();
+ const std::vector<Record*> &SubRegIndices = Bank.getSubRegIndices();
if (!SubRegIndices.empty()) {
OS << "\n// Subregister indices\n";
Namespace = SubRegIndices[0]->getValueAsString("Namespace");
if (!Namespace.empty())
OS << "namespace " << Namespace << " {\n";
OS << "enum {\n NoSubRegister,\n";
- for (unsigned i = 0, e = SubRegIndices.size(); i != e; ++i)
+ for (unsigned i = 0, e = Bank.getNumNamedIndices(); i != e; ++i)
OS << " " << SubRegIndices[i]->getName() << ",\t// " << i+1 << "\n";
- OS << " NUM_TARGET_SUBREGS = " << SubRegIndices.size()+1 << "\n";
+ OS << " NUM_TARGET_NAMED_SUBREGS = " << SubRegIndices.size()+1 << "\n";
OS << "};\n";
if (!Namespace.empty())
OS << "}\n";
@@ -80,6 +81,8 @@ void RegisterInfoEmitter::runHeader(raw_ostream &OS) {
<< "(int CallFrameSetupOpcode = -1, int CallFrameDestroyOpcode = -1);\n"
<< " virtual int getDwarfRegNumFull(unsigned RegNum, "
<< "unsigned Flavour) const;\n"
+ << " virtual int getLLVMRegNumFull(unsigned DwarfRegNum, "
+ << "unsigned Flavour) const;\n"
<< " virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const = 0;\n"
<< " virtual bool needsStackRealignment(const MachineFunction &) const\n"
<< " { return false; }\n"
@@ -165,160 +168,6 @@ static void addSubSuperReg(Record *R, Record *S,
addSubSuperReg(R, *I, SubRegs, SuperRegs, Aliases);
}
-struct RegisterMaps {
- // Map SubRegIndex -> Register
- typedef std::map<Record*, Record*, LessRecord> SubRegMap;
- // Map Register -> SubRegMap
- typedef std::map<Record*, SubRegMap> SubRegMaps;
-
- SubRegMaps SubReg;
- SubRegMap &inferSubRegIndices(Record *Reg);
-
- // Composite SubRegIndex instances.
- // Map (SubRegIndex,SubRegIndex) -> SubRegIndex
- typedef DenseMap<std::pair<Record*,Record*>,Record*> CompositeMap;
- CompositeMap Composite;
-
- // Compute SubRegIndex compositions after inferSubRegIndices has run on all
- // registers.
- void computeComposites();
-};
-
-// Calculate all subregindices for Reg. Loopy subregs cause infinite recursion.
-RegisterMaps::SubRegMap &RegisterMaps::inferSubRegIndices(Record *Reg) {
- SubRegMap &SRM = SubReg[Reg];
- if (!SRM.empty())
- return SRM;
- std::vector<Record*> SubRegs = Reg->getValueAsListOfDefs("SubRegs");
- std::vector<Record*> Indices = Reg->getValueAsListOfDefs("SubRegIndices");
- if (SubRegs.size() != Indices.size())
- throw "Register " + Reg->getName() + " SubRegIndices doesn't match SubRegs";
-
- // First insert the direct subregs and make sure they are fully indexed.
- for (unsigned i = 0, e = SubRegs.size(); i != e; ++i) {
- if (!SRM.insert(std::make_pair(Indices[i], SubRegs[i])).second)
- throw "SubRegIndex " + Indices[i]->getName()
- + " appears twice in Register " + Reg->getName();
- inferSubRegIndices(SubRegs[i]);
- }
-
- // Keep track of inherited subregs and how they can be reached.
- // Register -> (SubRegIndex, SubRegIndex)
- typedef std::map<Record*, std::pair<Record*,Record*>, LessRecord> OrphanMap;
- OrphanMap Orphans;
-
- // Clone inherited subregs. Here the order is important - earlier subregs take
- // precedence.
- for (unsigned i = 0, e = SubRegs.size(); i != e; ++i) {
- SubRegMap &M = SubReg[SubRegs[i]];
- for (SubRegMap::iterator si = M.begin(), se = M.end(); si != se; ++si)
- if (!SRM.insert(*si).second)
- Orphans[si->second] = std::make_pair(Indices[i], si->first);
- }
-
- // Finally process the composites.
- ListInit *Comps = Reg->getValueAsListInit("CompositeIndices");
- for (unsigned i = 0, e = Comps->size(); i != e; ++i) {
- DagInit *Pat = dynamic_cast<DagInit*>(Comps->getElement(i));
- if (!Pat)
- throw "Invalid dag '" + Comps->getElement(i)->getAsString()
- + "' in CompositeIndices";
- DefInit *BaseIdxInit = dynamic_cast<DefInit*>(Pat->getOperator());
- if (!BaseIdxInit || !BaseIdxInit->getDef()->isSubClassOf("SubRegIndex"))
- throw "Invalid SubClassIndex in " + Pat->getAsString();
-
- // Resolve list of subreg indices into R2.
- Record *R2 = Reg;
- for (DagInit::const_arg_iterator di = Pat->arg_begin(),
- de = Pat->arg_end(); di != de; ++di) {
- DefInit *IdxInit = dynamic_cast<DefInit*>(*di);
- if (!IdxInit || !IdxInit->getDef()->isSubClassOf("SubRegIndex"))
- throw "Invalid SubClassIndex in " + Pat->getAsString();
- SubRegMap::const_iterator ni = SubReg[R2].find(IdxInit->getDef());
- if (ni == SubReg[R2].end())
- throw "Composite " + Pat->getAsString() + " refers to bad index in "
- + R2->getName();
- R2 = ni->second;
- }
-
- // Insert composite index. Allow overriding inherited indices etc.
- SRM[BaseIdxInit->getDef()] = R2;
-
- // R2 is now directly addressable, no longer an orphan.
- Orphans.erase(R2);
- }
-
- // Now, Orphans contains the inherited subregisters without a direct index.
- if (!Orphans.empty()) {
- errs() << "Error: Register " << getQualifiedName(Reg)
- << " inherited subregisters without an index:\n";
- for (OrphanMap::iterator i = Orphans.begin(), e = Orphans.end(); i != e;
- ++i) {
- errs() << " " << getQualifiedName(i->first)
- << " = " << i->second.first->getName()
- << ", " << i->second.second->getName() << "\n";
- }
- abort();
- }
- return SRM;
-}
-
-void RegisterMaps::computeComposites() {
- for (SubRegMaps::const_iterator sri = SubReg.begin(), sre = SubReg.end();
- sri != sre; ++sri) {
- Record *Reg1 = sri->first;
- const SubRegMap &SRM1 = sri->second;
- for (SubRegMap::const_iterator i1 = SRM1.begin(), e1 = SRM1.end();
- i1 != e1; ++i1) {
- Record *Idx1 = i1->first;
- Record *Reg2 = i1->second;
- // Ignore identity compositions.
- if (Reg1 == Reg2)
- continue;
- // If Reg2 has no subregs, Idx1 doesn't compose.
- if (!SubReg.count(Reg2))
- continue;
- const SubRegMap &SRM2 = SubReg[Reg2];
- // Try composing Idx1 with another SubRegIndex.
- for (SubRegMap::const_iterator i2 = SRM2.begin(), e2 = SRM2.end();
- i2 != e2; ++i2) {
- std::pair<Record*,Record*> IdxPair(Idx1, i2->first);
- Record *Reg3 = i2->second;
- // OK Reg1:IdxPair == Reg3. Find the index with Reg:Idx == Reg3.
- for (SubRegMap::const_iterator i1d = SRM1.begin(), e1d = SRM1.end();
- i1d != e1d; ++i1d) {
- // Ignore identity compositions.
- if (Reg2 == Reg3)
- continue;
- if (i1d->second == Reg3) {
- std::pair<CompositeMap::iterator,bool> Ins =
- Composite.insert(std::make_pair(IdxPair, i1d->first));
- // Conflicting composition?
- if (!Ins.second && Ins.first->second != i1d->first) {
- errs() << "Error: SubRegIndex " << getQualifiedName(Idx1)
- << " and " << getQualifiedName(IdxPair.second)
- << " compose ambiguously as "
- << getQualifiedName(Ins.first->second) << " or "
- << getQualifiedName(i1d->first) << "\n";
- abort();
- }
- }
- }
- }
- }
- }
-
- // We don't care about the difference between (Idx1, Idx2) -> Idx2 and invalid
- // compositions, so remove any mappings of that form.
- for (CompositeMap::iterator i = Composite.begin(), e = Composite.end();
- i != e;) {
- CompositeMap::iterator j = i;
- ++i;
- if (j->first.second == j->second)
- Composite.erase(j);
- }
-}
-
class RegisterSorter {
private:
std::map<Record*, std::set<Record*>, LessRecord> &RegisterSubRegs;
@@ -337,28 +186,30 @@ public:
//
void RegisterInfoEmitter::run(raw_ostream &OS) {
CodeGenTarget Target(Records);
+ CodeGenRegBank &RegBank = Target.getRegBank();
+ RegBank.computeDerivedInfo();
EmitSourceFileHeader("Register Information Source Fragment", OS);
OS << "namespace llvm {\n\n";
- // Start out by emitting each of the register classes... to do this, we build
- // a set of registers which belong to a register class, this is to ensure that
- // each register is only in a single register class.
- //
+ // Start out by emitting each of the register classes.
const std::vector<CodeGenRegisterClass> &RegisterClasses =
Target.getRegisterClasses();
+ // Collect all registers belonging to any allocatable class.
+ std::set<Record*> AllocatableRegs;
+
// Loop over all of the register classes... emitting each one.
OS << "namespace { // Register classes...\n";
- // RegClassesBelongedTo - Keep track of which register classes each reg
- // belongs to.
- std::multimap<Record*, const CodeGenRegisterClass*> RegClassesBelongedTo;
-
// Emit the register enum value arrays for each RegisterClass
for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) {
const CodeGenRegisterClass &RC = RegisterClasses[rc];
+ // Collect allocatable registers.
+ if (RC.Allocatable)
+ AllocatableRegs.insert(RC.Elements.begin(), RC.Elements.end());
+
// Give the register class a legal C name if it's anonymous.
std::string Name = RC.TheDef->getName();
@@ -369,9 +220,6 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
for (unsigned i = 0, e = RC.Elements.size(); i != e; ++i) {
Record *Reg = RC.Elements[i];
OS << getQualifiedName(Reg) << ", ";
-
- // Keep track of which regclasses this register is in.
- RegClassesBelongedTo.insert(std::make_pair(Reg, &RC));
}
OS << "\n };\n\n";
}
@@ -406,7 +254,7 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
std::map<unsigned, std::set<unsigned> > SuperRegClassMap;
OS << "\n";
- unsigned NumSubRegIndices = Target.getSubRegIndices().size();
+ unsigned NumSubRegIndices = RegBank.getSubRegIndices().size();
if (NumSubRegIndices) {
// Emit the sub-register classes for each RegisterClass
@@ -417,7 +265,7 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
i = RC.SubRegClasses.begin(),
e = RC.SubRegClasses.end(); i != e; ++i) {
// Build SRC array.
- unsigned idx = Target.getSubRegIndexNo(i->first);
+ unsigned idx = RegBank.getSubRegIndexNo(i->first);
SRC.at(idx-1) = i->second;
// Find the register class number of i->second for SuperRegClassMap.
@@ -567,6 +415,7 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
<< RC.SpillSize/8 << ", "
<< RC.SpillAlignment/8 << ", "
<< RC.CopyCost << ", "
+ << RC.Allocatable << ", "
<< RC.getName() << ", " << RC.getName() << " + " << RC.Elements.size()
<< ") {}\n";
}
@@ -841,7 +690,7 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
}
OS<<"\n const TargetRegisterDesc RegisterDescriptors[] = { // Descriptors\n";
- OS << " { \"NOREG\",\t0,\t0,\t0,\t0 },\n";
+ OS << " { \"NOREG\",\t0,\t0,\t0,\t0,\t0 },\n";
// Now that register alias and sub-registers sets have been emitted, emit the
// register descriptors now.
@@ -857,12 +706,17 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
OS << Reg.getName() << "_SuperRegsSet,\t";
else
OS << "Empty_SuperRegsSet,\t";
- OS << Reg.CostPerUse << " },\n";
+ OS << Reg.CostPerUse << ",\t"
+ << int(AllocatableRegs.count(Reg.TheDef)) << " },\n";
}
OS << " };\n"; // End of register descriptors...
+ // Calculate the mapping of subregister+index pairs to physical registers.
+ // This will also create further anonymous indexes.
+ unsigned NamedIndices = RegBank.getNumNamedIndices();
+
// Emit SubRegIndex names, skipping 0
- const std::vector<Record*> SubRegIndices = Target.getSubRegIndices();
+ const std::vector<Record*> &SubRegIndices = RegBank.getSubRegIndices();
OS << "\n const char *const SubRegIndexTable[] = { \"";
for (unsigned i = 0, e = SubRegIndices.size(); i != e; ++i) {
OS << SubRegIndices[i]->getName();
@@ -870,13 +724,21 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
OS << "\", \"";
}
OS << "\" };\n\n";
+
+ // Emit names of the anonymus subreg indexes.
+ if (SubRegIndices.size() > NamedIndices) {
+ OS << " enum {";
+ for (unsigned i = NamedIndices, e = SubRegIndices.size(); i != e; ++i) {
+ OS << "\n " << SubRegIndices[i]->getName() << " = " << i+1;
+ if (i+1 != e)
+ OS << ',';
+ }
+ OS << "\n };\n\n";
+ }
OS << "}\n\n"; // End of anonymous namespace...
std::string ClassName = Target.getName() + "GenRegisterInfo";
- // Calculate the mapping of subregister+index pairs to physical registers.
- RegisterMaps RegMaps;
-
// Emit the subregister + index mapping function based on the information
// calculated above.
OS << "unsigned " << ClassName
@@ -884,16 +746,16 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
<< " switch (RegNo) {\n"
<< " default:\n return 0;\n";
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
- RegisterMaps::SubRegMap &SRM = RegMaps.inferSubRegIndices(Regs[i].TheDef);
+ const CodeGenRegister::SubRegMap &SRM = Regs[i].getSubRegs();
if (SRM.empty())
continue;
OS << " case " << getQualifiedName(Regs[i].TheDef) << ":\n";
OS << " switch (Index) {\n";
OS << " default: return 0;\n";
- for (RegisterMaps::SubRegMap::const_iterator ii = SRM.begin(),
+ for (CodeGenRegister::SubRegMap::const_iterator ii = SRM.begin(),
ie = SRM.end(); ii != ie; ++ii)
OS << " case " << getQualifiedName(ii->first)
- << ": return " << getQualifiedName(ii->second) << ";\n";
+ << ": return " << getQualifiedName(ii->second->TheDef) << ";\n";
OS << " };\n" << " break;\n";
}
OS << " };\n";
@@ -905,13 +767,13 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
<< " switch (RegNo) {\n"
<< " default:\n return 0;\n";
for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
- RegisterMaps::SubRegMap &SRM = RegMaps.SubReg[Regs[i].TheDef];
+ const CodeGenRegister::SubRegMap &SRM = Regs[i].getSubRegs();
if (SRM.empty())
continue;
OS << " case " << getQualifiedName(Regs[i].TheDef) << ":\n";
- for (RegisterMaps::SubRegMap::const_iterator ii = SRM.begin(),
+ for (CodeGenRegister::SubRegMap::const_iterator ii = SRM.begin(),
ie = SRM.end(); ii != ie; ++ii)
- OS << " if (SubRegNo == " << getQualifiedName(ii->second)
+ OS << " if (SubRegNo == " << getQualifiedName(ii->second->TheDef)
<< ") return " << getQualifiedName(ii->first) << ";\n";
OS << " return 0;\n";
}
@@ -920,7 +782,6 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
OS << "}\n\n";
// Emit composeSubRegIndices
- RegMaps.computeComposites();
OS << "unsigned " << ClassName
<< "::composeSubRegIndices(unsigned IdxA, unsigned IdxB) const {\n"
<< " switch (IdxA) {\n"
@@ -928,8 +789,8 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
for (unsigned i = 0, e = SubRegIndices.size(); i != e; ++i) {
bool Open = false;
for (unsigned j = 0; j != e; ++j) {
- if (Record *Comp = RegMaps.Composite.lookup(
- std::make_pair(SubRegIndices[i], SubRegIndices[j]))) {
+ if (Record *Comp = RegBank.getCompositeSubRegIndex(SubRegIndices[i],
+ SubRegIndices[j])) {
if (!Open) {
OS << " case " << getQualifiedName(SubRegIndices[i])
<< ": switch(IdxB) {\n default: return IdxB;\n";
@@ -975,6 +836,44 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
for (unsigned i = I->second.size(), e = maxLength; i != e; ++i)
I->second.push_back(-1);
+ // Emit reverse information about the dwarf register numbers.
+ OS << "int " << ClassName << "::getLLVMRegNumFull(unsigned DwarfRegNum, "
+ << "unsigned Flavour) const {\n"
+ << " switch (Flavour) {\n"
+ << " default:\n"
+ << " assert(0 && \"Unknown DWARF flavour\");\n"
+ << " return -1;\n";
+
+ for (unsigned i = 0, e = maxLength; i != e; ++i) {
+ OS << " case " << i << ":\n"
+ << " switch (DwarfRegNum) {\n"
+ << " default:\n"
+ << " assert(0 && \"Invalid DwarfRegNum\");\n"
+ << " return -1;\n";
+
+ for (DwarfRegNumsMapTy::iterator
+ I = DwarfRegNums.begin(), E = DwarfRegNums.end(); I != E; ++I) {
+ int DwarfRegNo = I->second[i];
+ if (DwarfRegNo >= 0)
+ OS << " case " << DwarfRegNo << ":\n"
+ << " return " << getQualifiedName(I->first) << ";\n";
+ }
+ OS << " };\n";
+ }
+
+ OS << " };\n}\n\n";
+
+ for (unsigned i = 0, e = Regs.size(); i != e; ++i) {
+ Record *Reg = Regs[i].TheDef;
+ const RecordVal *V = Reg->getValue("DwarfAlias");
+ if (!V || !V->getValue())
+ continue;
+
+ DefInit *DI = dynamic_cast<DefInit*>(V->getValue());
+ Record *Alias = DI->getDef();
+ DwarfRegNums[Reg] = DwarfRegNums[Alias];
+ }
+
// Emit information about the dwarf register numbers.
OS << "int " << ClassName << "::getDwarfRegNumFull(unsigned RegNum, "
<< "unsigned Flavour) const {\n"
@@ -996,13 +895,8 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
for (DwarfRegNumsMapTy::iterator
I = DwarfRegNums.begin(), E = DwarfRegNums.end(); I != E; ++I) {
int RegNo = I->second[i];
- if (RegNo != -2)
- OS << " case " << getQualifiedName(I->first) << ":\n"
- << " return " << RegNo << ";\n";
- else
- OS << " case " << getQualifiedName(I->first) << ":\n"
- << " assert(0 && \"Invalid register for this mode\");\n"
- << " return -1;\n";
+ OS << " case " << getQualifiedName(I->first) << ":\n"
+ << " return " << RegNo << ";\n";
}
OS << " };\n";
}
diff --git a/contrib/llvm/utils/TableGen/SetTheory.cpp b/contrib/llvm/utils/TableGen/SetTheory.cpp
new file mode 100644
index 0000000..ade1825
--- /dev/null
+++ b/contrib/llvm/utils/TableGen/SetTheory.cpp
@@ -0,0 +1,270 @@
+//===- SetTheory.cpp - Generate ordered sets from DAG expressions ---------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the SetTheory class that computes ordered sets of
+// Records from DAG expressions.
+//
+//===----------------------------------------------------------------------===//
+
+#include "SetTheory.h"
+#include "Record.h"
+#include "llvm/Support/Format.h"
+
+using namespace llvm;
+
+// Define the standard operators.
+namespace {
+
+typedef SetTheory::RecSet RecSet;
+typedef SetTheory::RecVec RecVec;
+
+// (add a, b, ...) Evaluate and union all arguments.
+struct AddOp : public SetTheory::Operator {
+ void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts) {
+ ST.evaluate(Expr->arg_begin(), Expr->arg_end(), Elts);
+ }
+};
+
+// (sub Add, Sub, ...) Set difference.
+struct SubOp : public SetTheory::Operator {
+ void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts) {
+ if (Expr->arg_size() < 2)
+ throw "Set difference needs at least two arguments: " +
+ Expr->getAsString();
+ RecSet Add, Sub;
+ ST.evaluate(*Expr->arg_begin(), Add);
+ ST.evaluate(Expr->arg_begin() + 1, Expr->arg_end(), Sub);
+ for (RecSet::iterator I = Add.begin(), E = Add.end(); I != E; ++I)
+ if (!Sub.count(*I))
+ Elts.insert(*I);
+ }
+};
+
+// (and S1, S2) Set intersection.
+struct AndOp : public SetTheory::Operator {
+ void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts) {
+ if (Expr->arg_size() != 2)
+ throw "Set intersection requires two arguments: " + Expr->getAsString();
+ RecSet S1, S2;
+ ST.evaluate(Expr->arg_begin()[0], S1);
+ ST.evaluate(Expr->arg_begin()[1], S2);
+ for (RecSet::iterator I = S1.begin(), E = S1.end(); I != E; ++I)
+ if (S2.count(*I))
+ Elts.insert(*I);
+ }
+};
+
+// SetIntBinOp - Abstract base class for (Op S, N) operators.
+struct SetIntBinOp : public SetTheory::Operator {
+ virtual void apply2(SetTheory &ST, DagInit *Expr,
+ RecSet &Set, int64_t N,
+ RecSet &Elts) =0;
+
+ void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts) {
+ if (Expr->arg_size() != 2)
+ throw "Operator requires (Op Set, Int) arguments: " + Expr->getAsString();
+ RecSet Set;
+ ST.evaluate(Expr->arg_begin()[0], Set);
+ IntInit *II = dynamic_cast<IntInit*>(Expr->arg_begin()[1]);
+ if (!II)
+ throw "Second argument must be an integer: " + Expr->getAsString();
+ apply2(ST, Expr, Set, II->getValue(), Elts);
+ }
+};
+
+// (shl S, N) Shift left, remove the first N elements.
+struct ShlOp : public SetIntBinOp {
+ void apply2(SetTheory &ST, DagInit *Expr,
+ RecSet &Set, int64_t N,
+ RecSet &Elts) {
+ if (N < 0)
+ throw "Positive shift required: " + Expr->getAsString();
+ if (unsigned(N) < Set.size())
+ Elts.insert(Set.begin() + N, Set.end());
+ }
+};
+
+// (trunc S, N) Truncate after the first N elements.
+struct TruncOp : public SetIntBinOp {
+ void apply2(SetTheory &ST, DagInit *Expr,
+ RecSet &Set, int64_t N,
+ RecSet &Elts) {
+ if (N < 0)
+ throw "Positive length required: " + Expr->getAsString();
+ if (unsigned(N) > Set.size())
+ N = Set.size();
+ Elts.insert(Set.begin(), Set.begin() + N);
+ }
+};
+
+// Left/right rotation.
+struct RotOp : public SetIntBinOp {
+ const bool Reverse;
+
+ RotOp(bool Rev) : Reverse(Rev) {}
+
+ void apply2(SetTheory &ST, DagInit *Expr,
+ RecSet &Set, int64_t N,
+ RecSet &Elts) {
+ if (Reverse)
+ N = -N;
+ // N > 0 -> rotate left, N < 0 -> rotate right.
+ if (Set.empty())
+ return;
+ if (N < 0)
+ N = Set.size() - (-N % Set.size());
+ else
+ N %= Set.size();
+ Elts.insert(Set.begin() + N, Set.end());
+ Elts.insert(Set.begin(), Set.begin() + N);
+ }
+};
+
+// (decimate S, N) Pick every N'th element of S.
+struct DecimateOp : public SetIntBinOp {
+ void apply2(SetTheory &ST, DagInit *Expr,
+ RecSet &Set, int64_t N,
+ RecSet &Elts) {
+ if (N <= 0)
+ throw "Positive stride required: " + Expr->getAsString();
+ for (unsigned I = 0; I < Set.size(); I += N)
+ Elts.insert(Set[I]);
+ }
+};
+
+// (sequence "Format", From, To) Generate a sequence of records by name.
+struct SequenceOp : public SetTheory::Operator {
+ void apply(SetTheory &ST, DagInit *Expr, RecSet &Elts) {
+ if (Expr->arg_size() != 3)
+ throw "Bad args to (sequence \"Format\", From, To): " +
+ Expr->getAsString();
+ std::string Format;
+ if (StringInit *SI = dynamic_cast<StringInit*>(Expr->arg_begin()[0]))
+ Format = SI->getValue();
+ else
+ throw "Format must be a string: " + Expr->getAsString();
+
+ int64_t From, To;
+ if (IntInit *II = dynamic_cast<IntInit*>(Expr->arg_begin()[1]))
+ From = II->getValue();
+ else
+ throw "From must be an integer: " + Expr->getAsString();
+ if (IntInit *II = dynamic_cast<IntInit*>(Expr->arg_begin()[2]))
+ To = II->getValue();
+ else
+ throw "From must be an integer: " + Expr->getAsString();
+
+ RecordKeeper &Records =
+ dynamic_cast<DefInit&>(*Expr->getOperator()).getDef()->getRecords();
+
+ int Step = From <= To ? 1 : -1;
+ for (To += Step; From != To; From += Step) {
+ std::string Name;
+ raw_string_ostream OS(Name);
+ OS << format(Format.c_str(), From);
+ Record *Rec = Records.getDef(OS.str());
+ if (!Rec)
+ throw "No def named '" + Name + "': " + Expr->getAsString();
+ // Try to reevaluate Rec in case it is a set.
+ if (const RecVec *Result = ST.expand(Rec))
+ Elts.insert(Result->begin(), Result->end());
+ else
+ Elts.insert(Rec);
+ }
+ }
+};
+
+// Expand a Def into a set by evaluating one of its fields.
+struct FieldExpander : public SetTheory::Expander {
+ StringRef FieldName;
+
+ FieldExpander(StringRef fn) : FieldName(fn) {}
+
+ void expand(SetTheory &ST, Record *Def, RecSet &Elts) {
+ ST.evaluate(Def->getValueInit(FieldName), Elts);
+ }
+};
+} // end anonymous namespace
+
+SetTheory::SetTheory() {
+ addOperator("add", new AddOp);
+ addOperator("sub", new SubOp);
+ addOperator("and", new AndOp);
+ addOperator("shl", new ShlOp);
+ addOperator("trunc", new TruncOp);
+ addOperator("rotl", new RotOp(false));
+ addOperator("rotr", new RotOp(true));
+ addOperator("decimate", new DecimateOp);
+ addOperator("sequence", new SequenceOp);
+}
+
+void SetTheory::addOperator(StringRef Name, Operator *Op) {
+ Operators[Name] = Op;
+}
+
+void SetTheory::addExpander(StringRef ClassName, Expander *E) {
+ Expanders[ClassName] = E;
+}
+
+void SetTheory::addFieldExpander(StringRef ClassName, StringRef FieldName) {
+ addExpander(ClassName, new FieldExpander(FieldName));
+}
+
+void SetTheory::evaluate(Init *Expr, RecSet &Elts) {
+ // A def in a list can be a just an element, or it may expand.
+ if (DefInit *Def = dynamic_cast<DefInit*>(Expr)) {
+ if (const RecVec *Result = expand(Def->getDef()))
+ return Elts.insert(Result->begin(), Result->end());
+ Elts.insert(Def->getDef());
+ return;
+ }
+
+ // Lists simply expand.
+ if (ListInit *LI = dynamic_cast<ListInit*>(Expr))
+ return evaluate(LI->begin(), LI->end(), Elts);
+
+ // Anything else must be a DAG.
+ DagInit *DagExpr = dynamic_cast<DagInit*>(Expr);
+ if (!DagExpr)
+ throw "Invalid set element: " + Expr->getAsString();
+ DefInit *OpInit = dynamic_cast<DefInit*>(DagExpr->getOperator());
+ if (!OpInit)
+ throw "Bad set expression: " + Expr->getAsString();
+ Operator *Op = Operators.lookup(OpInit->getDef()->getName());
+ if (!Op)
+ throw "Unknown set operator: " + Expr->getAsString();
+ Op->apply(*this, DagExpr, Elts);
+}
+
+const RecVec *SetTheory::expand(Record *Set) {
+ // Check existing entries for Set and return early.
+ ExpandMap::iterator I = Expansions.find(Set);
+ if (I != Expansions.end())
+ return &I->second;
+
+ // This is the first time we see Set. Find a suitable expander.
+ try {
+ const std::vector<Record*> &SC = Set->getSuperClasses();
+ for (unsigned i = 0, e = SC.size(); i != e; ++i)
+ if (Expander *Exp = Expanders.lookup(SC[i]->getName())) {
+ // This breaks recursive definitions.
+ RecVec &EltVec = Expansions[Set];
+ RecSet Elts;
+ Exp->expand(*this, Set, Elts);
+ EltVec.assign(Elts.begin(), Elts.end());
+ return &EltVec;
+ }
+ } catch (const std::string &Error) {
+ throw TGError(Set->getLoc(), Error);
+ }
+
+ // Set is not expandable.
+ return 0;
+}
+
diff --git a/contrib/llvm/utils/TableGen/SetTheory.h b/contrib/llvm/utils/TableGen/SetTheory.h
new file mode 100644
index 0000000..e37a76e
--- /dev/null
+++ b/contrib/llvm/utils/TableGen/SetTheory.h
@@ -0,0 +1,136 @@
+//===- SetTheory.h - Generate ordered sets from DAG expressions -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the SetTheory class that computes ordered sets of
+// Records from DAG expressions. Operators for standard set operations are
+// predefined, and it is possible to add special purpose set operators as well.
+//
+// The user may define named sets as Records of predefined classes. Set
+// expanders can be added to a SetTheory instance to teach it how to find the
+// elements of such a named set.
+//
+// These are the predefined operators. The argument lists can be individual
+// elements (defs), other sets (defs of expandable classes), lists, or DAG
+// expressions that are evaluated recursively.
+//
+// - (add S1, S2 ...) Union sets. This is also how sets are created from element
+// lists.
+//
+// - (sub S1, S2, ...) Set difference. Every element in S1 except for the
+// elements in S2, ...
+//
+// - (and S1, S2) Set intersection. Every element in S1 that is also in S2.
+//
+// - (shl S, N) Shift left. Remove the first N elements from S.
+//
+// - (trunc S, N) Truncate. The first N elements of S.
+//
+// - (rotl S, N) Rotate left. Same as (add (shl S, N), (trunc S, N)).
+//
+// - (rotr S, N) Rotate right.
+//
+// - (decimate S, N) Decimate S by picking every N'th element, starting with
+// the first one. For instance, (decimate S, 2) returns the even elements of
+// S.
+//
+// - (sequence "Format", From, To) Generate a sequence of defs with printf.
+// For instance, (sequence "R%u", 0, 3) -> [ R0, R1, R2, R3 ]
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SETTHEORY_H
+#define SETTHEORY_H
+
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/SetVector.h"
+#include <map>
+#include <vector>
+
+namespace llvm {
+
+class DagInit;
+struct Init;
+class Record;
+class RecordKeeper;
+
+class SetTheory {
+public:
+ typedef std::vector<Record*> RecVec;
+ typedef SmallSetVector<Record*, 16> RecSet;
+
+ /// Operator - A callback representing a DAG operator.
+ struct Operator {
+ virtual ~Operator() {}
+
+ /// apply - Apply this operator to Expr's arguments and insert the result
+ /// in Elts.
+ virtual void apply(SetTheory&, DagInit *Expr, RecSet &Elts) =0;
+ };
+
+ /// Expander - A callback function that can transform a Record representing a
+ /// set into a fully expanded list of elements. Expanders provide a way for
+ /// users to define named sets that can be used in DAG expressions.
+ struct Expander {
+ virtual ~Expander() {}
+
+ virtual void expand(SetTheory&, Record*, RecSet &Elts) =0;
+ };
+
+private:
+ // Map set defs to their fully expanded contents. This serves as a memoization
+ // cache and it makes it possible to return const references on queries.
+ typedef std::map<Record*, RecVec> ExpandMap;
+ ExpandMap Expansions;
+
+ // Known DAG operators by name.
+ StringMap<Operator*> Operators;
+
+ // Typed expanders by class name.
+ StringMap<Expander*> Expanders;
+
+public:
+ /// Create a SetTheory instance with only the standard operators.
+ SetTheory();
+
+ /// addExpander - Add an expander for Records with the named super class.
+ void addExpander(StringRef ClassName, Expander*);
+
+ /// addFieldExpander - Add an expander for ClassName that simply evaluates
+ /// FieldName in the Record to get the set elements. That is all that is
+ /// needed for a class like:
+ ///
+ /// class Set<dag d> {
+ /// dag Elts = d;
+ /// }
+ ///
+ void addFieldExpander(StringRef ClassName, StringRef FieldName);
+
+ /// addOperator - Add a DAG operator.
+ void addOperator(StringRef Name, Operator*);
+
+ /// evaluate - Evaluate Expr and append the resulting set to Elts.
+ void evaluate(Init *Expr, RecSet &Elts);
+
+ /// evaluate - Evaluate a sequence of Inits and append to Elts.
+ template<typename Iter>
+ void evaluate(Iter begin, Iter end, RecSet &Elts) {
+ while (begin != end)
+ evaluate(*begin++, Elts);
+ }
+
+ /// expand - Expand a record into a set of elements if possible. Return a
+ /// pointer to the expanded elements, or NULL if Set cannot be expanded
+ /// further.
+ const RecVec *expand(Record *Set);
+};
+
+} // end namespace llvm
+
+#endif
+
diff --git a/contrib/llvm/utils/TableGen/TGLexer.cpp b/contrib/llvm/utils/TableGen/TGLexer.cpp
index 82d2b64..572c36d 100644
--- a/contrib/llvm/utils/TableGen/TGLexer.cpp
+++ b/contrib/llvm/utils/TableGen/TGLexer.cpp
@@ -267,14 +267,17 @@ bool TGLexer::LexInclude() {
// Get the string.
std::string Filename = CurStrVal;
+ std::string IncludedFile;
- CurBuffer = SrcMgr.AddIncludeFile(Filename, SMLoc::getFromPointer(CurPtr));
+ CurBuffer = SrcMgr.AddIncludeFile(Filename, SMLoc::getFromPointer(CurPtr),
+ IncludedFile);
if (CurBuffer == -1) {
PrintError(getLoc(), "Could not find include file '" + Filename + "'");
return true;
}
+ Dependencies.push_back(IncludedFile);
// Save the line number and lex buffer of the includer.
CurBuf = SrcMgr.getMemoryBuffer(CurBuffer);
CurPtr = CurBuf->getBufferStart();
diff --git a/contrib/llvm/utils/TableGen/TGLexer.h b/contrib/llvm/utils/TableGen/TGLexer.h
index e1aa5a7..c2a6453 100644
--- a/contrib/llvm/utils/TableGen/TGLexer.h
+++ b/contrib/llvm/utils/TableGen/TGLexer.h
@@ -16,6 +16,7 @@
#include "llvm/Support/DataTypes.h"
#include <string>
+#include <vector>
#include <cassert>
namespace llvm {
@@ -71,6 +72,8 @@ class TGLexer {
/// CurBuffer - This is the current buffer index we're lexing from as managed
/// by the SourceMgr object.
int CurBuffer;
+ /// Dependencies - This is the list of all included files.
+ std::vector<std::string> Dependencies;
public:
TGLexer(SourceMgr &SrcMgr);
@@ -79,6 +82,10 @@ public:
tgtok::TokKind Lex() {
return CurCode = LexToken();
}
+
+ const std::vector<std::string> &getDependencies() const {
+ return Dependencies;
+ }
tgtok::TokKind getCode() const { return CurCode; }
diff --git a/contrib/llvm/utils/TableGen/TGParser.h b/contrib/llvm/utils/TableGen/TGParser.h
index 9cdf68f..419a99b 100644
--- a/contrib/llvm/utils/TableGen/TGParser.h
+++ b/contrib/llvm/utils/TableGen/TGParser.h
@@ -66,6 +66,9 @@ public:
bool TokError(const Twine &Msg) const {
return Error(Lex.getLoc(), Msg);
}
+ const std::vector<std::string> &getDependencies() const {
+ return Lex.getDependencies();
+ }
private: // Semantic analysis methods.
bool AddValue(Record *TheRec, SMLoc Loc, const RecordVal &RV);
bool SetValue(Record *TheRec, SMLoc Loc, const std::string &ValName,
diff --git a/contrib/llvm/utils/TableGen/TableGen.cpp b/contrib/llvm/utils/TableGen/TableGen.cpp
index aa92302..4e4da36 100644
--- a/contrib/llvm/utils/TableGen/TableGen.cpp
+++ b/contrib/llvm/utils/TableGen/TableGen.cpp
@@ -37,6 +37,7 @@
#include "RegisterInfoEmitter.h"
#include "ARMDecoderEmitter.h"
#include "SubtargetEmitter.h"
+#include "SetTheory.h"
#include "TGParser.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Support/CommandLine.h"
@@ -80,7 +81,8 @@ enum ActionType {
GenArmNeon,
GenArmNeonSema,
GenArmNeonTest,
- PrintEnums
+ PrintEnums,
+ PrintSets
};
namespace {
@@ -162,6 +164,8 @@ namespace {
"Generate ARM NEON tests for clang"),
clEnumValN(PrintEnums, "print-enums",
"Print enum values for a class"),
+ clEnumValN(PrintSets, "print-sets",
+ "Print expanded sets for testing DAG exprs"),
clEnumValEnd));
cl::opt<std::string>
@@ -173,6 +177,10 @@ namespace {
cl::init("-"));
cl::opt<std::string>
+ DependFilename("d", cl::desc("Dependency filename"), cl::value_desc("filename"),
+ cl::init(""));
+
+ cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"));
cl::list<std::string>
@@ -192,34 +200,6 @@ void llvm::PrintError(SMLoc ErrorLoc, const Twine &Msg) {
SrcMgr.PrintMessage(ErrorLoc, Msg, "error");
}
-
-
-/// ParseFile - this function begins the parsing of the specified tablegen
-/// file.
-static bool ParseFile(const std::string &Filename,
- const std::vector<std::string> &IncludeDirs,
- SourceMgr &SrcMgr,
- RecordKeeper &Records) {
- OwningPtr<MemoryBuffer> File;
- if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), File)) {
- errs() << "Could not open input file '" << Filename << "': "
- << ec.message() <<"\n";
- return true;
- }
- MemoryBuffer *F = File.take();
-
- // Tell SrcMgr about this buffer, which is what TGParser will pick up.
- SrcMgr.AddNewSourceBuffer(F, SMLoc());
-
- // Record the location of the include directory so that the lexer can find
- // it later.
- SrcMgr.setIncludeDirs(IncludeDirs);
-
- TGParser Parser(SrcMgr, Records);
-
- return Parser.ParseFile();
-}
-
int main(int argc, char **argv) {
RecordKeeper Records;
@@ -228,19 +208,57 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv);
- // Parse the input file.
- if (ParseFile(InputFilename, IncludeDirs, SrcMgr, Records))
- return 1;
+ try {
+ // Parse the input file.
+ OwningPtr<MemoryBuffer> File;
+ if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), File)) {
+ errs() << "Could not open input file '" << InputFilename << "': "
+ << ec.message() <<"\n";
+ return 1;
+ }
+ MemoryBuffer *F = File.take();
- std::string Error;
- tool_output_file Out(OutputFilename.c_str(), Error);
- if (!Error.empty()) {
- errs() << argv[0] << ": error opening " << OutputFilename
- << ":" << Error << "\n";
- return 1;
- }
+ // Tell SrcMgr about this buffer, which is what TGParser will pick up.
+ SrcMgr.AddNewSourceBuffer(F, SMLoc());
+
+ // Record the location of the include directory so that the lexer can find
+ // it later.
+ SrcMgr.setIncludeDirs(IncludeDirs);
+
+ TGParser Parser(SrcMgr, Records);
+
+ if (Parser.ParseFile())
+ return 1;
+
+ std::string Error;
+ tool_output_file Out(OutputFilename.c_str(), Error);
+ if (!Error.empty()) {
+ errs() << argv[0] << ": error opening " << OutputFilename
+ << ":" << Error << "\n";
+ return 1;
+ }
+ if (!DependFilename.empty()) {
+ if (OutputFilename == "-") {
+ errs() << argv[0] << ": the option -d must be used together with -o\n";
+ return 1;
+ }
+ tool_output_file DepOut(DependFilename.c_str(), Error);
+ if (!Error.empty()) {
+ errs() << argv[0] << ": error opening " << DependFilename
+ << ":" << Error << "\n";
+ return 1;
+ }
+ DepOut.os() << DependFilename << ":";
+ const std::vector<std::string> &Dependencies = Parser.getDependencies();
+ for (std::vector<std::string>::const_iterator I = Dependencies.begin(),
+ E = Dependencies.end();
+ I != E; ++I) {
+ DepOut.os() << " " << (*I);
+ }
+ DepOut.os() << "\n";
+ DepOut.keep();
+ }
- try {
switch (Action) {
case PrintRecords:
Out.os() << Records; // No argument, dump all contents
@@ -360,6 +378,21 @@ int main(int argc, char **argv) {
Out.os() << "\n";
break;
}
+ case PrintSets:
+ {
+ SetTheory Sets;
+ Sets.addFieldExpander("Set", "Elements");
+ std::vector<Record*> Recs = Records.getAllDerivedDefinitions("Set");
+ for (unsigned i = 0, e = Recs.size(); i != e; ++i) {
+ Out.os() << Recs[i]->getName() << " = [";
+ const std::vector<Record*> *Elts = Sets.expand(Recs[i]);
+ assert(Elts && "Couldn't expand Set instance");
+ for (unsigned ei = 0, ee = Elts->size(); ei != ee; ++ei)
+ Out.os() << ' ' << (*Elts)[ei]->getName();
+ Out.os() << " ]\n";
+ }
+ break;
+ }
default:
assert(1 && "Invalid Action");
return 1;
diff --git a/contrib/lukemftp/FreeBSD-patchset b/contrib/lukemftp/FreeBSD-patchset
deleted file mode 100644
index 2f9ff8a..0000000
--- a/contrib/lukemftp/FreeBSD-patchset
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -ru src.orig/cmds.c src/cmds.c
---- src.orig/cmds.c Sun Jun 15 22:11:43 2003
-+++ src/cmds.c Sun Jun 15 21:46:37 2003
-@@ -131,6 +131,7 @@
- #include <string.h>
- #include <time.h>
- #include <unistd.h>
-+#include <libutil.h>
-
- #include "ftp_var.h"
- #include "version.h"
-diff -ru src.orig/fetch.c src/fetch.c
---- src.orig/fetch.c Sun Jun 15 22:11:43 2003
-+++ src/fetch.c Sun Jun 15 21:46:53 2003
-@@ -69,6 +69,7 @@
- #include <string.h>
- #include <unistd.h>
- #include <time.h>
-+#include <libutil.h>
-
- #include "ftp_var.h"
- #include "version.h"
-Only in src: ftp.cat1
-diff -ru src.orig/progressbar.c src/progressbar.c
---- src.orig/progressbar.c Sun Jun 15 22:11:43 2003
-+++ src/progressbar.c Sun Jun 15 21:50:48 2003
-@@ -50,6 +50,7 @@
- */
- #include <sys/types.h>
- #include <sys/param.h>
-+#include <sys/time.h>
-
- #include <err.h>
- #include <errno.h>
-@@ -57,10 +58,12 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
--#include <tzfile.h>
- #include <unistd.h>
-
- #include "progressbar.h"
-+
-+#define SECSPERHOUR (60 * 60)
-+#define SECSPERDAY ((long)60 * 60 * 24)
-
- #if !defined(NO_PROGRESS)
- /*
-diff -ru src.orig/util.c src/util.c
---- src.orig/util.c Sun Jun 15 22:11:44 2003
-+++ src/util.c Sun Jun 15 21:51:31 2003
-@@ -101,10 +101,11 @@
- #include <string.h>
- #include <termios.h>
- #include <time.h>
--#include <tzfile.h>
- #include <unistd.h>
-
- #include "ftp_var.h"
-+
-+#define TM_YEAR_BASE 1900
-
- /*
- * Connect to peer server and auto-login, if possible.
diff --git a/contrib/lukemftp/INSTALL b/contrib/lukemftp/INSTALL
deleted file mode 100644
index 97e82b0..0000000
--- a/contrib/lukemftp/INSTALL
+++ /dev/null
@@ -1,211 +0,0 @@
-INSTALLATION INTRODUCTION
--------------------------
-
-This file describes how to compile and install lukemftp on your
-system.
-
- ============================================
- = =
- = NOTE: You will need an ANSI C compiler. =
- = =
- ============================================
-
-
-For most systems, execute the following to compile and install
-lukemftp:
- ./configure
- make
- make install
-
-A preformatted manual page (src/ftp.cat1) is also installed. If
-you wish to install the source (src/ftp.1), ensure that your system
-has up-to-date mandoc macros. groff ships with this macro suite,
-but it has bugs. Try:
- ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/tmac/
-for a more recent version.
-
-
-CONFIGURATION OPTIONS
----------------------
-
-lukemftp is configured using an `autoconf' generated `configure'
-script. `configure' supports the following options:
-
-* The standard `autoconf configure' options, including:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [/usr/local]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- BSD or GNU make may be required for this to work.
-
-* Specific options:
- --enable-editcomplete Turn on command line editing and completion.
- --disable-editcomplete Turn off command line editing and completion
- [default: enabled].
- --enable-ipv6 Enable IPv6 support (if your OS supports it)
- --disable-ipv6 Disable IPv6 support (even if your OS supports it.)
- [default: enabled].
- --with-socks Compile with SOCKS firewall traversal support.
- --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support.
- --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support.
-
-The following environment variables can be set to override various
-compiler related settings.
- CC=compiler specify name of the C compiler (default: gcc or cc)
- CFLAGS=flags specify flags to C compiler (default: -O -g or just -O)
- LDFLAGS=flags specify flags to linker (default: none)
-
-This can be achieved with:
- env CC="compiler" CFLAGS="flags" LDFLAGS="flags" ./configure
-
-
- ============================================
- = =
- = NOTE: You will need an ANSI C compiler. =
- = =
- ============================================
-
-
-PLATFORM SPECIFIC NOTES
------------------------
-
-The following platforms & compilers have been tested:
-
-- AIX 4.1.5:
-- AIX 4.2.1:
-- AIX 4.3.3:
- - Compiler: xlc -qlanglvl=ansi
- version: xlC 3.1.4.10 -- C for AIX Compiler
- version: ibmcxx.cmp 3.6.6.6 -- IBM C and C++ Compilers
-
- Configure with:
- env CC="xlc" CFLAGS="-qlanglvl=ansi" ./configure
-
-- BSD/OS 4.0.1 (x86)
-- BSD/OS 4.1 (x86)
-- BSD/OS 4.1 (sparc)
-- BSD/OS 4.2 (x86)
- - Compiler: /bin/cc
- version: gcc 2.7.2.1
- version: gcc version 2.95.2 19991024
-
-- Digital UNIX 4.0b
-- Digital UNIX 4.0d
-- Digital UNIX 4.0f
- - Compiler: cc -std
- version: DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564)
- version: DEC C V5.9-005 on Digital UNIX V4.0 (Rev. 1229)
-
- Configure with
- env CC="cc -std" ./configure
-
- - Compiler: gcc
- version: 2.95.1
-
-- Digital UNIX 5.0
- - Compiler: cc
- version: Compaq C V6.1-011 on Digital UNIX V5.0 (Rev. 910)
-
-- FreeBSD 3.4 (i386):
-- FreeBSD 3.5 (i386):
-- FreeBSD 4.1 (i386):
- - Compiler: cc
- version: gcc version 2.7.2.3
- version: gcc version 2.95.2 19991024
-
-- HP/UX 10.20:
-- HP/UX 11.00:
- - Compiler: /opt/ansic/bin/cc -Ae
- version: A.10.32.03
-
- Configure with
- env CC="cc -Ae" ./configure
-
- To generate code that will run on old architectures you
- may need to add "+DAportable" to CC.
-
-
-- IRIX 6.5.4
-- IRIX 6.5.8
- Compiler: /bin/cc
- version: MIPSpro Compilers: Version 7.2.1
- Compiler:
- version: gcc version 2.95.2
-
-- HP/UX 11.00:
-- HP/UX 11.00 64 bit:
- - Compiler: /opt/ansic/bin/cc -Ae
- version: A.11.01.00
-
- Configure with
- env CC="cc -Ae" ./configure
-
-- NetBSD 1.3.3 (i386)
- Compiler: /usr/bin/cc
- Compiler: /usr/bin/cc
-
- Ignore warnings about ``passing arg 3 of `tputs' from
- incompatible pointer type''.
-
-- RedHat Linux 5.1 (?? i386)
-- RedHat Linux 5.2 (?? i386)
-- RedHat Linux 6.0 (Linux 2.2.10 i686)
-- RedHat Linux 6.1 (Linux 2.2.5-15 i686)
-- RedHat Linux 6.2 (Linux 2.2.16-3smp i686)
- - Compiler: cc
- version: egcs-1.1.2
-
-- Slackware (Linux 2.0.35 i686)
- - Compiler: cc
- version: 2.7.2.3
-
-- Solaris 2.6 (sparc)
-- Solaris 7 (sparc)
- - Compiler: /opt/SUNWspro/bin/cc
- version: WorkShop Compilers 5.0
-
- - Compiler: gcc
- version: egcs-1.1.2
-
-=============
-= OLD NOTES =
-=============
-
-XXX: clean up to match reality
-------------------------------
-
-- RedHat Linux 5.0 (i386)
- Compiler: cc
-
-- Solaris 2.5 (sparc)
-- Solaris 7 (x86)
- Compiler: /opt/SUNWspro/bin/cc
- version: SC3.0 15 Dec 1993
- version: WorkShop Compilers 5.0
- Compiler: gcc
- version: egcs-1.1.2
- version: gcc 2.8.1
- version: gcc 2.95.1
-
-- Solaris 7 (sparc) 64 bit
- Compiler: /opt/SUNWspro/bin/cc -xarch=v9
- version: WorkShop Compilers 5.0
-
-- SunOS 4
- Compiler: gcc -lresolv
- version:
-
-- SuSE Linux
- Compiler: gcc
- version:
-
- /usr/bin/ftp on SuSE Linux 6.4 is this ftp client.
-
- May need `gcc -L/usr/lib/termcap' if tgetent() et al aren't found.
-
-- Ultrix 4.5
- Compiler: cc
- version: MIPS C Compiler 3.0
- Compiler: gcc
- version: 2.7.2.2
diff --git a/contrib/lukemftp/Makefile.in b/contrib/lukemftp/Makefile.in
deleted file mode 100644
index 3e4f298..0000000
--- a/contrib/lukemftp/Makefile.in
+++ /dev/null
@@ -1,33 +0,0 @@
-# $Id: Makefile.in,v 1.6 1999/11/13 01:18:22 lukem Exp $
-#
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-SHELL = /bin/sh
-
-@SET_MAKE@
-
-
-SUBDIRS = libedit libukem src
-
-all: ftp
-
-ftp: @LIBEDIT@ @LIBUKEM@
- ( cd src; ${MAKE} )
-
-libedit.a:
- ( cd libedit; ${MAKE} )
-
-libukem.a:
- ( cd libukem; ${MAKE} )
-
-install clean:
- @for i in ${SUBDIRS}; do \
- ( echo "$@ ===> $$i" ; cd $$i ; ${MAKE} $@ ); \
- done
-
-distclean: clean
- @for i in ${SUBDIRS}; do \
- ( echo "$@ ===> $$i" ; cd $$i ; ${MAKE} $@ ); \
- done
- rm -f Makefile config.cache config.log config.status config.h
diff --git a/contrib/lukemftp/NEWS b/contrib/lukemftp/NEWS
deleted file mode 100644
index 614dec0..0000000
--- a/contrib/lukemftp/NEWS
+++ /dev/null
@@ -1,84 +0,0 @@
-This is a brief description of the new features and fixes added to
-lukemftp-1.5 since the release of lukemftp-1.4. As always, the manual
-page (src/ftp.cat1) is the place to look for complete descriptions.
-
-* Add new commands:
- features list remote features supported by servers
- mlsd machine parseable directory listing
- mlst machine parseable file listing
- remopts set options on remote features
-
- These require support in the remote server for the ftp extensions
- described in RFC 2389 and draft-ietf-ftpext-mlst-11.
-
-* Fix support for the --program-prefix and --program-suffix configure
- options.
-
----
-This is a brief description of the new features and fixes added to
-lukemftp-1.4 since the release of lukemftp-1.3. As always, the manual
-page (src/ftp.cat1) is the place to look for complete descriptions.
-
-* Fix compilation problems on various non 4.4BSD derived platforms which
- support IPv6, and on Linux systems which have strdup() as a macro.
-
-* During auto-fetch, don't attempt to autologin a second time if the first
- time failed.
-
----
-This is a brief description of the new features and fixes added to
-lukemftp-1.3 since the release of lukemftp-1.2. As always, the manual
-page (src/ftp.cat1) is the place to look for complete descriptions.
-
-* The `ls' command now uses the `LIST' directive instead of `NLST',
- in order to be compatible with RFC959.
-
-* Add fget command, which reads a list of filenames to retrieve from
- the given file.
-
-* Add support for uploading files on the command-line with `ftp -u'.
-
-* Various fixes to the IPv6 support.
-
----
-This is a brief description of the new features and fixes added to
-lukemftp-1.2 since the release of lukemftp-1.1. As always, the manual
-page (src/ftp.cat1) is the place to look for complete descriptions.
-
-* During remote completion, only send ``NLST'' instead of ``NLST .''
- when reading the list of files from the remote server; some servers
- don't like the trailing `.'.
-
-* Support a leading ``[user@]'' for ``[user@]host[:][path]'' auto-fetches
- and ``[user@]host'' connections.
-
-* Always compile in support for setting the type of service on transfers.
- Should speed up transfers on Linux systems.
-
-* Improve performance of non-rate-limited transfers.
-
-* Work around ftp servers that aren't Y2K compliant in returning the
- modification time of a file.
-
-* Update the libedit library to support automatic and magic margins,
- allowing ftp's rprompt to move an extra character to the right.
-
----
-This is a brief description of the new features and fixes added to
-lukemftp-1.1 since the release of lukemftp-1.0. As always, the manual
-page (src/ftp.cat1) is the place to look for complete descriptions.
-
-* Implemented `set prompt' and `set rprompt', which allow you to
- configure the prompt and right side prompt (respectively).
- Some tcsh(1) style `%' escapes are supported, including
- %. %c %/ %m %M %n
-
-* Implemented restarting of file:/// and non-proxied http:// URLs
- (using -R)
-
-* Correctly parse remote ports given as numbers that don't appear in
- the services(5) database.
-
-* Prevent a couple of minor memory leaks
-
-* Add missing compilation setting for SOCKS
diff --git a/contrib/lukemftp/README b/contrib/lukemftp/README
deleted file mode 100644
index 4b3a12c..0000000
--- a/contrib/lukemftp/README
+++ /dev/null
@@ -1,61 +0,0 @@
-WHAT IS LUKEMFTP?
------------------
-
-`lukemftp' is what many users affectionately call the enhanced ftp
-client in NetBSD (http://www.netbsd.org). The `lukem' comes from
-the account name of the NetBSD developer who wrote most of the
-enhancements: Luke Mewburn <lukem@netbsd.org>.
-
-This package is a `port' of the NetBSD ftp client to other systems.
-
-The enhancements over the standard ftp client in 4.4BSD (and
-derivatives) include:
- * command-line editing within ftp
- * command-line fetching of URLS, including support for:
- - http proxies (c.f: $http_proxy, $ftp_proxy)
- - authentication
- * configurable prompt
- * context sensitive command and filename completion
- * dynamic progress bar
- * feature negotiation extensions from RFC 2389
- (c.f: `feat' and `remopts')
- * extensions to ftp from the IETF ftpext working group
- (c.f: `mlsd' and `mlst')
- * IPv6 support (from the WIDE project)
- * modification time preservation
- * paging of local and remote files, and of directory listings
- (c.f: `lpage', `page', `pdir')
- * passive mode support, with fallback to active mode
- * retrieval of filenames listed in a given file (c.f: `fget')
- * `set option' override of ftp environment variables
- * socks4/socks5 support
- * TIS Firewall Toolkit gate ftp proxy support (c.f: `gate')
- * transfer-rate throttling (c.f: `-T', `rate')
- * uploading of files on the command line (c.f: `-u')
-
-
-INSTALLATION
-------------
-
-Refer to `INSTALL' for more information on how to compile and install
-lukemftp.
-
-
-FEEDBACK / BUG REPORTS
-----------------------
-
-Please email feedback back to the maintainer: <lukem@netbsd.org>.
-
-
-COPYRIGHT
----------
-
-lukemftp is covered by a BSD-style copyright notice. Please refer to
-the file `COPYING' for more information.
-
-
-AVAILABILITY
-------------
-
-The primary ftp site for lukemftp is:
- ftp://ftp.netbsd.org/pub/NetBSD/misc/lukemftp/
diff --git a/contrib/lukemftp/THANKS b/contrib/lukemftp/THANKS
deleted file mode 100644
index bff4e25..0000000
--- a/contrib/lukemftp/THANKS
+++ /dev/null
@@ -1,30 +0,0 @@
-Whilst a lot of the work in lukemftp (both the original sources in NetBSD
-and this port) was done by me (Luke Mewburn), it would not be as useable
-without the enhancements, fixes, or input from the following people:
-
-Brian Stark <bstark1990@netscape.net>
-Chris G. Demetriou <cgd@netbsd.org>
-Christos Zoulas <christos@netbsd.org>
-Dan Winship <danw@mit.edu>
-Darren Reed <darrenr@pobox.com>
-David Carrel <carrel@netbsd.org>
-Giles Lean <giles@nemeton.com.au>
-Havard Eidnes <Havard.Eidnes@runit.sintef.no>
-ITOH Yasufumi <itohy@netbsd.org>
-Jason R. Thorpe <thorpej@netbsd.org>
-John Hawkinson <jhawk@mit.edu>
-Joseph S. Myers <jsm28@cam.ac.uk>
-Jun-ichiro itojun Hagino <itojun@netbsd.org>
-Kimmo Suominen <kim@tac.nyc.ny.us>
-Klaus Klein <kleink@netbsd.org>
-Luke Mewburn <lukem@netbsd.org>
-Marc Horowitz <marc@mit.edu>
-Matthew R. Green <mrg@eterna.com.au>
-Matthias Pfaller <leo@dachau.marco.de>
-Matthias Scheler <tron@zhadum.de>
-Michael L. Hitch <osymh@terra.oscs.montana.edu>
-Scott Aaron Bamford <sab@ansic.net>
-Simon Burge <simonb@thistledown.com.au>
-Todd C. Miller <Todd.Miller@courtesan.com>
-
-Apologies to anyone I've missed.
diff --git a/contrib/lukemftp/acconfig.h b/contrib/lukemftp/acconfig.h
deleted file mode 100644
index fb3cbfa..0000000
--- a/contrib/lukemftp/acconfig.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* $Id: acconfig.h,v 1.9 2002/06/10 01:27:13 lukem Exp $ */
-
-@TOP@
-@BOTTOM@
-
-/* Define if your compiler supports `long long' */
-#undef HAVE_LONG_LONG
-
-/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */
-#undef HAVE_PRINTF_QD
-
-/* Define if in_port_t exists */
-#undef HAVE_IN_PORT_T
-
-/* Define if sa_family_t exists in <sys/socket.h> */
-#undef HAVE_SA_FAMILY_T
-
-/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */
-#undef HAVE_SOCKADDR_SA_LEN
-
-/* Define if socklen_t exists */
-#undef HAVE_SOCKLEN_T
-
-/* Define if AF_INET6 exists in <sys/socket.h> */
-#undef HAVE_AF_INET6
-
-/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */
-#undef HAVE_SOCKADDR_IN6
-
-/* Define if `struct addrinfo' exists in <netdb.h> */
-#undef HAVE_ADDRINFO
-
-/*
- * Define if <netdb.h> contains AI_NUMERICHOST et al.
- * Systems which only implement RFC2133 will need this.
- */
-#undef HAVE_RFC2553_NETDB
-
-/* Define if `struct direct' has a d_namlen element */
-#undef HAVE_D_NAMLEN
-
-/* Define if h_errno exists in <netdb.h> */
-#undef HAVE_H_ERRNO_D
-
-/* Define if fclose() is declared in <stdio.h> */
-#undef HAVE_FCLOSE_D
-
-/* Define if getpass() is declared in <stdlib.h> or <unistd.h> */
-#undef HAVE_GETPASS_D
-
-/* Define if optarg is declared in <stdlib.h> or <unistd.h> */
-#undef HAVE_OPTARG_D
-
-/* Define if optind is declared in <stdlib.h> or <unistd.h> */
-#undef HAVE_OPTIND_D
-
-/* Define if pclose() is declared in <stdio.h> */
-#undef HAVE_PCLOSE_D
-
-/* Define if `long long' is supported and sizeof(off_t) >= 8 */
-#undef HAVE_QUAD_SUPPORT
-
-/* Define if strptime() is declared in <time.h> */
-#undef HAVE_STRPTIME_D
-
-/*
- * Define this if compiling with SOCKS (the firewall traversal library).
- * Also, you must define connect, getsockname, bind, accept, listen, and
- * select to their R-versions.
- */
-#undef SOCKS
-#undef SOCKS4
-#undef SOCKS5
-#undef connect
-#undef getsockname
-#undef bind
-#undef accept
-#undef listen
-#undef select
-#undef dup
-#undef dup2
-#undef fclose
-#undef gethostbyname
-#undef getpeername
-#undef read
-#undef recv
-#undef recvfrom
-#undef rresvport
-#undef send
-#undef sendto
-#undef shutdown
-#undef write
diff --git a/contrib/lukemftp/aclocal.m4 b/contrib/lukemftp/aclocal.m4
deleted file mode 100644
index 3e27508..0000000
--- a/contrib/lukemftp/aclocal.m4
+++ /dev/null
@@ -1,257 +0,0 @@
-dnl $Id: aclocal.m4,v 1.5 1999/11/13 10:50:39 lukem Exp $
-dnl
-
-dnl
-dnl AC_MSG_TRY_COMPILE
-dnl
-dnl Written by Luke Mewburn <lukem@netbsd.org>
-dnl
-dnl Usage:
-dnl AC_MSG_TRY_COMPILE(Message, CacheVar, Includes, Code,
-dnl ActionPass [,ActionFail] )
-dnl
-dnl effectively does:
-dnl AC_CACHE_CHECK(Message, CacheVar,
-dnl AC_TRY_COMPILE(Includes, Code, CacheVar = yes, CacheVar = no)
-dnl if CacheVar == yes
-dnl AC_MESSAGE_RESULT(yes)
-dnl ActionPass
-dnl else
-dnl AC_MESSAGE_RESULT(no)
-dnl ActionFail
-dnl )
-dnl
-AC_DEFUN(AC_MSG_TRY_COMPILE, [
- AC_CACHE_CHECK($1, $2, [
- AC_TRY_COMPILE([ $3 ], [ $4; ], [ $2=yes ], [ $2=no ])
- ])
- if test "x[$]$2" = "xyes"; then
- $5
- else
- $6
- :
- fi
-])
-
-dnl
-dnl AC_MSG_TRY_LINK
-dnl
-dnl Usage:
-dnl AC_MSG_TRY_LINK(Message, CacheVar, Includes, Code,
-dnl ActionPass [,ActionFail] )
-dnl
-dnl as AC_MSG_TRY_COMPILE, but uses AC_TRY_LINK instead of AC_TRY_COMPILE
-dnl
-AC_DEFUN(AC_MSG_TRY_LINK, [
- AC_CACHE_CHECK($1, $2, [
- AC_TRY_LINK([ $3 ], [ $4; ], [ $2=yes ], [ $2=no ])
- ])
- if test "x[$]$2" = "xyes"; then
- $5
- else
- $6
- :
- fi
-])
-
-
-dnl
-dnl AC_LIBRARY_NET: #Id: net.m4,v 1.5 1997/11/09 21:36:54 jhawk Exp #
-dnl
-dnl Written by John Hawkinson <jhawk@mit.edu>. This code is in the Public
-dnl Domain.
-dnl
-dnl This test is for network applications that need socket() and
-dnl gethostbyname() -ish functions. Under Solaris, those applications need to
-dnl link with "-lsocket -lnsl". Under IRIX, they should *not* link with
-dnl "-lsocket" because libsocket.a breaks a number of things (for instance:
-dnl gethostbyname() under IRIX 5.2, and snoop sockets under most versions of
-dnl IRIX).
-dnl
-dnl Unfortunately, many application developers are not aware of this, and
-dnl mistakenly write tests that cause -lsocket to be used under IRIX. It is
-dnl also easy to write tests that cause -lnsl to be used under operating
-dnl systems where neither are necessary (or useful), such as SunOS 4.1.4, which
-dnl uses -lnsl for TLI.
-dnl
-dnl This test exists so that every application developer does not test this in
-dnl a different, and subtly broken fashion.
-dnl
-dnl It has been argued that this test should be broken up into two seperate
-dnl tests, one for the resolver libraries, and one for the libraries necessary
-dnl for using Sockets API. Unfortunately, the two are carefully intertwined and
-dnl allowing the autoconf user to use them independantly potentially results in
-dnl unfortunate ordering dependancies -- as such, such component macros would
-dnl have to carefully use indirection and be aware if the other components were
-dnl executed. Since other autoconf macros do not go to this trouble, and almost
-dnl no applications use sockets without the resolver, this complexity has not
-dnl been implemented.
-dnl
-dnl The check for libresolv is in case you are attempting to link statically
-dnl and happen to have a libresolv.a lying around (and no libnsl.a).
-dnl
-AC_DEFUN(AC_LIBRARY_NET, [
- # Most operating systems have gethostbyname() in the default searched
- # libraries (i.e. libc):
- AC_CHECK_FUNC(gethostbyname, ,
- # Some OSes (eg. Solaris) place it in libnsl:
- AC_CHECK_LIB(nsl, gethostbyname, ,
- # Some strange OSes (SINIX) have it in libsocket:
- AC_CHECK_LIB(socket, gethostbyname, ,
- # Unfortunately libsocket sometimes depends on libnsl.
- # AC_CHECK_LIB's API is essentially broken so the following
- # ugliness is necessary:
- AC_CHECK_LIB(socket, gethostbyname,
- LIBS="-lsocket -lnsl $LIBS",
- AC_CHECK_LIB(resolv, gethostbyname),
- -lnsl)
- )
- )
- )
- AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
- AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)))
- ])
-
-
-dnl Checks for SOCKS firewall support.
-dnl
-dnl Written by Matthew R. Green <mrg@eterna.com.au>
-dnl
-AC_DEFUN(AC_LIBRARY_SOCKS, [
- AC_MSG_CHECKING(whether to support SOCKS)
- AC_ARG_WITH(socks,
- [ --with-socks Compile with SOCKS firewall traversal support.],
- [
- case "$withval" in
- no)
- AC_MSG_RESULT(no)
- ;;
- yes)
- AC_MSG_RESULT(yes)
- AC_CHECK_LIB(socks5, SOCKSconnect, [
- socks=5
- LIBS="-lsocks5 $LIBS"], [
- AC_CHECK_LIB(socks, Rconnect, [
- socks=4
- LIBS="-lsocks $LIBS"], [
- AC_MSG_ERROR(Could not find socks library. You must first install socks.) ] ) ] )
- ;;
- esac
- ],
- AC_MSG_RESULT(no)
- )
-
- if test "x$socks" = "x"; then
- AC_MSG_CHECKING(whether to support SOCKS5)
- AC_ARG_WITH(socks5,
- [ --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support.],
- [
- case "$withval" in
- no)
- AC_MSG_RESULT(no)
- ;;
- *)
- AC_MSG_RESULT(yes)
- socks=5
- if test "x$withval" = "xyes"; then
- withval="-lsocks5"
- else
- if test -d "$withval"; then
- if test -d "$withval/include"; then
- CFLAGS="$CFLAGS -I$withval/include"
- else
- CFLAGS="$CFLAGS -I$withval"
- fi
- if test -d "$withval/lib"; then
- withval="-L$withval/lib -lsocks5"
- else
- withval="-L$withval -lsocks5"
- fi
- fi
- fi
- LIBS="$withval $LIBS"
- # If Socks was compiled with Kerberos support, we will need
- # to link against kerberos libraries. Temporarily append
- # to LIBS. This is harmless if there is no kerberos support.
- TMPLIBS="$LIBS"
- LIBS="$LIBS $KERBEROS_LIBS"
- AC_TRY_LINK([],
- [ SOCKSconnect(); ],
- [],
- [ AC_MSG_ERROR(Could not find the $withval library. You must first install socks5.) ])
- LIBS="$TMPLIBS"
- ;;
- esac
- ],
- AC_MSG_RESULT(no)
- )
- fi
-
- if test "x$socks" = "x"; then
- AC_MSG_CHECKING(whether to support SOCKS4)
- AC_ARG_WITH(socks4,
- [ --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support.],
- [
- case "$withval" in
- no)
- AC_MSG_RESULT(no)
- ;;
- *)
- AC_MSG_RESULT(yes)
- socks=4
- if test "x$withval" = "xyes"; then
- withval="-lsocks"
- else
- if test -d "$withval"; then
- withval="-L$withval -lsocks"
- fi
- fi
- LIBS="$withval $LIBS"
- AC_TRY_LINK([],
- [ Rconnect(); ],
- [],
- [ AC_MSG_ERROR(Could not find the $withval library. You must first install socks.) ])
- ;;
- esac
- ],
- AC_MSG_RESULT(no)
- )
- fi
-
- if test "x$socks" = "x4"; then
- AC_DEFINE(SOCKS)
- AC_DEFINE(SOCKS4)
- AC_DEFINE(connect, Rconnect)
- AC_DEFINE(getsockname, Rgetsockname)
- AC_DEFINE(bind, Rbind)
- AC_DEFINE(accept, Raccept)
- AC_DEFINE(listen, Rlisten)
- AC_DEFINE(select, Rselect)
- fi
-
- if test "x$socks" = "x5"; then
- AC_DEFINE(SOCKS)
- AC_DEFINE(SOCKS5)
- AC_DEFINE(connect,SOCKSconnect)
- AC_DEFINE(getsockname,SOCKSgetsockname)
- AC_DEFINE(getpeername,SOCKSgetpeername)
- AC_DEFINE(bind,SOCKSbind)
- AC_DEFINE(accept,SOCKSaccept)
- AC_DEFINE(listen,SOCKSlisten)
- AC_DEFINE(select,SOCKSselect)
- AC_DEFINE(recvfrom,SOCKSrecvfrom)
- AC_DEFINE(sendto,SOCKSsendto)
- AC_DEFINE(recv,SOCKSrecv)
- AC_DEFINE(send,SOCKSsend)
- AC_DEFINE(read,SOCKSread)
- AC_DEFINE(write,SOCKSwrite)
- AC_DEFINE(rresvport,SOCKSrresvport)
- AC_DEFINE(shutdown,SOCKSshutdown)
- AC_DEFINE(listen,SOCKSlisten)
- AC_DEFINE(close,SOCKSclose)
- AC_DEFINE(dup,SOCKSdup)
- AC_DEFINE(dup2,SOCKSdup2)
- AC_DEFINE(fclose,SOCKSfclose)
- AC_DEFINE(gethostbyname,SOCKSgethostbyname)
- fi
-])
diff --git a/contrib/lukemftp/config.h.in b/contrib/lukemftp/config.h.in
deleted file mode 100644
index d754334..0000000
--- a/contrib/lukemftp/config.h.in
+++ /dev/null
@@ -1,275 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* $Id: config.h.in,v 1.28 2002/06/10 08:10:33 lukem Exp $ */
-
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-#undef _ALL_SOURCE
-#endif
-
-/* Define if the closedir function returns void instead of int. */
-#undef CLOSEDIR_VOID
-
-/* Define if the `getpgrp' function takes no argument. */
-#undef GETPGRP_VOID
-
-/* Define if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */
-#undef F77_NO_MINUS_C_MINUS_O
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define to the type of arg1 for select(). */
-#undef SELECT_TYPE_ARG1
-
-/* Define to the type of args 2, 3 and 4 for select(). */
-#undef SELECT_TYPE_ARG234
-
-/* Define to the type of arg5 for select(). */
-#undef SELECT_TYPE_ARG5
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define if the closedir function returns void instead of int. */
-#undef VOID_CLOSEDIR
-
-/* The number of bytes in a off_t. */
-#undef SIZEOF_OFF_T
-
-/* Define if you have the err function. */
-#undef HAVE_ERR
-
-/* Define if you have the fgetln function. */
-#undef HAVE_FGETLN
-
-/* Define if you have the fparseln function. */
-#undef HAVE_FPARSELN
-
-/* Define if you have the fseeko function. */
-#undef HAVE_FSEEKO
-
-/* Define if you have the getaddrinfo function. */
-#undef HAVE_GETADDRINFO
-
-/* Define if you have the gethostbyname2 function. */
-#undef HAVE_GETHOSTBYNAME2
-
-/* Define if you have the getnameinfo function. */
-#undef HAVE_GETNAMEINFO
-
-/* Define if you have the getpassphrase function. */
-#undef HAVE_GETPASSPHRASE
-
-/* Define if you have the getpgrp function. */
-#undef HAVE_GETPGRP
-
-/* Define if you have the inet_ntop function. */
-#undef HAVE_INET_NTOP
-
-/* Define if you have the inet_pton function. */
-#undef HAVE_INET_PTON
-
-/* Define if you have the memmove function. */
-#undef HAVE_MEMMOVE
-
-/* Define if you have the mkstemp function. */
-#undef HAVE_MKSTEMP
-
-/* Define if you have the poll function. */
-#undef HAVE_POLL
-
-/* Define if you have the select function. */
-#undef HAVE_SELECT
-
-/* Define if you have the setprogname function. */
-#undef HAVE_SETPROGNAME
-
-/* Define if you have the sl_init function. */
-#undef HAVE_SL_INIT
-
-/* Define if you have the snprintf function. */
-#undef HAVE_SNPRINTF
-
-/* Define if you have the strdup function. */
-#undef HAVE_STRDUP
-
-/* Define if you have the strerror function. */
-#undef HAVE_STRERROR
-
-/* Define if you have the strlcat function. */
-#undef HAVE_STRLCAT
-
-/* Define if you have the strlcpy function. */
-#undef HAVE_STRLCPY
-
-/* Define if you have the strptime function. */
-#undef HAVE_STRPTIME
-
-/* Define if you have the strsep function. */
-#undef HAVE_STRSEP
-
-/* Define if you have the strtoll function. */
-#undef HAVE_STRTOLL
-
-/* Define if you have the strunvis function. */
-#undef HAVE_STRUNVIS
-
-/* Define if you have the strvis function. */
-#undef HAVE_STRVIS
-
-/* Define if you have the timegm function. */
-#undef HAVE_TIMEGM
-
-/* Define if you have the usleep function. */
-#undef HAVE_USLEEP
-
-/* Define if you have the <arpa/nameser.h> header file. */
-#undef HAVE_ARPA_NAMESER_H
-
-/* Define if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
-
-/* Define if you have the <err.h> header file. */
-#undef HAVE_ERR_H
-
-/* Define if you have the <libutil.h> header file. */
-#undef HAVE_LIBUTIL_H
-
-/* Define if you have the <ndir.h> header file. */
-#undef HAVE_NDIR_H
-
-/* Define if you have the <paths.h> header file. */
-#undef HAVE_PATHS_H
-
-/* Define if you have the <poll.h> header file. */
-#undef HAVE_POLL_H
-
-/* Define if you have the <regex.h> header file. */
-#undef HAVE_REGEX_H
-
-/* Define if you have the <sys/dir.h> header file. */
-#undef HAVE_SYS_DIR_H
-
-/* Define if you have the <sys/ndir.h> header file. */
-#undef HAVE_SYS_NDIR_H
-
-/* Define if you have the <sys/poll.h> header file. */
-#undef HAVE_SYS_POLL_H
-
-/* Define if you have the <termcap.h> header file. */
-#undef HAVE_TERMCAP_H
-
-/* Define if you have the <util.h> header file. */
-#undef HAVE_UTIL_H
-
-/* Define if you have the <vis.h> header file. */
-#undef HAVE_VIS_H
-
-/* Define if you have the nsl library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define if you have the socket library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
-/* Define if you have the tinfo library (-ltinfo). */
-#undef HAVE_LIBTINFO
-
-/* Define if you have the util library (-lutil). */
-#undef HAVE_LIBUTIL
-
-/* Define if your compiler supports `long long' */
-#undef HAVE_LONG_LONG
-
-/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */
-#undef HAVE_PRINTF_QD
-
-/* Define if in_port_t exists */
-#undef HAVE_IN_PORT_T
-
-/* Define if sa_family_t exists in <sys/socket.h> */
-#undef HAVE_SA_FAMILY_T
-
-/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */
-#undef HAVE_SOCKADDR_SA_LEN
-
-/* Define if socklen_t exists */
-#undef HAVE_SOCKLEN_T
-
-/* Define if AF_INET6 exists in <sys/socket.h> */
-#undef HAVE_AF_INET6
-
-/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */
-#undef HAVE_SOCKADDR_IN6
-
-/* Define if `struct addrinfo' exists in <netdb.h> */
-#undef HAVE_ADDRINFO
-
-/*
- * Define if <netdb.h> contains AI_NUMERICHOST et al.
- * Systems which only implement RFC2133 will need this.
- */
-#undef HAVE_RFC2553_NETDB
-
-/* Define if `struct direct' has a d_namlen element */
-#undef HAVE_D_NAMLEN
-
-/* Define if h_errno exists in <netdb.h> */
-#undef HAVE_H_ERRNO_D
-
-/* Define if fclose() is declared in <stdio.h> */
-#undef HAVE_FCLOSE_D
-
-/* Define if getpass() is declared in <stdlib.h> or <unistd.h> */
-#undef HAVE_GETPASS_D
-
-/* Define if optarg is declared in <stdlib.h> or <unistd.h> */
-#undef HAVE_OPTARG_D
-
-/* Define if optind is declared in <stdlib.h> or <unistd.h> */
-#undef HAVE_OPTIND_D
-
-/* Define if pclose() is declared in <stdio.h> */
-#undef HAVE_PCLOSE_D
-
-/* Define if `long long' is supported and sizeof(off_t) >= 8 */
-#undef HAVE_QUAD_SUPPORT
-
-/* Define if strptime() is declared in <time.h> */
-#undef HAVE_STRPTIME_D
-
-/*
- * Define this if compiling with SOCKS (the firewall traversal library).
- * Also, you must define connect, getsockname, bind, accept, listen, and
- * select to their R-versions.
- */
-#undef SOCKS
-#undef SOCKS4
-#undef SOCKS5
-#undef connect
-#undef getsockname
-#undef bind
-#undef accept
-#undef listen
-#undef select
-#undef dup
-#undef dup2
-#undef fclose
-#undef gethostbyname
-#undef getpeername
-#undef read
-#undef recv
-#undef recvfrom
-#undef rresvport
-#undef send
-#undef sendto
-#undef shutdown
-#undef write
diff --git a/contrib/lukemftp/configure b/contrib/lukemftp/configure
deleted file mode 100755
index f759085..0000000
--- a/contrib/lukemftp/configure
+++ /dev/null
@@ -1,4229 +0,0 @@
-#! /bin/sh
-
-# From configure.in Revision: 1.37
-
-
-
-
-
-
-
-
-
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Defaults:
-ac_help=
-ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
-\
- --enable-editcomplete Turn on command line editing and completion.
- --disable-editcomplete Turn off command line editing and completion
- [default: enabled]."
-ac_help="$ac_help
-\
- --enable-ipv6 Enable IPv6 support (if your OS supports it).
- --disable-ipv6 Disable IPv6 support (even if your OS supports it)
- [default: enabled]."
-ac_help="$ac_help
- --with-socks Compile with SOCKS firewall traversal support."
-ac_help="$ac_help
- --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support."
-ac_help="$ac_help
- --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support."
-
-# Initialize some variables set by options.
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
-exec_prefix=NONE
-host=NONE
-no_create=
-nonopt=NONE
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-target=NONE
-verbose=
-x_includes=NONE
-x_libraries=NONE
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
-ac_prev=
-for ac_option
-do
-
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
- ac_prev=
- continue
- fi
-
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
-
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
- datadir="$ac_optarg" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
-
- -enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
- *) ac_optarg=yes ;;
- esac
- eval "with_${ac_package}='$ac_optarg'" ;;
-
- -without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
- # Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
-
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
- ;;
-
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
-
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
-do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
-
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=lukemftp.h
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
- srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
- else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
- fi
-fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
-fi
-for ac_site_file in $CONFIG_SITE; do
- if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
- . "$ac_site_file"
- fi
-done
-
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
-
-
-
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $. echo might interpret backslashes.
- cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
-fi
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-
-# Check whether --enable-editcomplete or --disable-editcomplete was given.
-if test "${enable_editcomplete+set}" = set; then
- enableval="$enable_editcomplete"
- opt_editcomplete=$enableval
-else
- opt_editcomplete=yes
-fi
-
-# Check whether --enable-ipv6 or --disable-ipv6 was given.
-if test "${enable_ipv6+set}" = set; then
- enableval="$enable_ipv6"
- opt_ipv6=$enableval
-else
- opt_ipv6=yes
-fi
-
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:590: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-# Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:619: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:649: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# -gt 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
- fi
-fi
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
- if test -z "$CC"; then
- case "`uname -s`" in
- *win32* | *WIN32*)
- # Extract the first word of "cl", so it can be a program name with args.
-set dummy cl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:700: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="cl"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-CC="$ac_cv_prog_CC"
-if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
- ;;
- esac
- fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:732: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
-
-#line 743 "configure"
-#include "confdefs.h"
-
-main(){return(0);}
-EOF
-if { (eval echo configure:748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
-fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
-fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:774: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
-
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:779: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi
-fi
-
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
-else
- GCC=
-fi
-
-ac_test_CFLAGS="${CFLAGS+set}"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS=
-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:807: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
-else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-
-for ac_prog in mawk gawk nawk awk
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:843: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AWK="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-AWK="$ac_cv_prog_AWK"
-if test -n "$AWK"; then
- echo "$ac_t""$AWK" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$AWK" && break
-done
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f $ac_dir/install.sh; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:903: checking for a BSD compatible install" >&5
-if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
- done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
- else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the path is relative.
- INSTALL="$ac_install_sh"
- fi
-fi
-echo "$ac_t""$INSTALL" 1>&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:958: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-for ac_prog in ar
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:990: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AR="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-AR="$ac_cv_prog_AR"
-if test -n "$AR"; then
- echo "$ac_t""$AR" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-test -n "$AR" && break
-done
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1020: checking how to run the C preprocessor" >&5
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 1035 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 1052 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 1069 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
-else
- ac_cv_prog_CPP="$CPP"
-fi
-echo "$ac_t""$CPP" 1>&6
-
-echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:1100: checking for AIX" >&5
-cat > conftest.$ac_ext <<EOF
-#line 1102 "configure"
-#include "confdefs.h"
-#ifdef _AIX
- yes
-#endif
-
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
-#define _ALL_SOURCE 1
-EOF
-
-else
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
-fi
-rm -f conftest*
-
-
-
-
-echo $ac_n "checking for fparseln in -lutil""... $ac_c" 1>&6
-echo "configure:1126: checking for fparseln in -lutil" >&5
-ac_lib_var=`echo util'_'fparseln | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lutil $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1134 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char fparseln();
-
-int main() {
-fparseln()
-; return 0; }
-EOF
-if { (eval echo configure:1145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo util | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lutil $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-if test $opt_editcomplete = yes; then
- echo $ac_n "checking for tgetent in -ltinfo""... $ac_c" 1>&6
-echo "configure:1174: checking for tgetent in -ltinfo" >&5
-ac_lib_var=`echo tinfo'_'tgetent | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-ltinfo $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1182 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char tgetent();
-
-int main() {
-tgetent()
-; return 0; }
-EOF
-if { (eval echo configure:1193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo tinfo | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-ltinfo $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:1219: checking for tgetent in -ltermcap" >&5
-ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-ltermcap $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1227 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char tgetent();
-
-int main() {
-tgetent()
-; return 0; }
-EOF
-if { (eval echo configure:1238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo termcap | sed -e 's/^a-zA-Z0-9_/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-ltermcap $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:1264: checking for tgetent in -lcurses" >&5
-ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lcurses $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1272 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char tgetent();
-
-int main() {
-tgetent()
-; return 0; }
-EOF
-if { (eval echo configure:1283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo curses | sed -e 's/^a-zA-Z0-9_/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lcurses $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:1309: checking for tgetent in -lncurses" >&5
-ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lncurses $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1317 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char tgetent();
-
-int main() {
-tgetent()
-; return 0; }
-EOF
-if { (eval echo configure:1328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/^a-zA-Z0-9_/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lncurses $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-fi
-
-fi
-
-
-echo $ac_n "checking for library containing el_init""... $ac_c" 1>&6
-echo "configure:1363: checking for library containing el_init" >&5
-if eval "test \"`echo '$''{'ac_cv_search_el_init'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_func_search_save_LIBS="$LIBS"
-ac_cv_search_el_init="no"
-cat > conftest.$ac_ext <<EOF
-#line 1370 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char el_init();
-
-int main() {
-el_init()
-; return 0; }
-EOF
-if { (eval echo configure:1381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ac_cv_search_el_init="none required"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-test "$ac_cv_search_el_init" = "no" && for i in edit; do
-LIBS="-l$i $ac_func_search_save_LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1392 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char el_init();
-
-int main() {
-el_init()
-; return 0; }
-EOF
-if { (eval echo configure:1403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ac_cv_search_el_init="-l$i"
-break
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-done
-LIBS="$ac_func_search_save_LIBS"
-fi
-
-echo "$ac_t""$ac_cv_search_el_init" 1>&6
-if test "$ac_cv_search_el_init" != "no"; then
- test "$ac_cv_search_el_init" = "none required" || LIBS="$ac_cv_search_el_init $LIBS"
- have_libedit=yes
-else :
- have_libedit=no
-fi
-fi
-
- # Most operating systems have gethostbyname() in the default searched
- # libraries (i.e. libc):
- echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1428: checking for gethostbyname" >&5
-if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1433 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char gethostbyname(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
-choke me
-#else
-gethostbyname();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_gethostbyname=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_gethostbyname=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-# Some OSes (eg. Solaris) place it in libnsl:
- echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1475: checking for gethostbyname in -lnsl" >&5
-ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lnsl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1483 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname();
-
-int main() {
-gethostbyname()
-; return 0; }
-EOF
-if { (eval echo configure:1494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/^a-zA-Z0-9_/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lnsl $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-# Some strange OSes (SINIX) have it in libsocket:
- echo $ac_n "checking for gethostbyname in -lsocket""... $ac_c" 1>&6
-echo "configure:1521: checking for gethostbyname in -lsocket" >&5
-ac_lib_var=`echo socket'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lsocket $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1529 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname();
-
-int main() {
-gethostbyname()
-; return 0; }
-EOF
-if { (eval echo configure:1540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/^a-zA-Z0-9_/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lsocket $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-# Unfortunately libsocket sometimes depends on libnsl.
- # AC_CHECK_LIB's API is essentially broken so the following
- # ugliness is necessary:
- echo $ac_n "checking for gethostbyname in -lsocket""... $ac_c" 1>&6
-echo "configure:1569: checking for gethostbyname in -lsocket" >&5
-ac_lib_var=`echo socket'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lsocket -lnsl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1577 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname();
-
-int main() {
-gethostbyname()
-; return 0; }
-EOF
-if { (eval echo configure:1588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="-lsocket -lnsl $LIBS"
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for gethostbyname in -lresolv""... $ac_c" 1>&6
-echo "configure:1607: checking for gethostbyname in -lresolv" >&5
-ac_lib_var=`echo resolv'_'gethostbyname | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lresolv $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1615 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char gethostbyname();
-
-int main() {
-gethostbyname()
-; return 0; }
-EOF
-if { (eval echo configure:1626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/^a-zA-Z0-9_/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lresolv $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:1665: checking for socket" >&5
-if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1670 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char socket(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char socket();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_socket) || defined (__stub___socket)
-choke me
-#else
-socket();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:1693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_socket=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_socket=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1711: checking for socket in -lsocket" >&5
-ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lsocket $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1719 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char socket();
-
-int main() {
-socket()
-; return 0; }
-EOF
-if { (eval echo configure:1730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/^a-zA-Z0-9_/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
- LIBS="-lsocket $LIBS"
-
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1756: checking for socket in -lsocket" >&5
-ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lsocket -lnsl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1764 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char socket();
-
-int main() {
-socket()
-; return 0; }
-EOF
-if { (eval echo configure:1775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="-lsocket -lnsl $LIBS"
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-fi
-
-
-
- echo $ac_n "checking whether to support SOCKS""... $ac_c" 1>&6
-echo "configure:1802: checking whether to support SOCKS" >&5
- # Check whether --with-socks or --without-socks was given.
-if test "${with_socks+set}" = set; then
- withval="$with_socks"
-
- case "$withval" in
- no)
- echo "$ac_t""no" 1>&6
- ;;
- yes)
- echo "$ac_t""yes" 1>&6
- echo $ac_n "checking for SOCKSconnect in -lsocks5""... $ac_c" 1>&6
-echo "configure:1814: checking for SOCKSconnect in -lsocks5" >&5
-ac_lib_var=`echo socks5'_'SOCKSconnect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lsocks5 $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1822 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char SOCKSconnect();
-
-int main() {
-SOCKSconnect()
-; return 0; }
-EOF
-if { (eval echo configure:1833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- socks=5
- LIBS="-lsocks5 $LIBS"
-else
- echo "$ac_t""no" 1>&6
-
- echo $ac_n "checking for Rconnect in -lsocks""... $ac_c" 1>&6
-echo "configure:1855: checking for Rconnect in -lsocks" >&5
-ac_lib_var=`echo socks'_'Rconnect | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lsocks $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1863 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char Rconnect();
-
-int main() {
-Rconnect()
-; return 0; }
-EOF
-if { (eval echo configure:1874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-
- socks=4
- LIBS="-lsocks $LIBS"
-else
- echo "$ac_t""no" 1>&6
-
- { echo "configure: error: Could not find socks library. You must first install socks." 1>&2; exit 1; }
-fi
-
-fi
-
- ;;
- esac
-
-else
- echo "$ac_t""no" 1>&6
-
-fi
-
-
- if test "x$socks" = "x"; then
- echo $ac_n "checking whether to support SOCKS5""... $ac_c" 1>&6
-echo "configure:1911: checking whether to support SOCKS5" >&5
- # Check whether --with-socks5 or --without-socks5 was given.
-if test "${with_socks5+set}" = set; then
- withval="$with_socks5"
-
- case "$withval" in
- no)
- echo "$ac_t""no" 1>&6
- ;;
- *)
- echo "$ac_t""yes" 1>&6
- socks=5
- if test "x$withval" = "xyes"; then
- withval="-lsocks5"
- else
- if test -d "$withval"; then
- if test -d "$withval/include"; then
- CFLAGS="$CFLAGS -I$withval/include"
- else
- CFLAGS="$CFLAGS -I$withval"
- fi
- if test -d "$withval/lib"; then
- withval="-L$withval/lib -lsocks5"
- else
- withval="-L$withval -lsocks5"
- fi
- fi
- fi
- LIBS="$withval $LIBS"
- # If Socks was compiled with Kerberos support, we will need
- # to link against kerberos libraries. Temporarily append
- # to LIBS. This is harmless if there is no kerberos support.
- TMPLIBS="$LIBS"
- LIBS="$LIBS $KERBEROS_LIBS"
- cat > conftest.$ac_ext <<EOF
-#line 1946 "configure"
-#include "confdefs.h"
-
-int main() {
- SOCKSconnect();
-; return 0; }
-EOF
-if { (eval echo configure:1953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Could not find the $withval library. You must first install socks5." 1>&2; exit 1; }
-fi
-rm -f conftest*
- LIBS="$TMPLIBS"
- ;;
- esac
-
-else
- echo "$ac_t""no" 1>&6
-
-fi
-
- fi
-
- if test "x$socks" = "x"; then
- echo $ac_n "checking whether to support SOCKS4""... $ac_c" 1>&6
-echo "configure:1975: checking whether to support SOCKS4" >&5
- # Check whether --with-socks4 or --without-socks4 was given.
-if test "${with_socks4+set}" = set; then
- withval="$with_socks4"
-
- case "$withval" in
- no)
- echo "$ac_t""no" 1>&6
- ;;
- *)
- echo "$ac_t""yes" 1>&6
- socks=4
- if test "x$withval" = "xyes"; then
- withval="-lsocks"
- else
- if test -d "$withval"; then
- withval="-L$withval -lsocks"
- fi
- fi
- LIBS="$withval $LIBS"
- cat > conftest.$ac_ext <<EOF
-#line 1996 "configure"
-#include "confdefs.h"
-
-int main() {
- Rconnect();
-; return 0; }
-EOF
-if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- { echo "configure: error: Could not find the $withval library. You must first install socks." 1>&2; exit 1; }
-fi
-rm -f conftest*
- ;;
- esac
-
-else
- echo "$ac_t""no" 1>&6
-
-fi
-
- fi
-
- if test "x$socks" = "x4"; then
- cat >> confdefs.h <<\EOF
-#define SOCKS 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define SOCKS4 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define connect Rconnect
-EOF
-
- cat >> confdefs.h <<\EOF
-#define getsockname Rgetsockname
-EOF
-
- cat >> confdefs.h <<\EOF
-#define bind Rbind
-EOF
-
- cat >> confdefs.h <<\EOF
-#define accept Raccept
-EOF
-
- cat >> confdefs.h <<\EOF
-#define listen Rlisten
-EOF
-
- cat >> confdefs.h <<\EOF
-#define select Rselect
-EOF
-
- fi
-
- if test "x$socks" = "x5"; then
- cat >> confdefs.h <<\EOF
-#define SOCKS 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define SOCKS5 1
-EOF
-
- cat >> confdefs.h <<\EOF
-#define connect SOCKSconnect
-EOF
-
- cat >> confdefs.h <<\EOF
-#define getsockname SOCKSgetsockname
-EOF
-
- cat >> confdefs.h <<\EOF
-#define getpeername SOCKSgetpeername
-EOF
-
- cat >> confdefs.h <<\EOF
-#define bind SOCKSbind
-EOF
-
- cat >> confdefs.h <<\EOF
-#define accept SOCKSaccept
-EOF
-
- cat >> confdefs.h <<\EOF
-#define listen SOCKSlisten
-EOF
-
- cat >> confdefs.h <<\EOF
-#define select SOCKSselect
-EOF
-
- cat >> confdefs.h <<\EOF
-#define recvfrom SOCKSrecvfrom
-EOF
-
- cat >> confdefs.h <<\EOF
-#define sendto SOCKSsendto
-EOF
-
- cat >> confdefs.h <<\EOF
-#define recv SOCKSrecv
-EOF
-
- cat >> confdefs.h <<\EOF
-#define send SOCKSsend
-EOF
-
- cat >> confdefs.h <<\EOF
-#define read SOCKSread
-EOF
-
- cat >> confdefs.h <<\EOF
-#define write SOCKSwrite
-EOF
-
- cat >> confdefs.h <<\EOF
-#define rresvport SOCKSrresvport
-EOF
-
- cat >> confdefs.h <<\EOF
-#define shutdown SOCKSshutdown
-EOF
-
- cat >> confdefs.h <<\EOF
-#define listen SOCKSlisten
-EOF
-
- cat >> confdefs.h <<\EOF
-#define close SOCKSclose
-EOF
-
- cat >> confdefs.h <<\EOF
-#define dup SOCKSdup
-EOF
-
- cat >> confdefs.h <<\EOF
-#define dup2 SOCKSdup2
-EOF
-
- cat >> confdefs.h <<\EOF
-#define fclose SOCKSfclose
-EOF
-
- cat >> confdefs.h <<\EOF
-#define gethostbyname SOCKSgethostbyname
-EOF
-
- fi
-
-if test -n "$socks"; then
- if test $opt_ipv6 = yes; then
- echo "IPv6 is incompatible with socks, disabling IPv6 support"
- opt_ipv6=no
- fi
-fi
-
-
-
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:2166: checking for $ac_hdr that defines DIR" >&5
-if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2171 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <$ac_hdr>
-int main() {
-DIR *dirp = 0;
-; return 0; }
-EOF
-if { (eval echo configure:2179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- eval "ac_cv_header_dirent_$ac_safe=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_dirent_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
- ac_header_dirent=$ac_hdr; break
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
-echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2204: checking for opendir in -ldir" >&5
-ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-ldir $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2212 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char opendir();
-
-int main() {
-opendir()
-; return 0; }
-EOF
-if { (eval echo configure:2223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -ldir"
-else
- echo "$ac_t""no" 1>&6
-fi
-
-else
-echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2245: checking for opendir in -lx" >&5
-ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lx $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2253 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char opendir();
-
-int main() {
-opendir()
-; return 0; }
-EOF
-if { (eval echo configure:2264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lx"
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2287: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2292 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- ac_cv_header_stdc=yes
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 2317 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 2335 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
-else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 2356 "configure"
-#include "confdefs.h"
-#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
-
-EOF
-if { (eval echo configure:2367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
-fi
-
-fi
-fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
-if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-for ac_hdr in arpa/nameser.h err.h regex.h paths.h poll.h sys/poll.h \
- termcap.h util.h libutil.h vis.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2395: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2400 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-
-
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2434: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2439 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:2448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_time=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_time=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
- cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
-EOF
-
-fi
-
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2469: checking for off_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2474 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_off_t=yes
-else
- rm -rf conftest*
- ac_cv_type_off_t=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
- cat >> confdefs.h <<\EOF
-#define off_t long
-EOF
-
-fi
-
-echo $ac_n "checking size of off_t""... $ac_c" 1>&6
-echo "configure:2502: checking size of off_t" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_sizeof_off_t=0
-else
- cat > conftest.$ac_ext <<EOF
-#line 2510 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(off_t));
- exit(0);
-}
-EOF
-if { (eval echo configure:2521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_cv_sizeof_off_t=`cat conftestval`
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_sizeof_off_t=0
-fi
-rm -fr conftest*
-fi
-
-fi
-echo "$ac_t""$ac_cv_sizeof_off_t" 1>&6
-cat >> confdefs.h <<EOF
-#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
-EOF
-
-
-
- echo $ac_n "checking for long long""... $ac_c" 1>&6
-echo "configure:2542: checking for long long" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_LONG_LONG'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2548 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-int main() {
-
-long long X = 2, Y = 1, Z;
-Z = X / Y; ;
-; return 0; }
-EOF
-if { (eval echo configure:2558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- ftp_cv_HAVE_LONG_LONG=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_LONG_LONG=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_LONG_LONG" 1>&6
- if test "x$ftp_cv_HAVE_LONG_LONG" = "xyes"; then
-
-cat >> confdefs.h <<\EOF
-#define HAVE_LONG_LONG 1
-EOF
-
-have_long_long=yes
- else
- have_long_long=no
- :
- fi
-
-
-
- echo $ac_n "checking for in_port_t""... $ac_c" 1>&6
-echo "configure:2587: checking for in_port_t" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_IN_PORT_T'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2593 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <netinet/in.h>
-int main() {
- in_port_t X ;
-; return 0; }
-EOF
-if { (eval echo configure:2602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_IN_PORT_T=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_IN_PORT_T=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_IN_PORT_T" 1>&6
- if test "x$ftp_cv_HAVE_IN_PORT_T" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_IN_PORT_T 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for sa_family_t""... $ac_c" 1>&6
-echo "configure:2629: checking for sa_family_t" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_SA_FAMILY_T'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2635 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-int main() {
- sa_family_t X ;
-; return 0; }
-EOF
-if { (eval echo configure:2644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_SA_FAMILY_T=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_SA_FAMILY_T=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_SA_FAMILY_T" 1>&6
- if test "x$ftp_cv_HAVE_SA_FAMILY_T" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SA_FAMILY_T 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for sockaddr_in.sin_len""... $ac_c" 1>&6
-echo "configure:2671: checking for sockaddr_in.sin_len" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKADDR_SA_LEN'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2677 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-int main() {
-
- struct sockaddr_in sin;
- int X = sin.sin_len ;
-; return 0; }
-EOF
-if { (eval echo configure:2689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_SOCKADDR_SA_LEN=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_SOCKADDR_SA_LEN=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_SOCKADDR_SA_LEN" 1>&6
- if test "x$ftp_cv_HAVE_SOCKADDR_SA_LEN" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SOCKADDR_SA_LEN 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:2716: checking for socklen_t" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKLEN_T'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2722 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-int main() {
- socklen_t X ;
-; return 0; }
-EOF
-if { (eval echo configure:2731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_SOCKLEN_T=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_SOCKLEN_T=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_SOCKLEN_T" 1>&6
- if test "x$ftp_cv_HAVE_SOCKLEN_T" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SOCKLEN_T 1
-EOF
-
- else
-
- :
- fi
-
-
-if test $opt_ipv6 = yes; then
-
-
- echo $ac_n "checking for AF_INET6""... $ac_c" 1>&6
-echo "configure:2760: checking for AF_INET6" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_AF_INET6'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2766 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-int main() {
- int X = AF_INET6 ;
-; return 0; }
-EOF
-if { (eval echo configure:2775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_AF_INET6=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_AF_INET6=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_AF_INET6" 1>&6
- if test "x$ftp_cv_HAVE_AF_INET6" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_AF_INET6 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for struct sockaddr_in6""... $ac_c" 1>&6
-echo "configure:2802: checking for struct sockaddr_in6" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKADDR_IN6'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2808 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <netinet/in.h>
-int main() {
- struct sockaddr_in6 X ;
-; return 0; }
-EOF
-if { (eval echo configure:2817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_SOCKADDR_IN6=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_SOCKADDR_IN6=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_SOCKADDR_IN6" 1>&6
- if test "x$ftp_cv_HAVE_SOCKADDR_IN6" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SOCKADDR_IN6 1
-EOF
-
- else
-
- :
- fi
-
-
-fi
-
-
- echo $ac_n "checking for struct addrinfo""... $ac_c" 1>&6
-echo "configure:2846: checking for struct addrinfo" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_ADDRINFO'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2852 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-int main() {
- struct addrinfo X ;
-; return 0; }
-EOF
-if { (eval echo configure:2862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_ADDRINFO=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_ADDRINFO=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_ADDRINFO" 1>&6
- if test "x$ftp_cv_HAVE_ADDRINFO" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ADDRINFO 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for d_namlen in struct dirent""... $ac_c" 1>&6
-echo "configure:2889: checking for d_namlen in struct dirent" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_D_NAMLEN'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2895 "configure"
-#include "confdefs.h"
-
-#if HAVE_DIRENT_H
-# include <dirent.h>
-#else
-# define dirent direct
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
-int main() {
-
- struct dirent dp;
- int X = dp.d_namlen; ;
-; return 0; }
-EOF
-if { (eval echo configure:2918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_D_NAMLEN=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_D_NAMLEN=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_D_NAMLEN" 1>&6
- if test "x$ftp_cv_HAVE_D_NAMLEN" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_D_NAMLEN 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for h_errno declaration""... $ac_c" 1>&6
-echo "configure:2945: checking for h_errno declaration" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_H_ERRNO_D'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2951 "configure"
-#include "confdefs.h"
-
-#include <netdb.h>
-int main() {
- int X = h_errno ;
-; return 0; }
-EOF
-if { (eval echo configure:2959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_H_ERRNO_D=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_H_ERRNO_D=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_H_ERRNO_D" 1>&6
- if test "x$ftp_cv_HAVE_H_ERRNO_D" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_H_ERRNO_D 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for fclose() declaration""... $ac_c" 1>&6
-echo "configure:2986: checking for fclose() declaration" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_FCLOSE_D'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 2992 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-int main() {
- int (*X)() = fclose ;
-; return 0; }
-EOF
-if { (eval echo configure:3000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_FCLOSE_D=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_FCLOSE_D=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_FCLOSE_D" 1>&6
- if test "x$ftp_cv_HAVE_FCLOSE_D" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_FCLOSE_D 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for getpass() declaration""... $ac_c" 1>&6
-echo "configure:3027: checking for getpass() declaration" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_GETPASS_D'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3033 "configure"
-#include "confdefs.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-int main() {
- char *(*X)() = getpass ;
-; return 0; }
-EOF
-if { (eval echo configure:3042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_GETPASS_D=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_GETPASS_D=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_GETPASS_D" 1>&6
- if test "x$ftp_cv_HAVE_GETPASS_D" = "xyes"; then
-
- cat >> confdefs.h <<\EOF
-#define HAVE_GETPASS_D 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for optarg declaration""... $ac_c" 1>&6
-echo "configure:3070: checking for optarg declaration" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_OPTARG_D'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3076 "configure"
-#include "confdefs.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-int main() {
- char *X = optarg ;
-; return 0; }
-EOF
-if { (eval echo configure:3085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_OPTARG_D=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_OPTARG_D=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_OPTARG_D" 1>&6
- if test "x$ftp_cv_HAVE_OPTARG_D" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_OPTARG_D 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for optind declaration""... $ac_c" 1>&6
-echo "configure:3112: checking for optind declaration" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_OPTIND_D'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3118 "configure"
-#include "confdefs.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-int main() {
- int X = optind ;
-; return 0; }
-EOF
-if { (eval echo configure:3127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_OPTIND_D=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_OPTIND_D=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_OPTIND_D" 1>&6
- if test "x$ftp_cv_HAVE_OPTIND_D" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_OPTIND_D 1
-EOF
-
- else
-
- :
- fi
-
-
-
- echo $ac_n "checking for pclose() declaration""... $ac_c" 1>&6
-echo "configure:3154: checking for pclose() declaration" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_PCLOSE_D'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3160 "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-int main() {
- int (*X)() = pclose ;
-; return 0; }
-EOF
-if { (eval echo configure:3168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_PCLOSE_D=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_PCLOSE_D=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_PCLOSE_D" 1>&6
- if test "x$ftp_cv_HAVE_PCLOSE_D" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_PCLOSE_D 1
-EOF
-
- else
-
- :
- fi
-
-
-
-for ac_func in err fgetln fseeko getaddrinfo getnameinfo inet_ntop inet_pton \
- mkstemp setprogname sl_init snprintf strdup strerror strlcat \
- strlcpy strptime strsep strunvis strvis timegm usleep
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3199: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3204 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:3227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
-fi
-done
-
-
-for ac_func in gethostbyname2 getpassphrase getpgrp memmove poll select
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3256: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3261 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:3284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
-if test $ac_cv_func_getpgrp = yes; then
- echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3310: checking whether getpgrp takes no argument" >&5
-if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
-else
- cat > conftest.$ac_ext <<EOF
-#line 3318 "configure"
-#include "confdefs.h"
-
-/*
- * If this system has a BSD-style getpgrp(),
- * which takes a pid argument, exit unsuccessfully.
- *
- * Snarfed from Chet Ramey's bash pgrp.c test program
- */
-#include <stdio.h>
-#include <sys/types.h>
-
-int pid;
-int pg1, pg2, pg3, pg4;
-int ng, np, s, child;
-
-main()
-{
- pid = getpid();
- pg1 = getpgrp(0);
- pg2 = getpgrp();
- pg3 = getpgrp(pid);
- pg4 = getpgrp(1);
-
- /*
- * If all of these values are the same, it's pretty sure that
- * we're on a system that ignores getpgrp's first argument.
- */
- if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
- exit(0);
-
- child = fork();
- if (child < 0)
- exit(1);
- else if (child == 0) {
- np = getpid();
- /*
- * If this is Sys V, this will not work; pgrp will be
- * set to np because setpgrp just changes a pgrp to be
- * the same as the pid.
- */
- setpgrp(np, pg1);
- ng = getpgrp(0); /* Same result for Sys V and BSD */
- if (ng == pg1) {
- exit(1);
- } else {
- exit(0);
- }
- } else {
- wait(&s);
- exit(s>>8);
- }
-}
-
-EOF
-if { (eval echo configure:3373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_getpgrp_void=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_getpgrp_void=no
-fi
-rm -fr conftest*
-fi
-
-
-fi
-
-echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6
-if test $ac_cv_func_getpgrp_void = yes; then
- cat >> confdefs.h <<\EOF
-#define GETPGRP_VOID 1
-EOF
-
-fi
-
-fi
-if test $ac_cv_lib_util_fparseln != yes; then
- for ac_func in fparseln
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3401: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3406 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:3429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
-fi
-done
-
-
-fi
-
-LIBOBJS="$LIBOBJS glob.o"
-
-if test $ac_cv_func_strptime = yes; then
-
- echo $ac_n "checking for strptime() declaration""... $ac_c" 1>&6
-echo "configure:3462: checking for strptime() declaration" >&5
-if eval "test \"`echo '$''{'ftp_cv_HAVE_STRPTIME_D'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3468 "configure"
-#include "confdefs.h"
-
- #include <time.h>
-int main() {
- char *X = strptime("", "", NULL) ;
-; return 0; }
-EOF
-if { (eval echo configure:3476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_HAVE_STRPTIME_D=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_HAVE_STRPTIME_D=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_HAVE_STRPTIME_D" 1>&6
- if test "x$ftp_cv_HAVE_STRPTIME_D" = "xyes"; then
- cat >> confdefs.h <<\EOF
-#define HAVE_STRPTIME_D 1
-EOF
-
- else
-
- :
- fi
-
-fi
-
-if test $have_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
-
-
- echo $ac_n "checking *printf() support for %lld""... $ac_c" 1>&6
-echo "configure:3506: checking *printf() support for %lld" >&5
- can_printf_longlong=no
- if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 3512 "configure"
-#include "confdefs.h"
-
- #include <stdio.h>
- int main() {
- char buf[100];
- sprintf(buf, "%lld", 4294967300LL);
- return (strcmp(buf, "4294967300"));
- }
-
-EOF
-if { (eval echo configure:3523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-
- echo "$ac_t""yes" 1>&6
- can_printf_longlong=yes
-
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
-
- echo "$ac_t""no" 1>&6
-
-fi
-rm -fr conftest*
-fi
-
-
- if test $can_printf_longlong != yes; then
- echo $ac_n "checking *printf() support for %qd""... $ac_c" 1>&6
-echo "configure:3543: checking *printf() support for %qd" >&5
- if test "$cross_compiling" = yes; then
- :
-else
- cat > conftest.$ac_ext <<EOF
-#line 3548 "configure"
-#include "confdefs.h"
-
- #include <stdio.h>
- int main() {
- char buf[100];
- sprintf(buf, "%qd", 4294967300LL);
- return (strcmp(buf, "4294967300"));
- }
-
-EOF
-if { (eval echo configure:3559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
-
- echo "$ac_t""yes" 1>&6
- can_printf_longlong=yes
- cat >> confdefs.h <<\EOF
-#define HAVE_PRINTF_QD 1
-EOF
-
-
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
-
- echo "$ac_t""no" 1>&6
-
-fi
-rm -fr conftest*
-fi
-
- fi
-
- if test $can_printf_longlong = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_QUAD_SUPPORT 1
-EOF
-
- for ac_func in strtoll
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3590: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3595 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-$ac_func();
-#endif
-
-; return 0; }
-EOF
-if { (eval echo configure:3618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
-fi
-done
-
-
- fi
-
-fi
-
-
-if test $opt_editcomplete = yes; then
- if test $have_libedit = yes; then
-
- echo $ac_n "checking for EL_RPROMPT in libedit""... $ac_c" 1>&6
-echo "configure:3653: checking for EL_RPROMPT in libedit" >&5
-if eval "test \"`echo '$''{'ftp_cv_have_libedit'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3659 "configure"
-#include "confdefs.h"
-
- #include <histedit.h>
-int main() {
- int X = EL_RPROMPT ;
-; return 0; }
-EOF
-if { (eval echo configure:3667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_have_libedit=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_have_libedit=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_have_libedit" 1>&6
- if test "x$ftp_cv_have_libedit" = "xyes"; then
- :
- else
- have_libedit=no
- :
- fi
-
- fi
-
- echo $ac_n "checking for working libedit""... $ac_c" 1>&6
-echo "configure:3691: checking for working libedit" >&5
- if test $have_libedit = no; then
- echo "$ac_t""no - using my own" 1>&6
- INCLUDES="-I\${srcdir}/../libedit $INCLUDES"
- LDFLAGS="-L../libedit $LDFLAGS"
- LIBS="-ledit $LIBS"
- LIBEDIT=libedit.a
- LIBDEPENDS="$LIBDEPENDS ../libedit/libedit.a"
- else
- echo "$ac_t""yes" 1>&6
- fi
-else
- CFLAGS="-DNO_EDITCOMPLETE $CFLAGS"
-fi
-
-if test $ac_cv_func_sl_init = yes; then
-
- echo $ac_n "checking if sl_add() returns int""... $ac_c" 1>&6
-echo "configure:3709: checking if sl_add() returns int" >&5
-if eval "test \"`echo '$''{'ftp_cv_INT_SL_ADD'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3715 "configure"
-#include "confdefs.h"
-
- #include <stringlist.h>
-int main() {
- int f = sl_add((StringList *)0, "foo") ;
-; return 0; }
-EOF
-if { (eval echo configure:3723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_INT_SL_ADD=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_INT_SL_ADD=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_INT_SL_ADD" 1>&6
- if test "x$ftp_cv_INT_SL_ADD" = "xyes"; then
- :
- else
- LIBOBJS="$LIBOBJS sl_init.o"
- :
- fi
-
-fi
-
-
-have_rfc2553_netdb=no
-if test $ac_cv_func_getaddrinfo = yes -a ! -n "$socks"; then
-
- echo $ac_n "checking for AI_NUMERICHOST""... $ac_c" 1>&6
-echo "configure:3751: checking for AI_NUMERICHOST" >&5
-if eval "test \"`echo '$''{'ftp_cv_have_ai_numerichost'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3757 "configure"
-#include "confdefs.h"
-
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
-int main() {
- int X = AI_NUMERICHOST ;
-; return 0; }
-EOF
-if { (eval echo configure:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_have_ai_numerichost=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_have_ai_numerichost=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_have_ai_numerichost" 1>&6
- if test "x$ftp_cv_have_ai_numerichost" = "xyes"; then
- have_rfc2553_netdb=yes
- else
-
- :
- fi
-
-fi
-echo $ac_n "checking for working getaddrinfo()""... $ac_c" 1>&6
-echo "configure:3790: checking for working getaddrinfo()" >&5
-if test $have_rfc2553_netdb = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_RFC2553_NETDB 1
-EOF
-
- echo "$ac_t""yes" 1>&6
-else
- if test $ac_cv_func_getaddrinfo = yes; then
- LIBOBJS="$LIBOBJS getaddrinfo.o"
- echo "$ac_t""no - using local version" 1>&6
- else
- echo "$ac_t""using local version" 1>&6
- fi
-fi
-
-
-if test $ac_cv_header_vis_h = yes; then
-
- echo $ac_n "checking for VIS_WHITE in vis.h""... $ac_c" 1>&6
-echo "configure:3810: checking for VIS_WHITE in vis.h" >&5
-if eval "test \"`echo '$''{'ftp_cv_have_vis_white'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
-
- cat > conftest.$ac_ext <<EOF
-#line 3816 "configure"
-#include "confdefs.h"
-
- #include <sys/types.h>
- #include <vis.h>
-int main() {
- int X = VIS_WHITE ;
-; return 0; }
-EOF
-if { (eval echo configure:3825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ftp_cv_have_vis_white=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ftp_cv_have_vis_white=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$ftp_cv_have_vis_white" 1>&6
- if test "x$ftp_cv_have_vis_white" = "xyes"; then
- :
- else
- ac_cv_header_vis_h=no
- :
- fi
-
-fi
-
-
-if test -n "$LIBOBJS"; then
- INCLUDES="$INCLUDES -I\${srcdir}/../libukem"
- LDFLAGS="$LDFLAGS -L../libukem"
- LIBS="$LIBS -lukem"
- LIBUKEM=libukem.a
- LIBDEPENDS="$LIBDEPENDS ../libukem/libukem.a"
-fi
-
-
-
-
-
-
-
-trap '' 1 2 15
-cat > confcache <<\EOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-EOF
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
- else
- echo "not updating unwritable cache $cache_file"
- fi
-fi
-rm -f confcache
-
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-DEFS=-DHAVE_CONFIG_H
-
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
-
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
-do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
-
-trap 'rm -fr `echo "Makefile libedit/Makefile libedit/makelist libukem/Makefile \
- src/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@CC@%$CC%g
-s%@AWK@%$AWK%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@RANLIB@%$RANLIB%g
-s%@AR@%$AR%g
-s%@CPP@%$CPP%g
-s%@LIBOBJS@%$LIBOBJS%g
-s%@INCLUDES@%$INCLUDES%g
-s%@LIBEDIT@%$LIBEDIT%g
-s%@LIBUKEM@%$LIBUKEM%g
-s%@LIBDEPENDS@%$LIBDEPENDS%g
-
-CEOF
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-EOF
-
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile libedit/Makefile libedit/makelist libukem/Makefile \
- src/Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
-rm -f conftest.tail
-while :
-do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
- echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
diff --git a/contrib/lukemftp/configure.in b/contrib/lukemftp/configure.in
deleted file mode 100644
index 4edb841..0000000
--- a/contrib/lukemftp/configure.in
+++ /dev/null
@@ -1,307 +0,0 @@
-dnl $Id: configure.in,v 1.37 2002/06/10 08:08:53 lukem Exp $
-dnl
-dnl configure.in --
-dnl process this file with autoconf to produce a configure script.
-dnl
-
-AC_REVISION($Revision: 1.37 $)dnl
-
-AC_INIT(lukemftp.h)
-
-dnl Arguments for which features are included
-dnl
-AC_ARG_PROGRAM
-AC_ARG_ENABLE(editcomplete, [\
- --enable-editcomplete Turn on command line editing and completion.
- --disable-editcomplete Turn off command line editing and completion
- [default: enabled].],
- opt_editcomplete=$enableval,
- opt_editcomplete=yes)
-AC_ARG_ENABLE(ipv6, [\
- --enable-ipv6 Enable IPv6 support (if your OS supports it).
- --disable-ipv6 Disable IPv6 support (even if your OS supports it)
- [default: enabled].],
- opt_ipv6=$enableval,
- opt_ipv6=yes)
-
-dnl Checks for programs.
-dnl
-AC_PROG_MAKE_SET
-AC_PROG_CC
-AC_PROG_AWK
-AC_PROG_INSTALL
-AC_PROG_RANLIB
-AC_CHECK_PROGS(AR, ar)
-AC_AIX
-
-
-dnl Checks for libraries.
-dnl
-AC_CHECK_LIB(util, fparseln)
-if test $opt_editcomplete = yes; then
- AC_CHECK_LIB(tinfo, tgetent, ,
- AC_CHECK_LIB(termcap, tgetent, ,
- AC_CHECK_LIB(curses, tgetent, ,
- AC_CHECK_LIB(ncurses, tgetent))))
- AC_SEARCH_LIBS(el_init, edit, have_libedit=yes, have_libedit=no)
-fi
-AC_LIBRARY_NET
-AC_LIBRARY_SOCKS
-if test -n "$socks"; then
- if test $opt_ipv6 = yes; then
- echo "IPv6 is incompatible with socks, disabling IPv6 support"
- opt_ipv6=no
- fi
-fi
-
-
-dnl Checks for header files.
-dnl
-AC_CONFIG_HEADER(config.h)
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_CHECK_HEADERS(arpa/nameser.h err.h regex.h paths.h poll.h sys/poll.h \
- termcap.h util.h libutil.h vis.h)
-
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-dnl
-AC_HEADER_TIME
-AC_TYPE_OFF_T
-AC_CHECK_SIZEOF(off_t, 0)
-AC_MSG_TRY_LINK(for long long, ftp_cv_HAVE_LONG_LONG, [
-#include <sys/types.h>] , [
-long long X = 2, Y = 1, Z;
-Z = X / Y; ], [
-AC_DEFINE(HAVE_LONG_LONG, 1)
-have_long_long=yes], [have_long_long=no])
-
-AC_MSG_TRY_COMPILE(for in_port_t, ftp_cv_HAVE_IN_PORT_T, [
-#include <sys/types.h>
-#include <netinet/in.h> ], [ in_port_t X ], [AC_DEFINE(HAVE_IN_PORT_T, 1)])
-
-AC_MSG_TRY_COMPILE(for sa_family_t, ftp_cv_HAVE_SA_FAMILY_T, [
-#include <sys/types.h>
-#include <sys/socket.h> ], [ sa_family_t X ], [AC_DEFINE(HAVE_SA_FAMILY_T, 1)])
-
-AC_MSG_TRY_COMPILE(for sockaddr_in.sin_len, ftp_cv_HAVE_SOCKADDR_SA_LEN, [
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h> ], [
- struct sockaddr_in sin;
- int X = sin.sin_len ], [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1)])
-
-AC_MSG_TRY_COMPILE(for socklen_t, ftp_cv_HAVE_SOCKLEN_T, [
-#include <sys/types.h>
-#include <sys/socket.h> ], [ socklen_t X ], [AC_DEFINE(HAVE_SOCKLEN_T, 1)])
-
-if test $opt_ipv6 = yes; then
-
- AC_MSG_TRY_COMPILE(for AF_INET6, ftp_cv_HAVE_AF_INET6, [
-#include <sys/types.h>
-#include <sys/socket.h> ],
- [ int X = AF_INET6 ], [AC_DEFINE(HAVE_AF_INET6, 1)])
-
- AC_MSG_TRY_COMPILE(for struct sockaddr_in6, ftp_cv_HAVE_SOCKADDR_IN6, [
-#include <sys/types.h>
-#include <netinet/in.h> ],
- [ struct sockaddr_in6 X ], [AC_DEFINE(HAVE_SOCKADDR_IN6, 1)])
-
-fi
-
-AC_MSG_TRY_COMPILE(for struct addrinfo, ftp_cv_HAVE_ADDRINFO, [
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h> ],
- [ struct addrinfo X ], [AC_DEFINE(HAVE_ADDRINFO, 1)])
-
-AC_MSG_TRY_COMPILE(for d_namlen in struct dirent, ftp_cv_HAVE_D_NAMLEN, [
-#if HAVE_DIRENT_H
-# include <dirent.h>
-#else
-# define dirent direct
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif ], [
- struct dirent dp;
- int X = dp.d_namlen; ], [AC_DEFINE(HAVE_D_NAMLEN, 1)])
-
-AC_MSG_TRY_COMPILE(for h_errno declaration, ftp_cv_HAVE_H_ERRNO_D, [
-#include <netdb.h> ], [ int X = h_errno ], [AC_DEFINE(HAVE_H_ERRNO_D, 1)])
-
-AC_MSG_TRY_COMPILE(for fclose() declaration, ftp_cv_HAVE_FCLOSE_D, [
-#include <stdio.h> ], [ int (*X)() = fclose ], [AC_DEFINE(HAVE_FCLOSE_D, 1)])
-
-AC_MSG_TRY_COMPILE(for getpass() declaration, ftp_cv_HAVE_GETPASS_D, [
-#include <stdlib.h>
-#include <unistd.h> ], [ char *(*X)() = getpass ], [
- AC_DEFINE(HAVE_GETPASS_D, 1)])
-
-AC_MSG_TRY_COMPILE(for optarg declaration, ftp_cv_HAVE_OPTARG_D, [
-#include <stdlib.h>
-#include <unistd.h> ], [ char *X = optarg ], [AC_DEFINE(HAVE_OPTARG_D, 1)])
-
-AC_MSG_TRY_COMPILE(for optind declaration, ftp_cv_HAVE_OPTIND_D, [
-#include <stdlib.h>
-#include <unistd.h> ], [ int X = optind ], [AC_DEFINE(HAVE_OPTIND_D, 1)])
-
-AC_MSG_TRY_COMPILE(for pclose() declaration, ftp_cv_HAVE_PCLOSE_D, [
-#include <stdio.h> ], [ int (*X)() = pclose ], [AC_DEFINE(HAVE_PCLOSE_D, 1)])
-
-
-dnl Checks for library functions.
-dnl
-AC_REPLACE_FUNCS(err fgetln fseeko getaddrinfo getnameinfo inet_ntop inet_pton \
- mkstemp setprogname sl_init snprintf strdup strerror strlcat \
- strlcpy strptime strsep strunvis strvis timegm usleep)
-AC_CHECK_FUNCS(gethostbyname2 getpassphrase getpgrp memmove poll select)
-if test $ac_cv_func_getpgrp = yes; then
- AC_FUNC_GETPGRP
-fi
-if test $ac_cv_lib_util_fparseln != yes; then
- AC_REPLACE_FUNCS(fparseln)
-fi
-
-LIBOBJS="$LIBOBJS glob.o"
-
-if test $ac_cv_func_strptime = yes; then
- AC_MSG_TRY_COMPILE(for strptime() declaration, ftp_cv_HAVE_STRPTIME_D, [
- #include <time.h> ], [ char *X = strptime("", "", NULL) ],
- [AC_DEFINE(HAVE_STRPTIME_D, 1)])
-fi
-
-if test $have_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
-
-dnl We assume that if sprintf() supports %lld or %qd,
-dnl then all of *printf() does. If not, disable long long
-dnl support because we don't know how to display it.
-
- AC_MSG_CHECKING(*printf() support for %lld)
- can_printf_longlong=no
- AC_TRY_RUN([
- #include <stdio.h>
- int main() {
- char buf[100];
- sprintf(buf, "%lld", 4294967300LL);
- return (strcmp(buf, "4294967300"));
- }
- ], [
- AC_MSG_RESULT(yes)
- can_printf_longlong=yes
- ], [
- AC_MSG_RESULT(no)
- ], [ : ])
-
- if test $can_printf_longlong != yes; then
- AC_MSG_CHECKING(*printf() support for %qd)
- AC_TRY_RUN([
- #include <stdio.h>
- int main() {
- char buf[100];
- sprintf(buf, "%qd", 4294967300LL);
- return (strcmp(buf, "4294967300"));
- }
- ], [
- AC_MSG_RESULT(yes)
- can_printf_longlong=yes
- AC_DEFINE(HAVE_PRINTF_QD, 1)
- ], [
- AC_MSG_RESULT(no)
- ], [ : ])
- fi
-
- if test $can_printf_longlong = yes; then
- AC_DEFINE(HAVE_QUAD_SUPPORT, 1)
- AC_REPLACE_FUNCS(strtoll)
- fi
-
-fi
-
-
-if test $opt_editcomplete = yes; then
- if test $have_libedit = yes; then
- AC_MSG_TRY_COMPILE(for EL_RPROMPT in libedit,
- ftp_cv_have_libedit, [
- #include <histedit.h> ], [ int X = EL_RPROMPT ], [:],
- have_libedit=no )
- fi
-
- AC_MSG_CHECKING(for working libedit)
- if test $have_libedit = no; then
- AC_MSG_RESULT(no - using my own)
- INCLUDES="-I\${srcdir}/../libedit $INCLUDES"
- LDFLAGS="-L../libedit $LDFLAGS"
- LIBS="-ledit $LIBS"
- LIBEDIT=libedit.a
- LIBDEPENDS="$LIBDEPENDS ../libedit/libedit.a"
- else
- AC_MSG_RESULT(yes)
- fi
-else
- CFLAGS="-DNO_EDITCOMPLETE $CFLAGS"
-fi
-
-if test $ac_cv_func_sl_init = yes; then
- AC_MSG_TRY_COMPILE(if sl_add() returns int, ftp_cv_INT_SL_ADD, [
- #include <stringlist.h> ], [ int f = sl_add((StringList *)0, "foo") ],
- [:] , [LIBOBJS="$LIBOBJS sl_init.o"])
-fi
-
-
-have_rfc2553_netdb=no
-if test $ac_cv_func_getaddrinfo = yes -a ! -n "$socks"; then
- AC_MSG_TRY_COMPILE(for AI_NUMERICHOST,
- ftp_cv_have_ai_numerichost, [
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h> ],
- [ int X = AI_NUMERICHOST ], [ have_rfc2553_netdb=yes ])
-fi
-AC_MSG_CHECKING(for working getaddrinfo())
-if test $have_rfc2553_netdb = yes; then
- AC_DEFINE(HAVE_RFC2553_NETDB, 1)
- AC_MSG_RESULT(yes)
-else
- if test $ac_cv_func_getaddrinfo = yes; then
- LIBOBJS="$LIBOBJS getaddrinfo.o"
- AC_MSG_RESULT(no - using local version)
- else
- AC_MSG_RESULT(using local version)
- fi
-fi
-
-
-if test $ac_cv_header_vis_h = yes; then
- AC_MSG_TRY_COMPILE(for VIS_WHITE in vis.h,
- ftp_cv_have_vis_white, [
- #include <sys/types.h>
- #include <vis.h> ], [ int X = VIS_WHITE ], [:],
- ac_cv_header_vis_h=no )
-fi
-
-
-if test -n "$LIBOBJS"; then
- INCLUDES="$INCLUDES -I\${srcdir}/../libukem"
- LDFLAGS="$LDFLAGS -L../libukem"
- LIBS="$LIBS -lukem"
- LIBUKEM=libukem.a
- LIBDEPENDS="$LIBDEPENDS ../libukem/libukem.a"
-fi
-
-dnl Create the Makefiles
-dnl
-
-AC_SUBST(INCLUDES)
-AC_SUBST(LIBEDIT)
-AC_SUBST(LIBUKEM)
-AC_SUBST(LIBDEPENDS)
-
-AC_OUTPUT(Makefile libedit/Makefile libedit/makelist libukem/Makefile \
- src/Makefile)
diff --git a/contrib/lukemftp/diffout b/contrib/lukemftp/diffout
deleted file mode 100644
index 932f748..0000000
--- a/contrib/lukemftp/diffout
+++ /dev/null
@@ -1,3500 +0,0 @@
-diff -Nru src/CVS/Entries /home/spock/ftp/CVS/Entries
---- src/CVS/Entries Thu Jan 30 11:00:13 2003
-+++ /home/spock/ftp/CVS/Entries Thu Jun 12 02:02:10 2003
-@@ -1,16 +1,17 @@
--/Makefile.in/1.1.1.1/Thu Jul 19 16:26:12 2001//
--/cmds.c/1.1.1.2/Sat Jun 15 09:40:32 2002//
--/cmdtab.c/1.1.1.2/Sat Jun 15 09:40:33 2002//
--/complete.c/1.1.1.1/Thu Jul 19 16:26:13 2001//
--/domacro.c/1.1.1.2/Sat Jun 15 09:40:33 2002//
--/extern.h/1.1.1.2/Sat Jun 15 09:40:33 2002//
--/fetch.c/1.1.1.3/Sat Jun 15 09:40:34 2002//
--/ftp.1/1.1.1.3/Sat Jun 15 09:40:35 2002//
--/ftp.c/1.1.1.3/Sat Jun 15 09:40:36 2002//
--/ftp.cat1/1.1.1.1/Sat Jun 15 09:40:31 2002//
--/ftp_var.h/1.1.1.3/Sat Jun 15 09:40:36 2002//
--/main.c/1.1.1.3/Sat Jun 15 09:40:36 2002//
--/ruserpass.c/1.1.1.2/Sat Jun 15 09:40:36 2002//
--/util.c/1.1.1.2/Sat Jun 15 09:40:37 2002//
--/version.h/1.1.1.2/Sat Jun 15 09:40:37 2002//
-+/Makefile/1.26/Tue Jan 21 16:08:06 2003//
-+/cmds.c/1.100/Sat Nov 30 03:10:55 2002//
-+/cmdtab.c/1.40/Mon Jul 29 04:24:47 2002//
-+/complete.c/1.38/Mon May 1 10:35:17 2000//
-+/domacro.c/1.19/Fri Feb 1 05:04:43 2002//
-+/extern.h/1.61/Tue Jan 21 16:08:07 2003//
-+/fetch.c/1.141/Wed May 14 14:31:00 2003//
-+/ftp.1/1.94/Wed May 14 14:31:00 2003//
-+/ftp.c/1.120/Wed Jun 5 10:20:49 2002//
-+/ftp_var.h/1.64/Tue Jan 21 16:08:07 2003//
-+/main.c/1.84/Wed May 14 14:31:00 2003//
-+/progressbar.c/1.3/Fri Feb 28 09:53:49 2003//
-+/progressbar.h/1.3/Fri Feb 28 09:53:49 2003//
-+/ruserpass.c/1.28/Wed Nov 15 00:11:04 2000//
-+/util.c/1.111/Fri Feb 28 09:54:51 2003//
-+/version.h/1.30/Fri Feb 28 09:54:20 2003//
- D
-diff -Nru src/CVS/Repository /home/spock/ftp/CVS/Repository
---- src/CVS/Repository Thu Jan 30 11:00:13 2003
-+++ /home/spock/ftp/CVS/Repository Thu Jun 12 02:02:10 2003
-@@ -1 +1 @@
--src/contrib/lukemftp/src
-+src/usr.bin/ftp
-diff -Nru src/CVS/Root /home/spock/ftp/CVS/Root
---- src/CVS/Root Thu Jan 30 11:00:13 2003
-+++ /home/spock/ftp/CVS/Root Thu Jun 12 02:02:09 2003
-@@ -1 +1 @@
--spock@current:/cvs/ncvs
-+:pserver:anoncvs@anoncvs.netbsd.org:/cvsroot
-diff -Nru src/Makefile /home/spock/ftp/Makefile
---- src/Makefile Wed Dec 31 19:00:00 1969
-+++ /home/spock/ftp/Makefile Thu Jun 12 02:02:10 2003
-@@ -0,0 +1,26 @@
-+# $NetBSD: Makefile,v 1.26 2003/01/21 16:08:06 jhawk Exp $
-+# from: @(#)Makefile 8.2 (Berkeley) 4/3/94
-+
-+PROG= ftp
-+SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
-+ progressbar.c ruserpass.c util.c
-+
-+# Uncomment the following to provide defaults for gate-ftp operation
-+#
-+#CPPFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21
-+
-+.if defined(SMALLPROG)
-+CPPFLAGS+=-DNO_EDITCOMPLETE -DNO_ABOUT
-+.else
-+LDADD+= -ledit -ltermcap
-+DPADD+= ${LIBEDIT} ${LIBTERMCAP}
-+.endif
-+
-+.if !defined(SMALLPROG) || defined(SMALLPROG_INET6)
-+CPPFLAGS+= -DINET6
-+.endif
-+
-+cmds.o fetch.o: version.h
-+main.o: ftp_var.h
-+
-+.include <bsd.prog.mk>
-diff -Nru src/Makefile.in /home/spock/ftp/Makefile.in
---- src/Makefile.in Thu Jul 19 12:26:12 2001
-+++ /home/spock/ftp/Makefile.in Wed Dec 31 19:00:00 1969
-@@ -1,43 +0,0 @@
--#
--# $Id: Makefile.in,v 1.8 2000/08/08 07:04:27 lukem Exp $
--#
--
--srcdir = @srcdir@
--VPATH = @srcdir@
--SHELL = /bin/sh
--
--prefix = @prefix@
--exec_prefix = @exec_prefix@
--bindir = @bindir@
--mandir = @mandir@
--transform = @program_transform_name@
--
--mandircat1 = ${mandir}/cat1
--
--CC = @CC@
--CFLAGS = -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CFLAGS@
--LIBS = @LIBS@
--LDFLAGS = @LDFLAGS@
--
--INSTALL = @INSTALL@
--
--PROG = ftp
--OBJS = cmds.o cmdtab.o complete.o domacro.o fetch.o ftp.o main.o \
-- ruserpass.o util.o
--
--all: ${PROG}
--
--install: all
-- -mkdir -p ${bindir}
-- ${INSTALL} -m 555 ${PROG} ${bindir}/`echo ${PROG}|sed '$(transform)'`
-- -mkdir -p ${mandircat1}
-- ${INSTALL} -m 444 ${srcdir}/${PROG}.cat1 ${mandircat1}/`echo ${PROG}|sed '$(transform)'`.1
--
--${PROG}: ${OBJS} @LIBDEPENDS@
-- ${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}
--
--clean:
-- rm -f core ${PROG} ${OBJS}
--
--distclean: clean
-- rm -f Makefile
-diff -Nru src/cmds.c /home/spock/ftp/cmds.c
---- src/cmds.c Sat Jun 15 05:40:32 2002
-+++ /home/spock/ftp/cmds.c Thu Jun 12 02:02:10 2003
-@@ -1,4 +1,4 @@
--/* $NetBSD: cmds.c,v 1.98 2002/06/05 10:20:46 lukem Exp $ */
-+/* $NetBSD: cmds.c,v 1.100 2002/11/30 03:10:55 lukem Exp $ */
-
- /*-
- * Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
-@@ -102,11 +102,35 @@
- * SUCH DAMAGE.
- */
-
-+#include <sys/cdefs.h>
-+#ifndef lint
-+#if 0
-+static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
-+#else
-+__RCSID("$NetBSD: cmds.c,v 1.100 2002/11/30 03:10:55 lukem Exp $");
-+#endif
-+#endif /* not lint */
-+
- /*
- * FTP User Program -- Command Routines.
- */
--
--#include "lukemftp.h"
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <sys/stat.h>
-+#include <sys/wait.h>
-+#include <arpa/ftp.h>
-+
-+#include <ctype.h>
-+#include <err.h>
-+#include <glob.h>
-+#include <limits.h>
-+#include <netdb.h>
-+#include <paths.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <time.h>
-+#include <unistd.h>
-
- #include "ftp_var.h"
- #include "version.h"
-@@ -1008,7 +1032,7 @@
- gatemode = 0;
- else {
- if (argc == 3)
-- gateport = strdup(argv[2]);
-+ gateport = xstrdup(argv[2]);
- (void)strlcpy(gsbuf, argv[1], sizeof(gsbuf));
- gateserver = gsbuf;
- gatemode = 1;
-diff -Nru src/cmdtab.c /home/spock/ftp/cmdtab.c
---- src/cmdtab.c Sat Jun 15 05:40:33 2002
-+++ /home/spock/ftp/cmdtab.c Thu Jun 12 02:02:10 2003
-@@ -1,4 +1,4 @@
--/* $NetBSD: cmdtab.c,v 1.39 2000/11/15 00:10:59 lukem Exp $ */
-+/* $NetBSD: cmdtab.c,v 1.40 2002/07/29 04:24:47 lukem Exp $ */
-
- /*-
- * Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
-@@ -69,8 +69,16 @@
- * SUCH DAMAGE.
- */
-
--#include "lukemftp.h"
-+#include <sys/cdefs.h>
-+#ifndef lint
-+#if 0
-+static char sccsid[] = "@(#)cmdtab.c 8.4 (Berkeley) 10/9/94";
-+#else
-+__RCSID("$NetBSD: cmdtab.c,v 1.40 2002/07/29 04:24:47 lukem Exp $");
-+#endif
-+#endif /* not lint */
-
-+#include <stdio.h>
- #include "ftp_var.h"
-
- /*
-@@ -123,7 +131,7 @@
- char ntranshelp[] = "set translation table for default file name mapping";
- char optshelp[] = "show or set options for remote commands";
- char pagehelp[] = "view a remote file through your pager";
--char passivehelp[] = "enter passive transfer mode";
-+char passivehelp[] = "toggle use of passive transfer mode";
- char plshelp[] = "list contents of remote path through your pager";
- char pmlsdhelp[] = "list contents of remote directory in a machine "
- "parsable form through your pager";
-diff -Nru src/complete.c /home/spock/ftp/complete.c
---- src/complete.c Thu Jul 19 12:26:13 2001
-+++ /home/spock/ftp/complete.c Thu Jun 12 02:02:10 2003
-@@ -36,11 +36,23 @@
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-+#include <sys/cdefs.h>
-+#ifndef lint
-+__RCSID("$NetBSD: complete.c,v 1.38 2000/05/01 10:35:17 lukem Exp $");
-+#endif /* not lint */
-+
- /*
- * FTP user program - command and file completion routines
- */
-
--#include "lukemftp.h"
-+#include <sys/stat.h>
-+
-+#include <ctype.h>
-+#include <err.h>
-+#include <dirent.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-
- #include "ftp_var.h"
-
-diff -Nru src/domacro.c /home/spock/ftp/domacro.c
---- src/domacro.c Sat Jun 15 05:40:33 2002
-+++ /home/spock/ftp/domacro.c Thu Jun 12 02:02:10 2003
-@@ -33,7 +33,18 @@
- * SUCH DAMAGE.
- */
-
--#include "lukemftp.h"
-+#include <sys/cdefs.h>
-+#ifndef lint
-+#if 0
-+static char sccsid[] = "@(#)domacro.c 8.3 (Berkeley) 4/2/94";
-+#else
-+__RCSID("$NetBSD: domacro.c,v 1.19 2002/02/01 05:04:43 itojun Exp $");
-+#endif
-+#endif /* not lint */
-+
-+#include <ctype.h>
-+#include <stdio.h>
-+#include <string.h>
-
- #include "ftp_var.h"
-
-diff -Nru src/extern.h /home/spock/ftp/extern.h
---- src/extern.h Sat Jun 15 05:40:33 2002
-+++ /home/spock/ftp/extern.h Thu Jun 12 02:02:10 2003
-@@ -1,7 +1,7 @@
--/* $NetBSD: extern.h,v 1.60 2000/10/11 14:46:03 is Exp $ */
-+/* $NetBSD: extern.h,v 1.61 2003/01/21 16:08:07 jhawk Exp $ */
-
- /*-
-- * Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
-+ * Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
-@@ -110,7 +110,6 @@
- void abortxfer(int);
- void account(int, char **);
- void ai_unmapped(struct addrinfo *);
--void alarmtimer(int);
- int another(int *, char ***, const char *);
- int auto_fetch(int, char **);
- int auto_put(int, char **, const char *);
-@@ -123,7 +122,7 @@
- void cmdtimeout(int);
- void cmdscanner(void);
- int command(const char *, ...)
-- ;
-+ __attribute__((__format__(__printf__, 1, 2)));
- #ifndef NO_EDITCOMPLETE
- unsigned char complete(EditLine *, int);
- void controlediting(void);
-@@ -183,14 +182,11 @@
- void page(int, char **);
- int parseport(const char *, int);
- int parserate(int, char **, int);
--void progressmeter(int);
- char *prompt(void);
- void proxabort(int);
- void proxtrans(const char *, const char *, const char *);
- void psabort(int);
--void psummary(int);
- void pswitch(int);
--void ptransfer(int);
- void put(int, char **);
- void pwd(int, char **);
- void quit(int, char **);
-@@ -263,5 +259,3 @@
- StringList *xsl_init(void);
- void xsl_add(StringList *, char *);
- char *xstrdup(const char *);
--sigfunc xsignal(int, sigfunc);
--sigfunc xsignal_restart(int, sigfunc, int);
-diff -Nru src/fetch.c /home/spock/ftp/fetch.c
---- src/fetch.c Sun Feb 16 14:45:52 2003
-+++ /home/spock/ftp/fetch.c Thu Jun 12 02:02:11 2003
-@@ -1,7 +1,7 @@
--/* $NetBSD: fetch.c,v 1.136 2002/06/05 10:20:48 lukem Exp $ */
-+/* $NetBSD: fetch.c,v 1.141 2003/05/14 14:31:00 wiz Exp $ */
-
- /*-
-- * Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
-+ * Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
-@@ -39,11 +39,36 @@
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-+#include <sys/cdefs.h>
-+#ifndef lint
-+__RCSID("$NetBSD: fetch.c,v 1.141 2003/05/14 14:31:00 wiz Exp $");
-+#endif /* not lint */
-+
- /*
- * FTP User Program -- Command line file retrieval
- */
-
--#include "lukemftp.h"
-+#include <sys/types.h>
-+#include <sys/param.h>
-+#include <sys/socket.h>
-+#include <sys/stat.h>
-+#include <sys/time.h>
-+
-+#include <netinet/in.h>
-+
-+#include <arpa/ftp.h>
-+#include <arpa/inet.h>
-+
-+#include <ctype.h>
-+#include <err.h>
-+#include <errno.h>
-+#include <netdb.h>
-+#include <fcntl.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <time.h>
-
- #include "ftp_var.h"
- #include "version.h"
-@@ -155,7 +180,7 @@
- *response = (char *)xmalloc(rlen);
- (void)strlcpy(*response, scheme, rlen);
- len = strlcat(*response, " ", rlen);
-- base64_encode(clear, clen, *response + len);
-+ base64_encode(clear, clen, (u_char *)*response + len);
- memset(clear, 0, clen);
- rval = 0;
-
-@@ -235,12 +260,12 @@
- * XXX: this is not totally RFC 1738 compliant; <path> will have the
- * leading `/' unless it's an ftp:// URL, as this makes things easier
- * for file:// and http:// URLs. ftp:// URLs have the `/' between the
-- * host and the url-path removed, but any additional leading slashes
-- * in the url-path are retained (because they imply that we should
-+ * host and the URL-path removed, but any additional leading slashes
-+ * in the URL-path are retained (because they imply that we should
- * later do "CWD" with a null argument).
- *
- * Examples:
-- * input url output path
-+ * input URL output path
- * --------- -----------
- * "ftp://host" NULL
- * "http://host/" NULL
-@@ -484,7 +509,8 @@
- rval = fetch_ftp(url);
- goto cleanup_fetch_url;
- }
-- warnx("Invalid URL (no file after directory) `%s'", url);
-+ warnx("no file after directory (you must specify an "
-+ "output file) `%s'", url);
- goto cleanup_fetch_url;
- } else {
- if (debug)
-@@ -1372,7 +1398,7 @@
- dir ? dir : "<null>", file ? file : "<null>");
-
- dirhasglob = filehasglob = 0;
-- if (doglob && (urltype == CLASSIC_URL_T || urltype == FTP_URL_T)) {
-+ if (doglob && urltype == CLASSIC_URL_T) {
- if (! EMPTYSTRING(dir) && strpbrk(dir, "*?[]{}") != NULL)
- dirhasglob = 1;
- if (! EMPTYSTRING(file) && strpbrk(file, "*?[]{}") != NULL)
-@@ -1741,7 +1767,7 @@
- }
- }
- if (debug)
-- fprintf(ttyout, "auto_put: url `%s' argv[2] `%s'\n",
-+ fprintf(ttyout, "auto_put: URL `%s' argv[2] `%s'\n",
- path, uargv[2] ? uargv[2] : "<null>");
-
- /* connect and cwd */
-diff -Nru src/ftp.1 /home/spock/ftp/ftp.1
---- src/ftp.1 Sat Jun 15 05:40:35 2002
-+++ /home/spock/ftp/ftp.1 Thu Jun 12 02:02:11 2003
-@@ -1,6 +1,6 @@
--.\" $NetBSD: ftp.1,v 1.83 2002/06/05 10:20:48 lukem Exp $
-+.\" $NetBSD: ftp.1,v 1.94 2003/05/14 14:31:00 wiz Exp $
- .\"
--.\" Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
-+.\" Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
- .\" All rights reserved.
- .\"
- .\" This code is derived from software contributed to The NetBSD Foundation
-@@ -68,7 +68,7 @@
- .\"
- .\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
- .\"
--.Dd May 18, 2002
-+.Dd January 20, 2003
- .Dt FTP 1
- .Os
- .Sh NAME
-@@ -76,7 +76,7 @@
- .Nd
- Internet file transfer program
- .Sh SYNOPSIS
--.Nm ""
-+.Nm
- .Op Fl 46AadefginpRtvV
- .Bk -words
- .Op Fl N Ar netrc
-@@ -88,46 +88,81 @@
- .Op Fl P Ar port
- .Ek
- .Bk -words
-+.Op Fl q Ar quittime
-+.Ek
-+.Bk -words
- .Op Fl r Ar retry
- .Ek
- .Bk -words
-+.\" [-T dir,max[,inc]]
- .Oo
--.Fl T
-+.Fl T Xo
- .Sm off
--.Xo
- .Ar dir ,
- .Ar max
- .Op , Ar inc
--.Xc
- .Sm on
-+.Xc
- .Oc
- .Ek
- .Bk -words
-+.\" [[user@]host [port]]
- .Oo
--[\fIuser\fR@]\fIhost\fR
-+.Oo Ar user Ns Li \&@ Oc Ns Ar host
- .Op Ar port
- .Oc
- .Ek
- .Bk -words
--[\fIuser\fR@]\fIhost\fR:[\fIpath\fR][/]
-+.\" [[user@]host:[path][/]]
-+.Sm off
-+.Oo
-+.Op Ar user Li \&@
-+.Ar host Li \&:
-+.Op Ar path
-+.Op Li /
-+.Oc
-+.Sm on
- .Ek
- .Bk -words
--.Op file:///\fIpath\fR
-+.\" [file:///path]
-+.Sm off
-+.Oo
-+.Li file:/// Ar path
-+.Oc
-+.Sm on
- .Ek
- .Bk -words
--.Op ftp://[\fIuser\fR[:\fIpassword\fR]@]\fIhost\fR[:\fIport\fR]/\fIpath\fR[/]
-+.\" [ftp://[user[:password]@]host[:port]/path[/]]
-+.Sm off
-+.Oo
-+.Li ftp://
-+.Oo Ar user
-+.Op Li \&: Ar password
-+.Li \&@ Oc
-+.Ar host Oo Li \&: Ar port Oc
-+.Li / Ar path
-+.Op Li /
-+.Op Li ;type= Ar X
-+.Oc
-+.Sm on
- .Ek
- .Bk -words
--.Op http://[\fIuser\fR[:\fIpassword\fR]@]\fIhost\fR[:\fIport\fR]/\fIpath\fR
-+.\" [http://[user[:password]@]host[:port]/path]
-+.Sm off
-+.Oo
-+.Li http://
-+.Oo Ar user
-+.Op Li \&: Ar password
-+.Li \&@ Oc
-+.Ar host Oo Li \&: Ar port Oc
-+.Li / Ar path
-+.Oc
-+.Sm on
- .Ek
- .Op Ar \&.\&.\&.
--.Nm ""
--.Fl u Ar url
--.\".Ar ftp://[\fIuser\fR[:\fIpassword\fR]@]\fIhost\fR[:\fIport\fR]/\fIpath\fR[/[file]]
--.\"|
--.\".Ar [\fIuser\fR@]\fIhost\fR:[\fIpath\fR][/[\fIfile\fR]]
-+.Nm
- .Bk -words
--file
-+.Fl u Ar URL Ar file
- .Ek
- .Op Ar \&.\&.\&.
- .Sh DESCRIPTION
-@@ -243,6 +278,10 @@
- Retry the connection attempt if it failed, pausing for
- .Ar wait
- seconds.
-+.It Fl q Ar quittime
-+Quit if the connection has stalled for
-+.Ar quittime
-+seconds.
- .It Fl R
- Restart all non-proxied auto-fetches.
- .It Fl t
-@@ -266,11 +305,11 @@
- Refer to
- .Ic rate
- for more information.
--.It Fl u Ar url file Op \&.\&.\&.
-+.It Fl u Ar URL file Op \&.\&.\&.
- Upload files on the command line to
--.Ar url
-+.Ar URL
- where
--.Ar url
-+.Ar URL
- is one of the ftp URL types as supported by auto-fetch
- (with an optional target filename for single file uploads), and
- .Ar file
-@@ -869,7 +908,7 @@
- .Tn FTP
- server at that port.
- If the
--.Ic auto-login
-+.Ic "set auto-login"
- option is on (default),
- .Nm
- will also attempt to automatically log the user in to
-@@ -882,10 +921,10 @@
- and display with the program specified by the
- .Ic "set pager"
- option.
--.It Ic passive Op Ic auto
-+.It Ic passive Op Cm auto
- Toggle passive mode (if no arguments are given).
- If
--.Ic auto
-+.Cm auto
- is given, act as if
- .Ev FTPMODE
- is set to
-@@ -896,14 +935,17 @@
- .Dv PASV
- command for all data connections instead of a
- .Dv PORT
--command. The
-+command.
-+The
- .Dv PASV
- command requests that the remote server open a port for the data connection
--and return the address of that port. The remote server listens on that
--port and the client connects to it. When using the more traditional
-+and return the address of that port.
-+The remote server listens on that port and the client connects to it.
-+When using the more traditional
- .Dv PORT
- command, the client listens on a port and sends that address to the remote
--server, who connects back to it. Passive mode is useful when using
-+server, who connects back to it.
-+Passive mode is useful when using
- .Nm
- through a gateway router or host that controls the directionality of
- traffic.
-@@ -965,34 +1007,34 @@
- .Pp
- When prompting is on, the following commands are available at a prompt:
- .Bl -tag -width 2n -offset indent
--.It Ic a
-+.It Cm a
- Answer
- .Sq yes
- to the current file, and automatically answer
- .Sq yes
- to any remaining files for the current command.
--.It Ic n
-+.It Cm n
- Answer
- .Sq no ,
- and do not transfer the file.
--.It Ic p
-+.It Cm p
- Answer
- .Sq yes
- to the current file, and turn off prompt mode
- (as is
- .Dq prompt off
- had been given).
--.It Ic q
-+.It Cm q
- Terminate the current operation.
--.It Ic y
-+.It Cm y
- Answer
- .Sq yes ,
- and transfer the file.
--.It Ic ?
-+.It Cm ?
- Display a help message.
- .El
- .Pp
--Any other reponse will answer
-+Any other response will answer
- .Sq yes
- to the current file.
- .It Ic proxy Ar ftp-command
-@@ -1072,11 +1114,11 @@
- .Ar direction
- may be one of:
- .Bl -tag -width "all" -offset indent -compact
--.It Ic all
-+.It Cm all
- Both directions.
--.It Ic get
-+.It Cm get
- Incoming transfers.
--.It Ic put
-+.It Cm put
- Outgoing transfers.
- .El
- .Pp
-@@ -1240,7 +1282,7 @@
- implementations which do ignore
- .Dv PORT
- commands but, incorrectly, indicate they've been accepted.
--.It Ic set Op Ar "option value"
-+.It Ic set Op Ar option Ar value
- Set
- .Ar option
- to
-@@ -1252,25 +1294,25 @@
- are not given, display all of the options and their values.
- The currently supported options are:
- .Bl -tag -width "http_proxy" -offset indent
--.It anonpass
-+.It Cm anonpass
- Defaults to
- .Ev $FTPANONPASS
--.It ftp_proxy
-+.It Cm ftp_proxy
- Defaults to
- .Ev $ftp_proxy .
--.It http_proxy
-+.It Cm http_proxy
- Defaults to
- .Ev $http_proxy .
--.It no_proxy
-+.It Cm no_proxy
- Defaults to
- .Ev $no_proxy .
--.It pager
-+.It Cm pager
- Defaults to
- .Ev $PAGER .
--.It prompt
-+.It Cm prompt
- Defaults to
- .Ev $FTPPROMPT .
--.It rprompt
-+.It Cm rprompt
- Defaults to
- .Ev $FTPRPROMPT .
- .El
-@@ -1415,13 +1457,14 @@
- interpretation of the argument.
- Supported suffixes are:
- .Bl -tag -width 3n -offset indent -compact
--.It b
--Causes no modification. (Optional)
--.It k
-+.It Li b
-+Causes no modification.
-+(Optional)
-+.It Li k
- Kilo; multiply the argument by 1024
--.It m
-+.It Li m
- Mega; multiply the argument by 1048576
--.It g
-+.It Li g
- Giga; multiply the argument by 1073741824
- .El
- .Pp
-@@ -1447,7 +1490,15 @@
- .Pp
- The following formats are valid syntax for an auto-fetch element:
- .Bl -tag -width "FOO "
--.It [user@]host:[path][/]
-+.\" [user@]host:[path][/]
-+.It Xo
-+.Sm off
-+.Op Ar user Li \&@
-+.Ar host Li \&:
-+.Op Ar path
-+.Op Li /
-+.Sm on
-+.Xc
- .Dq Classic
- .Tn FTP
- format.
-@@ -1471,7 +1522,19 @@
- in the current directory.
- Otherwise, the full remote name is used as the local name,
- relative to the local root directory.
--.It ftp://[user[:password]@]host[:port]/path[/][;type=X]
-+.\" ftp://[user[:password]@]host[:port]/path[/][;type=X]
-+.It Xo
-+.Sm off
-+.Li ftp://
-+.Oo Ar user
-+.Op Li \&: Ar password
-+.Li \&@ Oc
-+.Ar host Oo Li \&: Ar port Oc
-+.Li / Ar path
-+.Op Li /
-+.Op Li ;type= Ar X
-+.Sm on
-+.Xc
- An
- .Tn FTP
- URL, retrieved using the
-@@ -1493,15 +1556,94 @@
- .Ar password
- if supplied, otherwise prompt the user for one.
- .Pp
-+If a suffix of
-+.Sq ;type=A
-+or
-+.Sq ;type=I
-+is supplied, then the transfer type will take place as
-+ascii or binary (respectively).
-+The default transfer type is binary.
-+.Pp
- In order to be compliant with
- .Cm RFC 1738 ,
- .Nm
--strips the leading
--.Sq /
--from
-+interprets the
-+.Ar path
-+part of an
-+.Dq ftp://
-+auto-fetch URL as follows:
-+.Bl -bullet
-+.It
-+The
-+.Sq Li /
-+immediately after the
-+.Ar host Ns Oo Li \&: Ns Ar port Oc
-+is interpreted as a separator before the
-+.Ar path ,
-+and not as part of the
-+.Ar path
-+itself.
-+.It
-+The
-+.Ar path
-+is interpreted as a
-+.So Li / Sc Ns -separated
-+list of name components.
-+For all but the last such component,
-+.Nm
-+performs the equivalent of a
-+.Ic cd
-+command.
-+For the last path component,
-+.Nm
-+performs the equivalent of a
-+.Ic get
-+command.
-+.It
-+Empty name components,
-+which result from
-+.Sq Li //
-+within the
-+.Ar path ,
-+or from an extra
-+.Sq Li /
-+at the beginning of the
- .Ar path ,
--resulting in a transfer relative from the default login directory of
--the user.
-+will cause the equivalent of a
-+.Ic cd
-+command without a directory name.
-+This is unlikely to be useful.
-+.It
-+Any
-+.Sq Li \&% Ns Ar XX
-+codes within the path components are decoded, with
-+.Ar XX
-+representing a character code in hexadecimal.
-+This decoding takes place after the
-+.Ar path
-+has been split into components,
-+but before each component is used in the equivalent of a
-+.Ic cd
-+or
-+.Ic get
-+command.
-+Some often-used codes are
-+.Sq Li \&%2F
-+(which represents
-+.Sq Li / )
-+and
-+.Sq Li \&%7E
-+(which represents
-+.Sq Li ~ ) .
-+.El
-+.Pp
-+The above interpretation has the following consequences:
-+.Bl -bullet
-+.It
-+The path is interpreted relative to the
-+default login directory of the specified user or of the
-+.Sq anonymous
-+user.
- If the
- .Pa /
- directory is required, use a leading path of
-@@ -1519,15 +1661,57 @@
- .Sq mypass ,
- use
- .Dq ftp://myname:mypass@localhost/%2fetc/motd
--.Pp
--If a suffix of
--.Sq ;type=A
--or
--.Sq ;type=I
--is supplied, then the transfer type will take place as
--ascii or binary (respectively).
--The default transfer type is binary.
--.It http://[user[:password]@]host[:port]/path
-+.It
-+The exact
-+.Ic cd
-+and
-+.Ic get
-+commands can be controlled by careful choice of
-+where to use
-+.Sq /
-+and where to use
-+.Sq %2F
-+(or
-+.Sq %2f ) .
-+For example, the following URLs correspond to the
-+equivalents of the indicated commands:
-+.Bl -tag -width "ftp://host/%2Fdir1%2Fdir2%2Ffile"
-+.It ftp://host/dir1/dir2/file
-+.Dq "cd dir1" ,
-+.Dq "cd dir2" ,
-+.Dq "get file" .
-+.It ftp://host/%2Fdir1/dir2/file
-+.Dq "cd /dir1" ,
-+.Dq "cd dir2" ,
-+.Dq "get file" .
-+.It ftp://host/dir1%2Fdir2/file
-+.Dq "cd dir1/dir2" ,
-+.Dq "get file" .
-+.It ftp://host/%2Fdir1%2Fdir2/file
-+.Dq "cd /dir1/dir2" ,
-+.Dq "get file" .
-+.It ftp://host/dir1%2Fdir2%2Ffile
-+.Dq "get dir1/dir2/file" .
-+.It ftp://host/%2Fdir1%2Fdir2%2Ffile
-+.Dq "get /dir1/dir2/file" .
-+.El
-+.It
-+You must have appropriate access permission for each of the
-+intermediate directories that is used in the equivalent of a
-+.Ic cd
-+command.
-+.El
-+.\" http://[user[:password]@]host[:port]/path
-+.It Xo
-+.Sm off
-+.Li http://
-+.Oo Ar user
-+.Op Li \&: Ar password
-+.Li \&@ Oc
-+.Ar host Oo Li \&: Ar port Oc
-+.Li / Ar path
-+.Sm on
-+.Xc
- An
- .Tn HTTP
- URL, retrieved using the
-@@ -1540,16 +1724,22 @@
- proxy server.
- If
- .Tn HTTP
--authorisation is required to retrieve
-+authorization is required to retrieve
- .Ar path ,
- and
- .Sq user
- (and optionally
- .Sq password )
- is in the URL, use them for the first attempt to authenticate.
--.It file:///path
-+.\" file:///path
-+.It Xo
-+.Sm off
-+.Li file:/// Ar path
-+.Sm on
-+.Xc
- A local URL, copied from
--.Ar /path .
-+.Pa / Ns Ar path
-+on the local host.
- .El
- .Pp
- Unless noted otherwise above, and
-@@ -1736,7 +1926,7 @@
- .Nm
- supports only the default values for the remaining
- file transfer parameters:
--.Ic mode ,
-+.Ic mode ,
- .Ic form ,
- and
- .Ic struct .
-@@ -1841,6 +2031,14 @@
- .Ic init
- is defined, it is automatically executed as the last step in the
- auto-login process.
-+For example,
-+.Bd -literal -offset indent
-+default
-+macdef init
-+epsv4 off
-+.Ed
-+.Pp
-+followed by a blank line.
- .El
- .Sh COMMAND LINE EDITING
- .Nm
-@@ -1888,9 +2086,20 @@
- The following formatting sequences are replaced by the given
- information:
- .Bl -tag -width "%% " -offset indent
--.It %/
-+.It Li \&%/
- The current remote working directory.
--.It %c[[0]\fIn\fR], %.[[0]\fIn\fR]
-+.\" %c[[0]n], %.[[0]n]
-+.It Xo
-+.Sm off
-+.Li \&%c
-+.Op Oo Li 0 Oc Ar n
-+.Sm on
-+.No ,
-+.Sm off
-+.Li \&%.
-+.Op Oo Li 0 Oc Ar n
-+.Sm on
-+.Xc
- The trailing component of the current remote working directory, or
- .Em n
- trailing components if a digit
-@@ -1902,21 +2111,28 @@
- .Sq 0 ,
- the number of skipped components precede the trailing component(s) in
- the format
--.Dq /\fI\*[Lt]skipped\*[Gt]\fRtrailing
-+.\" ``/<number>trailing''
-+.Do
-+.Sm off
-+.Li / Li \*[Lt] Va number Li \*[Gt]
-+.Va trailing
-+.Sm on
-+.Dc
- (for
--.Sq %c )
-+.Sq \&%c )
- or
--.Dq ...trailing
-+.\" ``...trailing''
-+.Dq Li \&... Ns Va trailing
- (for
--.Sq %. ) .
--.It %M
-+.Sq \&%. ) .
-+.It Li \&%M
- The remote host name.
--.It %m
-+.It Li \&%m
- The remote host name, up to the first
- .Sq \&. .
--.It %n
-+.It Li \&%n
- The remote user name.
--.It %%
-+.It Li \&%%
- A single
- .Sq % .
- .El
-@@ -1934,15 +2150,15 @@
- Overrides the default operation mode.
- Support values are:
- .Bl -tag -width "passive"
--.It active
-+.It Cm active
- active mode
- .Tn FTP
- only
--.It auto
-+.It Cm auto
- automatic determination of passive or active (this is the default)
--.It gate
-+.It Cm gate
- gate-ftp mode
--.It passive
-+.It Cm passive
- passive mode
- .Tn FTP
- only
-@@ -2028,6 +2244,21 @@
- Each entry may have an optional trailing ":port", which restricts
- the matching to connections to that port.
- .El
-+.Sh EXTENDED PASSIVE MODE AND FIREWALLS
-+Some firewall configurations do not allow
-+.Nm
-+to use extended passive mode.
-+If you find that even a simple
-+.Ic ls
-+appears to hang after printing a message such as this:
-+.Pp
-+.Dl 229 Entering Extended Passive Mode (|||58551|)
-+.Pp
-+then you will need to disable extended passive mode with
-+.Ic epsv4 off .
-+See the above section
-+.Sx The .netrc File
-+for an example of how to make this automatic.
- .Sh SEE ALSO
- .Xr getservbyname 3 ,
- .Xr editrc 5 ,
-@@ -2061,7 +2292,9 @@
- were implemented in
- .Nx 1.3
- and later releases
--by Luke Mewburn \*[Lt]lukem@netbsd.org\*[Gt].
-+by
-+.An Luke Mewburn
-+.Aq lukem@NetBSD.org .
- .Pp
- IPv6 support was added by the WIDE/KAME project
- (but may not be present in all non-NetBSD versions of this program, depending
-diff -Nru src/ftp.c /home/spock/ftp/ftp.c
---- src/ftp.c Sat Jun 15 05:40:36 2002
-+++ /home/spock/ftp/ftp.c Thu Jun 12 02:02:11 2003
-@@ -98,9 +98,40 @@
- * SUCH DAMAGE.
- */
-
--#include "lukemftp.h"
-+#include <sys/cdefs.h>
-+#ifndef lint
-+#if 0
-+static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
-+#else
-+__RCSID("$NetBSD: ftp.c,v 1.120 2002/06/05 10:20:49 lukem Exp $");
-+#endif
-+#endif /* not lint */
-
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <sys/socket.h>
-+#include <sys/time.h>
-+
-+#include <netinet/in.h>
-+#include <netinet/in_systm.h>
-+#include <netinet/ip.h>
-+#include <arpa/inet.h>
-+#include <arpa/ftp.h>
- #include <arpa/telnet.h>
-+
-+#include <ctype.h>
-+#include <err.h>
-+#include <errno.h>
-+#include <netdb.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <time.h>
-+#include <unistd.h>
-+#include <stdarg.h>
-+#ifndef USE_SELECT
-+#include <poll.h>
-+#endif
-
- #include "ftp_var.h"
-
-diff -Nru src/ftp.cat1 /home/spock/ftp/ftp.cat1
---- src/ftp.cat1 Sat Jun 15 05:40:31 2002
-+++ /home/spock/ftp/ftp.cat1 Wed Dec 31 19:00:00 1969
-@@ -1,1055 +0,0 @@
--FTP(1) NetBSD Reference Manual FTP(1)
--
--NNAAMMEE
-- ffttpp - Internet file transfer program
--
--SSYYNNOOPPSSIISS
-- ffttpp [--4466AAaaddeeffggiinnppRRttvvVV] [--NN _n_e_t_r_c] [--oo _o_u_t_p_u_t] [--PP _p_o_r_t] [--rr _r_e_t_r_y] [--TT
-- _d_i_r,_m_a_x[,_i_n_c]] [[_u_s_e_r@]_h_o_s_t [_p_o_r_t]] [_u_s_e_r@]_h_o_s_t:[_p_a_t_h][/]
-- [file:///_p_a_t_h] [ftp://[_u_s_e_r[:_p_a_s_s_w_o_r_d]@]_h_o_s_t[:_p_o_r_t]/_p_a_t_h[/]]
-- [http://[_u_s_e_r[:_p_a_s_s_w_o_r_d]@]_h_o_s_t[:_p_o_r_t]/_p_a_t_h] [_._._.]
-- ffttpp --uu _u_r_l file [_._._.]
--
--DDEESSCCRRIIPPTTIIOONN
-- ffttpp is the user interface to the Internet standard File Transfer Proto-
-- col. The program allows a user to transfer files to and from a remote
-- network site.
--
-- The last five arguments will fetch a file using the FTP or HTTP proto-
-- cols, or by direct copying, into the current directory. This is ideal
-- for scripts. Refer to _A_U_T_O_-_F_E_T_C_H_I_N_G _F_I_L_E_S below for more information.
--
-- Options may be specified at the command line, or to the command inter-
-- preter.
--
-- --44 Forces ffttpp to only use IPv4 addresses.
--
-- --66 Forces ffttpp to only use IPv6 addresses.
--
-- --AA Force active mode ftp. By default, ffttpp will try to use passive
-- mode ftp and fall back to active mode if passive is not support-
-- ed by the server. This option causes ffttpp to always use an ac-
-- tive connection. It is only useful for connecting to very old
-- servers that do not implement passive mode properly.
--
-- --aa Causes ffttpp to bypass normal login procedure, and use an anony-
-- mous login instead.
--
-- --dd Enables debugging.
--
-- --ee Disables command line editing. This is useful for Emacs ange-
-- ftp mode.
--
-- --ff Forces a cache reload for transfers that go through the FTP or
-- HTTP proxies.
--
-- --gg Disables file name globbing.
--
-- --ii Turns off interactive prompting during multiple file transfers.
--
-- --nn Restrains ffttpp from attempting ``auto-login'' upon initial con-
-- nection. If auto-login is enabled, ffttpp will check the _._n_e_t_r_c
-- (see below) file in the user's home directory for an entry de-
-- scribing an account on the remote machine. If no entry exists,
-- ffttpp will prompt for the remote machine login name (default is
-- the user identity on the local machine), and, if necessary,
-- prompt for a password and an account with which to login.
--
-- --NN _n_e_t_r_c
-- Use _n_e_t_r_c instead of _~_/_._n_e_t_r_c. Refer to _T_H_E _._n_e_t_r_c _F_I_L_E for
-- more information.
--
-- --oo _o_u_t_p_u_t
-- When auto-fetching files, save the contents in _o_u_t_p_u_t. _o_u_t_p_u_t
-- is parsed according to the _F_I_L_E _N_A_M_I_N_G _C_O_N_V_E_N_T_I_O_N_S below. If
-- _o_u_t_p_u_t is not `-' or doesn't start with `|', then only the first
-- file specified will be retrieved into _o_u_t_p_u_t; all other files
-- will be retrieved into the basename of their remote name.
--
-- --pp Enable passive mode operation for use behind connection filter-
-- ing firewalls. This option has been deprecated as ffttpp now tries
-- to use passive mode by default, falling back to active mode if
-- the server does not support passive connections.
--
-- --PP _p_o_r_t Sets the port number to _p_o_r_t.
--
-- --rr _w_a_i_t Retry the connection attempt if it failed, pausing for _w_a_i_t sec-
-- onds.
--
-- --RR Restart all non-proxied auto-fetches.
--
-- --tt Enables packet tracing.
--
-- --TT _d_i_r_e_c_t_i_o_n,_m_a_x_i_m_u_m[,_i_n_c_r_e_m_e_n_t]
-- Set the maximum transfer rate for _d_i_r_e_c_t_i_o_n to _m_a_x_i_m_u_m
-- bytes/second, and if specified, the increment to _i_n_c_r_e_m_e_n_t
-- bytes/second. Refer to rraattee for more information.
--
-- --uu _u_r_l _f_i_l_e [...]
-- Upload files on the command line to _u_r_l where _u_r_l is one of the
-- ftp URL types as supported by auto-fetch (with an optional tar-
-- get filename for single file uploads), and _f_i_l_e is one or more
-- local files to be uploaded.
--
-- --vv Enable vveerrbboossee and pprrooggrreessss. This is the default if output is
-- to a terminal (and in the case of pprrooggrreessss, ffttpp is the fore-
-- ground process). Forces ffttpp to show all responses from the re-
-- mote server, as well as report on data transfer statistics.
--
-- --VV Disable vveerrbboossee and pprrooggrreessss, overriding the default of enabled
-- when output is to a terminal.
--
-- The client host with which ffttpp is to communicate may be specified on the
-- command line. If this is done, ffttpp will immediately attempt to establish
-- a connection to an FTP server on that host; otherwise, ffttpp will enter its
-- command interpreter and await instructions from the user. When ffttpp is
-- awaiting commands from the user the prompt `ftp>' is provided to the us-
-- er. The following commands are recognized by ffttpp:
--
-- !! [_c_o_m_m_a_n_d [_a_r_g_s]]
-- Invoke an interactive shell on the local machine. If there
-- are arguments, the first is taken to be a command to execute
-- directly, with the rest of the arguments as its arguments.
--
-- $$ _m_a_c_r_o_-_n_a_m_e [_a_r_g_s]
-- Execute the macro _m_a_c_r_o_-_n_a_m_e that was defined with the mmaaccddeeff
-- command. Arguments are passed to the macro unglobbed.
--
-- aaccccoouunntt [_p_a_s_s_w_d]
-- Supply a supplemental password required by a remote system
-- for access to resources once a login has been successfully
-- completed. If no argument is included, the user will be
-- prompted for an account password in a non-echoing input mode.
--
-- aappppeenndd _l_o_c_a_l_-_f_i_l_e [_r_e_m_o_t_e_-_f_i_l_e]
-- Append a local file to a file on the remote machine. If
-- _r_e_m_o_t_e_-_f_i_l_e is left unspecified, the local file name is used
-- in naming the remote file after being altered by any nnttrraannss
-- or nnmmaapp setting. File transfer uses the current settings for
-- ttyyppee, ffoorrmmaatt, mmooddee, and ssttrruuccttuurree.
--
-- aasscciiii Set the file transfer ttyyppee to network ASCII. This is the de-
-- fault type.
--
-- bbeellll Arrange that a bell be sounded after each file transfer com-
-- mand is completed.
--
-- bbiinnaarryy Set the file transfer ttyyppee to support binary image transfer.
--
-- bbyyee Terminate the FTP session with the remote server and exit
-- ffttpp. An end of file will also terminate the session and ex-
-- it.
--
-- ccaassee Toggle remote computer file name case mapping during ggeett,
-- mmggeett and mmppuutt commands. When ccaassee is on (default is off),
-- remote computer file names with all letters in upper case are
-- written in the local directory with the letters mapped to
-- lower case.
--
-- ccdd _r_e_m_o_t_e_-_d_i_r_e_c_t_o_r_y
-- Change the working directory on the remote machine to _r_e_m_o_t_e_-
-- _d_i_r_e_c_t_o_r_y.
--
-- ccdduupp Change the remote machine working directory to the parent of
-- the current remote machine working directory.
--
-- cchhmmoodd _m_o_d_e _r_e_m_o_t_e_-_f_i_l_e
-- Change the permission modes of the file _r_e_m_o_t_e_-_f_i_l_e on the
-- remote system to _m_o_d_e.
--
-- cclloossee Terminate the FTP session with the remote server, and return
-- to the command interpreter. Any defined macros are erased.
--
-- ccrr Toggle carriage return stripping during ascii type file re-
-- trieval. Records are denoted by a carriage return/linefeed
-- sequence during ascii type file transfer. When ccrr is on (the
-- default), carriage returns are stripped from this sequence to
-- conform with the UNIX single linefeed record delimiter.
-- Records on non-UNIX remote systems may contain single line-
-- feeds; when an ascii type transfer is made, these linefeeds
-- may be distinguished from a record delimiter only when ccrr is
-- off.
--
-- ddeebbuugg [_d_e_b_u_g_-_v_a_l_u_e]
-- Toggle debugging mode. If an optional _d_e_b_u_g_-_v_a_l_u_e is speci-
-- fied it is used to set the debugging level. When debugging
-- is on, ffttpp prints each command sent to the remote machine,
-- preceded by the string `-->'
--
-- ddeelleettee _r_e_m_o_t_e_-_f_i_l_e
-- Delete the file _r_e_m_o_t_e_-_f_i_l_e on the remote machine.
--
-- ddiirr [_r_e_m_o_t_e_-_p_a_t_h [_l_o_c_a_l_-_f_i_l_e]]
-- Print a listing of the contents of a directory on the remote
-- machine. The listing includes any system-dependent informa-
-- tion that the server chooses to include; for example, most
-- UNIX systems will produce output from the command `ls -l'.
-- If _r_e_m_o_t_e_-_p_a_t_h is left unspecified, the current working di-
-- rectory is used. If interactive prompting is on, ffttpp will
-- prompt the user to verify that the last argument is indeed
-- the target local file for receiving ddiirr output. If no local
-- file is specified, or if _l_o_c_a_l_-_f_i_l_e is `--', the output is
-- sent to the terminal.
--
-- ddiissccoonnnneecctt A synonym for cclloossee.
--
-- eeddiitt Toggle command line editing, and context sensitive command
-- and file completion. This is automatically enabled if input
-- is from a terminal, and disabled otherwise.
--
-- eeppssvv44 Toggle the use of the extended EPSV and EPRT commands on IPv4
-- connections; first try EPSV / EPRT, and then PASV / PORT.
-- This is enabled by default. If an extended command fails
-- then this option will be temporarily disabled for the dura-
-- tion of the current connection, or until eeppssvv44 is executed
-- again.
--
-- eexxiitt A synonym for bbyyee.
--
-- ffeeaattuurreess Display what features the remote server supports (using the
-- FEAT command).
--
-- ffggeett _l_o_c_a_l_f_i_l_e
-- Retrieve the files listed in _l_o_c_a_l_f_i_l_e, which has one line
-- per filename.
--
-- ffoorrmm _f_o_r_m_a_t
-- Set the file transfer ffoorrmm to _f_o_r_m_a_t. The default (and only
-- supported) format is ``non-print''.
--
-- ffttpp _h_o_s_t [_p_o_r_t]
-- A synonym for ooppeenn.
--
-- ggaattee [_h_o_s_t [_p_o_r_t]]
-- Toggle gate-ftp mode, which used to connect through the TIS
-- FWTK and Gauntlet ftp proxies. This will not be permitted if
-- the gate-ftp server hasn't been set (either explicitly by the
-- user, or from the FTPSERVER environment variable). If _h_o_s_t
-- is given, then gate-ftp mode will be enabled, and the gate-
-- ftp server will be set to _h_o_s_t. If _p_o_r_t is also given, that
-- will be used as the port to connect to on the gate-ftp serv-
-- er.
--
-- ggeett _r_e_m_o_t_e_-_f_i_l_e [_l_o_c_a_l_-_f_i_l_e]
-- Retrieve the _r_e_m_o_t_e_-_f_i_l_e and store it on the local machine.
-- If the local file name is not specified, it is given the same
-- name it has on the remote machine, subject to alteration by
-- the current ccaassee, nnttrraannss, and nnmmaapp settings. The current
-- settings for ttyyppee, ffoorrmm, mmooddee, and ssttrruuccttuurree are used while
-- transferring the file.
--
-- gglloobb Toggle filename expansion for mmddeelleettee, mmggeett, mmppuutt, and
-- mmrreeggeett. If globbing is turned off with gglloobb, the file name
-- arguments are taken literally and not expanded. Globbing for
-- mmppuutt is done as in csh(1). For mmddeelleettee, mmggeett, and mmrreeggeett,
-- each remote file name is expanded separately on the remote
-- machine and the lists are not merged. Expansion of a direc-
-- tory name is likely to be different from expansion of the
-- name of an ordinary file: the exact result depends on the
-- foreign operating system and ftp server, and can be previewed
-- by doing `mls remote-files -' Note: mmggeett, mmppuutt and mmrreeggeett are
-- not meant to transfer entire directory subtrees of files.
-- That can be done by transferring a tar(1) archive of the sub-
-- tree (in binary mode).
--
-- hhaasshh [_s_i_z_e]
-- Toggle hash-sign (``#'') printing for each data block trans-
-- ferred. The size of a data block defaults to 1024 bytes.
-- This can be changed by specifying _s_i_z_e in bytes. Enabling
-- hhaasshh disables pprrooggrreessss.
--
-- hheellpp [_c_o_m_m_a_n_d]
-- Print an informative message about the meaning of _c_o_m_m_a_n_d.
-- If no argument is given, ffttpp prints a list of the known com-
-- mands.
--
-- iiddllee [_s_e_c_o_n_d_s]
-- Set the inactivity timer on the remote server to _s_e_c_o_n_d_s sec-
-- onds. If _s_e_c_o_n_d_s is omitted, the current inactivity timer is
-- printed.
--
-- iimmaaggee A synonym for bbiinnaarryy.
--
-- llccdd [_d_i_r_e_c_t_o_r_y]
-- Change the working directory on the local machine. If no
-- _d_i_r_e_c_t_o_r_y is specified, the user's home directory is used.
--
-- lleessss _f_i_l_e A synonym for ppaaggee.
--
-- llppaaggee _l_o_c_a_l_-_f_i_l_e
-- Display _l_o_c_a_l_-_f_i_l_e with the program specified by the sseett
-- ppaaggeerr option.
--
-- llppwwdd Print the working directory on the local machine.
--
-- llss [_r_e_m_o_t_e_-_p_a_t_h [_l_o_c_a_l_-_f_i_l_e]]
-- A synonym for ddiirr.
--
-- mmaaccddeeff _m_a_c_r_o_-_n_a_m_e
-- Define a macro. Subsequent lines are stored as the macro
-- _m_a_c_r_o_-_n_a_m_e; a null line (consecutive newline characters in a
-- file or carriage returns from the terminal) terminates macro
-- input mode. There is a limit of 16 macros and 4096 total
-- characters in all defined macros. Macros remain defined un-
-- til a cclloossee command is executed. The macro processor inter-
-- prets `$' and `\' as special characters. A `$' followed by a
-- number (or numbers) is replaced by the corresponding argument
-- on the macro invocation command line. A `$' followed by an
-- `i' signals that macro processor that the executing macro is
-- to be looped. On the first pass `$i' is replaced by the
-- first argument on the macro invocation command line, on the
-- second pass it is replaced by the second argument, and so on.
-- A `\' followed by any character is replaced by that charac-
-- ter. Use the `\' to prevent special treatment of the `$'.
--
-- mmddeelleettee [_r_e_m_o_t_e_-_f_i_l_e_s]
-- Delete the _r_e_m_o_t_e_-_f_i_l_e_s on the remote machine.
--
-- mmddiirr _r_e_m_o_t_e_-_f_i_l_e_s _l_o_c_a_l_-_f_i_l_e
-- Like ddiirr, except multiple remote files may be specified. If
-- interactive prompting is on, ffttpp will prompt the user to ver-
-- ify that the last argument is indeed the target local file
-- for receiving mmddiirr output.
--
-- mmggeett _r_e_m_o_t_e_-_f_i_l_e_s
-- Expand the _r_e_m_o_t_e_-_f_i_l_e_s on the remote machine and do a ggeett
-- for each file name thus produced. See gglloobb for details on
-- the filename expansion. Resulting file names will then be
-- processed according to ccaassee, nnttrraannss, and nnmmaapp settings.
-- Files are transferred into the local working directory, which
-- can be changed with `lcd directory'; new local directories
-- can be created with `! mkdir directory'.
--
-- mmkkddiirr _d_i_r_e_c_t_o_r_y_-_n_a_m_e
-- Make a directory on the remote machine.
--
-- mmllss _r_e_m_o_t_e_-_f_i_l_e_s _l_o_c_a_l_-_f_i_l_e
-- Like llss, except multiple remote files may be specified, and
-- the _l_o_c_a_l_-_f_i_l_e must be specified. If interactive prompting
-- is on, ffttpp will prompt the user to verify that the last argu-
-- ment is indeed the target local file for receiving mmllss out-
-- put.
--
-- mmllssdd [_r_e_m_o_t_e_-_p_a_t_h]
-- Display the contents of _r_e_m_o_t_e_-_p_a_t_h (which should default to
-- the current directory if not given) in a machine-parsable
-- form, using MLSD. The format of display can be changed with
-- `remopts mlst ...'.
--
-- mmllsstt [_r_e_m_o_t_e_-_p_a_t_h]
-- Display the details about _r_e_m_o_t_e_-_p_a_t_h (which should default
-- to the current directory if not given) in a machine-parsable
-- form, using MLST. The format of display can be changed with
-- `remopts mlst ...'.
--
-- mmooddee _m_o_d_e_-_n_a_m_e
-- Set the file transfer mmooddee to _m_o_d_e_-_n_a_m_e. The default (and
-- only supported) mode is ``stream''.
--
-- mmooddttiimmee _r_e_m_o_t_e_-_f_i_l_e
-- Show the last modification time of the file on the remote ma-
-- chine.
--
-- mmoorree _f_i_l_e A synonym for ppaaggee.
--
-- mmppuutt _l_o_c_a_l_-_f_i_l_e_s
-- Expand wild cards in the list of local files given as argu-
-- ments and do a ppuutt for each file in the resulting list. See
-- gglloobb for details of filename expansion. Resulting file names
-- will then be processed according to nnttrraannss and nnmmaapp settings.
--
-- mmrreeggeett _r_e_m_o_t_e_-_f_i_l_e_s
-- As per mmggeett, but performs a rreeggeett instead of ggeett.
--
-- mmsseenndd _l_o_c_a_l_-_f_i_l_e_s
-- A synonym for mmppuutt.
--
-- nneewweerr _r_e_m_o_t_e_-_f_i_l_e [_l_o_c_a_l_-_f_i_l_e]
-- Get the file only if the modification time of the remote file
-- is more recent that the file on the current system. If the
-- file does not exist on the current system, the remote file is
-- considered nneewweerr. Otherwise, this command is identical to
-- _g_e_t.
--
-- nnlliisstt [_r_e_m_o_t_e_-_p_a_t_h [_l_o_c_a_l_-_f_i_l_e]]
-- A synonym for llss.
--
-- nnmmaapp [_i_n_p_a_t_t_e_r_n _o_u_t_p_a_t_t_e_r_n]
-- Set or unset the filename mapping mechanism. If no arguments
-- are specified, the filename mapping mechanism is unset. If
-- arguments are specified, remote filenames are mapped during
-- mmppuutt commands and ppuutt commands issued without a specified re-
-- mote target filename. If arguments are specified, local
-- filenames are mapped during mmggeett commands and ggeett commands
-- issued without a specified local target filename. This com-
-- mand is useful when connecting to a non-UNIX remote computer
-- with different file naming conventions or practices. The
-- mapping follows the pattern set by _i_n_p_a_t_t_e_r_n and _o_u_t_p_a_t_t_e_r_n.
-- [_I_n_p_a_t_t_e_r_n] is a template for incoming filenames (which may
-- have already been processed according to the nnttrraannss and ccaassee
-- settings). Variable templating is accomplished by including
-- the sequences `$1', `$2', ..., `$9' in _i_n_p_a_t_t_e_r_n. Use `\' to
-- prevent this special treatment of the `$' character. All
-- other characters are treated literally, and are used to de-
-- termine the nnmmaapp [_i_n_p_a_t_t_e_r_n] variable values. For example,
-- given _i_n_p_a_t_t_e_r_n $1.$2 and the remote file name "mydata.data",
-- $1 would have the value "mydata", and $2 would have the value
-- "data". The _o_u_t_p_a_t_t_e_r_n determines the resulting mapped file-
-- name. The sequences `$1', `$2', ...., `$9' are replaced by
-- any value resulting from the _i_n_p_a_t_t_e_r_n template. The se-
-- quence `$0' is replace by the original filename. Additional-
-- ly, the sequence `[_s_e_q_1, _s_e_q_2]' is replaced by [_s_e_q_1] if _s_e_q_1
-- is not a null string; otherwise it is replaced by _s_e_q_2. For
-- example, the command
--
-- nmap $1.$2.$3 [$1,$2].[$2,file]
--
-- would yield the output filename "myfile.data" for input file-
-- names "myfile.data" and "myfile.data.old", "myfile.file" for
-- the input filename "myfile", and "myfile.myfile" for the in-
-- put filename ".myfile". Spaces may be included in
-- _o_u_t_p_a_t_t_e_r_n, as in the example: `nmap $1 sed "s/ *$//" > $1'
-- . Use the `\' character to prevent special treatment of the
-- `$','[',']', and `,' characters.
--
-- nnttrraannss [_i_n_c_h_a_r_s [_o_u_t_c_h_a_r_s]]
-- Set or unset the filename character translation mechanism.
-- If no arguments are specified, the filename character trans-
-- lation mechanism is unset. If arguments are specified, char-
-- acters in remote filenames are translated during mmppuutt com-
-- mands and ppuutt commands issued without a specified remote tar-
-- get filename. If arguments are specified, characters in lo-
-- cal filenames are translated during mmggeett commands and ggeett
-- commands issued without a specified local target filename.
-- This command is useful when connecting to a non-UNIX remote
-- computer with different file naming conventions or practices.
-- Characters in a filename matching a character in _i_n_c_h_a_r_s are
-- replaced with the corresponding character in _o_u_t_c_h_a_r_s. If
-- the character's position in _i_n_c_h_a_r_s is longer than the length
-- of _o_u_t_c_h_a_r_s, the character is deleted from the file name.
--
-- ooppeenn _h_o_s_t [_p_o_r_t]
-- Establish a connection to the specified _h_o_s_t FTP server. An
-- optional port number may be supplied, in which case, ffttpp will
-- attempt to contact an FTP server at that port. If the aauuttoo--
-- llooggiinn option is on (default), ffttpp will also attempt to auto-
-- matically log the user in to the FTP server (see below).
--
-- ppaaggee _f_i_l_e Retrieve ffiillee and display with the program specified by the
-- sseett ppaaggeerr option.
--
-- ppaassssiivvee [aauuttoo]
-- Toggle passive mode (if no arguments are given). If aauuttoo is
-- given, act as if FTPMODE is set to `auto'. If passive mode
-- is turned on (default), ffttpp will send a PASV command for all
-- data connections instead of a PORT command. The PASV command
-- requests that the remote server open a port for the data con-
-- nection and return the address of that port. The remote
-- server listens on that port and the client connects to it.
-- When using the more traditional PORT command, the client lis-
-- tens on a port and sends that address to the remote server,
-- who connects back to it. Passive mode is useful when using
-- ffttpp through a gateway router or host that controls the direc-
-- tionality of traffic. (Note that though FTP servers are re-
-- quired to support the PASV command by RFC 1123, some do not.)
--
-- ppddiirr [_r_e_m_o_t_e_-_p_a_t_h]
-- Perform ddiirr [_r_e_m_o_t_e_-_p_a_t_h], and display the result with the
-- program specified by the sseett ppaaggeerr option.
--
-- ppllss [_r_e_m_o_t_e_-_p_a_t_h]
-- Perform llss [_r_e_m_o_t_e_-_p_a_t_h], and display the result with the
-- program specified by the sseett ppaaggeerr option.
--
-- ppmmllssdd [_r_e_m_o_t_e_-_p_a_t_h]
-- Perform mmllssdd [_r_e_m_o_t_e_-_p_a_t_h], and display the result with the
-- program specified by the sseett ppaaggeerr option.
--
-- pprreesseerrvvee Toggle preservation of modification times on retrieved files.
--
-- pprrooggrreessss Toggle display of transfer progress bar. The progress bar
-- will be disabled for a transfer that has _l_o_c_a_l_-_f_i_l_e as `--' or
-- a command that starts with `|'. Refer to _F_I_L_E _N_A_M_I_N_G
-- _C_O_N_V_E_N_T_I_O_N_S for more information. Enabling pprrooggrreessss disables
-- hhaasshh.
--
-- pprroommpptt Toggle interactive prompting. Interactive prompting occurs
-- during multiple file transfers to allow the user to selec-
-- tively retrieve or store files. If prompting is turned off
-- (default is on), any mmggeett or mmppuutt will transfer all files,
-- and any mmddeelleettee will delete all files.
--
-- When prompting is on, the following commands are available at
-- a prompt:
--
-- aa Answer `yes' to the current file, and automatically
-- answer `yes' to any remaining files for the current
-- command.
--
-- nn Answer `no', and do not transfer the file.
--
-- pp Answer `yes' to the current file, and turn off
-- prompt mode (as is ``prompt off'' had been given).
--
-- qq Terminate the current operation.
--
-- yy Answer `yes', and transfer the file.
--
-- ?? Display a help message.
--
-- Any other reponse will answer `yes' to the current file.
--
-- pprrooxxyy _f_t_p_-_c_o_m_m_a_n_d
-- Execute an ftp command on a secondary control connection.
-- This command allows simultaneous connection to two remote FTP
-- servers for transferring files between the two servers. The
-- first pprrooxxyy command should be an ooppeenn, to establish the sec-
-- ondary control connection. Enter the command "proxy ?" to
-- see other FTP commands executable on the secondary connec-
-- tion. The following commands behave differently when pref-
-- aced by pprrooxxyy: ooppeenn will not define new macros during the au-
-- to-login process, cclloossee will not erase existing macro defini-
-- tions, ggeett and mmggeett transfer files from the host on the pri-
-- mary control connection to the host on the secondary control
-- connection, and ppuutt, mmppuutt, and aappppeenndd transfer files from the
-- host on the secondary control connection to the host on the
-- primary control connection. Third party file transfers de-
-- pend upon support of the FTP protocol PASV command by the
-- server on the secondary control connection.
--
-- ppuutt _l_o_c_a_l_-_f_i_l_e [_r_e_m_o_t_e_-_f_i_l_e]
-- Store a local file on the remote machine. If _r_e_m_o_t_e_-_f_i_l_e is
-- left unspecified, the local file name is used after process-
-- ing according to any nnttrraannss or nnmmaapp settings in naming the
-- remote file. File transfer uses the current settings for
-- ttyyppee, ffoorrmmaatt, mmooddee, and ssttrruuccttuurree.
--
-- ppwwdd Print the name of the current working directory on the remote
-- machine.
--
-- qquuiitt A synonym for bbyyee.
--
-- qquuoottee _a_r_g_1 _a_r_g_2 _._._.
-- The arguments specified are sent, verbatim, to the remote FTP
-- server.
--
-- rraattee _d_i_r_e_c_t_i_o_n [_m_a_x_i_m_u_m [_i_n_c_r_e_m_e_n_t]]
-- Throttle the maximum transfer rate to _m_a_x_i_m_u_m bytes/second.
-- If _m_a_x_i_m_u_m is 0, disable the throttle.
--
-- _d_i_r_e_c_t_i_o_n may be one of:
-- aallll Both directions.
-- ggeett Incoming transfers.
-- ppuutt Outgoing transfers.
--
-- _m_a_x_i_m_u_m can by modified on the fly by _i_n_c_r_e_m_e_n_t bytes (de-
-- fault: 1024) each time a given signal is received:
--
-- SIGUSR1 Increment _m_a_x_i_m_u_m by _i_n_c_r_e_m_e_n_t bytes.
--
-- SIGUSR2 Decrement _m_a_x_i_m_u_m by _i_n_c_r_e_m_e_n_t bytes. The re-
-- sult must be a positive number.
--
-- If _m_a_x_i_m_u_m is not supplied, the current throttle rates are
-- displayed.
--
-- Note: rraattee is not yet implemented for ascii mode transfers.
--
-- rrccvvbbuuff _s_i_z_e
-- Set the size of the socket receive buffer to _s_i_z_e.
--
-- rreeccvv _r_e_m_o_t_e_-_f_i_l_e [_l_o_c_a_l_-_f_i_l_e]
-- A synonym for ggeett.
--
-- rreeggeett _r_e_m_o_t_e_-_f_i_l_e [_l_o_c_a_l_-_f_i_l_e]
-- rreeggeett acts like ggeett, except that if _l_o_c_a_l_-_f_i_l_e exists and is
-- smaller than _r_e_m_o_t_e_-_f_i_l_e, _l_o_c_a_l_-_f_i_l_e is presumed to be a par-
-- tially transferred copy of _r_e_m_o_t_e_-_f_i_l_e and the transfer is
-- continued from the apparent point of failure. This command
-- is useful when transferring very large files over networks
-- that are prone to dropping connections.
--
-- rreemmooppttss _c_o_m_m_a_n_d [_c_o_m_m_a_n_d_-_o_p_t_i_o_n_s]
-- Set options on the remote FTP server for _c_o_m_m_a_n_d to _c_o_m_m_a_n_d_-
-- _o_p_t_i_o_n_s (whose absence is handled on a command-specific ba-
-- sis). Remote FTP commands known to support options include:
-- `MLST' (used for MLSD and MLST).
--
-- rreennaammee [_f_r_o_m [_t_o]]
-- Rename the file _f_r_o_m on the remote machine, to the file _t_o.
--
-- rreesseett Clear reply queue. This command re-synchronizes command/re-
-- ply sequencing with the remote FTP server. Resynchronization
-- may be necessary following a violation of the FTP protocol by
-- the remote server.
--
-- rreessttaarrtt _m_a_r_k_e_r
-- Restart the immediately following ggeett or ppuutt at the indicated
-- _m_a_r_k_e_r. On UNIX systems, marker is usually a byte offset in-
-- to the file.
--
-- rrhheellpp [_c_o_m_m_a_n_d_-_n_a_m_e]
-- Request help from the remote FTP server. If a _c_o_m_m_a_n_d_-_n_a_m_e
-- is specified it is supplied to the server as well.
--
-- rrmmddiirr _d_i_r_e_c_t_o_r_y_-_n_a_m_e
-- Delete a directory on the remote machine.
--
-- rrssttaattuuss [_r_e_m_o_t_e_-_f_i_l_e]
-- With no arguments, show status of remote machine. If _r_e_m_o_t_e_-
-- _f_i_l_e is specified, show status of _r_e_m_o_t_e_-_f_i_l_e on remote ma-
-- chine.
--
-- rruunniiqquuee Toggle storing of files on the local system with unique file-
-- names. If a file already exists with a name equal to the
-- target local filename for a ggeett or mmggeett command, a ".1" is
-- appended to the name. If the resulting name matches another
-- existing file, a ".2" is appended to the original name. If
-- this process continues up to ".99", an error message is
-- printed, and the transfer does not take place. The generated
-- unique filename will be reported. Note that rruunniiqquuee will not
-- affect local files generated from a shell command (see be-
-- low). The default value is off.
--
-- sseenndd _l_o_c_a_l_-_f_i_l_e [_r_e_m_o_t_e_-_f_i_l_e]
-- A synonym for ppuutt.
--
-- sseennddppoorrtt Toggle the use of PORT commands. By default, ffttpp will at-
-- tempt to use a PORT command when establishing a connection
-- for each data transfer. The use of PORT commands can prevent
-- delays when performing multiple file transfers. If the PORT
-- command fails, ffttpp will use the default data port. When the
-- use of PORT commands is disabled, no attempt will be made to
-- use PORT commands for each data transfer. This is useful for
-- certain FTP implementations which do ignore PORT commands
-- but, incorrectly, indicate they've been accepted.
--
-- sseett [_o_p_t_i_o_n _v_a_l_u_e]
-- Set _o_p_t_i_o_n to _v_a_l_u_e. If _o_p_t_i_o_n and _v_a_l_u_e are not given, dis-
-- play all of the options and their values. The currently sup-
-- ported options are:
--
-- anonpass Defaults to $FTPANONPASS
--
-- ftp_proxy Defaults to $ftp_proxy.
--
-- http_proxy Defaults to $http_proxy.
--
-- no_proxy Defaults to $no_proxy.
--
-- pager Defaults to $PAGER.
--
-- prompt Defaults to $FTPPROMPT.
--
-- rprompt Defaults to $FTPRPROMPT.
--
-- ssiittee _a_r_g_1 _a_r_g_2 _._._.
-- The arguments specified are sent, verbatim, to the remote FTP
-- server as a SITE command.
--
-- ssiizzee _r_e_m_o_t_e_-_f_i_l_e
-- Return size of _r_e_m_o_t_e_-_f_i_l_e on remote machine.
--
-- ssnnddbbuuff _s_i_z_e
-- Set the size of the socket send buffer to _s_i_z_e.
--
-- ssttaattuuss Show the current status of ffttpp.
--
-- ssttrruucctt _s_t_r_u_c_t_-_n_a_m_e
-- Set the file transfer _s_t_r_u_c_t_u_r_e to _s_t_r_u_c_t_-_n_a_m_e. The default
-- (and only supported) structure is ``file''.
--
-- ssuunniiqquuee Toggle storing of files on remote machine under unique file
-- names. The remote FTP server must support FTP protocol STOU
-- command for successful completion. The remote server will
-- report unique name. Default value is off.
--
-- ssyysstteemm Show the type of operating system running on the remote ma-
-- chine.
--
-- tteenneexx Set the file transfer type to that needed to talk to TENEX
-- machines.
--
-- tthhrroottttllee A synonym for rraattee.
--
-- ttrraaccee Toggle packet tracing.
--
-- ttyyppee [_t_y_p_e_-_n_a_m_e]
-- Set the file transfer ttyyppee to _t_y_p_e_-_n_a_m_e. If no type is spec-
-- ified, the current type is printed. The default type is net-
-- work ASCII.
--
-- uummaasskk [_n_e_w_m_a_s_k]
-- Set the default umask on the remote server to _n_e_w_m_a_s_k. If
-- _n_e_w_m_a_s_k is omitted, the current umask is printed.
--
-- uunnsseett _o_p_t_i_o_n
-- Unset _o_p_t_i_o_n. Refer to sseett for more information.
--
-- uussaaggee _c_o_m_m_a_n_d
-- Print the usage message for _c_o_m_m_a_n_d.
--
-- uusseerr _u_s_e_r_-_n_a_m_e [_p_a_s_s_w_o_r_d [_a_c_c_o_u_n_t]]
-- Identify yourself to the remote FTP server. If the _p_a_s_s_w_o_r_d
-- is not specified and the server requires it, ffttpp will prompt
-- the user for it (after disabling local echo). If an _a_c_c_o_u_n_t
-- field is not specified, and the FTP server requires it, the
-- user will be prompted for it. If an _a_c_c_o_u_n_t field is speci-
-- fied, an account command will be relayed to the remote server
-- after the login sequence is completed if the remote server
-- did not require it for logging in. Unless ffttpp is invoked
-- with ``auto-login'' disabled, this process is done automati-
-- cally on initial connection to the FTP server.
--
-- vveerrbboossee Toggle verbose mode. In verbose mode, all responses from the
-- FTP server are displayed to the user. In addition, if ver-
-- bose is on, when a file transfer completes, statistics re-
-- garding the efficiency of the transfer are reported. By de-
-- fault, verbose is on.
--
-- xxffeerrbbuuff _s_i_z_e
-- Set the size of the socket send and receive buffers to _s_i_z_e.
--
-- ?? [_c_o_m_m_a_n_d]
-- A synonym for hheellpp.
--
-- Command arguments which have embedded spaces may be quoted with quote `"'
-- marks.
--
-- Commands which toggle settings can take an explicit oonn or ooffff argument to
-- force the setting appropriately.
--
-- Commands which take a byte count as an argument (e.g., hhaasshh, rraattee, and
-- xxffeerrbbuuff) support an optional suffix on the argument which changes the in-
-- terpretation of the argument. Supported suffixes are:
-- b Causes no modification. (Optional)
-- k Kilo; multiply the argument by 1024
-- m Mega; multiply the argument by 1048576
-- g Giga; multiply the argument by 1073741824
--
-- If ffttpp receives a SIGINFO (see the ``status'' argument of stty(1)) or
-- SIGQUIT signal whilst a transfer is in progress, the current transfer
-- rate statistics will be written to the standard error output, in the same
-- format as the standard completion message.
--
--AAUUTTOO--FFEETTCCHHIINNGG FFIILLEESS
-- In addition to standard commands, this version of ffttpp supports an auto-
-- fetch feature. To enable auto-fetch, simply pass the list of host-
-- names/files on the command line.
--
-- The following formats are valid syntax for an auto-fetch element:
--
-- [user@]host:[path][/]
-- ``Classic'' FTP format.
--
-- If _p_a_t_h contains a glob character and globbing is enabled, (see
-- gglloobb), then the equivalent of `mget path' is performed.
--
-- If the directory component of _p_a_t_h contains no globbing characters,
-- it is stored locally with the name basename (see basename(1)) of
-- ppaatthh, in the current directory. Otherwise, the full remote name is
-- used as the local name, relative to the local root directory.
--
-- ftp://[user[:password]@]host[:port]/path[/][;type=X]
-- An FTP URL, retrieved using the FTP protocol if sseett ffttpp__pprrooxxyy isn't
-- defined. Otherwise, transfer the URL using HTTP via the proxy de-
-- fined in sseett ffttpp__pprrooxxyy. If sseett ffttpp__pprrooxxyy isn't defined and _u_s_e_r is
-- given, login as _u_s_e_r. In this case, use _p_a_s_s_w_o_r_d if supplied, oth-
-- erwise prompt the user for one.
--
-- In order to be compliant with RRFFCC 11773388, ffttpp strips the leading `/'
-- from _p_a_t_h, resulting in a transfer relative from the default login
-- directory of the user. If the _/ directory is required, use a lead-
-- ing path of ``%2F''. If a user's home directory is required (and
-- the remote server supports the syntax), use a leading path of
-- ``%7Euser/''. For example, to retrieve _/_e_t_c_/_m_o_t_d from `localhost'
-- as the user `myname' with the password `mypass', use
-- ``ftp://myname:mypass@localhost/%2fetc/motd''
--
-- If a suffix of `;type=A' or `;type=I' is supplied, then the trans-
-- fer type will take place as ascii or binary (respectively). The
-- default transfer type is binary.
--
-- http://[user[:password]@]host[:port]/path
-- An HTTP URL, retrieved using the HTTP protocol. If sseett hhttttpp__pprrooxxyy
-- is defined, it is used as a URL to an HTTP proxy server. If HTTP
-- authorisation is required to retrieve _p_a_t_h, and `user' (and option-
-- ally `password') is in the URL, use them for the first attempt to
-- authenticate.
--
-- file:///path
-- A local URL, copied from _/_p_a_t_h.
--
-- Unless noted otherwise above, and --oo _o_u_t_p_u_t is not given, the file is
-- stored in the current directory as the basename(1) of _p_a_t_h.
--
-- If a classic format or an FTP URL format has a trailing `/' or an empty
-- _p_a_t_h component, then ffttpp will connect to the site and ccdd to the directory
-- given as the path, and leave the user in interactive mode ready for fur-
-- ther input. This will not work if sseett ffttpp__pprrooxxyy is being used.
--
-- Direct HTTP transfers use HTTP 1.1. Proxied FTP and HTTP transfers use
-- HTTP 1.0.
--
-- If --RR is given, all auto-fetches that don't go via the FTP or HTTP prox-
-- ies will be restarted. For FTP, this is implemented by using rreeggeett in-
-- stead of ggeett. For HTTP, this is implemented by using the `Range: bytes='
-- HTTP/1.1 directive.
--
-- If WWW or proxy WWW authentication is required, you will be prompted to
-- enter a username and password to authenticate with.
--
-- When specifying IPv6 numeric addresses in a URL, you need to surround the
-- address in square brackets. E.g.: ``ftp://[::1]:21/''. This is because
-- colons are used in IPv6 numeric address as well as being the separator
-- for the port number.
--
--AABBOORRTTIINNGG AA FFIILLEE TTRRAANNSSFFEERR
-- To abort a file transfer, use the terminal interrupt key (usually Ctrl-
-- C). Sending transfers will be immediately halted. Receiving transfers
-- will be halted by sending an FTP protocol ABOR command to the remote
-- server, and discarding any further data received. The speed at which
-- this is accomplished depends upon the remote server's support for ABOR
-- processing. If the remote server does not support the ABOR command, the
-- prompt will not appear until the remote server has completed sending the
-- requested file.
--
-- If the terminal interrupt key sequence is used whilst ffttpp is awaiting a
-- reply from the remote server for the ABOR processing, then the connection
-- will be closed. This is different from the traditional behaviour (which
-- ignores the terminal interrupt during this phase), but is considered more
-- useful.
--
--FFIILLEE NNAAMMIINNGG CCOONNVVEENNTTIIOONNSS
-- Files specified as arguments to ffttpp commands are processed according to
-- the following rules.
--
-- 1. If the file name `--' is specified, the _s_t_d_i_n (for reading) or _s_t_d_o_u_t
-- (for writing) is used.
--
-- 2. If the first character of the file name is `|', the remainder of the
-- argument is interpreted as a shell command. ffttpp then forks a shell,
-- using popen(3) with the argument supplied, and reads (writes) from
-- the stdout (stdin). If the shell command includes spaces, the argu-
-- ment must be quoted; e.g. ``"| ls -lt"''. A particularly useful
-- example of this mechanism is: ``dir "" |more''.
--
-- 3. Failing the above checks, if ``globbing'' is enabled, local file
-- names are expanded according to the rules used in the csh(1); c.f.
-- the gglloobb command. If the ffttpp command expects a single local file
-- (e.g. ppuutt), only the first filename generated by the "globbing" op-
-- eration is used.
--
-- 4. For mmggeett commands and ggeett commands with unspecified local file
-- names, the local filename is the remote filename, which may be al-
-- tered by a ccaassee, nnttrraannss, or nnmmaapp setting. The resulting filename
-- may then be altered if rruunniiqquuee is on.
--
-- 5. For mmppuutt commands and ppuutt commands with unspecified remote file
-- names, the remote filename is the local filename, which may be al-
-- tered by a nnttrraannss or nnmmaapp setting. The resulting filename may then
-- be altered by the remote server if ssuunniiqquuee is on.
--
--FFIILLEE TTRRAANNSSFFEERR PPAARRAAMMEETTEERRSS
-- The FTP specification specifies many parameters which may affect a file
-- transfer. The ttyyppee may be one of ``ascii'', ``image'' (binary),
-- ``ebcdic'', and ``local byte size'' (for PDP-10's and PDP-20's mostly).
-- ffttpp supports the ascii and image types of file transfer, plus local byte
-- size 8 for tteenneexx mode transfers.
--
-- ffttpp supports only the default values for the remaining file transfer pa-
-- rameters: mmooddee, ffoorrmm, and ssttrruucctt.
--
--TTHHEE ..nneettrrcc FFIILLEE
-- The _._n_e_t_r_c file contains login and initialization information used by the
-- auto-login process. It resides in the user's home directory, unless
-- overridden with the --NN _n_e_t_r_c option, or specified in the NETRC environ-
-- ment variable. The following tokens are recognized; they may be separat-
-- ed by spaces, tabs, or new-lines:
--
-- mmaacchhiinnee _n_a_m_e
-- Identify a remote machine _n_a_m_e. The auto-login process search-
-- es the _._n_e_t_r_c file for a mmaacchhiinnee token that matches the remote
-- machine specified on the ffttpp command line or as an ooppeenn command
-- argument. Once a match is made, the subsequent _._n_e_t_r_c tokens
-- are processed, stopping when the end of file is reached or an-
-- other mmaacchhiinnee or a ddeeffaauulltt token is encountered.
--
-- ddeeffaauulltt This is the same as mmaacchhiinnee _n_a_m_e except that ddeeffaauulltt matches
-- any name. There can be only one ddeeffaauulltt token, and it must be
-- after all mmaacchhiinnee tokens. This is normally used as:
--
-- default login anonymous password user@site
--
-- thereby giving the user an automatic anonymous FTP login to ma-
-- chines not specified in _._n_e_t_r_c. This can be overridden by us-
-- ing the --nn flag to disable auto-login.
--
-- llooggiinn _n_a_m_e
-- Identify a user on the remote machine. If this token is pre-
-- sent, the auto-login process will initiate a login using the
-- specified _n_a_m_e.
--
-- ppaasssswwoorrdd _s_t_r_i_n_g
-- Supply a password. If this token is present, the auto-login
-- process will supply the specified string if the remote server
-- requires a password as part of the login process. Note that if
-- this token is present in the _._n_e_t_r_c file for any user other
-- than _a_n_o_n_y_m_o_u_s, ffttpp will abort the auto-login process if the
-- _._n_e_t_r_c is readable by anyone besides the user.
--
-- aaccccoouunntt _s_t_r_i_n_g
-- Supply an additional account password. If this token is pre-
-- sent, the auto-login process will supply the specified string
-- if the remote server requires an additional account password,
-- or the auto-login process will initiate an ACCT command if it
-- does not.
--
-- mmaaccddeeff _n_a_m_e
-- Define a macro. This token functions like the ffttpp mmaaccddeeff com-
-- mand functions. A macro is defined with the specified name;
-- its contents begin with the next _._n_e_t_r_c line and continue until
-- a blank line (consecutive new-line characters) is encountered.
-- If a macro named iinniitt is defined, it is automatically executed
-- as the last step in the auto-login process.
--
--CCOOMMMMAANNDD LLIINNEE EEDDIITTIINNGG
-- ffttpp supports interactive command line editing, via the editline(3) li-
-- brary. It is enabled with the eeddiitt command, and is enabled by default if
-- input is from a tty. Previous lines can be recalled and edited with the
-- arrow keys, and other GNU Emacs-style editing keys may be used as well.
--
-- The editline(3) library is configured with a _._e_d_i_t_r_c file - refer to
-- editrc(5) for more information.
--
-- An extra key binding is available to ffttpp to provide context sensitive
-- command and filename completion (including remote file completion). To
-- use this, bind a key to the editline(3) command ffttpp--ccoommpplleettee. By de-
-- fault, this is bound to the TAB key.
--
--CCOOMMMMAANNDD LLIINNEE PPRROOMMPPTT
-- By default, ffttpp displays a command line prompt of ``ftp>'' to the user.
-- This can be changed with the sseett pprroommpptt command.
--
-- A prompt can be displayed on the right side of the screen (after the com-
-- mand input) with the sseett rrpprroommpptt command.
--
-- The following formatting sequences are replaced by the given information:
--
-- %/ The current remote working directory.
--
-- %c[[0]_n], %.[[0]_n]
-- The trailing component of the current remote working directo-
-- ry, or _n trailing components if a digit _n is given. If _n be-
-- gins with `0', the number of skipped components precede the
-- trailing component(s) in the format ``/_<_s_k_i_p_p_e_d_>trailing''
-- (for `%c') or ``...trailing'' (for `%.').
--
-- %M The remote host name.
--
-- %m The remote host name, up to the first `.'.
--
-- %n The remote user name.
--
-- %% A single `%'.
--
--EENNVVIIRROONNMMEENNTT
-- ffttpp uses the following environment variables.
--
-- FTPANONPASS Password to send in an anonymous FTP transfer. Defaults
-- to ```whoami`@''.
--
-- FTPMODE Overrides the default operation mode. Support values are:
--
-- active active mode FTP only
--
-- auto automatic determination of passive or active
-- (this is the default)
--
-- gate gate-ftp mode
--
-- passive passive mode FTP only
--
-- FTPPROMPT Command-line prompt to use. Defaults to ``ftp>''. Refer
-- to _C_O_M_M_A_N_D _L_I_N_E _P_R_O_M_P_T for more information.
--
-- FTPRPROMPT Command-line right side prompt to use. Defaults to ``''.
-- Refer to _C_O_M_M_A_N_D _L_I_N_E _P_R_O_M_P_T for more information.
--
-- FTPSERVER Host to use as gate-ftp server when ggaattee is enabled.
--
-- FTPSERVERPORT Port to use when connecting to gate-ftp server when ggaattee
-- is enabled. Default is port returned by a ggeettsseerrvvbbyynnaammee()
-- lookup of ``ftpgate/tcp''.
--
-- HOME For default location of a _._n_e_t_r_c file, if one exists.
--
-- NETRC An alternate location of the _._n_e_t_r_c file.
--
-- PAGER Used by various commands to display files. Defaults to
-- more(1) if empty or not set.
--
-- SHELL For default shell.
--
-- ftp_proxy URL of FTP proxy to use when making FTP URL requests (if
-- not defined, use the standard FTP protocol).
--
-- _N_O_T_E: this is not used for interactive sessions, only for
-- command-line fetches.
--
-- http_proxy URL of HTTP proxy to use when making HTTP URL requests.
-- If proxy authentication is required and there is a user-
-- name and password in this URL, they will automatically be
-- used in the first attempt to authenticate to the proxy.
--
-- Note that the use of a username and password in ftp_proxy
-- and http_proxy may be incompatible with other programs
-- that use it (such as lynx(1)).
--
-- _N_O_T_E: this is not used for interactive sessions, only for
-- command-line fetches.
--
-- no_proxy A space or comma separated list of hosts (or domains) for
-- which proxying is not to be used. Each entry may have an
-- optional trailing ":port", which restricts the matching to
-- connections to that port.
--
--SSEEEE AALLSSOO
-- getservbyname(3), editrc(5), services(5), ftpd(8)
--
--SSTTAANNDDAARRDDSS
-- ffttpp attempts to be compliant with RRFFCC 995599, RRFFCC 11112233, RRFFCC 11773388, RRFFCC 22006688,
-- RRFFCC 22338899, RRFFCC 22442288, RRFFCC 22773322, and ddrraafftt--iieettff--ffttppeexxtt--mmllsstt--1111.
--
--HHIISSTTOORRYY
-- The ffttpp command appeared in 4.2BSD.
--
-- Various features such as command line editing, context sensitive command
-- and file completion, dynamic progress bar, automatic fetching of files
-- and URLs, modification time preservation, transfer rate throttling, con-
-- figurable command line prompt, and other enhancements over the standard
-- BSD ffttpp were implemented in NetBSD 1.3 and later releases by Luke Mewburn
-- <lukem@netbsd.org>.
--
-- IPv6 support was added by the WIDE/KAME project (but may not be present
-- in all non-NetBSD versions of this program, depending if the operating
-- system supports IPv6 in a similar manner to KAME).
--
--BBUUGGSS
-- Correct execution of many commands depends upon proper behavior by the
-- remote server.
--
-- An error in the treatment of carriage returns in the 4.2BSD ascii-mode
-- transfer code has been corrected. This correction may result in incor-
-- rect transfers of binary files to and from 4.2BSD servers using the ascii
-- type. Avoid this problem by using the binary image type.
--
-- ffttpp assumes that all IPv4 mapped addresses (IPv6 addresses with a form
-- like ::ffff:10.1.1.1) indicate IPv4 destinations which can be handled by
-- AF_INET sockets. However, in certain IPv6 network configurations, this
-- assumption is not true. In such an environment, IPv4 mapped addresses
-- must be passed to AF_INET6 sockets directly. For example, if your site
-- uses a SIIT translator for IPv6-to-IPv4 translation, ffttpp is unable to
-- support your configuration.
--
--NetBSD 1.6_BETA1 May 18, 2002 16
-diff -Nru src/ftp_var.h /home/spock/ftp/ftp_var.h
---- src/ftp_var.h Sat Jun 15 05:40:36 2002
-+++ /home/spock/ftp/ftp_var.h Thu Jun 12 02:02:11 2003
-@@ -1,7 +1,7 @@
--/* $NetBSD: ftp_var.h,v 1.62 2001/12/26 09:40:16 lukem Exp $ */
-+/* $NetBSD: ftp_var.h,v 1.64 2003/01/21 16:08:07 jhawk Exp $ */
-
- /*-
-- * Copyright (c) 1996-2001 The NetBSD Foundation, Inc.
-+ * Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
-@@ -111,14 +111,20 @@
- #define NO_PROGRESS
- #endif
-
-+#include <sys/param.h>
-+
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
-+
-+#include <setjmp.h>
-+#include <stringlist.h>
-+
- #ifndef NO_EDITCOMPLETE
- #include <histedit.h>
- #endif /* !NO_EDITCOMPLETE */
-
--typedef void (*sigfunc)(int);
--
- #include "extern.h"
--
-+#include "progressbar.h"
-
- /*
- * Format of command table.
-@@ -175,7 +181,6 @@
-
- #define HASHBYTES 1024 /* default mark for `hash' command */
- #define DEFAULTINCR 1024 /* default increment for `rate' command */
--#define STALLTIME 5 /* # of seconds of no xfer before "stalling" */
-
- #define FTP_PORT 21 /* default if ! getservbyname("ftp/tcp") */
- #define HTTP_PORT 80 /* default if ! getservbyname("http/tcp") */
-@@ -204,9 +209,7 @@
- GLOBAL int hash; /* print # for each buffer transferred */
- GLOBAL int mark; /* number of bytes between hashes */
- GLOBAL int sendport; /* use PORT/LPRT cmd for each data connection */
--GLOBAL int verbose; /* print messages coming back from server */
- GLOBAL int connected; /* 1 = connected to server, -1 = logged in */
--GLOBAL int fromatty; /* input is from a terminal */
- GLOBAL int interactive; /* interactively prompt on m* cmds */
- GLOBAL int confirmrest; /* confirm rest of current m* cmd */
- GLOBAL int debug; /* debugging level */
-@@ -223,7 +226,6 @@
- GLOBAL int ntflag; /* use ntin ntout tables for name translation */
- GLOBAL int mapflag; /* use mapin mapout templates on file names */
- GLOBAL int preserve; /* preserve modification time on files */
--GLOBAL int progress; /* display transfer progress bar */
- GLOBAL int code; /* return/reply code for ftp command */
- GLOBAL int crflag; /* if 1, strip car. rets. on ascii gets */
- GLOBAL int passivemode; /* passive mode enabled */
-@@ -252,9 +254,7 @@
- GLOBAL int rate_put; /* maximum put xfer rate */
- GLOBAL int rate_put_incr; /* increment for put xfer rate */
- GLOBAL int retry_connect; /* seconds between retrying connection */
--GLOBAL int ttywidth; /* width of tty */
- GLOBAL char *tmpdir; /* temporary directory */
--GLOBAL FILE *ttyout; /* stdout, or stderr if retrieving to stdout */
- GLOBAL int epsv4; /* use EPSV/EPRT on IPv4 connections */
- GLOBAL int epsv4bad; /* EPSV doesn't work on the current server */
- GLOBAL int editing; /* command line editing enabled */
-@@ -268,10 +268,7 @@
- GLOBAL size_t cursor_argo; /* offset of cursor in margv[cursor_argc] */
- #endif /* !NO_EDITCOMPLETE */
-
--GLOBAL off_t bytes; /* current # of bytes read */
--GLOBAL off_t filesize; /* size of file being transferred */
- GLOBAL char *direction; /* direction transfer is occurring */
--GLOBAL off_t restart_point; /* offset to restart transfer */
-
- GLOBAL char *hostname; /* name of host connected to */
- GLOBAL int unix_server; /* server is unix, can use binary for ascii */
-@@ -287,8 +284,6 @@
- GLOBAL char *outfile; /* filename to output URLs to */
- GLOBAL int restartautofetch; /* restart auto-fetch */
-
--GLOBAL sigjmp_buf toplevel; /* non-local goto stuff for cmd scanner */
--
- GLOBAL char line[FTPBUFLEN]; /* input line buffer */
- GLOBAL char *stringbase; /* current scan point in line buffer */
- GLOBAL char argbuf[FTPBUFLEN]; /* argument storage buffer */
-@@ -336,29 +331,7 @@
- #endif
-
- #ifdef NO_LONG_LONG
--# define LLF "%ld"
--# define LLFP(x) "%" x "ld"
--# define LLT long
--# define ULLF "%lu"
--# define ULLFP(x) "%" x "lu"
--# define ULLT unsigned long
- # define STRTOLL(x,y,z) strtol(x,y,z)
- #else
--#if HAVE_PRINTF_QD
--# define LLF "%qd"
--# define LLFP(x) "%" x "qd"
--# define LLT long long
--# define ULLF "%qu"
--# define ULLFP(x) "%" x "qu"
--# define ULLT unsigned long long
--# define STRTOLL(x,y,z) strtoll(x,y,z)
--#else
--# define LLF "%lld"
--# define LLFP(x) "%" x "lld"
--# define LLT long long
--# define ULLF "%llu"
--# define ULLFP(x) "%" x "llu"
--# define ULLT unsigned long long
- # define STRTOLL(x,y,z) strtoll(x,y,z)
--#endif
- #endif
-diff -Nru src/main.c /home/spock/ftp/main.c
---- src/main.c Sat Jun 15 05:40:36 2002
-+++ /home/spock/ftp/main.c Thu Jun 12 02:02:11 2003
-@@ -1,4 +1,4 @@
--/* $NetBSD: main.c,v 1.82 2002/06/05 13:51:54 lukem Exp $ */
-+/* $NetBSD: main.c,v 1.84 2003/05/14 14:31:00 wiz Exp $ */
-
- /*-
- * Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
-@@ -98,11 +98,36 @@
- * SUCH DAMAGE.
- */
-
-+#include <sys/cdefs.h>
-+#ifndef lint
-+__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
-+ The Regents of the University of California. All rights reserved.\n");
-+#endif /* not lint */
-+
-+#ifndef lint
-+#if 0
-+static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
-+#else
-+__RCSID("$NetBSD: main.c,v 1.84 2003/05/14 14:31:00 wiz Exp $");
-+#endif
-+#endif /* not lint */
-+
- /*
- * FTP User Program -- Command Interface.
- */
-+#include <sys/types.h>
-+#include <sys/socket.h>
-
--#include "lukemftp.h"
-+#include <err.h>
-+#include <errno.h>
-+#include <netdb.h>
-+#include <paths.h>
-+#include <pwd.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <locale.h>
-
- #define GLOBAL /* force GLOBAL decls in ftp_var.h to be declared */
- #include "ftp_var.h"
-@@ -123,9 +148,7 @@
- char *cp, *ep, *anonuser, *anonpass, *upload_path;
- int dumbterm, s, len, isupload;
-
--#if 0 /* XXX */
- setlocale(LC_ALL, "");
--#endif
- setprogname(argv[0]);
-
- ftpport = "ftp";
-@@ -258,7 +281,7 @@
- }
- }
-
-- while ((ch = getopt(argc, argv, "46AadefginN:o:pP:r:RtT:u:vV")) != -1) {
-+ while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:RtT:u:vV")) != -1) {
- switch (ch) {
- case '4':
- family = AF_INET;
-@@ -330,6 +353,12 @@
- ftpport = optarg;
- break;
-
-+ case 'q':
-+ quit_time = strtol(optarg, &ep, 10);
-+ if (quit_time < 1 || *ep != '\0')
-+ errx(1, "bad quit value: %s", optarg);
-+ break;
-+
- case 'r':
- retry_connect = strtol(optarg, &ep, 10);
- if (retry_connect < 1 || *ep != '\0')
-@@ -1003,6 +1032,6 @@
- " [-T dir,max[,inc][[user@]host [port]]] [host:path[/]]\n"
- " [file:///file] [ftp://[user[:pass]@]host[:port]/path[/]]\n"
- " [http://[user[:pass]@]host[:port]/path] [...]\n"
--" %s -u url file [...]\n", progname, progname);
-+" %s -u URL file [...]\n", progname, progname);
- exit(1);
- }
-diff -Nru src/progressbar.c /home/spock/ftp/progressbar.c
---- src/progressbar.c Wed Dec 31 19:00:00 1969
-+++ /home/spock/ftp/progressbar.c Thu Jun 12 02:02:11 2003
-@@ -0,0 +1,460 @@
-+/* $NetBSD: progressbar.c,v 1.3 2003/02/28 09:53:49 lukem Exp $ */
-+
-+/*-
-+ * Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
-+ * All rights reserved.
-+ *
-+ * This code is derived from software contributed to The NetBSD Foundation
-+ * by Luke Mewburn.
-+ *
-+ * This code is derived from software contributed to The NetBSD Foundation
-+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
-+ * NASA Ames Research Center.
-+ *
-+ * 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 <sys/cdefs.h>
-+#ifndef lint
-+__RCSID("$NetBSD: progressbar.c,v 1.3 2003/02/28 09:53:49 lukem Exp $");
-+#endif /* not lint */
-+
-+/*
-+ * FTP User Program -- Misc support routines
-+ */
-+#include <sys/types.h>
-+#include <sys/param.h>
-+
-+#include <err.h>
-+#include <errno.h>
-+#include <signal.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <time.h>
-+#include <tzfile.h>
-+#include <unistd.h>
-+
-+#include "progressbar.h"
-+
-+#if !defined(NO_PROGRESS)
-+/*
-+ * return non-zero if we're the current foreground process
-+ */
-+int
-+foregroundproc(void)
-+{
-+ static pid_t pgrp = -1;
-+
-+ if (pgrp == -1)
-+ pgrp = getpgrp();
-+
-+ return (tcgetpgrp(fileno(ttyout)) == pgrp);
-+}
-+#endif /* !defined(NO_PROGRESS) */
-+
-+
-+#ifndef NO_PROGRESS
-+static void updateprogressmeter(int);
-+
-+/*
-+ * SIGALRM handler to update the progress meter
-+ */
-+static void
-+updateprogressmeter(int dummy)
-+{
-+ int oerrno = errno;
-+
-+ progressmeter(0);
-+ errno = oerrno;
-+}
-+#endif /* NO_PROGRESS */
-+
-+
-+/*
-+ * List of order of magnitude prefixes.
-+ * The last is `P', as 2^64 = 16384 Petabytes
-+ */
-+static const char prefixes[] = " KMGTP";
-+
-+/*
-+ * Display a transfer progress bar if progress is non-zero.
-+ * SIGALRM is hijacked for use by this function.
-+ * - Before the transfer, set filesize to size of file (or -1 if unknown),
-+ * and call with flag = -1. This starts the once per second timer,
-+ * and a call to updateprogressmeter() upon SIGALRM.
-+ * - During the transfer, updateprogressmeter will call progressmeter
-+ * with flag = 0
-+ * - After the transfer, call with flag = 1
-+ */
-+static struct timeval start;
-+static struct timeval lastupdate;
-+
-+#define BUFLEFT (sizeof(buf) - len)
-+
-+void
-+progressmeter(int flag)
-+{
-+ static off_t lastsize;
-+ off_t cursize;
-+ struct timeval now, wait;
-+#ifndef NO_PROGRESS
-+ struct timeval td;
-+ off_t abbrevsize, bytespersec;
-+ double elapsed;
-+ int ratio, barlength, i, len, remaining;
-+
-+ /*
-+ * Work variables for progress bar.
-+ *
-+ * XXX: if the format of the progress bar changes
-+ * (especially the number of characters in the
-+ * `static' portion of it), be sure to update
-+ * these appropriately.
-+ */
-+ char buf[256]; /* workspace for progress bar */
-+#define BAROVERHEAD 43 /* non `*' portion of progress bar */
-+ /*
-+ * stars should contain at least
-+ * sizeof(buf) - BAROVERHEAD entries
-+ */
-+ static const char stars[] =
-+"*****************************************************************************"
-+"*****************************************************************************"
-+"*****************************************************************************";
-+
-+#endif
-+
-+ if (flag == -1) {
-+ (void)gettimeofday(&start, NULL);
-+ lastupdate = start;
-+ lastsize = restart_point;
-+ }
-+
-+ (void)gettimeofday(&now, NULL);
-+ cursize = bytes + restart_point;
-+ timersub(&now, &lastupdate, &wait);
-+ if (cursize > lastsize) {
-+ lastupdate = now;
-+ lastsize = cursize;
-+ wait.tv_sec = 0;
-+ } else {
-+#ifndef STANDALONE_PROGRESS
-+ if (quit_time > 0 && wait.tv_sec > quit_time) {
-+ len = snprintf(buf, sizeof(buf), "\r\n%s: "
-+ "transfer aborted because stalled for %lu sec.\r\n",
-+ getprogname(), (unsigned long)wait.tv_sec);
-+ (void)write(fileno(ttyout), buf, len);
-+ (void)xsignal(SIGALRM, SIG_DFL);
-+ alarmtimer(0);
-+ siglongjmp(toplevel, 1);
-+ }
-+#endif /* !STANDALONE_PROGRESS */
-+ }
-+ /*
-+ * Always set the handler even if we are not the foreground process.
-+ */
-+#ifdef STANDALONE_PROGRESS
-+ if (progress) {
-+#else
-+ if (quit_time > 0 || progress) {
-+#endif /* !STANDALONE_PROGRESS */
-+ if (flag == -1) {
-+ (void)xsignal_restart(SIGALRM, updateprogressmeter, 1);
-+ alarmtimer(1); /* set alarm timer for 1 Hz */
-+ } else if (flag == 1) {
-+ (void)xsignal(SIGALRM, SIG_DFL);
-+ alarmtimer(0);
-+ }
-+ }
-+#ifndef NO_PROGRESS
-+ if (!progress)
-+ return;
-+ len = 0;
-+
-+ /*
-+ * print progress bar only if we are foreground process.
-+ */
-+ if (! foregroundproc())
-+ return;
-+
-+ len += snprintf(buf + len, BUFLEFT, "\r");
-+ if (filesize > 0) {
-+ ratio = (int)((double)cursize * 100.0 / (double)filesize);
-+ ratio = MAX(ratio, 0);
-+ ratio = MIN(ratio, 100);
-+ len += snprintf(buf + len, BUFLEFT, "%3d%% ", ratio);
-+
-+ /*
-+ * calculate the length of the `*' bar, ensuring that
-+ * the number of stars won't exceed the buffer size
-+ */
-+ barlength = MIN(sizeof(buf) - 1, ttywidth) - BAROVERHEAD;
-+ if (barlength > 0) {
-+ i = barlength * ratio / 100;
-+ len += snprintf(buf + len, BUFLEFT,
-+ "|%.*s%*s|", i, stars, barlength - i, "");
-+ }
-+ }
-+
-+ abbrevsize = cursize;
-+ for (i = 0; abbrevsize >= 100000 && i < sizeof(prefixes); i++)
-+ abbrevsize >>= 10;
-+ len += snprintf(buf + len, BUFLEFT, " " LLFP("5") " %c%c ",
-+ (LLT)abbrevsize,
-+ prefixes[i],
-+ i == 0 ? ' ' : 'B');
-+
-+ timersub(&now, &start, &td);
-+ elapsed = td.tv_sec + (td.tv_usec / 1000000.0);
-+
-+ bytespersec = 0;
-+ if (bytes > 0) {
-+ bytespersec = bytes;
-+ if (elapsed > 0.0)
-+ bytespersec /= elapsed;
-+ }
-+ for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++)
-+ bytespersec >>= 10;
-+ len += snprintf(buf + len, BUFLEFT,
-+ " " LLFP("3") ".%02d %cB/s ",
-+ (LLT)(bytespersec / 1024),
-+ (int)((bytespersec % 1024) * 100 / 1024),
-+ prefixes[i]);
-+
-+ if (filesize > 0) {
-+ if (bytes <= 0 || elapsed <= 0.0 || cursize > filesize) {
-+ len += snprintf(buf + len, BUFLEFT, " --:-- ETA");
-+ } else if (wait.tv_sec >= STALLTIME) {
-+ len += snprintf(buf + len, BUFLEFT, " - stalled -");
-+ } else {
-+ remaining = (int)
-+ ((filesize - restart_point) / (bytes / elapsed) -
-+ elapsed);
-+ if (remaining >= 100 * SECSPERHOUR)
-+ len += snprintf(buf + len, BUFLEFT,
-+ " --:-- ETA");
-+ else {
-+ i = remaining / SECSPERHOUR;
-+ if (i)
-+ len += snprintf(buf + len, BUFLEFT,
-+ "%2d:", i);
-+ else
-+ len += snprintf(buf + len, BUFLEFT,
-+ " ");
-+ i = remaining % SECSPERHOUR;
-+ len += snprintf(buf + len, BUFLEFT,
-+ "%02d:%02d ETA", i / 60, i % 60);
-+ }
-+ }
-+ }
-+ if (flag == 1)
-+ len += snprintf(buf + len, BUFLEFT, "\n");
-+ (void)write(fileno(ttyout), buf, len);
-+
-+#endif /* !NO_PROGRESS */
-+}
-+
-+#ifndef STANDALONE_PROGRESS
-+/*
-+ * Display transfer statistics.
-+ * Requires start to be initialised by progressmeter(-1),
-+ * direction to be defined by xfer routines, and filesize and bytes
-+ * to be updated by xfer routines
-+ * If siginfo is nonzero, an ETA is displayed, and the output goes to stderr
-+ * instead of ttyout.
-+ */
-+void
-+ptransfer(int siginfo)
-+{
-+ struct timeval now, td, wait;
-+ double elapsed;
-+ off_t bytespersec;
-+ int remaining, hh, i, len;
-+
-+ char buf[256]; /* Work variable for transfer status. */
-+
-+ if (!verbose && !progress && !siginfo)
-+ return;
-+
-+ (void)gettimeofday(&now, NULL);
-+ timersub(&now, &start, &td);
-+ elapsed = td.tv_sec + (td.tv_usec / 1000000.0);
-+ bytespersec = 0;
-+ if (bytes > 0) {
-+ bytespersec = bytes;
-+ if (elapsed > 0.0)
-+ bytespersec /= elapsed;
-+ }
-+ len = 0;
-+ len += snprintf(buf + len, BUFLEFT, LLF " byte%s %s in ",
-+ (LLT)bytes, bytes == 1 ? "" : "s", direction);
-+ remaining = (int)elapsed;
-+ if (remaining > SECSPERDAY) {
-+ int days;
-+
-+ days = remaining / SECSPERDAY;
-+ remaining %= SECSPERDAY;
-+ len += snprintf(buf + len, BUFLEFT,
-+ "%d day%s ", days, days == 1 ? "" : "s");
-+ }
-+ hh = remaining / SECSPERHOUR;
-+ remaining %= SECSPERHOUR;
-+ if (hh)
-+ len += snprintf(buf + len, BUFLEFT, "%2d:", hh);
-+ len += snprintf(buf + len, BUFLEFT,
-+ "%02d:%02d ", remaining / 60, remaining % 60);
-+
-+ for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++)
-+ bytespersec >>= 10;
-+ len += snprintf(buf + len, BUFLEFT, "(" LLF ".%02d %cB/s)",
-+ (LLT)(bytespersec / 1024),
-+ (int)((bytespersec % 1024) * 100 / 1024),
-+ prefixes[i]);
-+
-+ if (siginfo && bytes > 0 && elapsed > 0.0 && filesize >= 0
-+ && bytes + restart_point <= filesize) {
-+ remaining = (int)((filesize - restart_point) /
-+ (bytes / elapsed) - elapsed);
-+ hh = remaining / SECSPERHOUR;
-+ remaining %= SECSPERHOUR;
-+ len += snprintf(buf + len, BUFLEFT, " ETA: ");
-+ if (hh)
-+ len += snprintf(buf + len, BUFLEFT, "%2d:", hh);
-+ len += snprintf(buf + len, BUFLEFT, "%02d:%02d",
-+ remaining / 60, remaining % 60);
-+ timersub(&now, &lastupdate, &wait);
-+ if (wait.tv_sec >= STALLTIME)
-+ len += snprintf(buf + len, BUFLEFT, " (stalled)");
-+ }
-+ len += snprintf(buf + len, BUFLEFT, "\n");
-+ (void)write(siginfo ? STDERR_FILENO : fileno(ttyout), buf, len);
-+}
-+
-+/*
-+ * SIG{INFO,QUIT} handler to print transfer stats if a transfer is in progress
-+ */
-+void
-+psummary(int notused)
-+{
-+ int oerrno = errno;
-+
-+ if (bytes > 0) {
-+ if (fromatty)
-+ write(fileno(ttyout), "\n", 1);
-+ ptransfer(1);
-+ }
-+ errno = oerrno;
-+}
-+#endif /* !STANDALONE_PROGRESS */
-+
-+
-+/*
-+ * Set the SIGALRM interval timer for wait seconds, 0 to disable.
-+ */
-+void
-+alarmtimer(int wait)
-+{
-+ struct itimerval itv;
-+
-+ itv.it_value.tv_sec = wait;
-+ itv.it_value.tv_usec = 0;
-+ itv.it_interval = itv.it_value;
-+ setitimer(ITIMER_REAL, &itv, NULL);
-+}
-+
-+
-+/*
-+ * Install a POSIX signal handler, allowing the invoker to set whether
-+ * the signal should be restartable or not
-+ */
-+sigfunc
-+xsignal_restart(int sig, sigfunc func, int restartable)
-+{
-+ struct sigaction act, oact;
-+ act.sa_handler = func;
-+
-+ sigemptyset(&act.sa_mask);
-+#if defined(SA_RESTART) /* 4.4BSD, Posix(?), SVR4 */
-+ act.sa_flags = restartable ? SA_RESTART : 0;
-+#elif defined(SA_INTERRUPT) /* SunOS 4.x */
-+ act.sa_flags = restartable ? 0 : SA_INTERRUPT;
-+#else
-+#error "system must have SA_RESTART or SA_INTERRUPT"
-+#endif
-+ if (sigaction(sig, &act, &oact) < 0)
-+ return (SIG_ERR);
-+ return (oact.sa_handler);
-+}
-+
-+/*
-+ * Install a signal handler with the `restartable' flag set dependent upon
-+ * which signal is being set. (This is a wrapper to xsignal_restart())
-+ */
-+sigfunc
-+xsignal(int sig, sigfunc func)
-+{
-+ int restartable;
-+
-+ /*
-+ * Some signals print output or change the state of the process.
-+ * There should be restartable, so that reads and writes are
-+ * not affected. Some signals should cause program flow to change;
-+ * these signals should not be restartable, so that the system call
-+ * will return with EINTR, and the program will go do something
-+ * different. If the signal handler calls longjmp() or siglongjmp(),
-+ * it doesn't matter if it's restartable.
-+ */
-+
-+ switch(sig) {
-+#ifdef SIGINFO
-+ case SIGINFO:
-+#endif
-+ case SIGQUIT:
-+ case SIGUSR1:
-+ case SIGUSR2:
-+ case SIGWINCH:
-+ restartable = 1;
-+ break;
-+
-+ case SIGALRM:
-+ case SIGINT:
-+ case SIGPIPE:
-+ restartable = 0;
-+ break;
-+
-+ default:
-+ /*
-+ * This is unpleasant, but I don't know what would be better.
-+ * Right now, this "can't happen"
-+ */
-+ errx(1, "xsignal_restart called with signal %d", sig);
-+ }
-+
-+ return(xsignal_restart(sig, func, restartable));
-+}
-diff -Nru src/progressbar.h /home/spock/ftp/progressbar.h
---- src/progressbar.h Wed Dec 31 19:00:00 1969
-+++ /home/spock/ftp/progressbar.h Thu Jun 12 02:02:11 2003
-@@ -0,0 +1,99 @@
-+/* $NetBSD: progressbar.h,v 1.3 2003/02/28 09:53:49 lukem Exp $ */
-+
-+/*-
-+ * Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
-+ * All rights reserved.
-+ *
-+ * This code is derived from software contributed to The NetBSD Foundation
-+ * by Luke Mewburn.
-+ *
-+ * 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.
-+ */
-+
-+#ifndef STANDALONE_PROGRESS
-+#include <setjmp.h>
-+#endif /* !STANDALONE_PROGRESS */
-+
-+#ifndef GLOBAL
-+#define GLOBAL extern
-+#endif
-+
-+
-+#define STALLTIME 5 /* # of seconds of no xfer before "stalling" */
-+
-+typedef void (*sigfunc)(int);
-+
-+
-+GLOBAL FILE *ttyout; /* stdout, or stderr if retrieving to stdout */
-+
-+GLOBAL int progress; /* display transfer progress bar */
-+GLOBAL int ttywidth; /* width of tty */
-+
-+GLOBAL off_t bytes; /* current # of bytes read */
-+GLOBAL off_t filesize; /* size of file being transferred */
-+GLOBAL off_t restart_point; /* offset to restart transfer */
-+
-+
-+#ifndef STANDALONE_PROGRESS
-+GLOBAL int fromatty; /* input is from a terminal */
-+GLOBAL int verbose; /* print messages coming back from server */
-+GLOBAL int quit_time; /* maximum time to wait if stalled */
-+
-+GLOBAL char *direction; /* direction transfer is occurring */
-+
-+GLOBAL sigjmp_buf toplevel; /* non-local goto stuff for cmd scanner */
-+#endif /* !STANDALONE_PROGRESS */
-+
-+int foregroundproc(void);
-+void alarmtimer(int);
-+void progressmeter(int);
-+sigfunc xsignal(int, sigfunc);
-+sigfunc xsignal_restart(int, sigfunc, int);
-+
-+#ifndef STANDALONE_PROGRESS
-+void psummary(int);
-+void ptransfer(int);
-+#endif /* !STANDALONE_PROGRESS */
-+
-+
-+#ifdef NO_LONG_LONG
-+# define LLF "%ld"
-+# define LLFP(x) "%" x "ld"
-+# define LLT long
-+# define ULLF "%lu"
-+# define ULLFP(x) "%" x "lu"
-+# define ULLT unsigned long
-+#else
-+# define LLF "%lld"
-+# define LLFP(x) "%" x "lld"
-+# define LLT long long
-+# define ULLF "%llu"
-+# define ULLFP(x) "%" x "llu"
-+# define ULLT unsigned long long
-+#endif
-diff -Nru src/ruserpass.c /home/spock/ftp/ruserpass.c
---- src/ruserpass.c Sat Jun 15 05:40:36 2002
-+++ /home/spock/ftp/ruserpass.c Thu Jun 12 02:02:11 2003
-@@ -33,7 +33,26 @@
- * SUCH DAMAGE.
- */
-
--#include "lukemftp.h"
-+#include <sys/cdefs.h>
-+#ifndef lint
-+#if 0
-+static char sccsid[] = "@(#)ruserpass.c 8.4 (Berkeley) 4/27/95";
-+#else
-+__RCSID("$NetBSD: ruserpass.c,v 1.28 2000/11/15 00:11:04 lukem Exp $");
-+#endif
-+#endif /* not lint */
-+
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+
-+#include <ctype.h>
-+#include <err.h>
-+#include <errno.h>
-+#include <netdb.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <unistd.h>
-
- #include "ftp_var.h"
-
-diff -Nru src/util.c /home/spock/ftp/util.c
---- src/util.c Sat Jun 15 05:40:37 2002
-+++ /home/spock/ftp/util.c Thu Jun 12 02:02:11 2003
-@@ -1,7 +1,7 @@
--/* $NetBSD: util.c,v 1.107 2002/06/05 10:20:50 lukem Exp $ */
-+/* $NetBSD: util.c,v 1.111 2003/02/28 09:54:51 lukem Exp $ */
-
- /*-
-- * Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
-+ * Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
-@@ -73,11 +73,36 @@
- * SUCH DAMAGE.
- */
-
-+#include <sys/cdefs.h>
-+#ifndef lint
-+__RCSID("$NetBSD: util.c,v 1.111 2003/02/28 09:54:51 lukem Exp $");
-+#endif /* not lint */
-+
- /*
- * FTP User Program -- Misc support routines
- */
--
--#include "lukemftp.h"
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <sys/ioctl.h>
-+#include <sys/time.h>
-+#include <netinet/in.h>
-+#include <arpa/ftp.h>
-+
-+#include <ctype.h>
-+#include <err.h>
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <glob.h>
-+#include <signal.h>
-+#include <limits.h>
-+#include <netdb.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <termios.h>
-+#include <time.h>
-+#include <tzfile.h>
-+#include <unistd.h>
-
- #include "ftp_var.h"
-
-@@ -775,303 +800,6 @@
- code = ocode;
- }
-
--#ifndef NO_PROGRESS
--
--/*
-- * return non-zero if we're the current foreground process
-- */
--int
--foregroundproc(void)
--{
-- static pid_t pgrp = -1;
--
-- if (pgrp == -1)
--#if GETPGRP_VOID
-- pgrp = getpgrp();
--#else /* ! GETPGRP_VOID */
-- pgrp = getpgrp(0);
--#endif /* ! GETPGRP_VOID */
--
-- return (tcgetpgrp(fileno(ttyout)) == pgrp);
--}
--
--
--static void updateprogressmeter(int);
--
--/*
-- * SIGALRM handler to update the progress meter
-- */
--static void
--updateprogressmeter(int dummy)
--{
-- int oerrno = errno;
--
-- progressmeter(0);
-- errno = oerrno;
--}
--#endif /* NO_PROGRESS */
--
--
--/*
-- * List of order of magnitude prefixes.
-- * The last is `P', as 2^64 = 16384 Petabytes
-- */
--static const char prefixes[] = " KMGTP";
--
--/*
-- * Display a transfer progress bar if progress is non-zero.
-- * SIGALRM is hijacked for use by this function.
-- * - Before the transfer, set filesize to size of file (or -1 if unknown),
-- * and call with flag = -1. This starts the once per second timer,
-- * and a call to updateprogressmeter() upon SIGALRM.
-- * - During the transfer, updateprogressmeter will call progressmeter
-- * with flag = 0
-- * - After the transfer, call with flag = 1
-- */
--static struct timeval start;
--static struct timeval lastupdate;
--
--#define BUFLEFT (sizeof(buf) - len)
--
--void
--progressmeter(int flag)
--{
-- static off_t lastsize;
--#ifndef NO_PROGRESS
-- struct timeval now, td, wait;
-- off_t cursize, abbrevsize, bytespersec;
-- double elapsed;
-- int ratio, barlength, i, len, remaining;
--
-- /*
-- * Work variables for progress bar.
-- *
-- * XXX: if the format of the progress bar changes
-- * (especially the number of characters in the
-- * `static' portion of it), be sure to update
-- * these appropriately.
-- */
-- char buf[256]; /* workspace for progress bar */
--#define BAROVERHEAD 43 /* non `*' portion of progress bar */
-- /*
-- * stars should contain at least
-- * sizeof(buf) - BAROVERHEAD entries
-- */
-- const char stars[] =
--"*****************************************************************************"
--"*****************************************************************************"
--"*****************************************************************************";
--
--#endif
--
-- if (flag == -1) {
-- (void)gettimeofday(&start, NULL);
-- lastupdate = start;
-- lastsize = restart_point;
-- }
--#ifndef NO_PROGRESS
-- if (!progress)
-- return;
-- len = 0;
--
-- /*
-- * print progress bar only if we are foreground process.
-- */
-- if (! foregroundproc())
-- return;
--
-- (void)gettimeofday(&now, NULL);
-- cursize = bytes + restart_point;
-- timersub(&now, &lastupdate, &wait);
-- if (cursize > lastsize) {
-- lastupdate = now;
-- lastsize = cursize;
-- wait.tv_sec = 0;
-- }
--
-- len += snprintf(buf + len, BUFLEFT, "\r");
-- if (filesize > 0) {
-- ratio = (int)((double)cursize * 100.0 / (double)filesize);
-- ratio = MAX(ratio, 0);
-- ratio = MIN(ratio, 100);
-- len += snprintf(buf + len, BUFLEFT, "%3d%% ", ratio);
--
-- /*
-- * calculate the length of the `*' bar, ensuring that
-- * the number of stars won't exceed the buffer size
-- */
-- barlength = MIN(sizeof(buf) - 1, ttywidth) - BAROVERHEAD;
-- if (barlength > 0) {
-- i = barlength * ratio / 100;
-- len += snprintf(buf + len, BUFLEFT,
-- "|%.*s%*s|", i, stars, barlength - i, "");
-- }
-- }
--
-- abbrevsize = cursize;
-- for (i = 0; abbrevsize >= 100000 && i < sizeof(prefixes); i++)
-- abbrevsize >>= 10;
-- len += snprintf(buf + len, BUFLEFT, " " LLFP("5") " %c%c ",
-- (LLT)abbrevsize,
-- prefixes[i],
-- i == 0 ? ' ' : 'B');
--
-- timersub(&now, &start, &td);
-- elapsed = td.tv_sec + (td.tv_usec / 1000000.0);
--
-- bytespersec = 0;
-- if (bytes > 0) {
-- bytespersec = bytes;
-- if (elapsed > 0.0)
-- bytespersec /= elapsed;
-- }
-- for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++)
-- bytespersec >>= 10;
-- len += snprintf(buf + len, BUFLEFT,
-- " " LLFP("3") ".%02d %cB/s ",
-- (LLT)(bytespersec / 1024),
-- (int)((bytespersec % 1024) * 100 / 1024),
-- prefixes[i]);
--
-- if (filesize > 0) {
-- if (bytes <= 0 || elapsed <= 0.0 || cursize > filesize) {
-- len += snprintf(buf + len, BUFLEFT, " --:-- ETA");
-- } else if (flag == 1) {
-- i = elapsed / SECSPERHOUR;
-- if (i)
-- len += snprintf(buf + len, BUFLEFT, "%2d:", i);
-- else
-- len += snprintf(buf + len, BUFLEFT, " ");
-- i = (int)elapsed % SECSPERHOUR;
-- len += snprintf(buf + len, BUFLEFT,
-- "%02d:%02d ", i / 60, i % 60);
-- } else if (wait.tv_sec >= STALLTIME) {
-- len += snprintf(buf + len, BUFLEFT, " - stalled -");
-- } else {
-- remaining = (int)
-- ((filesize - restart_point) / (bytes / elapsed) -
-- elapsed);
-- if (remaining >= 100 * SECSPERHOUR)
-- len += snprintf(buf + len, BUFLEFT,
-- " --:-- ETA");
-- else {
-- i = remaining / SECSPERHOUR;
-- if (i)
-- len += snprintf(buf + len, BUFLEFT,
-- "%2d:", i);
-- else
-- len += snprintf(buf + len, BUFLEFT,
-- " ");
-- i = remaining % SECSPERHOUR;
-- len += snprintf(buf + len, BUFLEFT,
-- "%02d:%02d ETA", i / 60, i % 60);
-- }
-- }
-- }
-- if (flag == 1)
-- len += snprintf(buf + len, BUFLEFT, "\n");
-- (void)write(fileno(ttyout), buf, len);
--
-- if (flag == -1) {
-- (void)xsignal_restart(SIGALRM, updateprogressmeter, 1);
-- alarmtimer(1); /* set alarm timer for 1 Hz */
-- } else if (flag == 1) {
-- (void)xsignal(SIGALRM, SIG_DFL);
-- alarmtimer(0);
-- }
--#endif /* !NO_PROGRESS */
--}
--
--/*
-- * Display transfer statistics.
-- * Requires start to be initialised by progressmeter(-1),
-- * direction to be defined by xfer routines, and filesize and bytes
-- * to be updated by xfer routines
-- * If siginfo is nonzero, an ETA is displayed, and the output goes to stderr
-- * instead of ttyout.
-- */
--void
--ptransfer(int siginfo)
--{
-- struct timeval now, td, wait;
-- double elapsed;
-- off_t bytespersec;
-- int remaining, hh, i, len;
--
-- char buf[256]; /* Work variable for transfer status. */
--
-- if (!verbose && !progress && !siginfo)
-- return;
--
-- (void)gettimeofday(&now, NULL);
-- timersub(&now, &start, &td);
-- elapsed = td.tv_sec + (td.tv_usec / 1000000.0);
-- bytespersec = 0;
-- if (bytes > 0) {
-- bytespersec = bytes;
-- if (elapsed > 0.0)
-- bytespersec /= elapsed;
-- }
-- len = 0;
-- len += snprintf(buf + len, BUFLEFT, LLF " byte%s %s in ",
-- (LLT)bytes, bytes == 1 ? "" : "s", direction);
-- remaining = (int)elapsed;
-- if (remaining > SECSPERDAY) {
-- int days;
--
-- days = remaining / SECSPERDAY;
-- remaining %= SECSPERDAY;
-- len += snprintf(buf + len, BUFLEFT,
-- "%d day%s ", days, days == 1 ? "" : "s");
-- }
-- hh = remaining / SECSPERHOUR;
-- remaining %= SECSPERHOUR;
-- if (hh)
-- len += snprintf(buf + len, BUFLEFT, "%2d:", hh);
-- len += snprintf(buf + len, BUFLEFT,
-- "%02d:%02d ", remaining / 60, remaining % 60);
--
-- for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++)
-- bytespersec >>= 10;
-- len += snprintf(buf + len, BUFLEFT, "(" LLF ".%02d %cB/s)",
-- (LLT)(bytespersec / 1024),
-- (int)((bytespersec % 1024) * 100 / 1024),
-- prefixes[i]);
--
-- if (siginfo && bytes > 0 && elapsed > 0.0 && filesize >= 0
-- && bytes + restart_point <= filesize) {
-- remaining = (int)((filesize - restart_point) /
-- (bytes / elapsed) - elapsed);
-- hh = remaining / SECSPERHOUR;
-- remaining %= SECSPERHOUR;
-- len += snprintf(buf + len, BUFLEFT, " ETA: ");
-- if (hh)
-- len += snprintf(buf + len, BUFLEFT, "%2d:", hh);
-- len += snprintf(buf + len, BUFLEFT, "%02d:%02d",
-- remaining / 60, remaining % 60);
-- timersub(&now, &lastupdate, &wait);
-- if (wait.tv_sec >= STALLTIME)
-- len += snprintf(buf + len, BUFLEFT, " (stalled)");
-- }
-- len += snprintf(buf + len, BUFLEFT, "\n");
-- (void)write(siginfo ? STDERR_FILENO : fileno(ttyout), buf, len);
--}
--
--/*
-- * SIG{INFO,QUIT} handler to print transfer stats if a transfer is in progress
-- */
--void
--psummary(int notused)
--{
-- int oerrno = errno;
--
-- if (bytes > 0) {
-- if (fromatty)
-- write(fileno(ttyout), "\n", 1);
-- ptransfer(1);
-- }
-- errno = oerrno;
--}
-
- /*
- * List words in stringlist, vertically arranged
-@@ -1158,20 +886,6 @@
-
-
- /*
-- * Set the SIGALRM interval timer for wait seconds, 0 to disable.
-- */
--void
--alarmtimer(int wait)
--{
-- struct itimerval itv;
--
-- itv.it_value.tv_sec = wait;
-- itv.it_value.tv_usec = 0;
-- itv.it_interval = itv.it_value;
-- setitimer(ITIMER_REAL, &itv, NULL);
--}
--
--/*
- * Setup or cleanup EditLine structures
- */
- #ifndef NO_EDITCOMPLETE
-@@ -1552,85 +1266,4 @@
- if (s == NULL)
- err(1, "Unable to allocate memory for string copy");
- return (s);
--}
--
--/*
-- * Install a POSIX signal handler, allowing the invoker to set whether
-- * the signal should be restartable or not
-- */
--sigfunc
--xsignal_restart(int sig, sigfunc func, int restartable)
--{
--#ifdef ultrix /* XXX: this is lame - how do we test sigvec vs. sigaction? */
-- struct sigvec vec, ovec;
--
-- vec.sv_handler = func;
-- sigemptyset(&vec.sv_mask);
-- vec.sv_flags = 0;
-- if (sigvec(sig, &vec, &ovec) < 0)
-- return (SIG_ERR);
-- return (ovec.sv_handler);
--#else /* ! ultrix */
-- struct sigaction act, oact;
-- act.sa_handler = func;
--
-- sigemptyset(&act.sa_mask);
--#if defined(SA_RESTART) /* 4.4BSD, Posix(?), SVR4 */
-- act.sa_flags = restartable ? SA_RESTART : 0;
--#elif defined(SA_INTERRUPT) /* SunOS 4.x */
-- act.sa_flags = restartable ? 0 : SA_INTERRUPT;
--#else
--#error "system must have SA_RESTART or SA_INTERRUPT"
--#endif
-- if (sigaction(sig, &act, &oact) < 0)
-- return (SIG_ERR);
-- return (oact.sa_handler);
--#endif /* ! ultrix */
--}
--
--/*
-- * Install a signal handler with the `restartable' flag set dependent upon
-- * which signal is being set. (This is a wrapper to xsignal_restart())
-- */
--sigfunc
--xsignal(int sig, sigfunc func)
--{
-- int restartable;
--
-- /*
-- * Some signals print output or change the state of the process.
-- * There should be restartable, so that reads and writes are
-- * not affected. Some signals should cause program flow to change;
-- * these signals should not be restartable, so that the system call
-- * will return with EINTR, and the program will go do something
-- * different. If the signal handler calls longjmp() or siglongjmp(),
-- * it doesn't matter if it's restartable.
-- */
--
-- switch(sig) {
--#ifdef SIGINFO
-- case SIGINFO:
--#endif
-- case SIGQUIT:
-- case SIGUSR1:
-- case SIGUSR2:
-- case SIGWINCH:
-- restartable = 1;
-- break;
--
-- case SIGALRM:
-- case SIGINT:
-- case SIGPIPE:
-- restartable = 0;
-- break;
--
-- default:
-- /*
-- * This is unpleasant, but I don't know what would be better.
-- * Right now, this "can't happen"
-- */
-- errx(1, "xsignal_restart called with signal %d", sig);
-- }
--
-- return(xsignal_restart(sig, func, restartable));
- }
-diff -Nru src/version.h /home/spock/ftp/version.h
---- src/version.h Sat Jun 15 05:40:37 2002
-+++ /home/spock/ftp/version.h Thu Jun 12 02:02:11 2003
-@@ -1,6 +1,6 @@
--/* $NetBSD: version.h,v 1.29 2002/06/05 10:20:51 lukem Exp $ */
-+/* $NetBSD: version.h,v 1.30 2003/02/28 09:54:20 lukem Exp $ */
- /*-
-- * Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
-+ * Copyright (c) 1999-2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
-@@ -40,5 +40,5 @@
- #endif
-
- #ifndef FTP_VERSION
--#define FTP_VERSION "20020605"
-+#define FTP_VERSION "20030228"
- #endif
diff --git a/contrib/lukemftp/install-sh b/contrib/lukemftp/install-sh
deleted file mode 100755
index e9de238..0000000
--- a/contrib/lukemftp/install-sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- chmodcmd=""
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/contrib/lukemftp/lukemftp.h b/contrib/lukemftp/lukemftp.h
deleted file mode 100644
index e8d83f6..0000000
--- a/contrib/lukemftp/lukemftp.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/* $Id: lukemftp.h,v 1.43 2002/06/10 08:13:01 lukem Exp $ */
-
-#define FTP_PRODUCT "lukemftp"
-#define FTP_VERSION "1.6-beta2"
-
-#include "config.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-
-#include <arpa/ftp.h>
-#include <arpa/inet.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <netdb.h>
-#include <pwd.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <termios.h>
-#include <unistd.h>
-
-#if HAVE_POLL
-# if HAVE_POLL_H
-# include <poll.h>
-# elif HAVE_SYS_POLL_H
-# include <sys/poll.h>
-# endif
-#elif HAVE_SELECT
-# define USE_SELECT
-#else
-# error "no poll() or select() found"
-#endif
-
-#if HAVE_DIRENT_H
-# include <dirent.h>
-#else
-# define dirent direct
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#if HAVE_ERR_H
-# include <err.h>
-#endif
-
-#if USE_GLOB_H /* not set by configure; used by other build systems */
-# include <glob.h>
-#else
-# include "ftpglob.h"
-#endif
-
-#if HAVE_PATHS_H
-# include <paths.h>
-#endif
-#ifndef _PATH_BSHELL
-#define _PATH_BSHELL "/bin/sh"
-#endif
-#ifndef _PATH_TMP
-#define _PATH_TMP "/tmp/"
-#endif
-
-typedef struct _stringlist {
- char **sl_str;
- size_t sl_max;
- size_t sl_cur;
-} StringList;
-
-StringList *sl_init(void);
-int sl_add(StringList *, char *);
-void sl_free(StringList *, int);
-char *sl_find(StringList *, char *);
-
-#if HAVE_TERMCAP_H
-# include <termcap.h>
-#else
-int tgetent(char *, const char *);
-char *tgetstr(const char *, char **);
-int tgetflag(const char *);
-int tgetnum(const char *);
-char *tgoto(const char *, int, int);
-void tputs(const char *, int, int (*)(int));
-#endif
-
-#if HAVE_UTIL_H
-# include <util.h>
-#endif
-
-#if HAVE_LIBUTIL_H
-# include <libutil.h>
-#endif
-
-#if HAVE_VIS_H
-# include <vis.h>
-#else
-# include "ftpvis.h"
-#endif
-
-#if ! HAVE_IN_PORT_T
-typedef unsigned short in_port_t;
-#endif
-
-#if ! HAVE_SA_FAMILY_T
-typedef unsigned short sa_family_t;
-#endif
-
-#if ! HAVE_SOCKLEN_T
-typedef unsigned int socklen_t;
-#endif
-
-#if HAVE_AF_INET6 && HAVE_SOCKADDR_IN6
-# define INET6
-#endif
-
-
-#if ! HAVE_RFC2553_NETDB
-
- /* RFC 2553 */
-#undef EAI_ADDRFAMILY
-#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
-#undef EAI_AGAIN
-#define EAI_AGAIN 2 /* temporary failure in name resolution */
-#undef EAI_BADFLAGS
-#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
-#undef EAI_FAIL
-#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
-#undef EAI_FAMILY
-#define EAI_FAMILY 5 /* ai_family not supported */
-#undef EAI_MEMORY
-#define EAI_MEMORY 6 /* memory allocation failure */
-#undef EAI_NODATA
-#define EAI_NODATA 7 /* no address associated with hostname */
-#undef EAI_NONAME
-#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
-#undef EAI_SERVICE
-#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
-#undef EAI_SOCKTYPE
-#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
-#undef EAI_SYSTEM
-#define EAI_SYSTEM 11 /* system error returned in errno */
-
- /* KAME extensions? */
-#undef EAI_BADHINTS
-#define EAI_BADHINTS 12
-#undef EAI_PROTOCOL
-#define EAI_PROTOCOL 13
-#undef EAI_MAX
-#define EAI_MAX 14
-
- /* RFC 2553 */
-#undef NI_MAXHOST
-#define NI_MAXHOST 1025
-#undef NI_MAXSERV
-#define NI_MAXSERV 32
-
-#undef NI_NOFQDN
-#define NI_NOFQDN 0x00000001
-#undef NI_NUMERICHOST
-#define NI_NUMERICHOST 0x00000002
-#undef NI_NAMEREQD
-#define NI_NAMEREQD 0x00000004
-#undef NI_NUMERICSERV
-#define NI_NUMERICSERV 0x00000008
-#undef NI_DGRAM
-#define NI_DGRAM 0x00000010
-
- /* RFC 2553 */
-#undef AI_PASSIVE
-#define AI_PASSIVE 0x00000001 /* get address to use bind() */
-#undef AI_CANONNAME
-#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
-
- /* KAME extensions ? */
-#undef AI_NUMERICHOST
-#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
-#undef AI_MASK
-#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
-
- /* RFC 2553 */
-#undef AI_ALL
-#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
-#undef AI_V4MAPPED_CFG
-#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
-#undef AI_ADDRCONFIG
-#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
-#undef AI_V4MAPPED
-#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
-
-#endif /* ! HAVE_RFC2553_NETDB */
-
-
-#if ! HAVE_RFC2553_NETDB && ! HAVE_ADDRINFO
-
-struct addrinfo {
- int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
- int ai_family; /* PF_xxx */
- int ai_socktype; /* SOCK_xxx */
- int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
- size_t ai_addrlen; /* length of ai_addr */
- char *ai_canonname; /* canonical name for hostname */
- struct sockaddr *ai_addr; /* binary address */
- struct addrinfo *ai_next; /* next structure in linked list */
-};
-
-int getaddrinfo(const char *, const char *,
- const struct addrinfo *, struct addrinfo **);
-int getnameinfo(const struct sockaddr *, socklen_t, char *,
- size_t, char *, size_t, int);
-void freeaddrinfo(struct addrinfo *);
-char *gai_strerror(int);
-
-#endif /* ! HAVE_RFC2553_NETDB && ! HAVE_ADDRINFO */
-
-
-#if ! HAVE_D_NAMLEN
-# define DIRENT_MISSING_D_NAMLEN
-#endif
-
-#if ! HAVE_H_ERRNO_D
-extern int h_errno;
-#endif
-#define HAVE_H_ERRNO 1 /* XXX: an assumption for now... */
-
-#if ! HAVE_FCLOSE_D
-int fclose(FILE *);
-#endif
-
-#if ! HAVE_GETPASS_D
-char *getpass(const char *);
-#endif
-
-#if ! HAVE_OPTARG_D
-extern char *optarg;
-#endif
-
-#if ! HAVE_OPTIND_D
-extern int optind;
-#endif
-
-#if ! HAVE_PCLOSE_D
-int pclose(FILE *);
-#endif
-
-#if ! HAVE_ERR
-void err(int, const char *, ...);
-void errx(int, const char *, ...);
-void warn(const char *, ...);
-void warnx(const char *, ...);
-#endif
-
-#if ! HAVE_FGETLN
-char *fgetln(FILE *, size_t *);
-#endif
-
-#if ! HAVE_FSEEKO
-int fseeko(FILE *, off_t, int);
-#endif
-
-#if ! HAVE_FPARSELN
-# define FPARSELN_UNESCESC 0x01
-# define FPARSELN_UNESCCONT 0x02
-# define FPARSELN_UNESCCOMM 0x04
-# define FPARSELN_UNESCREST 0x08
-# define FPARSELN_UNESCALL 0x0f
-char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
-#endif
-
-#if ! HAVE_INET_NTOP
-const char *inet_ntop(int, const void *, char *, size_t);
-#endif
-
-#if ! HAVE_INET_PTON
-int inet_pton(int, const char *, void *);
-#endif
-
-#if ! HAVE_MKSTEMP
-int mkstemp(char *);
-#endif
-
-#if ! HAVE_SETPROGNAME
-const char *getprogname(void);
-void setprogname(const char *);
-#endif
-
-#if ! HAVE_SNPRINTF
-int snprintf(char *, size_t, const char *, ...);
-#endif
-
-#if ! HAVE_STRDUP
-char *strdup(const char *);
-#endif
-
-#if ! HAVE_STRERROR
-char *strerror(int);
-#endif
-
-#if ! HAVE_STRPTIME || ! HAVE_STRPTIME_D
-char *strptime(const char *, const char *, struct tm *);
-#endif
-
-#if HAVE_QUAD_SUPPORT
-# if ! HAVE_STRTOLL && HAVE_LONG_LONG
-long long strtoll(const char *, char **, int);
-# if ! defined(QUAD_MIN)
-# define QUAD_MIN (-0x7fffffffffffffffL-1)
-# endif
-# if ! defined(QUAD_MAX)
-# define QUAD_MAX (0x7fffffffffffffffL)
-# endif
-# endif
-#else /* ! HAVE_QUAD_SUPPORT */
-# define NO_LONG_LONG 1
-#endif /* ! HAVE_QUAD_SUPPORT */
-
-#if ! HAVE_TIMEGM
-time_t timegm(struct tm *);
-#endif
-
-#if ! HAVE_HSTRERROR
-char *strerror(int);
-#endif
-
-#if ! HAVE_STRLCAT
-size_t strlcat(char *, const char *, size_t);
-#endif
-
-#if ! HAVE_STRLCPY
-size_t strlcpy(char *, const char *, size_t);
-#endif
-
-#if ! HAVE_STRSEP
-char *strsep(char **stringp, const char *delim);
-#endif
-
-#if ! HAVE_MEMMOVE
-# define memmove(a,b,c) bcopy((b),(a),(c))
- /* XXX: add others #defines for borken systems? */
-#endif
-
-#if HAVE_GETPASSPHRASE
-# define getpass getpassphrase
-#endif
-
-#if ! defined(MIN)
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-#if ! defined(MAX)
-# define MAX(a, b) ((a) < (b) ? (b) : (a))
-#endif
-
-#if ! defined(timersub)
-# define timersub(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
- if ((vvp)->tv_usec < 0) { \
- (vvp)->tv_sec--; \
- (vvp)->tv_usec += 1000000; \
- } \
- } while (0)
-#endif
-
-#if ! defined(S_ISLNK)
-# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
-#endif
-
-#define EPOCH_YEAR 1970
-#define SECSPERHOUR 3600
-#define SECSPERDAY 86400
-#define TM_YEAR_BASE 1900
diff --git a/contrib/lukemftp/src/Makefile b/contrib/lukemftp/src/Makefile
deleted file mode 100644
index 79cc5a6..0000000
--- a/contrib/lukemftp/src/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# $NetBSD: Makefile,v 1.30 2005/02/11 15:13:28 jmc Exp $
-# from: @(#)Makefile 8.2 (Berkeley) 4/3/94
-
-.include <bsd.own.mk>
-
-PROG= ftp
-SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
- progressbar.c ruserpass.c util.c
-
-# Uncomment the following to provide defaults for gate-ftp operation
-#
-#CPPFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21
-
-.if defined(SMALLPROG)
-CPPFLAGS+=-DNO_EDITCOMPLETE -DNO_ABOUT -DNO_AUTH -DNO_HELP -DNO_STATUS
-.else
-LDADD+= -ledit -ltermcap
-DPADD+= ${LIBEDIT} ${LIBTERMCAP}
-.endif
-
-.if (!defined(SMALLPROG) || defined(SMALLPROG_INET6)) && (${USE_INET6} != "no")
-CPPFLAGS+= -DINET6
-.endif
-
-cmds.o fetch.o: version.h
-main.o: ftp_var.h
-
-.include <bsd.prog.mk>
diff --git a/contrib/lukemftp/src/Makefile.in b/contrib/lukemftp/src/Makefile.in
deleted file mode 100644
index bb60f10..0000000
--- a/contrib/lukemftp/src/Makefile.in
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# $Id: Makefile.in,v 1.8 2000/08/08 07:04:27 lukem Exp $
-#
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-SHELL = /bin/sh
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-
-mandircat1 = ${mandir}/cat1
-
-CC = @CC@
-CFLAGS = -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CFLAGS@
-LIBS = @LIBS@
-LDFLAGS = @LDFLAGS@
-
-INSTALL = @INSTALL@
-
-PROG = ftp
-OBJS = cmds.o cmdtab.o complete.o domacro.o fetch.o ftp.o main.o \
- ruserpass.o util.o
-
-all: ${PROG}
-
-install: all
- -mkdir -p ${bindir}
- ${INSTALL} -m 555 ${PROG} ${bindir}/`echo ${PROG}|sed '$(transform)'`
- -mkdir -p ${mandircat1}
- ${INSTALL} -m 444 ${srcdir}/${PROG}.cat1 ${mandircat1}/`echo ${PROG}|sed '$(transform)'`.1
-
-${PROG}: ${OBJS} @LIBDEPENDS@
- ${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}
-
-clean:
- rm -f core ${PROG} ${OBJS}
-
-distclean: clean
- rm -f Makefile
diff --git a/contrib/lukemftp/todo b/contrib/lukemftp/todo
deleted file mode 100644
index 4863815..0000000
--- a/contrib/lukemftp/todo
+++ /dev/null
@@ -1,25 +0,0 @@
-$Id: todo,v 1.30 2002/06/10 08:08:53 lukem Exp $
-
-update NEWS, README, ...
-
-at end of configure, show summary of options used and features found
-
-if socks is defined, disable ipv6 and use own getaddrinfo()/getnameinfo()
-(for tron)
-
-add locale autoconf checks
-
-AC_CHECK_SIZEOF(off_t, 0) doesn't work on FreeBSD 4.0 because the
-test doesn't include <sys/types.h>. fix autoconf?
-
-in configure, check for ansi c compiler and barf if it fails
-
-check if we need #defines for memcpy() et al
-
-check for utimes() decls [which system?]
-
-possibly install editline.3 and editrc.5
-
-system specific tests (to remove need for manual intervention):
-- sunos4
- LIBS+= -lresolv
diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c
index 71ee15f..8dac3c4 100644
--- a/contrib/ntp/ntpd/ntp_io.c
+++ b/contrib/ntp/ntpd/ntp_io.c
@@ -1753,7 +1753,12 @@ void
enable_multicast_if(struct interface *iface, struct sockaddr_storage *maddr)
{
#ifdef MCAST
+#ifdef IP_MULTICAST_LOOP
/*u_char*/ TYPEOF_IP_MULTICAST_LOOP off = 0;
+#endif
+#ifdef IPV6_MULTICAST_LOOP
+ u_int off6 = 0; /* RFC 3493, 5.2. defines type unsigned int */
+#endif
switch (maddr->ss_family)
{
@@ -1797,9 +1802,9 @@ enable_multicast_if(struct interface *iface, struct sockaddr_storage *maddr)
* Don't send back to itself, but allow it to fail to set it
*/
if (setsockopt(iface->fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP,
- (char *) &off, sizeof(off)) == -1) {
+ (char *) &off6, sizeof(off6)) == -1) {
netsyslog(LOG_ERR,
- "setsockopt IP_MULTICAST_LOOP failure: %m on socket %d, addr %s for multicast address %s",
+ "setsockopt IPV6_MULTICAST_LOOP failure: %m on socket %d, addr %s for multicast address %s",
iface->fd, stoa(&iface->sin), stoa(maddr));
}
#endif
diff --git a/contrib/openbsm/libbsm/audit_submit.3 b/contrib/openbsm/libbsm/audit_submit.3
index b6c28a7..c77e1d4 100644
--- a/contrib/openbsm/libbsm/audit_submit.3
+++ b/contrib/openbsm/libbsm/audit_submit.3
@@ -30,7 +30,7 @@
.\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/audit_submit.3#17 $
.\"
.Dd January 18, 2008
-.Dt audit_submit 3
+.Dt AUDIT_SUBMIT 3
.Os
.Sh NAME
.Nm audit_submit
diff --git a/contrib/pf/pfctl/pfctl.8 b/contrib/pf/pfctl/pfctl.8
index 24be6e5..917a859 100644
--- a/contrib/pf/pfctl/pfctl.8
+++ b/contrib/pf/pfctl/pfctl.8
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 20, 2002
+.Dd June 13, 2011
.Dt PFCTL 8
.Os
.Sh NAME
@@ -35,7 +35,7 @@
.Sh SYNOPSIS
.Nm pfctl
.Bk -words
-.Op Fl AdeghmNnOqRrvz
+.Op Fl AdeghmNnOPqRrvz
.Op Fl a Ar anchor
.Oo Fl D Ar macro Ns =
.Ar value Oc
@@ -350,6 +350,9 @@ without any options will enable
optimizations, and a second
.Fl o
will enable profiling.
+.It Fl P
+Do not perform service name lookup for port specific rules,
+instead display the ports numerically.
.It Fl p Ar device
Use the device file
.Ar device
@@ -670,6 +673,7 @@ Passive operating system fingerprint database.
.Xr pf.conf 5 ,
.Xr pf.os 5 ,
.Xr rc.conf 5 ,
+.Xr services 5 ,
.Xr sysctl.conf 5 ,
.Xr authpf 8 ,
.Xr ftp-proxy 8 ,
diff --git a/contrib/pf/pfctl/pfctl.c b/contrib/pf/pfctl/pfctl.c
index 21995f6..e76261b 100644
--- a/contrib/pf/pfctl/pfctl.c
+++ b/contrib/pf/pfctl/pfctl.c
@@ -235,7 +235,7 @@ usage(void)
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-AdeghmNnOqRrvz] ", __progname);
+ fprintf(stderr, "usage: %s [-AdeghmNnOPqRrvz] ", __progname);
fprintf(stderr, "[-a anchor] [-D macro=value] [-F modifier]\n");
fprintf(stderr, "\t[-f file] [-i interface] [-K host | network] ");
fprintf(stderr, "[-k host | network ]\n");
@@ -770,6 +770,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
struct pfioc_rule pr;
u_int32_t nr, mnr, header = 0;
int rule_numbers = opts & (PF_OPT_VERBOSE2 | PF_OPT_DEBUG);
+ int numeric = opts & PF_OPT_NUMERIC;
int len = strlen(path);
int brace;
char *p;
@@ -834,7 +835,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
case PFCTL_SHOW_RULES:
if (pr.rule.label[0] && (opts & PF_OPT_SHOWALL))
labels = 1;
- print_rule(&pr.rule, pr.anchor_call, rule_numbers);
+ print_rule(&pr.rule, pr.anchor_call, rule_numbers, numeric);
printf("\n");
pfctl_print_rule_counters(&pr.rule, opts);
break;
@@ -894,7 +895,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format,
} else
p = &pr.anchor_call[0];
- print_rule(&pr.rule, p, rule_numbers);
+ print_rule(&pr.rule, p, rule_numbers, numeric);
if (brace)
printf(" {\n");
else
@@ -951,7 +952,7 @@ pfctl_show_nat(int dev, int opts, char *anchorname)
dotitle = 0;
}
print_rule(&pr.rule, pr.anchor_call,
- opts & PF_OPT_VERBOSE2);
+ opts & PF_OPT_VERBOSE2, opts & PF_OPT_NUMERIC);
printf("\n");
pfctl_print_rule_counters(&pr.rule, opts);
pfctl_clear_pool(&pr.rule.rpool);
@@ -1318,7 +1319,8 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pf_rule *r, int depth)
if (pf->opts & PF_OPT_VERBOSE) {
INDENT(depth, !(pf->opts & PF_OPT_VERBOSE2));
print_rule(r, r->anchor ? r->anchor->name : "",
- pf->opts & PF_OPT_VERBOSE2);
+ pf->opts & PF_OPT_VERBOSE2,
+ pf->opts & PF_OPT_NUMERIC);
}
path[len] = '\0';
pfctl_clear_pool(&r->rpool);
@@ -1978,7 +1980,7 @@ main(int argc, char *argv[])
usage();
while ((ch = getopt(argc, argv,
- "a:AdD:eqf:F:ghi:k:K:mnNOo::p:rRs:t:T:vx:z")) != -1) {
+ "a:AdD:eqf:F:ghi:k:K:mnNOo::Pp:rRs:t:T:vx:z")) != -1) {
switch (ch) {
case 'a':
anchoropt = optarg;
@@ -2080,6 +2082,9 @@ main(int argc, char *argv[])
case 'p':
pf_device = optarg;
break;
+ case 'P':
+ opts |= PF_OPT_NUMERIC;
+ break;
case 's':
showopt = pfctl_lookup_option(optarg, showopt_list);
if (showopt == NULL) {
diff --git a/contrib/pf/pfctl/pfctl_optimize.c b/contrib/pf/pfctl/pfctl_optimize.c
index 44c0477..0514e81 100644
--- a/contrib/pf/pfctl/pfctl_optimize.c
+++ b/contrib/pf/pfctl/pfctl_optimize.c
@@ -407,7 +407,7 @@ optimize_superblock(struct pfctl *pf, struct superblock *block)
TAILQ_FOREACH(por, &block->sb_rules, por_entry) {
printf(" ");
print_rule(&por->por_rule, por->por_rule.anchor ?
- por->por_rule.anchor->name : "", 1);
+ por->por_rule.anchor->name : "", 1, 0);
}
#endif /* OPT_DEBUG */
diff --git a/contrib/pf/pfctl/pfctl_parser.c b/contrib/pf/pfctl/pfctl_parser.c
index c9b2e11..7dc0c59 100644
--- a/contrib/pf/pfctl/pfctl_parser.c
+++ b/contrib/pf/pfctl/pfctl_parser.c
@@ -64,11 +64,11 @@ __FBSDID("$FreeBSD$");
#include "pfctl.h"
void print_op (u_int8_t, const char *, const char *);
-void print_port (u_int8_t, u_int16_t, u_int16_t, const char *);
+void print_port (u_int8_t, u_int16_t, u_int16_t, const char *, int);
void print_ugid (u_int8_t, unsigned, unsigned, const char *, unsigned);
void print_flags (u_int8_t);
void print_fromto(struct pf_rule_addr *, pf_osfp_t,
- struct pf_rule_addr *, u_int8_t, u_int8_t, int);
+ struct pf_rule_addr *, u_int8_t, u_int8_t, int, int);
int ifa_skip_if(const char *filter, struct node_host *p);
struct node_host *ifa_grouplookup(const char *, int);
@@ -320,12 +320,15 @@ print_op(u_int8_t op, const char *a1, const char *a2)
}
void
-print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto)
+print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto, int numeric)
{
char a1[6], a2[6];
struct servent *s;
- s = getservbyport(p1, proto);
+ if (!numeric)
+ s = getservbyport(p1, proto);
+ else
+ s = NULL;
p1 = ntohs(p1);
p2 = ntohs(p2);
snprintf(a1, sizeof(a1), "%u", p1);
@@ -363,7 +366,7 @@ print_flags(u_int8_t f)
void
print_fromto(struct pf_rule_addr *src, pf_osfp_t osfp, struct pf_rule_addr *dst,
- sa_family_t af, u_int8_t proto, int verbose)
+ sa_family_t af, u_int8_t proto, int verbose, int numeric)
{
char buf[PF_OSFP_LEN*3];
if (src->addr.type == PF_ADDR_ADDRMASK &&
@@ -384,7 +387,8 @@ print_fromto(struct pf_rule_addr *src, pf_osfp_t osfp, struct pf_rule_addr *dst,
if (src->port_op)
print_port(src->port_op, src->port[0],
src->port[1],
- proto == IPPROTO_TCP ? "tcp" : "udp");
+ proto == IPPROTO_TCP ? "tcp" : "udp",
+ numeric);
if (osfp != PF_OSFP_ANY)
printf(" os \"%s\"", pfctl_lookup_fingerprint(osfp, buf,
sizeof(buf)));
@@ -396,7 +400,8 @@ print_fromto(struct pf_rule_addr *src, pf_osfp_t osfp, struct pf_rule_addr *dst,
if (dst->port_op)
print_port(dst->port_op, dst->port[0],
dst->port[1],
- proto == IPPROTO_TCP ? "tcp" : "udp");
+ proto == IPPROTO_TCP ? "tcp" : "udp",
+ numeric);
}
}
@@ -673,7 +678,7 @@ print_src_node(struct pf_src_node *sn, int opts)
}
void
-print_rule(struct pf_rule *r, const char *anchor_call, int verbose)
+print_rule(struct pf_rule *r, const char *anchor_call, int verbose, int numeric)
{
static const char *actiontypes[] = { "pass", "block", "scrub",
"no scrub", "nat", "no nat", "binat", "no binat", "rdr", "no rdr" };
@@ -800,7 +805,7 @@ print_rule(struct pf_rule *r, const char *anchor_call, int verbose)
printf(" proto %u", r->proto);
}
print_fromto(&r->src, r->os_fingerprint, &r->dst, r->af, r->proto,
- verbose);
+ verbose, numeric);
if (r->uid.op)
print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user",
UID_MAX);
diff --git a/contrib/pf/pfctl/pfctl_parser.h b/contrib/pf/pfctl/pfctl_parser.h
index 4885203..ab9017e 100644
--- a/contrib/pf/pfctl/pfctl_parser.h
+++ b/contrib/pf/pfctl/pfctl_parser.h
@@ -48,6 +48,7 @@
#define PF_OPT_DEBUG 0x0200
#define PF_OPT_SHOWALL 0x0400
#define PF_OPT_OPTIMIZE 0x0800
+#define PF_OPT_NUMERIC 0x1000
#define PF_OPT_MERGE 0x2000
#define PF_OPT_RECURSE 0x4000
@@ -235,7 +236,7 @@ int pfctl_load_anchors(int, struct pfctl *, struct pfr_buffer *);
void print_pool(struct pf_pool *, u_int16_t, u_int16_t, sa_family_t, int);
void print_src_node(struct pf_src_node *, int);
-void print_rule(struct pf_rule *, const char *, int);
+void print_rule(struct pf_rule *, const char *, int, int);
void print_tabledef(const char *, int, int, struct node_tinithead *);
void print_status(struct pf_status *, int);
diff --git a/contrib/sendmail/CACerts b/contrib/sendmail/CACerts
index dee2819..245148d 100644
--- a/contrib/sendmail/CACerts
+++ b/contrib/sendmail/CACerts
@@ -1,4 +1,4 @@
-# $Id: CACerts,v 8.4 2009/06/26 05:46:10 ca Exp $
+# $Id: CACerts,v 8.5 2011/05/06 23:05:10 ca Exp $
# This file contains some CA certificates that are used to sign the
# certificates of mail servers of members of the sendmail consortium
# who may reply to questions etc sent to sendmail.org.
@@ -9,73 +9,6 @@
Certificate:
Data:
Version: 3 (0x2)
- Serial Number: 0 (0x0)
- Signature Algorithm: md5WithRSAEncryption
- Issuer: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu
- Validity
- Not Before: May 12 00:40:50 2000 GMT
- Not After : May 20 00:40:50 2010 GMT
- Subject: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu
- Subject Public Key Info:
- Public Key Algorithm: rsaEncryption
- RSA Public Key: (1024 bit)
- Modulus (1024 bit):
- 00:b1:1b:49:06:ef:3f:44:e0:93:ad:8c:a7:f7:21:
- 7c:87:cb:da:35:f6:4b:a2:fd:8a:a0:07:5b:cc:6a:
- 9b:89:33:fc:24:f5:b1:24:59:5a:25:50:fd:16:d7:
- d4:bc:c7:04:1d:df:90:9b:5e:c3:a8:e9:8b:7d:a3:
- 5d:9a:e9:7f:e5:2b:ea:15:a7:ad:ba:58:26:0a:11:
- 49:4f:da:9a:67:7f:b0:a6:66:f4:27:b6:61:4e:3c:
- c8:3e:a0:2f:6a:b4:0e:15:d6:39:f8:92:60:85:df:
- a6:34:f3:fa:a4:a5:e4:47:49:e7:87:a4:a5:5c:8e:
- 6a:2f:13:76:5f:29:f3:64:73
- Exponent: 65537 (0x10001)
- X509v3 extensions:
- X509v3 Subject Key Identifier:
- B6:31:78:BB:7E:AA:4D:A1:5D:FD:A2:24:18:C6:90:5A:2D:2F:19:48
- X509v3 Authority Key Identifier:
- keyid:B6:31:78:BB:7E:AA:4D:A1:5D:FD:A2:24:18:C6:90:5A:2D:2F:19:48
- DirName:/C=US/ST=Illinois/L=De Kalb/O=Northern Illinois University/OU=Computer Science/CN=Neil Rickert/emailAddress=rickert@cs.niu.edu
- serial:00
-
- X509v3 Basic Constraints:
- CA:TRUE
- Signature Algorithm: md5WithRSAEncryption
- 60:69:23:65:97:51:5c:06:a4:42:cb:00:e7:9a:dc:39:70:c3:
- d3:5d:bf:0f:e0:04:54:4d:d9:dc:12:57:12:6c:67:fd:5b:b0:
- 39:63:ea:c4:12:65:51:bb:3d:f1:f7:25:b4:cd:0b:f6:5b:7a:
- 61:25:ad:06:0a:01:55:dc:71:05:29:0d:73:e9:30:51:be:d3:
- e1:b2:89:fc:0f:28:f7:06:75:96:1b:34:75:e0:07:e5:3b:b3:
- 0b:28:24:e5:79:ea:55:39:e7:d2:ee:ec:63:b4:e4:c6:ee:cb:
- 15:d0:c8:eb:3b:4f:36:10:a4:6a:c0:6b:03:e8:29:72:c7:a7:
- 10:00
------BEGIN CERTIFICATE-----
-MIID5TCCA06gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBrjELMAkGA1UEBhMCVVMx
-ETAPBgNVBAgTCElsbGlub2lzMRAwDgYDVQQHEwdEZSBLYWxiMSUwIwYDVQQKExxO
-b3J0aGVybiBJbGxpbm9pcyBVbml2ZXJzaXR5MRkwFwYDVQQLExBDb21wdXRlciBT
-Y2llbmNlMRUwEwYDVQQDEwxOZWlsIFJpY2tlcnQxITAfBgkqhkiG9w0BCQEWEnJp
-Y2tlcnRAY3Mubml1LmVkdTAeFw0wMDA1MTIwMDQwNTBaFw0xMDA1MjAwMDQwNTBa
-MIGuMQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0Rl
-IEthbGIxJTAjBgNVBAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAX
-BgNVBAsTEENvbXB1dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEh
-MB8GCSqGSIb3DQEJARYScmlja2VydEBjcy5uaXUuZWR1MIGfMA0GCSqGSIb3DQEB
-AQUAA4GNADCBiQKBgQCxG0kG7z9E4JOtjKf3IXyHy9o19kui/YqgB1vMapuJM/wk
-9bEkWVolUP0W19S8xwQd35CbXsOo6Yt9o12a6X/lK+oVp626WCYKEUlP2ppnf7Cm
-ZvQntmFOPMg+oC9qtA4V1jn4kmCF36Y08/qkpeRHSeeHpKVcjmovE3ZfKfNkcwID
-AQABo4IBDzCCAQswHQYDVR0OBBYEFLYxeLt+qk2hXf2iJBjGkFotLxlIMIHbBgNV
-HSMEgdMwgdCAFLYxeLt+qk2hXf2iJBjGkFotLxlIoYG0pIGxMIGuMQswCQYDVQQG
-EwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0RlIEthbGIxJTAjBgNV
-BAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAXBgNVBAsTEENvbXB1
-dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEhMB8GCSqGSIb3DQEJ
-ARYScmlja2VydEBjcy5uaXUuZWR1ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN
-AQEEBQADgYEAYGkjZZdRXAakQssA55rcOXDD012/D+AEVE3Z3BJXEmxn/VuwOWPq
-xBJlUbs98fcltM0L9lt6YSWtBgoBVdxxBSkNc+kwUb7T4bKJ/A8o9wZ1lhs0deAH
-5TuzCygk5XnqVTnn0u7sY7Tkxu7LFdDI6ztPNhCkasBrA+gpcsenEAA=
------END CERTIFICATE-----
-
-Certificate:
- Data:
- Version: 3 (0x2)
Serial Number:
c2:3c:61:67:3b:0a:cc:5e
Signature Algorithm: md5WithRSAEncryption
diff --git a/contrib/sendmail/FREEBSD-upgrade b/contrib/sendmail/FREEBSD-upgrade
index 5d4cf65..cabeb2e 100644
--- a/contrib/sendmail/FREEBSD-upgrade
+++ b/contrib/sendmail/FREEBSD-upgrade
@@ -1,6 +1,6 @@
$FreeBSD$
-sendmail 8.14.4
+sendmail 8.14.5
originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/
For the import of sendmail, the following directories were renamed:
@@ -110,4 +110,4 @@ infrastructure in FreeBSD:
usr.sbin/mailwrapper/Makefile
gshapiro@FreeBSD.org
-25-January-2010
+13-June-2011
diff --git a/contrib/sendmail/KNOWNBUGS b/contrib/sendmail/KNOWNBUGS
index 998fb11..5b7918c 100644
--- a/contrib/sendmail/KNOWNBUGS
+++ b/contrib/sendmail/KNOWNBUGS
@@ -12,6 +12,14 @@ distribution).
This list is not guaranteed to be complete.
+* Header values which are too long may be truncated.
+
+ If a value of a structured header is longer than 256 (MAXNAME)
+ characters then it may be truncated during output. For example,
+ if a single address in the To: header is longer than 256 characters
+ then it will be truncated which may result in a syntactically
+ invalid address.
+
* Delivery to programs that generate too much output may cause problems
If e-mail is delivered to a program which generates too much
@@ -258,4 +266,4 @@ Kresolve sequence dnsmx canon
be used if set instead of LOCAL_RELAY ($R). This will be fixed in a
future version.
-$Revision: 8.60 $, Last updated $Date: 2007/12/04 01:16:50 $
+$Revision: 8.61 $, Last updated $Date: 2011/04/07 17:48:23 $
diff --git a/contrib/sendmail/LICENSE b/contrib/sendmail/LICENSE
index 2c60403..a0ad124 100644
--- a/contrib/sendmail/LICENSE
+++ b/contrib/sendmail/LICENSE
@@ -1,8 +1,9 @@
SENDMAIL LICENSE
-The following license terms and conditions apply, unless a different
-license is obtained from Sendmail, Inc., 6475 Christie Ave, Suite 350,
-Emeryville, CA 94608, USA, or by electronic mail at license@sendmail.com.
+The following license terms and conditions apply, unless a redistribution
+agreement or other license is obtained from Sendmail, Inc., 6475 Christie
+Ave, Third Floor, Emeryville, CA 94608, USA, or by electronic mail at
+license@sendmail.com.
License Terms:
@@ -22,10 +23,11 @@ each of the following conditions is met:
must allow further use, modification, and redistribution of the Source
Code under substantially the same terms as this license. For the
purposes of redistribution "Source Code" means the complete compilable
- and linkable source code of sendmail including all modifications.
+ and linkable source code of sendmail and associated libraries and
+ utilities in the sendmail distribution including all modifications.
-2. Redistributions of source code must retain the copyright notices as they
- appear in each source code file, these license terms, and the
+2. Redistributions of Source Code must retain the copyright notices as they
+ appear in each Source Code file, these license terms, and the
disclaimer/limitation of liability set forth as paragraph 6 below.
3. Redistributions in binary form must reproduce the Copyright Notice,
@@ -33,16 +35,16 @@ each of the following conditions is met:
forth as paragraph 6 below, in the documentation and/or other materials
provided with the distribution. For the purposes of binary distribution
the "Copyright Notice" refers to the following language:
- "Copyright (c) 1998-2009 Sendmail, Inc. All rights reserved."
+ "Copyright (c) 1998-2010 Sendmail, Inc. All rights reserved."
4. Neither the name of Sendmail, Inc. nor the University of California nor
- the names of their contributors may be used to endorse or promote
+ names of their contributors may be used to endorse or promote
products derived from this software without specific prior written
permission. The name "sendmail" is a trademark of Sendmail, Inc.
5. All redistributions must comply with the conditions imposed by the
- University of California on certain embedded code, whose copyright
- notice and conditions for redistribution are as follows:
+ University of California on certain embedded code, which copyright
+ Notice and conditions for redistribution are as follows:
(a) Copyright (c) 1988, 1993 The Regents of the University of
California. All rights reserved.
@@ -76,4 +78,4 @@ each of the following conditions is met:
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-$Revision: 8.15 $, Last updated $Date: 2009/03/04 19:58:04 $
+$Revision: 8.17 $, Last updated $Date: 2010/12/03 01:10:00 $, Document 139848.1
diff --git a/contrib/sendmail/PGPKEYS b/contrib/sendmail/PGPKEYS
index 5f89ed4..fd6daf8 100644
--- a/contrib/sendmail/PGPKEYS
+++ b/contrib/sendmail/PGPKEYS
@@ -142,6 +142,223 @@ gpExpdV7qPrw9k01j5rod5PjZlG8zV0=
-----END PGP PUBLIC KEY BLOCK-----
Type Bits KeyID Created Expires Algorithm Use
+pub 2048 A97884B0 2011-01-04 ------- RSA Sign & Encrypt
+fingerprint: 5872 6218 A913 400D E660 3601 39A4 C77D A978 84B0
+uid Sendmail Signing Key/2011 <sendmail@Sendmail.ORG>
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.9 (OpenBSD)
+
+mQENBE0ios4BCAC0mjr+Fljl/LRvhI3sI29bM146dWJFr+oJVTHuafDuKQS5ICeU
+89LewVL6Pjp8RureijfbqZC51Z2v5v6GxAizr/LlD9FohjQXiAaA1vgPChBdzvLg
+4TzEVnQOGFuDUnuucQH82I7ysQkK7z1GpFkofKHHgwmcfFpOiRLoUR7YVP7yDpfv
+Zx3EPvRoFtR22kWlhms49J7zgRpXUCH9ggrtcl1QCXkPOlZ+VspUPrZaZEZy8RTA
+3W5l0yhnGVgnJHBfOo2svFurukQ7LAU4U6yCG5AFogcD3sgEvuFAkmWBJZ2rnOBn
+yCL658zfAJlmrni8kLQp6yBuEsUrT6jdRgRBABEBAAG0MVNlbmRtYWlsIFNpZ25p
+bmcgS2V5LzIwMTEgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAk0i
+os4CGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRA5pMd9qXiEsHIXB/0S
+PFGPpoJzQqcEUHZ8w21mJOhoB6eO3GYRXBBLODQbu3x5qMXgTXT2fZgsSO5zkKBD
+QCm4lMns+cJCds1+ggAZLywNM1SUvctXJYIaHnSLEnEbxIgRMM+HdULlJn3xgT6w
+HUVZhzjamXOLospz5BfIXx9NynvjxvjcZ/NI8Cas1WFPvP+89fT+VCzLw0eC1bAo
+puv2CA384i7pqeCvw13taksA0QnpHeN9c2xjWA6LTbLBrDLoTkfxvas0H9WzgNTF
+DpzSuIHyDFonrkSvdgyOCIUYWJ0qkzDYnJzaOd7ku+4YjcF1bw5FhbvXAvcBY8OA
+Ilr9WaR2TGj7//OylOjNiQEcBBABAgAGBQJNIqNLAAoJEGBN+/KFQQq+gDEH/i7x
+aOd7L+QV5rIYyujJdirVoO/9s1+YJkKmFAKltUPcj8vOulQrxjK1E4Wul1qzMclr
+TpZnIb9lyoqIKlGFwx345iHFhDHdWeGFxMxeQBopyOmAZcfMIX2C22+EYGNZNUsO
+xVxpNV0CzKTdbfPHmBFSbA4lWnkyFxZsTR0GmGXRluwc1kT3i98QJbqNudKzUSU4
+f0+3Uda3xrnLtmChSEc57PRSDV4jHdILxORcuHh3xi50y0J3JJ2Yj0utNZ/W2KWX
+guO0WSaNxv7lcKv5ilTWA5WWRt42SZfHlTiBJVpWydRBTZQGJLR6GTWpMoMs5jwP
+9BGlbcR9J5+wmOFT9BmInAQQAQIABgUCTSKjbwAKCRASiW6bp38kKRGJBAC+VwW2
+/kXhV70FPyny4RErQDtyovkyS4rqFLdTNWNu80xbgEZJZY9ZcxT8YLjePsPmDZ0R
+d4omumo5M35/gAastE5UMC4JCFM4v/iUUZwm5LRQNn0UtSKsSdHf32OqJx0FBr5k
+GAe9LAd6gIqkPMw4AaK5H+C3H9VbR4sWHr3AEYicBBABAgAGBQJNIqN3AAoJENiq
+8Mr2swcpK94D/A30eBH+qNleOIlwocxV+Fu7g6rvIPdULeYSNLhi/cuXUzo0HREs
+FowErSD9gSabBkHbAUUhz8gBIXBATUKDgPfoqUqzYZmWRz15jgbKv2vVF36v6uuj
+C/xgVZJsgw5uaZkJM5TI7FCEIs8EfjtPGD3AG1zBYw1+cmls6x+sq6tsiJwEEAEC
+AAYFAk0io40ACgkQl0MBGHCTuEEeRwP/eaawZ80/BoQLdlgz6nNsIhomtFZSPhMS
+/AFMo+cd4G777R1VJijNiD2ou3/2QbcPfu8OPENFYMLAOcYxYTzCL7XgSWkMxAmF
+l2S1/xNUIteUwReoWpp/TZfCaTyro1VrX5pbTf3EYRlkF1qStBwmFfwSIZazhabi
+XjlG/rDXL4WInAQQAQIABgUCTSKjlwAKCRAee7PIr5WWJfQsBACcJNvwXwHZVaf3
++7f2wvqk1HxQk/3x2A/kMBSl1KuWFHV/WGu7Abj8hrjdrBffeCo27TpOhNt5946X
+dwBLl4LYNL2Ogi8lH4nR1DsLTcJKICzxveFN1pRafd7+raVqsg/pIVQnagjxbuTa
+6ClKEqGnF23kfnjMmlkQgQqupXh6kYicBBABAgAGBQJNIqOfAAoJEHCgJE0e+ZJR
+RKYD/17M7wr4tyR+cO1vEJWftFbVCuyKnlUGH4yqjvZhFI0G3NhGnHcjXtl5Tntu
+6gUOzObitN1vL/n0BYOPX4ppQ52Ocv6I87geOXC9EDREy5fJU8kX9lGkDRwWJEcg
+i88ap0L/8Z3ihtr73hKZp3V6zfBIKdR/RfxxjV3xe5AevuooiJwEEAECAAYFAk0i
+o6YACgkQyNXtKZX2F3G35wQApLZxcOkchrNplG4YJMucVcPFyNzeUFL6yhV6PMIQ
+Vz8/ktBYF3LK2QQBxIFBEINF8EslKZ7LSfiFTSvsAxb8OiXGV23qHnglfN2zLFrA
+CR9wvZ7jtDHHFfhHoDN8d9PA2LQR7M9qJzf1ltTaSETm9bSEZ/wC+VHvw+EVQU2S
+OlSInAQQAQIABgUCTSKjrgAKCRAhg+GxOW8HiYOzBACR7nqyHOXspyNy0k2iKkEN
+yAaorX32AecPpwyee7G2+QLxbK8jGGcmh5NR/GUx3ZbdKroyMZHK6OrQi42NwC7Q
+n9xnzzgUgSdKRwnsA1IyP7DpiBSXMdk0kCc6UJy2L9fanHbamAe0oSZAACt9ePYD
+jjq4Jmf25ObWv16Hyv83N4icBBABAgAGBQJNIqPIAAoJEIlpYrhnjAoDa9sD/inn
+1dFkBlDPlPtGwHbw3+qCk8y6h3HpZubae7FxdE1pzsh/G00pB7Wy5K/EHL3MKlul
+TxtetwQhSrYBmsPD5t3BhDKIyU2MQuec8dbJw/O1/7xGYmG1O4gGwq9vM4C2g+wz
+atMl2pQnmi9DhhxFTwxhTgeorQ7nXrTclbuaqyLSiJwEEAECAAYFAk0io9EACgkQ
+OCLbR8w3Ty1JCgQAjkZe0O9GZko22lkc7/3eql8zKwBx3Fpugt1NZ9nyOxeS2WpO
+FfuiAiruA+p1L7b/dC60BUu+z6pgGIs05vIvPzzqjxnPBhqeYwWeW3ABa4JMVDi1
+RkR4TK6PsEj6IE7ZatzqiPST/GNRrjvpqtNyLsEbybPdY13hZSmxb780d1mInAQQ
+AQIABgUCTSKj2gAKCRCcHL3i41xWNXseA/93476LuPukf9rKz9hvf88HrK5O0YPc
+jG/CU2nFLhRbo5gkGFyf7540pODGBaCHyqwT46etzVY+WtZ1fETN0ALIJwoXkbwM
+QE637pwnCLUO6ZTixa6CwceWXXAIc5/hiuQn0uKL8x4kHUcMUZqggYvqrjG1ZEDG
+ZCVuTes1yhalDYicBBABAgAGBQJNIqPnAAoJEG9Sk9ijm6ZVpFYD/1OyjV5+9N/2
+rGbKcfaDXqTM0cvBjs1vBvFJfmDCy3fcOv590SboiCwY6dt5Sd6eRruY4FaTnosI
+V4MZZnvMq1W3KfbT6fvcli/hgTKwYfJM7Mj+Tdp3uOGXN1u+cvKEfY3YHwDb4NAc
+G3jPSslu1nrZq84bsokhnE+en8du7mKPiJwEEAECAAYFAk0io+8ACgkQ71iWZNQy
+4Z1jiQP8CdqzrpIpNuKOs1nVcMsX+T1ZdiNbqbPYbjhQx7isUoaarDk/tQZZGxDE
+dEXayRuNobRzQXltAKOhBrXlN2yFP9d9BR1y8B3dVBO9vsThuQ1BtMrtLrAL5In9
+4RyAvpuKcOhWnf9kJLis2MGghhIllJMuXOFeyujE3A4HSHFqGDWInAQQAQIABgUC
+TSKj+gAKCRDBnB0lEtNGHaOHA/4+zClhAJappAYqATHLCs8mgzYa0/9RvI+e6iV8
+OD8/BOJl4DnHya0ijX7Kt78VJymcmdXge1ypBnq4D2b/vTo18asDfzysPhAmPoCK
+FTlerV9xV/TW/QBZ7EkPW3BwOQW7LYnFd/NnoiX4z+KWh9FwOVWlXPz8xKgBgX3V
+yoz3l4icBBABAgAGBQJNIqQhAAoJEMApykAW9MzppmsD/1HonMTzk4X9qvhvaLTU
+/OKvOzxIdX6b/62DA0WZxN3Duyh2S8OLZzryI9SASesk5vgb2uSMC3dVCwOcfsiz
+QWqStOLG5eyYJh0/iiRZ2K4YM/FrFBo3+AmQ2IeL3qRftBWGyIf11l1ZFS3Uzp8t
+uzIxUFcQU2bJpy7GjHcq989qiJwEEAECAAYFAk0ipIwACgkQvdqP1j/qff3gwwP/
+WTAZ3r8UYbMoIN+ES8A9xLvUZRh/aT7TtiFCLxmJXIk3e+XKHw57DO3WUgZEo99d
+PYNm/Q3tTqT+fj1rIDH9VdxhiSVw2lq/7qoIoYFb1fyCtuMQ+27jF/AFqbkDQJYx
+gcnalClseYEsA9+GYKYfY0UAQePuDuWBMSPMkM+m+e+InAQQAQIABgUCTSKkqgAK
+CRB8S2dtoA4VY+t1A/922nF4Apuc162UVBiP+v67PeXLgekdkjqlDACxqqgWWerW
+6e41VaznDZjIGx76pQSbguCq7XbQXkiqO3E7bHcbjC8OEZ1Glju13GZG3heaoc23
+4n5pNctLmBWSdrp/4RCaf1BAgZ0UAYPO9fR7ZJyenp3vID8vwKTufoy0nR8/MIic
+BBABAgAGBQJNIqS6AAoJENbgof5PvirdRDID/39vOWdqbvu17vX2n3GBI4RYseA2
+1pmvDqvzQcLLDJAXr1auTY7uiotYlXA8qPd4KTy0hCcj2r+7lZMhY1mCumG/0Sp+
+CahRkvUk/rVgWLeK0WGEsCV4IcayKc6ARJVKW+JHUNc1eAScMDAlMOyg0cNtQeDA
+huCt6hxL1YGTPpPSiJwEEAECAAYFAk0on/MACgkQzx61AyIyegHYdAP/c4bKqid9
+lK7ciLbuo7RD0ZngCy+mE+xI4EQV+5LEhFVrqT+fMzSlHKLZGbPPJ2yP1ksBJITw
+cYh7wGN7Dc1xA5bnB0CtjUWYqGRcQoifbgetdee2AfRs0+RvnEo5FMJIBlJOPc2X
+o5eDTxmoSrt7cxnh7PEZnbxZi1gp/wJ+E+iIRgQQEQIABgUCTTHB2wAKCRAJp6JK
+0eWCBxuyAJkBu7Qu46EFKyVyC8eUFwLJkghR2gCdHQUS7eF9pXHFr6aN3J2VrGFe
+mFiIRgQQEQIABgUCTTUNYgAKCRDCeBwaRrHv4ROhAJ99EeU9KWWDnd2RjCN7uex5
+S6u3rQCeLUshZhe/NCehUnaaC8LJ1kwj/5yIRgQQEQIABgUCTTWM/AAKCRCWnNph
+S7Y2S8bjAJ9bOB/fFGyPgTuwQIEakXITRILLgwCgvrjaVZagTRwQW2BM1uH+vk9j
+yDuIRgQQEQIABgUCTUMwnwAKCRCiu/skDPlW91hCAJ0eizb5bxByUpXY0qsbcupw
+H3kiBwCg1Yc7cur+Yz2dhPuRreaPk4QeVrWIRgQQEQIABgUCTUMxEgAKCRD7VAFa
++haI7RKlAKCGogTWoJdDbetwBdRpRJ72d9qUgACfUehPWCmq2A/mIaMFlPI+F3k3
+Lk25AQ0ETSKizgEIALV2tE8RtEgC1fjw4zHrZVUChXKm1uVEkRkeoaASrAI4IiK+
+qtgbNEzhLEQavQaIZECQLCaQb5qzvKLCEvuo5tClU+2P4/YjnikdBDFXUwHznSmd
+N27SsX6gNoeX/ZwaEJUNpMd/v+/Gu9QmMBIFUhtXXZyeBBpCyi6CP5jw66KjjH1g
+OXCQvSYJVlutIGtzvHolvQ2I+h6Ztwy9d7pFIVlr7EymFI+x0oI/i4UwF3FZPVWO
+C1OZD7suXSre+eLzYXGBYyHkvGldhA/hvKLs3Z6udcirTMtX27xL6C5WKaCsuQPu
+ZiYWxJ2A9UgP6zTuBzmAJ4XXKo7QgamAbxHT0sMAEQEAAYkBHwQYAQIACQUCTSKi
+zgIbDAAKCRA5pMd9qXiEsI/1CACv83SSDOBt6HZcg7ucOZJ7Wkb5EJG6Mseh/K33
+CFDwWgYa20YeUUzPWD3ZRKY4irNL3ipnB3tJUF4yaasTPpI0owpcdCkOhpDw9S7M
+AOnUACuv3JIZ17892ZLjXalNGMY/23qPxbQIaAidNh02ouZ6Md+NUvgh22+oDa+v
+kxTkXmKiBGFpqY2myzzPvg84TMTpRBU372CZpmjjHK8duObUr9I0iIbVzshdnWuR
+MKGu+n4hSU3SIYl6xLsdBGpiDOQJ3C1YHIduhDrQlyAjDVEgzgw20DUxUzKIpn2b
+KH6d5q94eHcPD56A4cYD275DIZzAYqRpwzmB9O845HrHAPmQ
+=pDAG
+-----END PGP PUBLIC KEY BLOCK-----
+
+Type Bits KeyID Created Expires Algorithm Use
+pub 2048 85410ABE 2010-02-19 ------- RSA Sign
+fingerprint: B175 9644 5303 5DCE DD7B E919 604D FBF2 8541 0ABE
+uid Sendmail Signing Key/2010 <sendmail@Sendmail.ORG>
+
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.9 (OpenBSD)
+
+mQENBEt+6goBCAC95sVPzf4AWFmUklHO9yGBq6K135Tlt9JaX3frj6PCBjkLNn97
+J5WDAoLqE9wB7WgiBzs2lu8OPZZcf+6syd97SojEze5bj2uv84DBv2juupbHEBys
+9OH52QqYWG+1yuwAHY2gjKLYcvNgaOKLp5hoHZ2rakRc4a2ypLTPazsGFBO9/qBA
++v6qkP70/lOZeN9HX/yipbygAE+Y9elptW6ohvdGW8jbtllFqYFebB+lIaclkQnK
+pldnQfktnJDB+XmLOc5m/1BsultlI5IH9HXCeskXxLcxXq+ldg+it1DgzxmHpHTK
+dIhgOKY3MvTgxkcXiwIGcHBMnov6ESL1KaU5ABEBAAG0MVNlbmRtYWlsIFNpZ25p
+bmcgS2V5LzIwMTAgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAkt+
+6goCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBgTfvyhUEKvi4qB/0T
+Em3whttGoUrxdZd1gYKI9SY1/4dHOhD+xJQQgIoQSRpOEA7xQ6TTAYvG8sYdsF5K
+9/lWjOTEy5w6wBcu4e9F7aO/TUzue/7p0c2UKJTrEOw4HsRrENfQHx1TAXudQHHn
+5+PgBCQCSr36ktuSXnlOo2bGbZ4FUwNCu0ztmoEEca8ZgY6ciEXbva1kRj6Eumul
+MkqtVYEAtjzdIga6M3xYuJlus+qi/uEj5kivtf2LUDxXpGE6XFrArum0za/URiW8
+wxt5zBbTbne3tDr2yg6GC046+f1Wr02xWYapGyNRU6yrPciWOu0tpaxJ7CwEIMRq
+6HzbSVdZkqOdSoZ3ufqYiJwEEAECAAYFAkt+6lkACgkQEolum6d/JClfWAP/VBVb
+VYBQKV+NQyXl6ULJI91iIpEAR/T3nRoemGVPhbB8a7zRRkz1h4ou6VAMJeS4BxSC
+fm2iOHCYMAOMSQ03VaEM2F13b8PtsGaKjuAwDf2pHARYbOj4DRCY0dUmwPXze3Tp
+7S5ui/fk9t+NhQQa6IZHFkqdnQ+xZ88hhoF5slmInAQQAQIABgUCS37q1AAKCRDv
+WJZk1DLhnTPYA/0VhRNooc2csxwvxBG6HiS8wp2k+kbGbbtlQ4JFg59p4EUnT2Ld
+P9eUzFtj6fRkU/bZcIKgOn37M4GOXEoNvMT6NfmpTKeofg7hwp+pMdHlq4y9Em55
+TSC+rK2g6rAaSxMvDzasBouQqfxirj3nBI65zVHK98Zaj9vrpWCVCBIoZoicBBAB
+AgAGBQJLfurtAAoJEG9Sk9ijm6ZVjcoEAJdB5kzFWHsvf0u/Oe+LWQwowL5SjQ6W
+uhKgTDJ5IqFbDlCT/V33mpLEC9us4wNRT6Bff5agInCKfcUXdJijExkEbDB9ErZc
+WmZqtquxQJN3xH+fIoIorxjWD0RMPmMvwQRgjn/puXwichQP9PafTgd9YsQ3aWAU
+DGvx1U8pkloCiJwEEAECAAYFAkt+6vIACgkQnBy94uNcVjWGswQAhqDOQ8Os3gOo
+UAGm/Oju6t6JG4wxLyl7vlMZ2eQHAX8rJ99Q4kyJB9xR4uaZ42BwbPx3s25N67qb
+6z/ZAMrtqsXuK90+WlwykxG1uq4FOznHU6QT7cyO48Yeoq2PO1kFgQuRESPCRxXV
+8dmDgeoDQ0EDO1Ykm003AKCd0N7+n1CInAQQAQIABgUCS37q9wAKCRA4IttHzDdP
+LXmrA/4r9bzS6YnAHE0MFzByA2uZq0HeyrHI/Q6ELzqeMjuu/CwKdki/8gzz6Zt3
+KkXbqd9mPidsi/nqfUwQlqMHCFSRTyqw3FkGzQ/wk9fk4G+AF+5A//xGFIACHd54
+a/1+k0iVM5GNQkrknltYps0TmW8priU1uzmzAHpsCh0e4xFDIYicBBABAgAGBQJL
+fur9AAoJEIlpYrhnjAoD9mQD/0s7tHTX+Mzt7iwZzsAZEqoxSQS5dUAKK+j6GR5K
+8/cWcdiDJwCABViIn+TT7/GDmTlA4EUKQzIMPDfuagqa1SPxKXgivUnfhmpJVAma
+MUmZeGFQyfTBjp4qZ+Agk15Ulnz7arqmOmeAWSvdsJ/vCm44TCEDO1gIjLzgyOIc
+ktU5iJwEEAECAAYFAkt+6wQACgkQIYPhsTlvB4lH8wQAyqIKclShWxxaXi6YpS/k
+H+susHMVePzBPyEmv93UkSOj2bdMWuhVENPXlBn1UnFt0vKPOL+krF3+zIAjg6N6
+zFlasBUL9p2HqRI35Sq4cn3S3Im4vZIPwWNYgtQY41Hc1Gx2pIxmKtIz+9+sUiTE
+DGrTxnzUAohPaTzUVXPtWOuInAQQAQIABgUCS37rCgAKCRDI1e0plfYXcQXaA/9D
++sQJdEc1orgN/aTVGKkKoNyMmJhtNLECYIsfAYcE9lMGtymkkli0BrvrtNN1Co6P
+qmR+oaZSmeyq0qNVdV8AnoyFI5Dk3Nir82ISOtvzuNzn8NrosSed0nyVmg88amTa
+WoJS7as6s6/lCxuarGwRuHA7vXaxDg92lCYeTw09I4icBBABAgAGBQJLfusSAAoJ
+EHCgJE0e+ZJRWiMD/i65FDmbZo0srV01XwSUb8EF/70RF0uOxrGfunMin93cR8VW
+mNSzcydfH/mKR1Rf4Snsz9hp9NWryZpjVXrPJx6GOBzzwgyUtzAxH6OElv7rlK2Y
+XJ+Xi94djsyB56e6PKHA1uB30g2l5beh0bDUEa9mLfstTidMWGXRdtnVtW5KiJwE
+EAECAAYFAkt+6yAACgkQHnuzyK+VliU0OQQApyvdx0YKiDL7EuLf/QkOk64DRAKf
+7rxZSlN5jHnNJSQeX7cMRBcklbl/GlZH2oyHdDuahrZ62MT/mCneRIH58lf8c91h
+WLFjkpU/j8Md8ahFQDWpCwNSSwz4tqZyhKfeP/w0OaHC4ttAwbjKk6mn0wFpWxpH
+sYFc08L5PoUyaQaInAQQAQIABgUCS37rJAAKCRCXQwEYcJO4QR+cA/9EEv5UJCgt
+0glLmhIzpvGxlEyzhVqhtfDE8CI06lOSGWhYy4VCcOCho8ig+atxU1+/zPaJGIbI
+mvR+kuPZ9kmtd+LtV6fWtp7U6FrAZSXV6paWHc9ZCLJeKSNwmRrcOqaBEjj3MqNA
+pwXO3gCiuylHzgIo05+FxRho91AS/mciI4icBBABAgAGBQJLfusoAAoJENiq8Mr2
+swcppz4EALJ3JQOIPsvgptuPdq8XZuxxuFonjcr8RaLB89a9MDduFBM8zw/Q0qcA
+asltDtQidMwn+VCDQavkrpEM2QbNxFfhbdnw5c97CvovgmTATPaR2XZ7LaeIwE36
+HLL5e5/k0BThiqymD3tjaFbx7uTK2o3ZTyMvbjtqMOdt0eLqFvHRiJwEEAECAAYF
+Akt+6ywACgkQwCnKQBb0zOnn+AP+OdZu4BowBVYzmygmM1O7XyiEMd5TB3MxwkZR
+8+rGW8Xcl4JtLY9iiXzfakTHuP3OrINrhXnMQLAY46kAcUc+VcHvLdMth6btsltE
+Jjc33aZovPRabCeKVCnDKcEPRYclsXgGStXlFMoacI2KUUENZeGCUr0NJb7RnAk5
+Pfuib+mInAQQAQIABgUCS37rVgAKCRDBnB0lEtNGHcMMA/9mYtgCaK/zihws7d4V
+p+uQXKjnfhKZx4XX33BoUFgxC2N5/TB6qd0sBnaUYby/DDGh6W3721dGTw66i9vF
+Wn2IJ6JUj4CpLCCFVb9FxPdjrt/F1eKg8N1SOfVQg0D9Nkl48Y81tIf0xcMa9yuV
+8qssX8baTDhatDGFIZlYPfGpZIicBBABAgAGBQJLg2FTAAoJEM8etQMiMnoByVwD
+/3iim8IBm3ssOFJ58RR9wFPgH7INTiE28vO5yO+f2i0/cEdWwJDwmqOpKhUM7DWy
+LeK7LaZWzViuxh83ZI2KlcJJksdFtohuzyJul/phyaQYDPGlgu7AIthNm49pdDnR
+0AAQl98ccn0iT69Zp3Fi5fRMHVC4ChBsBir5JjJBh0aliJwEEAECAAYFAkuDdtQA
+CgkQvdqP1j/qff0GMwQAqgbWFQsOoEzzwSDo/SEun8gmRRLUH8vWx5Us659x2nQy
+BPtp8w2HpqKsyMn2E4TavKjyzUZPINziPVszXhG+dtCFuOQvRFFZzFQccdhAIB8o
+KJ7y/LRa7MpvIMRFJOURBnJgQ3asUojRcksd+rgMqujFrwyYN5J+LeXwBXS9eMSI
+nAQQAQIABgUCS4N2+gAKCRB8S2dtoA4VY6KoA/91U29DqRR0XRlk+KdRs6Qjo/R0
+lQp7uUtuP55xJkv+UMPVhABbMOR+/sjE8eUJdMpHfaQmdG89M5VZ+Ck2MZrhjveE
+acNH/sIWCDvIFV5gheNZycpp+wH2VO7+i9bWmMVl4JKK0grFRYQMqiqT+tHYfXS3
+MVQH8U4EhwnFuwFrgoicBBABAgAGBQJLg3cQAAoJENbgof5PvirdPboD/jUU/UV7
+7jGtnW9+xrsUUDcHeU8Ha/VKXfKts4Z0KifWYnjUOH5jR/OqYzHy7vAOyGpyrziN
+eJHLM/I8AuTtmsCY3IpfhaeRg4ZkJYRqx5QkhfUesOpPfKVPYtoF53Uw04iu0dtv
+2bFftaX0tX/hKhWmzobllBGM9b5E4G+kHCRZiEYEEBECAAYFAkuEoagACgkQCaei
+StHlggfktQCgjyKOB4tlm9WnufcJaYIbchyZVSQAn3thzs5akheaVsVwBHSmpJyk
+PDRbiJwEEAECAAYFAkuFS4UACgkQXx7Ib4gMnlUZEQP9HoutmYz6pAB8XEADTKrR
+wTWGqu/S4V6zhSJbIYSDIFAY+WeKCTUdVO8eFfrPIrS459z8yQ3PgFKL3QMp1VgX
+jMGPcvfHOjWh1jSw5W1aLcJX428T0oybgLZLvPT7QXpIwKcY8TtS/jjVTaepIqIG
+9tmQupstoaw/h9b1vHY7R7uIRgQQEQIABgUCS4Uc9QAKCRCWnNphS7Y2SyT5AKCE
+1AR60B2GDZ75U2kaNe/SyOQJ3ACfVtndQ22edDOB1INak6SyfYv9ZuSIRgQQEQIA
+BgUCS4TumQAKCRCiu/skDPlW9we5AKC6dNVZjpg/yDQiepI2E0XZ222vzACeJ7Ds
+41t2z3BT4qGJyZrpGK8G3kKIRgQQEQIABgUCS4TuuQAKCRD7VAFa+haI7WniAKCY
+mNr9FG/180EcUY/tgaHNuUDXtwCfX0DYjxL9ExvQ7wB2uXB2M7AwGxSIRgQQEQIA
+BgUCS4Ts4wAKCRCgT/sbfcrp09HnAJ0dELKCp7WoOoAPVBHez/sfHAmgAwCdG64t
+bjYwj5CamCOhDvuNjfbUpBSIRgQQEQIABgUCS4W+PgAKCRDCeBwaRrHv4S4EAKCV
+LKV3q7PiVV5rb9T+s5uyrETBsgCfUVhchd+Ha5nbduvnF25C0Eswouq5AQ0ES37q
+CgEIAK8GnjvPPqWqcNCmLyuscuTKPjqTyaA3xVVYNX+8hMD1iK4VAGf3QfKExVnN
+QLvLpnknnKK/caaXFME9t4L0BTjCJRYJiDpoWImwu5fTRIyfIIy4vv5vPErqqKen
+7dII6gptC2i538ntj7k8qkhewKJuTOVpE1eLHe3RxuP8rsv1AsvjJ+6WGZlFYINZ
++d0pxSOhdPN9WoTCl9JfkTQrnoVPClzG/euOkF5fUThL90gt31iN+RjB5DeWTPB/
+jDrq6t5spA8hTKvQ+UB65chI6TzrCr+k8f5D9AR0Fkf9KPFOL7+U9o6Ap9yur5sn
+njDP4fFVhazVyljUwwPvJ5jjS1cAEQEAAYkBHwQYAQIACQUCS37qCgIbDAAKCRBg
+TfvyhUEKvpWAB/0YnkJx6/5rIwDh1u5iFdboUCEsX92n9eOilPWw1NWbq/Gdx7+Z
+xoRjrGl8e8SxOZJbfyehgPX8NxOrkBfcAOOXmOvXSO1i3HSo2gaQxVh1urXojzID
+raUMcltcNeQagdtDfPhYnS25vJnj+H29Dal2FwLJb9wp8QH1DdhUBoqeRQH34REu
+fWu0LjF87JjUELhZe0Op4B8HnQV9oGo7W4IYw/3Ek6c5As+WIWSaz0NmHP2Xw+kI
+kpC4BVIwG0l2mChAT8Ds+rDLGYA2dxYK39mFSApem2KiXFhAanDBb5XgilmeDepk
+A4NAZlDwxoivB/5PTy67pX+AC1JgvPPafUMu
+=6Xeh
+-----END PGP PUBLIC KEY BLOCK-----
+
+Type Bits KeyID Created Expires Algorithm Use
pub 1024 0xA77F2429 2009-01-01 ---------- RSA Sign & Encrypt
f16 Fingerprint16 = 33 3A 62 61 2C F3 21 AA 4E 87 47 F2 2F 2C 40 4D
uid Sendmail Signing Key/2009 <sendmail@Sendmail.ORG>
@@ -1865,4 +2082,4 @@ DnF3FZZEzV7oqPwC2jzv/1dD6GFhtgy0cnyoPGUJCyc=
=nES8
-----END PGP PUBLIC KEY BLOCK-----
-$Revision: 8.29 $, Last updated $Date: 2009/01/06 05:59:03 $
+$Revision: 8.36 $, Last updated $Date: 2011/01/28 21:17:54 $
diff --git a/contrib/sendmail/RELEASE_NOTES b/contrib/sendmail/RELEASE_NOTES
index 4e1e8f3..f96f8cf 100644
--- a/contrib/sendmail/RELEASE_NOTES
+++ b/contrib/sendmail/RELEASE_NOTES
@@ -1,11 +1,75 @@
SENDMAIL RELEASE NOTES
- $Id: RELEASE_NOTES,v 8.1963 2009/12/23 04:43:46 ca Exp $
+ $Id: RELEASE_NOTES,v 8.1991 2011/05/15 04:28:16 ca Exp $
This listing shows the version of the sendmail binary, the version
of the sendmail configuration files, the date of release, and a
summary of the changes in that release.
+8.14.5/8.14.5 2011/05/17
+ Do not cache SMTP extensions across connections as the cache
+ is based on hostname which may not be a unique identifier
+ for a server, i.e., different machines may have the
+ same hostname but provide different SMTP extensions.
+ Problem noted by Jim Hermann.
+ Avoid an out-of-bounds access in case a resolver reply for a DNS
+ map lookup returns a size larger than 1K. Based on a
+ patch from Dr. Werner Fink of SuSE.
+ If a job is aborted using the interrupt signal (e.g., control-C from
+ the keyboard), perform minimal cleanup to avoid invoking
+ functions that are not signal-safe. Note: in previous
+ versions the mail might have been queued up already
+ and would be delivered subsequently, now an interrupt
+ will always remove the queue files and thus prevent
+ delivery.
+ Per RFC 6176, when operating as a TLS client, do not offer SSLv2.
+ Since TLS session resumption is never used as a client, disable
+ use of RFC 4507-style session tickets.
+ Work around gcc4 versions which reverse 25 years of history and
+ no longer align char buffers on the stack, breaking calls
+ to resolver functions on strict alignment platforms.
+ Found by Stuart Henderson of OpenBSD.
+ Read at most two AUTH lines from a server greeting (up to two
+ lines are read because servers may use "AUTH mechs" and
+ "AUTH=mechs"). Otherwise a malicious server may exhaust
+ the memory of the client. Bug report by Nils of MWR
+ InfoSecurity.
+ Avoid triggering an assertion in the OpenLDAP code when the
+ connection to an LDAP server is lost while making a query.
+ Problem noted and patch provided by Andy Fiddaman.
+ If ConnectOnlyTo is set and sendmail is compiled with NETINET6
+ it would try to use an IPv6 address if an IPv4 (or
+ unparseable) address is specified.
+ If SASLv2 is used, make sure that the macro {auth_authen} is
+ stored in xtext format to avoid problems with parsing
+ it. Problem noted by Christophe Wolfhugel.
+ CONFIG: FEATURE(`ldap_routing') in 8.14.4 tried to add a missing
+ -T<TMPF> that is required, but failed for some cases
+ that did not use LDAP. This change has been undone
+ until a better solution can be implemented. Problem
+ found by Andy Fiddaman.
+ CONFIG: Add cf/ostype/solaris11.m4 for Solaris11 support.
+ Contributed by Casper Dik of Oracle.
+ CONTRIB: qtool.pl: Deal with H entries that do not have a
+ letter between the question marks. Patch from
+ Stefan Christensen.
+ DOC: Use a better description for the -i option in sendmail.
+ Patch from Mitchell Berger.
+ Portability:
+ Add support for Darwin 10.x (Mac OS X 10.6).
+ Enable HAVE_NANOSLEEP for FreeBSD 3 and later. Patch
+ from John Marshall.
+ Enable HAVE_NANOSLEEP for OpenBSD 4.3 and later.
+ Use new directory "/system/volatile" for PidFile on
+ Solaris 11. Patch from Casper Dik of Oracle.
+ Fix compilation on Solaris 11 (and maybe some other
+ OSs) when using OpenSSL 1.0. Based on patch from
+ Jan Pechanec of Oracle.
+ Set SOCKADDR_LEN_T and SOCKOPT_LEN_T to socklen_t
+ for Solaris 11. Patch from Roger Faulkner of Oracle.
+ New Files:
+ cf/ostype/solaris11.m4
+
8.14.4/8.14.4 2009/12/30
SECURITY: Handle bogus certificates containing NUL characters
in CNs by placing a string indicating a bad certificate
diff --git a/contrib/sendmail/cf/cf/submit.cf b/contrib/sendmail/cf/cf/submit.cf
index 5286c68..6cc386a 100644
--- a/contrib/sendmail/cf/cf/submit.cf
+++ b/contrib/sendmail/cf/cf/submit.cf
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2004, 2009, 2010 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -16,8 +16,8 @@
#####
##### SENDMAIL CONFIGURATION FILE
#####
-##### built by ca@wiz.smi.sendmail.com on Tue Dec 22 20:49:09 PST 2009
-##### in /extra/home/ca/sm-8.14.4/OpenSource/sendmail-8.14.4/cf/cf
+##### built by ca@wiz.smi.sendmail.com on Sat May 14 21:31:14 PDT 2011
+##### in /extra/home/ca/sm-8.14.5/OpenSource/sendmail-8.14.5/cf/cf
##### using ../ as configuration include directory
#####
######################################################################
@@ -27,7 +27,7 @@
######################################################################
######################################################################
-##### $Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $ #####
+##### $Id: cfhead.m4,v 8.121 2010/01/07 18:20:19 ca Exp $ #####
##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ #####
##### $Id: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $ #####
##### $Id: msp.m4,v 1.33 2004/02/09 22:32:38 ca Exp $ #####
@@ -35,7 +35,7 @@
##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ #####
-##### $Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $ #####
+##### $Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $ #####
# level 10 config file format
V10/Berkeley
@@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1]
# Configuration version number
-DZ8.14.4/Submit
+DZ8.14.5/Submit
###############
@@ -992,7 +992,6 @@ R< $* > $* $: $2
-
######################################################################
### check_mail -- check SMTP `MAIL FROM:' command argument
######################################################################
diff --git a/contrib/sendmail/cf/feature/ldap_routing.m4 b/contrib/sendmail/cf/feature/ldap_routing.m4
index 227060c..e9b4880 100644
--- a/contrib/sendmail/cf/feature/ldap_routing.m4
+++ b/contrib/sendmail/cf/feature/ldap_routing.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1999-2002, 2004, 2007, 2009 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1999-2002, 2004, 2007 Sendmail, Inc. and its suppliers.
# All rights reserved.
#
# By using this file, you agree to the terms and conditions set
@@ -10,7 +10,7 @@ divert(-1)
#
divert(0)
-VERSIONID(`$Id: ldap_routing.m4,v 8.17 2009/06/26 21:11:08 ca Exp $')
+VERSIONID(`$Id: ldap_routing.m4,v 8.18 2010/01/05 00:57:27 ca Exp $')
divert(-1)
# Check first two arguments. If they aren't set, may need to warn in proto.m4
@@ -35,40 +35,12 @@ ifelse(len(X`'_ARG6_), `1', `define(`_LDAP_ROUTE_MAPTEMP_', `_QUEUE_')',
_ARG6_, `tempfail', `define(`_LDAP_ROUTE_MAPTEMP_', `_TEMPFAIL_')',
_ARG6_, `queue', `define(`_LDAP_ROUTE_MAPTEMP_', `_QUEUE_')')
-define(`_ATMPF_', `<TMPF>')dnl
-dnl check whether arg contains -T`'_ATMPF_
-dnl unless it is a sequence map or just LDAP
-dnl note: this does not work if ARG1 begins with space(s), however, as
-dnl we issue a warning, hopefully the user will fix it...
-ifelse(defn(`_ARG1_'), `', `',
- defn(`_ARG1_'), `LDAP', `',
- `ifelse(index(_ARG1_, `sequence '), `0', `',
- `ifelse(index(_ARG1_, _ATMPF_), `-1',
- `errprint(`*** WARNING: missing -T'_ATMPF_` in first argument of FEATURE(`ldap_routing')
-')
- define(`_ABP_', index(_ARG1_, ` '))
- define(`_NARG1_', `substr(_ARG1_, 0, _ABP_) -T'_ATMPF_` substr(_ARG1_, _ABP_)')
- ')
- ')
- ')
-ifelse(defn(`_ARG2_'), `', `',
- defn(`_ARG2_'), `LDAP', `',
- `ifelse(index(_ARG2_, `sequence '), `0', `',
- `ifelse(index(_ARG2_, _ATMPF_), `-1',
- `errprint(`*** WARNING: missing -T'_ATMPF_` in second argument of FEATURE(`ldap_routing')
-')
- define(`_ABP_', index(_ARG2_, ` '))
- define(`_NARG2_', `substr(_ARG2_, 0, _ABP_) -T'_ATMPF_` substr(_ARG2_, _ABP_)')
- ')
- ')
- ')
-
LOCAL_CONFIG
# LDAP routing maps
Kldapmh ifelse(len(X`'_ARG1_), `1',
`ldap -1 -T<TMPF> -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
- defn(`_NARG1_'), `', `_ARG1_', `_NARG1_')
+ `_ARG1_')
Kldapmra ifelse(len(X`'_ARG2_), `1',
`ldap -1 -T<TMPF> -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))',
- defn(`_NARG2_'), `', `_ARG2_', `_NARG2_')
+ `_ARG2_')
diff --git a/contrib/sendmail/cf/m4/cfhead.m4 b/contrib/sendmail/cf/m4/cfhead.m4
index c2d0df7..fbb9476 100644
--- a/contrib/sendmail/cf/m4/cfhead.m4
+++ b/contrib/sendmail/cf/m4/cfhead.m4
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2004, 2009, 2010 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -189,6 +189,7 @@ SLocal_tls_server')
define(`LOCAL_RULE_3', `divert(2)')
define(`LOCAL_CONFIG', `divert(6)')
define(`MAILER_DEFINITIONS', `divert(7)')
+define(`LOCAL_DNSBL', `divert(8)')
define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)')
define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*) DOL(1) < @ $2 > DOL(2)')
define(`CONCAT', `$1$2$3$4$5$6$7')
@@ -308,4 +309,4 @@ define(`confMILTER_MACROS_EOM', `{msg_id}')
divert(0)dnl
-VERSIONID(`$Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $')
+VERSIONID(`$Id: cfhead.m4,v 8.121 2010/01/07 18:20:19 ca Exp $')
diff --git a/contrib/sendmail/cf/m4/proto.m4 b/contrib/sendmail/cf/m4/proto.m4
index c021581..8bfd9de 100644
--- a/contrib/sendmail/cf/m4/proto.m4
+++ b/contrib/sendmail/cf/m4/proto.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -13,10 +13,10 @@ divert(-1)
#
divert(0)
-VERSIONID(`$Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $')
+VERSIONID(`$Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $')
# level CF_LEVEL config file format
-V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')
+V`'CF_LEVEL`'ifdef(`NO_VENDOR',`', `/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')')
divert(-1)
dnl if MAILER(`local') not defined: do it ourself; be nice
@@ -1795,7 +1795,7 @@ ifdef(`_CONN_CONTROL_',`dnl
ifdef(`_CONN_CONTROL_IMMEDIATE_',`',`dnl
dnl workspace: ignored...
R$* $: $>"ConnControl" dummy')', `dnl')
-undivert(8)
+undivert(8)dnl LOCAL_DNSBL
ifdef(`_REQUIRE_RDNS_', `dnl
R$* $: $&{client_addr} $| $&{client_resolve}
R$=R $* $@ RELAY We relay for these
diff --git a/contrib/sendmail/cf/m4/version.m4 b/contrib/sendmail/cf/m4/version.m4
index 5ad5ffb..566c3a5 100644
--- a/contrib/sendmail/cf/m4/version.m4
+++ b/contrib/sendmail/cf/m4/version.m4
@@ -1,6 +1,6 @@
divert(-1)
#
-# Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
+# Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers.
# All rights reserved.
# Copyright (c) 1983 Eric P. Allman. All rights reserved.
# Copyright (c) 1988, 1993
@@ -11,8 +11,8 @@ divert(-1)
# the sendmail distribution.
#
#
-VERSIONID(`$Id: version.m4,v 8.205 2009/12/23 04:43:09 ca Exp $')
+VERSIONID(`$Id: version.m4,v 8.214 2011/04/26 23:02:36 ca Exp $')
#
divert(0)
# Configuration version number
-DZ8.14.4`'ifdef(`confCF_VERSION', `/confCF_VERSION')
+DZ8.14.5`'ifdef(`confCF_VERSION', `/confCF_VERSION')
diff --git a/contrib/sendmail/cf/ostype/solaris11.m4 b/contrib/sendmail/cf/ostype/solaris11.m4
new file mode 100644
index 0000000..a48b077
--- /dev/null
+++ b/contrib/sendmail/cf/ostype/solaris11.m4
@@ -0,0 +1,22 @@
+divert(-1)
+#
+# Copyright (c) 2011 Sendmail, Inc. and its suppliers.
+# All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+# This ostype file is suitable for use on Solaris 11 and later systems,
+# make use of /system/volatile, introduced in Solaris 11.
+#
+
+divert(0)
+VERSIONID(`$Id: solaris11.m4,v 1.1 2011/01/24 21:22:08 ca Exp $')
+divert(-1)
+
+ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
+define(`confEBINDIR', `/usr/lib')dnl
+define(`confPID_FILE', `/system/volatile/sendmail.pid')dnl
+define(`_NETINET6_')dnl
+FEATURE(`local_lmtp')dnl
diff --git a/contrib/sendmail/contrib/qtool.pl b/contrib/sendmail/contrib/qtool.pl
index f2d33c2..c2a67f8 100755
--- a/contrib/sendmail/contrib/qtool.pl
+++ b/contrib/sendmail/contrib/qtool.pl
@@ -3,7 +3,7 @@
## Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
## All rights reserved.
##
-## $Id: qtool.pl,v 8.30 2009/03/04 16:57:30 ca Exp $
+## $Id: qtool.pl,v 8.31 2010/11/10 19:11:54 ca Exp $
##
use strict;
use File::Basename;
@@ -607,7 +607,7 @@ sub parse_header
$first_char = substr($line, 0, 1);
if ($first_char eq "?")
{
- $line = substr($line, 3);
+ $line = (split(/\?/, $line,3))[2];
}
elsif ($first_char eq "\t")
{
diff --git a/contrib/sendmail/doc/op/op.me b/contrib/sendmail/doc/op/op.me
index be07810..1e7d370 100644
--- a/contrib/sendmail/doc/op/op.me
+++ b/contrib/sendmail/doc/op/op.me
@@ -9,7 +9,7 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: op.me,v 8.745 2009/12/13 04:12:46 ca Exp $
+.\" $Id: op.me,v 8.747 2010/05/08 04:18:27 ca Exp $
.\"
.\" eqn op.me | pic | troff -me
.\"
@@ -90,7 +90,7 @@ Sendmail, Inc.
.de Ve
Version \\$2
..
-.Ve $Revision: 8.745 $
+.Ve $Revision: 8.747 $
.rm Ve
.sp
For Sendmail Version 8.14
@@ -1095,6 +1095,9 @@ The number of envelope recipients for this message
(after aliasing and forwarding).
.ip msgid
The message id of the message (from the header).
+.ip bodytype
+The message body type (7BIT or 8BITMIME),
+as determined from the envelope.
.ip proto
The protocol used to receive this message (e.g., ESMTP or UUCP)
.ip daemon
@@ -5154,7 +5157,8 @@ FAIL cert presented but could not be verified,
e.g., the signing CA is missing.
NONE STARTTLS has not been performed.
TEMP temporary error occurred.
-PROTOCOL some protocol error occurred.
+PROTOCOL some protocol error occurred
+ at the ESMTP level (not TLS).
SOFTWARE STARTTLS handshake failed,
which is a fatal error for this session,
the e-mail will be queued.
@@ -11463,7 +11467,7 @@ replace it with a blank sheet for double-sided output.
.\".sz 10
.\"Eric Allman
.\".sp
-.\"Version $Revision: 8.745 $
+.\"Version $Revision: 8.747 $
.\".ce 0
.bp 3
.ce
diff --git a/contrib/sendmail/include/sm/conf.h b/contrib/sendmail/include/sm/conf.h
index 5b18754..b47a5f8 100644
--- a/contrib/sendmail/include/sm/conf.h
+++ b/contrib/sendmail/include/sm/conf.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -10,7 +10,7 @@
* the sendmail distribution.
*
*
- * $Id: conf.h,v 1.139 2009/06/16 23:41:32 ca Exp $
+ * $Id: conf.h,v 1.144 2011/05/03 16:24:00 ca Exp $
*/
/*
@@ -381,6 +381,12 @@ typedef int pid_t;
# ifndef __svr4__
# define __svr4__ /* use all System V Release 4 defines below */
# endif /* ! __svr4__ */
+# if SOLARIS >= 21100
+# include <paths.h>
+# endif /* SOLARIS >= 21100 */
+# ifndef _PATH_VARRUN
+# define _PATH_VARRUN "/var/run/"
+# endif /* _PATH_VARRUN */
# define GIDSET_T gid_t
# define USE_SA_SIGACTION 1 /* use sa_sigaction field */
# define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */
@@ -443,7 +449,7 @@ typedef int pid_t;
# endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */
# if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208)
# undef _PATH_SENDMAILPID /* tmpfs /var/run added in 2.8 */
-# define _PATH_SENDMAILPID "/var/run/sendmail.pid"
+# define _PATH_SENDMAILPID _PATH_VARRUN "sendmail.pid"
# ifndef SMRSH_CMDDIR
# define SMRSH_CMDDIR "/var/adm/sm.bin"
# endif /* ! SMRSH_CMDDIR */
@@ -461,6 +467,8 @@ typedef int pid_t;
# if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211)
# define GETLDAPALIASBYNAME_VERSION 2 /* changed in S11 */
# define HAVE_NANOSLEEP 1 /* moved from librt to libc in S11 */
+# define SOCKADDR_LEN_T socklen_t /* arg#3 to accept, getsockname */
+# define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */
# endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */
# ifndef HASGETUSERSHELL
# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */
@@ -1014,6 +1022,9 @@ extern unsigned int sleepX __P((unsigned int seconds));
# if __FreeBSD_version >= 222000 /* 2.2.2-release and later */
# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
# endif /* __FreeBSD_version >= 222000 */
+# if __FreeBSD_version >= 300000 /* 3.0.0-release and later */
+# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */
+# endif /* __FreeBSD_version >= 300000 */
# if __FreeBSD_version >= 330000 /* 3.3.0-release and later */
# ifndef SMRSH_CMDDIR
# define SMRSH_CMDDIR "/usr/libexec/sm.bin"
@@ -1055,6 +1066,9 @@ extern unsigned int sleepX __P((unsigned int seconds));
# if OpenBSD >= 200505
# undef NETISO /* iso.h removed in 3.7 */
# endif /* OpenBSD >= 200505 */
+# if OpenBSD >= 200800
+# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */
+# endif /* OpenBSD >= 200800 */
# endif /* defined(__OpenBSD__) */
# endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */
@@ -2808,7 +2822,7 @@ struct utsname
# if _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255
/*
- ** override Linux wierdness: a FQHN can be 255 chars long
+ ** override Linux weirdness: a FQHN can be 255 chars long
** SUSv3 requires HOST_NAME_MAX ("Maximum length of a host
** name (not including the terminating null) as returned from the
** gethostname() function.") to be at least 255. c.f.:
diff --git a/contrib/sendmail/libmilter/docs/overview.html b/contrib/sendmail/libmilter/docs/overview.html
index 5c6f21c..d6e3bba 100644
--- a/contrib/sendmail/libmilter/docs/overview.html
+++ b/contrib/sendmail/libmilter/docs/overview.html
@@ -4,7 +4,7 @@
</HEAD>
<BODY>
<!--
-$Id: overview.html,v 1.20 2009/11/13 18:15:05 ca Exp $
+$Id: overview.html,v 1.21 2010/12/14 20:59:52 ca Exp $
-->
<H1>Technical Overview</H1>
@@ -126,7 +126,7 @@ messages may be sent in a single connection.
Note also that a message or connection may be aborted by
either the remote host or the MTA
at any point during the SMTP transaction.
-f this occurs during a message (between the MAIL command and the final "."),
+If this occurs during a message (between the MAIL command and the final "."),
the filter's
<A HREF="xxfi_abort.html">xxfi_abort</A> routine will be called.
<A HREF="xxfi_close.html">xxfi_close</A> is called any time the
diff --git a/contrib/sendmail/libmilter/docs/smfi_stop.html b/contrib/sendmail/libmilter/docs/smfi_stop.html
index 87ecdb2..5d25882 100644
--- a/contrib/sendmail/libmilter/docs/smfi_stop.html
+++ b/contrib/sendmail/libmilter/docs/smfi_stop.html
@@ -2,7 +2,7 @@
<HEAD><TITLE>smfi_stop</TITLE></HEAD>
<BODY>
<!--
-$Id: smfi_stop.html,v 1.6 2006/12/21 18:30:35 ca Exp $
+$Id: smfi_stop.html,v 1.7 2010/12/13 16:16:01 ca Exp $
-->
<H1>smfi_stop</H1>
@@ -42,7 +42,7 @@ which may then exit or warm-restart.
<TABLE border="1" cellspacing=0>
<TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
<TR valign="top"><TD>void</TD>
- <TD>Takes no arguement.
+ <TD>Takes no argument.
</TD></TR>
</TABLE>
</TD></TR>
diff --git a/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html b/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html
index 9fb4ce8..67a8cf5 100644
--- a/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html
+++ b/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html
@@ -2,7 +2,7 @@
<HEAD><TITLE>xxfi_envrcpt</TITLE></HEAD>
<BODY>
<!--
-$Id: xxfi_envrcpt.html,v 1.15 2007/01/25 01:00:20 ca Exp $
+$Id: xxfi_envrcpt.html,v 1.16 2010/07/14 04:41:03 ca Exp $
-->
<H1>xxfi_envrcpt</H1>
@@ -71,7 +71,8 @@ Handle the envelope RCPT command.
</TR>
<TR valign="top">
<TD>SMFIS_ACCEPT</TD>
- <TD>Accept recipient. <A href="xxfi_abort.html">xxfi_abort</A> will not be called.
+ <TD>Accept this message.
+ <A href="xxfi_abort.html">xxfi_abort</A> will not be called.
</TD>
</TR>
</TABLE>
@@ -87,7 +88,7 @@ Handle the envelope RCPT command.
<HR size="1">
<FONT size="-1">
-Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers.
+Copyright (c) 2000, 2003, 2010 Sendmail, Inc. and its suppliers.
All rights reserved.
<BR>
By using this file, you agree to the terms and conditions set
diff --git a/contrib/sendmail/libmilter/engine.c b/contrib/sendmail/libmilter/engine.c
index a2d3e1e..92c8e6d 100644
--- a/contrib/sendmail/libmilter/engine.c
+++ b/contrib/sendmail/libmilter/engine.c
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: engine.c,v 8.166 2009/11/06 00:57:07 ca Exp $")
+SM_RCSID("@(#)$Id: engine.c,v 8.167 2011/03/03 06:09:15 ca Exp $")
#include "libmilter.h"
@@ -284,7 +284,7 @@ mi_engine(ctx)
if (mi_stop() == MILTER_ABRT)
{
if (ctx->ctx_dbg > 3)
- sm_dprintf("[%ld] milter_abort\n",
+ sm_dprintf("[%lu] milter_abort\n",
(long) ctx->ctx_id);
ret = MI_FAILURE;
break;
@@ -315,7 +315,7 @@ mi_engine(ctx)
cmd < SMFIC_VALIDCMD)
{
if (ctx->ctx_dbg > 5)
- sm_dprintf("[%ld] mi_engine: mi_rd_cmd error (%x)\n",
+ sm_dprintf("[%lu] mi_engine: mi_rd_cmd error (%x)\n",
(long) ctx->ctx_id, (int) cmd);
/*
@@ -328,7 +328,7 @@ mi_engine(ctx)
break;
}
if (ctx->ctx_dbg > 4)
- sm_dprintf("[%ld] got cmd '%c' len %d\n",
+ sm_dprintf("[%lu] got cmd '%c' len %d\n",
(long) ctx->ctx_id, cmd, (int) len);
for (i = 0; i < ncmds; i++)
{
@@ -339,7 +339,7 @@ mi_engine(ctx)
{
/* unknown command */
if (ctx->ctx_dbg > 1)
- sm_dprintf("[%ld] cmd '%c' unknown\n",
+ sm_dprintf("[%lu] cmd '%c' unknown\n",
(long) ctx->ctx_id, cmd);
ret = MI_FAILURE;
break;
@@ -348,7 +348,7 @@ mi_engine(ctx)
{
/* stop for now */
if (ctx->ctx_dbg > 1)
- sm_dprintf("[%ld] cmd '%c' not impl\n",
+ sm_dprintf("[%lu] cmd '%c' not impl\n",
(long) ctx->ctx_id, cmd);
ret = MI_FAILURE;
break;
@@ -357,14 +357,14 @@ mi_engine(ctx)
/* is new state ok? */
newstate = cmds[i].cm_next;
if (ctx->ctx_dbg > 5)
- sm_dprintf("[%ld] cur %x new %x nextmask %x\n",
+ sm_dprintf("[%lu] cur %x new %x nextmask %x\n",
(long) ctx->ctx_id,
curstate, newstate, next_states[curstate]);
if (newstate != ST_NONE && !trans_ok(curstate, newstate))
{
if (ctx->ctx_dbg > 1)
- sm_dprintf("[%ld] abort: cur %d (%x) new %d (%x) next %x\n",
+ sm_dprintf("[%lu] abort: cur %d (%x) new %d (%x) next %x\n",
(long) ctx->ctx_id,
curstate, MI_MASK(curstate),
newstate, MI_MASK(newstate),
@@ -434,7 +434,7 @@ mi_engine(ctx)
else if (r == _SMFIS_ABORT)
{
if (ctx->ctx_dbg > 5)
- sm_dprintf("[%ld] function returned abort\n",
+ sm_dprintf("[%lu] function returned abort\n",
(long) ctx->ctx_id);
ret = MI_FAILURE;
break;
@@ -1122,7 +1122,7 @@ st_optionneg(g)
fix_stm(ctx);
if (ctx->ctx_dbg > 3)
- sm_dprintf("[%ld] milter_negotiate:"
+ sm_dprintf("[%lu] milter_negotiate:"
" mta_actions=0x%lx, mta_flags=0x%lx"
" actions=0x%lx, flags=0x%lx\n"
, (long) ctx->ctx_id
@@ -1131,7 +1131,7 @@ st_optionneg(g)
#if _FFR_MILTER_CHECK
if (ctx->ctx_dbg > 3)
- sm_dprintf("[%ld] milter_negotiate:"
+ sm_dprintf("[%lu] milter_negotiate:"
" testmode=%d, pflags2mta=%X, internal_pflags=%X\n"
, (long) ctx->ctx_id, testmode
, ctx->ctx_pflags2mta, internal_pflags);
diff --git a/contrib/sendmail/libmilter/sm_gethost.c b/contrib/sendmail/libmilter/sm_gethost.c
index 5706b89..8f2b339 100644
--- a/contrib/sendmail/libmilter/sm_gethost.c
+++ b/contrib/sendmail/libmilter/sm_gethost.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2001, 2004 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2001, 2004, 2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: sm_gethost.c,v 8.27 2004/08/20 21:12:37 ca Exp $")
+SM_RCSID("@(#)$Id: sm_gethost.c,v 8.29 2010/07/27 01:09:31 ca Exp $")
#include <sendmail.h>
#if NETINET || NETINET6
@@ -30,7 +30,7 @@ SM_RCSID("@(#)$Id: sm_gethost.c,v 8.27 2004/08/20 21:12:37 ca Exp $")
#if NETINET6 && NEEDSGETIPNODE
-static struct hostent *getipnodebyname __P((char *, int, int, int *));
+static struct hostent *sm_getipnodebyname __P((const char *, int, int, int *));
# ifndef AI_ADDRCONFIG
# define AI_ADDRCONFIG 0 /* dummy */
@@ -43,8 +43,8 @@ static struct hostent *getipnodebyname __P((char *, int, int, int *));
# endif /* ! AI_DEFAULT */
static struct hostent *
-getipnodebyname(name, family, flags, err)
- char *name;
+sm_getipnodebyname(name, family, flags, err)
+ const char *name;
int family;
int flags;
int *err;
@@ -77,6 +77,8 @@ freehostent(h)
return;
}
+#else /* NEEDSGETIPNODE && NETINET6 */
+#define sm_getipnodebyname getipnodebyname
#endif /* NEEDSGETIPNODE && NETINET6 */
struct hostent *
@@ -107,7 +109,7 @@ mi_gethostbyname(name, family)
# if ADDRCONFIG_IS_BROKEN
flags &= ~AI_ADDRCONFIG;
# endif /* ADDRCONFIG_IS_BROKEN */
- h = getipnodebyname(name, family, flags, &err);
+ h = sm_getipnodebyname(name, family, flags, &err);
SM_SET_H_ERRNO(err);
# else /* NETINET6 */
h = gethostbyname(name);
diff --git a/contrib/sendmail/libmilter/worker.c b/contrib/sendmail/libmilter/worker.c
index 28d404f..aa1bd57 100644
--- a/contrib/sendmail/libmilter/worker.c
+++ b/contrib/sendmail/libmilter/worker.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2004, 2007, 2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2003-2004, 2007, 2009-2011 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -11,7 +11,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: worker.c,v 8.17 2009/06/15 15:34:54 ca Exp $")
+SM_RCSID("@(#)$Id: worker.c,v 8.19 2011/02/14 23:33:48 ca Exp $")
#include "libmilter.h"
@@ -165,7 +165,9 @@ mi_start_session(ctx)
{
static long id = 0;
- SM_ASSERT(Tskmgr.tm_signature == TM_SIGNATURE);
+ /* this can happen if the milter is shutting down */
+ if (Tskmgr.tm_signature != TM_SIGNATURE)
+ return MI_FAILURE;
SM_ASSERT(ctx != NULL);
POOL_LEV_DPRINTF(4, ("PIPE r=[%d] w=[%d]", RD_PIPE, WR_PIPE));
TASKMGR_LOCK();
@@ -216,6 +218,41 @@ mi_close_session(ctx)
}
/*
+** NONBLOCKING -- set nonblocking mode for a file descriptor.
+**
+** Parameters:
+** fd -- file descriptor
+** name -- name for (error) logging
+**
+** Returns:
+** MI_SUCCESS/MI_FAILURE
+*/
+
+static int
+nonblocking(int fd, const char *name)
+{
+ int r;
+
+ errno = 0;
+ r = fcntl(fd, F_GETFL, 0);
+ if (r == -1)
+ {
+ smi_log(SMI_LOG_ERR, "fcntl(%s, F_GETFL)=%s",
+ name, sm_errstring(errno));
+ return MI_FAILURE;
+ }
+ errno = 0;
+ r = fcntl(fd, F_SETFL, r | O_NONBLOCK);
+ if (r == -1)
+ {
+ smi_log(SMI_LOG_ERR, "fcntl(%s, F_SETFL, O_NONBLOCK)=%s",
+ name, sm_errstring(errno));
+ return MI_FAILURE;
+ }
+ return MI_SUCCESS;
+}
+
+/*
** MI_POOL_CONTROLER_INIT -- Launch the worker pool controller
** Must be called before starting sessions.
**
@@ -246,6 +283,12 @@ mi_pool_controller_init()
sm_errstring(errno));
return MI_FAILURE;
}
+ r = nonblocking(WR_PIPE, "WR_PIPE");
+ if (r != MI_SUCCESS)
+ return r;
+ r = nonblocking(RD_PIPE, "RD_PIPE");
+ if (r != MI_SUCCESS)
+ return r;
(void) smutex_init(&Tskmgr.tm_w_mutex);
(void) scond_init(&Tskmgr.tm_w_cond);
@@ -495,25 +538,23 @@ mi_pool_controller(arg)
/* has a worker signaled an end of task ? */
if (WAIT_FD(i) == RD_PIPE)
{
- char evt = 0;
- int r = 0;
+ char evts[256];
+ ssize_t r;
POOL_LEV_DPRINTF(4,
("PIPE WILL READ evt = %08X %08X",
pfd[i].events, pfd[i].revents));
- if ((pfd[i].revents & MI_POLL_RD_FLAGS) != 0)
+ r = 1;
+ while ((pfd[i].revents & MI_POLL_RD_FLAGS) != 0
+ && r != -1)
{
- r = read(RD_PIPE, &evt, sizeof(evt));
- if (r == sizeof(evt))
- {
- /* Do nothing */
- }
+ r = read(RD_PIPE, evts, sizeof(evts));
}
POOL_LEV_DPRINTF(4,
("PIPE DONE READ i=[%d] fd=[%d] r=[%d] evt=[%d]",
- i, RD_PIPE, r, evt));
+ i, RD_PIPE, (int) r, evts[0]));
if ((pfd[i].revents & ~MI_POLL_RD_FLAGS) != 0)
{
diff --git a/contrib/sendmail/libsm/ldap.c b/contrib/sendmail/libsm/ldap.c
index 7ee57fc..9ae233f 100644
--- a/contrib/sendmail/libsm/ldap.c
+++ b/contrib/sendmail/libsm/ldap.c
@@ -11,7 +11,7 @@
#define LDAP_DEPRECATED 1
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: ldap.c,v 1.83 2009/06/19 22:02:26 guenther Exp $")
+SM_RCSID("@(#)$Id: ldap.c,v 1.85 2011/04/18 22:20:20 ca Exp $")
#if LDAPMAP
# include <sys/types.h>
@@ -1098,10 +1098,8 @@ sm_ldap_results(lmap, msgid, flags, delim, rpool, result,
if (ret == 0)
save_errno = ETIMEDOUT;
- else
+ else if (ret == LDAP_RES_SEARCH_RESULT)
{
- int rc;
-
/*
** We may have gotten an LDAP_RES_SEARCH_RESULT response
** with an error inside it, so we have to extract that
@@ -1109,11 +1107,21 @@ sm_ldap_results(lmap, msgid, flags, delim, rpool, result,
** to an LDAP proxy whose backend has gone down.
*/
- save_errno = ldap_parse_result(lmap->ldap_ld, lmap->ldap_res,
- &rc, NULL, NULL, NULL, NULL, 0);
- if (save_errno == LDAP_SUCCESS)
- save_errno = rc;
+ if (lmap->ldap_res == NULL)
+ save_errno = LDAP_UNAVAILABLE;
+ else
+ {
+ int rc;
+
+ save_errno = ldap_parse_result(lmap->ldap_ld,
+ lmap->ldap_res, &rc, NULL, NULL,
+ NULL, NULL, 0);
+ if (save_errno == LDAP_SUCCESS)
+ save_errno = rc;
+ }
}
+ else
+ save_errno = sm_ldap_geterrno(lmap->ldap_ld);
if (save_errno != LDAP_SUCCESS)
{
statp = EX_TEMPFAIL;
diff --git a/contrib/sendmail/makemap/makemap.c b/contrib/sendmail/makemap/makemap.c
index cacec00..f06ed07 100644
--- a/contrib/sendmail/makemap/makemap.c
+++ b/contrib/sendmail/makemap/makemap.c
@@ -20,7 +20,7 @@ SM_IDSTR(copyright,
Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n")
-SM_IDSTR(id, "@(#)$Id: makemap.c,v 8.179 2008/04/14 02:06:16 ca Exp $")
+SM_IDSTR(id, "@(#)$Id: makemap.c,v 8.180 2010/11/23 02:35:08 gshapiro Exp $")
#include <sys/types.h>
@@ -238,7 +238,7 @@ main(argc, argv)
if ((cfp = sm_io_open(SmFtStdio, SM_TIME_DEFAULT, cfile, SM_IO_RDONLY,
NULL)) == NULL)
{
- sm_io_fprintf(smioerr, SM_TIME_DEFAULT, "makemap: %s: %s",
+ sm_io_fprintf(smioerr, SM_TIME_DEFAULT, "makemap: %s: %s\n",
cfile, sm_errstring(errno));
exit(EX_NOINPUT);
}
diff --git a/contrib/sendmail/src/Makefile.m4 b/contrib/sendmail/src/Makefile.m4
index 0fa3374..7bcd24d 100644
--- a/contrib/sendmail/src/Makefile.m4
+++ b/contrib/sendmail/src/Makefile.m4
@@ -1,4 +1,4 @@
-dnl $Id: Makefile.m4,v 8.121 2009/12/15 22:39:23 ca Exp $
+dnl $Id: Makefile.m4,v 8.126 2010/11/24 19:59:54 gshapiro Exp $
include(confBUILDTOOLSDIR`/M4/switch.m4')
define(`confREQUIRE_LIBSM', `true')
diff --git a/contrib/sendmail/src/conf.c b/contrib/sendmail/src/conf.c
index 8d8f9ed..ffc6f20 100644
--- a/contrib/sendmail/src/conf.c
+++ b/contrib/sendmail/src/conf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: conf.c,v 8.1153 2009/12/18 17:25:12 ca Exp $")
+SM_RCSID("@(#)$Id: conf.c,v 8.1168 2011/01/25 18:31:30 ca Exp $")
#include <sm/sendmail.h>
#include <sendmail/pathnames.h>
@@ -50,8 +50,11 @@ static int get_num_procs_online __P((void));
static int add_hostnames __P((SOCKADDR *));
#if NETINET6 && NEEDSGETIPNODE
-static struct hostent *getipnodebyname __P((char *, int, int, int *));
-static struct hostent *getipnodebyaddr __P((char *, int, int, int *));
+static struct hostent *sm_getipnodebyname __P((const char *, int, int, int *));
+static struct hostent *sm_getipnodebyaddr __P((const void *, size_t, int, int *));
+#else /* NETINET6 && NEEDSGETIPNODE */
+#define sm_getipnodebyname getipnodebyname
+#define sm_getipnodebyaddr getipnodebyaddr
#endif /* NETINET6 && NEEDSGETIPNODE */
@@ -2600,7 +2603,7 @@ setproctitle(fmt, va_alist)
** none.
*/
-/*VARARGS2*/
+/*VARARGS3*/
void
#ifdef __STDC__
sm_setproctitle(bool status, ENVELOPE *e, const char *fmt, ...)
@@ -4188,7 +4191,7 @@ strstr(big, little)
/*
** SM_GETHOSTBY{NAME,ADDR} -- compatibility routines for gethostbyXXX
**
-** Some operating systems have wierd problems with the gethostbyXXX
+** Some operating systems have weird problems with the gethostbyXXX
** routines. For example, Solaris versions at least through 2.3
** don't properly deliver a canonical h_name field. This tries to
** work around these problems.
@@ -4212,8 +4215,8 @@ strstr(big, little)
# endif /* ! AI_ALL */
static struct hostent *
-getipnodebyname(name, family, flags, err)
- char *name;
+sm_getipnodebyname(name, family, flags, err)
+ const char *name;
int family;
int flags;
int *err;
@@ -4236,9 +4239,9 @@ getipnodebyname(name, family, flags, err)
}
static struct hostent *
-getipnodebyaddr(addr, len, family, err)
- char *addr;
- int len;
+sm_getipnodebyaddr(addr, len, family, err)
+ const void *addr;
+ size_t len;
int family;
int *err;
{
@@ -4305,7 +4308,7 @@ sm_gethostbyname(name, family)
# if ADDRCONFIG_IS_BROKEN
flags &= ~AI_ADDRCONFIG;
# endif /* ADDRCONFIG_IS_BROKEN */
- h = getipnodebyname(name, family, flags, &err);
+ h = sm_getipnodebyname(name, family, flags, &err);
SM_SET_H_ERRNO(err);
# else /* NETINET6 */
h = gethostbyname(name);
@@ -4344,7 +4347,7 @@ sm_gethostbyname(name, family)
hbuf, family);
# if NETINET6
- h = getipnodebyname(hbuf, family, flags, &err);
+ h = sm_getipnodebyname(hbuf, family, flags, &err);
SM_SET_H_ERRNO(err);
save_errno = errno;
# else /* NETINET6 */
@@ -4441,7 +4444,7 @@ sm_gethostbyaddr(addr, len, type)
{
int err;
- hp = getipnodebyaddr(addr, len, type, &err);
+ hp = sm_getipnodebyaddr(addr, len, type, &err);
SM_SET_H_ERRNO(err);
}
# else /* NETINET6 */
@@ -4864,6 +4867,7 @@ load_if_names()
switch (af)
{
case AF_INET6:
+ SETV6LOOPBACKADDRFOUND(*sa);
# ifdef __KAME__
/* convert into proper scoped address */
if ((IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr) ||
@@ -5063,6 +5067,7 @@ load_if_names()
# if NETINET6
case AF_INET6:
+ SETV6LOOPBACKADDRFOUND(*sa);
# ifdef __KAME__
/* convert into proper scoped address */
if ((IN6_IS_ADDR_LINKLOCAL(&sa->sin6.sin6_addr) ||
@@ -5928,6 +5933,9 @@ char *OsCompileOptions[] =
#if HASWAITPID
"HASWAITPID",
#endif /* HASWAITPID */
+#if HAVE_NANOSLEEP
+ "HAVE_NANOSLEEP",
+#endif /* HAVE_NANOSLEEP */
#if IDENTPROTO
"IDENTPROTO",
#endif /* IDENTPROTO */
@@ -6018,6 +6026,9 @@ char *OsCompileOptions[] =
#ifdef USESYSCTL
"USESYSCTL",
#endif /* USESYSCTL */
+#if USE_OPENSSL_ENGINE
+ "USE_OPENSSL_ENGINE",
+#endif /* USE_OPENSSL_ENGINE */
#if USING_NETSCAPE_LDAP
"USING_NETSCAPE_LDAP",
#endif /* USING_NETSCAPE_LDAP */
@@ -6321,7 +6332,7 @@ char *FFRCompileOptions[] =
#endif /* _FFR_QUEUE_SCHED_DBG */
#if _FFR_RCPTTHROTDELAY
/* configurable delay for BadRcptThrottle */
- "_FFR_RCPTTHROTDELAY"
+ "_FFR_RCPTTHROTDELAY",
#endif /* _FFR_RCPTTHROTDELAY */
#if _FFR_REDIRECTEMPTY
/*
diff --git a/contrib/sendmail/src/daemon.c b/contrib/sendmail/src/daemon.c
index 983ad2f..a1dcbe85 100644
--- a/contrib/sendmail/src/daemon.c
+++ b/contrib/sendmail/src/daemon.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2007, 2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2007, 2009, 2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include "map.h"
-SM_RCSID("@(#)$Id: daemon.c,v 8.683 2009/12/18 01:12:40 ca Exp $")
+SM_RCSID("@(#)$Id: daemon.c,v 8.691 2011/01/25 18:31:30 ca Exp $")
#if defined(SOCK_STREAM) || defined(__GNU_LIBRARY__)
# define USE_SOCK_STREAM 1
@@ -1267,7 +1267,8 @@ setupdaemon(daemonaddr)
case AF_INET6:
if (IN6_IS_ADDR_UNSPECIFIED(&daemonaddr->sin6.sin6_addr))
daemonaddr->sin6.sin6_addr =
- LocalDaemon ? in6addr_loopback : in6addr_any;
+ (LocalDaemon && V6LoopbackAddrFound) ?
+ in6addr_loopback : in6addr_any;
port = daemonaddr->sin6.sin6_port;
break;
#endif /* NETINET6 */
@@ -2219,7 +2220,8 @@ makeconnection(host, port, mci, e, enough)
#if NETINET6
case AF_INET6:
if (IN6_IS_ADDR_UNSPECIFIED(&clt_addr.sin6.sin6_addr))
- clt_addr.sin6.sin6_addr = LocalDaemon ?
+ clt_addr.sin6.sin6_addr =
+ (LocalDaemon && V6LoopbackAddrFound) ?
in6addr_loopback : in6addr_any;
else
clt_bind = true;
@@ -2665,6 +2667,7 @@ gothostent:
#if NETINET
case AF_INET:
addr.sin.sin_addr.s_addr = ConnectOnlyTo.sin.sin_addr.s_addr;
+ addr.sa.sa_family = ConnectOnlyTo.sa.sa_family;
break;
#endif /* NETINET */
@@ -2872,7 +2875,10 @@ nextaddr:
/* Use the configured HeloName as appropriate */
if (HeloName != NULL && HeloName[0] != '\0')
+ {
+ SM_FREE_CLR(mci->mci_heloname);
mci->mci_heloname = newstr(HeloName);
+ }
mci_setstat(mci, EX_OK, NULL, NULL);
return EX_OK;
diff --git a/contrib/sendmail/src/deliver.c b/contrib/sendmail/src/deliver.c
index 0322c95..acd977f 100644
--- a/contrib/sendmail/src/deliver.c
+++ b/contrib/sendmail/src/deliver.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2008 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <sm/time.h>
-SM_RCSID("@(#)$Id: deliver.c,v 8.1020 2009/12/18 17:08:01 ca Exp $")
+SM_RCSID("@(#)$Id: deliver.c,v 8.1024 2011/01/12 23:52:59 ca Exp $")
#if HASSETUSERCONTEXT
# include <login_cap.h>
@@ -1850,7 +1850,7 @@ deliver(e, firstto)
** If we are running SMTP, we just need to clean up.
*/
- /* XXX this seems a bit wierd */
+ /* XXX this seems a bit weird */
if (ctladdr == NULL && m != ProgMailer && m != FileMailer &&
bitset(QGOODUID, e->e_from.q_flags))
ctladdr = &e->e_from;
@@ -2144,6 +2144,7 @@ tryhost:
mci->mci_lastuse = curtime();
mci->mci_deliveries = 0;
mci->mci_exitstat = i;
+ mci_clr_extensions(mci);
# if NAMED_BIND
mci->mci_herrno = h_errno;
# endif /* NAMED_BIND */
@@ -3104,7 +3105,7 @@ reconnect: /* after switching to an encrypted connection */
mci->mci_state != MCIS_CLOSED)
{
SET_HELO(mci->mci_flags);
- mci->mci_flags &= ~MCIF_EXTENS;
+ mci_clr_extensions(mci);
goto reconnect;
}
}
@@ -3157,7 +3158,7 @@ reconnect: /* after switching to an encrypted connection */
&mci->mci_out,
mci->mci_conn, tmo) == 0)
{
- mci->mci_flags &= ~MCIF_EXTENS;
+ mci_clr_extensions(mci);
mci->mci_flags |= MCIF_AUTHACT|
MCIF_ONLY_EHLO;
goto reconnect;
@@ -6111,12 +6112,13 @@ starttls(m, mci, e)
return EX_TEMPFAIL;
# if USE_OPENSSL_ENGINE
- if (!SSL_set_engine(NULL))
+ if (!SSLEngineInitialized && !SSL_set_engine(NULL))
{
sm_syslog(LOG_ERR, NOQID,
"STARTTLS=client, SSL_set_engine=failed");
return EX_TEMPFAIL;
}
+ SSLEngineInitialized = true;
# endif /* USE_OPENSSL_ENGINE */
smtpmessage("STARTTLS", m, mci);
diff --git a/contrib/sendmail/src/domain.c b/contrib/sendmail/src/domain.c
index 394b0d3f..21442b3 100644
--- a/contrib/sendmail/src/domain.c
+++ b/contrib/sendmail/src/domain.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2004, 2006 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2004, 2006, 2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1986, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -15,9 +15,9 @@
#include "map.h"
#if NAMED_BIND
-SM_RCSID("@(#)$Id: domain.c,v 8.202 2006/12/19 01:15:07 ca Exp $ (with name server)")
+SM_RCSID("@(#)$Id: domain.c,v 8.204 2010/06/29 15:35:33 ca Exp $ (with name server)")
#else /* NAMED_BIND */
-SM_RCSID("@(#)$Id: domain.c,v 8.202 2006/12/19 01:15:07 ca Exp $ (without name server)")
+SM_RCSID("@(#)$Id: domain.c,v 8.204 2010/06/29 15:35:33 ca Exp $ (without name server)")
#endif /* NAMED_BIND */
#if NAMED_BIND
@@ -25,25 +25,6 @@ SM_RCSID("@(#)$Id: domain.c,v 8.202 2006/12/19 01:15:07 ca Exp $ (without name s
# include <arpa/inet.h>
-/*
-** The standard udp packet size PACKETSZ (512) is not sufficient for some
-** nameserver answers containing very many resource records. The resolver
-** may switch to tcp and retry if it detects udp packet overflow.
-** Also note that the resolver routines res_query and res_search return
-** the size of the *un*truncated answer in case the supplied answer buffer
-** it not big enough to accommodate the entire answer.
-*/
-
-# ifndef MAXPACKET
-# define MAXPACKET 8192 /* max packet size used internally by BIND */
-# endif /* ! MAXPACKET */
-
-typedef union
-{
- HEADER qb1;
- unsigned char qb2[MAXPACKET];
-} querybuf;
-
# ifndef MXHOSTBUFSIZE
# define MXHOSTBUFSIZE (128 * MAXMXHOSTS)
# endif /* ! MXHOSTBUFSIZE */
diff --git a/contrib/sendmail/src/envelope.c b/contrib/sendmail/src/envelope.c
index 022c3ca..18defd2 100644
--- a/contrib/sendmail/src/envelope.c
+++ b/contrib/sendmail/src/envelope.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: envelope.c,v 8.310 2009/12/18 17:08:01 ca Exp $")
+SM_RCSID("@(#)$Id: envelope.c,v 8.312 2010/02/03 16:36:40 ca Exp $")
/*
** CLRSESSENVELOPE -- clear session oriented data in an envelope
@@ -246,12 +246,14 @@ dropenvelope(e, fulldrop, split)
e->e_flags |= EF_FATALERRS|EF_CLRQUEUE;
}
+
e->e_flags &= ~EF_QUEUERUN;
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
if (QS_IS_UNDELIVERED(q->q_state))
queueit = true;
+
/* see if a notification is needed */
if (bitset(QPINGONFAILURE, q->q_flags) &&
((IS_MSG_ERR(msg_timeout) &&
diff --git a/contrib/sendmail/src/err.c b/contrib/sendmail/src/err.c
index 5825666..baa355a 100644
--- a/contrib/sendmail/src/err.c
+++ b/contrib/sendmail/src/err.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2003, 2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: err.c,v 8.196 2006/11/10 23:14:08 ca Exp $")
+SM_RCSID("@(#)$Id: err.c,v 8.205 2010/02/03 23:22:41 ca Exp $")
#if LDAPMAP
# include <lber.h>
@@ -359,7 +359,7 @@ usrerr(fmt, va_alist)
** increments Errors.
*/
-/*VARARGS1*/
+/*VARARGS2*/
void
#ifdef __STDC__
usrerrenh(char *enhsc, const char *fmt, ...)
@@ -427,6 +427,7 @@ usrerrenh(enhsc, fmt, va_alist)
if (QuickAbort)
sm_exc_raisenew_x(&EtypeQuickAbort, 1);
}
+
/*
** MESSAGE -- print message (not necessarily an error)
**
@@ -473,11 +474,12 @@ message(msg, va_alist)
case '5':
if (CurEnv->e_rpool == NULL && CurEnv->e_message != NULL)
sm_free(CurEnv->e_message);
- CurEnv->e_message =
- sm_rpool_strdup_x(CurEnv->e_rpool, errtxt);
+ CurEnv->e_message = sm_rpool_strdup_x(CurEnv->e_rpool, errtxt);
break;
}
}
+
+
/*
** NMESSAGE -- print message (not necessarily an error)
**
diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c
index 1bbb070..4d2318f 100644
--- a/contrib/sendmail/src/main.c
+++ b/contrib/sendmail/src/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2006, 2008, 2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2006, 2008, 2009, 2011 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -26,7 +26,7 @@ SM_UNUSED(static char copyright[]) =
The Regents of the University of California. All rights reserved.\n";
#endif /* ! lint */
-SM_RCSID("@(#)$Id: main.c,v 8.971 2009/12/18 17:08:01 ca Exp $")
+SM_RCSID("@(#)$Id: main.c,v 8.976 2011/03/15 23:14:36 ca Exp $")
#if NETINET || NETINET6
@@ -304,6 +304,9 @@ main(argc, argv, envp)
SubmitMode = SUBMIT_UNKNOWN;
#if _FFR_LOCAL_DAEMON
LocalDaemon = false;
+# if NETINET6
+ V6LoopbackAddrFound = false;
+# endif /* NETINET6 */
#endif /* _FFR_LOCAL_DAEMON */
#if XDEBUG
checkfd012("after openlog");
@@ -1308,7 +1311,7 @@ main(argc, argv, envp)
(void) getfallbackmxrr(FallbackMX);
#endif /* NAMED_BIND */
- if (SuperSafe == SAFE_INTERACTIVE && CurEnv->e_sendmode != SM_DELIVER)
+ if (SuperSafe == SAFE_INTERACTIVE && !SM_IS_INTERACTIVE(CurEnv->e_sendmode))
{
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
"WARNING: SuperSafe=interactive should only be used with\n DeliveryMode=interactive\n");
@@ -3190,7 +3193,7 @@ sigpipe(sig)
** may resend a message.
**
** Parameters:
-** none.
+** sig -- incoming signal.
**
** Returns:
** none.
@@ -3201,8 +3204,6 @@ sigpipe(sig)
** NOTE: THIS CAN BE CALLED FROM A SIGNAL HANDLER. DO NOT ADD
** ANYTHING TO THIS ROUTINE UNLESS YOU KNOW WHAT YOU ARE
** DOING.
-**
-** XXX: More work is needed for this signal handler.
*/
/* ARGSUSED */
@@ -3217,38 +3218,34 @@ intsig(sig)
errno = save_errno;
CHECK_CRITICAL(sig);
sm_allsignals(true);
+ IntSig = true;
- if (sig != 0 && LogLevel > 79)
- sm_syslog(LOG_DEBUG, CurEnv->e_id, "interrupt");
FileName = NULL;
/* Clean-up on aborted stdin message submission */
- if (CurEnv->e_id != NULL &&
- (OpMode == MD_SMTP ||
+ if (OpMode == MD_SMTP ||
OpMode == MD_DELIVER ||
- OpMode == MD_ARPAFTP))
+ OpMode == MD_ARPAFTP)
{
- register ADDRESS *q;
-
- /* don't return an error indication */
- CurEnv->e_to = NULL;
- CurEnv->e_flags &= ~EF_FATALERRS;
- CurEnv->e_flags |= EF_CLRQUEUE;
-
- /*
- ** Spin through the addresses and
- ** mark them dead to prevent bounces
- */
-
- for (q = CurEnv->e_sendqueue; q != NULL; q = q->q_next)
- q->q_state = QS_DONTSEND;
-
- drop = true;
+ if (CurEnv->e_id != NULL)
+ {
+ char *fn;
+
+ fn = queuename(CurEnv, DATAFL_LETTER);
+ if (fn != NULL)
+ (void) unlink(fn);
+ fn = queuename(CurEnv, ANYQFL_LETTER);
+ if (fn != NULL)
+ (void) unlink(fn);
+ }
+ _exit(EX_OK);
+ /* NOTREACHED */
}
- else if (OpMode != MD_TEST)
- {
+
+ if (sig != 0 && LogLevel > 79)
+ sm_syslog(LOG_DEBUG, CurEnv->e_id, "interrupt");
+ if (OpMode != MD_TEST)
unlockqueue(CurEnv);
- }
finis(drop, false, EX_OK);
/* NOTREACHED */
diff --git a/contrib/sendmail/src/map.c b/contrib/sendmail/src/map.c
index be88685..2eb6958 100644
--- a/contrib/sendmail/src/map.c
+++ b/contrib/sendmail/src/map.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: map.c,v 8.705 2009/08/11 22:22:40 ca Exp $")
+SM_RCSID("@(#)$Id: map.c,v 8.706 2010/07/27 03:35:42 ca Exp $")
#if LDAPMAP
# include <sm/ldap.h>
@@ -5985,7 +5985,7 @@ stab_map_store(map, lhs, rhs)
/*
** STAB_MAP_OPEN -- initialize (reads data file)
**
-** This is a wierd case -- it is only intended as a fallback for
+** This is a weird case -- it is only intended as a fallback for
** aliases. For this reason, opens for write (only during a
** "newaliases") always fails, and opens for read open the
** actual underlying text file instead of the database.
diff --git a/contrib/sendmail/src/mci.c b/contrib/sendmail/src/mci.c
index 2770117..7b17167 100644
--- a/contrib/sendmail/src/mci.c
+++ b/contrib/sendmail/src/mci.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2005, 2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: mci.c,v 8.221 2007/11/13 23:44:25 gshapiro Exp $")
+SM_RCSID("@(#)$Id: mci.c,v 8.223 2010/03/10 04:35:28 ca Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
@@ -288,6 +288,32 @@ mci_flush(doquit, allbut)
mci_uncache(&MciCache[i], doquit);
}
}
+
+/*
+** MCI_CLR_EXTENSIONS -- clear knowledge about SMTP extensions
+**
+** Parameters:
+** mci -- the connection to clear.
+**
+** Returns:
+** none.
+*/
+
+void
+mci_clr_extensions(mci)
+ MCI *mci;
+{
+ if (mci == NULL)
+ return;
+
+ mci->mci_flags &= ~MCIF_EXTENS;
+ mci->mci_maxsize = 0;
+ mci->mci_min_by = 0;
+#if SASL
+ mci->mci_saslcap = NULL;
+#endif /* SASL */
+}
+
/*
** MCI_GET -- get information about a particular host
**
@@ -567,6 +593,7 @@ static struct mcifbits MciFlags[] =
{ MCIF_CVT7TO8, "CVT7TO8" },
{ MCIF_INMIME, "INMIME" },
{ MCIF_AUTH, "AUTH" },
+ { MCIF_AUTH2, "AUTH2" },
{ MCIF_AUTHACT, "AUTHACT" },
{ MCIF_ENHSTAT, "ENHSTAT" },
{ MCIF_PIPELINED, "PIPELINED" },
diff --git a/contrib/sendmail/src/parseaddr.c b/contrib/sendmail/src/parseaddr.c
index 19bcf73..9135c22 100644
--- a/contrib/sendmail/src/parseaddr.c
+++ b/contrib/sendmail/src/parseaddr.c
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: parseaddr.c,v 8.403 2008/02/08 02:27:35 ca Exp $")
+SM_RCSID("@(#)$Id: parseaddr.c,v 8.404 2010/07/27 03:35:42 ca Exp $")
#include <sm/sendmail.h>
#include "map.h"
@@ -319,7 +319,7 @@ delim:
** is invalid and should be "repaired".
**
** Returns:
-** true -- if the address has any "wierd" characters or
+** true -- if the address has any "weird" characters or
** non-printable characters or if a quote is unbalanced.
** false -- otherwise.
*/
diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c
index 194f525..16142d9 100644
--- a/contrib/sendmail/src/queue.c
+++ b/contrib/sendmail/src/queue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2009, 2011 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -14,7 +14,7 @@
#include <sendmail.h>
#include <sm/sem.h>
-SM_RCSID("@(#)$Id: queue.c,v 8.987 2009/12/18 17:08:01 ca Exp $")
+SM_RCSID("@(#)$Id: queue.c,v 8.991 2011/03/15 23:14:36 ca Exp $")
#include <dirent.h>
@@ -203,7 +203,7 @@ static const char *FSPath[MAXFILESYS]; /* pathnames for file systems */
** tag -- should be a unique id to avoid misinterpretations by others.
** idea: hash over configuration data that will be stored here.
** NumFileSys -- number of file systems.
-** FileSys -- (arrary of) structure for used file systems.
+** FileSys -- (array of) structure for used file systems.
** RSATmpCnt -- counter for number of uses of ephemeral RSA key.
** QShm -- (array of) structure for information about queue directories.
*/
@@ -633,7 +633,6 @@ queueup(e, announce, msync)
}
/* output inode number of data file */
- /* XXX should probably include device major/minor too */
if (e->e_dfino != -1)
{
(void) sm_io_fprintf(tfp, SM_TIME_DEFAULT, "I%ld/%ld/%llu\n",
@@ -5195,7 +5194,11 @@ queuename(e, type)
/* Assign an ID if needed */
if (e->e_id == NULL)
+ {
+ if (IntSig)
+ return NULL;
assign_queueid(e);
+ }
type = queue_letter(e, type);
/* begin of filename */
@@ -5239,7 +5242,11 @@ queuename(e, type)
else
{
if (e->e_qgrp == NOQGRP || e->e_qdir == NOQDIR)
+ {
+ if (IntSig)
+ return NULL;
(void) setnewqueue(e);
+ }
if (type == DATAFL_LETTER)
{
qd = e->e_dfqdir;
@@ -5279,6 +5286,8 @@ queuename(e, type)
break;
default:
+ if (IntSig)
+ return NULL;
sm_abort("queuename: bad queue file type %d", type);
}
diff --git a/contrib/sendmail/src/readcf.c b/contrib/sendmail/src/readcf.c
index c6d48a8..7bc70c2 100644
--- a/contrib/sendmail/src/readcf.c
+++ b/contrib/sendmail/src/readcf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2006, 2008, 2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2006, 2008-2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -14,12 +14,13 @@
#include <sendmail.h>
#include <sm/sendmail.h>
-SM_RCSID("@(#)$Id: readcf.c,v 8.674 2009/10/26 17:47:00 ca Exp $")
+SM_RCSID("@(#)$Id: readcf.c,v 8.684 2011/03/15 17:29:29 guenther Exp $")
#if NETINET || NETINET6
# include <arpa/inet.h>
#endif /* NETINET || NETINET6 */
+
#define SECONDS
#define MINUTES * 60
#define HOUR * 3600
@@ -114,7 +115,15 @@ readcf(cfname, safe, e)
LineNumber = 0;
#if STARTTLS
- Srv_SSL_Options = Clt_SSL_Options = SSL_OP_ALL;
+ Srv_SSL_Options = SSL_OP_ALL;
+ Clt_SSL_Options = SSL_OP_ALL
+#ifdef SSL_OP_NO_SSLv2
+ | SSL_OP_NO_SSLv2
+#endif
+#ifdef SSL_OP_NO_TICKET
+ | SSL_OP_NO_TICKET
+#endif
+ ;
#endif /* STARTTLS */
if (DontLockReadFiles)
sff |= SFF_NOLOCK;
@@ -2271,6 +2280,10 @@ static struct optioninfo
# define O_RCPTTHROTDELAY 0xe6
{ "BadRcptThrottleDelay", O_RCPTTHROTDELAY, OI_SAFE },
#endif /* _FFR_RCPTTHROTDELAY */
+#if 0 && _FFR_QOS && defined(SOL_IP) && defined(IP_TOS)
+# define O_INETQOS 0xe7 /* reserved for FFR_QOS */
+ { "InetQoS", O_INETQOS, OI_NONE },
+#endif
{ NULL, '\0', OI_NONE }
};
@@ -2285,68 +2298,85 @@ static struct ssl_options
/* these are turned on by default */
#ifdef SSL_OP_MICROSOFT_SESS_ID_BUG
{ "SSL_OP_MICROSOFT_SESS_ID_BUG", SSL_OP_MICROSOFT_SESS_ID_BUG },
-#endif /* SSL_OP_MICROSOFT_SESS_ID_BUG */
+#endif
#ifdef SSL_OP_NETSCAPE_CHALLENGE_BUG
{ "SSL_OP_NETSCAPE_CHALLENGE_BUG", SSL_OP_NETSCAPE_CHALLENGE_BUG },
-#endif /* SSL_OP_NETSCAPE_CHALLENGE_BUG */
+#endif
#ifdef SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
{ "SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG", SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG },
-#endif /* SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG */
+#endif
#ifdef SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
{ "SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG", SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG },
-#endif /* SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG */
+#endif
#ifdef SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
{ "SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER", SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER },
-#endif /* SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER */
+#endif
#ifdef SSL_OP_MSIE_SSLV2_RSA_PADDING
{ "SSL_OP_MSIE_SSLV2_RSA_PADDING", SSL_OP_MSIE_SSLV2_RSA_PADDING },
-#endif /* SSL_OP_MSIE_SSLV2_RSA_PADDING */
+#endif
#ifdef SSL_OP_SSLEAY_080_CLIENT_DH_BUG
{ "SSL_OP_SSLEAY_080_CLIENT_DH_BUG", SSL_OP_SSLEAY_080_CLIENT_DH_BUG },
-#endif /* SSL_OP_SSLEAY_080_CLIENT_DH_BUG */
+#endif
#ifdef SSL_OP_TLS_D5_BUG
{ "SSL_OP_TLS_D5_BUG", SSL_OP_TLS_D5_BUG },
-#endif /* SSL_OP_TLS_D5_BUG */
+#endif
#ifdef SSL_OP_TLS_BLOCK_PADDING_BUG
{ "SSL_OP_TLS_BLOCK_PADDING_BUG", SSL_OP_TLS_BLOCK_PADDING_BUG },
-#endif /* SSL_OP_TLS_BLOCK_PADDING_BUG */
+#endif
#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
{ "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS", SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS },
-#endif /* SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS */
+#endif
+#ifdef SSL_OP_ALL
{ "SSL_OP_ALL", SSL_OP_ALL },
+#endif
+#ifdef SSL_OP_NO_QUERY_MTU
+ { "SSL_OP_NO_QUERY_MTU", SSL_OP_NO_QUERY_MTU },
+#endif
+#ifdef SSL_OP_COOKIE_EXCHANGE
+ { "SSL_OP_COOKIE_EXCHANGE", SSL_OP_COOKIE_EXCHANGE },
+#endif
+#ifdef SSL_OP_NO_TICKET
+ { "SSL_OP_NO_TICKET", SSL_OP_NO_TICKET },
+#endif
#ifdef SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
{ "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION", SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION },
-#endif /* SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION */
+#endif
+#ifdef SSL_OP_SINGLE_ECDH_USE
+ { "SSL_OP_SINGLE_ECDH_USE", SSL_OP_SINGLE_ECDH_USE },
+#endif
+#ifdef SSL_OP_SINGLE_DH_USE
+ { "SSL_OP_SINGLE_DH_USE", SSL_OP_SINGLE_DH_USE },
+#endif
#ifdef SSL_OP_EPHEMERAL_RSA
{ "SSL_OP_EPHEMERAL_RSA", SSL_OP_EPHEMERAL_RSA },
-#endif /* SSL_OP_EPHEMERAL_RSA */
+#endif
#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
{ "SSL_OP_CIPHER_SERVER_PREFERENCE", SSL_OP_CIPHER_SERVER_PREFERENCE },
-#endif /* SSL_OP_CIPHER_SERVER_PREFERENCE */
+#endif
#ifdef SSL_OP_TLS_ROLLBACK_BUG
{ "SSL_OP_TLS_ROLLBACK_BUG", SSL_OP_TLS_ROLLBACK_BUG },
-#endif /* SSL_OP_TLS_ROLLBACK_BUG */
+#endif
#ifdef SSL_OP_NO_SSLv2
{ "SSL_OP_NO_SSLv2", SSL_OP_NO_SSLv2 },
-#endif /* SSL_OP_NO_SSLv2 */
+#endif
#ifdef SSL_OP_NO_SSLv3
{ "SSL_OP_NO_SSLv3", SSL_OP_NO_SSLv3 },
-#endif /* SSL_OP_NO_SSLv3 */
+#endif
#ifdef SSL_OP_NO_TLSv1
{ "SSL_OP_NO_TLSv1", SSL_OP_NO_TLSv1 },
-#endif /* SSL_OP_NO_TLSv1 */
+#endif
#ifdef SSL_OP_PKCS1_CHECK_1
{ "SSL_OP_PKCS1_CHECK_1", SSL_OP_PKCS1_CHECK_1 },
-#endif /* SSL_OP_PKCS1_CHECK_1 */
+#endif
#ifdef SSL_OP_PKCS1_CHECK_2
{ "SSL_OP_PKCS1_CHECK_2", SSL_OP_PKCS1_CHECK_2 },
-#endif /* SSL_OP_PKCS1_CHECK_2 */
+#endif
#ifdef SSL_OP_NETSCAPE_CA_DN_BUG
{ "SSL_OP_NETSCAPE_CA_DN_BUG", SSL_OP_NETSCAPE_CA_DN_BUG },
-#endif /* SSL_OP_NETSCAPE_CA_DN_BUG */
+#endif
#ifdef SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
{ "SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG", SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG },
-#endif /* SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG */
+#endif
{ NULL, 0 }
};
#endif /* STARTTLS && _FFR_TLS_1 */
@@ -2639,6 +2669,7 @@ setoption(opt, val, safe, sticky, e)
set_delivery_mode(*val, e);
break;
+
default:
syserr("Unknown delivery mode %c", *val);
finis(false, true, EX_USAGE);
@@ -3446,7 +3477,7 @@ setoption(opt, val, safe, sticky, e)
ConnectOnlyTo.sa.sa_family = AF_UNSPEC;
# if NETINET6
if (anynet_pton(AF_INET6, val,
- &ConnectOnlyTo.sin6.sin6_addr) != 1)
+ &ConnectOnlyTo.sin6.sin6_addr) == 1)
ConnectOnlyTo.sa.sa_family = AF_INET6;
else
# endif /* NETINET6 */
diff --git a/contrib/sendmail/src/sendmail.8 b/contrib/sendmail/src/sendmail.8
index e5ce9ae..5097f22 100644
--- a/contrib/sendmail/src/sendmail.8
+++ b/contrib/sendmail/src/sendmail.8
@@ -9,9 +9,9 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: sendmail.8,v 8.59 2009/04/10 17:49:19 gshapiro Exp $
+.\" $Id: sendmail.8,v 8.60 2011/03/07 23:44:48 ca Exp $
.\"
-.TH SENDMAIL 8 "$Date: 2009/04/10 17:49:19 $"
+.TH SENDMAIL 8 "$Date: 2011/03/07 23:44:48 $"
.SH NAME
sendmail
\- an electronic mail transport agent
@@ -224,7 +224,9 @@ If not specified,
``Received:'' lines in the message are counted.
.TP
.B \-i
-Ignore dots alone on lines by themselves in incoming messages.
+Do not strip a leading dot from lines in incoming messages,
+and do not treat a dot on a line by itself
+as the end of an incoming message.
This should be set if you are reading data from a file.
.TP
.BI "\-L " tag
diff --git a/contrib/sendmail/src/sendmail.h b/contrib/sendmail/src/sendmail.h
index b170c2b..39ba16c 100644
--- a/contrib/sendmail/src/sendmail.h
+++ b/contrib/sendmail/src/sendmail.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -52,7 +52,7 @@
#ifdef _DEFINE
# ifndef lint
-SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail.h,v 8.1068 2009/12/18 17:08:01 ca Exp $";
+SM_UNUSED(static char SmailId[]) = "@(#)$Id: sendmail.h,v 8.1089 2011/03/15 23:14:36 ca Exp $";
# endif /* ! lint */
#endif /* _DEFINE */
@@ -327,7 +327,7 @@ typedef struct address ADDRESS;
(s) == QS_SENT || \
(s) == QS_DISCARDED)
#define QS_IS_DEAD(s) ((s) >= QS_DONTSEND)
-
+#define QS_IS_TEMPFAIL(s) ((s) == QS_QUEUEUP || (s) == QS_RETRY)
#define NULLADDR ((ADDRESS *) NULL)
@@ -721,17 +721,20 @@ MCI
#if STARTTLS
#define MCIF_TLS 0x00100000 /* STARTTLS supported */
#define MCIF_TLSACT 0x00200000 /* STARTTLS active */
-#define MCIF_EXTENS (MCIF_EXPN | MCIF_SIZE | MCIF_8BITMIME | MCIF_DSN | MCIF_8BITOK | MCIF_AUTH | MCIF_ENHSTAT | MCIF_TLS)
#else /* STARTTLS */
-#define MCIF_EXTENS (MCIF_EXPN | MCIF_SIZE | MCIF_8BITMIME | MCIF_DSN | MCIF_8BITOK | MCIF_AUTH | MCIF_ENHSTAT)
+#define MCIF_TLS 0
+#define MCIF_TLSACT 0
#endif /* STARTTLS */
#define MCIF_DLVR_BY 0x00400000 /* DELIVERBY */
#if _FFR_IGNORE_EXT_ON_HELO
# define MCIF_HELO 0x00800000 /* we used HELO: ignore extensions */
#endif /* _FFR_IGNORE_EXT_ON_HELO */
#define MCIF_INLONGLINE 0x01000000 /* in the middle of a long line */
+#define MCIF_AUTH2 0x02000000 /* got 2 AUTH lines */
#define MCIF_ONLY_EHLO 0x10000000 /* use only EHLO in smtpinit */
+#define MCIF_EXTENS (MCIF_EXPN | MCIF_SIZE | MCIF_8BITMIME | MCIF_DSN | MCIF_8BITOK | MCIF_AUTH | MCIF_ENHSTAT | MCIF_TLS | MCIF_AUTH2)
+
/* states */
#define MCIS_CLOSED 0 /* no traffic on this connection */
#define MCIS_OPENING 1 /* sending initial protocol */
@@ -749,6 +752,7 @@ extern void mci_close __P((MCI *, char *where));
extern void mci_dump __P((SM_FILE_T *, MCI *, bool));
extern void mci_dump_all __P((SM_FILE_T *, bool));
extern void mci_flush __P((bool, MCI *));
+extern void mci_clr_extensions __P((MCI *));
extern MCI *mci_get __P((char *, MAILER *));
extern int mci_lock_host __P((MCI *));
extern bool mci_match __P((char *, MAILER *));
@@ -1167,6 +1171,33 @@ struct hostsig_t
typedef struct hostsig_t HOSTSIG_T;
+/*
+** The standard udp packet size PACKETSZ (512) is not sufficient for some
+** nameserver answers containing very many resource records. The resolver
+** may switch to tcp and retry if it detects udp packet overflow.
+** Also note that the resolver routines res_query and res_search return
+** the size of the *un*truncated answer in case the supplied answer buffer
+** it not big enough to accommodate the entire answer.
+*/
+
+# ifndef MAXPACKET
+# define MAXPACKET 8192 /* max packet size used internally by BIND */
+# endif /* ! MAXPACKET */
+
+/*
+** The resolver functions res_{send,query,querydomain} expect the
+** answer buffer to be aligned, but some versions of gcc4 reverse
+** 25 years of history and no longer align char buffers on the
+** stack, resulting in crashes on strict-alignment platforms. Use
+** this union when putting the buffer on the stack to force the
+** alignment, then cast to (HEADER *) or (unsigned char *) as needed.
+*/
+typedef union
+{
+ HEADER qb1;
+ unsigned char qb2[MAXPACKET];
+} querybuf;
+
/* functions */
extern bool getcanonname __P((char *, int, bool, int *));
extern int getmxrr __P((char *, char **, unsigned short *, bool, int *, bool, int *));
@@ -1246,11 +1277,15 @@ MAP
#define MF_OPENBOGUS 0x00800000 /* open failed, don't call map_close */
#define MF_CLOSING 0x01000000 /* map is being closed */
-#define DYNOPENMAP(map) if (!bitset(MF_OPEN, (map)->map_mflags)) \
- { \
- if (!openmap(map)) \
- return NULL; \
- }
+#define DYNOPENMAP(map) \
+ do \
+ { \
+ if (!bitset(MF_OPEN, (map)->map_mflags)) \
+ { \
+ if (!openmap(map)) \
+ return NULL; \
+ } \
+ } while (0)
/* indices for map_actions */
@@ -1569,8 +1604,19 @@ extern void stabapply __P((void (*)(STAB *, int), int));
#if _FFR_LOCAL_DAEMON
EXTERN bool LocalDaemon;
+# if NETINET6
+EXTERN bool V6LoopbackAddrFound; /* found an IPv6 loopback address */
+# define SETV6LOOPBACKADDRFOUND(sa) \
+ do \
+ { \
+ if (isloopback(sa)) \
+ V6LoopbackAddrFound = true; \
+ } while (0)
+# endif /* NETINET6 */
#else /* _FFR_LOCAL_DAEMON */
# define LocalDaemon false
+# define V6LoopbackAddrFound false
+# define SETV6LOOPBACKADDRFOUND(sa)
#endif /* _FFR_LOCAL_DAEMON */
/* Note: see also include/sendmail/pathnames.h: GET_CLIENT_CF */
@@ -1585,6 +1631,7 @@ EXTERN bool LocalDaemon;
#define SM_DEFER 'd' /* defer map lookups as well as queue */
#define SM_VERIFY 'v' /* verify only (used internally) */
#define DM_NOTSET (-1) /* DeliveryMode (per daemon) option not set */
+# define SM_IS_INTERACTIVE(m) ((m) == SM_DELIVER)
#define WILL_BE_QUEUED(m) ((m) == SM_QUEUE || (m) == SM_DEFER)
@@ -2100,7 +2147,11 @@ extern void inittimeouts __P((char *, bool));
*/
/* macros for debugging flags */
-#define tTd(flag, level) (tTdvect[flag] >= (unsigned char)level)
+#if NOT_SENDMAIL
+# define tTd(flag, level) (tTdvect[flag] >= (unsigned char)level)
+#else
+# define tTd(flag, level) (tTdvect[flag] >= (unsigned char)level && !IntSig)
+#endif
#define tTdlevel(flag) (tTdvect[flag])
/* variables */
@@ -2123,22 +2174,26 @@ extern unsigned char tTdvect[100]; /* trace vector */
*/
/* set exit status */
-#define setstat(s) { \
- if (ExitStat == EX_OK || ExitStat == EX_TEMPFAIL) \
- ExitStat = s; \
- }
+#define setstat(s) \
+ do \
+ { \
+ if (ExitStat == EX_OK || ExitStat == EX_TEMPFAIL) \
+ ExitStat = s; \
+ } while (0)
#define STRUCTCOPY(s, d) d = s
/* free a pointer if it isn't NULL and set it to NULL */
#define SM_FREE_CLR(p) \
- if ((p) != NULL) \
- { \
- sm_free(p); \
- (p) = NULL; \
- } \
- else
+ do \
+ { \
+ if ((p) != NULL) \
+ { \
+ sm_free(p); \
+ (p) = NULL; \
+ } \
+ } while (0)
/*
** Update a permanent string variable with a new value.
@@ -2185,6 +2240,15 @@ extern unsigned char tTdvect[100]; /* trace vector */
#define XS_DEFAULT 0
#define XS_STARTTLS 1
#define XS_AUTH 2
+#define XS_GREET 3
+#define XS_EHLO 4
+#define XS_MAIL 5
+#define XS_RCPT 6
+#define XS_DATA 7
+#define XS_EOM 8
+#define XS_DATA2 9
+#define XS_RCPT2 10
+#define XS_QUIT 15
/*
** Global variables.
@@ -2363,6 +2427,7 @@ EXTERN char *RunAsUserName; /* user to become for bulk of run */
EXTERN char *SafeFileEnv; /* chroot location for file delivery */
EXTERN char *ServiceSwitchFile; /* backup service switch */
EXTERN char *volatile ShutdownRequest;/* a sendmail shutdown has been requested */
+EXTERN bool volatile IntSig;
EXTERN char *SmtpGreeting; /* SMTP greeting message (old $e macro) */
EXTERN char *SmtpPhase; /* current phase in SMTP processing */
EXTERN char SmtpError[MAXLINE]; /* save failure error messages */
@@ -2390,6 +2455,9 @@ extern const SM_EXC_TYPE_T EtypeQuickAbort; /* type of a QuickAbort exception */
EXTERN int ConnectionRateWindowSize;
+#if STARTTLS && USE_OPENSSL_ENGINE
+EXTERN bool SSLEngineInitialized;
+#endif /* STARTTLS && USE_OPENSSL_ENGINE */
/*
** Declarations of useful functions
@@ -2442,6 +2510,8 @@ extern int smtprcpt __P((ADDRESS *, MAILER *, MCI *, ENVELOPE *, ADDRESS *, time
extern void smtprset __P((MAILER *, MCI *, ENVELOPE *));
#define REPLYTYPE(r) ((r) / 100) /* first digit of reply code */
+#define REPLYCLASS(r) (((r) / 10) % 10) /* second digit of reply code */
+#define REPLYMINOR(r) ((r) % 10) /* last digit of reply code */
#define ISSMTPCODE(c) (isascii(c[0]) && isdigit(c[0]) && \
isascii(c[1]) && isdigit(c[1]) && \
isascii(c[2]) && isdigit(c[2]))
diff --git a/contrib/sendmail/src/sm_resolve.c b/contrib/sendmail/src/sm_resolve.c
index 6d9c28d..b8a1405 100644
--- a/contrib/sendmail/src/sm_resolve.c
+++ b/contrib/sendmail/src/sm_resolve.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2004 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2000-2004, 2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -44,9 +44,13 @@
#include <sendmail.h>
#if DNSMAP
# if NAMED_BIND
+# if NETINET
+# include <netinet/in_systm.h>
+# include <netinet/ip.h>
+# endif /* NETINET */
# include "sm_resolve.h"
-SM_RCSID("$Id: sm_resolve.c,v 8.36 2008/02/11 23:04:16 ca Exp $")
+SM_RCSID("$Id: sm_resolve.c,v 8.39 2010/06/29 15:35:33 ca Exp $")
static struct stot
{
@@ -394,7 +398,13 @@ dns_lookup_int(domain, rr_class, rr_type, retrans, retry)
time_t save_retrans = 0;
int save_retry = 0;
DNS_REPLY_T *r = NULL;
- unsigned char reply[1024];
+ querybuf reply_buf;
+ unsigned char *reply;
+
+#define SMRBSIZE sizeof(reply_buf)
+#ifndef IP_MAXPACKET
+# define IP_MAXPACKET 65535
+#endif
if (tTd(8, 16))
{
@@ -415,15 +425,44 @@ dns_lookup_int(domain, rr_class, rr_type, retrans, retry)
}
errno = 0;
SM_SET_H_ERRNO(0);
- len = res_search(domain, rr_class, rr_type, reply, sizeof(reply));
+ reply = (unsigned char *)&reply_buf;
+ len = res_search(domain, rr_class, rr_type, reply, SMRBSIZE);
+ if (len >= SMRBSIZE)
+ {
+ if (len >= IP_MAXPACKET)
+ {
+ if (tTd(8, 4))
+ sm_dprintf("dns_lookup: domain=%s, length=%d, default_size=%d, max=%d, status=response too long\n",
+ domain, len, (int) SMRBSIZE,
+ IP_MAXPACKET);
+ }
+ else
+ {
+ if (tTd(8, 6))
+ sm_dprintf("dns_lookup: domain=%s, length=%d, default_size=%d, max=%d, status=response longer than default size, resizing\n",
+ domain, len, (int) SMRBSIZE,
+ IP_MAXPACKET);
+ reply = (unsigned char *)sm_malloc(IP_MAXPACKET);
+ if (reply == NULL)
+ SM_SET_H_ERRNO(TRY_AGAIN);
+ else
+ len = res_search(domain, rr_class, rr_type,
+ reply, IP_MAXPACKET);
+ }
+ }
if (tTd(8, 16))
{
_res.options = old_options;
sm_dprintf("dns_lookup(%s, %d, %s) --> %d\n",
domain, rr_class, dns_type_to_string(rr_type), len);
}
- if (len >= 0)
+ if (len >= 0 && len < IP_MAXPACKET && reply != NULL)
r = parse_dns_reply(reply, len);
+ if (reply != (unsigned char *)&reply_buf && reply != NULL)
+ {
+ sm_free(reply);
+ reply = NULL;
+ }
if (retrans > 0)
_res.retrans = save_retrans;
if (retry > 0)
diff --git a/contrib/sendmail/src/srvrsmtp.c b/contrib/sendmail/src/srvrsmtp.c
index 49016e4..1e6a5d2 100644
--- a/contrib/sendmail/src/srvrsmtp.c
+++ b/contrib/sendmail/src/srvrsmtp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2008 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -17,7 +17,7 @@
# include <libmilter/mfdef.h>
#endif /* MILTER */
-SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.989 2009/12/18 17:08:01 ca Exp $")
+SM_RCSID("@(#)$Id: srvrsmtp.c,v 8.1008 2011/01/12 23:52:59 ca Exp $")
#include <sm/time.h>
#include <sm/fdset.h>
@@ -875,10 +875,8 @@ smtp(nullserver, d_flags, e)
/* XXX should these be options settable via .cf ? */
/* ssp.min_ssf = 0; is default due to memset() */
- {
- ssp.max_ssf = MaxSLBits;
- ssp.maxbufsize = MAXOUTLEN;
- }
+ ssp.max_ssf = MaxSLBits;
+ ssp.maxbufsize = MAXOUTLEN;
ssp.security_flags = SASLOpts & SASL_SEC_MASK;
sasl_ok = sasl_setprop(conn, SASL_SEC_PROPS, &ssp) == SASL_OK;
@@ -909,15 +907,6 @@ smtp(nullserver, d_flags, e)
#endif /* SASL */
#if STARTTLS
-# if USE_OPENSSL_ENGINE
- if (tls_ok_srv && bitset(SRV_OFFER_TLS, features) &&
- !SSL_set_engine(NULL))
- {
- sm_syslog(LOG_ERR, NOQID,
- "STARTTLS=server, SSL_set_engine=failed");
- tls_ok_srv = false;
- }
-# endif /* USE_OPENSSL_ENGINE */
set_tls_rd_tmo(TimeOuts.to_nextcommand);
@@ -1836,6 +1825,21 @@ smtp(nullserver, d_flags, e)
break;
}
starttls:
+# if USE_OPENSSL_ENGINE
+ if (!SSLEngineInitialized)
+ {
+ if (!SSL_set_engine(NULL))
+ {
+ sm_syslog(LOG_ERR, NOQID,
+ "STARTTLS=server, SSL_set_engine=failed");
+ tls_ok_srv = false;
+ message("454 4.3.3 TLS not available right now");
+ break;
+ }
+ else
+ SSLEngineInitialized = true;
+ }
+# endif /* USE_OPENSSL_ENGINE */
# if TLS_NO_RSA
/*
** XXX do we need a temp key ?
@@ -2260,8 +2264,7 @@ smtp(nullserver, d_flags, e)
message("250-AUTH %s", mechlist);
#endif /* SASL */
#if STARTTLS
- if (tls_ok_srv &&
- bitset(SRV_OFFER_TLS, features))
+ if (tls_ok_srv && bitset(SRV_OFFER_TLS, features))
message("250-STARTTLS");
#endif /* STARTTLS */
if (DeliverByMin > 0)
@@ -2622,7 +2625,7 @@ smtp(nullserver, d_flags, e)
goto rcpt_done;
}
- if (e->e_sendmode != SM_DELIVER
+ if (!SM_IS_INTERACTIVE(e->e_sendmode)
#if _FFR_DM_ONE
&& (NotFirstDelivery || SM_DM_ONE != e->e_sendmode)
#endif /* _FFR_DM_ONE */
@@ -3724,6 +3727,7 @@ smtp_data(smtp, e)
_res.retrans = TimeOuts.res_retrans[RES_TO_FIRST];
#endif /* NAMED_BIND */
+
for (ee = e; ee != NULL; ee = ee->e_sibling)
{
/* make sure we actually do delivery */
@@ -3767,18 +3771,18 @@ smtp_data(smtp, e)
oldid = CurEnv->e_id;
CurEnv->e_id = id;
- /* issue success message */
+ /* issue success message */
#if _FFR_MSG_ACCEPT
- if (MessageAccept != NULL && *MessageAccept != '\0')
- {
- char msg[MAXLINE];
+ if (MessageAccept != NULL && *MessageAccept != '\0')
+ {
+ char msg[MAXLINE];
- expand(MessageAccept, msg, sizeof(msg), e);
- message("250 2.0.0 %s", msg);
- }
- else
+ expand(MessageAccept, msg, sizeof(msg), e);
+ message("250 2.0.0 %s", msg);
+ }
+ else
#endif /* _FFR_MSG_ACCEPT */
- message("250 2.0.0 %s Message accepted for delivery", id);
+ message("250 2.0.0 %s Message accepted for delivery", id);
CurEnv->e_id = oldid;
/* if we just queued, poke it */
@@ -4687,7 +4691,8 @@ proxy_policy(conn, context, requested_user, rlen, auth_identity, alen,
return SASL_FAIL;
macdefine(&BlankEnvelope.e_macro, A_TEMP,
- macid("{auth_authen}"), (char *) auth_identity);
+ macid("{auth_authen}"),
+ xtextify((char *) auth_identity, "=<>\")"));
return SASL_OK;
}
diff --git a/contrib/sendmail/src/tls.c b/contrib/sendmail/src/tls.c
index 7031994..a57a05d 100644
--- a/contrib/sendmail/src/tls.c
+++ b/contrib/sendmail/src/tls.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2006, 2008, 2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2000-2006, 2008, 2009, 2011 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -10,7 +10,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: tls.c,v 8.114 2009/08/10 15:11:09 ca Exp $")
+SM_RCSID("@(#)$Id: tls.c,v 8.118 2011/03/07 23:20:47 ca Exp $")
#if STARTTLS
# include <openssl/err.h>
@@ -1168,7 +1168,7 @@ tls_get_info(ssl, srv, host, mac, certreq)
MACROS_T *mac;
bool certreq;
{
- SSL_CIPHER *c;
+ const SSL_CIPHER *c;
int b, r;
long verifyok;
char *s, *who;
@@ -1213,12 +1213,14 @@ tls_get_info(ssl, srv, host, mac, certreq)
macdefine(mac, A_TEMP, macid("{cert_issuer}"),
xtextify(buf, "<>\")"));
+# define LL_BADCERT 8
+
#define CHECK_X509_NAME(which) \
do { \
if (r == -1) \
{ \
sm_strlcpy(buf, "BadCertificateUnknown", sizeof(buf)); \
- if (LogLevel > 7) \
+ if (LogLevel > LL_BADCERT) \
sm_syslog(LOG_INFO, NOQID, \
"STARTTLS=%s, relay=%.100s, field=%s, status=failed to extract CN", \
who, \
diff --git a/contrib/sendmail/src/udb.c b/contrib/sendmail/src/udb.c
index 29470e7..22b198e 100644
--- a/contrib/sendmail/src/udb.c
+++ b/contrib/sendmail/src/udb.c
@@ -15,9 +15,9 @@
#include "map.h"
#if USERDB
-SM_RCSID("@(#)$Id: udb.c,v 8.164 2006/12/19 19:49:51 ca Exp $ (with USERDB)")
+SM_RCSID("@(#)$Id: udb.c,v 8.165 2010/01/10 06:22:00 ca Exp $ (with USERDB)")
#else /* USERDB */
-SM_RCSID("@(#)$Id: udb.c,v 8.164 2006/12/19 19:49:51 ca Exp $ (without USERDB)")
+SM_RCSID("@(#)$Id: udb.c,v 8.165 2010/01/10 06:22:00 ca Exp $ (without USERDB)")
#endif /* USERDB */
#if USERDB
@@ -1219,7 +1219,7 @@ _udbx_close()
# endif /* DB_VERSION_MAJOR < 2 */
}
if (tTd(28, 1))
- sm_dprintf("_udbx_init: db->close(%s)\n",
+ sm_dprintf("_udbx_close: db->close(%s)\n",
up->udb_dbname);
# endif /* NEWDB */
}
diff --git a/contrib/sendmail/src/usersmtp.c b/contrib/sendmail/src/usersmtp.c
index 23278b0..0de839e 100644
--- a/contrib/sendmail/src/usersmtp.c
+++ b/contrib/sendmail/src/usersmtp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2006, 2008, 2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2006, 2008-2010 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: usersmtp.c,v 8.473 2009/06/17 17:26:51 ca Exp $")
+SM_RCSID("@(#)$Id: usersmtp.c,v 8.485 2010/07/23 21:09:38 ca Exp $")
#include <sysexits.h>
@@ -33,7 +33,6 @@ extern void sm_sasl_free __P((void *));
** This protocol is described in RFC821.
*/
-#define REPLYCLASS(r) (((r) / 10) % 10) /* second digit of reply code */
#define SMTPCLOSING 421 /* "Service Shutting Down" */
#define ENHSCN(e, d) ((e) == NULL ? (d) : (e))
@@ -136,8 +135,7 @@ smtpinit(m, mci, e, onlyhelo)
SmtpPhase = mci->mci_phase = "client greeting";
sm_setproctitle(true, e, "%s %s: %s",
qid_printname(e), CurHostName, mci->mci_phase);
- r = reply(m, mci, e, TimeOuts.to_initial, esmtp_check, NULL,
- XS_DEFAULT);
+ r = reply(m, mci, e, TimeOuts.to_initial, esmtp_check, NULL, XS_GREET);
if (r < 0)
goto tempfail1;
if (REPLYTYPE(r) == 4)
@@ -183,7 +181,7 @@ tryhelo:
r = reply(m, mci, e,
bitnset(M_LMTP, m->m_flags) ? TimeOuts.to_lhlo
: TimeOuts.to_helo,
- helo_options, NULL, XS_DEFAULT);
+ helo_options, NULL, XS_EHLO);
if (r < 0)
goto tempfail1;
else if (REPLYTYPE(r) == 5)
@@ -336,7 +334,15 @@ str_union(s1, s2, rpool)
l1 = strlen(s1);
l2 = strlen(s2);
rl = l1 + l2;
- res = (char *) sm_rpool_malloc(rpool, rl + 2);
+ if (rl <= 0)
+ {
+ sm_syslog(LOG_WARNING, NOQID,
+ "str_union: stringlen1=%d, stringlen2=%d, sum=%d, status=overflow",
+ l1, l2, rl);
+ res = NULL;
+ }
+ else
+ res = (char *) sm_rpool_malloc(rpool, rl + 2);
if (res == NULL)
{
if (l1 > l2)
@@ -409,9 +415,7 @@ helo_options(line, firstline, m, mci, e)
if (firstline)
{
-#if SASL
- mci->mci_saslcap = NULL;
-#endif /* SASL */
+ mci_clr_extensions(mci);
#if _FFR_IGNORE_EXT_ON_HELO
logged = false;
#endif /* _FFR_IGNORE_EXT_ON_HELO */
@@ -472,7 +476,8 @@ helo_options(line, firstline, m, mci, e)
#if SASL
else if (sm_strcasecmp(line, "auth") == 0)
{
- if (p != NULL && *p != '\0')
+ if (p != NULL && *p != '\0' &&
+ !bitset(MCIF_AUTH2, mci->mci_flags))
{
if (mci->mci_saslcap != NULL)
{
@@ -484,7 +489,7 @@ helo_options(line, firstline, m, mci, e)
mci->mci_saslcap = str_union(mci->mci_saslcap,
p, mci->mci_rpool);
- mci->mci_flags |= MCIF_AUTH;
+ mci->mci_flags |= MCIF_AUTH2;
}
else
{
@@ -501,6 +506,9 @@ helo_options(line, firstline, m, mci, e)
}
}
}
+ if (tTd(95, 5))
+ sm_syslog(LOG_DEBUG, NOQID, "AUTH flags=%lx, mechs=%s",
+ mci->mci_flags, mci->mci_saslcap);
}
#endif /* SASL */
}
@@ -1606,13 +1614,11 @@ attemptauth(m, mci, e, sai)
(void) memset(&ssp, '\0', sizeof(ssp));
/* XXX should these be options settable via .cf ? */
- {
- ssp.max_ssf = MaxSLBits;
- ssp.maxbufsize = MAXOUTLEN;
+ ssp.max_ssf = MaxSLBits;
+ ssp.maxbufsize = MAXOUTLEN;
# if 0
- ssp.security_flags = SASL_SEC_NOPLAINTEXT;
+ ssp.security_flags = SASL_SEC_NOPLAINTEXT;
# endif /* 0 */
- }
saslresult = sasl_setprop(mci->mci_conn, SASL_SEC_PROPS, &ssp);
if (saslresult != SASL_OK)
return EX_TEMPFAIL;
@@ -2175,7 +2181,7 @@ smtpmailfrom(m, mci, e)
SmtpPhase = mci->mci_phase = "client MAIL";
sm_setproctitle(true, e, "%s %s: %s", qid_printname(e),
CurHostName, mci->mci_phase);
- r = reply(m, mci, e, TimeOuts.to_mail, NULL, &enhsc, XS_DEFAULT);
+ r = reply(m, mci, e, TimeOuts.to_mail, NULL, &enhsc, XS_MAIL);
if (r < 0)
{
/* communications failure */
@@ -2427,7 +2433,7 @@ smtprcptstat(to, m, mci, e)
}
enhsc = NULL;
- r = reply(m, mci, e, TimeOuts.to_rcpt, NULL, &enhsc, XS_DEFAULT);
+ r = reply(m, mci, e, TimeOuts.to_rcpt, NULL, &enhsc, XS_RCPT);
save_errno = errno;
to->q_rstatus = sm_rpool_strdup_x(e->e_rpool, SmtpReplyBuffer);
to->q_status = ENHSCN_RPOOL(enhsc, smtptodsn(r), e->e_rpool);
@@ -2588,7 +2594,7 @@ smtpdata(m, mci, e, ctladdr, xstart)
mci->mci_state = MCIS_DATA;
sm_setproctitle(true, e, "%s %s: %s",
qid_printname(e), CurHostName, mci->mci_phase);
- r = reply(m, mci, e, TimeOuts.to_datainit, NULL, &enhsc, XS_DEFAULT);
+ r = reply(m, mci, e, TimeOuts.to_datainit, NULL, &enhsc, XS_DATA);
if (r < 0 || REPLYTYPE(r) == 4)
{
if (r >= 0)
@@ -2722,7 +2728,7 @@ smtpdata(m, mci, e, ctladdr, xstart)
CurHostName, mci->mci_phase);
if (bitnset(M_LMTP, m->m_flags))
return EX_OK;
- r = reply(m, mci, e, TimeOuts.to_datafinal, NULL, &enhsc, XS_DEFAULT);
+ r = reply(m, mci, e, TimeOuts.to_datafinal, NULL, &enhsc, XS_EOM);
if (r < 0)
return EX_TEMPFAIL;
if (mci->mci_state == MCIS_DATA)
@@ -2807,7 +2813,7 @@ smtpgetstat(m, mci, e)
enhsc = NULL;
/* check for the results of the transaction */
- r = reply(m, mci, e, TimeOuts.to_datafinal, NULL, &enhsc, XS_DEFAULT);
+ r = reply(m, mci, e, TimeOuts.to_datafinal, NULL, &enhsc, XS_DATA2);
if (r < 0)
return EX_TEMPFAIL;
xstat = EX_NOTSTICKY;
@@ -2893,8 +2899,7 @@ smtpquit(m, mci, e)
SmtpPhase = "client QUIT";
mci->mci_state = MCIS_QUITING;
smtpmessage("QUIT", m, mci);
- (void) reply(m, mci, e, TimeOuts.to_quit, NULL, NULL,
- XS_DEFAULT);
+ (void) reply(m, mci, e, TimeOuts.to_quit, NULL, NULL, XS_QUIT);
SuprErrs = oldSuprErrs;
if (mci->mci_state == MCIS_CLOSED)
goto end;
@@ -3233,14 +3238,17 @@ reply(m, mci, e, timeout, pfunc, enhstat, rtype)
if (pfunc != NULL)
(*pfunc)(bufp, firstline, m, mci, e);
- firstline = false;
-
/* decode the reply code */
r = atoi(bufp);
/* extra semantics: 0xx codes are "informational" */
if (r < 100)
+ {
+ firstline = false;
continue;
+ }
+
+ firstline = false;
/* if no continuation lines, return this line */
if (bufp[3] != '-')
diff --git a/contrib/sendmail/src/version.c b/contrib/sendmail/src/version.c
index cb94d0f..4f156c2 100644
--- a/contrib/sendmail/src/version.c
+++ b/contrib/sendmail/src/version.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,6 +13,6 @@
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: version.c,v 8.218 2009/12/23 04:43:09 ca Exp $")
+SM_RCSID("@(#)$Id: version.c,v 8.227 2011/04/26 23:02:35 ca Exp $")
-char Version[] = "8.14.4";
+char Version[] = "8.14.5";
diff --git a/contrib/lukemftp/COPYING b/contrib/tnftp/COPYING
index 31acb74..064be2d 100644
--- a/contrib/lukemftp/COPYING
+++ b/contrib/tnftp/COPYING
@@ -1,4 +1,10 @@
-Copyright 1999, 2000 Luke Mewburn <lukem@netbsd.org>. All rights reserved.
+$NetBSD: COPYING,v 1.7 2010/01/12 07:01:01 lukem Exp $
+
+Copyright (c) 2001-2010 The NetBSD Foundation, Inc.
+All rights reserved.
+
+This code is derived from software contributed to The NetBSD Foundation
+by Simon Burge, Luke Mewburn, and Christos Zoulas.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -10,20 +16,24 @@ are met:
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 Luke Mewburn.
-4. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ 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.
+
This product also contains software developed by other people, and you
are advised to read the various source files to read the full details
@@ -32,11 +42,13 @@ acknowledgements:
This product includes software developed by the NetBSD Foundation,
Inc. and its contributors. Those contributors include:
+ - Simon Burge
- Jaromir Dolecek
- Klaus Klein
- Luke Mewburn
- Jason R. Thorpe of the Numerical Aerospace Simulation
Facility, NASA Ames Research Center.
+ - Christos Zoulas
This product includes software developed by the University of
California, Berkeley and its contributors. Those contributors include:
diff --git a/contrib/lukemftp/ChangeLog b/contrib/tnftp/ChangeLog
index 8bdbb45..7674925 100644
--- a/contrib/lukemftp/ChangeLog
+++ b/contrib/tnftp/ChangeLog
@@ -1,3 +1,713 @@
+$NetBSD: ChangeLog,v 1.58 2010/01/12 06:58:57 lukem Exp $
+
+Tue Jan 12 06:58:15 UTC 2010 lukem
+
+ * Release as "tnftp 20100108"
+
+ * Rename onoff() argument "bool" to "val".
+
+Tue Jan 5 09:12:01 UTC 2010 lukem
+
+ * If ARG_MAX isn't defined, use the result from sysconf(_SC_ARG_MAX).
+ Fixes build when using newer glibc.
+
+ * Add libnetbsd.la to the LIBADD for libedit.
+ Fix provided by Adam Sampson.
+
+Mon Jan 4 06:28:07 UTC 2010 lukem
+
+ * Distribute various files not shipped by default automake rules,
+ to use 'make dist' instead of 'cvs export'.
+
+Wed Dec 30 00:12:47 UTC 2009 lukem
+
+ * Release as "tnftp 20091122"
+
+Sun Nov 15 10:14:44 UTC 2009 lukem
+
+ * Merge NetBSD ftp from 20090520 to 20090915. Change:
+ - Rename internal getline() to get_line() to avoid
+ conflict with libc with former.
+ - Avoid a NULL dereference in an error message.
+
+Sat Nov 14 09:21:19 UTC 2009 lukem
+
+ * Convert to automake & libtool.
+
+Sat Jun 6 07:17:38 UTC 2009 lukem
+
+ * Release as "tnftp 20090606"
+
+Fri May 22 01:11:15 UTC 2009 lukem
+
+ * configure fixes:
+ - Add the time.h headers to accheck_includes, for the strptime check.
+ - Remove the check for el_init in libedit; we're always replacing
+ the library and the presence of strvis() in some versions
+ confuses other checks.
+
+Wed May 20 13:47:43 UTC 2009 lukem
+
+ * Release as "tnftp 20090520"
+
+ * Merge NetBSD ftp from 20070722 to 20090520. Changes:
+ - Only attempt to el_parse() a command unknown by the default
+ parser if editing is enabled.
+ Fixes PR 38589.
+ - Turn off the alarmtimer before resetting the SIGALRM handler
+ back to SIG_DFL.
+ Fixes PR 35630.
+ - Add epsv6 and epsv to disable extended passive mode for ipv6 or
+ both ipv4 and ipv6 respectively. This hack is due to our
+ friends a Juniper Networks who break epsv in ipv6.
+ Should be fixed in ScreenOS 6.2.X.
+ - Improve parsing of chunked transfer chunks per RFC2616:
+ - more stringent chunk-size parsing
+ - ignore optional trailing ';chunk-ext' stuff, instead of barfing
+ - detect EOF before final \r\n.
+ - Use the service name to getaddrinfo() (along with the host
+ name), so that features such as DNS Service Discovery have a
+ better chance of working.
+ Display the service name in various status & error messages.
+ - Don't getservbyname() the :port component of a URL; RFC 3986
+ says it's just an unsigned number, not a service name.
+ - Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare).
+ - Fix -Wshadow issues
+ - Update copyrights
+ - Remove clause 3 and 4 from TNF licenses
+ - Rename HAVE_STRUCT_SOCKADDR_SA_LEN to
+ HAVE_STRUCT_SOCKADDR_IN_SIN_LEN to accurately reflect the
+ structure member being used.
+ - Use AF_INET instead of AF_UNSPEC as the default family if
+ !defined(INET6).
+
+ * configure improvements:
+ - Style tweaks.
+ - Use AC_LANG_PROGRAM() instead of AC_LANG_SOURCE()
+ - Add a check for strptime() requiring separators between
+ conversions, and use our replacement one if it does.
+
+Sat Dec 20 15:28:24 UTC 2008 lukem
+
+ * configure improvements:
+ - Move IPv6 check from tnftp.h to configure.ac (as per tnftpd).
+ - Rework option descriptions.
+ - Highlight when tests are for a specific option.
+ - Move configuration results to the end of the file.
+ - Display $prefix in configure results.
+
+Fri Aug 15 03:03:36 UTC 2008 lukem
+
+ * Add a "Configuration results" display at the end of configure.
+ Cosmetic tweaks.
+
+Fri Feb 29 09:45:56 UTC 2008 lukem
+
+ * Support @EXEEXT@ for Cygwin (etc).
+
+Mon Aug 6 04:55:19 UTC 2007 lukem
+
+ * Release as "tnftp 20070806"
+
+ * Add a NEWS file.
+
+ * Reduce differences between NetBSD-ftp and local copy.
+
+ * Merge NetBSD ftp from 20070605 to 20070722.
+ Changes:
+ - Document about:ftp and about:version.
+
+ * Add autoconf check for (Dante) SOCKS5.
+ (Needs run-time testing and more portability testing.)
+
+Mon Jul 23 11:44:42 UTC 2007 lukem
+
+ * Don't use non-standard: u_char u_short u_int.
+ Use uint32_t instead of u_int32_t.
+
+ * Consistently use AS_CASE() and AS_IF() in configure.ac.
+
+ * Don't use defined() with HAVE_DECL_xxx.
+ Use `LL' instead of `L' suffix for fallback
+ defines of LLONG_MIN and LLONG_MAX.
+
+Sun Jul 22 12:00:17 UTC 2007 lukem
+
+ * Include <arpa/nameser.h> if available, and provide fallback #defines.
+
+ * Sync with lib/libc/inet/inet_pton.c 1.3:
+ * Sync to bind 9.3.x version
+ * Update ISC copyright
+ * Fix some lint
+
+ * Sync with lib/libc/inet/inet_ntop.c 1.3:
+ * Sync to bind 9.3.x version
+ * Update ISC copyright
+ * Use socklen_t instead of size_t
+ * Use snprintf() instead of SPRINTF()
+ * Improve detection of various boundary conditions
+
+ * Sync to NetBSD glob.h 1.21, glob.c 1.16:
+ * Standards compliance fix
+ * De-lint
+ * Don't overflow when DEBUG is defined.
+
+ * Sync fgetln.c to tools/compat/fgetln.c 1.7:
+ * Clause 3 removal.
+
+ * Sync to config.guess 2007-07-22, config.sub 2007-06-28.
+
+ * Consistency tweaks in configure help strings.
+
+ * Add check for struct sockaddr.sa_len.
+ Change tests for HAVE_foo to defined(HAVE_foo).
+ Replace HAVE_SOCKADDR_SA_LEN with HAVE_STRUCT_SOCKADDR_SA_LEN.
+
+ * Remove pretence of supporting SOCKS for now;
+ no test system is available, and the old
+ autoconf 2.13 support wasn't upgraded to 2.61.
+
+ * configure.ac style consistency tweaks.
+ Move autoconf aux files from ./ to build-aux/
+
+ * Remove duplicate HAVE_STRERROR replacement in tnftp.h.
+
+Thu Jun 7 04:47:47 UTC 2007 lukem
+
+ * Merge NetBSD ftp from 20070510 to 20070605. Changes:
+ - Enforce restriction that (http) proxied URL fetchs don't
+ support being restarted at this time.
+ Addresses NetBSD Problem Report 28697.
+ - Display times in RFC2822 form rather than using ctime(3),
+ since the former is more explicit about the timezone offset.
+ - main: call tzset() to ensure TZ is setup for other <time.h>
+ functions.
+ - remotemodtime(): use strptime() to parse the reply.
+ - fetch_url(): ensure struct tm is zeroed before calling
+ strptime().
+ - Modify parse_url() to consistently strip the leading `/'
+ off ftp URLs.
+ Fixes NetBSD Problem Report 17617.
+ - Use 'RFCnnnn' (with leading 0) instead of 'RFC nnnn', to be
+ consistent with the style in the RFC index.
+ - Refer to RFC3916 instead of 1738 or 2732.
+ - Expand the list of supported RFCs in ftp(1) to contain the
+ document name as well.
+
+Fri May 11 04:39:55 UTC 2007 lukem
+
+ * Update INSTALL and COPYING.
+
+ * Rename HAVE_QUAD_SUPPORT to HAVE_PRINTF_LONG_LONG, and only
+ require support for 'long long' in that check rather than
+ needing sizeof(off_t)>=8, as some systems have a separate
+ off64_t when Large File Support is enabled.
+
+ * config.guess: treat 'i86xen:SunOS:5.*' as 'i86pc:SunOS:5.*'
+
+Thu May 10 15:23:33 UTC 2007 lukem
+
+ * Remove checks for util.h and libutil.h, and replacement for
+ fparseln(), since fparseln() isn't used any more.
+
+ * Merge NetBSD ftp from 20070418 to 20070510. Changes:
+ - Switch from fparseln() to the internal getline() when
+ parsing HTTP headers. Makes ftp a bit more portable
+ (not needing fparseln()) at the expense of not supporting
+ arbitrary long header lines, which I'm not concerned about
+ because we don't support header line continuation either...
+ - Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659.
+ - Fix misplaced const.
+ - Implement copy_bytes() to copy bytes from one fd to another
+ via the provided buffer, with optional rate-limiting and
+ hash-mark printing, using one loop and handle short writes.
+ Refactor sendrequest() and recvrequest() to use copy_data().
+ Addresses NetBSD Problem Report 15943.
+
+Wed May 9 05:24:55 UTC 2007 lukem
+
+ * Fix typo in poll()-based implementation of usleep() replacement.
+
+Wed May 9 04:58:50 UTC 2007 lukem
+
+ * Rename configure.in to configure.ac, as the latter is the
+ preferred name in autoconf 2.61.
+
+ * Convert from autoconf 2.13 to 2.61:
+ * Use a consistent quoting mechanism.
+ * Use modern autoconf macros, #define names, etc.
+ * Search for more header files, and only #include if found.
+ * Remove old-style config.h.in generation.
+ This may fix various tests on platforms such as FreeBSD and OS X.
+
+ * Add -Wl,-search_paths_first to LDFLAGS on OS X (Darwin) if the
+ linker supports it. This is needed so we use our libedit
+ rather than the system one.
+
+ XXX: SOCKS support is currently disabled until I update the
+ autoconf support.
+
+Mon Apr 23 06:04:26 UTC 2007 lukem
+
+ * Merge NetBSD ftp from 20050610 to 20070418. Changes:
+ - Add '-s srcaddr'.
+ - Use IEC 60027-2 2^N based "KiB", "MiB" (etc) instead of
+ 10^n "KB", "MB", ...
+ - Recognize 307 redirect code.
+ - Suppress printing non-COMPLETE reply strings when EPSV/EPRT
+ fails and we fall-back to PASV/PORT. Should fix a problem
+ with the emacs ftp wrapper.
+ - Fix display of 'Continue with <cmd>' messages.
+ - Prevent segfaults in .netrc parsing.
+ - Flush stdout before each command; ftp as slave process on
+ a pipe should work.
+ - getpass() can return NULL in some implementations; cope.
+ - Support '-q quittime' when waiting for server replies.
+ - Various spelling & grammatical fixes in the manual.
+ - Plug some memory leaks.
+ - If a file upload (via -u) fails, return an non-zero exit
+ value based on the index of the file that caused the
+ problem (a la auto-fetch retrieval).
+ - Coverity fixes for CIDs: 873 874 875 1447 1448 2194 2195 3610
+ - Don't remove trailing character during auth_url()
+ - Fix progressbar display on narrow terminals (<43 columns)
+
+Fri Mar 16 06:00:14 UTC 2007 lukem
+
+ * Change the return value of the replacement gai_strerror()
+ from "char *" to "const char *", to match the current
+ standards.
+ Problem noted by Thomas Klausner.
+
+Thu Oct 26 07:24:22 UTC 2006 lukem
+
+ * Correctly parse "AM" and "PM" in the replacement strptime().
+ Problem noted by Kathryn Hogg.
+
+Sat Jun 25 06:27:00 UTC 2005 lukem
+
+ * Release as "tnftp 20050625"
+
+ * Simplify the detection & replacement of dirname() and fparseln()
+ and just use AC_REPLACE_FUNCS.
+ (We don't care if the vendor has a working version in -lgen or -lutil
+ instead of -lc; they'll get our replacement version in that case).
+ Fixes build issue on older Darwin where the previous autoconf check
+ wouldn't find dirname() in the default system libraries.
+
+ * Only provide a prototype for dirname() if we can't find one in
+ <libgen.h>
+
+ * Search for NS_IN6ADDRSZ instead of IN6ADDRSZ, since we use the
+ former and not the latter and older Darwin has the former.
+ (This allows INET6 support to be enabled on Darwin 7.9.0)
+
+Mon Jun 13 09:22:13 UTC 2005 lukem
+
+ * Tweak SOCKS5 support:
+ acconfig.h:
+ - fix a comment
+ - ensure close() is replaced
+ - list entries in the same order as aclocal.m4
+ (and the SOCKS5 FAQ)
+ aclocal.m4:
+ - ensure getpeername() is replaced
+ - don't replace listen() twice
+
+Fri Jun 10 04:39:33 UTC 2005 lukem
+
+ * Release as "tnftp 20050610"
+
+ * Add dependencies on ${srcdir}/../tnftp.h and ../config.h
+
+ * Merge NetBSD ftp from 20050609 to 20050610. Changes:
+ - Implement getline() to read a line into a buffer.
+ - Convert to use getline() instead of fgets() whenever reading
+ user input to ensure that an overly long input line doesn't
+ leave excess characters for the next input operation to
+ accidentally use as input.
+ - Zero out the password & account after we've finished with it.
+ - Consistently use getpass(3) (i.e, character echo suppressed)
+ when reading the account data. For some reason, historically
+ the "login" code suppressed echo for Account: yet the "user"
+ command did not!
+ - Display the hostname in the "getaddrinfo failed" warning.
+ - Appease some -Wcast-qual warnings. Fixing all of these
+ requires significant code refactoring. (mmm, legacy code).
+
+Thu Jun 9 16:49:05 UTC 2005 lukem
+
+ * src, libnetbsd: Excise RCSID block, rather than using
+ #if 0 ... #endif. The point was to minimise RCSID
+ conflicts, and the latter isn't helping there.
+
+ * Merge NetBSD ftp from 20050531 to 20050609. Changes:
+ - Only print the "Trying <address>..." message if verbose
+ and there's more than one struct addrinfo in the
+ getaddrinfo() result.
+ - Don't use non-standard "u_int".
+
+Wed Jun 1 15:08:01 UTC 2005 lukem
+
+ * Look for dirname(3), which may be in -lgen on IRIX, and
+ replace it if not found..
+
+Wed Jun 1 11:48:58 UTC 2005 lukem
+
+ * libnetbsd:
+ - Don't use non-standard: u_char u_short u_int.
+ - Use uint32_t instead of u_int32_t.
+ - Don't use register.
+
+ * libedit: Don't use non-standard uint or u_int.
+
+Tue May 31 02:23:08 UTC 2005 lukem
+
+ * tnftp.h: need <libgen.h> for dirname(3)
+
+ * Merge ftp from 20050513 to 20050531. Changes:
+ - Helps if the definition of xconnect() matches its
+ declaration....
+ - Fix some cast issues highlighted by Scott Reynolds using
+ gcc 4 on OSX.4
+ - Use size_t instead of int where appropriate.
+ - Make this compile on sparc64 (size_t != int).
+ - Printf field widths and size_t don't always mix well, so
+ cast to int. Fixes build problem for alpha.
+ - Some const cleanups.
+ - tab cleanup
+ - Improve method used in fileindir() to determine if `file'
+ is in or under `dir': realpath(3) on non-NetBSD systems may
+ fail if the target filename doesn't exist, so instead use
+ realpath(3) on the parent directory of `file'.
+ Per discussion with Todd Eigenschink.
+ - formatbuf(): fix %m and %M to use the hostname, not the
+ username.
+ - fetch_ftp(): preserve 'anonftp' across a disconnect() so
+ that multiple ftp auto-fetches on the same command line
+ login automatically.
+ - auto_fetch(): use an initialized volatile int to appease
+ IRIX cc.
+
+ * Merge libedit from NetBSD 20050105 to 20050531. Changes include:
+ - Rui Paulo: Incorrect tok_line and tok_str declarations.
+ - Remove clause 3 from the UCB license.
+ - Luke Mewburn: Don't abuse unconstify'ing a string
+ and writing to it, because you'll core dump. Also remove
+ extra const that gives pain to the irix compiler.
+ - Make sure we flush after we prepare when we are unbuffered
+ otherwise the prompt will not appear immediately.
+ - Terminate the arglist with a NULL instead of 0.
+ (Shuts up gcc4.x)
+
+Sat May 28 13:19:38 UTC 2005 lukem
+
+ * libnetbsd/strvis.c:
+ - Sync to NetBSD's vis.c 1.33:
+ Use malloc(3) instead of alloca(3).
+ - Remove extraenous #endif
+
+Fri May 27 05:46:58 UTC 2005 lukem
+
+ * libnetbsd/strvis.c: Sync to NetBSD's vis.c 1.30:
+ Use a more standard TNF license.
+
+ * libedit/sig.c: Include "src/progressbar.h" for xsignal_restart()
+ prototype.
+
+ * Ensure that fallback #define of __attribute__ is available.
+ Fixes build problem on HP-UX with cc.
+
+Thu May 26 14:21:08 UTC 2005 lukem
+
+ * Extend xpoll()'s HAVE_SELECT implementation to support POLLRDNORM,
+ POLLWRNORM, and POLLRDBAND - the latter using exceptfds.
+ Per discussion with Christos Zoulas.
+
+Mon May 16 13:33:27 UTC 2005 lukem
+
+ * Pull in <poll.h> or <sys/poll.h> if they exist even if we're
+ not using poll, as struct pollfd might exist in those.
+ Fixes build problem on OSX.3.
+
+ * Separate CPPFLAGS from CFLAGS.
+
+ * Sync various files in libnetbsd with the original versions
+ in NetBSD. Notable changes
+ - Convert 4 clause UCB license to 3 clause.
+ - Use strlcpy instead of strcpy.
+ - Update ISC copyright.
+ - Use NS_INADDRSZ, NS_IN6ADDRSZ and NS_INT16SZ instead of
+ equivalents without NS_ prefix.
+ - Use socklen_t instead of size_t where appropriate.
+ - Improve bounds checking.
+ - Don't update the size of allocated storage until
+ realloc succeeds.
+ - Fix comment about return value.
+ - Reverse the order of two loop invariant to make
+ 'strlcat(0, "foo", 0)' not get a SEGV.
+ - Use Todd C. Miller's latest copyright notice (more loose).
+ - Use "long long" instead of "quad" in various
+ comments & constants.
+ - Support VIS_HTTPSTYLE.
+ - Implement svis(), strsvis(), strsvisx(), strunvisx().
+
+ * Prefer poll over select when implementing replacement usleep().
+
+Sat May 14 04:44:35 UTC 2005 lukem
+
+ * Release "tnftp 20050514"
+
+ * Fail if we can't find a library with tgetent (needed for libedit).
+ NetBSD PR pkg/28925.
+ * Improve quoting when using various autoconf macros.
+
+ * Merge NetBSD-ftp 20050513:
+ - Correct the "optlen" argument passed to getsockopt(3) and
+ setsockopt(3) in various places. Fixes a problem noted by
+ Allen Briggs.
+ - Improve warning printed when connect(2) for the data
+ channel fails.
+
+Wed May 11 04:19:43 UTC 2005 lukem
+
+ * Release "tnftp 20050511"
+
+Wed May 11 04:10:01 UTC 2005 lukem
+
+ * Update the THANKS file.
+
+ * Only use poll() to implement xpoll() if it's available,
+ otherwise attempt to use select() if that's available,
+ otherwise #error.
+
+ * Detect if struct pollfd is available in <poll.h> or <sys/poll.h>.
+ Improve consistency in use of autoconf macros.
+
+Wed May 11 02:42:08 UTC 2005 lukem
+
+ * Merge NetBSD-ftp 20050511:
+ - Use socklen_t instead of int as the 5th argument to
+ getsockopt(). Improve invocation of setsockopt() and
+ associated failure messages.
+
+Wed May 11 01:46:29 UTC 2005 lukem
+
+ * Clean up RCSID usage in vendor-derived code, restoring original
+ IDs where possible.
+
+Wed May 11 00:08:16 UTC 2005 lukem
+
+ * Merge NetBSD-ftp 20050510:
+ - Prevent an overly-long input line causing a core dump when
+ editing is enabled.
+ Issue noted by Ryoji Kanai in FreeBSD Problem Report # 77158.
+ - Implement a timeout on the accept(2) in dataconn() and the
+ connect(2) in xconnect() by temporarily setting O_NONBLOCK
+ on the socket and using xpoll() to wait for the operation
+ to succeed. The timeout used is the '-q quittime' argument
+ (defaults to 60s for accept(2), and the system default for
+ connect(2)). Idea inspired by discussion with Chuck Cranor.
+ This may (indirectly) fix various problems with timeouts in
+ active mode through broken firewalls.
+ - Implement xpoll() as a wrapper around poll(2), to make it
+ easier to replace on systems without a functional poll(2).
+ Unconditionally use xpoll() instead of conditionally using
+ select(2) or poll(2).
+ - In fetch_url(), don't call freeaddrinfo(res0) too early, as
+ we use pointers to its contents later in the function.
+ Problem found by Onno van der Linden.
+ - Fix ftp url reget when globs are being used.
+ Provided by Mathieu Arnold <mat@FreeBSD.org>.
+ - Factor out common string processing code eliminating static
+ buffers, making functions that should be static be static,
+ and cleaning up const usage. Added a guard against buffer
+ overflow, but the domap function is a bit too complicated
+ to tackle right now.
+ - Clean up whitespace.
+ - Expand description of http_proxy by suggesting the use of
+ RFC 1738 '%xx' encoding for "unsafe URL" characters in
+ usernames and passwords.
+
+Wed Jan 5 05:53:59 UTC 2005 lukem
+
+ * For now, assume libedit is not up-to-date and use our own version.
+
+ * Merge libedit from NetBSD 20020605 to 20050105. Changes include:
+ - Improve vi-mode.
+ - Delete-previous-char and delete-next-char without an
+ argument are not supposed to modify the yank buffer in
+ emacs-mode.
+ - Improve incremental searching.
+ - Improve memory allocation & usage.
+ - Move UCB-licensed code from 4-clause to 3-clause.
+ - Make the tokenization functions publically available.
+ - Various tty access bug-fixes.
+ - Improve readline emulation.
+
+Tue Jan 4 13:33:40 UTC 2005 lukem
+
+ * Unixware 7.1.1 implements RFC 2133 (Basic Socket Interface
+ Extensions for IPv6) but not the successor RFC 2553. The configure
+ script detects this and decides that tnftp needs to compile its own
+ version of getaddrinfo(). This produces the error message
+ /usr/include/netdb.h:248: `getaddrinfo' previously defined here
+ because Unixware provides an implementation of getaddrinfo() in
+ netdb.h instead of a prototype declaration :-/. Since netdb.h
+ cannot be omitted, we will always get this definition and tnftp's
+ version of getaddrinfo will always create a conflict. This ugly
+ preprocessor hack works around the problem. Hints for a better
+ solution welcome. Fix from pkgsrc/net/tnftp.
+
+ * Workaround poll() being a compatibility function on Darwin 7
+ (MacOSX 10.3) by adding a custom test for _POLL_EMUL_H_ which
+ is defined in poll.h on some MacOSX 10.3 systems. Not all 10.3
+ systems have poll.h, so only do the poll() test if at least one
+ of the header files is found. Fix from pkgsrc/net/tnftp.
+
+ * Add a utimes() replacement (using utime()) for Interix.
+ From pkgsrc/net/tnftp.
+
+Mon Jan 3 10:21:57 UTC 2005 lukem
+
+ * Release "tnftp 20050103"
+
+ * Merge NetBSD-ftp 20050103:
+ - Forbid filenames returned from mget that aren't in (or below)
+ the current directory. The previous behaviour (of trusting
+ the remote server's response when retrieving the list of
+ files to mget with prompting disabled) has been in ftp
+ ~forever, and has been a "known issue" for a long time.
+ Recently an advisory was published by D.J. Bernstein on
+ behalf of Yosef Klein warning of the problems with the
+ previous behaviour, so to alleviate concern I've fixed
+ this with a sledgehammer.
+ - Remember the local cwd after any operation which may
+ change it.
+ - Use "remotecwd" instead of "remotepwd".
+ - Add (unsigned char) cast to ctype functions
+ - Ensure that "mname" is set in ls() and mls() so that an
+ aborted confirm() prints the correct name.
+ Problem highlighted & suggested fix from PR [bin/17766]
+ by Steve McClellan.
+ - If an ftp auto-fetch transfer is interrupted by SIGINT
+ (usually ^C), exit with 130 instead of 1 (or rarely, 0).
+ This allows an ftp auto-fetch in a shell loop to correctly
+ terminate the loop.
+ Should fix PR [pkg/26351], and possibly others.
+ - Save approximately 8K by not including http authentication,
+ extended status messages and help strings when the
+ appropriate options are set.
+ - Move UCB-licensed code from 4-clause to 3-clause licence.
+ Patches provided by Joel Baker in PR 22365, verified by
+ Alistair Crooks.
+ - Always decode %xx in a url's user & pass components.
+ - Only remember {WWW,Proxy}-Authenticate "Basic" challenges; no
+ point in tracking any others since ftp doesn't support them.
+ - Improve the parsing of HTTP responses.
+ - Don't base64 encode the trailing NUL in the HTTP basic auth
+ response. Problem noted by Eric Haszlakiewicz.
+ - Improve parsing of HTTP response headers to be more RFC2616
+ compliant, and skip LWS (linear white space; CR, LF, space,
+ tab) and the end of lines and between the field name and
+ the field value. This still isn't 100% compliant, since we
+ don't support "multi line" responses at this time.
+ This should fix PR [bin/22611] from TAMURA Kent (although I
+ can't easily find a http server to reproduce the problem
+ against.)
+ - Fix a minor memory leak when parsing HTTP response headers.
+ - Don't unnecessarily display a 401/407 error when running
+ with -V. Fix from PR [bin/18535] by Jeremy Reed.
+ - Don't warn about "ignored setsockopt" failures unless
+ debugging is enabled. Suggested by Todd Vierling.
+ - Allow empty passwords in ftp://user:@host/file auto-fetch
+ URLs, per RFC 1738. Requested by Simon Poole.
+ - correct URL syntax in comment
+ - Note potentially surprising file-saving behaviour in case
+ of HTTP redirects
+ - -n is ignored for auto-fetch transfers
+ - If connect(2) in xconnect() fails with EINTR, call select(2)
+ on the socket until it's writable or it fails with something
+ other than EINTR. This matches the behaviour in SUSv3, and
+ prevents the problem when pressing ^T (SIGINFO, which is
+ marked as restartable) during connection setup would cause
+ ftp to fail with EADDRINUSE or EALREADY when the second
+ connect(2) was attempted on the same socket. Problem found
+ and solution provided by Maxime Henrion <mux@freebsd.org>.
+ - Add -q to usage. From Kouichirou Hiratsuka in PR 26199.
+ - PR/25566: Anders Magnusson: ftp(1) do not like large TCP
+ windows. Limit it to 8M.
+
+Mon Oct 6 01:23:03 UTC 2003 lukem
+
+ * configure.in improvements:
+ - When testing for IN6ADDRSZ in <arpa/nameser.h>, pull in
+ <sys/types.h> first. From Stoned Elipot <seb @ NetBSD>
+ - Whitespace cleanup
+
+Mon Aug 25 11:45:45 UTC 2003 lukem
+
+ * Release "tnftp 20030825"
+
+ * Add autoconf test for <sys/syslimits.h>; Cygwin needs it for ARG_MAX.
+ Per discussion with Eugene Kotlyarov <ekot@protek36.esoo.ru>.
+
+Thu Jul 31 07:30:00 UTC 2003 lukem
+
+ * release "tnftp 20030731"
+
+ * merge ftp from NetBSD 20030731 to 20030731b:
+ - Work around broken ftp servers (notably ProFTPd) that can't
+ even follow RFC 2389, and skip any amount of whitespace
+ before a FEATure response. The RFC says 'single space' yet
+ ProFTPd puts two. Noted by DervishD <raul@pleyades.net>.
+ - Improve formatting of features[] debug dump.
+ - Invalidate remote directory completion cache if any command
+ which may change the remote contents completes successfully,
+ including: del, mdel, ren, mkdir, rmdir, quote, and all
+ upload commands. Patch from Yar Tikhiy <yar@freebsd.org>.
+
+ * merge ftp from NetBSD 20030228 to 20030731:
+ - $FTPUSERAGENT overrides the HTTP User-Agent header.
+ Based on patch from Douwe Kiela <virtus@wanadoo.nl>.
+ - Add about:tnftp
+ - Fix URL in about:netbsd
+ - netbsd.org->NetBSD.org
+ - strlcpy fix in fetch.c
+ - Uppercase "URL"
+ - fix a bogus error message when given a HTTP URL with a
+ trailing slash
+ - groff fixes in man page
+ - tweak progressbar.c copyright; the stuff jason did in util.c
+ wasn't migrated to this file
+ - Don't coredump when printing '%n' in the prompt if there's
+ no username yet.
+ Fix from Maxim Konovalov <maxim@freebsd.org>
+
+ * Add test for HAVE_IN6ADDRSZ (which older Darwin is lacking),
+ and only enable INET6 if it exists.
+ Patch from Amitai Schlair <schmonz@schmonz.com>.
+
+ * Improve ipv6 check for older linux systems that don't provide
+ sin6_scope_id.
+ Patch from YAMANO Yuji <Yamano_Yuji@tk-bay.ogis-ri.co.jp>.
+
+Fri Feb 28 10:57:30 UTC 2003 lukem
+
+ * tagged as "tnftp 2.0 beta1"
+
+Fri Feb 28 10:07:07 UTC 2003 lukem
+
+ * renamed to `tnftp' (from `lukemftp')
+
+ * renamed `libukem' to `libnetbsd'
+
+
+Mon Jun 17 06:50:13 UTC 2002 lukem
+
+ * #if USE_GLOB_H, use <glob.h> instead of "ftpglob.h".
+ Requested by Mike Heffner <mikeh@freebsd.org>
+
Mon Jun 10 08:12:35 UTC 2002 lukem
* crank FTP_VERSION from 1.6-beta1 to 1.6-beta2
@@ -223,7 +933,7 @@ Tue Oct 3 10:22:36 EST 2000 lukem
Mon Sep 25 21:52:12 EST 2000 lukem
* crank to version 1.5 beta5
-
+
Sun Sep 24 13:31:19 EST 2000 lukem
* merge ftp from NetBSD-current (20000924)
@@ -243,7 +953,7 @@ Sun Sep 24 13:31:19 EST 2000 lukem
- in progressmeter() perform the check for foregroundproc() a
little earlier
- removed unused variable `items' in list_vertical()
-
+
Sat Sep 23 15:43:34 EST 2000 lukem
* remove unused sverrno in warnx() and errx()
@@ -406,7 +1116,7 @@ Wed Aug 2 23:43:50 EST 2000 lukem
* update from NetBSD-current (20000802):
- rename NO_QUAD to NO_LONG_LONG, QUAD* -> LL* and add ULL*
(unsigned) equivalents. name change suggested by Klaus
- Klein <kjk@netbsd.org>
+ Klein <kjk@NetBSD.org>
- change defined(BSD4_4) || HAVE_SIN_LEN tests into
HAVE_SOCKADDR_SA_LEN, and set the latter if BSD4_4 exists
@@ -451,7 +1161,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem
- add support for FEAT and OPTS commands with `features' and
`opts'. (from RFC 2389).
- add support for MLST & MLSD (machine parseble listings)
- with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands.
+ with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands.
(from draft-ietf-ftpext-mlst-11)
- rename remotesyst() to getremoteinfo(), and modify to parse
the result from FEAT (if supported), and take into account
@@ -473,7 +1183,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem
- minor knf (indent goto labels by one space, etc).
- simply various command usage handlers by assuming that
argv != NULL except for quit() and disconnect().
- - errx?/warnx? audit. do not pass variable alone, use %s.
+ - errx?/warnx? audit. do not pass variable alone, use %s.
* check for issetugid() and don't use in libedit if it doesn't exist.
@@ -572,12 +1282,12 @@ Sun Jun 4 18:00:07 EST 2000 lukem
- do not pass scoped IPv6 address notation on Host: directive,
since scope identifier is local to the originating node.
do not allow scoped IPv6 address notation in URL, if it is
- via proxy.
+ via proxy.
- fixes from cgd:
* sanity check a length (otherwise certain bogus responses
can crash ftp)
* allow a transfer encoding type of `binary'; certain
- firewall vendors return this bogus type...
+ firewall vendors return this bogus type...
- make debugging output unambiguous on IPv6 numeric addrs
(don't use host:port)
- http://[::1]:8080/ is legal.
@@ -705,7 +1415,7 @@ Sun Nov 28 18:20:41 EST 1999 lukem
- implement xsl_init() and xsl_add(); error checking forms of
sl_{init,add}()
- fix bug where the second press of <TAB> on an empty word (i.e, list
- all options) may have resulted in an strncmp() against NULL.
+ all options) may have resulted in an strncmp() against NULL.
(detected by _DIAGASSERT())
- in cleanuppeer(), reset username to NULL after free()ing it.
fixes [bin/8870] by Wolfgang Rupprecht <wolfgang@wsrcc.com>
@@ -985,7 +1695,7 @@ Mon Oct 4 10:57:41 EST 1999 lukem
* Add support for --{en,dis}able-editcomplete (defaults to enabled),
which prevents libedit support from being compiled in.
- From Chris G. Demetriou <cgd@netbsd.org>
+ From Chris G. Demetriou <cgd@NetBSD.org>
Sun Oct 3 16:49:01 EST 1999 lukem
diff --git a/contrib/tnftp/INSTALL b/contrib/tnftp/INSTALL
new file mode 100644
index 0000000..7c5e96a
--- /dev/null
+++ b/contrib/tnftp/INSTALL
@@ -0,0 +1,60 @@
+INSTALLATION INTRODUCTION
+-------------------------
+
+This file describes how to compile and install tnftp on your system.
+
+ ============================================
+ = =
+ = NOTE: You will need an ANSI C compiler. =
+ = =
+ ============================================
+
+
+For most systems, execute the following to compile and install tnftp:
+ ./configure
+ make
+ make install
+
+A preformatted manual page (src/ftp.cat1) is also installed.
+If you wish to install the source (src/ftp.1), ensure that your system
+has up-to-date mandoc macros, such as those that are shipped with groff.
+
+
+CONFIGURATION OPTIONS
+---------------------
+
+tnftp is configured using an `autoconf' generated `configure'
+script. `configure' supports the following options:
+
+* The standard `autoconf configure' options, including:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [/usr/local]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ BSD or GNU make may be required for this to work.
+
+* Specific options:
+ --enable-editcomplete Turn on command line editing and completion.
+ (default: enabled)
+ --enable-ipv6 Enable IPv6 support (if your OS supports it).
+ (default: enabled)
+ --disable-largefile omit support for large files
+ --with-socks enable support for (Dante) SOCKS5 proxy
+
+The following environment variables can be set to override various
+compiler related settings.
+ CC=compiler specify name of the C compiler (default: gcc or cc)
+ CFLAGS=flags specify flags to C compiler (default: -O -g or just -O)
+ LDFLAGS=flags specify flags to linker (default: none)
+
+This can be achieved with:
+ env CC="compiler" CFLAGS="flags" LDFLAGS="flags" ./configure
+
+
+ ============================================
+ = =
+ = NOTE: You will need an ANSI C compiler. =
+ = =
+ ============================================
+
diff --git a/contrib/tnftp/Makefile.am b/contrib/tnftp/Makefile.am
new file mode 100644
index 0000000..b5b27da
--- /dev/null
+++ b/contrib/tnftp/Makefile.am
@@ -0,0 +1,13 @@
+## $NetBSD: Makefile.am,v 1.2 2010/01/04 06:24:58 lukem Exp $
+
+SUBDIRS = libnetbsd
+
+if USE_LIBEDIT
+SUBDIRS += libedit
+endif
+
+SUBDIRS += src
+
+EXTRA_DIST = \
+ todo \
+ tnftp.h
diff --git a/contrib/tnftp/Makefile.in b/contrib/tnftp/Makefile.in
new file mode 100644
index 0000000..8f92dd7
--- /dev/null
+++ b/contrib/tnftp/Makefile.in
@@ -0,0 +1,726 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@USE_LIBEDIT_TRUE@am__append_1 = libedit
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/tnftp_config.h.in \
+ $(top_srcdir)/configure COPYING ChangeLog INSTALL NEWS THANKS \
+ buildaux/config.guess buildaux/config.sub buildaux/depcomp \
+ buildaux/install-sh buildaux/ltmain.sh buildaux/missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = tnftp_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+ distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = libnetbsd libedit src
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d "$(distdir)" \
+ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr "$(distdir)"; }; }
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = libnetbsd $(am__append_1) src
+EXTRA_DIST = \
+ todo \
+ tnftp.h
+
+all: tnftp_config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+tnftp_config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/tnftp_config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status tnftp_config.h
+$(srcdir)/tnftp_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f tnftp_config.h stamp-h1
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) tnftp_config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) tnftp_config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) tnftp_config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) tnftp_config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @$(am__cd) '$(distuninstallcheck_dir)' \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile tnftp_config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+ ctags-recursive install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
+ distcheck distclean distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/tnftp/NEWS b/contrib/tnftp/NEWS
new file mode 100644
index 0000000..7647a81
--- /dev/null
+++ b/contrib/tnftp/NEWS
@@ -0,0 +1,36 @@
+This is tnftp version 20091122.
+
+Changes in tnftp from 20090606 to 20091122:
+
+ Portability fixes.
+
+Changes in tnftp from 20090520 to 20090606:
+
+ Portability fixes.
+
+Changes in tnftp from 20070806 to 20090520:
+
+ Fix intermittent "Alarm clock" error.
+
+ Add epsv6 and epsv to disable extended passive mode for IPv6 or
+ both IPv4 and IPv6 respectively.
+
+ Improve parsing of HTTP chunked transfers per RFC2616.
+
+ Use the service name to getaddrinfo() (along with the host name),
+ so that features such as DNS Service Discovery will work.
+
+ Fix various compiler warnings.
+
+
+Changes in tnftp from 20050625 to 20070806:
+
+ Implement '-s srcaddr' to set the local IP address for
+ all connections.
+
+ Support '-q quittime' when waiting for server replies.
+
+ Use IEC 60027-2 "KiB", "MiB" (etc) instead of "KB", "MB", ...
+
+ Portability fixes, including for FreeBSD, Mac OS X, and Solaris.
+
diff --git a/contrib/tnftp/README b/contrib/tnftp/README
new file mode 100644
index 0000000..2f81da6
--- /dev/null
+++ b/contrib/tnftp/README
@@ -0,0 +1,68 @@
+WHAT IS TNFTP?
+--------------
+
+`tnftp' is a `port' of the NetBSD FTP client to other systems.
+See http://www.NetBSD.org/ for more details about NetBSD.
+
+tnftp was formerly known as `lukemftp'
+It was renamed to `tnftp' by Luke Mewburn in February 2003.
+
+The enhancements over the standard ftp client in 4.4BSD (and
+derivatives) include:
+ * command-line editing within ftp
+ * command-line fetching of URLS, including support for:
+ - http proxies (see $http_proxy, $ftp_proxy)
+ - authentication
+ * configurable prompt
+ * context sensitive command and filename completion
+ * dynamic progress bar
+ * feature negotiation extensions from RFC 2389
+ (see `feat' and `remopts')
+ * extensions to ftp from the IETF ftpext working group
+ (see `mlsd' and `mlst')
+ * IPv6 support (from the WIDE project)
+ * modification time preservation
+ * paging of local and remote files, and of directory listings
+ (see `lpage', `page', `pdir')
+ * passive mode support, with fallback to active mode
+ * retrieval of filenames listed in a given file (see `fget')
+ * `set option' override of ftp environment variables
+ * TIS Firewall Toolkit gate ftp proxy support (see `gate')
+ * transfer-rate throttling (see `-T', `rate')
+ * uploading of files on the command line (see `-u')
+ * (Dante) SOCKS5 support
+
+Previous features, currently disabled until a test system is available:
+ * SOCKS4 support
+
+
+INSTALLATION
+------------
+
+Refer to `INSTALL' for more information on how to compile and install tnftp.
+
+
+FEEDBACK / BUG REPORTS
+----------------------
+
+Please email feedback back to the maintainer:
+ Luke Mewburn <lukem@NetBSD.org>.
+
+
+COPYRIGHT
+---------
+
+tnftp is covered by a BSD-style copyright notice.
+Please refer to the file `COPYING' for more information.
+
+
+AVAILABILITY
+------------
+
+The primary ftp site for tnftp is:
+ ftp://ftp.NetBSD.org/pub/NetBSD/misc/tnftp/
+
+
+DOCUMENT REFERENCE
+------------------
+$NetBSD: README,v 1.10 2007/08/06 01:58:57 lukem Exp $
diff --git a/contrib/tnftp/THANKS b/contrib/tnftp/THANKS
new file mode 100644
index 0000000..93e12af
--- /dev/null
+++ b/contrib/tnftp/THANKS
@@ -0,0 +1,53 @@
+Whilst a lot of the work in tnftp (both the original sources in NetBSD
+and this port) was done by Luke Mewburn, it would not be as usable
+without the enhancements, bug fixes, or input from the following people:
+
+Amitai Schlair <schmonz@schmonz.com>
+Anders Dinsen <anders@dinsen.net>
+Anders Magnusson <ragge@ltu.se>
+Arkadiusz Miskiewicz <misiek@pld.org.pl>
+Brian Stark <bstark1990@netscape.net>
+Chris G. Demetriou <cgd@NetBSD.org>
+Christos Zoulas <christos@NetBSD.org>
+Dan Winship <danw@mit.edu>
+Darren Reed <darrenr@pobox.com>
+David Brownlee <abs@mono.org>
+David Carrel <carrel@NetBSD.org>
+DervishD <raul@pleyades.net>
+Douwe Kiela <virtus@wanadoo.nl>
+Eugene Kotlyarov <ekot@protek36.esoo.ru>
+Geoff Wing <mason@primenet.com.au>
+Giles Lean <giles@nemeton.com.au>
+Havard Eidnes <Havard.Eidnes@runit.sintef.no>
+Hubert Feyrer <hubert@feyrer.de>
+ITOH Yasufumi <itohy@NetBSD.org>
+Jason R. Thorpe <thorpej@NetBSD.org>
+John Hawkinson <jhawk@mit.edu>
+Joseph S. Myers <jsm28@cam.ac.uk>
+Jun-ichiro itojun Hagino <itojun@NetBSD.org>
+Kimmo Suominen <kim@tac.nyc.ny.us>
+Klaus Klein <kleink@NetBSD.org>
+Launey Thomas <ljt@alum.mit.edu>
+Luke Mewburn <lukem@NetBSD.org>
+Marc Horowitz <marc@mit.edu>
+Mathieu Arnold <mat@FreeBSD.org>
+Matthew R. Green <mrg@eterna.com.au>
+Matthias Pfaller <leo@dachau.marco.de>
+Matthias Scheler <tron@zhadum.de>
+Maxim Konovalov <maxim@FreeBSD.org>
+Maxime Henrion <mux@FreeBSD.org>
+Michael L. Hitch <osymh@terra.oscs.montana.edu>
+Mike Heffner <mikeh@FreeBSD.org>
+Onno van der Linden <o.vd.linden@quicknet.nl>
+Ruslan Ermilov <ru@FreeBSD.org>
+Ryoji Kanai <rkanai@eeye.com>
+Scott Aaron Bamford <sab@ansic.net>
+Simon Burge <simonb@thistledown.com.au>
+Steve McClellan <steve.mcclellan@radisys.com>
+TAMURA Kent <kent@NetBSD.org>
+Stoned Elipot <seb@NetBSD.org>
+Todd C. Miller <Todd.Miller@courtesan.com>
+YAMANO Yuji <yyamano@NetBSD.org>
+Yar Tikhiy <yar@FreeBSD.org>
+
+Apologies to anyone missed.
diff --git a/contrib/tnftp/src/Makefile.am b/contrib/tnftp/src/Makefile.am
new file mode 100644
index 0000000..8ac32f9
--- /dev/null
+++ b/contrib/tnftp/src/Makefile.am
@@ -0,0 +1,52 @@
+## $NetBSD: Makefile.am,v 1.2 2010/01/04 06:24:20 lukem Exp $
+
+bin_PROGRAMS = tnftp
+
+tnftp_SOURCES = \
+ cmds.c \
+ cmdtab.c \
+ complete.c \
+ domacro.c \
+ fetch.c \
+ ftp.c \
+ main.c \
+ progressbar.c \
+ ruserpass.c \
+ util.c
+
+tnftp_CPPFLAGS = \
+ -DHAVE_TNFTPD_H=1 \
+ -D_DEFAULT_CONFDIR=\"${sysconfdir}\" \
+ -I$(srcdir) \
+ -I$(top_srcdir)/libnetbsd \
+ -I$(top_srcdir) \
+ -I$(top_builddir)
+
+tnftp_LDADD = \
+ ../libnetbsd/libnetbsd.la
+
+
+if USE_LIBEDIT
+tnftp_CPPFLAGS += \
+ -I$(top_srcdir)/libedit
+
+tnftp_LDADD += \
+ ../libedit/libedit.la
+endif
+
+
+man1_MANS = \
+ tnftp.1
+
+tnftp.1: ftp.1
+ cp $(srcdir)/ftp.1 tnftp.1
+
+CLEANFILES = \
+ tnftp.1
+
+EXTRA_DIST = \
+ extern.h \
+ ftp.1 \
+ ftp_var.h \
+ progressbar.h \
+ version.h
diff --git a/contrib/tnftp/src/Makefile.in b/contrib/tnftp/src/Makefile.in
new file mode 100644
index 0000000..e11a81a
--- /dev/null
+++ b/contrib/tnftp/src/Makefile.in
@@ -0,0 +1,809 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = tnftp$(EXEEXT)
+@USE_LIBEDIT_TRUE@am__append_1 = \
+@USE_LIBEDIT_TRUE@ -I$(top_srcdir)/libedit
+
+@USE_LIBEDIT_TRUE@am__append_2 = \
+@USE_LIBEDIT_TRUE@ ../libedit/libedit.la
+
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/tnftp_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_tnftp_OBJECTS = tnftp-cmds.$(OBJEXT) tnftp-cmdtab.$(OBJEXT) \
+ tnftp-complete.$(OBJEXT) tnftp-domacro.$(OBJEXT) \
+ tnftp-fetch.$(OBJEXT) tnftp-ftp.$(OBJEXT) tnftp-main.$(OBJEXT) \
+ tnftp-progressbar.$(OBJEXT) tnftp-ruserpass.$(OBJEXT) \
+ tnftp-util.$(OBJEXT)
+tnftp_OBJECTS = $(am_tnftp_OBJECTS)
+tnftp_DEPENDENCIES = ../libnetbsd/libnetbsd.la $(am__append_2)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+DEFAULT_INCLUDES =
+depcomp = $(SHELL) $(top_srcdir)/buildaux/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(tnftp_SOURCES)
+DIST_SOURCES = $(tnftp_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(man1_MANS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+tnftp_SOURCES = \
+ cmds.c \
+ cmdtab.c \
+ complete.c \
+ domacro.c \
+ fetch.c \
+ ftp.c \
+ main.c \
+ progressbar.c \
+ ruserpass.c \
+ util.c
+
+tnftp_CPPFLAGS = -DHAVE_TNFTPD_H=1 \
+ -D_DEFAULT_CONFDIR=\"${sysconfdir}\" -I$(srcdir) \
+ -I$(top_srcdir)/libnetbsd -I$(top_srcdir) -I$(top_builddir) \
+ $(am__append_1)
+tnftp_LDADD = ../libnetbsd/libnetbsd.la $(am__append_2)
+man1_MANS = \
+ tnftp.1
+
+CLEANFILES = \
+ tnftp.1
+
+EXTRA_DIST = \
+ extern.h \
+ ftp.1 \
+ ftp_var.h \
+ progressbar.h \
+ version.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+tnftp$(EXEEXT): $(tnftp_OBJECTS) $(tnftp_DEPENDENCIES)
+ @rm -f tnftp$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tnftp_OBJECTS) $(tnftp_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-cmds.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-cmdtab.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-complete.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-domacro.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-fetch.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-ftp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-progressbar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-ruserpass.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-util.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+tnftp-cmds.o: cmds.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-cmds.o -MD -MP -MF $(DEPDIR)/tnftp-cmds.Tpo -c -o tnftp-cmds.o `test -f 'cmds.c' || echo '$(srcdir)/'`cmds.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-cmds.Tpo $(DEPDIR)/tnftp-cmds.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmds.c' object='tnftp-cmds.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-cmds.o `test -f 'cmds.c' || echo '$(srcdir)/'`cmds.c
+
+tnftp-cmds.obj: cmds.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-cmds.obj -MD -MP -MF $(DEPDIR)/tnftp-cmds.Tpo -c -o tnftp-cmds.obj `if test -f 'cmds.c'; then $(CYGPATH_W) 'cmds.c'; else $(CYGPATH_W) '$(srcdir)/cmds.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-cmds.Tpo $(DEPDIR)/tnftp-cmds.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmds.c' object='tnftp-cmds.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-cmds.obj `if test -f 'cmds.c'; then $(CYGPATH_W) 'cmds.c'; else $(CYGPATH_W) '$(srcdir)/cmds.c'; fi`
+
+tnftp-cmdtab.o: cmdtab.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-cmdtab.o -MD -MP -MF $(DEPDIR)/tnftp-cmdtab.Tpo -c -o tnftp-cmdtab.o `test -f 'cmdtab.c' || echo '$(srcdir)/'`cmdtab.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-cmdtab.Tpo $(DEPDIR)/tnftp-cmdtab.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmdtab.c' object='tnftp-cmdtab.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-cmdtab.o `test -f 'cmdtab.c' || echo '$(srcdir)/'`cmdtab.c
+
+tnftp-cmdtab.obj: cmdtab.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-cmdtab.obj -MD -MP -MF $(DEPDIR)/tnftp-cmdtab.Tpo -c -o tnftp-cmdtab.obj `if test -f 'cmdtab.c'; then $(CYGPATH_W) 'cmdtab.c'; else $(CYGPATH_W) '$(srcdir)/cmdtab.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-cmdtab.Tpo $(DEPDIR)/tnftp-cmdtab.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmdtab.c' object='tnftp-cmdtab.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-cmdtab.obj `if test -f 'cmdtab.c'; then $(CYGPATH_W) 'cmdtab.c'; else $(CYGPATH_W) '$(srcdir)/cmdtab.c'; fi`
+
+tnftp-complete.o: complete.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-complete.o -MD -MP -MF $(DEPDIR)/tnftp-complete.Tpo -c -o tnftp-complete.o `test -f 'complete.c' || echo '$(srcdir)/'`complete.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-complete.Tpo $(DEPDIR)/tnftp-complete.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='complete.c' object='tnftp-complete.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-complete.o `test -f 'complete.c' || echo '$(srcdir)/'`complete.c
+
+tnftp-complete.obj: complete.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-complete.obj -MD -MP -MF $(DEPDIR)/tnftp-complete.Tpo -c -o tnftp-complete.obj `if test -f 'complete.c'; then $(CYGPATH_W) 'complete.c'; else $(CYGPATH_W) '$(srcdir)/complete.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-complete.Tpo $(DEPDIR)/tnftp-complete.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='complete.c' object='tnftp-complete.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-complete.obj `if test -f 'complete.c'; then $(CYGPATH_W) 'complete.c'; else $(CYGPATH_W) '$(srcdir)/complete.c'; fi`
+
+tnftp-domacro.o: domacro.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-domacro.o -MD -MP -MF $(DEPDIR)/tnftp-domacro.Tpo -c -o tnftp-domacro.o `test -f 'domacro.c' || echo '$(srcdir)/'`domacro.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-domacro.Tpo $(DEPDIR)/tnftp-domacro.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='domacro.c' object='tnftp-domacro.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-domacro.o `test -f 'domacro.c' || echo '$(srcdir)/'`domacro.c
+
+tnftp-domacro.obj: domacro.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-domacro.obj -MD -MP -MF $(DEPDIR)/tnftp-domacro.Tpo -c -o tnftp-domacro.obj `if test -f 'domacro.c'; then $(CYGPATH_W) 'domacro.c'; else $(CYGPATH_W) '$(srcdir)/domacro.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-domacro.Tpo $(DEPDIR)/tnftp-domacro.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='domacro.c' object='tnftp-domacro.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-domacro.obj `if test -f 'domacro.c'; then $(CYGPATH_W) 'domacro.c'; else $(CYGPATH_W) '$(srcdir)/domacro.c'; fi`
+
+tnftp-fetch.o: fetch.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-fetch.o -MD -MP -MF $(DEPDIR)/tnftp-fetch.Tpo -c -o tnftp-fetch.o `test -f 'fetch.c' || echo '$(srcdir)/'`fetch.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-fetch.Tpo $(DEPDIR)/tnftp-fetch.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fetch.c' object='tnftp-fetch.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-fetch.o `test -f 'fetch.c' || echo '$(srcdir)/'`fetch.c
+
+tnftp-fetch.obj: fetch.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-fetch.obj -MD -MP -MF $(DEPDIR)/tnftp-fetch.Tpo -c -o tnftp-fetch.obj `if test -f 'fetch.c'; then $(CYGPATH_W) 'fetch.c'; else $(CYGPATH_W) '$(srcdir)/fetch.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-fetch.Tpo $(DEPDIR)/tnftp-fetch.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fetch.c' object='tnftp-fetch.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-fetch.obj `if test -f 'fetch.c'; then $(CYGPATH_W) 'fetch.c'; else $(CYGPATH_W) '$(srcdir)/fetch.c'; fi`
+
+tnftp-ftp.o: ftp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-ftp.o -MD -MP -MF $(DEPDIR)/tnftp-ftp.Tpo -c -o tnftp-ftp.o `test -f 'ftp.c' || echo '$(srcdir)/'`ftp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-ftp.Tpo $(DEPDIR)/tnftp-ftp.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ftp.c' object='tnftp-ftp.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-ftp.o `test -f 'ftp.c' || echo '$(srcdir)/'`ftp.c
+
+tnftp-ftp.obj: ftp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-ftp.obj -MD -MP -MF $(DEPDIR)/tnftp-ftp.Tpo -c -o tnftp-ftp.obj `if test -f 'ftp.c'; then $(CYGPATH_W) 'ftp.c'; else $(CYGPATH_W) '$(srcdir)/ftp.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-ftp.Tpo $(DEPDIR)/tnftp-ftp.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ftp.c' object='tnftp-ftp.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-ftp.obj `if test -f 'ftp.c'; then $(CYGPATH_W) 'ftp.c'; else $(CYGPATH_W) '$(srcdir)/ftp.c'; fi`
+
+tnftp-main.o: main.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-main.o -MD -MP -MF $(DEPDIR)/tnftp-main.Tpo -c -o tnftp-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-main.Tpo $(DEPDIR)/tnftp-main.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='tnftp-main.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
+
+tnftp-main.obj: main.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-main.obj -MD -MP -MF $(DEPDIR)/tnftp-main.Tpo -c -o tnftp-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-main.Tpo $(DEPDIR)/tnftp-main.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='tnftp-main.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
+
+tnftp-progressbar.o: progressbar.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-progressbar.o -MD -MP -MF $(DEPDIR)/tnftp-progressbar.Tpo -c -o tnftp-progressbar.o `test -f 'progressbar.c' || echo '$(srcdir)/'`progressbar.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-progressbar.Tpo $(DEPDIR)/tnftp-progressbar.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='progressbar.c' object='tnftp-progressbar.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-progressbar.o `test -f 'progressbar.c' || echo '$(srcdir)/'`progressbar.c
+
+tnftp-progressbar.obj: progressbar.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-progressbar.obj -MD -MP -MF $(DEPDIR)/tnftp-progressbar.Tpo -c -o tnftp-progressbar.obj `if test -f 'progressbar.c'; then $(CYGPATH_W) 'progressbar.c'; else $(CYGPATH_W) '$(srcdir)/progressbar.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-progressbar.Tpo $(DEPDIR)/tnftp-progressbar.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='progressbar.c' object='tnftp-progressbar.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-progressbar.obj `if test -f 'progressbar.c'; then $(CYGPATH_W) 'progressbar.c'; else $(CYGPATH_W) '$(srcdir)/progressbar.c'; fi`
+
+tnftp-ruserpass.o: ruserpass.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-ruserpass.o -MD -MP -MF $(DEPDIR)/tnftp-ruserpass.Tpo -c -o tnftp-ruserpass.o `test -f 'ruserpass.c' || echo '$(srcdir)/'`ruserpass.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-ruserpass.Tpo $(DEPDIR)/tnftp-ruserpass.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ruserpass.c' object='tnftp-ruserpass.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-ruserpass.o `test -f 'ruserpass.c' || echo '$(srcdir)/'`ruserpass.c
+
+tnftp-ruserpass.obj: ruserpass.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-ruserpass.obj -MD -MP -MF $(DEPDIR)/tnftp-ruserpass.Tpo -c -o tnftp-ruserpass.obj `if test -f 'ruserpass.c'; then $(CYGPATH_W) 'ruserpass.c'; else $(CYGPATH_W) '$(srcdir)/ruserpass.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-ruserpass.Tpo $(DEPDIR)/tnftp-ruserpass.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ruserpass.c' object='tnftp-ruserpass.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-ruserpass.obj `if test -f 'ruserpass.c'; then $(CYGPATH_W) 'ruserpass.c'; else $(CYGPATH_W) '$(srcdir)/ruserpass.c'; fi`
+
+tnftp-util.o: util.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-util.o -MD -MP -MF $(DEPDIR)/tnftp-util.Tpo -c -o tnftp-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-util.Tpo $(DEPDIR)/tnftp-util.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='tnftp-util.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+tnftp-util.obj: util.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-util.obj -MD -MP -MF $(DEPDIR)/tnftp-util.Tpo -c -o tnftp-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-util.Tpo $(DEPDIR)/tnftp-util.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='tnftp-util.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-man1: $(man1_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ { for i in $$list; do echo "$$i"; done; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ test -z "$$files" || { \
+ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @list='$(MANS)'; if test -n "$$list"; then \
+ list=`for p in $$list; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+ if test -n "$$list" && \
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
+ exit 1; \
+ else :; fi; \
+ else :; fi
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(MANS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-man1 install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binPROGRAMS uninstall-man \
+ uninstall-man1
+
+
+tnftp.1: ftp.1
+ cp $(srcdir)/ftp.1 tnftp.1
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/lukemftp/src/cmds.c b/contrib/tnftp/src/cmds.c
index 69dbd18..7be3a77 100644
--- a/contrib/lukemftp/src/cmds.c
+++ b/contrib/tnftp/src/cmds.c
@@ -1,7 +1,8 @@
-/* $NetBSD: cmds.c,v 1.112 2005/04/11 01:49:31 lukem Exp $ */
+/* $NetBSD: cmds.c,v 1.17 2010/01/12 06:55:47 lukem Exp $ */
+/* from NetBSD: cmds.c,v 1.130 2009/07/13 19:05:41 roy Exp */
/*-
- * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -19,13 +20,6 @@
* 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
@@ -98,12 +92,16 @@
* SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: cmds.c,v 1.112 2005/04/11 01:49:31 lukem Exp $");
+__RCSID(" NetBSD: cmds.c,v 1.130 2009/07/13 19:05:41 roy Exp ");
#endif
#endif /* not lint */
@@ -122,57 +120,73 @@ __RCSID("$NetBSD: cmds.c,v 1.112 2005/04/11 01:49:31 lukem Exp $");
#include <limits.h>
#include <netdb.h>
#include <paths.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
-#include <libutil.h>
+
+#endif /* tnftp */
#include "ftp_var.h"
#include "version.h"
-struct types {
- char *t_name;
- char *t_mode;
- int t_type;
- char *t_arg;
+static struct types {
+ const char *t_name;
+ const char *t_mode;
+ int t_type;
+ const char *t_arg;
} types[] = {
{ "ascii", "A", TYPE_A, 0 },
{ "binary", "I", TYPE_I, 0 },
{ "image", "I", TYPE_I, 0 },
{ "ebcdic", "E", TYPE_E, 0 },
{ "tenex", "L", TYPE_L, bytename },
- { NULL }
+ { NULL, NULL, 0, NULL }
};
-sigjmp_buf jabort;
-const char *mname;
+static sigjmp_buf jabort;
static int confirm(const char *, const char *);
+static void mintr(int);
+static void mabort(const char *);
+static void set_type(const char *);
static const char *doprocess(char *, size_t, const char *, int, int, int);
static const char *domap(char *, size_t, const char *);
static const char *docase(char *, size_t, const char *);
static const char *dotrans(char *, size_t, const char *);
+/*
+ * Confirm if "cmd" is to be performed upon "file".
+ * If "file" is NULL, generate a "Continue with" prompt instead.
+ */
static int
confirm(const char *cmd, const char *file)
{
- char line[BUFSIZ];
+ const char *errormsg;
+ char cline[BUFSIZ];
+ const char *promptleft, *promptright;
if (!interactive || confirmrest)
return (1);
+ if (file == NULL) {
+ promptleft = "Continue with";
+ promptright = cmd;
+ } else {
+ promptleft = cmd;
+ promptright = file;
+ }
while (1) {
- fprintf(ttyout, "%s %s [anpqy?]? ", cmd, file);
+ fprintf(ttyout, "%s %s [anpqy?]? ", promptleft, promptright);
(void)fflush(ttyout);
- if (fgets(line, sizeof(line), stdin) == NULL) {
+ if (get_line(stdin, cline, sizeof(cline), &errormsg) < 0) {
mflag = 0;
- fprintf(ttyout, "\nEOF received; %s aborted\n", mname);
- clearerr(stdin);
+ fprintf(ttyout, "%s; %s aborted\n", errormsg, cmd);
return (0);
}
- switch (tolower((unsigned char)*line)) {
+ switch (tolower((unsigned char)*cline)) {
case 'a':
confirmrest = 1;
fprintf(ttyout,
@@ -184,7 +198,7 @@ confirm(const char *cmd, const char *file)
break;
case 'q':
mflag = 0;
- fprintf(ttyout, "%s aborted.\n", mname);
+ fprintf(ttyout, "%s aborted.\n", cmd);
/* FALLTHROUGH */
case 'n':
return (0);
@@ -212,12 +226,11 @@ void
settype(int argc, char *argv[])
{
struct types *p;
- int comret;
if (argc == 0 || argc > 2) {
- char *sep;
+ const char *sep;
- fprintf(ttyout, "usage: %s [", argv[0]);
+ UPRINTF("usage: %s [", argv[0]);
sep = " ";
for (p = types; p->t_name; p++) {
fprintf(ttyout, "%s%s", sep, p->t_name);
@@ -232,11 +245,20 @@ settype(int argc, char *argv[])
code = 0;
return;
}
+ set_type(argv[1]);
+}
+
+void
+set_type(const char *ttype)
+{
+ struct types *p;
+ int comret;
+
for (p = types; p->t_name; p++)
- if (strcmp(argv[1], p->t_name) == 0)
+ if (strcmp(ttype, p->t_name) == 0)
break;
if (p->t_name == 0) {
- fprintf(ttyout, "%s: unknown mode.\n", argv[1]);
+ fprintf(ttyout, "%s: unknown mode.\n", ttype);
code = -1;
return;
}
@@ -265,14 +287,13 @@ changetype(int newtype, int show)
newtype = TYPE_I;
if (newtype == curtype)
return;
- if (debug == 0 && show == 0)
+ if (ftp_debug == 0 && show == 0)
verbose = 0;
for (p = types; p->t_name; p++)
if (newtype == p->t_type)
break;
if (p->t_name == 0) {
- warnx("internal error: unknown type %d.", newtype);
- return;
+ errx(1, "changetype: unknown type %d", newtype);
}
if (newtype == TYPE_L && bytename[0] != '\0')
comret = command("TYPE %s %s", p->t_mode, bytename);
@@ -283,12 +304,6 @@ changetype(int newtype, int show)
verbose = oldverbose;
}
-char *stype[] = {
- "type",
- "",
- 0
-};
-
/*
* Set binary transfer type.
*/
@@ -298,12 +313,11 @@ setbinary(int argc, char *argv[])
{
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
- stype[1] = "binary";
- settype(2, stype);
+ set_type("binary");
}
/*
@@ -315,12 +329,11 @@ setascii(int argc, char *argv[])
{
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
- stype[1] = "ascii";
- settype(2, stype);
+ set_type("ascii");
}
/*
@@ -332,12 +345,11 @@ settenex(int argc, char *argv[])
{
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
- stype[1] = "tenex";
- settype(2, stype);
+ set_type("tenex");
}
/*
@@ -349,7 +361,7 @@ setftmode(int argc, char *argv[])
{
if (argc != 2) {
- fprintf(ttyout, "usage: %s mode-name\n", argv[0]);
+ UPRINTF("usage: %s mode-name\n", argv[0]);
code = -1;
return;
}
@@ -366,7 +378,7 @@ setform(int argc, char *argv[])
{
if (argc != 2) {
- fprintf(ttyout, "usage: %s format\n", argv[0]);
+ UPRINTF("usage: %s format\n", argv[0]);
code = -1;
return;
}
@@ -383,7 +395,7 @@ setstruct(int argc, char *argv[])
{
if (argc != 2) {
- fprintf(ttyout, "usage: %s struct-mode\n", argv[0]);
+ UPRINTF("usage: %s struct-mode\n", argv[0]);
code = -1;
return;
}
@@ -398,7 +410,7 @@ void
put(int argc, char *argv[])
{
char buf[MAXPATHLEN];
- char *cmd;
+ const char *cmd;
int loc = 0;
char *locfile;
const char *remfile;
@@ -412,8 +424,7 @@ put(int argc, char *argv[])
goto usage;
if ((argc < 3 && !another(&argc, &argv, "remote-file")) || argc > 3) {
usage:
- fprintf(ttyout, "usage: %s local-file [remote-file]\n",
- argv[0]);
+ UPRINTF("usage: %s local-file [remote-file]\n", argv[0]);
code = -1;
return;
}
@@ -457,15 +468,14 @@ mput(int argc, char *argv[])
const char *tp;
if (argc == 0 || (argc == 1 && !another(&argc, &argv, "local-files"))) {
- fprintf(ttyout, "usage: %s local-files\n", argv[0]);
+ UPRINTF("usage: %s local-files\n", argv[0]);
code = -1;
return;
}
- mname = argv[0];
mflag = 1;
oldintr = xsignal(SIGINT, mintr);
if (sigsetjmp(jabort, 1))
- mabort();
+ mabort(argv[0]);
if (proxy) {
char *cp;
@@ -483,7 +493,7 @@ mput(int argc, char *argv[])
if (!mflag && fromatty) {
ointer = interactive;
interactive = 1;
- if (confirm("Continue with", "mput")) {
+ if (confirm(argv[0], NULL)) {
mflag++;
}
interactive = ointer;
@@ -507,7 +517,7 @@ mput(int argc, char *argv[])
if (!mflag && fromatty) {
ointer = interactive;
interactive = 1;
- if (confirm("Continue with", "mput")) {
+ if (confirm(argv[0], NULL)) {
mflag++;
}
interactive = ointer;
@@ -519,7 +529,7 @@ mput(int argc, char *argv[])
memset(&gl, 0, sizeof(gl));
flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE;
if (glob(argv[i], flags, NULL, &gl) || gl.gl_pathc == 0) {
- warnx("%s: not found", argv[i]);
+ warnx("Glob pattern `%s' not found", argv[i]);
globfree(&gl);
continue;
}
@@ -535,7 +545,7 @@ mput(int argc, char *argv[])
if (!mflag && fromatty) {
ointer = interactive;
interactive = 1;
- if (confirm("Continue with", "mput")) {
+ if (confirm(argv[0], NULL)) {
mflag++;
}
interactive = ointer;
@@ -569,7 +579,7 @@ get(int argc, char *argv[])
* If restartit is -1, restart the xfer only if the remote file is newer.
*/
int
-getit(int argc, char *argv[], int restartit, const char *mode)
+getit(int argc, char *argv[], int restartit, const char *gmode)
{
int loc, rval;
char *remfile, *olocfile;
@@ -586,8 +596,7 @@ getit(int argc, char *argv[], int restartit, const char *mode)
goto usage;
if ((argc < 3 && !another(&argc, &argv, "local-file")) || argc > 3) {
usage:
- fprintf(ttyout, "usage: %s remote-file [local-file]\n",
- argv[0]);
+ UPRINTF("usage: %s remote-file [local-file]\n", argv[0]);
code = -1;
return (0);
}
@@ -610,7 +619,7 @@ getit(int argc, char *argv[], int restartit, const char *mode)
ret = stat(locfile, &stbuf);
if (restartit == 1) {
if (ret < 0) {
- warn("local: %s", locfile);
+ warn("Can't stat `%s'", locfile);
goto freegetit;
}
restart_point = stbuf.st_size;
@@ -629,7 +638,7 @@ getit(int argc, char *argv[], int restartit, const char *mode)
}
}
- recvrequest("RETR", locfile, remfile, mode,
+ recvrequest("RETR", locfile, remfile, gmode,
remfile != argv[1] || locfile != argv[2], loc);
restart_point = 0;
freegetit:
@@ -638,7 +647,7 @@ getit(int argc, char *argv[], int restartit, const char *mode)
}
/* ARGSUSED */
-void
+static void
mintr(int signo)
{
@@ -648,8 +657,8 @@ mintr(int signo)
siglongjmp(jabort, 1);
}
-void
-mabort(void)
+static void
+mabort(const char *cmd)
{
int ointer, oconf;
@@ -658,7 +667,7 @@ mabort(void)
oconf = confirmrest;
interactive = 1;
confirmrest = 0;
- if (confirm("Continue with", mname)) {
+ if (confirm(cmd, NULL)) {
interactive = ointer;
confirmrest = oconf;
return;
@@ -679,15 +688,14 @@ mget(int argc, char *argv[])
int ointer;
char *cp;
const char *tp;
- int restartit;
+ int volatile restartit;
if (argc == 0 ||
(argc == 1 && !another(&argc, &argv, "remote-files"))) {
- fprintf(ttyout, "usage: %s remote-files\n", argv[0]);
+ UPRINTF("usage: %s remote-files\n", argv[0]);
code = -1;
return;
}
- mname = argv[0];
mflag = 1;
restart_point = 0;
restartit = 0;
@@ -701,7 +709,7 @@ mget(int argc, char *argv[])
}
oldintr = xsignal(SIGINT, mintr);
if (sigsetjmp(jabort, 1))
- mabort();
+ mabort(argv[0]);
while ((cp = remglob(argv, proxy, NULL)) != NULL) {
char buf[MAXPATHLEN];
if (*cp == '\0' || !connected) {
@@ -724,7 +732,7 @@ mget(int argc, char *argv[])
if (stat(tp, &stbuf) == 0)
restart_point = stbuf.st_size;
else
- warn("stat %s", tp);
+ warn("Can't stat `%s'", tp);
}
recvrequest("RETR", tp, cp, restart_point ? "r+" : "w",
tp != cp || !interactive, 1);
@@ -732,7 +740,7 @@ mget(int argc, char *argv[])
if (!mflag && fromatty) {
ointer = interactive;
interactive = 1;
- if (confirm("Continue with", "mget"))
+ if (confirm(argv[0], NULL))
mflag++;
interactive = ointer;
}
@@ -747,41 +755,41 @@ mget(int argc, char *argv[])
void
fget(int argc, char *argv[])
{
- char *buf, *mode;
+ const char *gmode;
FILE *fp;
+ char buf[MAXPATHLEN], cmdbuf[MAX_C_NAME];
if (argc != 2) {
- fprintf(ttyout, "usage: %s localfile\n", argv[0]);
+ UPRINTF("usage: %s localfile\n", argv[0]);
code = -1;
return;
}
fp = fopen(argv[1], "r");
if (fp == NULL) {
- fprintf(ttyout, "Cannot open source file %s\n", argv[1]);
+ fprintf(ttyout, "Can't open source file %s\n", argv[1]);
code = -1;
return;
}
- argv[0] = "get";
- mode = restart_point ? "r+" : "w";
+ (void)strlcpy(cmdbuf, "get", sizeof(cmdbuf));
+ argv[0] = cmdbuf;
+ gmode = restart_point ? "r+" : "w";
- for (;
- (buf = fparseln(fp, NULL, NULL, "\0\0\0", 0)) != NULL;
- free(buf)) {
+ while (get_line(fp, buf, sizeof(buf), NULL) >= 0) {
if (buf[0] == '\0')
continue;
argv[1] = buf;
- (void)getit(argc, argv, 0, mode);
+ (void)getit(argc, argv, 0, gmode);
}
fclose(fp);
}
-char *
-onoff(int bool)
+const char *
+onoff(int val)
{
- return (bool ? "on" : "off");
+ return (val ? "on" : "off");
}
/*
@@ -793,7 +801,7 @@ status(int argc, char *argv[])
{
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
@@ -854,6 +862,8 @@ status(int argc, char *argv[])
fprintf(ttyout, "Use of PORT cmds: %s.\n", onoff(sendport));
fprintf(ttyout, "Use of EPSV/EPRT cmds for IPv4: %s%s.\n", onoff(epsv4),
epsv4bad ? " (disabled for this connection)" : "");
+ fprintf(ttyout, "Use of EPSV/EPRT cmds for IPv6: %s%s.\n", onoff(epsv6),
+ epsv6bad ? " (disabled for this connection)" : "");
fprintf(ttyout, "Command line editing: %s.\n",
#ifdef NO_EDITCOMPLETE
"support not compiled in"
@@ -887,7 +897,7 @@ togglevar(int argc, char *argv[], int *var, const char *mesg)
} else if (argc == 2 && strcasecmp(argv[1], "off") == 0) {
*var = 0;
} else {
- fprintf(ttyout, "usage: %s [ on | off ]\n", argv[0]);
+ UPRINTF("usage: %s [ on | off ]\n", argv[0]);
return (-1);
}
if (mesg)
@@ -916,7 +926,7 @@ setedit(int argc, char *argv[])
#ifdef NO_EDITCOMPLETE
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
@@ -950,7 +960,7 @@ sethash(int argc, char *argv[])
if (argc == 1)
hash = !hash;
else if (argc != 2) {
- fprintf(ttyout, "usage: %s [ on | off | bytecount ]\n",
+ UPRINTF("usage: %s [ on | off | bytecount ]\n",
argv[0]);
code = -1;
return;
@@ -1036,7 +1046,7 @@ setgate(int argc, char *argv[])
static char gsbuf[MAXHOSTNAMELEN];
if (argc == 0 || argc > 3) {
- fprintf(ttyout,
+ UPRINTF(
"usage: %s [ on | off | gateserver [port] ]\n", argv[0]);
code = -1;
return;
@@ -1049,7 +1059,7 @@ setgate(int argc, char *argv[])
gatemode = 0;
else {
if (argc == 3)
- gateport = xstrdup(argv[2]);
+ gateport = ftp_strdup(argv[2]);
(void)strlcpy(gsbuf, argv[1], sizeof(gsbuf));
gateserver = gsbuf;
gatemode = 1;
@@ -1097,15 +1107,14 @@ void
setdebug(int argc, char *argv[])
{
if (argc == 0 || argc > 2) {
- fprintf(ttyout, "usage: %s [ on | off | debuglevel ]\n",
- argv[0]);
+ UPRINTF("usage: %s [ on | off | debuglevel ]\n", argv[0]);
code = -1;
return;
} else if (argc == 2) {
if (strcasecmp(argv[1], "on") == 0)
- debug = 1;
+ ftp_debug = 1;
else if (strcasecmp(argv[1], "off") == 0)
- debug = 0;
+ ftp_debug = 0;
else {
int val;
@@ -1116,16 +1125,16 @@ setdebug(int argc, char *argv[])
code = -1;
return;
}
- debug = val;
+ ftp_debug = val;
}
} else
- debug = !debug;
- if (debug)
+ ftp_debug = !ftp_debug;
+ if (ftp_debug)
options |= SO_DEBUG;
else
options &= ~SO_DEBUG;
- fprintf(ttyout, "Debugging %s (debug=%d).\n", onoff(debug), debug);
- code = debug > 0;
+ fprintf(ttyout, "Debugging %s (ftp_debug=%d).\n", onoff(ftp_debug), ftp_debug);
+ code = ftp_debug > 0;
}
/*
@@ -1138,7 +1147,7 @@ cd(int argc, char *argv[])
if (argc == 0 || argc > 2 ||
(argc == 1 && !another(&argc, &argv, "remote-directory"))) {
- fprintf(ttyout, "usage: %s remote-directory\n", argv[0]);
+ UPRINTF("usage: %s remote-directory\n", argv[0]);
code = -1;
return;
}
@@ -1169,13 +1178,13 @@ lcd(int argc, char *argv[])
argv[1] = localhome;
}
if (argc != 2) {
- fprintf(ttyout, "usage: %s [local-directory]\n", argv[0]);
+ UPRINTF("usage: %s [local-directory]\n", argv[0]);
return;
}
if ((locdir = globulize(argv[1])) == NULL)
return;
if (chdir(locdir) == -1)
- warn("lcd %s", locdir);
+ warn("Can't chdir `%s'", locdir);
else {
updatelocalcwd();
if (localcwd[0]) {
@@ -1197,7 +1206,7 @@ delete(int argc, char *argv[])
if (argc == 0 || argc > 2 ||
(argc == 1 && !another(&argc, &argv, "remote-file"))) {
- fprintf(ttyout, "usage: %s remote-file\n", argv[0]);
+ UPRINTF("usage: %s remote-file\n", argv[0]);
code = -1;
return;
}
@@ -1217,15 +1226,14 @@ mdelete(int argc, char *argv[])
if (argc == 0 ||
(argc == 1 && !another(&argc, &argv, "remote-files"))) {
- fprintf(ttyout, "usage: %s [remote-files]\n", argv[0]);
+ UPRINTF("usage: %s [remote-files]\n", argv[0]);
code = -1;
return;
}
- mname = argv[0];
mflag = 1;
oldintr = xsignal(SIGINT, mintr);
if (sigsetjmp(jabort, 1))
- mabort();
+ mabort(argv[0]);
while ((cp = remglob(argv, 0, NULL)) != NULL) {
if (*cp == '\0') {
mflag = 0;
@@ -1237,7 +1245,7 @@ mdelete(int argc, char *argv[])
if (!mflag && fromatty) {
ointer = interactive;
interactive = 1;
- if (confirm("Continue with", "mdelete")) {
+ if (confirm(argv[0], NULL)) {
mflag++;
}
interactive = ointer;
@@ -1259,7 +1267,7 @@ renamefile(int argc, char *argv[])
goto usage;
if ((argc < 3 && !another(&argc, &argv, "to-name")) || argc > 3) {
usage:
- fprintf(ttyout, "usage: %s from-name to-name\n", argv[0]);
+ UPRINTF("usage: %s from-name to-name\n", argv[0]);
code = -1;
return;
}
@@ -1277,18 +1285,20 @@ renamefile(int argc, char *argv[])
* mlsd MLSD
* nlist NLST
* pdir, pls LIST |$PAGER
- * mmlsd MLSD |$PAGER
+ * pmlsd MLSD |$PAGER
*/
void
ls(int argc, char *argv[])
{
const char *cmd;
- char *remdir, *locfile;
- int freelocfile, pagecmd, mlsdcmd;
+ char *remdir, *locbuf;
+ const char *locfile;
+ int pagecmd, mlsdcmd;
remdir = NULL;
+ locbuf = NULL;
locfile = "-";
- freelocfile = pagecmd = mlsdcmd = 0;
+ pagecmd = mlsdcmd = 0;
/*
* the only commands that start with `p' are
* the `pager' versions.
@@ -1320,41 +1330,38 @@ ls(int argc, char *argv[])
if (argc > 3 || ((pagecmd | mlsdcmd) && argc > 2)) {
usage:
if (pagecmd || mlsdcmd)
- fprintf(ttyout,
- "usage: %s [remote-path]\n", argv[0]);
+ UPRINTF("usage: %s [remote-path]\n", argv[0]);
else
- fprintf(ttyout,
- "usage: %s [remote-path [local-file]]\n",
+ UPRINTF("usage: %s [remote-path [local-file]]\n",
argv[0]);
code = -1;
goto freels;
}
if (pagecmd) {
- char *p;
- int len;
+ const char *p;
+ size_t len;
p = getoptionvalue("pager");
if (EMPTYSTRING(p))
p = DEFAULTPAGER;
len = strlen(p) + 2;
- locfile = xmalloc(len);
- locfile[0] = '|';
- (void)strlcpy(locfile + 1, p, len - 1);
- freelocfile = 1;
+ locbuf = ftp_malloc(len);
+ locbuf[0] = '|';
+ (void)strlcpy(locbuf + 1, p, len - 1);
+ locfile = locbuf;
} else if ((strcmp(locfile, "-") != 0) && *locfile != '|') {
- mname = argv[0];
- if ((locfile = globulize(locfile)) == NULL ||
- !confirm("output to local-file:", locfile)) {
+ if ((locbuf = globulize(locfile)) == NULL ||
+ !confirm("output to local-file:", locbuf)) {
code = -1;
goto freels;
}
- freelocfile = 1;
+ locfile = locbuf;
}
recvrequest(cmd, locfile, remdir, "w", 0, 0);
freels:
- if (freelocfile && locfile)
- (void)free(locfile);
+ if (locbuf)
+ (void)free(locbuf);
}
/*
@@ -1365,8 +1372,9 @@ mls(int argc, char *argv[])
{
sigfunc oldintr;
int ointer, i;
- int dolist;
- char *mode, *dest, *odest;
+ int volatile dolist;
+ char * volatile dest, *odest;
+ const char *lmode;
if (argc == 0)
goto usage;
@@ -1374,13 +1382,12 @@ mls(int argc, char *argv[])
goto usage;
if (argc < 3 && !another(&argc, &argv, "local-file")) {
usage:
- fprintf(ttyout, "usage: %s remote-files local-file\n", argv[0]);
+ UPRINTF("usage: %s remote-files local-file\n", argv[0]);
code = -1;
return;
}
odest = dest = argv[argc - 1];
argv[argc - 1] = NULL;
- mname = argv[0];
if (strcmp(dest, "-") && *dest != '|')
if (((dest = globulize(dest)) == NULL) ||
!confirm("output to local-file:", dest)) {
@@ -1391,15 +1398,15 @@ mls(int argc, char *argv[])
mflag = 1;
oldintr = xsignal(SIGINT, mintr);
if (sigsetjmp(jabort, 1))
- mabort();
+ mabort(argv[0]);
for (i = 1; mflag && i < argc-1 && connected; i++) {
- mode = (i == 1) ? "w" : "a";
- recvrequest(dolist ? "LIST" : "NLST", dest, argv[i], mode,
+ lmode = (i == 1) ? "w" : "a";
+ recvrequest(dolist ? "LIST" : "NLST", dest, argv[i], lmode,
0, 0);
if (!mflag && fromatty) {
ointer = interactive;
interactive = 1;
- if (confirm("Continue with", argv[0])) {
+ if (confirm(argv[0], NULL)) {
mflag++;
}
interactive = ointer;
@@ -1420,11 +1427,12 @@ shell(int argc, char *argv[])
{
pid_t pid;
sigfunc oldintr;
- char shellnam[MAXPATHLEN], *shell, *namep;
+ char shellnam[MAXPATHLEN];
+ const char *shellp, *namep;
int wait_status;
if (argc == 0) {
- fprintf(ttyout, "usage: %s [command [args]]\n", argv[0]);
+ UPRINTF("usage: %s [command [args]]\n", argv[0]);
code = -1;
return;
}
@@ -1433,26 +1441,26 @@ shell(int argc, char *argv[])
for (pid = 3; pid < 20; pid++)
(void)close(pid);
(void)xsignal(SIGINT, SIG_DFL);
- shell = getenv("SHELL");
- if (shell == NULL)
- shell = _PATH_BSHELL;
- namep = strrchr(shell, '/');
+ shellp = getenv("SHELL");
+ if (shellp == NULL)
+ shellp = _PATH_BSHELL;
+ namep = strrchr(shellp, '/');
if (namep == NULL)
- namep = shell;
+ namep = shellp;
else
namep++;
(void)strlcpy(shellnam, namep, sizeof(shellnam));
- if (debug) {
- fputs(shell, ttyout);
+ if (ftp_debug) {
+ fputs(shellp, ttyout);
putc('\n', ttyout);
}
if (argc > 1) {
- execl(shell, shellnam, "-c", altarg, (char *)0);
+ execl(shellp, shellnam, "-c", altarg, (char *)0);
}
else {
- execl(shell, shellnam, (char *)0);
+ execl(shellp, shellnam, (char *)0);
}
- warn("%s", shell);
+ warn("Can't execute `%s'", shellp);
code = -1;
exit(1);
}
@@ -1461,7 +1469,7 @@ shell(int argc, char *argv[])
;
(void)xsignal(SIGINT, oldintr);
if (pid == -1) {
- warn("Try again later");
+ warn("Can't fork a subshell; try again later");
code = -1;
} else
code = 0;
@@ -1473,7 +1481,8 @@ shell(int argc, char *argv[])
void
user(int argc, char *argv[])
{
- char acct[80];
+ char *password;
+ char emptypass[] = "";
int n, aflag = 0;
if (argc == 0)
@@ -1482,7 +1491,7 @@ user(int argc, char *argv[])
(void)another(&argc, &argv, "username");
if (argc < 2 || argc > 4) {
usage:
- fprintf(ttyout, "usage: %s username [password [account]]\n",
+ UPRINTF("usage: %s username [password [account]]\n",
argv[0]);
code = -1;
return;
@@ -1490,34 +1499,35 @@ user(int argc, char *argv[])
n = command("USER %s", argv[1]);
if (n == CONTINUE) {
if (argc < 3) {
- argv[2] = getpass("Password: ");
- argc++;
+ password = getpass("Password: ");
+ if (password == NULL)
+ password = emptypass;
+ } else {
+ password = argv[2];
}
- n = command("PASS %s", argv[2]);
+ n = command("PASS %s", password);
+ memset(password, 0, strlen(password));
}
if (n == CONTINUE) {
+ aflag++;
if (argc < 4) {
- (void)fputs("Account: ", ttyout);
- (void)fflush(ttyout);
- if (fgets(acct, sizeof(acct) - 1, stdin) == NULL) {
- fprintf(ttyout,
- "\nEOF received; login aborted.\n");
- clearerr(stdin);
- code = -1;
- return;
- }
- acct[strlen(acct) - 1] = '\0';
- argv[3] = acct; argc++;
+ password = getpass("Account: ");
+ if (password == NULL)
+ password = emptypass;
+ } else {
+ password = argv[3];
}
- n = command("ACCT %s", argv[3]);
- aflag++;
+ n = command("ACCT %s", password);
+ memset(password, 0, strlen(password));
}
if (n != COMPLETE) {
fputs("Login failed.\n", ttyout);
return;
}
if (!aflag && argc == 4) {
- (void)command("ACCT %s", argv[3]);
+ password = argv[3];
+ (void)command("ACCT %s", password);
+ memset(password, 0, strlen(password));
}
connected = -1;
getremoteinfo();
@@ -1533,7 +1543,7 @@ pwd(int argc, char *argv[])
code = -1;
if (argc != 1) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
return;
}
if (! remotecwd[0])
@@ -1555,7 +1565,7 @@ lpwd(int argc, char *argv[])
code = -1;
if (argc != 1) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
return;
}
if (! localcwd[0])
@@ -1578,7 +1588,7 @@ makedir(int argc, char *argv[])
if (argc == 0 || argc > 2 ||
(argc == 1 && !another(&argc, &argv, "directory-name"))) {
- fprintf(ttyout, "usage: %s directory-name\n", argv[0]);
+ UPRINTF("usage: %s directory-name\n", argv[0]);
code = -1;
return;
}
@@ -1603,7 +1613,7 @@ removedir(int argc, char *argv[])
if (argc == 0 || argc > 2 ||
(argc == 1 && !another(&argc, &argv, "directory-name"))) {
- fprintf(ttyout, "usage: %s directory-name\n", argv[0]);
+ UPRINTF("usage: %s directory-name\n", argv[0]);
code = -1;
return;
}
@@ -1627,7 +1637,7 @@ quote(int argc, char *argv[])
if (argc == 0 ||
(argc == 1 && !another(&argc, &argv, "command line to send"))) {
- fprintf(ttyout, "usage: %s line-to-send\n", argv[0]);
+ UPRINTF("usage: %s line-to-send\n", argv[0]);
code = -1;
return;
}
@@ -1645,7 +1655,7 @@ site(int argc, char *argv[])
if (argc == 0 ||
(argc == 1 && !another(&argc, &argv, "arguments to SITE command"))){
- fprintf(ttyout, "usage: %s line-to-send\n", argv[0]);
+ UPRINTF("usage: %s line-to-send\n", argv[0]);
code = -1;
return;
}
@@ -1683,7 +1693,7 @@ do_chmod(int argc, char *argv[])
goto usage;
if ((argc < 3 && !another(&argc, &argv, "remote-file")) || argc > 3) {
usage:
- fprintf(ttyout, "usage: %s mode remote-file\n", argv[0]);
+ UPRINTF("usage: %s mode remote-file\n", argv[0]);
code = -1;
return;
}
@@ -1702,7 +1712,7 @@ do_umask(int argc, char *argv[])
int oldverbose = verbose;
if (argc == 0) {
- fprintf(ttyout, "usage: %s [umask]\n", argv[0]);
+ UPRINTF("usage: %s [umask]\n", argv[0]);
code = -1;
return;
}
@@ -1717,7 +1727,7 @@ idlecmd(int argc, char *argv[])
int oldverbose = verbose;
if (argc < 1 || argc > 2) {
- fprintf(ttyout, "usage: %s [seconds]\n", argv[0]);
+ UPRINTF("usage: %s [seconds]\n", argv[0]);
code = -1;
return;
}
@@ -1735,7 +1745,7 @@ rmthelp(int argc, char *argv[])
int oldverbose = verbose;
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
@@ -1755,7 +1765,7 @@ quit(int argc, char *argv[])
/* this may be called with argc == 0, argv == NULL */
if (argc == 0 && argv != NULL) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
@@ -1777,7 +1787,7 @@ disconnect(int argc, char *argv[])
/* this may be called with argc == 0, argv == NULL */
if (argc == 0 && argv != NULL) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
@@ -1791,17 +1801,22 @@ void
account(int argc, char *argv[])
{
char *ap;
+ char emptypass[] = "";
if (argc == 0 || argc > 2) {
- fprintf(ttyout, "usage: %s [password]\n", argv[0]);
+ UPRINTF("usage: %s [password]\n", argv[0]);
code = -1;
return;
}
else if (argc == 2)
ap = argv[1];
- else
+ else {
ap = getpass("Account:");
+ if (ap == NULL)
+ ap = emptypass;
+ }
(void)command("ACCT %s", ap);
+ memset(ap, 0, strlen(ap));
}
sigjmp_buf abortprox;
@@ -1831,9 +1846,10 @@ doproxy(int argc, char *argv[])
struct cmd *c;
int cmdpos;
sigfunc oldintr;
+ char cmdbuf[MAX_C_NAME];
if (argc == 0 || (argc == 1 && !another(&argc, &argv, "command"))) {
- fprintf(ttyout, "usage: %s command\n", argv[0]);
+ UPRINTF("usage: %s command\n", argv[0]);
code = -1;
return;
}
@@ -1869,7 +1885,8 @@ doproxy(int argc, char *argv[])
cmdpos = strcspn(line, " \t");
if (cmdpos > 0) /* remove leading "proxy " from input buffer */
memmove(line, line + cmdpos + 1, strlen(line) - cmdpos + 1);
- argv[1] = c->c_name;
+ (void)strlcpy(cmdbuf, c->c_name, sizeof(cmdbuf));
+ argv[1] = cmdbuf;
(*c->c_handler)(argc-1, argv+1);
if (connected) {
proxflag = 1;
@@ -1925,7 +1942,7 @@ setntrans(int argc, char *argv[])
{
if (argc == 0 || argc > 3) {
- fprintf(ttyout, "usage: %s [inchars [outchars]]\n", argv[0]);
+ UPRINTF("usage: %s [inchars [outchars]]\n", argv[0]);
code = -1;
return;
}
@@ -1961,7 +1978,7 @@ dotrans(char *dst, size_t dlen, const char *src)
found++;
if (i < ostop) {
*cp2++ = *(ntout + i);
- if (cp2 - dst >= dlen - 1)
+ if (cp2 - dst >= (ptrdiff_t)(dlen - 1))
goto out;
}
break;
@@ -1989,7 +2006,7 @@ setnmap(int argc, char *argv[])
}
if (argc == 0 ||
(argc < 3 && !another(&argc, &argv, "mapout")) || argc > 3) {
- fprintf(ttyout, "usage: %s [mapin mapout]\n", argv[0]);
+ UPRINTF("usage: %s [mapin mapout]\n", argv[0]);
code = -1;
return;
}
@@ -2189,7 +2206,7 @@ setpassive(int argc, char *argv[])
activefallback = passivemode;
} else if (argc != 2) {
passiveusage:
- fprintf(ttyout, "usage: %s [ on | off | auto ]\n", argv[0]);
+ UPRINTF("usage: %s [ on | off | auto ]\n", argv[0]);
code = -1;
return;
} else if (strcasecmp(argv[1], "on") == 0) {
@@ -2208,16 +2225,31 @@ setpassive(int argc, char *argv[])
code = passivemode;
}
+
void
setepsv4(int argc, char *argv[])
{
-
code = togglevar(argc, argv, &epsv4,
verbose ? "EPSV/EPRT on IPv4" : NULL);
epsv4bad = 0;
}
void
+setepsv6(int argc, char *argv[])
+{
+ code = togglevar(argc, argv, &epsv6,
+ verbose ? "EPSV/EPRT on IPv6" : NULL);
+ epsv6bad = 0;
+}
+
+void
+setepsv(int argc, char*argv[])
+{
+ setepsv4(argc,argv);
+ setepsv6(argc,argv);
+}
+
+void
setsunique(int argc, char *argv[])
{
@@ -2240,11 +2272,11 @@ parserate(int argc, char *argv[], int cmdlineopt)
if (argc > 4 || (argc < (cmdlineopt ? 3 : 2))) {
usage:
if (cmdlineopt)
- fprintf(ttyout,
+ UPRINTF(
"usage: %s (all|get|put),maximum-bytes[,increment-bytes]]\n",
argv[0]);
else
- fprintf(ttyout,
+ UPRINTF(
"usage: %s (all|get|put) [maximum-bytes [increment-bytes]]\n",
argv[0]);
return -1;
@@ -2316,7 +2348,7 @@ cdup(int argc, char *argv[])
int r;
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
@@ -2341,7 +2373,7 @@ restart(int argc, char *argv[])
{
if (argc == 0 || argc > 2) {
- fprintf(ttyout, "usage: %s [restart-point]\n", argv[0]);
+ UPRINTF("usage: %s [restart-point]\n", argv[0]);
code = -1;
return;
}
@@ -2378,7 +2410,7 @@ syst(int argc, char *argv[])
int oldverbose = verbose;
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
@@ -2403,7 +2435,7 @@ macdef(int argc, char *argv[])
}
if ((argc < 2 && !another(&argc, &argv, "macro name")) || argc > 2) {
usage:
- fprintf(ttyout, "usage: %s macro_name\n", argv[0]);
+ UPRINTF("usage: %s macro_name\n", argv[0]);
code = -1;
return;
}
@@ -2461,7 +2493,7 @@ sizecmd(int argc, char *argv[])
if (argc == 0 || argc > 2 ||
(argc == 1 && !another(&argc, &argv, "remote-file"))) {
- fprintf(ttyout, "usage: %s remote-file\n", argv[0]);
+ UPRINTF("usage: %s remote-file\n", argv[0]);
code = -1;
return;
}
@@ -2482,13 +2514,14 @@ modtime(int argc, char *argv[])
if (argc == 0 || argc > 2 ||
(argc == 1 && !another(&argc, &argv, "remote-file"))) {
- fprintf(ttyout, "usage: %s remote-file\n", argv[0]);
+ UPRINTF("usage: %s remote-file\n", argv[0]);
code = -1;
return;
}
mtime = remotemodtime(argv[1], 1);
if (mtime != -1)
- fprintf(ttyout, "%s\t%s", argv[1], asctime(localtime(&mtime)));
+ fprintf(ttyout, "%s\t%s", argv[1],
+ rfc2822time(localtime(&mtime)));
code = (mtime > 0);
}
@@ -2500,7 +2533,7 @@ rmtstatus(int argc, char *argv[])
{
if (argc == 0) {
- fprintf(ttyout, "usage: %s [remote-file]\n", argv[0]);
+ UPRINTF("usage: %s [remote-file]\n", argv[0]);
code = -1;
return;
}
@@ -2526,12 +2559,13 @@ newer(int argc, char *argv[])
void
lpage(int argc, char *argv[])
{
- int len;
- char *p, *pager, *locfile;
+ size_t len;
+ const char *p;
+ char *pager, *locfile;
if (argc == 0 || argc > 2 ||
(argc == 1 && !another(&argc, &argv, "local-file"))) {
- fprintf(ttyout, "usage: %s local-file\n", argv[0]);
+ UPRINTF("usage: %s local-file\n", argv[0]);
code = -1;
return;
}
@@ -2543,7 +2577,7 @@ lpage(int argc, char *argv[])
if (EMPTYSTRING(p))
p = DEFAULTPAGER;
len = strlen(p) + strlen(locfile) + 2;
- pager = xmalloc(len);
+ pager = ftp_malloc(len);
(void)strlcpy(pager, p, len);
(void)strlcat(pager, " ", len);
(void)strlcat(pager, locfile, len);
@@ -2559,12 +2593,14 @@ lpage(int argc, char *argv[])
void
page(int argc, char *argv[])
{
- int ohash, orestart_point, overbose, len;
- char *p, *pager;
+ int ohash, orestart_point, overbose;
+ size_t len;
+ const char *p;
+ char *pager;
if (argc == 0 || argc > 2 ||
(argc == 1 && !another(&argc, &argv, "remote-file"))) {
- fprintf(ttyout, "usage: %s remote-file\n", argv[0]);
+ UPRINTF("usage: %s remote-file\n", argv[0]);
code = -1;
return;
}
@@ -2572,7 +2608,7 @@ page(int argc, char *argv[])
if (EMPTYSTRING(p))
p = DEFAULTPAGER;
len = strlen(p) + 2;
- pager = xmalloc(len);
+ pager = ftp_malloc(len);
pager[0] = '|';
(void)strlcpy(pager + 1, p, len - 1);
@@ -2597,7 +2633,7 @@ setxferbuf(int argc, char *argv[])
if (argc != 2) {
usage:
- fprintf(ttyout, "usage: %s size\n", argv[0]);
+ UPRINTF("usage: %s size\n", argv[0]);
code = -1;
return;
}
@@ -2637,7 +2673,7 @@ setoption(int argc, char *argv[])
code = -1;
if (argc == 0 || (argc != 1 && argc != 3)) {
- fprintf(ttyout, "usage: %s [option value]\n", argv[0]);
+ UPRINTF("usage: %s [option value]\n", argv[0]);
return;
}
@@ -2648,20 +2684,28 @@ setoption(int argc, char *argv[])
o->name, o->value ? o->value : "");
}
} else {
- o = getoption(argv[1]);
- if (o == NULL) {
- fprintf(ttyout, "No such option `%s'.\n", argv[1]);
- return;
- }
- FREEPTR(o->value);
- o->value = xstrdup(argv[2]);
- if (verbose)
- fprintf(ttyout, "Setting `%s' to `%s'.\n",
- o->name, o->value);
+ set_option(argv[1], argv[2], 1);
}
code = 0;
}
+void
+set_option(const char * option, const char * value, int doverbose)
+{
+ struct option *o;
+
+ o = getoption(option);
+ if (o == NULL) {
+ fprintf(ttyout, "No such option `%s'.\n", option);
+ return;
+ }
+ FREEPTR(o->value);
+ o->value = ftp_strdup(value);
+ if (verbose && doverbose)
+ fprintf(ttyout, "Setting `%s' to `%s'.\n",
+ o->name, o->value);
+}
+
/*
* Unset an option
*/
@@ -2672,7 +2716,7 @@ unsetoption(int argc, char *argv[])
code = -1;
if (argc == 0 || argc != 2) {
- fprintf(ttyout, "usage: %s option\n", argv[0]);
+ UPRINTF("usage: %s option\n", argv[0]);
return;
}
@@ -2695,7 +2739,7 @@ feat(int argc, char *argv[])
int oldverbose = verbose;
if (argc == 0) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
@@ -2715,7 +2759,7 @@ mlst(int argc, char *argv[])
int oldverbose = verbose;
if (argc < 1 || argc > 2) {
- fprintf(ttyout, "usage: %s [remote-path]\n", argv[0]);
+ UPRINTF("usage: %s [remote-path]\n", argv[0]);
code = -1;
return;
}
@@ -2735,7 +2779,7 @@ opts(int argc, char *argv[])
int oldverbose = verbose;
if (argc < 2 || argc > 3) {
- fprintf(ttyout, "usage: %s command [options]\n", argv[0]);
+ UPRINTF("usage: %s command [options]\n", argv[0]);
code = -1;
return;
}
diff --git a/contrib/lukemftp/src/cmdtab.c b/contrib/tnftp/src/cmdtab.c
index 04efade..dec48e8 100644
--- a/contrib/lukemftp/src/cmdtab.c
+++ b/contrib/tnftp/src/cmdtab.c
@@ -1,7 +1,8 @@
-/* $NetBSD: cmdtab.c,v 1.44 2005/04/11 01:49:31 lukem Exp $ */
+/* $NetBSD: cmdtab.c,v 1.11 2009/05/20 12:53:47 lukem Exp $ */
+/* from NetBSD: cmdtab.c,v 1.51 2009/04/12 10:18:52 lukem Exp */
/*-
- * Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -15,13 +16,6 @@
* 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
@@ -65,16 +59,23 @@
* SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cmdtab.c 8.4 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: cmdtab.c,v 1.44 2005/04/11 01:49:31 lukem Exp $");
+__RCSID(" NetBSD: cmdtab.c,v 1.51 2009/04/12 10:18:52 lukem Exp ");
#endif
#endif /* not lint */
#include <stdio.h>
+
+#endif /* tnftp */
+
#include "ftp_var.h"
/*
@@ -100,7 +101,9 @@ HSTR deletehelp[] = "delete remote file";
HSTR disconhelp[] = "terminate ftp session";
HSTR domachelp[] = "execute macro";
HSTR edithelp[] = "toggle command line editing";
+HSTR epsvhelp[] = "toggle use of EPSV/EPRT on both IPv4 and IPV6 ftp";
HSTR epsv4help[] = "toggle use of EPSV/EPRT on IPv4 ftp";
+HSTR epsv6help[] = "toggle use of EPSV/EPRT on IPv6 ftp";
HSTR feathelp[] = "show FEATures supported by remote system";
HSTR formhelp[] = "set file transfer format";
HSTR gatehelp[] = "toggle gate-ftp; specify host[:port] to change proxy";
@@ -211,7 +214,9 @@ struct cmd cmdtab[] = {
{ "dir", H(lshelp), 1, 1, 1, CMPL(rl) ls },
{ "disconnect", H(disconhelp), 0, 1, 1, CMPL0 disconnect },
{ "edit", H(edithelp), 0, 0, 0, CMPL0 setedit },
+ { "epsv", H(epsvhelp), 0, 0, 0, CMPL0 setepsv },
{ "epsv4", H(epsv4help), 0, 0, 0, CMPL0 setepsv4 },
+ { "epsv6", H(epsv6help), 0, 0, 0, CMPL0 setepsv6 },
{ "exit", H(quithelp), 0, 0, 0, CMPL0 quit },
{ "features", H(feathelp), 0, 1, 1, CMPL0 feat },
{ "fget", H(fgethelp), 1, 1, 1, CMPL(l) fget },
@@ -294,7 +299,7 @@ struct cmd cmdtab[] = {
{ "verbose", H(verbosehelp), 0, 0, 0, CMPL0 setverbose },
{ "xferbuf", H(xferbufhelp), 0, 0, 0, CMPL0 setxferbuf },
{ "?", H(helphelp), 0, 0, 1, CMPL(C) help },
- { 0 },
+ { NULL, NULL, 0, 0, 0, CMPL0 NULL },
};
struct option optiontab[] = {
@@ -305,5 +310,5 @@ struct option optiontab[] = {
{ "pager", NULL },
{ "prompt", NULL },
{ "rprompt", NULL },
- { 0 },
+ { NULL, NULL },
};
diff --git a/contrib/lukemftp/src/complete.c b/contrib/tnftp/src/complete.c
index 8831bc1..df75d3a 100644
--- a/contrib/lukemftp/src/complete.c
+++ b/contrib/tnftp/src/complete.c
@@ -1,7 +1,8 @@
-/* $NetBSD: complete.c,v 1.38 2000/05/01 10:35:17 lukem Exp $ */
+/* $NetBSD: complete.c,v 1.10 2009/05/20 12:53:47 lukem Exp $ */
+/* from NetBSD: complete.c,v 1.46 2009/04/12 10:18:52 lukem Exp */
/*-
- * Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -15,13 +16,6 @@
* 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
@@ -36,9 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: complete.c,v 1.38 2000/05/01 10:35:17 lukem Exp $");
+__RCSID(" NetBSD: complete.c,v 1.46 2009/04/12 10:18:52 lukem Exp ");
#endif /* not lint */
/*
@@ -54,6 +52,8 @@ __RCSID("$NetBSD: complete.c,v 1.38 2000/05/01 10:35:17 lukem Exp $");
#include <stdlib.h>
#include <string.h>
+#endif /* tnftp */
+
#include "ftp_var.h"
#ifndef NO_EDITCOMPLETE
@@ -68,7 +68,7 @@ static unsigned char complete_remote (char *, int);
static int
comparstr(const void *a, const void *b)
{
- return (strcmp(*(const char **)a, *(const char **)b));
+ return (strcmp(*(const char * const *)a, *(const char * const *)b));
}
/*
@@ -87,7 +87,7 @@ complete_ambiguous(char *word, int list, StringList *words)
{
char insertstr[MAXPATHLEN];
char *lastmatch, *p;
- int i, j;
+ size_t i, j;
size_t matchlen, wordlen;
wordlen = strlen(word);
@@ -143,14 +143,14 @@ complete_command(char *word, int list)
size_t wordlen;
unsigned char rv;
- words = xsl_init();
+ words = ftp_sl_init();
wordlen = strlen(word);
for (c = cmdtab; c->c_name != NULL; c++) {
if (wordlen > strlen(c->c_name))
continue;
if (strncmp(word, c->c_name, wordlen) == 0)
- xsl_add(words, c->c_name);
+ ftp_sl_add(words, ftp_strdup(c->c_name));
}
rv = complete_ambiguous(word, list, words);
@@ -158,7 +158,7 @@ complete_command(char *word, int list)
if (el_insertstr(el, " ") == -1)
rv = CC_ERROR;
}
- sl_free(words, 0);
+ sl_free(words, 1);
return (rv);
}
@@ -200,7 +200,7 @@ complete_local(char *word, int list)
if ((dd = opendir(dir)) == NULL)
return (CC_ERROR);
- words = xsl_init();
+ words = ftp_sl_init();
len = strlen(file);
for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
@@ -217,8 +217,8 @@ complete_local(char *word, int list)
if (strncmp(file, dp->d_name, len) == 0) {
char *tcp;
- tcp = xstrdup(dp->d_name);
- xsl_add(words, tcp);
+ tcp = ftp_strdup(dp->d_name);
+ ftp_sl_add(words, tcp);
}
}
closedir(dd);
@@ -255,14 +255,14 @@ complete_option(char *word, int list)
size_t wordlen;
unsigned char rv;
- words = xsl_init();
+ words = ftp_sl_init();
wordlen = strlen(word);
for (o = optiontab; o->name != NULL; o++) {
if (wordlen > strlen(o->name))
continue;
if (strncmp(word, o->name, wordlen) == 0)
- xsl_add(words, o->name);
+ ftp_sl_add(words, ftp_strdup(o->name));
}
rv = complete_ambiguous(word, list, words);
@@ -270,7 +270,7 @@ complete_option(char *word, int list)
if (el_insertstr(el, " ") == -1)
rv = CC_ERROR;
}
- sl_free(words, 0);
+ sl_free(words, 1);
return (rv);
}
@@ -285,10 +285,13 @@ complete_remote(char *word, int list)
StringList *words;
char dir[MAXPATHLEN];
char *file, *cp;
- int i;
+ size_t i;
unsigned char rv;
+ char cmdbuf[MAX_C_NAME];
+ char *dummyargv[3] = { NULL, NULL, NULL };
- char *dummyargv[] = { "complete", NULL, NULL };
+ (void)strlcpy(cmdbuf, "complete", sizeof(cmdbuf));
+ dummyargv[0] = cmdbuf;
dummyargv[1] = dir;
if ((file = strrchr(word, '/')) == NULL) {
@@ -304,11 +307,11 @@ complete_remote(char *word, int list)
if (dirchange || dirlist == NULL ||
strcmp(dir, lastdir) != 0) { /* dir not cached */
- char *emesg;
+ const char *emesg;
if (dirlist != NULL)
sl_free(dirlist, 1);
- dirlist = xsl_init();
+ dirlist = ftp_sl_init();
mflag = 1;
emesg = NULL;
@@ -326,8 +329,8 @@ complete_remote(char *word, int list)
tcp++;
else
tcp = cp;
- tcp = xstrdup(tcp);
- xsl_add(dirlist, tcp);
+ tcp = ftp_strdup(tcp);
+ ftp_sl_add(dirlist, tcp);
}
if (emesg != NULL) {
fprintf(ttyout, "\n%s\n", emesg);
@@ -337,13 +340,13 @@ complete_remote(char *word, int list)
dirchange = 0;
}
- words = xsl_init();
+ words = ftp_sl_init();
for (i = 0; i < dirlist->sl_cur; i++) {
cp = dirlist->sl_str[i];
if (strlen(file) > strlen(cp))
continue;
if (strncmp(file, cp, strlen(file)) == 0)
- xsl_add(words, cp);
+ ftp_sl_add(words, cp);
}
rv = complete_ambiguous(file, list, words);
sl_free(words, 0);
@@ -354,17 +357,17 @@ complete_remote(char *word, int list)
* Generic complete routine
*/
unsigned char
-complete(EditLine *el, int ch)
+complete(EditLine *cel, int ch)
{
static char word[FTPBUFLEN];
- static int lastc_argc, lastc_argo;
+ static size_t lastc_argc, lastc_argo;
struct cmd *c;
const LineInfo *lf;
- int celems, dolist, cmpltype;
- size_t len;
+ int dolist, cmpltype;
+ size_t celems, len;
- lf = el_line(el);
+ lf = el_line(cel);
len = lf->lastchar - lf->buffer;
if (len >= sizeof(line))
return (CC_ERROR);
@@ -383,7 +386,7 @@ complete(EditLine *el, int ch)
&& strncmp(word, margv[cursor_argc] ? margv[cursor_argc] : "",
cursor_argo) == 0)
dolist = 1;
- else if (cursor_argc < margc)
+ else if (cursor_argc < (size_t)margc)
(void)strlcpy(word, margv[cursor_argc], cursor_argo + 1);
word[cursor_argo] = '\0';
@@ -426,7 +429,8 @@ complete(EditLine *el, int ch)
}
return (complete_remote(word, dolist));
default:
- errx(1, "unknown complete type `%c'", cmpltype);
+ errx(1, "complete: unknown complete type `%c'",
+ cmpltype);
return (CC_ERROR);
}
/* NOTREACHED */
diff --git a/contrib/lukemftp/src/domacro.c b/contrib/tnftp/src/domacro.c
index 2e10e1c..b8fde0c 100644
--- a/contrib/lukemftp/src/domacro.c
+++ b/contrib/tnftp/src/domacro.c
@@ -1,4 +1,5 @@
-/* $NetBSD: domacro.c,v 1.20 2003/08/07 11:13:53 agc Exp $ */
+/* $NetBSD: domacro.c,v 1.8 2009/05/20 12:53:47 lukem Exp $ */
+/* from NetBSD: domacro.c,v 1.22 2009/04/12 10:18:52 lukem Exp */
/*
* Copyright (c) 1985, 1993, 1994
@@ -29,12 +30,16 @@
* SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)domacro.c 8.3 (Berkeley) 4/2/94";
#else
-__RCSID("$NetBSD: domacro.c,v 1.20 2003/08/07 11:13:53 agc Exp $");
+__RCSID(" NetBSD: domacro.c,v 1.22 2009/04/12 10:18:52 lukem Exp ");
#endif
#endif /* not lint */
@@ -42,6 +47,8 @@ __RCSID("$NetBSD: domacro.c,v 1.20 2003/08/07 11:13:53 agc Exp $");
#include <stdio.h>
#include <string.h>
+#endif /* tnftp */
+
#include "ftp_var.h"
void
@@ -50,10 +57,11 @@ domacro(int argc, char *argv[])
int i, j, count = 2, loopflg = 0;
char *cp1, *cp2, line2[FTPBUFLEN];
struct cmd *c;
+ char cmdbuf[MAX_C_NAME];
if ((argc == 0 && argv != NULL) ||
(argc < 2 && !another(&argc, &argv, "macro name"))) {
- fprintf(ttyout, "usage: %s macro_name [args]\n", argv[0]);
+ UPRINTF("usage: %s macro_name [args]\n", argv[0]);
code = -1;
return;
}
@@ -126,7 +134,8 @@ domacro(int argc, char *argv[])
fputs(line, ttyout);
putc('\n', ttyout);
}
- margv[0] = c->c_name;
+ (void)strlcpy(cmdbuf, c->c_name, sizeof(cmdbuf));
+ margv[0] = cmdbuf;
(*c->c_handler)(margc, margv);
if (bell && c->c_bell)
(void)putc('\007', ttyout);
diff --git a/contrib/lukemftp/src/extern.h b/contrib/tnftp/src/extern.h
index f2b802a..9b6c645 100644
--- a/contrib/lukemftp/src/extern.h
+++ b/contrib/tnftp/src/extern.h
@@ -1,7 +1,8 @@
-/* $NetBSD: extern.h,v 1.67 2005/05/14 15:26:43 lukem Exp $ */
+/* $NetBSD: extern.h,v 1.12 2009/11/15 10:12:37 lukem Exp $ */
+/* from NetBSD: extern.h,v 1.77 2009/07/13 19:05:41 roy Exp */
/*-
- * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -15,13 +16,6 @@
* 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
@@ -118,7 +112,7 @@ void cmdabort(int);
void cmdtimeout(int);
void cmdscanner(void);
int command(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2)));
+ ;
#ifndef NO_EDITCOMPLETE
unsigned char complete(EditLine *, int);
void controlediting(void);
@@ -141,6 +135,7 @@ int ftp_login(const char *, const char *, const char *);
void get(int, char **);
struct cmd *getcmd(const char *);
int getit(int, char **, int, const char *);
+int get_line(FILE *, char *, size_t, const char **);
struct option *getoption(const char *);
char *getoptionvalue(const char *);
void getremoteinfo(void);
@@ -148,7 +143,7 @@ int getreply(int);
char *globulize(const char *);
char *gunique(const char *);
void help(int, char **);
-char *hookup(char *, char *);
+char *hookup(const char *, const char *);
void idlecmd(int, char **);
int initconn(void);
void intr(int);
@@ -159,22 +154,19 @@ void lostpeer(int);
void lpage(int, char **);
void lpwd(int, char **);
void ls(int, char **);
-void mabort(void);
void macdef(int, char **);
void makeargv(void);
void makedir(int, char **);
void mdelete(int, char **);
void mget(int, char **);
-void mintr(int);
void mls(int, char **);
void mlst(int, char **);
void modtime(int, char **);
void mput(int, char **);
-char *onoff(int);
+const char *onoff(int);
void opts(int, char **);
void newer(int, char **);
void page(int, char **);
-int parseport(const char *, int);
int parserate(int, char **, int);
char *prompt(void);
void proxabort(int);
@@ -189,18 +181,18 @@ void quote1(const char *, int, char **);
void recvrequest(const char *, const char *, const char *,
const char *, int, int);
void reget(int, char **);
-char *remglob(char **, int, char **);
+char *remglob(char **, int, const char **);
time_t remotemodtime(const char *, int);
off_t remotesize(const char *, int);
void removedir(int, char **);
void renamefile(int, char **);
void reset(int, char **);
void restart(int, char **);
+const char *rfc2822time(const struct tm *);
void rmthelp(int, char **);
void rmtstatus(int, char **);
char *rprompt(void);
-int ruserpass(const char *, const char **, const char **,
- const char **);
+int ruserpass(const char *, char **, char **, char **);
void sendrequest(const char *, const char *, const char *, int);
void setascii(int, char **);
void setbell(int, char **);
@@ -210,6 +202,8 @@ void setcr(int, char **);
void setdebug(int, char **);
void setedit(int, char **);
void setepsv4(int, char **);
+void setepsv6(int, char **);
+void setepsv(int, char **);
void setform(int, char **);
void setftmode(int, char **);
void setgate(int, char **);
@@ -235,6 +229,7 @@ void settype(int, char **);
void setupsockbufsize(int);
void setverbose(int, char **);
void setxferbuf(int, char **);
+void set_option(const char *, const char *, int);
void shell(int, char **);
void site(int, char **);
void sizecmd(int, char **);
@@ -248,10 +243,10 @@ void updatelocalcwd(void);
void updateremotecwd(void);
void usage(void);
void user(int, char **);
-int xconnect(int, const struct sockaddr *, socklen_t);
-int xlisten(int, int);
-int xpoll(struct pollfd *, int, int);
-void *xmalloc(size_t);
-StringList *xsl_init(void);
-void xsl_add(StringList *, char *);
-char *xstrdup(const char *);
+int ftp_connect(int, const struct sockaddr *, socklen_t);
+int ftp_listen(int, int);
+int ftp_poll(struct pollfd *, int, int);
+void *ftp_malloc(size_t);
+StringList *ftp_sl_init(void);
+void ftp_sl_add(StringList *, char *);
+char *ftp_strdup(const char *);
diff --git a/contrib/lukemftp/src/fetch.c b/contrib/tnftp/src/fetch.c
index e2acb01..91b49fd 100644
--- a/contrib/lukemftp/src/fetch.c
+++ b/contrib/tnftp/src/fetch.c
@@ -1,7 +1,8 @@
-/* $NetBSD: fetch.c,v 1.158 2005/05/14 15:26:43 lukem Exp $ */
+/* $NetBSD: fetch.c,v 1.18 2009/11/15 10:12:37 lukem Exp $ */
+/* from NetBSD: fetch.c,v 1.191 2009/08/17 09:08:16 christos Exp */
/*-
- * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -18,13 +19,6 @@
* 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
@@ -39,9 +33,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.158 2005/05/14 15:26:43 lukem Exp $");
+__RCSID(" NetBSD: fetch.c,v 1.191 2009/08/17 09:08:16 christos Exp ");
#endif /* not lint */
/*
@@ -69,7 +67,8 @@ __RCSID("$NetBSD: fetch.c,v 1.158 2005/05/14 15:26:43 lukem Exp $");
#include <string.h>
#include <unistd.h>
#include <time.h>
-#include <libutil.h>
+
+#endif /* tnftp */
#include "ftp_var.h"
#include "version.h"
@@ -113,7 +112,7 @@ static int redirect_loop;
* Determine if token is the next word in buf (case insensitive).
* If so, advance buf past the token and any trailing LWS, and
* return a pointer to the token (in buf). Otherwise, return NULL.
- * token may be preceeded by LWS.
+ * token may be preceded by LWS.
* token must be followed by LWS or NUL. (I.e, don't partial match).
*/
static const char *
@@ -147,9 +146,10 @@ static int
auth_url(const char *challenge, char **response, const char *guser,
const char *gpass)
{
- const char *cp, *scheme;
+ const char *cp, *scheme, *errormsg;
char *ep, *clear, *realm;
- char user[BUFSIZ], *pass;
+ char uuser[BUFSIZ], *gotpass;
+ const char *upass;
int rval;
size_t len, clen, rlen;
@@ -158,12 +158,12 @@ auth_url(const char *challenge, char **response, const char *guser,
rval = -1;
cp = challenge;
scheme = "Basic"; /* only support Basic authentication */
+ gotpass = NULL;
- if (debug)
- fprintf(ttyout, "auth_url: challenge `%s'\n", challenge);
+ DPRINTF("auth_url: challenge `%s'\n", challenge);
if (! match_token(&cp, scheme)) {
- warnx("Unsupported authentication challenge - `%s'",
+ warnx("Unsupported authentication challenge `%s'",
challenge);
goto cleanup_auth_url;
}
@@ -172,50 +172,54 @@ auth_url(const char *challenge, char **response, const char *guser,
if (STRNEQUAL(cp, REALM))
cp += sizeof(REALM) - 1;
else {
- warnx("Unsupported authentication challenge - `%s'",
+ warnx("Unsupported authentication challenge `%s'",
challenge);
goto cleanup_auth_url;
}
/* XXX: need to improve quoted-string parsing to support \ quoting, etc. */
if ((ep = strchr(cp, '\"')) != NULL) {
- size_t len = ep - cp;
-
- realm = (char *)xmalloc(len + 1);
+ len = ep - cp;
+ realm = (char *)ftp_malloc(len + 1);
(void)strlcpy(realm, cp, len + 1);
} else {
- warnx("Unsupported authentication challenge - `%s'",
+ warnx("Unsupported authentication challenge `%s'",
challenge);
goto cleanup_auth_url;
}
fprintf(ttyout, "Username for `%s': ", realm);
if (guser != NULL) {
- (void)strlcpy(user, guser, sizeof(user));
- fprintf(ttyout, "%s\n", user);
+ (void)strlcpy(uuser, guser, sizeof(uuser));
+ fprintf(ttyout, "%s\n", uuser);
} else {
(void)fflush(ttyout);
- if (fgets(user, sizeof(user) - 1, stdin) == NULL) {
- clearerr(stdin);
+ if (get_line(stdin, uuser, sizeof(uuser), &errormsg) < 0) {
+ warnx("%s; can't authenticate", errormsg);
goto cleanup_auth_url;
}
- user[strlen(user) - 1] = '\0';
}
if (gpass != NULL)
- pass = (char *)gpass;
- else
- pass = getpass("Password: ");
+ upass = gpass;
+ else {
+ gotpass = getpass("Password: ");
+ if (gotpass == NULL) {
+ warnx("Can't read password");
+ goto cleanup_auth_url;
+ }
+ upass = gotpass;
+ }
- clen = strlen(user) + strlen(pass) + 2; /* user + ":" + pass + "\0" */
- clear = (char *)xmalloc(clen);
- (void)strlcpy(clear, user, clen);
+ clen = strlen(uuser) + strlen(upass) + 2; /* user + ":" + pass + "\0" */
+ clear = (char *)ftp_malloc(clen);
+ (void)strlcpy(clear, uuser, clen);
(void)strlcat(clear, ":", clen);
- (void)strlcat(clear, pass, clen);
- if (gpass == NULL)
- memset(pass, 0, strlen(pass));
+ (void)strlcat(clear, upass, clen);
+ if (gotpass)
+ memset(gotpass, 0, strlen(gotpass));
/* scheme + " " + enc + "\0" */
rlen = strlen(scheme) + 1 + (clen + 2) * 4 / 3 + 1;
- *response = (char *)xmalloc(rlen);
+ *response = (char *)ftp_malloc(rlen);
(void)strlcpy(*response, scheme, rlen);
len = strlcat(*response, " ", rlen);
/* use `clen - 1' to not encode the trailing NUL */
@@ -240,7 +244,7 @@ base64_encode(const unsigned char *clear, size_t len, unsigned char *encoded)
static const unsigned char enc[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
unsigned char *cp;
- int i;
+ size_t i;
cp = encoded;
for (i = 0; i < len; i += 3) {
@@ -284,7 +288,7 @@ url_decode(char *url)
/*
- * Parse URL of form:
+ * Parse URL of form (per RFC3986):
* <type>://[<user>[:<password>]@]<host>[:<port>][/<path>]
* Returns -1 if a parse error occurred, otherwise 0.
* It's the caller's responsibility to url_decode() the returned
@@ -294,12 +298,9 @@ url_decode(char *url)
* malloc(3)ed strings of the relevant section, and port to
* the number given, or ftpport if ftp://, or httpport if http://.
*
- * If <host> is surrounded by `[' and ']', it's parsed as an
- * IPv6 address (as per RFC 2732).
- *
- * XXX: this is not totally RFC 1738 compliant; <path> will have the
+ * XXX: this is not totally RFC3986 compliant; <path> will have the
* leading `/' unless it's an ftp:// URL, as this makes things easier
- * for file:// and http:// URLs. ftp:// URLs have the `/' between the
+ * for file:// and http:// URLs. ftp:// URLs have the `/' between the
* host and the URL-path removed, but any additional leading slashes
* in the URL-path are retained (because they imply that we should
* later do "CWD" with a null argument).
@@ -307,50 +308,56 @@ url_decode(char *url)
* Examples:
* input URL output path
* --------- -----------
- * "ftp://host" NULL
- * "http://host/" NULL
+ * "http://host" "/"
+ * "http://host/" "/"
+ * "http://host/path" "/path"
* "file://host/dir/file" "dir/file"
+ * "ftp://host" ""
* "ftp://host/" ""
- * "ftp://host//" NULL
+ * "ftp://host//" "/"
+ * "ftp://host/dir/file" "dir/file"
* "ftp://host//dir/file" "/dir/file"
*/
static int
-parse_url(const char *url, const char *desc, url_t *type,
- char **user, char **pass, char **host, char **port,
+parse_url(const char *url, const char *desc, url_t *utype,
+ char **uuser, char **pass, char **host, char **port,
in_port_t *portnum, char **path)
{
- const char *origurl;
- char *cp, *ep, *thost, *tport;
+ const char *origurl, *tport;
+ char *cp, *ep, *thost;
size_t len;
- if (url == NULL || desc == NULL || type == NULL || user == NULL
+ if (url == NULL || desc == NULL || utype == NULL || uuser == NULL
|| pass == NULL || host == NULL || port == NULL || portnum == NULL
|| path == NULL)
errx(1, "parse_url: invoked with NULL argument!");
+ DPRINTF("parse_url: %s `%s'\n", desc, url);
origurl = url;
- *type = UNKNOWN_URL_T;
- *user = *pass = *host = *port = *path = NULL;
+ *utype = UNKNOWN_URL_T;
+ *uuser = *pass = *host = *port = *path = NULL;
*portnum = 0;
tport = NULL;
if (STRNEQUAL(url, HTTP_URL)) {
url += sizeof(HTTP_URL) - 1;
- *type = HTTP_URL_T;
+ *utype = HTTP_URL_T;
*portnum = HTTP_PORT;
tport = httpport;
} else if (STRNEQUAL(url, FTP_URL)) {
url += sizeof(FTP_URL) - 1;
- *type = FTP_URL_T;
+ *utype = FTP_URL_T;
*portnum = FTP_PORT;
tport = ftpport;
} else if (STRNEQUAL(url, FILE_URL)) {
url += sizeof(FILE_URL) - 1;
- *type = FILE_URL_T;
+ *utype = FILE_URL_T;
} else {
warnx("Invalid %s `%s'", desc, url);
cleanup_parse_url:
- FREEPTR(*user);
+ FREEPTR(*uuser);
+ if (*pass != NULL)
+ memset(*pass, 0, strlen(*pass));
FREEPTR(*pass);
FREEPTR(*host);
FREEPTR(*port);
@@ -364,29 +371,29 @@ parse_url(const char *url, const char *desc, url_t *type,
/* find [user[:pass]@]host[:port] */
ep = strchr(url, '/');
if (ep == NULL)
- thost = xstrdup(url);
+ thost = ftp_strdup(url);
else {
len = ep - url;
- thost = (char *)xmalloc(len + 1);
+ thost = (char *)ftp_malloc(len + 1);
(void)strlcpy(thost, url, len + 1);
- if (*type == FTP_URL_T) /* skip first / for ftp URLs */
+ if (*utype == FTP_URL_T) /* skip first / for ftp URLs */
ep++;
- *path = xstrdup(ep);
+ *path = ftp_strdup(ep);
}
cp = strchr(thost, '@'); /* look for user[:pass]@ in URLs */
if (cp != NULL) {
- if (*type == FTP_URL_T)
+ if (*utype == FTP_URL_T)
anonftp = 0; /* disable anonftp */
- *user = thost;
+ *uuser = thost;
*cp = '\0';
- thost = xstrdup(cp + 1);
- cp = strchr(*user, ':');
+ thost = ftp_strdup(cp + 1);
+ cp = strchr(*uuser, ':');
if (cp != NULL) {
*cp = '\0';
- *pass = xstrdup(cp + 1);
+ *pass = ftp_strdup(cp + 1);
}
- url_decode(*user);
+ url_decode(*uuser);
if (*pass)
url_decode(*pass);
}
@@ -394,7 +401,7 @@ parse_url(const char *url, const char *desc, url_t *type,
#ifdef INET6
/*
* Check if thost is an encoded IPv6 address, as per
- * RFC 2732:
+ * RFC3986:
* `[' ipv6-address ']'
*/
if (*thost == '[') {
@@ -420,16 +427,17 @@ parse_url(const char *url, const char *desc, url_t *type,
cp = NULL;
} else
#endif /* INET6 */
- if ((cp = strchr(thost, ':')) != NULL)
- *cp++ = '\0';
+ if ((cp = strchr(thost, ':')) != NULL)
+ *cp++ = '\0';
*host = thost;
/* look for [:port] */
if (cp != NULL) {
- long nport;
+ unsigned long nport;
- nport = parseport(cp, -1);
- if (nport == -1) {
+ nport = strtoul(cp, &ep, 10);
+ if (*cp == '\0' || *ep != '\0' ||
+ nport < 1 || nport > MAX_IN_PORT_T) {
warnx("Unknown port `%s' in %s `%s'",
cp, desc, origurl);
goto cleanup_parse_url;
@@ -439,17 +447,19 @@ parse_url(const char *url, const char *desc, url_t *type,
}
if (tport != NULL)
- *port = xstrdup(tport);
- if (*path == NULL)
- *path = xstrdup("/");
-
- if (debug)
- fprintf(ttyout,
- "parse_url: user `%s' pass `%s' host %s port %s(%d) "
- "path `%s'\n",
- *user ? *user : "<null>", *pass ? *pass : "<null>",
- *host ? *host : "<null>", *port ? *port : "<null>",
- *portnum ? *portnum : -1, *path ? *path : "<null>");
+ *port = ftp_strdup(tport);
+ if (*path == NULL) {
+ const char *emptypath = "/";
+ if (*utype == FTP_URL_T) /* skip first / for ftp URLs */
+ emptypath++;
+ *path = ftp_strdup(emptypath);
+ }
+
+ DPRINTF("parse_url: user `%s' pass `%s' host %s port %s(%d) "
+ "path `%s'\n",
+ STRorNULL(*uuser), STRorNULL(*pass),
+ STRorNULL(*host), STRorNULL(*port),
+ *portnum ? *portnum : -1, STRorNULL(*path));
return (0);
}
@@ -469,53 +479,50 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
{
struct addrinfo hints, *res, *res0 = NULL;
int error;
- char hbuf[NI_MAXHOST];
- volatile sigfunc oldintr, oldintp;
- volatile int s;
+ sigfunc volatile oldintr;
+ sigfunc volatile oldintp;
+ int volatile s;
struct stat sb;
- int ischunked, isproxy, rval, hcode;
- size_t len;
+ int volatile ischunked;
+ int volatile isproxy;
+ int volatile rval;
+ int volatile hcode;
+ int len;
+ size_t flen;
static size_t bufsize;
static char *xferbuf;
const char *cp, *token;
- char *ep, *buf, *savefile;
- char *auth, *location, *message;
- char *user, *pass, *host, *port, *path, *decodedpath;
+ char *ep;
+ char buf[FTPBUFLEN];
+ const char *errormsg;
+ char *volatile savefile;
+ char *volatile auth;
+ char *volatile location;
+ char *volatile message;
+ char *uuser, *pass, *host, *port, *path;
+ char *volatile decodedpath;
char *puser, *ppass, *useragent;
off_t hashbytes, rangestart, rangeend, entitylen;
- int (*closefunc)(FILE *);
- FILE *fin, *fout;
+ int (*volatile closefunc)(FILE *);
+ FILE *volatile fin;
+ FILE *volatile fout;
time_t mtime;
url_t urltype;
in_port_t portnum;
+ DPRINTF("fetch_url: `%s' proxyenv `%s'\n", url, STRorNULL(proxyenv));
+
oldintr = oldintp = NULL;
closefunc = NULL;
fin = fout = NULL;
s = -1;
- buf = savefile = NULL;
+ savefile = NULL;
auth = location = message = NULL;
ischunked = isproxy = hcode = 0;
rval = 1;
- user = pass = host = path = decodedpath = puser = ppass = NULL;
-
-#ifdef __GNUC__ /* shut up gcc warnings */
- (void)&closefunc;
- (void)&fin;
- (void)&fout;
- (void)&buf;
- (void)&savefile;
- (void)&rval;
- (void)&isproxy;
- (void)&hcode;
- (void)&ischunked;
- (void)&message;
- (void)&location;
- (void)&auth;
- (void)&decodedpath;
-#endif
+ uuser = pass = host = path = decodedpath = puser = ppass = NULL;
- if (parse_url(url, "URL", &urltype, &user, &pass, &host, &port,
+ if (parse_url(url, "URL", &urltype, &uuser, &pass, &host, &port,
&portnum, &path) == -1)
goto cleanup_fetch_url;
@@ -536,29 +543,27 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
}
}
- decodedpath = xstrdup(path);
+ decodedpath = ftp_strdup(path);
url_decode(decodedpath);
if (outfile)
- savefile = xstrdup(outfile);
+ savefile = ftp_strdup(outfile);
else {
cp = strrchr(decodedpath, '/'); /* find savefile */
if (cp != NULL)
- savefile = xstrdup(cp + 1);
+ savefile = ftp_strdup(cp + 1);
else
- savefile = xstrdup(decodedpath);
+ savefile = ftp_strdup(decodedpath);
}
+ DPRINTF("fetch_url: savefile `%s'\n", savefile);
if (EMPTYSTRING(savefile)) {
if (urltype == FTP_URL_T) {
rval = fetch_ftp(url);
goto cleanup_fetch_url;
}
- warnx("no file after directory (you must specify an "
+ warnx("No file after directory (you must specify an "
"output file) `%s'", url);
goto cleanup_fetch_url;
- } else {
- if (debug)
- fprintf(ttyout, "savefile `%s'\n", savefile);
}
restart_point = 0;
@@ -574,7 +579,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
direction = "copied";
fin = fopen(decodedpath, "r");
if (fin == NULL) {
- warn("Cannot open file `%s'", decodedpath);
+ warn("Can't open `%s'", decodedpath);
goto cleanup_fetch_url;
}
if (fstat(fileno(fin), &sb) == 0) {
@@ -583,7 +588,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
}
if (restart_point) {
if (lseek(fileno(fin), restart_point, SEEK_SET) < 0) {
- warn("Can't lseek to restart `%s'",
+ warn("Can't seek to restart `%s'",
decodedpath);
goto cleanup_fetch_url;
}
@@ -596,7 +601,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
fputs("\n", ttyout);
}
} else { /* ftp:// or http:// URLs */
- char *leading;
+ const char *leading;
int hasleading;
if (proxyenv == NULL) {
@@ -610,26 +615,26 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
url_t purltype;
char *phost, *ppath;
char *pport, *no_proxy;
+ in_port_t pportnum;
isproxy = 1;
/* check URL against list of no_proxied sites */
no_proxy = getoptionvalue("no_proxy");
if (! EMPTYSTRING(no_proxy)) {
- char *np, *np_copy;
- long np_port;
+ char *np, *np_copy, *np_iter;
+ unsigned long np_port;
size_t hlen, plen;
- np_copy = xstrdup(no_proxy);
+ np_iter = np_copy = ftp_strdup(no_proxy);
hlen = strlen(host);
- while ((cp = strsep(&np_copy, " ,")) != NULL) {
+ while ((cp = strsep(&np_iter, " ,")) != NULL) {
if (*cp == '\0')
continue;
if ((np = strrchr(cp, ':')) != NULL) {
- *np = '\0';
- np_port =
- strtol(np + 1, &ep, 10);
- if (*ep != '\0')
+ *np++ = '\0';
+ np_port = strtoul(np, &ep, 10);
+ if (*np == '\0' || *ep != '\0')
continue;
if (np_port != portnum)
continue;
@@ -651,8 +656,13 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
}
if (isproxy) {
+ if (restart_point) {
+ warnx("Can't restart via proxy URL `%s'",
+ proxyenv);
+ goto cleanup_fetch_url;
+ }
if (parse_url(proxyenv, "proxy URL", &purltype,
- &puser, &ppass, &phost, &pport, &portnum,
+ &puser, &ppass, &phost, &pport, &pportnum,
&ppath) == -1)
goto cleanup_fetch_url;
@@ -684,7 +694,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
FREEPTR(port);
port = pport;
FREEPTR(path);
- path = xstrdup(url);
+ path = ftp_strdup(url);
FREEPTR(ppath);
}
} /* ! EMPTYSTRING(proxyenv) */
@@ -694,9 +704,11 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
hints.ai_family = family;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = 0;
- error = getaddrinfo(host, NULL, &hints, &res0);
+ error = getaddrinfo(host, port, &hints, &res0);
if (error) {
- warnx("%s", gai_strerror(error));
+ warnx("Can't lookup `%s:%s': %s", host, port,
+ (error == EAI_SYSTEM) ? strerror(errno)
+ : gai_strerror(error));
goto cleanup_fetch_url;
}
if (res0->ai_canonname)
@@ -704,28 +716,31 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
s = -1;
for (res = res0; res; res = res->ai_next) {
- /*
- * see comment in hookup()
- */
+ char hname[NI_MAXHOST], sname[NI_MAXSERV];
+
ai_unmapped(res);
if (getnameinfo(res->ai_addr, res->ai_addrlen,
- hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0)
- strlcpy(hbuf, "invalid", sizeof(hbuf));
+ hname, sizeof(hname), sname, sizeof(sname),
+ NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
+ strlcpy(hname, "?", sizeof(hname));
+ strlcpy(sname, "?", sizeof(sname));
+ }
- if (verbose && res != res0)
- fprintf(ttyout, "Trying %s...\n", hbuf);
+ if (verbose && res0->ai_next) {
+ fprintf(ttyout, "Trying %s:%s ...\n",
+ hname, sname);
+ }
- ((struct sockaddr_in *)res->ai_addr)->sin_port =
- htons(portnum);
s = socket(res->ai_family, SOCK_STREAM,
res->ai_protocol);
if (s < 0) {
- warn("Can't create socket");
+ warn(
+ "Can't create socket for connection to "
+ "`%s:%s'", hname, sname);
continue;
}
- if (xconnect(s, res->ai_addr, res->ai_addrlen) < 0) {
- warn("Connect to address `%s'", hbuf);
+ if (ftp_connect(s, res->ai_addr, res->ai_addrlen) < 0) {
close(s);
s = -1;
continue;
@@ -736,7 +751,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
}
if (s < 0) {
- warn("Can't connect to %s", host);
+ warnx("Can't connect to `%s:%s'", host, port);
goto cleanup_fetch_url;
}
@@ -767,7 +782,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
* strip off IPv6 scope identifier, since it is
* local to the node
*/
- h = xstrdup(host);
+ h = ftp_strdup(host);
if (isipv6addr(h) &&
(p = strchr(h, '%')) != NULL) {
*p = '\0';
@@ -826,14 +841,16 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
}
/* Read the response */
- if ((buf = fparseln(fin, &len, NULL, "\0\0\0", 0)) == NULL) {
- warn("Receiving HTTP reply");
+ len = get_line(fin, buf, sizeof(buf), &errormsg);
+ if (len < 0) {
+ if (*errormsg == '\n')
+ errormsg++;
+ warnx("Receiving HTTP reply: %s", errormsg);
goto cleanup_fetch_url;
}
while (len > 0 && (ISLWS(buf[len-1])))
buf[--len] = '\0';
- if (debug)
- fprintf(ttyout, "received `%s'\n", buf);
+ DPRINTF("fetch_url: received `%s'\n", buf);
/* Determine HTTP response code */
cp = strchr(buf, ' ');
@@ -844,22 +861,22 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
hcode = strtol(cp, &ep, 10);
if (*ep != '\0' && !isspace((unsigned char)*ep))
goto improper;
- message = xstrdup(cp);
+ message = ftp_strdup(cp);
/* Read the rest of the header. */
while (1) {
- FREEPTR(buf);
- if ((buf = fparseln(fin, &len, NULL, "\0\0\0", 0))
- == NULL) {
- warn("Receiving HTTP reply");
+ len = get_line(fin, buf, sizeof(buf), &errormsg);
+ if (len < 0) {
+ if (*errormsg == '\n')
+ errormsg++;
+ warnx("Receiving HTTP reply: %s", errormsg);
goto cleanup_fetch_url;
}
while (len > 0 && (ISLWS(buf[len-1])))
buf[--len] = '\0';
if (len == 0)
break;
- if (debug)
- fprintf(ttyout, "received `%s'\n", buf);
+ DPRINTF("fetch_url: received `%s'\n", buf);
/*
* Look for some headers
@@ -871,10 +888,8 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
filesize = STRTOLL(cp, &ep, 10);
if (filesize < 0 || *ep != '\0')
goto improper;
- if (debug)
- fprintf(ttyout,
- "parsed len as: " LLF "\n",
- (LLT)filesize);
+ DPRINTF("fetch_url: parsed len as: " LLF "\n",
+ (LLT)filesize);
} else if (match_token(&cp, "Content-Range:")) {
if (! match_token(&cp, "bytes"))
@@ -906,7 +921,8 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
if (*cp != '\0')
goto improper;
- if (debug) {
+#ifndef NO_DEBUG
+ if (ftp_debug) {
fprintf(ttyout, "parsed range as: ");
if (rangestart == -1)
fprintf(ttyout, "*");
@@ -916,6 +932,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
(LLT)rangeend);
fprintf(ttyout, "/" LLF "\n", (LLT)entitylen);
}
+#endif
if (! restart_point) {
warnx(
"Received unexpected Content-Range header");
@@ -926,11 +943,12 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
struct tm parsed;
char *t;
- /* RFC 1123 */
+ memset(&parsed, 0, sizeof(parsed));
+ /* RFC1123 */
if ((t = strptime(cp,
"%a, %d %b %Y %H:%M:%S GMT",
&parsed))
- /* RFC 850 */
+ /* RFC0850 */
|| (t = strptime(cp,
"%a, %d-%b-%y %H:%M:%S GMT",
&parsed))
@@ -941,55 +959,50 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
parsed.tm_isdst = -1;
if (*t == '\0')
mtime = timegm(&parsed);
- if (debug && mtime != -1) {
+#ifndef NO_DEBUG
+ if (ftp_debug && mtime != -1) {
fprintf(ttyout,
"parsed date as: %s",
- ctime(&mtime));
+ rfc2822time(localtime(&mtime)));
}
+#endif
}
} else if (match_token(&cp, "Location:")) {
- location = xstrdup(cp);
- if (debug)
- fprintf(ttyout,
- "parsed location as `%s'\n", cp);
+ location = ftp_strdup(cp);
+ DPRINTF("fetch_url: parsed location as `%s'\n",
+ cp);
} else if (match_token(&cp, "Transfer-Encoding:")) {
if (match_token(&cp, "binary")) {
warnx(
- "Bogus transfer encoding - `binary' (fetching anyway)");
+ "Bogus transfer encoding `binary' (fetching anyway)");
continue;
}
if (! (token = match_token(&cp, "chunked"))) {
warnx(
- "Unsupported transfer encoding - `%s'",
+ "Unsupported transfer encoding `%s'",
token);
goto cleanup_fetch_url;
}
ischunked++;
- if (debug)
- fprintf(ttyout,
- "using chunked encoding\n");
+ DPRINTF("fetch_url: using chunked encoding\n");
} else if (match_token(&cp, "Proxy-Authenticate:")
|| match_token(&cp, "WWW-Authenticate:")) {
if (! (token = match_token(&cp, "Basic"))) {
- if (debug)
- fprintf(ttyout,
- "skipping unknown auth scheme `%s'\n",
+ DPRINTF(
+ "fetch_url: skipping unknown auth scheme `%s'\n",
token);
continue;
}
FREEPTR(auth);
- auth = xstrdup(token);
- if (debug)
- fprintf(ttyout,
- "parsed auth as `%s'\n", cp);
+ auth = ftp_strdup(token);
+ DPRINTF("fetch_url: parsed auth as `%s'\n", cp);
}
}
/* finished parsing header */
- FREEPTR(buf);
switch (hcode) {
case 200:
@@ -1005,6 +1018,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
case 302:
case 303:
case 305:
+ case 307:
if (EMPTYSTRING(location)) {
warnx(
"No redirection Location provided by server");
@@ -1036,7 +1050,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
if (hcode == 401) {
authp = &wwwauth;
- auser = user;
+ auser = uuser;
apass = pass;
} else {
authp = &proxyauth;
@@ -1056,9 +1070,8 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
fprintf(ttyout,
"Authorization failed. Retry (y/n)? ");
- if (fgets(reply, sizeof(reply), stdin)
- == NULL) {
- clearerr(stdin);
+ if (get_line(stdin, reply, sizeof(reply), NULL)
+ < 0) {
goto cleanup_fetch_url;
}
if (tolower((unsigned char)reply[0]) != 'y')
@@ -1077,7 +1090,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
#endif
default:
if (message)
- warnx("Error retrieving file - `%s'", message);
+ warnx("Error retrieving file `%s'", message);
else
warnx("Unknown error retrieving file");
goto cleanup_fetch_url;
@@ -1091,7 +1104,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
oldintp = xsignal(SIGPIPE, SIG_IGN);
fout = popen(savefile + 1, "w");
if (fout == NULL) {
- warn("Can't run `%s'", savefile + 1);
+ warn("Can't execute `%s'", savefile + 1);
goto cleanup_fetch_url;
}
closefunc = pclose;
@@ -1129,11 +1142,11 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
(void)xsignal(SIGQUIT, psummary);
oldintr = xsignal(SIGINT, aborthttp);
- if (rcvbuf_size > bufsize) {
+ if ((size_t)rcvbuf_size > bufsize) {
if (xferbuf)
(void)free(xferbuf);
bufsize = rcvbuf_size;
- xferbuf = xmalloc(bufsize);
+ xferbuf = ftp_malloc(bufsize);
}
bytes = 0;
@@ -1143,33 +1156,53 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
/* Finally, suck down the file. */
do {
long chunksize;
+ short lastchunk;
chunksize = 0;
- /* read chunksize */
+ lastchunk = 0;
+ /* read chunk-size */
if (ischunked) {
if (fgets(xferbuf, bufsize, fin) == NULL) {
- warnx("Unexpected EOF reading chunksize");
+ warnx("Unexpected EOF reading chunk-size");
goto cleanup_fetch_url;
}
+ errno = 0;
chunksize = strtol(xferbuf, &ep, 16);
+ if (ep == xferbuf) {
+ warnx("Invalid chunk-size");
+ goto cleanup_fetch_url;
+ }
+ if (errno == ERANGE || chunksize < 0) {
+ errno = ERANGE;
+ warn("Chunk-size `%.*s'",
+ (int)(ep-xferbuf), xferbuf);
+ goto cleanup_fetch_url;
+ }
/*
* XXX: Work around bug in Apache 1.3.9 and
* 1.3.11, which incorrectly put trailing
- * space after the chunksize.
+ * space after the chunk-size.
*/
while (*ep == ' ')
ep++;
+ /* skip [ chunk-ext ] */
+ if (*ep == ';') {
+ while (*ep && *ep != '\r')
+ ep++;
+ }
+
if (strcmp(ep, "\r\n") != 0) {
- warnx("Unexpected data following chunksize");
+ warnx("Unexpected data following chunk-size");
goto cleanup_fetch_url;
}
- if (debug)
- fprintf(ttyout, "got chunksize of " LLF "\n",
- (LLT)chunksize);
- if (chunksize == 0)
- break;
+ DPRINTF("fetch_url: got chunk-size of " LLF "\n",
+ (LLT)chunksize);
+ if (chunksize == 0) {
+ lastchunk = 1;
+ goto chunkdone;
+ }
}
/* transfer file or chunk */
while (1) {
@@ -1178,18 +1211,18 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
if (rate_get)
(void)gettimeofday(&then, NULL);
- bufrem = rate_get ? rate_get : bufsize;
+ bufrem = rate_get ? rate_get : (off_t)bufsize;
if (ischunked)
bufrem = MIN(chunksize, bufrem);
while (bufrem > 0) {
- len = fread(xferbuf, sizeof(char),
- MIN(bufsize, bufrem), fin);
- if (len <= 0)
+ flen = fread(xferbuf, sizeof(char),
+ MIN((off_t)bufsize, bufrem), fin);
+ if (flen <= 0)
goto chunkdone;
- bytes += len;
- bufrem -= len;
- if (fwrite(xferbuf, sizeof(char), len, fout)
- != len) {
+ bytes += flen;
+ bufrem -= flen;
+ if (fwrite(xferbuf, sizeof(char), flen, fout)
+ != flen) {
warn("Writing `%s'", savefile);
goto cleanup_fetch_url;
}
@@ -1201,7 +1234,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
(void)fflush(ttyout);
}
if (ischunked) {
- chunksize -= len;
+ chunksize -= flen;
if (chunksize <= 0)
break;
}
@@ -1221,14 +1254,21 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
/* read CRLF after chunk*/
chunkdone:
if (ischunked) {
- if (fgets(xferbuf, bufsize, fin) == NULL)
- break;
+ if (fgets(xferbuf, bufsize, fin) == NULL) {
+ warnx("Unexpected EOF reading chunk CRLF");
+ goto cleanup_fetch_url;
+ }
if (strcmp(xferbuf, "\r\n") != 0) {
warnx("Unexpected data following chunk");
goto cleanup_fetch_url;
}
+ if (lastchunk)
+ break;
}
} while (ischunked);
+
+/* XXX: deal with optional trailer & CRLF here? */
+
if (hash && !progress && bytes > 0) {
if (bytes < mark)
(void)putc('#', ttyout);
@@ -1252,7 +1292,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
if (utimes(savefile, tval) == -1) {
fprintf(ttyout,
"Can't change modification time to %s",
- asctime(localtime(&mtime)));
+ rfc2822time(localtime(&mtime)));
}
}
if (bytes > 0)
@@ -1263,7 +1303,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
goto cleanup_fetch_url;
improper:
- warnx("Improper response from `%s'", host);
+ warnx("Improper response from `%s:%s'", host, port);
cleanup_fetch_url:
if (oldintr)
@@ -1279,15 +1319,18 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
if (res0)
freeaddrinfo(res0);
FREEPTR(savefile);
- FREEPTR(user);
+ FREEPTR(uuser);
+ if (pass != NULL)
+ memset(pass, 0, strlen(pass));
FREEPTR(pass);
FREEPTR(host);
FREEPTR(port);
FREEPTR(path);
FREEPTR(decodedpath);
FREEPTR(puser);
+ if (ppass != NULL)
+ memset(ppass, 0, strlen(ppass));
FREEPTR(ppass);
- FREEPTR(buf);
FREEPTR(auth);
FREEPTR(location);
FREEPTR(message);
@@ -1301,7 +1344,7 @@ void
aborthttp(int notused)
{
char msgbuf[100];
- int len;
+ size_t len;
sigint_raised = 1;
alarmtimer(0);
@@ -1319,21 +1362,25 @@ static int
fetch_ftp(const char *url)
{
char *cp, *xargv[5], rempath[MAXPATHLEN];
- char *host, *path, *dir, *file, *user, *pass;
+ char *host, *path, *dir, *file, *uuser, *pass;
char *port;
- int dirhasglob, filehasglob, oautologin, rval, type, xargc;
+ char cmdbuf[MAXPATHLEN];
+ char dirbuf[4];
+ int dirhasglob, filehasglob, rval, transtype, xargc;
+ int oanonftp, oautologin;
in_port_t portnum;
url_t urltype;
- host = path = dir = file = user = pass = NULL;
+ DPRINTF("fetch_ftp: `%s'\n", url);
+ host = path = dir = file = uuser = pass = NULL;
port = NULL;
rval = 1;
- type = TYPE_I;
+ transtype = TYPE_I;
if (STRNEQUAL(url, FTP_URL)) {
- if ((parse_url(url, "URL", &urltype, &user, &pass,
+ if ((parse_url(url, "URL", &urltype, &uuser, &pass,
&host, &port, &portnum, &path) == -1) ||
- (user != NULL && *user == '\0') ||
+ (uuser != NULL && *uuser == '\0') ||
EMPTYSTRING(host)) {
warnx("Invalid URL `%s'", url);
goto cleanup_fetch_ftp;
@@ -1346,9 +1393,9 @@ fetch_ftp(const char *url)
/* check for trailing ';type=[aid]' */
if (! EMPTYSTRING(path) && (cp = strrchr(path, ';')) != NULL) {
if (strcasecmp(cp, ";type=a") == 0)
- type = TYPE_A;
+ transtype = TYPE_A;
else if (strcasecmp(cp, ";type=i") == 0)
- type = TYPE_I;
+ transtype = TYPE_I;
else if (strcasecmp(cp, ";type=d") == 0) {
warnx(
"Directory listing via a URL is not supported");
@@ -1362,18 +1409,18 @@ fetch_ftp(const char *url)
}
} else { /* classic style `[user@]host:[file]' */
urltype = CLASSIC_URL_T;
- host = xstrdup(url);
+ host = ftp_strdup(url);
cp = strchr(host, '@');
if (cp != NULL) {
*cp = '\0';
- user = host;
+ uuser = host;
anonftp = 0; /* disable anonftp */
- host = xstrdup(cp + 1);
+ host = ftp_strdup(cp + 1);
}
cp = strchr(host, ':');
if (cp != NULL) {
*cp = '\0';
- path = xstrdup(cp + 1);
+ path = ftp_strdup(cp + 1);
}
}
if (EMPTYSTRING(host))
@@ -1407,7 +1454,8 @@ fetch_ftp(const char *url)
cp = strrchr(dir, '/');
if (cp == dir && urltype == CLASSIC_URL_T) {
file = cp + 1;
- dir = "/";
+ (void)strlcpy(dirbuf, "/", sizeof(dirbuf));
+ dir = dirbuf;
} else if (cp != NULL) {
*cp++ = '\0';
file = cp;
@@ -1421,14 +1469,11 @@ fetch_ftp(const char *url)
url_decode(file);
/* but still don't url_decode(dir) */
}
- if (debug)
- fprintf(ttyout,
- "fetch_ftp: user `%s' pass `%s' host %s port %s "
- "path `%s' dir `%s' file `%s'\n",
- user ? user : "<null>", pass ? pass : "<null>",
- host ? host : "<null>", port ? port : "<null>",
- path ? path : "<null>",
- dir ? dir : "<null>", file ? file : "<null>");
+ DPRINTF("fetch_ftp: user `%s' pass `%s' host %s port %s "
+ "path `%s' dir `%s' file `%s'\n",
+ STRorNULL(uuser), STRorNULL(pass),
+ STRorNULL(host), STRorNULL(port),
+ STRorNULL(path), STRorNULL(dir), STRorNULL(file));
dirhasglob = filehasglob = 0;
if (doglob && urltype == CLASSIC_URL_T) {
@@ -1439,9 +1484,12 @@ fetch_ftp(const char *url)
}
/* Set up the connection */
+ oanonftp = anonftp;
if (connected)
disconnect(0, NULL);
- xargv[0] = (char *)getprogname(); /* XXX discards const */
+ anonftp = oanonftp;
+ (void)strlcpy(cmdbuf, getprogname(), sizeof(cmdbuf));
+ xargv[0] = cmdbuf;
xargv[1] = host;
xargv[2] = NULL;
xargc = 2;
@@ -1456,12 +1504,13 @@ fetch_ftp(const char *url)
setpeer(xargc, xargv);
autologin = oautologin;
if ((connected == 0) ||
- (connected == 1 && !ftp_login(host, user, pass))) {
- warnx("Can't connect or login to host `%s'", host);
+ (connected == 1 && !ftp_login(host, uuser, pass))) {
+ warnx("Can't connect or login to host `%s:%s'",
+ host, port ? port : "?");
goto cleanup_fetch_ftp;
}
- switch (type) {
+ switch (transtype) {
case TYPE_A:
setascii(1, xargv);
break;
@@ -1469,7 +1518,7 @@ fetch_ftp(const char *url)
setbinary(1, xargv);
break;
default:
- errx(1, "fetch_ftp: unknown transfer type %d", type);
+ errx(1, "fetch_ftp: unknown transfer type %d", transtype);
}
/*
@@ -1488,12 +1537,12 @@ fetch_ftp(const char *url)
* directories in one step.
*
* If we are dealing with an `ftp://host/path' URL
- * (urltype is FTP_URL_T), then RFC 1738 says we need to
+ * (urltype is FTP_URL_T), then RFC3986 says we need to
* send a separate CWD command for each unescaped "/"
* in the path, and we have to interpret %hex escaping
* *after* we find the slashes. It's possible to get
* empty components here, (from multiple adjacent
- * slashes in the path) and RFC 1738 says that we should
+ * slashes in the path) and RFC3986 says that we should
* still do `CWD ' (with a null argument) in such cases.
*
* Many ftp servers don't support `CWD ', so if there's an
@@ -1551,12 +1600,11 @@ fetch_ftp(const char *url)
url_decode(dir);
} else
nextpart = NULL;
- if (debug)
- fprintf(ttyout, "dir `%s', nextpart `%s'\n",
- dir ? dir : "<null>",
- nextpart ? nextpart : "<null>");
+ DPRINTF("fetch_ftp: dir `%s', nextpart `%s'\n",
+ STRorNULL(dir), STRorNULL(nextpart));
if (urltype == FTP_URL_T || *dir != '\0') {
- xargv[0] = "cd";
+ (void)strlcpy(cmdbuf, "cd", sizeof(cmdbuf));
+ xargv[0] = cmdbuf;
xargv[1] = dir;
xargv[2] = NULL;
dirchange = 0;
@@ -1566,8 +1614,8 @@ fetch_ftp(const char *url)
fprintf(stderr,
"\n"
"ftp: The `CWD ' command (without a directory), which is required by\n"
-" RFC 1738 to support the empty directory in the URL pathname (`//'),\n"
-" conflicts with the server's conformance to RFC 959.\n"
+" RFC3986 to support the empty directory in the URL pathname (`//'),\n"
+" conflicts with the server's conformance to RFC0959.\n"
" Try the same URL without the `//' in the URL pathname.\n"
"\n");
goto cleanup_fetch_ftp;
@@ -1591,7 +1639,8 @@ fetch_ftp(const char *url)
/* Fetch the file(s). */
xargc = 2;
- xargv[0] = "get";
+ (void)strlcpy(cmdbuf, "get", sizeof(cmdbuf));
+ xargv[0] = cmdbuf;
xargv[1] = file;
xargv[2] = NULL;
if (dirhasglob || filehasglob) {
@@ -1600,9 +1649,10 @@ fetch_ftp(const char *url)
ointeractive = interactive;
interactive = 0;
if (restartautofetch)
- xargv[0] = "mreget";
+ (void)strlcpy(cmdbuf, "mreget", sizeof(cmdbuf));
else
- xargv[0] = "mget";
+ (void)strlcpy(cmdbuf, "mget", sizeof(cmdbuf));
+ xargv[0] = cmdbuf;
mget(xargc, xargv);
interactive = ointeractive;
} else {
@@ -1626,9 +1676,12 @@ fetch_ftp(const char *url)
rval = 0;
cleanup_fetch_ftp:
+ FREEPTR(port);
FREEPTR(host);
FREEPTR(path);
- FREEPTR(user);
+ FREEPTR(uuser);
+ if (pass)
+ memset(pass, 0, strlen(pass));
FREEPTR(pass);
return (rval);
}
@@ -1648,7 +1701,7 @@ fetch_ftp(const char *url)
static int
go_fetch(const char *url)
{
- char *proxy;
+ char *proxyenv;
#ifndef NO_ABOUT
/*
@@ -1697,8 +1750,8 @@ go_fetch(const char *url)
* If ftpproxy is set with an FTP URL, use fetch_url()
* Othewise, use fetch_ftp().
*/
- proxy = getoptionvalue("ftp_proxy");
- if (!EMPTYSTRING(proxy) && STRNEQUAL(url, FTP_URL))
+ proxyenv = getoptionvalue("ftp_proxy");
+ if (!EMPTYSTRING(proxyenv) && STRNEQUAL(url, FTP_URL))
return (fetch_url(url, NULL, NULL, NULL));
return (fetch_ftp(url));
@@ -1719,10 +1772,9 @@ go_fetch(const char *url)
int
auto_fetch(int argc, char *argv[])
{
- volatile int argpos;
- int rval;
+ volatile int argpos, rval;
- argpos = 0;
+ argpos = rval = 0;
if (sigsetjmp(toplevel, 1)) {
if (connected)
@@ -1737,7 +1789,7 @@ auto_fetch(int argc, char *argv[])
/*
* Loop through as long as there's files to fetch.
*/
- for (rval = 0; (rval == 0) && (argpos < argc); argpos++) {
+ for (; (rval == 0) && (argpos < argc); argpos++) {
if (strchr(argv[argpos], ':') == NULL)
break;
redirect_loop = 0;
@@ -1757,38 +1809,47 @@ auto_fetch(int argc, char *argv[])
}
+/*
+ * Upload multiple files from the command line.
+ *
+ * If an error occurs the return value will be the offset+1 in
+ * argv[] of the file that caused a problem (i.e, argv[x]
+ * returns x+1)
+ * Otherwise, 0 is returned if all files uploaded successfully.
+ */
int
auto_put(int argc, char **argv, const char *uploadserver)
{
char *uargv[4], *path, *pathsep;
- int uargc, rval, len;
-
- uargc = 0;
- uargv[uargc++] = "mput";
- uargv[uargc++] = argv[0];
+ int uargc, rval, argpos;
+ size_t len;
+ char cmdbuf[MAX_C_NAME];
+
+ (void)strlcpy(cmdbuf, "mput", sizeof(cmdbuf));
+ uargv[0] = cmdbuf;
+ uargv[1] = argv[0];
+ uargc = 2;
uargv[2] = uargv[3] = NULL;
pathsep = NULL;
rval = 1;
- if (debug)
- fprintf(ttyout, "auto_put: target `%s'\n", uploadserver);
+ DPRINTF("auto_put: target `%s'\n", uploadserver);
- path = xstrdup(uploadserver);
+ path = ftp_strdup(uploadserver);
len = strlen(path);
if (path[len - 1] != '/' && path[len - 1] != ':') {
/*
* make sure we always pass a directory to auto_fetch
*/
if (argc > 1) { /* more than one file to upload */
- int len;
-
len = strlen(uploadserver) + 2; /* path + "/" + "\0" */
free(path);
- path = (char *)xmalloc(len);
+ path = (char *)ftp_malloc(len);
(void)strlcpy(path, uploadserver, len);
(void)strlcat(path, "/", len);
} else { /* single file to upload */
- uargv[0] = "put";
+ (void)strlcpy(cmdbuf, "put", sizeof(cmdbuf));
+ uargv[0] = cmdbuf;
pathsep = strrchr(path, '/');
if (pathsep == NULL) {
pathsep = strrchr(path, ':');
@@ -1797,38 +1858,44 @@ auto_put(int argc, char **argv, const char *uploadserver)
goto cleanup_auto_put;
}
pathsep++;
- uargv[2] = xstrdup(pathsep);
+ uargv[2] = ftp_strdup(pathsep);
pathsep[0] = '/';
} else
- uargv[2] = xstrdup(pathsep + 1);
+ uargv[2] = ftp_strdup(pathsep + 1);
pathsep[1] = '\0';
uargc++;
}
}
- if (debug)
- fprintf(ttyout, "auto_put: URL `%s' argv[2] `%s'\n",
- path, uargv[2] ? uargv[2] : "<null>");
+ DPRINTF("auto_put: URL `%s' argv[2] `%s'\n",
+ path, STRorNULL(uargv[2]));
/* connect and cwd */
rval = auto_fetch(1, &path);
- free(path);
if(rval >= 0)
goto cleanup_auto_put;
+ rval = 0;
+
+ /* target filename provided; upload 1 file */
/* XXX : is this the best way? */
if (uargc == 3) {
uargv[1] = argv[0];
put(uargc, uargv);
- goto cleanup_auto_put;
- }
-
- for(; argv[0] != NULL; argv++) {
- uargv[1] = argv[0];
- mput(uargc, uargv);
+ if ((code / 100) != COMPLETE)
+ rval = 1;
+ } else { /* otherwise a target dir: upload all files to it */
+ for(argpos = 0; argv[argpos] != NULL; argpos++) {
+ uargv[1] = argv[argpos];
+ mput(uargc, uargv);
+ if ((code / 100) != COMPLETE) {
+ rval = argpos + 1;
+ break;
+ }
+ }
}
- rval = 0;
cleanup_auto_put:
+ free(path);
FREEPTR(uargv[2]);
return (rval);
}
diff --git a/contrib/lukemftp/src/ftp.1 b/contrib/tnftp/src/ftp.1
index 917980f..34a88c2 100644
--- a/contrib/lukemftp/src/ftp.1
+++ b/contrib/tnftp/src/ftp.1
@@ -1,6 +1,7 @@
-.\" $NetBSD: ftp.1,v 1.109 2005/02/20 20:54:01 wiz Exp $
+.\" $NetBSD: ftp.1,v 1.13 2009/11/15 10:12:37 lukem Exp $
+.\" from NetBSD: ftp.1,v 1.130 2009/07/11 18:35:48 joerg Exp
.\"
-.\" Copyright (c) 1996-2004 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1996-2008 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
@@ -14,13 +15,6 @@
.\" 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
@@ -64,16 +58,15 @@
.\"
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
.\"
-.Dd January 15, 2005
+.Dd May 10, 2008
.Dt FTP 1
.Os
.Sh NAME
.Nm ftp
-.Nd
-Internet file transfer program
+.Nd Internet file transfer program
.Sh SYNOPSIS
.Nm
-.Op Fl 46AadefginpRtvV
+.Op Fl 46AadefginpRtVv
.Bk -words
.Op Fl N Ar netrc
.Ek
@@ -89,6 +82,7 @@ Internet file transfer program
.Bk -words
.Op Fl r Ar retry
.Ek
+.Op Fl s Ar srcaddr
.Bk -words
.\" [-T dir,max[,inc]]
.Oo
@@ -179,7 +173,7 @@ below for more information.
.Pp
Options may be specified at the command line, or to the
command interpreter.
-.Bl -tag -width "port "
+.Bl -tag -width Fl
.It Fl 4
Forces
.Nm
@@ -219,6 +213,14 @@ Disables file name globbing.
.It Fl i
Turns off interactive prompting during
multiple file transfers.
+.It Fl N Ar netrc
+Use
+.Ar netrc
+instead of
+.Pa ~/.netrc .
+Refer to
+.Sx THE .netrc FILE
+for more information.
.It Fl n
Restrains
.Nm
@@ -238,14 +240,6 @@ identity on the local machine), and, if necessary, prompt for a password
and an account with which to login.
To override the auto-login for auto-fetch transfers, specify the
username (and optionally, password) as appropriate.
-.It Fl N Ar netrc
-Use
-.Ar netrc
-instead of
-.Pa ~/.netrc .
-Refer to
-.Sx THE .netrc FILE
-for more information.
.It Fl o Ar output
When auto-fetching files, save the contents in
.Ar output .
@@ -263,35 +257,32 @@ then only the first file specified will be retrieved into
.Ar output ;
all other files will be retrieved into the basename of their
remote name.
+.It Fl P Ar port
+Sets the port number to
+.Ar port .
.It Fl p
Enable passive mode operation for use behind connection filtering firewalls.
This option has been deprecated as
.Nm
now tries to use passive mode by default, falling back to active mode
if the server does not support passive connections.
-.It Fl P Ar port
-Sets the port number to
-.Ar port .
-.It Fl r Ar wait
-Retry the connection attempt if it failed, pausing for
-.Ar wait
-seconds.
.It Fl q Ar quittime
Quit if the connection has stalled for
.Ar quittime
seconds.
.It Fl R
Restart all non-proxied auto-fetches.
+.It Fl r Ar wait
+Retry the connection attempt if it failed, pausing for
+.Ar wait
+seconds.
+.It Fl s Ar srcaddr
+Uses
+.Ar srcaddr
+as the local IP address for all connections.
.It Fl t
Enables packet tracing.
-.It Xo
-.Fl T
-.Sm off
-.Ar direction ,
-.Ar maximum
-.Op , Ar increment
-.Sm on
-.Xc
+.It Fl T Ar direction Ns , Ns Ar maximum Ns Oo , Ns Ar increment Oc
Set the maximum transfer rate for
.Ar direction
to
@@ -312,6 +303,12 @@ is one of the ftp URL types as supported by auto-fetch
(with an optional target filename for single file uploads), and
.Ar file
is one or more local files to be uploaded.
+.It Fl V
+Disable
+.Ic verbose
+and
+.Ic progress ,
+overriding the default of enabled when output is to a terminal.
.It Fl v
Enable
.Ic verbose
@@ -325,12 +322,6 @@ Forces
.Nm
to show all responses from the remote server, as well
as report on data transfer statistics.
-.It Fl V
-Disable
-.Ic verbose
-and
-.Ic progress ,
-overriding the default of enabled when output is to a terminal.
.El
.Pp
The client host with which
@@ -351,8 +342,8 @@ is awaiting commands from the user the prompt
is provided to the user.
The following commands are recognized
by
-.Nm ftp :
-.Bl -tag -width Fl
+.Nm ftp :
+.Bl -tag -width Ic
.It Ic \&! Op Ar command Op Ar args
Invoke an interactive shell on the local machine.
If there are arguments, the first is taken to be a command to execute
@@ -455,16 +446,6 @@ when an ascii type transfer is made, these linefeeds may be
distinguished from a record delimiter only when
.Ic \&cr
is off.
-.It Ic debug Op Ar debug-value
-Toggle debugging mode.
-If an optional
-.Ar debug-value
-is specified it is used to set the debugging level.
-When debugging is on,
-.Nm
-prints each command sent to the remote machine, preceded
-by the string
-.Ql \-\-\*[Gt]
.It Ic delete Ar remote-file
Delete the file
.Ar remote-file
@@ -500,12 +481,13 @@ Toggle command line editing, and context sensitive command and file
completion.
This is automatically enabled if input is from a terminal, and
disabled otherwise.
-.It Ic epsv4
+.It Ic epsv epsv4 epsv6
Toggle the use of the extended
.Dv EPSV
and
.Dv EPRT
-commands on IPv4 connections; first try
+commands on all IP, IPv4, and IPv6 connections respectively.
+First try
.Dv EPSV /
.Dv EPRT ,
and then
@@ -514,7 +496,10 @@ and then
This is enabled by default.
If an extended command fails then this option will be temporarily
disabled for the duration of the current connection, or until
-.Ic epsv4
+.Ic epsv ,
+.Ic epsv4 ,
+or
+.Ic epsv6
is executed again.
.It Ic exit
A synonym for
@@ -538,6 +523,16 @@ format is
.It Ic ftp Ar host Op Ar port
A synonym for
.Ic open .
+.It Ic ftp_debug Op Ar ftp_debug-value
+Toggle debugging mode.
+If an optional
+.Ar ftp_debug-value
+is specified it is used to set the debugging level.
+When debugging is on,
+.Nm
+prints each command sent to the remote machine, preceded
+by the string
+.Ql \-\-\*[Gt] .
.It Ic gate Op Ar host Op Ar port
Toggle gate-ftp mode, which used to connect through the
TIS FWTK and Gauntlet ftp proxies.
@@ -613,8 +608,9 @@ transferring a
.Xr tar 1
archive of the subtree (in binary mode).
.It Ic hash Op Ar size
-Toggle hash-sign (``#'') printing for each data block
-transferred.
+Toggle hash-sign
+.Pq Sq #
+printing for each data block transferred.
The size of a data block defaults to 1024 bytes.
This can be changed by specifying
.Ar size
@@ -663,24 +659,49 @@ A synonym for
Define a macro.
Subsequent lines are stored as the macro
.Ar macro-name ;
-a null line (consecutive newline characters
-in a file or
-carriage returns from the terminal) terminates macro input mode.
+a null line (consecutive newline characters in a file or carriage
+returns from the terminal) terminates macro input mode.
There is a limit of 16 macros and 4096 total characters in all
defined macros.
-Macros remain defined until a
+Macro names can be a maximum of 8 characters.
+Macros are only applicable to the current session they are
+defined within (or if defined outside a session, to the session
+invoked with the next
+.Ic open
+command), and remain defined until a
.Ic close
command is executed.
-The macro processor interprets `$' and `\e' as special characters.
-A `$' followed by a number (or numbers) is replaced by the
+To invoke a macro, use the
+.Ic $
+command (see above).
+.Pp
+The macro processor interprets
+.Sq $
+and
+.Sq \e
+as special characters.
+A
+.Sq $
+followed by a number (or numbers) is replaced by the
corresponding argument on the macro invocation command line.
-A `$' followed by an `i' signals that macro processor that the
-executing macro is to be looped.
-On the first pass `$i' is
-replaced by the first argument on the macro invocation command line,
-on the second pass it is replaced by the second argument, and so on.
-A `\e' followed by any character is replaced by that character.
-Use the `\e' to prevent special treatment of the `$'.
+A
+.Sq $
+followed by an
+.Sq i
+signals the macro processor that the executing macro is to be
+looped.
+On the first pass
+.Dq $i
+is replaced by the first argument on the macro invocation command
+line, on the second pass it is replaced by the second argument,
+and so on.
+A
+.Sq \e
+followed by any character is replaced by that character.
+Use the
+.Sq \e
+to prevent special treatment of the
+.Sq $ .
.It Ic mdelete Op Ar remote-files
Delete the
.Ar remote-files
@@ -756,7 +777,9 @@ The default (and only supported)
mode is
.Dq stream .
.It Ic modtime Ar remote-file
-Show the last modification time of the file on the remote machine.
+Show the last modification time of the file on the remote machine, in
+.Li RFC2822
+format.
.It Ic more Ar file
A synonym for
.Ic page .
@@ -823,9 +846,18 @@ and
.Ic case
settings).
Variable templating is accomplished by including the
-sequences `$1', `$2', ..., `$9' in
+sequences
+.Dq $1 ,
+.Dq $2 ,
+\&...
+.Dq $9
+in
.Ar inpattern .
-Use `\\' to prevent this special treatment of the `$' character.
+Use
+.Sq \e
+to prevent this special treatment of the
+.Sq $
+character.
All other characters are treated literally, and are used to determine the
.Ic nmap
.Op Ar inpattern
@@ -837,13 +869,19 @@ $1.$2 and the remote file name "mydata.data", $1 would have the value
The
.Ar outpattern
determines the resulting mapped filename.
-The sequences `$1', `$2', ...., `$9' are replaced by any value resulting
-from the
+The sequences
+.Dq $1 ,
+.Dq $2 ,
+\&...
+.Dq $9
+are replaced by any value resulting from the
.Ar inpattern
template.
-The sequence `$0' is replace by the original filename.
+The sequence
+.Dq $0
+is replaced by the original filename.
Additionally, the sequence
-.Ql Op Ar seq1 , Ar seq2
+.Dq Op Ar seq1 , Ar seq2
is replaced by
.Op Ar seq1
if
@@ -862,9 +900,18 @@ the output filename "myfile.data" for input filenames "myfile.data" and
"myfile.myfile" for the input filename ".myfile".
Spaces may be included in
.Ar outpattern ,
-as in the example: `nmap $1 sed "s/ *$//" \*[Gt] $1' .
-Use the `\e' character to prevent special treatment
-of the `$','[',']', and `,' characters.
+as in the example:
+.Dl nmap $1 sed "s/ *$//" \*[Gt] $1
+Use the
+.Sq \e
+character to prevent special treatment
+of the
+.Sq $ ,
+.Sq \&[ ,
+.Sq \&] ,
+and
+.Sq \&,
+characters.
.It Ic ntrans Op Ar inchars Op Ar outchars
Set or unset the filename character translation mechanism.
If no arguments are specified, the filename character
@@ -952,7 +999,7 @@ traffic.
servers are required to support the
.Dv PASV
command by
-.Li RFC 1123 ,
+.Li RFC1123 ,
some do not.)
.It Ic pdir Op Ar remote-path
Perform
@@ -1100,10 +1147,7 @@ A synonym for
The arguments specified are sent, verbatim, to the remote
.Tn FTP
server.
-.It Xo
-.Ic rate Ar direction
-.Op Ar maximum Op Ar increment
-.Xc
+.It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc
Throttle the maximum transfer rate to
.Ar maximum
bytes/second.
@@ -1126,7 +1170,6 @@ Outgoing transfers.
can be modified on the fly by
.Ar increment
bytes (default: 1024) each time a given signal is received:
-.B
.Bl -tag -width "SIGUSR1" -offset indent
.It Dv SIGUSR1
Increment
@@ -1388,10 +1431,7 @@ for more information.
.It Ic usage Ar command
Print the usage message for
.Ar command .
-.It Xo
-.Ic user Ar user-name
-.Op Ar password Op Ar account
-.Xc
+.It Ic user Ar user-name Oo Ar password Oo Ar account Oc Oc
Identify yourself to the remote
.Tn FTP
server.
@@ -1439,7 +1479,9 @@ A synonym for
.El
.Pp
Command arguments which have embedded spaces may be quoted with
-quote `"' marks.
+quote
+.Sq \&"
+marks.
.Pp
Commands which toggle settings can take an explicit
.Ic on
@@ -1491,14 +1533,8 @@ on the command line.
The following formats are valid syntax for an auto-fetch element:
.Bl -tag -width "FOO "
.\" [user@]host:[path][/]
-.It Xo
-.Sm off
-.Op Ar user Li \&@
-.Ar host Li \&:
-.Op Ar path
-.Op Li /
-.Sm on
-.Xc
+.It Oo Ar user Ns Li \&@ Oc Ns Ar host Ns Li \&: Ns Oo Ar path Oc \
+Ns Oo Li / Oc
.Dq Classic
.Tn FTP
format.
@@ -1523,18 +1559,9 @@ in the current directory.
Otherwise, the full remote name is used as the local name,
relative to the local root directory.
.\" ftp://[user[:password]@]host[:port]/path[/][;type=X]
-.It Xo
-.Sm off
-.Li ftp://
-.Oo Ar user
-.Op Li \&: Ar password
-.Li \&@ Oc
-.Ar host Oo Li \&: Ar port Oc
-.Li / Ar path
-.Op Li /
-.Op Li ;type= Ar X
-.Sm on
-.Xc
+.It Li ftp:// Ns Oo Ar user Ns Oo Ns Li \&: Ns Ar password Oc Ns Li \&@ Oc \
+Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path Ns Oo Li / Oc \
+Ns Oo Li ;type= Ns Ar X Oc
An
.Tn FTP
URL, retrieved using the
@@ -1565,7 +1592,7 @@ ascii or binary (respectively).
The default transfer type is binary.
.Pp
In order to be compliant with
-.Li RFC 1738 ,
+.Li RFC3986 ,
.Nm
interprets the
.Ar path
@@ -1618,7 +1645,7 @@ Any
.Sq Li \&% Ns Ar XX
codes
(per
-.Li RFC 1738 )
+.Li RFC3986 )
within the path components are decoded, with
.Ar XX
representing a character code in hexadecimal.
@@ -1705,16 +1732,8 @@ intermediate directories that is used in the equivalent of a
command.
.El
.\" http://[user[:password]@]host[:port]/path
-.It Xo
-.Sm off
-.Li http://
-.Oo Ar user
-.Op Li \&: Ar password
-.Li \&@ Oc
-.Ar host Oo Li \&: Ar port Oc
-.Li / Ar path
-.Sm on
-.Xc
+.It Li http:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
+Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
An
.Tn HTTP
URL, retrieved using the
@@ -1735,14 +1754,25 @@ and
.Sq password )
is in the URL, use them for the first attempt to authenticate.
.\" file:///path
-.It Xo
-.Sm off
-.Li file:/// Ar path
-.Sm on
-.Xc
+.It Li file:/// Ns Ar path
A local URL, copied from
.Pa / Ns Ar path
on the local host.
+.\" about:
+.It Li about: Ns Ar topic
+Display information regarding
+.Ar topic ;
+no file is retrieved for this auto-fetched element.
+Supported values include:
+.Bl -tag -width "about:version"
+.It Li about:ftp
+Information about
+.Nm ftp .
+.It Li about:version
+The version of
+.Nm ftp .
+Useful to provide when reporting problems.
+.El
.El
.Pp
Unless noted otherwise above, and
@@ -1868,11 +1898,12 @@ A particularly
useful example of this mechanism is:
.Dq Li dir \&"\&" \&|more .
.It
-Failing the above checks, if ``globbing'' is enabled,
-local file names are expanded
-according to the rules used in the
+Failing the above checks, if
+.Dq globbing
+is enabled, local file names are expanded according to the rules
+used in the
.Xr csh 1 ;
-c.f. the
+see the
.Ic glob
command.
If the
@@ -2038,6 +2069,20 @@ next
.Pa .netrc
line and continue until a blank line (consecutive new-line
characters) is encountered.
+Like the other tokens in the
+.Pa .netrc
+file, a
+.Ic macdef
+is applicable only to the
+.Ic machine
+definition preceding it.
+A
+.Ic macdef
+entry cannot be used by multiple
+.Ic machine
+definitions; rather, it must be defined following each
+.Ic machine
+it is intended to be used with.
If a macro named
.Ic init
is defined, it is automatically executed as the last step in the
@@ -2100,14 +2145,7 @@ information:
.It Li \&%/
The current remote working directory.
.\" %c[[0]n], %.[[0]n]
-.It Xo
-.Sm off
-.Li \&%c
-.Op Oo Li 0 Oc Ar n Ns ,
-.Li \&%.
-.Op Oo Li 0 Oc Ar n
-.Sm on
-.Xc
+.It \&%c Ns Oo Oo Li 0 Oc Ns Ar n Oc , Ns Li \&%. Ns Oo Oo Li 0 Oc Ns Ar n Oc
The trailing component of the current remote working directory, or
.Em n
trailing components if a digit
@@ -2248,7 +2286,7 @@ URL characters are required in the username or password
or
.Sq / ) ,
encode them with
-.Li RFC 1738
+.Li RFC3986
.Sq Li \&% Ns Ar XX
encoding.
.Pp
@@ -2291,16 +2329,27 @@ for an example of how to make this automatic.
.Xr ftpd 8
.Sh STANDARDS
.Nm
-attempts to be compliant with
-.Li RFC 959 ,
-.Li RFC 1123 ,
-.Li RFC 1738 ,
-.Li RFC 2068 ,
-.Li RFC 2389 ,
-.Li RFC 2428 ,
-.Li RFC 2732 ,
-and
-.Cm draft-ietf-ftpext-mlst-11 .
+attempts to be compliant with:
+.Bl -tag -offset indent -width 8n
+.It Li RFC0959
+.Em File Transfer Protocol
+.It Li RFC1123
+.Em Requirements for Internet Hosts - Application and Support
+.It Li RFC1635
+.Em How to Use Anonymous FTP
+.It Li RFC2389
+.Em Feature negotiation mechanism for the File Transfer Protocol
+.It Li RFC2428
+.Em FTP Extensions for IPv6 and NATs
+.It Li RFC2616
+.Em Hypertext Transfer Protocol -- HTTP/1.1
+.It Li RFC2822
+.Em Internet Message Format
+.It Li RFC3659
+.Em Extensions to FTP
+.It Li RFC3986
+.Em Uniform Resource Identifier (URI)
+.El
.Sh HISTORY
The
.Nm
diff --git a/contrib/lukemftp/src/ftp.c b/contrib/tnftp/src/ftp.c
index dae6131..4c4942f 100644
--- a/contrib/lukemftp/src/ftp.c
+++ b/contrib/tnftp/src/ftp.c
@@ -1,7 +1,8 @@
-/* $NetBSD: ftp.c,v 1.132 2005/05/14 15:26:43 lukem Exp $ */
+/* $NetBSD: ftp.c,v 1.18 2009/05/20 12:53:47 lukem Exp $ */
+/* from NetBSD: ftp.c,v 1.159 2009/04/15 03:42:33 jld Exp */
/*-
- * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -15,13 +16,6 @@
* 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
@@ -94,12 +88,17 @@
* SUCH DAMAGE.
*/
+#include "tnftp.h"
+#include <arpa/telnet.h>
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-__RCSID("$NetBSD: ftp.c,v 1.132 2005/05/14 15:26:43 lukem Exp $");
+__RCSID(" NetBSD: ftp.c,v 1.159 2009/04/15 03:42:33 jld Exp ");
#endif
#endif /* not lint */
@@ -127,6 +126,8 @@ __RCSID("$NetBSD: ftp.c,v 1.132 2005/05/14 15:26:43 lukem Exp $");
#include <unistd.h>
#include <stdarg.h>
+#endif /* tnftp */
+
#include "ftp_var.h"
volatile sig_atomic_t abrtflag;
@@ -146,12 +147,12 @@ struct sockinet {
struct sockaddr_in6 su_sin6;
#endif
} si_su;
-#if !HAVE_SOCKADDR_SA_LEN
+#if !defined(HAVE_STRUCT_SOCKADDR_IN_SIN_LEN)
int si_len;
#endif
};
-#if !HAVE_SOCKADDR_SA_LEN
+#if !defined(HAVE_STRUCT_SOCKADDR_IN_SIN_LEN)
# define su_len si_len
#else
# define su_len si_su.su_sin.sin_len
@@ -162,27 +163,26 @@ struct sockinet {
struct sockinet myctladdr, hisctladdr, data_addr;
char *
-hookup(char *host, char *port)
+hookup(const char *host, const char *port)
{
- int s = -1, error, portnum;
+ int s = -1, error;
struct addrinfo hints, *res, *res0;
- char hbuf[MAXHOSTNAMELEN];
static char hostnamebuf[MAXHOSTNAMELEN];
- char *cause = "unknown";
socklen_t len;
int on = 1;
memset((char *)&hisctladdr, 0, sizeof (hisctladdr));
memset((char *)&myctladdr, 0, sizeof (myctladdr));
memset(&hints, 0, sizeof(hints));
- portnum = parseport(port, FTP_PORT);
hints.ai_flags = AI_CANONNAME;
hints.ai_family = family;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = 0;
- error = getaddrinfo(host, NULL, &hints, &res0);
+ error = getaddrinfo(host, port, &hints, &res0);
if (error) {
- warnx("%s", gai_strerror(error));
+ warnx("Can't lookup `%s:%s': %s", host, port,
+ (error == EAI_SYSTEM) ? strerror(errno)
+ : gai_strerror(error));
code = -1;
return (0);
}
@@ -195,53 +195,26 @@ hookup(char *host, char *port)
hostname = hostnamebuf;
for (res = res0; res; res = res->ai_next) {
- /*
- * make sure that ai_addr is NOT an IPv4 mapped address.
- * IPv4 mapped address complicates too many things in FTP
- * protocol handling, as FTP protocol is defined differently
- * between IPv4 and IPv6.
- *
- * This may not be the best way to handle this situation,
- * since the semantics of IPv4 mapped address is defined in
- * the kernel. There are configurations where we should use
- * IPv4 mapped address as native IPv6 address, not as
- * "an IPv6 address that embeds IPv4 address" (namely, SIIT).
- *
- * More complete solution would be to have an additional
- * getsockopt to grab "real" peername/sockname. "real"
- * peername/sockname will be AF_INET if IPv4 mapped address
- * is used to embed IPv4 address, and will be AF_INET6 if
- * we use it as native. What a mess!
- */
+ char hname[NI_MAXHOST], sname[NI_MAXSERV];
+
ai_unmapped(res);
-#if 0 /*old behavior*/
- if (res != res0) /* not on the first address */
-#else
- if (res0->ai_next) /* if we have multiple possibilities */
-#endif
- {
- if (getnameinfo(res->ai_addr, res->ai_addrlen,
- hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST))
- strlcpy(hbuf, "?", sizeof(hbuf));
- fprintf(ttyout, "Trying %s...\n", hbuf);
+ if (getnameinfo(res->ai_addr, res->ai_addrlen,
+ hname, sizeof(hname), sname, sizeof(sname),
+ NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
+ strlcpy(hname, "?", sizeof(hname));
+ strlcpy(sname, "?", sizeof(sname));
+ }
+ if (verbose && res0->ai_next) {
+ /* if we have multiple possibilities */
+ fprintf(ttyout, "Trying %s:%s ...\n", hname, sname);
}
- ((struct sockaddr_in *)res->ai_addr)->sin_port = htons(portnum);
s = socket(res->ai_family, SOCK_STREAM, res->ai_protocol);
if (s < 0) {
- cause = "socket";
+ warn("Can't create socket for connection to `%s:%s'",
+ hname, sname);
continue;
}
- error = xconnect(s, res->ai_addr, res->ai_addrlen);
- if (error) {
- /* this "if" clause is to prevent print warning twice */
- if (res->ai_next) {
- if (getnameinfo(res->ai_addr, res->ai_addrlen,
- hbuf, sizeof(hbuf), NULL, 0,
- NI_NUMERICHOST))
- strlcpy(hbuf, "?", sizeof(hbuf));
- warn("connect to address %s", hbuf);
- }
- cause = "connect";
+ if (ftp_connect(s, res->ai_addr, res->ai_addrlen) < 0) {
close(s);
s = -1;
continue;
@@ -251,7 +224,7 @@ hookup(char *host, char *port)
break;
}
if (s < 0) {
- warn("%s", cause);
+ warnx("Can't connect to `%s:%s'", host, port);
code = -1;
freeaddrinfo(res0);
return 0;
@@ -263,7 +236,8 @@ hookup(char *host, char *port)
len = hisctladdr.su_len;
if (getsockname(s, (struct sockaddr *)&myctladdr.si_su, &len) == -1) {
- warn("getsockname");
+ warn("Can't determine my address of connection to `%s:%s'",
+ host, port);
code = -1;
goto bad;
}
@@ -274,8 +248,7 @@ hookup(char *host, char *port)
int tos = IPTOS_LOWDELAY;
if (setsockopt(s, IPPROTO_IP, IP_TOS,
(void *)&tos, sizeof(tos)) == -1) {
- if (debug)
- warn("setsockopt %s (ignored)",
+ DWARN("setsockopt %s (ignored)",
"IPTOS_LOWDELAY");
}
}
@@ -283,7 +256,7 @@ hookup(char *host, char *port)
cin = fdopen(s, "r");
cout = fdopen(s, "w");
if (cin == NULL || cout == NULL) {
- warnx("fdopen failed.");
+ warnx("Can't fdopen socket");
if (cin)
(void)fclose(cin);
if (cout)
@@ -304,8 +277,7 @@ hookup(char *host, char *port)
if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE,
(void *)&on, sizeof(on)) == -1) {
- if (debug)
- warn("setsockopt %s (ignored)", "SO_OOBINLINE");
+ DWARN("setsockopt %s (ignored)", "SO_OOBINLINE");
}
return (hostname);
@@ -351,7 +323,8 @@ command(const char *fmt, ...)
int r;
sigfunc oldsigint;
- if (debug) {
+#ifndef NO_DEBUG
+ if (ftp_debug) {
fputs("---> ", ttyout);
va_start(ap, fmt);
if (strncmp("PASS ", fmt, 5) == 0)
@@ -363,8 +336,9 @@ command(const char *fmt, ...)
va_end(ap);
putc('\n', ttyout);
}
+#endif
if (cout == NULL) {
- warnx("No control connection for command.");
+ warnx("No control connection for command");
code = -1;
return (0);
}
@@ -386,11 +360,17 @@ command(const char *fmt, ...)
return (r);
}
+static const char *m421[] = {
+ "remote server timed out. Connection closed",
+ "user interrupt. Connection closed",
+ "remote server has closed connection",
+};
+
int
getreply(int expecteof)
{
char current_line[BUFSIZ]; /* last line of previous reply */
- int c, n, line;
+ int c, n, lineno;
int dig;
int originalcode = 0, continuation = 0;
sigfunc oldsigint, oldsigalrm;
@@ -403,10 +383,11 @@ getreply(int expecteof)
oldsigint = xsignal(SIGINT, cmdabort);
oldsigalrm = xsignal(SIGALRM, cmdtimeout);
- for (line = 0 ;; line++) {
+ for (lineno = 0 ;; lineno++) {
dig = n = code = 0;
cp = current_line;
- while (alarmtimer(60),((c = getc(cin)) != '\n')) {
+ while (alarmtimer(quit_time ? quit_time : 60),
+ ((c = getc(cin)) != '\n')) {
if (c == IAC) { /* handle telnet commands */
switch (c = getc(cin)) {
case WILL:
@@ -445,18 +426,15 @@ getreply(int expecteof)
cpend = 0;
lostpeer(0);
if (verbose) {
+ size_t midx;
if (reply_timeoutflag)
- fputs(
- "421 Service not available, remote server timed out. Connection closed\n",
- ttyout);
+ midx = 0;
else if (reply_abrtflag)
- fputs(
- "421 Service not available, user interrupt. Connection closed.\n",
- ttyout);
+ midx = 1;
else
- fputs(
- "421 Service not available, remote server has closed connection.\n",
- ttyout);
+ midx = 2;
+ (void)fprintf(ttyout,
+ "421 Service not available, %s.\n", m421[midx]);
(void)fflush(ttyout);
}
code = 421;
@@ -505,15 +483,15 @@ getreply(int expecteof)
if (verbose > 0 || ((verbose > -1 && n == '5') &&
(n < '5' || !retry_connect))) {
(void)putc(c, ttyout);
- (void)fflush (ttyout);
+ (void)fflush(ttyout);
}
if (cp[-1] == '\r')
cp[-1] = '\0';
*cp = '\0';
- if (line == 0)
+ if (lineno == 0)
(void)strlcpy(reply_string, current_line,
sizeof(reply_string));
- if (line > 0 && code == 0 && reply_callback != NULL)
+ if (lineno > 0 && code == 0 && reply_callback != NULL)
(*reply_callback)(current_line);
if (continuation && code != originalcode) {
if (originalcode == 0)
@@ -537,14 +515,14 @@ getreply(int expecteof)
}
static int
-empty(FILE *cin, FILE *din, int sec)
+empty(FILE *ecin, FILE *din, int sec)
{
int nr, nfd;
struct pollfd pfd[2];
nfd = 0;
- if (cin) {
- pfd[nfd].fd = fileno(cin);
+ if (ecin) {
+ pfd[nfd].fd = fileno(ecin);
pfd[nfd++].events = POLLIN;
}
@@ -553,12 +531,12 @@ empty(FILE *cin, FILE *din, int sec)
pfd[nfd++].events = POLLIN;
}
- if ((nr = xpoll(pfd, nfd, sec * 1000)) <= 0)
+ if ((nr = ftp_poll(pfd, nfd, sec * 1000)) <= 0)
return nr;
nr = 0;
nfd = 0;
- if (cin)
+ if (ecin)
nr |= (pfd[nfd++].revents & POLLIN) ? 1 : 0;
if (din)
nr |= (pfd[nfd++].revents & POLLIN) ? 2 : 0;
@@ -585,8 +563,7 @@ abortxfer(int notused)
strlcpy(msgbuf, "\nsend", sizeof(msgbuf));
break;
default:
- errx(1, "abortxfer called with unknown direction `%s'",
- direction);
+ errx(1, "abortxfer: unknown direction `%s'", direction);
}
len = strlcat(msgbuf, " aborted. Waiting for remote to finish abort.\n",
sizeof(msgbuf));
@@ -594,30 +571,108 @@ abortxfer(int notused)
siglongjmp(xferabort, 1);
}
+/*
+ * Read data from infd & write to outfd, using buf/bufsize as the temporary
+ * buffer, dealing with short writes.
+ * If rate_limit != 0, rate-limit the transfer.
+ * If hash_interval != 0, fputc('c', ttyout) every hash_interval bytes.
+ * Updates global variables: bytes.
+ * Returns 0 if ok, 1 if there was a read error, 2 if there was a write error.
+ * In the case of error, errno contains the appropriate error code.
+ */
+static int
+copy_bytes(int infd, int outfd, char *buf, size_t bufsize,
+ int rate_limit, int hash_interval)
+{
+ volatile off_t hashc;
+ ssize_t inc, outc;
+ char *bufp;
+ struct timeval tvthen, tvnow, tvdiff;
+ off_t bufrem, bufchunk;
+ int serr;
+
+ hashc = hash_interval;
+ if (rate_limit)
+ bufchunk = rate_limit;
+ else
+ bufchunk = bufsize;
+
+ while (1) {
+ if (rate_limit) {
+ (void)gettimeofday(&tvthen, NULL);
+ }
+ errno = 0;
+ inc = outc = 0;
+ /* copy bufchunk at a time */
+ bufrem = bufchunk;
+ while (bufrem > 0) {
+ inc = read(infd, buf, MIN((off_t)bufsize, bufrem));
+ if (inc <= 0)
+ goto copy_done;
+ bytes += inc;
+ bufrem -= inc;
+ bufp = buf;
+ while (inc > 0) {
+ outc = write(outfd, bufp, inc);
+ if (outc < 0)
+ goto copy_done;
+ inc -= outc;
+ bufp += outc;
+ }
+ if (hash_interval) {
+ while (bytes >= hashc) {
+ (void)putc('#', ttyout);
+ hashc += hash_interval;
+ }
+ (void)fflush(ttyout);
+ }
+ }
+ if (rate_limit) { /* rate limited; wait if necessary */
+ while (1) {
+ (void)gettimeofday(&tvnow, NULL);
+ timersub(&tvnow, &tvthen, &tvdiff);
+ if (tvdiff.tv_sec > 0)
+ break;
+ usleep(1000000 - tvdiff.tv_usec);
+ }
+ }
+ }
+
+ copy_done:
+ serr = errno;
+ if (hash_interval && bytes > 0) {
+ if (bytes < hash_interval)
+ (void)putc('#', ttyout);
+ (void)putc('\n', ttyout);
+ (void)fflush(ttyout);
+ }
+ errno = serr;
+ if (inc == -1)
+ return 1;
+ if (outc == -1)
+ return 2;
+
+ return 0;
+}
+
void
sendrequest(const char *cmd, const char *local, const char *remote,
int printnames)
{
struct stat st;
- int c, d;
- FILE *fin, *dout;
- int (*closefunc)(FILE *);
- sigfunc oldintr, oldintp;
- volatile off_t hashbytes;
- char *lmode, *bufp;
+ int c;
+ FILE *volatile fin;
+ FILE *volatile dout;
+ int (*volatile closefunc)(FILE *);
+ sigfunc volatile oldintr;
+ sigfunc volatile oldintp;
+ off_t volatile hashbytes;
+ int hash_interval;
+ const char *lmode;
static size_t bufsize;
static char *buf;
int oprogress;
-#ifdef __GNUC__ /* to shut up gcc warnings */
- (void)&fin;
- (void)&dout;
- (void)&closefunc;
- (void)&oldintr;
- (void)&oldintp;
- (void)&lmode;
-#endif
-
hashbytes = mark;
direction = "sent";
dout = NULL;
@@ -625,7 +680,7 @@ sendrequest(const char *cmd, const char *local, const char *remote,
filesize = -1;
oprogress = progress;
if (verbose && printnames) {
- if (local && *local != '-')
+ if (*local != '-')
fprintf(ttyout, "local: %s ", local);
if (remote)
fprintf(ttyout, "remote: %s\n", remote);
@@ -655,7 +710,7 @@ sendrequest(const char *cmd, const char *local, const char *remote,
oldintp = xsignal(SIGPIPE, SIG_IGN);
fin = popen(local + 1, "r");
if (fin == NULL) {
- warn("%s", local + 1);
+ warn("Can't execute `%s'", local + 1);
code = -1;
goto cleanupsend;
}
@@ -664,7 +719,7 @@ sendrequest(const char *cmd, const char *local, const char *remote,
} else {
fin = fopen(local, "r");
if (fin == NULL) {
- warn("local: %s", local);
+ warn("Can't open `%s'", local);
code = -1;
goto cleanupsend;
}
@@ -698,7 +753,7 @@ sendrequest(const char *cmd, const char *local, const char *remote,
break;
}
if (rc < 0) {
- warn("local: %s", local);
+ warn("Can't seek to restart `%s'", local);
goto cleanupsend;
}
if (command("REST " LLF, (LLT)restart_point) != CONTINUE)
@@ -717,90 +772,28 @@ sendrequest(const char *cmd, const char *local, const char *remote,
if (dout == NULL)
goto abort;
- if (sndbuf_size > bufsize) {
+ if ((size_t)sndbuf_size > bufsize) {
if (buf)
(void)free(buf);
bufsize = sndbuf_size;
- buf = xmalloc(bufsize);
+ buf = ftp_malloc(bufsize);
}
progressmeter(-1);
oldintp = xsignal(SIGPIPE, SIG_IGN);
+ hash_interval = (hash && (!progress || filesize < 0)) ? mark : 0;
switch (curtype) {
case TYPE_I:
case TYPE_L:
- if (rate_put) { /* rate limited */
- while (1) {
- struct timeval then, now, td;
- off_t bufrem;
-
- (void)gettimeofday(&then, NULL);
- errno = c = d = 0;
- bufrem = rate_put;
- while (bufrem > 0) {
- if ((c = read(fileno(fin), buf,
- MIN(bufsize, bufrem))) <= 0)
- goto senddone;
- bytes += c;
- bufrem -= c;
- for (bufp = buf; c > 0;
- c -= d, bufp += d)
- if ((d = write(fileno(dout),
- bufp, c)) <= 0)
- break;
- if (d < 0)
- goto senddone;
- if (hash &&
- (!progress || filesize < 0) ) {
- while (bytes >= hashbytes) {
- (void)putc('#', ttyout);
- hashbytes += mark;
- }
- (void)fflush(ttyout);
- }
- }
- while (1) {
- (void)gettimeofday(&now, NULL);
- timersub(&now, &then, &td);
- if (td.tv_sec > 0)
- break;
- usleep(1000000 - td.tv_usec);
- }
- }
- } else { /* simpler/faster; no rate limit */
- while (1) {
- errno = c = d = 0;
- if ((c = read(fileno(fin), buf, bufsize)) <= 0)
- goto senddone;
- bytes += c;
- for (bufp = buf; c > 0; c -= d, bufp += d)
- if ((d = write(fileno(dout), bufp, c))
- <= 0)
- break;
- if (d < 0)
- goto senddone;
- if (hash && (!progress || filesize < 0) ) {
- while (bytes >= hashbytes) {
- (void)putc('#', ttyout);
- hashbytes += mark;
- }
- (void)fflush(ttyout);
- }
- }
- }
- senddone:
- if (hash && (!progress || filesize < 0) && bytes > 0) {
- if (bytes < mark)
- (void)putc('#', ttyout);
- (void)putc('\n', ttyout);
- }
- if (c < 0)
- warn("local: %s", local);
- if (d < 0) {
+ c = copy_bytes(fileno(fin), fileno(dout), buf, bufsize,
+ rate_put, hash_interval);
+ if (c == 1) {
+ warn("Reading `%s'", local);
+ } else if (c == 2) {
if (errno != EPIPE)
- warn("netout");
+ warn("Writing to network");
bytes = -1;
}
break;
@@ -808,8 +801,7 @@ sendrequest(const char *cmd, const char *local, const char *remote,
case TYPE_A:
while ((c = getc(fin)) != EOF) {
if (c == '\n') {
- while (hash && (!progress || filesize < 0) &&
- (bytes >= hashbytes)) {
+ while (hash_interval && bytes >= hashbytes) {
(void)putc('#', ttyout);
(void)fflush(ttyout);
hashbytes += mark;
@@ -821,23 +813,23 @@ sendrequest(const char *cmd, const char *local, const char *remote,
}
(void)putc(c, dout);
bytes++;
-#if 0 /* this violates RFC */
+#if 0 /* this violates RFC0959 */
if (c == '\r') {
(void)putc('\0', dout);
bytes++;
}
#endif
}
- if (hash && (!progress || filesize < 0)) {
+ if (hash_interval) {
if (bytes < hashbytes)
(void)putc('#', ttyout);
(void)putc('\n', ttyout);
}
if (ferror(fin))
- warn("local: %s", local);
+ warn("Reading `%s'", local);
if (ferror(dout)) {
if (errno != EPIPE)
- warn("netout");
+ warn("Writing to network");
bytes = -1;
}
break;
@@ -894,32 +886,28 @@ sendrequest(const char *cmd, const char *local, const char *remote,
}
void
-recvrequest(const char *cmd, const char *local, const char *remote,
+recvrequest(const char *cmd, const char *volatile local, const char *remote,
const char *lmode, int printnames, int ignorespecial)
{
- FILE *fout, *din;
- int (*closefunc)(FILE *);
- sigfunc oldintr, oldintp;
+ FILE *volatile fout;
+ FILE *volatile din;
+ int (*volatile closefunc)(FILE *);
+ sigfunc volatile oldintr;
+ sigfunc volatile oldintp;
int c, d;
- volatile int is_retr, tcrflag, bare_lfs;
+ int volatile is_retr;
+ int volatile tcrflag;
+ int volatile bare_lfs;
static size_t bufsize;
static char *buf;
- volatile off_t hashbytes;
+ off_t volatile hashbytes;
+ int hash_interval;
struct stat st;
time_t mtime;
struct timeval tval[2];
int oprogress;
int opreserve;
-#ifdef __GNUC__ /* to shut up gcc warnings */
- (void)&local;
- (void)&fout;
- (void)&din;
- (void)&closefunc;
- (void)&oldintr;
- (void)&oldintp;
-#endif
-
fout = NULL;
din = NULL;
hashbytes = mark;
@@ -931,7 +919,7 @@ recvrequest(const char *cmd, const char *local, const char *remote,
opreserve = preserve;
is_retr = (strcmp(cmd, "RETR") == 0);
if (is_retr && verbose && printnames) {
- if (local && (ignorespecial || *local != '-'))
+ if (ignorespecial || *local != '-')
fprintf(ttyout, "local: %s ", local);
if (remote)
fprintf(ttyout, "remote: %s\n", remote);
@@ -957,7 +945,7 @@ recvrequest(const char *cmd, const char *local, const char *remote,
char *dir = strrchr(local, '/');
if (errno != ENOENT && errno != EACCES) {
- warn("local: %s", local);
+ warn("Can't access `%s'", local);
code = -1;
goto cleanuprecv;
}
@@ -968,13 +956,13 @@ recvrequest(const char *cmd, const char *local, const char *remote,
if (dir != NULL)
*dir = '/';
if (d < 0) {
- warn("local: %s", local);
+ warn("Can't access `%s'", local);
code = -1;
goto cleanuprecv;
}
if (!runique && errno == EACCES &&
chmod(local, (S_IRUSR|S_IWUSR)) < 0) {
- warn("local: %s", local);
+ warn("Can't chmod `%s'", local);
code = -1;
goto cleanuprecv;
}
@@ -1026,7 +1014,7 @@ recvrequest(const char *cmd, const char *local, const char *remote,
oldintp = xsignal(SIGPIPE, SIG_IGN);
fout = popen(local + 1, "w");
if (fout == NULL) {
- warn("%s", local+1);
+ warn("Can't execute `%s'", local+1);
goto abort;
}
progress = 0;
@@ -1035,7 +1023,7 @@ recvrequest(const char *cmd, const char *local, const char *remote,
} else {
fout = fopen(local, lmode);
if (fout == NULL) {
- warn("local: %s", local);
+ warn("Can't open `%s'", local);
goto abort;
}
closefunc = fclose;
@@ -1045,14 +1033,15 @@ recvrequest(const char *cmd, const char *local, const char *remote,
progress = 0;
preserve = 0;
}
- if (rcvbuf_size > bufsize) {
+ if ((size_t)rcvbuf_size > bufsize) {
if (buf)
(void)free(buf);
bufsize = rcvbuf_size;
- buf = xmalloc(bufsize);
+ buf = ftp_malloc(bufsize);
}
progressmeter(-1);
+ hash_interval = (hash && (!progress || filesize < 0)) ? mark : 0;
switch (curtype) {
@@ -1060,76 +1049,17 @@ recvrequest(const char *cmd, const char *local, const char *remote,
case TYPE_L:
if (is_retr && restart_point &&
lseek(fileno(fout), restart_point, SEEK_SET) < 0) {
- warn("local: %s", local);
+ warn("Can't seek to restart `%s'", local);
goto cleanuprecv;
}
- if (rate_get) { /* rate limiting */
- while (1) {
- struct timeval then, now, td;
- off_t bufrem;
-
- (void)gettimeofday(&then, NULL);
- errno = c = d = 0;
- for (bufrem = rate_get; bufrem > 0; ) {
- if ((c = read(fileno(din), buf,
- MIN(bufsize, bufrem))) <= 0)
- goto recvdone;
- bytes += c;
- bufrem -=c;
- if ((d = write(fileno(fout), buf, c))
- != c)
- goto recvdone;
- if (hash &&
- (!progress || filesize < 0)) {
- while (bytes >= hashbytes) {
- (void)putc('#', ttyout);
- hashbytes += mark;
- }
- (void)fflush(ttyout);
- }
- }
- /* sleep until time is up */
- while (1) {
- (void)gettimeofday(&now, NULL);
- timersub(&now, &then, &td);
- if (td.tv_sec > 0)
- break;
- usleep(1000000 - td.tv_usec);
- }
- }
- } else { /* faster code (no limiting) */
- while (1) {
- errno = c = d = 0;
- if ((c = read(fileno(din), buf, bufsize)) <= 0)
- goto recvdone;
- bytes += c;
- if ((d = write(fileno(fout), buf, c)) != c)
- goto recvdone;
- if (hash && (!progress || filesize < 0)) {
- while (bytes >= hashbytes) {
- (void)putc('#', ttyout);
- hashbytes += mark;
- }
- (void)fflush(ttyout);
- }
- }
- }
- recvdone:
- if (hash && (!progress || filesize < 0) && bytes > 0) {
- if (bytes < mark)
- (void)putc('#', ttyout);
- (void)putc('\n', ttyout);
- }
- if (c < 0) {
+ c = copy_bytes(fileno(din), fileno(fout), buf, bufsize,
+ rate_get, hash_interval);
+ if (c == 1) {
if (errno != EPIPE)
- warn("netin");
+ warn("Reading from network");
bytes = -1;
- }
- if (d < c) {
- if (d < 0)
- warn("local: %s", local);
- else
- warnx("%s: short write", local);
+ } else if (c == 2) {
+ warn("Writing `%s'", local);
}
break;
@@ -1148,7 +1078,7 @@ recvrequest(const char *cmd, const char *local, const char *remote,
}
if (fseeko(fout, (off_t)0, SEEK_CUR) < 0) {
done:
- warn("local: %s", local);
+ warn("Can't seek to restart `%s'", local);
goto cleanuprecv;
}
}
@@ -1156,8 +1086,7 @@ recvrequest(const char *cmd, const char *local, const char *remote,
if (c == '\n')
bare_lfs++;
while (c == '\r') {
- while (hash && (!progress || filesize < 0) &&
- (bytes >= hashbytes)) {
+ while (hash_interval && bytes >= hashbytes) {
(void)putc('#', ttyout);
(void)fflush(ttyout);
hashbytes += mark;
@@ -1180,18 +1109,18 @@ recvrequest(const char *cmd, const char *local, const char *remote,
contin2: ;
}
break2:
- if (hash && (!progress || filesize < 0)) {
+ if (hash_interval) {
if (bytes < hashbytes)
(void)putc('#', ttyout);
(void)putc('\n', ttyout);
}
if (ferror(din)) {
if (errno != EPIPE)
- warn("netin");
+ warn("Reading from network");
bytes = -1;
}
if (ferror(fout))
- warn("local: %s", local);
+ warn("Writing `%s'", local);
break;
}
@@ -1221,7 +1150,8 @@ recvrequest(const char *cmd, const char *local, const char *remote,
if (utimes(local, tval) == -1) {
fprintf(ttyout,
"Can't change modification time on %s to %s",
- local, asctime(localtime(&mtime)));
+ local,
+ rfc2822time(localtime(&mtime)));
}
}
}
@@ -1230,7 +1160,7 @@ recvrequest(const char *cmd, const char *local, const char *remote,
abort:
/*
- * abort using RFC 959 recommended IP,SYNC sequence
+ * abort using RFC0959 recommended IP,SYNC sequence
*/
if (! sigsetjmp(xferabort, 1)) {
/* this is the first call */
@@ -1274,38 +1204,48 @@ initconn(void)
int result, tmpno = 0;
int on = 1;
int error;
- u_int addr[16], port[2];
- u_int af, hal, pal;
+ unsigned int addr[16], port[2];
+ unsigned int af, hal, pal;
socklen_t len;
- char *pasvcmd = NULL;
+ const char *pasvcmd = NULL;
+ int overbose;
#ifdef INET6
- if (myctladdr.su_family == AF_INET6 && debug &&
+#ifndef NO_DEBUG
+ if (myctladdr.su_family == AF_INET6 && ftp_debug &&
(IN6_IS_ADDR_LINKLOCAL(&myctladdr.si_su.su_sin6.sin6_addr) ||
IN6_IS_ADDR_SITELOCAL(&myctladdr.si_su.su_sin6.sin6_addr))) {
- warnx("use of scoped address can be troublesome");
+ warnx("Use of scoped addresses can be troublesome");
}
#endif
+#endif
+
reinit:
if (passivemode) {
data_addr = myctladdr;
data = socket(data_addr.su_family, SOCK_STREAM, 0);
if (data < 0) {
- warn("socket");
+ warn("Can't create socket for data connection");
return (1);
}
if ((options & SO_DEBUG) &&
setsockopt(data, SOL_SOCKET, SO_DEBUG,
(void *)&on, sizeof(on)) == -1) {
- if (debug)
- warn("setsockopt %s (ignored)", "SO_DEBUG");
+ DWARN("setsockopt %s (ignored)", "SO_DEBUG");
}
result = COMPLETE + 1;
switch (data_addr.su_family) {
case AF_INET:
if (epsv4 && !epsv4bad) {
pasvcmd = "EPSV";
+ overbose = verbose;
+ if (ftp_debug == 0)
+ verbose = -1;
result = command("EPSV");
+ verbose = overbose;
+ if (verbose > 0 &&
+ (result == COMPLETE || !connected))
+ fprintf(ttyout, "%s\n", reply_string);
if (!connected)
return (1);
/*
@@ -1320,10 +1260,8 @@ initconn(void)
}
if (result != COMPLETE) {
epsv4bad = 1;
- if (debug)
- fputs(
- "disabling epsv4 for this connection\n",
- ttyout);
+ DPRINTF("disabling epsv4 for this "
+ "connection\n");
}
}
if (result != COMPLETE) {
@@ -1335,16 +1273,33 @@ initconn(void)
break;
#ifdef INET6
case AF_INET6:
- pasvcmd = "EPSV";
- result = command("EPSV");
- if (!connected)
- return (1);
- /* this code is to be friendly with broken BSDI ftpd */
- if (code / 10 == 22 && code != 229) {
- fputs(
-"wrong server: return code must be 229\n",
- ttyout);
- result = COMPLETE + 1;
+ if (epsv6 && !epsv6bad) {
+ pasvcmd = "EPSV";
+ overbose = verbose;
+ if (ftp_debug == 0)
+ verbose = -1;
+ result = command("EPSV");
+ verbose = overbose;
+ if (verbose > 0 &&
+ (result == COMPLETE || !connected))
+ fprintf(ttyout, "%s\n", reply_string);
+ if (!connected)
+ return (1);
+ /*
+ * this code is to be friendly with
+ * broken BSDI ftpd
+ */
+ if (code / 10 == 22 && code != 229) {
+ fputs(
+ "wrong server: return code must be 229\n",
+ ttyout);
+ result = COMPLETE + 1;
+ }
+ if (result != COMPLETE) {
+ epsv6bad = 1;
+ DPRINTF("disabling epsv6 for this "
+ "connection\n");
+ }
}
if (result != COMPLETE) {
pasvcmd = "LPSV";
@@ -1476,7 +1431,7 @@ initconn(void)
data_addr.su_family = AF_INET6;
data_addr.su_len = sizeof(struct sockaddr_in6);
{
- int i;
+ size_t i;
for (i = 0; i < sizeof(struct in6_addr); i++) {
data_addr.si_su.su_sin6.sin6_addr.s6_addr[i] =
UC(addr[i]);
@@ -1516,8 +1471,8 @@ initconn(void)
} else
goto bad;
- while (xconnect(data, (struct sockaddr *)&data_addr.si_su,
- data_addr.su_len) < 0) {
+ if (ftp_connect(data, (struct sockaddr *)&data_addr.si_su,
+ data_addr.su_len) < 0) {
if (activefallback) {
(void)close(data);
data = -1;
@@ -1527,7 +1482,6 @@ initconn(void)
#endif
goto reinit;
}
- warn("connect for data channel");
goto bad;
}
#ifdef IPTOS_THROUGHPUT
@@ -1535,9 +1489,8 @@ initconn(void)
on = IPTOS_THROUGHPUT;
if (setsockopt(data, IPPROTO_IP, IP_TOS,
(void *)&on, sizeof(on)) == -1) {
- if (debug)
- warn("setsockopt %s (ignored)",
- "IPTOS_THROUGHPUT");
+ DWARN("setsockopt %s (ignored)",
+ "IPTOS_THROUGHPUT");
}
}
#endif
@@ -1552,7 +1505,7 @@ initconn(void)
(void)close(data);
data = socket(data_addr.su_family, SOCK_STREAM, 0);
if (data < 0) {
- warn("socket");
+ warn("Can't create socket for data connection");
if (tmpno)
sendport = 1;
return (1);
@@ -1560,33 +1513,31 @@ initconn(void)
if (!sendport)
if (setsockopt(data, SOL_SOCKET, SO_REUSEADDR,
(void *)&on, sizeof(on)) == -1) {
- warn("setsockopt %s", "SO_REUSEADDR");
+ warn("Can't set SO_REUSEADDR on data connection");
goto bad;
}
if (bind(data, (struct sockaddr *)&data_addr.si_su,
data_addr.su_len) < 0) {
- warn("bind");
+ warn("Can't bind for data connection");
goto bad;
}
if ((options & SO_DEBUG) &&
setsockopt(data, SOL_SOCKET, SO_DEBUG,
(void *)&on, sizeof(on)) == -1) {
- if (debug)
- warn("setsockopt %s (ignored)", "SO_DEBUG");
+ DWARN("setsockopt %s (ignored)", "SO_DEBUG");
}
len = sizeof(data_addr.si_su);
memset((char *)&data_addr, 0, sizeof (data_addr));
if (getsockname(data, (struct sockaddr *)&data_addr.si_su, &len) == -1) {
- warn("getsockname");
+ warn("Can't determine my address of data connection");
goto bad;
}
data_addr.su_len = len;
- if (xlisten(data, 1) < 0)
- warn("listen");
+ if (ftp_listen(data, 1) < 0)
+ warn("Can't listen to data connection");
if (sendport) {
char hname[NI_MAXHOST], sname[NI_MAXSERV];
- int af;
struct sockinet tmp;
switch (data_addr.su_family) {
@@ -1598,6 +1549,10 @@ initconn(void)
/* FALLTHROUGH */
#ifdef INET6
case AF_INET6:
+ if (!epsv6 || epsv6bad) {
+ result = COMPLETE + 1;
+ break;
+ }
#endif
af = (data_addr.su_family == AF_INET) ? 1 : 2;
tmp = data_addr;
@@ -1610,16 +1565,21 @@ initconn(void)
sizeof(sname), NI_NUMERICHOST | NI_NUMERICSERV)) {
result = ERROR;
} else {
- result = command("EPRT |%d|%s|%s|", af, hname,
+ overbose = verbose;
+ if (ftp_debug == 0)
+ verbose = -1;
+ result = command("EPRT |%u|%s|%s|", af, hname,
sname);
+ verbose = overbose;
+ if (verbose > 0 &&
+ (result == COMPLETE || !connected))
+ fprintf(ttyout, "%s\n", reply_string);
if (!connected)
return (1);
if (result != COMPLETE) {
epsv4bad = 1;
- if (debug)
- fputs(
- "disabling epsv4 for this connection\n",
- ttyout);
+ DPRINTF("disabling epsv4 for this "
+ "connection\n");
}
}
break;
@@ -1672,10 +1632,9 @@ initconn(void)
if (data_addr.su_family == AF_INET) {
on = IPTOS_THROUGHPUT;
if (setsockopt(data, IPPROTO_IP, IP_TOS,
- (void *)&on, sizeof(on)) == -1)
- if (debug)
- warn("setsockopt %s (ignored)",
- "IPTOS_THROUGHPUT");
+ (void *)&on, sizeof(on)) == -1) {
+ DWARN("setsockopt %s (ignored)", "IPTOS_THROUGHPUT");
+ }
}
#endif
return (0);
@@ -1720,14 +1679,14 @@ dataconn(const char *lmode)
timeout = td.tv_sec * 1000 + td.tv_usec/1000;
if (timeout < 0)
timeout = 0;
- rv = xpoll(pfd, 1, timeout);
+ rv = ftp_poll(pfd, 1, timeout);
} while (rv == -1 && errno == EINTR); /* loop until poll ! EINTR */
if (rv == -1) {
- warn("poll waiting before accept");
+ warn("Can't poll waiting before accept");
goto dataconn_failed;
}
if (rv == 0) {
- warn("poll timeout waiting before accept");
+ warnx("Poll timeout waiting before accept");
goto dataconn_failed;
}
@@ -1737,7 +1696,7 @@ dataconn(const char *lmode)
s = accept(data, (struct sockaddr *) &from.si_su, &fromlen);
} while (s == -1 && errno == EINTR); /* loop until accept ! EINTR */
if (s == -1) {
- warn("accept");
+ warn("Can't accept data connection");
goto dataconn_failed;
}
@@ -1751,9 +1710,7 @@ dataconn(const char *lmode)
int tos = IPTOS_THROUGHPUT;
if (setsockopt(s, IPPROTO_IP, IP_TOS,
(void *)&tos, sizeof(tos)) == -1) {
- if (debug)
- warn("setsockopt %s (ignored)",
- "IPTOS_THROUGHPUT");
+ DWARN("setsockopt %s (ignored)", "IPTOS_THROUGHPUT");
}
}
#endif
@@ -1880,15 +1837,10 @@ abortpt(int notused)
void
proxtrans(const char *cmd, const char *local, const char *remote)
{
- sigfunc oldintr;
+ sigfunc volatile oldintr;
int prox_type, nfnd;
- volatile int secndflag;
- char *cmd2;
-
-#ifdef __GNUC__ /* to shut up gcc warnings */
- (void)&oldintr;
- (void)&cmd2;
-#endif
+ int volatile secndflag;
+ const char *volatile cmd2;
oldintr = NULL;
secndflag = 0;
@@ -1992,7 +1944,7 @@ proxtrans(const char *cmd, const char *local, const char *remote)
if (cpend) {
if ((nfnd = empty(cin, NULL, 10)) <= 0) {
if (nfnd < 0)
- warn("abort");
+ warn("Error aborting proxy command");
if (ptabflg)
code = -1;
lostpeer(0);
@@ -2014,13 +1966,13 @@ reset(int argc, char *argv[])
int nfnd = 1;
if (argc == 0 && argv != NULL) {
- fprintf(ttyout, "usage: %s\n", argv[0]);
+ UPRINTF("usage: %s\n", argv[0]);
code = -1;
return;
}
while (nfnd > 0) {
if ((nfnd = empty(cin, NULL, 0)) < 0) {
- warn("reset");
+ warn("Error resetting connection");
code = -1;
lostpeer(0);
} else if (nfnd)
@@ -2042,7 +1994,7 @@ gunique(const char *local)
if (cp)
*cp = '/';
if (d < 0) {
- warn("local: %s", local);
+ warn("Can't access `%s'", local);
return (NULL);
}
len = strlcpy(new, local, sizeof(new));
@@ -2102,7 +2054,7 @@ abort_remote(FILE *din)
int nfnd;
if (cout == NULL) {
- warnx("Lost control connection for abort.");
+ warnx("Lost control connection for abort");
if (ptabflg)
code = -1;
lostpeer(0);
@@ -2116,12 +2068,12 @@ abort_remote(FILE *din)
buf[1] = IP;
buf[2] = IAC;
if (send(fileno(cout), buf, 3, MSG_OOB) != 3)
- warn("abort");
+ warn("Can't send abort message");
fprintf(cout, "%cABOR\r\n", DM);
(void)fflush(cout);
if ((nfnd = empty(cin, din, 10)) <= 0) {
if (nfnd < 0)
- warn("abort");
+ warn("Can't send abort message");
if (ptabflg)
code = -1;
lostpeer(0);
@@ -2137,6 +2089,24 @@ abort_remote(FILE *din)
(void)getreply(0);
}
+/*
+ * Ensure that ai->ai_addr is NOT an IPv4 mapped address.
+ * IPv4 mapped address complicates too many things in FTP
+ * protocol handling, as FTP protocol is defined differently
+ * between IPv4 and IPv6.
+ *
+ * This may not be the best way to handle this situation,
+ * since the semantics of IPv4 mapped address is defined in
+ * the kernel. There are configurations where we should use
+ * IPv4 mapped address as native IPv6 address, not as
+ * "an IPv6 address that embeds IPv4 address" (namely, SIIT).
+ *
+ * More complete solution would be to have an additional
+ * getsockopt to grab "real" peername/sockname. "real"
+ * peername/sockname will be AF_INET if IPv4 mapped address
+ * is used to embed IPv4 address, and will be AF_INET6 if
+ * we use it as native. What a mess!
+ */
void
ai_unmapped(struct addrinfo *ai)
{
@@ -2162,10 +2132,18 @@ ai_unmapped(struct addrinfo *ai)
sin.sin_port = sin6->sin6_port;
ai->ai_family = AF_INET;
-#if HAVE_SOCKADDR_SA_LEN
+#if defined(HAVE_STRUCT_SOCKADDR_IN_SIN_LEN)
sin.sin_len = len;
#endif
memcpy(ai->ai_addr, &sin, len);
ai->ai_addrlen = len;
#endif
}
+
+#ifdef NO_USAGE
+void
+xusage(void)
+{
+ fputs("Usage error\n", ttyout);
+}
+#endif
diff --git a/contrib/lukemftp/src/ftp_var.h b/contrib/tnftp/src/ftp_var.h
index 25f13d4..cd6dcbf 100644
--- a/contrib/lukemftp/src/ftp_var.h
+++ b/contrib/tnftp/src/ftp_var.h
@@ -1,7 +1,8 @@
-/* $NetBSD: ftp_var.h,v 1.71 2005/04/11 01:49:31 lukem Exp $ */
+/* $NetBSD: ftp_var.h,v 1.10 2009/05/20 12:53:47 lukem Exp $ */
+/* from NetBSD: ftp_var.h,v 1.81 2009/04/12 10:18:52 lukem Exp */
/*-
- * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -15,13 +16,6 @@
* 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
@@ -107,6 +101,8 @@
#define NO_PROGRESS
#endif
+#if 0 /* tnftp */
+
#include <sys/param.h>
#include <netinet/in.h>
@@ -117,6 +113,8 @@
#include <setjmp.h>
#include <stringlist.h>
+#endif /* tnftp */
+
#ifndef NO_EDITCOMPLETE
#include <histedit.h>
#endif /* !NO_EDITCOMPLETE */
@@ -128,7 +126,7 @@
* Format of command table.
*/
struct cmd {
- char *c_name; /* name of command */
+ const char *c_name; /* name of command */
const char *c_help; /* help string */
char c_bell; /* give bell when command completes */
char c_conn; /* must be connected to use command */
@@ -139,6 +137,8 @@ struct cmd {
void (*c_handler)(int, char **); /* function to call */
};
+#define MAX_C_NAME 12 /* maximum length of cmd.c_name */
+
/*
* Format of macro table
*/
@@ -152,8 +152,8 @@ struct macel {
* Format of option table
*/
struct option {
- char *name;
- char *value;
+ const char *name;
+ char *value;
};
/*
@@ -210,14 +210,14 @@ GLOBAL int sendport; /* use PORT/LPRT cmd for each data connection */
GLOBAL int connected; /* 1 = connected to server, -1 = logged in */
GLOBAL int interactive; /* interactively prompt on m* cmds */
GLOBAL int confirmrest; /* confirm rest of current m* cmd */
-GLOBAL int debug; /* debugging level */
+GLOBAL int ftp_debug; /* debugging level */
GLOBAL int bell; /* ring bell on cmd completion */
GLOBAL int doglob; /* glob local file names */
GLOBAL int autologin; /* establish user account on connection */
GLOBAL int proxy; /* proxy server connection active */
GLOBAL int proxflag; /* proxy connection exists */
GLOBAL int gatemode; /* use gate-ftp */
-GLOBAL char *gateserver; /* server to use for gate-ftp */
+GLOBAL const char *gateserver; /* server to use for gate-ftp */
GLOBAL int sunique; /* store files on server with unique name */
GLOBAL int runique; /* store local files with unique name */
GLOBAL int mcase; /* map upper to lower case for mget names */
@@ -252,9 +252,11 @@ GLOBAL int rate_get_incr; /* increment for get xfer rate */
GLOBAL int rate_put; /* maximum put xfer rate */
GLOBAL int rate_put_incr; /* increment for put xfer rate */
GLOBAL int retry_connect; /* seconds between retrying connection */
-GLOBAL char *tmpdir; /* temporary directory */
+GLOBAL const char *tmpdir; /* temporary directory */
GLOBAL int epsv4; /* use EPSV/EPRT on IPv4 connections */
GLOBAL int epsv4bad; /* EPSV doesn't work on the current server */
+GLOBAL int epsv6; /* use EPSV/EPRT on IPv6 connections */
+GLOBAL int epsv6bad; /* EPSV doesn't work on the current server */
GLOBAL int editing; /* command line editing enabled */
GLOBAL int features[FEAT_max]; /* remote FEATures supported */
@@ -266,8 +268,6 @@ GLOBAL size_t cursor_argc; /* location of cursor in margv */
GLOBAL size_t cursor_argo; /* offset of cursor in margv[cursor_argc] */
#endif /* !NO_EDITCOMPLETE */
-GLOBAL char *direction; /* direction transfer is occurring */
-
GLOBAL char *hostname; /* name of host connected to */
GLOBAL int unix_server; /* server is unix, can use binary for ascii */
GLOBAL int unix_proxy; /* proxy is unix, can use binary for ascii */
@@ -276,9 +276,10 @@ GLOBAL char remotecwd[MAXPATHLEN]; /* remote dir */
GLOBAL char *username; /* name of user logged in as. (dynamic) */
GLOBAL sa_family_t family; /* address family to use for connections */
-GLOBAL char *ftpport; /* port number to use for FTP connections */
-GLOBAL char *httpport; /* port number to use for HTTP connections */
-GLOBAL char *gateport; /* port number to use for gateftp connections */
+GLOBAL const char *ftpport; /* port number to use for FTP connections */
+GLOBAL const char *httpport; /* port number to use for HTTP connections */
+GLOBAL const char *gateport; /* port number to use for gateftp connections */
+GLOBAL struct addrinfo *bindai; /* local address to bind as */
GLOBAL char *outfile; /* filename to output URLs to */
GLOBAL int restartautofetch; /* restart auto-fetch */
@@ -327,7 +328,7 @@ extern struct option optiontab[];
#define FREEPTR(x) if ((x) != NULL) { free(x); (x) = NULL; }
#ifdef BSD4_4
-# define HAVE_SOCKADDR_SA_LEN 1
+# define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
#endif
#ifdef NO_LONG_LONG
@@ -335,3 +336,20 @@ extern struct option optiontab[];
#else
# define STRTOLL(x,y,z) strtoll(x,y,z)
#endif
+
+#ifdef NO_DEBUG
+#define DPRINTF(...)
+#define DWARN(...)
+#else
+#define DPRINTF(...) if (ftp_debug) (void)fprintf(ttyout, __VA_ARGS__)
+#define DWARN(...) if (ftp_debug) warn(__VA_ARGS__)
+#endif
+
+#define STRorNULL(s) ((s) ? (s) : "<null>")
+
+#ifdef NO_USAGE
+void xusage(void);
+#define UPRINTF(...) xusage()
+#else
+#define UPRINTF(...) (void)fprintf(ttyout, __VA_ARGS__)
+#endif
diff --git a/contrib/lukemftp/src/main.c b/contrib/tnftp/src/main.c
index def05c5..c2d922b 100644
--- a/contrib/lukemftp/src/main.c
+++ b/contrib/tnftp/src/main.c
@@ -1,7 +1,8 @@
-/* $NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $ */
+/* $NetBSD: main.c,v 1.17 2009/11/15 10:12:37 lukem Exp $ */
+/* from NetBSD: main.c,v 1.117 2009/07/13 19:05:41 roy Exp */
/*-
- * Copyright (c) 1996-2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -15,13 +16,6 @@
* 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
@@ -94,17 +88,22 @@
* SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
- The Regents of the University of California. All rights reserved.\n");
+__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\
+ The Regents of the University of California. All rights reserved.\
+ Copyright 1996-2008 The NetBSD Foundation, Inc. All rights reserved");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $");
+__RCSID(" NetBSD: main.c,v 1.117 2009/07/13 19:05:41 roy Exp ");
#endif
#endif /* not lint */
@@ -123,9 +122,12 @@ __RCSID("$NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#include <locale.h>
+#endif /* tnftp */
+
#define GLOBAL /* force GLOBAL decls in ftp_var.h to be declared */
#include "ftp_var.h"
@@ -134,19 +136,24 @@ __RCSID("$NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $");
#define NO_PROXY "no_proxy" /* env var with list of non-proxied
* hosts, comma or space separated */
-static void setupoption(char *, char *, char *);
+static void setupoption(const char *, const char *, const char *);
int main(int, char *[]);
int
-main(int argc, char *argv[])
+main(int volatile argc, char **volatile argv)
{
int ch, rval;
struct passwd *pw;
- char *cp, *ep, *anonuser, *anonpass, *upload_path;
- int dumbterm, s, len, isupload;
+ char *cp, *ep, *anonpass, *upload_path, *src_addr;
+ const char *anonuser;
+ int dumbterm, s, isupload;
+ size_t len;
socklen_t slen;
+ tzset();
+#if 0 /* tnftp */ /* XXX */
setlocale(LC_ALL, "");
+#endif /* tnftp */
setprogname(argv[0]);
sigint_raised = 0;
@@ -184,14 +191,22 @@ main(int argc, char *argv[])
rate_put_incr = DEFAULTINCR;
#ifdef INET6
epsv4 = 1;
+ epsv6 = 1;
#else
epsv4 = 0;
+ epsv6 = 0;
#endif
epsv4bad = 0;
+ epsv6bad = 0;
+ src_addr = NULL;
upload_path = NULL;
isupload = 0;
reply_callback = NULL;
+#ifdef INET6
family = AF_UNSPEC;
+#else
+ family = AF_INET; /* force AF_INET if no INET6 support */
+#endif
netrc[0] = '\0';
cp = getenv("NETRC");
@@ -206,15 +221,15 @@ main(int argc, char *argv[])
*/
s = socket(AF_INET, SOCK_STREAM, 0);
if (s == -1)
- err(1, "can't create socket");
+ err(1, "Can't create socket to determine default socket sizes");
slen = sizeof(rcvbuf_size);
if (getsockopt(s, SOL_SOCKET, SO_RCVBUF,
(void *)&rcvbuf_size, &slen) == -1)
- err(1, "unable to get default rcvbuf size");
+ err(1, "Unable to get default rcvbuf size");
slen = sizeof(sndbuf_size);
if (getsockopt(s, SOL_SOCKET, SO_SNDBUF,
(void *)&sndbuf_size, &slen) == -1)
- err(1, "unable to get default sndbuf size");
+ err(1, "Unable to get default sndbuf size");
(void)close(s);
/* sanity check returned buffer sizes */
if (rcvbuf_size <= 0)
@@ -227,7 +242,7 @@ main(int argc, char *argv[])
if (rcvbuf_size > 8 * 1024 * 1024)
rcvbuf_size = 8 * 1024 * 1024;
- marg_sl = xsl_init();
+ marg_sl = ftp_sl_init();
if ((tmpdir = getenv("TMPDIR")) == NULL)
tmpdir = _PATH_TMP;
@@ -245,7 +260,7 @@ main(int argc, char *argv[])
passivemode = 1;
activefallback = 1;
} else
- warnx("unknown $FTPMODE '%s'; using defaults", cp);
+ warnx("Unknown $FTPMODE `%s'; using defaults", cp);
}
if (strcmp(getprogname(), "pftp") == 0) {
@@ -286,7 +301,7 @@ main(int argc, char *argv[])
}
}
- while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:RtT:u:vV")) != -1) {
+ while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:Rs:tT:u:vV")) != -1) {
switch (ch) {
case '4':
family = AF_INET;
@@ -311,7 +326,7 @@ main(int argc, char *argv[])
case 'd':
options |= SO_DEBUG;
- debug++;
+ ftp_debug++;
break;
case 'e':
@@ -361,19 +376,23 @@ main(int argc, char *argv[])
case 'q':
quit_time = strtol(optarg, &ep, 10);
if (quit_time < 1 || *ep != '\0')
- errx(1, "bad quit value: %s", optarg);
+ errx(1, "Bad quit value: %s", optarg);
break;
case 'r':
retry_connect = strtol(optarg, &ep, 10);
if (retry_connect < 1 || *ep != '\0')
- errx(1, "bad retry value: %s", optarg);
+ errx(1, "Bad retry value: %s", optarg);
break;
case 'R':
restartautofetch = 1;
break;
+ case 's':
+ src_addr = optarg;
+ break;
+
case 't':
trace = 1;
break;
@@ -382,15 +401,18 @@ main(int argc, char *argv[])
{
int targc;
char *targv[6], *oac;
+ char cmdbuf[MAX_C_NAME];
/* look for `dir,max[,incr]' */
targc = 0;
- targv[targc++] = "-T";
- oac = xstrdup(optarg);
+ (void)strlcpy(cmdbuf, "-T", sizeof(cmdbuf));
+ targv[targc++] = cmdbuf;
+ oac = ftp_strdup(optarg);
while ((cp = strsep(&oac, ",")) != NULL) {
if (*cp == '\0') {
- warnx("bad throttle value: %s", optarg);
+ warnx("Bad throttle value `%s'",
+ optarg);
usage();
/* NOTREACHED */
}
@@ -408,7 +430,7 @@ main(int argc, char *argv[])
{
isupload = 1;
interactive = 0;
- upload_path = xstrdup(optarg);
+ upload_path = ftp_strdup(optarg);
break;
}
@@ -435,6 +457,22 @@ main(int argc, char *argv[])
crflag = 1; /* strip c.r. on ascii gets */
sendport = -1; /* not using ports */
+ if (src_addr != NULL) {
+ struct addrinfo hints;
+ int error;
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = family;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_PASSIVE;
+ error = getaddrinfo(src_addr, NULL, &hints, &bindai);
+ if (error) {
+ errx(1, "Can't lookup `%s': %s", src_addr,
+ (error == EAI_SYSTEM) ? strerror(errno)
+ : gai_strerror(error));
+ }
+ }
+
/*
* Cache the user name and home directory.
*/
@@ -443,7 +481,7 @@ main(int argc, char *argv[])
anonuser = "anonymous";
cp = getenv("HOME");
if (! EMPTYSTRING(cp))
- localhome = xstrdup(cp);
+ localhome = ftp_strdup(cp);
pw = NULL;
cp = getlogin();
if (cp != NULL)
@@ -452,8 +490,8 @@ main(int argc, char *argv[])
pw = getpwuid(getuid());
if (pw != NULL) {
if (localhome == NULL && !EMPTYSTRING(pw->pw_dir))
- localhome = xstrdup(pw->pw_dir);
- localname = xstrdup(pw->pw_name);
+ localhome = ftp_strdup(pw->pw_dir);
+ localname = ftp_strdup(pw->pw_name);
anonuser = localname;
}
if (netrc[0] == '\0' && localhome != NULL) {
@@ -465,7 +503,7 @@ main(int argc, char *argv[])
}
}
if (localhome == NULL)
- localhome = xstrdup("/");
+ localhome = ftp_strdup("/");
/*
* Every anonymous FTP server I've encountered will accept the
@@ -475,7 +513,7 @@ main(int argc, char *argv[])
* - thorpej@NetBSD.org
*/
len = strlen(anonuser) + 2;
- anonpass = xmalloc(len);
+ anonpass = ftp_malloc(len);
(void)strlcpy(anonpass, anonuser, len);
(void)strlcat(anonpass, "@", len);
@@ -502,11 +540,6 @@ main(int argc, char *argv[])
(void)xsignal(SIGUSR2, crankrate);
(void)xsignal(SIGWINCH, setttywidth);
-#ifdef __GNUC__ /* to shut up gcc warnings */
- (void)&argc;
- (void)&argv;
-#endif
-
if (argc > 0) {
if (isupload) {
rval = auto_put(argc, argv, upload_path);
@@ -522,22 +555,23 @@ main(int argc, char *argv[])
if (rval >= 0) /* -1 == connected and cd-ed */
goto sigint_or_rval_exit;
} else {
- char *xargv[4], *user, *host;
+ char *xargv[4], *uuser, *host;
+ char cmdbuf[MAXPATHLEN];
if ((rval = sigsetjmp(toplevel, 1)))
goto sigint_or_rval_exit;
(void)xsignal(SIGINT, intr);
(void)xsignal(SIGPIPE, lostpeer);
- user = NULL;
+ uuser = NULL;
host = argv[0];
cp = strchr(host, '@');
if (cp) {
*cp = '\0';
- user = host;
+ uuser = host;
host = cp + 1;
}
- /* XXX discards const */
- xargv[0] = (char *)getprogname();
+ (void)strlcpy(cmdbuf, getprogname(), sizeof(cmdbuf));
+ xargv[0] = cmdbuf;
xargv[1] = host;
xargv[2] = argv[1];
xargv[3] = NULL;
@@ -545,14 +579,14 @@ main(int argc, char *argv[])
int oautologin;
oautologin = autologin;
- if (user != NULL) {
+ if (uuser != NULL) {
anonftp = 0;
autologin = 0;
}
setpeer(argc+1, xargv);
autologin = oautologin;
- if (connected == 1 && user != NULL)
- (void)ftp_login(host, user, NULL);
+ if (connected == 1 && uuser != NULL)
+ (void)ftp_login(host, uuser, NULL);
if (!retry_connect)
break;
if (!connected) {
@@ -586,18 +620,18 @@ main(int argc, char *argv[])
char *
prompt(void)
{
- static char **prompt;
+ static char **promptopt;
static char buf[MAXPATHLEN];
- if (prompt == NULL) {
+ if (promptopt == NULL) {
struct option *o;
o = getoption("prompt");
if (o == NULL)
- errx(1, "no such option `prompt'");
- prompt = &(o->value);
+ errx(1, "prompt: no such option `prompt'");
+ promptopt = &(o->value);
}
- formatbuf(buf, sizeof(buf), *prompt ? *prompt : DEFAULTPROMPT);
+ formatbuf(buf, sizeof(buf), *promptopt ? *promptopt : DEFAULTPROMPT);
return (buf);
}
@@ -607,18 +641,18 @@ prompt(void)
char *
rprompt(void)
{
- static char **rprompt;
+ static char **rpromptopt;
static char buf[MAXPATHLEN];
- if (rprompt == NULL) {
+ if (rpromptopt == NULL) {
struct option *o;
o = getoption("rprompt");
if (o == NULL)
- errx(1, "no such option `rprompt'");
- rprompt = &(o->value);
+ errx(1, "rprompt: no such option `rprompt'");
+ rpromptopt = &(o->value);
}
- formatbuf(buf, sizeof(buf), *rprompt ? *rprompt : DEFAULTRPROMPT);
+ formatbuf(buf, sizeof(buf), *rpromptopt ? *rpromptopt : DEFAULTRPROMPT);
return (buf);
}
@@ -630,7 +664,12 @@ cmdscanner(void)
{
struct cmd *c;
char *p;
- int num;
+#ifndef NO_EDITCOMPLETE
+ int ch;
+ size_t num;
+#endif
+ int len;
+ char cmdbuf[MAX_C_NAME];
for (;;) {
#ifndef NO_EDITCOMPLETE
@@ -641,34 +680,33 @@ cmdscanner(void)
p = rprompt();
if (*p)
fprintf(ttyout, "%s ", p);
- (void)fflush(ttyout);
}
- if (fgets(line, sizeof(line), stdin) == NULL) {
+ (void)fflush(ttyout);
+ len = get_line(stdin, line, sizeof(line), NULL);
+ switch (len) {
+ case -1: /* EOF */
+ case -2: /* error */
if (fromatty)
putc('\n', ttyout);
quit(0, NULL);
- }
- num = strlen(line);
- if (num == 0)
- break;
- if (line[--num] == '\n') {
- if (num == 0)
- break;
- line[num] = '\0';
- } else if (num == sizeof(line) - 2) {
+ /* NOTREACHED */
+ case -3: /* too long; try again */
fputs("Sorry, input line is too long.\n",
ttyout);
- while ((num = getchar()) != '\n' && num != EOF)
- /* void */;
+ continue;
+ case 0: /* empty; try again */
+ continue;
+ default: /* all ok */
break;
- } /* else it was a line without a newline */
+ }
#ifndef NO_EDITCOMPLETE
} else {
const char *buf;
HistEvent ev;
cursor_pos = NULL;
- buf = el_gets(el, &num);
+ buf = el_gets(el, &ch);
+ num = ch;
if (buf == NULL || num == 0) {
if (fromatty)
putc('\n', ttyout);
@@ -718,7 +756,8 @@ cmdscanner(void)
continue;
}
confirmrest = 0;
- margv[0] = c->c_name;
+ (void)strlcpy(cmdbuf, c->c_name, sizeof(cmdbuf));
+ margv[0] = cmdbuf;
(*c->c_handler)(margc, margv);
if (bell && c->c_bell)
(void)putc('\007', ttyout);
@@ -777,7 +816,7 @@ makeargv(void)
marg_sl->sl_cur = 0; /* reset to start of marg_sl */
for (margc = 0; ; margc++) {
argp = slurpstring();
- xsl_add(marg_sl, argp);
+ ftp_sl_add(marg_sl, argp);
if (argp == NULL)
break;
}
@@ -812,6 +851,8 @@ makeargv(void)
char *
slurpstring(void)
{
+ static char bangstr[2] = { '!', '\0' };
+ static char dollarstr[2] = { '$', '\0' };
int got_one = 0;
char *sb = stringbase;
char *ap = argbase;
@@ -822,7 +863,7 @@ slurpstring(void)
case 0:
slrflag++;
INC_CHKCURSOR(stringbase);
- return ((*sb == '!') ? "!" : "$");
+ return ((*sb == '!') ? bangstr : dollarstr);
/* NOTREACHED */
case 1:
slrflag++;
@@ -945,27 +986,28 @@ void
help(int argc, char *argv[])
{
struct cmd *c;
- char *nargv[1], *p, *cmd;
+ char *nargv[1], *cmd;
+ const char *p;
int isusage;
cmd = argv[0];
isusage = (strcmp(cmd, "usage") == 0);
if (argc == 0 || (isusage && argc == 1)) {
- fprintf(ttyout, "usage: %s [command [...]]\n", cmd);
+ UPRINTF("usage: %s [command [...]]\n", cmd);
return;
}
if (argc == 1) {
StringList *buf;
- buf = xsl_init();
+ buf = ftp_sl_init();
fprintf(ttyout,
"%sommands may be abbreviated. Commands are:\n\n",
proxy ? "Proxy c" : "C");
for (c = cmdtab; (p = c->c_name) != NULL; c++)
if (!proxy || c->c_proxy)
- xsl_add(buf, p);
+ ftp_sl_add(buf, ftp_strdup(p));
list_vertical(buf);
- sl_free(buf, 0);
+ sl_free(buf, 1);
return;
}
@@ -973,6 +1015,7 @@ help(int argc, char *argv[])
while (--argc > 0) {
char *arg;
+ char cmdbuf[MAX_C_NAME];
arg = *++argv;
c = getcmd(arg);
@@ -984,7 +1027,8 @@ help(int argc, char *argv[])
cmd, arg);
else {
if (isusage) {
- nargv[0] = c->c_name;
+ (void)strlcpy(cmdbuf, c->c_name, sizeof(cmdbuf));
+ nargv[0] = cmdbuf;
(*c->c_handler)(0, nargv);
} else
fprintf(ttyout, "%-*s\t%s\n", HELPINDENT,
@@ -1014,27 +1058,18 @@ getoptionvalue(const char *name)
struct option *c;
if (name == NULL)
- errx(1, "getoptionvalue() invoked with NULL name");
+ errx(1, "getoptionvalue: invoked with NULL name");
c = getoption(name);
if (c != NULL)
return (c->value);
- errx(1, "getoptionvalue() invoked with unknown option `%s'", name);
+ errx(1, "getoptionvalue: invoked with unknown option `%s'", name);
/* NOTREACHED */
}
static void
-setupoption(char *name, char *value, char *defaultvalue)
+setupoption(const char *name, const char *value, const char *defaultvalue)
{
- char *nargv[3];
- int overbose;
-
- nargv[0] = "setupoption()";
- nargv[1] = name;
- nargv[2] = (value ? value : defaultvalue);
- overbose = verbose;
- verbose = 0;
- setoption(3, nargv);
- verbose = overbose;
+ set_option(name, value ? value : defaultvalue, 0);
}
void
@@ -1043,9 +1078,10 @@ usage(void)
const char *progname = getprogname();
(void)fprintf(stderr,
-"usage: %s [-46AadefginpRtvV] [-N netrc] [-o outfile] [-P port] [-q quittime]\n"
-" [-r retry] [-T dir,max[,inc][[user@]host [port]]] [host:path[/]]\n"
-" [file:///file] [ftp://[user[:pass]@]host[:port]/path[/]]\n"
+"usage: %s [-46AadefginpRtVv] [-N netrc] [-o outfile] [-P port] [-q quittime]\n"
+" [-r retry] [-s srcaddr] [-T dir,max[,inc]]\n"
+" [[user@]host [port]] [host:path[/]] [file:///file]\n"
+" [ftp://[user[:pass]@]host[:port]/path[/]]\n"
" [http://[user[:pass]@]host[:port]/path] [...]\n"
" %s -u URL file [...]\n", progname, progname);
exit(1);
diff --git a/contrib/lukemftp/src/progressbar.c b/contrib/tnftp/src/progressbar.c
index d0bd35f..bd4d76d 100644
--- a/contrib/lukemftp/src/progressbar.c
+++ b/contrib/tnftp/src/progressbar.c
@@ -1,7 +1,8 @@
-/* $NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $ */
+/* $NetBSD: progressbar.c,v 1.14 2009/05/20 12:53:47 lukem Exp $ */
+/* from NetBSD: progressbar.c,v 1.21 2009/04/12 10:18:52 lukem Exp */
/*-
- * Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -15,13 +16,6 @@
* 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
@@ -36,9 +30,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $");
+__RCSID(" NetBSD: progressbar.c,v 1.21 2009/04/12 10:18:52 lukem Exp ");
#endif /* not lint */
/*
@@ -46,7 +44,6 @@ __RCSID("$NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $");
*/
#include <sys/types.h>
#include <sys/param.h>
-#include <sys/time.h>
#include <err.h>
#include <errno.h>
@@ -55,12 +52,12 @@ __RCSID("$NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $");
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <tzfile.h>
#include <unistd.h>
-#include "progressbar.h"
+#endif /* tnftp */
-#define SECSPERHOUR (60 * 60)
-#define SECSPERDAY ((long)60 * 60 * 24)
+#include "progressbar.h"
#if !defined(NO_PROGRESS)
/*
@@ -72,7 +69,11 @@ foregroundproc(void)
static pid_t pgrp = -1;
if (pgrp == -1)
+#if GETPGRP_VOID
pgrp = getpgrp();
+#else /* ! GETPGRP_VOID */
+ pgrp = getpgrp(0);
+#endif /* ! GETPGRP_VOID */
return (tcgetpgrp(fileno(ttyout)) == pgrp);
}
@@ -94,10 +95,23 @@ updateprogressmeter(int dummy)
}
/*
- * List of order of magnitude prefixes.
- * The last is `P', as 2^64 = 16384 Petabytes
+ * List of order of magnitude suffixes, per IEC 60027-2.
*/
-static const char prefixes[] = " KMGTP";
+static const char * const suffixes[] = {
+ "", /* 2^0 (byte) */
+ "KiB", /* 2^10 Kibibyte */
+ "MiB", /* 2^20 Mebibyte */
+ "GiB", /* 2^30 Gibibyte */
+ "TiB", /* 2^40 Tebibyte */
+ "PiB", /* 2^50 Pebibyte */
+ "EiB", /* 2^60 Exbibyte */
+#if 0
+ /* The following are not necessary for signed 64-bit off_t */
+ "ZiB", /* 2^70 Zebibyte */
+ "YiB", /* 2^80 Yobibyte */
+#endif
+};
+#define NSUFFIXES (int)(sizeof(suffixes) / sizeof(suffixes[0]))
/*
* Display a transfer progress bar if progress is non-zero.
@@ -124,7 +138,7 @@ progressmeter(int flag)
struct timeval td;
off_t abbrevsize, bytespersec;
double elapsed;
- int ratio, barlength, i, remaining;
+ int ratio, i, remaining, barlength;
/*
* Work variables for progress bar.
@@ -135,10 +149,10 @@ progressmeter(int flag)
* these appropriately.
*/
#endif
- int len;
+ size_t len;
char buf[256]; /* workspace for progress bar */
#ifndef NO_PROGRESS
-#define BAROVERHEAD 43 /* non `*' portion of progress bar */
+#define BAROVERHEAD 45 /* non `*' portion of progress bar */
/*
* stars should contain at least
* sizeof(buf) - BAROVERHEAD entries
@@ -170,8 +184,8 @@ progressmeter(int flag)
"transfer aborted because stalled for %lu sec.\r\n",
getprogname(), (unsigned long)wait.tv_sec);
(void)write(fileno(ttyout), buf, len);
- (void)xsignal(SIGALRM, SIG_DFL);
alarmtimer(0);
+ (void)xsignal(SIGALRM, SIG_DFL);
siglongjmp(toplevel, 1);
}
#endif /* !STANDALONE_PROGRESS */
@@ -188,8 +202,8 @@ progressmeter(int flag)
(void)xsignal_restart(SIGALRM, updateprogressmeter, 1);
alarmtimer(1); /* set alarm timer for 1 Hz */
} else if (flag == 1) {
- (void)xsignal(SIGALRM, SIG_DFL);
alarmtimer(0);
+ (void)xsignal(SIGALRM, SIG_DFL);
}
}
#ifndef NO_PROGRESS
@@ -216,23 +230,24 @@ progressmeter(int flag)
* calculate the length of the `*' bar, ensuring that
* the number of stars won't exceed the buffer size
*/
- barlength = MIN(sizeof(buf) - 1, ttywidth) - BAROVERHEAD;
+ barlength = MIN((int)(sizeof(buf) - 1), ttywidth) - BAROVERHEAD;
if (prefix)
- barlength -= strlen(prefix);
+ barlength -= (int)strlen(prefix);
if (barlength > 0) {
i = barlength * ratio / 100;
len += snprintf(buf + len, BUFLEFT,
- "|%.*s%*s|", i, stars, barlength - i, "");
+ "|%.*s%*s|", i, stars, (int)(barlength - i), "");
}
}
abbrevsize = cursize;
- for (i = 0; abbrevsize >= 100000 && i < sizeof(prefixes); i++)
+ for (i = 0; abbrevsize >= 100000 && i < NSUFFIXES; i++)
abbrevsize >>= 10;
- len += snprintf(buf + len, BUFLEFT, " " LLFP("5") " %c%c ",
+ if (i == NSUFFIXES)
+ i--;
+ len += snprintf(buf + len, BUFLEFT, " " LLFP("5") " %-3s ",
(LLT)abbrevsize,
- prefixes[i],
- i == 0 ? ' ' : 'B');
+ suffixes[i]);
timersub(&now, &start, &td);
elapsed = td.tv_sec + (td.tv_usec / 1000000.0);
@@ -243,13 +258,13 @@ progressmeter(int flag)
if (elapsed > 0.0)
bytespersec /= elapsed;
}
- for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++)
+ for (i = 1; bytespersec >= 1024000 && i < NSUFFIXES; i++)
bytespersec >>= 10;
len += snprintf(buf + len, BUFLEFT,
- " " LLFP("3") ".%02d %cB/s ",
+ " " LLFP("3") ".%02d %.2sB/s ",
(LLT)(bytespersec / 1024),
(int)((bytespersec % 1024) * 100 / 1024),
- prefixes[i]);
+ suffixes[i]);
if (filesize > 0) {
if (bytes <= 0 || elapsed <= 0.0 || cursize > filesize) {
@@ -299,7 +314,8 @@ ptransfer(int siginfo)
struct timeval now, td, wait;
double elapsed;
off_t bytespersec;
- int remaining, hh, i, len;
+ int remaining, hh, i;
+ size_t len;
char buf[256]; /* Work variable for transfer status. */
@@ -334,12 +350,14 @@ ptransfer(int siginfo)
len += snprintf(buf + len, BUFLEFT,
"%02d:%02d ", remaining / 60, remaining % 60);
- for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++)
+ for (i = 1; bytespersec >= 1024000 && i < NSUFFIXES; i++)
bytespersec >>= 10;
- len += snprintf(buf + len, BUFLEFT, "(" LLF ".%02d %cB/s)",
+ if (i == NSUFFIXES)
+ i--;
+ len += snprintf(buf + len, BUFLEFT, "(" LLF ".%02d %.2sB/s)",
(LLT)(bytespersec / 1024),
(int)((bytespersec % 1024) * 100 / 1024),
- prefixes[i]);
+ suffixes[i]);
if (siginfo && bytes > 0 && elapsed > 0.0 && filesize >= 0
&& bytes + restart_point <= filesize) {
@@ -400,6 +418,16 @@ alarmtimer(int wait)
sigfunc
xsignal_restart(int sig, sigfunc func, int restartable)
{
+#ifdef ultrix /* XXX: this is lame - how do we test sigvec vs. sigaction? */
+ struct sigvec vec, ovec;
+
+ vec.sv_handler = func;
+ sigemptyset(&vec.sv_mask);
+ vec.sv_flags = 0;
+ if (sigvec(sig, &vec, &ovec) < 0)
+ return (SIG_ERR);
+ return (ovec.sv_handler);
+#else /* ! ultrix */
struct sigaction act, oact;
act.sa_handler = func;
@@ -414,6 +442,7 @@ xsignal_restart(int sig, sigfunc func, int restartable)
if (sigaction(sig, &act, &oact) < 0)
return (SIG_ERR);
return (oact.sa_handler);
+#endif /* ! ultrix */
}
/*
@@ -457,7 +486,7 @@ xsignal(int sig, sigfunc func)
* This is unpleasant, but I don't know what would be better.
* Right now, this "can't happen"
*/
- errx(1, "xsignal_restart called with signal %d", sig);
+ errx(1, "xsignal_restart: called with signal %d", sig);
}
return(xsignal_restart(sig, func, restartable));
diff --git a/contrib/lukemftp/src/progressbar.h b/contrib/tnftp/src/progressbar.h
index 9e004f4..70e2df3 100644
--- a/contrib/lukemftp/src/progressbar.h
+++ b/contrib/tnftp/src/progressbar.h
@@ -1,7 +1,8 @@
-/* $NetBSD: progressbar.h,v 1.5 2005/02/10 16:00:38 jmc Exp $ */
+/* $NetBSD: progressbar.h,v 1.9 2009/05/20 12:53:47 lukem Exp $ */
+/* from NetBSD: progressbar.h,v 1.8 2009/04/12 10:18:52 lukem Exp */
/*-
- * Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -15,13 +16,6 @@
* 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
@@ -66,7 +60,7 @@ GLOBAL int fromatty; /* input is from a terminal */
GLOBAL int verbose; /* print messages coming back from server */
GLOBAL int quit_time; /* maximum time to wait if stalled */
-GLOBAL char *direction; /* direction transfer is occurring */
+GLOBAL const char *direction; /* direction transfer is occurring */
GLOBAL sigjmp_buf toplevel; /* non-local goto stuff for cmd scanner */
#endif /* !STANDALONE_PROGRESS */
@@ -90,10 +84,19 @@ void ptransfer(int);
# define ULLFP(x) "%" x "lu"
# define ULLT unsigned long
#else
+#if defined(HAVE_PRINTF_QD)
+# define LLF "%qd"
+# define LLFP(x) "%" x "qd"
+# define LLT long long
+# define ULLF "%qu"
+# define ULLFP(x) "%" x "qu"
+# define ULLT unsigned long long
+#else /* !defined(HAVE_PRINTF_QD) */
# define LLF "%lld"
# define LLFP(x) "%" x "lld"
# define LLT long long
# define ULLF "%llu"
# define ULLFP(x) "%" x "llu"
# define ULLT unsigned long long
+#endif /* !defined(HAVE_PRINTF_QD) */
#endif
diff --git a/contrib/lukemftp/src/ruserpass.c b/contrib/tnftp/src/ruserpass.c
index 9cb318a..a2e0360 100644
--- a/contrib/lukemftp/src/ruserpass.c
+++ b/contrib/tnftp/src/ruserpass.c
@@ -1,4 +1,5 @@
-/* $NetBSD: ruserpass.c,v 1.29 2003/08/07 11:13:57 agc Exp $ */
+/* $NetBSD: ruserpass.c,v 1.8 2007/08/06 04:33:24 lukem Exp $ */
+/* from NetBSD: ruserpass.c,v 1.33 2007/04/17 05:52:04 lukem Exp */
/*
* Copyright (c) 1985, 1993, 1994
@@ -29,12 +30,16 @@
* SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)ruserpass.c 8.4 (Berkeley) 4/27/95";
#else
-__RCSID("$NetBSD: ruserpass.c,v 1.29 2003/08/07 11:13:57 agc Exp $");
+__RCSID(" NetBSD: ruserpass.c,v 1.33 2007/04/17 05:52:04 lukem Exp ");
#endif
#endif /* not lint */
@@ -50,6 +55,8 @@ __RCSID("$NetBSD: ruserpass.c,v 1.29 2003/08/07 11:13:57 agc Exp $");
#include <string.h>
#include <unistd.h>
+#endif /* tnftp */
+
#include "ftp_var.h"
static int token(void);
@@ -66,7 +73,7 @@ static FILE *cfile;
static char tokval[100];
static struct toktab {
- char *tokstr;
+ const char *tokstr;
int tval;
} toktab[] = {
{ "default", DEFAULT },
@@ -80,11 +87,11 @@ static struct toktab {
};
int
-ruserpass(const char *host, const char **aname, const char **apass,
- const char **aacct)
+ruserpass(const char *host, char **aname, char **apass, char **aacct)
{
char *tmp;
- char myname[MAXHOSTNAMELEN + 1], *mydomain;
+ const char *mydomain;
+ char myname[MAXHOSTNAMELEN + 1];
int t, i, c, usedefault = 0;
struct stat stb;
@@ -93,7 +100,7 @@ ruserpass(const char *host, const char **aname, const char **apass,
cfile = fopen(netrc, "r");
if (cfile == NULL) {
if (errno != ENOENT)
- warn("%s", netrc);
+ warn("Can't read `%s'", netrc);
return (0);
}
if (gethostname(myname, sizeof(myname)) < 0)
@@ -102,7 +109,7 @@ ruserpass(const char *host, const char **aname, const char **apass,
if ((mydomain = strchr(myname, '.')) == NULL)
mydomain = "";
next:
- while ((t = token())) switch(t) {
+ while ((t = token()) > 0) switch(t) {
case DEFAULT:
usedefault = 1;
@@ -110,7 +117,9 @@ ruserpass(const char *host, const char **aname, const char **apass,
case MACH:
if (!usedefault) {
- if (token() != ID)
+ if ((t = token()) == -1)
+ goto bad;
+ if (t != ID)
continue;
/*
* Allow match either for user's input host name
@@ -134,12 +143,15 @@ ruserpass(const char *host, const char **aname, const char **apass,
continue;
}
match:
- while ((t = token()) && t != MACH && t != DEFAULT) switch(t) {
+ while ((t = token()) > 0 &&
+ t != MACH && t != DEFAULT) switch(t) {
case LOGIN:
- if (token()) {
+ if ((t = token()) == -1)
+ goto bad;
+ if (t) {
if (*aname == NULL)
- *aname = xstrdup(tokval);
+ *aname = ftp_strdup(tokval);
else {
if (strcmp(*aname, tokval))
goto next;
@@ -150,22 +162,26 @@ ruserpass(const char *host, const char **aname, const char **apass,
if ((*aname == NULL || strcmp(*aname, "anonymous")) &&
fstat(fileno(cfile), &stb) >= 0 &&
(stb.st_mode & 077) != 0) {
- warnx("Error: .netrc file is readable by others.");
- warnx("Remove password or make file unreadable by others.");
+ warnx("Error: .netrc file is readable by others");
+ warnx("Remove password or make file unreadable by others");
goto bad;
}
- if (token() && *apass == NULL)
- *apass = xstrdup(tokval);
+ if ((t = token()) == -1)
+ goto bad;
+ if (t && *apass == NULL)
+ *apass = ftp_strdup(tokval);
break;
case ACCOUNT:
if (fstat(fileno(cfile), &stb) >= 0
&& (stb.st_mode & 077) != 0) {
- warnx("Error: .netrc file is readable by others.");
- warnx("Remove account or make file unreadable by others.");
+ warnx("Error: .netrc file is readable by others");
+ warnx("Remove account or make file unreadable by others");
goto bad;
}
- if (token() && *aacct == NULL)
- *aacct = xstrdup(tokval);
+ if ((t = token()) == -1)
+ goto bad;
+ if (t && *aacct == NULL)
+ *aacct = ftp_strdup(tokval);
break;
case MACDEF:
if (proxy) {
@@ -225,9 +241,13 @@ ruserpass(const char *host, const char **aname, const char **apass,
}
*tmp = c;
if (*tmp == '\n') {
- if (*(tmp-1) == '\0') {
- macros[macnum++].mac_end = tmp - 1;
- break;
+ if (tmp == macros[macnum].mac_start) {
+ macros[macnum++].mac_end = tmp;
+ break;
+ } else if (*(tmp - 1) == '\0') {
+ macros[macnum++].mac_end =
+ tmp - 1;
+ break;
}
*tmp = '\0';
}
@@ -240,12 +260,14 @@ ruserpass(const char *host, const char **aname, const char **apass,
}
break;
default:
- warnx("Unknown .netrc keyword %s", tokval);
+ warnx("Unknown .netrc keyword `%s'", tokval);
break;
}
goto done;
}
done:
+ if (t == -1)
+ goto bad;
(void)fclose(cfile);
return (0);
bad:
@@ -271,16 +293,26 @@ token(void)
if (c == '"') {
while ((c = getc(cfile)) != EOF && c != '"') {
if (c == '\\')
- c = getc(cfile);
+ if ((c = getc(cfile)) == EOF)
+ break;
*cp++ = c;
+ if (cp == tokval + sizeof(tokval)) {
+ warnx("Token in .netrc too long");
+ return (-1);
+ }
}
} else {
*cp++ = c;
while ((c = getc(cfile)) != EOF
&& c != '\n' && c != '\t' && c != ' ' && c != ',') {
if (c == '\\')
- c = getc(cfile);
+ if ((c = getc(cfile)) == EOF)
+ break;
*cp++ = c;
+ if (cp == tokval + sizeof(tokval)) {
+ warnx("Token in .netrc too long");
+ return (-1);
+ }
}
}
*cp = 0;
diff --git a/contrib/lukemftp/src/util.c b/contrib/tnftp/src/util.c
index 6f94bb0..366b194 100644
--- a/contrib/lukemftp/src/util.c
+++ b/contrib/tnftp/src/util.c
@@ -1,7 +1,8 @@
-/* $NetBSD: util.c,v 1.123 2005/05/14 18:56:45 dsl Exp $ */
+/* $NetBSD: util.c,v 1.21 2009/11/15 10:12:37 lukem Exp $ */
+/* from NetBSD: util.c,v 1.152 2009/07/13 19:05:41 roy Exp */
/*-
- * Copyright (c) 1997-2005 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -19,13 +20,6 @@
* 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
@@ -69,9 +63,13 @@
* SUCH DAMAGE.
*/
+#include "tnftp.h"
+
+#if 0 /* tnftp */
+
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: util.c,v 1.123 2005/05/14 18:56:45 dsl Exp $");
+__RCSID(" NetBSD: util.c,v 1.152 2009/07/13 19:05:41 roy Exp ");
#endif /* not lint */
/*
@@ -90,6 +88,7 @@ __RCSID("$NetBSD: util.c,v 1.123 2005/05/14 18:56:45 dsl Exp $");
#include <fcntl.h>
#include <glob.h>
#include <signal.h>
+#include <libgen.h>
#include <limits.h>
#include <netdb.h>
#include <stdio.h>
@@ -97,11 +96,12 @@ __RCSID("$NetBSD: util.c,v 1.123 2005/05/14 18:56:45 dsl Exp $");
#include <string.h>
#include <termios.h>
#include <time.h>
+#include <tzfile.h>
#include <unistd.h>
-#include "ftp_var.h"
+#endif /* tnftp */
-#define TM_YEAR_BASE 1900
+#include "ftp_var.h"
/*
* Connect to peer server and auto-login, if possible.
@@ -110,7 +110,7 @@ void
setpeer(int argc, char *argv[])
{
char *host;
- char *port;
+ const char *port;
if (argc == 0)
goto usage;
@@ -124,7 +124,7 @@ setpeer(int argc, char *argv[])
(void)another(&argc, &argv, "to");
if (argc < 2 || argc > 3) {
usage:
- fprintf(ttyout, "usage: %s host-name [port]\n", argv[0]);
+ UPRINTF("usage: %s host-name [port]\n", argv[0]);
code = -1;
return;
}
@@ -137,7 +137,7 @@ setpeer(int argc, char *argv[])
if (gatemode) {
if (gateserver == NULL || *gateserver == '\0')
- errx(1, "gateserver not defined (shouldn't happen)");
+ errx(1, "main: gateserver not defined");
host = hookup(gateserver, port);
} else
host = hookup(argv[1], port);
@@ -170,25 +170,25 @@ setpeer(int argc, char *argv[])
}
static void
-parse_feat(const char *line)
+parse_feat(const char *fline)
{
/*
* work-around broken ProFTPd servers that can't
- * even obey RFC 2389.
+ * even obey RFC2389.
*/
- while (*line && isspace((int)*line))
- line++;
+ while (*fline && isspace((int)*fline))
+ fline++;
- if (strcasecmp(line, "MDTM") == 0)
+ if (strcasecmp(fline, "MDTM") == 0)
features[FEAT_MDTM] = 1;
- else if (strncasecmp(line, "MLST", sizeof("MLST") - 1) == 0) {
+ else if (strncasecmp(fline, "MLST", sizeof("MLST") - 1) == 0) {
features[FEAT_MLST] = 1;
- } else if (strcasecmp(line, "REST STREAM") == 0)
+ } else if (strcasecmp(fline, "REST STREAM") == 0)
features[FEAT_REST_STREAM] = 1;
- else if (strcasecmp(line, "SIZE") == 0)
+ else if (strcasecmp(fline, "SIZE") == 0)
features[FEAT_SIZE] = 1;
- else if (strcasecmp(line, "TVFS") == 0)
+ else if (strcasecmp(fline, "TVFS") == 0)
features[FEAT_TVFS] = 1;
}
@@ -202,7 +202,7 @@ getremoteinfo(void)
int overbose, i;
overbose = verbose;
- if (debug == 0)
+ if (ftp_debug == 0)
verbose = -1;
/* determine remote system type */
@@ -268,7 +268,8 @@ getremoteinfo(void)
features[FEAT_FEAT] = 1;
} else
features[FEAT_FEAT] = 0;
- if (debug) {
+#ifndef NO_DEBUG
+ if (ftp_debug) {
#define DEBUG_FEAT(x) fprintf(ttyout, "features[" #x "] = %d\n", features[(x)])
DEBUG_FEAT(FEAT_FEAT);
DEBUG_FEAT(FEAT_MDTM);
@@ -278,6 +279,7 @@ getremoteinfo(void)
DEBUG_FEAT(FEAT_TVFS);
#undef DEBUG_FEAT
}
+#endif
reply_callback = NULL;
verbose = overbose;
@@ -308,6 +310,7 @@ cleanuppeer(void)
anonftp = 0;
data = -1;
epsv4bad = 0;
+ epsv6bad = 0;
if (username)
free(username);
username = NULL;
@@ -373,99 +376,105 @@ lostpeer(int dummy)
* Return non-zero if successful.
*/
int
-ftp_login(const char *host, const char *user, const char *pass)
+ftp_login(const char *host, const char *luser, const char *lpass)
{
char tmp[80];
- const char *acct;
- int n, aflag, rval, freeuser, freepass, freeacct;
+ char *fuser, *pass, *facct, *p;
+ char emptypass[] = "";
+ const char *errormsg;
+ int n, aflag, rval, nlen;
- acct = NULL;
- aflag = rval = freeuser = freepass = freeacct = 0;
-
- if (debug)
- fprintf(ttyout, "ftp_login: user `%s' pass `%s' host `%s'\n",
- user ? user : "<null>", pass ? pass : "<null>",
- host ? host : "<null>");
+ aflag = rval = 0;
+ fuser = pass = facct = NULL;
+ if (luser)
+ fuser = ftp_strdup(luser);
+ if (lpass)
+ pass = ftp_strdup(lpass);
+ DPRINTF("ftp_login: user `%s' pass `%s' host `%s'\n",
+ STRorNULL(fuser), STRorNULL(pass), STRorNULL(host));
/*
* Set up arguments for an anonymous FTP session, if necessary.
*/
if (anonftp) {
- user = "anonymous"; /* as per RFC 1635 */
- pass = getoptionvalue("anonpass");
+ FREEPTR(fuser);
+ fuser = ftp_strdup("anonymous"); /* as per RFC1635 */
+ FREEPTR(pass);
+ pass = ftp_strdup(getoptionvalue("anonpass"));
}
- if (user == NULL)
- freeuser = 1;
- if (pass == NULL)
- freepass = 1;
- freeacct = 1;
- if (ruserpass(host, &user, &pass, &acct) < 0) {
+ if (ruserpass(host, &fuser, &pass, &facct) < 0) {
code = -1;
goto cleanup_ftp_login;
}
- while (user == NULL) {
+ while (fuser == NULL) {
if (localname)
fprintf(ttyout, "Name (%s:%s): ", host, localname);
else
fprintf(ttyout, "Name (%s): ", host);
- *tmp = '\0';
- if (fgets(tmp, sizeof(tmp) - 1, stdin) == NULL) {
- fprintf(ttyout, "\nEOF received; login aborted.\n");
- clearerr(stdin);
+ errormsg = NULL;
+ nlen = get_line(stdin, tmp, sizeof(tmp), &errormsg);
+ if (nlen < 0) {
+ fprintf(ttyout, "%s; %s aborted.\n", errormsg, "login");
code = -1;
goto cleanup_ftp_login;
+ } else if (nlen == 0) {
+ fuser = ftp_strdup(localname);
+ } else {
+ fuser = ftp_strdup(tmp);
}
- tmp[strlen(tmp) - 1] = '\0';
- freeuser = 0;
- if (*tmp == '\0')
- user = localname;
- else
- user = tmp;
}
if (gatemode) {
char *nuser;
- int len;
+ size_t len;
- len = strlen(user) + 1 + strlen(host) + 1;
- nuser = xmalloc(len);
- (void)strlcpy(nuser, user, len);
+ len = strlen(fuser) + 1 + strlen(host) + 1;
+ nuser = ftp_malloc(len);
+ (void)strlcpy(nuser, fuser, len);
(void)strlcat(nuser, "@", len);
(void)strlcat(nuser, host, len);
- freeuser = 1;
- user = nuser;
+ FREEPTR(fuser);
+ fuser = nuser;
}
- n = command("USER %s", user);
+ n = command("USER %s", fuser);
if (n == CONTINUE) {
if (pass == NULL) {
- freepass = 0;
- pass = getpass("Password:");
+ p = getpass("Password: ");
+ if (p == NULL)
+ p = emptypass;
+ pass = ftp_strdup(p);
+ memset(p, 0, strlen(p));
}
n = command("PASS %s", pass);
+ memset(pass, 0, strlen(pass));
}
if (n == CONTINUE) {
aflag++;
- if (acct == NULL) {
- freeacct = 0;
- acct = getpass("Account:");
+ if (facct == NULL) {
+ p = getpass("Account: ");
+ if (p == NULL)
+ p = emptypass;
+ facct = ftp_strdup(p);
+ memset(p, 0, strlen(p));
}
- if (acct[0] == '\0') {
- warnx("Login failed.");
+ if (facct[0] == '\0') {
+ warnx("Login failed");
goto cleanup_ftp_login;
}
- n = command("ACCT %s", acct);
+ n = command("ACCT %s", facct);
+ memset(facct, 0, strlen(facct));
}
if ((n != COMPLETE) ||
- (!aflag && acct != NULL && command("ACCT %s", acct) != COMPLETE)) {
- warnx("Login failed.");
+ (!aflag && facct != NULL && command("ACCT %s", facct) != COMPLETE)) {
+ warnx("Login failed");
goto cleanup_ftp_login;
}
rval = 1;
- username = xstrdup(user);
+ username = ftp_strdup(fuser);
if (proxy)
goto cleanup_ftp_login;
@@ -483,12 +492,13 @@ ftp_login(const char *host, const char *user, const char *pass)
updateremotecwd();
cleanup_ftp_login:
- if (user != NULL && freeuser)
- free((char *)user);
- if (pass != NULL && freepass)
- free((char *)pass);
- if (acct != NULL && freeacct)
- free((char *)acct);
+ FREEPTR(fuser);
+ if (pass != NULL)
+ memset(pass, 0, strlen(pass));
+ FREEPTR(pass);
+ if (facct != NULL)
+ memset(facct, 0, strlen(facct));
+ FREEPTR(facct);
return (rval);
}
@@ -499,23 +509,26 @@ ftp_login(const char *host, const char *user, const char *pass)
* Returns false if no new arguments have been added.
*/
int
-another(int *pargc, char ***pargv, const char *prompt)
+another(int *pargc, char ***pargv, const char *aprompt)
{
- int len = strlen(line), ret;
+ const char *errormsg;
+ int ret, nlen;
+ size_t len;
+ len = strlen(line);
if (len >= sizeof(line) - 3) {
- fputs("sorry, arguments too long.\n", ttyout);
+ fputs("Sorry, arguments too long.\n", ttyout);
intr(0);
}
- fprintf(ttyout, "(%s) ", prompt);
+ fprintf(ttyout, "(%s) ", aprompt);
line[len++] = ' ';
- if (fgets(&line[len], sizeof(line) - len, stdin) == NULL) {
- clearerr(stdin);
+ errormsg = NULL;
+ nlen = get_line(stdin, line + len, sizeof(line)-len, &errormsg);
+ if (nlen < 0) {
+ fprintf(ttyout, "%s; %s aborted.\n", errormsg, "operation");
intr(0);
}
- len += strlen(&line[len]);
- if (len > 0 && line[len - 1] == '\n')
- line[len - 1] = '\0';
+ len += nlen;
makeargv();
ret = margc > *pargc;
*pargc = margc;
@@ -529,83 +542,83 @@ another(int *pargc, char ***pargv, const char *prompt)
* of writing to the screen.
*/
char *
-remglob(char *argv[], int doswitch, char **errbuf)
+remglob(char *argv[], int doswitch, const char **errbuf)
{
- char temp[MAXPATHLEN];
- static char buf[MAXPATHLEN];
- static FILE *ftemp = NULL;
- static char **args;
- int oldverbose, oldhash, oldprogress, fd, len;
- char *cp, *mode;
-
- if (!mflag || !connected) {
- if (!doglob)
- args = NULL;
- else {
- if (ftemp) {
- (void)fclose(ftemp);
- ftemp = NULL;
- }
- }
- return (NULL);
- }
- if (!doglob) {
- if (args == NULL)
- args = argv;
- if ((cp = *++args) == NULL)
- args = NULL;
- return (cp);
- }
- if (ftemp == NULL) {
+ static char buf[MAXPATHLEN];
+ static FILE *ftemp = NULL;
+ static char **args;
+ char temp[MAXPATHLEN];
+ int oldverbose, oldhash, oldprogress, fd;
+ char *cp;
+ const char *rmode;
+ size_t len;
+
+ if (!mflag || !connected) {
+ if (!doglob)
+ args = NULL;
+ else {
+ if (ftemp) {
+ (void)fclose(ftemp);
+ ftemp = NULL;
+ }
+ }
+ return (NULL);
+ }
+ if (!doglob) {
+ if (args == NULL)
+ args = argv;
+ if ((cp = *++args) == NULL)
+ args = NULL;
+ return (cp);
+ }
+ if (ftemp == NULL) {
len = strlcpy(temp, tmpdir, sizeof(temp));
if (temp[len - 1] != '/')
(void)strlcat(temp, "/", sizeof(temp));
(void)strlcat(temp, TMPFILE, sizeof(temp));
- if ((fd = mkstemp(temp)) < 0) {
- warn("unable to create temporary file %s", temp);
- return (NULL);
- }
- close(fd);
- oldverbose = verbose;
+ if ((fd = mkstemp(temp)) < 0) {
+ warn("Unable to create temporary file `%s'", temp);
+ return (NULL);
+ }
+ close(fd);
+ oldverbose = verbose;
verbose = (errbuf != NULL) ? -1 : 0;
- oldhash = hash;
+ oldhash = hash;
oldprogress = progress;
- hash = 0;
+ hash = 0;
progress = 0;
- if (doswitch)
- pswitch(!proxy);
- for (mode = "w"; *++argv != NULL; mode = "a")
- recvrequest("NLST", temp, *argv, mode, 0, 0);
+ if (doswitch)
+ pswitch(!proxy);
+ for (rmode = "w"; *++argv != NULL; rmode = "a")
+ recvrequest("NLST", temp, *argv, rmode, 0, 0);
if ((code / 100) != COMPLETE) {
if (errbuf != NULL)
*errbuf = reply_string;
}
- if (doswitch)
- pswitch(!proxy);
- verbose = oldverbose;
+ if (doswitch)
+ pswitch(!proxy);
+ verbose = oldverbose;
hash = oldhash;
progress = oldprogress;
- ftemp = fopen(temp, "r");
- (void)unlink(temp);
- if (ftemp == NULL) {
+ ftemp = fopen(temp, "r");
+ (void)unlink(temp);
+ if (ftemp == NULL) {
if (errbuf == NULL)
- fputs(
- "can't find list of remote files, oops.\n",
- ttyout);
+ warnx("Can't find list of remote files");
else
*errbuf =
- "can't find list of remote files, oops.";
- return (NULL);
- }
- }
- if (fgets(buf, sizeof(buf), ftemp) == NULL) {
- (void)fclose(ftemp);
+ "Can't find list of remote files";
+ return (NULL);
+ }
+ }
+ if (fgets(buf, sizeof(buf), ftemp) == NULL) {
+ (void)fclose(ftemp);
ftemp = NULL;
- return (NULL);
- }
- if ((cp = strchr(buf, '\n')) != NULL)
- *cp = '\0';
- return (buf);
+ return (NULL);
+ }
+ if ((cp = strchr(buf, '\n')) != NULL)
+ *cp = '\0';
+ return (buf);
}
/*
@@ -623,16 +636,16 @@ globulize(const char *pattern)
char *p;
if (!doglob)
- return (xstrdup(pattern));
+ return (ftp_strdup(pattern));
flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE;
memset(&gl, 0, sizeof(gl));
if (glob(pattern, flags, NULL, &gl) || gl.gl_pathc == 0) {
- warnx("%s: not found", pattern);
+ warnx("Glob pattern `%s' not found", pattern);
globfree(&gl);
return (NULL);
}
- p = xstrdup(gl.gl_pathv[0]);
+ p = ftp_strdup(gl.gl_pathv[0]);
globfree(&gl);
return (p);
}
@@ -648,7 +661,7 @@ remotesize(const char *file, int noisy)
overbose = verbose;
size = -1;
- if (debug == 0)
+ if (ftp_debug == 0)
verbose = -1;
if (! features[FEAT_SIZE]) {
if (noisy)
@@ -670,7 +683,7 @@ remotesize(const char *file, int noisy)
} else {
if (r == ERROR && code == 500 && features[FEAT_SIZE] == -1)
features[FEAT_SIZE] = 0;
- if (noisy && debug == 0) {
+ if (noisy && ftp_debug == 0) {
fputs(reply_string, ttyout);
putc('\n', ttyout);
}
@@ -692,7 +705,7 @@ remotemodtime(const char *file, int noisy)
overbose = verbose;
ocode = code;
rtime = -1;
- if (debug == 0)
+ if (ftp_debug == 0)
verbose = -1;
if (! features[FEAT_MDTM]) {
if (noisy)
@@ -704,7 +717,6 @@ remotemodtime(const char *file, int noisy)
if (r == COMPLETE) {
struct tm timebuf;
char *timestr, *frac;
- int yy, mo, day, hour, min, sec;
/*
* time-val = 14DIGIT [ "." 1*DIGIT ]
@@ -736,33 +748,30 @@ remotemodtime(const char *file, int noisy)
timestr[1] = '0';
fprintf(ttyout, "Converted to `%s'\n", timestr);
}
+ memset(&timebuf, 0, sizeof(timebuf));
if (strlen(timestr) != 14 ||
- sscanf(timestr, "%04d%02d%02d%02d%02d%02d",
- &yy, &mo, &day, &hour, &min, &sec) != 6) {
+ (strptime(timestr, "%Y%m%d%H%M%S", &timebuf) == NULL)) {
bad_parse_time:
fprintf(ttyout, "Can't parse time `%s'.\n", timestr);
goto cleanup_parse_time;
}
- memset(&timebuf, 0, sizeof(timebuf));
- timebuf.tm_sec = sec;
- timebuf.tm_min = min;
- timebuf.tm_hour = hour;
- timebuf.tm_mday = day;
- timebuf.tm_mon = mo - 1;
- timebuf.tm_year = yy - TM_YEAR_BASE;
timebuf.tm_isdst = -1;
rtime = timegm(&timebuf);
if (rtime == -1) {
- if (noisy || debug != 0)
+ if (noisy || ftp_debug != 0)
goto bad_parse_time;
else
goto cleanup_parse_time;
- } else if (debug)
- fprintf(ttyout, "parsed date as: %s", ctime(&rtime));
+ } else {
+ DPRINTF("remotemodtime: parsed date `%s' as " LLF
+ ", %s",
+ timestr, (LLT)rtime,
+ rfc2822time(localtime(&rtime)));
+ }
} else {
if (r == ERROR && code == 500 && features[FEAT_MDTM] == -1)
features[FEAT_MDTM] = 0;
- if (noisy && debug == 0) {
+ if (noisy && ftp_debug == 0) {
fputs(reply_string, ttyout);
putc('\n', ttyout);
}
@@ -775,6 +784,21 @@ remotemodtime(const char *file, int noisy)
}
/*
+ * Format tm in an RFC2822 compatible manner, with a trailing \n.
+ * Returns a pointer to a static string containing the result.
+ */
+const char *
+rfc2822time(const struct tm *tm)
+{
+ static char result[50];
+
+ if (strftime(result, sizeof(result),
+ "%a, %d %b %Y %H:%M:%S %z\n", tm) == 0)
+ errx(1, "Can't convert RFC2822 time: buffer too small");
+ return result;
+}
+
+/*
* Update global `localcwd', which contains the state of the local cwd
*/
void
@@ -783,8 +807,7 @@ updatelocalcwd(void)
if (getcwd(localcwd, sizeof(localcwd)) == NULL)
localcwd[0] = '\0';
- if (debug)
- fprintf(ttyout, "got localcwd as `%s'\n", localcwd);
+ DPRINTF("updatelocalcwd: got `%s'\n", localcwd);
}
/*
@@ -793,12 +816,13 @@ updatelocalcwd(void)
void
updateremotecwd(void)
{
- int overbose, ocode, i;
+ int overbose, ocode;
+ size_t i;
char *cp;
overbose = verbose;
ocode = code;
- if (debug == 0)
+ if (ftp_debug == 0)
verbose = -1;
if (command("PWD") != COMPLETE)
goto badremotecwd;
@@ -816,8 +840,7 @@ updateremotecwd(void)
remotecwd[i] = *cp;
}
remotecwd[i] = '\0';
- if (debug)
- fprintf(ttyout, "got remotecwd as `%s'\n", remotecwd);
+ DPRINTF("updateremotecwd: got `%s'\n", remotecwd);
goto cleanupremotecwd;
badremotecwd:
remotecwd[0]='\0';
@@ -833,20 +856,26 @@ updateremotecwd(void)
int
fileindir(const char *file, const char *dir)
{
- char realfile[PATH_MAX+1];
+ char parentdirbuf[PATH_MAX+1], *parentdir;
+ char realdir[PATH_MAX+1];
size_t dirlen;
- if (realpath(file, realfile) == NULL) {
- warn("Unable to determine real path of `%s'", file);
+ /* determine parent directory of file */
+ (void)strlcpy(parentdirbuf, file, sizeof(parentdirbuf));
+ parentdir = dirname(parentdirbuf);
+ if (strcmp(parentdir, ".") == 0)
+ return 1; /* current directory is ok */
+
+ /* find the directory */
+ if (realpath(parentdir, realdir) == NULL) {
+ warn("Unable to determine real path of `%s'", parentdir);
return 0;
}
- if (realfile[0] != '/') /* relative result */
+ if (realdir[0] != '/') /* relative result is ok */
return 1;
dirlen = strlen(dir);
-#if 0
-printf("file %s realfile %s dir %s [%d]\n", file, realfile, dir, dirlen);
-#endif
- if (strncmp(realfile, dir, dirlen) == 0 && realfile[dirlen] == '/')
+ if (strncmp(realdir, dir, dirlen) == 0 &&
+ (realdir[dirlen] == '/' || realdir[dirlen] == '\0'))
return 1;
return 0;
}
@@ -857,9 +886,10 @@ printf("file %s realfile %s dir %s [%d]\n", file, realfile, dir, dirlen);
void
list_vertical(StringList *sl)
{
- int i, j, w;
- int columns, width, lines;
+ size_t i, j;
+ size_t columns, lines;
char *p;
+ size_t w, width;
width = 0;
@@ -883,10 +913,12 @@ list_vertical(StringList *sl)
putc('\n', ttyout);
break;
}
- w = strlen(p);
- while (w < width) {
- w = (w + 8) &~ 7;
- (void)putc('\t', ttyout);
+ if (p) {
+ w = strlen(p);
+ while (w < width) {
+ w = (w + 8) &~ 7;
+ (void)putc('\t', ttyout);
+ }
}
}
}
@@ -1031,11 +1063,11 @@ setupsockbufsize(int sock)
if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF,
(void *)&sndbuf_size, sizeof(sndbuf_size)) == -1)
- warn("unable to set sndbuf size %d", sndbuf_size);
+ warn("Unable to set sndbuf size %d", sndbuf_size);
if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
(void *)&rcvbuf_size, sizeof(rcvbuf_size)) == -1)
- warn("unable to set rcvbuf size %d", rcvbuf_size);
+ warn("Unable to set rcvbuf size %d", rcvbuf_size);
}
/*
@@ -1044,7 +1076,7 @@ setupsockbufsize(int sock)
void
ftpvis(char *dst, size_t dstlen, const char *src, size_t srclen)
{
- int di, si;
+ size_t di, si;
for (di = si = 0;
src[si] != '\0' && di < dstlen && si < srclen;
@@ -1073,9 +1105,9 @@ ftpvis(char *dst, size_t dstlen, const char *src, size_t srclen)
void
formatbuf(char *buf, size_t len, const char *src)
{
- const char *p;
- char *p2, *q;
- int i, op, updirs, pdirs;
+ const char *p, *p2, *q;
+ size_t i;
+ int op, updirs, pdirs;
#define ADDBUF(x) do { \
if (i >= len - 1) \
@@ -1153,7 +1185,7 @@ formatbuf(char *buf, size_t len, const char *src)
case 'M':
case 'm':
- for (p2 = connected && username ? username : "-";
+ for (p2 = connected && hostname ? hostname : "-";
*p2 ; p2++) {
if (op == 'm' && *p2 == '.')
break;
@@ -1182,39 +1214,6 @@ formatbuf(char *buf, size_t len, const char *src)
}
/*
- * Parse `port' into a TCP port number, defaulting to `defport' if `port' is
- * an unknown service name. If defport != -1, print a warning upon bad parse.
- */
-int
-parseport(const char *port, int defport)
-{
- int rv;
- long nport;
- char *p, *ep;
-
- p = xstrdup(port);
- nport = strtol(p, &ep, 10);
- if (*ep != '\0' && ep == p) {
- struct servent *svp;
-
- svp = getservbyname(port, "tcp");
- if (svp == NULL) {
- badparseport:
- if (defport != -1)
- warnx("Unknown port `%s', using port %d",
- port, defport);
- rv = defport;
- } else
- rv = ntohs(svp->s_port);
- } else if (nport < 1 || nport > MAX_IN_PORT_T || *ep != '\0')
- goto badparseport;
- else
- rv = nport;
- free(p);
- return (rv);
-}
-
-/*
* Determine if given string is an IPv6 address or not.
* Return 1 for yes, 0 for no
*/
@@ -1226,7 +1225,7 @@ isipv6addr(const char *addr)
struct addrinfo hints, *res;
memset(&hints, 0, sizeof(hints));
- hints.ai_family = PF_INET6;
+ hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
hints.ai_flags = AI_NUMERICHOST;
if (getaddrinfo(addr, "0", &hints, &res) != 0)
@@ -1235,35 +1234,124 @@ isipv6addr(const char *addr)
rv = 1;
freeaddrinfo(res);
}
- if (debug)
- fprintf(ttyout, "isipv6addr: got %d for %s\n", rv, addr);
+ DPRINTF("isipv6addr: got %d for %s\n", rv, addr);
#endif
return (rv == 1) ? 1 : 0;
}
+/*
+ * Read a line from the FILE stream into buf/buflen using fgets(), so up
+ * to buflen-1 chars will be read and the result will be NUL terminated.
+ * If the line has a trailing newline it will be removed.
+ * If the line is too long, excess characters will be read until
+ * newline/EOF/error.
+ * If EOF/error occurs or a too-long line is encountered and errormsg
+ * isn't NULL, it will be changed to a description of the problem.
+ * (The EOF message has a leading \n for cosmetic purposes).
+ * Returns:
+ * >=0 length of line (excluding trailing newline) if all ok
+ * -1 error occurred
+ * -2 EOF encountered
+ * -3 line was too long
+ */
+int
+get_line(FILE *stream, char *buf, size_t buflen, const char **errormsg)
+{
+ int rv, ch;
+ size_t len;
+
+ if (fgets(buf, buflen, stream) == NULL) {
+ if (feof(stream)) { /* EOF */
+ rv = -2;
+ if (errormsg)
+ *errormsg = "\nEOF received";
+ } else { /* error */
+ rv = -1;
+ if (errormsg)
+ *errormsg = "Error encountered";
+ }
+ clearerr(stream);
+ return rv;
+ }
+ len = strlen(buf);
+ if (buf[len-1] == '\n') { /* clear any trailing newline */
+ buf[--len] = '\0';
+ } else if (len == buflen-1) { /* line too long */
+ while ((ch = getchar()) != '\n' && ch != EOF)
+ continue;
+ if (errormsg)
+ *errormsg = "Input line is too long";
+ clearerr(stream);
+ return -3;
+ }
+ if (errormsg)
+ *errormsg = NULL;
+ return len;
+}
/*
- * Internal version of connect(2); sets socket buffer sizes first and
+ * Internal version of connect(2); sets socket buffer sizes,
+ * binds to a specific local address (if set), and
* supports a connection timeout using a non-blocking connect(2) with
* a poll(2).
* Socket fcntl flags are temporarily updated to include O_NONBLOCK;
* these will not be reverted on connection failure.
- * Returns -1 upon failure (with errno set to the problem), or 0 on success.
+ * Returns 0 on success, or -1 upon failure (with an appropriate
+ * error message displayed.)
*/
int
-xconnect(int sock, const struct sockaddr *name, socklen_t namelen)
+ftp_connect(int sock, const struct sockaddr *name, socklen_t namelen)
{
int flags, rv, timeout, error;
socklen_t slen;
struct timeval endtime, now, td;
struct pollfd pfd[1];
+ char hname[NI_MAXHOST];
+ char sname[NI_MAXSERV];
setupsockbufsize(sock);
+ if (getnameinfo(name, namelen,
+ hname, sizeof(hname), sname, sizeof(sname),
+ NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
+ strlcpy(hname, "?", sizeof(hname));
+ strlcpy(sname, "?", sizeof(sname));
+ }
+
+ if (bindai != NULL) { /* bind to specific addr */
+ struct addrinfo *ai;
+
+ for (ai = bindai; ai != NULL; ai = ai->ai_next) {
+ if (ai->ai_family == name->sa_family)
+ break;
+ }
+ if (ai == NULL)
+ ai = bindai;
+ if (bind(sock, ai->ai_addr, ai->ai_addrlen) == -1) {
+ char bname[NI_MAXHOST];
+ int saveerr;
+
+ saveerr = errno;
+ if (getnameinfo(ai->ai_addr, ai->ai_addrlen,
+ bname, sizeof(bname), NULL, 0, NI_NUMERICHOST) != 0)
+ strlcpy(bname, "?", sizeof(bname));
+ errno = saveerr;
+ warn("Can't bind to `%s'", bname);
+ return -1;
+ }
+ }
- if ((flags = fcntl(sock, F_GETFL, 0)) == -1)
- return -1; /* get current socket flags */
- if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) == -1)
- return -1; /* set non-blocking connect */
+ /* save current socket flags */
+ if ((flags = fcntl(sock, F_GETFL, 0)) == -1) {
+ warn("Can't %s socket flags for connect to `%s:%s'",
+ "save", hname, sname);
+ return -1;
+ }
+ /* set non-blocking connect */
+ if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) == -1) {
+ warn("Can't set socket non-blocking for connect to `%s:%s'",
+ hname, sname);
+ return -1;
+ }
/* NOTE: we now must restore socket flags on successful exit */
@@ -1277,8 +1365,11 @@ xconnect(int sock, const struct sockaddr *name, socklen_t namelen)
rv = connect(sock, name, namelen); /* inititate the connection */
if (rv == -1) { /* connection error */
- if (errno != EINPROGRESS) /* error isn't "please wait" */
+ if (errno != EINPROGRESS) { /* error isn't "please wait" */
+ connecterror:
+ warn("Can't connect to `%s:%s'", hname, sname);
return -1;
+ }
/* connect EINPROGRESS; wait */
do {
@@ -1292,34 +1383,39 @@ xconnect(int sock, const struct sockaddr *name, socklen_t namelen)
timeout = INFTIM;
}
pfd[0].revents = 0;
- rv = xpoll(pfd, 1, timeout);
+ rv = ftp_poll(pfd, 1, timeout);
/* loop until poll ! EINTR */
} while (rv == -1 && errno == EINTR);
if (rv == 0) { /* poll (connect) timed out */
errno = ETIMEDOUT;
- return -1;
+ goto connecterror;
}
if (rv == -1) { /* poll error */
- return -1;
+ goto connecterror;
} else if (pfd[0].revents & (POLLIN|POLLOUT)) {
slen = sizeof(error); /* OK, or pending error */
if (getsockopt(sock, SOL_SOCKET, SO_ERROR,
- &error, &slen) == -1)
- return -1; /* Solaris pending error */
- if (error != 0) {
+ &error, &slen) == -1) {
+ /* Solaris pending error */
+ goto connecterror;
+ } else if (error != 0) {
errno = error; /* BSD pending error */
- return -1;
+ goto connecterror;
}
} else {
errno = EBADF; /* this shouldn't happen ... */
- return -1;
+ goto connecterror;
}
}
- if (fcntl(sock, F_SETFL, flags) == -1) /* restore socket flags */
+ if (fcntl(sock, F_SETFL, flags) == -1) {
+ /* restore socket flags */
+ warn("Can't %s socket flags for connect to `%s:%s'",
+ "restore", hname, sname);
return -1;
+ }
return 0;
}
@@ -1327,7 +1423,7 @@ xconnect(int sock, const struct sockaddr *name, socklen_t namelen)
* Internal version of listen(2); sets socket buffer sizes first.
*/
int
-xlisten(int sock, int backlog)
+ftp_listen(int sock, int backlog)
{
setupsockbufsize(sock);
@@ -1339,16 +1435,74 @@ xlisten(int sock, int backlog)
* on platforms without the former.
*/
int
-xpoll(struct pollfd *fds, int nfds, int timeout)
+ftp_poll(struct pollfd *fds, int nfds, int timeout)
{
+#if defined(HAVE_POLL)
return poll(fds, nfds, timeout);
+
+#elif defined(HAVE_SELECT)
+ /* implement poll(2) using select(2) */
+ fd_set rset, wset, xset;
+ const int rsetflags = POLLIN | POLLRDNORM;
+ const int wsetflags = POLLOUT | POLLWRNORM;
+ const int xsetflags = POLLRDBAND;
+ struct timeval tv, *ptv;
+ int i, max, rv;
+
+ FD_ZERO(&rset); /* build list of read & write events */
+ FD_ZERO(&wset);
+ FD_ZERO(&xset);
+ max = 0;
+ for (i = 0; i < nfds; i++) {
+ if (fds[i].fd > FD_SETSIZE) {
+ warnx("can't select fd %d", fds[i].fd);
+ errno = EINVAL;
+ return -1;
+ } else if (fds[i].fd > max)
+ max = fds[i].fd;
+ if (fds[i].events & rsetflags)
+ FD_SET(fds[i].fd, &rset);
+ if (fds[i].events & wsetflags)
+ FD_SET(fds[i].fd, &wset);
+ if (fds[i].events & xsetflags)
+ FD_SET(fds[i].fd, &xset);
+ }
+
+ ptv = &tv; /* determine timeout */
+ if (timeout == -1) { /* wait forever */
+ ptv = NULL;
+ } else if (timeout == 0) { /* poll once */
+ ptv->tv_sec = 0;
+ ptv->tv_usec = 0;
+ }
+ else if (timeout != 0) { /* wait timeout milliseconds */
+ ptv->tv_sec = timeout / 1000;
+ ptv->tv_usec = (timeout % 1000) * 1000;
+ }
+ rv = select(max + 1, &rset, &wset, &xset, ptv);
+ if (rv <= 0) /* -1 == error, 0 == timeout */
+ return rv;
+
+ for (i = 0; i < nfds; i++) { /* determine results */
+ if (FD_ISSET(fds[i].fd, &rset))
+ fds[i].revents |= (fds[i].events & rsetflags);
+ if (FD_ISSET(fds[i].fd, &wset))
+ fds[i].revents |= (fds[i].events & wsetflags);
+ if (FD_ISSET(fds[i].fd, &xset))
+ fds[i].revents |= (fds[i].events & xsetflags);
+ }
+ return rv;
+
+#else
+# error no way to implement xpoll
+#endif
}
/*
* malloc() with inbuilt error checking
*/
void *
-xmalloc(size_t size)
+ftp_malloc(size_t size)
{
void *p;
@@ -1362,7 +1516,7 @@ xmalloc(size_t size)
* sl_init() with inbuilt error checking
*/
StringList *
-xsl_init(void)
+ftp_sl_init(void)
{
StringList *p;
@@ -1376,7 +1530,7 @@ xsl_init(void)
* sl_add() with inbuilt error checking
*/
void
-xsl_add(StringList *sl, char *i)
+ftp_sl_add(StringList *sl, char *i)
{
if (sl_add(sl, i) == -1)
@@ -1387,12 +1541,12 @@ xsl_add(StringList *sl, char *i)
* strdup() with inbuilt error checking
*/
char *
-xstrdup(const char *str)
+ftp_strdup(const char *str)
{
char *s;
if (str == NULL)
- errx(1, "xstrdup() called with NULL argument");
+ errx(1, "ftp_strdup: called with NULL argument");
s = strdup(str);
if (s == NULL)
err(1, "Unable to allocate memory for string copy");
diff --git a/contrib/lukemftp/src/version.h b/contrib/tnftp/src/version.h
index 7b69df1..6bb3631 100644
--- a/contrib/lukemftp/src/version.h
+++ b/contrib/tnftp/src/version.h
@@ -1,6 +1,8 @@
-/* $NetBSD: version.h,v 1.50 2005/05/14 15:26:43 lukem Exp $ */
+/* $NetBSD: version.h,v 1.4 2009/11/15 10:12:37 lukem Exp $ */
+/* from NetBSD: version.h,v 1.80 2009/11/15 10:03:16 lukem Exp */
+
/*-
- * Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -14,13 +16,6 @@
* 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
@@ -40,5 +35,5 @@
#endif
#ifndef FTP_VERSION
-#define FTP_VERSION "20050514"
+#define FTP_VERSION "20090915"
#endif
diff --git a/contrib/tnftp/tnftp.h b/contrib/tnftp/tnftp.h
new file mode 100644
index 0000000..3aa6eca
--- /dev/null
+++ b/contrib/tnftp/tnftp.h
@@ -0,0 +1,495 @@
+/* $NetBSD: tnftp.h,v 1.33 2009/11/14 08:32:42 lukem Exp $ */
+
+#define FTP_PRODUCT PACKAGE_NAME
+#define FTP_VERSION PACKAGE_VERSION
+
+#include "tnftp_config.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+
+#if defined(HAVE_SYS_TYPES_H)
+# include <sys/types.h>
+#endif
+#if defined(STDC_HEADERS)
+# include <stdarg.h>
+# include <stdlib.h>
+# include <string.h>
+#endif
+#if defined(HAVE_LIBGEN_H)
+# include <libgen.h>
+#endif
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif
+#if defined(HAVE_POLL_H)
+# include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
+# include <sys/poll.h>
+#endif
+#if defined(HAVE_SYS_SOCKET_H)
+# include <sys/socket.h>
+#endif
+#if defined(HAVE_NETINET_IN_H)
+# include <netinet/in.h>
+#endif
+#if defined(HAVE_NETINET_IN_SYSTM_H)
+# include <netinet/in_systm.h>
+#endif
+#if defined(HAVE_NETINET_IP_H)
+# include <netinet/ip.h>
+#endif
+#if defined(HAVE_NETDB_H)
+# if HAVE_DECL_AI_NUMERICHOST
+# include <netdb.h>
+# else /* !HAVE_DECL_AI_NUMERICHOST */
+# define getaddrinfo non_rfc2553_getaddrinfo
+# include <netdb.h>
+# undef getaddrinfo
+# endif /* !HAVE_DECL_AI_NUMERICHOST */
+#endif
+#if defined(HAVE_ARPA_INET_H)
+# include <arpa/inet.h>
+#endif
+#if defined(HAVE_DIRENT_H)
+# include <dirent.h>
+#else
+# define dirent direct
+# if defined(HAVE_SYS_NDIR_H)
+# include <sys/ndir.h>
+# endif
+# if defined(HAVE_SYS_DIR_H)
+# include <sys/dir.h>
+# endif
+# if defined(HAVE_NDIR_H)
+# include <ndir.h>
+# endif
+#endif
+
+#if defined(HAVE_SYS_IOCTL_H)
+# include <sys/ioctl.h>
+#endif
+#if defined(HAVE_SYS_PARAM_H)
+# include <sys/param.h>
+#endif
+#if defined(HAVE_SYS_STAT_H)
+# include <sys/stat.h>
+#endif
+#if defined(HAVE_SYS_SYSLIMITS_H)
+# include <sys/syslimits.h>
+#endif
+#if defined(HAVE_SYS_WAIT_H)
+# include <sys/wait.h>
+#endif
+
+#if defined(HAVE_ARPA_FTP_H)
+# include <arpa/ftp.h>
+#endif
+
+#if defined(HAVE_FCNTL_H)
+# include <fcntl.h>
+#endif
+#if defined(HAVE_LIMITS_H)
+# include <limits.h>
+#endif
+#if defined(HAVE_PWD_H)
+# include <pwd.h>
+#endif
+#if defined(HAVE_SETJMP_H)
+# include <setjmp.h>
+#endif
+#if defined(HAVE_SIGNAL_H)
+# include <signal.h>
+#endif
+#if defined(HAVE_STDDEF_H)
+# include <stddef.h>
+#endif
+#if defined(HAVE_TERMIOS_H)
+# include <termios.h>
+#endif
+
+#if defined(HAVE_POLL)
+/* we use poll */
+#elif defined(HAVE_SELECT)
+/* we use select */
+#else /* !defined(HAVE_POLL) && !defined(HAVE_SELECT) */
+# error "no poll() or select() found"
+#endif
+#if !defined(POLLIN)
+# define POLLIN 0x0001
+#endif
+#if !defined(POLLOUT)
+# define POLLOUT 0x0004
+#endif
+#if !defined(POLLRDNORM)
+# define POLLRDNORM 0x0040
+#endif
+#if !defined(POLLWRNORM)
+# define POLLWRNORM POLLOUT
+#endif
+#if !defined(POLLRDBAND)
+# define POLLRDBAND 0x0080
+#endif
+#if !defined(INFTIM)
+# define INFTIM -1
+#endif
+#if !defined(HAVE_STRUCT_POLLFD)
+struct pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+#endif
+
+#if defined(TIME_WITH_SYS_TIME)
+# include <sys/time.h>
+# include <time.h>
+#else
+# if defined(HAVE_SYS_TIME_H)
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if defined(HAVE_ERR_H)
+# include <err.h>
+#endif
+
+#if defined(USE_GLOB_H) /* not set by configure; used by other build systems */
+# include <glob.h>
+#else
+# include "ftpglob.h"
+#endif
+
+#if defined(HAVE_PATHS_H)
+# include <paths.h>
+#endif
+#if !defined(_PATH_BSHELL)
+# define _PATH_BSHELL "/bin/sh"
+#endif
+#if !defined(_PATH_TMP)
+# define _PATH_TMP "/tmp/"
+#endif
+
+typedef struct _stringlist {
+ char **sl_str;
+ size_t sl_max;
+ size_t sl_cur;
+} StringList;
+
+StringList *sl_init(void);
+int sl_add(StringList *, char *);
+void sl_free(StringList *, int);
+char *sl_find(StringList *, char *);
+
+#if defined(HAVE_TERMCAP_H)
+# include <termcap.h>
+#else
+int tgetent(char *, const char *);
+char *tgetstr(const char *, char **);
+int tgetflag(const char *);
+int tgetnum(const char *);
+char *tgoto(const char *, int, int);
+void tputs(const char *, int, int (*)(int));
+#endif /* !HAVE_TERMCAP_H */
+
+#if defined(HAVE_VIS_H) && defined(HAVE_STRVIS) && defined(HAVE_STRUNVIS)
+# include <vis.h>
+#else
+# include "ftpvis.h"
+#endif
+
+#if !defined(HAVE_IN_PORT_T)
+typedef unsigned short in_port_t;
+#endif
+
+#if !defined(HAVE_SA_FAMILY_T)
+typedef unsigned short sa_family_t;
+#endif
+
+#if !defined(HAVE_SOCKLEN_T)
+typedef unsigned int socklen_t;
+#endif
+
+#if defined(USE_INET6)
+# define INET6
+#endif
+
+#if !HAVE_DECL_AI_NUMERICHOST
+
+ /* RFC 2553 */
+#undef EAI_ADDRFAMILY
+#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
+#undef EAI_AGAIN
+#define EAI_AGAIN 2 /* temporary failure in name resolution */
+#undef EAI_BADFLAGS
+#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
+#undef EAI_FAIL
+#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
+#undef EAI_FAMILY
+#define EAI_FAMILY 5 /* ai_family not supported */
+#undef EAI_MEMORY
+#define EAI_MEMORY 6 /* memory allocation failure */
+#undef EAI_NODATA
+#define EAI_NODATA 7 /* no address associated with hostname */
+#undef EAI_NONAME
+#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
+#undef EAI_SERVICE
+#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
+#undef EAI_SOCKTYPE
+#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
+#undef EAI_SYSTEM
+#define EAI_SYSTEM 11 /* system error returned in errno */
+
+ /* KAME extensions? */
+#undef EAI_BADHINTS
+#define EAI_BADHINTS 12
+#undef EAI_PROTOCOL
+#define EAI_PROTOCOL 13
+#undef EAI_MAX
+#define EAI_MAX 14
+
+ /* RFC 2553 */
+#undef NI_MAXHOST
+#define NI_MAXHOST 1025
+#undef NI_MAXSERV
+#define NI_MAXSERV 32
+
+#undef NI_NOFQDN
+#define NI_NOFQDN 0x00000001
+#undef NI_NUMERICHOST
+#define NI_NUMERICHOST 0x00000002
+#undef NI_NAMEREQD
+#define NI_NAMEREQD 0x00000004
+#undef NI_NUMERICSERV
+#define NI_NUMERICSERV 0x00000008
+#undef NI_DGRAM
+#define NI_DGRAM 0x00000010
+
+ /* RFC 2553 */
+#undef AI_PASSIVE
+#define AI_PASSIVE 0x00000001 /* get address to use bind() */
+#undef AI_CANONNAME
+#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
+
+ /* KAME extensions ? */
+#undef AI_NUMERICHOST
+#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
+#undef AI_MASK
+#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
+
+ /* RFC 2553 */
+#undef AI_ALL
+#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
+#undef AI_V4MAPPED_CFG
+#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
+#undef AI_ADDRCONFIG
+#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
+#undef AI_V4MAPPED
+#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
+
+#endif /* !HAVE_DECL_AI_NUMERICHOST */
+
+
+#if !HAVE_DECL_AI_NUMERICHOST && !defined(HAVE_STRUCT_ADDRINFO) \
+ && !defined(USE_SOCKS)
+
+struct addrinfo {
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+ int ai_family; /* PF_xxx */
+ int ai_socktype; /* SOCK_xxx */
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ socklen_t ai_addrlen; /* length of ai_addr */
+ char *ai_canonname; /* canonical name for hostname */
+ struct sockaddr *ai_addr; /* binary address */
+ struct addrinfo *ai_next; /* next structure in linked list */
+};
+
+int getaddrinfo(const char *, const char *,
+ const struct addrinfo *, struct addrinfo **);
+int getnameinfo(const struct sockaddr *, socklen_t,
+ char *, size_t, char *, size_t, int);
+void freeaddrinfo(struct addrinfo *);
+const char *gai_strerror(int);
+
+#endif /* !HAVE_DECL_AI_NUMERICHOST && !defined(HAVE_STRUCT_ADDRINFO) \
+ && !defined(USE_SOCKS) */
+
+#if !defined(HAVE_STRUCT_DIRENT_D_NAMLEN)
+# define DIRENT_MISSING_D_NAMLEN
+#endif
+
+#if !HAVE_DECL_H_ERRNO
+extern int h_errno;
+#endif
+#define HAVE_H_ERRNO 1 /* XXX: an assumption for now... */
+
+#if !HAVE_DECL_FCLOSE
+int fclose(FILE *);
+#endif
+
+#if !HAVE_DECL_GETPASS
+char *getpass(const char *);
+#endif
+
+#if !HAVE_DECL_OPTARG
+extern char *optarg;
+#endif
+
+#if !HAVE_DECL_OPTIND
+extern int optind;
+#endif
+
+#if !HAVE_DECL_PCLOSE
+int pclose(FILE *);
+#endif
+
+#if !HAVE_DECL_DIRNAME
+char *dirname(char *);
+#endif
+
+#if !defined(HAVE_ERR)
+void err(int, const char *, ...);
+void errx(int, const char *, ...);
+void warn(const char *, ...);
+void warnx(const char *, ...);
+#endif
+
+#if !defined(HAVE_FGETLN)
+char *fgetln(FILE *, size_t *);
+#endif
+
+#if !defined(HAVE_FSEEKO)
+int fseeko(FILE *, off_t, int);
+#endif
+
+#if !defined(HAVE_INET_NTOP)
+const char *inet_ntop(int, const void *, char *, socklen_t);
+#endif
+
+#if !defined(HAVE_INET_PTON)
+int inet_pton(int, const char *, void *);
+#endif
+
+#if !defined(HAVE_MKSTEMP)
+int mkstemp(char *);
+#endif
+
+#if !defined(HAVE_SETPROGNAME)
+const char *getprogname(void);
+void setprogname(const char *);
+#endif
+
+#if !defined(HAVE_SNPRINTF)
+int snprintf(char *, size_t, const char *, ...);
+#endif
+
+#if !defined(HAVE_STRDUP)
+char *strdup(const char *);
+#endif
+
+#if !defined(HAVE_STRERROR)
+char *strerror(int);
+#endif
+
+#if !defined(HAVE_STRPTIME) || !HAVE_DECL_STRPTIME
+char *strptime(const char *, const char *, struct tm *);
+#endif
+
+#if defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)
+# if !defined(HAVE_STRTOLL)
+long long strtoll(const char *, char **, int);
+# endif
+# if !defined(LLONG_MIN)
+# define LLONG_MIN (-0x7fffffffffffffffLL-1)
+# endif
+# if !defined(LLONG_MAX)
+# define LLONG_MAX (0x7fffffffffffffffLL)
+# endif
+#else /* !(defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)) */
+# define NO_LONG_LONG 1
+#endif /* !(defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)) */
+
+#if !defined(HAVE_TIMEGM)
+time_t timegm(struct tm *);
+#endif
+
+#if !defined(HAVE_STRLCAT)
+size_t strlcat(char *, const char *, size_t);
+#endif
+
+#if !defined(HAVE_STRLCPY)
+size_t strlcpy(char *, const char *, size_t);
+#endif
+
+#if !defined(HAVE_STRSEP)
+char *strsep(char **stringp, const char *delim);
+#endif
+
+#if !defined(HAVE_UTIMES)
+int utimes(const char *, const struct timeval *);
+#endif
+
+#if !defined(HAVE_MEMMOVE)
+# define memmove(a,b,c) bcopy((b),(a),(c))
+ /* XXX: add others #defines for borken systems? */
+#endif
+
+#if defined(HAVE_GETPASSPHRASE)
+# define getpass getpassphrase
+#endif
+
+#if !defined(MIN)
+# define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#if !defined(MAX)
+# define MAX(a, b) ((a) < (b) ? (b) : (a))
+#endif
+
+#if !defined(timersub)
+# define timersub(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+#endif
+
+#if !defined(S_ISLNK)
+# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
+#endif
+
+#define EPOCH_YEAR 1970
+#define SECSPERHOUR 3600
+#define SECSPERDAY 86400
+#define TM_YEAR_BASE 1900
+
+#if defined(USE_SOCKS) /* (Dante) SOCKS5 */
+#define connect Rconnect
+#define bind Rbind
+#define getsockname Rgetsockname
+#define getpeername Rgetpeername
+#define accept Raccept
+#define rresvport Rrresvport
+#define bindresvport Rbindresvport
+#define gethostbyname Rgethostbyname
+#define gethostbyname2 Rgethostbyname2
+#define sendto Rsendto
+#define recvfrom Rrecvfrom
+#define recvfrom Rrecvfrom
+#define write Rwrite
+#define writev Rwritev
+#define send Rsend
+#define sendmsg Rsendmsg
+#define read Rread
+#define readv Rreadv
+#define recv Rrecv
+#define recvmsg Rrecvmsg
+#define getaddrinfo Rgetaddrinfo
+#define getipnodebyname Rgetipnodebyname
+#endif /* defined(USE_SOCKS) */
diff --git a/contrib/tnftp/todo b/contrib/tnftp/todo
new file mode 100644
index 0000000..38f8264
--- /dev/null
+++ b/contrib/tnftp/todo
@@ -0,0 +1,25 @@
+$NetBSD: todo,v 1.12 2008/12/20 15:17:58 lukem Exp $
+
+Current Items
+-------------
+
+autoconf test for HAVE_DECL_GETADDRINFO if providing getaddrinfo() override.
+(required for UnixWare 7.1.1)
+
+Interix may need hack to fix detection of getpgrp() void args.
+(See pkgsrc/net/tnftp/files/src/progressbar.c 1.2)
+
+Old Items
+---------
+
+add locale autoconf checks
+
+in configure, check for ansi c compiler and barf if it fails
+
+check if we need #defines for memcpy() et al
+
+possibly install editline.3 and editrc.5
+
+system specific tests (to remove need for manual intervention):
+- sunos4
+ LIBS+= -lresolv
diff --git a/contrib/top/commands.c b/contrib/top/commands.c
index 47f4a2e..7891068 100644
--- a/contrib/top/commands.c
+++ b/contrib/top/commands.c
@@ -94,6 +94,7 @@ S - toggle the displaying of system processes\n\
a - toggle the displaying of process titles\n\
t - toggle the display of this process\n\
u - display processes for only one user (+ selects all users)\n\
+z - toggle the displaying of the system idle process\n\
\n\
\n", stdout);
}
diff --git a/contrib/top/display.c b/contrib/top/display.c
index f0f0c23..8d89d82 100644
--- a/contrib/top/display.c
+++ b/contrib/top/display.c
@@ -698,7 +698,7 @@ char *text;
int width;
s = NULL;
- width = screen_width;
+ width = display_width;
header_length = strlen(text);
if (header_length >= width) {
s = malloc((width + 1) * sizeof(char));
@@ -706,14 +706,6 @@ char *text;
return (NULL);
strncpy(s, text, width);
s[width] = '\0';
- } else {
- s = malloc((width + 1) * sizeof(char));
- if (s == NULL)
- return (NULL);
- strncpy(s, text, width);
- while (screen_width > header_length)
- s[header_length++] = ' ';
- s[width] = '\0';
}
return (s);
}
@@ -738,7 +730,7 @@ char *text;
if (header_status == ON)
{
putchar('\n');
- standout(text, stdout);
+ fputs(text, stdout);
lastline++;
}
else if (header_status == ERASE)
diff --git a/contrib/top/machine.h b/contrib/top/machine.h
index a09424c..3e1af16 100644
--- a/contrib/top/machine.h
+++ b/contrib/top/machine.h
@@ -65,6 +65,7 @@ struct process_select
int uid; /* only this uid (unless uid == -1) */
int wcpu; /* show weighted cpu */
int jail; /* show jail ID */
+ int kidle; /* show per-CPU idle threads */
char *command; /* only this command (unless == NULL) */
};
diff --git a/contrib/top/top.X b/contrib/top/top.X
index 830e50d..41c3d78 100644
--- a/contrib/top/top.X
+++ b/contrib/top/top.X
@@ -10,7 +10,7 @@ top \- display and update information about the top cpu processes
.SH SYNOPSIS
.B top
[
-.B \-abCHIijnPqStuv
+.B \-abCHIijnPqStuvz
] [
.BI \-d count
] [
@@ -89,6 +89,10 @@ Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is
ignored. Interrupt characters (such as ^C and ^\e) still have an effect.
This is the default on a dumb terminal, or when the output is not a terminal.
.TP
+.B \-H
+Display each thread for a multithreaded process individually.
+By default a single summary line is displayed for each process.
+.TP
.B \-i
Use \*(lqinteractive\*(rq mode. In this mode, any input is immediately
read for processing. See the section on \*(lqInteractive Mode\*(rq
@@ -142,6 +146,9 @@ Write version number information to stderr then exit immediately.
No other processing takes place when this option is used. To see current
revision information while top is running, use the help command \*(lq?\*(rq.
.TP
+.B \-z
+Do not display the system idle process.
+.TP
.BI \-d count
Show only
.I count
@@ -289,6 +296,9 @@ or
.BR r enice
command.
.TP
+.B H
+Toggle the display of threads.
+.TP
.B i
(or
.BR I )
@@ -303,6 +313,9 @@ ID.
Toggle the display of the
.I top
process.
+.TP
+.B z
+Toggle the display of the system idle process.
.SH "THE DISPLAY"
The actual display varies depending on the specific variant of Unix
that the machine is running. This description may not exactly match
@@ -352,8 +365,11 @@ the order of the processes, and
COMMAND is the name of the command that the process is currently running
(if the process is swapped out, this column is marked \*(lq<swapped>\*(rq).
.SH NOTES
-The \*(lqABANDONED\*(rq state (known in the kernel as \*(lqSWAIT\*(rq) was
-abandoned, thus the name. A process should never end up in this state.
+If a process is in the \*(lqSLEEP\*(rq or \*(lqLOCK\*(rq state,
+the state column will report the name of the event or lock on which the
+process is waiting.
+Lock names are prefixed with an asterisk \*(lq*\*(rq while sleep events
+are not.
.SH AUTHOR
William LeFebvre, EECS Department, Northwestern University
.SH ENVIRONMENT
diff --git a/contrib/top/top.c b/contrib/top/top.c
index 762efaa..6673a27 100644
--- a/contrib/top/top.c
+++ b/contrib/top/top.c
@@ -196,9 +196,9 @@ char *argv[];
fd_set readfds;
#ifdef ORDER
- static char command_chars[] = "\f qh?en#sdkriIutHmSCajo";
+ static char command_chars[] = "\f qh?en#sdkriIutHmSCajzo";
#else
- static char command_chars[] = "\f qh?en#sdkriIutHmSCaj";
+ static char command_chars[] = "\f qh?en#sdkriIutHmSCajz";
#endif
/* these defines enumerate the "strchr"s of the commands in command_chars */
#define CMD_redraw 0
@@ -224,8 +224,9 @@ char *argv[];
#define CMD_wcputog 19
#define CMD_showargs 20
#define CMD_jidtog 21
+#define CMD_kidletog 22
#ifdef ORDER
-#define CMD_order 22
+#define CMD_order 23
#endif
/* set the buffer for stdout */
@@ -258,6 +259,7 @@ char *argv[];
ps.thread = No;
ps.wcpu = 1;
ps.jail = No;
+ ps.kidle = Yes;
ps.command = NULL;
/* get preset options from the environment */
@@ -283,7 +285,7 @@ char *argv[];
optind = 1;
}
- while ((i = getopt(ac, av, "CSIHPabijnquvs:d:U:m:o:t")) != EOF)
+ while ((i = getopt(ac, av, "CSIHPabijnquvzs:d:U:m:o:t")) != EOF)
{
switch(i)
{
@@ -412,10 +414,14 @@ char *argv[];
pcpu_stats = Yes;
break;
+ case 'z':
+ ps.kidle = !ps.kidle;
+ break;
+
default:
fprintf(stderr,
"Top version %s\n"
-"Usage: %s [-abCHIijnPqStuv] [-d count] [-m io | cpu] [-o field] [-s time]\n"
+"Usage: %s [-abCHIijnPqStuvz] [-d count] [-m io | cpu] [-o field] [-s time]\n"
" [-U username] [number]\n",
version_string(), myname);
exit(1);
@@ -1075,7 +1081,13 @@ restart:
reset_display();
putchar('\r');
break;
-
+ case CMD_kidletog:
+ ps.kidle = !ps.kidle;
+ new_message(MT_standout | MT_delayed,
+ " %sisplaying system idle process.",
+ ps.kidle ? "D" : "Not d");
+ putchar('\r');
+ break;
default:
new_message(MT_standout, " BAD CASE IN SWITCH!");
putchar('\r');
diff --git a/contrib/top/top.h b/contrib/top/top.h
index c51485a..a281957 100644
--- a/contrib/top/top.h
+++ b/contrib/top/top.h
@@ -14,7 +14,7 @@
extern int Header_lines; /* 7 */
/* Maximum number of columns allowed for display */
-#define MAX_COLS 512
+#define MAX_COLS 128
/* Log base 2 of 1024 is 10 (2^10 == 1024) */
#define LOG1024 10
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 21007d6..d467eaa 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -38,6 +38,7 @@ ddb_enable="NO" # Set to YES to load ddb scripts at boot.
ddb_config="/etc/ddb.conf" # ddb(8) config file.
devd_enable="YES" # Run devd, to trigger programs on device tree changes.
devd_flags="" # Additional flags for devd(8).
+#kld_list="" # Kernel modules to load after local disks are mounted
kldxref_enable="NO" # Build linker.hints files with kldxref(8).
kldxref_clobber="NO" # Overwrite old linker.hints at boot.
kldxref_module_path="" # Override kern.module_path. A ';'-delimited list.
@@ -89,7 +90,7 @@ fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails.
fsck_y_flags="" # Additional flags for fsck -y
background_fsck="YES" # Attempt to run fsck in the background where possible.
background_fsck_delay="60" # Time to wait (seconds) before starting the fsck.
-netfs_types="nfs:NFS newnfs:NEWNFS smbfs:SMB portalfs:PORTAL nwfs:NWFS" # Net filesystems.
+netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB portalfs:PORTAL nwfs:NWFS" # Net filesystems.
extra_netfs_types="NO" # List of network extra filesystem types for delayed
# mount at startup (or NO).
@@ -210,7 +211,7 @@ icmp_log_redirect="NO" # Set to YES to log ICMP REDIRECT packets
network_interfaces="auto" # List of network interfaces (or "auto").
cloned_interfaces="" # List of cloned network interfaces to create.
#cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config.
-ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
+#ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
#ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry.
#ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry
@@ -443,6 +444,13 @@ ubthidhci_enable="NO" # Switch an USB BT controller present on
#ubthidhci_addr="2" # Check usbconfig list to find the correct
# numbers for your system.
+### Network link/usability verification options
+netwait_enable="NO" # Enable rc.d/netwait (or NO)
+#netwait_ip="" # IP addresses to be pinged by netwait.
+netwait_timeout="60" # Total number of seconds to perform pings.
+#netwait_if="" # Interface name to watch link state on.
+netwait_if_timeout="30" # Total number of seconds to monitor link state.
+
### Miscellaneous network options: ###
icmp_bmcastecho="NO" # respond to broadcast ping packets
diff --git a/etc/network.subr b/etc/network.subr
index 8185c5a..f9a1f88 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -44,9 +44,9 @@ ifn_start()
ifscript_up ${ifn} && cfg=0
ifconfig_up ${ifn} && cfg=0
- ipv4_up ${ifn} && cfg=0
- ipv6_up ${ifn} && cfg=0
- ipx_up ${ifn} && cfg=0
+ afexists inet && ipv4_up ${ifn} && cfg=0
+ afexists inet6 && ipv6_up ${ifn} && cfg=0
+ afexists ipx && ipx_up ${ifn} && cfg=0
childif_create ${ifn} && cfg=0
return $cfg
@@ -64,9 +64,9 @@ ifn_stop()
[ -z "$ifn" ] && err 1 "ifn_stop called without an interface"
- ipx_down ${ifn} && cfg=0
- ipv6_down ${ifn} && cfg=0
- ipv4_down ${ifn} && cfg=0
+ afexists ipx && ipx_down ${ifn} && cfg=0
+ afexists inet6 && ipv6_down ${ifn} && cfg=0
+ afexists inet && ipv4_down ${ifn} && cfg=0
ifconfig_down ${ifn} && cfg=0
ifscript_down ${ifn} && cfg=0
childif_destroy ${ifn} && cfg=0
@@ -86,6 +86,11 @@ ifconfig_up()
local _cfg _ipv6_opts ifconfig_args
_cfg=1
+ # Make sure lo0 always comes up.
+ if [ "$1" = "lo0" ]; then
+ _cfg=0
+ fi
+
# ifconfig_IF
ifconfig_args=`ifconfig_getargs $1`
if [ -n "${ifconfig_args}" ]; then
@@ -95,25 +100,19 @@ ifconfig_up()
# inet6 specific
if afexists inet6; then
- if ipv6if $1; then
- if checkyesno ipv6_gateway_enable; then
- _ipv6_opts="-accept_rtadv"
- fi
- else
- if checkyesno ipv6_activate_all_interfaces; then
- _ipv6_opts="-ifdisabled"
- else
- _ipv6_opts="ifdisabled"
- fi
-
- # backward compatibility: $ipv6_enable
- case $ipv6_enable in
- [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
- _ipv6_opts="${_ipv6_opts} accept_rtadv"
- ;;
- esac
+ if checkyesno ipv6_activate_all_interfaces; then
+ _ipv6_opts="-ifdisabled"
+ elif [ "$1" != "lo0" ]; then
+ _ipv6_opts="ifdisabled"
fi
+ # backward compatibility: $ipv6_enable
+ case $ipv6_enable in
+ [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+ _ipv6_opts="${_ipv6_opts} accept_rtadv"
+ ;;
+ esac
+
if [ -n "${_ipv6_opts}" ]; then
ifconfig $1 inet6 ${_ipv6_opts}
fi
@@ -350,11 +349,8 @@ afexists()
_af=$1
case ${_af} in
- inet)
- ${SYSCTL_N} net.inet > /dev/null 2>&1
- ;;
- inet6)
- ${SYSCTL_N} net.inet6 > /dev/null 2>&1
+ inet|inet6)
+ check_kern_features ${_af}
;;
ipx)
${SYSCTL_N} net.ipx > /dev/null 2>&1
@@ -512,6 +508,13 @@ ipv4_up()
_if=$1
_ret=1
+ # Add 127.0.0.1/8 to lo0 unless otherwise specified.
+ if [ "${_if}" = "lo0" ]; then
+ ifconfig_args=`ifconfig_getargs ${_if}`
+ if [ -z "${ifconfig_args}" ]; then
+ ifconfig ${_if} inet 127.0.0.1/8 alias
+ fi
+ fi
ifalias_up ${_if} inet && _ret=0
ipv4_addrs_common ${_if} alias && _ret=0
diff --git a/etc/periodic/daily/800.scrub-zfs b/etc/periodic/daily/800.scrub-zfs
index 7ad99fe..b153b66 100755
--- a/etc/periodic/daily/800.scrub-zfs
+++ b/etc/periodic/daily/800.scrub-zfs
@@ -46,7 +46,7 @@ case "$daily_scrub_zfs_enable" in
esac
# determine how many days shall be between scrubs
- eval _pool_threshold=\${daily_scrub_zfs_${pool}_threshold}
+ eval _pool_threshold=\${daily_scrub_zfs_$(echo "${pool}"|tr ".:-" "_")_threshold}
if [ -z "${_pool_threshold}" ];then
_pool_threshold=${daily_scrub_zfs_default_threshold}
fi
diff --git a/etc/periodic/monthly/Makefile b/etc/periodic/monthly/Makefile
index 1e71afd..77c1d66 100644
--- a/etc/periodic/monthly/Makefile
+++ b/etc/periodic/monthly/Makefile
@@ -6,7 +6,7 @@ FILES= 999.local
# NB: keep these sorted by MK_* knobs
-.if ${MK_ACCT} != "no"
+.if ${MK_UTMPX} != "no"
FILES+= 200.accounting
.endif
diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile
index 887db41..65759df 100644
--- a/etc/rc.d/Makefile
+++ b/etc/rc.d/Makefile
@@ -18,11 +18,11 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
ip6addrctl ipfilter ipfs ipfw ipmon \
ipnat ipsec ipxrouted \
jail \
- kadmind kerberos keyserv kldxref kpasswdd \
+ kadmind kerberos keyserv kld kldxref kpasswdd \
ldconfig local localpkg lockd lpd \
mixer motd mountcritlocal mountcritremote mountlate \
mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \
- named natd netif netoptions \
+ named natd netif netoptions netwait \
newsyslog nfsclient nfscbd nfsd \
nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \
othermta \
diff --git a/etc/rc.d/kld b/etc/rc.d/kld
new file mode 100755
index 0000000..946ec69
--- /dev/null
+++ b/etc/rc.d/kld
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Copyright (c) 2011 Douglas Barton
+# All rights reserved.
+#
+# 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 AUTHOR 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 AUTHOR 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.
+#
+# $FreeBSD$
+#
+# PROVIDE: kld
+# REQUIRE: FILESYSTEMS
+# KEYWORD: nojail
+
+. /etc/rc.subr
+
+name="kld"
+
+start_cmd="${name}_start"
+stop_cmd=':'
+
+kld_start()
+{
+ [ -n "$kld_list" ] || return
+
+ local _kld
+
+ echo 'Loading kernel modules:'
+ for _kld in $kld_list ; do
+ load_kld -e ${_kld}.ko $_kld
+ done
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/etc/rc.d/mountcritremote b/etc/rc.d/mountcritremote
index ff965da..62e5079 100755
--- a/etc/rc.d/mountcritremote
+++ b/etc/rc.d/mountcritremote
@@ -4,7 +4,7 @@
#
# PROVIDE: mountcritremote
-# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec
+# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec netwait
# KEYWORD: nojail
. /etc/rc.subr
@@ -26,7 +26,7 @@ mountcritremote_precmd()
case "`mount -d -a -t nfs 2> /dev/null`" in
*mount_nfs*)
# Handle absent nfs client support
- load_kld -m nfs nfsclient || return 1
+ load_kld -m nfs nfscl || return 1
;;
esac
return 0
diff --git a/etc/rc.d/netwait b/etc/rc.d/netwait
new file mode 100755
index 0000000..d7a5184
--- /dev/null
+++ b/etc/rc.d/netwait
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: netwait
+# REQUIRE: NETWORKING
+# KEYWORD: nojail
+#
+# The netwait script is intended to be used by systems which have
+# statically-configured IP addresses in rc.conf(5). If your system
+# uses DHCP, you should use synchronous_dhclient="YES" in your
+# /etc/rc.conf instead of using netwait.
+
+. /etc/rc.subr
+
+name="netwait"
+rc_var=`set_rcvar`
+start_cmd="${name}_start"
+stop_cmd=":"
+
+netwait_start()
+{
+ local ip rc count output link
+
+ if [ -z "${netwait_ip}" ]; then
+ err 1 "You must define one or more IP addresses in netwait_ip"
+ fi
+
+ if [ ${netwait_timeout} -lt 1 ]; then
+ err 1 "netwait_timeout must be >= 1"
+ fi
+
+ # Handle SIGINT (Ctrl-C); force abort of while() loop
+ trap break SIGINT
+
+ if [ -n "${netwait_if}" ]; then
+ echo -n "Waiting for $netwait_if to have link"
+
+ count=1
+ while [ ${count} -le ${netwait_if_timeout} ]; do
+ if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then
+ link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'`
+ if [ -z "${link}" ]; then
+ echo '.'
+ break
+ fi
+ else
+ echo ''
+ err 1 "ifconfig ${netwait_if} failed"
+ fi
+ sleep 1
+ count=$((count+1))
+ done
+ if [ -n "${link}" ]; then
+ # Restore default SIGINT handler
+ trap - SIGINT
+
+ echo ''
+ warn "Interface still has no link. Continuing with startup, but"
+ warn "be aware you may not have a fully functional networking"
+ warn "layer at this point."
+ return
+ fi
+ fi
+
+ # Handle SIGINT (Ctrl-C); force abort of while() loop
+ trap break SIGINT
+
+ for ip in ${netwait_ip}; do
+ echo -n "Waiting for ${ip} to respond to ICMP"
+
+ count=1
+ while [ ${count} -le ${netwait_timeout} ]; do
+ /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1
+ rc=$?
+
+ if [ $rc -eq 0 ]; then
+ # Restore default SIGINT handler
+ trap - SIGINT
+
+ echo '.'
+ return
+ fi
+ count=$((count+1))
+ done
+ echo ': No response from host.'
+ done
+
+ # Restore default SIGINT handler
+ trap - SIGINT
+
+ warn "Exhausted IP list. Continuing with startup, but be aware you may"
+ warn "not have a fully functional networking layer at this point."
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/etc/rc.d/nfsclient b/etc/rc.d/nfsclient
index c97a52a..fa7906d 100755
--- a/etc/rc.d/nfsclient
+++ b/etc/rc.d/nfsclient
@@ -13,7 +13,7 @@ name="nfsclient"
rcvar="nfs_client_enable"
start_cmd="nfsclient_start"
stop_cmd="unmount_all"
-required_modules="nfsclient:oldnfs"
+required_modules="nfscl:nfs"
nfsclient_start()
{
diff --git a/etc/rc.d/rtadvd b/etc/rc.d/rtadvd
index 99b700d..2ead892 100755
--- a/etc/rc.d/rtadvd
+++ b/etc/rc.d/rtadvd
@@ -18,12 +18,6 @@ start_precmd="rtadvd_precmd"
rtadvd_precmd()
{
- if ! checkyesno ipv6_gateway_enable ; then
- warn \
- "${name} cannot be used on IPv6 host, only on an IPv6 router."
- return 1
- fi
-
# This should be enabled with a great care.
# You may want to fine-tune /etc/rtadvd.conf.
#
@@ -42,7 +36,7 @@ rtadvd_precmd()
#
case ${rtadvd_interfaces} in
[Aa][Uu][Tt][Oo]|'')
- for i in `ifconfig -l` ; do
+ for i in `list_net_interfaces`; do
case $i in
lo0) continue ;;
esac
diff --git a/etc/rc.d/var b/etc/rc.d/var
index 8e5bdde..0655658 100755
--- a/etc/rc.d/var
+++ b/etc/rc.d/var
@@ -28,7 +28,7 @@
#
# PROVIDE: var
-# REQUIRE: FILESYSTEMS
+# REQUIRE: FILESYSTEMS kld
. /etc/rc.subr
diff --git a/etc/rc.subr b/etc/rc.subr
index 4748e25..36cba6d 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -1062,7 +1062,7 @@ load_rc_config()
# Set defaults if defined.
for _var in $rcvar $rcvars; do
- _defval=`eval echo "\\\$${_var}_defval"`
+ eval _defval=\$${_var}_defval
if [ -n "$_defval" ]; then
eval : \${$_var:=\$${_var}_defval}
fi
@@ -1070,9 +1070,9 @@ load_rc_config()
# check obsolete rc.conf variables
for _var in $rcvars_obsolete; do
- _v=`eval echo \\$$_var`
- _msg=`eval echo \\$${_var}_obsolete_msg`
- _new=`eval echo \\$${_var}_newvar`
+ eval _v=\$$_var
+ eval _msg=\$${_var}_obsolete_msg
+ eval _new=\$${_var}_newvar
case $_v in
"")
;;
@@ -1732,7 +1732,27 @@ check_required_after()
return 0
}
-fi
+# check_kern_features mib
+# Return existence of kern.features.* sysctl MIB as true or
+# false. The result will be cached in $_rc_cache_kern_features_
+# namespace. "0" means the kern.features.X exists.
+
+check_kern_features()
+{
+ local _v
+
+ [ -n "$1" ] || return 1;
+ eval _v=\$_rc_cache_kern_features_$1
+ [ -n "$_v" ] && return "$_v";
+
+ if ${SYSCTL_N} kern.features.$1 > /dev/null 2>&1; then
+ eval _rc_cache_kern_features_$1=0
+ return 0
+ else
+ eval _rc_cache_kern_features_$1=1
+ return 1
+ fi
+}
# _echoonce var msg mode
# mode=0: Echo $msg if ${$var} is empty.
@@ -1743,7 +1763,7 @@ fi
_echoonce()
{
local _var _msg _mode
- _var=`eval echo \\$$1`
+ eval _var=\$$1
_msg=$2
_mode=$3
@@ -1753,4 +1773,6 @@ _echoonce()
esac
}
+fi # [ -z "${_rc_subr_loaded}" ]
+
_rc_subr_loaded=:
diff --git a/etc/sendmail/freebsd.mc b/etc/sendmail/freebsd.mc
index 4bf41a5..1e28c47 100644
--- a/etc/sendmail/freebsd.mc
+++ b/etc/sendmail/freebsd.mc
@@ -66,12 +66,10 @@ dnl so this file will not serve as a database of the available servers.
dnl For that, visit
dnl http://www.google.com/Top/Computers/Internet/E-mail/Spam/Blacklists/
-dnl Uncomment to activate Realtime Blackhole List
-dnl information available at http://www.mail-abuse.com/
-dnl NOTE: This is a subscription service as of July 31, 2001
-dnl FEATURE(dnsbl)
+dnl Uncomment to activate your chosen DNS based blacklist
+dnl FEATURE(dnsbl, `dnsbl.example.com')
dnl Alternatively, you can provide your own server and rejection message:
-dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', ``"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}'')
+dnl FEATURE(dnsbl, `dnsbl.example.com', ``"550 Mail from " $&{client_addr} " rejected'')
dnl Dialup users should uncomment and define this appropriately
dnl define(`SMART_HOST', `your.isp.mail.server')
diff --git a/etc/sendmail/freebsd.submit.mc b/etc/sendmail/freebsd.submit.mc
index 0fd8d63..c6ec655 100644
--- a/etc/sendmail/freebsd.submit.mc
+++ b/etc/sendmail/freebsd.submit.mc
@@ -25,4 +25,3 @@ define(`confBIND_OPTS', `WorkAroundBrokenAAAA')dnl
dnl
dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
FEATURE(`msp', `[127.0.0.1]')dnl
-
diff --git a/games/fortune/datfiles/fortunes b/games/fortune/datfiles/fortunes
index 7f2a7d4..5a52b18 100644
--- a/games/fortune/datfiles/fortunes
+++ b/games/fortune/datfiles/fortunes
@@ -2057,7 +2057,7 @@ promised me faithfully that you'd be back before six and here it is almost
nine. It just can't take that long to play 18 holes of golf."
"Honey, wait," said Harry. "Let me explain. I know what I promised
you, but I have a very good reason for being late. Fred and I tee'd off
-right on time and everything was find for the first three holes. Then, on
+right on time and everything was fine for the first three holes. Then, on
the fourth tee Fred had a stroke. I ran back to the clubhouse but couldn't
find a doctor. And, by the time I got back to Fred, he was dead. So, for
the next 15 holes, it was hit the ball, drag Fred, hit the ball, drag Fred...
@@ -25523,7 +25523,9 @@ him, prussic acid could solve our population problems in one generation.
%
If everybody minded their own business, the world would go
around a deal faster.
- -- The Duchess, "Through the Looking Glass"
+ -- The Duchess; Lewis Carroll,
+ "Through the Looking-Glass,
+ and What Alice Found There" (1871)
%
If everything is coming your way then you're in the wrong lane.
%
@@ -42420,7 +42422,7 @@ in peoples' memories never really happened.
Some of them want to use you,
Some of them want to be used by you,
...Everybody's looking for something.
- -- Eurythmics
+ -- Eurythmics, "Sweet Dreams (Are Made Of This)"
%
Some of us are becoming the men we wanted to marry.
-- Gloria Steinem
diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile
index 0ee257f..b222c47 100644
--- a/gnu/usr.bin/Makefile
+++ b/gnu/usr.bin/Makefile
@@ -11,7 +11,7 @@ SUBDIR= ${_binutils} \
${_dtc} \
${_gdb} \
${_gperf} \
- ${_grep} \
+ grep \
${_groff} \
patch \
${_rcs} \
@@ -27,10 +27,6 @@ _groff= groff
.endif
.endif
-.if ${MK_BSD_GREP} != "yes"
-_grep= grep
-.endif
-
.if ${MK_CVS} != "no"
_cvs= cvs
.endif
diff --git a/gnu/usr.bin/gdb/kgdb/kthr.c b/gnu/usr.bin/gdb/kgdb/kthr.c
index 5036c9c..461f408 100644
--- a/gnu/usr.bin/gdb/kgdb/kthr.c
+++ b/gnu/usr.bin/gdb/kgdb/kthr.c
@@ -28,6 +28,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/cpuset.h>
#include <sys/proc.h>
#include <sys/types.h>
#include <sys/signal.h>
@@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <defs.h>
#include <frame-unwind.h>
@@ -48,7 +50,7 @@ static CORE_ADDR dumppcb;
static int dumptid;
static CORE_ADDR stoppcbs;
-static __cpumask_t stopped_cpus;
+static cpuset_t stopped_cpus;
static struct kthr *first;
struct kthr *curkthr;
@@ -76,6 +78,7 @@ kgdb_thr_init(void)
{
struct proc p;
struct thread td;
+ long cpusetsize;
struct kthr *kt;
CORE_ADDR addr;
uintptr_t paddr;
@@ -102,10 +105,11 @@ kgdb_thr_init(void)
dumptid = -1;
addr = kgdb_lookup("stopped_cpus");
- if (addr != 0)
- kvm_read(kvm, addr, &stopped_cpus, sizeof(stopped_cpus));
- else
- stopped_cpus = 0;
+ CPU_ZERO(&stopped_cpus);
+ cpusetsize = sysconf(_SC_CPUSET_SIZE);
+ if (cpusetsize != -1 && (u_long)cpusetsize <= sizeof(cpuset_t) &&
+ addr != 0)
+ kvm_read(kvm, addr, &stopped_cpus, cpusetsize);
stoppcbs = kgdb_lookup("stoppcbs");
@@ -126,8 +130,8 @@ kgdb_thr_init(void)
kt->kaddr = addr;
if (td.td_tid == dumptid)
kt->pcb = dumppcb;
- else if (td.td_state == TDS_RUNNING && ((1 << td.td_oncpu) & stopped_cpus)
- && stoppcbs != 0)
+ else if (td.td_state == TDS_RUNNING && stoppcbs != 0 &&
+ CPU_ISSET(td.td_oncpu, &stopped_cpus))
kt->pcb = (uintptr_t) stoppcbs + sizeof(struct pcb) * td.td_oncpu;
else
kt->pcb = (uintptr_t)td.td_pcb;
diff --git a/gnu/usr.bin/grep/Makefile b/gnu/usr.bin/grep/Makefile
index b0c3988..7d3b607 100644
--- a/gnu/usr.bin/grep/Makefile
+++ b/gnu/usr.bin/grep/Makefile
@@ -1,35 +1,50 @@
# $FreeBSD$
+.include <bsd.own.mk>
+
GREP_LIBZ=YES
+.if ${MK_BSD_GREP} != "yes"
PROG= grep
+.else
+PROG= gnugrep
+.endif
SRCS= closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \
isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \
xstrtoumax.c
CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H
+.if ${MK_BSD_GREP} != "yes"
LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \
${BINDIR}/grep ${BINDIR}/fgrep
MLINKS= grep.1 egrep.1 grep.1 fgrep.1
+.endif
DPADD= ${LIBGNUREGEX} ${LIBBZ2}
LDADD= -lgnuregex -lbz2
+.if ${MK_BSD_GREP} != "yes"
LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \
${BINDIR}/grep ${BINDIR}/bzegrep \
${BINDIR}/grep ${BINDIR}/bzfgrep
MLINKS+=grep.1 bzgrep.1 grep.1 bzegrep.1 grep.1 bzfgrep.1
+.endif
.if defined(GREP_LIBZ) && !empty(GREP_LIBZ)
LDADD+= -lz
DPADD+= ${LIBZ}
CFLAGS+=-DHAVE_LIBZ=1
+.if ${MK_BSD_GREP} != "yes"
LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \
${BINDIR}/grep ${BINDIR}/zegrep \
${BINDIR}/grep ${BINDIR}/zfgrep
MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1
.endif
+.endif
+
+gnugrep.1: grep.1
+ cp ${.ALLSRC} ${.TARGET}
SUBDIR+=doc
diff --git a/gnu/usr.bin/groff/tmac/mdoc.local b/gnu/usr.bin/groff/tmac/mdoc.local
index d46f5db..befc87d 100644
--- a/gnu/usr.bin/groff/tmac/mdoc.local
+++ b/gnu/usr.bin/groff/tmac/mdoc.local
@@ -34,7 +34,6 @@
.\" FreeBSD .Lb values
.ds doc-str-Lb-libarchive Streaming Archive Library (libarchive, \-larchive)
.ds doc-str-Lb-libbluetooth Bluetooth User Library (libbluetooth, \-lbluetooth)
-.ds doc-str-Lb-libbsm Basic Security Module User Library (libbsm, \-lbsm)
.ds doc-str-Lb-libc_r Reentrant C\~Library (libc_r, \-lc_r)
.ds doc-str-Lb-libcalendar Calendar Arithmetic Library (libcalendar, \-lcalendar)
.ds doc-str-Lb-libcam Common Access Method User Library (libcam, \-lcam)
@@ -75,7 +74,7 @@
.
.\" FreeBSD releases not found in doc-common
.ds doc-operating-system-FreeBSD-7.4 7.4
-.ds doc-operating-system-FreeBSD-8.2 8.2
+.ds doc-operating-system-FreeBSD-8.3 8.3
.ds doc-operating-system-FreeBSD-9.0 9.0
.
.\" Definitions not (yet) in doc-syms
diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc
index 1febce2..144a920 100644
--- a/lib/clang/include/clang/Basic/Version.inc
+++ b/lib/clang/include/clang/Basic/Version.inc
@@ -5,6 +5,6 @@
#define CLANG_VERSION_MINOR 0
#define CLANG_VENDOR "FreeBSD "
-#define CLANG_VENDOR_SUFFIX " 20110502"
+#define CLANG_VENDOR_SUFFIX " 20110612"
-#define SVN_REVISION "130700"
+#define SVN_REVISION "132879"
diff --git a/lib/clang/libclangfrontend/Makefile b/lib/clang/libclangfrontend/Makefile
index 71f76b7..ff32c08 100644
--- a/lib/clang/libclangfrontend/Makefile
+++ b/lib/clang/libclangfrontend/Makefile
@@ -12,7 +12,6 @@ SRCS= ASTConsumers.cpp \
CompilerInvocation.cpp \
CreateInvocationFromCommandLine.cpp \
DependencyFile.cpp \
- DiagChecker.cpp \
FrontendAction.cpp \
FrontendActions.cpp \
FrontendOptions.cpp \
diff --git a/lib/clang/libllvmasmprinter/Makefile b/lib/clang/libllvmasmprinter/Makefile
index 7e5182c..26f113f 100644
--- a/lib/clang/libllvmasmprinter/Makefile
+++ b/lib/clang/libllvmasmprinter/Makefile
@@ -12,7 +12,7 @@ SRCS= ARMException.cpp \
DwarfCompileUnit.cpp \
DwarfDebug.cpp \
DwarfException.cpp \
- DwarfTableException.cpp \
- OcamlGCPrinter.cpp
+ OcamlGCPrinter.cpp \
+ Win64Exception.cpp
.include "../clang.lib.mk"
diff --git a/lib/clang/libllvmcodegen/Makefile b/lib/clang/libllvmcodegen/Makefile
index c7c55a2..c657316 100644
--- a/lib/clang/libllvmcodegen/Makefile
+++ b/lib/clang/libllvmcodegen/Makefile
@@ -71,6 +71,7 @@ SRCS= AggressiveAntiDepBreaker.cpp \
RegAllocGreedy.cpp \
RegAllocLinearScan.cpp \
RegAllocPBQP.cpp \
+ RegisterClassInfo.cpp \
RegisterCoalescer.cpp \
RegisterScavenging.cpp \
RenderMachineFunction.cpp \
diff --git a/lib/clang/libllvmmc/Makefile b/lib/clang/libllvmmc/Makefile
index a7ed25b..07b91ad 100644
--- a/lib/clang/libllvmmc/Makefile
+++ b/lib/clang/libllvmmc/Makefile
@@ -31,6 +31,7 @@ SRCS= ELFObjectWriter.cpp \
MCSectionMachO.cpp \
MCStreamer.cpp \
MCSymbol.cpp \
+ MCWin64EH.cpp \
MachObjectWriter.cpp \
TargetAsmBackend.cpp \
WinCOFFObjectWriter.cpp \
diff --git a/lib/clang/libllvmmipscodegen/Makefile b/lib/clang/libllvmmipscodegen/Makefile
index 47744ed..63e9e0e 100644
--- a/lib/clang/libllvmmipscodegen/Makefile
+++ b/lib/clang/libllvmmipscodegen/Makefile
@@ -5,6 +5,7 @@ LIB= llvmmipscodegen
SRCDIR= lib/Target/Mips
SRCS= MipsAsmPrinter.cpp \
MipsDelaySlotFiller.cpp \
+ MipsEmitGPRestore.cpp \
MipsExpandPseudo.cpp \
MipsFrameLowering.cpp \
MipsISelDAGToDAG.cpp \
diff --git a/lib/libc/db/btree/bt_split.c b/lib/libc/db/btree/bt_split.c
index ca8b16a..f0db406 100644
--- a/lib/libc/db/btree/bt_split.c
+++ b/lib/libc/db/btree/bt_split.c
@@ -37,6 +37,7 @@ static char sccsid[] = "@(#)bt_split.c 8.10 (Berkeley) 1/9/95";
__FBSDID("$FreeBSD$");
#include <sys/types.h>
+#include <sys/param.h>
#include <limits.h>
#include <stdio.h>
@@ -482,7 +483,7 @@ bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
WR_RINTERNAL(dest,
l->flags & P_RLEAF ? NEXTINDEX(l) : rec_total(l), l->pgno);
- h->linp[1] = h->upper -= NRINTERNAL;
+ __PAST_END(h->linp, 1) = h->upper -= NRINTERNAL;
dest = (char *)h + h->upper;
WR_RINTERNAL(dest,
r->flags & P_RLEAF ? NEXTINDEX(r) : rec_total(r), r->pgno);
@@ -534,7 +535,7 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
case P_BLEAF:
bl = GETBLEAF(r, 0);
nbytes = NBINTERNAL(bl->ksize);
- h->linp[1] = h->upper -= nbytes;
+ __PAST_END(h->linp, 1) = h->upper -= nbytes;
dest = (char *)h + h->upper;
WR_BINTERNAL(dest, bl->ksize, r->pgno, 0);
memmove(dest, bl->bytes, bl->ksize);
@@ -550,7 +551,7 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r)
case P_BINTERNAL:
bi = GETBINTERNAL(r, 0);
nbytes = NBINTERNAL(bi->ksize);
- h->linp[1] = h->upper -= nbytes;
+ __PAST_END(h->linp, 1) = h->upper -= nbytes;
dest = (char *)h + h->upper;
memmove(dest, bi, nbytes);
((BINTERNAL *)dest)->pgno = r->pgno;
diff --git a/lib/libc/db/man/mpool.3 b/lib/libc/db/man/mpool.3
index 3de51c3..5af7d27 100644
--- a/lib/libc/db/man/mpool.3
+++ b/lib/libc/db/man/mpool.3
@@ -28,7 +28,7 @@
.\" @(#)mpool.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd February 25, 1999
+.Dd June 17, 2011
.Dt MPOOL 3
.Os
.Sh NAME
@@ -147,7 +147,14 @@ is returned and
is set.
The
.Fa flags
-argument is not currently used.
+argument is specified by
+.Em or Ns 'ing
+any of the following values:
+.Bl -tag -width indent
+.It Dv MPOOL_IGNOREPIN
+The page returned is not pinned;
+page will otherwise be pinned on return.
+.El
.Pp
The
.Fn mpool_put
diff --git a/lib/libc/gen/basename.3 b/lib/libc/gen/basename.3
index 4a3743a..bcdd99e 100644
--- a/lib/libc/gen/basename.3
+++ b/lib/libc/gen/basename.3
@@ -1,33 +1,22 @@
+.\" $OpenBSD: basename.3,v 1.20 2007/05/31 19:19:28 jmc Exp $
.\"
.\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
-.\" All rights reserved.
.\"
-.\" 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. The name of the author may not be used to endorse or promote products
-.\" derived from this software without specific prior written permission.
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
.\"
-.\" THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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.
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $
.\" $FreeBSD$
.\"
-.Dd October 6, 2009
+.Dd March 31, 2010
.Dt BASENAME 3
.Os
.Sh NAME
@@ -42,8 +31,7 @@
.Sh DESCRIPTION
The
.Fn basename
-function
-returns the last component from the pathname pointed to by
+function returns the last component from the pathname pointed to by
.Fa path ,
deleting any trailing
.Sq \&/
@@ -111,4 +99,15 @@ function first appeared in
and
.Fx 4.2 .
.Sh AUTHORS
-.An "Todd C. Miller" Aq Todd.Miller@courtesan.com
+.An Todd C. Miller
+.Sh CAVEATS
+.Fn basename
+returns a pointer to internal static storage space that will be overwritten
+by subsequent calls.
+.Pp
+Other vendor implementations of
+.Fn basename
+may modify the contents of the string passed to
+.Fn basename ;
+this should be taken into account when writing code which calls this function
+if portability is desired.
diff --git a/lib/libc/gen/basename.c b/lib/libc/gen/basename.c
index 9588c28..f2bfe5f 100644
--- a/lib/libc/gen/basename.c
+++ b/lib/libc/gen/basename.c
@@ -1,35 +1,21 @@
+/* $OpenBSD: basename.c,v 1.14 2005/08/08 08:05:33 espie Exp $ */
+
/*
- * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
- * All rights reserved.
+ * Copyright (c) 1997, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
*
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
- * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if 0
-#ifndef lint
-static char rcsid[] = "$OpenBSD: basename.c,v 1.4 1999/05/30 17:10:30 espie Exp $";
-#endif /* not lint */
-#endif
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -40,27 +26,28 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
char *
-basename_r(path, bname)
- const char *path;
- char *bname;
+basename_r(const char *path, char *bname)
{
const char *endp, *startp;
+ size_t len;
/* Empty or NULL string gets treated as "." */
if (path == NULL || *path == '\0') {
- (void)strcpy(bname, ".");
- return(bname);
+ bname[0] = '.';
+ bname[1] = '\0';
+ return (bname);
}
- /* Strip trailing slashes */
+ /* Strip any trailing slashes */
endp = path + strlen(path) - 1;
while (endp > path && *endp == '/')
endp--;
/* All slashes becomes "/" */
if (endp == path && *endp == '/') {
- (void)strcpy(bname, "/");
- return(bname);
+ bname[0] = '/';
+ bname[1] = '\0';
+ return (bname);
}
/* Find the start of the base */
@@ -68,18 +55,18 @@ basename_r(path, bname)
while (startp > path && *(startp - 1) != '/')
startp--;
- if (endp - startp + 2 > MAXPATHLEN) {
+ len = endp - startp + 1;
+ if (len >= MAXPATHLEN) {
errno = ENAMETOOLONG;
- return(NULL);
+ return (NULL);
}
- (void)strncpy(bname, startp, endp - startp + 1);
- bname[endp - startp + 1] = '\0';
- return(bname);
+ memcpy(bname, startp, len);
+ bname[len] = '\0';
+ return (bname);
}
char *
-basename(path)
- const char *path;
+basename(const char *path)
{
static char *bname = NULL;
diff --git a/lib/libc/gen/feature_present.3 b/lib/libc/gen/feature_present.3
index 9a4269e..3a702d4 100644
--- a/lib/libc/gen/feature_present.3
+++ b/lib/libc/gen/feature_present.3
@@ -29,7 +29,7 @@
.\" $FreeBSD$
.\"
.Dd January 8, 2008
-.Dt feature_present 3
+.Dt FEATURE_PRESENT 3
.Os
.Sh NAME
.Nm feature_present
diff --git a/lib/libc/gen/ftw.c b/lib/libc/gen/ftw.c
index 0177712..bfaf121 100644
--- a/lib/libc/gen/ftw.c
+++ b/lib/libc/gen/ftw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftw.c,v 1.4 2004/07/07 16:05:23 millert Exp $ */
+/* $OpenBSD: ftw.c,v 1.5 2005/08/08 08:05:34 espie Exp $ */
/*
* Copyright (c) 2003, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -20,12 +20,6 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
-#if 0
-#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$OpenBSD: ftw.c,v 1.4 2004/07/07 16:05:23 millert Exp $";
-#endif /* LIBC_SCCS and not lint */
-#endif
-
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3
index 7569239..3d902bf 100644
--- a/lib/libc/gen/posix_spawn.3
+++ b/lib/libc/gen/posix_spawn.3
@@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 24, 2008
+.Dd June 17, 2011
.Dt POSIX_SPAWN 3
.Os
.Sh NAME
@@ -384,29 +384,28 @@ the child process exits with exit status 127).
.It
If the
.Fa file_actions
-argument is not NULL, and specifies any close, dup2, or open actions to be
+argument is not NULL, and specifies any dup2 or open actions to be
performed, and if
.Fn posix_spawn
or
.Fn posix_spawnp
fails for any of the reasons that would cause
-.Fn close ,
-.Fn dup2 ,
+.Fn dup2
or
.Fn open
to fail, an error value is returned as described by
-.Fn close ,
-.Fn dup2 ,
+.Fn dup2
and
.Fn open ,
respectively (or, if the error occurs after the calling process successfully
returns, the child process exits with exit status 127). An open file action
may, by itself, result in any of the errors described by
-.Fn close
-or
.Fn dup2 ,
in addition to those described by
.Fn open .
+This implementation ignores any errors from
+.Fn close ,
+including trying to close a descriptor that is not open.
.El
.Sh SEE ALSO
.Xr close 2 ,
@@ -443,7 +442,13 @@ The
and
.Fn posix_spawnp
functions conform to
-.St -p1003.1-2001 .
+.St -p1003.1-2001 ,
+except that they ignore all errors from
+.Fn close .
+A future update of the Standard is expected to require that these functions
+not fail because a file descriptor to be closed (via
+.Fn posix_spawn_file_actions_addclose )
+is not open.
.Sh HISTORY
The
.Fn posix_spawn
diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c
index 20f2c16..58044b3 100644
--- a/lib/libc/gen/posix_spawn.c
+++ b/lib/libc/gen/posix_spawn.c
@@ -163,11 +163,8 @@ process_file_actions_entry(posix_spawn_file_actions_entry_t *fae)
return (errno);
break;
case FAE_CLOSE:
- /* Perform a close() */
- if (_close(fae->fae_fildes) != 0) {
- if (errno == EBADF)
- return (EBADF);
- }
+ /* Perform a close(), do not fail if already closed */
+ (void)_close(fae->fae_fildes);
break;
}
return (0);
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 7539d61..80ae626 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -599,11 +599,11 @@ yesno:
#ifdef _SC_CPUSET_SIZE
case _SC_CPUSET_SIZE:
- len = sizeof(lvalue);
- if (sysctlbyname("kern.sched.cpusetsize", &lvalue, &len, NULL,
+ len = sizeof(value);
+ if (sysctlbyname("kern.sched.cpusetsize", &value, &len, NULL,
0) == -1)
return (-1);
- return (lvalue);
+ return ((long)value);
#endif
default:
diff --git a/lib/libc/iconv/Symbol.map b/lib/libc/iconv/Symbol.map
index 515cddc..73e0e22 100644
--- a/lib/libc/iconv/Symbol.map
+++ b/lib/libc/iconv/Symbol.map
@@ -6,6 +6,18 @@ FBSD_1.2 {
__iconv;
__iconv_free_list;
__iconv_get_list;
+ _libiconv_version;
+ iconv_canonicalize;
+ libiconv;
+ libiconv_close;
+ libiconv_open;
+ libiconv_open_into;
+ libiconv_set_relocation_prefix;
+ libiconvctl;
+ libiconvlist;
+};
+
+FBSDprivate_1.0 {
_citrus_bcs_convert_to_lower;
_citrus_bcs_convert_to_upper;
_citrus_bcs_isalnum;
@@ -89,13 +101,4 @@ FBSD_1.2 {
_citrus_stdenc_close;
_citrus_stdenc_open;
_citrus_unmap_file;
- _libiconv_version;
- iconv_canonicalize;
- libiconv;
- libiconv_close;
- libiconv_open;
- libiconv_open_into;
- libiconv_set_relocation_prefix;
- libiconvctl;
- libiconvlist;
};
diff --git a/lib/libc/iconv/citrus_mapper.c b/lib/libc/iconv/citrus_mapper.c
index a788a9d9..b5ae96d 100644
--- a/lib/libc/iconv/citrus_mapper.c
+++ b/lib/libc/iconv/citrus_mapper.c
@@ -337,7 +337,9 @@ _citrus_mapper_open(struct _citrus_mapper_area *__restrict ma,
goto quit;
/* open mapper */
+ UNLOCK;
ret = mapper_open(ma, &cm, module, variable);
+ WLOCK;
if (ret)
goto quit;
cm->cm_key = strdup(mapname);
diff --git a/lib/libc/iconv/iconv.c b/lib/libc/iconv/iconv.c
index 2cd38df..d1e01e8 100644
--- a/lib/libc/iconv/iconv.c
+++ b/lib/libc/iconv/iconv.c
@@ -85,7 +85,7 @@ _iconv_open(const char *out, const char *in, struct _citrus_iconv *prealloc)
errno = ENOMEM;
return ((iconv_t)-1);
}
-
+
p = out_truncated;
while (*p != 0) {
if (p[0] == '/' && p[1] == '/') {
diff --git a/lib/libc/iconv/iconvctl.3 b/lib/libc/iconv/iconvctl.3
index 29007c1..30fc0aa 100644
--- a/lib/libc/iconv/iconvctl.3
+++ b/lib/libc/iconv/iconvctl.3
@@ -150,6 +150,9 @@ facility is a non-standard extension, which appeared in
the GNU implementation and was adopted in
.Fx 9
for compatibility's sake.
+.Sh AUTHORS
+This manual page was written by
+.An Gabor Kovesdan Aq gabor@FreeBSD.org .
.Sh BUGS
Transliteration is enabled in this implementation by default, so it
is impossible by design to turn it off.
@@ -157,6 +160,3 @@ Accordingly, trying to turn it off will always fail and \-1 will be
returned.
Getting the transliteration state will always succeed and indicate
that it is turned on, though.
-.Sh AUTHORS
-This manual page was written by
-.An Gabor Kovesdan Aq gabor@FreeBSD.org .
diff --git a/lib/libc/net/sctp_opt_info.3 b/lib/libc/net/sctp_opt_info.3
index f010613..df8faa6 100644
--- a/lib/libc/net/sctp_opt_info.3
+++ b/lib/libc/net/sctp_opt_info.3
@@ -32,7 +32,7 @@
.\" From: @(#)send.2 8.2 (Berkeley) 2/21/94
.\" $FreeBSD$
.\"
-.Dd December 15, 2006
+.Dd June 18, 2011
.Dt SCTP_OPT_INFO 3
.Os
.Sh NAME
@@ -76,14 +76,30 @@ socket options.
.Pp
.Dv SCTP_PRIMARY_ADDR
.Pp
-.Dv SCTP_SET_PEER_PRIMARY_ADDR
+.Dv SCTP_PEER_ADDR_PARAMS
.Pp
-.Dv SCTP_STATUS
+.Dv SCTP_DEFAULT_SEND_PARAM
.Pp
-.Dv SCTP_GET_PEER_ADDR_INFO
+.Dv SCTP_MAX_SEG
.Pp
.Dv SCTP_AUTH_ACTIVE_KEY
.Pp
+.Dv SCTP_DELAYED_SACK
+.Pp
+.Dv SCTP_MAX_BURST
+.Pp
+.Dv SCTP_CONTEXT
+.Pp
+.Dv SCTP_EVENT
+.Pp
+.Dv SCTP_DEFAULT_SNDINFO
+.Pp
+.Dv SCTP_DEFAULT_PRINFO
+.Pp
+.Dv SCTP_STATUS
+.Pp
+.Dv SCTP_GET_PEER_ADDR_INFO
+.Pp
.Dv SCTP_PEER_AUTH_CHUNKS
.Pp
.Dv SCTP_LOCAL_AUTH_CHUNKS
@@ -115,3 +131,14 @@ is not a socket.
.Sh SEE ALSO
.Xr getsockopt 2 ,
.Xr sctp 4
+.Sh BUGS
+Because the structure used for
+.Fa arg
+of the
+.Dv SCTP_MAX_BURST
+socket option has changed in FreeBSD 9.0 and higher,
+using
+.Dv SCTP_MAX_BURST
+as
+.Fa opt
+is only supported in FreeBSD 9.0 and higher.
diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c
index 0921669..27664bc 100644
--- a/lib/libc/net/sctp_sys_calls.c
+++ b/lib/libc/net/sctp_sys_calls.c
@@ -141,7 +141,7 @@ in6_sin6_2_sin(struct sockaddr_in *sin, struct sockaddr_in6 *sin6)
int
sctp_getaddrlen(sa_family_t family)
{
- int error, sd;
+ int ret, sd;
socklen_t siz;
struct sctp_assoc_value av;
@@ -151,13 +151,15 @@ sctp_getaddrlen(sa_family_t family)
sd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);
#elif defined(AF_INET6)
sd = socket(AF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP);
+#else
+ sd = -1;
#endif
if (sd == -1) {
return (-1);
}
- error = getsockopt(sd, IPPROTO_SCTP, SCTP_GET_ADDR_LEN, &av, &siz);
+ ret = getsockopt(sd, IPPROTO_SCTP, SCTP_GET_ADDR_LEN, &av, &siz);
close(sd);
- if (error == 0) {
+ if (ret == 0) {
return ((int)av.assoc_value);
} else {
return (-1);
@@ -363,9 +365,6 @@ sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size)
case SCTP_DEFAULT_SEND_PARAM:
((struct sctp_assocparams *)arg)->sasoc_assoc_id = id;
break;
- case SCTP_SET_PEER_PRIMARY_ADDR:
- ((struct sctp_setpeerprim *)arg)->sspp_assoc_id = id;
- break;
case SCTP_PRIMARY_ADDR:
((struct sctp_setprim *)arg)->ssp_assoc_id = id;
break;
@@ -402,6 +401,18 @@ sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size)
case SCTP_TIMEOUTS:
((struct sctp_timeouts *)arg)->stimo_assoc_id = id;
break;
+ case SCTP_EVENT:
+ ((struct sctp_event *)arg)->se_assoc_id = id;
+ break;
+ case SCTP_DEFAULT_SNDINFO:
+ ((struct sctp_sndinfo *)arg)->snd_assoc_id = id;
+ break;
+ case SCTP_DEFAULT_PRINFO:
+ ((struct sctp_default_prinfo *)arg)->pr_assoc_id = id;
+ break;
+ case SCTP_MAX_BURST:
+ ((struct sctp_assoc_value *)arg)->assoc_id = id;
+ break;
default:
break;
}
@@ -919,32 +930,297 @@ sctp_recvmsg(int s,
#endif
}
+ssize_t
+sctp_recvv(int sd,
+ const struct iovec *iov,
+ int iovlen,
+ struct sockaddr *from,
+ socklen_t * fromlen,
+ void *info,
+ socklen_t * infolen,
+ unsigned int *infotype,
+ int *flags)
+{
+ char ctlbuf[SCTP_CONTROL_VEC_SIZE_RCV];
+ struct msghdr msg;
+ struct cmsghdr *cmsg;
+ ssize_t n;
+ struct sctp_rcvinfo *rcvinfo;
+ struct sctp_nxtinfo *nxtinfo;
-#if defined(HAVE_SCTP_PEELOFF_SOCKOPT)
-#include <netinet/sctp_peeloff.h>
+ if (((info != NULL) && (infolen == NULL)) |
+ ((info == NULL) && (infolen != NULL) && (*infolen != 0)) ||
+ ((info != NULL) && (infotype == NULL))) {
+ errno = EINVAL;
+ return (-1);
+ }
+ if (infotype) {
+ *infotype = SCTP_RECVV_NOINFO;
+ }
+ msg.msg_name = from;
+ if (fromlen == NULL) {
+ msg.msg_namelen = 0;
+ } else {
+ msg.msg_namelen = *fromlen;
+ }
+ msg.msg_iov = (struct iovec *)iov;
+ msg.msg_iovlen = iovlen;
+ msg.msg_control = ctlbuf;
+ msg.msg_controllen = sizeof(ctlbuf);
+ errno = 0;
+ n = recvmsg(sd, &msg, *flags);
+ *flags = msg.msg_flags;
+ if ((n > 0) &&
+ (msg.msg_controllen > 0) &&
+ (infotype != NULL) &&
+ (infolen != NULL) &&
+ (*infolen > 0)) {
+ rcvinfo = NULL;
+ nxtinfo = NULL;
+ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
+ if (cmsg->cmsg_level != IPPROTO_SCTP) {
+ continue;
+ }
+ if (cmsg->cmsg_type == SCTP_RCVINFO) {
+ rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmsg);
+ }
+ if (cmsg->cmsg_type == SCTP_NXTINFO) {
+ nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmsg);
+ }
+ if (rcvinfo && nxtinfo) {
+ break;
+ }
+ }
+ if (rcvinfo) {
+ if (nxtinfo) {
+ if (*infolen >= sizeof(struct sctp_recvv_rn)) {
+ struct sctp_recvv_rn *rn_info;
+
+ rn_info = (struct sctp_recvv_rn *)info;
+ rn_info->recvv_rcvinfo = *rcvinfo;
+ rn_info->recvv_nxtinfo = *nxtinfo;
+ *infolen = (socklen_t) sizeof(struct sctp_recvv_rn);
+ *infotype = SCTP_RECVV_RN;
+ }
+ } else {
+ if (*infolen >= sizeof(struct sctp_rcvinfo)) {
+ memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo));
+ *infolen = (socklen_t) sizeof(struct sctp_rcvinfo);
+ *infotype = SCTP_RECVV_RCVINFO;
+ }
+ }
+ } else if (nxtinfo) {
+ if (*infolen >= sizeof(struct sctp_rcvinfo)) {
+ memcpy(info, nxtinfo, sizeof(struct sctp_nxtinfo));
+ *infolen = (socklen_t) sizeof(struct sctp_nxtinfo);
+ *infotype = SCTP_RECVV_NXTINFO;
+ }
+ }
+ }
+ return (n);
+}
-int
-sctp_peeloff(int sd, sctp_assoc_t assoc_id)
+ssize_t
+sctp_sendv(int sd,
+ const struct iovec *iov, int iovcnt,
+ struct sockaddr *addrs, int addrcnt,
+ void *info, socklen_t infolen, unsigned int infotype,
+ int flags)
{
- struct sctp_peeloff_opt peeloff;
- int result;
- socklen_t optlen;
-
- /* set in the socket option params */
- memset(&peeloff, 0, sizeof(peeloff));
- peeloff.s = sd;
- peeloff.assoc_id = assoc_id;
- optlen = sizeof(peeloff);
- result = getsockopt(sd, IPPROTO_SCTP, SCTP_PEELOFF, (void *)&peeloff, &optlen);
-
- if (result < 0) {
+ ssize_t ret;
+ int i;
+ socklen_t addr_len;
+ struct msghdr msg;
+ in_port_t port;
+ struct sctp_sendv_spa *spa_info;
+ struct cmsghdr *cmsg;
+ char *cmsgbuf;
+ struct sockaddr *addr;
+ struct sockaddr_in *addr_in;
+ struct sockaddr_in6 *addr_in6;
+
+ if ((addrcnt < 0) ||
+ (iovcnt < 0) ||
+ ((addrs == NULL) && (addrcnt > 0)) ||
+ ((addrs != NULL) && (addrcnt == 0)) ||
+ ((iov == NULL) && (iovcnt > 0)) ||
+ ((iov != NULL) && (iovcnt == 0))) {
+ errno = EINVAL;
return (-1);
- } else {
- return (peeloff.new_sd);
}
+ cmsgbuf = malloc(CMSG_SPACE(sizeof(struct sctp_sndinfo)) +
+ CMSG_SPACE(sizeof(struct sctp_prinfo)) +
+ CMSG_SPACE(sizeof(struct sctp_authinfo)) +
+ addrcnt * CMSG_SPACE(sizeof(struct in6_addr)));
+ if (cmsgbuf == NULL) {
+ errno = ENOBUFS;
+ return (-1);
+ }
+ msg.msg_control = cmsgbuf;
+ msg.msg_controllen = 0;
+ cmsg = (struct cmsghdr *)cmsgbuf;
+ switch (infotype) {
+ case SCTP_SENDV_NOINFO:
+ if ((infolen != 0) || (info != NULL)) {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ break;
+ case SCTP_SENDV_SNDINFO:
+ if ((info == NULL) || (infolen < sizeof(struct sctp_sndinfo))) {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ cmsg->cmsg_level = IPPROTO_SCTP;
+ cmsg->cmsg_type = SCTP_SNDINFO;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndinfo));
+ memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_sndinfo));
+ msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo));
+ cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo)));
+ break;
+ case SCTP_SENDV_PRINFO:
+ if ((info == NULL) || (infolen < sizeof(struct sctp_prinfo))) {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ cmsg->cmsg_level = IPPROTO_SCTP;
+ cmsg->cmsg_type = SCTP_PRINFO;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_prinfo));
+ memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_prinfo));
+ msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_prinfo));
+ cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo)));
+ break;
+ case SCTP_SENDV_AUTHINFO:
+ if ((info == NULL) || (infolen < sizeof(struct sctp_authinfo))) {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ cmsg->cmsg_level = IPPROTO_SCTP;
+ cmsg->cmsg_type = SCTP_AUTHINFO;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_authinfo));
+ memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_authinfo));
+ msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_authinfo));
+ cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo)));
+ break;
+ case SCTP_SENDV_SPA:
+ if ((info == NULL) || (infolen < sizeof(struct sctp_sendv_spa))) {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ spa_info = (struct sctp_sendv_spa *)info;
+ if (spa_info->sendv_flags & SCTP_SEND_SNDINFO_VALID) {
+ cmsg->cmsg_level = IPPROTO_SCTP;
+ cmsg->cmsg_type = SCTP_SNDINFO;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndinfo));
+ memcpy(CMSG_DATA(cmsg), &spa_info->sendv_sndinfo, sizeof(struct sctp_sndinfo));
+ msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo));
+ cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo)));
+ }
+ if (spa_info->sendv_flags & SCTP_SEND_PRINFO_VALID) {
+ cmsg->cmsg_level = IPPROTO_SCTP;
+ cmsg->cmsg_type = SCTP_PRINFO;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_prinfo));
+ memcpy(CMSG_DATA(cmsg), &spa_info->sendv_prinfo, sizeof(struct sctp_prinfo));
+ msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_prinfo));
+ cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo)));
+ }
+ if (spa_info->sendv_flags & SCTP_SEND_AUTHINFO_VALID) {
+ cmsg->cmsg_level = IPPROTO_SCTP;
+ cmsg->cmsg_type = SCTP_AUTHINFO;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_authinfo));
+ memcpy(CMSG_DATA(cmsg), &spa_info->sendv_authinfo, sizeof(struct sctp_authinfo));
+ msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_authinfo));
+ cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo)));
+ }
+ break;
+ default:
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ addr = addrs;
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+
+ for (i = 0; i < addrcnt; i++) {
+ switch (addr->sa_family) {
+ case AF_INET:
+ addr_len = (socklen_t) sizeof(struct sockaddr_in);
+ addr_in = (struct sockaddr_in *)addr;
+ if (addr_in->sin_len != addr_len) {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ if (i == 0) {
+ port = addr_in->sin_port;
+ } else {
+ if (port == addr_in->sin_port) {
+ cmsg->cmsg_level = IPPROTO_SCTP;
+ cmsg->cmsg_type = SCTP_DSTADDRV4;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr));
+ memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr));
+ msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr));
+ cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr)));
+ } else {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ }
+ break;
+ case AF_INET6:
+ addr_len = (socklen_t) sizeof(struct sockaddr_in6);
+ addr_in6 = (struct sockaddr_in6 *)addr;
+ if (addr_in6->sin6_len != addr_len) {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ if (i == 0) {
+ port = addr_in6->sin6_port;
+ } else {
+ if (port == addr_in6->sin6_port) {
+ cmsg->cmsg_level = IPPROTO_SCTP;
+ cmsg->cmsg_type = SCTP_DSTADDRV6;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr));
+ memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr));
+ msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr));
+ cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr)));
+ } else {
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ }
+ break;
+ default:
+ free(cmsgbuf);
+ errno = EINVAL;
+ return (-1);
+ }
+ if (i == 0) {
+ msg.msg_name = addr;
+ msg.msg_namelen = addr_len;
+ }
+ addr = (struct sockaddr *)((caddr_t)addr + addr_len);
+ }
+ if (msg.msg_controllen == 0) {
+ msg.msg_control = NULL;
+ }
+ msg.msg_iov = (struct iovec *)iov;
+ msg.msg_iovlen = iovcnt;
+ msg.msg_flags = 0;
+ ret = sendmsg(sd, &msg, flags);
+ free(cmsgbuf);
+ return (ret);
}
-#endif
#if !defined(SYS_sctp_peeloff) && !defined(HAVE_SCTP_PEELOFF_SOCKOPT)
diff --git a/lib/libc/sys/wait.2 b/lib/libc/sys/wait.2
index 2e084d2..e4812fc 100644
--- a/lib/libc/sys/wait.2
+++ b/lib/libc/sys/wait.2
@@ -66,6 +66,19 @@ the
.Fa status
area contains termination information about the process that exited
as defined below.
+The
+.Fn wait
+call is the same as
+.Fn wait4
+with a
+.Fa wpid
+value of -1,
+with an
+.Fa options
+value of zero,
+and a
+.Fa rusage
+value of zero.
.Pp
The
.Fn wait4
diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
index dcfcf74..3a501f5 100644
--- a/lib/libcompiler_rt/Makefile
+++ b/lib/libcompiler_rt/Makefile
@@ -41,6 +41,8 @@ SRCF= absvdi2 \
ctzti2 \
divdc3 \
divdi3 \
+ divmoddi4 \
+ divmodsi4 \
divsc3 \
divti3 \
divxc3 \
@@ -114,6 +116,7 @@ SRCF= absvdi2 \
ucmpti2 \
udivdi3 \
udivmoddi4 \
+ udivmodsi4 \
udivmodti4 \
udivti3 \
umoddi3 \
@@ -134,6 +137,8 @@ SRCF+= adddf3 \
modsi3 \
muldf3 \
mulsf3 \
+ subdf3 \
+ subsf3 \
truncdfsf2 \
udivsi3 \
umodsi3
diff --git a/lib/libiconv/Makefile b/lib/libiconv/Makefile
index 078771e..71c2885 100644
--- a/lib/libiconv/Makefile
+++ b/lib/libiconv/Makefile
@@ -19,7 +19,6 @@ SRCS= citrus_bcs.c citrus_bcs_strtol.c citrus_bcs_strtoul.c \
citrus_module.c citrus_none.c citrus_pivot_factory.c \
citrus_prop.c citrus_stdenc.c iconv.c
-WARNS?= 6
CFLAGS+= --param max-inline-insns-single=128 -I ${.CURDIR}/../../include -I${.CURDIR}/../libc/include
.include <bsd.lib.mk>
diff --git a/lib/libkvm/kvm_pcpu.c b/lib/libkvm/kvm_pcpu.c
index fd09fc8..bc73baf 100644
--- a/lib/libkvm/kvm_pcpu.c
+++ b/lib/libkvm/kvm_pcpu.c
@@ -39,11 +39,13 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/cpuset.h>
#include <sys/pcpu.h>
#include <sys/sysctl.h>
#include <kvm.h>
#include <limits.h>
#include <stdlib.h>
+#include <unistd.h>
#include "kvm_private.h"
@@ -118,6 +120,9 @@ _kvm_pcpu_clear(void)
void *
kvm_getpcpu(kvm_t *kd, int cpu)
{
+ long kcpusetsize;
+ ssize_t nbytes;
+ uintptr_t readptr;
char *buf;
if (kd == NULL) {
@@ -125,6 +130,10 @@ kvm_getpcpu(kvm_t *kd, int cpu)
return (NULL);
}
+ kcpusetsize = sysconf(_SC_CPUSET_SIZE);
+ if (kcpusetsize == -1 || (u_long)kcpusetsize > sizeof(cpuset_t))
+ return ((void *)-1);
+
if (maxcpu == 0)
if (_kvm_pcpu_init(kd) < 0)
return ((void *)-1);
@@ -137,8 +146,26 @@ kvm_getpcpu(kvm_t *kd, int cpu)
_kvm_err(kd, kd->program, "out of memory");
return ((void *)-1);
}
- if (kvm_read(kd, (uintptr_t)pcpu_data[cpu], buf, sizeof(struct pcpu)) !=
- sizeof(struct pcpu)) {
+ nbytes = sizeof(struct pcpu) - 2 * kcpusetsize;
+ readptr = (uintptr_t)pcpu_data[cpu];
+ if (kvm_read(kd, readptr, buf, nbytes) != nbytes) {
+ _kvm_err(kd, kd->program, "unable to read per-CPU data");
+ free(buf);
+ return ((void *)-1);
+ }
+
+ /* Fetch the valid cpuset_t objects. */
+ CPU_ZERO((cpuset_t *)(buf + nbytes));
+ CPU_ZERO((cpuset_t *)(buf + nbytes + sizeof(cpuset_t)));
+ readptr += nbytes;
+ if (kvm_read(kd, readptr, buf + nbytes, kcpusetsize) != kcpusetsize) {
+ _kvm_err(kd, kd->program, "unable to read per-CPU data");
+ free(buf);
+ return ((void *)-1);
+ }
+ readptr += kcpusetsize;
+ if (kvm_read(kd, readptr, buf + nbytes + sizeof(cpuset_t),
+ kcpusetsize) != kcpusetsize) {
_kvm_err(kd, kd->program, "unable to read per-CPU data");
free(buf);
return ((void *)-1);
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c
index 4aae61a..485a4f2 100644
--- a/lib/libmemstat/memstat_uma.c
+++ b/lib/libmemstat/memstat_uma.c
@@ -27,6 +27,7 @@
*/
#include <sys/param.h>
+#include <sys/cpuset.h>
#include <sys/sysctl.h>
#define LIBMEMSTAT /* Cause vm_page.h not to include opt_vmpage.h */
@@ -44,6 +45,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "memstat.h"
#include "memstat_internal.h"
@@ -313,7 +315,8 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
struct uma_keg *kzp, kz;
int hint_dontsearch, i, mp_maxid, ret;
char name[MEMTYPE_MAXNAME];
- __cpumask_t all_cpus;
+ cpuset_t all_cpus;
+ long cpusetsize;
kvm_t *kvm;
kvm = (kvm_t *)kvm_handle;
@@ -337,7 +340,13 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
list->mtl_error = ret;
return (-1);
}
- ret = kread_symbol(kvm, X_ALL_CPUS, &all_cpus, sizeof(all_cpus), 0);
+ cpusetsize = sysconf(_SC_CPUSET_SIZE);
+ if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) {
+ list->mtl_error = MEMSTAT_ERROR_KVM_NOSYMBOL;
+ return (-1);
+ }
+ CPU_ZERO(&all_cpus);
+ ret = kread_symbol(kvm, X_ALL_CPUS, &all_cpus, cpusetsize, 0);
if (ret != 0) {
list->mtl_error = ret;
return (-1);
@@ -407,7 +416,7 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
if (kz.uk_flags & UMA_ZFLAG_INTERNAL)
goto skip_percpu;
for (i = 0; i < mp_maxid + 1; i++) {
- if ((all_cpus & (1 << i)) == 0)
+ if (!CPU_ISSET(i, &all_cpus))
continue;
ucp = &ucp_array[i];
mtp->mt_numallocs += ucp->uc_allocs;
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c
index 384fe73..22ca668 100644
--- a/lib/libprocstat/libprocstat.c
+++ b/lib/libprocstat/libprocstat.c
@@ -191,7 +191,7 @@ procstat_getprocs(struct procstat *procstat, int what, int arg,
len = *count * sizeof(*p);
p = malloc(len);
if (p == NULL) {
- warnx("malloc(%zd)", len);
+ warnx("malloc(%zu)", len);
goto fail;
}
bcopy(p0, p, len);
@@ -213,7 +213,7 @@ procstat_getprocs(struct procstat *procstat, int what, int arg,
}
p = malloc(len);
if (p == NULL) {
- warnx("malloc(%zd)", len);
+ warnx("malloc(%zu)", len);
goto fail;
}
error = sysctl(name, 4, p, &len, NULL, 0);
@@ -229,7 +229,7 @@ procstat_getprocs(struct procstat *procstat, int what, int arg,
*count = len / sizeof(*p);
return (p);
} else {
- warnx("unknown access method");
+ warnx("unknown access method: %d", procstat->type);
return (NULL);
}
fail:
@@ -271,11 +271,11 @@ procstat_freefiles(struct procstat *procstat, struct filestat_list *head)
}
free(head);
if (procstat->vmentries != NULL) {
- free (procstat->vmentries);
+ free(procstat->vmentries);
procstat->vmentries = NULL;
}
if (procstat->files != NULL) {
- free (procstat->files);
+ free(procstat->files);
procstat->files = NULL;
}
}
@@ -426,7 +426,7 @@ procstat_getfiles_kvm(struct procstat *procstat, struct kinfo_proc *kp, int mmap
nfiles = filed.fd_lastfile + 1;
ofiles = malloc(nfiles * sizeof(struct file *));
if (ofiles == NULL) {
- warn("malloc(%zd)", nfiles * sizeof(struct file *));
+ warn("malloc(%zu)", nfiles * sizeof(struct file *));
goto do_mmapped;
}
if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles,
@@ -522,7 +522,8 @@ do_mmapped:
fflags = 0;
if (prot & VM_PROT_READ)
fflags = PS_FST_FFLAG_READ;
- if (prot & VM_PROT_WRITE)
+ if ((vmentry.eflags & MAP_ENTRY_COW) == 0 &&
+ prot & VM_PROT_WRITE)
fflags |= PS_FST_FFLAG_WRITE;
/*
@@ -696,7 +697,8 @@ procstat_getfiles_sysctl(struct procstat *procstat, struct kinfo_proc *kp, int m
fflags = 0;
if (kve->kve_protection & KVME_PROT_READ)
fflags = PS_FST_FFLAG_READ;
- if (kve->kve_protection & KVME_PROT_WRITE)
+ if ((kve->kve_flags & KVME_FLAG_COW) == 0 &&
+ kve->kve_protection & KVME_PROT_WRITE)
fflags |= PS_FST_FFLAG_WRITE;
offset = kve->kve_offset;
refcount = kve->kve_ref_count;
@@ -726,7 +728,7 @@ procstat_get_pipe_info(struct procstat *procstat, struct filestat *fst,
} else if (procstat->type == PROCSTAT_SYSCTL) {
return (procstat_get_pipe_info_sysctl(fst, ps, errbuf));
} else {
- warnx("unknow access method: %d", procstat->type);
+ warnx("unknown access method: %d", procstat->type);
snprintf(errbuf, _POSIX2_LINE_MAX, "error");
return (1);
}
@@ -790,7 +792,7 @@ procstat_get_pts_info(struct procstat *procstat, struct filestat *fst,
} else if (procstat->type == PROCSTAT_SYSCTL) {
return (procstat_get_pts_info_sysctl(fst, pts, errbuf));
} else {
- warnx("unknow access method: %d", procstat->type);
+ warnx("unknown access method: %d", procstat->type);
snprintf(errbuf, _POSIX2_LINE_MAX, "error");
return (1);
}
@@ -852,7 +854,7 @@ procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst,
} else if (procstat->type == PROCSTAT_SYSCTL) {
return (procstat_get_vnode_info_sysctl(fst, vn, errbuf));
} else {
- warnx("unknow access method: %d", procstat->type);
+ warnx("unknown access method: %d", procstat->type);
snprintf(errbuf, _POSIX2_LINE_MAX, "error");
return (1);
}
@@ -1059,7 +1061,7 @@ procstat_get_socket_info(struct procstat *procstat, struct filestat *fst,
} else if (procstat->type == PROCSTAT_SYSCTL) {
return (procstat_get_socket_info_sysctl(fst, sock, errbuf));
} else {
- warnx("unknow access method: %d", procstat->type);
+ warnx("unknown access method: %d", procstat->type);
snprintf(errbuf, _POSIX2_LINE_MAX, "error");
return (1);
}
@@ -1283,7 +1285,7 @@ vntype2psfsttype(int type)
static char *
getmnton(kvm_t *kd, struct mount *m)
{
- static struct mount mnt;
+ struct mount mnt;
static struct mtab {
struct mtab *next;
struct mount *m;
@@ -1302,7 +1304,7 @@ getmnton(kvm_t *kd, struct mount *m)
err(1, NULL);
mt->m = m;
bcopy(&mnt.mnt_stat.f_mntonname[0], &mt->mntonname[0], MNAMELEN);
- mnt.mnt_stat.f_mntonname[MNAMELEN] = '\0';
+ mt->mntonname[MNAMELEN] = '\0';
mt->next = mhead;
mhead = mt;
return (mt->mntonname);
diff --git a/lib/libstand/bswap.c b/lib/libstand/bswap.c
index 212e2af..b8e6ffb 100644
--- a/lib/libstand/bswap.c
+++ b/lib/libstand/bswap.c
@@ -8,7 +8,7 @@ __FBSDID("$FreeBSD$");
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$NetBSD: bswap32.c,v 1.1 1997/10/09 15:42:33 bouyer Exp $";
-static char *rcsid = "$NetBSD: bswap64.c,v 1.1 1997/10/09 15:42:33 bouyer Exp $";
+static char *rcsid = "$NetBSD: bswap64.c,v 1.3 2009/03/16 05:59:21 cegger Exp $";
#endif
#include <sys/types.h>
@@ -30,12 +30,28 @@ bswap32(u_int32_t x)
u_int64_t
bswap64(u_int64_t x)
-{
- u_int32_t *p = (u_int32_t*)&x;
- u_int32_t t;
- t = bswap32(p[0]);
- p[0] = bswap32(p[1]);
- p[1] = t;
- return x;
-}
-
+{
+#ifdef _LP64
+ /*
+ * Assume we have wide enough registers to do it without touching
+ * memory.
+ */
+ return ( (x << 56) & 0xff00000000000000UL ) |
+ ( (x << 40) & 0x00ff000000000000UL ) |
+ ( (x << 24) & 0x0000ff0000000000UL ) |
+ ( (x << 8) & 0x000000ff00000000UL ) |
+ ( (x >> 8) & 0x00000000ff000000UL ) |
+ ( (x >> 24) & 0x0000000000ff0000UL ) |
+ ( (x >> 40) & 0x000000000000ff00UL ) |
+ ( (x >> 56) & 0x00000000000000ffUL );
+#else
+ /*
+ * Split the operation in two 32bit steps.
+ */
+ u_int32_t tl, th;
+
+ th = bswap32((u_int32_t)(x & 0x00000000ffffffffULL));
+ tl = bswap32((u_int32_t)((x >> 32) & 0x00000000ffffffffULL));
+ return ((u_int64_t)th << 32) | tl;
+#endif
+}
diff --git a/lib/libstand/net.c b/lib/libstand/net.c
index 81b4521..24593e6 100644
--- a/lib/libstand/net.c
+++ b/lib/libstand/net.c
@@ -100,7 +100,7 @@ sendrecv(struct iodesc *d,
cc, ssize);
tleft = tmo;
- tmo <<= 1;
+ tmo += MINTMO;
if (tmo > MAXTMO)
tmo = MAXTMO;
diff --git a/lib/libstand/tftp.c b/lib/libstand/tftp.c
index 29590fc..54e184c 100644
--- a/lib/libstand/tftp.c
+++ b/lib/libstand/tftp.c
@@ -60,12 +60,21 @@ __FBSDID("$FreeBSD$");
#include "tftp.h"
+struct tftp_handle;
+
static int tftp_open(const char *path, struct open_file *f);
static int tftp_close(struct open_file *f);
+static void tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len);
static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid);
static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid);
static off_t tftp_seek(struct open_file *f, off_t offset, int where);
+static int tftp_set_blksize(struct tftp_handle *h, const char *str);
static int tftp_stat(struct open_file *f, struct stat *sb);
+static ssize_t sendrecv_tftp(struct tftp_handle *h,
+ ssize_t (*sproc)(struct iodesc *, void *, size_t),
+ void *sbuf, size_t ssize,
+ ssize_t (*rproc)(struct tftp_handle *h, void *, ssize_t, time_t, unsigned short *),
+ void *rbuf, size_t rsize, unsigned short *rtype);
struct fs_ops tftp_fsops = {
"tftp",
@@ -81,8 +90,20 @@ struct fs_ops tftp_fsops = {
extern struct in_addr servip;
static int tftpport = 2000;
+static int is_open = 0;
+
+/*
+ * The legacy TFTP_BLKSIZE value was 512.
+ * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and
+ * IP header lengths).
+ */
+#define TFTP_REQUESTED_BLKSIZE 1428
-#define RSPACE 520 /* max data packet, rounded up */
+/*
+ * Choose a blksize big enough so we can test with Ethernet
+ * Jumbo frames in the future.
+ */
+#define TFTP_MAX_BLKSIZE 9008
struct tftp_handle {
struct iodesc *iodesc;
@@ -91,10 +112,12 @@ struct tftp_handle {
int validsize;
int off;
char *path; /* saved for re-requests */
+ unsigned int tftp_blksize;
+ unsigned long tftp_tsize;
struct {
u_char header[HEADER_SIZE];
struct tftphdr t;
- u_char space[RSPACE];
+ u_char space[TFTP_MAX_BLKSIZE];
} __packed __aligned(4) lastdata;
};
@@ -110,8 +133,10 @@ static const int tftperrors[8] = {
};
static ssize_t
-recvtftp(struct iodesc *d, void *pkt, ssize_t len, time_t tleft)
+recvtftp(struct tftp_handle *h, void *pkt, ssize_t len, time_t tleft,
+ unsigned short *rtype)
{
+ struct iodesc *d = h->iodesc;
struct tftphdr *t;
errno = 0;
@@ -122,6 +147,7 @@ recvtftp(struct iodesc *d, void *pkt, ssize_t len, time_t tleft)
return (-1);
t = (struct tftphdr *) pkt;
+ *rtype = ntohs(t->th_opcode);
switch (ntohs(t->th_opcode)) {
case DATA: {
int got;
@@ -154,6 +180,18 @@ recvtftp(struct iodesc *d, void *pkt, ssize_t len, time_t tleft)
errno = tftperrors[ntohs(t->th_code)];
}
return (-1);
+ case OACK: {
+ struct udphdr *uh;
+ int tftp_oack_len = len - sizeof(t->th_opcode);
+ tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len);
+ /*
+ * Remember which port this OACK came from,
+ * because we need to send the ACK back to it.
+ */
+ uh = (struct udphdr *) pkt - 1;
+ d->destport = uh->uh_sport;
+ return (0);
+ }
default:
#ifdef TFTP_DEBUG
printf("tftp type %d not handled\n", ntohs(t->th_opcode));
@@ -175,14 +213,35 @@ tftp_makereq(struct tftp_handle *h)
int l;
ssize_t res;
struct tftphdr *t;
+ char *tftp_blksize = NULL;
+ int blksize_l;
+ unsigned short rtype = 0;
+
+ /*
+ * Allow overriding default TFTP block size by setting
+ * a tftp.blksize environment variable.
+ */
+ if ((tftp_blksize = getenv("tftp.blksize")) != NULL) {
+ tftp_set_blksize(h, tftp_blksize);
+ }
wbuf.t.th_opcode = htons((u_short) RRQ);
wtail = wbuf.t.th_stuff;
l = strlen(h->path);
+ if (l > FNAME_SIZE)
+ return (ENAMETOOLONG);
bcopy(h->path, wtail, l + 1);
wtail += l + 1;
bcopy("octet", wtail, 6);
wtail += 6;
+ bcopy("blksize", wtail, 8);
+ wtail += 8;
+ blksize_l = sprintf(wtail, "%d", h->tftp_blksize);
+ wtail += blksize_l + 1;
+ bcopy("tsize", wtail, 6);
+ wtail += 6;
+ bcopy("0", wtail, 2);
+ wtail += 2;
t = &h->lastdata.t;
@@ -191,18 +250,33 @@ tftp_makereq(struct tftp_handle *h)
h->iodesc->destport = htons(IPPORT_TFTP);
h->iodesc->xid = 1; /* expected block */
- res = sendrecv(h->iodesc, sendudp, &wbuf.t, wtail - (char *) &wbuf.t,
- recvtftp, t, sizeof(*t) + RSPACE);
+ res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t,
+ &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype);
+
+ if (rtype == OACK) {
+ wbuf.t.th_opcode = htons((u_short)ACK);
+ wtail = (char *) &wbuf.t.th_block;
+ wbuf.t.th_block = htons(0);
+ wtail += 2;
+ rtype = 0;
+ res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t,
+ &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype);
+ }
- if (res == -1)
- return (errno);
+ switch (rtype) {
+ case DATA: {
+ h->currblock = 1;
+ h->validsize = res;
+ h->islastblock = 0;
+ if (res < h->tftp_blksize)
+ h->islastblock = 1; /* very short file */
+ return (0);
+ }
+ case ERROR:
+ default:
+ return (errno);
+ }
- h->currblock = 1;
- h->validsize = res;
- h->islastblock = 0;
- if (res < SEGSIZE)
- h->islastblock = 1; /* very short file */
- return (0);
}
/* ack block, expect next */
@@ -216,7 +290,7 @@ tftp_getnextblock(struct tftp_handle *h)
char *wtail;
int res;
struct tftphdr *t;
-
+ unsigned short rtype = 0;
wbuf.t.th_opcode = htons((u_short) ACK);
wtail = (char *) &wbuf.t.th_block;
wbuf.t.th_block = htons((u_short) h->currblock);
@@ -226,16 +300,23 @@ tftp_getnextblock(struct tftp_handle *h)
h->iodesc->xid = h->currblock + 1; /* expected block */
- res = sendrecv(h->iodesc, sendudp, &wbuf.t, wtail - (char *) &wbuf.t,
- recvtftp, t, sizeof(*t) + RSPACE);
+ res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t,
+ &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype);
if (res == -1) /* 0 is OK! */
return (errno);
h->currblock++;
h->validsize = res;
- if (res < SEGSIZE)
+ if (res < h->tftp_blksize)
h->islastblock = 1; /* EOF */
+
+ if (h->islastblock == 1) {
+ /* Send an ACK for the last block */
+ wbuf.t.th_block = htons((u_short) h->currblock);
+ sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t);
+ }
+
return (0);
}
@@ -251,10 +332,15 @@ tftp_open(const char *path, struct open_file *f)
return (EINVAL);
#endif
+ if (is_open)
+ return (EBUSY);
+
tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile));
if (!tftpfile)
return (ENOMEM);
+ memset(tftpfile, 0, sizeof(*tftpfile));
+ tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE;
tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
if (io == NULL)
return (EINVAL);
@@ -275,6 +361,7 @@ tftp_open(const char *path, struct open_file *f)
return (res);
}
f->f_fsdata = (void *) tftpfile;
+ is_open = 1;
return (0);
}
@@ -292,7 +379,7 @@ tftp_read(struct open_file *f, void *addr, size_t size,
if (!(tc++ % 16))
twiddle();
- needblock = tftpfile->off / SEGSIZE + 1;
+ needblock = tftpfile->off / tftpfile->tftp_blksize + 1;
if (tftpfile->currblock > needblock) /* seek backwards */
tftp_makereq(tftpfile); /* no error check, it worked
@@ -315,7 +402,7 @@ tftp_read(struct open_file *f, void *addr, size_t size,
if (tftpfile->currblock == needblock) {
int offinblock, inbuffer;
- offinblock = tftpfile->off % SEGSIZE;
+ offinblock = tftpfile->off % tftpfile->tftp_blksize;
inbuffer = tftpfile->validsize - offinblock;
if (inbuffer < 0) {
@@ -361,18 +448,19 @@ tftp_close(struct open_file *f)
free(tftpfile->path);
free(tftpfile);
}
+ is_open = 0;
return (0);
}
static int
tftp_write(struct open_file *f __unused, void *start __unused, size_t size __unused,
- size_t *resid /* out */ __unused)
+ size_t *resid __unused /* out */)
{
return (EROFS);
}
static int
-tftp_stat(struct open_file *f, struct stat *sb)
+tftp_stat(struct open_file *f, struct stat *sb)
{
struct tftp_handle *tftpfile;
tftpfile = (struct tftp_handle *) f->f_fsdata;
@@ -404,3 +492,166 @@ tftp_seek(struct open_file *f, off_t offset, int where)
}
return (tftpfile->off);
}
+
+static ssize_t
+sendrecv_tftp(struct tftp_handle *h,
+ ssize_t (*sproc)(struct iodesc *, void *, size_t),
+ void *sbuf, size_t ssize,
+ ssize_t (*rproc)(struct tftp_handle *, void *, ssize_t, time_t, unsigned short *),
+ void *rbuf, size_t rsize, unsigned short *rtype)
+{
+ struct iodesc *d = h->iodesc;
+ ssize_t cc;
+ time_t t, t1, tleft;
+
+#ifdef TFTP_DEBUG
+ if (debug)
+ printf("sendrecv: called\n");
+#endif
+
+ tleft = MINTMO;
+ t = t1 = getsecs();
+ for (;;) {
+ if ((getsecs() - t) > MAXTMO) {
+ errno = ETIMEDOUT;
+ return -1;
+ }
+
+ cc = (*sproc)(d, sbuf, ssize);
+ if (cc != -1 && cc < ssize)
+ panic("sendrecv: short write! (%zd < %zu)",
+ cc, ssize);
+
+ if (cc == -1) {
+ /* Error on transmit; wait before retrying */
+ while ((getsecs() - t1) < tleft);
+ continue;
+ }
+
+recvnext:
+ /* Try to get a packet and process it. */
+ cc = (*rproc)(h, rbuf, rsize, tleft, rtype);
+ /* Return on data, EOF or real error. */
+ if (cc != -1 || errno != 0)
+ return (cc);
+ if ((getsecs() - t1) < tleft) {
+ goto recvnext;
+ }
+
+ /* Timed out or didn't get the packet we're waiting for */
+ tleft += MINTMO;
+ if (tleft > (2 * MINTMO)) {
+ tleft = (2 * MINTMO);
+ }
+ t1 = getsecs();
+ }
+}
+
+static int
+tftp_set_blksize(struct tftp_handle *h, const char *str)
+{
+ char *endptr;
+ int new_blksize;
+ int ret = 0;
+
+ if (h == NULL || str == NULL)
+ return (ret);
+
+ new_blksize =
+ (unsigned int)strtol(str, &endptr, 0);
+
+ /*
+ * Only accept blksize value if it is numeric.
+ * RFC2348 specifies that acceptable valuesare 8-65464
+ * 8-65464 . Let's choose a limit less than MAXRSPACE
+ */
+ if (*endptr == '\0' && new_blksize >= 8
+ && new_blksize <= TFTP_MAX_BLKSIZE) {
+ h->tftp_blksize = new_blksize;
+ ret = 1;
+ }
+
+ return (ret);
+}
+
+/*
+ * In RFC2347, the TFTP Option Acknowledgement package (OACK)
+ * is used to acknowledge a client's option negotiation request.
+ * The format of an OACK packet is:
+ * +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
+ * | opc | opt1 | 0 | value1 | 0 | optN | 0 | valueN | 0 |
+ * +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
+ *
+ * opc
+ * The opcode field contains a 6, for Option Acknowledgment.
+ *
+ * opt1
+ * The first option acknowledgment, copied from the original
+ * request.
+ *
+ * value1
+ * The acknowledged value associated with the first option. If
+ * and how this value may differ from the original request is
+ * detailed in the specification for the option.
+ *
+ * optN, valueN
+ * The final option/value acknowledgment pair.
+ */
+static void
+tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len)
+{
+ /*
+ * We parse the OACK strings into an array
+ * of name-value pairs.
+ *
+ */
+ char *tftp_options[128] = { 0 };
+ char *val = buf;
+ int i = 0;
+ int option_idx = 0;
+ int blksize_is_set = 0;
+ int tsize = 0;
+
+
+ while ( option_idx < 128 && i < len ) {
+ if (buf[i] == '\0') {
+ if (&buf[i] > val) {
+ tftp_options[option_idx] = val;
+ val = &buf[i] + 1;
+ ++option_idx;
+ }
+ }
+ ++i;
+ }
+
+ /*
+ * Parse individual TFTP options.
+ * * "blksize" is specified in RFC2348.
+ * * "tsize" is specified in RFC2349.
+ */
+ for (i = 0; i < option_idx; i += 2) {
+ if (strcasecmp(tftp_options[i], "blksize") == 0) {
+ if (i + 1 < option_idx) {
+ blksize_is_set =
+ tftp_set_blksize(h, tftp_options[i + 1]);
+ }
+ } else if (strcasecmp(tftp_options[i], "tsize") == 0) {
+ if (i + 1 < option_idx) {
+ tsize = strtol(tftp_options[i + 1], (char **)NULL, 10);
+ }
+ }
+ }
+
+ if (!blksize_is_set) {
+ /*
+ * If TFTP blksize was not set, try defaulting
+ * to the legacy TFTP blksize of 512
+ */
+ h->tftp_blksize = 512;
+ }
+
+#ifdef TFTP_DEBUG
+ printf("tftp_blksize: %u\n", h->tftp_blksize);
+ printf("tftp_tsize: %lu\n", h->tftp_tsize);
+#endif
+}
diff --git a/lib/libstand/zalloc.c b/lib/libstand/zalloc.c
index aa8ccd0..2cd71c4 100644
--- a/lib/libstand/zalloc.c
+++ b/lib/libstand/zalloc.c
@@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t bytes)
if ((char *)ptr < (char *)mp->mp_Base ||
(char *)ptr + bytes > (char *)mp->mp_End ||
((iaddr_t)ptr & MEMNODE_SIZE_MASK) != 0)
- panic("zfree(%p,%d): wild pointer", ptr, bytes);
+ panic("zfree(%p,%ju): wild pointer", ptr, bytes);
/*
* free the segment
@@ -178,7 +178,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t bytes)
* range check
*/
if ((char *)ptr + bytes > (char *)mn)
- panic("zfree(%p,%d): corrupt memlist1",ptr, bytes);
+ panic("zfree(%p,%ju): corrupt memlist1",ptr, bytes);
/*
* merge against next area or create independant area
@@ -209,7 +209,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t bytes)
/* NOT REACHED */
}
if ((char *)ptr < (char *)mn + mn->mr_Bytes)
- panic("zfree(%p,%d): corrupt memlist2", ptr, bytes);
+ panic("zfree(%p,%ju): corrupt memlist2", ptr, bytes);
}
/*
* We are beyond the last MemNode, append new MemNode. Merge against
diff --git a/lib/libstand/zalloc_malloc.c b/lib/libstand/zalloc_malloc.c
index cdacf13..5cd7bcb 100644
--- a/lib/libstand/zalloc_malloc.c
+++ b/lib/libstand/zalloc_malloc.c
@@ -110,7 +110,7 @@ Free(void *ptr, const char *file, int line)
return;
}
if (*((signed char *)res + res->ga_Bytes - 1) != -2)
- panic("free: guard2 fail @ %p + %d from %s:%d", ptr, res->ga_Bytes - MALLOCALIGN, file, line);
+ panic("free: guard2 fail @ %p + %zu from %s:%d", ptr, res->ga_Bytes - MALLOCALIGN, file, line);
*((signed char *)res + res->ga_Bytes - 1) = -1;
#endif
diff --git a/lib/libthr/arch/sparc64/Makefile.inc b/lib/libthr/arch/sparc64/Makefile.inc
index 2ee2247..88586b4 100644
--- a/lib/libthr/arch/sparc64/Makefile.inc
+++ b/lib/libthr/arch/sparc64/Makefile.inc
@@ -1,3 +1,3 @@
# $FreeBSD$
-SRCS+= pthread_md.c
+SRCS+= _umtx_op_err.S pthread_md.c
diff --git a/lib/libthr/arch/sparc64/include/pthread_md.h b/lib/libthr/arch/sparc64/include/pthread_md.h
index 7909291..7ee9654 100644
--- a/lib/libthr/arch/sparc64/include/pthread_md.h
+++ b/lib/libthr/arch/sparc64/include/pthread_md.h
@@ -50,10 +50,6 @@ struct tcb {
void *tcb_spare[1];
};
-register struct tcb *_tp __asm("%g7");
-
-#define _tcb (_tp)
-
/*
* The tcb constructors.
*/
@@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *);
static __inline void
_tcb_set(struct tcb *tcb)
{
- _tp = tcb;
+
+ __asm __volatile("mov %0, %%g7" : : "r" (tcb));
}
-/*
- * Get the current tcb.
- */
static __inline struct tcb *
_tcb_get(void)
{
- return (_tcb);
-}
+ register struct tcb *tp __asm("%g7");
-extern struct pthread *_thr_initial;
+ return (tp);
+}
static __inline struct pthread *
_get_curthread(void)
{
- if (_thr_initial)
- return (_tcb->tcb_thread);
- return (NULL);
+
+ return (_tcb_get()->tcb_thread);
}
+#define HAS__UMTX_OP_ERR 1
+
#endif /* _PTHREAD_MD_H_ */
diff --git a/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S b/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S
new file mode 100644
index 0000000..220d279
--- /dev/null
+++ b/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S
@@ -0,0 +1,38 @@
+/*-
+ * Copyright (c) 2011 Marius Strobl <marius@FreeBSD.org>
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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 <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/syscall.h>
+
+#include <machine/utrap.h>
+
+ENTRY(_umtx_op_err)
+ mov SYS__umtx_op, %g1
+ retl
+ ta %xcc, ST_SYSCALL
+END(_umtx_op_err)
diff --git a/lib/libthr/arch/sparc64/sparc64/pthread_md.c b/lib/libthr/arch/sparc64/sparc64/pthread_md.c
index 3f8e105..e1d439a 100644
--- a/lib/libthr/arch/sparc64/sparc64/pthread_md.c
+++ b/lib/libthr/arch/sparc64/sparc64/pthread_md.c
@@ -24,10 +24,11 @@
* 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.
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/types.h>
#include <rtld_tls.h>
@@ -37,13 +38,11 @@ struct tcb *
_tcb_ctor(struct pthread *thread, int initial)
{
struct tcb *tcb;
- void *oldtls;
if (initial)
- oldtls = _tp;
+ tcb = _tcb_get();
else
- oldtls = NULL;
- tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16);
+ tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16);
if (tcb)
tcb->tcb_thread = thread;
return (tcb);
@@ -52,5 +51,6 @@ _tcb_ctor(struct pthread *thread, int initial)
void
_tcb_dtor(struct tcb *tcb)
{
+
_rtld_free_tls(tcb, sizeof(struct tcb), 16);
}
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
index 7e07215..86abad8 100644
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -409,7 +409,6 @@ init_main_thread(struct pthread *thread)
thread->cancel_enable = 1;
thread->cancel_async = 0;
- thr_set_name(thread->tid, "initial thread");
/* Initialize the mutex queue: */
TAILQ_INIT(&thread->mutexq);
diff --git a/lib/msun/ld128/e_rem_pio2l.h b/lib/msun/ld128/e_rem_pio2l.h
index d223627..5d78c4d 100644
--- a/lib/msun/ld128/e_rem_pio2l.h
+++ b/lib/msun/ld128/e_rem_pio2l.h
@@ -58,10 +58,7 @@ pio2_2t = 2.0670321098263988236496903051604844e-43L, /* 0x127044533e63a0105df5
pio2_3 = 2.0670321098263988236499468110329591e-43L, /* 0x127044533e63a0105e00000000000.0p-254 */
pio2_3t = -2.5650587247459238361625433492959285e-65L; /* -0x159c4ec64ddaeb5f78671cbfb2210.0p-327 */
-#ifdef INLINE_REM_PIO2L
-static inline __always_inline
-#endif
-int
+static inline __always_inline int
__ieee754_rem_pio2l(long double x, long double *y)
{
union IEEEl2bits u,u1;
diff --git a/lib/msun/ld80/e_rem_pio2l.h b/lib/msun/ld80/e_rem_pio2l.h
index cfe3fb9..75e4e4b 100644
--- a/lib/msun/ld80/e_rem_pio2l.h
+++ b/lib/msun/ld80/e_rem_pio2l.h
@@ -70,10 +70,7 @@ pio2_2t = 6.36831716351095013979e-25L, /* 0xc51701b839a25205.0p-144 */
pio2_3t = -2.75299651904407171810e-37L; /* -0xbb5bf6c7ddd660ce.0p-185 */
#endif
-#ifdef INLINE_REM_PIO2L
-static inline __always_inline
-#endif
-int
+static inline __always_inline int
__ieee754_rem_pio2l(long double x, long double *y)
{
union IEEEl2bits u,u1;
@@ -85,7 +82,7 @@ __ieee754_rem_pio2l(long double x, long double *y)
u.e = x;
expsign = u.xbits.expsign;
ex = expsign & 0x7fff;
- if (ex < BIAS + 25 || ex == BIAS + 25 && u.bits.manh < 0xc90fdaa2) {
+ if (ex < BIAS + 25 || (ex == BIAS + 25 && u.bits.manh < 0xc90fdaa2)) {
/* |x| ~< 2^25*(pi/2), medium size */
/* Use a specialized rint() to get fn. Assume round-to-nearest. */
fn = x*invpio2+0x1.8p63;
diff --git a/lib/msun/src/e_rem_pio2.c b/lib/msun/src/e_rem_pio2.c
index a58a81b..fde9660 100644
--- a/lib/msun/src/e_rem_pio2.c
+++ b/lib/msun/src/e_rem_pio2.c
@@ -171,9 +171,8 @@ medium:
}
/* set z = scalbn(|x|,ilogb(x)-23) */
GET_LOW_WORD(low,x);
- SET_LOW_WORD(z,low);
e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */
- SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20)));
+ INSERT_WORDS(z, ix - ((int32_t)(e0<<20)), low);
for(i=0;i<2;i++) {
tx[i] = (double)((int32_t)(z));
z = (z-tx[i])*two24;
diff --git a/lib/msun/src/s_cosl.c b/lib/msun/src/s_cosl.c
index 77611c1..8d43626 100644
--- a/lib/msun/src/s_cosl.c
+++ b/lib/msun/src/s_cosl.c
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
#include <float.h>
#include "math.h"
-#define INLINE_REM_PIO2L
#include "math_private.h"
#if LDBL_MANT_DIG == 64
#include "../ld80/e_rem_pio2l.h"
diff --git a/lib/msun/src/s_sinl.c b/lib/msun/src/s_sinl.c
index 19d9572..919deb9 100644
--- a/lib/msun/src/s_sinl.c
+++ b/lib/msun/src/s_sinl.c
@@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$");
#include <float.h>
#include "math.h"
-#define INLINE_REM_PIO2L
#include "math_private.h"
#if LDBL_MANT_DIG == 64
#include "../ld80/e_rem_pio2l.h"
diff --git a/lib/msun/src/s_tanl.c b/lib/msun/src/s_tanl.c
index 3cf4a69..9562cf8 100644
--- a/lib/msun/src/s_tanl.c
+++ b/lib/msun/src/s_tanl.c
@@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
#include <float.h>
#include "math.h"
-#define INLINE_REM_PIO2L
#include "math_private.h"
#if LDBL_MANT_DIG == 64
#include "../ld80/e_rem_pio2l.h"
diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c
index d0ff7a4..2a0fd3c 100644
--- a/libexec/comsat/comsat.c
+++ b/libexec/comsat/comsat.c
@@ -180,7 +180,7 @@ notify(struct utmpx *utp, char file[], off_t offset, int folder)
dsyslog(LOG_DEBUG, "%s: wrong mode on %s", utp->ut_user, tty);
return;
}
- dsyslog(LOG_DEBUG, "notify %s on %s\n", utp->ut_user, tty);
+ dsyslog(LOG_DEBUG, "notify %s on %s", utp->ut_user, tty);
switch (fork()) {
case -1:
syslog(LOG_NOTICE, "fork failed (%m)");
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 45318b9..95bec19 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -17,6 +17,7 @@ RTLD_ARCH= ${MACHINE_CPUARCH}
.endif
CFLAGS+= -I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR}
.if ${MACHINE_ARCH} == "powerpc64"
+CFLAGS+= -mcall-aixdesc
LDFLAGS+= -nostdlib -e _rtld_start
.else
LDFLAGS+= -nostdlib -e .rtld_start
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 5c2db0a..722b274 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -928,8 +928,8 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath,
obj->textrel = true;
if (dynp->d_un.d_val & DF_BIND_NOW)
obj->bind_now = true;
- if (dynp->d_un.d_val & DF_STATIC_TLS)
- ;
+ /*if (dynp->d_un.d_val & DF_STATIC_TLS)
+ ;*/
break;
#ifdef __mips__
case DT_MIPS_LOCAL_GOTNO:
@@ -958,8 +958,8 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath,
obj->z_noopen = true;
if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust)
obj->z_origin = true;
- if (dynp->d_un.d_val & DF_1_GLOBAL)
- /* XXX */;
+ /*if (dynp->d_un.d_val & DF_1_GLOBAL)
+ XXX ;*/
if (dynp->d_un.d_val & DF_1_BIND_NOW)
obj->bind_now = true;
if (dynp->d_un.d_val & DF_1_NODELETE)
diff --git a/libexec/tftpd/tftp-io.c b/libexec/tftpd/tftp-io.c
index 8a39abd..17eabcb 100644
--- a/libexec/tftpd/tftp-io.c
+++ b/libexec/tftpd/tftp-io.c
@@ -262,7 +262,7 @@ send_rrq(int peer, char *filename, char *mode)
n = sendto(peer, buf, size, 0,
(struct sockaddr *)&peer_sock, peer_sock.ss_len);
if (n != size) {
- tftp_log(LOG_ERR, "send_rrq: %s", n, strerror(errno));
+ tftp_log(LOG_ERR, "send_rrq: %d %s", n, strerror(errno));
return (1);
}
return (0);
diff --git a/libexec/tftpd/tftpd.8 b/libexec/tftpd/tftpd.8
index 852323c..3bac492 100644
--- a/libexec/tftpd/tftpd.8
+++ b/libexec/tftpd/tftpd.8
@@ -253,8 +253,9 @@ was introduced in
support for the TFTP Blocksize Option (RFC2348) and the blksize2 option
was introduced in
.Fx 7.4 .
-.Sh BUGS
+.Sh NOTES
Files larger than 33488896 octets (65535 blocks) cannot be transferred
-without client and server supporting blocksize negotiation (RFC2348).
+without client and server supporting the the TFTP blocksize option (RFC2348),
+or the non-standard TFTP rollover option.
.Pp
Many tftp clients will not transfer files over 16744448 octets (32767 blocks).
diff --git a/release/Makefile b/release/Makefile
index 081cdbf..f8a52d6 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -110,8 +110,8 @@ reldoc:
system: packagesystem
# Install system
-mkdir ${.OBJDIR}/release
- cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution DESTDIR=${.OBJDIR}/release
- -rm ${.OBJDIR}/release/boot/kernel/*.symbols
+ cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
+ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1
# Copy distfiles
mkdir ${.OBJDIR}/release/usr/freebsd-dist
cp ${.OBJDIR}/*.txz ${.OBJDIR}/MANIFEST \
@@ -135,8 +135,9 @@ bootonly: packagesystem
WITHOUT_BIND_DNSSEC=1 WITHOUT_BIND_ETC=1 WITHOUT_BIND_MTREE=1 \
WITHOUT_BIND_NAMED=1 WITHOUT_GAMES=1 WITHOUT_GROFF=1 \
WITHOUT_INSTALLLIB=1 WITHOUT_LIB32=1 WITHOUT_MAIL=1 \
- WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1
- -rm ${.OBJDIR}/bootonly/boot/kernel/*.symbols
+ WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_PROFILE=1 \
+ WITHOUT_INSTALLIB=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 \
+ WITHOUT_KERNEL_SYMBOLS=1
# Copy manifest only (no distfiles) to get checksums
mkdir ${.OBJDIR}/bootonly/usr/freebsd-dist
cp ${.OBJDIR}/MANIFEST ${.OBJDIR}/bootonly/usr/freebsd-dist
diff --git a/release/doc/en_US.ISO8859-1/relnotes/article.sgml b/release/doc/en_US.ISO8859-1/relnotes/article.sgml
index f34a81d..b40da22 100644
--- a/release/doc/en_US.ISO8859-1/relnotes/article.sgml
+++ b/release/doc/en_US.ISO8859-1/relnotes/article.sgml
@@ -480,7 +480,7 @@
Figwort release to the Hydrangea release.</para>
<para role="merged"><application>sendmail</application> has been updated from
- 8.14.1 to 8.14.4.</para>
+ 8.14.1 to 8.14.5.</para>
<para role="merged">The timezone database has been updated from
the <application>tzdata2008h</application> release to
diff --git a/release/ia64/mkisoimages.sh b/release/ia64/mkisoimages.sh
index 33ba192..f17185b 100644
--- a/release/ia64/mkisoimages.sh
+++ b/release/ia64/mkisoimages.sh
@@ -48,28 +48,32 @@ EFIPART=efipart.sys
if [ $bootable = yes ]; then
EFISZ=65536
MNT=/mnt
- dd if=/dev/zero of=$BASE/$EFIPART count=$EFISZ
- md=`mdconfig -a -t vnode -f $BASE/$EFIPART`
+ dd if=/dev/zero of=$EFIPART count=$EFISZ
+ md=`mdconfig -a -t vnode -f $EFIPART`
newfs_msdos -F 12 -S 512 -h 4 -o 0 -s $EFISZ -u 16 $md
mount -t msdosfs /dev/$md $MNT
mkdir -p $MNT/efi/boot $MNT/boot $MNT/boot/kernel
cp -R $BASE/boot/defaults $MNT/boot
cp $BASE/boot/kernel/kernel $MNT/boot/kernel
- cp $BASE/boot/kernel/ispfw.ko $MNT/boot/kernel
+ if [ -s $BASE/boot/kernel/ispfw.ko ]; then
+ cp $BASE/boot/kernel/ispfw.ko $MNT/boot/kernel
+ fi
cp $BASE/boot/device.hints $MNT/boot
cp $BASE/boot/loader.* $MNT/boot
- cp $BASE/boot/mfsroot.gz $MNT/boot
+ if [ -s $BASE/boot/mfsroot.gz ]; then
+ cp $BASE/boot/mfsroot.gz $MNT/boot
+ fi
cp $BASE/boot/support.4th $MNT/boot
mv $MNT/boot/loader.efi $MNT/efi/boot/bootia64.efi
umount $MNT
mdconfig -d -u $md
- BOOTOPTS="-b bootimage=i386;$EFIPART -o no-emul-boot"
+ BOOTOPTS="-o bootimage=i386;$EFIPART -o no-emul-boot"
else
BOOTOPTS=""
fi
-echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $BASE/etc/fstab
makefs -t cd9660 $BOOTOPTS -o rockridge -o label=$LABEL $NAME $BASE $*
-rm -f $BASE/$EFIPART
-rm $1/etc/fstab
+rm $BASE/etc/fstab
+rm -f $EFIPART
exit 0
diff --git a/release/powerpc/mkisoimages.sh b/release/powerpc/mkisoimages.sh
index 63619fb..5d5e750 100644
--- a/release/powerpc/mkisoimages.sh
+++ b/release/powerpc/mkisoimages.sh
@@ -43,6 +43,8 @@ if [ "x$1" = "x-b" ]; then
<boot-script>boot &device;:&partition;,\ppc\chrp\loader</boot-script>
</chrp-boot>
EOF
+ bootable="$bootable -o chrp-boot"
+
shift
else
bootable=""
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index 6e494c7..7ad79d5 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -5044,13 +5044,13 @@ getdevid(struct cam_devitem *item)
* then allocate that much memory and try again.
*/
retry:
- ccb->ccb_h.func_code = XPT_GDEV_ADVINFO;
+ ccb->ccb_h.func_code = XPT_DEV_ADVINFO;
ccb->ccb_h.flags = CAM_DIR_IN;
- ccb->cgdai.flags = CGDAI_FLAG_PROTO;
- ccb->cgdai.buftype = CGDAI_TYPE_SCSI_DEVID;
- ccb->cgdai.bufsiz = item->device_id_len;
+ ccb->cdai.flags = 0;
+ ccb->cdai.buftype = CDAI_TYPE_SCSI_DEVID;
+ ccb->cdai.bufsiz = item->device_id_len;
if (item->device_id_len != 0)
- ccb->cgdai.buf = (uint8_t *)item->device_id;
+ ccb->cdai.buf = (uint8_t *)item->device_id;
if (cam_send_ccb(dev, ccb) < 0) {
warn("%s: error sending XPT_GDEV_ADVINFO CCB", __func__);
@@ -5069,13 +5069,13 @@ retry:
* This is our first time through. Allocate the buffer,
* and then go back to get the data.
*/
- if (ccb->cgdai.provsiz == 0) {
+ if (ccb->cdai.provsiz == 0) {
warnx("%s: invalid .provsiz field returned with "
"XPT_GDEV_ADVINFO CCB", __func__);
retval = 1;
goto bailout;
}
- item->device_id_len = ccb->cgdai.provsiz;
+ item->device_id_len = ccb->cdai.provsiz;
item->device_id = malloc(item->device_id_len);
if (item->device_id == NULL) {
warn("%s: unable to allocate %d bytes", __func__,
@@ -5283,8 +5283,9 @@ findsasdevice(struct cam_devlist *devlist, uint64_t sasaddr)
/*
* XXX KDM look for LUN IDs as well?
*/
- item_addr = scsi_get_sas_addr(item->device_id,
- item->device_id_len);
+ item_addr = scsi_get_devid(item->device_id,
+ item->device_id_len,
+ scsi_devid_is_sas_target);
if (item_addr == NULL)
continue;
diff --git a/sbin/ddb/ddb.8 b/sbin/ddb/ddb.8
index 5ee2650..0fb9687 100644
--- a/sbin/ddb/ddb.8
+++ b/sbin/ddb/ddb.8
@@ -126,7 +126,7 @@ it is advisable to enclose
in quotes.
.It Cm scripts
List currently defined scripts.
-.It Cm unset Ar scriptname
+.It Cm unscript Ar scriptname
Delete the script named
.Ar scriptname .
.El
diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c
index c1c5811..b4aa679 100644
--- a/sbin/fsck_ffs/suj.c
+++ b/sbin/fsck_ffs/suj.c
@@ -1604,7 +1604,7 @@ ino_trunc(ino_t ino, off_t size)
* uninitialized space later.
*/
off = blkoff(fs, size);
- if (off) {
+ if (off && DIP(ip, di_mode) != IFDIR) {
uint8_t *buf;
long clrsize;
@@ -1775,13 +1775,18 @@ cg_trunc(struct suj_cg *sc)
struct suj_ino *sino;
int i;
- for (i = 0; i < SUJ_HASHSIZE; i++)
- LIST_FOREACH(sino, &sc->sc_inohash[i], si_next)
+ for (i = 0; i < SUJ_HASHSIZE; i++) {
+ LIST_FOREACH(sino, &sc->sc_inohash[i], si_next) {
if (sino->si_trunc) {
ino_trunc(sino->si_ino,
sino->si_trunc->jt_size);
+ sino->si_blkadj = 0;
sino->si_trunc = NULL;
}
+ if (sino->si_blkadj)
+ ino_adjblks(sino);
+ }
+ }
}
/*
@@ -1791,7 +1796,6 @@ cg_trunc(struct suj_cg *sc)
static void
cg_check_blk(struct suj_cg *sc)
{
- struct suj_ino *sino;
struct suj_blk *sblk;
int i;
@@ -1799,15 +1803,6 @@ cg_check_blk(struct suj_cg *sc)
for (i = 0; i < SUJ_HASHSIZE; i++)
LIST_FOREACH(sblk, &sc->sc_blkhash[i], sb_next)
blk_check(sblk);
- /*
- * Now that we've freed blocks which are not referenced we
- * make a second pass over all inodes to adjust their block
- * counts.
- */
- for (i = 0; i < SUJ_HASHSIZE; i++)
- LIST_FOREACH(sino, &sc->sc_inohash[i], si_next)
- if (sino->si_blkadj)
- ino_adjblks(sino);
}
/*
@@ -1961,14 +1956,7 @@ ino_append(union jrec *rec)
"parent %d, diroff %jd\n",
refrec->jr_op, refrec->jr_ino, refrec->jr_nlink,
refrec->jr_parent, refrec->jr_diroff);
- /*
- * Lookup the ino and clear truncate if one is found. Partial
- * truncates are always done synchronously so if we discover
- * an operation that requires a lock the truncation has completed
- * and can be discarded.
- */
sino = ino_lookup(((struct jrefrec *)rec)->jr_ino, 1);
- sino->si_trunc = NULL;
sino->si_hasrecs = 1;
srec = errmalloc(sizeof(*srec));
srec->sr_rec = rec;
@@ -2174,9 +2162,7 @@ blk_build(struct jblkrec *blkrec)
struct suj_rec *srec;
struct suj_blk *sblk;
struct jblkrec *blkrn;
- struct suj_ino *sino;
ufs2_daddr_t blk;
- off_t foff;
int frag;
if (debug)
@@ -2185,17 +2171,6 @@ blk_build(struct jblkrec *blkrec)
blkrec->jb_op, blkrec->jb_blkno, blkrec->jb_frags,
blkrec->jb_oldfrags, blkrec->jb_ino, blkrec->jb_lbn);
- /*
- * Look up the inode and clear the truncate if any lbns after the
- * truncate lbn are freed or allocated.
- */
- sino = ino_lookup(blkrec->jb_ino, 0);
- if (sino && sino->si_trunc) {
- foff = lblktosize(fs, blkrec->jb_lbn);
- foff += lfragtosize(fs, blkrec->jb_frags);
- if (foff > sino->si_trunc->jt_size)
- sino->si_trunc = NULL;
- }
blk = blknum(fs, blkrec->jb_blkno);
frag = fragnum(fs, blkrec->jb_blkno);
sblk = blk_lookup(blk, 1);
@@ -2242,10 +2217,15 @@ ino_build_trunc(struct jtrncrec *rec)
struct suj_ino *sino;
if (debug)
- printf("ino_build_trunc: ino %d, size %jd\n",
- rec->jt_ino, rec->jt_size);
+ printf("ino_build_trunc: op %d ino %d, size %jd\n",
+ rec->jt_op, rec->jt_ino, rec->jt_size);
sino = ino_lookup(rec->jt_ino, 1);
- sino->si_trunc = rec;
+ if (rec->jt_op == JOP_SYNC) {
+ sino->si_trunc = NULL;
+ return;
+ }
+ if (sino->si_trunc == NULL || sino->si_trunc->jt_size > rec->jt_size)
+ sino->si_trunc = rec;
}
/*
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c
index 19d1502..eaf5845 100644
--- a/sbin/geom/class/part/geom_part.c
+++ b/sbin/geom/class/part/geom_part.c
@@ -101,7 +101,7 @@ struct g_command PUBSYM(class_commands)[] = {
{ 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING },
{ 'f', "flags", GPART_FLAGS, G_TYPE_STRING },
G_OPT_SENTINEL },
- "[-a alignment] [-b start] [-s size] -t type [-i index] "
+ "-t type [-a alignment] [-b start] [-s size] [-i index] "
"[-l label] [-f flags] geom"
},
{ "backup", 0, gpart_backup, G_NULL_OPTS,
@@ -113,7 +113,7 @@ struct g_command PUBSYM(class_commands)[] = {
{ 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER },
{ 'f', "flags", GPART_FLAGS, G_TYPE_STRING },
G_OPT_SENTINEL },
- "[-b bootcode] [-p partcode] [-i index] [-f flags] geom"
+ "[-b bootcode] [-p partcode -i index] [-f flags] geom"
},
{ "commit", 0, gpart_issue, G_NULL_OPTS,
"geom"
@@ -157,7 +157,7 @@ struct g_command PUBSYM(class_commands)[] = {
{ 'r', "show_rawtype", NULL, G_TYPE_BOOL },
{ 'p', "show_providers", NULL, G_TYPE_BOOL },
G_OPT_SENTINEL },
- "[-lrp] [geom ...]"
+ "[-l | -r] [-p] [geom ...]"
},
{ "undo", 0, gpart_issue, G_NULL_OPTS,
"geom"
@@ -175,7 +175,7 @@ struct g_command PUBSYM(class_commands)[] = {
{ 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER },
{ 'f', "flags", GPART_FLAGS, G_TYPE_STRING },
G_OPT_SENTINEL },
- "[-a alignment] [-s size] -i index [-f flags] geom"
+ "-i index [-a alignment] [-s size] [-f flags] geom"
},
{ "restore", 0, gpart_restore, {
{ 'F', "force", NULL, G_TYPE_BOOL },
@@ -295,8 +295,8 @@ fmtattrib(struct gprovider *pp)
return (buf);
}
-#define ALIGNDOWN(d, a) (-(a) & (d))
-#define ALIGNUP(d, a) (-(-(a) & -(d)))
+#define ALIGNDOWN(d, a) ((d) - (d) % (a))
+#define ALIGNUP(d, a) ((d) % (a) ? (d) - (d) % (a) + (a): (d))
static int
gpart_autofill_resize(struct gctl_req *req)
@@ -306,7 +306,7 @@ gpart_autofill_resize(struct gctl_req *req)
struct ggeom *gp;
struct gprovider *pp;
off_t last, size, start, new_size;
- off_t lba, new_lba, alignment;
+ off_t lba, new_lba, alignment, offset;
const char *s;
int error, idx;
@@ -341,6 +341,10 @@ gpart_autofill_resize(struct gctl_req *req)
errc(EXIT_FAILURE, error, "Invalid alignment param");
if (alignment == 0)
errx(EXIT_FAILURE, "Invalid alignment param");
+ } else {
+ lba = pp->lg_stripesize / pp->lg_sectorsize;
+ if (lba > 0)
+ alignment = lba;
}
error = gctl_delete_param(req, "alignment");
if (error)
@@ -356,12 +360,10 @@ gpart_autofill_resize(struct gctl_req *req)
/* no autofill necessary. */
if (alignment == 1)
goto done;
- if (new_size > alignment)
- new_size = ALIGNDOWN(new_size, alignment);
}
+ offset = pp->lg_stripeoffset / pp->lg_sectorsize;
last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0);
- last = ALIGNDOWN(last, alignment);
LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
s = find_provcfg(pp, "index");
if (s == NULL)
@@ -375,24 +377,32 @@ gpart_autofill_resize(struct gctl_req *req)
s = find_provcfg(pp, "start");
start = (off_t)strtoimax(s, NULL, 0);
s = find_provcfg(pp, "end");
- lba = (off_t)strtoimax(s, NULL, 0) + 1;
+ lba = (off_t)strtoimax(s, NULL, 0);
+ size = lba - start + 1;
- if (lba > last) {
- geom_deletetree(&mesh);
- return (ENOSPC);
+ if (new_size > 0 && new_size <= size) {
+ /* The start offset may be not aligned, so we align the end
+ * offset and then calculate the size.
+ */
+ new_size = ALIGNDOWN(start + offset + new_size,
+ alignment) - start - offset;
+ goto done;
}
- size = lba - start;
- pp = find_provider(gp, lba);
- if (pp == NULL)
- new_size = ALIGNDOWN(last - start + 1, alignment);
- else {
+
+ pp = find_provider(gp, lba + 1);
+ if (pp == NULL) {
+ new_size = ALIGNDOWN(last + offset + 1, alignment) -
+ start - offset;
+ if (new_size < size)
+ return (ENOSPC);
+ } else {
s = find_provcfg(pp, "start");
new_lba = (off_t)strtoimax(s, NULL, 0);
/*
* Is there any free space between current and
* next providers?
*/
- new_lba = ALIGNUP(new_lba, alignment);
+ new_lba = ALIGNDOWN(new_lba + offset, alignment) - offset;
if (new_lba > lba)
new_size = new_lba - start;
else {
@@ -482,10 +492,12 @@ gpart_autofill(struct gctl_req *req)
if (has_size && has_start && !has_alignment)
goto done;
- /* Adjust parameters to offset value for better alignment */
- s = find_provcfg(pp, "offset");
- offset = (s == NULL) ? 0:
- (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize;
+ len = pp->lg_stripesize / pp->lg_sectorsize;
+ if (len > 0 && !has_alignment)
+ alignment = len;
+
+ /* Adjust parameters to stripeoffset */
+ offset = pp->lg_stripeoffset / pp->lg_sectorsize;
start = ALIGNUP(start + offset, alignment);
if (size + offset > alignment)
size = ALIGNDOWN(size + offset, alignment);
@@ -915,6 +927,7 @@ gpart_restore(struct gctl_req *req, unsigned int fl __unused)
gctl_ro_param(r, "size", -1, argv[3]);
if (rl != 0 && label != NULL)
gctl_ro_param(r, "label", -1, argv[4]);
+ gctl_ro_param(r, "alignment", -1, GPART_AUTOFILL);
gctl_ro_param(r, "arg0", -1, s);
error = gpart_autofill(r);
if (error != 0)
diff --git a/sbin/geom/class/part/gpart.8 b/sbin/geom/class/part/gpart.8
index 436a1a0..4365d6b 100644
--- a/sbin/geom/class/part/gpart.8
+++ b/sbin/geom/class/part/gpart.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 03, 2011
+.Dd June 6, 2011
.Dt GPART 8
.Os
.Sh NAME
@@ -61,7 +61,8 @@ which is used to define a logical partition.
The
.Dv GEOM_PART_EBR_COMPAT
option enables backward compatibility for partition names
-in the EBR scheme. Also it makes impossible any types of actions
+in the EBR scheme.
+Also it makes impossible any types of actions
with such partitions.
The
.Dv GEOM_PART_GPT
@@ -170,7 +171,8 @@ utility:
.\" ==== SHOW ====
.Nm
.Cm show
-.Op Fl lrp
+.Op Fl l | r
+.Op Fl p
.Op Ar geom ...
.\" ==== UNDO ====
.Nm
@@ -199,11 +201,14 @@ The partition begins on the logical block address given by the
option.
Its size is given by the
.Fl s Ar size
-option. SI unit suffixes are allowed. One or both
+option.
+SI unit suffixes are allowed.
+One or both
.Fl b
and
.Fl s
-options can be omitted. If so they are automatically calculated.
+options can be omitted.
+If so they are automatically calculated.
The type of the partition is given by the
.Fl t Ar type
option.
@@ -398,7 +403,7 @@ about its use.
Recover corrupt partition's scheme metadata on the geom
.Ar geom .
See the section entitled
-.Sx "RECOVERING"
+.Sx RECOVERING
below for the additional information.
.Pp
Additional options include:
@@ -452,7 +457,7 @@ action and given from standard input.
Only partition table may be restored.
This action does not affect content of partitions.
This mean that you should copy your data from backup after restoring
-partition table and write bootcode again if it is needed.
+partition table and write bootcode again if it is needed.
.Pp
Additional options include:
.Bl -tag -width 10n
@@ -473,7 +478,7 @@ about its use.
.It Cm set
Set the named attribute on the partition entry.
See the section entitled
-.Sx "ATTRIBUTES"
+.Sx ATTRIBUTES
below for a list of available attributes.
.Pp
Additional options include:
@@ -510,7 +515,7 @@ action and can be used to undo any changes that have not been committed.
.It Cm unset
Clear the named attribute on the partition entry.
See the section entitled
-.Sx "ATTRIBUTES"
+.Sx ATTRIBUTES
below for a list of available attributes.
.Pp
Additional options include:
@@ -525,16 +530,17 @@ about its use.
.El
.\"
.Sh PARTITION TYPES
+Partition types are identified on disk by particular strings or magic
+values.
The
.Nm
-utility uses symbolic names for common partition types to avoid that the
-user needs to know what the partitioning scheme in question is and what
-the actual number or identification needs to be used for a particular
-type.
+utility uses symbolic names for common partition types to avoid the
+user needing to know these values or other details of the partitioning
+scheme in question.
The
.Nm
utility also allows the user to specify scheme-specific partition types
-for partition types that do not have symbol names.
+for partition types that do not have symbolic names.
The symbolic names currently understood are:
.Bl -tag -width ".Cm freebsd-vinum"
.It Cm bios-boot
@@ -615,75 +621,75 @@ by GPT.
.El
.Sh ATTRIBUTES
The scheme-specific attributes for EBR:
-.Bl -tag -width ".Ar active"
-.It Ar active
+.Bl -tag -width ".Cm active"
+.It Cm active
.El
.Pp
The scheme-specific attributes for GPT:
-.Bl -tag -width ".Ar bootfailed"
-.It Ar bootme
+.Bl -tag -width ".Cm bootfailed"
+.It Cm bootme
When set, the
.Nm gptboot
stage 1 boot loader will try to boot the system from this partition.
Multiple partitions might be marked with the
-.Ar bootme
+.Cm bootme
attribute.
In such scenario the
.Nm gptboot
will try all
-.Ar bootme
+.Cm bootme
partitions one by one, until the next boot stage is successfully entered.
-.It Ar bootonce
+.It Cm bootonce
Setting this attribute automatically sets the
-.Ar bootme
+.Cm bootme
attribute.
When set, the
.Nm gptboot
stage 1 boot loader will try to boot the system from this partition only once.
Partitions with both
-.Ar bootonce
+.Cm bootonce
and
-.Ar bootme
+.Cm bootme
attributes are tried before partitions with only the
-.Ar bootme
+.Cm bootme
attribute.
Before
-.Ar bootonce
+.Cm bootonce
partition is tried, the
.Nm gptboot
removes the
-.Ar bootme
+.Cm bootme
attribute and tries to execute the next boot stage.
If it fails, the
-.Ar bootonce
+.Cm bootonce
attribute that is now alone is replaced with the
-.Ar bootfailed
+.Cm bootfailed
attribute.
If the execution of the next boot stage succeeds, but the system is not fully
booted, the
.Nm gptboot
will look for
-.Ar bootonce
+.Cm bootonce
attributes alone (without the
-.Ar bootme
+.Cm bootme
attribute) on the next system boot and will replace those with the
-.Ar bootfailed
+.Cm bootfailed
attribute.
If the system is fully booted, the
.Pa /etc/rc.d/gptboot
start-up script will look for partition with the
-.Ar bootonce
+.Cm bootonce
attribute alone, will remove the attribute and log that the system was
successfully booted from this partition.
There should be at most one
-.Ar bootonce
+.Cm bootonce
partition when system is successfully booted.
Multiple partitions might be marked with the
-.Ar bootonce
+.Cm bootonce
and
-.Ar bootme
+.Cm bootme
attribute pairs.
-.It Ar bootfailed
+.It Cm bootfailed
This attribute should not be manually managed.
It is managed by the
.Nm gptboot
@@ -691,24 +697,24 @@ stage 1 boot loader and the
.Pa /etc/rc.d/gptboot
start-up script.
This attribute is used to mark partitions that had the
-.Ar bootonce
+.Cm bootonce
attribute set, but we failed to boot from them.
Once we successfully boot, the
.Pa /etc/rc.d/gptboot
script will log all the partitions we failed to boot from and will remove the
-.Ar bootfailed
+.Cm bootfailed
attributes.
.El
.Pp
The scheme-specific attributes for MBR:
-.Bl -tag -width ".Ar active"
-.It Ar active
+.Bl -tag -width ".Cm active"
+.It Cm active
.El
.Pp
The scheme-specific attributes for PC98:
-.Bl -tag -width ".Ar bootable"
-.It Ar active
-.It Ar bootable
+.Bl -tag -width ".Cm bootable"
+.It Cm active
+.It Cm bootable
.El
.Sh OPERATIONAL FLAGS
Actions other than the
@@ -735,30 +741,30 @@ action or reverted with the
.Cm undo
action.
.Sh RECOVERING
-The GEOM class PART supports recovering of partition tables only for GPT.
+The GEOM PART class supports recovering of partition tables only for GPT.
The GUID partition table has a primary and secondary (backup) copy of
-metadata for redundance.
-They are stored in the begining and in the end of device respectively.
-Therefore it is acceptable to have some corruptions in the metadata that
-are not fatal to work with GPT.
-When kernel detects corrupt metadata it marks this table as corrupt and
-reports about corruption.
-Any changes in corrupt table are prohibited except
+metadata for redundance, these are stored at the begining and the end
+of the device respectively.
+As a result of having two copies, it is acceptable to have some corruption
+within the metadata that is not fatal to the working of GPT.
+When the kernel detects corrupt metadata it marks this table as corrupt and
+reports the corruption.
+Any operations on corrupt tables are prohibited except for
.Cm destroy
and
-.Cm recover .
+.Cm recover .
.Pp
-In case when only first sector is corrupt kernel can not detect GPT even
-if partition table is not corrupt.
-You can write protective MBR with
+If the first sector of a provider is corrupt, the kernel can not detect GPT
+even if partition table itself is not corrupt.
+You can rewrite the protective MBR using the
.Xr dd 1
-command to restore ability of GPT detection.
-The copy of protective MBR is usually located in the
+command, to restore the ability to detect the GPT.
+The copy of the protective MBR is usually located in the
.Pa /boot/pmbr
file.
.Pp
-In case when some of metadata is corrupt you will get to know about this
-from kernel's messages like these:
+If one GPT header appears to be corrupt but the other copy remains intact,
+the kernel will log the following:
.Bd -literal -offset indent
GEOM: provider: the primary GPT table is corrupt or invalid.
GEOM: provider: using the secondary instead -- recovery strongly advised.
@@ -770,47 +776,63 @@ GEOM: provider: the secondary GPT table is corrupt or invalid.
GEOM: provider: using the primary only -- recovery suggested.
.Ed
.Pp
-Also
-.Cm gpart
-commands like
-.Cm show ,
-.Cm status
+Also
+.Nm
+commands such as
+.Cm show , status
and
.Cm list
-will report about corrupt table.
+will report about corrupt tables.
.Pp
-In case when the size of device has changed (e.g. volume expansion) the
-secondary GPT header will become located not in the last sector.
+If the size of the device has changed (e.g.\& volume expansion) the
+secondary GPT header will no longer be located in the last sector.
This is not a metadata corruption, but it is dangerous because any
-corruption of the primary GPT will lead to lost of partition table.
-Kernel reports about this problem with message:
+corruption of the primary GPT will lead to loss of partition table.
+This problem is reported by the kernel with the message:
.Bd -literal -offset indent
GEOM: provider: the secondary GPT header is not in the last LBA.
.Ed
.Pp
-A corrupt table can be recovered with
-.Cm gpart recover
+This situation can be recovered with the
+.Cm recover
command.
-This command does reconstruction of corrupt metadata using
-known valid metadata.
-Also it can relocate secondary GPT to the end of device.
-.Pp
-.Pa NOTE :
-The GEOM class PART can detect the same partition table on different GEOM
-providers and some of them will be marked as corrupt.
-Be careful when choosing a provider for recovering.
+This command reconstructs the corrupt metadata using known valid
+metadata and relocates the secondary GPT to the end of the device.
+.Pp
+.Em NOTE :
+The GEOM PART class can detect the same partition table visible through
+different GEOM providers, and some of them will be marked as corrupt.
+Be careful when choosing a provider for recovery.
If you choose incorrectly you can destroy the metadata of another GEOM class,
-e.g. GEOM MIRROR or GEOM LABEL.
+e.g.\& GEOM MIRROR or GEOM LABEL.
+.Sh SYSCTL VARIABLES
+The following
+.Xr sysctl 8
+variables can be used to control the behavior of the
+.Nm PART
+GEOM class.
+The default value is shown next to each variable.
+.Bl -tag -width indent
+.It Va kern.geom.part.check_integrity : No 1
+This variable controls the behaviour of metadata integrity checks.
+When integrity checks are enabled, the
+.Nm PART
+GEOM class verifies all generic partition parameters obtained from the
+disk metadata.
+If some inconsistency is detected, the partition table will be
+rejected with a diagnostic message:
+.Sy "GEOM_PART: Integrity check failed (provider, scheme)" .
+.El
.Sh EXIT STATUS
Exit status is 0 on success, and 1 if the command fails.
.Sh EXAMPLES
Create GPT scheme on
-.Pa ad0 .
+.Pa ad0 :
.Bd -literal -offset indent
/sbin/gpart create -s GPT ad0
.Ed
.Pp
-Embed GPT bootstrap code into protective MBR.
+Embed GPT bootstrap code into protective MBR:
.Bd -literal -offset indent
/sbin/gpart bootcode -b /boot/pmbr ad0
.Ed
@@ -836,20 +858,57 @@ future need (e.g.\& from a ZFS partition).
.Pp
Create a 512MB-sized
.Cm freebsd-ufs
-partition that would contain UFS where the system boots from.
+partition that would contain UFS where the system boots from:
.Bd -literal -offset indent
/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0
.Ed
.Pp
+Create MBR scheme on
+.Pa ada0 ,
+then create 30GB-sized
+.Fx
+slice, mark it active and
+install
+.Nm boot0
+boot manager:
+.Bd -literal -offset indent
+/sbin/gpart create -s MBR ada0
+/sbin/gpart add -t freebsd -s 30G ada0
+/sbin/gpart set -a active -i 1 ada0
+/sbin/gpart bootcode -b /boot/boot0 ada0
+.Ed
+.Pp
+Now create
+.Bx
+scheme
+.Pf ( Bx
+label) with ability to have up to 20 partitions:
+.Bd -literal -offset indent
+/sbin/gpart create -s BSD -n 20 ada0s1
+.Ed
+.Pp
+Create 1GB-sized UFS partition and 4GB-sized swap partition:
+.Bd -literal -offset indent
+/sbin/gpart add -t freebsd-ufs -s 1G ada0s1
+/sbin/gpart add -t freebsd-swap -s 4G ada0s1
+.Ed
+.Pp
+Install bootstrap code for the
+.Bx
+label:
+.Bd -literal -offset indent
+/sbin/gpart bootcode -b /boot/boot ada0s1
+.Ed
+.Pp
Create VTOC8 scheme on
-.Pa da0 .
+.Pa da0 :
.Bd -literal -offset indent
/sbin/gpart create -s VTOC8 da0
.Ed
.Pp
Create a 512MB-sized
.Cm freebsd-ufs
-partition that would contain UFS where the system boots from.
+partition that would contain UFS where the system boots from:
.Bd -literal -offset indent
/sbin/gpart add -s 512M -t freebsd-ufs da0
.Ed
@@ -861,29 +920,29 @@ partition that would contain UFS and aligned on 4KB boundaries:
/sbin/gpart add -s 15G -t freebsd-ufs -a 4k da0
.Ed
.Pp
-After having created all required partitions, embed bootstrap code into them.
+After having created all required partitions, embed bootstrap code into them:
.Bd -literal -offset indent
/sbin/gpart bootcode -p /boot/boot1 da0
.Ed
.Pp
Create backup of partition table from
-.Pa da0
+.Pa da0 :
.Bd -literal -offset indent
/sbin/gpart backup da0 > da0.backup
.Ed
.Pp
Restore partition table from backup to
-.Pa da0
+.Pa da0 :
.Bd -literal -offset indent
/sbin/gpart restore -l da0 < /mnt/da0.backup
.Ed
.Pp
-Clone partition table from
-.Pa ada0
-to
-.Pa ada1
-and
-.Pa ada2
+Clone partition table from
+.Pa ada0
+to
+.Pa ada1
+and
+.Pa ada2 :
.Bd -literal -offset indent
/sbin/gpart backup ada0 | /sbin/gpart restore -F ada1 ada2
.Ed
diff --git a/sbin/geom/class/sched/Makefile b/sbin/geom/class/sched/Makefile
index a6ccd58..6f54d3f 100644
--- a/sbin/geom/class/sched/Makefile
+++ b/sbin/geom/class/sched/Makefile
@@ -5,6 +5,4 @@
GEOM_CLASS= sched
-WARNS?= 6
-
.include <bsd.lib.mk>
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c
index 1f6585c..af0f353 100644
--- a/sbin/hastd/primary.c
+++ b/sbin/hastd/primary.c
@@ -726,11 +726,13 @@ init_remote(struct hast_resource *res, struct proto_conn **inp,
(void)hast_activemap_flush(res);
}
nv_free(nvin);
+#ifdef notyet
/* Setup directions. */
if (proto_send(out, NULL, 0) == -1)
pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
if (proto_recv(in, NULL, 0) == -1)
pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
+#endif
pjdlog_info("Connected to %s.", res->hr_remoteaddr);
if (inp != NULL && outp != NULL) {
*inp = in;
@@ -1243,7 +1245,7 @@ local_send_thread(void *arg)
ggio->gctl_offset + res->hr_localoff);
if (ret == ggio->gctl_length)
hio->hio_errors[ncomp] = 0;
- else {
+ else if (!ISSYNCREQ(hio)) {
/*
* If READ failed, try to read from remote node.
*/
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c
index 1597af8..7120d3d 100644
--- a/sbin/hastd/secondary.c
+++ b/sbin/hastd/secondary.c
@@ -183,9 +183,11 @@ init_remote(struct hast_resource *res, struct nv *nvin)
unsigned char *map;
size_t mapsize;
+#ifdef notyet
/* Setup direction. */
if (proto_send(res->hr_remoteout, NULL, 0) == -1)
pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
+#endif
map = NULL;
mapsize = 0;
@@ -351,9 +353,11 @@ init_remote(struct hast_resource *res, struct nv *nvin)
if (map != NULL)
free(map);
nv_free(nvout);
+#ifdef notyet
/* Setup direction. */
if (proto_recv(res->hr_remotein, NULL, 0) == -1)
pjdlog_errno(LOG_WARNING, "Unable to set connection direction");
+#endif
if (res->hr_secondary_localcnt > res->hr_primary_remotecnt &&
res->hr_primary_localcnt > res->hr_secondary_remotecnt) {
/* Exit on split-brain. */
diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile
index 77491f2..461de71 100644
--- a/sbin/ifconfig/Makefile
+++ b/sbin/ifconfig/Makefile
@@ -15,10 +15,16 @@ SRCS= ifconfig.c # base support
# of the toolchain.
#
SRCS+= af_link.c # LLC support
+.if ${MK_INET_SUPPORT} != "no"
SRCS+= af_inet.c # IPv4 support
+.endif
+.if ${MK_INET6_SUPPORT} != "no"
SRCS+= af_inet6.c # IPv6 support
+.endif
SRCS+= af_atalk.c # AppleTalk support
+.if ${MK_INET6_SUPPORT} != "no"
SRCS+= af_nd6.c # ND6 support
+.endif
SRCS+= ifclone.c # clone device support
SRCS+= ifmac.c # MAC support
@@ -38,6 +44,12 @@ SRCS+= ifpfsync.c # pfsync(4) support
SRCS+= ifbridge.c # bridge support
SRCS+= iflagg.c # lagg support
+.if ${MK_INET6_SUPPORT} != "no"
+CFLAGS+= -DINET6
+.endif
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+= -DINET
+.endif
.if ${MK_IPX_SUPPORT} != "no" && !defined(RELEASE_CRUNCH)
SRCS+= af_ipx.c # IPX support
DPADD+= ${LIBIPX}
diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c
index 2e27114..6b4d735 100644
--- a/sbin/ifconfig/af_inet.c
+++ b/sbin/ifconfig/af_inet.c
@@ -200,5 +200,7 @@ static struct afswtch af_inet = {
static __constructor void
inet_ctor(void)
{
+ if (!feature_present("inet"))
+ return;
af_register(&af_inet);
}
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
index 8fc143a..585be05 100644
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -69,6 +69,7 @@ static int explicit_prefix = 0;
extern void setnd6flags(const char *, int, int, const struct afswtch *);
extern void setnd6defif(const char *, int, int, const struct afswtch *);
+extern void nd6_status(int);
static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/
@@ -498,6 +499,8 @@ static struct cmd inet6_cmds[] = {
DEF_CMD("-autoconf", -IN6_IFF_AUTOCONF, setip6flags),
DEF_CMD("accept_rtadv", ND6_IFF_ACCEPT_RTADV, setnd6flags),
DEF_CMD("-accept_rtadv",-ND6_IFF_ACCEPT_RTADV, setnd6flags),
+ DEF_CMD("no_radr", ND6_IFF_NO_RADR, setnd6flags),
+ DEF_CMD("-no_radr", -ND6_IFF_NO_RADR, setnd6flags),
DEF_CMD("defaultif", 1, setnd6defif),
DEF_CMD("-defaultif", -1, setnd6defif),
DEF_CMD("ifdisabled", ND6_IFF_IFDISABLED, setnd6flags),
@@ -519,6 +522,7 @@ static struct afswtch af_inet6 = {
.af_status = in6_status,
.af_getaddr = in6_getaddr,
.af_getprefix = in6_getprefix,
+ .af_other_status = nd6_status,
.af_postproc = in6_postproc,
.af_status_tunnel = in6_status_tunnel,
.af_settunnel = in6_set_tunnel,
@@ -541,6 +545,9 @@ inet6_ctor(void)
#define N(a) (sizeof(a) / sizeof(a[0]))
size_t i;
+ if (!feature_present("inet6"))
+ return;
+
for (i = 0; i < N(inet6_cmds); i++)
cmd_register(&inet6_cmds[i]);
af_register(&af_inet6);
diff --git a/sbin/ifconfig/af_nd6.c b/sbin/ifconfig/af_nd6.c
index e6b920a..eed00ea 100644
--- a/sbin/ifconfig/af_nd6.c
+++ b/sbin/ifconfig/af_nd6.c
@@ -58,11 +58,12 @@ static const char rcsid[] =
#define MAX_SYSCTL_TRY 5
#define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \
"\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \
- "\020DEFAULTIF"
+ "\007NO_RADR\020DEFAULTIF"
static int isnd6defif(int);
void setnd6flags(const char *, int, int, const struct afswtch *);
void setnd6defif(const char *, int, int, const struct afswtch *);
+void nd6_status(int);
void
setnd6flags(const char *dummyaddr __unused,
@@ -136,64 +137,13 @@ isnd6defif(int s)
return (ndifreq.ifindex == ifindex);
}
-static void
+void
nd6_status(int s)
{
struct in6_ndireq nd;
- struct rt_msghdr *rtm;
- size_t needed;
- char *buf, *next;
- int mib[6], ntry;
int s6;
int error;
- int isinet6, isdefif;
-
- /* Check if the interface has at least one IPv6 address. */
- mib[0] = CTL_NET;
- mib[1] = PF_ROUTE;
- mib[2] = 0;
- mib[3] = AF_INET6;
- mib[4] = NET_RT_IFLIST;
- mib[5] = if_nametoindex(ifr.ifr_name);
-
- /* Try to prevent a race between two sysctls. */
- ntry = 0;
- do {
- error = sysctl(mib, 6, NULL, &needed, NULL, 0);
- if (error) {
- warn("sysctl(NET_RT_IFLIST)/estimate");
- return;
- }
- buf = malloc(needed);
- if (buf == NULL) {
- warn("malloc for sysctl(NET_RT_IFLIST) failed");
- return;
- }
- if ((error = sysctl(mib, 6, buf, &needed, NULL, 0)) < 0) {
- if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) {
- warn("sysctl(NET_RT_IFLIST)/get");
- free(buf);
- return;
- }
- free(buf);
- buf = NULL;
- }
- } while (buf == NULL);
-
- isinet6 = 0;
- for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
- rtm = (struct rt_msghdr *)next;
-
- if (rtm->rtm_version != RTM_VERSION)
- continue;
- if (rtm->rtm_type == RTM_NEWADDR) {
- isinet6 = 1;
- break;
- }
- }
- free(buf);
- if (!isinet6)
- return;
+ int isdefif;
memset(&nd, 0, sizeof(nd));
strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname));
@@ -215,15 +165,3 @@ nd6_status(int s)
(unsigned int)(nd.ndi.flags | (isdefif << 15)), ND6BITS);
putchar('\n');
}
-
-static struct afswtch af_nd6 = {
- .af_name = "nd6",
- .af_af = AF_LOCAL,
- .af_other_status= nd6_status,
-};
-
-static __constructor void
-nd6_ctor(void)
-{
- af_register(&af_nd6);
-}
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index e28178a..45cf59b 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -28,7 +28,7 @@
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\" $FreeBSD$
.\"
-.Dd March 20, 2011
+.Dd May 31, 2011
.Dt IFCONFIG 8
.Os
.Sh NAME
@@ -42,7 +42,7 @@
.Op Fl n
.Ar interface
.Op Cm create
-.Op Ar address_family
+.Ar address_family
.Oo
.Ar address
.Op Ar dest_address
@@ -165,8 +165,10 @@ and
.Dq link .
.\" and
.\" .Dq ns .
-The default is
-.Dq inet .
+The default if available is
+.Dq inet
+or otherwise
+.Dq link .
.Dq ether
and
.Dq lladdr
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 7c5d351..408d77e 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -220,8 +220,10 @@ main(int argc, char *argv[])
ifindex = 0;
if (argc == 1) {
afp = af_getbyname(*argv);
- if (afp == NULL)
+ if (afp == NULL) {
+ warnx("Address family '%s' unknown.", *argv);
usage();
+ }
if (afp->af_name != NULL)
argc--, argv++;
/* leave with afp non-zero */
@@ -484,7 +486,28 @@ ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp)
int s;
strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name);
- afp = uafp != NULL ? uafp : af_getbyname("inet");
+ afp = NULL;
+ if (uafp != NULL)
+ afp = uafp;
+ /*
+ * This is the historical "accident" allowing users to configure IPv4
+ * addresses without the "inet" keyword which while a nice feature has
+ * proven to complicate other things. We cannot remove this but only
+ * make sure we will never have a similar implicit default for IPv6 or
+ * any other address familiy. We need a fallback though for
+ * ifconfig IF up/down etc. to work without INET support as people
+ * never used ifconfig IF link up/down, etc. either.
+ */
+#ifdef INET
+ if (afp == NULL && feature_present("inet"))
+ afp = af_getbyname("inet");
+#endif
+ if (afp == NULL)
+ afp = af_getbyname("link");
+ if (afp == NULL) {
+ warnx("Please specify an address_family.");
+ usage();
+ }
top:
ifr.ifr_addr.sa_family =
afp->af_af == AF_LINK || afp->af_af == AF_UNSPEC ?
@@ -885,7 +908,7 @@ unsetifdescr(const char *val, int value, int s, const struct afswtch *afp)
#define IFCAPBITS \
"\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \
"\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \
-"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE"
+"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP"
/*
* Print the status of the interface. If an address family was
diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8
index 710996b..4a22320 100644
--- a/sbin/ipfw/ipfw.8
+++ b/sbin/ipfw/ipfw.8
@@ -1,7 +1,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 27, 2010
+.Dd June 14, 2011
.Dt IPFW 8
.Os
.Sh NAME
@@ -871,13 +871,16 @@ for more information on
and
.Cm ngtee
actions.
-.It Cm setfib Ar fibnum
+.It Cm setfib Ar fibnum | tablearg
The packet is tagged so as to use the FIB (routing table)
.Ar fibnum
in any subsequent forwarding decisions.
Initially this is limited to the values 0 through 15, see
.Xr setfib 1 .
Processing continues at the next rule.
+It is possible to use the
+.Cm tablearg
+keyword with a setfib. If tablearg value is not within compiled FIB range packet fib is set to 0.
.It Cm reass
Queue and reassemble ip fragments.
If the packet is not fragmented, counters are updated and processing continues with the next rule.
@@ -1711,7 +1714,7 @@ is used.
The
.Cm tablearg
argument can be used with the following actions:
-.Cm nat, pipe , queue, divert, tee, netgraph, ngtee, fwd, skipto
+.Cm nat, pipe , queue, divert, tee, netgraph, ngtee, fwd, skipto, setfib,
action parameters:
.Cm tag, untag,
rule options:
@@ -2432,6 +2435,27 @@ Reset table of the packet aliasing engine on address change.
Reverse the way libalias handles aliasing.
.It Cm proxy_only
Obey transparent proxy rules only, packet aliasing is not performed.
+.It Cm skip_global
+Skip instance in case of global state lookup (see below).
+.El
+.Pp
+Some specials value can be supplied instead of
+.Va nat_number:
+.Bl -tag -width indent
+.It Cm global
+Looks up translation state in all configured nat instances.
+If an entry is found, packet is aliased according to that entry.
+If no entry was found in any of the instances, packet is passed unchanged,
+and no new entry will be created.
+See section
+.Sx MULTIPLE INSTANCES
+in
+.Xr natd 8
+for more information.
+.It Cm tablearg
+Uses argument supplied in lookup table. See
+.Sx LOOKUP TABLES
+section below for more information on lookup tables.
.El
.Pp
To let the packet continue after being (de)aliased, set the sysctl variable
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index ad871fe..64e5eb1 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -21,6 +21,7 @@
*/
#include <sys/types.h>
+#include <sys/param.h>
#include <sys/socket.h>
#include <sys/sockio.h>
#include <sys/sysctl.h>
@@ -1121,8 +1122,11 @@ show_ipfw(struct ip_fw *rule, int pcwidth, int bcwidth)
break;
case O_NAT:
- PRINT_UINT_ARG("nat ", cmd->arg1);
- break;
+ if (cmd->arg1 != 0)
+ PRINT_UINT_ARG("nat ", cmd->arg1);
+ else
+ printf("nat global");
+ break;
case O_SETFIB:
PRINT_UINT_ARG("setfib ", cmd->arg1);
@@ -2738,9 +2742,14 @@ ipfw_add(char *av[])
break;
case TOK_NAT:
- action->opcode = O_NAT;
- action->len = F_INSN_SIZE(ipfw_insn_nat);
- goto chkarg;
+ action->opcode = O_NAT;
+ action->len = F_INSN_SIZE(ipfw_insn_nat);
+ if (_substrcmp(*av, "global") == 0) {
+ action->arg1 = 0;
+ av++;
+ break;
+ } else
+ goto chkarg;
case TOK_QUEUE:
action->opcode = O_QUEUE;
@@ -2835,14 +2844,19 @@ chkarg:
size_t intsize = sizeof(int);
action->opcode = O_SETFIB;
- NEED1("missing fib number");
- action->arg1 = strtoul(*av, NULL, 10);
- if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1)
- errx(EX_DATAERR, "fibs not suported.\n");
- if (action->arg1 >= numfibs) /* Temporary */
- errx(EX_DATAERR, "fib too large.\n");
- av++;
- break;
+ NEED1("missing fib number");
+ if (_substrcmp(*av, "tablearg") == 0) {
+ action->arg1 = IP_FW_TABLEARG;
+ } else {
+ action->arg1 = strtoul(*av, NULL, 10);
+ if (sysctlbyname("net.fibs", &numfibs, &intsize,
+ NULL, 0) == -1)
+ errx(EX_DATAERR, "fibs not suported.\n");
+ if (action->arg1 >= numfibs) /* Temporary */
+ errx(EX_DATAERR, "fib too large.\n");
+ }
+ av++;
+ break;
}
case TOK_REASS:
@@ -3554,7 +3568,7 @@ read_options:
}
if (lookup_key[j] <= 0)
errx(EX_USAGE, "format: cannot lookup on %s", *av);
- c->d[1] = j; // i converted to option
+ __PAST_END(c->d, 1) = j; // i converted to option
av++;
cmd->arg1 = strtoul(*av, &p, 0);
if (p && *p)
diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h
index c9f8687..9562f32 100644
--- a/sbin/ipfw/ipfw2.h
+++ b/sbin/ipfw/ipfw2.h
@@ -178,6 +178,7 @@ enum tokens {
TOK_DENY_INC,
TOK_SAME_PORTS,
TOK_UNREG_ONLY,
+ TOK_SKIP_GLOBAL,
TOK_RESET_ADDR,
TOK_ALIAS_REV,
TOK_PROXY_ONLY,
diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c
index fb3f3fb..109b62b 100644
--- a/sbin/ipfw/main.c
+++ b/sbin/ipfw/main.c
@@ -356,6 +356,7 @@ ipfw_main(int oldac, char **oldav)
*/
co.do_nat = 0;
co.do_pipe = 0;
+ co.use_set = 0;
if (!strncmp(*av, "nat", strlen(*av)))
co.do_nat = 1;
else if (!strncmp(*av, "pipe", strlen(*av)))
@@ -444,7 +445,7 @@ static void
ipfw_readfile(int ac, char *av[])
{
#define MAX_ARGS 32
- char buf[BUFSIZ];
+ char buf[4096];
char *progname = av[0]; /* original program name */
const char *cmd = NULL; /* preprocessor name, if any */
const char *filename = av[ac-1]; /* file to read */
@@ -552,7 +553,7 @@ ipfw_readfile(int ac, char *av[])
}
}
- while (fgets(buf, BUFSIZ, f)) { /* read commands */
+ while (fgets(buf, sizeof(buf), f)) { /* read commands */
char linename[20];
char *args[2];
diff --git a/sbin/ipfw/nat.c b/sbin/ipfw/nat.c
index 0331d383..ecb5d8a 100644
--- a/sbin/ipfw/nat.c
+++ b/sbin/ipfw/nat.c
@@ -53,6 +53,7 @@ static struct _s_x nat_params[] = {
{ "deny_in", TOK_DENY_INC },
{ "same_ports", TOK_SAME_PORTS },
{ "unreg_only", TOK_UNREG_ONLY },
+ { "skip_global", TOK_SKIP_GLOBAL },
{ "reset", TOK_RESET_ADDR },
{ "reverse", TOK_ALIAS_REV },
{ "proxy_only", TOK_PROXY_ONLY },
@@ -314,14 +315,19 @@ static int
estimate_redir_addr(int *ac, char ***av)
{
size_t space = sizeof(struct cfg_redir);
- char *sep;
+ char *sep = **av;
+ u_int c = 0;
- if ((sep = strtok(**av, ",")) != NULL) {
- space += sizeof(struct cfg_spool);
- while ((sep = strtok(NULL, ",")) != NULL)
- space += sizeof(struct cfg_spool);
+ while ((sep = strchr(sep, ',')) != NULL) {
+ c++;
+ sep++;
}
+ if (c > 0)
+ c++;
+
+ space += c * sizeof(struct cfg_spool);
+
return (space);
}
@@ -369,14 +375,19 @@ static int
estimate_redir_port(int *ac, char ***av)
{
size_t space = sizeof(struct cfg_redir);
- char *sep;
+ char *sep = **av;
+ u_int c = 0;
- if ((sep = strtok(**av, ",")) != NULL) {
- space += sizeof(struct cfg_spool);
- while ((sep = strtok(NULL, ",")) != NULL)
- space += sizeof(struct cfg_spool);
+ while ((sep = strchr(sep, ',')) != NULL) {
+ c++;
+ sep++;
}
+ if (c > 0)
+ c++;
+
+ space += c * sizeof(struct cfg_spool);
+
return (space);
}
@@ -464,10 +475,10 @@ setup_redir_port(char *buf, int *ac, char ***av)
* Extract remote address and optionally port.
*/
/*
- * NB: isalpha(**av) => we've to check that next parameter is really an
+ * NB: isdigit(**av) => we've to check that next parameter is really an
* option for this redirect entry, else stop here processing arg[cv].
*/
- if (*ac != 0 && !isalpha(***av)) {
+ if (*ac != 0 && isdigit(***av)) {
if ((sep = strchr(**av, ':')) != NULL) {
if (StrToAddrAndPortRange(**av, &r->raddr, protoName,
&portRange) != 0)
@@ -583,7 +594,7 @@ setup_redir_proto(char *buf, int *ac, char ***av)
r->raddr.s_addr = INADDR_ANY;
} else {
/* see above in setup_redir_port() */
- if (!isalpha(***av)) {
+ if (isdigit(***av)) {
StrToAddr(**av, &r->paddr);
(*av)++; (*ac)--;
@@ -591,7 +602,7 @@ setup_redir_proto(char *buf, int *ac, char ***av)
* Extract optional remote address.
*/
/* see above in setup_redir_port() */
- if (*ac != 0 && !isalpha(***av)) {
+ if (*ac != 0 && isdigit(***av)) {
StrToAddr(**av, &r->raddr);
(*av)++; (*ac)--;
}
@@ -628,6 +639,9 @@ print_nat_config(unsigned char *buf)
} else if (n->mode & PKT_ALIAS_SAME_PORTS) {
printf(" same_ports");
n->mode &= ~PKT_ALIAS_SAME_PORTS;
+ } else if (n->mode & PKT_ALIAS_SKIP_GLOBAL) {
+ printf(" skip_global");
+ n->mode &= ~PKT_ALIAS_SKIP_GLOBAL;
} else if (n->mode & PKT_ALIAS_UNREGISTERED_ONLY) {
printf(" unreg_only");
n->mode &= ~PKT_ALIAS_UNREGISTERED_ONLY;
@@ -721,16 +735,18 @@ ipfw_config_nat(int ac, char **av)
{
struct cfg_nat *n; /* Nat instance configuration. */
int i, off, tok, ac1;
- char *id, *buf, **av1;
+ char *id, *buf, **av1, *end;
size_t len;
av++; ac--;
/* Nat id. */
- if (ac && isdigit(**av)) {
- id = *av;
- ac--; av++;
- } else
+ if (ac == 0)
errx(EX_DATAERR, "missing nat id");
+ id = *av;
+ i = (int)strtol(id, &end, 0);
+ if (i <= 0 || *end != '\0')
+ errx(EX_DATAERR, "illegal nat id: %s", id);
+ av++; ac--;
if (ac == 0)
errx(EX_DATAERR, "missing option");
@@ -744,10 +760,11 @@ ipfw_config_nat(int ac, char **av)
case TOK_IP:
case TOK_IF:
ac1--; av1++;
- break;
+ break;
case TOK_ALOG:
case TOK_DENY_INC:
case TOK_SAME_PORTS:
+ case TOK_SKIP_GLOBAL:
case TOK_UNREG_ONLY:
case TOK_RESET_ADDR:
case TOK_ALIAS_REV:
@@ -767,6 +784,9 @@ ipfw_config_nat(int ac, char **av)
av1++; ac1--;
len += estimate_redir_port(&ac1, &av1);
av1 += 2; ac1 -= 2;
+ /* Skip optional remoteIP/port */
+ if (ac1 != 0 && isdigit(**av1))
+ av1++; ac1--;
break;
case TOK_REDIR_PROTO:
if (ac1 < 2)
@@ -774,6 +794,11 @@ ipfw_config_nat(int ac, char **av)
"not enough arguments");
len += sizeof(struct cfg_redir);
av1 += 2; ac1 -= 2;
+ /* Skip optional remoteIP/port */
+ if (ac1 != 0 && isdigit(**av1))
+ av1++; ac1--;
+ if (ac1 != 0 && isdigit(**av1))
+ av1++; ac1--;
break;
default:
errx(EX_DATAERR, "unrecognised option ``%s''", av1[-1]);
@@ -787,7 +812,6 @@ ipfw_config_nat(int ac, char **av)
off = sizeof(*n);
memset(buf, 0, len);
n = (struct cfg_nat *)buf;
- i = atoi(id);
n->id = i;
while (ac > 0) {
@@ -820,6 +844,9 @@ ipfw_config_nat(int ac, char **av)
case TOK_UNREG_ONLY:
n->mode |= PKT_ALIAS_UNREGISTERED_ONLY;
break;
+ case TOK_SKIP_GLOBAL:
+ n->mode |= PKT_ALIAS_SKIP_GLOBAL;
+ break;
case TOK_RESET_ADDR:
n->mode |= PKT_ALIAS_RESET_ON_ADDR_CHANGE;
break;
diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8
index 2140b37..fdfd75c 100644
--- a/sbin/mount/mount.8
+++ b/sbin/mount/mount.8
@@ -28,7 +28,7 @@
.\" @(#)mount.8 8.8 (Berkeley) 6/16/94
.\" $FreeBSD$
.\"
-.Dd April 28, 2011
+.Dd June 6, 2011
.Dt MOUNT 8
.Os
.Sh NAME
@@ -348,7 +348,6 @@ option) may be passed as a comma separated list; these options are
distinguished by a leading
.Dq \&-
(dash).
-Options that take a value are specified using the syntax -option=value.
For example, the
.Nm
command:
@@ -363,6 +362,16 @@ to execute the equivalent of:
/sbin/mount_cd9660 -e /dev/cd0 /cdrom
.Ed
.Pp
+Options that take a value are specified using the -option=value syntax:
+.Bd -literal -offset indent
+mount -t msdosfs -o -u=fred,-g=wheel /dev/da0s1 /mnt
+.Ed
+.Pp
+is equivalent to
+.Bd -literal -offset indent
+/sbin/mount_msdosfs -u fred -g wheel /dev/da0s1 /mnt
+.Ed
+.Pp
Additional options specific to file system types
which are not internally known
(see the description of the
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index acded1c..2229419 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -243,7 +243,7 @@ main(int argc, char *argv[])
const char *mntfromname, **vfslist, *vfstype;
struct fstab *fs;
struct statfs *mntbuf;
- int all, ch, i, init_flags, late, mntsize, rval, have_fstab, ro;
+ int all, ch, i, init_flags, late, failok, mntsize, rval, have_fstab, ro;
char *cp, *ep, *options;
all = init_flags = late = 0;
@@ -328,6 +328,10 @@ main(int argc, char *argv[])
continue;
if (hasopt(fs->fs_mntops, "late") && !late)
continue;
+ if (hasopt(fs->fs_mntops, "failok"))
+ failok = 1;
+ else
+ failok = 0;
if (!(init_flags & MNT_UPDATE) &&
ismounted(fs, mntbuf, mntsize))
continue;
@@ -335,7 +339,7 @@ main(int argc, char *argv[])
mntbuf->f_flags);
if (mountfs(fs->fs_vfstype, fs->fs_spec,
fs->fs_file, init_flags, options,
- fs->fs_mntops))
+ fs->fs_mntops) && !failok)
rval = 1;
}
} else if (fstab_style) {
@@ -717,6 +721,14 @@ mangle(char *options, struct cpa *a)
* before mountd starts.
*/
continue;
+ } else if (strcmp(p, "failok") == 0) {
+ /*
+ * "failok" is used to prevent certain file
+ * systems from being causing the system to
+ * drop into single user mode in the boot
+ * cycle, and is not a real mount option.
+ */
+ continue;
} else if (strncmp(p, "mountprog", 9) == 0) {
/*
* "mountprog" is used to force the use of
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8
index 5ed1d6a..9d454cf 100644
--- a/sbin/newfs/newfs.8
+++ b/sbin/newfs/newfs.8
@@ -28,7 +28,7 @@
.\" @(#)newfs.8 8.6 (Berkeley) 5/3/95
.\" $FreeBSD$
.\"
-.Dd February 22, 2011
+.Dd May 25, 2011
.Dt NEWFS 8
.Os
.Sh NAME
@@ -112,7 +112,7 @@ for more details on how to set this option.
The block size of the file system, in bytes.
It must be a power of 2.
The
-default size is 16384 bytes, and the smallest allowable size is 4096 bytes.
+default size is 32768 bytes, and the smallest allowable size is 4096 bytes.
The optimal block:fragment ratio is 8:1.
Other ratios are possible, but are not recommended,
and may produce poor results.
@@ -143,7 +143,7 @@ ranging in value between
.Ar blocksize Ns /8
and
.Ar blocksize .
-The default is 2048 bytes.
+The default is 4096 bytes.
.It Fl g Ar avgfilesize
The expected average file size for the file system.
.It Fl h Ar avgfpdir
@@ -279,7 +279,7 @@ Creates a new ufs file system on
.Pa ad3s1a .
The
.Nm
-utility will use a block size of 16384 bytes, a fragment size of 2048 bytes
+utility will use a block size of 32768 bytes, a fragment size of 4096 bytes
and the largest possible number of blocks per cylinders group.
These values tend to produce better performance for most applications
than the historical defaults
diff --git a/sbin/newfs/newfs.h b/sbin/newfs/newfs.h
index 8c826b1..326c518 100644
--- a/sbin/newfs/newfs.h
+++ b/sbin/newfs/newfs.h
@@ -47,8 +47,8 @@
* sectorsize <= DESFRAGSIZE <= DESBLKSIZE
* DESBLKSIZE / DESFRAGSIZE <= 8
*/
-#define DFL_FRAGSIZE 2048
-#define DFL_BLKSIZE 16384
+#define DFL_FRAGSIZE 4096
+#define DFL_BLKSIZE 32768
/*
* Cylinder groups may have up to MAXBLKSPERCG blocks. The actual
diff --git a/sbin/rcorder/rcorder.8 b/sbin/rcorder/rcorder.8
index b17b0a3..a47f013 100644
--- a/sbin/rcorder/rcorder.8
+++ b/sbin/rcorder/rcorder.8
@@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 9, 2008
+.Dd June 6, 2011
.Dt RCORDER 8
.Os
.Sh NAME
@@ -89,6 +89,12 @@ and
lines may appear, but all such lines must appear in a sequence without
any intervening lines, as once a line that does not follow the format
is reached, parsing stops.
+Note that for historical reasons,
+.Dq Li REQUIRES ,
+.Dq Li PROVIDES ,
+and
+.Dq Li KEYWORDS
+are also accepted in addition to the above.
.Pp
The options are as follows:
.Bl -tag -width indent
diff --git a/sbin/rtsol/Makefile b/sbin/rtsol/Makefile
index 413b6d5..39ef258 100644
--- a/sbin/rtsol/Makefile
+++ b/sbin/rtsol/Makefile
@@ -19,7 +19,7 @@ SRCDIR= ${.CURDIR}/../../usr.sbin/rtsold
.PATH: ${SRCDIR}
PROG= rtsol
-SRCS= rtsold.c rtsol.c if.c probe.c rtsock.c
+SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c
NO_MAN=
WARNS?= 3
diff --git a/sbin/setkey/setkey.8 b/sbin/setkey/setkey.8
index 7103e1f..f53683e 100644
--- a/sbin/setkey/setkey.8
+++ b/sbin/setkey/setkey.8
@@ -441,13 +441,14 @@ protocols other than TCP, UDP and ICMP may not be suitable to use with IPsec.
.It Ar policy
.Ar policy
is expressed in one of the following three formats:
-.Bd -ragged -offset indent
+.Pp
+.Bl -tag -compact
.It Fl P Ar direction Li discard
.It Fl P Ar direction Li none
.It Xo Fl P Ar direction Li ipsec
.Ar protocol/mode/src-dst/level Op ...
.Xc
-.Ed
+.El
.Pp
The direction of a policy must be specified as
one of:
diff --git a/sbin/umount/umount.8 b/sbin/umount/umount.8
index 91231a7..cb3a97b 100644
--- a/sbin/umount/umount.8
+++ b/sbin/umount/umount.8
@@ -28,7 +28,7 @@
.\" @(#)umount.8 8.2 (Berkeley) 5/8/95
.\" $FreeBSD$
.\"
-.Dd July 18, 2003
+.Dd May 31, 2011
.Dt UMOUNT 8
.Os
.Sh NAME
@@ -78,6 +78,9 @@ The file system is forcibly unmounted.
Active special devices continue to work,
but all other files return errors if further accesses are attempted.
The root file system cannot be forcibly unmounted.
+For NFS, a forced dismount can take up to 1 minute or more to
+complete against an unresponsive server and may throw away
+data not yet written to the server for this case.
.It Fl h Ar host
Only file systems mounted from the specified host will be
unmounted.
diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c
index 911666f..9b75449 100644
--- a/sbin/umount/umount.c
+++ b/sbin/umount/umount.c
@@ -90,9 +90,6 @@ main(int argc, char *argv[])
struct statfs *mntbuf, *sfs;
struct addrinfo hints;
- /* Start disks transferring immediately. */
- sync();
-
all = errs = 0;
while ((ch = getopt(argc, argv, "AaF:fh:t:v")) != -1)
switch (ch) {
@@ -127,6 +124,10 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
+ /* Start disks transferring immediately. */
+ if ((fflag & MNT_FORCE) == 0)
+ sync();
+
if ((argc == 0 && !all) || (argc != 0 && all))
usage();
diff --git a/share/examples/Makefile b/share/examples/Makefile
index abe40f1..7b968f9 100644
--- a/share/examples/Makefile
+++ b/share/examples/Makefile
@@ -175,6 +175,7 @@ XFILES= BSD_daemon/FreeBSD.pfa \
ses/setobjstat/setobjstat.0 \
ses/srcs/chpmon.c \
ses/srcs/eltsub.c \
+ ses/srcs/eltsub.h \
ses/srcs/getencstat.c \
ses/srcs/getnobj.c \
ses/srcs/getobjmap.c \
diff --git a/share/examples/etc/make.conf b/share/examples/etc/make.conf
index 516a0e2..d3cdf3e7 100644
--- a/share/examples/etc/make.conf
+++ b/share/examples/etc/make.conf
@@ -188,6 +188,7 @@
#SUPFILE= /usr/share/examples/cvsup/standard-supfile
#PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile
#DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile
+#WWWSUPFILE= /usr/share/examples/cvsup/www-supfile
#
# top(1) uses a hash table for the user names. The size of this hash
# can be tuned to match the number of local users. The table size should
diff --git a/share/examples/ses/srcs/eltsub.c b/share/examples/ses/srcs/eltsub.c
index 2acf982..8500fff 100644
--- a/share/examples/ses/srcs/eltsub.c
+++ b/share/examples/ses/srcs/eltsub.c
@@ -85,6 +85,9 @@ geteltnm(int type)
case SESTYP_KEYPAD:
sprintf(rbuf, "Key pad entry device");
break;
+ case SESTYP_ENCLOSURE:
+ sprintf(rbuf, "Enclosure");
+ break;
case SESTYP_SCSIXVR:
sprintf(rbuf, "SCSI port/transceiver");
break;
@@ -109,6 +112,15 @@ geteltnm(int type)
case SESTYP_SUBENC:
sprintf(rbuf, "Simple sub-enclosure");
break;
+ case SESTYP_ARRAY:
+ sprintf(rbuf, "Array device");
+ break;
+ case SESTYP_SASEXPANDER:
+ sprintf(rbuf, "SAS Expander");
+ break;
+ case SESTYP_SASCONNECTOR:
+ sprintf(rbuf, "SAS Connector");
+ break;
default:
(void) sprintf(rbuf, "<Type 0x%x>", type);
break;
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index f71da84..7ccccfb 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -46,7 +46,9 @@ MAN= aac.4 \
atapicam.4 \
ataraid.4 \
ath.4 \
+ ath_ahb.4 \
ath_hal.4 \
+ ath_pci.4 \
atkbd.4 \
atkbdc.4 \
${_atp.4} \
@@ -473,6 +475,7 @@ MAN= aac.4 \
ukbd.4 \
ulpt.4 \
umass.4 \
+ umcs.4 \
umct.4 \
umodem.4 \
ums.4 \
diff --git a/share/man/man4/amdsbwd.4 b/share/man/man4/amdsbwd.4
index 370cfa8..cfb2f79 100644
--- a/share/man/man4/amdsbwd.4
+++ b/share/man/man4/amdsbwd.4
@@ -25,12 +25,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 30, 2009
+.Dd June 7, 2011
.Dt AMDSBWD 4
.Os
.Sh NAME
.Nm amdsbwd
-.Nd device driver for the AMD SB600/SB700/SB710/SB750 watchdog timer
+.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in your
@@ -51,7 +51,7 @@ The
driver provides
.Xr watchdog 4
support for the watchdog timers present on
-AMD SB600 and SB7xx south bridge chips.
+AMD SB600, SB7xx and SB8xx southbridges.
.Sh SEE ALSO
.Xr watchdog 4 ,
.Xr watchdog 8 ,
@@ -61,12 +61,14 @@ AMD SB600 and SB7xx south bridge chips.
The
.Nm
driver first appeared in
-.Fx 9.0 .
+.Fx 7.3
+and
+.Fx 8.1 .
.Sh AUTHORS
.An -nosplit
The
.Nm
driver was written by
-.An Andiry Gapon Aq avg@FreeBSD.org .
+.An Andriy Gapon Aq avg@FreeBSD.org .
This manual page was written by
-.An Andiry Gapon Aq avg@FreeBSD.org .
+.An Andriy Gapon Aq avg@FreeBSD.org .
diff --git a/share/man/man4/ath.4 b/share/man/man4/ath.4
index 7579546..fadf192 100644
--- a/share/man/man4/ath.4
+++ b/share/man/man4/ath.4
@@ -40,6 +40,7 @@ place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device ath"
+.Cd "device ath_pci"
.Cd "device ath_hal"
.Cd "options AH_SUPPORT_AR5416"
.Cd "device ath_rate_sample"
@@ -51,6 +52,7 @@ module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
if_ath_load="YES"
+if_ath_pci_load="YES"
.Ed
.Sh DESCRIPTION
The
@@ -64,6 +66,19 @@ Supported features include 802.11 and 802.3 frames, power management, BSS,
IBSS, MBSS, TDMA, and host-based access point operation modes.
All host/device interaction is via DMA.
.Pp
+Please note that from FreeBSD-9.0, the
+.Nm
+driver does not include the PCI/PCIe bus glue.
+The same driver supports multiple underlying bus types, including PCI/PCIe,
+but also embedded (AHB) and USB in the future.
+.Pp
+To enable use for PCI/PCIe systems, see the
+.Xr ath_pci 4
+driver.
+For embedded systems which use the AHB to connect the wireless MAC, see the
+.Xr ath_ahb 4
+driver.
+.Pp
The
.Nm
driver encapsulates all IP and ARP traffic as 802.11 frames, however
diff --git a/share/man/man4/ath_ahb.4 b/share/man/man4/ath_ahb.4
new file mode 100644
index 0000000..6688dc2
--- /dev/null
+++ b/share/man/man4/ath_ahb.4
@@ -0,0 +1,60 @@
+.\"-
+.\" Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd
+.\" All rights reserved.
+.\""
+.\" 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,
+.\" without modification.
+.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
+.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+.\" redistribution must be conditioned upon including a substantially
+.\" similar Disclaimer requirement for further binary redistribution.
+.\"
+.\" NO WARRANTY
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+.\"
+.\" $FreeBSD$
+.\"/
+.Dd May 30, 2011
+.Dt ATH_AHB 4
+.Os
+.Sh NAME
+.Nm ath_ahb
+.Nd "Atheros AHB device glue"
+.Sh SYNOPSIS
+.Cd "device ath_ahb"
+.Sh DESCRIPTION
+This module provides the AHB bus glue needed for the devices supported
+by the
+.Xr ath 4
+and
+.Xr ath_hal 4
+drivers.
+.Pp
+This is only relevant for embedded System-on-Chip (SoC) devices such as
+the Atheros AR913x series, which include an Atheros wireless MAC on-die.
+.Sh SEE ALSO
+.Xr ath 4
+.Xr ath_hal 4
+.Sh HISTORY
+The
+.Nm
+module first appeared in
+.Fx 9.0 .
+.Sh BUGS
+See
+.Xr ath 4
+for known bugs.
diff --git a/share/man/man4/ath_hal.4 b/share/man/man4/ath_hal.4
index 4422a0d..c1ad779 100644
--- a/share/man/man4/ath_hal.4
+++ b/share/man/man4/ath_hal.4
@@ -51,14 +51,17 @@ or
.\".Cd "device ath_ar5312"
.\".Cd "device ath_rf2136"
.\".Cd "device ath_rf2137"
+.Cd "device ath_ar9130"
.Cd "device ath_ar9160"
.Cd "device ath_ar9280"
+.Cd "device ath_ar9285"
+.Cd "device ath_ar9287"
.Cd "options AH_SUPPORT_AR5416"
.Sh DESCRIPTION
The hal provides hardware support for wireless network adapters based on
the Atheros AR5210, AR5211, AR5212, AR5213, AR2413, AR2417, AR2425,
-AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, and AR9285 chips
-(and companion RF/baseband parts).
+AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285 and AR9287
+chips (and companion RF/baseband parts).
This code is part of the
.Xr ath 4
driver but configured separately to allow fine-grained control
@@ -66,14 +69,15 @@ over the set of chips supported.
Selecting
.Nm
enables support for all PCI and Cardbus devices.
-Note this includes AR5416, AR9160, AR9220, AR9280 and AR9285 devices
-and must be accompanied by the
+Note this includes AR5416, AR5418, AR9130, AR9160, AR9220, AR9280, AR9285
+and AR9287 devices and must be accompanied by the
AH_SUPPORT_AR5416
option to enable the extended hardware descriptor format used by
AR5416 and later devices.
.Pp
Some devices come in Cardbus/MiniPCI/PCI format.
-Others (AR9280, AR9285) come in PCIe, Mini-PCIe or ExpressCard format.
+Others (for example AR2413, AR2427, AR5418, AR9280, AR9285, AR9287) come in
+PCIe, Mini-PCIe or ExpressCard format.
.Pp
Historically this code has been released in a binary-only form
and packaged as a separate module.
diff --git a/share/man/man4/ath_pci.4 b/share/man/man4/ath_pci.4
new file mode 100644
index 0000000..814e535
--- /dev/null
+++ b/share/man/man4/ath_pci.4
@@ -0,0 +1,57 @@
+.\"-
+.\" Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd
+.\" All rights reserved.
+.\""
+.\" 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,
+.\" without modification.
+.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
+.\" similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+.\" redistribution must be conditioned upon including a substantially
+.\" similar Disclaimer requirement for further binary redistribution.
+.\"
+.\" NO WARRANTY
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+.\" THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+.\"
+.\" $FreeBSD$
+.\"/
+.Dd May 30, 2011
+.Dt ATH_PCI 4
+.Os
+.Sh NAME
+.Nm ath_pci
+.Nd "Atheros PCI device glue"
+.Sh SYNOPSIS
+.Cd "device ath_pci"
+.Sh DESCRIPTION
+This module provides the PCI/PCIe bus glue needed for the devices supported
+by the
+.Xr ath 4
+and
+.Xr ath_hal 4
+drivers.
+.Sh SEE ALSO
+.Xr ath 4
+.Xr ath_hal 4
+.Sh HISTORY
+The
+.Nm
+module first appeared in
+.Fx 9.0 .
+.Sh BUGS
+See
+.Xr ath 4
+for known bugs.
diff --git a/share/man/man4/atkbd.4 b/share/man/man4/atkbd.4
index 0c486e2..73831c2 100644
--- a/share/man/man4/atkbd.4
+++ b/share/man/man4/atkbd.4
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 20, 2011
+.Dd January 29, 2008
.Dt ATKBD 4
.Os
.Sh NAME
@@ -176,11 +176,6 @@ When this option is given, the
.Nm
driver will not test the keyboard port during the probe routine.
Some machines hang during boot when this test is performed.
-.It bit 4 (PROBE_TYPEMATIC)
-When this option is given, the
-.Nm
-driver will try to probe the keyboard typematic rate on boot.
-Some machines hang during boot when this test is performed.
.El
.\".Sh FILES
.Sh EXAMPLES
diff --git a/share/man/man4/atrtc.4 b/share/man/man4/atrtc.4
index 35e770d..51d6f05 100644
--- a/share/man/man4/atrtc.4
+++ b/share/man/man4/atrtc.4
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd September 17, 2010
-.Dt atrtc 4
+.Dt ATRTC 4
.Os
.Sh NAME
.Nm atrtc
diff --git a/share/man/man4/attimer.4 b/share/man/man4/attimer.4
index d5bfaf9..67d001e 100644
--- a/share/man/man4/attimer.4
+++ b/share/man/man4/attimer.4
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd September 14, 2010
-.Dt attimer 4
+.Dt ATTIMER 4
.Os
.Sh NAME
.Nm attimer
diff --git a/share/man/man4/bwn.4 b/share/man/man4/bwn.4
index 81452c7..a2ff5c4 100644
--- a/share/man/man4/bwn.4
+++ b/share/man/man4/bwn.4
@@ -142,9 +142,6 @@ The
.Nm
driver first appeared in
.Fx 8.1 .
-.Sh CAVEATS
-Some LP PHY devices have DMA operation problems that in that case try to
-use PIO mode.
.Sh AUTHORS
.An -nosplit
The
@@ -155,3 +152,6 @@ driver was written by
.\".Sh BUGS
.\"Some card based on the BCM4306 and BCM4309 chips do not work properly
.\"on channel 1, 2 and 3.
+.Sh CAVEATS
+Some LP PHY devices have DMA operation problems that in that case try to
+use PIO mode.
diff --git a/share/man/man4/cc.4 b/share/man/man4/cc.4
index 32da741..c518f45 100644
--- a/share/man/man4/cc.4
+++ b/share/man/man4/cc.4
@@ -31,7 +31,7 @@
.\" $FreeBSD$
.\"
.Dd February 15, 2011
-.Dt cc 4
+.Dt CC 4
.Os
.Sh NAME
.Nm cc
diff --git a/share/man/man4/em.4 b/share/man/man4/em.4
index ecde44d..842f9ee 100644
--- a/share/man/man4/em.4
+++ b/share/man/man4/em.4
@@ -227,6 +227,20 @@ If
is non-zero, this tunable limits the maximum delay in which a transmit
interrupt is generated.
.El
+.Sh FILES
+.Bl -tag -width /dev/led/em*
+.It Pa /dev/led/em*
+identification LED device nodes
+.El
+.Sh EXAMPLES
+Make the identification LED of em0 blink:
+.Pp
+.Dl "echo f2 > /dev/led/em0"
+.Pp
+Turn the identification LED of em0 off again:
+.Pp
+.Dl "echo 0 > /dev/led/em0"
+.Pp
.Sh DIAGNOSTICS
.Bl -diag
.It "em%d: Unable to allocate bus resource: memory"
@@ -246,20 +260,6 @@ If an issue is identified with the released source code on the supported kernel
with a supported adapter, email the specific information related to the
issue to
.Aq freebsdnic@mailbox.intel.com .
-.Sh FILES
-.Bl -tag -width /dev/led/em*
-.It Pa /dev/led/em*
-identification LED device nodes
-.El
-.Sh EXAMPLES
-Make the identification LED of em0 blink:
-.Pp
-.Dl "echo f2 > /dev/led/em0"
-.Pp
-Turn the identification LED of em0 off again:
-.Pp
-.Dl "echo 0 > /dev/led/em0"
-.Pp
.Sh SEE ALSO
.Xr altq 4 ,
.Xr arp 4 ,
diff --git a/share/man/man4/h_ertt.4 b/share/man/man4/h_ertt.4
index ed7461e..b04efaa 100644
--- a/share/man/man4/h_ertt.4
+++ b/share/man/man4/h_ertt.4
@@ -30,7 +30,7 @@
.\" $FreeBSD$
.\"
.Dd February 15, 2011
-.Dt h_ertt 9
+.Dt H_ERTT 9
.Os
.Sh NAME
.Nm h_ertt
diff --git a/share/man/man4/igb.4 b/share/man/man4/igb.4
index 65012d2..70db340 100644
--- a/share/man/man4/igb.4
+++ b/share/man/man4/igb.4
@@ -161,6 +161,20 @@ The minimum is 80, and the maximum is 4096.
If set to 1, enable Adaptive Interrupt Moderation.
The default is to enable Adaptive Interrupt Moderation.
.El
+.Sh FILES
+.Bl -tag -width /dev/led/igb*
+.It Pa /dev/led/igb*
+identification LED device nodes
+.El
+.Sh EXAMPLES
+Make the identification LED of igb0 blink:
+.Pp
+.Dl "echo f2 > /dev/led/igb0"
+.Pp
+Turn the identification LED of igb0 off again:
+.Pp
+.Dl "echo 0 > /dev/led/igb0"
+.Pp
.Sh DIAGNOSTICS
.Bl -diag
.It "igb%d: Unable to allocate bus resource: memory"
@@ -180,20 +194,6 @@ If an issue is identified with the released source code on the supported kernel
with a supported adapter, email the specific information related to the
issue to
.Aq freebsdnic@mailbox.intel.com .
-.Sh FILES
-.Bl -tag -width /dev/led/igb*
-.It Pa /dev/led/igb*
-identification LED device nodes
-.El
-.Sh EXAMPLES
-Make the identification LED of igb0 blink:
-.Pp
-.Dl "echo f2 > /dev/led/igb0"
-.Pp
-Turn the identification LED of igb0 off again:
-.Pp
-.Dl "echo 0 > /dev/led/igb0"
-.Pp
.Sh SEE ALSO
.Xr altq 4 ,
.Xr arp 4 ,
diff --git a/share/man/man4/mps.4 b/share/man/man4/mps.4
index c6dd527..e22bf15 100644
--- a/share/man/man4/mps.4
+++ b/share/man/man4/mps.4
@@ -143,6 +143,19 @@ Enable prints for controller events.
.Xr sa 4 ,
.Xr scsi 4 ,
.Xr targ 4
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was originally written by
+.An Scott Long Aq scottl@FreeBSD.org .
+This man page was written by
+.An Ken Merry Aq ken@FreeBSD.org .
.Sh BUGS
This driver is still in development, it has only been tested on the amd64
architecture and has some known shortcomings:
@@ -158,16 +171,3 @@ times, without user intervention.
.It
The error recovery code isn't complete.
.El
-.Sh HISTORY
-The
-.Nm
-driver first appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was originally written by
-.An Scott Long Aq scottl@FreeBSD.org .
-This man page was written by
-.An Ken Merry Aq ken@FreeBSD.org .
diff --git a/share/man/man4/nvram2env.4 b/share/man/man4/nvram2env.4
index c0ee0cf..5176097 100644
--- a/share/man/man4/nvram2env.4
+++ b/share/man/man4/nvram2env.4
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd April 3, 2011
-.Dt nvram2env 4
+.Dt NVRAM2ENV 4
.Os
.Sh NAME
.Nm nvram2env
diff --git a/share/man/man4/snd_hda.4 b/share/man/man4/snd_hda.4
index 9325788..6dedb02 100644
--- a/share/man/man4/snd_hda.4
+++ b/share/man/man4/snd_hda.4
@@ -668,16 +668,20 @@ and
A few Hardware/OEM vendors tend to screw up BIOS settings, thus
rendering the
.Nm
-driver useless, which usually results in a state where the
+driver useless.
+This usually results in a state where the
.Nm
-driver seems to attach and work, but without any sound. Some of
-that cases can be solved by tuning loader.conf variables. But before
-trying to fix problem that way, make sure that problem is really exists
-and the PCM audio device you are using really corresponds to expected
+driver seems to attach and work, but no sound is played.
+Some cases can be solved by tuning
+.Pa loader.conf
+variables.
+Before trying to fix problem that way, make sure that there really is a problem
+and that the PCM audio device in use really corresponds to the expected
audio connector.
.Pp
-Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec
-to control external amplifiers. In some cases setting proper combination of
-GPIO bits may be needed to make sound work on specific device.
+Some vendors use non-standardized General Purpose I/O (GPIO) pins of the codec
+to control external amplifiers.
+In some cases setting a combination of GPIO bits may be needed to make
+sound work on a specific device.
.Pp
HDMI and DisplayPort audio may also require support from video driver.
diff --git a/share/man/man4/ucom.4 b/share/man/man4/ucom.4
index ff891cb..8898872 100644
--- a/share/man/man4/ucom.4
+++ b/share/man/man4/ucom.4
@@ -78,6 +78,7 @@ multiple external ports.
.Xr uark 4 ,
.Xr uchcom 4 ,
.Xr uftdi 4 ,
+.Xr umcs 4 ,
.Xr umct 4 ,
.Xr umodem 4 ,
.Xr uplcom 4 ,
diff --git a/share/man/man4/uep.4 b/share/man/man4/uep.4
index 62dc51a..74b65f3 100644
--- a/share/man/man4/uep.4
+++ b/share/man/man4/uep.4
@@ -57,11 +57,6 @@ To get mouse working in
.Xr X 7 ,
one needs to install
.Pa ports/x11-drivers/xf86-input-egalax .
-.Sh BUGS
-.Nm
-can't act like
-.Xr sysmouse 4 ,
-since the latter does not support absolute motion events.
.Sh FILES
.Nm
creates a blocking pseudo\-device file,
@@ -77,3 +72,8 @@ The
.Nm
driver was written by
.An Gleb Smirnoff Aq glebius@FreeBSD.org
+.Sh BUGS
+.Nm
+can't act like
+.Xr sysmouse 4 ,
+since the latter does not support absolute motion events.
diff --git a/share/man/man4/umcs.4 b/share/man/man4/umcs.4
new file mode 100644
index 0000000..f57b084
--- /dev/null
+++ b/share/man/man4/umcs.4
@@ -0,0 +1,97 @@
+.\"
+.\" Copyright (c) 2010 Lev Serebryakov <lev@FreeBSD.org>.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Lennart Augustsson.
+.\"
+.\" 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd December 10, 2010
+.Dt UMCS 4
+.Os
+.Sh NAME
+.Nm umcs
+.Nd USB support for serial adapters based on the MCS7820 and MCS7840 chips
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device umcs"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+umcs_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for various multiport serial adapters based on the MosCom
+MCS7820 and MCS7840 chips. They are 2- or 4-port adapters with full-featured
+16550-compatible UARTs and very flexible baud generators. Also, these chips
+support RS422/RS485 and IrDA oprations.
+.Pp
+The device is accessed through the
+.Xr ucom 4
+driver which makes it behave like a
+.Xr tty 4 .
+.Pp
+Different ports on device are presented as sub-units, like
+.Pa /dev/ttyU0.1
+and
+.Pa /dev/ttyU0.2
+.Sh HARDWARE
+The
+.Nm
+driver was tested on the following adapters:
+.Pp
+.Bl -bullet -compact
+.It
+ST Lab U-360 two-port serial USB adapter
+.It
+ST Lab U-400 four-port serial USB adapter
+.El
+.Sh SEE ALSO
+.Xr tty 4 ,
+.Xr ucom 4 ,
+.Xr usb 4
+.Sh BUGS
+This driver doesn't support access to any fine tunes of
+chip, like RS522/RS485 mode, non-standard baudrates, etc.
+.Sh HISTORY
+The
+.Nm
+driver
+appeared in ports since December of 2010.
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Lev Serebryakov
+.Aq lev@FreeBSD.org .
diff --git a/share/man/man4/vge.4 b/share/man/man4/vge.4
index ae0206a..3ab9bce 100644
--- a/share/man/man4/vge.4
+++ b/share/man/man4/vge.4
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 23, 2010
+.Dd May 29, 2011
.Dt VGE 4
.Os
.Sh NAME
@@ -66,13 +66,14 @@ The MAC supports TCP/IP hardware
checksums (IPv4 only), TCP large send, VLAN tag insertion and stripping,
as well as VLAN filtering, a 64-entry CAM filter and a 64-entry VLAN filter,
64-bit multicast hash filter, 4 separate transmit DMA queues, flow control
-and jumbo frames up to 16K in size.
+and jumbo frames (not on VT6130/VT6132) up to 16K in size.
The Velocity family controllers have a 16K receive FIFO and 48K transmit FIFO.
.Pp
The
.Nm
driver takes advantage of the controller's checksum offload and VLAN
-tagging features, as well as the jumbo frame and CAM filter support.
+tagging features, as well as the jumbo frame (except VT6130/VT6132) and CAM
+filter support.
The CAM filter is used for multicast address filtering to provide
64 perfect multicast address filter support.
If it is necessary for the interface to join more than 64 multicast
@@ -81,6 +82,8 @@ groups, the driver will switch over to using the hash filter.
The jumbo frame support can be enabled by setting the interface MTU
to any value larger than the default of 1500 bytes, up to a maximum
of 9000 bytes.
+Jumbo frames are disabled on the VT6130/VT6132 controllers because the TX
+MAC will hang when trying to send a frame that is larger than 4K.
The receive and transmit checksum offload support
can be toggled on and off using the
.Xr ifconfig 8
diff --git a/share/man/man5/fstab.5 b/share/man/man5/fstab.5
index 1c6f17e..adbf489 100644
--- a/share/man/man5/fstab.5
+++ b/share/man/man5/fstab.5
@@ -32,7 +32,7 @@
.\" @(#)fstab.5 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd November 23, 2008
+.Dd June 7, 2011
.Dt FSTAB 5
.Os
.Sh NAME
@@ -70,7 +70,8 @@ remote file system to be mounted.
The second field,
.Pq Fa fs_file ,
describes the mount point for the file system.
-For swap partitions, this field should be specified as ``none''.
+For swap partitions, this field should be specified as
+.Dq none .
.Pp
The third field,
.Pq Fa fs_vfstype ,
@@ -125,7 +126,11 @@ sync,noatime,-m=644,-M=755,-u=foo,-g=bar
in the option field of
.Nm .
.Pp
-If the options ``userquota'' and/or ``groupquota'' are specified,
+If the options
+.Dq userquota
+and/or
+.Dq groupquota
+are specified,
the file system is automatically processed by the
.Xr quotacheck 8
command, and user and/or group disk quotas are enabled with
@@ -147,7 +152,18 @@ this location can be specified as:
userquota=/var/quotas/tmp.user
.Ed
.Pp
-If the option ``noauto'' is specified, the file system will not be automatically
+If the option
+.Dq failok
+is specified,
+the system will ignore any error which happens during the mount of that filesystem,
+which would otherwise cause the system to drop into single user mode.
+This option is implemented by the
+.Xr mount 8
+command and will not be passed to the kernel.
+.Pp
+If the option
+.Dq noauto
+is specified, the file system will not be automatically
mounted at system startup.
Note that, for network file systems
of third party types
@@ -170,13 +186,19 @@ field (it is not deleted from the
field).
If
.Fa fs_type
-is ``rw'' or ``ro'' then the file system whose name is given in the
+is
+.Dq rw
+or
+.Dq ro
+then the file system whose name is given in the
.Fa fs_file
field is normally mounted read-write or read-only on the
specified special file.
If
.Fa fs_type
-is ``sw'' then the special file is made available as a piece of swap
+is
+.Dq sw
+then the special file is made available as a piece of swap
space by the
.Xr swapon 8
command at the end of the system reboot procedure.
@@ -187,7 +209,9 @@ and
are unused.
If
.Fa fs_type
-is specified as ``xx'' the entry is ignored.
+is specified as
+.Dq xx
+the entry is ignored.
This is useful to show disk partitions which are currently unused.
.Pp
The fifth field,
diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5
index 0f9e70d..c424a1e 100644
--- a/share/man/man5/make.conf.5
+++ b/share/man/man5/make.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 15, 2009
+.Dd June 16, 2011
.Dt MAKE.CONF 5
.Os
.Sh NAME
@@ -181,7 +181,11 @@ options.
.Pq Vt bool
Set this to use
.Xr cvs 1
-to update your ports with
+to update your
+.Pa src , ports
+and
+.Pa doc
+trees with
.Dq Li "make update" .
.It Va CXXFLAGS
.Pq Vt str
@@ -202,8 +206,8 @@ The documentation
.Ar supfile
to use when doing a
.Dq Li "make update" .
-This defaults to
-.Pa /usr/share/examples/cvsup/doc\-supfile .
+For example,
+.Pa /usr/share/examples/cvsup/doc-supfile .
.It Va INSTALL
.Pq Vt str
the default install command.
@@ -259,14 +263,18 @@ Set this to not update the doc tree during
.Pq Vt bool
Set this to not update the ports tree during
.Dq Li "make update" .
+.It Va NO_WWWUPDATE
+.Pq Vt bool
+Set this to not update the www tree during
+.Dq Li "make update" .
.It Va PORTSSUPFILE
.Pq Vt str
The ports
.Ar supfile
to use when doing a
.Dq Li "make update" .
-This defaults to
-.Pa /usr/share/examples/cvsup/ports\-supfile .
+For example,
+.Pa /usr/share/examples/cvsup/ports-supfile .
.It Va SUP
.Pq Vt str
The location of the
@@ -281,24 +289,20 @@ The first
.Ar supfile
to use when doing a
.Dq Li "make update" .
-This defaults to
-.Pa /usr/share/examples/cvsup/standard\-supfile .
+For example,
+.Pa /usr/share/examples/cvsup/standard-supfile .
.It Va SUPFILE1
.Pq Vt str
The second
.Ar supfile
to use when doing a
.Dq Li "make update" .
-This defaults to
-.Pa /usr/share/examples/cvsup/secure\-supfile .
.It Va SUPFILE2
.Pq Vt str
The third
.Ar supfile
to use when doing a
.Dq Li "make update" .
-This defaults to
-.Pa /usr/share/examples/cvsup/secure\-supfile .
.It Va SUPFLAGS
.Pq Vt str
The flag for the
@@ -315,16 +319,28 @@ The hostname of the sup server to use when doing
.Pq Vt bool
Set this to use
.Xr cvsup 1
-to update your ports with
+to update your
+.Pa src , ports , doc
+and
+.Pa www
+trees with
+.Dq Li "make update" .
+.It Va SVN_UPDATE
+.Pq Vt bool
+Set this to use
+.Xr svn 1
+to update your
+.Pa src
+tree with
.Dq Li "make update" .
.It Va WWWSUPFILE
.Pq Vt str
The www
.Ar supfile
to use when doing a
-.Dq Li "make update"
-This defaults to
-.Pa /usr/share/examples/cvsup/www\-supfile .
+.Dq Li "make update" .
+For example,
+.Pa /usr/share/examples/cvsup/www-supfile .
.El
.Ss "BUILDING THE KERNEL"
The following list provides a name and short description for variables
@@ -730,6 +746,7 @@ filter, or both.
.Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
.It Pa /etc/make.conf
.It Pa /usr/doc/Makefile
+.It Pa /usr/ports/Makefile
.It Pa /usr/share/examples/etc/make.conf
.It Pa /usr/share/mk/sys.mk
.It Pa /usr/src/Makefile
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index cf062c5..d7d52c1 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 27, 2011
+.Dd June 19, 2011
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -196,6 +196,14 @@ Configuration file for
.Xr ddb 8 .
Default
.Pa /etc/ddb.conf .
+.It Va kld_list
+.Pq Vt str
+A list of kernel modules to load right after the local
+disks are mounted.
+Loading modules at this point in the boot process is
+much faster than doing it via
+.Pa /boot/loader.conf
+for those modules not necessary for mounting local disk.
.It Va kldxref_enable
.Pq Vt bool
Set to
@@ -4285,6 +4293,61 @@ Bus address of the USB Bluetooth controller.
Check the output of
.Xr usbconfig 8
on your system to find this information.
+.It Va netwait_enable
+.Pq Vt bool
+If set to
+.Dq Li YES ,
+delays the start of network-reliant services until
+.Va netwait_if
+is up and ICMP packets to a destination defined in
+.Va netwait_ip
+are flowing.
+Link state is examined first, followed by
+.Dq Li pinging
+an IP address to verify network usability.
+If no destination can be reached or timeouts are exceeded,
+network services are started anyway with no guarantee that
+the network is usable.
+Use of this variable requires both
+.Va netwait_ip
+and
+.Va netwait_if
+to be set.
+.It Va netwait_ip
+.Pq Vt str
+Empty by default.
+This variable contains a space-delimited list of IP addresses to
+.Xr ping 8 .
+DNS hostnames should not be used as resolution is not guaranteed
+to be functional at this point.
+If multiple IP addresses are specified,
+each will be tried until one is successful or the list is exhausted.
+.It Va netwait_timeout
+.Pq Vt int
+Indicates the total number of seconds to perform a
+.Dq Li ping
+against each IP address in
+.Va netwait_ip ,
+at a rate of one ping per second.
+If any of the pings are successful,
+full network connectivity is considered reliable.
+The default is 60.
+.It Va netwait_if
+.Pq Vt str
+Empty by default.
+Defines the name of the network interface on which watch for link.
+.Xr ifconfig 8
+is used to monitor the interface, looking for
+.Dq Li status: no carrier .
+Once gone, the link is considered up.
+This can be a
+.Xr vlan 4
+interface if desired.
+.It Va netwait_if_timeout
+.Pq Vt int
+Defines the total number of seconds to wait for link to become usable,
+polled at a 1-second interval.
+The default is 30.
.El
.Sh FILES
.Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact
@@ -4356,6 +4419,7 @@ on your system to find this information.
.Xr ntpdate 8 ,
.Xr pfctl 8 ,
.Xr pflogd 8 ,
+.Xr ping 8 ,
.Xr powerd 8 ,
.Xr quotacheck 8 ,
.Xr quotaon 8 ,
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index f0b9905..544344c 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,7 +1,7 @@
.\" DO NOT EDIT-- this file is automatically generated.
.\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru
.\" $FreeBSD$
-.Dd May 22, 2011
+.Dd June 17, 2011
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -78,11 +78,11 @@ The following list provides a name and short description for variables
that can be used for source builds.
.Bl -tag -width indent
.It Va WITHOUT_ACCT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 221540 2011-05-06 19:13:03Z ru
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed
Set to not build process accounting tools such as
-.Xr ac 8
+.Xr accton 8
and
-.Xr accton 8 .
+.Xr sa 8 .
.It Va WITHOUT_ACPI
.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru
Set to not build
@@ -225,8 +225,8 @@ Set to not build the boot blocks and loader.
Set to not build the BSD licensed version of cpio based on
.Xr libarchive 3 .
.It Va WITH_BSD_GREP
-.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 211701 2010-08-23 10:04:26Z gabor
-Build BSD-licensed grep instead of GNU grep.
+.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien
+Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
.It Va WITHOUT_BSNMP
.\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam
Set to not build or install
@@ -916,6 +916,17 @@ When set, it also enforces the following options:
.It Va WITHOUT_USB
.\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru
Set to not build USB-related programs and libraries.
+.It Va WITHOUT_UTMPX
+.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 223209 2011-06-17 21:30:21Z ed
+Set to not build user accounting tools such as
+.Xr last 1 ,
+.Xr users 1 ,
+.Xr who 1 ,
+.Xr wtmpcvt 1 ,
+.Xr ac 8 ,
+.Xr lastlogin 8
+and
+.Xr utxrm 8 .
.It Va WITHOUT_WIRELESS
.\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam
Set to not build programs used for 802.11 wireless networks; especially
diff --git a/share/man/man7/build.7 b/share/man/man7/build.7
index 22305b7..b43a961 100644
--- a/share/man/man7/build.7
+++ b/share/man/man7/build.7
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 18, 2011
+.Dd June 16, 2011
.Dt BUILD 7
.Os
.Sh NAME
@@ -517,6 +517,10 @@ target.
If set, the update process does not update the Ports tree as part of the
.Dq make update
target.
+.It Va NO_WWWUPDATE
+If set, the update process does not update the www tree as part of the
+.Dq make update
+target.
.El
.Pp
Builds under directory
diff --git a/share/man/man7/c99.7 b/share/man/man7/c99.7
index 1b76442..8c7d5e2 100644
--- a/share/man/man7/c99.7
+++ b/share/man/man7/c99.7
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 17, 2010
+.Dd May 30, 2011
.Dt C 7
.Os
.Sh NAME
@@ -122,7 +122,7 @@ Support for variable length arrays
New high-precision integer type named long long int, and other integer types
defined in stdint.h
.It
-New boolen data type implemented in stdbool.h
+New boolean data type implemented in stdbool.h
.It
One line comments taken from the C++ language
.It
diff --git a/share/man/man7/eventtimers.7 b/share/man/man7/eventtimers.7
index 6c9552a..37d5fc8 100644
--- a/share/man/man7/eventtimers.7
+++ b/share/man/man7/eventtimers.7
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd September 15, 2010
-.Dt eventtimers 4
+.Dt EVENTTIMERS 4
.Os
.Sh NAME
.Nm eventtimers
diff --git a/share/man/man7/ports.7 b/share/man/man7/ports.7
index 54afe0a..975b825 100644
--- a/share/man/man7/ports.7
+++ b/share/man/man7/ports.7
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 14, 2009
+.Dd May 30, 2011
.Dt PORTS 7
.Os
.Sh NAME
@@ -124,6 +124,8 @@ and
.It Cm checksum
Verify that the fetched distfile's checksum matches the one the port was
tested against.
+If the distfile's checksum does not match, it also fetches the distfiles
+which are missing or failed the checksum calculation.
Defining
.Va NO_CHECKSUM
will skip this step.
@@ -477,6 +479,8 @@ Of course, these ports may not work as expected, but if you really know
what you are doing and are sure about installing a forbidden port, then
.Va NO_IGNORE
lets you do it.
+.It Va NO_CHECKSUM
+If defined, skip verifying the port's checksum.
.It Va TRYBROKEN
If defined, attempt to build a port even if it is marked as
.Aq Va BROKEN .
diff --git a/share/man/man7/release.7 b/share/man/man7/release.7
index 6eeda83..f2ca0c8 100644
--- a/share/man/man7/release.7
+++ b/share/man/man7/release.7
@@ -65,7 +65,9 @@ and should have experience upgrading systems from source.
The release build process requires that
.Pa /usr/obj
be populated with the output of
-.Dq Li "make buildworld" .
+.Dq Li "make buildworld"
+and
+.Dq Li "make buildkernel" .
This is necessary to provide the object files for the release or, when
using
.Pa generate-release.sh ,
@@ -294,7 +296,7 @@ The following sequence of commands can be used to build a
cd /usr
svn co svn://svn.freebsd.org/base/head src
cd src
-make buildworld
+make buildworld buildkernel
cd release
make release
make install DESTDIR=/var/freebsd-snapshot
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 50edf73..815ddd0 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -860,6 +860,22 @@ MLINKS+=\
mbuf.9 mtod.9 \
mbuf.9 M_TRAILINGSPACE.9 \
mbuf.9 M_WRITABLE.9
+MLINKS+=\
+ mbuf_tags.9 m_tag_alloc.9 \
+ mbuf_tags.9 m_tag_copy.9 \
+ mbuf_tags.9 m_tag_copy_chain.9 \
+ mbuf_tags.9 m_tag_delete.9 \
+ mbuf_tags.9 m_tag_delete_chain.9 \
+ mbuf_tags.9 m_tag_delete_nonpersistent.9 \
+ mbuf_tags.9 m_tag_find.9 \
+ mbuf_tags.9 m_tag_first.9 \
+ mbuf_tags.9 m_tag_free.9 \
+ mbuf_tags.9 m_tag_get.9 \
+ mbuf_tags.9 m_tag_init.9 \
+ mbuf_tags.9 m_tag_locate.9 \
+ mbuf_tags.9 m_tag_next.9 \
+ mbuf_tags.9 m_tag_prepend.9 \
+ mbuf_tags.9 m_tag_unlink.9
MLINKS+=MD5.9 MD5Init.9 \
MD5.9 MD5Transform.9
MLINKS+=mdchain.9 md_append_record.9 \
diff --git a/share/man/man9/bus_adjust_resource.9 b/share/man/man9/bus_adjust_resource.9
index 519974b..be4adae 100644
--- a/share/man/man9/bus_adjust_resource.9
+++ b/share/man/man9/bus_adjust_resource.9
@@ -67,6 +67,15 @@ It is the caller's responsibility to enforce any such requirements.
The
.Fn bus_adjust_resource
method returns zero on success or an error code on failure.
+.Sh EXAMPLES
+Grow an existing memory resource by 4096 bytes.
+.Bd -literal
+ struct resource *res;
+ int error;
+
+ error = bus_adjust_resource(dev, SYS_RES_MEMORY, res,
+ rman_get_start(res), rman_get_end(res) + 0x1000);
+.Ed
.Sh ERRORS
.Fn bus_adjust_resource
will fail if:
@@ -85,15 +94,6 @@ The new address range does not overlap with the existing address range of
.It Bq Er EBUSY
The new address range conflicts with another allocated resource.
.El
-.Sh EXAMPLES
-Grow an existing memory resource by 4096 bytes.
-.Bd -literal
- struct resource *res;
- int error;
-
- error = bus_adjust_resource(dev, SYS_RES_MEMORY, res,
- rman_get_start(res), rman_get_end(res) + 0x1000);
-.Ed
.Sh SEE ALSO
.Xr bus_alloc_resource 9 ,
.Xr bus_release_resource 9 ,
diff --git a/share/man/man9/devfs_set_cdevpriv.9 b/share/man/man9/devfs_set_cdevpriv.9
index fcdc5c4..a2b0279 100644
--- a/share/man/man9/devfs_set_cdevpriv.9
+++ b/share/man/man9/devfs_set_cdevpriv.9
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd September 8, 2008
-.Dt DEVFS_CDEVPRIV
+.Dt DEVFS_CDEVPRIV 9
.Os
.Sh NAME
.Nm devfs_set_cdevpriv ,
diff --git a/share/man/man9/device_get_sysctl.9 b/share/man/man9/device_get_sysctl.9
index 4dcc2ab..d838ac7 100644
--- a/share/man/man9/device_get_sysctl.9
+++ b/share/man/man9/device_get_sysctl.9
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 23, 2006
+.Dd June 18, 2011
.Dt DEVICE_GET_SYSCTL 9
.Os
.Sh NAME
@@ -49,7 +49,7 @@ This node can be accessed with the
.Fn device_get_sysctl_tree
function.
The context for the node can be obtained with the
-.Fn device_get_sysctl_ctl
+.Fn device_get_sysctl_ctx
function.
.Sh SEE ALSO
.Xr device 9
diff --git a/share/man/man9/hhook.9 b/share/man/man9/hhook.9
index 1dd391f..df74543 100644
--- a/share/man/man9/hhook.9
+++ b/share/man/man9/hhook.9
@@ -31,7 +31,7 @@
.\" $FreeBSD$
.\"
.Dd February 15, 2011
-.Dt hhook 9
+.Dt HHOOK 9
.Os
.Sh NAME
.Nm hhook ,
diff --git a/share/man/man9/khelp.9 b/share/man/man9/khelp.9
index 25125c0..2f3f0e1 100644
--- a/share/man/man9/khelp.9
+++ b/share/man/man9/khelp.9
@@ -31,7 +31,7 @@
.\" $FreeBSD$
.\"
.Dd February 15, 2011
-.Dt khelp 9
+.Dt KHELP 9
.Os
.Sh NAME
.Nm khelp ,
diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot
index bfe9f4e..712590c 100644
--- a/share/misc/committers-ports.dot
+++ b/share/misc/committers-ports.dot
@@ -67,6 +67,7 @@ chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2007/06/12"]
clement [label="Clement Laforet\nclement@FreeBSD.org\n2003/12/17"]
clsung [label="Cheng-Lung Sung\nclsung@FreeBSD.org\n2004/8/18"]
cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2006/01/31"]
+crees [label="Chris Rees\ncrees@FreeBSD.org\n2011/06/11"]
culot [label="Frederic Culot\nculot@FreeBSD.org\n2010/10/16"]
daichi [label="Daichi Goto\ndaichi@FreeBSD.org\n2002/10/17"]
danfe [label="Alexey Dokuchaev\ndanfe@FreeBSD.org\n2004/08/20"]
@@ -97,6 +98,7 @@ itetcu [label="Ion-Mihai Tetcu\nitetcu@FreeBSD.org\n2006/06/07"]
jacula [label="Giuseppe Pilichi\njacula@FreeBSD.org\n2010/04/05"]
jadawin [label="Philippe Audeoud\njadawin@FreeBSD.org\n2008/03/02"]
jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2007/09/12"]
+jlaffaye [label="Julien Laffaye\njlaffaye@FreeBSD.org\n2011/06/06"]
jmelo [label="Jean Milanez Melo\njmelo@FreeBSD.org\n2006/03/31"]
joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1994/08/22"]
johans [label="Johan Selst\njohans@FreeBSD.org\n2006/04/01"]
@@ -164,6 +166,7 @@ skreuzer [label="Steven Kreuzer\nskreuzer@FreeBSD.org\n2009/03/25"]
sobomax[label="Maxim Sobolev\nsobomax@FreeBSD.org\n2000/05/17"]
stas [label="Stanislav Sedov\nstas@FreeBSD.org\n2006/09/18"]
stefan [label="Stefan Walter\nstefan@FreeBSD.org\n2006/05/07"]
+stephen [label="Stephen Montgomery-Smith\nstephen@FreeBSD.org\n2011/06/13"]
sunpoet [label="Po-Chuan Hsieh\nsunpoet@FreeBSD.org\n2010/09/21"]
sylvio [label="Sylvio Cesar Teixeira\nsylvio@FreeBSD.org\n2009/10/29"]
swills [label="Steve Wills\nswills@FreeBSD.org\n2010/09/03"]
@@ -204,6 +207,8 @@ arved -> stefan
asami -> obrien
+bapt -> jlaffaye
+
beat -> decke
beech -> glarkin
@@ -255,6 +260,7 @@ flz -> romain
gabor -> lippe
gabor -> pgj
+gabor -> stephen
garga -> acm
garga -> alepulver
@@ -307,6 +313,7 @@ lioux -> pat
lwhsu -> yzlin
+maho -> stephen
maho -> tota
marcus -> ahze
@@ -372,6 +379,8 @@ philip -> koitsu
rafan -> chinsan
+rene -> crees
+
sahil -> culot
sat -> beech
@@ -401,6 +410,7 @@ tabthorpe -> dhn
tabthorpe -> fluffy
tabthorpe -> jacula
tabthorpe -> jadawin
+tabthorpe -> jlaffaye
tabthorpe -> pgj
tabthorpe -> rene
diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot
index d450c8a..2fce08f 100644
--- a/share/misc/committers-src.dot
+++ b/share/misc/committers-src.dot
@@ -206,6 +206,7 @@ ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"]
qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"]
rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31"]
randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20"]
+ray [label="Aleksandr Rybalko\nray@FreeBSD.org\n2011/05/25"]
rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n2008/03/13"]
remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"]
rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"]
@@ -268,6 +269,8 @@ day1 -> rgrimes
day1 -> alm
day1 -> dg
+adrian -> ray
+
andre -> qingli
anholt -> jkim
diff --git a/share/misc/mdoc.template b/share/misc/mdoc.template
index 63ba47d..30a5b8e 100644
--- a/share/misc/mdoc.template
+++ b/share/misc/mdoc.template
@@ -33,3 +33,4 @@
.\" .Sh HISTORY
.\" .Sh AUTHORS
.\" .Sh BUGS
+.\" .Sh SECURITY CONSIDERATIONS
diff --git a/share/misc/usb_hid_usages b/share/misc/usb_hid_usages
index 2e66836..0a4a556 100644
--- a/share/misc/usb_hid_usages
+++ b/share/misc/usb_hid_usages
@@ -989,9 +989,11 @@
0x0B Armature
0x0C Multiple Point Digitizer
0x0D Free Space Wand
+ 0x0E Device Configuration
0x20 Stylus
0x21 Puck
0x22 Finger
+ 0x23 Device Settings
0x30 Tip Pressure
0x31 Barrel Pressure
0x32 In Range
@@ -1015,6 +1017,14 @@
0x44 Barrel Switch
0x45 Eraser
0x46 Tablet Pick
+ 0x47 Touch Valid
+ 0x48 Width
+ 0x49 Height
+ 0x51 Contact Identifier
+ 0x52 Device Mode
+ 0x53 Device Identifier
+ 0x54 Contact Count
+ 0x55 Contact Count Maximum
15 Physical Interface Device
0x00 Undefined
diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk
index 539d4c3..49b2d9b 100644
--- a/share/mk/bsd.doc.mk
+++ b/share/mk/bsd.doc.mk
@@ -54,10 +54,10 @@ INDXBIB?= indxbib
PIC?= pic
REFER?= refer
.for _dev in ${PRINTERDEVICE:Mascii}
-ROFF.ascii?= groff -Tascii ${TRFLAGS} -mtty-char ${MACROS} -o${PAGES}
+ROFF.ascii?= groff -Tascii -P-c ${TRFLAGS} -mtty-char ${MACROS} ${PAGES:C/^/-o/1}
.endfor
.for _dev in ${PRINTERDEVICE:Nascii}
-ROFF.${_dev}?= groff -T${_dev} ${TRFLAGS} ${MACROS} -o${PAGES}
+ROFF.${_dev}?= groff -T${_dev} ${TRFLAGS} ${MACROS} ${PAGES:C/^/-o/1}
.endfor
SOELIM?= soelim
TBL?= tbl
@@ -94,8 +94,6 @@ DFILE.${_dev}= ${DOC}.${_dev}${DCOMPRESS_EXT}
.endif
.endfor
-PAGES?= 1-
-
UNROFF?= unroff
HTML_SPLIT?= yes
UNROFFFLAGS?= -fhtml
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index f7ab5f8..a589fba 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -383,6 +383,7 @@ __DEFAULT_YES_OPTIONS = \
TEXTPROC \
TOOLCHAIN \
USB \
+ UTMPX \
WIRELESS \
WPA_SUPPLICANT_EAPOL \
ZFS \
diff --git a/share/skel/dot.shrc b/share/skel/dot.shrc
index 7349169..ea32f35 100644
--- a/share/skel/dot.shrc
+++ b/share/skel/dot.shrc
@@ -44,4 +44,4 @@ alias g='egrep -i'
# esac
# search path for cd(1)
-# CDPATH=.:$HOME
+# CDPATH=:$HOME
diff --git a/sys/Makefile b/sys/Makefile
index 3b24ed9..969994f 100644
--- a/sys/Makefile
+++ b/sys/Makefile
@@ -12,7 +12,7 @@ CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
geom gnu isa kern libkern modules net net80211 netatalk \
netgraph netinet netinet6 netipsec netipx netnatm netncp \
netsmb nfs nfsclient nfsserver nlm opencrypto \
- pci rpc security sys ufs vm xdr ${CSCOPE_ARCHDIR}
+ pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
.if defined(ALL_ARCH)
CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86
.else
diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c
index 57341c9..29e66c5 100644
--- a/sys/amd64/acpica/acpi_wakeup.c
+++ b/sys/amd64/acpica/acpi_wakeup.c
@@ -78,7 +78,7 @@ static void acpi_stop_beep(void *);
#ifdef SMP
static int acpi_wakeup_ap(struct acpi_softc *, int);
-static void acpi_wakeup_cpus(struct acpi_softc *, cpumask_t);
+static void acpi_wakeup_cpus(struct acpi_softc *, const cpuset_t *);
#endif
#define WAKECODE_VADDR(sc) ((sc)->acpi_wakeaddr + (3 * PAGE_SIZE))
@@ -173,7 +173,7 @@ acpi_wakeup_ap(struct acpi_softc *sc, int cpu)
#define BIOS_WARM (0x0a)
static void
-acpi_wakeup_cpus(struct acpi_softc *sc, cpumask_t wakeup_cpus)
+acpi_wakeup_cpus(struct acpi_softc *sc, const cpuset_t *wakeup_cpus)
{
uint32_t mpbioswarmvec;
int cpu;
@@ -192,7 +192,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc, cpumask_t wakeup_cpus)
/* Wake up each AP. */
for (cpu = 1; cpu < mp_ncpus; cpu++) {
- if ((wakeup_cpus & (1 << cpu)) == 0)
+ if (!CPU_ISSET(cpu, wakeup_cpus))
continue;
if (acpi_wakeup_ap(sc, cpu) == 0) {
/* restore the warmstart vector */
@@ -214,7 +214,7 @@ int
acpi_sleep_machdep(struct acpi_softc *sc, int state)
{
#ifdef SMP
- cpumask_t wakeup_cpus;
+ cpuset_t wakeup_cpus;
#endif
register_t cr3, rf;
ACPI_STATUS status;
@@ -244,10 +244,9 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
if (savectx(susppcbs[0])) {
#ifdef SMP
- if (wakeup_cpus != 0 && suspend_cpus(wakeup_cpus) == 0) {
- device_printf(sc->acpi_dev,
- "Failed to suspend APs: CPU mask = 0x%jx\n",
- (uintmax_t)(wakeup_cpus & ~stopped_cpus));
+ if (!CPU_EMPTY(&wakeup_cpus) &&
+ suspend_cpus(wakeup_cpus) == 0) {
+ device_printf(sc->acpi_dev, "Failed to suspend APs\n");
goto out;
}
#endif
@@ -282,8 +281,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
PCPU_SET(switchtime, 0);
PCPU_SET(switchticks, ticks);
#ifdef SMP
- if (wakeup_cpus != 0)
- acpi_wakeup_cpus(sc, wakeup_cpus);
+ if (!CPU_EMPTY(&wakeup_cpus))
+ acpi_wakeup_cpus(sc, &wakeup_cpus);
#endif
acpi_resync_clock(sc);
ret = 0;
@@ -291,7 +290,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
out:
#ifdef SMP
- if (wakeup_cpus != 0)
+ if (!CPU_EMPTY(&wakeup_cpus))
restart_cpus(wakeup_cpus);
#endif
diff --git a/sys/amd64/amd64/intr_machdep.c b/sys/amd64/amd64/intr_machdep.c
index caab1d6..4557177 100644
--- a/sys/amd64/amd64/intr_machdep.c
+++ b/sys/amd64/amd64/intr_machdep.c
@@ -445,8 +445,7 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
* allocate CPUs round-robin.
*/
-/* The BSP is always a valid target. */
-static cpumask_t intr_cpus = (1 << 0);
+static cpuset_t intr_cpus;
static int current_cpu;
/*
@@ -472,7 +471,7 @@ intr_next_cpu(void)
current_cpu++;
if (current_cpu > mp_maxid)
current_cpu = 0;
- } while (!(intr_cpus & (1 << current_cpu)));
+ } while (!CPU_ISSET(current_cpu, &intr_cpus));
mtx_unlock_spin(&icu_lock);
return (apic_id);
}
@@ -503,7 +502,7 @@ intr_add_cpu(u_int cpu)
printf("INTR: Adding local APIC %d as a target\n",
cpu_apic_ids[cpu]);
- intr_cpus |= (1 << cpu);
+ CPU_SET(cpu, &intr_cpus);
}
/*
@@ -516,6 +515,9 @@ intr_shuffle_irqs(void *arg __unused)
struct intsrc *isrc;
int i;
+ /* The BSP is always a valid target. */
+ CPU_SETOF(0, &intr_cpus);
+
/* Don't bother on UP. */
if (mp_ncpus == 1)
return;
diff --git a/sys/amd64/amd64/legacy.c b/sys/amd64/amd64/legacy.c
index 100ce7c..06d7d17 100644
--- a/sys/amd64/amd64/legacy.c
+++ b/sys/amd64/amd64/legacy.c
@@ -81,6 +81,7 @@ static device_method_t legacy_methods[] = {
DEVMETHOD(bus_read_ivar, legacy_read_ivar),
DEVMETHOD(bus_write_ivar, legacy_write_ivar),
DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource),
DEVMETHOD(bus_release_resource, bus_generic_release_resource),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 94b4037..f90ad03 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include "opt_isa.h"
#include "opt_kstack_pages.h"
#include "opt_maxmem.h"
+#include "opt_mp_watchdog.h"
#include "opt_perfmon.h"
#include "opt_sched.h"
#include "opt_kdtrace.h"
@@ -116,6 +117,7 @@ __FBSDID("$FreeBSD$");
#include <x86/mca.h>
#include <machine/md_var.h>
#include <machine/metadata.h>
+#include <machine/mp_watchdog.h>
#include <machine/pc/bios.h>
#include <machine/pcb.h>
#include <machine/proc.h>
@@ -734,9 +736,8 @@ cpu_idle(int busy)
CTR2(KTR_SPARE2, "cpu_idle(%d) at %d",
busy, curcpu);
-#ifdef SMP
- if (mp_grab_cpu_hlt())
- return;
+#ifdef MP_WATCHDOG
+ ap_watchdog(PCPU_GET(cpuid));
#endif
/* If we are busy - try to use fast methods. */
if (busy) {
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index fde9df2..dcf70d4 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -29,13 +29,13 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
-#include "opt_mp_watchdog.h"
#include "opt_sched.h"
#include "opt_smp.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
+#include <sys/cpuset.h>
#ifdef GPROF
#include <sys/gmon.h>
#endif
@@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cpufunc.h>
#include <x86/mca.h>
#include <machine/md_var.h>
-#include <machine/mp_watchdog.h>
#include <machine/pcb.h>
#include <machine/psl.h>
#include <machine/smp.h>
@@ -125,7 +124,7 @@ extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
* Local data and functions.
*/
-static volatile cpumask_t ipi_nmi_pending;
+static volatile cpuset_t ipi_nmi_pending;
/* used to hold the AP's until we are ready to release them */
static struct mtx ap_boot_mtx;
@@ -179,11 +178,8 @@ static int start_all_aps(void);
static int start_ap(int apic_id);
static void release_aps(void *dummy);
-static int hlt_logical_cpus;
static u_int hyperthreading_cpus; /* logical cpus sharing L1 cache */
-static cpumask_t hyperthreading_cpus_mask;
static int hyperthreading_allowed = 1;
-static struct sysctl_ctx_list logical_cpu_clist;
static u_int bootMP_size;
static void
@@ -261,8 +257,11 @@ topo_probe_0x4(void)
* logical processors that belong to the same core
* as BSP thus deducing number of threads per core.
*/
- cpuid_count(0x04, 0, p);
- max_cores = ((p[0] >> 26) & 0x3f) + 1;
+ if (cpu_high >= 0x4) {
+ cpuid_count(0x04, 0, p);
+ max_cores = ((p[0] >> 26) & 0x3f) + 1;
+ } else
+ max_cores = 1;
core_id_bits = mask_width(max_logical/max_cores);
if (core_id_bits < 0)
return;
@@ -354,7 +353,7 @@ topo_probe(void)
if (cpu_topo_probed)
return;
- logical_cpus_mask = 0;
+ CPU_ZERO(&logical_cpus_mask);
if (mp_ncpus <= 1)
cpu_cores = cpu_logical = 1;
else if (cpu_vendor_id == CPU_VENDOR_AMD)
@@ -498,7 +497,7 @@ cpu_mp_probe(void)
* Always record BSP in CPU map so that the mbuf init code works
* correctly.
*/
- all_cpus = 1;
+ CPU_SETOF(0, &all_cpus);
if (mp_ncpus == 0) {
/*
* No CPUs were found, so this must be a UP system. Setup
@@ -625,6 +624,7 @@ cpu_mp_announce(void)
void
init_secondary(void)
{
+ cpuset_t tcpuset, tallcpus;
struct pcpu *pc;
struct nmi_pcpu *np;
u_int64_t msr, cr0;
@@ -756,19 +756,17 @@ init_secondary(void)
CTR1(KTR_SMP, "SMP: AP CPU #%d Launched", PCPU_GET(cpuid));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
+ tcpuset = PCPU_GET(cpumask);
/* Determine if we are a logical CPU. */
/* XXX Calculation depends on cpu_logical being a power of 2, e.g. 2 */
if (cpu_logical > 1 && PCPU_GET(apic_id) % cpu_logical != 0)
- logical_cpus_mask |= PCPU_GET(cpumask);
-
- /* Determine if we are a hyperthread. */
- if (hyperthreading_cpus > 1 &&
- PCPU_GET(apic_id) % hyperthreading_cpus != 0)
- hyperthreading_cpus_mask |= PCPU_GET(cpumask);
+ CPU_OR(&logical_cpus_mask, &tcpuset);
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
+ tallcpus = all_cpus;
+ CPU_NAND(&tallcpus, &tcpuset);
+ PCPU_SET(other_cpus, tallcpus);
if (bootverbose)
lapic_dump("AP");
@@ -855,7 +853,7 @@ assign_cpu_ids(void)
if (hyperthreading_cpus > 1 && i % hyperthreading_cpus != 0) {
cpu_info[i].cpu_hyperthread = 1;
-#if defined(SCHED_ULE)
+
/*
* Don't use HT CPU if it has been disabled by a
* tunable.
@@ -864,7 +862,6 @@ assign_cpu_ids(void)
cpu_info[i].cpu_disabled = 1;
continue;
}
-#endif
}
/* Don't use this CPU if it has been disabled by a tunable. */
@@ -874,6 +871,11 @@ assign_cpu_ids(void)
}
}
+ if (hyperthreading_allowed == 0 && hyperthreading_cpus > 1) {
+ hyperthreading_cpus = 0;
+ cpu_logical = 1;
+ }
+
/*
* Assign CPU IDs to local APIC IDs and disable any CPUs
* beyond MAXCPU. CPU 0 is always assigned to the BSP.
@@ -911,6 +913,7 @@ assign_cpu_ids(void)
static int
start_all_aps(void)
{
+ cpuset_t tallcpus, tcpuset;
vm_offset_t va = boot_address + KERNBASE;
u_int64_t *pt4, *pt3, *pt2;
u_int32_t mpbioswarmvec;
@@ -998,11 +1001,14 @@ start_all_aps(void)
panic("AP #%d (PHY# %d) failed!", cpu, apic_id);
}
- all_cpus |= (1 << cpu); /* record AP in CPU map */
+ CPU_SET(cpu, &all_cpus); /* record AP in CPU map */
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
+ tallcpus = all_cpus;
+ tcpuset = PCPU_GET(cpumask);
+ CPU_NAND(&tallcpus, &tcpuset);
+ PCPU_SET(other_cpus, tallcpus);
/* restore the warmstart vector */
*(u_int32_t *) WARMBOOT_OFF = mpbioswarmvec;
@@ -1131,6 +1137,30 @@ SYSCTL_UINT(_debug_xhits, OID_AUTO, ipi_masked_range_size, CTLFLAG_RW,
#endif /* COUNT_XINVLTLB_HITS */
/*
+ * Send an IPI to specified CPU handling the bitmap logic.
+ */
+static void
+ipi_send_cpu(int cpu, u_int ipi)
+{
+ u_int bitmap, old_pending, new_pending;
+
+ KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu));
+
+ if (IPI_IS_BITMAPED(ipi)) {
+ bitmap = 1 << ipi;
+ ipi = IPI_BITMAP_VECTOR;
+ do {
+ old_pending = cpu_ipi_pending[cpu];
+ new_pending = old_pending | bitmap;
+ } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],
+ old_pending, new_pending));
+ if (old_pending)
+ return;
+ }
+ lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
+}
+
+/*
* Flush the TLB on all other CPU's
*/
static void
@@ -1154,28 +1184,19 @@ smp_tlb_shootdown(u_int vector, vm_offset_t addr1, vm_offset_t addr2)
}
static void
-smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2)
+smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2)
{
- int ncpu, othercpus;
+ int cpu, ncpu, othercpus;
othercpus = mp_ncpus - 1;
- if (mask == (cpumask_t)-1) {
- ncpu = othercpus;
- if (ncpu < 1)
+ if (CPU_ISFULLSET(&mask)) {
+ if (othercpus < 1)
return;
} else {
- mask &= ~PCPU_GET(cpumask);
- if (mask == 0)
- return;
- ncpu = bitcount32(mask);
- if (ncpu > othercpus) {
- /* XXX this should be a panic offence */
- printf("SMP: tlb shootdown to %d other cpus (only have %d)\n",
- ncpu, othercpus);
- ncpu = othercpus;
- }
- /* XXX should be a panic, implied by mask == 0 above */
- if (ncpu < 1)
+ sched_pin();
+ CPU_NAND(&mask, PCPU_PTR(cpumask));
+ sched_unpin();
+ if (CPU_EMPTY(&mask))
return;
}
if (!(read_rflags() & PSL_I))
@@ -1184,39 +1205,25 @@ smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_o
smp_tlb_addr1 = addr1;
smp_tlb_addr2 = addr2;
atomic_store_rel_int(&smp_tlb_wait, 0);
- if (mask == (cpumask_t)-1)
+ if (CPU_ISFULLSET(&mask)) {
+ ncpu = othercpus;
ipi_all_but_self(vector);
- else
- ipi_selected(mask, vector);
+ } else {
+ ncpu = 0;
+ while ((cpu = cpusetobj_ffs(&mask)) != 0) {
+ cpu--;
+ CPU_CLR(cpu, &mask);
+ CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__,
+ cpu, vector);
+ ipi_send_cpu(cpu, vector);
+ ncpu++;
+ }
+ }
while (smp_tlb_wait < ncpu)
ia32_pause();
mtx_unlock_spin(&smp_ipi_mtx);
}
-/*
- * Send an IPI to specified CPU handling the bitmap logic.
- */
-static void
-ipi_send_cpu(int cpu, u_int ipi)
-{
- u_int bitmap, old_pending, new_pending;
-
- KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu));
-
- if (IPI_IS_BITMAPED(ipi)) {
- bitmap = 1 << ipi;
- ipi = IPI_BITMAP_VECTOR;
- do {
- old_pending = cpu_ipi_pending[cpu];
- new_pending = old_pending | bitmap;
- } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],
- old_pending, new_pending));
- if (old_pending)
- return;
- }
- lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
-}
-
void
smp_cache_flush(void)
{
@@ -1263,7 +1270,7 @@ smp_invlpg_range(vm_offset_t addr1, vm_offset_t addr2)
}
void
-smp_masked_invltlb(cpumask_t mask)
+smp_masked_invltlb(cpuset_t mask)
{
if (smp_started) {
@@ -1275,7 +1282,7 @@ smp_masked_invltlb(cpumask_t mask)
}
void
-smp_masked_invlpg(cpumask_t mask, vm_offset_t addr)
+smp_masked_invlpg(cpuset_t mask, vm_offset_t addr)
{
if (smp_started) {
@@ -1287,7 +1294,7 @@ smp_masked_invlpg(cpumask_t mask, vm_offset_t addr)
}
void
-smp_masked_invlpg_range(cpumask_t mask, vm_offset_t addr1, vm_offset_t addr2)
+smp_masked_invlpg_range(cpuset_t mask, vm_offset_t addr1, vm_offset_t addr2)
{
if (smp_started) {
@@ -1340,7 +1347,7 @@ ipi_bitmap_handler(struct trapframe frame)
* send an IPI to a set of cpus.
*/
void
-ipi_selected(cpumask_t cpus, u_int ipi)
+ipi_selected(cpuset_t cpus, u_int ipi)
{
int cpu;
@@ -1350,12 +1357,12 @@ ipi_selected(cpumask_t cpus, u_int ipi)
* Set the mask of receiving CPUs for this purpose.
*/
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, cpus);
+ CPU_OR_ATOMIC(&ipi_nmi_pending, &cpus);
- CTR3(KTR_SMP, "%s: cpus: %x ipi: %x", __func__, cpus, ipi);
- while ((cpu = ffs(cpus)) != 0) {
+ while ((cpu = cpusetobj_ffs(&cpus)) != 0) {
cpu--;
- cpus &= ~(1 << cpu);
+ CPU_CLR(cpu, &cpus);
+ CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi);
ipi_send_cpu(cpu, ipi);
}
}
@@ -1373,7 +1380,7 @@ ipi_cpu(int cpu, u_int ipi)
* Set the mask of receiving CPUs for this purpose.
*/
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, 1 << cpu);
+ CPU_SET_ATOMIC(cpu, &ipi_nmi_pending);
CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi);
ipi_send_cpu(cpu, ipi);
@@ -1386,8 +1393,10 @@ void
ipi_all_but_self(u_int ipi)
{
+ sched_pin();
if (IPI_IS_BITMAPED(ipi)) {
ipi_selected(PCPU_GET(other_cpus), ipi);
+ sched_unpin();
return;
}
@@ -1397,7 +1406,8 @@ ipi_all_but_self(u_int ipi)
* Set the mask of receiving CPUs for this purpose.
*/
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, PCPU_GET(other_cpus));
+ CPU_OR_ATOMIC(&ipi_nmi_pending, PCPU_PTR(other_cpus));
+ sched_unpin();
CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi);
lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
@@ -1406,7 +1416,7 @@ ipi_all_but_self(u_int ipi)
int
ipi_nmi_handler()
{
- cpumask_t cpumask;
+ cpuset_t cpumask;
/*
* As long as there is not a simple way to know about a NMI's
@@ -1414,11 +1424,13 @@ ipi_nmi_handler()
* the global pending bitword an IPI_STOP_HARD has been issued
* and should be handled.
*/
+ sched_pin();
cpumask = PCPU_GET(cpumask);
- if ((ipi_nmi_pending & cpumask) == 0)
+ sched_unpin();
+ if (!CPU_OVERLAP(&ipi_nmi_pending, &cpumask))
return (1);
- atomic_clear_int(&ipi_nmi_pending, cpumask);
+ CPU_NAND_ATOMIC(&ipi_nmi_pending, &cpumask);
cpustop_handler();
return (0);
}
@@ -1430,23 +1442,25 @@ ipi_nmi_handler()
void
cpustop_handler(void)
{
- cpumask_t cpumask;
+ cpuset_t cpumask;
u_int cpu;
+ sched_pin();
cpu = PCPU_GET(cpuid);
cpumask = PCPU_GET(cpumask);
+ sched_unpin();
savectx(&stoppcbs[cpu]);
/* Indicate that we are stopped */
- atomic_set_int(&stopped_cpus, cpumask);
+ CPU_OR_ATOMIC(&stopped_cpus, &cpumask);
/* Wait for restart */
- while (!(started_cpus & cpumask))
+ while (!CPU_OVERLAP(&started_cpus, &cpumask))
ia32_pause();
- atomic_clear_int(&started_cpus, cpumask);
- atomic_clear_int(&stopped_cpus, cpumask);
+ CPU_NAND_ATOMIC(&started_cpus, &cpumask);
+ CPU_NAND_ATOMIC(&stopped_cpus, &cpumask);
if (cpu == 0 && cpustop_restartfunc != NULL) {
cpustop_restartfunc();
@@ -1461,7 +1475,7 @@ cpustop_handler(void)
void
cpususpend_handler(void)
{
- cpumask_t cpumask;
+ cpuset_t cpumask;
register_t cr3, rf;
u_int cpu;
@@ -1473,7 +1487,7 @@ cpususpend_handler(void)
if (savectx(susppcbs[cpu])) {
wbinvd();
- atomic_set_int(&stopped_cpus, cpumask);
+ CPU_OR_ATOMIC(&stopped_cpus, &cpumask);
} else {
pmap_init_pat();
PCPU_SET(switchtime, 0);
@@ -1481,11 +1495,11 @@ cpususpend_handler(void)
}
/* Wait for resume */
- while (!(started_cpus & cpumask))
+ while (!CPU_OVERLAP(&started_cpus, &cpumask))
ia32_pause();
- atomic_clear_int(&started_cpus, cpumask);
- atomic_clear_int(&stopped_cpus, cpumask);
+ CPU_NAND_ATOMIC(&started_cpus, &cpumask);
+ CPU_NAND_ATOMIC(&stopped_cpus, &cpumask);
/* Restore CR3 and enable interrupts */
load_cr3(cr3);
@@ -1510,158 +1524,6 @@ release_aps(void *dummy __unused)
}
SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, release_aps, NULL);
-static int
-sysctl_hlt_cpus(SYSCTL_HANDLER_ARGS)
-{
- cpumask_t mask;
- int error;
-
- mask = hlt_cpus_mask;
- error = sysctl_handle_int(oidp, &mask, 0, req);
- if (error || !req->newptr)
- return (error);
-
- if (logical_cpus_mask != 0 &&
- (mask & logical_cpus_mask) == logical_cpus_mask)
- hlt_logical_cpus = 1;
- else
- hlt_logical_cpus = 0;
-
- if (! hyperthreading_allowed)
- mask |= hyperthreading_cpus_mask;
-
- if ((mask & all_cpus) == all_cpus)
- mask &= ~(1<<0);
- hlt_cpus_mask = mask;
- return (error);
-}
-SYSCTL_PROC(_machdep, OID_AUTO, hlt_cpus, CTLTYPE_INT|CTLFLAG_RW,
- 0, 0, sysctl_hlt_cpus, "IU",
- "Bitmap of CPUs to halt. 101 (binary) will halt CPUs 0 and 2.");
-
-static int
-sysctl_hlt_logical_cpus(SYSCTL_HANDLER_ARGS)
-{
- int disable, error;
-
- disable = hlt_logical_cpus;
- error = sysctl_handle_int(oidp, &disable, 0, req);
- if (error || !req->newptr)
- return (error);
-
- if (disable)
- hlt_cpus_mask |= logical_cpus_mask;
- else
- hlt_cpus_mask &= ~logical_cpus_mask;
-
- if (! hyperthreading_allowed)
- hlt_cpus_mask |= hyperthreading_cpus_mask;
-
- if ((hlt_cpus_mask & all_cpus) == all_cpus)
- hlt_cpus_mask &= ~(1<<0);
-
- hlt_logical_cpus = disable;
- return (error);
-}
-
-static int
-sysctl_hyperthreading_allowed(SYSCTL_HANDLER_ARGS)
-{
- int allowed, error;
-
- allowed = hyperthreading_allowed;
- error = sysctl_handle_int(oidp, &allowed, 0, req);
- if (error || !req->newptr)
- return (error);
-
-#ifdef SCHED_ULE
- /*
- * SCHED_ULE doesn't allow enabling/disabling HT cores at
- * run-time.
- */
- if (allowed != hyperthreading_allowed)
- return (ENOTSUP);
- return (error);
-#endif
-
- if (allowed)
- hlt_cpus_mask &= ~hyperthreading_cpus_mask;
- else
- hlt_cpus_mask |= hyperthreading_cpus_mask;
-
- if (logical_cpus_mask != 0 &&
- (hlt_cpus_mask & logical_cpus_mask) == logical_cpus_mask)
- hlt_logical_cpus = 1;
- else
- hlt_logical_cpus = 0;
-
- if ((hlt_cpus_mask & all_cpus) == all_cpus)
- hlt_cpus_mask &= ~(1<<0);
-
- hyperthreading_allowed = allowed;
- return (error);
-}
-
-static void
-cpu_hlt_setup(void *dummy __unused)
-{
-
- if (logical_cpus_mask != 0) {
- TUNABLE_INT_FETCH("machdep.hlt_logical_cpus",
- &hlt_logical_cpus);
- sysctl_ctx_init(&logical_cpu_clist);
- SYSCTL_ADD_PROC(&logical_cpu_clist,
- SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO,
- "hlt_logical_cpus", CTLTYPE_INT|CTLFLAG_RW, 0, 0,
- sysctl_hlt_logical_cpus, "IU", "");
- SYSCTL_ADD_UINT(&logical_cpu_clist,
- SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO,
- "logical_cpus_mask", CTLTYPE_INT|CTLFLAG_RD,
- &logical_cpus_mask, 0, "");
-
- if (hlt_logical_cpus)
- hlt_cpus_mask |= logical_cpus_mask;
-
- /*
- * If necessary for security purposes, force
- * hyperthreading off, regardless of the value
- * of hlt_logical_cpus.
- */
- if (hyperthreading_cpus_mask) {
- SYSCTL_ADD_PROC(&logical_cpu_clist,
- SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO,
- "hyperthreading_allowed", CTLTYPE_INT|CTLFLAG_RW,
- 0, 0, sysctl_hyperthreading_allowed, "IU", "");
- if (! hyperthreading_allowed)
- hlt_cpus_mask |= hyperthreading_cpus_mask;
- }
- }
-}
-SYSINIT(cpu_hlt, SI_SUB_SMP, SI_ORDER_ANY, cpu_hlt_setup, NULL);
-
-int
-mp_grab_cpu_hlt(void)
-{
- cpumask_t mask;
-#ifdef MP_WATCHDOG
- u_int cpuid;
-#endif
- int retval;
-
- mask = PCPU_GET(cpumask);
-#ifdef MP_WATCHDOG
- cpuid = PCPU_GET(cpuid);
- ap_watchdog(cpuid);
-#endif
-
- retval = 0;
- while (mask & hlt_cpus_mask) {
- retval = 1;
- __asm __volatile("sti; hlt" : : : "memory");
- }
- return (retval);
-}
-
#ifdef COUNT_IPIS
/*
* Setup interrupt counters for IPI handlers.
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index c9ff9bc..025ca5f 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -123,6 +123,8 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#ifdef SMP
#include <sys/smp.h>
+#else
+#include <sys/cpuset.h>
#endif
#include <vm/vm.h>
@@ -581,7 +583,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
PMAP_LOCK_INIT(kernel_pmap);
kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys);
kernel_pmap->pm_root = NULL;
- kernel_pmap->pm_active = -1; /* don't allow deactivation */
+ CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvchunk);
/*
@@ -923,19 +925,20 @@ pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde)
void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
invlpg(va);
smp_invlpg(va);
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
invlpg(va);
- if (pmap->pm_active & other_cpus)
- smp_masked_invlpg(pmap->pm_active & other_cpus, va);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invlpg(other_cpus, va);
}
sched_unpin();
}
@@ -943,23 +946,23 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
void
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
vm_offset_t addr;
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
smp_invlpg_range(sva, eva);
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
- if (pmap->pm_active & other_cpus)
- smp_masked_invlpg_range(pmap->pm_active & other_cpus,
- sva, eva);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invlpg_range(other_cpus, sva, eva);
}
sched_unpin();
}
@@ -967,19 +970,20 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
void
pmap_invalidate_all(pmap_t pmap)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
invltlb();
smp_invltlb();
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
invltlb();
- if (pmap->pm_active & other_cpus)
- smp_masked_invltlb(pmap->pm_active & other_cpus);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invltlb(other_cpus);
}
sched_unpin();
}
@@ -995,8 +999,8 @@ pmap_invalidate_cache(void)
}
struct pde_action {
- cpumask_t store; /* processor that updates the PDE */
- cpumask_t invalidate; /* processors that invalidate their TLB */
+ cpuset_t store; /* processor that updates the PDE */
+ cpuset_t invalidate; /* processors that invalidate their TLB */
vm_offset_t va;
pd_entry_t *pde;
pd_entry_t newpde;
@@ -1007,8 +1011,12 @@ pmap_update_pde_action(void *arg)
{
struct pde_action *act = arg;
- if (act->store == PCPU_GET(cpumask))
+ sched_pin();
+ if (!CPU_CMP(&act->store, PCPU_PTR(cpumask))) {
+ sched_unpin();
pde_store(act->pde, act->newpde);
+ } else
+ sched_unpin();
}
static void
@@ -1016,8 +1024,12 @@ pmap_update_pde_teardown(void *arg)
{
struct pde_action *act = arg;
- if ((act->invalidate & PCPU_GET(cpumask)) != 0)
+ sched_pin();
+ if (CPU_OVERLAP(&act->invalidate, PCPU_PTR(cpumask))) {
+ sched_unpin();
pmap_update_pde_invalidate(act->va, act->newpde);
+ } else
+ sched_unpin();
}
/*
@@ -1032,26 +1044,28 @@ static void
pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde)
{
struct pde_action act;
- cpumask_t active, cpumask;
+ cpuset_t active, cpumask, other_cpus;
sched_pin();
cpumask = PCPU_GET(cpumask);
+ other_cpus = PCPU_GET(other_cpus);
if (pmap == kernel_pmap)
active = all_cpus;
else
active = pmap->pm_active;
- if ((active & PCPU_GET(other_cpus)) != 0) {
+ if (CPU_OVERLAP(&active, &other_cpus)) {
act.store = cpumask;
act.invalidate = active;
act.va = va;
act.pde = pde;
act.newpde = newpde;
- smp_rendezvous_cpus(cpumask | active,
+ CPU_OR(&cpumask, &active);
+ smp_rendezvous_cpus(cpumask,
smp_no_rendevous_barrier, pmap_update_pde_action,
pmap_update_pde_teardown, &act);
} else {
pde_store(pde, newpde);
- if ((active & cpumask) != 0)
+ if (CPU_OVERLAP(&active, &cpumask))
pmap_update_pde_invalidate(va, newpde);
}
sched_unpin();
@@ -1065,7 +1079,7 @@ PMAP_INLINE void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
invlpg(va);
}
@@ -1074,7 +1088,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
vm_offset_t addr;
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
}
@@ -1083,7 +1097,7 @@ PMAP_INLINE void
pmap_invalidate_all(pmap_t pmap)
{
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
invltlb();
}
@@ -1099,7 +1113,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde)
{
pde_store(pde, newpde);
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
pmap_update_pde_invalidate(va, newpde);
}
#endif /* !SMP */
@@ -1607,7 +1621,7 @@ pmap_pinit0(pmap_t pmap)
PMAP_LOCK_INIT(pmap);
pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys);
pmap->pm_root = NULL;
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
PCPU_SET(curpmap, pmap);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
@@ -1649,7 +1663,7 @@ pmap_pinit(pmap_t pmap)
pmap->pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | PG_V | PG_RW | PG_A | PG_M;
pmap->pm_root = NULL;
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
@@ -5087,11 +5101,11 @@ pmap_activate(struct thread *td)
pmap = vmspace_pmap(td->td_proc->p_vmspace);
oldpmap = PCPU_GET(curpmap);
#ifdef SMP
- atomic_clear_int(&oldpmap->pm_active, PCPU_GET(cpumask));
- atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask));
+ CPU_NAND_ATOMIC(&oldpmap->pm_active, PCPU_PTR(cpumask));
+ CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask));
#else
- oldpmap->pm_active &= ~PCPU_GET(cpumask);
- pmap->pm_active |= PCPU_GET(cpumask);
+ CPU_NAND(&oldpmap->pm_active, PCPU_PTR(cpumask));
+ CPU_OR(&pmap->pm_active, PCPU_PTR(cpumask));
#endif
cr3 = DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4);
td->td_pcb->pcb_cr3 = cr3;
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 166bde1..2a9dd7a 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/pioctl.h>
#include <sys/proc.h>
+#include <sys/sched.h>
#include <sys/sf_buf.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
@@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
+#include <machine/smp.h>
#include <machine/specialreg.h>
#include <machine/tss.h>
@@ -512,13 +514,15 @@ cpu_set_user_tls(struct thread *td, void *tls_base)
static void
cpu_reset_proxy()
{
+ cpuset_t tcrp;
cpu_reset_proxy_active = 1;
while (cpu_reset_proxy_active == 1) {
ia32_pause();
; /* Wait for other cpu to see that we've started */
}
- stop_cpus((1<<cpu_reset_proxyid));
+ CPU_SETOF(cpu_reset_proxyid, &tcrp);
+ stop_cpus(tcrp);
printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid);
DELAY(1000000);
cpu_reset_real();
@@ -529,24 +533,28 @@ void
cpu_reset()
{
#ifdef SMP
- cpumask_t map;
+ cpuset_t map;
u_int cnt;
if (smp_active) {
- map = PCPU_GET(other_cpus) & ~stopped_cpus;
- if (map != 0) {
+ sched_pin();
+ map = PCPU_GET(other_cpus);
+ CPU_NAND(&map, &stopped_cpus);
+ if (!CPU_EMPTY(&map)) {
printf("cpu_reset: Stopping other CPUs\n");
stop_cpus(map);
}
if (PCPU_GET(cpuid) != 0) {
cpu_reset_proxyid = PCPU_GET(cpuid);
+ sched_unpin();
cpustop_restartfunc = cpu_reset_proxy;
cpu_reset_proxy_active = 0;
printf("cpu_reset: Restarting BSP\n");
/* Restart CPU #0. */
- atomic_store_rel_int(&started_cpus, 1 << 0);
+ CPU_SETOF(0, &started_cpus);
+ wmb();
cnt = 0;
while (cpu_reset_proxy_active == 0 && cnt < 10000000) {
@@ -561,7 +569,8 @@ cpu_reset()
while (1)
ia32_pause();
/* NOTREACHED */
- }
+ } else
+ sched_unpin();
DELAY(1000000);
}
diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC
index 1117f15..7c42038 100644
--- a/sys/amd64/conf/GENERIC
+++ b/sys/amd64/conf/GENERIC
@@ -296,6 +296,7 @@ options USB_DEBUG # enable debug msgs
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
+device xhci # XHCI PCI->USB interface (USB 3.0)
device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices (needs netgraph)
device uhid # "Human Interface Devices"
@@ -343,3 +344,11 @@ device dcons_crom # Configuration ROM for dcons
device bvmconsole # brain dead simple bvm console
device bvmdebug # brain dead simple bvm gdb pipe
device mptable
+
+# Sound support
+device sound # Generic sound driver (required)
+device snd_es137x # Ensoniq AudioPCI ES137x
+device snd_hda # Intel High Definition Audio
+device snd_ich # Intel, NVidia and other ICH AC'97 Audio
+device snd_uaudio # USB Audio
+device snd_via8233 # VIA VT8233x Audio
diff --git a/sys/amd64/ia32/ia32_sigtramp.S b/sys/amd64/ia32/ia32_sigtramp.S
index 7d64470..710834c 100644
--- a/sys/amd64/ia32/ia32_sigtramp.S
+++ b/sys/amd64/ia32/ia32_sigtramp.S
@@ -79,8 +79,20 @@ ia32_osigcode:
jmp 1b
+/*
+ * The lcall $7,$0 emulator cannot use the call gate that does an
+ * inter-privilege transition. The reason is that the call gate
+ * does not disable interrupts, and, before the swapgs is
+ * executed, we would have a window where the ring 0 code is
+ * executed with the wrong gsbase.
+ *
+ * Instead, reflect the lcall $7,$0 back to ring 3 trampoline
+ * which sets up the frame for int $0x80.
+ */
ALIGN_TEXT
lcall_tramp:
+ cmpl $SYS_vfork,%eax
+ je 2f
pushl %ebp
movl %esp,%ebp
pushl 0x24(%ebp) /* arg 6 */
@@ -91,8 +103,19 @@ lcall_tramp:
pushl 0x10(%ebp) /* arg 1 */
pushl 0xc(%ebp) /* gap */
int $0x80
- leave
+ leavel
+1:
lretl
+2:
+ /*
+ * vfork handling is special and relies on the libc stub saving
+ * the return ip in %ecx. If vfork failed, then there is no
+ * child which can corrupt the frame created by call gate.
+ */
+ int $0x80
+ jb 1b
+ addl $8,%esp
+ jmpl *%ecx
#endif
ALIGN_TEXT
diff --git a/sys/amd64/include/_types.h b/sys/amd64/include/_types.h
index 89d2e86..13dc3ea 100644
--- a/sys/amd64/include/_types.h
+++ b/sys/amd64/include/_types.h
@@ -61,7 +61,6 @@ typedef unsigned long __uint64_t;
* Standard type definitions.
*/
typedef __int32_t __clock_t; /* clock()... */
-typedef unsigned int __cpumask_t;
typedef __int64_t __critical_t;
typedef double __double_t;
typedef float __float_t;
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 7a62851..1b8108a 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -152,6 +152,7 @@
#ifndef LOCORE
#include <sys/queue.h>
+#include <sys/_cpuset.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
@@ -251,7 +252,7 @@ struct pmap {
struct mtx pm_mtx;
pml4_entry_t *pm_pml4; /* KVA of level 4 page table */
TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */
- cpumask_t pm_active; /* active on cpus */
+ cpuset_t pm_active; /* active on cpus */
/* spare u_int here due to padding */
struct pmap_statistics pm_stats; /* pmap statistics */
vm_page_t pm_root; /* spare page table pages */
diff --git a/sys/amd64/include/smp.h b/sys/amd64/include/smp.h
index ec107f9..de686b7 100644
--- a/sys/amd64/include/smp.h
+++ b/sys/amd64/include/smp.h
@@ -63,17 +63,16 @@ void ipi_all_but_self(u_int ipi);
void ipi_bitmap_handler(struct trapframe frame);
void ipi_cpu(int cpu, u_int ipi);
int ipi_nmi_handler(void);
-void ipi_selected(cpumask_t cpus, u_int ipi);
+void ipi_selected(cpuset_t cpus, u_int ipi);
u_int mp_bootaddress(u_int);
-int mp_grab_cpu_hlt(void);
void smp_cache_flush(void);
void smp_invlpg(vm_offset_t addr);
-void smp_masked_invlpg(cpumask_t mask, vm_offset_t addr);
+void smp_masked_invlpg(cpuset_t mask, vm_offset_t addr);
void smp_invlpg_range(vm_offset_t startva, vm_offset_t endva);
-void smp_masked_invlpg_range(cpumask_t mask, vm_offset_t startva,
+void smp_masked_invlpg_range(cpuset_t mask, vm_offset_t startva,
vm_offset_t endva);
void smp_invltlb(void);
-void smp_masked_invltlb(cpumask_t mask);
+void smp_masked_invltlb(cpuset_t mask);
#endif /* !LOCORE */
#endif /* SMP */
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h
index 0f4c356..26646fb 100644
--- a/sys/amd64/include/vmm.h
+++ b/sys/amd64/include/vmm.h
@@ -111,7 +111,7 @@ struct vlapic *vm_lapic(struct vm *vm, int cpu);
int vm_get_capability(struct vm *vm, int vcpu, int type, int *val);
int vm_set_capability(struct vm *vm, int vcpu, int type, int val);
void vm_activate_cpu(struct vm *vm, int vcpu);
-cpumask_t vm_active_cpus(struct vm *vm);
+cpuset_t vm_active_cpus(struct vm *vm);
/*
* Return 1 if device indicated by bus/slot/func is supposed to be a
@@ -136,12 +136,6 @@ vcpu_is_running(struct vm *vm, int vcpu, int *hostcpu)
return (vm_get_run_state(vm, vcpu, hostcpu) == VCPU_RUNNING);
}
-static cpumask_t __inline
-vcpu_mask(int vcpuid)
-{
- return ((cpumask_t)1 << vcpuid);
-}
-
#endif /* KERNEL */
#define VM_MAXCPU 8 /* maximum virtual cpus */
diff --git a/sys/amd64/vmm/amd/amdv.c b/sys/amd64/vmm/amd/amdv.c
index 41e937a..6844cc0 100644
--- a/sys/amd64/vmm/amd/amdv.c
+++ b/sys/amd64/vmm/amd/amdv.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/errno.h>
+#include <sys/smp.h>
#include <machine/vmm.h>
#include "io/iommu.h"
diff --git a/sys/amd64/vmm/io/ppt.c b/sys/amd64/vmm/io/ppt.c
index 02db4bd..fcb36ad 100644
--- a/sys/amd64/vmm/io/ppt.c
+++ b/sys/amd64/vmm/io/ppt.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/pciio.h>
#include <sys/rman.h>
+#include <sys/smp.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c
index c0d82dd..0a14127 100644
--- a/sys/amd64/vmm/io/vlapic.c
+++ b/sys/amd64/vmm/io/vlapic.c
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/systm.h>
+#include <sys/smp.h>
#include <machine/clock.h>
#include <x86/apicreg.h>
@@ -439,12 +440,11 @@ static int
lapic_process_icr(struct vlapic *vlapic, uint64_t icrval)
{
int i;
- cpumask_t dmask, thiscpumask;
+ cpuset_t dmask;
uint32_t dest, vec, mode;
- thiscpumask = vcpu_mask(vlapic->vcpuid);
+ CPU_ZERO(&dmask);
- dmask = 0;
dest = icrval >> 32;
vec = icrval & APIC_VECTOR_MASK;
mode = icrval & APIC_DELMODE_MASK;
@@ -452,26 +452,27 @@ lapic_process_icr(struct vlapic *vlapic, uint64_t icrval)
if (mode == APIC_DELMODE_FIXED || mode == APIC_DELMODE_NMI) {
switch (icrval & APIC_DEST_MASK) {
case APIC_DEST_DESTFLD:
- dmask = vcpu_mask(dest);
+ CPU_SETOF(dest, &dmask);
break;
case APIC_DEST_SELF:
- dmask = thiscpumask;
+ CPU_SETOF(vlapic->vcpuid, &dmask);
break;
case APIC_DEST_ALLISELF:
dmask = vm_active_cpus(vlapic->vm);
break;
case APIC_DEST_ALLESELF:
- dmask = vm_active_cpus(vlapic->vm) & ~thiscpumask;
+ dmask = vm_active_cpus(vlapic->vm);
+ CPU_CLR(vlapic->vcpuid, &dmask);
break;
}
- for (i = 0; i < VM_MAXCPU; i++) {
- if (dmask & vcpu_mask(i)) {
- if (mode == APIC_DELMODE_FIXED)
- lapic_set_intr(vlapic->vm, i, vec);
- else
- vm_inject_nmi(vlapic->vm, i);
- }
+ while ((i = cpusetobj_ffs(&dmask)) != 0) {
+ i--;
+ CPU_CLR(i, &dmask);
+ if (mode == APIC_DELMODE_FIXED)
+ lapic_set_intr(vlapic->vm, i, vec);
+ else
+ vm_inject_nmi(vlapic->vm, i);
}
return (0); /* handled completely in the kernel */
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index f984138..9d32ccc 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -97,11 +97,11 @@ struct vm {
char name[VM_MAX_NAMELEN];
/*
- * Mask of active vcpus.
+ * Set of active vcpus.
* An active vcpu is one that has been started implicitly (BSP) or
* explicitly (AP) by sending it a startup ipi.
*/
- cpumask_t active_cpus;
+ cpuset_t active_cpus;
};
static struct vmm_ops *ops;
@@ -720,10 +720,10 @@ vm_activate_cpu(struct vm *vm, int vcpuid)
{
if (vcpuid >= 0 && vcpuid < VM_MAXCPU)
- vm->active_cpus |= vcpu_mask(vcpuid);
+ CPU_SET(vcpuid, &vm->active_cpus);
}
-cpumask_t
+cpuset_t
vm_active_cpus(struct vm *vm)
{
diff --git a/sys/amd64/vmm/vmm_lapic.c b/sys/amd64/vmm/vmm_lapic.c
index 8704fcf..4aca087 100644
--- a/sys/amd64/vmm/vmm_lapic.c
+++ b/sys/amd64/vmm/vmm_lapic.c
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/smp.h>
#include <machine/vmm.h>
#include "vmm_ipi.h"
diff --git a/sys/amd64/vmm/vmm_msr.c b/sys/amd64/vmm/vmm_msr.c
index 5317ca0..99ac293 100644
--- a/sys/amd64/vmm/vmm_msr.c
+++ b/sys/amd64/vmm/vmm_msr.c
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/smp.h>
#include <machine/specialreg.h>
#include <x86/apicreg.h>
diff --git a/sys/amd64/vmm/vmm_stat.c b/sys/amd64/vmm/vmm_stat.c
index e6f5c48..ae60979 100644
--- a/sys/amd64/vmm/vmm_stat.c
+++ b/sys/amd64/vmm/vmm_stat.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/malloc.h>
+#include <sys/smp.h>
#include <machine/vmm.h>
#include "vmm_stat.h"
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index 087a744..cecf363 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -2395,7 +2395,7 @@ pmap_bootstrap(vm_offset_t firstaddr, vm_offset_t lastaddr, struct pv_addr *l1pt
cpu_cpwait();
PMAP_LOCK_INIT(kernel_pmap);
- kernel_pmap->pm_active = -1;
+ CPU_FILL(&kernel_pmap->pm_active);
kernel_pmap->pm_domain = PMAP_DOMAIN_KERNEL;
TAILQ_INIT(&kernel_pmap->pm_pvlist);
@@ -3826,7 +3826,7 @@ pmap_pinit(pmap_t pmap)
pmap_alloc_l1(pmap);
bzero(pmap->pm_l2, sizeof(pmap->pm_l2));
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
TAILQ_INIT(&pmap->pm_pvlist);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
diff --git a/sys/arm/include/_types.h b/sys/arm/include/_types.h
index 48dd2a7..d8386f3 100644
--- a/sys/arm/include/_types.h
+++ b/sys/arm/include/_types.h
@@ -67,7 +67,6 @@ typedef unsigned long long __uint64_t;
* Standard type definitions.
*/
typedef __uint32_t __clock_t; /* clock()... */
-typedef unsigned int __cpumask_t;
typedef __int32_t __critical_t;
typedef double __double_t;
typedef double __float_t;
diff --git a/sys/arm/include/pmap.h b/sys/arm/include/pmap.h
index 701390a..3d63432 100644
--- a/sys/arm/include/pmap.h
+++ b/sys/arm/include/pmap.h
@@ -62,6 +62,7 @@
#ifndef LOCORE
#include <sys/queue.h>
+#include <sys/_cpuset.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
@@ -134,7 +135,7 @@ struct pmap {
struct l1_ttable *pm_l1;
struct l2_dtable *pm_l2[L2_SIZE];
pd_entry_t *pm_pdir; /* KVA of page directory */
- cpumask_t pm_active; /* active on cpus */
+ cpuset_t pm_active; /* active on cpus */
struct pmap_statistics pm_stats; /* pmap statictics */
TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */
};
diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc
index 9893278..be6c3301 100644
--- a/sys/boot/common/Makefile.inc
+++ b/sys/boot/common/Makefile.inc
@@ -44,8 +44,15 @@ SRCS+= pnp.c
# Forth interpreter
.if defined(BOOT_FORTH)
SRCS+= interp_forth.c
+MAN+= ../forth/beastie.4th.8
+MAN+= ../forth/brand.4th.8
+MAN+= ../forth/check-password.4th.8
+MAN+= ../forth/color.4th.8
+MAN+= ../forth/delay.4th.8
MAN+= ../forth/loader.conf.5
MAN+= ../forth/loader.4th.8
+MAN+= ../forth/menu.4th.8
+MAN+= ../forth/version.4th.8
.endif
.if defined(BOOT_PROMPT_123)
diff --git a/sys/boot/common/load_elf_obj.c b/sys/boot/common/load_elf_obj.c
index dcd71ef..54d9b10 100644
--- a/sys/boot/common/load_elf_obj.c
+++ b/sys/boot/common/load_elf_obj.c
@@ -196,7 +196,7 @@ static int
__elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
{
Elf_Ehdr *hdr;
- Elf_Shdr *shdr;
+ Elf_Shdr *shdr, *cshdr, *lshdr;
vm_offset_t firstaddr, lastaddr;
int i, nsym, res, ret, shdrbytes, symstrindex;
@@ -294,12 +294,35 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
/* Clear the whole area, including bss regions. */
kern_bzero(firstaddr, lastaddr - firstaddr);
- /* Now read it all in. */
- for (i = 0; i < hdr->e_shnum; i++) {
- if (shdr[i].sh_addr == 0 || shdr[i].sh_type == SHT_NOBITS)
- continue;
- if (kern_pread(ef->fd, (vm_offset_t)shdr[i].sh_addr,
- shdr[i].sh_size, (off_t)shdr[i].sh_offset) != 0) {
+ /* Figure section with the lowest file offset we haven't loaded yet. */
+ for (cshdr = NULL; /* none */; /* none */)
+ {
+ /*
+ * Find next section to load. The complexity of this loop is
+ * O(n^2), but with the number of sections being typically
+ * small, we do not care.
+ */
+ lshdr = cshdr;
+
+ for (i = 0; i < hdr->e_shnum; i++) {
+ if (shdr[i].sh_addr == 0 ||
+ shdr[i].sh_type == SHT_NOBITS)
+ continue;
+ /* Skip sections that were loaded already. */
+ if (lshdr != NULL &&
+ lshdr->sh_offset >= shdr[i].sh_offset)
+ continue;
+ /* Find section with smallest offset. */
+ if (cshdr == lshdr ||
+ cshdr->sh_offset > shdr[i].sh_offset)
+ cshdr = &shdr[i];
+ }
+
+ if (cshdr == lshdr)
+ break;
+
+ if (kern_pread(ef->fd, (vm_offset_t)cshdr->sh_addr,
+ cshdr->sh_size, (off_t)cshdr->sh_offset) != 0) {
printf("\nelf" __XSTRING(__ELF_WORD_SIZE)
"_obj_loadimage: read failed\n");
goto out;
diff --git a/sys/boot/forth/beastie.4th b/sys/boot/forth/beastie.4th
index 1130ed0..75d6e02 100644
--- a/sys/boot/forth/beastie.4th
+++ b/sys/boot/forth/beastie.4th
@@ -1,7 +1,8 @@
\ Copyright (c) 2003 Scott Long <scottl@freebsd.org>
\ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com>
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@hotmail.com>
\ All rights reserved.
-\
+\
\ Redistribution and use in source and binary forms, with or without
\ modification, are permitted provided that the following conditions
\ are met:
@@ -10,7 +11,7 @@
\ 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 AUTHOR 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
@@ -22,35 +23,24 @@
\ 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.
-\
+\
\ $FreeBSD$
marker task-beastie.4th
-include /boot/screen.4th
-include /boot/frames.4th
+include /boot/color.4th
+include /boot/delay.4th
-hide
+variable logoX
+variable logoY
-variable menuidx
-variable menubllt
-variable menuX
-variable menuY
-variable promptwidth
+\ Initialize logo placement to defaults
+46 logoX !
+4 logoY !
-variable bootkey
-variable bootacpikey
-variable bootsafekey
-variable bootverbosekey
-variable bootsinglekey
-variable escapekey
-variable rebootkey
+: beastie-logo ( x y -- ) \ color BSD mascot (19 rows x 34 columns)
-46 constant dot
-
-\ The BSD Daemon. He is 19 rows high and 34 columns wide
-: beastie-logo ( x y -- )
-2dup at-xy ." , ," 1+
+2dup at-xy ." , ," 1+
2dup at-xy ." /( )`" 1+
2dup at-xy ." \ \___ / |" 1+
2dup at-xy ." /- _ `-/ '" 1+
@@ -59,7 +49,7 @@ variable rebootkey
2dup at-xy ." O O ) / |" 1+
2dup at-xy ." `-^--'`< '" 1+
2dup at-xy ." (_.) _ ) /" 1+
-2dup at-xy ." `.___/` / " 1+
+2dup at-xy ." `.___/` /" 1+
2dup at-xy ." `-----' /" 1+
2dup at-xy ." <----. __ / __ \" 1+
2dup at-xy ." <----|====O)))==) \) /====|" 1+
@@ -68,173 +58,201 @@ variable rebootkey
2dup at-xy ." \ / /\" 1+
2dup at-xy ." ______( (_ / \______/" 1+
2dup at-xy ." ,' ,-----' |" 1+
-at-xy ." `--{__________) "
+ at-xy ." `--{__________)"
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
;
-: beastiebw-logo ( x y -- )
- 2dup at-xy ." , ," 1+
- 2dup at-xy ." /( )`" 1+
- 2dup at-xy ." \ \___ / |" 1+
- 2dup at-xy ." /- _ `-/ '" 1+
- 2dup at-xy ." (/\/ \ \ /\" 1+
- 2dup at-xy ." / / | ` \" 1+
- 2dup at-xy ." O O ) / |" 1+
- 2dup at-xy ." `-^--'`< '" 1+
- 2dup at-xy ." (_.) _ ) /" 1+
- 2dup at-xy ." `.___/` /" 1+
- 2dup at-xy ." `-----' /" 1+
- 2dup at-xy ." <----. __ / __ \" 1+
- 2dup at-xy ." <----|====O)))==) \) /====" 1+
- 2dup at-xy ." <----' `--' `.__,' \" 1+
- 2dup at-xy ." | |" 1+
- 2dup at-xy ." \ / /\" 1+
- 2dup at-xy ." ______( (_ / \______/" 1+
- 2dup at-xy ." ,' ,-----' |" 1+
- at-xy ." `--{__________)"
+: beastiebw-logo ( x y -- ) \ B/W BSD mascot (19 rows x 34 columns)
+
+ 2dup at-xy ." , ," 1+
+ 2dup at-xy ." /( )`" 1+
+ 2dup at-xy ." \ \___ / |" 1+
+ 2dup at-xy ." /- _ `-/ '" 1+
+ 2dup at-xy ." (/\/ \ \ /\" 1+
+ 2dup at-xy ." / / | ` \" 1+
+ 2dup at-xy ." O O ) / |" 1+
+ 2dup at-xy ." `-^--'`< '" 1+
+ 2dup at-xy ." (_.) _ ) /" 1+
+ 2dup at-xy ." `.___/` /" 1+
+ 2dup at-xy ." `-----' /" 1+
+ 2dup at-xy ." <----. __ / __ \" 1+
+ 2dup at-xy ." <----|====O)))==) \) /====|" 1+
+ 2dup at-xy ." <----' `--' `.__,' \" 1+
+ 2dup at-xy ." | |" 1+
+ 2dup at-xy ." \ / /\" 1+
+ 2dup at-xy ." ______( (_ / \______/" 1+
+ 2dup at-xy ." ,' ,-----' |" 1+
+ at-xy ." `--{__________)"
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
;
-: fbsdbw-logo ( x y -- )
- 2dup at-xy ." ______" 1+
- 2dup at-xy ." | ____| __ ___ ___ " 1+
- 2dup at-xy ." | |__ | '__/ _ \/ _ \" 1+
- 2dup at-xy ." | __|| | | __/ __/" 1+
- 2dup at-xy ." | | | | | | |" 1+
- 2dup at-xy ." |_| |_| \___|\___|" 1+
- 2dup at-xy ." ____ _____ _____" 1+
- 2dup at-xy ." | _ \ / ____| __ \" 1+
- 2dup at-xy ." | |_) | (___ | | | |" 1+
- 2dup at-xy ." | _ < \___ \| | | |" 1+
- 2dup at-xy ." | |_) |____) | |__| |" 1+
- 2dup at-xy ." | | | |" 1+
- at-xy ." |____/|_____/|_____/"
+: fbsdbw-logo ( x y -- ) \ "FreeBSD" logo in B/W (13 rows x 21 columns)
+
+ \ We used to use the beastie himself as our default... until the
+ \ eventual complaint derided his reign of the advanced boot-menu.
+ \
+ \ This is the replacement of beastie to satiate the haters of our
+ \ beloved helper-daemon (ready to track down and spear bugs with
+ \ his trident and sporty sneakers; see above).
+ \
+ \ Since we merely just changed the default and not the default-
+ \ location, below is an adjustment to the passed-in coordinates,
+ \ forever influenced by the proper location of beastie himself
+ \ kept as the default loader_logo_x/loader_logo_y values.
+ \
+ 5 + swap 6 + swap
+
+ 2dup at-xy ." ______" 1+
+ 2dup at-xy ." | ____| __ ___ ___ " 1+
+ 2dup at-xy ." | |__ | '__/ _ \/ _ \" 1+
+ 2dup at-xy ." | __|| | | __/ __/" 1+
+ 2dup at-xy ." | | | | | | |" 1+
+ 2dup at-xy ." |_| |_| \___|\___|" 1+
+ 2dup at-xy ." ____ _____ _____" 1+
+ 2dup at-xy ." | _ \ / ____| __ \" 1+
+ 2dup at-xy ." | |_) | (___ | | | |" 1+
+ 2dup at-xy ." | _ < \___ \| | | |" 1+
+ 2dup at-xy ." | |_) |____) | |__| |" 1+
+ 2dup at-xy ." | | | |" 1+
+ at-xy ." |____/|_____/|_____/"
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
;
-: print-logo ( x y -- )
- s" loader_logo" getenv
- dup -1 = if
- drop
- fbsdbw-logo
- exit
- then
- 2dup s" fbsdbw" compare-insensitive 0= if
- 2drop
- fbsdbw-logo
- exit
- then
- 2dup s" beastiebw" compare-insensitive 0= if
- 2drop
- beastiebw-logo
- exit
- then
- 2dup s" beastie" compare-insensitive 0= if
- 2drop
- beastie-logo
- exit
- then
- 2dup s" none" compare-insensitive 0= if
- 2drop
- \ no logo
- exit
- then
- 2drop
- fbsdbw-logo
+: orb-logo ( x y -- ) \ color Orb mascot (15 rows x 30 columns)
+
+ 3 + \ beastie adjustment (see `fbsdbw-logo' comments above)
+
+ 2dup at-xy ." ``` `" 1+
+ 2dup at-xy ." s` `.....---.......--.``` -/" 1+
+ 2dup at-xy ." +o .--` /y:` +." 1+
+ 2dup at-xy ." yo`:. :o `+-" 1+
+ 2dup at-xy ." y/ -/` -o/" 1+
+ 2dup at-xy ." .- ::/sy+:." 1+
+ 2dup at-xy ." / `-- /" 1+
+ 2dup at-xy ." `: :`" 1+
+ 2dup at-xy ." `: :`" 1+
+ 2dup at-xy ." / /" 1+
+ 2dup at-xy ." .- -." 1+
+ 2dup at-xy ." -- -." 1+
+ 2dup at-xy ." `:` `:`" 1+
+ 2dup at-xy ." .-- `--." 1+
+ at-xy ." .---.....----."
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
;
-: acpipresent? ( -- flag )
- s" hint.acpi.0.rsdp" getenv
- dup -1 = if
- drop false exit
- then
- 2drop
- true
+: orbbw-logo ( x y -- ) \ B/W Orb mascot (15 rows x 32 columns)
+
+ 3 + \ beastie adjustment (see `fbsdbw-logo' comments above)
+
+ 2dup at-xy ." ``` `" 1+
+ 2dup at-xy ." s` `.....---.......--.``` -/" 1+
+ 2dup at-xy ." +o .--` /y:` +." 1+
+ 2dup at-xy ." yo`:. :o `+-" 1+
+ 2dup at-xy ." y/ -/` -o/" 1+
+ 2dup at-xy ." .- ::/sy+:." 1+
+ 2dup at-xy ." / `-- /" 1+
+ 2dup at-xy ." `: :`" 1+
+ 2dup at-xy ." `: :`" 1+
+ 2dup at-xy ." / /" 1+
+ 2dup at-xy ." .- -." 1+
+ 2dup at-xy ." -- -." 1+
+ 2dup at-xy ." `:` `:`" 1+
+ 2dup at-xy ." .-- `--." 1+
+ at-xy ." .---.....----."
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
;
-: acpienabled? ( -- flag )
- s" hint.acpi.0.disabled" getenv
- dup -1 <> if
- s" 0" compare 0<> if
- false exit
- then
+\ This function draws any number of beastie logos at (loader_logo_x,
+\ loader_logo_y) if defined, else (46,4) (to the right of the menu). To choose
+\ your beastie, set the variable `loader_logo' to the respective logo name.
+\
+\ Currently available:
+\
+\ NAME DESCRIPTION
+\ beastie Color ``Helper Daemon'' mascot (19 rows x 34 columns)
+\ beastiebw B/W ``Helper Daemon'' mascot (19 rows x 34 columns)
+\ fbsdbw "FreeBSD" logo in B/W (13 rows x 21 columns)
+\ orb Color ``Orb'' mascot (15 rows x 30 columns)
+\ orbbw B/W ``Orb'' mascot (15 rows x 32 columns) (default)
+\
+\ NOTE: Setting `loader_logo' to an undefined value (such as "none") will
+\ prevent beastie from being drawn.
+\
+: draw-beastie ( -- ) \ at (loader_logo_x,loader_logo_y), else (46,4)
+
+ s" loader_logo_x" getenv dup -1 <> if
+ ?number 1 = if logoX ! then
else
drop
then
- true
-;
-
-: printmenuitem ( -- n )
- menuidx @
- 1+ dup
- menuidx !
- menuY @ + dup menuX @ swap at-xy
- menuidx @ .
- menuX @ 1+ swap at-xy
- menubllt @ emit
- menuidx @ 48 +
-;
-
-: beastie-menu ( -- )
- 0 menuidx !
- dot menubllt !
- 8 menuY !
- 5 menuX !
- clear
- 46 4 print-logo
- 42 20 2 2 box
- 13 6 at-xy ." Welcome to FreeBSD!"
- printmenuitem ." Boot FreeBSD [default]" bootkey !
- s" arch-i386" environment? if
+ s" loader_logo_y" getenv dup -1 <> if
+ ?number 1 = if logoY ! then
+ else
drop
- acpipresent? if
- printmenuitem ." Boot FreeBSD with ACPI " bootacpikey !
- acpienabled? if
- ." disabled"
- else
- ." enabled"
- then
+ then
+
+ s" loader_logo" getenv dup -1 = if
+ logoX @ logoY @
+ loader_color? if
+ orb-logo
else
- menuidx @
- 1+
- menuidx !
- -2 bootacpikey !
+ orbbw-logo
then
- else
- -2 bootacpikey !
+ drop exit
then
- printmenuitem ." Boot FreeBSD in Safe Mode" bootsafekey !
- printmenuitem ." Boot FreeBSD in single user mode" bootsinglekey !
- printmenuitem ." Boot FreeBSD with verbose logging" bootverbosekey !
- printmenuitem ." Escape to loader prompt" escapekey !
- printmenuitem ." Reboot" rebootkey !
- menuX @ 20 at-xy
- ." Select option, [Enter] for default"
- menuX @ 21 at-xy
- s" or [Space] to pause timer " dup 2 - promptwidth !
- type
-;
-: tkey
- seconds +
- begin 1 while
- over 0<> if
- dup seconds u< if
- drop
- -1
- exit
- then
- menuX @ promptwidth @ + 21 at-xy dup seconds - .
- then
- key? if
- drop
- key
- exit
- then
- 50 ms
- repeat
+ 2dup s" beastie" compare-insensitive 0= if
+ logoX @ logoY @ beastie-logo
+ 2drop exit
+ then
+ 2dup s" beastiebw" compare-insensitive 0= if
+ logoX @ logoY @ beastiebw-logo
+ 2drop exit
+ then
+ 2dup s" fbsdbw" compare-insensitive 0= if
+ logoX @ logoY @ fbsdbw-logo
+ 2drop exit
+ then
+ 2dup s" orb" compare-insensitive 0= if
+ logoX @ logoY @ orb-logo
+ 2drop exit
+ then
+ 2dup s" orbbw" compare-insensitive 0= if
+ logoX @ logoY @ orbbw-logo
+ 2drop exit
+ then
+
+ 2drop
;
-set-current
+: clear-beastie ( -- ) \ clears beastie from the screen
+ logoX @ logoY @
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 1+ 2dup at-xy 34 spaces 1+
+ 2dup at-xy 34 spaces 2drop
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
+;
-: beastie-start
+: beastie-start ( -- ) \ starts the menu
s" beastie_disable" getenv
dup -1 <> if
s" YES" compare-insensitive 0= if
@@ -243,62 +261,15 @@ set-current
else
drop
then
- beastie-menu
- s" autoboot_delay" getenv
- dup -1 = if
- drop
- 10
+
+ s" loader_delay" getenv
+ -1 = if
+ s" include /boot/menu.rc" evaluate
else
- 2dup s" -1" compare 0= if
- 0 boot
- then
- 0 s>d 2swap >number 2drop drop
+ drop
+ ." Loading Menu (Ctrl-C to Abort)" cr
+ s" set delay_command='include /boot/menu.rc'" evaluate
+ s" set delay_showdots" evaluate
+ delay_execute
then
- begin
- dup tkey
- 0 25 at-xy
- dup 32 = if nip 0 swap then
- dup -1 = if 0 boot then
- dup 13 = if 0 boot then
- dup bootkey @ = if 0 boot then
- dup bootacpikey @ = if
- acpienabled? if
- s" 1" s" hint.acpi.0.disabled" setenv
- s" 1" s" loader.acpi_disabled_by_user" setenv
- else
- s" 0" s" hint.acpi.0.disabled" setenv
- then
- 0 boot
- then
- dup bootsafekey @ = if
- s" arch-i386" environment? if
- drop
- s" 1" s" hint.acpi.0.disabled" setenv
- s" 1" s" loader.acpi_disabled_by_user" setenv
- s" 1" s" hint.apic.0.disabled" setenv
- then
- s" 0" s" hw.ata.ata_dma" setenv
- s" 0" s" hw.ata.atapi_dma" setenv
- s" 0" s" hw.ata.wc" setenv
- s" 0" s" hw.eisa_slots" setenv
- s" 1" s" hint.kbdmux.0.disabled" setenv
- 0 boot
- then
- dup bootverbosekey @ = if
- s" YES" s" boot_verbose" setenv
- 0 boot
- then
- dup bootsinglekey @ = if
- s" YES" s" boot_single" setenv
- 0 boot
- then
- dup escapekey @ = if
- 2drop
- s" NO" s" autoboot_delay" setenv
- exit
- then
- rebootkey @ = if 0 reboot then
- again
;
-
-previous
diff --git a/sys/boot/forth/beastie.4th.8 b/sys/boot/forth/beastie.4th.8
new file mode 100644
index 0000000..5108769
--- /dev/null
+++ b/sys/boot/forth/beastie.4th.8
@@ -0,0 +1,171 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 16, 2011
+.Dt BEASTIE.4TH 8
+.Os
+.Sh NAME
+.Nm beastie.4th
+.Nd FreeBSD ASCII art boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to draw the ASCII art FreeBSD mascot
+.Nd known simply as
+.Ic beastie
+.Nd to the right of the boot loader menu.
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include beastie.4th
+.Pp
+This line is present in the default
+.Pa /boot/loader.rc
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic draw-beastie
+Draws the FreeBSD logo.
+.Pp
+The logo that is drawn is configured by setting the
+.Ic loader_logo
+variable in
+.Xr loader.conf 5
+to one of
+.Dq Li beastie ,
+.Dq Li beastiebw ,
+.Dq Li fbsdbw ,
+.Dq Li orb ,
+and
+.Dq Li orbbw
+(the default).
+.Pp
+The position of the logo can be configured by setting the
+.Ic loader_logo_x
+and
+.Ic loader_logo_y
+variables in
+.Xr loader.conf 5 .
+The default values are 46 (x) and 4 (y).
+.Pp
+.It Ic clear-beastie
+Clears the screen of beastie.
+.Pp
+.It Ic beastie-start
+Initializes the interactive boot loader menu.
+.Pp
+The
+.Ic loader_delay
+variable can be configured in
+.Xr loader.conf 5
+to the number of seconds you would like to delay loading the boot menu.
+During the delay the user can press Ctrl-C to fall back to autoboot or ENTER
+to proceed.
+The default behavior is to not delay.
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va loader_logo
+Selects the desired logo in the beastie boot menu. Possible values are:
+.Dq Li fbsdbw ,
+.Dq Li beastie ,
+.Dq Li beastiebw ,
+.Dq Li orb ,
+.Dq Li orbbw
+(default), and
+.Dq Li none .
+.It Va loader_logo_x
+Sets the desired column position of the logo. Default is 46.
+.It Va loader_logo_y
+Sets the desired row position of the logo. Default is 4.
+.It Va beastie_disable
+If set to
+.Dq YES ,
+the beastie boot menu will be skipped.
+.It Va loader_delay
+If set to a number higher than zero, introduces a delay before starting the
+beastie boot menu. During the delay the user can press either Ctrl-C to skip
+the menu or ENTER to proceed to the menu. The default is to not delay when
+loading the menu.
+.El
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/beastie.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+Standard i386
+.Pa /boot/loader.rc :
+.Pp
+.Bd -literal -offset indent -compact
+include /boot/beastie.4th
+beastie-start
+.Ed
+.Pp
+Set a different logo in
+.Xr loader.conf 5 :
+.Pp
+.Bd -literal -offset indent -compact
+loader_logo="beastie"
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Xr loader.4th 8
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 5.1 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Scott Long Aq scottl@FreeBSD.org ,
+.An Aleksander Fafula Aq alex@fafula.com
+and
+.An Devin Teske Aq devinteske@hotmail.com .
diff --git a/sys/boot/forth/brand.4th b/sys/boot/forth/brand.4th
new file mode 100644
index 0000000..bc64174
--- /dev/null
+++ b/sys/boot/forth/brand.4th
@@ -0,0 +1,91 @@
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@hotmail.com>
+\ All rights reserved.
+\
+\ 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 AUTHOR 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 AUTHOR 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.
+\
+\ $FreeBSD$
+
+marker task-brand.4th
+
+variable brandX
+variable brandY
+
+\ Initialize logo placement
+2 brandX !
+1 brandY !
+
+: fbsd-logo ( x y -- ) \ "FreeBSD" [wide] logo in B/W (7 rows x 42 columns)
+
+ 2dup at-xy ." ______ ____ _____ _____ " 1+
+ 2dup at-xy ." | ____| | _ \ / ____| __ \ " 1+
+ 2dup at-xy ." | |___ _ __ ___ ___ | |_) | (___ | | | |" 1+
+ 2dup at-xy ." | ___| '__/ _ \/ _ \| _ < \___ \| | | |" 1+
+ 2dup at-xy ." | | | | | __/ __/| |_) |____) | |__| |" 1+
+ 2dup at-xy ." | | | | | | || | | |" 1+
+ at-xy ." |_| |_| \___|\___||____/|_____/|_____/ "
+
+ \ Put the cursor back at the bottom
+ 0 25 at-xy
+;
+
+\ This function draws any number of company logos at (loader_brand_x,
+\ loader_brand_y) if defined, or (2,1) (top-left) if not defined. To choose
+\ your logo, set the variable `loader_brand' to the respective logo name.
+\
+\ Currently available:
+\
+\ NAME DESCRIPTION
+\ fbsd FreeBSD logo
+\
+\ NOTE: Setting `loader_brand' to an undefined value (such as "none") will
+\ prevent any brand from being drawn.
+\
+: draw-brand ( -- )
+
+ s" loader_brand_x" getenv dup -1 <> if
+ ?number 1 = if
+ brandX !
+ then
+ else
+ drop
+ then
+
+ s" loader_brand_y" getenv dup -1 <> if
+ ?number 1 = if
+ brandY !
+ then
+ else
+ drop
+ then
+
+ s" loader_brand" getenv dup -1 = if
+ brandX @ brandY @ fbsd-logo
+ drop exit
+ then
+
+ 2dup s" fbsd" compare-insensitive 0= if
+ brandX @ brandY @ fbsd-logo
+ 2drop exit
+ then
+
+ 2drop
+;
diff --git a/sys/boot/forth/brand.4th.8 b/sys/boot/forth/brand.4th.8
new file mode 100644
index 0000000..1a1cc84
--- /dev/null
+++ b/sys/boot/forth/brand.4th.8
@@ -0,0 +1,125 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 18, 2011
+.Dt BRAND.4TH 8
+.Os
+.Sh NAME
+.Nm brand.4th
+.Nd FreeBSD ASCII art boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to draw the ASCII art BSD brand above the boot
+loader menu.
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include brand.4th
+.Pp
+This line is present in the default
+.Pa /boot/menu.rc
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic draw-brand
+Draws the BSD brand.
+.Pp
+The brand that is drawn is configured by setting the
+.Ic loader_brand
+variable in
+.Xr loader.conf 5
+to one of
+.Dq Li fbsd
+(the default) or
+.Dq Li none .
+.Pp
+The position of the logo can be configured by setting the
+.Ic loader_brand_x
+and
+.Ic loader_brand_y
+variables in
+.Xr loader.conf 5 .
+The default values are 2 (x) and 1 (y).
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va loader_brand
+Selects the desired brand in the beastie boot menu. Possible values are:
+.Dq Li fbsd
+(default) or
+.Dq Li none .
+.It Va loader_brand_x
+Sets the desired column position of the brand. Default is 2.
+.It Va loader_brand_y
+Sets the desired row position of the brand. Default is 1.
+.El
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/brand.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+Set FreeBSD brand in
+.Xr loader.conf 5 :
+.Pp
+.Bd -literal -offset indent -compact
+loader_brand="fbsd"
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Devin Teske Aq devinteske@hotmail.com .
diff --git a/sys/boot/forth/check-password.4th b/sys/boot/forth/check-password.4th
new file mode 100644
index 0000000..0a1fa5d
--- /dev/null
+++ b/sys/boot/forth/check-password.4th
@@ -0,0 +1,156 @@
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@hotmail.com>
+\ All rights reserved.
+\
+\ 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 AUTHOR 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 AUTHOR 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.
+\
+\ $FreeBSD$
+
+marker task-check-password.4th
+
+include /boot/screen.4th
+
+13 constant enter_key \ The decimal ASCII value for Enter key
+8 constant bs_key \ The decimal ASCII value for Backspace key
+16 constant readmax \ Maximum number of characters for the password
+
+variable readX \ Current X offset (column)(used by read)
+variable read-start \ Starting X offset (column)(used by read)
+
+create readval 16 allot \ input obtained (maximum 16 characters)
+variable readlen \ input length
+
+\ This function blocks program flow (loops forever) until a key is pressed.
+\ The key that was pressed is added to the top of the stack in the form of its
+\ decimal ASCII representation. Note: the stack cannot be empty when this
+\ function starts or an underflow exception will occur. Simplest way to prevent
+\ this is to pass 0 as a stack parameter (ie. `0 sgetkey'). This function is
+\ called by the read function. You need not call it directly. NOTE: arrow keys
+\ show as 0 on the stack
+\
+: sgetkey ( -- )
+
+ begin \ Loop forever
+ key? if \ Was a key pressed? (see loader(8))
+
+ drop \ Remove stack-cruft
+ key \ Get the key that was pressed
+
+ \ Check key pressed (see loader(8)) and input limit
+ dup 0<> if ( and ) readlen @ readmax < if
+
+ \ Echo an asterisk (unless Backspace/Enter)
+ dup bs_key <> if ( and ) dup enter_key <> if
+ ." *" \ Echo an asterisk
+ then then
+
+ exit \ Exit from the function
+ then then
+
+ \ Always allow Backspace and Enter
+ dup bs_key = if exit then
+ dup enter_key = if exit then
+
+ then
+ 50 ms \ Sleep for 50 milliseconds (see loader(8))
+ again
+;
+
+: read ( -- String prompt )
+
+ 0 25 at-xy \ Move the cursor to the bottom-left
+ dup 1+ read-start ! \ Store X offset after the prompt
+ read-start @ readX ! \ copy value to the current X offset
+ 0 readlen ! \ Initialize the read length
+ type \ Print the prompt
+
+ begin \ Loop forever
+
+ 0 sgetkey \ Block here, waiting for a key to be pressed
+
+ \ We are not going to echo the password to the screen (for
+ \ security reasons). If Enter is pressed, we process the
+ \ password, otherwise augment the key to a string.
+
+ \ If the key that was entered was not Enter, advance
+ dup enter_key <> if
+ readX @ 1+ readX ! \ Advance the column
+ readlen @ 1+ readlen ! \ Increment input length
+ then
+
+ \ Handle backspacing
+ dup bs_key = if
+ readX @ 2 - readX ! \ Set new cursor position
+ readlen @ 2 - readlen ! \ Decrement input length
+
+ \ Don't move behind starting position
+ readX @ read-start @ < if
+ read-start @ readX !
+ then
+ readlen @ 0< if
+ 0 readlen !
+ then
+
+ \ Reposition cursor and erase character
+ readX @ 25 at-xy 1 spaces readX @ 25 at-xy
+ then
+
+ dup enter_key = if
+ drop \ Clean up stack cruft
+ 10 emit \ Echo new line
+ exit
+ then
+
+ \ If not Backspace or Enter, store the character
+ dup bs_key <> if ( and ) dup enter_key <> if
+
+ \ store the character in our buffer
+ dup readval readlen @ 1- + c!
+
+ then then
+
+ drop \ drop the last key that was entered
+
+ again \ Enter was not pressed; repeat
+;
+
+: check-password ( -- )
+
+ \ Exit if a password was not set
+ s" password" getenv dup -1 = if
+ drop exit
+ then
+
+ begin \ Loop as long as it takes to get the right password
+
+ s" Password: " \ Output a prompt for a password
+ read \ Read the user's input until Enter
+
+ 2dup readval readlen @ compare 0= if
+ 2drop exit \ Correct password
+ then
+
+ \ Bad Password
+ 3000 ms
+ ." loader: incorrect password" 10 emit
+
+ again \ Not the right password; repeat
+;
diff --git a/sys/boot/forth/check-password.4th.8 b/sys/boot/forth/check-password.4th.8
new file mode 100644
index 0000000..ec2323e
--- /dev/null
+++ b/sys/boot/forth/check-password.4th.8
@@ -0,0 +1,123 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 18, 2011
+.Dt CHECK-PASSWORD.4TH 8
+.Os
+.Sh NAME
+.Nm check-password.4th
+.Nd FreeBSD password-checking boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to prevent booting without the proper password.
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include check-password.4th
+.Pp
+This line is present in
+.Pa /boot/loader.4th
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic check-password
+Once called, the user cannot continue until the correct password is entered.
+If the user enters the correct password the function returns.
+.Pp
+The password that is required is configured by setting the
+.Ic password
+variable in
+.Xr loader.conf 5 .
+.Pp
+Subsequent calls after a successful password
+has been entered will not cause reprompting
+\(em the function will silently return.
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va password
+Sets the password (up to 16 characters long) that is required by
+.Ic check-password
+to be entered before the system is allowed to boot. If unset (default) or NULL,
+.Ic check-password
+will silently abort.
+.El
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/check-password.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+Standard i386
+.Pa /boot/loader.rc :
+.Pp
+.Bd -literal -offset indent -compact
+include /boot/loader.4th
+check-password
+.Ed
+.Pp
+Set a password in
+.Xr loader.conf 5 :
+.Pp
+.Bd -literal -offset indent -compact
+password="abc123"
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Xr loader.4th 8
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Devin Teske Aq devinteske@hotmail.com .
diff --git a/sys/boot/forth/color.4th b/sys/boot/forth/color.4th
new file mode 100644
index 0000000..4d43593
--- /dev/null
+++ b/sys/boot/forth/color.4th
@@ -0,0 +1,48 @@
+\ Copyright (c) 2011 Devin Teske <devinteske@hotmail.com>
+\ All rights reserved.
+\
+\ 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 AUTHOR 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 AUTHOR 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.
+\
+\ $FreeBSD$
+
+marker task-color.4th
+
+\ This function returns TRUE if the `loader_color' environment variable is set
+\ to YES, yes, or 1. Otherwise, FALSE is returned.
+\
+: loader_color? ( -- N )
+
+ s" loader_color" getenv dup -1 <> if
+
+ 2dup s" YES" compare-insensitive 0= if
+ 2drop
+ TRUE exit
+ then
+ 2dup s" 1" compare 0= if
+ 2drop
+ TRUE exit
+ then
+ drop
+ then
+
+ drop FALSE exit
+;
diff --git a/sys/boot/forth/color.4th.8 b/sys/boot/forth/color.4th.8
new file mode 100644
index 0000000..5a734dd
--- /dev/null
+++ b/sys/boot/forth/color.4th.8
@@ -0,0 +1,117 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 18, 2011
+.Dt COLOR.4TH 8
+.Os
+.Sh NAME
+.Nm color.4th
+.Nd FreeBSD color-detection boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to simplify color logic.
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include color.4th
+.Pp
+This line is present in
+.Pa /boot/beastie.4th
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic loader_color?
+Returns TRUE if the
+.Ic loader_color
+environment variable is set to
+.Dq YES
+(case-insensitive) or
+.Dq 1 .
+Otherwise returns FALSE.
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va loader_color
+If set to
+.Dq YES
+(case-insensitive) or
+.Dq 1 ,
+causes
+.Ic loader_color?
+to return TRUE, indicating to many other modules that color should be used
+whenever/wherever possible.
+.El
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/color.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+Standard i386
+.Pa /boot/loader.rc :
+.Pp
+Use color where applicable:
+.Pp
+.Bd -literal -offset indent -compact
+loader_color="YES"
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Xr beastie.4th 8 ,
+.Xr loader.4th 8
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Devin Teske Aq devinteske@hotmail.com .
diff --git a/sys/boot/forth/delay.4th b/sys/boot/forth/delay.4th
new file mode 100644
index 0000000..3068e65
--- /dev/null
+++ b/sys/boot/forth/delay.4th
@@ -0,0 +1,112 @@
+\ Copyright (c) 2008-2011 Devin Teske <devinteske@hotmail.com>
+\ All rights reserved.
+\
+\ 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 AUTHOR 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 AUTHOR 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.
+\
+\ $FreeBSD$
+
+marker task-delay.4th
+
+2 constant delay_default \ Default delay (in seconds)
+3 constant etx_key \ End-of-Text character produced by Ctrl+C
+13 constant enter_key \ Carriage-Return character produce by ENTER
+27 constant esc_key \ Escape character produced by ESC or Ctrl+[
+
+variable delay_tstart \ state variable used for delay timing
+variable delay_delay \ determined configurable delay duration
+variable delay_cancelled \ state variable for user cancellation
+variable delay_showdots \ whether continually print dots while waiting
+
+: delay_execute ( -- )
+
+ \ make sure that we have a command to execute
+ s" delay_command" getenv dup -1 = if
+ drop exit
+ then
+
+ \ read custom time-duration (if set)
+ s" loader_delay" getenv dup -1 = if
+ drop \ no custom duration (remove dup'd bunk -1)
+ delay_default \ use default setting (replacing bunk -1)
+ else
+ \ make sure custom duration is a number
+ ?number 0= if
+ delay_default \ use default if otherwise
+ then
+ then
+
+ \ initialize state variables
+ delay_delay ! \ stored value is on the stack from above
+ seconds delay_tstart ! \ store the time we started
+ 0 delay_cancelled ! \ boolean flag indicating user-cancelled event
+
+ false delay_showdots ! \ reset to zero and read from environment
+ s" delay_showdots" getenv dup -1 <> if
+ 2drop \ don't need the value, just existance
+ true delay_showdots !
+ else
+ drop
+ then
+
+ \ Loop until we have exceeded the desired time duration
+ begin
+ 25 ms \ sleep for 25 milliseconds (40 iterations/sec)
+
+ \ throw some dots up on the screen if desired
+ delay_showdots @ if
+ ." ." \ dots visually aid in the perception of time
+ then
+
+ \ was a key depressed?
+ key? if
+ key \ obtain ASCII value for keystroke
+ dup enter_key = if
+ -1 delay_delay ! \ break loop
+ then
+ dup etx_key = swap esc_key = OR if
+ -1 delay_delay ! \ break loop
+ -1 delay_cancelled ! \ set cancelled flag
+ then
+ then
+
+ \ if the time duration is set to zero, loop forever
+ \ waiting for either ENTER or Ctrl-C/Escape to be pressed
+ delay_delay @ 0> if
+ \ calculate elapsed time
+ seconds delay_tstart @ - delay_delay @ >
+ else
+ -1 \ break loop
+ then
+ until
+
+ \ if we were throwing up dots, throw up a line-break
+ delay_showdots @ if
+ cr
+ then
+
+ \ did the user press either Ctrl-C or Escape?
+ delay_cancelled @ if
+ 2drop \ we don't need the command string anymore
+ else
+ evaluate \ evaluate/execute the command string
+ then
+;
diff --git a/sys/boot/forth/delay.4th.8 b/sys/boot/forth/delay.4th.8
new file mode 100644
index 0000000..3fe5b5b
--- /dev/null
+++ b/sys/boot/forth/delay.4th.8
@@ -0,0 +1,126 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 18, 2011
+.Dt DELAY.4TH 8
+.Os
+.Sh NAME
+.Nm delay.4th
+.Nd FreeBSD debugging boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to add debugging capabilities to
+.Xr loader 8 .
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include delay.4th
+.Pp
+This line is present in
+.Pa /boot/beastie.4th
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic delay_execute
+Executes the [string] procedure stored in the
+.Ic delay_command
+environment variable after
+.Ic loader_delay
+seconds.
+.Pp
+If the optional
+.Ic delay_showdots
+environment variable is set, a continuous series of dots is printed.
+.Pp
+During the duration, the user can either press Ctrl-C (or Esc) to abort or
+ENTER to proceed immediately.
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va delay_command
+The command to be executed by
+.Ic delay_execute .
+.It Va loader_delay
+The duration (in seconds) to delay before executing
+.Ic delay_command .
+.It Va delay_showdots
+If set, will cause
+.Ic delay_execute
+to print a continuous series of dots during the delay duration.
+.El
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/delay.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+Introducing a 5-second delay before including another file from
+.Pa /boot/loader.rc :
+.Pp
+.Bd -literal -offset indent -compact
+include /boot/delay.4th
+set delay_command="include /boot/other.4th"
+set delay_showdots
+set loader_delay=5
+delay_execute
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Xr beastie.4th 8 ,
+.Xr loader.4th 8
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Devin Teske Aq devinteske@hotmail.com .
diff --git a/sys/boot/forth/loader.4th b/sys/boot/forth/loader.4th
index 7b22b6d..c765147 100644
--- a/sys/boot/forth/loader.4th
+++ b/sys/boot/forth/loader.4th
@@ -89,30 +89,7 @@ builtin: boot-conf
only forth definitions also support-functions
-\ ***** check-password
-\
-\ If a password was defined, execute autoboot and ask for
-\ password if autoboot returns.
-\ Do not exit unless the right password is given.
-
-: check-password
- password .addr @ if
- 0 autoboot
- false >r
- begin
- bell emit bell emit
- ." Password: "
- password .len @ read-password
- dup password .len @ = if
- 2dup password .addr @ password .len @
- compare 0= if r> drop true >r then
- then
- drop free drop
- r@
- until
- r> drop
- then
-;
+include /boot/check-password.4th
\ ***** start
\
diff --git a/sys/boot/forth/loader.conf.5 b/sys/boot/forth/loader.conf.5
index 6abb7ea..c8c61c6 100644
--- a/sys/boot/forth/loader.conf.5
+++ b/sys/boot/forth/loader.conf.5
@@ -215,14 +215,20 @@ be displayed.
If set to
.Dq YES ,
the beastie boot menu will be skipped.
-.It Va loader_logo Pq Dq Li fbsdbw
+.It Va loader_logo Pq Dq Li orbbw
Selects a desired logo in the beastie boot menu.
Possible values are:
+.Dq Li orbbw ,
+.Dq Li orb ,
.Dq Li fbsdbw ,
.Dq Li beastiebw ,
.Dq Li beastie ,
and
.Dq Li none .
+.It Va loader_color
+If set to
+.Dq YES ,
+the beastie boot menu will be displayed using ANSI coloring where possible.
.El
.Sh FILES
.Bl -tag -width /boot/defaults/loader.conf -compact
diff --git a/sys/boot/forth/menu-commands.4th b/sys/boot/forth/menu-commands.4th
new file mode 100644
index 0000000..828a148
--- /dev/null
+++ b/sys/boot/forth/menu-commands.4th
@@ -0,0 +1,190 @@
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@hotmail.com>
+\ All rights reserved.
+\
+\ 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 AUTHOR 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 AUTHOR 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.
+\
+\ $FreeBSD$
+
+marker task-menu-commands.4th
+
+: acpi_enable ( -- )
+ s" set acpi_load=YES" evaluate \ XXX deprecated but harmless
+ s" set hint.acpi.0.disabled=0" evaluate
+ s" loader.acpi_disabled_by_user" unsetenv
+;
+
+: acpi_disable ( -- )
+ s" acpi_load" unsetenv \ XXX deprecated but harmless
+ s" set hint.acpi.0.disabled=1" evaluate
+ s" set loader.acpi_disabled_by_user=1" evaluate
+;
+
+: toggle_acpi ( N -- N TRUE )
+
+ \ Make changes effective _before_ calling menu-redraw
+
+ acpienabled? if
+ acpi_disable
+ else
+ acpi_enable
+ then
+
+ menu-redraw
+
+ TRUE \ loop menu again
+;
+
+: toggle_safemode ( N -- N TRUE )
+ toggle_menuitem
+
+ \ Now we're going to make the change effective
+
+ s" toggle_stateN @" \ base name of toggle state var
+ -rot 2dup 12 + c! rot \ replace 'N' with ASCII numeral
+
+ evaluate 0= if
+ s" hint.apic.0.disabled" unsetenv
+ s" hw.ata.ata_dma" unsetenv
+ s" hw.ata.atapi_dma" unsetenv
+ s" hw.ata.wc" unsetenv
+ s" hw.eisa_slots" unsetenv
+ s" hint.kbdmux.0.disabled" unsetenv
+ else
+ \
+ \ Toggle ACPI elements if necessary
+ \
+ acpipresent? if acpienabled? if
+ menuacpi @ dup 0<> if
+ toggle_menuitem ( N -- N )
+ then
+ drop
+ acpi_disable
+ then then
+
+ s" set hint.apic.0.disabled=1" evaluate
+ s" set hw.ata.ata_dma=0" evaluate
+ s" set hw.ata.atapi_dma=0" evaluate
+ s" set hw.ata.wc=0" evaluate
+ s" set hw.eisa_slots=0" evaluate
+ s" set hint.kbdmux.0.disabled=1" evaluate
+ then
+
+ menu-redraw
+
+ TRUE \ loop menu again
+;
+
+: toggle_singleuser ( N -- N TRUE )
+ toggle_menuitem
+ menu-redraw
+
+ \ Now we're going to make the change effective
+
+ s" toggle_stateN @" \ base name of toggle state var
+ -rot 2dup 12 + c! rot \ replace 'N' with ASCII numeral
+
+ evaluate 0= if
+ s" boot_single" unsetenv
+ else
+ s" set boot_single=YES" evaluate
+ then
+
+ TRUE \ loop menu again
+;
+
+: toggle_verbose ( N -- N TRUE )
+ toggle_menuitem
+ menu-redraw
+
+ \ Now we're going to make the change effective
+
+ s" toggle_stateN @" \ base name of toggle state var
+ -rot 2dup 12 + c! rot \ replace 'N' with ASCII numeral
+
+ evaluate 0= if
+ s" boot_verbose" unsetenv
+ else
+ s" set boot_verbose=YES" evaluate
+ then
+
+ TRUE \ loop menu again
+;
+
+: goto_prompt ( N -- N FALSE )
+
+ s" set autoboot_delay=NO" evaluate
+
+ cr
+ ." To get back to the menu, type `menu' and press ENTER" cr
+ ." or type `boot' and press ENTER to start FreeBSD." cr
+ cr
+
+ FALSE \ exit the menu
+;
+
+: cycle_kernel ( N -- N TRUE )
+ cycle_menuitem
+ menu-redraw
+
+ \ Now we're going to make the change effective
+
+ s" cycle_stateN" \ base name of array state var
+ -rot 2dup 11 + c! rot \ replace 'N' with ASCII numeral
+ evaluate \ translate name into address
+ @ \ dereference address into value
+ 48 + \ convert to ASCII numeral
+
+ \ Since we are [in this file] going to override the standard `boot'
+ \ routine with a custom one, you should know that we use $kernel
+ \ when referencing the desired kernel. Set $kernel below.
+
+ s" set kernel=${kernel_prefix}${kernel[N]}${kernel_suffix}"
+ \ command to assemble full kernel-path
+ -rot tuck 36 + c! swap \ replace 'N' with array index value
+ evaluate \ sets $kernel to full kernel-path
+
+ TRUE \ loop menu again
+;
+
+: cycle_root ( N -- N TRUE )
+ cycle_menuitem
+ menu-redraw
+
+ \ Now we're going to make the change effective
+
+ s" cycle_stateN" \ base name of array state var
+ -rot 2dup 11 + c! rot \ replace 'N' with ASCII numeral
+ evaluate \ translate name into address
+ @ \ dereference address into value
+ 48 + \ convert to ASCII numeral
+
+ \ Since we are [in this file] going to override the standard `boot'
+ \ routine with a custom one, you should know that we use $root when
+ \ booting. Set $root below.
+
+ s" set root=${root_prefix}${root[N]}${root_prefix}"
+ \ command to assemble full kernel-path
+ -rot tuck 30 + c! swap \ replace 'N' with array index value
+ evaluate \ sets $kernel to full kernel-path
+
+ TRUE \ loop menu again
+;
diff --git a/sys/boot/forth/menu.4th b/sys/boot/forth/menu.4th
new file mode 100644
index 0000000..110ec1c
--- /dev/null
+++ b/sys/boot/forth/menu.4th
@@ -0,0 +1,971 @@
+\ Copyright (c) 2003 Scott Long <scottl@freebsd.org>
+\ Copyright (c) 2003 Aleksander Fafula <alex@fafula.com>
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@hotmail.com>
+\ All rights reserved.
+\
+\ 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 AUTHOR 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 AUTHOR 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.
+\
+\ $FreeBSD$
+
+marker task-menu.4th
+
+\ Frame drawing
+include /boot/frames.4th
+
+f_double \ Set frames to double (see frames.4th). Replace with
+ \ f_single if you want single frames.
+46 constant dot \ ASCII definition of a period (in decimal)
+
+ 4 constant menu_timeout_default_x \ default column position of timeout
+23 constant menu_timeout_default_y \ default row position of timeout msg
+10 constant menu_timeout_default \ default timeout (in seconds)
+
+\ Customize the following values with care
+
+ 1 constant menu_start \ Numerical prefix of first menu item
+dot constant bullet \ Menu bullet (appears after numerical prefix)
+ 5 constant menu_x \ Row position of the menu (from the top)
+ 10 constant menu_y \ Column position of the menu (from left side)
+
+\ Menu Appearance
+variable menuidx \ Menu item stack for number prefixes
+variable menurow \ Menu item stack for positioning
+variable menubllt \ Menu item bullet
+
+\ Menu Positioning
+variable menuX \ Menu X offset (columns)
+variable menuY \ Menu Y offset (rows)
+
+\ Menu-item key association/detection
+variable menukey1
+variable menukey2
+variable menukey3
+variable menukey4
+variable menukey5
+variable menukey6
+variable menukey7
+variable menukey8
+variable menureboot
+variable menurebootadded
+variable menuacpi
+variable menuoptions
+
+\ Menu timer [count-down] variables
+variable menu_timeout_enabled \ timeout state (internal use only)
+variable menu_time \ variable for tracking the passage of time
+variable menu_timeout \ determined configurable delay duration
+variable menu_timeout_x \ column position of timeout message
+variable menu_timeout_y \ row position of timeout message
+
+\ Boolean option status variables
+variable toggle_state1
+variable toggle_state2
+variable toggle_state3
+variable toggle_state4
+variable toggle_state5
+variable toggle_state6
+variable toggle_state7
+variable toggle_state8
+
+\ Array option status variables
+variable cycle_state1
+variable cycle_state2
+variable cycle_state3
+variable cycle_state4
+variable cycle_state5
+variable cycle_state6
+variable cycle_state7
+variable cycle_state8
+
+\ Containers for storing the initial caption text
+create init_text1 255 allot
+create init_text2 255 allot
+create init_text3 255 allot
+create init_text4 255 allot
+create init_text5 255 allot
+create init_text6 255 allot
+create init_text7 255 allot
+create init_text8 255 allot
+
+: arch-i386? ( -- BOOL ) \ Returns TRUE (-1) on i386, FALSE (0) otherwise.
+ s" arch-i386" environment? dup if
+ drop
+ then
+;
+
+\ This function prints a menu item at menuX (row) and menuY (column), returns
+\ the incremental decimal ASCII value associated with the menu item, and
+\ increments the cursor position to the next row for the creation of the next
+\ menu item. This function is called by the menu-create function. You need not
+\ call it directly.
+\
+: printmenuitem ( menu_item_str -- ascii_keycode )
+
+ menurow dup @ 1+ swap ! ( increment menurow )
+ menuidx dup @ 1+ swap ! ( increment menuidx )
+
+ \ Calculate the menuitem row position
+ menurow @ menuY @ +
+
+ \ Position the cursor at the menuitem position
+ dup menuX @ swap at-xy
+
+ \ Print the value of menuidx
+ loader_color? if
+ ." "
+ then
+ menuidx @ .
+ loader_color? if
+ ." "
+ then
+
+ \ Move the cursor forward 1 column
+ dup menuX @ 1+ swap at-xy
+
+ menubllt @ emit \ Print the menu bullet using the emit function
+
+ \ Move the cursor to the 3rd column from the current position
+ \ to allow for a space between the numerical prefix and the
+ \ text caption
+ menuX @ 3 + swap at-xy
+
+ \ Print the menu caption (we expect a string to be on the stack
+ \ prior to invoking this function)
+ type
+
+ \ Here we will add the ASCII decimal of the numerical prefix
+ \ to the stack (decimal ASCII for `1' is 49) as a "return value"
+ menuidx @ 48 +
+;
+
+: toggle_menuitem ( N -- N ) \ toggles caption text and internal menuitem state
+
+ \ ASCII numeral equal to user-selected menu item must be on the stack.
+ \ We do not modify the stack, so the ASCII numeral is left on top.
+
+ s" init_textN" \ base name of buffer
+ -rot 2dup 9 + c! rot \ replace 'N' with ASCII num
+
+ evaluate c@ 0= if
+ \ NOTE: no need to check toggle_stateN since the first time we
+ \ are called, we will populate init_textN. Further, we don't
+ \ need to test whether menu_caption[x] (ansi_caption[x] when
+ \ loader_color=1) is available since we would not have been
+ \ called if the caption was NULL.
+
+ \ base name of environment variable
+ loader_color? if
+ s" ansi_caption[x]"
+ else
+ s" menu_caption[x]"
+ then
+ -rot 2dup 13 + c! rot \ replace 'x' with ASCII numeral
+
+ getenv dup -1 <> if
+
+ s" init_textN" \ base name of buffer
+ 4 pick \ copy ASCII num to top
+ rot tuck 9 + c! swap \ replace 'N' with ASCII num
+ evaluate
+
+ \ now we have the buffer c-addr on top
+ \ ( followed by c-addr/u of current caption )
+
+ \ Copy the current caption into our buffer
+ 2dup c! -rot \ store strlen at first byte
+ begin
+ rot 1+ \ bring alt addr to top and increment
+ -rot -rot \ bring buffer addr to top
+ 2dup c@ swap c! \ copy current character
+ 1+ \ increment buffer addr
+ rot 1- \ bring buffer len to top and decrement
+ dup 0= \ exit loop if buffer len is zero
+ until
+ 2drop \ buffer len/addr
+ drop \ alt addr
+
+ else
+ drop
+ then
+ then
+
+ \ Now we are certain to have init_textN populated with the initial
+ \ value of menu_caption[x] (ansi_caption[x] with loader_color enabled).
+ \ We can now use init_textN as the untoggled caption and
+ \ toggled_text[x] (toggled_ansi[x] with loader_color enabled) as the
+ \ toggled caption and store the appropriate value into menu_caption[x]
+ \ (again, ansi_caption[x] with loader_color enabled). Last, we'll
+ \ negate the toggled state so that we reverse the flow on subsequent
+ \ calls.
+
+ s" toggle_stateN @" \ base name of toggle state var
+ -rot 2dup 12 + c! rot \ replace 'N' with ASCII numeral
+
+ evaluate 0= if
+ \ state is OFF, toggle to ON
+
+ \ base name of toggled text var
+ loader_color? if
+ s" toggled_ansi[x]"
+ else
+ s" toggled_text[x]"
+ then
+ -rot 2dup 13 + c! rot \ replace 'x' with ASCII num
+
+ getenv dup -1 <> if
+ \ Assign toggled text to menu caption
+
+ \ base name of caption var
+ loader_color? if
+ s" ansi_caption[x]"
+ else
+ s" menu_caption[x]"
+ then
+ 4 pick \ copy ASCII num to top
+ rot tuck 13 + c! swap \ replace 'x' with ASCII num
+
+ setenv \ set new caption
+ else
+ \ No toggled text, keep the same caption
+
+ drop
+ then
+
+ true \ new value of toggle state var (to be stored later)
+ else
+ \ state is ON, toggle to OFF
+
+ s" init_textN" \ base name of initial text buffer
+ -rot 2dup 9 + c! rot \ replace 'N' with ASCII numeral
+ evaluate \ convert string to c-addr
+ count \ convert c-addr to c-addr/u
+
+ \ base name of caption var
+ loader_color? if
+ s" ansi_caption[x]"
+ else
+ s" menu_caption[x]"
+ then
+ 4 pick \ copy ASCII num to top
+ rot tuck 13 + c! swap \ replace 'x' with ASCII numeral
+
+ setenv \ set new caption
+ false \ new value of toggle state var (to be stored below)
+ then
+
+ \ now we'll store the new toggle state (on top of stack)
+ s" toggle_stateN" \ base name of toggle state var
+ 3 pick \ copy ASCII numeral to top
+ rot tuck 12 + c! swap \ replace 'N' with ASCII numeral
+ evaluate \ convert string to addr
+ ! \ store new value
+;
+
+: cycle_menuitem ( N -- N ) \ cycles through array of choices for a menuitem
+
+ \ ASCII numeral equal to user-selected menu item must be on the stack.
+ \ We do not modify the stack, so the ASCII numeral is left on top.
+
+ s" cycle_stateN" \ base name of array state var
+ -rot 2dup 11 + c! rot \ replace 'N' with ASCII numeral
+
+ evaluate \ we now have a pointer to the proper variable
+ dup @ \ resolve the pointer (but leave it on the stack)
+ 1+ \ increment the value
+
+ \ Before assigning the (incremented) value back to the pointer,
+ \ let's test for the existence of this particular array element.
+ \ If the element exists, we'll store index value and move on.
+ \ Otherwise, we'll loop around to zero and store that.
+
+ dup 48 + \ duplicate Array index and convert to ASCII numeral
+
+ \ base name of array caption text
+ loader_color? if
+ s" ansi_caption[x][y]"
+ else
+ s" menu_caption[x][y]"
+ then
+ -rot tuck 16 + c! swap \ replace 'y' with Array index
+ 4 pick rot tuck 13 + c! swap \ replace 'x' with menu choice
+
+ \ Now test for the existence of our incremented array index in the
+ \ form of $menu_caption[x][y] ($ansi_caption[x][y] with loader_color
+ \ enabled) as set in loader.rc(5), et. al.
+
+ getenv dup -1 = if
+ \ No caption set for this array index. Loop back to zero.
+
+ drop ( getenv cruft )
+ drop ( incremented array index )
+ 0 ( new array index that will be stored later )
+
+ \ base name of caption var
+ loader_color? if
+ s" ansi_caption[x][0]"
+ else
+ s" menu_caption[x][0]"
+ then
+ 4 pick rot tuck 13 + c! swap \ replace 'x' with menu choice
+
+ getenv dup -1 = if
+ \ This is highly unlikely to occur, but to make
+ \ sure that things move along smoothly, allocate
+ \ a temporary NULL string
+
+ s" "
+ then
+ then
+
+ \ At this point, we should have the following on the stack (in order,
+ \ from bottom to top):
+ \
+ \ N - Ascii numeral representing the menu choice (inherited)
+ \ Addr - address of our internal cycle_stateN variable
+ \ N - zero-based number we intend to store to the above
+ \ C-Addr - string value we intend to store to menu_caption[x]
+ \ (or ansi_caption[x] with loader_color enabled)
+ \
+ \ Let's perform what we need to with the above.
+
+ \ base name of menuitem caption var
+ loader_color? if
+ s" ansi_caption[x]"
+ else
+ s" menu_caption[x]"
+ then
+ 6 pick rot tuck 13 + c! swap \ replace 'x' with menu choice
+ setenv \ set the new caption
+
+ swap ! \ update array state variable
+;
+
+: acpipresent? ( -- flag ) \ Returns TRUE if ACPI is present, FALSE otherwise
+ s" hint.acpi.0.rsdp" getenv
+ dup -1 = if
+ drop false exit
+ then
+ 2drop
+ true
+;
+
+: acpienabled? ( -- flag ) \ Returns TRUE if ACPI is enabled, FALSE otherwise
+ s" hint.acpi.0.disabled" getenv
+ dup -1 <> if
+ s" 0" compare 0<> if
+ false exit
+ then
+ else
+ drop
+ then
+ true
+;
+
+\ This function prints the appropriate menuitem basename to the stack if an
+\ ACPI option is to be presented to the user, otherwise returns -1. Used
+\ internally by menu-create, you need not (nor should you) call this directly.
+\
+: acpimenuitem ( -- C-Addr | -1 )
+
+ arch-i386? if
+ acpipresent? if
+ acpienabled? if
+ loader_color? if
+ s" toggled_ansi[x]"
+ else
+ s" toggled_text[x]"
+ then
+ else
+ loader_color? if
+ s" ansi_caption[x]"
+ else
+ s" menu_caption[x]"
+ then
+ then
+ else
+ menuidx dup @ 1+ swap ! ( increment menuidx )
+ -1
+ then
+ else
+ -1
+ then
+;
+
+\ This function creates the list of menu items. This function is called by the
+\ menu-display function. You need not be call it directly.
+\
+: menu-create ( -- )
+
+ \ Print the frame caption at (x,y)
+ s" loader_menu_title" getenv dup -1 = if
+ drop s" Welcome to FreeBSD"
+ then
+ 24 over 2 / - 9 at-xy type
+
+ \ Print our menu options with respective key/variable associations.
+ \ `printmenuitem' ends by adding the decimal ASCII value for the
+ \ numerical prefix to the stack. We store the value left on the stack
+ \ to the key binding variable for later testing against a character
+ \ captured by the `getkey' function.
+
+ \ Note that any menu item beyond 9 will have a numerical prefix on the
+ \ screen consisting of the first digit (ie. 1 for the tenth menu item)
+ \ and the key required to activate that menu item will be the decimal
+ \ ASCII of 48 plus the menu item (ie. 58 for the tenth item, aka. `:')
+ \ which is misleading and not desirable.
+ \
+ \ Thus, we do not allow more than 8 configurable items on the menu
+ \ (with "Reboot" as the optional ninth and highest numbered item).
+
+ \
+ \ Initialize the ACPI option status.
+ \
+ 0 menuacpi !
+ s" menu_acpi" getenv -1 <> if
+ c@ dup 48 > over 57 < and if ( '1' <= c1 <= '8' )
+ menuacpi !
+ arch-i386? if acpipresent? if
+ \
+ \ Set menu toggle state to active state
+ \ (required by generic toggle_menuitem)
+ \
+ menuacpi @
+ s" acpienabled? toggle_stateN !"
+ -rot tuck 25 + c! swap
+ evaluate
+ then then
+ else
+ drop
+ then
+ then
+
+ \
+ \ Initialize the menu_options visual separator.
+ \
+ 0 menuoptions !
+ s" menu_options" getenv -1 <> if
+ c@ dup 48 > over 57 < and if ( '1' <= c1 <= '8' )
+ menuoptions !
+ else
+ drop
+ then
+ then
+
+ \ Initialize "Reboot" menu state variable (prevents double-entry)
+ false menurebootadded !
+
+ 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8')
+ begin
+ \ If the "Options:" separator, print it.
+ dup menuoptions @ = if
+ \ Optionally add a reboot option to the menu
+ s" menu_reboot" getenv -1 <> if
+ drop
+ s" Reboot" printmenuitem menureboot !
+ true menurebootadded !
+ then
+
+ menuX @
+ menurow @ 2 + menurow !
+ menurow @ menuY @ +
+ at-xy
+ ." Options:"
+ then
+
+ \ If this is the ACPI menu option, act accordingly.
+ dup menuacpi @ = if
+ acpimenuitem ( -- C-Addr | -1 )
+ else
+ loader_color? if
+ s" ansi_caption[x]"
+ else
+ s" menu_caption[x]"
+ then
+ then
+
+ ( C-Addr | -1 )
+ dup -1 <> if
+ \ replace 'x' with current iteration
+ -rot 2dup 13 + c! rot
+
+ \ test for environment variable
+ getenv dup -1 <> if
+ printmenuitem ( C-Addr -- N )
+
+ s" menukeyN !" \ generate cmd to store result
+ -rot 2dup 7 + c! rot
+
+ evaluate
+ else
+ drop
+ then
+ else
+ drop
+
+ s" menu_command[x]"
+ -rot 2dup 13 + c! rot ( replace 'x' )
+ unsetenv
+ then
+
+ 1+ dup 56 > \ add 1 to iterator, continue if less than 57
+ until
+ drop \ iterator
+
+ \ Optionally add a reboot option to the menu
+ menurebootadded @ true <> if
+ s" menu_reboot" getenv -1 <> if
+ drop \ no need for the value
+ s" Reboot" \ menu caption (required by printmenuitem)
+
+ printmenuitem
+ menureboot !
+ else
+ 0 menureboot !
+ then
+ then
+;
+
+\ Takes a single integer on the stack and updates the timeout display. The
+\ integer must be between 0 and 9 (we will only update a single digit in the
+\ source message).
+\
+: menu-timeout-update ( N -- )
+
+ dup 9 > if ( N N 9 -- N )
+ drop ( N -- )
+ 9 ( maximum: -- N )
+ then
+
+ dup 0 < if ( N N 0 -- N )
+ drop ( N -- )
+ 0 ( minimum: -- N )
+ then
+
+ 48 + ( convert single-digit numeral to ASCII: N 48 -- N )
+
+ s" Autoboot in N seconds. [Space] to pause" ( N -- N Addr C )
+
+ 2 pick 48 - 0> if ( N Addr C N 48 -- N Addr C )
+
+ \ Modify 'N' (Addr+12) above to reflect time-left
+
+ -rot ( N Addr C -- C N Addr )
+ tuck ( C N Addr -- C Addr N Addr )
+ 12 + ( C Addr N Addr -- C Addr N Addr2 )
+ c! ( C Addr N Addr2 -- C Addr )
+ swap ( C Addr -- Addr C )
+
+ menu_timeout_x @
+ menu_timeout_y @
+ at-xy ( position cursor: Addr C N N -- Addr C )
+
+ type ( print message: Addr C -- )
+
+ else ( N Addr C N -- N Addr C )
+
+ menu_timeout_x @
+ menu_timeout_y @
+ at-xy ( position cursor: N Addr C N N -- N Addr C )
+
+ spaces ( erase message: N Addr C -- N Addr )
+ 2drop ( N Addr -- )
+
+ then
+
+ 0 25 at-xy ( position cursor back at bottom-left )
+;
+
+\ This function blocks program flow (loops forever) until a key is pressed.
+\ The key that was pressed is added to the top of the stack in the form of its
+\ decimal ASCII representation. This function is called by the menu-display
+\ function. You need not call it directly.
+\
+: getkey ( -- ascii_keycode )
+
+ begin \ loop forever
+
+ menu_timeout_enabled @ 1 = if
+ ( -- )
+ seconds ( get current time: -- N )
+ dup menu_time @ <> if ( has time elapsed?: N N N -- N )
+
+ \ At least 1 second has elapsed since last loop
+ \ so we will decrement our "timeout" (really a
+ \ counter, insuring that we do not proceed too
+ \ fast) and update our timeout display.
+
+ menu_time ! ( update time record: N -- )
+ menu_timeout @ ( "time" remaining: -- N )
+ dup 0> if ( greater than 0?: N N 0 -- N )
+ 1- ( decrement counter: N -- N )
+ dup menu_timeout !
+ ( re-assign: N N Addr -- N )
+ then
+ ( -- N )
+
+ dup 0= swap 0< or if ( N <= 0?: N N -- )
+ \ halt the timer
+ 0 menu_timeout ! ( 0 Addr -- )
+ 0 menu_timeout_enabled ! ( 0 Addr -- )
+ then
+
+ \ update the timer display ( N -- )
+ menu_timeout @ menu-timeout-update
+
+ menu_timeout @ 0= if
+ \ We've reached the end of the timeout
+ \ (user did not cancel by pressing ANY
+ \ key)
+
+ s" menu_timeout_command" getenv dup
+ -1 = if
+ drop \ clean-up
+ else
+ evaluate
+ then
+ then
+
+ else ( -- N )
+ \ No [detectable] time has elapsed (in seconds)
+ drop ( N -- )
+ then
+ ( -- )
+ then
+
+ key? if \ Was a key pressed? (see loader(8))
+
+ \ An actual key was pressed (if the timeout is running,
+ \ kill it regardless of which key was pressed)
+ menu_timeout @ 0<> if
+ 0 menu_timeout !
+ 0 menu_timeout_enabled !
+
+ \ clear screen of timeout message
+ 0 menu-timeout-update
+ then
+
+ \ get the key that was pressed and exit (if we
+ \ get a non-zero ASCII code)
+ key dup 0<> if
+ exit
+ else
+ drop
+ then
+ then
+ 50 ms \ sleep for 50 milliseconds (see loader(8))
+
+ again
+;
+
+: menu-erase ( -- ) \ Erases menu and resets positioning variable to positon 1.
+
+ \ Clear the screen area associated with the interactive menu
+ menuX @ menuY @
+ 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
+ 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
+ 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
+ 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
+ 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces 1+
+ 2dup at-xy 38 spaces 1+ 2dup at-xy 38 spaces
+ 2drop
+
+ \ Reset the starting index and position for the menu
+ menu_start 1- menuidx !
+ 0 menurow !
+;
+
+\ Erase and redraw the menu. Useful if you change a caption and want to
+\ update the menu to reflect the new value.
+\
+: menu-redraw ( -- )
+ menu-erase
+ menu-create
+;
+
+\ This function initializes the menu. Call this from your `loader.rc' file
+\ before calling any other menu-related functions.
+\
+: menu-init ( -- )
+ menu_start
+ 1- menuidx ! \ Initialize the starting index for the menu
+ 0 menurow ! \ Initialize the starting position for the menu
+ 42 13 2 9 box \ Draw frame (w,h,x,y)
+ 0 25 at-xy \ Move cursor to the bottom for output
+;
+
+\ Main function. Call this from your `loader.rc' file.
+\
+: menu-display ( -- )
+
+ 0 menu_timeout_enabled ! \ start with automatic timeout disabled
+
+ \ check indication that automatic execution after delay is requested
+ s" menu_timeout_command" getenv -1 <> if ( Addr C -1 -- | Addr )
+ drop ( just testing existence right now: Addr -- )
+
+ \ initialize state variables
+ seconds menu_time ! ( store the time we started )
+ 1 menu_timeout_enabled ! ( enable automatic timeout )
+
+ \ read custom time-duration (if set)
+ s" autoboot_delay" getenv dup -1 = if
+ drop \ no custom duration (remove dup'd bunk -1)
+ menu_timeout_default \ use default setting
+ else
+ 2dup ?number 0= if ( if not a number )
+ \ disable timeout if "NO", else use default
+ s" NO" compare-insensitive 0= if
+ 0 menu_timeout_enabled !
+ 0 ( assigned to menu_timeout below )
+ else
+ menu_timeout_default
+ then
+ else
+ -rot 2drop
+
+ \ disable timeout if less than zero
+ dup 0< if
+ drop
+ 0 menu_timeout_enabled !
+ 0 ( assigned to menu_timeout below )
+ then
+ then
+ then
+ menu_timeout ! ( store value on stack from above )
+
+ menu_timeout_enabled @ 1 = if
+ \ read custom column position (if set)
+ s" loader_menu_timeout_x" getenv dup -1 = if
+ drop \ no custom column position
+ menu_timeout_default_x \ use default setting
+ else
+ \ make sure custom position is a number
+ ?number 0= if
+ menu_timeout_default_x \ or use default
+ then
+ then
+ menu_timeout_x ! ( store value on stack from above )
+
+ \ read custom row position (if set)
+ s" loader_menu_timeout_y" getenv dup -1 = if
+ drop \ no custom row position
+ menu_timeout_default_y \ use default setting
+ else
+ \ make sure custom position is a number
+ ?number 0= if
+ menu_timeout_default_y \ or use default
+ then
+ then
+ menu_timeout_y ! ( store value on stack from above )
+ then
+ then
+
+ menu-create
+
+ begin \ Loop forever
+
+ 0 25 at-xy \ Move cursor to the bottom for output
+ getkey \ Block here, waiting for a key to be pressed
+
+ dup -1 = if
+ drop exit \ Caught abort (abnormal return)
+ then
+
+ \ Boot if the user pressed Enter/Ctrl-M (13) or
+ \ Ctrl-Enter/Ctrl-J (10)
+ dup over 13 = swap 10 = or if
+ drop ( no longer needed )
+ s" boot" evaluate
+ exit ( pedantic; never reached )
+ then
+
+ \ Evaluate the decimal ASCII value against known menu item
+ \ key associations and act accordingly
+
+ 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8')
+ begin
+ s" menukeyN @"
+
+ \ replace 'N' with current iteration
+ -rot 2dup 7 + c! rot
+
+ evaluate rot tuck = if
+
+ \ Adjust for missing ACPI menuitem on non-i386
+ arch-i386? true <> menuacpi @ 0<> and if
+ menuacpi @ over 2dup < -rot = or
+ over 58 < and if
+ ( key >= menuacpi && key < 58: N -- N )
+ 1+
+ then
+ then
+
+ \ base env name for the value (x is a number)
+ s" menu_command[x]"
+
+ \ Copy ASCII number to string at offset 13
+ -rot 2dup 13 + c! rot
+
+ \ Test for the environment variable
+ getenv dup -1 <> if
+ \ Execute the stored procedure
+ evaluate
+
+ \ We expect there to be a non-zero
+ \ value left on the stack after
+ \ executing the stored procedure.
+ \ If so, continue to run, else exit.
+
+ 0= if
+ drop \ key pressed
+ drop \ loop iterator
+ exit
+ else
+ swap \ need iterator on top
+ then
+ then
+
+ \ Re-adjust for missing ACPI menuitem
+ arch-i386? true <> menuacpi @ 0<> and if
+ swap
+ menuacpi @ 1+ over 2dup < -rot = or
+ over 59 < and if
+ 1-
+ then
+ swap
+ then
+ else
+ swap \ need iterator on top
+ then
+
+ \
+ \ Check for menu keycode shortcut(s)
+ \
+ s" menu_keycode[x]"
+ -rot 2dup 13 + c! rot
+ getenv dup -1 = if
+ drop
+ else
+ ?number 0<> if
+ rot tuck = if
+ swap
+ s" menu_command[x]"
+ -rot 2dup 13 + c! rot
+ getenv dup -1 <> if
+ evaluate
+ 0= if
+ 2drop
+ exit
+ then
+ else
+ drop
+ then
+ else
+ swap
+ then
+ then
+ then
+
+ 1+ dup 56 > \ increment iterator
+ \ continue if less than 57
+ until
+ drop \ loop iterator
+
+ menureboot @ = if 0 reboot then
+
+ again \ Non-operational key was pressed; repeat
+;
+
+\ This function unsets all the possible environment variables associated with
+\ creating the interactive menu. Call this when you want to clear the menu
+\ area in preparation for another menu.
+\
+: menu-clear ( -- )
+
+ 49 \ Iterator start (loop range 49 to 56; ASCII '1' to '8')
+ begin
+ \ basename for caption variable
+ loader_color? if
+ s" ansi_caption[x]"
+ else
+ s" menu_caption[x]"
+ then
+ -rot 2dup 13 + c! rot \ replace 'x' with current iteration
+ unsetenv \ not erroneous to unset unknown var
+
+ s" 0 menukeyN !" \ basename for key association var
+ -rot 2dup 9 + c! rot \ replace 'N' with current iteration
+ evaluate \ assign zero (0) to key assoc. var
+
+ 1+ dup 56 > \ increment, continue if less than 57
+ until
+ drop \ iterator
+
+ \ clear the "Reboot" menu option flag
+ s" menu_reboot" unsetenv
+ 0 menureboot !
+
+ \ clear the ACPI menu option flag
+ s" menu_acpi" unsetenv
+ 0 menuacpi !
+
+ \ clear the "Options" menu separator flag
+ s" menu_options" unsetenv
+ 0 menuoptions !
+
+ menu-erase
+;
+
+\ Assign configuration values
+bullet menubllt !
+10 menuY !
+5 menuX !
+
+\ Initialize our boolean state variables
+0 toggle_state1 !
+0 toggle_state2 !
+0 toggle_state3 !
+0 toggle_state4 !
+0 toggle_state5 !
+0 toggle_state6 !
+0 toggle_state7 !
+0 toggle_state8 !
+
+\ Initialize our array state variables
+0 cycle_state1 !
+0 cycle_state2 !
+0 cycle_state3 !
+0 cycle_state4 !
+0 cycle_state5 !
+0 cycle_state6 !
+0 cycle_state7 !
+0 cycle_state8 !
+
+\ Initialize string containers
+0 init_text1 c!
+0 init_text2 c!
+0 init_text3 c!
+0 init_text4 c!
+0 init_text5 c!
+0 init_text6 c!
+0 init_text7 c!
+0 init_text8 c!
diff --git a/sys/boot/forth/menu.4th.8 b/sys/boot/forth/menu.4th.8
new file mode 100644
index 0000000..45388f5
--- /dev/null
+++ b/sys/boot/forth/menu.4th.8
@@ -0,0 +1,307 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 18, 2011
+.Dt MENU.4TH 8
+.Os
+.Sh NAME
+.Nm menu.4th
+.Nd FreeBSD dynamic menu boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to display a dynamic menu system managed through
+a system of carefully named environment variables.
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include menu.4th
+.Pp
+This line is present in the default
+.Pa /boot/menu.rc
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic menu-init
+Draws the menu bounding box and initializes some internal state variables.
+This should be called before any other menu-related functions.
+.It Ic menu-display
+Displays the menu (configured via the below documented environment variables)
+and blocks on keyboard input, awaiting user action.
+.It Ic menu-erase
+Clears the screen area within the menu bounding box.
+.It Ic menu-redraw
+Calls
+.Ic menu-erase
+and then redraws the menu.
+.It Ic menu-clear
+Unsets all possible environment variables used
+to configure the menu and then calls
+.Ic menu-erase .
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va loader_color
+If set to
+.Dq Li YES
+(case-insensitive) or
+.Dq Li 1 ,
+causes the menu to be displayed in color wherever possible. This includes the
+use of ANSI bold for numbers appearing to the left of menuitems and the use of
+special
+.Dq Li ansi
+variables describd below.
+.It Va autoboot_delay
+Number of seconds
+.Ic menu-display
+will wait before executing
+.Va menu_timeout_command
+.Ic ( boot
+by default) unless a key is pressed.
+If set to
+.Dq Li NO
+(case-insensitive) or
+.Dq Li -1 ,
+.Ic menu-display
+will wait for user input and never execute
+.Ic menu_timeout_command .
+Default is
+.Dq Li 10 .
+See
+.Xr loader 8
+for additional information.
+.It Va menu_timeout_command
+The command to be executed after
+.Va autoboot_delay
+seconds if a key is not pressed. The default is
+.Ic boot .
+.It Va loader_menu_timeout_x
+Sets the desired column position of the timeout countdown text. Default is 4.
+.It Va loader_menu_timeout_y
+Sets the desired row position of the timeout countdown text. Default is 23.
+.It Va loader_menu_title
+The text to display centered above the menu. Default is
+.Dq Li "Welcome to FreeBSD" .
+.It Va menu_caption[x]
+The text to be displayed for the numbered menuitem
+.Dq Li x .
+.It Va menu_command[x]
+The command to be executed when the number associated with menuitem
+.Dq Li x
+is pressed. See the list of included FICL words below for some ideas.
+.It Va menu_keycode[x]
+An optional decimal ASCII keycode to be associated with menuitem
+.Dq Li x .
+When pressed, will cause the execution of
+.Va menu_command[x] .
+.It Va ansi_caption[x]
+If
+.Va loader_color
+is set, use this caption for menuitem
+.Dq Li x
+instead of
+.Va menu_caption[x] .
+.It Va toggled_text[x]
+For menuitems where
+.Va menu_command[x]
+is set to
+.Dq Li toggle_menuitem
+(or a derivative thereof), the text displayed
+will toggle between this and
+.Va menu_caption[x] .
+.It Va toggled_ansi[x]
+Like
+.Va toggled_text[x]
+except used when
+.Va loader_color
+is enabled.
+.It Va menu_caption[x][y]
+For menuitems where
+.Va menu_command[x]
+is set to
+.Dq Li cycle_menuitem
+(or a derivative thereof), the text displayed will cycle between this and other
+.Va menu_caption[x][y]
+entries.
+.It Va ansi_caption[x][y]
+Like
+.Va menu_caption[x][y]
+except used when
+.Va loader_color
+is enabled.
+.It Va menu_acpi
+When set to a number
+.Dq Li x
+associated with a given menuitem, that menuitem will only appear when
+running on i386-compatible hardware,
+.Va hint.acpi.0.rsdp
+is set (indicating the presence of hardware ACPI support as detected by
+.Xr loader 8 ) ,
+and
+.Va hint.acpi.0.disabled
+is not set.
+On non-i386 hardware, menuitems configured after the
+.Dq Li menu_acpi
+menuitem will use a lower number (to compensate for the missing ACPI menuitem)
+but continue to function as expected.
+On i386-compatible hardware lacking ACPI support (as detected by
+.Xr loader 8 ) ,
+subsequent menuitems will retain their associated numbers.
+.It Va hint.acpi.0.rsdp
+Set automatically by
+.Xr loader 8
+on i386-compatible hardware when ACPI support is detected at boot time.
+Effects the display of the
+.Dq Li menu_acpi
+menuitem (if configured).
+.It Va hint.acpi.0.disabled
+Effects the display of the
+.Va menu_acpi
+menuitem. If set, the menuitem will display
+.Va toggled_text[x]
+.Va ( toggled_ansi[x]
+if
+.Va loader_color
+is set), otherwise
+.Va menu_caption[x]
+.Va ( ansi_caption[x]
+if
+.Va loader_color
+is set).
+.It Va menu_options
+When set to a number
+.Dq Li x ,
+a single blank-line and an
+.Dq Li Options
+header are inserted between
+.Va menu_caption[x-1]
+and
+.Va menu_caption[x]
+(if configured).
+.It Va menu_reboot
+If set, adds a built-in
+.Dq Li Reboot
+menuitem to the end of the last configured menuitem. If
+.Va menu_options
+is configured, the
+.Dq Li Reboot
+menuitem will be inserted before the
+.Dq Options
+separator.
+.El
+.Pp
+In addition, it provides the following FICL words:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic arch-i386? ( -- BOOL )
+Returns true (-1) on i386 and false (0) otherwise.
+.It Ic acpipresent? ( -- BOOL )
+Returns true (-1) if ACPI is present and false (0) otherwise.
+.It Ic acpienabled? ( -- BOOL )
+Returns true (-1) if ACPI is enabled and false (0) otherwise.
+.It Ic toggle_menuitem ( N -- N )
+Toggles menuitem
+.Dq Li N
+between
+.Va menu_caption[x]
+and
+.Va toggled_text[x]
+(where
+.Dq Li N
+represents the ASCII decimal value for
+.Dq Li x ) .
+.It Ic cycle_menuitem ( N -- N )
+Cycles menuitem
+.Dq Li N
+between
+.Va menu_caption[x][y]
+entries (where
+.Va N
+represents the ASCII decimal value for
+.Va x ) .
+.El
+.Pp
+For all values of
+.Dq Li x
+above, use any number between 1 through 9. Sorry, double-digits are not
+currently supported.
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/menu.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+A simple boot menu:
+.Pp
+.Bd -literal -offset indent -compact
+include /boot/menu.4th
+menu-init
+set menu_caption[1]="Boot"
+set menu_command[1]="boot"
+set menu_options=2
+set menu_caption[2]="Option: NO"
+set toggled_text[2]="Option: YES"
+set menu_command[2]="toggle_menuitem"
+set menu_timeout_command="boot"
+set menu_reboot
+menu-display
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Xr loader.4th 8 ,
+.Xr beastie.4th 8
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Devin Teske Aq devinteske@hotmail.com .
diff --git a/sys/boot/forth/menu.rc b/sys/boot/forth/menu.rc
new file mode 100644
index 0000000..d8af4b2
--- /dev/null
+++ b/sys/boot/forth/menu.rc
@@ -0,0 +1,76 @@
+\ Menu.rc
+\ $FreeBSD$
+\
+\ Load required Forth modules
+include /boot/version.4th
+include /boot/brand.4th
+include /boot/menu.4th
+include /boot/menu-commands.4th
+include /boot/shortcuts.4th
+
+\ Screen prep
+clear \ clear the screen (see `screen.4th')
+print_version \ print version string (bottom-right; see `version.4th')
+draw-beastie \ draw freebsd mascot (on right; see `beastie.4th')
+draw-brand \ draw the FreeBSD title (top-left; see `brand.4th')
+menu-init \ initialize the menu area (see `menu.4th')
+
+\ Initialize main menu constructs (see `menu.4th')
+\ NOTE: To use the `ansi' variants, add `loader_color=1' to loader.conf(5)
+
+set menu_caption[1]="Boot [ENTER]"
+set menu_command[1]="boot"
+set ansi_caption[1]="Boot [ENTER]"
+set menu_keycode[1]="98"
+
+set menu_caption[2]="[Esc]ape to loader prompt"
+set menu_command[2]="goto_prompt"
+set menu_keycode[2]="27"
+set ansi_caption[2]="Escape to loader prompt"
+
+\ Enable built-in "Reboot" trailing menuitem
+\ NOTE: appears before menu_options if configured
+\
+set menu_reboot
+
+\ Enable "Options:" separator. When set to a numerical value (1-8), a visual
+\ separator is inserted before that menuitem number.
+\
+set menu_options=4
+
+set menu_caption[4]="[A]CPI Support: Disabled"
+set toggled_text[4]="[A]CPI Support: Enabled"
+set menu_command[4]="toggle_acpi"
+set menu_keycode[4]="97"
+set menu_acpi=4
+set ansi_caption[4]="ACPI Support: Disabled"
+set toggled_ansi[4]="ACPI Support: Enabled"
+
+set menu_caption[5]="Boot Safe [M]ode: NO"
+set toggled_text[5]="Boot Safe [M]ode: YES"
+set menu_command[5]="toggle_safemode"
+set menu_keycode[5]="109"
+set ansi_caption[5]="Boot Safe Mode: NO"
+set toggled_ansi[5]="Boot Safe Mode: YES"
+
+set menu_caption[6]="Boot [S]ingle User: NO"
+set toggled_text[6]="Boot [S]ingle User: YES"
+set menu_command[6]="toggle_singleuser"
+set menu_keycode[6]="115"
+set ansi_caption[6]="Boot Single User: NO"
+set toggled_ansi[6]="Boot Single User: YES"
+
+set menu_caption[7]="Boot [V]erbose: NO"
+set toggled_text[7]="Boot [V]erbose: YES"
+set menu_command[7]="toggle_verbose"
+set menu_keycode[7]="118"
+set ansi_caption[7]="Boot Verbose: NO"
+set toggled_ansi[7]="Boot Verbose: YES"
+
+\ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to
+\ customize the timeout; default is 10-seconds)
+\
+set menu_timeout_command="boot"
+
+\ Display the main menu (see `menu.4th')
+menu-display
diff --git a/sys/boot/forth/shortcuts.4th b/sys/boot/forth/shortcuts.4th
new file mode 100644
index 0000000..55a369b
--- /dev/null
+++ b/sys/boot/forth/shortcuts.4th
@@ -0,0 +1,50 @@
+\ Copyright (c) 2008-2011 Devin Teske <devinteske@hotmail.com>
+\ All rights reserved.
+\
+\ 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 AUTHOR 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 AUTHOR 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.
+\
+\ $FreeBSD$
+
+\ FICL words intended to be used as shortcuts for carrying out common tasks or
+\ producing common results. Generally, words defined here are simply groupings
+\ of other custom words that pull from multiple libraries (for example, if you
+\ want to define a custom word that uses words defined in three different
+\ libraries, this is a good place to define such a word).
+\
+\ This script should be included after you have included any/all other
+\ libraries. This will prevent calling a word defined here before any required
+\ words have been defined.
+
+marker task-shortcuts.4th
+
+\ This "shortcut" word will not be used directly, but is defined here to
+\ offer the user a quick way to get back into the interactive PXE menu
+\ after they have escaped to the shell (perhaps by accident).
+\
+: menu ( -- )
+ clear \ Clear the screen (in screen.4th)
+ print_version \ print version string (bottom-right; see version.4th)
+ draw-beastie \ Draw FreeBSD logo at right (in beastie.4th)
+ draw-brand \ Draw FIS logo at top (in brand.4th)
+ menu-init \ Initialize menu and draw bounding box (in menu.4th)
+ menu-display \ Launch interactive menu (in menu.4th)
+;
diff --git a/sys/boot/forth/support.4th b/sys/boot/forth/support.4th
index 5484e06..3dbeae8 100644
--- a/sys/boot/forth/support.4th
+++ b/sys/boot/forth/support.4th
@@ -54,7 +54,6 @@
\ Exported global variables;
\
\ string conf_files configuration files to be loaded
-\ string password password
\ cell modules_options pointer to first module information
\ value verbose? indicates if user wants a verbose loading
\ value any_conf_read? indicates if a conf file was succesfully read
@@ -164,7 +163,6 @@ structure: file_metadata
string conf_files
string nextboot_conf_file
-string password
create module_options sizeof module.next allot 0 module_options !
create last_module_option sizeof module.next allot 0 last_module_option !
0 value verbose?
@@ -610,8 +608,6 @@ only forth also support-functions also file-processing definitions also
: execute? s" exec" assignment_type? ;
-: password? s" password" assignment_type? ;
-
: module_load? load_module_suffix suffix_type? ;
: module_loadname? module_loadname_suffix suffix_type? ;
@@ -752,10 +748,6 @@ only forth also support-functions also file-processing definitions also
['] evaluate catch if EEXEC throw then
;
-: set_password
- value_buffer strget unquote password string=
-;
-
: process_assignment
name_buffer .len @ 0= if exit then
loader_conf_files? if set_conf_files exit then
@@ -763,7 +755,6 @@ only forth also support-functions also file-processing definitions also
nextboot_conf? if set_nextboot_conf exit then
verbose_flag? if set_verbose exit then
execute? if execute_command exit then
- password? if set_password exit then
module_load? if set_module_flag exit then
module_loadname? if set_module_loadname exit then
module_type? if set_module_type exit then
@@ -1532,30 +1523,6 @@ also builtins
?dup 0= if ['] load_modules catch then
;
-\ read and store only as many bytes as we need, drop the extra
-: read-password { size | buf len -- }
- size allocate if ENOMEM throw then
- to buf
- 0 to len
- begin
- key
- dup backspace = if
- drop
- len if
- backspace emit bl emit backspace emit
- len 1 - to len
- else
- bell emit
- then
- else
- dup <cr> = if cr drop buf len exit then
- [char] * emit
- len size < if buf len chars + c! else drop then
- len 1+ to len
- then
- again
-;
-
\ Go back to straight forth vocabulary
only forth also definitions
diff --git a/sys/boot/forth/version.4th b/sys/boot/forth/version.4th
new file mode 100644
index 0000000..c59f825
--- /dev/null
+++ b/sys/boot/forth/version.4th
@@ -0,0 +1,60 @@
+\ Copyright (c) 2006-2011 Devin Teske <devinteske@hotmail.com>
+\ All rights reserved.
+\
+\ 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 AUTHOR 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 AUTHOR 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.
+\
+\ $FreeBSD$
+
+marker task-version.4th
+
+variable versionX
+variable versionY
+
+\ Initialize text placement to defaults
+80 versionX ! \ NOTE: this is the ending column (text is right-justified)
+24 versionY !
+
+: print_version ( -- )
+
+ \ Get the text placement position (if set)
+ s" loader_version_x" getenv dup -1 <> if
+ ?number drop versionX ! -1
+ then drop
+ s" loader_version_y" getenv dup -1 <> if
+ ?number drop versionY ! -1
+ then drop
+
+ \ Exit if a version was not set
+ s" loader_version" getenv dup -1 = if
+ drop exit
+ then
+
+ \ Right justify the text
+ dup versionX @ swap - versionY @ at-xy
+
+ \ Print the version (optionally in cyan)
+ loader_color? if
+ ." " type ." "
+ else
+ type
+ then
+;
diff --git a/sys/boot/forth/version.4th.8 b/sys/boot/forth/version.4th.8
new file mode 100644
index 0000000..fff2268
--- /dev/null
+++ b/sys/boot/forth/version.4th.8
@@ -0,0 +1,126 @@
+.\" Copyright (c) 2011 Devin Teske
+.\" All rights reserved.
+.\"
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 19, 2011
+.Dt VERSION.4TH 8
+.Os
+.Sh NAME
+.Nm version.4th
+.Nd FreeBSD version string boot module.
+.Sh DESCRIPTION
+The file that goes by the name of
+.Nm
+is a set of commands designed to draw the boot loader
+version at the bottom-right of the screen.
+The commands of
+.Nm
+by themselves are not enough for most uses.
+Please refer to the
+examples below for the most common situations, and to
+.Xr loader 8
+for additional commands.
+.Pp
+Before using any of the commands provided in
+.Nm ,
+it must be included
+through the command:
+.Pp
+.Dl include version.4th
+.Pp
+This line is present in the default
+.Pa /boot/menu.rc
+file, so it is not needed (and should not be re-issued) in a normal setup.
+.Pp
+The commands provided by it are:
+.Pp
+.Bl -tag -width disable-module_module -compact -offset indent
+.It Ic print_version
+Prints the contents of the
+.Va loader_version
+environment variable right-justified at the column
+.Va loader_version_x
+and row
+.Va loader_version_y .
+.El
+.Pp
+The environment variables that effect its behavior are:
+.Bl -tag -width bootfile -offset indent
+.It Va loader_version
+Set automatically by
+.Xr loader 8 ,
+but you can override it by setting in
+.Xr loader.conf 5 .
+This should be the version of boot loader used.
+.It Va loader_version_x
+Sets the desired ending column position of
+.Va loader_version .
+Default is 80.
+.It Va loader_version_y
+Sets the desired ending row position of
+.Va loader_version .
+Default is 24.
+.It Va loader_color
+If set to
+.Dq Li YES
+(case-insensitive) or
+.Dq Li 1 ,
+causes the version to be printed in ANSI Cyan.
+.El
+.Sh FILES
+.Bl -tag -width /boot/loader.4th -compact
+.It Pa /boot/loader
+The
+.Xr loader 8 .
+.It Pa /boot/version.4th
+.Nm
+itself.
+.It Pa /boot/loader.rc
+.Xr loader 8
+bootstrapping script.
+.El
+.Sh EXAMPLES
+Override
+.Xr loader 8
+version in
+.Xr loader.conf 5 :
+.Pp
+.Bd -literal -offset indent -compact
+loader_version="loader 1.1"
+.Ed
+.Sh SEE ALSO
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Sh HISTORY
+The
+.Nm
+set of commands first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Nm
+set of commands was written by
+.An -nosplit
+.An Devin Teske Aq devinteske@hotmail.com .
diff --git a/sys/boot/i386/libi386/biosacpi.c b/sys/boot/i386/libi386/biosacpi.c
index f511eb7..ff8b1ca 100644
--- a/sys/boot/i386/libi386/biosacpi.c
+++ b/sys/boot/i386/libi386/biosacpi.c
@@ -61,7 +61,7 @@ biosacpi_detect(void)
return;
/* export values from the RSDP */
- sprintf(buf, "%p", VTOP(rsdp));
+ sprintf(buf, "%u", VTOP(rsdp));
setenv("hint.acpi.0.rsdp", buf, 1);
revision = rsdp->Revision;
if (revision == 0)
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index b834ea0..f4babff 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -104,11 +104,16 @@ FILESMODE_${LOADER}= ${BINMODE} -b
.PATH: ${.CURDIR}/../../forth
FILES+= loader.help loader.4th support.4th loader.conf
FILES+= screen.4th frames.4th beastie.4th
+FILES+= brand.4th check-password.4th color.4th delay.4th
+FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
FILESDIR_loader.conf= /boot/defaults
.if !exists(${DESTDIR}/boot/loader.rc)
FILES+= loader.rc
.endif
+.if !exists(${DESTDIR}/boot/menu.rc)
+FILES+= menu.rc
+.endif
.endif
# XXX crt0.o needs to be first for pxeboot(8) to work
diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile
index 06ff863..65df86f 100644
--- a/sys/boot/i386/zfsboot/Makefile
+++ b/sys/boot/i386/zfsboot/Makefile
@@ -15,7 +15,7 @@ ORG1= 0x7c00
ORG2= 0x2000
CFLAGS= -DBOOTPROG=\"zfsboot\" \
- -Os -g \
+ -Os \
-fno-guess-branch-probability \
-fomit-frame-pointer \
-fno-unit-at-a-time \
diff --git a/sys/boot/ia64/common/Makefile b/sys/boot/ia64/common/Makefile
index 3204edc..d90898f 100644
--- a/sys/boot/ia64/common/Makefile
+++ b/sys/boot/ia64/common/Makefile
@@ -6,7 +6,7 @@ MK_SSP= no
LIB= ia64
INTERNALLIB=
-SRCS= autoload.c bootinfo.c copy.c devicename.c exec.c
+SRCS= autoload.c bootinfo.c copy.c devicename.c exec.c icache.c
CFLAGS+= -I${.CURDIR}/../../efi/include
CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH}
@@ -33,9 +33,15 @@ loader.help: help.common
.PATH: ${.CURDIR}/../../forth
FILES+= loader.4th support.4th loader.conf
+FILES+= screen.4th frames.4th
+FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th
+FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
.if !exists(${DESTDIR}/boot/loader.rc)
FILES+= loader.rc
.endif
+.if !exists(${DESTDIR}/boot/menu.rc)
+FILES+= menu.rc
+.endif
FILESDIR_loader.conf= /boot/defaults
.include <bsd.lib.mk>
diff --git a/sys/boot/ia64/common/exec.c b/sys/boot/ia64/common/exec.c
index dd9c9ba..65886fa 100644
--- a/sys/boot/ia64/common/exec.c
+++ b/sys/boot/ia64/common/exec.c
@@ -258,6 +258,8 @@ ia64_loadseg(Elf_Ehdr *eh, Elf_Phdr *ph, uint64_t delta)
if (ph->p_flags & PF_X) {
ia64_text_start = ph->p_vaddr + delta;
ia64_text_size = ph->p_memsz;
+
+ ia64_sync_icache(ia64_text_start, ia64_text_size);
} else {
ia64_data_start = ph->p_vaddr + delta;
ia64_data_size = ph->p_memsz;
diff --git a/sys/boot/ia64/common/icache.c b/sys/boot/ia64/common/icache.c
new file mode 100644
index 0000000..77a35d7
--- /dev/null
+++ b/sys/boot/ia64/common/icache.c
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2011 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <stand.h>
+#include <machine/ia64_cpu.h>
+
+#include "libia64.h"
+
+void
+ia64_sync_icache(vm_offset_t va, size_t sz)
+{
+ uintptr_t pa;
+ size_t cnt, max;
+
+ while (sz > 0) {
+ max = sz;
+ pa = (uintptr_t)ia64_va2pa(va, &max);
+ for (cnt = 0; cnt < max; cnt += 32)
+ ia64_fc_i(pa + cnt);
+ ia64_sync_i();
+ va += max;
+ sz -= max;
+ }
+ ia64_srlz_i();
+}
diff --git a/sys/boot/ia64/common/libia64.h b/sys/boot/ia64/common/libia64.h
index 29912f5..4bc7638 100644
--- a/sys/boot/ia64/common/libia64.h
+++ b/sys/boot/ia64/common/libia64.h
@@ -64,6 +64,7 @@ void ia64_loadseg(void *, void *, uint64_t);
ssize_t ia64_copyin(const void *, vm_offset_t, size_t);
ssize_t ia64_copyout(vm_offset_t, void *, size_t);
+void ia64_sync_icache(vm_offset_t, size_t);
ssize_t ia64_readin(int, vm_offset_t, size_t);
void *ia64_va2pa(vm_offset_t, size_t *);
diff --git a/sys/boot/ia64/efi/efimd.c b/sys/boot/ia64/efi/efimd.c
index 0f7f02a..0b29e12 100644
--- a/sys/boot/ia64/efi/efimd.c
+++ b/sys/boot/ia64/efi/efimd.c
@@ -230,3 +230,35 @@ ia64_platform_enter(const char *kernel)
return (0);
}
+
+COMMAND_SET(pbvm, "pbvm", "show PBVM details", command_pbvm);
+
+static int
+command_pbvm(int argc, char *argv[])
+{
+ uint64_t limit, pg, start;
+ u_int idx;
+
+ printf("Page table @ %p, size %x\n", ia64_pgtbl, ia64_pgtblsz);
+
+ if (ia64_pgtbl == NULL)
+ return (0);
+
+ limit = ~0;
+ start = ~0;
+ idx = 0;
+ while (ia64_pgtbl[idx] != 0) {
+ pg = ia64_pgtbl[idx];
+ if (pg != limit) {
+ if (start != ~0)
+ printf("%#lx-%#lx\n", start, limit);
+ start = pg;
+ }
+ limit = pg + IA64_PBVM_PAGE_SIZE;
+ idx++;
+ }
+ if (start != ~0)
+ printf("%#lx-%#lx\n", start, limit);
+
+ return (0);
+}
diff --git a/sys/boot/ia64/efi/main.c b/sys/boot/ia64/efi/main.c
index 485a26d..ec12b42 100644
--- a/sys/boot/ia64/efi/main.c
+++ b/sys/boot/ia64/efi/main.c
@@ -153,9 +153,7 @@ main(int argc, CHAR16 *argv[])
*/
cons_probe();
- printf("\n");
- printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
- printf("(%s, %s)\n", bootprog_maker, bootprog_date);
+ printf("\n%s, Revision %s\n", bootprog_name, bootprog_rev);
find_pal_proc();
@@ -214,6 +212,18 @@ static int
command_quit(int argc, char *argv[])
{
exit(0);
+ /* NOTREACHED */
+ return (CMD_OK);
+}
+
+COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
+
+static int
+command_reboot(int argc, char *argv[])
+{
+
+ RS->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
+ /* NOTREACHED */
return (CMD_OK);
}
@@ -585,3 +595,24 @@ command_hcdp(int argc, char *argv[])
printf("<EOT>\n");
return (CMD_OK);
}
+
+COMMAND_SET(about, "about", "about the loader", command_about);
+
+extern uint64_t _start_plabel[];
+
+static int
+command_about(int argc, char *argv[])
+{
+ EFI_LOADED_IMAGE *img;
+
+ printf("%s\n", bootprog_name);
+ printf("revision %s\n", bootprog_rev);
+ printf("built by %s\n", bootprog_maker);
+ printf("built on %s\n", bootprog_date);
+
+ printf("\n");
+
+ BS->HandleProtocol(IH, &imgid, (VOID**)&img);
+ printf("image loaded at %p\n", img->ImageBase);
+ printf("entry at %#lx (%#lx)\n", _start_plabel[0], _start_plabel[1]);
+}
diff --git a/sys/boot/ia64/efi/version b/sys/boot/ia64/efi/version
index 3a947c8..17d14ea 100644
--- a/sys/boot/ia64/efi/version
+++ b/sys/boot/ia64/efi/version
@@ -3,6 +3,8 @@ $FreeBSD$
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
file is important. Make sure the current version number is on line 6.
+3.1: Add the about, reboot and pbvm commands.
+ I-cache coherency is maintained.
3.0: Add support for PBVM.
2.2: Create direct mapping based on start address instead of mapping
first 256M.
diff --git a/sys/boot/pc98/loader/Makefile b/sys/boot/pc98/loader/Makefile
index e1f47cd..d289cce 100644
--- a/sys/boot/pc98/loader/Makefile
+++ b/sys/boot/pc98/loader/Makefile
@@ -82,6 +82,8 @@ loader.help: help.common help.pc98
.PATH: ${.CURDIR}/../../forth
FILES= loader loader.help loader.4th support.4th loader.conf
FILES+= screen.4th frames.4th beastie.4th
+FILES+= brand.4th check-password.4th color.4th delay.4th
+FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
# XXX INSTALLFLAGS_loader= -b
FILESMODE_loader= ${BINMODE} -b
FILESDIR_loader.conf= /boot/defaults
@@ -90,6 +92,10 @@ FILESDIR_loader.conf= /boot/defaults
FILES+= ${.CURDIR}/../../i386/loader/loader.rc
.endif
+.if !exists(${DESTDIR}/boot/menu.rc)
+FILES+= menu.rc
+.endif
+
# XXX crt0.o needs to be first for pxeboot(8) to work
OBJS= ${BTXCRT}
diff --git a/sys/boot/powerpc/ofw/Makefile b/sys/boot/powerpc/ofw/Makefile
index 776f98e..079f552 100644
--- a/sys/boot/powerpc/ofw/Makefile
+++ b/sys/boot/powerpc/ofw/Makefile
@@ -103,10 +103,17 @@ loader.help: help.common help.ofw
.PATH: ${.CURDIR}/../../forth
FILES= loader.help loader.4th support.4th loader.conf
+FILES+= screen.4th frames.4th
+FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th
+FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
FILESDIR_loader.conf= /boot/defaults
.if !exists(${DESTDIR}/boot/loader.rc)
FILES+= loader.rc
.endif
+.if !exists(${DESTDIR}/boot/menu.rc)
+FILES+= menu.rc
+.endif
+
.include <bsd.prog.mk>
diff --git a/sys/boot/powerpc/ps3/Makefile b/sys/boot/powerpc/ps3/Makefile
index b3a37be..b05470b 100644
--- a/sys/boot/powerpc/ps3/Makefile
+++ b/sys/boot/powerpc/ps3/Makefile
@@ -113,10 +113,17 @@ loader.help: help.common help.ps3
.PATH: ${.CURDIR}/../../forth
FILES= loader.help loader.4th support.4th loader.conf
+FILES+= screen.4th frames.4th
+FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th
+FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
FILESDIR_loader.conf= /boot/defaults
.if !exists(${DESTDIR}/boot/loader.rc)
FILES+= loader.rc
.endif
+.if !exists(${DESTDIR}/boot/menu.rc)
+FILES+= menu.rc
+.endif
+
.include <bsd.prog.mk>
diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile
index 46c6baa..d32fbab 100644
--- a/sys/boot/sparc64/loader/Makefile
+++ b/sys/boot/sparc64/loader/Makefile
@@ -84,10 +84,17 @@ loader.help: help.common help.sparc64
.PATH: ${.CURDIR}/../../forth
FILES= loader.help loader.4th support.4th loader.conf
+FILES+= screen.4th frames.4th
+FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th
+FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th
FILESDIR_loader.conf= /boot/defaults
.if !exists(${DESTDIR}/boot/loader.rc)
FILES+= loader.rc
.endif
+.if !exists(${DESTDIR}/boot/menu.rc)
+FILES+= menu.rc
+.endif
+
.include <bsd.prog.mk>
diff --git a/sys/cam/ata/ata_all.c b/sys/cam/ata/ata_all.c
index 3737e8f..560eef4 100644
--- a/sys/cam/ata/ata_all.c
+++ b/sys/cam/ata/ata_all.c
@@ -270,6 +270,7 @@ ata_print_ident(struct ata_params *ident_data)
sizeof(revision));
printf("<%s %s> %s-%d",
product, revision,
+ (ident_data->config == ATA_PROTO_CFA) ? "CFA" :
(ident_data->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA",
ata_version(ident_data->version_major));
if (ident_data->satacapabilities && ident_data->satacapabilities != 0xffff) {
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 128bb8b..ed0dbef 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -89,7 +89,8 @@ typedef enum {
} ada_flags;
typedef enum {
- ADA_Q_NONE = 0x00
+ ADA_Q_NONE = 0x00,
+ ADA_Q_4K = 0x01,
} ada_quirks;
typedef enum {
@@ -113,11 +114,12 @@ struct disk_params {
u_int64_t sectors; /* Total number sectors */
};
-#define TRIM_MAX_BLOCKS 4
-#define TRIM_MAX_RANGES TRIM_MAX_BLOCKS * 64
+#define TRIM_MAX_BLOCKS 8
+#define TRIM_MAX_RANGES (TRIM_MAX_BLOCKS * 64)
+#define TRIM_MAX_BIOS (TRIM_MAX_RANGES * 4)
struct trim_request {
uint8_t data[TRIM_MAX_RANGES * 8];
- struct bio *bps[TRIM_MAX_RANGES];
+ struct bio *bps[TRIM_MAX_BIOS];
};
struct ada_softc {
@@ -154,6 +156,86 @@ struct ada_quirk_entry {
static struct ada_quirk_entry ada_quirk_table[] =
{
{
+ /* Hitachi Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Hitachi H??????????E3*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* Samsung Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG HD204UI*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* Seagate Barracuda Green Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST????DL*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* Seagate Momentus Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST9500423AS*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* Seagate Momentus Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST9500424AS*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* Seagate Momentus Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST9750420AS*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* Seagate Momentus Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST9750422AS*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* Seagate Momentus Thin Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST???LT*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* WDC Caviar Green Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD????RS*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* WDC Caviar Green Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD????RX*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* WDC Caviar Green Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD??????RS*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* WDC Caviar Green Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD??????RX*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* WDC Scorpio Black Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD???PKT*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* WDC Scorpio Black Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD?????PKT*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* WDC Scorpio Blue Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD???PVT*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
+ /* WDC Scorpio Blue Advanced Format (4k) drives */
+ { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD?????PVT*", "*" },
+ /*quirks*/ADA_Q_4K
+ },
+ {
/* Default */
{
T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
@@ -730,6 +812,25 @@ adasysctlinit(void *context, int pending)
cam_periph_release(periph);
}
+static int
+adagetattr(struct bio *bp)
+{
+ int ret = -1;
+ struct cam_periph *periph;
+
+ if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL)
+ return ENXIO;
+ periph = (struct cam_periph *)bp->bio_disk->d_drv1;
+ if (periph->path == NULL)
+ return ENXIO;
+
+ ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute,
+ periph->path);
+ if (ret == 0)
+ bp->bio_completed = bp->bio_length;
+ return ret;
+}
+
static cam_status
adaregister(struct cam_periph *periph, void *arg)
{
@@ -740,7 +841,7 @@ adaregister(struct cam_periph *periph, void *arg)
struct disk_params *dp;
caddr_t match;
u_int maxio;
- int legacy_id;
+ int legacy_id, quirks;
cgd = (struct ccb_getdev *)arg;
if (periph == NULL) {
@@ -815,6 +916,11 @@ adaregister(struct cam_periph *periph, void *arg)
*/
(void)cam_periph_hold(periph, PRIBIO);
mtx_unlock(periph->sim->mtx);
+ snprintf(announce_buf, sizeof(announce_buf),
+ "kern.cam.ada.%d.quirks", periph->unit_number);
+ quirks = softc->quirks;
+ TUNABLE_INT_FETCH(announce_buf, &quirks);
+ softc->quirks = quirks;
softc->write_cache = -1;
snprintf(announce_buf, sizeof(announce_buf),
"kern.cam.ada.%d.write_cache", periph->unit_number);
@@ -830,6 +936,7 @@ adaregister(struct cam_periph *periph, void *arg)
softc->disk->d_open = adaopen;
softc->disk->d_close = adaclose;
softc->disk->d_strategy = adastrategy;
+ softc->disk->d_getattr = adagetattr;
softc->disk->d_dump = adadump;
softc->disk->d_name = "ada";
softc->disk->d_drv1 = periph;
@@ -851,8 +958,6 @@ adaregister(struct cam_periph *periph, void *arg)
((softc->flags & ADA_FLAG_CAN_CFA) &&
!(softc->flags & ADA_FLAG_CAN_48BIT)))
softc->disk->d_flags |= DISKFLAG_CANDELETE;
- strlcpy(softc->disk->d_ident, cgd->serial_num,
- MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1));
strlcpy(softc->disk->d_descr, cgd->ident_data.model,
MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model)));
softc->disk->d_hba_vendor = cpi.hba_vendor;
@@ -870,6 +975,9 @@ adaregister(struct cam_periph *periph, void *arg)
softc->disk->d_stripeoffset = (softc->disk->d_stripesize -
ata_logical_sector_offset(&cgd->ident_data)) %
softc->disk->d_stripesize;
+ } else if (softc->quirks & ADA_Q_4K) {
+ softc->disk->d_stripesize = 4096;
+ softc->disk->d_stripeoffset = 0;
}
softc->disk->d_fwsectors = softc->params.secs_per_track;
softc->disk->d_fwheads = softc->params.heads;
@@ -978,7 +1086,8 @@ adastart(struct cam_periph *periph, union ccb *start_ccb)
(bp = bioq_first(&softc->trim_queue)) != 0) {
struct trim_request *req = &softc->trim_req;
struct bio *bp1;
- int bps = 0, ranges = 0;
+ uint64_t lastlba = (uint64_t)-1;
+ int bps = 0, c, lastcount = 0, off, ranges = 0;
softc->trim_running = 1;
bzero(req, sizeof(*req));
@@ -989,10 +1098,22 @@ adastart(struct cam_periph *periph, union ccb *start_ccb)
softc->params.secsize;
bioq_remove(&softc->trim_queue, bp1);
- while (count > 0) {
- int c = min(count, 0xffff);
- int off = ranges * 8;
+ /* Try to extend the previous range. */
+ if (lba == lastlba) {
+ c = min(count, 0xffff - lastcount);
+ lastcount += c;
+ off = (ranges - 1) * 8;
+ req->data[off + 6] = lastcount & 0xff;
+ req->data[off + 7] =
+ (lastcount >> 8) & 0xff;
+ count -= c;
+ lba += c;
+ }
+
+ while (count > 0) {
+ c = min(count, 0xffff);
+ off = ranges * 8;
req->data[off + 0] = lba & 0xff;
req->data[off + 1] = (lba >> 8) & 0xff;
req->data[off + 2] = (lba >> 16) & 0xff;
@@ -1003,11 +1124,14 @@ adastart(struct cam_periph *periph, union ccb *start_ccb)
req->data[off + 7] = (c >> 8) & 0xff;
lba += c;
count -= c;
+ lastcount = c;
ranges++;
}
+ lastlba = lba;
req->bps[bps++] = bp1;
bp1 = bioq_first(&softc->trim_queue);
- if (bp1 == NULL ||
+ if (bps >= TRIM_MAX_BIOS ||
+ bp1 == NULL ||
bp1->bio_bcount / softc->params.secsize >
(softc->trim_max_ranges - ranges) * 0xffff)
break;
@@ -1281,8 +1405,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb)
(struct trim_request *)ataio->data_ptr;
int i;
- for (i = 1; i < softc->trim_max_ranges &&
- req->bps[i]; i++) {
+ for (i = 1; i < TRIM_MAX_BIOS && req->bps[i]; i++) {
struct bio *bp1 = req->bps[i];
bp1->bio_resid = bp->bio_resid;
diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c
index 9e236a4..d02b36f 100644
--- a/sys/cam/ata/ata_xpt.c
+++ b/sys/cam/ata/ata_xpt.c
@@ -1583,12 +1583,14 @@ ata_device_transport(struct cam_path *path)
cts.proto_specific.valid = 0;
if (ident_buf) {
if (path->device->transport == XPORT_ATA) {
- cts.xport_specific.ata.atapi =
+ cts.xport_specific.ata.atapi =
+ (ident_buf->config == ATA_PROTO_CFA) ? 0 :
((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16) ? 16 :
((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12) ? 12 : 0;
cts.xport_specific.ata.valid = CTS_ATA_VALID_ATAPI;
} else {
- cts.xport_specific.sata.atapi =
+ cts.xport_specific.sata.atapi =
+ (ident_buf->config == ATA_PROTO_CFA) ? 0 :
((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16) ? 16 :
((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12) ? 12 : 0;
cts.xport_specific.sata.valid = CTS_SATA_VALID_ATAPI;
@@ -1638,7 +1640,9 @@ ata_action(union ccb *start_ccb)
uint16_t p =
device->ident_data.config & ATA_PROTO_MASK;
- maxlen = (p == ATA_PROTO_ATAPI_16) ? 16 :
+ maxlen =
+ (device->ident_data.config == ATA_PROTO_CFA) ? 0 :
+ (p == ATA_PROTO_ATAPI_16) ? 16 :
(p == ATA_PROTO_ATAPI_12) ? 12 : 0;
}
if (start_ccb->csio.cdb_len > maxlen) {
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h
index 981a5ed..ed2a890 100644
--- a/sys/cam/cam_ccb.h
+++ b/sys/cam/cam_ccb.h
@@ -144,8 +144,8 @@ typedef enum {
/* Device statistics (error counts, etc.) */
XPT_FREEZE_QUEUE = 0x0d,
/* Freeze device queue */
- XPT_GDEV_ADVINFO = 0x0e,
- /* Advanced device information */
+ XPT_DEV_ADVINFO = 0x0e,
+ /* Get/Set Device advanced information */
/* SCSI Control Functions: 0x10->0x1F */
XPT_ABORT = 0x10,
/* Abort the specified CCB */
@@ -391,15 +391,24 @@ typedef enum {
DEV_MATCH_TARGET = 0x002,
DEV_MATCH_LUN = 0x004,
DEV_MATCH_INQUIRY = 0x008,
+ DEV_MATCH_DEVID = 0x010,
DEV_MATCH_ANY = 0x00f
} dev_pattern_flags;
+struct device_id_match_pattern {
+ uint8_t id_len;
+ uint8_t id[256];
+};
+
struct device_match_pattern {
- path_id_t path_id;
- target_id_t target_id;
- lun_id_t target_lun;
- struct scsi_static_inquiry_pattern inq_pat;
- dev_pattern_flags flags;
+ path_id_t path_id;
+ target_id_t target_id;
+ lun_id_t target_lun;
+ dev_pattern_flags flags;
+ union {
+ struct scsi_static_inquiry_pattern inq_pat;
+ struct device_id_match_pattern devid_pat;
+ } data;
};
typedef enum {
@@ -745,6 +754,7 @@ struct ccb_relsim {
* Definitions for the asynchronous callback CCB fields.
*/
typedef enum {
+ AC_ADVINFO_CHANGED = 0x2000,/* Advance info might have changes */
AC_CONTRACT = 0x1000,/* A contractual callback */
AC_GETDEV_CHANGED = 0x800,/* Getdev info might have changed */
AC_INQ_CHANGED = 0x400,/* Inquiry info might have changed */
@@ -1094,19 +1104,20 @@ struct ccb_eng_exec { /* This structure must match SCSIIO size */
#define XPT_CCB_INVALID -1 /* for signaling a bad CCB to free */
/*
- * CCB for getting advanced device information. This operates in a fashion
+ * CCB for working with advanced device information. This operates in a fashion
* similar to XPT_GDEV_TYPE. Specify the target in ccb_h, the buffer
* type requested, and provide a buffer size/buffer to write to. If the
- * buffer is too small, the handler will set GDEVAI_FLAG_MORE.
+ * buffer is too small, provsiz will be larger than bufsiz.
*/
-struct ccb_getdev_advinfo {
+struct ccb_dev_advinfo {
struct ccb_hdr ccb_h;
uint32_t flags;
-#define CGDAI_FLAG_TRANSPORT 0x1
-#define CGDAI_FLAG_PROTO 0x2
+#define CDAI_FLAG_STORE 0x1 /* If set, action becomes store */
uint32_t buftype; /* IN: Type of data being requested */
/* NB: buftype is interpreted on a per-transport basis */
-#define CGDAI_TYPE_SCSI_DEVID 1
+#define CDAI_TYPE_SCSI_DEVID 1
+#define CDAI_TYPE_SERIAL_NUM 2
+#define CDAI_TYPE_PHYS_PATH 3
off_t bufsiz; /* IN: Size of external buffer */
#define CAM_SCSI_DEVID_MAXLEN 65536 /* length in buffer is an uint16_t */
off_t provsiz; /* OUT: Size required/used */
@@ -1151,7 +1162,7 @@ union ccb {
struct ccb_rescan crcn;
struct ccb_debug cdbg;
struct ccb_ataio ataio;
- struct ccb_getdev_advinfo cgdai;
+ struct ccb_dev_advinfo cdai;
};
__BEGIN_DECLS
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index dd51bca..f630772 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/devicestat.h>
#include <sys/bus.h>
+#include <sys/sbuf.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
@@ -303,6 +304,38 @@ cam_periph_find(struct cam_path *path, char *name)
return(NULL);
}
+/*
+ * Find a peripheral structure with the specified path, target, lun,
+ * and (optionally) type. If the name is NULL, this function will return
+ * the first peripheral driver that matches the specified path.
+ */
+int
+cam_periph_list(struct cam_path *path, struct sbuf *sb)
+{
+ struct periph_driver **p_drv;
+ struct cam_periph *periph;
+ int count;
+
+ count = 0;
+ xpt_lock_buses();
+ for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) {
+
+ TAILQ_FOREACH(periph, &(*p_drv)->units, unit_links) {
+ if (xpt_path_comp(periph->path, path) != 0)
+ continue;
+
+ if (sbuf_len(sb) != 0)
+ sbuf_cat(sb, ",");
+
+ sbuf_printf(sb, "%s%d", periph->periph_name,
+ periph->unit_number);
+ count++;
+ }
+ }
+ xpt_unlock_buses();
+ return (count);
+}
+
cam_status
cam_periph_acquire(struct cam_periph *periph)
{
@@ -654,12 +687,12 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
dirs[1] = CAM_DIR_IN;
numbufs = 2;
break;
- case XPT_GDEV_ADVINFO:
- if (ccb->cgdai.bufsiz == 0)
+ case XPT_DEV_ADVINFO:
+ if (ccb->cdai.bufsiz == 0)
return (0);
- data_ptrs[0] = (uint8_t **)&ccb->cgdai.buf;
- lengths[0] = ccb->cgdai.bufsiz;
+ data_ptrs[0] = (uint8_t **)&ccb->cdai.buf;
+ lengths[0] = ccb->cdai.bufsiz;
dirs[0] = CAM_DIR_IN;
numbufs = 1;
@@ -813,9 +846,9 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
data_ptrs[0] = &ccb->smpio.smp_request;
data_ptrs[1] = &ccb->smpio.smp_response;
break;
- case XPT_GDEV_ADVINFO:
+ case XPT_DEV_ADVINFO:
numbufs = min(mapinfo->num_bufs_used, 1);
- data_ptrs[0] = (uint8_t **)&ccb->cgdai.buf;
+ data_ptrs[0] = (uint8_t **)&ccb->cdai.buf;
break;
default:
/* allow ourselves to be swapped once again */
diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h
index 33e9f75..58bfd7b 100644
--- a/sys/cam/cam_periph.h
+++ b/sys/cam/cam_periph.h
@@ -142,6 +142,7 @@ cam_status cam_periph_alloc(periph_ctor_t *periph_ctor,
char *name, cam_periph_type type, struct cam_path *,
ac_callback_t *, ac_code, void *arg);
struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
+int cam_periph_list(struct cam_path *, struct sbuf *);
cam_status cam_periph_acquire(struct cam_periph *periph);
void cam_periph_release(struct cam_periph *periph);
void cam_periph_release_locked(struct cam_periph *periph);
@@ -200,5 +201,12 @@ cam_periph_owned(struct cam_periph *periph)
return (mtx_owned(periph->sim->mtx));
}
+static __inline int
+cam_periph_sleep(struct cam_periph *periph, void *chan, int priority,
+ const char *wmesg, int timo)
+{
+ return (msleep(chan, periph->sim->mtx, priority, wmesg, timo));
+}
+
#endif /* _KERNEL */
#endif /* _CAM_CAM_PERIPH_H */
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 1ce205d..f234076 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -287,9 +287,6 @@ static xpt_targetfunc_t xptdeftargetfunc;
static xpt_devicefunc_t xptdefdevicefunc;
static xpt_periphfunc_t xptdefperiphfunc;
static void xpt_finishconfig_task(void *context, int pending);
-static int xpt_for_all_busses(xpt_busfunc_t *tr_func, void *arg);
-static int xpt_for_all_devices(xpt_devicefunc_t *tr_func,
- void *arg);
static void xpt_dev_async_default(u_int32_t async_code,
struct cam_eb *bus,
struct cam_et *target,
@@ -1105,6 +1102,44 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
periph->unit_number, announce_string);
}
+int
+xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path)
+{
+ int ret = -1;
+ struct ccb_dev_advinfo cdai;
+
+ memset(&cdai, 0, sizeof(cdai));
+ xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL);
+ cdai.ccb_h.func_code = XPT_DEV_ADVINFO;
+ cdai.bufsiz = len;
+
+ if (!strcmp(attr, "GEOM::ident"))
+ cdai.buftype = CDAI_TYPE_SERIAL_NUM;
+ else if (!strcmp(attr, "GEOM::physpath"))
+ cdai.buftype = CDAI_TYPE_PHYS_PATH;
+ else
+ goto out;
+
+ cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO);
+ if (cdai.buf == NULL) {
+ ret = ENOMEM;
+ goto out;
+ }
+ xpt_action((union ccb *)&cdai); /* can only be synchronous */
+ if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0)
+ cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE);
+ if (cdai.provsiz == 0)
+ goto out;
+ ret = 0;
+ if (strlcpy(buf, cdai.buf, len) >= len)
+ ret = EFAULT;
+
+out:
+ if (cdai.buf != NULL)
+ free(cdai.buf, M_CAMXPT);
+ return ret;
+}
+
static dev_match_ret
xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns,
struct cam_eb *bus)
@@ -1241,6 +1276,7 @@ xptdevicematch(struct dev_match_pattern *patterns, u_int num_patterns,
for (i = 0; i < num_patterns; i++) {
struct device_match_pattern *cur_pattern;
+ struct scsi_vpd_device_id *device_id_page;
/*
* If the pattern in question isn't for a device node, we
@@ -1255,22 +1291,17 @@ xptdevicematch(struct dev_match_pattern *patterns, u_int num_patterns,
cur_pattern = &patterns[i].pattern.device_pattern;
+ /* Error out if mutually exclusive options are specified. */
+ if ((cur_pattern->flags & (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID))
+ == (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID))
+ return(DM_RET_ERROR);
+
/*
* If they want to match any device node, we give them any
* device node.
*/
- if (cur_pattern->flags == DEV_MATCH_ANY) {
- /* set the copy flag */
- retval |= DM_RET_COPY;
-
-
- /*
- * If we've already decided on an action, go ahead
- * and return.
- */
- if ((retval & DM_RET_ACTION_MASK) != DM_RET_NONE)
- return(retval);
- }
+ if (cur_pattern->flags == DEV_MATCH_ANY)
+ goto copy_dev_node;
/*
* Not sure why someone would do this...
@@ -1292,11 +1323,22 @@ xptdevicematch(struct dev_match_pattern *patterns, u_int num_patterns,
if (((cur_pattern->flags & DEV_MATCH_INQUIRY) != 0)
&& (cam_quirkmatch((caddr_t)&device->inq_data,
- (caddr_t)&cur_pattern->inq_pat,
- 1, sizeof(cur_pattern->inq_pat),
+ (caddr_t)&cur_pattern->data.inq_pat,
+ 1, sizeof(cur_pattern->data.inq_pat),
scsi_static_inquiry_match) == NULL))
continue;
+ device_id_page = (struct scsi_vpd_device_id *)device->device_id;
+ if (((cur_pattern->flags & DEV_MATCH_DEVID) != 0)
+ && (device->device_id_len < SVPD_DEVICE_ID_HDR_LEN
+ || scsi_devid_match((uint8_t *)device_id_page->desc_list,
+ device->device_id_len
+ - SVPD_DEVICE_ID_HDR_LEN,
+ cur_pattern->data.devid_pat.id,
+ cur_pattern->data.devid_pat.id_len) != 0))
+ continue;
+
+copy_dev_node:
/*
* If we get to this point, the user definitely wants
* information on this device. So tell the caller to copy
@@ -2889,6 +2931,8 @@ xpt_action_default(union ccb *start_ccb)
case XPT_TERM_IO:
case XPT_ENG_INQ:
/* XXX Implement */
+ printf("%s: CCB type %#x not supported\n", __func__,
+ start_ccb->ccb_h.func_code);
start_ccb->ccb_h.status = CAM_PROVIDE_FAIL;
if (start_ccb->ccb_h.func_code & XPT_FC_DEV_QUEUED) {
xpt_done(start_ccb);
@@ -3528,16 +3572,12 @@ xpt_path_string(struct cam_path *path, char *str, size_t str_len)
path_id_t
xpt_path_path_id(struct cam_path *path)
{
- mtx_assert(path->bus->sim->mtx, MA_OWNED);
-
return(path->bus->path_id);
}
target_id_t
xpt_path_target_id(struct cam_path *path)
{
- mtx_assert(path->bus->sim->mtx, MA_OWNED);
-
if (path->target != NULL)
return (path->target->target_id);
else
@@ -3547,8 +3587,6 @@ xpt_path_target_id(struct cam_path *path)
lun_id_t
xpt_path_lun_id(struct cam_path *path)
{
- mtx_assert(path->bus->sim->mtx, MA_OWNED);
-
if (path->device != NULL)
return (path->device->lun_id);
else
@@ -4242,7 +4280,8 @@ xpt_alloc_target(struct cam_eb *bus, target_id_t target_id)
{
struct cam_et *target;
- target = (struct cam_et *)malloc(sizeof(*target), M_CAMXPT, M_NOWAIT);
+ target = (struct cam_et *)malloc(sizeof(*target), M_CAMXPT,
+ M_NOWAIT|M_ZERO);
if (target != NULL) {
struct cam_et *cur_target;
@@ -4330,7 +4369,7 @@ xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
device = NULL;
} else {
device = (struct cam_ed *)malloc(sizeof(*device),
- M_CAMXPT, M_NOWAIT);
+ M_CAMXPT, M_NOWAIT|M_ZERO);
}
if (device != NULL) {
@@ -4676,27 +4715,29 @@ xpt_register_async(int event, ac_callback_t *cbfunc, void *cbarg,
csa.callback_arg = cbarg;
xpt_action((union ccb *)&csa);
status = csa.ccb_h.status;
+
if (xptpath) {
xpt_free_path(path);
mtx_unlock(&xsoftc.xpt_lock);
+ }
- if ((status == CAM_REQ_CMP) &&
- (csa.event_enable & AC_FOUND_DEVICE)) {
- /*
- * Get this peripheral up to date with all
- * the currently existing devices.
- */
- xpt_for_all_devices(xptsetasyncfunc, &csa);
- }
- if ((status == CAM_REQ_CMP) &&
- (csa.event_enable & AC_PATH_REGISTERED)) {
- /*
- * Get this peripheral up to date with all
- * the currently existing busses.
- */
- xpt_for_all_busses(xptsetasyncbusfunc, &csa);
- }
+ if ((status == CAM_REQ_CMP) &&
+ (csa.event_enable & AC_FOUND_DEVICE)) {
+ /*
+ * Get this peripheral up to date with all
+ * the currently existing devices.
+ */
+ xpt_for_all_devices(xptsetasyncfunc, &csa);
}
+ if ((status == CAM_REQ_CMP) &&
+ (csa.event_enable & AC_PATH_REGISTERED)) {
+ /*
+ * Get this peripheral up to date with all
+ * the currently existing busses.
+ */
+ xpt_for_all_busses(xptsetasyncbusfunc, &csa);
+ }
+
return (status);
}
@@ -4852,8 +4893,10 @@ camisr_runqueue(void *V_queue)
if ((dev->flags & CAM_DEV_TAG_AFTER_COUNT) != 0
&& (--dev->tag_delay_count == 0))
xpt_start_tags(ccb_h->path);
- if (!device_is_send_queued(dev))
- xpt_schedule_dev_sendq(ccb_h->path->bus, dev);
+ if (!device_is_send_queued(dev)) {
+ runq = xpt_schedule_dev_sendq(ccb_h->path->bus,
+ dev);
+ }
}
if (ccb_h->status & CAM_RELEASE_SIMQ) {
diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h
index 9355be4..f7d9b42 100644
--- a/sys/cam/cam_xpt.h
+++ b/sys/cam/cam_xpt.h
@@ -103,6 +103,8 @@ cam_status xpt_create_path_unlocked(struct cam_path **new_path_ptr,
struct cam_periph *perph,
path_id_t path_id,
target_id_t target_id, lun_id_t lun_id);
+int xpt_getattr(char *buf, size_t len, const char *attr,
+ struct cam_path *path);
void xpt_free_path(struct cam_path *path);
int xpt_path_comp(struct cam_path *path1,
struct cam_path *path2);
diff --git a/sys/cam/cam_xpt_internal.h b/sys/cam/cam_xpt_internal.h
index f485e37..b6e8f66 100644
--- a/sys/cam/cam_xpt_internal.h
+++ b/sys/cam/cam_xpt_internal.h
@@ -97,6 +97,8 @@ struct cam_ed {
uint8_t supported_vpds_len;
uint32_t device_id_len;
uint8_t *device_id;
+ uint8_t physpath_len;
+ uint8_t *physpath; /* physical path string form */
struct ata_params ident_data;
u_int8_t inq_flags; /*
* Current settings for inquiry flags.
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c
index 7ededa1..7361c42 100644
--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -3552,32 +3552,63 @@ scsi_calc_syncparam(u_int period)
return (period/400);
}
-uint8_t *
-scsi_get_sas_addr(struct scsi_vpd_device_id *id, uint32_t len)
+int
+scsi_devid_is_naa_ieee_reg(uint8_t *bufp)
{
- uint8_t *bufp, *buf_end;
struct scsi_vpd_id_descriptor *descr;
struct scsi_vpd_id_naa_basic *naa;
- bufp = buf_end = (uint8_t *)id;
- bufp += SVPD_DEVICE_ID_HDR_LEN;
- buf_end += len;
- while (bufp < buf_end) {
- descr = (struct scsi_vpd_id_descriptor *)bufp;
- bufp += SVPD_DEVICE_ID_DESC_HDR_LEN;
- /* Right now, we only care about SAS NAA IEEE Reg addrs */
- if (((descr->id_type & SVPD_ID_PIV) != 0)
- && (descr->proto_codeset >> SVPD_ID_PROTO_SHIFT) ==
- SCSI_PROTO_SAS
- && (descr->id_type & SVPD_ID_TYPE_MASK) == SVPD_ID_TYPE_NAA){
- naa = (struct scsi_vpd_id_naa_basic *)bufp;
- if ((naa->naa >> 4) == SVPD_ID_NAA_IEEE_REG)
- return bufp;
- }
- bufp += descr->length;
+ descr = (struct scsi_vpd_id_descriptor *)bufp;
+ naa = (struct scsi_vpd_id_naa_basic *)descr->identifier;
+ if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_NAA)
+ return 0;
+ if (descr->length < sizeof(struct scsi_vpd_id_naa_ieee_reg))
+ return 0;
+ if ((naa->naa >> SVPD_ID_NAA_NAA_SHIFT) != SVPD_ID_NAA_IEEE_REG)
+ return 0;
+ return 1;
+}
+
+int
+scsi_devid_is_sas_target(uint8_t *bufp)
+{
+ struct scsi_vpd_id_descriptor *descr;
+
+ descr = (struct scsi_vpd_id_descriptor *)bufp;
+ if (!scsi_devid_is_naa_ieee_reg(bufp))
+ return 0;
+ if ((descr->id_type & SVPD_ID_PIV) == 0) /* proto field reserved */
+ return 0;
+ if ((descr->proto_codeset >> SVPD_ID_PROTO_SHIFT) != SCSI_PROTO_SAS)
+ return 0;
+ return 1;
+}
+
+uint8_t *
+scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t page_len,
+ scsi_devid_checkfn_t ck_fn)
+{
+ struct scsi_vpd_id_descriptor *desc;
+ uint8_t *page_end;
+ uint8_t *desc_buf_end;
+
+ page_end = (uint8_t *)id + page_len;
+ if (page_end < id->desc_list)
+ return (NULL);
+
+ desc_buf_end = MIN(id->desc_list + scsi_2btoul(id->length), page_end);
+
+ for (desc = (struct scsi_vpd_id_descriptor *)id->desc_list;
+ desc->identifier <= desc_buf_end
+ && desc->identifier + desc->length <= desc_buf_end;
+ desc = (struct scsi_vpd_id_descriptor *)(desc->identifier
+ + desc->length)) {
+
+ if (ck_fn == NULL || ck_fn((uint8_t *)desc) != 0)
+ return (desc->identifier);
}
- return NULL;
+ return (NULL);
}
void
@@ -4174,6 +4205,77 @@ scsi_read_write(struct ccb_scsiio *csio, u_int32_t retries,
timeout);
}
+void
+scsi_receive_diagnostic_results(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb*),
+ uint8_t tag_action, int pcv, uint8_t page_code,
+ uint8_t *data_ptr, uint16_t allocation_length,
+ uint8_t sense_len, uint32_t timeout)
+{
+ struct scsi_receive_diag *scsi_cmd;
+
+ scsi_cmd = (struct scsi_receive_diag *)&csio->cdb_io.cdb_bytes;
+ memset(scsi_cmd, 0, sizeof(*scsi_cmd));
+ scsi_cmd->opcode = RECEIVE_DIAGNOSTIC;
+ if (pcv) {
+ scsi_cmd->byte2 |= SRD_PCV;
+ scsi_cmd->page_code = page_code;
+ }
+ scsi_ulto2b(allocation_length, scsi_cmd->length);
+
+ cam_fill_csio(csio,
+ retries,
+ cbfcnp,
+ /*flags*/CAM_DIR_IN,
+ tag_action,
+ data_ptr,
+ allocation_length,
+ sense_len,
+ sizeof(*scsi_cmd),
+ timeout);
+}
+
+void
+scsi_send_diagnostic(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ uint8_t tag_action, int unit_offline, int device_offline,
+ int self_test, int page_format, int self_test_code,
+ uint8_t *data_ptr, uint16_t param_list_length,
+ uint8_t sense_len, uint32_t timeout)
+{
+ struct scsi_send_diag *scsi_cmd;
+
+ scsi_cmd = (struct scsi_send_diag *)&csio->cdb_io.cdb_bytes;
+ memset(scsi_cmd, 0, sizeof(*scsi_cmd));
+ scsi_cmd->opcode = SEND_DIAGNOSTIC;
+
+ /*
+ * The default self-test mode control and specific test
+ * control are mutually exclusive.
+ */
+ if (self_test)
+ self_test_code = SSD_SELF_TEST_CODE_NONE;
+
+ scsi_cmd->byte2 = ((self_test_code << SSD_SELF_TEST_CODE_SHIFT)
+ & SSD_SELF_TEST_CODE_MASK)
+ | (unit_offline ? SSD_UNITOFFL : 0)
+ | (device_offline ? SSD_DEVOFFL : 0)
+ | (self_test ? SSD_SELFTEST : 0)
+ | (page_format ? SSD_PF : 0);
+ scsi_ulto2b(param_list_length, scsi_cmd->length);
+
+ cam_fill_csio(csio,
+ retries,
+ cbfcnp,
+ /*flags*/param_list_length ? CAM_DIR_OUT : CAM_DIR_NONE,
+ tag_action,
+ data_ptr,
+ param_list_length,
+ sense_len,
+ sizeof(*scsi_cmd),
+ timeout);
+}
+
void
scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
@@ -4206,7 +4308,6 @@ scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries,
sense_len,
sizeof(*scsi_cmd),
timeout);
-
}
@@ -4264,6 +4365,66 @@ scsi_static_inquiry_match(caddr_t inqbuffer, caddr_t table_entry)
return (-1);
}
+/**
+ * Compare two buffers of vpd device descriptors for a match.
+ *
+ * \param lhs Pointer to first buffer of descriptors to compare.
+ * \param lhs_len The length of the first buffer.
+ * \param rhs Pointer to second buffer of descriptors to compare.
+ * \param rhs_len The length of the second buffer.
+ *
+ * \return 0 on a match, -1 otherwise.
+ *
+ * Treat rhs and lhs as arrays of vpd device id descriptors. Walk lhs matching
+ * agains each element in rhs until all data are exhausted or we have found
+ * a match.
+ */
+int
+scsi_devid_match(uint8_t *lhs, size_t lhs_len, uint8_t *rhs, size_t rhs_len)
+{
+ struct scsi_vpd_id_descriptor *lhs_id;
+ struct scsi_vpd_id_descriptor *lhs_last;
+ struct scsi_vpd_id_descriptor *rhs_last;
+ uint8_t *lhs_end;
+ uint8_t *rhs_end;
+
+ lhs_end = lhs + lhs_len;
+ rhs_end = rhs + rhs_len;
+
+ /*
+ * rhs_last and lhs_last are the last posible position of a valid
+ * descriptor assuming it had a zero length identifier. We use
+ * these variables to insure we can safely dereference the length
+ * field in our loop termination tests.
+ */
+ lhs_last = (struct scsi_vpd_id_descriptor *)
+ (lhs_end - __offsetof(struct scsi_vpd_id_descriptor, identifier));
+ rhs_last = (struct scsi_vpd_id_descriptor *)
+ (rhs_end - __offsetof(struct scsi_vpd_id_descriptor, identifier));
+
+ lhs_id = (struct scsi_vpd_id_descriptor *)lhs;
+ while (lhs_id <= lhs_last
+ && (lhs_id->identifier + lhs_id->length) <= lhs_end) {
+ struct scsi_vpd_id_descriptor *rhs_id;
+
+ rhs_id = (struct scsi_vpd_id_descriptor *)rhs;
+ while (rhs_id <= rhs_last
+ && (rhs_id->identifier + rhs_id->length) <= rhs_end) {
+
+ if (rhs_id->length == lhs_id->length
+ && memcmp(rhs_id->identifier, lhs_id->identifier,
+ rhs_id->length) == 0)
+ return (0);
+
+ rhs_id = (struct scsi_vpd_id_descriptor *)
+ (rhs_id->identifier + rhs_id->length);
+ }
+ lhs_id = (struct scsi_vpd_id_descriptor *)
+ (lhs_id->identifier + lhs_id->length);
+ }
+ return (-1);
+}
+
#ifdef _KERNEL
static void
init_scsi_delay(void)
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index 0a7a58f..93b11d5 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -115,6 +115,7 @@ struct scsi_request_sense
{
u_int8_t opcode;
u_int8_t byte2;
+#define SRS_DESC 0x01
u_int8_t unused[2];
u_int8_t length;
u_int8_t control;
@@ -128,17 +129,33 @@ struct scsi_test_unit_ready
u_int8_t control;
};
-struct scsi_send_diag
-{
- u_int8_t opcode;
- u_int8_t byte2;
-#define SSD_UOL 0x01
-#define SSD_DOL 0x02
-#define SSD_SELFTEST 0x04
-#define SSD_PF 0x10
- u_int8_t unused[1];
- u_int8_t paramlen[2];
- u_int8_t control;
+struct scsi_receive_diag {
+ uint8_t opcode;
+ uint8_t byte2;
+#define SRD_PCV 0x01
+ uint8_t page_code;
+ uint8_t length[2];
+ uint8_t control;
+};
+
+struct scsi_send_diag {
+ uint8_t opcode;
+ uint8_t byte2;
+#define SSD_UNITOFFL 0x01
+#define SSD_DEVOFFL 0x02
+#define SSD_SELFTEST 0x04
+#define SSD_PF 0x10
+#define SSD_SELF_TEST_CODE_MASK 0xE0
+#define SSD_SELF_TEST_CODE_SHIFT 5
+#define SSD_SELF_TEST_CODE_NONE 0x00
+#define SSD_SELF_TEST_CODE_BG_SHORT 0x01
+#define SSD_SELF_TEST_CODE_BG_EXTENDED 0x02
+#define SSD_SELF_TEST_CODE_BG_ABORT 0x04
+#define SSD_SELF_TEST_CODE_FG_SHORT 0x05
+#define SSD_SELF_TEST_CODE_FG_EXTENDED 0x06
+ uint8_t reserved;
+ uint8_t length[2];
+ uint8_t control;
};
struct scsi_sense
@@ -894,11 +911,12 @@ struct scsi_vpd_id_naa_basic
uint8_t naa : 4;
uint8_t naa_desig : 4;
*/
+#define SVPD_ID_NAA_NAA_SHIFT 4
#define SVPD_ID_NAA_IEEE_EXT 0x02
#define SVPD_ID_NAA_LOCAL_REG 0x03
#define SVPD_ID_NAA_IEEE_REG 0x05
#define SVPD_ID_NAA_IEEE_REG_EXT 0x06
- uint8_t naa_data[0];
+ uint8_t naa_data[];
};
struct scsi_vpd_id_naa_ieee_extended_id
@@ -1322,7 +1340,12 @@ void scsi_print_inquiry(struct scsi_inquiry_data *inq_data);
u_int scsi_calc_syncsrate(u_int period_factor);
u_int scsi_calc_syncparam(u_int period);
-uint8_t * scsi_get_sas_addr(struct scsi_vpd_device_id *id, uint32_t len);
+
+typedef int (*scsi_devid_checkfn_t)(uint8_t *);
+int scsi_devid_is_naa_ieee_reg(uint8_t *bufp);
+int scsi_devid_is_sas_target(uint8_t *bufp);
+uint8_t * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len,
+ scsi_devid_checkfn_t ck_fn);
void scsi_test_unit_ready(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *,
@@ -1439,6 +1462,22 @@ void scsi_synchronize_cache(struct ccb_scsiio *csio,
u_int32_t begin_lba, u_int16_t lb_count,
u_int8_t sense_len, u_int32_t timeout);
+void scsi_receive_diagnostic_results(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *,
+ union ccb*),
+ uint8_t tag_action, int pcv,
+ uint8_t page_code, uint8_t *data_ptr,
+ uint16_t allocation_length,
+ uint8_t sense_len, uint32_t timeout);
+
+void scsi_send_diagnostic(struct ccb_scsiio *csio, u_int32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ uint8_t tag_action, int unit_offline,
+ int device_offline, int self_test, int page_format,
+ int self_test_code, uint8_t *data_ptr,
+ uint16_t param_list_length, uint8_t sense_len,
+ uint32_t timeout);
+
void scsi_read_write(struct ccb_scsiio *csio, u_int32_t retries,
void (*cbfcnp)(struct cam_periph *, union ccb *),
u_int8_t tag_action, int readop, u_int8_t byte2,
@@ -1455,6 +1494,8 @@ void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries,
int scsi_inquiry_match(caddr_t inqbuffer, caddr_t table_entry);
int scsi_static_inquiry_match(caddr_t inqbuffer,
caddr_t table_entry);
+int scsi_devid_match(uint8_t *rhs, size_t rhs_len,
+ uint8_t *lhs, size_t lhs_len);
static __inline void scsi_extract_sense(struct scsi_sense_data *sense,
int *error_code, int *sense_key,
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 9729878..a436318 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/eventhandler.h>
#include <sys/malloc.h>
#include <sys/cons.h>
+#include <geom/geom.h>
#include <geom/geom_disk.h>
#endif /* _KERNEL */
@@ -727,7 +728,8 @@ daclose(struct disk *dp)
softc = (struct da_softc *)periph->softc;
- if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) {
+ if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0
+ && (softc->flags & DA_FLAG_PACK_INVALID) == 0) {
union ccb *ccb;
ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
@@ -932,6 +934,25 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng
return (0);
}
+static int
+dagetattr(struct bio *bp)
+{
+ int ret = -1;
+ struct cam_periph *periph;
+
+ if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL)
+ return ENXIO;
+ periph = (struct cam_periph *)bp->bio_disk->d_drv1;
+ if (periph->path == NULL)
+ return ENXIO;
+
+ ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute,
+ periph->path);
+ if (ret == 0)
+ bp->bio_completed = bp->bio_length;
+ return ret;
+}
+
static void
dainit(void)
{
@@ -977,7 +998,8 @@ daoninvalidate(struct cam_periph *periph)
bioq_flush(&softc->bio_queue, NULL, ENXIO);
disk_gone(softc->disk);
- xpt_print(periph->path, "lost device\n");
+ xpt_print(periph->path, "lost device - %d outstanding\n",
+ softc->outstanding_cmds);
}
static void
@@ -1044,6 +1066,20 @@ daasync(void *callback_arg, u_int32_t code,
&& status != CAM_REQ_INPROG)
printf("daasync: Unable to attach to new device "
"due to status 0x%x\n", status);
+ return;
+ }
+ case AC_ADVINFO_CHANGED:
+ {
+ uintptr_t buftype;
+
+ buftype = (uintptr_t)arg;
+ if (buftype == CDAI_TYPE_PHYS_PATH) {
+ struct da_softc *softc;
+
+ softc = periph->softc;
+ disk_attr_changed(softc->disk, "GEOM::physpath",
+ M_NOWAIT);
+ }
break;
}
case AC_SENT_BDR:
@@ -1060,12 +1096,12 @@ daasync(void *callback_arg, u_int32_t code,
softc->flags |= DA_FLAG_RETRY_UA;
LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le)
ccbh->ccb_state |= DA_CCB_RETRY_UA;
- /* FALLTHROUGH*/
+ break;
}
default:
- cam_periph_async(periph, code, path, arg);
break;
}
+ cam_periph_async(periph, code, path, arg);
}
static void
@@ -1231,17 +1267,6 @@ daregister(struct cam_periph *periph, void *arg)
TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph);
/*
- * Add async callbacks for bus reset and
- * bus device reset calls. I don't bother
- * checking if this fails as, in most cases,
- * the system will function just fine without
- * them and the only alternative would be to
- * not attach the device on failure.
- */
- xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE,
- daasync, periph, periph->path);
-
- /*
* Take an exclusive refcount on the periph while dastart is called
* to finish the probe. The reference will be dropped in dadone at
* the end of probe.
@@ -1301,6 +1326,7 @@ daregister(struct cam_periph *periph, void *arg)
softc->disk->d_close = daclose;
softc->disk->d_strategy = dastrategy;
softc->disk->d_dump = dadump;
+ softc->disk->d_getattr = dagetattr;
softc->disk->d_name = "da";
softc->disk->d_drv1 = periph;
if (cpi.maxio == 0)
@@ -1313,8 +1339,6 @@ daregister(struct cam_periph *periph, void *arg)
softc->disk->d_flags = 0;
if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0)
softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE;
- strlcpy(softc->disk->d_ident, cgd->serial_num,
- MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1));
cam_strvis(softc->disk->d_descr, cgd->inq_data.vendor,
sizeof(cgd->inq_data.vendor), sizeof(softc->disk->d_descr));
strlcat(softc->disk->d_descr, " ", sizeof(softc->disk->d_descr));
@@ -1328,6 +1352,25 @@ daregister(struct cam_periph *periph, void *arg)
disk_create(softc->disk, DISK_VERSION);
mtx_lock(periph->sim->mtx);
+ /*
+ * Add async callbacks for events of interest.
+ * I don't bother checking if this fails as,
+ * in most cases, the system will function just
+ * fine without them and the only alternative
+ * would be to not attach the device on failure.
+ */
+ xpt_register_async(AC_SENT_BDR | AC_BUS_RESET
+ | AC_LOST_DEVICE | AC_ADVINFO_CHANGED,
+ daasync, periph, periph->path);
+
+ /*
+ * Emit an attribute changed notification just in case
+ * physical path information arrived before our async
+ * event handler was registered, but after anyone attaching
+ * to our disk device polled it.
+ */
+ disk_attr_changed(softc->disk, "GEOM::physpath", M_NOWAIT);
+
xpt_schedule(periph, CAM_PRIORITY_DEV);
return(CAM_REQ_CMP);
@@ -1558,7 +1601,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
int error;
int sf;
-
+
if ((csio->ccb_h.ccb_state & DA_CCB_RETRY_UA) != 0)
sf = SF_RETRY_UA;
else
@@ -1573,8 +1616,17 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
return;
}
if (error != 0) {
+ int queued_error;
+
+ /*
+ * return all queued I/O with EIO, so that
+ * the client can retry these I/Os in the
+ * proper order should it attempt to recover.
+ */
+ queued_error = EIO;
- if (error == ENXIO) {
+ if (error == ENXIO
+ && (softc->flags & DA_FLAG_PACK_INVALID)== 0) {
/*
* Catastrophic error. Mark our pack as
* invalid.
@@ -1586,14 +1638,10 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
xpt_print(periph->path,
"Invalidating pack\n");
softc->flags |= DA_FLAG_PACK_INVALID;
+ queued_error = ENXIO;
}
-
- /*
- * return all queued I/O with EIO, so that
- * the client can retry these I/Os in the
- * proper order should it attempt to recover.
- */
- bioq_flush(&softc->bio_queue, NULL, EIO);
+ bioq_flush(&softc->bio_queue, NULL,
+ queued_error);
bp->bio_error = error;
bp->bio_resid = bp->bio_bcount;
bp->bio_flags |= BIO_ERROR;
@@ -1626,6 +1674,11 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
if (softc->outstanding_cmds == 0)
softc->flags |= DA_FLAG_WENT_IDLE;
+ if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) {
+ xpt_print(periph->path, "oustanding %d\n",
+ softc->outstanding_cmds);
+ }
+
biodone(bp);
break;
}
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index e7ecb35..a124468 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/errno.h>
#include <sys/devicestat.h>
#include <sys/proc.h>
+#include <sys/taskqueue.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
@@ -70,12 +71,14 @@ typedef enum {
#define ccb_bp ppriv_ptr1
struct pass_softc {
- pass_state state;
- pass_flags flags;
- u_int8_t pd_type;
- union ccb saved_ccb;
- struct devstat *device_stats;
- struct cdev *dev;
+ pass_state state;
+ pass_flags flags;
+ u_int8_t pd_type;
+ union ccb saved_ccb;
+ struct devstat *device_stats;
+ struct cdev *dev;
+ struct cdev *alias_dev;
+ struct task add_physpath_task;
};
@@ -88,6 +91,7 @@ static periph_ctor_t passregister;
static periph_oninv_t passoninvalidate;
static periph_dtor_t passcleanup;
static periph_start_t passstart;
+static void pass_add_physpath(void *context, int pending);
static void passasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
static void passdone(struct cam_periph *periph,
@@ -168,17 +172,45 @@ passcleanup(struct cam_periph *periph)
if (bootverbose)
xpt_print(periph->path, "removing device entry\n");
devstat_remove_entry(softc->device_stats);
+
cam_periph_unlock(periph);
+ taskqueue_drain(taskqueue_thread, &softc->add_physpath_task);
+
/*
* passcleanup() is indirectly a d_close method via passclose,
* so using destroy_dev(9) directly can result in deadlock.
*/
destroy_dev_sched(softc->dev);
cam_periph_lock(periph);
+
free(softc, M_DEVBUF);
}
static void
+pass_add_physpath(void *context, int pending)
+{
+ struct cam_periph *periph;
+ struct pass_softc *softc;
+ char *physpath;
+
+ /*
+ * If we have one, create a devfs alias for our
+ * physical path.
+ */
+ periph = context;
+ softc = periph->softc;
+ physpath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK);
+ if (xpt_getattr(physpath, MAXPATHLEN,
+ "GEOM::physpath", periph->path) == 0
+ && strlen(physpath) != 0) {
+
+ make_dev_physpath_alias(MAKEDEV_WAITOK, &softc->alias_dev,
+ softc->dev, softc->alias_dev, physpath);
+ }
+ free(physpath, M_DEVBUF);
+}
+
+static void
passasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg)
{
@@ -219,6 +251,20 @@ passasync(void *callback_arg, u_int32_t code,
break;
}
+ case AC_ADVINFO_CHANGED:
+ {
+ uintptr_t buftype;
+
+ buftype = (uintptr_t)arg;
+ if (buftype == CDAI_TYPE_PHYS_PATH) {
+ struct pass_softc *softc;
+
+ softc = (struct pass_softc *)periph->softc;
+ taskqueue_enqueue(taskqueue_thread,
+ &softc->add_physpath_task);
+ }
+ break;
+ }
default:
cam_periph_async(periph, code, path, arg);
break;
@@ -292,11 +338,22 @@ passregister(struct cam_periph *periph, void *arg)
mtx_lock(periph->sim->mtx);
softc->dev->si_drv1 = periph;
+ TASK_INIT(&softc->add_physpath_task, /*priority*/0,
+ pass_add_physpath, periph);
+
+ /*
+ * See if physical path information is already available.
+ */
+ taskqueue_enqueue(taskqueue_thread, &softc->add_physpath_task);
+
/*
- * Add an async callback so that we get
- * notified if this device goes away.
+ * Add an async callback so that we get notified if
+ * this device goes away or its physical path
+ * (stored in the advanced info data of the EDT) has
+ * changed.
*/
- xpt_register_async(AC_LOST_DEVICE, passasync, periph, periph->path);
+ xpt_register_async(AC_LOST_DEVICE | AC_ADVINFO_CHANGED,
+ passasync, periph, periph->path);
if (bootverbose)
xpt_announce_periph(periph, NULL);
@@ -548,8 +605,8 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb)
&& ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE))
|| (ccb->ccb_h.func_code == XPT_DEV_MATCH)
|| (ccb->ccb_h.func_code == XPT_SMP_IO)
- || ((ccb->ccb_h.func_code == XPT_GDEV_ADVINFO)
- && (ccb->cgdai.bufsiz > 0)))) {
+ || ((ccb->ccb_h.func_code == XPT_DEV_ADVINFO)
+ && (ccb->cdai.bufsiz > 0)))) {
bzero(&mapinfo, sizeof(mapinfo));
diff --git a/sys/cam/scsi/scsi_ses.h b/sys/cam/scsi/scsi_ses.h
index 9925c1f..a52d517 100644
--- a/sys/cam/scsi/scsi_ses.h
+++ b/sys/cam/scsi/scsi_ses.h
@@ -101,6 +101,7 @@ typedef struct {
#define SESTYP_UPS 0x0b
#define SESTYP_DISPLAY 0x0c
#define SESTYP_KEYPAD 0x0d
+#define SESTYP_ENCLOSURE 0x0e
#define SESTYP_SCSIXVR 0x0f
#define SESTYP_LANGUAGE 0x10
#define SESTYP_COMPORT 0x11
@@ -109,6 +110,9 @@ typedef struct {
#define SESTYP_SCSI_TGT 0x14
#define SESTYP_SCSI_INI 0x15
#define SESTYP_SUBENC 0x16
+#define SESTYP_ARRAY 0x17
+#define SESTYP_SASEXPANDER 0x18
+#define SESTYP_SASCONNECTOR 0x19
/*
* Overall Enclosure Status
diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c
index 2a38128..1b507ca 100644
--- a/sys/cam/scsi/scsi_xpt.c
+++ b/sys/cam/scsi/scsi_xpt.c
@@ -542,6 +542,7 @@ static const int scsi_quirk_table_size =
static cam_status proberegister(struct cam_periph *periph,
void *arg);
static void probeschedule(struct cam_periph *probe_periph);
+static int device_has_vpd(struct cam_ed *device, uint8_t page_id);
static void probestart(struct cam_periph *periph, union ccb *start_ccb);
static void proberequestdefaultnegotiation(struct cam_periph *periph);
static int proberequestbackoff(struct cam_periph *periph,
@@ -1460,7 +1461,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
path->device->device_id = (uint8_t *)devid;
}
} else if (cam_periph_error(done_ccb, 0,
- SF_RETRY_UA|SF_NO_PRINT,
+ SF_RETRY_UA,
&softc->saved_ccb) == ERESTART) {
return;
} else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) {
@@ -1506,9 +1507,9 @@ probe_device_check:
(u_int8_t *)malloc((serial_buf->length + 1),
M_CAMXPT, M_NOWAIT);
if (path->device->serial_num != NULL) {
- bcopy(serial_buf->serial_num,
- path->device->serial_num,
- serial_buf->length);
+ memcpy(path->device->serial_num,
+ serial_buf->serial_num,
+ serial_buf->length);
path->device->serial_num_len =
serial_buf->length;
path->device->serial_num[serial_buf->length]
@@ -2433,28 +2434,77 @@ scsi_devise_transport(struct cam_path *path)
}
static void
-scsi_getdev_advinfo(union ccb *start_ccb)
+scsi_dev_advinfo(union ccb *start_ccb)
{
struct cam_ed *device;
- struct ccb_getdev_advinfo *cgdai;
+ struct ccb_dev_advinfo *cdai;
off_t amt;
device = start_ccb->ccb_h.path->device;
- cgdai = &start_ccb->cgdai;
- switch(cgdai->buftype) {
- case CGDAI_TYPE_SCSI_DEVID:
- cgdai->provsiz = device->device_id_len;
+ cdai = &start_ccb->cdai;
+ switch(cdai->buftype) {
+ case CDAI_TYPE_SCSI_DEVID:
+ if (cdai->flags & CDAI_FLAG_STORE)
+ break;
+ cdai->provsiz = device->device_id_len;
if (device->device_id_len == 0)
break;
amt = device->device_id_len;
- if (cgdai->provsiz > cgdai->bufsiz)
- amt = cgdai->bufsiz;
- bcopy(device->device_id, cgdai->buf, amt);
+ if (cdai->provsiz > cdai->bufsiz)
+ amt = cdai->bufsiz;
+ memcpy(cdai->buf, device->device_id, amt);
+ break;
+ case CDAI_TYPE_SERIAL_NUM:
+ if (cdai->flags & CDAI_FLAG_STORE)
+ break;
+ cdai->provsiz = device->serial_num_len;
+ if (device->serial_num_len == 0)
+ break;
+ amt = device->serial_num_len;
+ if (cdai->provsiz > cdai->bufsiz)
+ amt = cdai->bufsiz;
+ memcpy(cdai->buf, device->serial_num, amt);
+ break;
+ case CDAI_TYPE_PHYS_PATH:
+ if (cdai->flags & CDAI_FLAG_STORE) {
+ if (device->physpath != NULL)
+ free(device->physpath, M_CAMXPT);
+ device->physpath_len = cdai->bufsiz;
+ /* Clear existing buffer if zero length */
+ if (cdai->bufsiz == 0)
+ break;
+ device->physpath = malloc(cdai->bufsiz, M_CAMXPT, M_NOWAIT);
+ if (device->physpath == NULL) {
+ start_ccb->ccb_h.status = CAM_REQ_ABORTED;
+ return;
+ }
+ memcpy(device->physpath, cdai->buf, cdai->bufsiz);
+ } else {
+ cdai->provsiz = device->physpath_len;
+ if (device->physpath_len == 0)
+ break;
+ amt = device->physpath_len;
+ if (cdai->provsiz > cdai->bufsiz)
+ amt = cdai->bufsiz;
+ memcpy(cdai->buf, device->physpath, amt);
+ }
break;
default:
break;
}
start_ccb->ccb_h.status = CAM_REQ_CMP;
+
+ if (cdai->flags & CDAI_FLAG_STORE) {
+ int owned;
+
+ owned = mtx_owned(start_ccb->ccb_h.path->bus->sim->mtx);
+ if (owned == 0)
+ mtx_lock(start_ccb->ccb_h.path->bus->sim->mtx);
+ xpt_async(AC_ADVINFO_CHANGED, start_ccb->ccb_h.path,
+ (void *)(uintptr_t)cdai->buftype);
+ if (owned == 0)
+ mtx_unlock(start_ccb->ccb_h.path->bus->sim->mtx);
+ }
}
static void
@@ -2486,9 +2536,9 @@ scsi_action(union ccb *start_ccb)
(*(sim->sim_action))(sim, start_ccb);
break;
}
- case XPT_GDEV_ADVINFO:
+ case XPT_DEV_ADVINFO:
{
- scsi_getdev_advinfo(start_ccb);
+ scsi_dev_advinfo(start_ccb);
break;
}
default:
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris.c b/sys/cddl/compat/opensolaris/kern/opensolaris.c
index 54118eb..640b2f3 100644
--- a/sys/cddl/compat/opensolaris/kern/opensolaris.c
+++ b/sys/cddl/compat/opensolaris/kern/opensolaris.c
@@ -40,6 +40,7 @@
cpu_core_t cpu_core[MAXCPU];
kmutex_t cpu_lock;
solaris_cpu_t solaris_cpu[MAXCPU];
+int nsec_per_tick;
/*
* OpenSolaris subsystem initialisation.
@@ -60,6 +61,8 @@ opensolaris_load(void *dummy)
}
mutex_init(&cpu_lock, "OpenSolaris CPU lock", MUTEX_DEFAULT, NULL);
+
+ nsec_per_tick = NANOSEC / hz;
}
SYSINIT(opensolaris_register, SI_SUB_OPENSOLARIS, SI_ORDER_FIRST, opensolaris_load, NULL);
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c b/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c
index dea618c..c6ae497 100644
--- a/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c
+++ b/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c
@@ -113,8 +113,10 @@ sysevent_add_attr(sysevent_attr_list_t **ev_attr_list, char *name,
}
break;
default:
+#if 0
printf("%s: type %d is not implemented\n", __func__,
se_value->value_type);
+#endif
break;
}
@@ -286,8 +288,10 @@ log_sysevent(sysevent_t *evp, int flag, sysevent_id_t *eid)
break;
}
default:
+#if 0
printf("%s: type %d is not implemented\n", __func__,
nvpair_type(elem));
+#endif
break;
}
}
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c b/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
index 5a20488..a74f795 100644
--- a/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
+++ b/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
@@ -147,9 +147,7 @@ taskq_run_safe(void *arg, int pending __unused)
{
struct ostask *task = arg;
- ASSERT(task->ost_magic == TASKQ_MAGIC);
task->ost_func(task->ost_arg);
- task->ost_magic = 0;
}
taskqid_t
@@ -158,15 +156,12 @@ taskq_dispatch_safe(taskq_t *tq, task_func_t func, void *arg, u_int flags,
{
int prio;
- ASSERT(task->ost_magic != TASKQ_MAGIC);
-
/*
* If TQ_FRONT is given, we want higher priority for this task, so it
* can go at the front of the queue.
*/
prio = !!(flags & TQ_FRONT);
- task->ost_magic = TASKQ_MAGIC;
task->ost_func = func;
task->ost_arg = arg;
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
index be9f4ec..a266eca 100644
--- a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
+++ b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
@@ -172,6 +172,11 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath,
*/
mp->mnt_flag |= MNT_RDONLY;
/*
+ * We don't want snapshots to allow access to vulnerable setuid
+ * programs, so we turn off setuid when mounting snapshots.
+ */
+ mp->mnt_flag |= MNT_NOSUID;
+ /*
* We don't want snapshots to be visible in regular
* mount(8) and df(1) output.
*/
diff --git a/sys/cddl/compat/opensolaris/sys/atomic.h b/sys/cddl/compat/opensolaris/sys/atomic.h
index af9cc5d..f34d77e 100644
--- a/sys/cddl/compat/opensolaris/sys/atomic.h
+++ b/sys/cddl/compat/opensolaris/sys/atomic.h
@@ -40,8 +40,6 @@
extern void atomic_add_64(volatile uint64_t *target, int64_t delta);
extern void atomic_dec_64(volatile uint64_t *target);
#endif
-#ifndef __LP64__
-#endif
#ifndef __sparc64__
extern uint32_t atomic_cas_32(volatile uint32_t *target, uint32_t cmp,
uint32_t newval);
diff --git a/sys/cddl/compat/opensolaris/sys/kstat.h b/sys/cddl/compat/opensolaris/sys/kstat.h
index 9df4965..d73bd22 100644
--- a/sys/cddl/compat/opensolaris/sys/kstat.h
+++ b/sys/cddl/compat/opensolaris/sys/kstat.h
@@ -58,7 +58,7 @@ typedef struct kstat_named {
} value;
} kstat_named_t;
-kstat_t *kstat_create(char *module, int instance, char *name, char *class,
+kstat_t *kstat_create(char *module, int instance, char *name, char *cls,
uchar_t type, ulong_t ndata, uchar_t flags);
void kstat_install(kstat_t *ksp);
void kstat_delete(kstat_t *ksp);
diff --git a/sys/cddl/compat/opensolaris/sys/taskq.h b/sys/cddl/compat/opensolaris/sys/taskq.h
index eedc4da..ffe70ca 100644
--- a/sys/cddl/compat/opensolaris/sys/taskq.h
+++ b/sys/cddl/compat/opensolaris/sys/taskq.h
@@ -35,7 +35,6 @@ struct ostask {
struct task ost_task;
task_func_t *ost_func;
void *ost_arg;
- int ost_magic;
};
taskqid_t taskq_dispatch_safe(taskq_t *tq, task_func_t func, void *arg,
diff --git a/sys/cddl/compat/opensolaris/sys/time.h b/sys/cddl/compat/opensolaris/sys/time.h
index 05db50e..8e8a99d 100644
--- a/sys/cddl/compat/opensolaris/sys/time.h
+++ b/sys/cddl/compat/opensolaris/sys/time.h
@@ -62,8 +62,21 @@ gethrtime(void) {
#define gethrestime(ts) getnanotime(ts)
#define gethrtime_waitfree() gethrtime()
-#define ddi_get_lbolt() ((gethrtime() * hz) / NANOSEC)
-#define ddi_get_lbolt64() (int64_t)((gethrtime() * hz) / NANOSEC)
+extern int nsec_per_tick; /* nanoseconds per clock tick */
+
+static __inline int64_t
+ddi_get_lbolt64(void)
+{
+
+ return (gethrtime() / nsec_per_tick);
+}
+
+static __inline clock_t
+ddi_get_lbolt(void)
+{
+
+ return (ddi_get_lbolt64());
+}
#else
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c
index 942636b..130c918 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c
@@ -500,9 +500,11 @@ spa_history_log_version(spa_t *spa, history_internal_events_t event)
utsname.nodename, utsname.release, utsname.version,
utsname.machine);
}
+#if 0
cmn_err(CE_CONT, "!%s version %llu pool %s using %llu",
event == LOG_POOL_IMPORT ? "imported" :
event == LOG_POOL_CREATE ? "created" : "accessed",
(u_longlong_t)current_vers, spa_name(spa), SPA_VERSION);
#endif
+#endif
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
index 8f189c6..5265222 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
@@ -37,8 +37,8 @@ extern "C" {
typedef struct arc_buf_hdr arc_buf_hdr_t;
typedef struct arc_buf arc_buf_t;
-typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *private);
-typedef int arc_evict_func_t(void *private);
+typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *priv);
+typedef int arc_evict_func_t(void *priv);
/* generic arc_done_func_t's which you can use */
arc_done_func_t arc_bcopy_func;
@@ -103,17 +103,17 @@ int arc_referenced(arc_buf_t *buf);
#endif
int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf,
- arc_done_func_t *done, void *private, int priority, int zio_flags,
+ arc_done_func_t *done, void *priv, int priority, int zio_flags,
uint32_t *arc_flags, const zbookmark_t *zb);
int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
- arc_done_func_t *done, void *private, int priority, int flags,
+ arc_done_func_t *done, void *priv, int priority, int flags,
uint32_t *arc_flags, const zbookmark_t *zb);
zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, const zio_prop_t *zp,
- arc_done_func_t *ready, arc_done_func_t *done, void *private,
+ arc_done_func_t *ready, arc_done_func_t *done, void *priv,
int priority, int zio_flags, const zbookmark_t *zb);
-void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *private);
+void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv);
int arc_buf_evict(arc_buf_t *buf);
void arc_flush(spa_t *spa);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h
index 9724d6e..405622b 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h
@@ -169,15 +169,15 @@ typedef struct ddt_ops {
#define DDT_NAMELEN 80
extern void ddt_object_name(ddt_t *ddt, enum ddt_type type,
- enum ddt_class class, char *name);
+ enum ddt_class cls, char *name);
extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type,
- enum ddt_class class, uint64_t *walk, ddt_entry_t *dde);
+ enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde);
extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type,
- enum ddt_class class);
+ enum ddt_class cls);
extern int ddt_object_info(ddt_t *ddt, enum ddt_type type,
- enum ddt_class class, dmu_object_info_t *);
+ enum ddt_class cls, dmu_object_info_t *);
extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type,
- enum ddt_class class);
+ enum ddt_class cls);
extern void ddt_bp_fill(const ddt_phys_t *ddp, blkptr_t *bp,
uint64_t txg);
@@ -235,7 +235,7 @@ extern void ddt_unload(spa_t *spa);
extern void ddt_sync(spa_t *spa, uint64_t txg);
extern int ddt_walk(spa_t *spa, ddt_bookmark_t *ddb, ddt_entry_t *dde);
extern int ddt_object_update(ddt_t *ddt, enum ddt_type type,
- enum ddt_class class, ddt_entry_t *dde, dmu_tx_t *tx);
+ enum ddt_class cls, ddt_entry_t *dde, dmu_tx_t *tx);
extern const ddt_ops_t ddt_zap_ops;
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
index 7d25bd7..57725b5 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
@@ -126,10 +126,10 @@ void dsl_free(dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp);
void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg,
const blkptr_t *bpp);
int dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf,
- arc_done_func_t *done, void *private, int priority, int zio_flags,
+ arc_done_func_t *done, void *priv, int priority, int zio_flags,
uint32_t *arc_flags, const zbookmark_t *zb);
int dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp,
- arc_done_func_t *done, void *private, int priority, int zio_flags,
+ arc_done_func_t *done, void *priv, int priority, int zio_flags,
uint32_t *arc_flags, const zbookmark_t *zb);
void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx);
void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
index 23d48c8..9cdec18 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
@@ -655,7 +655,7 @@ extern void spa_history_log_version(spa_t *spa, history_internal_events_t evt);
/* error handling */
struct zbookmark;
extern void spa_log_error(spa_t *spa, zio_t *zio);
-extern void zfs_ereport_post(const char *class, spa_t *spa, vdev_t *vd,
+extern void zfs_ereport_post(const char *cls, spa_t *spa, vdev_t *vd,
zio_t *zio, uint64_t stateoroffset, uint64_t length);
extern void zfs_post_remove(spa_t *spa, vdev_t *vd);
extern void zfs_post_state_change(spa_t *spa, vdev_t *vd);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
index 63b9c57..f7e44aa 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
@@ -115,6 +115,87 @@ typedef enum drr_headertype {
/*
* zfs ioctl command structure
*/
+struct drr_begin {
+ uint64_t drr_magic;
+ uint64_t drr_versioninfo; /* was drr_version */
+ uint64_t drr_creation_time;
+ dmu_objset_type_t drr_type;
+ uint32_t drr_flags;
+ uint64_t drr_toguid;
+ uint64_t drr_fromguid;
+ char drr_toname[MAXNAMELEN];
+};
+
+struct drr_end {
+ zio_cksum_t drr_checksum;
+ uint64_t drr_toguid;
+};
+
+struct drr_object {
+ uint64_t drr_object;
+ dmu_object_type_t drr_type;
+ dmu_object_type_t drr_bonustype;
+ uint32_t drr_blksz;
+ uint32_t drr_bonuslen;
+ uint8_t drr_checksumtype;
+ uint8_t drr_compress;
+ uint8_t drr_pad[6];
+ uint64_t drr_toguid;
+ /* bonus content follows */
+};
+
+struct drr_freeobjects {
+ uint64_t drr_firstobj;
+ uint64_t drr_numobjs;
+ uint64_t drr_toguid;
+};
+
+struct drr_write {
+ uint64_t drr_object;
+ dmu_object_type_t drr_type;
+ uint32_t drr_pad;
+ uint64_t drr_offset;
+ uint64_t drr_length;
+ uint64_t drr_toguid;
+ uint8_t drr_checksumtype;
+ uint8_t drr_checksumflags;
+ uint8_t drr_pad2[6];
+ ddt_key_t drr_key; /* deduplication key */
+ /* content follows */
+};
+
+struct drr_free {
+ uint64_t drr_object;
+ uint64_t drr_offset;
+ uint64_t drr_length;
+ uint64_t drr_toguid;
+};
+
+struct drr_write_byref {
+ /* where to put the data */
+ uint64_t drr_object;
+ uint64_t drr_offset;
+ uint64_t drr_length;
+ uint64_t drr_toguid;
+ /* where to find the prior copy of the data */
+ uint64_t drr_refguid;
+ uint64_t drr_refobject;
+ uint64_t drr_refoffset;
+ /* properties of the data */
+ uint8_t drr_checksumtype;
+ uint8_t drr_checksumflags;
+ uint8_t drr_pad2[6];
+ ddt_key_t drr_key; /* deduplication key */
+};
+
+struct drr_spill {
+ uint64_t drr_object;
+ uint64_t drr_length;
+ uint64_t drr_toguid;
+ uint64_t drr_pad[4]; /* needed for crypto */
+ /* spill data follows */
+};
+
typedef struct dmu_replay_record {
enum {
DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
@@ -123,79 +204,14 @@ typedef struct dmu_replay_record {
} drr_type;
uint32_t drr_payloadlen;
union {
- struct drr_begin {
- uint64_t drr_magic;
- uint64_t drr_versioninfo; /* was drr_version */
- uint64_t drr_creation_time;
- dmu_objset_type_t drr_type;
- uint32_t drr_flags;
- uint64_t drr_toguid;
- uint64_t drr_fromguid;
- char drr_toname[MAXNAMELEN];
- } drr_begin;
- struct drr_end {
- zio_cksum_t drr_checksum;
- uint64_t drr_toguid;
- } drr_end;
- struct drr_object {
- uint64_t drr_object;
- dmu_object_type_t drr_type;
- dmu_object_type_t drr_bonustype;
- uint32_t drr_blksz;
- uint32_t drr_bonuslen;
- uint8_t drr_checksumtype;
- uint8_t drr_compress;
- uint8_t drr_pad[6];
- uint64_t drr_toguid;
- /* bonus content follows */
- } drr_object;
- struct drr_freeobjects {
- uint64_t drr_firstobj;
- uint64_t drr_numobjs;
- uint64_t drr_toguid;
- } drr_freeobjects;
- struct drr_write {
- uint64_t drr_object;
- dmu_object_type_t drr_type;
- uint32_t drr_pad;
- uint64_t drr_offset;
- uint64_t drr_length;
- uint64_t drr_toguid;
- uint8_t drr_checksumtype;
- uint8_t drr_checksumflags;
- uint8_t drr_pad2[6];
- ddt_key_t drr_key; /* deduplication key */
- /* content follows */
- } drr_write;
- struct drr_free {
- uint64_t drr_object;
- uint64_t drr_offset;
- uint64_t drr_length;
- uint64_t drr_toguid;
- } drr_free;
- struct drr_write_byref {
- /* where to put the data */
- uint64_t drr_object;
- uint64_t drr_offset;
- uint64_t drr_length;
- uint64_t drr_toguid;
- /* where to find the prior copy of the data */
- uint64_t drr_refguid;
- uint64_t drr_refobject;
- uint64_t drr_refoffset;
- /* properties of the data */
- uint8_t drr_checksumtype;
- uint8_t drr_checksumflags;
- uint8_t drr_pad2[6];
- ddt_key_t drr_key; /* deduplication key */
- } drr_write_byref;
- struct drr_spill {
- uint64_t drr_object;
- uint64_t drr_length;
- uint64_t drr_toguid;
- uint64_t drr_pad[4]; /* needed for crypto */
- /* spill data follows */
- } drr_spill;
+ struct drr_begin drr_begin;
+ struct drr_end drr_end;
+ struct drr_object drr_object;
+ struct drr_freeobjects drr_freeobjects;
+ struct drr_write drr_write;
+ struct drr_free drr_free;
+ struct drr_write_byref drr_write_byref;
+ struct drr_spill drr_spill;
} drr_u;
} dmu_replay_record_t;
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
index 355f560..4a4e843 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
@@ -421,28 +421,27 @@ struct zio {
#ifdef _KERNEL
/* FreeBSD only. */
- struct ostask io_task_issue;
- struct ostask io_task_interrupt;
+ struct ostask io_task;
#endif
};
extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd,
- zio_done_func_t *done, void *private, enum zio_flag flags);
+ zio_done_func_t *done, void *priv, enum zio_flag flags);
extern zio_t *zio_root(spa_t *spa,
- zio_done_func_t *done, void *private, enum zio_flag flags);
+ zio_done_func_t *done, void *priv, enum zio_flag flags);
extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data,
- uint64_t size, zio_done_func_t *done, void *private,
+ uint64_t size, zio_done_func_t *done, void *priv,
int priority, enum zio_flag flags, const zbookmark_t *zb);
extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
void *data, uint64_t size, const zio_prop_t *zp,
- zio_done_func_t *ready, zio_done_func_t *done, void *private,
+ zio_done_func_t *ready, zio_done_func_t *done, void *priv,
int priority, enum zio_flag flags, const zbookmark_t *zb);
extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
- void *data, uint64_t size, zio_done_func_t *done, void *private,
+ void *data, uint64_t size, zio_done_func_t *done, void *priv,
int priority, enum zio_flag flags, zbookmark_t *zb);
extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies);
@@ -451,19 +450,20 @@ extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp);
extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg,
const blkptr_t *bp,
- zio_done_func_t *done, void *private, enum zio_flag flags);
+ zio_done_func_t *done, void *priv, enum zio_flag flags);
extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
- zio_done_func_t *done, void *private, int priority, enum zio_flag flags);
+ zio_done_func_t *done, void *priv, int priority,
+ enum zio_flag flags);
extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
uint64_t size, void *data, int checksum,
- zio_done_func_t *done, void *private, int priority, enum zio_flag flags,
+ zio_done_func_t *done, void *priv, int priority, enum zio_flag flags,
boolean_t labels);
extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
uint64_t size, void *data, int checksum,
- zio_done_func_t *done, void *private, int priority, enum zio_flag flags,
+ zio_done_func_t *done, void *priv, int priority, enum zio_flag flags,
boolean_t labels);
extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg,
@@ -494,11 +494,11 @@ extern void zio_resubmit_stage_async(void *);
extern zio_t *zio_vdev_child_io(zio_t *zio, blkptr_t *bp, vdev_t *vd,
uint64_t offset, void *data, uint64_t size, int type, int priority,
- enum zio_flag flags, zio_done_func_t *done, void *private);
+ enum zio_flag flags, zio_done_func_t *done, void *priv);
extern zio_t *zio_vdev_delegated_io(vdev_t *vd, uint64_t offset,
void *data, uint64_t size, int type, int priority,
- enum zio_flag flags, zio_done_func_t *done, void *private);
+ enum zio_flag flags, zio_done_func_t *done, void *priv);
extern void zio_vdev_io_bypass(zio_t *zio);
extern void zio_vdev_io_reissue(zio_t *zio);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
index bae9071..6ff9339 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
@@ -239,15 +239,20 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, znode_t **zpp,
return (ENOENT);
}
if (dl == NULL) {
+ size_t namesize;
+
/*
* Allocate a new dirlock and add it to the list.
*/
- dl = kmem_alloc(sizeof (zfs_dirlock_t), KM_SLEEP);
+ namesize = strlen(name) + 1;
+ dl = kmem_alloc(sizeof (zfs_dirlock_t) + namesize,
+ KM_SLEEP);
cv_init(&dl->dl_cv, NULL, CV_DEFAULT, NULL);
- dl->dl_name = name;
+ dl->dl_name = (char *)(dl + 1);
+ bcopy(name, dl->dl_name, namesize);
dl->dl_sharecnt = 0;
dl->dl_namelock = 0;
- dl->dl_namesize = 0;
+ dl->dl_namesize = namesize;
dl->dl_dzp = dzp;
dl->dl_next = dzp->z_dirlocks;
dzp->z_dirlocks = dl;
@@ -264,20 +269,8 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, znode_t **zpp,
if (flag & ZHAVELOCK)
dl->dl_namelock = 1;
- if ((flag & ZSHARED) && ++dl->dl_sharecnt > 1 && dl->dl_namesize == 0) {
- /*
- * We're the second shared reference to dl. Make a copy of
- * dl_name in case the first thread goes away before we do.
- * Note that we initialize the new name before storing its
- * pointer into dl_name, because the first thread may load
- * dl->dl_name at any time. He'll either see the old value,
- * which is his, or the new shared copy; either is OK.
- */
- dl->dl_namesize = strlen(dl->dl_name) + 1;
- name = kmem_alloc(dl->dl_namesize, KM_SLEEP);
- bcopy(dl->dl_name, name, dl->dl_namesize);
- dl->dl_name = name;
- }
+ if (flag & ZSHARED)
+ dl->dl_sharecnt++;
mutex_exit(&dzp->z_lock);
@@ -361,10 +354,8 @@ zfs_dirent_unlock(zfs_dirlock_t *dl)
cv_broadcast(&dl->dl_cv);
mutex_exit(&dzp->z_lock);
- if (dl->dl_namesize != 0)
- kmem_free(dl->dl_name, dl->dl_namesize);
cv_destroy(&dl->dl_cv);
- kmem_free(dl, sizeof (*dl));
+ kmem_free(dl, sizeof (*dl) + dl->dl_namesize);
}
/*
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
index 5e968b5..9a04344 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
@@ -1068,19 +1068,9 @@ zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q, boolean_t cutinline)
spa_t *spa = zio->io_spa;
zio_type_t t = zio->io_type;
int flags = TQ_SLEEP | (cutinline ? TQ_FRONT : 0);
-#ifdef _KERNEL
- struct ostask *task;
-#endif
ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT);
-#ifdef _KERNEL
- if (q == ZIO_TASKQ_ISSUE)
- task = &zio->io_task_issue;
- else /* if (q == ZIO_TASKQ_INTERRUPT) */
- task = &zio->io_task_interrupt;
-#endif
-
/*
* If we're a config writer or a probe, the normal issue and
* interrupt threads may all be blocked waiting for the config lock.
@@ -1105,7 +1095,7 @@ zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q, boolean_t cutinline)
ASSERT3U(q, <, ZIO_TASKQ_TYPES);
#ifdef _KERNEL
(void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q],
- (task_func_t *)zio_execute, zio, flags, task);
+ (task_func_t *)zio_execute, zio, flags, &zio->io_task);
#else
(void) taskq_dispatch(spa->spa_zio_taskq[t][q],
(task_func_t *)zio_execute, zio, flags);
@@ -2904,7 +2894,7 @@ zio_done(zio_t *zio)
(void) taskq_dispatch_safe(
spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],
(task_func_t *)zio_reexecute, zio, TQ_SLEEP,
- &zio->io_task_issue);
+ &zio->io_task);
#else
(void) taskq_dispatch(
spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE],
diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h b/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h
index cd4caaa..b810f07 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h
@@ -65,7 +65,7 @@ typedef long ctf_id_t;
* filling in ctf_sect_t structures and passing them to ctf_bufopen():
*/
typedef struct ctf_sect {
- char *cts_name; /* section name (if any) */
+ const char *cts_name; /* section name (if any) */
ulong_t cts_type; /* section type (ELF SHT_... value) */
ulong_t cts_flags; /* section flags (ELF SHF_... value) */
#if defined(sun)
diff --git a/sys/cddl/dev/cyclic/i386/cyclic_machdep.c b/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
index 6f93663..9ba2fd3 100644
--- a/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
+++ b/sys/cddl/dev/cyclic/i386/cyclic_machdep.c
@@ -123,7 +123,9 @@ reprogram(cyb_arg_t arg __unused, hrtime_t exp)
static void xcall(cyb_arg_t arg __unused, cpu_t *c, cyc_func_t func,
void *param)
{
+ cpuset_t cpus;
- smp_rendezvous_cpus((cpumask_t)1 << c->cpuid,
+ CPU_SETOF(c->cpuid, &cpus);
+ smp_rendezvous_cpus(cpus,
smp_no_rendevous_barrier, func, smp_no_rendevous_barrier, param);
}
diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
index a081f67..0b86eac 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
@@ -113,12 +113,12 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit))
void
dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg)
{
- cpumask_t cpus;
+ cpuset_t cpus;
if (cpu == DTRACE_CPUALL)
cpus = all_cpus;
else
- cpus = (cpumask_t)1 << cpu;
+ CPU_SETOF(cpu, &cpus);
smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func,
smp_no_rendevous_barrier, arg);
@@ -374,7 +374,7 @@ dtrace_gethrtime_init(void *arg)
{
struct pcpu *pc;
uint64_t tsc_f;
- cpumask_t map;
+ cpuset_t map;
int i;
/*
@@ -412,7 +412,8 @@ dtrace_gethrtime_init(void *arg)
continue;
pc = pcpu_find(i);
- map = PCPU_GET(cpumask) | pc->pc_cpumask;
+ map = PCPU_GET(cpumask);
+ CPU_OR(&map, &pc->pc_cpumask);
smp_rendezvous_cpus(map, NULL,
dtrace_gethrtime_init_cpu,
diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
index 2753ffc..412fc38 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
@@ -30,6 +30,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
+#include <sys/cpuset.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/kmem.h>
@@ -113,12 +114,12 @@ dtrace_toxic_ranges(void (*func)(uintptr_t base, uintptr_t limit))
void
dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg)
{
- cpumask_t cpus;
+ cpuset_t cpus;
if (cpu == DTRACE_CPUALL)
cpus = all_cpus;
else
- cpus = (cpumask_t)1 << cpu;
+ CPU_SETOF(cpu, &cpus);
smp_rendezvous_cpus(cpus, smp_no_rendevous_barrier, func,
smp_no_rendevous_barrier, arg);
@@ -372,9 +373,9 @@ dtrace_gethrtime_init_cpu(void *arg)
static void
dtrace_gethrtime_init(void *arg)
{
+ cpuset_t map;
struct pcpu *pc;
uint64_t tsc_f;
- cpumask_t map;
int i;
/*
@@ -412,7 +413,8 @@ dtrace_gethrtime_init(void *arg)
continue;
pc = pcpu_find(i);
- map = PCPU_GET(cpumask) | pc->pc_cpumask;
+ map = PCPU_GET(cpumask);
+ CPU_OR(&map, &pc->pc_cpumask);
smp_rendezvous_cpus(map, NULL,
dtrace_gethrtime_init_cpu,
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 23985d3..5b6e895 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -1416,6 +1416,19 @@ freebsd32_pwrite(struct thread *td, struct freebsd32_pwrite_args *uap)
return (pwrite(td, &ap));
}
+#ifdef COMPAT_43
+int
+ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap)
+{
+ struct lseek_args nuap;
+
+ nuap.fd = uap->fd;
+ nuap.offset = uap->offset;
+ nuap.whence = uap->whence;
+ return (lseek(td, &nuap));
+}
+#endif
+
int
freebsd32_lseek(struct thread *td, struct freebsd32_lseek_args *uap)
{
diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h
index bfc142d..c10c6a8 100644
--- a/sys/compat/freebsd32/freebsd32_proto.h
+++ b/sys/compat/freebsd32/freebsd32_proto.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib
*/
#ifndef _FREEBSD32_SYSPROTO_H_
@@ -690,6 +690,11 @@ int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_
#if !defined(PAD64_REQUIRED) && defined(__powerpc__)
#define PAD64_REQUIRED
#endif
+struct ofreebsd32_lseek_args {
+ char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
+ char offset_l_[PADL_(int)]; int offset; char offset_r_[PADR_(int)];
+ char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
+};
struct ofreebsd32_stat_args {
char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
char ub_l_[PADL_(struct ostat32 *)]; struct ostat32 * ub; char ub_r_[PADR_(struct ostat32 *)];
@@ -747,6 +752,7 @@ struct ofreebsd32_getdirentries_args {
#ifdef PAD64_REQUIRED
#else
#endif
+int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *);
int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *);
int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *);
int ofreebsd32_sigaction(struct thread *, struct ofreebsd32_sigaction_args *);
@@ -923,6 +929,7 @@ int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_
#define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4
#define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT
+#define FREEBSD32_SYS_AUE_ofreebsd32_lseek AUE_LSEEK
#define FREEBSD32_SYS_AUE_freebsd32_recvmsg AUE_RECVMSG
#define FREEBSD32_SYS_AUE_freebsd32_sendmsg AUE_SENDMSG
#define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM
diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h
index 9fcbdf0..8903338 100644
--- a/sys/compat/freebsd32/freebsd32_syscall.h
+++ b/sys/compat/freebsd32/freebsd32_syscall.h
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib
*/
#define FREEBSD32_SYS_syscall 0
@@ -25,7 +25,7 @@
#define FREEBSD32_SYS_chown 16
#define FREEBSD32_SYS_break 17
#define FREEBSD32_SYS_freebsd4_freebsd32_getfsstat 18
- /* 19 is obsolete olseek */
+ /* 19 is old freebsd32_lseek */
#define FREEBSD32_SYS_getpid 20
#define FREEBSD32_SYS_mount 21
#define FREEBSD32_SYS_unmount 22
diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c
index 7e648e4..eac2385 100644
--- a/sys/compat/freebsd32/freebsd32_syscalls.c
+++ b/sys/compat/freebsd32/freebsd32_syscalls.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib
*/
const char *freebsd32_syscallnames[] = {
@@ -29,7 +29,7 @@ const char *freebsd32_syscallnames[] = {
"chown", /* 16 = chown */
"break", /* 17 = break */
"compat4.freebsd32_getfsstat", /* 18 = freebsd4 freebsd32_getfsstat */
- "obs_olseek", /* 19 = obsolete olseek */
+ "compat.freebsd32_lseek", /* 19 = old freebsd32_lseek */
"getpid", /* 20 = getpid */
"mount", /* 21 = mount */
"unmount", /* 22 = unmount */
diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c
index 2c174c7..61d1448 100644
--- a/sys/compat/freebsd32/freebsd32_sysent.c
+++ b/sys/compat/freebsd32/freebsd32_sysent.c
@@ -3,7 +3,7 @@
*
* DO NOT EDIT-- this file is automatically generated.
* $FreeBSD$
- * created from FreeBSD
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib
*/
#include "opt_compat.h"
@@ -66,7 +66,7 @@ struct sysent freebsd32_sysent[] = {
{ AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */
{ AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */
{ compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 freebsd32_getfsstat */
- { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 19 = obsolete olseek */
+ { compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = old freebsd32_lseek */
{ 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */
{ AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = mount */
{ AS(unmount_args), (sy_call_t *)unmount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = unmount */
diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master
index d524f3c..3e19298 100644
--- a/sys/compat/freebsd32/syscalls.master
+++ b/sys/compat/freebsd32/syscalls.master
@@ -89,7 +89,8 @@
18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \
struct statfs32 *buf, long bufsize, \
int flags); }
-19 AUE_LSEEK OBSOL olseek
+19 AUE_LSEEK COMPAT { int freebsd32_lseek(int fd, int offset, \
+ int whence); }
20 AUE_GETPID NOPROTO { pid_t getpid(void); }
21 AUE_MOUNT NOPROTO { int mount(char *type, char *path, \
int flags, caddr_t data); }
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index ddbd8b4..692c5a3 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -1049,6 +1049,15 @@ linprocfs_doproccmdline(PFS_FILL_ARGS)
PROC_UNLOCK(p);
return (ret);
}
+
+ /*
+ * Mimic linux behavior and pass only processes with usermode
+ * address space as valid. Return zero silently otherwize.
+ */
+ if (p->p_vmspace == &vmspace0) {
+ PROC_UNLOCK(p);
+ return (0);
+ }
if (p->p_args != NULL) {
sbuf_bcpy(sb, p->p_args->ar_args, p->p_args->ar_length);
PROC_UNLOCK(p);
@@ -1073,6 +1082,15 @@ linprocfs_doprocenviron(PFS_FILL_ARGS)
PROC_UNLOCK(p);
return (ret);
}
+
+ /*
+ * Mimic linux behavior and pass only processes with usermode
+ * address space as valid. Return zero silently otherwize.
+ */
+ if (p->p_vmspace == &vmspace0) {
+ PROC_UNLOCK(p);
+ return (0);
+ }
PROC_UNLOCK(p);
ret = linprocfs_doargv(td, p, sb, ps_string_env);
diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm
index 756945d..d099256 100644
--- a/sys/conf/Makefile.arm
+++ b/sys/conf/Makefile.arm
@@ -108,7 +108,8 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$M/inckern.S $S/$M/$M/elf_trampoline.c
gzip -9 ${KERNEL_KO}.tmp
eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \
echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h
- ${CC} -O2 -DKZIP -I. -I$S -c $S/kern/inflate.c -o inflate-tramp.o
+ ${CC} -O2 -ffreestanding -DKZIP -I. -I$S -c $S/kern/inflate.c -o \
+ inflate-tramp.o
${CC} -O -nostdlib -I. -I$S -Xlinker -T -Xlinker ldscript.$M.tramp \
-DKZIP tmphack.S $S/$M/$M/elf_trampoline.c inflate-tramp.o \
$S/$M/$M/inckern.S ${FILES_CPU_FUNC} -o ${KERNEL_KO}.gz.tramp
diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc
index e4cd85f..725f3c7 100644
--- a/sys/conf/Makefile.powerpc
+++ b/sys/conf/Makefile.powerpc
@@ -35,7 +35,7 @@ LDSCRIPT_NAME?= ldscript.${MACHINE_ARCH}
INCLUDES+= -I$S/contrib/libfdt
-CFLAGS+= -msoft-float
+CFLAGS+= -msoft-float -Wa,-many
DDB_ENABLED!= grep DDB opt_ddb.h || true
.if !empty(DDB_ENABLED)
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 94311c6..b84d0c5 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -432,7 +432,10 @@ options KTRACE_REQUEST_POOL=101
# defined by the KTR_* constants in <sys/ktr.h>. KTR_MASK defines the
# initial value of the ktr_mask variable which determines at runtime
# what events to trace. KTR_CPUMASK determines which CPU's log
-# events, with bit X corresponding to CPU X. KTR_VERBOSE enables
+# events, with bit X corresponding to CPU X. The layout of the string
+# passed as KTR_CPUMASK must match a serie of bitmasks each of them
+# separated by the ", " characters (ie:
+# KTR_CPUMASK=("0xAF, 0xFFFFFFFFFFFFFFFF")). KTR_VERBOSE enables
# dumping of KTR events to the console by default. This functionality
# can be toggled via the debug.ktr_verbose sysctl and defaults to off
# if KTR_VERBOSE is not defined. See ktr(4) and ktrdump(8) for details.
@@ -441,7 +444,7 @@ options KTR
options KTR_ENTRIES=1024
options KTR_COMPILE=(KTR_INTR|KTR_PROC)
options KTR_MASK=KTR_INTR
-options KTR_CPUMASK=0x3
+options KTR_CPUMASK=("0x3")
options KTR_VERBOSE
#
diff --git a/sys/conf/files b/sys/conf/files
index 5488f69..a62e1a6 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -604,6 +604,9 @@ dev/ath/ath_hal/ah_eeprom_v14.c \
dev/ath/ath_hal/ah_eeprom_v4k.c \
optional ath_hal | ath_ar9285 \
compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/ath_hal/ah_eeprom_9287.c \
+ optional ath_hal | ath_ar9287 \
+ compile-with "${NORMAL_C} -I$S/dev/ath"
dev/ath/ath_hal/ah_regdomain.c optional ath \
compile-with "${NORMAL_C} -I$S/dev/ath"
# ar5210
@@ -651,111 +654,128 @@ dev/ath/ath_hal/ar5211/ar5211_xmit.c optional ath_hal | ath_ar5211 \
# ar5212
dev/ath/ath_hal/ar5212/ar5212_ani.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_attach.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_beacon.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_eeprom.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_gpio.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_interrupts.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_keycache.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_misc.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_phy.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_power.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_recv.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_reset.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_rfgain.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5212/ar5212_xmit.c \
optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \
- ath_ar9285 \
+ ath_ar9285 ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
# ar5416 (depends on ar5212)
dev/ath/ath_hal/ar5416/ar5416_ani.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_attach.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_beacon.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_cal.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_cal_iq.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_eeprom.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_gpio.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_interrupts.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_keycache.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_misc.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_phy.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_power.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_recv.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_reset.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar5416/ar5416_xmit.c \
- optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
+ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \
+ ath_ar9287 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
# ar9130 (depends upon ar5416) - also requires AH_SUPPORT_AR9130
dev/ath/ath_hal/ar9001/ar9130_attach.c optional ath_hal | ath_ar9130 \
@@ -786,6 +806,16 @@ dev/ath/ath_hal/ar9002/ar9285_phy.c optional ath_hal | ath_ar9285 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar9002/ar9285_diversity.c optional ath_hal | ath_ar9285 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+# ar9287 (depends on ar5416)
+dev/ath/ath_hal/ar9002/ar9287_attach.c optional ath_hal | ath_ar9287 \
+ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar9002/ar9287_reset.c optional ath_hal | ath_ar9287 \
+ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar9002/ar9287_cal.c optional ath_hal | ath_ar9287 \
+ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar9002/ar9287_olc.c optional ath_hal | ath_ar9287 \
+ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+
# rf backends
dev/ath/ath_hal/ar5212/ar2316.c optional ath_rf2316 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
@@ -807,6 +837,8 @@ dev/ath/ath_hal/ar9002/ar9280.c optional ath_hal | ath_ar9280 | ath_ar9285 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
dev/ath/ath_hal/ar9002/ar9285.c optional ath_hal | ath_ar9285 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar9002/ar9287.c optional ath_hal | ath_ar9287 \
+ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
# ath rate control algorithms
dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \
compile-with "${NORMAL_C} -I$S/dev/ath"
@@ -814,7 +846,10 @@ dev/ath/ath_rate/onoe/onoe.c optional ath_rate_onoe \
compile-with "${NORMAL_C} -I$S/dev/ath"
dev/ath/ath_rate/sample/sample.c optional ath_rate_sample \
compile-with "${NORMAL_C} -I$S/dev/ath"
-#
+# ath DFS modules
+dev/ath/ath_dfs/null/dfs_null.c optional ath \
+ compile-with "${NORMAL_C} -I$S/dev/ath"
+#
dev/bce/if_bce.c optional bce
dev/bfe/if_bfe.c optional bfe
dev/bge/if_bge.c optional bge
@@ -885,6 +920,8 @@ dev/cxgbe/t4_main.c optional cxgbe pci \
compile-with "${NORMAL_C} -I$S/dev/cxgbe"
dev/cxgbe/t4_sge.c optional cxgbe pci \
compile-with "${NORMAL_C} -I$S/dev/cxgbe"
+dev/cxgbe/t4_l2t.c optional cxgbe pci \
+ compile-with "${NORMAL_C} -I$S/dev/cxgbe"
dev/cxgbe/common/t4_hw.c optional cxgbe pci \
compile-with "${NORMAL_C} -I$S/dev/cxgbe"
dev/cy/cy.c optional cy
@@ -1921,6 +1958,7 @@ dev/usb/serial/uftdi.c optional uftdi
dev/usb/serial/ugensa.c optional ugensa
dev/usb/serial/uipaq.c optional uipaq
dev/usb/serial/ulpt.c optional ulpt
+dev/usb/serial/umcs.c optional umcs
dev/usb/serial/umct.c optional umct
dev/usb/serial/umodem.c optional umodem
dev/usb/serial/umoscom.c optional umoscom
@@ -1930,7 +1968,7 @@ dev/usb/serial/uvisor.c optional uvisor
dev/usb/serial/uvscom.c optional uvscom
dev/usb/serial/usb_serial.c optional ucom | u3g | uark | ubsa | ubser | \
uchcom | ucycom | ufoma | uftdi | \
- ugensa | uipaq | umct | \
+ ugensa | uipaq | umcs | umct | \
umodem | umoscom | uplcom | uslcom | \
uvisor | uvscom
#
@@ -2710,6 +2748,7 @@ netinet/ip_gre.c optional gre inet
netinet/ip_id.c optional inet
netinet/in_mcast.c optional inet
netinet/in_pcb.c optional inet | inet6
+netinet/in_pcbgroup.c optional inet pcbgroup | inet6 pcbgroup
netinet/in_proto.c optional inet | inet6 \
compile-with "${NORMAL_C} -I$S/contrib/pf"
netinet/in_rmx.c optional inet
@@ -2787,6 +2826,7 @@ netinet6/in6_gif.c optional gif inet6 | netgraph_gif inet6
netinet6/in6_ifattach.c optional inet6
netinet6/in6_mcast.c optional inet6
netinet6/in6_pcb.c optional inet6
+netinet6/in6_pcbgroup.c optional inet6 pcbgroup
netinet6/in6_proto.c optional inet6
netinet6/in6_rmx.c optional inet6
netinet6/in6_src.c optional inet6
@@ -3112,41 +3152,41 @@ ofed/drivers/net/mlx4/en_tx.c optional mlxen \
compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/"
ofed/drivers/infiniband/hw/mthca/mthca_allocator.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_av.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_catas.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_cmd.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_cq.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_eq.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_mad.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_main.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_mcg.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_memfree.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_mr.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_pd.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_profile.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_provider.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_qp.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_reset.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_srq.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
ofed/drivers/infiniband/hw/mthca/mthca_uar.c optional mthca \
- no-depend compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/mthca/"
+ no-depend compile-with "${OFED_C}"
# crypto support
opencrypto/cast.c optional crypto | ipsec
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index 42bf6f2..9f5a357 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -27,6 +27,7 @@ dev/cfi/cfi_bus_fdt.c optional cfi fdt
dev/fb/fb.c optional sc
dev/fdt/fdt_powerpc.c optional fdt
dev/hwpmc/hwpmc_powerpc.c optional hwpmc
+dev/iicbus/ad7417.c optional ad7417 powermac
dev/iicbus/ds1775.c optional ds1775 powermac
dev/iicbus/max6690.c optional max6690 powermac
dev/kbd/kbd.c optional sc
@@ -86,7 +87,6 @@ powerpc/aim/moea64_if.m optional aim
powerpc/aim/moea64_native.c optional aim
powerpc/aim/mp_cpudep.c optional aim smp
powerpc/aim/nexus.c optional aim
-powerpc/aim/ofwmagic.S optional aim
powerpc/aim/slb.c optional aim powerpc64
powerpc/aim/swtch32.S optional aim powerpc
powerpc/aim/swtch64.S optional aim powerpc64
@@ -136,6 +136,10 @@ powerpc/ofw/ofw_pcibus.c optional pci aim
powerpc/ofw/ofw_pcib_pci.c optional pci aim
powerpc/ofw/ofw_real.c optional aim
powerpc/ofw/ofw_syscons.c optional sc aim
+powerpc/ofw/ofwcall32.S optional aim powerpc
+powerpc/ofw/ofwcall64.S optional aim powerpc64
+powerpc/ofw/ofwmagic.S optional aim
+powerpc/ofw/rtas.c optional aim
powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio
powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio
powerpc/powermac/ata_dbdma.c optional powermac ata | powermac atamacio
@@ -150,6 +154,7 @@ powerpc/powermac/macgpio.c optional powermac pci
powerpc/powermac/macio.c optional powermac pci
powerpc/powermac/openpic_macio.c optional powermac pci
powerpc/powermac/platform_powermac.c optional powermac
+powerpc/powermac/powermac_thermal.c optional powermac
powerpc/powermac/pswitch.c optional powermac pswitch
powerpc/powermac/pmu.c optional powermac pmu
powerpc/powermac/smu.c optional powermac smu
@@ -157,6 +162,7 @@ powerpc/powermac/smusat.c optional powermac smu
powerpc/powermac/uninorth.c optional powermac
powerpc/powermac/uninorthpci.c optional powermac pci
powerpc/powermac/vcoregpio.c optional powermac
+powerpc/powermac/windtunnel.c optional powermac windtunnel
powerpc/powerpc/altivec.c optional aim
powerpc/powerpc/atomic.S standard
powerpc/powerpc/autoconf.c standard
@@ -197,11 +203,13 @@ powerpc/powerpc/syncicache.c standard
powerpc/powerpc/sys_machdep.c standard
powerpc/powerpc/uio_machdep.c standard
powerpc/ps3/ehci_ps3.c optional ps3 ehci
+powerpc/ps3/ohci_ps3.c optional ps3 ohci
powerpc/ps3/if_glc.c optional ps3 glc
powerpc/ps3/mmu_ps3.c optional ps3
powerpc/ps3/platform_ps3.c optional ps3
powerpc/ps3/ps3ata.c optional ps3 ps3ata
powerpc/ps3/ps3bus.c optional ps3
+powerpc/ps3/ps3disk.c optional ps3
powerpc/ps3/ps3pic.c optional ps3
powerpc/ps3/ps3_syscons.c optional ps3 sc
powerpc/ps3/ps3-hvcall.S optional ps3 sc
diff --git a/sys/conf/options b/sys/conf/options
index a608d86..ee696a8 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -419,6 +419,7 @@ MROUTING opt_mrouting.h
NCP
NETATALK opt_atalk.h
NFSLOCKD
+PCBGROUP opt_pcbgroup.h
RADIX_MPATH opt_mpath.h
ROUTETABLES opt_route.h
SLIP_IFF_OPTS opt_slip.h
diff --git a/sys/contrib/dev/acpica/changes.txt b/sys/contrib/dev/acpica/changes.txt
index 68dda91..f53fd42 100644
--- a/sys/contrib/dev/acpica/changes.txt
+++ b/sys/contrib/dev/acpica/changes.txt
@@ -1,31 +1,99 @@
----------------------------------------
+27 May 2011. Summary of changes for version 20110527:
+
+This release is available at www.acpica.org/downloads
+
+1) ACPI CA Core Subsystem:
+
+ASL Load() operator: Reinstate most restrictions on the incoming ACPI table
+signature. Now, only allow SSDT, OEMx, and a null signature. History:
+ 1) Originally, we checked the table signature for "SSDT" or "PSDT".
+ (PSDT is now obsolete.)
+ 2) We added support for OEMx tables, signature "OEM" plus a fourth
+ "don't care" character.
+ 3) Valid tables were encountered with a null signature, so we just
+ gave up on validating the signature, (05/2008).
+ 4) We encountered non-AML tables such as the MADT, which caused
+ interpreter errors and kernel faults. So now, we once again allow
+ only SSDT, OEMx, and now, also a null signature. (05/2011).
+
+Added the missing _TDL predefined name to the global name list in order to
+enable validation. Affects both the core ACPICA code and the iASL compiler.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug
+version of the code includes the debug output trace mechanism and has a much
+larger code and data size.
+
+ Previous Release (VC 9.0):
+ Non-Debug Version: 90.0K Code, 23.8K Data, 113.8K Total
+ Debug Version: 164.5K Code, 68.0K Data, 232.5K Total
+ Current Release (VC 9.0):
+ Non-Debug Version: 90.1K Code, 23.9K Data, 114.0K Total
+ Debug Version: 165.6K Code, 68.4K Data, 234.0K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+Debugger/AcpiExec: Implemented support for "complex" method arguments on the
+debugger command line. This adds support beyond simple integers -- including
+Strings, Buffers, and Packages. Includes support for nested packages.
+Increased the default command line buffer size to accommodate these arguments.
+See the ACPICA reference for details and syntax. ACPICA BZ 917.
+
+Debugger/AcpiExec: Implemented support for "default" method arguments for the
+Execute/Debug command. Now, the debugger will always invoke a control method
+with the required number of arguments -- even if the command line specifies
+none or insufficient arguments. It uses default integer values for any missing
+arguments. Also fixes a bug where only six method arguments maximum were
+supported instead of the required seven.
+
+Debugger/AcpiExec: Add a maximum buffer length parameter to AcpiOsGetLine and
+also return status in order to prevent buffer overruns. See the ACPICA
+reference for details and syntax. ACPICA BZ 921
+
+iASL: Cleaned up support for Berkeley yacc. A general cleanup of code and
+makefiles to simplify support for the two different but similar parser
+generators, bison and yacc.
+
+Updated the generic unix makefile for gcc 4. The default gcc version is now
+expected to be 4 or greater, since options specific to gcc 4 are used.
+
+----------------------------------------
13 April 2011. Summary of changes for version 20110413:
1) ACPI CA Core Subsystem:
Implemented support to execute a so-called "orphan" _REG method under the EC
-device. This change will force the execution of a _REG method underneath the EC
+device. This change will force the execution of a _REG method underneath the
+EC
device even if there is no corresponding operation region of type
EmbeddedControl. Fixes a problem seen on some machines and apparently is
compatible with Windows behavior. ACPICA BZ 875.
Added more predefined methods that are eligible for automatic NULL package
-element removal. This change adds another group of predefined names to the list
+element removal. This change adds another group of predefined names to the
+list
of names that can be repaired by having NULL package elements dynamically
removed. This group are those methods that return a single variable-length
package containing simple data types such as integers, buffers, strings. This
-includes: _ALx, _BCL, _CID,_ DOD, _EDL, _FIX, _PCL, _PLD, _PMD, _PRx, _PSL, _Sx,
+includes: _ALx, _BCL, _CID,_ DOD, _EDL, _FIX, _PCL, _PLD, _PMD, _PRx, _PSL,
+_Sx,
and _TZD. ACPICA BZ 914.
-Split and segregated all internal global lock functions to a new file, evglock.c.
+Split and segregated all internal global lock functions to a new file,
+evglock.c.
-Updated internal address SpaceID for DataTable regions. Moved this internal space
-id in preparation for ACPI 5.0 changes that will include some new space IDs. This
+Updated internal address SpaceID for DataTable regions. Moved this internal
+space
+id in preparation for ACPI 5.0 changes that will include some new space IDs.
+This
change should not affect user/host code.
-Example Code and Data Size: These are the sizes for the OS-independent acpica.lib
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib
produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of
-the code includes the debug output trace mechanism and has a much larger code and
+the code includes the debug output trace mechanism and has a much larger code
+and
data size.
Previous Release (VC 9.0):
@@ -40,34 +108,44 @@ data size.
iASL/DTC: Major update for new grammar features. Allow generic data types in
custom ACPI tables. Field names are now optional. Any line can be split to
multiple lines using the continuation char (\). Large buffers now use line-
-continuation character(s) and no colon on the continuation lines. See the grammar
+continuation character(s) and no colon on the continuation lines. See the
+grammar
update in the iASL compiler reference. ACPI BZ 910,911. Lin Ming, Bob Moore.
iASL: Mark ASL "Return()" and the simple "Return" as "Null" return statements.
-Since the parser stuffs a "zero" as the return value for these statements (due to
+Since the parser stuffs a "zero" as the return value for these statements (due
+to
the underlying AML grammar), they were seen as "return with value" by the iASL
semantic checking. They are now seen correctly as "null" return statements.
iASL: Check if a_REG declaration has a corresponding Operation Region. Adds a
check for each _REG to ensure that there is in fact a corresponding operation
-region declaration in the same scope. If not, the _REG method is not very useful
+region declaration in the same scope. If not, the _REG method is not very
+useful
since it probably won't be executed. ACPICA BZ 915.
-iASL/DTC: Finish support for expression evaluation. Added a new expression parser
-that implements c-style operator precedence and parenthesization. ACPICA bugzilla
+iASL/DTC: Finish support for expression evaluation. Added a new expression
+parser
+that implements c-style operator precedence and parenthesization. ACPICA
+bugzilla
908.
-Disassembler/DTC: Remove support for () and <> style comments in data tables. Now
-that DTC has full expression support, we don't want to have comment strings that
-start with a parentheses or a less-than symbol. Now, only the standard /* and //
+Disassembler/DTC: Remove support for () and <> style comments in data tables.
+Now
+that DTC has full expression support, we don't want to have comment strings
+that
+start with a parentheses or a less-than symbol. Now, only the standard /* and
+//
comments are supported, as well as the bracket [] comments.
-AcpiXtract: Fix for RSDP and dynamic SSDT extraction. These tables have "unusual"
+AcpiXtract: Fix for RSDP and dynamic SSDT extraction. These tables have
+"unusual"
headers in the acpidump file. Update the header validation to support these
tables. Problem introduced in previous AcpiXtract version in the change to
support "wrong checksum" error messages emitted by acpidump utility.
-iASL: Add a * option to generate all template files (as a synonym for ALL) as in
+iASL: Add a * option to generate all template files (as a synonym for ALL) as
+in
"iasl -T *" or "iasl -T ALL".
iASL/DTC: Do not abort compiler on fatal errors. We do not want to completely
@@ -81,7 +159,8 @@ invocation.
1) ACPI CA Core Subsystem:
Fixed a problem caused by a _PRW method appearing at the namespace root scope
-during the setup of wake GPEs. A fault could occur if a _PRW directly under the
+during the setup of wake GPEs. A fault could occur if a _PRW directly under
+the
root object was passed to the AcpiSetupGpeForWake interface. Lin Ming.
Implemented support for "spurious" Global Lock interrupts. On some systems, a
@@ -89,9 +168,11 @@ global lock interrupt can occur without the pending flag being set. Upon a GL
interrupt, we now ensure that a thread is actually waiting for the lock before
signaling GL availability. Rafael Wysocki, Bob Moore.
-Example Code and Data Size: These are the sizes for the OS-independent acpica.lib
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib
produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of
-the code includes the debug output trace mechanism and has a much larger code and
+the code includes the debug output trace mechanism and has a much larger code
+and
data size.
Previous Release (VC 9.0):
@@ -108,14 +189,16 @@ header files, disassembler, table compiler, and template generator. Bob Moore,
Lin Ming.
AcpiXtract: Correctly handle embedded comments and messages from AcpiDump.
-Apparently some or all versions of acpidump will occasionally emit a comment like
+Apparently some or all versions of acpidump will occasionally emit a comment
+like
"Wrong checksum", etc., into the dump file. This was causing problems for
AcpiXtract. ACPICA BZ 905.
iASL: Fix the Linux makefile by removing an inadvertent double file inclusion.
ACPICA BZ 913.
-AcpiExec: Update installation of operation region handlers. Install one handler
+AcpiExec: Update installation of operation region handlers. Install one
+handler
for a user-defined address space. This is used by the ASL test suite (ASLTS).
----------------------------------------
diff --git a/sys/contrib/dev/acpica/debugger/dbexec.c b/sys/contrib/dev/acpica/debugger/dbexec.c
index 3d46335..eb0dde2 100644
--- a/sys/contrib/dev/acpica/debugger/dbexec.c
+++ b/sys/contrib/dev/acpica/debugger/dbexec.c
@@ -53,7 +53,8 @@
ACPI_MODULE_NAME ("dbexec")
-static ACPI_DB_METHOD_INFO AcpiGbl_DbMethodInfo;
+static ACPI_DB_METHOD_INFO AcpiGbl_DbMethodInfo;
+#define DB_DEFAULT_PKG_ELEMENTS 33
/* Local prototypes */
@@ -81,6 +82,348 @@ AcpiDbExecutionWalk (
void *Context,
void **ReturnValue);
+static ACPI_STATUS
+AcpiDbHexCharToValue (
+ int HexChar,
+ UINT8 *ReturnValue);
+
+static ACPI_STATUS
+AcpiDbConvertToPackage (
+ char *String,
+ ACPI_OBJECT *Object);
+
+static ACPI_STATUS
+AcpiDbConvertToObject (
+ ACPI_OBJECT_TYPE Type,
+ char *String,
+ ACPI_OBJECT *Object);
+
+static void
+AcpiDbDeleteObjects (
+ UINT32 Count,
+ ACPI_OBJECT *Objects);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbHexCharToValue
+ *
+ * PARAMETERS: HexChar - Ascii Hex digit, 0-9|a-f|A-F
+ * ReturnValue - Where the converted value is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a single hex character to a 4-bit number (0-16).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbHexCharToValue (
+ int HexChar,
+ UINT8 *ReturnValue)
+{
+ UINT8 Value;
+
+
+ /* Digit must be ascii [0-9a-fA-F] */
+
+ if (!ACPI_IS_XDIGIT (HexChar))
+ {
+ return (AE_BAD_HEX_CONSTANT);
+ }
+
+ if (HexChar <= 0x39)
+ {
+ Value = (UINT8) (HexChar - 0x30);
+ }
+ else
+ {
+ Value = (UINT8) (ACPI_TOUPPER (HexChar) - 0x37);
+ }
+
+ *ReturnValue = Value;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbHexByteToBinary
+ *
+ * PARAMETERS: HexByte - Double hex digit (0x00 - 0xFF) in format:
+ * HiByte then LoByte.
+ * ReturnValue - Where the converted value is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert two hex characters to an 8 bit number (0 - 255).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbHexByteToBinary (
+ char *HexByte,
+ UINT8 *ReturnValue)
+{
+ UINT8 Local0;
+ UINT8 Local1;
+ ACPI_STATUS Status;
+
+
+ /* High byte */
+
+ Status = AcpiDbHexCharToValue (HexByte[0], &Local0);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Low byte */
+
+ Status = AcpiDbHexCharToValue (HexByte[1], &Local1);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ *ReturnValue = (UINT8) ((Local0 << 4) | Local1);
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbConvertToBuffer
+ *
+ * PARAMETERS: String - Input string to be converted
+ * Object - Where the buffer object is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a string to a buffer object. String is treated a list
+ * of buffer elements, each separated by a space or comma.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToBuffer (
+ char *String,
+ ACPI_OBJECT *Object)
+{
+ UINT32 i;
+ UINT32 j;
+ UINT32 Length;
+ UINT8 *Buffer;
+ ACPI_STATUS Status;
+
+
+ /* Generate the final buffer length */
+
+ for (i = 0, Length = 0; String[i];)
+ {
+ i+=2;
+ Length++;
+
+ while (String[i] &&
+ ((String[i] == ',') || (String[i] == ' ')))
+ {
+ i++;
+ }
+ }
+
+ Buffer = ACPI_ALLOCATE (Length);
+ if (!Buffer)
+ {
+ return (AE_NO_MEMORY);
+ }
+
+ /* Convert the command line bytes to the buffer */
+
+ for (i = 0, j = 0; String[i];)
+ {
+ Status = AcpiDbHexByteToBinary (&String[i], &Buffer[j]);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_FREE (Buffer);
+ return (Status);
+ }
+
+ j++;
+ i+=2;
+ while (String[i] &&
+ ((String[i] == ',') || (String[i] == ' ')))
+ {
+ i++;
+ }
+ }
+
+ Object->Type = ACPI_TYPE_BUFFER;
+ Object->Buffer.Pointer = Buffer;
+ Object->Buffer.Length = Length;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbConvertToPackage
+ *
+ * PARAMETERS: String - Input string to be converted
+ * Object - Where the package object is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a string to a package object. Handles nested packages
+ * via recursion with AcpiDbConvertToObject.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToPackage (
+ char *String,
+ ACPI_OBJECT *Object)
+{
+ char *This;
+ char *Next;
+ UINT32 i;
+ ACPI_OBJECT_TYPE Type;
+ ACPI_OBJECT *Elements;
+ ACPI_STATUS Status;
+
+
+ Elements = ACPI_ALLOCATE_ZEROED (
+ DB_DEFAULT_PKG_ELEMENTS * sizeof (ACPI_OBJECT));
+
+ This = String;
+ for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++)
+ {
+ This = AcpiDbGetNextToken (This, &Next, &Type);
+ if (!This)
+ {
+ break;
+ }
+
+ /* Recursive call to convert each package element */
+
+ Status = AcpiDbConvertToObject (Type, This, &Elements[i]);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiDbDeleteObjects (i + 1, Elements);
+ ACPI_FREE (Elements);
+ return (Status);
+ }
+
+ This = Next;
+ }
+
+ Object->Type = ACPI_TYPE_PACKAGE;
+ Object->Package.Count = i;
+ Object->Package.Elements = Elements;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbConvertToObject
+ *
+ * PARAMETERS: Type - Object type as determined by parser
+ * String - Input string to be converted
+ * Object - Where the new object is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Convert a typed and tokenized string to an ACPI_OBJECT. Typing:
+ * 1) String objects were surrounded by quotes.
+ * 2) Buffer objects were surrounded by parentheses.
+ * 3) Package objects were surrounded by brackets "[]".
+ * 4) All standalone tokens are treated as integers.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToObject (
+ ACPI_OBJECT_TYPE Type,
+ char *String,
+ ACPI_OBJECT *Object)
+{
+ ACPI_STATUS Status = AE_OK;
+
+
+ switch (Type)
+ {
+ case ACPI_TYPE_STRING:
+ Object->Type = ACPI_TYPE_STRING;
+ Object->String.Pointer = String;
+ Object->String.Length = (UINT32) ACPI_STRLEN (String);
+ break;
+
+ case ACPI_TYPE_BUFFER:
+ Status = AcpiDbConvertToBuffer (String, Object);
+ break;
+
+ case ACPI_TYPE_PACKAGE:
+ Status = AcpiDbConvertToPackage (String, Object);
+ break;
+
+ default:
+ Object->Type = ACPI_TYPE_INTEGER;
+ Status = AcpiUtStrtoul64 (String, 16, &Object->Integer.Value);
+ break;
+ }
+
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDbDeleteObjects
+ *
+ * PARAMETERS: Count - Count of objects in the list
+ * Objects - Array of ACPI_OBJECTs to be deleted
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Delete a list of ACPI_OBJECTS. Handles packages and nested
+ * packages via recursion.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDbDeleteObjects (
+ UINT32 Count,
+ ACPI_OBJECT *Objects)
+{
+ UINT32 i;
+
+
+ for (i = 0; i < Count; i++)
+ {
+ switch (Objects[i].Type)
+ {
+ case ACPI_TYPE_BUFFER:
+ ACPI_FREE (Objects[i].Buffer.Pointer);
+ break;
+
+ case ACPI_TYPE_PACKAGE:
+
+ /* Recursive call to delete package elements */
+
+ AcpiDbDeleteObjects (Objects[i].Package.Count,
+ Objects[i].Package.Elements);
+
+ /* Free the elements array */
+
+ ACPI_FREE (Objects[i].Package.Elements);
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
/*******************************************************************************
*
@@ -104,8 +447,8 @@ AcpiDbExecuteMethod (
ACPI_OBJECT_LIST ParamObjects;
ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS];
ACPI_HANDLE Handle;
- UINT32 i;
ACPI_DEVICE_INFO *ObjInfo;
+ UINT32 i;
ACPI_FUNCTION_TRACE (DbExecuteMethod);
@@ -139,25 +482,37 @@ AcpiDbExecuteMethod (
{
/* Are there arguments to the method? */
+ i = 0;
if (Info->Args && Info->Args[0])
{
- for (i = 0; Info->Args[i] &&
+ /* Get arguments passed on the command line */
+
+ for (; Info->Args[i] &&
(i < ACPI_METHOD_NUM_ARGS) &&
(i < ObjInfo->ParamCount);
i++)
{
- Params[i].Type = ACPI_TYPE_INTEGER;
- Params[i].Integer.Value = ACPI_STRTOUL (Info->Args[i], NULL, 16);
- }
+ /* Convert input string (token) to an actual ACPI_OBJECT */
- ParamObjects.Pointer = Params;
- ParamObjects.Count = i;
+ Status = AcpiDbConvertToObject (Info->Types[i],
+ Info->Args[i], &Params[i]);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status,
+ "While parsing method arguments"));
+ goto Cleanup;
+ }
+ }
}
- else
+
+ /* Create additional "default" parameters as needed */
+
+ if (i < ObjInfo->ParamCount)
{
- /* Setup default parameters */
+ AcpiOsPrintf ("Adding %u arguments containing default values\n",
+ ObjInfo->ParamCount - i);
- for (i = 0; i < ObjInfo->ParamCount; i++)
+ for (; i < ObjInfo->ParamCount; i++)
{
switch (i)
{
@@ -181,13 +536,11 @@ AcpiDbExecuteMethod (
break;
}
}
-
- ParamObjects.Pointer = Params;
- ParamObjects.Count = ObjInfo->ParamCount;
}
- }
- ACPI_FREE (ObjInfo);
+ ParamObjects.Count = ObjInfo->ParamCount;
+ ParamObjects.Pointer = Params;
+ }
/* Prepare for a return object of arbitrary size */
@@ -198,7 +551,7 @@ AcpiDbExecuteMethod (
AcpiGbl_MethodExecuting = TRUE;
Status = AcpiEvaluateObject (NULL,
- Info->Pathname, &ParamObjects, ReturnObj);
+ Info->Pathname, &ParamObjects, ReturnObj);
AcpiGbl_CmSingleStep = FALSE;
AcpiGbl_MethodExecuting = FALSE;
@@ -206,16 +559,20 @@ AcpiDbExecuteMethod (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "while executing %s from debugger", Info->Pathname));
+ "while executing %s from debugger", Info->Pathname));
if (Status == AE_BUFFER_OVERFLOW)
{
ACPI_ERROR ((AE_INFO,
- "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)",
+ "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)",
ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
}
}
+Cleanup:
+ AcpiDbDeleteObjects (ObjInfo->ParamCount, Params);
+ ACPI_FREE (ObjInfo);
+
return_ACPI_STATUS (Status);
}
@@ -380,6 +737,7 @@ void
AcpiDbExecute (
char *Name,
char **Args,
+ ACPI_OBJECT_TYPE *Types,
UINT32 Flags)
{
ACPI_STATUS Status;
@@ -417,6 +775,7 @@ AcpiDbExecute (
AcpiUtStrupr (NameString);
AcpiGbl_DbMethodInfo.Name = NameString;
AcpiGbl_DbMethodInfo.Args = Args;
+ AcpiGbl_DbMethodInfo.Types = Types;
AcpiGbl_DbMethodInfo.Flags = Flags;
ReturnObj.Pointer = NULL;
@@ -529,6 +888,8 @@ AcpiDbMethodThread (
LocalInfo.Arguments[2] = LocalInfo.IndexOfThreadStr;
LocalInfo.Arguments[3] = NULL;
+ LocalInfo.Types = LocalInfo.ArgTypes;
+
(void) AcpiOsSignalSemaphore (Info->InfoGate, 1);
for (i = 0; i < Info->NumLoops; i++)
@@ -696,6 +1057,12 @@ AcpiDbCreateExecutionThreads (
AcpiGbl_DbMethodInfo.Arguments[1] = AcpiGbl_DbMethodInfo.IdOfThreadStr;
AcpiGbl_DbMethodInfo.Arguments[2] = AcpiGbl_DbMethodInfo.IndexOfThreadStr;
AcpiGbl_DbMethodInfo.Arguments[3] = NULL;
+
+ AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes;
+ AcpiGbl_DbMethodInfo.ArgTypes[0] = ACPI_TYPE_INTEGER;
+ AcpiGbl_DbMethodInfo.ArgTypes[1] = ACPI_TYPE_INTEGER;
+ AcpiGbl_DbMethodInfo.ArgTypes[2] = ACPI_TYPE_INTEGER;
+
AcpiDbUInt32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr);
AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
diff --git a/sys/contrib/dev/acpica/debugger/dbinput.c b/sys/contrib/dev/acpica/debugger/dbinput.c
index 5b8e70a..7d8bbb7 100644
--- a/sys/contrib/dev/acpica/debugger/dbinput.c
+++ b/sys/contrib/dev/acpica/debugger/dbinput.c
@@ -54,11 +54,6 @@
/* Local prototypes */
-static char *
-AcpiDbGetNextToken (
- char *String,
- char **Next);
-
static UINT32
AcpiDbGetLine (
char *InputBuffer);
@@ -285,6 +280,10 @@ AcpiDbDisplayHelp (
AcpiOsPrintf (" Call Run to next control method invocation\n");
AcpiOsPrintf (" Debug <Namepath> [Arguments] Single Step a control method\n");
AcpiOsPrintf (" Execute <Namepath> [Arguments] Execute control method\n");
+ AcpiOsPrintf (" Hex Integer Integer method argument\n");
+ AcpiOsPrintf (" \"Ascii String\" String method argument\n");
+ AcpiOsPrintf (" (Byte List) Buffer method argument\n");
+ AcpiOsPrintf (" [Package Element List] Package method argument\n");
AcpiOsPrintf (" Go Allow method to run to completion\n");
AcpiOsPrintf (" Information Display info about the current method\n");
AcpiOsPrintf (" Into Step into (not over) a method call\n");
@@ -318,12 +317,15 @@ AcpiDbDisplayHelp (
*
******************************************************************************/
-static char *
+char *
AcpiDbGetNextToken (
char *String,
- char **Next)
+ char **Next,
+ ACPI_OBJECT_TYPE *ReturnType)
{
char *Start;
+ UINT32 Depth;
+ ACPI_OBJECT_TYPE Type = ACPI_TYPE_INTEGER;
/* At end of buffer? */
@@ -333,7 +335,7 @@ AcpiDbGetNextToken (
return (NULL);
}
- /* Get rid of any spaces at the beginning */
+ /* Remove any spaces at the beginning */
if (*String == ' ')
{
@@ -348,22 +350,88 @@ AcpiDbGetNextToken (
}
}
- if (*String == '"')
+ switch (*String)
{
+ case '"':
+
/* This is a quoted string, scan until closing quote */
String++;
Start = String;
+ Type = ACPI_TYPE_STRING;
- /* Find end of token */
+ /* Find end of string */
while (*String && (*String != '"'))
{
String++;
}
- }
- else
- {
+ break;
+
+ case '(':
+
+ /* This is the start of a buffer, scan until closing paren */
+
+ String++;
+ Start = String;
+ Type = ACPI_TYPE_BUFFER;
+
+ /* Find end of buffer */
+
+ while (*String && (*String != ')'))
+ {
+ String++;
+ }
+ break;
+
+ case '[':
+
+ /* This is the start of a package, scan until closing bracket */
+
+ String++;
+ Depth = 1;
+ Start = String;
+ Type = ACPI_TYPE_PACKAGE;
+
+ /* Find end of package (closing bracket) */
+
+ while (*String)
+ {
+ /* Handle String package elements */
+
+ if (*String == '"')
+ {
+ /* Find end of string */
+
+ String++;
+ while (*String && (*String != '"'))
+ {
+ String++;
+ }
+ if (!(*String))
+ {
+ break;
+ }
+ }
+ else if (*String == '[')
+ {
+ Depth++; /* A nested package declaration */
+ }
+ else if (*String == ']')
+ {
+ Depth--;
+ if (Depth == 0) /* Found final package closing bracket */
+ {
+ break;
+ }
+ }
+
+ String++;
+ }
+ break;
+
+ default:
+
Start = String;
/* Find end of token */
@@ -372,6 +440,7 @@ AcpiDbGetNextToken (
{
String++;
}
+ break;
}
if (!(*String))
@@ -384,6 +453,7 @@ AcpiDbGetNextToken (
*Next = String + 1;
}
+ *ReturnType = Type;
return (Start);
}
@@ -416,7 +486,8 @@ AcpiDbGetLine (
This = AcpiGbl_DbParsedBuf;
for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
{
- AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next);
+ AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
+ &AcpiGbl_DbArgTypes[i]);
if (!AcpiGbl_DbArgs[i])
{
break;
@@ -575,7 +646,8 @@ AcpiDbCommandDispatch (
break;
case CMD_DEBUG:
- AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_SINGLE_STEP);
+ AcpiDbExecute (AcpiGbl_DbArgs[1],
+ &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_SINGLE_STEP);
break;
case CMD_DISASSEMBLE:
@@ -601,7 +673,7 @@ AcpiDbCommandDispatch (
case CMD_EXECUTE:
AcpiDbExecute (AcpiGbl_DbArgs[1],
- &AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP);
+ &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP);
break;
case CMD_FIND:
@@ -961,7 +1033,13 @@ AcpiDbUserCommands (
/* Get the user input line */
- (void) AcpiOsGetLine (AcpiGbl_DbLineBuf);
+ Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,
+ ACPI_DB_LINE_BUFFER_SIZE, NULL);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
+ return (Status);
+ }
/* Check for single or multithreaded debug */
diff --git a/sys/contrib/dev/acpica/debugger/dbutils.c b/sys/contrib/dev/acpica/debugger/dbutils.c
index 8385fc8..bed52e6 100644
--- a/sys/contrib/dev/acpica/debugger/dbutils.c
+++ b/sys/contrib/dev/acpica/debugger/dbutils.c
@@ -382,7 +382,7 @@ AcpiDbUInt32ToHexString (
UINT32 Value,
char *Buffer)
{
- UINT8 i;
+ int i;
if (Value == 0)
@@ -391,10 +391,9 @@ AcpiDbUInt32ToHexString (
return;
}
- ACPI_STRCPY (Buffer, "0x");
- Buffer[10] = '\0';
+ Buffer[8] = '\0';
- for (i = 9; i > 1; i--)
+ for (i = 7; i >= 0; i--)
{
Buffer[i] = Converter [Value & 0x0F];
Value = Value >> 4;
diff --git a/sys/contrib/dev/acpica/debugger/dbxface.c b/sys/contrib/dev/acpica/debugger/dbxface.c
index 2f3708a..e8602bc 100644
--- a/sys/contrib/dev/acpica/debugger/dbxface.c
+++ b/sys/contrib/dev/acpica/debugger/dbxface.c
@@ -137,7 +137,13 @@ AcpiDbStartCommand (
/* Get the user input line */
- (void) AcpiOsGetLine (AcpiGbl_DbLineBuf);
+ Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,
+ ACPI_DB_LINE_BUFFER_SIZE, NULL);
+ if (ACPI_FAILURE (Status))
+ {
+ ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
+ return (Status);
+ }
}
Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, WalkState, Op);
diff --git a/sys/contrib/dev/acpica/include/acconfig.h b/sys/contrib/dev/acpica/include/acconfig.h
index 4b05ed3..7a2107a 100644
--- a/sys/contrib/dev/acpica/include/acconfig.h
+++ b/sys/contrib/dev/acpica/include/acconfig.h
@@ -200,7 +200,8 @@
*
*****************************************************************************/
-#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
+#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 2 /* Max command line arguments */
+#define ACPI_DB_LINE_BUFFER_SIZE 512
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
diff --git a/sys/contrib/dev/acpica/include/acdebug.h b/sys/contrib/dev/acpica/include/acdebug.h
index 9b4822d..2c1fe73 100644
--- a/sys/contrib/dev/acpica/include/acdebug.h
+++ b/sys/contrib/dev/acpica/include/acdebug.h
@@ -277,6 +277,7 @@ void
AcpiDbExecute (
char *Name,
char **Args,
+ ACPI_OBJECT_TYPE *Types,
UINT32 Flags);
void
@@ -357,6 +358,12 @@ AcpiDbUserCommands (
char Prompt,
ACPI_PARSE_OBJECT *Op);
+char *
+AcpiDbGetNextToken (
+ char *String,
+ char **Next,
+ ACPI_OBJECT_TYPE *ReturnType);
+
/*
* dbstats - Generation and display of ACPI table statistics
diff --git a/sys/contrib/dev/acpica/include/acglobal.h b/sys/contrib/dev/acpica/include/acglobal.h
index fc20994..ebbae0f 100644
--- a/sys/contrib/dev/acpica/include/acglobal.h
+++ b/sys/contrib/dev/acpica/include/acglobal.h
@@ -425,10 +425,11 @@ ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_ini_methods;
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_NoRegionSupport;
ACPI_EXTERN char *AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS];
-ACPI_EXTERN char AcpiGbl_DbLineBuf[80];
-ACPI_EXTERN char AcpiGbl_DbParsedBuf[80];
-ACPI_EXTERN char AcpiGbl_DbScopeBuf[40];
-ACPI_EXTERN char AcpiGbl_DbDebugFilename[40];
+ACPI_EXTERN ACPI_OBJECT_TYPE AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS];
+ACPI_EXTERN char AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char AcpiGbl_DbScopeBuf[80];
+ACPI_EXTERN char AcpiGbl_DbDebugFilename[80];
ACPI_EXTERN BOOLEAN AcpiGbl_DbOutputToFile;
ACPI_EXTERN char *AcpiGbl_DbBuffer;
ACPI_EXTERN char *AcpiGbl_DbFilename;
diff --git a/sys/contrib/dev/acpica/include/aclocal.h b/sys/contrib/dev/acpica/include/aclocal.h
index bdefb76..2eb6fc2 100644
--- a/sys/contrib/dev/acpica/include/aclocal.h
+++ b/sys/contrib/dev/acpica/include/aclocal.h
@@ -1198,6 +1198,7 @@ typedef struct acpi_db_method_info
UINT32 NumLoops;
char Pathname[128];
char **Args;
+ ACPI_OBJECT_TYPE *Types;
/*
* Arguments to be passed to method for the command
@@ -1206,6 +1207,7 @@ typedef struct acpi_db_method_info
* Index of current thread inside all them created.
*/
char InitArgs;
+ ACPI_OBJECT_TYPE ArgTypes[4];
char *Arguments[4];
char NumThreadsStr[11];
char IdOfThreadStr[11];
diff --git a/sys/contrib/dev/acpica/include/acpiosxf.h b/sys/contrib/dev/acpica/include/acpiosxf.h
index 53605ad..43ca582 100644
--- a/sys/contrib/dev/acpica/include/acpiosxf.h
+++ b/sys/contrib/dev/acpica/include/acpiosxf.h
@@ -376,9 +376,11 @@ AcpiOsRedirectOutput (
/*
* Debug input
*/
-UINT32
+ACPI_STATUS
AcpiOsGetLine (
- char *Buffer);
+ char *Buffer,
+ UINT32 BufferLength,
+ UINT32 *BytesRead);
/*
diff --git a/sys/contrib/dev/acpica/include/acpixf.h b/sys/contrib/dev/acpica/include/acpixf.h
index 891ccf3..1755261 100644
--- a/sys/contrib/dev/acpica/include/acpixf.h
+++ b/sys/contrib/dev/acpica/include/acpixf.h
@@ -48,7 +48,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20110413
+#define ACPI_CA_VERSION 0x20110527
#include <contrib/dev/acpica/include/actypes.h>
#include <contrib/dev/acpica/include/actbl.h>
diff --git a/sys/contrib/dev/acpica/include/acpredef.h b/sys/contrib/dev/acpica/include/acpredef.h
index 884f118..0496767 100644
--- a/sys/contrib/dev/acpica/include/acpredef.h
+++ b/sys/contrib/dev/acpica/include/acpredef.h
@@ -470,6 +470,7 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_SWS", 0, ACPI_RTYPE_INTEGER}},
{{"_TC1", 0, ACPI_RTYPE_INTEGER}},
{{"_TC2", 0, ACPI_RTYPE_INTEGER}},
+ {{"_TDL", 0, ACPI_RTYPE_INTEGER}},
{{"_TIP", 1, ACPI_RTYPE_INTEGER}},
{{"_TIV", 1, ACPI_RTYPE_INTEGER}},
{{"_TMP", 0, ACPI_RTYPE_INTEGER}},
diff --git a/sys/contrib/dev/acpica/osunixxf.c b/sys/contrib/dev/acpica/osunixxf.c
index 0983bd4..f486c27 100644
--- a/sys/contrib/dev/acpica/osunixxf.c
+++ b/sys/contrib/dev/acpica/osunixxf.c
@@ -311,18 +311,21 @@ AcpiOsVprintf (
*
* FUNCTION: AcpiOsGetLine
*
- * PARAMETERS: fmt - Standard printf format
- * args - Argument list
+ * PARAMETERS: Buffer - Where to return the command line
+ * BufferLength - Maximum length of Buffer
+ * BytesRead - Where the actual byte count is returned
*
- * RETURN: Actual bytes read
+ * RETURN: Status and actual bytes read
*
* DESCRIPTION: Formatted input with argument list pointer
*
*****************************************************************************/
-UINT32
+ACPI_STATUS
AcpiOsGetLine (
- char *Buffer)
+ char *Buffer,
+ UINT32 BufferLength,
+ UINT32 *BytesRead)
{
UINT8 Temp;
UINT32 i;
@@ -330,6 +333,11 @@ AcpiOsGetLine (
for (i = 0; ; i++)
{
+ if (i >= BufferLength)
+ {
+ return (AE_BUFFER_OVERFLOW);
+ }
+
scanf ("%1c", &Temp);
if (!Temp || Temp == '\n')
{
@@ -345,7 +353,11 @@ AcpiOsGetLine (
/* Return the number of bytes in the string */
- return (i);
+ if (BytesRead)
+ {
+ *BytesRead = i;
+ }
+ return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/tables/tbinstal.c b/sys/contrib/dev/acpica/tables/tbinstal.c
index 8e2199f..8697fa1 100644
--- a/sys/contrib/dev/acpica/tables/tbinstal.c
+++ b/sys/contrib/dev/acpica/tables/tbinstal.c
@@ -144,12 +144,28 @@ AcpiTbAddTable (
}
/*
- * Originally, we checked the table signature for "SSDT" or "PSDT" here.
- * Next, we added support for OEMx tables, signature "OEM".
- * Valid tables were encountered with a null signature, so we've just
- * given up on validating the signature, since it seems to be a waste
- * of code. The original code was removed (05/2008).
+ * Validate the incoming table signature.
+ *
+ * 1) Originally, we checked the table signature for "SSDT" or "PSDT".
+ * 2) We added support for OEMx tables, signature "OEM".
+ * 3) Valid tables were encountered with a null signature, so we just
+ * gave up on validating the signature, (05/2008).
+ * 4) We encountered non-AML tables such as the MADT, which caused
+ * interpreter errors and kernel faults. So now, we once again allow
+ * only "SSDT", "OEMx", and now, also a null signature. (05/2011).
*/
+ if ((TableDesc->Pointer->Signature[0] != 0x00) &&
+ (!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) &&
+ (ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3)))
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx",
+ AcpiUtValidAcpiName (*(UINT32 *) TableDesc->Pointer->Signature) ?
+ TableDesc->Pointer->Signature : "????",
+ *(UINT32 *) TableDesc->Pointer->Signature));
+
+ return_ACPI_STATUS (AE_BAD_SIGNATURE);
+ }
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index d65ab8d..135d734 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -3034,16 +3034,18 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd)
#ifdef INET
case AF_INET:
#ifdef __FreeBSD__
- INP_INFO_RLOCK(pi); /* XXX LOR */
- inp = in_pcblookup_hash(pi, saddr->v4, sport, daddr->v4,
- dport, 0, NULL);
+ /*
+ * XXXRW: would be nice if we had an mbuf here so that we
+ * could use in_pcblookup_mbuf().
+ */
+ inp = in_pcblookup(pi, saddr->v4, sport, daddr->v4,
+ dport, INPLOOKUP_RLOCKPCB, NULL);
if (inp == NULL) {
- inp = in_pcblookup_hash(pi, saddr->v4, sport,
- daddr->v4, dport, INPLOOKUP_WILDCARD, NULL);
- if(inp == NULL) {
- INP_INFO_RUNLOCK(pi);
+ inp = in_pcblookup(pi, saddr->v4, sport,
+ daddr->v4, dport, INPLOOKUP_WILDCARD |
+ INPLOOKUP_RLOCKPCB, NULL);
+ if (inp == NULL)
return (-1);
- }
}
#else
inp = in_pcbhashlookup(tb, saddr->v4, sport, daddr->v4, dport);
@@ -3058,16 +3060,18 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd)
#ifdef INET6
case AF_INET6:
#ifdef __FreeBSD__
- INP_INFO_RLOCK(pi);
- inp = in6_pcblookup_hash(pi, &saddr->v6, sport,
- &daddr->v6, dport, 0, NULL);
+ /*
+ * XXXRW: would be nice if we had an mbuf here so that we
+ * could use in6_pcblookup_mbuf().
+ */
+ inp = in6_pcblookup(pi, &saddr->v6, sport,
+ &daddr->v6, dport, INPLOOKUP_RLOCKPCB, NULL);
if (inp == NULL) {
- inp = in6_pcblookup_hash(pi, &saddr->v6, sport,
- &daddr->v6, dport, INPLOOKUP_WILDCARD, NULL);
- if (inp == NULL) {
- INP_INFO_RUNLOCK(pi);
+ inp = in6_pcblookup(pi, &saddr->v6, sport,
+ &daddr->v6, dport, INPLOOKUP_WILDCARD |
+ INPLOOKUP_RLOCKPCB, NULL);
+ if (inp == NULL)
return (-1);
- }
}
#else
inp = in6_pcbhashlookup(tb, &saddr->v6, sport, &daddr->v6,
@@ -3085,9 +3089,10 @@ pf_socket_lookup(int direction, struct pf_pdesc *pd)
return (-1);
}
#ifdef __FreeBSD__
+ INP_RLOCK_ASSERT(inp);
pd->lookup.uid = inp->inp_cred->cr_uid;
pd->lookup.gid = inp->inp_cred->cr_groups[0];
- INP_INFO_RUNLOCK(pi);
+ INP_RUNLOCK(inp);
#else
pd->lookup.uid = inp->inp_socket->so_euid;
pd->lookup.gid = inp->inp_socket->so_egid;
@@ -6135,9 +6140,11 @@ pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif)
#ifdef __FreeBSD__
/* XXX MRT not always INET */ /* stick with table 0 though */
+#ifdef INET
if (af == AF_INET)
in_rtalloc_ign((struct route *)&ro, 0, 0);
else
+#endif
rtalloc_ign((struct route *)&ro, 0);
#else /* ! __FreeBSD__ */
rtalloc_noclone((struct route *)&ro, NO_CLONING);
@@ -6217,9 +6224,11 @@ pf_rtlabel_match(struct pf_addr *addr, sa_family_t af, struct pf_addr_wrap *aw)
# ifdef RTF_PRCLONING
rtalloc_ign((struct route *)&ro, (RTF_CLONING|RTF_PRCLONING));
# else /* !RTF_PRCLONING */
+#ifdef INET
if (af == AF_INET)
in_rtalloc_ign((struct route *)&ro, 0, 0);
else
+#endif
rtalloc_ign((struct route *)&ro, 0);
# endif
#else /* ! __FreeBSD__ */
@@ -6792,11 +6801,13 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, sa_family_t a
KMOD_UDPSTAT_INC(udps_badsum);
break;
}
+#ifdef INET
case IPPROTO_ICMP:
{
KMOD_ICMPSTAT_INC(icps_checksum);
break;
}
+#endif
#ifdef INET6
case IPPROTO_ICMPV6:
{
@@ -6892,9 +6903,11 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p,
case IPPROTO_UDP:
KMOD_UDPSTAT_INC(udps_badsum);
break;
+#ifdef INET
case IPPROTO_ICMP:
KMOD_ICMPSTAT_INC(icps_checksum);
break;
+#endif
#ifdef INET6
case IPPROTO_ICMPV6:
KMOD_ICMP6STAT_INC(icp6s_checksum);
diff --git a/sys/contrib/pf/net/pf_ioctl.c b/sys/contrib/pf/net/pf_ioctl.c
index 2a66fd8..c41fcc6 100644
--- a/sys/contrib/pf/net/pf_ioctl.c
+++ b/sys/contrib/pf/net/pf_ioctl.c
@@ -3735,9 +3735,12 @@ pf_check6_out(void *arg, struct mbuf **m, struct ifnet *ifp, int dir,
*/
int chk;
- /* We need a proper CSUM befor we start (s. OpenBSD ip_output) */
+ /* We need a proper CSUM before we start (s. OpenBSD ip_output) */
if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
+#ifdef INET
+ /* XXX-BZ copy&paste error from r126261? */
in_delayed_cksum(*m);
+#endif
(*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
}
chk = pf_test6(PF_OUT, ifp, m, NULL, inp);
diff --git a/sys/contrib/pf/net/pf_norm.c b/sys/contrib/pf/net/pf_norm.c
index 32ba9f4..cd6d65a 100644
--- a/sys/contrib/pf/net/pf_norm.c
+++ b/sys/contrib/pf/net/pf_norm.c
@@ -949,6 +949,7 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff,
return (NULL);
}
+#ifdef INET
int
pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kif *kif, u_short *reason,
struct pf_pdesc *pd)
@@ -1198,6 +1199,7 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kif *kif, u_short *reason,
return (PF_DROP);
}
+#endif
#ifdef INET6
int
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 21cb7c5..f2e2c42 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/signalvar.h>
#include <sys/systm.h>
#include <sys/cons.h>
+#include <sys/conf.h>
#include <sys/watchdog.h>
#include <sys/kernel.h>
@@ -64,6 +65,7 @@ db_addr_t db_last_addr;
db_addr_t db_prev;
db_addr_t db_next;
+static db_cmdfcn_t db_dump;
static db_cmdfcn_t db_fncall;
static db_cmdfcn_t db_gdb;
static db_cmdfcn_t db_halt;
@@ -102,6 +104,7 @@ static struct command db_cmds[] = {
{ "w", db_write_cmd, CS_MORE|CS_SET_DOT, 0 },
{ "delete", db_delete_cmd, 0, 0 },
{ "d", db_delete_cmd, 0, 0 },
+ { "dump", db_dump, 0, 0 },
{ "break", db_breakpoint_cmd, 0, 0 },
{ "b", db_breakpoint_cmd, 0, 0 },
{ "dwatch", db_deletewatch_cmd, 0, 0 },
@@ -526,6 +529,27 @@ db_error(s)
kdb_reenter();
}
+static void
+db_dump(db_expr_t dummy, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
+{
+ int error;
+
+ error = doadump(FALSE);
+ if (error) {
+ db_printf("Cannot dump: ");
+ switch (error) {
+ case EBUSY:
+ db_printf("debugger got invoked while dumping.\n");
+ break;
+ case ENXIO:
+ db_printf("no dump device specified.\n");
+ break;
+ default:
+ db_printf("unknown error (error=%d).\n", error);
+ break;
+ }
+ }
+}
/*
* Call random function:
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 53528fd..45cfa02 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -661,6 +661,16 @@ aac_detach(device_t dev)
callout_drain(&sc->aac_daemontime);
+ mtx_lock(&sc->aac_io_lock);
+ while (sc->aifflags & AAC_AIFFLAGS_RUNNING) {
+ sc->aifflags |= AAC_AIFFLAGS_EXIT;
+ wakeup(sc->aifthread);
+ msleep(sc->aac_dev, &sc->aac_io_lock, PUSER, "aacdch", 0);
+ }
+ mtx_unlock(&sc->aac_io_lock);
+ KASSERT((sc->aifflags & AAC_AIFFLAGS_RUNNING) == 0,
+ ("%s: invalid detach state", __func__));
+
/* Remove the child containers */
while ((co = TAILQ_FIRST(&sc->aac_container_tqh)) != NULL) {
error = device_delete_child(dev, co->co_disk);
@@ -679,15 +689,6 @@ aac_detach(device_t dev)
free(sim, M_AACBUF);
}
- if (sc->aifflags & AAC_AIFFLAGS_RUNNING) {
- sc->aifflags |= AAC_AIFFLAGS_EXIT;
- wakeup(sc->aifthread);
- tsleep(sc->aac_dev, PUSER | PCATCH, "aacdch", 30 * hz);
- }
-
- if (sc->aifflags & AAC_AIFFLAGS_RUNNING)
- panic("Cannot shutdown AIF thread");
-
if ((error = aac_shutdown(dev)))
return(error);
@@ -1020,7 +1021,7 @@ aac_command_thread(struct aac_softc *sc)
/*
* First see if any FIBs need to be allocated. This needs
* to be called without the driver lock because contigmalloc
- * will grab Giant, and would result in an LOR.
+ * can sleep.
*/
if ((sc->aifflags & AAC_AIFFLAGS_ALLOCFIBS) != 0) {
mtx_unlock(&sc->aac_io_lock);
@@ -1372,7 +1373,9 @@ aac_alloc_command(struct aac_softc *sc, struct aac_command **cmp)
if ((cm = aac_dequeue_free(sc)) == NULL) {
if (sc->total_fibs < sc->aac_max_fibs) {
+ mtx_lock(&sc->aac_io_lock);
sc->aifflags |= AAC_AIFFLAGS_ALLOCFIBS;
+ mtx_unlock(&sc->aac_io_lock);
wakeup(sc->aifthread);
}
return (EBUSY);
diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h
index 61f3c5b..d994acf 100644
--- a/sys/dev/aac/aacvar.h
+++ b/sys/dev/aac/aacvar.h
@@ -386,13 +386,12 @@ struct aac_softc
struct proc *aifthread;
int aifflags;
#define AAC_AIFFLAGS_RUNNING (1 << 0)
-#define AAC_AIFFLAGS_AIF (1 << 1)
+#define AAC_AIFFLAGS_UNUSED0 (1 << 1)
#define AAC_AIFFLAGS_EXIT (1 << 2)
#define AAC_AIFFLAGS_EXITED (1 << 3)
-#define AAC_AIFFLAGS_PRINTF (1 << 4)
+#define AAC_AIFFLAGS_UNUSED1 (1 << 4)
#define AAC_AIFFLAGS_ALLOCFIBS (1 << 5)
-#define AAC_AIFFLAGS_PENDING (AAC_AIFFLAGS_AIF | AAC_AIFFLAGS_PRINTF | \
- AAC_AIFFLAGS_ALLOCFIBS)
+#define AAC_AIFFLAGS_PENDING AAC_AIFFLAGS_ALLOCFIBS
u_int32_t flags;
#define AAC_FLAGS_PERC2QC (1 << 0)
#define AAC_FLAGS_ENABLE_CAM (1 << 1) /* No SCSI passthrough */
diff --git a/sys/dev/acpica/Osd/OsdDebug.c b/sys/dev/acpica/Osd/OsdDebug.c
index 8425357..0547f75 100644
--- a/sys/dev/acpica/Osd/OsdDebug.c
+++ b/sys/dev/acpica/Osd/OsdDebug.c
@@ -47,20 +47,23 @@ __FBSDID("$FreeBSD$");
#include <dev/acpica/acpivar.h>
-UINT32
-AcpiOsGetLine(char *Buffer)
+ACPI_STATUS
+AcpiOsGetLine(char *Buffer, UINT32 BufferLength, UINT32 *BytesRead)
{
#ifdef DDB
- char *cp;
+ char *cp;
- db_readline(Buffer, 80);
- for (cp = Buffer; *cp != 0; cp++)
- if (*cp == '\n')
- *cp = 0;
- return (AE_OK);
+ cp = Buffer;
+ if (db_readline(Buffer, BufferLength) > 0)
+ while (*cp != '\0' && *cp != '\n' && *cp != '\r')
+ cp++;
+ *cp = '\0';
+ if (BytesRead != NULL)
+ *BytesRead = cp - Buffer;
+ return (AE_OK);
#else
- printf("AcpiOsGetLine called but no input support");
- return (AE_NOT_EXIST);
+ printf("AcpiOsGetLine called but no input support");
+ return (AE_NOT_EXIST);
#endif /* DDB */
}
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index f6d6094..84f65bd 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -123,6 +123,8 @@ static int acpi_set_resource(device_t dev, device_t child, int type,
static struct resource *acpi_alloc_resource(device_t bus, device_t child,
int type, int *rid, u_long start, u_long end,
u_long count, u_int flags);
+static int acpi_adjust_resource(device_t bus, device_t child, int type,
+ struct resource *r, u_long start, u_long end);
static int acpi_release_resource(device_t bus, device_t child, int type,
int rid, struct resource *r);
static void acpi_delete_resource(device_t bus, device_t child, int type,
@@ -149,6 +151,7 @@ static ACPI_STATUS acpi_sleep_disable(struct acpi_softc *sc);
static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state);
static void acpi_shutdown_final(void *arg, int howto);
static void acpi_enable_fixed_events(struct acpi_softc *sc);
+static BOOLEAN acpi_has_hid(ACPI_HANDLE handle);
static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate);
static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate);
static int acpi_wake_prep_walk(int sstate);
@@ -193,6 +196,7 @@ static device_method_t acpi_methods[] = {
DEVMETHOD(bus_set_resource, acpi_set_resource),
DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
DEVMETHOD(bus_alloc_resource, acpi_alloc_resource),
+ DEVMETHOD(bus_adjust_resource, acpi_adjust_resource),
DEVMETHOD(bus_release_resource, acpi_release_resource),
DEVMETHOD(bus_delete_resource, acpi_delete_resource),
DEVMETHOD(bus_child_pnpinfo_str, acpi_child_pnpinfo_str_method),
@@ -1325,29 +1329,40 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
}
static int
-acpi_release_resource(device_t bus, device_t child, int type, int rid,
- struct resource *r)
+acpi_is_resource_managed(int type, struct resource *r)
{
- struct rman *rm;
- int ret;
/* We only handle memory and IO resources through rman. */
switch (type) {
case SYS_RES_IOPORT:
- rm = &acpi_rman_io;
- break;
+ return (rman_is_region_manager(r, &acpi_rman_io));
case SYS_RES_MEMORY:
- rm = &acpi_rman_mem;
- break;
- default:
- rm = NULL;
+ return (rman_is_region_manager(r, &acpi_rman_mem));
}
+ return (0);
+}
+
+static int
+acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r,
+ u_long start, u_long end)
+{
+
+ if (acpi_is_resource_managed(type, r))
+ return (rman_adjust_resource(r, start, end));
+ return (bus_generic_adjust_resource(bus, child, type, r, start, end));
+}
+
+static int
+acpi_release_resource(device_t bus, device_t child, int type, int rid,
+ struct resource *r)
+{
+ int ret;
/*
* If this resource belongs to one of our internal managers,
* deactivate it and release it to the local pool.
*/
- if (rm != NULL && rman_is_region_manager(r, rm)) {
+ if (acpi_is_resource_managed(type, r)) {
if (rman_get_flags(r) & RF_ACTIVE) {
ret = bus_deactivate_resource(child, type, rid, r);
if (ret != 0)
@@ -1841,6 +1856,13 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
break;
if (acpi_parse_prw(handle, &prw) == 0)
AcpiSetupGpeForWake(handle, prw.gpe_handle, prw.gpe_bit);
+
+ /*
+ * Ignore devices that do not have a _HID or _CID. They should
+ * be discovered by other buses (e.g. the PCI bus driver).
+ */
+ if (!acpi_has_hid(handle))
+ break;
/* FALLTHROUGH */
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_THERMAL:
@@ -2029,6 +2051,30 @@ acpi_BatteryIsPresent(device_t dev)
}
/*
+ * Returns true if a device has at least one valid device ID.
+ */
+static BOOLEAN
+acpi_has_hid(ACPI_HANDLE h)
+{
+ ACPI_DEVICE_INFO *devinfo;
+ BOOLEAN ret;
+
+ if (h == NULL ||
+ ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo)))
+ return (FALSE);
+
+ ret = FALSE;
+ if ((devinfo->Valid & ACPI_VALID_HID) != 0)
+ ret = TRUE;
+ else if ((devinfo->Valid & ACPI_VALID_CID) != 0)
+ if (devinfo->CompatibleIdList.Count > 0)
+ ret = TRUE;
+
+ AcpiOsFree(devinfo);
+ return (ret);
+}
+
+/*
* Match a HID string against a handle
*/
BOOLEAN
diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c
index 76cbacb..44db74a 100644
--- a/sys/dev/acpica/acpi_pci.c
+++ b/sys/dev/acpica/acpi_pci.c
@@ -209,38 +209,24 @@ acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child)
device_t child;
/*
- * Lookup and remove the unused device that acpi0 creates when it walks
- * the namespace creating devices.
+ * Occasionally a PCI device may show up as an ACPI device
+ * with a _HID. (For example, the TabletPC TC1000 has a
+ * second PCI-ISA bridge that has a _HID for an
+ * acpi_sysresource device.) In that case, leave ACPI-CA's
+ * device data pointing at the ACPI-enumerated device.
*/
child = acpi_get_device(handle);
if (child != NULL) {
- if (device_is_alive(child)) {
- /*
- * The TabletPC TC1000 has a second PCI-ISA bridge
- * that has a _HID for an acpi_sysresource device.
- * In that case, leave ACPI-CA's device data pointing
- * at the ACPI-enumerated device.
- */
- device_printf(child,
- "Conflicts with PCI device %d:%d:%d\n",
- pci_get_bus(pci_child), pci_get_slot(pci_child),
- pci_get_function(pci_child));
- return;
- }
KASSERT(device_get_parent(child) ==
devclass_get_device(devclass_find("acpi"), 0),
("%s: child (%s)'s parent is not acpi0", __func__,
acpi_name(handle)));
- device_delete_child(device_get_parent(child), child);
+ return;
}
/*
* Update ACPI-CA to use the PCI enumerated device_t for this handle.
*/
- status = AcpiDetachData(handle, acpi_fake_objhandler);
- if (ACPI_FAILURE(status))
- printf("WARNING: Unable to detach object data from %s - %s\n",
- acpi_name(handle), AcpiFormatException(status));
status = AcpiAttachData(handle, acpi_fake_objhandler, pci_child);
if (ACPI_FAILURE(status))
printf("WARNING: Unable to attach object data to %s - %s\n",
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 2a06492..136011c 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -119,6 +119,7 @@ static struct {
#define AHCI_Q_NOBSYRES 256
#define AHCI_Q_NOAA 512
#define AHCI_Q_NOCOUNT 1024
+#define AHCI_Q_ALTSIG 2048
} ahci_ids[] = {
{0x43801002, 0x00, "ATI IXP600", 0},
{0x43901002, 0x00, "ATI IXP700", 0},
@@ -192,8 +193,9 @@ static struct {
{0x614511ab, 0x00, "Marvell 88SX6145", AHCI_Q_NOFORCE | AHCI_Q_4CH |
AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT},
{0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES},
- {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES},
+ {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
{0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES},
+ {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES},
{0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES},
{0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES},
{0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES},
@@ -398,6 +400,13 @@ ahci_attach(device_t dev)
if (ctlr->caps & AHCI_CAP_EMS)
ctlr->capsem = ATA_INL(ctlr->r_mem, AHCI_EM_CTL);
ctlr->ichannels = ATA_INL(ctlr->r_mem, AHCI_PI);
+
+ /* Identify and set separate quirks for HBA and RAID f/w Marvells. */
+ if ((ctlr->quirks & AHCI_Q_NOBSYRES) &&
+ (ctlr->quirks & AHCI_Q_ALTSIG) &&
+ (ctlr->caps & AHCI_CAP_SPM) == 0)
+ ctlr->quirks &= ~AHCI_Q_NOBSYRES;
+
if (ctlr->quirks & AHCI_Q_1CH) {
ctlr->caps &= ~AHCI_CAP_NPMASK;
ctlr->ichannels &= 0x01;
@@ -1764,7 +1773,7 @@ ahci_execute_transaction(struct ahci_slot *slot)
struct ahci_cmd_list *clp;
union ccb *ccb = slot->ccb;
int port = ccb->ccb_h.target_id & 0x0f;
- int fis_size, i;
+ int fis_size, i, softreset;
uint8_t *fis = ch->dma.rfis + 0x40;
uint8_t val;
@@ -1791,17 +1800,20 @@ ahci_execute_transaction(struct ahci_slot *slot)
if ((ccb->ccb_h.func_code == XPT_ATA_IO) &&
(ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) {
if (ccb->ataio.cmd.control & ATA_A_RESET) {
+ softreset = 1;
/* Kick controller into sane state */
ahci_stop(dev);
ahci_clo(dev);
ahci_start(dev, 0);
clp->cmd_flags |= AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY;
} else {
+ softreset = 2;
/* Prepare FIS receive area for check. */
for (i = 0; i < 20; i++)
fis[i] = 0xff;
}
- }
+ } else
+ softreset = 0;
clp->bytecount = 0;
clp->cmd_table_phys = htole64(ch->dma.work_bus + AHCI_CT_OFFSET +
(AHCI_CT_SIZE * slot->slot));
@@ -1825,8 +1837,7 @@ ahci_execute_transaction(struct ahci_slot *slot)
ATA_OUTL(ch->r_mem, AHCI_P_CI, (1 << slot->slot));
/* Device reset commands doesn't interrupt. Poll them. */
if (ccb->ccb_h.func_code == XPT_ATA_IO &&
- (ccb->ataio.cmd.command == ATA_DEVICE_RESET ||
- (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL))) {
+ (ccb->ataio.cmd.command == ATA_DEVICE_RESET || softreset)) {
int count, timeout = ccb->ccb_h.timeout * 100;
enum ahci_err_type et = AHCI_ERR_NONE;
@@ -1834,10 +1845,13 @@ ahci_execute_transaction(struct ahci_slot *slot)
DELAY(10);
if (!(ATA_INL(ch->r_mem, AHCI_P_CI) & (1 << slot->slot)))
break;
- if (ATA_INL(ch->r_mem, AHCI_P_TFD) & ATA_S_ERROR) {
+ if ((ATA_INL(ch->r_mem, AHCI_P_TFD) & ATA_S_ERROR) &&
+ softreset != 1) {
+#if 0
device_printf(ch->dev,
"Poll error on slot %d, TFD: %04x\n",
slot->slot, ATA_INL(ch->r_mem, AHCI_P_TFD));
+#endif
et = AHCI_ERR_TFE;
break;
}
@@ -1849,9 +1863,20 @@ ahci_execute_transaction(struct ahci_slot *slot)
break;
}
}
+
+ /* Marvell controllers do not wait for readyness. */
+ if ((ch->quirks & AHCI_Q_NOBSYRES) && softreset == 2 &&
+ et == AHCI_ERR_NONE) {
+ while ((val = fis[2]) & ATA_S_BUSY) {
+ DELAY(10);
+ if (count++ >= timeout)
+ break;
+ }
+ }
+
if (timeout && (count >= timeout)) {
- device_printf(ch->dev,
- "Poll timeout on slot %d\n", slot->slot);
+ device_printf(dev, "Poll timeout on slot %d port %d\n",
+ slot->slot, port);
device_printf(dev, "is %08x cs %08x ss %08x "
"rs %08x tfd %02x serr %08x\n",
ATA_INL(ch->r_mem, AHCI_P_IS),
@@ -1861,30 +1886,11 @@ ahci_execute_transaction(struct ahci_slot *slot)
ATA_INL(ch->r_mem, AHCI_P_SERR));
et = AHCI_ERR_TIMEOUT;
}
- /* Marvell controllers do not wait for readyness. */
- if ((ch->quirks & AHCI_Q_NOBSYRES) &&
- (ccb->ccb_h.func_code == XPT_ATA_IO) &&
- (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) &&
- (ccb->ataio.cmd.control & ATA_A_RESET) == 0) {
- while ((val = fis[2]) & (ATA_S_BUSY | ATA_S_DRQ)) {
- DELAY(10);
- if (count++ >= timeout) {
- device_printf(dev, "device is not "
- "ready after soft-reset: "
- "tfd = %08x\n", val);
- et = AHCI_ERR_TIMEOUT;
- break;
- }
- }
- }
- ahci_end_transaction(slot, et);
+
/* Kick controller into sane state and enable FBS. */
- if ((ccb->ccb_h.func_code == XPT_ATA_IO) &&
- (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) &&
- (ccb->ataio.cmd.control & ATA_A_RESET) == 0) {
- ahci_stop(ch->dev);
- ahci_start(ch->dev, 1);
- }
+ if (softreset == 2)
+ ch->eslots |= (1 << slot->slot);
+ ahci_end_transaction(slot, et);
return;
}
/* Start command execution timeout */
@@ -1962,7 +1968,8 @@ ahci_timeout(struct ahci_slot *slot)
return;
}
- device_printf(dev, "Timeout on slot %d\n", slot->slot);
+ device_printf(dev, "Timeout on slot %d port %d\n",
+ slot->slot, slot->ccb->ccb_h.target_id & 0x0f);
device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n",
ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI),
ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots,
@@ -2013,6 +2020,7 @@ ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et)
union ccb *ccb = slot->ccb;
struct ahci_cmd_list *clp;
int lastto;
+ uint32_t sig;
bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
@@ -2050,6 +2058,20 @@ ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et)
res->lba_high_exp = fis[10];
res->sector_count = fis[12];
res->sector_count_exp = fis[13];
+
+ /*
+ * Some weird controllers do not return signature in
+ * FIS receive area. Read it from PxSIG register.
+ */
+ if ((ch->quirks & AHCI_Q_ALTSIG) &&
+ (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) &&
+ (ccb->ataio.cmd.control & ATA_A_RESET) == 0) {
+ sig = ATA_INL(ch->r_mem, AHCI_P_SIG);
+ res->lba_high = sig >> 24;
+ res->lba_mid = sig >> 16;
+ res->lba_low = sig >> 8;
+ res->sector_count = sig;
+ }
} else
bzero(res, sizeof(*res));
if ((ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) == 0 &&
@@ -2169,13 +2191,6 @@ ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et)
ch->numhslots++;
} else
xpt_done(ccb);
- /* Unfreeze frozen command. */
- if (ch->frozen && !ahci_check_collision(dev, ch->frozen)) {
- union ccb *fccb = ch->frozen;
- ch->frozen = NULL;
- ahci_begin_transaction(dev, fccb);
- xpt_release_simq(ch->sim, TRUE);
- }
/* If we have no other active commands, ... */
if (ch->rslots == 0) {
/* if there was fatal error - reset port. */
@@ -2185,6 +2200,7 @@ ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et)
/* if we have slots in error, we can reinit port. */
if (ch->eslots != 0) {
ahci_stop(dev);
+ ahci_clo(dev);
ahci_start(dev, 1);
}
/* if there commands on hold, we can do READ LOG. */
@@ -2195,6 +2211,13 @@ ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et)
} else if ((ch->rslots & ~ch->toslots) == 0 &&
et != AHCI_ERR_TIMEOUT)
ahci_rearm_timeout(dev);
+ /* Unfreeze frozen command. */
+ if (ch->frozen && !ahci_check_collision(dev, ch->frozen)) {
+ union ccb *fccb = ch->frozen;
+ ch->frozen = NULL;
+ ahci_begin_transaction(dev, fccb);
+ xpt_release_simq(ch->sim, TRUE);
+ }
/* Start PM timer. */
if (ch->numrslots == 0 && ch->pm_level > 3 &&
(ch->curr[ch->pm_present ? 15 : 0].caps & CTS_SATA_CAPS_D_PMREQ)) {
diff --git a/sys/dev/amdsbwd/amdsbwd.c b/sys/dev/amdsbwd/amdsbwd.c
index f5f0f87..4256381 100644
--- a/sys/dev/amdsbwd/amdsbwd.c
+++ b/sys/dev/amdsbwd/amdsbwd.c
@@ -25,8 +25,8 @@
*/
/*
- * This is a driver for watchdog timer present in AMD SB600/SB7xx
- * south bridges and other watchdog timers advertised via WDRT ACPI table.
+ * This is a driver for watchdog timer present in AMD SB600/SB7xx/SB8xx
+ * southbridges.
* Please see the following specifications for the descriptions of the
* registers and flags:
* - AMD SB600 Register Reference Guide, Public Version, Rev. 3.03 (SB600 RRG)
@@ -35,11 +35,13 @@
* http://developer.amd.com/assets/43009_sb7xx_rrg_pub_1.00.pdf
* - AMD SB700/710/750 Register Programming Requirements (RPR)
* http://developer.amd.com/assets/42413_sb7xx_rpr_pub_1.00.pdf
+ * - AMD SB800-Series Southbridges Register Reference Guide (RRG)
+ * http://support.amd.com/us/Embedded_TechDocs/45482.pdf
* Please see the following for Watchdog Resource Table specification:
* - Watchdog Timer Hardware Requirements for Windows Server 2003 (WDRT)
* http://www.microsoft.com/whdc/system/sysinternals/watchdog.mspx
- * AMD SB600/SB7xx watchdog hardware seems to conform to the above,
- * but my system doesn't provide the table.
+ * AMD SB600/SB7xx/SB8xx watchdog hardware seems to conform to the above
+ * specifications, but the table hasn't been spotted in the wild yet.
*/
#include <sys/cdefs.h>
@@ -59,15 +61,15 @@ __FBSDID("$FreeBSD$");
#include <dev/pci/pcivar.h>
#include <isa/isavar.h>
-/* RRG 2.3.3.1.1, page 161. */
+/* SB7xx RRG 2.3.3.1.1. */
#define AMDSB_PMIO_INDEX 0xcd6
#define AMDSB_PMIO_DATA (PMIO_INDEX + 1)
#define AMDSB_PMIO_WIDTH 2
-/* RRG 2.3.3.2, page 181. */
+/* SB7xx RRG 2.3.3.2. */
#define AMDSB_PM_RESET_STATUS0 0x44
#define AMDSB_PM_RESET_STATUS1 0x45
#define AMDSB_WD_RST_STS 0x02
-/* RRG 2.3.3.2, page 188; RPR 2.36, page 30. */
+/* SB7xx RRG 2.3.3.2, RPR 2.36. */
#define AMDSB_PM_WDT_CTRL 0x69
#define AMDSB_WDT_DISABLE 0x01
#define AMDSB_WDT_RES_MASK (0x02 | 0x04)
@@ -77,7 +79,18 @@ __FBSDID("$FreeBSD$");
#define AMDSB_WDT_RES_1S 0x06
#define AMDSB_PM_WDT_BASE_LSB 0x6c
#define AMDSB_PM_WDT_BASE_MSB 0x6f
-/* RRG 2.3.4, page 223, WDRT. */
+/* SB8xx RRG 2.3.3. */
+#define AMDSB8_PM_WDT_EN 0x48
+#define AMDSB8_WDT_DEC_EN 0x01
+#define AMDSB8_WDT_DISABLE 0x02
+#define AMDSB8_PM_WDT_CTRL 0x4c
+#define AMDSB8_WDT_32KHZ 0x00
+#define AMDSB8_WDT_1HZ 0x03
+#define AMDSB8_WDT_RES_MASK 0x03
+#define AMDSB8_PM_RESET_STATUS0 0xC0
+#define AMDSB8_PM_RESET_STATUS1 0xC1
+#define AMDSB8_WD_RST_STS 0x20
+/* SB7xx RRG 2.3.4, WDRT. */
#define AMDSB_WD_CTRL 0x00
#define AMDSB_WD_RUN 0x01
#define AMDSB_WD_FIRED 0x02
@@ -90,8 +103,9 @@ __FBSDID("$FreeBSD$");
#define AMDSB_WDIO_REG_WIDTH 4
/* WDRT */
#define MAXCOUNT_MIN_VALUE 511
-/* RRG 2.3.1.1, page 122; SB600 RRG 2.3.1.1, page 97. */
-#define AMDSB7xx_SMBUS_DEVID 0x43851002
+/* SB7xx RRG 2.3.1.1, SB600 RRG 2.3.1.1, SB8xx RRG 2.3.1. */
+#define AMDSB_SMBUS_DEVID 0x43851002
+#define AMDSB8_SMBUS_REVID 0x40
#define amdsbwd_verbose_printf(dev, ...) \
do { \
@@ -265,7 +279,7 @@ amdsbwd_identify(driver_t *driver, device_t parent)
smb_dev = pci_find_bsf(0, 20, 0);
if (smb_dev == NULL)
return;
- if (pci_get_devid(smb_dev) != AMDSB7xx_SMBUS_DEVID)
+ if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID)
return;
child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1);
@@ -273,15 +287,102 @@ amdsbwd_identify(driver_t *driver, device_t parent)
device_printf(parent, "add amdsbwd child failed\n");
}
+
+static void
+amdsbwd_probe_sb7xx(device_t dev, struct resource *pmres, uint32_t *addr)
+{
+ uint32_t val;
+ int i;
+
+ /* Report cause of previous reset for user's convenience. */
+ val = pmio_read(pmres, AMDSB_PM_RESET_STATUS0);
+ if (val != 0)
+ amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val);
+ val = pmio_read(pmres, AMDSB_PM_RESET_STATUS1);
+ if (val != 0)
+ amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val);
+ if ((val & AMDSB_WD_RST_STS) != 0)
+ device_printf(dev, "Previous Reset was caused by Watchdog\n");
+
+ /* Find base address of memory mapped WDT registers. */
+ for (*addr = 0, i = 0; i < 4; i++) {
+ *addr <<= 8;
+ *addr |= pmio_read(pmres, AMDSB_PM_WDT_BASE_MSB - i);
+ }
+ /* Set watchdog timer tick to 1s. */
+ val = pmio_read(pmres, AMDSB_PM_WDT_CTRL);
+ val &= ~AMDSB_WDT_RES_MASK;
+ val |= AMDSB_WDT_RES_10MS;
+ pmio_write(pmres, AMDSB_PM_WDT_CTRL, val);
+
+ /* Enable watchdog device (in stopped state). */
+ val = pmio_read(pmres, AMDSB_PM_WDT_CTRL);
+ val &= ~AMDSB_WDT_DISABLE;
+ pmio_write(pmres, AMDSB_PM_WDT_CTRL, val);
+
+ /*
+ * XXX TODO: Ensure that watchdog decode is enabled
+ * (register 0x41, bit 3).
+ */
+ device_set_desc(dev, "AMD SB600/SB7xx Watchdog Timer");
+}
+
+static void
+amdsbwd_probe_sb8xx(device_t dev, struct resource *pmres, uint32_t *addr)
+{
+ uint32_t val;
+ int i;
+
+ /* Report cause of previous reset for user's convenience. */
+ val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS0);
+ if (val != 0)
+ amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val);
+ val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS1);
+ if (val != 0)
+ amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val);
+ if ((val & AMDSB8_WD_RST_STS) != 0)
+ device_printf(dev, "Previous Reset was caused by Watchdog\n");
+
+ /* Find base address of memory mapped WDT registers. */
+ for (*addr = 0, i = 0; i < 4; i++) {
+ *addr <<= 8;
+ *addr |= pmio_read(pmres, AMDSB8_PM_WDT_EN + 3 - i);
+ }
+ *addr &= ~0x07u;
+
+ /* Set watchdog timer tick to 1s. */
+ val = pmio_read(pmres, AMDSB8_PM_WDT_CTRL);
+ val &= ~AMDSB8_WDT_RES_MASK;
+ val |= AMDSB8_WDT_1HZ;
+ pmio_write(pmres, AMDSB8_PM_WDT_CTRL, val);
+#ifdef AMDSBWD_DEBUG
+ val = pmio_read(pmres, AMDSB8_PM_WDT_CTRL);
+ amdsbwd_verbose_printf(dev, "AMDSB8_PM_WDT_CTRL value = %#02x\n", val);
+#endif
+
+ /*
+ * Enable watchdog device (in stopped state)
+ * and decoding of its address.
+ */
+ val = pmio_read(pmres, AMDSB8_PM_WDT_EN);
+ val &= ~AMDSB8_WDT_DISABLE;
+ val |= AMDSB8_WDT_DEC_EN;
+ pmio_write(pmres, AMDSB8_PM_WDT_EN, val);
+#ifdef AMDSBWD_DEBUG
+ val = pmio_read(pmres, AMDSB8_PM_WDT_EN);
+ device_printf(dev, "AMDSB8_PM_WDT_EN value = %#02x\n", val);
+#endif
+ device_set_desc(dev, "AMD SB8xx Watchdog Timer");
+}
+
static int
amdsbwd_probe(device_t dev)
{
struct resource *res;
+ device_t smb_dev;
uint32_t addr;
- uint32_t val;
int rid;
int rc;
- int i;
/* Do not claim some ISA PnP device by accident. */
if (isa_get_logicalid(dev) != 0)
@@ -301,21 +402,16 @@ amdsbwd_probe(device_t dev)
return (ENXIO);
}
- /* Report cause of previous reset for user's convenience. */
- val = pmio_read(res, AMDSB_PM_RESET_STATUS0);
- if (val != 0)
- amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val);
- val = pmio_read(res, AMDSB_PM_RESET_STATUS1);
- if (val != 0)
- amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val);
- if ((val & AMDSB_WD_RST_STS) != 0)
- device_printf(dev, "Previous Reset was caused by Watchdog\n");
+ smb_dev = pci_find_bsf(0, 20, 0);
+ KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n"));
+ if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID)
+ amdsbwd_probe_sb7xx(dev, res, &addr);
+ else
+ amdsbwd_probe_sb8xx(dev, res, &addr);
+
+ bus_release_resource(dev, SYS_RES_IOPORT, rid, res);
+ bus_delete_resource(dev, SYS_RES_IOPORT, rid);
- /* Find base address of memory mapped WDT registers. */
- for (addr = 0, i = 0; i < 4; i++) {
- addr <<= 8;
- addr |= pmio_read(res, AMDSB_PM_WDT_BASE_MSB - i);
- }
amdsbwd_verbose_printf(dev, "memory base address = %#010x\n", addr);
rc = bus_set_resource(dev, SYS_RES_MEMORY, 0, addr + AMDSB_WD_CTRL,
AMDSB_WDIO_REG_WIDTH);
@@ -330,36 +426,25 @@ amdsbwd_probe(device_t dev)
return (ENXIO);
}
- /* Set watchdog timer tick to 10ms. */
- val = pmio_read(res, AMDSB_PM_WDT_CTRL);
- val &= ~AMDSB_WDT_RES_MASK;
- val |= AMDSB_WDT_RES_10MS;
- pmio_write(res, AMDSB_PM_WDT_CTRL, val);
-
- /* Enable watchdog device (in stopped state). */
- val = pmio_read(res, AMDSB_PM_WDT_CTRL);
- val &= ~AMDSB_WDT_DISABLE;
- pmio_write(res, AMDSB_PM_WDT_CTRL, val);
-
- /*
- * XXX TODO: Ensure that watchdog decode is enabled
- * (register 0x41, bit 3).
- */
- bus_release_resource(dev, SYS_RES_IOPORT, rid, res);
- bus_delete_resource(dev, SYS_RES_IOPORT, rid);
-
- device_set_desc(dev, "AMD SB600/SB7xx Watchdog Timer");
return (0);
}
static int
amdsbwd_attach_sb(device_t dev, struct amdsbwd_softc *sc)
{
+ device_t smb_dev;
+
sc->max_ticks = UINT16_MAX;
- sc->ms_per_tick = 10;
sc->rid_ctrl = 0;
sc->rid_count = 1;
+ smb_dev = pci_find_bsf(0, 20, 0);
+ KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n"));
+ if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID)
+ sc->ms_per_tick = 10;
+ else
+ sc->ms_per_tick = 1000;
+
sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
&sc->rid_ctrl, RF_ACTIVE);
if (sc->res_ctrl == NULL) {
@@ -388,6 +473,11 @@ amdsbwd_attach(device_t dev)
if (rc != 0)
goto fail;
+#ifdef AMDSBWD_DEBUG
+ device_printf(dev, "wd ctrl = %#04x\n", wdctrl_read(sc));
+ device_printf(dev, "wd count = %#04x\n", wdcount_read(sc));
+#endif
+
/* Setup initial state of Watchdog Control. */
wdctrl_write(sc, AMDSB_WD_FIRED);
diff --git a/sys/dev/ata/ata-sata.c b/sys/dev/ata/ata-sata.c
index e95fc8f..1ddf238 100644
--- a/sys/dev/ata/ata-sata.c
+++ b/sys/dev/ata/ata-sata.c
@@ -54,6 +54,11 @@ ata_sata_phy_check_events(device_t dev, int port)
u_int32_t error, status;
ata_sata_scr_read(ch, port, ATA_SERROR, &error);
+
+ /* Check that SError value is sane. */
+ if (error == 0xffffffff)
+ return;
+
/* Clear set error bits/interrupt. */
if (error)
ata_sata_scr_write(ch, port, ATA_SERROR, error);
@@ -163,18 +168,18 @@ ata_sata_phy_reset(device_t dev, int port, int quick)
if (bootverbose) {
if (port < 0) {
- device_printf(dev, "hardware reset ...\n");
+ device_printf(dev, "hard reset ...\n");
} else {
- device_printf(dev, "p%d: hardware reset ...\n", port);
+ device_printf(dev, "p%d: hard reset ...\n", port);
}
}
for (retry = 0; retry < 10; retry++) {
for (loop = 0; loop < 10; loop++) {
if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET))
- return (0);
+ goto fail;
ata_udelay(100);
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val))
- return (0);
+ goto fail;
if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_RESET)
break;
}
@@ -183,15 +188,26 @@ ata_sata_phy_reset(device_t dev, int port, int quick)
if (ata_sata_scr_write(ch, port, ATA_SCONTROL,
ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 :
ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)))
- return (0);
+ goto fail;
ata_udelay(100);
if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val))
- return (0);
+ goto fail;
if ((val & ATA_SC_DET_MASK) == 0)
return ata_sata_connect(ch, port, 0);
}
}
- return 0;
+fail:
+ /* Clear SATA error register. */
+ ata_sata_scr_write(ch, port, ATA_SERROR, 0xffffffff);
+
+ if (bootverbose) {
+ if (port < 0) {
+ device_printf(dev, "hard reset failed\n");
+ } else {
+ device_printf(dev, "p%d: hard reset failed\n", port);
+ }
+ }
+ return (0);
}
int
diff --git a/sys/dev/ata/chipsets/ata-intel.c b/sys/dev/ata/chipsets/ata-intel.c
index 3b514db..e128051 100644
--- a/sys/dev/ata/chipsets/ata-intel.c
+++ b/sys/dev/ata/chipsets/ata-intel.c
@@ -288,7 +288,9 @@ ata_intel_chipinit(device_t dev)
ATA_OUTL(ctlr->r_res2, 0x0C,
ATA_INL(ctlr->r_res2, 0x0C) | 0xf);
}
- } else {
+ /* Skip BAR(5) on ICH8M Apples, system locks up on access. */
+ } else if (ctlr->chip->chipid != ATA_I82801HBM_S1 ||
+ pci_get_subvendor(dev) != 0x106b) {
ctlr->r_type2 = SYS_RES_IOPORT;
ctlr->r_rid2 = PCIR_BAR(5);
ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
diff --git a/sys/dev/ath/ath_dfs/null/dfs_null.c b/sys/dev/ath/ath_dfs/null/dfs_null.c
new file mode 100644
index 0000000..2f050a4
--- /dev/null
+++ b/sys/dev/ath/ath_dfs/null/dfs_null.c
@@ -0,0 +1,160 @@
+/*-
+ * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd
+ * All rights reserved.
+ *
+ * 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,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ * redistribution must be conditioned upon including a substantially
+ * similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+ *
+ * $FreeBSD$
+ */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * This implements an empty DFS module.
+ */
+#include "opt_inet.h"
+#include "opt_wlan.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/errno.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+#include <net/if_arp.h>
+#include <net/ethernet.h> /* XXX for ether_sprintf */
+
+#include <net80211/ieee80211_var.h>
+
+#include <net/bpf.h>
+
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#endif
+
+#include <dev/ath/if_athvar.h>
+#include <dev/ath/if_athdfs.h>
+
+#include <dev/ath/ath_hal/ah_desc.h>
+
+/*
+ * Methods which are required
+ */
+
+/*
+ * Attach DFS to the given interface
+ */
+int
+ath_dfs_attach(struct ath_softc *sc)
+{
+ return 1;
+}
+
+/*
+ * Detach DFS from the given interface
+ */
+int
+ath_dfs_detach(struct ath_softc *sc)
+{
+ return 1;
+}
+
+/*
+ * Enable radar check
+ */
+void
+ath_dfs_radar_enable(struct ath_softc *sc, struct ieee80211_channel *chan)
+{
+ /* Check if the current channel is radar-enabled */
+ if (! IEEE80211_IS_CHAN_DFS(chan))
+ return;
+}
+
+/*
+ * Process DFS related PHY errors
+ */
+void
+ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf,
+ uint64_t tsf, struct ath_rx_status *rxstat)
+{
+
+}
+
+/*
+ * Process the radar events and determine whether a DFS event has occured.
+ *
+ * This is designed to run outside of the RX processing path.
+ * The RX path will call ath_dfs_tasklet_needed() to see whether
+ * the task/callback running this routine needs to be called.
+ */
+int
+ath_dfs_process_radar_event(struct ath_softc *sc,
+ struct ieee80211_channel *chan)
+{
+ return 0;
+}
+
+/*
+ * Determine whether the the DFS check task needs to be queued.
+ *
+ * This is called in the RX task when the current batch of packets
+ * have been received. It will return whether there are any radar
+ * events for ath_dfs_process_radar_event() to handle.
+ */
+int
+ath_dfs_tasklet_needed(struct ath_softc *sc, struct ieee80211_channel *chan)
+{
+ return 0;
+}
+
+/*
+ * Handle ioctl requests from the diagnostic interface
+ */
+int
+ath_ioctl_phyerr(struct ath_softc *sc, struct ath_diag *ad)
+{
+ return 1;
+}
+
+/*
+ * Get the current DFS thresholds from the HAL
+ */
+int
+ath_dfs_get_thresholds(struct ath_softc *sc, HAL_PHYERR_PARAM *param)
+{
+ ath_hal_getdfsthresh(sc->sc_ah, param);
+ return 1;
+}
diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c
index 13a59f1..647f322 100644
--- a/sys/dev/ath/ath_hal/ah.c
+++ b/sys/dev/ath/ath_hal/ah.c
@@ -117,6 +117,8 @@ ath_hal_mac_name(struct ath_hal *ah)
return "9280";
case AR_XSREV_VERSION_KITE:
return "9285";
+ case AR_XSREV_VERSION_KIWI:
+ return "9287";
}
return "????";
}
@@ -608,6 +610,10 @@ ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
return HAL_OK;
case HAL_CAP_4ADDR_AGGR:
return pCap->hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP;
+ case HAL_CAP_EXT_CHAN_DFS:
+ return pCap->halExtChanDfsSupport ? HAL_OK : HAL_ENOTSUPP;
+ case HAL_CAP_COMBINED_RADAR_RSSI:
+ return pCap->halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_AUTO_SLEEP:
return pCap->halAutoSleepSupport ? HAL_OK : HAL_ENOTSUPP;
case HAL_CAP_MBSSID_AGGR_SUPPORT:
@@ -624,6 +630,8 @@ ath_hal_getcapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
case HAL_CAP_RXTSTAMP_PREC: /* rx desc tstamp precision (bits) */
*result = pCap->halTstampPrecision;
return HAL_OK;
+ case HAL_CAP_ENHANCED_DFS_SUPPORT:
+ return pCap->halEnhancedDfsSupport ? HAL_OK : HAL_ENOTSUPP;
/* FreeBSD-specific entries for now */
case HAL_CAP_RXORN_FATAL: /* HAL_INT_RXORN treated as fatal */
diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h
index 85790e1..7a01be3 100644
--- a/sys/dev/ath/ath_hal/ah.h
+++ b/sys/dev/ath/ath_hal/ah.h
@@ -121,6 +121,9 @@ typedef enum {
HAL_CAP_RTS_AGGR_LIMIT = 42, /* aggregation limit with RTS */
HAL_CAP_4ADDR_AGGR = 43, /* hardware is capable of 4addr aggregation */
+ HAL_CAP_DFS_DMN = 44, /* current DFS domain */
+ HAL_CAP_EXT_CHAN_DFS = 45, /* DFS support for extension channel */
+ HAL_CAP_COMBINED_RADAR_RSSI = 46, /* Is combined RSSI for radar accurate */
HAL_CAP_AUTO_SLEEP = 48, /* hardware can go to network sleep
automatically after waking up to receive TIM */
@@ -133,6 +136,7 @@ typedef enum {
HAL_CAP_HT20_SGI = 96, /* hardware supports HT20 short GI */
HAL_CAP_RXTSTAMP_PREC = 100, /* rx desc tstamp precision (bits) */
+ HAL_CAP_ENHANCED_DFS_SUPPORT = 117, /* hardware supports enhanced DFS */
/* The following are private to the FreeBSD HAL (224 onward) */
@@ -669,6 +673,90 @@ typedef struct {
} HAL_CHANNEL_SURVEY;
/*
+ * ANI commands.
+ *
+ * These are used both internally and externally via the diagnostic
+ * API.
+ *
+ * Note that this is NOT the ANI commands being used via the INTMIT
+ * capability - that has a different mapping for some reason.
+ */
+typedef enum {
+ HAL_ANI_PRESENT = 0, /* is ANI support present */
+ HAL_ANI_NOISE_IMMUNITY_LEVEL = 1, /* set level */
+ HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION = 2, /* enable/disable */
+ HAL_ANI_CCK_WEAK_SIGNAL_THR = 3, /* enable/disable */
+ HAL_ANI_FIRSTEP_LEVEL = 4, /* set level */
+ HAL_ANI_SPUR_IMMUNITY_LEVEL = 5, /* set level */
+ HAL_ANI_MODE = 6, /* 0 => manual, 1 => auto (XXX do not change) */
+ HAL_ANI_PHYERR_RESET = 7, /* reset phy error stats */
+} HAL_ANI_CMD;
+
+/*
+ * This is the layout of the ANI INTMIT capability.
+ *
+ * Notice that the command values differ to HAL_ANI_CMD.
+ */
+typedef enum {
+ HAL_CAP_INTMIT_PRESENT = 0,
+ HAL_CAP_INTMIT_ENABLE = 1,
+ HAL_CAP_INTMIT_NOISE_IMMUNITY_LEVEL = 2,
+ HAL_CAP_INTMIT_OFDM_WEAK_SIGNAL_LEVEL = 3,
+ HAL_CAP_INTMIT_CCK_WEAK_SIGNAL_THR = 4,
+ HAL_CAP_INTMIT_FIRSTEP_LEVEL = 5,
+ HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL = 6
+} HAL_CAP_INTMIT_CMD;
+
+typedef struct {
+ int32_t pe_firpwr; /* FIR pwr out threshold */
+ int32_t pe_rrssi; /* Radar rssi thresh */
+ int32_t pe_height; /* Pulse height thresh */
+ int32_t pe_prssi; /* Pulse rssi thresh */
+ int32_t pe_inband; /* Inband thresh */
+
+ /* The following params are only for AR5413 and later */
+ u_int32_t pe_relpwr; /* Relative power threshold in 0.5dB steps */
+ u_int32_t pe_relstep; /* Pulse Relative step threshold in 0.5dB steps */
+ u_int32_t pe_maxlen; /* Max length of radar sign in 0.8us units */
+ HAL_BOOL pe_usefir128; /* Use the average in-band power measured over 128 cycles */
+ HAL_BOOL pe_blockradar; /*
+ * Enable to block radar check if pkt detect is done via OFDM
+ * weak signal detect or pkt is detected immediately after tx
+ * to rx transition
+ */
+ HAL_BOOL pe_enmaxrssi; /*
+ * Enable to use the max rssi instead of the last rssi during
+ * fine gain changes for radar detection
+ */
+ HAL_BOOL pe_extchannel; /* Enable DFS on ext channel */
+} HAL_PHYERR_PARAM;
+
+#define HAL_PHYERR_PARAM_NOVAL 65535
+#define HAL_PHYERR_PARAM_ENABLE 0x8000 /* Enable/Disable if applicable */
+
+
+/*
+ * Flag for setting QUIET period
+ */
+typedef enum {
+ HAL_QUIET_DISABLE = 0x0,
+ HAL_QUIET_ENABLE = 0x1,
+ HAL_QUIET_ADD_CURRENT_TSF = 0x2, /* add current TSF to next_start offset */
+ HAL_QUIET_ADD_SWBA_RESP_TIME = 0x4, /* add beacon response time to next_start offset */
+} HAL_QUIET_FLAG;
+
+#define HAL_DFS_EVENT_PRICH 0x0000001
+
+struct dfs_event {
+ uint64_t re_full_ts; /* 64-bit full timestamp from interrupt time */
+ uint32_t re_ts; /* Original 15 bit recv timestamp */
+ uint8_t re_rssi; /* rssi of radar event */
+ uint8_t re_dur; /* duration of radar pulse */
+ uint32_t re_flags; /* Flags (see above) */
+};
+typedef struct dfs_event HAL_DFS_EVENT;
+
+/*
* Hardware Access Layer (HAL) API.
*
* Clients of the HAL call ath_hal_attach to obtain a reference to an
@@ -842,6 +930,18 @@ struct ath_hal {
u_int __ahdecl(*ah_getCTSTimeout)(struct ath_hal*);
HAL_BOOL __ahdecl(*ah_setDecompMask)(struct ath_hal*, uint16_t, int);
void __ahdecl(*ah_setCoverageClass)(struct ath_hal*, uint8_t, int);
+ HAL_STATUS __ahdecl(*ah_setQuiet)(struct ath_hal *ah, uint32_t period,
+ uint32_t duration, uint32_t nextStart,
+ HAL_QUIET_FLAG flag);
+
+ /* DFS functions */
+ void __ahdecl(*ah_enableDfs)(struct ath_hal *ah,
+ HAL_PHYERR_PARAM *pe);
+ void __ahdecl(*ah_getDfsThresh)(struct ath_hal *ah,
+ HAL_PHYERR_PARAM *pe);
+ HAL_BOOL __ahdecl(*ah_procRadarEvent)(struct ath_hal *ah,
+ struct ath_rx_status *rxs, uint64_t fulltsf,
+ const char *buf, HAL_DFS_EVENT *event);
/* Key Cache Functions */
uint32_t __ahdecl(*ah_getKeyCacheSize)(struct ath_hal*);
diff --git a/sys/dev/ath/ath_hal/ah_desc.h b/sys/dev/ath/ath_hal/ah_desc.h
index ff6f40c..bd3e6a8 100644
--- a/sys/dev/ath/ath_hal/ah_desc.h
+++ b/sys/dev/ath/ath_hal/ah_desc.h
@@ -144,7 +144,7 @@ enum {
HAL_PHYERR_RADAR = 5, /* Radar detect */
HAL_PHYERR_SERVICE = 6, /* Illegal service */
HAL_PHYERR_TOR = 7, /* Transmit override receive */
- /* NB: these are specific to the 5212 */
+ /* NB: these are specific to the 5212 and later */
HAL_PHYERR_OFDM_TIMING = 17, /* */
HAL_PHYERR_OFDM_SIGNAL_PARITY = 18, /* */
HAL_PHYERR_OFDM_RATE_ILLEGAL = 19, /* */
@@ -152,6 +152,7 @@ enum {
HAL_PHYERR_OFDM_POWER_DROP = 21, /* */
HAL_PHYERR_OFDM_SERVICE = 22, /* */
HAL_PHYERR_OFDM_RESTART = 23, /* */
+ HAL_PHYERR_FALSE_RADAR_EXT = 24, /* */
HAL_PHYERR_CCK_TIMING = 25, /* */
HAL_PHYERR_CCK_HEADER_CRC = 26, /* */
HAL_PHYERR_CCK_RATE_ILLEGAL = 27, /* */
diff --git a/sys/dev/ath/ath_hal/ah_devid.h b/sys/dev/ath/ath_hal/ah_devid.h
index 64033f3..c7a98dd 100644
--- a/sys/dev/ath/ath_hal/ah_devid.h
+++ b/sys/dev/ath/ath_hal/ah_devid.h
@@ -80,6 +80,8 @@
#define AR9280_DEVID_PCIE 0x002a /* AR9280 PCI-E Merlin */
#define AR9285_DEVID_PCIE 0x002b /* AR9285 PCI-E Kite */
#define AR2427_DEVID_PCIE 0x002c /* AR2427 PCI-E w/ 802.11n bonded out */
+#define AR9287_DEVID_PCI 0x002d /* AR9227 PCI Kiwi */
+#define AR9287_DEVID_PCIE 0x002e /* AR9287 PCI-E Kiwi */
#define AR_SUBVENDOR_ID_NOG 0x0e11 /* No 11G subvendor ID */
#define AR_SUBVENDOR_ID_NEW_A 0x7065 /* Update device to new RD */
diff --git a/sys/dev/ath/ath_hal/ah_eeprom.h b/sys/dev/ath/ath_hal/ah_eeprom.h
index c7fe385..2ca0589 100644
--- a/sys/dev/ath/ath_hal/ah_eeprom.h
+++ b/sys/dev/ath/ath_hal/ah_eeprom.h
@@ -101,7 +101,9 @@ enum {
AR_EEP_ANTGAINMAX_2, /* int8_t* */
AR_EEP_WRITEPROTECT, /* use ath_hal_eepromGetFlag */
AR_EEP_PWR_TABLE_OFFSET,/* int8_t* */
- AR_EEP_PWDCLKIND /* uint8_t* */
+ AR_EEP_PWDCLKIND, /* uint8_t* */
+ AR_EEP_TEMPSENSE_SLOPE, /* int8_t* */
+ AR_EEP_TEMPSENSE_SLOPE_PAL_ON, /* int8_t* */
};
typedef struct {
diff --git a/sys/dev/ath/ath_hal/ah_eeprom_9287.c b/sys/dev/ath/ath_hal/ah_eeprom_9287.c
index e8c5e54..4055093 100644
--- a/sys/dev/ath/ath_hal/ah_eeprom_9287.c
+++ b/sys/dev/ath/ath_hal/ah_eeprom_9287.c
@@ -63,28 +63,10 @@ v9287EepromGet(struct ath_hal *ah, int param, void *val)
return pBase->opCapFlags;
case AR_EEP_RFSILENT:
return pBase->rfSilent;
-#if 0
- case AR_EEP_OB_5:
- return pModal[CHAN_A_IDX].ob;
- case AR_EEP_DB_5:
- return pModal[CHAN_A_IDX].db;
- case AR_EEP_OB_2:
- return pModal[CHAN_B_IDX].ob;
- case AR_EEP_DB_2:
- return pModal[CHAN_B_IDX].db;
-#endif
case AR_EEP_TXMASK:
return pBase->txMask;
case AR_EEP_RXMASK:
return pBase->rxMask;
-#if 0
- case AR_EEP_RXGAIN_TYPE:
- return IS_VERS(>=, AR5416_EEP_MINOR_VER_17) ?
- pBase->rxGainType : AR5416_EEP_RXGAIN_ORIG;
- case AR_EEP_TXGAIN_TYPE:
- return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ?
- pBase->txGainType : AR5416_EEP_TXGAIN_ORIG;
-#endif
case AR_EEP_OL_PWRCTRL:
HALASSERT(val == AH_NULL);
return pBase->openLoopPwrCntl ? HAL_OK : HAL_EIO;
@@ -117,6 +99,18 @@ v9287EepromGet(struct ath_hal *ah, int param, void *val)
case AR_EEP_PWR_TABLE_OFFSET:
*(int8_t *) val = pBase->pwrTableOffset;
return HAL_OK;
+ case AR_EEP_TEMPSENSE_SLOPE:
+ if (IS_VERS(>=, AR9287_EEP_MINOR_VER_2))
+ *(int8_t *)val = pBase->tempSensSlope;
+ else
+ *(int8_t *)val = 0;
+ return HAL_OK;
+ case AR_EEP_TEMPSENSE_SLOPE_PAL_ON:
+ if (IS_VERS(>=, AR9287_EEP_MINOR_VER_3))
+ *(int8_t *)val = pBase->tempSensSlopePalOn;
+ else
+ *(int8_t *)val = 0;
+ return HAL_OK;
default:
HALASSERT(0);
return HAL_EINVAL;
@@ -132,14 +126,12 @@ v9287EepromSet(struct ath_hal *ah, int param, int v)
HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom;
switch (param) {
- case AR_EEP_ANTGAINMAX_2:
- ee->ee_antennaGainMax[1] = (int8_t) v;
- return HAL_OK;
- case AR_EEP_ANTGAINMAX_5:
- ee->ee_antennaGainMax[0] = (int8_t) v;
- return HAL_OK;
+ case AR_EEP_ANTGAINMAX_2:
+ ee->ee_antennaGainMax[1] = (int8_t) v;
+ return HAL_OK;
+ default:
+ return HAL_EINVAL;
}
- return HAL_EINVAL;
}
static HAL_BOOL
diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h
index b4cc817..d66c9d8 100644
--- a/sys/dev/ath/ath_hal/ah_internal.h
+++ b/sys/dev/ath/ath_hal/ah_internal.h
@@ -200,8 +200,10 @@ typedef struct {
halRifsTxSupport : 1,
hal4AddrAggrSupport : 1,
halExtChanDfsSupport : 1,
+ halUseCombinedRadarRssi : 1,
halForcePpmSupport : 1,
halEnhancedPmSupport : 1,
+ halEnhancedDfsSupport : 1,
halMbssidAggrSupport : 1,
halBssidMatchSupport : 1,
hal4kbSplitTransSupport : 1,
@@ -418,18 +420,6 @@ extern HAL_BOOL ath_hal_setTxQProps(struct ath_hal *ah,
extern HAL_BOOL ath_hal_getTxQProps(struct ath_hal *ah,
HAL_TXQ_INFO *qInfo, const HAL_TX_QUEUE_INFO *qi);
-typedef enum {
- HAL_ANI_PRESENT = 0x1, /* is ANI support present */
- HAL_ANI_NOISE_IMMUNITY_LEVEL = 0x2, /* set level */
- HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4, /* enable/disable */
- HAL_ANI_CCK_WEAK_SIGNAL_THR = 0x8, /* enable/disable */
- HAL_ANI_FIRSTEP_LEVEL = 0x10, /* set level */
- HAL_ANI_SPUR_IMMUNITY_LEVEL = 0x20, /* set level */
- HAL_ANI_MODE = 0x40, /* 0 => manual, 1 => auto (XXX do not change) */
- HAL_ANI_PHYERR_RESET =0x80, /* reset phy error stats */
- HAL_ANI_ALL = 0xff
-} HAL_ANI_CMD;
-
#define HAL_SPUR_VAL_MASK 0x3FFF
#define HAL_SPUR_CHAN_WIDTH 87
#define HAL_BIN_WIDTH_BASE_100HZ 3125
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212.h b/sys/dev/ath/ath_hal/ar5212/ar5212.h
index e226816..8503a62 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212.h
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212.h
@@ -320,6 +320,9 @@ struct ath_hal_5212 {
struct ar5212AniState *ah_curani; /* cached last reference */
struct ar5212AniState ah_ani[AH_MAXCHAN]; /* per-channel state */
+ /* AR5416 uses some of the AR5212 ANI code; these are the ANI methods */
+ HAL_BOOL (*ah_aniControl) (struct ath_hal *, HAL_ANI_CMD cmd, int param);
+
/*
* Transmit power state. Note these are maintained
* here so they can be retrieved by diagnostic tools.
@@ -503,6 +506,8 @@ extern HAL_BOOL ar5212SetCapability(struct ath_hal *, HAL_CAPABILITY_TYPE,
extern HAL_BOOL ar5212GetDiagState(struct ath_hal *ah, int request,
const void *args, uint32_t argsize,
void **result, uint32_t *resultsize);
+extern HAL_STATUS ar5212SetQuiet(struct ath_hal *ah, uint32_t period,
+ uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag);
extern HAL_BOOL ar5212SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode,
int setChip);
@@ -615,5 +620,10 @@ extern void ar5212AniReset(struct ath_hal *, const struct ieee80211_channel *,
extern HAL_BOOL ar5212IsNFCalInProgress(struct ath_hal *ah);
extern HAL_BOOL ar5212WaitNFCalComplete(struct ath_hal *ah, int i);
+extern void ar5212EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
+extern void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
+extern HAL_BOOL ar5212ProcessRadarEvent(struct ath_hal *ah,
+ struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf,
+ HAL_DFS_EVENT *event);
#endif /* _ATH_AR5212_H_ */
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
index 4b0fcbe..8e7f3cb 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
@@ -127,6 +127,12 @@ static const struct ath_hal_private ar5212hal = {{
.ah_getCTSTimeout = ar5212GetCTSTimeout,
.ah_setDecompMask = ar5212SetDecompMask,
.ah_setCoverageClass = ar5212SetCoverageClass,
+ .ah_setQuiet = ar5212SetQuiet,
+
+ /* DFS Functions */
+ .ah_enableDfs = ar5212EnableDfs,
+ .ah_getDfsThresh = ar5212GetDfsThresh,
+ .ah_procRadarEvent = ar5212ProcessRadarEvent,
/* Key Cache Functions */
.ah_getKeyCacheSize = ar5212GetKeyCacheSize,
@@ -203,6 +209,9 @@ ar5212AniSetup(struct ath_hal *ah)
ar5212AniAttach(ah, &tmp, &tmp, AH_TRUE);
} else
ar5212AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
+
+ /* Set overridable ANI methods */
+ AH5212(ah)->ah_aniControl = ar5212AniControl;
}
/*
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c b/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
index 0d6adc1..3a6019d 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
@@ -21,9 +21,7 @@
#include "ah.h"
#include "ah_internal.h"
#include "ah_devid.h"
-#ifdef AH_DEBUG
#include "ah_desc.h" /* NB: for HAL_PHYERR* */
-#endif
#include "ar5212/ar5212.h"
#include "ar5212/ar5212reg.h"
@@ -634,6 +632,20 @@ ar5212SetCoverageClass(struct ath_hal *ah, uint8_t coverageclass, int now)
}
}
+HAL_STATUS
+ar5212SetQuiet(struct ath_hal *ah, uint32_t period, uint32_t duration,
+ uint32_t nextStart, HAL_QUIET_FLAG flag)
+{
+ OS_REG_WRITE(ah, AR_QUIET2, period | (duration << AR_QUIET2_QUIET_DUR_S));
+ if (flag & HAL_QUIET_ENABLE) {
+ OS_REG_WRITE(ah, AR_QUIET1, nextStart | (1 << 16));
+ }
+ else {
+ OS_REG_WRITE(ah, AR_QUIET1, nextStart);
+ }
+ return HAL_OK;
+}
+
void
ar5212SetPCUConfig(struct ath_hal *ah)
{
@@ -880,16 +892,16 @@ ar5212GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
return HAL_OK;
case HAL_CAP_INTMIT: /* interference mitigation */
switch (capability) {
- case 0: /* hardware capability */
+ case HAL_CAP_INTMIT_PRESENT: /* hardware capability */
return HAL_OK;
- case 1:
+ case HAL_CAP_INTMIT_ENABLE:
return (ahp->ah_procPhyErr & HAL_ANI_ENA) ?
HAL_OK : HAL_ENXIO;
- case 2: /* HAL_ANI_NOISE_IMMUNITY_LEVEL */
- case 3: /* HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION */
- case 4: /* HAL_ANI_CCK_WEAK_SIGNAL_THR */
- case 5: /* HAL_ANI_FIRSTEP_LEVEL */
- case 6: /* HAL_ANI_SPUR_IMMUNITY_LEVEL */
+ case HAL_CAP_INTMIT_NOISE_IMMUNITY_LEVEL:
+ case HAL_CAP_INTMIT_OFDM_WEAK_SIGNAL_LEVEL:
+ case HAL_CAP_INTMIT_CCK_WEAK_SIGNAL_THR:
+ case HAL_CAP_INTMIT_FIRSTEP_LEVEL:
+ case HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL:
ani = ar5212AniGetCurrentState(ah);
if (ani == AH_NULL)
return HAL_ENXIO;
@@ -980,6 +992,8 @@ ar5212SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
OS_REG_WRITE(ah, AR_TPC, ahp->ah_macTPC);
return AH_TRUE;
case HAL_CAP_INTMIT: { /* interference mitigation */
+ /* This maps the public ANI commands to the internal ANI commands */
+ /* Private: HAL_ANI_CMD; Public: HAL_CAP_INTMIT_CMD */
static const HAL_ANI_CMD cmds[] = {
HAL_ANI_PRESENT,
HAL_ANI_MODE,
@@ -990,7 +1004,7 @@ ar5212SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
HAL_ANI_SPUR_IMMUNITY_LEVEL,
};
return capability < N(cmds) ?
- ar5212AniControl(ah, cmds[capability], setting) :
+ AH5212(ah)->ah_aniControl(ah, cmds[capability], setting) :
AH_FALSE;
}
case HAL_CAP_TSF_ADJUST: /* hardware has beacon tsf adjust */
@@ -1053,7 +1067,7 @@ ar5212GetDiagState(struct ath_hal *ah, int request,
case HAL_DIAG_ANI_CMD:
if (argsize != 2*sizeof(uint32_t))
return AH_FALSE;
- ar5212AniControl(ah, ((const uint32_t *)args)[0],
+ AH5212(ah)->ah_aniControl(ah, ((const uint32_t *)args)[0],
((const uint32_t *)args)[1]);
return AH_TRUE;
case HAL_DIAG_ANI_PARAMS:
@@ -1113,3 +1127,98 @@ ar5212WaitNFCalComplete(struct ath_hal *ah, int i)
}
return AH_FALSE;
}
+
+void
+ar5212EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
+{
+ uint32_t val;
+ val = OS_REG_READ(ah, AR_PHY_RADAR_0);
+
+ if (pe->pe_firpwr != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_FIRPWR;
+ val |= SM(pe->pe_firpwr, AR_PHY_RADAR_0_FIRPWR);
+ }
+ if (pe->pe_rrssi != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_RRSSI;
+ val |= SM(pe->pe_rrssi, AR_PHY_RADAR_0_RRSSI);
+ }
+ if (pe->pe_height != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_HEIGHT;
+ val |= SM(pe->pe_height, AR_PHY_RADAR_0_HEIGHT);
+ }
+ if (pe->pe_prssi != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_PRSSI;
+ val |= SM(pe->pe_prssi, AR_PHY_RADAR_0_PRSSI);
+ }
+ if (pe->pe_inband != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_INBAND;
+ val |= SM(pe->pe_inband, AR_PHY_RADAR_0_INBAND);
+ }
+ OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA);
+}
+
+void
+ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
+{
+ uint32_t val,temp;
+
+ val = OS_REG_READ(ah, AR_PHY_RADAR_0);
+
+ temp = MS(val,AR_PHY_RADAR_0_FIRPWR);
+ temp |= 0xFFFFFF80;
+ pe->pe_firpwr = temp;
+ pe->pe_rrssi = MS(val, AR_PHY_RADAR_0_RRSSI);
+ pe->pe_height = MS(val, AR_PHY_RADAR_0_HEIGHT);
+ pe->pe_prssi = MS(val, AR_PHY_RADAR_0_PRSSI);
+ pe->pe_inband = MS(val, AR_PHY_RADAR_0_INBAND);
+
+ pe->pe_relpwr = 0;
+ pe->pe_relstep = 0;
+ pe->pe_maxlen = 0;
+ pe->pe_extchannel = AH_FALSE;
+}
+
+/*
+ * Process the radar phy error and extract the pulse duration.
+ */
+HAL_BOOL
+ar5212ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs,
+ uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event)
+{
+ uint8_t dur;
+ uint8_t rssi;
+
+ /* Check whether the given phy error is a radar event */
+ if ((rxs->rs_phyerr != HAL_PHYERR_RADAR) &&
+ (rxs->rs_phyerr != HAL_PHYERR_FALSE_RADAR_EXT))
+ return AH_FALSE;
+
+ /*
+ * The first byte is the pulse width - if there's
+ * no data, simply set the duration to 0
+ */
+ if (rxs->rs_datalen >= 1)
+ /* The pulse width is byte 0 of the data */
+ dur = ((uint8_t) buf[0]) & 0xff;
+ else
+ dur = 0;
+
+ /* Pulse RSSI is the normal reported RSSI */
+ rssi = (uint8_t) rxs->rs_rssi;
+
+ /* 0 duration/rssi is not a valid radar event */
+ if (dur == 0 && rssi == 0)
+ return AH_FALSE;
+
+ HALDEBUG(ah, HAL_DEBUG_DFS, "%s: rssi=%d, dur=%d\n",
+ __func__, rssi, dur);
+
+ /* Record the event */
+ event->re_full_ts = fulltsf;
+ event->re_ts = rxs->rs_tstamp;
+ event->re_rssi = rssi;
+ event->re_dur = dur;
+ event->re_flags = HAL_DFS_EVENT_PRICH;
+
+ return AH_TRUE;
+}
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212reg.h b/sys/dev/ath/ath_hal/ar5212/ar5212reg.h
index f99b203..15c1a58 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212reg.h
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212reg.h
@@ -300,6 +300,7 @@
#define AR_QUIET1_NEXT_QUIET 0xffff
#define AR_QUIET1_QUIET_ENABLE 0x10000 /* Enable Quiet time operation */
#define AR_QUIET1_QUIET_ACK_CTS_ENABLE 0x20000 /* Do we ack/cts during quiet period */
+#define AR_QUIET1_QUIET_ACK_CTS_ENABLE_S 17
#define AR_QUIET2 0x8100 /* More Quiet time programming */
#define AR_QUIET2_QUIET_PER_S 0 /* Periodicity of quiet period (TU) */
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416.h b/sys/dev/ath/ath_hal/ar5416/ar5416.h
index 5327296..e5294b0 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416.h
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416.h
@@ -194,6 +194,8 @@ extern uint32_t ar5416Get11nExtBusy(struct ath_hal *ah);
extern void ar5416Set11nMac2040(struct ath_hal *ah, HAL_HT_MACMODE mode);
extern HAL_HT_RXCLEAR ar5416Get11nRxClear(struct ath_hal *ah);
extern void ar5416Set11nRxClear(struct ath_hal *ah, HAL_HT_RXCLEAR rxclear);
+extern HAL_STATUS ar5416SetQuiet(struct ath_hal *ah, uint32_t period,
+ uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag);
extern HAL_STATUS ar5416GetCapability(struct ath_hal *ah,
HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t *result);
extern HAL_BOOL ar5416GetDiagState(struct ath_hal *ah, int request,
@@ -201,6 +203,11 @@ extern HAL_BOOL ar5416GetDiagState(struct ath_hal *ah, int request,
void **result, uint32_t *resultsize);
extern HAL_BOOL ar5416SetRifsDelay(struct ath_hal *ah,
const struct ieee80211_channel *chan, HAL_BOOL enable);
+extern void ar5416EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
+extern void ar5416GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
+extern HAL_BOOL ar5416ProcessRadarEvent(struct ath_hal *ah,
+ struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf,
+ HAL_DFS_EVENT *event);
extern HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode,
int setChip);
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c b/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
index 3a8f785..e2c8592 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
@@ -175,9 +175,17 @@ ar5416AniControl(struct ath_hal *ah, HAL_ANI_CMD cmd, int param)
struct ar5212AniState *aniState = ahp->ah_curani;
const struct ar5212AniParams *params = aniState->params;
+ /* Check whether the particular function is enabled */
+ if (((1 << cmd) & AH5416(ah)->ah_ani_function) == 0) {
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: command %d disabled\n",
+ __func__, cmd);
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: cmd %d; mask %x\n", __func__, cmd, AH5416(ah)->ah_ani_function);
+ return AH_FALSE;
+ }
+
OS_MARK(ah, AH_MARK_ANI_CONTROL, cmd);
- switch (cmd & AH5416(ah)->ah_ani_function) {
+ switch (cmd) {
case HAL_ANI_NOISE_IMMUNITY_LEVEL: {
u_int level = param;
@@ -356,14 +364,14 @@ ar5416AniOfdmErrTrigger(struct ath_hal *ah)
aniState = ahp->ah_curani;
params = aniState->params;
/* First, raise noise immunity level, up to max */
- if ((AH5416(ah)->ah_ani_function & HAL_ANI_NOISE_IMMUNITY_LEVEL) &&
+ if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_NOISE_IMMUNITY_LEVEL)) &&
(aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) {
ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL,
aniState->noiseImmunityLevel + 1);
return;
}
/* then, raise spur immunity level, up to max */
- if ((AH5416(ah)->ah_ani_function & HAL_ANI_SPUR_IMMUNITY_LEVEL) &&
+ if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL)) &&
(aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel)) {
ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL,
aniState->spurImmunityLevel + 1);
@@ -443,7 +451,8 @@ ar5416AniCckErrTrigger(struct ath_hal *ah)
/* first, raise noise immunity level, up to max */
aniState = ahp->ah_curani;
params = aniState->params;
- if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) {
+ if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_NOISE_IMMUNITY_LEVEL) &&
+ aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) {
ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL,
aniState->noiseImmunityLevel + 1);
return;
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
index 6779bf9..e636325 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
@@ -58,7 +58,7 @@ ar5416AniSetup(struct ath_hal *ah)
.period = 100,
};
/* NB: disable ANI noise immmunity for reliable RIFS rx */
- AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL;
+ AH5416(ah)->ah_ani_function &= ~(1 << HAL_ANI_NOISE_IMMUNITY_LEVEL);
ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
}
@@ -139,10 +139,16 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc,
ah->ah_setAntennaSwitch = ar5416SetAntennaSwitch;
ah->ah_setDecompMask = ar5416SetDecompMask;
ah->ah_setCoverageClass = ar5416SetCoverageClass;
+ ah->ah_setQuiet = ar5416SetQuiet;
ah->ah_resetKeyCacheEntry = ar5416ResetKeyCacheEntry;
ah->ah_setKeyCacheEntry = ar5416SetKeyCacheEntry;
+ /* DFS Functions */
+ ah->ah_enableDfs = ar5416EnableDfs;
+ ah->ah_getDfsThresh = ar5416GetDfsThresh;
+ ah->ah_procRadarEvent = ar5416ProcessRadarEvent;
+
/* Power Management Functions */
ah->ah_setPowerMode = ar5416SetPowerMode;
@@ -199,7 +205,10 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc,
AH5416(ah)->ah_tx_chainmask = AR5416_DEFAULT_TXCHAINMASK;
/* Enable all ANI functions to begin with */
- AH5416(ah)->ah_ani_function = HAL_ANI_ALL;
+ AH5416(ah)->ah_ani_function = 0xffffffff;
+
+ /* Set overridable ANI methods */
+ AH5212(ah)->ah_aniControl = ar5416AniControl;
}
uint32_t
@@ -875,6 +884,7 @@ ar5416FillCapabilityInfo(struct ath_hal *ah)
pCap->halBssidMatchSupport = AH_TRUE;
pCap->halGTTSupport = AH_TRUE;
pCap->halCSTSupport = AH_TRUE;
+ pCap->halEnhancedDfsSupport = AH_FALSE;
if (ath_hal_eepromGetFlag(ah, AR_EEP_RFKILL) &&
ath_hal_eepromGet(ah, AR_EEP_RFSILENT, &ahpriv->ah_rfsilent) == HAL_OK) {
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c b/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
index ee61c30..1356c7d 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
@@ -594,8 +594,8 @@ ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *chan)
if (AR_SREV_KITE(ah)) {
/* Kite has only one chain */
chainmask = 0x9;
- } else if (AR_SREV_MERLIN(ah)) {
- /* Merlin has only two chains */
+ } else if (AR_SREV_MERLIN(ah) || AR_SREV_KIWI(ah)) {
+ /* Merlin/Kiwi has only two chains */
chainmask = 0x1B;
} else {
chainmask = 0x3F;
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c b/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
index 8f18c46..2332656 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
@@ -273,6 +273,35 @@ ar5416Set11nRxClear(struct ath_hal *ah, HAL_HT_RXCLEAR rxclear)
}
}
+/* XXX shouldn't be here! */
+#define TU_TO_USEC(_tu) ((_tu) << 10)
+
+HAL_STATUS
+ar5416SetQuiet(struct ath_hal *ah, uint32_t period, uint32_t duration,
+ uint32_t nextStart, HAL_QUIET_FLAG flag)
+{
+ uint32_t period_us = TU_TO_USEC(period); /* convert to us unit */
+ uint32_t nextStart_us = TU_TO_USEC(nextStart); /* convert to us unit */
+ if (flag & HAL_QUIET_ENABLE) {
+ if ((!nextStart) || (flag & HAL_QUIET_ADD_CURRENT_TSF)) {
+ /* Add the nextStart offset to the current TSF */
+ nextStart_us += OS_REG_READ(ah, AR_TSF_L32);
+ }
+ if (flag & HAL_QUIET_ADD_SWBA_RESP_TIME) {
+ nextStart_us += ath_hal_sw_beacon_response_time;
+ }
+ OS_REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1);
+ OS_REG_WRITE(ah, AR_QUIET2, SM(duration, AR_QUIET2_QUIET_DUR));
+ OS_REG_WRITE(ah, AR_QUIET_PERIOD, period_us);
+ OS_REG_WRITE(ah, AR_NEXT_QUIET, nextStart_us);
+ OS_REG_SET_BIT(ah, AR_TIMER_MODE, AR_TIMER_MODE_QUIET);
+ } else {
+ OS_REG_CLR_BIT(ah, AR_TIMER_MODE, AR_TIMER_MODE_QUIET);
+ }
+ return HAL_OK;
+}
+#undef TU_TO_USEC
+
HAL_STATUS
ar5416GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type,
uint32_t capability, uint32_t *result)
@@ -560,3 +589,122 @@ ar5416DetectBBHang(struct ath_hal *ah)
#undef N
}
#undef NUM_STATUS_READS
+
+/*
+ * Get the radar parameter values and return them in the pe
+ * structure
+ */
+void
+ar5416GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
+{
+ uint32_t val, temp;
+
+ val = OS_REG_READ(ah, AR_PHY_RADAR_0);
+
+ temp = MS(val,AR_PHY_RADAR_0_FIRPWR);
+ temp |= 0xFFFFFF80;
+ pe->pe_firpwr = temp;
+ pe->pe_rrssi = MS(val, AR_PHY_RADAR_0_RRSSI);
+ pe->pe_height = MS(val, AR_PHY_RADAR_0_HEIGHT);
+ pe->pe_prssi = MS(val, AR_PHY_RADAR_0_PRSSI);
+ pe->pe_inband = MS(val, AR_PHY_RADAR_0_INBAND);
+
+ val = OS_REG_READ(ah, AR_PHY_RADAR_1);
+ temp = val & AR_PHY_RADAR_1_RELPWR_ENA;
+ pe->pe_relpwr = MS(val, AR_PHY_RADAR_1_RELPWR_THRESH);
+ if (temp)
+ pe->pe_relpwr |= HAL_PHYERR_PARAM_ENABLE;
+ temp = val & AR_PHY_RADAR_1_RELSTEP_CHECK;
+ pe->pe_relstep = MS(val, AR_PHY_RADAR_1_RELSTEP_THRESH);
+ if (temp)
+ pe->pe_relstep |= HAL_PHYERR_PARAM_ENABLE;
+ pe->pe_maxlen = MS(val, AR_PHY_RADAR_1_MAXLEN);
+ pe->pe_extchannel = !! (OS_REG_READ(ah, AR_PHY_RADAR_EXT) &
+ AR_PHY_RADAR_EXT_ENA);
+}
+
+/*
+ * Enable radar detection and set the radar parameters per the
+ * values in pe
+ */
+void
+ar5416EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
+{
+ uint32_t val;
+
+ val = OS_REG_READ(ah, AR_PHY_RADAR_0);
+
+ if (pe->pe_firpwr != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_FIRPWR;
+ val |= SM(pe->pe_firpwr, AR_PHY_RADAR_0_FIRPWR);
+ }
+ if (pe->pe_rrssi != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_RRSSI;
+ val |= SM(pe->pe_rrssi, AR_PHY_RADAR_0_RRSSI);
+ }
+ if (pe->pe_height != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_HEIGHT;
+ val |= SM(pe->pe_height, AR_PHY_RADAR_0_HEIGHT);
+ }
+ if (pe->pe_prssi != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_PRSSI;
+ val |= SM(pe->pe_prssi, AR_PHY_RADAR_0_PRSSI);
+ }
+ if (pe->pe_inband != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_0_INBAND;
+ val |= SM(pe->pe_inband, AR_PHY_RADAR_0_INBAND);
+ }
+
+ /*Enable FFT data*/
+ val |= AR_PHY_RADAR_0_FFT_ENA;
+
+ OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA);
+
+ val = OS_REG_READ(ah, AR_PHY_RADAR_1);
+ val |= (AR_PHY_RADAR_1_MAX_RRSSI | AR_PHY_RADAR_1_BLOCK_CHECK);
+
+ if (pe->pe_maxlen != HAL_PHYERR_PARAM_NOVAL) {
+ val &= ~AR_PHY_RADAR_1_MAXLEN;
+ val |= SM(pe->pe_maxlen, AR_PHY_RADAR_1_MAXLEN);
+ }
+ OS_REG_WRITE(ah, AR_PHY_RADAR_1, val);
+
+ /*
+ * Enable HT/40 if the upper layer asks;
+ * it should check the channel is HT/40 and HAL_CAP_EXT_CHAN_DFS
+ * is available.
+ */
+ if (pe->pe_extchannel)
+ OS_REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
+ else
+ OS_REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
+
+ if (pe->pe_relstep != HAL_PHYERR_PARAM_NOVAL) {
+ val = OS_REG_READ(ah, AR_PHY_RADAR_1);
+ val &= ~AR_PHY_RADAR_1_RELSTEP_THRESH;
+ val |= SM(pe->pe_relstep, AR_PHY_RADAR_1_RELSTEP_THRESH);
+ OS_REG_WRITE(ah, AR_PHY_RADAR_1, val);
+ }
+ if (pe->pe_relpwr != HAL_PHYERR_PARAM_NOVAL) {
+ val = OS_REG_READ(ah, AR_PHY_RADAR_1);
+ val &= ~AR_PHY_RADAR_1_RELPWR_THRESH;
+ val |= SM(pe->pe_relpwr, AR_PHY_RADAR_1_RELPWR_THRESH);
+ OS_REG_WRITE(ah, AR_PHY_RADAR_1, val);
+ }
+}
+
+/*
+ * Extract the radar event information from the given phy error.
+ *
+ * Returns AH_TRUE if the phy error was actually a phy error,
+ * AH_FALSE if the phy error wasn't a phy error.
+ */
+HAL_BOOL
+ar5416ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs,
+ uint64_t fulltsf, const char *buf, HAL_DFS_EVENT *event)
+{
+ /*
+ * For now, this isn't implemented.
+ */
+ return AH_FALSE;
+}
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
index d2ae351..1da686a 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
@@ -167,6 +167,17 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode,
AH5416(ah)->ah_writeIni(ah, chan);
+ if(AR_SREV_KIWI_13_OR_LATER(ah) ) {
+ /* Enable ASYNC FIFO */
+ OS_REG_SET_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
+ AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL);
+ OS_REG_SET_BIT(ah, AR_PHY_MODE, AR_PHY_MODE_ASYNCFIFO);
+ OS_REG_CLR_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
+ AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET);
+ OS_REG_SET_BIT(ah, AR_MAC_PCU_ASYNC_FIFO_REG3,
+ AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET);
+ }
+
/* Override ini values (that can be overriden in this fashion) */
ar5416OverrideIni(ah, chan);
@@ -258,6 +269,12 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode,
OS_REG_WRITE(ah, AR_MAC_LED, OS_REG_READ(ah, AR_MAC_LED) |
saveLedState);
+ /* Start TSF2 for generic timer 8-15 */
+#ifdef NOTYET
+ if (AR_SREV_KIWI(ah))
+ ar5416StartTsf2(ah);
+#endif
+
/* Restore previous antenna */
OS_REG_WRITE(ah, AR_DEF_ANTENNA, saveDefAntenna);
@@ -292,6 +309,41 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMODE opmode,
/* This may override the AR_DIAG_SW register */
ar5416InitUserSettings(ah);
+ if (AR_SREV_KIWI_13_OR_LATER(ah)) {
+ /*
+ * Enable ASYNC FIFO
+ *
+ * If Async FIFO is enabled, the following counters change
+ * as MAC now runs at 117 Mhz instead of 88/44MHz when
+ * async FIFO is disabled.
+ *
+ * Overwrite the delay/timeouts initialized in ProcessIni()
+ * above.
+ */
+ OS_REG_WRITE(ah, AR_D_GBL_IFS_SIFS,
+ AR_D_GBL_IFS_SIFS_ASYNC_FIFO_DUR);
+ OS_REG_WRITE(ah, AR_D_GBL_IFS_SLOT,
+ AR_D_GBL_IFS_SLOT_ASYNC_FIFO_DUR);
+ OS_REG_WRITE(ah, AR_D_GBL_IFS_EIFS,
+ AR_D_GBL_IFS_EIFS_ASYNC_FIFO_DUR);
+
+ OS_REG_WRITE(ah, AR_TIME_OUT,
+ AR_TIME_OUT_ACK_CTS_ASYNC_FIFO_DUR);
+ OS_REG_WRITE(ah, AR_USEC, AR_USEC_ASYNC_FIFO_DUR);
+
+ OS_REG_SET_BIT(ah, AR_MAC_PCU_LOGIC_ANALYZER,
+ AR_MAC_PCU_LOGIC_ANALYZER_DISBUG20768);
+ OS_REG_RMW_FIELD(ah, AR_AHB_MODE, AR_AHB_CUSTOM_BURST_EN,
+ AR_AHB_CUSTOM_BURST_ASYNC_FIFO_VAL);
+ }
+
+ if (AR_SREV_KIWI_13_OR_LATER(ah)) {
+ /* Enable AGGWEP to accelerate encryption engine */
+ OS_REG_SET_BIT(ah, AR_PCU_MISC_MODE2,
+ AR_PCU_MISC_MODE2_ENABLE_AGGWEP);
+ }
+
+
/*
* disable seq number generation in hw
*/
@@ -2576,7 +2628,7 @@ ar5416OverrideIni(struct ath_hal *ah, const struct ieee80211_channel *chan)
if (!AR_SREV_9271(ah))
val &= ~AR_PCU_MISC_MODE2_HWWAR1;
- if (AR_SREV_9287_11_OR_LATER(ah))
+ if (AR_SREV_KIWI_11_OR_LATER(ah))
val = val & (~AR_PCU_MISC_MODE2_HWWAR2);
OS_REG_WRITE(ah, AR_PCU_MISC_MODE2, val);
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416phy.h b/sys/dev/ath/ath_hal/ar5416/ar5416phy.h
index 86643f0..d7a5e0b 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416phy.h
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416phy.h
@@ -21,6 +21,25 @@
#include "ar5212/ar5212phy.h"
+/* For AR_PHY_RADAR0 */
+#define AR_PHY_RADAR_0_FFT_ENA 0x80000000
+
+#define AR_PHY_RADAR_EXT 0x9940
+#define AR_PHY_RADAR_EXT_ENA 0x00004000
+
+#define AR_PHY_RADAR_1 0x9958
+#define AR_PHY_RADAR_1_RELPWR_ENA 0x00800000
+#define AR_PHY_RADAR_1_USE_FIR128 0x00400000
+#define AR_PHY_RADAR_1_RELPWR_THRESH 0x003F0000
+#define AR_PHY_RADAR_1_RELPWR_THRESH_S 16
+#define AR_PHY_RADAR_1_BLOCK_CHECK 0x00008000
+#define AR_PHY_RADAR_1_MAX_RRSSI 0x00004000
+#define AR_PHY_RADAR_1_RELSTEP_CHECK 0x00002000
+#define AR_PHY_RADAR_1_RELSTEP_THRESH 0x00001F00
+#define AR_PHY_RADAR_1_RELSTEP_THRESH_S 8
+#define AR_PHY_RADAR_1_MAXLEN 0x000000FF
+#define AR_PHY_RADAR_1_MAXLEN_S 0
+
#define AR_PHY_CHIP_ID_REV_0 0x80 /* 5416 Rev 0 (owl 1.0) BB */
#define AR_PHY_CHIP_ID_REV_1 0x81 /* 5416 Rev 1 (owl 2.0) BB */
@@ -301,4 +320,6 @@
#define AR_PHY_TX_PWRCTRL9_RES_DC_REMOVAL 0x80000000
#define AR_PHY_TX_PWRCTRL9_RES_DC_REMOVAL_S 31
+#define AR_PHY_MODE_ASYNCFIFO 0x80 /* Enable async fifo */
+
#endif /* _DEV_ATH_AR5416PHY_H_ */
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416reg.h b/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
index 9921366..561c5b4 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
@@ -219,6 +219,10 @@
#define AR_AHB_PAGE_SIZE_1K 0x00000000 /* set page-size as 1k */
#define AR_AHB_PAGE_SIZE_2K 0x00000008 /* set page-size as 2k */
#define AR_AHB_PAGE_SIZE_4K 0x00000010 /* set page-size as 4k */
+/* Kiwi */
+#define AR_AHB_CUSTOM_BURST_EN 0x000000C0 /* set Custom Burst Mode */
+#define AR_AHB_CUSTOM_BURST_EN_S 6 /* set Custom Burst Mode */
+#define AR_AHB_CUSTOM_BURST_ASYNC_FIFO_VAL 3 /* set both bits in Async FIFO mode */
/* MAC PCU Registers */
#define AR_STA_ID1_PRESERVE_SEQNUM 0x20000000 /* Don't replace seq num */
@@ -451,9 +455,23 @@
* For Merlin and above only.
*/
#define AR_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE 0x00000040
+#define AR_PCU_MISC_MODE2_ENABLE_AGGWEP 0x00020000 /* Kiwi or later? */
#define AR_PCU_MISC_MODE2_HWWAR1 0x00100000
#define AR_PCU_MISC_MODE2_HWWAR2 0x02000000
+/* For Kiwi */
+#define AR_MAC_PCU_ASYNC_FIFO_REG3 0x8358
+#define AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL 0x00000400
+#define AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET 0x80000000
+
+/* TSF2. For Kiwi only */
+#define AR_TSF2_L32 0x8390
+#define AR_TSF2_U32 0x8394
+
+/* MAC Direct Connect Control. For Kiwi only */
+#define AR_DIRECT_CONNECT 0x83A0
+#define AR_DC_AP_STA_EN 0x00000001
+
/* GPIO Interrupt */
#define AR_INTR_GPIO 0x3FF00000 /* gpio interrupted */
#define AR_INTR_GPIO_S 20
@@ -488,6 +506,17 @@
#define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700
#define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380
+/* IFS, SIFS, slot, etc for Async FIFO mode (Kiwi) */
+#define AR_D_GBL_IFS_SIFS_ASYNC_FIFO_DUR 0x000003AB
+#define AR_TIME_OUT_ACK_CTS_ASYNC_FIFO_DUR 0x16001D56
+#define AR_USEC_ASYNC_FIFO_DUR 0x12e00074
+#define AR_D_GBL_IFS_SLOT_ASYNC_FIFO_DUR 0x00000420
+#define AR_D_GBL_IFS_EIFS_ASYNC_FIFO_DUR 0x0000A5EB
+
+/* Used by Kiwi Async FIFO */
+#define AR_MAC_PCU_LOGIC_ANALYZER 0x8264
+#define AR_MAC_PCU_LOGIC_ANALYZER_DISBUG20768 0x20000000
+
/* Eeprom defines */
#define AR_EEPROM_STATUS_DATA_VAL 0x0000ffff
#define AR_EEPROM_STATUS_DATA_VAL_S 0
@@ -566,6 +595,11 @@
#define AR_XSREV_REVISION_KITE_10 0 /* Kite 1.0 */
#define AR_XSREV_REVISION_KITE_11 1 /* Kite 1.1 */
#define AR_XSREV_REVISION_KITE_12 2 /* Kite 1.2 */
+#define AR_XSREV_VERSION_KIWI 0x180 /* Kiwi (AR9287) */
+#define AR_XSREV_REVISION_KIWI_10 0
+#define AR_XSREV_REVISION_KIWI_11 1
+#define AR_XSREV_REVISION_KIWI_12 2
+#define AR_XSREV_REVISION_KIWI_13 3
/* Owl (AR5416) */
#define AR_SREV_OWL(_ah) \
@@ -648,9 +682,31 @@
(AR_SREV_KITE_12_OR_LATER(_ah) && \
((OS_REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1))
+#define AR_SREV_KIWI(_ah) \
+ (AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_KIWI)
+
+#define AR_SREV_KIWI_11_OR_LATER(_ah) \
+ (AR_SREV_KIWI(_ah) && \
+ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KIWI_11)
+
+#define AR_SREV_KIWI_11(_ah) \
+ (AR_SREV_KIWI(_ah) && \
+ AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_KIWI_11)
+
+#define AR_SREV_KIWI_12(_ah) \
+ (AR_SREV_KIWI(_ah) && \
+ AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_KIWI_12)
+
+#define AR_SREV_KIWI_12_OR_LATER(_ah) \
+ (AR_SREV_KIWI(_ah) && \
+ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KIWI_12)
+
+#define AR_SREV_KIWI_13_OR_LATER(_ah) \
+ (AR_SREV_KIWI(_ah) && \
+ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KIWI_13)
+
+
/* Not yet implemented chips */
#define AR_SREV_9271(_ah) 0
-#define AR_SREV_9287_11_OR_LATER(_ah) 0
-#define AR_SREV_KIWI_10_OR_LATER(_ah) 0
#endif /* _DEV_ATH_AR5416REG_H */
diff --git a/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c b/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
index 49a5f5e..2a3f3f0 100644
--- a/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
+++ b/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c
@@ -289,6 +289,7 @@ ar9130FillCapabilityInfo(struct ath_hal *ah)
pCap->halRifsTxSupport = AH_TRUE;
pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */
pCap->halExtChanDfsSupport = AH_TRUE;
+ pCap->halUseCombinedRadarRssi = AH_TRUE;
pCap->halAutoSleepSupport = AH_FALSE; /* XXX? */
/*
* MBSSID aggregation is broken in Howl v1.1, v1.2, v1.3
diff --git a/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c b/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
index 0b6472b..44a549d 100644
--- a/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
+++ b/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c
@@ -82,7 +82,7 @@ ar9160AniSetup(struct ath_hal *ah)
};
/* NB: disable ANI noise immmunity for reliable RIFS rx */
- AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL;
+ AH5416(ah)->ah_ani_function &= ~(1 << HAL_ANI_NOISE_IMMUNITY_LEVEL);
ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
}
@@ -293,6 +293,7 @@ ar9160FillCapabilityInfo(struct ath_hal *ah)
pCap->halRifsTxSupport = AH_TRUE;
pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */
pCap->halExtChanDfsSupport = AH_TRUE;
+ pCap->halUseCombinedRadarRssi = AH_TRUE;
pCap->halAutoSleepSupport = AH_FALSE; /* XXX? */
pCap->halMbssidAggrSupport = AH_TRUE;
pCap->hal4AddrAggrSupport = AH_TRUE;
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
index 3351edb..ebe3be1 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
@@ -93,7 +93,7 @@ ar9280AniSetup(struct ath_hal *ah)
.period = 100,
};
/* NB: disable ANI noise immmunity for reliable RIFS rx */
- AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL;
+ AH5416(ah)->ah_ani_function &= ~(1 << HAL_ANI_NOISE_IMMUNITY_LEVEL);
/* NB: ANI is not enabled yet */
ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
@@ -783,6 +783,7 @@ ar9280FillCapabilityInfo(struct ath_hal *ah)
pCap->halRifsTxSupport = AH_TRUE;
pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */
pCap->halExtChanDfsSupport = AH_TRUE;
+ pCap->halUseCombinedRadarRssi = AH_TRUE;
#if 0
/* XXX bluetooth */
pCap->halBtCoexSupport = AH_TRUE;
@@ -804,6 +805,7 @@ ar9280FillCapabilityInfo(struct ath_hal *ah)
}
pCap->halRxStbcSupport = 1;
pCap->halTxStbcSupport = 1;
+ pCap->halEnhancedDfsSupport = AH_TRUE;
return AH_TRUE;
}
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
index b7ed27d..9120313 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
@@ -98,7 +98,7 @@ ar9285AniSetup(struct ath_hal *ah)
.period = 100,
};
/* NB: disable ANI noise immmunity for reliable RIFS rx */
- AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL;
+ AH5416(ah)->ah_ani_function &= ~(1 << HAL_ANI_NOISE_IMMUNITY_LEVEL);
ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
}
@@ -414,6 +414,7 @@ ar9285FillCapabilityInfo(struct ath_hal *ah)
pCap->halRifsTxSupport = AH_TRUE;
pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */
pCap->halExtChanDfsSupport = AH_TRUE;
+ pCap->halUseCombinedRadarRssi = AH_TRUE;
#if 0
/* XXX bluetooth */
pCap->halBtCoexSupport = AH_TRUE;
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287.c b/sys/dev/ath/ath_hal/ar9002/ar9287.c
new file mode 100644
index 0000000..9b874b3
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287.c
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting
+ * Copyright (c) 2008 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+#include "opt_ah.h"
+
+/*
+ * NB: Merlin and later have a simpler RF backend.
+ */
+#include "ah.h"
+#include "ah_internal.h"
+
+#include "ah_eeprom_v14.h"
+
+#include "ar9002/ar9287.h"
+#include "ar5416/ar5416reg.h"
+#include "ar5416/ar5416phy.h"
+
+#define N(a) (sizeof(a)/sizeof(a[0]))
+
+struct ar9287State {
+ RF_HAL_FUNCS base; /* public state, must be first */
+ uint16_t pcdacTable[1]; /* XXX */
+};
+#define AR9287(ah) ((struct ar9287State *) AH5212(ah)->ah_rfHal)
+
+static HAL_BOOL ar9287GetChannelMaxMinPower(struct ath_hal *,
+ const struct ieee80211_channel *, int16_t *maxPow,int16_t *minPow);
+int16_t ar9287GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c);
+
+static void
+ar9287WriteRegs(struct ath_hal *ah, u_int modesIndex, u_int freqIndex,
+ int writes)
+{
+ (void) ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_bb_rfgain,
+ freqIndex, writes);
+}
+
+/*
+ * Take the MHz channel value and set the Channel value
+ *
+ * ASSUMES: Writes enabled to analog bus
+ *
+ * Actual Expression,
+ *
+ * For 2GHz channel,
+ * Channel Frequency = (3/4) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^17)
+ * (freq_ref = 40MHz)
+ *
+ * For 5GHz channel,
+ * Channel Frequency = (3/2) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^10)
+ * (freq_ref = 40MHz/(24>>amodeRefSel))
+ *
+ * For 5GHz channels which are 5MHz spaced,
+ * Channel Frequency = (3/2) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^17)
+ * (freq_ref = 40MHz)
+ */
+static HAL_BOOL
+ar9287SetChannel(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+ uint16_t bMode, fracMode, aModeRefSel = 0;
+ uint32_t freq, ndiv, channelSel = 0, channelFrac = 0, reg32 = 0;
+ CHAN_CENTERS centers;
+ uint32_t refDivA = 24;
+
+ OS_MARK(ah, AH_MARK_SETCHANNEL, chan->ic_freq);
+
+ ar5416GetChannelCenters(ah, chan, &centers);
+ freq = centers.synth_center;
+
+ reg32 = OS_REG_READ(ah, AR_PHY_SYNTH_CONTROL);
+ reg32 &= 0xc0000000;
+
+ if (freq < 4800) { /* 2 GHz, fractional mode */
+ uint32_t txctl;
+ int regWrites = 0;
+
+ bMode = 1;
+ fracMode = 1;
+ aModeRefSel = 0;
+ channelSel = (freq * 0x10000)/15;
+
+ if (AR_SREV_KIWI_11_OR_LATER(ah)) {
+ if (freq == 2484) {
+ ath_hal_ini_write(ah,
+ &AH9287(ah)->ah_ini_cckFirJapan2484, 1,
+ regWrites);
+ } else {
+ ath_hal_ini_write(ah,
+ &AH9287(ah)->ah_ini_cckFirNormal, 1,
+ regWrites);
+ }
+ }
+
+ txctl = OS_REG_READ(ah, AR_PHY_CCK_TX_CTRL);
+ if (freq == 2484) {
+ /* Enable channel spreading for channel 14 */
+ OS_REG_WRITE(ah, AR_PHY_CCK_TX_CTRL,
+ txctl | AR_PHY_CCK_TX_CTRL_JAPAN);
+ } else {
+ OS_REG_WRITE(ah, AR_PHY_CCK_TX_CTRL,
+ txctl &~ AR_PHY_CCK_TX_CTRL_JAPAN);
+ }
+ } else {
+ bMode = 0;
+ fracMode = 0;
+
+ if ((freq % 20) == 0) {
+ aModeRefSel = 3;
+ } else if ((freq % 10) == 0) {
+ aModeRefSel = 2;
+ } else {
+ aModeRefSel = 0;
+ /*
+ * Enable 2G (fractional) mode for channels which
+ * are 5MHz spaced
+ */
+ fracMode = 1;
+ refDivA = 1;
+ channelSel = (freq * 0x8000)/15;
+
+ /* RefDivA setting */
+ OS_A_REG_RMW_FIELD(ah, AR_AN_SYNTH9,
+ AR_AN_SYNTH9_REFDIVA, refDivA);
+ }
+ if (!fracMode) {
+ ndiv = (freq * (refDivA >> aModeRefSel))/60;
+ channelSel = ndiv & 0x1ff;
+ channelFrac = (ndiv & 0xfffffe00) * 2;
+ channelSel = (channelSel << 17) | channelFrac;
+ }
+ }
+
+ reg32 = reg32 | (bMode << 29) | (fracMode << 28) |
+ (aModeRefSel << 26) | (channelSel);
+
+ OS_REG_WRITE(ah, AR_PHY_SYNTH_CONTROL, reg32);
+
+ AH_PRIVATE(ah)->ah_curchan = chan;
+
+ return AH_TRUE;
+}
+
+/*
+ * Return a reference to the requested RF Bank.
+ */
+static uint32_t *
+ar9287GetRfBank(struct ath_hal *ah, int bank)
+{
+ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown RF Bank %d requested\n",
+ __func__, bank);
+ return AH_NULL;
+}
+
+/*
+ * Reads EEPROM header info from device structure and programs
+ * all rf registers
+ */
+static HAL_BOOL
+ar9287SetRfRegs(struct ath_hal *ah, const struct ieee80211_channel *chan,
+ uint16_t modesIndex, uint16_t *rfXpdGain)
+{
+ return AH_TRUE; /* nothing to do */
+}
+
+/*
+ * Read the transmit power levels from the structures taken from EEPROM
+ * Interpolate read transmit power values for this channel
+ * Organize the transmit power values into a table for writing into the hardware
+ */
+
+static HAL_BOOL
+ar9287SetPowerTable(struct ath_hal *ah, int16_t *pPowerMin, int16_t *pPowerMax,
+ const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
+{
+ return AH_TRUE;
+}
+
+#if 0
+static int16_t
+ar9287GetMinPower(struct ath_hal *ah, EXPN_DATA_PER_CHANNEL_5112 *data)
+{
+ int i, minIndex;
+ int16_t minGain,minPwr,minPcdac,retVal;
+
+ /* Assume NUM_POINTS_XPD0 > 0 */
+ minGain = data->pDataPerXPD[0].xpd_gain;
+ for (minIndex=0,i=1; i<NUM_XPD_PER_CHANNEL; i++) {
+ if (data->pDataPerXPD[i].xpd_gain < minGain) {
+ minIndex = i;
+ minGain = data->pDataPerXPD[i].xpd_gain;
+ }
+ }
+ minPwr = data->pDataPerXPD[minIndex].pwr_t4[0];
+ minPcdac = data->pDataPerXPD[minIndex].pcdac[0];
+ for (i=1; i<NUM_POINTS_XPD0; i++) {
+ if (data->pDataPerXPD[minIndex].pwr_t4[i] < minPwr) {
+ minPwr = data->pDataPerXPD[minIndex].pwr_t4[i];
+ minPcdac = data->pDataPerXPD[minIndex].pcdac[i];
+ }
+ }
+ retVal = minPwr - (minPcdac*2);
+ return(retVal);
+}
+#endif
+
+static HAL_BOOL
+ar9287GetChannelMaxMinPower(struct ath_hal *ah,
+ const struct ieee80211_channel *chan,
+ int16_t *maxPow, int16_t *minPow)
+{
+#if 0
+ struct ath_hal_5212 *ahp = AH5212(ah);
+ int numChannels=0,i,last;
+ int totalD, totalF,totalMin;
+ EXPN_DATA_PER_CHANNEL_5112 *data=AH_NULL;
+ EEPROM_POWER_EXPN_5112 *powerArray=AH_NULL;
+
+ *maxPow = 0;
+ if (IS_CHAN_A(chan)) {
+ powerArray = ahp->ah_modePowerArray5112;
+ data = powerArray[headerInfo11A].pDataPerChannel;
+ numChannels = powerArray[headerInfo11A].numChannels;
+ } else if (IS_CHAN_G(chan) || IS_CHAN_108G(chan)) {
+ /* XXX - is this correct? Should we also use the same power for turbo G? */
+ powerArray = ahp->ah_modePowerArray5112;
+ data = powerArray[headerInfo11G].pDataPerChannel;
+ numChannels = powerArray[headerInfo11G].numChannels;
+ } else if (IS_CHAN_B(chan)) {
+ powerArray = ahp->ah_modePowerArray5112;
+ data = powerArray[headerInfo11B].pDataPerChannel;
+ numChannels = powerArray[headerInfo11B].numChannels;
+ } else {
+ return (AH_TRUE);
+ }
+ /* Make sure the channel is in the range of the TP values
+ * (freq piers)
+ */
+ if ((numChannels < 1) ||
+ (chan->channel < data[0].channelValue) ||
+ (chan->channel > data[numChannels-1].channelValue))
+ return(AH_FALSE);
+
+ /* Linearly interpolate the power value now */
+ for (last=0,i=0;
+ (i<numChannels) && (chan->channel > data[i].channelValue);
+ last=i++);
+ totalD = data[i].channelValue - data[last].channelValue;
+ if (totalD > 0) {
+ totalF = data[i].maxPower_t4 - data[last].maxPower_t4;
+ *maxPow = (int8_t) ((totalF*(chan->channel-data[last].channelValue) + data[last].maxPower_t4*totalD)/totalD);
+
+ totalMin = ar9287GetMinPower(ah,&data[i]) - ar9287GetMinPower(ah, &data[last]);
+ *minPow = (int8_t) ((totalMin*(chan->channel-data[last].channelValue) + ar9287GetMinPower(ah, &data[last])*totalD)/totalD);
+ return (AH_TRUE);
+ } else {
+ if (chan->channel == data[i].channelValue) {
+ *maxPow = data[i].maxPower_t4;
+ *minPow = ar9287GetMinPower(ah, &data[i]);
+ return(AH_TRUE);
+ } else
+ return(AH_FALSE);
+ }
+#else
+ *maxPow = *minPow = 0;
+ return AH_FALSE;
+#endif
+}
+
+/*
+ * The ordering of nfarray is thus:
+ *
+ * nfarray[0]: Chain 0 ctl
+ * nfarray[1]: Chain 1 ctl
+ * nfarray[2]: Chain 2 ctl
+ * nfarray[3]: Chain 0 ext
+ * nfarray[4]: Chain 1 ext
+ * nfarray[5]: Chain 2 ext
+ */
+static void
+ar9287GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[])
+{
+ int16_t nf;
+
+ nf = MS(OS_REG_READ(ah, AR_PHY_CCA), AR9280_PHY_MINCCA_PWR);
+ if (nf & 0x100)
+ nf = 0 - ((nf ^ 0x1ff) + 1);
+ HALDEBUG(ah, HAL_DEBUG_NFCAL,
+ "NF calibrated [ctl] [chain 0] is %d\n", nf);
+ nfarray[0] = nf;
+
+ nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), AR9280_PHY_CH1_MINCCA_PWR);
+ if (nf & 0x100)
+ nf = 0 - ((nf ^ 0x1ff) + 1);
+ HALDEBUG(ah, HAL_DEBUG_NFCAL,
+ "NF calibrated [ctl] [chain 1] is %d\n", nf);
+ nfarray[1] = nf;
+
+ nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR);
+ if (nf & 0x100)
+ nf = 0 - ((nf ^ 0x1ff) + 1);
+ HALDEBUG(ah, HAL_DEBUG_NFCAL,
+ "NF calibrated [ext] [chain 0] is %d\n", nf);
+ nfarray[3] = nf;
+
+ nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR);
+ if (nf & 0x100)
+ nf = 0 - ((nf ^ 0x1ff) + 1);
+ HALDEBUG(ah, HAL_DEBUG_NFCAL,
+ "NF calibrated [ext] [chain 1] is %d\n", nf);
+ nfarray[4] = nf;
+
+ /* Chain 2 - invalid */
+ nfarray[2] = 0;
+ nfarray[5] = 0;
+
+}
+
+/*
+ * Adjust NF based on statistical values for 5GHz frequencies.
+ * Stubbed:Not used by Fowl
+ */
+int16_t
+ar9287GetNfAdjust(struct ath_hal *ah, const HAL_CHANNEL_INTERNAL *c)
+{
+ return 0;
+}
+
+/*
+ * Free memory for analog bank scratch buffers
+ */
+static void
+ar9287RfDetach(struct ath_hal *ah)
+{
+ struct ath_hal_5212 *ahp = AH5212(ah);
+
+ HALASSERT(ahp->ah_rfHal != AH_NULL);
+ ath_hal_free(ahp->ah_rfHal);
+ ahp->ah_rfHal = AH_NULL;
+}
+
+HAL_BOOL
+ar9287RfAttach(struct ath_hal *ah, HAL_STATUS *status)
+{
+ struct ath_hal_5212 *ahp = AH5212(ah);
+ struct ar9287State *priv;
+
+ HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: attach AR9280 radio\n", __func__);
+
+ HALASSERT(ahp->ah_rfHal == AH_NULL);
+ priv = ath_hal_malloc(sizeof(struct ar9287State));
+ if (priv == AH_NULL) {
+ HALDEBUG(ah, HAL_DEBUG_ANY,
+ "%s: cannot allocate private state\n", __func__);
+ *status = HAL_ENOMEM; /* XXX */
+ return AH_FALSE;
+ }
+ priv->base.rfDetach = ar9287RfDetach;
+ priv->base.writeRegs = ar9287WriteRegs;
+ priv->base.getRfBank = ar9287GetRfBank;
+ priv->base.setChannel = ar9287SetChannel;
+ priv->base.setRfRegs = ar9287SetRfRegs;
+ priv->base.setPowerTable = ar9287SetPowerTable;
+ priv->base.getChannelMaxMinPower = ar9287GetChannelMaxMinPower;
+ priv->base.getNfAdjust = ar9287GetNfAdjust;
+
+ ahp->ah_pcdacTable = priv->pcdacTable;
+ ahp->ah_pcdacTableSize = sizeof(priv->pcdacTable);
+ ahp->ah_rfHal = &priv->base;
+ /*
+ * Set noise floor adjust method; we arrange a
+ * direct call instead of thunking.
+ */
+ AH_PRIVATE(ah)->ah_getNfAdjust = priv->base.getNfAdjust;
+ AH_PRIVATE(ah)->ah_getNoiseFloor = ar9287GetNoiseFloor;
+
+ return AH_TRUE;
+}
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287.h b/sys/dev/ath/ath_hal/ar9002/ar9287.h
new file mode 100644
index 0000000..90d25ed
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2010 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _ATH_AR9287_H_
+#define _ATH_AR9287_H_
+
+#include "ar5416/ar5416.h"
+
+/*
+ * This is a chip thing, but it's used here as part of the
+ * ath_hal_9287 struct; so it's convienent to locate the
+ * define here.
+ */
+#define AR9287_TX_GAIN_TABLE_SIZE 22
+
+struct ath_hal_9287 {
+ struct ath_hal_5416 ah_5416;
+
+ HAL_INI_ARRAY ah_ini_xmodes;
+ HAL_INI_ARRAY ah_ini_rxgain;
+ HAL_INI_ARRAY ah_ini_txgain;
+
+ HAL_INI_ARRAY ah_ini_cckFirNormal;
+ HAL_INI_ARRAY ah_ini_cckFirJapan2484;
+
+ int PDADCdelta;
+
+ uint32_t originalGain[AR9287_TX_GAIN_TABLE_SIZE];
+};
+#define AH9287(_ah) ((struct ath_hal_9287 *)(_ah))
+
+#define AR9287_DEFAULT_RXCHAINMASK 3
+#define AR9285_DEFAULT_RXCHAINMASK 1
+#define AR9287_DEFAULT_TXCHAINMASK 3
+#define AR9285_DEFAULT_TXCHAINMASK 1
+
+#define AR_PHY_CCA_NOM_VAL_9287_2GHZ -112
+#define AR_PHY_CCA_NOM_VAL_9287_5GHZ -112
+#define AR_PHY_CCA_MIN_GOOD_VAL_9287_2GHZ -127
+#define AR_PHY_CCA_MIN_GOOD_VAL_9287_5GHZ -122
+#define AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ -97
+#define AR_PHY_CCA_MAX_GOOD_VAL_9287_5GHZ -102
+
+extern HAL_BOOL ar9287RfAttach(struct ath_hal *, HAL_STATUS *);
+extern HAL_BOOL ar9287SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING);
+
+#endif /* _ATH_AR9287_H_ */
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287.ini b/sys/dev/ath/ath_hal/ar9002/ar9287.ini
new file mode 100644
index 0000000..7f4ca05
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287.ini
@@ -0,0 +1,783 @@
+/*
+ * Copyright (c) 2010 Atheros Communications Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+static const uint32_t ar9287Modes_9287_1_1[][6] = {
+ {0x00001030, 0x00000000, 0x00000000, 0x000002c0, 0x00000160, 0x000001e0},
+ {0x00001070, 0x00000000, 0x00000000, 0x00000318, 0x0000018c, 0x000001e0},
+ {0x000010b0, 0x00000000, 0x00000000, 0x00007c70, 0x00003e38, 0x00001180},
+ {0x000010f0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008},
+ {0x00008014, 0x00000000, 0x00000000, 0x10801600, 0x08400b00, 0x06e006e0},
+ {0x0000801c, 0x00000000, 0x00000000, 0x12e00057, 0x12e0002b, 0x0988004f},
+ {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810, 0x08f04810},
+ {0x000081d0, 0x00003200, 0x00003200, 0x0000320a, 0x0000320a, 0x0000320a},
+ {0x00008318, 0x00000000, 0x00000000, 0x00006880, 0x00003440, 0x00006880},
+ {0x00009804, 0x00000000, 0x00000000, 0x000003c4, 0x00000300, 0x00000303},
+ {0x00009820, 0x00000000, 0x00000000, 0x02020200, 0x02020200, 0x02020200},
+ {0x00009824, 0x00000000, 0x00000000, 0x01000e0e, 0x01000e0e, 0x01000e0e},
+ {0x00009828, 0x00000000, 0x00000000, 0x3a020001, 0x3a020001, 0x3a020001},
+ {0x00009834, 0x00000000, 0x00000000, 0x00000e0e, 0x00000e0e, 0x00000e0e},
+ {0x00009838, 0x00000003, 0x00000003, 0x00000007, 0x00000007, 0x00000007},
+ {0x00009840, 0x206a002e, 0x206a002e, 0x206a012e, 0x206a012e, 0x206a012e},
+ {0x00009844, 0x03720000, 0x03720000, 0x037216a0, 0x037216a0, 0x037216a0},
+ {0x00009850, 0x60000000, 0x60000000, 0x6d4000e2, 0x6c4000e2, 0x6c4000e2},
+ {0x00009858, 0x7c000d00, 0x7c000d00, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e},
+ {0x0000985c, 0x3100005e, 0x3100005e, 0x3139605e, 0x31395d5e, 0x31395d5e},
+ {0x00009860, 0x00058d00, 0x00058d00, 0x00058d20, 0x00058d20, 0x00058d18},
+ {0x00009864, 0x00000e00, 0x00000e00, 0x0001ce00, 0x0001ce00, 0x0001ce00},
+ {0x00009868, 0x000040c0, 0x000040c0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
+ {0x0000986c, 0x00000080, 0x00000080, 0x06903881, 0x06903881, 0x06903881},
+ {0x00009914, 0x00000000, 0x00000000, 0x00001130, 0x00000898, 0x000007d0},
+ {0x00009918, 0x00000000, 0x00000000, 0x00000016, 0x0000000b, 0x00000016},
+ {0x00009924, 0xd00a8a01, 0xd00a8a01, 0xd00a8a0d, 0xd00a8a0d, 0xd00a8a0d},
+ {0x00009944, 0xefbc0000, 0xefbc0000, 0xefbc1010, 0xefbc1010, 0xefbc1010},
+ {0x00009960, 0x00000000, 0x00000000, 0x00000010, 0x00000010, 0x00000010},
+ {0x0000a960, 0x00000000, 0x00000000, 0x00000010, 0x00000010, 0x00000010},
+ {0x00009964, 0x00000000, 0x00000000, 0x00000210, 0x00000210, 0x00000210},
+ {0x0000c968, 0x00000200, 0x00000200, 0x000003ce, 0x000003ce, 0x000003ce},
+ {0x000099b8, 0x00000000, 0x00000000, 0x0000001c, 0x0000001c, 0x0000001c},
+ {0x000099bc, 0x00000000, 0x00000000, 0x00000c00, 0x00000c00, 0x00000c00},
+ {0x000099c0, 0x00000000, 0x00000000, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
+ {0x0000a204, 0x00000440, 0x00000440, 0x00000444, 0x00000444, 0x00000444},
+ {0x0000a20c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000b20c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a21c, 0x1803800a, 0x1803800a, 0x1883800a, 0x1883800a, 0x1883800a},
+ {0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000},
+ {0x0000a250, 0x00000000, 0x00000000, 0x0004a000, 0x0004a000, 0x0004a000},
+ {0x0000a358, 0x7999aa02, 0x7999aa02, 0x7999aa0e, 0x7999aa0e, 0x7999aa0e},
+ {0x0000a3d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+};
+
+static const uint32_t ar9287Common_9287_1_1[][2] = {
+ /* Addr allmodes */
+ {0x0000000c, 0x00000000},
+ {0x00000030, 0x00020015},
+ {0x00000034, 0x00000005},
+ {0x00000040, 0x00000000},
+ {0x00000044, 0x00000008},
+ {0x00000048, 0x00000008},
+ {0x0000004c, 0x00000010},
+ {0x00000050, 0x00000000},
+ {0x00000054, 0x0000001f},
+ {0x00000800, 0x00000000},
+ {0x00000804, 0x00000000},
+ {0x00000808, 0x00000000},
+ {0x0000080c, 0x00000000},
+ {0x00000810, 0x00000000},
+ {0x00000814, 0x00000000},
+ {0x00000818, 0x00000000},
+ {0x0000081c, 0x00000000},
+ {0x00000820, 0x00000000},
+ {0x00000824, 0x00000000},
+ {0x00001040, 0x002ffc0f},
+ {0x00001044, 0x002ffc0f},
+ {0x00001048, 0x002ffc0f},
+ {0x0000104c, 0x002ffc0f},
+ {0x00001050, 0x002ffc0f},
+ {0x00001054, 0x002ffc0f},
+ {0x00001058, 0x002ffc0f},
+ {0x0000105c, 0x002ffc0f},
+ {0x00001060, 0x002ffc0f},
+ {0x00001064, 0x002ffc0f},
+ {0x00001230, 0x00000000},
+ {0x00001270, 0x00000000},
+ {0x00001038, 0x00000000},
+ {0x00001078, 0x00000000},
+ {0x000010b8, 0x00000000},
+ {0x000010f8, 0x00000000},
+ {0x00001138, 0x00000000},
+ {0x00001178, 0x00000000},
+ {0x000011b8, 0x00000000},
+ {0x000011f8, 0x00000000},
+ {0x00001238, 0x00000000},
+ {0x00001278, 0x00000000},
+ {0x000012b8, 0x00000000},
+ {0x000012f8, 0x00000000},
+ {0x00001338, 0x00000000},
+ {0x00001378, 0x00000000},
+ {0x000013b8, 0x00000000},
+ {0x000013f8, 0x00000000},
+ {0x00001438, 0x00000000},
+ {0x00001478, 0x00000000},
+ {0x000014b8, 0x00000000},
+ {0x000014f8, 0x00000000},
+ {0x00001538, 0x00000000},
+ {0x00001578, 0x00000000},
+ {0x000015b8, 0x00000000},
+ {0x000015f8, 0x00000000},
+ {0x00001638, 0x00000000},
+ {0x00001678, 0x00000000},
+ {0x000016b8, 0x00000000},
+ {0x000016f8, 0x00000000},
+ {0x00001738, 0x00000000},
+ {0x00001778, 0x00000000},
+ {0x000017b8, 0x00000000},
+ {0x000017f8, 0x00000000},
+ {0x0000103c, 0x00000000},
+ {0x0000107c, 0x00000000},
+ {0x000010bc, 0x00000000},
+ {0x000010fc, 0x00000000},
+ {0x0000113c, 0x00000000},
+ {0x0000117c, 0x00000000},
+ {0x000011bc, 0x00000000},
+ {0x000011fc, 0x00000000},
+ {0x0000123c, 0x00000000},
+ {0x0000127c, 0x00000000},
+ {0x000012bc, 0x00000000},
+ {0x000012fc, 0x00000000},
+ {0x0000133c, 0x00000000},
+ {0x0000137c, 0x00000000},
+ {0x000013bc, 0x00000000},
+ {0x000013fc, 0x00000000},
+ {0x0000143c, 0x00000000},
+ {0x0000147c, 0x00000000},
+ {0x00004030, 0x00000002},
+ {0x0000403c, 0x00000002},
+ {0x00004024, 0x0000001f},
+ {0x00004060, 0x00000000},
+ {0x00004064, 0x00000000},
+ {0x00007010, 0x00000033},
+ {0x00007020, 0x00000000},
+ {0x00007034, 0x00000002},
+ {0x00007038, 0x000004c2},
+ {0x00008004, 0x00000000},
+ {0x00008008, 0x00000000},
+ {0x0000800c, 0x00000000},
+ {0x00008018, 0x00000700},
+ {0x00008020, 0x00000000},
+ {0x00008038, 0x00000000},
+ {0x0000803c, 0x00000000},
+ {0x00008048, 0x40000000},
+ {0x00008054, 0x00000000},
+ {0x00008058, 0x00000000},
+ {0x0000805c, 0x000fc78f},
+ {0x00008060, 0x0000000f},
+ {0x00008064, 0x00000000},
+ {0x00008070, 0x00000000},
+ {0x000080c0, 0x2a80001a},
+ {0x000080c4, 0x05dc01e0},
+ {0x000080c8, 0x1f402710},
+ {0x000080cc, 0x01f40000},
+ {0x000080d0, 0x00001e00},
+ {0x000080d4, 0x00000000},
+ {0x000080d8, 0x00400000},
+ {0x000080e0, 0xffffffff},
+ {0x000080e4, 0x0000ffff},
+ {0x000080e8, 0x003f3f3f},
+ {0x000080ec, 0x00000000},
+ {0x000080f0, 0x00000000},
+ {0x000080f4, 0x00000000},
+ {0x000080f8, 0x00000000},
+ {0x000080fc, 0x00020000},
+ {0x00008100, 0x00020000},
+ {0x00008104, 0x00000001},
+ {0x00008108, 0x00000052},
+ {0x0000810c, 0x00000000},
+ {0x00008110, 0x00000168},
+ {0x00008118, 0x000100aa},
+ {0x0000811c, 0x00003210},
+ {0x00008124, 0x00000000},
+ {0x00008128, 0x00000000},
+ {0x0000812c, 0x00000000},
+ {0x00008130, 0x00000000},
+ {0x00008134, 0x00000000},
+ {0x00008138, 0x00000000},
+ {0x0000813c, 0x00000000},
+ {0x00008144, 0xffffffff},
+ {0x00008168, 0x00000000},
+ {0x0000816c, 0x00000000},
+ {0x00008170, 0x18487320},
+ {0x00008174, 0xfaa4fa50},
+ {0x00008178, 0x00000100},
+ {0x0000817c, 0x00000000},
+ {0x000081c0, 0x00000000},
+ {0x000081c4, 0x00000000},
+ {0x000081d4, 0x00000000},
+ {0x000081ec, 0x00000000},
+ {0x000081f0, 0x00000000},
+ {0x000081f4, 0x00000000},
+ {0x000081f8, 0x00000000},
+ {0x000081fc, 0x00000000},
+ {0x00008200, 0x00000000},
+ {0x00008204, 0x00000000},
+ {0x00008208, 0x00000000},
+ {0x0000820c, 0x00000000},
+ {0x00008210, 0x00000000},
+ {0x00008214, 0x00000000},
+ {0x00008218, 0x00000000},
+ {0x0000821c, 0x00000000},
+ {0x00008220, 0x00000000},
+ {0x00008224, 0x00000000},
+ {0x00008228, 0x00000000},
+ {0x0000822c, 0x00000000},
+ {0x00008230, 0x00000000},
+ {0x00008234, 0x00000000},
+ {0x00008238, 0x00000000},
+ {0x0000823c, 0x00000000},
+ {0x00008240, 0x00100000},
+ {0x00008244, 0x0010f400},
+ {0x00008248, 0x00000100},
+ {0x0000824c, 0x0001e800},
+ {0x00008250, 0x00000000},
+ {0x00008254, 0x00000000},
+ {0x00008258, 0x00000000},
+ {0x0000825c, 0x400000ff},
+ {0x00008260, 0x00080922},
+ {0x00008264, 0x88a00010},
+ {0x00008270, 0x00000000},
+ {0x00008274, 0x40000000},
+ {0x00008278, 0x003e4180},
+ {0x0000827c, 0x00000000},
+ {0x00008284, 0x0000002c},
+ {0x00008288, 0x0000002c},
+ {0x0000828c, 0x000000ff},
+ {0x00008294, 0x00000000},
+ {0x00008298, 0x00000000},
+ {0x0000829c, 0x00000000},
+ {0x00008300, 0x00000040},
+ {0x00008314, 0x00000000},
+ {0x00008328, 0x00000000},
+ {0x0000832c, 0x00000007},
+ {0x00008330, 0x00000302},
+ {0x00008334, 0x00000e00},
+ {0x00008338, 0x00ff0000},
+ {0x0000833c, 0x00000000},
+ {0x00008340, 0x000107ff},
+ {0x00008344, 0x01c81043},
+ {0x00008360, 0xffffffff},
+ {0x00008364, 0xffffffff},
+ {0x00008368, 0x00000000},
+ {0x00008370, 0x00000000},
+ {0x00008374, 0x000000ff},
+ {0x00008378, 0x00000000},
+ {0x0000837c, 0x00000000},
+ {0x00008380, 0xffffffff},
+ {0x00008384, 0xffffffff},
+ {0x00008390, 0x0fffffff},
+ {0x00008394, 0x0fffffff},
+ {0x00008398, 0x00000000},
+ {0x0000839c, 0x00000000},
+ {0x000083a0, 0x00000000},
+ {0x00009808, 0x00000000},
+ {0x0000980c, 0xafe68e30},
+ {0x00009810, 0xfd14e000},
+ {0x00009814, 0x9c0a9f6b},
+ {0x0000981c, 0x00000000},
+ {0x0000982c, 0x0000a000},
+ {0x00009830, 0x00000000},
+ {0x0000983c, 0x00200400},
+ {0x0000984c, 0x0040233c},
+ {0x0000a84c, 0x0040233c},
+ {0x00009854, 0x00000044},
+ {0x00009900, 0x00000000},
+ {0x00009904, 0x00000000},
+ {0x00009908, 0x00000000},
+ {0x0000990c, 0x00000000},
+ {0x00009910, 0x10002310},
+ {0x0000991c, 0x10000fff},
+ {0x00009920, 0x04900000},
+ {0x0000a920, 0x04900000},
+ {0x00009928, 0x00000001},
+ {0x0000992c, 0x00000004},
+ {0x00009930, 0x00000000},
+ {0x0000a930, 0x00000000},
+ {0x00009934, 0x1e1f2022},
+ {0x00009938, 0x0a0b0c0d},
+ {0x0000993c, 0x00000000},
+ {0x00009948, 0x9280c00a},
+ {0x0000994c, 0x00020028},
+ {0x00009954, 0x5f3ca3de},
+ {0x00009958, 0x0108ecff},
+ {0x00009940, 0x14750604},
+ {0x0000c95c, 0x004b6a8e},
+ {0x00009970, 0x990bb514},
+ {0x00009974, 0x00000000},
+ {0x00009978, 0x00000001},
+ {0x0000997c, 0x00000000},
+ {0x000099a0, 0x00000000},
+ {0x000099a4, 0x00000001},
+ {0x000099a8, 0x201fff00},
+ {0x000099ac, 0x0c6f0000},
+ {0x000099b0, 0x03051000},
+ {0x000099b4, 0x00000820},
+ {0x000099c4, 0x06336f77},
+ {0x000099c8, 0x6af6532f},
+ {0x000099cc, 0x08f186c8},
+ {0x000099d0, 0x00046384},
+ {0x000099dc, 0x00000000},
+ {0x000099e0, 0x00000000},
+ {0x000099e4, 0xaaaaaaaa},
+ {0x000099e8, 0x3c466478},
+ {0x000099ec, 0x0cc80caa},
+ {0x000099f0, 0x00000000},
+ {0x000099fc, 0x00001042},
+ {0x0000a208, 0x803e4788},
+ {0x0000a210, 0x4080a333},
+ {0x0000a214, 0x40206c10},
+ {0x0000a218, 0x009c4060},
+ {0x0000a220, 0x01834061},
+ {0x0000a224, 0x00000400},
+ {0x0000a228, 0x000003b5},
+ {0x0000a22c, 0x233f7180},
+ {0x0000a234, 0x20202020},
+ {0x0000a238, 0x20202020},
+ {0x0000a23c, 0x13c889af},
+ {0x0000a240, 0x38490a20},
+ {0x0000a244, 0x00000000},
+ {0x0000a248, 0xfffffffc},
+ {0x0000a24c, 0x00000000},
+ {0x0000a254, 0x00000000},
+ {0x0000a258, 0x0cdbd380},
+ {0x0000a25c, 0x0f0f0f01},
+ {0x0000a260, 0xdfa91f01},
+ {0x0000a264, 0x00418a11},
+ {0x0000b264, 0x00418a11},
+ {0x0000a268, 0x00000000},
+ {0x0000a26c, 0x0e79e5c6},
+ {0x0000b26c, 0x0e79e5c6},
+ {0x0000d270, 0x00820820},
+ {0x0000a278, 0x1ce739ce},
+ {0x0000a27c, 0x050701ce},
+ {0x0000d35c, 0x07ffffef},
+ {0x0000d360, 0x0fffffe7},
+ {0x0000d364, 0x17ffffe5},
+ {0x0000d368, 0x1fffffe4},
+ {0x0000d36c, 0x37ffffe3},
+ {0x0000d370, 0x3fffffe3},
+ {0x0000d374, 0x57ffffe3},
+ {0x0000d378, 0x5fffffe2},
+ {0x0000d37c, 0x7fffffe2},
+ {0x0000d380, 0x7f3c7bba},
+ {0x0000d384, 0xf3307ff0},
+ {0x0000a388, 0x0c000000},
+ {0x0000a38c, 0x20202020},
+ {0x0000a390, 0x20202020},
+ {0x0000a394, 0x1ce739ce},
+ {0x0000a398, 0x000001ce},
+ {0x0000b398, 0x000001ce},
+ {0x0000a39c, 0x00000001},
+ {0x0000a3c8, 0x00000246},
+ {0x0000a3cc, 0x20202020},
+ {0x0000a3d0, 0x20202020},
+ {0x0000a3d4, 0x20202020},
+ {0x0000a3dc, 0x1ce739ce},
+ {0x0000a3e0, 0x000001ce},
+ {0x0000a3e4, 0x00000000},
+ {0x0000a3e8, 0x18c43433},
+ {0x0000a3ec, 0x00f70081},
+ {0x0000a3f0, 0x01036a1e},
+ {0x0000a3f4, 0x00000000},
+ {0x0000b3f4, 0x00000000},
+ {0x0000a7d8, 0x000003f1},
+ {0x00007800, 0x00000800},
+ {0x00007804, 0x6c35ffd2},
+ {0x00007808, 0x6db6c000},
+ {0x0000780c, 0x6db6cb30},
+ {0x00007810, 0x6db6cb6c},
+ {0x00007814, 0x0501e200},
+ {0x00007818, 0x0094128d},
+ {0x0000781c, 0x976ee392},
+ {0x00007820, 0xf75ff6fc},
+ {0x00007824, 0x00040000},
+ {0x00007828, 0xdb003012},
+ {0x0000782c, 0x04924914},
+ {0x00007830, 0x21084210},
+ {0x00007834, 0x00140000},
+ {0x00007838, 0x0e4548d8},
+ {0x0000783c, 0x54214514},
+ {0x00007840, 0x02025830},
+ {0x00007844, 0x71c0d388},
+ {0x00007848, 0x934934a8},
+ {0x00007850, 0x00000000},
+ {0x00007854, 0x00000800},
+ {0x00007858, 0x6c35ffd2},
+ {0x0000785c, 0x6db6c000},
+ {0x00007860, 0x6db6cb30},
+ {0x00007864, 0x6db6cb6c},
+ {0x00007868, 0x0501e200},
+ {0x0000786c, 0x0094128d},
+ {0x00007870, 0x976ee392},
+ {0x00007874, 0xf75ff6fc},
+ {0x00007878, 0x00040000},
+ {0x0000787c, 0xdb003012},
+ {0x00007880, 0x04924914},
+ {0x00007884, 0x21084210},
+ {0x00007888, 0x001b6db0},
+ {0x0000788c, 0x00376b63},
+ {0x00007890, 0x06db6db6},
+ {0x00007894, 0x006d8000},
+ {0x00007898, 0x48100000},
+ {0x0000789c, 0x00000000},
+ {0x000078a0, 0x08000000},
+ {0x000078a4, 0x0007ffd8},
+ {0x000078a8, 0x0007ffd8},
+ {0x000078ac, 0x001c0020},
+ {0x000078b0, 0x00060aeb},
+ {0x000078b4, 0x40008080},
+ {0x000078b8, 0x2a850160},
+};
+
+static const uint32_t ar9287Common_normal_cck_fir_coeff_9287_1_1[][2] = {
+ /* Addr allmodes */
+ {0x0000a1f4, 0x00fffeff},
+ {0x0000a1f8, 0x00f5f9ff},
+ {0x0000a1fc, 0xb79f6427},
+};
+
+static const uint32_t ar9287Common_japan_2484_cck_fir_coeff_9287_1_1[][2] = {
+ /* Addr allmodes */
+ {0x0000a1f4, 0x00000000},
+ {0x0000a1f8, 0xefff0301},
+ {0x0000a1fc, 0xca9228ee},
+};
+
+static const uint32_t ar9287Modes_tx_gain_9287_1_1[][6] = {
+ {0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a304, 0x00000000, 0x00000000, 0x00004002, 0x00004002, 0x00004002},
+ {0x0000a308, 0x00000000, 0x00000000, 0x00008004, 0x00008004, 0x00008004},
+ {0x0000a30c, 0x00000000, 0x00000000, 0x0000c00a, 0x0000c00a, 0x0000c00a},
+ {0x0000a310, 0x00000000, 0x00000000, 0x0001000c, 0x0001000c, 0x0001000c},
+ {0x0000a314, 0x00000000, 0x00000000, 0x0001420b, 0x0001420b, 0x0001420b},
+ {0x0000a318, 0x00000000, 0x00000000, 0x0001824a, 0x0001824a, 0x0001824a},
+ {0x0000a31c, 0x00000000, 0x00000000, 0x0001c44a, 0x0001c44a, 0x0001c44a},
+ {0x0000a320, 0x00000000, 0x00000000, 0x0002064a, 0x0002064a, 0x0002064a},
+ {0x0000a324, 0x00000000, 0x00000000, 0x0002484a, 0x0002484a, 0x0002484a},
+ {0x0000a328, 0x00000000, 0x00000000, 0x00028a4a, 0x00028a4a, 0x00028a4a},
+ {0x0000a32c, 0x00000000, 0x00000000, 0x0002cc4a, 0x0002cc4a, 0x0002cc4a},
+ {0x0000a330, 0x00000000, 0x00000000, 0x00030e4a, 0x00030e4a, 0x00030e4a},
+ {0x0000a334, 0x00000000, 0x00000000, 0x00034e8a, 0x00034e8a, 0x00034e8a},
+ {0x0000a338, 0x00000000, 0x00000000, 0x00038e8c, 0x00038e8c, 0x00038e8c},
+ {0x0000a33c, 0x00000000, 0x00000000, 0x0003cecc, 0x0003cecc, 0x0003cecc},
+ {0x0000a340, 0x00000000, 0x00000000, 0x00040ed4, 0x00040ed4, 0x00040ed4},
+ {0x0000a344, 0x00000000, 0x00000000, 0x00044edc, 0x00044edc, 0x00044edc},
+ {0x0000a348, 0x00000000, 0x00000000, 0x00048ede, 0x00048ede, 0x00048ede},
+ {0x0000a34c, 0x00000000, 0x00000000, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e},
+ {0x0000a350, 0x00000000, 0x00000000, 0x00050f5e, 0x00050f5e, 0x00050f5e},
+ {0x0000a354, 0x00000000, 0x00000000, 0x00054f9e, 0x00054f9e, 0x00054f9e},
+ {0x0000a780, 0x00000000, 0x00000000, 0x00000062, 0x00000062, 0x00000062},
+ {0x0000a784, 0x00000000, 0x00000000, 0x00004064, 0x00004064, 0x00004064},
+ {0x0000a788, 0x00000000, 0x00000000, 0x000080a4, 0x000080a4, 0x000080a4},
+ {0x0000a78c, 0x00000000, 0x00000000, 0x0000c0aa, 0x0000c0aa, 0x0000c0aa},
+ {0x0000a790, 0x00000000, 0x00000000, 0x000100ac, 0x000100ac, 0x000100ac},
+ {0x0000a794, 0x00000000, 0x00000000, 0x000140b4, 0x000140b4, 0x000140b4},
+ {0x0000a798, 0x00000000, 0x00000000, 0x000180f4, 0x000180f4, 0x000180f4},
+ {0x0000a79c, 0x00000000, 0x00000000, 0x0001c134, 0x0001c134, 0x0001c134},
+ {0x0000a7a0, 0x00000000, 0x00000000, 0x00020174, 0x00020174, 0x00020174},
+ {0x0000a7a4, 0x00000000, 0x00000000, 0x0002417c, 0x0002417c, 0x0002417c},
+ {0x0000a7a8, 0x00000000, 0x00000000, 0x0002817e, 0x0002817e, 0x0002817e},
+ {0x0000a7ac, 0x00000000, 0x00000000, 0x0002c1be, 0x0002c1be, 0x0002c1be},
+ {0x0000a7b0, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7b4, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7b8, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7bc, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7c0, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7c4, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7c8, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7cc, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7d0, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a7d4, 0x00000000, 0x00000000, 0x000301fe, 0x000301fe, 0x000301fe},
+ {0x0000a274, 0x0a180000, 0x0a180000, 0x0a1aa000, 0x0a1aa000, 0x0a1aa000},
+};
+
+static const uint32_t ar9287Modes_rx_gain_9287_1_1[][6] = {
+ {0x00009a00, 0x00000000, 0x00000000, 0x0000a120, 0x0000a120, 0x0000a120},
+ {0x00009a04, 0x00000000, 0x00000000, 0x0000a124, 0x0000a124, 0x0000a124},
+ {0x00009a08, 0x00000000, 0x00000000, 0x0000a128, 0x0000a128, 0x0000a128},
+ {0x00009a0c, 0x00000000, 0x00000000, 0x0000a12c, 0x0000a12c, 0x0000a12c},
+ {0x00009a10, 0x00000000, 0x00000000, 0x0000a130, 0x0000a130, 0x0000a130},
+ {0x00009a14, 0x00000000, 0x00000000, 0x0000a194, 0x0000a194, 0x0000a194},
+ {0x00009a18, 0x00000000, 0x00000000, 0x0000a198, 0x0000a198, 0x0000a198},
+ {0x00009a1c, 0x00000000, 0x00000000, 0x0000a20c, 0x0000a20c, 0x0000a20c},
+ {0x00009a20, 0x00000000, 0x00000000, 0x0000a210, 0x0000a210, 0x0000a210},
+ {0x00009a24, 0x00000000, 0x00000000, 0x0000a284, 0x0000a284, 0x0000a284},
+ {0x00009a28, 0x00000000, 0x00000000, 0x0000a288, 0x0000a288, 0x0000a288},
+ {0x00009a2c, 0x00000000, 0x00000000, 0x0000a28c, 0x0000a28c, 0x0000a28c},
+ {0x00009a30, 0x00000000, 0x00000000, 0x0000a290, 0x0000a290, 0x0000a290},
+ {0x00009a34, 0x00000000, 0x00000000, 0x0000a294, 0x0000a294, 0x0000a294},
+ {0x00009a38, 0x00000000, 0x00000000, 0x0000a2a0, 0x0000a2a0, 0x0000a2a0},
+ {0x00009a3c, 0x00000000, 0x00000000, 0x0000a2a4, 0x0000a2a4, 0x0000a2a4},
+ {0x00009a40, 0x00000000, 0x00000000, 0x0000a2a8, 0x0000a2a8, 0x0000a2a8},
+ {0x00009a44, 0x00000000, 0x00000000, 0x0000a2ac, 0x0000a2ac, 0x0000a2ac},
+ {0x00009a48, 0x00000000, 0x00000000, 0x0000a2b0, 0x0000a2b0, 0x0000a2b0},
+ {0x00009a4c, 0x00000000, 0x00000000, 0x0000a2b4, 0x0000a2b4, 0x0000a2b4},
+ {0x00009a50, 0x00000000, 0x00000000, 0x0000a2b8, 0x0000a2b8, 0x0000a2b8},
+ {0x00009a54, 0x00000000, 0x00000000, 0x0000a2c4, 0x0000a2c4, 0x0000a2c4},
+ {0x00009a58, 0x00000000, 0x00000000, 0x0000a708, 0x0000a708, 0x0000a708},
+ {0x00009a5c, 0x00000000, 0x00000000, 0x0000a70c, 0x0000a70c, 0x0000a70c},
+ {0x00009a60, 0x00000000, 0x00000000, 0x0000a710, 0x0000a710, 0x0000a710},
+ {0x00009a64, 0x00000000, 0x00000000, 0x0000ab04, 0x0000ab04, 0x0000ab04},
+ {0x00009a68, 0x00000000, 0x00000000, 0x0000ab08, 0x0000ab08, 0x0000ab08},
+ {0x00009a6c, 0x00000000, 0x00000000, 0x0000ab0c, 0x0000ab0c, 0x0000ab0c},
+ {0x00009a70, 0x00000000, 0x00000000, 0x0000ab10, 0x0000ab10, 0x0000ab10},
+ {0x00009a74, 0x00000000, 0x00000000, 0x0000ab14, 0x0000ab14, 0x0000ab14},
+ {0x00009a78, 0x00000000, 0x00000000, 0x0000ab18, 0x0000ab18, 0x0000ab18},
+ {0x00009a7c, 0x00000000, 0x00000000, 0x0000ab8c, 0x0000ab8c, 0x0000ab8c},
+ {0x00009a80, 0x00000000, 0x00000000, 0x0000ab90, 0x0000ab90, 0x0000ab90},
+ {0x00009a84, 0x00000000, 0x00000000, 0x0000ab94, 0x0000ab94, 0x0000ab94},
+ {0x00009a88, 0x00000000, 0x00000000, 0x0000ab98, 0x0000ab98, 0x0000ab98},
+ {0x00009a8c, 0x00000000, 0x00000000, 0x0000aba4, 0x0000aba4, 0x0000aba4},
+ {0x00009a90, 0x00000000, 0x00000000, 0x0000aba8, 0x0000aba8, 0x0000aba8},
+ {0x00009a94, 0x00000000, 0x00000000, 0x0000cb04, 0x0000cb04, 0x0000cb04},
+ {0x00009a98, 0x00000000, 0x00000000, 0x0000cb08, 0x0000cb08, 0x0000cb08},
+ {0x00009a9c, 0x00000000, 0x00000000, 0x0000cb0c, 0x0000cb0c, 0x0000cb0c},
+ {0x00009aa0, 0x00000000, 0x00000000, 0x0000cb10, 0x0000cb10, 0x0000cb10},
+ {0x00009aa4, 0x00000000, 0x00000000, 0x0000cb14, 0x0000cb14, 0x0000cb14},
+ {0x00009aa8, 0x00000000, 0x00000000, 0x0000cb18, 0x0000cb18, 0x0000cb18},
+ {0x00009aac, 0x00000000, 0x00000000, 0x0000cb8c, 0x0000cb8c, 0x0000cb8c},
+ {0x00009ab0, 0x00000000, 0x00000000, 0x0000cb90, 0x0000cb90, 0x0000cb90},
+ {0x00009ab4, 0x00000000, 0x00000000, 0x0000cf18, 0x0000cf18, 0x0000cf18},
+ {0x00009ab8, 0x00000000, 0x00000000, 0x0000cf24, 0x0000cf24, 0x0000cf24},
+ {0x00009abc, 0x00000000, 0x00000000, 0x0000cf28, 0x0000cf28, 0x0000cf28},
+ {0x00009ac0, 0x00000000, 0x00000000, 0x0000d314, 0x0000d314, 0x0000d314},
+ {0x00009ac4, 0x00000000, 0x00000000, 0x0000d318, 0x0000d318, 0x0000d318},
+ {0x00009ac8, 0x00000000, 0x00000000, 0x0000d38c, 0x0000d38c, 0x0000d38c},
+ {0x00009acc, 0x00000000, 0x00000000, 0x0000d390, 0x0000d390, 0x0000d390},
+ {0x00009ad0, 0x00000000, 0x00000000, 0x0000d394, 0x0000d394, 0x0000d394},
+ {0x00009ad4, 0x00000000, 0x00000000, 0x0000d398, 0x0000d398, 0x0000d398},
+ {0x00009ad8, 0x00000000, 0x00000000, 0x0000d3a4, 0x0000d3a4, 0x0000d3a4},
+ {0x00009adc, 0x00000000, 0x00000000, 0x0000d3a8, 0x0000d3a8, 0x0000d3a8},
+ {0x00009ae0, 0x00000000, 0x00000000, 0x0000d3ac, 0x0000d3ac, 0x0000d3ac},
+ {0x00009ae4, 0x00000000, 0x00000000, 0x0000d3b0, 0x0000d3b0, 0x0000d3b0},
+ {0x00009ae8, 0x00000000, 0x00000000, 0x0000f380, 0x0000f380, 0x0000f380},
+ {0x00009aec, 0x00000000, 0x00000000, 0x0000f384, 0x0000f384, 0x0000f384},
+ {0x00009af0, 0x00000000, 0x00000000, 0x0000f388, 0x0000f388, 0x0000f388},
+ {0x00009af4, 0x00000000, 0x00000000, 0x0000f710, 0x0000f710, 0x0000f710},
+ {0x00009af8, 0x00000000, 0x00000000, 0x0000f714, 0x0000f714, 0x0000f714},
+ {0x00009afc, 0x00000000, 0x00000000, 0x0000f718, 0x0000f718, 0x0000f718},
+ {0x00009b00, 0x00000000, 0x00000000, 0x0000fb10, 0x0000fb10, 0x0000fb10},
+ {0x00009b04, 0x00000000, 0x00000000, 0x0000fb14, 0x0000fb14, 0x0000fb14},
+ {0x00009b08, 0x00000000, 0x00000000, 0x0000fb18, 0x0000fb18, 0x0000fb18},
+ {0x00009b0c, 0x00000000, 0x00000000, 0x0000fb8c, 0x0000fb8c, 0x0000fb8c},
+ {0x00009b10, 0x00000000, 0x00000000, 0x0000fb90, 0x0000fb90, 0x0000fb90},
+ {0x00009b14, 0x00000000, 0x00000000, 0x0000fb94, 0x0000fb94, 0x0000fb94},
+ {0x00009b18, 0x00000000, 0x00000000, 0x0000ff8c, 0x0000ff8c, 0x0000ff8c},
+ {0x00009b1c, 0x00000000, 0x00000000, 0x0000ff90, 0x0000ff90, 0x0000ff90},
+ {0x00009b20, 0x00000000, 0x00000000, 0x0000ff94, 0x0000ff94, 0x0000ff94},
+ {0x00009b24, 0x00000000, 0x00000000, 0x0000ffa0, 0x0000ffa0, 0x0000ffa0},
+ {0x00009b28, 0x00000000, 0x00000000, 0x0000ffa4, 0x0000ffa4, 0x0000ffa4},
+ {0x00009b2c, 0x00000000, 0x00000000, 0x0000ffa8, 0x0000ffa8, 0x0000ffa8},
+ {0x00009b30, 0x00000000, 0x00000000, 0x0000ffac, 0x0000ffac, 0x0000ffac},
+ {0x00009b34, 0x00000000, 0x00000000, 0x0000ffb0, 0x0000ffb0, 0x0000ffb0},
+ {0x00009b38, 0x00000000, 0x00000000, 0x0000ffb4, 0x0000ffb4, 0x0000ffb4},
+ {0x00009b3c, 0x00000000, 0x00000000, 0x0000ffa1, 0x0000ffa1, 0x0000ffa1},
+ {0x00009b40, 0x00000000, 0x00000000, 0x0000ffa5, 0x0000ffa5, 0x0000ffa5},
+ {0x00009b44, 0x00000000, 0x00000000, 0x0000ffa9, 0x0000ffa9, 0x0000ffa9},
+ {0x00009b48, 0x00000000, 0x00000000, 0x0000ffad, 0x0000ffad, 0x0000ffad},
+ {0x00009b4c, 0x00000000, 0x00000000, 0x0000ffb1, 0x0000ffb1, 0x0000ffb1},
+ {0x00009b50, 0x00000000, 0x00000000, 0x0000ffb5, 0x0000ffb5, 0x0000ffb5},
+ {0x00009b54, 0x00000000, 0x00000000, 0x0000ffb9, 0x0000ffb9, 0x0000ffb9},
+ {0x00009b58, 0x00000000, 0x00000000, 0x0000ffc5, 0x0000ffc5, 0x0000ffc5},
+ {0x00009b5c, 0x00000000, 0x00000000, 0x0000ffc9, 0x0000ffc9, 0x0000ffc9},
+ {0x00009b60, 0x00000000, 0x00000000, 0x0000ffcd, 0x0000ffcd, 0x0000ffcd},
+ {0x00009b64, 0x00000000, 0x00000000, 0x0000ffd1, 0x0000ffd1, 0x0000ffd1},
+ {0x00009b68, 0x00000000, 0x00000000, 0x0000ffd5, 0x0000ffd5, 0x0000ffd5},
+ {0x00009b6c, 0x00000000, 0x00000000, 0x0000ffc2, 0x0000ffc2, 0x0000ffc2},
+ {0x00009b70, 0x00000000, 0x00000000, 0x0000ffc6, 0x0000ffc6, 0x0000ffc6},
+ {0x00009b74, 0x00000000, 0x00000000, 0x0000ffca, 0x0000ffca, 0x0000ffca},
+ {0x00009b78, 0x00000000, 0x00000000, 0x0000ffce, 0x0000ffce, 0x0000ffce},
+ {0x00009b7c, 0x00000000, 0x00000000, 0x0000ffd2, 0x0000ffd2, 0x0000ffd2},
+ {0x00009b80, 0x00000000, 0x00000000, 0x0000ffd6, 0x0000ffd6, 0x0000ffd6},
+ {0x00009b84, 0x00000000, 0x00000000, 0x0000ffda, 0x0000ffda, 0x0000ffda},
+ {0x00009b88, 0x00000000, 0x00000000, 0x0000ffc7, 0x0000ffc7, 0x0000ffc7},
+ {0x00009b8c, 0x00000000, 0x00000000, 0x0000ffcb, 0x0000ffcb, 0x0000ffcb},
+ {0x00009b90, 0x00000000, 0x00000000, 0x0000ffcf, 0x0000ffcf, 0x0000ffcf},
+ {0x00009b94, 0x00000000, 0x00000000, 0x0000ffd3, 0x0000ffd3, 0x0000ffd3},
+ {0x00009b98, 0x00000000, 0x00000000, 0x0000ffd7, 0x0000ffd7, 0x0000ffd7},
+ {0x00009b9c, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009ba0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009ba4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009ba8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bac, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bb0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bb4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bb8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bbc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bc0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bc4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bc8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bcc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bd0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bd4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bd8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bdc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009be0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009be4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009be8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bec, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bf0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bf4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bf8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009bfc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000aa00, 0x00000000, 0x00000000, 0x0000a120, 0x0000a120, 0x0000a120},
+ {0x0000aa04, 0x00000000, 0x00000000, 0x0000a124, 0x0000a124, 0x0000a124},
+ {0x0000aa08, 0x00000000, 0x00000000, 0x0000a128, 0x0000a128, 0x0000a128},
+ {0x0000aa0c, 0x00000000, 0x00000000, 0x0000a12c, 0x0000a12c, 0x0000a12c},
+ {0x0000aa10, 0x00000000, 0x00000000, 0x0000a130, 0x0000a130, 0x0000a130},
+ {0x0000aa14, 0x00000000, 0x00000000, 0x0000a194, 0x0000a194, 0x0000a194},
+ {0x0000aa18, 0x00000000, 0x00000000, 0x0000a198, 0x0000a198, 0x0000a198},
+ {0x0000aa1c, 0x00000000, 0x00000000, 0x0000a20c, 0x0000a20c, 0x0000a20c},
+ {0x0000aa20, 0x00000000, 0x00000000, 0x0000a210, 0x0000a210, 0x0000a210},
+ {0x0000aa24, 0x00000000, 0x00000000, 0x0000a284, 0x0000a284, 0x0000a284},
+ {0x0000aa28, 0x00000000, 0x00000000, 0x0000a288, 0x0000a288, 0x0000a288},
+ {0x0000aa2c, 0x00000000, 0x00000000, 0x0000a28c, 0x0000a28c, 0x0000a28c},
+ {0x0000aa30, 0x00000000, 0x00000000, 0x0000a290, 0x0000a290, 0x0000a290},
+ {0x0000aa34, 0x00000000, 0x00000000, 0x0000a294, 0x0000a294, 0x0000a294},
+ {0x0000aa38, 0x00000000, 0x00000000, 0x0000a2a0, 0x0000a2a0, 0x0000a2a0},
+ {0x0000aa3c, 0x00000000, 0x00000000, 0x0000a2a4, 0x0000a2a4, 0x0000a2a4},
+ {0x0000aa40, 0x00000000, 0x00000000, 0x0000a2a8, 0x0000a2a8, 0x0000a2a8},
+ {0x0000aa44, 0x00000000, 0x00000000, 0x0000a2ac, 0x0000a2ac, 0x0000a2ac},
+ {0x0000aa48, 0x00000000, 0x00000000, 0x0000a2b0, 0x0000a2b0, 0x0000a2b0},
+ {0x0000aa4c, 0x00000000, 0x00000000, 0x0000a2b4, 0x0000a2b4, 0x0000a2b4},
+ {0x0000aa50, 0x00000000, 0x00000000, 0x0000a2b8, 0x0000a2b8, 0x0000a2b8},
+ {0x0000aa54, 0x00000000, 0x00000000, 0x0000a2c4, 0x0000a2c4, 0x0000a2c4},
+ {0x0000aa58, 0x00000000, 0x00000000, 0x0000a708, 0x0000a708, 0x0000a708},
+ {0x0000aa5c, 0x00000000, 0x00000000, 0x0000a70c, 0x0000a70c, 0x0000a70c},
+ {0x0000aa60, 0x00000000, 0x00000000, 0x0000a710, 0x0000a710, 0x0000a710},
+ {0x0000aa64, 0x00000000, 0x00000000, 0x0000ab04, 0x0000ab04, 0x0000ab04},
+ {0x0000aa68, 0x00000000, 0x00000000, 0x0000ab08, 0x0000ab08, 0x0000ab08},
+ {0x0000aa6c, 0x00000000, 0x00000000, 0x0000ab0c, 0x0000ab0c, 0x0000ab0c},
+ {0x0000aa70, 0x00000000, 0x00000000, 0x0000ab10, 0x0000ab10, 0x0000ab10},
+ {0x0000aa74, 0x00000000, 0x00000000, 0x0000ab14, 0x0000ab14, 0x0000ab14},
+ {0x0000aa78, 0x00000000, 0x00000000, 0x0000ab18, 0x0000ab18, 0x0000ab18},
+ {0x0000aa7c, 0x00000000, 0x00000000, 0x0000ab8c, 0x0000ab8c, 0x0000ab8c},
+ {0x0000aa80, 0x00000000, 0x00000000, 0x0000ab90, 0x0000ab90, 0x0000ab90},
+ {0x0000aa84, 0x00000000, 0x00000000, 0x0000ab94, 0x0000ab94, 0x0000ab94},
+ {0x0000aa88, 0x00000000, 0x00000000, 0x0000ab98, 0x0000ab98, 0x0000ab98},
+ {0x0000aa8c, 0x00000000, 0x00000000, 0x0000aba4, 0x0000aba4, 0x0000aba4},
+ {0x0000aa90, 0x00000000, 0x00000000, 0x0000aba8, 0x0000aba8, 0x0000aba8},
+ {0x0000aa94, 0x00000000, 0x00000000, 0x0000cb04, 0x0000cb04, 0x0000cb04},
+ {0x0000aa98, 0x00000000, 0x00000000, 0x0000cb08, 0x0000cb08, 0x0000cb08},
+ {0x0000aa9c, 0x00000000, 0x00000000, 0x0000cb0c, 0x0000cb0c, 0x0000cb0c},
+ {0x0000aaa0, 0x00000000, 0x00000000, 0x0000cb10, 0x0000cb10, 0x0000cb10},
+ {0x0000aaa4, 0x00000000, 0x00000000, 0x0000cb14, 0x0000cb14, 0x0000cb14},
+ {0x0000aaa8, 0x00000000, 0x00000000, 0x0000cb18, 0x0000cb18, 0x0000cb18},
+ {0x0000aaac, 0x00000000, 0x00000000, 0x0000cb8c, 0x0000cb8c, 0x0000cb8c},
+ {0x0000aab0, 0x00000000, 0x00000000, 0x0000cb90, 0x0000cb90, 0x0000cb90},
+ {0x0000aab4, 0x00000000, 0x00000000, 0x0000cf18, 0x0000cf18, 0x0000cf18},
+ {0x0000aab8, 0x00000000, 0x00000000, 0x0000cf24, 0x0000cf24, 0x0000cf24},
+ {0x0000aabc, 0x00000000, 0x00000000, 0x0000cf28, 0x0000cf28, 0x0000cf28},
+ {0x0000aac0, 0x00000000, 0x00000000, 0x0000d314, 0x0000d314, 0x0000d314},
+ {0x0000aac4, 0x00000000, 0x00000000, 0x0000d318, 0x0000d318, 0x0000d318},
+ {0x0000aac8, 0x00000000, 0x00000000, 0x0000d38c, 0x0000d38c, 0x0000d38c},
+ {0x0000aacc, 0x00000000, 0x00000000, 0x0000d390, 0x0000d390, 0x0000d390},
+ {0x0000aad0, 0x00000000, 0x00000000, 0x0000d394, 0x0000d394, 0x0000d394},
+ {0x0000aad4, 0x00000000, 0x00000000, 0x0000d398, 0x0000d398, 0x0000d398},
+ {0x0000aad8, 0x00000000, 0x00000000, 0x0000d3a4, 0x0000d3a4, 0x0000d3a4},
+ {0x0000aadc, 0x00000000, 0x00000000, 0x0000d3a8, 0x0000d3a8, 0x0000d3a8},
+ {0x0000aae0, 0x00000000, 0x00000000, 0x0000d3ac, 0x0000d3ac, 0x0000d3ac},
+ {0x0000aae4, 0x00000000, 0x00000000, 0x0000d3b0, 0x0000d3b0, 0x0000d3b0},
+ {0x0000aae8, 0x00000000, 0x00000000, 0x0000f380, 0x0000f380, 0x0000f380},
+ {0x0000aaec, 0x00000000, 0x00000000, 0x0000f384, 0x0000f384, 0x0000f384},
+ {0x0000aaf0, 0x00000000, 0x00000000, 0x0000f388, 0x0000f388, 0x0000f388},
+ {0x0000aaf4, 0x00000000, 0x00000000, 0x0000f710, 0x0000f710, 0x0000f710},
+ {0x0000aaf8, 0x00000000, 0x00000000, 0x0000f714, 0x0000f714, 0x0000f714},
+ {0x0000aafc, 0x00000000, 0x00000000, 0x0000f718, 0x0000f718, 0x0000f718},
+ {0x0000ab00, 0x00000000, 0x00000000, 0x0000fb10, 0x0000fb10, 0x0000fb10},
+ {0x0000ab04, 0x00000000, 0x00000000, 0x0000fb14, 0x0000fb14, 0x0000fb14},
+ {0x0000ab08, 0x00000000, 0x00000000, 0x0000fb18, 0x0000fb18, 0x0000fb18},
+ {0x0000ab0c, 0x00000000, 0x00000000, 0x0000fb8c, 0x0000fb8c, 0x0000fb8c},
+ {0x0000ab10, 0x00000000, 0x00000000, 0x0000fb90, 0x0000fb90, 0x0000fb90},
+ {0x0000ab14, 0x00000000, 0x00000000, 0x0000fb94, 0x0000fb94, 0x0000fb94},
+ {0x0000ab18, 0x00000000, 0x00000000, 0x0000ff8c, 0x0000ff8c, 0x0000ff8c},
+ {0x0000ab1c, 0x00000000, 0x00000000, 0x0000ff90, 0x0000ff90, 0x0000ff90},
+ {0x0000ab20, 0x00000000, 0x00000000, 0x0000ff94, 0x0000ff94, 0x0000ff94},
+ {0x0000ab24, 0x00000000, 0x00000000, 0x0000ffa0, 0x0000ffa0, 0x0000ffa0},
+ {0x0000ab28, 0x00000000, 0x00000000, 0x0000ffa4, 0x0000ffa4, 0x0000ffa4},
+ {0x0000ab2c, 0x00000000, 0x00000000, 0x0000ffa8, 0x0000ffa8, 0x0000ffa8},
+ {0x0000ab30, 0x00000000, 0x00000000, 0x0000ffac, 0x0000ffac, 0x0000ffac},
+ {0x0000ab34, 0x00000000, 0x00000000, 0x0000ffb0, 0x0000ffb0, 0x0000ffb0},
+ {0x0000ab38, 0x00000000, 0x00000000, 0x0000ffb4, 0x0000ffb4, 0x0000ffb4},
+ {0x0000ab3c, 0x00000000, 0x00000000, 0x0000ffa1, 0x0000ffa1, 0x0000ffa1},
+ {0x0000ab40, 0x00000000, 0x00000000, 0x0000ffa5, 0x0000ffa5, 0x0000ffa5},
+ {0x0000ab44, 0x00000000, 0x00000000, 0x0000ffa9, 0x0000ffa9, 0x0000ffa9},
+ {0x0000ab48, 0x00000000, 0x00000000, 0x0000ffad, 0x0000ffad, 0x0000ffad},
+ {0x0000ab4c, 0x00000000, 0x00000000, 0x0000ffb1, 0x0000ffb1, 0x0000ffb1},
+ {0x0000ab50, 0x00000000, 0x00000000, 0x0000ffb5, 0x0000ffb5, 0x0000ffb5},
+ {0x0000ab54, 0x00000000, 0x00000000, 0x0000ffb9, 0x0000ffb9, 0x0000ffb9},
+ {0x0000ab58, 0x00000000, 0x00000000, 0x0000ffc5, 0x0000ffc5, 0x0000ffc5},
+ {0x0000ab5c, 0x00000000, 0x00000000, 0x0000ffc9, 0x0000ffc9, 0x0000ffc9},
+ {0x0000ab60, 0x00000000, 0x00000000, 0x0000ffcd, 0x0000ffcd, 0x0000ffcd},
+ {0x0000ab64, 0x00000000, 0x00000000, 0x0000ffd1, 0x0000ffd1, 0x0000ffd1},
+ {0x0000ab68, 0x00000000, 0x00000000, 0x0000ffd5, 0x0000ffd5, 0x0000ffd5},
+ {0x0000ab6c, 0x00000000, 0x00000000, 0x0000ffc2, 0x0000ffc2, 0x0000ffc2},
+ {0x0000ab70, 0x00000000, 0x00000000, 0x0000ffc6, 0x0000ffc6, 0x0000ffc6},
+ {0x0000ab74, 0x00000000, 0x00000000, 0x0000ffca, 0x0000ffca, 0x0000ffca},
+ {0x0000ab78, 0x00000000, 0x00000000, 0x0000ffce, 0x0000ffce, 0x0000ffce},
+ {0x0000ab7c, 0x00000000, 0x00000000, 0x0000ffd2, 0x0000ffd2, 0x0000ffd2},
+ {0x0000ab80, 0x00000000, 0x00000000, 0x0000ffd6, 0x0000ffd6, 0x0000ffd6},
+ {0x0000ab84, 0x00000000, 0x00000000, 0x0000ffda, 0x0000ffda, 0x0000ffda},
+ {0x0000ab88, 0x00000000, 0x00000000, 0x0000ffc7, 0x0000ffc7, 0x0000ffc7},
+ {0x0000ab8c, 0x00000000, 0x00000000, 0x0000ffcb, 0x0000ffcb, 0x0000ffcb},
+ {0x0000ab90, 0x00000000, 0x00000000, 0x0000ffcf, 0x0000ffcf, 0x0000ffcf},
+ {0x0000ab94, 0x00000000, 0x00000000, 0x0000ffd3, 0x0000ffd3, 0x0000ffd3},
+ {0x0000ab98, 0x00000000, 0x00000000, 0x0000ffd7, 0x0000ffd7, 0x0000ffd7},
+ {0x0000ab9c, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000aba0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000aba4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000aba8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abac, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abb0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abb4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abb8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abbc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abc0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abc4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abc8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abcc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abd0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abd4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abd8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abdc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abe0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abe4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abe8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abec, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abf0, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abf4, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abf8, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x0000abfc, 0x00000000, 0x00000000, 0x0000ffdb, 0x0000ffdb, 0x0000ffdb},
+ {0x00009848, 0x00000000, 0x00000000, 0x00001067, 0x00001067, 0x00001067},
+ {0x0000a848, 0x00000000, 0x00000000, 0x00001067, 0x00001067, 0x00001067},
+};
+
+static const uint32_t ar9287PciePhy_clkreq_always_on_L1_9287_1_1[][2] = {
+ /* Addr allmodes */
+ {0x00004040, 0x9248fd00},
+ {0x00004040, 0x24924924},
+ {0x00004040, 0xa8000019},
+ {0x00004040, 0x13160820},
+ {0x00004040, 0xe5980560},
+ {0x00004040, 0xc01dcffd},
+ {0x00004040, 0x1aaabe41},
+ {0x00004040, 0xbe105554},
+ {0x00004040, 0x00043007},
+ {0x00004044, 0x00000000},
+};
+
+static const uint32_t ar9287PciePhy_clkreq_off_L1_9287_1_1[][2] = {
+ /* Addr allmodes */
+ {0x00004040, 0x9248fd00},
+ {0x00004040, 0x24924924},
+ {0x00004040, 0xa8000019},
+ {0x00004040, 0x13160820},
+ {0x00004040, 0xe5980560},
+ {0x00004040, 0xc01dcffc},
+ {0x00004040, 0x1aaabe41},
+ {0x00004040, 0xbe105554},
+ {0x00004040, 0x00043007},
+ {0x00004044, 0x00000000},
+};
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
new file mode 100644
index 0000000..9cbe0a5
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
@@ -0,0 +1,476 @@
+/*
+ * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting
+ * Copyright (c) 2008 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+#include "opt_ah.h"
+
+#include "ah.h"
+#include "ah_internal.h"
+#include "ah_devid.h"
+
+#include "ah_eeprom_v14.h" /* XXX for tx/rx gain */
+#include "ah_eeprom_9287.h"
+
+#include "ar9002/ar9280.h"
+#include "ar9002/ar9287.h"
+#include "ar5416/ar5416reg.h"
+#include "ar5416/ar5416phy.h"
+
+#include "ar9002/ar9287_cal.h"
+#include "ar9002/ar9287_reset.h"
+#include "ar9002/ar9287_olc.h"
+
+#include "ar9002/ar9287.ini"
+
+static const HAL_PERCAL_DATA ar9287_iq_cal = { /* single sample */
+ .calName = "IQ", .calType = IQ_MISMATCH_CAL,
+ .calNumSamples = MIN_CAL_SAMPLES,
+ .calCountMax = PER_MAX_LOG_COUNT,
+ .calCollect = ar5416IQCalCollect,
+ .calPostProc = ar5416IQCalibration
+};
+static const HAL_PERCAL_DATA ar9287_adc_gain_cal = { /* single sample */
+ .calName = "ADC Gain", .calType = ADC_GAIN_CAL,
+ .calNumSamples = MIN_CAL_SAMPLES,
+ .calCountMax = PER_MIN_LOG_COUNT,
+ .calCollect = ar5416AdcGainCalCollect,
+ .calPostProc = ar5416AdcGainCalibration
+};
+static const HAL_PERCAL_DATA ar9287_adc_dc_cal = { /* single sample */
+ .calName = "ADC DC", .calType = ADC_DC_CAL,
+ .calNumSamples = MIN_CAL_SAMPLES,
+ .calCountMax = PER_MIN_LOG_COUNT,
+ .calCollect = ar5416AdcDcCalCollect,
+ .calPostProc = ar5416AdcDcCalibration
+};
+static const HAL_PERCAL_DATA ar9287_adc_init_dc_cal = {
+ .calName = "ADC Init DC", .calType = ADC_DC_INIT_CAL,
+ .calNumSamples = MIN_CAL_SAMPLES,
+ .calCountMax = INIT_LOG_COUNT,
+ .calCollect = ar5416AdcDcCalCollect,
+ .calPostProc = ar5416AdcDcCalibration
+};
+
+static void ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore);
+static HAL_BOOL ar9287FillCapabilityInfo(struct ath_hal *ah);
+static void ar9287WriteIni(struct ath_hal *ah,
+ const struct ieee80211_channel *chan);
+
+static void
+ar9287AniSetup(struct ath_hal *ah)
+{
+ /*
+ * These are the parameters from the AR5416 ANI code;
+ * they likely need quite a bit of adjustment for the
+ * AR9280.
+ */
+ static const struct ar5212AniParams aniparams = {
+ .maxNoiseImmunityLevel = 4, /* levels 0..4 */
+ .totalSizeDesired = { -55, -55, -55, -55, -62 },
+ .coarseHigh = { -14, -14, -14, -14, -12 },
+ .coarseLow = { -64, -64, -64, -64, -70 },
+ .firpwr = { -78, -78, -78, -78, -80 },
+ .maxSpurImmunityLevel = 2,
+ .cycPwrThr1 = { 2, 4, 6 },
+ .maxFirstepLevel = 2, /* levels 0..2 */
+ .firstep = { 0, 4, 8 },
+ .ofdmTrigHigh = 500,
+ .ofdmTrigLow = 200,
+ .cckTrigHigh = 200,
+ .cckTrigLow = 100,
+ .rssiThrHigh = 40,
+ .rssiThrLow = 7,
+ .period = 100,
+ };
+ /* NB: disable ANI noise immmunity for reliable RIFS rx */
+ AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL;
+
+ /* NB: ANI is not enabled yet */
+ ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
+}
+
+/*
+ * Attach for an AR9287 part.
+ */
+static struct ath_hal *
+ar9287Attach(uint16_t devid, HAL_SOFTC sc,
+ HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
+ HAL_STATUS *status)
+{
+ struct ath_hal_9287 *ahp9287;
+ struct ath_hal_5212 *ahp;
+ struct ath_hal *ah;
+ uint32_t val;
+ HAL_STATUS ecode;
+ HAL_BOOL rfStatus;
+ int8_t pwr_table_offset;
+
+ HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n",
+ __func__, sc, (void*) st, (void*) sh);
+
+ /* NB: memory is returned zero'd */
+ ahp9287 = ath_hal_malloc(sizeof (struct ath_hal_9287));
+ if (ahp9287 == AH_NULL) {
+ HALDEBUG(AH_NULL, HAL_DEBUG_ANY,
+ "%s: cannot allocate memory for state block\n", __func__);
+ *status = HAL_ENOMEM;
+ return AH_NULL;
+ }
+ ahp = AH5212(ahp9287);
+ ah = &ahp->ah_priv.h;
+
+ ar5416InitState(AH5416(ah), devid, sc, st, sh, status);
+
+ /* XXX override with 9280 specific state */
+ /* override 5416 methods for our needs */
+ ah->ah_setAntennaSwitch = ar9287SetAntennaSwitch;
+ ah->ah_configPCIE = ar9287ConfigPCIE;
+
+ AH5416(ah)->ah_cal.iqCalData.calData = &ar9287_iq_cal;
+ AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9287_adc_gain_cal;
+ AH5416(ah)->ah_cal.adcDcCalData.calData = &ar9287_adc_dc_cal;
+ AH5416(ah)->ah_cal.adcDcCalInitData.calData = &ar9287_adc_init_dc_cal;
+ /* Better performance without ADC Gain Calibration */
+ AH5416(ah)->ah_cal.suppCals = ADC_DC_CAL | IQ_MISMATCH_CAL;
+
+ AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate;
+ AH5416(ah)->ah_writeIni = ar9287WriteIni;
+
+ ah->ah_setTxPower = ar9287SetTransmitPower;
+ ah->ah_setBoardValues = ar9287SetBoardValues;
+
+ AH5416(ah)->ah_olcInit = ar9287olcInit;
+ AH5416(ah)->ah_olcTempCompensation = ar9287olcTemperatureCompensation;
+ //AH5416(ah)->ah_setPowerCalTable = ar9287SetPowerCalTable;
+ AH5416(ah)->ah_cal_initcal = ar9287InitCalHardware;
+ AH5416(ah)->ah_cal_pacal = ar9287PACal;
+
+ /* XXX NF calibration */
+ /* XXX Ini override? (IFS vars - since the kiwi mac clock is faster?) */
+ /* XXX what else is kiwi-specific in the radio/calibration pathway? */
+
+ AH5416(ah)->ah_rx_chainmask = AR9287_DEFAULT_RXCHAINMASK;
+ AH5416(ah)->ah_tx_chainmask = AR9287_DEFAULT_TXCHAINMASK;
+
+ if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) {
+ /* reset chip */
+ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n",
+ __func__);
+ ecode = HAL_EIO;
+ goto bad;
+ }
+
+ if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) {
+ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n",
+ __func__);
+ ecode = HAL_EIO;
+ goto bad;
+ }
+ /* Read Revisions from Chips before taking out of reset */
+ val = OS_REG_READ(ah, AR_SREV);
+ HALDEBUG(ah, HAL_DEBUG_ATTACH,
+ "%s: ID 0x%x VERSION 0x%x TYPE 0x%x REVISION 0x%x\n",
+ __func__, MS(val, AR_XSREV_ID), MS(val, AR_XSREV_VERSION),
+ MS(val, AR_XSREV_TYPE), MS(val, AR_XSREV_REVISION));
+ /* NB: include chip type to differentiate from pre-Sowl versions */
+ AH_PRIVATE(ah)->ah_macVersion =
+ (val & AR_XSREV_VERSION) >> AR_XSREV_TYPE_S;
+ AH_PRIVATE(ah)->ah_macRev = MS(val, AR_XSREV_REVISION);
+ AH_PRIVATE(ah)->ah_ispcie = (val & AR_XSREV_TYPE_HOST_MODE) == 0;
+
+ /* Don't support Kiwi < 1.2; those are pre-release chips */
+ if (! AR_SREV_KIWI_12_OR_LATER(ah)) {
+ ath_hal_printf(ah, "[ath]: Kiwi < 1.2 is not supported\n");
+ ecode = HAL_EIO;
+ goto bad;
+ }
+
+ /* setup common ini data; rf backends handle remainder */
+ HAL_INI_INIT(&ahp->ah_ini_modes, ar9287Modes_9287_1_1, 6);
+ HAL_INI_INIT(&ahp->ah_ini_common, ar9287Common_9287_1_1, 2);
+
+ /* If pcie_clock_req */
+ HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes,
+ ar9287PciePhy_clkreq_always_on_L1_9287_1_1, 2);
+
+ /* XXX WoW ini values */
+
+ /* Else */
+#if 0
+ HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes,
+ ar9287PciePhy_clkreq_off_L1_9287_1_1, 2);
+#endif
+
+ /* Initialise Japan arrays */
+ HAL_INI_INIT(&ahp9287->ah_ini_cckFirNormal,
+ ar9287Common_normal_cck_fir_coeff_9287_1_1, 2);
+ HAL_INI_INIT(&ahp9287->ah_ini_cckFirJapan2484,
+ ar9287Common_japan_2484_cck_fir_coeff_9287_1_1, 2);
+
+ ar5416AttachPCIE(ah);
+
+ ecode = ath_hal_9287EepromAttach(ah);
+ if (ecode != HAL_OK)
+ goto bad;
+
+ if (!ar5416ChipReset(ah, AH_NULL)) { /* reset chip */
+ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", __func__);
+ ecode = HAL_EIO;
+ goto bad;
+ }
+
+ AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIP_ID);
+
+ if (!ar5212ChipTest(ah)) {
+ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: hardware self-test failed\n",
+ __func__);
+ ecode = HAL_ESELFTEST;
+ goto bad;
+ }
+
+ /*
+ * Set correct Baseband to analog shift
+ * setting to access analog chips.
+ */
+ OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
+
+ /* Read Radio Chip Rev Extract */
+ AH_PRIVATE(ah)->ah_analog5GhzRev = ar5416GetRadioRev(ah);
+ switch (AH_PRIVATE(ah)->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR) {
+ case AR_RAD2133_SREV_MAJOR: /* Sowl: 2G/3x3 */
+ case AR_RAD5133_SREV_MAJOR: /* Sowl: 2+5G/3x3 */
+ break;
+ default:
+ if (AH_PRIVATE(ah)->ah_analog5GhzRev == 0) {
+ AH_PRIVATE(ah)->ah_analog5GhzRev =
+ AR_RAD5133_SREV_MAJOR;
+ break;
+ }
+#ifdef AH_DEBUG
+ HALDEBUG(ah, HAL_DEBUG_ANY,
+ "%s: 5G Radio Chip Rev 0x%02X is not supported by "
+ "this driver\n", __func__,
+ AH_PRIVATE(ah)->ah_analog5GhzRev);
+ ecode = HAL_ENOTSUPP;
+ goto bad;
+#endif
+ }
+ rfStatus = ar9287RfAttach(ah, &ecode);
+ if (!rfStatus) {
+ HALDEBUG(ah, HAL_DEBUG_ANY, "%s: RF setup failed, status %u\n",
+ __func__, ecode);
+ goto bad;
+ }
+
+ /*
+ * We only implement open-loop TX power control
+ * for the AR9287 in this codebase.
+ */
+ if (! ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) {
+ ath_hal_printf(ah, "[ath] AR9287 w/ closed-loop TX power control"
+ " isn't supported.\n");
+ ecode = HAL_ENOTSUPP;
+ goto bad;
+ }
+
+ /*
+ * Check whether the power table offset isn't the default.
+ * This can occur with eeprom minor V21 or greater on Merlin.
+ */
+ (void) ath_hal_eepromGet(ah, AR_EEP_PWR_TABLE_OFFSET, &pwr_table_offset);
+ if (pwr_table_offset != AR5416_PWR_TABLE_OFFSET_DB)
+ ath_hal_printf(ah, "[ath]: default pwr offset: %d dBm != EEPROM pwr offset: %d dBm; curves will be adjusted.\n",
+ AR5416_PWR_TABLE_OFFSET_DB, (int) pwr_table_offset);
+
+ /* setup rxgain table */
+ HAL_INI_INIT(&ahp9287->ah_ini_rxgain, ar9287Modes_rx_gain_9287_1_1, 6);
+
+ /* setup txgain table */
+ HAL_INI_INIT(&ahp9287->ah_ini_txgain, ar9287Modes_tx_gain_9287_1_1, 6);
+
+ /*
+ * Got everything we need now to setup the capabilities.
+ */
+ if (!ar9287FillCapabilityInfo(ah)) {
+ ecode = HAL_EEREAD;
+ goto bad;
+ }
+
+ ecode = ath_hal_eepromGet(ah, AR_EEP_MACADDR, ahp->ah_macaddr);
+ if (ecode != HAL_OK) {
+ HALDEBUG(ah, HAL_DEBUG_ANY,
+ "%s: error getting mac address from EEPROM\n", __func__);
+ goto bad;
+ }
+ /* XXX How about the serial number ? */
+ /* Read Reg Domain */
+ AH_PRIVATE(ah)->ah_currentRD =
+ ath_hal_eepromGet(ah, AR_EEP_REGDMN_0, AH_NULL);
+
+ /*
+ * ah_miscMode is populated by ar5416FillCapabilityInfo()
+ * starting from griffin. Set here to make sure that
+ * AR_MISC_MODE_MIC_NEW_LOC_ENABLE is set before a GTK is
+ * placed into hardware.
+ */
+ if (ahp->ah_miscMode != 0)
+ OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp->ah_miscMode);
+
+ ar9287AniSetup(ah); /* Anti Noise Immunity */
+
+ /* Setup noise floor min/max/nominal values */
+ AH5416(ah)->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ;
+ AH5416(ah)->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9287_2GHZ;
+ AH5416(ah)->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9287_2GHZ;
+ AH5416(ah)->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_9287_5GHZ;
+ AH5416(ah)->nf_5g.min = AR_PHY_CCA_MIN_GOOD_VAL_9287_5GHZ;
+ AH5416(ah)->nf_5g.nominal = AR_PHY_CCA_NOM_VAL_9287_5GHZ;
+
+ ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist);
+
+ HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__);
+
+ return ah;
+bad:
+ if (ah != AH_NULL)
+ ah->ah_detach(ah);
+ if (status)
+ *status = ecode;
+ return AH_NULL;
+}
+
+static void
+ar9287ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore)
+{
+ if (AH_PRIVATE(ah)->ah_ispcie && !restore) {
+ ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0);
+ OS_DELAY(1000);
+ OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA);
+ OS_REG_WRITE(ah, AR_WA, AR9285_WA_DEFAULT); /* Yes, Kiwi uses the Kite PCIe PHY WA */
+ }
+}
+
+static void
+ar9287WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+ u_int modesIndex, freqIndex;
+ int regWrites = 0;
+
+ /* Setup the indices for the next set of register array writes */
+ /* XXX Ignore 11n dynamic mode on the AR5416 for the moment */
+ if (IEEE80211_IS_CHAN_2GHZ(chan)) {
+ freqIndex = 2;
+ if (IEEE80211_IS_CHAN_HT40(chan))
+ modesIndex = 3;
+ else if (IEEE80211_IS_CHAN_108G(chan))
+ modesIndex = 5;
+ else
+ modesIndex = 4;
+ } else {
+ freqIndex = 1;
+ if (IEEE80211_IS_CHAN_HT40(chan) ||
+ IEEE80211_IS_CHAN_TURBO(chan))
+ modesIndex = 2;
+ else
+ modesIndex = 1;
+ }
+
+ /* Set correct Baseband to analog shift setting to access analog chips. */
+ OS_REG_WRITE(ah, AR_PHY(0), 0x00000007);
+ OS_REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_INTERNAL_ADDAC);
+
+ regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_modes, modesIndex, regWrites);
+ regWrites = ath_hal_ini_write(ah, &AH9287(ah)->ah_ini_rxgain, modesIndex, regWrites);
+ regWrites = ath_hal_ini_write(ah, &AH9287(ah)->ah_ini_txgain, modesIndex, regWrites);
+ regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_common, 1, regWrites);
+}
+
+#define AR_BASE_FREQ_2GHZ 2300
+#define AR_BASE_FREQ_5GHZ 4900
+#define AR_SPUR_FEEQ_BOUND_HT40 19
+#define AR_SPUR_FEEQ_BOUND_HT20 10
+
+
+
+/*
+ * Fill all software cached or static hardware state information.
+ * Return failure if capabilities are to come from EEPROM and
+ * cannot be read.
+ */
+static HAL_BOOL
+ar9287FillCapabilityInfo(struct ath_hal *ah)
+{
+ HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps;
+
+ if (!ar5416FillCapabilityInfo(ah))
+ return AH_FALSE;
+ pCap->halNumGpioPins = 10;
+ pCap->halWowSupport = AH_TRUE;
+ pCap->halWowMatchPatternExact = AH_TRUE;
+#if 0
+ pCap->halWowMatchPatternDword = AH_TRUE;
+#endif
+
+ pCap->halCSTSupport = AH_TRUE;
+ pCap->halRifsRxSupport = AH_TRUE;
+ pCap->halRifsTxSupport = AH_TRUE;
+ pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */
+ pCap->halExtChanDfsSupport = AH_TRUE;
+ pCap->halUseCombinedRadarRssi = AH_TRUE;
+#if 0
+ /* XXX bluetooth */
+ pCap->halBtCoexSupport = AH_TRUE;
+#endif
+ pCap->halAutoSleepSupport = AH_FALSE; /* XXX? */
+ pCap->hal4kbSplitTransSupport = AH_FALSE;
+ /* Disable this so Block-ACK works correctly */
+ pCap->halHasRxSelfLinkedTail = AH_FALSE;
+ pCap->halPSPollBroken = AH_FALSE;
+
+ /* Hardware supports (at least) single-stream STBC TX/RX */
+ pCap->halRxStbcSupport = 1;
+ pCap->halTxStbcSupport = 1;
+
+ /* Hardware supports short-GI w/ 20MHz */
+ pCap->halHTSGI20Support = 1;
+
+ pCap->halEnhancedDfsSupport = AH_TRUE;
+
+ return AH_TRUE;
+}
+
+/*
+ * This has been disabled - having the HAL flip chainmasks on/off
+ * when attempting to implement 11n disrupts things. For now, just
+ * leave this flipped off and worry about implementing TX diversity
+ * for legacy and MCS0-7 when 11n is fully functioning.
+ */
+HAL_BOOL
+ar9287SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings)
+{
+ return AH_TRUE;
+}
+
+static const char*
+ar9287Probe(uint16_t vendorid, uint16_t devid)
+{
+ if (vendorid == ATHEROS_VENDOR_ID &&
+ (devid == AR9287_DEVID_PCI || devid == AR9287_DEVID_PCIE))
+ return "Atheros 9287";
+ return AH_NULL;
+}
+AH_CHIP(AR9287, ar9287Probe, ar9287Attach);
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c b/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c
new file mode 100644
index 0000000..d5024b0
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2008-2010 Atheros Communications Inc.
+ * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+#include "opt_ah.h"
+#include "ah.h"
+#include "ah_internal.h"
+
+#include "ah_eeprom_v4k.h"
+
+#include "ar9002/ar9285.h"
+#include "ar5416/ar5416reg.h"
+#include "ar5416/ar5416phy.h"
+#include "ar9002/ar9002phy.h"
+//#include "ar9002/ar9287phy.h"
+
+#include "ar9002/ar9287_cal.h"
+
+
+void
+ar9287PACal(struct ath_hal *ah, HAL_BOOL is_reset)
+{
+ /* XXX not required */
+}
+
+/*
+ * This is like Merlin but without ADC disable
+ */
+HAL_BOOL
+ar9287InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+ OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_FLTR_CAL);
+
+ /* Calibrate the AGC */
+ OS_REG_WRITE(ah, AR_PHY_AGC_CONTROL,
+ OS_REG_READ(ah, AR_PHY_AGC_CONTROL) | AR_PHY_AGC_CONTROL_CAL);
+
+ /* Poll for offset calibration complete */
+ if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL,
+ AR_PHY_AGC_CONTROL_CAL, 0)) {
+ HALDEBUG(ah, HAL_DEBUG_RESET,
+ "%s: offset calibration failed to complete in 1ms; "
+ "noisy environment?\n", __func__);
+ return AH_FALSE;
+ }
+
+ OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_FLTR_CAL);
+
+ return AH_TRUE;
+}
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h b/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h
new file mode 100644
index 0000000..1a7cda2
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2008-2010 Atheros Communications Inc.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+#ifndef __AR9287_CAL_H__
+#define __AR9287_CAL_H__
+
+extern void ar9287PACal(struct ath_hal *ah, HAL_BOOL is_reset);
+extern HAL_BOOL ar9287InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan);
+
+#endif /* __AR9287_CAL_H__ */
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c b/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c
new file mode 100644
index 0000000..cbbe017
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+#include "opt_ah.h"
+
+#include "ah.h"
+#include "ah_internal.h"
+
+#include "ah_eeprom_v14.h"
+#include "ah_eeprom_9287.h"
+
+#include "ar9002/ar9280.h"
+#include "ar5416/ar5416reg.h"
+#include "ar5416/ar5416phy.h"
+#include "ar9002/ar9002phy.h"
+
+#include "ar9002/ar9287phy.h"
+#include "ar9002/ar9287an.h"
+#include "ar9002/ar9287_olc.h"
+
+void
+ar9287olcInit(struct ath_hal *ah)
+{
+ OS_REG_SET_BIT(ah, AR_PHY_TX_PWRCTRL9,
+ AR_PHY_TX_PWRCTRL9_RES_DC_REMOVAL);
+ OS_A_REG_RMW_FIELD(ah, AR9287_AN_TXPC0,
+ AR9287_AN_TXPC0_TXPCMODE,
+ AR9287_AN_TXPC0_TXPCMODE_TEMPSENSE);
+ OS_DELAY(100);
+}
+
+/*
+ * Run temperature compensation calibration.
+ *
+ * The TX gain table is adjusted depending upon the difference
+ * between the initial PDADC value and the currently read
+ * average TX power sample value. This value is only valid if
+ * frames have been transmitted, so currPDADC will be 0 if
+ * no frames have yet been transmitted.
+ */
+void
+ar9287olcTemperatureCompensation(struct ath_hal *ah)
+{
+ uint32_t rddata;
+ int32_t delta, currPDADC, slope;
+
+ rddata = OS_REG_READ(ah, AR_PHY_TX_PWRCTRL4);
+ currPDADC = MS(rddata, AR_PHY_TX_PWRCTRL_PD_AVG_OUT);
+
+ HALDEBUG(ah, HAL_DEBUG_PERCAL, "%s: initPDADC=%d, currPDADC=%d\n",
+ __func__, AH5416(ah)->initPDADC, currPDADC);
+
+ if (AH5416(ah)->initPDADC == 0 || currPDADC == 0) {
+ /*
+ * Zero value indicates that no frames have been transmitted
+ * yet, can't do temperature compensation until frames are
+ * transmitted.
+ */
+ return;
+ } else {
+ int8_t val;
+ (void) (ath_hal_eepromGet(ah, AR_EEP_TEMPSENSE_SLOPE, &val));
+ slope = val;
+
+ if (slope == 0) { /* to avoid divide by zero case */
+ delta = 0;
+ } else {
+ delta = ((currPDADC - AH5416(ah)->initPDADC)*4) / slope;
+ }
+ OS_REG_RMW_FIELD(ah, AR_PHY_CH0_TX_PWRCTRL11,
+ AR_PHY_TX_PWRCTRL_OLPC_TEMP_COMP, delta);
+ OS_REG_RMW_FIELD(ah, AR_PHY_CH1_TX_PWRCTRL11,
+ AR_PHY_TX_PWRCTRL_OLPC_TEMP_COMP, delta);
+
+ HALDEBUG(ah, HAL_DEBUG_PERCAL, "%s: delta=%d\n", __func__, delta);
+ }
+}
+
+void
+ar9287olcGetTxGainIndex(struct ath_hal *ah,
+ const struct ieee80211_channel *chan,
+ struct cal_data_op_loop_ar9287 *pRawDatasetOpLoop,
+ uint8_t *pCalChans, uint16_t availPiers, int8_t *pPwr)
+{
+ uint16_t idxL = 0, idxR = 0, numPiers;
+ HAL_BOOL match;
+ CHAN_CENTERS centers;
+
+ ar5416GetChannelCenters(ah, chan, &centers);
+
+ for (numPiers = 0; numPiers < availPiers; numPiers++) {
+ if (pCalChans[numPiers] == AR5416_BCHAN_UNUSED)
+ break;
+ }
+
+ match = ath_ee_getLowerUpperIndex(
+ (uint8_t)FREQ2FBIN(centers.synth_center, IEEE80211_IS_CHAN_2GHZ(chan)),
+ pCalChans, numPiers, &idxL, &idxR);
+
+ if (match) {
+ *pPwr = (int8_t) pRawDatasetOpLoop[idxL].pwrPdg[0][0];
+ } else {
+ *pPwr = ((int8_t) pRawDatasetOpLoop[idxL].pwrPdg[0][0] +
+ (int8_t) pRawDatasetOpLoop[idxR].pwrPdg[0][0])/2;
+ }
+}
+
+void
+ar9287olcSetPDADCs(struct ath_hal *ah, int32_t txPower,
+ uint16_t chain)
+{
+ uint32_t tmpVal;
+ uint32_t a;
+
+ /* Enable OLPC for chain 0 */
+
+ tmpVal = OS_REG_READ(ah, 0xa270);
+ tmpVal = tmpVal & 0xFCFFFFFF;
+ tmpVal = tmpVal | (0x3 << 24);
+ OS_REG_WRITE(ah, 0xa270, tmpVal);
+
+ /* Enable OLPC for chain 1 */
+
+ tmpVal = OS_REG_READ(ah, 0xb270);
+ tmpVal = tmpVal & 0xFCFFFFFF;
+ tmpVal = tmpVal | (0x3 << 24);
+ OS_REG_WRITE(ah, 0xb270, tmpVal);
+
+ /* Write the OLPC ref power for chain 0 */
+
+ if (chain == 0) {
+ tmpVal = OS_REG_READ(ah, 0xa398);
+ tmpVal = tmpVal & 0xff00ffff;
+ a = (txPower)&0xff;
+ tmpVal = tmpVal | (a << 16);
+ OS_REG_WRITE(ah, 0xa398, tmpVal);
+ }
+
+ /* Write the OLPC ref power for chain 1 */
+
+ if (chain == 1) {
+ tmpVal = OS_REG_READ(ah, 0xb398);
+ tmpVal = tmpVal & 0xff00ffff;
+ a = (txPower)&0xff;
+ tmpVal = tmpVal | (a << 16);
+ OS_REG_WRITE(ah, 0xb398, tmpVal);
+ }
+}
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h b/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h
new file mode 100644
index 0000000..ff21ce6
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __AR9287_OLC_H__
+#define __AR9287_OLC_H__
+
+extern void ar9287olcInit(struct ath_hal *ah);
+extern void ar9287olcTemperatureCompensation(struct ath_hal *ah);
+extern void ar9287olcGetTxGainIndex(struct ath_hal *ah,
+ const struct ieee80211_channel *chan,
+ struct cal_data_op_loop_ar9287 *pRawDatasetOpLoop,
+ uint8_t *pCalChans, uint16_t availPiers, int8_t *pPwr);
+extern void ar9287olcSetPDADCs(struct ath_hal *ah,
+ int32_t txPower, uint16_t chain);
+
+#endif /* __AR9287_OLC_H__ */
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c b/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c
new file mode 100644
index 0000000..a799ba0
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c
@@ -0,0 +1,571 @@
+/*
+ * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
+ * Copyright (c) 2002-2008 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#include "opt_ah.h"
+
+#include "ah.h"
+#include "ah_internal.h"
+#include "ah_devid.h"
+
+#include "ah_eeprom_v14.h"
+#include "ah_eeprom_9287.h"
+
+#include "ar5416/ar5416.h"
+#include "ar5416/ar5416reg.h"
+#include "ar5416/ar5416phy.h"
+
+#include "ar9002/ar9287phy.h"
+#include "ar9002/ar9287an.h"
+
+#include "ar9002/ar9287_olc.h"
+#include "ar9002/ar9287_reset.h"
+
+/*
+ * Set the TX power calibration table per-chain.
+ *
+ * This only supports open-loop TX power control for the AR9287.
+ */
+static void
+ar9287SetPowerCalTable(struct ath_hal *ah,
+ const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset)
+{
+ struct cal_data_op_loop_ar9287 *pRawDatasetOpenLoop;
+ uint8_t *pCalBChans = NULL;
+ uint16_t pdGainOverlap_t2;
+ uint16_t numPiers = 0, i;
+ uint16_t numXpdGain, xpdMask;
+ uint16_t xpdGainValues[AR5416_NUM_PD_GAINS] = {0, 0, 0, 0};
+ uint32_t regChainOffset;
+ HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom;
+ struct ar9287_eeprom *pEepData = &ee->ee_base;
+
+ xpdMask = pEepData->modalHeader.xpdGain;
+
+ if ((pEepData->baseEepHeader.version & AR9287_EEP_VER_MINOR_MASK) >=
+ AR9287_EEP_MINOR_VER_2)
+ pdGainOverlap_t2 = pEepData->modalHeader.pdGainOverlap;
+ else
+ pdGainOverlap_t2 = (uint16_t)(MS(OS_REG_READ(ah, AR_PHY_TPCRG5),
+ AR_PHY_TPCRG5_PD_GAIN_OVERLAP));
+
+ /* Note: Kiwi should only be 2ghz.. */
+ if (IEEE80211_IS_CHAN_2GHZ(chan)) {
+ pCalBChans = pEepData->calFreqPier2G;
+ numPiers = AR9287_NUM_2G_CAL_PIERS;
+ pRawDatasetOpenLoop = (struct cal_data_op_loop_ar9287 *)pEepData->calPierData2G[0];
+ AH5416(ah)->initPDADC = pRawDatasetOpenLoop->vpdPdg[0][0];
+ }
+ numXpdGain = 0;
+
+ /* Calculate the value of xpdgains from the xpdGain Mask */
+ for (i = 1; i <= AR5416_PD_GAINS_IN_MASK; i++) {
+ if ((xpdMask >> (AR5416_PD_GAINS_IN_MASK - i)) & 1) {
+ if (numXpdGain >= AR5416_NUM_PD_GAINS)
+ break;
+ xpdGainValues[numXpdGain] =
+ (uint16_t)(AR5416_PD_GAINS_IN_MASK-i);
+ numXpdGain++;
+ }
+ }
+
+ OS_REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_NUM_PD_GAIN,
+ (numXpdGain - 1) & 0x3);
+ OS_REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_1,
+ xpdGainValues[0]);
+ OS_REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_2,
+ xpdGainValues[1]);
+ OS_REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3,
+ xpdGainValues[2]);
+
+ for (i = 0; i < AR9287_MAX_CHAINS; i++) {
+ regChainOffset = i * 0x1000;
+
+ if (pEepData->baseEepHeader.txMask & (1 << i)) {
+ int8_t txPower;
+ pRawDatasetOpenLoop =
+ (struct cal_data_op_loop_ar9287 *)pEepData->calPierData2G[i];
+ ar9287olcGetTxGainIndex(ah, chan,
+ pRawDatasetOpenLoop,
+ pCalBChans, numPiers,
+ &txPower);
+ ar9287olcSetPDADCs(ah, txPower, i);
+ }
+ }
+
+ *pTxPowerIndexOffset = 0;
+}
+
+
+/* XXX hard-coded values? */
+#define REDUCE_SCALED_POWER_BY_TWO_CHAIN 6
+
+/*
+ * ar9287SetPowerPerRateTable
+ *
+ * Sets the transmit power in the baseband for the given
+ * operating channel and mode.
+ *
+ * This is like the v14 EEPROM table except the 5GHz code.
+ */
+static HAL_BOOL
+ar9287SetPowerPerRateTable(struct ath_hal *ah,
+ struct ar9287_eeprom *pEepData,
+ const struct ieee80211_channel *chan,
+ int16_t *ratesArray, uint16_t cfgCtl,
+ uint16_t AntennaReduction,
+ uint16_t twiceMaxRegulatoryPower,
+ uint16_t powerLimit)
+{
+#define N(a) (sizeof(a)/sizeof(a[0]))
+/* Local defines to distinguish between extension and control CTL's */
+#define EXT_ADDITIVE (0x8000)
+#define CTL_11A_EXT (CTL_11A | EXT_ADDITIVE)
+#define CTL_11G_EXT (CTL_11G | EXT_ADDITIVE)
+#define CTL_11B_EXT (CTL_11B | EXT_ADDITIVE)
+
+ uint16_t twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
+ int i;
+ int16_t twiceLargestAntenna;
+ struct cal_ctl_data_ar9287 *rep;
+ CAL_TARGET_POWER_LEG targetPowerOfdm;
+ CAL_TARGET_POWER_LEG targetPowerCck = {0, {0, 0, 0, 0}};
+ CAL_TARGET_POWER_LEG targetPowerOfdmExt = {0, {0, 0, 0, 0}};
+ CAL_TARGET_POWER_LEG targetPowerCckExt = {0, {0, 0, 0, 0}};
+ CAL_TARGET_POWER_HT targetPowerHt20;
+ CAL_TARGET_POWER_HT targetPowerHt40 = {0, {0, 0, 0, 0}};
+ int16_t scaledPower, minCtlPower;
+
+#define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */
+ static const uint16_t ctlModesFor11g[] = {
+ CTL_11B, CTL_11G, CTL_2GHT20, CTL_11B_EXT, CTL_11G_EXT, CTL_2GHT40
+ };
+ const uint16_t *pCtlMode;
+ uint16_t numCtlModes, ctlMode, freq;
+ CHAN_CENTERS centers;
+
+ ar5416GetChannelCenters(ah, chan, &centers);
+
+ /* Compute TxPower reduction due to Antenna Gain */
+
+ twiceLargestAntenna = AH_MAX(
+ pEepData->modalHeader.antennaGainCh[0],
+ pEepData->modalHeader.antennaGainCh[1]);
+
+ twiceLargestAntenna = (int16_t)AH_MIN((AntennaReduction) - twiceLargestAntenna, 0);
+
+ /* XXX setup for 5212 use (really used?) */
+ ath_hal_eepromSet(ah, AR_EEP_ANTGAINMAX_2, twiceLargestAntenna);
+
+ /*
+ * scaledPower is the minimum of the user input power level and
+ * the regulatory allowed power level
+ */
+ scaledPower = AH_MIN(powerLimit, twiceMaxRegulatoryPower + twiceLargestAntenna);
+
+ /* Reduce scaled Power by number of chains active to get to per chain tx power level */
+ /* TODO: better value than these? */
+ switch (owl_get_ntxchains(AH5416(ah)->ah_tx_chainmask)) {
+ case 1:
+ break;
+ case 2:
+ scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
+ break;
+ default:
+ return AH_FALSE; /* Unsupported number of chains */
+ }
+
+ scaledPower = AH_MAX(0, scaledPower);
+
+ /* Get target powers from EEPROM - our baseline for TX Power */
+ /* XXX assume channel is 2ghz */
+ if (1) {
+ /* Setup for CTL modes */
+ numCtlModes = N(ctlModesFor11g) - SUB_NUM_CTL_MODES_AT_2G_40; /* CTL_11B, CTL_11G, CTL_2GHT20 */
+ pCtlMode = ctlModesFor11g;
+
+ ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPowerCck,
+ AR9287_NUM_2G_CCK_TARGET_POWERS, &targetPowerCck, 4, AH_FALSE);
+ ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPower2G,
+ AR9287_NUM_2G_20_TARGET_POWERS, &targetPowerOfdm, 4, AH_FALSE);
+ ar5416GetTargetPowers(ah, chan, pEepData->calTargetPower2GHT20,
+ AR9287_NUM_2G_20_TARGET_POWERS, &targetPowerHt20, 8, AH_FALSE);
+
+ if (IEEE80211_IS_CHAN_HT40(chan)) {
+ numCtlModes = N(ctlModesFor11g); /* All 2G CTL's */
+
+ ar5416GetTargetPowers(ah, chan, pEepData->calTargetPower2GHT40,
+ AR9287_NUM_2G_40_TARGET_POWERS, &targetPowerHt40, 8, AH_TRUE);
+ /* Get target powers for extension channels */
+ ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPowerCck,
+ AR9287_NUM_2G_CCK_TARGET_POWERS, &targetPowerCckExt, 4, AH_TRUE);
+ ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPower2G,
+ AR9287_NUM_2G_20_TARGET_POWERS, &targetPowerOfdmExt, 4, AH_TRUE);
+ }
+ }
+
+ /*
+ * For MIMO, need to apply regulatory caps individually across dynamically
+ * running modes: CCK, OFDM, HT20, HT40
+ *
+ * The outer loop walks through each possible applicable runtime mode.
+ * The inner loop walks through each ctlIndex entry in EEPROM.
+ * The ctl value is encoded as [7:4] == test group, [3:0] == test mode.
+ *
+ */
+ for (ctlMode = 0; ctlMode < numCtlModes; ctlMode++) {
+ HAL_BOOL isHt40CtlMode = (pCtlMode[ctlMode] == CTL_5GHT40) ||
+ (pCtlMode[ctlMode] == CTL_2GHT40);
+ if (isHt40CtlMode) {
+ freq = centers.ctl_center;
+ } else if (pCtlMode[ctlMode] & EXT_ADDITIVE) {
+ freq = centers.ext_center;
+ } else {
+ freq = centers.ctl_center;
+ }
+
+ /* walk through each CTL index stored in EEPROM */
+ for (i = 0; (i < AR9287_NUM_CTLS) && pEepData->ctlIndex[i]; i++) {
+ uint16_t twiceMinEdgePower;
+
+ /* compare test group from regulatory channel list with test mode from pCtlMode list */
+ if ((((cfgCtl & ~CTL_MODE_M) | (pCtlMode[ctlMode] & CTL_MODE_M)) == pEepData->ctlIndex[i]) ||
+ (((cfgCtl & ~CTL_MODE_M) | (pCtlMode[ctlMode] & CTL_MODE_M)) ==
+ ((pEepData->ctlIndex[i] & CTL_MODE_M) | SD_NO_CTL))) {
+ rep = &(pEepData->ctlData[i]);
+ twiceMinEdgePower = ar5416GetMaxEdgePower(freq,
+ rep->ctlEdges[owl_get_ntxchains(AH5416(ah)->ah_tx_chainmask) - 1],
+ IEEE80211_IS_CHAN_2GHZ(chan));
+ if ((cfgCtl & ~CTL_MODE_M) == SD_NO_CTL) {
+ /* Find the minimum of all CTL edge powers that apply to this channel */
+ twiceMaxEdgePower = AH_MIN(twiceMaxEdgePower, twiceMinEdgePower);
+ } else {
+ /* specific */
+ twiceMaxEdgePower = twiceMinEdgePower;
+ break;
+ }
+ }
+ }
+ minCtlPower = (uint8_t)AH_MIN(twiceMaxEdgePower, scaledPower);
+ /* Apply ctl mode to correct target power set */
+ switch(pCtlMode[ctlMode]) {
+ case CTL_11B:
+ for (i = 0; i < N(targetPowerCck.tPow2x); i++) {
+ targetPowerCck.tPow2x[i] = (uint8_t)AH_MIN(targetPowerCck.tPow2x[i], minCtlPower);
+ }
+ break;
+ case CTL_11A:
+ case CTL_11G:
+ for (i = 0; i < N(targetPowerOfdm.tPow2x); i++) {
+ targetPowerOfdm.tPow2x[i] = (uint8_t)AH_MIN(targetPowerOfdm.tPow2x[i], minCtlPower);
+ }
+ break;
+ case CTL_5GHT20:
+ case CTL_2GHT20:
+ for (i = 0; i < N(targetPowerHt20.tPow2x); i++) {
+ targetPowerHt20.tPow2x[i] = (uint8_t)AH_MIN(targetPowerHt20.tPow2x[i], minCtlPower);
+ }
+ break;
+ case CTL_11B_EXT:
+ targetPowerCckExt.tPow2x[0] = (uint8_t)AH_MIN(targetPowerCckExt.tPow2x[0], minCtlPower);
+ break;
+ case CTL_11A_EXT:
+ case CTL_11G_EXT:
+ targetPowerOfdmExt.tPow2x[0] = (uint8_t)AH_MIN(targetPowerOfdmExt.tPow2x[0], minCtlPower);
+ break;
+ case CTL_5GHT40:
+ case CTL_2GHT40:
+ for (i = 0; i < N(targetPowerHt40.tPow2x); i++) {
+ targetPowerHt40.tPow2x[i] = (uint8_t)AH_MIN(targetPowerHt40.tPow2x[i], minCtlPower);
+ }
+ break;
+ default:
+ return AH_FALSE;
+ break;
+ }
+ } /* end ctl mode checking */
+
+ /* Set rates Array from collected data */
+ ar5416SetRatesArrayFromTargetPower(ah, chan, ratesArray,
+ &targetPowerCck,
+ &targetPowerCckExt,
+ &targetPowerOfdm,
+ &targetPowerOfdmExt,
+ &targetPowerHt20,
+ &targetPowerHt40);
+ return AH_TRUE;
+#undef EXT_ADDITIVE
+#undef CTL_11A_EXT
+#undef CTL_11G_EXT
+#undef CTL_11B_EXT
+#undef SUB_NUM_CTL_MODES_AT_5G_40
+#undef SUB_NUM_CTL_MODES_AT_2G_40
+#undef N
+}
+
+#undef REDUCE_SCALED_POWER_BY_TWO_CHAIN
+
+/*
+ * This is based off of the AR5416/AR9285 code and likely could
+ * be unified in the future.
+ */
+HAL_BOOL
+ar9287SetTransmitPower(struct ath_hal *ah,
+ const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
+{
+#define POW_SM(_r, _s) (((_r) & 0x3f) << (_s))
+#define N(a) (sizeof (a) / sizeof (a[0]))
+
+ const struct modal_eep_ar9287_header *pModal;
+ struct ath_hal_5212 *ahp = AH5212(ah);
+ int16_t ratesArray[Ar5416RateSize];
+ int16_t txPowerIndexOffset = 0;
+ uint8_t ht40PowerIncForPdadc = 2;
+ int i;
+
+ uint16_t cfgCtl;
+ uint16_t powerLimit;
+ uint16_t twiceAntennaReduction;
+ uint16_t twiceMaxRegulatoryPower;
+ int16_t maxPower;
+ HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom;
+ struct ar9287_eeprom *pEepData = &ee->ee_base;
+
+ /* Setup info for the actual eeprom */
+ OS_MEMZERO(ratesArray, sizeof(ratesArray));
+ cfgCtl = ath_hal_getctl(ah, chan);
+ powerLimit = chan->ic_maxregpower * 2;
+ twiceAntennaReduction = chan->ic_maxantgain;
+ twiceMaxRegulatoryPower = AH_MIN(MAX_RATE_POWER, AH_PRIVATE(ah)->ah_powerLimit);
+ pModal = &pEepData->modalHeader;
+ HALDEBUG(ah, HAL_DEBUG_RESET, "%s Channel=%u CfgCtl=%u\n",
+ __func__,chan->ic_freq, cfgCtl );
+
+ /* XXX Assume Minor is v2 or later */
+ ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc;
+
+ /* Fetch per-rate power table for the given channel */
+ if (! ar9287SetPowerPerRateTable(ah, pEepData, chan,
+ &ratesArray[0],cfgCtl,
+ twiceAntennaReduction,
+ twiceMaxRegulatoryPower, powerLimit)) {
+ HALDEBUG(ah, HAL_DEBUG_ANY,
+ "%s: unable to set tx power per rate table\n", __func__);
+ return AH_FALSE;
+ }
+
+ /* Set TX power control calibration curves for each TX chain */
+ ar9287SetPowerCalTable(ah, chan, &txPowerIndexOffset);
+
+ /* Calculate maximum power level */
+ maxPower = AH_MAX(ratesArray[rate6mb], ratesArray[rateHt20_0]);
+ maxPower = AH_MAX(maxPower, ratesArray[rate1l]);
+
+ if (IEEE80211_IS_CHAN_HT40(chan))
+ maxPower = AH_MAX(maxPower, ratesArray[rateHt40_0]);
+
+ ahp->ah_tx6PowerInHalfDbm = maxPower;
+ AH_PRIVATE(ah)->ah_maxPowerLevel = maxPower;
+ ahp->ah_txPowerIndexOffset = txPowerIndexOffset;
+
+ /*
+ * txPowerIndexOffset is set by the SetPowerTable() call -
+ * adjust the rate table (0 offset if rates EEPROM not loaded)
+ */
+ /* XXX what about the pwrTableOffset? */
+ for (i = 0; i < N(ratesArray); i++) {
+ ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]);
+ /* -5 dBm offset for Merlin and later; this includes Kiwi */
+ ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2;
+ if (ratesArray[i] > AR5416_MAX_RATE_POWER)
+ ratesArray[i] = AR5416_MAX_RATE_POWER;
+ if (ratesArray[i] < 0)
+ ratesArray[i] = 0;
+ }
+
+#ifdef AH_EEPROM_DUMP
+ ar5416PrintPowerPerRate(ah, ratesArray);
+#endif
+
+ /*
+ * Adjust the HT40 power to meet the correct target TX power
+ * for 40MHz mode, based on TX power curves that are established
+ * for 20MHz mode.
+ *
+ * XXX handle overflow/too high power level?
+ */
+ if (IEEE80211_IS_CHAN_HT40(chan)) {
+ ratesArray[rateHt40_0] += ht40PowerIncForPdadc;
+ ratesArray[rateHt40_1] += ht40PowerIncForPdadc;
+ ratesArray[rateHt40_2] += ht40PowerIncForPdadc;
+ ratesArray[rateHt40_3] += ht40PowerIncForPdadc;
+ ratesArray[rateHt40_4] += ht40PowerIncForPdadc;
+ ratesArray[rateHt40_5] += ht40PowerIncForPdadc;
+ ratesArray[rateHt40_6] += ht40PowerIncForPdadc;
+ ratesArray[rateHt40_7] += ht40PowerIncForPdadc;
+ }
+
+ /* Write the TX power rate registers */
+ ar5416WriteTxPowerRateRegisters(ah, chan, ratesArray);
+
+ return AH_TRUE;
+#undef POW_SM
+#undef N
+}
+
+/*
+ * Read EEPROM header info and program the device for correct operation
+ * given the channel value.
+ */
+HAL_BOOL
+ar9287SetBoardValues(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+ const HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom;
+ const struct ar9287_eeprom *eep = &ee->ee_base;
+ const struct modal_eep_ar9287_header *pModal = &eep->modalHeader;
+ uint16_t antWrites[AR9287_ANT_16S];
+ uint32_t regChainOffset, regval;
+ uint8_t txRxAttenLocal;
+ int i, j, offset_num;
+
+ pModal = &eep->modalHeader;
+
+ antWrites[0] = (uint16_t)((pModal->antCtrlCommon >> 28) & 0xF);
+ antWrites[1] = (uint16_t)((pModal->antCtrlCommon >> 24) & 0xF);
+ antWrites[2] = (uint16_t)((pModal->antCtrlCommon >> 20) & 0xF);
+ antWrites[3] = (uint16_t)((pModal->antCtrlCommon >> 16) & 0xF);
+ antWrites[4] = (uint16_t)((pModal->antCtrlCommon >> 12) & 0xF);
+ antWrites[5] = (uint16_t)((pModal->antCtrlCommon >> 8) & 0xF);
+ antWrites[6] = (uint16_t)((pModal->antCtrlCommon >> 4) & 0xF);
+ antWrites[7] = (uint16_t)(pModal->antCtrlCommon & 0xF);
+
+ offset_num = 8;
+
+ for (i = 0, j = offset_num; i < AR9287_MAX_CHAINS; i++) {
+ antWrites[j++] = (uint16_t)((pModal->antCtrlChain[i] >> 28) & 0xf);
+ antWrites[j++] = (uint16_t)((pModal->antCtrlChain[i] >> 10) & 0x3);
+ antWrites[j++] = (uint16_t)((pModal->antCtrlChain[i] >> 8) & 0x3);
+ antWrites[j++] = 0;
+ antWrites[j++] = (uint16_t)((pModal->antCtrlChain[i] >> 6) & 0x3);
+ antWrites[j++] = (uint16_t)((pModal->antCtrlChain[i] >> 4) & 0x3);
+ antWrites[j++] = (uint16_t)((pModal->antCtrlChain[i] >> 2) & 0x3);
+ antWrites[j++] = (uint16_t)(pModal->antCtrlChain[i] & 0x3);
+ }
+
+ OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon);
+
+ for (i = 0; i < AR9287_MAX_CHAINS; i++) {
+ regChainOffset = i * 0x1000;
+
+ OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset,
+ pModal->antCtrlChain[i]);
+
+ OS_REG_WRITE(ah, AR_PHY_TIMING_CTRL4_CHAIN(0) + regChainOffset,
+ (OS_REG_READ(ah, AR_PHY_TIMING_CTRL4_CHAIN(0) + regChainOffset)
+ & ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF |
+ AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) |
+ SM(pModal->iqCalICh[i],
+ AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) |
+ SM(pModal->iqCalQCh[i],
+ AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF));
+
+ txRxAttenLocal = pModal->txRxAttenCh[i];
+
+ OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
+ AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN,
+ pModal->bswMargin[i]);
+ OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
+ AR_PHY_GAIN_2GHZ_XATTEN1_DB,
+ pModal->bswAtten[i]);
+ OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset,
+ AR9280_PHY_RXGAIN_TXRX_ATTEN,
+ txRxAttenLocal);
+ OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset,
+ AR9280_PHY_RXGAIN_TXRX_MARGIN,
+ pModal->rxTxMarginCh[i]);
+ }
+
+
+ if (IEEE80211_IS_CHAN_HT40(chan))
+ OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING,
+ AR_PHY_SETTLING_SWITCH, pModal->swSettleHt40);
+ else
+ OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING,
+ AR_PHY_SETTLING_SWITCH, pModal->switchSettling);
+
+ OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ,
+ AR_PHY_DESIRED_SZ_ADC, pModal->adcDesiredSize);
+
+ OS_REG_WRITE(ah, AR_PHY_RF_CTL4,
+ SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAA_OFF)
+ | SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAB_OFF)
+ | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAA_ON)
+ | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAB_ON));
+
+ OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL3,
+ AR_PHY_TX_END_TO_A2_RX_ON, pModal->txEndToRxOn);
+
+ OS_REG_RMW_FIELD(ah, AR_PHY_CCA,
+ AR9280_PHY_CCA_THRESH62, pModal->thresh62);
+ OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0,
+ AR_PHY_EXT_CCA0_THRESH62, pModal->thresh62);
+
+ regval = OS_REG_READ(ah, AR9287_AN_RF2G3_CH0);
+ regval &= ~(AR9287_AN_RF2G3_DB1 |
+ AR9287_AN_RF2G3_DB2 |
+ AR9287_AN_RF2G3_OB_CCK |
+ AR9287_AN_RF2G3_OB_PSK |
+ AR9287_AN_RF2G3_OB_QAM |
+ AR9287_AN_RF2G3_OB_PAL_OFF);
+ regval |= (SM(pModal->db1, AR9287_AN_RF2G3_DB1) |
+ SM(pModal->db2, AR9287_AN_RF2G3_DB2) |
+ SM(pModal->ob_cck, AR9287_AN_RF2G3_OB_CCK) |
+ SM(pModal->ob_psk, AR9287_AN_RF2G3_OB_PSK) |
+ SM(pModal->ob_qam, AR9287_AN_RF2G3_OB_QAM) |
+ SM(pModal->ob_pal_off, AR9287_AN_RF2G3_OB_PAL_OFF));
+
+ OS_REG_WRITE(ah, AR9287_AN_RF2G3_CH0, regval);
+ OS_DELAY(100); /* analog write */
+
+ regval = OS_REG_READ(ah, AR9287_AN_RF2G3_CH1);
+ regval &= ~(AR9287_AN_RF2G3_DB1 |
+ AR9287_AN_RF2G3_DB2 |
+ AR9287_AN_RF2G3_OB_CCK |
+ AR9287_AN_RF2G3_OB_PSK |
+ AR9287_AN_RF2G3_OB_QAM |
+ AR9287_AN_RF2G3_OB_PAL_OFF);
+ regval |= (SM(pModal->db1, AR9287_AN_RF2G3_DB1) |
+ SM(pModal->db2, AR9287_AN_RF2G3_DB2) |
+ SM(pModal->ob_cck, AR9287_AN_RF2G3_OB_CCK) |
+ SM(pModal->ob_psk, AR9287_AN_RF2G3_OB_PSK) |
+ SM(pModal->ob_qam, AR9287_AN_RF2G3_OB_QAM) |
+ SM(pModal->ob_pal_off, AR9287_AN_RF2G3_OB_PAL_OFF));
+
+ OS_REG_WRITE(ah, AR9287_AN_RF2G3_CH1, regval);
+ OS_DELAY(100); /* analog write */
+
+ OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2,
+ AR_PHY_TX_FRAME_TO_DATA_START, pModal->txFrameToDataStart);
+ OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2,
+ AR_PHY_TX_FRAME_TO_PA_ON, pModal->txFrameToPaOn);
+
+ OS_A_REG_RMW_FIELD(ah, AR9287_AN_TOP2,
+ AR9287_AN_TOP2_XPABIAS_LVL, pModal->xpaBiasLvl);
+
+ return AH_TRUE;
+}
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h b/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h
new file mode 100644
index 0000000..679fb8c
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2010 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __AR9287_RESET_H__
+#define __AR9287_RESET_H__
+
+extern HAL_BOOL ar9287SetTransmitPower(struct ath_hal *ah,
+ const struct ieee80211_channel *chan, uint16_t *rfXpdGain);
+extern HAL_BOOL ar9287SetBoardValues(struct ath_hal *ah,
+ const struct ieee80211_channel *chan);
+
+#endif /* __AR9287_RESET_H__ */
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287an.h b/sys/dev/ath/ath_hal/ar9002/ar9287an.h
new file mode 100644
index 0000000..ba7a92c
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287an.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __AR9287AN_H__
+#define __AR9287AN_H__
+
+#define AR9287_AN_RF2G3_CH0 0x7808
+#define AR9287_AN_RF2G3_CH1 0x785c
+#define AR9287_AN_RF2G3_DB1 0xE0000000
+#define AR9287_AN_RF2G3_DB1_S 29
+#define AR9287_AN_RF2G3_DB2 0x1C000000
+#define AR9287_AN_RF2G3_DB2_S 26
+#define AR9287_AN_RF2G3_OB_CCK 0x03800000
+#define AR9287_AN_RF2G3_OB_CCK_S 23
+#define AR9287_AN_RF2G3_OB_PSK 0x00700000
+#define AR9287_AN_RF2G3_OB_PSK_S 20
+#define AR9287_AN_RF2G3_OB_QAM 0x000E0000
+#define AR9287_AN_RF2G3_OB_QAM_S 17
+#define AR9287_AN_RF2G3_OB_PAL_OFF 0x0001C000
+#define AR9287_AN_RF2G3_OB_PAL_OFF_S 14
+
+#define AR9287_AN_TXPC0 0x7898
+#define AR9287_AN_TXPC0_TXPCMODE 0x0000C000
+#define AR9287_AN_TXPC0_TXPCMODE_S 14
+#define AR9287_AN_TXPC0_TXPCMODE_NORMAL 0
+#define AR9287_AN_TXPC0_TXPCMODE_TEST 1
+#define AR9287_AN_TXPC0_TXPCMODE_TEMPSENSE 2
+#define AR9287_AN_TXPC0_TXPCMODE_ATBTEST 3
+
+#define AR9287_AN_TOP2 0x78b4
+#define AR9287_AN_TOP2_XPABIAS_LVL 0xC0000000
+#define AR9287_AN_TOP2_XPABIAS_LVL_S 30
+
+#endif
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287phy.h b/sys/dev/ath/ath_hal/ar9002/ar9287phy.h
new file mode 100644
index 0000000..8f28194
--- /dev/null
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287phy.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010 Atheros Communications, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __AR9287PHY_H__
+#define __AR9287PHY_H__
+
+/* AR_PHY_CH0_TX_PWRCTRL11, AR_PHY_CH1_TX_PWRCTRL11 */
+#define AR_PHY_TX_PWRCTRL_OLPC_TEMP_COMP 0x0000FC00
+#define AR_PHY_TX_PWRCTRL_OLPC_TEMP_COMP_S 10
+
+#endif
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 745a0d5..6c7b0e7 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -95,11 +95,13 @@ __FBSDID("$FreeBSD$");
#include <dev/ath/if_ath_tx.h>
#include <dev/ath/if_ath_sysctl.h>
#include <dev/ath/if_ath_keycache.h>
+#include <dev/ath/if_athdfs.h>
#ifdef ATH_TX99_DIAG
#include <dev/ath/ath_tx99/ath_tx99.h>
#endif
+
/*
* ATH_BCBUF determines the number of vap's that can transmit
* beacons and also (currently) the number of vap's that can
@@ -199,6 +201,8 @@ static void ath_setcurmode(struct ath_softc *, enum ieee80211_phymode);
static void ath_announce(struct ath_softc *);
+static void ath_dfs_tasklet(void *, int);
+
#ifdef IEEE80211_SUPPORT_TDMA
static void ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt,
u_int32_t bintval);
@@ -471,6 +475,16 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
goto bad2;
}
+ /* Attach DFS module */
+ if (! ath_dfs_attach(sc)) {
+ device_printf(sc->sc_dev, "%s: unable to attach DFS\n", __func__);
+ error = EIO;
+ goto bad2;
+ }
+
+ /* Start DFS processing tasklet */
+ TASK_INIT(&sc->sc_dfstask, 0, ath_dfs_tasklet, sc);
+
sc->sc_blinking = 0;
sc->sc_ledstate = 1;
sc->sc_ledon = 0; /* low true */
@@ -627,13 +641,22 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
| IEEE80211_HTC_AMPDU /* A-MPDU tx/rx */
| IEEE80211_HTC_AMSDU /* A-MSDU tx/rx */
| IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */
- /* At the present time, the hardware doesn't support short-GI in 20mhz mode */
-#if 0
- | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */
-#endif
| IEEE80211_HTCAP_SMPS_OFF; /* SM power save off */
;
+ /*
+ * Enable short-GI for HT20 only if the hardware
+ * advertises support.
+ * Notably, anything earlier than the AR9287 doesn't.
+ */
+ if ((ath_hal_getcapability(ah,
+ HAL_CAP_HT20_SGI, 0, NULL) == HAL_OK) &&
+ (wmodes & HAL_MODE_HT20)) {
+ device_printf(sc->sc_dev,
+ "[HT] enabling short-GI in 20MHz mode\n");
+ ic->ic_htcaps |= IEEE80211_HTCAP_SHORTGI20;
+ }
+
if (wmodes & HAL_MODE_HT40)
ic->ic_htcaps |= IEEE80211_HTCAP_CHWIDTH40
| IEEE80211_HTCAP_SHORTGI40;
@@ -762,6 +785,8 @@ ath_detach(struct ath_softc *sc)
sc->sc_tx99->detach(sc->sc_tx99);
#endif
ath_rate_detach(sc->sc_rc);
+
+ ath_dfs_detach(sc);
ath_desc_free(sc);
ath_tx_cleanup(sc);
ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */
@@ -975,6 +1000,21 @@ ath_vap_create(struct ieee80211com *ic,
avp->av_bmiss = vap->iv_bmiss;
vap->iv_bmiss = ath_bmiss_vap;
+ /* Set default parameters */
+
+ /*
+ * Anything earlier than some AR9300 series MACs don't
+ * support a smaller MPDU density.
+ */
+ vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_8;
+ /*
+ * All NICs can handle the maximum size, however
+ * AR5416 based MACs can only TX aggregates w/ RTS
+ * protection when the total aggregate size is <= 8k.
+ * However, for now that's enforced by the TX path.
+ */
+ vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K;
+
avp->av_bslot = -1;
if (needbeacon) {
/*
@@ -1221,6 +1261,10 @@ ath_resume(struct ath_softc *sc)
sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan,
AH_FALSE, &status);
ath_reset_keycache(sc);
+
+ /* Let DFS at it in case it's a DFS channel */
+ ath_dfs_radar_enable(sc, ic->ic_curchan);
+
if (sc->sc_resume_up) {
if (ic->ic_opmode == IEEE80211_M_STA) {
ath_init(sc);
@@ -1530,6 +1574,9 @@ ath_init(void *arg)
}
ath_chan_change(sc, ic->ic_curchan);
+ /* Let DFS at it in case it's a DFS channel */
+ ath_dfs_radar_enable(sc, ic->ic_curchan);
+
/*
* Likewise this is set during reset so update
* state cached in the driver.
@@ -1675,6 +1722,10 @@ ath_reset(struct ifnet *ifp)
if_printf(ifp, "%s: unable to reset hardware; hal status %u\n",
__func__, status);
sc->sc_diversity = ath_hal_getdiversity(ah);
+
+ /* Let DFS at it in case it's a DFS channel */
+ ath_dfs_radar_enable(sc, ic->ic_curchan);
+
if (ath_startrecv(sc) != 0) /* restart recv */
if_printf(ifp, "%s: unable to start recv logic\n", __func__);
/*
@@ -1966,6 +2017,10 @@ ath_calcrxfilter(struct ath_softc *sc)
if (ic->ic_opmode == IEEE80211_M_MONITOR)
rfilt |= HAL_RX_FILTER_CONTROL;
+ if (sc->sc_dodfs) {
+ rfilt |= HAL_RX_FILTER_PHYRADAR;
+ }
+
/*
* Enable RX of compressed BAR frames only when doing
* 802.11n. Required for A-MPDU.
@@ -3417,6 +3472,17 @@ ath_rx_proc(void *arg, int npending)
sc->sc_stats.ast_rx_fifoerr++;
if (rs->rs_status & HAL_RXERR_PHY) {
sc->sc_stats.ast_rx_phyerr++;
+ /* Process DFS radar events */
+ if ((rs->rs_phyerr == HAL_PHYERR_RADAR) ||
+ (rs->rs_phyerr == HAL_PHYERR_FALSE_RADAR_EXT)) {
+ /* Since we're touching the frame data, sync it */
+ bus_dmamap_sync(sc->sc_dmat,
+ bf->bf_dmamap,
+ BUS_DMASYNC_POSTREAD);
+ /* Now pass it to the radar processing code */
+ ath_dfs_process_phy_err(sc, mtod(m, char *), tsf, rs);
+ }
+
/* Be suitably paranoid about receiving phy errors out of the stats array bounds */
if (rs->rs_phyerr < 64)
sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++;
@@ -3658,6 +3724,10 @@ rx_next:
if (ngood)
sc->sc_lastrx = tsf;
+ /* Queue DFS tasklet if needed */
+ if (ath_dfs_tasklet_needed(sc, sc->sc_curchan))
+ taskqueue_enqueue(sc->sc_tq, &sc->sc_dfstask);
+
if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) {
#ifdef IEEE80211_SUPPORT_SUPERG
ieee80211_ff_age_all(ic, 100);
@@ -4375,6 +4445,9 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
}
sc->sc_diversity = ath_hal_getdiversity(ah);
+ /* Let DFS at it in case it's a DFS channel */
+ ath_dfs_radar_enable(sc, ic->ic_curchan);
+
/*
* Re-enable rx framework.
*/
@@ -5641,5 +5714,23 @@ ath_tdma_beacon_send(struct ath_softc *sc, struct ieee80211vap *vap)
}
#endif /* IEEE80211_SUPPORT_TDMA */
+static void
+ath_dfs_tasklet(void *p, int npending)
+{
+ struct ath_softc *sc = (struct ath_softc *) p;
+ struct ifnet *ifp = sc->sc_ifp;
+ struct ieee80211com *ic = ifp->if_l2com;
+
+ /*
+ * If previous processing has found a radar event,
+ * signal this to the net80211 layer to begin DFS
+ * processing.
+ */
+ if (ath_dfs_process_radar_event(sc, sc->sc_curchan)) {
+ /* DFS event found, initiate channel change */
+ ieee80211_dfs_notify_radar(ic, sc->sc_curchan);
+ }
+}
+
MODULE_VERSION(if_ath, 1);
MODULE_DEPEND(if_ath, wlan, 1, 1, 1); /* 802.11 media layer */
diff --git a/sys/dev/ath/if_ath_ahb.c b/sys/dev/ath/if_ath_ahb.c
index 33b8b92..a2bca05 100644
--- a/sys/dev/ath/if_ath_ahb.c
+++ b/sys/dev/ath/if_ath_ahb.c
@@ -123,7 +123,7 @@ ath_ahb_attach(device_t dev)
device_printf(sc->sc_dev, "eeprom @ %p\n", (void *) eepromaddr);
psc->sc_eeprom = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, (uintptr_t) eepromaddr,
(uintptr_t) eepromaddr + (uintptr_t) ((ATH_EEPROM_DATA_SIZE * 2) - 1), 0, RF_ACTIVE);
- if (psc->sc_sr == NULL) {
+ if (psc->sc_eeprom == NULL) {
device_printf(dev, "cannot map eeprom space\n");
goto bad0;
}
@@ -139,6 +139,10 @@ ath_ahb_attach(device_t dev)
/* Copy the EEPROM data out */
sc->sc_eepromdata = malloc(ATH_EEPROM_DATA_SIZE * 2, M_TEMP, M_NOWAIT | M_ZERO);
+ if (sc->sc_eepromdata == NULL) {
+ device_printf(dev, "cannot allocate memory for eeprom data\n");
+ goto bad1;
+ }
device_printf(sc->sc_dev, "eeprom data @ %p\n", (void *) rman_get_bushandle(psc->sc_eeprom));
/* XXX why doesn't this work? -adrian */
#if 0
diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c
index f4ade31..348a1499 100644
--- a/sys/dev/ath/if_ath_tx_ht.c
+++ b/sys/dev/ath/if_ath_tx_ht.c
@@ -136,15 +136,23 @@ ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni,
*/
if (ni->ni_chw == 40)
series[i].RateFlags |= HAL_RATESERIES_2040;
-#if 0
+
/*
- * The hardware only supports short-gi in 40mhz mode -
- * if later hardware supports it in 20mhz mode, be sure
- * to add the relevant check here.
+ * Set short-GI only if the node has advertised it
+ * the channel width is suitable, and we support it.
+ * We don't currently have a "negotiated" set of bits -
+ * ni_htcap is what the remote end sends, not what this
+ * node is capable of.
*/
- if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)
+ if (ni->ni_chw == 40 &&
+ ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40 &&
+ ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)
+ series[i].RateFlags |= HAL_RATESERIES_HALFGI;
+
+ if (ni->ni_chw == 20 &&
+ ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20 &&
+ ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20)
series[i].RateFlags |= HAL_RATESERIES_HALFGI;
-#endif
series[i].Rate = rt->info[rix[i]].rateCode;
diff --git a/sys/dev/ath/if_athdfs.h b/sys/dev/ath/if_athdfs.h
new file mode 100644
index 0000000..88ee7fc
--- /dev/null
+++ b/sys/dev/ath/if_athdfs.h
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd
+ * All rights reserved.
+ *
+ * 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,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ * redistribution must be conditioned upon including a substantially
+ * similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+ *
+ * $FreeBSD$
+ */
+#ifndef __IF_ATHDFS_H__
+#define __IF_ATHDFS_H__
+
+extern int ath_dfs_attach(struct ath_softc *sc);
+extern int ath_dfs_detach(struct ath_softc *sc);
+extern void ath_dfs_radar_enable(struct ath_softc *,
+ struct ieee80211_channel *chan);
+extern void ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf,
+ uint64_t tsf, struct ath_rx_status *rxstat);
+extern int ath_dfs_process_radar_event(struct ath_softc *sc,
+ struct ieee80211_channel *chan);
+extern int ath_dfs_tasklet_needed(struct ath_softc *sc,
+ struct ieee80211_channel *chan);
+extern int ath_ioctl_phyerr(struct ath_softc *sc, struct ath_diag *ad);
+extern int ath_dfs_get_thresholds(struct ath_softc *sc, HAL_PHYERR_PARAM *param);
+
+#endif /* __IF_ATHDFS_H__ */
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index 26a50bc..3bc8522 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -357,6 +357,11 @@ struct ath_softc {
uint16_t *sc_eepromdata; /* Local eeprom data, if AR9100 */
int sc_txchainmask; /* currently configured TX chainmask */
int sc_rxchainmask; /* currently configured RX chainmask */
+
+ /* DFS related state */
+ void *sc_dfs; /* Used by an optional DFS module */
+ int sc_dodfs; /* Whether to enable DFS rx filter bits */
+ struct task sc_dfstask; /* DFS processing task */
};
#define ATH_LOCK_INIT(_sc) \
@@ -634,11 +639,11 @@ void ath_intr(void *);
#define ath_hal_settpcts(_ah, _tpcts) \
ath_hal_setcapability(_ah, HAL_CAP_TPC_CTS, 0, _tpcts, NULL)
#define ath_hal_hasintmit(_ah) \
- (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, 0, NULL) == HAL_OK)
+ (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, HAL_CAP_INTMIT_PRESENT, NULL) == HAL_OK)
#define ath_hal_getintmit(_ah) \
- (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, 1, NULL) == HAL_OK)
+ (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, HAL_CAP_INTMIT_ENABLE, NULL) == HAL_OK)
#define ath_hal_setintmit(_ah, _v) \
- ath_hal_setcapability(_ah, HAL_CAP_INTMIT, 1, _v, NULL)
+ ath_hal_setcapability(_ah, HAL_CAP_INTMIT, HAL_CAP_INTMIT_ENABLE, _v, NULL)
#define ath_hal_getchannoise(_ah, _c) \
((*(_ah)->ah_getChanNoise)((_ah), (_c)))
#define ath_hal_getrxchainmask(_ah, _prxchainmask) \
@@ -694,6 +699,19 @@ void ath_intr(void *);
#define ath_hal_set11nburstduration(_ah, _ds, _dur) \
((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur)))
+/*
+ * This is badly-named; you need to set the correct parameters
+ * to begin to receive useful radar events; and even then
+ * it doesn't "enable" DFS. See the ath_dfs/null/ module for
+ * more information.
+ */
+#define ath_hal_enabledfs(_ah, _param) \
+ ((*(_ah)->ah_enableDfs)((_ah), (_param)))
+#define ath_hal_getdfsthresh(_ah, _param) \
+ ((*(_ah)->ah_getDfsThresh)((_ah), (_param)))
+#define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \
+ ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), (_buf), (_event)))
+
#define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \
((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type)))
#define ath_hal_gpioset(_ah, _gpio, _b) \
diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c
index 643554d..f2f5d74 100644
--- a/sys/dev/atkbdc/atkbd.c
+++ b/sys/dev/atkbdc/atkbd.c
@@ -1097,10 +1097,17 @@ get_typematic(keyboard_t *kbd)
x86regs_t regs;
uint8_t *p;
- if (!(kbd->kb_config & KB_CONF_PROBE_TYPEMATIC))
- return (ENODEV);
-
- if (x86bios_get_intr(0x15) == 0 || x86bios_get_intr(0x16) == 0)
+ /*
+ * Traditional entry points of int 0x15 and 0x16 are fixed
+ * and later BIOSes follow them. (U)EFI CSM specification
+ * also mandates these fixed entry points.
+ *
+ * Validate the entry points here before we proceed further.
+ * It's known that some recent laptops does not have the
+ * same entry point and hang on boot if we call it.
+ */
+ if (x86bios_get_intr(0x15) != 0xf000f859 ||
+ x86bios_get_intr(0x16) != 0xf000e82e)
return (ENODEV);
/* Is BIOS system configuration table supported? */
diff --git a/sys/dev/atkbdc/atkbdreg.h b/sys/dev/atkbdc/atkbdreg.h
index 3d54b4d..cf7ee6b 100644
--- a/sys/dev/atkbdc/atkbdreg.h
+++ b/sys/dev/atkbdc/atkbdreg.h
@@ -36,7 +36,6 @@
#define KB_CONF_NO_RESET (1 << 1) /* don't reset the keyboard */
#define KB_CONF_ALT_SCANCODESET (1 << 2) /* assume the XT type keyboard */
#define KB_CONF_NO_PROBE_TEST (1 << 3) /* don't test keyboard during probe */
-#define KB_CONF_PROBE_TYPEMATIC (1 << 4) /* probe keyboard typematic */
#ifdef _KERNEL
diff --git a/sys/dev/bxe/bxe_debug.h b/sys/dev/bxe/bxe_debug.h
index 99cbe5d..baf0e32 100644
--- a/sys/dev/bxe/bxe_debug.h
+++ b/sys/dev/bxe/bxe_debug.h
@@ -41,21 +41,22 @@ extern uint32_t bxe_debug;
* Debugging macros and definitions.
*/
-#define BXE_CP_LOAD 0x00000001
-#define BXE_CP_SEND 0x00000002
-#define BXE_CP_RECV 0x00000004
-#define BXE_CP_INTR 0x00000008
-#define BXE_CP_UNLOAD 0x00000010
-#define BXE_CP_RESET 0x00000020
-#define BXE_CP_IOCTL 0x00000040
-#define BXE_CP_STATS 0x00000080
-#define BXE_CP_MISC 0x00000100
-#define BXE_CP_PHY 0x00000200
-#define BXE_CP_RAMROD 0x00000400
-#define BXE_CP_NVRAM 0x00000800
-#define BXE_CP_REGS 0x00001000
-#define BXE_CP_ALL 0x00FFFFFF
-#define BXE_CP_MASK 0x00FFFFFF
+#define BXE_CP_LOAD 0x00000001
+#define BXE_CP_SEND 0x00000002
+#define BXE_CP_RECV 0x00000004
+#define BXE_CP_INTR 0x00000008
+#define BXE_CP_UNLOAD 0x00000010
+#define BXE_CP_RESET 0x00000020
+#define BXE_CP_IOCTL 0x00000040
+#define BXE_CP_STATS 0x00000080
+#define BXE_CP_MISC 0x00000100
+#define BXE_CP_PHY 0x00000200
+#define BXE_CP_RAMROD 0x00000400
+#define BXE_CP_NVRAM 0x00000800
+#define BXE_CP_REGS 0x00001000
+#define BXE_CP_TPA 0x00002000
+#define BXE_CP_ALL 0x00FFFFFF
+#define BXE_CP_MASK 0x00FFFFFF
#define BXE_LEVEL_FATAL 0x00000000
#define BXE_LEVEL_WARN 0x01000000
@@ -144,12 +145,18 @@ extern uint32_t bxe_debug;
#define BXE_EXTREME_REGS (BXE_CP_REGS | BXE_LEVEL_EXTREME)
#define BXE_INSANE_REGS (BXE_CP_REGS | BXE_LEVEL_INSANE)
-#define BXE_FATAL (BXE_CP_ALL | BXE_LEVEL_FATAL)
-#define BXE_WARN (BXE_CP_ALL | BXE_LEVEL_WARN)
-#define BXE_INFO (BXE_CP_ALL | BXE_LEVEL_INFO)
-#define BXE_VERBOSE (BXE_CP_ALL | BXE_LEVEL_VERBOSE)
-#define BXE_EXTREME (BXE_CP_ALL | BXE_LEVEL_EXTREME)
-#define BXE_INSANE (BXE_CP_ALL | BXE_LEVEL_INSANE)
+#define BXE_WARN_TPA (BXE_CP_TPA | BXE_LEVEL_WARN)
+#define BXE_INFO_TPA (BXE_CP_TPA | BXE_LEVEL_INFO)
+#define BXE_VERBOSE_TPA (BXE_CP_TPA | BXE_LEVEL_VERBOSE)
+#define BXE_EXTREME_TPA (BXE_CP_TPA | BXE_LEVEL_EXTREME)
+#define BXE_INSANE_TPA (BXE_CP_TPA | BXE_LEVEL_INSANE)
+
+#define BXE_FATAL (BXE_CP_ALL | BXE_LEVEL_FATAL)
+#define BXE_WARN (BXE_CP_ALL | BXE_LEVEL_WARN)
+#define BXE_INFO (BXE_CP_ALL | BXE_LEVEL_INFO)
+#define BXE_VERBOSE (BXE_CP_ALL | BXE_LEVEL_VERBOSE)
+#define BXE_EXTREME (BXE_CP_ALL | BXE_LEVEL_EXTREME)
+#define BXE_INSANE (BXE_CP_ALL | BXE_LEVEL_INSANE)
#define BXE_CODE_PATH(cp) ((cp & BXE_CP_MASK) & bxe_debug)
#define BXE_MSG_LEVEL(lv) ((lv & BXE_LEVEL_MASK) <= (bxe_debug & BXE_LEVEL_MASK))
diff --git a/sys/dev/bxe/bxe_link.c b/sys/dev/bxe/bxe_link.c
index 6ee29a8..8adc87e 100644
--- a/sys/dev/bxe/bxe_link.c
+++ b/sys/dev/bxe/bxe_link.c
@@ -1168,15 +1168,17 @@ bxe_set_parallel_detection(struct link_params *params, uint8_t phy_flags)
control2 |= MDIO_SERDES_DIGITAL_A_1000X_CONTROL2_PRL_DT_EN;
else
control2 &= ~MDIO_SERDES_DIGITAL_A_1000X_CONTROL2_PRL_DT_EN;
- DBPRINT(sc, 1, "params->speed_cap_mask = 0x%x, control2 = 0x%x\n",
- params->speed_cap_mask, control2);
+
+ DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): params->speed_cap_mask = 0x%x, "
+ "control2 = 0x%x\n", __FUNCTION__, params->speed_cap_mask, control2);
+
CL45_WR_OVER_CL22(sc, params->port, params->phy_addr,
MDIO_REG_BANK_SERDES_DIGITAL, MDIO_SERDES_DIGITAL_A_1000X_CONTROL2,
control2);
if ((phy_flags & PHY_XGXS_FLAG) && (params->speed_cap_mask &
PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)) {
- DBPRINT(sc, BXE_INFO, "XGXS\n");
+ DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): XGXS\n", __FUNCTION__);
CL45_WR_OVER_CL22(sc, params->port, params->phy_addr,
MDIO_REG_BANK_10G_PARALLEL_DETECT,
@@ -1688,7 +1690,9 @@ bxe_flow_ctrl_resolve(struct link_params *params, struct link_vars *vars,
}
bxe_pause_resolve(vars, pause_result);
}
- DBPRINT(sc, BXE_INFO, "flow_ctrl 0x%x\n", vars->flow_ctrl);
+
+ DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): flow_ctrl 0x%x\n",
+ __FUNCTION__, vars->flow_ctrl);
}
static void
@@ -1698,13 +1702,16 @@ bxe_check_fallback_to_cl37(struct link_params *params)
uint16_t rx_status, ustat_val, cl37_fsm_recieved;
sc = params->sc;
- DBPRINT(sc, BXE_INFO, "bxe_check_fallback_to_cl37\n");
+
+ DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): IEEE 802.3 Clause 37 Fallback\n",
+ __FUNCTION__);
+
CL45_RD_OVER_CL22(sc, params->port, params->phy_addr, MDIO_REG_BANK_RX0,
MDIO_RX0_RX_STATUS, &rx_status);
if ((rx_status & MDIO_RX0_RX_STATUS_SIGDET) !=
(MDIO_RX0_RX_STATUS_SIGDET)) {
DBPRINT(sc, BXE_VERBOSE_PHY,
- "Signal is not detected. Restoring CL73."
+ "No signal detected. Restoring CL73."
"rx_status(0x80b0) = 0x%x\n", rx_status);
CL45_WR_OVER_CL22(sc, params->port, params->phy_addr,
MDIO_REG_BANK_CL73_IEEEB0, MDIO_CL73_IEEEB0_CL73_AN_CONTROL,
@@ -1738,7 +1745,9 @@ bxe_check_fallback_to_cl37(struct link_params *params)
CL45_WR_OVER_CL22(sc, params->port, params->phy_addr,
MDIO_REG_BANK_CL73_IEEEB0, MDIO_CL73_IEEEB0_CL73_AN_CONTROL, 0);
bxe_restart_autoneg(params, 0);
- DBPRINT(sc, BXE_INFO, "Disabling CL73, and restarting CL37 autoneg\n");
+
+ DBPRINT(sc, BXE_INFO, "%s(): Disabling CL73 and restarting CL37 "
+ "autoneg\n", __FUNCTION__);
}
static void
@@ -3391,7 +3400,8 @@ bxe_init_internal_phy(struct link_params *params, struct link_vars *vars,
((XGXS_EXT_PHY_TYPE(params->ext_phy_config) ==
PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT) &&
params->loopback_mode == LOOPBACK_EXT)) {
- DBPRINT(sc, BXE_INFO, "not SGMII, no AN\n");
+ DBPRINT(sc, BXE_VERBOSE_PHY, "%s(): Not SGMII, no AN\n",
+ __FUNCTION__);
/* Disable autoneg. */
bxe_set_autoneg(params, vars, 0);
@@ -5338,9 +5348,6 @@ bxe_set_led(struct link_params *params, uint8_t mode, uint32_t speed)
emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0;
ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config);
- DBPRINT(sc, BXE_INFO, "bxe_set_led: port %x, mode %d\n", port, mode);
- DBPRINT(sc, BXE_VERBOSE_PHY, "speed 0x%x, hw_led_mode 0x%x\n", speed,
- hw_led_mode);
switch (mode) {
case LED_MODE_OFF:
REG_WR(sc, NIG_REG_LED_10G_P0 + port * 4, 0);
@@ -5382,7 +5389,7 @@ bxe_set_led(struct link_params *params, uint8_t mode, uint32_t speed)
default:
rc = -EINVAL;
DBPRINT(sc, BXE_VERBOSE_PHY,
- "bxe_set_led: Invalid led mode %d\n", mode);
+ "%s(): Invalid led mode (%d)!\n", __FUNCTION__, mode);
break;
}
return (rc);
@@ -5635,7 +5642,10 @@ bxe_link_reset(struct link_params *params, struct link_vars *vars,
ext_phy_type = XGXS_EXT_PHY_TYPE(ext_phy_config);
val = REG_RD(sc, params->shmem_base + offsetof(struct shmem_region,
dev_info.port_feature_config[params->port].config));
- DBPRINT(sc, BXE_INFO, "Resetting the link of port %d\n", port);
+
+ DBPRINT(sc, BXE_INFO, "%s(): Resetting port %d link.\n",
+ __FUNCTION__, port);
+
/* Disable attentions. */
vars->link_status = 0;
bxe_update_mng(params, vars->link_status);
diff --git a/sys/dev/bxe/if_bxe.c b/sys/dev/bxe/if_bxe.c
index cf0a40e..e7534f4 100644
--- a/sys/dev/bxe/if_bxe.c
+++ b/sys/dev/bxe/if_bxe.c
@@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$");
#ifdef BXE_DEBUG
uint32_t bxe_debug = BXE_WARN;
-
/* 0 = Never */
/* 1 = 1 in 2,147,483,648 */
/* 256 = 1 in 8,388,608 */
@@ -84,12 +83,9 @@ uint32_t bxe_debug = BXE_WARN;
/* Controls how often to simulate an mbuf allocation failure. */
int bxe_debug_mbuf_allocation_failure = 0;
-/* Controls how often to simulate a DMA mapping failure. */
+/* Controls how often to simulate a DMA mapping failure. */
int bxe_debug_dma_map_addr_failure = 0;
-/* Controls how often to received frame error. */
-int bxe_debug_received_frame_error = 0;
-
/* Controls how often to simulate a bootcode failure. */
int bxe_debug_bootcode_running_failure = 0;
#endif
@@ -103,7 +99,7 @@ int bxe_debug_bootcode_running_failure = 0;
/* BXE Build Time Options */
/* #define BXE_NVRAM_WRITE 1 */
-#define USE_DMAE 1
+#define BXE_USE_DMAE 1
/*
* PCI Device ID Table
@@ -132,14 +128,17 @@ static int bxe_attach(device_t);
static int bxe_detach(device_t);
static int bxe_shutdown(device_t);
-static void bxe_set_tunables(struct bxe_softc *);
+/*
+ * Driver local functions.
+ */
+static void bxe_tunables_set(struct bxe_softc *);
static void bxe_print_adapter_info(struct bxe_softc *);
static void bxe_probe_pci_caps(struct bxe_softc *);
static void bxe_link_settings_supported(struct bxe_softc *, uint32_t);
static void bxe_link_settings_requested(struct bxe_softc *);
-static int bxe_get_function_hwinfo(struct bxe_softc *);
-static void bxe_get_port_hwinfo(struct bxe_softc *);
-static void bxe_get_common_hwinfo(struct bxe_softc *);
+static int bxe_hwinfo_function_get(struct bxe_softc *);
+static int bxe_hwinfo_port_get(struct bxe_softc *);
+static int bxe_hwinfo_common_get(struct bxe_softc *);
static void bxe_undi_unload(struct bxe_softc *);
static int bxe_setup_leading(struct bxe_softc *);
static int bxe_stop_leading(struct bxe_softc *);
@@ -241,8 +240,8 @@ static int bxe_tx_encap(struct bxe_fastpath *, struct mbuf **);
static void bxe_tx_start(struct ifnet *);
static void bxe_tx_start_locked(struct ifnet *, struct bxe_fastpath *);
static int bxe_tx_mq_start(struct ifnet *, struct mbuf *);
-static int bxe_tx_mq_start_locked(struct ifnet *, struct bxe_fastpath *,
- struct mbuf *);
+static int bxe_tx_mq_start_locked(struct ifnet *,
+ struct bxe_fastpath *, struct mbuf *);
static void bxe_mq_flush(struct ifnet *ifp);
static int bxe_ioctl(struct ifnet *, u_long, caddr_t);
static __inline int bxe_has_rx_work(struct bxe_fastpath *);
@@ -254,33 +253,34 @@ static void bxe_intr_sp(void *);
static void bxe_task_fp(void *, int);
static void bxe_intr_fp(void *);
static void bxe_zero_sb(struct bxe_softc *, int);
-static void bxe_init_sb(struct bxe_softc *, struct host_status_block *,
- bus_addr_t, int);
+static void bxe_init_sb(struct bxe_softc *,
+ struct host_status_block *, bus_addr_t, int);
static void bxe_zero_def_sb(struct bxe_softc *);
-static void bxe_init_def_sb(struct bxe_softc *, struct host_def_status_block *,
- bus_addr_t, int);
+static void bxe_init_def_sb(struct bxe_softc *,
+ struct host_def_status_block *, bus_addr_t, int);
static void bxe_update_coalesce(struct bxe_softc *);
static __inline void bxe_update_rx_prod(struct bxe_softc *,
- struct bxe_fastpath *, uint16_t, uint16_t, uint16_t);
+ struct bxe_fastpath *, uint16_t, uint16_t, uint16_t);
static void bxe_clear_sge_mask_next_elems(struct bxe_fastpath *);
static __inline void bxe_init_sge_ring_bit_mask(struct bxe_fastpath *);
-static __inline void bxe_free_tpa_pool(struct bxe_fastpath *, int);
-static __inline void bxe_free_rx_sge(struct bxe_softc *, struct bxe_fastpath *,
- uint16_t);
-static __inline void bxe_free_rx_sge_range(struct bxe_softc *,
- struct bxe_fastpath *, int);
-static struct mbuf *bxe_alloc_mbuf(struct bxe_fastpath *, int);
-static int bxe_map_mbuf(struct bxe_fastpath *, struct mbuf *, bus_dma_tag_t,
- bus_dmamap_t, bus_dma_segment_t *);
-static struct mbuf *bxe_alloc_tpa_mbuf(struct bxe_fastpath *, int, int);
-static void bxe_alloc_mutexes(struct bxe_softc *);
-static void bxe_free_mutexes(struct bxe_softc *);
-static int bxe_alloc_rx_sge(struct bxe_softc *, struct bxe_fastpath *,
- uint16_t);
-static void bxe_init_rx_chains(struct bxe_softc *);
+static int bxe_alloc_tpa_mbuf(struct bxe_fastpath *, int);
+static int bxe_fill_tpa_pool(struct bxe_fastpath *);
+static void bxe_free_tpa_pool(struct bxe_fastpath *);
+
+static int bxe_alloc_rx_sge_mbuf(struct bxe_fastpath *, uint16_t);
+static int bxe_fill_sg_chain(struct bxe_fastpath *);
+static void bxe_free_sg_chain(struct bxe_fastpath *);
+
+static int bxe_alloc_rx_bd_mbuf(struct bxe_fastpath *, uint16_t);
+static int bxe_fill_rx_bd_chain(struct bxe_fastpath *);
+static void bxe_free_rx_bd_chain(struct bxe_fastpath *);
+
+static void bxe_mutexes_alloc(struct bxe_softc *);
+static void bxe_mutexes_free(struct bxe_softc *);
+static void bxe_clear_rx_chains(struct bxe_softc *);
+static int bxe_init_rx_chains(struct bxe_softc *);
+static void bxe_clear_tx_chains(struct bxe_softc *);
static void bxe_init_tx_chains(struct bxe_softc *);
-static void bxe_free_rx_chains(struct bxe_softc *);
-static void bxe_free_tx_chains(struct bxe_softc *);
static void bxe_init_sp_ring(struct bxe_softc *);
static void bxe_init_context(struct bxe_softc *);
static void bxe_init_ind_table(struct bxe_softc *);
@@ -291,8 +291,7 @@ static void bxe_init_internal_port(struct bxe_softc *);
static void bxe_init_internal_func(struct bxe_softc *);
static void bxe_init_internal(struct bxe_softc *, uint32_t);
-static void bxe_init_nic(struct bxe_softc *, uint32_t);
-static int bxe_gunzip_init(struct bxe_softc *);
+static int bxe_init_nic(struct bxe_softc *, uint32_t);
static void bxe_lb_pckt(struct bxe_softc *);
static int bxe_int_mem_test(struct bxe_softc *);
static void bxe_enable_blocks_attention (struct bxe_softc *);
@@ -304,13 +303,9 @@ static void bxe_ilt_wr(struct bxe_softc *, uint32_t, bus_addr_t);
static int bxe_init_func(struct bxe_softc *);
static int bxe_init_hw(struct bxe_softc *, uint32_t);
static int bxe_fw_command(struct bxe_softc *, uint32_t);
-static void bxe_dma_free(struct bxe_softc *);
-static void bxe_dmamem_free(struct bxe_softc *, bus_dma_tag_t, caddr_t,
- bus_dmamap_t);
+static void bxe_host_structures_free(struct bxe_softc *);
static void bxe_dma_map_addr(void *, bus_dma_segment_t *, int, int);
-static int bxe_dma_alloc(device_t);
-static int bxe_dmamem_alloc(struct bxe_softc *, bus_dma_tag_t, bus_dmamap_t,
- void *, uint32_t, bus_addr_t *);
+static int bxe_host_structures_alloc(device_t);
static void bxe_set_mac_addr_e1(struct bxe_softc *, int);
static void bxe_set_mac_addr_e1h(struct bxe_softc *, int);
static void bxe_set_rx_mode(struct bxe_softc *);
@@ -330,15 +325,12 @@ static void bxe_tpa_stop(struct bxe_softc *, struct bxe_fastpath *, uint16_t,
int, int, union eth_rx_cqe *, uint16_t);
static void bxe_rxeof(struct bxe_fastpath *);
static void bxe_txeof(struct bxe_fastpath *);
-static int bxe_get_buf(struct bxe_fastpath *, struct mbuf *, uint16_t);
static int bxe_watchdog(struct bxe_fastpath *fp);
-static int bxe_change_mtu(struct bxe_softc *, int);
static void bxe_tick(void *);
static void bxe_add_sysctls(struct bxe_softc *);
-static void bxe_gunzip_end(struct bxe_softc *);
-static void bxe_write_dmae_phys_len(struct bxe_softc *, bus_addr_t, uint32_t,
- uint32_t);
+static void bxe_write_dmae_phys_len(struct bxe_softc *,
+ bus_addr_t, uint32_t, uint32_t);
void bxe_write_dmae(struct bxe_softc *, bus_addr_t, uint32_t, uint32_t);
void bxe_read_dmae(struct bxe_softc *, uint32_t, uint32_t);
@@ -360,32 +352,33 @@ static int bxe_sysctl_dump_rx_bd_chain(SYSCTL_HANDLER_ARGS);
static int bxe_sysctl_dump_tx_chain(SYSCTL_HANDLER_ARGS);
static int bxe_sysctl_reg_read(SYSCTL_HANDLER_ARGS);
static int bxe_sysctl_breakpoint(SYSCTL_HANDLER_ARGS);
-static void bxe_validate_rx_packet(struct bxe_fastpath *, uint16_t,
- union eth_rx_cqe *, struct mbuf *);
+static __noinline void bxe_validate_rx_packet(struct bxe_fastpath *,
+ uint16_t, union eth_rx_cqe *, struct mbuf *);
static void bxe_grcdump(struct bxe_softc *, int);
-static void bxe_dump_enet(struct bxe_softc *,struct mbuf *);
-static void bxe_dump_mbuf (struct bxe_softc *, struct mbuf *);
-static void bxe_dump_tx_mbuf_chain(struct bxe_softc *, int, int);
-static void bxe_dump_rx_mbuf_chain(struct bxe_softc *, int, int);
-static void bxe_dump_tx_parsing_bd(struct bxe_fastpath *,int,
- struct eth_tx_parse_bd *);
-static void bxe_dump_txbd(struct bxe_fastpath *, int,
- union eth_tx_bd_types *);
-static void bxe_dump_rxbd(struct bxe_fastpath *, int,
- struct eth_rx_bd *);
-static void bxe_dump_cqe(struct bxe_fastpath *, int, union eth_rx_cqe *);
-static void bxe_dump_tx_chain(struct bxe_fastpath *, int, int);
-static void bxe_dump_rx_cq_chain(struct bxe_fastpath *, int, int);
-static void bxe_dump_rx_bd_chain(struct bxe_fastpath *, int, int);
-static void bxe_dump_status_block(struct bxe_softc *);
-static void bxe_dump_stats_block(struct bxe_softc *);
-static void bxe_dump_fp_state(struct bxe_fastpath *);
-static void bxe_dump_port_state_locked(struct bxe_softc *);
-static void bxe_dump_link_vars_state_locked(struct bxe_softc *);
-static void bxe_dump_link_params_state_locked(struct bxe_softc *);
-static void bxe_dump_driver_state(struct bxe_softc *);
-static void bxe_dump_hw_state(struct bxe_softc *);
-static void bxe_dump_fw(struct bxe_softc *);
+static __noinline void bxe_dump_enet(struct bxe_softc *,struct mbuf *);
+static __noinline void bxe_dump_mbuf (struct bxe_softc *, struct mbuf *);
+static __noinline void bxe_dump_tx_mbuf_chain(struct bxe_softc *, int, int);
+static __noinline void bxe_dump_rx_mbuf_chain(struct bxe_softc *, int, int);
+static __noinline void bxe_dump_tx_parsing_bd(struct bxe_fastpath *,int,
+ struct eth_tx_parse_bd *);
+static __noinline void bxe_dump_txbd(struct bxe_fastpath *, int,
+ union eth_tx_bd_types *);
+static __noinline void bxe_dump_rxbd(struct bxe_fastpath *, int,
+ struct eth_rx_bd *);
+static __noinline void bxe_dump_cqe(struct bxe_fastpath *,
+ int, union eth_rx_cqe *);
+static __noinline void bxe_dump_tx_chain(struct bxe_fastpath *, int, int);
+static __noinline void bxe_dump_rx_cq_chain(struct bxe_fastpath *, int, int);
+static __noinline void bxe_dump_rx_bd_chain(struct bxe_fastpath *, int, int);
+static __noinline void bxe_dump_status_block(struct bxe_softc *);
+static __noinline void bxe_dump_stats_block(struct bxe_softc *);
+static __noinline void bxe_dump_fp_state(struct bxe_fastpath *);
+static __noinline void bxe_dump_port_state_locked(struct bxe_softc *);
+static __noinline void bxe_dump_link_vars_state_locked(struct bxe_softc *);
+static __noinline void bxe_dump_link_params_state_locked(struct bxe_softc *);
+static __noinline void bxe_dump_driver_state(struct bxe_softc *);
+static __noinline void bxe_dump_hw_state(struct bxe_softc *);
+static __noinline void bxe_dump_fw(struct bxe_softc *);
static void bxe_decode_mb_msgs(struct bxe_softc *, uint32_t, uint32_t);
static void bxe_decode_ramrod_cmd(struct bxe_softc *, int);
static void bxe_breakpoint(struct bxe_softc *);
@@ -433,11 +426,6 @@ DRIVER_MODULE(bxe, pci, bxe_driver, bxe_devclass, 0, 0);
SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters");
/* Allowable values are TRUE (1) or FALSE (0). */
-static int bxe_stats_enable = FALSE;
-TUNABLE_INT("hw.bxe.stats_enable", &bxe_stats_enable);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, stats_enable, CTLFLAG_RDTUN, &bxe_stats_enable,
- 0, "stats Enable/Disable");
-
static int bxe_dcc_enable = FALSE;
TUNABLE_INT("hw.bxe.dcc_enable", &bxe_dcc_enable);
SYSCTL_UINT(_hw_bxe, OID_AUTO, dcc_enable, CTLFLAG_RDTUN, &bxe_dcc_enable,
@@ -456,18 +444,6 @@ SYSCTL_UINT(_hw_bxe, OID_AUTO, int_mode, CTLFLAG_RDTUN, &bxe_int_mode,
0, "Interrupt (MSI-X|MSI|INTx) mode");
/*
- * Specifies whether the driver should disable Transparent Packet
- * Aggregation (TPA, also known as LRO). By default TPA is enabled.
- *
- * Allowable values are TRUE (1) or FALSE (0).
- */
-static int bxe_tpa_enable = FALSE;
-TUNABLE_INT("hw.bxe.tpa_enable", &bxe_tpa_enable);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, tpa_enable, CTLFLAG_RDTUN, &bxe_tpa_enable,
- 0, "TPA Enable/Disable");
-
-
-/*
* Specifies the number of queues that will be used when a multi-queue
* RSS mode is selected using bxe_multi_mode below.
*
@@ -480,8 +456,8 @@ SYSCTL_UINT(_hw_bxe, OID_AUTO, queue_count, CTLFLAG_RDTUN, &bxe_queue_count,
/*
* ETH_RSS_MODE_DISABLED (0)
- * Disables all multi-queue/packet sorting algorithms. Each
- * received frame is routed to the same receive queue.
+ * Disables all multi-queue/packet sorting algorithms. All
+ * received frames are routed to a single receive queue.
*
* ETH_RSS_MODE_REGULAR (1)
* The default mode which assigns incoming frames to receive
@@ -579,7 +555,7 @@ bxe_reg_write32(struct bxe_softc *sc, bus_size_t offset, uint32_t val)
(uintmax_t)offset);
}
- DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%08X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%08X\n",
__FUNCTION__, (uintmax_t)offset, val);
bus_space_write_4(sc->bxe_btag, sc->bxe_bhandle, offset, val);
@@ -602,7 +578,7 @@ bxe_reg_write16(struct bxe_softc *sc, bus_size_t offset, uint16_t val)
(uintmax_t)offset);
}
- DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%04X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%04X\n",
__FUNCTION__, (uintmax_t)offset, val);
bus_space_write_2(sc->bxe_btag, sc->bxe_bhandle, offset, val);
@@ -619,7 +595,7 @@ static void
bxe_reg_write8(struct bxe_softc *sc, bus_size_t offset, uint8_t val)
{
- DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%02X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%02X\n",
__FUNCTION__, (uintmax_t)offset, val);
bus_space_write_1(sc->bxe_btag, sc->bxe_bhandle, offset, val);
@@ -645,7 +621,7 @@ bxe_reg_read32(struct bxe_softc *sc, bus_size_t offset)
val = bus_space_read_4(sc->bxe_btag, sc->bxe_bhandle, offset);
- DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%08X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%08X\n",
__FUNCTION__, (uintmax_t)offset, val);
return (val);
@@ -671,7 +647,7 @@ bxe_reg_read16(struct bxe_softc *sc, bus_size_t offset)
val = bus_space_read_2(sc->bxe_btag, sc->bxe_bhandle, offset);
- DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%08X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%08X\n",
__FUNCTION__, (uintmax_t)offset, val);
return (val);
@@ -690,10 +666,10 @@ bxe_reg_read8(struct bxe_softc *sc, bus_size_t offset)
{
uint8_t val = bus_space_read_1(sc->bxe_btag, sc->bxe_bhandle, offset);
- DBPRINT(sc, BXE_INSANE, "%s(): offset = 0x%jX, val = 0x%02X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(): offset = 0x%jX, val = 0x%02X\n",
__FUNCTION__, (uintmax_t)offset, val);
- return(val);
+ return (val);
}
#endif
@@ -996,6 +972,7 @@ bxe_probe(device_t dev)
* Returns:
* None.
*/
+/* ToDo: Create a sysctl for this info. */
static void
bxe_print_adapter_info(struct bxe_softc *sc)
{
@@ -1025,19 +1002,14 @@ bxe_print_adapter_info(struct bxe_softc *sc)
printf("); Flags (");
/* Miscellaneous flags. */
- if (sc->bxe_flags & BXE_USING_MSI_FLAG)
+ if (sc->msi_count > 0)
printf("MSI");
- if (sc->bxe_flags & BXE_USING_MSIX_FLAG) {
+ if (sc->msix_count > 0) {
if (i > 0) printf("|");
printf("MSI-X"); i++;
}
- if (sc->bxe_flags & BXE_SAFC_TX_FLAG) {
- if (i > 0) printf("|");
- printf("SAFC"); i++;
- }
-
if (TPA_ENABLED(sc)) {
if (i > 0) printf("|");
printf("TPA"); i++;
@@ -1056,6 +1028,9 @@ bxe_print_adapter_info(struct bxe_softc *sc)
break;
}
+ printf("); BD's (RX:%d,TX:%d",
+ (int) USABLE_RX_BD, (int) USABLE_TX_BD);
+
/* Firmware versions and device features. */
printf("); Firmware (%d.%d.%d); Bootcode (%d.%d.%d)\n",
BCM_5710_FW_MAJOR_VERSION,
@@ -1069,6 +1044,64 @@ bxe_print_adapter_info(struct bxe_softc *sc)
}
/*
+ * Release any interrupts allocated by the driver.
+ *
+ * Returns:
+ * None
+ */
+static void
+bxe_interrupt_free(struct bxe_softc *sc)
+{
+ device_t dev;
+ int i;
+
+ DBENTER(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+
+ dev = sc->dev;
+
+ if (sc->msix_count > 0) {
+ /* Free MSI-X resources. */
+
+ for (i = 0; i < sc->msix_count; i++) {
+ DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+ BXE_VERBOSE_INTR), "%s(): Releasing MSI-X[%d] "
+ "vector.\n", __FUNCTION__, i);
+ if (sc->bxe_msix_res[i] && sc->bxe_msix_rid[i])
+ bus_release_resource(dev, SYS_RES_IRQ,
+ sc->bxe_msix_rid[i], sc->bxe_msix_res[i]);
+ }
+
+ pci_release_msi(dev);
+
+ } else if (sc->msi_count > 0) {
+ /* Free MSI resources. */
+
+ for (i = 0; i < sc->msi_count; i++) {
+ DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+ BXE_VERBOSE_INTR), "%s(): Releasing MSI[%d] "
+ "vector.\n", __FUNCTION__, i);
+ if (sc->bxe_msi_res[i] && sc->bxe_msi_rid[i])
+ bus_release_resource(dev, SYS_RES_IRQ,
+ sc->bxe_msi_rid[i], sc->bxe_msi_res[i]);
+ }
+
+ pci_release_msi(dev);
+
+ } else {
+ /* Free legacy interrupt resources. */
+
+ DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+ BXE_VERBOSE_INTR), "%s(): Releasing legacy interrupt.\n",
+ __FUNCTION__);
+ if (sc->bxe_irq_res != NULL)
+ bus_release_resource(dev, SYS_RES_IRQ,
+ sc->bxe_irq_rid, sc->bxe_irq_res);
+ }
+
+ DBEXIT(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+}
+
+/*
* This function determines and allocates the appropriate
* interrupt based on system capabilites and user request.
*
@@ -1086,30 +1119,19 @@ bxe_print_adapter_info(struct bxe_softc *sc)
* 0 = Success, !0 = Failure.
*/
static int
-bxe_interrupt_allocate(struct bxe_softc *sc)
+bxe_interrupt_alloc(struct bxe_softc *sc)
{
device_t dev;
- int i, rid, rc;
+ int error, i, rid, rc;
int msi_count, msi_required, msi_allocated;
int msix_count, msix_required, msix_allocated;
- rc = 0;
- dev = sc->dev;
- msi_count = 0;
- msi_required = 0;
- msi_allocated = 0;
- msix_count = 0;
- msix_required = 0;
- msix_allocated = 0;
-
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR);
- /* Assume SAFC not enabled for TX. */
- sc->bxe_flags &= ~BXE_SAFC_TX_FLAG;
-
- /* Clear any previous priority queue mappings. */
- for (i = 0; i < BXE_MAX_PRIORITY; i++)
- sc->pri_map[i] = 0;
+ rc = 0;
+ dev = sc->dev;
+ msi_count = msi_required = msi_allocated = 0;
+ msix_count = msix_required = msix_allocated = 0;
/* Get the number of available MSI/MSI-X interrupts from the OS. */
if (sc->int_mode > 0) {
@@ -1140,7 +1162,8 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
/* BSD resource identifier */
rid = 1;
- if (pci_alloc_msix(dev, &msix_allocated) == 0) {
+ error = pci_alloc_msix(dev, &msix_allocated);
+ if (error == 0) {
DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
"%s(): Required/Allocated (%d/%d) MSI-X vector(s).\n",
__FUNCTION__, msix_required, msix_allocated);
@@ -1148,7 +1171,6 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
/* Make sure we got all the interrupts we asked for. */
if (msix_allocated >= msix_required) {
sc->msix_count = msix_required;
- sc->bxe_flags |= BXE_USING_MSIX_FLAG;
msi_count = 0;
/* Allocate the MSI-X vectors. */
@@ -1165,7 +1187,7 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
"%s(%d): Failed to map MSI-X[%d] vector!\n",
__FILE__, __LINE__, (3));
rc = ENXIO;
- goto bxe_interrupt_allocate_exit;
+ goto bxe_interrupt_alloc_exit;
}
}
} else {
@@ -1176,7 +1198,6 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
/* Release any resources acquired. */
pci_release_msi(dev);
- sc->bxe_flags &= ~BXE_USING_MSIX_FLAG;
sc->msix_count = msix_count = 0;
/* We'll try MSI next. */
@@ -1200,7 +1221,8 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
msi_required);
rid = 1;
- if (pci_alloc_msi(dev, &msi_allocated) == 0) {
+ error = pci_alloc_msi(dev, &msi_allocated);
+ if (error == 0) {
DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
"%s(): Required/Allocated (%d/%d) MSI vector(s).\n",
__FUNCTION__, msi_required, msi_allocated);
@@ -1212,7 +1234,6 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
*/
if (msi_required >= msi_allocated) {
sc->msi_count = msi_required;
- sc->bxe_flags |= BXE_USING_MSI_FLAG;
/* Allocate the MSI vectors. */
for (i = 0; i < msi_required; i++) {
sc->bxe_msi_rid[i] = i + rid;
@@ -1226,7 +1247,7 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
"%s(%d): Failed to map MSI vector (%d)!\n",
__FILE__, __LINE__, (i));
rc = ENXIO;
- goto bxe_interrupt_allocate_exit;
+ goto bxe_interrupt_alloc_exit;
}
}
}
@@ -1237,7 +1258,6 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
/* Release any resources acquired. */
pci_release_msi(dev);
- sc->bxe_flags &= ~BXE_USING_MSI_FLAG;
sc->msi_count = msi_count = 0;
/* We'll try INTx next. */
@@ -1262,7 +1282,7 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
BXE_PRINTF("%s(%d): PCI map interrupt failed!\n",
__FILE__, __LINE__);
rc = ENXIO;
- goto bxe_interrupt_allocate_exit;
+ goto bxe_interrupt_alloc_exit;
}
sc->bxe_irq_rid = rid;
}
@@ -1271,27 +1291,55 @@ bxe_interrupt_allocate(struct bxe_softc *sc)
"%s(): Actual: int_mode = %d, multi_mode = %d, num_queues = %d\n",
__FUNCTION__, sc->int_mode, sc->multi_mode, sc->num_queues);
-bxe_interrupt_allocate_exit:
+bxe_interrupt_alloc_exit:
DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR);
return (rc);
}
+/*
+ * This function releases taskqueues.
+ *
+ * Returns:
+ * None
+ */
static void
bxe_interrupt_detach(struct bxe_softc *sc)
{
+#ifdef BXE_TASK
+ struct bxe_fastpath *fp;
+#endif
device_t dev;
int i;
+ DBENTER(BXE_VERBOSE_UNLOAD);
+
dev = sc->dev;
- DBENTER(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+
+#ifdef BXE_TASK
+ /* Free the OS taskqueue resources. */
+ for (i = 0; i < sc->num_queues; i++) {
+ fp = &sc->fp[i];
+
+ if (fp->tq != NULL) {
+ taskqueue_drain(fp->tq, &fp->task);
+ taskqueue_free(fp->tq);
+ }
+ }
+
+ if (sc->tq != NULL) {
+ taskqueue_drain(sc->tq, &sc->task);
+ taskqueue_free(sc->tq);
+ }
+#endif
+
/* Release interrupt resources. */
- if ((sc->bxe_flags & BXE_USING_MSIX_FLAG) && sc->msix_count) {
+ if (sc->msix_count > 0) {
for (i = 0; i < sc->msix_count; i++) {
if (sc->bxe_msix_tag[i] && sc->bxe_msix_res[i])
bus_teardown_intr(dev, sc->bxe_msix_res[i],
sc->bxe_msix_tag[i]);
}
- } else if ((sc->bxe_flags & BXE_USING_MSI_FLAG) && sc->msi_count) {
+ } else if (sc->msi_count > 0) {
for (i = 0; i < sc->msi_count; i++) {
if (sc->bxe_msi_tag[i] && sc->bxe_msi_res[i])
bus_teardown_intr(dev, sc->bxe_msi_res[i],
@@ -1302,6 +1350,8 @@ bxe_interrupt_detach(struct bxe_softc *sc)
bus_teardown_intr(dev, sc->bxe_irq_res,
sc->bxe_irq_tag);
}
+
+ DBEXIT(BXE_VERBOSE_UNLOAD);
}
/*
@@ -1336,7 +1386,7 @@ bxe_interrupt_attach(struct bxe_softc *sc)
#endif
/* Setup interrupt handlers. */
- if (sc->bxe_flags & BXE_USING_MSIX_FLAG) {
+ if (sc->msix_count > 0) {
DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
"%s(): Enabling slowpath MSI-X[0] vector.\n",__FUNCTION__);
/*
@@ -1344,13 +1394,9 @@ bxe_interrupt_attach(struct bxe_softc *sc)
* driver instance to the interrupt handler for the
* slowpath.
*/
- rc = bus_setup_intr(sc->dev,
- sc->bxe_msix_res[0],
- INTR_TYPE_NET | INTR_MPSAFE,
- NULL,
- bxe_intr_sp,
- sc,
- &sc->bxe_msix_tag[0]);
+ rc = bus_setup_intr(sc->dev, sc->bxe_msix_res[0],
+ INTR_TYPE_NET | INTR_MPSAFE, NULL, bxe_intr_sp,
+ sc, &sc->bxe_msix_tag[0]);
if (rc) {
BXE_PRINTF(
@@ -1360,10 +1406,8 @@ bxe_interrupt_attach(struct bxe_softc *sc)
}
#if __FreeBSD_version >= 800504
- bus_describe_intr(sc->dev,
- sc->bxe_msix_res[0],
- sc->bxe_msix_tag[0],
- "sp");
+ bus_describe_intr(sc->dev, sc->bxe_msix_res[0],
+ sc->bxe_msix_tag[0], "sp");
#endif
/* Now initialize the fastpath vectors. */
@@ -1377,13 +1421,9 @@ bxe_interrupt_attach(struct bxe_softc *sc)
* fastpath context to the interrupt handler in this
* case. Also the first msix_res was used by the sp.
*/
- rc = bus_setup_intr(sc->dev,
- sc->bxe_msix_res[i + 1],
- INTR_TYPE_NET | INTR_MPSAFE,
- NULL,
- bxe_intr_fp,
- fp,
- &sc->bxe_msix_tag[i + 1]);
+ rc = bus_setup_intr(sc->dev, sc->bxe_msix_res[i + 1],
+ INTR_TYPE_NET | INTR_MPSAFE, NULL, bxe_intr_fp,
+ fp, &sc->bxe_msix_tag[i + 1]);
if (rc) {
BXE_PRINTF(
@@ -1393,11 +1433,8 @@ bxe_interrupt_attach(struct bxe_softc *sc)
}
#if __FreeBSD_version >= 800504
- bus_describe_intr(sc->dev,
- sc->bxe_msix_res[i + 1],
- sc->bxe_msix_tag[i + 1],
- "fp[%02d]",
- i);
+ bus_describe_intr(sc->dev, sc->bxe_msix_res[i + 1],
+ sc->bxe_msix_tag[i + 1], "fp[%02d]", i);
#endif
/* Bind the fastpath instance to a CPU. */
@@ -1409,13 +1446,13 @@ bxe_interrupt_attach(struct bxe_softc *sc)
#ifdef BXE_TASK
TASK_INIT(&fp->task, 0, bxe_task_fp, fp);
fp->tq = taskqueue_create_fast("bxe_fpq", M_NOWAIT,
- taskqueue_thread_enqueue, &fp->tq);
+ taskqueue_thread_enqueue, &fp->tq);
taskqueue_start_threads(&fp->tq, 1, PI_NET, "%s fpq",
- device_get_nameunit(sc->dev));
+ device_get_nameunit(sc->dev));
#endif
fp->state = BXE_FP_STATE_IRQ;
}
- } else if (sc->bxe_flags & BXE_USING_MSI_FLAG) {
+ } else if (sc->msi_count > 0) {
DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
"%s(): Enabling slowpath MSI[0] vector.\n",
__FUNCTION__);
@@ -1424,12 +1461,8 @@ bxe_interrupt_attach(struct bxe_softc *sc)
* instance to the interrupt handler for the slowpath.
*/
rc = bus_setup_intr(sc->dev,sc->bxe_msi_res[0],
- INTR_TYPE_NET | INTR_MPSAFE,
- NULL,
- bxe_intr_sp,
- sc,
- &sc->bxe_msi_tag[0]
- );
+ INTR_TYPE_NET | INTR_MPSAFE, NULL, bxe_intr_sp,
+ sc, &sc->bxe_msi_tag[0]);
if (rc) {
BXE_PRINTF(
@@ -1439,10 +1472,8 @@ bxe_interrupt_attach(struct bxe_softc *sc)
}
#if __FreeBSD_version >= 800504
- bus_describe_intr(sc->dev,
- sc->bxe_msi_res[0],
- sc->bxe_msi_tag[0],
- "sp");
+ bus_describe_intr(sc->dev, sc->bxe_msi_res[0],
+ sc->bxe_msi_tag[0], "sp");
#endif
/* Now initialize the fastpath vectors. */
@@ -1457,14 +1488,9 @@ bxe_interrupt_attach(struct bxe_softc *sc)
* fastpath context to the interrupt handler in this
* case.
*/
- rc = bus_setup_intr(sc->dev,
- sc->bxe_msi_res[i + 1],
- INTR_TYPE_NET | INTR_MPSAFE,
- NULL,
- bxe_intr_fp,
- fp,
- &sc->bxe_msi_tag[i + 1]
- );
+ rc = bus_setup_intr(sc->dev, sc->bxe_msi_res[i + 1],
+ INTR_TYPE_NET | INTR_MPSAFE, NULL, bxe_intr_fp,
+ fp, &sc->bxe_msi_tag[i + 1]);
if (rc) {
BXE_PRINTF(
@@ -1474,19 +1500,16 @@ bxe_interrupt_attach(struct bxe_softc *sc)
}
#if __FreeBSD_version >= 800504
- bus_describe_intr(sc->dev,
- sc->bxe_msi_res[i + 1],
- sc->bxe_msi_tag[i + 1],
- "fp[%02d]",
- i);
+ bus_describe_intr(sc->dev, sc->bxe_msi_res[i + 1],
+ sc->bxe_msi_tag[i + 1], "fp[%02d]", i);
#endif
#ifdef BXE_TASK
TASK_INIT(&fp->task, 0, bxe_task_fp, fp);
fp->tq = taskqueue_create_fast("bxe_fpq", M_NOWAIT,
- taskqueue_thread_enqueue, &fp->tq);
+ taskqueue_thread_enqueue, &fp->tq);
taskqueue_start_threads(&fp->tq, 1, PI_NET, "%s fpq",
- device_get_nameunit(sc->dev));
+ device_get_nameunit(sc->dev));
#endif
}
@@ -1495,23 +1518,19 @@ bxe_interrupt_attach(struct bxe_softc *sc)
fp = &sc->fp[0];
#endif
DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR),
- "%s(): Enabling INTx interrupts.\n", __FUNCTION__);
+ "%s(): Enabling INTx interrupts.\n", __FUNCTION__);
/*
* Setup the interrupt handler. Note that we pass the
* driver instance to the interrupt handler which
* will handle both the slowpath and fastpath.
*/
- rc = bus_setup_intr(sc->dev,sc->bxe_irq_res,
- INTR_TYPE_NET | INTR_MPSAFE,
- NULL,
- bxe_intr_legacy,
- sc,
- &sc->bxe_irq_tag);
+ rc = bus_setup_intr(sc->dev,sc->bxe_irq_res, INTR_TYPE_NET |
+ INTR_MPSAFE, NULL, bxe_intr_legacy, sc, &sc->bxe_irq_tag);
if (rc) {
BXE_PRINTF("%s(%d): Failed to allocate interrupt!\n",
- __FILE__, __LINE__);
+ __FILE__, __LINE__);
goto bxe_interrupt_attach_exit;
}
#ifdef BXE_TASK
@@ -1616,56 +1635,78 @@ bxe_probe_pci_caps(struct bxe_softc *sc)
DBEXIT(BXE_EXTREME_LOAD);
}
+/*
+ * Setup firmware pointers for BCM57710.
+ *
+ * Returns:
+ * None
+ */
static void
bxe_init_e1_firmware(struct bxe_softc *sc)
{
- INIT_OPS(sc) = (struct raw_op *)init_ops_e1;
- INIT_DATA(sc) = (const uint32_t *)init_data_e1;
- INIT_OPS_OFFSETS(sc) = (const uint16_t *)init_ops_offsets_e1;
- INIT_TSEM_INT_TABLE_DATA(sc) = tsem_int_table_data_e1;
- INIT_TSEM_PRAM_DATA(sc) = tsem_pram_data_e1;
- INIT_USEM_INT_TABLE_DATA(sc) = usem_int_table_data_e1;
- INIT_USEM_PRAM_DATA(sc) = usem_pram_data_e1;
- INIT_XSEM_INT_TABLE_DATA(sc) = xsem_int_table_data_e1;
- INIT_XSEM_PRAM_DATA(sc) = xsem_pram_data_e1;
- INIT_CSEM_INT_TABLE_DATA(sc) = csem_int_table_data_e1;
- INIT_CSEM_PRAM_DATA(sc) = csem_pram_data_e1;
+ INIT_OPS(sc) = (struct raw_op *)init_ops_e1;
+ INIT_DATA(sc) = (const uint32_t *)init_data_e1;
+ INIT_OPS_OFFSETS(sc) = (const uint16_t *)init_ops_offsets_e1;
+ INIT_TSEM_INT_TABLE_DATA(sc) = tsem_int_table_data_e1;
+ INIT_TSEM_PRAM_DATA(sc) = tsem_pram_data_e1;
+ INIT_USEM_INT_TABLE_DATA(sc) = usem_int_table_data_e1;
+ INIT_USEM_PRAM_DATA(sc) = usem_pram_data_e1;
+ INIT_XSEM_INT_TABLE_DATA(sc) = xsem_int_table_data_e1;
+ INIT_XSEM_PRAM_DATA(sc) = xsem_pram_data_e1;
+ INIT_CSEM_INT_TABLE_DATA(sc) = csem_int_table_data_e1;
+ INIT_CSEM_PRAM_DATA(sc) = csem_pram_data_e1;
}
+/*
+ * Setup firmware pointers for BCM57711.
+ *
+ * Returns:
+ * None
+ */
static void
bxe_init_e1h_firmware(struct bxe_softc *sc)
{
- INIT_OPS(sc) = (struct raw_op *)init_ops_e1h;
- INIT_DATA(sc) = (const uint32_t *)init_data_e1h;
- INIT_OPS_OFFSETS(sc) = (const uint16_t *)init_ops_offsets_e1h;
- INIT_TSEM_INT_TABLE_DATA(sc) = tsem_int_table_data_e1h;
- INIT_TSEM_PRAM_DATA(sc) = tsem_pram_data_e1h;
- INIT_USEM_INT_TABLE_DATA(sc) = usem_int_table_data_e1h;
- INIT_USEM_PRAM_DATA(sc) = usem_pram_data_e1h;
- INIT_XSEM_INT_TABLE_DATA(sc) = xsem_int_table_data_e1h;
- INIT_XSEM_PRAM_DATA(sc) = xsem_pram_data_e1h;
- INIT_CSEM_INT_TABLE_DATA(sc) = csem_int_table_data_e1h;
- INIT_CSEM_PRAM_DATA(sc) = csem_pram_data_e1h;
+ INIT_OPS(sc) = (struct raw_op *)init_ops_e1h;
+ INIT_DATA(sc) = (const uint32_t *)init_data_e1h;
+ INIT_OPS_OFFSETS(sc) = (const uint16_t *)init_ops_offsets_e1h;
+ INIT_TSEM_INT_TABLE_DATA(sc) = tsem_int_table_data_e1h;
+ INIT_TSEM_PRAM_DATA(sc) = tsem_pram_data_e1h;
+ INIT_USEM_INT_TABLE_DATA(sc) = usem_int_table_data_e1h;
+ INIT_USEM_PRAM_DATA(sc) = usem_pram_data_e1h;
+ INIT_XSEM_INT_TABLE_DATA(sc) = xsem_int_table_data_e1h;
+ INIT_XSEM_PRAM_DATA(sc) = xsem_pram_data_e1h;
+ INIT_CSEM_INT_TABLE_DATA(sc) = csem_int_table_data_e1h;
+ INIT_CSEM_PRAM_DATA(sc) = csem_pram_data_e1h;
}
+/*
+ * Sets up pointers for loading controller firmware.
+ *
+ * Returns:
+ * 0 = Success, !0 = Failure
+ */
static int
bxe_init_firmware(struct bxe_softc *sc)
{
+ int rc;
+
+ rc = 0;
+
if (CHIP_IS_E1(sc))
bxe_init_e1_firmware(sc);
else if (CHIP_IS_E1H(sc))
bxe_init_e1h_firmware(sc);
else {
- BXE_PRINTF("%s(%d): Unsupported chip revision\n",
+ BXE_PRINTF("%s(%d): No firmware to support chip revision!\n",
__FILE__, __LINE__);
- return (ENXIO);
+ rc = ENXIO;
}
- return (0);
-}
+ return (rc);
+}
static void
-bxe_set_tunables(struct bxe_softc *sc)
+bxe_tunables_set(struct bxe_softc *sc)
{
/*
* Get our starting point for interrupt mode/number of queues.
@@ -1724,15 +1765,7 @@ bxe_set_tunables(struct bxe_softc *sc)
"%s(): Requested: int_mode = %d, multi_mode = %d num_queues = %d\n",
__FUNCTION__, sc->int_mode, sc->multi_mode, sc->num_queues);
- /* Set transparent packet aggregation (TPA), aka LRO, flag. */
- if (bxe_tpa_enable!= FALSE)
- sc->bxe_flags |= BXE_TPA_ENABLE_FLAG;
-
- /* Capture the stats enable/disable setting. */
- if (bxe_stats_enable == FALSE)
- sc->stats_enable = FALSE;
- else
- sc->stats_enable = TRUE;
+ sc->stats_enable = TRUE;
/* Select the host coalescing tick count values (limit values). */
if (bxe_tx_ticks > 100) {
@@ -1766,11 +1799,13 @@ bxe_set_tunables(struct bxe_softc *sc)
/*
+ * Allocates PCI resources from OS.
+ *
* Returns:
* 0 = Success, !0 = Failure
*/
static int
-bxe_alloc_pci_resources(struct bxe_softc *sc)
+bxe_pci_resources_alloc(struct bxe_softc *sc)
{
int rid, rc = 0;
@@ -1782,32 +1817,32 @@ bxe_alloc_pci_resources(struct bxe_softc *sc)
* processor memory.
*/
rid = PCIR_BAR(0);
- sc->bxe_res = bus_alloc_resource_any(
- sc->dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+ sc->bxe_res = bus_alloc_resource_any(sc->dev,
+ SYS_RES_MEMORY, &rid, RF_ACTIVE);
if (sc->bxe_res == NULL) {
BXE_PRINTF("%s(%d):PCI BAR0 memory allocation failed\n",
__FILE__, __LINE__);
rc = ENXIO;
- goto bxe_alloc_pci_resources_exit;
+ goto bxe_pci_resources_alloc_exit;
}
/* Get OS resource handles for BAR0 memory. */
- sc->bxe_btag = rman_get_bustag(sc->bxe_res);
- sc->bxe_bhandle = rman_get_bushandle(sc->bxe_res);
- sc->bxe_vhandle = (vm_offset_t) rman_get_virtual(sc->bxe_res);
+ sc->bxe_btag = rman_get_bustag(sc->bxe_res);
+ sc->bxe_bhandle = rman_get_bushandle(sc->bxe_res);
+ sc->bxe_vhandle = (vm_offset_t) rman_get_virtual(sc->bxe_res);
/*
* Allocate PCI memory resources for BAR2.
* Doorbell (DB) memory.
*/
rid = PCIR_BAR(2);
- sc->bxe_db_res = bus_alloc_resource_any(
- sc->dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
+ sc->bxe_db_res = bus_alloc_resource_any(sc->dev,
+ SYS_RES_MEMORY, &rid, RF_ACTIVE);
if (sc->bxe_db_res == NULL) {
BXE_PRINTF("%s(%d): PCI BAR2 memory allocation failed\n",
__FILE__, __LINE__);
rc = ENXIO;
- goto bxe_alloc_pci_resources_exit;
+ goto bxe_pci_resources_alloc_exit;
}
/* Get OS resource handles for BAR2 memory. */
@@ -1815,45 +1850,52 @@ bxe_alloc_pci_resources(struct bxe_softc *sc)
sc->bxe_db_bhandle = rman_get_bushandle(sc->bxe_db_res);
sc->bxe_db_vhandle = (vm_offset_t) rman_get_virtual(sc->bxe_db_res);
-bxe_alloc_pci_resources_exit:
+bxe_pci_resources_alloc_exit:
DBEXIT(BXE_VERBOSE_LOAD);
- return(rc);
+ return (rc);
}
/*
+ * Frees PCI resources allocated in bxe_pci_resources_alloc().
+ *
* Returns:
* None
*/
static void
-bxe_release_pci_resources(struct bxe_softc *sc)
+bxe_pci_resources_free(struct bxe_softc *sc)
{
+ DBENTER(BXE_VERBOSE_UNLOAD);
+
/* Release the PCIe BAR0 mapped memory. */
if (sc->bxe_res != NULL) {
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET),
- "%s(): Releasing PCI BAR0 memory.\n", __FUNCTION__);
- bus_release_resource(sc->dev,
- SYS_RES_MEMORY, PCIR_BAR(0), sc->bxe_res);
+ bus_release_resource(sc->dev, SYS_RES_MEMORY,
+ PCIR_BAR(0), sc->bxe_res);
}
/* Release the PCIe BAR2 (doorbell) mapped memory. */
if (sc->bxe_db_res != NULL) {
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET),
- "%s(): Releasing PCI BAR2 memory.\n", __FUNCTION__);
- bus_release_resource(sc->dev,
- SYS_RES_MEMORY, PCIR_BAR(2), sc->bxe_db_res);
+ bus_release_resource(sc->dev, SYS_RES_MEMORY,
+ PCIR_BAR(2), sc->bxe_db_res);
}
+
+ DBENTER(BXE_VERBOSE_UNLOAD);
}
/*
+ * Determines the media reported to the OS by examining
+ * the installed PHY type.
+ *
* Returns:
* 0 = Success, !0 = Failure
*/
static int
bxe_media_detect(struct bxe_softc *sc)
{
- int rc = 0;
+ int rc;
+
+ rc = 0;
/* Identify supported media based on the PHY type. */
switch (XGXS_EXT_PHY_TYPE(sc->link_params.ext_phy_config)) {
@@ -1887,8 +1929,6 @@ bxe_media_detect(struct bxe_softc *sc)
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE:
case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN:
default:
- BXE_PRINTF("%s(%d): PHY not supported by driver!\n",
- __FILE__, __LINE__);
sc->media = 0;
rc = ENODEV;
}
@@ -1915,7 +1955,7 @@ bxe_attach(device_t dev)
int rc;
sc = device_get_softc(dev);
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ DBENTER(BXE_INFO_LOAD | BXE_INFO_RESET);
sc->dev = dev;
sc->bxe_unit = device_get_unit(dev);
@@ -1923,18 +1963,34 @@ bxe_attach(device_t dev)
sc->bxe_flags = 0;
sc->state = BXE_STATE_CLOSED;
rc = 0;
- bxe_set_tunables(sc);
- bxe_alloc_mutexes(sc);
+ DBPRINT(sc, BXE_FATAL, "%s(): ************************\n",
+ __FUNCTION__);
+ DBPRINT(sc, BXE_FATAL, "%s(): ** Debug mode enabled **\n",
+ __FUNCTION__);
+ DBPRINT(sc, BXE_FATAL, "%s(): ************************\n",
+ __FUNCTION__);
+ DBPRINT(sc, BXE_FATAL, "%s(): sc vaddr = 0x%08X:%08X\n",
+ __FUNCTION__, (uint32_t) U64_HI(sc), (uint32_t) U64_LO(sc));
+
+ /* Get the user configurable values for driver load. */
+ bxe_tunables_set(sc);
- /* Prepare the tick routine. */
- callout_init(&sc->bxe_tick_callout, CALLOUT_MPSAFE);
+ bxe_mutexes_alloc(sc);
+
+ /* Prepare tick routine. */
+ callout_init_mtx(&sc->bxe_tick_callout, &sc->bxe_core_mtx, 0);
/* Enable bus master capability */
pci_enable_busmaster(dev);
- if ((rc = bxe_alloc_pci_resources(sc)) != 0)
+ /* Enable PCI BAR mapped memory for register access. */
+ rc = bxe_pci_resources_alloc(sc);
+ if (rc != 0) {
+ BXE_PRINTF("%s(%d): Error allocating PCI resources!\n",
+ __FILE__, __LINE__);
goto bxe_attach_fail;
+ }
/* Put indirect address registers into a sane state. */
pci_write_config(sc->dev, PCICFG_GRC_ADDRESS,
@@ -1945,19 +2001,26 @@ bxe_attach(device_t dev)
REG_WR(sc, PXP2_REG_PGL_ADDR_94_F0 + BP_PORT(sc) * 16, 0);
/* Get hardware info from shared memory and validate data. */
- if (bxe_get_function_hwinfo(sc)) {
+ rc = bxe_hwinfo_function_get(sc);
+ if (rc != 0) {
DBPRINT(sc, BXE_WARN,
"%s(): Failed to get hardware info!\n", __FUNCTION__);
- rc = ENODEV;
goto bxe_attach_fail;
}
/* Setup supported media options. */
- if ((rc = bxe_media_detect(sc)) != 0)
+ rc = bxe_media_detect(sc);
+ if (rc != 0) {
+ BXE_PRINTF("%s(%d): Unknown media (PHY) type!\n",
+ __FILE__, __LINE__);
goto bxe_attach_fail;
+ }
+ /* Interface entrypoint for media type/status reporting. */
ifmedia_init(&sc->bxe_ifmedia,
IFM_IMASK, bxe_ifmedia_upd, bxe_ifmedia_status);
+
+ /* Default interface values. */
ifmedia_add(&sc->bxe_ifmedia,
IFM_ETHER | sc->media | IFM_FDX, 0, NULL);
ifmedia_add(&sc->bxe_ifmedia,
@@ -1967,38 +2030,37 @@ bxe_attach(device_t dev)
sc->bxe_ifmedia.ifm_media =
sc->bxe_ifmedia.ifm_cur->ifm_media;
- /* Set init arrays */
+ /* Setup firmware arrays (firmware load comes later). */
rc = bxe_init_firmware(sc);
if (rc) {
- BXE_PRINTF("%s(%d): Error loading firmware\n",
+ BXE_PRINTF("%s(%d): Error preparing firmware load!\n",
__FILE__, __LINE__);
goto bxe_attach_fail;
}
-
#ifdef BXE_DEBUG
/* Allocate a memory buffer for grcdump output.*/
sc->grcdump_buffer = malloc(BXE_GRCDUMP_BUF_SIZE, M_TEMP, M_NOWAIT);
if (sc->grcdump_buffer == NULL) {
- /* Failure is OK, just print a message and continue attach. */
BXE_PRINTF("%s(%d): Failed to allocate grcdump memory "
"buffer!\n", __FILE__, __LINE__);
+ rc = ENOBUFS;
}
#endif
/* Check that NVRAM contents are valid.*/
- if (bxe_nvram_test(sc)) {
+ rc = bxe_nvram_test(sc);
+ if (rc != 0) {
BXE_PRINTF("%s(%d): Failed NVRAM test!\n",
__FILE__, __LINE__);
- rc = ENODEV;
goto bxe_attach_fail;
}
/* Allocate the appropriate interrupts.*/
- if (bxe_interrupt_allocate(sc)) {
+ rc = bxe_interrupt_alloc(sc);
+ if (rc != 0) {
BXE_PRINTF("%s(%d): Interrupt allocation failed!\n",
__FILE__, __LINE__);
- rc = ENODEV;
goto bxe_attach_fail;
}
@@ -2016,7 +2078,7 @@ bxe_attach(device_t dev)
}
/* Check if PXE/UNDI is still active and unload it. */
- if (!BP_NOMCP(sc))
+ if (!NOMCP(sc))
bxe_undi_unload(sc);
/*
@@ -2032,6 +2094,7 @@ bxe_attach(device_t dev)
sc->rx_ring_size = USABLE_RX_BD;
/* Assume receive IP/TCP/UDP checksum is enabled. */
+ /* ToDo: Change when IOCTL changes checksum offload? */
sc->rx_csum = 1;
/* Disable WoL. */
@@ -2041,10 +2104,10 @@ bxe_attach(device_t dev)
sc->mbuf_alloc_size = MCLBYTES;
/* Allocate DMA memory resources. */
- if (bxe_dma_alloc(sc->dev)) {
+ rc = bxe_host_structures_alloc(sc->dev);
+ if (rc != 0) {
BXE_PRINTF("%s(%d): DMA memory allocation failed!\n",
__FILE__, __LINE__);
- rc = ENOMEM;
goto bxe_attach_fail;
}
@@ -2060,10 +2123,13 @@ bxe_attach(device_t dev)
/* Initialize the FreeBSD ifnet interface. */
ifp->if_softc = sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
+
+ /* Written by driver before attach, read-only afterwards. */
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+
+ /* Driver entrypoints from the network interface. */
ifp->if_ioctl = bxe_ioctl;
ifp->if_start = bxe_tx_start;
-
#if __FreeBSD_version >= 800000
ifp->if_transmit = bxe_tx_mq_start;
ifp->if_qflush = bxe_mq_flush;
@@ -2077,10 +2143,8 @@ bxe_attach(device_t dev)
ifp->if_mtu = ETHERMTU;
ifp->if_hwassist = BXE_IF_HWASSIST;
ifp->if_capabilities = BXE_IF_CAPABILITIES;
- if (TPA_ENABLED(sc)) {
- ifp->if_capabilities |= IFCAP_LRO;
- }
- ifp->if_capenable = ifp->if_capabilities;
+ /* TPA not enabled by default. */
+ ifp->if_capenable = BXE_IF_CAPABILITIES & ~IFCAP_LRO;
ifp->if_baudrate = IF_Gbps(10UL);
ifp->if_snd.ifq_drv_maxlen = sc->tx_ring_size;
@@ -2092,7 +2156,8 @@ bxe_attach(device_t dev)
ether_ifattach(ifp, sc->link_params.mac_addr);
/* Attach the interrupts to the interrupt handlers. */
- if (bxe_interrupt_attach(sc)) {
+ rc = bxe_interrupt_attach(sc);
+ if (rc != 0) {
BXE_PRINTF("%s(%d): Interrupt allocation failed!\n",
__FILE__, __LINE__);
goto bxe_attach_fail;
@@ -2108,8 +2173,8 @@ bxe_attach_fail:
if (rc != 0)
bxe_detach(dev);
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
- return(rc);
+ DBEXIT(BXE_INFO_LOAD | BXE_INFO_RESET);
+ return (rc);
}
@@ -2593,7 +2658,7 @@ bxe_link_settings_requested_exit:
* 0 = Success, !0 = Failure
*/
static int
-bxe_get_function_hwinfo(struct bxe_softc *sc)
+bxe_hwinfo_function_get(struct bxe_softc *sc)
{
uint32_t mac_hi, mac_lo, val;
int func, rc;
@@ -2604,7 +2669,7 @@ bxe_get_function_hwinfo(struct bxe_softc *sc)
func = BP_FUNC(sc);
/* Get the common hardware configuration first. */
- bxe_get_common_hwinfo(sc);
+ bxe_hwinfo_common_get(sc);
/* Assume no outer VLAN/multi-function support. */
sc->e1hov = sc->e1hmf = 0;
@@ -2621,13 +2686,13 @@ bxe_get_function_hwinfo(struct bxe_softc *sc)
} else {
if (BP_E1HVN(sc)) {
rc = EPERM;
- goto bxe_get_function_hwinfo_exit;
+ goto bxe_hwinfo_function_get_exit;
}
}
}
- if (!BP_NOMCP(sc)) {
- bxe_get_port_hwinfo(sc);
+ if (!NOMCP(sc)) {
+ bxe_hwinfo_port_get(sc);
sc->fw_seq = SHMEM_RD(sc, func_mb[func].drv_mb_header) &
DRV_MSG_SEQ_NUMBER_MASK;
}
@@ -2636,7 +2701,7 @@ bxe_get_function_hwinfo(struct bxe_softc *sc)
/*
* Fetch the factory configured MAC address for multi function
* devices. If this is not a multi-function device then the MAC
- * address was already read in the bxe_get_port_hwinfo() routine.
+ * address was already read in the bxe_hwinfo_port_get() routine.
* The MAC addresses used by the port are not the same as the MAC
* addressed used by the function.
*/
@@ -2647,6 +2712,7 @@ bxe_get_function_hwinfo(struct bxe_softc *sc)
if ((mac_lo == 0) && (mac_hi == 0)) {
BXE_PRINTF("%s(%d): Invalid Ethernet address!\n",
__FILE__, __LINE__);
+ rc = ENODEV;
} else {
sc->link_params.mac_addr[0] = (u_char)(mac_hi >> 8);
sc->link_params.mac_addr[1] = (u_char)(mac_hi);
@@ -2658,9 +2724,9 @@ bxe_get_function_hwinfo(struct bxe_softc *sc)
}
-bxe_get_function_hwinfo_exit:
+bxe_hwinfo_function_get_exit:
DBEXIT(BXE_VERBOSE_LOAD);
- return(rc);
+ return (rc);
}
@@ -2674,15 +2740,16 @@ bxe_get_function_hwinfo_exit:
* for future use.
*
* Returns:
- * None
+ * 0 = Success, !0 = Failure
*/
-static void
-bxe_get_port_hwinfo(struct bxe_softc *sc)
+static int
+bxe_hwinfo_port_get(struct bxe_softc *sc)
{
- int i, port;
+ int i, port, rc;
uint32_t val, mac_hi, mac_lo;
DBENTER(BXE_VERBOSE_LOAD);
+ rc = 0;
port = BP_PORT(sc);
sc->link_params.sc = sc;
@@ -2736,6 +2803,7 @@ bxe_get_port_hwinfo(struct bxe_softc *sc)
if (mac_lo == 0 && mac_hi == 0) {
BXE_PRINTF("%s(%d): No Ethernet address programmed on the "
"controller!\n", __FILE__, __LINE__);
+ rc = ENODEV;
} else {
sc->link_params.mac_addr[0] = (u_char)(mac_hi >> 8);
sc->link_params.mac_addr[1] = (u_char)(mac_hi);
@@ -2746,6 +2814,7 @@ bxe_get_port_hwinfo(struct bxe_softc *sc)
}
DBEXIT(BXE_VERBOSE_LOAD);
+ return (rc);
}
@@ -2753,17 +2822,22 @@ bxe_get_port_hwinfo(struct bxe_softc *sc)
* Get common hardware configuration.
*
* Multiple port devices such as the BCM57710 have configuration
- * information that is specific to each Ethernet port of the controller.
+ * information that is shared between all ports of the Ethernet
+ * controller. This function reads that configuration
+ * information from the bootcode's shared memory and saves it
+ * for future use.
*
* Returns:
- * None
+ * 0 = Success, !0 = Failure
*/
-static void
-bxe_get_common_hwinfo(struct bxe_softc *sc)
+static int
+bxe_hwinfo_common_get(struct bxe_softc *sc)
{
uint32_t val;
+ int rc;
DBENTER(BXE_VERBOSE_LOAD);
+ rc = 0;
/* Get the chip revision. */
sc->common.chip_id = sc->link_params.chip_id =
@@ -2806,10 +2880,12 @@ bxe_get_common_hwinfo(struct bxe_softc *sc)
(sc->common.shmem_base < 0xA0000) ||
(sc->common.shmem_base > 0xC0000)) {
- DBPRINT(sc, BXE_FATAL, "%s(): MCP is not active!\n",
- __FUNCTION__);
+ BXE_PRINTF("%s(%d): MCP is not active!\n",
+ __FILE__, __LINE__);
+ /* ToDo: Remove the NOMCP support. */
sc->bxe_flags |= BXE_NO_MCP_FLAG;
- goto bxe_get_common_hwinfo_exit;
+ rc = ENODEV;
+ goto bxe_hwinfo_common_get_exit;
}
/* Make sure the shared memory contents are valid. */
@@ -2818,7 +2894,8 @@ bxe_get_common_hwinfo(struct bxe_softc *sc)
(SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB)) {
BXE_PRINTF("%s(%d): Invalid NVRAM! Bad validity "
"signature.\n", __FILE__, __LINE__);
- goto bxe_get_common_hwinfo_exit;
+ rc = ENODEV;
+ goto bxe_hwinfo_common_get_exit;
}
/* Read the device configuration from shared memory. */
@@ -2854,11 +2931,13 @@ bxe_get_common_hwinfo(struct bxe_softc *sc)
BXE_PRINTF("%s(%d): Warning: This driver needs bootcode "
"0x%08X but found 0x%08X, please upgrade!\n",
__FILE__, __LINE__, MIN_BXE_BC_VER, sc->common.bc_ver);
- goto bxe_get_common_hwinfo_exit;
+ rc = ENODEV;
+ goto bxe_hwinfo_common_get_exit;
}
-bxe_get_common_hwinfo_exit:
+bxe_hwinfo_common_get_exit:
DBEXIT(BXE_VERBOSE_LOAD);
+ return (rc);
}
@@ -2979,51 +3058,45 @@ bxe_undi_unload(struct bxe_softc *sc)
* Stops the controller, resets the controller, and releases resources.
*
* Returns:
- * 0 on success, positive value on failure.
+ * 0 on success, !0 = failure.
*/
static int
bxe_detach(device_t dev)
{
struct bxe_softc *sc;
struct ifnet *ifp;
-#ifdef BXE_TASK
- struct bxe_fastpath *fp;
- int i;
-#endif
+ int rc;
sc = device_get_softc(dev);
- DBENTER(BXE_VERBOSE_RESET);
+ DBENTER(BXE_INFO_UNLOAD);
+
+ rc = 0;
ifp = sc->bxe_ifp;
if (ifp != NULL && ifp->if_vlantrunk != NULL) {
BXE_PRINTF("%s(%d): Cannot detach while VLANs are in use.\n",
__FILE__, __LINE__);
- return(EBUSY);
+ rc = EBUSY;
+ goto bxe_detach_exit;
}
/* Stop and reset the controller if it was open. */
if (sc->state != BXE_STATE_CLOSED) {
BXE_CORE_LOCK(sc);
- bxe_stop_locked(sc, UNLOAD_CLOSE);
+ rc = bxe_stop_locked(sc, UNLOAD_CLOSE);
BXE_CORE_UNLOCK(sc);
}
-#ifdef BXE_TASK
- /* Free the OS taskqueue resources. */
- for (i = 0; i < sc->num_queues; i++) {
- fp = &sc->fp[i];
+#ifdef BXE_DEBUG
+ /* Free memory buffer for grcdump output.*/
+ if (sc->grcdump_buffer != NULL)
+ free(sc->grcdump_buffer, M_TEMP);
+#endif
- if (fp->tq) {
- taskqueue_drain(fp->tq, &fp->task);
- taskqueue_free(fp->tq);
- }
- }
+ /* Clean-up any remaining interrupt resources. */
+ bxe_interrupt_detach(sc);
+ bxe_interrupt_free(sc);
- if (sc->tq) {
- taskqueue_drain(sc->tq, &sc->task);
- taskqueue_free(sc->tq);
- }
-#endif
/* Release the network interface. */
if (ifp != NULL)
ether_ifdetach(ifp);
@@ -3031,8 +3104,15 @@ bxe_detach(device_t dev)
/* Release all remaining resources. */
bxe_release_resources(sc);
+
+ /* Free all PCI resources. */
+ bxe_pci_resources_free(sc);
pci_disable_busmaster(dev);
+ bxe_mutexes_free(sc);
+
+bxe_detach_exit:
+ DBEXIT(BXE_INFO_UNLOAD);
return(0);
}
@@ -3079,9 +3159,8 @@ bxe_stop_leading(struct bxe_softc *sc)
uint16_t dsb_sp_prod_idx;
int rc, timeout;
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_RAMROD);
-
- DBPRINT(sc, BXE_VERBOSE_LOAD, "%s(): Stop client connection "
+ DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+ BXE_VERBOSE_UNLOAD), "%s(): Stop client connection "
"on fp[00].\n", __FUNCTION__);
/* Send the ETH_HALT ramrod. */
@@ -3089,26 +3168,24 @@ bxe_stop_leading(struct bxe_softc *sc)
bxe_sp_post(sc,RAMROD_CMD_ID_ETH_HALT, 0, 0, sc->fp[0].cl_id, 0);
/* Poll for the ETH_HALT ramrod on the leading connection. */
- rc = bxe_wait_ramrod(sc, BXE_FP_STATE_HALTED, 0, &(sc->fp[0].state), 1);
- if (rc)
+ rc = bxe_wait_ramrod(sc, BXE_FP_STATE_HALTED,
+ 0, &(sc->fp[0].state), 1);
+ if (rc) {
+ DBPRINT(sc, BXE_FATAL, "%s(): Timeout waiting for "
+ "STATE_HALTED ramrod completion!\n", __FUNCTION__);
goto bxe_stop_leading_exit;
+ }
+ /* Get the default status block SP producer index. */
dsb_sp_prod_idx = *sc->dsb_sp_prod;
- /*
- * Now that the connection is in the
- * HALTED state send PORT_DELETE ramrod.
- */
+ /* After HALT we send PORT_DELETE ramrod. */
bxe_sp_post(sc, RAMROD_CMD_ID_ETH_PORT_DEL, 0, 0, 0, 1);
- /*
- * Wait for completion. This can take a * long time if the other port
- * is busy. Give the command some time to complete but don't wait for a
- * completion since there's nothing we can do.
- */
+ /* Be patient but don't wait forever. */
timeout = 500;
while (dsb_sp_prod_idx == *sc->dsb_sp_prod) {
- if (!timeout) {
+ if (timeout == 0) {
DBPRINT(sc, BXE_FATAL, "%s(): Timeout waiting for "
"PORT_DEL ramrod completion!\n", __FUNCTION__);
rc = EBUSY;
@@ -3124,8 +3201,7 @@ bxe_stop_leading(struct bxe_softc *sc)
sc->fp[0].state = BXE_FP_STATE_CLOSED;
bxe_stop_leading_exit:
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_RAMROD);
- return(rc);
+ return (rc);
}
/*
@@ -3140,9 +3216,8 @@ bxe_setup_multi(struct bxe_softc *sc, int index)
struct bxe_fastpath *fp;
int rc;
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_RAMROD);
-
- DBPRINT(sc, BXE_VERBOSE_LOAD, "%s(): Setup client connection "
+ DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+ BXE_VERBOSE_UNLOAD), "%s(): Setup client connection "
"on fp[%02d].\n", __FUNCTION__, index);
fp = &sc->fp[index];
@@ -3154,10 +3229,9 @@ bxe_setup_multi(struct bxe_softc *sc, int index)
bxe_sp_post(sc, RAMROD_CMD_ID_ETH_CLIENT_SETUP, index, 0, fp->cl_id, 0);
/* Wait for the ramrod to complete. */
- rc = bxe_wait_ramrod(sc, BXE_FP_STATE_OPEN, index, &(fp->state), 1);
+ rc = bxe_wait_ramrod(sc, BXE_FP_STATE_OPEN, index, &fp->state, 1);
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_RAMROD);
- return(rc);
+ return (rc);
}
/*
@@ -3175,9 +3249,8 @@ bxe_stop_multi(struct bxe_softc *sc, int index)
struct bxe_fastpath *fp;
int rc;
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_RAMROD);
-
- DBPRINT(sc, BXE_VERBOSE_LOAD, "%s(): Stop client connection "
+ DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
+ BXE_VERBOSE_UNLOAD), "%s(): Stop client connection "
"on fp[%02d].\n", __FUNCTION__, index);
fp = &sc->fp[index];
@@ -3186,8 +3259,8 @@ bxe_stop_multi(struct bxe_softc *sc, int index)
fp->state = BXE_FP_STATE_HALTING;
bxe_sp_post(sc, RAMROD_CMD_ID_ETH_HALT, index, 0, fp->cl_id, 0);
- /* Wait for the ramrod completion. */
- rc = bxe_wait_ramrod(sc, BXE_FP_STATE_HALTED, index, &(fp->state), 1);
+ /* Wait for the HALT ramrod completion. */
+ rc = bxe_wait_ramrod(sc, BXE_FP_STATE_HALTED, index, &fp->state, 1);
if (rc){
BXE_PRINTF("%s(%d): fp[%02d] client ramrod halt failed!\n",
__FILE__, __LINE__, index);
@@ -3196,12 +3269,11 @@ bxe_stop_multi(struct bxe_softc *sc, int index)
/* Delete the CFC entry. */
bxe_sp_post(sc, RAMROD_CMD_ID_ETH_CFC_DEL, index, 0, 0, 1);
- /* Poll for the ramrod completion. */
- rc = bxe_wait_ramrod(sc, BXE_FP_STATE_CLOSED, index, &(fp->state), 1);
+ /* Poll for the DELETE ramrod completion. */
+ rc = bxe_wait_ramrod(sc, BXE_FP_STATE_CLOSED, index, &fp->state, 1);
bxe_stop_multi_exit:
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_RAMROD);
- return(rc);
+ return (rc);
}
/*
@@ -3268,7 +3340,7 @@ bxe__link_reset(struct bxe_softc *sc)
{
DBENTER(BXE_VERBOSE_PHY);
- if (!BP_NOMCP(sc)) {
+ if (!NOMCP(sc)) {
bxe_acquire_phy_lock(sc);
bxe_link_reset(&sc->link_params, &sc->link_vars, 1);
bxe_release_phy_lock(sc);
@@ -3285,7 +3357,7 @@ bxe__link_reset(struct bxe_softc *sc)
* Stop the controller.
*
* Returns:
- * Nothing.
+ * 0 = Success, !0 = Failure
*/
static int
bxe_stop_locked(struct bxe_softc *sc, int unload_mode)
@@ -3298,18 +3370,20 @@ bxe_stop_locked(struct bxe_softc *sc, int unload_mode)
uint8_t entry, *mac_addr;
int count, i, port, rc;
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+ DBENTER(BXE_INFO_LOAD | BXE_INFO_RESET | BXE_INFO_UNLOAD);
+
ifp = sc->bxe_ifp;
port = BP_PORT(sc),
- reset_code = 0;
- rc = 0;
+ rc = reset_code = 0;
+
+ BXE_CORE_LOCK_ASSERT(sc);
/* Stop the periodic tick. */
callout_stop(&sc->bxe_tick_callout);
sc->state = BXE_STATE_CLOSING_WAIT4_HALT;
- /* Stop receiving all types of Ethernet traffic. */
+ /* Prevent any further RX traffic. */
sc->rx_mode = BXE_RX_MODE_NONE;
bxe_set_storm_rx_mode(sc);
@@ -3320,6 +3394,7 @@ bxe_stop_locked(struct bxe_softc *sc, int unload_mode)
/* Tell the bootcode to stop watching for a heartbeat. */
SHMEM_WR(sc, func_mb[BP_FUNC(sc)].drv_pulse_mb,
(DRV_PULSE_ALWAYS_ALIVE | sc->fw_drv_pulse_wr_seq));
+
/* Stop the statistics updates. */
bxe_stats_handle(sc, STATS_EVENT_STOP);
@@ -3327,6 +3402,9 @@ bxe_stop_locked(struct bxe_softc *sc, int unload_mode)
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
+ if (fp == NULL || fp->tx_pkt_cons_sb == NULL)
+ break;
+
count = 1000;
while (bxe_has_tx_work(fp)) {
@@ -3334,7 +3412,7 @@ bxe_stop_locked(struct bxe_softc *sc, int unload_mode)
if (count == 0) {
BXE_PRINTF(
- "%s(%d): Timeout wating for fp[%d] transmits to complete!\n",
+ "%s(%d): Timeout wating for fp[%02d] transmits to complete!\n",
__FILE__, __LINE__, i);
break;
}
@@ -3351,8 +3429,8 @@ bxe_stop_locked(struct bxe_softc *sc, int unload_mode)
/* Disable Interrupts */
bxe_int_disable(sc);
-
DELAY(1000);
+
/* Clear the MAC addresses. */
if (CHIP_IS_E1(sc)) {
config = BXE_SP(sc, mcast_config);
@@ -3376,8 +3454,10 @@ bxe_stop_locked(struct bxe_softc *sc, int unload_mode)
REG_WR(sc, MC_HASH_OFFSET(sc, i), 0);
REG_WR(sc, MISC_REG_E1HMF_MODE, 0);
}
+
/* Determine if any WoL settings needed. */
if (unload_mode == UNLOAD_NORMAL)
+ /* Driver initiatied WoL is disabled. */
reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
else if (sc->bxe_flags & BXE_NO_WOL_FLAG) {
/* Driver initiated WoL is disabled, use OOB WoL settings. */
@@ -3398,38 +3478,29 @@ bxe_stop_locked(struct bxe_softc *sc, int unload_mode)
/* Prevent WoL. */
reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS;
}
+
/* Stop all non-leading client connections. */
for (i = 1; i < sc->num_queues; i++) {
if (bxe_stop_multi(sc, i)){
goto bxe_stop_locked_exit;
}
}
+
/* Stop the leading client connection. */
rc = bxe_stop_leading(sc);
- if (rc) {
-#ifdef BXE_DEBUG
- if ((sc->state != BXE_STATE_CLOSING_WAIT4_UNLOAD) ||
- (sc->fp[0].state != BXE_FP_STATE_CLOSED)) {
- BXE_PRINTF("%s(%d): Failed to close leading "
- "client connection!\n", __FILE__, __LINE__);
- }
-#endif
- }
-
DELAY(10000);
bxe_stop_locked_exit:
-
- if (BP_NOMCP(sc)) {
+ if (NOMCP(sc)) {
DBPRINT(sc, BXE_INFO,
- "%s(): Old No MCP load counts: %d, %d, %d\n", __FUNCTION__,
- load_count[0], load_count[1], load_count[2]);
+ "%s(): Old No MCP load counts: %d, %d, %d\n",
+ __FUNCTION__, load_count[0], load_count[1], load_count[2]);
load_count[0]--;
load_count[1 + port]--;
DBPRINT(sc, BXE_INFO,
- "%s(): New No MCP load counts: %d, %d, %d\n", __FUNCTION__,
- load_count[0], load_count[1], load_count[2]);
+ "%s(): New No MCP load counts: %d, %d, %d\n",
+ __FUNCTION__, load_count[0], load_count[1], load_count[2]);
if (load_count[0] == 0)
reset_code = FW_MSG_CODE_DRV_UNLOAD_COMMON;
@@ -3454,32 +3525,31 @@ bxe_stop_locked_exit:
DELAY(10000);
/* Report UNLOAD_DONE to MCP */
- if (!BP_NOMCP(sc))
+ if (!NOMCP(sc))
bxe_fw_command(sc, DRV_MSG_CODE_UNLOAD_DONE);
sc->port.pmf = 0;
/* Free RX chains and buffers. */
- bxe_free_rx_chains(sc);
+ bxe_clear_rx_chains(sc);
/* Free TX chains and buffers. */
- bxe_free_tx_chains(sc);
+ bxe_clear_tx_chains(sc);
sc->state = BXE_STATE_CLOSED;
bxe_ack_int(sc);
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |BXE_VERBOSE_UNLOAD);
- return(rc);
+ DBEXIT(BXE_INFO_LOAD | BXE_INFO_RESET |BXE_INFO_UNLOAD);
+ return (rc);
}
-
/*
* Device shutdown function.
*
* Stops and resets the controller.
*
* Returns:
- * Nothing
+ * 0 = Success, !0 = Failure
*/
static int
bxe_shutdown(device_t dev)
@@ -3487,13 +3557,13 @@ bxe_shutdown(device_t dev)
struct bxe_softc *sc;
sc = device_get_softc(dev);
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+ DBENTER(BXE_INFO_LOAD | BXE_INFO_RESET | BXE_INFO_UNLOAD);
BXE_CORE_LOCK(sc);
bxe_stop_locked(sc, UNLOAD_NORMAL);
BXE_CORE_UNLOCK(sc);
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+ DBEXIT(BXE_INFO_LOAD | BXE_INFO_RESET | BXE_INFO_UNLOAD);
return (0);
}
@@ -3571,7 +3641,9 @@ bxe__link_status_update(struct bxe_softc *sc)
bxe_stats_handle(sc, STATS_EVENT_LINK_UP);
else
bxe_stats_handle(sc, STATS_EVENT_STOP);
+
bxe_read_mf_cfg(sc);
+
/* Indicate link status. */
bxe_link_report(sc);
@@ -3630,7 +3702,7 @@ bxe_initial_phy_init(struct bxe_softc *sc)
DBENTER(BXE_VERBOSE_PHY);
rc = 0;
- if (!BP_NOMCP(sc)) {
+ if (!NOMCP(sc)) {
/*
* It is recommended to turn off RX flow control for 5771x
@@ -3646,6 +3718,7 @@ bxe_initial_phy_init(struct bxe_softc *sc)
bxe_release_phy_lock(sc);
bxe_calc_fc_adv(sc);
+
if (sc->link_vars.link_up) {
bxe_stats_handle(sc,STATS_EVENT_LINK_UP);
bxe_link_report(sc);
@@ -3673,9 +3746,10 @@ static int
bxe_alloc_buf_rings(struct bxe_softc *sc)
{
struct bxe_fastpath *fp;
- int i, rc = 0;
+ int i, rc;
DBENTER(BXE_VERBOSE_LOAD);
+ rc = 0;
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
@@ -3685,14 +3759,15 @@ bxe_alloc_buf_rings(struct bxe_softc *sc)
M_DEVBUF, M_DONTWAIT, &fp->mtx);
if (fp->br == NULL) {
rc = ENOMEM;
- return(rc);
+ goto bxe_alloc_buf_rings_exit;
}
} else
BXE_PRINTF("%s(%d): Bug!\n", __FILE__, __LINE__);
}
+bxe_alloc_buf_rings_exit:
DBEXIT(BXE_VERBOSE_LOAD);
- return(rc);
+ return (rc);
}
/*
@@ -3737,9 +3812,9 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
{
struct ifnet *ifp;
uint32_t load_code;
- int i, port;
+ int error, i, port;
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ DBENTER(BXE_INFO_LOAD | BXE_INFO_RESET);
BXE_CORE_LOCK_ASSERT(sc);
@@ -3753,7 +3828,7 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
/* Check if the driver is still running and bail out if it is. */
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
- DBPRINT(sc, BXE_INFO,
+ DBPRINT(sc, BXE_WARN,
"%s(): Init called while driver is running!\n",
__FUNCTION__);
goto bxe_init_locked_exit;
@@ -3770,7 +3845,7 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
*/
sc->state = BXE_STATE_OPENING_WAIT4_LOAD;
- if (BP_NOMCP(sc)) {
+ if (NOMCP(sc)) {
port = BP_PORT(sc);
DBPRINT(sc, BXE_INFO,
@@ -3817,7 +3892,8 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
sc->intr_sem = 1;
/* Initialize hardware. */
- if (bxe_init_hw(sc, load_code)){
+ error = bxe_init_hw(sc, load_code);
+ if (error != 0){
BXE_PRINTF("%s(%d): Hardware initialization failed, "
"aborting!\n", __FILE__, __LINE__);
goto bxe_init_locked_failed1;
@@ -3826,6 +3902,7 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
/* Calculate and save the Ethernet MTU size. */
sc->port.ether_mtu = ifp->if_mtu + ETHER_HDR_LEN +
(ETHER_VLAN_ENCAP_LEN * 2) + ETHER_CRC_LEN + 4;
+
DBPRINT(sc, BXE_INFO, "%s(): Setting MTU = %d\n",
__FUNCTION__, sc->port.ether_mtu);
@@ -3836,12 +3913,18 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
sc->mbuf_alloc_size = PAGE_SIZE;
else
sc->mbuf_alloc_size = MJUM9BYTES;
+
DBPRINT(sc, BXE_INFO, "%s(): mbuf_alloc_size = %d, "
"max_frame_size = %d\n", __FUNCTION__,
sc->mbuf_alloc_size, sc->port.ether_mtu);
/* Setup NIC internals and enable interrupts. */
- bxe_init_nic(sc, load_code);
+ error = bxe_init_nic(sc, load_code);
+ if (error != 0) {
+ BXE_PRINTF("%s(%d): NIC initialization failed, "
+ "aborting!\n", __FILE__, __LINE__);
+ goto bxe_init_locked_failed1;
+ }
if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) &&
(sc->common.shmem2_base)){
@@ -3855,7 +3938,8 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
#if __FreeBSD_version >= 800000
/* Allocate buffer rings for multiqueue operation. */
- if (bxe_alloc_buf_rings(sc)) {
+ error = bxe_alloc_buf_rings(sc);
+ if (error != 0) {
BXE_PRINTF("%s(%d): Buffer ring initialization failed, "
"aborting!\n", __FILE__, __LINE__);
goto bxe_init_locked_failed1;
@@ -3863,7 +3947,7 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
#endif
/* Tell MCP that driver load is done. */
- if (!BP_NOMCP(sc)) {
+ if (!NOMCP(sc)) {
load_code = bxe_fw_command(sc, DRV_MSG_CODE_LOAD_DONE);
if (!load_code) {
BXE_PRINTF("%s(%d): Driver load failed! No MCP "
@@ -3878,10 +3962,12 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
sc->intr_sem = 0;
/* Setup the leading connection for the controller. */
- if (bxe_setup_leading(sc))
+ error = bxe_setup_leading(sc);
+ if (error != 0) {
DBPRINT(sc, BXE_FATAL, "%s(): Initial PORT_SETUP ramrod "
"failed. State is not OPEN!\n", __FUNCTION__);
-
+ goto bxe_init_locked_failed3;
+ }
if (CHIP_IS_E1H(sc)) {
if (sc->mf_config[BP_E1HVN(sc)] & FUNC_MF_CFG_FUNC_DISABLED) {
@@ -3917,7 +4003,6 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
else
bxe_set_mac_addr_e1h(sc, 1);
-
DELAY(1000);
/* Perform PHY initialization for the primary port. */
@@ -3950,7 +4035,7 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
bxe__link_status_update(sc);
DELAY(1000);
- /* Tell the stack the driver is running and the TX queue is open. */
+ /* Tell the stack the driver is running. */
ifp->if_drv_flags = IFF_DRV_RUNNING;
/* Schedule our periodic timer tick. */
@@ -3958,23 +4043,20 @@ bxe_init_locked(struct bxe_softc *sc, int load_mode)
/* Everything went OK, go ahead and exit. */
goto bxe_init_locked_exit;
- /* Try and gracefully shutdown the device because of a failure. */
bxe_init_locked_failed4:
-
+ /* Try and gracefully shutdown the device because of a failure. */
for (i = 1; i < sc->num_queues; i++)
bxe_stop_multi(sc, i);
+bxe_init_locked_failed3:
bxe_stop_leading(sc);
-
bxe_stats_handle(sc, STATS_EVENT_STOP);
bxe_init_locked_failed2:
-
bxe_int_disable(sc);
bxe_init_locked_failed1:
-
- if (!BP_NOMCP(sc)) {
+ if (!NOMCP(sc)) {
bxe_fw_command(sc, DRV_MSG_CODE_LOAD_DONE);
bxe_fw_command(sc, DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP);
bxe_fw_command(sc, DRV_MSG_CODE_UNLOAD_DONE);
@@ -3985,11 +4067,10 @@ bxe_init_locked_failed1:
bxe_free_buf_rings(sc);
#endif
- DBPRINT(sc, BXE_INFO, "%s(): Initialization failed!\n", __FUNCTION__);
+ DBPRINT(sc, BXE_WARN, "%s(): Initialization failed!\n", __FUNCTION__);
bxe_init_locked_exit:
-
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ DBEXIT(BXE_INFO_LOAD | BXE_INFO_RESET);
}
/*
@@ -4039,7 +4120,7 @@ bxe_wait_ramrod(struct bxe_softc *sc, int state, int idx, int *state_p,
}
/* We timed out polling for a completion. */
- DBPRINT(sc, BXE_FATAL, "%s(): Timeout %s for state 0x%08X on fp[%d]. "
+ DBPRINT(sc, BXE_FATAL, "%s(): Timeout %s for state 0x%08X on fp[%02d]. "
"Got 0x%x instead\n", __FUNCTION__, poll ? "polling" : "waiting",
state, idx, *state_p);
@@ -4060,7 +4141,7 @@ bxe_write_dmae_phys_len(struct bxe_softc *sc, bus_addr_t phys_addr,
uint32_t addr, uint32_t len)
{
int dmae_wr_max, offset;
- DBENTER(BXE_VERBOSE_LOAD);
+ DBENTER(BXE_INSANE_REGS);
dmae_wr_max = DMAE_LEN32_WR_MAX(sc);
offset = 0;
@@ -4071,7 +4152,7 @@ bxe_write_dmae_phys_len(struct bxe_softc *sc, bus_addr_t phys_addr,
len -= dmae_wr_max;
}
bxe_write_dmae(sc, phys_addr + offset, addr + offset, len);
- DBEXIT(BXE_VERBOSE_LOAD);
+ DBEXIT(BXE_INSANE_REGS);
}
@@ -4119,17 +4200,17 @@ bxe_init_ind_wr(struct bxe_softc *sc, uint32_t addr, const uint32_t *data,
static void
bxe_write_big_buf(struct bxe_softc *sc, uint32_t addr, uint32_t len)
{
- DBENTER(BXE_VERBOSE_LOAD);
-#ifdef USE_DMAE
+ DBENTER(BXE_INSANE_REGS);
+#ifdef BXE_USE_DMAE
if (sc->dmae_ready)
- bxe_write_dmae_phys_len(sc, sc->gunzip_mapping, addr, len);
+ bxe_write_dmae_phys_len(sc, sc->gz_dma.paddr, addr, len);
else
- bxe_init_str_wr(sc, addr, sc->gunzip_buf, len);
+ bxe_init_str_wr(sc, addr, sc->gz, len);
#else
- bxe_init_str_wr(sc, addr, sc->gunzip_buf, len);
+ bxe_init_str_wr(sc, addr, sc->gz, len);
#endif
- DBEXIT(BXE_VERBOSE_LOAD);
+ DBEXIT(BXE_INSANE_REGS);
}
/*
@@ -4148,9 +4229,9 @@ bxe_init_fill(struct bxe_softc *sc, uint32_t addr, int fill, uint32_t len)
DBENTER(BXE_VERBOSE_LOAD);
- length = (((len * 4) > FW_BUF_SIZE) ? FW_BUF_SIZE : (len * 4));
+ length = (((len * 4) > BXE_FW_BUF_SIZE) ? BXE_FW_BUF_SIZE : (len * 4));
leftovers = length / 4;
- memset(sc->gunzip_buf, fill, length);
+ memset(sc->gz, fill, length);
for (i = 0; i < len; i += leftovers) {
cur_len = min(leftovers, len - i);
@@ -4173,13 +4254,15 @@ bxe_init_wr_64(struct bxe_softc *sc, uint32_t addr, const uint32_t *data,
uint32_t buf_len32, cur_len, len;
int i;
- buf_len32 = FW_BUF_SIZE / 4;
+ DBENTER(BXE_INSANE_REGS);
+
+ buf_len32 = BXE_FW_BUF_SIZE / 4;
len = len64 * 2;
/* 64 bit value is in a blob: first low DWORD, then high DWORD. */
data64 = HILO_U64((*(data + 1)), (*data));
- len64 = min((uint32_t)(FW_BUF_SIZE / 8), len64);
+ len64 = min((uint32_t)(BXE_FW_BUF_SIZE / 8), len64);
for (i = 0; i < len64; i++) {
- pdata = ((uint64_t *)(sc->gunzip_buf)) + i;
+ pdata = ((uint64_t *)(sc->gz)) + i;
*pdata = data64;
}
@@ -4187,6 +4270,8 @@ bxe_init_wr_64(struct bxe_softc *sc, uint32_t addr, const uint32_t *data,
cur_len = min(buf_len32, len - i);
bxe_write_big_buf(sc, addr + i*4, cur_len);
}
+
+ DBEXIT(BXE_INSANE_REGS);
}
@@ -4247,15 +4332,15 @@ static void
bxe_write_big_buf_wb(struct bxe_softc *sc, uint32_t addr, uint32_t len)
{
if (sc->dmae_ready)
- bxe_write_dmae_phys_len(sc, sc->gunzip_mapping, addr, len);
+ bxe_write_dmae_phys_len(sc, sc->gz_dma.paddr, addr, len);
else
- bxe_init_ind_wr(sc, addr, sc->gunzip_buf, len);
+ bxe_init_ind_wr(sc, addr, sc->gz, len);
}
#define VIRT_WR_DMAE_LEN(sc, data, addr, len32, le32_swap) \
do { \
- memcpy(sc->gunzip_buf, data, (len32)*4); \
+ memcpy(sc->gz, data, (len32)*4); \
bxe_write_big_buf_wb(sc, addr, len32); \
} while (0)
@@ -4271,7 +4356,7 @@ bxe_init_wr_wb(struct bxe_softc *sc, uint32_t addr, const uint32_t *data,
{
const uint32_t *old_data;
- DBENTER(BXE_VERBOSE_LOAD);
+ DBENTER(BXE_INSANE_REGS);
old_data = data;
data = (const uint32_t *)bxe_sel_blob(sc, addr, (const uint8_t *)data);
if (sc->dmae_ready) {
@@ -4282,7 +4367,7 @@ bxe_init_wr_wb(struct bxe_softc *sc, uint32_t addr, const uint32_t *data,
} else
bxe_init_ind_wr(sc, addr, data, len);
- DBEXIT(BXE_VERBOSE_LOAD);
+ DBEXIT(BXE_INSANE_REGS);
}
static void
@@ -4316,6 +4401,8 @@ bxe_init_block(struct bxe_softc *sc, uint32_t block, uint32_t stage)
uint16_t op_end, op_start;
int hw_wr;
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+
op_start = INIT_OPS_OFFSETS(sc)[BLOCK_OPS_IDX(block, stage,
STAGE_START)];
op_end = INIT_OPS_OFFSETS(sc)[BLOCK_OPS_IDX(block, stage, STAGE_END)];
@@ -4370,11 +4457,14 @@ bxe_init_block(struct bxe_softc *sc, uint32_t block, uint32_t stage)
break;
}
}
+
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
}
/*
* Handles controller initialization when called from an unlocked routine.
* ifconfig calls this function.
+ *
* Returns:
* None.
*/
@@ -4384,16 +4474,12 @@ bxe_init(void *xsc)
struct bxe_softc *sc;
sc = xsc;
- DBENTER(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
BXE_CORE_LOCK(sc);
bxe_init_locked(sc, LOAD_NORMAL);
BXE_CORE_UNLOCK(sc);
-
- DBEXIT(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
}
-
/*
* Release all resources used by the driver.
*
@@ -4407,7 +4493,6 @@ static void
bxe_release_resources(struct bxe_softc *sc)
{
device_t dev;
- int i;
DBENTER(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
@@ -4417,57 +4502,14 @@ bxe_release_resources(struct bxe_softc *sc)
if (sc->bxe_ifp != NULL)
if_free(sc->bxe_ifp);
- /* Release interrupt resources. */
- bxe_interrupt_detach(sc);
-
- if ((sc->bxe_flags & BXE_USING_MSIX_FLAG) && sc->msix_count) {
-
- for (i = 0; i < sc->msix_count; i++) {
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
- BXE_VERBOSE_INTR), "%s(): Releasing MSI-X[%d] "
- "vector.\n", __FUNCTION__, i);
- if (sc->bxe_msix_res[i] && sc->bxe_msix_rid[i])
- bus_release_resource(dev, SYS_RES_IRQ,
- sc->bxe_msix_rid[i], sc->bxe_msix_res[i]);
- }
-
- pci_release_msi(dev);
-
- } else if ((sc->bxe_flags & BXE_USING_MSI_FLAG) && sc->msi_count) {
-
- for (i = 0; i < sc->msi_count; i++) {
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
- BXE_VERBOSE_INTR), "%s(): Releasing MSI[%d] "
- "vector.\n", __FUNCTION__, i);
- if (sc->bxe_msi_res[i] && sc->bxe_msi_rid[i])
- bus_release_resource(dev, SYS_RES_IRQ,
- sc->bxe_msi_rid[i], sc->bxe_msi_res[i]);
- }
-
- pci_release_msi(dev);
-
- } else {
-
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET |
- BXE_VERBOSE_INTR), "%s(): Releasing legacy interrupt.\n",
- __FUNCTION__);
- if (sc->bxe_irq_res != NULL)
- bus_release_resource(dev, SYS_RES_IRQ,
- sc->bxe_irq_rid, sc->bxe_irq_res);
- }
-
/* Free the DMA resources. */
- bxe_dma_free(sc);
-
- bxe_release_pci_resources(sc);
+ bxe_host_structures_free(sc);
#if __FreeBSD_version >= 800000
/* Free multiqueue buffer rings. */
bxe_free_buf_rings(sc);
#endif
- /* Free remaining fastpath resources. */
- bxe_free_mutexes(sc);
}
@@ -4484,7 +4526,7 @@ bxe_release_resources(struct bxe_softc *sc)
static void
bxe_reg_wr_ind(struct bxe_softc *sc, uint32_t offset, uint32_t val)
{
- DBPRINT(sc, BXE_INSANE, "%s(); offset = 0x%08X, val = 0x%08X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(); offset = 0x%08X, val = 0x%08X\n",
__FUNCTION__, offset, val);
pci_write_config(sc->dev, PCICFG_GRC_ADDRESS, offset, 4);
@@ -4518,7 +4560,7 @@ bxe_reg_rd_ind(struct bxe_softc *sc, uint32_t offset)
pci_write_config(sc->dev, PCICFG_GRC_ADDRESS,
PCICFG_VENDOR_ID_OFFSET, 4);
- DBPRINT(sc, BXE_INSANE, "%s(); offset = 0x%08X, val = 0x%08X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(); offset = 0x%08X, val = 0x%08X\n",
__FUNCTION__, offset, val);
return (val);
}
@@ -4548,7 +4590,7 @@ bxe_post_dmae(struct bxe_softc *sc, struct dmae_command *dmae, int idx)
for (i = 0; i < (sizeof(struct dmae_command) / 4); i++) {
REG_WR(sc, cmd_offset + i * 4, *(((uint32_t *)dmae) + i));
- DBPRINT(sc, BXE_INSANE, "%s(): DMAE cmd[%d].%d : 0x%08X\n",
+ DBPRINT(sc, BXE_INSANE_REGS, "%s(): DMAE cmd[%d].%d : 0x%08X\n",
__FUNCTION__, idx, i, cmd_offset + i * 4);
}
@@ -4666,7 +4708,7 @@ bxe_read_dmae(struct bxe_softc *sc, uint32_t src_addr,
uint32_t *data, *wb_comp;
int i, timeout;
- DBENTER(BXE_INSANE);
+ DBENTER(BXE_INSANE_REGS);
wb_comp = BXE_SP(sc, wb_comp);
/* Fall back to indirect access if DMAE is not ready. */
@@ -4728,7 +4770,7 @@ bxe_read_dmae(struct bxe_softc *sc, uint32_t src_addr,
BXE_DMAE_UNLOCK(sc);
bxe_read_dmae_exit:
- DBEXIT(BXE_INSANE);
+ DBEXIT(BXE_INSANE_REGS);
}
/*
@@ -4962,7 +5004,7 @@ bxe_int_enable(struct bxe_softc *sc)
port = BP_PORT(sc);
hc_addr = port ? HC_REG_CONFIG_1 : HC_REG_CONFIG_0;
val = REG_RD(sc, hc_addr);
- if (sc->bxe_flags & BXE_USING_MSIX_FLAG) {
+ if (sc->msix_count > 0) {
if (sc->msix_count == 1) {
/* Single interrupt, multiple queues.*/
@@ -4993,7 +5035,7 @@ bxe_int_enable(struct bxe_softc *sc)
HC_CONFIG_0_REG_ATTN_BIT_EN_0);
}
- } else if (sc->bxe_flags & BXE_USING_MSI_FLAG) {
+ } else if (sc->msi_count > 0) {
if (sc->msi_count == 1) {
@@ -5080,7 +5122,7 @@ bxe_int_disable(struct bxe_softc *sc)
uint32_t hc_addr, val;
int port;
- DBENTER(BXE_VERBOSE_INTR);
+ DBENTER(BXE_VERBOSE_INTR | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
port = BP_PORT(sc);
hc_addr = port ? HC_REG_CONFIG_1 : HC_REG_CONFIG_0;
@@ -5097,7 +5139,7 @@ bxe_int_disable(struct bxe_softc *sc)
__FUNCTION__, val);
}
- DBEXIT(BXE_VERBOSE_INTR);
+ DBEXIT(BXE_VERBOSE_INTR | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
}
#define BXE_CRC32_RESIDUAL 0xdebb20e3
@@ -5592,10 +5634,6 @@ bxe_ack_sb(struct bxe_softc *sc, uint8_t sb_id, uint8_t storm, uint16_t index,
struct igu_ack_register igu_ack;
uint32_t hc_addr;
- DBPRINT(sc, BXE_VERBOSE_INTR, "%s(): sb_id = %d, storm = %d, "
- "index = %d, int_mode = %d, update = %d.\n", __FUNCTION__, sb_id,
- storm, index, int_mode, update);
-
hc_addr = (HC_REG_COMMAND_REG + BP_PORT(sc) * 32 + COMMAND_REG_INT_ACK);
igu_ack.status_block_index = index;
igu_ack.sb_id_and_flags =
@@ -5605,11 +5643,6 @@ bxe_ack_sb(struct bxe_softc *sc, uint8_t sb_id, uint8_t storm, uint16_t index,
(int_mode << IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT));
rmb();
-
- DBPRINT(sc, BXE_VERBOSE_INTR,
- "%s(): Writing 0x%08X to HC addr 0x%08X\n", __FUNCTION__,
- (*(uint32_t *) &igu_ack), hc_addr);
-
REG_WR(sc, hc_addr, (*(uint32_t *) &igu_ack));
wmb();
}
@@ -5618,7 +5651,8 @@ bxe_ack_sb(struct bxe_softc *sc, uint8_t sb_id, uint8_t storm, uint16_t index,
* Update fastpath status block index.
*
* Returns:
- * 0
+ * 0 = Nu completes, 1 = TX completes, 2 = RX completes,
+ * 3 = RX & TX completes
*/
static __inline uint16_t
bxe_update_fpsb_idx(struct bxe_fastpath *fp)
@@ -5686,7 +5720,7 @@ bxe_sp_event(struct bxe_fastpath *fp, union eth_rx_cqe *rr_cqe)
cid = SW_CID(rr_cqe->ramrod_cqe.conn_and_cmd_data);
command = CQE_CMD(rr_cqe->ramrod_cqe.conn_and_cmd_data);
DBPRINT(sc, BXE_VERBOSE_RAMROD, "%s(): CID = %d, ramrod command = %d, "
- "device state = 0x%08X, fp[%d].state = 0x%08X, type = %d\n",
+ "device state = 0x%08X, fp[%02d].state = 0x%08X, type = %d\n",
__FUNCTION__, cid, command, sc->state, fp->index, fp->state,
rr_cqe->ramrod_cqe.ramrod_type);
@@ -5699,13 +5733,13 @@ bxe_sp_event(struct bxe_fastpath *fp, union eth_rx_cqe *rr_cqe)
switch (command | fp->state) {
case (RAMROD_CMD_ID_ETH_CLIENT_SETUP | BXE_FP_STATE_OPENING):
DBPRINT(sc, BXE_VERBOSE_RAMROD,
- "%s(): Completed fp[%d] CLIENT_SETUP Ramrod.\n",
+ "%s(): Completed fp[%02d] CLIENT_SETUP Ramrod.\n",
__FUNCTION__, cid);
fp->state = BXE_FP_STATE_OPEN;
break;
case (RAMROD_CMD_ID_ETH_HALT | BXE_FP_STATE_HALTING):
DBPRINT(sc, BXE_VERBOSE_RAMROD,
- "%s(): Completed fp[%d] ETH_HALT ramrod\n",
+ "%s(): Completed fp[%02d] ETH_HALT ramrod\n",
__FUNCTION__, cid);
fp->state = BXE_FP_STATE_HALTED;
break;
@@ -5734,7 +5768,7 @@ bxe_sp_event(struct bxe_fastpath *fp, union eth_rx_cqe *rr_cqe)
break;
case (RAMROD_CMD_ID_ETH_CFC_DEL | BXE_STATE_CLOSING_WAIT4_HALT):
DBPRINT(sc, BXE_VERBOSE_RAMROD,
- "%s(): Completed fp[%d] ETH_CFC_DEL ramrod.\n",
+ "%s(): Completed fp[%02d] ETH_CFC_DEL ramrod.\n",
__FUNCTION__, cid);
sc->fp[cid].state = BXE_FP_STATE_CLOSED;
break;
@@ -5787,7 +5821,7 @@ bxe_acquire_hw_lock(struct bxe_softc *sc, uint32_t resource)
/* Validating that the resource is within range. */
if (resource > HW_LOCK_MAX_RESOURCE_VALUE) {
- DBPRINT(sc, BXE_INFO, "%s(): Resource is out of range! "
+ DBPRINT(sc, BXE_WARN, "%s(): Resource is out of range! "
"resource(0x%08X) > HW_LOCK_MAX_RESOURCE_VALUE(0x%08X)\n",
__FUNCTION__, resource, HW_LOCK_MAX_RESOURCE_VALUE);
rc = EINVAL;
@@ -5797,7 +5831,7 @@ bxe_acquire_hw_lock(struct bxe_softc *sc, uint32_t resource)
/* Validating that the resource is not already taken. */
lock_status = REG_RD(sc, hw_lock_control_reg);
if (lock_status & resource_bit) {
- DBPRINT(sc, BXE_INFO, "%s(): Failed to acquire lock! "
+ DBPRINT(sc, BXE_WARN, "%s(): Failed to acquire lock! "
"lock_status = 0x%08X, resource_bit = 0x%08X\n",
__FUNCTION__, lock_status, resource_bit);
rc = EEXIST;
@@ -5815,7 +5849,7 @@ bxe_acquire_hw_lock(struct bxe_softc *sc, uint32_t resource)
DELAY(5000);
}
- DBPRINT(sc, BXE_INFO, "%s(): Timeout!\n", __FUNCTION__);
+ DBPRINT(sc, BXE_WARN, "%s(): Timeout!\n", __FUNCTION__);
rc = EAGAIN;
bxe_acquire_hw_lock_exit:
@@ -5846,7 +5880,7 @@ bxe_release_hw_lock(struct bxe_softc *sc, uint32_t resource)
rc = 0;
/* Validating that the resource is within range */
if (resource > HW_LOCK_MAX_RESOURCE_VALUE) {
- DBPRINT(sc, BXE_INFO, "%s(): Resource is out of range! "
+ DBPRINT(sc, BXE_WARN, "%s(): Resource is out of range! "
"resource(0x%08X) > HW_LOCK_MAX_RESOURCE_VALUE(0x%08X)\n",
__FUNCTION__, resource, HW_LOCK_MAX_RESOURCE_VALUE);
rc = EINVAL;
@@ -5861,7 +5895,7 @@ bxe_release_hw_lock(struct bxe_softc *sc, uint32_t resource)
/* Validating that the resource is currently taken */
lock_status = REG_RD(sc, hw_lock_control_reg);
if (!(lock_status & resource_bit)) {
- DBPRINT(sc, BXE_INFO, "%s(): The resource is not currently "
+ DBPRINT(sc, BXE_WARN, "%s(): The resource is not currently "
"locked! lock_status = 0x%08X, resource_bit = 0x%08X\n",
__FUNCTION__, lock_status, resource_bit);
rc = EFAULT;
@@ -6045,15 +6079,13 @@ bxe_set_spio(struct bxe_softc *sc, int spio_num, uint32_t mode)
uint32_t spio_reg, spio_mask;
int rc;
- DBENTER(BXE_VERBOSE_MISC);
-
rc = 0;
spio_mask = 1 << spio_num;
/* Validate the SPIO. */
if ((spio_num < MISC_REGISTERS_SPIO_4) ||
(spio_num > MISC_REGISTERS_SPIO_7)) {
- DBPRINT(sc, BXE_FATAL, "%s(): Invalid SPIO (%d)!\n",
+ DBPRINT(sc, BXE_WARN, "%s(): Invalid SPIO (%d)!\n",
__FUNCTION__, spio_num);
rc = EINVAL;
goto bxe_set_spio_exit;
@@ -6071,24 +6103,24 @@ bxe_set_spio(struct bxe_softc *sc, int spio_num, uint32_t mode)
switch (mode) {
case MISC_REGISTERS_SPIO_OUTPUT_LOW :
- DBPRINT(sc, BXE_INFO, "%s(): Set SPIO %d -> output low\n",
- __FUNCTION__, spio_num);
+ DBPRINT(sc, BXE_VERBOSE_MISC, "%s(): Set SPIO %d -> "
+ "output low\n", __FUNCTION__, spio_num);
spio_reg &= ~(spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);
spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_CLR_POS);
break;
case MISC_REGISTERS_SPIO_OUTPUT_HIGH :
- DBPRINT(sc, BXE_INFO, "%s(): Set SPIO %d -> output high\n",
- __FUNCTION__, spio_num);
+ DBPRINT(sc, BXE_VERBOSE_MISC, "%s(): Set SPIO %d -> "
+ "output high\n", __FUNCTION__, spio_num);
spio_reg &= ~(spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);
spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_SET_POS);
break;
case MISC_REGISTERS_SPIO_INPUT_HI_Z:
- DBPRINT(sc, BXE_INFO, "%s(): Set SPIO %d -> input\n",
- __FUNCTION__, spio_num);
+ DBPRINT(sc, BXE_VERBOSE_MISC, "%s(): Set SPIO %d -> "
+ "input\n", __FUNCTION__, spio_num);
spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);
break;
default:
- DBPRINT(sc, BXE_FATAL, "%s(): Unknown SPIO mode (0x%08X)!\n",
+ DBPRINT(sc, BXE_WARN, "%s(): Unknown SPIO mode (0x%08X)!\n",
__FUNCTION__, mode);
break;
}
@@ -6101,7 +6133,6 @@ bxe_set_spio(struct bxe_softc *sc, int spio_num, uint32_t mode)
}
bxe_set_spio_exit:
- DBEXIT(BXE_VERBOSE_MISC);
return (rc);
}
@@ -6202,9 +6233,6 @@ bxe_link_attn(struct bxe_softc *sc)
bxe_stats_handle(sc, STATS_EVENT_LINK_UP);
}
- /* Report the new link status. */
- bxe_link_report(sc);
-
/* Need additional handling for multi-function devices. */
if (IS_E1HMF(sc)) {
port = BP_PORT(sc);
@@ -6254,11 +6282,9 @@ bxe_pmf_update(struct bxe_softc *sc)
uint32_t val;
int port;
- DBENTER(BXE_VERBOSE_INTR);
-
/* Record that this driver instance is managing the port. */
sc->port.pmf = 1;
- DBPRINT(sc, BXE_INFO, "%s(): Enabling port management function.\n",
+ DBPRINT(sc, BXE_INFO, "%s(): Enabling this port as PMF.\n",
__FUNCTION__);
/* Enable NIG attention. */
@@ -6268,8 +6294,6 @@ bxe_pmf_update(struct bxe_softc *sc)
REG_WR(sc, HC_REG_LEADING_EDGE_0 + port * 8, val);
bxe_stats_handle(sc, STATS_EVENT_PMF);
-
- DBEXIT(BXE_VERBOSE_INTR);
}
/* 8073 Download definitions */
@@ -6376,9 +6400,9 @@ bxe_sp_post(struct bxe_softc *sc, int command, int cid, uint32_t data_hi,
{
int func, rc;
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_RAMROD);
-
- DBRUNMSG(BXE_VERBOSE_RAMROD, bxe_decode_ramrod_cmd(sc, command));
+ DBRUNMSG((BXE_EXTREME_LOAD | BXE_EXTREME_RESET |
+ BXE_EXTREME_UNLOAD | BXE_EXTREME_RAMROD),
+ bxe_decode_ramrod_cmd(sc, command));
DBPRINT(sc, BXE_VERBOSE_RAMROD, "%s(): cid = %d, data_hi = 0x%08X, "
"data_low = 0x%08X, remaining spq entries = %d\n", __FUNCTION__,
@@ -6437,8 +6461,6 @@ bxe_sp_post(struct bxe_softc *sc, int command, int cid, uint32_t data_hi,
bxe_sp_post_exit:
BXE_SP_UNLOCK(sc);
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_RAMROD);
-
return (rc);
}
@@ -6512,7 +6534,7 @@ bxe_update_dsb_idx(struct bxe_softc *sc)
uint16_t rc;
rc = 0;
- dsb = sc->def_status_block;
+ dsb = sc->def_sb;
/* Read memory barrier since block is written by hardware. */
rmb();
@@ -7130,9 +7152,9 @@ bxe_attn_int(struct bxe_softc* sc)
DBENTER(BXE_VERBOSE_INTR);
- attn_bits = le32toh(sc->def_status_block->atten_status_block.attn_bits);
+ attn_bits = le32toh(sc->def_sb->atten_status_block.attn_bits);
attn_ack =
- le32toh(sc->def_status_block->atten_status_block.attn_bits_ack);
+ le32toh(sc->def_sb->atten_status_block.attn_bits_ack);
attn_state = sc->attn_state;
asserted = attn_bits & ~attn_ack & ~attn_state;
deasserted = ~attn_bits & attn_ack & attn_state;
@@ -7262,7 +7284,7 @@ bxe_attn_int(struct bxe_softc* sc)
#ifdef __i386__
#define BITS_PER_LONG 32
-#else /*Only support x86_64(AMD64 and EM64T)*/
+#else
#define BITS_PER_LONG 64
#endif
@@ -7290,19 +7312,19 @@ static void
bxe_stats_storm_post(struct bxe_softc *sc)
{
struct eth_query_ramrod_data ramrod_data = {0};
- int rc;
+ int i, rc;
DBENTER(BXE_INSANE_STATS);
if (!sc->stats_pending) {
ramrod_data.drv_counter = sc->stats_counter++;
ramrod_data.collect_port = sc->port.pmf ? 1 : 0;
- ramrod_data.ctr_id_vector = (1 << BP_CL_ID(sc));
+ for (i = 0; i < sc->num_queues; i++)
+ ramrod_data.ctr_id_vector |= (1 << sc->fp[i].cl_id);
rc = bxe_sp_post(sc, RAMROD_CMD_ID_ETH_STAT_QUERY, 0,
((uint32_t *)&ramrod_data)[1],
((uint32_t *)&ramrod_data)[0], 0);
-
if (rc == 0) {
/* Stats ramrod has it's own slot on the SPQ. */
sc->spq_left++;
@@ -7313,22 +7335,32 @@ bxe_stats_storm_post(struct bxe_softc *sc)
DBEXIT(BXE_INSANE_STATS);
}
+/*
+ * Setup the adrress used by the driver to report port-based statistics
+ * back to the controller.
+ *
+ * Returns:
+ * None.
+ */
static void
bxe_stats_port_base_init(struct bxe_softc *sc)
{
uint32_t *stats_comp;
struct dmae_command *dmae;
- if (!sc->port.pmf || !sc->port.port_stx) {
+ DBENTER(BXE_VERBOSE_STATS);
+
+ /* Only the port management function (PMF) does this work. */
+ if ((sc->port.pmf == 0) || !sc->port.port_stx) {
BXE_PRINTF("%s(%d): Invalid statistcs port setup!\n",
__FILE__, __LINE__);
- return;
+ goto bxe_stats_port_base_init_exit;
}
stats_comp = BXE_SP(sc, stats_comp);
+ sc->executer_idx = 0;
- sc->executer_idx = 0; /* dmae clients */
-
+ /* DMA the address of the drivers port statistics block. */
dmae = BXE_SP(sc, dmae[sc->executer_idx++]);
dmae->opcode = (DMAE_CMD_SRC_PCI | DMAE_CMD_DST_GRC |
DMAE_CMD_C_DST_PCI | DMAE_CMD_C_ENABLE |
@@ -7352,8 +7384,18 @@ bxe_stats_port_base_init(struct bxe_softc *sc)
*stats_comp = 0;
bxe_stats_hw_post(sc);
bxe_stats_comp(sc);
+
+bxe_stats_port_base_init_exit:
+ DBEXIT(BXE_VERBOSE_STATS);
}
+/*
+ * Setup the adrress used by the driver to report function-based statistics
+ * back to the controller.
+ *
+ * Returns:
+ * None.
+ */
static void
bxe_stats_func_base_init(struct bxe_softc *sc)
{
@@ -7361,12 +7403,22 @@ bxe_stats_func_base_init(struct bxe_softc *sc)
int vn, vn_max;
uint32_t func_stx;
+ DBENTER(BXE_VERBOSE_STATS);
+
+ /* Only the port management function (PMF) does this work. */
+ if ((sc->port.pmf == 0) || !sc->func_stx) {
+ BXE_PRINTF("%s(%d): Invalid statistcs function setup!\n",
+ __FILE__, __LINE__);
+ goto bxe_stats_func_base_init_exit;
+ }
+
port = BP_PORT(sc);
func_stx = sc->func_stx;
vn_max = IS_E1HMF(sc) ? E1HVN_MAX : E1VN_MAX;
+ /* Initialize each function individually. */
for (vn = VN_0; vn < vn_max; vn++) {
- func = 2*vn + port;
+ func = 2 * vn + port;
sc->func_stx = SHMEM_RD(sc, func_mb[func].fw_mb_param);
bxe_stats_func_init(sc);
bxe_stats_hw_post(sc);
@@ -7374,20 +7426,38 @@ bxe_stats_func_base_init(struct bxe_softc *sc)
}
sc->func_stx = func_stx;
+
+bxe_stats_func_base_init_exit:
+ DBEXIT(BXE_VERBOSE_STATS);
}
+/*
+ * DMA the function-based statistics to the controller.
+ *
+ * Returns:
+ * None.
+ */
static void
bxe_stats_func_base_update(struct bxe_softc *sc)
{
uint32_t *stats_comp;
struct dmae_command *dmae;
+ DBENTER(BXE_VERBOSE_STATS);
+
+ /* Only the port management function (PMF) does this work. */
+ if ((sc->port.pmf == 0) || !sc->func_stx) {
+ BXE_PRINTF("%s(%d): Invalid statistcs function update!\n",
+ __FILE__, __LINE__);
+ goto bxe_stats_func_base_update_exit;
+ }
+
dmae = &sc->stats_dmae;
stats_comp = BXE_SP(sc, stats_comp);
-
sc->executer_idx = 0;
memset(dmae, 0, sizeof(struct dmae_command));
+ /* DMA the function statistics from the driver to the H/W. */
dmae->opcode = (DMAE_CMD_SRC_GRC | DMAE_CMD_DST_PCI |
DMAE_CMD_C_DST_PCI | DMAE_CMD_C_ENABLE |
DMAE_CMD_SRC_RESET | DMAE_CMD_DST_RESET |
@@ -7410,6 +7480,9 @@ bxe_stats_func_base_update(struct bxe_softc *sc)
*stats_comp = 0;
bxe_stats_hw_post(sc);
bxe_stats_comp(sc);
+
+bxe_stats_func_base_update_exit:
+ DBEXIT(BXE_VERBOSE_STATS);
}
@@ -7428,7 +7501,7 @@ bxe_stats_init(struct bxe_softc *sc)
DBENTER(BXE_VERBOSE_STATS);
if (sc->stats_enable == FALSE)
- return;
+ goto bxe_stats_init_exit;
port = BP_PORT(sc);
func = BP_FUNC(sc);
@@ -7436,19 +7509,21 @@ bxe_stats_init(struct bxe_softc *sc)
sc->stats_counter = 0;
sc->stats_pending = 0;
- /* Fetch the offset of port statistics in shared memory. */
- if (BP_NOMCP(sc)){
+ /* Fetch the offset of port & function statistics in shared memory. */
+ if (NOMCP(sc)){
sc->port.port_stx = 0;
sc->func_stx = 0;
} else{
sc->port.port_stx = SHMEM_RD(sc, port_mb[port].port_stx);
sc->func_stx = SHMEM_RD(sc, func_mb[func].fw_mb_param);
}
- /* If this is still 0 then no management firmware running. */
+
DBPRINT(sc, BXE_VERBOSE_STATS, "%s(): sc->port.port_stx = 0x%08X\n",
__FUNCTION__, sc->port.port_stx);
+ DBPRINT(sc, BXE_VERBOSE_STATS, "%s(): sc->func_stx = 0x%08X\n",
+ __FUNCTION__, sc->func_stx);
- /* port stats */
+ /* Port statistics. */
memset(&(sc->port.old_nig_stats), 0, sizeof(struct nig_stats));
sc->port.old_nig_stats.brb_discard = REG_RD(sc,
NIG_REG_STAT0_BRB_DISCARD + port * 0x38);
@@ -7459,10 +7534,11 @@ bxe_stats_init(struct bxe_softc *sc)
REG_RD_DMAE(sc, NIG_REG_STAT0_EGRESS_MAC_PKT1 + port * 0x50,
&(sc->port.old_nig_stats.egress_mac_pkt1_lo), 2);
- /* function stats */
+ /* Function statistics. */
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
- /* Clear function statistics memory. */
+
+ /* Clear all per-queue statistics. */
memset(&fp->old_tclient, 0,
sizeof(struct tstorm_per_client_stats));
memset(&fp->old_uclient, 0,
@@ -7473,18 +7549,21 @@ bxe_stats_init(struct bxe_softc *sc)
sizeof(struct bxe_q_stats));
}
+ /* ToDo: Clear any driver specific statistics? */
+
sc->stats_state = STATS_STATE_DISABLED;
- /* Init port statistics if we're the port management function. */
- if (sc->port.pmf) {
- /* Port_stx are in 57710 when ncsi presnt & always in 57711.*/
+ if (sc->port.pmf == 1) {
+ /* Init port & function stats if we're PMF. */
if (sc->port.port_stx)
bxe_stats_port_base_init(sc);
if (sc->func_stx)
bxe_stats_func_base_init(sc);
} else if (sc->func_stx)
+ /* Update function stats if we're not PMF. */
bxe_stats_func_base_update(sc);
+bxe_stats_init_exit:
DBEXIT(BXE_VERBOSE_STATS);
}
@@ -7548,9 +7627,10 @@ bxe_stats_hw_post(struct bxe_softc *sc)
}
/*
+ * Delay routine which polls for the DMA engine to complete.
*
* Returns:
- * 1
+ * 0 = Failure, !0 = Success
*/
static int
bxe_stats_comp(struct bxe_softc *sc)
@@ -7562,6 +7642,7 @@ bxe_stats_comp(struct bxe_softc *sc)
stats_comp = BXE_SP(sc, stats_comp);
cnt = 10;
+
while (*stats_comp != DMAE_COMP_VAL) {
if (!cnt) {
BXE_PRINTF("%s(%d): Timeout waiting for statistics "
@@ -7573,11 +7654,12 @@ bxe_stats_comp(struct bxe_softc *sc)
}
DBEXIT(BXE_VERBOSE_STATS);
+ /* ToDo: Shouldn't this return the value of cnt? */
return (1);
}
/*
- * Initialize port statistics.
+ * DMA port statistcs from controller to driver.
*
* Returns:
* None.
@@ -7595,13 +7677,14 @@ bxe_stats_pmf_update(struct bxe_softc *sc)
loader_idx = PMF_DMAE_C(sc);
/* We shouldn't be here if any of the following are false. */
- if (!IS_E1HMF(sc) || !sc->port.pmf || !sc->port.port_stx) {
- DBPRINT(sc, BXE_WARN, "%s(): Bug!\n", __FUNCTION__);
+ if (!IS_E1HMF(sc) || (sc->port.pmf == 0) || !sc->port.port_stx) {
+ BXE_PRINTF("%s(%d): Statistics bug!\n", __FILE__, __LINE__);
goto bxe_stats_pmf_update_exit;
}
sc->executer_idx = 0;
+ /* Instruct DMA engine to copy port statistics from H/W to driver. */
opcode = (DMAE_CMD_SRC_GRC | DMAE_CMD_DST_PCI |
DMAE_CMD_C_DST_PCI | DMAE_CMD_C_ENABLE |
DMAE_CMD_SRC_RESET | DMAE_CMD_DST_RESET |
@@ -7638,6 +7721,7 @@ bxe_stats_pmf_update(struct bxe_softc *sc)
dmae->comp_addr_hi = U64_HI(BXE_SP_MAPPING(sc, stats_comp));
dmae->comp_val = DMAE_COMP_VAL;
+ /* Start the DMA and wait for the result. */
*stats_comp = 0;
bxe_stats_hw_post(sc);
bxe_stats_comp(sc);
@@ -7647,7 +7731,10 @@ bxe_stats_pmf_update_exit:
}
/*
- * Prepare the DMAE parameters required for port statistics.
+ * Prepare the DMAE parameters required for all statistics.
+ *
+ * This function should only be called by the driver instance
+ * that is designated as the port management function (PMF).
*
* Returns:
* None.
@@ -7666,8 +7753,8 @@ bxe_stats_port_init(struct bxe_softc *sc)
loader_idx = PMF_DMAE_C(sc);
stats_comp = BXE_SP(sc, stats_comp);
- /* Sanity check. */
- if (!sc->link_vars.link_up || !sc->port.pmf) {
+ /* Only the port management function (PMF) does this work. */
+ if (!sc->link_vars.link_up || (sc->port.pmf == 0)) {
BXE_PRINTF("%s(%d): Invalid statistics port setup!\n",
__FILE__, __LINE__);
goto bxe_stats_port_init_exit;
@@ -7675,7 +7762,7 @@ bxe_stats_port_init(struct bxe_softc *sc)
sc->executer_idx = 0;
- /* Setup statistics reporting to MCP. */
+ /* The same opcde is used for multiple DMA operations. */
opcode = (DMAE_CMD_SRC_PCI | DMAE_CMD_DST_GRC |
DMAE_CMD_C_DST_GRC | DMAE_CMD_C_ENABLE |
DMAE_CMD_SRC_RESET | DMAE_CMD_DST_RESET |
@@ -7728,7 +7815,7 @@ bxe_stats_port_init(struct bxe_softc *sc)
(vn << DMAE_CMD_E1HVN_SHIFT));
if (sc->link_vars.mac_type == MAC_TYPE_BMAC) {
- /* Enable statistics for the BMAC. */
+ /* Enable statistics for the 10Gb BMAC. */
mac_addr = (port ? NIG_REG_INGRESS_BMAC1_MEM :
NIG_REG_INGRESS_BMAC0_MEM);
@@ -7764,7 +7851,7 @@ bxe_stats_port_init(struct bxe_softc *sc)
dmae->comp_val = 1;
} else if (sc->link_vars.mac_type == MAC_TYPE_EMAC) {
- /* Enable statistics for the EMAC. */
+ /* Enable statistics for the 1Gb EMAC. */
mac_addr = (port ? GRCBASE_EMAC1 : GRCBASE_EMAC0);
@@ -7873,6 +7960,8 @@ bxe_stats_port_init_exit:
/*
* Prepare the DMAE parameters required for function statistics.
*
+ * This function is called by all driver instances.
+ *
* Returns:
* None.
*/
@@ -7884,15 +7973,14 @@ bxe_stats_func_init(struct bxe_softc *sc)
DBENTER(BXE_VERBOSE_STATS);
- dmae = &sc->stats_dmae;
- stats_comp = BXE_SP(sc, stats_comp);
-
if (!sc->func_stx) {
BXE_PRINTF("%s(%d): Invalid statistics function setup!\n",
__FILE__, __LINE__);
goto bxe_stats_func_init_exit;
}
+ dmae = &sc->stats_dmae;
+ stats_comp = BXE_SP(sc, stats_comp);
sc->executer_idx = 0;
memset(dmae, 0, sizeof(struct dmae_command));
@@ -7924,6 +8012,8 @@ bxe_stats_func_init_exit:
}
/*
+ * Starts a statistics update DMA and waits for completion.
+ *
* Returns:
* None.
*/
@@ -7933,9 +8023,8 @@ bxe_stats_start(struct bxe_softc *sc)
DBENTER(BXE_VERBOSE_STATS);
- if (sc->port.pmf)
+ if (sc->port.pmf == 1)
bxe_stats_port_init(sc);
-
else if (sc->func_stx)
bxe_stats_func_init(sc);
@@ -7978,6 +8067,7 @@ bxe_stats_restart(struct bxe_softc *sc)
}
/*
+ * Update the Big MAC (10Gb BMAC) statistics.
*
* Returns:
* None.
@@ -7987,7 +8077,7 @@ bxe_stats_bmac_update(struct bxe_softc *sc)
{
struct bmac_stats *new;
struct host_port_stats *pstats;
- struct bxe_eth_stats *estats;
+ struct bxe_port_stats *estats;
struct regpair diff;
DBENTER(BXE_INSANE_STATS);
@@ -7996,19 +8086,32 @@ bxe_stats_bmac_update(struct bxe_softc *sc)
pstats = BXE_SP(sc, port_stats);
estats = &sc->eth_stats;
- UPDATE_STAT64(rx_stat_grerb, rx_stat_ifhcinbadoctets);
- UPDATE_STAT64(rx_stat_grfcs, rx_stat_dot3statsfcserrors);
- UPDATE_STAT64(rx_stat_grund, rx_stat_etherstatsundersizepkts);
- UPDATE_STAT64(rx_stat_grovr, rx_stat_dot3statsframestoolong);
- UPDATE_STAT64(rx_stat_grfrg, rx_stat_etherstatsfragments);
- UPDATE_STAT64(rx_stat_grjbr, rx_stat_etherstatsjabbers);
- UPDATE_STAT64(rx_stat_grxcf, rx_stat_maccontrolframesreceived);
- UPDATE_STAT64(rx_stat_grxpf, rx_stat_xoffstateentered);
- UPDATE_STAT64(rx_stat_grxpf, rx_stat_bmac_xpf);
- UPDATE_STAT64(tx_stat_gtxpf, tx_stat_outxoffsent);
- UPDATE_STAT64(tx_stat_gtxpf, tx_stat_flowcontroldone);
- UPDATE_STAT64(tx_stat_gt64, tx_stat_etherstatspkts64octets);
- UPDATE_STAT64(tx_stat_gt127, tx_stat_etherstatspkts65octetsto127octets);
+ UPDATE_STAT64(rx_stat_grerb,
+ rx_stat_ifhcinbadoctets);
+ UPDATE_STAT64(rx_stat_grfcs,
+ rx_stat_dot3statsfcserrors);
+ UPDATE_STAT64(rx_stat_grund,
+ rx_stat_etherstatsundersizepkts);
+ UPDATE_STAT64(rx_stat_grovr,
+ rx_stat_dot3statsframestoolong);
+ UPDATE_STAT64(rx_stat_grfrg,
+ rx_stat_etherstatsfragments);
+ UPDATE_STAT64(rx_stat_grjbr,
+ rx_stat_etherstatsjabbers);
+ UPDATE_STAT64(rx_stat_grxcf,
+ rx_stat_maccontrolframesreceived);
+ UPDATE_STAT64(rx_stat_grxpf,
+ rx_stat_xoffstateentered);
+ UPDATE_STAT64(rx_stat_grxpf,
+ rx_stat_bmac_xpf);
+ UPDATE_STAT64(tx_stat_gtxpf,
+ tx_stat_outxoffsent);
+ UPDATE_STAT64(tx_stat_gtxpf,
+ tx_stat_flowcontroldone);
+ UPDATE_STAT64(tx_stat_gt64,
+ tx_stat_etherstatspkts64octets);
+ UPDATE_STAT64(tx_stat_gt127,
+ tx_stat_etherstatspkts65octetsto127octets);
UPDATE_STAT64(tx_stat_gt255,
tx_stat_etherstatspkts128octetsto255octets);
UPDATE_STAT64(tx_stat_gt511,
@@ -8017,19 +8120,23 @@ bxe_stats_bmac_update(struct bxe_softc *sc)
tx_stat_etherstatspkts512octetsto1023octets);
UPDATE_STAT64(tx_stat_gt1518,
tx_stat_etherstatspkts1024octetsto1522octets);
- UPDATE_STAT64(tx_stat_gt2047, tx_stat_bmac_2047);
- UPDATE_STAT64(tx_stat_gt4095, tx_stat_bmac_4095);
- UPDATE_STAT64(tx_stat_gt9216, tx_stat_bmac_9216);
- UPDATE_STAT64(tx_stat_gt16383, tx_stat_bmac_16383);
+ UPDATE_STAT64(tx_stat_gt2047,
+ tx_stat_bmac_2047);
+ UPDATE_STAT64(tx_stat_gt4095,
+ tx_stat_bmac_4095);
+ UPDATE_STAT64(tx_stat_gt9216,
+ tx_stat_bmac_9216);
+ UPDATE_STAT64(tx_stat_gt16383,
+ tx_stat_bmac_16383);
UPDATE_STAT64(tx_stat_gterr,
tx_stat_dot3statsinternalmactransmiterrors);
- UPDATE_STAT64(tx_stat_gtufl, tx_stat_bmac_ufl);
+ UPDATE_STAT64(tx_stat_gtufl,
+ tx_stat_bmac_ufl);
estats->pause_frames_received_hi =
pstats->mac_stx[1].rx_stat_bmac_xpf_hi;
estats->pause_frames_received_lo =
pstats->mac_stx[1].rx_stat_bmac_xpf_lo;
-
estats->pause_frames_sent_hi =
pstats->mac_stx[1].tx_stat_outxoffsent_hi;
estats->pause_frames_sent_lo =
@@ -8039,6 +8146,8 @@ bxe_stats_bmac_update(struct bxe_softc *sc)
}
/*
+ * Update the Ethernet MAC (1Gb EMAC) statistics.
+ *
* Returns:
* None.
*/
@@ -8047,7 +8156,7 @@ bxe_stats_emac_update(struct bxe_softc *sc)
{
struct emac_stats *new;
struct host_port_stats *pstats;
- struct bxe_eth_stats *estats;
+ struct bxe_port_stats *estats;
DBENTER(BXE_INSANE_STATS);
@@ -8092,9 +8201,9 @@ bxe_stats_emac_update(struct bxe_softc *sc)
estats->pause_frames_received_lo =
pstats->mac_stx[1].rx_stat_xonpauseframesreceived_lo;
ADD_64(estats->pause_frames_received_hi,
- pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_hi,
- estats->pause_frames_received_lo,
- pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_lo);
+ pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_hi,
+ estats->pause_frames_received_lo,
+ pstats->mac_stx[1].rx_stat_xoffpauseframesreceived_lo);
estats->pause_frames_sent_hi =
pstats->mac_stx[1].tx_stat_outxonsent_hi;
@@ -8117,7 +8226,7 @@ bxe_stats_hw_update(struct bxe_softc *sc)
{
struct nig_stats *new, *old;
struct host_port_stats *pstats;
- struct bxe_eth_stats *estats;
+ struct bxe_port_stats *estats;
struct regpair diff;
uint32_t nig_timer_max;
int rc;
@@ -8162,12 +8271,15 @@ bxe_stats_hw_update(struct bxe_softc *sc)
pstats->host_port_stats_start = ++pstats->host_port_stats_end;
- nig_timer_max = SHMEM_RD(sc, port_mb[BP_PORT(sc)].stat_nig_timer);
- if (nig_timer_max != estats->nig_timer_max) {
- estats->nig_timer_max = nig_timer_max;
- DBPRINT(sc, BXE_WARN,
- "%s(): NIG timer reached max value (%u)!\n", __FUNCTION__,
- estats->nig_timer_max);
+ if (!NOMCP(sc)) {
+ nig_timer_max =
+ SHMEM_RD(sc, port_mb[BP_PORT(sc)].stat_nig_timer);
+ if (nig_timer_max != estats->nig_timer_max) {
+ estats->nig_timer_max = nig_timer_max;
+ DBPRINT(sc, BXE_WARN,
+ "%s(): NIG timer reached max value (%u)!\n",
+ __FUNCTION__, estats->nig_timer_max);
+ }
}
bxe_stats_hw_update_exit:
@@ -8179,12 +8291,15 @@ bxe_stats_hw_update_exit:
* Returns:
* 0 = Success, !0 = Failure.
*/
+// DRC - Done
static int
bxe_stats_storm_update(struct bxe_softc *sc)
{
int rc, i, cl_id;
struct eth_stats_query *stats;
+ struct bxe_port_stats *estats;
struct host_func_stats *fstats;
+ struct bxe_q_stats *qstats;
struct tstorm_per_port_stats *tport;
struct tstorm_per_client_stats *tclient;
struct ustorm_per_client_stats *uclient;
@@ -8192,72 +8307,66 @@ bxe_stats_storm_update(struct bxe_softc *sc)
struct tstorm_per_client_stats *old_tclient;
struct ustorm_per_client_stats *old_uclient;
struct xstorm_per_client_stats *old_xclient;
- struct bxe_eth_stats *estats;
- struct bxe_q_stats *qstats;
struct bxe_fastpath * fp;
uint32_t diff;
DBENTER(BXE_INSANE_STATS);
rc = 0;
+ diff = 0;
stats = BXE_SP(sc, fw_stats);
tport = &stats->tstorm_common.port_statistics;
-
fstats = BXE_SP(sc, func_stats);
+
memcpy(&(fstats->total_bytes_received_hi),
&(BXE_SP(sc, func_stats_base)->total_bytes_received_hi),
- sizeof(struct host_func_stats) - 2*sizeof(uint32_t));
+ sizeof(struct host_func_stats) - 2 * sizeof(uint32_t));
- diff = 0;
estats = &sc->eth_stats;
estats->no_buff_discard_hi = 0;
estats->no_buff_discard_lo = 0;
estats->error_bytes_received_hi = 0;
estats->error_bytes_received_lo = 0;
-/* estats->etherstatsoverrsizepkts_hi = 0;
+ estats->etherstatsoverrsizepkts_hi = 0;
estats->etherstatsoverrsizepkts_lo = 0;
-*/
+
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
cl_id = fp->cl_id;
tclient = &stats->tstorm_common.client_statistics[cl_id];
- uclient = &stats->ustorm_common.client_statistics[cl_id];
- xclient = &stats->xstorm_common.client_statistics[cl_id];
old_tclient = &fp->old_tclient;
+ uclient = &stats->ustorm_common.client_statistics[cl_id];
old_uclient = &fp->old_uclient;
+ xclient = &stats->xstorm_common.client_statistics[cl_id];
old_xclient = &fp->old_xclient;
qstats = &fp->eth_q_stats;
- /* Are STORM statistics valid? */
+ /* Are TSTORM statistics valid? */
if ((uint16_t)(le16toh(tclient->stats_counter) + 1) !=
sc->stats_counter) {
-#if 0
DBPRINT(sc, BXE_WARN, "%s(): Stats not updated by TSTORM "
"(tstorm counter (%d) != stats_counter (%d))!\n",
__FUNCTION__, tclient->stats_counter, sc->stats_counter);
-#endif
rc = 1;
goto bxe_stats_storm_update_exit;
}
+ /* Are USTORM statistics valid? */
if ((uint16_t)(le16toh(uclient->stats_counter) + 1) !=
sc->stats_counter) {
-#if 0
DBPRINT(sc, BXE_WARN, "%s(): Stats not updated by USTORM "
"(ustorm counter (%d) != stats_counter (%d))!\n",
__FUNCTION__, uclient->stats_counter, sc->stats_counter);
-#endif
rc = 2;
goto bxe_stats_storm_update_exit;
}
+ /* Are XSTORM statistics valid? */
if ((uint16_t)(le16toh(xclient->stats_counter) + 1) !=
sc->stats_counter) {
-#if 0
DBPRINT(sc, BXE_WARN, "%s(): Stats not updated by XSTORM "
"(xstorm counter (%d) != stats_counter (%d))!\n",
__FUNCTION__, xclient->stats_counter, sc->stats_counter);
-#endif
rc = 3;
goto bxe_stats_storm_update_exit;
}
@@ -8313,9 +8422,8 @@ bxe_stats_storm_update(struct bxe_softc *sc)
total_multicast_packets_received);
UPDATE_EXTEND_TSTAT(rcv_broadcast_pkts,
total_broadcast_packets_received);
-/* UPDATE_EXTEND_TSTAT(packets_too_big_discard,
- etherstatsoverrsizepkts);
-*/
+ UPDATE_EXTEND_TSTAT(packets_too_big_discard,
+ etherstatsoverrsizepkts);
UPDATE_EXTEND_TSTAT(no_buff_discard, no_buff_discard);
SUB_EXTEND_USTAT(ucast_no_buff_pkts,
@@ -8329,19 +8437,19 @@ bxe_stats_storm_update(struct bxe_softc *sc)
UPDATE_EXTEND_USTAT(bcast_no_buff_pkts, no_buff_discard);
qstats->total_bytes_transmitted_hi =
- (xclient->unicast_bytes_sent.hi);
+ le32toh(xclient->unicast_bytes_sent.hi);
qstats->total_bytes_transmitted_lo =
- (xclient->unicast_bytes_sent.lo);
+ le32toh(xclient->unicast_bytes_sent.lo);
ADD_64(qstats->total_bytes_transmitted_hi,
- (xclient->multicast_bytes_sent.hi),
+ le32toh(xclient->multicast_bytes_sent.hi),
qstats->total_bytes_transmitted_lo,
- (xclient->multicast_bytes_sent.lo));
+ le32toh(xclient->multicast_bytes_sent.lo));
ADD_64(qstats->total_bytes_transmitted_hi,
- (xclient->broadcast_bytes_sent.hi),
+ le32toh(xclient->broadcast_bytes_sent.hi),
qstats->total_bytes_transmitted_lo,
- (xclient->broadcast_bytes_sent.lo));
+ le32toh(xclient->broadcast_bytes_sent.lo));
UPDATE_EXTEND_XSTAT(unicast_pkts_sent,
total_unicast_packets_transmitted);
@@ -8356,63 +8464,72 @@ bxe_stats_storm_update(struct bxe_softc *sc)
old_tclient->ttl0_discard = tclient->ttl0_discard;
ADD_64(fstats->total_bytes_received_hi,
- qstats->total_bytes_received_hi,
- fstats->total_bytes_received_lo,
- qstats->total_bytes_received_lo);
+ qstats->total_bytes_received_hi,
+ fstats->total_bytes_received_lo,
+ qstats->total_bytes_received_lo);
ADD_64(fstats->total_bytes_transmitted_hi,
- qstats->total_bytes_transmitted_hi,
- fstats->total_bytes_transmitted_lo,
- qstats->total_bytes_transmitted_lo);
+ qstats->total_bytes_transmitted_hi,
+ fstats->total_bytes_transmitted_lo,
+ qstats->total_bytes_transmitted_lo);
ADD_64(fstats->total_unicast_packets_received_hi,
- qstats->total_unicast_packets_received_hi,
- fstats->total_unicast_packets_received_lo,
- qstats->total_unicast_packets_received_lo);
+ qstats->total_unicast_packets_received_hi,
+ fstats->total_unicast_packets_received_lo,
+ qstats->total_unicast_packets_received_lo);
ADD_64(fstats->total_multicast_packets_received_hi,
- qstats->total_multicast_packets_received_hi,
- fstats->total_multicast_packets_received_lo,
- qstats->total_multicast_packets_received_lo);
+ qstats->total_multicast_packets_received_hi,
+ fstats->total_multicast_packets_received_lo,
+ qstats->total_multicast_packets_received_lo);
ADD_64(fstats->total_broadcast_packets_received_hi,
- qstats->total_broadcast_packets_received_hi,
- fstats->total_broadcast_packets_received_lo,
- qstats->total_broadcast_packets_received_lo);
+ qstats->total_broadcast_packets_received_hi,
+ fstats->total_broadcast_packets_received_lo,
+ qstats->total_broadcast_packets_received_lo);
ADD_64(fstats->total_unicast_packets_transmitted_hi,
- qstats->total_unicast_packets_transmitted_hi,
- fstats->total_unicast_packets_transmitted_lo,
- qstats->total_unicast_packets_transmitted_lo);
+ qstats->total_unicast_packets_transmitted_hi,
+ fstats->total_unicast_packets_transmitted_lo,
+ qstats->total_unicast_packets_transmitted_lo);
ADD_64(fstats->total_multicast_packets_transmitted_hi,
- qstats->total_multicast_packets_transmitted_hi,
- fstats->total_multicast_packets_transmitted_lo,
- qstats->total_multicast_packets_transmitted_lo);
+ qstats->total_multicast_packets_transmitted_hi,
+ fstats->total_multicast_packets_transmitted_lo,
+ qstats->total_multicast_packets_transmitted_lo);
ADD_64(fstats->total_broadcast_packets_transmitted_hi,
- qstats->total_broadcast_packets_transmitted_hi,
- fstats->total_broadcast_packets_transmitted_lo,
- qstats->total_broadcast_packets_transmitted_lo);
+ qstats->total_broadcast_packets_transmitted_hi,
+ fstats->total_broadcast_packets_transmitted_lo,
+ qstats->total_broadcast_packets_transmitted_lo);
ADD_64(fstats->valid_bytes_received_hi,
- qstats->valid_bytes_received_hi,
- fstats->valid_bytes_received_lo,
- qstats->valid_bytes_received_lo);
+ qstats->valid_bytes_received_hi,
+ fstats->valid_bytes_received_lo,
+ qstats->valid_bytes_received_lo);
ADD_64(estats->error_bytes_received_hi,
- qstats->error_bytes_received_hi,
- estats->error_bytes_received_lo,
- qstats->error_bytes_received_lo);
-
- ADD_64(estats->no_buff_discard_hi, qstats->no_buff_discard_hi,
- estats->no_buff_discard_lo, qstats->no_buff_discard_lo);
+ qstats->error_bytes_received_hi,
+ estats->error_bytes_received_lo,
+ qstats->error_bytes_received_lo);
+ ADD_64(estats->etherstatsoverrsizepkts_hi,
+ qstats->etherstatsoverrsizepkts_hi,
+ estats->etherstatsoverrsizepkts_lo,
+ qstats->etherstatsoverrsizepkts_lo);
+ ADD_64(estats->no_buff_discard_hi,
+ qstats->no_buff_discard_hi,
+ estats->no_buff_discard_lo,
+ qstats->no_buff_discard_lo);
}
ADD_64(fstats->total_bytes_received_hi,
- estats->rx_stat_ifhcinbadoctets_hi,
- fstats->total_bytes_received_lo,
- estats->rx_stat_ifhcinbadoctets_lo);
+ estats->rx_stat_ifhcinbadoctets_hi,
+ fstats->total_bytes_received_lo,
+ estats->rx_stat_ifhcinbadoctets_lo);
memcpy(estats, &(fstats->total_bytes_received_hi),
- sizeof(struct host_func_stats) - 2*sizeof(uint32_t));
+ sizeof(struct host_func_stats) - 2 * sizeof(uint32_t));
+ ADD_64(estats->etherstatsoverrsizepkts_hi,
+ estats->rx_stat_dot3statsframestoolong_hi,
+ estats->etherstatsoverrsizepkts_lo,
+ estats->rx_stat_dot3statsframestoolong_lo);
ADD_64(estats->error_bytes_received_hi,
- estats->rx_stat_ifhcinbadoctets_hi,
- estats->error_bytes_received_lo,
- estats->rx_stat_ifhcinbadoctets_lo);
+ estats->rx_stat_ifhcinbadoctets_hi,
+ estats->error_bytes_received_lo,
+ estats->rx_stat_ifhcinbadoctets_lo);
if (sc->port.pmf) {
estats->mac_filter_discard =
@@ -8431,7 +8548,7 @@ bxe_stats_storm_update(struct bxe_softc *sc)
bxe_stats_storm_update_exit:
DBEXIT(BXE_INSANE_STATS);
- return(rc);
+ return (rc);
}
/*
@@ -8444,7 +8561,7 @@ static void
bxe_stats_net_update(struct bxe_softc *sc)
{
struct tstorm_per_client_stats *old_tclient;
- struct bxe_eth_stats *estats;
+ struct bxe_port_stats *estats;
struct ifnet *ifp;
DBENTER(BXE_INSANE_STATS);
@@ -8469,7 +8586,6 @@ bxe_stats_net_update(struct bxe_softc *sc)
(u_long) estats->no_buff_discard_lo +
(u_long) estats->mac_discard +
(u_long) estats->rx_stat_etherstatsundersizepkts_lo +
- (u_long) estats->jabber_packets_received +
(u_long) estats->brb_drop_lo +
(u_long) estats->brb_truncate_discard +
(u_long) estats->rx_stat_dot3statsfcserrors_lo +
@@ -8515,7 +8631,7 @@ bxe_stats_update(struct bxe_softc *sc)
goto bxe_stats_update_exit;
/* Check for any hardware statistics updates. */
- if (sc->port.pmf)
+ if (sc->port.pmf == 1)
update = (bxe_stats_hw_update(sc) == 0);
/* Check for any STORM statistics updates. */
@@ -8637,10 +8753,11 @@ bxe_stats_stop(struct bxe_softc *sc)
DBENTER(BXE_VERBOSE_STATS);
update = 0;
+
/* Wait for any pending completions. */
bxe_stats_comp(sc);
- if (sc->port.pmf)
+ if (sc->port.pmf == 1)
update = (bxe_stats_hw_update(sc) == 0);
update |= (bxe_stats_storm_update(sc) == 0);
@@ -8648,7 +8765,7 @@ bxe_stats_stop(struct bxe_softc *sc)
if (update) {
bxe_stats_net_update(sc);
- if (sc->port.pmf)
+ if (sc->port.pmf == 1)
bxe_stats_port_stop(sc);
bxe_stats_hw_post(sc);
@@ -8667,7 +8784,8 @@ bxe_stats_stop(struct bxe_softc *sc)
static void
bxe_stats_do_nothing(struct bxe_softc *sc)
{
-
+ DBENTER(BXE_VERBOSE_STATS);
+ DBEXIT(BXE_VERBOSE_STATS);
}
static const struct {
@@ -8701,9 +8819,10 @@ bxe_stats_handle(struct bxe_softc *sc, enum bxe_stats_event event)
{
enum bxe_stats_state state;
- DBENTER(BXE_INSANE_STATS);
+ DBENTER(BXE_EXTREME_STATS);
state = sc->stats_state;
+
#ifdef BXE_DEBUG
if (event != STATS_EVENT_UPDATE)
DBPRINT(sc, BXE_VERBOSE_STATS,
@@ -8720,7 +8839,7 @@ bxe_stats_handle(struct bxe_softc *sc, enum bxe_stats_event event)
__FUNCTION__, sc->stats_state);
#endif
- DBEXIT(BXE_INSANE_STATS);
+ DBEXIT(BXE_EXTREME_STATS);
}
/*
@@ -8798,167 +8917,137 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head)
struct eth_tx_bd *tx_data_bd;
struct eth_tx_bd *tx_total_pkt_size_bd;
struct eth_tx_start_bd *tx_start_bd;
- uint16_t etype, bd_prod, pkt_prod, total_pkt_size;
+ uint16_t etype, sw_tx_bd_prod, sw_pkt_prod, total_pkt_size;
+// uint16_t bd_index, pkt_index;
uint8_t mac_type;
- int i, e_hlen, error, nsegs, rc, nbds, vlan_off, ovlan;
+ int i, defragged, e_hlen, error, nsegs, rc, nbds, vlan_off, ovlan;
struct bxe_softc *sc;
sc = fp->sc;
DBENTER(BXE_VERBOSE_SEND);
- rc = nbds = ovlan = vlan_off = total_pkt_size = 0;
+ DBRUN(M_ASSERTPKTHDR(*m_head));
m0 = *m_head;
-
- tx_total_pkt_size_bd = NULL;
+ rc = defragged = nbds = ovlan = vlan_off = total_pkt_size = 0;
tx_start_bd = NULL;
tx_data_bd = NULL;
tx_parse_bd = NULL;
+ tx_total_pkt_size_bd = NULL;
- pkt_prod = fp->tx_pkt_prod;
- bd_prod = TX_BD(fp->tx_bd_prod);
+ /* Get the H/W pointer (0 to 65535) for packets and BD's. */
+ sw_pkt_prod = fp->tx_pkt_prod;
+ sw_tx_bd_prod = fp->tx_bd_prod;
- mac_type = UNICAST_ADDRESS;
+ /* Create the S/W index (0 to MAX_TX_BD) for packets and BD's. */
+// pkt_index = TX_BD(sw_pkt_prod);
+// bd_index = TX_BD(sw_tx_bd_prod);
-#ifdef BXE_DEBUG
- int debug_prod;
- DBRUN(debug_prod = bd_prod);
-#endif
+ mac_type = UNICAST_ADDRESS;
/* Map the mbuf into the next open DMAable memory. */
- map = fp->tx_mbuf_map[TX_BD(pkt_prod)];
+ map = fp->tx_mbuf_map[TX_BD(sw_pkt_prod)];
error = bus_dmamap_load_mbuf_sg(fp->tx_mbuf_tag, map, m0,
segs, &nsegs, BUS_DMA_NOWAIT);
- do{
- /* Handle any mapping errors. */
- if(__predict_false(error)){
- fp->tx_dma_mapping_failure++;
- if (error == ENOMEM) {
- /* Resource issue, try again later. */
- rc = ENOMEM;
- }else if (error == EFBIG) {
- /* Possibly recoverable. */
- fp->mbuf_defrag_attempts++;
- m0 = m_defrag(*m_head, M_DONTWAIT);
- if (m0 == NULL) {
- fp->mbuf_defrag_failures++;
- rc = ENOBUFS;
- } else {
- /* Defrag was successful, try mapping again.*/
- fp->mbuf_defrag_successes++;
- *m_head = m0;
- error =
- bus_dmamap_load_mbuf_sg(
- fp->tx_mbuf_tag, map, m0,
- segs, &nsegs, BUS_DMA_NOWAIT);
- if (error) {
- fp->tx_dma_mapping_failure++;
- rc = error;
- }
- }
- }else {
- /* Unrecoverable. */
- DBPRINT(sc, BXE_WARN_SEND,
- "%s(): Unknown TX mapping error! "
- "rc = %d.\n", __FUNCTION__, error);
- DBRUN(bxe_dump_mbuf(sc, m0));
- rc = error;
- }
-
- break;
- }
-
- /* Make sure this enough room in the send queue. */
- if (__predict_false((nsegs + 2) >
- (USABLE_TX_BD - fp->used_tx_bd))) {
- fp->tx_queue_too_full++;
- bus_dmamap_unload(fp->tx_mbuf_tag, map);
- rc = ENOBUFS;
- break;
- }
-
- /* Now make sure it fits in the pkt window */
- if (__predict_false(nsegs > 12)) {
-
- /*
- * The mbuf may be to big for the controller
- * to handle. If the frame is a TSO frame
- * we'll need to do an additional check.
- */
- if(m0->m_pkthdr.csum_flags & CSUM_TSO){
- if (bxe_chktso_window(sc,nsegs,segs,m0) == 0)
- /* OK to send. */
- break;
- else
- fp->window_violation_tso++;
- } else
- fp->window_violation_std++;
-
- /*
- * If this is a standard frame then defrag is
- * required. Unmap the mbuf, defrag it, then
- * try mapping it again.
- */
+ /* Handle any mapping errors. */
+ if(__predict_false(error != 0)){
+ fp->tx_dma_mapping_failure++;
+ if (error == ENOMEM) {
+ /* Resource issue, try again later. */
+ rc = ENOMEM;
+ } else if (error == EFBIG) {
+ /* Possibly recoverable with defragmentation. */
fp->mbuf_defrag_attempts++;
- bus_dmamap_unload(fp->tx_mbuf_tag, map);
m0 = m_defrag(*m_head, M_DONTWAIT);
if (m0 == NULL) {
fp->mbuf_defrag_failures++;
rc = ENOBUFS;
- break;
+ } else {
+ /* Defrag successful, try mapping again.*/
+ *m_head = m0;
+ error = bus_dmamap_load_mbuf_sg(
+ fp->tx_mbuf_tag, map, m0,
+ segs, &nsegs, BUS_DMA_NOWAIT);
+ if (error) {
+ fp->tx_dma_mapping_failure++;
+ rc = error;
+ }
}
+ } else {
+ /* Unknown, unrecoverable mapping error. */
+ DBPRINT(sc, BXE_WARN_SEND,
+ "%s(): Unknown TX mapping error! "
+ "rc = %d.\n", __FUNCTION__, error);
+ DBRUN(bxe_dump_mbuf(sc, m0));
+ rc = error;
+ }
- /* Defrag was successful, try mapping again. */
- fp->mbuf_defrag_successes++;
- *m_head = m0;
- error =
- bus_dmamap_load_mbuf_sg(
- fp->tx_mbuf_tag, map, m0,
- segs, &nsegs, BUS_DMA_NOWAIT);
-
- /* Handle any mapping errors. */
- if (__predict_false(error)) {
- fp->tx_dma_mapping_failure++;
- rc = error;
- break;
- }
+ goto bxe_tx_encap_continue;
+ }
- /* Last try */
- if (m0->m_pkthdr.csum_flags & CSUM_TSO){
- if (bxe_chktso_window(sc,nsegs,segs,m0) == 1)
- rc = ENOBUFS;
- } else if (nsegs > 12 ){
- rc = ENOBUFS;
- } else
- rc = 0;
- }
- }while (0);
+ /* Make sure there's enough room in the send queue. */
+ if (__predict_false((nsegs + 2) >
+ (USABLE_TX_BD - fp->tx_bd_used))) {
+ /* Recoverable, try again later. */
+ fp->tx_hw_queue_full++;
+ bus_dmamap_unload(fp->tx_mbuf_tag, map);
+ rc = ENOMEM;
+ goto bxe_tx_encap_continue;
+ }
+
+ /* Capture the current H/W TX chain high watermark. */
+ if (__predict_false(fp->tx_hw_max_queue_depth <
+ fp->tx_bd_used))
+ fp->tx_hw_max_queue_depth = fp->tx_bd_used;
+
+ /* Now make sure it fits in the packet window. */
+ if (__predict_false(nsegs > 12)) {
+ /*
+ * The mbuf may be to big for the controller
+ * to handle. If the frame is a TSO frame
+ * we'll need to do an additional check.
+ */
+ if(m0->m_pkthdr.csum_flags & CSUM_TSO){
+ if (bxe_chktso_window(sc,nsegs,segs,m0) == 0)
+ /* OK to send. */
+ goto bxe_tx_encap_continue;
+ else
+ fp->tx_window_violation_tso++;
+ } else
+ fp->tx_window_violation_std++;
+ /* No sense trying to defrag again, we'll drop the frame. */
+ if (defragged > 0)
+ rc = ENODEV;
+ }
+
+bxe_tx_encap_continue:
/* Check for errors */
if (rc){
if(rc == ENOMEM){
/* Recoverable try again later */
}else{
- fp->soft_tx_errors++;
- DBRUN(fp->tx_mbuf_alloc--);
+ fp->tx_soft_errors++;
+ fp->tx_mbuf_alloc--;
m_freem(*m_head);
*m_head = NULL;
}
- return (rc);
+ goto bxe_tx_encap_exit;
}
- /* We're committed to sending the frame, update the counter. */
- fp->tx_pkt_prod++;
+ /* Save the mbuf and mapping. */
+ fp->tx_mbuf_ptr[TX_BD(sw_pkt_prod)] = m0;
+ fp->tx_mbuf_map[TX_BD(sw_pkt_prod)] = map;
- /* set flag according to packet type (UNICAST_ADDRESS is default)*/
+ /* Set flag according to packet type (UNICAST_ADDRESS is default). */
if (m0->m_flags & M_BCAST)
mac_type = BROADCAST_ADDRESS;
else if (m0->m_flags & M_MCAST)
mac_type = MULTICAST_ADDRESS;
- /* Prepare the first transmit BD for the mbuf(Get a link from the chain). */
- tx_start_bd = &fp->tx_bd_chain[TX_PAGE(bd_prod)][TX_IDX(bd_prod)].start_bd;
+ /* Prepare the first transmit (Start) BD for the mbuf. */
+ tx_start_bd = &fp->tx_chain[TX_BD(sw_tx_bd_prod)].start_bd;
tx_start_bd->addr_lo = htole32(U64_LO(segs[0].ds_addr));
tx_start_bd->addr_hi = htole32(U64_HI(segs[0].ds_addr));
@@ -8970,32 +9059,29 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head)
tx_start_bd->general_data |= (1 << ETH_TX_START_BD_HDR_NBDS_SHIFT);
- nbds = nsegs + 1; /* Add 1 for parsing bd. Assuming nseg > 0 */
+ /* All frames have at least Start BD + Parsing BD. */
+ nbds = nsegs + 1;
tx_start_bd->nbd = htole16(nbds);
if (m0->m_flags & M_VLANTAG) {
-// vlan_off += ETHER_VLAN_ENCAP_LEN;
tx_start_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_VLAN_TAG;
tx_start_bd->vlan = htole16(m0->m_pkthdr.ether_vtag);
- DBPRINT(sc, BXE_VERBOSE_SEND, "%s(): Inserting VLAN tag %d\n",
- __FUNCTION__, m0->m_pkthdr.ether_vtag);
- }
- else
+ } else
/*
* In cases where the VLAN tag is not used the firmware
* expects to see a packet counter in the VLAN tag field
* Failure to do so will cause an assertion which will
* stop the controller.
*/
- tx_start_bd->vlan = htole16(pkt_prod);
+ tx_start_bd->vlan = htole16(fp->tx_pkt_prod);
/*
- * Add a parsing BD from the chain. The parsing bd is always added,
- * however, it is only used for tso & chksum.
+ * Add a parsing BD from the chain. The parsing BD is always added,
+ * however, it is only used for TSO & chksum.
*/
- bd_prod = TX_BD(NEXT_TX_BD(bd_prod));
+ sw_tx_bd_prod = NEXT_TX_BD(sw_tx_bd_prod);
tx_parse_bd = (struct eth_tx_parse_bd *)
- &fp->tx_bd_chain[TX_PAGE(bd_prod)][TX_IDX(bd_prod)].parse_bd;
+ &fp->tx_chain[TX_BD(sw_tx_bd_prod)].parse_bd;
memset(tx_parse_bd, 0, sizeof(struct eth_tx_parse_bd));
/* Gather all info about the packet and add to tx_parse_bd */
@@ -9006,7 +9092,7 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head)
uint16_t flags = 0;
struct udphdr *uh = NULL;
- /* Map the Ethernet header to find the type & header length. */
+ /* Map Ethernet header to find type & header length. */
eh = mtod(m0, struct ether_vlan_header *);
/* Handle VLAN encapsulation if present. */
@@ -9024,23 +9110,22 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head)
ETH_TX_PARSE_BD_LLC_SNAP_EN_SHIFT);
switch (etype) {
- case ETHERTYPE_IP:{
- /* if mbuf's len < 20bytes, the ip_hdr is in next mbuf*/
+ case ETHERTYPE_IP:
+ /* If mbuf len < 20bytes, IP header is in next mbuf. */
if (m0->m_len < sizeof(struct ip))
- ip = (struct ip *)m0->m_next->m_data;
+ ip = (struct ip *) m0->m_next->m_data;
else
- ip = (struct ip *)(m0->m_data + e_hlen);
+ ip = (struct ip *) (m0->m_data + e_hlen);
/* Calculate IP header length (16 bit words). */
tx_parse_bd->ip_hlen = (ip->ip_hl << 1);
/* Calculate enet + IP header length (16 bit words). */
- tx_parse_bd->total_hlen = tx_parse_bd->ip_hlen + (e_hlen >> 1);
+ tx_parse_bd->total_hlen = tx_parse_bd->ip_hlen +
+ (e_hlen >> 1);
if (m0->m_pkthdr.csum_flags & CSUM_IP) {
- DBPRINT(sc, BXE_EXTREME_SEND, "%s(): IP checksum "
- "enabled.\n", __FUNCTION__);
- fp->offload_frames_csum_ip++;
+ fp->tx_offload_frames_csum_ip++;
flags |= ETH_TX_BD_FLAGS_IP_CSUM;
}
@@ -9048,132 +9133,130 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head)
if ((m0->m_pkthdr.csum_flags & CSUM_TCP)||
(m0->m_pkthdr.csum_flags & CSUM_TSO)){
- /* Perform TCP checksum offload. */
- DBPRINT(sc, BXE_EXTREME_SEND, "%s(): TCP checksum "
- "enabled.\n", __FUNCTION__);
-
/* Get the TCP header. */
- th = (struct tcphdr *)((caddr_t)ip + (ip->ip_hl << 2));
+ th = (struct tcphdr *)((caddr_t)ip +
+ (ip->ip_hl << 2));
/* Add the TCP checksum offload flag. */
flags |= ETH_TX_BD_FLAGS_L4_CSUM;
- fp->offload_frames_csum_tcp++;
+ fp->tx_offload_frames_csum_tcp++;
/* Update the enet + IP + TCP header length. */
- tx_parse_bd->total_hlen += (uint16_t)(th->th_off << 1);
+ tx_parse_bd->total_hlen +=
+ (uint16_t)(th->th_off << 1);
/* Get the pseudo header checksum. */
- tx_parse_bd->tcp_pseudo_csum = ntohs(th->th_sum);
+ tx_parse_bd->tcp_pseudo_csum =
+ ntohs(th->th_sum);
+
} else if (m0->m_pkthdr.csum_flags & CSUM_UDP) {
/*
- * The hardware doesn't actually support UDP checksum
- * offload but we can fake it by doing TCP checksum
- * offload and factoring out the extra bytes that are
- * different between the TCP header and the UDP header.
- * calculation will begin 10 bytes before the actual
- * start of the UDP header. To work around this we
- * need to calculate the checksum of the 10 bytes
- * before the UDP header and factor that out of the
- * UDP pseudo header checksum before asking the H/W
- * to calculate the full UDP checksum.
+ * The hardware doesn't actually support UDP
+ * checksum offload but we can fake it by
+ * doing TCP checksum offload and factoring
+ * out the extra bytes that are different
+ * between the TCP header and the UDP header.
+ *
+ * Calculation will begin 10 bytes before the
+ * actual start of the UDP header. To work
+ * around this we need to calculate the
+ * checksum of the 10 bytes before the UDP
+ * header and factor that out of the UDP
+ * pseudo header checksum before asking the
+ * H/W to calculate the full UDP checksum.
*/
uint16_t tmp_csum;
uint32_t *tmp_uh;
/* This value is 10. */
- uint8_t fix = (uint8_t) (offsetof(struct tcphdr, th_sum) -
- (int) offsetof(struct udphdr, uh_sum));
-
- /* Perform UDP checksum offload. */
- DBPRINT(sc, BXE_EXTREME_SEND, "%s(): UDP checksum "
- "enabled.\n", __FUNCTION__);
+ uint8_t fix = (uint8_t) (offsetof(struct tcphdr, th_sum) -
+ (int) offsetof(struct udphdr, uh_sum));
- /* Add the TCP checksum offload flag for UDP frames too. */
+ /*
+ * Add the TCP checksum offload flag for
+ * UDP frames too.*
+ */
flags |= ETH_TX_BD_FLAGS_L4_CSUM;
- fp->offload_frames_csum_udp++;
- tx_parse_bd->global_data |= ETH_TX_PARSE_BD_UDP_CS_FLG;
+ fp->tx_offload_frames_csum_udp++;
+ tx_parse_bd->global_data |=
+ ETH_TX_PARSE_BD_UDP_CS_FLG;
/* Get a pointer to the UDP header. */
- uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
+ uh = (struct udphdr *)((caddr_t)ip +
+ (ip->ip_hl << 2));
- /* Set a pointer 10 bytes before the actual UDP header. */
- tmp_uh = (uint32_t *)((uint8_t *)uh - fix);
+ /* Set pointer 10 bytes before UDP header. */
+ tmp_uh = (uint32_t *)((uint8_t *)uh -
+ fix);
/*
- * Calculate a pseudo header checksum over the 10 bytes
- * before the UDP header.
+ * Calculate a pseudo header checksum over
+ * the 10 bytes before the UDP header.
*/
tmp_csum = in_pseudo(ntohl(*tmp_uh),
- ntohl(*(tmp_uh + 1)),
- ntohl((*(tmp_uh + 2)) & 0x0000FFFF));
+ ntohl(*(tmp_uh + 1)),
+ ntohl((*(tmp_uh + 2)) & 0x0000FFFF));
/* Update the enet + IP + UDP header length. */
- tx_parse_bd->total_hlen += (sizeof(struct udphdr) >> 1);
- tx_parse_bd->tcp_pseudo_csum = ~in_addword(uh->uh_sum, ~tmp_csum);
+ tx_parse_bd->total_hlen +=
+ (sizeof(struct udphdr) >> 1);
+ tx_parse_bd->tcp_pseudo_csum =
+ ~in_addword(uh->uh_sum, ~tmp_csum);
}
- /* Update the flags settings for VLAN/Offload. */
+ /* Update the offload flags. */
tx_start_bd->bd_flags.as_bitfield |= flags;
-
break;
- }
+
case ETHERTYPE_IPV6:
- fp->unsupported_tso_request_ipv6++;
- /* DRC - How to handle this error? */
+ fp->tx_unsupported_tso_request_ipv6++;
+ /* ToDo: Add IPv6 support. */
break;
default:
- fp->unsupported_tso_request_not_tcp++;
- /* DRC - How to handle this error? */
+ fp->tx_unsupported_tso_request_not_tcp++;
+ /* ToDo - How to handle this error? */
}
/* Setup the Parsing BD with TSO specific info */
if (m0->m_pkthdr.csum_flags & CSUM_TSO) {
-
uint16_t hdr_len = tx_parse_bd->total_hlen << 1;
- DBPRINT(sc, BXE_EXTREME_SEND, "%s(): TSO is enabled.\n",
- __FUNCTION__);
-
- tx_start_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_SW_LSO;
+ tx_start_bd->bd_flags.as_bitfield |=
+ ETH_TX_BD_FLAGS_SW_LSO;
+ fp->tx_offload_frames_tso++;
- fp->offload_frames_tso++;
- if (__predict_false(tx_start_bd->nbytes > hdr_len)) {
+ /* ToDo: Does this really help? */
+ if (__predict_false(tx_start_bd->nbytes > hdr_len)) {
+ fp->tx_header_splits++;
/*
* Split the first BD into 2 BDs to make the
- * FW job easy...
+ * firmwares job easy...
*/
tx_start_bd->nbd++;
DBPRINT(sc, BXE_EXTREME_SEND,
"%s(): TSO split headr size is %d (%x:%x) nbds %d\n",
- __FUNCTION__, tx_start_bd->nbytes, tx_start_bd->addr_hi,
+ __FUNCTION__, tx_start_bd->nbytes,
+ tx_start_bd->addr_hi,
tx_start_bd->addr_lo, nbds);
- bd_prod = TX_BD(NEXT_TX_BD(bd_prod));
-
- /* Get a new transmit BD (after the tx_parse_bd) and fill it. */
- tx_data_bd = &fp->tx_bd_chain[TX_PAGE(bd_prod)][TX_IDX(bd_prod)].reg_bd;
- tx_data_bd->addr_hi = htole32(U64_HI(segs[0].ds_addr + hdr_len));
- tx_data_bd->addr_lo = htole32(U64_LO(segs[0].ds_addr + hdr_len));
- tx_data_bd->nbytes = htole16(segs[0].ds_len) - hdr_len;
+ sw_tx_bd_prod = NEXT_TX_BD(sw_tx_bd_prod);
+
+ /* New transmit BD (after the tx_parse_bd). */
+ tx_data_bd =
+ &fp->tx_chain[TX_BD(sw_tx_bd_prod)].reg_bd;
+ tx_data_bd->addr_hi =
+ htole32(U64_HI(segs[0].ds_addr + hdr_len));
+ tx_data_bd->addr_lo =
+ htole32(U64_LO(segs[0].ds_addr + hdr_len));
+ tx_data_bd->nbytes =
+ htole16(segs[0].ds_len) - hdr_len;
if (tx_total_pkt_size_bd == NULL)
tx_total_pkt_size_bd = tx_data_bd;
-
- /*
- * This indicates that the transmit BD
- * has no individual mapping and the
- * FW ignores this flag in a BD that is
- * not marked with the start flag.
- */
-
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): TSO split data size is %d (%x:%x)\n",
- __FUNCTION__, tx_data_bd->nbytes,
- tx_data_bd->addr_hi, tx_data_bd->addr_lo);
}
/*
- * For TSO the controller needs the following info:
+ * The controller needs the following info for TSO:
* MSS, tcp_send_seq, ip_id, and tcp_pseudo_csum.
*/
tx_parse_bd->lso_mss = htole16(m0->m_pkthdr.tso_segsz);
@@ -9190,10 +9273,10 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head)
}
}
- /* Prepare Remaining BDs. Start_tx_bd contains first seg(frag). */
+ /* Prepare remaining BDs. Start_tx_bd contains first seg (frag). */
for (i = 1; i < nsegs ; i++) {
- bd_prod = TX_BD(NEXT_TX_BD(bd_prod));
- tx_data_bd = &fp->tx_bd_chain[TX_PAGE(bd_prod)][TX_IDX(bd_prod)].reg_bd;
+ sw_tx_bd_prod = NEXT_TX_BD(sw_tx_bd_prod);
+ tx_data_bd = &fp->tx_chain[TX_BD(sw_tx_bd_prod)].reg_bd;
tx_data_bd->addr_lo = htole32(U64_LO(segs[i].ds_addr));
tx_data_bd->addr_hi = htole32(U64_HI(segs[i].ds_addr));
tx_data_bd->nbytes = htole16(segs[i].ds_len);
@@ -9205,56 +9288,27 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head)
if(tx_total_pkt_size_bd != NULL)
tx_total_pkt_size_bd->total_pkt_bytes = total_pkt_size;
- /* Update bd producer index value for next tx */
- bd_prod = TX_BD(NEXT_TX_BD(bd_prod));
- DBRUNMSG(BXE_EXTREME_SEND, bxe_dump_tx_chain(fp, debug_prod, nbds));
-
- /*
- * Ensure that the mbuf pointer for this
- * transmission is placed at the array index
- * of the last descriptor in this chain.
- * This is done because a single map is used
- * for all segments of the mbuf and we don't
- * want to unload the map before all of the
- * segments have been freed.
- */
- fp->tx_mbuf_ptr[TX_BD(pkt_prod)] = m0;
+ /* Update TX BD producer index value for next TX */
+ sw_tx_bd_prod = NEXT_TX_BD(sw_tx_bd_prod);
- fp->used_tx_bd += nbds;
+ /* Update the used TX BD counter. */
+ fp->tx_bd_used += nbds;
/*
- * Ring the tx doorbell, counting the next
- * bd if the packet contains or ends with it.
+ * If the chain of tx_bd's describing this frame
+ * is adjacent to or spans an eth_tx_next_bd element
+ * then we need to increment the nbds value.
*/
- if(TX_IDX(bd_prod) < nbds)
+ if(TX_IDX(sw_tx_bd_prod) < nbds)
nbds++;
-//BXE_PRINTF("nsegs:%d, tpktsz:0x%x\n",nsegs, total_pkt_size) ;
-
- /*
- * Update the buffer descriptor producer count and the packet
- * producer count in doorbell data memory (eth_tx_db_data) then
- * ring the doorbell.
- */
-/* fp->hw_tx_prods->bds_prod =
- htole16(le16toh(fp->hw_tx_prods->bds_prod) + nbds);
-*/
-
-
/* Don't allow reordering of writes for nbd and packets. */
mb();
-/*
- fp->hw_tx_prods->packets_prod =
- htole32(le32toh(fp->hw_tx_prods->packets_prod) + 1);
-*/
-// DOORBELL(sc, fp->index, 0);
-
-// BXE_PRINTF("doorbell: nbd %d bd %u index %d\n", nbds, bd_prod, fp->index);
-
fp->tx_db.data.prod += nbds;
/* Producer points to the next free tx_bd at this point. */
- fp->tx_bd_prod = bd_prod;
+ fp->tx_pkt_prod++;
+ fp->tx_bd_prod = sw_tx_bd_prod;
DOORBELL(sc, fp->index, fp->tx_db.raw);
@@ -9268,8 +9322,9 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head)
bus_space_barrier(sc->bxe_db_btag, sc->bxe_db_bhandle,
0, 0, BUS_SPACE_BARRIER_READ);
+bxe_tx_encap_exit:
DBEXIT(BXE_VERBOSE_SEND);
- return(rc);
+ return (rc);
}
@@ -9291,7 +9346,7 @@ bxe_tx_start(struct ifnet *ifp)
/* Exit if the transmit queue is full or link down. */
if (((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
IFF_DRV_RUNNING) || !sc->link_vars.link_up) {
- DBPRINT(sc, BXE_VERBOSE_SEND,
+ DBPRINT(sc, BXE_WARN,
"%s(): No link or TX queue full, ignoring "
"transmit request.\n", __FUNCTION__);
goto bxe_tx_start_exit;
@@ -9336,7 +9391,7 @@ bxe_tx_start_locked(struct ifnet *ifp, struct bxe_fastpath *fp)
break;
/* The transmit mbuf now belongs to us, keep track of it. */
- DBRUN(fp->tx_mbuf_alloc++);
+ fp->tx_mbuf_alloc++;
/*
* Pack the data into the transmit ring. If we
@@ -9354,8 +9409,8 @@ bxe_tx_start_locked(struct ifnet *ifp, struct bxe_fastpath *fp)
*/
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
IFQ_DRV_PREPEND(&ifp->if_snd, m);
- DBRUN(fp->tx_mbuf_alloc--);
- sc->eth_stats.driver_xoff++;
+ fp->tx_mbuf_alloc--;
+ fp->tx_queue_xoff++;
} else {
}
@@ -9375,8 +9430,6 @@ bxe_tx_start_locked(struct ifnet *ifp, struct bxe_fastpath *fp)
if (tx_count > 0)
/* Reset the TX watchdog timeout timer. */
fp->watchdog_timer = BXE_TX_TIMEOUT;
- else
- fp->tx_start_called_on_empty_queue++;
DBEXIT(BXE_EXTREME_SEND);
}
@@ -9391,41 +9444,27 @@ bxe_tx_start_locked(struct ifnet *ifp, struct bxe_fastpath *fp)
static int
bxe_tx_mq_start(struct ifnet *ifp, struct mbuf *m)
{
- struct bxe_softc *sc;
- struct bxe_fastpath *fp;
- int fp_index, rc;
+ struct bxe_softc *sc;
+ struct bxe_fastpath *fp;
+ int fp_index, rc;
sc = ifp->if_softc;
- fp_index = 0;
-
DBENTER(BXE_EXTREME_SEND);
- /* Map the flow ID to a queue number. */
- if ((m->m_flags & M_FLOWID) != 0) {
- fp_index = m->m_pkthdr.flowid % sc->num_queues;
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): Found flowid %d\n",
- __FUNCTION__, fp_index);
- } else {
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): No flowid found, using %d\n",
- __FUNCTION__, fp_index);
- }
+ fp_index = 0;
+ /* If using flow ID, assign the TX queue based on the flow ID. */
+ if ((m->m_flags & M_FLOWID) != 0)
+ fp_index = m->m_pkthdr.flowid % sc->num_queues;
/* Select the fastpath TX queue for the frame. */
fp = &sc->fp[fp_index];
- /* Exit if the transmit queue is full or link down. */
+ /* Skip H/W enqueue if transmit queue is full or link down. */
if (((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
IFF_DRV_RUNNING) || !sc->link_vars.link_up) {
- /* We're stuck with the mbuf. Stash it for now. */
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): TX queue full/link down, "
- "parking mbuf...\n", __FUNCTION__);
+ /* Stash the mbuf if we can. */
rc = drbr_enqueue(ifp, fp->br, m);
- /* DRC - Setup a task to try again. */
- /* taskqueue_enqueue(tq, task); */
goto bxe_tx_mq_start_exit;
}
@@ -9435,12 +9474,13 @@ bxe_tx_mq_start(struct ifnet *ifp, struct mbuf *m)
bxe_tx_mq_start_exit:
DBEXIT(BXE_EXTREME_SEND);
- return(rc);
+ return (rc);
}
/*
- * Multiqueue (TSS) transmit routine.
+ * Multiqueue (TSS) transmit routine. This routine is responsible
+ * for adding a frame to the hardware's transmit queue.
*
* Returns:
* 0 if transmit succeeds, !0 otherwise.
@@ -9451,55 +9491,40 @@ bxe_tx_mq_start_locked(struct ifnet *ifp,
{
struct bxe_softc *sc;
struct mbuf *next;
- int depth, rc = 0, tx_count = 0;
+ int depth, rc, tx_count;
sc = fp->sc;
-
DBENTER(BXE_EXTREME_SEND);
+
+ rc = tx_count = 0;
+
+ /* Fetch the depth of the driver queue. */
depth = drbr_inuse(ifp, fp->br);
- if (depth > fp->max_drbr_queue_depth) {
- fp->max_drbr_queue_depth = depth;
- }
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): fp[%02d], drbr queue depth=%d\n",
- __FUNCTION__, fp->index, depth);
+ if (depth > fp->tx_max_drbr_queue_depth)
+ fp->tx_max_drbr_queue_depth = depth;
BXE_FP_LOCK_ASSERT(fp);
if (m == NULL) {
- /* Check for any other work. */
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): No initial work, dequeue mbuf...\n",
- __FUNCTION__);
+ /* No new work, check for pending frames. */
next = drbr_dequeue(ifp, fp->br);
} else if (drbr_needs_enqueue(ifp, fp->br)) {
- /* Work pending, queue mbuf to maintain packet order. */
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): Found queued data pending...\n",
- __FUNCTION__);
- if ((rc = drbr_enqueue(ifp, fp->br, m)) != 0) {
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): Enqueue failed...\n",
- __FUNCTION__);
+ /* Both new and pending work, maintain packet order. */
+ rc = drbr_enqueue(ifp, fp->br, m);
+ if (rc != 0) {
+ fp->tx_soft_errors++;
goto bxe_tx_mq_start_locked_exit;
}
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): Dequeueing old mbuf...\n",
- __FUNCTION__);
next = drbr_dequeue(ifp, fp->br);
- } else {
- /* Work with the mbuf we have. */
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): Start with current mbuf...\n",
- __FUNCTION__);
+ } else
+ /* New work only, nothing pending. */
next = m;
- }
/* Keep adding entries while there are frames to send. */
while (next != NULL) {
/* The transmit mbuf now belongs to us, keep track of it. */
- DBRUN(fp->tx_mbuf_alloc++);
+ fp->tx_mbuf_alloc++;
/*
* Pack the data into the transmit ring. If we
@@ -9507,9 +9532,8 @@ bxe_tx_mq_start_locked(struct ifnet *ifp,
* head of the TX queue, set the OACTIVE flag,
* and wait for the NIC to drain the chain.
*/
- if (__predict_false(bxe_tx_encap(fp, &next))) {
- DBPRINT(sc, BXE_WARN, "%s(): TX encap failure...\n",
- __FUNCTION__);
+ rc = bxe_tx_encap(fp, &next);
+ if (__predict_false(rc != 0)) {
fp->tx_encap_failures++;
/* Very Bad Frames(tm) may have been dropped. */
if (next != NULL) {
@@ -9518,12 +9542,11 @@ bxe_tx_mq_start_locked(struct ifnet *ifp,
* the frame.
*/
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): Save mbuf for another time...\n",
- __FUNCTION__);
+ fp->tx_frame_deferred++;
+
+ /* This may reorder frame. */
rc = drbr_enqueue(ifp, fp->br, next);
- DBRUN(fp->tx_mbuf_alloc--);
- sc->eth_stats.driver_xoff++;
+ fp->tx_mbuf_alloc--;
}
/* Stop looking for more work. */
@@ -9536,27 +9559,27 @@ bxe_tx_mq_start_locked(struct ifnet *ifp,
/* Send a copy of the frame to any BPF listeners. */
BPF_MTAP(ifp, next);
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): Check for queued mbufs...\n",
- __FUNCTION__);
+ /* Handle any completions if we're running low. */
+ if (fp->tx_bd_used >= BXE_TX_CLEANUP_THRESHOLD)
+ bxe_txeof(fp);
+
+ /* Close TX since there's so little room left. */
+ if (fp->tx_bd_used >= BXE_TX_CLEANUP_THRESHOLD) {
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+ break;
+ }
+
next = drbr_dequeue(ifp, fp->br);
}
- DBPRINT(sc, BXE_EXTREME_SEND,
- "%s(): Enqueued %d mbufs...\n",
- __FUNCTION__, tx_count);
-
/* No TX packets were dequeued. */
- if (tx_count > 0) {
+ if (tx_count > 0)
/* Reset the TX watchdog timeout timer. */
fp->watchdog_timer = BXE_TX_TIMEOUT;
- } else {
- fp->tx_start_called_on_empty_queue++;
- }
bxe_tx_mq_start_locked_exit:
DBEXIT(BXE_EXTREME_SEND);
- return(rc);
+ return (rc);
}
@@ -9575,10 +9598,11 @@ bxe_mq_flush(struct ifnet *ifp)
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
- DBPRINT(sc, BXE_VERBOSE_UNLOAD, "%s(): Clearing fp[%02d]...\n",
- __FUNCTION__, fp->index);
-
if (fp->br != NULL) {
+ DBPRINT(sc, BXE_VERBOSE_UNLOAD,
+ "%s(): Clearing fp[%02d]...\n",
+ __FUNCTION__, fp->index);
+
BXE_FP_LOCK(fp);
while ((m = buf_ring_dequeue_sc(fp->br)) != NULL)
m_freem(m);
@@ -9607,7 +9631,7 @@ bxe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
int error, mask, reinit;
sc = ifp->if_softc;
- DBENTER(BXE_EXTREME_MISC);
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_MISC);
ifr = (struct ifreq *)data;
error = 0;
@@ -9616,72 +9640,65 @@ bxe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch (command) {
case SIOCSIFMTU:
/* Set the MTU. */
- DBPRINT(sc, BXE_EXTREME_MISC, "%s(): Received SIOCSIFMTU\n",
+ DBPRINT(sc, BXE_VERBOSE_MISC, "%s(): Received SIOCSIFMTU\n",
__FUNCTION__);
/* Check that the MTU setting is supported. */
if ((ifr->ifr_mtu < BXE_MIN_MTU) ||
- (ifr->ifr_mtu > BXE_JUMBO_MTU)) {
- DBPRINT(sc, BXE_WARN, "%s(): Unsupported MTU "
- "(%d < %d < %d)!\n", __FUNCTION__, BXE_MIN_MTU,
- ifr->ifr_mtu, BXE_JUMBO_MTU);
+ (ifr->ifr_mtu > BXE_JUMBO_MTU)) {
error = EINVAL;
break;
}
BXE_CORE_LOCK(sc);
ifp->if_mtu = ifr->ifr_mtu;
- bxe_change_mtu(sc, ifp->if_drv_flags & IFF_DRV_RUNNING);
BXE_CORE_UNLOCK(sc);
+
+ reinit = 1;
break;
case SIOCSIFFLAGS:
/* Toggle the interface state up or down. */
- DBPRINT(sc, BXE_EXTREME_MISC, "%s(): Received SIOCSIFFLAGS\n",
+ DBPRINT(sc, BXE_VERBOSE_MISC, "%s(): Received SIOCSIFFLAGS\n",
__FUNCTION__);
BXE_CORE_LOCK(sc);
-
/* Check if the interface is up. */
if (ifp->if_flags & IFF_UP) {
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
- /*
- * Change the promiscuous/multicast flags as
- * necessary.
- */
+ /* Set promiscuous/multicast flags. */
bxe_set_rx_mode(sc);
} else {
/* Start the HW */
bxe_init_locked(sc, LOAD_NORMAL);
}
} else {
- /*
- * The interface is down. Check if the driver is
- * running.
- */
+ /* Bring down the interface. */
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
bxe_stop_locked(sc, UNLOAD_NORMAL);
}
BXE_CORE_UNLOCK(sc);
+
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
/* Add/Delete multicast addresses. */
- DBPRINT(sc, BXE_EXTREME_MISC,
+ DBPRINT(sc, BXE_VERBOSE_MISC,
"%s(): Received SIOCADDMULTI/SIOCDELMULTI\n", __FUNCTION__);
BXE_CORE_LOCK(sc);
-
- /* Don't bother unless the driver's running. */
+ /* Check if the interface is up. */
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+ /* Set receive mode flags. */
bxe_set_rx_mode(sc);
-
BXE_CORE_UNLOCK(sc);
+
break;
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
/* Set/Get Interface media */
- DBPRINT(sc, BXE_EXTREME_MISC,
+ DBPRINT(sc, BXE_VERBOSE_MISC,
"%s(): Received SIOCSIFMEDIA/SIOCGIFMEDIA\n", __FUNCTION__);
+
error = ifmedia_ioctl(ifp, ifr, &sc->bxe_ifmedia, command);
break;
case SIOCSIFCAP:
@@ -9697,13 +9714,13 @@ bxe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
/* Toggle the LRO capabilites enable flag. */
if (mask & IFCAP_LRO) {
- if (TPA_ENABLED(sc)) {
- ifp->if_capenable ^= IFCAP_LRO;
- sc->bxe_flags ^= BXE_TPA_ENABLE_FLAG;
- DBPRINT(sc, BXE_INFO_MISC,
- "%s(): Toggling LRO (bxe_flags = "
- "0x%08X).\n", __FUNCTION__, sc->bxe_flags);
- }
+ ifp->if_capenable ^= IFCAP_LRO;
+ sc->bxe_flags ^= BXE_TPA_ENABLE_FLAG;
+ DBPRINT(sc, BXE_INFO_MISC,
+ "%s(): Toggling LRO (bxe_flags = "
+ "0x%08X).\n", __FUNCTION__, sc->bxe_flags);
+
+ /* LRO requires different buffer setup. */
reinit = 1;
}
@@ -9735,6 +9752,7 @@ bxe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
/* Toggle VLAN_MTU capabilities enable flag. */
if (mask & IFCAP_VLAN_MTU) {
+ /* ToDo: Is this really true? */
BXE_PRINTF("%s(%d): Changing VLAN_MTU not supported.\n",
__FILE__, __LINE__);
error = EINVAL;
@@ -9742,6 +9760,7 @@ bxe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
/* Toggle VLANHWTAG capabilities enabled flag. */
if (mask & IFCAP_VLAN_HWTAGGING) {
+ /* ToDo: Is this really true? */
BXE_PRINTF(
"%s(%d): Changing VLAN_HWTAGGING not supported!\n",
__FILE__, __LINE__);
@@ -9758,27 +9777,22 @@ bxe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
/* Toggle TSO6 capabilities enabled flag. */
if (mask & IFCAP_TSO6) {
- DBPRINT(sc, BXE_VERBOSE_MISC,
- "%s(): Toggling IFCAP_TSO6.\n", __FUNCTION__);
-
- ifp->if_capenable ^= IFCAP_TSO6;
- }
-
- /* Handle any other capabilities. */
- if (mask & ~(IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU |
- IFCAP_RXCSUM | IFCAP_TXCSUM)) {
- BXE_PRINTF("%s(%d): Unsupported capability!\n",
+ /* ToDo: Add TSO6 support. */
+ BXE_PRINTF(
+ "%s(%d): Changing TSO6 not supported!\n",
__FILE__, __LINE__);
- error = EINVAL;
- }
-
- /* Restart the controller with the new capabilities. */
- if (reinit) {
- bxe_stop_locked(sc, UNLOAD_NORMAL);
- bxe_init_locked(sc, LOAD_NORMAL);
}
-
BXE_CORE_UNLOCK(sc);
+
+ /*
+ * ToDo: Look into supporting:
+ * VLAN_HWFILTER
+ * VLAN_HWCSUM
+ * VLAN_HWTSO
+ * POLLING
+ * WOL[_UCAST|_MCAST|_MAGIC]
+ *
+ */
break;
default:
/* We don't know how to handle the IOCTL, pass it on. */
@@ -9786,7 +9800,15 @@ bxe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
break;
}
- DBEXIT(BXE_EXTREME_MISC);
+ /* Restart the controller with the new capabilities. */
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && (reinit != 0)) {
+ BXE_CORE_LOCK(sc);
+ bxe_stop_locked(sc, UNLOAD_NORMAL);
+ bxe_init_locked(sc, LOAD_NORMAL);
+ BXE_CORE_UNLOCK(sc);
+ }
+
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_MISC);
return (error);
}
@@ -9798,7 +9820,7 @@ bxe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
* caller.
*
* Returns:
- * The adjusted value of *fp->rx_cons_sb.
+ * The adjusted value of *fp->rx_cons_sb.
*/
static __inline uint16_t
bxe_rx_cq_cons(struct bxe_fastpath *fp)
@@ -9816,7 +9838,7 @@ bxe_rx_cq_cons(struct bxe_fastpath *fp)
* need to adjust the value accordingly.
*/
if ((rx_cq_cons_sb & USABLE_RCQ_ENTRIES_PER_PAGE) ==
- USABLE_RCQ_ENTRIES_PER_PAGE)
+ USABLE_RCQ_ENTRIES_PER_PAGE)
rx_cq_cons_sb++;
return (rx_cq_cons_sb);
@@ -9827,7 +9849,7 @@ bxe_has_tx_work(struct bxe_fastpath *fp)
{
rmb();
- return (((fp->tx_pkt_prod != le16toh(*fp->tx_cons_sb)) || \
+ return (((fp->tx_pkt_prod != le16toh(*fp->tx_pkt_cons_sb)) || \
(fp->tx_pkt_prod != fp->tx_pkt_cons)));
}
@@ -9836,8 +9858,8 @@ bxe_has_tx_work(struct bxe_fastpath *fp)
* completion queue.
*
* Returns:
- * 0 = No received frames pending, !0 = Received frames
- * pending
+ * 0 = No received frames pending, !0 = Received frames
+ * pending
*/
static __inline int
bxe_has_rx_work(struct bxe_fastpath *fp)
@@ -9860,7 +9882,6 @@ bxe_task_sp(void *xsc, int pending)
uint32_t sp_status;
sc = xsc;
- DBENTER(BXE_EXTREME_INTR);
DBPRINT(sc, BXE_EXTREME_INTR, "%s(): pending = %d.\n", __FUNCTION__,
pending);
@@ -9897,8 +9918,6 @@ bxe_task_sp(void *xsc, int pending)
IGU_INT_NOP, 1);
bxe_ack_sb(sc, DEF_SB_ID, TSTORM_ID, le16toh(sc->def_t_idx),
IGU_INT_ENABLE, 1);
-
- DBEXIT(BXE_EXTREME_INTR);
}
@@ -9931,9 +9950,6 @@ bxe_intr_legacy(void *xsc)
if (fp_status == 0)
goto bxe_intr_legacy_exit;
- /* Need to weed out calls due to shared interrupts. */
- DBENTER(BXE_EXTREME_INTR);
-
/* Handle the fastpath interrupt. */
/*
* sb_id = 0 for ustorm, 1 for cstorm.
@@ -9945,9 +9961,8 @@ bxe_intr_legacy(void *xsc)
*/
mask = (0x2 << fp->sb_id);
- DBPRINT(sc, BXE_EXTREME_INTR,
- "%s(): fp_status = 0x%08X, mask = 0x%08X\n", __FUNCTION__,
- fp_status, mask);
+ DBPRINT(sc, BXE_INSANE_INTR, "%s(): fp_status = 0x%08X, mask = "
+ "0x%08X\n", __FUNCTION__, fp_status, mask);
/* CSTORM event means fastpath completion. */
if (fp_status & mask) {
@@ -10004,7 +10019,9 @@ bxe_intr_sp(void *xsc)
struct bxe_softc *sc;
sc = xsc;
- DBENTER(BXE_EXTREME_INTR);
+
+ DBPRINT(sc, BXE_INSANE_INTR, "%s(%d): Slowpath interrupt.\n",
+ __FUNCTION__, curcpu);
/* Don't handle any interrupts if we're not ready. */
if (__predict_false(sc->intr_sem != 0))
@@ -10021,7 +10038,7 @@ bxe_intr_sp(void *xsc)
#endif
bxe_intr_sp_exit:
- DBEXIT(BXE_EXTREME_INTR);
+ return;
}
/*
@@ -10041,10 +10058,8 @@ bxe_intr_fp (void *xfp)
fp = xfp;
sc = fp->sc;
- DBENTER(BXE_EXTREME_INTR);
-
- DBPRINT(sc, BXE_VERBOSE_INTR,
- "%s(%d): MSI-X vector on fp[%d].sb_id = %d\n",
+ DBPRINT(sc, BXE_INSANE_INTR,
+ "%s(%d): fp[%02d].sb_id = %d interrupt.\n",
__FUNCTION__, curcpu, fp->index, fp->sb_id);
/* Don't handle any interrupts if we're not ready. */
@@ -10060,7 +10075,7 @@ bxe_intr_fp (void *xfp)
#endif
bxe_intr_fp_exit:
- DBEXIT(BXE_EXTREME_INTR);
+ return;
}
/*
@@ -10080,12 +10095,7 @@ bxe_task_fp (void *xfp, int pending)
fp = xfp;
sc = fp->sc;
- DBENTER(BXE_EXTREME_INTR);
-
- DBPRINT(sc, BXE_EXTREME_INTR, "%s(): pending = %d.\n", __FUNCTION__,
- pending);
-
- DBPRINT(sc, BXE_EXTREME_INTR, "%s(%d): Fastpath task on fp[%d]"
+ DBPRINT(sc, BXE_EXTREME_INTR, "%s(%d): Fastpath task on fp[%02d]"
".sb_id = %d\n", __FUNCTION__, curcpu, fp->index, fp->sb_id);
/* Update the fast path indices */
@@ -10105,8 +10115,6 @@ bxe_task_fp (void *xfp, int pending)
/* Acknowledge the fastpath status block indices. */
bxe_ack_sb(sc, fp->sb_id, USTORM_ID, fp->fp_u_idx, IGU_INT_NOP, 1);
bxe_ack_sb(sc, fp->sb_id, CSTORM_ID, fp->fp_c_idx, IGU_INT_ENABLE, 1);
-
- DBEXIT(BXE_EXTREME_INTR);
}
/*
@@ -10120,12 +10128,8 @@ bxe_zero_sb(struct bxe_softc *sc, int sb_id)
{
int port;
- port = BP_PORT(sc);
-
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_INTR);
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET),
- "%s(): Clearing sb_id = %d on port %d.\n", __FUNCTION__, sb_id,
- port);
+ port = BP_PORT(sc);
/* "CSTORM" */
bxe_init_fill(sc, CSEM_REG_FAST_MEMORY +
@@ -10151,13 +10155,14 @@ bxe_init_sb(struct bxe_softc *sc, struct host_status_block *sb,
uint64_t section;
int func, index, port;
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_INTR);
+
port = BP_PORT(sc);
func = BP_FUNC(sc);
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_INTR);
DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_INTR),
- "%s(): Initializing sb_id = %d on port %d, function %d.\n",
- __FUNCTION__, sb_id, port, func);
+ "%s(): Initializing sb_id = %d on port %d, function %d.\n",
+ __FUNCTION__, sb_id, port, func);
/* Setup the USTORM status block. */
section = ((uint64_t)mapping) + offsetof(struct host_status_block,
@@ -10418,300 +10423,580 @@ bxe_update_coalesce(struct bxe_softc *sc)
}
/*
- * Free memory buffers from the TPA pool.
+ * Allocate an mbuf and assign it to the TPA pool.
*
* Returns:
- * None
+ * 0 = Success, !0 = Failure
+ *
+ * Modifies:
+ * fp->tpa_mbuf_ptr[queue]
+ * fp->tpa_mbuf_map[queue]
+ * fp->tpa_mbuf_segs[queue]
*/
-static __inline void
-bxe_free_tpa_pool(struct bxe_fastpath *fp, int last)
+static int
+bxe_alloc_tpa_mbuf(struct bxe_fastpath *fp, int queue)
{
struct bxe_softc *sc;
- int j;
+ bus_dma_segment_t segs[1];
+ bus_dmamap_t map;
+ struct mbuf *m;
+ int nsegs, rc;
sc = fp->sc;
+ DBENTER(BXE_INSANE_TPA);
+ rc = 0;
+
+ DBRUNIF((fp->disable_tpa == TRUE),
+ BXE_PRINTF("%s(): fp[%02d] TPA disabled!\n",
+ __FUNCTION__, fp->index));
+
#ifdef BXE_DEBUG
- int tpa_pool_max;
+ /* Simulate an mbuf allocation failure. */
+ if (DB_RANDOMTRUE(bxe_debug_mbuf_allocation_failure)) {
+ sc->debug_sim_mbuf_alloc_failed++;
+ fp->mbuf_tpa_alloc_failed++;
+ rc = ENOMEM;
+ goto bxe_alloc_tpa_mbuf_exit;
+ }
+#endif
- tpa_pool_max = CHIP_IS_E1H(sc) ? ETH_MAX_AGGREGATION_QUEUES_E1H :
- ETH_MAX_AGGREGATION_QUEUES_E1;
- DBRUNIF((last > tpa_pool_max), DBPRINT(sc, BXE_FATAL,
- "%s(): Index value out of range (%d > %d)!\n", __FUNCTION__, last,
- tpa_pool_max));
+ /* Allocate the new TPA mbuf. */
+ m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size);
+ if (__predict_false(m == NULL)) {
+ fp->mbuf_tpa_alloc_failed++;
+ rc = ENOBUFS;
+ goto bxe_alloc_tpa_mbuf_exit;
+ }
+
+ DBRUN(fp->tpa_mbuf_alloc++);
+
+ /* Initialize the mbuf buffer length. */
+ m->m_pkthdr.len = m->m_len = sc->mbuf_alloc_size;
+
+#ifdef BXE_DEBUG
+ /* Simulate an mbuf mapping failure. */
+ if (DB_RANDOMTRUE(bxe_debug_dma_map_addr_failure)) {
+ sc->debug_sim_mbuf_map_failed++;
+ fp->mbuf_tpa_mapping_failed++;
+ m_freem(m);
+ DBRUN(fp->tpa_mbuf_alloc--);
+ rc = ENOMEM;
+ goto bxe_alloc_tpa_mbuf_exit;
+ }
#endif
- if (!(TPA_ENABLED(sc)))
- return;
+ /* Map the TPA mbuf into non-paged pool. */
+ rc = bus_dmamap_load_mbuf_sg(fp->rx_mbuf_tag,
+ fp->tpa_mbuf_spare_map, m, segs, &nsegs, BUS_DMA_NOWAIT);
+ if (__predict_false(rc != 0)) {
+ fp->mbuf_tpa_mapping_failed++;
+ m_free(m);
+ DBRUN(fp->tpa_mbuf_alloc--);
+ goto bxe_alloc_tpa_mbuf_exit;
+ }
- for (j = 0; j < last; j++) {
- if (fp->rx_mbuf_tag) {
- if (fp->tpa_mbuf_map[j] != NULL) {
- bus_dmamap_sync(fp->rx_mbuf_tag,
- fp->tpa_mbuf_map[j], BUS_DMASYNC_POSTREAD);
- bus_dmamap_unload(fp->rx_mbuf_tag,
- fp->tpa_mbuf_map[j]);
- }
+ /* All mubfs must map to a single segment. */
+ KASSERT(nsegs == 1, ("%s(): Too many segments (%d) returned!",
+ __FUNCTION__, nsegs));
- if (fp->tpa_mbuf_ptr[j] != NULL) {
- m_freem(fp->tpa_mbuf_ptr[j]);
- DBRUN(fp->tpa_mbuf_alloc--);
- fp->tpa_mbuf_ptr[j] = NULL;
- } else {
- DBPRINT(sc, BXE_FATAL,
- "%s(): TPA bin %d empty on free!\n",
- __FUNCTION__, j);
- }
- }
+ /* Release any existing TPA mbuf mapping. */
+ if (fp->tpa_mbuf_map[queue] != NULL) {
+ bus_dmamap_sync(fp->rx_mbuf_tag,
+ fp->tpa_mbuf_map[queue], BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(fp->rx_mbuf_tag,
+ fp->tpa_mbuf_map[queue]);
}
+
+ /* Save the mbuf and mapping info for the TPA mbuf. */
+ map = fp->tpa_mbuf_map[queue];
+ fp->tpa_mbuf_map[queue] = fp->tpa_mbuf_spare_map;
+ fp->tpa_mbuf_spare_map = map;
+ bus_dmamap_sync(fp->rx_mbuf_tag,
+ fp->tpa_mbuf_map[queue], BUS_DMASYNC_PREREAD);
+ fp->tpa_mbuf_ptr[queue] = m;
+ fp->tpa_mbuf_segs[queue] = segs[0];
+
+bxe_alloc_tpa_mbuf_exit:
+ DBEXIT(BXE_INSANE_TPA);
+ return (rc);
}
/*
- * Free an entry in the receive scatter gather list.
+ * Allocate mbufs for a fastpath TPA pool.
*
* Returns:
- * None
+ * 0 = Success, !0 = Failure.
+ *
+ * Modifies:
+ * fp->tpa_state[]
+ * fp->disable_tpa
*/
-static __inline void
-bxe_free_rx_sge(struct bxe_softc *sc, struct bxe_fastpath *fp, uint16_t index)
+static int
+bxe_fill_tpa_pool(struct bxe_fastpath *fp)
{
- struct eth_rx_sge *sge;
+ struct bxe_softc *sc;
+ int max_agg_queues, queue, rc;
- sge = &fp->rx_sge_chain[RX_SGE_PAGE(index)][RX_SGE_IDX(index)];
- /* Skip "next page" elements */
- if (!sge)
- return;
+ sc = fp->sc;
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ rc = 0;
- if (fp->rx_sge_buf_tag) {
- if (fp->rx_sge_buf_map[index]) {
- bus_dmamap_sync(fp->rx_sge_buf_tag,
- fp->rx_sge_buf_map[index], BUS_DMASYNC_POSTREAD);
- bus_dmamap_unload(fp->rx_sge_buf_tag,
- fp->rx_sge_buf_map[index]);
- }
+ if (!TPA_ENABLED(sc)) {
+ fp->disable_tpa = TRUE;
+ goto bxe_fill_tpa_pool_exit;
+ }
- if (fp->rx_sge_buf_ptr[index]) {
- DBRUN(fp->sge_mbuf_alloc--);
- m_freem(fp->rx_sge_buf_ptr[index]);
- fp->rx_sge_buf_ptr[index] = NULL;
- }
+ max_agg_queues = CHIP_IS_E1(sc) ? ETH_MAX_AGGREGATION_QUEUES_E1 :
+ ETH_MAX_AGGREGATION_QUEUES_E1H;
+
+ /* Assume the fill operation worked. */
+ fp->disable_tpa = FALSE;
- sge->addr_hi = sge->addr_lo = 0;
+ /* Fill the TPA pool. */
+ for (queue = 0; queue < max_agg_queues; queue++) {
+ rc = bxe_alloc_tpa_mbuf(fp, queue);
+ if (rc != 0) {
+ BXE_PRINTF(
+ "%s(%d): fp[%02d] TPA disabled!\n",
+ __FILE__, __LINE__, fp->index);
+ fp->disable_tpa = TRUE;
+ break;
+ }
+ fp->tpa_state[queue] = BXE_TPA_STATE_STOP;
}
+
+bxe_fill_tpa_pool_exit:
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ return (rc);
}
/*
- * Free a range of scatter gather elements from the ring.
+ * Free all mbufs from a fastpath TPA pool.
*
* Returns:
* None
+ *
+ * Modifies:
+ * fp->tpa_mbuf_ptr[]
+ * fp->tpa_mbuf_map[]
+ * fp->tpa_mbuf_alloc
*/
-static __inline void
-bxe_free_rx_sge_range(struct bxe_softc *sc, struct bxe_fastpath *fp, int last)
+static void
+bxe_free_tpa_pool(struct bxe_fastpath *fp)
{
- int i;
+ struct bxe_softc *sc;
+ int i, max_agg_queues;
+
+ sc = fp->sc;
+ DBENTER(BXE_INSANE_LOAD | BXE_INSANE_UNLOAD | BXE_INSANE_TPA);
- for (i = 0; i < last; i++)
- bxe_free_rx_sge(sc, fp, i);
+ if (fp->rx_mbuf_tag == NULL)
+ goto bxe_free_tpa_pool_exit;
+
+ max_agg_queues = CHIP_IS_E1H(sc) ?
+ ETH_MAX_AGGREGATION_QUEUES_E1H :
+ ETH_MAX_AGGREGATION_QUEUES_E1;
+
+ /* Release all mbufs and and all DMA maps in the TPA pool. */
+ for (i = 0; i < max_agg_queues; i++) {
+ if (fp->tpa_mbuf_map[i] != NULL) {
+ bus_dmamap_sync(fp->rx_mbuf_tag, fp->tpa_mbuf_map[i],
+ BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(fp->rx_mbuf_tag, fp->tpa_mbuf_map[i]);
+ }
+
+ if (fp->tpa_mbuf_ptr[i] != NULL) {
+ m_freem(fp->tpa_mbuf_ptr[i]);
+ DBRUN(fp->tpa_mbuf_alloc--);
+ fp->tpa_mbuf_ptr[i] = NULL;
+ }
+ }
+
+bxe_free_tpa_pool_exit:
+ DBEXIT(BXE_INSANE_LOAD | BXE_INSANE_UNLOAD | BXE_INSANE_TPA);
}
/*
- * Allocate an mbuf of the specified size for the caller.
+ * Allocate an mbuf and assign it to the receive scatter gather chain.
+ * The caller must take care to save a copy of the existing mbuf in the
+ * SG mbuf chain.
*
* Returns:
- * NULL on failure or an mbuf pointer on success.
+ * 0 = Success, !0= Failure.
+ *
+ * Modifies:
+ * fp->sg_chain[index]
+ * fp->rx_sge_buf_ptr[index]
+ * fp->rx_sge_buf_map[index]
+ * fp->rx_sge_spare_map
*/
-static struct mbuf*
-bxe_alloc_mbuf(struct bxe_fastpath *fp, int size)
+static int
+bxe_alloc_rx_sge_mbuf(struct bxe_fastpath *fp, uint16_t index)
{
struct bxe_softc *sc;
- struct mbuf *m_new;
+ struct eth_rx_sge *sge;
+ bus_dma_segment_t segs[1];
+ bus_dmamap_t map;
+ struct mbuf *m;
+ int nsegs, rc;
sc = fp->sc;
- DBENTER(BXE_INSANE);
+ DBENTER(BXE_INSANE_TPA);
+ rc = 0;
#ifdef BXE_DEBUG
/* Simulate an mbuf allocation failure. */
if (DB_RANDOMTRUE(bxe_debug_mbuf_allocation_failure)) {
- DBPRINT(sc, BXE_WARN,
- "%s(): Simulated mbuf allocation failure!\n", __FUNCTION__);
- fp->mbuf_alloc_failed++;
- sc->debug_mbuf_sim_alloc_failed++;
- m_new = NULL;
- goto bxe_alloc_mbuf_exit;
+ sc->debug_sim_mbuf_alloc_failed++;
+ fp->mbuf_sge_alloc_failed++;
+ rc = ENOMEM;
+ goto bxe_alloc_rx_sge_mbuf_exit;
}
#endif
- /* Allocate a new mbuf with memory attached. */
- if (size <= MCLBYTES)
- m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
- else
- m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size);
-
- /* Check whether the allocation succeeded and handle a failure. */
- if (__predict_false(m_new == NULL)) {
- DBPRINT(sc, BXE_WARN, "%s(): Failed to allocate %d byte "
- "mbuf on fp[%02d]!\n", __FUNCTION__, size, fp->index);
- fp->mbuf_alloc_failed++;
- goto bxe_alloc_mbuf_exit;
+ /* Allocate a new SGE mbuf. */
+ m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, SGE_PAGE_SIZE);
+ if (__predict_false(m == NULL)) {
+ fp->mbuf_sge_alloc_failed++;
+ rc = ENOMEM;
+ goto bxe_alloc_rx_sge_mbuf_exit;
}
- /* Do a little extra error checking when debugging. */
- DBRUN(M_ASSERTPKTHDR(m_new));
+ DBRUN(fp->sge_mbuf_alloc++);
/* Initialize the mbuf buffer length. */
- m_new->m_pkthdr.len = m_new->m_len = size;
- DBRUN(sc->debug_memory_allocated += size);
+ m->m_pkthdr.len = m->m_len = SGE_PAGE_SIZE;
+
+#ifdef BXE_DEBUG
+ /* Simulate an mbuf mapping failure. */
+ if (DB_RANDOMTRUE(bxe_debug_dma_map_addr_failure)) {
+ sc->debug_sim_mbuf_map_failed++;
+ fp->mbuf_sge_mapping_failed++;
+ m_freem(m);
+ DBRUN(fp->sge_mbuf_alloc--);
+ rc = ENOMEM;
+ goto bxe_alloc_rx_sge_mbuf_exit;
+ }
+#endif
+
+ /* Map the SGE mbuf into non-paged pool. */
+ rc = bus_dmamap_load_mbuf_sg(fp->rx_sge_buf_tag,
+ fp->rx_sge_spare_map, m, segs, &nsegs, BUS_DMA_NOWAIT);
+ if (__predict_false(rc != 0)) {
+ fp->mbuf_sge_mapping_failed++;
+ m_freem(m);
+ DBRUN(fp->sge_mbuf_alloc--);
+ goto bxe_alloc_rx_sge_mbuf_exit;
+ }
-bxe_alloc_mbuf_exit:
- return (m_new);
+ /* All mubfs must map to a single segment. */
+ KASSERT(nsegs == 1, ("%s(): Too many segments (%d) returned!",
+ __FUNCTION__, nsegs));
+
+ /* Unload any existing SGE mbuf mapping. */
+ if (fp->rx_sge_buf_map[index] != NULL) {
+ bus_dmamap_sync(fp->rx_sge_buf_tag,
+ fp->rx_sge_buf_map[index], BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(fp->rx_sge_buf_tag,
+ fp->rx_sge_buf_map[index]);
+ }
+
+ /* Add the new SGE mbuf to the SGE ring. */
+ map = fp->rx_sge_buf_map[index];
+ fp->rx_sge_buf_map[index] = fp->rx_sge_spare_map;
+ fp->rx_sge_spare_map = map;
+ bus_dmamap_sync(fp->rx_sge_buf_tag,
+ fp->rx_sge_buf_map[index], BUS_DMASYNC_PREREAD);
+ fp->rx_sge_buf_ptr[index] = m;
+ sge = &fp->sg_chain[index];
+ sge->addr_hi = htole32(U64_HI(segs[0].ds_addr));
+ sge->addr_lo = htole32(U64_LO(segs[0].ds_addr));
+
+bxe_alloc_rx_sge_mbuf_exit:
+ DBEXIT(BXE_INSANE_TPA);
+ return (rc);
}
/*
- * Map an mbuf into non-paged memory for the caller.
+ * Allocate mbufs for a SGE chain.
*
* Returns:
* 0 = Success, !0 = Failure.
*
- * Side-effects:
- * The mbuf passed will be released if a mapping failure occurs.
- * The segment mapping will be udpated if the mapping is successful.
+ * Modifies:
+ * fp->disable_tpa
+ * fp->rx_sge_prod
*/
static int
-bxe_map_mbuf(struct bxe_fastpath *fp, struct mbuf *m, bus_dma_tag_t tag,
- bus_dmamap_t map, bus_dma_segment_t *seg)
+bxe_fill_sg_chain(struct bxe_fastpath *fp)
{
struct bxe_softc *sc;
- bus_dma_segment_t segs[4];
- int nsegs, rc;
+ uint16_t index;
+ int i, rc;
+
sc = fp->sc;
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
rc = 0;
- DBENTER(BXE_INSANE);
-
-#ifdef BXE_DEBUG
- /* Simulate an mbuf mapping failure. */
- if (DB_RANDOMTRUE(bxe_debug_dma_map_addr_failure)) {
- DBPRINT(sc, BXE_WARN, "%s(): Simulated mbuf mapping failure!\n",
- __FUNCTION__);
- sc->debug_mbuf_sim_map_failed++;
- fp->mbuf_alloc_failed++;
- sc->debug_memory_allocated -= m->m_len;
- m_freem(m);
- rc = EINVAL;
- goto bxe_map_mbuf_exit;
+ if (!TPA_ENABLED(sc)) {
+ fp->disable_tpa = TRUE;
+ goto bxe_fill_sg_chain_exit;
}
-#endif
- /* Map the buffer memory into non-paged memory. */
- rc = bus_dmamap_load_mbuf_sg(tag, map, m, segs, &nsegs, BUS_DMA_NOWAIT);
+ /* Assume the fill operation works. */
+ fp->disable_tpa = FALSE;
- /* Handle any mapping errors. */
- if (__predict_false(rc)) {
- DBPRINT(sc, BXE_WARN, "%s(): mbuf mapping failure (%d) on "
- "fp[%02d]!\n", __FUNCTION__, rc, fp->index);
- fp->mbuf_alloc_failed++;
- DBRUN(sc->debug_memory_allocated -= m->m_len);
- m_freem(m);
- goto bxe_map_mbuf_exit;
+ /* Fill the RX SGE chain. */
+ index = 0;
+ for (i = 0; i < USABLE_RX_SGE; i++) {
+ rc = bxe_alloc_rx_sge_mbuf(fp, index);
+ if (rc != 0) {
+ BXE_PRINTF(
+ "%s(%d): fp[%02d] SGE memory allocation failure!\n",
+ __FILE__, __LINE__, fp->index);
+ index = 0;
+ fp->disable_tpa = TRUE;
+ break;
+ }
+ index = NEXT_SGE_IDX(index);
}
- /* All mubfs must map to a single segment. */
- KASSERT(nsegs == 1, ("%s(): Too many segments (%d) returned!",
- __FUNCTION__, nsegs));
-
- /* Save the DMA mapping tag for this memory buffer. */
- *seg = segs[0];
+ /* Update the driver's copy of the RX SGE producer index. */
+ fp->rx_sge_prod = index;
-bxe_map_mbuf_exit:
- DBEXIT(BXE_INSANE);
+bxe_fill_sg_chain_exit:
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
return (rc);
}
/*
- * Allocate an mbuf for the TPA pool.
+ * Free all elements from the receive scatter gather chain.
*
* Returns:
- * NULL on failure or an mbuf pointer on success.
+ * None
+ *
+ * Modifies:
+ * fp->rx_sge_buf_ptr[]
+ * fp->rx_sge_buf_map[]
+ * fp->sge_mbuf_alloc
*/
-static struct mbuf *
-bxe_alloc_tpa_mbuf(struct bxe_fastpath *fp, int index, int size)
+static void
+bxe_free_sg_chain(struct bxe_fastpath *fp)
{
- bus_dma_segment_t seg;
- struct mbuf *m;
- int rc;
-
- /* Allocate the new mbuf. */
- if ((m = bxe_alloc_mbuf(fp, size)) == NULL)
- goto bxe_alloc_tpa_mbuf_exit;
+ struct bxe_softc *sc;
+ int i;
- /* Map the mbuf into non-paged pool. */
- rc = bxe_map_mbuf(fp, m, fp->rx_mbuf_tag, fp->tpa_mbuf_map[index],
- &seg);
+ sc = fp->sc;
+ DBENTER(BXE_INSANE_TPA);
- if (rc) {
- m = NULL;
- goto bxe_alloc_tpa_mbuf_exit;
- }
+ if (fp->rx_sge_buf_tag == NULL)
+ goto bxe_free_sg_chain_exit;
- DBRUN(fp->tpa_mbuf_alloc++);
+ /* Free all mbufs and unload all maps. */
+ for (i = 0; i < TOTAL_RX_SGE; i++) {
+ /* Free the map and the mbuf if they're allocated. */
+ if (fp->rx_sge_buf_map[i] != NULL) {
+ bus_dmamap_sync(fp->rx_sge_buf_tag,
+ fp->rx_sge_buf_map[i], BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(fp->rx_sge_buf_tag,
+ fp->rx_sge_buf_map[i]);
+ }
- /* Save the mapping info for the mbuf. */
- fp->tpa_mbuf_segs[index] = seg;
+ if (fp->rx_sge_buf_ptr[i] != NULL) {
+ m_freem(fp->rx_sge_buf_ptr[i]);
+ DBRUN(fp->sge_mbuf_alloc--);
+ fp->rx_sge_buf_ptr[i] = NULL;
+ }
+ }
-bxe_alloc_tpa_mbuf_exit:
- return (m);
+bxe_free_sg_chain_exit:
+ DBEXIT(BXE_INSANE_TPA);
}
/*
- * Allocate a receive scatter gather entry
+ * Allocate an mbuf, if necessary, and add it to the receive chain.
*
* Returns:
- * 0 = Success, != Failure.
+ * 0 = Success, !0 = Failure.
*/
static int
-bxe_alloc_rx_sge(struct bxe_softc *sc, struct bxe_fastpath *fp,
- uint16_t ring_prod)
+bxe_alloc_rx_bd_mbuf(struct bxe_fastpath *fp, uint16_t index)
{
- struct eth_rx_sge *sge;
- bus_dma_segment_t seg;
+ struct bxe_softc *sc;
+ struct eth_rx_bd *rx_bd;
+ bus_dma_segment_t segs[1];
+ bus_dmamap_t map;
struct mbuf *m;
- int rc;
+ int nsegs, rc;
- sge = &fp->rx_sge_chain[RX_SGE_PAGE(ring_prod)][RX_SGE_IDX(ring_prod)];
+ sc = fp->sc;
+ DBENTER(BXE_INSANE_LOAD | BXE_INSANE_RESET | BXE_INSANE_RECV);
rc = 0;
- /* Allocate a new mbuf. */
- if ((m = bxe_alloc_mbuf(fp, PAGE_SIZE)) == NULL) {
+#ifdef BXE_DEBUG
+ /* Simulate an mbuf allocation failure. */
+ if (DB_RANDOMTRUE(bxe_debug_mbuf_allocation_failure)) {
+ sc->debug_sim_mbuf_alloc_failed++;
+ fp->mbuf_rx_bd_alloc_failed++;
rc = ENOMEM;
- goto bxe_alloc_rx_sge_exit;
+ goto bxe_alloc_rx_bd_mbuf_exit;
}
+#endif
- /* Map the mbuf into non-paged pool. */
- rc = bxe_map_mbuf(fp, m, fp->rx_sge_buf_tag,
- fp->rx_sge_buf_map[ring_prod], &seg);
+ /* Allocate the new RX BD mbuf. */
+ m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size);
+ if (__predict_false(m == NULL)) {
+ fp->mbuf_rx_bd_alloc_failed++;
+ rc = ENOBUFS;
+ goto bxe_alloc_rx_bd_mbuf_exit;
+ }
- if (rc)
- goto bxe_alloc_rx_sge_exit;
+ DBRUN(fp->rx_mbuf_alloc++);
- DBRUN(fp->sge_mbuf_alloc++);
+ /* Initialize the mbuf buffer length. */
+ m->m_pkthdr.len = m->m_len = sc->mbuf_alloc_size;
- /* Add the SGE buffer to the SGE ring. */
- sge->addr_hi = htole32(U64_HI(seg.ds_addr));
- sge->addr_lo = htole32(U64_LO(seg.ds_addr));
- fp->rx_sge_buf_ptr[ring_prod] = m;
+#ifdef BXE_DEBUG
+ /* Simulate an mbuf mapping failure. */
+ if (DB_RANDOMTRUE(bxe_debug_dma_map_addr_failure)) {
+ sc->debug_sim_mbuf_map_failed++;
+ fp->mbuf_rx_bd_mapping_failed++;
+ m_freem(m);
+ DBRUN(fp->rx_mbuf_alloc--);
+ rc = ENOMEM;
+ goto bxe_alloc_rx_bd_mbuf_exit;
+ }
+#endif
-bxe_alloc_rx_sge_exit:
+ /* Map the TPA mbuf into non-paged pool. */
+ rc = bus_dmamap_load_mbuf_sg(fp->rx_mbuf_tag,
+ fp->rx_mbuf_spare_map, m, segs, &nsegs, BUS_DMA_NOWAIT);
+ if (__predict_false(rc != 0)) {
+ fp->mbuf_rx_bd_mapping_failed++;
+ m_freem(m);
+ DBRUN(fp->rx_mbuf_alloc--);
+ goto bxe_alloc_rx_bd_mbuf_exit;
+ }
+
+ /* All mubfs must map to a single segment. */
+ KASSERT(nsegs == 1, ("%s(): Too many segments (%d) returned!",
+ __FUNCTION__, nsegs));
+
+ /* Release any existing RX BD mbuf mapping. */
+ if (fp->rx_mbuf_map[index] != NULL) {
+ bus_dmamap_sync(fp->rx_mbuf_tag,
+ fp->rx_mbuf_map[index], BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(fp->rx_mbuf_tag,
+ fp->rx_mbuf_map[index]);
+ }
+
+ /* Save the mbuf and mapping info. */
+ map = fp->rx_mbuf_map[index];
+ fp->rx_mbuf_map[index] = fp->rx_mbuf_spare_map;
+ fp->rx_mbuf_spare_map = map;
+ bus_dmamap_sync(fp->rx_mbuf_tag,
+ fp->rx_mbuf_map[index], BUS_DMASYNC_PREREAD);
+ fp->rx_mbuf_ptr[index] = m;
+ rx_bd = &fp->rx_chain[index];
+ rx_bd->addr_hi = htole32(U64_HI(segs[0].ds_addr));
+ rx_bd->addr_lo = htole32(U64_LO(segs[0].ds_addr));
+
+bxe_alloc_rx_bd_mbuf_exit:
+ DBEXIT(BXE_INSANE_LOAD | BXE_INSANE_RESET | BXE_INSANE_RECV);
return (rc);
}
+
+/*
+ * Allocate mbufs for a receive chain.
+ *
+ * Returns:
+ * 0 = Success, !0 = Failure.
+ *
+ * Modifies:
+ * fp->rx_bd_prod
+ */
+static int
+bxe_fill_rx_bd_chain(struct bxe_fastpath *fp)
+{
+ struct bxe_softc *sc;
+ uint16_t index;
+ int i, rc;
+
+ sc = fp->sc;
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ rc = index = 0;
+
+ /* Allocate buffers for all the RX BDs in RX BD Chain. */
+ for (i = 0; i < USABLE_RX_BD; i++) {
+ rc = bxe_alloc_rx_bd_mbuf(fp, index);
+ if (rc != 0) {
+ BXE_PRINTF(
+ "%s(%d): Memory allocation failure! Cannot fill fp[%02d] RX chain.\n",
+ __FILE__, __LINE__, fp->index);
+ index = 0;
+ break;
+ }
+ index = NEXT_RX_BD(index);
+ }
+
+ fp->rx_bd_prod = index;
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ return (rc);
+}
+
+/*
+ * Free all buffers from the receive chain.
+ *
+ * Returns:
+ * None
+ *
+ * Modifies:
+ * fp->rx_mbuf_ptr[]
+ * fp->rx_mbuf_map[]
+ * fp->rx_mbuf_alloc
+ */
+static void
+bxe_free_rx_bd_chain(struct bxe_fastpath *fp)
+{
+ struct bxe_softc *sc;
+ int i;
+
+ sc = fp->sc;
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+
+ if (fp->rx_mbuf_tag == NULL)
+ goto bxe_free_rx_bd_chain_exit;
+
+ /* Free all mbufs and unload all maps. */
+ for (i = 0; i < TOTAL_RX_BD; i++) {
+ if (fp->rx_mbuf_map[i] != NULL) {
+ bus_dmamap_sync(fp->rx_mbuf_tag, fp->rx_mbuf_map[i],
+ BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(fp->rx_mbuf_tag, fp->rx_mbuf_map[i]);
+ }
+
+ if (fp->rx_mbuf_ptr[i] != NULL) {
+ m_freem(fp->rx_mbuf_ptr[i]);
+ DBRUN(fp->rx_mbuf_alloc--);
+ fp->rx_mbuf_ptr[i] = NULL;
+ }
+ }
+
+bxe_free_rx_bd_chain_exit:
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+}
+
/*
+ * Setup mutexes used by the driver.
+ *
* Returns:
* None.
*/
static void
-bxe_alloc_mutexes(struct bxe_softc *sc)
+bxe_mutexes_alloc(struct bxe_softc *sc)
{
struct bxe_fastpath *fp;
int i;
@@ -10726,7 +11011,7 @@ bxe_alloc_mutexes(struct bxe_softc *sc)
BXE_PRINT_LOCK_INIT(sc, "bxe_print_lock");
/* Allocate one mutex for each fastpath structure. */
- for (i=0; i < sc->num_queues; i++ ) {
+ for (i = 0; i < sc->num_queues; i++ ) {
fp = &sc->fp[i];
/* Allocate per fastpath mutexes. */
@@ -10739,23 +11024,25 @@ bxe_alloc_mutexes(struct bxe_softc *sc)
}
/*
+ * Free mutexes used by the driver.
+ *
* Returns:
* None.
*/
static void
-bxe_free_mutexes(struct bxe_softc *sc)
+bxe_mutexes_free(struct bxe_softc *sc)
{
struct bxe_fastpath *fp;
int i;
DBENTER(BXE_VERBOSE_UNLOAD);
- for (i=0; i < sc->num_queues; i++ ) {
+ for (i = 0; i < sc->num_queues; i++ ) {
fp = &sc->fp[i];
/* Release per fastpath mutexes. */
- if (mtx_initialized(&(fp->mtx)))
- mtx_destroy(&(fp->mtx));
+ if (mtx_initialized(&fp->mtx))
+ mtx_destroy(&fp->mtx);
}
BXE_PRINT_LOCK_DESTROY(sc);
@@ -10769,7 +11056,42 @@ bxe_free_mutexes(struct bxe_softc *sc)
}
+/*
+ * Free memory and clear the RX data structures.
+ *
+ * Returns:
+ * Nothing.
+ */
+static void
+bxe_clear_rx_chains(struct bxe_softc *sc)
+{
+ struct bxe_fastpath *fp;
+ int i;
+ DBENTER(BXE_VERBOSE_RESET);
+
+ for (i = 0; i < sc->num_queues; i++) {
+ fp = &sc->fp[i];
+
+ /* Free all RX buffers. */
+ bxe_free_rx_bd_chain(fp);
+ bxe_free_tpa_pool(fp);
+ bxe_free_sg_chain(fp);
+
+ /* Check if any mbufs lost in the process. */
+ DBRUNIF((fp->tpa_mbuf_alloc), DBPRINT(sc, BXE_FATAL,
+ "%s(): Memory leak! Lost %d mbufs from fp[%02d] TPA pool!\n",
+ __FUNCTION__, fp->tpa_mbuf_alloc, fp->index));
+ DBRUNIF((fp->sge_mbuf_alloc), DBPRINT(sc, BXE_FATAL,
+ "%s(): Memory leak! Lost %d mbufs from fp[%02d] SGE chain!\n",
+ __FUNCTION__, fp->sge_mbuf_alloc, fp->index));
+ DBRUNIF((fp->rx_mbuf_alloc), DBPRINT(sc, BXE_FATAL,
+ "%s(): Memory leak! Lost %d mbufs from fp[%02d] RX chain!\n",
+ __FUNCTION__, fp->rx_mbuf_alloc, fp->index));
+ }
+
+ DBEXIT(BXE_VERBOSE_RESET);
+}
/*
* Initialize the receive rings.
@@ -10777,69 +11099,26 @@ bxe_free_mutexes(struct bxe_softc *sc)
* Returns:
* None.
*/
-static void
+static int
bxe_init_rx_chains(struct bxe_softc *sc)
{
struct bxe_fastpath *fp;
- struct eth_rx_sge *sge;
- struct eth_rx_bd *rx_bd;
- struct eth_rx_cqe_next_page *nextpg;
- uint16_t rx_bd_prod, rx_sge_prod;
- int func, i, j, rcq_idx, rx_idx, rx_sge_idx, max_agg_queues;
+ int func, i, rc;
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
-
+ rc = 0;
func = BP_FUNC(sc);
- max_agg_queues = CHIP_IS_E1(sc) ? ETH_MAX_AGGREGATION_QUEUES_E1 :
- ETH_MAX_AGGREGATION_QUEUES_E1H;
-
- sc->rx_buf_size = sc->mbuf_alloc_size;
-
- /* Allocate memory for the TPA pool. */
- if (TPA_ENABLED(sc)) {
- DBPRINT(sc, (BXE_INFO_LOAD | BXE_INFO_RESET),
- "%s(): mtu = %d, rx_buf_size = %d\n", __FUNCTION__,
- (int)sc->bxe_ifp->if_mtu, sc->rx_buf_size);
-
- for (i = 0; i < sc->num_queues; i++) {
- fp = &sc->fp[i];
- DBPRINT(sc, (BXE_INSANE_LOAD | BXE_INSANE_RESET),
- "%s(): Initializing fp[%02d] TPA pool.\n",
- __FUNCTION__, i);
-
- for (j = 0; j < max_agg_queues; j++) {
- DBPRINT(sc,
- (BXE_INSANE_LOAD | BXE_INSANE_RESET),
- "%s(): Initializing fp[%02d] TPA "
- "pool[%d].\n", __FUNCTION__, i, j);
-
- fp->disable_tpa = 0;
- fp->tpa_mbuf_ptr[j] = bxe_alloc_tpa_mbuf(fp, j,
- sc->mbuf_alloc_size);
-
- if (fp->tpa_mbuf_ptr[j] == NULL) {
- fp->tpa_mbuf_alloc_failed++;
- BXE_PRINTF("TPA disabled on "
- "fp[%02d]!\n", i);
- bxe_free_tpa_pool(fp, j);
- fp->disable_tpa = 1;
- break;
- }
- fp->tpa_state[j] = BXE_TPA_STATE_STOP;
- }
- }
- }
/* Allocate memory for RX and CQ chains. */
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET),
- "%s(): Initializing fp[%d] RX chain.\n", __FUNCTION__, i);
+ "%s(): Initializing fp[%02d] RX chain.\n", __FUNCTION__, i);
fp->rx_bd_cons = fp->rx_bd_prod = 0;
fp->rx_cq_cons = fp->rx_cq_prod = 0;
- /* Status block's completion queue consumer index. */
+ /* Pointer to status block's CQ consumer index. */
fp->rx_cq_cons_sb = &fp->status_block->
u_status_block.index_values[HC_INDEX_U_ETH_RX_CQ_CONS];
@@ -10847,138 +11126,30 @@ bxe_init_rx_chains(struct bxe_softc *sc)
fp->rx_bd_cons_sb = &fp->status_block->
u_status_block.index_values[HC_INDEX_U_ETH_RX_BD_CONS];
- if (TPA_ENABLED(sc)) {
- DBPRINT(sc, (BXE_INSANE_LOAD | BXE_INSANE_RESET),
- "%s(): Linking fp[%d] SGE rings.\n", __FUNCTION__,
- i);
-
- /* Link the SGE Ring Pages to form SGE chain */
- for (j = 0; j < NUM_RX_SGE_PAGES; j++) {
- rx_sge_idx = ((j + 1) % NUM_RX_SGE_PAGES);
- sge = &fp->rx_sge_chain[j][MAX_RX_SGE_CNT];
-
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): fp[%02d].rx_sge_chain[%02d][0x%04X]=0x%jX\n",
- __FUNCTION__, i, j,
- (uint16_t) MAX_RX_SGE_CNT,
- (uintmax_t) fp->rx_sge_chain_paddr[rx_sge_idx]);
-
- sge->addr_hi =
- htole32(U64_HI(fp->rx_sge_chain_paddr[rx_sge_idx]));
- sge->addr_lo =
- htole32(U64_LO(fp->rx_sge_chain_paddr[rx_sge_idx]));
- }
-
- bxe_init_sge_ring_bit_mask(fp);
- }
-
- DBPRINT(sc, (BXE_INSANE_LOAD | BXE_INSANE_RESET),
- "%s(): Linking fp[%d] RX chain pages.\n", __FUNCTION__, i);
-
- /* Link the pages to form the RX BD Chain. */
- for (j = 0; j < NUM_RX_PAGES; j++) {
- rx_idx = ((j + 1) % NUM_RX_PAGES);
- rx_bd = &fp->rx_bd_chain[j][USABLE_RX_BD_PER_PAGE];
-
- DBPRINT(sc, (BXE_EXTREME_LOAD),
- "%s(): fp[%02d].rx_bd_chain[%02d][0x%04X]=0x%jX\n",
- __FUNCTION__, i, j,
- (uint16_t) USABLE_RX_BD_PER_PAGE,
- (uintmax_t) fp->rx_bd_chain_paddr[rx_idx]);
-
- rx_bd->addr_hi =
- htole32(U64_HI(fp->rx_bd_chain_paddr[rx_idx]));
- rx_bd->addr_lo =
- htole32(U64_LO(fp->rx_bd_chain_paddr[rx_idx]));
- }
-
- DBPRINT(sc, (BXE_INSANE_LOAD | BXE_INSANE_RESET),
- "%s(): Linking fp[%d] RX completion chain pages.\n",
- __FUNCTION__, i);
-
- /* Link the pages to form the RX Completion Queue.*/
- for (j = 0; j < NUM_RCQ_PAGES; j++) {
- rcq_idx = ((j + 1) % NUM_RCQ_PAGES);
- nextpg = (struct eth_rx_cqe_next_page *)
- &fp->rx_cq_chain[j][USABLE_RCQ_ENTRIES_PER_PAGE];
-
- DBPRINT(sc, (BXE_EXTREME_LOAD),
- "%s(): fp[%02d].rx_cq_chain[%02d][0x%04X]=0x%jX\n",
- __FUNCTION__, i, j,
- (uint16_t) USABLE_RCQ_ENTRIES_PER_PAGE,
- (uintmax_t) fp->rx_cq_chain_paddr[rcq_idx]);
-
- nextpg->addr_hi =
- htole32(U64_HI(fp->rx_cq_chain_paddr[rcq_idx]));
- nextpg->addr_lo =
- htole32(U64_LO(fp->rx_cq_chain_paddr[rcq_idx]));
- }
-
- if (TPA_ENABLED(sc)) {
- /* Allocate SGEs and initialize the ring elements. */
- rx_sge_prod = 0;
-
- while (rx_sge_prod < sc->rx_ring_size) {
- if (bxe_alloc_rx_sge(sc, fp, rx_sge_prod) != 0) {
- fp->tpa_mbuf_alloc_failed++;
- BXE_PRINTF(
- "%s(%d): Memory allocation failure! "
- "Disabling TPA for fp[%02d].\n",
- __FILE__, __LINE__, i);
-
- /* Cleanup already allocated elements */
- bxe_free_rx_sge_range(sc, fp,
- rx_sge_prod);
- fp->disable_tpa = 1;
- rx_sge_prod = 0;
- break;
- }
- rx_sge_prod = NEXT_SGE_IDX(rx_sge_prod);
- }
-
- fp->rx_sge_prod = rx_sge_prod;
- }
-
- /*
- * Allocate buffers for all the RX BDs in RX BD Chain.
- */
- rx_bd_prod = 0;
- DBRUN(fp->free_rx_bd = sc->rx_ring_size);
-
- for (j = 0; j < sc->rx_ring_size; j++) {
- if (bxe_get_buf(fp, NULL, rx_bd_prod)) {
- BXE_PRINTF(
- "%s(%d): Memory allocation failure! Cannot fill fp[%d] RX chain.\n",
- __FILE__, __LINE__, i);
- break;
- }
- rx_bd_prod = NEXT_RX_BD(rx_bd_prod);
- }
-
- /* Update the driver's copy of the producer indices. */
- fp->rx_bd_prod = rx_bd_prod;
fp->rx_cq_prod = TOTAL_RCQ_ENTRIES;
- fp->rx_pkts = fp->rx_calls = 0;
+ fp->rx_pkts = fp->rx_tpa_pkts = fp->rx_soft_errors = 0;
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET),
- "%s(): USABLE_RX_BD=0x%04X, USABLE_RCQ_ENTRIES=0x%04X\n",
- __FUNCTION__, (uint16_t) USABLE_RX_BD,
- (uint16_t) USABLE_RCQ_ENTRIES);
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET),
- "%s(): fp[%02d]->rx_bd_prod=0x%04X, rx_cq_prod=0x%04X\n",
- __FUNCTION__, i, fp->rx_bd_prod, fp->rx_cq_prod);
+ /* Allocate memory for the receive chain. */
+ rc = bxe_fill_rx_bd_chain(fp);
+ if (rc != 0)
+ goto bxe_init_rx_chains_exit;
+
+ /* Allocate memory for TPA pool. */
+ rc = bxe_fill_tpa_pool(fp);
+ if (rc != 0)
+ goto bxe_init_rx_chains_exit;
+ /* Allocate memory for scatter-gather chain. */
+ rc = bxe_fill_sg_chain(fp);
+ if (rc != 0)
+ goto bxe_init_rx_chains_exit;
- /* Prepare the recevie BD and CQ buffers for DMA access. */
- for (j = 0; j < NUM_RX_PAGES; j++)
- bus_dmamap_sync(fp->rx_bd_chain_tag,
- fp->rx_bd_chain_map[j], BUS_DMASYNC_PREREAD |
- BUS_DMASYNC_PREWRITE);
+ /* Prepare the receive BD and CQ buffers for DMA access. */
+ bus_dmamap_sync(fp->rx_dma.tag, fp->rx_dma.map,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
- for (j = 0; j < NUM_RCQ_PAGES; j++)
- bus_dmamap_sync(fp->rx_cq_chain_tag,
- fp->rx_cq_chain_map[j], BUS_DMASYNC_PREREAD |
- BUS_DMASYNC_PREWRITE);
+ bus_dmamap_sync(fp->rcq_dma.tag, fp->rcq_dma.map,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
/*
* Tell the controller that we have rx_bd's and CQE's
@@ -10989,6 +11160,7 @@ bxe_init_rx_chains(struct bxe_softc *sc)
bxe_update_rx_prod(sc, fp, fp->rx_bd_prod,
fp->rx_cq_prod, fp->rx_sge_prod);
+ /* ToDo - Move to dma_alloc(). */
/*
* Tell controller where the receive CQ
* chains start in physical memory.
@@ -10996,214 +11168,123 @@ bxe_init_rx_chains(struct bxe_softc *sc)
if (i == 0) {
REG_WR(sc, BAR_USTORM_INTMEM +
USTORM_MEM_WORKAROUND_ADDRESS_OFFSET(func),
- U64_LO(fp->rx_cq_chain_paddr[0]));
+ U64_LO(fp->rcq_dma.paddr));
REG_WR(sc, BAR_USTORM_INTMEM +
USTORM_MEM_WORKAROUND_ADDRESS_OFFSET(func) + 4,
- U64_HI(fp->rx_cq_chain_paddr[0]));
+ U64_HI(fp->rcq_dma.paddr));
}
}
- /*
- * ToDo: Need a cleanup path if memory allocation
- * fails during initializtion. This is especially
- * easy if multiqueue is used on a system with
- * jumbo frames and many CPUs. On my 16GB system
- * with 8 CPUs I get the following defaults:
- *
- * kern.ipc.nmbjumbo16: 3200
- * kern.ipc.nmbjumbo9: 6400
- * kern.ipc.nmbjumbop: 12800
- * kern.ipc.nmbclusters: 25600
- */
-
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
-}
-
-/*
- * Initialize the transmit chain.
- *
- * Returns:
- * None.
- */
-static void
-bxe_init_tx_chains(struct bxe_softc *sc)
-{
- struct bxe_fastpath *fp;
- struct eth_tx_next_bd *tx_n_bd;
- int i, j;
-
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
-
- for (i = 0; i < sc->num_queues; i++) {
- fp = &sc->fp[i];
-
- DBPRINT(sc, (BXE_INSANE_LOAD | BXE_INSANE_RESET),
- "%s(): Linking fp[%d] TX chain pages.\n", __FUNCTION__, i);
-
- for (j = 0; j < NUM_TX_PAGES; j++) {
- tx_n_bd =
- &fp->tx_bd_chain[j][USABLE_TX_BD_PER_PAGE].next_bd;
-
- DBPRINT(sc, (BXE_INSANE_LOAD | BXE_INSANE_RESET),
- "%s(): Linking fp[%d] TX BD chain page[%d].\n",
- __FUNCTION__, i, j);
-
- tx_n_bd->addr_hi =
- htole32(U64_HI(fp->tx_bd_chain_paddr[(j + 1) %
- NUM_TX_PAGES]));
- tx_n_bd->addr_lo =
- htole32(U64_LO(fp->tx_bd_chain_paddr[(j + 1) %
- NUM_TX_PAGES]));
- }
-
- fp->tx_db.data.header.header = DOORBELL_HDR_DB_TYPE;
- fp->tx_db.data.zero_fill1 = 0;
- fp->tx_db.data.prod = 0;
-
- fp->tx_pkt_prod = 0;
- fp->tx_pkt_cons = 0;
- fp->tx_bd_prod = 0;
- fp->tx_bd_cons = 0;
- fp->used_tx_bd = 0;
-
- /*
- * Copy of TX BD Chain completion queue Consumer Index
- * from the Status Block.
- */
- fp->tx_cons_sb =
- &fp->status_block->c_status_block.index_values[C_SB_ETH_TX_CQ_INDEX];
-
- fp->tx_pkts = 0;
- }
+bxe_init_rx_chains_exit:
+ /* Release memory if an error occurred. */
+ if (rc != 0)
+ bxe_clear_rx_chains(sc);
DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ return (rc);
}
/*
- * Free memory and clear the RX data structures.
+ * Free memory and clear the TX data structures.
*
* Returns:
* Nothing.
*/
static void
-bxe_free_rx_chains(struct bxe_softc *sc)
+bxe_clear_tx_chains(struct bxe_softc *sc)
{
struct bxe_fastpath *fp;
- int i, j, max_agg_queues;
+ int i, j;
DBENTER(BXE_VERBOSE_RESET);
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
- if (fp->rx_mbuf_tag) {
- /* Free any mbufs still in the RX mbuf chain. */
- for (j = 0; j < TOTAL_RX_BD; j++) {
- if (fp->rx_mbuf_ptr[j] != NULL) {
- if (fp->rx_mbuf_map[j] != NULL)
- bus_dmamap_sync(fp->rx_mbuf_tag,
- fp->rx_mbuf_map[j],
- BUS_DMASYNC_POSTREAD);
- DBRUN(fp->rx_mbuf_alloc--);
- m_freem(fp->rx_mbuf_ptr[j]);
- fp->rx_mbuf_ptr[j] = NULL;
- }
- }
-
- /* Clear each RX chain page. */
- for (j = 0; j < NUM_RX_PAGES; j++) {
- if (fp->rx_bd_chain[j] != NULL)
- bzero((char *)fp->rx_bd_chain[j],
- BXE_RX_CHAIN_PAGE_SZ);
- }
- /* Clear each RX completion queue page. */
- for (j = 0; j < NUM_RCQ_PAGES; j++) {
- if (fp->rx_cq_chain[j] != NULL)
- bzero((char *)fp->rx_cq_chain[j],
- BXE_RX_CHAIN_PAGE_SZ);
- }
-
- if (TPA_ENABLED(sc)) {
- max_agg_queues = CHIP_IS_E1H(sc) ?
- ETH_MAX_AGGREGATION_QUEUES_E1H :
- ETH_MAX_AGGREGATION_QUEUES_E1;
-
- /* Free the TPA Pool mbufs. */
- bxe_free_tpa_pool(fp, max_agg_queues);
-
- /*
- * Free any mbufs still in the RX SGE
- * buf chain.
- */
- bxe_free_rx_sge_range(fp->sc, fp, MAX_RX_SGE);
-
- /* Clear each RX SGE page. */
- for (j = 0; j < NUM_RX_SGE_PAGES; j++) {
- if (fp->rx_sge_chain[j] != NULL)
- bzero(
- (char *)fp->rx_sge_chain[j],
- BXE_RX_CHAIN_PAGE_SZ);
+ /* Free all mbufs and unload all maps. */
+ if (fp->tx_mbuf_tag) {
+ for (j = 0; j < TOTAL_TX_BD; j++) {
+ if (fp->tx_mbuf_ptr[j] != NULL) {
+ bus_dmamap_sync(fp->tx_mbuf_tag,
+ fp->tx_mbuf_map[j],
+ BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(fp->tx_mbuf_tag,
+ fp->tx_mbuf_map[j]);
+ m_freem(fp->tx_mbuf_ptr[j]);
+ fp->tx_mbuf_alloc--;
+ fp->tx_mbuf_ptr[j] = NULL;
}
}
}
/* Check if we lost any mbufs in the process. */
- DBRUNIF((fp->rx_mbuf_alloc), DBPRINT(sc, BXE_FATAL,
- "%s(): Memory leak! Lost %d mbufs from fp[%d] RX chain!\n",
- __FUNCTION__, fp->rx_mbuf_alloc, fp->index));
+ DBRUNIF((fp->tx_mbuf_alloc), DBPRINT(sc, BXE_FATAL,
+ "%s(): Memory leak! Lost %d mbufs from fp[%02d] TX chain!\n",
+ __FUNCTION__, fp->tx_mbuf_alloc, fp->index));
}
DBEXIT(BXE_VERBOSE_RESET);
}
/*
- * Free memory and clear the TX data structures.
+ * Initialize the transmit chain.
*
* Returns:
- * Nothing.
+ * None.
*/
static void
-bxe_free_tx_chains(struct bxe_softc *sc)
+bxe_init_tx_chains(struct bxe_softc *sc)
{
struct bxe_fastpath *fp;
int i, j;
- DBENTER(BXE_VERBOSE_RESET);
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
- if (fp->tx_mbuf_tag) {
- /*
- * Unmap, unload, and free any mbufs in the
- * TX mbuf chain.
- */
- for (j = 0; j < TOTAL_TX_BD; j++) {
- if (fp->tx_mbuf_ptr[j] != NULL) {
- if (fp->tx_mbuf_map[j] != NULL)
- bus_dmamap_sync(fp->tx_mbuf_tag,
- fp->tx_mbuf_map[j],
- BUS_DMASYNC_POSTWRITE);
- DBRUN(fp->tx_mbuf_alloc--);
- m_freem(fp->tx_mbuf_ptr[j]);
- fp->tx_mbuf_ptr[j] = NULL;
- }
- }
- /* Clear each TX chain page. */
- for (j = 0; j < NUM_TX_PAGES; j++) {
- if (fp->tx_bd_chain[j] != NULL)
- bzero((char *)fp->tx_bd_chain[j],
- BXE_TX_CHAIN_PAGE_SZ);
- }
+ /* Initialize transmit doorbell. */
+ fp->tx_db.data.header.header = DOORBELL_HDR_DB_TYPE;
+ fp->tx_db.data.zero_fill1 = 0;
+ fp->tx_db.data.prod = 0;
+
+ /* Initialize tranmsit producer/consumer indices. */
+ fp->tx_pkt_prod = fp->tx_pkt_cons = 0;
+ fp->tx_bd_prod = fp->tx_bd_cons = 0;
+ fp->tx_bd_used = 0;
- /* Check if we lost any mbufs in the process. */
- DBRUNIF((fp->tx_mbuf_alloc), DBPRINT(sc, BXE_FATAL,
- "%s(): Memory leak! Lost %d mbufs from fp[%d] TX chain!\n",
- __FUNCTION__, fp->tx_mbuf_alloc, fp->index));
+ /* Pointer to TX packet consumer in status block. */
+ fp->tx_pkt_cons_sb =
+ &fp->status_block->c_status_block.index_values[C_SB_ETH_TX_CQ_INDEX];
+
+ /* Soft TX counters. */
+ fp->tx_pkts = 0;
+ fp->tx_soft_errors = 0;
+ fp->tx_offload_frames_csum_ip = 0;
+ fp->tx_offload_frames_csum_tcp = 0;
+ fp->tx_offload_frames_csum_udp = 0;
+ fp->tx_offload_frames_tso = 0;
+ fp->tx_header_splits = 0;
+ fp->tx_encap_failures = 0;
+ fp->tx_hw_queue_full = 0;
+ fp->tx_hw_max_queue_depth = 0;
+ fp->tx_dma_mapping_failure = 0;
+ fp->tx_max_drbr_queue_depth = 0;
+ fp->tx_window_violation_std = 0;
+ fp->tx_window_violation_tso = 0;
+ fp->tx_unsupported_tso_request_ipv6 = 0;
+ fp->tx_unsupported_tso_request_not_tcp = 0;
+ fp->tx_chain_lost_mbuf = 0;
+ fp->tx_frame_deferred = 0;
+ fp->tx_queue_xoff = 0;
+
+ /* Clear all TX mbuf pointers. */
+ for (j = 0; j < TOTAL_TX_BD; j++) {
+ fp->tx_mbuf_ptr[j] = NULL;
}
}
- DBEXIT(BXE_VERBOSE_RESET);
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
}
/*
@@ -11232,9 +11313,9 @@ bxe_init_sp_ring(struct bxe_softc *sc)
/* Tell the controller the address of the slowpath ring. */
REG_WR(sc, XSEM_REG_FAST_MEMORY + XSTORM_SPQ_PAGE_BASE_OFFSET(func),
- U64_LO(sc->spq_paddr));
+ U64_LO(sc->spq_dma.paddr));
REG_WR(sc, XSEM_REG_FAST_MEMORY + XSTORM_SPQ_PAGE_BASE_OFFSET(func) + 4,
- U64_HI(sc->spq_paddr));
+ U64_HI(sc->spq_dma.paddr));
REG_WR(sc, XSEM_REG_FAST_MEMORY + XSTORM_SPQ_PROD_OFFSET(func),
sc->spq_prod_idx);
@@ -11283,27 +11364,33 @@ bxe_init_context(struct bxe_softc *sc)
context->ustorm_st_context.common.mc_alignment_log_size = 8;
/* Set the size of the receive buffers. */
context->ustorm_st_context.common.bd_buff_size =
- sc->rx_buf_size;
+ sc->mbuf_alloc_size;
/* Set the address of the receive chain base page. */
context->ustorm_st_context.common.bd_page_base_hi =
- U64_HI(fp->rx_bd_chain_paddr[0]);
+ U64_HI(fp->rx_dma.paddr);
context->ustorm_st_context.common.bd_page_base_lo =
- U64_LO(fp->rx_bd_chain_paddr[0]);
+ U64_LO(fp->rx_dma.paddr);
- if (TPA_ENABLED(sc) && !(fp->disable_tpa)) {
+ if (TPA_ENABLED(sc) && (fp->disable_tpa == FALSE)) {
/* Enable TPA and SGE chain support. */
context->ustorm_st_context.common.flags |=
USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA;
+
/* Set the size of the SGE buffer. */
context->ustorm_st_context.common.sge_buff_size =
- (uint16_t) (PAGES_PER_SGE * BCM_PAGE_SIZE);
+ (uint16_t) (SGE_PAGE_SIZE * PAGES_PER_SGE);
+
/* Set the address of the SGE chain base page. */
context->ustorm_st_context.common.sge_page_base_hi =
- U64_HI(fp->rx_sge_chain_paddr[0]);
+ U64_HI(fp->sg_dma.paddr);
context->ustorm_st_context.common.sge_page_base_lo =
- U64_LO(fp->rx_sge_chain_paddr[0]);
+ U64_LO(fp->sg_dma.paddr);
+
+ DBPRINT(sc, BXE_VERBOSE_TPA, "%s(): MTU = %d\n",
+ __FUNCTION__, (int) sc->bxe_ifp->if_mtu);
+ /* Describe MTU to SGE alignment. */
context->ustorm_st_context.common.max_sges_for_packet =
SGE_PAGE_ALIGN(sc->bxe_ifp->if_mtu) >>
SGE_PAGE_SHIFT;
@@ -11311,6 +11398,10 @@ bxe_init_context(struct bxe_softc *sc)
((context->ustorm_st_context.common.
max_sges_for_packet + PAGES_PER_SGE - 1) &
(~(PAGES_PER_SGE - 1))) >> PAGES_PER_SGE_SHIFT;
+
+ DBPRINT(sc, BXE_VERBOSE_TPA,
+ "%s(): max_sges_for_packet = %d\n", __FUNCTION__,
+ context->ustorm_st_context.common.max_sges_for_packet);
}
/* Update USTORM context. */
@@ -11325,9 +11416,9 @@ bxe_init_context(struct bxe_softc *sc)
/* Set the address of the transmit chain base page. */
context->xstorm_st_context.tx_bd_page_base_hi =
- U64_HI(fp->tx_bd_chain_paddr[0]);
+ U64_HI(fp->tx_dma.paddr);
context->xstorm_st_context.tx_bd_page_base_lo =
- U64_LO(fp->tx_bd_chain_paddr[0]);
+ U64_LO(fp->tx_dma.paddr);
/* Enable XSTORM statistics. */
context->xstorm_st_context.statistics_data = (cl_id |
@@ -11592,7 +11683,7 @@ bxe_init_internal_func(struct bxe_softc *sc)
}
/* Enable TPA if needed */
- if (sc->bxe_flags & BXE_TPA_ENABLE_FLAG)
+ if (TPA_ENABLED(sc))
tstorm_config.config_flags |=
TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;
@@ -11693,21 +11784,24 @@ bxe_init_internal_func(struct bxe_softc *sc)
}
/* Init completion queue mapping and TPA aggregation size. */
- max_agg_size = min((uint32_t)(sc->rx_buf_size + 8 * BCM_PAGE_SIZE *
- PAGES_PER_SGE), (uint32_t)0xffff);
+ max_agg_size = min((uint32_t)(sc->mbuf_alloc_size +
+ (8 * BCM_PAGE_SIZE * PAGES_PER_SGE)), (uint32_t)0xffff);
+
+ DBPRINT(sc, BXE_VERBOSE_TPA, "%s(): max_agg_size = 0x%08X\n",
+ __FUNCTION__, max_agg_size);
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
nextpg = (struct eth_rx_cqe_next_page *)
- &fp->rx_cq_chain[0][USABLE_RCQ_ENTRIES_PER_PAGE];
+ &fp->rcq_chain[USABLE_RCQ_ENTRIES_PER_PAGE];
/* Program the completion queue address. */
REG_WR(sc, BAR_USTORM_INTMEM +
USTORM_CQE_PAGE_BASE_OFFSET(port, fp->cl_id),
- U64_LO(fp->rx_cq_chain_paddr[0]));
+ U64_LO(fp->rcq_dma.paddr));
REG_WR(sc, BAR_USTORM_INTMEM +
USTORM_CQE_PAGE_BASE_OFFSET(port, fp->cl_id) + 4,
- U64_HI(fp->rx_cq_chain_paddr[0]));
+ U64_HI(fp->rcq_dma.paddr));
/* Program the first CQ next page address. */
REG_WR(sc, BAR_USTORM_INTMEM +
@@ -11735,7 +11829,7 @@ bxe_init_internal_func(struct bxe_softc *sc)
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
- if (!fp->disable_tpa) {
+ if (fp->disable_tpa == FALSE) {
rx_pause.sge_thr_low = 150;
rx_pause.sge_thr_high = 250;
}
@@ -11818,18 +11912,18 @@ bxe_init_internal(struct bxe_softc *sc, uint32_t load_code)
* Returns:
* None
*/
-static void
+static int
bxe_init_nic(struct bxe_softc *sc, uint32_t load_code)
{
struct bxe_fastpath *fp;
- int i;
+ int i, rc;
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
/* Intialize fastpath structures and the status block. */
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
- fp->disable_tpa = 1;
+ fp->disable_tpa = TRUE;
bzero((char *)fp->status_block, BXE_STATUS_BLK_SZ);
fp->fp_u_idx = 0;
@@ -11851,29 +11945,31 @@ bxe_init_nic(struct bxe_softc *sc, uint32_t load_code)
fp->sb_id = fp->cl_id;
DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET),
- "%s(): fp[%d]: cl_id = %d, sb_id = %d\n",
+ "%s(): fp[%02d]: cl_id = %d, sb_id = %d\n",
__FUNCTION__, fp->index, fp->cl_id, fp->sb_id);
/* Initialize the fastpath status block. */
- bxe_init_sb(sc, fp->status_block, fp->status_block_paddr,
+ bxe_init_sb(sc, fp->status_block, fp->sb_dma.paddr,
fp->sb_id);
bxe_update_fpsb_idx(fp);
}
rmb();
- bzero((char *)sc->def_status_block, BXE_DEF_STATUS_BLK_SZ);
+ bzero((char *)sc->def_sb, BXE_DEF_STATUS_BLK_SZ);
/* Initialize the Default Status Block. */
- bxe_init_def_sb(sc, sc->def_status_block, sc->def_status_block_paddr,
- DEF_SB_ID);
+ bxe_init_def_sb(sc, sc->def_sb, sc->def_sb_dma.paddr, DEF_SB_ID);
bxe_update_dsb_idx(sc);
/* Initialize the coalescence parameters. */
bxe_update_coalesce(sc);
- /* Intiialize the Receive BD Chain and Receive Completion Chain. */
- bxe_init_rx_chains(sc);
+ /* Initialize receive chains. */
+ rc = bxe_init_rx_chains(sc);
+ if (rc != 0) {
+ goto bxe_init_nic_exit;
+ }
/* Initialize the Transmit BD Chain. */
bxe_init_tx_chains(sc);
@@ -11895,46 +11991,7 @@ bxe_init_nic(struct bxe_softc *sc, uint32_t load_code)
/* Disable the interrupts from device until init is complete.*/
bxe_int_disable(sc);
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
-}
-
-/*
-*
-* Returns:
-* 0 = Success, !0 = Failure
-*/
-static int
-bxe_gunzip_init(struct bxe_softc *sc)
-{
- int rc;
-
- rc = 0;
-
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
-
- bxe_dmamem_alloc(sc, sc->gunzip_tag, sc->gunzip_map, sc->gunzip_buf,
- FW_BUF_SIZE, &sc->gunzip_mapping);
-
- if (sc->gunzip_buf == NULL)
- goto bxe_gunzip_init_nomem1;
-
- sc->strm = malloc(sizeof(*sc->strm), M_DEVBUF, M_NOWAIT);
- if (sc->strm == NULL)
- goto bxe_gunzip_init_nomem2;
-
- goto bxe_gunzip_init_exit;
-
-bxe_gunzip_init_nomem2:
- bxe_dmamem_free(sc, sc->gunzip_tag, sc->gunzip_buf, sc->gunzip_map);
- sc->gunzip_buf = NULL;
-
-bxe_gunzip_init_nomem1:
- BXE_PRINTF(
- "%s(%d): Cannot allocate firmware buffer for decompression!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
-
-bxe_gunzip_init_exit:
+bxe_init_nic_exit:
DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
return (rc);
}
@@ -11948,14 +12005,14 @@ bxe_gunzip_init_exit:
static void
bxe_lb_pckt(struct bxe_softc *sc)
{
-#ifdef USE_DMAE
+#ifdef BXE_USE_DMAE
uint32_t wb_write[3];
#endif
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
/* Ethernet source and destination addresses. */
-#ifdef USE_DMAE
+#ifdef BXE_USE_DMAE
wb_write[0] = 0x55555555;
wb_write[1] = 0x55555555;
wb_write[2] = 0x20; /* SOP */
@@ -11967,7 +12024,7 @@ bxe_lb_pckt(struct bxe_softc *sc)
#endif
/* NON-IP protocol. */
-#ifdef USE_DMAE
+#ifdef BXE_USE_DMAE
wb_write[0] = 0x09000000;
wb_write[1] = 0x55555555;
wb_write[2] = 0x10; /* EOP */
@@ -12130,7 +12187,8 @@ bxe_int_mem_test(struct bxe_softc *sc)
val = REG_RD(sc, NIG_REG_INGRESS_EOP_LB_EMPTY);
if (val != 1) {
- DBPRINT(sc, BXE_INFO, "clear of NIG failed\n");
+ DBPRINT(sc, BXE_INFO, "%s(): Unable to clear NIG!\n",
+ __FUNCTION__);
rc = 6;
goto bxe_int_mem_test_exit;
}
@@ -12495,7 +12553,7 @@ bxe_setup_fan_failure_detection(struct bxe_softc *sc)
int is_required, port;
is_required = 0;
- if (BP_NOMCP(sc))
+ if (NOMCP(sc))
return;
val = SHMEM_RD(sc, dev_info.shared_hw_config.config2) &
@@ -12787,7 +12845,7 @@ bxe_init_common(struct bxe_softc *sc)
bxe_enable_blocks_attention(sc);
- if (!BP_NOMCP(sc)) {
+ if (!NOMCP(sc)) {
bxe_acquire_phy_lock(sc);
bxe_common_init_phy(sc, sc->common.shmem_base);
bxe_release_phy_lock(sc);
@@ -12813,7 +12871,7 @@ bxe_init_port(struct bxe_softc *sc)
uint32_t val, low, high;
uint32_t swap_val, swap_override, aeu_gpio_mask, offset;
uint32_t reg_addr;
- int i, init_stage, port;
+ int init_stage, port;
port = BP_PORT(sc);
init_stage = port ? PORT1_STAGE : PORT0_STAGE;
@@ -12855,14 +12913,6 @@ bxe_init_port(struct bxe_softc *sc)
REG_WR(sc, BRB1_REG_PAUSE_LOW_THRESHOLD_0 + port * 4, low);
REG_WR(sc, BRB1_REG_PAUSE_HIGH_THRESHOLD_0 + port * 4, high);
- if (sc->bxe_flags & BXE_SAFC_TX_FLAG) {
- REG_WR(sc, BRB1_REG_HIGH_LLFC_LOW_THRESHOLD_0 + port * 4, 0xa0);
- REG_WR(sc, BRB1_REG_HIGH_LLFC_HIGH_THRESHOLD_0 + port * 4,
- 0xd8);
- REG_WR(sc, BRB1_REG_LOW_LLFC_LOW_THRESHOLD_0 + port *4, 0xa0);
- REG_WR(sc, BRB1_REG_LOW_LLFC_HIGH_THRESHOLD_0 + port * 4, 0xd8);
- }
-
/* Port PRS comes here. */
bxe_init_block(sc, PRS_BLOCK, init_stage);
@@ -12901,6 +12951,7 @@ bxe_init_port(struct bxe_softc *sc)
REG_WR(sc, HC_REG_LEADING_EDGE_0 + port * 8, 0);
REG_WR(sc, HC_REG_TRAILING_EDGE_0 + port * 8, 0);
}
+
bxe_init_block(sc, HC_BLOCK, init_stage);
bxe_init_block(sc, MISC_AEU_BLOCK, init_stage);
@@ -12927,33 +12978,12 @@ bxe_init_port(struct bxe_softc *sc)
/* Enable outer VLAN support if required. */
REG_WR(sc, NIG_REG_LLH0_BRB1_DRV_MASK_MF + port * 4,
(IS_E1HOV(sc) ? 0x1 : 0x2));
-
- if (sc->bxe_flags & BXE_SAFC_TX_FLAG){
- high = 0;
- for (i = 0; i < BXE_MAX_PRIORITY; i++) {
- if (sc->pri_map[i] == 1)
- high |= (1 << i);
- }
- REG_WR(sc, NIG_REG_LLFC_HIGH_PRIORITY_CLASSES_0 +
- port * 4, high);
- low = 0;
- for (i = 0; i < BXE_MAX_PRIORITY; i++) {
- if (sc->pri_map[i] == 0)
- low |= (1 << i);
- }
- REG_WR(sc, NIG_REG_LLFC_LOW_PRIORITY_CLASSES_0 +
- port * 4, low);
-
- REG_WR(sc, NIG_REG_PAUSE_ENABLE_0 + port * 4, 0);
- REG_WR(sc, NIG_REG_LLFC_ENABLE_0 + port * 4, 1);
- REG_WR(sc, NIG_REG_LLFC_OUT_EN_0 + port * 4, 1);
- } else {
- REG_WR(sc, NIG_REG_LLFC_ENABLE_0 + port * 4, 0);
- REG_WR(sc, NIG_REG_LLFC_OUT_EN_0 + port * 4, 0);
- REG_WR(sc, NIG_REG_PAUSE_ENABLE_0 + port * 4, 1);
- }
}
+ REG_WR(sc, NIG_REG_LLFC_ENABLE_0 + port * 4, 0);
+ REG_WR(sc, NIG_REG_LLFC_OUT_EN_0 + port * 4, 0);
+ REG_WR(sc, NIG_REG_PAUSE_ENABLE_0 + port * 4, 1);
+
bxe_init_block(sc, MCP_BLOCK, init_stage);
bxe_init_block(sc, DMAE_BLOCK, init_stage);
@@ -13127,7 +13157,6 @@ bxe_init_hw(struct bxe_softc *sc, uint32_t load_code)
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
sc->dmae_ready = 0;
- bxe_gunzip_init(sc);
switch (load_code) {
case FW_MSG_CODE_DRV_LOAD_COMMON:
rc = bxe_init_common(sc);
@@ -13154,21 +13183,19 @@ bxe_init_hw(struct bxe_softc *sc, uint32_t load_code)
}
/* Fetch additional config data if the bootcode is running. */
- if (!BP_NOMCP(sc)) {
+ if (!NOMCP(sc)) {
func = BP_FUNC(sc);
/* Fetch the pulse sequence number. */
sc->fw_drv_pulse_wr_seq = (SHMEM_RD(sc,
func_mb[func].drv_pulse_mb) & DRV_PULSE_SEQ_MASK);
}
- /* This needs to be done before gunzip end. */
+ /* Clear the default status block. */
bxe_zero_def_sb(sc);
for (i = 0; i < sc->num_queues; i++)
bxe_zero_sb(sc, BP_L_ID(sc) + i);
bxe_init_hw_exit:
- bxe_gunzip_end(sc);
-
DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
return (rc);
@@ -13194,8 +13221,6 @@ bxe_fw_command(struct bxe_softc *sc, uint32_t command)
rc = 0;
cnt = 1;
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
-
DBRUNMSG(BXE_VERBOSE, bxe_decode_mb_msgs(sc, (command | seq), 0));
BXE_FWMB_LOCK(sc);
@@ -13225,321 +13250,285 @@ bxe_fw_command(struct bxe_softc *sc, uint32_t command)
}
BXE_FWMB_UNLOCK(sc);
-
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
return (rc);
}
/*
- * Free any DMA memory owned by the driver.
- *
- * Scans through each data structre that requires DMA memory and frees
- * the memory if allocated.
+ * Allocate a block of memory and map it for DMA. No partial
+ * completions allowed, release any resources acquired if we
+ * can't acquire all resources.
*
* Returns:
- * Nothing.
+ * 0 = Success, !0 = Failure
+ *
+ * Modifies:
+ * dma->paddr
+ * dma->vaddr
+ * dma->tag
+ * dma->map
+ * dma->size
+ *
*/
-static void
-bxe_dma_free(struct bxe_softc *sc)
+static int
+bxe_dma_malloc(struct bxe_softc *sc, bus_size_t size,
+ struct bxe_dma *dma, int mapflags, const char *msg)
{
- struct bxe_fastpath *fp;
- int i, j;
+ int rc;
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
- if (sc->parent_tag != NULL) {
+ DBRUNIF(dma->size > 0,
+ BXE_PRINTF("%s(): Called for %s with size > 0 (%05d)!\n",
+ __FUNCTION__, msg, (int) dma->size));
- for (i = 0; i < sc->num_queues; i++) {
- fp = &sc->fp[i];
- /* Trust no one! */
- if (fp) {
- /* Free, unmap, and destroy the status block. */
- if (fp->status_block_tag != NULL) {
- if (fp->status_block_map != NULL) {
- if (fp->status_block != NULL)
- bus_dmamem_free(
- fp->status_block_tag,
- fp->status_block,
- fp->status_block_map);
-
- bus_dmamap_unload(
- fp->status_block_tag,
- fp->status_block_map);
- bus_dmamap_destroy(
- fp->status_block_tag,
- fp->status_block_map);
- }
+ rc = bus_dma_tag_create(
+ sc->parent_tag, /* parent */
+ BCM_PAGE_SIZE, /* alignment for segs */
+ BXE_DMA_BOUNDARY, /* cannot cross */
+ BUS_SPACE_MAXADDR, /* restricted low */
+ BUS_SPACE_MAXADDR, /* restricted hi */
+ NULL, NULL, /* filter f(), arg */
+ size, /* max size for this tag */
+ 1, /* # of discontinuities */
+ size, /* max seg size */
+ BUS_DMA_ALLOCNOW, /* flags */
+ NULL, NULL, /* lock f(), arg */
+ &dma->tag);
- bus_dma_tag_destroy(
- fp->status_block_tag);
- }
+ if (rc != 0) {
+ BXE_PRINTF("%s(%d): bus_dma_tag_create() "
+ "failed (rc = %d) for %s!\n",
+ __FILE__, __LINE__, rc, msg);
+ goto bxe_dma_malloc_fail_create;
+ }
- /*
- * Free, unmap and destroy all TX BD
- * chain pages.
- */
- if (fp->tx_bd_chain_tag != NULL) {
- for (j = 0; j < NUM_TX_PAGES; j++ ) {
- if (fp->tx_bd_chain_map[j] != NULL) {
- if (fp->tx_bd_chain[j] != NULL)
- bus_dmamem_free(fp->tx_bd_chain_tag,
- fp->tx_bd_chain[j],
- fp->tx_bd_chain_map[j]);
-
- bus_dmamap_unload(fp->tx_bd_chain_tag,
- fp->tx_bd_chain_map[j]);
- bus_dmamap_destroy(fp->tx_bd_chain_tag,
- fp->tx_bd_chain_map[j]);
- }
- }
+ rc = bus_dmamem_alloc(dma->tag, (void **)&dma->vaddr,
+ BUS_DMA_NOWAIT, &dma->map);
+ if (rc != 0) {
+ BXE_PRINTF("%s(%d): bus_dmamem_alloc() "
+ "failed (rc = %d) for %s!\n",
+ __FILE__, __LINE__, rc, msg);
+ goto bxe_dma_malloc_fail_alloc;
+ }
- bus_dma_tag_destroy(fp->tx_bd_chain_tag);
- }
+ rc = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size,
+ bxe_dma_map_addr, &dma->paddr, mapflags | BUS_DMA_NOWAIT);
+ if (rc != 0) {
+ BXE_PRINTF("%s(%d): bus_dmamap_load() "
+ "failed (rc = %d) for %s!\n",
+ __FILE__, __LINE__, rc, msg);
+ goto bxe_dma_malloc_fail_load;
+ }
- /* Free, unmap and destroy all RX BD chain pages. */
- if (fp->rx_bd_chain_tag != NULL) {
-
- for (j = 0; j < NUM_RX_PAGES; j++ ) {
- if (fp->rx_bd_chain_map[j] != NULL) {
- if (fp->rx_bd_chain[j] != NULL)
- bus_dmamem_free(fp->rx_bd_chain_tag,
- fp->rx_bd_chain[j],
- fp->rx_bd_chain_map[j]);
-
- bus_dmamap_unload(fp->rx_bd_chain_tag,
- fp->rx_bd_chain_map[j]);
- bus_dmamap_destroy(fp->rx_bd_chain_tag,
- fp->rx_bd_chain_map[j]);
- }
- }
+ dma->size = size;
- bus_dma_tag_destroy(fp->rx_bd_chain_tag);
- }
+ DBPRINT(sc, BXE_VERBOSE, "%s(): size=%06d, vaddr=0x%p, "
+ "paddr=0x%jX - %s\n", __FUNCTION__, (int) dma->size,
+ dma->vaddr, (uintmax_t) dma->paddr, msg);
- /*
- * Free, unmap and destroy all RX CQ
- * chain pages.
- */
- if (fp->rx_cq_chain_tag != NULL) {
- for (j = 0; j < NUM_RCQ_PAGES; j++ ) {
- if (fp->rx_cq_chain_map[j] != NULL) {
- if (fp->rx_cq_chain[j] != NULL)
- bus_dmamem_free(fp->rx_cq_chain_tag,
- fp->rx_cq_chain[j],
- fp->rx_cq_chain_map[j]);
-
- bus_dmamap_unload(fp->rx_cq_chain_tag,
- fp->rx_cq_chain_map[j]);
- bus_dmamap_destroy(fp->rx_cq_chain_tag,
- fp->rx_cq_chain_map[j]);
- }
- }
+ goto bxe_dma_malloc_exit;
- bus_dma_tag_destroy(fp->rx_cq_chain_tag);
- }
+bxe_dma_malloc_fail_load:
+ bus_dmamem_free(dma->tag, dma->vaddr, dma->map);
- /* Unload and destroy the TX mbuf maps. */
- if (fp->tx_mbuf_tag != NULL) {
- for (j = 0; j < TOTAL_TX_BD; j++) {
- if (fp->tx_mbuf_map[j] != NULL) {
- bus_dmamap_unload(fp->tx_mbuf_tag,
- fp->tx_mbuf_map[j]);
- bus_dmamap_destroy(fp->tx_mbuf_tag,
- fp->tx_mbuf_map[j]);
- }
- }
+bxe_dma_malloc_fail_alloc:
+ bus_dma_tag_destroy(dma->tag);
+ dma->vaddr = NULL;
- bus_dma_tag_destroy(fp->tx_mbuf_tag);
- }
+bxe_dma_malloc_fail_create:
+ dma->map = NULL;
+ dma->tag = NULL;
+ dma->size = 0;
+bxe_dma_malloc_exit:
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ return (rc);
+}
- if (TPA_ENABLED(sc)) {
- int tpa_pool_max = CHIP_IS_E1H(sc) ?
- ETH_MAX_AGGREGATION_QUEUES_E1H :
- ETH_MAX_AGGREGATION_QUEUES_E1;
+/*
+ * Release a block of DMA memory associated tag/map.
+ *
+ * Returns:
+ * None
+ */
+static void
+bxe_dma_free(struct bxe_softc *sc, struct bxe_dma *dma)
+{
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_UNLOAD);
- /* Unload and destroy the TPA pool mbuf maps. */
- if (fp->rx_mbuf_tag != NULL) {
+ if (dma->size > 0) {
+ bus_dmamap_sync(dma->tag, dma->map,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(dma->tag, dma->map);
+ bus_dmamem_free(dma->tag, dma->vaddr, dma->map);
+ bus_dma_tag_destroy(dma->tag);
+ dma->size = 0;
+ }
- for (j = 0; j < tpa_pool_max; j++) {
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_UNLOAD);
+}
- if (fp->tpa_mbuf_map[j] != NULL) {
- bus_dmamap_unload(fp->rx_mbuf_tag,
- fp->tpa_mbuf_map[j]);
- bus_dmamap_destroy(fp->rx_mbuf_tag,
- fp->tpa_mbuf_map[j]);
- }
- }
- }
+/*
+ * Free any DMA memory owned by the driver.
+ *
+ * Scans through each data structre that requires DMA memory and frees
+ * the memory if allocated.
+ *
+ * Returns:
+ * Nothing.
+ */
+static void
+bxe_host_structures_free(struct bxe_softc *sc)
+{
+ struct bxe_fastpath *fp;
+ int i, j, max_agg_queues;
- /* Free, unmap and destroy all RX SGE chain pages. */
- if (fp->rx_sge_chain_tag != NULL) {
- for (j = 0; j < NUM_RX_SGE_PAGES; j++ ) {
- if (fp->rx_sge_chain_map[j] != NULL) {
- if (fp->rx_sge_chain[j] != NULL)
- bus_dmamem_free(fp->rx_sge_chain_tag,
- fp->rx_sge_chain[j],
- fp->rx_sge_chain_map[j]);
-
- bus_dmamap_unload(fp->rx_sge_chain_tag,
- fp->rx_sge_chain_map[j]);
- bus_dmamap_destroy(fp->rx_sge_chain_tag,
- fp->rx_sge_chain_map[j]);
- }
- }
-
- bus_dma_tag_destroy(fp->rx_sge_chain_tag);
- }
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+ max_agg_queues = CHIP_IS_E1H(sc) ?
+ ETH_MAX_AGGREGATION_QUEUES_E1H :
+ ETH_MAX_AGGREGATION_QUEUES_E1;
- /* Unload and destroy the SGE Buf maps. */
- if (fp->rx_sge_buf_tag != NULL) {
+ if (sc->parent_tag == NULL)
+ goto bxe_host_structures_free_exit;
- for (j = 0; j < TOTAL_RX_SGE; j++) {
- if (fp->rx_sge_buf_map[j] != NULL) {
- bus_dmamap_unload(fp->rx_sge_buf_tag,
- fp->rx_sge_buf_map[j]);
- bus_dmamap_destroy(fp->rx_sge_buf_tag,
- fp->rx_sge_buf_map[j]);
- }
- }
+ for (i = 0; i < sc->num_queues; i++) {
+ fp = &sc->fp[i];
- bus_dma_tag_destroy(fp->rx_sge_buf_tag);
- }
- }
+ /* Trust no one! */
+ if (fp == NULL)
+ break;
- /* Unload and destroy the RX mbuf maps. */
- if (fp->rx_mbuf_tag != NULL) {
- for (j = 0; j < TOTAL_RX_BD; j++) {
- if (fp->rx_mbuf_map[j] != NULL) {
- bus_dmamap_unload(fp->rx_mbuf_tag,
- fp->rx_mbuf_map[j]);
- bus_dmamap_destroy(fp->rx_mbuf_tag,
- fp->rx_mbuf_map[j]);
- }
- }
+ /* Status block. */
+ bxe_dma_free(sc, &fp->sb_dma);
- bus_dma_tag_destroy(fp->rx_mbuf_tag);
- }
+ /* TX chain. */
+ bxe_dma_free(sc, &fp->tx_dma);
+ fp->tx_chain = NULL;
- }
- }
+ /* RX chain */
+ bxe_dma_free(sc, &fp->rx_dma);
+ fp->rx_chain = NULL;
- /* Destroy the def_status block. */
- if (sc->def_status_block_tag != NULL) {
- if (sc->def_status_block_map != NULL) {
- if (sc->def_status_block != NULL)
- bus_dmamem_free(
- sc->def_status_block_tag,
- sc->def_status_block,
- sc->def_status_block_map);
-
- bus_dmamap_unload(sc->def_status_block_tag,
- sc->def_status_block_map);
- bus_dmamap_destroy(sc->def_status_block_tag,
- sc->def_status_block_map);
- }
+ /* RCQ chain */
+ bxe_dma_free(sc, &fp->rcq_dma);
+ fp->rcq_chain = NULL;
- bus_dma_tag_destroy(sc->def_status_block_tag);
- }
+ /* SG chain */
+ bxe_dma_free(sc, &fp->sg_dma);
+ fp->sg_chain = NULL;
- /* Destroy the statistics block. */
- if (sc->stats_tag != NULL) {
- if (sc->stats_map != NULL) {
- if (sc->stats_block != NULL)
- bus_dmamem_free(sc->stats_tag,
- sc->stats_block, sc->stats_map);
- bus_dmamap_unload(sc->stats_tag, sc->stats_map);
- bus_dmamap_destroy(sc->stats_tag,
- sc->stats_map);
+ /* Unload and destroy the TX mbuf maps. */
+ if (fp->tx_mbuf_tag != NULL) {
+ for (j = 0; j < TOTAL_TX_BD; j++) {
+ if (fp->tx_mbuf_map[j] != NULL) {
+ bus_dmamap_unload(
+ fp->tx_mbuf_tag,
+ fp->tx_mbuf_map[j]);
+ bus_dmamap_destroy(
+ fp->tx_mbuf_tag,
+ fp->tx_mbuf_map[j]);
+ }
}
- bus_dma_tag_destroy(sc->stats_tag);
+ bus_dma_tag_destroy(fp->tx_mbuf_tag);
}
- /* Destroy the Slow Path block. */
- if (sc->slowpath_tag != NULL) {
- if (sc->slowpath_map != NULL) {
- if (sc->slowpath != NULL)
- bus_dmamem_free(sc->slowpath_tag,
- sc->slowpath, sc->slowpath_map);
-
- bus_dmamap_unload(sc->slowpath_tag,
- sc->slowpath_map);
- bus_dmamap_destroy(sc->slowpath_tag,
- sc->slowpath_map);
+ /* Unload and destroy the TPA pool mbuf maps. */
+ if (fp->rx_mbuf_tag != NULL) {
+ if (fp->tpa_mbuf_spare_map != NULL) {
+ bus_dmamap_unload(
+ fp->rx_mbuf_tag,
+ fp->tpa_mbuf_spare_map);
+ bus_dmamap_destroy(
+ fp->rx_mbuf_tag,
+ fp->tpa_mbuf_spare_map);
}
- bus_dma_tag_destroy(sc->slowpath_tag);
+ for (j = 0; j < max_agg_queues; j++) {
+ if (fp->tpa_mbuf_map[j] != NULL) {
+ bus_dmamap_unload(
+ fp->rx_mbuf_tag,
+ fp->tpa_mbuf_map[j]);
+ bus_dmamap_destroy(
+ fp->rx_mbuf_tag,
+ fp->tpa_mbuf_map[j]);
+ }
+ }
}
- /* Destroy the Slow Path Ring. */
- if (sc->spq_tag != NULL) {
- if (sc->spq_map != NULL) {
- if (sc->spq != NULL)
- bus_dmamem_free(sc->spq_tag, sc->spq,
- sc->spq_map);
+ /* Unload and destroy the SGE Buf maps. */
+ if (fp->rx_sge_buf_tag != NULL) {
+ if (fp->rx_sge_spare_map != NULL) {
+ bus_dmamap_unload(
+ fp->rx_sge_buf_tag,
+ fp->rx_sge_spare_map);
+ bus_dmamap_destroy(
+ fp->rx_sge_buf_tag,
+ fp->rx_sge_spare_map);
+ }
- bus_dmamap_unload(sc->spq_tag, sc->spq_map);
- bus_dmamap_destroy(sc->spq_tag, sc->spq_map);
+ for (j = 0; j < TOTAL_RX_SGE; j++) {
+ if (fp->rx_sge_buf_map[j] != NULL) {
+ bus_dmamap_unload(
+ fp->rx_sge_buf_tag,
+ fp->rx_sge_buf_map[j]);
+ bus_dmamap_destroy(
+ fp->rx_sge_buf_tag,
+ fp->rx_sge_buf_map[j]);
+ }
}
- bus_dma_tag_destroy(sc->spq_tag);
+ bus_dma_tag_destroy(fp->rx_sge_buf_tag);
}
+ /* Unload and destroy the RX mbuf maps. */
+ if (fp->rx_mbuf_tag != NULL) {
+ if (fp->rx_mbuf_spare_map != NULL) {
+ bus_dmamap_unload(fp->rx_mbuf_tag,
+ fp->rx_mbuf_spare_map);
+ bus_dmamap_destroy(fp->rx_mbuf_tag,
+ fp->rx_mbuf_spare_map);
+ }
- free(sc->strm, M_DEVBUF);
- sc->strm = NULL;
-
- if (sc->gunzip_tag != NULL) {
- if (sc->gunzip_map != NULL) {
- if (sc->gunzip_buf != NULL)
- bus_dmamem_free(sc->gunzip_tag,
- sc->gunzip_buf, sc->gunzip_map);
-
- bus_dmamap_unload(sc->gunzip_tag,
- sc->gunzip_map);
- bus_dmamap_destroy(sc->gunzip_tag,
- sc->gunzip_map);
+ for (j = 0; j < TOTAL_RX_BD; j++) {
+ if (fp->rx_mbuf_map[j] != NULL) {
+ bus_dmamap_unload(
+ fp->rx_mbuf_tag,
+ fp->rx_mbuf_map[j]);
+ bus_dmamap_destroy(
+ fp->rx_mbuf_tag,
+ fp->rx_mbuf_map[j]);
+ }
}
- bus_dma_tag_destroy(sc->gunzip_tag);
+ bus_dma_tag_destroy(fp->rx_mbuf_tag);
}
-
- bus_dma_tag_destroy(sc->parent_tag);
}
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
-}
+ /* Destroy the default status block */
+ bxe_dma_free(sc, &sc->def_sb_dma);
+ sc->def_sb = NULL;
-/*
- * Free paged pool memory maps and tags.
- *
- * Returns:
- * Nothing.
- */
-
-static void
-bxe_dmamem_free(struct bxe_softc *sc, bus_dma_tag_t tag, caddr_t buf,
- bus_dmamap_t map)
-{
+ /* Destroy the statistics block */
+ bxe_dma_free(sc, &sc->stats_dma);
+ sc->stats = NULL;
- DBENTER(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
-
- if (tag) {
- if (sc->gunzip_buf != NULL)
- bus_dmamem_free(tag, buf, map);
+ /* Destroy the slowpath block. */
+ bxe_dma_free(sc, &sc->slowpath_dma);
+ sc->slowpath = NULL;
- if (map != NULL) {
- bus_dmamap_unload(tag, map);
- bus_dmamap_destroy(tag, map);
- }
-
- if (tag != NULL)
- bus_dma_tag_destroy(tag);
- }
+ /* Destroy the slowpath queue. */
+ bxe_dma_free(sc, &sc->spq_dma);
+ sc->spq = NULL;
+ /* Destroy the slowpath queue. */
+ bxe_dma_free(sc, &sc->gz_dma);
+ sc->gz = NULL;
+ free(sc->strm, M_DEVBUF);
+ sc->strm = NULL;
- DBEXIT(BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
+bxe_host_structures_free_exit:
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
}
/*
@@ -13575,31 +13564,30 @@ bxe_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error)
/*
* Allocate any non-paged DMA memory needed by the driver.
*
- * Allocates DMA memory needed for the various global structures which are
- * read or written by the hardware.
- *
* Returns:
* 0 = Success, !0 = Failure.
*/
static int
-bxe_dma_alloc(device_t dev)
+bxe_host_structures_alloc(device_t dev)
{
struct bxe_softc *sc;
struct bxe_fastpath *fp;
- int error, rc;
+ int rc;
bus_addr_t busaddr;
bus_size_t max_size, max_seg_size;
int i, j, max_segments;
sc = device_get_softc(dev);
- rc = 0;
-
DBENTER(BXE_VERBOSE_RESET);
+ rc = 0;
+ int max_agg_queues = CHIP_IS_E1H(sc) ?
+ ETH_MAX_AGGREGATION_QUEUES_E1H :
+ ETH_MAX_AGGREGATION_QUEUES_E1;
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
- if (bus_dma_tag_create(NULL, /* parent tag */
+ rc = bus_dma_tag_create(NULL, /* parent tag */
1, /* alignment for segs */
BXE_DMA_BOUNDARY, /* cannot cross */
BUS_SPACE_MAXADDR, /* restricted low */
@@ -13612,136 +13600,112 @@ bxe_dma_alloc(device_t dev)
0, /* flags */
NULL, /* lock f() */
NULL, /* lock f() arg */
- &sc->parent_tag) /* dma tag */
- ) {
+ &sc->parent_tag); /* dma tag */
+ if (rc != 0) {
BXE_PRINTF("%s(%d): Could not allocate parent DMA tag!\n",
__FILE__, __LINE__);
rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ goto bxe_host_structures_alloc_exit;
}
/* Allocate DMA memory for each fastpath structure. */
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): fp[%d] virtual address = %p, size = %lu\n",
- __FUNCTION__, i, fp,
- (long unsigned int)sizeof(struct bxe_fastpath));
/*
- * Create a DMA tag for the status block, allocate and
- * clear the memory, map the memory into DMA space, and
- * fetch the physical address of the block.
- */
+ * Allocate status block*
+ */
+ rc = bxe_dma_malloc(sc, BXE_STATUS_BLK_SZ,
+ &fp->sb_dma, BUS_DMA_NOWAIT, "fp status block");
+ /* ToDo: Only using 32 bytes out of 4KB allocation! */
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ fp->status_block =
+ (struct host_status_block *) fp->sb_dma.vaddr;
- if (bus_dma_tag_create(sc->parent_tag,
- BCM_PAGE_SIZE, /* alignment for segs */
- BXE_DMA_BOUNDARY, /* cannot cross */
- BUS_SPACE_MAXADDR, /* restricted low */
- BUS_SPACE_MAXADDR, /* restricted hi */
- NULL, /* filter f() */
- NULL, /* filter f() arg */
- BXE_STATUS_BLK_SZ, /* max map for this tag */
- 1, /* # of discontinuities */
- BXE_STATUS_BLK_SZ, /* max seg size */
- 0, /* flags */
- NULL, /* lock f() */
- NULL, /* lock f() arg */
- &fp->status_block_tag)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] status block DMA tag!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- if (bus_dmamem_alloc(fp->status_block_tag,
- (void **)&fp->status_block, BUS_DMA_NOWAIT,
- &fp->status_block_map)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] status block DMA memory!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ /*
+ * Allocate TX chain.
+ */
+ rc = bxe_dma_malloc(sc, BXE_TX_CHAIN_PAGE_SZ *
+ NUM_TX_PAGES, &fp->tx_dma, BUS_DMA_NOWAIT,
+ "tx chain pages");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ fp->tx_chain = (union eth_tx_bd_types *) fp->tx_dma.vaddr;
+
+ /* Link the TX chain pages. */
+ for (j = 1; j <= NUM_TX_PAGES; j++) {
+ struct eth_tx_next_bd *tx_n_bd =
+ &fp->tx_chain[TOTAL_TX_BD_PER_PAGE * j - 1].next_bd;
+
+ busaddr = fp->tx_dma.paddr +
+ BCM_PAGE_SIZE * (j % NUM_TX_PAGES);
+ tx_n_bd->addr_hi = htole32(U64_HI(busaddr));
+ tx_n_bd->addr_lo = htole32(U64_LO(busaddr));
}
- bzero((char *)fp->status_block, BXE_STATUS_BLK_SZ);
-
- error = bus_dmamap_load(fp->status_block_tag,
- fp->status_block_map, fp->status_block, BXE_STATUS_BLK_SZ,
- bxe_dma_map_addr, &busaddr, BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF(
- "%s(%d): Could not map fp[%d] status block DMA memory!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ /*
+ * Allocate RX chain.
+ */
+ rc = bxe_dma_malloc(sc, BXE_RX_CHAIN_PAGE_SZ *
+ NUM_RX_PAGES, &fp->rx_dma, BUS_DMA_NOWAIT,
+ "rx chain pages");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ fp->rx_chain = (struct eth_rx_bd *) fp->rx_dma.vaddr;
+
+ /* Link the RX chain pages. */
+ for (j = 1; j <= NUM_RX_PAGES; j++) {
+ struct eth_rx_bd *rx_bd =
+ &fp->rx_chain[TOTAL_RX_BD_PER_PAGE * j - 2];
+
+ busaddr = fp->rx_dma.paddr +
+ BCM_PAGE_SIZE * (j % NUM_RX_PAGES);
+ rx_bd->addr_hi = htole32(U64_HI(busaddr));
+ rx_bd->addr_lo = htole32(U64_LO(busaddr));
}
- /* Physical address of Status Block */
- fp->status_block_paddr = busaddr;
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): fp[%d] status block physical address = 0x%jX\n",
- __FUNCTION__, i, (uintmax_t) fp->status_block_paddr);
-
/*
- * Create a DMA tag for the TX buffer descriptor chain,
- * allocate and clear the memory, and fetch the
- * physical address of the block.
+ * Allocate CQ chain.
*/
- if (bus_dma_tag_create(sc->parent_tag,
- BCM_PAGE_SIZE, /* alignment for segs */
- BXE_DMA_BOUNDARY, /* cannot cross */
- BUS_SPACE_MAXADDR, /* restricted low */
- BUS_SPACE_MAXADDR, /* restricted hi */
- NULL, /* filter f() */
- NULL, /* filter f() arg */
- BXE_TX_CHAIN_PAGE_SZ,/* max map for this tag */
- 1, /* # of discontinuities */
- BXE_TX_CHAIN_PAGE_SZ,/* max seg size */
- 0, /* flags */
- NULL, /* lock f() */
- NULL, /* lock f() arg */
- &fp->tx_bd_chain_tag)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] TX descriptor chain DMA tag!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ rc = bxe_dma_malloc(sc, BXE_RX_CHAIN_PAGE_SZ *
+ NUM_RCQ_PAGES, &fp->rcq_dma, BUS_DMA_NOWAIT,
+ "rcq chain pages");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ fp->rcq_chain = (union eth_rx_cqe *) fp->rcq_dma.vaddr;
+
+ /* Link the CQ chain pages. */
+ for (j = 1; j <= NUM_RCQ_PAGES; j++) {
+ struct eth_rx_cqe_next_page *nextpg =
+ (struct eth_rx_cqe_next_page *)
+ &fp->rcq_chain[TOTAL_RCQ_ENTRIES_PER_PAGE * j - 1];
+
+ busaddr = fp->rcq_dma.paddr +
+ BCM_PAGE_SIZE * (j % NUM_RCQ_PAGES);
+ nextpg->addr_hi = htole32(U64_HI(busaddr));
+ nextpg->addr_lo = htole32(U64_LO(busaddr));
}
- for (j = 0; j < NUM_TX_PAGES; j++) {
- if (bus_dmamem_alloc(fp->tx_bd_chain_tag,
- (void **)&fp->tx_bd_chain[j], BUS_DMA_NOWAIT,
- &fp->tx_bd_chain_map[j])) {
- BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] TX descriptor chain DMA memory!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- bzero((char *)fp->tx_bd_chain[j], BXE_TX_CHAIN_PAGE_SZ);
-
- error = bus_dmamap_load(fp->tx_bd_chain_tag,
- fp->tx_bd_chain_map[j], fp->tx_bd_chain[j],
- BXE_TX_CHAIN_PAGE_SZ, bxe_dma_map_addr,
- &busaddr, BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF(
- "%s(%d): Could not map fp[%d] TX descriptor chain DMA memory!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /* Physical Address of each page in the Tx BD Chain. */
- fp->tx_bd_chain_paddr[j] = busaddr;
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): fp[%d]->tx_bd_chain_paddr[%d] = 0x%jX\n",
- __FUNCTION__, i, j, (uintmax_t)busaddr);
+ /*
+ * Allocate SG chain.
+ */
+ rc = bxe_dma_malloc(sc, BXE_RX_CHAIN_PAGE_SZ *
+ NUM_RX_SGE_PAGES, &fp->sg_dma, BUS_DMA_NOWAIT,
+ "sg chain pages");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ fp->sg_chain = (struct eth_rx_sge *) fp->sg_dma.vaddr;
+
+ /* Link the SG chain pages. */
+ for (j = 1; j <= NUM_RX_SGE_PAGES; j++) {
+ struct eth_rx_sge *nextpg =
+ &fp->sg_chain[TOTAL_RX_SGE_PER_PAGE * j - 2];
+
+ busaddr = fp->sg_dma.paddr +
+ BCM_PAGE_SIZE * (j % NUM_RX_SGE_PAGES);
+ nextpg->addr_hi = htole32(U64_HI(busaddr));
+ nextpg->addr_lo = htole32(U64_LO(busaddr));
}
/*
@@ -13773,84 +13737,25 @@ bxe_dma_alloc(device_t dev)
NULL, /* lock f() arg */
&fp->tx_mbuf_tag)) {
BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] TX mbuf DMA tag!\n",
+ "%s(%d): Could not allocate fp[%d] "
+ "TX mbuf DMA tag!\n",
__FILE__, __LINE__, i);
rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ goto bxe_host_structures_alloc_exit;
}
/* Create DMA maps for each the TX mbuf cluster(ext buf). */
for (j = 0; j < TOTAL_TX_BD; j++) {
if (bus_dmamap_create(fp->tx_mbuf_tag,
BUS_DMA_NOWAIT,
- &(fp->tx_mbuf_map[j]))) {
- BXE_PRINTF(
- "%s(%d): Unable to create fp[%d] TX mbuf DMA map!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
- }
-
- /*
- * Create a DMA tag for the RX buffer
- * descriptor chain, allocate and clear
- * the memory, and fetch the physical
- * address of the blocks.
- */
- if (bus_dma_tag_create(sc->parent_tag,
- BCM_PAGE_SIZE, /* alignment for segs */
- BXE_DMA_BOUNDARY, /* cannot cross */
- BUS_SPACE_MAXADDR, /* restricted low */
- BUS_SPACE_MAXADDR, /* restricted hi */
- NULL, /* filter f() */
- NULL, /* filter f() arg */
- BXE_RX_CHAIN_PAGE_SZ,/* max map for this tag */
- 1, /* # of discontinuities */
- BXE_RX_CHAIN_PAGE_SZ,/* max seg size */
- 0, /* flags */
- NULL, /* lock f() */
- NULL, /* lock f() arg */
- &fp->rx_bd_chain_tag)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] RX BD chain DMA tag!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- for (j = 0; j < NUM_RX_PAGES; j++) {
- if (bus_dmamem_alloc(fp->rx_bd_chain_tag,
- (void **)&fp->rx_bd_chain[j], BUS_DMA_NOWAIT,
- &fp->rx_bd_chain_map[j])) {
+ &fp->tx_mbuf_map[j])) {
BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] RX BD chain[%d] DMA memory!\n",
+ "%s(%d): Unable to create fp[%02d]."
+ "tx_mbuf_map[%d] DMA map!\n",
__FILE__, __LINE__, i, j);
rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ goto bxe_host_structures_alloc_exit;
}
-
- bzero((char *)fp->rx_bd_chain[j], BXE_RX_CHAIN_PAGE_SZ);
-
- error = bus_dmamap_load(fp->rx_bd_chain_tag,
- fp->rx_bd_chain_map[j], fp->rx_bd_chain[j],
- BXE_RX_CHAIN_PAGE_SZ, bxe_dma_map_addr, &busaddr,
- BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF(
- "%s(%d): Could not map fp[%d] RX BD chain[%d] DMA memory!\n",
- __FILE__, __LINE__, i, j);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /* Physical address of each page in the RX BD chain */
- fp->rx_bd_chain_paddr[j] = busaddr;
-
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): fp[%d]->rx_bd_chain_paddr[%d] = 0x%jX\n",
- __FUNCTION__, i, j, (uintmax_t)busaddr);
}
/*
@@ -13871,431 +13776,152 @@ bxe_dma_alloc(device_t dev)
NULL, /* lock f() arg */
&fp->rx_mbuf_tag)) {
BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] RX mbuf DMA tag!\n",
+ "%s(%d): Could not allocate fp[%02d] "
+ "RX mbuf DMA tag!\n",
__FILE__, __LINE__, i);
rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ goto bxe_host_structures_alloc_exit;
}
/* Create DMA maps for the RX mbuf clusters. */
+ if (bus_dmamap_create(fp->rx_mbuf_tag,
+ BUS_DMA_NOWAIT, &fp->rx_mbuf_spare_map)) {
+ BXE_PRINTF(
+ "%s(%d): Unable to create fp[%02d]."
+ "rx_mbuf_spare_map DMA map!\n",
+ __FILE__, __LINE__, i);
+ rc = ENOMEM;
+ goto bxe_host_structures_alloc_exit;
+ }
+
for (j = 0; j < TOTAL_RX_BD; j++) {
if (bus_dmamap_create(fp->rx_mbuf_tag,
- BUS_DMA_NOWAIT, &(fp->rx_mbuf_map[j]))) {
+ BUS_DMA_NOWAIT, &fp->rx_mbuf_map[j])) {
BXE_PRINTF(
- "%s(%d): Unable to create fp[%d] RX mbuf DMA map!\n",
- __FILE__, __LINE__, i);
+ "%s(%d): Unable to create fp[%02d]."
+ "rx_mbuf_map[%d] DMA map!\n",
+ __FILE__, __LINE__, i, j);
rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ goto bxe_host_structures_alloc_exit;
}
}
/*
- * Create a DMA tag for the RX Completion
- * Queue, allocate and clear the memory,
- * map the memory into DMA space, and fetch
- * the physical address of the block.
+ * Create a DMA tag for RX SGE bufs.
*/
- if (bus_dma_tag_create(sc->parent_tag,
- BCM_PAGE_SIZE, /* alignment for segs */
- BXE_DMA_BOUNDARY, /* cannot cross */
- BUS_SPACE_MAXADDR, /* restricted low */
- BUS_SPACE_MAXADDR, /* restricted hi */
- NULL, /* filter f() */
- NULL, /* filter f() arg */
- BXE_RX_CHAIN_PAGE_SZ,/* max map for this tag */
- 1, /* # of discontinuities */
- BXE_RX_CHAIN_PAGE_SZ,/* max seg size */
- 0, /* flags */
- NULL, /* lock f() */
- NULL, /* lock f() arg */
- &fp->rx_cq_chain_tag)) {
+ if (bus_dma_tag_create(sc->parent_tag, 1,
+ BXE_DMA_BOUNDARY, BUS_SPACE_MAXADDR,
+ BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE, 1,
+ PAGE_SIZE, 0, NULL, NULL, &fp->rx_sge_buf_tag)) {
BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] RX Completion Queue DMA tag!\n",
+ "%s(%d): Could not allocate fp[%02d] "
+ "RX SGE mbuf DMA tag!\n",
__FILE__, __LINE__, i);
rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ goto bxe_host_structures_alloc_exit;
}
- for (j = 0; j < NUM_RCQ_PAGES; j++) {
- if (bus_dmamem_alloc(fp->rx_cq_chain_tag,
- (void **)&fp->rx_cq_chain[j], BUS_DMA_NOWAIT,
- &fp->rx_cq_chain_map[j])) {
- BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] RX Completion Queue DMA memory!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- bzero((char *)fp->rx_cq_chain[j],
- BXE_RX_CHAIN_PAGE_SZ);
-
- error = bus_dmamap_load(fp->rx_cq_chain_tag,
- fp->rx_cq_chain_map[j], fp->rx_cq_chain[j],
- BXE_RX_CHAIN_PAGE_SZ, bxe_dma_map_addr, &busaddr,
- BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF(
- "%s(%d): Could not map fp[%d] RX Completion Queue DMA memory!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /*
- * Physical address of each page in the RX
- * Completion Chain.
- */
- fp->rx_cq_chain_paddr[j] = busaddr;
-
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): fp[%d]->rx_cq_chain_paddr[%d] = 0x%jX\n",
- __FUNCTION__, i, j, (uintmax_t)busaddr);
+ /* Create DMA maps for the SGE mbuf clusters. */
+ if (bus_dmamap_create(fp->rx_sge_buf_tag,
+ BUS_DMA_NOWAIT, &fp->rx_sge_spare_map)) {
+ BXE_PRINTF(
+ "%s(%d): Unable to create fp[%02d]."
+ "rx_sge_spare_map DMA map!\n",
+ __FILE__, __LINE__, i);
+ rc = ENOMEM;
+ goto bxe_host_structures_alloc_exit;
}
- if (TPA_ENABLED(sc)) {
- int tpa_pool_max = CHIP_IS_E1H(sc) ?
- ETH_MAX_AGGREGATION_QUEUES_E1H :
- ETH_MAX_AGGREGATION_QUEUES_E1;
-
- /*
- * Create a DMA tag for the RX SGE Ring,
- * allocate and clear the memory, map the
- * memory into DMA space, and fetch the
- * physical address of the block.
- */
- if (bus_dma_tag_create(sc->parent_tag,
- BCM_PAGE_SIZE, /* alignment for segs */
- BXE_DMA_BOUNDARY, /* cannot cross */
- BUS_SPACE_MAXADDR, /* restricted low */
- BUS_SPACE_MAXADDR, /* restricted hi */
- NULL, /* filter f() */
- NULL, /* filter f() arg */
- BXE_RX_CHAIN_PAGE_SZ,/* max map for this tag */
- 1, /* # of discontinuities */
- BXE_RX_CHAIN_PAGE_SZ,/* max seg size */
- 0, /* flags */
- NULL, /* lock f() */
- NULL, /* lock f() arg */
- &fp->rx_sge_chain_tag)) {
+ for (j = 0; j < TOTAL_RX_SGE; j++) {
+ if (bus_dmamap_create(fp->rx_sge_buf_tag,
+ BUS_DMA_NOWAIT, &fp->rx_sge_buf_map[j])) {
BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] RX SGE descriptor chain DMA tag!\n",
- __FILE__, __LINE__, i);
+ "%s(%d): Unable to create fp[%02d]."
+ "rx_sge_buf_map[%d] DMA map!\n",
+ __FILE__, __LINE__, i, j);
rc = ENOMEM;
- goto bxe_dma_alloc_exit;
+ goto bxe_host_structures_alloc_exit;
}
+ }
- for (j = 0; j < NUM_RX_SGE_PAGES; j++) {
- if (bus_dmamem_alloc(fp->rx_sge_chain_tag,
- (void **)&fp->rx_sge_chain[j],
- BUS_DMA_NOWAIT, &fp->rx_sge_chain_map[j])) {
- BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] RX SGE chain[%d] DMA memory!\n",
- __FILE__, __LINE__, i, j);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- bzero((char *)fp->rx_sge_chain[j],
- BXE_RX_CHAIN_PAGE_SZ);
-
- error = bus_dmamap_load(fp->rx_sge_chain_tag,
- fp->rx_sge_chain_map[j],
- fp->rx_sge_chain[j], BXE_RX_CHAIN_PAGE_SZ,
- bxe_dma_map_addr, &busaddr, BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF(
- "%s(%d): Could not map fp[%d] RX SGE chain[%d] DMA memory!\n",
- __FILE__, __LINE__, i, j);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /*
- * Physical address of each page in the RX
- * SGE chain.
- */
- DBPRINT(sc,
- (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): fp[%d]->rx_sge_chain_paddr[%d] = 0x%jX\n",
- __FUNCTION__, i, j, (uintmax_t)busaddr);
- fp->rx_sge_chain_paddr[j] = busaddr;
- }
+ /* Create DMA maps for the TPA pool mbufs. */
+ if (bus_dmamap_create(fp->rx_mbuf_tag,
+ BUS_DMA_NOWAIT, &fp->tpa_mbuf_spare_map)) {
+ BXE_PRINTF(
+ "%s(%d): Unable to create fp[%02d]."
+ "tpa_mbuf_spare_map DMA map!\n",
+ __FILE__, __LINE__, i);
+ rc = ENOMEM;
+ goto bxe_host_structures_alloc_exit;
+ }
- /*
- * Create a DMA tag for RX SGE bufs.
- */
- if (bus_dma_tag_create(sc->parent_tag, 1,
- BXE_DMA_BOUNDARY, BUS_SPACE_MAXADDR,
- BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE, 1,
- PAGE_SIZE, 0, NULL, NULL, &fp->rx_sge_buf_tag)) {
+ for (j = 0; j < max_agg_queues; j++) {
+ if (bus_dmamap_create(fp->rx_mbuf_tag,
+ BUS_DMA_NOWAIT, &fp->tpa_mbuf_map[j])) {
BXE_PRINTF(
- "%s(%d): Could not allocate fp[%d] RX SGE mbuf DMA tag!\n",
- __FILE__, __LINE__, i);
+ "%s(%d): Unable to create fp[%02d]."
+ "tpa_mbuf_map[%d] DMA map!\n",
+ __FILE__, __LINE__, i, j);
rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /* Create DMA maps for the SGE mbuf clusters. */
- for (j = 0; j < TOTAL_RX_SGE; j++) {
- if (bus_dmamap_create(fp->rx_sge_buf_tag,
- BUS_DMA_NOWAIT, &(fp->rx_sge_buf_map[j]))) {
- BXE_PRINTF(
- "%s(%d): Unable to create fp[%d] RX SGE mbuf DMA map!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
- }
-
- /* Create DMA maps for the TPA pool mbufs. */
- for (j = 0; j < tpa_pool_max; j++) {
- if (bus_dmamap_create(fp->rx_mbuf_tag,
- BUS_DMA_NOWAIT, &(fp->tpa_mbuf_map[j]))) {
- BXE_PRINTF(
- "%s(%d): Unable to create fp[%d] TPA DMA map!\n",
- __FILE__, __LINE__, i);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
+ goto bxe_host_structures_alloc_exit;
}
}
+
+ bxe_init_sge_ring_bit_mask(fp);
}
/*
- * Create a DMA tag for the def_status block, allocate and clear the
- * memory, map the memory into DMA space, and fetch the physical
- * address of the block.
+ * Allocate default status block.
*/
- if (bus_dma_tag_create(sc->parent_tag, BCM_PAGE_SIZE, BXE_DMA_BOUNDARY,
- BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
- BXE_DEF_STATUS_BLK_SZ, 1, BXE_DEF_STATUS_BLK_SZ, 0, NULL, NULL,
- &sc->def_status_block_tag)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate def_status block DMA tag!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- if (bus_dmamem_alloc(sc->def_status_block_tag,
- (void **)&sc->def_status_block, BUS_DMA_NOWAIT,
- &sc->def_status_block_map)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate def_status block DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- bzero((char *)sc->def_status_block, BXE_DEF_STATUS_BLK_SZ);
-
- error = bus_dmamap_load(sc->def_status_block_tag,
- sc->def_status_block_map, sc->def_status_block,
- BXE_DEF_STATUS_BLK_SZ, bxe_dma_map_addr, &busaddr, BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF(
- "%s(%d): Could not map def_status block DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /* Physical Address of Default Status Block. */
- sc->def_status_block_paddr = busaddr;
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): Default status block physical address = 0x%08X\n",
- __FUNCTION__, (uint32_t)sc->def_status_block_paddr);
+ rc = bxe_dma_malloc(sc, BXE_DEF_STATUS_BLK_SZ, &sc->def_sb_dma,
+ BUS_DMA_NOWAIT, "default status block");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ sc->def_sb = (struct host_def_status_block *) sc->def_sb_dma.vaddr;
/*
- * Create a DMA tag for the statistics block, allocate and clear the
- * memory, map the memory into DMA space, and fetch the physical
- * address of the block.
+ * Allocate statistics block.
*/
- if (bus_dma_tag_create(sc->parent_tag, BXE_DMA_ALIGN, BXE_DMA_BOUNDARY,
- BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, BXE_STATS_BLK_SZ,
- 1, BXE_STATS_BLK_SZ, 0, NULL, NULL, &sc->stats_tag)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate statistics block DMA tag!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- if (bus_dmamem_alloc(sc->stats_tag, (void **)&sc->stats_block,
- BUS_DMA_NOWAIT, &sc->stats_map)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate statistics block DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- bzero((char *)sc->stats_block, BXE_STATS_BLK_SZ);
-
- error = bus_dmamap_load(sc->stats_tag, sc->stats_map, sc->stats_block,
- BXE_STATS_BLK_SZ, bxe_dma_map_addr, &busaddr, BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF(
- "%s(%d): Could not map statistics block DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /* Physical Address of Statistics Block. */
- sc->stats_block_paddr = busaddr;
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): Statistics block physical address = 0x%08X\n",
- __FUNCTION__, (uint32_t)sc->stats_block_paddr);
+ rc = bxe_dma_malloc(sc, BXE_STATS_BLK_SZ, &sc->stats_dma,
+ BUS_DMA_NOWAIT, "statistics block");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ sc->stats = (struct statistics_block *) sc->stats_dma.vaddr;
/*
- * Create a DMA tag for slowpath memory, allocate and clear the
- * memory, map the memory into DMA space, and fetch the physical
- * address of the block.
+ * Allocate slowpath block.
*/
- if (bus_dma_tag_create(sc->parent_tag, BCM_PAGE_SIZE, BXE_DMA_BOUNDARY,
- BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, BXE_SLOWPATH_SZ,
- 1, BXE_SLOWPATH_SZ, 0, NULL, NULL, &sc->slowpath_tag)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate slowpath DMA tag!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- if (bus_dmamem_alloc(sc->slowpath_tag, (void **)&sc->slowpath,
- BUS_DMA_NOWAIT, &sc->slowpath_map)) {
- BXE_PRINTF(
- "%s(%d): Could not allocate slowpath DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- bzero((char *)sc->slowpath, BXE_SLOWPATH_SZ);
-
- error = bus_dmamap_load(sc->slowpath_tag, sc->slowpath_map,
- sc->slowpath, BXE_SLOWPATH_SZ, bxe_dma_map_addr, &busaddr,
- BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF("%s(%d): Could not map slowpath DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /* Physical Address For Slow Path Context. */
- sc->slowpath_paddr = busaddr;
- DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET),
- "%s(): Slowpath context physical address = 0x%08X\n",
- __FUNCTION__, (uint32_t)sc->slowpath_paddr);
+ rc = bxe_dma_malloc(sc, BXE_SLOWPATH_SZ, &sc->slowpath_dma,
+ BUS_DMA_NOWAIT, "slowpath block");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ sc->slowpath = (struct bxe_slowpath *) sc->slowpath_dma.vaddr;
/*
- * Create a DMA tag for the Slow Path Queue, allocate and clear the
- * memory, map the memory into DMA space, and fetch the physical
- * address of the block.
+ * Allocate slowpath queue.
*/
- if (bus_dma_tag_create(sc->parent_tag, BCM_PAGE_SIZE, BXE_DMA_BOUNDARY,
- BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, BXE_SPQ_SZ, 1,
- BXE_SPQ_SZ, 0, NULL, NULL, &sc->spq_tag)) {
- BXE_PRINTF("%s(%d): Could not allocate SPQ DMA tag!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- if (bus_dmamem_alloc(sc->spq_tag, (void **)&sc->spq, BUS_DMA_NOWAIT,
- &sc->spq_map)) {
- BXE_PRINTF("%s(%d): Could not allocate SPQ DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- bzero((char *)sc->spq, BXE_SPQ_SZ);
-
- error = bus_dmamap_load(sc->spq_tag, sc->spq_map, sc->spq, BXE_SPQ_SZ,
- bxe_dma_map_addr, &busaddr, BUS_DMA_NOWAIT);
-
- if (error) {
- BXE_PRINTF("%s(%d): Could not map SPQ DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
- /* Physical address of slow path queue. */
- sc->spq_paddr = busaddr;
- DBPRINT(sc, (BXE_EXTREME_LOAD | BXE_EXTREME_RESET),
- "%s(): Slowpath queue physical address = 0x%08X\n",
- __FUNCTION__, (uint32_t)sc->spq_paddr);
-
- if (bxe_gunzip_init(sc)) {
- rc = ENOMEM;
- goto bxe_dma_alloc_exit;
- }
-
-bxe_dma_alloc_exit:
- DBEXIT(BXE_VERBOSE_RESET);
- return (rc);
-}
-
-/*
- * Allocate DMA memory used for the firmware gunzip memory.
- *
- * Returns:
- * 0 for success, !0 = Failure.
- */
-
-static int
-bxe_dmamem_alloc(struct bxe_softc *sc, bus_dma_tag_t tag, bus_dmamap_t map,
- void *buf, uint32_t buflen, bus_addr_t *busaddr)
-{
- int rc;
-
- rc = 0;
-
- DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+ rc = bxe_dma_malloc(sc, BXE_SPQ_SZ, &sc->spq_dma,
+ BUS_DMA_NOWAIT, "slowpath queue");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ sc->spq = (struct eth_spe *) sc->spq_dma.vaddr;
/*
- * Create a DMA tag for the block, allocate and clear the
- * memory, map the memory into DMA space, and fetch the physical
- * address of the block.
+ * Allocate firmware decompression buffer.
*/
- if (bus_dma_tag_create(sc->parent_tag, BXE_DMA_ALIGN, BXE_DMA_BOUNDARY,
- BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, buflen, 1, buflen,
- 0, NULL, NULL, &sc->gunzip_tag)) {
- BXE_PRINTF("%s(%d): Could not allocate DMA tag!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dmamem_alloc_exit;
- }
-
- if (bus_dmamem_alloc(sc->gunzip_tag, (void **)&sc->gunzip_buf,
- BUS_DMA_NOWAIT, &sc->gunzip_map)) {
- BXE_PRINTF("%s(%d): Could not allocate DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- goto bxe_dmamem_alloc_exit;
+ rc = bxe_dma_malloc(sc, BXE_FW_BUF_SIZE, &sc->gz_dma,
+ BUS_DMA_NOWAIT, "gunzip buffer");
+ if (rc != 0)
+ goto bxe_host_structures_alloc_exit;
+ sc->gz = sc->gz_dma.vaddr;
+ if (sc->strm == NULL) {
+ goto bxe_host_structures_alloc_exit;
}
- bzero((char *)sc->gunzip_buf, buflen);
-
- if (bus_dmamap_load(sc->gunzip_tag, sc->gunzip_map, sc->gunzip_buf,
- buflen, bxe_dma_map_addr, busaddr, BUS_DMA_NOWAIT)) {
- BXE_PRINTF("%s(%d): Could not map DMA memory!\n",
- __FILE__, __LINE__);
- rc = ENOMEM;
- }
+ sc->strm = malloc(sizeof(*sc->strm), M_DEVBUF, M_NOWAIT);
-bxe_dmamem_alloc_exit:
- DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET);
+bxe_host_structures_alloc_exit:
+ DBEXIT(BXE_VERBOSE_RESET);
return (rc);
}
@@ -14313,7 +13939,7 @@ bxe_set_mac_addr_e1(struct bxe_softc *sc, int set)
uint8_t *eaddr;
int port;
- DBENTER(BXE_VERBOSE_MISC);
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
config = BXE_SP(sc, mac_config);
port = BP_PORT(sc);
@@ -14371,7 +13997,7 @@ bxe_set_mac_addr_e1(struct bxe_softc *sc, int set)
U64_HI(BXE_SP_MAPPING(sc, mac_config)),
U64_LO(BXE_SP_MAPPING(sc, mac_config)), 0);
- DBEXIT(BXE_VERBOSE_MISC);
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
}
/*
@@ -14388,7 +14014,7 @@ bxe_set_mac_addr_e1h(struct bxe_softc *sc, int set)
uint8_t *eaddr;
int func, port;
- DBENTER(BXE_VERBOSE_MISC);
+ DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
config = (struct mac_configuration_cmd_e1h *)BXE_SP(sc, mac_config);
port = BP_PORT(sc);
@@ -14428,7 +14054,7 @@ bxe_set_mac_addr_e1h(struct bxe_softc *sc, int set)
config_table->flags =
MAC_CONFIGURATION_ENTRY_E1H_ACTION_TYPE;
- DBPRINT(sc, BXE_VERBOSE_MISC,
+ DBPRINT(sc, BXE_VERBOSE,
"%s(): %s MAC (%04x:%04x:%04x), E1HOV = %d, CLID = %d\n",
__FUNCTION__, (set ? "Setting" : "Clearing"),
config_table->msb_mac_addr, config_table->middle_mac_addr,
@@ -14439,7 +14065,7 @@ bxe_set_mac_addr_e1h(struct bxe_softc *sc, int set)
U64_LO(BXE_SP_MAPPING(sc, mac_config)), 0);
bxe_set_mac_addr_e1h_exit:
- DBEXIT(BXE_VERBOSE_MISC);
+ DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
}
/*
@@ -14481,24 +14107,14 @@ bxe_set_rx_mode(struct bxe_softc *sc)
* multicast address filtering.
*/
if (ifp->if_flags & IFF_PROMISC) {
- DBPRINT(sc, BXE_VERBOSE_MISC,
- "%s(): Enabling promiscuous mode.\n", __FUNCTION__);
-
/* Enable promiscuous mode. */
rx_mode = BXE_RX_MODE_PROMISC;
} else if (ifp->if_flags & IFF_ALLMULTI ||
ifp->if_amcount > BXE_MAX_MULTICAST) {
- DBPRINT(sc, BXE_VERBOSE_MISC,
- "%s(): Enabling all multicast mode.\n", __FUNCTION__);
-
/* Enable all multicast addresses. */
rx_mode = BXE_RX_MODE_ALLMULTI;
} else {
/* Enable selective multicast mode. */
- DBPRINT(sc, BXE_VERBOSE_MISC,
- "%s(): Enabling selective multicast mode.\n",
- __FUNCTION__);
-
if (CHIP_IS_E1(sc)) {
i = 0;
config = BXE_SP(sc, mcast_config);
@@ -14608,7 +14224,6 @@ bxe_reset_func(struct bxe_softc *sc)
/* Configure IGU. */
REG_WR(sc, HC_REG_LEADING_EDGE_0 + port * 8, 0);
REG_WR(sc, HC_REG_TRAILING_EDGE_0 + port * 8, 0);
-
REG_WR(sc, HC_REG_CONFIG_0 + (port * 4), 0x1000);
/* Clear ILT. */
@@ -14670,8 +14285,10 @@ bxe_reset_common(struct bxe_softc *sc)
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
- REG_WR(sc, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, 0xd3ffff7f);
- REG_WR(sc, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403);
+ REG_WR(sc, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR,
+ 0xd3ffff7f);
+ REG_WR(sc, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR,
+ 0x1403);
DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
}
@@ -14687,7 +14304,6 @@ bxe_reset_chip(struct bxe_softc *sc, uint32_t reset_code)
{
DBENTER(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET | BXE_VERBOSE_UNLOAD);
- DBRUNLV(BXE_INFO, bxe_decode_mb_msgs(sc, 0, reset_code));
switch (reset_code) {
case FW_MSG_CODE_DRV_UNLOAD_COMMON:
@@ -14712,10 +14328,12 @@ bxe_reset_chip(struct bxe_softc *sc, uint32_t reset_code)
}
/*
- * Called by the OS to set media options (link, speed, etc.).
+ * Called by the OS to set media options (link, speed, etc.)
+ * when the user specifies "ifconfig bxe media XXX" or
+ * "ifconfig bxe mediaopt XXX".
*
* Returns:
- * 0 = Success, positive value for failure.
+ * 0 = Success, !0 = Failure
*/
static int
bxe_ifmedia_upd(struct ifnet *ifp)
@@ -14730,44 +14348,32 @@ bxe_ifmedia_upd(struct ifnet *ifp)
ifm = &sc->bxe_ifmedia;
rc = 0;
- /* This is an Ethernet controller. */
+ /* We only support Ethernet media type. */
if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) {
rc = EINVAL;
goto bxe_ifmedia_upd_exit;
}
- BXE_CORE_LOCK(sc);
-
switch (IFM_SUBTYPE(ifm->ifm_media)) {
case IFM_AUTO:
- DBPRINT(sc, BXE_VERBOSE_PHY,
- "%s(): Media set to IFM_AUTO, restarting autonegotiation.\n",
- __FUNCTION__);
+ /* ToDo: What to do here? */
+ /* Doing nothing translates to success here. */
break;
case IFM_10G_CX4:
- DBPRINT(sc, BXE_VERBOSE_PHY,
- "%s(): Media set to IFM_10G_CX4, forced mode.\n", __FUNCTION__);
- break;
+ /* Fall-through */
case IFM_10G_SR:
- DBPRINT(sc, BXE_VERBOSE_PHY,
- "%s(): Media set to IFM_10G_SR, forced mode.\n", __FUNCTION__);
- break;
+ /* Fall-through */
case IFM_10G_T:
- DBPRINT(sc, BXE_VERBOSE_PHY,
- "%s(): Media set to IFM_10G_T, forced mode.\n", __FUNCTION__);
- break;
+ /* Fall-through */
case IFM_10G_TWINAX:
- DBPRINT(sc, BXE_VERBOSE_PHY,
- "%s(): Media set to IFM_10G_TWINAX, forced mode.\n", __FUNCTION__);
- break;
+ /* Fall-through */
default:
+ /* We don't support channging the media type. */
DBPRINT(sc, BXE_WARN, "%s(): Invalid media type!\n",
__FUNCTION__);
rc = EINVAL;
}
- BXE_CORE_UNLOCK(sc);
-
bxe_ifmedia_upd_exit:
DBENTER(BXE_VERBOSE_PHY);
return (rc);
@@ -14789,7 +14395,7 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr)
DBENTER(BXE_EXTREME_LOAD | BXE_EXTREME_RESET);
/* Report link down if the driver isn't running. */
- if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
ifmr->ifm_active |= IFM_NONE;
goto bxe_ifmedia_status_exit;
}
@@ -14824,13 +14430,13 @@ bxe_ifmedia_status_exit:
* None.
*/
static __inline void
-bxe_update_last_max_sge(struct bxe_fastpath *fp, uint16_t idx)
+bxe_update_last_max_sge(struct bxe_fastpath *fp, uint16_t index)
{
uint16_t last_max;
last_max = fp->last_max_sge;
- if (SUB_S16(idx, last_max) > 0)
- fp->last_max_sge = idx;
+ if (SUB_S16(index, last_max) > 0)
+ fp->last_max_sge = index;
}
/*
@@ -14842,13 +14448,13 @@ bxe_update_last_max_sge(struct bxe_fastpath *fp, uint16_t idx)
static void
bxe_clear_sge_mask_next_elems(struct bxe_fastpath *fp)
{
- int i, idx, j;
+ int i, index, j;
- for (i = 1; i <= NUM_RX_SGE_PAGES; i++) {
- idx = RX_SGE_CNT * i - 1;
+ for (i = 0; i < NUM_RX_SGE_PAGES; i++) {
+ index = i * TOTAL_RX_SGE_PER_PAGE + USABLE_RX_SGE_PER_PAGE;
for (j = 0; j < 2; j++) {
- SGE_MASK_CLEAR_BIT(fp, idx);
- idx--;
+ SGE_MASK_CLEAR_BIT(fp, index);
+ index++;
}
}
}
@@ -14864,7 +14470,7 @@ bxe_update_sge_prod(struct bxe_fastpath *fp,
struct eth_fast_path_rx_cqe *fp_cqe)
{
struct bxe_softc *sc;
- uint16_t delta, last_max, last_elem, first_elem, sge_len;
+ uint16_t delta, first_elem, last_max, last_elem, sge_len;
int i;
sc = fp->sc;
@@ -14874,7 +14480,7 @@ bxe_update_sge_prod(struct bxe_fastpath *fp,
sge_len = SGE_PAGE_ALIGN(le16toh(fp_cqe->pkt_len) -
le16toh(fp_cqe->len_on_bd)) >> SGE_PAGE_SHIFT;
if (!sge_len)
- return;
+ goto bxe_update_sge_prod_exit;
/* First mark all used pages. */
for (i = 0; i < sge_len; i++)
@@ -14893,10 +14499,10 @@ bxe_update_sge_prod(struct bxe_fastpath *fp,
/* Now update the producer index. */
for (i = first_elem; i != last_elem; i = NEXT_SGE_MASK_ELEM(i)) {
- if (fp->sge_mask[i])
+ if (fp->rx_sge_mask[i])
break;
- fp->sge_mask[i] = RX_SGE_MASK_ELEM_ONE_MASK;
+ fp->rx_sge_mask[i] = RX_SGE_MASK_ELEM_ONE_MASK;
delta += RX_SGE_MASK_ELEM_SZ;
}
@@ -14906,16 +14512,18 @@ bxe_update_sge_prod(struct bxe_fastpath *fp,
bxe_clear_sge_mask_next_elems(fp);
}
+bxe_update_sge_prod_exit:
DBEXIT(BXE_EXTREME_RECV);
}
/*
* Initialize scatter gather ring bitmask.
*
- * Elements may be taken from the scatter gather ring out of order since
- * TCP frames may be out of order or intermingled among multiple TCP
- * flows on the wire. The SGE bitmask tracks which elements are used
- * or available.
+ * Each entry in the SGE is associated with an aggregation in process.
+ * Since there is no guarantee that all Ethernet frames associated with
+ * a partciular TCP flow will arrive at the adapter and be placed into
+ * the SGE chain contiguously, we maintain a bitmask for each SGE element
+ * that identifies which aggregation an Ethernet frame belongs to.
*
* Returns:
* None
@@ -14925,13 +14533,15 @@ bxe_init_sge_ring_bit_mask(struct bxe_fastpath *fp)
{
/* Set the mask to all 1s, it's faster to compare to 0 than to 0xf. */
- memset(fp->sge_mask, 0xff,
+ memset(fp->rx_sge_mask, 0xff,
(TOTAL_RX_SGE >> RX_SGE_MASK_ELEM_SHIFT) * sizeof(uint64_t));
/*
- * Clear the two last indices in the page to 1. These are the
- * indices that correspond to the "next" element which will
- * never be indicated and should be removed from calculations.
+ * The SGE chain is formatted just like the RX chain.
+ * The last two elements are reserved as a "next page pointer"
+ * to the next page of SGE elements. Clear the last two
+ * elements in each SGE chain page since they will never be
+ * used to track an aggregation.
*/
bxe_clear_sge_mask_next_elems(fp);
}
@@ -14948,32 +14558,55 @@ static void
bxe_tpa_start(struct bxe_fastpath *fp, uint16_t queue, uint16_t cons,
uint16_t prod)
{
- struct bxe_softc *sc = fp->sc;
+ struct bxe_softc *sc;
struct mbuf *m_temp;
struct eth_rx_bd *rx_bd;
bus_dmamap_t map_temp;
+ int max_agg_queues;
sc = fp->sc;
- DBENTER(BXE_EXTREME_RECV);
+ DBENTER(BXE_INSANE_RECV | BXE_INSANE_TPA);
- /* Move the empty mbuf and mapping from the TPA pool. */
+
+
+ DBPRINT(sc, BXE_EXTREME_TPA,
+ "%s(): fp[%02d].tpa[%02d], cons=0x%04X, prod=0x%04X\n",
+ __FUNCTION__, fp->index, queue, cons, prod);
+
+ max_agg_queues = CHIP_IS_E1(sc) ? ETH_MAX_AGGREGATION_QUEUES_E1 :
+ ETH_MAX_AGGREGATION_QUEUES_E1H;
+
+ DBRUNIF((queue > max_agg_queues),
+ BXE_PRINTF("%s(): fp[%02d] illegal aggregation (%d > %d)!\n",
+ __FUNCTION__, fp->index, queue, max_agg_queues));
+
+ DBRUNIF((fp->tpa_state[queue] != BXE_TPA_STATE_STOP),
+ BXE_PRINTF("%s(): Starting aggregation on "
+ "fp[%02d].tpa[%02d] even though queue is not in the "
+ "TPA_STOP state!\n", __FUNCTION__, fp->index, queue));
+
+ /* Remove the existing mbuf and mapping from the TPA pool. */
m_temp = fp->tpa_mbuf_ptr[queue];
map_temp = fp->tpa_mbuf_map[queue];
+ /* Only the paranoid survive! */
+ if(m_temp == NULL) {
+ BXE_PRINTF("%s(%d): fp[%02d].tpa[%02d] not allocated!\n",
+ __FILE__, __LINE__, fp->index, queue);
+ /* ToDo: Additional error handling! */
+ goto bxe_tpa_start_exit;
+ }
+
/* Move received mbuf and mapping to TPA pool. */
fp->tpa_mbuf_ptr[queue] = fp->rx_mbuf_ptr[cons];
fp->tpa_mbuf_map[queue] = fp->rx_mbuf_map[cons];
- DBRUNIF((fp->tpa_state[queue] != BXE_TPA_STATE_STOP),
- DBPRINT(sc, BXE_FATAL, "%s(): Starting bin[%d] even though queue "
- "is not in the TPA_STOP state!\n", __FUNCTION__, queue));
-
/* Place the TPA bin into the START state. */
fp->tpa_state[queue] = BXE_TPA_STATE_START;
DBRUN(fp->tpa_queue_used |= (1 << queue));
/* Get the rx_bd for the next open entry on the receive chain. */
- rx_bd = &fp->rx_bd_chain[RX_PAGE(prod)][RX_IDX(prod)];
+ rx_bd = &fp->rx_chain[prod];
/* Update the rx_bd with the empty mbuf from the TPA pool. */
rx_bd->addr_hi = htole32(U64_HI(fp->tpa_mbuf_segs[queue].ds_addr));
@@ -14981,13 +14614,14 @@ bxe_tpa_start(struct bxe_fastpath *fp, uint16_t queue, uint16_t cons,
fp->rx_mbuf_ptr[prod] = m_temp;
fp->rx_mbuf_map[prod] = map_temp;
- DBEXIT(BXE_EXTREME_RECV);
+bxe_tpa_start_exit:
+ DBEXIT(BXE_INSANE_RECV | BXE_INSANE_TPA);
}
/*
* When a TPA aggregation is completed, loop through the individual mbufs
* of the aggregation, combining them into a single mbuf which will be sent
- * up the stack. Refill all mbufs freed as we go along.
+ * up the stack. Refill all freed SGEs with mbufs as we go along.
*
* Returns:
* 0 = Success, !0 = Failure.
@@ -14996,22 +14630,27 @@ static int
bxe_fill_frag_mbuf(struct bxe_softc *sc, struct bxe_fastpath *fp,
struct mbuf *m, struct eth_fast_path_rx_cqe *fp_cqe, uint16_t cqe_idx)
{
+ struct mbuf *m_frag;
uint32_t frag_len, frag_size, pages, i;
uint16_t sge_idx, len_on_bd;
- int rc, j;
+ int j, rc;
- DBENTER(BXE_EXTREME_RECV);
+ DBENTER(BXE_EXTREME_RECV | BXE_EXTREME_TPA);
rc = 0;
len_on_bd = le16toh(fp_cqe->len_on_bd);
frag_size = le16toh(fp_cqe->pkt_len) - len_on_bd;
pages = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT;
+ DBPRINT(sc, BXE_VERBOSE_TPA,
+ "%s(): len_on_bd=%d, frag_size=%d, pages=%d\n",
+ __FUNCTION__, len_on_bd, frag_size, pages);
+
/* Make sure the aggregated frame is not too big to handle. */
if (pages > 8 * PAGES_PER_SGE) {
DBPRINT(sc, BXE_FATAL,
- "%s(): SGL length (%d) is too long! CQE index is %d\n",
- __FUNCTION__, pages, cqe_idx);
+ "%s(): fp[%02d].rx_sge[0x%04X] has too many pages (%d)!\n",
+ __FUNCTION__, fp->index, cqe_idx, pages);
DBPRINT(sc, BXE_FATAL,
"%s(): fp_cqe->pkt_len = %d fp_cqe->len_on_bd = %d\n",
__FUNCTION__, le16toh(fp_cqe->pkt_len), len_on_bd);
@@ -15021,7 +14660,7 @@ bxe_fill_frag_mbuf(struct bxe_softc *sc, struct bxe_fastpath *fp,
}
/*
- * Run through the scatter gather list, pulling the individual
+ * Scan through the scatter gather list, pulling individual
* mbufs into a single mbuf for the host stack.
*/
for (i = 0, j = 0; i < pages; i += PAGES_PER_SGE, j++) {
@@ -15035,38 +14674,37 @@ bxe_fill_frag_mbuf(struct bxe_softc *sc, struct bxe_fastpath *fp,
frag_len = min(frag_size, (uint32_t)(BCM_PAGE_SIZE *
PAGES_PER_SGE));
- /* Update the mbuf with the fragment length. */
- fp->rx_sge_buf_ptr[sge_idx]->m_len = frag_len;
+ DBPRINT(sc, BXE_VERBOSE_TPA,
+ "%s(): i=%d, j=%d, frag_size=%d, frag_len=%d\n",
+ __FUNCTION__, i, j, frag_size, frag_len);
- /* Unmap the mbuf from DMA space. */
- bus_dmamap_sync(fp->rx_sge_buf_tag, fp->rx_sge_buf_map[sge_idx],
- BUS_DMASYNC_POSTREAD);
- bus_dmamap_unload(fp->rx_sge_buf_tag,
- fp->rx_sge_buf_map[sge_idx]);
+ m_frag = fp->rx_sge_buf_ptr[sge_idx];
- /* Concatenate the current fragment to the aggregated mbuf. */
- m_cat(m, fp->rx_sge_buf_ptr[sge_idx]);
+ /* Allocate a new mbuf for the SGE. */
+ rc = bxe_alloc_rx_sge_mbuf(fp, sge_idx);
+ if (rc) {
+ /*
+ * Leave all remaining SGEs in the ring.
+ */
+ goto bxe_fill_frag_mbuf_exit;
+ }
- /* The SGE mbuf was freed in the call to m_cat(). */
- DBRUN(fp->sge_mbuf_alloc--);
- fp->rx_sge_buf_ptr[sge_idx] = NULL;
+ /* Update the fragment its length. */
+ m_frag->m_len = frag_len;
- /*
- * Try an allocate a new mbuf for the SGE that was just
- * released. If an allocation error occurs stop where we
- * are and drop the whole frame.
- */
- rc = bxe_alloc_rx_sge(sc, fp, sge_idx);
- if (rc)
- goto bxe_fill_frag_mbuf_exit;
+ /* Concatenate the fragment to the head mbuf. */
+ m_cat(m, m_frag);
+ DBRUN(fp->sge_mbuf_alloc--);
+ /* Update TPA mbuf size and remaining fragment size. */
m->m_pkthdr.len += frag_len;
-
frag_size -= frag_len;
}
bxe_fill_frag_mbuf_exit:
- DBEXIT(BXE_EXTREME_RECV);
+ DBPRINT(sc, BXE_VERBOSE_TPA,
+ "%s(): frag_size=%d\n", __FUNCTION__, frag_size);
+ DBEXIT(BXE_EXTREME_RECV | BXE_EXTREME_TPA);
return (rc);
}
@@ -15082,102 +14720,70 @@ static void
bxe_tpa_stop(struct bxe_softc *sc, struct bxe_fastpath *fp, uint16_t queue,
int pad, int len, union eth_rx_cqe *cqe, uint16_t cqe_idx)
{
- struct mbuf *m_old, *m_new;
- struct ip *ip;
+ struct mbuf *m;
struct ifnet *ifp;
- struct ether_vlan_header *eh;
- bus_dma_segment_t seg;
- int rc, e_hlen;
+ int rc;
- DBENTER(BXE_EXTREME_RECV);
- DBPRINT(sc, BXE_VERBOSE_RECV,
- "%s(): fp[%d], tpa queue = %d, len = %d, pad = %d\n", __FUNCTION__,
- fp->index, queue, len, pad);
+ DBENTER(BXE_INSANE_RECV | BXE_INSANE_TPA);
+ DBPRINT(sc, (BXE_EXTREME_RECV | BXE_EXTREME_TPA),
+ "%s(): fp[%02d].tpa[%02d], len=%d, pad=%d\n",
+ __FUNCTION__, fp->index, queue, len, pad);
rc = 0;
ifp = sc->bxe_ifp;
- /* Unmap m_old from DMA space. */
- m_old = fp->tpa_mbuf_ptr[queue];
- bus_dmamap_sync(fp->rx_mbuf_tag, fp->tpa_mbuf_map[queue],
- BUS_DMASYNC_POSTREAD);
- bus_dmamap_unload(fp->rx_mbuf_tag, fp->tpa_mbuf_map[queue]);
+ m = fp->tpa_mbuf_ptr[queue];
- /* Skip over the pad when passing the data up the stack. */
- m_adj(m_old, pad);
+ /* Allocate a replacement before modifying existing mbuf. */
+ rc = bxe_alloc_tpa_mbuf(fp, queue);
+ if (rc) {
+ /* Drop the frame and log a soft error. */
+ fp->rx_soft_errors++;
+ goto bxe_tpa_stop_exit;
+ }
- /* Adjust the packet length to match the received data. */
- m_old->m_pkthdr.len = m_old->m_len = len;
+ /* We have a replacement, fixup the current mbuf. */
+ m_adj(m, pad);
+ m->m_pkthdr.len = m->m_len = len;
- /* Validate the checksum if offload enabled. */
- m_old->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID |
+ /* Mark the checksums valid (taken care of by firmware). */
+ m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID |
CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
- m_old->m_pkthdr.csum_data = 0xffff;
-
- /* Map the header and find the Ethernet type & header length. */
- eh = mtod(m_old, struct ether_vlan_header *);
- if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN))
- e_hlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN;
- else
- e_hlen = ETHER_HDR_LEN;
-
- /* Get the IP header pointer. */
- ip = (struct ip *)(m_old->m_data + e_hlen);
+ m->m_pkthdr.csum_data = 0xffff;
- ip->ip_sum = 0;
- ip->ip_sum = in_cksum_hdr(ip);
-
- /* Try and aggregate all of the receive mbufs into a single mbuf. */
- if (!bxe_fill_frag_mbuf(sc, fp, m_old, &cqe->fast_path_cqe, cqe_idx)) {
- /*
- * We have an aggregated frame. If the frame has a vlan tag
- * attach that information to the mbuf.
- */
+ /* Aggregate all of the SGEs into a single mbuf. */
+ rc = bxe_fill_frag_mbuf(sc, fp, m, &cqe->fast_path_cqe, cqe_idx);
+ if (rc) {
+ /* Drop the packet and log an error. */
+ fp->rx_soft_errors++;
+ m_freem(m);
+ } else {
+ /* Find VLAN tag and send frame up to the stack. */
if ((le16toh(cqe->fast_path_cqe.pars_flags.flags) &
PARSING_FLAGS_VLAN)) {
- m_old->m_pkthdr.ether_vtag =
+ m->m_pkthdr.ether_vtag =
cqe->fast_path_cqe.vlan_tag;
- m_old->m_flags |= M_VLANTAG;
+ m->m_flags |= M_VLANTAG;
}
- /* Send the packet to the appropriate interface. */
- m_old->m_pkthdr.rcvif = ifp;
+ /* Assign packet to the appropriate interface. */
+ m->m_pkthdr.rcvif = ifp;
- /* Pass the packet up to the stack. */
- fp->ipackets++;
- DBRUN(fp->tpa_pkts++);
- (*ifp->if_input)(ifp, m_old);
- } else {
- DBPRINT(sc, BXE_WARN,
- "%s(): Failed to allocate new SGE page, dropping frame!\n",
- __FUNCTION__);
- fp->soft_rx_errors++;
- m_freem(m_old);
+ /* Update packet statistics. */
+ fp->rx_tpa_pkts++;
+ ifp->if_ipackets++;
+
+ /* ToDo: Any potential locking issues here? */
+ /* Pass the frame to the stack. */
+ (*ifp->if_input)(ifp, m);
}
- /* We passed m_old up the stack or dropped the frame. */
+ /* We passed mbuf up the stack or dropped the frame. */
DBRUN(fp->tpa_mbuf_alloc--);
- /* Allocate a replacement mbuf. */
- if (__predict_false((m_new = bxe_alloc_mbuf(fp,
- sc->mbuf_alloc_size)) == NULL))
- goto bxe_tpa_stop_exit;
-
- /* Map the new mbuf and place it in the pool. */
- rc = bxe_map_mbuf(fp, m_new, fp->rx_mbuf_tag,
- fp->tpa_mbuf_map[queue], &seg);
- if (rc)
- goto bxe_tpa_stop_exit;
-
- DBRUN(fp->tpa_mbuf_alloc++);
-
- fp->tpa_mbuf_ptr[queue] = m_new;
- fp->tpa_mbuf_segs[queue] = seg;
-
bxe_tpa_stop_exit:
fp->tpa_state[queue] = BXE_TPA_STATE_STOP;
DBRUN(fp->tpa_queue_used &= ~(1 << queue));
-
- DBEXIT(BXE_EXTREME_RECV);
+ DBEXIT(BXE_INSANE_RECV | BXE_INSANE_TPA);
}
/*
@@ -15195,7 +14801,7 @@ bxe_update_rx_prod(struct bxe_softc *sc, struct bxe_fastpath *fp,
int i;
/* Update producers. */
- rx_prods.bd_prod = bd_prod;
+ rx_prods.bd_prod = bd_prod;
rx_prods.cqe_prod = cqe_prod;
rx_prods.sge_prod = sge_prod;
@@ -15213,7 +14819,7 @@ bxe_update_rx_prod(struct bxe_softc *sc, struct bxe_fastpath *fp,
}
/*
- * Handles received frame interrupt events.
+ * Processes received frames.
*
* Returns:
* Nothing.
@@ -15228,6 +14834,7 @@ bxe_rxeof(struct bxe_fastpath *fp)
uint16_t rx_cq_cons, rx_cq_cons_idx;
uint16_t rx_cq_prod, rx_cq_cons_sb;
unsigned long rx_pkts = 0;
+ int rc;
sc = fp->sc;
ifp = sc->bxe_ifp;
@@ -15240,8 +14847,8 @@ bxe_rxeof(struct bxe_fastpath *fp)
/*
* Get working copies of the driver's view of the
* RX indices. These are 16 bit values that are
- * expected to increment from from 0 to 65535
- * and then wrap-around to 0 again.
+ * expected to increment from 0 to 65535 and then
+ * wrap-around to 0 again.
*/
rx_bd_cons = fp->rx_bd_cons;
rx_bd_prod = fp->rx_bd_prod;
@@ -15249,7 +14856,7 @@ bxe_rxeof(struct bxe_fastpath *fp)
rx_cq_prod = fp->rx_cq_prod;
DBPRINT(sc, (BXE_EXTREME_RECV),
- "%s(%d): BEFORE: fp[%d], rx_bd_cons = 0x%04X, rx_bd_prod = 0x%04X, "
+ "%s(%d): BEFORE: fp[%02d], rx_bd_cons = 0x%04X, rx_bd_prod = 0x%04X, "
"rx_cq_cons_sw = 0x%04X, rx_cq_prod_sw = 0x%04X\n", __FUNCTION__,
curcpu, fp->index, rx_bd_cons, rx_bd_prod, rx_cq_cons, rx_cq_prod);
@@ -15271,33 +14878,24 @@ bxe_rxeof(struct bxe_fastpath *fp)
/*
* Convert the 16 bit indices used by hardware
- * into values that map to the arrays used by
- * the driver (i.e. an index).
+ * into array indices used by the driver.
*/
- rx_cq_cons_idx = RCQ_ENTRY(rx_cq_cons);
+ rx_cq_cons_idx = RCQ_ENTRY(rx_cq_cons);
rx_bd_prod_idx = RX_BD(rx_bd_prod);
rx_bd_cons_idx = RX_BD(rx_bd_cons);
wmb();
- /* Fetch the cookie. */
+ /* Fetch the completion queue entry (i.e. cookie). */
cqe = (union eth_rx_cqe *)
- &fp->rx_cq_chain[RCQ_PAGE(rx_cq_cons_idx)][RCQ_IDX(rx_cq_cons_idx)];
+ &fp->rcq_chain[rx_cq_cons_idx];
cqe_fp_flags = cqe->fast_path_cqe.type_error_flags;
-#ifdef BXE_DEBUG
- /* Simulate an error on the received frame. */
- if (DB_RANDOMTRUE(bxe_debug_received_frame_error)) {
- DBPRINT(sc, BXE_WARN,
- "%s(): Simulated CQE error flags!\n", __FUNCTION__);
- cqe_fp_flags |= ETH_RX_ERROR_FLAGS;
- sc->debug_received_frame_error++;
+ /* Sanity check the cookie flags. */
+ if (__predict_false(cqe_fp_flags == 0)) {
+ fp->rx_null_cqe_flags++;
+ DBRUN(bxe_dump_cqe(fp, rx_cq_cons_idx, cqe));
+ /* ToDo: What error handling can be done here? */
}
-#endif
-
- DBRUNIF((cqe_fp_flags == 0),
- fp->null_cqe_flags++;
- bxe_dump_cqe(fp, rx_cq_cons_idx, cqe));
- /* DRC - ANything else to do here? */
/* Check the CQE type for slowpath or fastpath completion. */
if (__predict_false(CQE_TYPE(cqe_fp_flags) ==
@@ -15314,7 +14912,8 @@ bxe_rxeof(struct bxe_fastpath *fp)
pad = cqe->fast_path_cqe.placement_offset;
/* Check if the completion is for TPA. */
- if ((!fp->disable_tpa) && (TPA_TYPE(cqe_fp_flags) !=
+ if ((fp->disable_tpa == FALSE) &&
+ (TPA_TYPE(cqe_fp_flags) !=
(TPA_TYPE_START | TPA_TYPE_END))) {
uint16_t queue = cqe->fast_path_cqe.queue_index;
@@ -15325,21 +14924,19 @@ bxe_rxeof(struct bxe_fastpath *fp)
* the frames.
*/
- /*
- * Check if a TPA aggregation has been started.
- */
+ /* Check if TPA aggregation has started. */
if (TPA_TYPE(cqe_fp_flags) == TPA_TYPE_START) {
- bxe_tpa_start(fp, queue,
- rx_bd_cons_idx, rx_bd_prod_idx);
+ bxe_tpa_start(fp, queue, rx_bd_cons_idx,
+ rx_bd_prod_idx);
goto bxe_rxeof_next_rx;
}
- /* Check if a TPA aggregation has completed. */
+ /* Check if TPA aggregation has completed. */
if (TPA_TYPE(cqe_fp_flags) == TPA_TYPE_END) {
- if (!BXE_RX_SUM_FIX(cqe))
- DBPRINT(sc, BXE_FATAL,
- "%s(): STOP on non-TCP data.\n",
- __FUNCTION__);
+ DBRUNIF(!BXE_RX_SUM_FIX(cqe),
+ DBPRINT(sc, BXE_FATAL,
+ "%s(): STOP on non-TCP data.\n",
+ __FUNCTION__));
/*
* This is the size of the linear
@@ -15359,108 +14956,39 @@ bxe_rxeof(struct bxe_fastpath *fp)
}
}
- /* Remove the mbuf from the RX chain. */
m = fp->rx_mbuf_ptr[rx_bd_cons_idx];
- fp->rx_mbuf_ptr[rx_bd_cons_idx] = NULL;
- DBRUN(fp->free_rx_bd++);
- DBRUNIF((fp->free_rx_bd > USABLE_RX_BD),
- DBPRINT(sc, BXE_FATAL,
- "%s(): fp[%d] - Too many free rx_bd's (0x%04X)!\n",
- __FUNCTION__, fp->index, fp->free_rx_bd));
-
- /* Unmap the mbuf from DMA space. */
- bus_dmamap_sync(fp->rx_mbuf_tag,
- fp->rx_mbuf_map[rx_bd_cons_idx],
- BUS_DMASYNC_POSTREAD);
- bus_dmamap_unload(fp->rx_mbuf_tag,
- fp->rx_mbuf_map[rx_bd_cons_idx]);
+ /* Allocate a replacement before modifying existing mbuf. */
+ rc = bxe_alloc_rx_bd_mbuf(fp, rx_bd_prod_idx);
+ if (rc) {
+ /* Drop the frame and log a soft error. */
+ fp->rx_soft_errors++;
+ goto bxe_rxeof_next_rx;
+ }
/* Check if the received frame has any errors. */
if (__predict_false(cqe_fp_flags &
ETH_RX_ERROR_FLAGS)) {
DBPRINT(sc, BXE_WARN ,
- "%s(): Found error flags (0x%08X) "
- "set in received frame on fp[%d]!\n",
- __FUNCTION__, cqe_fp_flags, fp->index);
-
- fp->soft_rx_errors++;
-
- /* Reuse the mbuf for a new frame. */
- if (bxe_get_buf(fp, m, rx_bd_prod_idx)) {
- DBPRINT(sc, BXE_FATAL,
- "%s(): Can't reuse RX mbuf!\n",
- __FUNCTION__);
- DBRUN(bxe_breakpoint(sc));
+ "%s(): fp[%02d].cqe[0x%04X] has errors "
+ "(0x%08X)!\n", __FUNCTION__, fp->index,
+ rx_cq_cons, cqe_fp_flags);
- /* ToDo: Find alterntive to panic(). */
- panic("bxe%d: Can't reuse RX mbuf!\n",
- sc->bxe_unit);
- }
-
- /* Go handle any additional received frames. */
+ fp->rx_soft_errors++;
goto bxe_rxeof_next_rx;
}
- /*
- * The high level logic used here is to
- * immediatley replace each receive buffer
- * as it is used so that the receive chain
- * is full at all times. First we try to
- * allocate a new receive buffer, but if
- * that fails then we will reuse the
- * existing mbuf and log an error for the
- * lost packet.
- */
-
- /* Allocate a new mbuf for the receive chain. */
- if (__predict_false(bxe_get_buf(fp,
- NULL, rx_bd_prod_idx))) {
- /*
- * Drop the current frame if we can't get
- * a new mbuf.
- */
- fp->soft_rx_errors++;
-
- /*
- * Place the current mbuf back in the
- * receive chain.
- */
- if (__predict_false(bxe_get_buf(fp, m,
- rx_bd_prod_idx))) {
- /* This is really bad! */
- DBPRINT(sc, BXE_FATAL,
- "%s(): Can't reuse RX mbuf!\n",
- __FUNCTION__);
- DBRUN(bxe_breakpoint(sc));
-
- /* ToDo: Find alterntive to panic(). */
- panic(
- "bxe%d: Double mbuf allocation failure!\n",
- sc->bxe_unit);
- }
-
- /* Go handle any additional received frames. */
- goto bxe_rxeof_next_rx;
- }
-
- /*
- * Skip over the pad when passing the data up the stack.
- */
+ /* We have a replacement, fixup the current mbuf. */
m_adj(m, pad);
-
- /*
- * Adjust the packet length to match the received data.
- */
m->m_pkthdr.len = m->m_len = len;
- /* Send the packet to the appropriate interface. */
+ /* Assign packet to the appropriate interface. */
m->m_pkthdr.rcvif = ifp;
- /* Assume no hardware checksum. */
+ /* Assume no hardware checksum complated. */
m->m_pkthdr.csum_flags = 0;
- /* Validate the checksum if offload enabled. */
+ /* Validate checksum if offload enabled. */
if (ifp->if_capenable & IFCAP_RXCSUM) {
/* Check whether IP checksummed or not. */
if (sc->rx_csum &&
@@ -15517,8 +15045,9 @@ bxe_rxeof(struct bxe_fastpath *fp)
/* Last chance to check for problems. */
DBRUN(bxe_validate_rx_packet(fp, rx_cq_cons, cqe, m));
- /* Pass the mbuf off to the upper layers. */
+ /* Update packet statistics. */
ifp->if_ipackets++;
+ rx_pkts++;
/* ToDo: Any potential locking issues here? */
/* Pass the frame to the stack. */
@@ -15530,7 +15059,6 @@ bxe_rxeof(struct bxe_fastpath *fp)
bxe_rxeof_next_rx:
rx_bd_prod = NEXT_RX_BD(rx_bd_prod);
rx_bd_cons = NEXT_RX_BD(rx_bd_cons);
- rx_pkts++;
bxe_rxeof_next_cqe:
rx_cq_prod = NEXT_RCQ_IDX(rx_cq_prod);
@@ -15543,14 +15071,14 @@ bxe_rxeof_next_cqe:
rmb();
}
- /* Update the driver copy of the fastpath indices. */
+ /* Update driver copy of the fastpath indices. */
fp->rx_bd_cons = rx_bd_cons;
fp->rx_bd_prod = rx_bd_prod;
fp->rx_cq_cons = rx_cq_cons;
fp->rx_cq_prod = rx_cq_prod;
DBPRINT(sc, (BXE_EXTREME_RECV),
- "%s(%d): AFTER: fp[%d], rx_bd_cons = 0x%04X, rx_bd_prod = 0x%04X, "
+ "%s(%d): AFTER: fp[%02d], rx_bd_cons = 0x%04X, rx_bd_prod = 0x%04X, "
"rx_cq_cons_sw = 0x%04X, rx_cq_prod_sw = 0x%04X\n", __FUNCTION__,
curcpu, fp->index, rx_bd_cons, rx_bd_prod, rx_cq_cons, rx_cq_prod);
@@ -15561,12 +15089,11 @@ bxe_rxeof_next_cqe:
BUS_SPACE_BARRIER_READ);
fp->rx_pkts += rx_pkts;
- fp->rx_calls++;
DBEXIT(BXE_EXTREME_RECV);
}
/*
- * Handles transmit completion interrupt events.
+ * Processes transmit completions.
*
* Returns:
* Nothing.
@@ -15577,92 +15104,60 @@ bxe_txeof(struct bxe_fastpath *fp)
struct bxe_softc *sc;
struct ifnet *ifp;
struct eth_tx_start_bd *txbd;
- uint16_t hw_pkt_cons, sw_pkt_cons, sw_tx_bd_cons, sw_tx_chain_cons;
- uint16_t pkt_cons, nbds;
+ uint16_t hw_pkt_cons, sw_pkt_cons, sw_tx_bd_cons;
+ uint16_t bd_index, pkt_index, nbds;
int i;
sc = fp->sc;
ifp = sc->bxe_ifp;
DBENTER(BXE_EXTREME_SEND);
- DBPRINT(sc, BXE_EXTREME_SEND, "%s(): Servicing fp[%d]\n",
- __FUNCTION__, fp->index);
/* Get the hardware's view of the TX packet consumer index. */
- hw_pkt_cons = le16toh(*fp->tx_cons_sb);
+ hw_pkt_cons = le16toh(*fp->tx_pkt_cons_sb);
sw_pkt_cons = fp->tx_pkt_cons;
sw_tx_bd_cons = fp->tx_bd_cons;
/* Cycle through any completed TX chain page entries. */
while (sw_pkt_cons != hw_pkt_cons) {
- txbd = NULL;
- sw_tx_chain_cons = TX_BD(sw_tx_bd_cons);
- pkt_cons = TX_BD(sw_pkt_cons);
+ bd_index = TX_BD(sw_tx_bd_cons);
+ pkt_index = TX_BD(sw_pkt_cons);
-#ifdef BXE_DEBUG
- if (sw_tx_chain_cons > MAX_TX_BD) {
- BXE_PRINTF(
- "%s(): TX chain consumer out of range! 0x%04X > 0x%04X\n",
- __FUNCTION__, sw_tx_chain_cons, (int)MAX_TX_BD);
- bxe_breakpoint(sc);
- }
-#endif
-
- txbd =
-&fp->tx_bd_chain[TX_PAGE(sw_tx_chain_cons)][TX_IDX(sw_tx_chain_cons)].start_bd;
-
-#ifdef BXE_DEBUG
- if (txbd == NULL) {
- BXE_PRINTF("%s(): Unexpected NULL tx_bd[0x%04X]!\n",
- __FUNCTION__, sw_tx_chain_cons);
- bxe_breakpoint(sc);
- }
-#endif
-
- /*
- * Find the number of BD's that were used in the completed pkt.
- */
+ txbd = &fp->tx_chain[bd_index].start_bd;
nbds = txbd->nbd;
- /*
- * Free the ext mbuf cluster from the mbuf of the completed
- * frame.
- */
- if (__predict_true(fp->tx_mbuf_ptr[pkt_cons] != NULL)) {
- /* Unmap it from the mbuf. */
+ /* Free the completed frame's mbuf. */
+ if (__predict_true(fp->tx_mbuf_ptr[pkt_index] != NULL)) {
+ /* Unmap the mbuf from non-paged memory. */
bus_dmamap_unload(fp->tx_mbuf_tag,
- fp->tx_mbuf_map[pkt_cons]);
+ fp->tx_mbuf_map[pkt_index]);
- /* Return the mbuf to the stack. */
- DBRUN(fp->tx_mbuf_alloc--);
- m_freem(fp->tx_mbuf_ptr[pkt_cons]);
- fp->tx_mbuf_ptr[pkt_cons] = NULL;
+ /* Return the mbuf to the system. */
+ m_freem(fp->tx_mbuf_ptr[pkt_index]);
+ fp->tx_mbuf_alloc--;
+ fp->tx_mbuf_ptr[pkt_index] = NULL;
fp->opackets++;
} else {
fp->tx_chain_lost_mbuf++;
}
- /* Skip over the remaining used buffer descriptors. */
- fp->used_tx_bd -= nbds;
+ /* Updated packet consumer value. */
+ sw_pkt_cons++;
+ /* Skip over the remaining used buffer descriptors. */
+ fp->tx_bd_used -= nbds;
for (i = 0; i < nbds; i++)
sw_tx_bd_cons = NEXT_TX_BD(sw_tx_bd_cons);
- /* Increment the software copy of packet consumer index */
- sw_pkt_cons++;
-
- /*
- * Refresh the hw packet consumer index to see if there's
- * new work.
- */
- hw_pkt_cons = le16toh(*fp->tx_cons_sb);
+ /* Check for new work since we started. */
+ hw_pkt_cons = le16toh(*fp->tx_pkt_cons_sb);
rmb();
}
/* Enable new transmits if we've made enough room. */
- if (fp->used_tx_bd < BXE_TX_CLEANUP_THRESHOLD) {
+ if (fp->tx_bd_used < BXE_TX_CLEANUP_THRESHOLD) {
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- if (fp->used_tx_bd == 0) {
+ if (fp->tx_bd_used == 0) {
/*
* Clear the watchdog timer if we've emptied
* the TX chain.
@@ -15684,78 +15179,6 @@ bxe_txeof(struct bxe_fastpath *fp)
}
/*
- * Encapsulate an mbuf cluster into the rx_bd.
- *
- * This routine will map an mbuf cluster into 1 rx_bd
- *
- * Returns:
- * 0 for success, positive value for failure.
- */
-static int
-bxe_get_buf(struct bxe_fastpath *fp, struct mbuf *m, uint16_t prod)
-{
- struct bxe_softc *sc;
- bus_dma_segment_t seg;
- struct mbuf *m_new;
- struct eth_rx_bd *rx_bd;
- int rc;
-
- sc = fp->sc;
- m_new = NULL;
- rc = 0;
-
- DBENTER(BXE_INSANE_LOAD | BXE_INSANE_RESET | BXE_INSANE_RECV);
-
- /* Make sure the inputs are valid. */
- DBRUNIF((prod > MAX_RX_BD),
- BXE_PRINTF("%s(): RX producer out of range: 0x%04X > 0x%04X\n",
- __FUNCTION__, prod, (uint16_t) MAX_RX_BD));
-
- /* Check whether this is a new mbuf allocation. */
- if (m == NULL) {
- if ((m_new = bxe_alloc_mbuf(fp, sc->mbuf_alloc_size)) == NULL) {
- rc = ENOBUFS;
- goto bxe_get_buf_exit;
- }
-
- DBRUN(fp->rx_mbuf_alloc++);
- } else {
- /* Reuse the existing mbuf. */
- m_new = m;
- m_new->m_pkthdr.len = m_new->m_len = sc->mbuf_alloc_size;
- }
-
- /* Do some additional sanity checks on the mbuf. */
- DBRUN(m_sanity(m_new, FALSE));
-
- rc = bxe_map_mbuf(fp, m_new, fp->rx_mbuf_tag,
- fp->rx_mbuf_map[prod], &seg);
-
- if (__predict_false(rc)) {
- DBRUN(fp->rx_mbuf_alloc--);
- rc = ENOBUFS;
- goto bxe_get_buf_exit;
- }
-
- /* Setup the rx_bd for the first segment. */
- rx_bd = &fp->rx_bd_chain[RX_PAGE(prod)][RX_IDX(prod)];
- rx_bd->addr_lo = htole32(U64_LO(seg.ds_addr));
- rx_bd->addr_hi = htole32(U64_HI(seg.ds_addr));
-
- /* Save the mbuf and update our counter. */
- fp->rx_mbuf_ptr[prod] = m_new;
-
- DBRUN(fp->free_rx_bd--);
- DBRUNIF((fp->free_rx_bd > USABLE_RX_BD),
- DBPRINT(sc, BXE_FATAL, "%s(): fp[%d] - Too many free rx_bd's "
- "(0x%04X)!\n", __FUNCTION__, fp->index, fp->free_rx_bd));
-
-bxe_get_buf_exit:
- DBEXIT(BXE_INSANE_LOAD | BXE_INSANE_RESET | BXE_INSANE_RECV);
- return (rc);
-}
-
-/*
* Transmit timeout handler.
*
* Returns:
@@ -15764,9 +15187,10 @@ bxe_get_buf_exit:
static int
bxe_watchdog(struct bxe_fastpath *fp)
{
- struct bxe_softc *sc = fp->sc;
+ struct bxe_softc *sc;
int rc = 0;
+ sc = fp->sc;
DBENTER(BXE_INSANE_SEND);
BXE_FP_LOCK(fp);
@@ -15795,39 +15219,10 @@ bxe_watchdog(struct bxe_fastpath *fp)
bxe_watchdog_exit:
DBEXIT(BXE_INSANE_SEND);
- return(rc);
-}
-
-
-/*
- * Change the MTU size for the port. The MTU should be validated before
- * calling this routine.
- *
- * Returns:
- * 0 = Success, !0 = Failure.
- */
-static int
-bxe_change_mtu(struct bxe_softc *sc, int if_drv_running)
-{
- struct ifnet *ifp;
- int rc;
-
- BXE_CORE_LOCK_ASSERT(sc);
-
- rc = 0;
- ifp = sc->bxe_ifp;
- sc->bxe_ifp->if_mtu = ifp->if_mtu;
- if (if_drv_running) {
- DBPRINT(sc, BXE_INFO_IOCTL, "%s(): Changing the MTU to %d.\n",
- __FUNCTION__, sc->bxe_ifp->if_mtu);
-
- bxe_stop_locked(sc, UNLOAD_NORMAL);
- bxe_init_locked(sc, LOAD_NORMAL);
- }
-
return (rc);
}
+
/*
* The periodic timer tick routine.
*
@@ -15850,21 +15245,22 @@ bxe_tick(void *xsc)
sc = xsc;
DBENTER(BXE_INSANE_MISC);
+
/* Check for TX timeouts on any fastpath. */
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
+
if (bxe_watchdog(fp) != 0)
break;
}
- BXE_CORE_LOCK(sc);
func = BP_FUNC(sc);
/* Schedule the next tick. */
callout_reset(&sc->bxe_tick_callout, hz, bxe_tick, sc);
#if 0
- if (!BP_NOMCP(sc)) {
+ if (!NOMCP(sc)) {
func = BP_FUNC(sc);
++sc->fw_drv_pulse_wr_seq;
@@ -15894,8 +15290,6 @@ bxe_tick(void *xsc)
if ((sc->state == BXE_STATE_OPEN) || (sc->state == BXE_STATE_DISABLED))
bxe_stats_handle(sc, STATS_EVENT_UPDATE);
-
- BXE_CORE_UNLOCK(sc);
}
#ifdef BXE_DEBUG
@@ -16155,7 +15549,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
device_get_sysctl_ctx(sc->dev);
struct sysctl_oid_list *children =
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev));
- struct bxe_eth_stats *estats = &sc->eth_stats;
+ struct bxe_port_stats *estats = &sc->eth_stats;
SYSCTL_ADD_UINT(ctx, children, OID_AUTO,
"estats_total_bytes_received_hi",
@@ -16275,95 +15669,110 @@ bxe_add_sysctls(struct bxe_softc *sc)
namebuf, CTLFLAG_RD, NULL, "Queue Name");
queue_list = SYSCTL_CHILDREN(queue_node);
+ /*
+ * Receive related fastpath statistics.*
+ */
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
"rx_pkts",
CTLFLAG_RD, &fp->rx_pkts,
"Received packets");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "tx_pkts",
- CTLFLAG_RD, &fp->tx_pkts,
- "Transmitted packets");
-
- SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "mbuf_alloc_failed",
- CTLFLAG_RD, &fp->mbuf_alloc_failed,
- "Mbuf allocation failure count");
+ "rx_tpa_pkts",
+ CTLFLAG_RD, &fp->rx_tpa_pkts,
+ "Received TPA packets");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "tpa_mbuf_alloc_failed",
- CTLFLAG_RD, &fp->tpa_mbuf_alloc_failed,
- "TPA mbuf allocation failure count");
+ "rx_null_cqe_flags",
+ CTLFLAG_RD, &fp->rx_null_cqe_flags,
+ "CQEs with NULL flags count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "mbuf_defrag_attempts",
- CTLFLAG_RD, &fp->mbuf_defrag_attempts,
- "Mbuf defrag attempt count");
+ "rx_soft_errors",
+ CTLFLAG_RD, &fp->rx_soft_errors,
+ "Received frames dropped by driver count");
+ /*
+ * Transmit related fastpath statistics.*
+ */
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "mbuf_defrag_failures",
- CTLFLAG_RD, &fp->mbuf_defrag_failures,
- "Mbuf defrag failure count");
+ "tx_pkts",
+ CTLFLAG_RD, &fp->tx_pkts,
+ "Transmitted packets");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "mbuf_defrag_successes",
- CTLFLAG_RD, &fp->mbuf_defrag_successes,
- "Mbuf defrag success count");
+ "tx_soft_errors",
+ CTLFLAG_RD, &fp->tx_soft_errors,
+ "Transmit frames dropped by driver count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "offload_frames_csum_ip",
- CTLFLAG_RD, &fp->offload_frames_csum_ip,
+ "tx_offload_frames_csum_ip",
+ CTLFLAG_RD, &fp->tx_offload_frames_csum_ip,
"IP checksum offload frame count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "offload_frames_csum_tcp",
- CTLFLAG_RD, &fp->offload_frames_csum_tcp,
+ "tx_offload_frames_csum_tcp",
+ CTLFLAG_RD, &fp->tx_offload_frames_csum_tcp,
"TCP checksum offload frame count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "offload_frames_csum_udp",
- CTLFLAG_RD, &fp->offload_frames_csum_udp,
+ "tx_offload_frames_csum_udp",
+ CTLFLAG_RD, &fp->tx_offload_frames_csum_udp,
"UDP checksum offload frame count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "offload_frames_tso",
- CTLFLAG_RD, &fp->offload_frames_tso,
+ "tx_offload_frames_tso",
+ CTLFLAG_RD, &fp->tx_offload_frames_tso,
"TSO offload frame count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "tx_header_splits",
+ CTLFLAG_RD, &fp->tx_header_splits,
+ "TSO frame header/data split count");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
"tx_encap_failures",
CTLFLAG_RD, &fp->tx_encap_failures,
"TX encapsulation failure count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "tx_start_called_on_empty_queue",
- CTLFLAG_RD, &fp->tx_start_called_on_empty_queue,
- "TX start function called on empty "
- "TX queue count");
+ "tx_hw_queue_full",
+ CTLFLAG_RD, &fp->tx_hw_queue_full,
+ "TX H/W queue too full to add a frame count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "tx_queue_too_full",
- CTLFLAG_RD, &fp->tx_queue_too_full,
- "TX queue too full to add a TX frame count");
+ "tx_hw_max_queue_depth",
+ CTLFLAG_RD, &fp->tx_hw_max_queue_depth,
+ "TX H/W maximum queue depth count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "window_violation_std",
- CTLFLAG_RD, &fp->window_violation_std,
+ "tx_dma_mapping_failure",
+ CTLFLAG_RD, &fp->tx_dma_mapping_failure,
+ "TX DMA mapping failure");
+
+ SYSCTL_ADD_INT(ctx, queue_list, OID_AUTO,
+ "tx_max_drbr_queue_depth",
+ CTLFLAG_RD, &fp->tx_max_drbr_queue_depth,
+ 0, "TX S/W queue maximum depth");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "tx_window_violation_std",
+ CTLFLAG_RD, &fp->tx_window_violation_std,
"Standard frame TX BD window violation count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "window_violation_tso",
- CTLFLAG_RD, &fp->window_violation_tso,
+ "tx_window_violation_tso",
+ CTLFLAG_RD, &fp->tx_window_violation_tso,
"TSO frame TX BD window violation count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "unsupported_tso_request_ipv6",
- CTLFLAG_RD, &fp->unsupported_tso_request_ipv6,
+ "tx_unsupported_tso_request_ipv6",
+ CTLFLAG_RD, &fp->tx_unsupported_tso_request_ipv6,
"TSO frames with unsupported IPv6 protocol count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "unsupported_tso_request_not_tcp",
- CTLFLAG_RD, &fp->unsupported_tso_request_not_tcp,
+ "tx_unsupported_tso_request_not_tcp",
+ CTLFLAG_RD, &fp->tx_unsupported_tso_request_not_tcp,
"TSO frames with unsupported protocol count");
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
@@ -16371,17 +15780,58 @@ bxe_add_sysctls(struct bxe_softc *sc)
CTLFLAG_RD, &fp->tx_chain_lost_mbuf,
"Mbufs lost on TX chain count");
- SYSCTL_ADD_INT(ctx, queue_list, OID_AUTO,
- "max_drbr_queue_depth",
- CTLFLAG_RD, &fp->max_drbr_queue_depth,
- 0, "Driver queue maximum dpeth");
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "tx_frame_deferred",
+ CTLFLAG_RD, &fp->tx_frame_deferred,
+ "TX frame deferred from H/W queue to S/W queue count");
-#ifdef BXE_DEBUG
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
- "null_cqe_flags",
- CTLFLAG_RD, &fp->null_cqe_flags,
- "CQEs with NULL flags count");
-#endif
+ "tx_queue_xoff",
+ CTLFLAG_RD, &fp->tx_queue_xoff,
+ "TX queue full count");
+
+ /*
+ * Memory related fastpath statistics.*
+ */
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "mbuf_rx_bd_alloc_failed",
+ CTLFLAG_RD, &fp->mbuf_rx_bd_alloc_failed,
+ "RX BD mbuf allocation failure count");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "mbuf_rx_bd_mapping_failed",
+ CTLFLAG_RD, &fp->mbuf_rx_bd_mapping_failed,
+ "RX BD mbuf mapping failure count");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "mbuf_tpa_alloc_failed",
+ CTLFLAG_RD, &fp->mbuf_tpa_alloc_failed,
+ "TPA mbuf allocation failure count");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "mbuf_tpa_mapping_failed",
+ CTLFLAG_RD, &fp->mbuf_tpa_mapping_failed,
+ "TPA mbuf mapping failure count");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "mbuf_sge_alloc_failed",
+ CTLFLAG_RD, &fp->mbuf_sge_alloc_failed,
+ "SGE mbuf allocation failure count");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "mbuf_sge_mapping_failed",
+ CTLFLAG_RD, &fp->mbuf_sge_mapping_failed,
+ "SGE mbuf mapping failure count");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "mbuf_defrag_attempts",
+ CTLFLAG_RD, &fp->mbuf_defrag_attempts,
+ "Mbuf defrag attempt count");
+
+ SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO,
+ "mbuf_defrag_failures",
+ CTLFLAG_RD, &fp->mbuf_defrag_failures,
+ "Mbuf defrag failure count");
}
} while (0);
@@ -16560,13 +16010,13 @@ bxe_dump_debug_reg_wread(struct bxe_softc *sc, uint32_t *index)
pwreg_addrs = NULL;
/* Read different registers for different controllers. */
- if (CHIP_IS_E1H(sc)) {
- wregs_count = wregs_count_e1h;
- pwreg_addrs = &wreg_addrs_e1h[0];
- } else {
- wregs_count = wregs_count_e1;
- pwreg_addrs = &wreg_addrs_e1[0];
- }
+ if (CHIP_IS_E1H(sc)) {
+ wregs_count = wregs_count_e1h;
+ pwreg_addrs = &wreg_addrs_e1h[0];
+ } else {
+ wregs_count = wregs_count_e1;
+ pwreg_addrs = &wreg_addrs_e1[0];
+ }
for (reg_addrs_index = 0; reg_addrs_index < wregs_count;
reg_addrs_index++) {
@@ -16646,22 +16096,23 @@ bxe_grcdump(struct bxe_softc *sc, int log)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_validate_rx_packet(struct bxe_fastpath *fp, uint16_t comp_cons,
union eth_rx_cqe *cqe, struct mbuf *m)
{
struct bxe_softc *sc;
+ int error;
sc = fp->sc;
- /* Check that the mbuf is sane. */
- m_sanity(m, FALSE);
- /* Make sure the packet has a valid length. */
- if ((m->m_len < ETHER_HDR_LEN) |
- (m->m_len > ETH_MAX_JUMBO_PACKET_SIZE + ETH_OVREHEAD)) {
+ /* Check that the mbuf is sane. */
+ error = m_sanity(m, FALSE);
+ if (error != 1 || ((m->m_len < ETHER_HDR_LEN) |
+ (m->m_len > ETH_MAX_JUMBO_PACKET_SIZE + ETH_OVREHEAD))) {
m_print(m, 128);
bxe_dump_enet(sc, m);
bxe_dump_cqe(fp, comp_cons, cqe);
+ /* Make sure the packet has a valid length. */
}
}
@@ -16673,7 +16124,7 @@ void bxe_validate_rx_packet(struct bxe_fastpath *fp, uint16_t comp_cons,
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_enet(struct bxe_softc *sc, struct mbuf *m)
{
struct ether_vlan_header *eh;
@@ -16803,7 +16254,7 @@ bxe_dump_mbuf_data(struct mbuf *m, int len)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_mbuf(struct bxe_softc *sc, struct mbuf *m)
{
if (m == NULL) {
@@ -16868,17 +16319,19 @@ void bxe_dump_mbuf(struct bxe_softc *sc, struct mbuf *m)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_rxbd(struct bxe_fastpath *fp, int idx,
struct eth_rx_bd *rx_bd)
{
- struct bxe_softc *sc = fp->sc;
+ struct bxe_softc *sc;
+
+ sc = fp->sc;
/* Check if index out of range. */
if (idx > MAX_RX_BD) {
BXE_PRINTF("fp[%02d].rx_bd[0x%04X] XX: Invalid rx_bd index!\n",
fp->index, idx);
- } else if ((idx & RX_DESC_MASK) >= USABLE_RX_BD_PER_PAGE) {
+ } else if ((idx & RX_BD_PER_PAGE_MASK) >= USABLE_RX_BD_PER_PAGE) {
/* RX Chain page pointer. */
BXE_PRINTF("fp[%02d].rx_bd[0x%04X] NP: haddr=0x%08X:%08X\n",
fp->index, idx, rx_bd->addr_hi, rx_bd->addr_lo);
@@ -16894,11 +16347,13 @@ void bxe_dump_rxbd(struct bxe_fastpath *fp, int idx,
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_cqe(struct bxe_fastpath *fp, int idx,
union eth_rx_cqe *cqe)
{
- struct bxe_softc *sc = fp->sc;
+ struct bxe_softc *sc;
+
+ sc = fp->sc;
if (idx > MAX_RCQ_ENTRIES) {
/* Index out of range. */
@@ -16931,26 +16386,28 @@ void bxe_dump_cqe(struct bxe_fastpath *fp, int idx,
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_tx_parsing_bd(struct bxe_fastpath *fp, int idx,
struct eth_tx_parse_bd *p_bd)
{
- struct bxe_softc *sc = fp->sc;
-
- if (idx > MAX_TX_BD){
- /* Index out of range. */
- BXE_PRINTF("fp[%02d].tx_bd[0x%04X] XX: Invalid tx_bd index!\n",
- fp->index, idx);
- } else {
- BXE_PRINTF("fp[%02d]:tx_bd[0x%04X] PB: global_data=0x%b, "
- "tcp_flags=0x%b, ip_hlen=%04d, total_hlen=%04d, "
- "tcp_pseudo_csum=0x%04X, lso_mss=0x%04X, ip_id=0x%04X, "
- "tcp_send_seq=0x%08X\n", fp->index, idx,
- p_bd->global_data, BXE_ETH_TX_PARSE_BD_GLOBAL_DATA_PRINTFB,
- p_bd->tcp_flags, BXE_ETH_TX_PARSE_BD_TCP_FLAGS_PRINTFB,
- p_bd->ip_hlen, p_bd->total_hlen, p_bd->tcp_pseudo_csum,
- p_bd->lso_mss, p_bd->ip_id, p_bd->tcp_send_seq);
- }
+ struct bxe_softc *sc;
+
+ sc = fp->sc;
+
+ if (idx > MAX_TX_BD){
+ /* Index out of range. */
+ BXE_PRINTF("fp[%02d].tx_bd[0x%04X] XX: Invalid tx_bd index!\n",
+ fp->index, idx);
+ } else {
+ BXE_PRINTF("fp[%02d]:tx_bd[0x%04X] PB: global_data=0x%b, "
+ "tcp_flags=0x%b, ip_hlen=%04d, total_hlen=%04d, "
+ "tcp_pseudo_csum=0x%04X, lso_mss=0x%04X, ip_id=0x%04X, "
+ "tcp_send_seq=0x%08X\n", fp->index, idx,
+ p_bd->global_data, BXE_ETH_TX_PARSE_BD_GLOBAL_DATA_PRINTFB,
+ p_bd->tcp_flags, BXE_ETH_TX_PARSE_BD_TCP_FLAGS_PRINTFB,
+ p_bd->ip_hlen, p_bd->total_hlen, p_bd->tcp_pseudo_csum,
+ p_bd->lso_mss, p_bd->ip_id, p_bd->tcp_send_seq);
+ }
}
/*
@@ -16959,11 +16416,13 @@ void bxe_dump_tx_parsing_bd(struct bxe_fastpath *fp, int idx,
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_txbd(struct bxe_fastpath *fp, int idx,
union eth_tx_bd_types *tx_bd)
{
- struct bxe_softc *sc = fp->sc;
+ struct bxe_softc *sc;
+
+ sc = fp->sc;
if (idx > MAX_TX_BD){
/* Index out of range. */
@@ -17002,24 +16461,26 @@ void bxe_dump_txbd(struct bxe_fastpath *fp, int idx,
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_tx_chain(struct bxe_fastpath * fp, int tx_bd_prod, int count)
{
- struct bxe_softc *sc = fp->sc;
+ struct bxe_softc *sc;
union eth_tx_bd_types *tx_bd;
uint32_t val_hi, val_lo;
int i, parsing_bd = 0;
+ sc = fp->sc;
+
/* First some info about the tx_bd chain structure. */
BXE_PRINTF(
"----------------------------"
" tx_bd chain "
"----------------------------\n");
- val_hi = U64_HI(fp->tx_bd_chain_paddr);
- val_lo = U64_LO(fp->tx_bd_chain_paddr);
+ val_hi = U64_HI(fp->tx_dma.paddr);
+ val_lo = U64_LO(fp->tx_dma.paddr);
BXE_PRINTF(
- "0x%08X:%08X - (fp[%02d]->tx_bd_chain_paddr) TX Chain physical address\n",
+ "0x%08X:%08X - (fp[%02d]->tx_dma.paddr) TX Chain physical address\n",
val_hi, val_lo, fp->index);
BXE_PRINTF(
"page size = 0x%08X, tx chain pages = 0x%08X\n",
@@ -17037,12 +16498,11 @@ void bxe_dump_tx_chain(struct bxe_fastpath * fp, int tx_bd_prod, int count)
/* Now print out the tx_bd's themselves. */
for (i = 0; i < count; i++) {
- tx_bd =
- &fp->tx_bd_chain[TX_PAGE(tx_bd_prod)][TX_IDX(tx_bd_prod)];
+ tx_bd = &fp->tx_chain[tx_bd_prod];
if (parsing_bd) {
struct eth_tx_parse_bd *p_bd;
p_bd = (struct eth_tx_parse_bd *)
- &fp->tx_bd_chain[TX_PAGE(tx_bd_prod)][TX_IDX(tx_bd_prod)].parse_bd;
+ &fp->tx_chain[tx_bd_prod].parse_bd;
bxe_dump_tx_parsing_bd(fp, tx_bd_prod, p_bd);
parsing_bd = 0;
} else {
@@ -17071,23 +16531,23 @@ void bxe_dump_tx_chain(struct bxe_fastpath * fp, int tx_bd_prod, int count)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_rx_cq_chain(struct bxe_fastpath *fp, int rx_cq_prod, int count)
{
- struct bxe_softc *sc = fp->sc;
+ struct bxe_softc *sc;
union eth_rx_cqe *cqe;
int i;
+ sc = fp->sc;
+
/* First some info about the tx_bd chain structure. */
BXE_PRINTF(
"----------------------------"
" CQE Chain "
"----------------------------\n");
- for (i=0; i< NUM_RCQ_PAGES; i++) {
- BXE_PRINTF("fp[%02d]->rx_cq_chain_paddr[%d] = 0x%jX\n",
- fp->index, i, (uintmax_t) fp->rx_cq_chain_paddr[i]);
- }
+ BXE_PRINTF("fp[%02d]->rcq_dma.paddr = 0x%jX\n",
+ fp->index, (uintmax_t) fp->rcq_dma.paddr);
BXE_PRINTF("page size = 0x%08X, cq chain pages "
" = 0x%08X\n",
@@ -17107,9 +16567,10 @@ void bxe_dump_rx_cq_chain(struct bxe_fastpath *fp, int rx_cq_prod, int count)
"----------------------------\n");
for (i = 0; i < count; i++) {
- cqe = (union eth_rx_cqe *)&fp->rx_cq_chain
- [RCQ_PAGE(rx_cq_prod)][RCQ_IDX(rx_cq_prod)];
+ cqe = (union eth_rx_cqe *)&fp->rcq_chain[rx_cq_prod];
+
bxe_dump_cqe(fp, rx_cq_prod, cqe);
+
/* Don't skip next page pointers. */
rx_cq_prod = ((rx_cq_prod + 1) & MAX_RCQ_ENTRIES);
}
@@ -17126,8 +16587,8 @@ void bxe_dump_rx_cq_chain(struct bxe_fastpath *fp, int rx_cq_prod, int count)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
-void bxe_dump_rx_bd_chain(struct bxe_fastpath *fp, int rx_prod, int count)
+static __noinline
+void bxe_dump_rx_bd_chain(struct bxe_fastpath *fp, int prod, int count)
{
struct bxe_softc *sc;
struct eth_rx_bd *rx_bd;
@@ -17135,6 +16596,7 @@ void bxe_dump_rx_bd_chain(struct bxe_fastpath *fp, int rx_prod, int count)
int i;
sc = fp->sc;
+
/* First some info about the tx_bd chain structure. */
BXE_PRINTF(
"----------------------------"
@@ -17144,8 +16606,8 @@ void bxe_dump_rx_bd_chain(struct bxe_fastpath *fp, int rx_prod, int count)
BXE_PRINTF(
"----- RX_BD Chain -----\n");
- BXE_PRINTF("fp[%02d]->rx_cq_chain_paddr[0] = 0x%jX\n",
- fp->index, (uintmax_t) fp->rx_cq_chain_paddr[0]);
+ BXE_PRINTF("fp[%02d]->rx_dma.paddr = 0x%jX\n",
+ fp->index, (uintmax_t) fp->rx_dma.paddr);
BXE_PRINTF(
"page size = 0x%08X, rx chain pages = 0x%08X\n",
@@ -17166,15 +16628,14 @@ void bxe_dump_rx_bd_chain(struct bxe_fastpath *fp, int rx_prod, int count)
/* Now print out the rx_bd's themselves. */
for (i = 0; i < count; i++) {
- rx_bd = (struct eth_rx_bd *)
- (&fp->rx_bd_chain[RX_PAGE(rx_prod)][RX_IDX(rx_prod)]);
- m = sc->fp->rx_mbuf_ptr[rx_prod];
+ rx_bd = (struct eth_rx_bd *) (&fp->rx_chain[prod]);
+ m = sc->fp->rx_mbuf_ptr[prod];
- bxe_dump_rxbd(fp, rx_prod, rx_bd);
+ bxe_dump_rxbd(fp, prod, rx_bd);
bxe_dump_mbuf(sc, m);
/* Don't skip next page pointers. */
- rx_prod = ((rx_prod + 1) & MAX_RX_BD);
+ prod = ((prod + 1) & MAX_RX_BD);
}
BXE_PRINTF(
@@ -17189,7 +16650,7 @@ void bxe_dump_rx_bd_chain(struct bxe_fastpath *fp, int rx_prod, int count)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_hw_state(struct bxe_softc *sc)
{
int i;
@@ -17216,7 +16677,7 @@ void bxe_dump_hw_state(struct bxe_softc *sc)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_rx_mbuf_chain(struct bxe_softc *sc, int chain_prod, int count)
{
struct mbuf *m;
@@ -17246,7 +16707,7 @@ void bxe_dump_rx_mbuf_chain(struct bxe_softc *sc, int chain_prod, int count)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_tx_mbuf_chain(struct bxe_softc *sc, int chain_prod, int count)
{
struct mbuf *m;
@@ -17276,15 +16737,15 @@ void bxe_dump_tx_mbuf_chain(struct bxe_softc *sc, int chain_prod, int count)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_status_block(struct bxe_softc *sc)
{
struct bxe_fastpath *fp;
- struct host_def_status_block *dsb;
+ struct host_def_status_block *def_sb;
struct host_status_block *fpsb;
int i;
- dsb = sc->def_status_block;
+ def_sb = sc->def_sb;
BXE_PRINTF(
"----------------------------"
" Status Block "
@@ -17359,92 +16820,92 @@ void bxe_dump_status_block(struct bxe_softc *sc)
/* Print attention information. */
BXE_PRINTF(
" 0x%02X - Status Block ID\n",
- dsb->atten_status_block.status_block_id);
+ def_sb->atten_status_block.status_block_id);
BXE_PRINTF(
"0x%08X - Attn Bits\n",
- dsb->atten_status_block.attn_bits);
+ def_sb->atten_status_block.attn_bits);
BXE_PRINTF(
"0x%08X - Attn Bits Ack\n",
- dsb->atten_status_block.attn_bits_ack);
+ def_sb->atten_status_block.attn_bits_ack);
BXE_PRINTF(
" 0x%04X - Attn Block Index\n",
- le16toh(dsb->atten_status_block.attn_bits_index));
+ le16toh(def_sb->atten_status_block.attn_bits_index));
/* Print the USTORM fields (HC_USTORM_DEF_SB_NUM_INDICES). */
BXE_PRINTF(
" 0x%02X - USTORM Status Block ID\n",
- dsb->u_def_status_block.status_block_id);
+ def_sb->u_def_status_block.status_block_id);
BXE_PRINTF(
" 0x%04X - USTORM Status Block Index\n",
- le16toh(dsb->u_def_status_block.status_block_index));
+ le16toh(def_sb->u_def_status_block.status_block_index));
BXE_PRINTF(
" 0x%04X - USTORM [ETH_RDMA_RX_CQ_CONS]\n",
- le16toh(dsb->u_def_status_block.index_values[HC_INDEX_DEF_U_ETH_RDMA_RX_CQ_CONS]));
+ le16toh(def_sb->u_def_status_block.index_values[HC_INDEX_DEF_U_ETH_RDMA_RX_CQ_CONS]));
BXE_PRINTF(
" 0x%04X - USTORM [ETH_ISCSI_RX_CQ_CONS]\n",
- le16toh(dsb->u_def_status_block.index_values[HC_INDEX_DEF_U_ETH_ISCSI_RX_CQ_CONS]));
+ le16toh(def_sb->u_def_status_block.index_values[HC_INDEX_DEF_U_ETH_ISCSI_RX_CQ_CONS]));
BXE_PRINTF(
" 0x%04X - USTORM [ETH_RDMA_RX_BD_CONS]\n",
- le16toh(dsb->u_def_status_block.index_values[HC_INDEX_DEF_U_ETH_RDMA_RX_BD_CONS]));
+ le16toh(def_sb->u_def_status_block.index_values[HC_INDEX_DEF_U_ETH_RDMA_RX_BD_CONS]));
BXE_PRINTF(
" 0x%04X - USTORM [ETH_ISCSI_RX_BD_CONS]\n",
- le16toh(dsb->u_def_status_block.index_values[HC_INDEX_DEF_U_ETH_ISCSI_RX_BD_CONS]));
+ le16toh(def_sb->u_def_status_block.index_values[HC_INDEX_DEF_U_ETH_ISCSI_RX_BD_CONS]));
/* Print the CSTORM fields (HC_CSTORM_DEF_SB_NUM_INDICES). */
BXE_PRINTF(
" 0x%02X - CSTORM Status Block ID\n",
- dsb->c_def_status_block.status_block_id);
+ def_sb->c_def_status_block.status_block_id);
BXE_PRINTF(
" 0x%04X - CSTORM Status Block Index\n",
- le16toh(dsb->c_def_status_block.status_block_index));
+ le16toh(def_sb->c_def_status_block.status_block_index));
BXE_PRINTF(
" 0x%04X - CSTORM [RDMA_EQ_CONS]\n",
- le16toh(dsb->c_def_status_block.index_values[HC_INDEX_DEF_C_RDMA_EQ_CONS]));
+ le16toh(def_sb->c_def_status_block.index_values[HC_INDEX_DEF_C_RDMA_EQ_CONS]));
BXE_PRINTF(
" 0x%04X - CSTORM [RDMA_NAL_PROD]\n",
- le16toh(dsb->c_def_status_block.index_values[HC_INDEX_DEF_C_RDMA_NAL_PROD]));
+ le16toh(def_sb->c_def_status_block.index_values[HC_INDEX_DEF_C_RDMA_NAL_PROD]));
BXE_PRINTF(
" 0x%04X - CSTORM [ETH_FW_TX_CQ_CONS]\n",
- le16toh(dsb->c_def_status_block.index_values[HC_INDEX_DEF_C_ETH_FW_TX_CQ_CONS]));
+ le16toh(def_sb->c_def_status_block.index_values[HC_INDEX_DEF_C_ETH_FW_TX_CQ_CONS]));
BXE_PRINTF(
" 0x%04X - CSTORM [ETH_SLOW_PATH]\n",
- le16toh(dsb->c_def_status_block.index_values[HC_INDEX_DEF_C_ETH_SLOW_PATH]));
+ le16toh(def_sb->c_def_status_block.index_values[HC_INDEX_DEF_C_ETH_SLOW_PATH]));
BXE_PRINTF(
" 0x%04X - CSTORM [ETH_RDMA_CQ_CONS]\n",
- le16toh(dsb->c_def_status_block.index_values[HC_INDEX_DEF_C_ETH_RDMA_CQ_CONS]));
+ le16toh(def_sb->c_def_status_block.index_values[HC_INDEX_DEF_C_ETH_RDMA_CQ_CONS]));
BXE_PRINTF(
" 0x%04X - CSTORM [ETH_ISCSI_CQ_CONS]\n",
- le16toh(dsb->c_def_status_block.index_values[HC_INDEX_DEF_C_ETH_ISCSI_CQ_CONS]));
+ le16toh(def_sb->c_def_status_block.index_values[HC_INDEX_DEF_C_ETH_ISCSI_CQ_CONS]));
BXE_PRINTF(
" 0x%04X - CSTORM [UNUSED]\n",
- le16toh(dsb->c_def_status_block.index_values[6]));
+ le16toh(def_sb->c_def_status_block.index_values[6]));
BXE_PRINTF(
" 0x%04X - CSTORM [UNUSED]\n",
- le16toh(dsb->c_def_status_block.index_values[7]));
+ le16toh(def_sb->c_def_status_block.index_values[7]));
/* Print the TSTORM fields (HC_TSTORM_DEF_SB_NUM_INDICES). */
BXE_PRINTF(
" 0x%02X - TSTORM Status Block ID\n",
- dsb->t_def_status_block.status_block_id);
+ def_sb->t_def_status_block.status_block_id);
BXE_PRINTF(
" 0x%04X - TSTORM Status Block Index\n",
- le16toh(dsb->t_def_status_block.status_block_index));
+ le16toh(def_sb->t_def_status_block.status_block_index));
for (i = 0; i < HC_TSTORM_DEF_SB_NUM_INDICES; i++)
BXE_PRINTF(
" 0x%04X - TSTORM [UNUSED]\n",
- le16toh(dsb->t_def_status_block.index_values[i]));
+ le16toh(def_sb->t_def_status_block.index_values[i]));
/* Print the XSTORM fields (HC_XSTORM_DEF_SB_NUM_INDICES). */
BXE_PRINTF(
" 0x%02X - XSTORM Status Block ID\n",
- dsb->x_def_status_block.status_block_id);
+ def_sb->x_def_status_block.status_block_id);
BXE_PRINTF(
" 0x%04X - XSTORM Status Block Index\n",
- le16toh(dsb->x_def_status_block.status_block_index));
+ le16toh(def_sb->x_def_status_block.status_block_index));
for (i = 0; i < HC_XSTORM_DEF_SB_NUM_INDICES; i++)
BXE_PRINTF(
" 0x%04X - XSTORM [UNUSED]\n",
- le16toh(dsb->x_def_status_block.index_values[i]));
+ le16toh(def_sb->x_def_status_block.index_values[i]));
BXE_PRINTF(
"----------------------------"
@@ -17459,7 +16920,7 @@ void bxe_dump_status_block(struct bxe_softc *sc)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_stats_block(struct bxe_softc *sc)
{
@@ -17471,7 +16932,7 @@ void bxe_dump_stats_block(struct bxe_softc *sc)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_fp_state(struct bxe_fastpath *fp)
{
struct bxe_softc *sc;
@@ -17501,9 +16962,6 @@ void bxe_dump_fp_state(struct bxe_fastpath *fp)
/* Receive state. */
BXE_PRINTF(
- " 0x%04X - (fp[%02d]->free_rx_bd)\n",
- fp->free_rx_bd, fp->index);
- BXE_PRINTF(
" 0x%04X - (fp[%02d]->rx_bd_prod)\n",
fp->rx_bd_prod, fp->index);
BXE_PRINTF(
@@ -17525,13 +16983,13 @@ void bxe_dump_fp_state(struct bxe_fastpath *fp)
" %16lu - (fp[%02d]->ipackets)\n",
fp->ipackets, fp->index);
BXE_PRINTF(
- " %16lu - (fp[%02d]->soft_rx_errors)\n",
- fp->soft_rx_errors, fp->index);
+ " %16lu - (fp[%02d]->rx_soft_errors)\n",
+ fp->rx_soft_errors, fp->index);
/* Transmit state. */
BXE_PRINTF(
- " 0x%04X - (fp[%02d]->used_tx_bd)\n",
- fp->used_tx_bd, fp->index);
+ " 0x%04X - (fp[%02d]->tx_bd_used)\n",
+ fp->tx_bd_used, fp->index);
BXE_PRINTF(
" 0x%04X - (fp[%02d]->tx_bd_prod)\n",
fp->tx_bd_prod, fp->index);
@@ -17554,14 +17012,14 @@ void bxe_dump_fp_state(struct bxe_fastpath *fp)
" %16lu - (fp[%02d]->opackets)\n",
fp->opackets, fp->index);
BXE_PRINTF(
- " %16lu - (fp[%02d]->soft_tx_errors)\n",
- fp->soft_tx_errors, fp->index);
+ " %16lu - (fp[%02d]->tx_soft_errors)\n",
+ fp->tx_soft_errors, fp->index);
/* TPA state. */
if (TPA_ENABLED(sc)) {
BXE_PRINTF(
- " %16lu - (fp[%02d]->tpa_pkts)\n",
- fp->tpa_pkts, fp->index);
+ " %16lu - (fp[%02d]->rx_tpa_pkts)\n",
+ fp->rx_tpa_pkts, fp->index);
BXE_PRINTF(
" 0x%08X - (fp[%02d]->tpa_mbuf_alloc)\n",
fp->tpa_mbuf_alloc, fp->index);
@@ -17592,7 +17050,7 @@ void bxe_dump_fp_state(struct bxe_fastpath *fp)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_port_state_locked(struct bxe_softc *sc)
{
@@ -17622,7 +17080,7 @@ void bxe_dump_port_state_locked(struct bxe_softc *sc)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_link_vars_state_locked(struct bxe_softc *sc)
{
BXE_PRINTF(
@@ -17685,7 +17143,7 @@ void bxe_dump_link_vars_state_locked(struct bxe_softc *sc)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_link_params_state_locked(struct bxe_softc *sc)
{
BXE_PRINTF(
@@ -17739,7 +17197,7 @@ void bxe_dump_link_params_state_locked(struct bxe_softc *sc)
* Returns:
* Nothing.
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_driver_state(struct bxe_softc *sc)
{
uint32_t val_hi, val_lo;
@@ -17773,12 +17231,10 @@ void bxe_dump_driver_state(struct bxe_softc *sc)
sc->rx_lane_swap);
BXE_PRINTF(" 0x%08X - (sc->tx_lane_swap) TX XAUI lane swap\n",
sc->tx_lane_swap);
- BXE_PRINTF(" %16lu - (sc->debug_mbuf_sim_alloc_failed)\n",
- sc->debug_mbuf_sim_alloc_failed);
- BXE_PRINTF(" %16lu - (sc->debug_mbuf_sim_map_failed)\n",
- sc->debug_mbuf_sim_map_failed);
- BXE_PRINTF(" %16lu - (sc->debug_memory_allocated)\n",
- sc->debug_memory_allocated);
+ BXE_PRINTF(" %16lu - (sc->debug_sim_mbuf_alloc_failed)\n",
+ sc->debug_sim_mbuf_alloc_failed);
+ BXE_PRINTF(" %16lu - (sc->debug_sim_mbuf_map_failed)\n",
+ sc->debug_sim_mbuf_map_failed);
BXE_PRINTF(
"----------------------------"
@@ -17791,44 +17247,39 @@ void bxe_dump_driver_state(struct bxe_softc *sc)
}
/*
- * Dump bootcode debug buffer to the console.
+ * Dump bootcode (MCP) debug buffer to the console.
*
* Returns:
* None
*/
-static __attribute__ ((noinline))
+static __noinline
void bxe_dump_fw(struct bxe_softc *sc)
{
- uint32_t data[9], mark, offset;
- int word;
+ uint32_t addr, mark, data[9], offset;
+ int word;
- mark = REG_RD(sc, MCP_REG_MCPR_SCRATCH + 0xf104);
- mark = ((mark + 0x3) & ~0x3);
+ addr = sc->common.shmem_base - 0x0800 + 4;
+ mark = REG_RD(sc, addr);
+ mark = MCP_REG_MCPR_SCRATCH + ((mark + 0x3) & ~0x3) - 0x08000000;
BXE_PRINTF(
- "----------------------------"
- " Bootcode State "
- "----------------------------\n");
- BXE_PRINTF("Begin MCP bootcode dump (mark = 0x%08X)\n", mark);
- BXE_PRINTF(
- "----------------------------"
- "----------------"
- "----------------------------\n");
+ "---------------------------"
+ " MCP Debug Buffer "
+ "---------------------------\n");
- for (offset = mark - 0x08000000; offset <= 0xF900;
+ /* Read from "mark" to the end of the buffer. */
+ for (offset = mark; offset <= sc->common.shmem_base;
offset += (0x8 * 4)) {
for (word = 0; word < 8; word++)
- data[word] = htonl(REG_RD(sc, MCP_REG_MCPR_SCRATCH +
- offset + 4 * word));
+ data[word] = htonl(REG_RD(sc, offset + 4 * word));
data[8] = 0x0;
printf("%s", (char *) data);
}
- for (offset = 0xF108; offset <= mark - 0x08000000;
- offset += (0x8 * 4)) {
+ /* Read from the start of the buffer to "mark". */
+ for (offset = addr + 4; offset <= mark; offset += (0x8 * 4)) {
for (word = 0; word < 8; word++)
- data[word] = htonl(REG_RD(sc, MCP_REG_MCPR_SCRATCH +
- offset + 4 * word));
+ data[word] = htonl(REG_RD(sc, offset + 4 * word));
data[8] = 0x0;
printf("%s", (char *) data);
}
@@ -18129,26 +17580,9 @@ bxe_breakpoint(struct bxe_softc *sc)
bxe_dump_fp_state(&sc->fp[i]);
bxe_dump_status_block(sc);
+ bxe_dump_fw(sc);
/* Call the OS debugger. */
breakpoint();
}
#endif
-
-/*
- *
- * Returns:
- * Nothing.
- */
-static void
-bxe_gunzip_end(struct bxe_softc *sc)
-{
- free(sc->strm, M_DEVBUF);
- sc->strm = NULL;
-
- if (sc->gunzip_buf) {
- bxe_dmamem_free(sc, sc->gunzip_tag, sc->gunzip_buf,
- sc->gunzip_map);
- sc->gunzip_buf = NULL;
- }
-}
diff --git a/sys/dev/bxe/if_bxe.h b/sys/dev/bxe/if_bxe.h
index 8da3db4..a5af0bd 100644
--- a/sys/dev/bxe/if_bxe.h
+++ b/sys/dev/bxe/if_bxe.h
@@ -251,20 +251,22 @@ struct bxe_type {
#define SGE_PAGE_SHIFT PAGE_SHIFT
#define SGE_PAGE_ALIGN(addr) PAGE_ALIGN(addr)
-/* SGE ring related macros */
+/* NUM_RX_SGE_PAGES must be a power of 2. */
#define NUM_RX_SGE_PAGES 2
-#define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge))
-#define MAX_RX_SGE_CNT (RX_SGE_CNT - 2)
+#define TOTAL_RX_SGE_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) /* 512 */
+#define USABLE_RX_SGE_PER_PAGE (TOTAL_RX_SGE_PER_PAGE - 2) /* 510 */
+#define RX_SGE_PER_PAGE_MASK (TOTAL_RX_SGE_PER_PAGE - 1) /* 511 */
+#define TOTAL_RX_SGE (TOTAL_RX_SGE_PER_PAGE * NUM_RX_SGE_PAGES) /* 1024 */
+#define USABLE_RX_SGE (USABLE_RX_SGE_PER_PAGE * NUM_RX_SGE_PAGES) /* 1020 */
+#define MAX_RX_SGE (TOTAL_RX_SGE - 1) /* 1023 */
+
-/* RX_SGE_CNT is required to be a power of 2 */
-#define RX_SGE_MASK (RX_SGE_CNT - 1)
-#define TOTAL_RX_SGE (RX_SGE_CNT * NUM_RX_SGE_PAGES)
-#define MAX_RX_SGE (TOTAL_RX_SGE - 1)
#define NEXT_SGE_IDX(x) \
- ((((x) & RX_SGE_MASK) == (MAX_RX_SGE_CNT - 1)) ? (x) + 3 : (x) + 1)
+ ((((x) & RX_SGE_PER_PAGE_MASK) == (USABLE_RX_SGE_PER_PAGE - 1)) \
+ ? (x) + 3 : (x) + 1)
#define RX_SGE(x) ((x) & MAX_RX_SGE)
-#define RX_SGE_PAGE(x) (((x) & ~RX_SGE_MASK) >> 9)
-#define RX_SGE_IDX(x) ((x) & RX_SGE_MASK)
+#define RX_SGE_PAGE(x) (((x) & ~RX_SGE_PER_PAGE_MASK) >> 9)
+#define RX_SGE_IDX(x) ((x) & RX_SGE_PER_PAGE_MASK)
/* SGE producer mask related macros. */
/* Number of bits in one sge_mask array element. */
@@ -282,23 +284,23 @@ struct bxe_type {
/* Number of uint64_t elements in SGE mask array. */
#define RX_SGE_MASK_LEN \
- ((NUM_RX_SGE_PAGES * RX_SGE_CNT) / RX_SGE_MASK_ELEM_SZ)
+ ((NUM_RX_SGE_PAGES * TOTAL_RX_SGE_PER_PAGE) / RX_SGE_MASK_ELEM_SZ)
#define RX_SGE_MASK_LEN_MASK (RX_SGE_MASK_LEN - 1)
#define NEXT_SGE_MASK_ELEM(el) (((el) + 1) & RX_SGE_MASK_LEN_MASK)
+
/*
* Transmit Buffer Descriptor (tx_bd) definitions*
*/
-/* ToDo: Tune this value based on multi-queue/RSS enable/disable. */
-#define NUM_TX_PAGES 2
+/* NUM_TX_PAGES must be a power of 2. */
+#define NUM_TX_PAGES 1
+#define TOTAL_TX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(union eth_tx_bd_types)) /* 256 */
+#define USABLE_TX_BD_PER_PAGE (TOTAL_TX_BD_PER_PAGE - 1) /* 255 */
+#define TOTAL_TX_BD (TOTAL_TX_BD_PER_PAGE * NUM_TX_PAGES) /* 512 */
+#define USABLE_TX_BD (USABLE_TX_BD_PER_PAGE * NUM_TX_PAGES) /* 510 */
+#define MAX_TX_BD (TOTAL_TX_BD - 1) /* 511 */
-#define TOTAL_TX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(union eth_tx_bd_types))
-#define USABLE_TX_BD_PER_PAGE (TOTAL_TX_BD_PER_PAGE - 1)
-#define TOTAL_TX_BD (TOTAL_TX_BD_PER_PAGE * NUM_TX_PAGES)
-#define USABLE_TX_BD (USABLE_TX_BD_PER_PAGE * NUM_TX_PAGES)
-#define MAX_TX_AVAIL (USABLE_TX_BD_PER_PAGE * NUM_TX_PAGES - 2)
-#define MAX_TX_BD (TOTAL_TX_BD - 1)
#define NEXT_TX_BD(x) \
((((x) & USABLE_TX_BD_PER_PAGE) == \
(USABLE_TX_BD_PER_PAGE - 1)) ? (x) + 2 : (x) + 1)
@@ -309,55 +311,33 @@ struct bxe_type {
/*
* Receive Buffer Descriptor (rx_bd) definitions*
*/
-#define NUM_RX_PAGES 2
-
-/* 512 (0x200) of 8 byte bds in 4096 byte page. */
-#define TOTAL_RX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd))
-
-/* 510 (0x1fe) = 512 - 2 */
-#define USABLE_RX_BD_PER_PAGE (TOTAL_RX_BD_PER_PAGE - 2)
-
-/* 1024 (0x400) */
-#define TOTAL_RX_BD (TOTAL_RX_BD_PER_PAGE * NUM_RX_PAGES)
-/* 1020 (0x3fc) = 1024 - 4 */
-#define USABLE_RX_BD (USABLE_RX_BD_PER_PAGE * NUM_RX_PAGES)
-
-/* 1023 (0x3ff) = 1024 -1 */
-#define MAX_RX_BD (TOTAL_RX_BD - 1)
-
-/* 511 (0x1ff) = 512 - 1 */
-#define RX_DESC_MASK (TOTAL_RX_BD_PER_PAGE - 1)
+/* NUM_RX_PAGES must be a power of 2. */
+#define NUM_RX_PAGES 1
+#define TOTAL_RX_BD_PER_PAGE (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd)) /* 512 */
+#define USABLE_RX_BD_PER_PAGE (TOTAL_RX_BD_PER_PAGE - 2) /* 510 */
+#define RX_BD_PER_PAGE_MASK (TOTAL_RX_BD_PER_PAGE - 1) /* 511 */
+#define TOTAL_RX_BD (TOTAL_RX_BD_PER_PAGE * NUM_RX_PAGES) /* 1024 */
+#define USABLE_RX_BD (USABLE_RX_BD_PER_PAGE * NUM_RX_PAGES) /* 1020 */
+#define MAX_RX_BD (TOTAL_RX_BD - 1) /* 1023 */
#define NEXT_RX_BD(x) \
- ((((x) & RX_DESC_MASK) == \
+ ((((x) & RX_BD_PER_PAGE_MASK) == \
(USABLE_RX_BD_PER_PAGE - 1)) ? (x) + 3 : (x) + 1)
/* x & 0x3ff */
#define RX_BD(x) ((x) & MAX_RX_BD)
-#define RX_PAGE(x) (((x) & ~RX_DESC_MASK) >> 9)
-#define RX_IDX(x) ((x) & RX_DESC_MASK)
+#define RX_PAGE(x) (((x) & ~RX_BD_PER_PAGE_MASK) >> 9)
+#define RX_IDX(x) ((x) & RX_BD_PER_PAGE_MASK)
/*
* Receive Completion Queue definitions*
*/
-
-/* CQEs (32 bytes) are 4 times larger than rx_bd's (8 bytes). */
#define NUM_RCQ_PAGES (NUM_RX_PAGES * 4)
-
-/* 128 (0x80) */
-#define TOTAL_RCQ_ENTRIES_PER_PAGE (BCM_PAGE_SIZE / sizeof(union eth_rx_cqe))
-
-/* 127 (0x7f)for the next page RCQ bd */
-#define USABLE_RCQ_ENTRIES_PER_PAGE (TOTAL_RCQ_ENTRIES_PER_PAGE - 1)
-
-/* 1024 (0x400) */
-#define TOTAL_RCQ_ENTRIES (TOTAL_RCQ_ENTRIES_PER_PAGE * NUM_RCQ_PAGES)
-
-/* 1016 (0x3f8) */
-#define USABLE_RCQ_ENTRIES (USABLE_RCQ_ENTRIES_PER_PAGE * NUM_RCQ_PAGES)
-
-/* 1023 (0x3ff) */
-#define MAX_RCQ_ENTRIES (TOTAL_RCQ_ENTRIES - 1)
+#define TOTAL_RCQ_ENTRIES_PER_PAGE (BCM_PAGE_SIZE / sizeof(union eth_rx_cqe)) /* 128 */
+#define USABLE_RCQ_ENTRIES_PER_PAGE (TOTAL_RCQ_ENTRIES_PER_PAGE - 1) /* 127 */
+#define TOTAL_RCQ_ENTRIES (TOTAL_RCQ_ENTRIES_PER_PAGE * NUM_RCQ_PAGES) /* 1024 */
+#define USABLE_RCQ_ENTRIES (USABLE_RCQ_ENTRIES_PER_PAGE * NUM_RCQ_PAGES) /* 1016 */
+#define MAX_RCQ_ENTRIES (TOTAL_RCQ_ENTRIES - 1) /* 1023 */
#define NEXT_RCQ_IDX(x) \
((((x) & USABLE_RCQ_ENTRIES_PER_PAGE) == \
@@ -383,11 +363,11 @@ struct bxe_type {
} while (0)
#define SGE_MASK_SET_BIT(fp, idx) \
- __SGE_MASK_SET_BIT(fp->sge_mask[(idx) >> RX_SGE_MASK_ELEM_SHIFT], \
+ __SGE_MASK_SET_BIT(fp->rx_sge_mask[(idx) >> RX_SGE_MASK_ELEM_SHIFT], \
((idx) & RX_SGE_MASK_ELEM_MASK))
#define SGE_MASK_CLEAR_BIT(fp, idx) \
- __SGE_MASK_CLEAR_BIT(fp->sge_mask[(idx) >> RX_SGE_MASK_ELEM_SHIFT], \
+ __SGE_MASK_CLEAR_BIT(fp->rx_sge_mask[(idx) >> RX_SGE_MASK_ELEM_SHIFT], \
((idx) & RX_SGE_MASK_ELEM_MASK))
#define BXE_TX_TIMEOUT 5
@@ -418,14 +398,14 @@ struct bxe_type {
* IFCAP_TSO6, IFCAP_WOL_UCAST.
*/
#if __FreeBSD_version < 700000
-#define BXE_IF_CAPABILITIES \
+#define BXE_IF_CAPABILITIES \
(IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | IFCAP_HWCSUM | \
IFCAP_JUMBO_MTU)
#else
- /* TSO was introduced in FreeBSD 7 */
-#define BXE_IF_CAPABILITIES \
+ /* TSO/LRO was introduced in FreeBSD 7 */
+#define BXE_IF_CAPABILITIES \
(IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | IFCAP_HWCSUM | \
- IFCAP_JUMBO_MTU | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM)
+ IFCAP_JUMBO_MTU | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM | IFCAP_LRO)
#endif
/* Some typical Ethernet frame sizes */
@@ -449,6 +429,10 @@ struct bxe_type {
/* Resolution of the rate shaping timer - 100 usec */
#define RS_PERIODIC_TIMEOUT_USEC 100
+#define BXE_MBUF_ALLOC_RETRY_COUNT 10
+#define BXE_MBUF_MAPPING_RETRY_COUNT 10
+#define BXE_MBUF_RETRY_DELAY 100
+
/*
* Resolution of fairness algorithm, in usecs.
* Coefficient for calculating the actual t_fair.
@@ -546,7 +530,8 @@ enum bxe_stats_state {
STATS_STATE_MAX
};
-struct bxe_eth_stats {
+/* Statistics for an Ethernet port. */
+struct bxe_port_stats {
uint32_t total_bytes_received_hi;
uint32_t total_bytes_received_lo;
uint32_t total_bytes_transmitted_hi;
@@ -567,6 +552,12 @@ struct bxe_eth_stats {
uint32_t valid_bytes_received_lo;
uint32_t error_bytes_received_hi;
uint32_t error_bytes_received_lo;
+ uint32_t etherstatsoverrsizepkts_hi;
+ uint32_t etherstatsoverrsizepkts_lo;
+ uint32_t no_buff_discard_hi;
+ uint32_t no_buff_discard_lo;
+
+ /* Layout must match struct mac_stx. */
uint32_t rx_stat_ifhcinbadoctets_hi;
uint32_t rx_stat_ifhcinbadoctets_lo;
uint32_t tx_stat_ifhcoutbadoctets_hi;
@@ -643,39 +634,33 @@ struct bxe_eth_stats {
uint32_t tx_stat_dot3statsinternalmactransmiterrors_lo;
uint32_t tx_stat_bmac_ufl_hi;
uint32_t tx_stat_bmac_ufl_lo;
- uint32_t brb_drop_hi;
- uint32_t brb_drop_lo;
- uint32_t brb_truncate_hi;
- uint32_t brb_truncate_lo;
+ /* End of mac_stx. */
+
uint32_t pause_frames_received_hi;
uint32_t pause_frames_received_lo;
uint32_t pause_frames_sent_hi;
uint32_t pause_frames_sent_lo;
- uint32_t jabber_packets_received;
-
uint32_t etherstatspkts1024octetsto1522octets_hi;
uint32_t etherstatspkts1024octetsto1522octets_lo;
uint32_t etherstatspktsover1522octets_hi;
uint32_t etherstatspktsover1522octets_lo;
-
- uint32_t no_buff_discard_hi;
- uint32_t no_buff_discard_lo;
-
+ uint32_t brb_drop_hi;
+ uint32_t brb_drop_lo;
+ uint32_t brb_truncate_hi;
+ uint32_t brb_truncate_lo;
uint32_t mac_filter_discard;
uint32_t xxoverflow_discard;
uint32_t brb_truncate_discard;
uint32_t mac_discard;
-
uint32_t driver_xoff;
uint32_t rx_err_discard_pkt;
uint32_t rx_skb_alloc_failed;
uint32_t hw_csum_err;
-
uint32_t nig_timer_max;
};
#define STATS_OFFSET32(stat_name) \
- (offsetof(struct bxe_eth_stats, stat_name) / 4)
+ (offsetof(struct bxe_port_stats, stat_name) / 4)
#define MAX_CONTEXT 16
@@ -841,6 +826,18 @@ struct bxe_port {
#define PMF_DMAE_C(sc) \
(BP_PORT(sc) * MAX_DMAE_C_PER_PORT + E1HVN_MAX)
+
+/* Used to manage DMA allocations. */
+struct bxe_dma {
+ bus_addr_t paddr;
+ void *vaddr;
+ bus_dma_tag_t tag;
+ bus_dmamap_t map;
+ bus_dma_segment_t seg;
+ bus_size_t size;
+ int nseg;
+};
+
/*
* This is the slowpath data structure. It is mapped into non-paged memory
* so that the hardware can access it's contents directly and must be page
@@ -884,7 +881,7 @@ struct bxe_slowpath {
#define BXE_SP(sc, var) (&sc->slowpath->var)
#define BXE_SP_CHECK(sc, var) ((sc->slowpath) ? (&sc->slowpath->var) : NULL)
#define BXE_SP_MAPPING(sc, var) \
- (sc->slowpath_paddr + offsetof(struct bxe_slowpath, var))
+ (sc->slowpath_dma.paddr + offsetof(struct bxe_slowpath, var))
union db_prod {
struct doorbell_set_prod data;
@@ -933,51 +930,33 @@ struct bxe_fastpath {
struct mtx mtx;
char mtx_name[16];
- /* Hardware maintained status block. */
- bus_dma_tag_t status_block_tag;
- bus_dmamap_t status_block_map;
+ /* Status block. */
+ struct bxe_dma sb_dma;
struct host_status_block *status_block;
- bus_addr_t status_block_paddr;
-#ifdef notyet
- /*
- * In this implementation the doorbell data block
- * (eth_tx_db_data) is mapped into memory immediately
- * following the status block and is part of the same
- * memory allocation.
- */
- struct eth_tx_db_data *hw_tx_prods;
- bus_addr_t tx_prods_paddr;
-#endif
- /* Hardware maintained TX buffer descriptor chains. */
- bus_dma_tag_t tx_bd_chain_tag;
- bus_dmamap_t tx_bd_chain_map[NUM_TX_PAGES];
+ /* Transmit chain. */
+ struct bxe_dma tx_dma;
+ union eth_tx_bd_types *tx_chain;
+
+ /* Receive chain. */
+ struct bxe_dma rx_dma;
+ struct eth_rx_bd *rx_chain;
- union eth_tx_bd_types *tx_bd_chain[NUM_TX_PAGES];
- bus_addr_t tx_bd_chain_paddr[NUM_TX_PAGES];
+ /* Receive completion queue chain. */
+ struct bxe_dma rcq_dma;
+ union eth_rx_cqe *rcq_chain;
- /* Bus resource tag for TX mbufs. */
+ /* Bus resource tag, map, and mbufs for TX chain. */
bus_dma_tag_t tx_mbuf_tag;
bus_dmamap_t tx_mbuf_map[TOTAL_TX_BD];
struct mbuf *tx_mbuf_ptr[TOTAL_TX_BD];
- /* Hardware maintained RX buffer descriptor chains. */
- bus_dma_tag_t rx_bd_chain_tag;
- bus_dmamap_t rx_bd_chain_map[NUM_RX_PAGES];
- struct eth_rx_bd *rx_bd_chain[NUM_RX_PAGES];
- bus_addr_t rx_bd_chain_paddr[NUM_RX_PAGES];
-
- /* Bus resource tag for RX mbufs. */
+ /* Bus resource tag, map, and mbufs for RX chain. */
bus_dma_tag_t rx_mbuf_tag;
bus_dmamap_t rx_mbuf_map[TOTAL_RX_BD];
+ bus_dmamap_t rx_mbuf_spare_map;
struct mbuf *rx_mbuf_ptr[TOTAL_RX_BD];
- /* Hardware maintained Completion Queue (CQ) chains. */
- bus_dma_tag_t rx_cq_chain_tag;
- bus_dmamap_t rx_cq_chain_map[NUM_RCQ_PAGES];
- union eth_rx_cqe *rx_cq_chain[NUM_RCQ_PAGES];
- bus_addr_t rx_cq_chain_paddr[NUM_RCQ_PAGES];
-
/* Ticks until chip reset. */
int watchdog_timer;
@@ -1014,8 +993,6 @@ struct bxe_fastpath {
/* Transmit packet producer index (used in eth_tx_bd). */
uint16_t tx_pkt_prod;
-
- /* Transmit packet consumer index. */
uint16_t tx_pkt_cons;
/* Transmit buffer descriptor prod/cons indices. */
@@ -1044,25 +1021,27 @@ struct bxe_fastpath {
uint16_t *rx_bd_cons_sb;
/* Pointer to the transmit consumer in the status block. */
- uint16_t *tx_cons_sb;
+ uint16_t *tx_pkt_cons_sb;
- /* Free/used buffer descriptor counters. */
- uint16_t used_tx_bd;
+ /* Used TX buffer descriptor counters. */
+ uint16_t tx_bd_used;
/* Begin: TPA Related data structure. */
- /* Hardware maintained RX Scatter Gather Entry chains. */
- bus_dma_tag_t rx_sge_chain_tag;
- bus_dmamap_t rx_sge_chain_map[NUM_RX_SGE_PAGES];
- struct eth_rx_sge *rx_sge_chain[NUM_RX_SGE_PAGES];
- bus_addr_t rx_sge_chain_paddr[NUM_RX_SGE_PAGES];
+ struct bxe_dma sg_dma;
+ struct eth_rx_sge *sg_chain;
/* Bus tag for RX SGE bufs. */
bus_dma_tag_t rx_sge_buf_tag;
bus_dmamap_t rx_sge_buf_map[TOTAL_RX_SGE];
+ bus_dmamap_t rx_sge_spare_map;
struct mbuf *rx_sge_buf_ptr[TOTAL_RX_SGE];
- uint64_t sge_mask[RX_SGE_MASK_LEN];
+ /*
+ * Bitmask for each SGE element indicating which
+ * aggregation that element is a part of.
+ */
+ uint64_t rx_sge_mask[RX_SGE_MASK_LEN];
uint16_t rx_sge_prod;
/* The last maximal completed SGE. */
@@ -1072,6 +1051,7 @@ struct bxe_fastpath {
/* Use the larger supported size for TPA queue length. */
bus_dmamap_t tpa_mbuf_map[ETH_MAX_AGGREGATION_QUEUES_E1H];
+ bus_dmamap_t tpa_mbuf_spare_map;
struct mbuf *tpa_mbuf_ptr[ETH_MAX_AGGREGATION_QUEUES_E1H];
bus_dma_segment_t tpa_mbuf_segs[ETH_MAX_AGGREGATION_QUEUES_E1H];
@@ -1088,21 +1068,46 @@ struct bxe_fastpath {
struct xstorm_per_client_stats old_xclient;
struct bxe_q_stats eth_q_stats;
- uint16_t free_rx_bd;
-
#if __FreeBSD_version >= 800000
struct buf_ring *br;
#endif
- /* Recieve/transmit packet counters. */
+ /* Receive path driver statistics. */
unsigned long rx_pkts;
+ unsigned long rx_tpa_pkts;
+ unsigned long rx_null_cqe_flags;
+ unsigned long rx_soft_errors;
+
+ /* Transmit path driver statistics. */
unsigned long tx_pkts;
- unsigned long tpa_pkts;
- unsigned long rx_calls;
- unsigned long mbuf_alloc_failed;
+ unsigned long tx_soft_errors;
+ unsigned long tx_offload_frames_csum_ip;
+ unsigned long tx_offload_frames_csum_tcp;
+ unsigned long tx_offload_frames_csum_udp;
+ unsigned long tx_offload_frames_tso;
+ unsigned long tx_header_splits;
+ unsigned long tx_encap_failures;
+ unsigned long tx_hw_queue_full;
+ unsigned long tx_hw_max_queue_depth;
+ unsigned long tx_dma_mapping_failure;
+ int tx_max_drbr_queue_depth;
+ unsigned long tx_window_violation_std;
+ unsigned long tx_window_violation_tso;
+ unsigned long tx_unsupported_tso_request_ipv6;
+ unsigned long tx_unsupported_tso_request_not_tcp;
+ unsigned long tx_chain_lost_mbuf;
+ unsigned long tx_frame_deferred;
+ unsigned long tx_queue_xoff;
+
+ /* Memory path driver statistics. */
unsigned long mbuf_defrag_attempts;
unsigned long mbuf_defrag_failures;
- unsigned long mbuf_defrag_successes;
+ unsigned long mbuf_rx_bd_alloc_failed;
+ unsigned long mbuf_rx_bd_mapping_failed;
+ unsigned long mbuf_tpa_alloc_failed;
+ unsigned long mbuf_tpa_mapping_failed;
+ unsigned long mbuf_sge_alloc_failed;
+ unsigned long mbuf_sge_mapping_failed;
/* Track the number of enqueued mbufs. */
int tx_mbuf_alloc;
@@ -1110,29 +1115,9 @@ struct bxe_fastpath {
int sge_mbuf_alloc;
int tpa_mbuf_alloc;
- int max_drbr_queue_depth;
-
uint64_t tpa_queue_used;
- unsigned long null_cqe_flags;
- unsigned long offload_frames_csum_ip;
- unsigned long offload_frames_csum_tcp;
- unsigned long offload_frames_csum_udp;
- unsigned long offload_frames_tso;
- unsigned long tx_encap_failures;
- unsigned long tx_start_called_on_empty_queue;
- unsigned long tx_queue_too_full;
- unsigned long tx_dma_mapping_failure;
- unsigned long window_violation_tso;
- unsigned long window_violation_std;
- unsigned long unsupported_tso_request_ipv6;
- unsigned long unsupported_tso_request_not_tcp;
- unsigned long tpa_mbuf_alloc_failed;
- unsigned long tx_chain_lost_mbuf;
-
/* FreeBSD interface statistics. */
- unsigned long soft_rx_errors;
- unsigned long soft_tx_errors;
unsigned long ipackets;
unsigned long opackets;
@@ -1144,7 +1129,7 @@ struct bxe_fastpath {
#define BXE_STATUS_BLK_SZ \
sizeof(struct host_status_block) /* +sizeof(struct eth_tx_db_data) */
#define BXE_DEF_STATUS_BLK_SZ sizeof(struct host_def_status_block)
-#define BXE_STATS_BLK_SZ sizeof(struct bxe_eth_stats)
+#define BXE_STATS_BLK_SZ sizeof(struct bxe_port_stats)
#define BXE_SLOWPATH_SZ sizeof(struct bxe_slowpath)
#define BXE_SPQ_SZ BCM_PAGE_SIZE
#define BXE_TX_CHAIN_PAGE_SZ BCM_PAGE_SIZE
@@ -1165,14 +1150,13 @@ struct bxe_softc {
/* Bus tag for the bxe controller. */
bus_dma_tag_t parent_tag;
+
/* OS resources for BAR0 memory. */
struct resource *bxe_res;
bus_space_tag_t bxe_btag;
bus_space_handle_t bxe_bhandle;
vm_offset_t bxe_vhandle;
- /* OS resources for BAR2 memory. */
-
/* OS resources for BAR1 doorbell memory. */
#define BXE_DB_SIZE (16 * 2048)
struct resource *bxe_db_res;
@@ -1216,7 +1200,6 @@ struct bxe_softc {
struct taskqueue *tq;
/* RX Driver parameters*/
uint32_t rx_csum;
- int rx_buf_size;
/* ToDo: Replace with OS specific defintions. */
#define ETH_HLEN 14
@@ -1225,11 +1208,8 @@ struct bxe_softc {
#define ETH_MAX_PACKET_SIZE 1500
#define ETH_MAX_JUMBO_PACKET_SIZE 9600
- /* Hardware Maintained Host Default Status Block. */
- bus_dma_tag_t def_status_block_tag;
- bus_dmamap_t def_status_block_map;
- struct host_def_status_block *def_status_block;
- bus_addr_t def_status_block_paddr;
+ struct bxe_dma def_sb_dma;
+ struct host_def_status_block *def_sb;
#define DEF_SB_ID 16
uint16_t def_c_idx;
@@ -1241,23 +1221,15 @@ struct bxe_softc {
uint32_t attn_state;
struct attn_route attn_group[MAX_DYNAMIC_ATTN_GRPS];
- /* H/W maintained statistics block. */
- bus_dma_tag_t stats_tag;
- bus_dmamap_t stats_map;
- struct statistics_block *stats_block;
- bus_addr_t stats_block_paddr;
+ struct bxe_dma stats_dma;
+ struct statistics_block *stats;
- /* H/W maintained slow path. */
- bus_dma_tag_t slowpath_tag;
- bus_dmamap_t slowpath_map;
+ struct bxe_dma slowpath_dma;
struct bxe_slowpath *slowpath;
- bus_addr_t slowpath_paddr;
- /* Slow path ring. */
- bus_dma_tag_t spq_tag;
- bus_dmamap_t spq_map;
+ struct bxe_dma spq_dma;
struct eth_spe *spq;
- bus_addr_t spq_paddr;
+
uint16_t spq_prod_idx;
struct eth_spe *spq_prod_bd;
struct eth_spe *spq_last_bd;
@@ -1273,17 +1245,15 @@ struct bxe_softc {
/* Device flags. */
uint32_t bxe_flags;
-#define BXE_ONE_PORT_FLAG 0x00000004
-#define BXE_NO_WOL_FLAG 0x00000008
-#define BXE_USING_DAC_FLAG 0x00000010
-#define BXE_USING_MSIX_FLAG 0x00000020
-#define BXE_USING_MSI_FLAG 0x00000040
-#define BXE_TPA_ENABLE_FLAG 0x00000080
-#define BXE_NO_MCP_FLAG 0x00000100
-#define BP_NOMCP(sc) (sc->bxe_flags & BXE_NO_MCP_FLAG)
-#define BXE_SAFC_TX_FLAG 0x00000200
+#define BXE_ONE_PORT_FLAG 0x00000001
+#define BXE_NO_WOL_FLAG 0x00000002
+#define BXE_USING_DAC_FLAG 0x00000004
+#define BXE_TPA_ENABLE_FLAG 0x00000008
+#define BXE_NO_MCP_FLAG 0x00000010
#define TPA_ENABLED(sc) (sc->bxe_flags & BXE_TPA_ENABLE_FLAG)
+#define NOMCP(sc) (sc->bxe_flags & BXE_NO_MCP_FLAG)
+
/* PCI Express function number for the device. */
int bxe_func;
@@ -1386,8 +1356,6 @@ struct bxe_softc {
int mrrs;
int dcc_enable;
-#define BXE_NUM_QUEUES(cos) \
- ((bxe_qs_per_cos & (0xff << (cos * 8))) >> (cos * 8))
#define BXE_MAX_QUEUES(sc) \
(IS_E1HMF(sc) ? (MAX_CONTEXT / E1HVN_MAX) : MAX_CONTEXT)
@@ -1396,18 +1364,6 @@ struct bxe_softc {
#define BXE_MAX_PRIORITY 8
#define BXE_MAX_ENTRIES_PER_PRI 16
- /* Number of queues per class of service. */
- uint8_t qs_per_cos[BXE_MAX_COS];
-
- /* Priority to class of service mapping. */
- uint8_t pri_map[BXE_MAX_PRIORITY];
-
- /* min rate per cos */
- uint16_t cos_min_rate[BXE_MAX_COS];
-
- /* Class of service to queue mapping. */
- uint8_t cos_map[BXE_MAX_COS];
-
/* Used for multiple function devices. */
uint32_t mf_config[E1HVN_MAX];
@@ -1449,15 +1405,13 @@ struct bxe_softc {
/* Statistics. */
uint16_t stats_counter;
- struct bxe_eth_stats eth_stats;
+ struct bxe_port_stats eth_stats;
+ /* Support for DMAE and compressed firmware. */
z_streamp strm;
- bus_dma_tag_t gunzip_tag;
- bus_dmamap_t gunzip_map;
- void *gunzip_buf;
- bus_addr_t gunzip_mapping;
- int gunzip_outlen;
-#define FW_BUF_SIZE 0x40000
+ struct bxe_dma gz_dma;
+ void *gz;
+#define BXE_FW_BUF_SIZE 0x40000
struct raw_op *init_ops;
/* Init blocks offsets inside init_ops */
@@ -1500,10 +1454,9 @@ struct bxe_softc {
uint8_t intr_sem;
#ifdef BXE_DEBUG
- unsigned long debug_mbuf_sim_alloc_failed;
- unsigned long debug_mbuf_sim_map_failed;
+ unsigned long debug_sim_mbuf_alloc_failed;
+ unsigned long debug_sim_mbuf_map_failed;
unsigned long debug_received_frame_error;
- unsigned long debug_memory_allocated;
/* A buffer for hardware/firmware state information (grcdump). */
uint32_t *grcdump_buffer;
@@ -1763,7 +1716,7 @@ struct bxe_softc {
(&fp->status_block->c_status_block.index_values[C_SB_ETH_TX_CQ_INDEX])
#define BXE_SP_DSB_INDEX \
- &sc->def_status_block->c_def_status_block.index_values[C_DEF_SB_SP_INDEX]
+ &sc->def_sb->c_def_status_block.index_values[C_DEF_SB_SP_INDEX]
#define BXE_RX_SB_INDEX_NUM \
(((U_SB_ETH_RX_CQ_INDEX << \
diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c
index 2cfea19..3352a56 100644
--- a/sys/dev/cardbus/cardbus_cis.c
+++ b/sys/dev/cardbus/cardbus_cis.c
@@ -324,7 +324,7 @@ decode_tuple_bar(device_t cbdev, device_t child, int id,
* hint when the cardbus bridge is a child of pci0 (the main
* bus). The PC Card spec seems to indicate that this should
* only be done on x86 based machines, which suggests that on
- * non-x86 machines the adddresses can be anywhere. Since the
+ * non-x86 machines the addresses can be anywhere. Since the
* hardware can do it on non-x86 machines, it should be able
* to do it on x86 machines too. Therefore, we can and should
* ignore this hint. Furthermore, the PC Card spec recommends
@@ -430,7 +430,6 @@ cardbus_read_tuple_finish(device_t cbdev, device_t child, int rid,
{
if (res != CIS_CONFIG_SPACE) {
bus_release_resource(child, SYS_RES_MEMORY, rid, res);
- bus_delete_resource(child, SYS_RES_MEMORY, rid);
}
}
@@ -467,7 +466,7 @@ cardbus_read_tuple_init(device_t cbdev, device_t child, uint32_t *start,
}
/* allocate the memory space to read CIS */
- res = bus_alloc_resource(child, SYS_RES_MEMORY, rid, 0, ~0, 1,
+ res = bus_alloc_resource_any(child, SYS_RES_MEMORY, rid,
rman_make_alignment_flags(4096) | RF_ACTIVE);
if (res == NULL) {
device_printf(cbdev, "Unable to allocate resource "
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index 6b48325..8624fc1 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -110,6 +110,9 @@ enum {
FW_IQ_QSIZE = 256,
FW_IQ_ESIZE = 64, /* At least 64 mandated by the firmware spec */
+ INTR_IQ_QSIZE = 64,
+ INTR_IQ_ESIZE = 64, /* Handles some CPLs too, do not reduce */
+
CTRL_EQ_QSIZE = 128,
CTRL_EQ_ESIZE = 64,
@@ -141,7 +144,7 @@ enum {
/* adapter flags */
FULL_INIT_DONE = (1 << 0),
FW_OK = (1 << 1),
- INTR_FWD = (1 << 2),
+ INTR_SHARED = (1 << 2), /* one set of intrq's for all ports */
CXGBE_BUSY = (1 << 9),
@@ -294,7 +297,7 @@ struct sge_eq {
uint16_t pidx; /* producer idx (desc idx) */
uint16_t pending; /* # of descriptors used since last doorbell */
uint16_t iqid; /* iq that gets egr_update for the eq */
- uint32_t cntxt_id; /* SGE context id for the eq */
+ unsigned int cntxt_id; /* SGE context id for the eq */
};
struct sge_fl {
@@ -384,17 +387,16 @@ struct sge_ctrlq {
/* stats for common events first */
- uint64_t total_wrs; /* # of work requests sent down this queue */
/* stats for not-that-common events */
uint32_t no_desc; /* out of hardware descriptors */
- uint32_t too_long; /* WR longer than hardware max */
} __aligned(CACHE_LINE_SIZE);
struct sge {
uint16_t timer_val[SGE_NTIMERS];
uint8_t counter_val[SGE_NCOUNTERS];
+ int fl_starve_threshold;
int nrxq; /* total rx queues (all ports and the rest) */
int ntxq; /* total tx queues (all ports and the rest) */
@@ -403,7 +405,7 @@ struct sge {
struct sge_iq fwq; /* Firmware event queue */
struct sge_ctrlq *ctrlq;/* Control queues */
- struct sge_iq *fiq; /* Forwarded interrupt queues (INTR_FWD) */
+ struct sge_iq *intrq; /* Interrupt queues */
struct sge_txq *txq; /* NIC tx queues */
struct sge_rxq *rxq; /* NIC rx queues */
@@ -445,6 +447,7 @@ struct adapter {
struct port_info *port[MAX_NPORTS];
uint8_t chan_map[NCHAN];
+ struct l2t_data *l2t; /* L2 table */
struct tid_info tids;
int registered_device_map;
@@ -456,7 +459,9 @@ struct adapter {
struct t4_virt_res vres;
struct sysctl_ctx_list ctx; /* from first_port_up to last_port_down */
+ struct sysctl_oid *oid_fwq;
struct sysctl_oid *oid_ctrlq;
+ struct sysctl_oid *oid_intrq;
struct mtx sc_lock;
char lockname[16];
@@ -502,7 +507,10 @@ struct adapter {
rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \
for (iter = 0; iter < pi->nrxq; ++iter, ++rxq)
-#define NFIQ(sc) ((sc)->intr_count > 1 ? (sc)->intr_count - 1 : 1)
+/* One for errors, one for firmware events */
+#define T4_EXTRA_INTR 2
+#define NINTRQ(sc) ((sc)->intr_count > T4_EXTRA_INTR ? \
+ (sc)->intr_count - T4_EXTRA_INTR : 1)
static inline uint32_t
t4_read_reg(struct adapter *sc, uint32_t reg)
@@ -599,12 +607,9 @@ int t4_teardown_adapter_queues(struct adapter *);
int t4_setup_eth_queues(struct port_info *);
int t4_teardown_eth_queues(struct port_info *);
void t4_intr_all(void *);
-void t4_intr_fwd(void *);
+void t4_intr(void *);
void t4_intr_err(void *);
void t4_intr_evt(void *);
-void t4_intr_data(void *);
-void t4_evt_rx(void *);
-void t4_eth_rx(void *);
int t4_mgmt_tx(struct adapter *, struct mbuf *);
int t4_eth_tx(struct ifnet *, struct sge_txq *, struct mbuf *);
void t4_update_fl_bufsize(struct ifnet *);
diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h
index fa5ac9f..913be9b 100644
--- a/sys/dev/cxgbe/common/common.h
+++ b/sys/dev/cxgbe/common/common.h
@@ -54,7 +54,7 @@ enum {
#define FW_VERSION_MAJOR 1
#define FW_VERSION_MINOR 3
-#define FW_VERSION_MICRO 8
+#define FW_VERSION_MICRO 10
struct port_stats {
u64 tx_octets; /* total # of octets in good frames */
diff --git a/sys/dev/cxgbe/common/jhash.h b/sys/dev/cxgbe/common/jhash.h
new file mode 100644
index 0000000..4546b7b
--- /dev/null
+++ b/sys/dev/cxgbe/common/jhash.h
@@ -0,0 +1,140 @@
+#ifndef _JHASH_H
+#define _JHASH_H
+
+/* jhash.h: Jenkins hash support.
+ *
+ * Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net)
+ *
+ * http://burtleburtle.net/bob/hash/
+ *
+ * These are the credits from Bob's sources:
+ *
+ * lookup2.c, by Bob Jenkins, December 1996, Public Domain.
+ * hash(), hash2(), hash3, and mix() are externally useful functions.
+ * Routines to test the hash are included if SELF_TEST is defined.
+ * You can use this free for any purpose. It has no warranty.
+ *
+ * $FreeBSD$
+ */
+
+/* NOTE: Arguments are modified. */
+#define __jhash_mix(a, b, c) \
+{ \
+ a -= b; a -= c; a ^= (c>>13); \
+ b -= c; b -= a; b ^= (a<<8); \
+ c -= a; c -= b; c ^= (b>>13); \
+ a -= b; a -= c; a ^= (c>>12); \
+ b -= c; b -= a; b ^= (a<<16); \
+ c -= a; c -= b; c ^= (b>>5); \
+ a -= b; a -= c; a ^= (c>>3); \
+ b -= c; b -= a; b ^= (a<<10); \
+ c -= a; c -= b; c ^= (b>>15); \
+}
+
+/* The golden ration: an arbitrary value */
+#define JHASH_GOLDEN_RATIO 0x9e3779b9
+
+/* The most generic version, hashes an arbitrary sequence
+ * of bytes. No alignment or length assumptions are made about
+ * the input key.
+ */
+static inline u32 jhash(const void *key, u32 length, u32 initval)
+{
+ u32 a, b, c, len;
+ const u8 *k = key;
+
+ len = length;
+ a = b = JHASH_GOLDEN_RATIO;
+ c = initval;
+
+ while (len >= 12) {
+ a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24));
+ b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24));
+ c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24));
+
+ __jhash_mix(a,b,c);
+
+ k += 12;
+ len -= 12;
+ }
+
+ c += length;
+ switch (len) {
+ case 11: c += ((u32)k[10]<<24);
+ case 10: c += ((u32)k[9]<<16);
+ case 9 : c += ((u32)k[8]<<8);
+ case 8 : b += ((u32)k[7]<<24);
+ case 7 : b += ((u32)k[6]<<16);
+ case 6 : b += ((u32)k[5]<<8);
+ case 5 : b += k[4];
+ case 4 : a += ((u32)k[3]<<24);
+ case 3 : a += ((u32)k[2]<<16);
+ case 2 : a += ((u32)k[1]<<8);
+ case 1 : a += k[0];
+ };
+
+ __jhash_mix(a,b,c);
+
+ return c;
+}
+
+/* A special optimized version that handles 1 or more of u32s.
+ * The length parameter here is the number of u32s in the key.
+ */
+static inline u32 jhash2(u32 *k, u32 length, u32 initval)
+{
+ u32 a, b, c, len;
+
+ a = b = JHASH_GOLDEN_RATIO;
+ c = initval;
+ len = length;
+
+ while (len >= 3) {
+ a += k[0];
+ b += k[1];
+ c += k[2];
+ __jhash_mix(a, b, c);
+ k += 3; len -= 3;
+ }
+
+ c += length * 4;
+
+ switch (len) {
+ case 2 : b += k[1];
+ case 1 : a += k[0];
+ };
+
+ __jhash_mix(a,b,c);
+
+ return c;
+}
+
+
+/* A special ultra-optimized versions that knows they are hashing exactly
+ * 3, 2 or 1 word(s).
+ *
+ * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally
+ * done at the end is not done here.
+ */
+static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
+{
+ a += JHASH_GOLDEN_RATIO;
+ b += JHASH_GOLDEN_RATIO;
+ c += initval;
+
+ __jhash_mix(a, b, c);
+
+ return c;
+}
+
+static inline u32 jhash_2words(u32 a, u32 b, u32 initval)
+{
+ return jhash_3words(a, b, 0, initval);
+}
+
+static inline u32 jhash_1word(u32 a, u32 initval)
+{
+ return jhash_3words(a, 0, 0, initval);
+}
+
+#endif /* _JHASH_H */
diff --git a/sys/dev/cxgbe/common/t4fw_interface.h b/sys/dev/cxgbe/common/t4fw_interface.h
index 88126be..3eb9615 100644
--- a/sys/dev/cxgbe/common/t4fw_interface.h
+++ b/sys/dev/cxgbe/common/t4fw_interface.h
@@ -43,6 +43,7 @@ enum fw_retval {
FW_ENOMEM = 12, /* out of memory */
FW_EFAULT = 14, /* bad address; fw bad */
FW_EBUSY = 16, /* resource busy */
+ FW_EEXIST = 17, /* File exists */
FW_EINVAL = 22, /* invalid argument */
FW_ENOSYS = 38, /* functionality not implemented */
FW_EPROTO = 71, /* protocol error */
@@ -59,6 +60,8 @@ enum fw_retval {
FW_FCOE_NO_XCHG = 136, /* */
FW_SCSI_RSP_ERR = 137, /* */
FW_ERR_RDEV_IMPL_LOGO = 138, /* */
+ FW_SCSI_UNDER_FLOW_ERR = 139, /* */
+ FW_SCSI_OVER_FLOW_ERR = 140, /* */
};
/******************************************************************************
@@ -85,7 +88,8 @@ enum fw_wr_opcodes {
FW_RI_FR_NSMR_WR = 0x19,
FW_RI_INV_LSTAG_WR = 0x1a,
FW_RI_WR = 0x0d,
- FW_LASTC2E_WR = 0x4a
+ FW_ISCSI_NODE_WR = 0x4a,
+ FW_LASTC2E_WR = 0x4b
};
/*
@@ -514,7 +518,7 @@ struct fw_eth_tx_pkts_wr {
__be32 r3;
__be16 plen;
__u8 npkt;
- __u8 r4;
+ __u8 type;
};
struct fw_eq_flush_wr {
@@ -1465,6 +1469,65 @@ struct fw_ri_wr {
#define G_FW_RI_WR_P2PTYPE(x) \
(((x) >> S_FW_RI_WR_P2PTYPE) & M_FW_RI_WR_P2PTYPE)
+#ifdef FOISCSI
+struct fw_iscsi_node_wr {
+ __u8 opcode;
+ __u8 subop;
+ __u8 node_attr_to_compl;
+ __u8 len16;
+ __u8 status;
+ __u8 r2;
+ __be16 immd_len;
+ __be64 cookie;
+ __be32 node_id;
+ __be32 ctrl_handle;
+ __be32 io_handle;
+ __be32 r3;
+};
+
+#define S_FW_ISCSI_NODE_WR_NODE_ATTR 7
+#define M_FW_ISCSI_NODE_WR_NODE_ATTR 0x1
+#define V_FW_ISCSI_NODE_WR_NODE_ATTR(x) ((x) << S_FW_ISCSI_NODE_WR_NODE_ATTR)
+#define G_FW_ISCSI_NODE_WR_NODE_ATTR(x) \
+ (((x) >> S_FW_ISCSI_NODE_WR_NODE_ATTR) & M_FW_ISCSI_NODE_WR_NODE_ATTR)
+#define F_FW_ISCSI_NODE_WR_NODE_ATTR V_FW_ISCSI_NODE_WR_NODE_ATTR(1U)
+
+#define S_FW_ISCSI_NODE_WR_SESS_ATTR 6
+#define M_FW_ISCSI_NODE_WR_SESS_ATTR 0x1
+#define V_FW_ISCSI_NODE_WR_SESS_ATTR(x) ((x) << S_FW_ISCSI_NODE_WR_SESS_ATTR)
+#define G_FW_ISCSI_NODE_WR_SESS_ATTR(x) \
+ (((x) >> S_FW_ISCSI_NODE_WR_SESS_ATTR) & M_FW_ISCSI_NODE_WR_SESS_ATTR)
+#define F_FW_ISCSI_NODE_WR_SESS_ATTR V_FW_ISCSI_NODE_WR_SESS_ATTR(1U)
+
+#define S_FW_ISCSI_NODE_WR_CONN_ATTR 5
+#define M_FW_ISCSI_NODE_WR_CONN_ATTR 0x1
+#define V_FW_ISCSI_NODE_WR_CONN_ATTR(x) ((x) << S_FW_ISCSI_NODE_WR_CONN_ATTR)
+#define G_FW_ISCSI_NODE_WR_CONN_ATTR(x) \
+ (((x) >> S_FW_ISCSI_NODE_WR_CONN_ATTR) & M_FW_ISCSI_NODE_WR_CONN_ATTR)
+#define F_FW_ISCSI_NODE_WR_CONN_ATTR V_FW_ISCSI_NODE_WR_CONN_ATTR(1U)
+
+#define S_FW_ISCSI_NODE_WR_TGT_ATTR 4
+#define M_FW_ISCSI_NODE_WR_TGT_ATTR 0x1
+#define V_FW_ISCSI_NODE_WR_TGT_ATTR(x) ((x) << S_FW_ISCSI_NODE_WR_TGT_ATTR)
+#define G_FW_ISCSI_NODE_WR_TGT_ATTR(x) \
+ (((x) >> S_FW_ISCSI_NODE_WR_TGT_ATTR) & M_FW_ISCSI_NODE_WR_TGT_ATTR)
+#define F_FW_ISCSI_NODE_WR_TGT_ATTR V_FW_ISCSI_NODE_WR_TGT_ATTR(1U)
+
+#define S_FW_ISCSI_NODE_WR_NODE_TYPE 3
+#define M_FW_ISCSI_NODE_WR_NODE_TYPE 0x1
+#define V_FW_ISCSI_NODE_WR_NODE_TYPE(x) ((x) << S_FW_ISCSI_NODE_WR_NODE_TYPE)
+#define G_FW_ISCSI_NODE_WR_NODE_TYPE(x) \
+ (((x) >> S_FW_ISCSI_NODE_WR_NODE_TYPE) & M_FW_ISCSI_NODE_WR_NODE_TYPE)
+#define F_FW_ISCSI_NODE_WR_NODE_TYPE V_FW_ISCSI_NODE_WR_NODE_TYPE(1U)
+
+#define S_FW_ISCSI_NODE_WR_COMPL 0
+#define M_FW_ISCSI_NODE_WR_COMPL 0x1
+#define V_FW_ISCSI_NODE_WR_COMPL(x) ((x) << S_FW_ISCSI_NODE_WR_COMPL)
+#define G_FW_ISCSI_NODE_WR_COMPL(x) \
+ (((x) >> S_FW_ISCSI_NODE_WR_COMPL) & M_FW_ISCSI_NODE_WR_COMPL)
+#define F_FW_ISCSI_NODE_WR_COMPL V_FW_ISCSI_NODE_WR_COMPL(1U)
+
+#endif
/******************************************************************************
* C O M M A N D s
@@ -1511,6 +1574,7 @@ enum fw_cmd_opcodes {
FW_RSS_VI_CONFIG_CMD = 0x23,
FW_SCHED_CMD = 0x24,
FW_DEVLOG_CMD = 0x25,
+ FW_NETIF_CMD = 0x26,
FW_LASTC2E_CMD = 0x40,
FW_ERROR_CMD = 0x80,
FW_DEBUG_CMD = 0x81,
@@ -1941,6 +2005,8 @@ enum fw_caps_config_iscsi {
FW_CAPS_CONFIG_ISCSI_TARGET_PDU = 0x00000002,
FW_CAPS_CONFIG_ISCSI_INITIATOR_CNXOFLD = 0x00000004,
FW_CAPS_CONFIG_ISCSI_TARGET_CNXOFLD = 0x00000008,
+ FW_CAPS_CONFIG_ISCSI_INITIATOR_SSNOFLD = 0x00000010,
+ FW_CAPS_CONFIG_ISCSI_TARGET_SSNOFLD = 0x00000020,
};
enum fw_caps_config_fcoe {
@@ -3941,6 +4007,39 @@ enum fw_port_cap {
FW_PORT_CAP_TECHKX4 = 0x2000,
};
+#define S_FW_PORT_AUXLINFO_MDI 3
+#define M_FW_PORT_AUXLINFO_MDI 0x3
+#define V_FW_PORT_AUXLINFO_MDI(x) ((x) << S_FW_PORT_AUXLINFO_MDI)
+#define G_FW_PORT_AUXLINFO_MDI(x) \
+ (((x) >> S_FW_PORT_AUXLINFO_MDI) & M_FW_PORT_AUXLINFO_MDI)
+
+#define S_FW_PORT_AUXLINFO_KX4 2
+#define M_FW_PORT_AUXLINFO_KX4 0x1
+#define V_FW_PORT_AUXLINFO_KX4(x) ((x) << S_FW_PORT_AUXLINFO_KX4)
+#define G_FW_PORT_AUXLINFO_KX4(x) \
+ (((x) >> S_FW_PORT_AUXLINFO_KX4) & M_FW_PORT_AUXLINFO_KX4)
+#define F_FW_PORT_AUXLINFO_KX4 V_FW_PORT_AUXLINFO_KX4(1U)
+
+#define S_FW_PORT_AUXLINFO_KR 1
+#define M_FW_PORT_AUXLINFO_KR 0x1
+#define V_FW_PORT_AUXLINFO_KR(x) ((x) << S_FW_PORT_AUXLINFO_KR)
+#define G_FW_PORT_AUXLINFO_KR(x) \
+ (((x) >> S_FW_PORT_AUXLINFO_KR) & M_FW_PORT_AUXLINFO_KR)
+#define F_FW_PORT_AUXLINFO_KR V_FW_PORT_AUXLINFO_KR(1U)
+
+#define S_FW_PORT_AUXLINFO_FEC 0
+#define M_FW_PORT_AUXLINFO_FEC 0x1
+#define V_FW_PORT_AUXLINFO_FEC(x) ((x) << S_FW_PORT_AUXLINFO_FEC)
+#define G_FW_PORT_AUXLINFO_FEC(x) \
+ (((x) >> S_FW_PORT_AUXLINFO_FEC) & M_FW_PORT_AUXLINFO_FEC)
+#define F_FW_PORT_AUXLINFO_FEC V_FW_PORT_AUXLINFO_FEC(1U)
+
+#define S_FW_PORT_RCAP_AUX 11
+#define M_FW_PORT_RCAP_AUX 0x7
+#define V_FW_PORT_RCAP_AUX(x) ((x) << S_FW_PORT_RCAP_AUX)
+#define G_FW_PORT_RCAP_AUX(x) \
+ (((x) >> S_FW_PORT_RCAP_AUX) & M_FW_PORT_RCAP_AUX)
+
#define S_FW_PORT_CAP_SPEED 0
#define M_FW_PORT_CAP_SPEED 0x3f
#define V_FW_PORT_CAP_SPEED(x) ((x) << S_FW_PORT_CAP_SPEED)
@@ -4002,11 +4101,23 @@ enum fw_port_l2cfg_ctlbf {
FW_PORT_L2_CTLBF_MTU = 0x40
};
+enum fw_port_dcb_cfg {
+ FW_PORT_DCB_CFG_PG = 0x01,
+ FW_PORT_DCB_CFG_PFC = 0x02,
+ FW_PORT_DCB_CFG_APPL = 0x04
+};
+
+enum fw_port_dcb_cfg_rc {
+ FW_PORT_DCB_CFG_SUCCESS = 0x0,
+ FW_PORT_DCB_CFG_ERROR = 0x1
+};
+
enum fw_port_dcb_type {
FW_PORT_DCB_TYPE_PGID = 0x00,
FW_PORT_DCB_TYPE_PGRATE = 0x01,
FW_PORT_DCB_TYPE_PRIORATE = 0x02,
- FW_PORT_DCB_TYPE_PFC = 0x03
+ FW_PORT_DCB_TYPE_PFC = 0x03,
+ FW_PORT_DCB_TYPE_APP_ID = 0x04,
};
struct fw_port_cmd {
@@ -4038,7 +4149,7 @@ struct fw_port_cmd {
__be16 acap;
__be16 mtu;
__u8 cbllen;
- __u8 r7;
+ __u8 auxlinfo;
__be32 r8;
__be64 r9;
} info;
@@ -4068,6 +4179,14 @@ struct fw_port_cmd {
__be16 r10[3];
__be64 r11;
} pfc;
+ struct fw_port_app_priority {
+ __u8 type;
+ __u8 r10_lo[3];
+ __u8 prio;
+ __u8 sel;
+ __be16 protocolid;
+ __u8 r12[8];
+ } app_priority;
} dcb;
} u;
};
@@ -5232,6 +5351,116 @@ struct fw_devlog_cmd {
(((x) >> S_FW_DEVLOG_CMD_MEMADDR16_DEVLOG) & \
M_FW_DEVLOG_CMD_MEMADDR16_DEVLOG)
+struct fw_netif_cmd {
+ __be32 op_portid;
+ __be32 retval_to_len16;
+ __be32 add_to_ipv4gw;
+ __be32 vlanid_mtuval;
+ __be32 gwaddr;
+ __be32 addr;
+ __be32 nmask;
+ __be32 bcaddr;
+};
+
+#define S_FW_NETIF_CMD_PORTID 0
+#define M_FW_NETIF_CMD_PORTID 0xf
+#define V_FW_NETIF_CMD_PORTID(x) ((x) << S_FW_NETIF_CMD_PORTID)
+#define G_FW_NETIF_CMD_PORTID(x) \
+ (((x) >> S_FW_NETIF_CMD_PORTID) & M_FW_NETIF_CMD_PORTID)
+
+#define S_FW_NETIF_CMD_RETVAL 24
+#define M_FW_NETIF_CMD_RETVAL 0xff
+#define V_FW_NETIF_CMD_RETVAL(x) ((x) << S_FW_NETIF_CMD_RETVAL)
+#define G_FW_NETIF_CMD_RETVAL(x) \
+ (((x) >> S_FW_NETIF_CMD_RETVAL) & M_FW_NETIF_CMD_RETVAL)
+
+#define S_FW_NETIF_CMD_IFIDX 16
+#define M_FW_NETIF_CMD_IFIDX 0xff
+#define V_FW_NETIF_CMD_IFIDX(x) ((x) << S_FW_NETIF_CMD_IFIDX)
+#define G_FW_NETIF_CMD_IFIDX(x) \
+ (((x) >> S_FW_NETIF_CMD_IFIDX) & M_FW_NETIF_CMD_IFIDX)
+
+#define S_FW_NETIF_CMD_LEN16 0
+#define M_FW_NETIF_CMD_LEN16 0xff
+#define V_FW_NETIF_CMD_LEN16(x) ((x) << S_FW_NETIF_CMD_LEN16)
+#define G_FW_NETIF_CMD_LEN16(x) \
+ (((x) >> S_FW_NETIF_CMD_LEN16) & M_FW_NETIF_CMD_LEN16)
+
+#define S_FW_NETIF_CMD_ADD 31
+#define M_FW_NETIF_CMD_ADD 0x1
+#define V_FW_NETIF_CMD_ADD(x) ((x) << S_FW_NETIF_CMD_ADD)
+#define G_FW_NETIF_CMD_ADD(x) \
+ (((x) >> S_FW_NETIF_CMD_ADD) & M_FW_NETIF_CMD_ADD)
+#define F_FW_NETIF_CMD_ADD V_FW_NETIF_CMD_ADD(1U)
+
+#define S_FW_NETIF_CMD_LINK 30
+#define M_FW_NETIF_CMD_LINK 0x1
+#define V_FW_NETIF_CMD_LINK(x) ((x) << S_FW_NETIF_CMD_LINK)
+#define G_FW_NETIF_CMD_LINK(x) \
+ (((x) >> S_FW_NETIF_CMD_LINK) & M_FW_NETIF_CMD_LINK)
+#define F_FW_NETIF_CMD_LINK V_FW_NETIF_CMD_LINK(1U)
+
+#define S_FW_NETIF_CMD_VLAN 29
+#define M_FW_NETIF_CMD_VLAN 0x1
+#define V_FW_NETIF_CMD_VLAN(x) ((x) << S_FW_NETIF_CMD_VLAN)
+#define G_FW_NETIF_CMD_VLAN(x) \
+ (((x) >> S_FW_NETIF_CMD_VLAN) & M_FW_NETIF_CMD_VLAN)
+#define F_FW_NETIF_CMD_VLAN V_FW_NETIF_CMD_VLAN(1U)
+
+#define S_FW_NETIF_CMD_MTU 28
+#define M_FW_NETIF_CMD_MTU 0x1
+#define V_FW_NETIF_CMD_MTU(x) ((x) << S_FW_NETIF_CMD_MTU)
+#define G_FW_NETIF_CMD_MTU(x) \
+ (((x) >> S_FW_NETIF_CMD_MTU) & M_FW_NETIF_CMD_MTU)
+#define F_FW_NETIF_CMD_MTU V_FW_NETIF_CMD_MTU(1U)
+
+#define S_FW_NETIF_CMD_DHCP 27
+#define M_FW_NETIF_CMD_DHCP 0x1
+#define V_FW_NETIF_CMD_DHCP(x) ((x) << S_FW_NETIF_CMD_DHCP)
+#define G_FW_NETIF_CMD_DHCP(x) \
+ (((x) >> S_FW_NETIF_CMD_DHCP) & M_FW_NETIF_CMD_DHCP)
+#define F_FW_NETIF_CMD_DHCP V_FW_NETIF_CMD_DHCP(1U)
+
+#define S_FW_NETIF_CMD_IPV4BCADDR 3
+#define M_FW_NETIF_CMD_IPV4BCADDR 0x1
+#define V_FW_NETIF_CMD_IPV4BCADDR(x) ((x) << S_FW_NETIF_CMD_IPV4BCADDR)
+#define G_FW_NETIF_CMD_IPV4BCADDR(x) \
+ (((x) >> S_FW_NETIF_CMD_IPV4BCADDR) & M_FW_NETIF_CMD_IPV4BCADDR)
+#define F_FW_NETIF_CMD_IPV4BCADDR V_FW_NETIF_CMD_IPV4BCADDR(1U)
+
+#define S_FW_NETIF_CMD_IPV4NMASK 2
+#define M_FW_NETIF_CMD_IPV4NMASK 0x1
+#define V_FW_NETIF_CMD_IPV4NMASK(x) ((x) << S_FW_NETIF_CMD_IPV4NMASK)
+#define G_FW_NETIF_CMD_IPV4NMASK(x) \
+ (((x) >> S_FW_NETIF_CMD_IPV4NMASK) & M_FW_NETIF_CMD_IPV4NMASK)
+#define F_FW_NETIF_CMD_IPV4NMASK V_FW_NETIF_CMD_IPV4NMASK(1U)
+
+#define S_FW_NETIF_CMD_IPV4ADDR 1
+#define M_FW_NETIF_CMD_IPV4ADDR 0x1
+#define V_FW_NETIF_CMD_IPV4ADDR(x) ((x) << S_FW_NETIF_CMD_IPV4ADDR)
+#define G_FW_NETIF_CMD_IPV4ADDR(x) \
+ (((x) >> S_FW_NETIF_CMD_IPV4ADDR) & M_FW_NETIF_CMD_IPV4ADDR)
+#define F_FW_NETIF_CMD_IPV4ADDR V_FW_NETIF_CMD_IPV4ADDR(1U)
+
+#define S_FW_NETIF_CMD_IPV4GW 0
+#define M_FW_NETIF_CMD_IPV4GW 0x1
+#define V_FW_NETIF_CMD_IPV4GW(x) ((x) << S_FW_NETIF_CMD_IPV4GW)
+#define G_FW_NETIF_CMD_IPV4GW(x) \
+ (((x) >> S_FW_NETIF_CMD_IPV4GW) & M_FW_NETIF_CMD_IPV4GW)
+#define F_FW_NETIF_CMD_IPV4GW V_FW_NETIF_CMD_IPV4GW(1U)
+
+#define S_FW_NETIF_CMD_VLANID 16
+#define M_FW_NETIF_CMD_VLANID 0xfff
+#define V_FW_NETIF_CMD_VLANID(x) ((x) << S_FW_NETIF_CMD_VLANID)
+#define G_FW_NETIF_CMD_VLANID(x) \
+ (((x) >> S_FW_NETIF_CMD_VLANID) & M_FW_NETIF_CMD_VLANID)
+
+#define S_FW_NETIF_CMD_MTUVAL 0
+#define M_FW_NETIF_CMD_MTUVAL 0xffff
+#define V_FW_NETIF_CMD_MTUVAL(x) ((x) << S_FW_NETIF_CMD_MTUVAL)
+#define G_FW_NETIF_CMD_MTUVAL(x) \
+ (((x) >> S_FW_NETIF_CMD_MTUVAL) & M_FW_NETIF_CMD_MTUVAL)
+
enum fw_error_type {
FW_ERROR_TYPE_EXCEPTION = 0x0,
FW_ERROR_TYPE_HWMODULE = 0x1,
diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h
index fa58853..f31b840 100644
--- a/sys/dev/cxgbe/offload.h
+++ b/sys/dev/cxgbe/offload.h
@@ -31,6 +31,24 @@
#ifndef __T4_OFFLOAD_H__
#define __T4_OFFLOAD_H__
+/* CPL message priority levels */
+enum {
+ CPL_PRIORITY_DATA = 0, /* data messages */
+ CPL_PRIORITY_SETUP = 1, /* connection setup messages */
+ CPL_PRIORITY_TEARDOWN = 0, /* connection teardown messages */
+ CPL_PRIORITY_LISTEN = 1, /* listen start/stop messages */
+ CPL_PRIORITY_ACK = 1, /* RX ACK messages */
+ CPL_PRIORITY_CONTROL = 1 /* control messages */
+};
+
+#define INIT_TP_WR(w, tid) do { \
+ (w)->wr.wr_hi = htonl(V_FW_WR_OP(FW_TP_WR) | \
+ V_FW_WR_IMMDLEN(sizeof(*w) - sizeof(w->wr))); \
+ (w)->wr.wr_mid = htonl(V_FW_WR_LEN16(DIV_ROUND_UP(sizeof(*w), 16)) | \
+ V_FW_WR_FLOWID(tid)); \
+ (w)->wr.wr_lo = cpu_to_be64(0); \
+} while (0)
+
/*
* Max # of ATIDs. The absolute HW max is 16K but we keep it lower.
*/
diff --git a/sys/dev/cxgbe/osdep.h b/sys/dev/cxgbe/osdep.h
index 438a434..bde1eb4 100644
--- a/sys/dev/cxgbe/osdep.h
+++ b/sys/dev/cxgbe/osdep.h
@@ -82,6 +82,7 @@ typedef boolean_t bool;
#define DIV_ROUND_UP(x, y) howmany(x, y)
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define container_of(p, s, f) ((s *)(((uint8_t *)(p)) - offsetof(s, f)))
#define swab16(x) bswap16(x)
#define swab32(x) bswap32(x)
diff --git a/sys/dev/cxgbe/t4_ioctl.h b/sys/dev/cxgbe/t4_ioctl.h
index 8f1d133..ecc2c3d 100644
--- a/sys/dev/cxgbe/t4_ioctl.h
+++ b/sys/dev/cxgbe/t4_ioctl.h
@@ -46,6 +46,7 @@ enum {
T4_GET_FILTER, /* get information about a filter */
T4_SET_FILTER, /* program a filter */
T4_DEL_FILTER, /* delete a filter */
+ T4_GET_SGE_CONTEXT, /* get SGE context for a queue */
};
struct t4_reg {
@@ -178,10 +179,26 @@ struct t4_filter_specification {
struct t4_filter {
uint32_t idx;
+ uint16_t l2tidx;
+ uint16_t smtidx;
uint64_t hits;
struct t4_filter_specification fs;
};
+#define T4_SGE_CONTEXT_SIZE 24
+enum {
+ SGE_CONTEXT_EGRESS,
+ SGE_CONTEXT_INGRESS,
+ SGE_CONTEXT_FLM,
+ SGE_CONTEXT_CNM
+};
+
+struct t4_sge_context {
+ uint32_t mem_id;
+ uint32_t cid;
+ uint32_t data[T4_SGE_CONTEXT_SIZE / 4];
+};
+
#define CHELSIO_T4_GETREG _IOWR('f', T4_GETREG, struct t4_reg)
#define CHELSIO_T4_SETREG _IOW('f', T4_SETREG, struct t4_reg)
#define CHELSIO_T4_REGDUMP _IOWR('f', T4_REGDUMP, struct t4_regdump)
@@ -190,4 +207,6 @@ struct t4_filter {
#define CHELSIO_T4_GET_FILTER _IOWR('f', T4_GET_FILTER, struct t4_filter)
#define CHELSIO_T4_SET_FILTER _IOW('f', T4_SET_FILTER, struct t4_filter)
#define CHELSIO_T4_DEL_FILTER _IOW('f', T4_DEL_FILTER, struct t4_filter)
+#define CHELSIO_T4_GET_SGE_CONTEXT _IOWR('f', T4_GET_SGE_CONTEXT, \
+ struct t4_sge_context)
#endif
diff --git a/sys/dev/cxgbe/t4_l2t.c b/sys/dev/cxgbe/t4_l2t.c
new file mode 100644
index 0000000..31197b8
--- /dev/null
+++ b/sys/dev/cxgbe/t4_l2t.c
@@ -0,0 +1,361 @@
+/*-
+ * Copyright (c) 2011 Chelsio Communications, Inc.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_inet.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/bus.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <net/ethernet.h>
+#include <net/if_vlan_var.h>
+#include <net/if_dl.h>
+#include <net/if_llatbl.h>
+#include <net/route.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <netinet/if_ether.h>
+
+#include "common/common.h"
+#include "common/jhash.h"
+#include "common/t4_msg.h"
+#include "offload.h"
+#include "t4_l2t.h"
+
+/* identifies sync vs async L2T_WRITE_REQs */
+#define S_SYNC_WR 12
+#define V_SYNC_WR(x) ((x) << S_SYNC_WR)
+#define F_SYNC_WR V_SYNC_WR(1)
+
+enum {
+ L2T_STATE_VALID, /* entry is up to date */
+ L2T_STATE_STALE, /* entry may be used but needs revalidation */
+ L2T_STATE_RESOLVING, /* entry needs address resolution */
+ L2T_STATE_SYNC_WRITE, /* synchronous write of entry underway */
+
+ /* when state is one of the below the entry is not hashed */
+ L2T_STATE_SWITCHING, /* entry is being used by a switching filter */
+ L2T_STATE_UNUSED /* entry not in use */
+};
+
+struct l2t_data {
+ struct rwlock lock;
+ volatile int nfree; /* number of free entries */
+ struct l2t_entry *rover;/* starting point for next allocation */
+ struct l2t_entry l2tab[L2T_SIZE];
+};
+
+/*
+ * Module locking notes: There is a RW lock protecting the L2 table as a
+ * whole plus a spinlock per L2T entry. Entry lookups and allocations happen
+ * under the protection of the table lock, individual entry changes happen
+ * while holding that entry's spinlock. The table lock nests outside the
+ * entry locks. Allocations of new entries take the table lock as writers so
+ * no other lookups can happen while allocating new entries. Entry updates
+ * take the table lock as readers so multiple entries can be updated in
+ * parallel. An L2T entry can be dropped by decrementing its reference count
+ * and therefore can happen in parallel with entry allocation but no entry
+ * can change state or increment its ref count during allocation as both of
+ * these perform lookups.
+ *
+ * Note: We do not take refereces to ifnets in this module because both
+ * the TOE and the sockets already hold references to the interfaces and the
+ * lifetime of an L2T entry is fully contained in the lifetime of the TOE.
+ */
+static inline unsigned int
+vlan_prio(const struct l2t_entry *e)
+{
+ return e->vlan >> 13;
+}
+
+static inline void
+l2t_hold(struct l2t_data *d, struct l2t_entry *e)
+{
+ if (atomic_fetchadd_int(&e->refcnt, 1) == 0) /* 0 -> 1 transition */
+ atomic_add_int(&d->nfree, -1);
+}
+
+/*
+ * To avoid having to check address families we do not allow v4 and v6
+ * neighbors to be on the same hash chain. We keep v4 entries in the first
+ * half of available hash buckets and v6 in the second.
+ */
+enum {
+ L2T_SZ_HALF = L2T_SIZE / 2,
+ L2T_HASH_MASK = L2T_SZ_HALF - 1
+};
+
+static inline unsigned int
+arp_hash(const uint32_t *key, int ifindex)
+{
+ return jhash_2words(*key, ifindex, 0) & L2T_HASH_MASK;
+}
+
+static inline unsigned int
+ipv6_hash(const uint32_t *key, int ifindex)
+{
+ uint32_t xor = key[0] ^ key[1] ^ key[2] ^ key[3];
+
+ return L2T_SZ_HALF + (jhash_2words(xor, ifindex, 0) & L2T_HASH_MASK);
+}
+
+static inline unsigned int
+addr_hash(const uint32_t *addr, int addr_len, int ifindex)
+{
+ return addr_len == 4 ? arp_hash(addr, ifindex) :
+ ipv6_hash(addr, ifindex);
+}
+
+/*
+ * Checks if an L2T entry is for the given IP/IPv6 address. It does not check
+ * whether the L2T entry and the address are of the same address family.
+ * Callers ensure an address is only checked against L2T entries of the same
+ * family, something made trivial by the separation of IP and IPv6 hash chains
+ * mentioned above. Returns 0 if there's a match,
+ */
+static inline int
+addreq(const struct l2t_entry *e, const uint32_t *addr)
+{
+ if (e->v6)
+ return (e->addr[0] ^ addr[0]) | (e->addr[1] ^ addr[1]) |
+ (e->addr[2] ^ addr[2]) | (e->addr[3] ^ addr[3]);
+ return e->addr[0] ^ addr[0];
+}
+
+/*
+ * Write an L2T entry. Must be called with the entry locked (XXX: really?).
+ * The write may be synchronous or asynchronous.
+ */
+static int
+write_l2e(struct adapter *sc, struct l2t_entry *e, int sync)
+{
+ struct mbuf *m;
+ struct cpl_l2t_write_req *req;
+
+ if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL)
+ return (ENOMEM);
+
+ req = mtod(m, struct cpl_l2t_write_req *);
+ m->m_pkthdr.len = m->m_len = sizeof(*req);
+
+ INIT_TP_WR(req, 0);
+ OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, e->idx |
+ V_SYNC_WR(sync) | V_TID_QID(sc->sge.fwq.abs_id)));
+ req->params = htons(V_L2T_W_PORT(e->lport) | V_L2T_W_NOREPLY(!sync));
+ req->l2t_idx = htons(e->idx);
+ req->vlan = htons(e->vlan);
+ memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac));
+
+ t4_mgmt_tx(sc, m);
+
+ if (sync && e->state != L2T_STATE_SWITCHING)
+ e->state = L2T_STATE_SYNC_WRITE;
+
+ return (0);
+}
+
+/*
+ * Add a packet to an L2T entry's queue of packets awaiting resolution.
+ * Must be called with the entry's lock held.
+ */
+static inline void
+arpq_enqueue(struct l2t_entry *e, struct mbuf *m)
+{
+ mtx_assert(&e->lock, MA_OWNED);
+
+ m->m_next = NULL;
+ if (e->arpq_head)
+ e->arpq_tail->m_next = m;
+ else
+ e->arpq_head = m;
+ e->arpq_tail = m;
+}
+
+/*
+ * Allocate a free L2T entry. Must be called with l2t_data.lock held.
+ */
+static struct l2t_entry *
+alloc_l2e(struct l2t_data *d)
+{
+ struct l2t_entry *end, *e, **p;
+
+ rw_assert(&d->lock, RA_WLOCKED);
+
+ if (!atomic_load_acq_int(&d->nfree))
+ return (NULL);
+
+ /* there's definitely a free entry */
+ for (e = d->rover, end = &d->l2tab[L2T_SIZE]; e != end; ++e)
+ if (atomic_load_acq_int(&e->refcnt) == 0)
+ goto found;
+
+ for (e = d->l2tab; atomic_load_acq_int(&e->refcnt); ++e) ;
+found:
+ d->rover = e + 1;
+ atomic_add_int(&d->nfree, -1);
+
+ /*
+ * The entry we found may be an inactive entry that is
+ * presently in the hash table. We need to remove it.
+ */
+ if (e->state < L2T_STATE_SWITCHING) {
+ for (p = &d->l2tab[e->hash].first; *p; p = &(*p)->next) {
+ if (*p == e) {
+ *p = e->next;
+ e->next = NULL;
+ break;
+ }
+ }
+ }
+
+ e->state = L2T_STATE_UNUSED;
+ return e;
+}
+
+/*
+ * Called when an L2T entry has no more users. The entry is left in the hash
+ * table since it is likely to be reused but we also bump nfree to indicate
+ * that the entry can be reallocated for a different neighbor. We also drop
+ * the existing neighbor reference in case the neighbor is going away and is
+ * waiting on our reference.
+ *
+ * Because entries can be reallocated to other neighbors once their ref count
+ * drops to 0 we need to take the entry's lock to avoid races with a new
+ * incarnation.
+ */
+static void
+t4_l2e_free(struct l2t_entry *e)
+{
+ struct llentry *lle = NULL;
+ struct l2t_data *d;
+
+ mtx_lock(&e->lock);
+ if (atomic_load_acq_int(&e->refcnt) == 0) { /* hasn't been recycled */
+ lle = e->lle;
+ e->lle = NULL;
+ /*
+ * Don't need to worry about the arpq, an L2T entry can't be
+ * released if any packets are waiting for resolution as we
+ * need to be able to communicate with the device to close a
+ * connection.
+ */
+ }
+ mtx_unlock(&e->lock);
+
+ d = container_of(e, struct l2t_data, l2tab[e->idx]);
+ atomic_add_int(&d->nfree, 1);
+
+ if (lle)
+ LLE_FREE(lle);
+}
+
+void
+t4_l2t_release(struct l2t_entry *e)
+{
+ if (atomic_fetchadd_int(&e->refcnt, -1) == 1)
+ t4_l2e_free(e);
+}
+
+/*
+ * Allocate an L2T entry for use by a switching rule. Such need to be
+ * explicitly freed and while busy they are not on any hash chain, so normal
+ * address resolution updates do not see them.
+ */
+struct l2t_entry *
+t4_l2t_alloc_switching(struct l2t_data *d)
+{
+ struct l2t_entry *e;
+
+ rw_rlock(&d->lock);
+ e = alloc_l2e(d);
+ if (e) {
+ mtx_lock(&e->lock); /* avoid race with t4_l2t_free */
+ e->state = L2T_STATE_SWITCHING;
+ atomic_store_rel_int(&e->refcnt, 1);
+ mtx_unlock(&e->lock);
+ }
+ rw_runlock(&d->lock);
+ return e;
+}
+
+/*
+ * Sets/updates the contents of a switching L2T entry that has been allocated
+ * with an earlier call to @t4_l2t_alloc_switching.
+ */
+int
+t4_l2t_set_switching(struct adapter *sc, struct l2t_entry *e, uint16_t vlan,
+ uint8_t port, uint8_t *eth_addr)
+{
+ e->vlan = vlan;
+ e->lport = port;
+ memcpy(e->dmac, eth_addr, ETHER_ADDR_LEN);
+ return write_l2e(sc, e, 0);
+}
+
+struct l2t_data *
+t4_init_l2t(int flags)
+{
+ int i;
+ struct l2t_data *d;
+
+ d = malloc(sizeof(*d), M_CXGBE, M_ZERO | flags);
+ if (!d)
+ return (NULL);
+
+ d->rover = d->l2tab;
+ atomic_store_rel_int(&d->nfree, L2T_SIZE);
+ rw_init(&d->lock, "L2T");
+
+ for (i = 0; i < L2T_SIZE; i++) {
+ d->l2tab[i].idx = i;
+ d->l2tab[i].state = L2T_STATE_UNUSED;
+ mtx_init(&d->l2tab[i].lock, "L2T_E", NULL, MTX_DEF);
+ atomic_store_rel_int(&d->l2tab[i].refcnt, 0);
+ }
+
+ return (d);
+}
+
+int
+t4_free_l2t(struct l2t_data *d)
+{
+ int i;
+
+ for (i = 0; i < L2T_SIZE; i++)
+ mtx_destroy(&d->l2tab[i].lock);
+ rw_destroy(&d->lock);
+ free(d, M_CXGBE);
+
+ return (0);
+}
diff --git a/sys/dev/cxgbe/t4_l2t.h b/sys/dev/cxgbe/t4_l2t.h
new file mode 100644
index 0000000..c5520c6
--- /dev/null
+++ b/sys/dev/cxgbe/t4_l2t.h
@@ -0,0 +1,71 @@
+/*-
+ * Copyright (c) 2011 Chelsio Communications, Inc.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#ifndef __T4_L2T_H
+#define __T4_L2T_H
+
+enum { L2T_SIZE = 4096 }; /* # of L2T entries */
+
+/*
+ * Each L2T entry plays multiple roles. First of all, it keeps state for the
+ * corresponding entry of the HW L2 table and maintains a queue of offload
+ * packets awaiting address resolution. Second, it is a node of a hash table
+ * chain, where the nodes of the chain are linked together through their next
+ * pointer. Finally, each node is a bucket of a hash table, pointing to the
+ * first element in its chain through its first pointer.
+ */
+struct l2t_entry {
+ uint16_t state; /* entry state */
+ uint16_t idx; /* entry index */
+ uint32_t addr[4]; /* next hop IP or IPv6 address */
+ struct ifnet *ifp; /* outgoing interface */
+ uint16_t smt_idx; /* SMT index */
+ uint16_t vlan; /* VLAN TCI (id: 0-11, prio: 13-15) */
+ int ifindex; /* interface index */
+ struct llentry *lle; /* llentry for next hop */
+ struct l2t_entry *first; /* start of hash chain */
+ struct l2t_entry *next; /* next l2t_entry on chain */
+ struct mbuf *arpq_head; /* list of mbufs awaiting resolution */
+ struct mbuf *arpq_tail;
+ struct mtx lock;
+ volatile uint32_t refcnt; /* entry reference count */
+ uint16_t hash; /* hash bucket the entry is on */
+ uint8_t v6; /* whether entry is for IPv6 */
+ uint8_t lport; /* associated offload logical port */
+ uint8_t dmac[ETHER_ADDR_LEN]; /* next hop's MAC address */
+};
+
+struct l2t_data *t4_init_l2t(int);
+int t4_free_l2t(struct l2t_data *);
+struct l2t_entry *t4_l2t_alloc_switching(struct l2t_data *);
+int t4_l2t_set_switching(struct adapter *, struct l2t_entry *, uint16_t,
+ uint8_t, uint8_t *);
+void t4_l2t_release(struct l2t_entry *);
+
+#endif /* __T4_L2T_H */
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 469af8d..18b813d 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
#include "common/t4_regs_values.h"
#include "common/t4fw_interface.h"
#include "t4_ioctl.h"
+#include "t4_l2t.h"
/* T4 bus driver interface */
static int t4_probe(device_t);
@@ -213,12 +214,12 @@ SYSCTL_UINT(_hw_cxgbe, OID_AUTO, interrupt_types, CTLFLAG_RDTUN, &intr_types, 0,
"interrupt types allowed (bits 0, 1, 2 = INTx, MSI, MSI-X respectively)");
/*
- * Force the driver to use interrupt forwarding.
+ * Force the driver to use the same set of interrupts for all ports.
*/
-static int intr_fwd = 0;
-TUNABLE_INT("hw.cxgbe.interrupt_forwarding", &intr_fwd);
-SYSCTL_UINT(_hw_cxgbe, OID_AUTO, interrupt_forwarding, CTLFLAG_RDTUN,
- &intr_fwd, 0, "always use forwarded interrupts");
+static int intr_shared = 0;
+TUNABLE_INT("hw.cxgbe.interrupts_shared", &intr_shared);
+SYSCTL_UINT(_hw_cxgbe, OID_AUTO, interrupts_shared, CTLFLAG_RDTUN,
+ &intr_shared, 0, "interrupts shared between all ports");
static unsigned int filter_mode = HW_TPL_FR_MT_PR_IV_P_FC;
TUNABLE_INT("hw.cxgbe.filter_mode", &filter_mode);
@@ -228,7 +229,7 @@ SYSCTL_UINT(_hw_cxgbe, OID_AUTO, filter_mode, CTLFLAG_RDTUN,
struct intrs_and_queues {
int intr_type; /* INTx, MSI, or MSI-X */
int nirq; /* Number of vectors */
- int intr_fwd; /* Interrupts forwarded */
+ int intr_shared; /* Interrupts shared between all ports */
int ntxq10g; /* # of NIC txq's for each 10G port */
int nrxq10g; /* # of NIC rxq's for each 10G port */
int ntxq1g; /* # of NIC txq's for each 1G port */
@@ -240,6 +241,7 @@ struct filter_entry {
uint32_t locked:1; /* filter is administratively locked */
uint32_t pending:1; /* filter action is pending firmware reply */
uint32_t smtidx:8; /* Source MAC Table index for smac */
+ struct l2t_entry *l2t; /* Layer Two Table entry for dmac */
struct t4_filter_specification fs;
};
@@ -269,6 +271,7 @@ static void setup_memwin(struct adapter *);
static int cfg_itype_and_nqueues(struct adapter *, int, int,
struct intrs_and_queues *);
static int prep_firmware(struct adapter *);
+static int get_devlog_params(struct adapter *, struct devlog_params *);
static int get_capabilities(struct adapter *, struct fw_caps_config_cmd *);
static int get_params(struct adapter *, struct fw_caps_config_cmd *);
static void t4_set_desc(struct adapter *);
@@ -295,19 +298,22 @@ static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS);
static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS);
static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS);
static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS);
+static int sysctl_devlog(SYSCTL_HANDLER_ARGS);
static inline void txq_start(struct ifnet *, struct sge_txq *);
static uint32_t fconf_to_mode(uint32_t);
static uint32_t mode_to_fconf(uint32_t);
static uint32_t fspec_to_fconf(struct t4_filter_specification *);
static int get_filter_mode(struct adapter *, uint32_t *);
static int set_filter_mode(struct adapter *, uint32_t);
+static inline uint64_t get_filter_hits(struct adapter *, uint32_t);
static int get_filter(struct adapter *, struct t4_filter *);
static int set_filter(struct adapter *, struct t4_filter *);
static int del_filter(struct adapter *, struct t4_filter *);
-static void clear_filter(struct adapter *, struct filter_entry *);
+static void clear_filter(struct filter_entry *);
static int set_filter_wr(struct adapter *, int);
static int del_filter_wr(struct adapter *, int);
void filter_rpl(struct adapter *, const struct cpl_set_tcb_rpl *);
+static int get_sge_context(struct adapter *, struct t4_sge_context *);
static int t4_mod_event(module_t, int, void *);
struct t4_pciids {
@@ -400,6 +406,9 @@ t4_attach(device_t dev)
if (rc != 0)
goto done; /* error message displayed already */
+ /* Read firmware devlog parameters */
+ (void) get_devlog_params(sc, &sc->params.devlog);
+
/* Get device capabilities and select which ones we'll use */
rc = get_capabilities(sc, &caps);
if (rc != 0) {
@@ -484,6 +493,8 @@ t4_attach(device_t dev)
V_RXTSHIFTMAXR2(15) | V_PERSHIFTBACKOFFMAX(8) | V_PERSHIFTMAX(8) |
V_KEEPALIVEMAXR1(4) | V_KEEPALIVEMAXR2(9));
t4_write_reg(sc, A_ULP_RX_TDDP_PSZ, V_HPZ0(PAGE_SHIFT - 12));
+ t4_set_reg_field(sc, A_TP_PARA_REG3, F_TUNNELCNGDROP0 |
+ F_TUNNELCNGDROP1 | F_TUNNELCNGDROP2 | F_TUNNELCNGDROP3, 0);
setup_memwin(sc);
@@ -514,8 +525,8 @@ t4_attach(device_t dev)
device_printf(dev, "unable to initialize port %d: %d\n",
i, rc);
free(pi, M_CXGBE);
- sc->port[i] = NULL; /* indicates init failed */
- continue;
+ sc->port[i] = NULL;
+ goto done;
}
snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d",
@@ -582,15 +593,15 @@ t4_attach(device_t dev)
s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g;
s->ntxq = n10g * iaq.ntxq10g + n1g * iaq.ntxq1g;
s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */
- s->neq += NCHAN; /* control queues, 1 per hw channel */
+ s->neq += sc->params.nports; /* control queues, 1 per port */
s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */
- if (iaq.intr_fwd) {
- sc->flags |= INTR_FWD;
- s->niq += NFIQ(sc); /* forwarded interrupt queues */
- s->fiq = malloc(NFIQ(sc) * sizeof(struct sge_iq), M_CXGBE,
- M_ZERO | M_WAITOK);
- }
- s->ctrlq = malloc(NCHAN * sizeof(struct sge_ctrlq), M_CXGBE,
+ if (iaq.intr_shared)
+ sc->flags |= INTR_SHARED;
+ s->niq += NINTRQ(sc); /* interrupt queues */
+
+ s->intrq = malloc(NINTRQ(sc) * sizeof(struct sge_iq), M_CXGBE,
+ M_ZERO | M_WAITOK);
+ s->ctrlq = malloc(sc->params.nports * sizeof(struct sge_ctrlq), M_CXGBE,
M_ZERO | M_WAITOK);
s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE,
M_ZERO | M_WAITOK);
@@ -604,6 +615,8 @@ t4_attach(device_t dev)
sc->irq = malloc(sc->intr_count * sizeof(struct irq), M_CXGBE,
M_ZERO | M_WAITOK);
+ sc->l2t = t4_init_l2t(M_WAITOK);
+
t4_sysctls(sc);
/*
@@ -691,11 +704,14 @@ t4_detach(device_t dev)
bus_release_resource(dev, SYS_RES_MEMORY, sc->msix_rid,
sc->msix_res);
+ if (sc->l2t)
+ t4_free_l2t(sc->l2t);
+
free(sc->irq, M_CXGBE);
free(sc->sge.rxq, M_CXGBE);
free(sc->sge.txq, M_CXGBE);
free(sc->sge.ctrlq, M_CXGBE);
- free(sc->sge.fiq, M_CXGBE);
+ free(sc->sge.intrq, M_CXGBE);
free(sc->sge.iqmap, M_CXGBE);
free(sc->sge.eqmap, M_CXGBE);
free(sc->tids.ftid_tab, M_CXGBE);
@@ -1231,33 +1247,32 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g,
nrxq10g = min(nc, max_nrxq_10g);
nrxq1g = min(nc, max_nrxq_1g);
- /* Extra 2 is for a) error interrupt b) firmware event */
- iaq->nirq = n10g * nrxq10g + n1g * nrxq1g + 2;
- if (iaq->nirq <= navail && intr_fwd == 0) {
+ iaq->nirq = n10g * nrxq10g + n1g * nrxq1g + T4_EXTRA_INTR;
+ if (iaq->nirq <= navail && intr_shared == 0) {
if (itype == INTR_MSI && !powerof2(iaq->nirq))
- goto fwd;
+ goto share;
/* One for err, one for fwq, and one for each rxq */
- iaq->intr_fwd = 0;
+ iaq->intr_shared = 0;
iaq->nrxq10g = nrxq10g;
iaq->nrxq1g = nrxq1g;
} else {
-fwd:
- iaq->intr_fwd = 1;
+share:
+ iaq->intr_shared = 1;
- if (navail > nc) {
+ if (navail >= nc + T4_EXTRA_INTR) {
if (itype == INTR_MSIX)
- navail = nc + 1;
+ navail = nc + T4_EXTRA_INTR;
/* navail is and must remain a pow2 for MSI */
if (itype == INTR_MSI) {
KASSERT(powerof2(navail),
("%d not power of 2", navail));
- while (navail / 2 > nc)
+ while (navail / 2 >= nc + T4_EXTRA_INTR)
navail /= 2;
}
}
@@ -1290,7 +1305,7 @@ fwd:
* the kernel is willing to allocate (it's in navail).
*/
pci_release_msi(sc->dev);
- goto fwd;
+ goto share;
}
device_printf(sc->dev,
@@ -1414,6 +1429,34 @@ prep_firmware(struct adapter *sc)
}
static int
+get_devlog_params(struct adapter *sc, struct devlog_params *dlog)
+{
+ struct fw_devlog_cmd devlog_cmd;
+ uint32_t meminfo;
+ int rc;
+
+ bzero(&devlog_cmd, sizeof(devlog_cmd));
+ devlog_cmd.op_to_write = htobe32(V_FW_CMD_OP(FW_DEVLOG_CMD) |
+ F_FW_CMD_REQUEST | F_FW_CMD_READ);
+ devlog_cmd.retval_len16 = htobe32(FW_LEN16(devlog_cmd));
+ rc = -t4_wr_mbox(sc, sc->mbox, &devlog_cmd, sizeof(devlog_cmd),
+ &devlog_cmd);
+ if (rc != 0) {
+ device_printf(sc->dev,
+ "failed to get devlog parameters: %d.\n", rc);
+ bzero(dlog, sizeof (*dlog));
+ return (rc);
+ }
+
+ meminfo = be32toh(devlog_cmd.memtype_devlog_memaddr16_devlog);
+ dlog->memtype = G_FW_DEVLOG_CMD_MEMTYPE_DEVLOG(meminfo);
+ dlog->start = G_FW_DEVLOG_CMD_MEMADDR16_DEVLOG(meminfo) << 4;
+ dlog->size = be32toh(devlog_cmd.memsize_devlog);
+
+ return (0);
+}
+
+static int
get_capabilities(struct adapter *sc, struct fw_caps_config_cmd *caps)
{
int rc;
@@ -1923,16 +1966,18 @@ cxgbe_uninit_synchronized(struct port_info *pi)
return (0);
}
-#define T4_ALLOC_IRQ(sc, irqid, rid, handler, arg, name) do { \
- rc = t4_alloc_irq(sc, &sc->irq[irqid], rid, handler, arg, name); \
+#define T4_ALLOC_IRQ(sc, irq, rid, handler, arg, name) do { \
+ rc = t4_alloc_irq(sc, irq, rid, handler, arg, name); \
if (rc != 0) \
goto done; \
} while (0)
static int
first_port_up(struct adapter *sc)
{
- int rc, i;
- char name[8];
+ int rc, i, rid, p, q;
+ char s[8];
+ struct irq *irq;
+ struct sge_iq *intrq;
ADAPTER_LOCK_ASSERT_NOTOWNED(sc);
@@ -1946,39 +1991,52 @@ first_port_up(struct adapter *sc)
/*
* Setup interrupts.
*/
+ irq = &sc->irq[0];
+ rid = sc->intr_type == INTR_INTX ? 0 : 1;
if (sc->intr_count == 1) {
- KASSERT(sc->flags & INTR_FWD,
- ("%s: single interrupt but not forwarded?", __func__));
- T4_ALLOC_IRQ(sc, 0, 0, t4_intr_all, sc, "all");
+ KASSERT(sc->flags & INTR_SHARED,
+ ("%s: single interrupt but not shared?", __func__));
+
+ T4_ALLOC_IRQ(sc, irq, rid, t4_intr_all, sc, "all");
} else {
/* Multiple interrupts. The first one is always error intr */
- T4_ALLOC_IRQ(sc, 0, 1, t4_intr_err, sc, "err");
-
- if (sc->flags & INTR_FWD) {
- /* The rest are shared by the fwq and all data intr */
- for (i = 1; i < sc->intr_count; i++) {
- snprintf(name, sizeof(name), "mux%d", i - 1);
- T4_ALLOC_IRQ(sc, i, i + 1, t4_intr_fwd,
- &sc->sge.fiq[i - 1], name);
+ T4_ALLOC_IRQ(sc, irq, rid, t4_intr_err, sc, "err");
+ irq++;
+ rid++;
+
+ /* Firmware event queue normally has an interrupt of its own */
+ if (sc->intr_count > T4_EXTRA_INTR) {
+ T4_ALLOC_IRQ(sc, irq, rid, t4_intr_evt, &sc->sge.fwq,
+ "evt");
+ irq++;
+ rid++;
+ }
+
+ intrq = &sc->sge.intrq[0];
+ if (sc->flags & INTR_SHARED) {
+
+ /* All ports share these interrupt queues */
+
+ for (i = 0; i < NINTRQ(sc); i++) {
+ snprintf(s, sizeof(s), "*.%d", i);
+ T4_ALLOC_IRQ(sc, irq, rid, t4_intr, intrq, s);
+ irq++;
+ rid++;
+ intrq++;
}
} else {
- struct port_info *pi;
- int p, q;
- T4_ALLOC_IRQ(sc, 1, 2, t4_intr_evt, &sc->sge.fwq,
- "evt");
+ /* Each port has its own set of interrupt queues */
- p = q = 0;
- pi = sc->port[p];
- for (i = 2; i < sc->intr_count; i++) {
- snprintf(name, sizeof(name), "p%dq%d", p, q);
- if (++q >= pi->nrxq) {
- p++;
- q = 0;
- pi = sc->port[p];
+ for (p = 0; p < sc->params.nports; p++) {
+ for (q = 0; q < sc->port[p]->nrxq; q++) {
+ snprintf(s, sizeof(s), "%d.%d", p, q);
+ T4_ALLOC_IRQ(sc, irq, rid, t4_intr,
+ intrq, s);
+ irq++;
+ rid++;
+ intrq++;
}
- T4_ALLOC_IRQ(sc, i, i + 1, t4_intr_data,
- &sc->sge.rxq[i - 2], name);
}
}
}
@@ -2366,6 +2424,10 @@ t4_sysctls(struct adapter *sc)
CTLTYPE_STRING | CTLFLAG_RD, &intr_pktcount, sizeof(intr_pktcount),
sysctl_int_array, "A", "interrupt holdoff packet counter values");
+ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "devlog",
+ CTLTYPE_STRING | CTLFLAG_RD, sc, 0,
+ sysctl_devlog, "A", "device log");
+
return (0);
}
@@ -2709,6 +2771,120 @@ sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS)
return (sysctl_handle_64(oidp, &val, 0, req));
}
+const char *devlog_level_strings[] = {
+ [FW_DEVLOG_LEVEL_EMERG] = "EMERG",
+ [FW_DEVLOG_LEVEL_CRIT] = "CRIT",
+ [FW_DEVLOG_LEVEL_ERR] = "ERR",
+ [FW_DEVLOG_LEVEL_NOTICE] = "NOTICE",
+ [FW_DEVLOG_LEVEL_INFO] = "INFO",
+ [FW_DEVLOG_LEVEL_DEBUG] = "DEBUG"
+};
+
+const char *devlog_facility_strings[] = {
+ [FW_DEVLOG_FACILITY_CORE] = "CORE",
+ [FW_DEVLOG_FACILITY_SCHED] = "SCHED",
+ [FW_DEVLOG_FACILITY_TIMER] = "TIMER",
+ [FW_DEVLOG_FACILITY_RES] = "RES",
+ [FW_DEVLOG_FACILITY_HW] = "HW",
+ [FW_DEVLOG_FACILITY_FLR] = "FLR",
+ [FW_DEVLOG_FACILITY_DMAQ] = "DMAQ",
+ [FW_DEVLOG_FACILITY_PHY] = "PHY",
+ [FW_DEVLOG_FACILITY_MAC] = "MAC",
+ [FW_DEVLOG_FACILITY_PORT] = "PORT",
+ [FW_DEVLOG_FACILITY_VI] = "VI",
+ [FW_DEVLOG_FACILITY_FILTER] = "FILTER",
+ [FW_DEVLOG_FACILITY_ACL] = "ACL",
+ [FW_DEVLOG_FACILITY_TM] = "TM",
+ [FW_DEVLOG_FACILITY_QFC] = "QFC",
+ [FW_DEVLOG_FACILITY_DCB] = "DCB",
+ [FW_DEVLOG_FACILITY_ETH] = "ETH",
+ [FW_DEVLOG_FACILITY_OFLD] = "OFLD",
+ [FW_DEVLOG_FACILITY_RI] = "RI",
+ [FW_DEVLOG_FACILITY_ISCSI] = "ISCSI",
+ [FW_DEVLOG_FACILITY_FCOE] = "FCOE",
+ [FW_DEVLOG_FACILITY_FOISCSI] = "FOISCSI",
+ [FW_DEVLOG_FACILITY_FOFCOE] = "FOFCOE"
+};
+
+static int
+sysctl_devlog(SYSCTL_HANDLER_ARGS)
+{
+ struct adapter *sc = arg1;
+ struct devlog_params *dparams = &sc->params.devlog;
+ struct fw_devlog_e *buf, *e;
+ int i, j, rc, nentries, first = 0;
+ struct sbuf *sb;
+ uint64_t ftstamp = UINT64_MAX;
+
+ if (dparams->start == 0)
+ return (ENXIO);
+
+ nentries = dparams->size / sizeof(struct fw_devlog_e);
+
+ buf = malloc(dparams->size, M_CXGBE, M_NOWAIT);
+ if (buf == NULL)
+ return (ENOMEM);
+
+ rc = -t4_mem_read(sc, dparams->memtype, dparams->start, dparams->size,
+ (void *)buf);
+ if (rc != 0)
+ goto done;
+
+ for (i = 0; i < nentries; i++) {
+ e = &buf[i];
+
+ if (e->timestamp == 0)
+ break; /* end */
+
+ e->timestamp = be64toh(e->timestamp);
+ e->seqno = be32toh(e->seqno);
+ for (j = 0; j < 8; j++)
+ e->params[j] = be32toh(e->params[j]);
+
+ if (e->timestamp < ftstamp) {
+ ftstamp = e->timestamp;
+ first = i;
+ }
+ }
+
+ if (buf[first].timestamp == 0)
+ goto done; /* nothing in the log */
+
+ rc = sysctl_wire_old_buffer(req, 0);
+ if (rc != 0)
+ goto done;
+
+ sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req);
+ sbuf_printf(sb, "\n%10s %15s %8s %8s %s\n",
+ "Seq#", "Tstamp", "Level", "Facility", "Message");
+
+ i = first;
+ do {
+ e = &buf[i];
+ if (e->timestamp == 0)
+ break; /* end */
+
+ sbuf_printf(sb, "%10d %15ju %8s %8s ",
+ e->seqno, e->timestamp,
+ (e->level < ARRAY_SIZE(devlog_level_strings) ?
+ devlog_level_strings[e->level] : "UNKNOWN"),
+ (e->facility < ARRAY_SIZE(devlog_facility_strings) ?
+ devlog_facility_strings[e->facility] : "UNKNOWN"));
+ sbuf_printf(sb, e->fmt, e->params[0], e->params[1],
+ e->params[2], e->params[3], e->params[4],
+ e->params[5], e->params[6], e->params[7]);
+
+ if (++i == nentries)
+ i = 0;
+ } while (i != first);
+
+ rc = sbuf_finish(sb);
+ sbuf_delete(sb);
+done:
+ free(buf, M_CXGBE);
+ return (rc);
+}
+
static inline void
txq_start(struct ifnet *ifp, struct sge_txq *txq)
{
@@ -2892,6 +3068,20 @@ done:
return (rc);
}
+static inline uint64_t
+get_filter_hits(struct adapter *sc, uint32_t fid)
+{
+ uint32_t tcb_base = t4_read_reg(sc, A_TP_CMM_TCB_BASE);
+ uint64_t hits;
+
+ t4_write_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 0),
+ tcb_base + (fid + sc->tids.ftid_base) * TCB_SIZE);
+ t4_read_reg(sc, PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 0));
+ hits = t4_read_reg64(sc, MEMWIN0_BASE + 16);
+
+ return (be64toh(hits));
+}
+
static int
get_filter(struct adapter *sc, struct t4_filter *t)
{
@@ -2913,8 +3103,13 @@ get_filter(struct adapter *sc, struct t4_filter *t)
for (i = t->idx; i < nfilters; i++, f++) {
if (f->valid) {
t->idx = i;
+ t->l2tidx = f->l2t ? f->l2t->idx : 0;
+ t->smtidx = f->smtidx;
+ if (f->fs.hitcnts)
+ t->hits = get_filter_hits(sc, t->idx);
+ else
+ t->hits = UINT64_MAX;
t->fs = f->fs;
- t->hits = 0; /* XXX implement */
return (0);
}
@@ -3034,11 +3229,12 @@ del_filter(struct adapter *sc, struct t4_filter *t)
return (0);
}
-/* XXX: L2T */
static void
-clear_filter(struct adapter *sc, struct filter_entry *f)
+clear_filter(struct filter_entry *f)
{
- (void) sc;
+ if (f->l2t)
+ t4_l2t_release(f->l2t);
+
bzero(f, sizeof (*f));
}
@@ -3053,8 +3249,18 @@ set_filter_wr(struct adapter *sc, int fidx)
ADAPTER_LOCK_ASSERT_OWNED(sc);
- if (f->fs.newdmac || f->fs.newvlan)
- return (ENOTSUP); /* XXX: fix after L2T code */
+ if (f->fs.newdmac || f->fs.newvlan) {
+ /* This filter needs an L2T entry; allocate one. */
+ f->l2t = t4_l2t_alloc_switching(sc->l2t);
+ if (f->l2t == NULL)
+ return (EAGAIN);
+ if (t4_l2t_set_switching(sc, f->l2t, f->fs.vlan, f->fs.eport,
+ f->fs.dmac)) {
+ t4_l2t_release(f->l2t);
+ f->l2t = NULL;
+ return (ENOMEM);
+ }
+ }
ftid = sc->tids.ftid_base + fidx;
@@ -3089,7 +3295,7 @@ set_filter_wr(struct adapter *sc, int fidx)
V_FW_FILTER_WR_HITCNTS(f->fs.hitcnts) |
V_FW_FILTER_WR_TXCHAN(f->fs.eport) |
V_FW_FILTER_WR_PRIO(f->fs.prio) |
- V_FW_FILTER_WR_L2TIX(0)); /* XXX: L2T */
+ V_FW_FILTER_WR_L2TIX(f->l2t ? f->l2t->idx : 0));
fwr->ethtype = htobe16(f->fs.val.ethtype);
fwr->ethtypem = htobe16(f->fs.mask.ethtype);
fwr->frag_to_ovlan_vldm =
@@ -3101,7 +3307,7 @@ set_filter_wr(struct adapter *sc, int fidx)
V_FW_FILTER_WR_OVLAN_VLDM(f->fs.mask.ovlan_vld));
fwr->smac_sel = 0;
fwr->rx_chan_rx_rpl_iq = htobe16(V_FW_FILTER_WR_RX_CHAN(0) |
- V_FW_FILTER_WR_RX_RPL_IQ(sc->sge.fwq.abs_id));
+ V_FW_FILTER_WR_RX_RPL_IQ(sc->sge.intrq[0].abs_id));
fwr->maci_to_matchtypem =
htobe32(V_FW_FILTER_WR_MACI(f->fs.val.macidx) |
V_FW_FILTER_WR_MACIM(f->fs.mask.macidx) |
@@ -3136,7 +3342,7 @@ set_filter_wr(struct adapter *sc, int fidx)
if (rc != 0) {
sc->tids.ftids_in_use--;
m_freem(m);
- clear_filter(sc, f);
+ clear_filter(f);
}
return (rc);
}
@@ -3161,7 +3367,7 @@ del_filter_wr(struct adapter *sc, int fidx)
m->m_len = m->m_pkthdr.len = sizeof(*fwr);
bzero(fwr, sizeof (*fwr));
- t4_mk_filtdelwr(ftid, fwr, sc->sge.fwq.abs_id);
+ t4_mk_filtdelwr(ftid, fwr, sc->sge.intrq[0].abs_id);
f->pending = 1;
rc = t4_mgmt_tx(sc, m);
@@ -3188,12 +3394,12 @@ filter_rpl(struct adapter *sc, const struct cpl_set_tcb_rpl *rpl)
* Clear the filter when we get confirmation from the
* hardware that the filter has been deleted.
*/
- clear_filter(sc, f);
+ clear_filter(f);
sc->tids.ftids_in_use--;
} else if (rc == FW_FILTER_WR_SMT_TBL_FULL) {
device_printf(sc->dev,
"filter %u setup failed due to full SMT\n", idx);
- clear_filter(sc, f);
+ clear_filter(f);
sc->tids.ftids_in_use--;
} else if (rc == FW_FILTER_WR_FLT_ADDED) {
f->smtidx = (be64toh(rpl->oldval) >> 24) & 0xff;
@@ -3206,12 +3412,41 @@ filter_rpl(struct adapter *sc, const struct cpl_set_tcb_rpl *rpl)
*/
device_printf(sc->dev,
"filter %u setup failed with error %u\n", idx, rc);
- clear_filter(sc, f);
+ clear_filter(f);
sc->tids.ftids_in_use--;
}
}
}
+static int
+get_sge_context(struct adapter *sc, struct t4_sge_context *cntxt)
+{
+ int rc = EINVAL;
+
+ if (cntxt->cid > M_CTXTQID)
+ return (rc);
+
+ if (cntxt->mem_id != CTXT_EGRESS && cntxt->mem_id != CTXT_INGRESS &&
+ cntxt->mem_id != CTXT_FLM && cntxt->mem_id != CTXT_CNM)
+ return (rc);
+
+ if (sc->flags & FW_OK) {
+ ADAPTER_LOCK(sc); /* Avoid parallel t4_wr_mbox */
+ rc = -t4_sge_ctxt_rd(sc, sc->mbox, cntxt->cid, cntxt->mem_id,
+ &cntxt->data[0]);
+ ADAPTER_UNLOCK(sc);
+ }
+
+ if (rc != 0) {
+ /* Read via firmware failed or wasn't even attempted */
+
+ rc = -t4_sge_ctxt_rd_bd(sc, cntxt->cid, cntxt->mem_id,
+ &cntxt->data[0]);
+ }
+
+ return (rc);
+}
+
int
t4_os_find_pci_capability(struct adapter *sc, int cap)
{
@@ -3375,6 +3610,9 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
rc = del_filter(sc, (struct t4_filter *)data);
ADAPTER_UNLOCK(sc);
break;
+ case CHELSIO_T4_GET_SGE_CONTEXT:
+ rc = get_sge_context(sc, (struct t4_sge_context *)data);
+ break;
default:
rc = EINVAL;
}
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index a0ef172..b676799 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -91,6 +91,8 @@ struct sgl {
bus_dma_segment_t seg[TX_SGL_SEGS];
};
+static void t4_evt_rx(void *);
+static void t4_eth_rx(void *);
static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int,
int, iq_intr_handler_t *, char *);
static inline void init_fl(struct sge_fl *, int, char *);
@@ -102,8 +104,10 @@ static int free_ring(struct adapter *, bus_dma_tag_t, bus_dmamap_t, bus_addr_t,
static int alloc_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *,
int, int);
static int free_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *);
-static int alloc_iq(struct sge_iq *, int);
-static int free_iq(struct sge_iq *);
+static int alloc_intrq(struct adapter *, int, int, int);
+static int free_intrq(struct sge_iq *);
+static int alloc_fwq(struct adapter *, int);
+static int free_fwq(struct sge_iq *);
static int alloc_rxq(struct port_info *, struct sge_rxq *, int, int);
static int free_rxq(struct port_info *, struct sge_rxq *);
static int alloc_ctrlq(struct adapter *, struct sge_ctrlq *, int);
@@ -139,9 +143,10 @@ static void write_eqflush_wr(struct sge_eq *);
static __be64 get_flit(bus_dma_segment_t *, int, int);
static int handle_sge_egr_update(struct adapter *,
const struct cpl_sge_egr_update *);
+static void handle_cpl(struct adapter *, struct sge_iq *);
static int ctrl_tx(struct adapter *, struct sge_ctrlq *, struct mbuf *);
-static int sysctl_abs_id(SYSCTL_HANDLER_ARGS);
+static int sysctl_uint16(SYSCTL_HANDLER_ARGS);
extern void filter_rpl(struct adapter *, const struct cpl_set_tcb_rpl *);
@@ -198,6 +203,9 @@ t4_sge_init(struct adapter *sc)
FL_BUF_SIZE(i));
}
+ i = t4_read_reg(sc, A_SGE_CONM_CTRL);
+ s->fl_starve_threshold = G_EGRTHRESHOLD(i) * 2 + 1;
+
t4_write_reg(sc, A_SGE_INGRESS_RX_THRESHOLD,
V_THRESHOLD_0(s->counter_val[0]) |
V_THRESHOLD_1(s->counter_val[1]) |
@@ -243,8 +251,7 @@ t4_destroy_dma_tag(struct adapter *sc)
/*
* Allocate and initialize the firmware event queue, control queues, and the
- * forwarded interrupt queues (if any). The adapter owns all these queues as
- * they are not associated with any particular port.
+ * interrupt queues. The adapter owns all of these queues.
*
* Returns errno on failure. Resources allocated up to that point may still be
* allocated. Caller is responsible for cleanup in case this function fails.
@@ -252,8 +259,8 @@ t4_destroy_dma_tag(struct adapter *sc)
int
t4_setup_adapter_queues(struct adapter *sc)
{
- int i, rc;
- struct sge_iq *iq, *fwq;
+ int i, j, rc, intr_idx, qsize;
+ struct sge_iq *iq;
struct sge_ctrlq *ctrlq;
iq_intr_handler_t *handler;
char name[16];
@@ -264,47 +271,76 @@ t4_setup_adapter_queues(struct adapter *sc)
struct sysctl_oid *oid = device_get_sysctl_tree(sc->dev);
struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid);
+ sc->oid_fwq = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO,
+ "fwq", CTLFLAG_RD, NULL, "firmware event queue");
sc->oid_ctrlq = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO,
"ctrlq", CTLFLAG_RD, NULL, "ctrl queues");
+ sc->oid_intrq = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO,
+ "intrq", CTLFLAG_RD, NULL, "interrupt queues");
}
- fwq = &sc->sge.fwq;
- if (sc->flags & INTR_FWD) {
- iq = &sc->sge.fiq[0];
-
- /*
- * Forwarded interrupt queues - allocate 1 if there's only 1
- * vector available, one less than the number of vectors
- * otherwise (the first vector is reserved for the error
- * interrupt in that case).
- */
- i = sc->intr_count > 1 ? 1 : 0;
- for (; i < sc->intr_count; i++, iq++) {
-
- snprintf(name, sizeof(name), "%s fiq%d",
+ /*
+ * Interrupt queues
+ */
+ intr_idx = sc->intr_count - NINTRQ(sc);
+ if (sc->flags & INTR_SHARED) {
+ qsize = max((sc->sge.nrxq + 1) * 2, INTR_IQ_QSIZE);
+ for (i = 0; i < NINTRQ(sc); i++, intr_idx++) {
+ snprintf(name, sizeof(name), "%s intrq%d",
device_get_nameunit(sc->dev), i);
- init_iq(iq, sc, 0, 0, (sc->sge.nrxq + 1) * 2, 16, NULL,
- name);
- rc = alloc_iq(iq, i);
+ iq = &sc->sge.intrq[i];
+ init_iq(iq, sc, 0, 0, qsize, INTR_IQ_ESIZE, NULL, name);
+ rc = alloc_intrq(sc, i % sc->params.nports, i,
+ intr_idx);
+
if (rc != 0) {
device_printf(sc->dev,
- "failed to create fwd intr queue %d: %d\n",
- i, rc);
+ "failed to create %s: %d\n", name, rc);
return (rc);
}
}
-
- handler = t4_evt_rx;
- i = 0; /* forward fwq's interrupt to the first fiq */
} else {
- handler = NULL;
- i = 1; /* fwq should use vector 1 (0 is used by error) */
+ int qidx = 0;
+ struct port_info *pi;
+
+ for (i = 0; i < sc->params.nports; i++) {
+ pi = sc->port[i];
+ qsize = max((pi->nrxq + 1) * 2, INTR_IQ_QSIZE);
+ for (j = 0; j < pi->nrxq; j++, qidx++, intr_idx++) {
+ snprintf(name, sizeof(name), "%s intrq%d",
+ device_get_nameunit(pi->dev), j);
+
+ iq = &sc->sge.intrq[qidx];
+ init_iq(iq, sc, 0, 0, qsize, INTR_IQ_ESIZE,
+ NULL, name);
+ rc = alloc_intrq(sc, i, qidx, intr_idx);
+
+ if (rc != 0) {
+ device_printf(sc->dev,
+ "failed to create %s: %d\n",
+ name, rc);
+ return (rc);
+ }
+ }
+ }
}
+ /*
+ * Firmware event queue
+ */
snprintf(name, sizeof(name), "%s fwq", device_get_nameunit(sc->dev));
- init_iq(fwq, sc, 0, 0, FW_IQ_QSIZE, FW_IQ_ESIZE, handler, name);
- rc = alloc_iq(fwq, i);
+ if (sc->intr_count > T4_EXTRA_INTR) {
+ handler = NULL;
+ intr_idx = 1;
+ } else {
+ handler = t4_evt_rx;
+ intr_idx = 0;
+ }
+
+ iq = &sc->sge.fwq;
+ init_iq(iq, sc, 0, 0, FW_IQ_QSIZE, FW_IQ_ESIZE, handler, name);
+ rc = alloc_fwq(sc, intr_idx);
if (rc != 0) {
device_printf(sc->dev,
"failed to create firmware event queue: %d\n", rc);
@@ -313,10 +349,10 @@ t4_setup_adapter_queues(struct adapter *sc)
}
/*
- * Control queues - one per hardware channel.
+ * Control queues - one per port.
*/
ctrlq = &sc->sge.ctrlq[0];
- for (i = 0; i < NCHAN; i++, ctrlq++) {
+ for (i = 0; i < sc->params.nports; i++, ctrlq++) {
snprintf(name, sizeof(name), "%s ctrlq%d",
device_get_nameunit(sc->dev), i);
init_eq(&ctrlq->eq, CTRL_EQ_QSIZE, name);
@@ -344,21 +380,22 @@ t4_teardown_adapter_queues(struct adapter *sc)
ADAPTER_LOCK_ASSERT_NOTOWNED(sc);
/* Do this before freeing the queues */
- if (sc->oid_ctrlq) {
+ if (sc->oid_fwq || sc->oid_ctrlq || sc->oid_intrq) {
sysctl_ctx_free(&sc->ctx);
+ sc->oid_fwq = NULL;
sc->oid_ctrlq = NULL;
+ sc->oid_intrq = NULL;
}
- for (i = 0; i < NCHAN; i++)
+ for (i = 0; i < sc->params.nports; i++)
free_ctrlq(sc, &sc->sge.ctrlq[i]);
iq = &sc->sge.fwq;
- free_iq(iq);
- if (sc->flags & INTR_FWD) {
- for (i = 0; i < NFIQ(sc); i++) {
- iq = &sc->sge.fiq[i];
- free_iq(iq);
- }
+ free_fwq(iq);
+
+ for (i = 0; i < NINTRQ(sc); i++) {
+ iq = &sc->sge.intrq[i];
+ free_intrq(iq);
}
return (0);
@@ -388,23 +425,19 @@ t4_setup_eth_queues(struct port_info *pi)
snprintf(name, sizeof(name), "%s rxq%d-iq",
device_get_nameunit(pi->dev), i);
init_iq(&rxq->iq, sc, pi->tmr_idx, pi->pktc_idx,
- pi->qsize_rxq, RX_IQ_ESIZE,
- sc->flags & INTR_FWD ? t4_eth_rx : NULL, name);
+ pi->qsize_rxq, RX_IQ_ESIZE, t4_eth_rx, name);
snprintf(name, sizeof(name), "%s rxq%d-fl",
device_get_nameunit(pi->dev), i);
init_fl(&rxq->fl, pi->qsize_rxq / 8, name);
- if (sc->flags & INTR_FWD)
- intr_idx = (pi->first_rxq + i) % NFIQ(sc);
- else
- intr_idx = pi->first_rxq + i + 2;
+ intr_idx = pi->first_rxq + i;
+ if (sc->flags & INTR_SHARED)
+ intr_idx %= NINTRQ(sc);
rc = alloc_rxq(pi, rxq, intr_idx, i);
if (rc != 0)
goto done;
-
- intr_idx++;
}
for_each_txq(pi, i, txq) {
@@ -452,25 +485,26 @@ t4_teardown_eth_queues(struct port_info *pi)
return (0);
}
-/* Deals with errors and forwarded interrupts */
+/* Deals with errors and the first (and only) interrupt queue */
void
t4_intr_all(void *arg)
{
struct adapter *sc = arg;
t4_intr_err(arg);
- t4_intr_fwd(&sc->sge.fiq[0]);
+ t4_intr(&sc->sge.intrq[0]);
}
-/* Deals with forwarded interrupts on the given ingress queue */
+/* Deals with interrupts, and a few CPLs, on the given interrupt queue */
void
-t4_intr_fwd(void *arg)
+t4_intr(void *arg)
{
struct sge_iq *iq = arg, *q;
struct adapter *sc = iq->adapter;
struct rsp_ctrl *ctrl;
+ const struct rss_header *rss;
int ndesc_pending = 0, ndesc_total = 0;
- int qid;
+ int qid, rsp_type;
if (!atomic_cmpset_32(&iq->state, IQS_IDLE, IQS_BUSY))
return;
@@ -479,17 +513,23 @@ t4_intr_fwd(void *arg)
rmb();
- /* Only interrupt muxing expected on this queue */
- KASSERT(G_RSPD_TYPE(ctrl->u.type_gen) == X_RSPD_TYPE_INTR,
- ("unexpected event on forwarded interrupt queue: %x",
- G_RSPD_TYPE(ctrl->u.type_gen)));
+ rss = (const void *)iq->cdesc;
+ rsp_type = G_RSPD_TYPE(ctrl->u.type_gen);
+
+ if (__predict_false(rsp_type == X_RSPD_TYPE_CPL)) {
+ handle_cpl(sc, iq);
+ goto nextdesc;
+ }
qid = ntohl(ctrl->pldbuflen_qid) - sc->sge.iq_start;
q = sc->sge.iqmap[qid];
- q->handler(q);
+ if (atomic_cmpset_32(&q->state, IQS_IDLE, IQS_BUSY)) {
+ q->handler(q);
+ atomic_cmpset_32(&q->state, IQS_BUSY, IQS_IDLE);
+ }
- ndesc_total++;
+nextdesc: ndesc_total++;
if (++ndesc_pending >= iq->qsize / 4) {
t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
V_CIDXINC(ndesc_pending) |
@@ -514,9 +554,7 @@ t4_intr_err(void *arg)
{
struct adapter *sc = arg;
- if (sc->intr_type == INTR_INTX)
- t4_write_reg(sc, MYPF_REG(A_PCIE_PF_CLI), 0);
-
+ t4_write_reg(sc, MYPF_REG(A_PCIE_PF_CLI), 0);
t4_slow_intr_handler(sc);
}
@@ -526,70 +564,32 @@ t4_intr_evt(void *arg)
{
struct sge_iq *iq = arg;
- if (!atomic_cmpset_32(&iq->state, IQS_IDLE, IQS_BUSY))
- return;
-
- t4_evt_rx(arg);
-
- atomic_cmpset_32(&iq->state, IQS_BUSY, IQS_IDLE);
-}
-
-void
-t4_intr_data(void *arg)
-{
- struct sge_iq *iq = arg;
-
- if (!atomic_cmpset_32(&iq->state, IQS_IDLE, IQS_BUSY))
- return;
-
- t4_eth_rx(arg);
-
- atomic_cmpset_32(&iq->state, IQS_BUSY, IQS_IDLE);
+ if (atomic_cmpset_32(&iq->state, IQS_IDLE, IQS_BUSY)) {
+ t4_evt_rx(arg);
+ atomic_cmpset_32(&iq->state, IQS_BUSY, IQS_IDLE);
+ }
}
-void
+static void
t4_evt_rx(void *arg)
{
struct sge_iq *iq = arg;
struct adapter *sc = iq->adapter;
struct rsp_ctrl *ctrl;
- const struct rss_header *rss;
int ndesc_pending = 0, ndesc_total = 0;
KASSERT(iq == &sc->sge.fwq, ("%s: unexpected ingress queue", __func__));
while (is_new_response(iq, &ctrl)) {
+ int rsp_type;
rmb();
- rss = (const void *)iq->cdesc;
-
- /* Should only get CPL on this queue */
- KASSERT(G_RSPD_TYPE(ctrl->u.type_gen) == X_RSPD_TYPE_CPL,
- ("%s: unexpected type %d", __func__,
- G_RSPD_TYPE(ctrl->u.type_gen)));
+ rsp_type = G_RSPD_TYPE(ctrl->u.type_gen);
+ if (__predict_false(rsp_type != X_RSPD_TYPE_CPL))
+ panic("%s: unexpected rsp_type %d", __func__, rsp_type);
- switch (rss->opcode) {
- case CPL_FW4_MSG:
- case CPL_FW6_MSG: {
- const struct cpl_fw6_msg *cpl;
-
- cpl = (const void *)(rss + 1);
- if (cpl->type == FW6_TYPE_CMD_RPL)
- t4_handle_fw_rpl(sc, cpl->data);
-
- break;
- }
- case CPL_SGE_EGR_UPDATE:
- handle_sge_egr_update(sc, (const void *)(rss + 1));
- break;
- case CPL_SET_TCB_RPL:
- filter_rpl(sc, (const void *) (rss + 1));
- break;
- default:
- device_printf(sc->dev,
- "can't handle CPL opcode %d.", rss->opcode);
- }
+ handle_cpl(sc, iq);
ndesc_total++;
if (++ndesc_pending >= iq->qsize / 4) {
@@ -600,6 +600,7 @@ t4_evt_rx(void *arg)
V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX)));
ndesc_pending = 0;
}
+
iq_next(iq);
}
@@ -613,7 +614,7 @@ t4_evt_rx(void *arg)
#define RX_COPY_THRESHOLD MINCLSIZE
#endif
-void
+static void
t4_eth_rx(void *arg)
{
struct sge_rxq *rxq = arg;
@@ -644,17 +645,9 @@ t4_eth_rx(void *arg)
rss = (const void *)iq->cdesc;
i = G_RSPD_TYPE(ctrl->u.type_gen);
- if (__predict_false(i == X_RSPD_TYPE_CPL)) {
-
- /* Can't be anything except an egress update */
- KASSERT(rss->opcode == CPL_SGE_EGR_UPDATE,
- ("%s: unexpected CPL %x", __func__, rss->opcode));
-
- handle_sge_egr_update(sc, (const void *)(rss + 1));
- goto nextdesc;
- }
KASSERT(i == X_RSPD_TYPE_FLBUF && rss->opcode == CPL_RX_PKT,
- ("%s: unexpected CPL %x rsp %d", __func__, rss->opcode, i));
+ ("%s: unexpected type %d CPL opcode 0x%x",
+ __func__, i, rss->opcode));
sd_next = sd + 1;
if (__predict_false(fl->cidx + 1 == fl->cap))
@@ -786,16 +779,15 @@ t4_eth_rx(void *arg)
refill_fl(sc, fl, 64, 32);
FL_UNLOCK(fl);
-nextdesc: ndescs++;
- iq_next(iq);
-
- if (ndescs > 32) {
+ if (++ndescs > 32) {
t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
V_CIDXINC(ndescs) |
V_INGRESSQID((u32)iq->cntxt_id) |
V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX)));
ndescs = 0;
}
+
+ iq_next(iq);
}
#ifdef INET
@@ -1008,7 +1000,7 @@ t4_update_fl_bufsize(struct ifnet *ifp)
/*
* A non-NULL handler indicates this iq will not receive direct interrupts, the
- * handler will be invoked by a forwarded interrupt queue.
+ * handler will be invoked by an interrupt queue.
*/
static inline void
init_iq(struct sge_iq *iq, struct adapter *sc, int tmr_idx, int pktc_idx,
@@ -1100,7 +1092,7 @@ free_ring(struct adapter *sc, bus_dma_tag_t tag, bus_dmamap_t map,
*
* If the ingress queue will take interrupts directly (iq->handler == NULL) then
* the intr_idx specifies the vector, starting from 0. Otherwise it specifies
- * the index of the queue to which its interrupts will be forwarded.
+ * the index of the interrupt queue to which its interrupts will be forwarded.
*/
static int
alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
@@ -1112,10 +1104,6 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
struct adapter *sc = iq->adapter;
__be32 v = 0;
- /* The adapter queues are nominally allocated in port[0]'s name */
- if (pi == NULL)
- pi = sc->port[0];
-
len = iq->qsize * iq->esize;
rc = alloc_ring(sc, len, &iq->desc_tag, &iq->desc_map, &iq->ba,
(void **)&iq->desc);
@@ -1135,10 +1123,10 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
v |= F_FW_IQ_CMD_IQASYNCH;
if (iq->handler) {
- KASSERT(intr_idx < NFIQ(sc),
+ KASSERT(intr_idx < NINTRQ(sc),
("%s: invalid indirect intr_idx %d", __func__, intr_idx));
v |= F_FW_IQ_CMD_IQANDST;
- v |= V_FW_IQ_CMD_IQANDSTINDEX(sc->sge.fiq[intr_idx].abs_id);
+ v |= V_FW_IQ_CMD_IQANDSTINDEX(sc->sge.intrq[intr_idx].abs_id);
} else {
KASSERT(intr_idx < sc->intr_count,
("%s: invalid direct intr_idx %d", __func__, intr_idx));
@@ -1248,7 +1236,8 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
sc->sge.eqmap[cntxt_id] = (void *)fl;
FL_LOCK(fl);
- refill_fl(sc, fl, -1, 8);
+ /* Just enough to make sure it doesn't starve right away. */
+ refill_fl(sc, fl, roundup(sc->sge.fl_starve_threshold, 8), 8);
FL_UNLOCK(fl);
}
@@ -1333,13 +1322,67 @@ free_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl)
}
static int
-alloc_iq(struct sge_iq *iq, int intr_idx)
+alloc_intrq(struct adapter *sc, int port_idx, int intrq_idx, int intr_idx)
+{
+ int rc;
+ struct sysctl_oid *oid;
+ struct sysctl_oid_list *children;
+ char name[16];
+ struct sge_iq *intrq = &sc->sge.intrq[intrq_idx];
+
+ rc = alloc_iq_fl(sc->port[port_idx], intrq, NULL, intr_idx, -1);
+ if (rc != 0)
+ return (rc);
+
+ children = SYSCTL_CHILDREN(sc->oid_intrq);
+
+ snprintf(name, sizeof(name), "%d", intrq_idx);
+ oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, name, CTLFLAG_RD,
+ NULL, "interrupt queue");
+ children = SYSCTL_CHILDREN(oid);
+
+ SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "cidx",
+ CTLTYPE_INT | CTLFLAG_RD, &intrq->cidx, 0, sysctl_uint16, "I",
+ "consumer index");
+
+ return (rc);
+}
+
+static int
+free_intrq(struct sge_iq *iq)
+{
+ return free_iq_fl(NULL, iq, NULL);
+
+}
+
+static int
+alloc_fwq(struct adapter *sc, int intr_idx)
{
- return alloc_iq_fl(NULL, iq, NULL, intr_idx, -1);
+ int rc;
+ struct sysctl_oid_list *children;
+ struct sge_iq *fwq = &sc->sge.fwq;
+
+ rc = alloc_iq_fl(sc->port[0], fwq, NULL, intr_idx, -1);
+ if (rc != 0)
+ return (rc);
+
+ children = SYSCTL_CHILDREN(sc->oid_fwq);
+
+ SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "abs_id",
+ CTLTYPE_INT | CTLFLAG_RD, &fwq->abs_id, 0, sysctl_uint16, "I",
+ "absolute id of the queue");
+ SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "cntxt_id",
+ CTLTYPE_INT | CTLFLAG_RD, &fwq->cntxt_id, 0, sysctl_uint16, "I",
+ "SGE context id of the queue");
+ SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "cidx",
+ CTLTYPE_INT | CTLFLAG_RD, &fwq->cidx, 0, sysctl_uint16, "I",
+ "consumer index");
+
+ return (rc);
}
static int
-free_iq(struct sge_iq *iq)
+free_fwq(struct sge_iq *iq)
{
return free_iq_fl(NULL, iq, NULL);
}
@@ -1356,6 +1399,10 @@ alloc_rxq(struct port_info *pi, struct sge_rxq *rxq, int intr_idx, int idx)
if (rc != 0)
return (rc);
+ FL_LOCK(&rxq->fl);
+ refill_fl(pi->adapter, &rxq->fl, rxq->fl.needed / 8, 8);
+ FL_UNLOCK(&rxq->fl);
+
#ifdef INET
rc = tcp_lro_init(&rxq->lro);
if (rc != 0)
@@ -1375,8 +1422,14 @@ alloc_rxq(struct port_info *pi, struct sge_rxq *rxq, int intr_idx, int idx)
children = SYSCTL_CHILDREN(oid);
SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "abs_id",
- CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.abs_id, 0, sysctl_abs_id, "I",
+ CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.abs_id, 0, sysctl_uint16, "I",
"absolute id of the queue");
+ SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cntxt_id",
+ CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.cntxt_id, 0, sysctl_uint16, "I",
+ "SGE context id of the queue");
+ SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cidx",
+ CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.cidx, 0, sysctl_uint16, "I",
+ "consumer index");
#ifdef INET
SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_queued", CTLFLAG_RD,
&rxq->lro.lro_queued, 0, NULL);
@@ -1389,6 +1442,19 @@ alloc_rxq(struct port_info *pi, struct sge_rxq *rxq, int intr_idx, int idx)
CTLFLAG_RD, &rxq->vlan_extraction,
"# of times hardware extracted 802.1Q tag");
+ children = SYSCTL_CHILDREN(oid);
+ oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "fl", CTLFLAG_RD,
+ NULL, "freelist");
+ children = SYSCTL_CHILDREN(oid);
+
+ SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cntxt_id",
+ CTLTYPE_INT | CTLFLAG_RD, &rxq->fl.cntxt_id, 0, sysctl_uint16, "I",
+ "SGE context id of the queue");
+ SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "cidx", CTLFLAG_RD,
+ &rxq->fl.cidx, 0, "consumer index");
+ SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "pidx", CTLFLAG_RD,
+ &rxq->fl.pidx, 0, "producer index");
+
return (rc);
}
@@ -1433,7 +1499,10 @@ alloc_ctrlq(struct adapter *sc, struct sge_ctrlq *ctrlq, int idx)
eq->cap = eq->qsize - SPG_LEN / CTRL_EQ_ESIZE;
eq->spg = (void *)&eq->desc[eq->cap];
eq->avail = eq->cap - 1; /* one less to avoid cidx = pidx */
- eq->iqid = sc->sge.fwq.cntxt_id;
+ if (sc->flags & INTR_SHARED)
+ eq->iqid = sc->sge.intrq[idx % NINTRQ(sc)].cntxt_id;
+ else
+ eq->iqid = sc->sge.intrq[sc->port[idx]->first_rxq].cntxt_id;
bzero(&c, sizeof(c));
@@ -1446,8 +1515,8 @@ alloc_ctrlq(struct adapter *sc, struct sge_ctrlq *ctrlq, int idx)
c.physeqid_pkd = htobe32(0);
c.fetchszm_to_iqid =
htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
- V_FW_EQ_CTRL_CMD_PCIECHN(idx) | F_FW_EQ_CTRL_CMD_FETCHRO |
- V_FW_EQ_CTRL_CMD_IQID(eq->iqid));
+ V_FW_EQ_CTRL_CMD_PCIECHN(sc->port[idx]->tx_chan) |
+ F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid));
c.dcaen_to_eqsize =
htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
@@ -1479,13 +1548,12 @@ alloc_ctrlq(struct adapter *sc, struct sge_ctrlq *ctrlq, int idx)
NULL, "ctrl queue");
children = SYSCTL_CHILDREN(oid);
- SYSCTL_ADD_UQUAD(&sc->ctx, children, OID_AUTO, "total_wrs", CTLFLAG_RD,
- &ctrlq->total_wrs, "total # of work requests");
+ SYSCTL_ADD_PROC(&sc->ctx, children, OID_AUTO, "pidx",
+ CTLTYPE_INT | CTLFLAG_RD, &ctrlq->eq.pidx, 0, sysctl_uint16, "I",
+ "producer index");
SYSCTL_ADD_UINT(&sc->ctx, children, OID_AUTO, "no_desc", CTLFLAG_RD,
&ctrlq->no_desc, 0,
"# of times ctrlq ran out of hardware descriptors");
- SYSCTL_ADD_UINT(&sc->ctx, children, OID_AUTO, "too_long", CTLFLAG_RD,
- &ctrlq->too_long, 0, "# of oversized work requests");
return (rc);
}
@@ -1526,6 +1594,7 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx)
char name[16];
struct sysctl_oid *oid;
struct sysctl_oid_list *children;
+ struct sge_iq *intrq;
txq->ifp = pi->ifp;
TASK_INIT(&txq->resume_tx, 0, cxgbe_txq_start, txq);
@@ -1544,7 +1613,12 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx)
txq->sdesc = malloc(eq->cap * sizeof(struct tx_sdesc), M_CXGBE,
M_ZERO | M_WAITOK);
txq->br = buf_ring_alloc(eq->qsize, M_CXGBE, M_WAITOK, &eq->eq_lock);
- eq->iqid = sc->sge.rxq[pi->first_rxq].iq.cntxt_id;
+
+ intrq = &sc->sge.intrq[0];
+ if (sc->flags & INTR_SHARED)
+ eq->iqid = intrq[(pi->first_txq + idx) % NINTRQ(sc)].cntxt_id;
+ else
+ eq->iqid = intrq[pi->first_rxq + (idx % pi->nrxq)].cntxt_id;
rc = bus_dma_tag_create(sc->dmat, 1, 0, BUS_SPACE_MAXADDR,
BUS_SPACE_MAXADDR, NULL, NULL, 64 * 1024, TX_SGL_SEGS,
@@ -1603,6 +1677,15 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx)
NULL, "tx queue");
children = SYSCTL_CHILDREN(oid);
+ SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD,
+ &eq->cntxt_id, 0, "SGE context id of the queue");
+ SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cidx",
+ CTLTYPE_INT | CTLFLAG_RD, &eq->cidx, 0, sysctl_uint16, "I",
+ "consumer index");
+ SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "pidx",
+ CTLTYPE_INT | CTLFLAG_RD, &eq->pidx, 0, sysctl_uint16, "I",
+ "producer index");
+
SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txcsum", CTLFLAG_RD,
&txq->txcsum, "# of times hardware assisted with checksum");
SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "vlan_insertion",
@@ -2324,7 +2407,7 @@ write_txpkts_wr(struct sge_txq *txq, struct txpkts *txpkts)
wr->equiq_to_len16 = htobe32(ctrl);
wr->plen = htobe16(txpkts->plen);
wr->npkt = txpkts->npkt;
- wr->r3 = wr->r4 = 0;
+ wr->r3 = wr->type = 0;
/* Everything else already written */
@@ -2695,6 +2778,32 @@ handle_sge_egr_update(struct adapter *sc, const struct cpl_sge_egr_update *cpl)
return (0);
}
+static void
+handle_cpl(struct adapter *sc, struct sge_iq *iq)
+{
+ const struct rss_header *rss = (const void *)iq->cdesc;
+ const struct cpl_fw6_msg *cpl = (const void *)(rss + 1);
+
+ switch (rss->opcode) {
+ case CPL_FW4_MSG:
+ case CPL_FW6_MSG:
+ if (cpl->type == FW6_TYPE_CMD_RPL)
+ t4_handle_fw_rpl(sc, cpl->data);
+ break;
+
+ case CPL_SGE_EGR_UPDATE:
+ handle_sge_egr_update(sc, (const void *)cpl);
+ break;
+
+ case CPL_SET_TCB_RPL:
+ filter_rpl(sc, (const void *)cpl);
+ break;
+
+ default:
+ panic("%s: unexpected CPL opcode 0x%x", __func__, rss->opcode);
+ }
+}
+
/*
* m0 is freed on successful transmission.
*/
@@ -2710,7 +2819,8 @@ ctrl_tx(struct adapter *sc, struct sge_ctrlq *ctrlq, struct mbuf *m0)
M_ASSERTPKTHDR(m0);
if (m0->m_pkthdr.len > SGE_MAX_WR_LEN) {
- ctrlq->too_long++;
+ log(LOG_ERR, "%s: %s work request too long (%d)",
+ device_get_nameunit(sc->dev), __func__, m0->m_pkthdr.len);
return (EMSGSIZE);
}
ndesc = howmany(m0->m_pkthdr.len, CTRL_EQ_ESIZE);
@@ -2738,7 +2848,6 @@ ctrl_tx(struct adapter *sc, struct sge_ctrlq *ctrlq, struct mbuf *m0)
eq->pidx -= eq->cap;
eq->pending += ndesc;
- ctrlq->total_wrs++;
ring_eq_db(sc, eq);
failed:
EQ_UNLOCK(eq);
@@ -2749,7 +2858,7 @@ failed:
}
static int
-sysctl_abs_id(SYSCTL_HANDLER_ARGS)
+sysctl_uint16(SYSCTL_HANDLER_ARGS)
{
uint16_t *id = arg1;
int i = *id;
diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c
index 4aa08f6..08735ac 100644
--- a/sys/dev/e1000/if_igb.c
+++ b/sys/dev/e1000/if_igb.c
@@ -36,6 +36,7 @@
#ifdef HAVE_KERNEL_OPTION_HEADERS
#include "opt_device_polling.h"
#include "opt_inet.h"
+#include "opt_inet6.h"
#include "opt_altq.h"
#endif
@@ -99,7 +100,7 @@ int igb_display_debug_stats = 0;
/*********************************************************************
* Driver version:
*********************************************************************/
-char igb_driver_version[] = "version - 2.2.3";
+char igb_driver_version[] = "version - 2.2.5";
/*********************************************************************
@@ -170,13 +171,15 @@ static int igb_detach(device_t);
static int igb_shutdown(device_t);
static int igb_suspend(device_t);
static int igb_resume(device_t);
-static void igb_start(struct ifnet *);
-static void igb_start_locked(struct tx_ring *, struct ifnet *ifp);
#if __FreeBSD_version >= 800000
static int igb_mq_start(struct ifnet *, struct mbuf *);
static int igb_mq_start_locked(struct ifnet *,
struct tx_ring *, struct mbuf *);
static void igb_qflush(struct ifnet *);
+static void igb_deferred_mq_start(void *, int);
+#else
+static void igb_start(struct ifnet *);
+static void igb_start_locked(struct tx_ring *, struct ifnet *ifp);
#endif
static int igb_ioctl(struct ifnet *, u_long, caddr_t);
static void igb_init(void *);
@@ -263,6 +266,7 @@ static void igb_handle_link(void *context, int pending);
static void igb_set_sysctl_value(struct adapter *, const char *,
const char *, int *, int);
static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS);
+static int igb_sysctl_dmac(SYSCTL_HANDLER_ARGS);
#ifdef DEVICE_POLLING
static poll_handler_t igb_poll;
@@ -342,25 +346,6 @@ TUNABLE_INT("hw.igb.hdr_split", &igb_header_split);
static int igb_num_queues = 0;
TUNABLE_INT("hw.igb.num_queues", &igb_num_queues);
-/* How many packets rxeof tries to clean at a time */
-static int igb_rx_process_limit = 100;
-TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit);
-
-/* Flow control setting - default to FULL */
-static int igb_fc_setting = e1000_fc_full;
-TUNABLE_INT("hw.igb.fc_setting", &igb_fc_setting);
-
-/* Energy Efficient Ethernet - default to off */
-static int igb_eee_disabled = TRUE;
-TUNABLE_INT("hw.igb.eee_disabled", &igb_eee_disabled);
-
-/*
-** DMA Coalescing, only for i350 - default to off,
-** this feature is for power savings
-*/
-static int igb_dma_coalesce = FALSE;
-TUNABLE_INT("hw.igb.dma_coalesce", &igb_dma_coalesce);
-
/*********************************************************************
* Device identification routine
*
@@ -431,6 +416,11 @@ igb_attach(device_t dev)
INIT_DEBUGOUT("igb_attach: begin");
+ if (resource_disabled("igb", device_get_unit(dev))) {
+ device_printf(dev, "Disabled by device hint\n");
+ return (ENXIO);
+ }
+
adapter = device_get_softc(dev);
adapter->dev = adapter->osdep.dev = dev;
IGB_CORE_LOCK_INIT(adapter, device_get_nameunit(dev));
@@ -448,7 +438,7 @@ igb_attach(device_t dev)
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
- OID_AUTO, "flow_control", CTLTYPE_INT|CTLFLAG_RW,
+ OID_AUTO, "fc", CTLTYPE_INT|CTLFLAG_RW,
adapter, 0, igb_set_flowcntl, "I", "Flow Control");
callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0);
@@ -474,8 +464,8 @@ igb_attach(device_t dev)
/* Sysctl for limiting the amount of work done in the taskqueue */
igb_set_sysctl_value(adapter, "rx_processing_limit",
- "max number of rx packets to process", &adapter->rx_process_limit,
- igb_rx_process_limit);
+ "max number of rx packets to process",
+ &adapter->rx_process_limit, 100);
/*
* Validate number of transmit and receive descriptors. It
@@ -550,13 +540,14 @@ igb_attach(device_t dev)
/* Some adapter-specific advanced features */
if (adapter->hw.mac.type >= e1000_i350) {
- igb_set_sysctl_value(adapter, "dma_coalesce",
- "configure dma coalesce",
- &adapter->dma_coalesce, igb_dma_coalesce);
+ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "dmac", CTLTYPE_INT|CTLFLAG_RW,
+ adapter, 0, igb_sysctl_dmac, "I", "DMA Coalesce");
igb_set_sysctl_value(adapter, "eee_disabled",
"enable Energy Efficient Ethernet",
&adapter->hw.dev_spec._82575.eee_disable,
- igb_eee_disabled);
+ TRUE);
e1000_set_eee_i350(&adapter->hw);
}
@@ -656,6 +647,7 @@ igb_attach(device_t dev)
return (0);
err_late:
+ igb_detach(dev);
igb_free_transmit_structures(adapter);
igb_free_receive_structures(adapter);
igb_release_hw_control(adapter);
@@ -693,6 +685,8 @@ igb_detach(device_t dev)
return (EBUSY);
}
+ ether_ifdetach(adapter->ifp);
+
if (adapter->led_dev != NULL)
led_destroy(adapter->led_dev);
@@ -724,8 +718,6 @@ igb_detach(device_t dev)
if (adapter->vlan_detach != NULL)
EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach);
- ether_ifdetach(adapter->ifp);
-
callout_drain(&adapter->timer);
igb_free_pci_resources(adapter);
@@ -734,7 +726,8 @@ igb_detach(device_t dev)
igb_free_transmit_structures(adapter);
igb_free_receive_structures(adapter);
- free(adapter->mta, M_DEVBUF);
+ if (adapter->mta != NULL)
+ free(adapter->mta, M_DEVBUF);
IGB_CORE_LOCK_DESTROY(adapter);
@@ -784,14 +777,27 @@ igb_resume(device_t dev)
{
struct adapter *adapter = device_get_softc(dev);
struct ifnet *ifp = adapter->ifp;
+#if __FreeBSD_version >= 800000
+ struct tx_ring *txr = adapter->tx_rings;
+#endif
IGB_CORE_LOCK(adapter);
igb_init_locked(adapter);
igb_init_manageability(adapter);
if ((ifp->if_flags & IFF_UP) &&
- (ifp->if_drv_flags & IFF_DRV_RUNNING))
+ (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+#if __FreeBSD_version < 800000
igb_start(ifp);
+#else
+ for (int i = 0; i < adapter->num_queues; i++, txr++) {
+ IGB_TX_LOCK(txr);
+ if (!drbr_empty(ifp, txr->br))
+ igb_mq_start_locked(ifp, txr, NULL);
+ IGB_TX_UNLOCK(txr);
+ }
+#endif
+ }
IGB_CORE_UNLOCK(adapter);
@@ -799,6 +805,7 @@ igb_resume(device_t dev)
}
+#if __FreeBSD_version < 800000
/*********************************************************************
* Transmit entry point
*
@@ -875,7 +882,7 @@ igb_start(struct ifnet *ifp)
return;
}
-#if __FreeBSD_version >= 800000
+#else /* __FreeBSD_version >= 800000 */
/*
** Multiqueue Transmit driver
**
@@ -900,7 +907,7 @@ igb_mq_start(struct ifnet *ifp, struct mbuf *m)
IGB_TX_UNLOCK(txr);
} else {
err = drbr_enqueue(ifp, txr->br, m);
- taskqueue_enqueue(que->tq, &que->que_task);
+ taskqueue_enqueue(que->tq, &txr->txq_task);
}
return (err);
@@ -961,6 +968,22 @@ igb_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr, struct mbuf *m)
}
/*
+ * Called from a taskqueue to drain queued transmit packets.
+ */
+static void
+igb_deferred_mq_start(void *arg, int pending)
+{
+ struct tx_ring *txr = arg;
+ struct adapter *adapter = txr->adapter;
+ struct ifnet *ifp = adapter->ifp;
+
+ IGB_TX_LOCK(txr);
+ if (!drbr_empty(ifp, txr->br))
+ igb_mq_start_locked(ifp, txr, NULL);
+ IGB_TX_UNLOCK(txr);
+}
+
+/*
** Flush all ring buffers
*/
static void
@@ -978,7 +1001,7 @@ igb_qflush(struct ifnet *ifp)
}
if_qflush(ifp);
}
-#endif /* __FreeBSD_version >= 800000 */
+#endif /* __FreeBSD_version < 800000 */
/*********************************************************************
* Ioctl entry point
@@ -993,11 +1016,12 @@ static int
igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
{
struct adapter *adapter = ifp->if_softc;
- struct ifreq *ifr = (struct ifreq *)data;
-#ifdef INET
- struct ifaddr *ifa = (struct ifaddr *)data;
+ struct ifreq *ifr = (struct ifreq *)data;
+#if defined(INET) || defined(INET6)
+ struct ifaddr *ifa = (struct ifaddr *)data;
+ bool avoid_reset = FALSE;
#endif
- int error = 0;
+ int error = 0;
if (adapter->in_detach)
return (error);
@@ -1005,20 +1029,22 @@ igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch (command) {
case SIOCSIFADDR:
#ifdef INET
- if (ifa->ifa_addr->sa_family == AF_INET) {
- /*
- * XXX
- * Since resetting hardware takes a very long time
- * and results in link renegotiation we only
- * initialize the hardware only when it is absolutely
- * required.
- */
+ if (ifa->ifa_addr->sa_family == AF_INET)
+ avoid_reset = TRUE;
+#endif
+#ifdef INET6
+ if (ifa->ifa_addr->sa_family == AF_INET6)
+ avoid_reset = TRUE;
+#endif
+#if defined(INET) || defined(INET6)
+ /*
+ ** Calling init results in link renegotiation,
+ ** so we avoid doing it when possible.
+ */
+ if (avoid_reset) {
ifp->if_flags |= IFF_UP;
- if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
- IGB_CORE_LOCK(adapter);
- igb_init_locked(adapter);
- IGB_CORE_UNLOCK(adapter);
- }
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
+ igb_init(adapter);
if (!(ifp->if_flags & IFF_NOARP))
arp_ifinit(ifp, ifa);
} else
@@ -1143,6 +1169,10 @@ igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
ifp->if_capenable ^= IFCAP_VLAN_HWFILTER;
reinit = 1;
}
+ if (mask & IFCAP_VLAN_HWTSO) {
+ ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
+ reinit = 1;
+ }
if (mask & IFCAP_LRO) {
ifp->if_capenable ^= IFCAP_LRO;
reinit = 1;
@@ -2180,6 +2210,7 @@ igb_allocate_legacy(struct adapter *adapter)
{
device_t dev = adapter->dev;
struct igb_queue *que = adapter->queues;
+ struct tx_ring *txr = adapter->tx_rings;
int error, rid = 0;
/* Turn off all interrupts */
@@ -2198,6 +2229,10 @@ igb_allocate_legacy(struct adapter *adapter)
return (ENXIO);
}
+#if __FreeBSD_version >= 800000
+ TASK_INIT(&txr->txq_task, 0, igb_deferred_mq_start, txr);
+#endif
+
/*
* Try allocating a fast interrupt and the associated deferred
* processing contexts.
@@ -2268,9 +2303,13 @@ igb_allocate_msix(struct adapter *adapter)
*/
if (adapter->num_queues > 1)
bus_bind_intr(dev, que->res, i);
+#if __FreeBSD_version >= 800000
+ TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start,
+ que->txr);
+#endif
/* Make tasklet for deferred handling */
TASK_INIT(&que->que_task, 0, igb_handle_que, que);
- que->tq = taskqueue_create_fast("igb_que", M_NOWAIT,
+ que->tq = taskqueue_create("igb_que", M_NOWAIT,
taskqueue_thread_enqueue, &que->tq);
taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
device_get_nameunit(adapter->dev));
@@ -2477,13 +2516,24 @@ igb_free_pci_resources(struct adapter *adapter)
else
(adapter->msix != 0) ? (rid = 1):(rid = 0);
+ que = adapter->queues;
if (adapter->tag != NULL) {
+ taskqueue_drain(que->tq, &adapter->link_task);
bus_teardown_intr(dev, adapter->res, adapter->tag);
adapter->tag = NULL;
}
if (adapter->res != NULL)
bus_release_resource(dev, SYS_RES_IRQ, rid, adapter->res);
+ for (int i = 0; i < adapter->num_queues; i++, que++) {
+ if (que->tq != NULL) {
+#if __FreeBSD_version >= 800000
+ taskqueue_drain(que->tq, &que->txr->txq_task);
+#endif
+ taskqueue_drain(que->tq, &que->que_task);
+ taskqueue_free(que->tq);
+ }
+ }
mem:
if (adapter->msix)
pci_release_msi(dev);
@@ -2669,6 +2719,12 @@ igb_reset(struct adapter *adapter)
fc->pause_time = IGB_FC_PAUSE_TIME;
fc->send_xon = TRUE;
+ if (fc->requested_mode)
+ fc->current_mode = fc->requested_mode;
+ else
+ fc->current_mode = e1000_fc_full;
+
+ adapter->fc = fc->current_mode;
/* Issue a global reset */
e1000_reset_hw(hw);
@@ -2678,9 +2734,13 @@ igb_reset(struct adapter *adapter)
device_printf(dev, "Hardware Initialization Failed\n");
/* Setup DMA Coalescing */
- if ((hw->mac.type == e1000_i350) &&
- (adapter->dma_coalesce == TRUE)) {
- u32 reg;
+ if (hw->mac.type == e1000_i350) {
+ u32 reg = ~E1000_DMACR_DMAC_EN;
+
+ if (adapter->dmac == 0) { /* Disabling it */
+ E1000_WRITE_REG(hw, E1000_DMACR, reg);
+ goto reset_out;
+ }
hwm = (pba - 4) << 10;
reg = (((pba-6) << E1000_DMACR_DMACTHR_SHIFT)
@@ -2689,8 +2749,8 @@ igb_reset(struct adapter *adapter)
/* transition to L0x or L1 if available..*/
reg |= (E1000_DMACR_DMAC_EN | E1000_DMACR_DMAC_LX_MASK);
- /* timer = +-1000 usec in 32usec intervals */
- reg |= (1000 >> 5);
+ /* timer = value in adapter->dmac in 32usec intervals */
+ reg |= (adapter->dmac >> 5);
E1000_WRITE_REG(hw, E1000_DMACR, reg);
/* No lower threshold */
@@ -2715,6 +2775,7 @@ igb_reset(struct adapter *adapter)
device_printf(dev, "DMA Coalescing enabled\n");
}
+reset_out:
E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN);
e1000_get_phy_info(hw);
e1000_check_for_link(hw);
@@ -2744,10 +2805,11 @@ igb_setup_interface(device_t dev, struct adapter *adapter)
ifp->if_softc = adapter;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = igb_ioctl;
- ifp->if_start = igb_start;
#if __FreeBSD_version >= 800000
ifp->if_transmit = igb_mq_start;
ifp->if_qflush = igb_qflush;
+#else
+ ifp->if_start = igb_start;
#endif
IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1);
ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1;
@@ -2774,15 +2836,19 @@ igb_setup_interface(device_t dev, struct adapter *adapter)
* support full VLAN capability.
*/
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
- ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
- ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
+ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING
+ | IFCAP_VLAN_HWTSO
+ | IFCAP_VLAN_MTU;
+ ifp->if_capenable |= IFCAP_VLAN_HWTAGGING
+ | IFCAP_VLAN_HWTSO
+ | IFCAP_VLAN_MTU;
/*
- ** Dont turn this on by default, if vlans are
+ ** Don't turn this on by default, if vlans are
** created on another pseudo device (eg. lagg)
** then vlan events are not passed thru, breaking
** operation, but with HW FILTER off it works. If
- ** using vlans directly on the em driver you can
+ ** using vlans directly on the igb driver you can
** enable this and get full hardware tag filtering.
*/
ifp->if_capabilities |= IFCAP_VLAN_HWFILTER;
@@ -5542,19 +5608,18 @@ static int
igb_set_flowcntl(SYSCTL_HANDLER_ARGS)
{
int error;
- struct adapter *adapter;
+ struct adapter *adapter = (struct adapter *) arg1;
- error = sysctl_handle_int(oidp, &igb_fc_setting, 0, req);
+ error = sysctl_handle_int(oidp, &adapter->fc, 0, req);
- if (error)
+ if ((error) || (req->newptr == NULL))
return (error);
- adapter = (struct adapter *) arg1;
- switch (igb_fc_setting) {
+ switch (adapter->fc) {
case e1000_fc_rx_pause:
case e1000_fc_tx_pause:
case e1000_fc_full:
- adapter->hw.fc.requested_mode = igb_fc_setting;
+ adapter->hw.fc.requested_mode = adapter->fc;
break;
case e1000_fc_none:
default:
@@ -5563,5 +5628,54 @@ igb_set_flowcntl(SYSCTL_HANDLER_ARGS)
adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode;
e1000_force_mac_fc(&adapter->hw);
- return error;
+ return (error);
+}
+
+/*
+** Manage DMA Coalesce:
+** Control values:
+** 0/1 - off/on
+** Legal timer values are:
+** 250,500,1000-10000 in thousands
+*/
+static int
+igb_sysctl_dmac(SYSCTL_HANDLER_ARGS)
+{
+ struct adapter *adapter = (struct adapter *) arg1;
+ int error;
+
+ error = sysctl_handle_int(oidp, &adapter->dmac, 0, req);
+
+ if ((error) || (req->newptr == NULL))
+ return (error);
+
+ switch (adapter->dmac) {
+ case 0:
+ /*Disabling */
+ break;
+ case 1: /* Just enable and use default */
+ adapter->dmac = 1000;
+ break;
+ case 250:
+ case 500:
+ case 1000:
+ case 2000:
+ case 3000:
+ case 4000:
+ case 5000:
+ case 6000:
+ case 7000:
+ case 8000:
+ case 9000:
+ case 10000:
+ /* Legal values - allow */
+ break;
+ default:
+ /* Do nothing, illegal value */
+ adapter->dmac = 0;
+ return (error);
+ }
+ /* Reinit the interface */
+ igb_init(adapter);
+ return (error);
}
diff --git a/sys/dev/e1000/if_igb.h b/sys/dev/e1000/if_igb.h
index 609d650..f0ab685 100644
--- a/sys/dev/e1000/if_igb.h
+++ b/sys/dev/e1000/if_igb.h
@@ -297,6 +297,7 @@ struct tx_ring {
struct buf_ring *br;
#endif
bus_dma_tag_t txtag;
+ struct task txq_task;
u32 bytes;
u32 packets;
@@ -395,11 +396,12 @@ struct adapter {
u32 shadow_vfta[IGB_VFTA_SIZE];
/* Info about the interface */
- u8 link_active;
+ u16 link_active;
+ u16 fc;
u16 link_speed;
u16 link_duplex;
u32 smartspeed;
- u32 dma_coalesce;
+ u32 dmac;
/* Interface queues */
struct igb_queue *queues;
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index d6225d8..4cfcea8 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -1991,7 +1991,7 @@ pmc_hook_handler(struct thread *td, int function, void *arg)
* had already processed the interrupt). We don't
* lose the interrupt sample.
*/
- atomic_clear_int(&pmc_cpumask, (1 << PCPU_GET(cpuid)));
+ CPU_CLR_ATOMIC(PCPU_GET(cpuid), &pmc_cpumask);
pmc_process_samples(PCPU_GET(cpuid));
break;
@@ -4083,7 +4083,7 @@ pmc_process_interrupt(int cpu, struct pmc *pm, struct trapframe *tf,
done:
/* mark CPU as needing processing */
- atomic_set_int(&pmc_cpumask, (1 << cpu));
+ CPU_SET_ATOMIC(cpu, &pmc_cpumask);
return (error);
}
@@ -4193,7 +4193,7 @@ pmc_process_samples(int cpu)
break;
if (ps->ps_nsamples == PMC_SAMPLE_INUSE) {
/* Need a rescan at a later time. */
- atomic_set_int(&pmc_cpumask, (1 << cpu));
+ CPU_SET_ATOMIC(cpu, &pmc_cpumask);
break;
}
@@ -4782,7 +4782,7 @@ pmc_cleanup(void)
PMCDBG(MOD,INI,0, "%s", "cleanup");
/* switch off sampling */
- pmc_cpumask = 0;
+ CPU_ZERO(&pmc_cpumask);
pmc_intr = NULL;
sx_xlock(&pmc_sx);
diff --git a/sys/dev/iicbus/ad7417.c b/sys/dev/iicbus/ad7417.c
new file mode 100644
index 0000000..6ae16be
--- /dev/null
+++ b/sys/dev/iicbus/ad7417.c
@@ -0,0 +1,621 @@
+/*-
+ * Copyright (c) 2010 Andreas Tobler
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/systm.h>
+#include <sys/module.h>
+#include <sys/callout.h>
+#include <sys/conf.h>
+#include <sys/cpu.h>
+#include <sys/ctype.h>
+#include <sys/kernel.h>
+#include <sys/reboot.h>
+#include <sys/rman.h>
+#include <sys/sysctl.h>
+#include <sys/limits.h>
+
+#include <machine/bus.h>
+#include <machine/md_var.h>
+
+#include <dev/iicbus/iicbus.h>
+#include <dev/iicbus/iiconf.h>
+
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#include <powerpc/powermac/powermac_thermal.h>
+
+/* CPU A/B sensors, temp and adc: AD7417. */
+
+#define AD7417_TEMP 0x00
+#define AD7417_CONFIG 0x01
+#define AD7417_ADC 0x04
+#define AD7417_CONFIG2 0x05
+#define AD7417_CONFMASK 0xe0
+
+uint8_t adc741x_config;
+
+struct ad7417_sensor {
+ struct pmac_therm therm;
+ device_t dev;
+ int id;
+ enum {
+ ADC7417_TEMP_SENSOR,
+ ADC7417_ADC_SENSOR
+ } type;
+};
+
+struct write_data {
+ uint8_t reg;
+ uint8_t val;
+};
+
+struct read_data {
+ uint8_t reg;
+ uint16_t val;
+};
+
+/* Regular bus attachment functions */
+static int ad7417_probe(device_t);
+static int ad7417_attach(device_t);
+
+/* Utility functions */
+static int ad7417_sensor_sysctl(SYSCTL_HANDLER_ARGS);
+static int ad7417_write(device_t dev, uint32_t addr, uint8_t reg,
+ uint8_t *buf, int len);
+static int ad7417_read_1(device_t dev, uint32_t addr, uint8_t reg,
+ uint8_t *data);
+static int ad7417_read_2(device_t dev, uint32_t addr, uint8_t reg,
+ uint16_t *data);
+static int ad7417_write_read(device_t dev, uint32_t addr,
+ struct write_data out, struct read_data *in);
+static int ad7417_diode_read(struct ad7417_sensor *sens);
+static int ad7417_adc_read(struct ad7417_sensor *sens);
+static int ad7417_sensor_read(struct ad7417_sensor *sens);
+
+struct ad7417_softc {
+ device_t sc_dev;
+ uint32_t sc_addr;
+ struct ad7417_sensor *sc_sensors;
+ int sc_nsensors;
+};
+static device_method_t ad7417_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, ad7417_probe),
+ DEVMETHOD(device_attach, ad7417_attach),
+ { 0, 0 },
+};
+
+static driver_t ad7417_driver = {
+ "ad7417",
+ ad7417_methods,
+ sizeof(struct ad7417_softc)
+};
+
+static devclass_t ad7417_devclass;
+
+DRIVER_MODULE(ad7417, iicbus, ad7417_driver, ad7417_devclass, 0, 0);
+MALLOC_DEFINE(M_AD7417, "ad7417", "Supply-Monitor AD7417");
+
+
+static int
+ad7417_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff, int len)
+{
+ unsigned char buf[4];
+ int try = 0;
+
+ struct iic_msg msg[] = {
+ { addr, IIC_M_WR, 0, buf }
+ };
+
+ msg[0].len = len + 1;
+ buf[0] = reg;
+ memcpy(buf + 1, buff, len);
+
+ for (;;)
+ {
+ if (iicbus_transfer(dev, msg, 1) == 0)
+ return (0);
+
+ if (++try > 5) {
+ device_printf(dev, "iicbus write failed\n");
+ return (-1);
+ }
+ pause("ad7417_write", hz);
+ }
+}
+
+static int
+ad7417_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data)
+{
+ uint8_t buf[4];
+ int err, try = 0;
+
+ struct iic_msg msg[2] = {
+ { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
+ { addr, IIC_M_RD, 1, buf },
+ };
+
+ for (;;)
+ {
+ err = iicbus_transfer(dev, msg, 2);
+ if (err != 0)
+ goto retry;
+
+ *data = *((uint8_t*)buf);
+ return (0);
+ retry:
+ if (++try > 5) {
+ device_printf(dev, "iicbus read failed\n");
+ return (-1);
+ }
+ pause("ad7417_read_1", hz);
+ }
+}
+
+static int
+ad7417_read_2(device_t dev, uint32_t addr, uint8_t reg, uint16_t *data)
+{
+ uint8_t buf[4];
+ int err, try = 0;
+
+ struct iic_msg msg[2] = {
+ { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
+ { addr, IIC_M_RD, 2, buf },
+ };
+
+ for (;;)
+ {
+ err = iicbus_transfer(dev, msg, 2);
+ if (err != 0)
+ goto retry;
+
+ *data = *((uint16_t*)buf);
+ return (0);
+ retry:
+ if (++try > 5) {
+ device_printf(dev, "iicbus read failed\n");
+ return (-1);
+ }
+ pause("ad7417_read_2", hz);
+ }
+}
+
+static int
+ad7417_write_read(device_t dev, uint32_t addr, struct write_data out,
+ struct read_data *in)
+{
+ uint8_t buf[4];
+ int err, try = 0;
+
+ /* Do a combined write/read. */
+ struct iic_msg msg[3] = {
+ { addr, IIC_M_WR, 2, buf },
+ { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &in->reg },
+ { addr, IIC_M_RD, 2, buf },
+ };
+
+ /* Prepare the write msg. */
+ buf[0] = out.reg;
+ buf[1] = out.val & 0xff;
+
+ for (;;)
+ {
+ err = iicbus_transfer(dev, msg, 3);
+ if (err != 0)
+ goto retry;
+
+ in->val = *((uint16_t*)buf);
+ return (0);
+ retry:
+ if (++try > 5) {
+ device_printf(dev, "iicbus write/read failed\n");
+ return (-1);
+ }
+ pause("ad7417_write_read", hz);
+ }
+}
+
+static int
+ad7417_init_adc(device_t dev, uint32_t addr)
+{
+ uint8_t buf;
+ int err;
+
+ adc741x_config = 0;
+ /* Clear Config2 */
+ buf = 0;
+
+ err = ad7417_write(dev, addr, AD7417_CONFIG2, &buf, 1);
+
+ /* Read & cache Config1 */
+ buf = 0;
+ err = ad7417_write(dev, addr, AD7417_CONFIG, &buf, 1);
+ err = ad7417_read_1(dev, addr, AD7417_CONFIG, &buf);
+ adc741x_config = (uint8_t)buf;
+
+ /* Disable shutdown mode */
+ adc741x_config &= 0xfe;
+ buf = adc741x_config;
+ err = ad7417_write(dev, addr, AD7417_CONFIG, &buf, 1);
+ if (err < 0)
+ return (-1);
+
+ return (0);
+
+}
+static int
+ad7417_probe(device_t dev)
+{
+ const char *name, *compatible;
+ struct ad7417_softc *sc;
+
+ name = ofw_bus_get_name(dev);
+ compatible = ofw_bus_get_compat(dev);
+
+ if (!name)
+ return (ENXIO);
+
+ if (strcmp(name, "supply-monitor") != 0 ||
+ strcmp(compatible, "ad7417") != 0)
+ return (ENXIO);
+
+ sc = device_get_softc(dev);
+ sc->sc_dev = dev;
+ sc->sc_addr = iicbus_get_addr(dev);
+
+ device_set_desc(dev, "Supply-Monitor AD7417");
+
+ return (0);
+}
+
+/*
+ * This function returns the number of sensors. If we call it the second time
+ * and we have allocated memory for sc->sc_sensors, we fill in the properties.
+ */
+static int
+ad7417_fill_sensor_prop(device_t dev)
+{
+ phandle_t child;
+ struct ad7417_softc *sc;
+ u_int id[10];
+ char location[96];
+ char type[32];
+ int i = 0, j, len = 0, prop_len, prev_len = 0;
+
+ sc = device_get_softc(dev);
+
+ child = ofw_bus_get_node(dev);
+
+ /* Fill the sensor location property. */
+ prop_len = OF_getprop(child, "hwsensor-location", location,
+ sizeof(location));
+ while (len < prop_len) {
+ if (sc->sc_sensors != NULL)
+ strcpy(sc->sc_sensors[i].therm.name, location + len);
+ prev_len = strlen(location + len) + 1;
+ len += prev_len;
+ i++;
+ }
+ if (sc->sc_sensors == NULL)
+ return (i);
+
+ /* Fill the sensor type property. */
+ len = 0;
+ i = 0;
+ prev_len = 0;
+ prop_len = OF_getprop(child, "hwsensor-type", type, sizeof(type));
+ while (len < prop_len) {
+ if (strcmp(type + len, "temperature") == 0)
+ sc->sc_sensors[i].type = ADC7417_TEMP_SENSOR;
+ else
+ sc->sc_sensors[i].type = ADC7417_ADC_SENSOR;
+ prev_len = strlen(type + len) + 1;
+ len += prev_len;
+ i++;
+ }
+
+ /* Fill the sensor id property. Taken from OF. */
+ prop_len = OF_getprop(child, "hwsensor-id", id, sizeof(id));
+ for (j = 0; j < i; j++)
+ sc->sc_sensors[j].id = id[j];
+
+ /* Fill the sensor zone property. Taken from OF. */
+ prop_len = OF_getprop(child, "hwsensor-zone", id, sizeof(id));
+ for (j = 0; j < i; j++)
+ sc->sc_sensors[j].therm.zone = id[j];
+
+ /* Finish setting up sensor properties */
+ for (j = 0; j < i; j++) {
+ sc->sc_sensors[j].dev = dev;
+
+ /* HACK: Apple wired a random diode to the ADC line */
+ if (strstr(sc->sc_sensors[j].therm.name, "DIODE TEMP")
+ != NULL) {
+ sc->sc_sensors[j].type = ADC7417_TEMP_SENSOR;
+ sc->sc_sensors[j].therm.read =
+ (int (*)(struct pmac_therm *))(ad7417_diode_read);
+ } else {
+ sc->sc_sensors[j].therm.read =
+ (int (*)(struct pmac_therm *))(ad7417_sensor_read);
+ }
+
+ if (sc->sc_sensors[j].type != ADC7417_TEMP_SENSOR)
+ continue;
+
+ /* Make up some ranges */
+ sc->sc_sensors[j].therm.target_temp = 500 + ZERO_C_TO_K;
+ sc->sc_sensors[j].therm.max_temp = 900 + ZERO_C_TO_K;
+
+ pmac_thermal_sensor_register(&sc->sc_sensors[j].therm);
+ }
+
+ return (i);
+}
+
+static int
+ad7417_attach(device_t dev)
+{
+ struct ad7417_softc *sc;
+ struct sysctl_oid *oid, *sensroot_oid;
+ struct sysctl_ctx_list *ctx;
+ char sysctl_name[32];
+ int i, j;
+ const char *unit;
+ const char *desc;
+
+ sc = device_get_softc(dev);
+
+ sc->sc_nsensors = 0;
+
+ /* Count the actual number of sensors. */
+ sc->sc_nsensors = ad7417_fill_sensor_prop(dev);
+
+ device_printf(dev, "%d sensors detected.\n", sc->sc_nsensors);
+
+ if (sc->sc_nsensors == 0)
+ device_printf(dev, "WARNING: No AD7417 sensors detected!\n");
+
+ sc->sc_sensors = malloc (sc->sc_nsensors * sizeof(struct ad7417_sensor),
+ M_AD7417, M_WAITOK | M_ZERO);
+
+ ctx = device_get_sysctl_ctx(dev);
+ sensroot_oid = SYSCTL_ADD_NODE(ctx,
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor",
+ CTLFLAG_RD, 0, "AD7417 Sensor Information");
+
+ /* Now we can fill the properties into the allocated struct. */
+ sc->sc_nsensors = ad7417_fill_sensor_prop(dev);
+
+ /* Add sysctls for the sensors. */
+ for (i = 0; i < sc->sc_nsensors; i++) {
+ for (j = 0; j < strlen(sc->sc_sensors[i].therm.name); j++) {
+ sysctl_name[j] =
+ tolower(sc->sc_sensors[i].therm.name[j]);
+ if (isspace(sysctl_name[j]))
+ sysctl_name[j] = '_';
+ }
+ sysctl_name[j] = 0;
+
+ oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid),
+ OID_AUTO,
+ sysctl_name, CTLFLAG_RD, 0,
+ "Sensor Information");
+
+ if (sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR) {
+ unit = "temp";
+ desc = "Sensor temp in C";
+ } else {
+ unit = "volt";
+ desc = "Sensor Volt in V";
+ }
+ /* I use i to pass the sensor id. */
+ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+ unit, CTLTYPE_INT | CTLFLAG_RD, dev,
+ i, ad7417_sensor_sysctl,
+ sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR ?
+ "IK" : "I", desc);
+ }
+ /* Dump sensor location, ID & type. */
+ if (bootverbose) {
+ device_printf(dev, "Sensors\n");
+ for (i = 0; i < sc->sc_nsensors; i++) {
+ device_printf(dev, "Location: %s ID: %d type: %d\n",
+ sc->sc_sensors[i].therm.name,
+ sc->sc_sensors[i].id,
+ sc->sc_sensors[i].type);
+ }
+ }
+
+ return (0);
+}
+
+static int
+ad7417_get_temp(device_t dev, uint32_t addr, int *temp)
+{
+ uint16_t buf[2];
+ uint16_t read;
+ int err;
+
+ err = ad7417_read_2(dev, addr, AD7417_TEMP, buf);
+
+ if (err < 0)
+ return (-1);
+
+ read = *((int16_t*)buf);
+
+ /* The ADC is 10 bit, the resolution is 0.25 C.
+ The temperature is in tenth kelvin.
+ */
+ *temp = (((int16_t)(read & 0xffc0)) >> 6) * 25 / 10;
+ return (0);
+}
+
+static int
+ad7417_get_adc(device_t dev, uint32_t addr, unsigned int *value,
+ uint8_t chan)
+{
+ uint8_t tmp;
+ int err;
+ struct write_data config;
+ struct read_data data;
+
+ tmp = chan << 5;
+ config.reg = AD7417_CONFIG;
+ data.reg = AD7417_ADC;
+ data.val = 0;
+
+ err = ad7417_read_1(dev, addr, AD7417_CONFIG, &config.val);
+
+ config.val = (config.val & ~AD7417_CONFMASK) | (tmp & AD7417_CONFMASK);
+
+ err = ad7417_write_read(dev, addr, config, &data);
+ if (err < 0)
+ return (-1);
+
+ *value = ((uint32_t)data.val) >> 6;
+
+ return (0);
+}
+
+static int
+ad7417_diode_read(struct ad7417_sensor *sens)
+{
+ static int eeprom_read = 0;
+ static cell_t eeprom[2][40];
+ phandle_t eeprom_node;
+ int rawval, diode_slope, diode_offset;
+ int temp;
+
+ if (!eeprom_read) {
+ eeprom_node = OF_finddevice("/u3/i2c/cpuid@a0");
+ OF_getprop(eeprom_node, "cpuid", eeprom[0], sizeof(eeprom[0]));
+ eeprom_node = OF_finddevice("/u3/i2c/cpuid@a2");
+ OF_getprop(eeprom_node, "cpuid", eeprom[1], sizeof(eeprom[1]));
+ eeprom_read = 1;
+ }
+
+ rawval = ad7417_adc_read(sens);
+ if (rawval < 0)
+ return (-1);
+
+ if (strstr(sens->therm.name, "CPU B") != NULL) {
+ diode_slope = eeprom[1][0x11] >> 16;
+ diode_offset = (int16_t)(eeprom[1][0x11] & 0xffff) << 12;
+ } else {
+ diode_slope = eeprom[0][0x11] >> 16;
+ diode_offset = (int16_t)(eeprom[0][0x11] & 0xffff) << 12;
+ }
+
+ temp = (rawval*diode_slope + diode_offset) >> 2;
+ temp = (10*(temp >> 16)) + ((10*(temp & 0xffff)) >> 16);
+
+ return (temp + ZERO_C_TO_K);
+}
+
+static int
+ad7417_adc_read(struct ad7417_sensor *sens)
+{
+ struct ad7417_softc *sc;
+ uint8_t chan;
+ int temp;
+
+ sc = device_get_softc(sens->dev);
+
+ switch (sens->id) {
+ case 11:
+ case 16:
+ chan = 1;
+ break;
+ case 12:
+ case 17:
+ chan = 2;
+ break;
+ case 13:
+ case 18:
+ chan = 3;
+ break;
+ case 14:
+ case 19:
+ chan = 4;
+ break;
+ default:
+ chan = 1;
+ }
+
+ if (ad7417_get_adc(sc->sc_dev, sc->sc_addr, &temp, chan) < 0)
+ return (-1);
+
+ return (temp);
+}
+
+
+static int
+ad7417_sensor_read(struct ad7417_sensor *sens)
+{
+ struct ad7417_softc *sc;
+ int temp;
+
+ sc = device_get_softc(sens->dev);
+
+ /* Init the ADC. */
+ if (ad7417_init_adc(sc->sc_dev, sc->sc_addr) < 0)
+ return (-1);
+
+ if (sens->type == ADC7417_TEMP_SENSOR) {
+ if (ad7417_get_temp(sc->sc_dev, sc->sc_addr, &temp) < 0)
+ return (-1);
+ temp += ZERO_C_TO_K;
+ } else {
+ temp = ad7417_adc_read(sens);
+ }
+ return (temp);
+}
+
+static int
+ad7417_sensor_sysctl(SYSCTL_HANDLER_ARGS)
+{
+ device_t dev;
+ struct ad7417_softc *sc;
+ struct ad7417_sensor *sens;
+ int value = 0;
+ int error;
+
+ dev = arg1;
+ sc = device_get_softc(dev);
+ sens = &sc->sc_sensors[arg2];
+
+ value = sens->therm.read(&sens->therm);
+ if (value < 0)
+ return (ENXIO);
+
+ error = sysctl_handle_int(oidp, &value, 0, req);
+
+ return (error);
+}
diff --git a/sys/dev/iicbus/ds1775.c b/sys/dev/iicbus/ds1775.c
index 0edc074..23ad6f4 100644
--- a/sys/dev/iicbus/ds1775.c
+++ b/sys/dev/iicbus/ds1775.c
@@ -49,33 +49,29 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
-
-#define FCU_ZERO_C_TO_K 2732
+#include <powerpc/powermac/powermac_thermal.h>
/* Drivebay sensor: LM75/DS1775. */
#define DS1775_TEMP 0x0
-struct ds1775_sensor {
- char location[32];
-};
-
/* Regular bus attachment functions */
static int ds1775_probe(device_t);
static int ds1775_attach(device_t);
+struct ds1775_softc {
+ struct pmac_therm sc_sensor;
+ device_t sc_dev;
+ struct intr_config_hook enum_hook;
+ uint32_t sc_addr;
+};
+
/* Utility functions */
+static int ds1775_sensor_read(struct ds1775_softc *sc);
static int ds1775_sensor_sysctl(SYSCTL_HANDLER_ARGS);
static void ds1775_start(void *xdev);
static int ds1775_read_2(device_t dev, uint32_t addr, uint8_t reg,
uint16_t *data);
-struct ds1775_softc {
- device_t sc_dev;
- struct intr_config_hook enum_hook;
- uint32_t sc_addr;
- struct ds1775_sensor *sc_sensors;
-
-};
static device_method_t ds1775_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ds1775_probe),
@@ -92,26 +88,33 @@ static driver_t ds1775_driver = {
static devclass_t ds1775_devclass;
DRIVER_MODULE(ds1755, iicbus, ds1775_driver, ds1775_devclass, 0, 0);
-MALLOC_DEFINE(M_DS1775, "ds1775", "Temp-Monitor DS1775");
static int
ds1775_read_2(device_t dev, uint32_t addr, uint8_t reg, uint16_t *data)
{
uint8_t buf[4];
+ int err, try = 0;
struct iic_msg msg[2] = {
{ addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
{ addr, IIC_M_RD, 2, buf },
};
- if (iicbus_transfer(dev, msg, 2) != 0) {
- device_printf(dev, "iicbus read failed\n");
- return (EIO);
+ for (;;)
+ {
+ err = iicbus_transfer(dev, msg, 2);
+ if (err != 0)
+ goto retry;
+
+ *data = *((uint16_t*)buf);
+ return (0);
+ retry:
+ if (++try > 5) {
+ device_printf(dev, "iicbus read failed\n");
+ return (-1);
+ }
+ pause("ds1775_read_2", hz);
}
-
- *data = *((uint16_t*)buf);
-
- return (0);
}
static int
@@ -169,7 +172,6 @@ ds1775_start(void *xdev)
{
phandle_t child;
struct ds1775_softc *sc;
- struct ds1775_sensor *sens;
struct sysctl_oid *sensroot_oid;
struct sysctl_ctx_list *ctx;
ssize_t plen;
@@ -183,30 +185,43 @@ ds1775_start(void *xdev)
child = ofw_bus_get_node(dev);
- sc->sc_sensors = malloc (sizeof(struct ds1775_sensor),
- M_DS1775, M_WAITOK | M_ZERO);
-
- sens = sc->sc_sensors;
-
ctx = device_get_sysctl_ctx(dev);
sensroot_oid = device_get_sysctl_tree(dev);
- plen = OF_getprop(child, "hwsensor-location", sens->location,
- sizeof(sens->location));
+ if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone,
+ sizeof(int)) < 0)
+ sc->sc_sensor.zone = 0;
+
+ plen = OF_getprop(child, "hwsensor-location", sc->sc_sensor.name,
+ sizeof(sc->sc_sensor.name));
units = "C";
if (plen == -1) {
strcpy(sysctl_name, "sensor");
} else {
- for (i = 0; i < strlen(sens->location); i++) {
- sysctl_name[i] = tolower(sens->location[i]);
+ for (i = 0; i < strlen(sc->sc_sensor.name); i++) {
+ sysctl_name[i] = tolower(sc->sc_sensor.name[i]);
if (isspace(sysctl_name[i]))
sysctl_name[i] = '_';
}
sysctl_name[i] = 0;
}
- sprintf(sysctl_desc,"%s (%s)", sens->location, units);
+ /* Make up target temperatures. These are low, for the drive bay. */
+ if (sc->sc_sensor.zone == 0) {
+ sc->sc_sensor.target_temp = 500 + ZERO_C_TO_K;
+ sc->sc_sensor.max_temp = 600 + ZERO_C_TO_K;
+ }
+ else {
+ sc->sc_sensor.target_temp = 300 + ZERO_C_TO_K;
+ sc->sc_sensor.max_temp = 600 + ZERO_C_TO_K;
+ }
+
+ sc->sc_sensor.read =
+ (int (*)(struct pmac_therm *sc))(ds1775_sensor_read);
+ pmac_thermal_sensor_register(&sc->sc_sensor);
+
+ sprintf(sysctl_desc,"%s (%s)", sc->sc_sensor.name, units);
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO,
sysctl_name,
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev,
@@ -216,44 +231,38 @@ ds1775_start(void *xdev)
}
static int
-ds1775_sensor_read(device_t dev, struct ds1775_sensor *sens, int *temp)
+ds1775_sensor_read(struct ds1775_softc *sc)
{
- struct ds1775_softc *sc;
uint16_t buf[2];
uint16_t read;
+ int err;
- sc = device_get_softc(dev);
-
- ds1775_read_2(sc->sc_dev, sc->sc_addr, DS1775_TEMP, buf);
+ err = ds1775_read_2(sc->sc_dev, sc->sc_addr, DS1775_TEMP, buf);
+ if (err < 0)
+ return (-1);
read = *((int16_t *)buf);
/* The default mode of the ADC is 9 bit, the resolution is 0.5 C per
bit. The temperature is in tenth kelvin.
*/
- *temp = ((int16_t)(read) >> 7) * 5;
-
- return (0);
+ return (((int16_t)(read) >> 7) * 5 + ZERO_C_TO_K);
}
+
static int
ds1775_sensor_sysctl(SYSCTL_HANDLER_ARGS)
{
device_t dev;
struct ds1775_softc *sc;
- struct ds1775_sensor *sens;
- int value;
int error;
unsigned int temp;
dev = arg1;
sc = device_get_softc(dev);
- sens = &sc->sc_sensors[arg2];
- error = ds1775_sensor_read(dev, sens, &value);
- if (error != 0)
- return (error);
-
- temp = value + FCU_ZERO_C_TO_K;
+ temp = ds1775_sensor_read(sc);
+ if (temp < 0)
+ return (EIO);
error = sysctl_handle_int(oidp, &temp, 0, req);
diff --git a/sys/dev/iicbus/max6690.c b/sys/dev/iicbus/max6690.c
index cbfdc26..83f3b50 100644
--- a/sys/dev/iicbus/max6690.c
+++ b/sys/dev/iicbus/max6690.c
@@ -49,20 +49,22 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
-
-#define FCU_ZERO_C_TO_K 2732
+#include <powerpc/powermac/powermac_thermal.h>
/* Inlet, Backside, U3 Heatsink sensor: MAX6690. */
#define MAX6690_INT_TEMP 0x0
#define MAX6690_EXT_TEMP 0x1
+#define MAX6690_RSL_STATUS 0x2
#define MAX6690_EEXT_TEMP 0x10
#define MAX6690_IEXT_TEMP 0x11
#define MAX6690_TEMP_MASK 0xe0
struct max6690_sensor {
+ struct pmac_therm therm;
+ device_t dev;
+
int id;
- char location[32];
};
/* Regular bus attachment functions */
@@ -70,10 +72,11 @@ static int max6690_probe(device_t);
static int max6690_attach(device_t);
/* Utility functions */
+static int max6690_sensor_read(struct max6690_sensor *sens);
static int max6690_sensor_sysctl(SYSCTL_HANDLER_ARGS);
static void max6690_start(void *xdev);
-static int max6690_read_1(device_t dev, uint32_t addr, uint8_t reg,
- uint8_t *data);
+static int max6690_read(device_t dev, uint32_t addr, uint8_t reg,
+ uint8_t *data);
struct max6690_softc {
device_t sc_dev;
@@ -101,23 +104,43 @@ DRIVER_MODULE(max6690, iicbus, max6690_driver, max6690_devclass, 0, 0);
MALLOC_DEFINE(M_MAX6690, "max6690", "Temp-Monitor MAX6690");
static int
-max6690_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data)
+max6690_read(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data)
{
uint8_t buf[4];
-
- struct iic_msg msg[2] = {
+ uint8_t busy[1], rsl;
+ int err, try = 0;
+
+ /* Busy register RSL. */
+ rsl = MAX6690_RSL_STATUS;
+ /* first read the status register, 0x2. If busy, retry. */
+ struct iic_msg msg[4] = {
+ { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &rsl },
+ { addr, IIC_M_RD, 1, busy },
{ addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
{ addr, IIC_M_RD, 1, buf },
};
- if (iicbus_transfer(dev, msg, 2) != 0) {
- device_printf(dev, "iicbus read failed\n");
- return (EIO);
+ for (;;)
+ {
+ err = iicbus_transfer(dev, msg, 4);
+ if (err != 0)
+ goto retry;
+ if (busy[0] & 0x80)
+ goto retry;
+ /* Check for invalid value and retry. */
+ if (buf[0] == 0xff)
+ goto retry;
+
+ *data = *((uint8_t*)buf);
+ return (0);
+
+ retry:
+ if (++try > 5) {
+ device_printf(dev, "iicbus read failed\n");
+ return (-1);
+ }
+ pause("max6690_read", hz);
}
-
- *data = *((uint8_t*)buf);
-
- return (0);
}
static int
@@ -167,7 +190,7 @@ max6690_fill_sensor_prop(device_t dev)
sizeof(location));
while (len < prop_len) {
if (sc->sc_sensors != NULL)
- strcpy(sc->sc_sensors[i].location, location + len);
+ strcpy(sc->sc_sensors[i].therm.name, location + len);
prev_len = strlen(location + len) + 1;
len += prev_len;
i++;
@@ -180,6 +203,22 @@ max6690_fill_sensor_prop(device_t dev)
for (j = 0; j < i; j++)
sc->sc_sensors[j].id = (id[j] & 0xf);
+ /* Fill the sensor zone property. */
+ prop_len = OF_getprop(child, "hwsensor-zone", id, sizeof(id));
+ for (j = 0; j < i; j++)
+ sc->sc_sensors[j].therm.zone = id[j];
+
+ /* Set up remaining sensor properties */
+ for (j = 0; j < i; j++) {
+ sc->sc_sensors[j].dev = dev;
+
+ sc->sc_sensors[j].therm.target_temp = 400 + ZERO_C_TO_K;
+ sc->sc_sensors[j].therm.max_temp = 800 + ZERO_C_TO_K;
+
+ sc->sc_sensors[j].therm.read =
+ (int (*)(struct pmac_therm *))(max6690_sensor_read);
+ }
+
return (i);
}
static int
@@ -240,10 +279,15 @@ max6690_start(void *xdev)
/* Now we can fill the properties into the allocated struct. */
sc->sc_nsensors = max6690_fill_sensor_prop(dev);
+ /* Register with powermac_thermal */
+ for (i = 0; i < sc->sc_nsensors; i++)
+ pmac_thermal_sensor_register(&sc->sc_sensors[i].therm);
+
/* Add sysctls for the sensors. */
for (i = 0; i < sc->sc_nsensors; i++) {
- for (j = 0; j < strlen(sc->sc_sensors[i].location); j++) {
- sysctl_name[j] = tolower(sc->sc_sensors[i].location[j]);
+ for (j = 0; j < strlen(sc->sc_sensors[i].therm.name); j++) {
+ sysctl_name[j] =
+ tolower(sc->sc_sensors[i].therm.name[j]);
if (isspace(sysctl_name[j]))
sysctl_name[j] = '_';
}
@@ -265,7 +309,7 @@ max6690_start(void *xdev)
device_printf(dev, "Sensors\n");
for (i = 0; i < sc->sc_nsensors; i++) {
device_printf(dev, "Location : %s ID: %d\n",
- sc->sc_sensors[i].location,
+ sc->sc_sensors[i].therm.name,
sc->sc_sensors[i].id);
}
}
@@ -274,16 +318,18 @@ max6690_start(void *xdev)
}
static int
-max6690_sensor_read(device_t dev, struct max6690_sensor *sens, int *temp)
+max6690_sensor_read(struct max6690_sensor *sens)
{
uint8_t reg_int = 0, reg_ext = 0;
- uint8_t integer;
- uint8_t fraction;
+ uint8_t integer = 0;
+ uint8_t fraction = 0;
+ int err, temp;
+
struct max6690_softc *sc;
- sc = device_get_softc(dev);
+ sc = device_get_softc(sens->dev);
- /* The internal sensor id's are even, the external ar odd. */
+ /* The internal sensor id's are even, the external are odd. */
if ((sens->id % 2) == 0) {
reg_int = MAX6690_INT_TEMP;
reg_ext = MAX6690_IEXT_TEMP;
@@ -292,18 +338,20 @@ max6690_sensor_read(device_t dev, struct max6690_sensor *sens, int *temp)
reg_ext = MAX6690_EEXT_TEMP;
}
- max6690_read_1(sc->sc_dev, sc->sc_addr, reg_int, &integer);
+ err = max6690_read(sc->sc_dev, sc->sc_addr, reg_int, &integer);
+ err = max6690_read(sc->sc_dev, sc->sc_addr, reg_ext, &fraction);
- max6690_read_1(sc->sc_dev, sc->sc_addr, reg_ext, &fraction);
+ if (err < 0)
+ return (-1);
fraction &= MAX6690_TEMP_MASK;
/* The temperature is in tenth kelvin, the fractional part resolution
is 0.125.
*/
- *temp = (integer * 10) + (fraction >> 5) * 10 / 8;
+ temp = (integer * 10) + (fraction >> 5) * 10 / 8;
- return (0);
+ return (temp + ZERO_C_TO_K);
}
static int
@@ -312,7 +360,6 @@ max6690_sensor_sysctl(SYSCTL_HANDLER_ARGS)
device_t dev;
struct max6690_softc *sc;
struct max6690_sensor *sens;
- int value = 0;
int error;
unsigned int temp;
@@ -320,11 +367,9 @@ max6690_sensor_sysctl(SYSCTL_HANDLER_ARGS)
sc = device_get_softc(dev);
sens = &sc->sc_sensors[arg2];
- error = max6690_sensor_read(dev, sens, &value);
- if (error != 0)
- return (error);
-
- temp = value + FCU_ZERO_C_TO_K;
+ temp = max6690_sensor_read(sens);
+ if (temp < 0)
+ return (EIO);
error = sysctl_handle_int(oidp, &temp, 0, req);
diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c
index db76bfa..7560430 100644
--- a/sys/dev/ipw/if_ipw.c
+++ b/sys/dev/ipw/if_ipw.c
@@ -199,6 +199,8 @@ static devclass_t ipw_devclass;
DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, 0, 0);
+MODULE_VERSION(ipw, 1);
+
static int
ipw_probe(device_t dev)
{
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index dc81309..73b861c 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -232,6 +232,8 @@ static devclass_t iwi_devclass;
DRIVER_MODULE(iwi, pci, iwi_driver, iwi_devclass, 0, 0);
+MODULE_VERSION(iwi, 1);
+
static __inline uint8_t
MEM_READ_1(struct iwi_softc *sc, uint32_t addr)
{
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index 29e391f..ab3dec7 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -401,6 +401,8 @@ static devclass_t iwn_devclass;
DRIVER_MODULE(iwn, pci, iwn_driver, iwn_devclass, 0, 0);
+MODULE_VERSION(iwn, 1);
+
MODULE_DEPEND(iwn, firmware, 1, 1, 1);
MODULE_DEPEND(iwn, pci, 1, 1, 1);
MODULE_DEPEND(iwn, wlan, 1, 1, 1);
@@ -565,6 +567,7 @@ iwn_attach(device_t dev)
ic->ic_caps =
IEEE80211_C_STA /* station mode supported */
| IEEE80211_C_MONITOR /* monitor mode supported */
+ | IEEE80211_C_BGSCAN /* background scanning */
| IEEE80211_C_TXPMGT /* tx power management */
| IEEE80211_C_SHSLOT /* short slot time supported */
| IEEE80211_C_WPA
@@ -574,8 +577,6 @@ iwn_attach(device_t dev)
#endif
| IEEE80211_C_WME /* WME */
;
- if (sc->hw_type != IWN_HW_REV_TYPE_4965)
- ic->ic_caps |= IEEE80211_C_BGSCAN; /* background scanning */
/* Read MAC address, channels, etc from EEPROM. */
if ((error = iwn_read_eeprom(sc, macaddr)) != 0) {
@@ -605,9 +606,9 @@ iwn_attach(device_t dev)
ic->ic_htcaps =
IEEE80211_HTCAP_SMPS_OFF /* SMPS mode disabled */
| IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */
-#ifdef notyet
| IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width*/
| IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */
+#ifdef notyet
| IEEE80211_HTCAP_GREENFIELD
#if IWN_RBUF_SIZE == 8192
| IEEE80211_HTCAP_MAXAMSDU_7935 /* max A-MSDU length */
@@ -2104,6 +2105,7 @@ rate2plcp(int rate)
static void
iwn_newassoc(struct ieee80211_node *ni, int isnew)
{
+#define RV(v) ((v) & IEEE80211_RATE_VAL)
struct ieee80211com *ic = ni->ni_ic;
struct iwn_softc *sc = ic->ic_ifp->if_softc;
struct iwn_node *wn = (void *)ni;
@@ -2117,7 +2119,7 @@ iwn_newassoc(struct ieee80211_node *ni, int isnew)
if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {
ridx = ni->ni_rates.rs_nrates - 1;
for (i = ni->ni_htrates.rs_nrates - 1; i >= 0; i--) {
- plcp = ni->ni_htrates.rs_rates[i] | IWN_RFLAG_MCS;
+ plcp = RV(ni->ni_htrates.rs_rates[i]) | IWN_RFLAG_MCS;
if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {
plcp |= IWN_RFLAG_HT40;
if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)
@@ -2129,8 +2131,7 @@ iwn_newassoc(struct ieee80211_node *ni, int isnew)
else
plcp |= IWN_RFLAG_ANT(txant1);
if (ridx >= 0) {
- rate = ni->ni_rates.rs_rates[ridx];
- rate &= IEEE80211_RATE_VAL;
+ rate = RV(ni->ni_rates.rs_rates[ridx]);
wn->ridx[rate] = plcp;
}
wn->ridx[IEEE80211_RATE_MCS | i] = plcp;
@@ -2138,8 +2139,7 @@ iwn_newassoc(struct ieee80211_node *ni, int isnew)
}
} else {
for (i = 0; i < ni->ni_rates.rs_nrates; i++) {
- rate = ni->ni_rates.rs_rates[i] & IEEE80211_RATE_VAL;
-
+ rate = RV(ni->ni_rates.rs_rates[i]);
plcp = rate2plcp(rate);
ridx = ic->ic_rt->rateCodeToIndex[rate];
if (ridx < IWN_RIDX_OFDM6 &&
@@ -2149,6 +2149,7 @@ iwn_newassoc(struct ieee80211_node *ni, int isnew)
wn->ridx[rate] = htole32(plcp);
}
}
+#undef RV
}
static int
@@ -3313,7 +3314,8 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
}
ac = M_WME_GETAC(m);
- if (IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) {
+ if (IEEE80211_QOS_HAS_SEQ(wh) &&
+ IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) {
struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac];
ring = &sc->txq[*(int *)tap->txa_private];
@@ -3991,6 +3993,7 @@ iwn5000_add_node(struct iwn_softc *sc, struct iwn_node_info *node, int async)
static int
iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni)
{
+#define RV(v) ((v) & IEEE80211_RATE_VAL)
struct iwn_node *wn = (void *)ni;
struct ieee80211_rateset *rs = &ni->ni_rates;
struct iwn_cmd_link_quality linkq;
@@ -4017,11 +4020,11 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni)
if (IEEE80211_IS_CHAN_HT(ni->ni_chan))
rate = IEEE80211_RATE_MCS | txrate;
else
- rate = rs->rs_rates[txrate] & IEEE80211_RATE_VAL;
+ rate = RV(rs->rs_rates[txrate]);
linkq.retry[i] = wn->ridx[rate];
if ((le32toh(wn->ridx[rate]) & IWN_RFLAG_MCS) &&
- (le32toh(wn->ridx[rate]) & 0xff) > 7)
+ RV(le32toh(wn->ridx[rate])) > 7)
linkq.mimo = i + 1;
/* Next retry at immediate lower bit-rate. */
@@ -4029,6 +4032,7 @@ iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni)
txrate--;
}
return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, 1);
+#undef RV
}
/*
@@ -5159,7 +5163,7 @@ iwn_scan(struct iwn_softc *sc)
if (IEEE80211_IS_CHAN_A(ic->ic_curchan) &&
sc->hw_type == IWN_HW_REV_TYPE_4965) {
/* Ant A must be avoided in 5GHz because of an HW bug. */
- rxchain |= IWN_RXCHAIN_FORCE_SEL(IWN_ANT_BC);
+ rxchain |= IWN_RXCHAIN_FORCE_SEL(IWN_ANT_B);
} else /* Use all available RX antennas. */
rxchain |= IWN_RXCHAIN_FORCE_SEL(sc->rxchainmask);
hdr->rxchain = htole16(rxchain);
@@ -5170,14 +5174,19 @@ iwn_scan(struct iwn_softc *sc)
tx->id = sc->broadcast_id;
tx->lifetime = htole32(IWN_LIFETIME_INFINITE);
- if (IEEE80211_IS_CHAN_A(ic->ic_curchan)) {
+ if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) {
/* Send probe requests at 6Mbps. */
tx->rate = htole32(0xd);
rs = &ic->ic_sup_rates[IEEE80211_MODE_11A];
} else {
hdr->flags = htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO);
- /* Send probe requests at 1Mbps. */
- tx->rate = htole32(10 | IWN_RFLAG_CCK);
+ if (sc->hw_type == IWN_HW_REV_TYPE_4965 &&
+ sc->rxon.associd && sc->rxon.chan > 14)
+ tx->rate = htole32(0xd);
+ else {
+ /* Send probe requests at 1Mbps. */
+ tx->rate = htole32(10 | IWN_RFLAG_CCK);
+ }
rs = &ic->ic_sup_rates[IEEE80211_MODE_11G];
}
/* Use the first valid TX antenna. */
diff --git a/sys/dev/ixgbe/LICENSE b/sys/dev/ixgbe/LICENSE
index 0cf44c8..0d4f1db 100644
--- a/sys/dev/ixgbe/LICENSE
+++ b/sys/dev/ixgbe/LICENSE
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2001-2010, Intel Corporation
+ Copyright (c) 2001-2011, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/sys/dev/ixgbe/README b/sys/dev/ixgbe/README
index 0b27deb..5e4921f 100644
--- a/sys/dev/ixgbe/README
+++ b/sys/dev/ixgbe/README
@@ -1,8 +1,8 @@
-FreeBSD Driver for 10 Gigabit PCI Express Server Adapters
-=============================================
+FreeBSD Driver for Intel(R) Ethernet 10 Gigabit PCI Express Server Adapters
+============================================================================
/*$FreeBSD$*/
-May 14, 2008
+November 12, 2010
Contents
@@ -11,15 +11,15 @@ Contents
- Overview
- Supported Adapters
- Building and Installation
-- Additional Configurations
+- Additional Configurations and Tuning
- Known Limitations
Overview
========
-This file describes the FreeBSD* driver for the 10 Gigabit PCIE Family of
-Adapters. Drivers has been developed for use with FreeBSD 7 or later.
+This file describes the FreeBSD* driver for the Intel(R) Ethernet 10 Gigabit
+Family of Adapters. Driver has been developed for use with FreeBSD 7.2 or later.
For questions related to hardware requirements, refer to the documentation
supplied with your Intel 10GbE adapter. All hardware requirements listed
@@ -29,100 +29,98 @@ apply to use with FreeBSD.
Supported Adapters
==================
-The following Intel network adapters are compatible with the drivers in this
-release:
-
-Controller Adapter Name Physical Layer
----------- ------------ --------------
-82598EB Intel(R) 10 Gigabit XF SR/AF 10G Base -LR (850 nm optical fiber)
- Dual Port Server Adapter 10G Base -SR (1310 nm optical fiber)
-82598EB Intel(R) 10 Gigabit XF SR/LR
- Server Adapter
- Intel(R) 82598EB 10 Gigabit AF
- Network Connection
- Intel(R) 82598EB 10 Gigabit AT
- CX4 Network Connection
+The driver in this release is compatible with 82598 and 82599-based Intel
+Network Connections.
+SFP+ Devices with Pluggable Optics
+----------------------------------
-Building and Installation
-=========================
+82599-BASED ADAPTERS
-NOTE: You must have kernel sources installed in order to compile the driver
- module.
-
- In the instructions below, x.x.x is the driver version as indicated in
- the name of the driver tar.
-
-1. Move the base driver tar file to the directory of your choice. For
- example, use /home/username/ixgbe or /usr/local/src/ixgbe.
-
-2. Untar/unzip the archive:
- tar xfz ixgbe-x.x.x.tar.gz
-
-3. To install man page:
- cd ixgbe-x.x.x
- gzip -c ixgbe.4 > /usr/share/man/man4/ixgbee.4.gz
-
-4. To load the driver onto a running system:
- cd ixgbe-x.x.x/src
- make load
-
-5. To assign an IP address to the interface, enter the following:
- ifconfig ix<interface_num> <IP_address>
-
-6. Verify that the interface works. Enter the following, where <IP_address>
- is the IP address for another machine on the same subnet as the interface
- that is being tested:
- ping <IP_address>
-
-7. If you want the driver to load automatically when the system is booted:
-
- cd ixgbe-x.x.x/src
- make
- make install
-
- Edit /boot/loader.conf, and add the following line:
- ixgbe_load="YES"
-
- OR
-
- compile the driver into the kernel (see item 8).
-
-
- Edit /etc/rc.conf, and create the appropriate ifconfig_ixgbe<interface_num>
- entry:
-
- ifconfig_ix<interface_num>="<ifconfig_settings>"
-
- Example usage:
-
- ifconfig_ix0="inet 192.168.10.1 netmask 255.255.255.0"
-
- NOTE: For assistance, see the ifconfig man page.
-
-8. If you want to compile the driver into the kernel, enter:
-
- FreeBSD 7 or later:
-
- cd ixgbe-x.x.x/src
-
- cp *.[ch] /usr/src/sys/dev/ixgbe
-
- cp Makefile.kernel /usr/src/sys/modules/ixgbe/Makefile
-
- Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in
- /usr/src/sys/i386/conf (replace "i386" with the appropriate system
- architecture if necessary), and ensure the following line is present:
-
- device ixgbe
-
- Compile and install the kernel. The system must be reboot for the kernel
- updates to take affect. For additional information on compiling the kernel,
- consult the FreeBSD operating system documentation.
+NOTE: If your 82599-based Intel(R) Ethernet Network Adapter came with Intel
+optics, or is an Intel(R) Ethernet Server Adapter X520-2, then it only supports
+Intel optics and/or the direct attach cables listed below.
+When 82599-based SFP+ devices are connected back to back, they should be set to
+the same Speed setting via Ethtool. Results may vary if you mix speed settings.
+
+Supplier Type Part Numbers
+
+SR Modules
+Intel DUAL RATE 1G/10G SFP+ SR (bailed) FTLX8571D3BCV-IT
+Intel DUAL RATE 1G/10G SFP+ SR (bailed) AFBR-703SDZ-IN2
+Intel DUAL RATE 1G/10G SFP+ SR (bailed) AFBR-703SDDZ-IN1
+LR Modules
+Intel DUAL RATE 1G/10G SFP+ LR (bailed) FTLX1471D3BCV-IT
+Intel DUAL RATE 1G/10G SFP+ LR (bailed) AFCT-701SDZ-IN2
+Intel DUAL RATE 1G/10G SFP+ LR (bailed) AFCT-701SDDZ-IN1
+
+The following is a list of 3rd party SFP+ modules and direct attach cables that
+have received some testing. Not all modules are applicable to all devices.
+
+Supplier Type Part Numbers
+
+Finisar SFP+ SR bailed, 10g single rate FTLX8571D3BCL
+Avago SFP+ SR bailed, 10g single rate AFBR-700SDZ
+Finisar SFP+ LR bailed, 10g single rate FTLX8571D3BCV-IT
+
+Finisar DUAL RATE 1G/10G SFP+ SR (No Bail) FTLX8571D3QCV-IT
+Avago DUAL RATE 1G/10G SFP+ SR (No Bail) AFBR-703SDZ-IN1
+Finisar DUAL RATE 1G/10G SFP+ LR (No Bail) FTLX1471D3QCV-IT
+Avago DUAL RATE 1G/10G SFP+ LR (No Bail) AFCT-701SDZ-IN1
+Finistar 1000BASE-T SFP FCLF8522P2BTL
+Avago 1000BASE-T SFP ABCU-5710RZ
+
+82599-based adapters support all passive and active limiting direct attach
+cables that comply with SFF-8431 v4.1 and SFF-8472 v10.4 specifications.
+
+Laser turns off for SFP+ when ifconfig down
+--------------------------------------------------------
+"ifconfig down" turns off the laser for 82599-based SFP+ fiber adapters.
+"ifconfig up" turns on the later.
+
+82598-BASED ADAPTERS
+
+NOTES for 82598-Based Adapters:
+- Intel(R) Ethernet Network Adapters that support removable optical modules
+ only support their original module type (i.e., the Intel(R) 10 Gigabit SR
+ Dual Port Express Module only supports SR optical modules). If you plug
+ in a different type of module, the driver will not load.
+- Hot Swapping/hot plugging optical modules is not supported.
+- Only single speed, 10 gigabit modules are supported.
+- LAN on Motherboard (LOMs) may support DA, SR, or LR modules. Other module
+ types are not supported. Please see your system documentation for details.
+
+The following is a list of 3rd party SFP+ modules and direct attach cables that have
+received some testing. Not all modules are applicable to all devices.
+
+Supplier Type Part Numbers
+
+Finisar SFP+ SR bailed, 10g single rate FTLX8571D3BCL
+Avago SFP+ SR bailed, 10g single rate AFBR-700SDZ
+Finisar SFP+ LR bailed, 10g single rate FTLX1471D3BCL
+
+82598-based adapters support all passive direct attach cables that comply
+with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. Active direct attach
+cables are not supported.
+
+Third party optic modules and cables referred to above are listed only for the
+purpose of highlighting third party specifications and potential compatibility,
+and are not recommendations or endorsements or sponsorship of any third party's
+product by Intel. Intel is not endorsing or promoting products made by any
+third party and the third party reference is provided only to share information
+regarding certain optic modules and cables with the above specifications. There
+may be other manufacturers or suppliers, producing or supplying optic modules
+and cables with similar or matching descriptions. Customers must use their own
+discretion and diligence to purchase optic modules and cables from any third
+party of their choice. Customer are solely responsible for assessing the
+suitability of the product and/or devices and for the selection of the vendor
+for purchasing any product. INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL
+DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF
+SUCH THIRD PARTY PRODUCTS OR SELECTION OF VENDOR BY CUSTOMERS.
Configuration and Tuning
-=========================
+========================
The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on
all 10 Gigabit adapters.
@@ -143,7 +141,7 @@ all 10 Gigabit adapters.
The Jumbo Frames MTU range for Intel Adapters is 1500 to 16114. The default
MTU range is 1500. To modify the setting, enter the following:
- ifconfig ix <interface_num> <hostname or IP address> mtu 9000
+ ifconfig ix<interface_num> <hostname or IP address> mtu 9000
To confirm an interface's MTU value, use the ifconfig command. To confirm
the MTU used between two specific devices, use:
@@ -200,6 +198,8 @@ all 10 Gigabit adapters.
TSO
---
+ TSO is enabled by default.
+
To disable:
ifconfig <interface_num> -tso
@@ -209,23 +209,21 @@ all 10 Gigabit adapters.
ifconfig <interface_num> tso
LRO
- ___
+ ---
- Large Receive Offload is available in version 1.4.4, it is on
- by default. It can be toggled off and on by using:
- sysctl dev.ix.X.enable_lro=[0,1]
+ Large Receive Offload is available in the driver; it is on by default.
+ It can be disabled by using:
+ ifconfig <interface_num> -lro
+ To enable:
+ ifconfig <interface_num> lro
- NOTE: when changing this feature you MUST be sure the interface
- is reinitialized, it is easy to do this with ifconfig down/up.
- The LRO code will ultimately move into the kernel stack code,
- but for this first release it was included with the driver.
Important system configuration changes:
---------------------------------------
- When there is a choice run on a 64bit OS rather than 32, it makes
- a significant difference in improvement.
-
+ When there is a choice run on a 64bit OS rather than 32, it makes a
+ significant difference in improvement.
+
The default scheduler SCHED_4BSD is not smart about SMP locality issues.
Significant improvement can be achieved by switching to the ULE scheduler.
@@ -233,34 +231,79 @@ all 10 Gigabit adapters.
SCHED_ULE. Note that this is only advisable on FreeBSD 7, on 6.X there have
been stability problems with ULE.
- Change the file /etc/sysctl.conf, add the line:
+ The interface can generate high number of interrupts. To avoid running
+ into the limit set by the kernel, adjust hw.intr_storm_threshold
+ setting using sysctl:
- hw.intr_storm_threshold: 8000 (the default is 1000)
+ sysctl hw.intr_storm_threshold=9000 (the default is 1000)
+
+ For this change to take effect on boot, edit /etc/sysctl.conf and add the
+ line:
+ hw.intr_storm_threshold=9000
+
+ If you still see Interrupt Storm detected messages, increase the limit to a
+ higher number.
Best throughput results are seen with a large MTU; use 9000 if possible.
- The default number of descriptors is 256, increasing this to 1024 or even
- 2048 may improve performance.
+ The default number of descriptors is 1024, increasing this to 2K or even
+ 4K may improve performance in some workloads, but change carefully.
Known Limitations
=================
+
+For known hardware and troubleshooting issues, refer to the following website.
+
+ http://support.intel.com/support/go/network/adapter/home.htm
+
+Either select the link for your adapter or perform a search for the adapter
+number. The adapter's page lists many issues. For a complete list of hardware
+issues download your adapter's user guide and read the Release Notes.
+
+ UDP stress test with 10GbE driver
+ ---------------------------------
Under small packets UDP stress test with 10GbE driver, the FreeBSD system
will drop UDP packets due to the fullness of socket buffers. You may want
to change the driver's Flow Control variables to the minimum value for
controlling packet reception.
+ Attempting to configure larger MTUs with a large numbers of processors may
+ generate the error message "ix0:could not setup receive structures"
+ --------------------------------------------------------------------------
+ When using the ixgbe driver with RSS autoconfigured based on the number of
+ cores (the default setting) and that number is larger than 4, increase the
+ memory resources allocated for the mbuf pool as follows:
+
+ Add to the sysctl.conf file for the system:
+
+ kern.ipc.nmbclusters=262144
+ kern.ipc.nmbjumbop=262144
+
+ Lower than expected performance on dual port 10GbE devices
+ ----------------------------------------------------------
+ Some PCI-E x8 slots are actually configured as x4 slots. These slots have
+ insufficient bandwidth for full 10Gbe line rate with dual port 10GbE devices.
+ The driver can detect this situation and will write the following message in
+ the system log: "PCI-Express bandwidth available for this card is not
+ sufficient for optimal performance. For optimal performance a x8 PCI-Express
+ slot is required."
+
+ If this error occurs, moving your adapter to a true x8 slot will resolve the
+ issue.
+
+
Support
=======
For general information and support, go to the Intel support website at:
- http://support.intel.com
+ www.intel.com/support/
If an issue is identified with the released source code on the supported
kernel with a supported adapter, email the specific information related to
-the issue to freebsd@intel.com.
+the issue to freebsd@intel.com
diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c
index f58adbe..a382a53 100644
--- a/sys/dev/ixgbe/ixgbe.c
+++ b/sys/dev/ixgbe/ixgbe.c
@@ -34,6 +34,7 @@
#ifdef HAVE_KERNEL_OPTION_HEADERS
#include "opt_inet.h"
+#include "opt_inet6.h"
#endif
#include "ixgbe.h"
@@ -46,7 +47,7 @@ int ixgbe_display_debug_stats = 0;
/*********************************************************************
* Driver version
*********************************************************************/
-char ixgbe_driver_version[] = "2.3.10";
+char ixgbe_driver_version[] = "2.3.11";
/*********************************************************************
* PCI Device ID Table
@@ -318,7 +319,7 @@ static int fdir_pballoc = 1;
* ixgbe_probe determines if the driver should be loaded on
* adapter based on PCI vendor/device id of the adapter.
*
- * return 0 on success, positive on failure
+ * return BUS_PROBE_DEFAULT on success, positive on failure
*********************************************************************/
static int
@@ -357,7 +358,7 @@ ixgbe_probe(device_t dev)
ixgbe_driver_version);
device_set_desc_copy(dev, adapter_name);
++ixgbe_total_ports;
- return (0);
+ return (BUS_PROBE_DEFAULT);
}
ent++;
}
@@ -385,6 +386,11 @@ ixgbe_attach(device_t dev)
INIT_DEBUGOUT("ixgbe_attach: begin");
+ if (resource_disabled("ixgbe", device_get_unit(dev))) {
+ device_printf(dev, "Disabled by device hint\n");
+ return (ENXIO);
+ }
+
/* Allocate, clear, and link in our adapter structure */
adapter = device_get_softc(dev);
adapter->dev = adapter->osdep.dev = dev;
@@ -862,8 +868,9 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
{
struct adapter *adapter = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *) data;
-#ifdef INET
+#if defined(INET) || defined(INET6)
struct ifaddr *ifa = (struct ifaddr *)data;
+ bool avoid_reset = FALSE;
#endif
int error = 0;
@@ -871,26 +878,28 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
case SIOCSIFADDR:
#ifdef INET
- if (ifa->ifa_addr->sa_family == AF_INET) {
- /*
- * Since resetting hardware takes a very long time
- * and results in link renegotiation we only
- * initialize the hardware only when it is absolutely
- * required.
- */
+ if (ifa->ifa_addr->sa_family == AF_INET)
+ avoid_reset = TRUE;
+#endif
+#ifdef INET6
+ if (ifa->ifa_addr->sa_family == AF_INET6)
+ avoid_reset = TRUE;
+#endif
+#if defined(INET) || defined(INET6)
+ /*
+ ** Calling init results in link renegotiation,
+ ** so we avoid doing it when possible.
+ */
+ if (avoid_reset) {
ifp->if_flags |= IFF_UP;
- if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
- IXGBE_CORE_LOCK(adapter);
- ixgbe_init_locked(adapter);
- IXGBE_CORE_UNLOCK(adapter);
- }
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
+ ixgbe_init(adapter);
if (!(ifp->if_flags & IFF_NOARP))
arp_ifinit(ifp, ifa);
} else
-#endif
error = ether_ioctl(ifp, command, data);
break;
-
+#endif
case SIOCSIFMTU:
IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)");
if (ifr->ifr_mtu > IXGBE_MAX_FRAME_SIZE - ETHER_HDR_LEN) {
@@ -951,6 +960,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
if (mask & IFCAP_VLAN_HWFILTER)
ifp->if_capenable ^= IFCAP_VLAN_HWFILTER;
+ if (mask & IFCAP_VLAN_HWTSO)
+ ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
IXGBE_CORE_LOCK(adapter);
ixgbe_init_locked(adapter);
@@ -1338,7 +1349,7 @@ ixgbe_legacy_irq(void *arg)
/*********************************************************************
*
- * MSI Queue Interrupt Service routine
+ * MSIX Queue Interrupt Service routine
*
**********************************************************************/
void
@@ -1357,6 +1368,17 @@ ixgbe_msix_que(void *arg)
IXGBE_TX_LOCK(txr);
more_tx = ixgbe_txeof(txr);
+ /*
+ ** Make certain that if the stack
+ ** has anything queued the task gets
+ ** scheduled to handle it.
+ */
+#if __FreeBSD_version < 800000
+ if (!IFQ_DRV_IS_EMPTY(&adapter->ifp->if_snd))
+#else
+ if (!drbr_empty(adapter->ifp, txr->br))
+#endif
+ more_tx = 1;
IXGBE_TX_UNLOCK(txr);
/* Do AIM now? */
@@ -1570,7 +1592,7 @@ ixgbe_xmit(struct tx_ring *txr, struct mbuf **m_headp)
struct mbuf *m_head;
bus_dma_segment_t segs[adapter->num_segs];
bus_dmamap_t map;
- struct ixgbe_tx_buf *txbuf, *txbuf_mapped;
+ struct ixgbe_tx_buf *txbuf;
union ixgbe_adv_tx_desc *txd = NULL;
m_head = *m_headp;
@@ -1589,7 +1611,6 @@ ixgbe_xmit(struct tx_ring *txr, struct mbuf **m_headp)
*/
first = txr->next_avail_desc;
txbuf = &txr->tx_buffers[first];
- txbuf_mapped = txbuf;
map = txbuf->map;
/*
@@ -1708,6 +1729,8 @@ ixgbe_xmit(struct tx_ring *txr, struct mbuf **m_headp)
txr->next_avail_desc = i;
txbuf->m_head = m_head;
+ /* Swap the dma map between the first and last descriptor */
+ txr->tx_buffers[first].map = txbuf->map;
txbuf->map = map;
bus_dmamap_sync(txr->txtag, map, BUS_DMASYNC_PREWRITE);
@@ -2265,7 +2288,9 @@ ixgbe_setup_msix(struct adapter *adapter)
msi:
msgs = pci_msi_count(dev);
if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0)
- device_printf(adapter->dev,"Using MSI interrupt\n");
+ device_printf(adapter->dev,"Using an MSI interrupt\n");
+ else
+ device_printf(adapter->dev,"Using a Legacy interrupt\n");
return (msgs);
}
@@ -2412,19 +2437,21 @@ ixgbe_setup_interface(device_t dev, struct adapter *adapter)
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM;
- ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
ifp->if_capabilities |= IFCAP_JUMBO_MTU;
+ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING
+ | IFCAP_VLAN_HWTSO
+ | IFCAP_VLAN_MTU;
ifp->if_capenable = ifp->if_capabilities;
/* Don't enable LRO by default */
ifp->if_capabilities |= IFCAP_LRO;
/*
- ** Dont turn this on by default, if vlans are
+ ** Don't turn this on by default, if vlans are
** created on another pseudo device (eg. lagg)
** then vlan events are not passed thru, breaking
** operation, but with HW FILTER off it works. If
- ** using vlans directly on the em driver you can
+ ** using vlans directly on the ixgbe driver you can
** enable this and get full hardware tag filtering.
*/
ifp->if_capabilities |= IFCAP_VLAN_HWFILTER;
@@ -5333,7 +5360,7 @@ ixgbe_add_rx_process_limit(struct adapter *adapter, const char *name,
static int
ixgbe_set_advertise(SYSCTL_HANDLER_ARGS)
{
- int error;
+ int error = 0;
struct adapter *adapter;
struct ixgbe_hw *hw;
ixgbe_link_speed speed, last;
diff --git a/sys/dev/ixgbe/ixv.c b/sys/dev/ixgbe/ixv.c
index f9f910a..e52a527 100644
--- a/sys/dev/ixgbe/ixv.c
+++ b/sys/dev/ixgbe/ixv.c
@@ -1,6 +1,6 @@
/******************************************************************************
- Copyright (c) 2001-2010, Intel Corporation
+ Copyright (c) 2001-2011, Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,8 @@
/*$FreeBSD$*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include "opt_device_polling.h"
+#include "opt_inet.h"
+#include "opt_inet6.h"
#endif
#include "ixv.h"
@@ -41,7 +42,7 @@
/*********************************************************************
* Driver version
*********************************************************************/
-char ixv_driver_version[] = "1.0.0";
+char ixv_driver_version[] = "1.0.1";
/*********************************************************************
* PCI Device ID Table
@@ -234,7 +235,7 @@ static u32 ixv_shadow_vfta[VFTA_SIZE];
* ixv_probe determines if the driver should be loaded on
* adapter based on PCI vendor/device id of the adapter.
*
- * return 0 on success, positive on failure
+ * return BUS_PROBE_DEFAULT on success, positive on failure
*********************************************************************/
static int
@@ -271,7 +272,7 @@ ixv_probe(device_t dev)
ixv_strings[ent->index],
ixv_driver_version);
device_set_desc_copy(dev, adapter_name);
- return (0);
+ return (BUS_PROBE_DEFAULT);
}
ent++;
}
@@ -297,6 +298,11 @@ ixv_attach(device_t dev)
INIT_DEBUGOUT("ixv_attach: begin");
+ if (resource_disabled("ixgbe", device_get_unit(dev))) {
+ device_printf(dev, "Disabled by device hint\n");
+ return (ENXIO);
+ }
+
/* Allocate, clear, and link in our adapter structure */
adapter = device_get_softc(dev);
adapter->dev = adapter->osdep.dev = dev;
@@ -690,10 +696,38 @@ ixv_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
{
struct adapter *adapter = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *) data;
+#if defined(INET) || defined(INET6)
+ struct ifaddr *ifa = (struct ifaddr *) data;
+ bool avoid_reset = FALSE;
+#endif
int error = 0;
switch (command) {
+ case SIOCSIFADDR:
+#ifdef INET
+ if (ifa->ifa_addr->sa_family == AF_INET)
+ avoid_reset = TRUE;
+#endif
+#ifdef INET6
+ if (ifa->ifa_addr->sa_family == AF_INET6)
+ avoid_reset = TRUE;
+#endif
+#if defined(INET) || defined(INET6)
+ /*
+ ** Calling init results in link renegotiation,
+ ** so we avoid doing it when possible.
+ */
+ if (avoid_reset) {
+ ifp->if_flags |= IFF_UP;
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
+ ixv_init(adapter);
+ if (!(ifp->if_flags & IFF_NOARP))
+ arp_ifinit(ifp, ifa);
+ } else
+ error = ether_ioctl(ifp, command, data);
+ break;
+#endif
case SIOCSIFMTU:
IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)");
if (ifr->ifr_mtu > IXV_MAX_FRAME_SIZE - ETHER_HDR_LEN) {
@@ -1161,7 +1195,7 @@ ixv_xmit(struct tx_ring *txr, struct mbuf **m_headp)
struct mbuf *m_head;
bus_dma_segment_t segs[32];
bus_dmamap_t map;
- struct ixv_tx_buf *txbuf, *txbuf_mapped;
+ struct ixv_tx_buf *txbuf;
union ixgbe_adv_tx_desc *txd = NULL;
m_head = *m_headp;
@@ -1180,7 +1214,6 @@ ixv_xmit(struct tx_ring *txr, struct mbuf **m_headp)
*/
first = txr->next_avail_desc;
txbuf = &txr->tx_buffers[first];
- txbuf_mapped = txbuf;
map = txbuf->map;
/*
@@ -1283,6 +1316,7 @@ ixv_xmit(struct tx_ring *txr, struct mbuf **m_headp)
txr->next_avail_desc = i;
txbuf->m_head = m_head;
+ txr->tx_buffers[first].map = txbuf->map;
txbuf->map = map;
bus_dmamap_sync(txr->txtag, map, BUS_DMASYNC_PREWRITE);
@@ -1820,11 +1854,15 @@ ixv_setup_interface(device_t dev, struct adapter *adapter)
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM;
- ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
- ifp->if_capabilities |= IFCAP_JUMBO_MTU | IFCAP_LRO;
-
+ ifp->if_capabilities |= IFCAP_JUMBO_MTU;
+ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING
+ | IFCAP_VLAN_HWTSO
+ | IFCAP_VLAN_MTU;
ifp->if_capenable = ifp->if_capabilities;
+ /* Don't enable LRO by default */
+ ifp->if_capabilities |= IFCAP_LRO;
+
/*
* Specify the media types supported by this adapter and register
* callbacks to update media and link information
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index eb18ffe..1962648 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -788,7 +788,7 @@ mfi_aen_setup(struct mfi_softc *sc, uint32_t seq_start)
class_locale.members.reserved = 0;
class_locale.members.locale = mfi_event_locale;
- class_locale.members.class = mfi_event_class;
+ class_locale.members.evt_class = mfi_event_class;
if (seq_start == 0) {
error = mfi_get_log_state(sc, &log_state);
@@ -1082,8 +1082,8 @@ mfi_decode_evt(struct mfi_softc *sc, struct mfi_evt_detail *detail)
{
device_printf(sc->mfi_dev, "%d (%s/0x%04x/%s) - %s\n", detail->seq,
- format_timestamp(detail->time), detail->class.members.locale,
- format_class(detail->class.members.class), detail->description);
+ format_timestamp(detail->time), detail->evt_class.members.locale,
+ format_class(detail->evt_class.members.evt_class), detail->description);
}
static int
@@ -1099,16 +1099,16 @@ mfi_aen_register(struct mfi_softc *sc, int seq, int locale)
if (sc->mfi_aen_cm != NULL) {
prior_aen.word =
((uint32_t *)&sc->mfi_aen_cm->cm_frame->dcmd.mbox)[1];
- if (prior_aen.members.class <= current_aen.members.class &&
+ if (prior_aen.members.evt_class <= current_aen.members.evt_class &&
!((prior_aen.members.locale & current_aen.members.locale)
^current_aen.members.locale)) {
return (0);
} else {
prior_aen.members.locale |= current_aen.members.locale;
- if (prior_aen.members.class
- < current_aen.members.class)
- current_aen.members.class =
- prior_aen.members.class;
+ if (prior_aen.members.evt_class
+ < current_aen.members.evt_class)
+ current_aen.members.evt_class =
+ prior_aen.members.evt_class;
mfi_abort(sc, sc->mfi_aen_cm);
}
}
@@ -1199,7 +1199,7 @@ mfi_parse_entries(struct mfi_softc *sc, int start_seq, int stop_seq)
class_locale.members.reserved = 0;
class_locale.members.locale = mfi_event_locale;
- class_locale.members.class = mfi_event_class;
+ class_locale.members.evt_class = mfi_event_class;
size = sizeof(struct mfi_evt_list) + sizeof(struct mfi_evt_detail)
* (MAX_EVENTS - 1);
diff --git a/sys/dev/mfi/mfireg.h b/sys/dev/mfi/mfireg.h
index e08a16d..efee827 100644
--- a/sys/dev/mfi/mfireg.h
+++ b/sys/dev/mfi/mfireg.h
@@ -719,7 +719,7 @@ union mfi_evt {
struct {
uint16_t locale;
uint8_t reserved;
- int8_t class;
+ int8_t evt_class;
} members;
uint32_t word;
} __packed;
@@ -755,7 +755,7 @@ struct mfi_evt_detail {
uint32_t seq;
uint32_t time;
uint32_t code;
- union mfi_evt class;
+ union mfi_evt evt_class;
uint8_t arg_type;
uint8_t reserved1[15];
diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c
index 45ddd56..6ff47c3 100644
--- a/sys/dev/mmc/mmc.c
+++ b/sys/dev/mmc/mmc.c
@@ -1445,37 +1445,37 @@ mmc_read_ivar(device_t bus, device_t child, int which, uintptr_t *result)
default:
return (EINVAL);
case MMC_IVAR_DSR_IMP:
- *(int *)result = ivar->csd.dsr_imp;
+ *result = ivar->csd.dsr_imp;
break;
case MMC_IVAR_MEDIA_SIZE:
- *(off_t *)result = ivar->sec_count;
+ *result = ivar->sec_count;
break;
case MMC_IVAR_RCA:
- *(int *)result = ivar->rca;
+ *result = ivar->rca;
break;
case MMC_IVAR_SECTOR_SIZE:
- *(int *)result = MMC_SECTOR_SIZE;
+ *result = MMC_SECTOR_SIZE;
break;
case MMC_IVAR_TRAN_SPEED:
- *(int *)result = mmcbr_get_clock(bus);
+ *result = mmcbr_get_clock(bus);
break;
case MMC_IVAR_READ_ONLY:
- *(int *)result = ivar->read_only;
+ *result = ivar->read_only;
break;
case MMC_IVAR_HIGH_CAP:
- *(int *)result = ivar->high_cap;
+ *result = ivar->high_cap;
break;
case MMC_IVAR_CARD_TYPE:
- *(int *)result = ivar->mode;
+ *result = ivar->mode;
break;
case MMC_IVAR_BUS_WIDTH:
- *(int *)result = ivar->bus_width;
+ *result = ivar->bus_width;
break;
case MMC_IVAR_ERASE_SECTOR:
- *(int *)result = ivar->erase_sector;
+ *result = ivar->erase_sector;
break;
case MMC_IVAR_MAX_DATA:
- *(int *)result = mmcbr_get_max_data(bus);
+ *result = mmcbr_get_max_data(bus);
break;
}
return (0);
diff --git a/sys/dev/mmc/mmcvar.h b/sys/dev/mmc/mmcvar.h
index 9126439..a28d3ac 100644
--- a/sys/dev/mmc/mmcvar.h
+++ b/sys/dev/mmc/mmcvar.h
@@ -79,7 +79,7 @@ enum mmc_device_ivars {
__BUS_ACCESSOR(mmc, var, MMC, ivar, type)
MMC_ACCESSOR(dsr_imp, DSR_IMP, int)
-MMC_ACCESSOR(media_size, MEDIA_SIZE, off_t)
+MMC_ACCESSOR(media_size, MEDIA_SIZE, long)
MMC_ACCESSOR(rca, RCA, int)
MMC_ACCESSOR(sector_size, SECTOR_SIZE, int)
MMC_ACCESSOR(tran_speed, TRAN_SPEED, int)
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c
index 2adbf1c..be4ac5d 100644
--- a/sys/dev/msk/if_msk.c
+++ b/sys/dev/msk/if_msk.c
@@ -566,7 +566,7 @@ msk_miibus_statchg(device_t dev)
msk_phy_writereg(sc_if, PHY_ADDR_MARV, PHY_MARV_INT_MASK, 0);
/* Disable Rx/Tx MAC. */
gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL);
- if ((GM_GPCR_RX_ENA | GM_GPCR_TX_ENA) != 0) {
+ if ((gmac & (GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)) != 0) {
gmac &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA);
GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac);
/* Read again to ensure writing. */
@@ -1018,7 +1018,7 @@ msk_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
if (ifr->ifr_mtu > MSK_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN)
error = EINVAL;
else if (ifp->if_mtu != ifr->ifr_mtu) {
- if (ifr->ifr_mtu > ETHERMTU) {
+ if (ifr->ifr_mtu > ETHERMTU) {
if ((sc_if->msk_flags & MSK_FLAG_JUMBO) == 0) {
error = EINVAL;
MSK_IF_UNLOCK(sc_if);
@@ -1636,7 +1636,7 @@ msk_attach(device_t dev)
* this workaround does not work so disable checksum offload
* for VLAN interface.
*/
- ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO;
+ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO;
/*
* Enable Rx checksum offloading for VLAN tagged frames
* if controller support new descriptor format.
@@ -1921,7 +1921,8 @@ mskc_attach(device_t dev)
error = ENXIO;
goto fail;
}
- mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO);
+ mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK |
+ M_ZERO);
if (mmd == NULL) {
device_printf(dev, "failed to allocate memory for "
"ivars of PORT_B\n");
@@ -1930,9 +1931,9 @@ mskc_attach(device_t dev)
}
mmd->port = MSK_PORT_B;
mmd->pmd = sc->msk_pmd;
- if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S')
+ if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S')
mmd->mii_flags |= MIIF_HAVEFIBER;
- if (sc->msk_pmd == 'P')
+ if (sc->msk_pmd == 'P')
mmd->mii_flags |= MIIF_HAVEFIBER | MIIF_MACPRIV0;
device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd);
}
@@ -3741,10 +3742,10 @@ msk_init_locked(struct msk_if_softc *sc_if)
ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM);
}
- /* GMAC Control reset. */
- CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET);
- CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR);
- CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF);
+ /* GMAC Control reset. */
+ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET);
+ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR);
+ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF);
if (sc->msk_hw_id == CHIP_ID_YUKON_EX ||
sc->msk_hw_id == CHIP_ID_YUKON_SUPR)
CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL),
@@ -3854,13 +3855,13 @@ msk_init_locked(struct msk_if_softc *sc_if)
msk_set_tx_stfwd(sc_if);
}
- if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P &&
- sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) {
- /* Disable dynamic watermark - from Linux. */
- reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA));
- reg &= ~0x03;
- CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg);
- }
+ if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P &&
+ sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) {
+ /* Disable dynamic watermark - from Linux. */
+ reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA));
+ reg &= ~0x03;
+ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg);
+ }
/*
* Disable Force Sync bit and Alloc bit in Tx RAM interface
diff --git a/sys/dev/mvs/mvs.c b/sys/dev/mvs/mvs.c
index 5dbe30c..54808c5 100644
--- a/sys/dev/mvs/mvs.c
+++ b/sys/dev/mvs/mvs.c
@@ -1738,13 +1738,6 @@ mvs_end_transaction(struct mvs_slot *slot, enum mvs_err_type et)
ch->numhslots++;
} else
xpt_done(ccb);
- /* Unfreeze frozen command. */
- if (ch->frozen && !mvs_check_collision(dev, ch->frozen)) {
- union ccb *fccb = ch->frozen;
- ch->frozen = NULL;
- mvs_begin_transaction(dev, fccb);
- xpt_release_simq(ch->sim, TRUE);
- }
/* If we have no other active commands, ... */
if (ch->rslots == 0) {
/* if there was fatal error - reset port. */
@@ -1764,6 +1757,13 @@ mvs_end_transaction(struct mvs_slot *slot, enum mvs_err_type et)
} else if ((ch->rslots & ~ch->toslots) == 0 &&
et != MVS_ERR_TIMEOUT)
mvs_rearm_timeout(dev);
+ /* Unfreeze frozen command. */
+ if (ch->frozen && !mvs_check_collision(dev, ch->frozen)) {
+ union ccb *fccb = ch->frozen;
+ ch->frozen = NULL;
+ mvs_begin_transaction(dev, fccb);
+ xpt_release_simq(ch->sim, TRUE);
+ }
/* Start PM timer. */
if (ch->numrslots == 0 && ch->pm_level > 3 &&
(ch->curr[ch->pm_present ? 15 : 0].caps & CTS_SATA_CAPS_D_PMREQ)) {
@@ -2080,7 +2080,8 @@ mvs_softreset(device_t dev, union ccb *ccb)
{
struct mvs_channel *ch = device_get_softc(dev);
int port = ccb->ccb_h.target_id & 0x0f;
- int i;
+ int i, stuck;
+ uint8_t status;
mvs_set_edma_mode(dev, MVS_EDMA_OFF);
ATA_OUTB(ch->r_mem, SATA_SATAICTL, port << SATA_SATAICTL_PMPTX_SHIFT);
@@ -2089,12 +2090,35 @@ mvs_softreset(device_t dev, union ccb *ccb)
ATA_OUTB(ch->r_mem, ATA_CONTROL, 0);
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
/* Wait for clearing busy status. */
- if ((i = mvs_wait(dev, 0, ATA_S_BUSY | ATA_S_DRQ, ccb->ccb_h.timeout)) < 0) {
+ if ((i = mvs_wait(dev, 0, ATA_S_BUSY, ccb->ccb_h.timeout)) < 0) {
ccb->ccb_h.status |= CAM_CMD_TIMEOUT;
+ stuck = 1;
} else {
- ccb->ccb_h.status |= CAM_REQ_CMP;
+ status = mvs_getstatus(dev, 0);
+ if (status & ATA_S_ERROR)
+ ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR;
+ else
+ ccb->ccb_h.status |= CAM_REQ_CMP;
+ if (status & ATA_S_DRQ)
+ stuck = 1;
+ else
+ stuck = 0;
}
mvs_tfd_read(dev, ccb);
+
+ /*
+ * XXX: If some device on PMP failed to soft-reset,
+ * try to recover by sending dummy soft-reset to PMP.
+ */
+ if (stuck && ch->pm_present && port != 15) {
+ ATA_OUTB(ch->r_mem, SATA_SATAICTL,
+ 15 << SATA_SATAICTL_PMPTX_SHIFT);
+ ATA_OUTB(ch->r_mem, ATA_CONTROL, ATA_A_RESET);
+ DELAY(10000);
+ ATA_OUTB(ch->r_mem, ATA_CONTROL, 0);
+ mvs_wait(dev, 0, ATA_S_BUSY | ATA_S_DRQ, ccb->ccb_h.timeout);
+ }
+
xpt_done(ccb);
}
diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c
index 6cdfa34..28a3c01 100644
--- a/sys/dev/nfe/if_nfe.c
+++ b/sys/dev/nfe/if_nfe.c
@@ -1889,7 +1889,7 @@ nfe_int_task(void *arg, int pending)
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
NFE_UNLOCK(sc);
- nfe_enable_intr(sc);
+ nfe_disable_intr(sc);
return;
}
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index 00cd1dc..1de571c 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -1405,8 +1405,8 @@ pccard_ccr_read_impl(device_t brdev, device_t child, uint32_t offset,
struct pccard_ivar *devi = PCCARD_IVAR(child);
*val = pccard_ccr_read(devi->pf, offset);
- device_printf(child, "ccr_read of %#x (%#x) is %#x\n", offset,
- devi->pf->pf_ccr_offset, *val);
+ DEVPRINTF((child, "ccr_read of %#x (%#x) is %#x\n", offset,
+ devi->pf->pf_ccr_offset, *val));
return 0;
}
@@ -1421,8 +1421,8 @@ pccard_ccr_write_impl(device_t brdev, device_t child, uint32_t offset,
* Can't use pccard_ccr_write since client drivers may access
* registers not contained in the 'mask' if they are non-standard.
*/
- device_printf(child, "ccr_write of %#x to %#x (%#x)\n", val, offset,
- devi->pf->pf_ccr_offset);
+ DEVPRINTF((child, "ccr_write of %#x to %#x (%#x)\n", val, offset,
+ devi->pf->pf_ccr_offset));
bus_space_write_1(pf->pf_ccrt, pf->pf_ccrh, pf->pf_ccr_offset + offset,
val);
return 0;
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index bbb9eae..3c60f37 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -800,24 +800,36 @@ cbb_power(device_t brdev, int volts)
* We have a shortish timeout of 500ms here. Some bridges do
* not generate a POWER_CYCLE event for 16-bit cards. In
* those cases, we have to cope the best we can, and having
- * only a short delay is better than the alternatives.
+ * only a short delay is better than the alternatives. Others
+ * raise the power cycle a smidge before it is really ready.
+ * We deal with those below.
*/
sane = 10;
while (!(cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_POWER_CYCLE) &&
cnt == sc->powerintr && sane-- > 0)
msleep(&sc->powerintr, &sc->mtx, 0, "-", hz / 20);
mtx_unlock(&sc->mtx);
+
+ /*
+ * Relax for 100ms. Some bridges appear to assert this signal
+ * right away, but before the card has stabilized. Other
+ * cards need need more time to cope up reliabily.
+ * Experiments with troublesome setups show this to be a
+ * "cheap" way to enhance reliabilty. We need not do this for
+ * "off" since we don't touch the card after we turn it off.
+ */
+ pause("cbbPwr", min(hz / 10, 1));
+
/*
* The TOPIC95B requires a little bit extra time to get its
* act together, so delay for an additional 100ms. Also as
* documented below, it doesn't seem to set the POWER_CYCLE
* bit, so don't whine if it never came on.
*/
- if (sc->chipset == CB_TOPIC95) {
+ if (sc->chipset == CB_TOPIC95)
pause("cbb95B", hz / 10);
- } else if (sane <= 0) {
+ else if (sane <= 0)
device_printf(sc->dev, "power timeout, doom?\n");
- }
}
/*
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 22046c1..9cd5a1c 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -2576,6 +2576,17 @@ pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl,
uint16_t cmd;
struct resource *res;
+ /*
+ * The BAR may already exist if the device is a CardBus card
+ * whose CIS is stored in this BAR.
+ */
+ pm = pci_find_bar(dev, reg);
+ if (pm != NULL) {
+ maprange = pci_maprange(pm->pm_value);
+ barlen = maprange == 64 ? 2 : 1;
+ return (barlen);
+ }
+
pci_read_bar(dev, reg, &map, &testval);
if (PCI_BAR_MEM(map)) {
type = SYS_RES_MEMORY;
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index f68973b..da8465c 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -916,7 +916,8 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
/* Move end_free down until it is properly aligned. */
end_free &= ~(align - 1);
- front = end_free - count;
+ end_free--;
+ front = end_free - (count - 1);
/*
* The resource would now be allocated at (front,
@@ -944,7 +945,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
/* Move start_free up until it is properly aligned. */
start_free = roundup2(start_free, align);
- back = start_free + count;
+ back = start_free + count - 1;
/*
* The resource would now be allocated at (start_free,
@@ -957,7 +958,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
if (bootverbose)
printf("\tback candidate range: %#lx-%#lx\n",
start_free, back);
- back = roundup2(back, w->step) - 1;
+ back = roundup2(back + 1, w->step) - 1;
back -= rman_get_end(w->res);
} else
back = 0;
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c
index b6fa3c5..9bb3ceb 100644
--- a/sys/dev/puc/puc.c
+++ b/sys/dev/puc/puc.c
@@ -726,3 +726,41 @@ puc_bus_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
}
return (0);
}
+
+int
+puc_bus_print_child(device_t dev, device_t child)
+{
+ struct puc_port *port;
+ int retval;
+
+ port = device_get_ivars(child);
+ retval = 0;
+
+ retval += bus_print_child_header(dev, child);
+ retval += printf(" at port %d", port->p_nr);
+ retval += bus_print_child_footer(dev, child);
+
+ return (retval);
+}
+
+int
+puc_bus_child_location_str(device_t dev, device_t child, char *buf,
+ size_t buflen)
+{
+ struct puc_port *port;
+
+ port = device_get_ivars(child);
+ snprintf(buf, buflen, "port=%d", port->p_nr);
+ return (0);
+}
+
+int
+puc_bus_child_pnpinfo_str(device_t dev, device_t child, char *buf,
+ size_t buflen)
+{
+ struct puc_port *port;
+
+ port = device_get_ivars(child);
+ snprintf(buf, buflen, "type=%d", port->p_type);
+ return (0);
+}
diff --git a/sys/dev/puc/puc_bfe.h b/sys/dev/puc/puc_bfe.h
index f6d69c4..c67fab5 100644
--- a/sys/dev/puc/puc_bfe.h
+++ b/sys/dev/puc/puc_bfe.h
@@ -82,9 +82,12 @@ int puc_bfe_attach(device_t);
int puc_bfe_detach(device_t);
int puc_bfe_probe(device_t, const struct puc_cfg *);
+int puc_bus_child_location_str(device_t, device_t, char *, size_t);
+int puc_bus_child_pnpinfo_str(device_t, device_t, char *, size_t);
struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *, u_long,
u_long, u_long, u_int);
int puc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
+int puc_bus_print_child(device_t, device_t);
int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
int puc_bus_release_resource(device_t, device_t, int, int, struct resource *);
int puc_bus_setup_intr(device_t, device_t, struct resource *, int,
diff --git a/sys/dev/puc/puc_pccard.c b/sys/dev/puc/puc_pccard.c
index 2cb9513..63d5787 100644
--- a/sys/dev/puc/puc_pccard.c
+++ b/sys/dev/puc/puc_pccard.c
@@ -82,7 +82,9 @@ static device_method_t puc_pccard_methods[] = {
DEVMETHOD(bus_read_ivar, puc_bus_read_ivar),
DEVMETHOD(bus_setup_intr, puc_bus_setup_intr),
DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr),
- DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_print_child, puc_bus_print_child),
+ DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str),
+ DEVMETHOD(bus_child_location_str, puc_bus_child_location_str),
DEVMETHOD(bus_driver_added, bus_generic_driver_added),
{ 0, 0 }
};
diff --git a/sys/dev/puc/puc_pci.c b/sys/dev/puc/puc_pci.c
index 9a05b66..8c14717 100644
--- a/sys/dev/puc/puc_pci.c
+++ b/sys/dev/puc/puc_pci.c
@@ -132,7 +132,9 @@ static device_method_t puc_pci_methods[] = {
DEVMETHOD(bus_read_ivar, puc_bus_read_ivar),
DEVMETHOD(bus_setup_intr, puc_bus_setup_intr),
DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr),
- DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_print_child, puc_bus_print_child),
+ DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str),
+ DEVMETHOD(bus_child_location_str, puc_bus_child_location_str),
DEVMETHOD(bus_driver_added, bus_generic_driver_added),
{ 0, 0 }
};
diff --git a/sys/dev/puc/pucdata.c b/sys/dev/puc/pucdata.c
index 83b02ea..2b38d9b 100644
--- a/sys/dev/puc/pucdata.c
+++ b/sys/dev/puc/pucdata.c
@@ -48,15 +48,15 @@ __FBSDID("$FreeBSD$");
#include <dev/puc/puc_bfe.h>
static puc_config_f puc_config_amc;
-static puc_config_f puc_config_cronyx;
static puc_config_f puc_config_diva;
+static puc_config_f puc_config_exar;
static puc_config_f puc_config_icbook;
+static puc_config_f puc_config_oxford_pcie;
static puc_config_f puc_config_quatech;
static puc_config_f puc_config_syba;
static puc_config_f puc_config_siig;
static puc_config_f puc_config_timedia;
static puc_config_f puc_config_titan;
-static puc_config_f puc_config_oxford_pcie;
const struct puc_cfg puc_pci_devices[] = {
@@ -548,11 +548,25 @@ const struct puc_cfg puc_pci_devices[] = {
PUC_PORT_8S, 0x18, 0, 8,
},
+ { 0x13a8, 0x0152, 0xffff, 0,
+ "Exar XR17C/D152",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_2S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
+ { 0x13a8, 0x0154, 0xffff, 0,
+ "Exar XR17C154",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_4S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
{ 0x13a8, 0x0158, 0xffff, 0,
- "Cronyx Omega2-PCI",
+ "Exar XR17C158",
DEFAULT_RCLK * 8,
PUC_PORT_8S, 0x10, 0, -1,
- .config_function = puc_config_cronyx
+ .config_function = puc_config_exar
},
{ 0x13a8, 0x0258, 0xffff, 0,
@@ -1014,28 +1028,28 @@ puc_config_amc(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
}
static int
-puc_config_cronyx(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
+ const struct puc_cfg *cfg = sc->sc_cfg;
+
if (cmd == PUC_CFG_GET_OFS) {
- *res = port * 0x200;
+ if (cfg->subdevice == 0x1282) /* Everest SP */
+ port <<= 1;
+ else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
+ port = (port == 3) ? 4 : port;
+ *res = port * 8 + ((port > 2) ? 0x18 : 0);
return (0);
}
return (ENXIO);
}
static int
-puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
- const struct puc_cfg *cfg = sc->sc_cfg;
-
if (cmd == PUC_CFG_GET_OFS) {
- if (cfg->subdevice == 0x1282) /* Everest SP */
- port <<= 1;
- else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
- port = (port == 3) ? 4 : port;
- *res = port * 8 + ((port > 2) ? 0x18 : 0);
+ *res = port * 0x200;
return (0);
}
return (ENXIO);
@@ -1292,6 +1306,12 @@ puc_config_timedia(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
uint16_t subdev;
switch (cmd) {
+ case PUC_CFG_GET_CLOCK:
+ if (port < 2)
+ *res = DEFAULT_RCLK * 8;
+ else
+ *res = DEFAULT_RCLK;
+ return (0);
case PUC_CFG_GET_DESC:
snprintf(desc, sizeof(desc),
"Timedia technology %d Port Serial", (int)sc->sc_cfg_data);
@@ -1346,14 +1366,12 @@ puc_config_oxford_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
bar = puc_get_bar(sc, cfg->rid);
if (bar == NULL)
return (ENXIO);
-
for (idx = 0; idx < sc->sc_nports; idx++) {
- value = bus_read_1(bar->b_res, 0x1000 + (idx << 9)
- + 0x92);
+ value = bus_read_1(bar->b_res, 0x1000 + (idx << 9) +
+ 0x92);
bus_write_1(bar->b_res, 0x1000 + (idx << 9) + 0x92,
- value | 0x10);
+ value | 0x10);
}
-
return (0);
case PUC_CFG_GET_LEN:
*res = 0x200;
diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c
index ac97098..18ef5e5 100644
--- a/sys/dev/safe/safe.c
+++ b/sys/dev/safe/safe.c
@@ -1580,9 +1580,12 @@ safe_callback(struct safe_softc *sc, struct safe_ringentry *re)
* SHA-1 ICV's are byte-swapped; fix 'em up
* before copy them to their destination.
*/
- bswap32(re->re_sastate.sa_saved_indigest[0]);
- bswap32(re->re_sastate.sa_saved_indigest[1]);
- bswap32(re->re_sastate.sa_saved_indigest[2]);
+ re->re_sastate.sa_saved_indigest[0] =
+ bswap32(re->re_sastate.sa_saved_indigest[0]);
+ re->re_sastate.sa_saved_indigest[1] =
+ bswap32(re->re_sastate.sa_saved_indigest[1]);
+ re->re_sastate.sa_saved_indigest[2] =
+ bswap32(re->re_sastate.sa_saved_indigest[2]);
}
crypto_copyback(crp->crp_flags, crp->crp_buf,
crd->crd_inject,
diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c
index 6bbc25f..24cba57 100644
--- a/sys/dev/sdhci/sdhci.c
+++ b/sys/dev/sdhci/sdhci.c
@@ -1443,46 +1443,46 @@ sdhci_read_ivar(device_t bus, device_t child, int which, uintptr_t *result)
default:
return (EINVAL);
case MMCBR_IVAR_BUS_MODE:
- *(int *)result = slot->host.ios.bus_mode;
+ *result = slot->host.ios.bus_mode;
break;
case MMCBR_IVAR_BUS_WIDTH:
- *(int *)result = slot->host.ios.bus_width;
+ *result = slot->host.ios.bus_width;
break;
case MMCBR_IVAR_CHIP_SELECT:
- *(int *)result = slot->host.ios.chip_select;
+ *result = slot->host.ios.chip_select;
break;
case MMCBR_IVAR_CLOCK:
- *(int *)result = slot->host.ios.clock;
+ *result = slot->host.ios.clock;
break;
case MMCBR_IVAR_F_MIN:
- *(int *)result = slot->host.f_min;
+ *result = slot->host.f_min;
break;
case MMCBR_IVAR_F_MAX:
- *(int *)result = slot->host.f_max;
+ *result = slot->host.f_max;
break;
case MMCBR_IVAR_HOST_OCR:
- *(int *)result = slot->host.host_ocr;
+ *result = slot->host.host_ocr;
break;
case MMCBR_IVAR_MODE:
- *(int *)result = slot->host.mode;
+ *result = slot->host.mode;
break;
case MMCBR_IVAR_OCR:
- *(int *)result = slot->host.ocr;
+ *result = slot->host.ocr;
break;
case MMCBR_IVAR_POWER_MODE:
- *(int *)result = slot->host.ios.power_mode;
+ *result = slot->host.ios.power_mode;
break;
case MMCBR_IVAR_VDD:
- *(int *)result = slot->host.ios.vdd;
+ *result = slot->host.ios.vdd;
break;
case MMCBR_IVAR_CAPS:
- *(int *)result = slot->host.caps;
+ *result = slot->host.caps;
break;
case MMCBR_IVAR_TIMING:
- *(int *)result = slot->host.ios.timing;
+ *result = slot->host.ios.timing;
break;
case MMCBR_IVAR_MAX_DATA:
- *(int *)result = 65535;
+ *result = 65535;
break;
}
return (0);
diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c
index 01edae3..a7b018a 100644
--- a/sys/dev/siis/siis.c
+++ b/sys/dev/siis/siis.c
@@ -1178,11 +1178,22 @@ siis_timeout(struct siis_slot *slot)
{
device_t dev = slot->dev;
struct siis_channel *ch = device_get_softc(dev);
+ union ccb *ccb = slot->ccb;
mtx_assert(&ch->mtx, MA_OWNED);
/* Check for stale timeout. */
if (slot->state < SIIS_SLOT_RUNNING)
return;
+
+ /* Handle soft-reset timeouts without doing hard-reset. */
+ if ((ccb->ccb_h.func_code == XPT_ATA_IO) &&
+ (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) &&
+ (ccb->ataio.cmd.control & ATA_A_RESET)) {
+ xpt_freeze_simq(ch->sim, ch->numrslots);
+ siis_end_transaction(slot, SIIS_ERR_TFE);
+ return;
+ }
+
device_printf(dev, "Timeout on slot %d\n", slot->slot);
device_printf(dev, "%s is %08x ss %08x rs %08x es %08x sts %08x serr %08x\n",
__func__, ATA_INL(ch->r_mem, SIIS_P_IS),
@@ -1331,13 +1342,6 @@ siis_end_transaction(struct siis_slot *slot, enum siis_err_type et)
ch->numhslots++;
} else
xpt_done(ccb);
- /* Unfreeze frozen command. */
- if (ch->frozen && !siis_check_collision(dev, ch->frozen)) {
- union ccb *fccb = ch->frozen;
- ch->frozen = NULL;
- siis_begin_transaction(dev, fccb);
- xpt_release_simq(ch->sim, TRUE);
- }
/* If we have no other active commands, ... */
if (ch->rslots == 0) {
/* if there were timeouts or fatal error - reset port. */
@@ -1355,6 +1359,13 @@ siis_end_transaction(struct siis_slot *slot, enum siis_err_type et)
} else if ((ch->rslots & ~ch->toslots) == 0 &&
et != SIIS_ERR_TIMEOUT)
siis_rearm_timeout(dev);
+ /* Unfreeze frozen command. */
+ if (ch->frozen && !siis_check_collision(dev, ch->frozen)) {
+ union ccb *fccb = ch->frozen;
+ ch->frozen = NULL;
+ siis_begin_transaction(dev, fccb);
+ xpt_release_simq(ch->sim, TRUE);
+ }
}
static void
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index 7af5303..bb0f385 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -754,7 +754,17 @@ static const struct {
#define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051)
#define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066)
#define HDA_CODEC_CX20583 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5067)
+#define HDA_CODEC_CX20584 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5068)
#define HDA_CODEC_CX20585 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5069)
+#define HDA_CODEC_CX20590 HDA_CODEC_CONSTRUCT(CONEXANT, 0x506e)
+#define HDA_CODEC_CX20631 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5097)
+#define HDA_CODEC_CX20632 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5098)
+#define HDA_CODEC_CX20641 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50a1)
+#define HDA_CODEC_CX20642 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50a2)
+#define HDA_CODEC_CX20651 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50ab)
+#define HDA_CODEC_CX20652 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50ac)
+#define HDA_CODEC_CX20664 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50b8)
+#define HDA_CODEC_CX20665 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50b9)
#define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff)
/* VIA */
@@ -826,12 +836,13 @@ static const struct {
#define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff)
/* INTEL */
-#define HDA_CODEC_INTELG45_1 HDA_CODEC_CONSTRUCT(INTEL, 0x2801)
-#define HDA_CODEC_INTELG45_2 HDA_CODEC_CONSTRUCT(INTEL, 0x2802)
-#define HDA_CODEC_INTELG45_3 HDA_CODEC_CONSTRUCT(INTEL, 0x2803)
-#define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x2804)
-#define HDA_CODEC_INTELG45_5 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb)
-#define HDA_CODEC_INTELQ57 HDA_CODEC_CONSTRUCT(INTEL, 0x0054)
+#define HDA_CODEC_INTELIP HDA_CODEC_CONSTRUCT(INTEL, 0x0054)
+#define HDA_CODEC_INTELBL HDA_CODEC_CONSTRUCT(INTEL, 0x2801)
+#define HDA_CODEC_INTELCA HDA_CODEC_CONSTRUCT(INTEL, 0x2802)
+#define HDA_CODEC_INTELEL HDA_CODEC_CONSTRUCT(INTEL, 0x2803)
+#define HDA_CODEC_INTELIP2 HDA_CODEC_CONSTRUCT(INTEL, 0x2804)
+#define HDA_CODEC_INTELCPT HDA_CODEC_CONSTRUCT(INTEL, 0x2805)
+#define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb)
#define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff)
/* Codecs */
@@ -938,7 +949,17 @@ static const struct {
{ HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" },
{ HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" },
{ HDA_CODEC_CX20583, "Conexant CX20583 (Pebble HSF)" },
+ { HDA_CODEC_CX20584, "Conexant CX20584" },
{ HDA_CODEC_CX20585, "Conexant CX20585" },
+ { HDA_CODEC_CX20590, "Conexant CX20590" },
+ { HDA_CODEC_CX20631, "Conexant CX20631" },
+ { HDA_CODEC_CX20632, "Conexant CX20632" },
+ { HDA_CODEC_CX20641, "Conexant CX20641" },
+ { HDA_CODEC_CX20642, "Conexant CX20642" },
+ { HDA_CODEC_CX20651, "Conexant CX20651" },
+ { HDA_CODEC_CX20652, "Conexant CX20652" },
+ { HDA_CODEC_CX20664, "Conexant CX20664" },
+ { HDA_CODEC_CX20665, "Conexant CX20665" },
{ HDA_CODEC_VT1708_8, "VIA VT1708_8" },
{ HDA_CODEC_VT1708_9, "VIA VT1708_9" },
{ HDA_CODEC_VT1708_A, "VIA VT1708_A" },
@@ -998,12 +1019,13 @@ static const struct {
{ HDA_CODEC_NVIDIAGT21X, "NVidia GT21x HDMI" },
{ HDA_CODEC_NVIDIAMCP89, "NVidia MCP89 HDMI" },
{ HDA_CODEC_NVIDIAGT240, "NVidia GT240 HDMI" },
- { HDA_CODEC_INTELG45_1, "Intel G45 HDMI" },
- { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" },
- { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" },
- { HDA_CODEC_INTELG45_4, "Intel G45 HDMI" },
- { HDA_CODEC_INTELG45_5, "Intel G45 HDMI" },
- { HDA_CODEC_INTELQ57, "Intel Q57 HDMI" },
+ { HDA_CODEC_INTELIP, "Intel Ibex Peak HDMI" },
+ { HDA_CODEC_INTELBL, "Intel Bearlake HDMI" },
+ { HDA_CODEC_INTELCA, "Intel Cantiga HDMI" },
+ { HDA_CODEC_INTELEL, "Intel Eaglelake HDMI" },
+ { HDA_CODEC_INTELIP2, "Intel Ibex Peak HDMI" },
+ { HDA_CODEC_INTELCPT, "Intel Cougar Point HDMI" },
+ { HDA_CODEC_INTELCL, "Intel Crestline HDMI" },
{ HDA_CODEC_SII1390, "Silicon Image SiI1390 HDMI" },
{ HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" },
/* Unknown codec */
@@ -4124,7 +4146,10 @@ hdac_attach(device_t dev)
uint16_t vendor;
uint8_t v;
- device_printf(dev, "HDA Driver Revision: %s\n", HDA_DRV_TEST_REV);
+ HDA_BOOTVERBOSE(
+ device_printf(dev, "HDA Driver Revision: %s\n",
+ HDA_DRV_TEST_REV);
+ );
model = (uint32_t)pci_get_device(dev) << 16;
model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff;
@@ -4919,6 +4944,25 @@ hdac_vendor_patch_parse(struct hdac_devinfo *devinfo)
if (w != NULL)
w->connsenable[0] = 0;
break;
+ case HDA_CODEC_CX20582:
+ case HDA_CODEC_CX20583:
+ case HDA_CODEC_CX20584:
+ case HDA_CODEC_CX20585:
+ case HDA_CODEC_CX20590:
+ /*
+ * These codecs have extra connectivity on record side
+ * too reach for the present parser.
+ */
+ w = hdac_widget_get(devinfo, 20);
+ if (w != NULL)
+ w->connsenable[1] = 0;
+ w = hdac_widget_get(devinfo, 21);
+ if (w != NULL)
+ w->connsenable[1] = 0;
+ w = hdac_widget_get(devinfo, 22);
+ if (w != NULL)
+ w->connsenable[0] = 0;
+ break;
}
}
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index caa7841..958065f 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -51,7 +51,7 @@ int pcm_veto_load = 1;
int snd_unit = -1;
TUNABLE_INT("hw.snd.default_unit", &snd_unit);
-static int snd_unit_auto = 0;
+static int snd_unit_auto = -1;
TUNABLE_INT("hw.snd.default_auto", &snd_unit_auto);
SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RW,
&snd_unit_auto, 0, "assign default unit to a newly attached device");
@@ -443,6 +443,7 @@ sysctl_hw_snd_default_unit(SYSCTL_HANDLER_ARGS)
if (!PCM_REGISTERED(d) || CHN_EMPTY(d, channels.pcm))
return EINVAL;
snd_unit = unit;
+ snd_unit_auto = 0;
}
return (error);
}
@@ -737,6 +738,32 @@ pcm_killchan(device_t dev)
return (pcm_chn_destroy(ch));
}
+static int
+pcm_best_unit(int old)
+{
+ struct snddev_info *d;
+ int i, best, bestprio, prio;
+
+ best = -1;
+ bestprio = -100;
+ for (i = 0; pcm_devclass != NULL &&
+ i < devclass_get_maxunit(pcm_devclass); i++) {
+ d = devclass_get_softc(pcm_devclass, i);
+ if (!PCM_REGISTERED(d))
+ continue;
+ prio = 0;
+ if (d->playcount == 0)
+ prio -= 10;
+ if (d->reccount == 0)
+ prio -= 2;
+ if (prio > bestprio || (prio == bestprio && i == old)) {
+ best = i;
+ bestprio = prio;
+ }
+ }
+ return (best);
+}
+
int
pcm_setstatus(device_t dev, char *str)
{
@@ -770,8 +797,12 @@ pcm_setstatus(device_t dev, char *str)
PCM_UNLOCK(d);
- if (snd_unit < 0 || snd_unit_auto != 0)
+ if (snd_unit_auto < 0)
+ snd_unit_auto = (snd_unit < 0) ? 1 : 0;
+ if (snd_unit < 0 || snd_unit_auto > 1)
snd_unit = device_get_unit(dev);
+ else if (snd_unit_auto == 1)
+ snd_unit = pcm_best_unit(snd_unit);
return (0);
}
@@ -1113,7 +1144,6 @@ pcm_unregister(device_t dev)
struct snddev_info *d;
struct pcm_channel *ch;
struct thread *td;
- int i;
td = curthread;
d = device_get_softc(dev);
@@ -1216,21 +1246,9 @@ pcm_unregister(device_t dev)
sndstat_release(td);
if (snd_unit == device_get_unit(dev)) {
- /*
- * Reassign default unit to the next available dev, but
- * first, reset snd_unit to something ridiculous.
- */
- snd_unit = -1;
- for (i = 0; pcm_devclass != NULL &&
- i < devclass_get_maxunit(pcm_devclass); i++) {
- if (device_get_unit(dev) == i)
- continue;
- d = devclass_get_softc(pcm_devclass, i);
- if (PCM_REGISTERED(d)) {
- snd_unit = i;
- break;
- }
- }
+ snd_unit = pcm_best_unit(-1);
+ if (snd_unit_auto == 0)
+ snd_unit_auto = 1;
}
return (0);
diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c
index 3cdd5ad..489be29 100644
--- a/sys/dev/uart/uart_dev_ns8250.c
+++ b/sys/dev/uart/uart_dev_ns8250.c
@@ -242,8 +242,14 @@ ns8250_probe(struct uart_bas *bas)
val = uart_getreg(bas, REG_IIR);
if (val & 0x30)
return (ENXIO);
+ /*
+ * Bit 6 of the MCR (= 0x40) appears to be 1 for the Sun1699
+ * chip, but otherwise doesn't seem to have a function. In
+ * other words, uart(4) works regardless. Ignore that bit so
+ * the probe succeeds.
+ */
val = uart_getreg(bas, REG_MCR);
- if (val & 0xe0)
+ if (val & 0xa0)
return (ENXIO);
return (0);
diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c
index fbe63de..00d1c0b 100644
--- a/sys/dev/usb/net/if_axe.c
+++ b/sys/dev/usb/net/if_axe.c
@@ -514,7 +514,7 @@ static void
axe_ax88178_init(struct axe_softc *sc)
{
struct usb_ether *ue;
- int gpio0, phymode;
+ int gpio0, ledmode, phymode;
uint16_t eeprom, val;
ue = &sc->sc_ue;
@@ -528,9 +528,11 @@ axe_ax88178_init(struct axe_softc *sc)
if (eeprom == 0xffff) {
phymode = AXE_PHY_MODE_MARVELL;
gpio0 = 1;
+ ledmode = 0;
} else {
phymode = eeprom & 0x7f;
gpio0 = (eeprom & 0x80) ? 0 : 1;
+ ledmode = eeprom >> 8;
}
if (bootverbose)
@@ -548,9 +550,22 @@ axe_ax88178_init(struct axe_softc *sc)
AXE_GPIO_WRITE(AXE_GPIO0_EN | AXE_GPIO2_EN, hz / 4);
AXE_GPIO_WRITE(AXE_GPIO0_EN | AXE_GPIO2 | AXE_GPIO2_EN,
hz / 32);
- } else
+ } else {
AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM | AXE_GPIO1 |
- AXE_GPIO1_EN, hz / 32);
+ AXE_GPIO1_EN, hz / 3);
+ if (ledmode == 1) {
+ AXE_GPIO_WRITE(AXE_GPIO1_EN, hz / 3);
+ AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN,
+ hz / 3);
+ } else {
+ AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN |
+ AXE_GPIO2 | AXE_GPIO2_EN, hz / 32);
+ AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN |
+ AXE_GPIO2_EN, hz / 4);
+ AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN |
+ AXE_GPIO2 | AXE_GPIO2_EN, hz / 32);
+ }
+ }
break;
case AXE_PHY_MODE_CICADA:
case AXE_PHY_MODE_CICADA_V2:
diff --git a/sys/dev/usb/net/if_udav.c b/sys/dev/usb/net/if_udav.c
index a1a0a8d..a6598ef 100644
--- a/sys/dev/usb/net/if_udav.c
+++ b/sys/dev/usb/net/if_udav.c
@@ -210,6 +210,7 @@ static const struct usb_device_id udav_devs[] = {
{USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)},
/* Kontron AG USB Ethernet */
{USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)},
+ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)},
};
static void
diff --git a/sys/dev/usb/serial/umcs.c b/sys/dev/usb/serial/umcs.c
new file mode 100644
index 0000000..c74044e
--- /dev/null
+++ b/sys/dev/usb/serial/umcs.c
@@ -0,0 +1,1075 @@
+/*-
+ * Copyright (c) 2010 Lev Serebryakov <lev@FreeBSD.org>.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ */
+
+/*
+ * This driver supports several multiport USB-to-RS232 serial adapters driven
+ * by MosChip mos7820 and mos7840, bridge chips.
+ * The adapters are sold under many different brand names.
+ *
+ * Datasheets are available at MosChip www site at
+ * http://www.moschip.com. The datasheets don't contain full
+ * programming information for the chip.
+ *
+ * It is nornal to have only two enabled ports in devices, based on
+ * quad-port mos7840.
+ *
+ */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <sys/param.h>
+#include <sys/queue.h>
+#include <sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include <dev/usb/usb_cdc.h>
+#include "usbdevs.h"
+
+#define USB_DEBUG_VAR umcs_debug
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_process.h>
+
+#include <dev/usb/serial/usb_serial.h>
+
+#include <dev/usb/serial/umcs.h>
+
+#define UMCS7840_MODVER 1
+
+#ifdef USB_DEBUG
+static int umcs_debug = 0;
+
+SYSCTL_NODE(_hw_usb, OID_AUTO, umcs, CTLFLAG_RW, 0, "USB umcs quadport serial adapter");
+SYSCTL_INT(_hw_usb_umcs, OID_AUTO, debug, CTLFLAG_RW, &umcs_debug, 0, "Debug level");
+#endif /* USB_DEBUG */
+
+
+/*
+ * Two-port devices (both with 7820 chip and 7840 chip configured as two-port)
+ * have ports 0 and 2, with ports 1 and 3 omitted.
+ * So,PHYSICAL port numbers (indexes) on two-port device will be 0 and 2.
+ * This driver trys to use physical numbers as much as possible.
+ */
+
+/*
+ * Indexed by PHYSICAL port number.
+ * Pack non-regular registers to array to easier if-less access.
+ */
+struct umcs7840_port_registers {
+ uint8_t reg_sp; /* SP register. */
+ uint8_t reg_control; /* CONTROL register. */
+ uint8_t reg_dcr; /* DCR0 register. DCR1 & DCR2 can be
+ * calculated */
+};
+
+static const struct umcs7840_port_registers umcs7840_port_registers[UMCS7840_MAX_PORTS] = {
+ {.reg_sp = MCS7840_DEV_REG_SP1,.reg_control = MCS7840_DEV_REG_CONTROL1,.reg_dcr = MCS7840_DEV_REG_DCR0_1},
+ {.reg_sp = MCS7840_DEV_REG_SP2,.reg_control = MCS7840_DEV_REG_CONTROL2,.reg_dcr = MCS7840_DEV_REG_DCR0_2},
+ {.reg_sp = MCS7840_DEV_REG_SP3,.reg_control = MCS7840_DEV_REG_CONTROL3,.reg_dcr = MCS7840_DEV_REG_DCR0_3},
+ {.reg_sp = MCS7840_DEV_REG_SP4,.reg_control = MCS7840_DEV_REG_CONTROL4,.reg_dcr = MCS7840_DEV_REG_DCR0_4},
+};
+
+enum {
+ UMCS7840_BULK_RD_EP,
+ UMCS7840_BULK_WR_EP,
+ UMCS7840_N_TRANSFERS
+};
+
+struct umcs7840_softc_oneport {
+ struct usb_xfer *sc_xfer[UMCS7840_N_TRANSFERS]; /* Control structures
+ * for two transfers */
+
+ uint8_t sc_lcr; /* local line control register */
+ uint8_t sc_mcr; /* local modem control register */
+ uint8_t sc_lsr; /* local line status register */
+ uint8_t sc_msr; /* local modem status register */
+};
+
+struct umcs7840_softc {
+ struct ucom_super_softc sc_super_ucom;
+ struct ucom_softc sc_ucom[UMCS7840_MAX_PORTS]; /* Need to be continuous
+ * array, so indexed by
+ * LOGICAL port
+ * (subunit) number */
+
+ struct usb_xfer *sc_intr_xfer; /* Interrupt endpoint */
+
+ device_t sc_dev; /* Device for error prints */
+ struct usb_device *sc_udev; /* USB Device for all operations */
+ struct mtx sc_mtx; /* ucom requires this */
+
+ uint8_t sc_driver_done; /* Flag when enumeration is finished */
+
+ uint8_t sc_numports; /* Number of ports (subunits) */
+ struct umcs7840_softc_oneport sc_ports[UMCS7840_MAX_PORTS]; /* Indexed by PHYSICAL
+ * port number. */
+};
+
+/* prototypes */
+static usb_error_t umcs7840_get_reg_sync(struct umcs7840_softc *, uint8_t, uint8_t *);
+static usb_error_t umcs7840_set_reg_sync(struct umcs7840_softc *, uint8_t, uint8_t);
+static usb_error_t umcs7840_get_UART_reg_sync(struct umcs7840_softc *, uint8_t, uint8_t, uint8_t *);
+static usb_error_t umcs7840_set_UART_reg_sync(struct umcs7840_softc *, uint8_t, uint8_t, uint8_t);
+
+static usb_error_t umcs7840_set_baudrate(struct umcs7840_softc *, uint8_t, uint32_t);
+static usb_error_t umcs7840_calc_baudrate(uint32_t rate, uint16_t *, uint8_t *);
+
+static void umcs7840_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *);
+static void umcs7840_cfg_set_dtr(struct ucom_softc *, uint8_t);
+static void umcs7840_cfg_set_rts(struct ucom_softc *, uint8_t);
+static void umcs7840_cfg_set_break(struct ucom_softc *, uint8_t);
+static void umcs7840_cfg_param(struct ucom_softc *, struct termios *);
+static void umcs7840_cfg_open(struct ucom_softc *);
+static void umcs7840_cfg_close(struct ucom_softc *);
+
+static int umcs7840_pre_param(struct ucom_softc *, struct termios *);
+
+static void umcs7840_start_read(struct ucom_softc *);
+static void umcs7840_stop_read(struct ucom_softc *);
+
+static void umcs7840_start_write(struct ucom_softc *);
+static void umcs7840_stop_write(struct ucom_softc *);
+
+static void umcs7840_poll(struct ucom_softc *ucom);
+
+static device_probe_t umcs7840_probe;
+static device_attach_t umcs7840_attach;
+static device_detach_t umcs7840_detach;
+
+static usb_callback_t umcs7840_intr_callback;
+static usb_callback_t umcs7840_read_callback1;
+static usb_callback_t umcs7840_read_callback2;
+static usb_callback_t umcs7840_read_callback3;
+static usb_callback_t umcs7840_read_callback4;
+static usb_callback_t umcs7840_write_callback1;
+static usb_callback_t umcs7840_write_callback2;
+static usb_callback_t umcs7840_write_callback3;
+static usb_callback_t umcs7840_write_callback4;
+
+static void umcs7840_read_callbackN(struct usb_xfer *, usb_error_t, uint8_t);
+static void umcs7840_write_callbackN(struct usb_xfer *, usb_error_t, uint8_t);
+
+/* Indexed by LOGICAL port number (subunit), so two-port device uses 0 & 1 */
+static usb_callback_t *umcs7840_rw_callbacks[UMCS7840_MAX_PORTS][UMCS7840_N_TRANSFERS] = {
+ {&umcs7840_read_callback1, &umcs7840_write_callback1},
+ {&umcs7840_read_callback2, &umcs7840_write_callback2},
+ {&umcs7840_read_callback3, &umcs7840_write_callback3},
+ {&umcs7840_read_callback4, &umcs7840_write_callback4},
+};
+
+static const struct usb_config umcs7840_bulk_config_data[UMCS7840_N_TRANSFERS] = {
+ [UMCS7840_BULK_RD_EP] = {
+ .type = UE_BULK,
+ .endpoint = 0x01,
+ .direction = UE_DIR_IN,
+ .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
+ .bufsize = 0, /* use wMaxPacketSize */
+ .callback = &umcs7840_read_callback1,
+ .if_index = 0,
+ },
+
+ [UMCS7840_BULK_WR_EP] = {
+ .type = UE_BULK,
+ .endpoint = 0x02,
+ .direction = UE_DIR_OUT,
+ .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
+ .bufsize = 0, /* use wMaxPacketSize */
+ .callback = &umcs7840_write_callback1,
+ .if_index = 0,
+ },
+};
+
+static const struct usb_config umcs7840_intr_config_data[1] = {
+ [0] = {
+ .type = UE_INTERRUPT,
+ .endpoint = 0x09,
+ .direction = UE_DIR_IN,
+ .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
+ .bufsize = 0, /* use wMaxPacketSize */
+ .callback = &umcs7840_intr_callback,
+ .if_index = 0,
+ },
+};
+
+static struct ucom_callback umcs7840_callback = {
+ .ucom_cfg_get_status = &umcs7840_cfg_get_status,
+
+ .ucom_cfg_set_dtr = &umcs7840_cfg_set_dtr,
+ .ucom_cfg_set_rts = &umcs7840_cfg_set_rts,
+ .ucom_cfg_set_break = &umcs7840_cfg_set_break,
+
+ .ucom_cfg_param = &umcs7840_cfg_param,
+ .ucom_cfg_open = &umcs7840_cfg_open,
+ .ucom_cfg_close = &umcs7840_cfg_close,
+
+ .ucom_pre_param = &umcs7840_pre_param,
+
+ .ucom_start_read = &umcs7840_start_read,
+ .ucom_stop_read = &umcs7840_stop_read,
+
+ .ucom_start_write = &umcs7840_start_write,
+ .ucom_stop_write = &umcs7840_stop_write,
+
+ .ucom_poll = &umcs7840_poll,
+};
+
+static const struct usb_device_id umcs7840_devs[] = {
+ {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7820, 0)},
+ {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7840, 0)},
+};
+
+static device_method_t umcs7840_methods[] = {
+ DEVMETHOD(device_probe, umcs7840_probe),
+ DEVMETHOD(device_attach, umcs7840_attach),
+ DEVMETHOD(device_detach, umcs7840_detach),
+ {0, 0}
+};
+
+static devclass_t umcs7840_devclass;
+
+static driver_t umcs7840_driver = {
+ .name = "umcs7840",
+ .methods = umcs7840_methods,
+ .size = sizeof(struct umcs7840_softc),
+};
+
+DRIVER_MODULE(umcs7840, uhub, umcs7840_driver, umcs7840_devclass, 0, 0);
+MODULE_DEPEND(umcs7840, ucom, 1, 1, 1);
+MODULE_DEPEND(umcs7840, usb, 1, 1, 1);
+MODULE_VERSION(umcs7840, UMCS7840_MODVER);
+
+static int
+umcs7840_probe(device_t dev)
+{
+ struct usb_attach_arg *uaa = device_get_ivars(dev);
+
+ if (uaa->usb_mode != USB_MODE_HOST)
+ return (ENXIO);
+ if (uaa->info.bConfigIndex != MCS7840_CONFIG_INDEX)
+ return (ENXIO);
+ if (uaa->info.bIfaceIndex != MCS7840_IFACE_INDEX)
+ return (ENXIO);
+ return (usbd_lookup_id_by_uaa(umcs7840_devs, sizeof(umcs7840_devs), uaa));
+}
+
+static int
+umcs7840_attach(device_t dev)
+{
+ struct usb_config umcs7840_config_tmp[UMCS7840_N_TRANSFERS];
+ struct usb_attach_arg *uaa = device_get_ivars(dev);
+ struct umcs7840_softc *sc = device_get_softc(dev);
+
+ uint8_t iface_index = MCS7840_IFACE_INDEX;
+ int error;
+ int subunit;
+ int n;
+ uint8_t data;
+
+ for (n = 0; n < UMCS7840_N_TRANSFERS; ++n)
+ umcs7840_config_tmp[n] = umcs7840_bulk_config_data[n];
+
+ device_set_usb_desc(dev);
+ mtx_init(&sc->sc_mtx, "umcs7840", NULL, MTX_DEF);
+
+ sc->sc_dev = dev;
+ sc->sc_udev = uaa->device;
+
+ /*
+ * Get number of ports
+ * Documentation (full datasheet) says, that number of ports is
+ * set as MCS7840_DEV_MODE_SELECT24S bit in MODE R/Only
+ * register. But vendor driver uses these undocumented
+ * register & bit.
+ *
+ * Experiments show, that MODE register can have `0'
+ * (4 ports) bit on 2-port device, so use vendor driver's way.
+ *
+ * Also, see notes in header file for these constants.
+ */
+ umcs7840_get_reg_sync(sc, MCS7840_DEV_REG_GPIO, &data);
+ if (data & MCS7840_DEV_GPIO_4PORTS) {
+ sc->sc_numports = 4;
+ /* Store physical port numbers in sc_portno */
+ sc->sc_ucom[0].sc_portno = 0;
+ sc->sc_ucom[1].sc_portno = 1;
+ sc->sc_ucom[2].sc_portno = 2;
+ sc->sc_ucom[3].sc_portno = 3;
+ } else {
+ sc->sc_numports = 2;
+ /* Store physical port numbers in sc_portno */
+ sc->sc_ucom[0].sc_portno = 0;
+ sc->sc_ucom[1].sc_portno = 2; /* '1' is skipped */
+ }
+ device_printf(dev, "Chip mcs%04x, found %d active ports\n", uaa->info.idProduct, sc->sc_numports);
+ if (!umcs7840_get_reg_sync(sc, MCS7840_DEV_REG_MODE, &data)) {
+ device_printf(dev, "On-die confguration: RST: active %s, HRD: %s, PLL: %s, POR: %s, Ports: %s, EEPROM write %s, IrDA is %savailable\n",
+ (data & MCS7840_DEV_MODE_RESET) ? "low" : "high",
+ (data & MCS7840_DEV_MODE_SER_PRSNT) ? "yes" : "no",
+ (data & MCS7840_DEV_MODE_PLLBYPASS) ? "bypassed" : "avail",
+ (data & MCS7840_DEV_MODE_PORBYPASS) ? "bypassed" : "avail",
+ (data & MCS7840_DEV_MODE_SELECT24S) ? "2" : "4",
+ (data & MCS7840_DEV_MODE_EEPROMWR) ? "enabled" : "disabled",
+ (data & MCS7840_DEV_MODE_IRDA) ? "" : "not ");
+ }
+ /* Setup all transfers */
+ for (subunit = 0; subunit < sc->sc_numports; ++subunit) {
+ for (n = 0; n < UMCS7840_N_TRANSFERS; ++n) {
+ /* Set endpoint address */
+ umcs7840_config_tmp[n].endpoint = umcs7840_bulk_config_data[n].endpoint + 2 * sc->sc_ucom[subunit].sc_portno;
+ umcs7840_config_tmp[n].callback = umcs7840_rw_callbacks[subunit][n];
+ }
+ error = usbd_transfer_setup(uaa->device,
+ &iface_index, sc->sc_ports[sc->sc_ucom[subunit].sc_portno].sc_xfer, umcs7840_config_tmp,
+ UMCS7840_N_TRANSFERS, sc, &sc->sc_mtx);
+ if (error) {
+ device_printf(dev, "allocating USB transfers failed for subunit %d of %d\n",
+ subunit + 1, sc->sc_numports);
+ goto detach;
+ }
+ }
+ error = usbd_transfer_setup(uaa->device,
+ &iface_index, &sc->sc_intr_xfer, umcs7840_intr_config_data,
+ 1, sc, &sc->sc_mtx);
+ if (error) {
+ device_printf(dev, "allocating USB transfers failed for interrupt\n");
+ goto detach;
+ }
+ /* clear stall at first run */
+ mtx_lock(&sc->sc_mtx);
+ for (subunit = 0; subunit < sc->sc_numports; ++subunit) {
+ usbd_xfer_set_stall(sc->sc_ports[sc->sc_ucom[subunit].sc_portno].sc_xfer[UMCS7840_BULK_RD_EP]);
+ usbd_xfer_set_stall(sc->sc_ports[sc->sc_ucom[subunit].sc_portno].sc_xfer[UMCS7840_BULK_WR_EP]);
+ }
+ mtx_unlock(&sc->sc_mtx);
+
+ error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_numports, sc,
+ &umcs7840_callback, &sc->sc_mtx);
+ if (error)
+ goto detach;
+
+ ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
+
+ return (0);
+
+detach:
+ umcs7840_detach(dev);
+ return (ENXIO);
+}
+
+static int
+umcs7840_detach(device_t dev)
+{
+ struct umcs7840_softc *sc = device_get_softc(dev);
+ int subunit;
+
+ ucom_detach(&sc->sc_super_ucom, sc->sc_ucom);
+
+ for (subunit = 0; subunit < sc->sc_numports; ++subunit)
+ usbd_transfer_unsetup(sc->sc_ports[sc->sc_ucom[subunit].sc_portno].sc_xfer, UMCS7840_N_TRANSFERS);
+ usbd_transfer_unsetup(&sc->sc_intr_xfer, 1);
+
+ mtx_destroy(&sc->sc_mtx);
+ return (0);
+}
+
+static void
+umcs7840_cfg_open(struct ucom_softc *ucom)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint16_t pn = ucom->sc_portno;
+ uint8_t data;
+
+ /* If it very first open, finish global configuration */
+ if (!sc->sc_driver_done) {
+ /*
+ * USB enumeration is finished, pass internal memory to FIFOs
+ * If it is done in the end of "attach", kernel panics.
+ */
+ if (umcs7840_get_reg_sync(sc, MCS7840_DEV_REG_CONTROL1, &data))
+ return;
+ data |= MCS7840_DEV_CONTROL1_DRIVER_DONE;
+ if (umcs7840_set_reg_sync(sc, MCS7840_DEV_REG_CONTROL1, data))
+ return;
+ sc->sc_driver_done = 1;
+ }
+ /* Toggle reset bit on-off */
+ if (umcs7840_get_reg_sync(sc, umcs7840_port_registers[pn].reg_sp, &data))
+ return;
+ data |= MCS7840_DEV_SPx_UART_RESET;
+ if (umcs7840_set_reg_sync(sc, umcs7840_port_registers[pn].reg_sp, data))
+ return;
+ data &= ~MCS7840_DEV_SPx_UART_RESET;
+ if (umcs7840_set_reg_sync(sc, umcs7840_port_registers[pn].reg_sp, data))
+ return;
+
+ /* Set RS-232 mode */
+ if (umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_SCRATCHPAD, MCS7840_UART_SCRATCHPAD_RS232))
+ return;
+
+ /* Disable RX on time of initialization */
+ if (umcs7840_get_reg_sync(sc, umcs7840_port_registers[pn].reg_control, &data))
+ return;
+ data |= MCS7840_DEV_CONTROLx_RX_DISABLE;
+ if (umcs7840_set_reg_sync(sc, umcs7840_port_registers[pn].reg_control, data))
+ return;
+
+ /* Disable all interrupts */
+ if (umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_IER, 0))
+ return;
+
+ /* Reset FIFO -- documented */
+ if (umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_FCR, 0))
+ return;
+ if (umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_FCR,
+ MCS7840_UART_FCR_ENABLE | MCS7840_UART_FCR_FLUSHRHR |
+ MCS7840_UART_FCR_FLUSHTHR | MCS7840_UART_FCR_RTL_1_14))
+ return;
+
+ /* Set 8 bit, no parity, 1 stop bit -- documented */
+ sc->sc_ports[pn].sc_lcr = MCS7840_UART_LCR_DATALEN8 | MCS7840_UART_LCR_STOPB1;
+ if (umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_LCR, sc->sc_ports[pn].sc_lcr))
+ return;
+
+ /*
+ * Enable DTR/RTS on modem control, enable modem interrupts --
+ * documented
+ */
+ sc->sc_ports[pn].sc_mcr = MCS7840_UART_MCR_DTR | MCS7840_UART_MCR_RTS | MCS7840_UART_MCR_IE;
+ if (umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_MCR, sc->sc_ports[pn].sc_mcr))
+ return;
+
+ /* Clearing Bulkin and Bulkout FIFO */
+ if (umcs7840_get_reg_sync(sc, umcs7840_port_registers[pn].reg_sp, &data))
+ return;
+ data |= MCS7840_DEV_SPx_RESET_OUT_FIFO | MCS7840_DEV_SPx_RESET_IN_FIFO;
+ if (umcs7840_set_reg_sync(sc, umcs7840_port_registers[pn].reg_sp, data))
+ return;
+ data &= ~(MCS7840_DEV_SPx_RESET_OUT_FIFO | MCS7840_DEV_SPx_RESET_IN_FIFO);
+ if (umcs7840_set_reg_sync(sc, umcs7840_port_registers[pn].reg_sp, data))
+ return;
+
+ /* Set speed 9600 */
+ if (umcs7840_set_baudrate(sc, pn, 9600))
+ return;
+
+
+ /* Finally enable all interrupts -- documented */
+ /*
+ * Copied from vendor driver, I don't know why we should read LCR
+ * here
+ */
+ if (umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_LCR, &sc->sc_ports[pn].sc_lcr))
+ return;
+ if (umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_IER,
+ MCS7840_UART_IER_RXSTAT | MCS7840_UART_IER_MODEM))
+ return;
+
+ /* Enable RX */
+ if (umcs7840_get_reg_sync(sc, umcs7840_port_registers[pn].reg_control, &data))
+ return;
+ data &= ~MCS7840_DEV_CONTROLx_RX_DISABLE;
+ if (umcs7840_set_reg_sync(sc, umcs7840_port_registers[pn].reg_control, data))
+ return;
+
+ /* Read LSR & MSR */
+ if (umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_LSR, &sc->sc_ports[pn].sc_lsr))
+ return;
+ if (umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_MSR, &sc->sc_ports[pn].sc_msr))
+ return;
+ DPRINTF("Port %d has been opened, LSR=%02x MSR=%02x\n", pn, sc->sc_ports[pn].sc_lsr, sc->sc_ports[pn].sc_msr);
+}
+
+static void
+umcs7840_cfg_close(struct ucom_softc *ucom)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint16_t pn = ucom->sc_portno;
+ uint8_t data;
+
+ umcs7840_stop_read(ucom);
+ umcs7840_stop_write(ucom);
+
+ umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_MCR, 0);
+ umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_IER, 0);
+
+ /* Disable RX */
+ if (umcs7840_get_reg_sync(sc, umcs7840_port_registers[pn].reg_control, &data))
+ return;
+ data |= MCS7840_DEV_CONTROLx_RX_DISABLE;
+ if (umcs7840_set_reg_sync(sc, umcs7840_port_registers[pn].reg_control, data))
+ return;
+ DPRINTF("Port %d has been closed\n", pn);
+}
+
+static void
+umcs7840_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint8_t pn = ucom->sc_portno;
+
+ if (onoff)
+ sc->sc_ports[pn].sc_mcr |= MCS7840_UART_MCR_DTR;
+ else
+ sc->sc_ports[pn].sc_mcr &= ~MCS7840_UART_MCR_DTR;
+
+ umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_MCR, sc->sc_ports[pn].sc_mcr);
+ DPRINTF("Port %d DTR set to: %s\n", pn, onoff ? "on" : "off");
+}
+
+static void
+umcs7840_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint8_t pn = ucom->sc_portno;
+
+ if (onoff)
+ sc->sc_ports[pn].sc_mcr |= MCS7840_UART_MCR_RTS;
+ else
+ sc->sc_ports[pn].sc_mcr &= ~MCS7840_UART_MCR_RTS;
+
+ umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_MCR, sc->sc_ports[pn].sc_mcr);
+ DPRINTF("Port %d RTS set to: %s\n", pn, onoff ? "on" : "off");
+}
+
+static void
+umcs7840_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint8_t pn = ucom->sc_portno;
+
+ if (onoff)
+ sc->sc_ports[pn].sc_lcr |= MCS7840_UART_LCR_BREAK;
+ else
+ sc->sc_ports[pn].sc_lcr &= ~MCS7840_UART_LCR_BREAK;
+
+ umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_LCR, sc->sc_ports[pn].sc_lcr);
+ DPRINTF("Port %d BREAK set to: %s\n", pn, onoff ? "on" : "off");
+}
+
+
+static void
+umcs7840_cfg_param(struct ucom_softc *ucom, struct termios *t)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint8_t pn = ucom->sc_portno;
+ uint8_t lcr = sc->sc_ports[pn].sc_lcr;
+ uint8_t mcr = sc->sc_ports[pn].sc_mcr;
+
+ DPRINTF("Port %d config:\n", pn);
+ if (t->c_cflag & CSTOPB) {
+ DPRINTF(" 2 stop bits\n");
+ lcr |= MCS7840_UART_LCR_STOPB2;
+ } else {
+ lcr |= MCS7840_UART_LCR_STOPB1;
+ DPRINTF(" 1 stop bit\n");
+ }
+
+ lcr &= ~MCS7840_UART_LCR_PARITYMASK;
+ if (t->c_cflag & PARENB) {
+ lcr |= MCS7840_UART_LCR_PARITYON;
+ if (t->c_cflag & PARODD) {
+ lcr = MCS7840_UART_LCR_PARITYODD;
+ DPRINTF(" parity on - odd\n");
+ } else {
+ lcr = MCS7840_UART_LCR_PARITYEVEN;
+ DPRINTF(" parity on - even\n");
+ }
+ } else {
+ lcr &= ~MCS7840_UART_LCR_PARITYON;
+ DPRINTF(" parity off\n");
+ }
+
+ lcr &= ~MCS7840_UART_LCR_DATALENMASK;
+ switch (t->c_cflag & CSIZE) {
+ case CS5:
+ lcr |= MCS7840_UART_LCR_DATALEN5;
+ DPRINTF(" 5 bit\n");
+ break;
+ case CS6:
+ lcr |= MCS7840_UART_LCR_DATALEN6;
+ DPRINTF(" 6 bit\n");
+ break;
+ case CS7:
+ lcr |= MCS7840_UART_LCR_DATALEN7;
+ DPRINTF(" 7 bit\n");
+ break;
+ case CS8:
+ lcr |= MCS7840_UART_LCR_DATALEN8;
+ DPRINTF(" 8 bit\n");
+ break;
+ }
+
+ if (t->c_cflag & CRTSCTS) {
+ mcr |= MCS7840_UART_MCR_CTSRTS;
+ DPRINTF(" CTS/RTS\n");
+ } else
+ mcr &= ~MCS7840_UART_MCR_CTSRTS;
+
+ if (t->c_cflag & (CDTR_IFLOW | CDSR_OFLOW)) {
+ mcr |= MCS7840_UART_MCR_DTRDSR;
+ DPRINTF(" DTR/DSR\n");
+ } else
+ mcr &= ~MCS7840_UART_MCR_DTRDSR;
+
+ sc->sc_ports[pn].sc_lcr = lcr;
+ umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_LCR, sc->sc_ports[pn].sc_lcr);
+ DPRINTF("Port %d LCR=%02x\n", pn, sc->sc_ports[pn].sc_lcr);
+
+ sc->sc_ports[pn].sc_mcr = mcr;
+ umcs7840_set_UART_reg_sync(sc, pn, MCS7840_UART_REG_MCR, sc->sc_ports[pn].sc_mcr);
+ DPRINTF("Port %d MCR=%02x\n", pn, sc->sc_ports[pn].sc_mcr);
+
+ umcs7840_set_baudrate(sc, pn, t->c_ospeed);
+}
+
+
+static int
+umcs7840_pre_param(struct ucom_softc *ucom, struct termios *t)
+{
+ uint8_t clk;
+ uint16_t divisor;
+
+ if (umcs7840_calc_baudrate(t->c_ospeed, &divisor, &clk) || !divisor)
+ return (EINVAL);
+ return (0);
+}
+
+static void
+umcs7840_start_read(struct ucom_softc *ucom)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint8_t pn = ucom->sc_portno;
+
+ /* Start interrupt transfer */
+ usbd_transfer_start(sc->sc_intr_xfer);
+
+ /* Start read transfer */
+ usbd_transfer_start(sc->sc_ports[pn].sc_xfer[UMCS7840_BULK_RD_EP]);
+}
+
+static void
+umcs7840_stop_read(struct ucom_softc *ucom)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint8_t pn = ucom->sc_portno;
+
+ /* Stop read transfer */
+ usbd_transfer_stop(sc->sc_ports[pn].sc_xfer[UMCS7840_BULK_RD_EP]);
+}
+
+static void
+umcs7840_start_write(struct ucom_softc *ucom)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint8_t pn = ucom->sc_portno;
+
+ /* Start interrupt transfer */
+ usbd_transfer_start(sc->sc_intr_xfer);
+
+ /* Start write transfer */
+ usbd_transfer_start(sc->sc_ports[pn].sc_xfer[UMCS7840_BULK_WR_EP]);
+}
+
+static void
+umcs7840_stop_write(struct ucom_softc *ucom)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+ uint8_t pn = ucom->sc_portno;
+
+ /* Stop write transfer */
+ usbd_transfer_stop(sc->sc_ports[pn].sc_xfer[UMCS7840_BULK_WR_EP]);
+}
+
+static void
+umcs7840_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+
+ *lsr = sc->sc_ports[ucom->sc_portno].sc_lsr;
+ *msr = sc->sc_ports[ucom->sc_portno].sc_msr;
+ DPRINTF("Port %d status: LSR=%02x MSR=%02x\n", ucom->sc_portno, *lsr, *msr);
+}
+
+static void
+umcs7840_intr_callback(struct usb_xfer *xfer, usb_error_t error)
+{
+ struct umcs7840_softc *sc = usbd_xfer_softc(xfer);
+ struct usb_page_cache *pc;
+ uint8_t buf[13];
+ int actlen;
+ int subunit;
+
+ usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
+
+ switch (USB_GET_STATE(xfer)) {
+ case USB_ST_TRANSFERRED:
+ if (actlen == 5 || actlen == 13) {
+ pc = usbd_xfer_get_frame(xfer, 0);
+ usbd_copy_out(pc, 0, buf, actlen);
+ /* Check status of all ports */
+ for (subunit = 0; subunit < sc->sc_numports; ++subunit) {
+ uint8_t pn = sc->sc_ucom[subunit].sc_portno;
+
+ if (buf[pn] & MCS7840_UART_ISR_NOPENDING)
+ continue;
+ DPRINTF("Port %d has pending interrupt: %02x (FIFO: %02x)\n", pn, buf[pn] & MCS7840_UART_ISR_INTMASK, buf[pn] & (~MCS7840_UART_ISR_INTMASK));
+ switch (buf[pn] & MCS7840_UART_ISR_INTMASK) {
+ case MCS7840_UART_ISR_RXERR:
+ case MCS7840_UART_ISR_RXHASDATA:
+ case MCS7840_UART_ISR_RXTIMEOUT:
+ /* Read new LSR */
+ if (umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_LSR, &sc->sc_ports[pn].sc_lsr))
+ break; /* Inner switch */
+ ucom_status_change(&sc->sc_ucom[subunit]);
+ /* Inner switch */
+ break;
+ case MCS7840_UART_ISR_TXEMPTY:
+ /* Do nothing */
+ break; /* Inner switch */
+ case MCS7840_UART_ISR_MSCHANGE:
+ /* Read new MSR */
+ if (umcs7840_get_UART_reg_sync(sc, pn, MCS7840_UART_REG_MSR, &sc->sc_ports[pn].sc_msr))
+ break; /* Inner switch */
+ DPRINTF("Port %d: new MSR %02x\n", pn, sc->sc_ports[pn].sc_msr);
+ ucom_status_change(&sc->sc_ucom[subunit]);
+ break;
+ }
+ }
+ } else
+ device_printf(sc->sc_dev, "Invalid interrupt data length %d", actlen);
+ /* FALLTHROUGH */
+ case USB_ST_SETUP:
+tr_setup:
+ usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
+ usbd_transfer_submit(xfer);
+ return;
+
+ default: /* Error */
+ if (error != USB_ERR_CANCELLED) {
+ /* try to clear stall first */
+ usbd_xfer_set_stall(xfer);
+ goto tr_setup;
+ }
+ return;
+ }
+}
+
+static void
+umcs7840_read_callback1(struct usb_xfer *xfer, usb_error_t error)
+{
+ umcs7840_read_callbackN(xfer, error, 0);
+}
+
+static void
+umcs7840_read_callback2(struct usb_xfer *xfer, usb_error_t error)
+{
+ umcs7840_read_callbackN(xfer, error, 1);
+}
+static void
+umcs7840_read_callback3(struct usb_xfer *xfer, usb_error_t error)
+{
+ umcs7840_read_callbackN(xfer, error, 2);
+}
+
+static void
+umcs7840_read_callback4(struct usb_xfer *xfer, usb_error_t error)
+{
+ umcs7840_read_callbackN(xfer, error, 3);
+}
+
+static void
+umcs7840_read_callbackN(struct usb_xfer *xfer, usb_error_t error, uint8_t subunit)
+{
+ struct umcs7840_softc *sc = usbd_xfer_softc(xfer);
+ struct ucom_softc *ucom = &sc->sc_ucom[subunit];
+ struct usb_page_cache *pc;
+ int actlen;
+
+ usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
+
+ DPRINTF("Port %d read, state = %d, data length = %d\n", ucom->sc_portno, USB_GET_STATE(xfer), actlen);
+
+ switch (USB_GET_STATE(xfer)) {
+ case USB_ST_TRANSFERRED:
+ pc = usbd_xfer_get_frame(xfer, 0);
+ ucom_put_data(ucom, pc, 0, actlen);
+ /* FALLTHROUGH */
+ case USB_ST_SETUP:
+tr_setup:
+ usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
+ usbd_transfer_submit(xfer);
+ return;
+
+ default: /* Error */
+ if (error != USB_ERR_CANCELLED) {
+ /* try to clear stall first */
+ usbd_xfer_set_stall(xfer);
+ goto tr_setup;
+ }
+ return;
+ }
+}
+
+static void
+umcs7840_write_callback1(struct usb_xfer *xfer, usb_error_t error)
+{
+ umcs7840_write_callbackN(xfer, error, 0);
+}
+
+static void
+umcs7840_write_callback2(struct usb_xfer *xfer, usb_error_t error)
+{
+ umcs7840_write_callbackN(xfer, error, 1);
+}
+
+static void
+umcs7840_write_callback3(struct usb_xfer *xfer, usb_error_t error)
+{
+ umcs7840_write_callbackN(xfer, error, 2);
+}
+
+static void
+umcs7840_write_callback4(struct usb_xfer *xfer, usb_error_t error)
+{
+ umcs7840_write_callbackN(xfer, error, 3);
+}
+
+static void
+umcs7840_write_callbackN(struct usb_xfer *xfer, usb_error_t error, uint8_t subunit)
+{
+ struct umcs7840_softc *sc = usbd_xfer_softc(xfer);
+ struct ucom_softc *ucom = &sc->sc_ucom[subunit];
+ struct usb_page_cache *pc;
+ uint32_t actlen;
+
+ DPRINTF("Port %d write, state = %d\n", ucom->sc_portno, USB_GET_STATE(xfer));
+
+ switch (USB_GET_STATE(xfer)) {
+ case USB_ST_SETUP:
+ case USB_ST_TRANSFERRED:
+tr_setup:
+ pc = usbd_xfer_get_frame(xfer, 0);
+ if (ucom_get_data(ucom, pc, 0, usbd_xfer_max_len(xfer), &actlen)) {
+ DPRINTF("Port %d write, has %d bytes\n", ucom->sc_portno, actlen);
+ usbd_xfer_set_frame_len(xfer, 0, actlen);
+ usbd_transfer_submit(xfer);
+ }
+ return;
+
+ default: /* Error */
+ if (error != USB_ERR_CANCELLED) {
+ /* try to clear stall first */
+ usbd_xfer_set_stall(xfer);
+ goto tr_setup;
+ }
+ return;
+ }
+}
+
+static void
+umcs7840_poll(struct ucom_softc *ucom)
+{
+ struct umcs7840_softc *sc = ucom->sc_parent;
+
+ DPRINTF("Port %d poll\n", ucom->sc_portno);
+ usbd_transfer_poll(sc->sc_ports[ucom->sc_portno].sc_xfer, UMCS7840_N_TRANSFERS);
+ usbd_transfer_poll(&sc->sc_intr_xfer, 1);
+}
+
+static usb_error_t
+umcs7840_get_reg_sync(struct umcs7840_softc *sc, uint8_t reg, uint8_t *data)
+{
+ struct usb_device_request req;
+ usb_error_t err;
+ uint16_t len;
+
+ req.bmRequestType = UT_READ_VENDOR_DEVICE;
+ req.bRequest = MCS7840_RDREQ;
+ USETW(req.wValue, 0);
+ USETW(req.wIndex, reg);
+ USETW(req.wLength, UMCS7840_READ_LENGTH);
+
+ err = usbd_do_request_proc(sc->sc_udev, &sc->sc_super_ucom.sc_tq, &req, (void *)data, 0, &len, UMCS7840_CTRL_TIMEOUT);
+ if (err == USB_ERR_NORMAL_COMPLETION && len != 1) {
+ device_printf(sc->sc_dev, "Reading register %d failed: invalid length %d\n", reg, len);
+ return (USB_ERR_INVAL);
+ } else if (err)
+ device_printf(sc->sc_dev, "Reading register %d failed: %s\n", reg, usbd_errstr(err));
+ return (err);
+}
+
+static usb_error_t
+umcs7840_set_reg_sync(struct umcs7840_softc *sc, uint8_t reg, uint8_t data)
+{
+ struct usb_device_request req;
+ usb_error_t err;
+
+ req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
+ req.bRequest = MCS7840_WRREQ;
+ USETW(req.wValue, data);
+ USETW(req.wIndex, reg);
+ USETW(req.wLength, 0);
+
+ err = usbd_do_request_proc(sc->sc_udev, &sc->sc_super_ucom.sc_tq, &req, NULL, 0, NULL, UMCS7840_CTRL_TIMEOUT);
+ if (err)
+ device_printf(sc->sc_dev, "Writing register %d failed: %s\n", reg, usbd_errstr(err));
+
+ return (err);
+}
+
+static usb_error_t
+umcs7840_get_UART_reg_sync(struct umcs7840_softc *sc, uint8_t portno, uint8_t reg, uint8_t *data)
+{
+ struct usb_device_request req;
+ uint16_t wVal;
+ usb_error_t err;
+ uint16_t len;
+
+ /* portno is port number */
+ wVal = ((uint16_t)(portno + 1)) << 8;
+
+ req.bmRequestType = UT_READ_VENDOR_DEVICE;
+ req.bRequest = MCS7840_RDREQ;
+ USETW(req.wValue, wVal);
+ USETW(req.wIndex, reg);
+ USETW(req.wLength, UMCS7840_READ_LENGTH);
+
+ err = usbd_do_request_proc(sc->sc_udev, &sc->sc_super_ucom.sc_tq, &req, (void *)data, 0, &len, UMCS7840_CTRL_TIMEOUT);
+ if (err == USB_ERR_NORMAL_COMPLETION && len != 1) {
+ device_printf(sc->sc_dev, "Reading UART%d register %d failed: invalid length %d\n", portno, reg, len);
+ return (USB_ERR_INVAL);
+ } else if (err)
+ device_printf(sc->sc_dev, "Reading UART%d register %d failed: %s\n", portno, reg, usbd_errstr(err));
+ return (err);
+}
+
+static usb_error_t
+umcs7840_set_UART_reg_sync(struct umcs7840_softc *sc, uint8_t portno, uint8_t reg, uint8_t data)
+{
+ struct usb_device_request req;
+ usb_error_t err;
+ uint16_t wVal;
+
+ /* portno is port number */
+ wVal = ((uint16_t)(portno + 1)) << 8 | data;
+
+ req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
+ req.bRequest = MCS7840_WRREQ;
+ USETW(req.wValue, wVal);
+ USETW(req.wIndex, reg);
+ USETW(req.wLength, 0);
+
+ err = usbd_do_request_proc(sc->sc_udev, &sc->sc_super_ucom.sc_tq, &req, NULL, 0, NULL, UMCS7840_CTRL_TIMEOUT);
+ if (err)
+ device_printf(sc->sc_dev, "Writing UART%d register %d failed: %s\n", portno, reg, usbd_errstr(err));
+ return (err);
+}
+
+static usb_error_t
+umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno, uint32_t rate)
+{
+ usb_error_t err;
+ uint16_t divisor;
+ uint8_t clk;
+ uint8_t data;
+
+ if (umcs7840_calc_baudrate(rate, &divisor, &clk)) {
+ DPRINTF("Port %d bad speed: %d\n", portno, rate);
+ return (-1);
+ }
+ if (divisor == 0 || (clk & MCS7840_DEV_SPx_CLOCK_MASK) != clk) {
+ DPRINTF("Port %d bad speed calculation: %d\n", portno, rate);
+ return (-1);
+ }
+ DPRINTF("Port %d set speed: %d (%02x / %d)\n", portno, rate, clk, divisor);
+
+ /* Set clock source for standard BAUD frequences */
+ err = umcs7840_get_reg_sync(sc, umcs7840_port_registers[portno].reg_sp, &data);
+ if (err)
+ return (err);
+ data &= MCS7840_DEV_SPx_CLOCK_MASK;
+ data |= clk;
+ err = umcs7840_set_reg_sync(sc, umcs7840_port_registers[portno].reg_sp, data);
+ if (err)
+ return (err);
+
+ /* Set divider */
+ sc->sc_ports[portno].sc_lcr |= MCS7840_UART_LCR_DIVISORS;
+ err = umcs7840_set_UART_reg_sync(sc, portno, MCS7840_UART_REG_LCR, sc->sc_ports[portno].sc_lcr);
+ if (err)
+ return (err);
+
+ err = umcs7840_set_UART_reg_sync(sc, portno, MCS7840_UART_REG_DLL, (uint8_t)(divisor & 0xff));
+ if (err)
+ return (err);
+ err = umcs7840_set_UART_reg_sync(sc, portno, MCS7840_UART_REG_DLM, (uint8_t)((divisor >> 8) & 0xff));
+ if (err)
+ return (err);
+
+ /* Turn off access to DLL/DLM registers of UART */
+ sc->sc_ports[portno].sc_lcr &= ~MCS7840_UART_LCR_DIVISORS;
+ err = umcs7840_set_UART_reg_sync(sc, portno, MCS7840_UART_REG_LCR, sc->sc_ports[portno].sc_lcr);
+ if (err)
+ return (err);
+ return (0);
+}
+
+/* Maximum speeds for standard frequences, when PLL is not used */
+static const uint32_t umcs7840_baudrate_divisors[] = {0, 115200, 230400, 403200, 460800, 806400, 921600, 1572864, 3145728,};
+static const uint8_t umcs7840_baudrate_divisors_len = sizeof(umcs7840_baudrate_divisors) / sizeof(umcs7840_baudrate_divisors[0]);
+
+static usb_error_t
+umcs7840_calc_baudrate(uint32_t rate, uint16_t *divisor, uint8_t *clk)
+{
+ uint8_t i = 0;
+
+ if (rate > umcs7840_baudrate_divisors[umcs7840_baudrate_divisors_len - 1])
+ return (-1);
+
+ for (i = 0; i < umcs7840_baudrate_divisors_len - 1 &&
+ !(rate > umcs7840_baudrate_divisors[i] && rate <= umcs7840_baudrate_divisors[i + 1]); ++i);
+ *divisor = umcs7840_baudrate_divisors[i + 1] / rate;
+ /* 0x00 .. 0x70 */
+ *clk = i << MCS7840_DEV_SPx_CLOCK_SHIFT;
+ return (0);
+}
diff --git a/sys/dev/usb/serial/umcs.h b/sys/dev/usb/serial/umcs.h
new file mode 100644
index 0000000..310b4af
--- /dev/null
+++ b/sys/dev/usb/serial/umcs.h
@@ -0,0 +1,644 @@
+/* $FreeBSD$ */
+/*-
+ * Copyright (c) 2010 Lev Serebryakov <lev@FreeBSD.org>.
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ */
+#ifndef _UMCS7840_H_
+#define _UMCS7840_H_
+
+#define UMCS7840_MAX_PORTS 4
+
+#define UMCS7840_READ_LENGTH 1 /* bytes */
+#define UMCS7840_CTRL_TIMEOUT 500 /* ms */
+
+/* Read/Wrtire registers vendor commands */
+#define MCS7840_RDREQ 0x0d
+#define MCS7840_WRREQ 0x0e
+
+/* Read/Wrtie EEPROM values */
+#define MCS7840_EEPROM_RW_WVALUE 0x0900
+
+/*
+ * All these registers are documented only in full datasheet,
+ * which can be requested from MosChip tech support.
+ */
+#define MCS7840_DEV_REG_SP1 0x00 /* Options for for UART 1, R/W */
+#define MCS7840_DEV_REG_CONTROL1 0x01 /* Control bits for UART 1,
+ * R/W */
+#define MCS7840_DEV_REG_PINPONGHIGH 0x02 /* High bits of ping-pong
+ * register, R/W */
+#define MCS7840_DEV_REG_PINPONGLOW 0x03 /* Low bits of ping-pong
+ * register, R/W */
+/* DCRx_1 Registers goes here (see below, they are documented) */
+#define MCS7840_DEV_REG_GPIO 0x07 /* GPIO_0 and GPIO_1 bits,
+ * undocumented, see notes
+ * below R/W */
+#define MCS7840_DEV_REG_SP2 0x08 /* Options for for UART 2, R/W */
+#define MCS7840_DEV_REG_CONTROL2 0x09 /* Control bits for UART 2,
+ * R/W */
+#define MCS7840_DEV_REG_SP3 0x0a /* Options for for UART 3, R/W */
+#define MCS7840_DEV_REG_CONTROL3 0x0b /* Control bits for UART 3,
+ * R/W */
+#define MCS7840_DEV_REG_SP4 0x0c /* Options for for UART 4, R/W */
+#define MCS7840_DEV_REG_CONTROL4 0x0d /* Control bits for UART 4,
+ * R/W */
+#define MCS7840_DEV_REG_PLL_DIV_M 0x0e /* Pre-diviedr for PLL, R/W */
+#define MCS7840_DEV_REG_UNKNOWN1 0x0f /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_PLL_DIV_N 0x10 /* Loop divider for PLL, R/W */
+#define MCS7840_DEV_REG_CLOCK_MUX 0x12 /* PLL input clock & Interrupt
+ * endpoint control, R/W */
+#define MCS7840_DEV_REG_UNKNOWN2 0x11 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_CLOCK_SELECT12 0x13 /* Clock source for ports 1 &
+ * 2, R/W */
+#define MCS7840_DEV_REG_CLOCK_SELECT34 0x14 /* Clock source for ports 3 &
+ * 4, R/W */
+#define MCS7840_DEV_REG_UNKNOWN3 0x15 /* NOT MENTIONED AND NOT USED */
+/* DCRx_2-DCRx_4 Registers goes here (see below, they are documented) */
+#define MCS7840_DEV_REG_UNKNOWN4 0x1f /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWN5 0x20 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWN6 0x21 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWN7 0x22 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWN8 0x23 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWN9 0x24 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWNA 0x25 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWNB 0x26 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWNC 0x27 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWND 0x28 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWNE 0x29 /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_UNKNOWNF 0x2a /* NOT MENTIONED AND NOT USED */
+#define MCS7840_DEV_REG_MODE 0x2b /* Hardware configuration,
+ * R/Only */
+#define MCS7840_DEV_REG_SP1_ICG 0x2c /* Inter character gap
+ * configuration for Port 1,
+ * R/W */
+#define MCS7840_DEV_REG_SP2_ICG 0x2d /* Inter character gap
+ * configuration for Port 2,
+ * R/W */
+#define MCS7840_DEV_REG_SP3_ICG 0x2e /* Inter character gap
+ * configuration for Port 3,
+ * R/W */
+#define MCS7840_DEV_REG_SP4_ICG 0x2f /* Inter character gap
+ * configuration for Port 4,
+ * R/W */
+#define MCS7840_DEV_REG_RX_SAMPLING12 0x30 /* RX sampling for ports 1 &
+ * 2, R/W */
+#define MCS7840_DEV_REG_RX_SAMPLING34 0x31 /* RX sampling for ports 3 &
+ * 4, R/W */
+#define MCS7840_DEV_REG_BI_FIFO_STAT1 0x32 /* Bulk-In FIFO Stat for Port
+ * 1, contains number of
+ * availiable bytes, R/Only */
+#define MCS7840_DEV_REG_BO_FIFO_STAT1 0x33 /* Bulk-out FIFO Stat for Port
+ * 1, contains number of
+ * availiable bytes, R/Only */
+#define MCS7840_DEV_REG_BI_FIFO_STAT2 0x34 /* Bulk-In FIFO Stat for Port
+ * 2, contains number of
+ * availiable bytes, R/Only */
+#define MCS7840_DEV_REG_BO_FIFO_STAT2 0x35 /* Bulk-out FIFO Stat for Port
+ * 2, contains number of
+ * availiable bytes, R/Only */
+#define MCS7840_DEV_REG_BI_FIFO_STAT3 0x36 /* Bulk-In FIFO Stat for Port
+ * 3, contains number of
+ * availiable bytes, R/Only */
+#define MCS7840_DEV_REG_BO_FIFO_STAT3 0x37 /* Bulk-out FIFO Stat for Port
+ * 3, contains number of
+ * availiable bytes, R/Only */
+#define MCS7840_DEV_REG_BI_FIFO_STAT4 0x38 /* Bulk-In FIFO Stat for Port
+ * 4, contains number of
+ * availiable bytes, R/Only */
+#define MCS7840_DEV_REG_BO_FIFO_STAT4 0x39 /* Bulk-out FIFO Stat for Port
+ * 4, contains number of
+ * availiable bytes, R/Only */
+#define MCS7840_DEV_REG_ZERO_PERIOD1 0x3a /* Period between zero out
+ * frames for Port 1, R/W */
+#define MCS7840_DEV_REG_ZERO_PERIOD2 0x3b /* Period between zero out
+ * frames for Port 1, R/W */
+#define MCS7840_DEV_REG_ZERO_PERIOD3 0x3c /* Period between zero out
+ * frames for Port 1, R/W */
+#define MCS7840_DEV_REG_ZERO_PERIOD4 0x3d /* Period between zero out
+ * frames for Port 1, R/W */
+#define MCS7840_DEV_REG_ZERO_ENABLE 0x3e /* Enable/disable of zero out
+ * frames, R/W */
+#define MCS7840_DEV_REG_THR_VAL_LOW1 0x3f /* Low 8 bits of threshhold
+ * value for Bulk-Out for Port
+ * 1, R/W */
+#define MCS7840_DEV_REG_THR_VAL_HIGH1 0x40 /* High 1 bit of threshhold
+ * value for Bulk-Out and
+ * enable flag for Port 1, R/W */
+#define MCS7840_DEV_REG_THR_VAL_LOW2 0x41 /* Low 8 bits of threshhold
+ * value for Bulk-Out for Port
+ * 2, R/W */
+#define MCS7840_DEV_REG_THR_VAL_HIGH2 0x42 /* High 1 bit of threshhold
+ * value for Bulk-Out and
+ * enable flag for Port 2, R/W */
+#define MCS7840_DEV_REG_THR_VAL_LOW3 0x43 /* Low 8 bits of threshhold
+ * value for Bulk-Out for Port
+ * 3, R/W */
+#define MCS7840_DEV_REG_THR_VAL_HIGH3 0x44 /* High 1 bit of threshhold
+ * value for Bulk-Out and
+ * enable flag for Port 3, R/W */
+#define MCS7840_DEV_REG_THR_VAL_LOW4 0x45 /* Low 8 bits of threshhold
+ * value for Bulk-Out for Port
+ * 4, R/W */
+#define MCS7840_DEV_REG_THR_VAL_HIGH4 0x46 /* High 1 bit of threshhold
+ * value for Bulk-Out and
+ * enable flag for Port 4, R/W */
+
+/* Bits for SPx registers */
+#define MCS7840_DEV_SPx_LOOP_PIPES 0x01 /* Loop Bulk-Out FIFO to the
+ * Bulk-In FIFO, default = 0 */
+#define MCS7840_DEV_SPx_SKIP_ERR_DATA 0x02 /* Drop data bytes from UART,
+ * which were recevied with
+ * errors, default = 0 */
+#define MCS7840_DEV_SPx_RESET_OUT_FIFO 0x04 /* Reset Bulk-Out FIFO */
+#define MCS7840_DEV_SPx_RESET_IN_FIFO 0x08 /* Reset Bulk-In FIFO */
+#define MCS7840_DEV_SPx_CLOCK_MASK 0x70 /* Mask to extract Baud CLK
+ * source */
+#define MCS7840_DEV_SPx_CLOCK_X1 0x00 /* CLK = 1.8432Mhz, max speed
+ * = 115200 bps, default */
+#define MCS7840_DEV_SPx_CLOCK_X2 0x10 /* CLK = 3.6864Mhz, max speed
+ * = 230400 bps */
+#define MCS7840_DEV_SPx_CLOCK_X35 0x20 /* CLK = 6.4512Mhz, max speed
+ * = 403200 bps */
+#define MCS7840_DEV_SPx_CLOCK_X4 0x30 /* CLK = 7.3728Mhz, max speed
+ * = 460800 bps */
+#define MCS7840_DEV_SPx_CLOCK_X7 0x40 /* CLK = 12.9024Mhz, max speed
+ * = 806400 bps */
+#define MCS7840_DEV_SPx_CLOCK_X8 0x50 /* CLK = 14.7456Mhz, max speed
+ * = 921600 bps */
+#define MCS7840_DEV_SPx_CLOCK_24MHZ 0x60 /* CLK = 24.0000Mhz, max speed
+ * = 1.5 Mbps */
+#define MCS7840_DEV_SPx_CLOCK_48MHZ 0x70 /* CLK = 48.0000Mhz, max speed
+ * = 3.0 Mbps */
+#define MCS7840_DEV_SPx_CLOCK_SHIFT 4 /* Value 0..7 can be shifted
+ * to get clock value */
+#define MCS7840_DEV_SPx_UART_RESET 0x80 /* Reset UART */
+
+/* Bits for CONTROLx registers */
+#define MCS7840_DEV_CONTROLx_HWFC 0x01 /* Enable hardware flow
+ * control (when power
+ * down? It is unclear
+ * in documents),
+ * default = 0 */
+#define MCS7840_DEV_CONTROLx_UNUNSED1 0x02 /* Reserved */
+#define MCS7840_DEV_CONTROLx_CTS_ENABLE 0x04 /* CTS changes are
+ * translated to MSR,
+ * default = 0 */
+#define MCS7840_DEV_CONTROLx_UNUSED2 0x08 /* Reserved for ports
+ * 2,3,4 */
+#define MCS7840_DEV_CONTROL1_DRIVER_DONE 0x08 /* USB enumerating is
+ * finished, USB
+ * enumeration memory
+ * can be used as FIFOs */
+#define MCS7840_DEV_CONTROLx_RX_NEGATE 0x10 /* Negate RX input,
+ * works for IrDA mode
+ * only, default = 0 */
+#define MCS7840_DEV_CONTROLx_RX_DISABLE 0x20 /* Disable RX logic,
+ * works only for
+ * RS-232/RS-485 mode,
+ * default = 0 */
+#define MCS7840_DEV_CONTROLx_FSM_CONTROL 0x40 /* Disable RX FSM when
+ * TX is in progress,
+ * works for IrDA mode
+ * only, default = 0 */
+#define MCS7840_DEV_CONTROLx_UNUSED3 0x80 /* Reserved */
+
+/*
+ * Bits for PINPONGx registers
+ * These registers control how often two input buffers
+ * for Bulk-In FIFOs are swapped. One of buffers is used
+ * for USB trnasfer, other for receiving data from UART.
+ * Exact meaning of 15 bit value in these registers is unknown
+ */
+#define MCS7840_DEV_PINPONGHIGH_MULT 128 /* Only 7 bits in PINPONGLOW
+ * register */
+#define MCS7840_DEV_PINPONGLOW_BITS 7 /* Only 7 bits in PINPONGLOW
+ * register */
+
+/*
+ * THIS ONE IS UNDOCUMENTED IN FULL DATASHEET, but e-mail from tech support
+ * confirms, that it is register for GPIO_0 and GPIO_1 data input/output.
+ * Chips has 2 GPIO, but first one (lower bit) MUST be used by device
+ * authors as "number of port" indicator, grounded (0) for two-port
+ * devices and pulled-up to 1 for 4-port devices.
+ */
+#define MCS7840_DEV_GPIO_4PORTS 0x01 /* Device has 4 ports
+ * configured */
+#define MCS7840_DEV_GPIO_GPIO_0 0x01 /* The same as above */
+#define MCS7840_DEV_GPIO_GPIO_1 0x02 /* GPIO_1 data */
+
+/*
+ * Constants for PLL dividers
+ * Ouptut frequency of PLL is:
+ * Fout = (N/M) * Fin.
+ * Default PLL input frequency Fin is 12Mhz (on-chip).
+ */
+#define MCS7840_DEV_PLL_DIV_M_BITS 6 /* Number of useful bits for M
+ * divider */
+#define MCS7840_DEV_PLL_DIV_M_MASK 0x3f /* Mask for M divider */
+#define MCS7840_DEV_PLL_DIV_M_MIN 1 /* Minimum value for M, 0 is
+ * forbidden */
+#define MCS7840_DEV_PLL_DIV_M_DEF 1 /* Default value for M */
+#define MCS7840_DEV_PLL_DIV_M_MAX 63 /* Maximum value for M */
+#define MCS7840_DEV_PLL_DIV_N_BITS 6 /* Number of useful bits for N
+ * divider */
+#define MCS7840_DEV_PLL_DIV_N_MASK 0x3f /* Mask for N divider */
+#define MCS7840_DEV_PLL_DIV_N_MIN 1 /* Minimum value for N, 0 is
+ * forbidden */
+#define MCS7840_DEV_PLL_DIV_N_DEF 8 /* Default value for N */
+#define MCS7840_DEV_PLL_DIV_N_MAX 63 /* Maximum value for N */
+
+/* Bits for CLOCK_MUX register */
+#define MCS7840_DEV_CLOCK_MUX_INPUTMASK 0x03 /* Mask to extract PLL clock
+ * input */
+#define MCS7840_DEV_CLOCK_MUX_IN12MHZ 0x00 /* 12Mhz PLL input, default */
+#define MCS7840_DEV_CLOCK_MUX_INEXTRN 0x01 /* External (device-depended)
+ * PLL input */
+#define MCS7840_DEV_CLOCK_MUX_INRSV1 0x02 /* Reserved */
+#define MCS7840_DEV_CLOCK_MUX_INRSV2 0x03 /* Reserved */
+#define MCS7840_DEV_CLOCK_MUX_PLLHIGH 0x04 /* 0 = PLL Output is
+ * 20MHz-100MHz (default), 1 =
+ * 100MHz-300MHz range */
+#define MCS7840_DEV_CLOCK_MUX_INTRFIFOS 0x08 /* Enable additional 8 bytes
+ * fro Interrupt USB pipe with
+ * USB FIFOs statuses, default
+ * = 0 */
+#define MCS7840_DEV_CLOCK_MUX_RESERVED1 0x10 /* Unused */
+#define MCS7840_DEV_CLOCK_MUX_RESERVED2 0x20 /* Unused */
+#define MCS7840_DEV_CLOCK_MUX_RESERVED3 0x40 /* Unused */
+#define MCS7840_DEV_CLOCK_MUX_RESERVED4 0x80 /* Unused */
+
+/* Bits for CLOCK_SELECTxx registers */
+#define MCS7840_DEV_CLOCK_SELECT1_MASK 0x07 /* Bits for port 1 in
+ * CLOCK_SELECT12 */
+#define MCS7840_DEV_CLOCK_SELECT1_SHIFT 0 /* Shift for port 1in
+ * CLOCK_SELECT12 */
+#define MCS7840_DEV_CLOCK_SELECT2_MASK 0x38 /* Bits for port 2 in
+ * CLOCK_SELECT12 */
+#define MCS7840_DEV_CLOCK_SELECT2_SHIFT 3 /* Shift for port 2 in
+ * CLOCK_SELECT12 */
+#define MCS7840_DEV_CLOCK_SELECT3_MASK 0x07 /* Bits for port 3 in
+ * CLOCK_SELECT23 */
+#define MCS7840_DEV_CLOCK_SELECT3_SHIFT 0 /* Shift for port 3 in
+ * CLOCK_SELECT23 */
+#define MCS7840_DEV_CLOCK_SELECT4_MASK 0x38 /* Bits for port 4 in
+ * CLOCK_SELECT23 */
+#define MCS7840_DEV_CLOCK_SELECT4_SHIFT 3 /* Shift for port 4 in
+ * CLOCK_SELECT23 */
+#define MCS7840_DEV_CLOCK_SELECT_STD 0x00 /* STANDARD baudrate derived
+ * from 96Mhz, default for all
+ * ports */
+#define MCS7840_DEV_CLOCK_SELECT_30MHZ 0x01 /* 30Mhz */
+#define MCS7840_DEV_CLOCK_SELECT_96MHZ 0x02 /* 96Mhz direct */
+#define MCS7840_DEV_CLOCK_SELECT_120MHZ 0x03 /* 120Mhz */
+#define MCS7840_DEV_CLOCK_SELECT_PLL 0x04 /* PLL output (see for M and N
+ * dividers) */
+#define MCS7840_DEV_CLOCK_SELECT_EXT 0x05 /* External clock input
+ * (device-dependend) */
+#define MCS7840_DEV_CLOCK_SELECT_RES1 0x06 /* Unused */
+#define MCS7840_DEV_CLOCK_SELECT_RES2 0x07 /* Unused */
+
+/* Bits for MODE register */
+#define MCS7840_DEV_MODE_RESERVED1 0x01 /* Unused */
+#define MCS7840_DEV_MODE_RESET 0x02 /* 0: RESET = Active High
+ * (default), 1: Reserved (?) */
+#define MCS7840_DEV_MODE_SER_PRSNT 0x04 /* 0: Reserved, 1: Do not use
+ * hardocded values (default)
+ * (?) */
+#define MCS7840_DEV_MODE_PLLBYPASS 0x08 /* 1: PLL output is bypassed,
+ * default = 0 */
+#define MCS7840_DEV_MODE_PORBYPASS 0x10 /* 1: Power-On Reset is
+ * bypassed, default = 0 */
+#define MCS7840_DEV_MODE_SELECT24S 0x20 /* 0: 4 Serial Ports / IrDA
+ * active, 1: 2 Serial Ports /
+ * IrDA active */
+#define MCS7840_DEV_MODE_EEPROMWR 0x40 /* EEPROM write is enabled,
+ * default */
+#define MCS7840_DEV_MODE_IRDA 0x80 /* IrDA mode is activated
+ * (could be turned on),
+ * default */
+
+/* Bits for SPx ICG */
+#define MCS7840_DEV_SPx_ICG_DEF 0x24 /* All 8 bits is used as
+ * number of BAUD clocks of
+ * pause */
+
+/*
+ * Bits for RX_SAMPLINGxx registers
+ * These registers control when bit value will be sampled within
+ * the baud period.
+ * 0 is very beginning of period, 15 is very end, 7 is the middle.
+ */
+#define MCS7840_DEV_RX_SAMPLING1_MASK 0x0f /* Bits for port 1 in
+ * RX_SAMPLING12 */
+#define MCS7840_DEV_RX_SAMPLING1_SHIFT 0 /* Shift for port 1in
+ * RX_SAMPLING12 */
+#define MCS7840_DEV_RX_SAMPLING2_MASK 0xf0 /* Bits for port 2 in
+ * RX_SAMPLING12 */
+#define MCS7840_DEV_RX_SAMPLING2_SHIFT 4 /* Shift for port 2 in
+ * RX_SAMPLING12 */
+#define MCS7840_DEV_RX_SAMPLING3_MASK 0x0f /* Bits for port 3 in
+ * RX_SAMPLING23 */
+#define MCS7840_DEV_RX_SAMPLING3_SHIFT 0 /* Shift for port 3 in
+ * RX_SAMPLING23 */
+#define MCS7840_DEV_RX_SAMPLING4_MASK 0xf0 /* Bits for port 4 in
+ * RX_SAMPLING23 */
+#define MCS7840_DEV_RX_SAMPLING4_SHIFT 4 /* Shift for port 4 in
+ * RX_SAMPLING23 */
+#define MCS7840_DEV_RX_SAMPLINGx_MIN 0 /* Max for any RX Sampling */
+#define MCS7840_DEV_RX_SAMPLINGx_DEF 7 /* Default for any RX
+ * Sampling, center of period */
+#define MCS7840_DEV_RX_SAMPLINGx_MAX 15 /* Min for any RX Sampling */
+
+/* Bits for ZERO_PERIODx */
+#define MCS7840_DEV_ZERO_PERIODx_DEF 20 /* Number of Bulk-in requests
+ * befor sending zero-sized
+ * reply */
+
+/* Bits for ZERO_ENABLE */
+#define MCS7840_DEV_ZERO_ENABLE_PORT1 0x01 /* Enable of sending
+ * zero-sized replies for port
+ * 1, default */
+#define MCS7840_DEV_ZERO_ENABLE_PORT2 0x02 /* Enable of sending
+ * zero-sized replies for port
+ * 2, default */
+#define MCS7840_DEV_ZERO_ENABLE_PORT3 0x04 /* Enable of sending
+ * zero-sized replies for port
+ * 3, default */
+#define MCS7840_DEV_ZERO_ENABLE_PORT4 0x08 /* Enable of sending
+ * zero-sized replies for port
+ * 4, default */
+
+/* Bits for THR_VAL_HIGHx */
+#define MCS7840_DEV_THR_VAL_HIGH_MASK 0x01 /* Only one bit is used */
+#define MCS7840_DEV_THR_VAL_HIGH_MUL 256 /* This one bit is means "256" */
+#define MCS7840_DEV_THR_VAL_HIGH_SHIFT 8 /* This one bit is means "256" */
+#define MCS7840_DEV_THR_VAL_HIGH_ENABLE 0x80 /* Enable threshold */
+
+/* These are documented in "public" datasheet */
+#define MCS7840_DEV_REG_DCR0_1 0x04 /* Device contol register 0 for Port
+ * 1, R/W */
+#define MCS7840_DEV_REG_DCR1_1 0x05 /* Device contol register 1 for Port
+ * 1, R/W */
+#define MCS7840_DEV_REG_DCR2_1 0x06 /* Device contol register 2 for Port
+ * 1, R/W */
+#define MCS7840_DEV_REG_DCR0_2 0x16 /* Device contol register 0 for Port
+ * 2, R/W */
+#define MCS7840_DEV_REG_DCR1_2 0x17 /* Device contol register 1 for Port
+ * 2, R/W */
+#define MCS7840_DEV_REG_DCR2_2 0x18 /* Device contol register 2 for Port
+ * 2, R/W */
+#define MCS7840_DEV_REG_DCR0_3 0x19 /* Device contol register 0 for Port
+ * 3, R/W */
+#define MCS7840_DEV_REG_DCR1_3 0x1a /* Device contol register 1 for Port
+ * 3, R/W */
+#define MCS7840_DEV_REG_DCR2_3 0x1b /* Device contol register 2 for Port
+ * 3, R/W */
+#define MCS7840_DEV_REG_DCR0_4 0x1c /* Device contol register 0 for Port
+ * 4, R/W */
+#define MCS7840_DEV_REG_DCR1_4 0x1d /* Device contol register 1 for Port
+ * 4, R/W */
+#define MCS7840_DEV_REG_DCR2_4 0x1e /* Device contol register 2 for Port
+ * 4, R/W */
+
+/* Bits of DCR0 registers, documented in datasheet */
+#define MCS7840_DEV_DCR0_PWRSAVE 0x01 /* Shutdown transiver
+ * when USB Suspend is
+ * engaged, default = 1 */
+#define MCS7840_DEV_DCR0_RESERVED1 0x02 /* Unused */
+#define MCS7840_DEV_DCR0_GPIO_MODE_MASK 0x0c /* GPIO Mode bits, WORKS
+ * ONLY FOR PORT 1 */
+#define MCS7840_DEV_DCR0_GPIO_MODE_IN 0x00 /* GPIO Mode - Input
+ * (0b00), WORKS ONLY
+ * FOR PORT 1 */
+#define MCS7840_DEV_DCR0_GPIO_MODE_OUT 0x08 /* GPIO Mode - Input
+ * (0b10), WORKS ONLY
+ * FOR PORT 1 */
+#define MCS7840_DEV_DCR0_RTS_ACTIVE_HIGH 0x10 /* RTS Active is HIGH,
+ * default = 0 (low) */
+#define MCS7840_DEV_DCR0_RTS_AUTO 0x20 /* RTS is controlled by
+ * state of TX buffer,
+ * default = 0
+ * (controlled by MCR) */
+#define MCS7840_DEV_DCR0_IRDA 0x40 /* IrDA mode */
+#define MCS7840_DEV_DCR0_RESERVED2 0x80 /* Unused */
+
+/* Bits of DCR1 registers, documented in datasheet */
+#define MCS7840_DEV_DCR1_GPIO_CURRENT_MASK 0x03 /* Mask to extract GPIO
+ * current value, WORKS
+ * ONLY FOR PORT 1 */
+#define MCS7840_DEV_DCR1_GPIO_CURRENT_6MA 0x00 /* GPIO output current
+ * 6mA, WORKS ONLY FOR
+ * PORT 1 */
+#define MCS7840_DEV_DCR1_GPIO_CURRENT_8MA 0x01 /* GPIO output current
+ * 8mA, defauilt, WORKS
+ * ONLY FOR PORT 1 */
+#define MCS7840_DEV_DCR1_GPIO_CURRENT_10MA 0x02 /* GPIO output current
+ * 10mA, WORKS ONLY FOR
+ * PORT 1 */
+#define MCS7840_DEV_DCR1_GPIO_CURRENT_12MA 0x03 /* GPIO output current
+ * 12mA, WORKS ONLY FOR
+ * PORT 1 */
+#define MCS7840_DEV_DCR1_UART_CURRENT_MASK 0x0c /* Mask to extract UART
+ * signals current value */
+#define MCS7840_DEV_DCR1_UART_CURRENT_6MA 0x00 /* UART output current
+ * 6mA */
+#define MCS7840_DEV_DCR1_UART_CURRENT_8MA 0x04 /* UART output current
+ * 8mA, defauilt */
+#define MCS7840_DEV_DCR1_UART_CURRENT_10MA 0x08 /* UART output current
+ * 10mA */
+#define MCS7840_DEV_DCR1_UART_CURRENT_12MA 0x0c /* UART output current
+ * 12mA */
+#define MCS7840_DEV_DCR1_WAKEUP_DISABLE 0x10 /* Disable Remote USB
+ * Wakeup */
+#define MCS7840_DEV_DCR1_PLLPWRDOWN_DISABLE 0x20 /* Disable PLL power
+ * down when not needed,
+ * WORKS ONLY FOR PORT 1 */
+#define MCS7840_DEV_DCR1_LONG_INTERRUPT 0x40 /* Enable 13 bytes of
+ * interrupt data, with
+ * FIFO statistics,
+ * WORKS ONLY FOR PORT 1 */
+#define MCS7840_DEV_DCR1_RESERVED1 0x80 /* Unused */
+
+/*
+ * Bits of DCR2 registers, documented in datasheet
+ * Wakeup will work only if DCR0_IRDA = 0 (RS-xxx mode) and
+ * DCR1_WAKEUP_DISABLE = 0 (wakeup enabled).
+ */
+#define MCS7840_DEV_DCR2_WAKEUP_CTS 0x01 /* Wakeup on CTS change,
+ * default = 0 */
+#define MCS7840_DEV_DCR2_WAKEUP_DCD 0x02 /* Wakeup on DCD change,
+ * default = 0 */
+#define MCS7840_DEV_DCR2_WAKEUP_RI 0x04 /* Wakeup on RI change,
+ * default = 1 */
+#define MCS7840_DEV_DCR2_WAKEUP_DSR 0x08 /* Wakeup on DSR change,
+ * default = 0 */
+#define MCS7840_DEV_DCR2_WAKEUP_RXD 0x10 /* Wakeup on RX Data change,
+ * default = 0 */
+#define MCS7840_DEV_DCR2_WAKEUP_RESUME 0x20 /* Wakeup issues RESUME
+ * signal, DISCONNECT
+ * otherwise, default = 1 */
+#define MCS7840_DEV_DCR2_RESERVED1 0x40 /* Unused */
+#define MCS7840_DEV_DCR2_SHDN_POLARITY 0x80 /* 0: Pin 12 Active Low, 1:
+ * Pin 12 Active High, default
+ * = 0 */
+
+/* Interrupt endpoint bytes & bits */
+#define MCS7840_IEP_FIFO_STATUS_INDEX 5
+/*
+ * Thesse can be calculated as "1 << portnumber" for Bulk-out and
+ * "1 << (portnumber+1)" for Bulk-in
+ */
+#define MCS7840_IEP_BO_PORT1_HASDATA 0x01
+#define MCS7840_IEP_BI_PORT1_HASDATA 0x02
+#define MCS7840_IEP_BO_PORT2_HASDATA 0x04
+#define MCS7840_IEP_BI_PORT2_HASDATA 0x08
+#define MCS7840_IEP_BO_PORT3_HASDATA 0x10
+#define MCS7840_IEP_BI_PORT3_HASDATA 0x20
+#define MCS7840_IEP_BO_PORT4_HASDATA 0x40
+#define MCS7840_IEP_BI_PORT4_HASDATA 0x80
+
+/* Documented UART registers (fully compatible with 16550 UART) */
+#define MCS7840_UART_REG_THR 0x00 /* Transmitter Holding
+ * Register W/Only */
+#define MCS7840_UART_REG_RHR 0x00 /* Receiver Holding Register
+ * R/Only */
+#define MCS7840_UART_REG_IER 0x01 /* Interrupt enable register -
+ * R/W */
+#define MCS7840_UART_REG_FCR 0x02 /* FIFO Control register -
+ * W/Only */
+#define MCS7840_UART_REG_ISR 0x02 /* Interrupt Status Registter
+ * R/Only */
+#define MCS7840_UART_REG_LCR 0x03 /* Line control register R/W */
+#define MCS7840_UART_REG_MCR 0x04 /* Modem control register R/W */
+#define MCS7840_UART_REG_LSR 0x05 /* Line status register R/Only */
+#define MCS7840_UART_REG_MSR 0x06 /* Modem status register
+ * R/Only */
+#define MCS7840_UART_REG_SCRATCHPAD 0x07 /* Scratch pad register */
+
+#define MCS7840_UART_REG_DLL 0x00 /* Low bits of BAUD divider */
+#define MCS7840_UART_REG_DLM 0x01 /* High bits of BAUD divider */
+
+/* IER bits */
+#define MCS7840_UART_IER_RXREADY 0x01 /* RX Ready interrumpt mask */
+#define MCS7840_UART_IER_TXREADY 0x02 /* TX Ready interrumpt mask */
+#define MCS7840_UART_IER_RXSTAT 0x04 /* RX Status interrumpt mask */
+#define MCS7840_UART_IER_MODEM 0x08 /* Modem status change
+ * interrumpt mask */
+#define MCS7840_UART_IER_SLEEP 0x10 /* SLEEP enable */
+
+/* FCR bits */
+#define MCS7840_UART_FCR_ENABLE 0x01 /* Enable FIFO */
+#define MCS7840_UART_FCR_FLUSHRHR 0x02 /* Flush RHR and FIFO */
+#define MCS7840_UART_FCR_FLUSHTHR 0x04 /* Flush THR and FIFO */
+#define MCS7840_UART_FCR_RTLMASK 0xa0 /* Mask to select RHR
+ * Interrupt Trigger level */
+#define MCS7840_UART_FCR_RTL_1_1 0x00 /* L1 = 1, L2 = 1 */
+#define MCS7840_UART_FCR_RTL_1_4 0x40 /* L1 = 1, L2 = 4 */
+#define MCS7840_UART_FCR_RTL_1_8 0x80 /* L1 = 1, L2 = 8 */
+#define MCS7840_UART_FCR_RTL_1_14 0xa0 /* L1 = 1, L2 = 14 */
+
+/* ISR bits */
+#define MCS7840_UART_ISR_NOPENDING 0x01 /* No interrupt pending */
+#define MCS7840_UART_ISR_INTMASK 0x3f /* Mask to select interrupt
+ * source */
+#define MCS7840_UART_ISR_RXERR 0x06 /* Recevir error */
+#define MCS7840_UART_ISR_RXHASDATA 0x04 /* Recevier has data */
+#define MCS7840_UART_ISR_RXTIMEOUT 0x0c /* Recevier timeout */
+#define MCS7840_UART_ISR_TXEMPTY 0x02 /* Transmitter empty */
+#define MCS7840_UART_ISR_MSCHANGE 0x00 /* Modem status change */
+
+/* LCR bits */
+#define MCS7840_UART_LCR_DATALENMASK 0x03 /* Mask for data length */
+#define MCS7840_UART_LCR_DATALEN5 0x00 /* 5 data bits */
+#define MCS7840_UART_LCR_DATALEN6 0x01 /* 6 data bits */
+#define MCS7840_UART_LCR_DATALEN7 0x02 /* 7 data bits */
+#define MCS7840_UART_LCR_DATALEN8 0x03 /* 8 data bits */
+
+#define MCS7840_UART_LCR_STOPBMASK 0x04 /* Mask for stop bits */
+#define MCS7840_UART_LCR_STOPB1 0x00 /* 1 stop bit in any case */
+#define MCS7840_UART_LCR_STOPB2 0x04 /* 1.5-2 stop bits depends on
+ * data length */
+
+#define MCS7840_UART_LCR_PARITYMASK 0x38 /* Mask for all parity data */
+#define MCS7840_UART_LCR_PARITYON 0x08 /* Parity ON/OFF - ON */
+#define MCS7840_UART_LCR_PARITYODD 0x00 /* Parity Odd */
+#define MCS7840_UART_LCR_PARITYEVEN 0x10 /* Parity Even */
+#define MCS7840_UART_LCR_PARITYODD 0x00 /* Parity Odd */
+#define MCS7840_UART_LCR_PARITYFORCE 0x20 /* Force parity odd/even */
+
+#define MCS7840_UART_LCR_BREAK 0x40 /* Send BREAK */
+#define MCS7840_UART_LCR_DIVISORS 0x80 /* Map DLL/DLM instead of
+ * xHR/IER */
+
+/* LSR bits */
+#define MCS7840_UART_LSR_RHRAVAIL 0x01 /* Data available for read */
+#define MCS7840_UART_LSR_RHROVERRUN 0x02 /* Data FIFO/register overflow */
+#define MCS7840_UART_LSR_PARITYERR 0x04 /* Parity error */
+#define MCS7840_UART_LSR_FRAMEERR 0x10 /* Framing error */
+#define MCS7840_UART_LSR_BREAKERR 0x20 /* BREAK sigmal received */
+#define MCS7840_UART_LSR_THREMPTY 0x40 /* THR register is empty,
+ * ready for transmit */
+#define MCS7840_UART_LSR_HASERR 0x80 /* Has error in receiver FIFO */
+
+/* MCR bits */
+#define MCS7840_UART_MCR_DTR 0x01 /* Force DTR to be active
+ * (low) */
+#define MCS7840_UART_MCR_RTS 0x02 /* Force RTS to be active
+ * (low) */
+#define MCS7840_UART_MCR_IE 0x04 /* Enable interrupts (from
+ * code, not documented) */
+#define MCS7840_UART_MCR_LOOPBACK 0x10 /* Enable local loopback test
+ * mode */
+#define MCS7840_UART_MCR_CTSRTS 0x20 /* Enable CTS/RTS flow control
+ * in 550 (FIFO) mode */
+#define MCS7840_UART_MCR_DTRDSR 0x40 /* Enable DTR/DSR flow control
+ * in 550 (FIFO) mode */
+#define MCS7840_UART_MCR_DCD 0x80 /* Enable DCD flow control in
+ * 550 (FIFO) mode */
+
+/* MSR bits */
+#define MCS7840_UART_MSR_DELTACTS 0x01 /* CTS was changed since last
+ * read */
+#define MCS7840_UART_MSR_DELTADSR 0x02 /* DSR was changed since last
+ * read */
+#define MCS7840_UART_MSR_DELTARI 0x04 /* RI was changed from low to
+ * high since last read */
+#define MCS7840_UART_MSR_DELTADCD 0x08 /* DCD was changed since last
+ * read */
+#define MCS7840_UART_MSR_NEGCTS 0x10 /* Negated CTS signal */
+#define MCS7840_UART_MSR_NEGDSR 0x20 /* Negated DSR signal */
+#define MCS7840_UART_MSR_NEGRI 0x40 /* Negated RI signal */
+#define MCS7840_UART_MSR_NEGDCD 0x80 /* Negated DCD signal */
+
+/* SCRATCHPAD bits */
+#define MCS7840_UART_SCRATCHPAD_RS232 0x00 /* RS-485 disabled */
+#define MCS7840_UART_SCRATCHPAD_RS485_DTRRX 0x80 /* RS-485 mode, DTR High
+ * = RX */
+#define MCS7840_UART_SCRATCHPAD_RS485_DTRTX 0xc0 /* RS-485 mode, DTR High
+ * = TX */
+
+#define MCS7840_CONFIG_INDEX 0
+#define MCS7840_IFACE_INDEX 0
+
+#endif
diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h
index c8bc5eb..bf41221 100644
--- a/sys/dev/usb/usb_device.h
+++ b/sys/dev/usb/usb_device.h
@@ -187,6 +187,8 @@ struct usb_device {
struct usb_host_endpoint *linux_endpoint_end;
uint16_t devnum;
#endif
+
+ uint32_t clear_stall_errors; /* number of clear-stall failures */
};
/* globals */
diff --git a/sys/dev/usb/usb_freebsd.h b/sys/dev/usb/usb_freebsd.h
index a44e530..ae69cdb 100644
--- a/sys/dev/usb/usb_freebsd.h
+++ b/sys/dev/usb/usb_freebsd.h
@@ -66,6 +66,7 @@
#define USB_HUB_MAX_DEPTH 5
#define USB_EP0_BUFSIZE 1024 /* bytes */
+#define USB_CS_RESET_LIMIT 20 /* failures = 20 * 50 ms = 1sec */
typedef uint32_t usb_timeout_t; /* milliseconds */
typedef uint32_t usb_frlength_t; /* bytes */
diff --git a/sys/dev/usb/usb_generic.c b/sys/dev/usb/usb_generic.c
index 714ee6f..d62f8f9 100644
--- a/sys/dev/usb/usb_generic.c
+++ b/sys/dev/usb/usb_generic.c
@@ -966,10 +966,8 @@ ugen_re_enumerate(struct usb_fifo *f)
/* ignore any errors */
DPRINTFN(6, "no FIFOs\n");
}
- if (udev->re_enumerate_wait == 0) {
- udev->re_enumerate_wait = 1;
- usb_needs_explore(udev->bus, 0);
- }
+ /* start re-enumeration of device */
+ usbd_start_re_enumerate(udev);
return (0);
}
diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c
index ce8a4a5..351b134 100644
--- a/sys/dev/usb/usb_hub.c
+++ b/sys/dev/usb/usb_hub.c
@@ -242,9 +242,14 @@ uhub_explore_sub(struct uhub_softc *sc, struct usb_port *up)
if (child->flags.usb_mode == USB_MODE_HOST) {
usbd_enum_lock(child);
if (child->re_enumerate_wait) {
- err = usbd_set_config_index(child, USB_UNCONFIG_INDEX);
- if (err == 0)
- err = usbd_req_re_enumerate(child, NULL);
+ err = usbd_set_config_index(child,
+ USB_UNCONFIG_INDEX);
+ if (err != 0) {
+ DPRINTF("Unconfigure failed: "
+ "%s: Ignored.\n",
+ usbd_errstr(err));
+ }
+ err = usbd_req_re_enumerate(child, NULL);
if (err == 0)
err = usbd_set_config_index(child, 0);
if (err == 0) {
@@ -2471,3 +2476,19 @@ usbd_filter_power_mode(struct usb_device *udev, uint8_t power_mode)
/* use fixed power mode given by hardware driver */
return (temp);
}
+
+/*------------------------------------------------------------------------*
+ * usbd_start_re_enumerate
+ *
+ * This function starts re-enumeration of the given USB device. This
+ * function does not need to be called BUS-locked. This function does
+ * not wait until the re-enumeration is completed.
+ *------------------------------------------------------------------------*/
+void
+usbd_start_re_enumerate(struct usb_device *udev)
+{
+ if (udev->re_enumerate_wait == 0) {
+ udev->re_enumerate_wait = 1;
+ usb_needs_explore(udev->bus, 0);
+ }
+}
diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c
index 0509ec2..051ded9 100644
--- a/sys/dev/usb/usb_process.c
+++ b/sys/dev/usb/usb_process.c
@@ -360,7 +360,12 @@ usb_proc_is_gone(struct usb_process *up)
if (up->up_gone)
return (1);
- mtx_assert(up->up_mtx, MA_OWNED);
+ /*
+ * Allow calls when up_mtx is NULL, before the USB process
+ * structure is initialised.
+ */
+ if (up->up_mtx != NULL)
+ mtx_assert(up->up_mtx, MA_OWNED);
return (0);
}
diff --git a/sys/dev/usb/usb_request.c b/sys/dev/usb/usb_request.c
index c099e71..4358ef4 100644
--- a/sys/dev/usb/usb_request.c
+++ b/sys/dev/usb/usb_request.c
@@ -238,6 +238,10 @@ usb_do_clear_stall_callback(struct usb_xfer *xfer, usb_error_t error)
switch (USB_GET_STATE(xfer)) {
case USB_ST_TRANSFERRED:
+
+ /* reset error counter */
+ udev->clear_stall_errors = 0;
+
if (ep == NULL)
goto tr_setup; /* device was unconfigured */
if (ep->edesc &&
@@ -289,8 +293,23 @@ tr_setup:
goto tr_setup;
default:
- if (xfer->error == USB_ERR_CANCELLED) {
+ if (error == USB_ERR_CANCELLED)
break;
+
+ DPRINTF("Clear stall failed.\n");
+ if (udev->clear_stall_errors == USB_CS_RESET_LIMIT)
+ goto tr_setup;
+
+ if (error == USB_ERR_TIMEOUT) {
+ udev->clear_stall_errors = USB_CS_RESET_LIMIT;
+ DPRINTF("Trying to re-enumerate.\n");
+ usbd_start_re_enumerate(udev);
+ } else {
+ udev->clear_stall_errors++;
+ if (udev->clear_stall_errors == USB_CS_RESET_LIMIT) {
+ DPRINTF("Trying to re-enumerate.\n");
+ usbd_start_re_enumerate(udev);
+ }
}
goto tr_setup;
}
@@ -1936,6 +1955,23 @@ usbd_req_re_enumerate(struct usb_device *udev, struct mtx *mtx)
return (USB_ERR_INVAL);
}
retry:
+ /*
+ * Try to reset the High Speed parent HUB of a LOW- or FULL-
+ * speed device, if any.
+ */
+ if (udev->parent_hs_hub != NULL &&
+ udev->speed != USB_SPEED_HIGH) {
+ DPRINTF("Trying to reset parent High Speed TT.\n");
+ err = usbd_req_reset_tt(udev->parent_hs_hub, NULL,
+ udev->hs_port_no);
+ if (err) {
+ DPRINTF("Resetting parent High "
+ "Speed TT failed (%s).\n",
+ usbd_errstr(err));
+ }
+ }
+
+ /* Try to reset the parent HUB port. */
err = usbd_req_reset_port(parent_hub, mtx, udev->port_no);
if (err) {
DPRINTFN(0, "addr=%d, port reset failed, %s\n",
@@ -2033,3 +2069,65 @@ usbd_req_set_device_feature(struct usb_device *udev, struct mtx *mtx,
USETW(req.wLength, 0);
return (usbd_do_request(udev, mtx, &req, 0));
}
+
+/*------------------------------------------------------------------------*
+ * usbd_req_reset_tt
+ *
+ * Returns:
+ * 0: Success
+ * Else: Failure
+ *------------------------------------------------------------------------*/
+usb_error_t
+usbd_req_reset_tt(struct usb_device *udev, struct mtx *mtx,
+ uint8_t port)
+{
+ struct usb_device_request req;
+
+ /* For single TT HUBs the port should be 1 */
+
+ if (udev->ddesc.bDeviceClass == UDCLASS_HUB &&
+ udev->ddesc.bDeviceProtocol == UDPROTO_HSHUBSTT)
+ port = 1;
+
+ req.bmRequestType = UT_WRITE_CLASS_OTHER;
+ req.bRequest = UR_RESET_TT;
+ USETW(req.wValue, 0);
+ req.wIndex[0] = port;
+ req.wIndex[1] = 0;
+ USETW(req.wLength, 0);
+ return (usbd_do_request(udev, mtx, &req, 0));
+}
+
+/*------------------------------------------------------------------------*
+ * usbd_req_clear_tt_buffer
+ *
+ * For single TT HUBs the port should be 1.
+ *
+ * Returns:
+ * 0: Success
+ * Else: Failure
+ *------------------------------------------------------------------------*/
+usb_error_t
+usbd_req_clear_tt_buffer(struct usb_device *udev, struct mtx *mtx,
+ uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint)
+{
+ struct usb_device_request req;
+ uint16_t wValue;
+
+ /* For single TT HUBs the port should be 1 */
+
+ if (udev->ddesc.bDeviceClass == UDCLASS_HUB &&
+ udev->ddesc.bDeviceProtocol == UDPROTO_HSHUBSTT)
+ port = 1;
+
+ wValue = (endpoint & 0xF) | ((addr & 0x7F) << 4) |
+ ((endpoint & 0x80) << 8) | ((type & 3) << 12);
+
+ req.bmRequestType = UT_WRITE_CLASS_OTHER;
+ req.bRequest = UR_CLEAR_TT_BUFFER;
+ USETW(req.wValue, wValue);
+ req.wIndex[0] = port;
+ req.wIndex[1] = 0;
+ USETW(req.wLength, 0);
+ return (usbd_do_request(udev, mtx, &req, 0));
+}
diff --git a/sys/dev/usb/usb_request.h b/sys/dev/usb/usb_request.h
index 12f373d..ac7a7c1 100644
--- a/sys/dev/usb/usb_request.h
+++ b/sys/dev/usb/usb_request.h
@@ -85,5 +85,9 @@ usb_error_t usbd_req_set_hub_u2_timeout(struct usb_device *udev,
struct mtx *mtx, uint8_t port, uint8_t timeout);
usb_error_t usbd_req_set_hub_depth(struct usb_device *udev,
struct mtx *mtx, uint16_t depth);
+usb_error_t usbd_req_reset_tt(struct usb_device *udev, struct mtx *mtx,
+ uint8_t port);
+usb_error_t usbd_req_clear_tt_buffer(struct usb_device *udev, struct mtx *mtx,
+ uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint);
#endif /* _USB_REQUEST_H_ */
diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c
index 5fd4f5a..d4c2408 100644
--- a/sys/dev/usb/usb_transfer.c
+++ b/sys/dev/usb/usb_transfer.c
@@ -2928,6 +2928,11 @@ repeat:
usbd_transfer_unsetup(udev->ctrl_xfer, USB_CTRL_XFER_MAX);
/*
+ * Reset clear stall error counter.
+ */
+ udev->clear_stall_errors = 0;
+
+ /*
* Try to setup a new USB transfer for the
* default control endpoint:
*/
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index eb49eb2..a5f4cbb 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -2014,6 +2014,7 @@ product KODAK DC280 0x0130 Digital Science DC280
/* Kontron AG products */
product KONTRON DM9601 0x8101 USB Ethernet
+product KONTRON JP1082 0x9700 USB Ethernet
/* Konica Corp. Products */
product KONICA CAMERA 0x0720 Digital Color Camera
@@ -2273,7 +2274,9 @@ product MOBILITY EASIDOCK 0x0304 EasiDock Ethernet
/* MosChip products */
product MOSCHIP MCS7703 0x7703 MCS7703 Serial Port Adapter
product MOSCHIP MCS7730 0x7730 MCS7730 Ethernet
+product MOSCHIP MCS7820 0x7820 MCS7820 Serial Port Adapter
product MOSCHIP MCS7830 0x7830 MCS7830 Ethernet
+product MOSCHIP MCS7840 0x7840 MCS7840 Serial Port Adapter
/* Motorola products */
product MOTOROLA MC141555 0x1555 MC141555 hub controller
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 8f6da7c..91cd3fa 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -542,6 +542,7 @@ void usbd_m_copy_in(struct usb_page_cache *cache, usb_frlength_t dst_offset,
struct mbuf *m, usb_size_t src_offset, usb_frlength_t src_len);
void usbd_frame_zero(struct usb_page_cache *cache, usb_frlength_t offset,
usb_frlength_t len);
+void usbd_start_re_enumerate(struct usb_device *udev);
int usb_fifo_attach(struct usb_device *udev, void *priv_sc,
struct mtx *priv_mtx, struct usb_fifo_methods *pm,
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index e1fffe1..38ebb7e 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -273,6 +273,8 @@ static devclass_t wpi_devclass;
DRIVER_MODULE(wpi, pci, wpi_driver, wpi_devclass, 0, 0);
+MODULE_VERSION(wpi, 1);
+
static const uint8_t wpi_ridx_to_plcp[] = {
/* OFDM: IEEE Std 802.11a-1999, pp. 14 Table 80 */
/* R1-R4 (ral/ural is R4-R1) */
diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c
index 458149d..e52c342 100644
--- a/sys/dev/xen/blkback/blkback.c
+++ b/sys/dev/xen/blkback/blkback.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2009-2010 Spectra Logic Corporation
+ * Copyright (c) 2009-2011 Spectra Logic Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/vnode.h>
#include <sys/mount.h>
+#include <sys/sysctl.h>
+#include <sys/bitstring.h>
#include <geom/geom.h>
@@ -153,9 +155,19 @@ MALLOC_DEFINE(M_XENBLOCKBACK, "xbbd", "Xen Block Back Driver Data");
#define XBB_MAX_RING_PAGES \
BLKIF_RING_PAGES(BLKIF_SEGS_TO_BLOCKS(XBB_MAX_SEGMENTS_PER_REQUEST) \
* XBB_MAX_REQUESTS)
+/**
+ * The maximum number of ring pages that we can allow per request list.
+ * We limit this to the maximum number of segments per request, because
+ * that is already a reasonable number of segments to aggregate. This
+ * number should never be smaller than XBB_MAX_SEGMENTS_PER_REQUEST,
+ * because that would leave situations where we can't dispatch even one
+ * large request.
+ */
+#define XBB_MAX_SEGMENTS_PER_REQLIST XBB_MAX_SEGMENTS_PER_REQUEST
/*--------------------------- Forward Declarations ---------------------------*/
struct xbb_softc;
+struct xbb_xen_req;
static void xbb_attach_failed(struct xbb_softc *xbb, int err, const char *fmt,
...) __attribute__((format(printf, 3, 4)));
@@ -163,16 +175,15 @@ static int xbb_shutdown(struct xbb_softc *xbb);
static int xbb_detach(device_t dev);
/*------------------------------ Data Structures -----------------------------*/
-/**
- * \brief Object tracking an in-flight I/O from a Xen VBD consumer.
- */
-struct xbb_xen_req {
- /**
- * Linked list links used to aggregate idle request in the
- * request free pool (xbb->request_free_slist).
- */
- SLIST_ENTRY(xbb_xen_req) links;
+STAILQ_HEAD(xbb_xen_req_list, xbb_xen_req);
+
+typedef enum {
+ XBB_REQLIST_NONE = 0x00,
+ XBB_REQLIST_MAPPED = 0x01
+} xbb_reqlist_flags;
+
+struct xbb_xen_reqlist {
/**
* Back reference to the parent block back instance for this
* request. Used during bio_done handling.
@@ -180,17 +191,71 @@ struct xbb_xen_req {
struct xbb_softc *xbb;
/**
- * The remote domain's identifier for this I/O request.
+ * BLKIF_OP code for this request.
+ */
+ int operation;
+
+ /**
+ * Set to BLKIF_RSP_* to indicate request status.
+ *
+ * This field allows an error status to be recorded even if the
+ * delivery of this status must be deferred. Deferred reporting
+ * is necessary, for example, when an error is detected during
+ * completion processing of one bio when other bios for this
+ * request are still outstanding.
+ */
+ int status;
+
+ /**
+ * Number of 512 byte sectors not transferred.
*/
- uint64_t id;
+ int residual_512b_sectors;
+
+ /**
+ * Starting sector number of the first request in the list.
+ */
+ off_t starting_sector_number;
+
+ /**
+ * If we're going to coalesce, the next contiguous sector would be
+ * this one.
+ */
+ off_t next_contig_sector;
+
+ /**
+ * Number of child requests in the list.
+ */
+ int num_children;
+
+ /**
+ * Number of I/O requests dispatched to the backend.
+ */
+ int pendcnt;
+
+ /**
+ * Total number of segments for requests in the list.
+ */
+ int nr_segments;
+
+ /**
+ * Flags for this particular request list.
+ */
+ xbb_reqlist_flags flags;
/**
* Kernel virtual address space reserved for this request
- * structure and used to map the remote domain's pages for
+ * list structure and used to map the remote domain's pages for
* this I/O, into our domain's address space.
*/
uint8_t *kva;
+ /**
+ * Base, psuedo-physical address, corresponding to the start
+ * of this request's kva region.
+ */
+ uint64_t gnt_base;
+
+
#ifdef XBB_USE_BOUNCE_BUFFERS
/**
* Pre-allocated domain local memory used to proxy remote
@@ -200,53 +265,91 @@ struct xbb_xen_req {
#endif
/**
- * Base, psuedo-physical address, corresponding to the start
- * of this request's kva region.
+ * Array of grant handles (one per page) used to map this request.
*/
- uint64_t gnt_base;
+ grant_handle_t *gnt_handles;
+
+ /**
+ * Device statistics request ordering type (ordered or simple).
+ */
+ devstat_tag_type ds_tag_type;
+
+ /**
+ * Device statistics request type (read, write, no_data).
+ */
+ devstat_trans_flags ds_trans_type;
+
+ /**
+ * The start time for this request.
+ */
+ struct bintime ds_t0;
+
+ /**
+ * Linked list of contiguous requests with the same operation type.
+ */
+ struct xbb_xen_req_list contig_req_list;
+
+ /**
+ * Linked list links used to aggregate idle requests in the
+ * request list free pool (xbb->reqlist_free_stailq) and pending
+ * requests waiting for execution (xbb->reqlist_pending_stailq).
+ */
+ STAILQ_ENTRY(xbb_xen_reqlist) links;
+};
+
+STAILQ_HEAD(xbb_xen_reqlist_list, xbb_xen_reqlist);
+
+/**
+ * \brief Object tracking an in-flight I/O from a Xen VBD consumer.
+ */
+struct xbb_xen_req {
+ /**
+ * Linked list links used to aggregate requests into a reqlist
+ * and to store them in the request free pool.
+ */
+ STAILQ_ENTRY(xbb_xen_req) links;
+
+ /**
+ * The remote domain's identifier for this I/O request.
+ */
+ uint64_t id;
/**
* The number of pages currently mapped for this request.
*/
- int nr_pages;
+ int nr_pages;
/**
* The number of 512 byte sectors comprising this requests.
*/
- int nr_512b_sectors;
+ int nr_512b_sectors;
/**
* The number of struct bio requests still outstanding for this
* request on the backend device. This field is only used for
* device (rather than file) backed I/O.
*/
- int pendcnt;
+ int pendcnt;
/**
* BLKIF_OP code for this request.
*/
- int operation;
+ int operation;
/**
- * BLKIF_RSP status code for this request.
- *
- * This field allows an error status to be recorded even if the
- * delivery of this status must be deferred. Deferred reporting
- * is necessary, for example, when an error is detected during
- * completion processing of one bio when other bios for this
- * request are still outstanding.
+ * Storage used for non-native ring requests.
*/
- int status;
+ blkif_request_t ring_req_storage;
/**
- * Device statistics request ordering type (ordered or simple).
+ * Pointer to the Xen request in the ring.
*/
- devstat_tag_type ds_tag_type;
+ blkif_request_t *ring_req;
/**
- * Device statistics request type (read, write, no_data).
+ * Consumer index for this request.
*/
- devstat_trans_flags ds_trans_type;
+ RING_IDX req_ring_idx;
/**
* The start time for this request.
@@ -254,9 +357,9 @@ struct xbb_xen_req {
struct bintime ds_t0;
/**
- * Array of grant handles (one per page) used to map this request.
+ * Pointer back to our parent request list.
*/
- grant_handle_t *gnt_handles;
+ struct xbb_xen_reqlist *reqlist;
};
SLIST_HEAD(xbb_xen_req_slist, xbb_xen_req);
@@ -321,7 +424,10 @@ typedef enum
XBBF_RESOURCE_SHORTAGE = 0x04,
/** Connection teardown in progress. */
- XBBF_SHUTDOWN = 0x08
+ XBBF_SHUTDOWN = 0x08,
+
+ /** A thread is already performing shutdown processing. */
+ XBBF_IN_SHUTDOWN = 0x10
} xbb_flag_t;
/** Backend device type. */
@@ -399,7 +505,7 @@ struct xbb_file_data {
* Only a single file based request is outstanding per-xbb instance,
* so we only need one of these.
*/
- struct iovec xiovecs[XBB_MAX_SEGMENTS_PER_REQUEST];
+ struct iovec xiovecs[XBB_MAX_SEGMENTS_PER_REQLIST];
#ifdef XBB_USE_BOUNCE_BUFFERS
/**
@@ -411,7 +517,7 @@ struct xbb_file_data {
* bounce-out the read data. This array serves as the temporary
* storage for this saved data.
*/
- struct iovec saved_xiovecs[XBB_MAX_SEGMENTS_PER_REQUEST];
+ struct iovec saved_xiovecs[XBB_MAX_SEGMENTS_PER_REQLIST];
/**
* \brief Array of memoized bounce buffer kva offsets used
@@ -422,7 +528,7 @@ struct xbb_file_data {
* the request sg elements is unavoidable. We memoize the computed
* bounce address here to reduce the cost of the second walk.
*/
- void *xiovecs_vaddr[XBB_MAX_SEGMENTS_PER_REQUEST];
+ void *xiovecs_vaddr[XBB_MAX_SEGMENTS_PER_REQLIST];
#endif /* XBB_USE_BOUNCE_BUFFERS */
};
@@ -437,9 +543,9 @@ union xbb_backend_data {
/**
* Function signature of backend specific I/O handlers.
*/
-typedef int (*xbb_dispatch_t)(struct xbb_softc *xbb, blkif_request_t *ring_req,
- struct xbb_xen_req *req, int nseg,
- int operation, int flags);
+typedef int (*xbb_dispatch_t)(struct xbb_softc *xbb,
+ struct xbb_xen_reqlist *reqlist, int operation,
+ int flags);
/**
* Per-instance configuration data.
@@ -467,14 +573,23 @@ struct xbb_softc {
xbb_dispatch_t dispatch_io;
/** The number of requests outstanding on the backend device/file. */
- u_int active_request_count;
+ int active_request_count;
/** Free pool of request tracking structures. */
- struct xbb_xen_req_slist request_free_slist;
+ struct xbb_xen_req_list request_free_stailq;
/** Array, sized at connection time, of request tracking structures. */
struct xbb_xen_req *requests;
+ /** Free pool of request list structures. */
+ struct xbb_xen_reqlist_list reqlist_free_stailq;
+
+ /** List of pending request lists awaiting execution. */
+ struct xbb_xen_reqlist_list reqlist_pending_stailq;
+
+ /** Array, sized at connection time, of request list structures. */
+ struct xbb_xen_reqlist *request_lists;
+
/**
* Global pool of kva used for mapping remote domain ring
* and I/O transaction data.
@@ -487,6 +602,15 @@ struct xbb_softc {
/** The size of the global kva pool. */
int kva_size;
+ /** The size of the KVA area used for request lists. */
+ int reqlist_kva_size;
+
+ /** The number of pages of KVA used for request lists */
+ int reqlist_kva_pages;
+
+ /** Bitmap of free KVA pages */
+ bitstr_t *kva_free;
+
/**
* \brief Cached value of the front-end's domain id.
*
@@ -508,12 +632,12 @@ struct xbb_softc {
int abi;
/**
- * \brief The maximum number of requests allowed to be in
- * flight at a time.
+ * \brief The maximum number of requests and request lists allowed
+ * to be in flight at a time.
*
* This value is negotiated via the XenStore.
*/
- uint32_t max_requests;
+ u_int max_requests;
/**
* \brief The maximum number of segments (1 page per segment)
@@ -521,7 +645,15 @@ struct xbb_softc {
*
* This value is negotiated via the XenStore.
*/
- uint32_t max_request_segments;
+ u_int max_request_segments;
+
+ /**
+ * \brief Maximum number of segments per request list.
+ *
+ * This value is derived from and will generally be larger than
+ * max_request_segments.
+ */
+ u_int max_reqlist_segments;
/**
* The maximum size of any request to this back-end
@@ -529,7 +661,13 @@ struct xbb_softc {
*
* This value is negotiated via the XenStore.
*/
- uint32_t max_request_size;
+ u_int max_request_size;
+
+ /**
+ * The maximum size of any request list. This is derived directly
+ * from max_reqlist_segments.
+ */
+ u_int max_reqlist_size;
/** Various configuration and state bit flags. */
xbb_flag_t flags;
@@ -574,6 +712,7 @@ struct xbb_softc {
struct vnode *vn;
union xbb_backend_data backend;
+
/** The native sector size of the backend. */
u_int sector_size;
@@ -598,7 +737,14 @@ struct xbb_softc {
*
* Ring processing is serialized so we only need one of these.
*/
- struct xbb_sg xbb_sgs[XBB_MAX_SEGMENTS_PER_REQUEST];
+ struct xbb_sg xbb_sgs[XBB_MAX_SEGMENTS_PER_REQLIST];
+
+ /**
+ * Temporary grant table map used in xbb_dispatch_io(). When
+ * XBB_MAX_SEGMENTS_PER_REQLIST gets large, keeping this on the
+ * stack could cause a stack overflow.
+ */
+ struct gnttab_map_grant_ref maps[XBB_MAX_SEGMENTS_PER_REQLIST];
/** Mutex protecting per-instance data. */
struct mtx lock;
@@ -614,8 +760,51 @@ struct xbb_softc {
int pseudo_phys_res_id;
#endif
- /** I/O statistics. */
+ /**
+ * I/O statistics from BlockBack dispatch down. These are
+ * coalesced requests, and we start them right before execution.
+ */
struct devstat *xbb_stats;
+
+ /**
+ * I/O statistics coming into BlockBack. These are the requests as
+ * we get them from BlockFront. They are started as soon as we
+ * receive a request, and completed when the I/O is complete.
+ */
+ struct devstat *xbb_stats_in;
+
+ /** Disable sending flush to the backend */
+ int disable_flush;
+
+ /** Send a real flush for every N flush requests */
+ int flush_interval;
+
+ /** Count of flush requests in the interval */
+ int flush_count;
+
+ /** Don't coalesce requests if this is set */
+ int no_coalesce_reqs;
+
+ /** Number of requests we have received */
+ uint64_t reqs_received;
+
+ /** Number of requests we have completed*/
+ uint64_t reqs_completed;
+
+ /** How many forced dispatches (i.e. without coalescing) have happend */
+ uint64_t forced_dispatch;
+
+ /** How many normal dispatches have happend */
+ uint64_t normal_dispatch;
+
+ /** How many total dispatches have happend */
+ uint64_t total_dispatch;
+
+ /** How many times we have run out of KVA */
+ uint64_t kva_shortages;
+
+ /** How many times we have run out of request structures */
+ uint64_t request_shortages;
};
/*---------------------------- Request Processing ----------------------------*/
@@ -633,21 +822,14 @@ xbb_get_req(struct xbb_softc *xbb)
struct xbb_xen_req *req;
req = NULL;
- mtx_lock(&xbb->lock);
- /*
- * Do not allow new requests to be allocated while we
- * are shutting down.
- */
- if ((xbb->flags & XBBF_SHUTDOWN) == 0) {
- if ((req = SLIST_FIRST(&xbb->request_free_slist)) != NULL) {
- SLIST_REMOVE_HEAD(&xbb->request_free_slist, links);
- xbb->active_request_count++;
- } else {
- xbb->flags |= XBBF_RESOURCE_SHORTAGE;
- }
+ mtx_assert(&xbb->lock, MA_OWNED);
+
+ if ((req = STAILQ_FIRST(&xbb->request_free_stailq)) != NULL) {
+ STAILQ_REMOVE_HEAD(&xbb->request_free_stailq, links);
+ xbb->active_request_count++;
}
- mtx_unlock(&xbb->lock);
+
return (req);
}
@@ -660,34 +842,40 @@ xbb_get_req(struct xbb_softc *xbb)
static inline void
xbb_release_req(struct xbb_softc *xbb, struct xbb_xen_req *req)
{
- int wake_thread;
+ mtx_assert(&xbb->lock, MA_OWNED);
- mtx_lock(&xbb->lock);
- wake_thread = xbb->flags & XBBF_RESOURCE_SHORTAGE;
- xbb->flags &= ~XBBF_RESOURCE_SHORTAGE;
- SLIST_INSERT_HEAD(&xbb->request_free_slist, req, links);
+ STAILQ_INSERT_HEAD(&xbb->request_free_stailq, req, links);
xbb->active_request_count--;
- if ((xbb->flags & XBBF_SHUTDOWN) != 0) {
- /*
- * Shutdown is in progress. See if we can
- * progress further now that one more request
- * has completed and been returned to the
- * free pool.
- */
- xbb_shutdown(xbb);
- }
- mtx_unlock(&xbb->lock);
+ KASSERT(xbb->active_request_count >= 0,
+ ("xbb_release_req: negative active count"));
+}
- if (wake_thread != 0)
- taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task);
+/**
+ * Return an xbb_xen_req_list of allocated xbb_xen_reqs to the free pool.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ * \param req_list The list of requests to free.
+ * \param nreqs The number of items in the list.
+ */
+static inline void
+xbb_release_reqs(struct xbb_softc *xbb, struct xbb_xen_req_list *req_list,
+ int nreqs)
+{
+ mtx_assert(&xbb->lock, MA_OWNED);
+
+ STAILQ_CONCAT(&xbb->request_free_stailq, req_list);
+ xbb->active_request_count -= nreqs;
+
+ KASSERT(xbb->active_request_count >= 0,
+ ("xbb_release_reqs: negative active count"));
}
/**
* Given a page index and 512b sector offset within that page,
* calculate an offset into a request's kva region.
*
- * \param req The request structure whose kva region will be accessed.
+ * \param reqlist The request structure whose kva region will be accessed.
* \param pagenr The page index used to compute the kva offset.
* \param sector The 512b sector index used to compute the page relative
* kva offset.
@@ -695,9 +883,9 @@ xbb_release_req(struct xbb_softc *xbb, struct xbb_xen_req *req)
* \return The computed global KVA offset.
*/
static inline uint8_t *
-xbb_req_vaddr(struct xbb_xen_req *req, int pagenr, int sector)
+xbb_reqlist_vaddr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector)
{
- return (req->kva + (PAGE_SIZE * pagenr) + (sector << 9));
+ return (reqlist->kva + (PAGE_SIZE * pagenr) + (sector << 9));
}
#ifdef XBB_USE_BOUNCE_BUFFERS
@@ -705,7 +893,7 @@ xbb_req_vaddr(struct xbb_xen_req *req, int pagenr, int sector)
* Given a page index and 512b sector offset within that page,
* calculate an offset into a request's local bounce memory region.
*
- * \param req The request structure whose bounce region will be accessed.
+ * \param reqlist The request structure whose bounce region will be accessed.
* \param pagenr The page index used to compute the bounce offset.
* \param sector The 512b sector index used to compute the page relative
* bounce offset.
@@ -713,9 +901,9 @@ xbb_req_vaddr(struct xbb_xen_req *req, int pagenr, int sector)
* \return The computed global bounce buffer address.
*/
static inline uint8_t *
-xbb_req_bounce_addr(struct xbb_xen_req *req, int pagenr, int sector)
+xbb_reqlist_bounce_addr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector)
{
- return (req->bounce + (PAGE_SIZE * pagenr) + (sector << 9));
+ return (reqlist->bounce + (PAGE_SIZE * pagenr) + (sector << 9));
}
#endif
@@ -724,7 +912,7 @@ xbb_req_bounce_addr(struct xbb_xen_req *req, int pagenr, int sector)
* calculate an offset into the request's memory region that the
* underlying backend device/file should use for I/O.
*
- * \param req The request structure whose I/O region will be accessed.
+ * \param reqlist The request structure whose I/O region will be accessed.
* \param pagenr The page index used to compute the I/O offset.
* \param sector The 512b sector index used to compute the page relative
* I/O offset.
@@ -736,12 +924,12 @@ xbb_req_bounce_addr(struct xbb_xen_req *req, int pagenr, int sector)
* this request.
*/
static inline uint8_t *
-xbb_req_ioaddr(struct xbb_xen_req *req, int pagenr, int sector)
+xbb_reqlist_ioaddr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector)
{
#ifdef XBB_USE_BOUNCE_BUFFERS
- return (xbb_req_bounce_addr(req, pagenr, sector));
+ return (xbb_reqlist_bounce_addr(reqlist, pagenr, sector));
#else
- return (xbb_req_vaddr(req, pagenr, sector));
+ return (xbb_reqlist_vaddr(reqlist, pagenr, sector));
#endif
}
@@ -750,7 +938,7 @@ xbb_req_ioaddr(struct xbb_xen_req *req, int pagenr, int sector)
* an offset into the local psuedo-physical address space used to map a
* front-end's request data into a request.
*
- * \param req The request structure whose pseudo-physical region
+ * \param reqlist The request list structure whose pseudo-physical region
* will be accessed.
* \param pagenr The page index used to compute the pseudo-physical offset.
* \param sector The 512b sector index used to compute the page relative
@@ -763,10 +951,126 @@ xbb_req_ioaddr(struct xbb_xen_req *req, int pagenr, int sector)
* this request.
*/
static inline uintptr_t
-xbb_req_gntaddr(struct xbb_xen_req *req, int pagenr, int sector)
+xbb_get_gntaddr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector)
{
- return ((uintptr_t)(req->gnt_base
- + (PAGE_SIZE * pagenr) + (sector << 9)));
+ struct xbb_softc *xbb;
+
+ xbb = reqlist->xbb;
+
+ return ((uintptr_t)(xbb->gnt_base_addr +
+ (uintptr_t)(reqlist->kva - xbb->kva) +
+ (PAGE_SIZE * pagenr) + (sector << 9)));
+}
+
+/**
+ * Get Kernel Virtual Address space for mapping requests.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ * \param nr_pages Number of pages needed.
+ * \param check_only If set, check for free KVA but don't allocate it.
+ * \param have_lock If set, xbb lock is already held.
+ *
+ * \return On success, a pointer to the allocated KVA region. Otherwise NULL.
+ *
+ * Note: This should be unnecessary once we have either chaining or
+ * scatter/gather support for struct bio. At that point we'll be able to
+ * put multiple addresses and lengths in one bio/bio chain and won't need
+ * to map everything into one virtual segment.
+ */
+static uint8_t *
+xbb_get_kva(struct xbb_softc *xbb, int nr_pages)
+{
+ intptr_t first_clear, num_clear;
+ uint8_t *free_kva;
+ int i;
+
+ KASSERT(nr_pages != 0, ("xbb_get_kva of zero length"));
+
+ first_clear = 0;
+ free_kva = NULL;
+
+ mtx_lock(&xbb->lock);
+
+ /*
+ * Look for the first available page. If there are none, we're done.
+ */
+ bit_ffc(xbb->kva_free, xbb->reqlist_kva_pages, &first_clear);
+
+ if (first_clear == -1)
+ goto bailout;
+
+ /*
+ * Starting at the first available page, look for consecutive free
+ * pages that will satisfy the user's request.
+ */
+ for (i = first_clear, num_clear = 0; i < xbb->reqlist_kva_pages; i++) {
+ /*
+ * If this is true, the page is used, so we have to reset
+ * the number of clear pages and the first clear page
+ * (since it pointed to a region with an insufficient number
+ * of clear pages).
+ */
+ if (bit_test(xbb->kva_free, i)) {
+ num_clear = 0;
+ first_clear = -1;
+ continue;
+ }
+
+ if (first_clear == -1)
+ first_clear = i;
+
+ /*
+ * If this is true, we've found a large enough free region
+ * to satisfy the request.
+ */
+ if (++num_clear == nr_pages) {
+
+ bit_nset(xbb->kva_free, first_clear,
+ first_clear + nr_pages - 1);
+
+ free_kva = xbb->kva +
+ (uint8_t *)(first_clear * PAGE_SIZE);
+
+ KASSERT(free_kva >= (uint8_t *)xbb->kva &&
+ free_kva + (nr_pages * PAGE_SIZE) <=
+ (uint8_t *)xbb->ring_config.va,
+ ("Free KVA %p len %d out of range, "
+ "kva = %#jx, ring VA = %#jx\n", free_kva,
+ nr_pages * PAGE_SIZE, (uintmax_t)xbb->kva,
+ (uintmax_t)xbb->ring_config.va));
+ break;
+ }
+ }
+
+bailout:
+
+ if (free_kva == NULL) {
+ xbb->flags |= XBBF_RESOURCE_SHORTAGE;
+ xbb->kva_shortages++;
+ }
+
+ mtx_unlock(&xbb->lock);
+
+ return (free_kva);
+}
+
+/**
+ * Free allocated KVA.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ * \param kva_ptr Pointer to allocated KVA region.
+ * \param nr_pages Number of pages in the KVA region.
+ */
+static void
+xbb_free_kva(struct xbb_softc *xbb, uint8_t *kva_ptr, int nr_pages)
+{
+ intptr_t start_page;
+
+ mtx_assert(&xbb->lock, MA_OWNED);
+
+ start_page = (intptr_t)(kva_ptr - xbb->kva) >> PAGE_SHIFT;
+ bit_nclear(xbb->kva_free, start_page, start_page + nr_pages - 1);
+
}
/**
@@ -775,23 +1079,23 @@ xbb_req_gntaddr(struct xbb_xen_req *req, int pagenr, int sector)
* \param req The request structure to unmap.
*/
static void
-xbb_unmap_req(struct xbb_xen_req *req)
+xbb_unmap_reqlist(struct xbb_xen_reqlist *reqlist)
{
- struct gnttab_unmap_grant_ref unmap[XBB_MAX_SEGMENTS_PER_REQUEST];
+ struct gnttab_unmap_grant_ref unmap[XBB_MAX_SEGMENTS_PER_REQLIST];
u_int i;
u_int invcount;
int error;
invcount = 0;
- for (i = 0; i < req->nr_pages; i++) {
+ for (i = 0; i < reqlist->nr_segments; i++) {
- if (req->gnt_handles[i] == GRANT_REF_INVALID)
+ if (reqlist->gnt_handles[i] == GRANT_REF_INVALID)
continue;
- unmap[invcount].host_addr = xbb_req_gntaddr(req, i, 0);
+ unmap[invcount].host_addr = xbb_get_gntaddr(reqlist, i, 0);
unmap[invcount].dev_bus_addr = 0;
- unmap[invcount].handle = req->gnt_handles[i];
- req->gnt_handles[i] = GRANT_REF_INVALID;
+ unmap[invcount].handle = reqlist->gnt_handles[i];
+ reqlist->gnt_handles[i] = GRANT_REF_INVALID;
invcount++;
}
@@ -801,6 +1105,175 @@ xbb_unmap_req(struct xbb_xen_req *req)
}
/**
+ * Allocate an internal transaction tracking structure from the free pool.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ *
+ * \return On success, a pointer to the allocated xbb_xen_reqlist structure.
+ * Otherwise NULL.
+ */
+static inline struct xbb_xen_reqlist *
+xbb_get_reqlist(struct xbb_softc *xbb)
+{
+ struct xbb_xen_reqlist *reqlist;
+
+ reqlist = NULL;
+
+ mtx_assert(&xbb->lock, MA_OWNED);
+
+ if ((reqlist = STAILQ_FIRST(&xbb->reqlist_free_stailq)) != NULL) {
+
+ STAILQ_REMOVE_HEAD(&xbb->reqlist_free_stailq, links);
+ reqlist->flags = XBB_REQLIST_NONE;
+ reqlist->kva = NULL;
+ reqlist->status = BLKIF_RSP_OKAY;
+ reqlist->residual_512b_sectors = 0;
+ reqlist->num_children = 0;
+ reqlist->nr_segments = 0;
+ STAILQ_INIT(&reqlist->contig_req_list);
+ }
+
+ return (reqlist);
+}
+
+/**
+ * Return an allocated transaction tracking structure to the free pool.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ * \param req The request list structure to free.
+ * \param wakeup If set, wakeup the work thread if freeing this reqlist
+ * during a resource shortage condition.
+ */
+static inline void
+xbb_release_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist,
+ int wakeup)
+{
+
+ mtx_lock(&xbb->lock);
+
+ if (wakeup) {
+ wakeup = xbb->flags & XBBF_RESOURCE_SHORTAGE;
+ xbb->flags &= ~XBBF_RESOURCE_SHORTAGE;
+ }
+
+ if (reqlist->kva != NULL)
+ xbb_free_kva(xbb, reqlist->kva, reqlist->nr_segments);
+
+ xbb_release_reqs(xbb, &reqlist->contig_req_list, reqlist->num_children);
+
+ STAILQ_INSERT_TAIL(&xbb->reqlist_free_stailq, reqlist, links);
+
+ if ((xbb->flags & XBBF_SHUTDOWN) != 0) {
+ /*
+ * Shutdown is in progress. See if we can
+ * progress further now that one more request
+ * has completed and been returned to the
+ * free pool.
+ */
+ xbb_shutdown(xbb);
+ }
+
+ mtx_unlock(&xbb->lock);
+
+ if (wakeup != 0)
+ taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task);
+}
+
+/**
+ * Request resources and do basic request setup.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ * \param reqlist Pointer to reqlist pointer.
+ * \param ring_req Pointer to a block ring request.
+ * \param ring_index The ring index of this request.
+ *
+ * \return 0 for success, non-zero for failure.
+ */
+static int
+xbb_get_resources(struct xbb_softc *xbb, struct xbb_xen_reqlist **reqlist,
+ blkif_request_t *ring_req, RING_IDX ring_idx)
+{
+ struct xbb_xen_reqlist *nreqlist;
+ struct xbb_xen_req *nreq;
+
+ nreqlist = NULL;
+ nreq = NULL;
+
+ mtx_lock(&xbb->lock);
+
+ /*
+ * We don't allow new resources to be allocated if we're in the
+ * process of shutting down.
+ */
+ if ((xbb->flags & XBBF_SHUTDOWN) != 0) {
+ mtx_unlock(&xbb->lock);
+ return (1);
+ }
+
+ /*
+ * Allocate a reqlist if the caller doesn't have one already.
+ */
+ if (*reqlist == NULL) {
+ nreqlist = xbb_get_reqlist(xbb);
+ if (nreqlist == NULL)
+ goto bailout_error;
+ }
+
+ /* We always allocate a request. */
+ nreq = xbb_get_req(xbb);
+ if (nreq == NULL)
+ goto bailout_error;
+
+ mtx_unlock(&xbb->lock);
+
+ if (*reqlist == NULL) {
+ *reqlist = nreqlist;
+ nreqlist->operation = ring_req->operation;
+ nreqlist->starting_sector_number = ring_req->sector_number;
+ STAILQ_INSERT_TAIL(&xbb->reqlist_pending_stailq, nreqlist,
+ links);
+ }
+
+ nreq->reqlist = *reqlist;
+ nreq->req_ring_idx = ring_idx;
+
+ if (xbb->abi != BLKIF_PROTOCOL_NATIVE) {
+ bcopy(ring_req, &nreq->ring_req_storage, sizeof(*ring_req));
+ nreq->ring_req = &nreq->ring_req_storage;
+ } else {
+ nreq->ring_req = ring_req;
+ }
+
+ binuptime(&nreq->ds_t0);
+ devstat_start_transaction(xbb->xbb_stats_in, &nreq->ds_t0);
+ STAILQ_INSERT_TAIL(&(*reqlist)->contig_req_list, nreq, links);
+ (*reqlist)->num_children++;
+ (*reqlist)->nr_segments += ring_req->nr_segments;
+
+ return (0);
+
+bailout_error:
+
+ /*
+ * We're out of resources, so set the shortage flag. The next time
+ * a request is released, we'll try waking up the work thread to
+ * see if we can allocate more resources.
+ */
+ xbb->flags |= XBBF_RESOURCE_SHORTAGE;
+ xbb->request_shortages++;
+
+ if (nreq != NULL)
+ xbb_release_req(xbb, nreq);
+
+ mtx_unlock(&xbb->lock);
+
+ if (nreqlist != NULL)
+ xbb_release_reqlist(xbb, nreqlist, /*wakeup*/ 0);
+
+ return (1);
+}
+
+/**
* Create and transmit a response to a blkif request.
*
* \param xbb Per-instance xbb configuration structure.
@@ -862,6 +1335,8 @@ xbb_send_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status)
more_to_do = 1;
}
+ xbb->reqs_completed++;
+
mtx_unlock(&xbb->lock);
if (more_to_do)
@@ -872,6 +1347,70 @@ xbb_send_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status)
}
/**
+ * Complete a request list.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ * \param reqlist Allocated internal request list structure.
+ */
+static void
+xbb_complete_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist)
+{
+ struct xbb_xen_req *nreq;
+ off_t sectors_sent;
+
+ sectors_sent = 0;
+
+ if (reqlist->flags & XBB_REQLIST_MAPPED)
+ xbb_unmap_reqlist(reqlist);
+
+ /*
+ * All I/O is done, send the response. A lock should not be
+ * necessary here because the request list is complete, and
+ * therefore this is the only context accessing this request
+ * right now. The functions we call do their own locking if
+ * necessary.
+ */
+ STAILQ_FOREACH(nreq, &reqlist->contig_req_list, links) {
+ off_t cur_sectors_sent;
+
+ xbb_send_response(xbb, nreq, reqlist->status);
+
+ /* We don't report bytes sent if there is an error. */
+ if (reqlist->status == BLKIF_RSP_OKAY)
+ cur_sectors_sent = nreq->nr_512b_sectors;
+ else
+ cur_sectors_sent = 0;
+
+ sectors_sent += cur_sectors_sent;
+
+ devstat_end_transaction(xbb->xbb_stats_in,
+ /*bytes*/cur_sectors_sent << 9,
+ reqlist->ds_tag_type,
+ reqlist->ds_trans_type,
+ /*now*/NULL,
+ /*then*/&nreq->ds_t0);
+ }
+
+ /*
+ * Take out any sectors not sent. If we wind up negative (which
+ * might happen if an error is reported as well as a residual), just
+ * report 0 sectors sent.
+ */
+ sectors_sent -= reqlist->residual_512b_sectors;
+ if (sectors_sent < 0)
+ sectors_sent = 0;
+
+ devstat_end_transaction(xbb->xbb_stats,
+ /*bytes*/ sectors_sent << 9,
+ reqlist->ds_tag_type,
+ reqlist->ds_trans_type,
+ /*now*/NULL,
+ /*then*/&reqlist->ds_t0);
+
+ xbb_release_reqlist(xbb, reqlist, /*wakeup*/ 1);
+}
+
+/**
* Completion handler for buffer I/O requests issued by the device
* backend driver.
*
@@ -881,18 +1420,34 @@ xbb_send_response(struct xbb_softc *xbb, struct xbb_xen_req *req, int status)
static void
xbb_bio_done(struct bio *bio)
{
- struct xbb_softc *xbb;
- struct xbb_xen_req *req;
+ struct xbb_softc *xbb;
+ struct xbb_xen_reqlist *reqlist;
+
+ reqlist = bio->bio_caller1;
+ xbb = reqlist->xbb;
- req = bio->bio_caller1;
- xbb = req->xbb;
+ reqlist->residual_512b_sectors += bio->bio_resid >> 9;
- /* Only include transferred I/O in stats. */
- req->nr_512b_sectors -= bio->bio_resid >> 9;
+ /*
+ * This is a bit imprecise. With aggregated I/O a single
+ * request list can contain multiple front-end requests and
+ * a multiple bios may point to a single request. By carefully
+ * walking the request list, we could map residuals and errors
+ * back to the original front-end request, but the interface
+ * isn't sufficiently rich for us to properly report the error.
+ * So, we just treat the entire request list as having failed if an
+ * error occurs on any part. And, if an error occurs, we treat
+ * the amount of data transferred as 0.
+ *
+ * For residuals, we report it on the overall aggregated device,
+ * but not on the individual requests, since we don't currently
+ * do the work to determine which front-end request to which the
+ * residual applies.
+ */
if (bio->bio_error) {
DPRINTF("BIO returned error %d for operation on device %s\n",
bio->bio_error, xbb->dev_name);
- req->status = BLKIF_RSP_ERROR;
+ reqlist->status = BLKIF_RSP_ERROR;
if (bio->bio_error == ENXIO
&& xenbus_get_state(xbb->dev) == XenbusStateConnected) {
@@ -911,23 +1466,18 @@ xbb_bio_done(struct bio *bio)
vm_offset_t kva_offset;
kva_offset = (vm_offset_t)bio->bio_data
- - (vm_offset_t)req->bounce;
- memcpy((uint8_t *)req->kva + kva_offset,
+ - (vm_offset_t)reqlist->bounce;
+ memcpy((uint8_t *)reqlist->kva + kva_offset,
bio->bio_data, bio->bio_bcount);
}
#endif /* XBB_USE_BOUNCE_BUFFERS */
- if (atomic_fetchadd_int(&req->pendcnt, -1) == 1) {
- xbb_unmap_req(req);
- xbb_send_response(xbb, req, req->status);
- devstat_end_transaction(xbb->xbb_stats,
- /*bytes*/req->nr_512b_sectors << 9,
- req->ds_tag_type,
- req->ds_trans_type,
- /*now*/NULL,
- /*then*/&req->ds_t0);
- xbb_release_req(xbb, req);
- }
+ /*
+ * Decrement the pending count for the request list. When we're
+ * done with the requests, send status back for all of them.
+ */
+ if (atomic_fetchadd_int(&reqlist->pendcnt, -1) == 1)
+ xbb_complete_reqlist(xbb, reqlist);
g_destroy_bio(bio);
}
@@ -936,228 +1486,315 @@ xbb_bio_done(struct bio *bio)
* Parse a blkif request into an internal request structure and send
* it to the backend for processing.
*
- * \param xbb Per-instance xbb configuration structure.
- * \param ring_req Front-end's I/O request as pulled from the shared
- * communication ring.
- * \param req Allocated internal request structure.
- * \param req_ring_idx The location of ring_req within the shared
- * communication ring.
+ * \param xbb Per-instance xbb configuration structure.
+ * \param reqlist Allocated internal request list structure.
*
+ * \return On success, 0. For resource shortages, non-zero.
+ *
* This routine performs the backend common aspects of request parsing
* including compiling an internal request structure, parsing the S/G
* list and any secondary ring requests in which they may reside, and
* the mapping of front-end I/O pages into our domain.
*/
-static void
-xbb_dispatch_io(struct xbb_softc *xbb, blkif_request_t *ring_req,
- struct xbb_xen_req *req, RING_IDX req_ring_idx)
+static int
+xbb_dispatch_io(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist)
{
- struct gnttab_map_grant_ref maps[XBB_MAX_SEGMENTS_PER_REQUEST];
struct xbb_sg *xbb_sg;
struct gnttab_map_grant_ref *map;
struct blkif_request_segment *sg;
struct blkif_request_segment *last_block_sg;
+ struct xbb_xen_req *nreq;
u_int nseg;
u_int seg_idx;
u_int block_segs;
int nr_sects;
+ int total_sects;
int operation;
uint8_t bio_flags;
int error;
- nseg = ring_req->nr_segments;
- nr_sects = 0;
- req->xbb = xbb;
- req->id = ring_req->id;
- req->operation = ring_req->operation;
- req->status = BLKIF_RSP_OKAY;
- req->ds_tag_type = DEVSTAT_TAG_SIMPLE;
- req->nr_pages = nseg;
- req->nr_512b_sectors = 0;
+ reqlist->ds_tag_type = DEVSTAT_TAG_SIMPLE;
bio_flags = 0;
- sg = NULL;
+ total_sects = 0;
+ nr_sects = 0;
+
+ /*
+ * First determine whether we have enough free KVA to satisfy this
+ * request list. If not, tell xbb_run_queue() so it can go to
+ * sleep until we have more KVA.
+ */
+ reqlist->kva = NULL;
+ if (reqlist->nr_segments != 0) {
+ reqlist->kva = xbb_get_kva(xbb, reqlist->nr_segments);
+ if (reqlist->kva == NULL) {
+ /*
+ * If we're out of KVA, return ENOMEM.
+ */
+ return (ENOMEM);
+ }
+ }
- binuptime(&req->ds_t0);
- devstat_start_transaction(xbb->xbb_stats, &req->ds_t0);
+ binuptime(&reqlist->ds_t0);
+ devstat_start_transaction(xbb->xbb_stats, &reqlist->ds_t0);
- switch (req->operation) {
+ switch (reqlist->operation) {
case BLKIF_OP_WRITE_BARRIER:
bio_flags |= BIO_ORDERED;
- req->ds_tag_type = DEVSTAT_TAG_ORDERED;
+ reqlist->ds_tag_type = DEVSTAT_TAG_ORDERED;
/* FALLTHROUGH */
case BLKIF_OP_WRITE:
operation = BIO_WRITE;
- req->ds_trans_type = DEVSTAT_WRITE;
+ reqlist->ds_trans_type = DEVSTAT_WRITE;
if ((xbb->flags & XBBF_READ_ONLY) != 0) {
DPRINTF("Attempt to write to read only device %s\n",
xbb->dev_name);
- goto fail_send_response;
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
}
break;
case BLKIF_OP_READ:
operation = BIO_READ;
- req->ds_trans_type = DEVSTAT_READ;
+ reqlist->ds_trans_type = DEVSTAT_READ;
break;
case BLKIF_OP_FLUSH_DISKCACHE:
+ /*
+ * If this is true, the user has requested that we disable
+ * flush support. So we just complete the requests
+ * successfully.
+ */
+ if (xbb->disable_flush != 0) {
+ goto send_response;
+ }
+
+ /*
+ * The user has requested that we only send a real flush
+ * for every N flush requests. So keep count, and either
+ * complete the request immediately or queue it for the
+ * backend.
+ */
+ if (xbb->flush_interval != 0) {
+ if (++(xbb->flush_count) < xbb->flush_interval) {
+ goto send_response;
+ } else
+ xbb->flush_count = 0;
+ }
+
operation = BIO_FLUSH;
- req->ds_tag_type = DEVSTAT_TAG_ORDERED;
- req->ds_trans_type = DEVSTAT_NO_DATA;
+ reqlist->ds_tag_type = DEVSTAT_TAG_ORDERED;
+ reqlist->ds_trans_type = DEVSTAT_NO_DATA;
goto do_dispatch;
/*NOTREACHED*/
default:
DPRINTF("error: unknown block io operation [%d]\n",
- req->operation);
- goto fail_send_response;
+ reqlist->operation);
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
}
- /* Check that number of segments is sane. */
- if (unlikely(nseg == 0)
- || unlikely(nseg > xbb->max_request_segments)) {
- DPRINTF("Bad number of segments in request (%d)\n", nseg);
- goto fail_send_response;
- }
-
- map = maps;
+ reqlist->xbb = xbb;
xbb_sg = xbb->xbb_sgs;
- block_segs = MIN(req->nr_pages, BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK);
- sg = ring_req->seg;
- last_block_sg = sg + block_segs;
+ map = xbb->maps;
seg_idx = 0;
- while (1) {
- while (sg < last_block_sg) {
-
- xbb_sg->first_sect = sg->first_sect;
- xbb_sg->last_sect = sg->last_sect;
- xbb_sg->nsect =
- (int8_t)(sg->last_sect - sg->first_sect + 1);
-
- if ((sg->last_sect >= (PAGE_SIZE >> 9))
- || (xbb_sg->nsect <= 0))
- goto fail_send_response;
-
- nr_sects += xbb_sg->nsect;
- map->host_addr = xbb_req_gntaddr(req, seg_idx,
- /*sector*/0);
- map->flags = GNTMAP_host_map;
- map->ref = sg->gref;
- map->dom = xbb->otherend_id;
- if (operation == BIO_WRITE)
- map->flags |= GNTMAP_readonly;
- sg++;
- map++;
- xbb_sg++;
- seg_idx++;
+ STAILQ_FOREACH(nreq, &reqlist->contig_req_list, links) {
+ blkif_request_t *ring_req;
+ RING_IDX req_ring_idx;
+ u_int req_seg_idx;
+
+ ring_req = nreq->ring_req;
+ req_ring_idx = nreq->req_ring_idx;
+ nr_sects = 0;
+ nseg = ring_req->nr_segments;
+ nreq->id = ring_req->id;
+ nreq->nr_pages = nseg;
+ nreq->nr_512b_sectors = 0;
+ req_seg_idx = 0;
+ sg = NULL;
+
+ /* Check that number of segments is sane. */
+ if (unlikely(nseg == 0)
+ || unlikely(nseg > xbb->max_request_segments)) {
+ DPRINTF("Bad number of segments in request (%d)\n",
+ nseg);
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
}
- block_segs = MIN(nseg - seg_idx,
- BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK);
- if (block_segs == 0)
- break;
-
- /*
- * Fetch the next request block full of SG elements.
- * For now, only the spacing between entries is different
- * in the different ABIs, not the sg entry layout.
- */
- req_ring_idx++;
- switch (xbb->abi) {
- case BLKIF_PROTOCOL_NATIVE:
- sg = BLKRING_GET_SG_REQUEST(&xbb->rings.native,
- req_ring_idx);
- break;
- case BLKIF_PROTOCOL_X86_32:
- {
- sg = BLKRING_GET_SG_REQUEST(&xbb->rings.x86_32,
- req_ring_idx);
- break;
- }
- case BLKIF_PROTOCOL_X86_64:
- {
- sg = BLKRING_GET_SG_REQUEST(&xbb->rings.x86_64,
- req_ring_idx);
- break;
- }
- default:
- panic("Unexpected blkif protocol ABI.");
- /* NOTREACHED */
- }
+ block_segs = MIN(nreq->nr_pages,
+ BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK);
+ sg = ring_req->seg;
last_block_sg = sg + block_segs;
- }
+ while (1) {
+
+ while (sg < last_block_sg) {
+ KASSERT(seg_idx <
+ XBB_MAX_SEGMENTS_PER_REQLIST,
+ ("seg_idx %d is too large, max "
+ "segs %d\n", seg_idx,
+ XBB_MAX_SEGMENTS_PER_REQLIST));
+
+ xbb_sg->first_sect = sg->first_sect;
+ xbb_sg->last_sect = sg->last_sect;
+ xbb_sg->nsect =
+ (int8_t)(sg->last_sect -
+ sg->first_sect + 1);
+
+ if ((sg->last_sect >= (PAGE_SIZE >> 9))
+ || (xbb_sg->nsect <= 0)) {
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
+ }
+
+ nr_sects += xbb_sg->nsect;
+ map->host_addr = xbb_get_gntaddr(reqlist,
+ seg_idx, /*sector*/0);
+ KASSERT(map->host_addr + PAGE_SIZE <=
+ xbb->ring_config.gnt_addr,
+ ("Host address %#jx len %d overlaps "
+ "ring address %#jx\n",
+ (uintmax_t)map->host_addr, PAGE_SIZE,
+ (uintmax_t)xbb->ring_config.gnt_addr));
+
+ map->flags = GNTMAP_host_map;
+ map->ref = sg->gref;
+ map->dom = xbb->otherend_id;
+ if (operation == BIO_WRITE)
+ map->flags |= GNTMAP_readonly;
+ sg++;
+ map++;
+ xbb_sg++;
+ seg_idx++;
+ req_seg_idx++;
+ }
- /* Convert to the disk's sector size */
- req->nr_512b_sectors = nr_sects;
- nr_sects = (nr_sects << 9) >> xbb->sector_size_shift;
+ block_segs = MIN(nseg - req_seg_idx,
+ BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK);
+ if (block_segs == 0)
+ break;
- if ((req->nr_512b_sectors & ((xbb->sector_size >> 9) - 1)) != 0) {
- device_printf(xbb->dev, "%s: I/O size (%d) is not a multiple "
- "of the backing store sector size (%d)\n",
- __func__, req->nr_512b_sectors << 9,
- xbb->sector_size);
- goto fail_send_response;
+ /*
+ * Fetch the next request block full of SG elements.
+ * For now, only the spacing between entries is
+ * different in the different ABIs, not the sg entry
+ * layout.
+ */
+ req_ring_idx++;
+ switch (xbb->abi) {
+ case BLKIF_PROTOCOL_NATIVE:
+ sg = BLKRING_GET_SG_REQUEST(&xbb->rings.native,
+ req_ring_idx);
+ break;
+ case BLKIF_PROTOCOL_X86_32:
+ {
+ sg = BLKRING_GET_SG_REQUEST(&xbb->rings.x86_32,
+ req_ring_idx);
+ break;
+ }
+ case BLKIF_PROTOCOL_X86_64:
+ {
+ sg = BLKRING_GET_SG_REQUEST(&xbb->rings.x86_64,
+ req_ring_idx);
+ break;
+ }
+ default:
+ panic("Unexpected blkif protocol ABI.");
+ /* NOTREACHED */
+ }
+ last_block_sg = sg + block_segs;
+ }
+
+ /* Convert to the disk's sector size */
+ nreq->nr_512b_sectors = nr_sects;
+ nr_sects = (nr_sects << 9) >> xbb->sector_size_shift;
+ total_sects += nr_sects;
+
+ if ((nreq->nr_512b_sectors &
+ ((xbb->sector_size >> 9) - 1)) != 0) {
+ device_printf(xbb->dev, "%s: I/O size (%d) is not "
+ "a multiple of the backing store sector "
+ "size (%d)\n", __func__,
+ nreq->nr_512b_sectors << 9,
+ xbb->sector_size);
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
+ }
}
error = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref,
- maps, req->nr_pages);
+ xbb->maps, reqlist->nr_segments);
if (error != 0)
panic("Grant table operation failed (%d)", error);
- for (seg_idx = 0, map = maps; seg_idx < nseg; seg_idx++, map++) {
+ reqlist->flags |= XBB_REQLIST_MAPPED;
+
+ for (seg_idx = 0, map = xbb->maps; seg_idx < reqlist->nr_segments;
+ seg_idx++, map++){
if (unlikely(map->status != 0)) {
- DPRINTF("invalid buffer -- could not remap it (%d)\n",
- map->status);
- DPRINTF("Mapping(%d): Host Addr 0x%lx, flags 0x%x "
- "ref 0x%x, dom %d\n", seg_idx,
+ DPRINTF("invalid buffer -- could not remap "
+ "it (%d)\n", map->status);
+ DPRINTF("Mapping(%d): Host Addr 0x%lx, flags "
+ "0x%x ref 0x%x, dom %d\n", seg_idx,
map->host_addr, map->flags, map->ref,
map->dom);
- goto fail_unmap_req;
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
}
- req->gnt_handles[seg_idx] = map->handle;
+ reqlist->gnt_handles[seg_idx] = map->handle;
}
- if (ring_req->sector_number + nr_sects > xbb->media_num_sectors) {
+ if (reqlist->starting_sector_number + total_sects >
+ xbb->media_num_sectors) {
DPRINTF("%s of [%" PRIu64 ",%" PRIu64 "] "
"extends past end of device %s\n",
operation == BIO_READ ? "read" : "write",
- ring_req->sector_number,
- ring_req->sector_number + nr_sects, xbb->dev_name);
- goto fail_unmap_req;
+ reqlist->starting_sector_number,
+ reqlist->starting_sector_number + total_sects,
+ xbb->dev_name);
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
}
do_dispatch:
error = xbb->dispatch_io(xbb,
- ring_req,
- req,
- nseg,
+ reqlist,
operation,
bio_flags);
if (error != 0) {
- if (operation == BIO_FLUSH)
- goto fail_send_response;
- else
- goto fail_unmap_req;
+ reqlist->status = BLKIF_RSP_ERROR;
+ goto send_response;
}
- return;
+ return (0);
+send_response:
-fail_unmap_req:
- xbb_unmap_req(req);
- /* FALLTHROUGH */
+ xbb_complete_reqlist(xbb, reqlist);
-fail_send_response:
- xbb_send_response(xbb, req, BLKIF_RSP_ERROR);
- xbb_release_req(xbb, req);
- devstat_end_transaction(xbb->xbb_stats,
- /*bytes*/0,
- req->ds_tag_type,
- req->ds_trans_type,
- /*now*/NULL,
- /*then*/&req->ds_t0);
+ return (0);
+}
+
+static __inline int
+xbb_count_sects(blkif_request_t *ring_req)
+{
+ int i;
+ int cur_size = 0;
+
+ for (i = 0; i < ring_req->nr_segments; i++) {
+ int nsect;
+
+ nsect = (int8_t)(ring_req->seg[i].last_sect -
+ ring_req->seg[i].first_sect + 1);
+ if (nsect <= 0)
+ break;
+
+ cur_size += nsect;
+ }
+
+ return (cur_size);
}
/**
@@ -1172,95 +1809,210 @@ fail_send_response:
static void
xbb_run_queue(void *context, int pending)
{
- struct xbb_softc *xbb;
- blkif_back_rings_t *rings;
- RING_IDX rp;
+ struct xbb_softc *xbb;
+ blkif_back_rings_t *rings;
+ RING_IDX rp;
+ uint64_t cur_sector;
+ int cur_operation;
+ struct xbb_xen_reqlist *reqlist;
- xbb = (struct xbb_softc *)context;
- rings = &xbb->rings;
+ xbb = (struct xbb_softc *)context;
+ rings = &xbb->rings;
/*
- * Cache req_prod to avoid accessing a cache line shared
- * with the frontend.
+ * Work gather and dispatch loop. Note that we have a bias here
+ * towards gathering I/O sent by blockfront. We first gather up
+ * everything in the ring, as long as we have resources. Then we
+ * dispatch one request, and then attempt to gather up any
+ * additional requests that have come in while we were dispatching
+ * the request.
+ *
+ * This allows us to get a clearer picture (via devstat) of how
+ * many requests blockfront is queueing to us at any given time.
*/
- rp = rings->common.sring->req_prod;
+ for (;;) {
+ int retval;
+
+ /*
+ * Initialize reqlist to the last element in the pending
+ * queue, if there is one. This allows us to add more
+ * requests to that request list, if we have room.
+ */
+ reqlist = STAILQ_LAST(&xbb->reqlist_pending_stailq,
+ xbb_xen_reqlist, links);
+ if (reqlist != NULL) {
+ cur_sector = reqlist->next_contig_sector;
+ cur_operation = reqlist->operation;
+ } else {
+ cur_operation = 0;
+ cur_sector = 0;
+ }
- /* Ensure we see queued requests up to 'rp'. */
- rmb();
+ /*
+ * Cache req_prod to avoid accessing a cache line shared
+ * with the frontend.
+ */
+ rp = rings->common.sring->req_prod;
+
+ /* Ensure we see queued requests up to 'rp'. */
+ rmb();
+
+ /**
+ * Run so long as there is work to consume and the generation
+ * of a response will not overflow the ring.
+ *
+ * @note There's a 1 to 1 relationship between requests and
+ * responses, so an overflow should never occur. This
+ * test is to protect our domain from digesting bogus
+ * data. Shouldn't we log this?
+ */
+ while (rings->common.req_cons != rp
+ && RING_REQUEST_CONS_OVERFLOW(&rings->common,
+ rings->common.req_cons) == 0){
+ blkif_request_t ring_req_storage;
+ blkif_request_t *ring_req;
+ int cur_size;
+
+ switch (xbb->abi) {
+ case BLKIF_PROTOCOL_NATIVE:
+ ring_req = RING_GET_REQUEST(&xbb->rings.native,
+ rings->common.req_cons);
+ break;
+ case BLKIF_PROTOCOL_X86_32:
+ {
+ struct blkif_x86_32_request *ring_req32;
+
+ ring_req32 = RING_GET_REQUEST(
+ &xbb->rings.x86_32, rings->common.req_cons);
+ blkif_get_x86_32_req(&ring_req_storage,
+ ring_req32);
+ ring_req = &ring_req_storage;
+ break;
+ }
+ case BLKIF_PROTOCOL_X86_64:
+ {
+ struct blkif_x86_64_request *ring_req64;
+
+ ring_req64 =RING_GET_REQUEST(&xbb->rings.x86_64,
+ rings->common.req_cons);
+ blkif_get_x86_64_req(&ring_req_storage,
+ ring_req64);
+ ring_req = &ring_req_storage;
+ break;
+ }
+ default:
+ panic("Unexpected blkif protocol ABI.");
+ /* NOTREACHED */
+ }
- /**
- * Run so long as there is work to consume and the generation
- * of a response will not overflow the ring.
- *
- * @note There's a 1 to 1 relationship between requests and responses,
- * so an overflow should never occur. This test is to protect
- * our domain from digesting bogus data. Shouldn't we log this?
- */
- while (rings->common.req_cons != rp
- && RING_REQUEST_CONS_OVERFLOW(&rings->common,
- rings->common.req_cons) == 0) {
- blkif_request_t ring_req_storage;
- blkif_request_t *ring_req;
- struct xbb_xen_req *req;
- RING_IDX req_ring_idx;
-
- req = xbb_get_req(xbb);
- if (req == NULL) {
/*
- * Resource shortage has been recorded.
- * We'll be scheduled to run once a request
- * object frees up due to a completion.
+ * Check for situations that would require closing
+ * off this I/O for further coalescing:
+ * - Coalescing is turned off.
+ * - Current I/O is out of sequence with the previous
+ * I/O.
+ * - Coalesced I/O would be too large.
*/
- break;
- }
+ if ((reqlist != NULL)
+ && ((xbb->no_coalesce_reqs != 0)
+ || ((xbb->no_coalesce_reqs == 0)
+ && ((ring_req->sector_number != cur_sector)
+ || (ring_req->operation != cur_operation)
+ || ((ring_req->nr_segments + reqlist->nr_segments) >
+ xbb->max_reqlist_segments))))) {
+ reqlist = NULL;
+ }
- switch (xbb->abi) {
- case BLKIF_PROTOCOL_NATIVE:
- ring_req = RING_GET_REQUEST(&xbb->rings.native,
- rings->common.req_cons);
- break;
- case BLKIF_PROTOCOL_X86_32:
- {
- struct blkif_x86_32_request *ring_req32;
-
- ring_req32 = RING_GET_REQUEST(&xbb->rings.x86_32,
- rings->common.req_cons);
- blkif_get_x86_32_req(&ring_req_storage, ring_req32);
- ring_req = &ring_req_storage;
- break;
+ /*
+ * Grab and check for all resources in one shot.
+ * If we can't get all of the resources we need,
+ * the shortage is noted and the thread will get
+ * woken up when more resources are available.
+ */
+ retval = xbb_get_resources(xbb, &reqlist, ring_req,
+ xbb->rings.common.req_cons);
+
+ if (retval != 0) {
+ /*
+ * Resource shortage has been recorded.
+ * We'll be scheduled to run once a request
+ * object frees up due to a completion.
+ */
+ break;
+ }
+
+ /*
+ * Signify that we can overwrite this request with
+ * a response by incrementing our consumer index.
+ * The response won't be generated until after
+ * we've already consumed all necessary data out
+ * of the version of the request in the ring buffer
+ * (for native mode). We must update the consumer
+ * index before issueing back-end I/O so there is
+ * no possibility that it will complete and a
+ * response be generated before we make room in
+ * the queue for that response.
+ */
+ xbb->rings.common.req_cons +=
+ BLKIF_SEGS_TO_BLOCKS(ring_req->nr_segments);
+ xbb->reqs_received++;
+
+ cur_size = xbb_count_sects(ring_req);
+ cur_sector = ring_req->sector_number + cur_size;
+ reqlist->next_contig_sector = cur_sector;
+ cur_operation = ring_req->operation;
}
- case BLKIF_PROTOCOL_X86_64:
- {
- struct blkif_x86_64_request *ring_req64;
-
- ring_req64 = RING_GET_REQUEST(&xbb->rings.x86_64,
- rings->common.req_cons);
- blkif_get_x86_64_req(&ring_req_storage, ring_req64);
- ring_req = &ring_req_storage;
+
+ /* Check for I/O to dispatch */
+ reqlist = STAILQ_FIRST(&xbb->reqlist_pending_stailq);
+ if (reqlist == NULL) {
+ /*
+ * We're out of work to do, put the task queue to
+ * sleep.
+ */
break;
}
- default:
- panic("Unexpected blkif protocol ABI.");
- /* NOTREACHED */
- }
/*
- * Signify that we can overwrite this request with a
- * response by incrementing our consumer index. The
- * response won't be generated until after we've already
- * consumed all necessary data out of the version of the
- * request in the ring buffer (for native mode). We
- * must update the consumer index before issueing back-end
- * I/O so there is no possibility that it will complete
- * and a response be generated before we make room in
- * the queue for that response.
+ * Grab the first request off the queue and attempt
+ * to dispatch it.
*/
- req_ring_idx = xbb->rings.common.req_cons;
- xbb->rings.common.req_cons +=
- BLKIF_SEGS_TO_BLOCKS(ring_req->nr_segments);
+ STAILQ_REMOVE_HEAD(&xbb->reqlist_pending_stailq, links);
- xbb_dispatch_io(xbb, ring_req, req, req_ring_idx);
+ retval = xbb_dispatch_io(xbb, reqlist);
+ if (retval != 0) {
+ /*
+ * xbb_dispatch_io() returns non-zero only when
+ * there is a resource shortage. If that's the
+ * case, re-queue this request on the head of the
+ * queue, and go to sleep until we have more
+ * resources.
+ */
+ STAILQ_INSERT_HEAD(&xbb->reqlist_pending_stailq,
+ reqlist, links);
+ break;
+ } else {
+ /*
+ * If we still have anything on the queue after
+ * removing the head entry, that is because we
+ * met one of the criteria to create a new
+ * request list (outlined above), and we'll call
+ * that a forced dispatch for statistical purposes.
+ *
+ * Otherwise, if there is only one element on the
+ * queue, we coalesced everything available on
+ * the ring and we'll call that a normal dispatch.
+ */
+ reqlist = STAILQ_FIRST(&xbb->reqlist_pending_stailq);
+
+ if (reqlist != NULL)
+ xbb->forced_dispatch++;
+ else
+ xbb->normal_dispatch++;
+
+ xbb->total_dispatch++;
+ }
}
}
@@ -1285,11 +2037,7 @@ xbb_intr(void *arg)
* Backend handler for character device access.
*
* \param xbb Per-instance xbb configuration structure.
- * \param ring_req Front-end's I/O request as pulled from the shared
- * communication ring.
- * \param req Allocated internal request structure.
- * \param nseg The number of valid segments for this request in
- * xbb->xbb_sgs.
+ * \param reqlist Allocated internal request list structure.
* \param operation BIO_* I/O operation code.
* \param bio_flags Additional bio_flag data to pass to any generated
* bios (e.g. BIO_ORDERED)..
@@ -1297,28 +2045,30 @@ xbb_intr(void *arg)
* \return 0 for success, errno codes for failure.
*/
static int
-xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
- struct xbb_xen_req *req, int nseg, int operation,
- int bio_flags)
+xbb_dispatch_dev(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist,
+ int operation, int bio_flags)
{
struct xbb_dev_data *dev_data;
- struct bio *bios[XBB_MAX_SEGMENTS_PER_REQUEST];
+ struct bio *bios[XBB_MAX_SEGMENTS_PER_REQLIST];
+ struct xbb_xen_req *nreq;
off_t bio_offset;
struct bio *bio;
struct xbb_sg *xbb_sg;
u_int nbio;
u_int bio_idx;
+ u_int nseg;
u_int seg_idx;
int error;
dev_data = &xbb->backend.dev;
- bio_offset = (off_t)ring_req->sector_number
+ bio_offset = (off_t)reqlist->starting_sector_number
<< xbb->sector_size_shift;
error = 0;
nbio = 0;
bio_idx = 0;
if (operation == BIO_FLUSH) {
+ nreq = STAILQ_FIRST(&reqlist->contig_req_list);
bio = g_new_bio();
if (unlikely(bio == NULL)) {
DPRINTF("Unable to allocate bio for BIO_FLUSH\n");
@@ -1332,19 +2082,21 @@ xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
bio->bio_offset = 0;
bio->bio_data = 0;
bio->bio_done = xbb_bio_done;
- bio->bio_caller1 = req;
+ bio->bio_caller1 = nreq;
bio->bio_pblkno = 0;
- req->pendcnt = 1;
+ nreq->pendcnt = 1;
- (*dev_data->csw->d_strategy)(bios[bio_idx]);
+ (*dev_data->csw->d_strategy)(bio);
return (0);
}
- for (seg_idx = 0, bio = NULL, xbb_sg = xbb->xbb_sgs;
- seg_idx < nseg;
- seg_idx++, xbb_sg++) {
+ xbb_sg = xbb->xbb_sgs;
+ bio = NULL;
+ nseg = reqlist->nr_segments;
+
+ for (seg_idx = 0; seg_idx < nseg; seg_idx++, xbb_sg++) {
/*
* KVA will not be contiguous, so any additional
@@ -1353,10 +2105,10 @@ xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
if ((bio != NULL)
&& (xbb_sg->first_sect != 0)) {
if ((bio->bio_length & (xbb->sector_size - 1)) != 0) {
- printf("%s: Discontiguous I/O request from "
- "domain %d ends on non-sector "
- "boundary\n", __func__,
- xbb->otherend_id);
+ printf("%s: Discontiguous I/O request "
+ "from domain %d ends on "
+ "non-sector boundary\n",
+ __func__, xbb->otherend_id);
error = EINVAL;
goto fail_free_bios;
}
@@ -1365,12 +2117,12 @@ xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
if (bio == NULL) {
/*
- * Make sure that the start of this bio is aligned
- * to a device sector.
+ * Make sure that the start of this bio is
+ * aligned to a device sector.
*/
- if ((bio_offset & (xbb->sector_size - 1)) != 0) {
- printf("%s: Misaligned I/O request from "
- "domain %d\n", __func__,
+ if ((bio_offset & (xbb->sector_size - 1)) != 0){
+ printf("%s: Misaligned I/O request "
+ "from domain %d\n", __func__,
xbb->otherend_id);
error = EINVAL;
goto fail_free_bios;
@@ -1385,12 +2137,11 @@ xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
bio->bio_flags |= bio_flags;
bio->bio_dev = dev_data->cdev;
bio->bio_offset = bio_offset;
- bio->bio_data = xbb_req_ioaddr(req, seg_idx,
- xbb_sg->first_sect);
+ bio->bio_data = xbb_reqlist_ioaddr(reqlist, seg_idx,
+ xbb_sg->first_sect);
bio->bio_done = xbb_bio_done;
- bio->bio_caller1 = req;
- bio->bio_pblkno = bio_offset
- >> xbb->sector_size_shift;
+ bio->bio_caller1 = reqlist;
+ bio->bio_pblkno = bio_offset >> xbb->sector_size_shift;
}
bio->bio_length += xbb_sg->nsect << 9;
@@ -1400,10 +2151,10 @@ xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
if (xbb_sg->last_sect != (PAGE_SIZE - 512) >> 9) {
if ((bio->bio_length & (xbb->sector_size - 1)) != 0) {
- printf("%s: Discontiguous I/O request from "
- "domain %d ends on non-sector "
- "boundary\n", __func__,
- xbb->otherend_id);
+ printf("%s: Discontiguous I/O request "
+ "from domain %d ends on "
+ "non-sector boundary\n",
+ __func__, xbb->otherend_id);
error = EINVAL;
goto fail_free_bios;
}
@@ -1415,7 +2166,7 @@ xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
}
}
- req->pendcnt = nbio;
+ reqlist->pendcnt = nbio;
for (bio_idx = 0; bio_idx < nbio; bio_idx++)
{
@@ -1423,10 +2174,10 @@ xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
vm_offset_t kva_offset;
kva_offset = (vm_offset_t)bios[bio_idx]->bio_data
- - (vm_offset_t)req->bounce;
+ - (vm_offset_t)reqlist->bounce;
if (operation == BIO_WRITE) {
memcpy(bios[bio_idx]->bio_data,
- (uint8_t *)req->kva + kva_offset,
+ (uint8_t *)reqlist->kva + kva_offset,
bios[bio_idx]->bio_bcount);
}
#endif
@@ -1438,7 +2189,7 @@ xbb_dispatch_dev(struct xbb_softc *xbb, blkif_request_t *ring_req,
fail_free_bios:
for (bio_idx = 0; bio_idx < (nbio-1); bio_idx++)
g_destroy_bio(bios[bio_idx]);
-
+
return (error);
}
@@ -1446,24 +2197,21 @@ fail_free_bios:
* Backend handler for file access.
*
* \param xbb Per-instance xbb configuration structure.
- * \param ring_req Front-end's I/O request as pulled from the shared
- * communication ring.
- * \param req Allocated internal request structure.
- * \param nseg The number of valid segments for this request in
- * xbb->xbb_sgs.
+ * \param reqlist Allocated internal request list.
* \param operation BIO_* I/O operation code.
- * \param bio_flags Additional bio_flag data to pass to any generated bios
+ * \param flags Additional bio_flag data to pass to any generated bios
* (e.g. BIO_ORDERED)..
*
* \return 0 for success, errno codes for failure.
*/
static int
-xbb_dispatch_file(struct xbb_softc *xbb, blkif_request_t *ring_req,
- struct xbb_xen_req *req, int nseg, int operation,
- int flags)
+xbb_dispatch_file(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist,
+ int operation, int flags)
{
struct xbb_file_data *file_data;
u_int seg_idx;
+ u_int nseg;
+ off_t sectors_sent;
struct uio xuio;
struct xbb_sg *xbb_sg;
struct iovec *xiovec;
@@ -1475,11 +2223,10 @@ xbb_dispatch_file(struct xbb_softc *xbb, blkif_request_t *ring_req,
int error;
file_data = &xbb->backend.file;
+ sectors_sent = 0;
error = 0;
bzero(&xuio, sizeof(xuio));
- req->pendcnt = 0;
-
switch (operation) {
case BIO_READ:
xuio.uio_rw = UIO_READ;
@@ -1509,37 +2256,39 @@ xbb_dispatch_file(struct xbb_softc *xbb, blkif_request_t *ring_req,
panic("invalid operation %d", operation);
/* NOTREACHED */
}
- xuio.uio_offset = (vm_offset_t)ring_req->sector_number
+ xuio.uio_offset = (vm_offset_t)reqlist->starting_sector_number
<< xbb->sector_size_shift;
-
xuio.uio_segflg = UIO_SYSSPACE;
xuio.uio_iov = file_data->xiovecs;
xuio.uio_iovcnt = 0;
+ xbb_sg = xbb->xbb_sgs;
+ nseg = reqlist->nr_segments;
- for (seg_idx = 0, xiovec = NULL, xbb_sg = xbb->xbb_sgs;
- seg_idx < nseg; seg_idx++, xbb_sg++) {
+ for (xiovec = NULL, seg_idx = 0; seg_idx < nseg; seg_idx++, xbb_sg++) {
/*
- * If the first sector is not 0, the KVA will not be
- * contiguous and we'll need to go on to another segment.
+ * If the first sector is not 0, the KVA will
+ * not be contiguous and we'll need to go on
+ * to another segment.
*/
if (xbb_sg->first_sect != 0)
xiovec = NULL;
if (xiovec == NULL) {
xiovec = &file_data->xiovecs[xuio.uio_iovcnt];
- xiovec->iov_base = xbb_req_ioaddr(req, seg_idx,
- xbb_sg->first_sect);
+ xiovec->iov_base = xbb_reqlist_ioaddr(reqlist,
+ seg_idx, xbb_sg->first_sect);
#ifdef XBB_USE_BOUNCE_BUFFERS
/*
- * Store the address of the incoming buffer at this
- * particular offset as well, so we can do the copy
- * later without having to do more work to
- * recalculate this address.
+ * Store the address of the incoming
+ * buffer at this particular offset
+ * as well, so we can do the copy
+ * later without having to do more
+ * work to recalculate this address.
*/
p_vaddr = &file_data->xiovecs_vaddr[xuio.uio_iovcnt];
- *p_vaddr = xbb_req_vaddr(req, seg_idx,
- xbb_sg->first_sect);
+ *p_vaddr = xbb_reqlist_vaddr(reqlist, seg_idx,
+ xbb_sg->first_sect);
#endif /* XBB_USE_BOUNCE_BUFFERS */
xiovec->iov_len = 0;
xuio.uio_iovcnt++;
@@ -1550,9 +2299,9 @@ xbb_dispatch_file(struct xbb_softc *xbb, blkif_request_t *ring_req,
xuio.uio_resid += xbb_sg->nsect << 9;
/*
- * If the last sector is not the full page size count,
- * the next segment will not be contiguous in KVA and we
- * need a new iovec.
+ * If the last sector is not the full page
+ * size count, the next segment will not be
+ * contiguous in KVA and we need a new iovec.
*/
if (xbb_sg->last_sect != (PAGE_SIZE - 512) >> 9)
xiovec = NULL;
@@ -1676,23 +2425,10 @@ xbb_dispatch_file(struct xbb_softc *xbb, blkif_request_t *ring_req,
bailout_send_response:
- /*
- * All I/O is already done, send the response. A lock is not
- * necessary here because we're single threaded, and therefore the
- * only context accessing this request right now. If that changes,
- * we may need some locking here.
- */
- xbb_unmap_req(req);
- xbb_send_response(xbb, req, (error == 0) ? BLKIF_RSP_OKAY :
- BLKIF_RSP_ERROR);
- devstat_end_transaction(xbb->xbb_stats,
- /*bytes*/error == 0 ? req->nr_512b_sectors << 9
- : 0,
- req->ds_tag_type,
- req->ds_trans_type,
- /*now*/NULL,
- /*then*/&req->ds_t0);
- xbb_release_req(xbb, req);
+ if (error != 0)
+ reqlist->status = BLKIF_RSP_ERROR;
+
+ xbb_complete_reqlist(xbb, reqlist);
return (0);
}
@@ -1913,6 +2649,12 @@ xbb_open_backend(struct xbb_softc *xbb)
DPRINTF("opening dev=%s\n", xbb->dev_name);
+ if (rootvnode == NULL) {
+ xenbus_dev_fatal(xbb->dev, ENOENT,
+ "Root file system not mounted");
+ return (ENOENT);
+ }
+
if ((xbb->flags & XBBF_READ_ONLY) == 0)
flags |= FWRITE;
@@ -1996,11 +2738,39 @@ xbb_open_backend(struct xbb_softc *xbb)
/*------------------------ Inter-Domain Communication ------------------------*/
/**
- * Cleanup all inter-domain communication mechanisms.
+ * Free dynamically allocated KVA or pseudo-physical address allocations.
*
* \param xbb Per-instance xbb configuration structure.
*/
static void
+xbb_free_communication_mem(struct xbb_softc *xbb)
+{
+ if (xbb->kva != 0) {
+#ifndef XENHVM
+ kmem_free(kernel_map, xbb->kva, xbb->kva_size);
+#else
+ if (xbb->pseudo_phys_res != NULL) {
+ bus_release_resource(xbb->dev, SYS_RES_MEMORY,
+ xbb->pseudo_phys_res_id,
+ xbb->pseudo_phys_res);
+ xbb->pseudo_phys_res = NULL;
+ }
+#endif
+ }
+ xbb->kva = 0;
+ xbb->gnt_base_addr = 0;
+ if (xbb->kva_free != NULL) {
+ free(xbb->kva_free, M_XENBLOCKBACK);
+ xbb->kva_free = NULL;
+ }
+}
+
+/**
+ * Cleanup all inter-domain communication mechanisms.
+ *
+ * \param xbb Per-instance xbb configuration structure.
+ */
+static int
xbb_disconnect(struct xbb_softc *xbb)
{
struct gnttab_unmap_grant_ref ops[XBB_MAX_RING_PAGES];
@@ -2011,13 +2781,24 @@ xbb_disconnect(struct xbb_softc *xbb)
DPRINTF("\n");
if ((xbb->flags & XBBF_RING_CONNECTED) == 0)
- return;
+ return (0);
if (xbb->irq != 0) {
unbind_from_irqhandler(xbb->irq);
xbb->irq = 0;
}
+ mtx_unlock(&xbb->lock);
+ taskqueue_drain(xbb->io_taskqueue, &xbb->io_task);
+ mtx_lock(&xbb->lock);
+
+ /*
+ * No new interrupts can generate work, but we must wait
+ * for all currently active requests to drain.
+ */
+ if (xbb->active_request_count != 0)
+ return (EAGAIN);
+
for (ring_idx = 0, op = ops;
ring_idx < xbb->ring_config.ring_pages;
ring_idx++, op++) {
@@ -2033,7 +2814,37 @@ xbb_disconnect(struct xbb_softc *xbb)
if (error != 0)
panic("Grant table op failed (%d)", error);
+ xbb_free_communication_mem(xbb);
+
+ if (xbb->requests != NULL) {
+ free(xbb->requests, M_XENBLOCKBACK);
+ xbb->requests = NULL;
+ }
+
+ if (xbb->request_lists != NULL) {
+ struct xbb_xen_reqlist *reqlist;
+ int i;
+
+ /* There is one request list for ever allocated request. */
+ for (i = 0, reqlist = xbb->request_lists;
+ i < xbb->max_requests; i++, reqlist++){
+#ifdef XBB_USE_BOUNCE_BUFFERS
+ if (reqlist->bounce != NULL) {
+ free(reqlist->bounce, M_XENBLOCKBACK);
+ reqlist->bounce = NULL;
+ }
+#endif
+ if (reqlist->gnt_handles != NULL) {
+ free(reqlist->gnt_handles, M_XENBLOCKBACK);
+ reqlist->gnt_handles = NULL;
+ }
+ }
+ free(xbb->request_lists, M_XENBLOCKBACK);
+ xbb->request_lists = NULL;
+ }
+
xbb->flags &= ~XBBF_RING_CONNECTED;
+ return (0);
}
/**
@@ -2135,7 +2946,7 @@ xbb_connect_ring(struct xbb_softc *xbb)
INTR_TYPE_BIO | INTR_MPSAFE,
&xbb->irq);
if (error) {
- xbb_disconnect(xbb);
+ (void)xbb_disconnect(xbb);
xenbus_dev_fatal(xbb->dev, error, "binding event channel");
return (error);
}
@@ -2145,6 +2956,10 @@ xbb_connect_ring(struct xbb_softc *xbb)
return 0;
}
+/* Needed to make bit_alloc() macro work */
+#define calloc(count, size) malloc((count)*(size), M_XENBLOCKBACK, \
+ M_NOWAIT|M_ZERO);
+
/**
* Size KVA and pseudo-physical address allocations based on negotiated
* values for the size and number of I/O requests, and the size of our
@@ -2158,9 +2973,18 @@ xbb_connect_ring(struct xbb_softc *xbb)
static int
xbb_alloc_communication_mem(struct xbb_softc *xbb)
{
- xbb->kva_size = (xbb->ring_config.ring_pages
- + (xbb->max_requests * xbb->max_request_segments))
- * PAGE_SIZE;
+ xbb->reqlist_kva_pages = xbb->max_requests * xbb->max_request_segments;
+ xbb->reqlist_kva_size = xbb->reqlist_kva_pages * PAGE_SIZE;
+ xbb->kva_size = xbb->reqlist_kva_size +
+ (xbb->ring_config.ring_pages * PAGE_SIZE);
+
+ xbb->kva_free = bit_alloc(xbb->reqlist_kva_pages);
+ if (xbb->kva_free == NULL)
+ return (ENOMEM);
+
+ DPRINTF("%s: kva_size = %d, reqlist_kva_size = %d\n",
+ device_get_nameunit(xbb->dev), xbb->kva_size,
+ xbb->reqlist_kva_size);
#ifndef XENHVM
xbb->kva = kmem_alloc_nofault(kernel_map, xbb->kva_size);
if (xbb->kva == 0)
@@ -2185,31 +3009,11 @@ xbb_alloc_communication_mem(struct xbb_softc *xbb)
xbb->kva = (vm_offset_t)rman_get_virtual(xbb->pseudo_phys_res);
xbb->gnt_base_addr = rman_get_start(xbb->pseudo_phys_res);
#endif /* XENHVM */
- return (0);
-}
-/**
- * Free dynamically allocated KVA or pseudo-physical address allocations.
- *
- * \param xbb Per-instance xbb configuration structure.
- */
-static void
-xbb_free_communication_mem(struct xbb_softc *xbb)
-{
- if (xbb->kva != 0) {
-#ifndef XENHVM
- kmem_free(kernel_map, xbb->kva, xbb->kva_size);
-#else
- if (xbb->pseudo_phys_res != NULL) {
- bus_release_resource(xbb->dev, SYS_RES_MEMORY,
- xbb->pseudo_phys_res_id,
- xbb->pseudo_phys_res);
- xbb->pseudo_phys_res = NULL;
- }
-#endif
- }
- xbb->kva = 0;
- xbb->gnt_base_addr = 0;
+ DPRINTF("%s: kva: %#jx, gnt_base_addr: %#jx\n",
+ device_get_nameunit(xbb->dev), (uintmax_t)xbb->kva,
+ (uintmax_t)xbb->gnt_base_addr);
+ return (0);
}
/**
@@ -2228,6 +3032,14 @@ xbb_collect_frontend_info(struct xbb_softc *xbb)
otherend_path = xenbus_get_otherend_path(xbb->dev);
/*
+ * Protocol defaults valid even if all negotiation fails.
+ */
+ xbb->ring_config.ring_pages = 1;
+ xbb->max_requests = BLKIF_MAX_RING_REQUESTS(PAGE_SIZE);
+ xbb->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK;
+ xbb->max_request_size = xbb->max_request_segments * PAGE_SIZE;
+
+ /*
* Mandatory data (used in all versions of the protocol) first.
*/
error = xs_gather(XST_NIL, otherend_path,
@@ -2255,19 +3067,19 @@ xbb_collect_frontend_info(struct xbb_softc *xbb)
* tree.
*/
(void)xs_scanf(XST_NIL, otherend_path,
- "ring-pages", NULL, "%" PRIu32,
+ "ring-pages", NULL, "%u",
&xbb->ring_config.ring_pages);
(void)xs_scanf(XST_NIL, otherend_path,
- "max-requests", NULL, "%" PRIu32,
+ "max-requests", NULL, "%u",
&xbb->max_requests);
(void)xs_scanf(XST_NIL, otherend_path,
- "max-request-segments", NULL, "%" PRIu32,
+ "max-request-segments", NULL, "%u",
&xbb->max_request_segments);
(void)xs_scanf(XST_NIL, otherend_path,
- "max-request-size", NULL, "%" PRIu32,
+ "max-request-size", NULL, "%u",
&xbb->max_request_size);
if (xbb->ring_config.ring_pages > XBB_MAX_RING_PAGES) {
@@ -2360,8 +3172,6 @@ xbb_alloc_requests(struct xbb_softc *xbb)
{
struct xbb_xen_req *req;
struct xbb_xen_req *last_req;
- uint8_t *req_kva;
- u_long gnt_base;
/*
* Allocate request book keeping datastructures.
@@ -2374,43 +3184,68 @@ xbb_alloc_requests(struct xbb_softc *xbb)
return (ENOMEM);
}
- req_kva = (uint8_t *)xbb->kva;
- gnt_base = xbb->gnt_base_addr;
req = xbb->requests;
last_req = &xbb->requests[xbb->max_requests - 1];
+ STAILQ_INIT(&xbb->request_free_stailq);
while (req <= last_req) {
+ STAILQ_INSERT_TAIL(&xbb->request_free_stailq, req, links);
+ req++;
+ }
+ return (0);
+}
+
+static int
+xbb_alloc_request_lists(struct xbb_softc *xbb)
+{
+ int i;
+ struct xbb_xen_reqlist *reqlist;
+
+ /*
+ * If no requests can be merged, we need 1 request list per
+ * in flight request.
+ */
+ xbb->request_lists = malloc(xbb->max_requests *
+ sizeof(*xbb->request_lists), M_XENBLOCKBACK, M_NOWAIT|M_ZERO);
+ if (xbb->request_lists == NULL) {
+ xenbus_dev_fatal(xbb->dev, ENOMEM,
+ "Unable to allocate request list structures");
+ return (ENOMEM);
+ }
+
+ STAILQ_INIT(&xbb->reqlist_free_stailq);
+ STAILQ_INIT(&xbb->reqlist_pending_stailq);
+ for (i = 0; i < xbb->max_requests; i++) {
int seg;
- req->xbb = xbb;
- req->kva = req_kva;
- req->gnt_handles = malloc(xbb->max_request_segments
- * sizeof(*req->gnt_handles),
- M_XENBLOCKBACK, M_NOWAIT|M_ZERO);
- if (req->gnt_handles == NULL) {
- xenbus_dev_fatal(xbb->dev, ENOMEM,
- "Unable to allocate request "
- "grant references");
- return (ENOMEM);
- }
+ reqlist = &xbb->request_lists[i];
+
+ reqlist->xbb = xbb;
+
#ifdef XBB_USE_BOUNCE_BUFFERS
- req->bounce = malloc(xbb->max_request_size,
- M_XENBLOCKBACK, M_NOWAIT);
- if (req->bounce == NULL) {
+ reqlist->bounce = malloc(xbb->max_reqlist_size,
+ M_XENBLOCKBACK, M_NOWAIT);
+ if (reqlist->bounce == NULL) {
xenbus_dev_fatal(xbb->dev, ENOMEM,
"Unable to allocate request "
"bounce buffers");
return (ENOMEM);
}
#endif /* XBB_USE_BOUNCE_BUFFERS */
- req->gnt_base = gnt_base;
- req_kva += xbb->max_request_segments * PAGE_SIZE;
- gnt_base += xbb->max_request_segments * PAGE_SIZE;
- SLIST_INSERT_HEAD(&xbb->request_free_slist, req, links);
- for (seg = 0; seg < xbb->max_request_segments; seg++)
- req->gnt_handles[seg] = GRANT_REF_INVALID;
+ reqlist->gnt_handles = malloc(xbb->max_reqlist_segments *
+ sizeof(*reqlist->gnt_handles),
+ M_XENBLOCKBACK, M_NOWAIT|M_ZERO);
+ if (reqlist->gnt_handles == NULL) {
+ xenbus_dev_fatal(xbb->dev, ENOMEM,
+ "Unable to allocate request "
+ "grant references");
+ return (ENOMEM);
+ }
+
+ for (seg = 0; seg < xbb->max_reqlist_segments; seg++)
+ reqlist->gnt_handles[seg] = GRANT_REF_INVALID;
- req++;
+ STAILQ_INSERT_TAIL(&xbb->reqlist_free_stailq, reqlist, links);
}
return (0);
}
@@ -2491,6 +3326,22 @@ xbb_connect(struct xbb_softc *xbb)
if (xbb_collect_frontend_info(xbb) != 0)
return;
+ xbb->flags &= ~XBBF_SHUTDOWN;
+
+ /*
+ * We limit the maximum number of reqlist segments to the maximum
+ * number of segments in the ring, or our absolute maximum,
+ * whichever is smaller.
+ */
+ xbb->max_reqlist_segments = MIN(xbb->max_request_segments *
+ xbb->max_requests, XBB_MAX_SEGMENTS_PER_REQLIST);
+
+ /*
+ * The maximum size is simply a function of the number of segments
+ * we can handle.
+ */
+ xbb->max_reqlist_size = xbb->max_reqlist_segments * PAGE_SIZE;
+
/* Allocate resources whose size depends on front-end configuration. */
error = xbb_alloc_communication_mem(xbb);
if (error != 0) {
@@ -2505,6 +3356,12 @@ xbb_connect(struct xbb_softc *xbb)
return;
}
+ error = xbb_alloc_request_lists(xbb);
+ if (error != 0) {
+ /* Specific errors are reported by xbb_alloc_request_lists(). */
+ return;
+ }
+
/*
* Connect communication channel.
*/
@@ -2520,7 +3377,7 @@ xbb_connect(struct xbb_softc *xbb)
* in this connection, and waiting for a front-end state
* change will not help the situation.
*/
- xbb_disconnect(xbb);
+ (void)xbb_disconnect(xbb);
return;
}
@@ -2542,7 +3399,7 @@ xbb_connect(struct xbb_softc *xbb)
static int
xbb_shutdown(struct xbb_softc *xbb)
{
- static int in_shutdown;
+ int error;
DPRINTF("\n");
@@ -2553,7 +3410,7 @@ xbb_shutdown(struct xbb_softc *xbb)
* the same time. Tell the caller that hits this
* race to try back later.
*/
- if (in_shutdown != 0)
+ if ((xbb->flags & XBBF_IN_SHUTDOWN) != 0)
return (EAGAIN);
DPRINTF("\n");
@@ -2561,20 +3418,30 @@ xbb_shutdown(struct xbb_softc *xbb)
/* Indicate shutdown is in progress. */
xbb->flags |= XBBF_SHUTDOWN;
- /* Wait for requests to complete. */
- if (xbb->active_request_count != 0)
- return (EAGAIN);
-
- DPRINTF("\n");
-
/* Disconnect from the front-end. */
- xbb_disconnect(xbb);
+ error = xbb_disconnect(xbb);
+ if (error != 0) {
+ /*
+ * Requests still outstanding. We'll be called again
+ * once they complete.
+ */
+ KASSERT(error == EAGAIN,
+ ("%s: Unexpected xbb_disconnect() failure %d",
+ __func__, error));
+
+ return (error);
+ }
- in_shutdown = 1;
+ DPRINTF("\n");
+
+ xbb->flags |= XBBF_IN_SHUTDOWN;
mtx_unlock(&xbb->lock);
- xenbus_set_state(xbb->dev, XenbusStateClosed);
+
+ if (xenbus_get_state(xbb->dev) < XenbusStateClosing)
+ xenbus_set_state(xbb->dev, XenbusStateClosing);
+
mtx_lock(&xbb->lock);
- in_shutdown = 0;
+ xbb->flags &= ~XBBF_IN_SHUTDOWN;
/* Indicate to xbb_detach() that is it safe to proceed. */
wakeup(xbb);
@@ -2634,6 +3501,77 @@ xbb_probe(device_t dev)
}
/**
+ * Setup sysctl variables to control various Block Back parameters.
+ *
+ * \param xbb Xen Block Back softc.
+ *
+ */
+static void
+xbb_setup_sysctl(struct xbb_softc *xbb)
+{
+ struct sysctl_ctx_list *sysctl_ctx = NULL;
+ struct sysctl_oid *sysctl_tree = NULL;
+
+ sysctl_ctx = device_get_sysctl_ctx(xbb->dev);
+ if (sysctl_ctx == NULL)
+ return;
+
+ sysctl_tree = device_get_sysctl_tree(xbb->dev);
+ if (sysctl_tree == NULL)
+ return;
+
+ SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "disable_flush", CTLFLAG_RW, &xbb->disable_flush, 0,
+ "fake the flush command");
+
+ SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "flush_interval", CTLFLAG_RW, &xbb->flush_interval, 0,
+ "send a real flush for N flush requests");
+
+ SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "no_coalesce_reqs", CTLFLAG_RW, &xbb->no_coalesce_reqs,0,
+ "Don't coalesce contiguous requests");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "reqs_received", CTLFLAG_RW, &xbb->reqs_received,
+ "how many I/O requests we have received");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "reqs_completed", CTLFLAG_RW, &xbb->reqs_completed,
+ "how many I/O requests have been completed");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "forced_dispatch", CTLFLAG_RW, &xbb->forced_dispatch,
+ "how many I/O dispatches were forced");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "normal_dispatch", CTLFLAG_RW, &xbb->normal_dispatch,
+ "how many I/O dispatches were normal");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "total_dispatch", CTLFLAG_RW, &xbb->total_dispatch,
+ "total number of I/O dispatches");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "kva_shortages", CTLFLAG_RW, &xbb->kva_shortages,
+ "how many times we have run out of KVA");
+
+ SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "request_shortages", CTLFLAG_RW,
+ &xbb->request_shortages,
+ "how many times we have run out of requests");
+
+ SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "max_requests", CTLFLAG_RD, &xbb->max_requests, 0,
+ "maximum outstanding requests (negotiated)");
+
+ SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+ "max_request_segments", CTLFLAG_RD,
+ &xbb->max_request_segments, 0,
+ "maximum number of pages per requests (negotiated)");
+}
+
+/**
* Attach to a XenBus device that has been claimed by our probe routine.
*
* \param dev NewBus device object representing this Xen Block Back instance.
@@ -2643,8 +3581,8 @@ xbb_probe(device_t dev)
static int
xbb_attach(device_t dev)
{
- struct xbb_softc *xbb;
- int error;
+ struct xbb_softc *xbb;
+ int error;
DPRINTF("Attaching to %s\n", xenbus_get_node(dev));
@@ -2658,15 +3596,6 @@ xbb_attach(device_t dev)
xbb->otherend_id = xenbus_get_otherend_id(dev);
TASK_INIT(&xbb->io_task, /*priority*/0, xbb_run_queue, xbb);
mtx_init(&xbb->lock, device_get_nameunit(dev), NULL, MTX_DEF);
- SLIST_INIT(&xbb->request_free_slist);
-
- /*
- * Protocol defaults valid even if all negotiation fails.
- */
- xbb->ring_config.ring_pages = 1;
- xbb->max_requests = BLKIF_MAX_RING_REQUESTS(PAGE_SIZE);
- xbb->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK;
- xbb->max_request_size = xbb->max_request_segments * PAGE_SIZE;
/*
* Publish protocol capabilities for consumption by the
@@ -2763,6 +3692,18 @@ xbb_attach(device_t dev)
DEVSTAT_TYPE_DIRECT
| DEVSTAT_TYPE_IF_OTHER,
DEVSTAT_PRIORITY_OTHER);
+
+ xbb->xbb_stats_in = devstat_new_entry("xbbi", device_get_unit(xbb->dev),
+ xbb->sector_size,
+ DEVSTAT_ALL_SUPPORTED,
+ DEVSTAT_TYPE_DIRECT
+ | DEVSTAT_TYPE_IF_OTHER,
+ DEVSTAT_PRIORITY_OTHER);
+ /*
+ * Setup sysctl variables.
+ */
+ xbb_setup_sysctl(xbb);
+
/*
* Create a taskqueue for doing work that must occur from a
* thread context.
@@ -2797,7 +3738,7 @@ xbb_attach(device_t dev)
}
/**
- * Detach from a block back device instanced.
+ * Detach from a block back device instance.
*
* \param dev NewBus device object representing this Xen Block Back instance.
*
@@ -2823,7 +3764,6 @@ xbb_detach(device_t dev)
"xbb_shutdown", 0);
}
mtx_unlock(&xbb->lock);
- mtx_destroy(&xbb->lock);
DPRINTF("\n");
@@ -2833,8 +3773,10 @@ xbb_detach(device_t dev)
if (xbb->xbb_stats != NULL)
devstat_remove_entry(xbb->xbb_stats);
+ if (xbb->xbb_stats_in != NULL)
+ devstat_remove_entry(xbb->xbb_stats_in);
+
xbb_close_backend(xbb);
- xbb_free_communication_mem(xbb);
if (xbb->dev_mode != NULL) {
free(xbb->dev_mode, M_XENBUS);
@@ -2851,29 +3793,7 @@ xbb_detach(device_t dev)
xbb->dev_name = NULL;
}
- if (xbb->requests != NULL) {
- struct xbb_xen_req *req;
- struct xbb_xen_req *last_req;
-
- req = xbb->requests;
- last_req = &xbb->requests[xbb->max_requests - 1];
- while (req <= last_req) {
-#ifdef XBB_USE_BOUNCE_BUFFERS
- if (req->bounce != NULL) {
- free(req->bounce, M_XENBLOCKBACK);
- req->bounce = NULL;
- }
-#endif
- if (req->gnt_handles != NULL) {
- free (req->gnt_handles, M_XENBLOCKBACK);
- req->gnt_handles = NULL;
- }
- req++;
- }
- free(xbb->requests, M_XENBLOCKBACK);
- xbb->requests = NULL;
- }
-
+ mtx_destroy(&xbb->lock);
return (0);
}
@@ -2921,34 +3841,35 @@ xbb_resume(device_t dev)
*
* \return 0 for success, errno codes for failure.
*/
-static int
+static void
xbb_frontend_changed(device_t dev, XenbusState frontend_state)
{
struct xbb_softc *xbb = device_get_softc(dev);
- DPRINTF("state=%s\n", xenbus_strstate(frontend_state));
+ DPRINTF("frontend_state=%s, xbb_state=%s\n",
+ xenbus_strstate(frontend_state),
+ xenbus_strstate(xenbus_get_state(xbb->dev)));
switch (frontend_state) {
case XenbusStateInitialising:
- case XenbusStateClosing:
break;
case XenbusStateInitialised:
case XenbusStateConnected:
xbb_connect(xbb);
break;
+ case XenbusStateClosing:
case XenbusStateClosed:
- case XenbusStateInitWait:
-
mtx_lock(&xbb->lock);
xbb_shutdown(xbb);
mtx_unlock(&xbb->lock);
+ if (frontend_state == XenbusStateClosed)
+ xenbus_set_state(xbb->dev, XenbusStateClosed);
break;
default:
xenbus_dev_fatal(xbb->dev, EINVAL, "saw state %d at frontend",
frontend_state);
break;
}
- return (0);
}
/*---------------------------- NewBus Registration ---------------------------*/
diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c
index 81c0e8b..2868313 100644
--- a/sys/dev/xen/blkfront/blkfront.c
+++ b/sys/dev/xen/blkfront/blkfront.c
@@ -739,7 +739,7 @@ setup_blkring(struct xb_softc *sc)
/**
* Callback received when the backend's state changes.
*/
-static int
+static void
blkfront_backend_changed(device_t dev, XenbusState backend_state)
{
struct xb_softc *sc = device_get_softc(dev);
@@ -772,8 +772,6 @@ blkfront_backend_changed(device_t dev, XenbusState backend_state)
blkfront_closing(dev);
break;
}
-
- return (0);
}
/*
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c
index c03d536..bc59fa0 100644
--- a/sys/dev/xen/control/control.c
+++ b/sys/dev/xen/control/control.c
@@ -173,8 +173,6 @@ static struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = {
};
struct xctrl_softc {
-
- /** Must be first */
struct xs_watch xctrl_watch;
};
@@ -203,24 +201,29 @@ xctrl_suspend()
unsigned long max_pfn, start_info_mfn;
#ifdef SMP
- cpumask_t map;
+ struct thread *td;
+ cpuset_t map;
/*
* Bind us to CPU 0 and stop any other VCPUs.
*/
- thread_lock(curthread);
- sched_bind(curthread, 0);
- thread_unlock(curthread);
+ td = curthread;
+ thread_lock(td);
+ sched_bind(td, 0);
+ thread_unlock(td);
KASSERT(PCPU_GET(cpuid) == 0, ("xen_suspend: not running on cpu 0"));
- map = PCPU_GET(other_cpus) & ~stopped_cpus;
- if (map)
+ sched_pin();
+ map = PCPU_GET(other_cpus);
+ sched_unpin();
+ CPU_NAND(&map, &stopped_cpus);
+ if (!CPU_EMPTY(&map))
stop_cpus(map);
#endif
if (DEVICE_SUSPEND(root_bus) != 0) {
printf("xen_suspend: device_suspend failed\n");
#ifdef SMP
- if (map)
+ if (!CPU_EMPTY(&map))
restart_cpus(map);
#endif
return;
@@ -289,7 +292,7 @@ xctrl_suspend()
thread_lock(curthread);
sched_unbind(curthread);
thread_unlock(curthread);
- if (map)
+ if (!CPU_EMPTY(&map))
restart_cpus(map);
#endif
}
@@ -445,6 +448,7 @@ xctrl_attach(device_t dev)
/* Activate watch */
xctrl->xctrl_watch.node = "control/shutdown";
xctrl->xctrl_watch.callback = xctrl_on_watch_event;
+ xctrl->xctrl_watch.callback_data = (uintptr_t)xctrl;
xs_register_watch(&xctrl->xctrl_watch);
#ifndef XENHVM
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
index 40ff031..c694514 100644
--- a/sys/dev/xen/netfront/netfront.c
+++ b/sys/dev/xen/netfront/netfront.c
@@ -650,7 +650,7 @@ netfront_send_fake_arp(device_t dev, struct netfront_info *info)
/**
* Callback received when the backend's state changes.
*/
-static int
+static void
netfront_backend_changed(device_t dev, XenbusState newstate)
{
struct netfront_info *sc = device_get_softc(dev);
@@ -680,7 +680,6 @@ netfront_backend_changed(device_t dev, XenbusState newstate)
xenbus_set_state(dev, XenbusStateClosed);
break;
}
- return (0);
}
static void
diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index ba1ac4e..df23e49 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
*/
#include "opt_inet6.h"
+#include "opt_kdtrace.h"
#include "opt_kgssapi.h"
#include "opt_nfs.h"
@@ -64,6 +65,28 @@ __FBSDID("$FreeBSD$");
#include <fs/nfs/nfsport.h>
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+
+dtrace_nfsclient_nfs23_start_probe_func_t
+ dtrace_nfscl_nfs234_start_probe;
+
+dtrace_nfsclient_nfs23_done_probe_func_t
+ dtrace_nfscl_nfs234_done_probe;
+
+/*
+ * Registered probes by RPC type.
+ */
+uint32_t nfscl_nfs2_start_probes[NFS_NPROCS + 1];
+uint32_t nfscl_nfs2_done_probes[NFS_NPROCS + 1];
+
+uint32_t nfscl_nfs3_start_probes[NFS_NPROCS + 1];
+uint32_t nfscl_nfs3_done_probes[NFS_NPROCS + 1];
+
+uint32_t nfscl_nfs4_start_probes[NFS_NPROCS + 1];
+uint32_t nfscl_nfs4_done_probes[NFS_NPROCS + 1];
+#endif
+
NFSSTATESPINLOCK;
NFSREQSPINLOCK;
extern struct nfsstats newnfsstats;
@@ -300,9 +323,7 @@ newnfs_disconnect(struct nfssockreq *nrp)
client = nrp->nr_client;
nrp->nr_client = NULL;
mtx_unlock(&nrp->nr_mtx);
-#ifdef KGSSAPI
- rpc_gss_secpurge(client);
-#endif
+ rpc_gss_secpurge_call(client);
CLNT_CLOSE(client);
CLNT_RELEASE(client);
} else {
@@ -314,21 +335,18 @@ static AUTH *
nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal,
char *srv_principal, gss_OID mech_oid, struct ucred *cred)
{
-#ifdef KGSSAPI
rpc_gss_service_t svc;
AUTH *auth;
#ifdef notyet
rpc_gss_options_req_t req_options;
#endif
-#endif
switch (secflavour) {
-#ifdef KGSSAPI
case RPCSEC_GSS_KRB5:
case RPCSEC_GSS_KRB5I:
case RPCSEC_GSS_KRB5P:
if (!mech_oid) {
- if (!rpc_gss_mech_to_oid("kerberosv5", &mech_oid))
+ if (!rpc_gss_mech_to_oid_call("kerberosv5", &mech_oid))
return (NULL);
}
if (secflavour == RPCSEC_GSS_KRB5)
@@ -344,7 +362,7 @@ nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal,
req_options.input_channel_bindings = NULL;
req_options.enc_type = nfs_keytab_enctype;
- auth = rpc_gss_secfind(nrp->nr_client, cred,
+ auth = rpc_gss_secfind_call(nrp->nr_client, cred,
clnt_principal, srv_principal, mech_oid, svc,
&req_options);
#else
@@ -354,7 +372,7 @@ nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal,
* principals. As such, that case cannot yet be handled.
*/
if (clnt_principal == NULL)
- auth = rpc_gss_secfind(nrp->nr_client, cred,
+ auth = rpc_gss_secfind_call(nrp->nr_client, cred,
srv_principal, mech_oid, svc);
else
auth = NULL;
@@ -362,7 +380,6 @@ nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal,
if (auth != NULL)
return (auth);
/* fallthrough */
-#endif /* KGSSAPI */
case AUTH_SYS:
default:
return (authunix_create(cred));
@@ -568,6 +585,29 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
if ((nd->nd_flag & ND_NFSV4) && procnum == NFSV4PROC_COMPOUND)
MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq),
M_NFSDREQ, M_WAITOK);
+#ifdef KDTRACE_HOOKS
+ if (dtrace_nfscl_nfs234_start_probe != NULL) {
+ uint32_t probe_id;
+ int probe_procnum;
+
+ if (nd->nd_flag & ND_NFSV4) {
+ probe_id =
+ nfscl_nfs4_start_probes[nd->nd_procnum];
+ probe_procnum = nd->nd_procnum;
+ } else if (nd->nd_flag & ND_NFSV3) {
+ probe_id = nfscl_nfs3_start_probes[procnum];
+ probe_procnum = procnum;
+ } else {
+ probe_id =
+ nfscl_nfs2_start_probes[nd->nd_procnum];
+ probe_procnum = procnum;
+ }
+ if (probe_id != 0)
+ (dtrace_nfscl_nfs234_start_probe)
+ (probe_id, vp, nd->nd_mreq, cred,
+ probe_procnum);
+ }
+#endif
}
trycnt = 0;
tryagain:
@@ -762,6 +802,27 @@ tryagain:
}
}
+#ifdef KDTRACE_HOOKS
+ if (nmp != NULL && dtrace_nfscl_nfs234_done_probe != NULL) {
+ uint32_t probe_id;
+ int probe_procnum;
+
+ if (nd->nd_flag & ND_NFSV4) {
+ probe_id = nfscl_nfs4_done_probes[nd->nd_procnum];
+ probe_procnum = nd->nd_procnum;
+ } else if (nd->nd_flag & ND_NFSV3) {
+ probe_id = nfscl_nfs3_done_probes[procnum];
+ probe_procnum = procnum;
+ } else {
+ probe_id = nfscl_nfs2_done_probes[nd->nd_procnum];
+ probe_procnum = procnum;
+ }
+ if (probe_id != 0)
+ (dtrace_nfscl_nfs234_done_probe)(probe_id, vp,
+ nd->nd_mreq, cred, probe_procnum, 0);
+ }
+#endif
+
m_freem(nd->nd_mreq);
AUTH_DESTROY(auth);
if (rep != NULL)
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index e725889..03b5786 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -1726,11 +1726,13 @@ nfsmout:
* Any usecnt must be decremented by calling nfsv4_relref() before
* calling nfsv4_lock(). It was done this way, so nfsv4_lock() could
* be called in a loop.
- * The last argument is set to indicate if the call slept, iff not NULL.
+ * The isleptp argument is set to indicate if the call slept, iff not NULL
+ * and the mp argument indicates to check for a forced dismount, iff not
+ * NULL.
*/
APPLESTATIC int
nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *isleptp,
- void *mutex)
+ void *mutex, struct mount *mp)
{
if (isleptp)
@@ -1751,6 +1753,10 @@ nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *isleptp,
lp->nfslock_lock |= NFSV4LOCK_LOCKWANTED;
}
while (lp->nfslock_lock & (NFSV4LOCK_LOCK | NFSV4LOCK_LOCKWANTED)) {
+ if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
+ lp->nfslock_lock &= ~NFSV4LOCK_LOCKWANTED;
+ return (0);
+ }
lp->nfslock_lock |= NFSV4LOCK_WANTED;
if (isleptp)
*isleptp = 1;
@@ -1801,9 +1807,12 @@ nfsv4_relref(struct nfsv4lock *lp)
* not wait for threads that want the exclusive lock. If priority needs
* to be given to threads that need the exclusive lock, a call to nfsv4_lock()
* with the 2nd argument == 0 should be done before calling nfsv4_getref().
+ * If the mp argument is not NULL, check for MNTK_UNMOUNTF being set and
+ * return without getting a refcnt for that case.
*/
APPLESTATIC void
-nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void *mutex)
+nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void *mutex,
+ struct mount *mp)
{
if (isleptp)
@@ -1813,12 +1822,16 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void *mutex)
* Wait for a lock held.
*/
while (lp->nfslock_lock & NFSV4LOCK_LOCK) {
+ if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0)
+ return;
lp->nfslock_lock |= NFSV4LOCK_WANTED;
if (isleptp)
*isleptp = 1;
(void) nfsmsleep(&lp->nfslock_lock, mutex,
PZERO - 1, "nfsv4lck", NULL);
}
+ if (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0)
+ return;
lp->nfslock_usecnt++;
}
diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h
index 6182ee8..5f944b5 100644
--- a/sys/fs/nfs/nfs_var.h
+++ b/sys/fs/nfs/nfs_var.h
@@ -247,10 +247,10 @@ int nfsv4_loadattr(struct nfsrv_descript *, vnode_t,
struct nfsv3_pathconf *, struct statfs *, struct nfsstatfs *,
struct nfsfsinfo *, NFSACL_T *,
int, int *, u_int32_t *, u_int32_t *, NFSPROC_T *, struct ucred *);
-int nfsv4_lock(struct nfsv4lock *, int, int *, void *);
+int nfsv4_lock(struct nfsv4lock *, int, int *, void *, struct mount *);
void nfsv4_unlock(struct nfsv4lock *, int);
void nfsv4_relref(struct nfsv4lock *);
-void nfsv4_getref(struct nfsv4lock *, int *, void *);
+void nfsv4_getref(struct nfsv4lock *, int *, void *, struct mount *);
int nfsv4_getref_nonblock(struct nfsv4lock *);
int nfsv4_testlock(struct nfsv4lock *);
int nfsrv_mtostr(struct nfsrv_descript *, char *, int);
@@ -370,7 +370,7 @@ int nfsrpc_readlink(vnode_t, struct uio *, struct ucred *,
NFSPROC_T *, struct nfsvattr *, int *, void *);
int nfsrpc_read(vnode_t, struct uio *, struct ucred *, NFSPROC_T *,
struct nfsvattr *, int *, void *);
-int nfsrpc_write(vnode_t, struct uio *, int *, u_char *,
+int nfsrpc_write(vnode_t, struct uio *, int *, int *,
struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *, int);
int nfsrpc_mknod(vnode_t, char *, int, struct vattr *, u_int32_t,
enum vtype, struct ucred *, NFSPROC_T *, struct nfsvattr *,
@@ -401,10 +401,10 @@ int nfsrpc_readdirplus(vnode_t, struct uio *, nfsuint64 *,
int nfsrpc_commit(vnode_t, u_quad_t, int, struct ucred *,
NFSPROC_T *, u_char *, struct nfsvattr *, int *, void *);
int nfsrpc_advlock(vnode_t, off_t, int, struct flock *, int,
- struct ucred *, NFSPROC_T *);
+ struct ucred *, NFSPROC_T *, void *, int);
int nfsrpc_lockt(struct nfsrv_descript *, vnode_t,
struct nfsclclient *, u_int64_t, u_int64_t, struct flock *,
- struct ucred *, NFSPROC_T *);
+ struct ucred *, NFSPROC_T *, void *, int);
int nfsrpc_lock(struct nfsrv_descript *, struct nfsmount *, vnode_t,
u_int8_t *, int, struct nfscllockowner *, int, int, u_int64_t,
u_int64_t, short, struct ucred *, NFSPROC_T *, int);
@@ -439,16 +439,16 @@ struct nfsclclient *nfscl_findcl(struct nfsmount *);
void nfscl_clientrelease(struct nfsclclient *);
void nfscl_freelock(struct nfscllock *, int);
int nfscl_getbytelock(vnode_t, u_int64_t, u_int64_t, short,
- struct ucred *, NFSPROC_T *, struct nfsclclient *, int, u_int8_t *,
- u_int8_t *, struct nfscllockowner **, int *, int *);
+ struct ucred *, NFSPROC_T *, struct nfsclclient *, int, void *, int,
+ u_int8_t *, u_int8_t *, struct nfscllockowner **, int *, int *);
int nfscl_relbytelock(vnode_t, u_int64_t, u_int64_t,
struct ucred *, NFSPROC_T *, int, struct nfsclclient *,
- struct nfscllockowner **, int *);
+ void *, int, struct nfscllockowner **, int *);
int nfscl_checkwritelocked(vnode_t, struct flock *,
- struct ucred *, NFSPROC_T *);
+ struct ucred *, NFSPROC_T *, void *, int);
void nfscl_lockrelease(struct nfscllockowner *, int, int);
void nfscl_fillclid(u_int64_t, char *, u_int8_t *, u_int16_t);
-void nfscl_filllockowner(NFSPROC_T *, u_int8_t *);
+void nfscl_filllockowner(void *, u_int8_t *, int);
void nfscl_freeopen(struct nfsclopen *, int);
void nfscl_umount(struct nfsmount *, NFSPROC_T *);
void nfscl_renewthread(struct nfsclclient *, NFSPROC_T *);
@@ -466,9 +466,10 @@ void nfscl_lockexcl(struct nfsv4lock *, void *);
void nfscl_lockunlock(struct nfsv4lock *);
void nfscl_lockderef(struct nfsv4lock *);
void nfscl_docb(struct nfsrv_descript *, NFSPROC_T *);
-void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *);
+void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *, void *,
+ int);
int nfscl_lockt(vnode_t, struct nfsclclient *, u_int64_t,
- u_int64_t, struct flock *, NFSPROC_T *);
+ u_int64_t, struct flock *, NFSPROC_T *, void *, int);
int nfscl_mustflush(vnode_t);
int nfscl_nodeleg(vnode_t, int);
int nfscl_removedeleg(vnode_t, NFSPROC_T *, nfsv4stateid_t *);
diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h
index c21482d..9866ef7 100644
--- a/sys/fs/nfs/nfsport.h
+++ b/sys/fs/nfs/nfsport.h
@@ -267,6 +267,7 @@
* NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is
* one greater than the last number.
*/
+#ifndef NFS_V3NPROCS
#define NFS_V3NPROCS 22
#define NFSPROC_LOOKUPP 22
@@ -293,6 +294,7 @@
* Must be defined as one higher than the last Proc# above.
*/
#define NFSV4_NPROCS 41
+#endif /* NFS_V3NPROCS */
/*
* Stats structure
@@ -358,7 +360,9 @@ struct ext_nfsstats {
/*
* Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code.
*/
+#ifndef NFS_NPROCS
#define NFS_NPROCS NFSV4_NPROCS
+#endif
#include <fs/nfs/nfskpiport.h>
#include <fs/nfs/nfsdport.h>
diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h
index 6b66c1f..a15f93b 100644
--- a/sys/fs/nfs/nfsproto.h
+++ b/sys/fs/nfs/nfsproto.h
@@ -226,6 +226,48 @@
#define NFSPROC_COMMIT 21
/*
+ * The lower numbers -> 21 are used by NFSv2 and v3. These define higher
+ * numbers used by NFSv4.
+ * NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is
+ * one greater than the last number.
+ */
+#ifndef NFS_V3NPROCS
+#define NFS_V3NPROCS 22
+
+#define NFSPROC_LOOKUPP 22
+#define NFSPROC_SETCLIENTID 23
+#define NFSPROC_SETCLIENTIDCFRM 24
+#define NFSPROC_LOCK 25
+#define NFSPROC_LOCKU 26
+#define NFSPROC_OPEN 27
+#define NFSPROC_CLOSE 28
+#define NFSPROC_OPENCONFIRM 29
+#define NFSPROC_LOCKT 30
+#define NFSPROC_OPENDOWNGRADE 31
+#define NFSPROC_RENEW 32
+#define NFSPROC_PUTROOTFH 33
+#define NFSPROC_RELEASELCKOWN 34
+#define NFSPROC_DELEGRETURN 35
+#define NFSPROC_RETDELEGREMOVE 36
+#define NFSPROC_RETDELEGRENAME1 37
+#define NFSPROC_RETDELEGRENAME2 38
+#define NFSPROC_GETACL 39
+#define NFSPROC_SETACL 40
+
+/*
+ * Must be defined as one higher than the last Proc# above.
+ */
+#define NFSV4_NPROCS 41
+#endif /* NFS_V3NPROCS */
+
+/*
+ * Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code.
+ */
+#ifndef NFS_NPROCS
+#define NFS_NPROCS NFSV4_NPROCS
+#endif
+
+/*
* NFSPROC_NOOP is a fake op# that can't be the same as any V2/3/4 Procedure
* or Operation#. Since the NFS V4 Op #s go higher, use NFSV4OP_NOPS, which
* is one greater than the highest Op#.
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index fee8b05..b33c8a5 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -35,6 +35,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_kdtrace.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bio.h>
@@ -55,6 +57,7 @@ __FBSDID("$FreeBSD$");
#include <fs/nfsclient/nfsmount.h>
#include <fs/nfsclient/nfs.h>
#include <fs/nfsclient/nfsnode.h>
+#include <fs/nfsclient/nfs_kdtrace.h>
extern int newnfs_directio_allow_mmap;
extern struct nfsstats newnfsstats;
@@ -302,7 +305,7 @@ ncl_putpages(struct vop_putpages_args *ap)
}
for (i = 0; i < npages; i++)
- rtvals[i] = VM_PAGER_AGAIN;
+ rtvals[i] = VM_PAGER_ERROR;
/*
* When putting pages, do not extend file past EOF.
@@ -345,16 +348,9 @@ ncl_putpages(struct vop_putpages_args *ap)
pmap_qremove(kva, npages);
relpbuf(bp, &ncl_pbuf_freecnt);
- if (!error) {
- int nwritten = round_page(count - uio.uio_resid) / PAGE_SIZE;
- for (i = 0; i < nwritten; i++) {
- rtvals[i] = VM_PAGER_OK;
- vm_page_undirty(pages[i]);
- }
- if (must_commit) {
- ncl_clearcommit(vp->v_mount);
- }
- }
+ vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
+ if (must_commit)
+ ncl_clearcommit(vp->v_mount);
return rtvals[0];
}
@@ -406,6 +402,7 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread *td, struct ucred *cred)
goto out;
}
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
error = VOP_GETATTR(vp, &vattr, cred);
if (error)
goto out;
@@ -922,6 +919,7 @@ ncl_write(struct vop_write_args *ap)
#endif
flush_and_restart:
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
error = ncl_vinvalbuf(vp, V_SAVE, td, 1);
if (error)
return (error);
@@ -935,6 +933,7 @@ flush_and_restart:
*/
if (ioflag & IO_APPEND) {
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
error = VOP_GETATTR(vp, &vattr, cred);
if (error)
return (error);
@@ -1755,6 +1754,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
mtx_lock(&np->n_mtx);
np->n_flag |= NWRITEERR;
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
mtx_unlock(&np->n_mtx);
}
bp->b_dirtyoff = bp->b_dirtyend = 0;
diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c
index 6866a73..c7fd69b 100644
--- a/sys/fs/nfsclient/nfs_clcomsubs.c
+++ b/sys/fs/nfsclient/nfs_clcomsubs.c
@@ -482,7 +482,7 @@ nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex)
int igotlock;
do {
- igotlock = nfsv4_lock(lckp, 1, NULL, mutex);
+ igotlock = nfsv4_lock(lckp, 1, NULL, mutex, NULL);
} while (!igotlock);
}
diff --git a/sys/fs/nfsclient/nfs_clkdtrace.c b/sys/fs/nfsclient/nfs_clkdtrace.c
new file mode 100644
index 0000000..c7db3a4
--- /dev/null
+++ b/sys/fs/nfsclient/nfs_clkdtrace.c
@@ -0,0 +1,600 @@
+/*-
+ * Copyright (c) 2009 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * This software was developed at the University of Cambridge Computer
+ * Laboratory with support from a grant from Google, Inc.
+ *
+ * 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 AUTHOR 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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+
+#include <sys/dtrace.h>
+#include <sys/dtrace_bsd.h>
+
+#include <fs/nfs/nfsproto.h>
+
+#include <fs/nfsclient/nfs_kdtrace.h>
+
+/*
+ * dtnfscl is a DTrace provider that tracks the intent to perform RPCs
+ * in the NFS client, as well as acess to and maintenance of the access and
+ * attribute caches. This is not quite the same as RPCs, because NFS may
+ * issue multiple RPC transactions in the event that authentication fails,
+ * there's a jukebox error, or none at all if the access or attribute cache
+ * hits. However, it cleanly represents the logical layer between RPC
+ * transmission and vnode/vfs operations, providing access to state linking
+ * the two.
+ */
+
+static int dtnfsclient_unload(void);
+static void dtnfsclient_getargdesc(void *, dtrace_id_t, void *,
+ dtrace_argdesc_t *);
+static void dtnfsclient_provide(void *, dtrace_probedesc_t *);
+static void dtnfsclient_destroy(void *, dtrace_id_t, void *);
+static void dtnfsclient_enable(void *, dtrace_id_t, void *);
+static void dtnfsclient_disable(void *, dtrace_id_t, void *);
+static void dtnfsclient_load(void *);
+
+static dtrace_pattr_t dtnfsclient_attr = {
+{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
+{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
+{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
+{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
+{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON },
+};
+
+/*
+ * Description of NFSv4, NFSv3 and (optional) NFSv2 probes for a procedure.
+ */
+struct dtnfsclient_rpc {
+ char *nr_v4_name;
+ char *nr_v3_name; /* Or NULL if none. */
+ char *nr_v2_name; /* Or NULL if none. */
+
+ /*
+ * IDs for the start and done cases, for NFSv2, NFSv3 and NFSv4.
+ */
+ uint32_t nr_v2_id_start, nr_v2_id_done;
+ uint32_t nr_v3_id_start, nr_v3_id_done;
+ uint32_t nr_v4_id_start, nr_v4_id_done;
+};
+
+/*
+ * This table is indexed by NFSv3 procedure number, but also used for NFSv2
+ * procedure names and NFSv4 operations.
+ */
+static struct dtnfsclient_rpc dtnfsclient_rpcs[NFS_NPROCS + 1] = {
+ { "null", "null", "null" },
+ { "getattr", "getattr", "getattr" },
+ { "setattr", "setattr", "setattr" },
+ { "lookup", "lookup", "lookup" },
+ { "access", "access", "noop" },
+ { "readlink", "readlink", "readlink" },
+ { "read", "read", "read" },
+ { "write", "write", "write" },
+ { "create", "create", "create" },
+ { "mkdir", "mkdir", "mkdir" },
+ { "symlink", "symlink", "symlink" },
+ { "mknod", "mknod" },
+ { "remove", "remove", "remove" },
+ { "rmdir", "rmdir", "rmdir" },
+ { "rename", "rename", "rename" },
+ { "link", "link", "link" },
+ { "readdir", "readdir", "readdir" },
+ { "readdirplus", "readdirplus" },
+ { "fsstat", "fsstat", "statfs" },
+ { "fsinfo", "fsinfo" },
+ { "pathconf", "pathconf" },
+ { "commit", "commit" },
+ { "lookupp" },
+ { "setclientid" },
+ { "setclientidcfrm" },
+ { "lock" },
+ { "locku" },
+ { "open" },
+ { "close" },
+ { "openconfirm" },
+ { "lockt" },
+ { "opendowngrade" },
+ { "renew" },
+ { "putrootfh" },
+ { "releaselckown" },
+ { "delegreturn" },
+ { "retdelegremove" },
+ { "retdelegrename1" },
+ { "retdelegrename2" },
+ { "getacl" },
+ { "setacl" },
+ { "noop", "noop", "noop" }
+};
+
+/*
+ * Module name strings.
+ */
+static char *dtnfsclient_accesscache_str = "accesscache";
+static char *dtnfsclient_attrcache_str = "attrcache";
+static char *dtnfsclient_nfs2_str = "nfs2";
+static char *dtnfsclient_nfs3_str = "nfs3";
+static char *dtnfsclient_nfs4_str = "nfs4";
+
+/*
+ * Function name strings.
+ */
+static char *dtnfsclient_flush_str = "flush";
+static char *dtnfsclient_load_str = "load";
+static char *dtnfsclient_get_str = "get";
+
+/*
+ * Name strings.
+ */
+static char *dtnfsclient_done_str = "done";
+static char *dtnfsclient_hit_str = "hit";
+static char *dtnfsclient_miss_str = "miss";
+static char *dtnfsclient_start_str = "start";
+
+static dtrace_pops_t dtnfsclient_pops = {
+ dtnfsclient_provide,
+ NULL,
+ dtnfsclient_enable,
+ dtnfsclient_disable,
+ NULL,
+ NULL,
+ dtnfsclient_getargdesc,
+ NULL,
+ NULL,
+ dtnfsclient_destroy
+};
+
+static dtrace_provider_id_t dtnfsclient_id;
+
+/*
+ * Most probes are generated from the above RPC table, but for access and
+ * attribute caches, we have specific IDs we recognize and handle specially
+ * in various spots.
+ */
+extern uint32_t nfscl_accesscache_flush_done_id;
+extern uint32_t nfscl_accesscache_get_hit_id;
+extern uint32_t nfscl_accesscache_get_miss_id;
+extern uint32_t nfscl_accesscache_load_done_id;
+
+extern uint32_t nfscl_attrcache_flush_done_id;
+extern uint32_t nfscl_attrcache_get_hit_id;
+extern uint32_t nfscl_attrcache_get_miss_id;
+extern uint32_t nfscl_attrcache_load_done_id;
+
+/*
+ * When tracing on a procedure is enabled, the DTrace ID for an RPC event is
+ * stored in one of these two NFS client-allocated arrays; 0 indicates that
+ * the event is not being traced so probes should not be called.
+ *
+ * For simplicity, we allocate both v2, v3 and v4 arrays as NFS_NPROCS + 1, and
+ * the v2, v3 arrays are simply sparse.
+ */
+extern uint32_t nfscl_nfs2_start_probes[NFS_NPROCS + 1];
+extern uint32_t nfscl_nfs2_done_probes[NFS_NPROCS + 1];
+
+extern uint32_t nfscl_nfs3_start_probes[NFS_NPROCS + 1];
+extern uint32_t nfscl_nfs3_done_probes[NFS_NPROCS + 1];
+
+extern uint32_t nfscl_nfs4_start_probes[NFS_NPROCS + 1];
+extern uint32_t nfscl_nfs4_done_probes[NFS_NPROCS + 1];
+
+/*
+ * Look up a DTrace probe ID to see if it's associated with a "done" event --
+ * if so, we will return a fourth argument type of "int".
+ */
+static int
+dtnfs234_isdoneprobe(dtrace_id_t id)
+{
+ int i;
+
+ for (i = 0; i < NFS_NPROCS + 1; i++) {
+ if (dtnfsclient_rpcs[i].nr_v4_id_done == id ||
+ dtnfsclient_rpcs[i].nr_v3_id_done == id ||
+ dtnfsclient_rpcs[i].nr_v2_id_done == id)
+ return (1);
+ }
+ return (0);
+}
+
+static void
+dtnfsclient_getargdesc(void *arg, dtrace_id_t id, void *parg,
+ dtrace_argdesc_t *desc)
+{
+ const char *p = NULL;
+
+ if (id == nfscl_accesscache_flush_done_id ||
+ id == nfscl_attrcache_flush_done_id ||
+ id == nfscl_attrcache_get_miss_id) {
+ switch (desc->dtargd_ndx) {
+ case 0:
+ p = "struct vnode *";
+ break;
+ default:
+ desc->dtargd_ndx = DTRACE_ARGNONE;
+ break;
+ }
+ } else if (id == nfscl_accesscache_get_hit_id ||
+ id == nfscl_accesscache_get_miss_id) {
+ switch (desc->dtargd_ndx) {
+ case 0:
+ p = "struct vnode *";
+ break;
+ case 1:
+ p = "uid_t";
+ break;
+ case 2:
+ p = "uint32_t";
+ break;
+ default:
+ desc->dtargd_ndx = DTRACE_ARGNONE;
+ break;
+ }
+ } else if (id == nfscl_accesscache_load_done_id) {
+ switch (desc->dtargd_ndx) {
+ case 0:
+ p = "struct vnode *";
+ break;
+ case 1:
+ p = "uid_t";
+ break;
+ case 2:
+ p = "uint32_t";
+ break;
+ case 3:
+ p = "int";
+ break;
+ default:
+ desc->dtargd_ndx = DTRACE_ARGNONE;
+ break;
+ }
+ } else if (id == nfscl_attrcache_get_hit_id) {
+ switch (desc->dtargd_ndx) {
+ case 0:
+ p = "struct vnode *";
+ break;
+ case 1:
+ p = "struct vattr *";
+ break;
+ default:
+ desc->dtargd_ndx = DTRACE_ARGNONE;
+ break;
+ }
+ } else if (id == nfscl_attrcache_load_done_id) {
+ switch (desc->dtargd_ndx) {
+ case 0:
+ p = "struct vnode *";
+ break;
+ case 1:
+ p = "struct vattr *";
+ break;
+ case 2:
+ p = "int";
+ break;
+ default:
+ desc->dtargd_ndx = DTRACE_ARGNONE;
+ break;
+ }
+ } else {
+ switch (desc->dtargd_ndx) {
+ case 0:
+ p = "struct vnode *";
+ break;
+ case 1:
+ p = "struct mbuf *";
+ break;
+ case 2:
+ p = "struct ucred *";
+ break;
+ case 3:
+ p = "int";
+ break;
+ case 4:
+ if (dtnfs234_isdoneprobe(id)) {
+ p = "int";
+ break;
+ }
+ /* FALLSTHROUGH */
+ default:
+ desc->dtargd_ndx = DTRACE_ARGNONE;
+ break;
+ }
+ }
+ if (p != NULL)
+ strlcpy(desc->dtargd_native, p, sizeof(desc->dtargd_native));
+}
+
+static void
+dtnfsclient_provide(void *arg, dtrace_probedesc_t *desc)
+{
+ int i;
+
+ if (desc != NULL)
+ return;
+
+ /*
+ * Register access cache probes.
+ */
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+ dtnfsclient_flush_str, dtnfsclient_done_str) == 0) {
+ nfscl_accesscache_flush_done_id = dtrace_probe_create(
+ dtnfsclient_id, dtnfsclient_accesscache_str,
+ dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL);
+ }
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+ dtnfsclient_get_str, dtnfsclient_hit_str) == 0) {
+ nfscl_accesscache_get_hit_id = dtrace_probe_create(
+ dtnfsclient_id, dtnfsclient_accesscache_str,
+ dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL);
+ }
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+ dtnfsclient_get_str, dtnfsclient_miss_str) == 0) {
+ nfscl_accesscache_get_miss_id = dtrace_probe_create(
+ dtnfsclient_id, dtnfsclient_accesscache_str,
+ dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL);
+ }
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str,
+ dtnfsclient_load_str, dtnfsclient_done_str) == 0) {
+ nfscl_accesscache_load_done_id = dtrace_probe_create(
+ dtnfsclient_id, dtnfsclient_accesscache_str,
+ dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL);
+ }
+
+ /*
+ * Register attribute cache probes.
+ */
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+ dtnfsclient_flush_str, dtnfsclient_done_str) == 0) {
+ nfscl_attrcache_flush_done_id = dtrace_probe_create(
+ dtnfsclient_id, dtnfsclient_attrcache_str,
+ dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL);
+ }
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+ dtnfsclient_get_str, dtnfsclient_hit_str) == 0) {
+ nfscl_attrcache_get_hit_id = dtrace_probe_create(
+ dtnfsclient_id, dtnfsclient_attrcache_str,
+ dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL);
+ }
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+ dtnfsclient_get_str, dtnfsclient_miss_str) == 0) {
+ nfscl_attrcache_get_miss_id = dtrace_probe_create(
+ dtnfsclient_id, dtnfsclient_attrcache_str,
+ dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL);
+ }
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str,
+ dtnfsclient_load_str, dtnfsclient_done_str) == 0) {
+ nfscl_attrcache_load_done_id = dtrace_probe_create(
+ dtnfsclient_id, dtnfsclient_attrcache_str,
+ dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL);
+ }
+
+ /*
+ * Register NFSv2 RPC procedures; note sparseness check for each slot
+ * in the NFSv3, NFSv4 procnum-indexed array.
+ */
+ for (i = 0; i < NFS_NPROCS + 1; i++) {
+ if (dtnfsclient_rpcs[i].nr_v2_name != NULL &&
+ dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str,
+ dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_start_str) ==
+ 0) {
+ dtnfsclient_rpcs[i].nr_v2_id_start =
+ dtrace_probe_create(dtnfsclient_id,
+ dtnfsclient_nfs2_str,
+ dtnfsclient_rpcs[i].nr_v2_name,
+ dtnfsclient_start_str, 0,
+ &nfscl_nfs2_start_probes[i]);
+ }
+ if (dtnfsclient_rpcs[i].nr_v2_name != NULL &&
+ dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str,
+ dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_done_str) ==
+ 0) {
+ dtnfsclient_rpcs[i].nr_v2_id_done =
+ dtrace_probe_create(dtnfsclient_id,
+ dtnfsclient_nfs2_str,
+ dtnfsclient_rpcs[i].nr_v2_name,
+ dtnfsclient_done_str, 0,
+ &nfscl_nfs2_done_probes[i]);
+ }
+ }
+
+ /*
+ * Register NFSv3 RPC procedures; note sparseness check for each slot
+ * in the NFSv4 procnum-indexed array.
+ */
+ for (i = 0; i < NFS_NPROCS + 1; i++) {
+ if (dtnfsclient_rpcs[i].nr_v3_name != NULL &&
+ dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str,
+ dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_start_str) ==
+ 0) {
+ dtnfsclient_rpcs[i].nr_v3_id_start =
+ dtrace_probe_create(dtnfsclient_id,
+ dtnfsclient_nfs3_str,
+ dtnfsclient_rpcs[i].nr_v3_name,
+ dtnfsclient_start_str, 0,
+ &nfscl_nfs3_start_probes[i]);
+ }
+ if (dtnfsclient_rpcs[i].nr_v3_name != NULL &&
+ dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str,
+ dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_done_str) ==
+ 0) {
+ dtnfsclient_rpcs[i].nr_v3_id_done =
+ dtrace_probe_create(dtnfsclient_id,
+ dtnfsclient_nfs3_str,
+ dtnfsclient_rpcs[i].nr_v3_name,
+ dtnfsclient_done_str, 0,
+ &nfscl_nfs3_done_probes[i]);
+ }
+ }
+
+ /*
+ * Register NFSv4 RPC procedures.
+ */
+ for (i = 0; i < NFS_NPROCS + 1; i++) {
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs4_str,
+ dtnfsclient_rpcs[i].nr_v4_name, dtnfsclient_start_str) ==
+ 0) {
+ dtnfsclient_rpcs[i].nr_v4_id_start =
+ dtrace_probe_create(dtnfsclient_id,
+ dtnfsclient_nfs4_str,
+ dtnfsclient_rpcs[i].nr_v4_name,
+ dtnfsclient_start_str, 0,
+ &nfscl_nfs4_start_probes[i]);
+ }
+ if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs4_str,
+ dtnfsclient_rpcs[i].nr_v4_name, dtnfsclient_done_str) ==
+ 0) {
+ dtnfsclient_rpcs[i].nr_v4_id_done =
+ dtrace_probe_create(dtnfsclient_id,
+ dtnfsclient_nfs4_str,
+ dtnfsclient_rpcs[i].nr_v4_name,
+ dtnfsclient_done_str, 0,
+ &nfscl_nfs4_done_probes[i]);
+ }
+ }
+}
+
+static void
+dtnfsclient_destroy(void *arg, dtrace_id_t id, void *parg)
+{
+}
+
+static void
+dtnfsclient_enable(void *arg, dtrace_id_t id, void *parg)
+{
+ uint32_t *p = parg;
+ void *f = dtrace_probe;
+
+ if (id == nfscl_accesscache_flush_done_id)
+ dtrace_nfscl_accesscache_flush_done_probe = f;
+ else if (id == nfscl_accesscache_get_hit_id)
+ dtrace_nfscl_accesscache_get_hit_probe = f;
+ else if (id == nfscl_accesscache_get_miss_id)
+ dtrace_nfscl_accesscache_get_miss_probe = f;
+ else if (id == nfscl_accesscache_load_done_id)
+ dtrace_nfscl_accesscache_load_done_probe = f;
+ else if (id == nfscl_attrcache_flush_done_id)
+ dtrace_nfscl_attrcache_flush_done_probe = f;
+ else if (id == nfscl_attrcache_get_hit_id)
+ dtrace_nfscl_attrcache_get_hit_probe = f;
+ else if (id == nfscl_attrcache_get_miss_id)
+ dtrace_nfscl_attrcache_get_miss_probe = f;
+ else if (id == nfscl_attrcache_load_done_id)
+ dtrace_nfscl_attrcache_load_done_probe = f;
+ else
+ *p = id;
+}
+
+static void
+dtnfsclient_disable(void *arg, dtrace_id_t id, void *parg)
+{
+ uint32_t *p = parg;
+
+ if (id == nfscl_accesscache_flush_done_id)
+ dtrace_nfscl_accesscache_flush_done_probe = NULL;
+ else if (id == nfscl_accesscache_get_hit_id)
+ dtrace_nfscl_accesscache_get_hit_probe = NULL;
+ else if (id == nfscl_accesscache_get_miss_id)
+ dtrace_nfscl_accesscache_get_miss_probe = NULL;
+ else if (id == nfscl_accesscache_load_done_id)
+ dtrace_nfscl_accesscache_load_done_probe = NULL;
+ else if (id == nfscl_attrcache_flush_done_id)
+ dtrace_nfscl_attrcache_flush_done_probe = NULL;
+ else if (id == nfscl_attrcache_get_hit_id)
+ dtrace_nfscl_attrcache_get_hit_probe = NULL;
+ else if (id == nfscl_attrcache_get_miss_id)
+ dtrace_nfscl_attrcache_get_miss_probe = NULL;
+ else if (id == nfscl_attrcache_load_done_id)
+ dtrace_nfscl_attrcache_load_done_probe = NULL;
+ else
+ *p = 0;
+}
+
+static void
+dtnfsclient_load(void *dummy)
+{
+
+ if (dtrace_register("nfscl", &dtnfsclient_attr,
+ DTRACE_PRIV_USER, NULL, &dtnfsclient_pops, NULL,
+ &dtnfsclient_id) != 0)
+ return;
+
+ dtrace_nfscl_nfs234_start_probe =
+ (dtrace_nfsclient_nfs23_start_probe_func_t)dtrace_probe;
+ dtrace_nfscl_nfs234_done_probe =
+ (dtrace_nfsclient_nfs23_done_probe_func_t)dtrace_probe;
+}
+
+
+static int
+dtnfsclient_unload()
+{
+
+ dtrace_nfscl_nfs234_start_probe = NULL;
+ dtrace_nfscl_nfs234_done_probe = NULL;
+
+ return (dtrace_unregister(dtnfsclient_id));
+}
+
+static int
+dtnfsclient_modevent(module_t mod __unused, int type, void *data __unused)
+{
+ int error = 0;
+
+ switch (type) {
+ case MOD_LOAD:
+ break;
+
+ case MOD_UNLOAD:
+ break;
+
+ case MOD_SHUTDOWN:
+ break;
+
+ default:
+ error = EOPNOTSUPP;
+ break;
+ }
+
+ return (error);
+}
+
+SYSINIT(dtnfsclient_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY,
+ dtnfsclient_load, NULL);
+SYSUNINIT(dtnfsclient_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY,
+ dtnfsclient_unload, NULL);
+
+DEV_MODULE(dtnfscl, dtnfsclient_modevent, NULL);
+MODULE_VERSION(dtnfscl, 1);
+MODULE_DEPEND(dtnfscl, dtrace, 1, 1, 1);
+MODULE_DEPEND(dtnfscl, opensolaris, 1, 1, 1);
+MODULE_DEPEND(dtnfscl, nfscl, 1, 1, 1);
+MODULE_DEPEND(dtnfscl, nfscommon, 1, 1, 1);
diff --git a/sys/fs/nfsclient/nfs_clkrpc.c b/sys/fs/nfsclient/nfs_clkrpc.c
index c4f7e94..0cd41b3 100644
--- a/sys/fs/nfsclient/nfs_clkrpc.c
+++ b/sys/fs/nfsclient/nfs_clkrpc.c
@@ -215,12 +215,9 @@ nfscbd_addsock(struct file *fp)
int
nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args)
{
-#ifdef KGSSAPI
char principal[128];
int error;
-#endif
-#ifdef KGSSAPI
if (args != NULL) {
error = copyinstr(args->principal, principal,
sizeof(principal), NULL);
@@ -229,7 +226,6 @@ nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args)
} else {
principal[0] = '\0';
}
-#endif
/*
* Only the first nfsd actually does any work. The RPC code
@@ -244,20 +240,16 @@ nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args)
NFSD_UNLOCK();
-#ifdef KGSSAPI
if (principal[0] != '\0')
- rpc_gss_set_svc_name(principal, "kerberosv5",
+ rpc_gss_set_svc_name_call(principal, "kerberosv5",
GSS_C_INDEFINITE, NFS_CALLBCKPROG, NFSV4_CBVERS);
-#endif
nfscbd_pool->sp_minthreads = 4;
nfscbd_pool->sp_maxthreads = 4;
svc_run(nfscbd_pool);
-#ifdef KGSSAPI
- rpc_gss_clear_svc_name(NFS_CALLBCKPROG, NFSV4_CBVERS);
-#endif
+ rpc_gss_clear_svc_name_call(NFS_CALLBCKPROG, NFSV4_CBVERS);
NFSD_LOCK();
nfs_numnfscbd--;
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c
index d4d652e..d15de6e 100644
--- a/sys/fs/nfsclient/nfs_clnode.c
+++ b/sys/fs/nfsclient/nfs_clnode.c
@@ -35,6 +35,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_kdtrace.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/fcntl.h>
@@ -53,6 +55,7 @@ __FBSDID("$FreeBSD$");
#include <fs/nfsclient/nfsnode.h>
#include <fs/nfsclient/nfsmount.h>
#include <fs/nfsclient/nfs.h>
+#include <fs/nfsclient/nfs_kdtrace.h>
#include <nfs/nfs_lock.h>
@@ -300,7 +303,9 @@ ncl_invalcaches(struct vnode *vp)
mtx_lock(&np->n_mtx);
for (i = 0; i < NFS_ACCESSCACHESIZE; i++)
np->n_accesscache[i].stamp = 0;
+ KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp);
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
mtx_unlock(&np->n_mtx);
}
diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c
index 0c3a4c9..0538382 100644
--- a/sys/fs/nfsclient/nfs_clport.c
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -34,6 +34,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_kdtrace.h"
+
/*
* generally, I don't like #includes inside .h files, but it seems to
* be the easiest way to handle the port.
@@ -43,6 +45,26 @@ __FBSDID("$FreeBSD$");
#include <netinet/if_ether.h>
#include <net/if_types.h>
+#include <fs/nfsclient/nfs_kdtrace.h>
+
+#ifdef KDTRACE_HOOKS
+dtrace_nfsclient_attrcache_flush_probe_func_t
+ dtrace_nfscl_attrcache_flush_done_probe;
+uint32_t nfscl_attrcache_flush_done_id;
+
+dtrace_nfsclient_attrcache_get_hit_probe_func_t
+ dtrace_nfscl_attrcache_get_hit_probe;
+uint32_t nfscl_attrcache_get_hit_id;
+
+dtrace_nfsclient_attrcache_get_miss_probe_func_t
+ dtrace_nfscl_attrcache_get_miss_probe;
+uint32_t nfscl_attrcache_get_miss_id;
+
+dtrace_nfsclient_attrcache_load_probe_func_t
+ dtrace_nfscl_attrcache_load_done_probe;
+uint32_t nfscl_attrcache_load_done_id;
+#endif /* !KDTRACE_HOOKS */
+
extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1;
extern struct vop_vector newnfs_vnodeops;
extern struct vop_vector newnfs_fifoops;
@@ -407,6 +429,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper,
*/
vap->va_size = np->n_size;
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
} else if (np->n_flag & NMODIFIED) {
/*
* We've modified the file: Use the larger
@@ -439,9 +462,11 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper,
* We detect this by for the mtime moving back. We invalidate the
* attrcache when this happens.
*/
- if (timespeccmp(&mtime_save, &vap->va_mtime, >))
+ if (timespeccmp(&mtime_save, &vap->va_mtime, >)) {
/* Size changed or mtime went backwards */
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
+ }
if (vaper != NULL) {
NFSBCOPY((caddr_t)vap, (caddr_t)vaper, sizeof(*vap));
if (np->n_flag & NCHG) {
@@ -451,6 +476,10 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr *nap, void *nvaper,
vaper->va_mtime = np->n_mtim;
}
}
+#ifdef KDTRACE_HOOKS
+ if (np->n_attrstamp != 0)
+ KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, 0);
+#endif
NFSUNLOCKNODE(np);
return (0);
}
@@ -500,7 +529,7 @@ nfscl_fillclid(u_int64_t clval, char *uuid, u_int8_t *cp, u_int16_t idlen)
* Fill in a lock owner name. For now, pid + the process's creation time.
*/
void
-nfscl_filllockowner(struct thread *td, u_int8_t *cp)
+nfscl_filllockowner(void *id, u_int8_t *cp, int flags)
{
union {
u_int32_t lval;
@@ -508,37 +537,35 @@ nfscl_filllockowner(struct thread *td, u_int8_t *cp)
} tl;
struct proc *p;
-if (td == NULL) {
- printf("NULL td\n");
- bzero(cp, 12);
- return;
-}
- p = td->td_proc;
-if (p == NULL) {
- printf("NULL pid\n");
- bzero(cp, 12);
- return;
-}
- tl.lval = p->p_pid;
- *cp++ = tl.cval[0];
- *cp++ = tl.cval[1];
- *cp++ = tl.cval[2];
- *cp++ = tl.cval[3];
-if (p->p_stats == NULL) {
- printf("pstats null\n");
- bzero(cp, 8);
- return;
-}
- tl.lval = p->p_stats->p_start.tv_sec;
- *cp++ = tl.cval[0];
- *cp++ = tl.cval[1];
- *cp++ = tl.cval[2];
- *cp++ = tl.cval[3];
- tl.lval = p->p_stats->p_start.tv_usec;
- *cp++ = tl.cval[0];
- *cp++ = tl.cval[1];
- *cp++ = tl.cval[2];
- *cp = tl.cval[3];
+ if (id == NULL) {
+ printf("NULL id\n");
+ bzero(cp, NFSV4CL_LOCKNAMELEN);
+ return;
+ }
+ if ((flags & F_POSIX) != 0) {
+ p = (struct proc *)id;
+ tl.lval = p->p_pid;
+ *cp++ = tl.cval[0];
+ *cp++ = tl.cval[1];
+ *cp++ = tl.cval[2];
+ *cp++ = tl.cval[3];
+ tl.lval = p->p_stats->p_start.tv_sec;
+ *cp++ = tl.cval[0];
+ *cp++ = tl.cval[1];
+ *cp++ = tl.cval[2];
+ *cp++ = tl.cval[3];
+ tl.lval = p->p_stats->p_start.tv_usec;
+ *cp++ = tl.cval[0];
+ *cp++ = tl.cval[1];
+ *cp++ = tl.cval[2];
+ *cp = tl.cval[3];
+ } else if ((flags & F_FLOCK) != 0) {
+ bcopy(&id, cp, sizeof(id));
+ bzero(&cp[sizeof(id)], NFSV4CL_LOCKNAMELEN - sizeof(id));
+ } else {
+ printf("nfscl_filllockowner: not F_POSIX or F_FLOCK\n");
+ bzero(cp, NFSV4CL_LOCKNAMELEN);
+ }
}
/*
@@ -943,6 +970,7 @@ nfscl_getmyip(struct nfsmount *nmp, int *isinet6p)
sad.sin_family = AF_INET;
sad.sin_len = sizeof (struct sockaddr_in);
sad.sin_addr.s_addr = sin->sin_addr.s_addr;
+ CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred));
rt = rtalloc1((struct sockaddr *)&sad, 0, 0UL);
if (rt != NULL) {
if (rt->rt_ifp != NULL &&
@@ -956,6 +984,7 @@ nfscl_getmyip(struct nfsmount *nmp, int *isinet6p)
}
RTFREE_LOCKED(rt);
}
+ CURVNET_RESTORE();
#ifdef INET6
} else if (nmp->nm_nam->sa_family == AF_INET6) {
struct sockaddr_in6 sad6, *sin6;
@@ -966,6 +995,7 @@ nfscl_getmyip(struct nfsmount *nmp, int *isinet6p)
sad6.sin6_family = AF_INET6;
sad6.sin6_len = sizeof (struct sockaddr_in6);
sad6.sin6_addr = sin6->sin6_addr;
+ CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred));
rt = rtalloc1((struct sockaddr *)&sad6, 0, 0UL);
if (rt != NULL) {
if (rt->rt_ifp != NULL &&
@@ -980,6 +1010,7 @@ nfscl_getmyip(struct nfsmount *nmp, int *isinet6p)
}
RTFREE_LOCKED(rt);
}
+ CURVNET_RESTORE();
#endif
}
return (retp);
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 7af0852..5d83d0b 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -68,7 +68,7 @@ static int nfsrpc_setattrrpc(vnode_t , struct vattr *, nfsv4stateid_t *,
struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *);
static int nfsrpc_readrpc(vnode_t , struct uio *, struct ucred *,
nfsv4stateid_t *, NFSPROC_T *, struct nfsvattr *, int *, void *);
-static int nfsrpc_writerpc(vnode_t , struct uio *, int *, u_char *,
+static int nfsrpc_writerpc(vnode_t , struct uio *, int *, int *,
struct ucred *, nfsv4stateid_t *, NFSPROC_T *, struct nfsvattr *, int *,
void *);
static int nfsrpc_createv23(vnode_t , char *, int, struct vattr *,
@@ -1369,7 +1369,7 @@ nfsmout:
* will then deadlock.
*/
APPLESTATIC int
-nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, u_char *verfp,
+nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit,
struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp,
void *stuff, int called_from_strategy)
{
@@ -1382,6 +1382,7 @@ nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, u_char *verfp,
nfsv4stateid_t stateid;
void *lckp;
+ *must_commit = 0;
if (nmp->nm_clp != NULL)
clidrev = nmp->nm_clp->nfsc_clientidrev;
newcred = cred;
@@ -1412,7 +1413,7 @@ nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, u_char *verfp,
if (nostateid)
error = 0;
else
- error = nfsrpc_writerpc(vp, uiop, iomode, verfp,
+ error = nfsrpc_writerpc(vp, uiop, iomode, must_commit,
newcred, &stateid, p, nap, attrflagp, stuff);
if (error == NFSERR_STALESTATEID)
nfscl_initiate_recovery(nmp->nm_clp);
@@ -1447,7 +1448,7 @@ nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, u_char *verfp,
*/
static int
nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode,
- u_char *verfp, struct ucred *cred, nfsv4stateid_t *stateidp,
+ int *must_commit, struct ucred *cred, nfsv4stateid_t *stateidp,
NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff)
{
u_int32_t *tl;
@@ -1585,14 +1586,16 @@ nfsrpc_writerpc(vnode_t vp, struct uio *uiop, int *iomode,
else if (committed == NFSWRITE_DATASYNC &&
commit == NFSWRITE_UNSTABLE)
committed = commit;
- if (verfp != NULL)
- NFSBCOPY((caddr_t)tl, verfp, NFSX_VERF);
NFSLOCKMNT(nmp);
if (!NFSHASWRITEVERF(nmp)) {
NFSBCOPY((caddr_t)tl,
(caddr_t)&nmp->nm_verf[0],
NFSX_VERF);
NFSSETWRITEVERF(nmp);
+ } else if (NFSBCMP(tl, nmp->nm_verf,
+ NFSX_VERF)) {
+ *must_commit = 1;
+ NFSBCOPY(tl, nmp->nm_verf, NFSX_VERF);
}
NFSUNLOCKMNT(nmp);
}
@@ -3456,7 +3459,7 @@ nfsmout:
*/
APPLESTATIC int
nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
- int reclaim, struct ucred *cred, NFSPROC_T *p)
+ int reclaim, struct ucred *cred, NFSPROC_T *p, void *id, int flags)
{
struct nfscllockowner *lp;
struct nfsclclient *clp;
@@ -3508,11 +3511,11 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
error = nfscl_getcl(vp, cred, p, &clp);
if (error)
return (error);
- error = nfscl_lockt(vp, clp, off, len, fl, p);
+ error = nfscl_lockt(vp, clp, off, len, fl, p, id, flags);
if (!error) {
clidrev = clp->nfsc_clientidrev;
error = nfsrpc_lockt(nd, vp, clp, off, len, fl, cred,
- p);
+ p, id, flags);
} else if (error == -1) {
error = 0;
}
@@ -3527,7 +3530,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
return (error);
do {
error = nfscl_relbytelock(vp, off, len, cred, p, callcnt,
- clp, &lp, &dorpc);
+ clp, id, flags, &lp, &dorpc);
/*
* If it returns a NULL lp, we're done.
*/
@@ -3535,7 +3538,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
if (callcnt == 0)
nfscl_clientrelease(clp);
else
- nfscl_releasealllocks(clp, vp, p);
+ nfscl_releasealllocks(clp, vp, p, id, flags);
return (error);
}
if (nmp->nm_clp != NULL)
@@ -3569,10 +3572,10 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
}
callcnt++;
} while (error == 0 && nd->nd_repstat == 0);
- nfscl_releasealllocks(clp, vp, p);
+ nfscl_releasealllocks(clp, vp, p, id, flags);
} else if (op == F_SETLK) {
error = nfscl_getbytelock(vp, off, len, fl->l_type, cred, p,
- NULL, 0, NULL, NULL, &lp, &newone, &donelocally);
+ NULL, 0, id, flags, NULL, NULL, &lp, &newone, &donelocally);
if (error || donelocally) {
return (error);
}
@@ -3622,7 +3625,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl,
APPLESTATIC int
nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp,
struct nfsclclient *clp, u_int64_t off, u_int64_t len, struct flock *fl,
- struct ucred *cred, NFSPROC_T *p)
+ struct ucred *cred, NFSPROC_T *p, void *id, int flags)
{
u_int32_t *tl;
int error, type, size;
@@ -3640,7 +3643,7 @@ nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp,
tl += 2;
*tl++ = clp->nfsc_clientid.lval[0];
*tl = clp->nfsc_clientid.lval[1];
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(id, own, flags);
(void) nfsm_strtom(nd, own, NFSV4CL_LOCKNAMELEN);
error = nfscl_request(nd, vp, p, cred, NULL);
if (error)
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 8e9aa6a..aa81437 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -226,7 +226,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg,
* If none found, add the new one or return error, depending upon
* "create".
*/
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(p->td_proc, own, F_POSIX);
NFSLOCKCLSTATE();
dp = NULL;
/* First check the delegation list */
@@ -521,7 +521,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode,
* If p != NULL, we want to search the parentage tree
* for a matching OpenOwner and use that.
*/
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(p->td_proc, own, F_POSIX);
error = nfscl_getopen(&clp->nfsc_owner, nfhp, fhlen, NULL, p,
mode, NULL, &op);
if (error == 0) {
@@ -596,7 +596,7 @@ nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nfhp, int fhlen,
op = NULL;
while (op == NULL && (nproc != NULL || rown != NULL)) {
if (nproc != NULL) {
- nfscl_filllockowner(nproc, own);
+ nfscl_filllockowner(nproc->td_proc, own, F_POSIX);
ownp = own;
} else {
ownp = rown;
@@ -687,11 +687,14 @@ nfscl_getcl(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
struct nfsclclient *clp;
struct nfsclclient *newclp = NULL;
struct nfscllockowner *lp, *nlp;
- struct nfsmount *nmp = VFSTONFS(vnode_mount(vp));
+ struct mount *mp;
+ struct nfsmount *nmp;
char uuid[HOSTUUIDLEN];
int igotlock = 0, error, trystalecnt, clidinusedelay, i;
u_int16_t idlen = 0;
+ mp = vnode_mount(vp);
+ nmp = VFSTONFS(mp);
if (cred != NULL) {
getcredhostuuid(cred, uuid, sizeof uuid);
idlen = strlen(uuid);
@@ -704,6 +707,17 @@ nfscl_getcl(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
M_WAITOK);
}
NFSLOCKCLSTATE();
+ /*
+ * If a forced dismount is already in progress, don't
+ * allocate a new clientid and get out now. For the case where
+ * clp != NULL, this is a harmless optimization.
+ */
+ if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
+ NFSUNLOCKCLSTATE();
+ if (newclp != NULL)
+ free(newclp, M_NFSCLCLIENT);
+ return (EBADF);
+ }
clp = nmp->nm_clp;
if (clp == NULL) {
if (newclp == NULL) {
@@ -736,9 +750,21 @@ nfscl_getcl(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
NFSLOCKCLSTATE();
while ((clp->nfsc_flags & NFSCLFLAGS_HASCLIENTID) == 0 && !igotlock)
igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL,
- NFSCLSTATEMUTEXPTR);
+ NFSCLSTATEMUTEXPTR, mp);
if (!igotlock)
- nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR);
+ nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, mp);
+ if (igotlock == 0 && (mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
+ /*
+ * Both nfsv4_lock() and nfsv4_getref() know to check
+ * for MNTK_UNMOUNTF and return without sleeping to
+ * wait for the exclusive lock to be released, since it
+ * might be held by nfscl_umount() and we need to get out
+ * now for that case and not wait until nfscl_umount()
+ * releases it.
+ */
+ NFSUNLOCKCLSTATE();
+ return (EBADF);
+ }
NFSUNLOCKCLSTATE();
/*
@@ -855,7 +881,7 @@ nfscl_clientrelease(struct nfsclclient *clp)
APPLESTATIC int
nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
short type, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *rclp,
- int recovery, u_int8_t *rownp, u_int8_t *ropenownp,
+ int recovery, void *id, int flags, u_int8_t *rownp, u_int8_t *ropenownp,
struct nfscllockowner **lpp, int *newonep, int *donelocallyp)
{
struct nfscllockowner *lp;
@@ -916,7 +942,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
if (recovery) {
ownp = rownp;
} else {
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(id, own, flags);
ownp = own;
}
if (!recovery) {
@@ -1053,7 +1079,8 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
APPLESTATIC int
nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
__unused struct ucred *cred, NFSPROC_T *p, int callcnt,
- struct nfsclclient *clp, struct nfscllockowner **lpp, int *dorpcp)
+ struct nfsclclient *clp, void *id, int flags,
+ struct nfscllockowner **lpp, int *dorpcp)
{
struct nfscllockowner *lp;
struct nfsclowner *owp;
@@ -1090,7 +1117,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
sizeof (struct nfscllock), M_NFSCLLOCK, M_WAITOK);
*other_lop = *nlop;
}
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(id, own, flags);
dp = NULL;
NFSLOCKCLSTATE();
if (callcnt == 0)
@@ -1162,7 +1189,8 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len,
* Release all lockowners marked in progess for this process and file.
*/
APPLESTATIC void
-nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p)
+nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p,
+ void *id, int flags)
{
struct nfsclowner *owp;
struct nfsclopen *op;
@@ -1171,7 +1199,7 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p)
u_int8_t own[NFSV4CL_LOCKNAMELEN];
np = VTONFS(vp);
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(id, own, flags);
NFSLOCKCLSTATE();
LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) {
LIST_FOREACH(op, &owp->nfsow_open, nfso_list) {
@@ -1200,7 +1228,7 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p)
*/
APPLESTATIC int
nfscl_checkwritelocked(vnode_t vp, struct flock *fl,
- struct ucred *cred, NFSPROC_T *p)
+ struct ucred *cred, NFSPROC_T *p, void *id, int flags)
{
struct nfsclowner *owp;
struct nfscllockowner *lp;
@@ -1240,7 +1268,7 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl,
error = nfscl_getcl(vp, cred, p, &clp);
if (error)
return (1);
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(id, own, flags);
NFSLOCKCLSTATE();
/*
@@ -1615,7 +1643,7 @@ nfscl_cleanup(NFSPROC_T *p)
if (!nfscl_inited)
return;
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(p->td_proc, own, F_POSIX);
NFSLOCKCLSTATE();
/*
@@ -1713,6 +1741,7 @@ nfscl_cleanupkext(struct nfsclclient *clp)
}
#endif /* APPLEKEXT || __FreeBSD__ */
+static int fake_global; /* Used to force visibility of MNTK_UNMOUNTF */
/*
* Called from nfs umount to free up the clientid.
*/
@@ -1723,6 +1752,33 @@ nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p)
struct ucred *cred;
int igotlock;
+ /*
+ * For the case that matters, this is the thread that set
+ * MNTK_UNMOUNTF, so it will see it set. The code that follows is
+ * done to ensure that any thread executing nfscl_getcl() after
+ * this time, will see MNTK_UNMOUNTF set. nfscl_getcl() uses the
+ * mutex for NFSLOCKCLSTATE(), so it is "m" for the following
+ * explanation, courtesy of Alan Cox.
+ * What follows is a snippet from Alan Cox's email at:
+ * http://docs.FreeBSD.org/cgi/
+ * mid.cgi?BANLkTikR3d65zPHo9==08ZfJ2vmqZucEvw
+ *
+ * 1. Set MNTK_UNMOUNTF
+ * 2. Acquire a standard FreeBSD mutex "m".
+ * 3. Update some data structures.
+ * 4. Release mutex "m".
+ *
+ * Then, other threads that acquire "m" after step 4 has occurred will
+ * see MNTK_UNMOUNTF as set. But, other threads that beat thread X to
+ * step 2 may or may not see MNTK_UNMOUNTF as set.
+ */
+ NFSLOCKCLSTATE();
+ if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
+ fake_global++;
+ NFSUNLOCKCLSTATE();
+ NFSLOCKCLSTATE();
+ }
+
clp = nmp->nm_clp;
if (clp != NULL) {
if ((clp->nfsc_flags & NFSCLFLAGS_INITED) == 0)
@@ -1734,12 +1790,16 @@ nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p)
*/
clp->nfsc_flags |= NFSCLFLAGS_UMOUNT;
while (clp->nfsc_flags & NFSCLFLAGS_HASTHREAD)
- (void) tsleep((caddr_t)clp, PWAIT, "nfsclumnt", hz);
+ (void)mtx_sleep(clp, NFSCLSTATEMUTEXPTR, PWAIT,
+ "nfsclumnt", hz);
- NFSLOCKCLSTATE();
+ /*
+ * Now, get the exclusive lock on the client state, so
+ * that no uses of the state are still in progress.
+ */
do {
igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL,
- NFSCLSTATEMUTEXPTR);
+ NFSCLSTATEMUTEXPTR, NULL);
} while (!igotlock);
NFSUNLOCKCLSTATE();
@@ -1756,8 +1816,8 @@ nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p)
nmp->nm_clp = NULL;
NFSFREECRED(cred);
FREE((caddr_t)clp, M_NFSCLCLIENT);
- }
-
+ } else
+ NFSUNLOCKCLSTATE();
}
/*
@@ -1790,7 +1850,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *cred, NFSPROC_T *p)
clp->nfsc_flags |= NFSCLFLAGS_RECVRINPROG;
do {
igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL,
- NFSCLSTATEMUTEXPTR);
+ NFSCLSTATEMUTEXPTR, NULL);
} while (!igotlock);
NFSUNLOCKCLSTATE();
@@ -2105,7 +2165,7 @@ nfscl_hasexpired(struct nfsclclient *clp, u_int32_t clidrev, NFSPROC_T *p)
clp->nfsc_flags |= NFSCLFLAGS_EXPIREIT;
do {
igotlock = nfsv4_lock(&clp->nfsc_lock, 1, NULL,
- NFSCLSTATEMUTEXPTR);
+ NFSCLSTATEMUTEXPTR, NULL);
} while (!igotlock && (clp->nfsc_flags & NFSCLFLAGS_EXPIREIT));
if ((clp->nfsc_flags & NFSCLFLAGS_EXPIREIT) == 0) {
if (igotlock)
@@ -2464,7 +2524,7 @@ tryagain:
}
while (!igotlock) {
igotlock = nfsv4_lock(&clp->nfsc_lock, 1,
- &islept, NFSCLSTATEMUTEXPTR);
+ &islept, NFSCLSTATEMUTEXPTR, NULL);
if (islept)
goto tryagain;
}
@@ -2556,14 +2616,18 @@ tryagain:
}
#endif /* APPLEKEXT || __FreeBSD__ */
+ NFSLOCKCLSTATE();
if ((clp->nfsc_flags & NFSCLFLAGS_RECOVER) == 0)
- (void) tsleep((caddr_t)clp, PWAIT, "nfscl", hz);
+ (void)mtx_sleep(clp, NFSCLSTATEMUTEXPTR, PWAIT, "nfscl",
+ hz);
if (clp->nfsc_flags & NFSCLFLAGS_UMOUNT) {
- NFSFREECRED(cred);
clp->nfsc_flags &= ~NFSCLFLAGS_HASTHREAD;
+ NFSUNLOCKCLSTATE();
+ NFSFREECRED(cred);
wakeup((caddr_t)clp);
return;
}
+ NFSUNLOCKCLSTATE();
}
}
@@ -3260,7 +3324,7 @@ nfscl_checkconflict(struct nfscllockownerhead *lhp, struct nfscllock *nlop,
*/
APPLESTATIC int
nfscl_lockt(vnode_t vp, struct nfsclclient *clp, u_int64_t off,
- u_int64_t len, struct flock *fl, NFSPROC_T *p)
+ u_int64_t len, struct flock *fl, NFSPROC_T *p, void *id, int flags)
{
struct nfscllock *lop, nlck;
struct nfscldeleg *dp;
@@ -3278,7 +3342,7 @@ nfscl_lockt(vnode_t vp, struct nfsclclient *clp, u_int64_t off,
return (NFSERR_INVAL);
}
np = VTONFS(vp);
- nfscl_filllockowner(p, own);
+ nfscl_filllockowner(id, own, flags);
NFSLOCKCLSTATE();
dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len);
error = nfscl_localconflict(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len,
@@ -3553,7 +3617,7 @@ nfscl_relock(vnode_t vp, struct nfsclclient *clp, struct nfsmount *nmp,
off = lop->nfslo_first;
len = lop->nfslo_end - lop->nfslo_first;
error = nfscl_getbytelock(vp, off, len, lop->nfslo_type, cred, p,
- clp, 1, lp->nfsl_owner, lp->nfsl_openowner, &nlp, &newone,
+ clp, 1, NULL, 0, lp->nfsl_owner, lp->nfsl_openowner, &nlp, &newone,
&donelocally);
if (error || donelocally)
return (error);
@@ -3864,7 +3928,7 @@ nfscl_removedeleg(vnode_t vp, NFSPROC_T *p, nfsv4stateid_t *stp)
islept = 0;
while (!igotlock) {
igotlock = nfsv4_lock(&clp->nfsc_lock, 1,
- &islept, NFSCLSTATEMUTEXPTR);
+ &islept, NFSCLSTATEMUTEXPTR, NULL);
if (islept)
break;
}
@@ -3963,7 +4027,7 @@ nfscl_renamedeleg(vnode_t fvp, nfsv4stateid_t *fstp, int *gotfdp, vnode_t tvp,
islept = 0;
while (!igotlock) {
igotlock = nfsv4_lock(&clp->nfsc_lock, 1,
- &islept, NFSCLSTATEMUTEXPTR);
+ &islept, NFSCLSTATEMUTEXPTR, NULL);
if (islept)
break;
}
@@ -4043,7 +4107,7 @@ nfscl_getref(struct nfsmount *nmp)
NFSUNLOCKCLSTATE();
return (0);
}
- nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR);
+ nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, NULL);
NFSUNLOCKCLSTATE();
return (1);
}
diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c
index 0c05631..214dfb7 100644
--- a/sys/fs/nfsclient/nfs_clsubs.c
+++ b/sys/fs/nfsclient/nfs_clsubs.c
@@ -35,6 +35,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_kdtrace.h"
+
/*
* These functions support the macros and help fiddle mbuf chains for
* the nfs op functions. They do things like create the rpc header and
@@ -68,6 +70,7 @@ __FBSDID("$FreeBSD$");
#include <fs/nfsclient/nfsnode.h>
#include <fs/nfsclient/nfsmount.h>
#include <fs/nfsclient/nfs.h>
+#include <fs/nfsclient/nfs_kdtrace.h>
#include <netinet/in.h>
@@ -238,6 +241,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
#ifdef NFS_ACDEBUG
mtx_unlock(&Giant); /* ncl_printf() */
#endif
+ KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
return( ENOENT);
}
newnfsstats.attrcache_hits++;
@@ -267,6 +271,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
#ifdef NFS_ACDEBUG
mtx_unlock(&Giant); /* ncl_printf() */
#endif
+ KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap);
return (0);
}
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index 84725dd..d962a54 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -1458,10 +1458,20 @@ nfs_sync(struct mount *mp, int waitfor)
td = curthread;
+ MNT_ILOCK(mp);
+ /*
+ * If a forced dismount is in progress, return from here so that
+ * the umount(2) syscall doesn't get stuck in VFS_SYNC() before
+ * calling VFS_UNMOUNT().
+ */
+ if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
+ MNT_IUNLOCK(mp);
+ return (EBADF);
+ }
+
/*
* Force stale buffer cache information to be flushed.
*/
- MNT_ILOCK(mp);
loop:
MNT_VNODE_FOREACH(vp, mp, mvp) {
VI_LOCK(vp);
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 1b08582..0a1d6a2 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
* vnode op calls for Sun NFS version 2, 3 and 4
*/
+#include "opt_kdtrace.h"
#include "opt_inet.h"
#include <sys/param.h>
@@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$");
#include <fs/nfsclient/nfsnode.h>
#include <fs/nfsclient/nfsmount.h>
#include <fs/nfsclient/nfs.h>
+#include <fs/nfsclient/nfs_kdtrace.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -77,6 +79,24 @@ __FBSDID("$FreeBSD$");
#include <nfs/nfs_lock.h>
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+
+dtrace_nfsclient_accesscache_flush_probe_func_t
+ dtrace_nfscl_accesscache_flush_done_probe;
+uint32_t nfscl_accesscache_flush_done_id;
+
+dtrace_nfsclient_accesscache_get_probe_func_t
+ dtrace_nfscl_accesscache_get_hit_probe,
+ dtrace_nfscl_accesscache_get_miss_probe;
+uint32_t nfscl_accesscache_get_hit_id;
+uint32_t nfscl_accesscache_get_miss_id;
+
+dtrace_nfsclient_accesscache_load_probe_func_t
+ dtrace_nfscl_accesscache_load_done_probe;
+uint32_t nfscl_accesscache_load_done_id;
+#endif /* !KDTRACE_HOOKS */
+
/* Defs */
#define TRUE 1
#define FALSE 0
@@ -298,9 +318,15 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct thread *td,
mtx_unlock(&np->n_mtx);
if (retmode != NULL)
*retmode = rmode;
+ KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, rmode, 0);
} else if (NFS_ISV4(vp)) {
error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
}
+#ifdef KDTRACE_HOOKS
+ if (error != 0)
+ KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, 0,
+ error);
+#endif
return (error);
}
@@ -397,6 +423,14 @@ nfs_access(struct vop_access_args *ap)
}
}
mtx_unlock(&np->n_mtx);
+#ifdef KDTRACE_HOOKS
+ if (gotahit != 0)
+ KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp,
+ ap->a_cred->cr_uid, mode);
+ else
+ KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp,
+ ap->a_cred->cr_uid, mode);
+#endif
if (gotahit == 0) {
/*
* Either a no, or a don't know. Go to the wire.
@@ -507,6 +541,7 @@ nfs_open(struct vop_open_args *ap)
}
mtx_lock(&np->n_mtx);
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
if (vp->v_type == VDIR)
np->n_direofoffset = 0;
mtx_unlock(&np->n_mtx);
@@ -692,8 +727,10 @@ nfs_close(struct vop_close_args *ap)
* is the cause of some caching/coherency issue that might
* crop up.)
*/
- if (VFSTONFS(vp->v_mount)->nm_negnametimeo == 0)
+ if (VFSTONFS(vp->v_mount)->nm_negnametimeo == 0) {
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
+ }
if (np->n_flag & NWRITEERR) {
np->n_flag &= ~NWRITEERR;
error = np->n_error;
@@ -949,6 +986,7 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred,
np->n_accesscache[i].stamp = 0;
np->n_flag |= NDELEGMOD;
mtx_unlock(&np->n_mtx);
+ KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp);
}
error = nfsrpc_setattr(vp, vap, NULL, cred, td, &nfsva, &attrflag,
NULL);
@@ -1030,6 +1068,7 @@ nfs_lookup(struct vop_lookup_args *ap)
!(newnp->n_flag & NMODIFIED)) {
mtx_lock(&newnp->n_mtx);
newnp->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp);
mtx_unlock(&newnp->n_mtx);
}
if (nfscl_nodeleg(newvp, 0) == 0 ||
@@ -1233,6 +1272,7 @@ nfs_lookup(struct vop_lookup_args *ap)
*/
mtx_lock(&np->n_mtx);
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp);
mtx_unlock(&np->n_mtx);
}
}
@@ -1332,19 +1372,9 @@ ncl_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
{
struct nfsvattr nfsva;
int error = 0, attrflag, ret;
- u_char verf[NFSX_VERF];
- struct nfsmount *nmp = VFSTONFS(vp->v_mount);
- *must_commit = 0;
- error = nfsrpc_write(vp, uiop, iomode, verf, cred,
+ error = nfsrpc_write(vp, uiop, iomode, must_commit, cred,
uiop->uio_td, &nfsva, &attrflag, NULL, called_from_strategy);
- NFSLOCKMNT(nmp);
- if (!error && NFSHASWRITEVERF(nmp) &&
- NFSBCMP(verf, nmp->nm_verf, NFSX_VERF)) {
- *must_commit = 1;
- NFSBCOPY(verf, nmp->nm_verf, NFSX_VERF);
- }
- NFSUNLOCKMNT(nmp);
if (attrflag) {
if (VTONFS(vp)->n_flag & ND_NFSV4)
ret = nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 1,
@@ -1422,8 +1452,10 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
dnp = VTONFS(dvp);
mtx_lock(&dnp->n_mtx);
dnp->n_flag |= NMODIFIED;
- if (!dattrflag)
+ if (!dattrflag) {
dnp->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+ }
mtx_unlock(&dnp->n_mtx);
return (error);
}
@@ -1576,8 +1608,10 @@ again:
}
mtx_lock(&dnp->n_mtx);
dnp->n_flag |= NMODIFIED;
- if (!dattrflag)
+ if (!dattrflag) {
dnp->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+ }
mtx_unlock(&dnp->n_mtx);
return (error);
}
@@ -1640,6 +1674,7 @@ nfs_remove(struct vop_remove_args *ap)
mtx_lock(&np->n_mtx);
np->n_attrstamp = 0;
mtx_unlock(&np->n_mtx);
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
return (error);
}
@@ -1688,8 +1723,10 @@ nfs_removerpc(struct vnode *dvp, struct vnode *vp, char *name,
(void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1);
mtx_lock(&dnp->n_mtx);
dnp->n_flag |= NMODIFIED;
- if (!dattrflag)
+ if (!dattrflag) {
dnp->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
+ }
mtx_unlock(&dnp->n_mtx);
if (error && NFS_ISV4(dvp))
error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
@@ -1867,6 +1904,7 @@ nfs_renamerpc(struct vnode *fdvp, struct vnode *fvp, char *fnameptr,
} else {
fdnp->n_attrstamp = 0;
mtx_unlock(&fdnp->n_mtx);
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(fdvp);
}
mtx_lock(&tdnp->n_mtx);
tdnp->n_flag |= NMODIFIED;
@@ -1876,6 +1914,7 @@ nfs_renamerpc(struct vnode *fdvp, struct vnode *fvp, char *fnameptr,
} else {
tdnp->n_attrstamp = 0;
mtx_unlock(&tdnp->n_mtx);
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(tdvp);
}
if (error && NFS_ISV4(fdvp))
error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0);
@@ -1918,6 +1957,7 @@ nfs_link(struct vop_link_args *ap)
} else {
tdnp->n_attrstamp = 0;
mtx_unlock(&tdnp->n_mtx);
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(tdvp);
}
if (attrflag)
(void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1);
@@ -1926,6 +1966,7 @@ nfs_link(struct vop_link_args *ap)
mtx_lock(&np->n_mtx);
np->n_attrstamp = 0;
mtx_unlock(&np->n_mtx);
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
}
/*
* If negative lookup caching is enabled, I might as well
@@ -2012,6 +2053,7 @@ nfs_symlink(struct vop_symlink_args *ap)
} else {
dnp->n_attrstamp = 0;
mtx_unlock(&dnp->n_mtx);
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
}
return (error);
}
@@ -2047,6 +2089,7 @@ nfs_mkdir(struct vop_mkdir_args *ap)
} else {
dnp->n_attrstamp = 0;
mtx_unlock(&dnp->n_mtx);
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
}
if (nfhp) {
ret = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, cnp->cn_thread,
@@ -2115,6 +2158,7 @@ nfs_rmdir(struct vop_rmdir_args *ap)
} else {
dnp->n_attrstamp = 0;
mtx_unlock(&dnp->n_mtx);
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp);
}
cache_purge(dvp);
@@ -2480,10 +2524,12 @@ ncl_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred,
error = nfsrpc_commit(vp, offset, cnt, cred, td, verf, &nfsva,
&attrflag, NULL);
if (!error) {
+ mtx_lock(&nmp->nm_mtx);
if (NFSBCMP((caddr_t)nmp->nm_verf, verf, NFSX_VERF)) {
NFSBCOPY(verf, (caddr_t)nmp->nm_verf, NFSX_VERF);
error = NFSERR_STALEWRITEVERF;
}
+ mtx_unlock(&nmp->nm_mtx);
if (!error && attrflag)
(void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL,
0, 1);
@@ -2892,8 +2938,11 @@ nfs_advlock(struct vop_advlock_args *ap)
int ret, error = EOPNOTSUPP;
u_quad_t size;
- if (NFS_ISV4(vp) && (ap->a_flags & F_POSIX)) {
- cred = p->p_ucred;
+ if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) {
+ if ((ap->a_flags & F_POSIX) != 0)
+ cred = p->p_ucred;
+ else
+ cred = td->td_ucred;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
if (vp->v_iflag & VI_DOOMED) {
VOP_UNLOCK(vp, 0);
@@ -2906,7 +2955,8 @@ nfs_advlock(struct vop_advlock_args *ap)
* RFC3530 Sec. 9.3.2.
*/
if (ap->a_op == F_UNLCK &&
- nfscl_checkwritelocked(vp, ap->a_fl, cred, td))
+ nfscl_checkwritelocked(vp, ap->a_fl, cred, td, ap->a_id,
+ ap->a_flags))
(void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0);
/*
@@ -2915,7 +2965,7 @@ nfs_advlock(struct vop_advlock_args *ap)
*/
do {
ret = nfsrpc_advlock(vp, np->n_size, ap->a_op,
- ap->a_fl, 0, cred, td);
+ ap->a_fl, 0, cred, td, ap->a_id, ap->a_flags);
if (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) &&
ap->a_op == F_SETLK) {
VOP_UNLOCK(vp, 0);
@@ -2950,12 +3000,14 @@ nfs_advlock(struct vop_advlock_args *ap)
if (ap->a_op == F_SETLK) {
if ((np->n_flag & NMODIFIED) == 0) {
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
ret = VOP_GETATTR(vp, &va, cred);
}
if ((np->n_flag & NMODIFIED) || ret ||
np->n_change != va.va_filerev) {
(void) ncl_vinvalbuf(vp, V_SAVE, td, 1);
np->n_attrstamp = 0;
+ KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
ret = VOP_GETATTR(vp, &va, cred);
if (!ret) {
np->n_mtime = va.va_mtime;
@@ -3301,7 +3353,13 @@ nfs_pathconf(struct vop_pathconf_args *ap)
struct thread *td = curthread;
int attrflag, error;
- if (NFS_ISV34(vp)) {
+ if (NFS_ISV4(vp) || (NFS_ISV3(vp) && (ap->a_name == _PC_LINK_MAX ||
+ ap->a_name == _PC_NAME_MAX || ap->a_name == _PC_CHOWN_RESTRICTED ||
+ ap->a_name == _PC_NO_TRUNC))) {
+ /*
+ * Since only the above 4 a_names are returned by the NFSv3
+ * Pathconf RPC, there is no point in doing it for others.
+ */
error = nfsrpc_pathconf(vp, &pc, td->td_ucred, td, &nfsva,
&attrflag, NULL);
if (attrflag != 0)
@@ -3310,7 +3368,10 @@ nfs_pathconf(struct vop_pathconf_args *ap)
if (error != 0)
return (error);
} else {
- /* For NFSv2, just fake them. */
+ /*
+ * For NFSv2 (or NFSv3 when not one of the above 4 a_names),
+ * just fake them.
+ */
pc.pc_linkmax = LINK_MAX;
pc.pc_namemax = NFS_MAXNAMLEN;
pc.pc_notrunc = 1;
diff --git a/sys/fs/nfsclient/nfs_kdtrace.h b/sys/fs/nfsclient/nfs_kdtrace.h
new file mode 100644
index 0000000..f8f143f
--- /dev/null
+++ b/sys/fs/nfsclient/nfs_kdtrace.h
@@ -0,0 +1,120 @@
+/*-
+ * Copyright (c) 2009 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * This software was developed at the University of Cambridge Computer
+ * Laboratory with support from a grant from Google, Inc.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _NFSCL_NFS_KDTRACE_H_
+#define _NFSCL_NFS_KDTRACE_H_
+
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+
+/*
+ * Definitions for NFS access cache probes.
+ */
+extern uint32_t nfscl_accesscache_flush_done_id;
+extern uint32_t nfscl_accesscache_get_hit_id;
+extern uint32_t nfscl_accesscache_get_miss_id;
+extern uint32_t nfscl_accesscache_load_done_id;
+
+#define KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp) do { \
+ if (dtrace_nfscl_accesscache_flush_done_probe != NULL) \
+ (dtrace_nfscl_accesscache_flush_done_probe)( \
+ nfscl_accesscache_flush_done_id, (vp)); \
+} while (0)
+
+#define KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, uid, mode) do { \
+ if (dtrace_nfscl_accesscache_get_hit_probe != NULL) \
+ (dtrace_nfscl_accesscache_get_hit_probe)( \
+ nfscl_accesscache_get_hit_id, (vp), (uid), \
+ (mode)); \
+} while (0)
+
+#define KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp, uid, mode) do { \
+ if (dtrace_nfscl_accesscache_get_miss_probe != NULL) \
+ (dtrace_nfscl_accesscache_get_miss_probe)( \
+ nfscl_accesscache_get_miss_id, (vp), (uid), \
+ (mode)); \
+} while (0)
+
+#define KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, uid, rmode, error) do { \
+ if (dtrace_nfscl_accesscache_load_done_probe != NULL) \
+ (dtrace_nfscl_accesscache_load_done_probe)( \
+ nfscl_accesscache_load_done_id, (vp), (uid), \
+ (rmode), (error)); \
+} while (0)
+
+/*
+ * Definitions for NFS attribute cache probes.
+ */
+extern uint32_t nfscl_attrcache_flush_done_id;
+extern uint32_t nfscl_attrcache_get_hit_id;
+extern uint32_t nfscl_attrcache_get_miss_id;
+extern uint32_t nfscl_attrcache_load_done_id;
+
+#define KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp) do { \
+ if (dtrace_nfscl_attrcache_flush_done_probe != NULL) \
+ (dtrace_nfscl_attrcache_flush_done_probe)( \
+ nfscl_attrcache_flush_done_id, (vp)); \
+} while (0)
+
+#define KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap) do { \
+ if (dtrace_nfscl_attrcache_get_hit_probe != NULL) \
+ (dtrace_nfscl_attrcache_get_hit_probe)( \
+ nfscl_attrcache_get_hit_id, (vp), (vap)); \
+} while (0)
+
+#define KDTRACE_NFS_ATTRCACHE_GET_MISS(vp) do { \
+ if (dtrace_nfscl_attrcache_get_miss_probe != NULL) \
+ (dtrace_nfscl_attrcache_get_miss_probe)( \
+ nfscl_attrcache_get_miss_id, (vp)); \
+} while (0)
+
+#define KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, error) do { \
+ if (dtrace_nfscl_attrcache_load_done_probe != NULL) \
+ (dtrace_nfscl_attrcache_load_done_probe)( \
+ nfscl_attrcache_load_done_id, (vp), (vap), \
+ (error)); \
+} while (0)
+
+#else /* !KDTRACE_HOOKS */
+
+#define KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp)
+#define KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, uid, mode)
+#define KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp, uid, mode)
+#define KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, uid, rmode, error)
+
+#define KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp)
+#define KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap)
+#define KDTRACE_NFS_ATTRCACHE_GET_MISS(vp)
+#define KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, error)
+
+#endif /* KDTRACE_HOOKS */
+
+#endif /* !_NFSCL_NFS_KDTRACE_H_ */
diff --git a/sys/fs/nfsserver/nfs_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c
index bcffd6c..fc513a3 100644
--- a/sys/fs/nfsserver/nfs_nfsdcache.c
+++ b/sys/fs/nfsserver/nfs_nfsdcache.c
@@ -405,6 +405,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so)
{
struct nfsrvcache *rp;
struct nfsrvcache *retrp = NULL;
+ mbuf_t m;
rp = nd->nd_rp;
if (!rp)
@@ -457,9 +458,9 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so)
}
if ((nd->nd_flag & ND_NFSV2) &&
nfsv2_repstat[newnfsv2_procid[nd->nd_procnum]]) {
- NFSUNLOCKCACHE();
rp->rc_status = nd->nd_repstat;
rp->rc_flag |= RC_REPSTATUS;
+ NFSUNLOCKCACHE();
} else {
if (!(rp->rc_flag & RC_UDP)) {
nfsrc_tcpsavedreplies++;
@@ -469,9 +470,11 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so)
nfsrc_tcpsavedreplies;
}
NFSUNLOCKCACHE();
- rp->rc_reply = m_copym(nd->nd_mreq, 0, M_COPYALL,
- M_WAIT);
+ m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAIT);
+ NFSLOCKCACHE();
+ rp->rc_reply = m;
rp->rc_flag |= RC_REPMBUF;
+ NFSUNLOCKCACHE();
}
if (rp->rc_flag & RC_UDP) {
rp->rc_timestamp = NFSD_MONOSEC +
@@ -518,6 +521,7 @@ nfsrvd_delcache(struct nfsrvcache *rp)
APPLESTATIC void
nfsrvd_sentcache(struct nfsrvcache *rp, struct socket *so, int err)
{
+ tcp_seq tmp_seq;
if (!(rp->rc_flag & RC_LOCKED))
panic("nfsrvd_sentcache not locked");
@@ -526,8 +530,12 @@ nfsrvd_sentcache(struct nfsrvcache *rp, struct socket *so, int err)
so->so_proto->pr_domain->dom_family != AF_INET6) ||
so->so_proto->pr_protocol != IPPROTO_TCP)
panic("nfs sent cache");
- if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq))
+ if (nfsrv_getsockseqnum(so, &tmp_seq)) {
+ NFSLOCKCACHE();
+ rp->rc_tcpseq = tmp_seq;
rp->rc_flag |= RC_TCPSEQ;
+ NFSUNLOCKCACHE();
+ }
}
nfsrc_unlock(rp);
}
@@ -687,8 +695,11 @@ nfsrc_lock(struct nfsrvcache *rp)
static void
nfsrc_unlock(struct nfsrvcache *rp)
{
+
+ NFSLOCKCACHE();
rp->rc_flag &= ~RC_LOCKED;
nfsrc_wanted(rp);
+ NFSUNLOCKCACHE();
}
/*
diff --git a/sys/fs/nfsserver/nfs_nfsdkrpc.c b/sys/fs/nfsserver/nfs_nfsdkrpc.c
index 8ce70fa..2484919 100644
--- a/sys/fs/nfsserver/nfs_nfsdkrpc.c
+++ b/sys/fs/nfsserver/nfs_nfsdkrpc.c
@@ -386,18 +386,14 @@ nfsrvd_addsock(struct file *fp)
int
nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
{
-#ifdef KGSSAPI
char principal[MAXHOSTNAMELEN + 5];
int error;
bool_t ret2, ret3, ret4;
-#endif
-#ifdef KGSSAPI
error = copyinstr(args->principal, principal, sizeof (principal),
NULL);
if (error)
return (error);
-#endif
/*
* Only the first nfsd actually does any work. The RPC code
@@ -412,38 +408,29 @@ nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
NFSD_UNLOCK();
-#ifdef KGSSAPI
/* An empty string implies AUTH_SYS only. */
if (principal[0] != '\0') {
- ret2 = rpc_gss_set_svc_name(principal, "kerberosv5",
- GSS_C_INDEFINITE, NFS_PROG, NFS_VER2);
- ret3 = rpc_gss_set_svc_name(principal, "kerberosv5",
- GSS_C_INDEFINITE, NFS_PROG, NFS_VER3);
- ret4 = rpc_gss_set_svc_name(principal, "kerberosv5",
- GSS_C_INDEFINITE, NFS_PROG, NFS_VER4);
-
- if (!ret2 || !ret3 || !ret4) {
- NFSD_LOCK();
- newnfs_numnfsd--;
- nfsrvd_init(1);
- NFSD_UNLOCK();
- return (EAUTH);
- }
+ ret2 = rpc_gss_set_svc_name_call(principal,
+ "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2);
+ ret3 = rpc_gss_set_svc_name_call(principal,
+ "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER3);
+ ret4 = rpc_gss_set_svc_name_call(principal,
+ "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER4);
+
+ if (!ret2 || !ret3 || !ret4)
+ printf("nfsd: can't register svc name\n");
}
-#endif
nfsrvd_pool->sp_minthreads = args->minthreads;
nfsrvd_pool->sp_maxthreads = args->maxthreads;
svc_run(nfsrvd_pool);
-#ifdef KGSSAPI
if (principal[0] != '\0') {
- rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2);
- rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3);
- rpc_gss_clear_svc_name(NFS_PROG, NFS_VER4);
+ rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2);
+ rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3);
+ rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4);
}
-#endif
NFSD_LOCK();
newnfs_numnfsd--;
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index d62be99..5b96729 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -2592,6 +2592,36 @@ nfsvno_pathconf(struct vnode *vp, int flag, register_t *retf,
int error;
error = VOP_PATHCONF(vp, flag, retf);
+ if (error == EOPNOTSUPP || error == EINVAL) {
+ /*
+ * Some file systems return EINVAL for name arguments not
+ * supported and some return EOPNOTSUPP for this case.
+ * So the NFSv3 Pathconf RPC doesn't fail for these cases,
+ * just fake them.
+ */
+ switch (flag) {
+ case _PC_LINK_MAX:
+ *retf = LINK_MAX;
+ break;
+ case _PC_NAME_MAX:
+ *retf = NAME_MAX;
+ break;
+ case _PC_CHOWN_RESTRICTED:
+ *retf = 1;
+ break;
+ case _PC_NO_TRUNC:
+ *retf = 1;
+ break;
+ default:
+ /*
+ * Only happens if a _PC_xxx is added to the server,
+ * but this isn't updated.
+ */
+ *retf = 0;
+ printf("nfsrvd pathconf flag=%d not supp\n", flag);
+ };
+ error = 0;
+ }
return (error);
}
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
index ee55031..fc296c0 100644
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -454,7 +454,7 @@ nfsmout:
APPLESTATIC int
nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram,
vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p,
- __unused struct nfsexstuff *exp)
+ struct nfsexstuff *exp)
{
struct nameidata named;
vnode_t vp, dirp = NULL;
@@ -508,7 +508,15 @@ nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram,
vrele(named.ni_startdir);
nfsvno_relpathbuf(&named);
vp = named.ni_vp;
- nd->nd_repstat = nfsvno_getfh(vp, fhp, p);
+ if ((nd->nd_flag & ND_NFSV4) != 0 && !NFSVNO_EXPORTED(exp) &&
+ vp->v_type != VDIR && vp->v_type != VLNK)
+ /*
+ * Only allow lookup of VDIR and VLNK for traversal of
+ * non-exported volumes during NFSv4 mounting.
+ */
+ nd->nd_repstat = ENOENT;
+ if (nd->nd_repstat == 0)
+ nd->nd_repstat = nfsvno_getfh(vp, fhp, p);
if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat)
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
if (vpp != NULL && nd->nd_repstat == 0)
diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c
index eeecded..33be284 100644
--- a/sys/fs/nfsserver/nfs_nfsdsocket.c
+++ b/sys/fs/nfsserver/nfs_nfsdsocket.c
@@ -525,10 +525,10 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram,
NFSLOCKV4ROOTMUTEX();
if (nfsrv_stablefirst.nsf_flags & NFSNSF_NEEDLOCK)
igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL,
- NFSV4ROOTLOCKMUTEXPTR);
+ NFSV4ROOTLOCKMUTEXPTR, NULL);
else
igotlock = nfsv4_lock(&nfsv4rootfs_lock, 0, NULL,
- NFSV4ROOTLOCKMUTEXPTR);
+ NFSV4ROOTLOCKMUTEXPTR, NULL);
NFSUNLOCKV4ROOTMUTEX();
if (igotlock) {
/*
@@ -576,7 +576,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram,
*/
NFSLOCKV4ROOTMUTEX();
nfsv4_getref(&nfsv4rootfs_lock, NULL,
- NFSV4ROOTLOCKMUTEXPTR);
+ NFSV4ROOTLOCKMUTEXPTR, NULL);
NFSUNLOCKV4ROOTMUTEX();
}
@@ -786,6 +786,8 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram,
op != NFSV4OP_LOOKUP &&
op != NFSV4OP_GETATTR &&
op != NFSV4OP_GETFH &&
+ op != NFSV4OP_ACCESS &&
+ op != NFSV4OP_READLINK &&
op != NFSV4OP_SECINFO)
nd->nd_repstat = NFSERR_NOFILEHANDLE;
else if (nfsvno_testexp(nd, &vpnes) &&
diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c
index ab94f0e..fc84d72 100644
--- a/sys/fs/nfsserver/nfs_nfsdstate.c
+++ b/sys/fs/nfsserver/nfs_nfsdstate.c
@@ -169,7 +169,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp,
nfsv4_relref(&nfsv4rootfs_lock);
do {
igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL,
- NFSV4ROOTLOCKMUTEXPTR);
+ NFSV4ROOTLOCKMUTEXPTR, NULL);
} while (!igotlock);
NFSUNLOCKV4ROOTMUTEX();
@@ -419,7 +419,7 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp,
nfsv4_relref(&nfsv4rootfs_lock);
do {
igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL,
- NFSV4ROOTLOCKMUTEXPTR);
+ NFSV4ROOTLOCKMUTEXPTR, NULL);
} while (!igotlock);
NFSUNLOCKV4ROOTMUTEX();
} else if (opflags != CLOPS_RENEW) {
@@ -548,7 +548,7 @@ nfsrv_adminrevoke(struct nfsd_clid *revokep, NFSPROC_T *p)
NFSLOCKV4ROOTMUTEX();
do {
igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL,
- NFSV4ROOTLOCKMUTEXPTR);
+ NFSV4ROOTLOCKMUTEXPTR, NULL);
} while (!igotlock);
NFSUNLOCKV4ROOTMUTEX();
@@ -608,7 +608,7 @@ nfsrv_dumpclients(struct nfsd_dumpclients *dumpp, int maxcnt)
* exclusive lock cannot be acquired while dumping the clients.
*/
NFSLOCKV4ROOTMUTEX();
- nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR);
+ nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, NULL);
NFSUNLOCKV4ROOTMUTEX();
NFSLOCKSTATE();
/*
@@ -709,7 +709,7 @@ nfsrv_dumplocks(vnode_t vp, struct nfsd_dumplocks *ldumpp, int maxcnt,
* exclusive lock on it cannot be acquired while dumping the locks.
*/
NFSLOCKV4ROOTMUTEX();
- nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR);
+ nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, NULL);
NFSUNLOCKV4ROOTMUTEX();
NFSLOCKSTATE();
if (!ret)
@@ -4254,7 +4254,7 @@ nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, vnode_t vp,
nfsv4_relref(&nfsv4rootfs_lock);
do {
gotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL,
- NFSV4ROOTLOCKMUTEXPTR);
+ NFSV4ROOTLOCKMUTEXPTR, NULL);
} while (!gotlock);
NFSUNLOCKV4ROOTMUTEX();
*haslockp = 1;
@@ -4422,7 +4422,7 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p,
nfsv4_relref(&nfsv4rootfs_lock);
do {
gotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL,
- NFSV4ROOTLOCKMUTEXPTR);
+ NFSV4ROOTLOCKMUTEXPTR, NULL);
} while (!gotlock);
NFSUNLOCKV4ROOTMUTEX();
*haslockp = 1;
@@ -4616,7 +4616,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPROC_T *p)
* exclusive lock cannot be acquired by another thread.
*/
NFSLOCKV4ROOTMUTEX();
- nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR);
+ nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR, NULL);
NFSUNLOCKV4ROOTMUTEX();
/*
@@ -5179,7 +5179,7 @@ nfsrv_locklf(struct nfslockfile *lfp)
lfp->lf_usecount++;
do {
gotlock = nfsv4_lock(&lfp->lf_locallock_lck, 1, NULL,
- NFSSTATEMUTEXPTR);
+ NFSSTATEMUTEXPTR, NULL);
} while (gotlock == 0);
lfp->lf_usecount--;
}
diff --git a/sys/fs/nwfs/nwfs_io.c b/sys/fs/nwfs/nwfs_io.c
index 141c52e..d764f79 100644
--- a/sys/fs/nwfs/nwfs_io.c
+++ b/sys/fs/nwfs/nwfs_io.c
@@ -544,7 +544,7 @@ nwfs_putpages(ap)
npages = btoc(count);
for (i = 0; i < npages; i++) {
- rtvals[i] = VM_PAGER_AGAIN;
+ rtvals[i] = VM_PAGER_ERROR;
}
bp = getpbuf(&nwfs_pbuf_freecnt);
@@ -569,13 +569,8 @@ nwfs_putpages(ap)
pmap_qremove(kva, npages);
relpbuf(bp, &nwfs_pbuf_freecnt);
- if (!error) {
- int nwritten = round_page(count - uio.uio_resid) / PAGE_SIZE;
- for (i = 0; i < nwritten; i++) {
- rtvals[i] = VM_PAGER_OK;
- vm_page_undirty(pages[i]);
- }
- }
+ if (!error)
+ vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
return rtvals[0];
#endif /* NWFS_RWCACHE */
}
diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c
index 6c02fc6..4599a6f 100644
--- a/sys/fs/smbfs/smbfs_io.c
+++ b/sys/fs/smbfs/smbfs_io.c
@@ -609,7 +609,7 @@ smbfs_putpages(ap)
npages = btoc(count);
for (i = 0; i < npages; i++) {
- rtvals[i] = VM_PAGER_AGAIN;
+ rtvals[i] = VM_PAGER_ERROR;
}
bp = getpbuf(&smbfs_pbuf_freecnt);
@@ -639,13 +639,8 @@ smbfs_putpages(ap)
relpbuf(bp, &smbfs_pbuf_freecnt);
- if (!error) {
- int nwritten = round_page(count - uio.uio_resid) / PAGE_SIZE;
- for (i = 0; i < nwritten; i++) {
- rtvals[i] = VM_PAGER_OK;
- vm_page_undirty(pages[i]);
- }
- }
+ if (!error)
+ vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
return rtvals[0];
#endif /* SMBFS_RWGENERIC */
}
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 74c70ff..30497a4 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -672,7 +672,7 @@ static int
g_eli_cpu_is_disabled(int cpu)
{
#ifdef SMP
- return ((hlt_cpus_mask & (1 << cpu)) != 0);
+ return (CPU_ISSET(cpu, &hlt_cpus_mask));
#else
return (0);
#endif
diff --git a/sys/geom/geom.h b/sys/geom/geom.h
index 1dc6eb1..6256572 100644
--- a/sys/geom/geom.h
+++ b/sys/geom/geom.h
@@ -76,6 +76,7 @@ typedef void g_orphan_t (struct g_consumer *);
typedef void g_start_t (struct bio *);
typedef void g_spoiled_t (struct g_consumer *);
+typedef void g_attrchanged_t (struct g_consumer *, const char *attr);
typedef void g_dumpconf_t (struct sbuf *, const char *indent, struct g_geom *,
struct g_consumer *, struct g_provider *);
@@ -100,6 +101,7 @@ struct g_class {
*/
g_start_t *start;
g_spoiled_t *spoiled;
+ g_attrchanged_t *attrchanged;
g_dumpconf_t *dumpconf;
g_access_t *access;
g_orphan_t *orphan;
@@ -128,6 +130,7 @@ struct g_geom {
int rank;
g_start_t *start;
g_spoiled_t *spoiled;
+ g_attrchanged_t *attrchanged;
g_dumpconf_t *dumpconf;
g_access_t *access;
g_orphan_t *orphan;
@@ -217,6 +220,7 @@ struct g_classifier_hook {
/* geom_dev.c */
struct cdev;
void g_dev_print(void);
+void g_dev_physpath_changed(void);
struct g_provider *g_dev_getprovider(struct cdev *dev);
/* geom_dump.c */
@@ -232,6 +236,7 @@ typedef void g_event_t(void *, int flag);
int g_post_event(g_event_t *func, void *arg, int flag, ...);
int g_waitfor_event(g_event_t *func, void *arg, int flag, ...);
void g_cancel_event(void *ref);
+int g_attr_changed(struct g_provider *pp, const char *attr, int flag);
void g_orphan_provider(struct g_provider *pp, int error);
void g_waitidlelock(void);
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index f291b32..210f2ee 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/conf.h>
+#include <sys/ctype.h>
#include <sys/bio.h>
#include <sys/lock.h>
#include <sys/mutex.h>
@@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$");
#include <sys/limits.h>
#include <geom/geom.h>
#include <geom/geom_int.h>
+#include <machine/stdarg.h>
+
+/*
+ * Use the consumer private field to reference a physdev alias (if any).
+ */
+#define cp_alias_dev private
static d_open_t g_dev_open;
static d_close_t g_dev_close;
@@ -72,12 +79,14 @@ static struct cdevsw g_dev_cdevsw = {
static g_taste_t g_dev_taste;
static g_orphan_t g_dev_orphan;
+static g_attrchanged_t g_dev_attrchanged;
static struct g_class g_dev_class = {
.name = "DEV",
.version = G_VERSION,
.taste = g_dev_taste,
.orphan = g_dev_orphan,
+ .attrchanged = g_dev_attrchanged
};
void
@@ -93,6 +102,40 @@ g_dev_print(void)
printf("\n");
}
+static void
+g_dev_attrchanged(struct g_consumer *cp, const char *attr)
+{
+
+ if (strcmp(attr, "GEOM::physpath") != 0)
+ return;
+
+ if (g_access(cp, 1, 0, 0) == 0) {
+ char *physpath;
+ int error, physpath_len;
+
+ physpath_len = MAXPATHLEN;
+ physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO);
+ error =
+ g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath);
+ g_access(cp, -1, 0, 0);
+ if (error == 0 && strlen(physpath) != 0) {
+ struct cdev *dev;
+ struct cdev *old_alias_dev;
+ struct cdev **alias_devp;
+
+ dev = cp->geom->softc;
+ old_alias_dev = cp->cp_alias_dev;
+ alias_devp = (struct cdev **)&cp->cp_alias_dev;
+ make_dev_physpath_alias(MAKEDEV_WAITOK, alias_devp,
+ dev, old_alias_dev, physpath);
+ } else if (cp->cp_alias_dev) {
+ destroy_dev((struct cdev *)cp->cp_alias_dev);
+ cp->cp_alias_dev = NULL;
+ }
+ g_free(physpath);
+ }
+}
+
struct g_provider *
g_dev_getprovider(struct cdev *dev)
{
@@ -107,7 +150,6 @@ g_dev_getprovider(struct cdev *dev)
return (cp->provider);
}
-
static struct g_geom *
g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
{
@@ -167,6 +209,9 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
adev->si_drv1 = gp;
adev->si_drv2 = cp;
}
+
+ g_dev_attrchanged(cp, "GEOM::physpath");
+
return (gp);
}
@@ -365,6 +410,11 @@ g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread
case DIOCGSTRIPEOFFSET:
*(off_t *)data = cp->provider->stripeoffset;
break;
+ case DIOCGPHYSPATH:
+ error = g_io_getattr("GEOM::physpath", cp, &i, data);
+ if (error == 0 && *(char *)data == '\0')
+ error = ENOENT;
+ break;
default:
if (cp->provider->geom->ioctl != NULL) {
error = cp->provider->geom->ioctl(cp->provider, cmd, data, fflag, td);
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index a051772..17cae68 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -154,6 +154,12 @@ g_disk_access(struct g_provider *pp, int r, int w, int e)
}
pp->mediasize = dp->d_mediasize;
pp->sectorsize = dp->d_sectorsize;
+ if (dp->d_flags & DISKFLAG_CANDELETE)
+ pp->flags |= G_PF_CANDELETE;
+ else
+ pp->flags &= ~G_PF_CANDELETE;
+ pp->stripeoffset = dp->d_stripeoffset;
+ pp->stripesize = dp->d_stripesize;
dp->d_flags |= DISKFLAG_OPEN;
if (dp->d_maxsize == 0) {
printf("WARNING: Disk drive %s%d has no d_maxsize\n",
@@ -341,6 +347,15 @@ g_disk_start(struct bio *bp)
} while (bp2 != NULL);
break;
case BIO_GETATTR:
+ /* Give the driver a chance to override */
+ if (dp->d_getattr != NULL) {
+ if (bp->bio_disk == NULL)
+ bp->bio_disk = dp;
+ error = dp->d_getattr(bp);
+ if (error != -1)
+ break;
+ error = EJUSTRETURN;
+ }
if (g_handleattr_int(bp, "GEOM::candelete",
(dp->d_flags & DISKFLAG_CANDELETE) != 0))
break;
@@ -576,6 +591,18 @@ disk_gone(struct disk *dp)
g_wither_provider(pp, ENXIO);
}
+void
+disk_attr_changed(struct disk *dp, const char *attr, int flag)
+{
+ struct g_geom *gp;
+ struct g_provider *pp;
+
+ gp = dp->d_geom;
+ if (gp != NULL)
+ LIST_FOREACH(pp, &gp->provider, provider)
+ (void)g_attr_changed(pp, attr, flag);
+}
+
static void
g_kern_disks(void *p, int flag __unused)
{
diff --git a/sys/geom/geom_disk.h b/sys/geom/geom_disk.h
index 2d5f15d..e92f4aa 100644
--- a/sys/geom/geom_disk.h
+++ b/sys/geom/geom_disk.h
@@ -49,6 +49,7 @@ struct disk;
typedef int disk_open_t(struct disk *);
typedef int disk_close_t(struct disk *);
typedef void disk_strategy_t(struct bio *bp);
+typedef int disk_getattr_t(struct bio *bp);
typedef int disk_ioctl_t(struct disk *, u_long cmd, void *data,
int fflag, struct thread *td);
/* NB: disk_ioctl_t SHALL be cast'able to d_ioctl_t */
@@ -75,6 +76,7 @@ struct disk {
disk_strategy_t *d_strategy;
disk_ioctl_t *d_ioctl;
dumper_t *d_dump;
+ disk_getattr_t *d_getattr;
/* Info fields from driver to geom_disk.c. Valid when open */
u_int d_sectorsize;
@@ -104,6 +106,7 @@ struct disk *disk_alloc(void);
void disk_create(struct disk *disk, int version);
void disk_destroy(struct disk *disk);
void disk_gone(struct disk *disk);
+void disk_attr_changed(struct disk *dp, const char *attr, int flag);
#define DISK_VERSION_00 0x58561059
#define DISK_VERSION_01 0x5856105a
diff --git a/sys/geom/geom_dump.c b/sys/geom/geom_dump.c
index d1e56d6..6f678cf 100644
--- a/sys/geom/geom_dump.c
+++ b/sys/geom/geom_dump.c
@@ -207,10 +207,8 @@ g_conf_provider(struct sbuf *sb, struct g_provider *pp)
sbuf_printf(sb, "\t <mediasize>%jd</mediasize>\n",
(intmax_t)pp->mediasize);
sbuf_printf(sb, "\t <sectorsize>%u</sectorsize>\n", pp->sectorsize);
- if (pp->stripesize > 0) {
- sbuf_printf(sb, "\t <stripesize>%u</stripesize>\n", pp->stripesize);
- sbuf_printf(sb, "\t <stripeoffset>%u</stripeoffset>\n", pp->stripeoffset);
- }
+ sbuf_printf(sb, "\t <stripesize>%u</stripesize>\n", pp->stripesize);
+ sbuf_printf(sb, "\t <stripeoffset>%u</stripeoffset>\n", pp->stripeoffset);
if (pp->geom->flags & G_GEOM_WITHER)
;
else if (pp->geom->dumpconf != NULL) {
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c
index d6e5498..1e2fc8d 100644
--- a/sys/geom/geom_event.c
+++ b/sys/geom/geom_event.c
@@ -110,6 +110,53 @@ g_waitidlelock(void)
}
#endif
+struct g_attrchanged_args {
+ struct g_provider *pp;
+ const char *attr;
+};
+
+static void
+g_attr_changed_event(void *arg, int flag)
+{
+ struct g_attrchanged_args *args;
+ struct g_provider *pp;
+ struct g_consumer *cp;
+ struct g_consumer *next_cp;
+
+ args = arg;
+ pp = args->pp;
+
+ g_topology_assert();
+ if (flag != EV_CANCEL && g_shutdown == 0) {
+
+ /*
+ * Tell all consumers of the change.
+ */
+ LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, next_cp) {
+ if (cp->geom->attrchanged != NULL)
+ cp->geom->attrchanged(cp, args->attr);
+ }
+ }
+ g_free(args);
+}
+
+int
+g_attr_changed(struct g_provider *pp, const char *attr, int flag)
+{
+ struct g_attrchanged_args *args;
+ int error;
+
+ args = g_malloc(sizeof *args, flag);
+ if (args == NULL)
+ return (ENOMEM);
+ args->pp = pp;
+ args->attr = attr;
+ error = g_post_event(g_attr_changed_event, args, flag, pp, NULL);
+ if (error != 0)
+ g_free(args);
+ return (error);
+}
+
void
g_orphan_provider(struct g_provider *pp, int error)
{
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index a0958f3..6e2589b 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -350,6 +350,7 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...)
/* Fill in defaults from class */
gp->start = mp->start;
gp->spoiled = mp->spoiled;
+ gp->attrchanged = mp->attrchanged;
gp->dumpconf = mp->dumpconf;
gp->access = mp->access;
gp->orphan = mp->orphan;
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index a3f8575..f24e7b5 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -248,6 +248,7 @@ g_part_check_integrity(struct g_part_table *table, struct g_consumer *cp)
{
struct g_part_entry *e1, *e2;
struct g_provider *pp;
+ off_t offset;
int failed;
failed = 0;
@@ -294,6 +295,16 @@ g_part_check_integrity(struct g_part_table *table, struct g_consumer *cp)
(intmax_t)table->gpt_last);
failed++;
}
+ if (pp->stripesize > 0) {
+ offset = e1->gpe_start * pp->sectorsize;
+ if (e1->gpe_offset > offset)
+ offset = e1->gpe_offset;
+ if ((offset + pp->stripeoffset) % pp->stripesize) {
+ DPRINTF("partition %d is not aligned on %u "
+ "bytes\n", e1->gpe_index, pp->stripesize);
+ /* Don't treat this as a critical failure */
+ }
+ }
e2 = e1;
while ((e2 = LIST_NEXT(e2, gpe_entry)) != NULL) {
if (e2->gpe_deleted || e2->gpe_internal)
@@ -723,7 +734,11 @@ g_part_ctl_add(struct gctl_req *req, struct g_part_parms *gpp)
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
sb = sbuf_new_auto();
G_PART_FULLNAME(table, entry, sb, gp->name);
- sbuf_cat(sb, " added\n");
+ if (pp->stripesize > 0 && entry->gpe_pp->stripeoffset != 0)
+ sbuf_printf(sb, " added, but partition is not "
+ "aligned on %u bytes\n", pp->stripesize);
+ else
+ sbuf_cat(sb, " added\n");
sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
diff --git a/sys/geom/part/g_part_bsd.c b/sys/geom/part/g_part_bsd.c
index 269b943..be46775 100644
--- a/sys/geom/part/g_part_bsd.c
+++ b/sys/geom/part/g_part_bsd.c
@@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$");
#include "g_part_if.h"
+#define BOOT1_SIZE 512
+#define LABEL_SIZE 512
+#define BOOT2_OFF (BOOT1_SIZE + LABEL_SIZE)
+#define BOOT2_SIZE (BBSIZE - BOOT2_OFF)
+
FEATURE(geom_part_bsd, "GEOM partitioning class for BSD disklabels");
struct g_part_bsd_table {
@@ -170,22 +175,16 @@ g_part_bsd_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp)
{
struct g_part_bsd_table *table;
const u_char *codeptr;
- size_t hdsz, tlsz;
- size_t codesz, tlofs;
- hdsz = 512;
- tlofs = hdsz + 148 + basetable->gpt_entries * 16;
- tlsz = BBSIZE - tlofs;
+ if (gpp->gpp_codesize != BOOT1_SIZE && gpp->gpp_codesize != BBSIZE)
+ return (ENODEV);
+
table = (struct g_part_bsd_table *)basetable;
- bzero(table->bbarea, hdsz);
- bzero(table->bbarea + tlofs, tlsz);
codeptr = gpp->gpp_codeptr;
- codesz = MIN(hdsz, gpp->gpp_codesize);
- if (codesz > 0)
- bcopy(codeptr, table->bbarea, codesz);
- codesz = MIN(tlsz, gpp->gpp_codesize - tlofs);
- if (codesz > 0)
- bcopy(codeptr + tlofs, table->bbarea + tlofs, codesz);
+ bcopy(codeptr, table->bbarea, BOOT1_SIZE);
+ if (gpp->gpp_codesize == BBSIZE)
+ bcopy(codeptr + BOOT2_OFF, table->bbarea + BOOT2_OFF,
+ BOOT2_SIZE);
return (0);
}
diff --git a/sys/geom/part/g_part_ebr.c b/sys/geom/part/g_part_ebr.c
index f6278cc..8ea9b47 100644
--- a/sys/geom/part/g_part_ebr.c
+++ b/sys/geom/part/g_part_ebr.c
@@ -289,7 +289,6 @@ g_part_ebr_create(struct g_part_table *basetable, struct g_part_parms *gpp)
return (ENXIO);
msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX);
- msize -= msize % basetable->gpt_sectors;
basetable->gpt_first = 0;
basetable->gpt_last = msize - 1;
basetable->gpt_entries = msize / basetable->gpt_sectors;
@@ -523,7 +522,7 @@ g_part_ebr_read(struct g_part_table *basetable, struct g_consumer *cp)
basetable->gpt_entries = msize / basetable->gpt_sectors;
basetable->gpt_first = 0;
- basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1;
+ basetable->gpt_last = msize - 1;
return (0);
}
diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c
index 63dcac4..825a109 100644
--- a/sys/geom/part/g_part_mbr.c
+++ b/sys/geom/part/g_part_mbr.c
@@ -253,15 +253,14 @@ g_part_mbr_create(struct g_part_table *basetable, struct g_part_parms *gpp)
{
struct g_provider *pp;
struct g_part_mbr_table *table;
- uint32_t msize;
pp = gpp->gpp_provider;
if (pp->sectorsize < MBRSIZE)
return (ENOSPC);
- msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX);
basetable->gpt_first = basetable->gpt_sectors;
- basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1;
+ basetable->gpt_last = MIN(pp->mediasize / pp->sectorsize,
+ UINT32_MAX) - 1;
table = (struct g_part_mbr_table *)basetable;
le16enc(table->mbr + DOSMAGICOFFSET, DOSMAGIC);
@@ -424,12 +423,13 @@ g_part_mbr_read(struct g_part_table *basetable, struct g_consumer *cp)
struct g_part_mbr_table *table;
struct g_part_mbr_entry *entry;
u_char *buf, *p;
- off_t chs, msize;
+ off_t chs, msize, first;
u_int sectors, heads;
int error, index;
pp = cp->provider;
table = (struct g_part_mbr_table *)basetable;
+ first = basetable->gpt_sectors;
msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX);
buf = g_read_data(cp, 0L, pp->sectorsize, &error);
@@ -462,7 +462,8 @@ g_part_mbr_read(struct g_part_table *basetable, struct g_consumer *cp)
basetable->gpt_heads = heads;
}
}
-
+ if (ent.dp_start < first)
+ first = ent.dp_start;
entry = (struct g_part_mbr_entry *)g_part_new_entry(basetable,
index + 1, ent.dp_start, ent.dp_start + ent.dp_size - 1);
entry->ent = ent;
@@ -470,7 +471,10 @@ g_part_mbr_read(struct g_part_table *basetable, struct g_consumer *cp)
basetable->gpt_entries = NDOSPART;
basetable->gpt_first = basetable->gpt_sectors;
- basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1;
+ basetable->gpt_last = msize - 1;
+
+ if (first < basetable->gpt_first)
+ basetable->gpt_first = 1;
g_free(buf);
return (0);
diff --git a/sys/geom/part/g_part_pc98.c b/sys/geom/part/g_part_pc98.c
index 0bdc0a6..0d81a0e 100644
--- a/sys/geom/part/g_part_pc98.c
+++ b/sys/geom/part/g_part_pc98.c
@@ -248,7 +248,6 @@ g_part_pc98_create(struct g_part_table *basetable, struct g_part_parms *gpp)
{
struct g_provider *pp;
struct g_part_pc98_table *table;
- uint32_t cyl, msize;
pp = gpp->gpp_provider;
if (pp->sectorsize < SECSIZE || pp->mediasize < BOOTSIZE)
@@ -256,11 +255,8 @@ g_part_pc98_create(struct g_part_table *basetable, struct g_part_parms *gpp)
if (pp->sectorsize > SECSIZE)
return (ENXIO);
- cyl = basetable->gpt_heads * basetable->gpt_sectors;
-
- msize = MIN(pp->mediasize / SECSIZE, UINT32_MAX);
- basetable->gpt_first = cyl;
- basetable->gpt_last = msize - (msize % cyl) - 1;
+ basetable->gpt_first = basetable->gpt_heads * basetable->gpt_sectors;
+ basetable->gpt_last = MIN(pp->mediasize / SECSIZE, UINT32_MAX) - 1;
table = (struct g_part_pc98_table *)basetable;
le16enc(table->boot + DOSMAGICOFFSET, DOSMAGIC);
@@ -488,7 +484,7 @@ g_part_pc98_read(struct g_part_table *basetable, struct g_consumer *cp)
basetable->gpt_entries = NDOSPART;
basetable->gpt_first = cyl;
- basetable->gpt_last = msize - (msize % cyl) - 1;
+ basetable->gpt_last = msize - 1;
g_free(buf);
return (0);
diff --git a/sys/geom/vinum/geom_vinum_drive.c b/sys/geom/vinum/geom_vinum_drive.c
index 5ab68f3..f782fd0 100644
--- a/sys/geom/vinum/geom_vinum_drive.c
+++ b/sys/geom/vinum/geom_vinum_drive.c
@@ -126,6 +126,10 @@ gv_read_header(struct g_consumer *cp, struct gv_hdr *m_hdr)
pp = cp->provider;
KASSERT(pp != NULL, ("gv_read_header: null pp"));
+ if ((GV_HDR_OFFSET % pp->sectorsize) != 0 ||
+ (GV_HDR_LEN % pp->sectorsize) != 0)
+ return (ENODEV);
+
d_hdr = g_read_data(cp, GV_HDR_OFFSET, pp->sectorsize, NULL);
if (d_hdr == NULL)
return (-1);
diff --git a/sys/geom/vinum/geom_vinum_events.c b/sys/geom/vinum/geom_vinum_events.c
index fcd45f1..db4e543 100644
--- a/sys/geom/vinum/geom_vinum_events.c
+++ b/sys/geom/vinum/geom_vinum_events.c
@@ -109,6 +109,12 @@ gv_drive_tasted(struct gv_softc *sc, struct g_provider *pp)
buf = NULL;
G_VINUM_DEBUG(2, "tasted drive on '%s'", pp->name);
+ if ((GV_CFG_OFFSET % pp->sectorsize) != 0 ||
+ (GV_CFG_LEN % pp->sectorsize) != 0) {
+ G_VINUM_DEBUG(0, "provider %s has unsupported sectorsize.",
+ pp->name);
+ return;
+ }
gp = sc->geom;
g_topology_lock();
diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC
index ec5b113..c4548c6 100644
--- a/sys/i386/conf/GENERIC
+++ b/sys/i386/conf/GENERIC
@@ -308,6 +308,7 @@ options USB_DEBUG # enable debug msgs
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
+device xhci # XHCI PCI->USB interface (USB 3.0)
device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices (needs netgraph)
device uhid # "Human Interface Devices"
@@ -350,3 +351,11 @@ device fwe # Ethernet over FireWire (non-standard!)
device fwip # IP over FireWire (RFC 2734,3146)
device dcons # Dumb console driver
device dcons_crom # Configuration ROM for dcons
+
+# Sound support
+device sound # Generic sound driver (required)
+device snd_es137x # Ensoniq AudioPCI ES137x
+device snd_hda # Intel High Definition Audio
+device snd_ich # Intel, NVidia and other ICH AC'97 Audio
+device snd_uaudio # USB Audio
+device snd_via8233 # VIA VT8233x Audio
diff --git a/sys/i386/i386/intr_machdep.c b/sys/i386/i386/intr_machdep.c
index 77b8004..56529f7 100644
--- a/sys/i386/i386/intr_machdep.c
+++ b/sys/i386/i386/intr_machdep.c
@@ -409,8 +409,7 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
* allocate CPUs round-robin.
*/
-/* The BSP is always a valid target. */
-static cpumask_t intr_cpus = (1 << 0);
+static cpuset_t intr_cpus;
static int current_cpu;
/*
@@ -432,7 +431,7 @@ intr_next_cpu(void)
current_cpu++;
if (current_cpu > mp_maxid)
current_cpu = 0;
- } while (!(intr_cpus & (1 << current_cpu)));
+ } while (!CPU_ISSET(current_cpu, &intr_cpus));
mtx_unlock_spin(&icu_lock);
return (apic_id);
}
@@ -463,7 +462,7 @@ intr_add_cpu(u_int cpu)
printf("INTR: Adding local APIC %d as a target\n",
cpu_apic_ids[cpu]);
- intr_cpus |= (1 << cpu);
+ CPU_SET(cpu, &intr_cpus);
}
/*
@@ -483,6 +482,9 @@ intr_shuffle_irqs(void *arg __unused)
return;
#endif
+ /* The BSP is always a valid target. */
+ CPU_SETOF(0, &intr_cpus);
+
/* Don't bother on UP. */
if (mp_ncpus == 1)
return;
diff --git a/sys/i386/i386/legacy.c b/sys/i386/i386/legacy.c
index 2136d80..6fe5700 100644
--- a/sys/i386/i386/legacy.c
+++ b/sys/i386/i386/legacy.c
@@ -86,6 +86,7 @@ static device_method_t legacy_methods[] = {
DEVMETHOD(bus_read_ivar, legacy_read_ivar),
DEVMETHOD(bus_write_ivar, legacy_write_ivar),
DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource),
DEVMETHOD(bus_release_resource, bus_generic_release_resource),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index fbf444a..91050c4 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include "opt_isa.h"
#include "opt_kstack_pages.h"
#include "opt_maxmem.h"
+#include "opt_mp_watchdog.h"
#include "opt_npx.h"
#include "opt_perfmon.h"
#include "opt_xbox.h"
@@ -118,6 +119,7 @@ __FBSDID("$FreeBSD$");
#include <x86/mca.h>
#include <machine/md_var.h>
#include <machine/metadata.h>
+#include <machine/mp_watchdog.h>
#include <machine/pc/bios.h>
#include <machine/pcb.h>
#include <machine/pcb_ext.h>
@@ -1357,9 +1359,8 @@ cpu_idle(int busy)
CTR2(KTR_SPARE2, "cpu_idle(%d) at %d",
busy, curcpu);
-#if defined(SMP) && !defined(XEN)
- if (mp_grab_cpu_hlt())
- return;
+#if defined(MP_WATCHDOG) && !defined(XEN)
+ ap_watchdog(PCPU_GET(cpuid));
#endif
#ifndef XEN
/* If we are busy - try to use fast methods. */
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index a4db401..78c90c0 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
#include "opt_apic.h"
#include "opt_cpu.h"
#include "opt_kstack_pages.h"
-#include "opt_mp_watchdog.h"
#include "opt_pmap.h"
#include "opt_sched.h"
#include "opt_smp.h"
@@ -51,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/cons.h> /* cngetc() */
+#include <sys/cpuset.h>
#ifdef GPROF
#include <sys/gmon.h>
#endif
@@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cputypes.h>
#include <x86/mca.h>
#include <machine/md_var.h>
-#include <machine/mp_watchdog.h>
#include <machine/pcb.h>
#include <machine/psl.h>
#include <machine/smp.h>
@@ -173,7 +172,7 @@ static u_long *ipi_hardclock_counts[MAXCPU];
* Local data and functions.
*/
-static volatile cpumask_t ipi_nmi_pending;
+static volatile cpuset_t ipi_nmi_pending;
/* used to hold the AP's until we are ready to release them */
static struct mtx ap_boot_mtx;
@@ -208,11 +207,8 @@ static int start_all_aps(void);
static int start_ap(int apic_id);
static void release_aps(void *dummy);
-static int hlt_logical_cpus;
static u_int hyperthreading_cpus; /* logical cpus sharing L1 cache */
-static cpumask_t hyperthreading_cpus_mask;
static int hyperthreading_allowed = 1;
-static struct sysctl_ctx_list logical_cpu_clist;
static void
mem_range_AP_init(void)
@@ -289,8 +285,11 @@ topo_probe_0x4(void)
* logical processors that belong to the same core
* as BSP thus deducing number of threads per core.
*/
- cpuid_count(0x04, 0, p);
- max_cores = ((p[0] >> 26) & 0x3f) + 1;
+ if (cpu_high >= 0x4) {
+ cpuid_count(0x04, 0, p);
+ max_cores = ((p[0] >> 26) & 0x3f) + 1;
+ } else
+ max_cores = 1;
core_id_bits = mask_width(max_logical/max_cores);
if (core_id_bits < 0)
return;
@@ -382,7 +381,7 @@ topo_probe(void)
if (cpu_topo_probed)
return;
- logical_cpus_mask = 0;
+ CPU_ZERO(&logical_cpus_mask);
if (mp_ncpus <= 1)
cpu_cores = cpu_logical = 1;
else if (cpu_vendor_id == CPU_VENDOR_AMD)
@@ -524,7 +523,7 @@ cpu_mp_probe(void)
* Always record BSP in CPU map so that the mbuf init code works
* correctly.
*/
- all_cpus = 1;
+ CPU_SETOF(0, &all_cpus);
if (mp_ncpus == 0) {
/*
* No CPUs were found, so this must be a UP system. Setup
@@ -659,6 +658,7 @@ cpu_mp_announce(void)
void
init_secondary(void)
{
+ cpuset_t tcpuset, tallcpus;
struct pcpu *pc;
vm_offset_t addr;
int gsel_tss;
@@ -783,19 +783,17 @@ init_secondary(void)
CTR1(KTR_SMP, "SMP: AP CPU #%d Launched", PCPU_GET(cpuid));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
+ tcpuset = PCPU_GET(cpumask);
/* Determine if we are a logical CPU. */
/* XXX Calculation depends on cpu_logical being a power of 2, e.g. 2 */
if (cpu_logical > 1 && PCPU_GET(apic_id) % cpu_logical != 0)
- logical_cpus_mask |= PCPU_GET(cpumask);
-
- /* Determine if we are a hyperthread. */
- if (hyperthreading_cpus > 1 &&
- PCPU_GET(apic_id) % hyperthreading_cpus != 0)
- hyperthreading_cpus_mask |= PCPU_GET(cpumask);
+ CPU_OR(&logical_cpus_mask, &tcpuset);
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
+ tallcpus = all_cpus;
+ CPU_NAND(&tallcpus, &tcpuset);
+ PCPU_SET(other_cpus, tallcpus);
if (bootverbose)
lapic_dump("AP");
@@ -874,7 +872,7 @@ assign_cpu_ids(void)
if (hyperthreading_cpus > 1 && i % hyperthreading_cpus != 0) {
cpu_info[i].cpu_hyperthread = 1;
-#if defined(SCHED_ULE)
+
/*
* Don't use HT CPU if it has been disabled by a
* tunable.
@@ -883,7 +881,6 @@ assign_cpu_ids(void)
cpu_info[i].cpu_disabled = 1;
continue;
}
-#endif
}
/* Don't use this CPU if it has been disabled by a tunable. */
@@ -893,6 +890,11 @@ assign_cpu_ids(void)
}
}
+ if (hyperthreading_allowed == 0 && hyperthreading_cpus > 1) {
+ hyperthreading_cpus = 0;
+ cpu_logical = 1;
+ }
+
/*
* Assign CPU IDs to local APIC IDs and disable any CPUs
* beyond MAXCPU. CPU 0 is always assigned to the BSP.
@@ -932,6 +934,7 @@ assign_cpu_ids(void)
static int
start_all_aps(void)
{
+ cpuset_t tallcpus;
#ifndef PC98
u_char mpbiosreason;
#endif
@@ -991,11 +994,13 @@ start_all_aps(void)
}
CHECK_PRINT("trace"); /* show checkpoints */
- all_cpus |= (1 << cpu); /* record AP in CPU map */
+ CPU_SET(cpu, &all_cpus); /* record AP in CPU map */
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
+ tallcpus = all_cpus;
+ CPU_NAND(&tallcpus, PCPU_PTR(cpumask));
+ PCPU_SET(other_cpus, tallcpus);
/* restore the warmstart vector */
*(u_int32_t *) WARMBOOT_OFF = mpbioswarmvec;
@@ -1192,6 +1197,30 @@ SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_range_size, CTLFLAG_RW,
#endif /* COUNT_XINVLTLB_HITS */
/*
+ * Send an IPI to specified CPU handling the bitmap logic.
+ */
+static void
+ipi_send_cpu(int cpu, u_int ipi)
+{
+ u_int bitmap, old_pending, new_pending;
+
+ KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu));
+
+ if (IPI_IS_BITMAPED(ipi)) {
+ bitmap = 1 << ipi;
+ ipi = IPI_BITMAP_VECTOR;
+ do {
+ old_pending = cpu_ipi_pending[cpu];
+ new_pending = old_pending | bitmap;
+ } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],
+ old_pending, new_pending));
+ if (old_pending)
+ return;
+ }
+ lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
+}
+
+/*
* Flush the TLB on all other CPU's
*/
static void
@@ -1215,28 +1244,19 @@ smp_tlb_shootdown(u_int vector, vm_offset_t addr1, vm_offset_t addr2)
}
static void
-smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2)
+smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2)
{
- int ncpu, othercpus;
+ int cpu, ncpu, othercpus;
othercpus = mp_ncpus - 1;
- if (mask == (u_int)-1) {
- ncpu = othercpus;
- if (ncpu < 1)
+ if (CPU_ISFULLSET(&mask)) {
+ if (othercpus < 1)
return;
} else {
- mask &= ~PCPU_GET(cpumask);
- if (mask == 0)
- return;
- ncpu = bitcount32(mask);
- if (ncpu > othercpus) {
- /* XXX this should be a panic offence */
- printf("SMP: tlb shootdown to %d other cpus (only have %d)\n",
- ncpu, othercpus);
- ncpu = othercpus;
- }
- /* XXX should be a panic, implied by mask == 0 above */
- if (ncpu < 1)
+ sched_pin();
+ CPU_NAND(&mask, PCPU_PTR(cpumask));
+ sched_unpin();
+ if (CPU_EMPTY(&mask))
return;
}
if (!(read_eflags() & PSL_I))
@@ -1245,39 +1265,25 @@ smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_o
smp_tlb_addr1 = addr1;
smp_tlb_addr2 = addr2;
atomic_store_rel_int(&smp_tlb_wait, 0);
- if (mask == (u_int)-1)
+ if (CPU_ISFULLSET(&mask)) {
+ ncpu = othercpus;
ipi_all_but_self(vector);
- else
- ipi_selected(mask, vector);
+ } else {
+ ncpu = 0;
+ while ((cpu = cpusetobj_ffs(&mask)) != 0) {
+ cpu--;
+ CPU_CLR(cpu, &mask);
+ CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu,
+ vector);
+ ipi_send_cpu(cpu, vector);
+ ncpu++;
+ }
+ }
while (smp_tlb_wait < ncpu)
ia32_pause();
mtx_unlock_spin(&smp_ipi_mtx);
}
-/*
- * Send an IPI to specified CPU handling the bitmap logic.
- */
-static void
-ipi_send_cpu(int cpu, u_int ipi)
-{
- u_int bitmap, old_pending, new_pending;
-
- KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu));
-
- if (IPI_IS_BITMAPED(ipi)) {
- bitmap = 1 << ipi;
- ipi = IPI_BITMAP_VECTOR;
- do {
- old_pending = cpu_ipi_pending[cpu];
- new_pending = old_pending | bitmap;
- } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],
- old_pending, new_pending));
- if (old_pending)
- return;
- }
- lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
-}
-
void
smp_cache_flush(void)
{
@@ -1324,7 +1330,7 @@ smp_invlpg_range(vm_offset_t addr1, vm_offset_t addr2)
}
void
-smp_masked_invltlb(cpumask_t mask)
+smp_masked_invltlb(cpuset_t mask)
{
if (smp_started) {
@@ -1336,7 +1342,7 @@ smp_masked_invltlb(cpumask_t mask)
}
void
-smp_masked_invlpg(cpumask_t mask, vm_offset_t addr)
+smp_masked_invlpg(cpuset_t mask, vm_offset_t addr)
{
if (smp_started) {
@@ -1348,7 +1354,7 @@ smp_masked_invlpg(cpumask_t mask, vm_offset_t addr)
}
void
-smp_masked_invlpg_range(cpumask_t mask, vm_offset_t addr1, vm_offset_t addr2)
+smp_masked_invlpg_range(cpuset_t mask, vm_offset_t addr1, vm_offset_t addr2)
{
if (smp_started) {
@@ -1401,7 +1407,7 @@ ipi_bitmap_handler(struct trapframe frame)
* send an IPI to a set of cpus.
*/
void
-ipi_selected(cpumask_t cpus, u_int ipi)
+ipi_selected(cpuset_t cpus, u_int ipi)
{
int cpu;
@@ -1411,12 +1417,12 @@ ipi_selected(cpumask_t cpus, u_int ipi)
* Set the mask of receiving CPUs for this purpose.
*/
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, cpus);
+ CPU_OR_ATOMIC(&ipi_nmi_pending, &cpus);
- CTR3(KTR_SMP, "%s: cpus: %x ipi: %x", __func__, cpus, ipi);
- while ((cpu = ffs(cpus)) != 0) {
+ while ((cpu = cpusetobj_ffs(&cpus)) != 0) {
cpu--;
- cpus &= ~(1 << cpu);
+ CPU_CLR(cpu, &cpus);
+ CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi);
ipi_send_cpu(cpu, ipi);
}
}
@@ -1434,7 +1440,7 @@ ipi_cpu(int cpu, u_int ipi)
* Set the mask of receiving CPUs for this purpose.
*/
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, 1 << cpu);
+ CPU_SET_ATOMIC(cpu, &ipi_nmi_pending);
CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi);
ipi_send_cpu(cpu, ipi);
@@ -1447,8 +1453,10 @@ void
ipi_all_but_self(u_int ipi)
{
+ sched_pin();
if (IPI_IS_BITMAPED(ipi)) {
ipi_selected(PCPU_GET(other_cpus), ipi);
+ sched_unpin();
return;
}
@@ -1458,7 +1466,9 @@ ipi_all_but_self(u_int ipi)
* Set the mask of receiving CPUs for this purpose.
*/
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, PCPU_GET(other_cpus));
+ CPU_OR_ATOMIC(&ipi_nmi_pending, PCPU_PTR(other_cpus));
+ sched_unpin();
+
CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi);
lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
}
@@ -1466,7 +1476,7 @@ ipi_all_but_self(u_int ipi)
int
ipi_nmi_handler()
{
- cpumask_t cpumask;
+ cpuset_t cpumask;
/*
* As long as there is not a simple way to know about a NMI's
@@ -1474,11 +1484,13 @@ ipi_nmi_handler()
* the global pending bitword an IPI_STOP_HARD has been issued
* and should be handled.
*/
+ sched_pin();
cpumask = PCPU_GET(cpumask);
- if ((ipi_nmi_pending & cpumask) == 0)
+ sched_unpin();
+ if (!CPU_OVERLAP(&ipi_nmi_pending, &cpumask))
return (1);
- atomic_clear_int(&ipi_nmi_pending, cpumask);
+ CPU_NAND_ATOMIC(&ipi_nmi_pending, &cpumask);
cpustop_handler();
return (0);
}
@@ -1490,23 +1502,25 @@ ipi_nmi_handler()
void
cpustop_handler(void)
{
- cpumask_t cpumask;
+ cpuset_t cpumask;
u_int cpu;
+ sched_pin();
cpu = PCPU_GET(cpuid);
cpumask = PCPU_GET(cpumask);
+ sched_unpin();
savectx(&stoppcbs[cpu]);
/* Indicate that we are stopped */
- atomic_set_int(&stopped_cpus, cpumask);
+ CPU_OR_ATOMIC(&stopped_cpus, &cpumask);
/* Wait for restart */
- while (!(started_cpus & cpumask))
+ while (!CPU_OVERLAP(&started_cpus, &cpumask))
ia32_pause();
- atomic_clear_int(&started_cpus, cpumask);
- atomic_clear_int(&stopped_cpus, cpumask);
+ CPU_NAND_ATOMIC(&started_cpus, &cpumask);
+ CPU_NAND_ATOMIC(&stopped_cpus, &cpumask);
if (cpu == 0 && cpustop_restartfunc != NULL) {
cpustop_restartfunc();
@@ -1530,158 +1544,6 @@ release_aps(void *dummy __unused)
}
SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, release_aps, NULL);
-static int
-sysctl_hlt_cpus(SYSCTL_HANDLER_ARGS)
-{
- cpumask_t mask;
- int error;
-
- mask = hlt_cpus_mask;
- error = sysctl_handle_int(oidp, &mask, 0, req);
- if (error || !req->newptr)
- return (error);
-
- if (logical_cpus_mask != 0 &&
- (mask & logical_cpus_mask) == logical_cpus_mask)
- hlt_logical_cpus = 1;
- else
- hlt_logical_cpus = 0;
-
- if (! hyperthreading_allowed)
- mask |= hyperthreading_cpus_mask;
-
- if ((mask & all_cpus) == all_cpus)
- mask &= ~(1<<0);
- hlt_cpus_mask = mask;
- return (error);
-}
-SYSCTL_PROC(_machdep, OID_AUTO, hlt_cpus, CTLTYPE_INT|CTLFLAG_RW,
- 0, 0, sysctl_hlt_cpus, "IU",
- "Bitmap of CPUs to halt. 101 (binary) will halt CPUs 0 and 2.");
-
-static int
-sysctl_hlt_logical_cpus(SYSCTL_HANDLER_ARGS)
-{
- int disable, error;
-
- disable = hlt_logical_cpus;
- error = sysctl_handle_int(oidp, &disable, 0, req);
- if (error || !req->newptr)
- return (error);
-
- if (disable)
- hlt_cpus_mask |= logical_cpus_mask;
- else
- hlt_cpus_mask &= ~logical_cpus_mask;
-
- if (! hyperthreading_allowed)
- hlt_cpus_mask |= hyperthreading_cpus_mask;
-
- if ((hlt_cpus_mask & all_cpus) == all_cpus)
- hlt_cpus_mask &= ~(1<<0);
-
- hlt_logical_cpus = disable;
- return (error);
-}
-
-static int
-sysctl_hyperthreading_allowed(SYSCTL_HANDLER_ARGS)
-{
- int allowed, error;
-
- allowed = hyperthreading_allowed;
- error = sysctl_handle_int(oidp, &allowed, 0, req);
- if (error || !req->newptr)
- return (error);
-
-#ifdef SCHED_ULE
- /*
- * SCHED_ULE doesn't allow enabling/disabling HT cores at
- * run-time.
- */
- if (allowed != hyperthreading_allowed)
- return (ENOTSUP);
- return (error);
-#endif
-
- if (allowed)
- hlt_cpus_mask &= ~hyperthreading_cpus_mask;
- else
- hlt_cpus_mask |= hyperthreading_cpus_mask;
-
- if (logical_cpus_mask != 0 &&
- (hlt_cpus_mask & logical_cpus_mask) == logical_cpus_mask)
- hlt_logical_cpus = 1;
- else
- hlt_logical_cpus = 0;
-
- if ((hlt_cpus_mask & all_cpus) == all_cpus)
- hlt_cpus_mask &= ~(1<<0);
-
- hyperthreading_allowed = allowed;
- return (error);
-}
-
-static void
-cpu_hlt_setup(void *dummy __unused)
-{
-
- if (logical_cpus_mask != 0) {
- TUNABLE_INT_FETCH("machdep.hlt_logical_cpus",
- &hlt_logical_cpus);
- sysctl_ctx_init(&logical_cpu_clist);
- SYSCTL_ADD_PROC(&logical_cpu_clist,
- SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO,
- "hlt_logical_cpus", CTLTYPE_INT|CTLFLAG_RW, 0, 0,
- sysctl_hlt_logical_cpus, "IU", "");
- SYSCTL_ADD_UINT(&logical_cpu_clist,
- SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO,
- "logical_cpus_mask", CTLTYPE_INT|CTLFLAG_RD,
- &logical_cpus_mask, 0, "");
-
- if (hlt_logical_cpus)
- hlt_cpus_mask |= logical_cpus_mask;
-
- /*
- * If necessary for security purposes, force
- * hyperthreading off, regardless of the value
- * of hlt_logical_cpus.
- */
- if (hyperthreading_cpus_mask) {
- SYSCTL_ADD_PROC(&logical_cpu_clist,
- SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO,
- "hyperthreading_allowed", CTLTYPE_INT|CTLFLAG_RW,
- 0, 0, sysctl_hyperthreading_allowed, "IU", "");
- if (! hyperthreading_allowed)
- hlt_cpus_mask |= hyperthreading_cpus_mask;
- }
- }
-}
-SYSINIT(cpu_hlt, SI_SUB_SMP, SI_ORDER_ANY, cpu_hlt_setup, NULL);
-
-int
-mp_grab_cpu_hlt(void)
-{
- cpumask_t mask;
-#ifdef MP_WATCHDOG
- u_int cpuid;
-#endif
- int retval;
-
- mask = PCPU_GET(cpumask);
-#ifdef MP_WATCHDOG
- cpuid = PCPU_GET(cpuid);
- ap_watchdog(cpuid);
-#endif
-
- retval = 0;
- while (mask & hlt_cpus_mask) {
- retval = 1;
- __asm __volatile("sti; hlt" : : : "memory");
- }
- return (retval);
-}
-
#ifdef COUNT_IPIS
/*
* Setup interrupt counters for IPI handlers.
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index d10bbe5..3f9248d 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -125,6 +125,8 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#ifdef SMP
#include <sys/smp.h>
+#else
+#include <sys/cpuset.h>
#endif
#include <vm/vm.h>
@@ -386,7 +388,7 @@ pmap_bootstrap(vm_paddr_t firstaddr)
kernel_pmap->pm_pdpt = (pdpt_entry_t *) (KERNBASE + (u_int)IdlePDPT);
#endif
kernel_pmap->pm_root = NULL;
- kernel_pmap->pm_active = -1; /* don't allow deactivation */
+ CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvchunk);
LIST_INIT(&allpmaps);
@@ -930,19 +932,20 @@ pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde)
void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
invlpg(va);
smp_invlpg(va);
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
invlpg(va);
- if (pmap->pm_active & other_cpus)
- smp_masked_invlpg(pmap->pm_active & other_cpus, va);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invlpg(other_cpus, va);
}
sched_unpin();
}
@@ -950,23 +953,23 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
void
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
vm_offset_t addr;
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
smp_invlpg_range(sva, eva);
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
- if (pmap->pm_active & other_cpus)
- smp_masked_invlpg_range(pmap->pm_active & other_cpus,
- sva, eva);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invlpg_range(other_cpus, sva, eva);
}
sched_unpin();
}
@@ -974,19 +977,20 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
void
pmap_invalidate_all(pmap_t pmap)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
invltlb();
smp_invltlb();
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
invltlb();
- if (pmap->pm_active & other_cpus)
- smp_masked_invltlb(pmap->pm_active & other_cpus);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invltlb(other_cpus);
}
sched_unpin();
}
@@ -1002,8 +1006,8 @@ pmap_invalidate_cache(void)
}
struct pde_action {
- cpumask_t store; /* processor that updates the PDE */
- cpumask_t invalidate; /* processors that invalidate their TLB */
+ cpuset_t store; /* processor that updates the PDE */
+ cpuset_t invalidate; /* processors that invalidate their TLB */
vm_offset_t va;
pd_entry_t *pde;
pd_entry_t newpde;
@@ -1016,7 +1020,10 @@ pmap_update_pde_kernel(void *arg)
pd_entry_t *pde;
pmap_t pmap;
- if (act->store == PCPU_GET(cpumask))
+ sched_pin();
+ if (!CPU_CMP(&act->store, PCPU_PTR(cpumask))) {
+ sched_unpin();
+
/*
* Elsewhere, this operation requires allpmaps_lock for
* synchronization. Here, it does not because it is being
@@ -1026,6 +1033,8 @@ pmap_update_pde_kernel(void *arg)
pde = pmap_pde(pmap, act->va);
pde_store(pde, act->newpde);
}
+ } else
+ sched_unpin();
}
static void
@@ -1033,8 +1042,12 @@ pmap_update_pde_user(void *arg)
{
struct pde_action *act = arg;
- if (act->store == PCPU_GET(cpumask))
+ sched_pin();
+ if (!CPU_CMP(&act->store, PCPU_PTR(cpumask))) {
+ sched_unpin();
pde_store(act->pde, act->newpde);
+ } else
+ sched_unpin();
}
static void
@@ -1042,8 +1055,12 @@ pmap_update_pde_teardown(void *arg)
{
struct pde_action *act = arg;
- if ((act->invalidate & PCPU_GET(cpumask)) != 0)
+ sched_pin();
+ if (CPU_OVERLAP(&act->invalidate, PCPU_PTR(cpumask))) {
+ sched_unpin();
pmap_update_pde_invalidate(act->va, act->newpde);
+ } else
+ sched_unpin();
}
/*
@@ -1058,21 +1075,23 @@ static void
pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde)
{
struct pde_action act;
- cpumask_t active, cpumask;
+ cpuset_t active, cpumask, other_cpus;
sched_pin();
cpumask = PCPU_GET(cpumask);
+ other_cpus = PCPU_GET(other_cpus);
if (pmap == kernel_pmap)
active = all_cpus;
else
active = pmap->pm_active;
- if ((active & PCPU_GET(other_cpus)) != 0) {
+ if (CPU_OVERLAP(&active, &other_cpus)) {
act.store = cpumask;
act.invalidate = active;
act.va = va;
act.pde = pde;
act.newpde = newpde;
- smp_rendezvous_cpus(cpumask | active,
+ CPU_OR(&cpumask, &active);
+ smp_rendezvous_cpus(cpumask,
smp_no_rendevous_barrier, pmap == kernel_pmap ?
pmap_update_pde_kernel : pmap_update_pde_user,
pmap_update_pde_teardown, &act);
@@ -1081,7 +1100,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde)
pmap_kenter_pde(va, newpde);
else
pde_store(pde, newpde);
- if ((active & cpumask) != 0)
+ if (CPU_OVERLAP(&active, &cpumask))
pmap_update_pde_invalidate(va, newpde);
}
sched_unpin();
@@ -1095,7 +1114,7 @@ PMAP_INLINE void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
invlpg(va);
}
@@ -1104,7 +1123,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
vm_offset_t addr;
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
}
@@ -1113,7 +1132,7 @@ PMAP_INLINE void
pmap_invalidate_all(pmap_t pmap)
{
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
invltlb();
}
@@ -1132,7 +1151,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, pd_entry_t newpde)
pmap_kenter_pde(va, newpde);
else
pde_store(pde, newpde);
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
pmap_update_pde_invalidate(va, newpde);
}
#endif /* !SMP */
@@ -1689,7 +1708,7 @@ pmap_pinit0(pmap_t pmap)
pmap->pm_pdpt = (pdpt_entry_t *)(KERNBASE + (vm_offset_t)IdlePDPT);
#endif
pmap->pm_root = NULL;
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
PCPU_SET(curpmap, pmap);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
@@ -1770,7 +1789,7 @@ pmap_pinit(pmap_t pmap)
#endif
}
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
@@ -1886,7 +1905,7 @@ retry:
* Deal with a SMP shootdown of other users of the pmap that we are
* trying to dispose of. This can be a bit hairy.
*/
-static cpumask_t *lazymask;
+static cpuset_t *lazymask;
static u_int lazyptd;
static volatile u_int lazywait;
@@ -1895,36 +1914,42 @@ void pmap_lazyfix_action(void);
void
pmap_lazyfix_action(void)
{
- cpumask_t mymask = PCPU_GET(cpumask);
#ifdef COUNT_IPIS
(*ipi_lazypmap_counts[PCPU_GET(cpuid)])++;
#endif
if (rcr3() == lazyptd)
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
- atomic_clear_int(lazymask, mymask);
+ CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask);
atomic_store_rel_int(&lazywait, 1);
}
static void
-pmap_lazyfix_self(cpumask_t mymask)
+pmap_lazyfix_self(cpuset_t mymask)
{
if (rcr3() == lazyptd)
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
- atomic_clear_int(lazymask, mymask);
+ CPU_NAND_ATOMIC(lazymask, &mymask);
}
static void
pmap_lazyfix(pmap_t pmap)
{
- cpumask_t mymask, mask;
+ cpuset_t mymask, mask;
u_int spins;
+ int lsb;
- while ((mask = pmap->pm_active) != 0) {
+ mask = pmap->pm_active;
+ while (!CPU_EMPTY(&mask)) {
spins = 50000000;
- mask = mask & -mask; /* Find least significant set bit */
+
+ /* Find least significant set bit. */
+ lsb = cpusetobj_ffs(&mask);
+ MPASS(lsb != 0);
+ lsb--;
+ CPU_SETOF(lsb, &mask);
mtx_lock_spin(&smp_ipi_mtx);
#ifdef PAE
lazyptd = vtophys(pmap->pm_pdpt);
@@ -1932,7 +1957,7 @@ pmap_lazyfix(pmap_t pmap)
lazyptd = vtophys(pmap->pm_pdir);
#endif
mymask = PCPU_GET(cpumask);
- if (mask == mymask) {
+ if (!CPU_CMP(&mask, &mymask)) {
lazymask = &pmap->pm_active;
pmap_lazyfix_self(mymask);
} else {
@@ -1949,6 +1974,7 @@ pmap_lazyfix(pmap_t pmap)
mtx_unlock_spin(&smp_ipi_mtx);
if (spins == 0)
printf("pmap_lazyfix: spun for 50000000\n");
+ mask = pmap->pm_active;
}
}
@@ -1968,7 +1994,7 @@ pmap_lazyfix(pmap_t pmap)
cr3 = vtophys(pmap->pm_pdir);
if (cr3 == rcr3()) {
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
- pmap->pm_active &= ~(PCPU_GET(cpumask));
+ CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active);
}
}
#endif /* SMP */
@@ -5078,11 +5104,11 @@ pmap_activate(struct thread *td)
pmap = vmspace_pmap(td->td_proc->p_vmspace);
oldpmap = PCPU_GET(curpmap);
#if defined(SMP)
- atomic_clear_int(&oldpmap->pm_active, PCPU_GET(cpumask));
- atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask));
+ CPU_NAND_ATOMIC(&oldpmap->pm_active, PCPU_PTR(cpumask));
+ CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask));
#else
- oldpmap->pm_active &= ~1;
- pmap->pm_active |= 1;
+ CPU_NAND(&oldpmap->pm_active, PCPU_PTR(cpumask));
+ CPU_OR(&pmap->pm_active, PCPU_PTR(cpumask));
#endif
#ifdef PAE
cr3 = vtophys(pmap->pm_pdpt);
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index 232e1a1..a084e09 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -573,11 +573,13 @@ kvtop(void *addr)
static void
cpu_reset_proxy()
{
+ cpuset_t tcrp;
cpu_reset_proxy_active = 1;
while (cpu_reset_proxy_active == 1)
; /* Wait for other cpu to see that we've started */
- stop_cpus((1<<cpu_reset_proxyid));
+ CPU_SETOF(cpu_reset_proxyid, &tcrp);
+ stop_cpus(tcrp);
printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid);
DELAY(1000000);
cpu_reset_real();
@@ -596,25 +598,29 @@ cpu_reset()
#endif
#ifdef SMP
- cpumask_t map;
+ cpuset_t map;
u_int cnt;
if (smp_active) {
- map = PCPU_GET(other_cpus) & ~stopped_cpus;
- if (map != 0) {
+ sched_pin();
+ map = PCPU_GET(other_cpus);
+ CPU_NAND(&map, &stopped_cpus);
+ if (!CPU_EMPTY(&map)) {
printf("cpu_reset: Stopping other CPUs\n");
stop_cpus(map);
}
if (PCPU_GET(cpuid) != 0) {
cpu_reset_proxyid = PCPU_GET(cpuid);
+ sched_unpin();
cpustop_restartfunc = cpu_reset_proxy;
cpu_reset_proxy_active = 0;
printf("cpu_reset: Restarting BSP\n");
/* Restart CPU #0. */
/* XXX: restart_cpus(1 << 0); */
- atomic_store_rel_int(&started_cpus, (1 << 0));
+ CPU_SETOF(0, &started_cpus);
+ wmb();
cnt = 0;
while (cpu_reset_proxy_active == 0 && cnt < 10000000)
@@ -626,7 +632,8 @@ cpu_reset()
while (1);
/* NOTREACHED */
- }
+ } else
+ sched_unpin();
DELAY(1000000);
}
@@ -795,7 +802,7 @@ sf_buf_alloc(struct vm_page *m, int flags)
struct sf_head *hash_list;
struct sf_buf *sf;
#ifdef SMP
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
#endif
int error;
@@ -867,22 +874,23 @@ sf_buf_alloc(struct vm_page *m, int flags)
*/
#ifdef SMP
if ((opte & (PG_V | PG_A)) == (PG_V | PG_A))
- sf->cpumask = 0;
+ CPU_ZERO(&sf->cpumask);
shootdown:
sched_pin();
cpumask = PCPU_GET(cpumask);
- if ((sf->cpumask & cpumask) == 0) {
- sf->cpumask |= cpumask;
+ if (!CPU_OVERLAP(&cpumask, &sf->cpumask)) {
+ CPU_OR(&sf->cpumask, &cpumask);
invlpg(sf->kva);
}
if ((flags & SFB_CPUPRIVATE) == 0) {
- other_cpus = PCPU_GET(other_cpus) & ~sf->cpumask;
- if (other_cpus != 0) {
- sf->cpumask |= other_cpus;
+ other_cpus = PCPU_GET(other_cpus);
+ CPU_NAND(&other_cpus, &sf->cpumask);
+ if (!CPU_EMPTY(&other_cpus)) {
+ CPU_OR(&sf->cpumask, &other_cpus);
smp_masked_invlpg(other_cpus, sf->kva);
}
}
- sched_unpin();
+ sched_unpin();
#else
if ((opte & (PG_V | PG_A)) == (PG_V | PG_A))
pmap_invalidate_page(kernel_pmap, sf->kva);
diff --git a/sys/i386/include/_types.h b/sys/i386/include/_types.h
index 7a969fe..3194fd6 100644
--- a/sys/i386/include/_types.h
+++ b/sys/i386/include/_types.h
@@ -69,7 +69,6 @@ typedef unsigned long long __uint64_t;
* Standard type definitions.
*/
typedef unsigned long __clock_t; /* clock()... */
-typedef unsigned int __cpumask_t;
typedef __int32_t __critical_t;
typedef long double __double_t;
typedef long double __float_t;
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index eeada2e..3012a00 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -155,6 +155,7 @@
#ifndef LOCORE
#include <sys/queue.h>
+#include <sys/_cpuset.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
@@ -433,7 +434,7 @@ struct pmap {
struct mtx pm_mtx;
pd_entry_t *pm_pdir; /* KVA of page directory */
TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */
- cpumask_t pm_active; /* active on cpus */
+ cpuset_t pm_active; /* active on cpus */
struct pmap_statistics pm_stats; /* pmap statistics */
LIST_ENTRY(pmap) pm_list; /* List of all pmaps */
#ifdef PAE
diff --git a/sys/i386/include/sf_buf.h b/sys/i386/include/sf_buf.h
index 7bc1095..415dcbb 100644
--- a/sys/i386/include/sf_buf.h
+++ b/sys/i386/include/sf_buf.h
@@ -29,6 +29,7 @@
#ifndef _MACHINE_SF_BUF_H_
#define _MACHINE_SF_BUF_H_
+#include <sys/_cpuset.h>
#include <sys/queue.h>
struct vm_page;
@@ -40,7 +41,7 @@ struct sf_buf {
vm_offset_t kva; /* va of mapping */
int ref_count; /* usage of this mapping */
#ifdef SMP
- cpumask_t cpumask; /* cpus on which mapping is valid */
+ cpuset_t cpumask; /* cpus on which mapping is valid */
#endif
};
diff --git a/sys/i386/include/smp.h b/sys/i386/include/smp.h
index d364cd9..04d67c9 100644
--- a/sys/i386/include/smp.h
+++ b/sys/i386/include/smp.h
@@ -66,17 +66,16 @@ void ipi_bitmap_handler(struct trapframe frame);
#endif
void ipi_cpu(int cpu, u_int ipi);
int ipi_nmi_handler(void);
-void ipi_selected(cpumask_t cpus, u_int ipi);
+void ipi_selected(cpuset_t cpus, u_int ipi);
u_int mp_bootaddress(u_int);
-int mp_grab_cpu_hlt(void);
void smp_cache_flush(void);
void smp_invlpg(vm_offset_t addr);
-void smp_masked_invlpg(cpumask_t mask, vm_offset_t addr);
+void smp_masked_invlpg(cpuset_t mask, vm_offset_t addr);
void smp_invlpg_range(vm_offset_t startva, vm_offset_t endva);
-void smp_masked_invlpg_range(cpumask_t mask, vm_offset_t startva,
+void smp_masked_invlpg_range(cpuset_t mask, vm_offset_t startva,
vm_offset_t endva);
void smp_invltlb(void);
-void smp_masked_invltlb(cpumask_t mask);
+void smp_masked_invltlb(cpuset_t mask);
#ifdef XEN
void ipi_to_irq_init(void);
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c
index ae56990..ac641a8 100644
--- a/sys/i386/pci/pci_cfgreg.c
+++ b/sys/i386/pci/pci_cfgreg.c
@@ -553,7 +553,7 @@ pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus)
(uintmax_t)base);
#ifdef SMP
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu)
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu)
#endif
{
diff --git a/sys/i386/xen/mp_machdep.c b/sys/i386/xen/mp_machdep.c
index 2919570..2d05596 100644
--- a/sys/i386/xen/mp_machdep.c
+++ b/sys/i386/xen/mp_machdep.c
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/cons.h> /* cngetc() */
+#include <sys/cpuset.h>
#ifdef GPROF
#include <sys/gmon.h>
#endif
@@ -116,7 +117,7 @@ volatile int smp_tlb_wait;
typedef void call_data_func_t(uintptr_t , uintptr_t);
static u_int logical_cpus;
-static volatile cpumask_t ipi_nmi_pending;
+static volatile cpuset_t ipi_nmi_pending;
/* used to hold the AP's until we are ready to release them */
static struct mtx ap_boot_mtx;
@@ -149,7 +150,7 @@ static int start_ap(int apic_id);
static void release_aps(void *dummy);
static u_int hyperthreading_cpus;
-static cpumask_t hyperthreading_cpus_mask;
+static cpuset_t hyperthreading_cpus_mask;
extern void Xhypervisor_callback(void);
extern void failsafe_callback(void);
@@ -239,7 +240,7 @@ cpu_mp_probe(void)
* Always record BSP in CPU map so that the mbuf init code works
* correctly.
*/
- all_cpus = 1;
+ CPU_SETOF(0, &all_cpus);
if (mp_ncpus == 0) {
/*
* No CPUs were found, so this must be a UP system. Setup
@@ -293,7 +294,8 @@ cpu_mp_start(void)
start_all_aps();
/* Setup the initial logical CPUs info. */
- logical_cpus = logical_cpus_mask = 0;
+ logical_cpus = 0;
+ CPU_ZERO(&logical_cpus_mask);
if (cpu_feature & CPUID_HTT)
logical_cpus = (cpu_procinfo & CPUID_HTT_CORES) >> 16;
@@ -521,6 +523,7 @@ xen_smp_intr_init_cpus(void *unused)
void
init_secondary(void)
{
+ cpuset_t tcpuset, tallcpus;
vm_offset_t addr;
int gsel_tss;
@@ -600,18 +603,21 @@ init_secondary(void)
CTR1(KTR_SMP, "SMP: AP CPU #%d Launched", PCPU_GET(cpuid));
printf("SMP: AP CPU #%d Launched!\n", PCPU_GET(cpuid));
+ tcpuset = PCPU_GET(cpumask);
/* Determine if we are a logical CPU. */
if (logical_cpus > 1 && PCPU_GET(apic_id) % logical_cpus != 0)
- logical_cpus_mask |= PCPU_GET(cpumask);
+ CPU_OR(&logical_cpus_mask, &tcpuset);
/* Determine if we are a hyperthread. */
if (hyperthreading_cpus > 1 &&
PCPU_GET(apic_id) % hyperthreading_cpus != 0)
- hyperthreading_cpus_mask |= PCPU_GET(cpumask);
+ CPU_OR(&hyperthreading_cpus_mask, &tcpuset);
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
+ tallcpus = all_cpus;
+ CPU_NAND(&tallcpus, &tcpuset);
+ PCPU_SET(other_cpus, tallcpus);
#if 0
if (bootverbose)
lapic_dump("AP");
@@ -725,6 +731,7 @@ assign_cpu_ids(void)
int
start_all_aps(void)
{
+ cpuset_t tallcpus;
int x,apic_id, cpu;
struct pcpu *pc;
@@ -778,12 +785,14 @@ start_all_aps(void)
panic("bye-bye");
}
- all_cpus |= (1 << cpu); /* record AP in CPU map */
+ CPU_SET(cpu, &all_cpus); /* record AP in CPU map */
}
/* build our map of 'other' CPUs */
- PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
+ tallcpus = all_cpus;
+ CPU_NAND(&tallcpus, PCPU_PTR(cpumask));
+ PCPU_SET(other_cpus, tallcpus);
pmap_invalidate_range(kernel_pmap, 0, NKPT * NBPDR - 1);
@@ -1012,29 +1021,20 @@ smp_tlb_shootdown(u_int vector, vm_offset_t addr1, vm_offset_t addr2)
}
static void
-smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2)
+smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2)
{
- int ncpu, othercpus;
+ int cpu, ncpu, othercpus;
struct _call_data data;
othercpus = mp_ncpus - 1;
- if (mask == (u_int)-1) {
- ncpu = othercpus;
- if (ncpu < 1)
+ if (CPU_ISFULLSET(&mask)) {
+ if (othercpus < 1)
return;
} else {
- mask &= ~PCPU_GET(cpumask);
- if (mask == 0)
- return;
- ncpu = bitcount32(mask);
- if (ncpu > othercpus) {
- /* XXX this should be a panic offence */
- printf("SMP: tlb shootdown to %d other cpus (only have %d)\n",
- ncpu, othercpus);
- ncpu = othercpus;
- }
- /* XXX should be a panic, implied by mask == 0 above */
- if (ncpu < 1)
+ critical_enter();
+ CPU_NAND(&mask, PCPU_PTR(cpumask));
+ critical_exit();
+ if (CPU_EMPTY(&mask))
return;
}
if (!(read_eflags() & PSL_I))
@@ -1046,10 +1046,20 @@ smp_targeted_tlb_shootdown(cpumask_t mask, u_int vector, vm_offset_t addr1, vm_o
call_data->arg1 = addr1;
call_data->arg2 = addr2;
atomic_store_rel_int(&smp_tlb_wait, 0);
- if (mask == (u_int)-1)
+ if (CPU_ISFULLSET(&mask)) {
+ ncpu = othercpus;
ipi_all_but_self(vector);
- else
- ipi_selected(mask, vector);
+ } else {
+ ncpu = 0;
+ while ((cpu = cpusetobj_ffs(&mask)) != 0) {
+ cpu--;
+ CPU_CLR(cpu, &mask);
+ CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu,
+ vector);
+ ipi_send_cpu(cpu, vector);
+ ncpu++;
+ }
+ }
while (smp_tlb_wait < ncpu)
ia32_pause();
call_data = NULL;
@@ -1092,7 +1102,7 @@ smp_invlpg_range(vm_offset_t addr1, vm_offset_t addr2)
}
void
-smp_masked_invltlb(cpumask_t mask)
+smp_masked_invltlb(cpuset_t mask)
{
if (smp_started) {
@@ -1101,7 +1111,7 @@ smp_masked_invltlb(cpumask_t mask)
}
void
-smp_masked_invlpg(cpumask_t mask, vm_offset_t addr)
+smp_masked_invlpg(cpuset_t mask, vm_offset_t addr)
{
if (smp_started) {
@@ -1110,7 +1120,7 @@ smp_masked_invlpg(cpumask_t mask, vm_offset_t addr)
}
void
-smp_masked_invlpg_range(cpumask_t mask, vm_offset_t addr1, vm_offset_t addr2)
+smp_masked_invlpg_range(cpuset_t mask, vm_offset_t addr1, vm_offset_t addr2)
{
if (smp_started) {
@@ -1122,7 +1132,7 @@ smp_masked_invlpg_range(cpumask_t mask, vm_offset_t addr1, vm_offset_t addr2)
* send an IPI to a set of cpus.
*/
void
-ipi_selected(cpumask_t cpus, u_int ipi)
+ipi_selected(cpuset_t cpus, u_int ipi)
{
int cpu;
@@ -1132,11 +1142,11 @@ ipi_selected(cpumask_t cpus, u_int ipi)
* Set the mask of receiving CPUs for this purpose.
*/
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, cpus);
+ CPU_OR_ATOMIC(&ipi_nmi_pending, &cpus);
- while ((cpu = ffs(cpus)) != 0) {
+ while ((cpu = cpusetobj_ffs(&cpus)) != 0) {
cpu--;
- cpus &= ~(1 << cpu);
+ CPU_CLR(cpu, &cpus);
CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi);
ipi_send_cpu(cpu, ipi);
}
@@ -1155,7 +1165,7 @@ ipi_cpu(int cpu, u_int ipi)
* Set the mask of receiving CPUs for this purpose.
*/
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, 1 << cpu);
+ CPU_SET_ATOMIC(cpu, &ipi_nmi_pending);
CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi);
ipi_send_cpu(cpu, ipi);
@@ -1167,23 +1177,27 @@ ipi_cpu(int cpu, u_int ipi)
void
ipi_all_but_self(u_int ipi)
{
+ cpuset_t other_cpus;
/*
* IPI_STOP_HARD maps to a NMI and the trap handler needs a bit
* of help in order to understand what is the source.
* Set the mask of receiving CPUs for this purpose.
*/
+ sched_pin();
+ other_cpus = PCPU_GET(other_cpus);
+ sched_unpin();
if (ipi == IPI_STOP_HARD)
- atomic_set_int(&ipi_nmi_pending, PCPU_GET(other_cpus));
+ CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus);
CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi);
- ipi_selected(PCPU_GET(other_cpus), ipi);
+ ipi_selected(other_cpus, ipi);
}
int
ipi_nmi_handler()
{
- cpumask_t cpumask;
+ cpuset_t cpumask;
/*
* As long as there is not a simple way to know about a NMI's
@@ -1191,11 +1205,13 @@ ipi_nmi_handler()
* the global pending bitword an IPI_STOP_HARD has been issued
* and should be handled.
*/
+ sched_pin();
cpumask = PCPU_GET(cpumask);
- if ((ipi_nmi_pending & cpumask) == 0)
+ sched_unpin();
+ if (!CPU_OVERLAP(&ipi_nmi_pending, &cpumask))
return (1);
- atomic_clear_int(&ipi_nmi_pending, cpumask);
+ CPU_NAND_ATOMIC(&ipi_nmi_pending, &cpumask);
cpustop_handler();
return (0);
}
@@ -1207,20 +1223,25 @@ ipi_nmi_handler()
void
cpustop_handler(void)
{
- int cpu = PCPU_GET(cpuid);
- int cpumask = PCPU_GET(cpumask);
+ cpuset_t cpumask;
+ int cpu;
+
+ sched_pin();
+ cpumask = PCPU_GET(cpumask);
+ cpu = PCPU_GET(cpuid);
+ sched_unpin();
savectx(&stoppcbs[cpu]);
/* Indicate that we are stopped */
- atomic_set_int(&stopped_cpus, cpumask);
+ CPU_OR_ATOMIC(&stopped_cpus, &cpumask);
/* Wait for restart */
- while (!(started_cpus & cpumask))
+ while (!CPU_OVERLAP(&started_cpus, &cpumask))
ia32_pause();
- atomic_clear_int(&started_cpus, cpumask);
- atomic_clear_int(&stopped_cpus, cpumask);
+ CPU_NAND_ATOMIC(&started_cpus, &cpumask);
+ CPU_NAND_ATOMIC(&stopped_cpus, &cpumask);
if (cpu == 0 && cpustop_restartfunc != NULL) {
cpustop_restartfunc();
diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c
index eb3c803..3efa4f1 100644
--- a/sys/i386/xen/pmap.c
+++ b/sys/i386/xen/pmap.c
@@ -422,7 +422,7 @@ pmap_bootstrap(vm_paddr_t firstaddr)
#ifdef PAE
kernel_pmap->pm_pdpt = (pdpt_entry_t *) (KERNBASE + (u_int)IdlePDPT);
#endif
- kernel_pmap->pm_active = -1; /* don't allow deactivation */
+ CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvchunk);
LIST_INIT(&allpmaps);
mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_SPIN);
@@ -802,22 +802,23 @@ pmap_cache_bits(int mode, boolean_t is_pde)
void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
CTR2(KTR_PMAP, "pmap_invalidate_page: pmap=%p va=0x%x",
pmap, va);
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
invlpg(va);
smp_invlpg(va);
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
invlpg(va);
- if (pmap->pm_active & other_cpus)
- smp_masked_invlpg(pmap->pm_active & other_cpus, va);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invlpg(other_cpus, va);
}
sched_unpin();
PT_UPDATES_FLUSH();
@@ -826,26 +827,26 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
void
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
vm_offset_t addr;
CTR3(KTR_PMAP, "pmap_invalidate_page: pmap=%p eva=0x%x sva=0x%x",
pmap, sva, eva);
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
smp_invlpg_range(sva, eva);
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
- if (pmap->pm_active & other_cpus)
- smp_masked_invlpg_range(pmap->pm_active & other_cpus,
- sva, eva);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invlpg_range(other_cpus, sva, eva);
}
sched_unpin();
PT_UPDATES_FLUSH();
@@ -854,21 +855,22 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
void
pmap_invalidate_all(pmap_t pmap)
{
- cpumask_t cpumask, other_cpus;
+ cpuset_t cpumask, other_cpus;
CTR1(KTR_PMAP, "pmap_invalidate_page: pmap=%p", pmap);
sched_pin();
- if (pmap == kernel_pmap || pmap->pm_active == all_cpus) {
+ if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
invltlb();
smp_invltlb();
} else {
cpumask = PCPU_GET(cpumask);
other_cpus = PCPU_GET(other_cpus);
- if (pmap->pm_active & cpumask)
+ if (CPU_OVERLAP(&pmap->pm_active, &cpumask))
invltlb();
- if (pmap->pm_active & other_cpus)
- smp_masked_invltlb(pmap->pm_active & other_cpus);
+ CPU_AND(&other_cpus, &pmap->pm_active);
+ if (!CPU_EMPTY(&other_cpus))
+ smp_masked_invltlb(other_cpus);
}
sched_unpin();
}
@@ -893,7 +895,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
CTR2(KTR_PMAP, "pmap_invalidate_page: pmap=%p va=0x%x",
pmap, va);
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
invlpg(va);
PT_UPDATES_FLUSH();
}
@@ -907,7 +909,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
CTR3(KTR_PMAP, "pmap_invalidate_range: pmap=%p sva=0x%x eva=0x%x",
pmap, sva, eva);
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
PT_UPDATES_FLUSH();
@@ -919,7 +921,7 @@ pmap_invalidate_all(pmap_t pmap)
CTR1(KTR_PMAP, "pmap_invalidate_all: pmap=%p", pmap);
- if (pmap == kernel_pmap || pmap->pm_active)
+ if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
invltlb();
}
@@ -1449,7 +1451,7 @@ pmap_pinit0(pmap_t pmap)
#ifdef PAE
pmap->pm_pdpt = (pdpt_entry_t *)(KERNBASE + (vm_offset_t)IdlePDPT);
#endif
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
PCPU_SET(curpmap, pmap);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
@@ -1556,7 +1558,7 @@ pmap_pinit(pmap_t pmap)
}
xen_flush_queue();
vm_page_unlock_queues();
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
@@ -1686,7 +1688,7 @@ retry:
* Deal with a SMP shootdown of other users of the pmap that we are
* trying to dispose of. This can be a bit hairy.
*/
-static cpumask_t *lazymask;
+static cpuset_t *lazymask;
static u_int lazyptd;
static volatile u_int lazywait;
@@ -1695,36 +1697,42 @@ void pmap_lazyfix_action(void);
void
pmap_lazyfix_action(void)
{
- cpumask_t mymask = PCPU_GET(cpumask);
#ifdef COUNT_IPIS
(*ipi_lazypmap_counts[PCPU_GET(cpuid)])++;
#endif
if (rcr3() == lazyptd)
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
- atomic_clear_int(lazymask, mymask);
+ CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask);
atomic_store_rel_int(&lazywait, 1);
}
static void
-pmap_lazyfix_self(cpumask_t mymask)
+pmap_lazyfix_self(cpuset_t mymask)
{
if (rcr3() == lazyptd)
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
- atomic_clear_int(lazymask, mymask);
+ CPU_NAND_ATOMIC(lazymask, &mymask);
}
static void
pmap_lazyfix(pmap_t pmap)
{
- cpumask_t mymask, mask;
+ cpuset_t mymask, mask;
u_int spins;
+ int lsb;
- while ((mask = pmap->pm_active) != 0) {
+ mask = pmap->pm_active;
+ while (!CPU_EMPTY(&mask)) {
spins = 50000000;
- mask = mask & -mask; /* Find least significant set bit */
+
+ /* Find least significant set bit. */
+ lsb = cpusetobj_ffs(&mask);
+ MPASS(lsb != 0);
+ lsb--;
+ CPU_SETOF(lsb, &mask);
mtx_lock_spin(&smp_ipi_mtx);
#ifdef PAE
lazyptd = vtophys(pmap->pm_pdpt);
@@ -1732,7 +1740,7 @@ pmap_lazyfix(pmap_t pmap)
lazyptd = vtophys(pmap->pm_pdir);
#endif
mymask = PCPU_GET(cpumask);
- if (mask == mymask) {
+ if (!CPU_CMP(&mask, &mymask)) {
lazymask = &pmap->pm_active;
pmap_lazyfix_self(mymask);
} else {
@@ -1749,6 +1757,7 @@ pmap_lazyfix(pmap_t pmap)
mtx_unlock_spin(&smp_ipi_mtx);
if (spins == 0)
printf("pmap_lazyfix: spun for 50000000\n");
+ mask = pmap->pm_active;
}
}
@@ -1768,7 +1777,7 @@ pmap_lazyfix(pmap_t pmap)
cr3 = vtophys(pmap->pm_pdir);
if (cr3 == rcr3()) {
load_cr3(PCPU_GET(curpcb)->pcb_cr3);
- pmap->pm_active &= ~(PCPU_GET(cpumask));
+ CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active);
}
}
#endif /* SMP */
@@ -4123,11 +4132,11 @@ pmap_activate(struct thread *td)
pmap = vmspace_pmap(td->td_proc->p_vmspace);
oldpmap = PCPU_GET(curpmap);
#if defined(SMP)
- atomic_clear_int(&oldpmap->pm_active, PCPU_GET(cpumask));
- atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask));
+ CPU_NAND_ATOMIC(&oldpmap->pm_active, PCPU_PTR(cpumask));
+ CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask));
#else
- oldpmap->pm_active &= ~1;
- pmap->pm_active |= 1;
+ CPU_NAND(&oldpmap->pm_active, PCPU_PTR(cpumask));
+ CPU_OR(&pmap->pm_active, PCPU_PTR(cpumask));
#endif
#ifdef PAE
cr3 = vtophys(pmap->pm_pdpt);
diff --git a/sys/ia64/acpica/acpi_machdep.c b/sys/ia64/acpica/acpi_machdep.c
index b7b612f..1466cfe 100644
--- a/sys/ia64/acpica/acpi_machdep.c
+++ b/sys/ia64/acpica/acpi_machdep.c
@@ -56,7 +56,14 @@ acpi_machdep_quirks(int *quirks)
void
acpi_cpu_c1()
{
+#ifdef INVARIANTS
+ register_t ie;
+
+ ie = intr_disable();
+ KASSERT(ie == 0, ("%s called with interrupts enabled\n", __func__));
+#endif
ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0);
+ ia64_enable_intr();
}
void *
diff --git a/sys/ia64/ia64/busdma_machdep.c b/sys/ia64/ia64/busdma_machdep.c
index 7554d31..d7152df 100644
--- a/sys/ia64/ia64/busdma_machdep.c
+++ b/sys/ia64/ia64/busdma_machdep.c
@@ -51,21 +51,21 @@ __FBSDID("$FreeBSD$");
#define MAX_BPAGES 1024
struct bus_dma_tag {
- bus_dma_tag_t parent;
- bus_size_t alignment;
- bus_size_t boundary;
- bus_addr_t lowaddr;
- bus_addr_t highaddr;
+ bus_dma_tag_t parent;
+ bus_size_t alignment;
+ bus_size_t boundary;
+ bus_addr_t lowaddr;
+ bus_addr_t highaddr;
bus_dma_filter_t *filter;
- void *filterarg;
- bus_size_t maxsize;
- u_int nsegments;
- bus_size_t maxsegsz;
- int flags;
- int ref_count;
- int map_count;
- bus_dma_lock_t *lockfunc;
- void *lockfuncarg;
+ void *filterarg;
+ bus_size_t maxsize;
+ u_int nsegments;
+ bus_size_t maxsegsz;
+ int flags;
+ int ref_count;
+ int map_count;
+ bus_dma_lock_t *lockfunc;
+ void *lockfuncarg;
bus_dma_segment_t *segments;
};
@@ -90,27 +90,27 @@ static int total_deferred;
SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters");
SYSCTL_INT(_hw_busdma, OID_AUTO, free_bpages, CTLFLAG_RD, &free_bpages, 0,
- "Free bounce pages");
+ "Free bounce pages");
SYSCTL_INT(_hw_busdma, OID_AUTO, reserved_bpages, CTLFLAG_RD, &reserved_bpages,
- 0, "Reserved bounce pages");
+ 0, "Reserved bounce pages");
SYSCTL_INT(_hw_busdma, OID_AUTO, active_bpages, CTLFLAG_RD, &active_bpages, 0,
- "Active bounce pages");
+ "Active bounce pages");
SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0,
- "Total bounce pages");
+ "Total bounce pages");
SYSCTL_INT(_hw_busdma, OID_AUTO, total_bounced, CTLFLAG_RD, &total_bounced, 0,
- "Total bounce requests");
-SYSCTL_INT(_hw_busdma, OID_AUTO, total_deferred, CTLFLAG_RD, &total_deferred, 0,
- "Total bounce requests that were deferred");
+ "Total bounce requests");
+SYSCTL_INT(_hw_busdma, OID_AUTO, total_deferred, CTLFLAG_RD, &total_deferred,
+ 0, "Total bounce requests that were deferred");
struct bus_dmamap {
- struct bp_list bpages;
- int pagesneeded;
- int pagesreserved;
- bus_dma_tag_t dmat;
- void *buf; /* unmapped buffer pointer */
- bus_size_t buflen; /* unmapped buffer length */
+ struct bp_list bpages;
+ int pagesneeded;
+ int pagesreserved;
+ bus_dma_tag_t dmat;
+ void *buf; /* unmapped buffer pointer */
+ bus_size_t buflen; /* unmapped buffer length */
bus_dmamap_callback_t *callback;
- void *callback_arg;
+ void *callback_arg;
STAILQ_ENTRY(bus_dmamap) links;
};
@@ -121,12 +121,12 @@ static struct bus_dmamap nobounce_dmamap;
static void init_bounce_pages(void *dummy);
static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages);
static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
- int commit);
+ int commit);
static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map,
- vm_offset_t vaddr, bus_size_t size);
+ vm_offset_t vaddr, bus_size_t size);
static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr,
- bus_size_t len);
+ bus_size_t len);
/*
* Return true if a match is made.
@@ -144,16 +144,14 @@ run_filter(bus_dma_tag_t dmat, bus_addr_t paddr, bus_size_t len)
retval = 0;
bndy = dmat->boundary;
-
do {
- if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr)
- || ((paddr & (dmat->alignment - 1)) != 0)
- || ((paddr & bndy) != ((paddr + len) & bndy)))
- && (dmat->filter == NULL
- || (*dmat->filter)(dmat->filterarg, paddr) != 0))
+ if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) ||
+ (paddr & (dmat->alignment - 1)) != 0 ||
+ (paddr & bndy) != ((paddr + len) & bndy)) &&
+ (dmat->filter == NULL ||
+ (*dmat->filter)(dmat->filterarg, paddr) != 0))
retval = 1;
-
- dmat = dmat->parent;
+ dmat = dmat->parent;
} while (retval == 0 && dmat != NULL);
return (retval);
}
@@ -195,16 +193,16 @@ dflt_lock(void *arg, bus_dma_lock_op_t op)
}
#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4
+
/*
* Allocate a device specific dma_tag.
*/
int
bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
- bus_size_t boundary, bus_addr_t lowaddr,
- bus_addr_t highaddr, bus_dma_filter_t *filter,
- void *filterarg, bus_size_t maxsize, int nsegments,
- bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
- void *lockfuncarg, bus_dma_tag_t *dmat)
+ bus_size_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
+ bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
+ int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
+ void *lockfuncarg, bus_dma_tag_t *dmat)
{
bus_dma_tag_t newtag;
int error = 0;
@@ -250,7 +248,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
newtag->boundary = parent->boundary;
else if (parent->boundary != 0)
newtag->boundary = MIN(parent->boundary,
- newtag->boundary);
+ newtag->boundary);
if (newtag->filter == NULL) {
/*
* Short circuit looking at our parent directly
@@ -279,7 +277,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
/* Performed initial allocation */
newtag->flags |= BUS_DMA_MIN_ALLOC_COMP;
}
-
+
if (error != 0) {
free(newtag, M_DEVBUF);
} else {
@@ -347,7 +345,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
int maxpages;
*mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF,
- M_NOWAIT | M_ZERO);
+ M_NOWAIT | M_ZERO);
if (*mapp == NULL)
return (ENOMEM);
@@ -408,7 +406,7 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map)
*/
int
bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
- bus_dmamap_t *mapp)
+ bus_dmamap_t *mapp)
{
int mflags;
@@ -430,7 +428,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
if (flags & BUS_DMA_ZERO)
mflags |= M_ZERO;
- /*
+ /*
* XXX:
* (dmat->alignment < dmat->maxsize) is just a quick hack; the exact
* alignment guarantees of malloc need to be nailed down, and the
@@ -489,15 +487,9 @@ bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
* first indicates if this is the first invocation of this function.
*/
static int
-_bus_dmamap_load_buffer(bus_dma_tag_t dmat,
- bus_dmamap_t map,
- void *buf, bus_size_t buflen,
- struct thread *td,
- int flags,
- bus_addr_t *lastaddrp,
- bus_dma_segment_t *segs,
- int *segp,
- int first)
+_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
+ bus_size_t buflen, struct thread *td, int flags, bus_addr_t *lastaddrp,
+ bus_dma_segment_t *segs, int *segp, int first)
{
bus_size_t sgsize;
bus_addr_t curaddr, lastaddr, baddr, bmask;
@@ -607,7 +599,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
if (curaddr == lastaddr &&
(segs[seg].ds_len + sgsize) <= dmat->maxsegsz &&
(dmat->boundary == 0 ||
- (segs[seg].ds_addr & bmask) == (curaddr & bmask)))
+ (segs[seg].ds_addr & bmask) == (curaddr & bmask)))
segs[seg].ds_len += sgsize;
else {
if (++seg >= dmat->nsegments)
@@ -636,11 +628,11 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dmat,
*/
int
bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
- bus_size_t buflen, bus_dmamap_callback_t *callback,
- void *callback_arg, int flags)
+ bus_size_t buflen, bus_dmamap_callback_t *callback, void *callback_arg,
+ int flags)
{
- bus_addr_t lastaddr = 0;
- int error, nsegs = 0;
+ bus_addr_t lastaddr = 0;
+ int error, nsegs = 0;
if (map != NULL) {
flags |= BUS_DMA_WAITOK;
@@ -666,10 +658,8 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
* Like _bus_dmamap_load(), but for mbufs.
*/
int
-bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map,
- struct mbuf *m0,
- bus_dmamap_callback2_t *callback, void *callback_arg,
- int flags)
+bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
+ bus_dmamap_callback2_t *callback, void *callback_arg, int flags)
{
int nsegs, error;
@@ -686,9 +676,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map,
for (m = m0; m != NULL && error == 0; m = m->m_next) {
if (m->m_len > 0) {
error = _bus_dmamap_load_buffer(dmat, map,
- m->m_data, m->m_len,
- NULL, flags, &lastaddr,
- dmat->segments, &nsegs, first);
+ m->m_data, m->m_len, NULL, flags,
+ &lastaddr, dmat->segments, &nsegs, first);
first = 0;
}
}
@@ -707,9 +696,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map,
}
int
-bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
- struct mbuf *m0, bus_dma_segment_t *segs,
- int *nsegs, int flags)
+bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
+ bus_dma_segment_t *segs, int *nsegs, int flags)
{
int error;
@@ -726,9 +714,8 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
for (m = m0; m != NULL && error == 0; m = m->m_next) {
if (m->m_len > 0) {
error = _bus_dmamap_load_buffer(dmat, map,
- m->m_data, m->m_len,
- NULL, flags, &lastaddr,
- segs, nsegs, first);
+ m->m_data, m->m_len, NULL, flags,
+ &lastaddr, segs, nsegs, first);
first = 0;
}
}
@@ -744,10 +731,8 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
* Like _bus_dmamap_load(), but for uios.
*/
int
-bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map,
- struct uio *uio,
- bus_dmamap_callback2_t *callback, void *callback_arg,
- int flags)
+bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio,
+ bus_dmamap_callback2_t *callback, void *callback_arg, int flags)
{
bus_addr_t lastaddr;
int nsegs, error, first, i;
@@ -826,8 +811,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
if (op & BUS_DMASYNC_PREWRITE) {
while (bpage != NULL) {
bcopy((void *)bpage->datavaddr,
- (void *)bpage->vaddr,
- bpage->datacount);
+ (void *)bpage->vaddr, bpage->datacount);
bpage = STAILQ_NEXT(bpage, links);
}
total_bounced++;
@@ -836,8 +820,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
if (op & BUS_DMASYNC_POSTREAD) {
while (bpage != NULL) {
bcopy((void *)bpage->vaddr,
- (void *)bpage->datavaddr,
- bpage->datacount);
+ (void *)bpage->datavaddr, bpage->datacount);
bpage = STAILQ_NEXT(bpage, links);
}
total_bounced++;
@@ -870,15 +853,11 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages)
struct bounce_page *bpage;
bpage = (struct bounce_page *)malloc(sizeof(*bpage), M_DEVBUF,
- M_NOWAIT | M_ZERO);
-
+ M_NOWAIT | M_ZERO);
if (bpage == NULL)
break;
bpage->vaddr = (vm_offset_t)contigmalloc(PAGE_SIZE, M_DEVBUF,
- M_NOWAIT, 0ul,
- dmat->lowaddr,
- PAGE_SIZE,
- dmat->boundary);
+ M_NOWAIT, 0ul, dmat->lowaddr, PAGE_SIZE, dmat->boundary);
if (bpage->vaddr == 0) {
free(bpage, M_DEVBUF);
break;
@@ -914,7 +893,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, int commit)
static bus_addr_t
add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr,
- bus_size_t size)
+ bus_size_t size)
{
struct bounce_page *bpage;
@@ -974,8 +953,8 @@ free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage)
if ((map = STAILQ_FIRST(&bounce_map_waitinglist)) != NULL) {
if (reserve_bounce_pages(map->dmat, map, 1) == 0) {
STAILQ_REMOVE_HEAD(&bounce_map_waitinglist, links);
- STAILQ_INSERT_TAIL(&bounce_map_callbacklist,
- map, links);
+ STAILQ_INSERT_TAIL(&bounce_map_callbacklist, map,
+ links);
busdma_swi_pending = 1;
total_deferred++;
swi_sched(vm_ih, 0);
@@ -997,7 +976,7 @@ busdma_swi(void)
dmat = map->dmat;
(dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_LOCK);
bus_dmamap_load(map->dmat, map, map->buf, map->buflen,
- map->callback, map->callback_arg, /*flags*/0);
+ map->callback, map->callback_arg, /*flags*/0);
(dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_UNLOCK);
mtx_lock(&bounce_lock);
}
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index 41d2211..f3105fc 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -232,6 +232,9 @@ identifycpu(void)
case 0x00:
model_name = "Montecito";
break;
+ case 0x01:
+ model_name = "Montvale";
+ break;
}
break;
}
@@ -316,7 +319,7 @@ cpu_startup(void *dummy)
/*
* Create sysctl tree for per-CPU information.
*/
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
snprintf(nodename, sizeof(nodename), "%u", pc->pc_cpuid);
sysctl_ctx_init(&pc->pc_md.sysctl_ctx);
pc->pc_md.sysctl_tree = SYSCTL_ADD_NODE(&pc->pc_md.sysctl_ctx,
@@ -411,12 +414,34 @@ cpu_halt()
void
cpu_idle(int busy)
{
- struct ia64_pal_result res;
+ register_t ie;
- if (cpu_idle_hook != NULL)
+#if 0
+ if (!busy) {
+ critical_enter();
+ cpu_idleclock();
+ }
+#endif
+
+ ie = intr_disable();
+ KASSERT(ie != 0, ("%s called with interrupts disabled\n", __func__));
+
+ if (sched_runnable())
+ ia64_enable_intr();
+ else if (cpu_idle_hook != NULL) {
(*cpu_idle_hook)();
- else
- res = ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0);
+ /* The hook must enable interrupts! */
+ } else {
+ ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0);
+ ia64_enable_intr();
+ }
+
+#if 0
+ if (!busy) {
+ cpu_activeclock();
+ critical_exit();
+ }
+#endif
}
int
@@ -644,9 +669,12 @@ calculate_frequencies(void)
{
struct ia64_sal_result sal;
struct ia64_pal_result pal;
+ register_t ie;
+ ie = intr_disable();
sal = ia64_sal_entry(SAL_FREQ_BASE, 0, 0, 0, 0, 0, 0, 0);
pal = ia64_call_pal_static(PAL_FREQ_RATIOS, 0, 0, 0);
+ intr_restore(ie);
if (sal.sal_status == 0 && pal.pal_status == 0) {
if (bootverbose) {
@@ -761,6 +789,8 @@ ia64_init(void)
ia64_sal_init();
calculate_frequencies();
+ set_cputicker(ia64_get_itc, (u_long)itc_freq * 1000000, 0);
+
/*
* Setup the PCPU data for the bootstrap processor. It is needed
* by printf(). Also, since printf() has critical sections, we
diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c
index 5804f8c..15afea0 100644
--- a/sys/ia64/ia64/mp_machdep.c
+++ b/sys/ia64/ia64/mp_machdep.c
@@ -139,18 +139,18 @@ ia64_ih_rndzvs(struct thread *td, u_int xiv, struct trapframe *tf)
static u_int
ia64_ih_stop(struct thread *td, u_int xiv, struct trapframe *tf)
{
- cpumask_t mybit;
+ cpuset_t mybit;
PCPU_INC(md.stats.pcs_nstops);
mybit = PCPU_GET(cpumask);
savectx(PCPU_PTR(md.pcb));
- atomic_set_int(&stopped_cpus, mybit);
- while ((started_cpus & mybit) == 0)
+ CPU_OR_ATOMIC(&stopped_cpus, &mybit);
+ while (!CPU_OVERLAP(&started_cpus, &mybit))
cpu_spinwait();
- atomic_clear_int(&started_cpus, mybit);
- atomic_clear_int(&stopped_cpus, mybit);
+ CPU_NAND_ATOMIC(&started_cpus, &mybit);
+ CPU_NAND_ATOMIC(&stopped_cpus, &mybit);
return (0);
}
@@ -286,7 +286,7 @@ cpu_mp_add(u_int acpi_id, u_int id, u_int eid)
cpuid = (IA64_LID_GET_SAPIC_ID(ia64_get_lid()) == sapic_id)
? 0 : smp_cpus++;
- KASSERT((all_cpus & (1UL << cpuid)) == 0,
+ KASSERT(!CPU_ISSET(cpuid, &all_cpus),
("%s: cpu%d already in CPU map", __func__, acpi_id));
if (cpuid != 0) {
@@ -300,7 +300,7 @@ cpu_mp_add(u_int acpi_id, u_int id, u_int eid)
pc->pc_acpi_id = acpi_id;
pc->pc_md.lid = IA64_LID_SET_SAPIC_ID(sapic_id);
- all_cpus |= (1UL << pc->pc_cpuid);
+ CPU_SET(pc->pc_cpuid, &all_cpus);
}
void
@@ -357,9 +357,10 @@ cpu_mp_start()
/* Keep 'em spinning until we unleash them... */
ia64_ap_state.as_spin = 1;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
pc->pc_md.current_pmap = kernel_pmap;
- pc->pc_other_cpus = all_cpus & ~pc->pc_cpumask;
+ pc->pc_other_cpus = all_cpus;
+ CPU_NAND(&pc->pc_other_cpus, &pc->pc_cpumask);
/* The BSP is obviously running already. */
if (pc->pc_cpuid == 0) {
pc->pc_md.awake = 1;
@@ -424,7 +425,7 @@ cpu_mp_unleash(void *dummy)
cpus = 0;
smp_cpus = 0;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
cpus++;
if (pc->pc_md.awake) {
kproc_create(ia64_store_mca_state, pc, NULL, 0, 0,
@@ -458,12 +459,12 @@ cpu_mp_unleash(void *dummy)
* send an IPI to a set of cpus.
*/
void
-ipi_selected(cpumask_t cpus, int ipi)
+ipi_selected(cpuset_t cpus, int ipi)
{
struct pcpu *pc;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
- if (cpus & pc->pc_cpumask)
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
+ if (CPU_OVERLAP(&cpus, &pc->pc_cpumask))
ipi_send(pc, ipi);
}
}
@@ -486,7 +487,7 @@ ipi_all_but_self(int ipi)
{
struct pcpu *pc;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
if (pc != pcpup)
ipi_send(pc, ipi);
}
diff --git a/sys/ia64/ia64/pal.S b/sys/ia64/ia64/pal.S
index 2f0d0da..2e3f4cd 100644
--- a/sys/ia64/ia64/pal.S
+++ b/sys/ia64/ia64/pal.S
@@ -38,43 +38,40 @@ ia64_pal_entry: .quad 0
* u_int64_t arg1, u_int64_t arg2, u_int64_t arg3)
*/
ENTRY(ia64_call_pal_static, 4)
-
- .regstk 4,5,0,0
+
+ .regstk 4,4,0,0
palret = loc0
entry = loc1
rpsave = loc2
pfssave = loc3
-psrsave = loc4
- alloc pfssave=ar.pfs,4,5,0,0
+ alloc pfssave=ar.pfs,4,4,0,0
;;
mov rpsave=rp
-
movl entry=@gprel(ia64_pal_entry)
+
1: mov palret=ip // for return address
;;
add entry=entry,gp
- mov psrsave=psr
+ add palret=2f-1b,palret // calculate return address
mov r28=in0 // procedure number
- ;;
- ld8 entry=[entry] // read entry point
mov r29=in1 // copy arguments
mov r30=in2
mov r31=in3
;;
- mov b6=entry
- add palret=2f-1b,palret // calculate return address
- ;;
+ ld8 entry=[entry] // read entry point
mov b0=palret
- rsm psr.i // disable interrupts
+ ;;
+ mov b6=entry
;;
br.cond.sptk b6 // call into firmware
-2: mov psr.l=psrsave
+ ;;
+2:
mov rp=rpsave
mov ar.pfs=pfssave
;;
- srlz.d
br.ret.sptk rp
+ ;;
END(ia64_call_pal_static)
/*
diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c
index 5f10ad6..625d0af7 100644
--- a/sys/ia64/ia64/pmap.c
+++ b/sys/ia64/ia64/pmap.c
@@ -535,7 +535,7 @@ pmap_invalidate_page(vm_offset_t va)
critical_enter();
vhpt_ofs = ia64_thash(va) - PCPU_GET(md.vhpt);
tag = ia64_ttag(va);
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
pte = (struct ia64_lpte *)(pc->pc_md.vhpt + vhpt_ofs);
atomic_cmpset_64(&pte->tag, tag, 1UL << 63);
}
@@ -559,10 +559,14 @@ pmap_invalidate_page(vm_offset_t va)
} while (sem != tag);
ia64_ptc_ga(va, PAGE_SHIFT << 2);
+ ia64_mf();
+ ia64_srlz_i();
/* PTC.G leave exclusive */
atomic_store_rel_long(&pmap_ptc_g_sem, 0);
+ ia64_invala();
+
intr_restore(is);
critical_exit();
}
diff --git a/sys/ia64/include/_types.h b/sys/ia64/include/_types.h
index 8fc1be2..0c2f5cc 100644
--- a/sys/ia64/include/_types.h
+++ b/sys/ia64/include/_types.h
@@ -59,7 +59,6 @@ typedef unsigned long __uint64_t;
* Standard type definitions.
*/
typedef __int32_t __clock_t; /* clock()... */
-typedef unsigned int __cpumask_t;
typedef __int64_t __critical_t;
typedef double __double_t;
typedef float __float_t;
diff --git a/sys/ia64/include/ia64_cpu.h b/sys/ia64/include/ia64_cpu.h
index bb8284d..74e649b 100644
--- a/sys/ia64/include/ia64_cpu.h
+++ b/sys/ia64/include/ia64_cpu.h
@@ -266,7 +266,7 @@ ia64_ptc_e(uint64_t v)
static __inline void
ia64_ptc_g(uint64_t va, uint64_t log2size)
{
- __asm __volatile("ptc.g %0,%1;; srlz.i;;" :: "r"(va), "r"(log2size));
+ __asm __volatile("ptc.g %0,%1;;" :: "r"(va), "r"(log2size));
}
/*
@@ -275,7 +275,7 @@ ia64_ptc_g(uint64_t va, uint64_t log2size)
static __inline void
ia64_ptc_ga(uint64_t va, uint64_t log2size)
{
- __asm __volatile("ptc.ga %0,%1;; srlz.i;;" :: "r"(va), "r"(log2size));
+ __asm __volatile("ptc.ga %0,%1;;" :: "r"(va), "r"(log2size));
}
/*
@@ -288,6 +288,15 @@ ia64_ptc_l(uint64_t va, uint64_t log2size)
}
/*
+ * Invalidate the ALAT on the local processor.
+ */
+static __inline void
+ia64_invala(void)
+{
+ __asm __volatile("invala;;");
+}
+
+/*
* Unordered memory load.
*/
diff --git a/sys/ia64/include/smp.h b/sys/ia64/include/smp.h
index 26557a7..d2aff76 100644
--- a/sys/ia64/include/smp.h
+++ b/sys/ia64/include/smp.h
@@ -14,6 +14,8 @@
#ifndef LOCORE
+#include <sys/_cpuset.h>
+
struct pcpu;
struct ia64_ap_state {
@@ -44,7 +46,7 @@ extern int ia64_ipi_wakeup;
void ipi_all_but_self(int ipi);
void ipi_cpu(int cpu, u_int ipi);
-void ipi_selected(cpumask_t cpus, int ipi);
+void ipi_selected(cpuset_t cpus, int ipi);
void ipi_send(struct pcpu *, int ipi);
#endif /* !LOCORE */
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 2f889ca..3908da7 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -103,7 +103,7 @@ struct sysentvec aout_sysvec = {
#elif defined(__amd64__)
-#define AOUT32_USRSTACK 0xbfc0000
+#define AOUT32_USRSTACK 0xbfc00000
#define AOUT32_PS_STRINGS \
(AOUT32_USRSTACK - sizeof(struct freebsd32_ps_strings))
@@ -152,7 +152,7 @@ aout_fixup(register_t **stack_base, struct image_params *imgp)
{
*(char **)stack_base -= sizeof(uint32_t);
- return (suword(*stack_base, imgp->args->argc));
+ return (suword32(*stack_base, imgp->args->argc));
}
static int
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 59b876c..a4d90c7 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -963,6 +963,68 @@ make_dev_alias_p(int flags, struct cdev **cdev, struct cdev *pdev,
return (res);
}
+int
+make_dev_physpath_alias(int flags, struct cdev **cdev, struct cdev *pdev,
+ struct cdev *old_alias, const char *physpath)
+{
+ char *devfspath;
+ int physpath_len;
+ int max_parentpath_len;
+ int parentpath_len;
+ int devfspathbuf_len;
+ int mflags;
+ int ret;
+
+ *cdev = NULL;
+ devfspath = NULL;
+ physpath_len = strlen(physpath);
+ ret = EINVAL;
+ if (physpath_len == 0)
+ goto out;
+
+ if (strncmp("id1,", physpath, 4) == 0) {
+ physpath += 4;
+ physpath_len -= 4;
+ if (physpath_len == 0)
+ goto out;
+ }
+
+ max_parentpath_len = SPECNAMELEN - physpath_len - /*/*/1;
+ parentpath_len = strlen(pdev->si_name);
+ if (max_parentpath_len < parentpath_len) {
+ printf("make_dev_physpath_alias: WARNING - Unable to alias %s "
+ "to %s/%s - path too long\n",
+ pdev->si_name, physpath, pdev->si_name);
+ ret = ENAMETOOLONG;
+ goto out;
+ }
+
+ mflags = (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK;
+ devfspathbuf_len = physpath_len + /*/*/1 + parentpath_len + /*NUL*/1;
+ devfspath = malloc(devfspathbuf_len, M_DEVBUF, mflags);
+ if (devfspath == NULL) {
+ ret = ENOMEM;
+ goto out;
+ }
+
+ sprintf(devfspath, "%s/%s", physpath, pdev->si_name);
+ if (old_alias != NULL
+ && strcmp(old_alias->si_name, devfspath) == 0) {
+ /* Retain the existing alias. */
+ *cdev = old_alias;
+ old_alias = NULL;
+ ret = 0;
+ } else {
+ ret = make_dev_alias_p(flags, cdev, pdev, devfspath);
+ }
+out:
+ if (old_alias != NULL)
+ destroy_dev(old_alias);
+ if (devfspath != NULL)
+ free(devfspath, M_DEVBUF);
+ return (ret);
+}
+
static void
destroy_devl(struct cdev *dev)
{
diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c
index 6489ffb..e1f2801 100644
--- a/sys/kern/kern_cpuset.c
+++ b/sys/kern/kern_cpuset.c
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/cpuset.h>
#include <sys/sx.h>
#include <sys/queue.h>
+#include <sys/libkern.h>
#include <sys/limits.h>
#include <sys/bus.h>
#include <sys/interrupt.h>
@@ -617,6 +618,86 @@ out:
}
/*
+ * Calculate the ffs() of the cpuset.
+ */
+int
+cpusetobj_ffs(const cpuset_t *set)
+{
+ size_t i;
+ int cbit;
+
+ cbit = 0;
+ for (i = 0; i < _NCPUWORDS; i++) {
+ if (set->__bits[i] != 0) {
+ cbit = ffsl(set->__bits[i]);
+ cbit += i * _NCPUBITS;
+ break;
+ }
+ }
+ return (cbit);
+}
+
+/*
+ * Return a string representing a valid layout for a cpuset_t object.
+ * It expects an incoming buffer at least sized as CPUSETBUFSIZ.
+ */
+char *
+cpusetobj_strprint(char *buf, const cpuset_t *set)
+{
+ char *tbuf;
+ size_t i, bytesp, bufsiz;
+
+ tbuf = buf;
+ bytesp = 0;
+ bufsiz = CPUSETBUFSIZ;
+
+ for (i = _NCPUWORDS - 1; i > 0; i--) {
+ bytesp = snprintf(tbuf, bufsiz, "%lx, ", set->__bits[i]);
+ bufsiz -= bytesp;
+ tbuf += bytesp;
+ }
+ snprintf(tbuf, bufsiz, "%lx", set->__bits[0]);
+ return (buf);
+}
+
+/*
+ * Build a valid cpuset_t object from a string representation.
+ * It expects an incoming buffer at least sized as CPUSETBUFSIZ.
+ */
+int
+cpusetobj_strscan(cpuset_t *set, const char *buf)
+{
+ u_int nwords;
+ int i, ret;
+
+ if (strlen(buf) > CPUSETBUFSIZ - 1)
+ return (-1);
+
+ /* Allow to pass a shorter version of the mask when necessary. */
+ nwords = 1;
+ for (i = 0; buf[i] != '\0'; i++)
+ if (buf[i] == ',')
+ nwords++;
+ if (nwords > _NCPUWORDS)
+ return (-1);
+
+ CPU_ZERO(set);
+ for (i = nwords - 1; i > 0; i--) {
+ ret = sscanf(buf, "%lx, ", &set->__bits[i]);
+ if (ret == 0 || ret == -1)
+ return (-1);
+ buf = strstr(buf, " ");
+ if (buf == NULL)
+ return (-1);
+ buf++;
+ }
+ ret = sscanf(buf, "%lx", &set->__bits[0]);
+ if (ret == 0 || ret == -1)
+ return (-1);
+ return (0);
+}
+
+/*
* Apply an anonymous mask to a single thread.
*/
int
@@ -754,12 +835,7 @@ cpuset_init(void *arg)
{
cpuset_t mask;
- CPU_ZERO(&mask);
-#ifdef SMP
- mask.__bits[0] = all_cpus;
-#else
- mask.__bits[0] = 1;
-#endif
+ mask = all_cpus;
if (cpuset_modify(cpuset_zero, &mask))
panic("Can't set initial cpuset mask.\n");
cpuset_zero->cs_flags |= CPU_SET_RDONLY;
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 6510e13..bb25d17 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -701,8 +701,9 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options,
*/
if (p->p_oppid && (t = pfind(p->p_oppid)) != NULL) {
PROC_LOCK(p);
- p->p_oppid = 0;
proc_reparent(p, t);
+ p->p_pptr->p_dbg_child--;
+ p->p_oppid = 0;
PROC_UNLOCK(p);
pksignal(t, SIGCHLD, p->p_ksi);
wakeup(t);
@@ -794,7 +795,8 @@ kern_wait(struct thread *td, pid_t pid, int *status, int options,
pid = -q->p_pgid;
PROC_UNLOCK(q);
}
- if (options &~ (WUNTRACED|WNOHANG|WCONTINUED|WNOWAIT|WLINUXCLONE))
+ /* If we don't know the option, just return. */
+ if (options & ~(WUNTRACED|WNOHANG|WCONTINUED|WNOWAIT|WLINUXCLONE))
return (EINVAL);
loop:
if (q->p_flag & P_STATCHILD) {
@@ -873,7 +875,10 @@ loop:
}
if (nfound == 0) {
sx_xunlock(&proctree_lock);
- return (ECHILD);
+ if (td->td_proc->p_dbg_child)
+ return (0);
+ else
+ return (ECHILD);
}
if (options & WNOHANG) {
sx_xunlock(&proctree_lock);
diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c
index af12d7d..f412d17 100644
--- a/sys/kern/kern_idle.c
+++ b/sys/kern/kern_idle.c
@@ -60,7 +60,7 @@ idle_setup(void *dummy)
p = NULL; /* start with no idle process */
#ifdef SMP
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
#endif
#ifdef SMP
error = kproc_kthread_add(sched_idletd, NULL, &p, &td,
diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c
index 2e5e06f..eff3d5b 100644
--- a/sys/kern/kern_ktr.c
+++ b/sys/kern/kern_ktr.c
@@ -40,8 +40,10 @@ __FBSDID("$FreeBSD$");
#include "opt_alq.h"
#include <sys/param.h>
+#include <sys/queue.h>
#include <sys/alq.h>
#include <sys/cons.h>
+#include <sys/cpuset.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/libkern.h>
@@ -68,10 +70,6 @@ __FBSDID("$FreeBSD$");
#define KTR_MASK (0)
#endif
-#ifndef KTR_CPUMASK
-#define KTR_CPUMASK (~0)
-#endif
-
#ifndef KTR_TIME
#define KTR_TIME get_cyclecount()
#endif
@@ -84,11 +82,6 @@ FEATURE(ktr, "Kernel support for KTR kernel tracing facility");
SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options");
-int ktr_cpumask = KTR_CPUMASK;
-TUNABLE_INT("debug.ktr.cpumask", &ktr_cpumask);
-SYSCTL_INT(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW,
- &ktr_cpumask, 0, "Bitmask of CPUs on which KTR logging is enabled");
-
int ktr_mask = KTR_MASK;
TUNABLE_INT("debug.ktr.mask", &ktr_mask);
SYSCTL_INT(_debug_ktr, OID_AUTO, mask, CTLFLAG_RW,
@@ -106,6 +99,54 @@ int ktr_version = KTR_VERSION;
SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD,
&ktr_version, 0, "Version of the KTR interface");
+cpuset_t ktr_cpumask;
+static char ktr_cpumask_str[CPUSETBUFSIZ];
+TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask_str, sizeof(ktr_cpumask_str));
+
+static void
+ktr_cpumask_initializer(void *dummy __unused)
+{
+
+ CPU_FILL(&ktr_cpumask);
+#ifdef KTR_CPUMASK
+ if (cpusetobj_strscan(&ktr_cpumask, KTR_CPUMASK) == -1)
+ CPU_FILL(&ktr_cpumask);
+#endif
+
+ /*
+ * TUNABLE_STR() runs with SI_ORDER_MIDDLE priority, thus it must be
+ * already set, if necessary.
+ */
+ if (ktr_cpumask_str[0] != '\0' &&
+ cpusetobj_strscan(&ktr_cpumask, ktr_cpumask_str) == -1)
+ CPU_FILL(&ktr_cpumask);
+}
+SYSINIT(ktr_cpumask_initializer, SI_SUB_TUNABLES, SI_ORDER_ANY,
+ ktr_cpumask_initializer, NULL);
+
+static int
+sysctl_debug_ktr_cpumask(SYSCTL_HANDLER_ARGS)
+{
+ char lktr_cpumask_str[CPUSETBUFSIZ];
+ cpuset_t imask;
+ int error;
+
+ cpusetobj_strprint(lktr_cpumask_str, &ktr_cpumask);
+ error = sysctl_handle_string(oidp, lktr_cpumask_str,
+ sizeof(lktr_cpumask_str), req);
+ if (error != 0 || req->newptr == NULL)
+ return (error);
+ if (cpusetobj_strscan(&imask, lktr_cpumask_str) == -1)
+ return (EINVAL);
+ CPU_COPY(&imask, &ktr_cpumask);
+
+ return (error);
+}
+SYSCTL_PROC(_debug_ktr, OID_AUTO, cpumask,
+ CTLFLAG_RW | CTLFLAG_MPSAFE | CTLTYPE_STRING, NULL, 0,
+ sysctl_debug_ktr_cpumask, "S",
+ "Bitmask of CPUs on which KTR logging is enabled");
+
volatile int ktr_idx = 0;
struct ktr_entry ktr_buf[KTR_ENTRIES];
@@ -213,7 +254,7 @@ ktr_tracepoint(u_int mask, const char *file, int line, const char *format,
if ((ktr_mask & mask) == 0)
return;
cpu = KTR_CPU;
- if (((1 << cpu) & ktr_cpumask) == 0)
+ if (!CPU_ISSET(cpu, &ktr_cpumask))
return;
#if defined(KTR_VERBOSE) || defined(KTR_ALQ)
td = curthread;
diff --git a/sys/kern/kern_pmc.c b/sys/kern/kern_pmc.c
index 7532378..8d9c7c0 100644
--- a/sys/kern/kern_pmc.c
+++ b/sys/kern/kern_pmc.c
@@ -55,7 +55,7 @@ int (*pmc_hook)(struct thread *td, int function, void *arg) = NULL;
int (*pmc_intr)(int cpu, struct trapframe *tf) = NULL;
/* Bitmask of CPUs requiring servicing at hardclock time */
-volatile cpumask_t pmc_cpumask;
+volatile cpuset_t pmc_cpumask;
/*
* A global count of SS mode PMCs. When non-zero, this means that
@@ -112,7 +112,7 @@ pmc_cpu_is_active(int cpu)
{
#ifdef SMP
return (pmc_cpu_is_present(cpu) &&
- (hlt_cpus_mask & (1 << cpu)) == 0);
+ !CPU_ISSET(cpu, &hlt_cpus_mask));
#else
return (1);
#endif
@@ -139,7 +139,7 @@ int
pmc_cpu_is_primary(int cpu)
{
#ifdef SMP
- return ((logical_cpus_mask & (1 << cpu)) == 0);
+ return (!CPU_ISSET(cpu, &logical_cpus_mask));
#else
return (1);
#endif
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
index 98bd9c5..01f7777 100644
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -104,8 +104,6 @@ SDT_PROBE_DEFINE2(racct, kernel, racct, leave, leave, "struct racct *",
int racct_types[] = {
[RACCT_CPU] =
RACCT_IN_THOUSANDS,
- [RACCT_FSIZE] =
- RACCT_RECLAIMABLE | RACCT_INHERITABLE | RACCT_DENIABLE,
[RACCT_DATA] =
RACCT_RECLAIMABLE | RACCT_INHERITABLE | RACCT_DENIABLE,
[RACCT_STACK] =
@@ -120,8 +118,6 @@ int racct_types[] = {
RACCT_RECLAIMABLE | RACCT_DENIABLE,
[RACCT_NOFILE] =
RACCT_RECLAIMABLE | RACCT_INHERITABLE | RACCT_DENIABLE,
- [RACCT_SBSIZE] =
- RACCT_RECLAIMABLE | RACCT_DENIABLE | RACCT_SLOPPY,
[RACCT_VMEM] =
RACCT_RECLAIMABLE | RACCT_INHERITABLE | RACCT_DENIABLE,
[RACCT_NPTS] =
@@ -627,7 +623,6 @@ racct_proc_exit(struct proc *p)
/*
* XXX: Free this some other way.
*/
- racct_set(p, RACCT_FSIZE, 0);
racct_set(p, RACCT_NPTS, 0);
racct_set(p, RACCT_NTHR, 0);
racct_set(p, RACCT_RSS, 0);
diff --git a/sys/kern/kern_rctl.c b/sys/kern/kern_rctl.c
index 2d43bdc..3d0a478 100644
--- a/sys/kern/kern_rctl.c
+++ b/sys/kern/kern_rctl.c
@@ -100,7 +100,6 @@ static struct dict subjectnames[] = {
static struct dict resourcenames[] = {
{ "cpu", RACCT_CPU },
- { "fsize", RACCT_FSIZE },
{ "data", RACCT_DATA },
{ "stack", RACCT_STACK },
{ "core", RACCT_CORE },
@@ -108,7 +107,6 @@ static struct dict resourcenames[] = {
{ "memlock", RACCT_MEMLOCK },
{ "nproc", RACCT_NPROC },
{ "nofile", RACCT_NOFILE },
- { "sbsize", RACCT_SBSIZE },
{ "vmem", RACCT_VMEM },
{ "npts", RACCT_NPTS },
{ "swap", RACCT_SWAP },
diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c
index 7f2b4e7..3214e1b 100644
--- a/sys/kern/kern_rmlock.c
+++ b/sys/kern/kern_rmlock.c
@@ -263,7 +263,7 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock)
pc = pcpu_find(curcpu);
/* Check if we just need to do a proper critical_exit. */
- if (!(pc->pc_cpumask & rm->rm_writecpus)) {
+ if (!CPU_OVERLAP(&pc->pc_cpumask, &rm->rm_writecpus)) {
critical_exit();
return (1);
}
@@ -325,7 +325,7 @@ _rm_rlock_hard(struct rmlock *rm, struct rm_priotracker *tracker, int trylock)
critical_enter();
pc = pcpu_find(curcpu);
- rm->rm_writecpus &= ~pc->pc_cpumask;
+ CPU_NAND(&rm->rm_writecpus, &pc->pc_cpumask);
rm_tracker_add(pc, tracker);
sched_pin();
critical_exit();
@@ -366,7 +366,8 @@ _rm_rlock(struct rmlock *rm, struct rm_priotracker *tracker, int trylock)
* Fast path to combine two common conditions into a single
* conditional jump.
*/
- if (0 == (td->td_owepreempt | (rm->rm_writecpus & pc->pc_cpumask)))
+ if (0 == (td->td_owepreempt |
+ CPU_OVERLAP(&rm->rm_writecpus, &pc->pc_cpumask)))
return (1);
/* We do not have a read token and need to acquire one. */
@@ -429,17 +430,17 @@ _rm_wlock(struct rmlock *rm)
{
struct rm_priotracker *prio;
struct turnstile *ts;
- cpumask_t readcpus;
+ cpuset_t readcpus;
if (rm->lock_object.lo_flags & RM_SLEEPABLE)
sx_xlock(&rm->rm_lock_sx);
else
mtx_lock(&rm->rm_lock_mtx);
- if (rm->rm_writecpus != all_cpus) {
+ if (CPU_CMP(&rm->rm_writecpus, &all_cpus)) {
/* Get all read tokens back */
-
- readcpus = all_cpus & (all_cpus & ~rm->rm_writecpus);
+ readcpus = all_cpus;
+ CPU_NAND(&readcpus, &rm->rm_writecpus);
rm->rm_writecpus = all_cpus;
/*
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 001da3d..60e854f 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -233,30 +233,32 @@ print_uptime(void)
printf("%lds\n", (long)ts.tv_sec);
}
-static void
-doadump(void)
+int
+doadump(boolean_t textdump)
{
+ boolean_t coredump;
- /*
- * Sometimes people have to call this from the kernel debugger.
- * (if 'panic' can not dump)
- * Give them a clue as to why they can't dump.
- */
- if (dumper.dumper == NULL) {
- printf("Cannot dump. Device not defined or unavailable.\n");
- return;
- }
+ if (dumping)
+ return (EBUSY);
+ if (dumper.dumper == NULL)
+ return (ENXIO);
savectx(&dumppcb);
dumptid = curthread->td_tid;
dumping++;
+
+ coredump = TRUE;
#ifdef DDB
- if (textdump_pending)
+ if (textdump && textdump_pending) {
+ coredump = FALSE;
textdump_dumpsys(&dumper);
- else
+ }
#endif
+ if (coredump)
dumpsys(&dumper);
+
dumping--;
+ return (0);
}
static int
@@ -425,7 +427,7 @@ kern_reboot(int howto)
EVENTHANDLER_INVOKE(shutdown_post_sync, howto);
if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && !cold && !dumping)
- doadump();
+ doadump(TRUE);
/* Now that we're going to really halt the system... */
EVENTHANDLER_INVOKE(shutdown_final, howto);
@@ -553,11 +555,12 @@ panic(const char *fmt, ...)
; /* nothing */
#endif
- bootopt = RB_AUTOBOOT | RB_DUMP;
+ bootopt = RB_AUTOBOOT;
newpanic = 0;
if (panicstr)
bootopt |= RB_NOSYNC;
else {
+ bootopt |= RB_DUMP;
panicstr = fmt;
newpanic = 1;
}
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index d5b49da..e1861eb 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/posix4.h>
#include <sys/pioctl.h>
+#include <sys/racct.h>
#include <sys/resourcevar.h>
#include <sys/sdt.h>
#include <sys/sbuf.h>
@@ -3173,14 +3174,15 @@ coredump(struct thread *td)
* if it is larger than the limit.
*/
limit = (off_t)lim_cur(p, RLIMIT_CORE);
- PROC_UNLOCK(p);
- if (limit == 0) {
+ if (limit == 0 || racct_get_available(p, RACCT_CORE) == 0) {
+ PROC_UNLOCK(p);
#ifdef AUDIT
audit_proc_coredump(td, name, EFBIG);
#endif
free(name, M_TEMP);
return (EFBIG);
}
+ PROC_UNLOCK(p);
restart:
NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, name, td);
diff --git a/sys/kern/ksched.c b/sys/kern/ksched.c
index 7ee56d5..799b60d 100644
--- a/sys/kern/ksched.c
+++ b/sys/kern/ksched.c
@@ -206,7 +206,7 @@ ksched_setscheduler(struct ksched *ksched,
if (param->sched_priority >= 0 &&
param->sched_priority <= (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE)) {
rtp.type = RTP_PRIO_NORMAL;
- rtp.prio = p4prio_to_rtpprio(param->sched_priority);
+ rtp.prio = p4prio_to_tsprio(param->sched_priority);
rtp_to_pri(&rtp, td);
} else
e = EINVAL;
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index 38bf37f..2f9a1f6 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -950,11 +950,11 @@ link_elf_load_file(linker_class_t cls, const char* filename,
ef->ddbstrcnt = strcnt;
ef->ddbstrtab = ef->strbase;
+nosyms:
error = link_elf_link_common_finish(lf);
if (error != 0)
goto out;
-nosyms:
*result = lf;
out:
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index fef9e25..592bb80 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -156,7 +156,7 @@ static struct runq runq;
static struct runq runq_pcpu[MAXCPU];
long runq_length[MAXCPU];
-static cpumask_t idle_cpus_mask;
+static cpuset_t idle_cpus_mask;
#endif
struct pcpuidlestat {
@@ -951,7 +951,8 @@ sched_switch(struct thread *td, struct thread *newtd, int flags)
if (td->td_flags & TDF_IDLETD) {
TD_SET_CAN_RUN(td);
#ifdef SMP
- idle_cpus_mask &= ~PCPU_GET(cpumask);
+ /* Spinlock held here, assume no migration. */
+ CPU_NAND(&idle_cpus_mask, PCPU_PTR(cpumask));
#endif
} else {
if (TD_IS_RUNNING(td)) {
@@ -1025,7 +1026,7 @@ sched_switch(struct thread *td, struct thread *newtd, int flags)
#ifdef SMP
if (td->td_flags & TDF_IDLETD)
- idle_cpus_mask |= PCPU_GET(cpumask);
+ CPU_OR(&idle_cpus_mask, PCPU_PTR(cpumask));
#endif
sched_lock.mtx_lock = (uintptr_t)td;
td->td_oncpu = PCPU_GET(cpuid);
@@ -1054,7 +1055,8 @@ static int
forward_wakeup(int cpunum)
{
struct pcpu *pc;
- cpumask_t dontuse, id, map, map2, me;
+ cpuset_t dontuse, id, map, map2, me;
+ int iscpuset;
mtx_assert(&sched_lock, MA_OWNED);
@@ -1071,32 +1073,38 @@ forward_wakeup(int cpunum)
/*
* Check the idle mask we received against what we calculated
* before in the old version.
+ *
+ * Also note that sched_lock is held now, thus no migration is
+ * expected.
*/
me = PCPU_GET(cpumask);
/* Don't bother if we should be doing it ourself. */
- if ((me & idle_cpus_mask) && (cpunum == NOCPU || me == (1 << cpunum)))
+ if (CPU_OVERLAP(&me, &idle_cpus_mask) &&
+ (cpunum == NOCPU || CPU_ISSET(cpunum, &me)))
return (0);
- dontuse = me | stopped_cpus | hlt_cpus_mask;
- map2 = 0;
+ dontuse = me;
+ CPU_OR(&dontuse, &stopped_cpus);
+ CPU_OR(&dontuse, &hlt_cpus_mask);
+ CPU_ZERO(&map2);
if (forward_wakeup_use_loop) {
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
id = pc->pc_cpumask;
- if ((id & dontuse) == 0 &&
+ if (!CPU_OVERLAP(&id, &dontuse) &&
pc->pc_curthread == pc->pc_idlethread) {
- map2 |= id;
+ CPU_OR(&map2, &id);
}
}
}
if (forward_wakeup_use_mask) {
- map = 0;
- map = idle_cpus_mask & ~dontuse;
+ map = idle_cpus_mask;
+ CPU_NAND(&map, &dontuse);
/* If they are both on, compare and use loop if different. */
if (forward_wakeup_use_loop) {
- if (map != map2) {
+ if (CPU_CMP(&map, &map2)) {
printf("map != map2, loop method preferred\n");
map = map2;
}
@@ -1108,18 +1116,22 @@ forward_wakeup(int cpunum)
/* If we only allow a specific CPU, then mask off all the others. */
if (cpunum != NOCPU) {
KASSERT((cpunum <= mp_maxcpus),("forward_wakeup: bad cpunum."));
- map &= (1 << cpunum);
+ iscpuset = CPU_ISSET(cpunum, &map);
+ if (iscpuset == 0)
+ CPU_ZERO(&map);
+ else
+ CPU_SETOF(cpunum, &map);
}
- if (map) {
+ if (!CPU_EMPTY(&map)) {
forward_wakeups_delivered++;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
id = pc->pc_cpumask;
- if ((map & id) == 0)
+ if (!CPU_OVERLAP(&map, &id))
continue;
if (cpu_idle_wakeup(pc->pc_cpuid))
- map &= ~id;
+ CPU_NAND(&map, &id);
}
- if (map)
+ if (!CPU_EMPTY(&map))
ipi_selected(map, IPI_AST);
return (1);
}
@@ -1135,7 +1147,7 @@ kick_other_cpu(int pri, int cpuid)
int cpri;
pcpu = pcpu_find(cpuid);
- if (idle_cpus_mask & pcpu->pc_cpumask) {
+ if (CPU_OVERLAP(&idle_cpus_mask, &pcpu->pc_cpumask)) {
forward_wakeups_delivered++;
if (!cpu_idle_wakeup(cpuid))
ipi_cpu(cpuid, IPI_AST);
@@ -1193,6 +1205,7 @@ void
sched_add(struct thread *td, int flags)
#ifdef SMP
{
+ cpuset_t idle, me, tidlemsk;
struct td_sched *ts;
int forwarded = 0;
int cpu;
@@ -1262,11 +1275,20 @@ sched_add(struct thread *td, int flags)
kick_other_cpu(td->td_priority, cpu);
} else {
if (!single_cpu) {
- cpumask_t me = PCPU_GET(cpumask);
- cpumask_t idle = idle_cpus_mask & me;
- if (!idle && ((flags & SRQ_INTR) == 0) &&
- (idle_cpus_mask & ~(hlt_cpus_mask | me)))
+ /*
+ * Thread spinlock is held here, assume no
+ * migration is possible.
+ */
+ me = PCPU_GET(cpumask);
+ idle = idle_cpus_mask;
+ tidlemsk = idle;
+ CPU_AND(&idle, &me);
+ CPU_OR(&me, &hlt_cpus_mask);
+ CPU_NAND(&tidlemsk, &me);
+
+ if (CPU_EMPTY(&idle) && ((flags & SRQ_INTR) == 0) &&
+ !CPU_EMPTY(&tidlemsk))
forwarded = forward_wakeup(cpu);
}
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
index ac18e77..05267f3 100644
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -564,7 +564,7 @@ struct cpu_search {
#define CPUSET_FOREACH(cpu, mask) \
for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++) \
- if ((mask) & 1 << (cpu))
+ if (CPU_ISSET(cpu, &mask))
static __inline int cpu_search(struct cpu_group *cg, struct cpu_search *low,
struct cpu_search *high, const int match);
@@ -2650,15 +2650,16 @@ static int
sysctl_kern_sched_topology_spec_internal(struct sbuf *sb, struct cpu_group *cg,
int indent)
{
+ char cpusetbuf[CPUSETBUFSIZ];
int i, first;
sbuf_printf(sb, "%*s<group level=\"%d\" cache-level=\"%d\">\n", indent,
"", 1 + indent / 2, cg->cg_level);
- sbuf_printf(sb, "%*s <cpu count=\"%d\" mask=\"0x%x\">", indent, "",
- cg->cg_count, cg->cg_mask);
+ sbuf_printf(sb, "%*s <cpu count=\"%d\" mask=\"%s\">", indent, "",
+ cg->cg_count, cpusetobj_strprint(cpusetbuf, &cg->cg_mask));
first = TRUE;
for (i = 0; i < MAXCPU; i++) {
- if ((cg->cg_mask & (1 << i)) != 0) {
+ if (CPU_ISSET(i, &cg->cg_mask)) {
if (!first)
sbuf_printf(sb, ", ");
else
diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c
index 24963d5..eaf6427 100644
--- a/sys/kern/subr_devstat.c
+++ b/sys/kern/subr_devstat.c
@@ -49,8 +49,9 @@ static long devstat_generation = 1;
static int devstat_version = DEVSTAT_VERSION;
static int devstat_current_devnumber;
static struct mtx devstat_mutex;
+MTX_SYSINIT(devstat_mutex, &devstat_mutex, "devstat", MTX_DEF);
-static struct devstatlist device_statq;
+static struct devstatlist device_statq = STAILQ_HEAD_INITIALIZER(device_statq);
static struct devstat *devstat_alloc(void);
static void devstat_free(struct devstat *);
static void devstat_add_entry(struct devstat *ds, const void *dev_name,
@@ -70,13 +71,7 @@ devstat_new_entry(const void *dev_name,
devstat_priority priority)
{
struct devstat *ds;
- static int once;
- if (!once) {
- STAILQ_INIT(&device_statq);
- mtx_init(&devstat_mutex, "devstat", NULL, MTX_DEF);
- once = 1;
- }
mtx_assert(&devstat_mutex, MA_NOTOWNED);
ds = devstat_alloc();
@@ -476,8 +471,9 @@ devstat_alloc(void)
mtx_assert(&devstat_mutex, MA_NOTOWNED);
if (!once) {
- make_dev_credf(MAKEDEV_ETERNAL, &devstat_cdevsw, 0, NULL,
- UID_ROOT, GID_WHEEL, 0400, DEVSTAT_DEVICE_NAME);
+ make_dev_credf(MAKEDEV_ETERNAL | MAKEDEV_CHECKNAME,
+ &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0400,
+ DEVSTAT_DEVICE_NAME);
once = 1;
}
spp2 = NULL;
diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c
index 342c5ca..c2f6e99 100644
--- a/sys/kern/subr_kdb.c
+++ b/sys/kern/subr_kdb.c
@@ -244,29 +244,44 @@ kdb_reboot(void)
#define KEY_CRTLP 16 /* ^P */
#define KEY_CRTLR 18 /* ^R */
+/* States of th KDB "alternate break sequence" detecting state machine. */
+enum {
+ KDB_ALT_BREAK_SEEN_NONE,
+ KDB_ALT_BREAK_SEEN_CR,
+ KDB_ALT_BREAK_SEEN_CR_TILDE,
+};
+
int
kdb_alt_break(int key, int *state)
{
int brk;
+ /* All states transition to KDB_ALT_BREAK_SEEN_CR on a CR. */
+ if (key == KEY_CR) {
+ *state = KDB_ALT_BREAK_SEEN_CR;
+ return (0);
+ }
+
brk = 0;
switch (*state) {
- case 0:
- if (key == KEY_CR)
- *state = 1;
- break;
- case 1:
+ case KDB_ALT_BREAK_SEEN_CR:
+ *state = KDB_ALT_BREAK_SEEN_NONE;
if (key == KEY_TILDE)
- *state = 2;
+ *state = KDB_ALT_BREAK_SEEN_CR_TILDE;
break;
- case 2:
+ case KDB_ALT_BREAK_SEEN_CR_TILDE:
+ *state = KDB_ALT_BREAK_SEEN_NONE;
if (key == KEY_CRTLB)
brk = KDB_REQ_DEBUGGER;
else if (key == KEY_CRTLP)
brk = KDB_REQ_PANIC;
else if (key == KEY_CRTLR)
brk = KDB_REQ_REBOOT;
- *state = 0;
+ break;
+ case KDB_ALT_BREAK_SEEN_NONE:
+ default:
+ *state = KDB_ALT_BREAK_SEEN_NONE;
+ break;
}
return (brk);
}
@@ -412,8 +427,9 @@ kdb_thr_ctx(struct thread *thr)
return (&kdb_pcb);
#if defined(SMP) && defined(KDB_STOPPEDPCB)
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
- if (pc->pc_curthread == thr && (stopped_cpus & pc->pc_cpumask))
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
+ if (pc->pc_curthread == thr &&
+ CPU_OVERLAP(&stopped_cpus, &pc->pc_cpumask))
return (KDB_STOPPEDPCB(pc));
}
#endif
diff --git a/sys/kern/subr_msgbuf.c b/sys/kern/subr_msgbuf.c
index 14cd39d..cd9c551 100644
--- a/sys/kern/subr_msgbuf.c
+++ b/sys/kern/subr_msgbuf.c
@@ -31,8 +31,16 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
#include <sys/msgbuf.h>
+/*
+ * Maximum number conversion buffer length: uintmax_t in base 2, plus <>
+ * around the priority, and a terminating NUL.
+ */
+#define MAXPRIBUF (sizeof(intmax_t) * NBBY + 3)
+
/* Read/write sequence numbers are modulo a multiple of the buffer size. */
#define SEQMOD(size) ((size) * 16)
@@ -51,6 +59,10 @@ msgbuf_init(struct msgbuf *mbp, void *ptr, int size)
mbp->msg_seqmod = SEQMOD(size);
msgbuf_clear(mbp);
mbp->msg_magic = MSG_MAGIC;
+ mbp->msg_lastpri = -1;
+ mbp->msg_needsnl = 0;
+ bzero(&mbp->msg_lock, sizeof(mbp->msg_lock));
+ mtx_init(&mbp->msg_lock, "msgbuf", NULL, MTX_SPIN);
}
/*
@@ -80,6 +92,12 @@ msgbuf_reinit(struct msgbuf *mbp, void *ptr, int size)
}
msgbuf_clear(mbp);
}
+
+ mbp->msg_lastpri = -1;
+ /* Assume that the old message buffer didn't end in a newline. */
+ mbp->msg_needsnl = 1;
+ bzero(&mbp->msg_lock, sizeof(mbp->msg_lock));
+ mtx_init(&mbp->msg_lock, "msgbuf", NULL, MTX_SPIN);
}
/*
@@ -110,25 +128,140 @@ msgbuf_getcount(struct msgbuf *mbp)
}
/*
- * Append a character to a message buffer. This function can be
- * considered fully reentrant so long as the number of concurrent
- * callers is less than the number of characters in the buffer.
- * However, the message buffer is only guaranteed to be consistent
- * for reading when there are no callers in this function.
+ * Add a character into the message buffer, and update the checksum and
+ * sequence number.
+ *
+ * The caller should hold the message buffer spinlock.
+ */
+static inline void
+msgbuf_do_addchar(struct msgbuf *mbp, u_int *seq, int c)
+{
+ u_int pos;
+
+ /* Make sure we properly wrap the sequence number. */
+ pos = MSGBUF_SEQ_TO_POS(mbp, *seq);
+
+ mbp->msg_cksum += (u_int)c -
+ (u_int)(u_char)mbp->msg_ptr[pos];
+
+ mbp->msg_ptr[pos] = c;
+
+ *seq = MSGBUF_SEQNORM(mbp, *seq + 1);
+}
+
+/*
+ * Append a character to a message buffer.
*/
void
msgbuf_addchar(struct msgbuf *mbp, int c)
{
- u_int new_seq, pos, seq;
-
- do {
- seq = mbp->msg_wseq;
- new_seq = MSGBUF_SEQNORM(mbp, seq + 1);
- } while (atomic_cmpset_rel_int(&mbp->msg_wseq, seq, new_seq) == 0);
- pos = MSGBUF_SEQ_TO_POS(mbp, seq);
- atomic_add_int(&mbp->msg_cksum, (u_int)(u_char)c -
- (u_int)(u_char)mbp->msg_ptr[pos]);
- mbp->msg_ptr[pos] = c;
+ mtx_lock_spin(&mbp->msg_lock);
+
+ msgbuf_do_addchar(mbp, &mbp->msg_wseq, c);
+
+ mtx_unlock_spin(&mbp->msg_lock);
+}
+
+/*
+ * Append a NUL-terminated string with a priority to a message buffer.
+ * Filter carriage returns if the caller requests it.
+ *
+ * XXX The carriage return filtering behavior is present in the
+ * msglogchar() API, however testing has shown that we don't seem to send
+ * carriage returns down this path. So do we still need it?
+ */
+void
+msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr)
+{
+ u_int seq;
+ size_t len, prefix_len;
+ char prefix[MAXPRIBUF];
+ int nl, i;
+
+ len = strlen(str);
+ prefix_len = 0;
+ nl = 0;
+
+ /* If we have a zero-length string, no need to do anything. */
+ if (len == 0)
+ return;
+
+ mtx_lock_spin(&mbp->msg_lock);
+
+ /*
+ * If this is true, we may need to insert a new priority sequence,
+ * so prepare the prefix.
+ */
+ if (pri != -1)
+ prefix_len = sprintf(prefix, "<%d>", pri);
+
+ /*
+ * Starting write sequence number.
+ */
+ seq = mbp->msg_wseq;
+
+ /*
+ * Whenever there is a change in priority, we have to insert a
+ * newline, and a priority prefix if the priority is not -1. Here
+ * we detect whether there was a priority change, and whether we
+ * did not end with a newline. If that is the case, we need to
+ * insert a newline before this string.
+ */
+ if (mbp->msg_lastpri != pri && mbp->msg_needsnl != 0) {
+
+ msgbuf_do_addchar(mbp, &seq, '\n');
+ mbp->msg_needsnl = 0;
+ }
+
+ for (i = 0; i < len; i++) {
+ /*
+ * If we just had a newline, and the priority is not -1
+ * (and therefore prefix_len != 0), then we need a priority
+ * prefix for this line.
+ */
+ if (mbp->msg_needsnl == 0 && prefix_len != 0) {
+ int j;
+
+ for (j = 0; j < prefix_len; j++)
+ msgbuf_do_addchar(mbp, &seq, prefix[j]);
+ }
+
+ /*
+ * Don't copy carriage returns if the caller requested
+ * filtering.
+ *
+ * XXX This matches the behavior of msglogchar(), but is it
+ * necessary? Testing has shown that we don't seem to get
+ * carriage returns here.
+ */
+ if ((filter_cr != 0) && (str[i] == '\r'))
+ continue;
+
+ /*
+ * Clear this flag if we see a newline. This affects whether
+ * we need to insert a new prefix or insert a newline later.
+ */
+ if (str[i] == '\n')
+ mbp->msg_needsnl = 0;
+ else
+ mbp->msg_needsnl = 1;
+
+ msgbuf_do_addchar(mbp, &seq, str[i]);
+ }
+ /*
+ * Update the write sequence number for the actual number of
+ * characters we put in the message buffer. (Depends on whether
+ * carriage returns are filtered.)
+ */
+ mbp->msg_wseq = seq;
+
+ /*
+ * Set the last priority.
+ */
+ mbp->msg_lastpri = pri;
+
+ mtx_unlock_spin(&mbp->msg_lock);
+
}
/*
@@ -141,14 +274,21 @@ msgbuf_getchar(struct msgbuf *mbp)
u_int len, wseq;
int c;
+ mtx_lock_spin(&mbp->msg_lock);
+
wseq = mbp->msg_wseq;
len = MSGBUF_SEQSUB(mbp, wseq, mbp->msg_rseq);
- if (len == 0)
+ if (len == 0) {
+ mtx_unlock_spin(&mbp->msg_lock);
return (-1);
+ }
if (len > mbp->msg_size)
mbp->msg_rseq = MSGBUF_SEQNORM(mbp, wseq - mbp->msg_size);
c = (u_char)mbp->msg_ptr[MSGBUF_SEQ_TO_POS(mbp, mbp->msg_rseq)];
mbp->msg_rseq = MSGBUF_SEQNORM(mbp, mbp->msg_rseq + 1);
+
+ mtx_unlock_spin(&mbp->msg_lock);
+
return (c);
}
@@ -161,10 +301,14 @@ msgbuf_getbytes(struct msgbuf *mbp, char *buf, int buflen)
{
u_int len, pos, wseq;
+ mtx_lock_spin(&mbp->msg_lock);
+
wseq = mbp->msg_wseq;
len = MSGBUF_SEQSUB(mbp, wseq, mbp->msg_rseq);
- if (len == 0)
+ if (len == 0) {
+ mtx_unlock_spin(&mbp->msg_lock);
return (0);
+ }
if (len > mbp->msg_size) {
mbp->msg_rseq = MSGBUF_SEQNORM(mbp, wseq - mbp->msg_size);
len = mbp->msg_size;
@@ -175,6 +319,9 @@ msgbuf_getbytes(struct msgbuf *mbp, char *buf, int buflen)
bcopy(&mbp->msg_ptr[pos], buf, len);
mbp->msg_rseq = MSGBUF_SEQNORM(mbp, mbp->msg_rseq + len);
+
+ mtx_unlock_spin(&mbp->msg_lock);
+
return (len);
}
@@ -193,16 +340,21 @@ msgbuf_peekbytes(struct msgbuf *mbp, char *buf, int buflen, u_int *seqp)
{
u_int len, pos, wseq;
+ mtx_lock_spin(&mbp->msg_lock);
+
if (buf == NULL) {
/* Just initialise *seqp. */
*seqp = MSGBUF_SEQNORM(mbp, mbp->msg_wseq - mbp->msg_size);
+ mtx_unlock_spin(&mbp->msg_lock);
return (0);
}
wseq = mbp->msg_wseq;
len = MSGBUF_SEQSUB(mbp, wseq, *seqp);
- if (len == 0)
+ if (len == 0) {
+ mtx_unlock_spin(&mbp->msg_lock);
return (0);
+ }
if (len > mbp->msg_size) {
*seqp = MSGBUF_SEQNORM(mbp, wseq - mbp->msg_size);
len = mbp->msg_size;
@@ -212,6 +364,9 @@ msgbuf_peekbytes(struct msgbuf *mbp, char *buf, int buflen, u_int *seqp)
len = min(len, (u_int)buflen);
bcopy(&mbp->msg_ptr[MSGBUF_SEQ_TO_POS(mbp, *seqp)], buf, len);
*seqp = MSGBUF_SEQNORM(mbp, *seqp + len);
+
+ mtx_unlock_spin(&mbp->msg_lock);
+
return (len);
}
diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c
index de5cafc..a6b3ae0 100644
--- a/sys/kern/subr_pcpu.c
+++ b/sys/kern/subr_pcpu.c
@@ -74,7 +74,7 @@ static TAILQ_HEAD(, dpcpu_free) dpcpu_head = TAILQ_HEAD_INITIALIZER(dpcpu_head);
static struct sx dpcpu_lock;
uintptr_t dpcpu_off[MAXCPU];
struct pcpu *cpuid_to_pcpu[MAXCPU];
-struct cpuhead cpuhead = SLIST_HEAD_INITIALIZER(cpuhead);
+struct cpuhead cpuhead = STAILQ_HEAD_INITIALIZER(cpuhead);
/*
* Initialize the MI portions of a struct pcpu.
@@ -87,9 +87,9 @@ pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
KASSERT(cpuid >= 0 && cpuid < MAXCPU,
("pcpu_init: invalid cpuid %d", cpuid));
pcpu->pc_cpuid = cpuid;
- pcpu->pc_cpumask = 1 << cpuid;
+ CPU_SETOF(cpuid, &pcpu->pc_cpumask);
cpuid_to_pcpu[cpuid] = pcpu;
- SLIST_INSERT_HEAD(&cpuhead, pcpu, pc_allcpu);
+ STAILQ_INSERT_TAIL(&cpuhead, pcpu, pc_allcpu);
cpu_pcpu_init(pcpu, cpuid, size);
pcpu->pc_rm_queue.rmq_next = &pcpu->pc_rm_queue;
pcpu->pc_rm_queue.rmq_prev = &pcpu->pc_rm_queue;
@@ -245,7 +245,7 @@ void
pcpu_destroy(struct pcpu *pcpu)
{
- SLIST_REMOVE(&cpuhead, pcpu, pcpu, pc_allcpu);
+ STAILQ_REMOVE(&cpuhead, pcpu, pcpu, pc_allcpu);
cpuid_to_pcpu[pcpu->pc_cpuid] = NULL;
dpcpu_off[pcpu->pc_cpuid] = 0;
}
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index d0d2ad7..48f2dd9 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -94,6 +94,7 @@ struct snprintf_arg {
extern int log_open;
static void msglogchar(int c, int pri);
+static void msglogstr(char *str, int pri, int filter_cr);
static void putchar(int ch, void *arg);
static char *ksprintn(char *nbuf, uintmax_t num, int base, int *len, int upper);
static void snprintf_func(int ch, void *arg);
@@ -106,6 +107,14 @@ TUNABLE_INT("kern.log_console_output", &log_console_output);
SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RW,
&log_console_output, 0, "Duplicate console output to the syslog.");
+/*
+ * See the comment in log_console() below for more explanation of this.
+ */
+static int log_console_add_linefeed = 0;
+TUNABLE_INT("kern.log_console_add_linefeed", &log_console_add_linefeed);
+SYSCTL_INT(_kern, OID_AUTO, log_console_add_linefeed, CTLFLAG_RW,
+ &log_console_add_linefeed, 0, "log_console() adds extra newlines.");
+
static int always_console_output = 0;
TUNABLE_INT("kern.always_console_output", &always_console_output);
SYSCTL_INT(_kern, OID_AUTO, always_console_output, CTLFLAG_RW,
@@ -154,6 +163,7 @@ uprintf(const char *fmt, ...)
goto out;
}
pca.flags = TOTTY;
+ pca.p_bufr = NULL;
va_start(ap, fmt);
tty_lock(pca.tty);
retval = kvprintf(fmt, putchar, &pca, 10, ap);
@@ -197,6 +207,7 @@ tprintf(struct proc *p, int pri, const char *fmt, ...)
pca.pri = pri;
pca.tty = tp;
pca.flags = flags;
+ pca.p_bufr = NULL;
va_start(ap, fmt);
if (pca.tty != NULL)
tty_lock(pca.tty);
@@ -225,6 +236,7 @@ ttyprintf(struct tty *tp, const char *fmt, ...)
va_start(ap, fmt);
pca.tty = tp;
pca.flags = TOTTY;
+ pca.p_bufr = NULL;
retval = kvprintf(fmt, putchar, &pca, 10, ap);
va_end(ap);
return (retval);
@@ -240,16 +252,37 @@ log(int level, const char *fmt, ...)
{
va_list ap;
struct putchar_arg pca;
+#ifdef PRINTF_BUFR_SIZE
+ char bufr[PRINTF_BUFR_SIZE];
+#endif
pca.tty = NULL;
pca.pri = level;
pca.flags = log_open ? TOLOG : TOCONS;
+#ifdef PRINTF_BUFR_SIZE
+ pca.p_bufr = bufr;
+ pca.p_next = pca.p_bufr;
+ pca.n_bufr = sizeof(bufr);
+ pca.remain = sizeof(bufr);
+ *pca.p_next = '\0';
+#else
pca.p_bufr = NULL;
+#endif
va_start(ap, fmt);
kvprintf(fmt, putchar, &pca, 10, ap);
va_end(ap);
+#ifdef PRINTF_BUFR_SIZE
+ /* Write any buffered console/log output: */
+ if (*pca.p_bufr != '\0') {
+ if (pca.flags & TOLOG)
+ msglogstr(pca.p_bufr, level, /*filter_cr*/1);
+
+ if (pca.flags & TOCONS)
+ cnputs(pca.p_bufr);
+ }
+#endif
msgbuftrigger = 1;
}
@@ -258,7 +291,7 @@ log(int level, const char *fmt, ...)
void
log_console(struct uio *uio)
{
- int c, i, error, nl;
+ int c, error, nl;
char *consbuffer;
int pri;
@@ -271,20 +304,48 @@ log_console(struct uio *uio)
nl = 0;
while (uio->uio_resid > 0) {
- c = imin(uio->uio_resid, CONSCHUNK);
+ c = imin(uio->uio_resid, CONSCHUNK - 1);
error = uiomove(consbuffer, c, uio);
if (error != 0)
break;
- for (i = 0; i < c; i++) {
- msglogchar(consbuffer[i], pri);
- if (consbuffer[i] == '\n')
- nl = 1;
- else
- nl = 0;
- }
+ /* Make sure we're NUL-terminated */
+ consbuffer[c] = '\0';
+ if (consbuffer[c - 1] == '\n')
+ nl = 1;
+ else
+ nl = 0;
+ msglogstr(consbuffer, pri, /*filter_cr*/ 1);
+ }
+ /*
+ * The previous behavior in log_console() is preserved when
+ * log_console_add_linefeed is non-zero. For that behavior, if an
+ * individual console write came in that was not terminated with a
+ * line feed, it would add a line feed.
+ *
+ * This results in different data in the message buffer than
+ * appears on the system console (which doesn't add extra line feed
+ * characters).
+ *
+ * A number of programs and rc scripts write a line feed, or a period
+ * and a line feed when they have completed their operation. On
+ * the console, this looks seamless, but when displayed with
+ * 'dmesg -a', you wind up with output that looks like this:
+ *
+ * Updating motd:
+ * .
+ *
+ * On the console, it looks like this:
+ * Updating motd:.
+ *
+ * We could add logic to detect that situation, or just not insert
+ * the extra newlines. Set the kern.log_console_add_linefeed
+ * sysctl/tunable variable to get the old behavior.
+ */
+ if (!nl && log_console_add_linefeed) {
+ consbuffer[0] = '\n';
+ consbuffer[1] = '\0';
+ msglogstr(consbuffer, pri, /*filter_cr*/ 1);
}
- if (!nl)
- msglogchar('\n', pri);
msgbuftrigger = 1;
free(uio, M_IOV);
free(consbuffer, M_TEMP);
@@ -330,9 +391,11 @@ vprintf(const char *fmt, va_list ap)
retval = kvprintf(fmt, putchar, &pca, 10, ap);
#ifdef PRINTF_BUFR_SIZE
- /* Write any buffered console output: */
- if (*pca.p_bufr != '\0')
+ /* Write any buffered console/log output: */
+ if (*pca.p_bufr != '\0') {
cnputs(pca.p_bufr);
+ msglogstr(pca.p_bufr, pca.pri, /*filter_cr*/ 1);
+ }
#endif
if (!panicstr)
@@ -342,18 +405,18 @@ vprintf(const char *fmt, va_list ap)
}
static void
-putcons(int c, struct putchar_arg *ap)
+putbuf(int c, struct putchar_arg *ap)
{
/* Check if no console output buffer was provided. */
- if (ap->p_bufr == NULL)
+ if (ap->p_bufr == NULL) {
/* Output direct to the console. */
- cnputc(c);
- else {
+ if (ap->flags & TOCONS)
+ cnputc(c);
+
+ if (ap->flags & TOLOG)
+ msglogchar(c, ap->pri);
+ } else {
/* Buffer the character: */
- if (c == '\n') {
- *ap->p_next++ = '\r';
- ap->remain--;
- }
*ap->p_next++ = c;
ap->remain--;
@@ -361,12 +424,35 @@ putcons(int c, struct putchar_arg *ap)
*ap->p_next = '\0';
/* Check if the buffer needs to be flushed. */
- if (ap->remain < 3 || c == '\n') {
- cnputs(ap->p_bufr);
+ if (ap->remain == 2 || c == '\n') {
+
+ if (ap->flags & TOLOG)
+ msglogstr(ap->p_bufr, ap->pri, /*filter_cr*/1);
+
+ if (ap->flags & TOCONS) {
+ if ((panicstr == NULL) && (constty != NULL))
+ msgbuf_addstr(&consmsgbuf, -1,
+ ap->p_bufr, /*filter_cr*/ 0);
+
+ if ((constty == NULL) ||(always_console_output))
+ cnputs(ap->p_bufr);
+ }
+
ap->p_next = ap->p_bufr;
ap->remain = ap->n_bufr;
*ap->p_next = '\0';
}
+
+ /*
+ * Since we fill the buffer up one character at a time,
+ * this should not happen. We should always catch it when
+ * ap->remain == 2 (if not sooner due to a newline), flush
+ * the buffer and move on. One way this could happen is
+ * if someone sets PRINTF_BUFR_SIZE to 1 or something
+ * similarly silly.
+ */
+ KASSERT(ap->remain > 2, ("Bad buffer logic, remain = %zd",
+ ap->remain));
}
}
@@ -381,26 +467,25 @@ putchar(int c, void *arg)
struct putchar_arg *ap = (struct putchar_arg*) arg;
struct tty *tp = ap->tty;
int flags = ap->flags;
+ int putbuf_done = 0;
/* Don't use the tty code after a panic or while in ddb. */
if (kdb_active) {
if (c != '\0')
cnputc(c);
- } else if (panicstr || ((flags & TOCONS) && constty == NULL)) {
- if (c != '\0')
- putcons(c, ap);
} else {
- if ((flags & TOTTY) && tp != NULL)
+ if ((panicstr == NULL) && (flags & TOTTY) && (tp != NULL))
tty_putchar(tp, c);
+
if (flags & TOCONS) {
- if (constty != NULL)
- msgbuf_addchar(&consmsgbuf, c);
- if (always_console_output && c != '\0')
- putcons(c, ap);
+ putbuf(c, ap);
+ putbuf_done = 1;
}
}
- if ((flags & TOLOG))
- msglogchar(c, ap->pri);
+ if ((flags & TOLOG) && (putbuf_done == 0)) {
+ if (c != '\0')
+ putbuf(c, ap);
+ }
}
/*
@@ -890,6 +975,15 @@ msglogchar(int c, int pri)
}
}
+static void
+msglogstr(char *str, int pri, int filter_cr)
+{
+ if (!msgbufmapped)
+ return;
+
+ msgbuf_addstr(msgbufp, pri, str, filter_cr);
+}
+
void
msgbufinit(void *ptr, int size)
{
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
index 3014b19..abd72c0 100644
--- a/sys/kern/subr_rman.c
+++ b/sys/kern/subr_rman.c
@@ -839,6 +839,7 @@ int_rman_release_resource(struct rman *rm, struct resource_i *r)
* without freeing anything.
*/
r->r_flags &= ~RF_ALLOCATED;
+ r->r_dev = NULL;
return 0;
}
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index 67774d8..c38177b 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -53,15 +53,15 @@ __FBSDID("$FreeBSD$");
#include "opt_sched.h"
#ifdef SMP
-volatile cpumask_t stopped_cpus;
-volatile cpumask_t started_cpus;
-cpumask_t hlt_cpus_mask;
-cpumask_t logical_cpus_mask;
+volatile cpuset_t stopped_cpus;
+volatile cpuset_t started_cpus;
+cpuset_t hlt_cpus_mask;
+cpuset_t logical_cpus_mask;
void (*cpustop_restartfunc)(void);
#endif
/* This is used in modules that need to work in both SMP and UP. */
-cpumask_t all_cpus;
+cpuset_t all_cpus;
int mp_ncpus;
/* export this for libkvm consumers. */
@@ -200,8 +200,11 @@ forward_signal(struct thread *td)
*
*/
static int
-generic_stop_cpus(cpumask_t map, u_int type)
+generic_stop_cpus(cpuset_t map, u_int type)
{
+#ifdef KTR
+ char cpusetbuf[CPUSETBUFSIZ];
+#endif
static volatile u_int stopping_cpu = NOCPU;
int i;
@@ -216,7 +219,8 @@ generic_stop_cpus(cpumask_t map, u_int type)
if (!smp_started)
return (0);
- CTR2(KTR_SMP, "stop_cpus(%x) with %u type", map, type);
+ CTR2(KTR_SMP, "stop_cpus(%s) with %u type",
+ cpusetobj_strprint(cpusetbuf, &map), type);
if (stopping_cpu != PCPU_GET(cpuid))
while (atomic_cmpset_int(&stopping_cpu, NOCPU,
@@ -228,7 +232,7 @@ generic_stop_cpus(cpumask_t map, u_int type)
ipi_selected(map, type);
i = 0;
- while ((stopped_cpus & map) != map) {
+ while (!CPU_SUBSET(&stopped_cpus, &map)) {
/* spin */
cpu_spinwait();
i++;
@@ -245,14 +249,14 @@ generic_stop_cpus(cpumask_t map, u_int type)
}
int
-stop_cpus(cpumask_t map)
+stop_cpus(cpuset_t map)
{
return (generic_stop_cpus(map, IPI_STOP));
}
int
-stop_cpus_hard(cpumask_t map)
+stop_cpus_hard(cpuset_t map)
{
return (generic_stop_cpus(map, IPI_STOP_HARD));
@@ -260,7 +264,7 @@ stop_cpus_hard(cpumask_t map)
#if defined(__amd64__)
int
-suspend_cpus(cpumask_t map)
+suspend_cpus(cpuset_t map)
{
return (generic_stop_cpus(map, IPI_SUSPEND));
@@ -281,19 +285,22 @@ suspend_cpus(cpumask_t map)
* 1: ok
*/
int
-restart_cpus(cpumask_t map)
+restart_cpus(cpuset_t map)
{
+#ifdef KTR
+ char cpusetbuf[CPUSETBUFSIZ];
+#endif
if (!smp_started)
return 0;
- CTR1(KTR_SMP, "restart_cpus(%x)", map);
+ CTR1(KTR_SMP, "restart_cpus(%s)", cpusetobj_strprint(cpusetbuf, &map));
/* signal other cpus to restart */
- atomic_store_rel_int(&started_cpus, map);
+ CPU_COPY_STORE_REL(&map, &started_cpus);
/* wait for each to clear its bit */
- while ((stopped_cpus & map) != 0)
+ while (CPU_OVERLAP(&stopped_cpus, &map))
cpu_spinwait();
return 1;
@@ -348,11 +355,11 @@ smp_rendezvous_action(void)
* cannot use a regular critical section however as having
* critical_exit() preempt from this routine would also be
* problematic (the preemption must not occur before the IPI
- * has been acknowleged via an EOI). Instead, we
+ * has been acknowledged via an EOI). Instead, we
* intentionally ignore td_owepreempt when leaving the
- * critical setion. This should be harmless because we do not
- * permit rendezvous action routines to schedule threads, and
- * thus td_owepreempt should never transition from 0 to 1
+ * critical section. This should be harmless because we do
+ * not permit rendezvous action routines to schedule threads,
+ * and thus td_owepreempt should never transition from 0 to 1
* during this routine.
*/
td = curthread;
@@ -409,13 +416,13 @@ smp_rendezvous_action(void)
}
void
-smp_rendezvous_cpus(cpumask_t map,
+smp_rendezvous_cpus(cpuset_t map,
void (* setup_func)(void *),
void (* action_func)(void *),
void (* teardown_func)(void *),
void *arg)
{
- int i, ncpus = 0;
+ int curcpumap, i, ncpus = 0;
if (!smp_started) {
if (setup_func != NULL)
@@ -428,11 +435,11 @@ smp_rendezvous_cpus(cpumask_t map,
}
CPU_FOREACH(i) {
- if (((1 << i) & map) != 0)
+ if (CPU_ISSET(i, &map))
ncpus++;
}
if (ncpus == 0)
- panic("ncpus is 0 with map=0x%x", map);
+ panic("ncpus is 0 with non-zero map");
mtx_lock_spin(&smp_ipi_mtx);
@@ -452,10 +459,12 @@ smp_rendezvous_cpus(cpumask_t map,
* Signal other processors, which will enter the IPI with
* interrupts off.
*/
- ipi_selected(map & ~(1 << curcpu), IPI_RENDEZVOUS);
+ curcpumap = CPU_ISSET(curcpu, &map);
+ CPU_CLR(curcpu, &map);
+ ipi_selected(map, IPI_RENDEZVOUS);
/* Check if the current CPU is in the map */
- if ((map & (1 << curcpu)) != 0)
+ if (curcpumap != 0)
smp_rendezvous_action();
/*
@@ -484,6 +493,7 @@ static struct cpu_group group[MAXCPU];
struct cpu_group *
smp_topo(void)
{
+ char cpusetbuf[CPUSETBUFSIZ], cpusetbuf2[CPUSETBUFSIZ];
struct cpu_group *top;
/*
@@ -530,9 +540,10 @@ smp_topo(void)
if (top->cg_count != mp_ncpus)
panic("Built bad topology at %p. CPU count %d != %d",
top, top->cg_count, mp_ncpus);
- if (top->cg_mask != all_cpus)
- panic("Built bad topology at %p. CPU mask 0x%X != 0x%X",
- top, top->cg_mask, all_cpus);
+ if (CPU_CMP(&top->cg_mask, &all_cpus))
+ panic("Built bad topology at %p. CPU mask (%s) != (%s)",
+ top, cpusetobj_strprint(cpusetbuf, &top->cg_mask),
+ cpusetobj_strprint(cpusetbuf2, &all_cpus));
return (top);
}
@@ -557,11 +568,13 @@ static int
smp_topo_addleaf(struct cpu_group *parent, struct cpu_group *child, int share,
int count, int flags, int start)
{
- cpumask_t mask;
+ char cpusetbuf[CPUSETBUFSIZ], cpusetbuf2[CPUSETBUFSIZ];
+ cpuset_t mask;
int i;
- for (mask = 0, i = 0; i < count; i++, start++)
- mask |= (1 << start);
+ CPU_ZERO(&mask);
+ for (i = 0; i < count; i++, start++)
+ CPU_SET(start, &mask);
child->cg_parent = parent;
child->cg_child = NULL;
child->cg_children = 0;
@@ -571,10 +584,12 @@ smp_topo_addleaf(struct cpu_group *parent, struct cpu_group *child, int share,
child->cg_mask = mask;
parent->cg_children++;
for (; parent != NULL; parent = parent->cg_parent) {
- if ((parent->cg_mask & child->cg_mask) != 0)
- panic("Duplicate children in %p. mask 0x%X child 0x%X",
- parent, parent->cg_mask, child->cg_mask);
- parent->cg_mask |= child->cg_mask;
+ if (CPU_OVERLAP(&parent->cg_mask, &child->cg_mask))
+ panic("Duplicate children in %p. mask (%s) child (%s)",
+ parent,
+ cpusetobj_strprint(cpusetbuf, &parent->cg_mask),
+ cpusetobj_strprint(cpusetbuf2, &child->cg_mask));
+ CPU_OR(&parent->cg_mask, &child->cg_mask);
parent->cg_count += child->cg_count;
}
@@ -634,20 +649,20 @@ struct cpu_group *
smp_topo_find(struct cpu_group *top, int cpu)
{
struct cpu_group *cg;
- cpumask_t mask;
+ cpuset_t mask;
int children;
int i;
- mask = (1 << cpu);
+ CPU_SETOF(cpu, &mask);
cg = top;
for (;;) {
- if ((cg->cg_mask & mask) == 0)
+ if (!CPU_OVERLAP(&cg->cg_mask, &mask))
return (NULL);
if (cg->cg_children == 0)
return (cg);
children = cg->cg_children;
for (i = 0, cg = cg->cg_child; i < children; cg++, i++)
- if ((cg->cg_mask & mask) != 0)
+ if (CPU_OVERLAP(&cg->cg_mask, &mask))
break;
}
return (NULL);
@@ -655,7 +670,7 @@ smp_topo_find(struct cpu_group *top, int cpu)
#else /* !SMP */
void
-smp_rendezvous_cpus(cpumask_t map,
+smp_rendezvous_cpus(cpuset_t map,
void (*setup_func)(void *),
void (*action_func)(void *),
void (*teardown_func)(void *),
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index a7f280a..ee36b35 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -829,10 +829,22 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
case PT_ATTACH:
/* security check done above */
+ /*
+ * It would be nice if the tracing relationship was separate
+ * from the parent relationship but that would require
+ * another set of links in the proc struct or for "wait"
+ * to scan the entire proc table. To make life easier,
+ * we just re-parent the process we're trying to trace.
+ * The old parent is remembered so we can put things back
+ * on a "detach".
+ */
p->p_flag |= P_TRACED;
p->p_oppid = p->p_pptr->p_pid;
- if (p->p_pptr != td->td_proc)
+ if (p->p_pptr != td->td_proc) {
+ /* Remember that a child is being debugged(traced). */
+ p->p_pptr->p_dbg_child++;
proc_reparent(p, td->td_proc);
+ }
data = SIGSTOP;
goto sendsig; /* in PT_CONTINUE below */
@@ -919,11 +931,12 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
PROC_UNLOCK(pp);
PROC_LOCK(p);
proc_reparent(p, pp);
+ p->p_pptr->p_dbg_child--;
if (pp == initproc)
p->p_sigparent = SIGCHLD;
}
- p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK);
p->p_oppid = 0;
+ p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK);
/* should we send SIGCHLD? */
/* childproc_continued(p); */
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 54a050f..3334fc2 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1845,10 +1845,16 @@ dontblock:
}
SBLASTRECORDCHK(&so->so_rcv);
SBLASTMBUFCHK(&so->so_rcv);
- error = sbwait(&so->so_rcv);
- if (error) {
- SOCKBUF_UNLOCK(&so->so_rcv);
- goto release;
+ /*
+ * We could receive some data while was notifying
+ * the protocol. Skip blocking in this case.
+ */
+ if (so->so_rcv.sb_mb == NULL) {
+ error = sbwait(&so->so_rcv);
+ if (error) {
+ SOCKBUF_UNLOCK(&so->so_rcv);
+ goto release;
+ }
}
m = so->so_rcv.sb_mb;
if (m != NULL)
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index a4bbdba..19aaee0 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -747,6 +747,10 @@ kern_sendit(td, s, mp, flags, control, segflg)
return (error);
so = (struct socket *)fp->f_data;
+#ifdef KTRACE
+ if (mp->msg_name != NULL && KTRPOINT(td, KTR_STRUCT))
+ ktrsockaddr(mp->msg_name);
+#endif
#ifdef MAC
if (mp->msg_name != NULL) {
error = mac_socket_check_connect(td->td_ucred, so,
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 00681ca..2743089 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -3999,10 +3999,11 @@ DB_SHOW_COMMAND(buffer, db_show_buffer)
db_printf("b_flags = 0x%b\n", (u_int)bp->b_flags, PRINT_BUF_FLAGS);
db_printf(
"b_error = %d, b_bufsize = %ld, b_bcount = %ld, b_resid = %ld\n"
- "b_bufobj = (%p), b_data = %p, b_blkno = %jd, b_dep = %p\n",
+ "b_bufobj = (%p), b_data = %p, b_blkno = %jd, b_lblkno = %jd, "
+ "b_dep = %p\n",
bp->b_error, bp->b_bufsize, bp->b_bcount, bp->b_resid,
bp->b_bufobj, bp->b_data, (intmax_t)bp->b_blkno,
- bp->b_dep.lh_first);
+ (intmax_t)bp->b_lblkno, bp->b_dep.lh_first);
if (bp->b_npages) {
int i;
db_printf("b_npages = %d, pages(OBJ, IDX, PA): ", bp->b_npages);
diff --git a/sys/kgssapi/gss_impl.c b/sys/kgssapi/gss_impl.c
index 01d940a..09b0a4b 100644
--- a/sys/kgssapi/gss_impl.c
+++ b/sys/kgssapi/gss_impl.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <kgssapi/gssapi_impl.h>
#include <rpc/rpc.h>
#include <rpc/rpc_com.h>
+#include <rpc/rpcsec_gss.h>
#include "gssd.h"
#include "kgss_if.h"
@@ -253,8 +254,40 @@ kgss_copy_buffer(const gss_buffer_t from, gss_buffer_t to)
static int
kgssapi_modevent(module_t mod, int type, void *data)
{
-
- return (0);
+ int error = 0;
+
+ switch (type) {
+ case MOD_LOAD:
+ rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind;
+ rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge;
+ rpc_gss_entries.rpc_gss_seccreate = rpc_gss_seccreate;
+ rpc_gss_entries.rpc_gss_set_defaults = rpc_gss_set_defaults;
+ rpc_gss_entries.rpc_gss_max_data_length =
+ rpc_gss_max_data_length;
+ rpc_gss_entries.rpc_gss_get_error = rpc_gss_get_error;
+ rpc_gss_entries.rpc_gss_mech_to_oid = rpc_gss_mech_to_oid;
+ rpc_gss_entries.rpc_gss_oid_to_mech = rpc_gss_oid_to_mech;
+ rpc_gss_entries.rpc_gss_qop_to_num = rpc_gss_qop_to_num;
+ rpc_gss_entries.rpc_gss_get_mechanisms = rpc_gss_get_mechanisms;
+ rpc_gss_entries.rpc_gss_get_versions = rpc_gss_get_versions;
+ rpc_gss_entries.rpc_gss_is_installed = rpc_gss_is_installed;
+ rpc_gss_entries.rpc_gss_set_svc_name = rpc_gss_set_svc_name;
+ rpc_gss_entries.rpc_gss_clear_svc_name = rpc_gss_clear_svc_name;
+ rpc_gss_entries.rpc_gss_getcred = rpc_gss_getcred;
+ rpc_gss_entries.rpc_gss_set_callback = rpc_gss_set_callback;
+ rpc_gss_entries.rpc_gss_clear_callback = rpc_gss_clear_callback;
+ rpc_gss_entries.rpc_gss_get_principal_name =
+ rpc_gss_get_principal_name;
+ rpc_gss_entries.rpc_gss_svc_max_data_length =
+ rpc_gss_svc_max_data_length;
+ break;
+ case MOD_UNLOAD:
+ /* Unloading of the kgssapi module isn't supported. */
+ /* FALLTHROUGH */
+ default:
+ error = EOPNOTSUPP;
+ };
+ return (error);
}
static moduledata_t kgssapi_mod = {
"kgssapi",
diff --git a/sys/mips/cavium/octeon_ebt3000_cf.c b/sys/mips/cavium/octeon_ebt3000_cf.c
index 7955d19..f5a44c4 100644
--- a/sys/mips/cavium/octeon_ebt3000_cf.c
+++ b/sys/mips/cavium/octeon_ebt3000_cf.c
@@ -104,12 +104,40 @@ __FBSDID("$FreeBSD$");
extern cvmx_bootinfo_t *octeon_bootinfo;
/* Globals */
-int bus_width;
+/*
+ * There's three bus types supported by this driver.
+ *
+ * CF_8 -- Traditional PC Card IDE interface on an 8-bit wide bus. We assume
+ * the bool loader has configure attribute memory properly. We then access
+ * the device like old-school 8-bit IDE card (which is all a traditional PC Card
+ * interface really is).
+ * CF_16 -- Traditional PC Card IDE interface on a 16-bit wide bus. Registers on
+ * this bus are 16-bits wide too. When accessing registers in the task file, you
+ * have to do it in 16-bit chunks, and worry about masking out what you don't want
+ * or ORing together the traditional 8-bit values. We assume the bootloader does
+ * the right attribute memory initialization dance.
+ * CF_TRUE_IDE_8 - CF Card wired to True IDE mode. There's no Attribute memory
+ * space at all. Instead all the traditional 8-bit registers are there, but
+ * on a 16-bit bus where addr0 isn't wired. This means we need to read/write them
+ * 16-bit chunks, but only the lower 8 bits are valid. We do not (and can not)
+ * access this like CF_16 with the comingled registers. Yet we can't access
+ * this like CF_8 because of the register offset. Except the TF_DATA register
+ * appears to be full width?
+ */
void *base_addr;
+int bus_type;
+#define CF_8 1 /* 8-bit bus, no offsets - PC Card */
+#define CF_16 2 /* 16-bit bus, registers shared - PC Card */
+#define CF_TRUE_IDE_8 3 /* 16-bit bus, only lower 8-bits, TrueIDE */
+const char *const cf_type[] = {
+ "impossible type",
+ "CF 8-bit",
+ "CF 16-bit",
+ "True IDE"
+};
/* Device softc */
struct cf_priv {
-
device_t dev;
struct drive_param *drive_param;
@@ -230,9 +258,65 @@ static void cf_start (struct bio *bp)
static int cf_ioctl (struct g_provider *pp, u_long cmd, void *data, int fflag, struct thread *td)
{
- return (0);
+ return (0);
+}
+
+
+static uint8_t cf_inb_8(int port)
+{
+ /*
+ * Traditional 8-bit PC Card/CF bus access.
+ */
+ if (bus_type == CF_8) {
+ volatile uint8_t *task_file = (volatile uint8_t *)base_addr;
+ return task_file[port];
+ }
+
+ /*
+ * True IDE access. lower 8 bits on a 16-bit bus (see above).
+ */
+ volatile uint16_t *task_file = (volatile uint16_t *)base_addr;
+ return task_file[port] & 0xff;
+}
+
+static void cf_outb_8(int port, uint8_t val)
+{
+ /*
+ * Traditional 8-bit PC Card/CF bus access.
+ */
+ if (bus_type == CF_8) {
+ volatile uint8_t *task_file = (volatile uint8_t *)base_addr;
+ task_file[port] = val;
+ }
+
+ /*
+ * True IDE access. lower 8 bits on a 16-bit bus (see above).
+ */
+ volatile uint16_t *task_file = (volatile uint16_t *)base_addr;
+ task_file[port] = val & 0xff;
+}
+
+static uint8_t cf_inb_16(int port)
+{
+ volatile uint16_t *task_file = (volatile uint16_t *)base_addr;
+ uint16_t val = task_file[port / 2];
+ if (port & 1)
+ return (val >> 8) & 0xff;
+ return val & 0xff;
}
+static uint16_t cf_inw_16(int port)
+{
+ volatile uint16_t *task_file = (volatile uint16_t *)base_addr;
+ uint16_t val = task_file[port / 2];
+ return val;
+}
+
+static void cf_outw_16(int port, uint16_t val)
+{
+ volatile uint16_t *task_file = (volatile uint16_t *)base_addr;
+ task_file[port / 2] = val;
+}
/* ------------------------------------------------------------------- *
* cf_cmd_read() *
@@ -264,25 +348,29 @@ static int cf_cmd_read (uint32_t nr_sectors, uint32_t start_sector, void *buf)
return (error);
}
- if (bus_width == 8) {
- volatile uint8_t *task_file = (volatile uint8_t*)base_addr;
- volatile uint8_t dummy;
+ switch (bus_type)
+ {
+ case CF_8:
for (count = 0; count < SECTOR_SIZE; count++) {
- *ptr_8++ = task_file[TF_DATA];
- if ((count & 0xf) == 0) dummy = task_file[TF_STATUS];
+ *ptr_8++ = cf_inb_8(TF_DATA);
+ if ((count & 0xf) == 0)
+ (void)cf_inb_8(TF_STATUS);
}
- } else {
- volatile uint16_t *task_file = (volatile uint16_t*)base_addr;
- volatile uint16_t dummy;
+ break;
+ case CF_TRUE_IDE_8:
+ case CF_16:
+ default:
for (count = 0; count < SECTOR_SIZE; count+=2) {
uint16_t temp;
- temp = task_file[TF_DATA];
+ temp = cf_inw_16(TF_DATA);
*ptr_16++ = SWAP_SHORT(temp);
- if ((count & 0xf) == 0) dummy = task_file[TF_STATUS/2];
+ if ((count & 0xf) == 0)
+ (void)cf_inb_16(TF_STATUS);
}
+ break;
}
- lba ++;
+ lba++;
}
#ifdef OCTEON_VISUAL_CF_0
octeon_led_write_char(0, ' ');
@@ -320,28 +408,28 @@ static int cf_cmd_write (uint32_t nr_sectors, uint32_t start_sector, void *buf)
return (error);
}
- if (bus_width == 8) {
- volatile uint8_t *task_file;
- volatile uint8_t dummy;
-
- task_file = (volatile uint8_t *) base_addr;
+ switch (bus_type)
+ {
+ case CF_8:
for (count = 0; count < SECTOR_SIZE; count++) {
- task_file[TF_DATA] = *ptr_8++;
- if ((count & 0xf) == 0) dummy = task_file[TF_STATUS];
+ cf_outb_8(TF_DATA, *ptr_8++);
+ if ((count & 0xf) == 0)
+ (void)cf_inb_8(TF_STATUS);
}
- } else {
- volatile uint16_t *task_file;
- volatile uint16_t dummy;
-
- task_file = (volatile uint16_t *) base_addr;
+ break;
+ case CF_TRUE_IDE_8:
+ case CF_16:
+ default:
for (count = 0; count < SECTOR_SIZE; count+=2) {
uint16_t temp = *ptr_16++;
- task_file[TF_DATA] = SWAP_SHORT(temp);
- if ((count & 0xf) == 0) dummy = task_file[TF_STATUS/2];
+ cf_outw_16(TF_DATA, SWAP_SHORT(temp));
+ if ((count & 0xf) == 0)
+ (void)cf_inb_16(TF_STATUS);
}
+ break;
}
- lba ++;
+ lba++;
}
#ifdef OCTEON_VISUAL_CF_1
octeon_led_write_char(1, ' ');
@@ -361,59 +449,32 @@ static int cf_cmd_write (uint32_t nr_sectors, uint32_t start_sector, void *buf)
static int cf_cmd_identify (void)
{
int count;
- uint8_t status;
int error;
- if (bus_width == 8) {
- volatile uint8_t *task_file;
-
- task_file = (volatile uint8_t *) base_addr;
-
- while ((status = task_file[TF_STATUS]) & STATUS_BSY) {
- DELAY(WAIT_DELAY);
- }
-
- task_file[TF_SECTOR_COUNT] = 0;
- task_file[TF_SECTOR_NUMBER] = 0;
- task_file[TF_CYL_LSB] = 0;
- task_file[TF_CYL_MSB] = 0;
- task_file[TF_DRV_HEAD] = 0;
- task_file[TF_COMMAND] = CMD_IDENTIFY;
-
- error = cf_wait_busy();
- if (error == 0) {
- for (count = 0; count < SECTOR_SIZE; count++)
- drive_param.u.buf[count] = task_file[TF_DATA];
- }
- } else {
- volatile uint16_t *task_file;
-
- task_file = (volatile uint16_t *) base_addr;
-
- while ((status = (task_file[TF_STATUS/2]>>8)) & STATUS_BSY) {
- DELAY(WAIT_DELAY);
- }
-
- task_file[TF_SECTOR_COUNT/2] = 0; /* this includes TF_SECTOR_NUMBER */
- task_file[TF_CYL_LSB/2] = 0; /* this includes TF_CYL_MSB */
- task_file[TF_DRV_HEAD/2] = 0 | (CMD_IDENTIFY<<8); /* this includes TF_COMMAND */
-
- error = cf_wait_busy();
- if (error == 0) {
- for (count = 0; count < SECTOR_SIZE; count+=2) {
- uint16_t temp;
- temp = task_file[TF_DATA];
-
- /* endianess will be swapped below */
- drive_param.u.buf[count] = (temp & 0xff);
- drive_param.u.buf[count+1] = (temp & 0xff00)>>8;
- }
- }
- }
+ error = cf_send_cmd(0, CMD_IDENTIFY);
if (error != 0) {
printf("%s: identify failed: %d\n", __func__, error);
return (error);
}
+ switch (bus_type)
+ {
+ case CF_8:
+ for (count = 0; count < SECTOR_SIZE; count++)
+ drive_param.u.buf[count] = cf_inb_8(TF_DATA);
+ break;
+ case CF_TRUE_IDE_8:
+ case CF_16:
+ default:
+ for (count = 0; count < SECTOR_SIZE; count += 2) {
+ uint16_t temp;
+ temp = cf_inw_16(TF_DATA);
+
+ /* endianess will be swapped below */
+ drive_param.u.buf[count] = (temp & 0xff);
+ drive_param.u.buf[count + 1] = (temp & 0xff00) >> 8;
+ }
+ break;
+ }
cf_swap_ascii(drive_param.u.driveid.model, drive_param.model);
@@ -423,6 +484,7 @@ static int cf_cmd_identify (void)
drive_param.sec_track = SWAP_SHORT (drive_param.u.driveid.current_sectors);
drive_param.nr_sectors = (uint32_t)SWAP_SHORT (drive_param.u.driveid.lba_size_1) |
((uint32_t)SWAP_SHORT (drive_param.u.driveid.lba_size_2));
+ printf("cf0: <%s> %lld sectors\n", drive_param.model, (long long)drive_param.nr_sectors);
return (0);
}
@@ -437,37 +499,27 @@ static int cf_cmd_identify (void)
*/
static int cf_send_cmd (uint32_t lba, uint8_t cmd)
{
- uint8_t status;
-
- if (bus_width == 8) {
- volatile uint8_t *task_file;
-
- task_file = (volatile uint8_t *) base_addr;
-
- while ( (status = task_file[TF_STATUS]) & STATUS_BSY) {
+ switch (bus_type)
+ {
+ case CF_8:
+ case CF_TRUE_IDE_8:
+ while (cf_inb_8(TF_STATUS) & STATUS_BSY)
DELAY(WAIT_DELAY);
- }
-
- task_file[TF_SECTOR_COUNT] = 1;
- task_file[TF_SECTOR_NUMBER] = (lba & 0xff);
- task_file[TF_CYL_LSB] = ((lba >> 8) & 0xff);
- task_file[TF_CYL_MSB] = ((lba >> 16) & 0xff);
- task_file[TF_DRV_HEAD] = ((lba >> 24) & 0xff) | 0xe0;
- task_file[TF_COMMAND] = cmd;
-
- } else {
- volatile uint16_t *task_file;
-
- task_file = (volatile uint16_t *) base_addr;
-
- while ( (status = (task_file[TF_STATUS/2]>>8)) & STATUS_BSY) {
+ cf_outb_8(TF_SECTOR_COUNT, 1);
+ cf_outb_8(TF_SECTOR_NUMBER, lba & 0xff);
+ cf_outb_8(TF_CYL_LSB, (lba >> 8) & 0xff);
+ cf_outb_8(TF_CYL_MSB, (lba >> 16) & 0xff);
+ cf_outb_8(TF_DRV_HEAD, ((lba >> 24) & 0xff) | 0xe0);
+ cf_outb_8(TF_COMMAND, cmd);
+ break;
+ case CF_16:
+ default:
+ while (cf_inb_16(TF_STATUS) & STATUS_BSY)
DELAY(WAIT_DELAY);
- }
-
- task_file[TF_SECTOR_COUNT/2] = 1 | ((lba & 0xff) << 8);
- task_file[TF_CYL_LSB/2] = ((lba >> 8) & 0xff) | (((lba >> 16) & 0xff) << 8);
- task_file[TF_DRV_HEAD/2] = (((lba >> 24) & 0xff) | 0xe0) | (cmd << 8);
-
+ cf_outw_16(TF_SECTOR_COUNT, 1 | ((lba & 0xff) << 8));
+ cf_outw_16(TF_CYL_LSB, ((lba >> 8) & 0xff) | (((lba >> 16) & 0xff) << 8));
+ cf_outw_16(TF_DRV_HEAD, (((lba >> 24) & 0xff) | 0xe0) | (cmd << 8));
+ break;
}
return (cf_wait_busy());
@@ -499,32 +551,32 @@ static int cf_wait_busy (void)
octeon_led_run_wheel(&where0, 2);
#endif
- if (bus_width == 8) {
- volatile uint8_t *task_file;
- task_file = (volatile uint8_t *)base_addr;
-
- status = task_file[TF_STATUS];
+ switch (bus_type)
+ {
+ case CF_8:
+ case CF_TRUE_IDE_8:
+ status = cf_inb_8(TF_STATUS);
while ((status & STATUS_BSY) == STATUS_BSY) {
if ((status & STATUS_DF) != 0) {
printf("%s: device fault (status=%x)\n", __func__, status);
return (EIO);
}
DELAY(WAIT_DELAY);
- status = task_file[TF_STATUS];
+ status = cf_inb_8(TF_STATUS);
}
- } else {
- volatile uint16_t *task_file;
- task_file = (volatile uint16_t *)base_addr;
-
- status = task_file[TF_STATUS/2]>>8;
+ break;
+ case CF_16:
+ default:
+ status = cf_inb_16(TF_STATUS);
while ((status & STATUS_BSY) == STATUS_BSY) {
if ((status & STATUS_DF) != 0) {
printf("%s: device fault (status=%x)\n", __func__, status);
return (EIO);
}
DELAY(WAIT_DELAY);
- status = (uint8_t)(task_file[TF_STATUS/2]>>8);
+ status = cf_inb_16(TF_STATUS);
}
+ break;
}
if ((status & STATUS_DRQ) == 0) {
printf("%s: device not ready (status=%x)\n", __func__, status);
@@ -550,9 +602,8 @@ static void cf_swap_ascii (unsigned char str1[], char str2[])
{
int i;
- for(i = 0; i < MODEL_STR_SIZE; i++) {
- str2[i] = str1[i^1];
- }
+ for(i = 0; i < MODEL_STR_SIZE; i++)
+ str2[i] = str1[i ^ 1];
}
@@ -562,7 +613,8 @@ static void cf_swap_ascii (unsigned char str1[], char str2[])
static int cf_probe (device_t dev)
{
- if (octeon_is_simulation()) return 1;
+ if (octeon_is_simulation())
+ return (ENXIO);
if (device_get_unit(dev) != 0) {
panic("can't attach more devices\n");
@@ -582,9 +634,9 @@ static int cf_probe (device_t dev)
* inserted.
*
*/
+typedef unsigned long long llu;
static void cf_identify (driver_t *drv, device_t parent)
{
- uint8_t status;
int bus_region;
int count = 0;
cvmx_mio_boot_reg_cfgx_t cfg;
@@ -599,34 +651,39 @@ static void cf_identify (driver_t *drv, device_t parent)
cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(bus_region));
if (cfg.s.base == octeon_bootinfo->compact_flash_common_base_addr >> 16)
{
- bus_width = (cfg.s.width) ? 16: 8;
- printf("Compact flash found in bootbus region %d (%d bit).\n", bus_region, bus_width);
+ if (octeon_bootinfo->compact_flash_attribute_base_addr == 0)
+ bus_type = CF_TRUE_IDE_8;
+ else
+ bus_type = (cfg.s.width) ? CF_16 : CF_8;
+ printf("Compact flash found in bootbus region %d (%s).\n", bus_region, cf_type[bus_type]);
break;
}
}
- if (bus_width == 8) {
- volatile uint8_t *task_file;
- task_file = (volatile uint8_t *) base_addr;
+ switch (bus_type)
+ {
+ case CF_8:
+ case CF_TRUE_IDE_8:
/* Check if CF is inserted */
- while ( (status = task_file[TF_STATUS]) & STATUS_BSY){
- if ((count++) == NR_TRIES ) {
+ while (cf_inb_8(TF_STATUS) & STATUS_BSY) {
+ if ((count++) == NR_TRIES ) {
printf("Compact Flash not present\n");
return;
}
DELAY(WAIT_DELAY);
}
- } else {
- volatile uint16_t *task_file;
- task_file = (volatile uint16_t *) base_addr;
+ break;
+ case CF_16:
+ default:
/* Check if CF is inserted */
- while ( (status = (task_file[TF_STATUS/2]>>8)) & STATUS_BSY){
- if ((count++) == NR_TRIES ) {
+ while (cf_inb_16(TF_STATUS) & STATUS_BSY) {
+ if ((count++) == NR_TRIES ) {
printf("Compact Flash not present\n");
return;
}
DELAY(WAIT_DELAY);
}
+ break;
}
BUS_ADD_CHILD(parent, 0, "cf", 0);
@@ -655,7 +712,7 @@ static int cf_attach_geom (void *arg, int flag)
* ------------------------------------------------------------------- */
static void cf_attach_geom_proxy (void *arg, int flag)
{
- cf_attach_geom(arg, flag);
+ cf_attach_geom(arg, flag);
}
@@ -668,7 +725,8 @@ static int cf_attach (device_t dev)
{
struct cf_priv *cf_priv;
- if (octeon_is_simulation()) return 1;
+ if (octeon_is_simulation())
+ return (ENXIO);
cf_priv = device_get_softc(dev);
cf_priv->dev = dev;
@@ -701,4 +759,3 @@ static driver_t cf_driver = {
static devclass_t cf_devclass;
DRIVER_MODULE(cf, nexus, cf_driver, cf_devclass, 0, 0);
-
diff --git a/sys/mips/cavium/octeon_mp.c b/sys/mips/cavium/octeon_mp.c
index 78eafa6..efddee8 100644
--- a/sys/mips/cavium/octeon_mp.c
+++ b/sys/mips/cavium/octeon_mp.c
@@ -102,10 +102,18 @@ platform_init_ap(int cpuid)
mips_wbflush();
}
-cpumask_t
-platform_cpu_mask(void)
+void
+platform_cpu_mask(cpuset_t *mask)
{
- return (octeon_bootinfo->core_mask);
+
+ CPU_ZERO(mask);
+
+ /*
+ * XXX: hack in order to simplify CPU set building, assuming that
+ * core_mask is 32-bits.
+ */
+ memcpy(mask, &octeon_bootinfo->core_mask,
+ sizeof(octeon_bootinfo->core_mask));
}
struct cpu_group *
diff --git a/sys/mips/include/_types.h b/sys/mips/include/_types.h
index 4d57e20..2f23db6 100644
--- a/sys/mips/include/_types.h
+++ b/sys/mips/include/_types.h
@@ -73,7 +73,6 @@ typedef unsigned long long __uint64_t;
* Standard type definitions.
*/
typedef __int32_t __clock_t; /* clock()... */
-typedef unsigned int __cpumask_t;
typedef double __double_t;
typedef double __float_t;
#ifdef __mips_n64
diff --git a/sys/mips/include/hwfunc.h b/sys/mips/include/hwfunc.h
index 683aedb..a9e3285 100644
--- a/sys/mips/include/hwfunc.h
+++ b/sys/mips/include/hwfunc.h
@@ -28,6 +28,8 @@
#ifndef _MACHINE_HWFUNC_H_
#define _MACHINE_HWFUNC_H_
+#include <sys/_cpuset.h>
+
struct trapframe;
struct timecounter;
/*
@@ -91,7 +93,7 @@ extern int platform_processor_id(void);
/*
* Return the cpumask of available processors.
*/
-extern cpumask_t platform_cpu_mask(void);
+extern void platform_cpu_mask(cpuset_t *mask);
/*
* Return the topology of processors on this platform
diff --git a/sys/mips/include/pmap.h b/sys/mips/include/pmap.h
index e710635..90375eb 100644
--- a/sys/mips/include/pmap.h
+++ b/sys/mips/include/pmap.h
@@ -58,6 +58,7 @@
#ifndef LOCORE
#include <sys/queue.h>
+#include <sys/_cpuset.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
@@ -83,7 +84,7 @@ struct pmap {
pd_entry_t *pm_segtab; /* KVA of segment table */
TAILQ_HEAD(, pv_entry) pm_pvlist; /* list of mappings in
* pmap */
- cpumask_t pm_active; /* active on cpus */
+ cpuset_t pm_active; /* active on cpus */
struct {
u_int32_t asid:ASID_BITS; /* TLB address space tag */
u_int32_t gen:ASIDGEN_BITS; /* its generation number */
diff --git a/sys/mips/include/smp.h b/sys/mips/include/smp.h
index 58aaf03..0fcca9a 100644
--- a/sys/mips/include/smp.h
+++ b/sys/mips/include/smp.h
@@ -17,6 +17,8 @@
#ifdef _KERNEL
+#include <sys/_cpuset.h>
+
#include <machine/pcb.h>
/*
@@ -33,7 +35,7 @@
void ipi_all_but_self(int ipi);
void ipi_cpu(int cpu, u_int ipi);
-void ipi_selected(cpumask_t cpus, int ipi);
+void ipi_selected(cpuset_t cpus, int ipi);
void smp_init_secondary(u_int32_t cpuid);
void mpentry(void);
diff --git a/sys/mips/mips/mp_machdep.c b/sys/mips/mips/mp_machdep.c
index e945736..79a3476 100644
--- a/sys/mips/mips/mp_machdep.c
+++ b/sys/mips/mips/mp_machdep.c
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/cpuset.h>
#include <sys/ktr.h>
#include <sys/proc.h>
#include <sys/lock.h>
@@ -80,15 +81,16 @@ ipi_all_but_self(int ipi)
/* Send an IPI to a set of cpus. */
void
-ipi_selected(cpumask_t cpus, int ipi)
+ipi_selected(cpuset_t cpus, int ipi)
{
struct pcpu *pc;
- CTR3(KTR_SMP, "%s: cpus: %x, ipi: %x\n", __func__, cpus, ipi);
-
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
- if ((cpus & pc->pc_cpumask) != 0)
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
+ if (CPU_OVERLAP(&cpus, &pc->pc_cpumask)) {
+ CTR3(KTR_SMP, "%s: pc: %p, ipi: %x\n", __func__, pc,
+ ipi);
ipi_send(pc, ipi);
+ }
}
}
@@ -108,7 +110,7 @@ static int
mips_ipi_handler(void *arg)
{
int cpu;
- cpumask_t cpumask;
+ cpuset_t cpumask;
u_int ipi, ipi_bitmap;
int bit;
@@ -148,14 +150,14 @@ mips_ipi_handler(void *arg)
tlb_save();
/* Indicate we are stopped */
- atomic_set_int(&stopped_cpus, cpumask);
+ CPU_OR_ATOMIC(&stopped_cpus, &cpumask);
/* Wait for restart */
- while ((started_cpus & cpumask) == 0)
+ while (!CPU_OVERLAP(&started_cpus, &cpumask))
cpu_spinwait();
- atomic_clear_int(&started_cpus, cpumask);
- atomic_clear_int(&stopped_cpus, cpumask);
+ CPU_NAND_ATOMIC(&started_cpus, &cpumask);
+ CPU_NAND_ATOMIC(&stopped_cpus, &cpumask);
CTR0(KTR_SMP, "IPI_STOP (restart)");
break;
case IPI_PREEMPT:
@@ -200,14 +202,22 @@ start_ap(int cpuid)
void
cpu_mp_setmaxid(void)
{
- cpumask_t cpumask;
-
- cpumask = platform_cpu_mask();
- mp_ncpus = bitcount32(cpumask);
+ cpuset_t cpumask;
+ int cpu, last;
+
+ platform_cpu_mask(&cpumask);
+ mp_ncpus = 0;
+ last = 1;
+ while ((cpu = cpusetobj_ffs(&cpumask)) != 0) {
+ last = cpu;
+ cpu--;
+ CPU_CLR(cpu, &cpumask);
+ mp_ncpus++;
+ }
if (mp_ncpus <= 0)
mp_ncpus = 1;
- mp_maxid = min(fls(cpumask), MAXCPU) - 1;
+ mp_maxid = min(last, MAXCPU) - 1;
}
void
@@ -233,16 +243,16 @@ void
cpu_mp_start(void)
{
int error, cpuid;
- cpumask_t cpumask;
+ cpuset_t cpumask, ocpus;
mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN);
- all_cpus = 0;
- cpumask = platform_cpu_mask();
+ CPU_ZERO(&all_cpus);
+ platform_cpu_mask(&cpumask);
- while (cpumask != 0) {
- cpuid = ffs(cpumask) - 1;
- cpumask &= ~(1 << cpuid);
+ while (!CPU_EMPTY(&cpumask)) {
+ cpuid = cpusetobj_ffs(&cpumask) - 1;
+ CPU_CLR(cpuid, &cpumask);
if (cpuid >= MAXCPU) {
printf("cpu_mp_start: ignoring AP #%d.\n", cpuid);
@@ -257,15 +267,19 @@ cpu_mp_start(void)
if (bootverbose)
printf("AP #%d started!\n", cpuid);
}
- all_cpus |= 1 << cpuid;
+ CPU_SET(cpuid, &all_cpus);
}
- PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
+ ocpus = all_cpus;
+ CPU_CLR(PCPU_GET(cpuid), &ocpus);
+ PCPU_SET(other_cpus, ocpus);
}
void
smp_init_secondary(u_int32_t cpuid)
{
+ cpuset_t ocpus;
+
/* TLB */
mips_wr_wired(0);
tlb_invalidate_all();
@@ -303,7 +317,9 @@ smp_init_secondary(u_int32_t cpuid)
CTR1(KTR_SMP, "SMP: AP CPU #%d launched", PCPU_GET(cpuid));
/* Build our map of 'other' CPUs. */
- PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask));
+ ocpus = all_cpus;
+ CPU_CLR(PCPU_GET(cpuid), &ocpus);
+ PCPU_SET(other_cpus, ocpus);
if (bootverbose)
printf("SMP: AP CPU #%d launched.\n", PCPU_GET(cpuid));
diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c
index 7f0f4f0..f7ea660 100644
--- a/sys/mips/mips/pmap.c
+++ b/sys/mips/mips/pmap.c
@@ -471,7 +471,7 @@ pmap_create_kernel_pagetable(void)
PMAP_LOCK_INIT(kernel_pmap);
kernel_pmap->pm_segtab = kernel_segmap;
- kernel_pmap->pm_active = ~0;
+ CPU_FILL(&kernel_pmap->pm_active);
TAILQ_INIT(&kernel_pmap->pm_pvlist);
kernel_pmap->pm_asid[0].asid = PMAP_ASID_RESERVED;
kernel_pmap->pm_asid[0].gen = 0;
@@ -630,10 +630,14 @@ pmap_invalidate_all_local(pmap_t pmap)
tlb_invalidate_all();
return;
}
- if (pmap->pm_active & PCPU_GET(cpumask))
+ sched_pin();
+ if (CPU_OVERLAP(&pmap->pm_active, PCPU_PTR(cpumask))) {
+ sched_unpin();
tlb_invalidate_all_user(pmap);
- else
+ } else {
+ sched_unpin();
pmap->pm_asid[PCPU_GET(cpuid)].gen = 0;
+ }
}
#ifdef SMP
@@ -667,12 +671,16 @@ pmap_invalidate_page_local(pmap_t pmap, vm_offset_t va)
tlb_invalidate_address(pmap, va);
return;
}
- if (pmap->pm_asid[PCPU_GET(cpuid)].gen != PCPU_GET(asid_generation))
+ sched_pin();
+ if (pmap->pm_asid[PCPU_GET(cpuid)].gen != PCPU_GET(asid_generation)) {
+ sched_unpin();
return;
- else if (!(pmap->pm_active & PCPU_GET(cpumask))) {
+ } else if (!CPU_OVERLAP(&pmap->pm_active, PCPU_PTR(cpumask))) {
pmap->pm_asid[PCPU_GET(cpuid)].gen = 0;
+ sched_unpin();
return;
}
+ sched_unpin();
tlb_invalidate_address(pmap, va);
}
@@ -716,12 +724,16 @@ pmap_update_page_local(pmap_t pmap, vm_offset_t va, pt_entry_t pte)
tlb_update(pmap, va, pte);
return;
}
- if (pmap->pm_asid[PCPU_GET(cpuid)].gen != PCPU_GET(asid_generation))
+ sched_pin();
+ if (pmap->pm_asid[PCPU_GET(cpuid)].gen != PCPU_GET(asid_generation)) {
+ sched_unpin();
return;
- else if (!(pmap->pm_active & PCPU_GET(cpumask))) {
+ } else if (!CPU_OVERLAP(&pmap->pm_active, PCPU_PTR(cpumask))) {
pmap->pm_asid[PCPU_GET(cpuid)].gen = 0;
+ sched_unpin();
return;
}
+ sched_unpin();
tlb_update(pmap, va, pte);
}
@@ -1041,7 +1053,7 @@ pmap_pinit0(pmap_t pmap)
PMAP_LOCK_INIT(pmap);
pmap->pm_segtab = kernel_segmap;
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
pmap->pm_ptphint = NULL;
for (i = 0; i < MAXCPU; i++) {
pmap->pm_asid[i].asid = PMAP_ASID_RESERVED;
@@ -1102,7 +1114,7 @@ pmap_pinit(pmap_t pmap)
ptdva = MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(ptdpg));
pmap->pm_segtab = (pd_entry_t *)ptdva;
- pmap->pm_active = 0;
+ CPU_ZERO(&pmap->pm_active);
pmap->pm_ptphint = NULL;
for (i = 0; i < MAXCPU; i++) {
pmap->pm_asid[i].asid = PMAP_ASID_RESERVED;
@@ -2948,8 +2960,8 @@ pmap_activate(struct thread *td)
oldpmap = PCPU_GET(curpmap);
if (oldpmap)
- atomic_clear_32(&oldpmap->pm_active, PCPU_GET(cpumask));
- atomic_set_32(&pmap->pm_active, PCPU_GET(cpumask));
+ CPU_NAND_ATOMIC(&oldpmap->pm_active, PCPU_PTR(cpumask));
+ CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask));
pmap_asid_alloc(pmap);
if (td == curthread) {
PCPU_SET(segbase, pmap->pm_segtab);
@@ -3283,7 +3295,7 @@ pmap_kextract(vm_offset_t va)
pt_entry_t *ptep;
/* Is the kernel pmap initialized? */
- if (kernel_pmap->pm_active) {
+ if (!CPU_EMPTY(&kernel_pmap->pm_active)) {
/* It's inside the virtual address range */
ptep = pmap_pte(kernel_pmap, va);
if (ptep) {
diff --git a/sys/mips/rmi/xlr_machdep.c b/sys/mips/rmi/xlr_machdep.c
index 4a1734a..836c605 100644
--- a/sys/mips/rmi/xlr_machdep.c
+++ b/sys/mips/rmi/xlr_machdep.c
@@ -614,11 +614,15 @@ platform_processor_id(void)
return (xlr_hwtid_to_cpuid[xlr_cpu_id()]);
}
-cpumask_t
-platform_cpu_mask(void)
+void
+platform_cpu_mask(cpuset_t *mask)
{
+ int i, s;
- return (~0U >> (32 - (xlr_ncores * xlr_threads_per_core)));
+ CPU_ZERO(mask);
+ s = xlr_ncores * xlr_threads_per_core;
+ for (i = 0; i < s; i++)
+ CPU_SET(i, mask);
}
struct cpu_group *
diff --git a/sys/mips/sibyte/sb_scd.c b/sys/mips/sibyte/sb_scd.c
index e5ac23c..50b9987 100644
--- a/sys/mips/sibyte/sb_scd.c
+++ b/sys/mips/sibyte/sb_scd.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/module.h>
#include <sys/bus.h>
+#include <sys/cpuset.h>
#include <machine/resource.h>
#include <machine/hwfunc.h>
@@ -242,11 +243,15 @@ sb_clear_mailbox(int cpu, uint64_t val)
sb_store64(regaddr, val);
}
-cpumask_t
-platform_cpu_mask(void)
+void
+platform_cpu_mask(cpuset_t *mask)
{
+ int i, s;
- return (~0U >> (32 - SYSREV_NUM_PROCESSORS(sb_read_sysrev())));
+ CPU_ZERO(mask);
+ s = SYSREV_NUM_PROCESSORS(sb_read_sysrev());
+ for (i = 0; i < s; i++)
+ CPU_SET(i, mask);
}
#endif /* SMP */
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 22e0f20..8775e19 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -156,6 +156,8 @@ SUBDIR= ${_3dfx} \
jme \
joy \
kbdmux \
+ kgssapi \
+ kgssapi_krb5 \
khelp \
krpc \
ksyms \
diff --git a/sys/modules/ath/Makefile b/sys/modules/ath/Makefile
index b66ec09..49f7fa6 100644
--- a/sys/modules/ath/Makefile
+++ b/sys/modules/ath/Makefile
@@ -116,6 +116,12 @@ SRCS+= ar9280.c ar9280_attach.c ar9280_olc.c
SRCS+= ar9285.c ar9285_reset.c ar9285_attach.c ar9285_cal.c ar9285_phy.c
SRCS+= ar9285_diversity.c
+# + AR9287 - Kiwi
+.PATH: ${.CURDIR}/../../dev/ath/ath_hal
+SRCS+= ah_eeprom_9287.c
+.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9002
+SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c
+
# NB: rate control is bound to the driver by symbol names so only pick one
.if ${ATH_RATE} == "sample"
.PATH: ${.CURDIR}/../../dev/ath/ath_rate/sample
@@ -128,6 +134,10 @@ SRCS+= onoe.c
SRCS+= amrr.c
.endif
+# DFS
+.PATH: ${.CURDIR}/../../dev/ath/ath_dfs/null
+SRCS+= dfs_null.c
+
CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal
opt_ah.h:
diff --git a/sys/modules/cxgbe/if_cxgbe/Makefile b/sys/modules/cxgbe/if_cxgbe/Makefile
index a524cde..ac1d22c 100644
--- a/sys/modules/cxgbe/if_cxgbe/Makefile
+++ b/sys/modules/cxgbe/if_cxgbe/Makefile
@@ -6,7 +6,7 @@ CXGBE = ${.CURDIR}/../../../dev/cxgbe
.PATH: ${CXGBE} ${CXGBE}/common
KMOD = if_cxgbe
-SRCS = t4_main.c t4_sge.c
+SRCS = t4_main.c t4_sge.c t4_l2t.c
SRCS+= t4_hw.c
SRCS+= device_if.h bus_if.h pci_if.h
SRCS+= opt_inet.h
diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile
index 09fe55e..316b859 100644
--- a/sys/modules/dtrace/Makefile
+++ b/sys/modules/dtrace/Makefile
@@ -4,6 +4,7 @@
.include "Makefile.inc"
SUBDIR= dtmalloc \
+ dtnfscl \
dtnfsclient \
dtrace \
dtraceall \
diff --git a/sys/modules/dtrace/dtnfscl/Makefile b/sys/modules/dtrace/dtnfscl/Makefile
new file mode 100644
index 0000000..0296232
--- /dev/null
+++ b/sys/modules/dtrace/dtnfscl/Makefile
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../fs/nfsclient
+
+KMOD= dtnfscl
+SRCS= nfs_clkdtrace.c \
+ vnode_if.h
+
+CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
+ -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
+ -I${.CURDIR}/../../..
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dtrace/dtraceall/dtraceall.c b/sys/modules/dtrace/dtraceall/dtraceall.c
index 76172b7..61896bf 100644
--- a/sys/modules/dtrace/dtraceall/dtraceall.c
+++ b/sys/modules/dtrace/dtraceall/dtraceall.c
@@ -66,6 +66,7 @@ MODULE_DEPEND(dtraceall, cyclic, 1, 1, 1);
MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1);
MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1);
MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1);
+MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1);
MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1);
#if defined(__amd64__) || defined(__i386__)
MODULE_DEPEND(dtraceall, fbt, 1, 1, 1);
diff --git a/sys/modules/kgssapi_krb5/Makefile b/sys/modules/kgssapi_krb5/Makefile
index c2ee417..e5c3e30 100644
--- a/sys/modules/kgssapi_krb5/Makefile
+++ b/sys/modules/kgssapi_krb5/Makefile
@@ -8,7 +8,8 @@ SRCS= krb5_mech.c \
kcrypto_des.c \
kcrypto_des3.c \
kcrypto_aes.c \
- kcrypto_arcfour.c
+ kcrypto_arcfour.c \
+ opt_inet6.h
SRCS+= kgss_if.h gssd.h
MFILES= kgssapi/kgss_if.m
diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile
index 38f56cb..6288d66 100644
--- a/sys/modules/usb/Makefile
+++ b/sys/modules/usb/Makefile
@@ -30,7 +30,7 @@ SUBDIR += ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci}
SUBDIR += rum run uath upgt ural zyd ${_urtw}
SUBDIR += atp uhid ukbd ums udbp ufm uep
SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
- umct umodem umoscom uplcom uslcom uvisor uvscom
+ umct umcs umodem umoscom uplcom uslcom uvisor uvscom
SUBDIR += uether aue axe cdce cue kue mos rue udav uhso ipheth
SUBDIR += usfs umass urio
SUBDIR += quirk template
diff --git a/sys/modules/usb/umcs/Makefile b/sys/modules/usb/umcs/Makefile
new file mode 100644
index 0000000..be75fb5
--- /dev/null
+++ b/sys/modules/usb/umcs/Makefile
@@ -0,0 +1,36 @@
+#
+# $FreeBSD$
+#
+# Copyright (c) 2011 Hans Petter Selasky. All rights reserved.
+#
+# 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 AUTHOR 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 AUTHOR 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.
+#
+
+S= ${.CURDIR}/../../..
+
+.PATH: $S/dev/usb/serial
+
+KMOD= umcs
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ umcs.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index 2993838..e263b0b 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -1860,6 +1860,8 @@ bstp_tick(void *arg)
if (bs->bs_running == 0)
return;
+ CURVNET_SET(bs->bs_vnet);
+
/* slow timer to catch missed link events */
if (bstp_timer_expired(&bs->bs_link_timer)) {
LIST_FOREACH(bp, &bs->bs_bplist, bp_next)
@@ -1893,6 +1895,8 @@ bstp_tick(void *arg)
bp->bp_txcount--;
}
+ CURVNET_RESTORE();
+
callout_reset(&bs->bs_bstpcallout, hz, bstp_tick, bs);
}
@@ -2126,6 +2130,7 @@ bstp_attach(struct bstp_state *bs, struct bstp_cb_ops *cb)
bs->bs_protover = BSTP_PROTO_RSTP;
bs->bs_state_cb = cb->bcb_state;
bs->bs_rtage_cb = cb->bcb_rtage;
+ bs->bs_vnet = curvnet;
getmicrotime(&bs->bs_last_tc_time);
diff --git a/sys/net/bridgestp.h b/sys/net/bridgestp.h
index 74086fc..fdf16aa 100644
--- a/sys/net/bridgestp.h
+++ b/sys/net/bridgestp.h
@@ -358,6 +358,7 @@ struct bstp_state {
LIST_HEAD(, bstp_port) bs_bplist;
bstp_state_cb_t bs_state_cb;
bstp_rtage_cb_t bs_rtage_cb;
+ struct vnet *bs_vnet;
};
#define BSTP_LOCK_INIT(_bs) mtx_init(&(_bs)->bs_mtx, "bstp", NULL, MTX_DEF)
diff --git a/sys/net/if.h b/sys/net/if.h
index d291da8..06521cb 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -199,6 +199,13 @@ struct if_data {
* field. IFCAP_* and CSUM_* do not match one to one and CSUM_* may be
* more detailed or differenciated than IFCAP_*.
* Hwassist features are defined CSUM_* in sys/mbuf.h
+ *
+ * Capabilities that cannot be arbitrarily changed with ifconfig/ioctl
+ * are listed in IFCAP_CANTCHANGE, similar to IFF_CANTCHANGE.
+ * This is not strictly necessary because the common code never
+ * changes capabilities, and it is left to the individual driver
+ * to do the right thing. However, having the filter here
+ * avoids replication of the same code in all individual drivers.
*/
#define IFCAP_RXCSUM 0x00001 /* can offload checksum on RX */
#define IFCAP_TXCSUM 0x00002 /* can offload checksum on TX */
@@ -220,12 +227,15 @@ struct if_data {
#define IFCAP_POLLING_NOCOUNT 0x20000 /* polling ticks cannot be fragmented */
#define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */
#define IFCAP_LINKSTATE 0x80000 /* the runtime link state is dynamic */
+#define IFCAP_NETMAP 0x100000 /* netmap mode supported/enabled */
#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
#define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6)
#define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
#define IFCAP_TOE (IFCAP_TOE4 | IFCAP_TOE6)
+#define IFCAP_CANTCHANGE (IFCAP_NETMAP)
+
#define IFQ_MAXLEN 50
#define IFNET_SLOWHZ 1 /* granularity is 1 second */
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 5e5a548..be90f5a 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -561,7 +561,7 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared)
* mbuf chain m with the ethernet header at the front.
*/
static void
-ether_input(struct ifnet *ifp, struct mbuf *m)
+ether_input_internal(struct ifnet *ifp, struct mbuf *m)
{
struct ether_header *eh;
u_short etype;
@@ -755,6 +755,46 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
}
/*
+ * Ethernet input dispatch; by default, direct dispatch here regardless of
+ * global configuration.
+ */
+static void
+ether_nh_input(struct mbuf *m)
+{
+
+ ether_input_internal(m->m_pkthdr.rcvif, m);
+}
+
+static struct netisr_handler ether_nh = {
+ .nh_name = "ether",
+ .nh_handler = ether_nh_input,
+ .nh_proto = NETISR_ETHER,
+ .nh_policy = NETISR_POLICY_SOURCE,
+ .nh_dispatch = NETISR_DISPATCH_DIRECT,
+};
+
+static void
+ether_init(__unused void *arg)
+{
+
+ netisr_register(&ether_nh);
+}
+SYSINIT(ether, SI_SUB_INIT_IF, SI_ORDER_ANY, ether_init, NULL);
+
+static void
+ether_input(struct ifnet *ifp, struct mbuf *m)
+{
+
+ /*
+ * We will rely on rcvif being set properly in the deferred context,
+ * so assert it is correct here.
+ */
+ KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__));
+
+ netisr_dispatch(NETISR_ETHER, m);
+}
+
+/*
* Upper layer processing for a received Ethernet packet.
*/
void
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index de968af..5f8156b 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -48,6 +48,7 @@
#include <sys/param.h>
#include <sys/jail.h>
#include <sys/kernel.h>
+#include <sys/libkern.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mbuf.h>
@@ -91,6 +92,14 @@
#define GRENAME "gre"
+#define MTAG_COOKIE_GRE 1307983903
+#define MTAG_GRE_NESTING 1
+struct mtag_gre_nesting {
+ uint16_t count;
+ uint16_t max;
+ struct ifnet *ifp[];
+};
+
/*
* gre_mtx protects all global variables in if_gre.c.
* XXX: gre_softc data not protected yet.
@@ -196,7 +205,6 @@ gre_clone_create(ifc, unit, params)
sc->g_proto = IPPROTO_GRE;
GRE2IFP(sc)->if_flags |= IFF_LINK0;
sc->encap = NULL;
- sc->called = 0;
sc->gre_fibnum = curthread->td_proc->p_fibnum;
sc->wccp_ver = WCCP_V1;
sc->key = 0;
@@ -240,23 +248,77 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
struct gre_softc *sc = ifp->if_softc;
struct greip *gh;
struct ip *ip;
+ struct m_tag *mtag;
+ struct mtag_gre_nesting *gt;
+ size_t len;
u_short gre_ip_id = 0;
uint8_t gre_ip_tos = 0;
u_int16_t etype = 0;
struct mobile_h mob_h;
u_int32_t af;
- int extra = 0;
+ int extra = 0, max;
/*
- * gre may cause infinite recursion calls when misconfigured.
- * We'll prevent this by introducing upper limit.
+ * gre may cause infinite recursion calls when misconfigured. High
+ * nesting level may cause stack exhaustion. We'll prevent this by
+ * detecting loops and by introducing upper limit.
*/
- if (++(sc->called) > max_gre_nesting) {
- printf("%s: gre_output: recursively called too many "
- "times(%d)\n", if_name(GRE2IFP(sc)), sc->called);
- m_freem(m);
- error = EIO; /* is there better errno? */
- goto end;
+ mtag = m_tag_locate(m, MTAG_COOKIE_GRE, MTAG_GRE_NESTING, NULL);
+ if (mtag != NULL) {
+ struct ifnet **ifp2;
+
+ gt = (struct mtag_gre_nesting *)(mtag + 1);
+ gt->count++;
+ if (gt->count > min(gt->max,max_gre_nesting)) {
+ printf("%s: hit maximum recursion limit %u on %s\n",
+ __func__, gt->count - 1, ifp->if_xname);
+ m_freem(m);
+ error = EIO; /* is there better errno? */
+ goto end;
+ }
+
+ ifp2 = gt->ifp;
+ for (max = gt->count - 1; max > 0; max--) {
+ if (*ifp2 == ifp)
+ break;
+ ifp2++;
+ }
+ if (*ifp2 == ifp) {
+ printf("%s: detected loop with nexting %u on %s\n",
+ __func__, gt->count-1, ifp->if_xname);
+ m_freem(m);
+ error = EIO; /* is there better errno? */
+ goto end;
+ }
+ *ifp2 = ifp;
+
+ } else {
+ /*
+ * Given that people should NOT increase max_gre_nesting beyond
+ * their real needs, we allocate once per packet rather than
+ * allocating an mtag once per passing through gre.
+ *
+ * Note: the sysctl does not actually check for saneness, so we
+ * limit the maximum numbers of possible recursions here.
+ */
+ max = imin(max_gre_nesting, 256);
+ /* If someone sets the sysctl <= 0, we want at least 1. */
+ max = imax(max, 1);
+ len = sizeof(struct mtag_gre_nesting) +
+ max * sizeof(struct ifnet *);
+ mtag = m_tag_alloc(MTAG_COOKIE_GRE, MTAG_GRE_NESTING, len,
+ M_NOWAIT);
+ if (mtag == NULL) {
+ m_freem(m);
+ error = ENOMEM;
+ goto end;
+ }
+ gt = (struct mtag_gre_nesting *)(mtag + 1);
+ bzero(gt, len);
+ gt->count = 1;
+ gt->max = max;
+ *gt->ifp = ifp;
+ m_tag_prepend(m, mtag);
}
if (!((ifp->if_flags & IFF_UP) &&
@@ -444,7 +506,6 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
error = ip_output(m, NULL, &sc->route, IP_FORWARDING,
(struct ip_moptions *)NULL, (struct inpcb *)NULL);
end:
- sc->called = 0;
if (error)
ifp->if_oerrors++;
return (error);
diff --git a/sys/net/if_gre.h b/sys/net/if_gre.h
index e23daef..74d16b1 100644
--- a/sys/net/if_gre.h
+++ b/sys/net/if_gre.h
@@ -61,8 +61,6 @@ struct gre_softc {
const struct encaptab *encap; /* encapsulation cookie */
- int called; /* infinite recursion preventer */
-
uint32_t key; /* key included in outgoing GRE packets */
/* zero means none */
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 4e727d9..49a5249 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -126,7 +126,7 @@ static void tunclone(void *arg, struct ucred *cred, char *name,
int namelen, struct cdev **dev);
static void tuncreate(const char *name, struct cdev *dev);
static int tunifioctl(struct ifnet *, u_long, caddr_t);
-static int tuninit(struct ifnet *);
+static void tuninit(struct ifnet *);
static int tunmodevent(module_t, int, void *);
static int tunoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
struct route *ro);
@@ -494,14 +494,13 @@ tunclose(struct cdev *dev, int foo, int bar, struct thread *td)
return (0);
}
-static int
+static void
tuninit(struct ifnet *ifp)
{
struct tun_softc *tp = ifp->if_softc;
#ifdef INET
struct ifaddr *ifa;
#endif
- int error = 0;
TUNDEBUG(ifp, "tuninit\n");
@@ -528,7 +527,6 @@ tuninit(struct ifnet *ifp)
if_addr_runlock(ifp);
#endif
mtx_unlock(&tp->tun_mtx);
- return (error);
}
/*
@@ -552,12 +550,12 @@ tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
mtx_unlock(&tp->tun_mtx);
break;
case SIOCSIFADDR:
- error = tuninit(ifp);
- TUNDEBUG(ifp, "address set, error=%d\n", error);
+ tuninit(ifp);
+ TUNDEBUG(ifp, "address set\n");
break;
case SIOCSIFDSTADDR:
- error = tuninit(ifp);
- TUNDEBUG(ifp, "destination address set, error=%d\n", error);
+ tuninit(ifp);
+ TUNDEBUG(ifp, "destination address set\n");
break;
case SIOCSIFMTU:
ifp->if_mtu = ifr->ifr_mtu;
@@ -857,7 +855,6 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag)
struct tun_softc *tp = dev->si_drv1;
struct ifnet *ifp = TUN2IFP(tp);
struct mbuf *m;
- int error = 0;
uint32_t family;
int isr;
@@ -877,7 +874,7 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag)
if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0, M_PKTHDR)) == NULL) {
ifp->if_ierrors++;
- return (error);
+ return (ENOBUFS);
}
m->m_pkthdr.rcvif = ifp;
diff --git a/sys/net/netisr.c b/sys/net/netisr.c
index 67ec160..127cf67 100644
--- a/sys/net/netisr.c
+++ b/sys/net/netisr.c
@@ -1221,7 +1221,7 @@ netisr_start(void *arg)
{
struct pcpu *pc;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
if (nws_count >= netisr_maxthreads)
break;
/* XXXRW: Is skipping absent CPUs still required here? */
diff --git a/sys/net/route.c b/sys/net/route.c
index a41efa9..a6f910e 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1189,6 +1189,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
rt0 = NULL;
/* XXX
* "flow-table" only support IPv4 at the moment.
+ * XXX-BZ as of r205066 it would support IPv6.
*/
#ifdef INET
if (dst->sa_family == AF_INET) {
diff --git a/sys/net80211/ieee80211_acl.c b/sys/net80211/ieee80211_acl.c
index cb20b87..da505e3 100644
--- a/sys/net80211/ieee80211_acl.c
+++ b/sys/net80211/ieee80211_acl.c
@@ -77,7 +77,7 @@ struct acl {
struct aclstate {
acl_lock_t as_lock;
int as_policy;
- int as_nacls;
+ uint32_t as_nacls;
TAILQ_HEAD(, acl) as_list; /* list of all ACL's */
LIST_HEAD(, acl) as_hash[ACL_HASHSIZE];
struct ieee80211vap *as_vap;
@@ -289,7 +289,8 @@ acl_getioctl(struct ieee80211vap *vap, struct ieee80211req *ireq)
struct aclstate *as = vap->iv_as;
struct acl *acl;
struct ieee80211req_maclist *ap;
- int error, space, i;
+ int error;
+ uint32_t i, space;
switch (ireq->i_val) {
case IEEE80211_MACCMD_POLICY:
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index 8c4d7d3..61c84e9 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -217,6 +217,9 @@ static int ieee80211_addba_response(struct ieee80211_node *ni,
int code, int baparamset, int batimeout);
static void ieee80211_addba_stop(struct ieee80211_node *ni,
struct ieee80211_tx_ampdu *tap);
+static void null_addba_response_timeout(struct ieee80211_node *ni,
+ struct ieee80211_tx_ampdu *tap);
+
static void ieee80211_bar_response(struct ieee80211_node *ni,
struct ieee80211_tx_ampdu *tap, int status);
static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap);
@@ -234,6 +237,7 @@ ieee80211_ht_attach(struct ieee80211com *ic)
ic->ic_ampdu_enable = ieee80211_ampdu_enable;
ic->ic_addba_request = ieee80211_addba_request;
ic->ic_addba_response = ieee80211_addba_response;
+ ic->ic_addba_response_timeout = null_addba_response_timeout;
ic->ic_addba_stop = ieee80211_addba_stop;
ic->ic_bar_response = ieee80211_bar_response;
ic->ic_ampdu_rx_start = ampdu_rx_start;
@@ -1691,14 +1695,23 @@ ampdu_tx_stop(struct ieee80211_tx_ampdu *tap)
tap->txa_flags &= ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK);
}
+/*
+ * ADDBA response timeout.
+ *
+ * If software aggregation and per-TID queue management was done here,
+ * that queue would be unpaused after the ADDBA timeout occurs.
+ */
static void
addba_timeout(void *arg)
{
struct ieee80211_tx_ampdu *tap = arg;
+ struct ieee80211_node *ni = tap->txa_ni;
+ struct ieee80211com *ic = ni->ni_ic;
/* XXX ? */
tap->txa_flags &= ~IEEE80211_AGGR_XCHGPEND;
tap->txa_attempts++;
+ ic->ic_addba_response_timeout(ni, tap);
}
static void
@@ -1721,6 +1734,12 @@ addba_stop_timeout(struct ieee80211_tx_ampdu *tap)
}
}
+static void
+null_addba_response_timeout(struct ieee80211_node *ni,
+ struct ieee80211_tx_ampdu *tap)
+{
+}
+
/*
* Default method for requesting A-MPDU tx aggregation.
* We setup the specified state block and start a timer
@@ -2520,6 +2539,7 @@ ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni)
frm[1] = (v) >> 8; \
frm += 2; \
} while (0)
+ struct ieee80211com *ic = ni->ni_ic;
struct ieee80211vap *vap = ni->ni_vap;
uint16_t caps, extcaps;
int rxmax, density;
@@ -2543,6 +2563,17 @@ ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni)
/* use advertised setting (XXX locally constraint) */
rxmax = MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU);
density = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY);
+
+ /*
+ * NB: Hardware might support HT40 on some but not all
+ * channels. We can't determine this earlier because only
+ * after association the channel is upgraded to HT based
+ * on the negotiated capabilities.
+ */
+ if (ni->ni_chan != IEEE80211_CHAN_ANYC &&
+ findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT40U) == NULL &&
+ findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT40D) == NULL)
+ caps &= ~IEEE80211_HTCAP_CHWIDTH40;
} else {
/* override 20/40 use based on current channel */
if (IEEE80211_IS_CHAN_HT40(ni->ni_chan))
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 37d5dbe..f8e1785 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -143,7 +143,7 @@ static __noinline int
ieee80211_ioctl_getchaninfo(struct ieee80211vap *vap, struct ieee80211req *ireq)
{
struct ieee80211com *ic = vap->iv_ic;
- int space;
+ uint32_t space;
space = __offsetof(struct ieee80211req_chaninfo,
ic_chans[ic->ic_nchans]);
@@ -207,7 +207,7 @@ ieee80211_ioctl_getstastats(struct ieee80211vap *vap, struct ieee80211req *ireq)
{
struct ieee80211_node *ni;
uint8_t macaddr[IEEE80211_ADDR_LEN];
- const int off = __offsetof(struct ieee80211req_sta_stats, is_stats);
+ const size_t off = __offsetof(struct ieee80211req_sta_stats, is_stats);
int error;
if (ireq->i_len < off)
@@ -323,7 +323,7 @@ ieee80211_ioctl_getscanresults(struct ieee80211vap *vap,
if (req.space > ireq->i_len)
req.space = ireq->i_len;
if (req.space > 0) {
- size_t space;
+ uint32_t space;
void *p;
space = req.space;
@@ -458,7 +458,7 @@ get_sta_info(void *arg, struct ieee80211_node *ni)
static __noinline int
getstainfo_common(struct ieee80211vap *vap, struct ieee80211req *ireq,
- struct ieee80211_node *ni, int off)
+ struct ieee80211_node *ni, size_t off)
{
struct ieee80211com *ic = vap->iv_ic;
struct stainforeq req;
@@ -503,7 +503,7 @@ static __noinline int
ieee80211_ioctl_getstainfo(struct ieee80211vap *vap, struct ieee80211req *ireq)
{
uint8_t macaddr[IEEE80211_ADDR_LEN];
- const int off = __offsetof(struct ieee80211req_sta_req, info);
+ const size_t off = __offsetof(struct ieee80211req_sta_req, info);
struct ieee80211_node *ni;
int error;
diff --git a/sys/net80211/ieee80211_ioctl.h b/sys/net80211/ieee80211_ioctl.h
index 7215a5e..cad5576 100644
--- a/sys/net80211/ieee80211_ioctl.h
+++ b/sys/net80211/ieee80211_ioctl.h
@@ -578,7 +578,7 @@ struct ieee80211req {
char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
uint16_t i_type; /* req type */
int16_t i_val; /* Index or simple value */
- int16_t i_len; /* Index or simple value */
+ uint16_t i_len; /* Index or simple value */
void *i_data; /* Extra data */
};
#define SIOCS80211 _IOW('i', 234, struct ieee80211req)
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index b689310..6020144 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -516,6 +516,7 @@ ieee80211_send_setup(
{
#define WH4(wh) ((struct ieee80211_frame_addr4 *)wh)
struct ieee80211vap *vap = ni->ni_vap;
+ struct ieee80211_tx_ampdu *tap;
struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
ieee80211_seq seqno;
@@ -583,9 +584,15 @@ ieee80211_send_setup(
}
*(uint16_t *)&wh->i_dur[0] = 0;
- seqno = ni->ni_txseqs[tid]++;
- *(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
- M_SEQNO_SET(m, seqno);
+ tap = &ni->ni_tx_ampdu[TID_TO_WME_AC(tid)];
+ if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap))
+ m->m_flags |= M_AMPDU_MPDU;
+ else {
+ seqno = ni->ni_txseqs[tid]++;
+ *(uint16_t *)&wh->i_seq[0] =
+ htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT);
+ M_SEQNO_SET(m, seqno);
+ }
if (IEEE80211_IS_MULTICAST(wh->i_addr1))
m->m_flags |= M_MCAST;
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index 39cf347..a3dcd9f 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -307,6 +307,8 @@ struct ieee80211com {
int status, int baparamset, int batimeout);
void (*ic_addba_stop)(struct ieee80211_node *,
struct ieee80211_tx_ampdu *);
+ void (*ic_addba_response_timeout)(struct ieee80211_node *,
+ struct ieee80211_tx_ampdu *);
/* BAR response received */
void (*ic_bar_response)(struct ieee80211_node *,
struct ieee80211_tx_ampdu *, int status);
diff --git a/sys/netgraph/ng_nat.c b/sys/netgraph/ng_nat.c
index 84da500..59818d9 100644
--- a/sys/netgraph/ng_nat.c
+++ b/sys/netgraph/ng_nat.c
@@ -43,6 +43,7 @@
#include <machine/in_cksum.h>
#include <netinet/libalias/alias.h>
+#include <netinet/libalias/alias_local.h>
#include <netgraph/ng_message.h>
#include <netgraph/ng_parse.h>
@@ -696,22 +697,35 @@ ng_nat_rcvdata(hook_p hook, item_p item )
KASSERT(m->m_pkthdr.len == ntohs(ip->ip_len),
("ng_nat: ip_len != m_pkthdr.len"));
+ /*
+ * We drop packet when:
+ * 1. libalias returns PKT_ALIAS_ERROR;
+ * 2. For incoming packets:
+ * a) for unresolved fragments;
+ * b) libalias returns PKT_ALIAS_IGNORED and
+ * PKT_ALIAS_DENY_INCOMING flag is set.
+ */
if (hook == priv->in) {
rval = LibAliasIn(priv->lib, c, m->m_len + M_TRAILINGSPACE(m));
- if (rval != PKT_ALIAS_OK &&
- rval != PKT_ALIAS_FOUND_HEADER_FRAGMENT) {
+ if (rval == PKT_ALIAS_ERROR ||
+ rval == PKT_ALIAS_UNRESOLVED_FRAGMENT ||
+ (rval == PKT_ALIAS_IGNORED &&
+ (priv->lib->packetAliasMode &
+ PKT_ALIAS_DENY_INCOMING) != 0)) {
NG_FREE_ITEM(item);
return (EINVAL);
}
} else if (hook == priv->out) {
rval = LibAliasOut(priv->lib, c, m->m_len + M_TRAILINGSPACE(m));
- if (rval != PKT_ALIAS_OK) {
+ if (rval == PKT_ALIAS_ERROR) {
NG_FREE_ITEM(item);
return (EINVAL);
}
} else
panic("ng_nat: unknown hook!\n");
+ if (rval == PKT_ALIAS_RESPOND)
+ m->m_flags |= M_SKIP_FIREWALL;
m->m_pkthdr.len = m->m_len = ntohs(ip->ip_len);
if ((ip->ip_off & htons(IP_OFFMASK)) == 0 &&
diff --git a/sys/netgraph/ng_pipe.c b/sys/netgraph/ng_pipe.c
index b5bab3c..11ea814 100644
--- a/sys/netgraph/ng_pipe.c
+++ b/sys/netgraph/ng_pipe.c
@@ -298,11 +298,12 @@ ngp_rcvmsg(node_p node, item_p item, hook_p lasthook)
{
const priv_p priv = NG_NODE_PRIVATE(node);
struct ng_mesg *resp = NULL;
- struct ng_mesg *msg;
+ struct ng_mesg *msg, *flow_msg;
struct ng_pipe_stats *stats;
struct ng_pipe_run *run;
struct ng_pipe_cfg *cfg;
int error = 0;
+ int prev_down, now_down, cmd;
NGI_GET_MSG(item, msg);
switch (msg->header.typecookie) {
@@ -403,10 +404,38 @@ ngp_rcvmsg(node_p node, item_p item, hook_p lasthook)
cfg->header_offset < 64)
priv->header_offset = cfg->header_offset;
+ prev_down = priv->upper.cfg.ber == 1 ||
+ priv->lower.cfg.ber == 1;
parse_cfg(&priv->upper.cfg, &cfg->downstream,
&priv->upper, priv);
parse_cfg(&priv->lower.cfg, &cfg->upstream,
&priv->lower, priv);
+ now_down = priv->upper.cfg.ber == 1 ||
+ priv->lower.cfg.ber == 1;
+
+ if (prev_down != now_down) {
+ if (now_down)
+ cmd = NGM_LINK_IS_DOWN;
+ else
+ cmd = NGM_LINK_IS_UP;
+
+ if (priv->lower.hook != NULL) {
+ NG_MKMESSAGE(flow_msg, NGM_FLOW_COOKIE,
+ cmd, 0, M_NOWAIT);
+ if (flow_msg != NULL)
+ NG_SEND_MSG_HOOK(error, node,
+ flow_msg, priv->lower.hook,
+ 0);
+ }
+ if (priv->upper.hook != NULL) {
+ NG_MKMESSAGE(flow_msg, NGM_FLOW_COOKIE,
+ cmd, 0, M_NOWAIT);
+ if (flow_msg != NULL)
+ NG_SEND_MSG_HOOK(error, node,
+ flow_msg, priv->upper.hook,
+ 0);
+ }
+ }
break;
default:
error = EINVAL;
diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h
index 5faae7c..c9da86a 100644
--- a/sys/netinet/icmp6.h
+++ b/sys/netinet/icmp6.h
@@ -297,8 +297,9 @@ struct nd_opt_hdr { /* Neighbor discovery option header */
#define ND_OPT_PREFIX_INFORMATION 3
#define ND_OPT_REDIRECTED_HEADER 4
#define ND_OPT_MTU 5
-
-#define ND_OPT_ROUTE_INFO 200 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */
+#define ND_OPT_ROUTE_INFO 24 /* RFC 4191 */
+#define ND_OPT_RDNSS 25 /* RFC 6016 */
+#define ND_OPT_DNSSL 31 /* RFC 6016 */
struct nd_opt_prefix_info { /* prefix information */
u_int8_t nd_opt_pi_type;
@@ -338,6 +339,22 @@ struct nd_opt_route_info { /* route info */
/* prefix follows */
} __packed;
+struct nd_opt_rdnss { /* RDNSS option (RFC 6106) */
+ u_int8_t nd_opt_rdnss_type;
+ u_int8_t nd_opt_rdnss_len;
+ u_int16_t nd_opt_rdnss_reserved;
+ u_int32_t nd_opt_rdnss_lifetime;
+ /* followed by list of recursive DNS servers */
+} __packed;
+
+struct nd_opt_dnssl { /* DNSSL option (RFC 6106) */
+ u_int8_t nd_opt_dnssl_type;
+ u_int8_t nd_opt_dnssl_len;
+ u_int16_t nd_opt_dnssl_reserved;
+ u_int32_t nd_opt_dnssl_lifetime;
+ /* followed by list of DNS search domains */
+} __packed;
+
/*
* icmp6 namelookup
*/
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 3afdc7d..6a66c05 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -759,7 +759,7 @@ match:
}
} else
LLE_WUNLOCK(la);
- } /* end of FIB loop */
+ }
reply:
if (op != ARPOP_REQUEST)
goto drop;
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 684d808..7ae8477 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -548,7 +548,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
* is the same as before, then the call is
* un-necessarily executed here.
*/
- in_ifscrub(ifp, ia, 0);
+ in_ifscrub(ifp, ia, LLE_STATIC);
ia->ia_sockmask = ifra->ifra_mask;
ia->ia_sockmask.sin_family = AF_INET;
ia->ia_subnetmask =
@@ -557,7 +557,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
}
if ((ifp->if_flags & IFF_POINTOPOINT) &&
(ifra->ifra_dstaddr.sin_family == AF_INET)) {
- in_ifscrub(ifp, ia, 0);
+ in_ifscrub(ifp, ia, LLE_STATIC);
ia->ia_dstaddr = ifra->ifra_dstaddr;
maskIsNew = 1; /* We lie; but the effect's the same */
}
@@ -1179,14 +1179,20 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags)
&& (ia->ia_ifp->if_type != IFT_CARP)) {
ifa_ref(&ia->ia_ifa);
IN_IFADDR_RUNLOCK();
- rtinit(&(target->ia_ifa), (int)RTM_DELETE,
+ error = rtinit(&(target->ia_ifa), (int)RTM_DELETE,
rtinitflags(target));
- target->ia_flags &= ~IFA_ROUTE;
-
+ if (error == 0)
+ target->ia_flags &= ~IFA_ROUTE;
+ else
+ log(LOG_INFO, "in_scrubprefix: err=%d, old prefix delete failed\n",
+ error);
error = rtinit(&ia->ia_ifa, (int)RTM_ADD,
rtinitflags(ia) | RTF_UP);
if (error == 0)
ia->ia_flags |= IFA_ROUTE;
+ else
+ log(LOG_INFO, "in_scrubprefix: err=%d, new prefix add failed\n",
+ error);
ifa_free(&ia->ia_ifa);
return (error);
}
@@ -1210,9 +1216,12 @@ in_scrubprefix(struct in_ifaddr *target, u_int flags)
/*
* As no-one seem to have this prefix, we can remove the route.
*/
- rtinit(&(target->ia_ifa), (int)RTM_DELETE, rtinitflags(target));
- target->ia_flags &= ~IFA_ROUTE;
- return (0);
+ error = rtinit(&(target->ia_ifa), (int)RTM_DELETE, rtinitflags(target));
+ if (error == 0)
+ target->ia_flags &= ~IFA_ROUTE;
+ else
+ log(LOG_INFO, "in_scrubprefix: err=%d, prefix delete failed\n", error);
+ return (error);
}
#undef rtinitflags
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 85e31dc..4eb309a 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include "opt_ipsec.h"
#include "opt_inet.h"
#include "opt_inet6.h"
+#include "opt_pcbgroup.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -128,8 +129,12 @@ static VNET_DEFINE(int, ipport_tcplastcount);
#define V_ipport_tcplastcount VNET(ipport_tcplastcount)
static void in_pcbremlists(struct inpcb *inp);
-
#ifdef INET
+static struct inpcb *in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo,
+ struct in_addr faddr, u_int fport_arg,
+ struct in_addr laddr, u_int lport_arg,
+ int lookupflags, struct ifnet *ifp);
+
#define RANGECHK(var, min, max) \
if ((var) < (min)) { (var) = (min); } \
else if ((var) > (max)) { (var) = (max); }
@@ -208,19 +213,24 @@ void
in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char *name,
struct inpcbhead *listhead, int hash_nelements, int porthash_nelements,
char *inpcbzone_name, uma_init inpcbzone_init, uma_fini inpcbzone_fini,
- uint32_t inpcbzone_flags)
+ uint32_t inpcbzone_flags, u_int hashfields)
{
INP_INFO_LOCK_INIT(pcbinfo, name);
+ INP_HASH_LOCK_INIT(pcbinfo, "pcbinfohash"); /* XXXRW: argument? */
#ifdef VIMAGE
pcbinfo->ipi_vnet = curvnet;
#endif
pcbinfo->ipi_listhead = listhead;
LIST_INIT(pcbinfo->ipi_listhead);
+ pcbinfo->ipi_count = 0;
pcbinfo->ipi_hashbase = hashinit(hash_nelements, M_PCB,
&pcbinfo->ipi_hashmask);
pcbinfo->ipi_porthashbase = hashinit(porthash_nelements, M_PCB,
&pcbinfo->ipi_porthashmask);
+#ifdef PCBGROUP
+ in_pcbgroup_init(pcbinfo, hashfields, hash_nelements);
+#endif
pcbinfo->ipi_zone = uma_zcreate(inpcbzone_name, sizeof(struct inpcb),
NULL, NULL, inpcbzone_init, inpcbzone_fini, UMA_ALIGN_PTR,
inpcbzone_flags);
@@ -234,10 +244,17 @@ void
in_pcbinfo_destroy(struct inpcbinfo *pcbinfo)
{
+ KASSERT(pcbinfo->ipi_count == 0,
+ ("%s: ipi_count = %u", __func__, pcbinfo->ipi_count));
+
hashdestroy(pcbinfo->ipi_hashbase, M_PCB, pcbinfo->ipi_hashmask);
hashdestroy(pcbinfo->ipi_porthashbase, M_PCB,
pcbinfo->ipi_porthashmask);
+#ifdef PCBGROUP
+ in_pcbgroup_destroy(pcbinfo);
+#endif
uma_zdestroy(pcbinfo->ipi_zone);
+ INP_HASH_LOCK_DESTROY(pcbinfo);
INP_INFO_LOCK_DESTROY(pcbinfo);
}
@@ -309,8 +326,8 @@ in_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred)
{
int anonport, error;
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo);
if (inp->inp_lport != 0 || inp->inp_laddr.s_addr != INADDR_ANY)
return (EINVAL);
@@ -351,8 +368,8 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp,
* Because no actual state changes occur here, a global write lock on
* the pcbinfo isn't required.
*/
- INP_INFO_LOCK_ASSERT(pcbinfo);
INP_LOCK_ASSERT(inp);
+ INP_HASH_LOCK_ASSERT(pcbinfo);
if (inp->inp_flags & INP_HIGHPORT) {
first = V_ipport_hifirstauto; /* sysctl */
@@ -473,11 +490,10 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp,
int error;
/*
- * Because no actual state changes occur here, a global write lock on
- * the pcbinfo isn't required.
+ * No state changes, so read locks are sufficient here.
*/
- INP_INFO_LOCK_ASSERT(pcbinfo);
INP_LOCK_ASSERT(inp);
+ INP_HASH_LOCK_ASSERT(pcbinfo);
if (TAILQ_EMPTY(&V_in_ifaddrhead)) /* XXX broken! */
return (EADDRNOTAVAIL);
@@ -612,14 +628,15 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp,
* then pick one.
*/
int
-in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred)
+in_pcbconnect_mbuf(struct inpcb *inp, struct sockaddr *nam,
+ struct ucred *cred, struct mbuf *m)
{
u_short lport, fport;
in_addr_t laddr, faddr;
int anonport, error;
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo);
lport = inp->inp_lport;
laddr = inp->inp_laddr.s_addr;
@@ -645,13 +662,20 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred)
inp->inp_laddr.s_addr = laddr;
inp->inp_faddr.s_addr = faddr;
inp->inp_fport = fport;
- in_pcbrehash(inp);
+ in_pcbrehash_mbuf(inp, m);
if (anonport)
inp->inp_flags |= INP_ANONPORT;
return (0);
}
+int
+in_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred)
+{
+
+ return (in_pcbconnect_mbuf(inp, nam, cred, NULL));
+}
+
/*
* Do proper source address selection on an unbound socket in case
* of connect. Take jails into account as well.
@@ -907,8 +931,8 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr *nam,
* Because a global state change doesn't actually occur here, a read
* lock is sufficient.
*/
- INP_INFO_LOCK_ASSERT(inp->inp_pcbinfo);
INP_LOCK_ASSERT(inp);
+ INP_HASH_LOCK_ASSERT(inp->inp_pcbinfo);
if (oinpp != NULL)
*oinpp = NULL;
@@ -983,8 +1007,8 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr *nam,
if (error)
return (error);
}
- oinp = in_pcblookup_hash(inp->inp_pcbinfo, faddr, fport, laddr, lport,
- 0, NULL);
+ oinp = in_pcblookup_hash_locked(inp->inp_pcbinfo, faddr, fport,
+ laddr, lport, 0, NULL);
if (oinp != NULL) {
if (oinpp != NULL)
*oinpp = oinp;
@@ -1007,8 +1031,8 @@ void
in_pcbdisconnect(struct inpcb *inp)
{
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo);
inp->inp_faddr.s_addr = INADDR_ANY;
inp->inp_fport = 0;
@@ -1036,7 +1060,8 @@ in_pcbdetach(struct inpcb *inp)
* in_pcbref() bumps the reference count on an inpcb in order to maintain
* stability of an inpcb pointer despite the inpcb lock being released. This
* is used in TCP when the inpcbinfo lock needs to be acquired or upgraded,
- * but where the inpcb lock is already held.
+ * but where the inpcb lock may already held, or when acquiring a reference
+ * via a pcbgroup.
*
* in_pcbref() should be used only to provide brief memory stability, and
* must always be followed by a call to INP_WLOCK() and in_pcbrele() to
@@ -1187,20 +1212,28 @@ void
in_pcbdrop(struct inpcb *inp)
{
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_WLOCK_ASSERT(inp);
+ /*
+ * XXXRW: Possibly we should protect the setting of INP_DROPPED with
+ * the hash lock...?
+ */
inp->inp_flags |= INP_DROPPED;
if (inp->inp_flags & INP_INHASHLIST) {
struct inpcbport *phd = inp->inp_phd;
+ INP_HASH_WLOCK(inp->inp_pcbinfo);
LIST_REMOVE(inp, inp_hash);
LIST_REMOVE(inp, inp_portlist);
if (LIST_FIRST(&phd->phd_pcblist) == NULL) {
LIST_REMOVE(phd, phd_hash);
free(phd, M_PCB);
}
+ INP_HASH_WUNLOCK(inp->inp_pcbinfo);
inp->inp_flags &= ~INP_INHASHLIST;
+#ifdef PCBGROUP
+ in_pcbgroup_remove(inp);
+#endif
}
}
@@ -1328,7 +1361,8 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet *ifp)
}
/*
- * Lookup a PCB based on the local address and port.
+ * Lookup a PCB based on the local address and port. Caller must hold the
+ * hash lock. No inpcb locks or references are acquired.
*/
#define INP_LOOKUP_MAPPED_PCB_COST 3
struct inpcb *
@@ -1346,7 +1380,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr,
KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0,
("%s: invalid lookup flags %d", __func__, lookupflags));
- INP_INFO_LOCK_ASSERT(pcbinfo);
+ INP_HASH_LOCK_ASSERT(pcbinfo);
if ((lookupflags & INPLOOKUP_WILDCARD) == 0) {
struct inpcbhead *head;
@@ -1449,11 +1483,155 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr,
}
#undef INP_LOOKUP_MAPPED_PCB_COST
+#ifdef PCBGROUP
/*
- * Lookup PCB in hash list.
+ * Lookup PCB in hash list, using pcbgroup tables.
*/
-struct inpcb *
-in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr,
+static struct inpcb *
+in_pcblookup_group(struct inpcbinfo *pcbinfo, struct inpcbgroup *pcbgroup,
+ struct in_addr faddr, u_int fport_arg, struct in_addr laddr,
+ u_int lport_arg, int lookupflags, struct ifnet *ifp)
+{
+ struct inpcbhead *head;
+ struct inpcb *inp, *tmpinp;
+ u_short fport = fport_arg, lport = lport_arg;
+
+ /*
+ * First look for an exact match.
+ */
+ tmpinp = NULL;
+ INP_GROUP_LOCK(pcbgroup);
+ head = &pcbgroup->ipg_hashbase[INP_PCBHASH(faddr.s_addr, lport, fport,
+ pcbgroup->ipg_hashmask)];
+ LIST_FOREACH(inp, head, inp_pcbgrouphash) {
+#ifdef INET6
+ /* XXX inp locking */
+ if ((inp->inp_vflag & INP_IPV4) == 0)
+ continue;
+#endif
+ if (inp->inp_faddr.s_addr == faddr.s_addr &&
+ inp->inp_laddr.s_addr == laddr.s_addr &&
+ inp->inp_fport == fport &&
+ inp->inp_lport == lport) {
+ /*
+ * XXX We should be able to directly return
+ * the inp here, without any checks.
+ * Well unless both bound with SO_REUSEPORT?
+ */
+ if (prison_flag(inp->inp_cred, PR_IP4))
+ goto found;
+ if (tmpinp == NULL)
+ tmpinp = inp;
+ }
+ }
+ if (tmpinp != NULL) {
+ inp = tmpinp;
+ goto found;
+ }
+
+ /*
+ * Then look for a wildcard match, if requested.
+ */
+ if ((lookupflags & INPLOOKUP_WILDCARD) != 0) {
+ struct inpcb *local_wild = NULL, *local_exact = NULL;
+#ifdef INET6
+ struct inpcb *local_wild_mapped = NULL;
+#endif
+ struct inpcb *jail_wild = NULL;
+ struct inpcbhead *head;
+ int injail;
+
+ /*
+ * Order of socket selection - we always prefer jails.
+ * 1. jailed, non-wild.
+ * 2. jailed, wild.
+ * 3. non-jailed, non-wild.
+ * 4. non-jailed, wild.
+ */
+ head = &pcbinfo->ipi_wildbase[INP_PCBHASH(INADDR_ANY, lport,
+ 0, pcbinfo->ipi_wildmask)];
+ LIST_FOREACH(inp, head, inp_pcbgroup_wild) {
+#ifdef INET6
+ /* XXX inp locking */
+ if ((inp->inp_vflag & INP_IPV4) == 0)
+ continue;
+#endif
+ if (inp->inp_faddr.s_addr != INADDR_ANY ||
+ inp->inp_lport != lport)
+ continue;
+
+ /* XXX inp locking */
+ if (ifp && ifp->if_type == IFT_FAITH &&
+ (inp->inp_flags & INP_FAITH) == 0)
+ continue;
+
+ injail = prison_flag(inp->inp_cred, PR_IP4);
+ if (injail) {
+ if (prison_check_ip4(inp->inp_cred,
+ &laddr) != 0)
+ continue;
+ } else {
+ if (local_exact != NULL)
+ continue;
+ }
+
+ if (inp->inp_laddr.s_addr == laddr.s_addr) {
+ if (injail)
+ goto found;
+ else
+ local_exact = inp;
+ } else if (inp->inp_laddr.s_addr == INADDR_ANY) {
+#ifdef INET6
+ /* XXX inp locking, NULL check */
+ if (inp->inp_vflag & INP_IPV6PROTO)
+ local_wild_mapped = inp;
+ else
+#endif /* INET6 */
+ if (injail)
+ jail_wild = inp;
+ else
+ local_wild = inp;
+ }
+ } /* LIST_FOREACH */
+ inp = jail_wild;
+ if (inp == NULL)
+ inp = local_exact;
+ if (inp == NULL)
+ inp = local_wild;
+#ifdef INET6
+ if (inp == NULL)
+ inp = local_wild_mapped;
+#endif /* defined(INET6) */
+ if (inp != NULL)
+ goto found;
+ } /* if (lookupflags & INPLOOKUP_WILDCARD) */
+ INP_GROUP_UNLOCK(pcbgroup);
+ return (NULL);
+
+found:
+ in_pcbref(inp);
+ INP_GROUP_UNLOCK(pcbgroup);
+ if (lookupflags & INPLOOKUP_WLOCKPCB) {
+ INP_WLOCK(inp);
+ if (in_pcbrele_wlocked(inp))
+ return (NULL);
+ } else if (lookupflags & INPLOOKUP_RLOCKPCB) {
+ INP_RLOCK(inp);
+ if (in_pcbrele_rlocked(inp))
+ return (NULL);
+ } else
+ panic("%s: locking bug", __func__);
+ return (inp);
+}
+#endif /* PCBGROUP */
+
+/*
+ * Lookup PCB in hash list, using pcbinfo tables. This variation assumes
+ * that the caller has locked the hash list, and will not perform any further
+ * locking or reference operations on either the hash list or the connection.
+ */
+static struct inpcb *
+in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in_addr faddr,
u_int fport_arg, struct in_addr laddr, u_int lport_arg, int lookupflags,
struct ifnet *ifp)
{
@@ -1464,7 +1642,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr,
KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0,
("%s: invalid lookup flags %d", __func__, lookupflags));
- INP_INFO_LOCK_ASSERT(pcbinfo);
+ INP_HASH_LOCK_ASSERT(pcbinfo);
/*
* First look for an exact match.
@@ -1574,13 +1752,108 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr,
return (NULL);
}
+
+/*
+ * Lookup PCB in hash list, using pcbinfo tables. This variation locks the
+ * hash list lock, and will return the inpcb locked (i.e., requires
+ * INPLOOKUP_LOCKPCB).
+ */
+static struct inpcb *
+in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr,
+ u_int fport, struct in_addr laddr, u_int lport, int lookupflags,
+ struct ifnet *ifp)
+{
+ struct inpcb *inp;
+
+ INP_HASH_RLOCK(pcbinfo);
+ inp = in_pcblookup_hash_locked(pcbinfo, faddr, fport, laddr, lport,
+ (lookupflags & ~(INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)), ifp);
+ if (inp != NULL) {
+ in_pcbref(inp);
+ INP_HASH_RUNLOCK(pcbinfo);
+ if (lookupflags & INPLOOKUP_WLOCKPCB) {
+ INP_WLOCK(inp);
+ if (in_pcbrele_wlocked(inp))
+ return (NULL);
+ } else if (lookupflags & INPLOOKUP_RLOCKPCB) {
+ INP_RLOCK(inp);
+ if (in_pcbrele_rlocked(inp))
+ return (NULL);
+ } else
+ panic("%s: locking bug", __func__);
+ } else
+ INP_HASH_RUNLOCK(pcbinfo);
+ return (inp);
+}
+
+/*
+ * Public inpcb lookup routines, accepting a 4-tuple, and optionally, an mbuf
+ * from which a pre-calculated hash value may be extracted.
+ *
+ * Possibly more of this logic should be in in_pcbgroup.c.
+ */
+struct inpcb *
+in_pcblookup(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport,
+ struct in_addr laddr, u_int lport, int lookupflags, struct ifnet *ifp)
+{
+#if defined(PCBGROUP)
+ struct inpcbgroup *pcbgroup;
+#endif
+
+ KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0,
+ ("%s: invalid lookup flags %d", __func__, lookupflags));
+ KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0,
+ ("%s: LOCKPCB not set", __func__));
+
+#if defined(PCBGROUP)
+ if (in_pcbgroup_enabled(pcbinfo)) {
+ pcbgroup = in_pcbgroup_bytuple(pcbinfo, laddr, lport, faddr,
+ fport);
+ return (in_pcblookup_group(pcbinfo, pcbgroup, faddr, fport,
+ laddr, lport, lookupflags, ifp));
+ }
+#endif
+ return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport,
+ lookupflags, ifp));
+}
+
+struct inpcb *
+in_pcblookup_mbuf(struct inpcbinfo *pcbinfo, struct in_addr faddr,
+ u_int fport, struct in_addr laddr, u_int lport, int lookupflags,
+ struct ifnet *ifp, struct mbuf *m)
+{
+#ifdef PCBGROUP
+ struct inpcbgroup *pcbgroup;
+#endif
+
+ KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0,
+ ("%s: invalid lookup flags %d", __func__, lookupflags));
+ KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0,
+ ("%s: LOCKPCB not set", __func__));
+
+#ifdef PCBGROUP
+ if (in_pcbgroup_enabled(pcbinfo)) {
+ pcbgroup = in_pcbgroup_byhash(pcbinfo, M_HASHTYPE_GET(m),
+ m->m_pkthdr.flowid);
+ if (pcbgroup != NULL)
+ return (in_pcblookup_group(pcbinfo, pcbgroup, faddr,
+ fport, laddr, lport, lookupflags, ifp));
+ pcbgroup = in_pcbgroup_bytuple(pcbinfo, laddr, lport, faddr,
+ fport);
+ return (in_pcblookup_group(pcbinfo, pcbgroup, faddr, fport,
+ laddr, lport, lookupflags, ifp));
+ }
+#endif
+ return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport,
+ lookupflags, ifp));
+}
#endif /* INET */
/*
* Insert PCB onto various hash lists.
*/
-int
-in_pcbinshash(struct inpcb *inp)
+static int
+in_pcbinshash_internal(struct inpcb *inp, int do_pcbgroup_update)
{
struct inpcbhead *pcbhash;
struct inpcbporthead *pcbporthash;
@@ -1588,8 +1861,9 @@ in_pcbinshash(struct inpcb *inp)
struct inpcbport *phd;
u_int32_t hashkey_faddr;
- INP_INFO_WLOCK_ASSERT(pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(pcbinfo);
+
KASSERT((inp->inp_flags & INP_INHASHLIST) == 0,
("in_pcbinshash: INP_INHASHLIST"));
@@ -1629,24 +1903,54 @@ in_pcbinshash(struct inpcb *inp)
LIST_INSERT_HEAD(&phd->phd_pcblist, inp, inp_portlist);
LIST_INSERT_HEAD(pcbhash, inp, inp_hash);
inp->inp_flags |= INP_INHASHLIST;
+#ifdef PCBGROUP
+ if (do_pcbgroup_update)
+ in_pcbgroup_update(inp);
+#endif
return (0);
}
/*
+ * For now, there are two public interfaces to insert an inpcb into the hash
+ * lists -- one that does update pcbgroups, and one that doesn't. The latter
+ * is used only in the TCP syncache, where in_pcbinshash is called before the
+ * full 4-tuple is set for the inpcb, and we don't want to install in the
+ * pcbgroup until later.
+ *
+ * XXXRW: This seems like a misfeature. in_pcbinshash should always update
+ * connection groups, and partially initialised inpcbs should not be exposed
+ * to either reservation hash tables or pcbgroups.
+ */
+int
+in_pcbinshash(struct inpcb *inp)
+{
+
+ return (in_pcbinshash_internal(inp, 1));
+}
+
+int
+in_pcbinshash_nopcbgroup(struct inpcb *inp)
+{
+
+ return (in_pcbinshash_internal(inp, 0));
+}
+
+/*
* Move PCB to the proper hash bucket when { faddr, fport } have been
* changed. NOTE: This does not handle the case of the lport changing (the
* hashed port list would have to be updated as well), so the lport must
* not change after in_pcbinshash() has been called.
*/
void
-in_pcbrehash(struct inpcb *inp)
+in_pcbrehash_mbuf(struct inpcb *inp, struct mbuf *m)
{
struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
struct inpcbhead *head;
u_int32_t hashkey_faddr;
- INP_INFO_WLOCK_ASSERT(pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(pcbinfo);
+
KASSERT(inp->inp_flags & INP_INHASHLIST,
("in_pcbrehash: !INP_INHASHLIST"));
@@ -1662,6 +1966,20 @@ in_pcbrehash(struct inpcb *inp)
LIST_REMOVE(inp, inp_hash);
LIST_INSERT_HEAD(head, inp, inp_hash);
+
+#ifdef PCBGROUP
+ if (m != NULL)
+ in_pcbgroup_update_mbuf(inp, m);
+ else
+ in_pcbgroup_update(inp);
+#endif
+}
+
+void
+in_pcbrehash(struct inpcb *inp)
+{
+
+ in_pcbrehash_mbuf(inp, NULL);
}
/*
@@ -1679,16 +1997,21 @@ in_pcbremlists(struct inpcb *inp)
if (inp->inp_flags & INP_INHASHLIST) {
struct inpcbport *phd = inp->inp_phd;
+ INP_HASH_WLOCK(pcbinfo);
LIST_REMOVE(inp, inp_hash);
LIST_REMOVE(inp, inp_portlist);
if (LIST_FIRST(&phd->phd_pcblist) == NULL) {
LIST_REMOVE(phd, phd_hash);
free(phd, M_PCB);
}
+ INP_HASH_WUNLOCK(pcbinfo);
inp->inp_flags &= ~INP_INHASHLIST;
}
LIST_REMOVE(inp, inp_list);
pcbinfo->ipi_count--;
+#ifdef PCBGROUP
+ in_pcbgroup_remove(inp);
+#endif
}
/*
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 14d4ea2..dfef963 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -44,6 +44,7 @@
#include <sys/_rwlock.h>
#ifdef _KERNEL
+#include <sys/lock.h>
#include <sys/rwlock.h>
#include <net/vnet.h>
#include <vm/uma.h>
@@ -141,6 +142,7 @@ struct icmp6_filter;
*
* Key:
* (c) - Constant after initialization
+ * (g) - Protected by the pcbgroup lock
* (i) - Protected by the inpcb lock
* (p) - Protected by the pcbinfo lock for the inpcb
* (s) - Protected by another subsystem's locks
@@ -160,9 +162,12 @@ struct icmp6_filter;
*/
struct inpcb {
LIST_ENTRY(inpcb) inp_hash; /* (i/p) hash list */
+ LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */
LIST_ENTRY(inpcb) inp_list; /* (i/p) list for all PCBs for proto */
void *inp_ppcb; /* (i) pointer to per-protocol pcb */
struct inpcbinfo *inp_pcbinfo; /* (c) PCB list info */
+ struct inpcbgroup *inp_pcbgroup; /* (g/i) PCB group list */
+ LIST_ENTRY(inpcb) inp_pcbgroup_wild; /* (g/i/p) group wildcard entry */
struct socket *inp_socket; /* (i) back pointer to socket */
struct ucred *inp_cred; /* (c) cache of socket cred */
u_int32_t inp_flow; /* (i) IPv6 flow information */
@@ -268,22 +273,23 @@ struct inpcbport {
* Global data structure for each high-level protocol (UDP, TCP, ...) in both
* IPv4 and IPv6. Holds inpcb lists and information for managing them.
*
- * Each pcbinfo is protected by ipi_lock, covering mutable global fields (such
- * as the global pcb list) and hashed lookup tables. The lock order is:
+ * Each pcbinfo is protected by two locks: ipi_lock and ipi_hash_lock,
+ * the former covering mutable global fields (such as the global pcb list),
+ * and the latter covering the hashed lookup tables. The lock order is:
*
- * ipi_lock (before) inpcb locks
+ * ipi_lock (before) inpcb locks (before) {ipi_hash_lock, pcbgroup locks}
*
* Locking key:
*
* (c) Constant or nearly constant after initialisation
* (g) Locked by ipi_lock
- * (h) Read using either ipi_lock or inpcb lock; write requires both.
+ * (h) Read using either ipi_hash_lock or inpcb lock; write requires both
+ * (p) Protected by one or more pcbgroup locks
* (x) Synchronisation properties poorly defined
*/
struct inpcbinfo {
/*
- * Global lock protecting global inpcb list, inpcb count, hash tables,
- * etc.
+ * Global lock protecting global inpcb list, inpcb count, etc.
*/
struct rwlock ipi_lock;
@@ -312,17 +318,39 @@ struct inpcbinfo {
struct uma_zone *ipi_zone; /* (c) */
/*
+ * Connection groups associated with this protocol. These fields are
+ * constant, but pcbgroup structures themselves are protected by
+ * per-pcbgroup locks.
+ */
+ struct inpcbgroup *ipi_pcbgroups; /* (c) */
+ u_int ipi_npcbgroups; /* (c) */
+ u_int ipi_hashfields; /* (c) */
+
+ /*
+ * Global lock protecting non-pcbgroup hash lookup tables.
+ */
+ struct rwlock ipi_hash_lock;
+
+ /*
* Global hash of inpcbs, hashed by local and foreign addresses and
* port numbers.
*/
- struct inpcbhead *ipi_hashbase; /* (g) */
- u_long ipi_hashmask; /* (g) */
+ struct inpcbhead *ipi_hashbase; /* (h) */
+ u_long ipi_hashmask; /* (h) */
/*
* Global hash of inpcbs, hashed by only local port number.
*/
- struct inpcbporthead *ipi_porthashbase; /* (g) */
- u_long ipi_porthashmask; /* (g) */
+ struct inpcbporthead *ipi_porthashbase; /* (h) */
+ u_long ipi_porthashmask; /* (h) */
+
+ /*
+ * List of wildcard inpcbs for use with pcbgroups. In the past, was
+ * per-pcbgroup but is now global. All pcbgroup locks must be held
+ * to modify the list, so any is sufficient to read it.
+ */
+ struct inpcbhead *ipi_wildbase; /* (p) */
+ u_long ipi_wildmask; /* (p) */
/*
* Pointer to network stack instance
@@ -335,6 +363,31 @@ struct inpcbinfo {
void *ipi_pspare[2];
};
+/*
+ * Connection groups hold sets of connections that have similar CPU/thread
+ * affinity. Each connection belongs to exactly one connection group.
+ */
+struct inpcbgroup {
+ /*
+ * Per-connection group hash of inpcbs, hashed by local and foreign
+ * addresses and port numbers.
+ */
+ struct inpcbhead *ipg_hashbase; /* (c) */
+ u_long ipg_hashmask; /* (c) */
+
+ /*
+ * Notional affinity of this pcbgroup.
+ */
+ u_int ipg_cpu; /* (p) */
+
+ /*
+ * Per-connection group lock, not to be confused with ipi_lock.
+ * Protects the hash table hung off the group, but also the global
+ * wildcard list in inpcbinfo.
+ */
+ struct mtx ipg_lock;
+} __aligned(CACHE_LINE_SIZE);
+
#define INP_LOCK_INIT(inp, d, t) \
rw_init_flags(&(inp)->inp_lock, (t), RW_RECURSE | RW_DUPOK)
#define INP_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock)
@@ -406,6 +459,26 @@ void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp,
#define INP_INFO_WLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_WLOCKED)
#define INP_INFO_UNLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_UNLOCKED)
+#define INP_HASH_LOCK_INIT(ipi, d) \
+ rw_init_flags(&(ipi)->ipi_hash_lock, (d), 0)
+#define INP_HASH_LOCK_DESTROY(ipi) rw_destroy(&(ipi)->ipi_hash_lock)
+#define INP_HASH_RLOCK(ipi) rw_rlock(&(ipi)->ipi_hash_lock)
+#define INP_HASH_WLOCK(ipi) rw_wlock(&(ipi)->ipi_hash_lock)
+#define INP_HASH_RUNLOCK(ipi) rw_runlock(&(ipi)->ipi_hash_lock)
+#define INP_HASH_WUNLOCK(ipi) rw_wunlock(&(ipi)->ipi_hash_lock)
+#define INP_HASH_LOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_hash_lock, \
+ RA_LOCKED)
+#define INP_HASH_WLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_hash_lock, \
+ RA_WLOCKED)
+
+#define INP_GROUP_LOCK_INIT(ipg, d) mtx_init(&(ipg)->ipg_lock, (d), NULL, \
+ MTX_DEF | MTX_DUPOK)
+#define INP_GROUP_LOCK_DESTROY(ipg) mtx_destroy(&(ipg)->ipg_lock)
+
+#define INP_GROUP_LOCK(ipg) mtx_lock(&(ipg)->ipg_lock)
+#define INP_GROUP_LOCK_ASSERT(ipg) mtx_assert(&(ipg)->ipg_lock, MA_OWNED)
+#define INP_GROUP_UNLOCK(ipg) mtx_unlock(&(ipg)->ipg_lock)
+
#define INP_PCBHASH(faddr, lport, fport, mask) \
(((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask))
#define INP_PCBPORTHASH(lport, mask) \
@@ -465,8 +538,18 @@ void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp,
*/
#define INP_LLE_VALID 0x00000001 /* cached lle is valid */
#define INP_RT_VALID 0x00000002 /* cached rtentry is valid */
+#define INP_PCBGROUPWILD 0x00000004 /* in pcbgroup wildcard list */
+
+/*
+ * Flags passed to in_pcblookup*() functions.
+ */
+#define INPLOOKUP_WILDCARD 0x00000001 /* Allow wildcard sockets. */
+#define INPLOOKUP_RLOCKPCB 0x00000002 /* Return inpcb read-locked. */
+#define INPLOOKUP_WLOCKPCB 0x00000004 /* Return inpcb write-locked. */
+
+#define INPLOOKUP_MASK (INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB | \
+ INPLOOKUP_WLOCKPCB)
-#define INPLOOKUP_WILDCARD 1
#define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb)
#define sotoin6pcb(so) sotoinpcb(so) /* for KAME src sync over BSD*'s */
@@ -474,6 +557,13 @@ void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp,
#define INP_CHECK_SOCKAF(so, af) (INP_SOCKAF(so) == af)
+/*
+ * Constants for pcbinfo.ipi_hashfields.
+ */
+#define IPI_HASHFIELDS_NONE 0
+#define IPI_HASHFIELDS_2TUPLE 1
+#define IPI_HASHFIELDS_4TUPLE 2
+
#ifdef _KERNEL
VNET_DECLARE(int, ipport_reservedhigh);
VNET_DECLARE(int, ipport_reservedlow);
@@ -505,7 +595,21 @@ VNET_DECLARE(int, ipport_tcpallocs);
void in_pcbinfo_destroy(struct inpcbinfo *);
void in_pcbinfo_init(struct inpcbinfo *, const char *, struct inpcbhead *,
- int, int, char *, uma_init, uma_fini, uint32_t);
+ int, int, char *, uma_init, uma_fini, uint32_t, u_int);
+
+struct inpcbgroup *
+ in_pcbgroup_byhash(struct inpcbinfo *, u_int, uint32_t);
+struct inpcbgroup *
+ in_pcbgroup_byinpcb(struct inpcb *);
+struct inpcbgroup *
+ in_pcbgroup_bytuple(struct inpcbinfo *, struct in_addr, u_short,
+ struct in_addr, u_short);
+void in_pcbgroup_destroy(struct inpcbinfo *);
+int in_pcbgroup_enabled(struct inpcbinfo *);
+void in_pcbgroup_init(struct inpcbinfo *, u_int, int);
+void in_pcbgroup_remove(struct inpcb *);
+void in_pcbgroup_update(struct inpcb *);
+void in_pcbgroup_update_mbuf(struct inpcb *, struct mbuf *);
void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);
int in_pcballoc(struct socket *, struct inpcbinfo *);
@@ -515,6 +619,8 @@ int in_pcb_lport(struct inpcb *, struct in_addr *, u_short *,
int in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *,
u_short *, struct ucred *);
int in_pcbconnect(struct inpcb *, struct sockaddr *, struct ucred *);
+int in_pcbconnect_mbuf(struct inpcb *, struct sockaddr *, struct ucred *,
+ struct mbuf *);
int in_pcbconnect_setup(struct inpcb *, struct sockaddr *, in_addr_t *,
u_short *, in_addr_t *, u_short *, struct inpcb **,
struct ucred *);
@@ -523,16 +629,21 @@ void in_pcbdisconnect(struct inpcb *);
void in_pcbdrop(struct inpcb *);
void in_pcbfree(struct inpcb *);
int in_pcbinshash(struct inpcb *);
+int in_pcbinshash_nopcbgroup(struct inpcb *);
struct inpcb *
in_pcblookup_local(struct inpcbinfo *,
struct in_addr, u_short, int, struct ucred *);
struct inpcb *
- in_pcblookup_hash(struct inpcbinfo *, struct in_addr, u_int,
+ in_pcblookup(struct inpcbinfo *, struct in_addr, u_int,
struct in_addr, u_int, int, struct ifnet *);
+struct inpcb *
+ in_pcblookup_mbuf(struct inpcbinfo *, struct in_addr, u_int,
+ struct in_addr, u_int, int, struct ifnet *, struct mbuf *);
void in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr,
int, struct inpcb *(*)(struct inpcb *, int));
void in_pcbref(struct inpcb *);
void in_pcbrehash(struct inpcb *);
+void in_pcbrehash_mbuf(struct inpcb *, struct mbuf *);
int in_pcbrele(struct inpcb *);
int in_pcbrele_rlocked(struct inpcb *);
int in_pcbrele_wlocked(struct inpcb *);
diff --git a/sys/netinet/in_pcbgroup.c b/sys/netinet/in_pcbgroup.c
new file mode 100644
index 0000000..c9f5c70
--- /dev/null
+++ b/sys/netinet/in_pcbgroup.c
@@ -0,0 +1,457 @@
+/*-
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
+ * All rights reserved.
+ *
+ * This software was developed by Robert N. M. Watson under contract
+ * to Juniper Networks, Inc.
+ *
+ * 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 AUTHOR 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 AUTHOR 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 <sys/cdefs.h>
+
+__FBSDID("$FreeBSD$");
+
+#include "opt_inet6.h"
+
+#include <sys/param.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/mutex.h>
+#include <sys/smp.h>
+#include <sys/socketvar.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#ifdef INET6
+#include <netinet6/in6_pcb.h>
+#endif /* INET6 */
+
+/*
+ * pcbgroups, or "connection groups" are based on Willman, Rixner, and Cox's
+ * 2006 USENIX paper, "An Evaluation of Network Stack Parallelization
+ * Strategies in Modern Operating Systems". This implementation differs
+ * significantly from that described in the paper, in that it attempts to
+ * introduce not just notions of affinity for connections and distribute work
+ * so as to reduce lock contention, but also align those notions with
+ * hardware work distribution strategies such as RSS. In this construction,
+ * connection groups supplement, rather than replace, existing reservation
+ * tables for protocol 4-tuples, offering CPU-affine lookup tables with
+ * minimal cache line migration and lock contention during steady state
+ * operation.
+ *
+ * Internet protocols, such as UDP and TCP, register to use connection groups
+ * by providing an ipi_hashfields value other than IPI_HASHFIELDS_NONE; this
+ * indicates to the connection group code whether a 2-tuple or 4-tuple is
+ * used as an argument to hashes that assign a connection to a particular
+ * group. This must be aligned with any hardware offloaded distribution
+ * model, such as RSS or similar approaches taken in embedded network boards.
+ * Wildcard sockets require special handling, as in Willman 2006, and are
+ * shared between connection groups -- while being protected by group-local
+ * locks. This means that connection establishment and teardown can be
+ * signficantly more expensive than without connection groups, but that
+ * steady-state processing can be significantly faster.
+ *
+ * Most of the implementation of connection groups is in this file; however,
+ * connection group lookup is implemented in in_pcb.c alongside reservation
+ * table lookups -- see in_pcblookup_group().
+ *
+ * TODO:
+ *
+ * Implement dynamic rebalancing of buckets with connection groups; when
+ * load is unevenly distributed, search for more optimal balancing on
+ * demand. This might require scaling up the number of connection groups
+ * by <<1.
+ *
+ * Provide an IP 2-tuple or 4-tuple netisr m2cpu handler based on connection
+ * groups for ip_input and ip6_input, allowing non-offloaded work
+ * distribution.
+ *
+ * Expose effective CPU affinity of connections to userspace using socket
+ * options.
+ *
+ * Investigate per-connection affinity overrides based on socket options; an
+ * option could be set, certainly resulting in work being distributed
+ * differently in software, and possibly propagated to supporting hardware
+ * with TCAMs or hardware hash tables. This might require connections to
+ * exist in more than one connection group at a time.
+ *
+ * Hook netisr thread reconfiguration events, and propagate those to RSS so
+ * that rebalancing can occur when the thread pool grows or shrinks.
+ *
+ * Expose per-pcbgroup statistics to userspace monitoring tools such as
+ * netstat, in order to allow better debugging and profiling.
+ */
+
+void
+in_pcbgroup_init(struct inpcbinfo *pcbinfo, u_int hashfields,
+ int hash_nelements)
+{
+ struct inpcbgroup *pcbgroup;
+ u_int numpcbgroups, pgn;
+
+ /*
+ * Only enable connection groups for a protocol if it has been
+ * specifically requested.
+ */
+ if (hashfields == IPI_HASHFIELDS_NONE)
+ return;
+
+ /*
+ * Connection groups are about multi-processor load distribution,
+ * lock contention, and connection CPU affinity. As such, no point
+ * in turning them on for a uniprocessor machine, it only wastes
+ * memory.
+ */
+ if (mp_ncpus == 1)
+ return;
+
+ /*
+ * Use one group per CPU for now. If we decide to do dynamic
+ * rebalancing a la RSS, we'll need to shift left by at least 1.
+ */
+ numpcbgroups = mp_ncpus;
+
+ pcbinfo->ipi_hashfields = hashfields;
+ pcbinfo->ipi_pcbgroups = malloc(numpcbgroups *
+ sizeof(*pcbinfo->ipi_pcbgroups), M_PCB, M_WAITOK | M_ZERO);
+ pcbinfo->ipi_npcbgroups = numpcbgroups;
+ pcbinfo->ipi_wildbase = hashinit(hash_nelements, M_PCB,
+ &pcbinfo->ipi_wildmask);
+ for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++) {
+ pcbgroup = &pcbinfo->ipi_pcbgroups[pgn];
+ pcbgroup->ipg_hashbase = hashinit(hash_nelements, M_PCB,
+ &pcbgroup->ipg_hashmask);
+ INP_GROUP_LOCK_INIT(pcbgroup, "pcbgroup");
+
+ /*
+ * Initialise notional affinity of the pcbgroup -- for RSS,
+ * we want the same notion of affinity as NICs to be used.
+ * Just round robin for the time being.
+ */
+ pcbgroup->ipg_cpu = (pgn % mp_ncpus);
+ }
+}
+
+void
+in_pcbgroup_destroy(struct inpcbinfo *pcbinfo)
+{
+ struct inpcbgroup *pcbgroup;
+ u_int pgn;
+
+ if (pcbinfo->ipi_npcbgroups == 0)
+ return;
+
+ for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++) {
+ pcbgroup = &pcbinfo->ipi_pcbgroups[pgn];
+ KASSERT(LIST_EMPTY(pcbinfo->ipi_listhead),
+ ("in_pcbinfo_destroy: listhead not empty"));
+ INP_GROUP_LOCK_DESTROY(pcbgroup);
+ hashdestroy(pcbgroup->ipg_hashbase, M_PCB,
+ pcbgroup->ipg_hashmask);
+ }
+ hashdestroy(pcbinfo->ipi_wildbase, M_PCB, pcbinfo->ipi_wildmask);
+ free(pcbinfo->ipi_pcbgroups, M_PCB);
+ pcbinfo->ipi_pcbgroups = NULL;
+ pcbinfo->ipi_npcbgroups = 0;
+ pcbinfo->ipi_hashfields = 0;
+}
+
+/*
+ * Given a hash of whatever the covered tuple might be, return a pcbgroup
+ * index.
+ */
+static __inline u_int
+in_pcbgroup_getbucket(struct inpcbinfo *pcbinfo, uint32_t hash)
+{
+
+ return (hash % pcbinfo->ipi_npcbgroups);
+}
+
+/*
+ * Map a (hashtype, hash) tuple into a connection group, or NULL if the hash
+ * information is insufficient to identify the pcbgroup.
+ */
+struct inpcbgroup *
+in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash)
+{
+
+ return (NULL);
+}
+
+static struct inpcbgroup *
+in_pcbgroup_bymbuf(struct inpcbinfo *pcbinfo, struct mbuf *m)
+{
+
+ return (in_pcbgroup_byhash(pcbinfo, M_HASHTYPE_GET(m),
+ m->m_pkthdr.flowid));
+}
+
+struct inpcbgroup *
+in_pcbgroup_bytuple(struct inpcbinfo *pcbinfo, struct in_addr laddr,
+ u_short lport, struct in_addr faddr, u_short fport)
+{
+ uint32_t hash;
+
+ switch (pcbinfo->ipi_hashfields) {
+ case IPI_HASHFIELDS_4TUPLE:
+ hash = faddr.s_addr ^ fport;
+ break;
+
+ case IPI_HASHFIELDS_2TUPLE:
+ hash = faddr.s_addr ^ laddr.s_addr;
+ break;
+
+ default:
+ hash = 0;
+ }
+ return (&pcbinfo->ipi_pcbgroups[in_pcbgroup_getbucket(pcbinfo,
+ hash)]);
+}
+
+struct inpcbgroup *
+in_pcbgroup_byinpcb(struct inpcb *inp)
+{
+
+ return (in_pcbgroup_bytuple(inp->inp_pcbinfo, inp->inp_laddr,
+ inp->inp_lport, inp->inp_faddr, inp->inp_fport));
+}
+
+static void
+in_pcbwild_add(struct inpcb *inp)
+{
+ struct inpcbinfo *pcbinfo;
+ struct inpcbhead *head;
+ u_int pgn;
+
+ INP_WLOCK_ASSERT(inp);
+ KASSERT(!(inp->inp_flags2 & INP_PCBGROUPWILD),
+ ("%s: is wild",__func__));
+
+ pcbinfo = inp->inp_pcbinfo;
+ for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++)
+ INP_GROUP_LOCK(&pcbinfo->ipi_pcbgroups[pgn]);
+ head = &pcbinfo->ipi_wildbase[INP_PCBHASH(INADDR_ANY, inp->inp_lport,
+ 0, pcbinfo->ipi_wildmask)];
+ LIST_INSERT_HEAD(head, inp, inp_pcbgroup_wild);
+ inp->inp_flags2 |= INP_PCBGROUPWILD;
+ for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++)
+ INP_GROUP_UNLOCK(&pcbinfo->ipi_pcbgroups[pgn]);
+}
+
+static void
+in_pcbwild_remove(struct inpcb *inp)
+{
+ struct inpcbinfo *pcbinfo;
+ u_int pgn;
+
+ INP_WLOCK_ASSERT(inp);
+ KASSERT((inp->inp_flags2 & INP_PCBGROUPWILD),
+ ("%s: not wild", __func__));
+
+ pcbinfo = inp->inp_pcbinfo;
+ for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++)
+ INP_GROUP_LOCK(&pcbinfo->ipi_pcbgroups[pgn]);
+ LIST_REMOVE(inp, inp_pcbgroup_wild);
+ for (pgn = 0; pgn < pcbinfo->ipi_npcbgroups; pgn++)
+ INP_GROUP_UNLOCK(&pcbinfo->ipi_pcbgroups[pgn]);
+ inp->inp_flags2 &= ~INP_PCBGROUPWILD;
+}
+
+static __inline int
+in_pcbwild_needed(struct inpcb *inp)
+{
+
+#ifdef INET6
+ if (inp->inp_vflag & INP_IPV6)
+ return (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr));
+ else
+#endif
+ return (inp->inp_faddr.s_addr == htonl(INADDR_ANY));
+}
+
+static void
+in_pcbwild_update_internal(struct inpcb *inp)
+{
+ int wildcard_needed;
+
+ wildcard_needed = in_pcbwild_needed(inp);
+ if (wildcard_needed && !(inp->inp_flags2 & INP_PCBGROUPWILD))
+ in_pcbwild_add(inp);
+ else if (!wildcard_needed && (inp->inp_flags2 & INP_PCBGROUPWILD))
+ in_pcbwild_remove(inp);
+}
+
+/*
+ * Update the pcbgroup of an inpcb, which might include removing an old
+ * pcbgroup reference and/or adding a new one. Wildcard processing is not
+ * performed here, although ideally we'll never install a pcbgroup for a
+ * wildcard inpcb (asserted below).
+ */
+static void
+in_pcbgroup_update_internal(struct inpcbinfo *pcbinfo,
+ struct inpcbgroup *newpcbgroup, struct inpcb *inp)
+{
+ struct inpcbgroup *oldpcbgroup;
+ struct inpcbhead *pcbhash;
+ uint32_t hashkey_faddr;
+
+ INP_WLOCK_ASSERT(inp);
+
+ oldpcbgroup = inp->inp_pcbgroup;
+ if (oldpcbgroup != NULL && oldpcbgroup != newpcbgroup) {
+ INP_GROUP_LOCK(oldpcbgroup);
+ LIST_REMOVE(inp, inp_pcbgrouphash);
+ inp->inp_pcbgroup = NULL;
+ INP_GROUP_UNLOCK(oldpcbgroup);
+ }
+ if (newpcbgroup != NULL && oldpcbgroup != newpcbgroup) {
+#ifdef INET6
+ if (inp->inp_vflag & INP_IPV6)
+ hashkey_faddr = inp->in6p_faddr.s6_addr32[3]; /* XXX */
+ else
+#endif
+ hashkey_faddr = inp->inp_faddr.s_addr;
+ INP_GROUP_LOCK(newpcbgroup);
+ pcbhash = &newpcbgroup->ipg_hashbase[
+ INP_PCBHASH(hashkey_faddr, inp->inp_lport, inp->inp_fport,
+ newpcbgroup->ipg_hashmask)];
+ LIST_INSERT_HEAD(pcbhash, inp, inp_pcbgrouphash);
+ inp->inp_pcbgroup = newpcbgroup;
+ INP_GROUP_UNLOCK(newpcbgroup);
+ }
+
+ KASSERT(!(newpcbgroup != NULL && in_pcbwild_needed(inp)),
+ ("%s: pcbgroup and wildcard!", __func__));
+}
+
+/*
+ * Two update paths: one in which the 4-tuple on an inpcb has been updated
+ * and therefore connection groups may need to change (or a wildcard entry
+ * may needed to be installed), and another in which the 4-tuple has been
+ * set as a result of a packet received, in which case we may be able to use
+ * the hash on the mbuf to avoid doing a software hash calculation for RSS.
+ *
+ * In each case: first, let the wildcard code have a go at placing it as a
+ * wildcard socket. If it was a wildcard, or if the connection has been
+ * dropped, then no pcbgroup is required (so potentially clear it);
+ * otherwise, calculate and update the pcbgroup for the inpcb.
+ */
+void
+in_pcbgroup_update(struct inpcb *inp)
+{
+ struct inpcbinfo *pcbinfo;
+ struct inpcbgroup *newpcbgroup;
+
+ INP_WLOCK_ASSERT(inp);
+
+ pcbinfo = inp->inp_pcbinfo;
+ if (!in_pcbgroup_enabled(pcbinfo))
+ return;
+
+ in_pcbwild_update_internal(inp);
+ if (!(inp->inp_flags2 & INP_PCBGROUPWILD) &&
+ !(inp->inp_flags & INP_DROPPED)) {
+#ifdef INET6
+ if (inp->inp_vflag & INP_IPV6)
+ newpcbgroup = in6_pcbgroup_byinpcb(inp);
+ else
+#endif
+ newpcbgroup = in_pcbgroup_byinpcb(inp);
+ } else
+ newpcbgroup = NULL;
+ in_pcbgroup_update_internal(pcbinfo, newpcbgroup, inp);
+}
+
+void
+in_pcbgroup_update_mbuf(struct inpcb *inp, struct mbuf *m)
+{
+ struct inpcbinfo *pcbinfo;
+ struct inpcbgroup *newpcbgroup;
+
+ INP_WLOCK_ASSERT(inp);
+
+ pcbinfo = inp->inp_pcbinfo;
+ if (!in_pcbgroup_enabled(pcbinfo))
+ return;
+
+ /*
+ * Possibly should assert !INP_PCBGROUPWILD rather than testing for
+ * it; presumably this function should never be called for anything
+ * other than non-wildcard socket?
+ */
+ in_pcbwild_update_internal(inp);
+ if (!(inp->inp_flags2 & INP_PCBGROUPWILD) &&
+ !(inp->inp_flags & INP_DROPPED)) {
+ newpcbgroup = in_pcbgroup_bymbuf(pcbinfo, m);
+#ifdef INET6
+ if (inp->inp_vflag & INP_IPV6) {
+ if (newpcbgroup == NULL)
+ newpcbgroup = in6_pcbgroup_byinpcb(inp);
+ } else {
+#endif
+ if (newpcbgroup == NULL)
+ newpcbgroup = in_pcbgroup_byinpcb(inp);
+#ifdef INET6
+ }
+#endif
+ } else
+ newpcbgroup = NULL;
+ in_pcbgroup_update_internal(pcbinfo, newpcbgroup, inp);
+}
+
+/*
+ * Remove pcbgroup entry and optional pcbgroup wildcard entry for this inpcb.
+ */
+void
+in_pcbgroup_remove(struct inpcb *inp)
+{
+ struct inpcbgroup *pcbgroup;
+
+ INP_WLOCK_ASSERT(inp);
+
+ if (!in_pcbgroup_enabled(inp->inp_pcbinfo))
+ return;
+
+ if (inp->inp_flags2 & INP_PCBGROUPWILD)
+ in_pcbwild_remove(inp);
+
+ pcbgroup = inp->inp_pcbgroup;
+ if (pcbgroup != NULL) {
+ INP_GROUP_LOCK(pcbgroup);
+ LIST_REMOVE(inp, inp_pcbgrouphash);
+ inp->inp_pcbgroup = NULL;
+ INP_GROUP_UNLOCK(pcbgroup);
+ }
+}
+
+/*
+ * Query whether or not it is appropriate to use pcbgroups to look up inpcbs
+ * for a protocol.
+ */
+int
+in_pcbgroup_enabled(struct inpcbinfo *pcbinfo)
+{
+
+ return (pcbinfo->ipi_npcbgroups > 0);
+}
diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c
index 2827c22..d2a772f 100644
--- a/sys/netinet/in_proto.c
+++ b/sys/netinet/in_proto.c
@@ -106,6 +106,8 @@ static struct pr_usrreqs nousrreqs;
#include <net/if_pfsync.h>
#endif
+FEATURE(inet, "Internet Protocol version 4");
+
extern struct domain inetdomain;
/* Spacer for loadable protocols. */
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index de88556..527ce56 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -153,7 +153,8 @@ div_init(void)
* place for hashbase == NULL.
*/
in_pcbinfo_init(&V_divcbinfo, "div", &V_divcb, 1, 1, "divcb",
- div_inpcb_init, div_inpcb_fini, UMA_ZONE_NOFREE);
+ div_inpcb_init, div_inpcb_fini, UMA_ZONE_NOFREE,
+ IPI_HASHFIELDS_NONE);
}
static void
@@ -530,7 +531,9 @@ div_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
((struct sockaddr_in *)nam)->sin_addr.s_addr = INADDR_ANY;
INP_INFO_WLOCK(&V_divcbinfo);
INP_WLOCK(inp);
+ INP_HASH_WLOCK(&V_divcbinfo);
error = in_pcbbind(inp, nam, td->td_ucred);
+ INP_HASH_WUNLOCK(&V_divcbinfo);
INP_WUNLOCK(inp);
INP_INFO_WUNLOCK(&V_divcbinfo);
return error;
@@ -659,9 +662,9 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
INP_INFO_WLOCK(&V_divcbinfo);
for (i = 0; i < n; i++) {
inp = inp_list[i];
- INP_WLOCK(inp);
- if (!in_pcbrele(inp))
- INP_WUNLOCK(inp);
+ INP_RLOCK(inp);
+ if (!in_pcbrele_rlocked(inp))
+ INP_RUNLOCK(inp);
}
INP_INFO_WUNLOCK(&V_divcbinfo);
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index ac1c723..67fcb74 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -488,7 +488,7 @@ tooshort:
}
#ifdef IPSEC
/*
- * Bypass packet filtering for packets from a tunnel (gif).
+ * Bypass packet filtering for packets previously handled by IPsec.
*/
if (ip_ipsec_filtertunnel(m))
goto passin;
diff --git a/sys/netinet/ip_ipsec.c b/sys/netinet/ip_ipsec.c
index 50a6ce4..a3c87f5 100644
--- a/sys/netinet/ip_ipsec.c
+++ b/sys/netinet/ip_ipsec.c
@@ -95,7 +95,7 @@ ip_ipsec_filtertunnel(struct mbuf *m)
#if defined(IPSEC)
/*
- * Bypass packet filtering for packets from a tunnel.
+ * Bypass packet filtering for packets previously handled by IPsec.
*/
if (!V_ip4_ipsec_filtertunnel &&
m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL)
diff --git a/sys/netinet/ipfw/ip_dummynet.c b/sys/netinet/ipfw/ip_dummynet.c
index ba6e892..e23ba3a 100644
--- a/sys/netinet/ipfw/ip_dummynet.c
+++ b/sys/netinet/ipfw/ip_dummynet.c
@@ -1045,7 +1045,7 @@ config_red(struct dn_fsk *fs)
fs->w_q = fs->fs.w_q;
fs->max_p = fs->fs.max_p;
- D("called");
+ ND("called");
/* Doing stuff that was in userland */
i = fs->sched->link.bandwidth;
s = (i <= 0) ? 0 :
@@ -1109,7 +1109,7 @@ config_red(struct dn_fsk *fs)
if (dn_cfg.red_max_pkt_size < 1)
dn_cfg.red_max_pkt_size = 1500;
fs->max_pkt_size = dn_cfg.red_max_pkt_size;
- D("exit");
+ ND("exit");
return 0;
}
@@ -2176,7 +2176,7 @@ ip_dn_destroy(int last)
DN_BH_WLOCK();
if (last) {
- printf("%s removing last instance\n", __FUNCTION__);
+ ND("removing last instance\n");
ip_dn_ctl_ptr = NULL;
ip_dn_io_ptr = NULL;
}
@@ -2256,13 +2256,13 @@ unload_dn_sched(struct dn_alg *s)
struct dn_alg *tmp, *r;
int err = EINVAL;
- D("called for %s", s->name);
+ ND("called for %s", s->name);
DN_BH_WLOCK();
SLIST_FOREACH_SAFE(r, &dn_cfg.schedlist, next, tmp) {
if (strcmp(s->name, r->name) != 0)
continue;
- D("ref_count = %d", r->ref_count);
+ ND("ref_count = %d", r->ref_count);
err = (r->ref_count != 0) ? EBUSY : 0;
if (err == 0)
SLIST_REMOVE(&dn_cfg.schedlist, r, dn_alg, next);
diff --git a/sys/netinet/ipfw/ip_fw2.c b/sys/netinet/ipfw/ip_fw2.c
index 9a75cf5..9e5c737 100644
--- a/sys/netinet/ipfw/ip_fw2.c
+++ b/sys/netinet/ipfw/ip_fw2.c
@@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
#ifdef INET6
+#include <netinet6/in6_pcb.h>
#include <netinet6/scope6_var.h>
#include <netinet6/ip6_var.h>
#endif
@@ -646,21 +647,27 @@ send_reject(struct ip_fw_args *args, int code, int iplen, struct ip *ip)
* we tried and failed, or any other value if successful.
*/
static int
-check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif,
- struct in_addr dst_ip, u_int16_t dst_port, struct in_addr src_ip,
- u_int16_t src_port, int *ugid_lookupp,
- struct ucred **uc, struct inpcb *inp)
+check_uidgid(ipfw_insn_u32 *insn, struct ip_fw_args *args, int *ugid_lookupp,
+ struct ucred **uc)
{
#ifndef __FreeBSD__
+ /* XXX */
return cred_check(insn, proto, oif,
dst_ip, dst_port, src_ip, src_port,
(struct bsd_ucred *)uc, ugid_lookupp, ((struct mbuf *)inp)->m_skb);
#else /* FreeBSD */
+ struct in_addr src_ip, dst_ip;
struct inpcbinfo *pi;
- int wildcard;
- struct inpcb *pcb;
+ struct ipfw_flow_id *id;
+ struct inpcb *pcb, *inp;
+ struct ifnet *oif;
+ int lookupflags;
int match;
+ id = &args->f_id;
+ inp = args->inp;
+ oif = args->oif;
+
/*
* Check to see if the UDP or TCP stack supplied us with
* the PCB. If so, rather then holding a lock and looking
@@ -681,31 +688,53 @@ check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif,
*/
if (*ugid_lookupp == -1)
return (0);
- if (proto == IPPROTO_TCP) {
- wildcard = 0;
+ if (id->proto == IPPROTO_TCP) {
+ lookupflags = 0;
pi = &V_tcbinfo;
- } else if (proto == IPPROTO_UDP) {
- wildcard = INPLOOKUP_WILDCARD;
+ } else if (id->proto == IPPROTO_UDP) {
+ lookupflags = INPLOOKUP_WILDCARD;
pi = &V_udbinfo;
} else
return 0;
+ lookupflags |= INPLOOKUP_RLOCKPCB;
match = 0;
if (*ugid_lookupp == 0) {
- INP_INFO_RLOCK(pi);
- pcb = (oif) ?
- in_pcblookup_hash(pi,
- dst_ip, htons(dst_port),
- src_ip, htons(src_port),
- wildcard, oif) :
- in_pcblookup_hash(pi,
- src_ip, htons(src_port),
- dst_ip, htons(dst_port),
- wildcard, NULL);
+ if (id->addr_type == 6) {
+#ifdef INET6
+ if (oif == NULL)
+ pcb = in6_pcblookup_mbuf(pi,
+ &id->src_ip6, htons(id->src_port),
+ &id->dst_ip6, htons(id->dst_port),
+ lookupflags, oif, args->m);
+ else
+ pcb = in6_pcblookup_mbuf(pi,
+ &id->dst_ip6, htons(id->dst_port),
+ &id->src_ip6, htons(id->src_port),
+ lookupflags, oif, args->m);
+#else
+ *ugid_lookupp = -1;
+ return (0);
+#endif
+ } else {
+ src_ip.s_addr = htonl(id->src_ip);
+ dst_ip.s_addr = htonl(id->dst_ip);
+ if (oif == NULL)
+ pcb = in_pcblookup_mbuf(pi,
+ src_ip, htons(id->src_port),
+ dst_ip, htons(id->dst_port),
+ lookupflags, oif, args->m);
+ else
+ pcb = in_pcblookup_mbuf(pi,
+ dst_ip, htons(id->dst_port),
+ src_ip, htons(id->src_port),
+ lookupflags, oif, args->m);
+ }
if (pcb != NULL) {
+ INP_RLOCK_ASSERT(pcb);
*uc = crhold(pcb->inp_cred);
*ugid_lookupp = 1;
+ INP_RUNLOCK(pcb);
}
- INP_INFO_RUNLOCK(pi);
if (*ugid_lookupp == 0) {
/*
* We tried and failed, set the variable to -1
@@ -714,14 +743,14 @@ check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif,
*ugid_lookupp = -1;
return (0);
}
- }
+ }
if (insn->o.opcode == O_UID)
match = ((*uc)->cr_uid == (uid_t)insn->d[0]);
else if (insn->o.opcode == O_GID)
match = groupmember((gid_t)insn->d[0], *uc);
else if (insn->o.opcode == O_JAIL)
match = ((*uc)->cr_prison->pr_id == (int)insn->d[0]);
- return match;
+ return (match);
#endif /* __FreeBSD__ */
}
@@ -1259,22 +1288,17 @@ do { \
* as this ensures that we have a
* packet with the ports info.
*/
- if (offset!=0)
- break;
- if (is_ipv6) /* XXX to be fixed later */
+ if (offset != 0)
break;
if (proto == IPPROTO_TCP ||
proto == IPPROTO_UDP)
match = check_uidgid(
(ipfw_insn_u32 *)cmd,
- proto, oif,
- dst_ip, dst_port,
- src_ip, src_port, &ucred_lookup,
+ args, &ucred_lookup,
#ifdef __FreeBSD__
- &ucred_cache, args->inp);
+ &ucred_cache);
#else
- (void *)&ucred_cache,
- (struct inpcb *)args->m);
+ (void *)&ucred_cache);
#endif
break;
@@ -1389,18 +1413,15 @@ do { \
else if (v == 4 || v == 5) {
check_uidgid(
(ipfw_insn_u32 *)cmd,
- proto, oif,
- dst_ip, dst_port,
- src_ip, src_port, &ucred_lookup,
+ args, &ucred_lookup,
#ifdef __FreeBSD__
- &ucred_cache, args->inp);
+ &ucred_cache);
if (v == 4 /* O_UID */)
key = ucred_cache->cr_uid;
else if (v == 5 /* O_JAIL */)
key = ucred_cache->cr_prison->pr_id;
#else /* !__FreeBSD__ */
- (void *)&ucred_cache,
- (struct inpcb *)args->m);
+ (void *)&ucred_cache);
if (v ==4 /* O_UID */)
key = ucred_cache.uid;
else if (v == 5 /* O_JAIL */)
@@ -1827,21 +1848,32 @@ do { \
else
break;
+ /*
+ * XXXRW: so_user_cookie should almost
+ * certainly be inp_user_cookie?
+ */
+
/* For incomming packet, lookup up the
inpcb using the src/dest ip/port tuple */
if (inp == NULL) {
- INP_INFO_RLOCK(pi);
- inp = in_pcblookup_hash(pi,
+ inp = in_pcblookup(pi,
src_ip, htons(src_port),
dst_ip, htons(dst_port),
- 0, NULL);
- INP_INFO_RUNLOCK(pi);
- }
-
- if (inp && inp->inp_socket) {
- tablearg = inp->inp_socket->so_user_cookie;
- if (tablearg)
- match = 1;
+ INPLOOKUP_RLOCKPCB, NULL);
+ if (inp != NULL) {
+ tablearg =
+ inp->inp_socket->so_user_cookie;
+ if (tablearg)
+ match = 1;
+ INP_RUNLOCK(inp);
+ }
+ } else {
+ if (inp->inp_socket) {
+ tablearg =
+ inp->inp_socket->so_user_cookie;
+ if (tablearg)
+ match = 1;
+ }
}
break;
}
@@ -2106,7 +2138,8 @@ do { \
case O_FORWARD_IP:
if (args->eh) /* not valid on layer2 pkts */
break;
- if (!q || dyn_dir == MATCH_FORWARD) {
+ if (q == NULL || q->rule != f ||
+ dyn_dir == MATCH_FORWARD) {
struct sockaddr_in *sa;
sa = &(((ipfw_insn_sa *)cmd)->sa);
if (sa->sin_addr.s_addr == INADDR_ANY) {
@@ -2137,14 +2170,21 @@ do { \
done = 1; /* exit outer loop */
break;
- case O_SETFIB:
+ case O_SETFIB: {
+ uint32_t fib;
+
f->pcnt++; /* update stats */
f->bcnt += pktlen;
f->timestamp = time_uptime;
- M_SETFIB(m, cmd->arg1);
- args->f_id.fib = cmd->arg1;
+ fib = (cmd->arg1 == IP_FW_TABLEARG) ? tablearg:
+ cmd->arg1;
+ if (fib >= rt_numfibs)
+ fib = 0;
+ M_SETFIB(m, fib);
+ args->f_id.fib = fib;
l = 0; /* exit inner loop */
break;
+ }
case O_NAT:
if (!IPFW_NAT_LOADED) {
@@ -2154,6 +2194,13 @@ do { \
int nat_id;
set_match(args, f_pos, chain);
+ /* Check if this is 'global' nat rule */
+ if (cmd->arg1 == 0) {
+ retval = ipfw_nat_ptr(args, NULL, m);
+ l = 0;
+ done = 1;
+ break;
+ }
t = ((ipfw_insn_nat *)cmd)->nat;
if (t == NULL) {
nat_id = (cmd->arg1 == IP_FW_TABLEARG) ?
diff --git a/sys/netinet/ipfw/ip_fw_dynamic.c b/sys/netinet/ipfw/ip_fw_dynamic.c
index 7f0feb4..0bc4cc1 100644
--- a/sys/netinet/ipfw/ip_fw_dynamic.c
+++ b/sys/netinet/ipfw/ip_fw_dynamic.c
@@ -753,11 +753,12 @@ ipfw_install_state(struct ip_fw *rule, ipfw_insn_limit *cmd,
q = lookup_dyn_rule_locked(&args->f_id, NULL, NULL);
if (q != NULL) { /* should never occur */
+ DEB(
if (last_log != time_uptime) {
last_log = time_uptime;
printf("ipfw: %s: entry already present, done\n",
__func__);
- }
+ })
IPFW_DYN_UNLOCK();
return (0);
}
diff --git a/sys/netinet/ipfw/ip_fw_nat.c b/sys/netinet/ipfw/ip_fw_nat.c
index f8c3e63..1679a97 100644
--- a/sys/netinet/ipfw/ip_fw_nat.c
+++ b/sys/netinet/ipfw/ip_fw_nat.c
@@ -207,7 +207,8 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m)
struct mbuf *mcl;
struct ip *ip;
/* XXX - libalias duct tape */
- int ldt, retval;
+ int ldt, retval, found;
+ struct ip_fw_chain *chain;
char *c;
ldt = 0;
@@ -256,23 +257,65 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m)
ldt = 1;
c = mtod(mcl, char *);
- if (args->oif == NULL)
- retval = LibAliasIn(t->lib, c,
- mcl->m_len + M_TRAILINGSPACE(mcl));
- else
- retval = LibAliasOut(t->lib, c,
- mcl->m_len + M_TRAILINGSPACE(mcl));
- if (retval == PKT_ALIAS_RESPOND) {
- m->m_flags |= M_SKIP_FIREWALL;
- retval = PKT_ALIAS_OK;
+
+ /* Check if this is 'global' instance */
+ if (t == NULL) {
+ if (args->oif == NULL) {
+ /* Wrong direction, skip processing */
+ args->m = mcl;
+ return (IP_FW_NAT);
+ }
+
+ found = 0;
+ chain = &V_layer3_chain;
+ IPFW_RLOCK(chain);
+ /* Check every nat entry... */
+ LIST_FOREACH(t, &chain->nat, _next) {
+ if ((t->mode & PKT_ALIAS_SKIP_GLOBAL) != 0)
+ continue;
+ retval = LibAliasOutTry(t->lib, c,
+ mcl->m_len + M_TRAILINGSPACE(mcl), 0);
+ if (retval == PKT_ALIAS_OK) {
+ /* Nat instance recognises state */
+ found = 1;
+ break;
+ }
+ }
+ IPFW_RUNLOCK(chain);
+ if (found != 1) {
+ /* No instance found, return ignore */
+ args->m = mcl;
+ return (IP_FW_NAT);
+ }
+ } else {
+ if (args->oif == NULL)
+ retval = LibAliasIn(t->lib, c,
+ mcl->m_len + M_TRAILINGSPACE(mcl));
+ else
+ retval = LibAliasOut(t->lib, c,
+ mcl->m_len + M_TRAILINGSPACE(mcl));
}
- if (retval != PKT_ALIAS_OK &&
- retval != PKT_ALIAS_FOUND_HEADER_FRAGMENT) {
+
+ /*
+ * We drop packet when:
+ * 1. libalias returns PKT_ALIAS_ERROR;
+ * 2. For incoming packets:
+ * a) for unresolved fragments;
+ * b) libalias returns PKT_ALIAS_IGNORED and
+ * PKT_ALIAS_DENY_INCOMING flag is set.
+ */
+ if (retval == PKT_ALIAS_ERROR ||
+ (args->oif == NULL && (retval == PKT_ALIAS_UNRESOLVED_FRAGMENT ||
+ (retval == PKT_ALIAS_IGNORED &&
+ (t->mode & PKT_ALIAS_DENY_INCOMING) != 0)))) {
/* XXX - should i add some logging? */
m_free(mcl);
args->m = NULL;
return (IP_FW_DENY);
}
+
+ if (retval == PKT_ALIAS_RESPOND)
+ m->m_flags |= M_SKIP_FIREWALL;
mcl->m_pkthdr.len = mcl->m_len = ntohs(ip->ip_len);
/*
diff --git a/sys/netinet/ipfw/ip_fw_sockopt.c b/sys/netinet/ipfw/ip_fw_sockopt.c
index 0c903ee..2347456 100644
--- a/sys/netinet/ipfw/ip_fw_sockopt.c
+++ b/sys/netinet/ipfw/ip_fw_sockopt.c
@@ -349,12 +349,13 @@ del_entry(struct ip_fw_chain *chain, uint32_t arg)
}
if (n == 0) {
- /* A flush request (arg == 0) on empty ruleset
- * returns with no error. On the contrary,
+ /* A flush request (arg == 0 or cmd == 1) on empty
+ * ruleset returns with no error. On the contrary,
* if there is no match on a specific request,
* we return EINVAL.
*/
- error = (arg == 0) ? 0 : EINVAL;
+ if (arg != 0 && cmd != 1)
+ error = EINVAL;
break;
}
@@ -606,7 +607,8 @@ check_ipfw_struct(struct ip_fw *rule, int size)
case O_SETFIB:
if (cmdlen != F_INSN_SIZE(ipfw_insn))
goto bad_size;
- if (cmd->arg1 >= rt_numfibs) {
+ if ((cmd->arg1 != IP_FW_TABLEARG) &&
+ (cmd->arg1 >= rt_numfibs)) {
printf("ipfw: invalid fib number %d\n",
cmd->arg1);
return EINVAL;
diff --git a/sys/netinet/libalias/alias.h b/sys/netinet/libalias/alias.h
index 2aed829..b12b353 100644
--- a/sys/netinet/libalias/alias.h
+++ b/sys/netinet/libalias/alias.h
@@ -197,6 +197,18 @@ struct mbuf *m_megapullup(struct mbuf *, int);
*/
#define PKT_ALIAS_RESET_ON_ADDR_CHANGE 0x20
+/*
+ * If PKT_ALIAS_PROXY_ONLY is set, then NAT will be disabled and only
+ * transparent proxying is performed.
+ */
+#define PKT_ALIAS_PROXY_ONLY 0x40
+
+/*
+ * If PKT_ALIAS_REVERSE is set, the actions of PacketAliasIn() and
+ * PacketAliasOut() are reversed.
+ */
+#define PKT_ALIAS_REVERSE 0x80
+
#ifndef NO_FW_PUNCH
/*
* If PKT_ALIAS_PUNCH_FW is set, active FTP and IRC DCC connections will
@@ -209,16 +221,10 @@ struct mbuf *m_megapullup(struct mbuf *, int);
#endif
/*
- * If PKT_ALIAS_PROXY_ONLY is set, then NAT will be disabled and only
- * transparent proxying is performed.
- */
-#define PKT_ALIAS_PROXY_ONLY 0x40
-
-/*
- * If PKT_ALIAS_REVERSE is set, the actions of PacketAliasIn() and
- * PacketAliasOut() are reversed.
+ * If PKT_ALIAS_SKIP_GLOBAL is set, nat instance is not checked for matching
+ * states in 'ipfw nat global' rule.
*/
-#define PKT_ALIAS_REVERSE 0x80
+#define PKT_ALIAS_SKIP_GLOBAL 0x200
/* Function return codes. */
#define PKT_ALIAS_ERROR -1
diff --git a/sys/netinet/libalias/alias_sctp.h b/sys/netinet/libalias/alias_sctp.h
index 80ed965..99d54ce 100644
--- a/sys/netinet/libalias/alias_sctp.h
+++ b/sys/netinet/libalias/alias_sctp.h
@@ -135,13 +135,13 @@ struct sctp_nat_assoc {
struct in_addr a_addr; /**< alias ip address */
int state; /**< current state of NAT association */
int TableRegister; /**< stores which look up tables association is registered in */
- int exp; /**< timer expiration in seconds from uptime */
+ int exp; /**< timer expiration in seconds from uptime */
int exp_loc; /**< current location in timer_Q */
int num_Gaddr; /**< number of global IP addresses in the list */
LIST_HEAD(sctpGlobalAddresshead,sctp_GlobalAddress) Gaddr; /**< List of global addresses */
- LIST_ENTRY (sctp_nat_assoc) list_L; /**< Linked list of pointers for Local table*/
- LIST_ENTRY (sctp_nat_assoc) list_G; /**< Linked list of pointers for Global table */
- LIST_ENTRY (sctp_nat_assoc) timer_Q; /**< Linked list of pointers for timer Q */
+ LIST_ENTRY (sctp_nat_assoc) list_L; /**< Linked list of pointers for Local table*/
+ LIST_ENTRY (sctp_nat_assoc) list_G; /**< Linked list of pointers for Global table */
+ LIST_ENTRY (sctp_nat_assoc) timer_Q; /**< Linked list of pointers for timer Q */
//Using libalias locking
};
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index be099a8..e754b88 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -205,7 +205,8 @@ rip_init(void)
{
in_pcbinfo_init(&V_ripcbinfo, "rip", &V_ripcb, INP_PCBHASH_RAW_SIZE,
- 1, "ripcb", rip_inpcb_init, NULL, UMA_ZONE_NOFREE);
+ 1, "ripcb", rip_inpcb_init, NULL, UMA_ZONE_NOFREE,
+ IPI_HASHFIELDS_NONE);
EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, NULL,
EVENTHANDLER_PRI_ANY);
}
@@ -226,7 +227,7 @@ rip_append(struct inpcb *last, struct ip *ip, struct mbuf *n,
{
int policyfail = 0;
- INP_RLOCK_ASSERT(last);
+ INP_LOCK_ASSERT(last);
#ifdef IPSEC
/* check AH/ESP integrity. */
@@ -834,16 +835,19 @@ rip_detach(struct socket *so)
static void
rip_dodisconnect(struct socket *so, struct inpcb *inp)
{
+ struct inpcbinfo *pcbinfo;
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
- INP_WLOCK_ASSERT(inp);
-
+ pcbinfo = inp->inp_pcbinfo;
+ INP_INFO_WLOCK(pcbinfo);
+ INP_WLOCK(inp);
rip_delhash(inp);
inp->inp_faddr.s_addr = INADDR_ANY;
rip_inshash(inp);
SOCK_LOCK(so);
so->so_state &= ~SS_ISCONNECTED;
SOCK_UNLOCK(so);
+ INP_WUNLOCK(inp);
+ INP_INFO_WUNLOCK(pcbinfo);
}
static void
@@ -854,11 +858,7 @@ rip_abort(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("rip_abort: inp == NULL"));
- INP_INFO_WLOCK(&V_ripcbinfo);
- INP_WLOCK(inp);
rip_dodisconnect(so, inp);
- INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_ripcbinfo);
}
static void
@@ -869,11 +869,7 @@ rip_close(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("rip_close: inp == NULL"));
- INP_INFO_WLOCK(&V_ripcbinfo);
- INP_WLOCK(inp);
rip_dodisconnect(so, inp);
- INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_ripcbinfo);
}
static int
@@ -887,11 +883,7 @@ rip_disconnect(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("rip_disconnect: inp == NULL"));
- INP_INFO_WLOCK(&V_ripcbinfo);
- INP_WLOCK(inp);
rip_dodisconnect(so, inp);
- INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_ripcbinfo);
return (0);
}
@@ -1077,9 +1069,9 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
INP_INFO_WLOCK(&V_ripcbinfo);
for (i = 0; i < n; i++) {
inp = inp_list[i];
- INP_WLOCK(inp);
- if (!in_pcbrele(inp))
- INP_WUNLOCK(inp);
+ INP_RLOCK(inp);
+ if (!in_pcbrele_rlocked(inp))
+ INP_RUNLOCK(inp);
}
INP_INFO_WUNLOCK(&V_ripcbinfo);
diff --git a/sys/netinet/sctp.h b/sys/netinet/sctp.h
index fa29a75..3c8cf36 100644
--- a/sys/netinet/sctp.h
+++ b/sys/netinet/sctp.h
@@ -91,7 +91,7 @@ struct sctp_paramhdr {
#define SCTP_PEER_ADDR_PARAMS 0x0000000a
#define SCTP_DEFAULT_SEND_PARAM 0x0000000b
/* ancillary data/notification interest options */
-#define SCTP_EVENTS 0x0000000c
+#define SCTP_EVENTS 0x0000000c /* deprecated */
/* Without this applied we will give V4 and V6 addresses on a V6 socket */
#define SCTP_I_WANT_MAPPED_V4_ADDR 0x0000000d
#define SCTP_MAXSEG 0x0000000e
@@ -114,6 +114,11 @@ struct sctp_paramhdr {
#define SCTP_EXPLICIT_EOR 0x0000001b
#define SCTP_REUSE_PORT 0x0000001c /* rw */
#define SCTP_AUTH_DEACTIVATE_KEY 0x0000001d
+#define SCTP_EVENT 0x0000001e
+#define SCTP_RECVRCVINFO 0x0000001f
+#define SCTP_RECVNXTINFO 0x00000020
+#define SCTP_DEFAULT_SNDINFO 0x00000021
+#define SCTP_DEFAULT_PRINFO 0x00000022
/*
* read-only options
@@ -490,7 +495,7 @@ struct sctp_error_unrecognized_chunk {
/*
* PCB Features (in sctp_features bitmask)
*/
-#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002
+#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 /* deprecated */
#define SCTP_PCB_FLAGS_DONOT_HEARTBEAT 0x00000004
#define SCTP_PCB_FLAGS_FRAG_INTERLEAVE 0x00000008
#define SCTP_PCB_FLAGS_INTERLEAVE_STRMS 0x00000010
@@ -500,7 +505,7 @@ struct sctp_error_unrecognized_chunk {
/* socket options */
#define SCTP_PCB_FLAGS_NODELAY 0x00000100
#define SCTP_PCB_FLAGS_AUTOCLOSE 0x00000200
-#define SCTP_PCB_FLAGS_RECVDATAIOEVNT 0x00000400
+#define SCTP_PCB_FLAGS_RECVDATAIOEVNT 0x00000400 /* deprecated */
#define SCTP_PCB_FLAGS_RECVASSOCEVNT 0x00000800
#define SCTP_PCB_FLAGS_RECVPADDREVNT 0x00001000
#define SCTP_PCB_FLAGS_RECVPEERERR 0x00002000
@@ -516,6 +521,9 @@ struct sctp_error_unrecognized_chunk {
#define SCTP_PCB_FLAGS_MULTIPLE_ASCONFS 0x01000000
#define SCTP_PCB_FLAGS_PORTREUSE 0x02000000
#define SCTP_PCB_FLAGS_DRYEVNT 0x04000000
+#define SCTP_PCB_FLAGS_RECVRCVINFO 0x08000000
+#define SCTP_PCB_FLAGS_RECVNXTINFO 0x10000000
+
/*-
* mobility_features parameters (by micchie).Note
* these features are applied against the
diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c
index 91e3f78..b68c840 100644
--- a/sys/netinet/sctp_auth.c
+++ b/sys/netinet/sctp_auth.c
@@ -1866,7 +1866,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication,
/* If the socket is gone we are out of here */
return;
}
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_AUTHEVNT))
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_AUTHEVNT))
/* event not enabled */
return;
diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c
index 9734aea..e142a3e 100644
--- a/sys/netinet/sctp_indata.c
+++ b/sys/netinet/sctp_indata.c
@@ -201,95 +201,114 @@ failed_build:
struct mbuf *
-sctp_build_ctl_nchunk(struct sctp_inpcb *inp,
- struct sctp_sndrcvinfo *sinfo)
+sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
{
+ struct sctp_extrcvinfo *seinfo;
struct sctp_sndrcvinfo *outinfo;
+ struct sctp_rcvinfo *rcvinfo;
+ struct sctp_nxtinfo *nxtinfo;
struct cmsghdr *cmh;
struct mbuf *ret;
int len;
- int use_extended = 0;
+ int use_extended;
+ int provide_nxt;
- if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) {
- /* user does not want the sndrcv ctl */
+ if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT) &&
+ sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVRCVINFO) &&
+ sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVNXTINFO)) {
+ /* user does not want any ancillary data */
return (NULL);
}
- if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) {
- use_extended = 1;
- len = CMSG_LEN(sizeof(struct sctp_extrcvinfo));
+ len = 0;
+ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) {
+ len += CMSG_SPACE(sizeof(struct sctp_rcvinfo));
+ }
+ seinfo = (struct sctp_extrcvinfo *)sinfo;
+ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO) &&
+ (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_AVAIL)) {
+ provide_nxt = 1;
+ len += CMSG_SPACE(sizeof(struct sctp_rcvinfo));
} else {
- len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo));
+ provide_nxt = 0;
+ }
+ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) {
+ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) {
+ use_extended = 1;
+ len += CMSG_SPACE(sizeof(struct sctp_extrcvinfo));
+ } else {
+ use_extended = 0;
+ len += CMSG_SPACE(sizeof(struct sctp_sndrcvinfo));
+ }
+ } else {
+ use_extended = 0;
}
-
- ret = sctp_get_mbuf_for_msg(len,
- 0, M_DONTWAIT, 1, MT_DATA);
-
+ ret = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA);
if (ret == NULL) {
/* No space */
return (ret);
}
- /* We need a CMSG header followed by the struct */
+ SCTP_BUF_LEN(ret) = 0;
+
+ /* We need a CMSG header followed by the struct */
cmh = mtod(ret, struct cmsghdr *);
- outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh);
- cmh->cmsg_level = IPPROTO_SCTP;
- if (use_extended) {
- cmh->cmsg_type = SCTP_EXTRCV;
- cmh->cmsg_len = len;
- memcpy(outinfo, sinfo, len);
- } else {
- cmh->cmsg_type = SCTP_SNDRCV;
- cmh->cmsg_len = len;
- *outinfo = *sinfo;
+ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) {
+ cmh->cmsg_level = IPPROTO_SCTP;
+ cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_rcvinfo));
+ cmh->cmsg_type = SCTP_RCVINFO;
+ rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmh);
+ rcvinfo->rcv_sid = sinfo->sinfo_stream;
+ rcvinfo->rcv_ssn = sinfo->sinfo_ssn;
+ rcvinfo->rcv_flags = sinfo->sinfo_flags;
+ rcvinfo->rcv_ppid = sinfo->sinfo_ppid;
+ rcvinfo->rcv_tsn = sinfo->sinfo_tsn;
+ rcvinfo->rcv_cumtsn = sinfo->sinfo_cumtsn;
+ rcvinfo->rcv_context = sinfo->sinfo_context;
+ rcvinfo->rcv_assoc_id = sinfo->sinfo_assoc_id;
+ cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_rcvinfo)));
+ SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_rcvinfo));
+ }
+ if (provide_nxt) {
+ cmh->cmsg_level = IPPROTO_SCTP;
+ cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_nxtinfo));
+ cmh->cmsg_type = SCTP_NXTINFO;
+ nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmh);
+ nxtinfo->nxt_sid = seinfo->sreinfo_next_stream;
+ nxtinfo->nxt_flags = 0;
+ if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_UNORDERED) {
+ nxtinfo->nxt_flags |= SCTP_UNORDERED;
+ }
+ if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_NOTIFICATION) {
+ nxtinfo->nxt_flags |= SCTP_NOTIFICATION;
+ }
+ if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_ISCOMPLETE) {
+ nxtinfo->nxt_flags |= SCTP_COMPLETE;
+ }
+ nxtinfo->nxt_ppid = seinfo->sreinfo_next_ppid;
+ nxtinfo->nxt_length = seinfo->sreinfo_next_length;
+ nxtinfo->nxt_assoc_id = seinfo->sreinfo_next_aid;
+ cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_nxtinfo)));
+ SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_nxtinfo));
+ }
+ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) {
+ cmh->cmsg_level = IPPROTO_SCTP;
+ outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh);
+ if (use_extended) {
+ cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_extrcvinfo));
+ cmh->cmsg_type = SCTP_EXTRCV;
+ memcpy(outinfo, sinfo, sizeof(struct sctp_extrcvinfo));
+ SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_extrcvinfo));
+ } else {
+ cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo));
+ cmh->cmsg_type = SCTP_SNDRCV;
+ *outinfo = *sinfo;
+ SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_sndrcvinfo));
+ }
}
- SCTP_BUF_LEN(ret) = cmh->cmsg_len;
return (ret);
}
-char *
-sctp_build_ctl_cchunk(struct sctp_inpcb *inp,
- int *control_len,
- struct sctp_sndrcvinfo *sinfo)
-{
- struct sctp_sndrcvinfo *outinfo;
- struct cmsghdr *cmh;
- char *buf;
- int len;
- int use_extended = 0;
-
- if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) {
- /* user does not want the sndrcv ctl */
- return (NULL);
- }
- if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) {
- use_extended = 1;
- len = CMSG_LEN(sizeof(struct sctp_extrcvinfo));
- } else {
- len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo));
- }
- SCTP_MALLOC(buf, char *, len, SCTP_M_CMSG);
- if (buf == NULL) {
- /* No space */
- return (buf);
- }
- /* We need a CMSG header followed by the struct */
- cmh = (struct cmsghdr *)buf;
- outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh);
- cmh->cmsg_level = IPPROTO_SCTP;
- if (use_extended) {
- cmh->cmsg_type = SCTP_EXTRCV;
- cmh->cmsg_len = len;
- memcpy(outinfo, sinfo, len);
- } else {
- cmh->cmsg_type = SCTP_SNDRCV;
- cmh->cmsg_len = len;
- *outinfo = *sinfo;
- }
- *control_len = len;
- return (buf);
-}
-
static void
sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn)
{
diff --git a/sys/netinet/sctp_indata.h b/sys/netinet/sctp_indata.h
index 34090df..1dbd364 100644
--- a/sys/netinet/sctp_indata.h
+++ b/sys/netinet/sctp_indata.h
@@ -83,11 +83,6 @@ struct mbuf *
sctp_build_ctl_nchunk(struct sctp_inpcb *inp,
struct sctp_sndrcvinfo *sinfo);
-char *
-sctp_build_ctl_cchunk(struct sctp_inpcb *inp,
- int *control_len,
- struct sctp_sndrcvinfo *sinfo);
-
void sctp_set_rwnd(struct sctp_tcb *, struct sctp_association *);
uint32_t
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index a7d22bd..043b3b2 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -3355,54 +3355,338 @@ sctp_source_address_selection(struct sctp_inpcb *inp,
}
static int
-sctp_find_cmsg(int c_type, void *data, struct mbuf *control, int cpsize)
+sctp_find_cmsg(int c_type, void *data, struct mbuf *control, size_t cpsize)
{
struct cmsghdr cmh;
- int tlen, at;
+ int tlen, at, found;
+ struct sctp_sndinfo sndinfo;
+ struct sctp_prinfo prinfo;
+ struct sctp_authinfo authinfo;
tlen = SCTP_BUF_LEN(control);
at = 0;
+ found = 0;
/*
* Independent of how many mbufs, find the c_type inside the control
* structure and copy out the data.
*/
while (at < tlen) {
if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) {
- /* not enough room for one more we are done. */
- return (0);
+ /* There is not enough room for one more. */
+ return (found);
}
m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh);
+ if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) {
+ /* We dont't have a complete CMSG header. */
+ return (found);
+ }
if (((int)cmh.cmsg_len + at) > tlen) {
- /*
- * this is real messed up since there is not enough
- * data here to cover the cmsg header. We are done.
- */
- return (0);
+ /* We don't have the complete CMSG. */
+ return (found);
}
if ((cmh.cmsg_level == IPPROTO_SCTP) &&
- (c_type == cmh.cmsg_type)) {
- /* found the one we want, copy it out */
- at += CMSG_ALIGN(sizeof(struct cmsghdr));
- if ((int)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) {
- /*
- * space of cmsg_len after header not big
- * enough
- */
- return (0);
+ ((c_type == cmh.cmsg_type) ||
+ ((c_type == SCTP_SNDRCV) &&
+ ((cmh.cmsg_type == SCTP_SNDINFO) ||
+ (cmh.cmsg_type == SCTP_PRINFO) ||
+ (cmh.cmsg_type == SCTP_AUTHINFO))))) {
+ if (c_type == cmh.cmsg_type) {
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) {
+ return (found);
+ }
+ /* It is exactly what we want. Copy it out. */
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), cpsize, (caddr_t)data);
+ return (1);
+ } else {
+ struct sctp_sndrcvinfo *sndrcvinfo;
+
+ sndrcvinfo = (struct sctp_sndrcvinfo *)data;
+ if (found == 0) {
+ if (cpsize < sizeof(struct sctp_sndrcvinfo)) {
+ return (found);
+ }
+ memset(sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo));
+ }
+ switch (cmh.cmsg_type) {
+ case SCTP_SNDINFO:
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_sndinfo)) {
+ return (found);
+ }
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo);
+ sndrcvinfo->sinfo_stream = sndinfo.snd_sid;
+ sndrcvinfo->sinfo_flags = sndinfo.snd_flags;
+ sndrcvinfo->sinfo_ppid = sndinfo.snd_ppid;
+ sndrcvinfo->sinfo_context = sndinfo.snd_context;
+ sndrcvinfo->sinfo_assoc_id = sndinfo.snd_assoc_id;
+ break;
+ case SCTP_PRINFO:
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_prinfo)) {
+ return (found);
+ }
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo);
+ sndrcvinfo->sinfo_timetolive = prinfo.pr_value;
+ sndrcvinfo->sinfo_flags |= prinfo.pr_policy;
+ break;
+ case SCTP_AUTHINFO:
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_authinfo)) {
+ return (found);
+ }
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo);
+ sndrcvinfo->sinfo_keynumber_valid = 1;
+ sndrcvinfo->sinfo_keynumber = authinfo.auth_keyid;
+ break;
+ default:
+ return (found);
+ }
+ found = 1;
}
- m_copydata(control, at, cpsize, data);
+ }
+ at += CMSG_ALIGN(cmh.cmsg_len);
+ }
+ return (found);
+}
+
+static int
+sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *error)
+{
+ struct cmsghdr cmh;
+ int tlen, at;
+ struct sctp_initmsg initmsg;
+
+#ifdef INET
+ struct sockaddr_in sin;
+
+#endif
+#ifdef INET6
+ struct sockaddr_in6 sin6;
+
+#endif
+
+ tlen = SCTP_BUF_LEN(control);
+ at = 0;
+ while (at < tlen) {
+ if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) {
+ /* There is not enough room for one more. */
+ *error = EINVAL;
return (1);
- } else {
- at += CMSG_ALIGN(cmh.cmsg_len);
- if (cmh.cmsg_len == 0) {
+ }
+ m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh);
+ if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) {
+ /* We dont't have a complete CMSG header. */
+ *error = EINVAL;
+ return (1);
+ }
+ if (((int)cmh.cmsg_len + at) > tlen) {
+ /* We don't have the complete CMSG. */
+ *error = EINVAL;
+ return (1);
+ }
+ if (cmh.cmsg_level == IPPROTO_SCTP) {
+ switch (cmh.cmsg_type) {
+ case SCTP_INIT:
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_initmsg)) {
+ *error = EINVAL;
+ return (1);
+ }
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg);
+ if (initmsg.sinit_max_attempts)
+ stcb->asoc.max_init_times = initmsg.sinit_max_attempts;
+ if (initmsg.sinit_num_ostreams)
+ stcb->asoc.pre_open_streams = initmsg.sinit_num_ostreams;
+ if (initmsg.sinit_max_instreams)
+ stcb->asoc.max_inbound_streams = initmsg.sinit_max_instreams;
+ if (initmsg.sinit_max_init_timeo)
+ stcb->asoc.initial_init_rto_max = initmsg.sinit_max_init_timeo;
+ if (stcb->asoc.streamoutcnt < stcb->asoc.pre_open_streams) {
+ struct sctp_stream_out *tmp_str;
+ unsigned int i;
+
+ /* Default is NOT correct */
+ SCTPDBG(SCTP_DEBUG_OUTPUT1, "Ok, default:%d pre_open:%d\n",
+ stcb->asoc.streamoutcnt, stcb->asoc.pre_open_streams);
+ SCTP_TCB_UNLOCK(stcb);
+ SCTP_MALLOC(tmp_str,
+ struct sctp_stream_out *,
+ (stcb->asoc.pre_open_streams * sizeof(struct sctp_stream_out)),
+ SCTP_M_STRMO);
+ SCTP_TCB_LOCK(stcb);
+ if (tmp_str != NULL) {
+ SCTP_FREE(stcb->asoc.strmout, SCTP_M_STRMO);
+ stcb->asoc.strmout = tmp_str;
+ stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt = stcb->asoc.pre_open_streams;
+ } else {
+ stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt;
+ }
+ for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
+ stcb->asoc.strmout[i].next_sequence_sent = 0;
+ TAILQ_INIT(&stcb->asoc.strmout[i].outqueue);
+ stcb->asoc.strmout[i].stream_no = i;
+ stcb->asoc.strmout[i].last_msg_incomplete = 0;
+ stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL);
+ }
+ }
+ break;
+#ifdef INET
+ case SCTP_DSTADDRV4:
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) {
+ *error = EINVAL;
+ return (1);
+ }
+ memset(&sin, 0, sizeof(struct sockaddr_in));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(struct sockaddr_in);
+ sin.sin_port = stcb->rport;
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr);
+ if ((sin.sin_addr.s_addr == INADDR_ANY) ||
+ (sin.sin_addr.s_addr == INADDR_BROADCAST) ||
+ IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) {
+ *error = EINVAL;
+ return (-1);
+ }
+ if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) {
+ *error = ENOBUFS;
+ return (1);
+ }
+ break;
+#endif
+#ifdef INET6
+ case SCTP_DSTADDRV6:
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) {
+ *error = EINVAL;
+ return (1);
+ }
+ memset(&sin6, 0, sizeof(struct sockaddr_in6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_len = sizeof(struct sockaddr_in6);
+ sin6.sin6_port = stcb->rport;
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr);
+ if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) ||
+ IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) {
+ *error = EINVAL;
+ return (-1);
+ }
+#ifdef INET
+ if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) {
+ in6_sin6_2_sin(&sin, &sin6);
+ if ((sin.sin_addr.s_addr == INADDR_ANY) ||
+ (sin.sin_addr.s_addr == INADDR_BROADCAST) ||
+ IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) {
+ *error = EINVAL;
+ return (-1);
+ }
+ if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) {
+ *error = ENOBUFS;
+ return (1);
+ }
+ } else
+#endif
+ if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin6, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) {
+ *error = ENOBUFS;
+ return (1);
+ }
+ break;
+#endif
+ default:
break;
}
}
+ at += CMSG_ALIGN(cmh.cmsg_len);
}
- /* not found */
return (0);
}
+static struct sctp_tcb *
+sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p,
+ in_port_t port,
+ struct mbuf *control,
+ struct sctp_nets **net_p,
+ int *error)
+{
+ struct cmsghdr cmh;
+ int tlen, at;
+ struct sctp_tcb *stcb;
+ struct sockaddr *addr;
+
+#ifdef INET
+ struct sockaddr_in sin;
+
+#endif
+#ifdef INET6
+ struct sockaddr_in6 sin6;
+
+#endif
+
+ tlen = SCTP_BUF_LEN(control);
+ at = 0;
+ while (at < tlen) {
+ if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) {
+ /* There is not enough room for one more. */
+ *error = EINVAL;
+ return (NULL);
+ }
+ m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh);
+ if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) {
+ /* We dont't have a complete CMSG header. */
+ *error = EINVAL;
+ return (NULL);
+ }
+ if (((int)cmh.cmsg_len + at) > tlen) {
+ /* We don't have the complete CMSG. */
+ *error = EINVAL;
+ return (NULL);
+ }
+ if (cmh.cmsg_level == IPPROTO_SCTP) {
+ switch (cmh.cmsg_type) {
+#ifdef INET
+ case SCTP_DSTADDRV4:
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) {
+ *error = EINVAL;
+ return (NULL);
+ }
+ memset(&sin, 0, sizeof(struct sockaddr_in));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(struct sockaddr_in);
+ sin.sin_port = port;
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr);
+ addr = (struct sockaddr *)&sin;
+ break;
+#endif
+#ifdef INET6
+ case SCTP_DSTADDRV6:
+ if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) {
+ *error = EINVAL;
+ return (NULL);
+ }
+ memset(&sin6, 0, sizeof(struct sockaddr_in6));
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_len = sizeof(struct sockaddr_in6);
+ sin6.sin6_port = port;
+ m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr);
+#ifdef INET
+ if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) {
+ in6_sin6_2_sin(&sin, &sin6);
+ addr = (struct sockaddr *)&sin;
+ } else
+#endif
+ addr = (struct sockaddr *)&sin6;
+ break;
+#endif
+ default:
+ addr = NULL;
+ break;
+ }
+ if (addr) {
+ stcb = sctp_findassociation_ep_addr(inp_p, addr, net_p, NULL, NULL);
+ if (stcb != NULL) {
+ return (stcb);
+ }
+ }
+ }
+ at += CMSG_ALIGN(cmh.cmsg_len);
+ }
+ return (NULL);
+}
+
static struct mbuf *
sctp_add_cookie(struct sctp_inpcb *inp, struct mbuf *init, int init_offset,
struct mbuf *initack, int initack_offset, struct sctp_state_cookie *stc_in, uint8_t ** signature)
@@ -5989,19 +6273,26 @@ sctp_msg_append(struct sctp_tcb *stcb,
sp->some_taken = 0;
sp->data = m;
sp->tail_mbuf = NULL;
- sp->length = 0;
- at = m;
sctp_set_prsctp_policy(sp);
/*
* We could in theory (for sendall) sifa the length in, but we would
* still have to hunt through the chain since we need to setup the
* tail_mbuf
*/
- while (at) {
+ sp->length = 0;
+ for (at = m; at; at = SCTP_BUF_NEXT(at)) {
if (SCTP_BUF_NEXT(at) == NULL)
sp->tail_mbuf = at;
sp->length += SCTP_BUF_LEN(at);
- at = SCTP_BUF_NEXT(at);
+ }
+ if (srcv->sinfo_keynumber_valid) {
+ sp->auth_keyid = srcv->sinfo_keynumber;
+ } else {
+ sp->auth_keyid = stcb->asoc.authinfo.active_keyid;
+ }
+ if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) {
+ sctp_auth_key_acquire(stcb, sp->auth_keyid);
+ sp->holds_key_ref = 1;
}
SCTP_TCB_SEND_LOCK(stcb);
sctp_snd_sb_alloc(stcb, sp->length);
@@ -6478,7 +6769,9 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m,
memset(ca, 0, sizeof(struct sctp_copy_all));
ca->inp = inp;
- memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo));
+ if (srcv) {
+ memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo));
+ }
/*
* take off the sendall flag, it would be bad if we failed to do
* this :-0
@@ -12229,9 +12522,13 @@ sctp_copy_it_in(struct sctp_tcb *stcb,
*error = 0;
goto skip_copy;
}
- sp->auth_keyid = stcb->asoc.authinfo.active_keyid;
+ if (srcv->sinfo_keynumber_valid) {
+ sp->auth_keyid = srcv->sinfo_keynumber;
+ } else {
+ sp->auth_keyid = stcb->asoc.authinfo.active_keyid;
+ }
if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) {
- sctp_auth_key_acquire(stcb, stcb->asoc.authinfo.active_keyid);
+ sctp_auth_key_acquire(stcb, sp->auth_keyid);
sp->holds_key_ref = 1;
}
*error = sctp_copy_one(sp, uio, resv_in_first);
@@ -12263,8 +12560,8 @@ sctp_sosend(struct socket *so,
struct thread *p
)
{
- int error, use_rcvinfo = 0;
- struct sctp_sndrcvinfo srcv;
+ int error, use_sndinfo = 0;
+ struct sctp_sndrcvinfo sndrcvninfo;
struct sockaddr *addr_to_use;
#if defined(INET) && defined(INET6)
@@ -12274,10 +12571,10 @@ sctp_sosend(struct socket *so,
if (control) {
/* process cmsg snd/rcv info (maybe a assoc-id) */
- if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&srcv, control,
- sizeof(srcv))) {
+ if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&sndrcvninfo, control,
+ sizeof(sndrcvninfo))) {
/* got one */
- use_rcvinfo = 1;
+ use_sndinfo = 1;
}
}
addr_to_use = addr;
@@ -12295,7 +12592,7 @@ sctp_sosend(struct socket *so,
error = sctp_lower_sosend(so, addr_to_use, uio, top,
control,
flags,
- use_rcvinfo ? &srcv : NULL
+ use_sndinfo ? &sndrcvninfo : NULL
,p
);
return (error);
@@ -12500,6 +12797,9 @@ sctp_lower_sosend(struct socket *so,
SCTP_INP_WUNLOCK(inp);
/* With the lock applied look again */
stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL);
+ if ((stcb == NULL) && (control != NULL) && (port > 0)) {
+ stcb = sctp_findassociation_cmsgs(&t_inp, port, control, &net, &error);
+ }
if (stcb == NULL) {
SCTP_INP_WLOCK(inp);
SCTP_INP_DECR_REF(inp);
@@ -12507,6 +12807,9 @@ sctp_lower_sosend(struct socket *so,
} else {
hold_tcblock = 1;
}
+ if (error) {
+ goto out_unlocked;
+ }
if (t_inp != inp) {
SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN);
error = ENOTCONN;
@@ -12555,6 +12858,7 @@ sctp_lower_sosend(struct socket *so,
/* Error is setup for us in the call */
goto out_unlocked;
}
+ hold_tcblock = 1;
if (create_lock_applied) {
SCTP_ASOC_CREATE_UNLOCK(inp);
create_lock_applied = 0;
@@ -12574,84 +12878,13 @@ sctp_lower_sosend(struct socket *so,
sctp_initialize_auth_params(inp, stcb);
if (control) {
- /*
- * see if a init structure exists in cmsg
- * headers
- */
- struct sctp_initmsg initm;
- int i;
-
- if (sctp_find_cmsg(SCTP_INIT, (void *)&initm, control,
- sizeof(initm))) {
- /*
- * we have an INIT override of the
- * default
- */
- if (initm.sinit_max_attempts)
- asoc->max_init_times = initm.sinit_max_attempts;
- if (initm.sinit_num_ostreams)
- asoc->pre_open_streams = initm.sinit_num_ostreams;
- if (initm.sinit_max_instreams)
- asoc->max_inbound_streams = initm.sinit_max_instreams;
- if (initm.sinit_max_init_timeo)
- asoc->initial_init_rto_max = initm.sinit_max_init_timeo;
- if (asoc->streamoutcnt < asoc->pre_open_streams) {
- struct sctp_stream_out *tmp_str;
- int had_lock = 0;
-
- /* Default is NOT correct */
- SCTPDBG(SCTP_DEBUG_OUTPUT1, "Ok, defout:%d pre_open:%d\n",
- asoc->streamoutcnt, asoc->pre_open_streams);
- /*
- * What happens if this
- * fails? we panic ...
- */
-
- if (hold_tcblock) {
- had_lock = 1;
- SCTP_TCB_UNLOCK(stcb);
- }
- SCTP_MALLOC(tmp_str,
- struct sctp_stream_out *,
- (asoc->pre_open_streams *
- sizeof(struct sctp_stream_out)),
- SCTP_M_STRMO);
- if (had_lock) {
- SCTP_TCB_LOCK(stcb);
- }
- if (tmp_str != NULL) {
- SCTP_FREE(asoc->strmout, SCTP_M_STRMO);
- asoc->strmout = tmp_str;
- asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams;
- } else {
- asoc->pre_open_streams = asoc->streamoutcnt;
- }
- for (i = 0; i < asoc->streamoutcnt; i++) {
- /*-
- * inbound side must be set
- * to 0xffff, also NOTE when
- * we get the INIT-ACK back
- * (for INIT sender) we MUST
- * reduce the count
- * (streamoutcnt) but first
- * check if we sent to any
- * of the upper streams that
- * were dropped (if some
- * were). Those that were
- * dropped must be notified
- * to the upper layer as
- * failed to send.
- */
- asoc->strmout[i].next_sequence_sent = 0x0;
- TAILQ_INIT(&asoc->strmout[i].outqueue);
- asoc->strmout[i].stream_no = i;
- asoc->strmout[i].last_msg_incomplete = 0;
- asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL);
- }
- }
+ if (sctp_process_cmsgs_for_init(stcb, control, &error)) {
+ sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, SCTP_FROM_SCTP_OUTPUT + SCTP_LOC_7);
+ hold_tcblock = 0;
+ stcb = NULL;
+ goto out_unlocked;
}
}
- hold_tcblock = 1;
/* out with the INIT */
queue_only_for_init = 1;
/*-
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index e53e28a..8dc01cd 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -4196,11 +4196,11 @@ try_again:
return (0);
}
/*
- * We don't allow assoc id to be 0, this is needed otherwise if the
- * id were to wrap we would have issues with some socket options.
+ * We don't allow assoc id to be one of SCTP_FUTURE_ASSOC,
+ * SCTP_CURRENT_ASSOC and SCTP_ALL_ASSOC.
*/
- if (inp->sctp_associd_counter == 0) {
- inp->sctp_associd_counter++;
+ if (inp->sctp_associd_counter <= SCTP_ALL_ASSOC) {
+ inp->sctp_associd_counter = SCTP_ALL_ASSOC + 1;
}
id = inp->sctp_associd_counter;
inp->sctp_associd_counter++;
@@ -4793,7 +4793,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre
/* Held for PD-API clear that. */
sq->pdapi_aborted = 1;
sq->held_length = 0;
- if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PDAPIEVNT) && (so != NULL)) {
+ if (sctp_stcb_is_feature_on(inp, stcb, SCTP_PCB_FLAGS_PDAPIEVNT) && (so != NULL)) {
/*
* Need to add a PD-API
* aborted indication.
diff --git a/sys/netinet/sctp_structs.h b/sys/netinet/sctp_structs.h
index 250b312..0f9bcaf 100644
--- a/sys/netinet/sctp_structs.h
+++ b/sys/netinet/sctp_structs.h
@@ -647,6 +647,8 @@ struct sctp_nonpad_sndrcvinfo {
uint32_t sinfo_tsn;
uint32_t sinfo_cumtsn;
sctp_assoc_t sinfo_assoc_id;
+ uint16_t sinfo_keynumber;
+ uint16_t sinfo_keynumber_valid;
};
/*
@@ -1201,6 +1203,7 @@ struct sctp_association {
/* JRS 5/21/07 - CMT PF variable */
uint8_t sctp_cmt_pf;
uint8_t use_precise_time;
+ uint32_t sctp_features;
/*
* The mapping array is used to track out of order sequences above
* last_acked_seq. 0 indicates packet missing 1 indicates packet
diff --git a/sys/netinet/sctp_uio.h b/sys/netinet/sctp_uio.h
index 56aef9d..a798682 100644
--- a/sys/netinet/sctp_uio.h
+++ b/sys/netinet/sctp_uio.h
@@ -47,6 +47,16 @@ __FBSDID("$FreeBSD$");
typedef uint32_t sctp_assoc_t;
+#define SCTP_FUTURE_ASSOC 0
+#define SCTP_CURRENT_ASSOC 1
+#define SCTP_ALL_ASSOC 2
+
+struct sctp_event {
+ sctp_assoc_t se_assoc_id;
+ uint16_t se_type;
+ uint8_t se_on;
+};
+
/* Compatibility to previous define's */
#define sctp_stream_reset_events sctp_stream_reset_event
@@ -69,6 +79,14 @@ struct sctp_event_subscribe {
#define SCTP_INIT 0x0001
#define SCTP_SNDRCV 0x0002
#define SCTP_EXTRCV 0x0003
+#define SCTP_SNDINFO 0x0004
+#define SCTP_RCVINFO 0x0005
+#define SCTP_NXTINFO 0x0006
+#define SCTP_PRINFO 0x0007
+#define SCTP_AUTHINFO 0x0008
+#define SCTP_DSTADDRV4 0x0009
+#define SCTP_DSTADDRV6 0x000a
+
/*
* ancillary data structures
*/
@@ -93,8 +111,8 @@ struct sctp_initmsg {
*/
-#define SCTP_ALIGN_RESV_PAD 96
-#define SCTP_ALIGN_RESV_PAD_SHORT 80
+#define SCTP_ALIGN_RESV_PAD 92
+#define SCTP_ALIGN_RESV_PAD_SHORT 76
struct sctp_sndrcvinfo {
uint16_t sinfo_stream;
@@ -106,6 +124,8 @@ struct sctp_sndrcvinfo {
uint32_t sinfo_tsn;
uint32_t sinfo_cumtsn;
sctp_assoc_t sinfo_assoc_id;
+ uint16_t sinfo_keynumber;
+ uint16_t sinfo_keynumber_valid;
uint8_t __reserve_pad[SCTP_ALIGN_RESV_PAD];
};
@@ -113,7 +133,6 @@ struct sctp_extrcvinfo {
uint16_t sinfo_stream;
uint16_t sinfo_ssn;
uint16_t sinfo_flags;
- uint16_t sinfo_pr_policy;
uint32_t sinfo_ppid;
uint32_t sinfo_context;
uint32_t sinfo_timetolive;
@@ -125,15 +144,86 @@ struct sctp_extrcvinfo {
uint32_t sreinfo_next_aid;
uint32_t sreinfo_next_length;
uint32_t sreinfo_next_ppid;
+ uint16_t sinfo_keynumber;
+ uint16_t sinfo_keynumber_valid;
uint8_t __reserve_pad[SCTP_ALIGN_RESV_PAD_SHORT];
};
+struct sctp_sndinfo {
+ uint16_t snd_sid;
+ uint16_t snd_flags;
+ uint32_t snd_ppid;
+ uint32_t snd_context;
+ sctp_assoc_t snd_assoc_id;
+};
+
+struct sctp_prinfo {
+ uint16_t pr_policy;
+ uint32_t pr_value;
+};
+
+struct sctp_default_prinfo {
+ uint16_t pr_policy;
+ uint32_t pr_value;
+ sctp_assoc_t pr_assoc_id;
+};
+
+struct sctp_authinfo {
+ uint16_t auth_keyid;
+};
+
+struct sctp_rcvinfo {
+ uint16_t rcv_sid;
+ uint16_t rcv_ssn;
+ uint16_t rcv_flags;
+ uint32_t rcv_ppid;
+ uint32_t rcv_tsn;
+ uint32_t rcv_cumtsn;
+ uint32_t rcv_context;
+ sctp_assoc_t rcv_assoc_id;
+};
+
+struct sctp_nxtinfo {
+ uint16_t nxt_sid;
+ uint16_t nxt_flags;
+ uint32_t nxt_ppid;
+ uint32_t nxt_length;
+ sctp_assoc_t nxt_assoc_id;
+};
+
#define SCTP_NO_NEXT_MSG 0x0000
#define SCTP_NEXT_MSG_AVAIL 0x0001
#define SCTP_NEXT_MSG_ISCOMPLETE 0x0002
#define SCTP_NEXT_MSG_IS_UNORDERED 0x0004
#define SCTP_NEXT_MSG_IS_NOTIFICATION 0x0008
+struct sctp_recvv_rn {
+ struct sctp_rcvinfo recvv_rcvinfo;
+ struct sctp_nxtinfo recvv_nxtinfo;
+};
+
+#define SCTP_RECVV_NOINFO 0
+#define SCTP_RECVV_RCVINFO 1
+#define SCTP_RECVV_NXTINFO 2
+#define SCTP_RECVV_RN 3
+
+#define SCTP_SENDV_NOINFO 0
+#define SCTP_SENDV_SNDINFO 1
+#define SCTP_SENDV_PRINFO 2
+#define SCTP_SENDV_AUTHINFO 3
+#define SCTP_SENDV_SPA 4
+
+struct sctp_sendv_spa {
+ uint32_t sendv_flags;
+ struct sctp_sndinfo sendv_sndinfo;
+ struct sctp_prinfo sendv_prinfo;
+ struct sctp_authinfo sendv_authinfo;
+};
+
+#define SCTP_SEND_SNDINFO_VALID 0x00000001
+#define SCTP_SEND_PRINFO_VALID 0x00000002
+#define SCTP_SEND_AUTHINFO_VALID 0x00000004
+
struct sctp_snd_all_completes {
uint16_t sall_stream;
uint16_t sall_flags;
@@ -144,6 +234,8 @@ struct sctp_snd_all_completes {
};
/* Flags that go into the sinfo->sinfo_flags field */
+#define SCTP_NOTIFICATION 0x0010 /* next message is a notification */
+#define SCTP_COMPLETE 0x0020 /* next message is complete */
#define SCTP_EOF 0x0100 /* Start shutdown procedures */
#define SCTP_ABORT 0x0200 /* Send an ABORT to peer */
#define SCTP_UNORDERED 0x0400 /* Message is un-ordered */
@@ -152,7 +244,7 @@ struct sctp_snd_all_completes {
#define SCTP_EOR 0x2000 /* end of message signal */
#define SCTP_SACK_IMMEDIATELY 0x4000 /* Set I-Bit */
-#define INVALID_SINFO_FLAG(x) (((x) & 0xffffff00 \
+#define INVALID_SINFO_FLAG(x) (((x) & 0xfffffff0 \
& ~(SCTP_EOF | SCTP_ABORT | SCTP_UNORDERED |\
SCTP_ADDR_OVER | SCTP_SENDALL | SCTP_EOR |\
SCTP_SACK_IMMEDIATELY)) != 0)
@@ -163,7 +255,7 @@ struct sctp_snd_all_completes {
#define SCTP_PR_SCTP_BUF 0x0002/* Buffer based PR-SCTP */
#define SCTP_PR_SCTP_RTX 0x0003/* Number of retransmissions based PR-SCTP */
-#define PR_SCTP_POLICY(x) ((x) & 0xff)
+#define PR_SCTP_POLICY(x) ((x) & 0x0f)
#define PR_SCTP_ENABLED(x) (PR_SCTP_POLICY(x) != 0)
#define PR_SCTP_TTL_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL)
#define PR_SCTP_BUF_ENABLED(x) (PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF)
@@ -1132,26 +1224,34 @@ int sctp_getladdrs __P((int, sctp_assoc_t, struct sockaddr **));
void sctp_freeladdrs __P((struct sockaddr *));
int sctp_opt_info __P((int, sctp_assoc_t, int, void *, socklen_t *));
+/* deprecated */
ssize_t sctp_sendmsg
-__P((int, const void *, size_t,
- const struct sockaddr *,
+__P((int, const void *, size_t, const struct sockaddr *,
socklen_t, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t));
- ssize_t sctp_send __P((int sd, const void *msg, size_t len,
- const struct sctp_sndrcvinfo *sinfo, int flags));
+/* deprecated */
+ ssize_t sctp_send __P((int, const void *, size_t,
+ const struct sctp_sndrcvinfo *, int));
+
+/* deprecated */
+ ssize_t sctp_sendx __P((int, const void *, size_t, struct sockaddr *,
+ int, struct sctp_sndrcvinfo *, int));
+
+/* deprecated */
+ ssize_t sctp_sendmsgx __P((int sd, const void *, size_t, struct sockaddr *,
+ int, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t));
- ssize_t sctp_sendx __P((int sd, const void *msg, size_t len,
- struct sockaddr *addrs, int addrcnt,
- struct sctp_sndrcvinfo *sinfo, int flags));
+ sctp_assoc_t sctp_getassocid __P((int, struct sockaddr *));
- ssize_t sctp_sendmsgx __P((int sd, const void *, size_t,
- struct sockaddr *, int,
- uint32_t, uint32_t, uint16_t, uint32_t, uint32_t));
+/* deprecated */
+ ssize_t sctp_recvmsg __P((int, void *, size_t, struct sockaddr *, socklen_t *,
+ struct sctp_sndrcvinfo *, int *));
- sctp_assoc_t sctp_getassocid __P((int sd, struct sockaddr *sa));
+ ssize_t sctp_sendv __P((int, const struct iovec *, int, struct sockaddr *,
+ int, void *, socklen_t, unsigned int, int));
- ssize_t sctp_recvmsg __P((int, void *, size_t, struct sockaddr *,
- socklen_t *, struct sctp_sndrcvinfo *, int *));
+ ssize_t sctp_recvv __P((int, const struct iovec *, int, struct sockaddr *,
+ socklen_t *, void *, socklen_t *, unsigned int *, int *));
__END_DECLS
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index b3eb805..4c1d726 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -713,7 +713,7 @@ sctp_sendm(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
control = NULL;
}
error = EDESTADDRREQ;
- return EDESTADDRREQ;
+ return (error);
}
#endif /* INET6 */
connected_type:
@@ -1448,7 +1448,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval,
struct sctp_tcb *stcb = NULL;
struct sockaddr *sa;
int num_v6 = 0, num_v4 = 0, *totaddrp, totaddr;
- int added = 0;
uint32_t vrf_id;
int bad_addresses = 0;
sctp_assoc_t *a_id;
@@ -1560,7 +1559,7 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb *inp, void *optval,
}
error = 0;
- added = sctp_connectx_helper_add(stcb, sa, (totaddr - 1), &error);
+ sctp_connectx_helper_add(stcb, sa, (totaddr - 1), &error);
/* Fill in the return id */
if (error) {
(void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6);
@@ -1603,7 +1602,7 @@ out_now:
SCTP_TCB_LOCK(stcb); \
} \
SCTP_INP_RUNLOCK(inp); \
- } else if (assoc_id != 0) { \
+ } else if (assoc_id > SCTP_ALL_ASSOC) { \
stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); \
if (stcb == NULL) { \
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT); \
@@ -1691,10 +1690,6 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize,
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
error = ENOPROTOOPT;
} /* end switch (sopt->sopt_name) */
- if (optname != SCTP_AUTOCLOSE) {
- /* make it an "on/off" value */
- val = (val != 0);
- }
if (*optsize < sizeof(val)) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
@@ -1734,8 +1729,8 @@ flags_out:
SCTP_CHECK_AND_CAST(value, optval, uint32_t, *optsize);
*value = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE);
*optsize = sizeof(uint32_t);
+ break;
}
- break;
case SCTP_PARTIAL_DELIVERY_POINT:
{
uint32_t *value;
@@ -1743,8 +1738,8 @@ flags_out:
SCTP_CHECK_AND_CAST(value, optval, uint32_t, *optsize);
*value = inp->partial_delivery_point;
*optsize = sizeof(uint32_t);
+ break;
}
- break;
case SCTP_FRAGMENT_INTERLEAVE:
{
uint32_t *value;
@@ -1760,8 +1755,8 @@ flags_out:
*value = SCTP_FRAG_LEVEL_0;
}
*optsize = sizeof(uint32_t);
+ break;
}
- break;
case SCTP_CMT_ON_OFF:
{
struct sctp_assoc_value *av;
@@ -1772,14 +1767,20 @@ flags_out:
av->assoc_value = stcb->asoc.sctp_cmt_on_off;
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_RLOCK(inp);
- av->assoc_value = inp->sctp_cmt_on_off;
- SCTP_INP_RUNLOCK(inp);
+ if (av->assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ av->assoc_value = inp->sctp_cmt_on_off;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
}
- *optsize = sizeof(*av);
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_assoc_value);
+ }
+ break;
}
- break;
- /* JRS - Get socket option for pluggable congestion control */
case SCTP_PLUGGABLE_CC:
{
struct sctp_assoc_value *av;
@@ -1790,11 +1791,20 @@ flags_out:
av->assoc_value = stcb->asoc.congestion_control_module;
SCTP_TCB_UNLOCK(stcb);
} else {
- av->assoc_value = inp->sctp_ep.sctp_default_cc_module;
+ if (av->assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ av->assoc_value = inp->sctp_ep.sctp_default_cc_module;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
}
- *optsize = sizeof(*av);
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_assoc_value);
+ }
+ break;
}
- break;
case SCTP_CC_OPTION:
{
struct sctp_cc_option *cc_opt;
@@ -1807,15 +1817,13 @@ flags_out:
if (stcb->asoc.cc_functions.sctp_cwnd_socket_option == NULL) {
error = ENOTSUP;
} else {
- error = (*stcb->asoc.cc_functions.sctp_cwnd_socket_option) (stcb, 0,
- cc_opt);
- *optsize = sizeof(*cc_opt);
+ error = (*stcb->asoc.cc_functions.sctp_cwnd_socket_option) (stcb, 0, cc_opt);
+ *optsize = sizeof(struct sctp_cc_option);
}
SCTP_TCB_UNLOCK(stcb);
}
+ break;
}
- break;
- /* RS - Get socket option for pluggable stream scheduling */
case SCTP_PLUGGABLE_SS:
{
struct sctp_assoc_value *av;
@@ -1826,11 +1834,20 @@ flags_out:
av->assoc_value = stcb->asoc.stream_scheduling_module;
SCTP_TCB_UNLOCK(stcb);
} else {
- av->assoc_value = inp->sctp_ep.sctp_default_ss_module;
+ if (av->assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ av->assoc_value = inp->sctp_ep.sctp_default_ss_module;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ }
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_assoc_value);
}
- *optsize = sizeof(*av);
+ break;
}
- break;
case SCTP_SS_VALUE:
{
struct sctp_stream_value *av;
@@ -1843,7 +1860,7 @@ flags_out:
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
} else {
- *optsize = sizeof(*av);
+ *optsize = sizeof(struct sctp_stream_value);
}
SCTP_TCB_UNLOCK(stcb);
} else {
@@ -1854,8 +1871,8 @@ flags_out:
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
+ break;
}
- break;
case SCTP_GET_ADDR_LEN:
{
struct sctp_assoc_value *av;
@@ -1876,10 +1893,11 @@ flags_out:
#endif
if (error) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ } else {
+ *optsize = sizeof(struct sctp_assoc_value);
}
- *optsize = sizeof(*av);
+ break;
}
- break;
case SCTP_GET_ASSOC_NUMBER:
{
uint32_t *value, cnt;
@@ -1893,9 +1911,8 @@ flags_out:
SCTP_INP_RUNLOCK(inp);
*value = cnt;
*optsize = sizeof(uint32_t);
+ break;
}
- break;
-
case SCTP_GET_ASSOC_ID_LIST:
{
struct sctp_assoc_ids *ids;
@@ -1915,10 +1932,12 @@ flags_out:
}
}
SCTP_INP_RUNLOCK(inp);
- ids->gaids_number_of_ids = at;
- *optsize = ((at * sizeof(sctp_assoc_t)) + sizeof(uint32_t));
+ if (error == 0) {
+ ids->gaids_number_of_ids = at;
+ *optsize = ((at * sizeof(sctp_assoc_t)) + sizeof(uint32_t));
+ }
+ break;
}
- break;
case SCTP_CONTEXT:
{
struct sctp_assoc_value *av;
@@ -1930,19 +1949,27 @@ flags_out:
av->assoc_value = stcb->asoc.context;
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_RLOCK(inp);
- av->assoc_value = inp->sctp_context;
- SCTP_INP_RUNLOCK(inp);
+ if (av->assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ av->assoc_value = inp->sctp_context;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
}
- *optsize = sizeof(*av);
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_assoc_value);
+ }
+ break;
}
- break;
case SCTP_VRF_ID:
{
uint32_t *default_vrfid;
SCTP_CHECK_AND_CAST(default_vrfid, optval, uint32_t, *optsize);
*default_vrfid = inp->def_vrf_id;
+ *optsize = sizeof(uint32_t);
break;
}
case SCTP_GET_ASOC_VRF:
@@ -1954,9 +1981,10 @@ flags_out:
if (stcb == NULL) {
error = EINVAL;
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
- break;
+ } else {
+ id->assoc_value = stcb->asoc.vrf_id;
+ *optsize = sizeof(struct sctp_assoc_value);
}
- id->assoc_value = stcb->asoc.vrf_id;
break;
}
case SCTP_GET_VRF_IDS:
@@ -1976,13 +2004,13 @@ flags_out:
gnv->gn_peers_tag = stcb->asoc.peer_vtag;
gnv->gn_local_tag = stcb->asoc.my_vtag;
SCTP_TCB_UNLOCK(stcb);
+ *optsize = sizeof(struct sctp_get_nonce_values);
} else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
error = ENOTCONN;
}
- *optsize = sizeof(*gnv);
+ break;
}
- break;
case SCTP_DELAYED_SACK:
{
struct sctp_sack_info *sack;
@@ -1994,15 +2022,21 @@ flags_out:
sack->sack_freq = stcb->asoc.sack_freq;
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_RLOCK(inp);
- sack->sack_delay = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]);
- sack->sack_freq = inp->sctp_ep.sctp_sack_freq;
- SCTP_INP_RUNLOCK(inp);
+ if (sack->sack_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ sack->sack_delay = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV]);
+ sack->sack_freq = inp->sctp_ep.sctp_sack_freq;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
}
- *optsize = sizeof(*sack);
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_sack_info);
+ }
+ break;
}
- break;
-
case SCTP_GET_SNDBUF_USE:
{
struct sctp_sockstat *ss;
@@ -2015,13 +2049,13 @@ flags_out:
ss->ss_total_recv_buf = (stcb->asoc.size_on_reasm_queue +
stcb->asoc.size_on_all_streams);
SCTP_TCB_UNLOCK(stcb);
+ *optsize = sizeof(struct sctp_sockstat);
} else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
error = ENOTCONN;
}
- *optsize = sizeof(struct sctp_sockstat);
+ break;
}
- break;
case SCTP_MAX_BURST:
{
struct sctp_assoc_value *av;
@@ -2033,14 +2067,20 @@ flags_out:
av->assoc_value = stcb->asoc.max_burst;
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_RLOCK(inp);
- av->assoc_value = inp->sctp_ep.max_burst;
- SCTP_INP_RUNLOCK(inp);
+ if (av->assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ av->assoc_value = inp->sctp_ep.max_burst;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
}
- *optsize = sizeof(struct sctp_assoc_value);
-
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_assoc_value);
+ }
+ break;
}
- break;
case SCTP_MAXSEG:
{
struct sctp_assoc_value *av;
@@ -2053,21 +2093,28 @@ flags_out:
av->assoc_value = sctp_get_frag_point(stcb, &stcb->asoc);
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_RLOCK(inp);
- if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
- ovh = SCTP_MED_OVERHEAD;
+ if (av->assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
+ ovh = SCTP_MED_OVERHEAD;
+ } else {
+ ovh = SCTP_MED_V4_OVERHEAD;
+ }
+ if (inp->sctp_frag_point >= SCTP_DEFAULT_MAXSEGMENT)
+ av->assoc_value = 0;
+ else
+ av->assoc_value = inp->sctp_frag_point - ovh;
+ SCTP_INP_RUNLOCK(inp);
} else {
- ovh = SCTP_MED_V4_OVERHEAD;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
}
- if (inp->sctp_frag_point >= SCTP_DEFAULT_MAXSEGMENT)
- av->assoc_value = 0;
- else
- av->assoc_value = inp->sctp_frag_point - ovh;
- SCTP_INP_RUNLOCK(inp);
}
- *optsize = sizeof(struct sctp_assoc_value);
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_assoc_value);
+ }
+ break;
}
- break;
case SCTP_GET_STAT_LOG:
error = sctp_fill_stat_log(optval, optsize);
break;
@@ -2076,7 +2123,7 @@ flags_out:
struct sctp_event_subscribe *events;
SCTP_CHECK_AND_CAST(events, optval, struct sctp_event_subscribe, *optsize);
- memset(events, 0, sizeof(*events));
+ memset(events, 0, sizeof(struct sctp_event_subscribe));
SCTP_INP_RLOCK(inp);
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT))
events->sctp_data_io_event = 1;
@@ -2112,9 +2159,8 @@ flags_out:
events->sctp_stream_reset_event = 1;
SCTP_INP_RUNLOCK(inp);
*optsize = sizeof(struct sctp_event_subscribe);
+ break;
}
- break;
-
case SCTP_ADAPTATION_LAYER:
{
uint32_t *value;
@@ -2125,8 +2171,8 @@ flags_out:
*value = inp->sctp_ep.adaptation_layer_indicator;
SCTP_INP_RUNLOCK(inp);
*optsize = sizeof(uint32_t);
+ break;
}
- break;
case SCTP_SET_INITIAL_DBG_SEQ:
{
uint32_t *value;
@@ -2136,8 +2182,8 @@ flags_out:
*value = inp->sctp_ep.initial_sequence_debug;
SCTP_INP_RUNLOCK(inp);
*optsize = sizeof(uint32_t);
+ break;
}
- break;
case SCTP_GET_LOCAL_ADDR_SIZE:
{
uint32_t *value;
@@ -2147,8 +2193,8 @@ flags_out:
*value = sctp_count_max_addresses(inp);
SCTP_INP_RUNLOCK(inp);
*optsize = sizeof(uint32_t);
+ break;
}
- break;
case SCTP_GET_REMOTE_ADDR_SIZE:
{
uint32_t *value;
@@ -2184,13 +2230,13 @@ flags_out:
}
SCTP_TCB_UNLOCK(stcb);
*value = (uint32_t) size;
+ *optsize = sizeof(uint32_t);
} else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTCONN);
error = ENOTCONN;
}
- *optsize = sizeof(uint32_t);
+ break;
}
- break;
case SCTP_GET_PEER_ADDRESSES:
/*
* Get the address information, an array is passed in to
@@ -2260,8 +2306,8 @@ flags_out:
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
error = ENOENT;
}
+ break;
}
- break;
case SCTP_GET_LOCAL_ADDRESSES:
{
size_t limit, actual;
@@ -2278,8 +2324,8 @@ flags_out:
SCTP_TCB_UNLOCK(stcb);
}
*optsize = sizeof(struct sockaddr_storage) + actual;
+ break;
}
- break;
case SCTP_PEER_ADDR_PARAMS:
{
struct sctp_paddrparams *paddrp;
@@ -2416,38 +2462,45 @@ flags_out:
paddrp->spp_assoc_id = sctp_get_associd(stcb);
SCTP_TCB_UNLOCK(stcb);
} else {
- /* Use endpoint defaults */
- SCTP_INP_RLOCK(inp);
- paddrp->spp_pathmaxrxt = inp->sctp_ep.def_net_failure;
- paddrp->spp_hbinterval = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]);
- paddrp->spp_assoc_id = (sctp_assoc_t) 0;
- /* get inp's default */
+ if (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC) {
+ /* Use endpoint defaults */
+ SCTP_INP_RLOCK(inp);
+ paddrp->spp_pathmaxrxt = inp->sctp_ep.def_net_failure;
+ paddrp->spp_hbinterval = TICKS_TO_MSEC(inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT]);
+ paddrp->spp_assoc_id = SCTP_FUTURE_ASSOC;
+ /* get inp's default */
#ifdef INET
- paddrp->spp_ipv4_tos = inp->ip_inp.inp.inp_ip_tos;
- paddrp->spp_flags |= SPP_IPV4_TOS;
+ paddrp->spp_ipv4_tos = inp->ip_inp.inp.inp_ip_tos;
+ paddrp->spp_flags |= SPP_IPV4_TOS;
#endif
#ifdef INET6
- if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
- paddrp->spp_ipv6_flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo;
- paddrp->spp_flags |= SPP_IPV6_FLOWLABEL;
- }
+ if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
+ paddrp->spp_ipv6_flowlabel = ((struct in6pcb *)inp)->in6p_flowinfo;
+ paddrp->spp_flags |= SPP_IPV6_FLOWLABEL;
+ }
#endif
- /* can't return this */
- paddrp->spp_pathmtu = 0;
+ /* can't return this */
+ paddrp->spp_pathmtu = 0;
- /* default behavior, no stcb */
- paddrp->spp_flags = SPP_PMTUD_ENABLE;
+ /* default behavior, no stcb */
+ paddrp->spp_flags = SPP_PMTUD_ENABLE;
- if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) {
- paddrp->spp_flags |= SPP_HB_ENABLE;
+ if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT)) {
+ paddrp->spp_flags |= SPP_HB_ENABLE;
+ } else {
+ paddrp->spp_flags |= SPP_HB_DISABLE;
+ }
+ SCTP_INP_RUNLOCK(inp);
} else {
- paddrp->spp_flags |= SPP_HB_DISABLE;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
}
- SCTP_INP_RUNLOCK(inp);
}
- *optsize = sizeof(struct sctp_paddrparams);
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_paddrparams);
+ }
+ break;
}
- break;
case SCTP_GET_PEER_ADDR_INFO:
{
struct sctp_paddrinfo *paddri;
@@ -2491,6 +2544,7 @@ flags_out:
paddri->spinfo_assoc_id = sctp_get_associd(stcb);
paddri->spinfo_mtu = net->mtu;
SCTP_TCB_UNLOCK(stcb);
+ *optsize = sizeof(struct sctp_paddrinfo);
} else {
if (stcb) {
SCTP_TCB_UNLOCK(stcb);
@@ -2498,9 +2552,8 @@ flags_out:
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
error = ENOENT;
}
- *optsize = sizeof(struct sctp_paddrinfo);
+ break;
}
- break;
case SCTP_PCB_STATUS:
{
struct sctp_pcbinfo *spcb;
@@ -2508,9 +2561,8 @@ flags_out:
SCTP_CHECK_AND_CAST(spcb, optval, struct sctp_pcbinfo, *optsize);
sctp_fill_pcbinfo(spcb);
*optsize = sizeof(struct sctp_pcbinfo);
+ break;
}
- break;
-
case SCTP_STATUS:
{
struct sctp_nets *net;
@@ -2520,7 +2572,7 @@ flags_out:
SCTP_FIND_STCB(inp, stcb, sstat->sstat_assoc_id);
if (stcb == NULL) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
break;
}
@@ -2569,9 +2621,9 @@ flags_out:
sstat->sstat_primary.spinfo_mtu = net->mtu;
sstat->sstat_primary.spinfo_assoc_id = sctp_get_associd(stcb);
SCTP_TCB_UNLOCK(stcb);
- *optsize = sizeof(*sstat);
+ *optsize = sizeof(struct sctp_status);
+ break;
}
- break;
case SCTP_RTOINFO:
{
struct sctp_rtoinfo *srto;
@@ -2585,15 +2637,22 @@ flags_out:
srto->srto_min = stcb->asoc.minrto;
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_RLOCK(inp);
- srto->srto_initial = inp->sctp_ep.initial_rto;
- srto->srto_max = inp->sctp_ep.sctp_maxrto;
- srto->srto_min = inp->sctp_ep.sctp_minrto;
- SCTP_INP_RUNLOCK(inp);
+ if (srto->srto_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ srto->srto_initial = inp->sctp_ep.initial_rto;
+ srto->srto_max = inp->sctp_ep.sctp_maxrto;
+ srto->srto_min = inp->sctp_ep.sctp_minrto;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ }
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_rtoinfo);
}
- *optsize = sizeof(*srto);
+ break;
}
- break;
case SCTP_TIMEOUTS:
{
struct sctp_timeouts *stimo;
@@ -2610,23 +2669,21 @@ flags_out:
stimo->stimo_cookie = stcb->asoc.timocookie;
stimo->stimo_shutdownack = stcb->asoc.timoshutdownack;
SCTP_TCB_UNLOCK(stcb);
+ *optsize = sizeof(struct sctp_timeouts);
} else {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
- *optsize = sizeof(*stimo);
+ break;
}
- break;
case SCTP_ASSOCINFO:
{
struct sctp_assocparams *sasoc;
- uint32_t oldval;
SCTP_CHECK_AND_CAST(sasoc, optval, struct sctp_assocparams, *optsize);
SCTP_FIND_STCB(inp, stcb, sasoc->sasoc_assoc_id);
if (stcb) {
- oldval = sasoc->sasoc_cookie_life;
sasoc->sasoc_cookie_life = TICKS_TO_MSEC(stcb->asoc.cookie_life);
sasoc->sasoc_asocmaxrxt = stcb->asoc.max_send_times;
sasoc->sasoc_number_peer_destinations = stcb->asoc.numnets;
@@ -2634,17 +2691,24 @@ flags_out:
sasoc->sasoc_local_rwnd = stcb->asoc.my_rwnd;
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_RLOCK(inp);
- sasoc->sasoc_cookie_life = TICKS_TO_MSEC(inp->sctp_ep.def_cookie_life);
- sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times;
- sasoc->sasoc_number_peer_destinations = 0;
- sasoc->sasoc_peer_rwnd = 0;
- sasoc->sasoc_local_rwnd = sbspace(&inp->sctp_socket->so_rcv);
- SCTP_INP_RUNLOCK(inp);
+ if (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ sasoc->sasoc_cookie_life = TICKS_TO_MSEC(inp->sctp_ep.def_cookie_life);
+ sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times;
+ sasoc->sasoc_number_peer_destinations = 0;
+ sasoc->sasoc_peer_rwnd = 0;
+ sasoc->sasoc_local_rwnd = sbspace(&inp->sctp_socket->so_rcv);
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ }
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_assocparams);
}
- *optsize = sizeof(*sasoc);
+ break;
}
- break;
case SCTP_DEFAULT_SEND_PARAM:
{
struct sctp_sndrcvinfo *s_info;
@@ -2656,13 +2720,20 @@ flags_out:
memcpy(s_info, &stcb->asoc.def_send, sizeof(stcb->asoc.def_send));
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_RLOCK(inp);
- memcpy(s_info, &inp->def_send, sizeof(inp->def_send));
- SCTP_INP_RUNLOCK(inp);
+ if (s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ memcpy(s_info, &inp->def_send, sizeof(inp->def_send));
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
}
- *optsize = sizeof(*s_info);
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_sndrcvinfo);
+ }
+ break;
}
- break;
case SCTP_INITMSG:
{
struct sctp_initmsg *sinit;
@@ -2674,9 +2745,9 @@ flags_out:
sinit->sinit_max_attempts = inp->sctp_ep.max_init_times;
sinit->sinit_max_init_timeo = inp->sctp_ep.initial_init_rto_max;
SCTP_INP_RUNLOCK(inp);
- *optsize = sizeof(*sinit);
+ *optsize = sizeof(struct sctp_initmsg);
+ break;
}
- break;
case SCTP_PRIMARY_ADDR:
/* we allow a "get" operation on this */
{
@@ -2697,14 +2768,13 @@ flags_out:
&stcb->asoc.primary_destination->ro._l_addr,
len);
SCTP_TCB_UNLOCK(stcb);
+ *optsize = sizeof(struct sctp_setprim);
} else {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
- *optsize = sizeof(*ssp);
+ break;
}
- break;
-
case SCTP_HMAC_IDENT:
{
struct sctp_hmacalgo *shmac;
@@ -2726,7 +2796,7 @@ flags_out:
size = sizeof(*shmac) + (hmaclist->num_algo *
sizeof(shmac->shmac_idents[0]));
if ((size_t)(*optsize) < size) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
SCTP_INP_RUNLOCK(inp);
break;
@@ -2752,12 +2822,19 @@ flags_out:
scact->scact_keynumber = stcb->asoc.authinfo.active_keyid;
SCTP_TCB_UNLOCK(stcb);
} else {
- /* get the endpoint active key */
- SCTP_INP_RLOCK(inp);
- scact->scact_keynumber = inp->sctp_ep.default_keyid;
- SCTP_INP_RUNLOCK(inp);
+ if (scact->scact_assoc_id == SCTP_FUTURE_ASSOC) {
+ /* get the endpoint active key */
+ SCTP_INP_RLOCK(inp);
+ scact->scact_keynumber = inp->sctp_ep.default_keyid;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ }
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_authkeyid);
}
- *optsize = sizeof(*scact);
break;
}
case SCTP_LOCAL_AUTH_CHUNKS:
@@ -2780,24 +2857,30 @@ flags_out:
} else {
/* copy in the chunks */
(void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+ *optsize = sizeof(struct sctp_authchunks) + size;
}
SCTP_TCB_UNLOCK(stcb);
} else {
- /* get off the endpoint */
- SCTP_INP_RLOCK(inp);
- chklist = inp->sctp_ep.local_auth_chunks;
- /* is there enough space? */
- size = sctp_auth_get_chklist_size(chklist);
- if (*optsize < (sizeof(struct sctp_authchunks) + size)) {
- error = EINVAL;
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ if (sac->gauth_assoc_id == SCTP_FUTURE_ASSOC) {
+ /* get off the endpoint */
+ SCTP_INP_RLOCK(inp);
+ chklist = inp->sctp_ep.local_auth_chunks;
+ /* is there enough space? */
+ size = sctp_auth_get_chklist_size(chklist);
+ if (*optsize < (sizeof(struct sctp_authchunks) + size)) {
+ error = EINVAL;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error);
+ } else {
+ /* copy in the chunks */
+ (void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+ *optsize = sizeof(struct sctp_authchunks) + size;
+ }
+ SCTP_INP_RUNLOCK(inp);
} else {
- /* copy in the chunks */
- (void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
}
- SCTP_INP_RUNLOCK(inp);
}
- *optsize = sizeof(struct sctp_authchunks) + size;
break;
}
case SCTP_PEER_AUTH_CHUNKS:
@@ -2820,23 +2903,191 @@ flags_out:
} else {
/* copy in the chunks */
(void)sctp_serialize_auth_chunks(chklist, sac->gauth_chunks);
+ *optsize = sizeof(struct sctp_authchunks) + size;
}
SCTP_TCB_UNLOCK(stcb);
} else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT);
error = ENOENT;
}
- *optsize = sizeof(struct sctp_authchunks) + size;
break;
}
+ case SCTP_EVENT:
+ {
+ struct sctp_event *event;
+ uint32_t event_type;
+
+ SCTP_CHECK_AND_CAST(event, optval, struct sctp_event, *optsize);
+ SCTP_FIND_STCB(inp, stcb, event->se_assoc_id);
+
+ switch (event->se_type) {
+ case SCTP_ASSOC_CHANGE:
+ event_type = SCTP_PCB_FLAGS_RECVASSOCEVNT;
+ break;
+ case SCTP_PEER_ADDR_CHANGE:
+ event_type = SCTP_PCB_FLAGS_RECVPADDREVNT;
+ break;
+ case SCTP_REMOTE_ERROR:
+ event_type = SCTP_PCB_FLAGS_RECVPEERERR;
+ break;
+ case SCTP_SEND_FAILED:
+ event_type = SCTP_PCB_FLAGS_RECVSENDFAILEVNT;
+ break;
+ case SCTP_SHUTDOWN_EVENT:
+ event_type = SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT;
+ break;
+ case SCTP_ADAPTATION_INDICATION:
+ event_type = SCTP_PCB_FLAGS_ADAPTATIONEVNT;
+ break;
+ case SCTP_PARTIAL_DELIVERY_EVENT:
+ event_type = SCTP_PCB_FLAGS_PDAPIEVNT;
+ break;
+ case SCTP_AUTHENTICATION_EVENT:
+ event_type = SCTP_PCB_FLAGS_AUTHEVNT;
+ break;
+ case SCTP_STREAM_RESET_EVENT:
+ event_type = SCTP_PCB_FLAGS_STREAM_RESETEVNT;
+ break;
+ case SCTP_SENDER_DRY_EVENT:
+ event_type = SCTP_PCB_FLAGS_DRYEVNT;
+ break;
+ case SCTP_NOTIFICATIONS_STOPPED_EVENT:
+ event_type = 0;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP);
+ error = ENOTSUP;
+ break;
+ default:
+ event_type = 0;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ break;
+ }
+ if (event_type > 0) {
+ if (stcb) {
+ event->se_on = sctp_stcb_is_feature_on(inp, stcb, event_type);
+ SCTP_TCB_UNLOCK(stcb);
+ } else {
+ if (event->se_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ event->se_on = sctp_is_feature_on(inp, event_type);
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ }
+ }
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_event);
+ }
+ break;
+ }
+ case SCTP_RECVRCVINFO:
+ {
+ int onoff;
+
+ if (*optsize < sizeof(int)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ } else {
+ SCTP_INP_RUNLOCK(inp);
+ onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO);
+ SCTP_INP_RUNLOCK(inp);
+ }
+ if (error == 0) {
+ /* return the option value */
+ *(int *)optval = onoff;
+ *optsize = sizeof(int);
+ }
+ break;
+ }
+ case SCTP_RECVNXTINFO:
+ {
+ int onoff;
+
+ if (*optsize < sizeof(int)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ } else {
+ SCTP_INP_RUNLOCK(inp);
+ onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO);
+ SCTP_INP_RUNLOCK(inp);
+ }
+ if (error == 0) {
+ /* return the option value */
+ *(int *)optval = onoff;
+ *optsize = sizeof(int);
+ }
+ break;
+ }
+ case SCTP_DEFAULT_SNDINFO:
+ {
+ struct sctp_sndinfo *info;
+
+ SCTP_CHECK_AND_CAST(info, optval, struct sctp_sndinfo, *optsize);
+ SCTP_FIND_STCB(inp, stcb, info->snd_assoc_id);
+
+ if (stcb) {
+ info->snd_sid = stcb->asoc.def_send.sinfo_stream;
+ info->snd_flags = stcb->asoc.def_send.sinfo_flags;
+ info->snd_flags &= 0xfff0;
+ info->snd_ppid = stcb->asoc.def_send.sinfo_ppid;
+ info->snd_context = stcb->asoc.def_send.sinfo_context;
+ SCTP_TCB_UNLOCK(stcb);
+ } else {
+ if (info->snd_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ info->snd_sid = inp->def_send.sinfo_stream;
+ info->snd_flags = inp->def_send.sinfo_flags;
+ info->snd_flags &= 0xfff0;
+ info->snd_ppid = inp->def_send.sinfo_ppid;
+ info->snd_context = inp->def_send.sinfo_context;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ }
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_sndinfo);
+ }
+ break;
+ }
+ case SCTP_DEFAULT_PRINFO:
+ {
+ struct sctp_default_prinfo *info;
+ SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, *optsize);
+ SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id);
+ if (stcb) {
+ info->pr_policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags);
+ info->pr_value = stcb->asoc.def_send.sinfo_timetolive;
+ SCTP_TCB_UNLOCK(stcb);
+ } else {
+ if (info->pr_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ info->pr_policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags);
+ info->pr_value = inp->def_send.sinfo_timetolive;
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ }
+ if (error == 0) {
+ *optsize = sizeof(struct sctp_default_prinfo);
+ }
+ break;
+ }
default:
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
error = ENOPROTOOPT;
- *optsize = 0;
break;
} /* end switch (sopt->sopt_name) */
+ if (error) {
+ *optsize = 0;
+ }
return (error);
}
@@ -2949,8 +3200,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
sctp_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE);
else
sctp_feature_off(inp, SCTP_PCB_FLAGS_PORTREUSE);
+ break;
}
- break;
case SCTP_PARTIAL_DELIVERY_POINT:
{
uint32_t *value;
@@ -2962,8 +3213,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
break;
}
inp->partial_delivery_point = *value;
+ break;
}
- break;
case SCTP_FRAGMENT_INTERLEAVE:
/* not yet until we re-write sctp_recvmsg() */
{
@@ -2984,83 +3235,95 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
+ break;
}
- break;
case SCTP_CMT_ON_OFF:
if (SCTP_BASE_SYSCTL(sctp_cmt_on_off)) {
struct sctp_assoc_value *av;
SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize);
+ if (av->assoc_value > SCTP_CMT_MAX) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ break;
+ }
SCTP_FIND_STCB(inp, stcb, av->assoc_id);
if (stcb) {
- if (av->assoc_value > SCTP_CMT_MAX) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
- error = EINVAL;
- } else {
- stcb->asoc.sctp_cmt_on_off = av->assoc_value;
- }
+ stcb->asoc.sctp_cmt_on_off = av->assoc_value;
SCTP_TCB_UNLOCK(stcb);
} else {
- if (av->assoc_value > SCTP_CMT_MAX) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
- error = EINVAL;
- } else {
+ if ((av->assoc_id == SCTP_FUTURE_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
SCTP_INP_WLOCK(inp);
inp->sctp_cmt_on_off = av->assoc_value;
SCTP_INP_WUNLOCK(inp);
}
+ if ((av->assoc_id == SCTP_CURRENT_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ stcb->asoc.sctp_cmt_on_off = av->assoc_value;
+ SCTP_TCB_UNLOCK(stcb);
+ SCTP_INP_RUNLOCK(inp);
+ }
+ }
}
} else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
error = ENOPROTOOPT;
}
break;
- /* JRS - Set socket option for pluggable congestion control */
case SCTP_PLUGGABLE_CC:
{
struct sctp_assoc_value *av;
struct sctp_nets *net;
SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize);
+ if ((av->assoc_value != SCTP_CC_RFC2581) &&
+ (av->assoc_value != SCTP_CC_HSTCP) &&
+ (av->assoc_value != SCTP_CC_HTCP) &&
+ (av->assoc_value != SCTP_CC_RTCC)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ break;
+ }
SCTP_FIND_STCB(inp, stcb, av->assoc_id);
if (stcb) {
- switch (av->assoc_value) {
- case SCTP_CC_RFC2581:
- case SCTP_CC_HSTCP:
- case SCTP_CC_HTCP:
- case SCTP_CC_RTCC:
- stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value];
- stcb->asoc.congestion_control_module = av->assoc_value;
- if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) {
- TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
- stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
- }
+ stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value];
+ stcb->asoc.congestion_control_module = av->assoc_value;
+ if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) {
+ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
+ stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
}
- break;
- default:
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
- error = EINVAL;
- break;
}
SCTP_TCB_UNLOCK(stcb);
} else {
- switch (av->assoc_value) {
- case SCTP_CC_RFC2581:
- case SCTP_CC_HSTCP:
- case SCTP_CC_HTCP:
- case SCTP_CC_RTCC:
+ if ((av->assoc_id == SCTP_FUTURE_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
SCTP_INP_WLOCK(inp);
inp->sctp_ep.sctp_default_cc_module = av->assoc_value;
SCTP_INP_WUNLOCK(inp);
- break;
- default:
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
- error = EINVAL;
- break;
+ }
+ if ((av->assoc_id == SCTP_CURRENT_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value];
+ stcb->asoc.congestion_control_module = av->assoc_value;
+ if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) {
+ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
+ stcb->asoc.cc_functions.sctp_set_initial_cc_param(stcb, net);
+ }
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
}
}
+ break;
}
- break;
case SCTP_CC_OPTION:
{
struct sctp_cc_option *cc_opt;
@@ -3068,7 +3331,19 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_CHECK_AND_CAST(cc_opt, optval, struct sctp_cc_option, optsize);
SCTP_FIND_STCB(inp, stcb, cc_opt->aid_value.assoc_id);
if (stcb == NULL) {
- error = EINVAL;
+ if (cc_opt->aid_value.assoc_id == SCTP_CURRENT_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ if (stcb->asoc.cc_functions.sctp_cwnd_socket_option) {
+ (*stcb->asoc.cc_functions.sctp_cwnd_socket_option) (stcb, 1, cc_opt);
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+ } else {
+ error = EINVAL;
+ }
} else {
if (stcb->asoc.cc_functions.sctp_cwnd_socket_option == NULL) {
error = ENOTSUP;
@@ -3078,54 +3353,54 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
SCTP_TCB_UNLOCK(stcb);
}
+ break;
}
- break;
- /* RS - Set socket option for pluggable stream scheduling */
case SCTP_PLUGGABLE_SS:
{
struct sctp_assoc_value *av;
SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize);
+ if ((av->assoc_value != SCTP_SS_DEFAULT) &&
+ (av->assoc_value != SCTP_SS_DEFAULT) &&
+ (av->assoc_value != SCTP_SS_ROUND_ROBIN) &&
+ (av->assoc_value != SCTP_SS_ROUND_ROBIN_PACKET) &&
+ (av->assoc_value != SCTP_SS_PRIORITY) &&
+ (av->assoc_value != SCTP_SS_FAIR_BANDWITH) &&
+ (av->assoc_value != SCTP_SS_FIRST_COME)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ break;
+ }
SCTP_FIND_STCB(inp, stcb, av->assoc_id);
if (stcb) {
- switch (av->assoc_value) {
- case SCTP_SS_DEFAULT:
- case SCTP_SS_ROUND_ROBIN:
- case SCTP_SS_ROUND_ROBIN_PACKET:
- case SCTP_SS_PRIORITY:
- case SCTP_SS_FAIR_BANDWITH:
- case SCTP_SS_FIRST_COME:
- stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 1, 1);
- stcb->asoc.ss_functions = sctp_ss_functions[av->assoc_value];
- stcb->asoc.stream_scheduling_module = av->assoc_value;
- stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1);
- break;
- default:
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
- error = EINVAL;
- break;
- }
+ stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 1, 1);
+ stcb->asoc.ss_functions = sctp_ss_functions[av->assoc_value];
+ stcb->asoc.stream_scheduling_module = av->assoc_value;
+ stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1);
SCTP_TCB_UNLOCK(stcb);
} else {
- switch (av->assoc_value) {
- case SCTP_SS_DEFAULT:
- case SCTP_SS_ROUND_ROBIN:
- case SCTP_SS_ROUND_ROBIN_PACKET:
- case SCTP_SS_PRIORITY:
- case SCTP_SS_FAIR_BANDWITH:
- case SCTP_SS_FIRST_COME:
+ if ((av->assoc_id == SCTP_FUTURE_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
SCTP_INP_WLOCK(inp);
inp->sctp_ep.sctp_default_ss_module = av->assoc_value;
SCTP_INP_WUNLOCK(inp);
- break;
- default:
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
- error = EINVAL;
- break;
+ }
+ if ((av->assoc_id == SCTP_CURRENT_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 1, 1);
+ stcb->asoc.ss_functions = sctp_ss_functions[av->assoc_value];
+ stcb->asoc.stream_scheduling_module = av->assoc_value;
+ stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1);
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
}
}
+ break;
}
- break;
case SCTP_SS_VALUE:
{
struct sctp_stream_value *av;
@@ -3140,15 +3415,29 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
SCTP_TCB_UNLOCK(stcb);
} else {
- /*
- * Can't set stream value without
- * association
- */
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
- error = EINVAL;
+ if (av->assoc_id == SCTP_CURRENT_ASSOC) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ stcb->asoc.ss_functions.sctp_ss_set_value(stcb,
+ &stcb->asoc,
+ &stcb->asoc.strmout[av->stream_id],
+ av->stream_value);
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+
+ } else {
+ /*
+ * Can't set stream value without
+ * association
+ */
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
}
+ break;
}
- break;
case SCTP_CLR_STAT_LOG:
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP);
error = EOPNOTSUPP;
@@ -3164,12 +3453,25 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
stcb->asoc.context = av->assoc_value;
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- inp->sctp_context = av->assoc_value;
- SCTP_INP_WUNLOCK(inp);
+ if ((av->assoc_id == SCTP_FUTURE_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ inp->sctp_context = av->assoc_value;
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((av->assoc_id == SCTP_CURRENT_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ stcb->asoc.context = av->assoc_value;
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+ }
}
+ break;
}
- break;
case SCTP_VRF_ID:
{
uint32_t *default_vrfid;
@@ -3204,12 +3506,12 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
if (sack->sack_delay) {
if (sack->sack_delay > SCTP_MAX_SACK_DELAY)
sack->sack_delay = SCTP_MAX_SACK_DELAY;
+ if (MSEC_TO_TICKS(sack->sack_delay) < 1) {
+ sack->sack_delay = TICKS_TO_MSEC(1);
+ }
}
if (stcb) {
if (sack->sack_delay) {
- if (MSEC_TO_TICKS(sack->sack_delay) < 1) {
- sack->sack_delay = TICKS_TO_MSEC(1);
- }
stcb->asoc.delayed_ack = sack->sack_delay;
}
if (sack->sack_freq) {
@@ -3217,17 +3519,32 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- if (sack->sack_delay) {
- if (MSEC_TO_TICKS(sack->sack_delay) < 1) {
- sack->sack_delay = TICKS_TO_MSEC(1);
+ if ((sack->sack_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (sack->sack_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ if (sack->sack_delay) {
+ inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV] = MSEC_TO_TICKS(sack->sack_delay);
+ }
+ if (sack->sack_freq) {
+ inp->sctp_ep.sctp_sack_freq = sack->sack_freq;
}
- inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_RECV] = MSEC_TO_TICKS(sack->sack_delay);
+ SCTP_INP_WUNLOCK(inp);
}
- if (sack->sack_freq) {
- inp->sctp_ep.sctp_sack_freq = sack->sack_freq;
+ if ((sack->sack_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (sack->sack_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ if (sack->sack_delay) {
+ stcb->asoc.delayed_ack = sack->sack_delay;
+ }
+ if (sack->sack_freq) {
+ stcb->asoc.sack_freq = sack->sack_freq;
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
}
- SCTP_INP_WUNLOCK(inp);
}
break;
}
@@ -3255,10 +3572,9 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_CHECK_AND_CAST(sca, optval, struct sctp_authkey, optsize);
SCTP_FIND_STCB(inp, stcb, sca->sca_assoc_id);
- size = optsize - sizeof(*sca);
+ size = optsize - sizeof(struct sctp_authkey);
if (stcb) {
- /* set it on the assoc */
shared_keys = &stcb->asoc.shared_keys;
/* clear the cached keys for this key id */
sctp_clear_cachedkeys(stcb, sca->sca_keynumber);
@@ -3288,39 +3604,76 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
error = sctp_insert_sharedkey(shared_keys, shared_key);
SCTP_TCB_UNLOCK(stcb);
} else {
- /* set it on the endpoint */
- SCTP_INP_WLOCK(inp);
- shared_keys = &inp->sctp_ep.shared_keys;
- /*
- * clear the cached keys on all assocs for
- * this key id
- */
- sctp_clear_cachedkeys_ep(inp, sca->sca_keynumber);
- /*
- * create the new shared key and
- * insert/replace it
- */
- if (size > 0) {
- key = sctp_set_key(sca->sca_key, (uint32_t) size);
- if (key == NULL) {
+ if ((sca->sca_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (sca->sca_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ shared_keys = &inp->sctp_ep.shared_keys;
+ /*
+ * clear the cached keys on all
+ * assocs for this key id
+ */
+ sctp_clear_cachedkeys_ep(inp, sca->sca_keynumber);
+ /*
+ * create the new shared key and
+ * insert/replace it
+ */
+ if (size > 0) {
+ key = sctp_set_key(sca->sca_key, (uint32_t) size);
+ if (key == NULL) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
+ error = ENOMEM;
+ SCTP_INP_WUNLOCK(inp);
+ break;
+ }
+ }
+ shared_key = sctp_alloc_sharedkey();
+ if (shared_key == NULL) {
+ sctp_free_key(key);
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
error = ENOMEM;
SCTP_INP_WUNLOCK(inp);
break;
}
- }
- shared_key = sctp_alloc_sharedkey();
- if (shared_key == NULL) {
- sctp_free_key(key);
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOMEM);
- error = ENOMEM;
+ shared_key->key = key;
+ shared_key->keyid = sca->sca_keynumber;
+ error = sctp_insert_sharedkey(shared_keys, shared_key);
SCTP_INP_WUNLOCK(inp);
- break;
}
- shared_key->key = key;
- shared_key->keyid = sca->sca_keynumber;
- error = sctp_insert_sharedkey(shared_keys, shared_key);
- SCTP_INP_WUNLOCK(inp);
+ if ((sca->sca_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (sca->sca_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ shared_keys = &stcb->asoc.shared_keys;
+ /*
+ * clear the cached keys for
+ * this key id
+ */
+ sctp_clear_cachedkeys(stcb, sca->sca_keynumber);
+ /*
+ * create the new shared key
+ * and insert/replace it
+ */
+ if (size > 0) {
+ key = sctp_set_key(sca->sca_key, (uint32_t) size);
+ if (key == NULL) {
+ SCTP_TCB_UNLOCK(stcb);
+ continue;
+ }
+ }
+ shared_key = sctp_alloc_sharedkey();
+ if (shared_key == NULL) {
+ sctp_free_key(key);
+ SCTP_TCB_UNLOCK(stcb);
+ continue;
+ }
+ shared_key->key = key;
+ shared_key->keyid = sca->sca_keynumber;
+ error = sctp_insert_sharedkey(shared_keys, shared_key);
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+ }
}
break;
}
@@ -3330,7 +3683,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
sctp_hmaclist_t *hmaclist;
uint16_t hmacid;
uint32_t i;
-
size_t found;
SCTP_CHECK_AND_CAST(shmac, optval, struct sctp_hmacalgo, optsize);
@@ -3381,8 +3733,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
{
struct sctp_authkeyid *scact;
- SCTP_CHECK_AND_CAST(scact, optval, struct sctp_authkeyid,
- optsize);
+ SCTP_CHECK_AND_CAST(scact, optval, struct sctp_authkeyid, optsize);
SCTP_FIND_STCB(inp, stcb, scact->scact_assoc_id);
/* set the active key on the right place */
@@ -3397,16 +3748,25 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
SCTP_TCB_UNLOCK(stcb);
} else {
- /* set the active key on the endpoint */
- SCTP_INP_WLOCK(inp);
- if (sctp_auth_setactivekey_ep(inp,
- scact->scact_keynumber)) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL,
- SCTP_FROM_SCTP_USRREQ,
- EINVAL);
- error = EINVAL;
+ if ((scact->scact_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (scact->scact_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ if (sctp_auth_setactivekey_ep(inp, scact->scact_keynumber)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((scact->scact_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (scact->scact_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ sctp_auth_setactivekey(stcb, scact->scact_keynumber);
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
}
- SCTP_INP_WUNLOCK(inp);
}
break;
}
@@ -3414,30 +3774,36 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
{
struct sctp_authkeyid *scdel;
- SCTP_CHECK_AND_CAST(scdel, optval, struct sctp_authkeyid,
- optsize);
+ SCTP_CHECK_AND_CAST(scdel, optval, struct sctp_authkeyid, optsize);
SCTP_FIND_STCB(inp, stcb, scdel->scact_assoc_id);
/* delete the key from the right place */
if (stcb) {
- if (sctp_delete_sharedkey(stcb,
- scdel->scact_keynumber)) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL,
- SCTP_FROM_SCTP_USRREQ,
- EINVAL);
+ if (sctp_delete_sharedkey(stcb, scdel->scact_keynumber)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- if (sctp_delete_sharedkey_ep(inp,
- scdel->scact_keynumber)) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL,
- SCTP_FROM_SCTP_USRREQ,
- EINVAL);
- error = EINVAL;
+ if ((scdel->scact_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (scdel->scact_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ if (sctp_delete_sharedkey_ep(inp, scdel->scact_keynumber)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((scdel->scact_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (scdel->scact_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ sctp_delete_sharedkey(stcb, scdel->scact_keynumber);
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
}
- SCTP_INP_WUNLOCK(inp);
}
break;
}
@@ -3445,30 +3811,36 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
{
struct sctp_authkeyid *keyid;
- SCTP_CHECK_AND_CAST(keyid, optval, struct sctp_authkeyid,
- optsize);
+ SCTP_CHECK_AND_CAST(keyid, optval, struct sctp_authkeyid, optsize);
SCTP_FIND_STCB(inp, stcb, keyid->scact_assoc_id);
/* deactivate the key from the right place */
if (stcb) {
- if (sctp_deact_sharedkey(stcb,
- keyid->scact_keynumber)) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL,
- SCTP_FROM_SCTP_USRREQ,
- EINVAL);
+ if (sctp_deact_sharedkey(stcb, keyid->scact_keynumber)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- if (sctp_deact_sharedkey_ep(inp,
- keyid->scact_keynumber)) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL,
- SCTP_FROM_SCTP_USRREQ,
- EINVAL);
- error = EINVAL;
+ if ((keyid->scact_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (keyid->scact_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ if (sctp_deact_sharedkey_ep(inp, keyid->scact_keynumber)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((keyid->scact_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (keyid->scact_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ sctp_deact_sharedkey(stcb, keyid->scact_keynumber);
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
}
- SCTP_INP_WUNLOCK(inp);
}
break;
}
@@ -3632,9 +4004,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
SCTP_TCB_UNLOCK(stcb);
+ break;
}
- break;
-
case SCTP_CONNECT_X:
if (optsize < (sizeof(int) + sizeof(struct sockaddr_in))) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
@@ -3643,7 +4014,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
error = sctp_do_connect_x(so, inp, optval, optsize, p, 0);
break;
-
case SCTP_CONNECT_X_DELAYED:
if (optsize < (sizeof(int) + sizeof(struct sockaddr_in))) {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
@@ -3652,7 +4022,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
error = sctp_do_connect_x(so, inp, optval, optsize, p, 1);
break;
-
case SCTP_CONNECT_X_COMPLETE:
{
struct sockaddr *sa;
@@ -3706,8 +4075,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
error = EALREADY;
}
SCTP_TCB_UNLOCK(stcb);
+ break;
}
- break;
case SCTP_MAX_BURST:
{
struct sctp_assoc_value *av;
@@ -3719,12 +4088,25 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
stcb->asoc.max_burst = av->assoc_value;
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- inp->sctp_ep.max_burst = av->assoc_value;
- SCTP_INP_WUNLOCK(inp);
+ if ((av->assoc_id == SCTP_FUTURE_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ inp->sctp_ep.max_burst = av->assoc_value;
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((av->assoc_id == SCTP_CURRENT_ASSOC) ||
+ (av->assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ stcb->asoc.max_burst = av->assoc_value;
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+ }
}
+ break;
}
- break;
case SCTP_MAXSEG:
{
struct sctp_assoc_value *av;
@@ -3746,20 +4128,25 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- /*
- * FIXME MT: I think this is not in tune
- * with the API ID
- */
- if (av->assoc_value) {
- inp->sctp_frag_point = (av->assoc_value + ovh);
+ if (av->assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_WLOCK(inp);
+ /*
+ * FIXME MT: I think this is not in
+ * tune with the API ID
+ */
+ if (av->assoc_value) {
+ inp->sctp_frag_point = (av->assoc_value + ovh);
+ } else {
+ inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT;
+ }
+ SCTP_INP_WUNLOCK(inp);
} else {
- inp->sctp_frag_point = SCTP_DEFAULT_MAXSEGMENT;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
}
- SCTP_INP_WUNLOCK(inp);
}
+ break;
}
- break;
case SCTP_EVENTS:
{
struct sctp_event_subscribe *events;
@@ -3823,22 +4210,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
if (events->sctp_sender_dry_event) {
sctp_feature_on(inp, SCTP_PCB_FLAGS_DRYEVNT);
- if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
- (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
- stcb = LIST_FIRST(&inp->sctp_asoc_list);
- if (stcb) {
- SCTP_TCB_LOCK(stcb);
- }
- if (stcb &&
- TAILQ_EMPTY(&stcb->asoc.send_queue) &&
- TAILQ_EMPTY(&stcb->asoc.sent_queue) &&
- (stcb->asoc.stream_queue_cnt == 0)) {
- sctp_ulp_notify(SCTP_NOTIFY_SENDER_DRY, stcb, 0, NULL, SCTP_SO_LOCKED);
- }
- if (stcb) {
- SCTP_TCB_UNLOCK(stcb);
- }
- }
} else {
sctp_feature_off(inp, SCTP_PCB_FLAGS_DRYEVNT);
}
@@ -3849,9 +4220,84 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
sctp_feature_off(inp, SCTP_PCB_FLAGS_STREAM_RESETEVNT);
}
SCTP_INP_WUNLOCK(inp);
- }
- break;
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ if (events->sctp_association_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT);
+ }
+ if (events->sctp_address_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVPADDREVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVPADDREVNT);
+ }
+ if (events->sctp_send_failure_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT);
+ }
+ if (events->sctp_peer_error_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVPEERERR);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVPEERERR);
+ }
+ if (events->sctp_shutdown_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT);
+ }
+ if (events->sctp_partial_delivery_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_PDAPIEVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_PDAPIEVNT);
+ }
+ if (events->sctp_adaptation_layer_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_ADAPTATIONEVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_ADAPTATIONEVNT);
+ }
+ if (events->sctp_authentication_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_AUTHEVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_AUTHEVNT);
+ }
+ if (events->sctp_sender_dry_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DRYEVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_DRYEVNT);
+ }
+ if (events->sctp_stream_reset_event) {
+ sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT);
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ /*
+ * Send up the sender dry event only for 1-to-1
+ * style sockets.
+ */
+ if (events->sctp_sender_dry_event) {
+ if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
+ (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
+ stcb = LIST_FIRST(&inp->sctp_asoc_list);
+ if (stcb) {
+ SCTP_TCB_LOCK(stcb);
+ if (TAILQ_EMPTY(&stcb->asoc.send_queue) &&
+ TAILQ_EMPTY(&stcb->asoc.sent_queue) &&
+ (stcb->asoc.stream_queue_cnt == 0)) {
+ sctp_ulp_notify(SCTP_NOTIFY_SENDER_DRY, stcb, 0, NULL, SCTP_SO_LOCKED);
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ }
+ }
+ SCTP_INP_RUNLOCK(inp);
+ break;
+ }
case SCTP_ADAPTATION_LAYER:
{
struct sctp_setadaptation *adap_bits;
@@ -3860,8 +4306,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_INP_WLOCK(inp);
inp->sctp_ep.adaptation_layer_indicator = adap_bits->ssb_adaptation_ind;
SCTP_INP_WUNLOCK(inp);
+ break;
}
- break;
#ifdef SCTP_DEBUG
case SCTP_SET_INITIAL_DBG_SEQ:
{
@@ -3871,8 +4317,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_INP_WLOCK(inp);
inp->sctp_ep.initial_sequence_debug = *vvv;
SCTP_INP_WUNLOCK(inp);
+ break;
}
- break;
#endif
case SCTP_DEFAULT_SEND_PARAM:
{
@@ -3882,7 +4328,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_FIND_STCB(inp, stcb, s_info->sinfo_assoc_id);
if (stcb) {
- if (s_info->sinfo_stream <= stcb->asoc.streamoutcnt) {
+ if (s_info->sinfo_stream < stcb->asoc.streamoutcnt) {
memcpy(&stcb->asoc.def_send, s_info, min(optsize, sizeof(stcb->asoc.def_send)));
} else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
@@ -3890,12 +4336,27 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- memcpy(&inp->def_send, s_info, min(optsize, sizeof(inp->def_send)));
- SCTP_INP_WUNLOCK(inp);
+ if ((s_info->sinfo_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (s_info->sinfo_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ memcpy(&inp->def_send, s_info, min(optsize, sizeof(inp->def_send)));
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((s_info->sinfo_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (s_info->sinfo_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ if (s_info->sinfo_stream < stcb->asoc.streamoutcnt) {
+ memcpy(&stcb->asoc.def_send, s_info, min(optsize, sizeof(stcb->asoc.def_send)));
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+ }
}
+ break;
}
- break;
case SCTP_PEER_ADDR_PARAMS:
/* Applys to the specific association */
{
@@ -4116,31 +4577,37 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_TCB_UNLOCK(stcb);
} else {
/************************NO TCB, SET TO default stuff ******************/
- SCTP_INP_WLOCK(inp);
- /*
- * For the TOS/FLOWLABEL stuff you set it
- * with the options on the socket
- */
- if (paddrp->spp_pathmaxrxt) {
- inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt;
- }
- if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO)
- inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = 0;
- else if (paddrp->spp_hbinterval) {
- if (paddrp->spp_hbinterval > SCTP_MAX_HB_INTERVAL)
- paddrp->spp_hbinterval = SCTP_MAX_HB_INTERVAL;
- inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(paddrp->spp_hbinterval);
- }
- if (paddrp->spp_flags & SPP_HB_ENABLE) {
- sctp_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
+ if (paddrp->spp_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_WLOCK(inp);
+ /*
+ * For the TOS/FLOWLABEL stuff you
+ * set it with the options on the
+ * socket
+ */
+ if (paddrp->spp_pathmaxrxt) {
+ inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt;
+ }
+ if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO)
+ inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = 0;
+ else if (paddrp->spp_hbinterval) {
+ if (paddrp->spp_hbinterval > SCTP_MAX_HB_INTERVAL)
+ paddrp->spp_hbinterval = SCTP_MAX_HB_INTERVAL;
+ inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(paddrp->spp_hbinterval);
+ }
+ if (paddrp->spp_flags & SPP_HB_ENABLE) {
+ sctp_feature_off(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
- } else if (paddrp->spp_flags & SPP_HB_DISABLE) {
- sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
+ } else if (paddrp->spp_flags & SPP_HB_DISABLE) {
+ sctp_feature_on(inp, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
+ }
+ SCTP_INP_WUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
}
- SCTP_INP_WUNLOCK(inp);
}
+ break;
}
- break;
case SCTP_RTOINFO:
{
struct sctp_rtoinfo *srto;
@@ -4172,31 +4639,36 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- if (srto->srto_initial)
- new_init = srto->srto_initial;
- else
- new_init = inp->sctp_ep.initial_rto;
- if (srto->srto_max)
- new_max = srto->srto_max;
- else
- new_max = inp->sctp_ep.sctp_maxrto;
- if (srto->srto_min)
- new_min = srto->srto_min;
- else
- new_min = inp->sctp_ep.sctp_minrto;
- if ((new_min <= new_init) && (new_init <= new_max)) {
- inp->sctp_ep.initial_rto = new_init;
- inp->sctp_ep.sctp_maxrto = new_max;
- inp->sctp_ep.sctp_minrto = new_min;
+ if (srto->srto_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_WLOCK(inp);
+ if (srto->srto_initial)
+ new_init = srto->srto_initial;
+ else
+ new_init = inp->sctp_ep.initial_rto;
+ if (srto->srto_max)
+ new_max = srto->srto_max;
+ else
+ new_max = inp->sctp_ep.sctp_maxrto;
+ if (srto->srto_min)
+ new_min = srto->srto_min;
+ else
+ new_min = inp->sctp_ep.sctp_minrto;
+ if ((new_min <= new_init) && (new_init <= new_max)) {
+ inp->sctp_ep.initial_rto = new_init;
+ inp->sctp_ep.sctp_maxrto = new_max;
+ inp->sctp_ep.sctp_minrto = new_min;
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ SCTP_INP_WUNLOCK(inp);
} else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
- SCTP_INP_WUNLOCK(inp);
}
+ break;
}
- break;
case SCTP_ASSOCINFO:
{
struct sctp_assocparams *sasoc;
@@ -4214,27 +4686,26 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
if (stcb) {
if (sasoc->sasoc_asocmaxrxt)
stcb->asoc.max_send_times = sasoc->sasoc_asocmaxrxt;
- sasoc->sasoc_number_peer_destinations = stcb->asoc.numnets;
- sasoc->sasoc_peer_rwnd = 0;
- sasoc->sasoc_local_rwnd = 0;
if (sasoc->sasoc_cookie_life) {
stcb->asoc.cookie_life = MSEC_TO_TICKS(sasoc->sasoc_cookie_life);
}
SCTP_TCB_UNLOCK(stcb);
} else {
- SCTP_INP_WLOCK(inp);
- if (sasoc->sasoc_asocmaxrxt)
- inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt;
- sasoc->sasoc_number_peer_destinations = 0;
- sasoc->sasoc_peer_rwnd = 0;
- sasoc->sasoc_local_rwnd = 0;
- if (sasoc->sasoc_cookie_life) {
- inp->sctp_ep.def_cookie_life = MSEC_TO_TICKS(sasoc->sasoc_cookie_life);
+ if (sasoc->sasoc_assoc_id == SCTP_FUTURE_ASSOC) {
+ SCTP_INP_WLOCK(inp);
+ if (sasoc->sasoc_asocmaxrxt)
+ inp->sctp_ep.max_send_times = sasoc->sasoc_asocmaxrxt;
+ if (sasoc->sasoc_cookie_life) {
+ inp->sctp_ep.def_cookie_life = MSEC_TO_TICKS(sasoc->sasoc_cookie_life);
+ }
+ SCTP_INP_WUNLOCK(inp);
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
}
- SCTP_INP_WUNLOCK(inp);
}
+ break;
}
- break;
case SCTP_INITMSG:
{
struct sctp_initmsg *sinit;
@@ -4253,12 +4724,12 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
if (sinit->sinit_max_init_timeo)
inp->sctp_ep.initial_init_rto_max = sinit->sinit_max_init_timeo;
SCTP_INP_WUNLOCK(inp);
+ break;
}
- break;
case SCTP_PRIMARY_ADDR:
{
struct sctp_setprim *spa;
- struct sctp_nets *net, *lnet;
+ struct sctp_nets *net;
SCTP_CHECK_AND_CAST(spa, optval, struct sctp_setprim, optsize);
SCTP_FIND_STCB(inp, stcb, spa->ssp_assoc_id);
@@ -4287,7 +4758,6 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
if ((net != stcb->asoc.primary_destination) &&
(!(net->dest_state & SCTP_ADDR_UNCONFIRMED))) {
/* Ok we need to set it */
- lnet = stcb->asoc.primary_destination;
if (sctp_set_primary_addr(stcb, (struct sockaddr *)NULL, net) == 0) {
if (net->dest_state & SCTP_ADDR_SWITCH_PRIMARY) {
net->dest_state |= SCTP_ADDR_DOUBLE_SWITCH;
@@ -4302,8 +4772,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
if (stcb) {
SCTP_TCB_UNLOCK(stcb);
}
+ break;
}
- break;
case SCTP_SET_DYNAMIC_PRIMARY:
{
union sctp_sockstore *ss;
@@ -4316,8 +4786,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_CHECK_AND_CAST(ss, optval, union sctp_sockstore, optsize);
/* SUPER USER CHECK? */
error = sctp_dynamic_set_primary(&ss->sa, vrf_id);
+ break;
}
- break;
case SCTP_SET_PEER_PRIMARY_ADDR:
{
struct sctp_setpeerprim *sspp;
@@ -4370,9 +4840,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
error = EINVAL;
}
-
+ break;
}
- break;
case SCTP_BINDX_ADD_ADDR:
{
struct sctp_getaddresses *addrs;
@@ -4418,8 +4887,8 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
sctp_bindx_add_address(so, inp, addrs->addr,
addrs->sget_assoc_id, vrf_id,
&error, p);
+ break;
}
- break;
case SCTP_BINDX_REM_ADDR:
{
struct sctp_getaddresses *addrs;
@@ -4465,8 +4934,232 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
sctp_bindx_delete_address(so, inp, addrs->addr,
addrs->sget_assoc_id, vrf_id,
&error);
+ break;
+ }
+ case SCTP_EVENT:
+ {
+ struct sctp_event *event;
+ uint32_t event_type;
+
+ SCTP_CHECK_AND_CAST(event, optval, struct sctp_event, optsize);
+ SCTP_FIND_STCB(inp, stcb, event->se_assoc_id);
+ switch (event->se_type) {
+ case SCTP_ASSOC_CHANGE:
+ event_type = SCTP_PCB_FLAGS_RECVASSOCEVNT;
+ break;
+ case SCTP_PEER_ADDR_CHANGE:
+ event_type = SCTP_PCB_FLAGS_RECVPADDREVNT;
+ break;
+ case SCTP_REMOTE_ERROR:
+ event_type = SCTP_PCB_FLAGS_RECVPEERERR;
+ break;
+ case SCTP_SEND_FAILED:
+ event_type = SCTP_PCB_FLAGS_RECVSENDFAILEVNT;
+ break;
+ case SCTP_SHUTDOWN_EVENT:
+ event_type = SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT;
+ break;
+ case SCTP_ADAPTATION_INDICATION:
+ event_type = SCTP_PCB_FLAGS_ADAPTATIONEVNT;
+ break;
+ case SCTP_PARTIAL_DELIVERY_EVENT:
+ event_type = SCTP_PCB_FLAGS_PDAPIEVNT;
+ break;
+ case SCTP_AUTHENTICATION_EVENT:
+ event_type = SCTP_PCB_FLAGS_AUTHEVNT;
+ break;
+ case SCTP_STREAM_RESET_EVENT:
+ event_type = SCTP_PCB_FLAGS_STREAM_RESETEVNT;
+ break;
+ case SCTP_SENDER_DRY_EVENT:
+ event_type = SCTP_PCB_FLAGS_DRYEVNT;
+ break;
+ case SCTP_NOTIFICATIONS_STOPPED_EVENT:
+ event_type = 0;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP);
+ error = ENOTSUP;
+ break;
+ default:
+ event_type = 0;
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ break;
+ }
+ if (event_type > 0) {
+ if (stcb) {
+ if (event->se_on) {
+ sctp_stcb_feature_on(inp, stcb, event_type);
+ if (event_type == SCTP_PCB_FLAGS_DRYEVNT) {
+ if (TAILQ_EMPTY(&stcb->asoc.send_queue) &&
+ TAILQ_EMPTY(&stcb->asoc.sent_queue) &&
+ (stcb->asoc.stream_queue_cnt == 0)) {
+ sctp_ulp_notify(SCTP_NOTIFY_SENDER_DRY, stcb, 0, NULL, SCTP_SO_LOCKED);
+ }
+ }
+ } else {
+ sctp_stcb_feature_off(inp, stcb, event_type);
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ } else {
+ /*
+ * We don't want to send up a storm
+ * of events, so return an error for
+ * sender dry events
+ */
+ if ((event_type == SCTP_PCB_FLAGS_DRYEVNT) &&
+ ((event->se_assoc_id == SCTP_ALL_ASSOC) ||
+ (event->se_assoc_id == SCTP_CURRENT_ASSOC))) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOTSUP);
+ error = ENOTSUP;
+ break;
+ }
+ if ((event->se_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (event->se_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ if (event->se_on) {
+ sctp_feature_on(inp, event_type);
+ } else {
+ sctp_feature_off(inp, event_type);
+ }
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((event->se_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (event->se_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ if (event->se_on) {
+ sctp_stcb_feature_on(inp, stcb, event_type);
+ } else {
+ sctp_stcb_feature_off(inp, stcb, event_type);
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+ }
+ }
+ }
+ break;
+ }
+ case SCTP_RECVRCVINFO:
+ {
+ int *onoff;
+
+ SCTP_CHECK_AND_CAST(onoff, optval, int, optsize);
+ SCTP_INP_WLOCK(inp);
+ if (*onoff != 0) {
+ sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO);
+ } else {
+ sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVRCVINFO);
+ }
+ SCTP_INP_WUNLOCK(inp);
+ break;
+ }
+ case SCTP_RECVNXTINFO:
+ {
+ int *onoff;
+
+ SCTP_CHECK_AND_CAST(onoff, optval, int, optsize);
+ SCTP_INP_WLOCK(inp);
+ if (*onoff != 0) {
+ sctp_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO);
+ } else {
+ sctp_feature_off(inp, SCTP_PCB_FLAGS_RECVNXTINFO);
+ }
+ SCTP_INP_WUNLOCK(inp);
+ break;
+ }
+ case SCTP_DEFAULT_SNDINFO:
+ {
+ struct sctp_sndinfo *info;
+ uint16_t policy;
+
+ SCTP_CHECK_AND_CAST(info, optval, struct sctp_sndinfo, optsize);
+ SCTP_FIND_STCB(inp, stcb, info->snd_assoc_id);
+
+ if (stcb) {
+ if (info->snd_sid < stcb->asoc.streamoutcnt) {
+ stcb->asoc.def_send.sinfo_stream = info->snd_sid;
+ policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags);
+ stcb->asoc.def_send.sinfo_flags = info->snd_flags;
+ stcb->asoc.def_send.sinfo_flags |= policy;
+ stcb->asoc.def_send.sinfo_ppid = info->snd_ppid;
+ stcb->asoc.def_send.sinfo_context = info->snd_context;
+ } else {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ } else {
+ if ((info->snd_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (info->snd_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ inp->def_send.sinfo_stream = info->snd_sid;
+ policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags);
+ inp->def_send.sinfo_flags = info->snd_flags;
+ inp->def_send.sinfo_flags |= policy;
+ inp->def_send.sinfo_ppid = info->snd_ppid;
+ inp->def_send.sinfo_context = info->snd_context;
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((info->snd_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (info->snd_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ if (info->snd_sid < stcb->asoc.streamoutcnt) {
+ stcb->asoc.def_send.sinfo_stream = info->snd_sid;
+ policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags);
+ stcb->asoc.def_send.sinfo_flags = info->snd_flags;
+ stcb->asoc.def_send.sinfo_flags |= policy;
+ stcb->asoc.def_send.sinfo_ppid = info->snd_ppid;
+ stcb->asoc.def_send.sinfo_context = info->snd_context;
+ }
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+ }
+ }
+ break;
+ }
+ case SCTP_DEFAULT_PRINFO:
+ {
+ struct sctp_default_prinfo *info;
+
+ SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, optsize);
+ SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id);
+
+ if (PR_SCTP_INVALID_POLICY(info->pr_policy)) {
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ error = EINVAL;
+ break;
+ }
+ if (stcb) {
+ stcb->asoc.def_send.sinfo_flags &= 0xfff0;
+ stcb->asoc.def_send.sinfo_flags |= info->pr_policy;
+ SCTP_TCB_UNLOCK(stcb);
+ } else {
+ if ((info->pr_assoc_id == SCTP_FUTURE_ASSOC) ||
+ (info->pr_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_WLOCK(inp);
+ inp->def_send.sinfo_flags &= 0xfff0;
+ inp->def_send.sinfo_flags |= info->pr_policy;
+ SCTP_INP_WUNLOCK(inp);
+ }
+ if ((info->pr_assoc_id == SCTP_CURRENT_ASSOC) ||
+ (info->pr_assoc_id == SCTP_ALL_ASSOC)) {
+ SCTP_INP_RLOCK(inp);
+ LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) {
+ SCTP_TCB_LOCK(stcb);
+ stcb->asoc.def_send.sinfo_flags &= 0xfff0;
+ stcb->asoc.def_send.sinfo_flags |= info->pr_policy;
+ SCTP_TCB_UNLOCK(stcb);
+ }
+ SCTP_INP_RUNLOCK(inp);
+ }
+ }
+ break;
}
- break;
default:
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT);
error = ENOPROTOOPT;
diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h
index 1e17900..e48dfe4 100644
--- a/sys/netinet/sctp_var.h
+++ b/sys/netinet/sctp_var.h
@@ -50,6 +50,30 @@ extern struct pr_usrreqs sctp_usrreqs;
#define sctp_is_feature_on(inp, feature) ((inp->sctp_features & feature) == feature)
#define sctp_is_feature_off(inp, feature) ((inp->sctp_features & feature) == 0)
+#define sctp_stcb_feature_on(inp, stcb, feature) {\
+ if (stcb) { \
+ stcb->asoc.sctp_features |= feature; \
+ } else { \
+ inp->sctp_features |= feature; \
+ } \
+}
+#define sctp_stcb_feature_off(inp, stcb, feature) {\
+ if (stcb) { \
+ stcb->asoc.sctp_features &= ~feature; \
+ } else { \
+ inp->sctp_features &= ~feature; \
+ } \
+}
+#define sctp_stcb_is_feature_on(inp, stcb, feature) \
+ (((stcb != NULL) && \
+ ((stcb->asoc.sctp_features & feature) == feature)) || \
+ ((stcb == NULL) && \
+ ((inp->sctp_features & feature) == feature)))
+#define sctp_stcb_is_feature_off(inp, stcb, feature) \
+ (((stcb != NULL) && \
+ ((stcb->asoc.sctp_features & feature) == 0)) || \
+ ((stcb == NULL) && \
+ ((inp->sctp_features & feature) == 0)))
/* managing mobility_feature in inpcb (by micchie) */
#define sctp_mobility_feature_on(inp, feature) (inp->sctp_mobility_features |= feature)
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 39df039..9a8bd2e 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -923,6 +923,7 @@ sctp_init_asoc(struct sctp_inpcb *m, struct sctp_tcb *stcb,
asoc->sctp_nr_sack_on_off = (uint8_t) SCTP_BASE_SYSCTL(sctp_nr_sack_on_off);
asoc->sctp_cmt_pf = (uint8_t) SCTP_BASE_SYSCTL(sctp_cmt_pf);
asoc->sctp_frag_point = m->sctp_frag_point;
+ asoc->sctp_features = m->sctp_features;
#ifdef INET
asoc->default_tos = m->ip_inp.inp.inp_ip_tos;
#else
@@ -2760,7 +2761,7 @@ sctp_notify_assoc_change(uint32_t event, struct sctp_tcb *stcb,
}
#endif
}
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_RECVASSOCEVNT)) {
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) {
/* event not enabled */
return;
}
@@ -2831,7 +2832,7 @@ sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state,
struct sctp_paddr_change *spc;
struct sctp_queued_to_read *control;
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_RECVPADDREVNT)) {
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVPADDREVNT)) {
/* event not enabled */
return;
}
@@ -2914,7 +2915,7 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint32_t error,
struct sctp_queued_to_read *control;
int length;
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_RECVSENDFAILEVNT)) {
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT)) {
/* event not enabled */
return;
}
@@ -2997,7 +2998,7 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error,
struct sctp_queued_to_read *control;
int length;
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_RECVSENDFAILEVNT)) {
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSENDFAILEVNT)) {
/* event not enabled */
return;
}
@@ -3067,7 +3068,7 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb,
struct sctp_adaptation_event *sai;
struct sctp_queued_to_read *control;
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_ADAPTATIONEVNT)) {
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ADAPTATIONEVNT)) {
/* event not enabled */
return;
}
@@ -3118,7 +3119,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
struct sctp_queued_to_read *control;
struct sockbuf *sb;
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_PDAPIEVNT)) {
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_PDAPIEVNT)) {
/* event not enabled */
return;
}
@@ -3231,7 +3232,7 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb)
SCTP_SOCKET_UNLOCK(so, 1);
#endif
}
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT)) {
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVSHUTDOWNEVNT)) {
/* event not enabled */
return;
}
@@ -3278,7 +3279,7 @@ sctp_notify_sender_dry_event(struct sctp_tcb *stcb,
struct sctp_sender_dry_event *event;
struct sctp_queued_to_read *control;
- if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_DRYEVNT)) {
+ if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_DRYEVNT)) {
/* event not enabled */
return;
}
@@ -5490,7 +5491,8 @@ found_one:
if ((sinfo) && filling_sinfo) {
memcpy(sinfo, control, sizeof(struct sctp_nonpad_sndrcvinfo));
nxt = TAILQ_NEXT(control, next);
- if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) {
+ if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO) ||
+ sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO)) {
struct sctp_extrcvinfo *s_extra;
s_extra = (struct sctp_extrcvinfo *)sinfo;
@@ -5997,7 +5999,8 @@ out:
if (((out_flags & MSG_EOR) == 0) &&
((in_flags & MSG_PEEK) == 0) &&
(sinfo) &&
- (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO))) {
+ (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO) ||
+ sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO))) {
struct sctp_extrcvinfo *s_extra;
s_extra = (struct sctp_extrcvinfo *)sinfo;
@@ -6147,8 +6150,9 @@ sctp_soreceive(struct socket *so,
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL);
return (EINVAL);
}
- if ((sctp_is_feature_off(inp,
- SCTP_PCB_FLAGS_RECVDATAIOEVNT)) ||
+ if ((sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT) &&
+ sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVRCVINFO) &&
+ sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVNXTINFO)) ||
(controlp == NULL)) {
/* user does not want the sndrcv ctl */
filling_sinfo = 0;
@@ -6184,71 +6188,6 @@ sctp_soreceive(struct socket *so,
}
-int
-sctp_l_soreceive(struct socket *so,
- struct sockaddr **name,
- struct uio *uio,
- char **controlp,
- int *controllen,
- int *flag)
-{
- int error, fromlen;
- uint8_t sockbuf[256];
- struct sockaddr *from;
- struct sctp_extrcvinfo sinfo;
- int filling_sinfo = 1;
- struct sctp_inpcb *inp;
-
- inp = (struct sctp_inpcb *)so->so_pcb;
- /* pickup the assoc we are reading from */
- if (inp == NULL) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL);
- return (EINVAL);
- }
- if ((sctp_is_feature_off(inp,
- SCTP_PCB_FLAGS_RECVDATAIOEVNT)) ||
- (controlp == NULL)) {
- /* user does not want the sndrcv ctl */
- filling_sinfo = 0;
- }
- if (name) {
- from = (struct sockaddr *)sockbuf;
- fromlen = sizeof(sockbuf);
- from->sa_len = 0;
- } else {
- from = NULL;
- fromlen = 0;
- }
-
- error = sctp_sorecvmsg(so, uio,
- (struct mbuf **)NULL,
- from, fromlen, flag,
- (struct sctp_sndrcvinfo *)&sinfo,
- filling_sinfo);
- if ((controlp) && (filling_sinfo)) {
- /*
- * copy back the sinfo in a CMSG format note that the caller
- * has reponsibility for freeing the memory.
- */
- if (filling_sinfo)
- *controlp = sctp_build_ctl_cchunk(inp,
- controllen,
- (struct sctp_sndrcvinfo *)&sinfo);
- }
- if (name) {
- /* copy back the address info */
- if (from && from->sa_len) {
- *name = sodupsockaddr(from, M_WAIT);
- } else {
- *name = NULL;
- }
- }
- return (error);
-}
-
-
-
-
diff --git a/sys/netinet/sctputil.h b/sys/netinet/sctputil.h
index 69983e0..460adc7 100644
--- a/sys/netinet/sctputil.h
+++ b/sys/netinet/sctputil.h
@@ -328,20 +328,6 @@ sctp_soreceive(struct socket *so, struct sockaddr **psa,
struct mbuf **controlp,
int *flagsp);
-
-/* For those not passing mbufs, this does the
- * translations for you. Caller owns memory
- * of size controllen returned in controlp.
- */
-int
-sctp_l_soreceive(struct socket *so,
- struct sockaddr **name,
- struct uio *uio,
- char **controlp,
- int *controllen,
- int *flag);
-
-
void
sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, uint32_t c, uint32_t d);
diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c
index 9d11262..6145a54 100644
--- a/sys/netinet/siftr.c
+++ b/sys/netinet/siftr.c
@@ -696,17 +696,16 @@ siftr_findinpcb(int ipver, struct ip *ip, struct mbuf *m, uint16_t sport,
/* We need the tcbinfo lock. */
INP_INFO_UNLOCK_ASSERT(&V_tcbinfo);
- INP_INFO_RLOCK(&V_tcbinfo);
if (dir == PFIL_IN)
inp = (ipver == INP_IPV4 ?
- in_pcblookup_hash(&V_tcbinfo, ip->ip_src, sport, ip->ip_dst,
- dport, 0, m->m_pkthdr.rcvif)
+ in_pcblookup(&V_tcbinfo, ip->ip_src, sport, ip->ip_dst,
+ dport, INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif)
:
#ifdef SIFTR_IPV6
- in6_pcblookup_hash(&V_tcbinfo,
+ in6_pcblookup(&V_tcbinfo,
&((struct ip6_hdr *)ip)->ip6_src, sport,
- &((struct ip6_hdr *)ip)->ip6_dst, dport, 0,
+ &((struct ip6_hdr *)ip)->ip6_dst, dport, INPLOOKUP_RLOCKPCB,
m->m_pkthdr.rcvif)
#else
NULL
@@ -715,13 +714,13 @@ siftr_findinpcb(int ipver, struct ip *ip, struct mbuf *m, uint16_t sport,
else
inp = (ipver == INP_IPV4 ?
- in_pcblookup_hash(&V_tcbinfo, ip->ip_dst, dport, ip->ip_src,
- sport, 0, m->m_pkthdr.rcvif)
+ in_pcblookup(&V_tcbinfo, ip->ip_dst, dport, ip->ip_src,
+ sport, INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif)
:
#ifdef SIFTR_IPV6
- in6_pcblookup_hash(&V_tcbinfo,
+ in6_pcblookup(&V_tcbinfo,
&((struct ip6_hdr *)ip)->ip6_dst, dport,
- &((struct ip6_hdr *)ip)->ip6_src, sport, 0,
+ &((struct ip6_hdr *)ip)->ip6_src, sport, INPLOOKUP_RLOCKPCB,
m->m_pkthdr.rcvif)
#else
NULL
@@ -734,12 +733,7 @@ siftr_findinpcb(int ipver, struct ip *ip, struct mbuf *m, uint16_t sport,
ss->nskip_in_inpcb++;
else
ss->nskip_out_inpcb++;
- } else {
- /* Acquire the inpcb lock. */
- INP_UNLOCK_ASSERT(inp);
- INP_RLOCK(inp);
}
- INP_INFO_RUNLOCK(&V_tcbinfo);
return (inp);
}
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 1a94d0a..e3e9aa6 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -5,6 +5,7 @@
* Swinburne University of Technology, Melbourne, Australia.
* Copyright (c) 2009-2010 Lawrence Stewart <lstewart@freebsd.org>
* Copyright (c) 2010 The FreeBSD Foundation
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
* All rights reserved.
*
* Portions of this software were developed at the Centre for Advanced Internet
@@ -16,6 +17,9 @@
* Internet Architectures, Swinburne University of Technology, Melbourne,
* Australia by David Hayes under sponsorship from the FreeBSD Foundation.
*
+ * Portions of this software were developed by Robert N. M. Watson under
+ * contract to Juniper Networks, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -197,10 +201,6 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW,
&VNET_NAME(tcp_autorcvbuf_max), 0,
"Max size of automatic receive buffer");
-int tcp_read_locking = 1;
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, read_locking, CTLFLAG_RW,
- &tcp_read_locking, 0, "Enable read locking strategy");
-
VNET_DEFINE(struct inpcbhead, tcb);
#define tcb6 tcb /* for KAME src sync over BSD*'s */
VNET_DEFINE(struct inpcbinfo, tcbinfo);
@@ -591,8 +591,7 @@ tcp_input(struct mbuf *m, int off0)
char *s = NULL; /* address and port logging */
int ti_locked;
#define TI_UNLOCKED 1
-#define TI_RLOCKED 2
-#define TI_WLOCKED 3
+#define TI_WLOCKED 2
#ifdef TCPDEBUG
/*
@@ -756,30 +755,25 @@ tcp_input(struct mbuf *m, int off0)
drop_hdrlen = off0 + off;
/*
- * Locate pcb for segment, which requires a lock on tcbinfo.
- * Optimisticaly acquire a global read lock rather than a write lock
- * unless header flags necessarily imply a state change. There are
- * two cases where we might discover later we need a write lock
- * despite the flags: ACKs moving a connection out of the syncache,
- * and ACKs for a connection in TIMEWAIT.
+ * Locate pcb for segment; if we're likely to add or remove a
+ * connection then first acquire pcbinfo lock. There are two cases
+ * where we might discover later we need a write lock despite the
+ * flags: ACKs moving a connection out of the syncache, and ACKs for
+ * a connection in TIMEWAIT.
*/
- if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 ||
- tcp_read_locking == 0) {
+ if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0) {
INP_INFO_WLOCK(&V_tcbinfo);
ti_locked = TI_WLOCKED;
- } else {
- INP_INFO_RLOCK(&V_tcbinfo);
- ti_locked = TI_RLOCKED;
- }
+ } else
+ ti_locked = TI_UNLOCKED;
findpcb:
#ifdef INVARIANTS
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RLOCK_ASSERT(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED) {
INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
- else
- panic("%s: findpcb ti_locked %d\n", __func__, ti_locked);
+ } else {
+ INP_INFO_UNLOCK_ASSERT(&V_tcbinfo);
+ }
#endif
#ifdef INET
@@ -797,20 +791,20 @@ findpcb:
* Transparently forwarded. Pretend to be the destination.
* already got one like this?
*/
- inp = in_pcblookup_hash(&V_tcbinfo,
- ip->ip_src, th->th_sport,
- ip->ip_dst, th->th_dport,
- 0, m->m_pkthdr.rcvif);
+ inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport,
+ ip->ip_dst, th->th_dport, INPLOOKUP_WLOCKPCB,
+ m->m_pkthdr.rcvif, m);
if (!inp) {
- /* It's new. Try to find the ambushing socket. */
- inp = in_pcblookup_hash(&V_tcbinfo,
- ip->ip_src, th->th_sport,
- next_hop->sin_addr,
- next_hop->sin_port ?
- ntohs(next_hop->sin_port) :
- th->th_dport,
- INPLOOKUP_WILDCARD,
- m->m_pkthdr.rcvif);
+ /*
+ * It's new. Try to find the ambushing socket.
+ * Because we've rewritten the destination address,
+ * any hardware-generated hash is ignored.
+ */
+ inp = in_pcblookup(&V_tcbinfo, ip->ip_src,
+ th->th_sport, next_hop->sin_addr,
+ next_hop->sin_port ? ntohs(next_hop->sin_port) :
+ th->th_dport, INPLOOKUP_WILDCARD |
+ INPLOOKUP_WLOCKPCB, m->m_pkthdr.rcvif);
}
/* Remove the tag from the packet. We don't need it anymore. */
m_tag_delete(m, fwd_tag);
@@ -820,21 +814,19 @@ findpcb:
{
#ifdef INET6
if (isipv6)
- inp = in6_pcblookup_hash(&V_tcbinfo,
- &ip6->ip6_src, th->th_sport,
- &ip6->ip6_dst, th->th_dport,
- INPLOOKUP_WILDCARD,
- m->m_pkthdr.rcvif);
+ inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src,
+ th->th_sport, &ip6->ip6_dst, th->th_dport,
+ INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB,
+ m->m_pkthdr.rcvif, m);
#endif
#if defined(INET) && defined(INET6)
else
#endif
#ifdef INET
- inp = in_pcblookup_hash(&V_tcbinfo,
- ip->ip_src, th->th_sport,
- ip->ip_dst, th->th_dport,
- INPLOOKUP_WILDCARD,
- m->m_pkthdr.rcvif);
+ inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src,
+ th->th_sport, ip->ip_dst, th->th_dport,
+ INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB,
+ m->m_pkthdr.rcvif, m);
#endif
}
@@ -865,7 +857,7 @@ findpcb:
rstreason = BANDLIM_RST_CLOSEDPORT;
goto dropwithreset;
}
- INP_WLOCK(inp);
+ INP_WLOCK_ASSERT(inp);
if (!(inp->inp_flags & INP_HW_FLOWID)
&& (m->m_flags & M_FLOWID)
&& ((inp->inp_socket == NULL)
@@ -906,28 +898,26 @@ findpcb:
* legitimate new connection attempt the old INPCB gets removed and
* we can try again to find a listening socket.
*
- * At this point, due to earlier optimism, we may hold a read lock on
- * the inpcbinfo, rather than a write lock. If so, we need to
- * upgrade, or if that fails, acquire a reference on the inpcb, drop
- * all locks, acquire a global write lock, and then re-acquire the
- * inpcb lock. We may at that point discover that another thread has
- * tried to free the inpcb, in which case we need to loop back and
- * try to find a new inpcb to deliver to.
+ * At this point, due to earlier optimism, we may hold only an inpcb
+ * lock, and not the inpcbinfo write lock. If so, we need to try to
+ * acquire it, or if that fails, acquire a reference on the inpcb,
+ * drop all locks, acquire a global write lock, and then re-acquire
+ * the inpcb lock. We may at that point discover that another thread
+ * has tried to free the inpcb, in which case we need to loop back
+ * and try to find a new inpcb to deliver to.
+ *
+ * XXXRW: It may be time to rethink timewait locking.
*/
relocked:
if (inp->inp_flags & INP_TIMEWAIT) {
- KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED,
- ("%s: INP_TIMEWAIT ti_locked %d", __func__, ti_locked));
-
- if (ti_locked == TI_RLOCKED) {
- if (INP_INFO_TRY_UPGRADE(&V_tcbinfo) == 0) {
+ if (ti_locked == TI_UNLOCKED) {
+ if (INP_INFO_TRY_WLOCK(&V_tcbinfo) == 0) {
in_pcbref(inp);
INP_WUNLOCK(inp);
- INP_INFO_RUNLOCK(&V_tcbinfo);
INP_INFO_WLOCK(&V_tcbinfo);
ti_locked = TI_WLOCKED;
INP_WLOCK(inp);
- if (in_pcbrele(inp)) {
+ if (in_pcbrele_wlocked(inp)) {
inp = NULL;
goto findpcb;
}
@@ -975,26 +965,24 @@ relocked:
/*
* We've identified a valid inpcb, but it could be that we need an
- * inpcbinfo write lock and have only a read lock. In this case,
- * attempt to upgrade/relock using the same strategy as the TIMEWAIT
- * case above. If we relock, we have to jump back to 'relocked' as
- * the connection might now be in TIMEWAIT.
+ * inpcbinfo write lock but don't hold it. In this case, attempt to
+ * acquire using the same strategy as the TIMEWAIT case above. If we
+ * relock, we have to jump back to 'relocked' as the connection might
+ * now be in TIMEWAIT.
*/
- if (tp->t_state != TCPS_ESTABLISHED ||
- (thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 ||
- tcp_read_locking == 0) {
- KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED,
- ("%s: upgrade check ti_locked %d", __func__, ti_locked));
-
- if (ti_locked == TI_RLOCKED) {
- if (INP_INFO_TRY_UPGRADE(&V_tcbinfo) == 0) {
+#ifdef INVARIANTS
+ if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0)
+ INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
+#endif
+ if (tp->t_state != TCPS_ESTABLISHED) {
+ if (ti_locked == TI_UNLOCKED) {
+ if (INP_INFO_TRY_WLOCK(&V_tcbinfo) == 0) {
in_pcbref(inp);
INP_WUNLOCK(inp);
- INP_INFO_RUNLOCK(&V_tcbinfo);
INP_INFO_WLOCK(&V_tcbinfo);
ti_locked = TI_WLOCKED;
INP_WLOCK(inp);
- if (in_pcbrele(inp)) {
+ if (in_pcbrele_wlocked(inp)) {
inp = NULL;
goto findpcb;
}
@@ -1027,13 +1015,16 @@ relocked:
/*
* When the socket is accepting connections (the INPCB is in LISTEN
* state) we look into the SYN cache if this is a new connection
- * attempt or the completion of a previous one.
+ * attempt or the completion of a previous one. Because listen
+ * sockets are never in TCPS_ESTABLISHED, the V_tcbinfo lock will be
+ * held in this case.
*/
if (so->so_options & SO_ACCEPTCONN) {
struct in_conninfo inc;
KASSERT(tp->t_state == TCPS_LISTEN, ("%s: so accepting but "
"tp not listening", __func__));
+ INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
bzero(&inc, sizeof(inc));
#ifdef INET6
@@ -1371,13 +1362,17 @@ relocked:
return;
dropwithreset:
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RUNLOCK(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED) {
INP_INFO_WUNLOCK(&V_tcbinfo);
- else
- panic("%s: dropwithreset ti_locked %d", __func__, ti_locked);
- ti_locked = TI_UNLOCKED;
+ ti_locked = TI_UNLOCKED;
+ }
+#ifdef INVARIANTS
+ else {
+ KASSERT(ti_locked == TI_UNLOCKED, ("%s: dropwithreset "
+ "ti_locked: %d", __func__, ti_locked));
+ INP_INFO_UNLOCK_ASSERT(&V_tcbinfo);
+ }
+#endif
if (inp != NULL) {
tcp_dropwithreset(m, th, tp, tlen, rstreason);
@@ -1388,13 +1383,17 @@ dropwithreset:
goto drop;
dropunlock:
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RUNLOCK(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED) {
INP_INFO_WUNLOCK(&V_tcbinfo);
- else
- panic("%s: dropunlock ti_locked %d", __func__, ti_locked);
- ti_locked = TI_UNLOCKED;
+ ti_locked = TI_UNLOCKED;
+ }
+#ifdef INVARIANTS
+ else {
+ KASSERT(ti_locked == TI_UNLOCKED, ("%s: dropunlock "
+ "ti_locked: %d", __func__, ti_locked));
+ INP_INFO_UNLOCK_ASSERT(&V_tcbinfo);
+ }
+#endif
if (inp != NULL)
INP_WUNLOCK(inp);
@@ -1449,13 +1448,13 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
} else {
#ifdef INVARIANTS
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RLOCK_ASSERT(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED)
INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
- else
- panic("%s: ti_locked %d for EST", __func__,
- ti_locked);
+ else {
+ KASSERT(ti_locked == TI_UNLOCKED, ("%s: EST "
+ "ti_locked: %d", __func__, ti_locked));
+ INP_INFO_UNLOCK_ASSERT(&V_tcbinfo);
+ }
#endif
}
INP_WLOCK_ASSERT(tp->t_inpcb);
@@ -1601,13 +1600,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
/*
* This is a pure ack for outstanding data.
*/
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RUNLOCK(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED)
INP_INFO_WUNLOCK(&V_tcbinfo);
- else
- panic("%s: ti_locked %d on pure ACK",
- __func__, ti_locked);
ti_locked = TI_UNLOCKED;
TCPSTAT_INC(tcps_predack);
@@ -1708,13 +1702,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
* nothing on the reassembly queue and we have enough
* buffer space to take it.
*/
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RUNLOCK(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED)
INP_INFO_WUNLOCK(&V_tcbinfo);
- else
- panic("%s: ti_locked %d on pure data "
- "segment", __func__, ti_locked);
ti_locked = TI_UNLOCKED;
/* Clean receiver SACK report if present */
@@ -2550,9 +2539,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
}
process_ACK:
- INP_INFO_LOCK_ASSERT(&V_tcbinfo);
- KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED,
- ("tcp_input: process_ACK ti_locked %d", ti_locked));
INP_WLOCK_ASSERT(tp->t_inpcb);
acked = BYTES_THIS_ACK(tp, th);
@@ -2716,9 +2702,6 @@ process_ACK:
}
step6:
- INP_INFO_LOCK_ASSERT(&V_tcbinfo);
- KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED,
- ("tcp_do_segment: step6 ti_locked %d", ti_locked));
INP_WLOCK_ASSERT(tp->t_inpcb);
/*
@@ -2804,9 +2787,6 @@ step6:
tp->rcv_up = tp->rcv_nxt;
}
dodata: /* XXX */
- INP_INFO_LOCK_ASSERT(&V_tcbinfo);
- KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED,
- ("tcp_do_segment: dodata ti_locked %d", ti_locked));
INP_WLOCK_ASSERT(tp->t_inpcb);
/*
@@ -2938,13 +2918,8 @@ dodata: /* XXX */
return;
}
}
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RUNLOCK(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED)
INP_INFO_WUNLOCK(&V_tcbinfo);
- else
- panic("%s: dodata epilogue ti_locked %d", __func__,
- ti_locked);
ti_locked = TI_UNLOCKED;
#ifdef TCPDEBUG
@@ -2973,9 +2948,6 @@ check_delack:
return;
dropafterack:
- KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED,
- ("tcp_do_segment: dropafterack ti_locked %d", ti_locked));
-
/*
* Generate an ACK dropping incoming segment if it occupies
* sequence space, where the ACK reflects our state.
@@ -3002,13 +2974,8 @@ dropafterack:
tcp_trace(TA_DROP, ostate, tp, (void *)tcp_saveipgen,
&tcp_savetcp, 0);
#endif
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RUNLOCK(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED)
INP_INFO_WUNLOCK(&V_tcbinfo);
- else
- panic("%s: dropafterack epilogue ti_locked %d", __func__,
- ti_locked);
ti_locked = TI_UNLOCKED;
tp->t_flags |= TF_ACKNOW;
@@ -3018,12 +2985,8 @@ dropafterack:
return;
dropwithreset:
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RUNLOCK(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED)
INP_INFO_WUNLOCK(&V_tcbinfo);
- else
- panic("%s: dropwithreset ti_locked %d", __func__, ti_locked);
ti_locked = TI_UNLOCKED;
if (tp != NULL) {
@@ -3034,15 +2997,14 @@ dropwithreset:
return;
drop:
- if (ti_locked == TI_RLOCKED)
- INP_INFO_RUNLOCK(&V_tcbinfo);
- else if (ti_locked == TI_WLOCKED)
+ if (ti_locked == TI_WLOCKED) {
INP_INFO_WUNLOCK(&V_tcbinfo);
+ ti_locked = TI_UNLOCKED;
+ }
#ifdef INVARIANTS
else
INP_INFO_UNLOCK_ASSERT(&V_tcbinfo);
#endif
- ti_locked = TI_UNLOCKED;
/*
* Drop space held by incoming segment and return.
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 4b5fa10..4542ac5 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1102,8 +1102,15 @@ send:
m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen;
}
+#ifdef IPSEC
+ KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL),
+ ("%s: mbuf chain shorter than expected: %ld + %u + %u - %u != %u",
+ __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL)));
+#else
KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL),
- ("%s: mbuf chain shorter than expected", __func__));
+ ("%s: mbuf chain shorter than expected: %ld + %u + %u != %u",
+ __func__, len, hdrlen, ipoptlen, m_length(m, NULL)));
+#endif
/*
* In transmit state, time the transmission and arrange for
@@ -1331,7 +1338,7 @@ out:
* then remember the size of the advertised window.
* Any pending ACK has now been sent.
*/
- if (recwin > 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv))
+ if (recwin >= 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv))
tp->rcv_adv = tp->rcv_nxt + recwin;
tp->last_ack_sent = tp->rcv_nxt;
tp->t_flags &= ~(TF_ACKNOW | TF_DELACK);
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 2c013be..6ed58911 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -300,7 +300,8 @@ tcp_init(void)
hashsize = 512; /* safe default */
}
in_pcbinfo_init(&V_tcbinfo, "tcp", &V_tcb, hashsize, hashsize,
- "tcp_inpcb", tcp_inpcb_init, NULL, UMA_ZONE_NOFREE);
+ "tcp_inpcb", tcp_inpcb_init, NULL, UMA_ZONE_NOFREE,
+ IPI_HASHFIELDS_4TUPLE);
/*
* These have to be type stable for the benefit of the timers.
@@ -1184,9 +1185,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
INP_INFO_WLOCK(&V_tcbinfo);
for (i = 0; i < n; i++) {
inp = inp_list[i];
- INP_WLOCK(inp);
- if (!in_pcbrele(inp))
- INP_WUNLOCK(inp);
+ INP_RLOCK(inp);
+ if (!in_pcbrele_rlocked(inp))
+ INP_RUNLOCK(inp);
}
INP_INFO_WUNLOCK(&V_tcbinfo);
@@ -1228,12 +1229,9 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
error = SYSCTL_IN(req, addrs, sizeof(addrs));
if (error)
return (error);
- INP_INFO_RLOCK(&V_tcbinfo);
- inp = in_pcblookup_hash(&V_tcbinfo, addrs[1].sin_addr,
- addrs[1].sin_port, addrs[0].sin_addr, addrs[0].sin_port, 0, NULL);
+ inp = in_pcblookup(&V_tcbinfo, addrs[1].sin_addr, addrs[1].sin_port,
+ addrs[0].sin_addr, addrs[0].sin_port, INPLOOKUP_RLOCKPCB, NULL);
if (inp != NULL) {
- INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&V_tcbinfo);
if (inp->inp_socket == NULL)
error = ENOENT;
if (error == 0)
@@ -1241,10 +1239,8 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
if (error == 0)
cru2x(inp->inp_cred, &xuc);
INP_RUNLOCK(inp);
- } else {
- INP_INFO_RUNLOCK(&V_tcbinfo);
+ } else
error = ENOENT;
- }
if (error == 0)
error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred));
return (error);
@@ -1286,23 +1282,20 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
return (EINVAL);
}
- INP_INFO_RLOCK(&V_tcbinfo);
#ifdef INET
if (mapped == 1)
- inp = in_pcblookup_hash(&V_tcbinfo,
+ inp = in_pcblookup(&V_tcbinfo,
*(struct in_addr *)&addrs[1].sin6_addr.s6_addr[12],
addrs[1].sin6_port,
*(struct in_addr *)&addrs[0].sin6_addr.s6_addr[12],
- addrs[0].sin6_port,
- 0, NULL);
+ addrs[0].sin6_port, INPLOOKUP_RLOCKPCB, NULL);
else
#endif
- inp = in6_pcblookup_hash(&V_tcbinfo,
+ inp = in6_pcblookup(&V_tcbinfo,
&addrs[1].sin6_addr, addrs[1].sin6_port,
- &addrs[0].sin6_addr, addrs[0].sin6_port, 0, NULL);
+ &addrs[0].sin6_addr, addrs[0].sin6_port,
+ INPLOOKUP_RLOCKPCB, NULL);
if (inp != NULL) {
- INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&V_tcbinfo);
if (inp->inp_socket == NULL)
error = ENOENT;
if (error == 0)
@@ -1310,10 +1303,8 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
if (error == 0)
cru2x(inp->inp_cred, &xuc);
INP_RUNLOCK(inp);
- } else {
- INP_INFO_RUNLOCK(&V_tcbinfo);
+ } else
error = ENOENT;
- }
if (error == 0)
error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred));
return (error);
@@ -1374,10 +1365,9 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
th = (struct tcphdr *)((caddr_t)ip
+ (ip->ip_hl << 2));
INP_INFO_WLOCK(&V_tcbinfo);
- inp = in_pcblookup_hash(&V_tcbinfo, faddr, th->th_dport,
- ip->ip_src, th->th_sport, 0, NULL);
+ inp = in_pcblookup(&V_tcbinfo, faddr, th->th_dport,
+ ip->ip_src, th->th_sport, INPLOOKUP_WLOCKPCB, NULL);
if (inp != NULL) {
- INP_WLOCK(inp);
if (!(inp->inp_flags & INP_TIMEWAIT) &&
!(inp->inp_flags & INP_DROPPED) &&
!(inp->inp_socket == NULL)) {
@@ -2154,20 +2144,19 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
switch (addrs[0].ss_family) {
#ifdef INET6
case AF_INET6:
- inp = in6_pcblookup_hash(&V_tcbinfo, &fin6->sin6_addr,
- fin6->sin6_port, &lin6->sin6_addr, lin6->sin6_port, 0,
- NULL);
+ inp = in6_pcblookup(&V_tcbinfo, &fin6->sin6_addr,
+ fin6->sin6_port, &lin6->sin6_addr, lin6->sin6_port,
+ INPLOOKUP_WLOCKPCB, NULL);
break;
#endif
#ifdef INET
case AF_INET:
- inp = in_pcblookup_hash(&V_tcbinfo, fin->sin_addr,
- fin->sin_port, lin->sin_addr, lin->sin_port, 0, NULL);
+ inp = in_pcblookup(&V_tcbinfo, fin->sin_addr, fin->sin_port,
+ lin->sin_addr, lin->sin_port, INPLOOKUP_WLOCKPCB, NULL);
break;
#endif
}
if (inp != NULL) {
- INP_WLOCK(inp);
if (inp->inp_flags & INP_TIMEWAIT) {
/*
* XXXRW: There currently exists a state where an
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 8262f43..66e4732 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
+#include "opt_pcbgroup.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -661,6 +662,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
inp = sotoinpcb(so);
inp->inp_inc.inc_fibnum = so->so_fibnum;
INP_WLOCK(inp);
+ INP_HASH_WLOCK(&V_tcbinfo);
/* Insert new socket into PCB hash list. */
inp->inp_inc.inc_flags = sc->sc_inc.inc_flags;
@@ -675,8 +677,14 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
#ifdef INET6
}
#endif
+
+ /*
+ * Install in the reservation hash table for now, but don't yet
+ * install a connection group since the full 4-tuple isn't yet
+ * configured.
+ */
inp->inp_lport = sc->sc_inc.inc_lport;
- if ((error = in_pcbinshash(inp)) != 0) {
+ if ((error = in_pcbinshash_nopcbgroup(inp)) != 0) {
/*
* Undo the assignments above if we failed to
* put the PCB on the hash lists.
@@ -694,6 +702,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
s, __func__, error);
free(s, M_TCPLOG);
}
+ INP_HASH_WUNLOCK(&V_tcbinfo);
goto abort;
}
#ifdef IPSEC
@@ -728,8 +737,8 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
laddr6 = inp->in6p_laddr;
if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr))
inp->in6p_laddr = sc->sc_inc.inc6_laddr;
- if ((error = in6_pcbconnect(inp, (struct sockaddr *)&sin6,
- thread0.td_ucred)) != 0) {
+ if ((error = in6_pcbconnect_mbuf(inp, (struct sockaddr *)&sin6,
+ thread0.td_ucred, m)) != 0) {
inp->in6p_laddr = laddr6;
if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) {
log(LOG_DEBUG, "%s; %s: in6_pcbconnect failed "
@@ -737,6 +746,7 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
s, __func__, error);
free(s, M_TCPLOG);
}
+ INP_HASH_WUNLOCK(&V_tcbinfo);
goto abort;
}
/* Override flowlabel from in6_pcbconnect. */
@@ -767,8 +777,8 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
laddr = inp->inp_laddr;
if (inp->inp_laddr.s_addr == INADDR_ANY)
inp->inp_laddr = sc->sc_inc.inc_laddr;
- if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin,
- thread0.td_ucred)) != 0) {
+ if ((error = in_pcbconnect_mbuf(inp, (struct sockaddr *)&sin,
+ thread0.td_ucred, m)) != 0) {
inp->inp_laddr = laddr;
if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) {
log(LOG_DEBUG, "%s; %s: in_pcbconnect failed "
@@ -776,10 +786,12 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m)
s, __func__, error);
free(s, M_TCPLOG);
}
+ INP_HASH_WUNLOCK(&V_tcbinfo);
goto abort;
}
}
#endif /* INET */
+ INP_HASH_WUNLOCK(&V_tcbinfo);
tp = intotcpcb(inp);
tp->t_state = TCPS_SYN_RECEIVED;
tp->iss = sc->sc_iss;
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 5c2c5c2..73984c7 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -490,7 +490,7 @@ tcp_timer_rexmt(void * xtp)
INP_WUNLOCK(inp);
INP_INFO_WLOCK(&V_tcbinfo);
INP_WLOCK(inp);
- if (in_pcbrele(inp)) {
+ if (in_pcbrele_wlocked(inp)) {
INP_INFO_WUNLOCK(&V_tcbinfo);
CURVNET_RESTORE();
return;
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 318fe27..96cb1e4 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -2,8 +2,12 @@
* Copyright (c) 1982, 1986, 1988, 1993
* The Regents of the University of California.
* Copyright (c) 2006-2007 Robert N. M. Watson
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
* All rights reserved.
*
+ * Portions of this software were developed by Robert N. M. Watson under
+ * contract to Juniper Networks, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -251,7 +255,6 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
return (EAFNOSUPPORT);
TCPDEBUG0;
- INP_INFO_WLOCK(&V_tcbinfo);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp_usr_bind: inp == NULL"));
INP_WLOCK(inp);
@@ -261,11 +264,12 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
}
tp = intotcpcb(inp);
TCPDEBUG1();
+ INP_HASH_WLOCK(&V_tcbinfo);
error = in_pcbbind(inp, nam, td->td_ucred);
+ INP_HASH_WUNLOCK(&V_tcbinfo);
out:
TCPDEBUG2(PRU_BIND);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_tcbinfo);
return (error);
}
@@ -292,7 +296,6 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
return (EAFNOSUPPORT);
TCPDEBUG0;
- INP_INFO_WLOCK(&V_tcbinfo);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp6_usr_bind: inp == NULL"));
INP_WLOCK(inp);
@@ -302,6 +305,7 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
}
tp = intotcpcb(inp);
TCPDEBUG1();
+ INP_HASH_WLOCK(&V_tcbinfo);
inp->inp_vflag &= ~INP_IPV4;
inp->inp_vflag |= INP_IPV6;
#ifdef INET
@@ -316,15 +320,16 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
inp->inp_vflag &= ~INP_IPV6;
error = in_pcbbind(inp, (struct sockaddr *)&sin,
td->td_ucred);
+ INP_HASH_WUNLOCK(&V_tcbinfo);
goto out;
}
}
#endif
error = in6_pcbbind(inp, nam, td->td_ucred);
+ INP_HASH_WUNLOCK(&V_tcbinfo);
out:
TCPDEBUG2(PRU_BIND);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_tcbinfo);
return (error);
}
#endif /* INET6 */
@@ -341,7 +346,6 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td)
struct tcpcb *tp = NULL;
TCPDEBUG0;
- INP_INFO_WLOCK(&V_tcbinfo);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp_usr_listen: inp == NULL"));
INP_WLOCK(inp);
@@ -353,8 +357,10 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td)
TCPDEBUG1();
SOCK_LOCK(so);
error = solisten_proto_check(so);
+ INP_HASH_WLOCK(&V_tcbinfo);
if (error == 0 && inp->inp_lport == 0)
error = in_pcbbind(inp, (struct sockaddr *)0, td->td_ucred);
+ INP_HASH_WUNLOCK(&V_tcbinfo);
if (error == 0) {
tp->t_state = TCPS_LISTEN;
solisten_proto(so, backlog);
@@ -365,7 +371,6 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td)
out:
TCPDEBUG2(PRU_LISTEN);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_tcbinfo);
return (error);
}
#endif /* INET */
@@ -379,7 +384,6 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td)
struct tcpcb *tp = NULL;
TCPDEBUG0;
- INP_INFO_WLOCK(&V_tcbinfo);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp6_usr_listen: inp == NULL"));
INP_WLOCK(inp);
@@ -391,12 +395,14 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td)
TCPDEBUG1();
SOCK_LOCK(so);
error = solisten_proto_check(so);
+ INP_HASH_WLOCK(&V_tcbinfo);
if (error == 0 && inp->inp_lport == 0) {
inp->inp_vflag &= ~INP_IPV4;
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0)
inp->inp_vflag |= INP_IPV4;
error = in6_pcbbind(inp, (struct sockaddr *)0, td->td_ucred);
}
+ INP_HASH_WUNLOCK(&V_tcbinfo);
if (error == 0) {
tp->t_state = TCPS_LISTEN;
solisten_proto(so, backlog);
@@ -406,7 +412,6 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td)
out:
TCPDEBUG2(PRU_LISTEN);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_tcbinfo);
return (error);
}
#endif /* INET6 */
@@ -440,7 +445,6 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
return (error);
TCPDEBUG0;
- INP_INFO_WLOCK(&V_tcbinfo);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp_usr_connect: inp == NULL"));
INP_WLOCK(inp);
@@ -456,7 +460,6 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
out:
TCPDEBUG2(PRU_CONNECT);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_tcbinfo);
return (error);
}
#endif /* INET */
@@ -482,7 +485,6 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
&& IN6_IS_ADDR_MULTICAST(&sin6p->sin6_addr))
return (EAFNOSUPPORT);
- INP_INFO_WLOCK(&V_tcbinfo);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp6_usr_connect: inp == NULL"));
INP_WLOCK(inp);
@@ -493,6 +495,11 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
tp = intotcpcb(inp);
TCPDEBUG1();
#ifdef INET
+ /*
+ * XXXRW: Some confusion: V4/V6 flags relate to binding, and
+ * therefore probably require the hash lock, which isn't held here.
+ * Is this a significant problem?
+ */
if (IN6_IS_ADDR_V4MAPPED(&sin6p->sin6_addr)) {
struct sockaddr_in sin;
@@ -525,7 +532,6 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
out:
TCPDEBUG2(PRU_CONNECT);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_tcbinfo);
return (error);
}
#endif /* INET6 */
@@ -639,6 +645,7 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp6_usr_accept: inp == NULL"));
+ INP_INFO_RLOCK(&V_tcbinfo);
INP_WLOCK(inp);
if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
error = ECONNABORTED;
@@ -664,6 +671,7 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam)
out:
TCPDEBUG2(PRU_ACCEPT);
INP_WUNLOCK(inp);
+ INP_INFO_RUNLOCK(&V_tcbinfo);
if (error == 0) {
if (v4)
*nam = in6_v4mapsin6_sockaddr(port, &addr);
@@ -750,25 +758,17 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
int error = 0;
struct inpcb *inp;
struct tcpcb *tp = NULL;
- int headlocked = 0;
#ifdef INET6
int isipv6;
#endif
TCPDEBUG0;
/*
- * We require the pcbinfo lock in two cases:
- *
- * (1) An implied connect is taking place, which can result in
- * binding IPs and ports and hence modification of the pcb hash
- * chains.
- *
- * (2) PRUS_EOF is set, resulting in explicit close on the send.
+ * We require the pcbinfo lock if we will close the socket as part of
+ * this call.
*/
- if ((nam != NULL) || (flags & PRUS_EOF)) {
+ if (flags & PRUS_EOF)
INP_INFO_WLOCK(&V_tcbinfo);
- headlocked = 1;
- }
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp_usr_send: inp == NULL"));
INP_WLOCK(inp);
@@ -805,7 +805,6 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
* initialize maxseg/maxopd using peer's cached
* MSS.
*/
- INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
#ifdef INET6
if (isipv6)
error = tcp6_connect(tp, nam, td);
@@ -830,10 +829,6 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
socantsendmore(so);
tcp_usrclosed(tp);
}
- if (headlocked) {
- INP_INFO_WUNLOCK(&V_tcbinfo);
- headlocked = 0;
- }
if (!(inp->inp_flags & INP_DROPPED)) {
if (flags & PRUS_MORETOCOME)
tp->t_flags |= TF_MORETOCOME;
@@ -869,7 +864,6 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
* initialize maxseg/maxopd using peer's cached
* MSS.
*/
- INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
#ifdef INET6
if (isipv6)
error = tcp6_connect(tp, nam, td);
@@ -884,11 +878,6 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
goto out;
tp->snd_wnd = TTCP_CLIENT_SND_WND;
tcp_mss(tp, -1);
- INP_INFO_WUNLOCK(&V_tcbinfo);
- headlocked = 0;
- } else if (nam) {
- INP_INFO_WUNLOCK(&V_tcbinfo);
- headlocked = 0;
}
tp->snd_up = tp->snd_una + so->so_snd.sb_cc;
tp->t_flags |= TF_FORCEDATA;
@@ -899,7 +888,7 @@ out:
TCPDEBUG2((flags & PRUS_OOB) ? PRU_SENDOOB :
((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND));
INP_WUNLOCK(inp);
- if (headlocked)
+ if (flags & PRUS_EOF)
INP_INFO_WUNLOCK(&V_tcbinfo);
return (error);
}
@@ -1087,13 +1076,13 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
u_short lport;
int error;
- INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK(&V_tcbinfo);
if (inp->inp_lport == 0) {
error = in_pcbbind(inp, (struct sockaddr *)0, td->td_ucred);
if (error)
- return error;
+ goto out;
}
/*
@@ -1106,11 +1095,14 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
error = in_pcbconnect_setup(inp, nam, &laddr.s_addr, &lport,
&inp->inp_faddr.s_addr, &inp->inp_fport, &oinp, td->td_ucred);
if (error && oinp == NULL)
- return error;
- if (oinp)
- return EADDRINUSE;
+ goto out;
+ if (oinp) {
+ error = EADDRINUSE;
+ goto out;
+ }
inp->inp_laddr = laddr;
in_pcbrehash(inp);
+ INP_HASH_WUNLOCK(&V_tcbinfo);
/*
* Compute window scaling to request:
@@ -1129,6 +1121,10 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
tcp_sendseqinit(tp);
return 0;
+
+out:
+ INP_HASH_WUNLOCK(&V_tcbinfo);
+ return (error);
}
#endif /* INET */
@@ -1142,13 +1138,13 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
struct in6_addr addr6;
int error;
- INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK(&V_tcbinfo);
if (inp->inp_lport == 0) {
error = in6_pcbbind(inp, (struct sockaddr *)0, td->td_ucred);
if (error)
- return error;
+ goto out;
}
/*
@@ -1156,18 +1152,23 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
* earlier incarnation of this same connection still in
* TIME_WAIT state, creating an ADDRINUSE error.
* in6_pcbladdr() also handles scope zone IDs.
+ *
+ * XXXRW: We wouldn't need to expose in6_pcblookup_hash_locked()
+ * outside of in6_pcb.c if there were an in6_pcbconnect_setup().
*/
error = in6_pcbladdr(inp, nam, &addr6);
if (error)
- return error;
- oinp = in6_pcblookup_hash(inp->inp_pcbinfo,
+ goto out;
+ oinp = in6_pcblookup_hash_locked(inp->inp_pcbinfo,
&sin6->sin6_addr, sin6->sin6_port,
IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)
? &addr6
: &inp->in6p_laddr,
inp->inp_lport, 0, NULL);
- if (oinp)
- return EADDRINUSE;
+ if (oinp) {
+ error = EADDRINUSE;
+ goto out;
+ }
if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr))
inp->in6p_laddr = addr6;
inp->in6p_faddr = sin6->sin6_addr;
@@ -1178,6 +1179,7 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
inp->inp_flow |=
(htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK);
in_pcbrehash(inp);
+ INP_HASH_WUNLOCK(&V_tcbinfo);
/* Compute window scaling to request. */
while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
@@ -1192,6 +1194,10 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td)
tcp_sendseqinit(tp);
return 0;
+
+out:
+ INP_HASH_WUNLOCK(&V_tcbinfo);
+ return error;
}
#endif /* INET6 */
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index c3503e6..28eb8fd 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -2,8 +2,12 @@
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
* The Regents of the University of California.
* Copyright (c) 2008 Robert N. M. Watson
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
* All rights reserved.
*
+ * Portions of this software were developed by Robert N. M. Watson under
+ * contract to Juniper Networks, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -182,7 +186,8 @@ udp_init(void)
{
in_pcbinfo_init(&V_udbinfo, "udp", &V_udb, UDBHASHSIZE, UDBHASHSIZE,
- "udp_inpcb", udp_inpcb_init, NULL, UMA_ZONE_NOFREE);
+ "udp_inpcb", udp_inpcb_init, NULL, UMA_ZONE_NOFREE,
+ IPI_HASHFIELDS_2TUPLE);
V_udpcb_zone = uma_zcreate("udpcb", sizeof(struct udpcb),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
uma_zone_set_max(V_udpcb_zone, maxsockets);
@@ -253,7 +258,7 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off,
#endif
struct udpcb *up;
- INP_RLOCK_ASSERT(inp);
+ INP_LOCK_ASSERT(inp);
/*
* Engage the tunneling protocol.
@@ -458,12 +463,12 @@ udp_input(struct mbuf *m, int off)
}
#endif
- INP_INFO_RLOCK(&V_udbinfo);
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
in_broadcast(ip->ip_dst, ifp)) {
struct inpcb *last;
struct ip_moptions *imo;
+ INP_INFO_RLOCK(&V_udbinfo);
last = NULL;
LIST_FOREACH(inp, &V_udb, inp_list) {
if (inp->inp_lport != uh->uh_dport)
@@ -485,6 +490,13 @@ udp_input(struct mbuf *m, int off)
INP_RLOCK(inp);
/*
+ * XXXRW: Because we weren't holding either the inpcb
+ * or the hash lock when we checked for a match
+ * before, we should probably recheck now that the
+ * inpcb lock is held.
+ */
+
+ /*
* Handle socket delivery policy for any-source
* and source-specific multicast. [RFC3678]
*/
@@ -542,7 +554,10 @@ udp_input(struct mbuf *m, int off)
* or multicast datgram.)
*/
UDPSTAT_INC(udps_noportbcast);
- goto badheadlocked;
+ if (inp)
+ INP_RUNLOCK(inp);
+ INP_INFO_RUNLOCK(&V_udbinfo);
+ goto badunlocked;
}
udp_append(last, ip, m, iphlen, &udp_in);
INP_RUNLOCK(last);
@@ -553,8 +568,9 @@ udp_input(struct mbuf *m, int off)
/*
* Locate pcb for datagram.
*/
- inp = in_pcblookup_hash(&V_udbinfo, ip->ip_src, uh->uh_sport,
- ip->ip_dst, uh->uh_dport, 1, ifp);
+ inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport,
+ ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB,
+ ifp, m);
if (inp == NULL) {
if (udp_log_in_vain) {
char buf[4*sizeof "123"];
@@ -568,36 +584,31 @@ udp_input(struct mbuf *m, int off)
UDPSTAT_INC(udps_noport);
if (m->m_flags & (M_BCAST | M_MCAST)) {
UDPSTAT_INC(udps_noportbcast);
- goto badheadlocked;
+ goto badunlocked;
}
if (V_udp_blackhole)
- goto badheadlocked;
+ goto badunlocked;
if (badport_bandlim(BANDLIM_ICMP_UNREACH) < 0)
- goto badheadlocked;
+ goto badunlocked;
*ip = save_ip;
ip->ip_len += iphlen;
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);
- INP_INFO_RUNLOCK(&V_udbinfo);
return;
}
/*
* Check the minimum TTL for socket.
*/
- INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&V_udbinfo);
+ INP_RLOCK_ASSERT(inp);
if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) {
INP_RUNLOCK(inp);
- goto badunlocked;
+ m_freem(m);
+ return;
}
udp_append(inp, ip, m, iphlen, &udp_in);
INP_RUNLOCK(inp);
return;
-badheadlocked:
- if (inp)
- INP_RUNLOCK(inp);
- INP_INFO_RUNLOCK(&V_udbinfo);
badunlocked:
m_freem(m);
}
@@ -656,17 +667,15 @@ udp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
return;
if (ip != NULL) {
uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2));
- INP_INFO_RLOCK(&V_udbinfo);
- inp = in_pcblookup_hash(&V_udbinfo, faddr, uh->uh_dport,
- ip->ip_src, uh->uh_sport, 0, NULL);
+ inp = in_pcblookup(&V_udbinfo, faddr, uh->uh_dport,
+ ip->ip_src, uh->uh_sport, INPLOOKUP_RLOCKPCB, NULL);
if (inp != NULL) {
- INP_RLOCK(inp);
+ INP_RLOCK_ASSERT(inp);
if (inp->inp_socket != NULL) {
udp_notify(inp, inetctlerrmap[cmd]);
}
INP_RUNLOCK(inp);
}
- INP_INFO_RUNLOCK(&V_udbinfo);
} else
in_pcbnotifyall(&V_udbinfo, faddr, inetctlerrmap[cmd],
udp_notify);
@@ -756,9 +765,9 @@ udp_pcblist(SYSCTL_HANDLER_ARGS)
INP_INFO_WLOCK(&V_udbinfo);
for (i = 0; i < n; i++) {
inp = inp_list[i];
- INP_WLOCK(inp);
- if (!in_pcbrele(inp))
- INP_WUNLOCK(inp);
+ INP_RLOCK(inp);
+ if (!in_pcbrele_rlocked(inp))
+ INP_RUNLOCK(inp);
}
INP_INFO_WUNLOCK(&V_udbinfo);
@@ -799,12 +808,11 @@ udp_getcred(SYSCTL_HANDLER_ARGS)
error = SYSCTL_IN(req, addrs, sizeof(addrs));
if (error)
return (error);
- INP_INFO_RLOCK(&V_udbinfo);
- inp = in_pcblookup_hash(&V_udbinfo, addrs[1].sin_addr, addrs[1].sin_port,
- addrs[0].sin_addr, addrs[0].sin_port, 1, NULL);
+ inp = in_pcblookup(&V_udbinfo, addrs[1].sin_addr, addrs[1].sin_port,
+ addrs[0].sin_addr, addrs[0].sin_port,
+ INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL);
if (inp != NULL) {
- INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&V_udbinfo);
+ INP_RLOCK_ASSERT(inp);
if (inp->inp_socket == NULL)
error = ENOENT;
if (error == 0)
@@ -812,10 +820,8 @@ udp_getcred(SYSCTL_HANDLER_ARGS)
if (error == 0)
cru2x(inp->inp_cred, &xuc);
INP_RUNLOCK(inp);
- } else {
- INP_INFO_RUNLOCK(&V_udbinfo);
+ } else
error = ENOENT;
- }
if (error == 0)
error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred));
return (error);
@@ -924,6 +930,9 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt)
}
#ifdef INET
+#define UH_WLOCKED 2
+#define UH_RLOCKED 1
+#define UH_UNLOCKED 0
static int
udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
struct mbuf *control, struct thread *td)
@@ -1016,29 +1025,27 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
* conservative locks than required the second time around, so later
* assertions have to accept that. Further analysis of the number of
* misses under contention is required.
+ *
+ * XXXRW: Check that hash locking update here is correct.
*/
sin = (struct sockaddr_in *)addr;
INP_RLOCK(inp);
if (sin != NULL &&
(inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) {
INP_RUNLOCK(inp);
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
- unlock_udbinfo = 2;
+ INP_HASH_WLOCK(&V_udbinfo);
+ unlock_udbinfo = UH_WLOCKED;
} else if ((sin != NULL && (
(sin->sin_addr.s_addr == INADDR_ANY) ||
(sin->sin_addr.s_addr == INADDR_BROADCAST) ||
(inp->inp_laddr.s_addr == INADDR_ANY) ||
(inp->inp_lport == 0))) ||
(src.sin_family == AF_INET)) {
- if (!INP_INFO_TRY_RLOCK(&V_udbinfo)) {
- INP_RUNLOCK(inp);
- INP_INFO_RLOCK(&V_udbinfo);
- INP_RLOCK(inp);
- }
- unlock_udbinfo = 1;
+ INP_HASH_RLOCK(&V_udbinfo);
+ unlock_udbinfo = UH_RLOCKED;
} else
- unlock_udbinfo = 0;
+ unlock_udbinfo = UH_UNLOCKED;
/*
* If the IP_SENDSRCADDR control message was specified, override the
@@ -1048,7 +1055,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
laddr = inp->inp_laddr;
lport = inp->inp_lport;
if (src.sin_family == AF_INET) {
- INP_INFO_LOCK_ASSERT(&V_udbinfo);
+ INP_HASH_LOCK_ASSERT(&V_udbinfo);
if ((lport == 0) ||
(laddr.s_addr == INADDR_ANY &&
src.sin_addr.s_addr == INADDR_ANY)) {
@@ -1099,7 +1106,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
inp->inp_lport == 0 ||
sin->sin_addr.s_addr == INADDR_ANY ||
sin->sin_addr.s_addr == INADDR_BROADCAST) {
- INP_INFO_LOCK_ASSERT(&V_udbinfo);
+ INP_HASH_LOCK_ASSERT(&V_udbinfo);
error = in_pcbconnect_setup(inp, addr, &laddr.s_addr,
&lport, &faddr.s_addr, &fport, NULL,
td->td_ucred);
@@ -1113,8 +1120,8 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
/* Commit the local port if newly assigned. */
if (inp->inp_laddr.s_addr == INADDR_ANY &&
inp->inp_lport == 0) {
- INP_INFO_WLOCK_ASSERT(&V_udbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(&V_udbinfo);
/*
* Remember addr if jailed, to prevent
* rebinding.
@@ -1209,25 +1216,25 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */
UDPSTAT_INC(udps_opackets);
- if (unlock_udbinfo == 2)
- INP_INFO_WUNLOCK(&V_udbinfo);
- else if (unlock_udbinfo == 1)
- INP_INFO_RUNLOCK(&V_udbinfo);
+ if (unlock_udbinfo == UH_WLOCKED)
+ INP_HASH_WUNLOCK(&V_udbinfo);
+ else if (unlock_udbinfo == UH_RLOCKED)
+ INP_HASH_RUNLOCK(&V_udbinfo);
error = ip_output(m, inp->inp_options, NULL, ipflags,
inp->inp_moptions, inp);
- if (unlock_udbinfo == 2)
+ if (unlock_udbinfo == UH_WLOCKED)
INP_WUNLOCK(inp);
else
INP_RUNLOCK(inp);
return (error);
release:
- if (unlock_udbinfo == 2) {
+ if (unlock_udbinfo == UH_WLOCKED) {
+ INP_HASH_WUNLOCK(&V_udbinfo);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
- } else if (unlock_udbinfo == 1) {
+ } else if (unlock_udbinfo == UH_RLOCKED) {
+ INP_HASH_RUNLOCK(&V_udbinfo);
INP_RUNLOCK(inp);
- INP_INFO_RUNLOCK(&V_udbinfo);
} else
INP_RUNLOCK(inp);
m_freem(m);
@@ -1376,15 +1383,15 @@ udp_abort(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_abort: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
if (inp->inp_faddr.s_addr != INADDR_ANY) {
+ INP_HASH_WLOCK(&V_udbinfo);
in_pcbdisconnect(inp);
inp->inp_laddr.s_addr = INADDR_ANY;
+ INP_HASH_WUNLOCK(&V_udbinfo);
soisdisconnected(so);
}
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
}
static int
@@ -1453,11 +1460,11 @@ udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_bind: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
+ INP_HASH_WLOCK(&V_udbinfo);
error = in_pcbbind(inp, nam, td->td_ucred);
+ INP_HASH_WUNLOCK(&V_udbinfo);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (error);
}
@@ -1468,15 +1475,15 @@ udp_close(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_close: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
if (inp->inp_faddr.s_addr != INADDR_ANY) {
+ INP_HASH_WLOCK(&V_udbinfo);
in_pcbdisconnect(inp);
inp->inp_laddr.s_addr = INADDR_ANY;
+ INP_HASH_WUNLOCK(&V_udbinfo);
soisdisconnected(so);
}
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
}
static int
@@ -1488,25 +1495,23 @@ udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_connect: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
if (inp->inp_faddr.s_addr != INADDR_ANY) {
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (EISCONN);
}
sin = (struct sockaddr_in *)nam;
error = prison_remote_ip4(td->td_ucred, &sin->sin_addr);
if (error != 0) {
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (error);
}
+ INP_HASH_WLOCK(&V_udbinfo);
error = in_pcbconnect(inp, nam, td->td_ucred);
+ INP_HASH_WUNLOCK(&V_udbinfo);
if (error == 0)
soisconnected(so);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (error);
}
@@ -1538,21 +1543,19 @@ udp_disconnect(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp_disconnect: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
if (inp->inp_faddr.s_addr == INADDR_ANY) {
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (ENOTCONN);
}
-
+ INP_HASH_WLOCK(&V_udbinfo);
in_pcbdisconnect(inp);
inp->inp_laddr.s_addr = INADDR_ANY;
+ INP_HASH_WUNLOCK(&V_udbinfo);
SOCK_LOCK(so);
so->so_state &= ~SS_ISCONNECTED; /* XXX */
SOCK_UNLOCK(so);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (0);
}
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 9e8e5cd..9558d1b 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -652,8 +652,32 @@ in6_control(struct socket *so, u_long cmd, caddr_t data,
* that is, this address might make other addresses detached.
*/
pfxlist_onlink_check();
- if (error == 0 && ia)
+ if (error == 0 && ia) {
+ if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) {
+ /*
+ * Try to clear the flag when a new
+ * IPv6 address is added onto an
+ * IFDISABLED interface and it
+ * succeeds.
+ */
+ struct in6_ndireq nd;
+
+ memset(&nd, 0, sizeof(nd));
+ nd.ndi.flags = ND_IFINFO(ifp)->flags;
+ nd.ndi.flags &= ~ND6_IFF_IFDISABLED;
+ if (nd6_ioctl(SIOCSIFINFO_FLAGS,
+ (caddr_t)&nd, ifp) < 0)
+ log(LOG_NOTICE, "SIOCAIFADDR_IN6: "
+ "SIOCSIFINFO_FLAGS for -ifdisabled "
+ "failed.");
+ /*
+ * Ignore failure of clearing the flag
+ * intentionally. The failure means
+ * address duplication was detected.
+ */
+ }
EVENTHANDLER_INVOKE(ifaddr_event, ifp);
+ }
break;
}
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h
index 32759af..ae0da6a 100644
--- a/sys/netinet6/in6.h
+++ b/sys/netinet6/in6.h
@@ -611,7 +611,10 @@ struct ip6_mtuinfo {
#define IPV6CTL_STEALTH 45
#define ICMPV6CTL_ND6_ONLINKNSRFC4861 47
-#define IPV6CTL_MAXID 48
+#define IPV6CTL_NO_RADR 48 /* No defroute from RA */
+#define IPV6CTL_NORBIT_RAIF 49 /* Disable R-bit in NA on RA
+ * receiving IF. */
+#define IPV6CTL_MAXID 50
#endif /* __BSD_VISIBLE */
/*
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index eacce8c..d15c605 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -1,7 +1,11 @@
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
* All rights reserved.
*
+ * Portions of this software were developed by Robert N. M. Watson under
+ * contract to Juniper Networks, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -66,6 +70,7 @@ __FBSDID("$FreeBSD$");
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
+#include "opt_pcbgroup.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -114,8 +119,8 @@ in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam,
int error, lookupflags = 0;
int reuseport = (so->so_options & SO_REUSEPORT);
- INP_INFO_WLOCK_ASSERT(pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(pcbinfo);
if (TAILQ_EMPTY(&V_in6_ifaddrhead)) /* XXX broken! */
return (EADDRNOTAVAIL);
@@ -298,8 +303,8 @@ in6_pcbladdr(register struct inpcb *inp, struct sockaddr *nam,
int scope_ambiguous = 0;
struct in6_addr in6a;
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo); /* XXXRW: why? */
if (nam->sa_len != sizeof (*sin6))
return (EINVAL);
@@ -360,15 +365,16 @@ in6_pcbladdr(register struct inpcb *inp, struct sockaddr *nam,
* then pick one.
*/
int
-in6_pcbconnect(register struct inpcb *inp, struct sockaddr *nam,
- struct ucred *cred)
+in6_pcbconnect_mbuf(register struct inpcb *inp, struct sockaddr *nam,
+ struct ucred *cred, struct mbuf *m)
{
+ struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
register struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam;
struct in6_addr addr6;
int error;
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(pcbinfo);
/*
* Call inner routine, to assign local interface address.
@@ -377,7 +383,7 @@ in6_pcbconnect(register struct inpcb *inp, struct sockaddr *nam,
if ((error = in6_pcbladdr(inp, nam, &addr6)) != 0)
return (error);
- if (in6_pcblookup_hash(inp->inp_pcbinfo, &sin6->sin6_addr,
+ if (in6_pcblookup_hash_locked(pcbinfo, &sin6->sin6_addr,
sin6->sin6_port,
IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)
? &addr6 : &inp->in6p_laddr,
@@ -400,17 +406,24 @@ in6_pcbconnect(register struct inpcb *inp, struct sockaddr *nam,
inp->inp_flow |=
(htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK);
- in_pcbrehash(inp);
+ in_pcbrehash_mbuf(inp, m);
return (0);
}
+int
+in6_pcbconnect(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred)
+{
+
+ return (in6_pcbconnect_mbuf(inp, nam, cred, NULL));
+}
+
void
in6_pcbdisconnect(struct inpcb *inp)
{
- INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo);
bzero((caddr_t)&inp->in6p_faddr, sizeof(inp->in6p_faddr));
inp->inp_fport = 0;
@@ -649,7 +662,8 @@ in6_pcbnotify(struct inpcbinfo *pcbinfo, struct sockaddr *dst,
}
/*
- * Lookup a PCB based on the local address and port.
+ * Lookup a PCB based on the local address and port. Caller must hold the
+ * hash lock. No inpcb locks or references are acquired.
*/
struct inpcb *
in6_pcblookup_local(struct inpcbinfo *pcbinfo, struct in6_addr *laddr,
@@ -661,7 +675,7 @@ in6_pcblookup_local(struct inpcbinfo *pcbinfo, struct in6_addr *laddr,
KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0,
("%s: invalid lookup flags %d", __func__, lookupflags));
- INP_INFO_WLOCK_ASSERT(pcbinfo);
+ INP_HASH_WLOCK_ASSERT(pcbinfo);
if ((lookupflags & INPLOOKUP_WILDCARD) == 0) {
struct inpcbhead *head;
@@ -814,13 +828,148 @@ in6_rtchange(struct inpcb *inp, int errno)
return inp;
}
+#ifdef PCBGROUP
+/*
+ * Lookup PCB in hash list, using pcbgroup tables.
+ */
+static struct inpcb *
+in6_pcblookup_group(struct inpcbinfo *pcbinfo, struct inpcbgroup *pcbgroup,
+ struct in6_addr *faddr, u_int fport_arg, struct in6_addr *laddr,
+ u_int lport_arg, int lookupflags, struct ifnet *ifp)
+{
+ struct inpcbhead *head;
+ struct inpcb *inp, *tmpinp;
+ u_short fport = fport_arg, lport = lport_arg;
+ int faith;
+
+ if (faithprefix_p != NULL)
+ faith = (*faithprefix_p)(laddr);
+ else
+ faith = 0;
+
+ /*
+ * First look for an exact match.
+ */
+ tmpinp = NULL;
+ INP_GROUP_LOCK(pcbgroup);
+ head = &pcbgroup->ipg_hashbase[
+ INP_PCBHASH(faddr->s6_addr32[3] /* XXX */, lport, fport,
+ pcbgroup->ipg_hashmask)];
+ LIST_FOREACH(inp, head, inp_pcbgrouphash) {
+ /* XXX inp locking */
+ if ((inp->inp_vflag & INP_IPV6) == 0)
+ continue;
+ if (IN6_ARE_ADDR_EQUAL(&inp->in6p_faddr, faddr) &&
+ IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr) &&
+ inp->inp_fport == fport &&
+ inp->inp_lport == lport) {
+ /*
+ * XXX We should be able to directly return
+ * the inp here, without any checks.
+ * Well unless both bound with SO_REUSEPORT?
+ */
+ if (prison_flag(inp->inp_cred, PR_IP6))
+ goto found;
+ if (tmpinp == NULL)
+ tmpinp = inp;
+ }
+ }
+ if (tmpinp != NULL) {
+ inp = tmpinp;
+ goto found;
+ }
+
+ /*
+ * Then look for a wildcard match, if requested.
+ */
+ if ((lookupflags & INPLOOKUP_WILDCARD) != 0) {
+ struct inpcb *local_wild = NULL, *local_exact = NULL;
+ struct inpcb *jail_wild = NULL;
+ int injail;
+
+ /*
+ * Order of socket selection - we always prefer jails.
+ * 1. jailed, non-wild.
+ * 2. jailed, wild.
+ * 3. non-jailed, non-wild.
+ * 4. non-jailed, wild.
+ */
+ head = &pcbinfo->ipi_wildbase[INP_PCBHASH(INADDR_ANY, lport,
+ 0, pcbinfo->ipi_wildmask)];
+ LIST_FOREACH(inp, head, inp_pcbgroup_wild) {
+ /* XXX inp locking */
+ if ((inp->inp_vflag & INP_IPV6) == 0)
+ continue;
+
+ if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr) ||
+ inp->inp_lport != lport) {
+ continue;
+ }
+
+ /* XXX inp locking */
+ if (faith && (inp->inp_flags & INP_FAITH) == 0)
+ continue;
+
+ injail = prison_flag(inp->inp_cred, PR_IP6);
+ if (injail) {
+ if (prison_check_ip6(inp->inp_cred,
+ laddr) != 0)
+ continue;
+ } else {
+ if (local_exact != NULL)
+ continue;
+ }
+
+ if (IN6_ARE_ADDR_EQUAL(&inp->in6p_laddr, laddr)) {
+ if (injail)
+ goto found;
+ else
+ local_exact = inp;
+ } else if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) {
+ if (injail)
+ jail_wild = inp;
+ else
+ local_wild = inp;
+ }
+ } /* LIST_FOREACH */
+
+ inp = jail_wild;
+ if (inp == NULL)
+ inp = jail_wild;
+ if (inp == NULL)
+ inp = local_exact;
+ if (inp == NULL)
+ inp = local_wild;
+ if (inp != NULL)
+ goto found;
+ } /* if ((lookupflags & INPLOOKUP_WILDCARD) != 0) */
+ INP_GROUP_UNLOCK(pcbgroup);
+ return (NULL);
+
+found:
+ in_pcbref(inp);
+ INP_GROUP_UNLOCK(pcbgroup);
+ if (lookupflags & INPLOOKUP_WLOCKPCB) {
+ INP_WLOCK(inp);
+ if (in_pcbrele_wlocked(inp))
+ return (NULL);
+ } else if (lookupflags & INPLOOKUP_RLOCKPCB) {
+ INP_RLOCK(inp);
+ if (in_pcbrele_rlocked(inp))
+ return (NULL);
+ } else
+ panic("%s: locking buf", __func__);
+ return (inp);
+}
+#endif /* PCBGROUP */
+
/*
* Lookup PCB in hash list.
*/
struct inpcb *
-in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in6_addr *faddr,
- u_int fport_arg, struct in6_addr *laddr, u_int lport_arg, int lookupflags,
- struct ifnet *ifp)
+in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in6_addr *faddr,
+ u_int fport_arg, struct in6_addr *laddr, u_int lport_arg,
+ int lookupflags, struct ifnet *ifp)
{
struct inpcbhead *head;
struct inpcb *inp, *tmpinp;
@@ -830,7 +979,7 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in6_addr *faddr,
KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0,
("%s: invalid lookup flags %d", __func__, lookupflags));
- INP_INFO_LOCK_ASSERT(pcbinfo);
+ INP_HASH_LOCK_ASSERT(pcbinfo);
if (faithprefix_p != NULL)
faith = (*faithprefix_p)(laddr);
@@ -934,6 +1083,101 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in6_addr *faddr,
return (NULL);
}
+/*
+ * Lookup PCB in hash list, using pcbinfo tables. This variation locks the
+ * hash list lock, and will return the inpcb locked (i.e., requires
+ * INPLOOKUP_LOCKPCB).
+ */
+static struct inpcb *
+in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in6_addr *faddr,
+ u_int fport, struct in6_addr *laddr, u_int lport, int lookupflags,
+ struct ifnet *ifp)
+{
+ struct inpcb *inp;
+
+ INP_HASH_RLOCK(pcbinfo);
+ inp = in6_pcblookup_hash_locked(pcbinfo, faddr, fport, laddr, lport,
+ (lookupflags & ~(INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)), ifp);
+ if (inp != NULL) {
+ in_pcbref(inp);
+ INP_HASH_RUNLOCK(pcbinfo);
+ if (lookupflags & INPLOOKUP_WLOCKPCB) {
+ INP_WLOCK(inp);
+ if (in_pcbrele_wlocked(inp))
+ return (NULL);
+ } else if (lookupflags & INPLOOKUP_RLOCKPCB) {
+ INP_RLOCK(inp);
+ if (in_pcbrele_rlocked(inp))
+ return (NULL);
+ } else
+ panic("%s: locking bug", __func__);
+ } else
+ INP_HASH_RUNLOCK(pcbinfo);
+ return (inp);
+}
+
+/*
+ * Public inpcb lookup routines, accepting a 4-tuple, and optionally, an mbuf
+ * from which a pre-calculated hash value may be extracted.
+ *
+ * Possibly more of this logic should be in in6_pcbgroup.c.
+ */
+struct inpcb *
+in6_pcblookup(struct inpcbinfo *pcbinfo, struct in6_addr *faddr, u_int fport,
+ struct in6_addr *laddr, u_int lport, int lookupflags, struct ifnet *ifp)
+{
+#if defined(PCBGROUP)
+ struct inpcbgroup *pcbgroup;
+#endif
+
+ KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0,
+ ("%s: invalid lookup flags %d", __func__, lookupflags));
+ KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0,
+ ("%s: LOCKPCB not set", __func__));
+
+#if defined(PCBGROUP)
+ if (in_pcbgroup_enabled(pcbinfo)) {
+ pcbgroup = in6_pcbgroup_bytuple(pcbinfo, laddr, lport, faddr,
+ fport);
+ return (in6_pcblookup_group(pcbinfo, pcbgroup, faddr, fport,
+ laddr, lport, lookupflags, ifp));
+ }
+#endif
+ return (in6_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport,
+ lookupflags, ifp));
+}
+
+struct inpcb *
+in6_pcblookup_mbuf(struct inpcbinfo *pcbinfo, struct in6_addr *faddr,
+ u_int fport, struct in6_addr *laddr, u_int lport, int lookupflags,
+ struct ifnet *ifp, struct mbuf *m)
+{
+#ifdef PCBGROUP
+ struct inpcbgroup *pcbgroup;
+#endif
+
+ KASSERT((lookupflags & ~INPLOOKUP_MASK) == 0,
+ ("%s: invalid lookup flags %d", __func__, lookupflags));
+ KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0,
+ ("%s: LOCKPCB not set", __func__));
+
+#ifdef PCBGROUP
+ if (in_pcbgroup_enabled(pcbinfo)) {
+ pcbgroup = in6_pcbgroup_byhash(pcbinfo, M_HASHTYPE_GET(m),
+ m->m_pkthdr.flowid);
+ if (pcbgroup != NULL)
+ return (in6_pcblookup_group(pcbinfo, pcbgroup, faddr,
+ fport, laddr, lport, lookupflags, ifp));
+ pcbgroup = in6_pcbgroup_bytuple(pcbinfo, laddr, lport, faddr,
+ fport);
+ return (in6_pcblookup_group(pcbinfo, pcbgroup, faddr, fport,
+ laddr, lport, lookupflags, ifp));
+ }
+#endif
+ return (in6_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport,
+ lookupflags, ifp));
+}
+
void
init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m)
{
diff --git a/sys/netinet6/in6_pcb.h b/sys/netinet6/in6_pcb.h
index c54a8cf..8398d54 100644
--- a/sys/netinet6/in6_pcb.h
+++ b/sys/netinet6/in6_pcb.h
@@ -69,10 +69,22 @@
#define sin6tosa(sin6) ((struct sockaddr *)(sin6))
#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa))
+struct inpcbgroup *
+ in6_pcbgroup_byhash(struct inpcbinfo *, u_int, uint32_t);
+struct inpcbgroup *
+ in6_pcbgroup_byinpcb __P((struct inpcb *));
+struct inpcbgroup *
+ in6_pcbgroup_bymbuf(struct inpcbinfo *, struct mbuf *);
+struct inpcbgroup *
+ in6_pcbgroup_bytuple __P((struct inpcbinfo *, const struct in6_addr *,
+ u_short, const struct in6_addr *, u_short));
+
void in6_pcbpurgeif0 __P((struct inpcbinfo *, struct ifnet *));
void in6_losing __P((struct inpcb *));
int in6_pcbbind __P((struct inpcb *, struct sockaddr *, struct ucred *));
int in6_pcbconnect __P((struct inpcb *, struct sockaddr *, struct ucred *));
+int in6_pcbconnect_mbuf __P((struct inpcb *, struct sockaddr *,
+ struct ucred *, struct mbuf *));
void in6_pcbdisconnect __P((struct inpcb *));
int in6_pcbladdr(struct inpcb *, struct sockaddr *, struct in6_addr *);
struct inpcb *
@@ -80,9 +92,17 @@ struct inpcb *
struct in6_addr *, u_short, int,
struct ucred *));
struct inpcb *
- in6_pcblookup_hash __P((struct inpcbinfo *,
- struct in6_addr *, u_int, struct in6_addr *,
- u_int, int, struct ifnet *));
+ in6_pcblookup __P((struct inpcbinfo *, struct in6_addr *,
+ u_int, struct in6_addr *, u_int, int,
+ struct ifnet *));
+struct inpcb *
+ in6_pcblookup_hash_locked __P((struct inpcbinfo *, struct in6_addr *,
+ u_int, struct in6_addr *, u_int, int,
+ struct ifnet *));
+struct inpcb *
+ in6_pcblookup_mbuf __P((struct inpcbinfo *, struct in6_addr *,
+ u_int, struct in6_addr *, u_int, int,
+ struct ifnet *ifp, struct mbuf *));
void in6_pcbnotify __P((struct inpcbinfo *, struct sockaddr *,
u_int, const struct sockaddr *, u_int, int, void *,
struct inpcb *(*)(struct inpcb *, int)));
diff --git a/sys/netinet6/in6_pcbgroup.c b/sys/netinet6/in6_pcbgroup.c
new file mode 100644
index 0000000..850d7f4
--- /dev/null
+++ b/sys/netinet6/in6_pcbgroup.c
@@ -0,0 +1,103 @@
+/*-
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
+ * All rights reserved.
+ *
+ * This software was developed by Robert N. M. Watson under contract
+ * to Juniper Networks, Inc.
+ *
+ * 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 AUTHOR 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 AUTHOR 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 <sys/cdefs.h>
+
+__FBSDID("$FreeBSD$");
+
+#include "opt_inet6.h"
+
+#include <sys/param.h>
+#include <sys/mbuf.h>
+
+#include <netinet/in.h>
+#include <netinet/in_pcb.h>
+#ifdef INET6
+#include <netinet6/in6_pcb.h>
+#endif /* INET6 */
+
+/*
+ * Given a hash of whatever the covered tuple might be, return a pcbgroup
+ * index.
+ */
+static __inline u_int
+in6_pcbgroup_getbucket(struct inpcbinfo *pcbinfo, uint32_t hash)
+{
+
+ return (hash % pcbinfo->ipi_npcbgroups);
+}
+
+/*
+ * Map a (hashtype, hash) tuple into a connection group, or NULL if the hash
+ * information is insufficient to identify the pcbgroup.
+ */
+struct inpcbgroup *
+in6_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash)
+{
+
+ return (NULL);
+}
+
+struct inpcbgroup *
+in6_pcbgroup_bymbuf(struct inpcbinfo *pcbinfo, struct mbuf *m)
+{
+
+ return (in6_pcbgroup_byhash(pcbinfo, M_HASHTYPE_GET(m),
+ m->m_pkthdr.flowid));
+}
+
+struct inpcbgroup *
+in6_pcbgroup_bytuple(struct inpcbinfo *pcbinfo, const struct in6_addr *laddrp,
+ u_short lport, const struct in6_addr *faddrp, u_short fport)
+{
+ uint32_t hash;
+
+ switch (pcbinfo->ipi_hashfields) {
+ case IPI_HASHFIELDS_4TUPLE:
+ hash = faddrp->s6_addr32[3] ^ fport;
+ break;
+
+ case IPI_HASHFIELDS_2TUPLE:
+ hash = faddrp->s6_addr32[3] ^ laddrp->s6_addr32[3];
+ break;
+
+ default:
+ hash = 0;
+ }
+ return (&pcbinfo->ipi_pcbgroups[in6_pcbgroup_getbucket(pcbinfo,
+ hash)]);
+}
+
+struct inpcbgroup *
+in6_pcbgroup_byinpcb(struct inpcb *inp)
+{
+
+ return (in6_pcbgroup_bytuple(inp->inp_pcbinfo, &inp->in6p_laddr,
+ inp->inp_lport, &inp->in6p_faddr, inp->inp_fport));
+}
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
index acd1569..9e78e9a 100644
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -133,6 +133,7 @@ __FBSDID("$FreeBSD$");
/*
* TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
*/
+FEATURE(inet6, "Internet Protocol version 6");
extern struct domain inet6domain;
static struct pr_usrreqs nousrreqs;
@@ -408,6 +409,8 @@ VNET_DEFINE(int, ip6_sendredirects) = IPV6_SENDREDIRECTS;
VNET_DEFINE(int, ip6_defhlim) = IPV6_DEFHLIM;
VNET_DEFINE(int, ip6_defmcasthlim) = IPV6_DEFAULT_MULTICAST_HOPS;
VNET_DEFINE(int, ip6_accept_rtadv) = 0;
+VNET_DEFINE(int, ip6_no_radr) = 0;
+VNET_DEFINE(int, ip6_norbit_raif) = 0;
VNET_DEFINE(int, ip6_maxfragpackets); /* initialized in frag6.c:frag6_init() */
VNET_DEFINE(int, ip6_maxfrags); /* initialized in frag6.c:frag6_init() */
VNET_DEFINE(int, ip6_log_interval) = 5;
@@ -536,6 +539,15 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv,
CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0,
"Default value of per-interface flag for accepting ICMPv6 Router"
"Advertisement messages");
+SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_NO_RADR, no_radr,
+ CTLFLAG_RW, &VNET_NAME(ip6_no_radr), 0,
+ "Default value of per-interface flag to control whether routers "
+ "sending ICMPv6 RA messages on that interface are added into the "
+ "default router list.");
+SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_NORBIT_RAIF, norbit_raif, CTLFLAG_RW,
+ &VNET_NAME(ip6_norbit_raif), 0,
+ "Always set 0 to R flag in ICMPv6 NA messages when accepting RA"
+ " on the interface.");
SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH, keepfaith, CTLFLAG_RW,
&VNET_NAME(ip6_keepfaith), 0, "");
SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL, log_interval,
diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c
index 5202e09..c802bfc 100644
--- a/sys/netinet6/in6_src.c
+++ b/sys/netinet6/in6_src.c
@@ -856,8 +856,8 @@ in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred)
struct inpcbinfo *pcbinfo = inp->inp_pcbinfo;
#endif
- INP_INFO_WLOCK_ASSERT(pcbinfo);
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(pcbinfo);
error = prison_local_ip6(cred, laddr,
((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0));
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 052b8f6..de3a622 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -504,6 +504,13 @@ ip6_input(struct mbuf *m)
goto bad;
}
#endif
+#ifdef IPSEC
+ /*
+ * Bypass packet filtering for packets previously handled by IPsec.
+ */
+ if (ip6_ipsec_filtertunnel(m))
+ goto passin;
+#endif /* IPSEC */
/*
* Run through list of hooks for input packets.
diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c
index 8731e12..bbbc9c9 100644
--- a/sys/netinet6/ip6_ipsec.c
+++ b/sys/netinet6/ip6_ipsec.c
@@ -97,7 +97,7 @@ SYSCTL_VNET_INT(_net_inet6_ipsec6, OID_AUTO,
/*
* Check if we have to jump over firewall processing for this packet.
- * Called from ip_input().
+ * Called from ip6_input().
* 1 = jump over firewall, 0 = packet goes through firewall.
*/
int
@@ -106,7 +106,7 @@ ip6_ipsec_filtertunnel(struct mbuf *m)
#if defined(IPSEC)
/*
- * Bypass packet filtering for packets from a tunnel.
+ * Bypass packet filtering for packets previously handled by IPsec.
*/
if (!V_ip6_ipsec6_filtertunnel &&
m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL)
@@ -118,7 +118,7 @@ ip6_ipsec_filtertunnel(struct mbuf *m)
/*
* Check if this packet has an active SA and needs to be dropped instead
* of forwarded.
- * Called from ip_input().
+ * Called from ip6_input().
* 1 = drop packet, 0 = forward packet.
*/
int
@@ -141,7 +141,7 @@ ip6_ipsec_fwd(struct mbuf *m)
if (sp == NULL) { /* NB: can happen if error */
splx(s);
/*XXX error stat???*/
- DPRINTF(("ip_input: no SP for forwarding\n")); /*XXX*/
+ DPRINTF(("%s: no SP for forwarding\n", __func__)); /*XXX*/
return 1;
}
@@ -163,7 +163,7 @@ ip6_ipsec_fwd(struct mbuf *m)
* Check if protocol type doesn't have a further header and do IPSEC
* decryption or reject right now. Protocols with further headers get
* their IPSEC treatment within the protocol specific processing.
- * Called from ip_input().
+ * Called from ip6_input().
* 1 = drop packet, 0 = continue processing packet.
*/
int
@@ -206,7 +206,7 @@ ip6_ipsec_input(struct mbuf *m, int nxt)
} else {
/* XXX error stat??? */
error = EINVAL;
- DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/
+ DPRINTF(("%s: no SP, packet discarded\n", __func__));/*XXX*/
return 1;
}
splx(s);
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
index 4e44d9f..dbfba9a 100644
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -316,6 +316,9 @@ VNET_DECLARE(int, ip6_maxfragpackets); /* Maximum packets in reassembly
VNET_DECLARE(int, ip6_maxfrags); /* Maximum fragments in reassembly
* queue */
VNET_DECLARE(int, ip6_accept_rtadv); /* Acts as a host not a router */
+VNET_DECLARE(int, ip6_no_radr); /* No defroute from RA */
+VNET_DECLARE(int, ip6_norbit_raif); /* Disable R-bit in NA on RA
+ * receiving IF. */
VNET_DECLARE(int, ip6_keepfaith); /* Firewall Aided Internet Translator */
VNET_DECLARE(int, ip6_log_interval);
VNET_DECLARE(time_t, ip6_log_time);
@@ -327,6 +330,8 @@ VNET_DECLARE(int, ip6_dad_count); /* DupAddrDetectionTransmits */
#define V_ip6_maxfragpackets VNET(ip6_maxfragpackets)
#define V_ip6_maxfrags VNET(ip6_maxfrags)
#define V_ip6_accept_rtadv VNET(ip6_accept_rtadv)
+#define V_ip6_no_radr VNET(ip6_no_radr)
+#define V_ip6_norbit_raif VNET(ip6_norbit_raif)
#define V_ip6_keepfaith VNET(ip6_keepfaith)
#define V_ip6_log_interval VNET(ip6_log_interval)
#define V_ip6_log_time VNET(ip6_log_time)
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index f1e48ea..2b51e43 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -193,6 +193,8 @@ nd6_ifattach(struct ifnet *ifp)
/* A loopback interface does not need to accept RTADV. */
if (V_ip6_accept_rtadv && !(ifp->if_flags & IFF_LOOPBACK))
nd->flags |= ND6_IFF_ACCEPT_RTADV;
+ if (V_ip6_no_radr && !(ifp->if_flags & IFF_LOOPBACK))
+ nd->flags |= ND6_IFF_NO_RADR;
/* XXX: we cannot call nd6_setmtu since ifp is not fully initialized */
nd6_setmtu0(ifp, nd);
@@ -825,7 +827,7 @@ nd6_purge(struct ifnet *ifp)
if (V_nd6_defifindex == ifp->if_index)
nd6_setdefaultiface(0);
- if (!V_ip6_forwarding && ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) {
+ if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) {
/* Refresh default router list. */
defrouter_select();
}
@@ -958,10 +960,9 @@ nd6_is_new_addr_neighbor(struct sockaddr_in6 *addr, struct ifnet *ifp)
/*
* If the default router list is empty, all addresses are regarded
* as on-link, and thus, as a neighbor.
- * XXX: we restrict the condition to hosts, because routers usually do
- * not have the "default router list".
*/
- if (!V_ip6_forwarding && TAILQ_FIRST(&V_nd_defrouter) == NULL &&
+ if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV &&
+ TAILQ_FIRST(&V_nd_defrouter) == NULL &&
V_nd6_defifindex == ifp->if_index) {
return (1);
}
@@ -1022,8 +1023,7 @@ nd6_free(struct llentry *ln, int gc)
ifp = ln->lle_tbl->llt_ifp;
- if (!V_ip6_forwarding) {
-
+ if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) {
dr = defrouter_lookup(&L3_ADDR_SIN6(ln)->sin6_addr, ifp);
if (dr != NULL && dr->expire &&
@@ -1322,6 +1322,16 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
struct ifaddr *ifa;
struct in6_ifaddr *ia;
+ /*
+ * Try to clear ifdisabled flag when enabling
+ * accept_rtadv or auto_linklocal.
+ */
+ if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
+ !(ND.flags & ND6_IFF_IFDISABLED) &&
+ (ND.flags & (ND6_IFF_ACCEPT_RTADV |
+ ND6_IFF_AUTO_LINKLOCAL)))
+ ND.flags &= ~ND6_IFF_IFDISABLED;
+
if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
!(ND.flags & ND6_IFF_IFDISABLED)) {
/* ifdisabled 1->0 transision */
@@ -1340,7 +1350,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
continue;
ia = (struct in6_ifaddr *)ifa;
if ((ia->ia6_flags & IN6_IFF_DUPLICATED) &&
- IN6_IS_ADDR_LINKLOCAL(&ia->ia_addr.sin6_addr)) {
+ IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia))) {
duplicated_linklocal = 1;
break;
}
@@ -1379,6 +1389,28 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
/* If no link-local address on ifp, configure */
ND_IFINFO(ifp)->flags |= ND6_IFF_AUTO_LINKLOCAL;
in6_ifattach(ifp, NULL);
+ } else if ((ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) &&
+ !(ND.flags & ND6_IFF_IFDISABLED)) {
+ /*
+ * When the IF already has
+ * ND6_IFF_AUTO_LINKLOCAL and no link-local
+ * address is assigned, try to assign one.
+ */
+ int haslinklocal = 0;
+
+ IF_ADDR_LOCK(ifp);
+ TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ if (ifa->ifa_addr->sa_family != AF_INET6)
+ continue;
+ ia = (struct in6_ifaddr *)ifa;
+ if (IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia))) {
+ haslinklocal = 1;
+ break;
+ }
+ }
+ IF_ADDR_UNLOCK(ifp);
+ if (!haslinklocal)
+ in6_ifattach(ifp, NULL);
}
}
ND_IFINFO(ifp)->flags = ND.flags;
@@ -1718,7 +1750,7 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *from, char *lladdr,
* for those are not autoconfigured hosts, we explicitly avoid such
* cases for safety.
*/
- if (do_update && router && !V_ip6_forwarding &&
+ if (do_update && router &&
ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV) {
/*
* guaranteed recursion
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index abcfcb7..6f63192 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -85,6 +85,7 @@ struct nd_ifinfo {
*/
#define ND6_IFF_DONT_SET_IFROUTE 0x10
#define ND6_IFF_AUTO_LINKLOCAL 0x20
+#define ND6_IFF_NO_RADR 0x40
#define ND6_CREATE LLE_CREATE
#define ND6_EXCLUSIVE LLE_EXCLUSIVE
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index fd5bcf2..fb8e379 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -112,10 +112,14 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
int lladdrlen = 0;
int anycast = 0, proxy = 0, tentative = 0;
int tlladdr;
+ int rflag;
union nd_opts ndopts;
struct sockaddr_dl proxydl;
char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
+ rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0;
+ if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif)
+ rflag = 0;
#ifndef PULLDOWN_TEST
IP6_EXTHDR_CHECK(m, off, icmp6len,);
nd_ns = (struct nd_neighbor_solicit *)((caddr_t)ip6 + off);
@@ -339,8 +343,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
goto bad;
nd6_na_output(ifp, &in6_all, &taddr6,
((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) |
- (V_ip6_forwarding ? ND_NA_FLAG_ROUTER : 0),
- tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL);
+ rflag, tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL);
goto freeit;
}
@@ -349,8 +352,8 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
nd6_na_output(ifp, &saddr6, &taddr6,
((anycast || proxy || !tlladdr) ? 0 : ND_NA_FLAG_OVERRIDE) |
- (V_ip6_forwarding ? ND_NA_FLAG_ROUTER : 0) | ND_NA_FLAG_SOLICITED,
- tlladdr, proxy ? (struct sockaddr *)&proxydl : NULL);
+ rflag | ND_NA_FLAG_SOLICITED, tlladdr,
+ proxy ? (struct sockaddr *)&proxydl : NULL);
freeit:
if (ifa != NULL)
ifa_free(ifa);
@@ -862,7 +865,8 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len)
dr = defrouter_lookup(in6, ln->lle_tbl->llt_ifp);
if (dr)
defrtrlist_del(dr);
- else if (!V_ip6_forwarding) {
+ else if (ND_IFINFO(ln->lle_tbl->llt_ifp)->flags &
+ ND6_IFF_ACCEPT_RTADV) {
/*
* Even if the neighbor is not in the default
* router list, the neighbor may be used
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 19ec989..e791e2e 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -127,8 +127,11 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len)
union nd_opts ndopts;
char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
- /* If I'm not a router, ignore it. */
- if (!V_ip6_forwarding)
+ /*
+ * Accept RS only when V_ip6_forwarding=1 and the interface has
+ * no ND6_IFF_ACCEPT_RTADV.
+ */
+ if (!V_ip6_forwarding || ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV)
goto freeit;
/* Sanity checks */
@@ -213,11 +216,10 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len)
char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
/*
- * We only accept RAs only when
- * the node is not a router and
- * per-interface variable allows RAs on the receiving interface.
+ * We only accept RAs only when the per-interface flag
+ * ND6_IFF_ACCEPT_RTADV is on the receiving interface.
*/
- if (V_ip6_forwarding || !(ndi->flags & ND6_IFF_ACCEPT_RTADV))
+ if (!(ndi->flags & ND6_IFF_ACCEPT_RTADV))
goto freeit;
if (ip6->ip6_hlim != 255) {
@@ -266,7 +268,15 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len)
bzero(&dr0, sizeof(dr0));
dr0.rtaddr = saddr6;
dr0.flags = nd_ra->nd_ra_flags_reserved;
- dr0.rtlifetime = ntohs(nd_ra->nd_ra_router_lifetime);
+ /*
+ * Effectively-disable the route in the RA packet
+ * when ND6_IFF_NO_RADR on the receiving interface or
+ * ip6.forwarding=1.
+ */
+ if (ndi->flags & ND6_IFF_NO_RADR || V_ip6_forwarding)
+ dr0.rtlifetime = 0;
+ else
+ dr0.rtlifetime = ntohs(nd_ra->nd_ra_router_lifetime);
dr0.expire = time_second + dr0.rtlifetime;
dr0.ifp = ifp;
/* unspecified or not? (RFC 2461 6.3.4) */
@@ -557,7 +567,7 @@ defrtrlist_del(struct nd_defrouter *dr)
* Flush all the routing table entries that use the router
* as a next hop.
*/
- if (!V_ip6_forwarding)
+ if (ND_IFINFO(dr->ifp)->flags & ND6_IFF_ACCEPT_RTADV)
rt6_flush(&dr->rtaddr, dr->ifp);
if (dr->installed) {
@@ -616,20 +626,6 @@ defrouter_select(void)
struct llentry *ln = NULL;
/*
- * This function should be called only when acting as an autoconfigured
- * host. Although the remaining part of this function is not effective
- * if the node is not an autoconfigured host, we explicitly exclude
- * such cases here for safety.
- */
- if (V_ip6_forwarding) {
- nd6log((LOG_WARNING,
- "defrouter_select: called unexpectedly (forwarding=%d)\n",
- V_ip6_forwarding));
- splx(s);
- return;
- }
-
- /*
* Let's handle easy case (3) first:
* If default router list is empty, there's nothing to be done.
*/
diff --git a/sys/netinet6/send.h b/sys/netinet6/send.h
index 36ba571..9795d14 100644
--- a/sys/netinet6/send.h
+++ b/sys/netinet6/send.h
@@ -33,7 +33,7 @@
#define SND_IN 1 /* Incoming traffic. */
struct sockaddr_send {
- unsigned char send_len; /* total length */
+ uint8_t send_len; /* total length */
sa_family_t send_family; /* address family */
int send_direction;
int send_ifidx;
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index d574c19..6723007 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -1,7 +1,11 @@
/*-
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
* All rights reserved.
*
+ * Portions of this software were developed by Robert N. M. Watson under
+ * contract to Juniper Networks, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -231,11 +235,11 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
init_sin6(&fromsa, m);
fromsa.sin6_port = uh->uh_sport;
- INP_INFO_RLOCK(&V_udbinfo);
if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
struct inpcb *last;
struct ip6_moptions *imo;
+ INP_INFO_RLOCK(&V_udbinfo);
/*
* In the event that laddr should be set to the link-local
* address (this happens in RIPng), the multicast address
@@ -273,6 +277,13 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
}
/*
+ * XXXRW: Because we weren't holding either the inpcb
+ * or the hash lock when we checked for a match
+ * before, we should probably recheck now that the
+ * inpcb lock is (supposed to be) held.
+ */
+
+ /*
* Handle socket delivery policy for any-source
* and source-specific multicast. [RFC3678]
*/
@@ -366,8 +377,9 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
/*
* Locate pcb for datagram.
*/
- inp = in6_pcblookup_hash(&V_udbinfo, &ip6->ip6_src, uh->uh_sport,
- &ip6->ip6_dst, uh->uh_dport, 1, m->m_pkthdr.rcvif);
+ inp = in6_pcblookup_mbuf(&V_udbinfo, &ip6->ip6_src, uh->uh_sport,
+ &ip6->ip6_dst, uh->uh_dport, INPLOOKUP_WILDCARD |
+ INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif, m);
if (inp == NULL) {
if (udp_log_in_vain) {
char ip6bufs[INET6_ADDRSTRLEN];
@@ -384,9 +396,8 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
if (m->m_flags & M_MCAST) {
printf("UDP6: M_MCAST is set in a unicast packet.\n");
UDPSTAT_INC(udps_noportmcast);
- goto badheadlocked;
+ goto badunlocked;
}
- INP_INFO_RUNLOCK(&V_udbinfo);
if (V_udp_blackhole)
goto badunlocked;
if (badport_bandlim(BANDLIM_ICMP6_UNREACH) < 0)
@@ -394,8 +405,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOPORT, 0);
return (IPPROTO_DONE);
}
- INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&V_udbinfo);
+ INP_RLOCK_ASSERT(inp);
up = intoudpcb(inp);
if (up->u_tun_func == NULL) {
udp6_append(inp, m, off, &fromsa);
@@ -505,13 +515,11 @@ udp6_getcred(SYSCTL_HANDLER_ARGS)
(error = sa6_embedscope(&addrs[1], V_ip6_use_defzone)) != 0) {
return (error);
}
- INP_INFO_RLOCK(&V_udbinfo);
- inp = in6_pcblookup_hash(&V_udbinfo, &addrs[1].sin6_addr,
- addrs[1].sin6_port, &addrs[0].sin6_addr, addrs[0].sin6_port, 1,
- NULL);
+ inp = in6_pcblookup(&V_udbinfo, &addrs[1].sin6_addr,
+ addrs[1].sin6_port, &addrs[0].sin6_addr, addrs[0].sin6_port,
+ INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL);
if (inp != NULL) {
- INP_RLOCK(inp);
- INP_INFO_RUNLOCK(&V_udbinfo);
+ INP_RLOCK_ASSERT(inp);
if (inp->inp_socket == NULL)
error = ENOENT;
if (error == 0)
@@ -520,10 +528,8 @@ udp6_getcred(SYSCTL_HANDLER_ARGS)
if (error == 0)
cru2x(inp->inp_cred, &xuc);
INP_RUNLOCK(inp);
- } else {
- INP_INFO_RUNLOCK(&V_udbinfo);
+ } else
error = ENOENT;
- }
if (error == 0)
error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred));
return (error);
@@ -552,6 +558,7 @@ udp6_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr6,
struct sockaddr_in6 tmp;
INP_WLOCK_ASSERT(inp);
+ INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo);
if (addr6) {
/* addr6 has been validated in udp6_send(). */
@@ -772,15 +779,15 @@ udp6_abort(struct socket *so)
}
#endif
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
+ INP_HASH_WLOCK(&V_udbinfo);
in6_pcbdisconnect(inp);
inp->in6p_laddr = in6addr_any;
+ INP_HASH_WUNLOCK(&V_udbinfo);
soisdisconnected(so);
}
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
}
static int
@@ -838,8 +845,8 @@ udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_bind: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
+ INP_HASH_WLOCK(&V_udbinfo);
inp->inp_vflag &= ~INP_IPV4;
inp->inp_vflag |= INP_IPV6;
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) {
@@ -867,8 +874,8 @@ udp6_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
#ifdef INET
out:
#endif
+ INP_HASH_WUNLOCK(&V_udbinfo);
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (error);
}
@@ -889,15 +896,15 @@ udp6_close(struct socket *so)
return;
}
#endif
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
+ INP_HASH_WLOCK(&V_udbinfo);
in6_pcbdisconnect(inp);
inp->in6p_laddr = in6addr_any;
+ INP_HASH_WUNLOCK(&V_udbinfo);
soisdisconnected(so);
}
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
}
static int
@@ -911,7 +918,9 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
sin6 = (struct sockaddr_in6 *)nam;
KASSERT(inp != NULL, ("udp6_connect: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
+ /*
+ * XXXRW: Need to clarify locking of v4/v6 flags.
+ */
INP_WLOCK(inp);
#ifdef INET
if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
@@ -931,8 +940,10 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
error = prison_remote_ip4(td->td_ucred, &sin.sin_addr);
if (error != 0)
goto out;
+ INP_HASH_WLOCK(&V_udbinfo);
error = in_pcbconnect(inp, (struct sockaddr *)&sin,
td->td_ucred);
+ INP_HASH_WUNLOCK(&V_udbinfo);
if (error == 0)
soisconnected(so);
goto out;
@@ -947,12 +958,13 @@ udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
error = prison_remote_ip6(td->td_ucred, &sin6->sin6_addr);
if (error != 0)
goto out;
+ INP_HASH_WLOCK(&V_udbinfo);
error = in6_pcbconnect(inp, nam, td->td_ucred);
+ INP_HASH_WUNLOCK(&V_udbinfo);
if (error == 0)
soisconnected(so);
out:
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (error);
}
@@ -984,32 +996,32 @@ udp6_disconnect(struct socket *so)
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_disconnect: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
- INP_WLOCK(inp);
-
#ifdef INET
if (inp->inp_vflag & INP_IPV4) {
struct pr_usrreqs *pru;
pru = inetsw[ip_protox[IPPROTO_UDP]].pr_usrreqs;
- error = (*pru->pru_disconnect)(so);
- goto out;
+ (void)(*pru->pru_disconnect)(so);
+ return (0);
}
#endif
+ INP_WLOCK(inp);
+
if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
error = ENOTCONN;
goto out;
}
+ INP_HASH_WLOCK(&V_udbinfo);
in6_pcbdisconnect(inp);
inp->in6p_laddr = in6addr_any;
+ INP_HASH_WUNLOCK(&V_udbinfo);
SOCK_LOCK(so);
so->so_state &= ~SS_ISCONNECTED; /* XXX */
SOCK_UNLOCK(so);
out:
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (0);
}
@@ -1023,7 +1035,6 @@ udp6_send(struct socket *so, int flags, struct mbuf *m,
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("udp6_send: inp == NULL"));
- INP_INFO_WLOCK(&V_udbinfo);
INP_WLOCK(inp);
if (addr) {
if (addr->sa_len != sizeof(struct sockaddr_in6)) {
@@ -1060,7 +1071,6 @@ udp6_send(struct socket *so, int flags, struct mbuf *m,
* select the UDPv4 output routine are invalidated?
*/
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
if (sin6)
in6_sin6_2_sin_in_sock(addr);
pru = inetsw[ip_protox[IPPROTO_UDP]].pr_usrreqs;
@@ -1073,16 +1083,16 @@ udp6_send(struct socket *so, int flags, struct mbuf *m,
#ifdef MAC
mac_inpcb_create_mbuf(inp, m);
#endif
+ INP_HASH_WLOCK(&V_udbinfo);
error = udp6_output(inp, m, addr, control, td);
+ INP_HASH_WUNLOCK(&V_udbinfo);
#ifdef INET
#endif
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
return (error);
bad:
INP_WUNLOCK(inp);
- INP_INFO_WUNLOCK(&V_udbinfo);
m_freem(m);
return (error);
}
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 9a777c8..da8a2ec 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -300,7 +300,7 @@ nfs_putpages(struct vop_putpages_args *ap)
}
for (i = 0; i < npages; i++)
- rtvals[i] = VM_PAGER_AGAIN;
+ rtvals[i] = VM_PAGER_ERROR;
/*
* When putting pages, do not extend file past EOF.
@@ -344,11 +344,7 @@ nfs_putpages(struct vop_putpages_args *ap)
relpbuf(bp, &nfs_pbuf_freecnt);
if (!error) {
- int nwritten = round_page(count - uio.uio_resid) / PAGE_SIZE;
- for (i = 0; i < nwritten; i++) {
- rtvals[i] = VM_PAGER_OK;
- vm_page_undirty(pages[i]);
- }
+ vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
if (must_commit) {
nfs_clearcommit(vp->v_mount);
}
diff --git a/sys/nfsclient/nfs_krpc.c b/sys/nfsclient/nfs_krpc.c
index 242d425..171f7aa 100644
--- a/sys/nfsclient/nfs_krpc.c
+++ b/sys/nfsclient/nfs_krpc.c
@@ -306,9 +306,7 @@ nfs_disconnect(struct nfsmount *nmp)
client = nmp->nm_client;
nmp->nm_client = NULL;
mtx_unlock(&nmp->nm_mtx);
-#ifdef KGSSAPI
- rpc_gss_secpurge(client);
-#endif
+ rpc_gss_secpurge_call(client);
CLNT_CLOSE(client);
CLNT_RELEASE(client);
} else
@@ -325,18 +323,15 @@ nfs_safedisconnect(struct nfsmount *nmp)
static AUTH *
nfs_getauth(struct nfsmount *nmp, struct ucred *cred)
{
-#ifdef KGSSAPI
rpc_gss_service_t svc;
AUTH *auth;
-#endif
switch (nmp->nm_secflavor) {
-#ifdef KGSSAPI
case RPCSEC_GSS_KRB5:
case RPCSEC_GSS_KRB5I:
case RPCSEC_GSS_KRB5P:
if (!nmp->nm_mech_oid)
- if (!rpc_gss_mech_to_oid("kerberosv5",
+ if (!rpc_gss_mech_to_oid_call("kerberosv5",
&nmp->nm_mech_oid))
return (NULL);
if (nmp->nm_secflavor == RPCSEC_GSS_KRB5)
@@ -345,12 +340,11 @@ nfs_getauth(struct nfsmount *nmp, struct ucred *cred)
svc = rpc_gss_svc_integrity;
else
svc = rpc_gss_svc_privacy;
- auth = rpc_gss_secfind(nmp->nm_client, cred,
+ auth = rpc_gss_secfind_call(nmp->nm_client, cred,
nmp->nm_principal, nmp->nm_mech_oid, svc);
if (auth)
return (auth);
/* fallthrough */
-#endif
case AUTH_SYS:
default:
return (authunix_create(cred));
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 79659d0..8498ee4 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -1408,10 +1408,20 @@ nfs_sync(struct mount *mp, int waitfor)
td = curthread;
+ MNT_ILOCK(mp);
+ /*
+ * If a forced dismount is in progress, return from here so that
+ * the umount(2) syscall doesn't get stuck in VFS_SYNC() before
+ * calling VFS_UNMOUNT().
+ */
+ if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
+ MNT_IUNLOCK(mp);
+ return (EBADF);
+ }
+
/*
* Force stale buffer cache information to be flushed.
*/
- MNT_ILOCK(mp);
loop:
MNT_VNODE_FOREACH(vp, mp, mvp) {
VI_LOCK(vp);
diff --git a/sys/nfsserver/nfs_srvkrpc.c b/sys/nfsserver/nfs_srvkrpc.c
index 512373b..3c60825 100644
--- a/sys/nfsserver/nfs_srvkrpc.c
+++ b/sys/nfsserver/nfs_srvkrpc.c
@@ -418,12 +418,9 @@ nfssvc_addsock(struct file *fp, struct thread *td)
static int
nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
{
-#ifdef KGSSAPI
char principal[128];
int error;
-#endif
-#ifdef KGSSAPI
if (args) {
error = copyinstr(args->principal, principal,
sizeof(principal), NULL);
@@ -434,7 +431,6 @@ nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
getcredhostname(td->td_ucred, principal + 4,
sizeof(principal) - 4);
}
-#endif
/*
* Only the first nfsd actually does any work. The RPC code
@@ -449,12 +445,10 @@ nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
NFSD_UNLOCK();
-#ifdef KGSSAPI
- rpc_gss_set_svc_name(principal, "kerberosv5",
+ rpc_gss_set_svc_name_call(principal, "kerberosv5",
GSS_C_INDEFINITE, NFS_PROG, NFS_VER2);
- rpc_gss_set_svc_name(principal, "kerberosv5",
+ rpc_gss_set_svc_name_call(principal, "kerberosv5",
GSS_C_INDEFINITE, NFS_PROG, NFS_VER3);
-#endif
if (args) {
nfsrv_pool->sp_minthreads = args->minthreads;
@@ -466,10 +460,8 @@ nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
svc_run(nfsrv_pool);
-#ifdef KGSSAPI
- rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2);
- rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3);
-#endif
+ rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2);
+ rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3);
NFSD_LOCK();
nfsrv_numnfsd--;
diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 2d0fd61..4aaf216 100644
--- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -554,8 +554,8 @@ void ipoib_cm_handle_rx_wc(struct ipoib_dev_priv *priv, struct ib_wc *wc)
ipoib_dma_mb(priv, mb, wc->byte_len);
- ++dev->if_opackets;
- dev->if_obytes += mb->m_pkthdr.len;
+ ++dev->if_ipackets;
+ dev->if_ibytes += mb->m_pkthdr.len;
mb->m_pkthdr.rcvif = dev;
proto = *mtod(mb, uint16_t *);
diff --git a/sys/ofed/include/linux/list.h b/sys/ofed/include/linux/list.h
index f6f9404..61b42d2 100644
--- a/sys/ofed/include/linux/list.h
+++ b/sys/ofed/include/linux/list.h
@@ -38,6 +38,7 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/queue.h>
+#include <sys/cpuset.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
diff --git a/sys/pc98/conf/GENERIC b/sys/pc98/conf/GENERIC
index 0fac1a9..e2bed44 100644
--- a/sys/pc98/conf/GENERIC
+++ b/sys/pc98/conf/GENERIC
@@ -139,12 +139,6 @@ device sc
# Add suspend/resume support for the i8254.
#device pmtimer
-# Audio support
-#device sound # Generic sound driver
-#device snd_mss # Microsoft Sound System
-#device "snd_sb16" # Sound Blaster 16
-#device snd_sbc # Sound Blaster
-
# PCCARD (PCMCIA) support
# PCMCIA and cardbus bridge support
device cbb # cardbus (yenta) bridge
@@ -288,3 +282,10 @@ device bpf # Berkeley packet filter
#device firewire # FireWire bus code
#device sbp # SCSI over FireWire (Requires scbus and da)
#device fwe # Ethernet over FireWire (non-standard!)
+
+# Sound support
+#device sound # Generic sound driver (required)
+#device snd_mss # Microsoft Sound System
+#device "snd_sb16" # Sound Blaster 16
+#device snd_sbc # Sound Blaster
+#device snd_uaudio # USB Audio
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 853ac69..8bcb618 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include "opt_isa.h"
#include "opt_kstack_pages.h"
#include "opt_maxmem.h"
+#include "opt_mp_watchdog.h"
#include "opt_npx.h"
#include "opt_perfmon.h"
@@ -115,6 +116,7 @@ __FBSDID("$FreeBSD$");
#include <machine/intr_machdep.h>
#include <x86/mca.h>
#include <machine/md_var.h>
+#include <machine/mp_watchdog.h>
#include <machine/pc/bios.h>
#include <machine/pcb.h>
#include <machine/pcb_ext.h>
@@ -1193,9 +1195,8 @@ cpu_idle(int busy)
CTR2(KTR_SPARE2, "cpu_idle(%d) at %d",
busy, curcpu);
-#ifdef SMP
- if (mp_grab_cpu_hlt())
- return;
+#ifdef MP_WATCHDOG
+ ap_watchdog(PCPU_GET(cpuid));
#endif
/* If we are busy - try to use fast methods. */
if (busy) {
diff --git a/sys/powerpc/aim/interrupt.c b/sys/powerpc/aim/interrupt.c
index b06fb92..d1e3655 100644
--- a/sys/powerpc/aim/interrupt.c
+++ b/sys/powerpc/aim/interrupt.c
@@ -100,10 +100,8 @@ powerpc_interrupt(struct trapframe *framep)
default:
/* Re-enable interrupts if applicable. */
ee = framep->srr1 & PSL_EE;
- if (ee != 0) {
+ if (ee != 0)
mtmsr(mfmsr() | ee);
- isync();
- }
trap(framep);
}
}
diff --git a/sys/powerpc/aim/locore32.S b/sys/powerpc/aim/locore32.S
index 64bf81e..35ea99b 100644
--- a/sys/powerpc/aim/locore32.S
+++ b/sys/powerpc/aim/locore32.S
@@ -87,9 +87,6 @@ GLOBAL(tmpstk)
GLOBAL(esym)
.long 0 /* end of symbol table */
-GLOBAL(ofmsr)
- .long 0, 0, 0, 0, 0 /* msr/sprg0-3 used in Open Firmware */
-
#define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */
GLOBAL(intrnames)
.space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2
@@ -99,16 +96,6 @@ GLOBAL(intrcnt)
.space INTRCNT_COUNT * 4 * 2
GLOBAL(eintrcnt)
-/*
- * File-scope for locore.S
- */
-idle_u:
- .long 0 /* fake uarea during idle after exit */
-openfirmware_entry:
- .long 0 /* Open Firmware entry point */
-srsave:
- .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-
.text
.globl btext
btext:
diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S
index acdc8a1..c200b4c 100644
--- a/sys/powerpc/aim/locore64.S
+++ b/sys/powerpc/aim/locore64.S
@@ -75,8 +75,7 @@
.globl kernbase
.set kernbase, KERNBASE
-#define TMPSTKSZ 8192 /* 8K temporary stack */
-#define OFWSTKSZ 4096 /* 4K Open Firmware stack */
+#define TMPSTKSZ 16384 /* 16K temporary stack */
/*
* Globals
@@ -85,14 +84,9 @@
.align 4
GLOBAL(tmpstk)
.space TMPSTKSZ
-GLOBAL(ofwstk)
- .space OFWSTKSZ
GLOBAL(esym)
.llong 0 /* end of symbol table */
-GLOBAL(ofmsr)
- .llong 0, 0, 0, 0, 0 /* msr/sprg0-3 used in Open Firmware */
-
#define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */
GLOBAL(intrnames)
.space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2
@@ -102,16 +96,6 @@ GLOBAL(intrcnt)
.space INTRCNT_COUNT * 4 * 2
GLOBAL(eintrcnt)
-/*
- * File-scope for locore.S
- */
-idle_u:
- .llong 0 /* fake uarea during idle after exit */
-openfirmware_entry:
- .llong 0 /* Open Firmware entry point */
-srsave:
- .llong 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-
.text
.globl btext
btext:
@@ -208,122 +192,6 @@ tocbase:
.llong .TOC.@tocbase
/*
- * Open Firmware Real-mode Entry Point. This is a huge pain.
- */
-
-ASENTRY(ofw_32bit_mode_entry)
- mflr %r0
- std %r0,16(%r1)
- stdu %r1,-208(%r1)
-
- /*
- * We need to save the following, because OF's register save/
- * restore code assumes that the contents of registers are
- * at most 32 bits wide: lr, cr, r2, r13-r31, the old MSR. These
- * get placed in that order in the stack.
- */
-
- mfcr %r4
- std %r4,48(%r1)
- std %r13,56(%r1)
- std %r14,64(%r1)
- std %r15,72(%r1)
- std %r16,80(%r1)
- std %r17,88(%r1)
- std %r18,96(%r1)
- std %r19,104(%r1)
- std %r20,112(%r1)
- std %r21,120(%r1)
- std %r22,128(%r1)
- std %r23,136(%r1)
- std %r24,144(%r1)
- std %r25,152(%r1)
- std %r26,160(%r1)
- std %r27,168(%r1)
- std %r28,176(%r1)
- std %r29,184(%r1)
- std %r30,192(%r1)
- std %r31,200(%r1)
-
- /* Record the old MSR */
- mfmsr %r6
-
- /* read client interface handler */
- lis %r4,openfirmware_entry@ha
- ld %r4,openfirmware_entry@l(%r4)
-
- /*
- * Set the MSR to the OF value. This has the side effect of disabling
- * exceptions, which is important for the next few steps.
- */
-
- lis %r5,ofmsr@ha
- ld %r5,ofmsr@l(%r5)
- mtmsrd %r5
- isync
-
- /*
- * Set up OF stack. This needs to be accessible in real mode and
- * use the 32-bit ABI stack frame format. The pointer to the current
- * kernel stack is placed at the very top of the stack along with
- * the old MSR so we can get them back later.
- */
- mr %r5,%r1
- lis %r1,(ofwstk+OFWSTKSZ-32)@ha
- addi %r1,%r1,(ofwstk+OFWSTKSZ-32)@l
- std %r5,8(%r1) /* Save real stack pointer */
- std %r2,16(%r1) /* Save old TOC */
- std %r6,24(%r1) /* Save old MSR */
- li %r5,0
- stw %r5,4(%r1)
- stw %r5,0(%r1)
-
- /* Finally, branch to OF */
- mtctr %r4
- bctrl
-
- /* Reload stack pointer and MSR from the OFW stack */
- ld %r6,24(%r1)
- ld %r2,16(%r1)
- ld %r1,8(%r1)
-
- /* Now set the real MSR */
- mtmsrd %r6
- isync
-
- /* Sign-extend the return value from OF */
- extsw %r3,%r3
-
- /* Restore all the non-volatile registers */
- ld %r5,48(%r1)
- mtcr %r5
- ld %r13,56(%r1)
- ld %r14,64(%r1)
- ld %r15,72(%r1)
- ld %r16,80(%r1)
- ld %r17,88(%r1)
- ld %r18,96(%r1)
- ld %r19,104(%r1)
- ld %r20,112(%r1)
- ld %r21,120(%r1)
- ld %r22,128(%r1)
- ld %r23,136(%r1)
- ld %r24,144(%r1)
- ld %r25,152(%r1)
- ld %r26,160(%r1)
- ld %r27,168(%r1)
- ld %r28,176(%r1)
- ld %r29,184(%r1)
- ld %r30,192(%r1)
- ld %r31,200(%r1)
-
- /* Restore the stack and link register */
- ld %r1,0(%r1)
- ld %r0,16(%r1)
- mtlr %r0
- blr
-
-/*
* int setfault()
*
* Similar to setjmp to setup for handling faults on accesses to user memory.
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c
index 65c9db1..3ccae91 100644
--- a/sys/powerpc/aim/machdep.c
+++ b/sys/powerpc/aim/machdep.c
@@ -132,6 +132,7 @@ extern vm_offset_t ksym_start, ksym_end;
int cold = 1;
#ifdef __powerpc64__
+extern int n_slbs;
int cacheline_size = 128;
#else
int cacheline_size = 32;
@@ -251,7 +252,6 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
vm_offset_t basekernel, void *mdp)
{
struct pcpu *pc;
- vm_offset_t end;
void *generictrap;
size_t trap_offset;
void *kmdp;
@@ -263,7 +263,6 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
int ppc64;
#endif
- end = 0;
kmdp = NULL;
trap_offset = 0;
cacheline_warn = 0;
@@ -279,7 +278,8 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
if (kmdp != NULL) {
boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
- end = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t);
+ endkernel = ulmax(endkernel, MD_FETCH(kmdp,
+ MODINFOMD_KERNEND, vm_offset_t));
#ifdef DDB
ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t);
ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t);
@@ -338,13 +338,13 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
kdb_init();
- /*
- * PowerPC 970 CPUs have a misfeature requested by Apple that makes
- * them pretend they have a 32-byte cacheline. Turn this off
- * before we measure the cacheline size.
- */
-
+ /* Various very early CPU fix ups */
switch (mfpvr() >> 16) {
+ /*
+ * PowerPC 970 CPUs have a misfeature requested by Apple that
+ * makes them pretend they have a 32-byte cacheline. Turn this
+ * off before we measure the cacheline size.
+ */
case IBM970:
case IBM970FX:
case IBM970MP:
@@ -353,6 +353,12 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
scratch &= ~HID5_970_DCBZ_SIZE_HI;
mtspr(SPR_HID5, scratch);
break;
+ #ifdef __powerpc64__
+ case IBMPOWER7:
+ /* XXX: get from ibm,slb-size in device tree */
+ n_slbs = 32;
+ break;
+ #endif
}
/*
@@ -368,7 +374,6 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
msr = mfmsr();
mtmsr((msr & ~(PSL_IR | PSL_DR)) | PSL_RI);
- isync();
/*
* Measure the cacheline size using dcbz
@@ -503,7 +508,6 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
* Restore MSR
*/
mtmsr(msr);
- isync();
/* Warn if cachline size was not determined */
if (cacheline_warn == 1) {
@@ -527,8 +531,7 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC);
pmap_bootstrap(startkernel, endkernel);
- mtmsr(mfmsr() | PSL_IR|PSL_DR|PSL_ME|PSL_RI);
- isync();
+ mtmsr(PSL_KERNSET & ~PSL_EE);
/*
* Initialize params/tunables that are derived from memsize
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c
index 30435f5..be80455 100644
--- a/sys/powerpc/aim/mmu_oea.c
+++ b/sys/powerpc/aim/mmu_oea.c
@@ -118,11 +118,14 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/kernel.h>
+#include <sys/queue.h>
+#include <sys/cpuset.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/msgbuf.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/vmmeter.h>
@@ -584,26 +587,9 @@ moea_pte_change(struct pte *pt, struct pte *pvo_pt, vm_offset_t va)
/*
* Quick sort callout for comparing memory regions.
*/
-static int mr_cmp(const void *a, const void *b);
static int om_cmp(const void *a, const void *b);
static int
-mr_cmp(const void *a, const void *b)
-{
- const struct mem_region *regiona;
- const struct mem_region *regionb;
-
- regiona = a;
- regionb = b;
- if (regiona->mr_start < regionb->mr_start)
- return (-1);
- else if (regiona->mr_start > regionb->mr_start)
- return (1);
- else
- return (0);
-}
-
-static int
om_cmp(const void *a, const void *b)
{
const struct ofw_map *mapa;
@@ -720,7 +706,6 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
mem_regions(&pregions, &pregions_sz, &regions, &regions_sz);
CTR0(KTR_PMAP, "moea_bootstrap: physical memory");
- qsort(pregions, pregions_sz, sizeof(*pregions), mr_cmp);
for (i = 0; i < pregions_sz; i++) {
vm_offset_t pa;
vm_offset_t end;
@@ -749,7 +734,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
if (sizeof(phys_avail)/sizeof(phys_avail[0]) < regions_sz)
panic("moea_bootstrap: phys_avail too small");
- qsort(regions, regions_sz, sizeof(*regions), mr_cmp);
+
phys_avail_count = 0;
physsz = 0;
hwphyssz = 0;
@@ -838,7 +823,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
PMAP_LOCK_INIT(kernel_pmap);
for (i = 0; i < 16; i++)
kernel_pmap->pm_sr[i] = EMPTY_SEGMENT + i;
- kernel_pmap->pm_active = ~0;
+ CPU_FILL(&kernel_pmap->pm_active);
/*
* Set up the Open Firmware mappings
@@ -960,7 +945,9 @@ moea_activate(mmu_t mmu, struct thread *td)
pm = &td->td_proc->p_vmspace->vm_pmap;
pmr = pm->pmap_phys;
- pm->pm_active |= PCPU_GET(cpumask);
+ sched_pin();
+ CPU_OR(&pm->pm_active, PCPU_PTR(cpumask));
+ sched_unpin();
PCPU_SET(curpmap, pmr);
}
@@ -970,7 +957,9 @@ moea_deactivate(mmu_t mmu, struct thread *td)
pmap_t pm;
pm = &td->td_proc->p_vmspace->vm_pmap;
- pm->pm_active &= ~PCPU_GET(cpumask);
+ sched_pin();
+ CPU_NAND(&pm->pm_active, PCPU_PTR(cpumask));
+ sched_unpin();
PCPU_SET(curpmap, NULL);
}
diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c
index c33a094..291d89b 100644
--- a/sys/powerpc/aim/mmu_oea64.c
+++ b/sys/powerpc/aim/mmu_oea64.c
@@ -118,11 +118,14 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/kernel.h>
+#include <sys/queue.h>
+#include <sys/cpuset.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/msgbuf.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/vmmeter.h>
@@ -162,8 +165,8 @@ __FBSDID("$FreeBSD$");
void moea64_release_vsid(uint64_t vsid);
uintptr_t moea64_get_unique_vsid(void);
-#define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR); isync()
-#define ENABLE_TRANS(msr) mtmsr(msr); isync()
+#define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR)
+#define ENABLE_TRANS(msr) mtmsr(msr)
#define VSID_MAKE(sr, hash) ((sr) | (((hash) & 0xfffff) << 4))
#define VSID_TO_HASH(vsid) (((vsid) >> 4) & 0xfffff)
@@ -473,26 +476,9 @@ moea64_calc_wimg(vm_offset_t pa, vm_memattr_t ma)
/*
* Quick sort callout for comparing memory regions.
*/
-static int mr_cmp(const void *a, const void *b);
static int om_cmp(const void *a, const void *b);
static int
-mr_cmp(const void *a, const void *b)
-{
- const struct mem_region *regiona;
- const struct mem_region *regionb;
-
- regiona = a;
- regionb = b;
- if (regiona->mr_start < regionb->mr_start)
- return (-1);
- else if (regiona->mr_start > regionb->mr_start)
- return (1);
- else
- return (0);
-}
-
-static int
om_cmp(const void *a, const void *b)
{
const struct ofw_map *mapa;
@@ -707,10 +693,9 @@ moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelen
mem_regions(&pregions, &pregions_sz, &regions, &regions_sz);
CTR0(KTR_PMAP, "moea64_bootstrap: physical memory");
- qsort(pregions, pregions_sz, sizeof(*pregions), mr_cmp);
if (sizeof(phys_avail)/sizeof(phys_avail[0]) < regions_sz)
panic("moea64_bootstrap: phys_avail too small");
- qsort(regions, regions_sz, sizeof(*regions), mr_cmp);
+
phys_avail_count = 0;
physsz = 0;
hwphyssz = 0;
@@ -845,7 +830,7 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
#endif
kernel_pmap->pmap_phys = kernel_pmap;
- kernel_pmap->pm_active = ~0;
+ CPU_FILL(&kernel_pmap->pm_active);
PMAP_LOCK_INIT(kernel_pmap);
@@ -895,7 +880,7 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend
* Initialize MMU and remap early physical mappings
*/
MMU_CPU_BOOTSTRAP(mmup,0);
- mtmsr(mfmsr() | PSL_DR | PSL_IR); isync();
+ mtmsr(mfmsr() | PSL_DR | PSL_IR);
pmap_bootstrapped++;
bs_remap_earlyboot();
@@ -1013,7 +998,9 @@ moea64_activate(mmu_t mmu, struct thread *td)
pmap_t pm;
pm = &td->td_proc->p_vmspace->vm_pmap;
- pm->pm_active |= PCPU_GET(cpumask);
+ sched_pin();
+ CPU_OR(&pm->pm_active, PCPU_PTR(cpumask));
+ sched_unpin();
#ifdef __powerpc64__
PCPU_SET(userslb, pm->pm_slb);
@@ -1028,7 +1015,9 @@ moea64_deactivate(mmu_t mmu, struct thread *td)
pmap_t pm;
pm = &td->td_proc->p_vmspace->vm_pmap;
- pm->pm_active &= ~(PCPU_GET(cpumask));
+ sched_pin();
+ CPU_NAND(&pm->pm_active, PCPU_PTR(cpumask));
+ sched_unpin();
#ifdef __powerpc64__
PCPU_SET(userslb, NULL);
#else
@@ -2580,8 +2569,8 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t va, vm_size_t sz)
lim = round_page(va);
len = MIN(lim - va, sz);
pvo = moea64_pvo_find_va(pm, va & ~ADDR_POFF);
- if (pvo != NULL) {
- pa = (pvo->pvo_pte.pte.pte_lo & LPTE_RPGN) |
+ if (pvo != NULL && !(pvo->pvo_pte.lpte.pte_lo & LPTE_I)) {
+ pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) |
(va & ADDR_POFF);
moea64_syncicache(mmu, pm, va, pa, len);
}
diff --git a/sys/powerpc/aim/moea64_native.c b/sys/powerpc/aim/moea64_native.c
index bca51ab..9e5174f 100644
--- a/sys/powerpc/aim/moea64_native.c
+++ b/sys/powerpc/aim/moea64_native.c
@@ -185,8 +185,8 @@ TLBIE(uint64_t vpn) {
mtx_unlock_spin(&tlbie_mutex);
}
-#define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR); isync()
-#define ENABLE_TRANS(msr) mtmsr(msr); isync()
+#define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR)
+#define ENABLE_TRANS(msr) mtmsr(msr)
/*
* PTEG data.
@@ -344,7 +344,7 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap)
* Initialize segment registers and MMU
*/
- mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR); isync();
+ mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR);
/*
* Install kernel SLB entries
diff --git a/sys/powerpc/aim/mp_cpudep.c b/sys/powerpc/aim/mp_cpudep.c
index 3ee22f3..d617fde 100644
--- a/sys/powerpc/aim/mp_cpudep.c
+++ b/sys/powerpc/aim/mp_cpudep.c
@@ -87,7 +87,6 @@ cpudep_ap_bootstrap(void)
msr = PSL_KERNSET & ~PSL_EE;
mtmsr(msr);
- isync();
pcpup->pc_curthread = pcpup->pc_idlethread;
pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb;
@@ -344,6 +343,10 @@ cpudep_ap_setup()
break;
default:
+#ifdef __powerpc64__
+ if (!(mfmsr() & PSL_HV)) /* Rely on HV to have set things up */
+ break;
+#endif
printf("WARNING: Unknown CPU type. Cache performace may be "
"suboptimal.\n");
break;
diff --git a/sys/powerpc/aim/slb.c b/sys/powerpc/aim/slb.c
index 1fafbb4..df493b4 100644
--- a/sys/powerpc/aim/slb.c
+++ b/sys/powerpc/aim/slb.c
@@ -51,8 +51,9 @@ uintptr_t moea64_get_unique_vsid(void);
void moea64_release_vsid(uint64_t vsid);
static void slb_zone_init(void *);
-uma_zone_t slbt_zone;
-uma_zone_t slb_cache_zone;
+static uma_zone_t slbt_zone;
+static uma_zone_t slb_cache_zone;
+int n_slbs = 64;
SYSINIT(slb_zone_init, SI_SUB_KMEM, SI_ORDER_ANY, slb_zone_init, NULL);
@@ -426,16 +427,18 @@ slb_insert_kernel(uint64_t slbe, uint64_t slbv)
/* Check for an unused slot, abusing the user slot as a full flag */
if (slbcache[USER_SLB_SLOT].slbe == 0) {
- for (i = 0; i < USER_SLB_SLOT; i++) {
+ for (i = 0; i < n_slbs; i++) {
+ if (i == USER_SLB_SLOT)
+ continue;
if (!(slbcache[i].slbe & SLBE_VALID))
goto fillkernslb;
}
- if (i == USER_SLB_SLOT)
+ if (i == n_slbs)
slbcache[USER_SLB_SLOT].slbe = 1;
}
- for (i = mftb() % 64, j = 0; j < 64; j++, i = (i+1) % 64) {
+ for (i = mftb() % n_slbs, j = 0; j < n_slbs; j++, i = (i+1) % n_slbs) {
if (i == USER_SLB_SLOT)
continue;
@@ -443,9 +446,11 @@ slb_insert_kernel(uint64_t slbe, uint64_t slbv)
break;
}
- KASSERT(j < 64, ("All kernel SLB slots locked!"));
+ KASSERT(j < n_slbs, ("All kernel SLB slots locked!"));
fillkernslb:
+ KASSERT(i != USER_SLB_SLOT,
+ ("Filling user SLB slot with a kernel mapping"));
slbcache[i].slbv = slbv;
slbcache[i].slbe = slbe | (uint64_t)i;
@@ -466,11 +471,11 @@ slb_insert_user(pmap_t pm, struct slb *slb)
PMAP_LOCK_ASSERT(pm, MA_OWNED);
- if (pm->pm_slb_len < 64) {
+ if (pm->pm_slb_len < n_slbs) {
i = pm->pm_slb_len;
pm->pm_slb_len++;
} else {
- i = mftb() % 64;
+ i = mftb() % n_slbs;
}
/* Note that this replacement is atomic with respect to trap_subr */
@@ -521,8 +526,9 @@ slb_zone_init(void *dummy)
slbt_zone = uma_zcreate("SLB tree node", sizeof(struct slbtnode),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM);
- slb_cache_zone = uma_zcreate("SLB cache", 64*sizeof(struct slb *),
- NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM);
+ slb_cache_zone = uma_zcreate("SLB cache",
+ (n_slbs + 1)*sizeof(struct slb *), NULL, NULL, NULL, NULL,
+ UMA_ALIGN_PTR, UMA_ZONE_VM);
if (platform_real_maxaddr() != VM_MAX_ADDRESS) {
uma_zone_set_allocf(slb_cache_zone, slb_uma_real_alloc);
diff --git a/sys/powerpc/aim/trap_subr64.S b/sys/powerpc/aim/trap_subr64.S
index 64e4ac1..5d4148a 100644
--- a/sys/powerpc/aim/trap_subr64.S
+++ b/sys/powerpc/aim/trap_subr64.S
@@ -53,55 +53,53 @@
* User SRs are loaded through a pointer to the current pmap.
*/
restore_usersrs:
- GET_CPUINFO(%r28);
- ld %r28,PC_USERSLB(%r28);
+ GET_CPUINFO(%r28)
+ ld %r28,PC_USERSLB(%r28)
li %r29, 0 /* Set the counter to zero */
slbia
slbmfee %r31,%r29
clrrdi %r31,%r31,28
slbie %r31
-instuserslb:
- ld %r31, 0(%r28); /* Load SLB entry pointer */
- cmpli 0, %r31, 0; /* If NULL, stop */
- beqlr;
+1: ld %r31, 0(%r28) /* Load SLB entry pointer */
+ cmpli 0, %r31, 0 /* If NULL, stop */
+ beqlr
ld %r30, 0(%r31) /* Load SLBV */
ld %r31, 8(%r31) /* Load SLBE */
or %r31, %r31, %r29 /* Set SLBE slot */
- slbmte %r30, %r31; /* Install SLB entry */
+ slbmte %r30, %r31 /* Install SLB entry */
- addi %r28, %r28, 8; /* Advance pointer */
- addi %r29, %r29, 1;
- cmpli 0, %r29, 64; /* Repeat if we are not at the end */
- blt instuserslb;
- blr;
+ addi %r28, %r28, 8 /* Advance pointer */
+ addi %r29, %r29, 1
+ b 1b /* Repeat */
/*
* Kernel SRs are loaded directly from the PCPU fields
*/
restore_kernsrs:
- GET_CPUINFO(%r28);
- addi %r28,%r28,PC_KERNSLB;
+ GET_CPUINFO(%r28)
+ addi %r28,%r28,PC_KERNSLB
li %r29, 0 /* Set the counter to zero */
slbia
slbmfee %r31,%r29
clrrdi %r31,%r31,28
slbie %r31
-instkernslb:
- ld %r31, 8(%r28); /* Load SLBE */
+1: cmpli 0, %r29, USER_SLB_SLOT /* Skip the user slot */
+ beq- 2f
- cmpli 0, %r31, 0; /* If SLBE is not valid, stop */
- beqlr;
+ ld %r31, 8(%r28) /* Load SLBE */
+ cmpli 0, %r31, 0 /* If SLBE is not valid, stop */
+ beqlr
ld %r30, 0(%r28) /* Load SLBV */
- slbmte %r30, %r31; /* Install SLB entry */
+ slbmte %r30, %r31 /* Install SLB entry */
- addi %r28, %r28, 16; /* Advance pointer */
- addi %r29, %r29, 1;
- cmpli 0, %r29, USER_SLB_SLOT; /* Repeat if we are not at the end */
- blt instkernslb;
- blr;
+2: addi %r28, %r28, 16 /* Advance pointer */
+ addi %r29, %r29, 1
+ cmpli 0, %r29, 64 /* Repeat if we are not at the end */
+ blt 1b
+ blr
/*
* FRAME_SETUP assumes:
@@ -519,6 +517,7 @@ CNAME(trapexit):
mfmsr %r3
andi. %r3,%r3,~PSL_EE@l
mtmsr %r3
+ isync
/* Test AST pending: */
ld %r5,FRAME_SRR1+48(%r1)
mtcr %r5
diff --git a/sys/powerpc/booke/locore.S b/sys/powerpc/booke/locore.S
index 3ac4a1a..de7effc 100644
--- a/sys/powerpc/booke/locore.S
+++ b/sys/powerpc/booke/locore.S
@@ -83,17 +83,18 @@ __start:
* locore registers use:
* r1 : stack pointer
* r2 : trace pointer (AP only, for early diagnostics)
- * r3-r27 : scratch registers
- * r28 : kernload
- * r29 : temp TLB1 entry
- * r30 : initial TLB1 entry we started in
- * r31 : metadata pointer
+ * r3-r26 : scratch registers
+ * r27 : kernload
+ * r28 : temp TLB1 entry
+ * r29 : initial TLB1 entry we started in
+ * r30-r31 : arguments (metadata pointer)
*/
/*
- * Keep metadata ptr in r31 for later use.
+ * Keep arguments in r30 & r31 for later use.
*/
- mr %r31, %r3
+ mr %r30, %r3
+ mr %r31, %r4
/*
* Initial cleanup
@@ -120,7 +121,7 @@ __start:
*/
bl 1f
1: mflr %r3
- bl tlb1_find_current /* the entry number found is returned in r30 */
+ bl tlb1_find_current /* the entry found is returned in r29 */
bl tlb1_inval_all_but_current
/*
@@ -140,7 +141,7 @@ __start:
/*
* Invalidate initial entry
*/
- mr %r3, %r30
+ mr %r3, %r29
bl tlb1_inval_entry
/*
@@ -148,7 +149,7 @@ __start:
*/
/* Final kernel mapping, map in 16 MB of RAM */
lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */
- li %r4, 1 /* Entry 1 */
+ li %r4, 0 /* Entry 0 */
rlwimi %r3, %r4, 16, 12, 15
mtspr SPR_MAS0, %r3
isync
@@ -170,7 +171,7 @@ __start:
bl 3f
3: mflr %r4 /* Use current address */
rlwinm %r4, %r4, 0, 0, 7 /* 16MB alignment mask */
- mr %r28, %r4 /* Keep kernel load address */
+ mr %r27, %r4 /* Keep kernel load address */
ori %r4, %r4, (MAS3_SX | MAS3_SW | MAS3_SR)@l
mtspr SPR_MAS3, %r4 /* Set RPN and protection */
isync
@@ -193,7 +194,7 @@ __start:
/*
* Invalidate temp mapping
*/
- mr %r3, %r29
+ mr %r3, %r28
bl tlb1_inval_entry
/*
@@ -201,7 +202,7 @@ __start:
*/
lis %r3, kernload@ha
addi %r3, %r3, kernload@l
- stw %r28, 0(%r3)
+ stw %r27, 0(%r3)
#ifdef SMP
/*
* APs need a separate copy of kernload info within the __boot_page
@@ -210,7 +211,7 @@ __start:
*/
lis %r3, kernload_ap@ha
addi %r3, %r3, kernload_ap@l
- stw %r28, 0(%r3)
+ stw %r27, 0(%r3)
msync
#endif
@@ -229,14 +230,11 @@ __start:
/*
* Set up arguments and jump to system initialization code
*/
- lis %r3, kernel_text@ha
- addi %r3, %r3, kernel_text@l
- lis %r4, _end@ha
- addi %r4, %r4, _end@l
- mr %r5, %r31 /* metadata ptr */
+ mr %r3, %r30
+ mr %r4, %r31
/* Prepare e500 core */
- bl e500_init
+ bl booke_init
/* Switch to thread0.td_kstack now */
mr %r1, %r3
@@ -290,7 +288,7 @@ kernload_ap:
*/
bl 2f
2: mflr %r3
- bl tlb1_find_current /* the entry number found is in r30 */
+ bl tlb1_find_current /* the entry number found is in r29 */
bl tlb1_inval_all_but_current
/*
@@ -310,7 +308,7 @@ kernload_ap:
/*
* Invalidate initial entry
*/
- mr %r3, %r30
+ mr %r3, %r29
bl tlb1_inval_entry
/*
@@ -318,7 +316,7 @@ kernload_ap:
*/
/* Final kernel mapping, map in 16 MB of RAM */
lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */
- li %r4, 1 /* Entry 1 */
+ li %r4, 0 /* Entry 0 */
rlwimi %r3, %r4, 16, 4, 15
mtspr SPR_MAS0, %r3
isync
@@ -373,7 +371,7 @@ kernload_ap:
/*
* Invalidate temp mapping
*/
- mr %r3, %r29
+ mr %r3, %r28
bl tlb1_inval_entry
/*
@@ -425,7 +423,7 @@ tlb_inval_all:
blr
/*
- * expects address to look up in r3, returns entry number in r30
+ * expects address to look up in r3, returns entry number in r29
*
* FIXME: the hidden assumption is we are now running in AS=0, but we should
* retrieve actual AS from MSR[IS|DS] and put it in MAS6[SAS]
@@ -437,7 +435,7 @@ tlb1_find_current:
isync
tlbsx 0, %r3
mfspr %r17, SPR_MAS0
- rlwinm %r30, %r17, 16, 20, 31 /* MAS0[ESEL] -> r30 */
+ rlwinm %r29, %r17, 16, 20, 31 /* MAS0[ESEL] -> r29 */
/* Make sure we have IPROT set on the entry */
mfspr %r17, SPR_MAS1
@@ -470,14 +468,14 @@ tlb1_inval_entry:
blr
/*
- * r30 current entry number
- * r29 returned temp entry
+ * r29 current entry number
+ * r28 returned temp entry
* r3-r5 scratched
*/
tlb1_temp_mapping_as1:
/* Read our current translation */
lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */
- rlwimi %r3, %r30, 16, 12, 15 /* Select our current entry */
+ rlwimi %r3, %r29, 16, 12, 15 /* Select our current entry */
mtspr SPR_MAS0, %r3
isync
tlbre
@@ -489,12 +487,8 @@ tlb1_temp_mapping_as1:
* entry is the last in TLB1
*/
lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */
- addi %r29, %r30, 1 /* Use next entry. */
- li %r4, 1
- cmpw %r4, %r29
- bne 1f
- addi %r29, %r29, 1
-1: rlwimi %r3, %r29, 16, 12, 15 /* Select temp entry */
+ addi %r28, %r29, 1 /* Use next entry. */
+ rlwimi %r3, %r28, 16, 12, 15 /* Select temp entry */
mtspr SPR_MAS0, %r3
isync
mfspr %r5, SPR_MAS1
@@ -514,7 +508,7 @@ tlb1_temp_mapping_as1:
* Loops over TLB1, invalidates all entries skipping the one which currently
* maps this code.
*
- * r30 current entry
+ * r29 current entry
* r3-r5 scratched
*/
tlb1_inval_all_but_current:
@@ -528,7 +522,7 @@ tlb1_inval_all_but_current:
isync
tlbre
mfspr %r5, SPR_MAS1
- cmpw %r4, %r30 /* our current entry? */
+ cmpw %r4, %r29 /* our current entry? */
beq 2f
rlwinm %r5, %r5, 0, 2, 31 /* clear VALID and IPROT bits */
mtspr SPR_MAS1, %r5
diff --git a/sys/powerpc/booke/machdep.c b/sys/powerpc/booke/machdep.c
index f2dbacf..c2b5e6f 100644
--- a/sys/powerpc/booke/machdep.c
+++ b/sys/powerpc/booke/machdep.c
@@ -190,7 +190,7 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_e500_startup, NULL);
void print_kernel_section_addr(void);
void print_kenv(void);
-u_int e500_init(u_int32_t, u_int32_t, void *);
+u_int booke_init(uint32_t, uint32_t);
static void
cpu_e500_startup(void *dummy)
@@ -276,19 +276,41 @@ print_kernel_section_addr(void)
}
u_int
-e500_init(u_int32_t startkernel, u_int32_t endkernel, void *mdp)
+booke_init(uint32_t arg1, uint32_t arg2)
{
struct pcpu *pc;
- void *kmdp;
+ void *kmdp, *mdp;
vm_offset_t dtbp, end;
uint32_t csr;
kmdp = NULL;
- end = endkernel;
+ end = (uintptr_t)_end;
dtbp = (vm_offset_t)NULL;
/*
+ * Handle the various ways we can get loaded and started:
+ * - FreeBSD's loader passes the pointer to the metadata
+ * in arg1, with arg2 undefined. arg1 has a value that's
+ * relative to the kernel's link address (i.e. larger
+ * than 0xc0000000).
+ * - Juniper's loader passes the metadata pointer in arg2
+ * and sets arg1 to zero. This is to signal that the
+ * loader maps the kernel and starts it at its link
+ * address (unlike the FreeBSD loader).
+ * - U-Boot passes the standard argc and argv parameters
+ * in arg1 and arg2 (resp). arg1 is between 1 and some
+ * relatively small number, such as 64K. arg2 is the
+ * physical address of the argv vector.
+ */
+ if (arg1 > (uintptr_t)kernel_text) /* FreeBSD loader */
+ mdp = (void *)arg1;
+ else if (arg1 == 0) /* Juniper loader */
+ mdp = (void *)arg2;
+ else /* U-Boot */
+ mdp = NULL;
+
+ /*
* Parse metadata and fetch parameters.
*/
if (mdp != NULL) {
@@ -309,17 +331,8 @@ e500_init(u_int32_t startkernel, u_int32_t endkernel, void *mdp)
#endif
}
} else {
- /*
- * We should scream but how? Cannot even output anything...
- */
-
- /*
- * FIXME add return value and handle in the locore so we can
- * return to the loader maybe? (this seems not very easy to
- * restore everything as the TLB have all been reprogrammed
- * in the locore etc...)
- */
- while (1);
+ bzero(__sbss_start, __sbss_end - __sbss_start);
+ bzero(__bss_start, _end - __bss_start);
}
#if defined(FDT_DTB_STATIC)
@@ -368,9 +381,7 @@ e500_init(u_int32_t startkernel, u_int32_t endkernel, void *mdp)
cninit();
/* Print out some debug info... */
- debugf("e500_init: console initialized\n");
- debugf(" arg1 startkernel = 0x%08x\n", startkernel);
- debugf(" arg2 endkernel = 0x%08x\n", endkernel);
+ debugf("%s: console initialized\n", __func__);
debugf(" arg3 mdp = 0x%08x\n", (u_int32_t)mdp);
debugf(" end = 0x%08x\n", (u_int32_t)end);
debugf(" boothowto = 0x%08x\n", boothowto);
@@ -403,7 +414,7 @@ e500_init(u_int32_t startkernel, u_int32_t endkernel, void *mdp)
/* Initialise virtual memory. */
pmap_mmu_install(MMU_TYPE_BOOKE, 0);
- pmap_bootstrap(startkernel, end);
+ pmap_bootstrap((uintptr_t)kernel_text, end);
debugf("MSR = 0x%08x\n", mfmsr());
//tlb1_print_entries();
//tlb1_print_tlbentries();
@@ -449,8 +460,8 @@ e500_init(u_int32_t startkernel, u_int32_t endkernel, void *mdp)
printf("L1 I-cache %sabled\n",
(csr & L1CSR1_ICE) ? "en" : "dis");
- debugf("e500_init: SP = 0x%08x\n", ((uintptr_t)thread0.td_pcb - 16) & ~15);
- debugf("e500_init: e\n");
+ debugf("%s: SP = 0x%08x\n", __func__,
+ ((uintptr_t)thread0.td_pcb - 16) & ~15);
return (((uintptr_t)thread0.td_pcb - 16) & ~15);
}
diff --git a/sys/powerpc/booke/platform_bare.c b/sys/powerpc/booke/platform_bare.c
index 8e03bd3..d76664e 100644
--- a/sys/powerpc/booke/platform_bare.c
+++ b/sys/powerpc/booke/platform_bare.c
@@ -104,10 +104,22 @@ bare_probe(platform_t plat)
int i, law_max, tgt;
ver = SVR_VER(mfspr(SPR_SVR));
- if (ver == SVR_MPC8572E || ver == SVR_MPC8572)
+ switch (ver & ~0x0008) { /* Mask Security Enabled bit */
+ case SVR_P4080:
+ maxcpu = 8;
+ break;
+ case SVR_P4040:
+ maxcpu = 4;
+ break;
+ case SVR_MPC8572:
+ case SVR_P1020:
+ case SVR_P2020:
maxcpu = 2;
- else
+ break;
+ default:
maxcpu = 1;
+ break;
+ }
/*
* Clear local access windows. Skip DRAM entries, so we don't shoot
@@ -166,8 +178,11 @@ bare_timebase_freq(platform_t plat, struct cpuref *cpuref)
phandle_t cpus, child;
pcell_t freq;
- /* Backward compatibility. See 8-STABLE. */
- ticks = bootinfo[3] >> 3;
+ if (bootinfo != NULL) {
+ /* Backward compatibility. See 8-STABLE. */
+ ticks = bootinfo[3] >> 3;
+ } else
+ ticks = 0;
if ((cpus = OF_finddevice("/cpus")) == 0)
goto out;
@@ -241,7 +256,7 @@ bare_smp_start_cpu(platform_t plat, struct pcpu *pc)
int timeout;
eebpcr = ccsr_read4(OCP85XX_EEBPCR);
- if ((eebpcr & (pc->pc_cpumask << 24)) != 0) {
+ if ((eebpcr & (1 << (pc->pc_cpuid + 24))) != 0) {
printf("%s: CPU=%d already out of hold-off state!\n",
__func__, pc->pc_cpuid);
return (ENXIO);
@@ -259,7 +274,7 @@ bare_smp_start_cpu(platform_t plat, struct pcpu *pc)
/*
* Release AP from hold-off state
*/
- eebpcr |= (pc->pc_cpumask << 24);
+ eebpcr |= (1 << (pc->pc_cpuid + 24));
ccsr_write4(OCP85XX_EEBPCR, eebpcr);
__asm __volatile("isync; msync");
@@ -277,24 +292,23 @@ bare_smp_start_cpu(platform_t plat, struct pcpu *pc)
static void
e500_reset(platform_t plat)
{
- uint32_t ver = SVR_VER(mfspr(SPR_SVR));
-
- if (ver == SVR_MPC8572E || ver == SVR_MPC8572 ||
- ver == SVR_MPC8548E || ver == SVR_MPC8548)
- /* Systems with dedicated reset register */
- ccsr_write4(OCP85XX_RSTCR, 2);
- else {
- /* Clear DBCR0, disables debug interrupts and events. */
- mtspr(SPR_DBCR0, 0);
- __asm __volatile("isync");
-
- /* Enable Debug Interrupts in MSR. */
- mtmsr(mfmsr() | PSL_DE);
-
- /* Enable debug interrupts and issue reset. */
- mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM |
- DBCR0_RST_SYSTEM);
- }
+
+ /*
+ * Try the dedicated reset register first.
+ * If the SoC doesn't have one, we'll fall
+ * back to using the debug control register.
+ */
+ ccsr_write4(OCP85XX_RSTCR, 2);
+
+ /* Clear DBCR0, disables debug interrupts and events. */
+ mtspr(SPR_DBCR0, 0);
+ __asm __volatile("isync");
+
+ /* Enable Debug Interrupts in MSR. */
+ mtmsr(mfmsr() | PSL_DE);
+
+ /* Enable debug interrupts and issue reset. */
+ mtspr(SPR_DBCR0, mfspr(SPR_DBCR0) | DBCR0_IDM | DBCR0_RST_SYSTEM);
printf("Reset failed...\n");
while (1);
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index 2fffa3f..e1cd071 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
#include <sys/msgbuf.h>
#include <sys/lock.h>
#include <sys/mutex.h>
+#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/vmmeter.h>
@@ -91,9 +92,6 @@ __FBSDID("$FreeBSD$");
#include "mmu_if.h"
-#define DEBUG
-#undef DEBUG
-
#ifdef DEBUG
#define debugf(fmt, args...) printf(fmt, ##args)
#else
@@ -393,7 +391,7 @@ tlb_miss_lock(void)
if (!smp_started)
return;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
if (pc != pcpup) {
CTR3(KTR_PMAP, "%s: tlb miss LOCK of CPU=%d, "
@@ -419,7 +417,7 @@ tlb_miss_unlock(void)
if (!smp_started)
return;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
if (pc != pcpup) {
CTR2(KTR_PMAP, "%s: tlb miss UNLOCK of CPU=%d",
__func__, pc->pc_cpuid);
@@ -946,7 +944,7 @@ pte_find(mmu_t mmu, pmap_t pmap, vm_offset_t va)
/**************************************************************************/
/*
- * This is called during e500_init, before the system is really initialized.
+ * This is called during booke_init, before the system is really initialized.
*/
static void
mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend)
@@ -1228,7 +1226,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend)
PTE_VALID;
}
/* Mark kernel_pmap active on all CPUs */
- kernel_pmap->pm_active = ~0;
+ CPU_FILL(&kernel_pmap->pm_active);
/*******************************************************/
/* Final setup */
@@ -1483,7 +1481,7 @@ mmu_booke_pinit(mmu_t mmu, pmap_t pmap)
PMAP_LOCK_INIT(pmap);
for (i = 0; i < MAXCPU; i++)
pmap->pm_tid[i] = TID_NONE;
- pmap->pm_active = 0;
+ CPU_ZERO(&kernel_pmap->pm_active);
bzero(&pmap->pm_stats, sizeof(pmap->pm_stats));
bzero(&pmap->pm_pdir, sizeof(pte_t *) * PDIR_NENTRIES);
TAILQ_INIT(&pmap->pm_ptbl_list);
@@ -1838,7 +1836,7 @@ mmu_booke_activate(mmu_t mmu, struct thread *td)
mtx_lock_spin(&sched_lock);
- atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask));
+ CPU_OR_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask));
PCPU_SET(curpmap, pmap);
if (pmap->pm_tid[PCPU_GET(cpuid)] == TID_NONE)
@@ -1867,7 +1865,9 @@ mmu_booke_deactivate(mmu_t mmu, struct thread *td)
CTR5(KTR_PMAP, "%s: td=%p, proc = '%s', id = %d, pmap = 0x%08x",
__func__, td, td->td_proc->p_comm, td->td_proc->p_pid, pmap);
- atomic_clear_int(&pmap->pm_active, PCPU_GET(cpumask));
+ sched_pin();
+ CPU_NAND_ATOMIC(&pmap->pm_active, PCPU_PTR(cpumask));
+ sched_unpin();
PCPU_SET(curpmap, NULL);
}
@@ -3019,24 +3019,18 @@ tlb1_init(vm_offset_t ccsrbar)
{
uint32_t mas0;
- /* TLB1[1] is used to map the kernel. Save that entry. */
- mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(1);
+ /* TLB1[0] is used to map the kernel. Save that entry. */
+ mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(0);
mtspr(SPR_MAS0, mas0);
__asm __volatile("isync; tlbre");
- tlb1[1].mas1 = mfspr(SPR_MAS1);
- tlb1[1].mas2 = mfspr(SPR_MAS2);
- tlb1[1].mas3 = mfspr(SPR_MAS3);
+ tlb1[0].mas1 = mfspr(SPR_MAS1);
+ tlb1[0].mas2 = mfspr(SPR_MAS2);
+ tlb1[0].mas3 = mfspr(SPR_MAS3);
- /* Map in CCSRBAR in TLB1[0] */
- tlb1_idx = 0;
+ /* Map in CCSRBAR in TLB1[1] */
+ tlb1_idx = 1;
tlb1_set_entry(CCSRBAR_VA, ccsrbar, CCSRBAR_SIZE, _TLB_ENTRY_IO);
- /*
- * Set the next available TLB1 entry index. Note TLB[1] is reserved
- * for initial mapping of kernel text+data, which was set early in
- * locore, we need to skip this [busy] entry.
- */
- tlb1_idx = 2;
/* Setup TLB miss defaults */
set_mas4_defaults();
diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC
index d221a97..2950a49 100644
--- a/sys/powerpc/conf/GENERIC
+++ b/sys/powerpc/conf/GENERIC
@@ -174,18 +174,24 @@ device sbp # SCSI over FireWire (Requires scbus and da)
device fwe # Ethernet over FireWire (non-standard!)
# Misc
+device iicbus # I2C bus code
+device kiic # Keywest I2C
+device ad7417 # PowerMac7,2 temperature sensor
device ds1775 # PowerMac7,2 temperature sensor
device fcu # Apple Fan Control Unit
device max6690 # PowerMac7,2 temperature sensor
device powermac_nvram # Open Firmware configuration NVRAM
device smu # Apple System Management Unit
+device windtunnel # Apple G4 MDD fan controller
# ADB support
device adb
device cuda
device pmu
-# Powermac I2C support
-device iicbus # I2C bus code
-device kiic # Keywest I2C
+# Sound support
+device sound # Generic sound driver (required)
+device snd_ai2s # Apple I2S audio
+device snd_davbus # Apple DAVBUS audio
+device snd_uaudio # USB Audio
diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64
index d7526b3..7e385a1 100644
--- a/sys/powerpc/conf/GENERIC64
+++ b/sys/powerpc/conf/GENERIC64
@@ -175,6 +175,9 @@ device sbp # SCSI over FireWire (Requires scbus and da)
device fwe # Ethernet over FireWire (non-standard!)
# Misc
+device iicbus # I2C bus code
+device kiic # Keywest I2C
+device ad7417 # PowerMac7,2 temperature sensor
device ds1775 # PowerMac7,2 temperature sensor
device fcu # Apple Fan Control Unit
device max6690 # PowerMac7,2 temperature sensor
@@ -185,7 +188,8 @@ device smu # Apple System Management Unit
device adb
device pmu
-# Powermac I2C support
-device iicbus # I2C bus code
-device kiic # Keywest I2C
+# Sound support
+device sound # Generic sound driver (required)
+device snd_ai2s # Apple I2S audio
+device snd_uaudio # USB Audio
diff --git a/sys/powerpc/conf/NOTES b/sys/powerpc/conf/NOTES
index b80a817..0045763 100644
--- a/sys/powerpc/conf/NOTES
+++ b/sys/powerpc/conf/NOTES
@@ -39,6 +39,7 @@ device kiic # Apple Keywest I2C Controller
device ofwd # Open Firmware disks
device adb # Apple Desktop Bus
device cuda # VIA-CUDA ADB interface
+device ad7417 # PowerMac7,2 temperature sensor
device ds1775 # PowerMac7,2 temperature sensor
device fcu # Apple Fan Control Unit
device max6690 # PowerMac7,2 temperature sensor
@@ -46,6 +47,7 @@ device pmu # Apple Power Management Unit
device smu # Apple System Management Unit
device snd_ai2s # Apple I2S Audio
device snd_davbus # Apple Davbus Audio
+device windtunnel # Apple G4 MDD fan controller
#####################################################################
diff --git a/sys/powerpc/include/_types.h b/sys/powerpc/include/_types.h
index fae2416..b0b582e 100644
--- a/sys/powerpc/include/_types.h
+++ b/sys/powerpc/include/_types.h
@@ -72,7 +72,6 @@ typedef unsigned long long __uint64_t;
* Standard type definitions.
*/
typedef __uint32_t __clock_t; /* clock()... */
-typedef unsigned int __cpumask_t;
typedef double __double_t;
typedef double __float_t;
#ifdef __LP64__
diff --git a/sys/powerpc/include/openpicvar.h b/sys/powerpc/include/openpicvar.h
index 4fb9aa7..605dc0f 100644
--- a/sys/powerpc/include/openpicvar.h
+++ b/sys/powerpc/include/openpicvar.h
@@ -57,7 +57,7 @@ int openpic_common_attach(device_t, uint32_t);
/*
* PIC interface.
*/
-void openpic_bind(device_t dev, u_int irq, cpumask_t cpumask);
+void openpic_bind(device_t dev, u_int irq, cpuset_t cpumask);
void openpic_config(device_t, u_int, enum intr_trigger, enum intr_polarity);
void openpic_dispatch(device_t, struct trapframe *);
void openpic_enable(device_t, u_int, u_int);
diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h
index d71d048..06b131c 100644
--- a/sys/powerpc/include/param.h
+++ b/sys/powerpc/include/param.h
@@ -68,7 +68,7 @@
#endif
#if defined(SMP) || defined(KLD_MODULE)
-#define MAXCPU 4
+#define MAXCPU 8
#else
#define MAXCPU 1
#endif /* SMP || KLD_MODULE */
diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h
index 369ca9d..9166d04 100644
--- a/sys/powerpc/include/pmap.h
+++ b/sys/powerpc/include/pmap.h
@@ -66,6 +66,7 @@
#include <sys/queue.h>
#include <sys/tree.h>
+#include <sys/_cpuset.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
#include <machine/sr.h>
@@ -98,7 +99,7 @@ struct pmap {
#else
register_t pm_sr[16];
#endif
- cpumask_t pm_active;
+ cpuset_t pm_active;
struct pmap *pmap_phys;
struct pmap_statistics pm_stats;
@@ -175,7 +176,7 @@ void slb_free_user_cache(struct slb **);
struct pmap {
struct mtx pm_mtx; /* pmap mutex */
tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */
- cpumask_t pm_active; /* active on cpus */
+ cpuset_t pm_active; /* active on cpus */
struct pmap_statistics pm_stats; /* pmap statistics */
/* Page table directory, array of pointers to page tables. */
diff --git a/sys/powerpc/include/rtas.h b/sys/powerpc/include/rtas.h
new file mode 100644
index 0000000..5b18632
--- /dev/null
+++ b/sys/powerpc/include/rtas.h
@@ -0,0 +1,61 @@
+/*-
+ * Copyright (c) 2011 Nathan Whitehorn
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _MACHINE_RTAS_H_
+#define _MACHINE_RTAS_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <dev/ofw/openfirm.h>
+
+/*
+ * RTAS functions are defined by 32-bit integer tokens. These vary from
+ * system to system, and can be looked up from their standardized names
+ * using rtas_token_lookup(). If RTAS is not available, rtas_token_lookup()
+ * and rtas_call_method() return -1; this can be checked in advance using
+ * rtas_exists(). Otherwise, rtas_call_method() returns one of the RTAS
+ * status codes from the bottom of this file.
+ */
+
+int rtas_exists(void);
+int rtas_call_method(cell_t token, int nargs, int nreturns, ...);
+cell_t rtas_token_lookup(const char *method);
+
+/* RTAS Status Codes: see CHRP or PAPR specification */
+#define RTAS_OK 0
+#define RTAS_HW_ERROR -1
+#define RTAS_BUSY -2
+#define RTAS_PARAM_ERROR -3
+#define RTAS_STATE_CHANGE -7
+#define RTAS_VENDOR_BEGIN 9000
+#define RTAS_EXTENDED_DELAY 9900
+#define RTAS_ISOLATION_ERROR -9000
+#define RTAS_VENDOR_ERROR_BEGIN -9004
+
+#endif /* _MACHINE_RTAS_H_ */
+
diff --git a/sys/powerpc/include/slb.h b/sys/powerpc/include/slb.h
index f675e15..637110c 100644
--- a/sys/powerpc/include/slb.h
+++ b/sys/powerpc/include/slb.h
@@ -65,7 +65,7 @@
/*
* User segment for copyin/out
*/
-#define USER_SLB_SLOT 63
+#define USER_SLB_SLOT 0
#define USER_SLB_SLBE (((USER_ADDR >> ADDR_SR_SHFT) << SLBE_ESID_SHIFT) | \
SLBE_VALID | USER_SLB_SLOT)
diff --git a/sys/powerpc/include/smp.h b/sys/powerpc/include/smp.h
index cf95278..32fcfb4 100644
--- a/sys/powerpc/include/smp.h
+++ b/sys/powerpc/include/smp.h
@@ -40,9 +40,11 @@
#ifndef LOCORE
+#include <sys/_cpuset.h>
+
void ipi_all_but_self(int ipi);
void ipi_cpu(int cpu, u_int ipi);
-void ipi_selected(cpumask_t cpus, int ipi);
+void ipi_selected(cpuset_t cpus, int ipi);
struct cpuref {
uintptr_t cr_hwref;
diff --git a/sys/powerpc/include/spr.h b/sys/powerpc/include/spr.h
index 7d45136..4f675c3 100644
--- a/sys/powerpc/include/spr.h
+++ b/sys/powerpc/include/spr.h
@@ -644,8 +644,8 @@
#define SPR_MCSRR1 0x23b /* ..8 571 Machine check SRR1 */
#define SPR_SVR 0x3ff /* ..8 1023 System Version Register */
-#define SVR_MPC8533 0x803c
-#define SVR_MPC8533E 0x8034
+#define SVR_MPC8533 0x8034
+#define SVR_MPC8533E 0x803c
#define SVR_MPC8541 0x8072
#define SVR_MPC8541E 0x807a
#define SVR_MPC8548 0x8031
@@ -654,6 +654,18 @@
#define SVR_MPC8555E 0x8079
#define SVR_MPC8572 0x80e0
#define SVR_MPC8572E 0x80e8
+#define SVR_P1011 0x80e5
+#define SVR_P1011E 0x80ed
+#define SVR_P1020 0x80e4
+#define SVR_P1020E 0x80ec
+#define SVR_P2010 0x80e3
+#define SVR_P2010E 0x80eb
+#define SVR_P2020 0x80e2
+#define SVR_P2020E 0x80ea
+#define SVR_P4040 0x8200
+#define SVR_P4040E 0x8208
+#define SVR_P4080 0x8201
+#define SVR_P4080E 0x8209
#define SVR_VER(svr) (((svr) >> 16) & 0xffff)
#define SPR_PID0 0x030 /* ..8 Process ID Register 0 */
diff --git a/sys/powerpc/mpc85xx/mpc85xx.c b/sys/powerpc/mpc85xx/mpc85xx.c
index 564bf84..f383a1b 100644
--- a/sys/powerpc/mpc85xx/mpc85xx.c
+++ b/sys/powerpc/mpc85xx/mpc85xx.c
@@ -69,12 +69,13 @@ law_getmax(void)
uint32_t ver;
ver = SVR_VER(mfspr(SPR_SVR));
- if (ver == SVR_MPC8572E || ver == SVR_MPC8572)
- return (12);
- else if (ver == SVR_MPC8548E || ver == SVR_MPC8548)
- return (10);
- else
+ if (ver == SVR_MPC8555E || ver == SVR_MPC8555)
return (8);
+ if (ver == SVR_MPC8548E || ver == SVR_MPC8548 ||
+ ver == SVR_MPC8533E || ver == SVR_MPC8533)
+ return (10);
+
+ return (12);
}
#define _LAW_SR(trgt,size) (0x80000000 | (trgt << 20) | (ffsl(size) - 2))
@@ -152,10 +153,16 @@ law_pci_target(struct resource *res, int *trgt_mem, int *trgt_io)
trgt = 1;
break;
case 0xa000:
- if (ver == SVR_MPC8572E || ver == SVR_MPC8572)
- trgt = 2;
+ if (ver == SVR_MPC8548E || ver == SVR_MPC8548)
+ trgt = 3;
else
+ trgt = 2;
+ break;
+ case 0xb000:
+ if (ver == SVR_MPC8548E || ver == SVR_MPC8548)
rv = EINVAL;
+ else
+ trgt = 3;
break;
default:
rv = ENXIO;
diff --git a/sys/powerpc/mpc85xx/mpc85xx.h b/sys/powerpc/mpc85xx/mpc85xx.h
index 7621f2c..fa3bde3 100644
--- a/sys/powerpc/mpc85xx/mpc85xx.h
+++ b/sys/powerpc/mpc85xx/mpc85xx.h
@@ -67,11 +67,6 @@
#define OCP85XX_PORDEVSR2 (CCSRBAR_VA + 0xe0014)
-#define OCP85XX_DEVDISR (CCSRBAR_VA + 0xe0070)
-#define OCP85XX_DEVDISR_PCIE0 0x20000000
-#define OCP85XX_DEVDISR_PCIE1 0x04000000
-#define OCP85XX_DEVDISR_PCIE2 0x02000000
-
/*
* Status Registers.
*/
diff --git a/sys/powerpc/mpc85xx/openpic_fdt.c b/sys/powerpc/mpc85xx/openpic_fdt.c
index 7cf18ea..1cd9369 100644
--- a/sys/powerpc/mpc85xx/openpic_fdt.c
+++ b/sys/powerpc/mpc85xx/openpic_fdt.c
@@ -37,11 +37,12 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <machine/intr_machdep.h>
-#include <machine/openpicvar.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
+#include <machine/openpicvar.h>
+
#include "pic_if.h"
static int openpic_fdt_probe(device_t);
diff --git a/sys/powerpc/ofw/ofw_machdep.c b/sys/powerpc/ofw/ofw_machdep.c
index 9af4051..fcdc953 100644
--- a/sys/powerpc/ofw/ofw_machdep.c
+++ b/sys/powerpc/ofw/ofw_machdep.c
@@ -60,17 +60,15 @@ __FBSDID("$FreeBSD$");
#include <machine/platform.h>
#include <machine/ofw_machdep.h>
-#define OFMEM_REGIONS 32
-static struct mem_region OFmem[OFMEM_REGIONS + 1], OFavail[OFMEM_REGIONS + 3];
-static struct mem_region OFfree[OFMEM_REGIONS + 3];
-static int nOFmem;
+static struct mem_region OFmem[PHYS_AVAIL_SZ], OFavail[PHYS_AVAIL_SZ];
+static struct mem_region OFfree[PHYS_AVAIL_SZ];
extern register_t ofmsr[5];
-static int (*ofwcall)(void *);
+extern void *openfirmware_entry;
static void *fdt;
int ofw_real_mode;
-int ofw_32bit_mode_entry(void *);
+int ofwcall(void *);
static void ofw_quiesce(void);
static int openfirmware(void *args);
@@ -134,11 +132,32 @@ memr_merge(struct mem_region *from, struct mem_region *to)
to->mr_size = end - to->mr_start;
}
+/*
+ * Quick sort callout for comparing memory regions.
+ */
+static int mr_cmp(const void *a, const void *b);
+
+static int
+mr_cmp(const void *a, const void *b)
+{
+ const struct mem_region *regiona;
+ const struct mem_region *regionb;
+
+ regiona = a;
+ regionb = b;
+ if (regiona->mr_start < regionb->mr_start)
+ return (-1);
+ else if (regiona->mr_start > regionb->mr_start)
+ return (1);
+ else
+ return (0);
+}
+
static int
parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output)
{
cell_t address_cells, size_cells;
- cell_t OFmem[4*(OFMEM_REGIONS + 1)];
+ cell_t OFmem[4 * PHYS_AVAIL_SZ];
int sz, i, j;
int apple_hack_mode;
phandle_t phandle;
@@ -174,8 +193,8 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output)
/*
* Get memory.
*/
- if ((node == -1) || (sz = OF_getprop(node, prop,
- OFmem, sizeof(OFmem[0]) * 4 * OFMEM_REGIONS)) <= 0)
+ if (node == -1 || (sz = OF_getprop(node, prop,
+ OFmem, sizeof(OFmem))) <= 0)
panic("Physical memory map not found");
i = 0;
@@ -225,7 +244,7 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output)
#ifdef __powerpc64__
if (apple_hack_mode) {
/* Add in regions above 4 GB to the available list */
- struct mem_region himem[OFMEM_REGIONS];
+ struct mem_region himem[16];
int hisz;
hisz = parse_ofw_memory(node, "reg", himem);
@@ -243,6 +262,81 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output)
return (sz);
}
+static int
+parse_drconf_memory(int *msz, int *asz, struct mem_region *ofmem,
+ struct mem_region *ofavail)
+{
+ phandle_t phandle;
+ vm_offset_t base;
+ int i, idx, len, lasz, lmsz, res;
+ uint32_t lmb_size[2];
+ unsigned long *dmem, flags;
+
+ lmsz = *msz;
+ lasz = *asz;
+
+ phandle = OF_finddevice("/ibm,dynamic-reconfiguration-memory");
+ if (phandle == -1)
+ /* No drconf node, return. */
+ return (0);
+
+ res = OF_getprop(phandle, "ibm,lmb-size", lmb_size, sizeof(lmb_size));
+ if (res == -1)
+ return (0);
+
+ /* Parse the /ibm,dynamic-memory.
+ The first position gives the # of entries. The next two words
+ reflect the address of the memory block. The next four words are
+ the DRC index, reserved, list index and flags.
+ (see PAPR C.6.6.2 ibm,dynamic-reconfiguration-memory)
+
+ #el Addr DRC-idx res list-idx flags
+ -------------------------------------------------
+ | 4 | 8 | 4 | 4 | 4 | 4 |....
+ -------------------------------------------------
+ */
+
+ len = OF_getproplen(phandle, "ibm,dynamic-memory");
+ if (len > 0) {
+
+ /* We have to use a variable length array on the stack
+ since we have very limited stack space.
+ */
+ cell_t arr[len/sizeof(cell_t)];
+
+ res = OF_getprop(phandle, "ibm,dynamic-memory", &arr,
+ sizeof(arr));
+ if (res == -1)
+ return (0);
+
+ /* Number of elements */
+ idx = arr[0];
+
+ /* First address. */
+ dmem = (void*)&arr[1];
+
+ for (i = 0; i < idx; i++) {
+ base = *dmem;
+ dmem += 2;
+ flags = *dmem;
+ /* Use region only if available and not reserved. */
+ if ((flags & 0x8) && !(flags & 0x80)) {
+ ofmem[lmsz].mr_start = base;
+ ofmem[lmsz].mr_size = (vm_size_t)lmb_size[1];
+ ofavail[lasz].mr_start = base;
+ ofavail[lasz].mr_size = (vm_size_t)lmb_size[1];
+ lmsz++;
+ lasz++;
+ }
+ dmem++;
+ }
+ }
+
+ *msz = lmsz;
+ *asz = lasz;
+
+ return (1);
+}
/*
* This is called during powerpc_init, before the system is really initialized.
* It shall provide the total and the available regions of RAM.
@@ -255,31 +349,62 @@ ofw_mem_regions(struct mem_region **memp, int *memsz,
struct mem_region **availp, int *availsz)
{
phandle_t phandle;
+ vm_offset_t maxphysaddr;
int asz, msz, fsz;
- int i, j;
+ int i, j, res;
int still_merging;
+ char name[31];
asz = msz = 0;
/*
- * Get memory.
+ * Get memory from all the /memory nodes.
*/
- phandle = OF_finddevice("/memory");
- if (phandle == -1)
- phandle = OF_finddevice("/memory@0");
+ for (phandle = OF_child(OF_peer(0)); phandle != 0;
+ phandle = OF_peer(phandle)) {
+ if (OF_getprop(phandle, "name", name, sizeof(name)) <= 0)
+ continue;
+ if (strncmp(name, "memory", sizeof(name)) != 0)
+ continue;
+
+ res = parse_ofw_memory(phandle, "reg", &OFmem[msz]);
+ msz += res/sizeof(struct mem_region);
+ if (OF_getproplen(phandle, "available") >= 0)
+ res = parse_ofw_memory(phandle, "available",
+ &OFavail[asz]);
+ else
+ res = parse_ofw_memory(phandle, "reg", &OFavail[asz]);
+ asz += res/sizeof(struct mem_region);
+ }
+
+ /* Check for memory in ibm,dynamic-reconfiguration-memory */
+ parse_drconf_memory(&msz, &asz, OFmem, OFavail);
- msz = parse_ofw_memory(phandle, "reg", OFmem);
- nOFmem = msz / sizeof(struct mem_region);
- asz = parse_ofw_memory(phandle, "available", OFavail);
+ qsort(OFmem, msz, sizeof(*OFmem), mr_cmp);
+ qsort(OFavail, asz, sizeof(*OFavail), mr_cmp);
*memp = OFmem;
- *memsz = nOFmem;
-
+ *memsz = msz;
+
+ /*
+ * On some firmwares (SLOF), some memory may be marked available that
+ * doesn't actually exist. This manifests as an extension of the last
+ * available segment past the end of physical memory, so truncate that
+ * one.
+ */
+ maxphysaddr = 0;
+ for (i = 0; i < msz; i++)
+ if (OFmem[i].mr_start + OFmem[i].mr_size > maxphysaddr)
+ maxphysaddr = OFmem[i].mr_start + OFmem[i].mr_size;
+
+ if (OFavail[asz - 1].mr_start + OFavail[asz - 1].mr_size > maxphysaddr)
+ OFavail[asz - 1].mr_size = maxphysaddr -
+ OFavail[asz - 1].mr_start;
+
/*
* OFavail may have overlapping regions - collapse these
* and copy out remaining regions to OFfree
*/
- asz /= sizeof(struct mem_region);
do {
still_merging = FALSE;
for (i = 0; i < asz; i++) {
@@ -318,19 +443,6 @@ OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *))
else
ofw_real_mode = 1;
- ofwcall = NULL;
-
- #ifdef __powerpc64__
- /*
- * For PPC64, we need to use some hand-written
- * asm trampolines to get to OF.
- */
- if (openfirm != NULL)
- ofwcall = ofw_32bit_mode_entry;
- #else
- ofwcall = openfirm;
- #endif
-
fdt = fdt_ptr;
#ifdef FDT_DTB_STATIC
@@ -345,7 +457,7 @@ OF_bootstrap()
{
boolean_t status = FALSE;
- if (ofwcall != NULL) {
+ if (openfirmware_entry != NULL) {
if (ofw_real_mode) {
status = OF_install(OFW_STD_REAL, 0);
} else {
@@ -481,12 +593,7 @@ openfirmware(void *args)
int result;
#ifdef SMP
struct ofw_rv_args rv_args;
- #endif
-
- if (pmap_bootstrapped && ofw_real_mode)
- args = (void *)pmap_kextract((vm_offset_t)args);
- #ifdef SMP
rv_args.args = args;
rv_args.in_progress = 1;
smp_rendezvous(smp_no_rendevous_barrier, ofw_rendezvous_dispatch,
diff --git a/sys/powerpc/ofw/ofw_real.c b/sys/powerpc/ofw/ofw_real.c
index 617f9be..1fc2ed1 100644
--- a/sys/powerpc/ofw/ofw_real.c
+++ b/sys/powerpc/ofw/ofw_real.c
@@ -205,13 +205,14 @@ ofw_real_bounce_alloc(void *junk)
/*
* Allocate a page of contiguous, wired physical memory that can
- * fit into a 32-bit address space.
+ * fit into a 32-bit address space and accessed from real mode.
*/
mtx_lock(&of_bounce_mtx);
- of_bounce_virt = contigmalloc(PAGE_SIZE, M_OFWREAL, 0,
- 0, BUS_SPACE_MAXADDR_32BIT, PAGE_SIZE, PAGE_SIZE);
+ of_bounce_virt = contigmalloc(PAGE_SIZE, M_OFWREAL, 0, 0,
+ ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT), PAGE_SIZE,
+ PAGE_SIZE);
of_bounce_phys = vtophys(of_bounce_virt);
of_bounce_size = PAGE_SIZE;
diff --git a/sys/powerpc/ofw/ofwcall32.S b/sys/powerpc/ofw/ofwcall32.S
new file mode 100644
index 0000000..06cc105
--- /dev/null
+++ b/sys/powerpc/ofw/ofwcall32.S
@@ -0,0 +1,154 @@
+/*-
+ * Copyright (C) 2009-2011 Nathan Whitehorn
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 TOOLS GMBH 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/syscall.h>
+
+#include <machine/trap.h>
+#include <machine/param.h>
+#include <machine/spr.h>
+#include <machine/asm.h>
+
+#define OFWSTKSZ 4096 /* 4K Open Firmware stack */
+
+/*
+ * Globals
+ */
+ .data
+GLOBAL(ofmsr)
+ .long 0, 0, 0, 0, 0 /* msr/sprg0-3 used in Open Firmware */
+GLOBAL(rtasmsr)
+ .long 0
+GLOBAL(openfirmware_entry)
+ .long 0 /* Open Firmware entry point */
+GLOBAL(rtas_entry)
+ .long 0 /* RTAS entry point */
+
+ .align 4
+ofwstk:
+ .space OFWSTKSZ
+rtas_regsave:
+ .space 4
+
+/*
+ * Open Firmware Entry Point. May need to enter real mode.
+ *
+ * C prototype: int ofwcall(void *callbuffer);
+ */
+
+ASENTRY(ofwcall)
+ mflr %r0
+ stw %r0,4(%r1)
+
+ /* Record the old MSR */
+ mfmsr %r6
+
+ /* read client interface handler */
+ lis %r4,openfirmware_entry@ha
+ lwz %r4,openfirmware_entry@l(%r4)
+
+ /*
+ * Set the MSR to the OF value. This has the side effect of disabling
+ * exceptions, which prevents preemption later.
+ */
+
+ lis %r5,ofmsr@ha
+ lwz %r5,ofmsr@l(%r5)
+ mtmsr %r5
+ isync
+
+ /*
+ * Set up OF stack. This needs to be potentially accessible in real mode
+ * The pointer to the current kernel stack is placed at the very
+ * top of the stack along with the old MSR so we can get them back
+ * later.
+ */
+ mr %r5,%r1
+ lis %r1,(ofwstk+OFWSTKSZ-16)@ha
+ addi %r1,%r1,(ofwstk+OFWSTKSZ-16)@l
+ stw %r5,8(%r1) /* Save real stack pointer */
+ stw %r6,12(%r1) /* Save old MSR */
+ li %r5,0
+ stw %r5,4(%r1)
+ stw %r5,0(%r1)
+
+ /* Finally, branch to OF */
+ mtctr %r4
+ bctrl
+
+ /* Reload stack pointer and MSR from the OFW stack */
+ lwz %r6,12(%r1)
+ lwz %r1,8(%r1)
+
+ /* Now set the real MSR */
+ mtmsr %r6
+ isync
+
+ /* Return */
+ lwz %r0,4(%r1)
+ mtlr %r0
+ blr
+
+/*
+ * RTAS Entry Point. Similar to the OF one, but simpler (no separate stack)
+ *
+ * C prototype: int rtascall(void *callbuffer, void *rtas_privdat);
+ */
+
+ASENTRY(rtascall)
+ mflr %r0
+ stw %r0,4(%r1)
+
+ /* Record the old MSR to real-mode-accessible area */
+ mfmsr %r0
+ lis %r5,rtas_regsave@ha
+ stw %r0,rtas_regsave@l(%r5)
+
+ /* read client interface handler */
+ lis %r5,rtas_entry@ha
+ lwz %r5,rtas_entry@l(%r5)
+
+ /* Set the MSR to the RTAS value */
+ lis %r6,rtasmsr@ha
+ lwz %r6,rtasmsr@l(%r6)
+ mtmsr %r6
+ isync
+
+ /* Branch to RTAS */
+ mtctr %r5
+ bctrl
+
+ /* Now set the MSR back */
+ lis %r6,rtas_regsave@ha
+ lwz %r6,rtas_regsave@l(%r6)
+ mtmsr %r6
+ isync
+
+ /* And return */
+ lwz %r0,4(%r1)
+ mtlr %r0
+ blr
+
diff --git a/sys/powerpc/ofw/ofwcall64.S b/sys/powerpc/ofw/ofwcall64.S
new file mode 100644
index 0000000..1fb78e8
--- /dev/null
+++ b/sys/powerpc/ofw/ofwcall64.S
@@ -0,0 +1,290 @@
+/*-
+ * Copyright (C) 2009-2011 Nathan Whitehorn
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 TOOLS GMBH 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/syscall.h>
+
+#include <machine/trap.h>
+#include <machine/param.h>
+#include <machine/spr.h>
+#include <machine/asm.h>
+
+#define OFWSTKSZ 4096 /* 4K Open Firmware stack */
+
+/*
+ * Globals
+ */
+ .data
+ .align 4
+ofwstk:
+ .space OFWSTKSZ
+rtas_regsave:
+ .space 24 /* 3 * sizeof(register_t) */
+GLOBAL(ofmsr)
+ .llong 0, 0, 0, 0, 0 /* msr/sprg0-3 used in Open Firmware */
+GLOBAL(rtasmsr)
+ .llong 0
+GLOBAL(openfirmware_entry)
+ .llong 0 /* Open Firmware entry point */
+GLOBAL(rtas_entry)
+ .llong 0 /* RTAS entry point */
+
+/*
+ * Open Firmware Real-mode Entry Point. This is a huge pain.
+ */
+
+ASENTRY(ofwcall)
+ mflr %r0
+ std %r0,16(%r1)
+ stdu %r1,-208(%r1)
+
+ /*
+ * We need to save the following, because OF's register save/
+ * restore code assumes that the contents of registers are
+ * at most 32 bits wide: lr, cr, r2, r13-r31, the old MSR. These
+ * get placed in that order in the stack.
+ */
+
+ mfcr %r4
+ std %r4,48(%r1)
+ std %r13,56(%r1)
+ std %r14,64(%r1)
+ std %r15,72(%r1)
+ std %r16,80(%r1)
+ std %r17,88(%r1)
+ std %r18,96(%r1)
+ std %r19,104(%r1)
+ std %r20,112(%r1)
+ std %r21,120(%r1)
+ std %r22,128(%r1)
+ std %r23,136(%r1)
+ std %r24,144(%r1)
+ std %r25,152(%r1)
+ std %r26,160(%r1)
+ std %r27,168(%r1)
+ std %r28,176(%r1)
+ std %r29,184(%r1)
+ std %r30,192(%r1)
+ std %r31,200(%r1)
+
+ /* Record the old MSR */
+ mfmsr %r6
+
+ /* read client interface handler */
+ lis %r4,openfirmware_entry@ha
+ ld %r4,openfirmware_entry@l(%r4)
+
+ /*
+ * Set the MSR to the OF value. This has the side effect of disabling
+ * exceptions, which is important for the next few steps.
+ */
+
+ lis %r5,ofmsr@ha
+ ld %r5,ofmsr@l(%r5)
+ mtmsrd %r5
+ isync
+
+ /*
+ * Set up OF stack. This needs to be accessible in real mode and
+ * use the 32-bit ABI stack frame format. The pointer to the current
+ * kernel stack is placed at the very top of the stack along with
+ * the old MSR so we can get them back later.
+ */
+ mr %r5,%r1
+ lis %r1,(ofwstk+OFWSTKSZ-32)@ha
+ addi %r1,%r1,(ofwstk+OFWSTKSZ-32)@l
+ std %r5,8(%r1) /* Save real stack pointer */
+ std %r2,16(%r1) /* Save old TOC */
+ std %r6,24(%r1) /* Save old MSR */
+ li %r5,0
+ stw %r5,4(%r1)
+ stw %r5,0(%r1)
+
+ /* Finally, branch to OF */
+ mtctr %r4
+ bctrl
+
+ /* Reload stack pointer and MSR from the OFW stack */
+ ld %r6,24(%r1)
+ ld %r2,16(%r1)
+ ld %r1,8(%r1)
+
+ /* Now set the real MSR */
+ mtmsrd %r6
+ isync
+
+ /* Sign-extend the return value from OF */
+ extsw %r3,%r3
+
+ /* Restore all the non-volatile registers */
+ ld %r5,48(%r1)
+ mtcr %r5
+ ld %r13,56(%r1)
+ ld %r14,64(%r1)
+ ld %r15,72(%r1)
+ ld %r16,80(%r1)
+ ld %r17,88(%r1)
+ ld %r18,96(%r1)
+ ld %r19,104(%r1)
+ ld %r20,112(%r1)
+ ld %r21,120(%r1)
+ ld %r22,128(%r1)
+ ld %r23,136(%r1)
+ ld %r24,144(%r1)
+ ld %r25,152(%r1)
+ ld %r26,160(%r1)
+ ld %r27,168(%r1)
+ ld %r28,176(%r1)
+ ld %r29,184(%r1)
+ ld %r30,192(%r1)
+ ld %r31,200(%r1)
+
+ /* Restore the stack and link register */
+ ld %r1,0(%r1)
+ ld %r0,16(%r1)
+ mtlr %r0
+ blr
+
+/*
+ * RTAS 32-bit Entry Point. Similar to the OF one, but simpler (no separate
+ * stack)
+ *
+ * C prototype: int rtascall(void *callbuffer, void *rtas_privdat);
+ */
+
+ASENTRY(rtascall)
+ mflr %r0
+ std %r0,16(%r1)
+ stdu %r1,-208(%r1)
+
+ /*
+ * We need to save the following, because RTAS's register save/
+ * restore code assumes that the contents of registers are
+ * at most 32 bits wide: lr, cr, r2, r13-r31, the old MSR. These
+ * get placed in that order in the stack.
+ */
+
+ mfcr %r5
+ std %r5,48(%r1)
+ std %r13,56(%r1)
+ std %r14,64(%r1)
+ std %r15,72(%r1)
+ std %r16,80(%r1)
+ std %r17,88(%r1)
+ std %r18,96(%r1)
+ std %r19,104(%r1)
+ std %r20,112(%r1)
+ std %r21,120(%r1)
+ std %r22,128(%r1)
+ std %r23,136(%r1)
+ std %r24,144(%r1)
+ std %r25,152(%r1)
+ std %r26,160(%r1)
+ std %r27,168(%r1)
+ std %r28,176(%r1)
+ std %r29,184(%r1)
+ std %r30,192(%r1)
+ std %r31,200(%r1)
+
+ /* Record the old MSR */
+ mfmsr %r6
+
+ /* read client interface handler */
+ lis %r5,rtas_entry@ha
+ ld %r5,rtas_entry@l(%r5)
+
+ /*
+ * Set the MSR to the RTAS value. This has the side effect of disabling
+ * exceptions, which is important for the next few steps.
+ */
+
+ lis %r7,rtasmsr@ha
+ ld %r7,rtasmsr@l(%r7)
+ mtmsrd %r7
+ isync
+
+ /*
+ * Set up RTAS register save area, so that we can get back all of
+ * our 64-bit pointers. Save our stack pointer, the TOC, and the MSR.
+ * Put this in r1, since RTAS is obliged to save it. Kernel globals
+ * are below 4 GB, so this is safe.
+ */
+ mr %r7,%r1
+ lis %r1,rtas_regsave@ha
+ addi %r1,%r1,rtas_regsave@l
+ std %r7,0(%r1) /* Save 64-bit stack pointer */
+ std %r2,8(%r1) /* Save TOC */
+ std %r6,16(%r1) /* Save MSR */
+
+ /* Finally, branch to RTAS */
+ mtctr %r5
+ bctrl
+
+ /*
+ * Reload stack pointer and MSR from the reg save area in r1. We are
+ * running in 32-bit mode at this point, so it doesn't matter if r1
+ * has become sign-extended.
+ */
+ ld %r6,16(%r1)
+ ld %r2,8(%r1)
+ ld %r1,0(%r1)
+
+ /* Now set the real MSR */
+ mtmsrd %r6
+ isync
+
+ /* Sign-extend the return value from RTAS */
+ extsw %r3,%r3
+
+ /* Restore all the non-volatile registers */
+ ld %r5,48(%r1)
+ mtcr %r5
+ ld %r13,56(%r1)
+ ld %r14,64(%r1)
+ ld %r15,72(%r1)
+ ld %r16,80(%r1)
+ ld %r17,88(%r1)
+ ld %r18,96(%r1)
+ ld %r19,104(%r1)
+ ld %r20,112(%r1)
+ ld %r21,120(%r1)
+ ld %r22,128(%r1)
+ ld %r23,136(%r1)
+ ld %r24,144(%r1)
+ ld %r25,152(%r1)
+ ld %r26,160(%r1)
+ ld %r27,168(%r1)
+ ld %r28,176(%r1)
+ ld %r29,184(%r1)
+ ld %r30,192(%r1)
+ ld %r31,200(%r1)
+
+ /* Restore the stack and link register */
+ ld %r1,0(%r1)
+ ld %r0,16(%r1)
+ mtlr %r0
+ blr
+
diff --git a/sys/powerpc/aim/ofwmagic.S b/sys/powerpc/ofw/ofwmagic.S
index f44f1e5..f44f1e5 100644
--- a/sys/powerpc/aim/ofwmagic.S
+++ b/sys/powerpc/ofw/ofwmagic.S
diff --git a/sys/powerpc/ofw/rtas.c b/sys/powerpc/ofw/rtas.c
new file mode 100644
index 0000000..59692c9
--- /dev/null
+++ b/sys/powerpc/ofw/rtas.c
@@ -0,0 +1,243 @@
+/*-
+ * Copyright (c) 2011 Nathan Whitehorn
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
+
+#include <vm/vm.h>
+#include <vm/vm_page.h>
+#include <vm/pmap.h>
+
+#include <machine/bus.h>
+#include <machine/md_var.h>
+#include <machine/pmap.h>
+#include <machine/rtas.h>
+#include <machine/stdarg.h>
+
+#include <dev/ofw/openfirm.h>
+
+MALLOC_DEFINE(M_RTAS, "rtas", "Run Time Abstraction Service");
+
+static vm_offset_t rtas_bounce_phys;
+static caddr_t rtas_bounce_virt;
+static off_t rtas_bounce_offset;
+static size_t rtas_bounce_size;
+static uintptr_t rtas_private_data;
+static struct mtx rtas_mtx;
+static phandle_t rtas;
+
+/* From ofwcall.S */
+int rtascall(vm_offset_t callbuffer, uintptr_t rtas_privdat);
+extern uintptr_t rtas_entry;
+extern register_t rtasmsr;
+
+/*
+ * After the VM is up, allocate RTAS memory and instantiate it
+ */
+
+static void rtas_setup(void *);
+
+SYSINIT(rtas_setup, SI_SUB_KMEM, SI_ORDER_ANY, rtas_setup, NULL);
+
+static void
+rtas_setup(void *junk)
+{
+ ihandle_t rtasi;
+ cell_t rtas_size = 0, rtas_ptr;
+ char path[31];
+ int result;
+
+ rtas = OF_finddevice("/rtas");
+ if (rtas == -1) {
+ rtas = 0;
+ return;
+ }
+ OF_package_to_path(rtas, path, sizeof(path));
+ rtasi = OF_open(path);
+ if (rtasi == 0) {
+ rtas = 0;
+ printf("Error initializing RTAS: could not open node\n");
+ return;
+ }
+
+ mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0);
+
+ /* RTAS must be called with everything turned off in MSR */
+ rtasmsr = mfmsr();
+ rtasmsr &= ~(PSL_IR | PSL_DR | PSL_EE | PSL_SE);
+ #ifdef __powerpc64__
+ rtasmsr &= ~PSL_SF;
+ #endif
+
+ /*
+ * Allocate rtas_size + one page of contiguous, wired physical memory
+ * that can fit into a 32-bit address space and accessed from real mode.
+ * This is used both to bounce arguments and for RTAS private data.
+ *
+ * It must be 4KB-aligned and not cross a 256 MB boundary.
+ */
+
+ OF_getprop(rtas, "rtas-size", &rtas_size, sizeof(rtas_size));
+ rtas_size = round_page(rtas_size);
+ rtas_bounce_virt = contigmalloc(rtas_size + PAGE_SIZE, M_RTAS, 0, 0,
+ ulmin(platform_real_maxaddr(), BUS_SPACE_MAXADDR_32BIT),
+ 4096, 256*1024*1024);
+
+ rtas_private_data = vtophys(rtas_bounce_virt);
+ rtas_bounce_virt += rtas_size; /* Actual bounce area */
+ rtas_bounce_phys = vtophys(rtas_bounce_virt);
+ rtas_bounce_size = PAGE_SIZE;
+
+ /*
+ * Instantiate RTAS. We always use the 32-bit version.
+ */
+
+ result = OF_call_method("instantiate-rtas", rtasi, 1, 1,
+ (cell_t)rtas_private_data, &rtas_ptr);
+ OF_close(rtasi);
+
+ if (result != 0) {
+ rtas = 0;
+ rtas_ptr = 0;
+ printf("Error initializing RTAS (%d)\n", result);
+ return;
+ }
+
+ rtas_entry = (uintptr_t)(rtas_ptr);
+}
+
+static cell_t
+rtas_real_map(const void *buf, size_t len)
+{
+ cell_t phys;
+
+ mtx_assert(&rtas_mtx, MA_OWNED);
+
+ /*
+ * Make sure the bounce page offset satisfies any reasonable
+ * alignment constraint.
+ */
+ rtas_bounce_offset += sizeof(register_t) -
+ (rtas_bounce_offset % sizeof(register_t));
+
+ if (rtas_bounce_offset + len > rtas_bounce_size) {
+ panic("Oversize RTAS call!");
+ return 0;
+ }
+
+ if (buf != NULL)
+ memcpy(rtas_bounce_virt + rtas_bounce_offset, buf, len);
+ else
+ return (0);
+
+ phys = rtas_bounce_phys + rtas_bounce_offset;
+ rtas_bounce_offset += len;
+
+ return (phys);
+}
+
+static void
+rtas_real_unmap(cell_t physaddr, void *buf, size_t len)
+{
+ mtx_assert(&rtas_mtx, MA_OWNED);
+
+ if (physaddr == 0)
+ return;
+
+ memcpy(buf, rtas_bounce_virt + (physaddr - rtas_bounce_phys), len);
+}
+
+/* Check if we have RTAS */
+int
+rtas_exists(void)
+{
+ return (rtas != 0);
+}
+
+/* Call an RTAS method by token */
+int
+rtas_call_method(cell_t token, int nargs, int nreturns, ...)
+{
+ vm_offset_t argsptr;
+ va_list ap;
+ struct {
+ cell_t token;
+ cell_t nargs;
+ cell_t nreturns;
+ cell_t args_n_results[12];
+ } args;
+ int n, result;
+
+ if (!rtas_exists() || nargs + nreturns > 12)
+ return (-1);
+
+ args.token = token;
+ va_start(ap, nreturns);
+
+ mtx_lock(&rtas_mtx);
+ rtas_bounce_offset = 0;
+
+ args.nargs = nargs;
+ args.nreturns = nreturns;
+
+ for (n = 0; n < nargs; n++)
+ args.args_n_results[n] = va_arg(ap, cell_t);
+
+ argsptr = rtas_real_map(&args, sizeof(args));
+ result = rtascall(argsptr, rtas_private_data);
+ rtas_real_unmap(argsptr, &args, sizeof(args));
+ mtx_unlock(&rtas_mtx);
+
+ if (result < 0)
+ return (result);
+
+ for (n = nargs; n < nargs + nreturns; n++)
+ *va_arg(ap, cell_t *) = args.args_n_results[n];
+ return (result);
+}
+
+/* Look up an RTAS token */
+cell_t
+rtas_token_lookup(const char *method)
+{
+ cell_t token;
+
+ if (!rtas_exists())
+ return (-1);
+
+ if (OF_getprop(rtas, method, &token, sizeof(token)) == -1)
+ return (-1);
+
+ return (token);
+}
+
+
diff --git a/sys/powerpc/powermac/fcu.c b/sys/powerpc/powermac/fcu.c
index 004b4db..7ac9b1b 100644
--- a/sys/powerpc/powermac/fcu.c
+++ b/sys/powerpc/powermac/fcu.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
+#include <powerpc/powermac/powermac_thermal.h>
/* FCU registers
* /u3@0,f8000000/i2c@f8001000/fan@15e
@@ -66,10 +67,10 @@ __FBSDID("$FreeBSD$");
#define FCU_PWM_SGET(x) 0x30 + (x) * 2 /* Set or get PWM. */
struct fcu_fan {
+ struct pmac_fan fan;
+ device_t dev;
+
int id;
- cell_t min;
- cell_t max;
- char location[32];
enum {
FCU_FAN_RPM,
FCU_FAN_PWM
@@ -103,9 +104,9 @@ static int fcu_attach(device_t);
/* Utility functions */
static void fcu_attach_fans(device_t dev);
static int fcu_fill_fan_prop(device_t dev);
-static int fcu_fan_set_rpm(device_t dev, struct fcu_fan *fan, int rpm);
-static int fcu_fan_get_rpm(device_t dev, struct fcu_fan *fan, int *rpm);
-static int fcu_fan_set_pwm(device_t dev, struct fcu_fan *fan, int pwm);
+static int fcu_fan_set_rpm(struct fcu_fan *fan, int rpm);
+static int fcu_fan_get_rpm(struct fcu_fan *fan);
+static int fcu_fan_set_pwm(struct fcu_fan *fan, int pwm);
static int fcu_fan_get_pwm(device_t dev, struct fcu_fan *fan, int *pwm,
int *rpm);
static int fcu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS);
@@ -137,6 +138,8 @@ fcu_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff,
int len)
{
unsigned char buf[4];
+ int try = 0;
+
struct iic_msg msg[] = {
{ addr, IIC_M_WR, 0, buf }
};
@@ -144,33 +147,46 @@ fcu_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff,
msg[0].len = len + 1;
buf[0] = reg;
memcpy(buf + 1, buff, len);
- if (iicbus_transfer(dev, msg, 1) != 0) {
- device_printf(dev, "iicbus write failed\n");
- return (EIO);
- }
- return (0);
+ for (;;)
+ {
+ if (iicbus_transfer(dev, msg, 1) == 0)
+ return (0);
+ if (++try > 5) {
+ device_printf(dev, "iicbus write failed\n");
+ return (-1);
+ }
+ pause("fcu_write", hz);
+ }
}
static int
fcu_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data)
{
uint8_t buf[4];
+ int err, try = 0;
struct iic_msg msg[2] = {
{ addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
{ addr, IIC_M_RD, 1, buf },
};
- if (iicbus_transfer(dev, msg, 2) != 0) {
- device_printf(dev, "iicbus read failed\n");
- return (EIO);
+ for (;;)
+ {
+ err = iicbus_transfer(dev, msg, 2);
+ if (err != 0)
+ goto retry;
+
+ *data = *((uint8_t*)buf);
+ return (0);
+ retry:
+ if (++try > 5) {
+ device_printf(dev, "iicbus read failed\n");
+ return (-1);
+ }
+ pause("fcu_read_1", hz);
}
-
- *data = *((uint8_t*)buf);
-
- return (0);
}
static int
@@ -249,95 +265,102 @@ fcu_start(void *xdev)
}
static int
-fcu_fan_set_rpm(device_t dev, struct fcu_fan *fan, int rpm)
+fcu_fan_set_rpm(struct fcu_fan *fan, int rpm)
{
uint8_t reg;
struct fcu_softc *sc;
unsigned char buf[2];
- sc = device_get_softc(dev);
+ sc = device_get_softc(fan->dev);
/* Clamp to allowed range */
- rpm = max(fan->min, rpm);
- rpm = min(fan->max, rpm);
+ rpm = max(fan->fan.min_rpm, rpm);
+ rpm = min(fan->fan.max_rpm, rpm);
if (fan->type == FCU_FAN_RPM) {
reg = FCU_RPM_SET(fan->id);
fan->setpoint = rpm;
} else {
- device_printf(dev, "Unknown fan type: %d\n", fan->type);
- return (EIO);
+ device_printf(fan->dev, "Unknown fan type: %d\n", fan->type);
+ return (-1);
}
buf[0] = rpm >> (8 - fcu_rpm_shift);
buf[1] = rpm << fcu_rpm_shift;
- fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 2);
+ if (fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 2) < 0)
+ return (-1);
return (0);
}
static int
-fcu_fan_get_rpm(device_t dev, struct fcu_fan *fan, int *rpm)
+fcu_fan_get_rpm(struct fcu_fan *fan)
{
uint8_t reg;
struct fcu_softc *sc;
uint8_t buff[2] = { 0, 0 };
uint8_t active = 0, avail = 0, fail = 0;
+ int rpm;
- sc = device_get_softc(dev);
+ sc = device_get_softc(fan->dev);
if (fan->type == FCU_FAN_RPM) {
/* Check if the fan is available. */
reg = FCU_RPM_AVAILABLE;
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail) < 0)
+ return (-1);
if ((avail & (1 << fan->id)) == 0) {
- device_printf(dev, "RPM Fan not available ID: %d\n",
- fan->id);
- return (EIO);
+ device_printf(fan->dev,
+ "RPM Fan not available ID: %d\n", fan->id);
+ return (-1);
}
/* Check if we have a failed fan. */
reg = FCU_RPM_FAIL;
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail) < 0)
+ return (-1);
if ((fail & (1 << fan->id)) != 0) {
- device_printf(dev, "RPM Fan failed ID: %d\n", fan->id);
- return (EIO);
+ device_printf(fan->dev,
+ "RPM Fan failed ID: %d\n", fan->id);
+ return (-1);
}
/* Check if fan is active. */
reg = FCU_RPM_ACTIVE;
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active) < 0)
+ return (-1);
if ((active & (1 << fan->id)) == 0) {
- device_printf(dev, "RPM Fan not active ID: %d\n",
+ device_printf(fan->dev, "RPM Fan not active ID: %d\n",
fan->id);
- return (ENXIO);
+ return (-1);
}
reg = FCU_RPM_READ(fan->id);
} else {
- device_printf(dev, "Unknown fan type: %d\n", fan->type);
- return (EIO);
+ device_printf(fan->dev, "Unknown fan type: %d\n", fan->type);
+ return (-1);
}
/* It seems that we can read the fans rpm. */
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buff);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buff) < 0)
+ return (-1);
- *rpm = (buff[0] << (8 - fcu_rpm_shift)) | buff[1] >> fcu_rpm_shift;
+ rpm = (buff[0] << (8 - fcu_rpm_shift)) | buff[1] >> fcu_rpm_shift;
- return (0);
+ return (rpm);
}
static int
-fcu_fan_set_pwm(device_t dev, struct fcu_fan *fan, int pwm)
+fcu_fan_set_pwm(struct fcu_fan *fan, int pwm)
{
uint8_t reg;
struct fcu_softc *sc;
uint8_t buf[2];
- sc = device_get_softc(dev);
+ sc = device_get_softc(fan->dev);
/* Clamp to allowed range */
- pwm = max(fan->min, pwm);
- pwm = min(fan->max, pwm);
+ pwm = max(fan->fan.min_rpm, pwm);
+ pwm = min(fan->fan.max_rpm, pwm);
if (fan->type == FCU_FAN_PWM) {
reg = FCU_PWM_SGET(fan->id);
@@ -347,14 +370,14 @@ fcu_fan_set_pwm(device_t dev, struct fcu_fan *fan, int pwm)
pwm = 30;
fan->setpoint = pwm;
} else {
- device_printf(dev, "Unknown fan type: %d\n", fan->type);
+ device_printf(fan->dev, "Unknown fan type: %d\n", fan->type);
return (EIO);
}
buf[0] = (pwm * 2550) / 1000;
- fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 1);
-
+ if (fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 1) < 0)
+ return (-1);
return (0);
}
@@ -371,26 +394,29 @@ fcu_fan_get_pwm(device_t dev, struct fcu_fan *fan, int *pwm, int *rpm)
if (fan->type == FCU_FAN_PWM) {
/* Check if the fan is available. */
reg = FCU_PWM_AVAILABLE;
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail) < 0)
+ return (-1);
if ((avail & (1 << fan->id)) == 0) {
device_printf(dev, "PWM Fan not available ID: %d\n",
fan->id);
- return (EIO);
+ return (-1);
}
/* Check if we have a failed fan. */
reg = FCU_PWM_FAIL;
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail) < 0)
+ return (-1);
if ((fail & (1 << fan->id)) != 0) {
device_printf(dev, "PWM Fan failed ID: %d\n", fan->id);
- return (EIO);
+ return (-1);
}
/* Check if fan is active. */
reg = FCU_PWM_ACTIVE;
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active) < 0)
+ return (-1);
if ((active & (1 << fan->id)) == 0) {
device_printf(dev, "PWM Fan not active ID: %d\n",
fan->id);
- return (ENXIO);
+ return (-1);
}
reg = FCU_PWM_SGET(fan->id);
} else {
@@ -399,13 +425,16 @@ fcu_fan_get_pwm(device_t dev, struct fcu_fan *fan, int *pwm, int *rpm)
}
/* It seems that we can read the fans pwm. */
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buf);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buf) < 0)
+ return (-1);
*pwm = (buf[0] * 1000) / 2550;
/* Now read the rpm. */
reg = FCU_PWM_RPM(fan->id);
- fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buf);
+ if (fcu_read_1(sc->sc_dev, sc->sc_addr, reg, buf) < 0)
+ return (-1);
+
*rpm = (buf[0] << (8 - fcu_rpm_shift)) | buf[1] >> fcu_rpm_shift;
return (0);
@@ -434,7 +463,7 @@ fcu_fill_fan_prop(device_t dev)
sizeof(location));
while (len < prop_len) {
if (sc->sc_fans != NULL) {
- strcpy(sc->sc_fans[i].location, location + len);
+ strcpy(sc->sc_fans[i].fan.name, location + len);
}
prev_len = strlen(location + len) + 1;
len += prev_len;
@@ -463,6 +492,33 @@ fcu_fill_fan_prop(device_t dev)
for (j = 0; j < i; j++)
sc->sc_fans[j].id = ((id[j] >> 8) & 0x0f) % 8;
+ /* Fill the fan zone property. */
+ prop_len = OF_getprop(child, "hwctrl-zone", id, sizeof(id));
+ for (j = 0; j < i; j++)
+ sc->sc_fans[j].fan.zone = id[j];
+
+ /* Finish setting up fan properties */
+ for (j = 0; j < i; j++) {
+ sc->sc_fans[j].dev = sc->sc_dev;
+ if (sc->sc_fans[j].type == FCU_FAN_RPM) {
+ sc->sc_fans[j].fan.min_rpm = 4800 >> fcu_rpm_shift;
+ sc->sc_fans[j].fan.max_rpm = 56000 >> fcu_rpm_shift;
+ sc->sc_fans[j].setpoint =
+ fcu_fan_get_rpm(&sc->sc_fans[j]);
+ sc->sc_fans[j].fan.read =
+ (int (*)(struct pmac_fan *))(fcu_fan_get_rpm);
+ sc->sc_fans[j].fan.set =
+ (int (*)(struct pmac_fan *, int))(fcu_fan_set_rpm);
+ } else {
+ sc->sc_fans[j].fan.min_rpm = 40; /* Percent */
+ sc->sc_fans[j].fan.max_rpm = 100;
+ sc->sc_fans[j].fan.read = NULL;
+ sc->sc_fans[j].fan.set =
+ (int (*)(struct pmac_fan *, int))(fcu_fan_set_pwm);
+ }
+ sc->sc_fans[j].fan.default_rpm = sc->sc_fans[j].fan.max_rpm;
+ }
+
return (i);
}
@@ -472,16 +528,20 @@ fcu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS)
device_t fcu;
struct fcu_softc *sc;
struct fcu_fan *fan;
- int rpm = 0, pwm = 0, error;
+ int rpm = 0, pwm = 0, error = 0;
fcu = arg1;
sc = device_get_softc(fcu);
fan = &sc->sc_fans[arg2 & 0x00ff];
if (fan->type == FCU_FAN_RPM) {
- fcu_fan_get_rpm(fcu, fan, &rpm);
+ rpm = fcu_fan_get_rpm(fan);
+ if (rpm < 0)
+ return (-1);
error = sysctl_handle_int(oidp, &rpm, 0, req);
} else {
- fcu_fan_get_pwm(fcu, fan, &pwm, &rpm);
+ error = fcu_fan_get_pwm(fcu, fan, &pwm, &rpm);
+ if (error < 0)
+ return (-1);
switch (arg2 & 0xff00) {
case FCU_PWM_SYSCTL_PWM:
@@ -504,9 +564,9 @@ fcu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS)
return (error);
if (fan->type == FCU_FAN_RPM)
- return (fcu_fan_set_rpm(fcu, fan, rpm));
+ return (fcu_fan_set_rpm(fan, rpm));
else
- return (fcu_fan_set_pwm(fcu, fan, pwm));
+ return (fcu_fan_set_pwm(fan, pwm));
}
static void
@@ -543,39 +603,36 @@ fcu_attach_fans(device_t dev)
/* Now we can fill the properties into the allocated struct. */
sc->sc_nfans = fcu_fill_fan_prop(dev);
+ /* Register fans with pmac_thermal */
+ for (i = 0; i < sc->sc_nfans; i++)
+ pmac_thermal_fan_register(&sc->sc_fans[i].fan);
+
/* Add sysctls for the fans. */
for (i = 0; i < sc->sc_nfans; i++) {
- for (j = 0; j < strlen(sc->sc_fans[i].location); j++) {
- sysctl_name[j] = tolower(sc->sc_fans[i].location[j]);
+ for (j = 0; j < strlen(sc->sc_fans[i].fan.name); j++) {
+ sysctl_name[j] = tolower(sc->sc_fans[i].fan.name[j]);
if (isspace(sysctl_name[j]))
sysctl_name[j] = '_';
}
sysctl_name[j] = 0;
if (sc->sc_fans[i].type == FCU_FAN_RPM) {
- sc->sc_fans[i].min = 2400 >> fcu_rpm_shift;
- sc->sc_fans[i].max = 56000 >> fcu_rpm_shift;
- fcu_fan_get_rpm(dev, &sc->sc_fans[i],
- &sc->sc_fans[i].setpoint);
-
oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid),
OID_AUTO, sysctl_name,
CTLFLAG_RD, 0, "Fan Information");
SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
"minrpm", CTLTYPE_INT | CTLFLAG_RD,
- &(sc->sc_fans[i].min), sizeof(cell_t),
- "Minimum allowed RPM");
+ &(sc->sc_fans[i].fan.min_rpm),
+ sizeof(int), "Minimum allowed RPM");
SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
"maxrpm", CTLTYPE_INT | CTLFLAG_RD,
- &(sc->sc_fans[i].max), sizeof(cell_t),
- "Maximum allowed RPM");
+ &(sc->sc_fans[i].fan.max_rpm),
+ sizeof(int), "Maximum allowed RPM");
/* I use i to pass the fan id. */
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
"rpm", CTLTYPE_INT | CTLFLAG_RW, dev, i,
fcu_fanrpm_sysctl, "I", "Fan RPM");
} else {
- sc->sc_fans[i].min = 30;
- sc->sc_fans[i].max = 100;
fcu_fan_get_pwm(dev, &sc->sc_fans[i],
&sc->sc_fans[i].setpoint,
&sc->sc_fans[i].rpm);
@@ -585,12 +642,12 @@ fcu_attach_fans(device_t dev)
CTLFLAG_RD, 0, "Fan Information");
SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
"minpwm", CTLTYPE_INT | CTLFLAG_RD,
- &(sc->sc_fans[i].min), sizeof(cell_t),
- "Minimum allowed PWM in %");
+ &(sc->sc_fans[i].fan.min_rpm),
+ sizeof(int), "Minimum allowed PWM in %");
SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
"maxpwm", CTLTYPE_INT | CTLFLAG_RD,
- &(sc->sc_fans[i].max), sizeof(cell_t),
- "Maximum allowed PWM in %");
+ &(sc->sc_fans[i].fan.max_rpm),
+ sizeof(int), "Maximum allowed PWM in %");
/* I use i to pass the fan id or'ed with the type
* of info I want to display/modify.
*/
@@ -610,7 +667,7 @@ fcu_attach_fans(device_t dev)
device_printf(dev, "Fans\n");
for (i = 0; i < sc->sc_nfans; i++) {
device_printf(dev, "Location: %s type: %d ID: %d "
- "RPM: %d\n", sc->sc_fans[i].location,
+ "RPM: %d\n", sc->sc_fans[i].fan.name,
sc->sc_fans[i].type, sc->sc_fans[i].id,
(sc->sc_fans[i].type == FCU_FAN_RPM) ?
sc->sc_fans[i].setpoint :
diff --git a/sys/powerpc/powermac/powermac_thermal.c b/sys/powerpc/powermac/powermac_thermal.c
new file mode 100644
index 0000000..9c1f59d
--- /dev/null
+++ b/sys/powerpc/powermac/powermac_thermal.c
@@ -0,0 +1,183 @@
+/*-
+ * Copyright (c) 2009-2011 Nathan Whitehorn
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
+
+#include <sys/types.h>
+#include <sys/kthread.h>
+#include <sys/malloc.h>
+#include <sys/reboot.h>
+#include <sys/sysctl.h>
+#include <sys/queue.h>
+
+#include "powermac_thermal.h"
+
+static void fan_management_proc(void);
+static void pmac_therm_manage_fans(void);
+
+static struct proc *pmac_them_proc;
+static int enable_pmac_thermal = 1;
+
+static struct kproc_desc pmac_therm_kp = {
+ "pmac_thermal",
+ fan_management_proc,
+ &pmac_them_proc
+};
+
+SYSINIT(pmac_therm_setup, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, kproc_start,
+ &pmac_therm_kp);
+SYSCTL_INT(_machdep, OID_AUTO, manage_fans, CTLFLAG_RW | CTLFLAG_TUN,
+ &enable_pmac_thermal, 1, "Enable automatic fan management");
+MALLOC_DEFINE(M_PMACTHERM, "pmactherm", "Powermac Thermal Management");
+
+struct pmac_fan_le {
+ struct pmac_fan *fan;
+ int last_val;
+ SLIST_ENTRY(pmac_fan_le) entries;
+};
+struct pmac_sens_le {
+ struct pmac_therm *sensor;
+ int last_val;
+ SLIST_ENTRY(pmac_sens_le) entries;
+};
+static SLIST_HEAD(pmac_fans, pmac_fan_le) fans = SLIST_HEAD_INITIALIZER(fans);
+static SLIST_HEAD(pmac_sensors, pmac_sens_le) sensors =
+ SLIST_HEAD_INITIALIZER(sensors);
+
+static void
+fan_management_proc(void)
+{
+ /* Nothing to manage? */
+ if (SLIST_EMPTY(&fans))
+ kproc_exit(0);
+
+ while (1) {
+ pmac_therm_manage_fans();
+ pause("pmac_therm", hz);
+ }
+}
+
+static void
+pmac_therm_manage_fans(void)
+{
+ struct pmac_sens_le *sensor;
+ struct pmac_fan_le *fan;
+ int average_excess, max_excess_zone, frac_excess;
+ int nsens, nsens_zone;
+ int temp;
+
+ if (!enable_pmac_thermal)
+ return;
+
+ /* Read all the sensors */
+ SLIST_FOREACH(sensor, &sensors, entries) {
+ temp = sensor->sensor->read(sensor->sensor);
+ if (temp > 0) /* Use the previous temp in case of error */
+ sensor->last_val = temp;
+
+ if (sensor->last_val > sensor->sensor->max_temp) {
+ printf("WARNING: Current temperature (%s: %d.%d C) "
+ "exceeds critical temperature (%d.%d C)! "
+ "Shutting down!\n", sensor->sensor->name,
+ (sensor->last_val - ZERO_C_TO_K) / 10,
+ (sensor->last_val - ZERO_C_TO_K) % 10,
+ (sensor->sensor->max_temp - ZERO_C_TO_K) / 10,
+ (sensor->sensor->max_temp - ZERO_C_TO_K) % 10);
+ shutdown_nice(RB_POWEROFF);
+ }
+ }
+
+ /* Set all the fans */
+ SLIST_FOREACH(fan, &fans, entries) {
+ nsens = nsens_zone = 0;
+ average_excess = max_excess_zone = 0;
+ SLIST_FOREACH(sensor, &sensors, entries) {
+ frac_excess = (sensor->last_val -
+ sensor->sensor->target_temp)*100 /
+ (sensor->sensor->max_temp -
+ sensor->sensor->target_temp);
+ if (frac_excess < 0)
+ frac_excess = 0;
+ if (sensor->sensor->zone == fan->fan->zone) {
+ max_excess_zone = imax(max_excess_zone,
+ frac_excess);
+ nsens_zone++;
+ }
+ average_excess += frac_excess;
+ nsens++;
+ }
+ average_excess /= nsens;
+
+ /* If there are no sensors in this zone, use the average */
+ if (nsens_zone == 0)
+ max_excess_zone = average_excess;
+ /* No sensors at all? Use default */
+ if (nsens == 0) {
+ fan->fan->set(fan->fan, fan->fan->default_rpm);
+ continue;
+ }
+
+ /*
+ * Scale the fan linearly in the max temperature in its
+ * thermal zone.
+ */
+ fan->fan->set(fan->fan, max_excess_zone *
+ (fan->fan->max_rpm - fan->fan->min_rpm)/100 +
+ fan->fan->min_rpm);
+ }
+}
+
+void
+pmac_thermal_fan_register(struct pmac_fan *fan)
+{
+ struct pmac_fan_le *list_entry;
+
+ list_entry = malloc(sizeof(struct pmac_fan_le), M_PMACTHERM,
+ M_ZERO | M_WAITOK);
+ list_entry->fan = fan;
+
+ SLIST_INSERT_HEAD(&fans, list_entry, entries);
+}
+
+void
+pmac_thermal_sensor_register(struct pmac_therm *sensor)
+{
+ struct pmac_sens_le *list_entry;
+
+ list_entry = malloc(sizeof(struct pmac_sens_le), M_PMACTHERM,
+ M_ZERO | M_WAITOK);
+ list_entry->sensor = sensor;
+
+ SLIST_INSERT_HEAD(&sensors, list_entry, entries);
+}
+
diff --git a/sys/powerpc/powermac/powermac_thermal.h b/sys/powerpc/powermac/powermac_thermal.h
new file mode 100644
index 0000000..424c612
--- /dev/null
+++ b/sys/powerpc/powermac/powermac_thermal.h
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 2009-2011 Nathan Whitehorn
+ * All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _POWERPC_POWERMAC_POWERMAC_THERMAL_H
+#define _POWERPC_POWERMAC_POWERMAC_THERMAL_H
+
+#define ZERO_C_TO_K 2732
+
+struct pmac_fan {
+ int min_rpm, max_rpm, default_rpm;
+
+ char name[32];
+ int zone;
+
+ int (*read)(struct pmac_fan *);
+ int (*set)(struct pmac_fan *, int value);
+};
+
+struct pmac_therm {
+ int target_temp, max_temp; /* Tenths of a degree K */
+
+ char name[32];
+ int zone;
+
+ int (*read)(struct pmac_therm *);
+};
+
+void pmac_thermal_fan_register(struct pmac_fan *);
+void pmac_thermal_sensor_register(struct pmac_therm *);
+
+#endif
diff --git a/sys/powerpc/powermac/smu.c b/sys/powerpc/powermac/smu.c
index 928472c..ede97a1 100644
--- a/sys/powerpc/powermac/smu.c
+++ b/sys/powerpc/powermac/smu.c
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
#include <powerpc/powermac/macgpiovar.h>
+#include <powerpc/powermac/powermac_thermal.h>
#include "clock_if.h"
#include "iicbus_if.h"
@@ -69,19 +70,19 @@ struct smu_cmd {
STAILQ_HEAD(smu_cmdq, smu_cmd);
struct smu_fan {
+ struct pmac_fan fan;
+ device_t dev;
cell_t reg;
- cell_t min_rpm;
- cell_t max_rpm;
- cell_t unmanaged_rpm;
- char location[32];
int old_style;
int setpoint;
};
struct smu_sensor {
+ struct pmac_therm therm;
+ device_t dev;
+
cell_t reg;
- char location[32];
enum {
SMU_CURRENT_SENSOR,
SMU_VOLTAGE_SENSOR,
@@ -131,10 +132,6 @@ struct smu_softc {
uint16_t sc_slots_pow_scale;
int16_t sc_slots_pow_offset;
- /* Thermal management parameters */
- int sc_target_temp; /* Default 55 C */
- int sc_critical_temp; /* Default 90 C */
-
struct cdev *sc_leddev;
};
@@ -161,8 +158,6 @@ static int smu_get_datablock(device_t dev, int8_t id, uint8_t *buf,
static void smu_attach_i2c(device_t dev, phandle_t i2croot);
static void smu_attach_fans(device_t dev, phandle_t fanroot);
static void smu_attach_sensors(device_t dev, phandle_t sensroot);
-static void smu_fan_management_proc(void *xdev);
-static void smu_manage_fans(device_t smu);
static void smu_set_sleepled(void *xdev, int onoff);
static int smu_server_mode(SYSCTL_HANDLER_ARGS);
static void smu_doorbell_intr(void *xdev);
@@ -349,24 +344,6 @@ smu_attach(device_t dev)
sc->sc_slots_pow_offset = (data[6] << 8) + data[7];
/*
- * Set up simple-minded thermal management.
- */
- sc->sc_target_temp = 55;
- sc->sc_critical_temp = 90;
-
- SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
- "target_temp", CTLTYPE_INT | CTLFLAG_RW, &sc->sc_target_temp,
- sizeof(int), "Target temperature (C)");
- SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
- "critical_temp", CTLTYPE_INT | CTLFLAG_RW,
- &sc->sc_critical_temp, sizeof(int), "Critical temperature (C)");
-
- kproc_create(smu_fan_management_proc, dev, &sc->sc_fanmgt_proc,
- RFHIGHPID, 0, "smu_thermal");
-
- /*
* Set up LED interface
*/
sc->sc_leddev = led_create(smu_set_sleepled, dev, "sleepled");
@@ -658,8 +635,9 @@ doorbell_attach(device_t dev)
*/
static int
-smu_fan_set_rpm(device_t smu, struct smu_fan *fan, int rpm)
+smu_fan_set_rpm(struct smu_fan *fan, int rpm)
{
+ device_t smu = fan->dev;
struct smu_cmd cmd;
int error;
@@ -667,8 +645,8 @@ smu_fan_set_rpm(device_t smu, struct smu_fan *fan, int rpm)
error = EIO;
/* Clamp to allowed range */
- rpm = max(fan->min_rpm, rpm);
- rpm = min(fan->max_rpm, rpm);
+ rpm = max(fan->fan.min_rpm, rpm);
+ rpm = min(fan->fan.max_rpm, rpm);
/*
* Apple has two fan control mechanisms. We can't distinguish
@@ -684,7 +662,7 @@ smu_fan_set_rpm(device_t smu, struct smu_fan *fan, int rpm)
cmd.data[3] = rpm & 0xff;
error = smu_run_cmd(smu, &cmd, 1);
- if (error)
+ if (error && error != EWOULDBLOCK)
fan->old_style = 1;
}
@@ -704,8 +682,9 @@ smu_fan_set_rpm(device_t smu, struct smu_fan *fan, int rpm)
}
static int
-smu_fan_read_rpm(device_t smu, struct smu_fan *fan)
+smu_fan_read_rpm(struct smu_fan *fan)
{
+ device_t smu = fan->dev;
struct smu_cmd cmd;
int rpm, error;
@@ -716,7 +695,7 @@ smu_fan_read_rpm(device_t smu, struct smu_fan *fan)
cmd.data[1] = fan->reg;
error = smu_run_cmd(smu, &cmd, 1);
- if (error)
+ if (error && error != EWOULDBLOCK)
fan->old_style = 1;
rpm = (cmd.data[0] << 8) | cmd.data[1];
@@ -749,7 +728,7 @@ smu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS)
sc = device_get_softc(smu);
fan = &sc->sc_fans[arg2];
- rpm = smu_fan_read_rpm(smu, fan);
+ rpm = smu_fan_read_rpm(fan);
if (rpm < 0)
return (rpm);
@@ -760,7 +739,7 @@ smu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS)
sc->sc_lastuserchange = time_uptime;
- return (smu_fan_set_rpm(smu, fan, rpm));
+ return (smu_fan_set_rpm(fan, rpm));
}
static void
@@ -801,23 +780,25 @@ smu_attach_fans(device_t dev, phandle_t fanroot)
if (strcmp(type, "fan-rpm-control") != 0)
continue;
+ fan->dev = dev;
fan->old_style = 0;
OF_getprop(child, "reg", &fan->reg, sizeof(cell_t));
- OF_getprop(child, "min-value", &fan->min_rpm, sizeof(cell_t));
- OF_getprop(child, "max-value", &fan->max_rpm, sizeof(cell_t));
+ OF_getprop(child, "min-value", &fan->fan.min_rpm, sizeof(int));
+ OF_getprop(child, "max-value", &fan->fan.max_rpm, sizeof(int));
+ OF_getprop(child, "zone", &fan->fan.zone, sizeof(int));
- if (OF_getprop(child, "unmanaged-value", &fan->unmanaged_rpm,
- sizeof(cell_t)) != sizeof(cell_t))
- fan->unmanaged_rpm = fan->max_rpm;
+ if (OF_getprop(child, "unmanaged-value", &fan->fan.default_rpm,
+ sizeof(int)) != sizeof(int))
+ fan->fan.default_rpm = fan->fan.max_rpm;
- fan->setpoint = smu_fan_read_rpm(dev, fan);
+ fan->setpoint = smu_fan_read_rpm(fan);
- OF_getprop(child, "location", fan->location,
- sizeof(fan->location));
+ OF_getprop(child, "location", fan->fan.name,
+ sizeof(fan->fan.name));
/* Add sysctls */
- for (i = 0; i < strlen(fan->location); i++) {
- sysctl_name[i] = tolower(fan->location[i]);
+ for (i = 0; i < strlen(fan->fan.name); i++) {
+ sysctl_name[i] = tolower(fan->fan.name[i]);
if (isspace(sysctl_name[i]))
sysctl_name[i] = '_';
}
@@ -826,23 +807,28 @@ smu_attach_fans(device_t dev, phandle_t fanroot)
oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid),
OID_AUTO, sysctl_name, CTLFLAG_RD, 0, "Fan Information");
SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "minrpm",
- CTLTYPE_INT | CTLFLAG_RD, &fan->min_rpm, sizeof(cell_t),
+ CTLTYPE_INT | CTLFLAG_RD, &fan->fan.min_rpm, sizeof(int),
"Minimum allowed RPM");
SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "maxrpm",
- CTLTYPE_INT | CTLFLAG_RD, &fan->max_rpm, sizeof(cell_t),
+ CTLTYPE_INT | CTLFLAG_RD, &fan->fan.max_rpm, sizeof(int),
"Maximum allowed RPM");
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "rpm",
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev,
sc->sc_nfans, smu_fanrpm_sysctl, "I", "Fan RPM");
+ fan->fan.read = (int (*)(struct pmac_fan *))smu_fan_read_rpm;
+ fan->fan.set = (int (*)(struct pmac_fan *, int))smu_fan_set_rpm;
+ pmac_thermal_fan_register(&fan->fan);
+
fan++;
sc->sc_nfans++;
}
}
static int
-smu_sensor_read(device_t smu, struct smu_sensor *sens, int *val)
+smu_sensor_read(struct smu_sensor *sens)
{
+ device_t smu = sens->dev;
struct smu_cmd cmd;
struct smu_softc *sc;
int64_t value;
@@ -855,7 +841,7 @@ smu_sensor_read(device_t smu, struct smu_sensor *sens, int *val)
error = smu_run_cmd(smu, &cmd, 1);
if (error != 0)
- return (error);
+ return (-1);
sc = device_get_softc(smu);
value = (cmd.data[0] << 8) | cmd.data[1];
@@ -867,8 +853,8 @@ smu_sensor_read(device_t smu, struct smu_sensor *sens, int *val)
value += ((int64_t)sc->sc_cpu_diode_offset) << 9;
value <<= 1;
- /* Convert from 16.16 fixed point degC into integer C. */
- value >>= 16;
+ /* Convert from 16.16 fixed point degC into integer 0.1 K. */
+ value = 10*(value >> 16) + ((10*(value & 0xffff)) >> 16) + 2732;
break;
case SMU_VOLTAGE_SENSOR:
value *= sc->sc_cpu_volt_scale;
@@ -902,8 +888,7 @@ smu_sensor_read(device_t smu, struct smu_sensor *sens, int *val)
break;
}
- *val = value;
- return (0);
+ return (value);
}
static int
@@ -918,9 +903,9 @@ smu_sensor_sysctl(SYSCTL_HANDLER_ARGS)
sc = device_get_softc(smu);
sens = &sc->sc_sensors[arg2];
- error = smu_sensor_read(smu, sens, &value);
- if (error != 0)
- return (error);
+ value = smu_sensor_read(sens);
+ if (value < 0)
+ return (EBUSY);
error = sysctl_handle_int(oidp, &value, 0, req);
@@ -964,6 +949,7 @@ smu_attach_sensors(device_t dev, phandle_t sensroot)
char sysctl_name[40], sysctl_desc[40];
const char *units;
+ sens->dev = dev;
OF_getprop(child, "device_type", type, sizeof(type));
if (strcmp(type, "current-sensor") == 0) {
@@ -983,98 +969,37 @@ smu_attach_sensors(device_t dev, phandle_t sensroot)
}
OF_getprop(child, "reg", &sens->reg, sizeof(cell_t));
- OF_getprop(child, "location", sens->location,
- sizeof(sens->location));
+ OF_getprop(child, "zone", &sens->therm.zone, sizeof(int));
+ OF_getprop(child, "location", sens->therm.name,
+ sizeof(sens->therm.name));
- for (i = 0; i < strlen(sens->location); i++) {
- sysctl_name[i] = tolower(sens->location[i]);
+ for (i = 0; i < strlen(sens->therm.name); i++) {
+ sysctl_name[i] = tolower(sens->therm.name[i]);
if (isspace(sysctl_name[i]))
sysctl_name[i] = '_';
}
sysctl_name[i] = 0;
- sprintf(sysctl_desc,"%s (%s)", sens->location, units);
+ sprintf(sysctl_desc,"%s (%s)", sens->therm.name, units);
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO,
sysctl_name, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE,
- dev, sc->sc_nsensors, smu_sensor_sysctl, "I", sysctl_desc);
-
- sens++;
- sc->sc_nsensors++;
- }
-}
-
-static void
-smu_fan_management_proc(void *xdev)
-{
- device_t smu = xdev;
-
- while(1) {
- smu_manage_fans(smu);
- pause("smu", SMU_FANMGT_INTERVAL * hz / 1000);
- }
-}
-
-static void
-smu_manage_fans(device_t smu)
-{
- struct smu_softc *sc;
- int i, maxtemp, temp, factor, error;
-
- sc = device_get_softc(smu);
-
- maxtemp = 0;
- for (i = 0; i < sc->sc_nsensors; i++) {
- if (sc->sc_sensors[i].type != SMU_TEMP_SENSOR)
- continue;
-
- error = smu_sensor_read(smu, &sc->sc_sensors[i], &temp);
- if (error == 0 && temp > maxtemp)
- maxtemp = temp;
- }
+ dev, sc->sc_nsensors, smu_sensor_sysctl,
+ (sens->type == SMU_TEMP_SENSOR) ? "IK" : "I", sysctl_desc);
- if (maxtemp > sc->sc_critical_temp) {
- device_printf(smu, "WARNING: Current system temperature (%d C) "
- "exceeds critical temperature (%d C)! Shutting down!\n",
- maxtemp, sc->sc_critical_temp);
- shutdown_nice(RB_POWEROFF);
- }
-
- if (maxtemp - sc->sc_target_temp > 20)
- device_printf(smu, "WARNING: Current system temperature (%d C) "
- "more than 20 degrees over target temperature (%d C)!\n",
- maxtemp, sc->sc_target_temp);
-
- if (time_uptime - sc->sc_lastuserchange < 3) {
- /*
- * If we have heard from a user process in the last 3 seconds,
- * go away.
- */
+ if (sens->type == SMU_TEMP_SENSOR) {
+ /* Make up some numbers */
+ sens->therm.target_temp = 500 + 2732; /* 50 C */
+ sens->therm.max_temp = 900 + 2732; /* 90 C */
- return;
- }
+ sens->therm.read =
+ (int (*)(struct pmac_therm *))smu_sensor_read;
+ pmac_thermal_sensor_register(&sens->therm);
+ }
- if (maxtemp < 10) { /* Bail if no good sensors */
- for (i = 0; i < sc->sc_nfans; i++)
- smu_fan_set_rpm(smu, &sc->sc_fans[i],
- sc->sc_fans[i].unmanaged_rpm);
- return;
+ sens++;
+ sc->sc_nsensors++;
}
-
- if (maxtemp - sc->sc_target_temp > 4)
- factor = 110;
- else if (maxtemp - sc->sc_target_temp > 1)
- factor = 105;
- else if (sc->sc_target_temp - maxtemp > 4)
- factor = 90;
- else if (sc->sc_target_temp - maxtemp > 1)
- factor = 95;
- else
- factor = 100;
-
- for (i = 0; i < sc->sc_nfans; i++)
- smu_fan_set_rpm(smu, &sc->sc_fans[i],
- (sc->sc_fans[i].setpoint * factor) / 100);
}
static void
diff --git a/sys/powerpc/powermac/smusat.c b/sys/powerpc/powermac/smusat.c
index 42f023a..fcaa9ed 100644
--- a/sys/powerpc/powermac/smusat.c
+++ b/sys/powerpc/powermac/smusat.c
@@ -43,9 +43,13 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/openfirm.h>
+#include <powerpc/powermac/powermac_thermal.h>
+
struct smu_sensor {
+ struct pmac_therm therm;
+ device_t dev;
+
cell_t reg;
- char location[32];
enum {
SMU_CURRENT_SENSOR,
SMU_VOLTAGE_SENSOR,
@@ -57,6 +61,7 @@ struct smu_sensor {
static int smusat_probe(device_t);
static int smusat_attach(device_t);
static int smusat_sensor_sysctl(SYSCTL_HANDLER_ARGS);
+static int smusat_sensor_read(struct smu_sensor *sens);
MALLOC_DEFINE(M_SMUSAT, "smusat", "SMU Sattelite Sensors");
@@ -135,14 +140,16 @@ smusat_attach(device_t dev)
char sysctl_name[40], sysctl_desc[40];
const char *units;
+ sens->dev = dev;
sens->reg = 0;
OF_getprop(child, "reg", &sens->reg, sizeof(sens->reg));
if (sens->reg < 0x30)
continue;
-
sens->reg -= 0x30;
- OF_getprop(child, "location", sens->location,
- sizeof(sens->location));
+
+ OF_getprop(child, "zone", &sens->therm.zone, sizeof(int));
+ OF_getprop(child, "location", sens->therm.name,
+ sizeof(sens->therm.name));
OF_getprop(child, "device_type", type, sizeof(type));
@@ -162,17 +169,27 @@ smusat_attach(device_t dev)
continue;
}
- for (i = 0; i < strlen(sens->location); i++) {
- sysctl_name[i] = tolower(sens->location[i]);
+ for (i = 0; i < strlen(sens->therm.name); i++) {
+ sysctl_name[i] = tolower(sens->therm.name[i]);
if (isspace(sysctl_name[i]))
sysctl_name[i] = '_';
}
sysctl_name[i] = 0;
- sprintf(sysctl_desc,"%s (%s)", sens->location, units);
+ sprintf(sysctl_desc,"%s (%s)", sens->therm.name, units);
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO,
sysctl_name, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev,
- sc->sc_nsensors, smusat_sensor_sysctl, "I", sysctl_desc);
+ sc->sc_nsensors, smusat_sensor_sysctl,
+ (sens->type == SMU_TEMP_SENSOR) ? "IK" : "I", sysctl_desc);
+
+ if (sens->type == SMU_TEMP_SENSOR) {
+ /* Make up some numbers */
+ sens->therm.target_temp = 500 + 2732; /* 50 C */
+ sens->therm.max_temp = 900 + 2732; /* 90 C */
+ sens->therm.read =
+ (int (*)(struct pmac_therm *))smusat_sensor_read;
+ pmac_thermal_sensor_register(&sens->therm);
+ }
sens++;
sc->sc_nsensors++;
@@ -198,11 +215,13 @@ smusat_updatecache(device_t dev)
}
static int
-smusat_sensor_read(device_t dev, struct smu_sensor *sens, int *val)
+smusat_sensor_read(struct smu_sensor *sens)
{
int value;
+ device_t dev;
struct smusat_softc *sc;
+ dev = sens->dev;
sc = device_get_softc(dev);
if (time_uptime - sc->sc_last_update > 1)
@@ -215,8 +234,8 @@ smusat_sensor_read(device_t dev, struct smu_sensor *sens, int *val)
case SMU_TEMP_SENSOR:
/* 16.16 */
value <<= 10;
- /* Kill the .16 */
- value >>= 16;
+ /* From 16.16 to 0.1 C */
+ value = 10*(value >> 16) + ((10*(value & 0xffff)) >> 16) + 2732;
break;
case SMU_VOLTAGE_SENSOR:
/* 16.16 */
@@ -235,8 +254,7 @@ smusat_sensor_read(device_t dev, struct smu_sensor *sens, int *val)
break;
}
- *val = value;
- return (0);
+ return (value);
}
static int
@@ -251,9 +269,9 @@ smusat_sensor_sysctl(SYSCTL_HANDLER_ARGS)
sc = device_get_softc(dev);
sens = &sc->sc_sensors[arg2];
- error = smusat_sensor_read(dev, sens, &value);
- if (error != 0)
- return (error);
+ value = smusat_sensor_read(sens);
+ if (value < 0)
+ return (EBUSY);
error = sysctl_handle_int(oidp, &value, 0, req);
diff --git a/sys/powerpc/powermac/windtunnel.c b/sys/powerpc/powermac/windtunnel.c
new file mode 100644
index 0000000..b4aeca3
--- /dev/null
+++ b/sys/powerpc/powermac/windtunnel.c
@@ -0,0 +1,216 @@
+/*-
+ * Copyright (c) 2011 Justin Hibbits
+ * Copyright (c) 2010 Andreas Tobler
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/systm.h>
+#include <sys/module.h>
+#include <sys/callout.h>
+#include <sys/conf.h>
+#include <sys/cpu.h>
+#include <sys/ctype.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/limits.h>
+#include <sys/reboot.h>
+#include <sys/rman.h>
+#include <sys/sysctl.h>
+#include <sys/unistd.h>
+
+#include <machine/bus.h>
+#include <machine/md_var.h>
+
+#include <dev/iicbus/iicbus.h>
+#include <dev/iicbus/iiconf.h>
+
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#include <powerpc/powermac/powermac_thermal.h>
+
+struct adm1030_softc {
+ struct pmac_fan fan;
+ device_t sc_dev;
+ struct intr_config_hook enum_hook;
+ uint32_t sc_addr;
+ phandle_t sc_thermostat_phandle;
+ device_t sc_thermostat_dev;
+};
+
+/* Regular bus attachment functions */
+static int adm1030_probe(device_t);
+static int adm1030_attach(device_t);
+
+/* Utility functions */
+static void adm1030_start(void *xdev);
+static int adm1030_write_byte(device_t dev, uint32_t addr, uint8_t reg, uint8_t buf);
+static int adm1030_set(struct adm1030_softc *fan, int pwm);
+
+static device_method_t adm1030_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, adm1030_probe),
+ DEVMETHOD(device_attach, adm1030_attach),
+ {0, 0},
+};
+
+static driver_t adm1030_driver = {
+ "adm1030",
+ adm1030_methods,
+ sizeof(struct adm1030_softc)
+};
+
+static devclass_t adm1030_devclass;
+
+DRIVER_MODULE(adm1030, iicbus, adm1030_driver, adm1030_devclass, 0, 0);
+
+static int
+adm1030_write_byte(device_t dev, uint32_t addr, uint8_t reg, uint8_t byte)
+{
+ unsigned char buf[4];
+ int try = 0;
+
+ struct iic_msg msg[] = {
+ {addr, IIC_M_WR, 0, buf}
+ };
+
+ msg[0].len = 2;
+ buf[0] = reg;
+ buf[1] = byte;
+
+ for (;;)
+ {
+ if (iicbus_transfer(dev, msg, 1) == 0)
+ return (0);
+
+ if (++try > 5) {
+ device_printf(dev, "iicbus write failed\n");
+ return (-1);
+ }
+ pause("adm1030_write_byte", hz);
+ }
+}
+
+static int
+adm1030_probe(device_t dev)
+{
+ const char *name, *compatible;
+ struct adm1030_softc *sc;
+ phandle_t handle;
+ phandle_t thermostat;
+
+ name = ofw_bus_get_name(dev);
+ compatible = ofw_bus_get_compat(dev);
+ handle = ofw_bus_get_node(dev);
+
+ if (!name)
+ return (ENXIO);
+
+ if (strcmp(name, "fan") != 0 || strcmp(compatible, "adm1030") != 0)
+ return (ENXIO);
+
+ /* This driver can only be used if there's an associated temp sensor. */
+ if (OF_getprop(handle, "platform-getTemp", &thermostat, sizeof(thermostat)) < 0)
+ return (ENXIO);
+
+ sc = device_get_softc(dev);
+ sc->sc_dev = dev;
+ sc->sc_addr = iicbus_get_addr(dev);
+
+ device_set_desc(dev, "G4 MDD Fan driver");
+
+ return (0);
+}
+
+static int
+adm1030_attach(device_t dev)
+{
+ struct adm1030_softc *sc;
+
+ sc = device_get_softc(dev);
+
+ sc->enum_hook.ich_func = adm1030_start;
+ sc->enum_hook.ich_arg = dev;
+
+ /*
+ * We have to wait until interrupts are enabled. I2C read and write
+ * only works if the interrupts are available. The unin/i2c is
+ * controlled by the htpic on unin. But this is not the master. The
+ * openpic on mac-io is controlling the htpic. This one gets attached
+ * after the mac-io probing and then the interrupts will be
+ * available.
+ */
+
+ if (config_intrhook_establish(&sc->enum_hook) != 0)
+ return (ENOMEM);
+
+ return (0);
+}
+
+static void
+adm1030_start(void *xdev)
+{
+ struct adm1030_softc *sc;
+
+ device_t dev = (device_t) xdev;
+
+ sc = device_get_softc(dev);
+
+ /* Start the adm1030 device. */
+ adm1030_write_byte(sc->sc_dev, sc->sc_addr, 0x1, 0x1);
+ adm1030_write_byte(sc->sc_dev, sc->sc_addr, 0x0, 0x95);
+ adm1030_write_byte(sc->sc_dev, sc->sc_addr, 0x23, 0x91);
+
+ /* Use the RPM fields as PWM duty cycles. */
+ sc->fan.min_rpm = 0;
+ sc->fan.max_rpm = 15;
+ sc->fan.default_rpm = 2;
+
+ strcpy(sc->fan.name, "MDD Case fan");
+ sc->fan.zone = 0;
+ sc->fan.read = NULL;
+ sc->fan.set = (int (*)(struct pmac_fan *, int))adm1030_set;
+ config_intrhook_disestablish(&sc->enum_hook);
+
+ pmac_thermal_fan_register(&sc->fan);
+}
+
+static int adm1030_set(struct adm1030_softc *fan, int pwm)
+{
+ /* Clamp the PWM to 0-0xF, one nibble. */
+ if (pwm > 0xF)
+ pwm = 0xF;
+ if (pwm < 0)
+ pwm = 0;
+
+ if (adm1030_write_byte(fan->sc_dev, fan->sc_addr, 0x22, pwm) < 0)
+ return (-1);
+
+ return (0);
+}
+
diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c
index f2bfa33..1e6342c 100644
--- a/sys/powerpc/powerpc/intr_machdep.c
+++ b/sys/powerpc/powerpc/intr_machdep.c
@@ -67,6 +67,7 @@
#include <sys/kernel.h>
#include <sys/queue.h>
#include <sys/bus.h>
+#include <sys/cpuset.h>
#include <sys/interrupt.h>
#include <sys/ktr.h>
#include <sys/lock.h>
@@ -98,7 +99,7 @@ struct powerpc_intr {
u_int intline;
u_int vector;
u_int cntindex;
- cpumask_t cpu;
+ cpuset_t cpu;
enum intr_trigger trig;
enum intr_polarity pol;
};
@@ -205,7 +206,7 @@ intr_lookup(u_int irq)
#ifdef SMP
i->cpu = all_cpus;
#else
- i->cpu = 1;
+ CPU_SETOF(0, &i->cpu);
#endif
for (vector = 0; vector < INTR_VECTORS && vector <= nvectors;
@@ -296,7 +297,7 @@ powerpc_assign_intr_cpu(void *arg, u_char cpu)
if (cpu == NOCPU)
i->cpu = all_cpus;
else
- i->cpu = 1 << cpu;
+ CPU_SETOF(cpu, &i->cpu);
if (!cold && i->pic != NULL && i->pic == root_pic)
PIC_BIND(i->pic, i->intline, i->cpu);
diff --git a/sys/powerpc/powerpc/mp_machdep.c b/sys/powerpc/powerpc/mp_machdep.c
index 02920da..62a97e9 100644
--- a/sys/powerpc/powerpc/mp_machdep.c
+++ b/sys/powerpc/powerpc/mp_machdep.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/bus.h>
+#include <sys/cpuset.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/pcpu.h>
@@ -157,7 +158,7 @@ cpu_mp_start(void)
cpu.cr_cpuid);
goto next;
}
- if (all_cpus & (1 << cpu.cr_cpuid)) {
+ if (CPU_ISSET(cpu.cr_cpuid, &all_cpus)) {
printf("SMP: cpu%d: skipped - duplicate ID\n",
cpu.cr_cpuid);
goto next;
@@ -174,9 +175,9 @@ cpu_mp_start(void)
pc->pc_cpuid = bsp.cr_cpuid;
pc->pc_bsp = 1;
}
- pc->pc_cpumask = 1 << pc->pc_cpuid;
+ CPU_SETOF(pc->pc_cpuid, &pc->pc_cpumask);
pc->pc_hwref = cpu.cr_hwref;
- all_cpus |= pc->pc_cpumask;
+ CPU_OR(&all_cpus, &pc->pc_cpumask);
next:
error = platform_smp_next_cpu(&cpu);
}
@@ -212,9 +213,10 @@ cpu_mp_unleash(void *dummy)
cpus = 0;
smp_cpus = 0;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
cpus++;
- pc->pc_other_cpus = all_cpus & ~pc->pc_cpumask;
+ pc->pc_other_cpus = all_cpus;
+ CPU_NAND(&pc->pc_other_cpus, &pc->pc_cpumask);
if (!pc->pc_bsp) {
if (bootverbose)
printf("Waking up CPU %d (dev=%x)\n",
@@ -236,7 +238,7 @@ cpu_mp_unleash(void *dummy)
pc->pc_cpuid, pc->pc_pir, pc->pc_awake);
smp_cpus++;
} else
- stopped_cpus |= (1 << pc->pc_cpuid);
+ CPU_SET(pc->pc_cpuid, &stopped_cpus);
}
ap_awake = 1;
@@ -276,7 +278,7 @@ SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL);
int
powerpc_ipi_handler(void *arg)
{
- cpumask_t self;
+ cpuset_t self;
uint32_t ipimask;
int msg;
@@ -311,11 +313,11 @@ powerpc_ipi_handler(void *arg)
savectx(&stoppcbs[PCPU_GET(cpuid)]);
self = PCPU_GET(cpumask);
savectx(PCPU_GET(curpcb));
- atomic_set_int(&stopped_cpus, self);
- while ((started_cpus & self) == 0)
+ CPU_OR_ATOMIC(&stopped_cpus, &self);
+ while (!CPU_OVERLAP(&started_cpus, &self))
cpu_spinwait();
- atomic_clear_int(&started_cpus, self);
- atomic_clear_int(&stopped_cpus, self);
+ CPU_NAND_ATOMIC(&started_cpus, &self);
+ CPU_NAND_ATOMIC(&stopped_cpus, &self);
CTR1(KTR_SMP, "%s: IPI_STOP (restart)", __func__);
break;
case IPI_HARDCLOCK:
@@ -343,12 +345,12 @@ ipi_send(struct pcpu *pc, int ipi)
/* Send an IPI to a set of cpus. */
void
-ipi_selected(cpumask_t cpus, int ipi)
+ipi_selected(cpuset_t cpus, int ipi)
{
struct pcpu *pc;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
- if (cpus & pc->pc_cpumask)
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
+ if (CPU_OVERLAP(&cpus, &pc->pc_cpumask))
ipi_send(pc, ipi);
}
}
@@ -367,7 +369,7 @@ ipi_all_but_self(int ipi)
{
struct pcpu *pc;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
if (pc != pcpup)
ipi_send(pc, ipi);
}
diff --git a/sys/powerpc/powerpc/openpic.c b/sys/powerpc/powerpc/openpic.c
index 042f8b8..347dc3f 100644
--- a/sys/powerpc/powerpc/openpic.c
+++ b/sys/powerpc/powerpc/openpic.c
@@ -231,7 +231,7 @@ openpic_common_attach(device_t dev, uint32_t node)
*/
void
-openpic_bind(device_t dev, u_int irq, cpumask_t cpumask)
+openpic_bind(device_t dev, u_int irq, cpuset_t cpumask)
{
struct openpic_softc *sc;
@@ -240,7 +240,12 @@ openpic_bind(device_t dev, u_int irq, cpumask_t cpumask)
return;
sc = device_get_softc(dev);
- openpic_write(sc, OPENPIC_IDEST(irq), cpumask);
+
+ /*
+ * XXX: openpic_write() is very special and just needs a 32 bits mask.
+ * For the moment, just play dirty and get the first half word.
+ */
+ openpic_write(sc, OPENPIC_IDEST(irq), cpumask.__bits[0] & 0xffffffff);
}
void
diff --git a/sys/powerpc/powerpc/pic_if.m b/sys/powerpc/powerpc/pic_if.m
index 185cc08..e429d31 100644
--- a/sys/powerpc/powerpc/pic_if.m
+++ b/sys/powerpc/powerpc/pic_if.m
@@ -28,6 +28,7 @@
#
#include <sys/bus.h>
+#include <sys/cpuset.h>
#include <machine/frame.h>
INTERFACE pic;
@@ -35,7 +36,7 @@ INTERFACE pic;
METHOD void bind {
device_t dev;
u_int irq;
- cpumask_t cpumask;
+ cpuset_t cpumask;
};
METHOD void config {
diff --git a/sys/powerpc/ps3/if_glc.c b/sys/powerpc/ps3/if_glc.c
index 6901f44..d87383d 100644
--- a/sys/powerpc/ps3/if_glc.c
+++ b/sys/powerpc/ps3/if_glc.c
@@ -135,6 +135,7 @@ glc_attach(device_t dev)
callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0);
sc->next_txdma_slot = 0;
sc->bsy_txdma_slots = 0;
+ sc->sc_next_rxdma_slot = 0;
sc->first_used_txdma_slot = -1;
/*
@@ -375,6 +376,14 @@ glc_tick(void *xsc)
mtx_assert(&sc->sc_mtx, MA_OWNED);
+ /*
+ * XXX: Sometimes the RX queue gets stuck. Poke it periodically until
+ * we figure out why. This will fail harmlessly if the RX queue is
+ * already running.
+ */
+ lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev,
+ sc->sc_rxsoft[sc->sc_next_rxdma_slot].rxs_desc, 0);
+
if (sc->sc_wdog_timer == 0 || --sc->sc_wdog_timer != 0) {
callout_reset(&sc->sc_tick_ch, hz, glc_tick, sc);
return;
@@ -707,12 +716,19 @@ glc_rxintr(struct glc_softc *sc)
struct ifnet *ifp = sc->sc_ifp;
bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_rxdmadesc_map,
- BUS_DMASYNC_PREWRITE);
+ BUS_DMASYNC_POSTREAD);
restart_rxdma = 0;
while ((sc->sc_rxdmadesc[sc->sc_next_rxdma_slot].cmd_stat &
GELIC_DESCR_OWNED) == 0) {
i = sc->sc_next_rxdma_slot;
+ sc->sc_next_rxdma_slot++;
+ if (sc->sc_next_rxdma_slot >= GLC_MAX_RX_PACKETS)
+ sc->sc_next_rxdma_slot = 0;
+
+ if (sc->sc_rxdmadesc[i].cmd_stat & GELIC_CMDSTAT_CHAIN_END)
+ restart_rxdma = 1;
+
if (sc->sc_rxdmadesc[i].rxerror & GELIC_RXERRORS) {
ifp->if_ierrors++;
goto requeue;
@@ -738,9 +754,6 @@ glc_rxintr(struct glc_softc *sc)
m->m_pkthdr.rcvif = ifp;
m->m_len = sc->sc_rxdmadesc[i].valid_size;
m->m_pkthdr.len = m->m_len;
- sc->sc_next_rxdma_slot++;
- if (sc->sc_next_rxdma_slot >= GLC_MAX_RX_PACKETS)
- sc->sc_next_rxdma_slot = 0;
if (sc->sc_rx_vlan >= 0)
m_adj(m, 2);
@@ -750,16 +763,18 @@ glc_rxintr(struct glc_softc *sc)
mtx_lock(&sc->sc_mtx);
requeue:
- if (sc->sc_rxdmadesc[i].cmd_stat & GELIC_CMDSTAT_CHAIN_END)
- restart_rxdma = 1;
glc_add_rxbuf_dma(sc, i);
- if (restart_rxdma) {
- error = lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev,
- sc->sc_rxsoft[i].rxs_desc, 0);
- if (error != 0)
- device_printf(sc->sc_self,
- "lv1_net_start_rx_dma error: %d\n", error);
- }
+ }
+
+ bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_rxdmadesc_map,
+ BUS_DMASYNC_PREWRITE);
+
+ if (restart_rxdma) {
+ error = lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev,
+ sc->sc_rxsoft[sc->sc_next_rxdma_slot].rxs_desc, 0);
+ if (error != 0)
+ device_printf(sc->sc_self,
+ "lv1_net_start_rx_dma error: %d\n", error);
}
}
@@ -770,6 +785,9 @@ glc_txintr(struct glc_softc *sc)
struct glc_txsoft *txs;
int progress = 0, kickstart = 0, error;
+ bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_txdmadesc_map,
+ BUS_DMASYNC_POSTREAD);
+
while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) {
if (sc->sc_txdmadesc[txs->txs_lastdesc].cmd_stat
& GELIC_DESCR_OWNED)
@@ -805,7 +823,8 @@ glc_txintr(struct glc_softc *sc)
else
sc->first_used_txdma_slot = -1;
- if (kickstart && txs != NULL) {
+ if (kickstart || txs != NULL) {
+ /* Speculatively (or necessarily) start the TX queue again */
error = lv1_net_start_tx_dma(sc->sc_bus, sc->sc_dev,
sc->sc_txdmadesc_phys +
txs->txs_firstdesc*sizeof(struct glc_dmadesc), 0);
diff --git a/sys/powerpc/ps3/ohci_ps3.c b/sys/powerpc/ps3/ohci_ps3.c
new file mode 100644
index 0000000..e13435b
--- /dev/null
+++ b/sys/powerpc/ps3/ohci_ps3.c
@@ -0,0 +1,170 @@
+/*-
+ * Copyright (C) 2010 Nathan Whitehorn
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 TOOLS GMBH 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/stdint.h>
+#include <sys/stddef.h>
+#include <sys/param.h>
+#include <sys/queue.h>
+#include <sys/types.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/linker_set.h>
+#include <sys/module.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/condvar.h>
+#include <sys/sysctl.h>
+#include <sys/sx.h>
+#include <sys/unistd.h>
+#include <sys/callout.h>
+#include <sys/malloc.h>
+#include <sys/priv.h>
+
+#include <sys/rman.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+
+#include <dev/usb/usb_core.h>
+#include <dev/usb/usb_busdma.h>
+#include <dev/usb/usb_process.h>
+#include <dev/usb/usb_util.h>
+
+#include <dev/usb/usb_controller.h>
+#include <dev/usb/usb_bus.h>
+#include <dev/usb/controller/ohci.h>
+#include <dev/usb/controller/ohcireg.h>
+
+#include "ps3bus.h"
+
+static int
+ohci_ps3_probe(device_t dev)
+{
+ if (ps3bus_get_bustype(dev) != PS3_BUSTYPE_SYSBUS ||
+ ps3bus_get_devtype(dev) != PS3_DEVTYPE_USB)
+ return (ENXIO);
+
+ device_set_desc(dev, "Playstation 3 USB 2.0 controller");
+ return (BUS_PROBE_SPECIFIC);
+}
+
+static int
+ohci_ps3_attach(device_t dev)
+{
+ ohci_softc_t *sc = device_get_softc(dev);
+ int rid, err;
+
+ sc->sc_bus.parent = dev;
+ sc->sc_bus.devices = sc->sc_devices;
+ sc->sc_bus.devices_max = OHCI_MAX_DEVICES;
+
+ if (usb_bus_mem_alloc_all(&sc->sc_bus,
+ USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc))
+ return (ENOMEM);
+
+ rid = 0;
+ sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ &rid, RF_ACTIVE);
+
+ if (!sc->sc_io_res) {
+ device_printf(dev, "Could not map memory\n");
+ goto error;
+ }
+
+ sc->sc_io_tag = rman_get_bustag(sc->sc_io_res);
+ sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res);
+ sc->sc_io_size = rman_get_size(sc->sc_io_res);
+
+ rid = 0;
+ sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_SHAREABLE | RF_ACTIVE);
+
+ if (sc->sc_irq_res == NULL) {
+ device_printf(dev, "Could not allocate irq\n");
+ return (ENXIO);
+ }
+
+ sc->sc_bus.bdev = device_add_child(dev, "usbus", -1);
+ if (!sc->sc_bus.bdev) {
+ device_printf(dev, "Could not add USB device\n");
+ return (ENXIO);
+ }
+
+ device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus);
+
+ sprintf(sc->sc_vendor, "Sony");
+
+ err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
+ NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
+ if (err) {
+ device_printf(dev, "Could not setup error irq, %d\n", err);
+ goto error;
+ }
+
+ //sc->sc_flags |= EHCI_SCFLG_BIGEMMIO;
+ bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl,
+ OHCI_CONTROL, 0);
+ err = ohci_init(sc);
+ if (err) {
+ device_printf(dev, "USB init failed err=%d\n", err);
+ goto error;
+ }
+
+ err = device_probe_and_attach(sc->sc_bus.bdev);
+ if (err == 0)
+ return (0);
+
+error:
+ return (ENXIO);
+}
+
+static device_method_t ohci_ps3_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, ohci_ps3_probe),
+ DEVMETHOD(device_attach, ohci_ps3_attach),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+
+ {0, 0}
+};
+
+static driver_t ohci_ps3_driver = {
+ "ohci",
+ ohci_ps3_methods,
+ sizeof(ohci_softc_t),
+};
+
+static devclass_t ohci_ps3_devclass;
+
+DRIVER_MODULE(ohci_ps3, ps3bus, ohci_ps3_driver, ohci_ps3_devclass, 0, 0);
+MODULE_DEPEND(ohci_ps3, usb, 1, 1, 1);
+
diff --git a/sys/powerpc/ps3/ps3bus.c b/sys/powerpc/ps3/ps3bus.c
index 6a5120a..2fe303d 100644
--- a/sys/powerpc/ps3/ps3bus.c
+++ b/sys/powerpc/ps3/ps3bus.c
@@ -1,5 +1,6 @@
/*-
* Copyright (C) 2010 Nathan Whitehorn
+ * Copyright (C) 2011 glevand (geoffrey.levand@mail.ru)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -73,6 +74,8 @@ struct ps3bus_devinfo {
int dev;
uint64_t bustype;
uint64_t devtype;
+ int busidx;
+ int devidx;
struct resource_list resources;
bus_dma_tag_t dma_tag;
@@ -89,6 +92,11 @@ enum ps3bus_irq_type {
EHCI_IRQ = 4,
};
+enum ps3bus_reg_type {
+ OHCI_REG = 3,
+ EHCI_REG = 4,
+};
+
static device_method_t ps3bus_methods[] = {
/* Device interface */
DEVMETHOD(device_identify, ps3bus_identify),
@@ -235,6 +243,77 @@ ps3bus_resources_init(struct rman *rm, int bus_index, int dev_index,
}
}
+static void
+ps3bus_resources_init_by_type(struct rman *rm, int bus_index, int dev_index,
+ uint64_t irq_type, uint64_t reg_type, struct ps3bus_devinfo *dinfo)
+{
+ uint64_t _irq_type, irq, outlet;
+ uint64_t _reg_type, paddr, len;
+ uint64_t ppe, junk;
+ int i, result;
+ int thread;
+
+ resource_list_init(&dinfo->resources);
+
+ lv1_get_logical_ppe_id(&ppe);
+ thread = 32 - fls(mfctrl());
+
+ /* Scan for interrupts */
+ for (i = 0; i < 10; i++) {
+ result = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("intr") | i, 0, &_irq_type, &irq);
+
+ if (result != 0)
+ break;
+
+ if (_irq_type != irq_type)
+ continue;
+
+ lv1_construct_io_irq_outlet(irq, &outlet);
+ lv1_connect_irq_plug_ext(ppe, thread, outlet, outlet,
+ 0);
+ resource_list_add(&dinfo->resources, SYS_RES_IRQ, i,
+ outlet, outlet, 1);
+ }
+
+ /* Scan for registers */
+ for (i = 0; i < 10; i++) {
+ result = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("reg") | i,
+ lv1_repository_string("type"), &_reg_type, &junk);
+
+ if (result != 0)
+ break;
+
+ if (_reg_type != reg_type)
+ continue;
+
+ result = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("reg") | i,
+ lv1_repository_string("data"), &paddr, &len);
+
+ result = lv1_map_device_mmio_region(dinfo->bus, dinfo->dev,
+ paddr, len, 12 /* log_2(4 KB) */, &paddr);
+
+ if (result != 0) {
+ printf("Mapping registers failed for device "
+ "%d.%d (%ld.%ld): %d\n", dinfo->bus, dinfo->dev,
+ dinfo->bustype, dinfo->devtype, result);
+ break;
+ }
+
+ rman_manage_region(rm, paddr, paddr + len - 1);
+ resource_list_add(&dinfo->resources, SYS_RES_MEMORY, i,
+ paddr, paddr + len, len);
+ }
+}
+
static int
ps3bus_attach(device_t self)
{
@@ -294,30 +373,93 @@ ps3bus_attach(device_t self)
if (result != 0)
continue;
- dinfo = malloc(sizeof(*dinfo), M_PS3BUS,
- M_WAITOK | M_ZERO);
-
- dinfo->bus = bus;
- dinfo->dev = dev;
- dinfo->bustype = bustype;
- dinfo->devtype = devtype;
+ switch (devtype) {
+ case PS3_DEVTYPE_USB:
+ /* USB device has OHCI and EHCI USB host controllers */
- if (dinfo->bustype == PS3_BUSTYPE_SYSBUS)
lv1_open_device(bus, dev, 0);
- ps3bus_resources_init(&sc->sc_mem_rman, bus_index,
- dev_index, dinfo);
-
- cdev = device_add_child(self, NULL, -1);
- if (cdev == NULL) {
- device_printf(self,
- "device_add_child failed\n");
- free(dinfo, M_PS3BUS);
- continue;
+ /* OHCI host controller */
+
+ dinfo = malloc(sizeof(*dinfo), M_PS3BUS,
+ M_WAITOK | M_ZERO);
+
+ dinfo->bus = bus;
+ dinfo->dev = dev;
+ dinfo->bustype = bustype;
+ dinfo->devtype = devtype;
+ dinfo->busidx = bus_index;
+ dinfo->devidx = dev_index;
+
+ ps3bus_resources_init_by_type(&sc->sc_mem_rman, bus_index,
+ dev_index, OHCI_IRQ, OHCI_REG, dinfo);
+
+ cdev = device_add_child(self, "ohci", -1);
+ if (cdev == NULL) {
+ device_printf(self,
+ "device_add_child failed\n");
+ free(dinfo, M_PS3BUS);
+ continue;
+ }
+
+ mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF);
+ device_set_ivars(cdev, dinfo);
+
+ /* EHCI host controller */
+
+ dinfo = malloc(sizeof(*dinfo), M_PS3BUS,
+ M_WAITOK | M_ZERO);
+
+ dinfo->bus = bus;
+ dinfo->dev = dev;
+ dinfo->bustype = bustype;
+ dinfo->devtype = devtype;
+ dinfo->busidx = bus_index;
+ dinfo->devidx = dev_index;
+
+ ps3bus_resources_init_by_type(&sc->sc_mem_rman, bus_index,
+ dev_index, EHCI_IRQ, EHCI_REG, dinfo);
+
+ cdev = device_add_child(self, "ehci", -1);
+ if (cdev == NULL) {
+ device_printf(self,
+ "device_add_child failed\n");
+ free(dinfo, M_PS3BUS);
+ continue;
+ }
+
+ mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF);
+ device_set_ivars(cdev, dinfo);
+ break;
+ default:
+ dinfo = malloc(sizeof(*dinfo), M_PS3BUS,
+ M_WAITOK | M_ZERO);
+
+ dinfo->bus = bus;
+ dinfo->dev = dev;
+ dinfo->bustype = bustype;
+ dinfo->devtype = devtype;
+ dinfo->busidx = bus_index;
+ dinfo->devidx = dev_index;
+
+ if (dinfo->bustype == PS3_BUSTYPE_SYSBUS ||
+ dinfo->bustype == PS3_BUSTYPE_STORAGE)
+ lv1_open_device(bus, dev, 0);
+
+ ps3bus_resources_init(&sc->sc_mem_rman, bus_index,
+ dev_index, dinfo);
+
+ cdev = device_add_child(self, NULL, -1);
+ if (cdev == NULL) {
+ device_printf(self,
+ "device_add_child failed\n");
+ free(dinfo, M_PS3BUS);
+ continue;
+ }
+
+ mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF);
+ device_set_ivars(cdev, dinfo);
}
-
- mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF);
- device_set_ivars(cdev, dinfo);
}
}
@@ -361,6 +503,12 @@ ps3bus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result)
case PS3BUS_IVAR_DEVTYPE:
*result = dinfo->devtype;
break;
+ case PS3BUS_IVAR_BUSIDX:
+ *result = dinfo->busidx;
+ break;
+ case PS3BUS_IVAR_DEVIDX:
+ *result = dinfo->devidx;
+ break;
default:
return (EINVAL);
}
@@ -483,7 +631,8 @@ ps3bus_get_dma_tag(device_t dev, device_t child)
struct ps3bus_softc *sc = device_get_softc(dev);
int i, err, flags;
- if (dinfo->bustype != PS3_BUSTYPE_SYSBUS)
+ if (dinfo->bustype != PS3_BUSTYPE_SYSBUS &&
+ dinfo->bustype != PS3_BUSTYPE_STORAGE)
return (bus_get_dma_tag(dev));
mtx_lock(&dinfo->iommu_mtx);
diff --git a/sys/powerpc/ps3/ps3bus.h b/sys/powerpc/ps3/ps3bus.h
index b11ff8a..6725625 100644
--- a/sys/powerpc/ps3/ps3bus.h
+++ b/sys/powerpc/ps3/ps3bus.h
@@ -32,7 +32,9 @@ enum {
PS3BUS_IVAR_BUS,
PS3BUS_IVAR_DEVICE,
PS3BUS_IVAR_BUSTYPE,
- PS3BUS_IVAR_DEVTYPE
+ PS3BUS_IVAR_DEVTYPE,
+ PS3BUS_IVAR_BUSIDX,
+ PS3BUS_IVAR_DEVIDX,
};
#define PS3BUS_ACCESSOR(A, B, T) \
@@ -42,6 +44,8 @@ PS3BUS_ACCESSOR(bus, BUS, int)
PS3BUS_ACCESSOR(device, DEVICE, int)
PS3BUS_ACCESSOR(bustype, BUSTYPE, uint64_t)
PS3BUS_ACCESSOR(devtype, DEVTYPE, uint64_t)
+PS3BUS_ACCESSOR(busidx, BUSIDX, int)
+PS3BUS_ACCESSOR(devidx, DEVIDX, int)
/* Bus types */
enum {
diff --git a/sys/powerpc/ps3/ps3disk.c b/sys/powerpc/ps3/ps3disk.c
new file mode 100644
index 0000000..5390f50
--- /dev/null
+++ b/sys/powerpc/ps3/ps3disk.c
@@ -0,0 +1,901 @@
+/*-
+ * Copyright (C) 2011 glevand (geoffrey.levand@mail.ru)
+ * All rights reserved.
+ *
+ * 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 AUTHOR ``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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+#include <sys/disk.h>
+#include <sys/bio.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <machine/pio.h>
+#include <machine/bus.h>
+#include <machine/platform.h>
+#include <machine/pmap.h>
+#include <machine/resource.h>
+#include <sys/bus.h>
+#include <sys/rman.h>
+
+#include <geom/geom_disk.h>
+
+#include "ps3bus.h"
+#include "ps3-hvcall.h"
+
+#define PS3DISK_LOCK_INIT(_sc) \
+ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), "ps3disk", MTX_DEF)
+#define PS3DISK_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx);
+#define PS3DISK_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
+#define PS3DISK_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
+#define PS3DISK_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
+#define PS3DISK_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
+
+#define LV1_STORAGE_ATA_HDDOUT 0x23
+
+SYSCTL_NODE(_hw, OID_AUTO, ps3disk, CTLFLAG_RD, 0, "PS3 Disk driver parameters");
+
+#ifdef PS3DISK_DEBUG
+static int ps3disk_debug = 0;
+SYSCTL_INT(_hw_ps3disk, OID_AUTO, debug, CTLFLAG_RW, &ps3disk_debug,
+ 0, "control debugging printfs");
+TUNABLE_INT("hw.ps3disk.debug", &ps3disk_debug);
+enum {
+ PS3DISK_DEBUG_INTR = 0x00000001,
+ PS3DISK_DEBUG_TASK = 0x00000002,
+ PS3DISK_DEBUG_READ = 0x00000004,
+ PS3DISK_DEBUG_WRITE = 0x00000008,
+ PS3DISK_DEBUG_FLUSH = 0x00000010,
+ PS3DISK_DEBUG_ANY = 0xffffffff
+};
+#define DPRINTF(sc, m, fmt, ...) \
+do { \
+ if (sc->sc_debug & (m)) \
+ printf(fmt, __VA_ARGS__); \
+} while (0)
+#else
+#define DPRINTF(sc, m, fmt, ...)
+#endif
+
+struct ps3disk_region {
+ uint64_t r_id;
+ uint64_t r_start;
+ uint64_t r_size;
+ uint64_t r_flags;
+};
+
+struct ps3disk_softc {
+ device_t sc_dev;
+
+ struct mtx sc_mtx;
+
+ uint64_t sc_blksize;
+ uint64_t sc_nblocks;
+
+ uint64_t sc_nregs;
+ struct ps3disk_region *sc_reg;
+
+ int sc_irqid;
+ struct resource *sc_irq;
+ void *sc_irqctx;
+
+ struct disk **sc_disk;
+
+ struct bio_queue_head sc_bioq;
+
+ struct proc *sc_task;
+
+ int sc_bounce_maxblocks;
+ bus_dma_tag_t sc_bounce_dmatag;
+ bus_dmamap_t sc_bounce_dmamap;
+ bus_addr_t sc_bounce_dmaphys;
+ char *sc_bounce;
+ uint64_t sc_bounce_lpar;
+ int sc_bounce_busy;
+ uint64_t sc_bounce_tag;
+ uint64_t sc_bounce_status;
+
+ int sc_running;
+
+ int sc_debug;
+};
+
+static int ps3disk_open(struct disk *dp);
+static int ps3disk_close(struct disk *dp);
+static void ps3disk_strategy(struct bio *bp);
+static void ps3disk_task(void *arg);
+
+static int ps3disk_intr_filter(void *arg);
+static void ps3disk_intr(void *arg);
+static void ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error);
+static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc);
+static int ps3disk_enum_regions(struct ps3disk_softc *sc);
+static int ps3disk_read(struct ps3disk_softc *sc, int regidx,
+ uint64_t start_sector, uint64_t sector_count, char *data);
+static int ps3disk_write(struct ps3disk_softc *sc, int regidx,
+ uint64_t start_sector, uint64_t sector_count, char *data);
+static int ps3disk_flush(struct ps3disk_softc *sc);
+
+static void ps3disk_sysctlattach(struct ps3disk_softc *sc);
+
+static MALLOC_DEFINE(M_PS3DISK, "ps3disk", "PS3 Disk");
+
+static int
+ps3disk_probe(device_t dev)
+{
+ if (ps3bus_get_bustype(dev) != PS3_BUSTYPE_STORAGE ||
+ ps3bus_get_devtype(dev) != PS3_DEVTYPE_DISK)
+ return (ENXIO);
+
+ device_set_desc(dev, "Playstation 3 Disk");
+
+ return (BUS_PROBE_SPECIFIC);
+}
+
+static int
+ps3disk_attach(device_t dev)
+{
+ struct ps3disk_softc *sc;
+ struct disk *d;
+ intmax_t mb;
+ char unit;
+ int i, err;
+
+ sc = device_get_softc(dev);
+ sc->sc_dev = dev;
+
+ PS3DISK_LOCK_INIT(sc);
+
+ err = ps3disk_get_disk_geometry(sc);
+ if (err) {
+ device_printf(dev, "Could not get disk geometry\n");
+ err = ENXIO;
+ goto fail_destroy_lock;
+ }
+
+ device_printf(dev, "block size %lu total blocks %lu\n",
+ sc->sc_blksize, sc->sc_nblocks);
+
+ err = ps3disk_enum_regions(sc);
+ if (err) {
+ device_printf(dev, "Could not enumerate disk regions\n");
+ err = ENXIO;
+ goto fail_destroy_lock;
+ }
+
+ device_printf(dev, "Found %lu regions\n", sc->sc_nregs);
+
+ if (!sc->sc_nregs) {
+ err = ENXIO;
+ goto fail_destroy_lock;
+ }
+
+ /* Setup interrupt handler */
+
+ sc->sc_irqid = 0;
+ sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irqid,
+ RF_ACTIVE);
+ if (!sc->sc_irq) {
+ device_printf(dev, "Could not allocate IRQ\n");
+ err = ENXIO;
+ goto fail_free_regions;
+ }
+
+ err = bus_setup_intr(dev, sc->sc_irq,
+ INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY,
+ ps3disk_intr_filter, ps3disk_intr, sc, &sc->sc_irqctx);
+ if (err) {
+ device_printf(dev, "Could not setup IRQ\n");
+ err = ENXIO;
+ goto fail_release_intr;
+ }
+
+ /* Setup DMA bounce buffer */
+
+ sc->sc_bounce_maxblocks = DFLTPHYS / sc->sc_blksize;
+
+ err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0,
+ BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
+ sc->sc_bounce_maxblocks * sc->sc_blksize, 1,
+ sc->sc_bounce_maxblocks * sc->sc_blksize,
+ 0, NULL, NULL, &sc->sc_bounce_dmatag);
+ if (err) {
+ device_printf(dev, "Could not create DMA tag for bounce buffer\n");
+ err = ENXIO;
+ goto fail_teardown_intr;
+ }
+
+ err = bus_dmamem_alloc(sc->sc_bounce_dmatag, (void **) &sc->sc_bounce,
+ BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO,
+ &sc->sc_bounce_dmamap);
+ if (err) {
+ device_printf(dev, "Could not allocate DMA memory for bounce buffer\n");
+ err = ENXIO;
+ goto fail_destroy_dmatag;
+ }
+
+ err = bus_dmamap_load(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap,
+ sc->sc_bounce, sc->sc_bounce_maxblocks * sc->sc_blksize,
+ ps3disk_getphys, &sc->sc_bounce_dmaphys, 0);
+ if (err) {
+ device_printf(dev, "Could not load DMA map for bounce buffer\n");
+ err = ENXIO;
+ goto fail_free_dmamem;
+ }
+
+ sc->sc_bounce_lpar = vtophys(sc->sc_bounce);
+
+ if (bootverbose)
+ device_printf(dev, "bounce buffer lpar address 0x%016lx\n",
+ sc->sc_bounce_lpar);
+
+ /* Setup disks */
+
+ sc->sc_disk = malloc(sc->sc_nregs * sizeof(struct disk *),
+ M_PS3DISK, M_ZERO | M_WAITOK);
+ if (!sc->sc_disk) {
+ device_printf(dev, "Could not allocate disk(s)\n");
+ err = ENOMEM;
+ goto fail_unload_dmamem;
+ }
+
+ for (i = 0; i < sc->sc_nregs; i++) {
+ struct ps3disk_region *rp = &sc->sc_reg[i];
+
+ d = sc->sc_disk[i] = disk_alloc();
+ d->d_open = ps3disk_open;
+ d->d_close = ps3disk_close;
+ d->d_strategy = ps3disk_strategy;
+ d->d_name = "ps3disk";
+ d->d_drv1 = sc;
+ d->d_maxsize = DFLTPHYS;
+ d->d_sectorsize = sc->sc_blksize;
+ d->d_unit = i;
+ d->d_mediasize = sc->sc_reg[i].r_size * sc->sc_blksize;
+ d->d_flags |= DISKFLAG_CANFLUSHCACHE;
+
+ mb = d->d_mediasize >> 20;
+ unit = 'M';
+ if (mb >= 10240) {
+ unit = 'G';
+ mb /= 1024;
+ }
+
+ /* Test to see if we can read this region */
+ err = lv1_storage_read(ps3bus_get_device(dev), d->d_unit,
+ 0, 1, rp->r_flags, sc->sc_bounce_lpar, &sc->sc_bounce_tag);
+ device_printf(dev, "region %d %ju%cB%s\n", i, mb, unit,
+ (err == 0) ? "" : " (hypervisor protected)");
+
+ if (err == 0)
+ disk_create(d, DISK_VERSION);
+ }
+ err = 0;
+
+ bioq_init(&sc->sc_bioq);
+
+ ps3disk_sysctlattach(sc);
+
+ sc->sc_running = 1;
+
+ kproc_create(&ps3disk_task, sc, &sc->sc_task, 0, 0, "task: ps3disk");
+
+ return (0);
+
+fail_unload_dmamem:
+
+ bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap);
+
+fail_free_dmamem:
+
+ bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap);
+
+fail_destroy_dmatag:
+
+ bus_dma_tag_destroy(sc->sc_bounce_dmatag);
+
+fail_teardown_intr:
+
+ bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx);
+
+fail_release_intr:
+
+ bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq);
+
+fail_free_regions:
+
+ free(sc->sc_reg, M_PS3DISK);
+
+fail_destroy_lock:
+
+ PS3DISK_LOCK_DESTROY(sc);
+
+ return (err);
+}
+
+static int
+ps3disk_detach(device_t dev)
+{
+ struct ps3disk_softc *sc = device_get_softc(dev);
+ int i;
+
+ PS3DISK_LOCK(sc);
+ sc->sc_running = 0;
+ wakeup(sc);
+ PS3DISK_UNLOCK(sc);
+
+ PS3DISK_LOCK(sc);
+ while (sc->sc_running != -1)
+ msleep(sc, &sc->sc_mtx, PRIBIO, "detach", 0);
+ PS3DISK_UNLOCK(sc);
+
+ for (i = 0; i < sc->sc_nregs; i++)
+ disk_destroy(sc->sc_disk[i]);
+
+ bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap);
+ bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap);
+ bus_dma_tag_destroy(sc->sc_bounce_dmatag);
+
+ bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx);
+ bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq);
+
+ free(sc->sc_disk, M_PS3DISK);
+
+ free(sc->sc_reg, M_PS3DISK);
+
+ PS3DISK_LOCK_DESTROY(sc);
+
+ return (0);
+}
+
+static int
+ps3disk_open(struct disk *dp)
+{
+ return (0);
+}
+
+static int
+ps3disk_close(struct disk *dp)
+{
+ return (0);
+}
+
+static void
+ps3disk_strategy(struct bio *bp)
+{
+ struct ps3disk_softc *sc = (struct ps3disk_softc *) bp->bio_disk->d_drv1;
+
+ if (!sc) {
+ bp->bio_flags |= BIO_ERROR;
+ bp->bio_error = EINVAL;
+ biodone(bp);
+ return;
+ }
+
+ PS3DISK_LOCK(sc);
+ bioq_disksort(&sc->sc_bioq, bp);
+ if (!sc->sc_bounce_busy)
+ wakeup(sc);
+ PS3DISK_UNLOCK(sc);
+}
+
+static void
+ps3disk_task(void *arg)
+{
+ struct ps3disk_softc *sc = (struct ps3disk_softc *) arg;
+ struct bio *bp;
+ daddr_t block, end;
+ u_long nblocks;
+ char *data;
+ int err;
+
+ while (sc->sc_running) {
+ PS3DISK_LOCK(sc);
+ do {
+ bp = bioq_first(&sc->sc_bioq);
+ if (bp == NULL)
+ msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0);
+ } while (bp == NULL && sc->sc_running);
+ if (bp)
+ bioq_remove(&sc->sc_bioq, bp);
+ PS3DISK_UNLOCK(sc);
+
+ if (!sc->sc_running)
+ break;
+
+ DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_cmd 0x%02x\n",
+ __func__, bp->bio_cmd);
+
+ if (bp->bio_cmd == BIO_FLUSH) {
+ err = ps3disk_flush(sc);
+
+ if (err) {
+ bp->bio_error = EIO;
+ bp->bio_flags |= BIO_ERROR;
+ } else {
+ bp->bio_error = 0;
+ bp->bio_flags |= BIO_DONE;
+ }
+ } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) {
+ end = bp->bio_pblkno + (bp->bio_bcount / sc->sc_blksize);
+
+ DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_pblkno %ld bio_bcount %ld\n",
+ __func__, bp->bio_pblkno, bp->bio_bcount);
+
+ for (block = bp->bio_pblkno; block < end;) {
+ data = bp->bio_data +
+ (block - bp->bio_pblkno) * sc->sc_blksize;
+
+ nblocks = end - block;
+ if (nblocks > sc->sc_bounce_maxblocks)
+ nblocks = sc->sc_bounce_maxblocks;
+
+ DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: nblocks %lu\n",
+ __func__, nblocks);
+
+ if (bp->bio_cmd == BIO_READ) {
+ err = ps3disk_read(sc, bp->bio_disk->d_unit,
+ block, nblocks, data);
+ } else {
+ err = ps3disk_write(sc, bp->bio_disk->d_unit,
+ block, nblocks, data);
+ }
+
+ if (err)
+ break;
+
+ block += nblocks;
+ }
+
+ bp->bio_resid = (end - block) * sc->sc_blksize;
+ if (bp->bio_resid) {
+ bp->bio_error = EIO;
+ bp->bio_flags |= BIO_ERROR;
+ } else {
+ bp->bio_error = 0;
+ bp->bio_flags |= BIO_DONE;
+ }
+
+ DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_resid %ld\n",
+ __func__, bp->bio_resid);
+ } else {
+ bp->bio_error = EINVAL;
+ bp->bio_flags |= BIO_ERROR;
+ }
+
+ if (bp->bio_flags & BIO_ERROR)
+ disk_err(bp, "hard error", -1, 1);
+
+ biodone(bp);
+ }
+
+ PS3DISK_LOCK(sc);
+ sc->sc_running = -1;
+ wakeup(sc);
+ PS3DISK_UNLOCK(sc);
+
+ kproc_exit(0);
+}
+
+static int
+ps3disk_intr_filter(void *arg)
+{
+ return (FILTER_SCHEDULE_THREAD);
+}
+
+static void
+ps3disk_intr(void *arg)
+{
+ struct ps3disk_softc *sc = (struct ps3disk_softc *) arg;
+ device_t dev = sc->sc_dev;
+ uint64_t devid = ps3bus_get_device(dev);
+ uint64_t tag, status;
+ int err;
+
+ PS3DISK_LOCK(sc);
+
+ err = lv1_storage_get_async_status(devid, &tag, &status);
+
+ DPRINTF(sc, PS3DISK_DEBUG_INTR, "%s: err %d tag 0x%016lx status 0x%016lx\n",
+ __func__, err, tag, status);
+
+ if (err)
+ goto out;
+
+ if (!sc->sc_bounce_busy) {
+ device_printf(dev, "Got interrupt while no request pending\n");
+ goto out;
+ }
+
+ if (tag != sc->sc_bounce_tag)
+ device_printf(dev, "Tag mismatch, got 0x%016lx expected 0x%016lx\n",
+ tag, sc->sc_bounce_tag);
+
+ if (status)
+ device_printf(dev, "Request completed with status 0x%016lx\n", status);
+
+ sc->sc_bounce_status = status;
+ sc->sc_bounce_busy = 0;
+
+ wakeup(sc);
+
+out:
+
+ PS3DISK_UNLOCK(sc);
+}
+
+static void
+ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+{
+ if (error != 0)
+ return;
+
+ *(bus_addr_t *) arg = segs[0].ds_addr;
+}
+
+static int
+ps3disk_get_disk_geometry(struct ps3disk_softc *sc)
+{
+ device_t dev = sc->sc_dev;
+ uint64_t bus_index = ps3bus_get_busidx(dev);
+ uint64_t dev_index = ps3bus_get_devidx(dev);
+ uint64_t junk;
+ int err;
+
+ err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("blk_size"), 0, &sc->sc_blksize, &junk);
+ if (err) {
+ device_printf(dev, "Could not get block size (0x%08x)\n", err);
+ err = ENXIO;
+ goto out;
+ }
+
+ err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("n_blocks"), 0, &sc->sc_nblocks, &junk);
+ if (err) {
+ device_printf(dev, "Could not get total number of blocks (0x%08x)\n",
+ err);
+ err = ENXIO;
+ goto out;
+ }
+
+ err = 0;
+
+out:
+
+ return (err);
+}
+
+static int
+ps3disk_enum_regions(struct ps3disk_softc *sc)
+{
+ device_t dev = sc->sc_dev;
+ uint64_t bus_index = ps3bus_get_busidx(dev);
+ uint64_t dev_index = ps3bus_get_devidx(dev);
+ uint64_t junk;
+ int i, err;
+
+ /* Read number of regions */
+
+ err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("n_regs"), 0, &sc->sc_nregs, &junk);
+ if (err) {
+ device_printf(dev, "Could not get number of regions (0x%08x)\n",
+ err);
+ err = ENXIO;
+ goto fail;
+ }
+
+ if (!sc->sc_nregs)
+ return 0;
+
+ sc->sc_reg = malloc(sc->sc_nregs * sizeof(struct ps3disk_region),
+ M_PS3DISK, M_ZERO | M_WAITOK);
+ if (!sc->sc_reg) {
+ err = ENOMEM;
+ goto fail;
+ }
+
+ /* Setup regions */
+
+ for (i = 0; i < sc->sc_nregs; i++) {
+ err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("region") | i,
+ lv1_repository_string("id"), &sc->sc_reg[i].r_id, &junk);
+ if (err) {
+ device_printf(dev, "Could not get region id (0x%08x)\n",
+ err);
+ err = ENXIO;
+ goto fail;
+ }
+
+ err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("region") | i,
+ lv1_repository_string("start"), &sc->sc_reg[i].r_start, &junk);
+ if (err) {
+ device_printf(dev, "Could not get region start (0x%08x)\n",
+ err);
+ err = ENXIO;
+ goto fail;
+ }
+
+ err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
+ (lv1_repository_string("bus") >> 32) | bus_index,
+ lv1_repository_string("dev") | dev_index,
+ lv1_repository_string("region") | i,
+ lv1_repository_string("size"), &sc->sc_reg[i].r_size, &junk);
+ if (err) {
+ device_printf(dev, "Could not get region size (0x%08x)\n",
+ err);
+ err = ENXIO;
+ goto fail;
+ }
+
+ if (i == 0)
+ /* disables HV access control and grants access to whole disk */
+ sc->sc_reg[i].r_flags = 0x2;
+ else
+ sc->sc_reg[i].r_flags = 0;
+ }
+
+ return (0);
+
+fail:
+
+ sc->sc_nregs = 0;
+ if (sc->sc_reg)
+ free(sc->sc_reg, M_PS3DISK);
+
+ return (err);
+}
+
+static int
+ps3disk_read(struct ps3disk_softc *sc, int regidx,
+ uint64_t start_sector, uint64_t sector_count, char *data)
+{
+ device_t dev = sc->sc_dev;
+ struct ps3disk_region *rp = &sc->sc_reg[regidx];
+ uint64_t devid = ps3bus_get_device(dev);
+ int err;
+
+ PS3DISK_LOCK(sc);
+
+ if (sc->sc_bounce_busy) {
+ device_printf(dev, "busy\n");
+ PS3DISK_UNLOCK(sc);
+ return EIO;
+ }
+
+ sc->sc_bounce_busy = 1;
+
+ err = lv1_storage_read(devid, rp->r_id,
+ start_sector, sector_count, rp->r_flags,
+ sc->sc_bounce_lpar, &sc->sc_bounce_tag);
+ if (err) {
+ device_printf(dev, "Could not read sectors (0x%08x)\n", err);
+ err = EIO;
+ goto out;
+ }
+
+ DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n",
+ __func__, sc->sc_bounce_tag);
+
+ err = msleep(sc, &sc->sc_mtx, PRIBIO, "read", hz);
+ if (err) {
+ device_printf(dev, "Read request timed out\n");
+ err = EIO;
+ goto out;
+ }
+
+ if (sc->sc_bounce_busy || sc->sc_bounce_status) {
+ err = EIO;
+ } else {
+ bus_dmamap_sync(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap,
+ BUS_DMASYNC_POSTREAD);
+ memcpy(data, sc->sc_bounce, sector_count * sc->sc_blksize);
+ err = 0;
+ }
+
+out:
+
+ sc->sc_bounce_busy = 0;
+
+ PS3DISK_UNLOCK(sc);
+
+ return (err);
+}
+
+static int
+ps3disk_write(struct ps3disk_softc *sc, int regidx,
+ uint64_t start_sector, uint64_t sector_count, char *data)
+{
+ device_t dev = sc->sc_dev;
+ struct ps3disk_region *rp = &sc->sc_reg[regidx];
+ uint64_t devid = ps3bus_get_device(dev);
+ int err;
+
+ PS3DISK_LOCK(sc);
+
+ if (sc->sc_bounce_busy) {
+ device_printf(dev, "busy\n");
+ PS3DISK_UNLOCK(sc);
+ return EIO;
+ }
+
+ memcpy(sc->sc_bounce, data, sector_count * sc->sc_blksize);
+
+ bus_dmamap_sync(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap,
+ BUS_DMASYNC_PREWRITE);
+
+ sc->sc_bounce_busy = 1;
+
+ err = lv1_storage_write(devid, rp->r_id,
+ start_sector, sector_count, rp->r_flags,
+ sc->sc_bounce_lpar, &sc->sc_bounce_tag);
+ if (err) {
+ device_printf(dev, "Could not write sectors (0x%08x)\n", err);
+ err = EIO;
+ goto out;
+ }
+
+ DPRINTF(sc, PS3DISK_DEBUG_WRITE, "%s: tag 0x%016lx\n",
+ __func__, sc->sc_bounce_tag);
+
+ err = msleep(sc, &sc->sc_mtx, PRIBIO, "write", hz);
+ if (err) {
+ device_printf(dev, "Write request timed out\n");
+ err = EIO;
+ goto out;
+ }
+
+ err = (sc->sc_bounce_busy || sc->sc_bounce_status) ? EIO : 0;
+
+out:
+
+ sc->sc_bounce_busy = 0;
+
+ PS3DISK_UNLOCK(sc);
+
+ return (err);
+}
+
+static int
+ps3disk_flush(struct ps3disk_softc *sc)
+{
+ device_t dev = sc->sc_dev;
+ uint64_t devid = ps3bus_get_device(dev);
+ int err;
+
+ PS3DISK_LOCK(sc);
+
+ if (sc->sc_bounce_busy) {
+ device_printf(dev, "busy\n");
+ PS3DISK_UNLOCK(sc);
+ return EIO;
+ }
+
+ sc->sc_bounce_busy = 1;
+
+ err = lv1_storage_send_device_command(devid, LV1_STORAGE_ATA_HDDOUT,
+ 0, 0, 0, 0, &sc->sc_bounce_tag);
+ if (err) {
+ device_printf(dev, "Could not flush (0x%08x)\n", err);
+ err = EIO;
+ goto out;
+ }
+
+ DPRINTF(sc, PS3DISK_DEBUG_FLUSH, "%s: tag 0x%016lx\n",
+ __func__, sc->sc_bounce_tag);
+
+ err = msleep(sc, &sc->sc_mtx, PRIBIO, "flush", hz);
+ if (err) {
+ device_printf(dev, "Flush request timed out\n");
+ err = EIO;
+ goto out;
+ }
+
+ err = (sc->sc_bounce_busy || sc->sc_bounce_status) ? EIO : 0;
+
+out:
+
+ sc->sc_bounce_busy = 0;
+
+ PS3DISK_UNLOCK(sc);
+
+ return (err);
+}
+
+#ifdef PS3DISK_DEBUG
+static int
+ps3disk_sysctl_debug(SYSCTL_HANDLER_ARGS)
+{
+ struct ps3disk_softc *sc = arg1;
+ int debug, error;
+
+ debug = sc->sc_debug;
+
+ error = sysctl_handle_int(oidp, &debug, 0, req);
+ if (error || !req->newptr)
+ return error;
+
+ sc->sc_debug = debug;
+
+ return 0;
+}
+#endif
+
+static void
+ps3disk_sysctlattach(struct ps3disk_softc *sc)
+{
+#ifdef PS3DISK_DEBUG
+ struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev);
+ struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev);
+
+ sc->sc_debug = ps3disk_debug;
+
+ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+ "debug", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
+ ps3disk_sysctl_debug, "I", "control debugging printfs");
+#endif
+}
+
+static device_method_t ps3disk_methods[] = {
+ DEVMETHOD(device_probe, ps3disk_probe),
+ DEVMETHOD(device_attach, ps3disk_attach),
+ DEVMETHOD(device_detach, ps3disk_detach),
+ {0, 0},
+};
+
+static driver_t ps3disk_driver = {
+ "ps3disk",
+ ps3disk_methods,
+ sizeof(struct ps3disk_softc),
+};
+
+static devclass_t ps3disk_devclass;
+
+DRIVER_MODULE(ps3disk, ps3bus, ps3disk_driver, ps3disk_devclass, 0, 0);
diff --git a/sys/rpc/rpc_generic.c b/sys/rpc/rpc_generic.c
index fd39350..6adae38 100644
--- a/sys/rpc/rpc_generic.c
+++ b/sys/rpc/rpc_generic.c
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
#include <rpc/rpc.h>
#include <rpc/nettype.h>
+#include <rpc/rpcsec_gss.h>
#include <rpc/rpc_com.h>
@@ -69,6 +70,9 @@ extern u_long sb_max_adj; /* not defined in socketvar.h */
#define strrchr rindex
#endif
+/* Provide an entry point hook for the rpcsec_gss module. */
+struct rpc_gss_entries rpc_gss_entries;
+
struct handle {
NCONF_HANDLE *nhandle;
int nflag; /* Whether NETPATH or NETCONFIG */
diff --git a/sys/rpc/rpcsec_gss.h b/sys/rpc/rpcsec_gss.h
index 563205c..94696f3 100644
--- a/sys/rpc/rpcsec_gss.h
+++ b/sys/rpc/rpcsec_gss.h
@@ -141,6 +141,271 @@ typedef struct {
__BEGIN_DECLS
#ifdef _KERNEL
+/*
+ * Set up a structure of entry points for the kgssapi module and inline
+ * functions named rpc_gss_XXX_call() to use them, so that the kgssapi
+ * module doesn't need to be loaded for the NFS modules to work using
+ * AUTH_SYS. The kgssapi modules will be loaded by the gssd(8) daemon
+ * when it is started up and the entry points will then be filled in.
+ */
+typedef AUTH *rpc_gss_secfind_ftype(CLIENT *clnt, struct ucred *cred,
+ const char *principal, gss_OID mech_oid,
+ rpc_gss_service_t service);
+typedef void rpc_gss_secpurge_ftype(CLIENT *clnt);
+typedef AUTH *rpc_gss_seccreate_ftype(CLIENT *clnt, struct ucred *cred,
+ const char *principal, const char *mechanism,
+ rpc_gss_service_t service, const char *qop,
+ rpc_gss_options_req_t *options_req,
+ rpc_gss_options_ret_t *options_ret);
+typedef bool_t rpc_gss_set_defaults_ftype(AUTH *auth,
+ rpc_gss_service_t service, const char *qop);
+typedef int rpc_gss_max_data_length_ftype(AUTH *handle,
+ int max_tp_unit_len);
+typedef void rpc_gss_get_error_ftype(rpc_gss_error_t *error);
+typedef bool_t rpc_gss_mech_to_oid_ftype(const char *mech, gss_OID *oid_ret);
+typedef bool_t rpc_gss_oid_to_mech_ftype(gss_OID oid, const char **mech_ret);
+typedef bool_t rpc_gss_qop_to_num_ftype(const char *qop, const char *mech,
+ u_int *num_ret);
+typedef const char **rpc_gss_get_mechanisms_ftype(void);
+typedef bool_t rpc_gss_get_versions_ftype(u_int *vers_hi, u_int *vers_lo);
+typedef bool_t rpc_gss_is_installed_ftype(const char *mech);
+typedef bool_t rpc_gss_set_svc_name_ftype(const char *principal,
+ const char *mechanism, u_int req_time, u_int program,
+ u_int version);
+typedef void rpc_gss_clear_svc_name_ftype(u_int program, u_int version);
+typedef bool_t rpc_gss_getcred_ftype(struct svc_req *req,
+ rpc_gss_rawcred_t **rcred,
+ rpc_gss_ucred_t **ucred, void **cookie);
+typedef bool_t rpc_gss_set_callback_ftype(rpc_gss_callback_t *cb);
+typedef void rpc_gss_clear_callback_ftype(rpc_gss_callback_t *cb);
+typedef bool_t rpc_gss_get_principal_name_ftype(rpc_gss_principal_t *principal,
+ const char *mech, const char *name, const char *node,
+ const char *domain);
+typedef int rpc_gss_svc_max_data_length_ftype(struct svc_req *req,
+ int max_tp_unit_len);
+
+struct rpc_gss_entries {
+ rpc_gss_secfind_ftype *rpc_gss_secfind;
+ rpc_gss_secpurge_ftype *rpc_gss_secpurge;
+ rpc_gss_seccreate_ftype *rpc_gss_seccreate;
+ rpc_gss_set_defaults_ftype *rpc_gss_set_defaults;
+ rpc_gss_max_data_length_ftype *rpc_gss_max_data_length;
+ rpc_gss_get_error_ftype *rpc_gss_get_error;
+ rpc_gss_mech_to_oid_ftype *rpc_gss_mech_to_oid;
+ rpc_gss_oid_to_mech_ftype *rpc_gss_oid_to_mech;
+ rpc_gss_qop_to_num_ftype *rpc_gss_qop_to_num;
+ rpc_gss_get_mechanisms_ftype *rpc_gss_get_mechanisms;
+ rpc_gss_get_versions_ftype *rpc_gss_get_versions;
+ rpc_gss_is_installed_ftype *rpc_gss_is_installed;
+ rpc_gss_set_svc_name_ftype *rpc_gss_set_svc_name;
+ rpc_gss_clear_svc_name_ftype *rpc_gss_clear_svc_name;
+ rpc_gss_getcred_ftype *rpc_gss_getcred;
+ rpc_gss_set_callback_ftype *rpc_gss_set_callback;
+ rpc_gss_clear_callback_ftype *rpc_gss_clear_callback;
+ rpc_gss_get_principal_name_ftype *rpc_gss_get_principal_name;
+ rpc_gss_svc_max_data_length_ftype *rpc_gss_svc_max_data_length;
+};
+extern struct rpc_gss_entries rpc_gss_entries;
+
+/* Functions to access the entry points. */
+static __inline AUTH *
+rpc_gss_secfind_call(CLIENT *clnt, struct ucred *cred, const char *principal,
+ gss_OID mech_oid, rpc_gss_service_t service)
+{
+ AUTH *ret = NULL;
+
+ if (rpc_gss_entries.rpc_gss_secfind != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_secfind)(clnt, cred, principal,
+ mech_oid, service);
+ return (ret);
+}
+
+static __inline void
+rpc_gss_secpurge_call(CLIENT *clnt)
+{
+
+ if (rpc_gss_entries.rpc_gss_secpurge != NULL)
+ (*rpc_gss_entries.rpc_gss_secpurge)(clnt);
+}
+
+static __inline AUTH *
+rpc_gss_seccreate_call(CLIENT *clnt, struct ucred *cred, const char *principal,
+ const char *mechanism, rpc_gss_service_t service, const char *qop,
+ rpc_gss_options_req_t *options_req, rpc_gss_options_ret_t *options_ret)
+{
+ AUTH *ret = NULL;
+
+ if (rpc_gss_entries.rpc_gss_seccreate != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_seccreate)(clnt, cred,
+ principal, mechanism, service, qop, options_req,
+ options_ret);
+ return (ret);
+}
+
+static __inline bool_t
+rpc_gss_set_defaults_call(AUTH *auth, rpc_gss_service_t service,
+ const char *qop)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_set_defaults != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_set_defaults)(auth, service,
+ qop);
+ return (ret);
+}
+
+static __inline int
+rpc_gss_max_data_length_call(AUTH *handle, int max_tp_unit_len)
+{
+ int ret = 0;
+
+ if (rpc_gss_entries.rpc_gss_max_data_length != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_max_data_length)(handle,
+ max_tp_unit_len);
+ return (ret);
+}
+
+static __inline void
+rpc_gss_get_error_call(rpc_gss_error_t *error)
+{
+
+ if (rpc_gss_entries.rpc_gss_get_error != NULL)
+ (*rpc_gss_entries.rpc_gss_get_error)(error);
+}
+
+static __inline bool_t
+rpc_gss_mech_to_oid_call(const char *mech, gss_OID *oid_ret)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_mech_to_oid != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_mech_to_oid)(mech, oid_ret);
+ return (ret);
+}
+
+static __inline bool_t
+rpc_gss_oid_to_mech_call(gss_OID oid, const char **mech_ret)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_oid_to_mech != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_oid_to_mech)(oid, mech_ret);
+ return (ret);
+}
+
+static __inline bool_t
+rpc_gss_qop_to_num_call(const char *qop, const char *mech, u_int *num_ret)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_qop_to_num != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_qop_to_num)(qop, mech, num_ret);
+ return (ret);
+}
+
+static __inline const char **
+rpc_gss_get_mechanisms_call(void)
+{
+ const char **ret = NULL;
+
+ if (rpc_gss_entries.rpc_gss_get_mechanisms != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_get_mechanisms)();
+ return (ret);
+}
+
+static __inline bool_t
+rpc_gss_get_versions_call(u_int *vers_hi, u_int *vers_lo)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_get_versions != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_get_versions)(vers_hi, vers_lo);
+ return (ret);
+}
+
+static __inline bool_t
+rpc_gss_is_installed_call(const char *mech)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_is_installed != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_is_installed)(mech);
+ return (ret);
+}
+
+static __inline bool_t
+rpc_gss_set_svc_name_call(const char *principal, const char *mechanism,
+ u_int req_time, u_int program, u_int version)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_set_svc_name != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_set_svc_name)(principal,
+ mechanism, req_time, program, version);
+ return (ret);
+}
+
+static __inline void
+rpc_gss_clear_svc_name_call(u_int program, u_int version)
+{
+
+ if (rpc_gss_entries.rpc_gss_clear_svc_name != NULL)
+ (*rpc_gss_entries.rpc_gss_clear_svc_name)(program, version);
+}
+
+static __inline bool_t
+rpc_gss_getcred_call(struct svc_req *req, rpc_gss_rawcred_t **rcred,
+ rpc_gss_ucred_t **ucred, void **cookie)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_getcred != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_getcred)(req, rcred, ucred,
+ cookie);
+ return (ret);
+}
+
+static __inline bool_t
+rpc_gss_set_callback_call(rpc_gss_callback_t *cb)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_set_callback != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_set_callback)(cb);
+ return (ret);
+}
+
+static __inline void
+rpc_gss_clear_callback_call(rpc_gss_callback_t *cb)
+{
+
+ if (rpc_gss_entries.rpc_gss_clear_callback != NULL)
+ (*rpc_gss_entries.rpc_gss_clear_callback)(cb);
+}
+
+static __inline bool_t
+rpc_gss_get_principal_name_call(rpc_gss_principal_t *principal,
+ const char *mech, const char *name, const char *node, const char *domain)
+{
+ bool_t ret = 1;
+
+ if (rpc_gss_entries.rpc_gss_get_principal_name != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_get_principal_name)(principal,
+ mech, name, node, domain);
+ return (ret);
+}
+
+static __inline int
+rpc_gss_svc_max_data_length_call(struct svc_req *req, int max_tp_unit_len)
+{
+ int ret = 0;
+
+ if (rpc_gss_entries.rpc_gss_svc_max_data_length != NULL)
+ ret = (*rpc_gss_entries.rpc_gss_svc_max_data_length)(req,
+ max_tp_unit_len);
+ return (ret);
+}
+
AUTH *rpc_gss_secfind(CLIENT *clnt, struct ucred *cred,
const char *principal, gss_OID mech_oid, rpc_gss_service_t service);
void rpc_gss_secpurge(CLIENT *clnt);
diff --git a/sys/sparc64/conf/GENERIC b/sys/sparc64/conf/GENERIC
index 406dcf6..11c5d35 100644
--- a/sys/sparc64/conf/GENERIC
+++ b/sys/sparc64/conf/GENERIC
@@ -61,13 +61,13 @@ options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed.
options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
options AUDIT # Security event auditing
options MAC # TrustedBSD MAC Framework
-options INCLUDE_CONFIG_FILE # Include this file in kernel
+options INCLUDE_CONFIG_FILE # Include this file in kernel
# Debugging for use in -current
options KDB # Enable kernel debugger support.
options DDB # Support DDB.
options GDB # Support remote GDB.
-options DEADLKRES # Enable the deadlock resolver
+options DEADLKRES # Enable the deadlock resolver
options INVARIANTS # Enable calls of extra sanity checking
options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS
options WITNESS # Enable checks to detect deadlocks and cycles
@@ -266,3 +266,10 @@ device fwe # Ethernet over FireWire (non-standard!)
device fwip # IP over FireWire (RFC 2734,3146)
device dcons # Dumb console driver
device dcons_crom # Configuration ROM for dcons
+
+# Sound support
+device sound # Generic sound driver (required)
+device snd_audiocs # Crystal Semiconductor CS4231
+device snd_es137x # Ensoniq AudioPCI ES137x
+device snd_t4dwave # Acer Labs M5451
+device snd_uaudio # USB Audio
diff --git a/sys/sparc64/include/_types.h b/sys/sparc64/include/_types.h
index f810c15..7e993c4 100644
--- a/sys/sparc64/include/_types.h
+++ b/sys/sparc64/include/_types.h
@@ -55,7 +55,6 @@ typedef unsigned long __uint64_t;
* Standard type definitions.
*/
typedef __int32_t __clock_t; /* clock()... */
-typedef unsigned int __cpumask_t;
typedef __int64_t __critical_t;
typedef double __double_t;
typedef float __float_t;
diff --git a/sys/sparc64/include/ktr.h b/sys/sparc64/include/ktr.h
index 5948ba2..f13865f 100644
--- a/sys/sparc64/include/ktr.h
+++ b/sys/sparc64/include/ktr.h
@@ -40,16 +40,6 @@
#else
-#define AND(var, mask, r1, r2) \
- SET(var, r2, r1) ; \
- lduw [r1], r2 ; \
- and r2, mask, r1
-
-#define TEST(var, mask, r1, r2, l1) \
- AND(var, mask, r1, r2) ; \
- brz r1, l1 ## f ; \
- nop
-
/*
* XXX could really use another register...
*/
@@ -79,13 +69,37 @@ l2: add r2, 1, r3 ; \
SET(l1 ## b, r3, r2) ; \
stx r2, [r1 + KTR_DESC]
+/*
+ * NB: this clobbers %y.
+ */
#define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \
set mask, r1 ; \
- TEST(ktr_mask, r1, r2, r2, l3) ; \
- lduw [PCPU(MID)], r1 ; \
+ SET(ktr_mask, r3, r2) ; \
+ lduw [r2], r2 ; \
+ and r2, r1, r1 ; \
+ brz r1, l3 ## f ; \
+ nop ; \
+ lduw [PCPU(CPUID)], r2 ; \
+ mov _NCPUBITS, r3 ; \
+ mov %g0, %y ; \
+ udiv r2, r3, r2 ; \
+ srl r2, 0, r2 ; \
+ sllx r2, PTR_SHIFT, r2 ; \
+ SET(ktr_cpumask, r3, r1) ; \
+ ldx [r1 + r2], r1 ; \
+ lduw [PCPU(CPUID)], r2 ; \
+ mov _NCPUBITS, r3 ; \
+ mov %g0, %y ; \
+ udiv r2, r3, r2 ; \
+ srl r2, 0, r2 ; \
+ smul r2, r3, r3 ; \
+ lduw [PCPU(CPUID)], r2 ; \
+ sub r2, r3, r3 ; \
mov 1, r2 ; \
- sllx r2, r1, r1 ; \
- TEST(ktr_cpumask, r1, r2, r3, l3) ; \
+ sllx r2, r3, r2 ; \
+ andn r1, r2, r1 ; \
+ brz r1, l3 ## f ; \
+ nop ; \
ATR(desc, r1, r2, r3, l1, l2)
#endif /* LOCORE */
diff --git a/sys/sparc64/include/pmap.h b/sys/sparc64/include/pmap.h
index e16ea97..adad257 100644
--- a/sys/sparc64/include/pmap.h
+++ b/sys/sparc64/include/pmap.h
@@ -40,6 +40,7 @@
#define _MACHINE_PMAP_H_
#include <sys/queue.h>
+#include <sys/_cpuset.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
#include <machine/cache.h>
@@ -61,7 +62,7 @@ struct pmap {
struct mtx pm_mtx;
struct tte *pm_tsb;
vm_object_t pm_tsb_obj;
- cpumask_t pm_active;
+ cpuset_t pm_active;
u_int pm_context[MAXCPU];
struct pmap_statistics pm_stats;
};
diff --git a/sys/sparc64/include/smp.h b/sys/sparc64/include/smp.h
index 3ca8e03..a519e01 100644
--- a/sys/sparc64/include/smp.h
+++ b/sys/sparc64/include/smp.h
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2001 Jake Burkholder.
+ * Copyright (c) 2007 - 2011 Marius Strobl <marius@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,6 +39,7 @@
#ifndef LOCORE
+#include <sys/cpuset.h>
#include <sys/proc.h>
#include <sys/sched.h>
@@ -76,17 +78,17 @@ struct cpu_start_args {
};
struct ipi_cache_args {
- cpumask_t ica_mask;
+ cpuset_t ica_mask;
vm_paddr_t ica_pa;
};
struct ipi_rd_args {
- cpumask_t ira_mask;
+ cpuset_t ira_mask;
register_t *ira_val;
};
struct ipi_tlb_args {
- cpumask_t ita_mask;
+ cpuset_t ita_mask;
struct pmap *ita_pmap;
u_long ita_start;
u_long ita_end;
@@ -100,7 +102,7 @@ extern struct pcb stoppcbs[];
void cpu_mp_bootstrap(struct pcpu *pc);
void cpu_mp_shutdown(void);
-typedef void cpu_ipi_selected_t(u_int, u_long, u_long, u_long);
+typedef void cpu_ipi_selected_t(cpuset_t, u_long, u_long, u_long);
extern cpu_ipi_selected_t *cpu_ipi_selected;
typedef void cpu_ipi_single_t(u_int, u_long, u_long, u_long);
extern cpu_ipi_single_t *cpu_ipi_single;
@@ -135,12 +137,15 @@ extern char tl_ipi_tlb_range_demap[];
static __inline void
ipi_all_but_self(u_int ipi)
{
+ cpuset_t cpus;
- cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)tl_ipi_level, ipi);
+ cpus = all_cpus;
+ CPU_CLR(PCPU_GET(cpuid), &cpus);
+ cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi);
}
static __inline void
-ipi_selected(u_int cpus, u_int ipi)
+ipi_selected(cpuset_t cpus, u_int ipi)
{
cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi);
@@ -166,8 +171,9 @@ ipi_dcache_page_inval(void *func, vm_paddr_t pa)
ica = &ipi_cache_args;
mtx_lock_spin(&ipi_mtx);
ica->ica_mask = all_cpus;
+ CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask);
ica->ica_pa = pa;
- cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica);
+ cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica);
return (&ica->ica_mask);
}
@@ -182,8 +188,9 @@ ipi_icache_page_inval(void *func, vm_paddr_t pa)
ica = &ipi_cache_args;
mtx_lock_spin(&ipi_mtx);
ica->ica_mask = all_cpus;
+ CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask);
ica->ica_pa = pa;
- cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica);
+ cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica);
return (&ica->ica_mask);
}
@@ -197,7 +204,7 @@ ipi_rd(u_int cpu, void *func, u_long *val)
sched_pin();
ira = &ipi_rd_args;
mtx_lock_spin(&ipi_mtx);
- ira->ira_mask = 1 << cpu | PCPU_GET(cpumask);
+ CPU_SETOF(cpu, &ira->ira_mask);
ira->ira_val = val;
cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira);
return (&ira->ira_mask);
@@ -207,18 +214,21 @@ static __inline void *
ipi_tlb_context_demap(struct pmap *pm)
{
struct ipi_tlb_args *ita;
- cpumask_t cpus;
+ cpuset_t cpus;
if (smp_cpus == 1)
return (NULL);
sched_pin();
- if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) {
+ cpus = pm->pm_active;
+ CPU_AND(&cpus, &all_cpus);
+ CPU_CLR(PCPU_GET(cpuid), &cpus);
+ if (CPU_EMPTY(&cpus)) {
sched_unpin();
return (NULL);
}
ita = &ipi_tlb_args;
mtx_lock_spin(&ipi_mtx);
- ita->ita_mask = cpus | PCPU_GET(cpumask);
+ ita->ita_mask = cpus;
ita->ita_pmap = pm;
cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap,
(u_long)ita);
@@ -229,18 +239,21 @@ static __inline void *
ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va)
{
struct ipi_tlb_args *ita;
- cpumask_t cpus;
+ cpuset_t cpus;
if (smp_cpus == 1)
return (NULL);
sched_pin();
- if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) {
+ cpus = pm->pm_active;
+ CPU_AND(&cpus, &all_cpus);
+ CPU_CLR(PCPU_GET(cpuid), &cpus);
+ if (CPU_EMPTY(&cpus)) {
sched_unpin();
return (NULL);
}
ita = &ipi_tlb_args;
mtx_lock_spin(&ipi_mtx);
- ita->ita_mask = cpus | PCPU_GET(cpumask);
+ ita->ita_mask = cpus;
ita->ita_pmap = pm;
ita->ita_va = va;
cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_page_demap, (u_long)ita);
@@ -251,18 +264,21 @@ static __inline void *
ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end)
{
struct ipi_tlb_args *ita;
- cpumask_t cpus;
+ cpuset_t cpus;
if (smp_cpus == 1)
return (NULL);
sched_pin();
- if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) {
+ cpus = pm->pm_active;
+ CPU_AND(&cpus, &all_cpus);
+ CPU_CLR(PCPU_GET(cpuid), &cpus);
+ if (CPU_EMPTY(&cpus)) {
sched_unpin();
return (NULL);
}
ita = &ipi_tlb_args;
mtx_lock_spin(&ipi_mtx);
- ita->ita_mask = cpus | PCPU_GET(cpumask);
+ ita->ita_mask = cpus;
ita->ita_pmap = pm;
ita->ita_start = start;
ita->ita_end = end;
@@ -274,11 +290,10 @@ ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end)
static __inline void
ipi_wait(void *cookie)
{
- volatile cpumask_t *mask;
+ volatile cpuset_t *mask;
if ((mask = cookie) != NULL) {
- atomic_clear_int(mask, PCPU_GET(cpumask));
- while (*mask != 0)
+ while (!CPU_EMPTY(mask))
;
mtx_unlock_spin(&ipi_mtx);
sched_unpin();
diff --git a/sys/sparc64/sparc64/exception.S b/sys/sparc64/sparc64/exception.S
index ed0e381..0b8a0fa 100644
--- a/sys/sparc64/sparc64/exception.S
+++ b/sys/sparc64/sparc64/exception.S
@@ -1280,6 +1280,7 @@ ENTRY(tl1_data_excptn_trap)
END(tl1_data_excptn_trap)
.macro tl1_align
+ wrpr %g0, PSTATE_ALT, %pstate
ba,a %xcc, tl1_align_trap
nop
.align 32
@@ -1289,7 +1290,7 @@ ENTRY(tl1_align_trap)
RESUME_SPILLFILL_ALIGN
ba %xcc, tl1_sfsr_trap
mov T_MEM_ADDRESS_NOT_ALIGNED | T_KERNEL, %g2
-END(tl1_data_excptn_trap)
+END(tl1_align_trap)
ENTRY(tl1_sfsr_trap)
wr %g0, ASI_DMMU, %asi
@@ -2615,9 +2616,9 @@ ENTRY(tl0_ret)
andn %l4, TSTATE_CWP_MASK, %g2
/*
- * Restore %y. Could also be below if we had more alternate globals.
+ * Save %y in an alternate global.
*/
- wr %l5, 0, %y
+ mov %l5, %g4
/*
* Setup %wstate for return. We need to restore the user window state
@@ -2662,8 +2663,8 @@ tl0_ret_fill:
* Fixup %tstate so the saved %cwp points to the current window and
* restore it.
*/
- rdpr %cwp, %g4
- wrpr %g2, %g4, %tstate
+ rdpr %cwp, %g1
+ wrpr %g2, %g1, %tstate
/*
* Restore the user window state. The transition bit was set above
@@ -2673,20 +2674,25 @@ tl0_ret_fill:
#if KTR_COMPILE & KTR_TRAP
CATR(KTR_TRAP, "tl0_ret: td=%#lx pil=%#lx pc=%#lx npc=%#lx sp=%#lx"
- , %g2, %g3, %g4, 7, 8, 9)
- ldx [PCPU(CURTHREAD)], %g3
- stx %g3, [%g2 + KTR_PARM1]
- rdpr %pil, %g3
- stx %g3, [%g2 + KTR_PARM2]
- rdpr %tpc, %g3
- stx %g3, [%g2 + KTR_PARM3]
- rdpr %tnpc, %g3
- stx %g3, [%g2 + KTR_PARM4]
- stx %sp, [%g2 + KTR_PARM5]
+ , %g1, %g2, %g3, 7, 8, 9)
+ ldx [PCPU(CURTHREAD)], %g2
+ stx %g2, [%g1 + KTR_PARM1]
+ rdpr %pil, %g2
+ stx %g2, [%g1 + KTR_PARM2]
+ rdpr %tpc, %g2
+ stx %g2, [%g1 + KTR_PARM3]
+ rdpr %tnpc, %g2
+ stx %g2, [%g1 + KTR_PARM4]
+ stx %sp, [%g1 + KTR_PARM5]
9:
#endif
/*
+ * Restore %y. Note that the CATR above clobbered it.
+ */
+ wr %g4, 0, %y
+
+ /*
* Return to usermode.
*/
retry
@@ -2697,9 +2703,14 @@ tl0_ret_fill_end:
, %l0, %l1, %l2, 7, 8, 9)
rdpr %pstate, %l1
stx %l1, [%l0 + KTR_PARM1]
- stx %l5, [%l0 + KTR_PARM2]
+ stx %l6, [%l0 + KTR_PARM2]
stx %sp, [%l0 + KTR_PARM3]
9:
+
+ /*
+ * Restore %y clobbered by the CATR. This was saved in %l5 above.
+ */
+ wr %l5, 0, %y
#endif
/*
@@ -2867,34 +2878,36 @@ ENTRY(tl1_ret)
andn %l0, TSTATE_CWP_MASK, %g1
mov %l1, %g2
mov %l2, %g3
+ mov %l4, %g4
wrpr %l3, 0, %pil
- wr %l4, 0, %y
restore
wrpr %g0, 2, %tl
- rdpr %cwp, %g4
- wrpr %g1, %g4, %tstate
wrpr %g2, 0, %tpc
wrpr %g3, 0, %tnpc
+ rdpr %cwp, %g2
+ wrpr %g1, %g2, %tstate
#if KTR_COMPILE & KTR_TRAP
CATR(KTR_TRAP, "tl1_ret: td=%#lx pil=%#lx ts=%#lx pc=%#lx sp=%#lx"
- , %g2, %g3, %g4, 7, 8, 9)
- ldx [PCPU(CURTHREAD)], %g3
- stx %g3, [%g2 + KTR_PARM1]
- rdpr %pil, %g3
- stx %g3, [%g2 + KTR_PARM2]
- rdpr %tstate, %g3
- stx %g3, [%g2 + KTR_PARM3]
- rdpr %tpc, %g3
- stx %g3, [%g2 + KTR_PARM4]
- stx %sp, [%g2 + KTR_PARM5]
+ , %g1, %g2, %g3, 7, 8, 9)
+ ldx [PCPU(CURTHREAD)], %g2
+ stx %g2, [%g1 + KTR_PARM1]
+ rdpr %pil, %g2
+ stx %g2, [%g1 + KTR_PARM2]
+ rdpr %tstate, %g2
+ stx %g2, [%g1 + KTR_PARM3]
+ rdpr %tpc, %g2
+ stx %g2, [%g1 + KTR_PARM4]
+ stx %sp, [%g1 + KTR_PARM5]
9:
#endif
+ wr %g4, 0, %y
+
retry
END(tl1_ret)
@@ -2995,33 +3008,35 @@ ENTRY(tl1_intr)
andn %l0, TSTATE_CWP_MASK, %g1
mov %l1, %g2
mov %l2, %g3
+ mov %l4, %g4
wrpr %l3, 0, %pil
- wr %l4, 0, %y
restore
wrpr %g0, 2, %tl
- rdpr %cwp, %g4
- wrpr %g1, %g4, %tstate
wrpr %g2, 0, %tpc
wrpr %g3, 0, %tnpc
+ rdpr %cwp, %g2
+ wrpr %g1, %g2, %tstate
#if KTR_COMPILE & KTR_INTR
CATR(KTR_INTR, "tl1_intr: td=%#x pil=%#lx ts=%#lx pc=%#lx sp=%#lx"
- , %g2, %g3, %g4, 7, 8, 9)
- ldx [PCPU(CURTHREAD)], %g3
- stx %g3, [%g2 + KTR_PARM1]
- rdpr %pil, %g3
- stx %g3, [%g2 + KTR_PARM2]
- rdpr %tstate, %g3
- stx %g3, [%g2 + KTR_PARM3]
- rdpr %tpc, %g3
- stx %g3, [%g2 + KTR_PARM4]
- stx %sp, [%g2 + KTR_PARM5]
+ , %g1, %g2, %g3, 7, 8, 9)
+ ldx [PCPU(CURTHREAD)], %g2
+ stx %g2, [%g1 + KTR_PARM1]
+ rdpr %pil, %g2
+ stx %g2, [%g1 + KTR_PARM2]
+ rdpr %tstate, %g2
+ stx %g2, [%g1 + KTR_PARM3]
+ rdpr %tpc, %g2
+ stx %g2, [%g1 + KTR_PARM4]
+ stx %sp, [%g1 + KTR_PARM5]
9:
#endif
+ wr %g4, 0, %y
+
retry
END(tl1_intr)
diff --git a/sys/sparc64/sparc64/genassym.c b/sys/sparc64/sparc64/genassym.c
index e33e581..89ec718 100644
--- a/sys/sparc64/sparc64/genassym.c
+++ b/sys/sparc64/sparc64/genassym.c
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/smp.h>
#include <sys/vmmeter.h>
+#include <sys/_cpuset.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
@@ -59,6 +60,8 @@ ASSYM(PCPU_PAGES, PCPU_PAGES);
ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT);
+ASSYM(_NCPUBITS, _NCPUBITS);
+
#ifdef SUN4U
ASSYM(TLB_DEMAP_ALL, TLB_DEMAP_ALL);
#endif
@@ -137,7 +140,6 @@ ASSYM(MAXCOMLEN, MAXCOMLEN);
ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
-ASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask));
ASSYM(PC_IRHEAD, offsetof(struct pcpu, pc_irhead));
ASSYM(PC_IRTAIL, offsetof(struct pcpu, pc_irtail));
ASSYM(PC_IRFREE, offsetof(struct pcpu, pc_irfree));
diff --git a/sys/sparc64/sparc64/intr_machdep.c b/sys/sparc64/sparc64/intr_machdep.c
index f6ef9a7..112ddab 100644
--- a/sys/sparc64/sparc64/intr_machdep.c
+++ b/sys/sparc64/sparc64/intr_machdep.c
@@ -83,10 +83,11 @@ CTASSERT((1 << IV_SHIFT) == sizeof(struct intr_vector));
ih_func_t *intr_handlers[PIL_MAX];
uint16_t pil_countp[PIL_MAX];
+static uint16_t pil_stray_count[PIL_MAX];
struct intr_vector intr_vectors[IV_MAX];
uint16_t intr_countp[IV_MAX];
-static u_long intr_stray_count[IV_MAX];
+static uint16_t intr_stray_count[IV_MAX];
static const char *const pil_names[] = {
"stray",
@@ -199,22 +200,32 @@ intr_setup(int pri, ih_func_t *ihf, int vec, iv_func_t *ivf, void *iva)
static void
intr_stray_level(struct trapframe *tf)
{
-
- printf("stray level interrupt %ld\n", tf->tf_level);
+ uint64_t level;
+
+ level = tf->tf_level;
+ if (pil_stray_count[level] < MAX_STRAY_LOG) {
+ printf("stray level interrupt %ld\n", level);
+ pil_stray_count[level]++;
+ if (pil_stray_count[level] >= MAX_STRAY_LOG)
+ printf("got %d stray level interrupt %ld's: not "
+ "logging anymore\n", MAX_STRAY_LOG, level);
+ }
}
static void
intr_stray_vector(void *cookie)
{
struct intr_vector *iv;
+ u_int vec;
iv = cookie;
- if (intr_stray_count[iv->iv_vec] < MAX_STRAY_LOG) {
- printf("stray vector interrupt %d\n", iv->iv_vec);
- intr_stray_count[iv->iv_vec]++;
- if (intr_stray_count[iv->iv_vec] >= MAX_STRAY_LOG)
- printf("got %d stray interrupt %d's: not logging "
- "anymore\n", MAX_STRAY_LOG, iv->iv_vec);
+ vec = iv->iv_vec;
+ if (intr_stray_count[vec] < MAX_STRAY_LOG) {
+ printf("stray vector interrupt %d\n", vec);
+ intr_stray_count[vec]++;
+ if (intr_stray_count[vec] >= MAX_STRAY_LOG)
+ printf("got %d stray vector interrupt %d's: not "
+ "logging anymore\n", MAX_STRAY_LOG, vec);
}
}
@@ -445,8 +456,7 @@ intr_describe(int vec, void *ih, const char *descr)
* allocate CPUs round-robin.
*/
-/* The BSP is always a valid target. */
-static cpumask_t intr_cpus = (1 << 0);
+static cpuset_t intr_cpus;
static int current_cpu;
static void
@@ -468,7 +478,7 @@ intr_assign_next_cpu(struct intr_vector *iv)
current_cpu++;
if (current_cpu > mp_maxid)
current_cpu = 0;
- } while (!(intr_cpus & (1 << current_cpu)));
+ } while (!CPU_ISSET(current_cpu, &intr_cpus));
}
/* Attempt to bind the specified IRQ to the specified CPU. */
@@ -504,7 +514,7 @@ intr_add_cpu(u_int cpu)
if (bootverbose)
printf("INTR: Adding CPU %d as a target\n", cpu);
- intr_cpus |= (1 << cpu);
+ CPU_SET(cpu, &intr_cpus);
}
/*
@@ -518,6 +528,9 @@ intr_shuffle_irqs(void *arg __unused)
struct intr_vector *iv;
int i;
+ /* The BSP is always a valid target. */
+ CPU_SETOF(0, &intr_cpus);
+
/* Don't bother on UP. */
if (mp_ncpus == 1)
return;
diff --git a/sys/sparc64/sparc64/mp_exception.S b/sys/sparc64/sparc64/mp_exception.S
index 5a8a105..f1b323a 100644
--- a/sys/sparc64/sparc64/mp_exception.S
+++ b/sys/sparc64/sparc64/mp_exception.S
@@ -38,9 +38,21 @@ __FBSDID("$FreeBSD$");
.register %g2, #ignore
.register %g3, #ignore
-#define IPI_DONE(r1, r2, r3, r4) \
- lduw [PCPU(CPUMASK)], r4 ; \
- ATOMIC_CLEAR_INT(r1, r2, r3, r4)
+#define IPI_DONE(r1, r2, r3, r4, r5, r6) \
+ rd %y, r6 ; \
+ lduw [PCPU(CPUID)], r2 ; \
+ mov _NCPUBITS, r3 ; \
+ mov %g0, %y ; \
+ udiv r2, r3, r4 ; \
+ srl r4, 0, r5 ; \
+ sllx r5, PTR_SHIFT, r5 ; \
+ add r1, r5, r1 ; \
+ smul r4, r3, r3 ; \
+ sub r2, r3, r3 ; \
+ mov 1, r4 ; \
+ sllx r4, r3, r4 ; \
+ wr r6, %y ; \
+ ATOMIC_CLEAR_LONG(r1, r2, r3, r4)
/*
* Invalidate a physical page in the data cache. For UltraSPARC I and II.
@@ -77,7 +89,7 @@ ENTRY(tl_ipi_spitfire_dcache_page_inval)
2: brgz,pt %g2, 1b
sub %g2, %g4, %g2
- IPI_DONE(%g5, %g1, %g2, %g3)
+ IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
retry
END(tl_ipi_spitfire_dcache_page_inval)
@@ -117,7 +129,7 @@ ENTRY(tl_ipi_spitfire_icache_page_inval)
2: brgz,pt %g2, 1b
sub %g2, %g4, %g2
- IPI_DONE(%g5, %g1, %g2, %g3)
+ IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
retry
END(tl_ipi_spitfire_icache_page_inval)
@@ -148,7 +160,7 @@ ENTRY(tl_ipi_cheetah_dcache_page_inval)
blt,a,pt %xcc, 1b
nop
- IPI_DONE(%g5, %g1, %g2, %g3)
+ IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
retry
END(tl_ipi_cheetah_dcache_page_inval)
@@ -204,7 +216,7 @@ ENTRY(tl_ipi_tlb_page_demap)
stxa %g0, [%g2] ASI_IMMU_DEMAP
flush %g3
- IPI_DONE(%g5, %g1, %g2, %g3)
+ IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
retry
END(tl_ipi_tlb_page_demap)
@@ -247,7 +259,7 @@ ENTRY(tl_ipi_tlb_range_demap)
blt,a,pt %xcc, 1b
nop
- IPI_DONE(%g5, %g1, %g2, %g3)
+ IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
retry
END(tl_ipi_tlb_range_demap)
@@ -271,7 +283,7 @@ ENTRY(tl_ipi_tlb_context_demap)
stxa %g0, [%g1] ASI_IMMU_DEMAP
flush %g3
- IPI_DONE(%g5, %g1, %g2, %g3)
+ IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
retry
END(tl_ipi_tlb_context_demap)
@@ -283,7 +295,7 @@ ENTRY(tl_ipi_stick_rd)
rd %asr24, %g2
stx %g2, [%g1]
- IPI_DONE(%g5, %g1, %g2, %g3)
+ IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
retry
END(tl_ipi_stick_rd)
@@ -295,6 +307,6 @@ ENTRY(tl_ipi_tick_rd)
rd %tick, %g2
stx %g2, [%g1]
- IPI_DONE(%g5, %g1, %g2, %g3)
+ IPI_DONE(%g5, %g1, %g2, %g3, %g4, %g6)
retry
END(tl_ipi_tick_rd)
diff --git a/sys/sparc64/sparc64/mp_locore.S b/sys/sparc64/sparc64/mp_locore.S
index fbcb767..fd4357e 100644
--- a/sys/sparc64/sparc64/mp_locore.S
+++ b/sys/sparc64/sparc64/mp_locore.S
@@ -269,13 +269,17 @@ ENTRY(mp_startup)
add %l1, %l2, %l1
sub %l1, SPOFF + CCFSZ, %sp
+ /* Initialize global registers. */
+ call cpu_setregs
+ mov %l1, %o0
+
#if KTR_COMPILE & KTR_SMP
CATR(KTR_SMP,
"mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx"
, %g1, %g2, %g3, 7, 8, 9)
- lduw [%l1 + PC_CPUID], %g2
+ lduw [PCPU(CPUID)], %g2
stx %g2, [%g1 + KTR_PARM1]
- lduw [%l1 + PC_MID], %g2
+ lduw [PCPU(MID)], %g2
stx %g2, [%g1 + KTR_PARM2]
stx %l1, [%g1 + KTR_PARM3]
stx %sp, [%g1 + KTR_PARM5]
diff --git a/sys/sparc64/sparc64/mp_machdep.c b/sys/sparc64/sparc64/mp_machdep.c
index 8700f89..83d8e9f 100644
--- a/sys/sparc64/sparc64/mp_machdep.c
+++ b/sys/sparc64/sparc64/mp_machdep.c
@@ -121,7 +121,7 @@ cpu_ipi_single_t *cpu_ipi_single;
static vm_offset_t mp_tramp;
static u_int cpuid_to_mid[MAXCPU];
static int isjbus;
-static volatile cpumask_t shutdown_cpus;
+static volatile cpuset_t shutdown_cpus;
static void ap_count(phandle_t node, u_int mid, u_int cpu_impl);
static void ap_start(phandle_t node, u_int mid, u_int cpu_impl);
@@ -140,8 +140,6 @@ static cpu_ipi_single_t spitfire_ipi_single;
SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL);
CTASSERT(MAXCPU <= IDR_CHEETAH_MAX_BN_PAIRS);
-CTASSERT(MAXCPU <= sizeof(u_int) * NBBY);
-CTASSERT(MAXCPU <= sizeof(int) * NBBY);
void
mp_init(u_int cpu_impl)
@@ -228,7 +226,7 @@ void
cpu_mp_setmaxid()
{
- all_cpus = 1 << curcpu;
+ CPU_SETOF(curcpu, &all_cpus);
mp_ncpus = 1;
mp_maxid = 0;
@@ -283,6 +281,7 @@ sun4u_startcpu(phandle_t cpu, void *func, u_long arg)
void
cpu_mp_start(void)
{
+ cpuset_t ocpus;
mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN);
@@ -299,7 +298,9 @@ cpu_mp_start(void)
KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS,
("%s: can only IPI a maximum of %d JBus-CPUs",
__func__, IDR_JALAPENO_MAX_BN_PAIRS));
- PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu));
+ ocpus = all_cpus;
+ CPU_CLR(curcpu, &ocpus);
+ PCPU_SET(other_cpus, ocpus);
smp_active = 1;
}
@@ -357,7 +358,7 @@ ap_start(phandle_t node, u_int mid, u_int cpu_impl)
cache_init(pc);
- all_cpus |= 1 << cpuid;
+ CPU_SET(cpuid, &all_cpus);
intr_add_cpu(cpuid);
}
@@ -383,7 +384,7 @@ cpu_mp_unleash(void *v)
ctx_inc = (TLB_CTX_USER_MAX - 1) / mp_ncpus;
csa = &cpu_start_args;
csa->csa_count = mp_ncpus;
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) {
pc->pc_tlb_ctx = ctx_min;
pc->pc_tlb_ctx_min = ctx_min;
pc->pc_tlb_ctx_max = ctx_min + ctx_inc;
@@ -421,6 +422,7 @@ cpu_mp_unleash(void *v)
void
cpu_mp_bootstrap(struct pcpu *pc)
{
+ cpuset_t ocpus;
volatile struct cpu_start_args *csa;
csa = &cpu_start_args;
@@ -453,9 +455,6 @@ cpu_mp_bootstrap(struct pcpu *pc)
*/
tlb_flush_nonlocked();
- /* Initialize global registers. */
- cpu_setregs(pc);
-
/*
* Enable interrupts.
* Note that the PIL we be lowered indirectly via sched_throw(NULL)
@@ -465,7 +464,9 @@ cpu_mp_bootstrap(struct pcpu *pc)
smp_cpus++;
KASSERT(curthread != NULL, ("%s: curthread", __func__));
- PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu));
+ ocpus = all_cpus;
+ CPU_CLR(curcpu, &ocpus);
+ PCPU_SET(other_cpus, ocpus);
printf("SMP: AP CPU #%d Launched!\n", curcpu);
csa->csa_count--;
@@ -484,14 +485,23 @@ cpu_mp_bootstrap(struct pcpu *pc)
void
cpu_mp_shutdown(void)
{
+ cpuset_t cpus;
int i;
critical_enter();
- shutdown_cpus = PCPU_GET(other_cpus);
- if (stopped_cpus != PCPU_GET(other_cpus)) /* XXX */
- stop_cpus(stopped_cpus ^ PCPU_GET(other_cpus));
+ shutdown_cpus = all_cpus;
+ CPU_CLR(PCPU_GET(cpuid), &shutdown_cpus);
+ cpus = shutdown_cpus;
+
+ /* XXX: Stop all the CPUs which aren't already. */
+ if (CPU_CMP(&stopped_cpus, &cpus)) {
+
+ /* cpus is just a flat "on" mask without curcpu. */
+ CPU_NAND(&cpus, &stopped_cpus);
+ stop_cpus(cpus);
+ }
i = 0;
- while (shutdown_cpus != 0) {
+ while (!CPU_EMPTY(&shutdown_cpus)) {
if (i++ > 100000) {
printf("timeout shutting down CPUs.\n");
break;
@@ -509,20 +519,24 @@ cpu_ipi_ast(struct trapframe *tf)
static void
cpu_ipi_stop(struct trapframe *tf)
{
+ u_int cpuid;
CTR2(KTR_SMP, "%s: stopped %d", __func__, curcpu);
+ sched_pin();
savectx(&stoppcbs[curcpu]);
- atomic_set_acq_int(&stopped_cpus, PCPU_GET(cpumask));
- while ((started_cpus & PCPU_GET(cpumask)) == 0) {
- if ((shutdown_cpus & PCPU_GET(cpumask)) != 0) {
- atomic_clear_int(&shutdown_cpus, PCPU_GET(cpumask));
+ cpuid = PCPU_GET(cpuid);
+ CPU_SET_ATOMIC(cpuid, &stopped_cpus);
+ while (!CPU_ISSET(cpuid, &started_cpus)) {
+ if (CPU_ISSET(cpuid, &shutdown_cpus)) {
+ CPU_CLR_ATOMIC(cpuid, &shutdown_cpus);
(void)intr_disable();
for (;;)
;
}
}
- atomic_clear_rel_int(&started_cpus, PCPU_GET(cpumask));
- atomic_clear_rel_int(&stopped_cpus, PCPU_GET(cpumask));
+ CPU_CLR_ATOMIC(cpuid, &started_cpus);
+ CPU_CLR_ATOMIC(cpuid, &stopped_cpus);
+ sched_unpin();
CTR2(KTR_SMP, "%s: restarted %d", __func__, curcpu);
}
@@ -551,13 +565,13 @@ cpu_ipi_hardclock(struct trapframe *tf)
}
static void
-spitfire_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
+spitfire_ipi_selected(cpuset_t cpus, u_long d0, u_long d1, u_long d2)
{
u_int cpu;
- while (cpus) {
- cpu = ffs(cpus) - 1;
- cpus &= ~(1 << cpu);
+ while ((cpu = cpusetobj_ffs(&cpus)) != 0) {
+ cpu--;
+ CPU_CLR(cpu, &cpus);
spitfire_ipi_single(cpu, d0, d1, d2);
}
}
@@ -657,20 +671,21 @@ cheetah_ipi_single(u_int cpu, u_long d0, u_long d1, u_long d2)
}
static void
-cheetah_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
+cheetah_ipi_selected(cpuset_t cpus, u_long d0, u_long d1, u_long d2)
{
+ char pbuf[CPUSETBUFSIZ];
register_t s;
u_long ids;
u_int bnp;
u_int cpu;
int i;
- KASSERT((cpus & (1 << curcpu)) == 0,
- ("%s: CPU can't IPI itself", __func__));
+ KASSERT(!CPU_ISSET(curcpu, &cpus), ("%s: CPU can't IPI itself",
+ __func__));
KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) &
IDR_CHEETAH_ALL_BUSY) == 0,
("%s: outstanding dispatch", __func__));
- if (cpus == 0)
+ if (CPU_EMPTY(&cpus))
return;
ids = 0;
for (i = 0; i < IPI_RETRIES * mp_ncpus; i++) {
@@ -681,7 +696,7 @@ cheetah_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
membar(Sync);
bnp = 0;
for (cpu = 0; cpu < mp_ncpus; cpu++) {
- if ((cpus & (1 << cpu)) != 0) {
+ if (CPU_ISSET(cpu, &cpus)) {
stxa(AA_INTR_SEND | (cpuid_to_mid[cpu] <<
IDC_ITID_SHIFT) | bnp << IDC_BN_SHIFT,
ASI_SDB_INTR_W, 0);
@@ -698,9 +713,9 @@ cheetah_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
return;
bnp = 0;
for (cpu = 0; cpu < mp_ncpus; cpu++) {
- if ((cpus & (1 << cpu)) != 0) {
+ if (CPU_ISSET(cpu, &cpus)) {
if ((ids & (IDR_NACK << (2 * bnp))) == 0)
- cpus &= ~(1 << cpu);
+ CPU_CLR(cpu, &cpus);
bnp++;
}
}
@@ -709,7 +724,7 @@ cheetah_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
* CPUs we actually haven't tried to send an IPI to,
* but which apparently can be safely ignored.
*/
- if (cpus == 0)
+ if (CPU_EMPTY(&cpus))
return;
/*
* Leave interrupts enabled for a bit before retrying
@@ -719,11 +734,11 @@ cheetah_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
DELAY(2 * mp_ncpus);
}
if (kdb_active != 0 || panicstr != NULL)
- printf("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)\n",
- __func__, cpus, ids);
+ printf("%s: couldn't send IPI (cpus=%s ids=0x%lu)\n",
+ __func__, cpusetobj_strprint(pbuf, &cpus), ids);
else
- panic("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)",
- __func__, cpus, ids);
+ panic("%s: couldn't send IPI (cpus=%s ids=0x%lu)",
+ __func__, cpusetobj_strprint(pbuf, &cpus), ids);
}
static void
@@ -772,19 +787,20 @@ jalapeno_ipi_single(u_int cpu, u_long d0, u_long d1, u_long d2)
}
static void
-jalapeno_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
+jalapeno_ipi_selected(cpuset_t cpus, u_long d0, u_long d1, u_long d2)
{
+ char pbuf[CPUSETBUFSIZ];
register_t s;
u_long ids;
u_int cpu;
int i;
- KASSERT((cpus & (1 << curcpu)) == 0,
- ("%s: CPU can't IPI itself", __func__));
+ KASSERT(!CPU_ISSET(curcpu, &cpus), ("%s: CPU can't IPI itself",
+ __func__));
KASSERT((ldxa(0, ASI_INTR_DISPATCH_STATUS) &
IDR_CHEETAH_ALL_BUSY) == 0,
("%s: outstanding dispatch", __func__));
- if (cpus == 0)
+ if (CPU_EMPTY(&cpus))
return;
ids = 0;
for (i = 0; i < IPI_RETRIES * mp_ncpus; i++) {
@@ -794,7 +810,7 @@ jalapeno_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
stxa(AA_SDB_INTR_D2, ASI_SDB_INTR_W, d2);
membar(Sync);
for (cpu = 0; cpu < mp_ncpus; cpu++) {
- if ((cpus & (1 << cpu)) != 0) {
+ if (CPU_ISSET(cpu, &cpus)) {
stxa(AA_INTR_SEND | (cpuid_to_mid[cpu] <<
IDC_ITID_SHIFT), ASI_SDB_INTR_W, 0);
membar(Sync);
@@ -808,10 +824,10 @@ jalapeno_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
(IDR_CHEETAH_ALL_BUSY | IDR_CHEETAH_ALL_NACK)) == 0)
return;
for (cpu = 0; cpu < mp_ncpus; cpu++)
- if ((cpus & (1 << cpu)) != 0)
+ if (CPU_ISSET(cpu, &cpus))
if ((ids & (IDR_NACK <<
(2 * cpuid_to_mid[cpu]))) == 0)
- cpus &= ~(1 << cpu);
+ CPU_CLR(cpu, &cpus);
/*
* Leave interrupts enabled for a bit before retrying
* in order to avoid deadlocks if the other CPUs are
@@ -820,9 +836,9 @@ jalapeno_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
DELAY(2 * mp_ncpus);
}
if (kdb_active != 0 || panicstr != NULL)
- printf("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)\n",
- __func__, cpus, ids);
+ printf("%s: couldn't send IPI (cpus=%s ids=0x%lu)\n",
+ __func__, cpusetobj_strprint(pbuf, &cpus), ids);
else
- panic("%s: couldn't send IPI (cpus=0x%u ids=0x%lu)",
- __func__, cpus, ids);
+ panic("%s: couldn't send IPI (cpus=%s ids=0x%lu)",
+ __func__, cpusetobj_strprint(pbuf, &cpus), ids);
}
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 09482b9..876dce3 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -664,7 +664,7 @@ pmap_bootstrap(u_int cpu_impl)
pm = kernel_pmap;
for (i = 0; i < MAXCPU; i++)
pm->pm_context[i] = TLB_CTX_KERNEL;
- pm->pm_active = ~0;
+ CPU_FILL(&pm->pm_active);
/*
* Flush all non-locked TLB entries possibly left over by the
@@ -1189,7 +1189,7 @@ pmap_pinit0(pmap_t pm)
PMAP_LOCK_INIT(pm);
for (i = 0; i < MAXCPU; i++)
pm->pm_context[i] = TLB_CTX_KERNEL;
- pm->pm_active = 0;
+ CPU_ZERO(&pm->pm_active);
pm->pm_tsb = NULL;
pm->pm_tsb_obj = NULL;
bzero(&pm->pm_stats, sizeof(pm->pm_stats));
@@ -1229,7 +1229,7 @@ pmap_pinit(pmap_t pm)
mtx_lock_spin(&sched_lock);
for (i = 0; i < MAXCPU; i++)
pm->pm_context[i] = -1;
- pm->pm_active = 0;
+ CPU_ZERO(&pm->pm_active);
mtx_unlock_spin(&sched_lock);
VM_OBJECT_LOCK(pm->pm_tsb_obj);
@@ -1278,7 +1278,7 @@ pmap_release(pmap_t pm)
* to a kernel thread, leaving the pmap pointer unchanged.
*/
mtx_lock_spin(&sched_lock);
- SLIST_FOREACH(pc, &cpuhead, pc_allcpu)
+ STAILQ_FOREACH(pc, &cpuhead, pc_allcpu)
if (pc->pc_pmap == pm)
pc->pc_pmap = NULL;
mtx_unlock_spin(&sched_lock);
@@ -2217,11 +2217,10 @@ pmap_activate(struct thread *td)
struct pmap *pm;
int context;
+ critical_enter();
vm = td->td_proc->p_vmspace;
pm = vmspace_pmap(vm);
- mtx_lock_spin(&sched_lock);
-
context = PCPU_GET(tlb_ctx);
if (context == PCPU_GET(tlb_ctx_max)) {
tlb_flush_user();
@@ -2229,17 +2228,18 @@ pmap_activate(struct thread *td)
}
PCPU_SET(tlb_ctx, context + 1);
+ mtx_lock_spin(&sched_lock);
pm->pm_context[curcpu] = context;
- pm->pm_active |= PCPU_GET(cpumask);
+ CPU_SET(PCPU_GET(cpuid), &pm->pm_active);
PCPU_SET(pmap, pm);
+ mtx_unlock_spin(&sched_lock);
stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb);
stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb);
stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) &
TLB_CXR_PGSZ_MASK) | context);
flush(KERNBASE);
-
- mtx_unlock_spin(&sched_lock);
+ critical_exit();
}
void
diff --git a/sys/sparc64/sparc64/swtch.S b/sys/sparc64/sparc64/swtch.S
index ea13779..7515734 100644
--- a/sys/sparc64/sparc64/swtch.S
+++ b/sys/sparc64/sparc64/swtch.S
@@ -164,20 +164,29 @@ ENTRY(cpu_switch)
* If there was no non-kernel pmap, don't try to deactivate it.
*/
brz,pn %l2, 3f
- lduw [PCPU(CPUMASK)], %l4
+ lduw [PCPU(CPUID)], %l3
/*
* Mark the pmap of the last non-kernel vmspace to run as no longer
* active on this CPU.
*/
- lduw [%l2 + PM_ACTIVE], %l3
- andn %l3, %l4, %l3
- stw %l3, [%l2 + PM_ACTIVE]
+ mov _NCPUBITS, %l5
+ mov %g0, %y
+ udiv %l3, %l5, %l6
+ srl %l6, 0, %l4
+ sllx %l4, PTR_SHIFT, %l4
+ add %l4, PM_ACTIVE, %l4
+ smul %l6, %l5, %l5
+ sub %l3, %l5, %l5
+ mov 1, %l6
+ sllx %l6, %l5, %l5
+ ldx [%l2 + %l4], %l6
+ andn %l6, %l5, %l6
+ stx %l6, [%l2 + %l4]
/*
* Take away its context number.
*/
- lduw [PCPU(CPUID)], %l3
sllx %l3, INT_SHIFT, %l3
add %l2, PM_CONTEXT, %l4
mov -1, %l5
@@ -210,18 +219,27 @@ ENTRY(cpu_switch)
/*
* Set the new context number in the pmap.
*/
- lduw [PCPU(CPUID)], %i4
- sllx %i4, INT_SHIFT, %i4
+ lduw [PCPU(CPUID)], %l3
+ sllx %l3, INT_SHIFT, %i4
add %l1, PM_CONTEXT, %i5
stw %i3, [%i4 + %i5]
/*
* Mark the pmap as active on this CPU.
*/
- lduw [%l1 + PM_ACTIVE], %i4
- lduw [PCPU(CPUMASK)], %i5
- or %i4, %i5, %i4
- stw %i4, [%l1 + PM_ACTIVE]
+ mov _NCPUBITS, %l5
+ mov %g0, %y
+ udiv %l3, %l5, %l6
+ srl %l6, 0, %l4
+ sllx %l4, PTR_SHIFT, %l4
+ add %l4, PM_ACTIVE, %l4
+ smul %l6, %l5, %l5
+ sub %l3, %l5, %l5
+ mov 1, %l6
+ sllx %l6, %l5, %l5
+ ldx [%l1 + %l4], %l6
+ or %l6, %l5, %l6
+ stx %l6, [%l1 + %l4]
/*
* Make note of the change in pmap.
diff --git a/sys/sparc64/sparc64/tlb.c b/sys/sparc64/sparc64/tlb.c
index 990c777..70b2823 100644
--- a/sys/sparc64/sparc64/tlb.c
+++ b/sys/sparc64/sparc64/tlb.c
@@ -80,7 +80,7 @@ tlb_context_demap(struct pmap *pm)
PMAP_STATS_INC(tlb_ncontext_demap);
cookie = ipi_tlb_context_demap(pm);
s = intr_disable();
- if (pm->pm_active & PCPU_GET(cpumask)) {
+ if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) {
KASSERT(pm->pm_context[curcpu] != -1,
("tlb_context_demap: inactive pmap?"));
stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_DMMU_DEMAP, 0);
@@ -101,7 +101,7 @@ tlb_page_demap(struct pmap *pm, vm_offset_t va)
PMAP_STATS_INC(tlb_npage_demap);
cookie = ipi_tlb_page_demap(pm, va);
s = intr_disable();
- if (pm->pm_active & PCPU_GET(cpumask)) {
+ if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) {
KASSERT(pm->pm_context[curcpu] != -1,
("tlb_page_demap: inactive pmap?"));
if (pm == kernel_pmap)
@@ -128,7 +128,7 @@ tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end)
PMAP_STATS_INC(tlb_nrange_demap);
cookie = ipi_tlb_range_demap(pm, start, end);
s = intr_disable();
- if (pm->pm_active & PCPU_GET(cpumask)) {
+ if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) {
KASSERT(pm->pm_context[curcpu] != -1,
("tlb_range_demap: inactive pmap?"));
if (pm == kernel_pmap)
diff --git a/sys/sys/_cpuset.h b/sys/sys/_cpuset.h
new file mode 100644
index 0000000..42a0a6a
--- /dev/null
+++ b/sys/sys/_cpuset.h
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2008, Jeffrey Roberson <jeff@freebsd.org>
+ * All rights reserved.
+ *
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved.
+ *
+ * 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 unmodified, 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 AUTHOR ``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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS__CPUSET_H_
+#define _SYS__CPUSET_H_
+
+#ifdef _KERNEL
+#define CPU_SETSIZE MAXCPU
+#endif
+
+#define CPU_MAXSIZE 128
+
+#ifndef CPU_SETSIZE
+#define CPU_SETSIZE CPU_MAXSIZE
+#endif
+
+#define _NCPUBITS (sizeof(long) * NBBY) /* bits per mask */
+#define _NCPUWORDS howmany(CPU_SETSIZE, _NCPUBITS)
+
+typedef struct _cpuset {
+ long __bits[howmany(CPU_SETSIZE, _NCPUBITS)];
+} cpuset_t;
+
+#endif /* !_SYS__CPUSET_H_ */
diff --git a/sys/sys/_rmlock.h b/sys/sys/_rmlock.h
index 75a159c..15d6c49 100644
--- a/sys/sys/_rmlock.h
+++ b/sys/sys/_rmlock.h
@@ -45,7 +45,7 @@ LIST_HEAD(rmpriolist,rm_priotracker);
struct rmlock {
struct lock_object lock_object;
- volatile cpumask_t rm_writecpus;
+ volatile cpuset_t rm_writecpus;
LIST_HEAD(,rm_priotracker) rm_activeReaders;
union {
struct mtx _rm_lock_mtx;
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 31fd34d..08e1582 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -280,6 +280,9 @@ struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...)
__printflike(2, 3);
int make_dev_alias_p(int _flags, struct cdev **_cdev, struct cdev *_pdev,
const char *_fmt, ...) __printflike(4, 5);
+int make_dev_physpath_alias(int _flags, struct cdev **_cdev,
+ struct cdev *_pdev, struct cdev *_old_alias,
+ const char *_physpath);
void dev_lock(void);
void dev_unlock(void);
void setconf(void);
@@ -332,6 +335,7 @@ struct dumperinfo {
int set_dumper(struct dumperinfo *);
int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t);
void dumpsys(struct dumperinfo *);
+int doadump(boolean_t);
extern int dumping; /* system is dumping */
#endif /* _KERNEL */
diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h
index 854fa29..030a874 100644
--- a/sys/sys/cpuset.h
+++ b/sys/sys/cpuset.h
@@ -32,22 +32,9 @@
#ifndef _SYS_CPUSET_H_
#define _SYS_CPUSET_H_
-#ifdef _KERNEL
-#define CPU_SETSIZE MAXCPU
-#endif
+#include <sys/_cpuset.h>
-#define CPU_MAXSIZE 128
-
-#ifndef CPU_SETSIZE
-#define CPU_SETSIZE CPU_MAXSIZE
-#endif
-
-#define _NCPUBITS (sizeof(long) * NBBY) /* bits per mask */
-#define _NCPUWORDS howmany(CPU_SETSIZE, _NCPUBITS)
-
-typedef struct _cpuset {
- long __bits[howmany(CPU_SETSIZE, _NCPUBITS)];
-} cpuset_t;
+#define CPUSETBUFSIZ ((2 + sizeof(long) * 2) * _NCPUWORDS)
#define __cpuset_mask(n) ((long)1 << ((n) % _NCPUBITS))
#define CPU_CLR(n, p) ((p)->__bits[(n)/_NCPUBITS] &= ~__cpuset_mask(n))
@@ -66,6 +53,11 @@ typedef struct _cpuset {
(p)->__bits[__i] = -1; \
} while (0)
+#define CPU_SETOF(n, p) do { \
+ CPU_ZERO(p); \
+ ((p)->__bits[(n)/_NCPUBITS] = __cpuset_mask(n)); \
+} while (0)
+
/* Is p empty. */
#define CPU_EMPTY(p) __extension__ ({ \
__size_t __i; \
@@ -75,6 +67,15 @@ typedef struct _cpuset {
__i == _NCPUWORDS; \
})
+/* Is p full set. */
+#define CPU_ISFULLSET(p) __extension__ ({ \
+ __size_t __i; \
+ for (__i = 0; __i < _NCPUWORDS; __i++) \
+ if ((p)->__bits[__i] != (long)-1) \
+ break; \
+ __i == _NCPUWORDS; \
+})
+
/* Is c a subset of p. */
#define CPU_SUBSET(p, c) __extension__ ({ \
__size_t __i; \
@@ -124,6 +125,33 @@ typedef struct _cpuset {
(d)->__bits[__i] &= ~(s)->__bits[__i]; \
} while (0)
+#define CPU_CLR_ATOMIC(n, p) \
+ atomic_clear_long(&(p)->__bits[(n)/_NCPUBITS], __cpuset_mask(n))
+
+#define CPU_SET_ATOMIC(n, p) \
+ atomic_set_long(&(p)->__bits[(n)/_NCPUBITS], __cpuset_mask(n))
+
+#define CPU_OR_ATOMIC(d, s) do { \
+ __size_t __i; \
+ for (__i = 0; __i < _NCPUWORDS; __i++) \
+ atomic_set_long(&(d)->__bits[__i], \
+ (s)->__bits[__i]); \
+} while (0)
+
+#define CPU_NAND_ATOMIC(d, s) do { \
+ __size_t __i; \
+ for (__i = 0; __i < _NCPUWORDS; __i++) \
+ atomic_clear_long(&(d)->__bits[__i], \
+ (s)->__bits[__i]); \
+} while (0)
+
+#define CPU_COPY_STORE_REL(f, t) do { \
+ __size_t __i; \
+ for (__i = 0; __i < _NCPUWORDS; __i++) \
+ atomic_store_rel_long(&(t)->__bits[__i], \
+ (f)->__bits[__i]); \
+} while (0)
+
/*
* Valid cpulevel_t values.
*/
@@ -184,6 +212,9 @@ void cpuset_rel(struct cpuset *);
int cpuset_setthread(lwpid_t id, cpuset_t *);
int cpuset_create_root(struct prison *, struct cpuset **);
int cpuset_setproc_update_set(struct proc *, struct cpuset *);
+int cpusetobj_ffs(const cpuset_t *);
+char *cpusetobj_strprint(char *, const cpuset_t *);
+int cpusetobj_strscan(cpuset_t *, const char *);
#else
__BEGIN_DECLS
diff --git a/sys/sys/disk.h b/sys/sys/disk.h
index ba25c89..112eed0 100644
--- a/sys/sys/disk.h
+++ b/sys/sys/disk.h
@@ -116,4 +116,12 @@ void disk_err(struct bio *bp, const char *what, int blkdone, int nl);
* This should be a multiple of the sector size.
*/
+#define DIOCGPHYSPATH _IOR('d', 141, char[MAXPATHLEN])
+ /*
+ * Get a string defining the physical path for a given provider.
+ * This has similar rules to ident, but is intended to uniquely
+ * identify the physical location of the device, not the current
+ * occupant of that location.
+ */
+
#endif /* _SYS_DISK_H_ */
diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h
index c20ca6c..66bda90 100644
--- a/sys/sys/diskpc98.h
+++ b/sys/sys/diskpc98.h
@@ -36,8 +36,11 @@
#include <sys/ioccom.h>
#define DOSBBSECTOR 0 /* DOS boot block relative sector number */
+#undef DOSPARTOFF
#define DOSPARTOFF 0
+#undef DOSPARTSIZE
#define DOSPARTSIZE 32
+#undef NDOSPART
#define NDOSPART 16
#define DOSMAGICOFFSET 510
#define DOSMAGIC 0xAA55
@@ -52,6 +55,7 @@
#define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE)
#define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE)
+#undef DOSPTYP_386BSD
#define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD)
struct pc98_partition {
diff --git a/sys/sys/dtrace_bsd.h b/sys/sys/dtrace_bsd.h
index 15e1be9..eb348b2 100644
--- a/sys/sys/dtrace_bsd.h
+++ b/sys/sys/dtrace_bsd.h
@@ -100,54 +100,73 @@ typedef void (*dtrace_malloc_probe_func_t)(u_int32_t, uintptr_t arg0,
extern dtrace_malloc_probe_func_t dtrace_malloc_probe;
-/* dtnfsclient NFSv3 access cache provider hooks. */
+/* dtnfsclient NFSv[34] access cache provider hooks. */
typedef void (*dtrace_nfsclient_accesscache_flush_probe_func_t)(uint32_t,
struct vnode *);
extern dtrace_nfsclient_accesscache_flush_probe_func_t
dtrace_nfsclient_accesscache_flush_done_probe;
+extern dtrace_nfsclient_accesscache_flush_probe_func_t
+ dtrace_nfscl_accesscache_flush_done_probe;
typedef void (*dtrace_nfsclient_accesscache_get_probe_func_t)(uint32_t,
struct vnode *, uid_t, uint32_t);
extern dtrace_nfsclient_accesscache_get_probe_func_t
dtrace_nfsclient_accesscache_get_hit_probe,
dtrace_nfsclient_accesscache_get_miss_probe;
+extern dtrace_nfsclient_accesscache_get_probe_func_t
+ dtrace_nfscl_accesscache_get_hit_probe,
+ dtrace_nfscl_accesscache_get_miss_probe;
typedef void (*dtrace_nfsclient_accesscache_load_probe_func_t)(uint32_t,
struct vnode *, uid_t, uint32_t, int);
extern dtrace_nfsclient_accesscache_load_probe_func_t
dtrace_nfsclient_accesscache_load_done_probe;
+extern dtrace_nfsclient_accesscache_load_probe_func_t
+ dtrace_nfscl_accesscache_load_done_probe;
-/* dtnfsclient NFSv[23] attribute cache provider hooks. */
+/* dtnfsclient NFSv[234] attribute cache provider hooks. */
typedef void (*dtrace_nfsclient_attrcache_flush_probe_func_t)(uint32_t,
struct vnode *);
extern dtrace_nfsclient_attrcache_flush_probe_func_t
dtrace_nfsclient_attrcache_flush_done_probe;
+extern dtrace_nfsclient_attrcache_flush_probe_func_t
+ dtrace_nfscl_attrcache_flush_done_probe;
typedef void (*dtrace_nfsclient_attrcache_get_hit_probe_func_t)(uint32_t,
struct vnode *, struct vattr *);
extern dtrace_nfsclient_attrcache_get_hit_probe_func_t
dtrace_nfsclient_attrcache_get_hit_probe;
+extern dtrace_nfsclient_attrcache_get_hit_probe_func_t
+ dtrace_nfscl_attrcache_get_hit_probe;
typedef void (*dtrace_nfsclient_attrcache_get_miss_probe_func_t)(uint32_t,
struct vnode *);
extern dtrace_nfsclient_attrcache_get_miss_probe_func_t
dtrace_nfsclient_attrcache_get_miss_probe;
+extern dtrace_nfsclient_attrcache_get_miss_probe_func_t
+ dtrace_nfscl_attrcache_get_miss_probe;
typedef void (*dtrace_nfsclient_attrcache_load_probe_func_t)(uint32_t,
struct vnode *, struct vattr *, int);
extern dtrace_nfsclient_attrcache_load_probe_func_t
dtrace_nfsclient_attrcache_load_done_probe;
+extern dtrace_nfsclient_attrcache_load_probe_func_t
+ dtrace_nfscl_attrcache_load_done_probe;
-/* dtnfsclient NFSv[23] RPC provider hooks. */
+/* dtnfsclient NFSv[234] RPC provider hooks. */
typedef void (*dtrace_nfsclient_nfs23_start_probe_func_t)(uint32_t,
struct vnode *, struct mbuf *, struct ucred *, int);
extern dtrace_nfsclient_nfs23_start_probe_func_t
dtrace_nfsclient_nfs23_start_probe;
+extern dtrace_nfsclient_nfs23_start_probe_func_t
+ dtrace_nfscl_nfs234_start_probe;
typedef void (*dtrace_nfsclient_nfs23_done_probe_func_t)(uint32_t,
struct vnode *, struct mbuf *, struct ucred *, int, int);
extern dtrace_nfsclient_nfs23_done_probe_func_t
dtrace_nfsclient_nfs23_done_probe;
+extern dtrace_nfsclient_nfs23_done_probe_func_t
+ dtrace_nfscl_nfs234_done_probe;
/*
* Functions which allow the dtrace module to check that the kernel
diff --git a/sys/sys/ktr.h b/sys/sys/ktr.h
index 3b78101..7885b22 100644
--- a/sys/sys/ktr.h
+++ b/sys/sys/ktr.h
@@ -97,6 +97,9 @@
#ifndef LOCORE
+#include <sys/param.h>
+#include <sys/_cpuset.h>
+
struct ktr_entry {
u_int64_t ktr_timestamp;
int ktr_cpu;
@@ -107,7 +110,7 @@ struct ktr_entry {
u_long ktr_parms[KTR_PARMS];
};
-extern int ktr_cpumask;
+extern cpuset_t ktr_cpumask;
extern int ktr_mask;
extern int ktr_entries;
extern int ktr_verbose;
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 654f145..c2b7081 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -199,7 +199,9 @@ struct mbuf {
#define M_PROTO6 0x00080000 /* protocol-specific */
#define M_PROTO7 0x00100000 /* protocol-specific */
#define M_PROTO8 0x00200000 /* protocol-specific */
-#define M_FLOWID 0x00400000 /* flowid is valid */
+#define M_FLOWID 0x00400000 /* deprecated: flowid is valid */
+#define M_HASHTYPEBITS 0x0F000000 /* mask of bits holding flowid hash type */
+
/*
* For RELENG_{6,7} steal these flags for limited multiple routing table
* support. In RELENG_8 and beyond, use just one flag and a tag.
@@ -215,11 +217,45 @@ struct mbuf {
(M_PROTO1|M_PROTO2|M_PROTO3|M_PROTO4|M_PROTO5|M_PROTO6|M_PROTO7|M_PROTO8)
/*
+ * Network interface cards are able to hash protocol fields (such as IPv4
+ * addresses and TCP port numbers) classify packets into flows. These flows
+ * can then be used to maintain ordering while delivering packets to the OS
+ * via parallel input queues, as well as to provide a stateless affinity
+ * model. NIC drivers can pass up the hash via m->m_pkthdr.flowid, and set
+ * m_flag fields to indicate how the hash should be interpreted by the
+ * network stack.
+ *
+ * Most NICs support RSS, which provides ordering and explicit affinity, and
+ * use the hash m_flag bits to indicate what header fields were covered by
+ * the hash. M_HASHTYPE_OPAQUE can be set by non-RSS cards or configurations
+ * that provide an opaque flow identifier, allowing for ordering and
+ * distribution without explicit affinity.
+ */
+#define M_HASHTYPE_SHIFT 24
+#define M_HASHTYPE_NONE 0x0
+#define M_HASHTYPE_RSS_IPV4 0x1 /* IPv4 2-tuple */
+#define M_HASHTYPE_RSS_TCP_IPV4 0x2 /* TCPv4 4-tuple */
+#define M_HASHTYPE_RSS_IPV6 0x3 /* IPv6 2-tuple */
+#define M_HASHTYPE_RSS_TCP_IPV6 0x4 /* TCPv6 4-tuple */
+#define M_HASHTYPE_RSS_IPV6_EX 0x5 /* IPv6 2-tuple + ext hdrs */
+#define M_HASHTYPE_RSS_TCP_IPV6_EX 0x6 /* TCPv6 4-tiple + ext hdrs */
+#define M_HASHTYPE_OPAQUE 0xf /* ordering, not affinity */
+
+#define M_HASHTYPE_CLEAR(m) (m)->m_flags &= ~(M_HASHTYPEBITS)
+#define M_HASHTYPE_GET(m) (((m)->m_flags & M_HASHTYPEBITS) >> \
+ M_HASHTYPE_SHIFT)
+#define M_HASHTYPE_SET(m, v) do { \
+ (m)->m_flags &= ~M_HASHTYPEBITS; \
+ (m)->m_flags |= ((v) << M_HASHTYPE_SHIFT); \
+} while (0)
+#define M_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v))
+
+/*
* Flags preserved when copying m_pkthdr.
*/
#define M_COPYFLAGS \
(M_PKTHDR|M_EOR|M_RDONLY|M_PROTOFLAGS|M_SKIP_FIREWALL|M_BCAST|M_MCAST|\
- M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_FIB)
+ M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_VLANTAG|M_PROMISC|M_FIB|M_HASHTYPEBITS)
/*
* External buffer types: identify ext_buf type.
diff --git a/sys/sys/msgbuf.h b/sys/sys/msgbuf.h
index 8435c68..67f80a5 100644
--- a/sys/sys/msgbuf.h
+++ b/sys/sys/msgbuf.h
@@ -33,15 +33,21 @@
#ifndef _SYS_MSGBUF_H_
#define _SYS_MSGBUF_H_
+#include <sys/lock.h>
+#include <sys/mutex.h>
+
struct msgbuf {
- char *msg_ptr; /* pointer to buffer */
+ char *msg_ptr; /* pointer to buffer */
#define MSG_MAGIC 0x063062
- u_int msg_magic;
- u_int msg_size; /* size of buffer area */
- u_int msg_wseq; /* write sequence number */
- u_int msg_rseq; /* read sequence number */
- u_int msg_cksum; /* checksum of contents */
- u_int msg_seqmod; /* range for sequence numbers */
+ u_int msg_magic;
+ u_int msg_size; /* size of buffer area */
+ u_int msg_wseq; /* write sequence number */
+ u_int msg_rseq; /* read sequence number */
+ u_int msg_cksum; /* checksum of contents */
+ u_int msg_seqmod; /* range for sequence numbers */
+ int msg_lastpri; /* saved priority value */
+ int msg_needsnl; /* set when newline needed */
+ struct mtx msg_lock; /* mutex to protect the buffer */
};
/* Normalise a sequence number or a difference between sequence numbers. */
@@ -59,6 +65,7 @@ extern struct mtx msgbuf_lock;
void msgbufinit(void *ptr, int size);
void msgbuf_addchar(struct msgbuf *mbp, int c);
+void msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr);
void msgbuf_clear(struct msgbuf *mbp);
void msgbuf_copy(struct msgbuf *src, struct msgbuf *dst);
int msgbuf_getbytes(struct msgbuf *mbp, char *buf, int buflen);
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 838769f..589a0f7 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -319,4 +319,10 @@ __END_DECLS
#define member2struct(s, m, x) \
((struct s *)(void *)((char *)(x) - offsetof(struct s, m)))
+/*
+ * Access a variable length array that has been declared as a fixed
+ * length array.
+ */
+#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+
#endif /* _SYS_PARAM_H_ */
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index ad1cf33..e6044a7 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -37,6 +37,7 @@
#error "no assembler-serviceable parts inside"
#endif
+#include <sys/_cpuset.h>
#include <sys/queue.h>
#include <sys/vmmeter.h>
#include <sys/resource.h>
@@ -162,9 +163,7 @@ struct pcpu {
uint64_t pc_switchtime; /* cpu_ticks() at last csw */
int pc_switchticks; /* `ticks' at last csw */
u_int pc_cpuid; /* This cpu number */
- cpumask_t pc_cpumask; /* This cpu mask */
- cpumask_t pc_other_cpus; /* Mask of all other cpus */
- SLIST_ENTRY(pcpu) pc_allcpu;
+ STAILQ_ENTRY(pcpu) pc_allcpu;
struct lock_list_entry *pc_spinlocks;
#ifdef KTR
char pc_name[PCPU_NAME_LEN]; /* String name for KTR */
@@ -197,11 +196,23 @@ struct pcpu {
* if only to make kernel debugging easier.
*/
PCPU_MD_FIELDS;
+
+ /*
+ * XXX
+ * For the time being, keep the cpuset_t objects as the very last
+ * members of the structure.
+ * They are actually tagged to be removed soon, but as long as this
+ * does not happen, it is necessary to find a way to implement
+ * easilly interfaces to userland and leaving them last makes that
+ * possible.
+ */
+ cpuset_t pc_cpumask; /* This cpu mask */
+ cpuset_t pc_other_cpus; /* Mask of all other cpus */
} __aligned(CACHE_LINE_SIZE);
#ifdef _KERNEL
-SLIST_HEAD(cpuhead, pcpu);
+STAILQ_HEAD(cpuhead, pcpu);
extern struct cpuhead cpuhead;
extern struct pcpu *cpuid_to_pcpu[MAXCPU];
diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h
index 3e8c1ef..796c4ca 100644
--- a/sys/sys/pmckern.h
+++ b/sys/sys/pmckern.h
@@ -76,7 +76,7 @@ extern int (*pmc_intr)(int _cpu, struct trapframe *_frame);
extern struct sx pmc_sx;
/* Per-cpu flags indicating availability of sampling data */
-extern volatile cpumask_t pmc_cpumask;
+extern volatile cpuset_t pmc_cpumask;
/* Count of system-wide sampling PMCs in existence */
extern volatile int pmc_ss_count;
@@ -122,7 +122,7 @@ do { \
#define PMC_SYSTEM_SAMPLING_ACTIVE() (pmc_ss_count > 0)
/* Check if a CPU has recorded samples. */
-#define PMC_CPU_HAS_SAMPLES(C) (__predict_false(pmc_cpumask & (1 << (C))))
+#define PMC_CPU_HAS_SAMPLES(C) (__predict_false(CPU_ISSET(C, &pmc_cpumask)))
/*
* Helper functions.
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 4d7b540..c54a956 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -503,6 +503,8 @@ struct proc {
/* The following fields are all zeroed upon creation in fork. */
#define p_startzero p_oppid
pid_t p_oppid; /* (c + e) Save ppid in ptrace. XXX */
+ int p_dbg_child; /* (c + e) # of debugged children in
+ ptrace. */
struct vmspace *p_vmspace; /* (b) Address space. */
u_int p_swtick; /* (c) Tick when swapped in or out. */
struct itimerval p_realtimer; /* (c) Alarm timer. */
diff --git a/sys/sys/racct.h b/sys/sys/racct.h
index cbd96a9..222dbce 100644
--- a/sys/sys/racct.h
+++ b/sys/sys/racct.h
@@ -49,27 +49,25 @@ struct ucred;
*/
#define RACCT_UNDEFINED -1
#define RACCT_CPU 0
-#define RACCT_FSIZE 1
-#define RACCT_DATA 2
-#define RACCT_STACK 3
-#define RACCT_CORE 4
-#define RACCT_RSS 5
-#define RACCT_MEMLOCK 6
-#define RACCT_NPROC 7
-#define RACCT_NOFILE 8
-#define RACCT_SBSIZE 9
-#define RACCT_VMEM 10
-#define RACCT_NPTS 11
-#define RACCT_SWAP 12
-#define RACCT_NTHR 13
-#define RACCT_MSGQQUEUED 14
-#define RACCT_MSGQSIZE 15
-#define RACCT_NMSGQ 16
-#define RACCT_NSEM 17
-#define RACCT_NSEMOP 18
-#define RACCT_NSHM 19
-#define RACCT_SHMSIZE 20
-#define RACCT_WALLCLOCK 21
+#define RACCT_DATA 1
+#define RACCT_STACK 2
+#define RACCT_CORE 3
+#define RACCT_RSS 4
+#define RACCT_MEMLOCK 5
+#define RACCT_NPROC 6
+#define RACCT_NOFILE 7
+#define RACCT_VMEM 8
+#define RACCT_NPTS 9
+#define RACCT_SWAP 10
+#define RACCT_NTHR 11
+#define RACCT_MSGQQUEUED 12
+#define RACCT_MSGQSIZE 13
+#define RACCT_NMSGQ 14
+#define RACCT_NSEM 15
+#define RACCT_NSEMOP 16
+#define RACCT_NSHM 17
+#define RACCT_SHMSIZE 18
+#define RACCT_WALLCLOCK 19
#define RACCT_MAX RACCT_WALLCLOCK
/*
diff --git a/sys/sys/smp.h b/sys/sys/smp.h
index f8cce5f..66e8008 100644
--- a/sys/sys/smp.h
+++ b/sys/sys/smp.h
@@ -16,6 +16,8 @@
#ifndef LOCORE
+#include <sys/cpuset.h>
+
/*
* Topology of a NUMA or HTT system.
*
@@ -32,7 +34,7 @@
struct cpu_group {
struct cpu_group *cg_parent; /* Our parent group. */
struct cpu_group *cg_child; /* Optional children groups. */
- cpumask_t cg_mask; /* Mask of cpus in this group. */
+ cpuset_t cg_mask; /* Mask of cpus in this group. */
int32_t cg_count; /* Count of cpus in this group. */
int16_t cg_children; /* Number of children groups. */
int8_t cg_level; /* Shared cache level. */
@@ -71,10 +73,10 @@ struct cpu_group *smp_topo_find(struct cpu_group *top, int cpu);
extern void (*cpustop_restartfunc)(void);
extern int smp_active;
extern int smp_cpus;
-extern volatile cpumask_t started_cpus;
-extern volatile cpumask_t stopped_cpus;
-extern cpumask_t hlt_cpus_mask;
-extern cpumask_t logical_cpus_mask;
+extern volatile cpuset_t started_cpus;
+extern volatile cpuset_t stopped_cpus;
+extern cpuset_t hlt_cpus_mask;
+extern cpuset_t logical_cpus_mask;
#endif /* SMP */
extern u_int mp_maxid;
@@ -82,14 +84,14 @@ extern int mp_maxcpus;
extern int mp_ncpus;
extern volatile int smp_started;
-extern cpumask_t all_cpus;
+extern cpuset_t all_cpus;
/*
* Macro allowing us to determine whether a CPU is absent at any given
* time, thus permitting us to configure sparse maps of cpuid-dependent
* (per-CPU) structures.
*/
-#define CPU_ABSENT(x_cpu) ((all_cpus & (1 << (x_cpu))) == 0)
+#define CPU_ABSENT(x_cpu) (!CPU_ISSET(x_cpu, &all_cpus))
/*
* Macros to iterate over non-absent CPUs. CPU_FOREACH() takes an
@@ -158,11 +160,11 @@ void cpu_mp_setmaxid(void);
void cpu_mp_start(void);
void forward_signal(struct thread *);
-int restart_cpus(cpumask_t);
-int stop_cpus(cpumask_t);
-int stop_cpus_hard(cpumask_t);
+int restart_cpus(cpuset_t);
+int stop_cpus(cpuset_t);
+int stop_cpus_hard(cpuset_t);
#if defined(__amd64__)
-int suspend_cpus(cpumask_t);
+int suspend_cpus(cpuset_t);
#endif
void smp_rendezvous_action(void);
extern struct mtx smp_ipi_mtx;
@@ -173,7 +175,7 @@ void smp_rendezvous(void (*)(void *),
void (*)(void *),
void (*)(void *),
void *arg);
-void smp_rendezvous_cpus(cpumask_t,
+void smp_rendezvous_cpus(cpuset_t,
void (*)(void *),
void (*)(void *),
void (*)(void *),
diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h
index c4cfc27..a6817df 100644
--- a/sys/sys/soundcard.h
+++ b/sys/sys/soundcard.h
@@ -311,7 +311,8 @@ typedef struct _snd_capabilities {
* IOCTL Commands for /dev/sequencer
*/
-#define SNDCTL_SEQ_RESET _IO ('Q', 0)
+#define SNDCTL_SEQ_HALT _IO ('Q', 0)
+#define SNDCTL_SEQ_RESET SNDCTL_SEQ_HALT /* Historic interface */
#define SNDCTL_SEQ_SYNC _IO ('Q', 1)
#define SNDCTL_SYNTH_INFO _IOWR('Q', 2, struct synth_info)
#define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) /* Set/get timer res.(hz) */
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 4bc1a8d..cb513af 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -99,7 +99,6 @@ typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
-typedef __cpumask_t cpumask_t;
typedef __critical_t critical_t; /* Critical section value */
typedef __int64_t daddr_t; /* disk address */
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index bfe94fb..40f9a6a 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -302,6 +302,7 @@ struct vattr {
#define IO_EXT 0x0400 /* operate on external attributes */
#define IO_NORMAL 0x0800 /* operate on regular data */
#define IO_NOMACCHECK 0x1000 /* MAC checks unnecessary */
+#define IO_BUFLOCKED 0x2000 /* ffs flag; indir buf is locked */
#define IO_SEQMAX 0x7F /* seq heuristic max value */
#define IO_SEQSHIFT 16 /* seq heuristic in upper 16 bits */
diff --git a/sys/teken/libteken/teken.3 b/sys/teken/libteken/teken.3
index bcc0db0..2a9b291 100644
--- a/sys/teken/libteken/teken.3
+++ b/sys/teken/libteken/teken.3
@@ -185,22 +185,6 @@ function switches terminal emulation to
which is used by versions of
.Fx
prior to 9.0.
-.Sh SECURITY CONSIDERATIONS
-The
-.Fn tf_respond
-callback is used to respond to device status requests commands generated
-by an application.
-In the past, there have been various security issues, where a malicious
-application sends a device status request before termination, causing
-the generated response to be interpreted by applications such as
-.Xr sh 1 .
-.Pp
-.Nm
-only implements a small subset of responses which are unlikely to cause
-any harm.
-Still, it is advised to leave
-.Fn tf_respond
-unimplemented.
.Sh SEE ALSO
.Xr ncurses 3 ,
.Xr termcap 3 ,
@@ -218,3 +202,19 @@ the
library appeared in userspace.
.Sh AUTHORS
.An Ed Schouten Aq ed@FreeBSD.org
+.Sh SECURITY CONSIDERATIONS
+The
+.Fn tf_respond
+callback is used to respond to device status requests commands generated
+by an application.
+In the past, there have been various security issues, where a malicious
+application sends a device status request before termination, causing
+the generated response to be interpreted by applications such as
+.Xr sh 1 .
+.Pp
+.Nm
+only implements a small subset of responses which are unlikely to cause
+any harm.
+Still, it is advised to leave
+.Fn tf_respond
+unimplemented.
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index e60514d..6d27ace 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -116,7 +116,6 @@ static ufs2_daddr_t ffs_clusteralloc(struct inode *, u_int, ufs2_daddr_t, int,
static ino_t ffs_dirpref(struct inode *);
static ufs2_daddr_t ffs_fragextend(struct inode *, u_int, ufs2_daddr_t,
int, int);
-static void ffs_fserr(struct fs *, ino_t, char *);
static ufs2_daddr_t ffs_hashalloc
(struct inode *, u_int, ufs2_daddr_t, int, int, allocfcn_t *);
static ufs2_daddr_t ffs_nodealloccg(struct inode *, u_int, ufs2_daddr_t, int,
@@ -217,13 +216,13 @@ nospace:
(void) chkdq(ip, -btodb(size), cred, FORCE);
UFS_LOCK(ump);
#endif
- if (reclaimed == 0) {
+ if (reclaimed == 0 && (flags & IO_BUFLOCKED) == 0) {
reclaimed = 1;
softdep_request_cleanup(fs, ITOV(ip), cred, FLUSH_BLOCKS_WAIT);
goto retry;
}
UFS_UNLOCK(ump);
- if (ppsratecheck(&lastfail, &curfail, 1)) {
+ if (reclaimed > 0 && ppsratecheck(&lastfail, &curfail, 1)) {
ffs_fserr(fs, ip->i_number, "filesystem full");
uprintf("\n%s: write failed, filesystem is full\n",
fs->fs_fsmnt);
@@ -391,7 +390,7 @@ retry:
bp->b_blkno = fsbtodb(fs, bno);
if (!DOINGSOFTDEP(vp))
ffs_blkfree(ump, fs, ip->i_devvp, bprev, (long)osize,
- ip->i_number, NULL);
+ ip->i_number, vp->v_type, NULL);
delta = btodb(nsize - osize);
DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta);
if (flags & IO_EXT)
@@ -418,21 +417,21 @@ nospace:
/*
* no space available
*/
- if (reclaimed == 0) {
+ if (reclaimed == 0 && (flags & IO_BUFLOCKED) == 0) {
reclaimed = 1;
- softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT);
UFS_UNLOCK(ump);
if (bp) {
brelse(bp);
bp = NULL;
}
UFS_LOCK(ump);
+ softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT);
goto retry;
}
UFS_UNLOCK(ump);
if (bp)
brelse(bp);
- if (ppsratecheck(&lastfail, &curfail, 1)) {
+ if (reclaimed > 0 && ppsratecheck(&lastfail, &curfail, 1)) {
ffs_fserr(fs, ip->i_number, "filesystem full");
uprintf("\n%s: write failed, filesystem is full\n",
fs->fs_fsmnt);
@@ -671,7 +670,7 @@ ffs_reallocblks_ufs1(ap)
if (!DOINGSOFTDEP(vp))
ffs_blkfree(ump, fs, ip->i_devvp,
dbtofsb(fs, buflist->bs_children[i]->b_blkno),
- fs->fs_bsize, ip->i_number, NULL);
+ fs->fs_bsize, ip->i_number, vp->v_type, NULL);
buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
#ifdef INVARIANTS
if (!ffs_checkblk(ip,
@@ -879,7 +878,7 @@ ffs_reallocblks_ufs2(ap)
if (!DOINGSOFTDEP(vp))
ffs_blkfree(ump, fs, ip->i_devvp,
dbtofsb(fs, buflist->bs_children[i]->b_blkno),
- fs->fs_bsize, ip->i_number, NULL);
+ fs->fs_bsize, ip->i_number, vp->v_type, NULL);
buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
#ifdef INVARIANTS
if (!ffs_checkblk(ip,
@@ -1022,7 +1021,7 @@ dup_alloc:
(*vpp)->v_op = &ffs_vnodeops1;
return (0);
noinodes:
- if (fs->fs_pendinginodes > 0 && reclaimed == 0) {
+ if (reclaimed == 0) {
reclaimed = 1;
softdep_request_cleanup(fs, pvp, cred, FLUSH_INODES_WAIT);
goto retry;
@@ -1830,7 +1829,7 @@ gotit:
}
UFS_UNLOCK(ump);
if (DOINGSOFTDEP(ITOV(ip)))
- softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref);
+ softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref, mode);
bdwrite(bp);
if (ibp != NULL)
bawrite(ibp);
@@ -1873,10 +1872,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd)
/* devvp is a normal disk device */
dev = devvp->v_rdev;
cgblkno = fsbtodb(fs, cgtod(fs, cg));
- ASSERT_VOP_LOCKED(devvp, "ffs_blkfree");
- if ((devvp->v_vflag & VV_COPYONWRITE) &&
- ffs_snapblkfree(fs, devvp, bno, size, inum))
- return;
+ ASSERT_VOP_LOCKED(devvp, "ffs_blkfree_cg");
}
#ifdef INVARIANTS
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0 ||
@@ -1884,7 +1880,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd)
printf("dev=%s, bno = %jd, bsize = %ld, size = %ld, fs = %s\n",
devtoname(dev), (intmax_t)bno, (long)fs->fs_bsize,
size, fs->fs_fsmnt);
- panic("ffs_blkfree: bad size");
+ panic("ffs_blkfree_cg: bad size");
}
#endif
if ((u_int)bno >= fs->fs_size) {
@@ -1918,7 +1914,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd)
}
printf("dev = %s, block = %jd, fs = %s\n",
devtoname(dev), (intmax_t)bno, fs->fs_fsmnt);
- panic("ffs_blkfree: freeing free block");
+ panic("ffs_blkfree_cg: freeing free block");
}
ffs_setblock(fs, blksfree, fragno);
ffs_clusteracct(fs, cgp, fragno, 1);
@@ -1941,7 +1937,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd)
printf("dev = %s, block = %jd, fs = %s\n",
devtoname(dev), (intmax_t)(bno + i),
fs->fs_fsmnt);
- panic("ffs_blkfree: freeing free frag");
+ panic("ffs_blkfree_cg: freeing free frag");
}
setbit(blksfree, cgbno + i);
}
@@ -2017,19 +2013,31 @@ ffs_blkfree_trim_completed(bip)
}
void
-ffs_blkfree(ump, fs, devvp, bno, size, inum, dephd)
+ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd)
struct ufsmount *ump;
struct fs *fs;
struct vnode *devvp;
ufs2_daddr_t bno;
long size;
ino_t inum;
+ enum vtype vtype;
struct workhead *dephd;
{
struct mount *mp;
struct bio *bip;
struct ffs_blkfree_trim_params *tp;
+ /*
+ * Check to see if a snapshot wants to claim the block.
+ * Check that devvp is a normal disk device, not a snapshot,
+ * it has a snapshot(s) associated with it, and one of the
+ * snapshots wants to claim the block.
+ */
+ if (devvp->v_type != VREG &&
+ (devvp->v_vflag & VV_COPYONWRITE) &&
+ ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, dephd)) {
+ return;
+ }
if (!ump->um_candelete) {
ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd);
return;
@@ -2327,7 +2335,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz)
* The form of the error message is:
* fs: error message
*/
-static void
+void
ffs_fserr(fs, inum, cp)
struct fs *fs;
ino_t inum;
@@ -2348,8 +2356,8 @@ ffs_fserr(fs, inum, cp)
* specified inode by the specified amount. Under normal
* operation the count should always go down. Decrementing
* the count to zero will cause the inode to be freed.
- * adjblkcnt(inode, amt) - adjust the number of blocks used to
- * by the specifed amount.
+ * adjblkcnt(inode, amt) - adjust the number of blocks used by the
+ * inode by the specified amount.
* adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) -
* adjust the superblock summary.
* freedirs(inode, count) - directory inodes [inode..inode + count - 1]
@@ -2564,7 +2572,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS)
if (blksize > blkcnt)
blksize = blkcnt;
ffs_blkfree(ump, fs, ump->um_devvp, blkno,
- blksize * fs->fs_fsize, ROOTINO, NULL);
+ blksize * fs->fs_fsize, ROOTINO, VDIR, NULL);
blkno += blksize;
blkcnt -= blksize;
blksize = fs->fs_frag;
diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c
index 6d5f27c..63a4eba 100644
--- a/sys/ufs/ffs/ffs_balloc.c
+++ b/sys/ufs/ffs/ffs_balloc.c
@@ -105,6 +105,9 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
ufs2_daddr_t *lbns_remfree, lbns[NIADDR + 1];
int unwindidx = -1;
int saved_inbdflush;
+ static struct timeval lastfail;
+ static int curfail;
+ int reclaimed;
ip = VTOI(vp);
dp = ip->i_din1;
@@ -112,6 +115,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
ump = ip->i_ump;
lbn = lblkno(fs, startoffset);
size = blkoff(fs, startoffset) + size;
+ reclaimed = 0;
if (size > fs->fs_bsize)
panic("ffs_balloc_ufs1: blk too big");
*bpp = NULL;
@@ -276,6 +280,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
/*
* Fetch through the indirect blocks, allocating as necessary.
*/
+retry:
for (i = 1;;) {
error = bread(vp,
indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp);
@@ -296,8 +301,20 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
if (pref == 0)
pref = ffs_blkpref_ufs1(ip, lbn, 0, (ufs1_daddr_t *)0);
if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
- flags, cred, &newb)) != 0) {
+ flags | IO_BUFLOCKED, cred, &newb)) != 0) {
brelse(bp);
+ if (++reclaimed == 1) {
+ UFS_LOCK(ump);
+ softdep_request_cleanup(fs, vp, cred,
+ FLUSH_BLOCKS_WAIT);
+ UFS_UNLOCK(ump);
+ goto retry;
+ }
+ if (ppsratecheck(&lastfail, &curfail, 1)) {
+ ffs_fserr(fs, ip->i_number, "filesystem full");
+ uprintf("\n%s: write failed, filesystem "
+ "is full\n", fs->fs_fsmnt);
+ }
goto fail;
}
nb = newb;
@@ -349,10 +366,22 @@ ffs_balloc_ufs1(struct vnode *vp, off_t startoffset, int size,
if (nb == 0) {
UFS_LOCK(ump);
pref = ffs_blkpref_ufs1(ip, lbn, indirs[i].in_off, &bap[0]);
- error = ffs_alloc(ip,
- lbn, pref, (int)fs->fs_bsize, flags, cred, &newb);
+ error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
+ flags | IO_BUFLOCKED, cred, &newb);
if (error) {
brelse(bp);
+ if (++reclaimed == 1) {
+ UFS_LOCK(ump);
+ softdep_request_cleanup(fs, vp, cred,
+ FLUSH_BLOCKS_WAIT);
+ UFS_UNLOCK(ump);
+ goto retry;
+ }
+ if (ppsratecheck(&lastfail, &curfail, 1)) {
+ ffs_fserr(fs, ip->i_number, "filesystem full");
+ uprintf("\n%s: write failed, filesystem "
+ "is full\n", fs->fs_fsmnt);
+ }
goto fail;
}
nb = newb;
@@ -477,7 +506,7 @@ fail:
*/
for (blkp = allociblk; blkp < allocblk; blkp++) {
ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize,
- ip->i_number, NULL);
+ ip->i_number, vp->v_type, NULL);
}
return (error);
}
@@ -506,6 +535,9 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
int deallocated, osize, nsize, num, i, error;
int unwindidx = -1;
int saved_inbdflush;
+ static struct timeval lastfail;
+ static int curfail;
+ int reclaimed;
ip = VTOI(vp);
dp = ip->i_din2;
@@ -513,6 +545,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
ump = ip->i_ump;
lbn = lblkno(fs, startoffset);
size = blkoff(fs, startoffset) + size;
+ reclaimed = 0;
if (size > fs->fs_bsize)
panic("ffs_balloc_ufs2: blk too big");
*bpp = NULL;
@@ -787,6 +820,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
/*
* Fetch through the indirect blocks, allocating as necessary.
*/
+retry:
for (i = 1;;) {
error = bread(vp,
indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp);
@@ -807,8 +841,20 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
if (pref == 0)
pref = ffs_blkpref_ufs2(ip, lbn, 0, (ufs2_daddr_t *)0);
if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
- flags, cred, &newb)) != 0) {
+ flags | IO_BUFLOCKED, cred, &newb)) != 0) {
brelse(bp);
+ if (++reclaimed == 1) {
+ UFS_LOCK(ump);
+ softdep_request_cleanup(fs, vp, cred,
+ FLUSH_BLOCKS_WAIT);
+ UFS_UNLOCK(ump);
+ goto retry;
+ }
+ if (ppsratecheck(&lastfail, &curfail, 1)) {
+ ffs_fserr(fs, ip->i_number, "filesystem full");
+ uprintf("\n%s: write failed, filesystem "
+ "is full\n", fs->fs_fsmnt);
+ }
goto fail;
}
nb = newb;
@@ -860,10 +906,22 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
if (nb == 0) {
UFS_LOCK(ump);
pref = ffs_blkpref_ufs2(ip, lbn, indirs[i].in_off, &bap[0]);
- error = ffs_alloc(ip,
- lbn, pref, (int)fs->fs_bsize, flags, cred, &newb);
+ error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
+ flags | IO_BUFLOCKED, cred, &newb);
if (error) {
brelse(bp);
+ if (++reclaimed == 1) {
+ UFS_LOCK(ump);
+ softdep_request_cleanup(fs, vp, cred,
+ FLUSH_BLOCKS_WAIT);
+ UFS_UNLOCK(ump);
+ goto retry;
+ }
+ if (ppsratecheck(&lastfail, &curfail, 1)) {
+ ffs_fserr(fs, ip->i_number, "filesystem full");
+ uprintf("\n%s: write failed, filesystem "
+ "is full\n", fs->fs_fsmnt);
+ }
goto fail;
}
nb = newb;
@@ -994,7 +1052,7 @@ fail:
*/
for (blkp = allociblk; blkp < allocblk; blkp++) {
ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize,
- ip->i_number, NULL);
+ ip->i_number, vp->v_type, NULL);
}
return (error);
}
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index d819c8a..70bcf1d 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -33,6 +33,10 @@
#ifndef _UFS_FFS_EXTERN_H
#define _UFS_FFS_EXTERN_H
+#ifndef _KERNEL
+#error "No user-serving parts inside"
+#else
+
struct buf;
struct cg;
struct fid;
@@ -57,7 +61,7 @@ int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_startoffset, int a_size,
struct ucred *a_cred, int a_flags, struct buf **a_bpp);
int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **);
void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *,
- ufs2_daddr_t, long, ino_t, struct workhead *);
+ ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *);
ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *);
ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *);
int ffs_checkfreefile(struct fs *, struct vnode *, ino_t);
@@ -69,22 +73,26 @@ int ffs_flushfiles(struct mount *, int, struct thread *);
void ffs_fragacct(struct fs *, int, int32_t [], int);
int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t,
int, struct workhead *);
+void ffs_fserr(struct fs *, ino_t, char *);
int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t);
int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t);
void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t);
int ffs_mountroot(void);
void ffs_oldfscompat_write(struct fs *, struct ufsmount *);
+void ffs_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end);
int ffs_reallocblks(struct vop_reallocblks_args *);
int ffs_realloccg(struct inode *, ufs2_daddr_t, ufs2_daddr_t,
ufs2_daddr_t, int, int, int, struct ucred *, struct buf **);
int ffs_sbupdate(struct ufsmount *, int, int);
void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t);
-int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t);
+int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t,
+ enum vtype, struct workhead *);
void ffs_snapremove(struct vnode *vp);
int ffs_snapshot(struct mount *mp, char *snapfile);
void ffs_snapshot_mount(struct mount *mp);
void ffs_snapshot_unmount(struct mount *mp);
void process_deferred_inactive(struct mount *mp);
+void ffs_sync_snap(struct mount *, int);
int ffs_syncvnode(struct vnode *vp, int waitfor);
int ffs_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *);
int ffs_update(struct vnode *, int);
@@ -107,7 +115,6 @@ extern struct vop_vector ffs_fifoops2;
int softdep_check_suspend(struct mount *, struct vnode *,
int, int, int, int);
-int softdep_complete_trunc(struct vnode *, void *);
void softdep_get_depcounts(struct mount *, int *, int *);
void softdep_initialize(void);
void softdep_uninitialize(void);
@@ -123,7 +130,7 @@ void softdep_freefile(struct vnode *, ino_t, int);
int softdep_request_cleanup(struct fs *, struct vnode *,
struct ucred *, int);
void softdep_setup_freeblocks(struct inode *, off_t, int);
-void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t);
+void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t, int);
void softdep_setup_blkmapdep(struct buf *, struct mount *, ufs2_daddr_t,
int, int);
void softdep_setup_allocdirect(struct inode *, ufs_lbn_t, ufs2_daddr_t,
@@ -139,14 +146,20 @@ void softdep_setup_blkfree(struct mount *, struct buf *, ufs2_daddr_t, int,
void softdep_setup_inofree(struct mount *, struct buf *, ino_t,
struct workhead *);
void softdep_setup_sbupdate(struct ufsmount *, struct fs *, struct buf *);
-void *softdep_setup_trunc(struct vnode *vp, off_t length, int flags);
void softdep_fsync_mountdev(struct vnode *);
int softdep_sync_metadata(struct vnode *);
+int softdep_sync_buf(struct vnode *, struct buf *, int);
int softdep_process_worklist(struct mount *, int);
int softdep_fsync(struct vnode *);
int softdep_waitidle(struct mount *);
int softdep_prealloc(struct vnode *, int);
int softdep_journal_lookup(struct mount *, struct vnode **);
+void softdep_journal_freeblocks(struct inode *, struct ucred *, off_t, int);
+void softdep_journal_fsync(struct inode *);
+void softdep_buf_append(struct buf *, struct workhead *);
+void softdep_inode_append(struct inode *, struct ucred *, struct workhead *);
+void softdep_freework(struct workhead *);
+
/*
* Things to request flushing in softdep_request_cleanup()
@@ -158,4 +171,16 @@ int softdep_journal_lookup(struct mount *, struct vnode **);
int ffs_rdonly(struct inode *);
+TAILQ_HEAD(snaphead, inode);
+
+struct snapdata {
+ LIST_ENTRY(snapdata) sn_link;
+ struct snaphead sn_head;
+ daddr_t sn_listsize;
+ daddr_t *sn_blklist;
+ struct lock sn_lock;
+};
+
+#endif /* _KERNEL */
+
#endif /* !_UFS_FFS_EXTERN_H */
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index ba2813d..a7b43e2 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -120,7 +120,7 @@ ffs_update(vp, waitfor)
}
}
-static void
+void
ffs_pages_remove(struct vnode *vp, vm_pindex_t start, vm_pindex_t end)
{
vm_object_t object;
@@ -151,12 +151,12 @@ ffs_truncate(vp, length, flags, cred, td)
ufs2_daddr_t bn, lbn, lastblock, lastiblock[NIADDR], indir_lbn[NIADDR];
ufs2_daddr_t oldblks[NDADDR + NIADDR], newblks[NDADDR + NIADDR];
ufs2_daddr_t count, blocksreleased = 0, datablocks;
- void *cookie;
struct bufobj *bo;
struct fs *fs;
struct buf *bp;
struct ufsmount *ump;
- int needextclean, softdepslowdown, extblocks;
+ int softdeptrunc, journaltrunc;
+ int needextclean, extblocks;
int offset, size, level, nblocks;
int i, error, allerror;
off_t osize;
@@ -165,7 +165,6 @@ ffs_truncate(vp, length, flags, cred, td)
fs = ip->i_fs;
ump = ip->i_ump;
bo = &vp->v_bufobj;
- cookie = NULL;
ASSERT_VOP_LOCKED(vp, "ffs_truncate");
@@ -173,6 +172,11 @@ ffs_truncate(vp, length, flags, cred, td)
return (EINVAL);
if (length > fs->fs_maxfilesize)
return (EFBIG);
+#ifdef QUOTA
+ error = getinoquota(ip);
+ if (error)
+ return (error);
+#endif
/*
* Historically clients did not have to specify which data
* they were truncating. So, if not specified, we assume
@@ -191,7 +195,10 @@ ffs_truncate(vp, length, flags, cred, td)
*/
allerror = 0;
needextclean = 0;
- softdepslowdown = DOINGSOFTDEP(vp) && softdep_slowdown(vp);
+ softdeptrunc = 0;
+ journaltrunc = DOINGSUJ(vp);
+ if (journaltrunc == 0 && DOINGSOFTDEP(vp) && length == 0)
+ softdeptrunc = !softdep_slowdown(vp);
extblocks = 0;
datablocks = DIP(ip, i_blocks);
if (fs->fs_magic == FS_UFS2_MAGIC && ip->i_din2->di_extsize > 0) {
@@ -199,27 +206,23 @@ ffs_truncate(vp, length, flags, cred, td)
datablocks -= extblocks;
}
if ((flags & IO_EXT) && extblocks > 0) {
- if (DOINGSOFTDEP(vp) && softdepslowdown == 0 && length == 0) {
- if ((flags & IO_NORMAL) == 0) {
- softdep_setup_freeblocks(ip, length, IO_EXT);
- return (0);
- }
+ if (length != 0)
+ panic("ffs_truncate: partial trunc of extdata");
+ if (softdeptrunc || journaltrunc) {
+ if ((flags & IO_NORMAL) == 0)
+ goto extclean;
needextclean = 1;
} else {
- if (length != 0)
- panic("ffs_truncate: partial trunc of extdata");
if ((error = ffs_syncvnode(vp, MNT_WAIT)) != 0)
return (error);
- if (DOINGSUJ(vp))
- cookie = softdep_setup_trunc(vp, length, flags);
- osize = ip->i_din2->di_extsize;
- ip->i_din2->di_blocks -= extblocks;
#ifdef QUOTA
(void) chkdq(ip, -extblocks, NOCRED, 0);
#endif
vinvalbuf(vp, V_ALT, 0, 0);
ffs_pages_remove(vp,
OFF_TO_IDX(lblktosize(fs, -extblocks)), 0);
+ osize = ip->i_din2->di_extsize;
+ ip->i_din2->di_blocks -= extblocks;
ip->i_din2->di_extsize = 0;
for (i = 0; i < NXADDR; i++) {
oldblks[i] = ip->i_din2->di_extb[i];
@@ -227,19 +230,18 @@ ffs_truncate(vp, length, flags, cred, td)
}
ip->i_flag |= IN_CHANGE;
if ((error = ffs_update(vp, 1)))
- goto out;
+ return (error);
for (i = 0; i < NXADDR; i++) {
if (oldblks[i] == 0)
continue;
ffs_blkfree(ump, fs, ip->i_devvp, oldblks[i],
- sblksize(fs, osize, i), ip->i_number, NULL);
+ sblksize(fs, osize, i), ip->i_number,
+ vp->v_type, NULL);
}
}
}
- if ((flags & IO_NORMAL) == 0) {
- error = 0;
- goto out;
- }
+ if ((flags & IO_NORMAL) == 0)
+ return (0);
if (vp->v_type == VLNK &&
(ip->i_size < vp->v_mount->mnt_maxsymlinklen ||
datablocks == 0)) {
@@ -252,24 +254,17 @@ ffs_truncate(vp, length, flags, cred, td)
DIP_SET(ip, i_size, 0);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
if (needextclean)
- softdep_setup_freeblocks(ip, length, IO_EXT);
- error = ffs_update(vp, 1);
- goto out;
+ goto extclean;
+ return ffs_update(vp, 1);
}
if (ip->i_size == length) {
ip->i_flag |= IN_CHANGE | IN_UPDATE;
if (needextclean)
- softdep_setup_freeblocks(ip, length, IO_EXT);
- error = ffs_update(vp, 0);
- goto out;
+ goto extclean;
+ return ffs_update(vp, 0);
}
if (fs->fs_ronly)
panic("ffs_truncate: read-only filesystem");
-#ifdef QUOTA
- error = getinoquota(ip);
- if (error)
- goto out;
-#endif
if ((ip->i_flags & SF_SNAPSHOT) != 0)
ffs_snapremove(vp);
vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0;
@@ -285,7 +280,7 @@ ffs_truncate(vp, length, flags, cred, td)
error = UFS_BALLOC(vp, length - 1, 1, cred, flags, &bp);
if (error) {
vnode_pager_setsize(vp, osize);
- goto out;
+ return (error);
}
ip->i_size = length;
DIP_SET(ip, i_size, length);
@@ -296,11 +291,10 @@ ffs_truncate(vp, length, flags, cred, td)
else
bawrite(bp);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- error = ffs_update(vp, 1);
- goto out;
+ return ffs_update(vp, 1);
}
if (DOINGSOFTDEP(vp)) {
- if (length > 0 || softdepslowdown) {
+ if (softdeptrunc == 0 && journaltrunc == 0) {
/*
* If a file is only partially truncated, then
* we have to clean up the data structures
@@ -311,29 +305,20 @@ ffs_truncate(vp, length, flags, cred, td)
* so that it will have no data structures left.
*/
if ((error = ffs_syncvnode(vp, MNT_WAIT)) != 0)
- goto out;
- /*
- * We have to journal the truncation before we change
- * any blocks so we don't leave the file partially
- * truncated.
- */
- if (DOINGSUJ(vp) && cookie == NULL)
- cookie = softdep_setup_trunc(vp, length, flags);
+ return (error);
} else {
-#ifdef QUOTA
- (void) chkdq(ip, -datablocks, NOCRED, 0);
-#endif
- softdep_setup_freeblocks(ip, length, needextclean ?
- IO_EXT | IO_NORMAL : IO_NORMAL);
+ flags = IO_NORMAL | (needextclean ? IO_EXT: 0);
+ if (journaltrunc)
+ softdep_journal_freeblocks(ip, cred, length,
+ flags);
+ else
+ softdep_setup_freeblocks(ip, length, flags);
ASSERT_VOP_LOCKED(vp, "ffs_truncate1");
- vinvalbuf(vp, needextclean ? 0 : V_NORMAL, 0, 0);
- if (!needextclean)
- ffs_pages_remove(vp, 0,
- OFF_TO_IDX(lblktosize(fs, -extblocks)));
- vnode_pager_setsize(vp, 0);
- ip->i_flag |= IN_CHANGE | IN_UPDATE;
- error = ffs_update(vp, 0);
- goto out;
+ if (journaltrunc == 0) {
+ ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ error = ffs_update(vp, 0);
+ }
+ return (error);
}
}
/*
@@ -353,7 +338,7 @@ ffs_truncate(vp, length, flags, cred, td)
flags |= BA_CLRBUF;
error = UFS_BALLOC(vp, length - 1, 1, cred, flags, &bp);
if (error)
- goto out;
+ return (error);
/*
* When we are doing soft updates and the UFS_BALLOC
* above fills in a direct block hole with a full sized
@@ -365,7 +350,7 @@ ffs_truncate(vp, length, flags, cred, td)
if (DOINGSOFTDEP(vp) && lbn < NDADDR &&
fragroundup(fs, blkoff(fs, length)) < fs->fs_bsize &&
(error = ffs_syncvnode(vp, MNT_WAIT)) != 0)
- goto out;
+ return (error);
ip->i_size = length;
DIP_SET(ip, i_size, length);
size = blksize(fs, ip, lbn);
@@ -411,13 +396,7 @@ ffs_truncate(vp, length, flags, cred, td)
DIP_SET(ip, i_db[i], 0);
}
ip->i_flag |= IN_CHANGE | IN_UPDATE;
- /*
- * When doing softupdate journaling we must preserve the size along
- * with the old pointers until they are freed or we might not
- * know how many fragments remain.
- */
- if (!DOINGSUJ(vp))
- allerror = ffs_update(vp, 1);
+ allerror = ffs_update(vp, 1);
/*
* Having written the new inode to disk, save its new configuration
@@ -457,7 +436,8 @@ ffs_truncate(vp, length, flags, cred, td)
if (lastiblock[level] < 0) {
DIP_SET(ip, i_ib[level], 0);
ffs_blkfree(ump, fs, ip->i_devvp, bn,
- fs->fs_bsize, ip->i_number, NULL);
+ fs->fs_bsize, ip->i_number,
+ vp->v_type, NULL);
blocksreleased += nblocks;
}
}
@@ -477,7 +457,7 @@ ffs_truncate(vp, length, flags, cred, td)
DIP_SET(ip, i_db[i], 0);
bsize = blksize(fs, ip, i);
ffs_blkfree(ump, fs, ip->i_devvp, bn, bsize, ip->i_number,
- NULL);
+ vp->v_type, NULL);
blocksreleased += btodb(bsize);
}
if (lastblock < 0)
@@ -509,7 +489,7 @@ ffs_truncate(vp, length, flags, cred, td)
*/
bn += numfrags(fs, newspace);
ffs_blkfree(ump, fs, ip->i_devvp, bn,
- oldspace - newspace, ip->i_number, NULL);
+ oldspace - newspace, ip->i_number, vp->v_type, NULL);
blocksreleased += btodb(oldspace - newspace);
}
}
@@ -541,14 +521,14 @@ done:
#ifdef QUOTA
(void) chkdq(ip, -blocksreleased, NOCRED, 0);
#endif
- error = allerror;
-out:
- if (cookie) {
- allerror = softdep_complete_trunc(vp, cookie);
- if (allerror != 0 && error == 0)
- error = allerror;
- }
- return (error);
+ return (allerror);
+
+extclean:
+ if (journaltrunc)
+ softdep_journal_freeblocks(ip, cred, length, IO_EXT);
+ else
+ softdep_setup_freeblocks(ip, length, IO_EXT);
+ return ffs_update(vp, MNT_WAIT);
}
/*
@@ -656,7 +636,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp)
blocksreleased += blkcount;
}
ffs_blkfree(ip->i_ump, fs, ip->i_devvp, nb, fs->fs_bsize,
- ip->i_number, NULL);
+ ip->i_number, vp->v_type, NULL);
blocksreleased += nblocks;
}
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index 968be8a..c8dd4c6 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -81,12 +81,14 @@ ffs_snapshot(mp, snapfile)
}
int
-ffs_snapblkfree(fs, devvp, bno, size, inum)
+ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, wkhd)
struct fs *fs;
struct vnode *devvp;
ufs2_daddr_t bno;
long size;
ino_t inum;
+ enum vtype vtype;
+ struct workhead *wkhd;
{
return (EINVAL);
}
@@ -123,19 +125,16 @@ ffs_copyonwrite(devvp, bp)
return (EINVAL);
}
+void
+ffs_sync_snap(mp, waitfor)
+ struct mount *mp;
+ int waitfor;
+{
+}
+
#else
FEATURE(ffs_snapshot, "FFS snapshot support");
-TAILQ_HEAD(snaphead, inode);
-
-struct snapdata {
- LIST_ENTRY(snapdata) sn_link;
- struct snaphead sn_head;
- daddr_t sn_listsize;
- daddr_t *sn_blklist;
- struct lock sn_lock;
-};
-
LIST_HEAD(, snapdata) snapfree;
static struct mtx snapfree_lock;
MTX_SYSINIT(ffs_snapfree, &snapfree_lock, "snapdata free list", MTX_DEF);
@@ -176,8 +175,10 @@ static int ffs_bp_snapblk(struct vnode *, struct buf *);
* To ensure the consistency of snapshots across crashes, we must
* synchronously write out copied blocks before allowing the
* originals to be modified. Because of the rather severe speed
- * penalty that this imposes, the following flag allows this
- * crash persistence to be disabled.
+ * penalty that this imposes, the code normally only ensures
+ * persistence for the filesystem metadata contained within a
+ * snapshot. Setting the following flag allows this crash
+ * persistence to be enabled for file contents.
*/
int dopersistence = 0;
@@ -584,7 +585,7 @@ loop:
if (len != 0 && len < fs->fs_bsize) {
ffs_blkfree(ump, copy_fs, vp,
DIP(xp, i_db[loc]), len, xp->i_number,
- NULL);
+ xvp->v_type, NULL);
blkno = DIP(xp, i_db[loc]);
DIP_SET(xp, i_db[loc], 0);
}
@@ -1247,7 +1248,8 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
*ip->i_snapblklist++ = lblkno;
if (blkno == BLK_SNAP)
blkno = blkstofrags(fs, lblkno);
- ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, NULL);
+ ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum,
+ vp->v_type, NULL);
}
return (0);
}
@@ -1530,7 +1532,8 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
*ip->i_snapblklist++ = lblkno;
if (blkno == BLK_SNAP)
blkno = blkstofrags(fs, lblkno);
- ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, NULL);
+ ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum,
+ vp->v_type, NULL);
}
return (0);
}
@@ -1635,7 +1638,7 @@ ffs_snapremove(vp)
DIP_SET(ip, i_db[blkno], 0);
else if ((dblk == blkstofrags(fs, blkno) &&
ffs_snapblkfree(fs, ip->i_devvp, dblk, fs->fs_bsize,
- ip->i_number))) {
+ ip->i_number, vp->v_type, NULL))) {
DIP_SET(ip, i_blocks, DIP(ip, i_blocks) -
btodb(fs->fs_bsize));
DIP_SET(ip, i_db[blkno], 0);
@@ -1660,7 +1663,8 @@ ffs_snapremove(vp)
((ufs1_daddr_t *)(ibp->b_data))[loc]= 0;
else if ((dblk == blkstofrags(fs, blkno) &&
ffs_snapblkfree(fs, ip->i_devvp, dblk,
- fs->fs_bsize, ip->i_number))) {
+ fs->fs_bsize, ip->i_number, vp->v_type,
+ NULL))) {
ip->i_din1->di_blocks -=
btodb(fs->fs_bsize);
((ufs1_daddr_t *)(ibp->b_data))[loc]= 0;
@@ -1674,7 +1678,7 @@ ffs_snapremove(vp)
((ufs2_daddr_t *)(ibp->b_data))[loc] = 0;
else if ((dblk == blkstofrags(fs, blkno) &&
ffs_snapblkfree(fs, ip->i_devvp, dblk,
- fs->fs_bsize, ip->i_number))) {
+ fs->fs_bsize, ip->i_number, vp->v_type, NULL))) {
ip->i_din2->di_blocks -= btodb(fs->fs_bsize);
((ufs2_daddr_t *)(ibp->b_data))[loc] = 0;
}
@@ -1722,12 +1726,14 @@ ffs_snapremove(vp)
* must always have been allocated from a BLK_NOCOPY location.
*/
int
-ffs_snapblkfree(fs, devvp, bno, size, inum)
+ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, wkhd)
struct fs *fs;
struct vnode *devvp;
ufs2_daddr_t bno;
long size;
ino_t inum;
+ enum vtype vtype;
+ struct workhead *wkhd;
{
struct buf *ibp, *cbp, *savedcbp = 0;
struct thread *td = curthread;
@@ -1825,6 +1831,17 @@ retry:
"Grabonremove: snapino", ip->i_number,
(intmax_t)lbn, inum);
#endif
+ /*
+ * If journaling is tracking this write we must add
+ * the work to the inode or indirect being written.
+ */
+ if (wkhd != NULL) {
+ if (lbn < NDADDR)
+ softdep_inode_append(ip,
+ curthread->td_ucred, wkhd);
+ else
+ softdep_buf_append(ibp, wkhd);
+ }
if (lbn < NDADDR) {
DIP_SET(ip, i_db[lbn], bno);
} else if (ip->i_ump->um_fstype == UFS1) {
@@ -1864,12 +1881,16 @@ retry:
* simply copy them to the new block. Note that we need
* to synchronously write snapshots that have not been
* unlinked, and hence will be visible after a crash,
- * to ensure their integrity.
+ * to ensure their integrity. At a minimum we ensure the
+ * integrity of the filesystem metadata, but use the
+ * dopersistence sysctl-setable flag to decide on the
+ * persistence needed for file content data.
*/
if (savedcbp != 0) {
bcopy(savedcbp->b_data, cbp->b_data, fs->fs_bsize);
bawrite(cbp);
- if (dopersistence && ip->i_effnlink > 0)
+ if ((vtype == VDIR || dopersistence) &&
+ ip->i_effnlink > 0)
(void) ffs_syncvnode(vp, MNT_WAIT);
continue;
}
@@ -1879,7 +1900,8 @@ retry:
if ((error = readblock(vp, cbp, lbn)) != 0) {
bzero(cbp->b_data, fs->fs_bsize);
bawrite(cbp);
- if (dopersistence && ip->i_effnlink > 0)
+ if ((vtype == VDIR || dopersistence) &&
+ ip->i_effnlink > 0)
(void) ffs_syncvnode(vp, MNT_WAIT);
break;
}
@@ -1888,12 +1910,16 @@ retry:
/*
* Note that we need to synchronously write snapshots that
* have not been unlinked, and hence will be visible after
- * a crash, to ensure their integrity.
+ * a crash, to ensure their integrity. At a minimum we
+ * ensure the integrity of the filesystem metadata, but
+ * use the dopersistence sysctl-setable flag to decide on
+ * the persistence needed for file content data.
*/
if (savedcbp) {
vp = savedcbp->b_vp;
bawrite(savedcbp);
- if (dopersistence && VTOI(vp)->i_effnlink > 0)
+ if ((vtype == VDIR || dopersistence) &&
+ VTOI(vp)->i_effnlink > 0)
(void) ffs_syncvnode(vp, MNT_WAIT);
}
/*
@@ -1902,6 +1928,8 @@ retry:
* not be freed. Although space will be lost, the snapshot
* will stay consistent.
*/
+ if (error != 0 && wkhd != NULL)
+ softdep_freework(wkhd);
lockmgr(vp->v_vnlock, LK_RELEASE, NULL);
return (error);
}
@@ -2346,12 +2374,16 @@ ffs_copyonwrite(devvp, bp)
* simply copy them to the new block. Note that we need
* to synchronously write snapshots that have not been
* unlinked, and hence will be visible after a crash,
- * to ensure their integrity.
+ * to ensure their integrity. At a minimum we ensure the
+ * integrity of the filesystem metadata, but use the
+ * dopersistence sysctl-setable flag to decide on the
+ * persistence needed for file content data.
*/
if (savedcbp != 0) {
bcopy(savedcbp->b_data, cbp->b_data, fs->fs_bsize);
bawrite(cbp);
- if (dopersistence && ip->i_effnlink > 0)
+ if ((devvp == bp->b_vp || bp->b_vp->v_type == VDIR ||
+ dopersistence) && ip->i_effnlink > 0)
(void) ffs_syncvnode(vp, MNT_WAIT);
else
launched_async_io = 1;
@@ -2363,7 +2395,8 @@ ffs_copyonwrite(devvp, bp)
if ((error = readblock(vp, cbp, lbn)) != 0) {
bzero(cbp->b_data, fs->fs_bsize);
bawrite(cbp);
- if (dopersistence && ip->i_effnlink > 0)
+ if ((devvp == bp->b_vp || bp->b_vp->v_type == VDIR ||
+ dopersistence) && ip->i_effnlink > 0)
(void) ffs_syncvnode(vp, MNT_WAIT);
else
launched_async_io = 1;
@@ -2374,12 +2407,16 @@ ffs_copyonwrite(devvp, bp)
/*
* Note that we need to synchronously write snapshots that
* have not been unlinked, and hence will be visible after
- * a crash, to ensure their integrity.
+ * a crash, to ensure their integrity. At a minimum we
+ * ensure the integrity of the filesystem metadata, but
+ * use the dopersistence sysctl-setable flag to decide on
+ * the persistence needed for file content data.
*/
if (savedcbp) {
vp = savedcbp->b_vp;
bawrite(savedcbp);
- if (dopersistence && VTOI(vp)->i_effnlink > 0)
+ if ((devvp == bp->b_vp || bp->b_vp->v_type == VDIR ||
+ dopersistence) && VTOI(vp)->i_effnlink > 0)
(void) ffs_syncvnode(vp, MNT_WAIT);
else
launched_async_io = 1;
@@ -2400,6 +2437,42 @@ ffs_copyonwrite(devvp, bp)
}
/*
+ * sync snapshots to force freework records waiting on snapshots to claim
+ * blocks to free.
+ */
+void
+ffs_sync_snap(mp, waitfor)
+ struct mount *mp;
+ int waitfor;
+{
+ struct snapdata *sn;
+ struct vnode *devvp;
+ struct vnode *vp;
+ struct inode *ip;
+
+ devvp = VFSTOUFS(mp)->um_devvp;
+ if ((devvp->v_vflag & VV_COPYONWRITE) == 0)
+ return;
+ for (;;) {
+ VI_LOCK(devvp);
+ sn = devvp->v_rdev->si_snapdata;
+ if (sn == NULL) {
+ VI_UNLOCK(devvp);
+ return;
+ }
+ if (lockmgr(&sn->sn_lock,
+ LK_INTERLOCK | LK_EXCLUSIVE | LK_SLEEPFAIL,
+ VI_MTX(devvp)) == 0)
+ break;
+ }
+ TAILQ_FOREACH(ip, &sn->sn_head, i_nextsnap) {
+ vp = ITOV(ip);
+ ffs_syncvnode(vp, waitfor);
+ }
+ lockmgr(&sn->sn_lock, LK_RELEASE, NULL);
+}
+
+/*
* Read the specified block into the given buffer.
* Much of this boiler-plate comes from bwrite().
*/
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index a7ae484..a10104d 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include <sys/buf.h>
#include <sys/kdb.h>
#include <sys/kthread.h>
+#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mount.h>
@@ -71,6 +72,7 @@ __FBSDID("$FreeBSD$");
#include <sys/syslog.h>
#include <sys/vnode.h>
#include <sys/conf.h>
+
#include <ufs/ufs/dir.h>
#include <ufs/ufs/extattr.h>
#include <ufs/ufs/quota.h>
@@ -82,6 +84,8 @@ __FBSDID("$FreeBSD$");
#include <ufs/ufs/ufs_extern.h>
#include <vm/vm.h>
+#include <vm/vm_extern.h>
+#include <vm/vm_object.h>
#include <ddb/ddb.h>
@@ -138,10 +142,11 @@ softdep_setup_sbupdate(ump, fs, bp)
}
void
-softdep_setup_inomapdep(bp, ip, newinum)
+softdep_setup_inomapdep(bp, ip, newinum, mode)
struct buf *bp;
struct inode *ip;
ino_t newinum;
+ int mode;
{
panic("softdep_setup_inomapdep called");
@@ -214,6 +219,25 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
}
void
+softdep_journal_freeblocks(ip, cred, length, flags)
+ struct inode *ip;
+ struct ucred *cred;
+ off_t length;
+ int flags;
+{
+
+ panic("softdep_journal_freeblocks called");
+}
+
+void
+softdep_journal_fsync(ip)
+ struct inode *ip;
+{
+
+ panic("softdep_journal_fsync called");
+}
+
+void
softdep_setup_freeblocks(ip, length, flags)
struct inode *ip;
off_t length;
@@ -282,29 +306,6 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
panic("softdep_setup_directory_change called");
}
-void *
-softdep_setup_trunc(vp, length, flags)
- struct vnode *vp;
- off_t length;
- int flags;
-{
-
- panic("%s called", __FUNCTION__);
-
- return (NULL);
-}
-
-int
-softdep_complete_trunc(vp, cookie)
- struct vnode *vp;
- void *cookie;
-{
-
- panic("%s called", __FUNCTION__);
-
- return (0);
-}
-
void
softdep_setup_blkfree(mp, bp, blkno, frags, wkhd)
struct mount *mp;
@@ -499,6 +500,13 @@ softdep_sync_metadata(struct vnode *vp)
}
int
+softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor)
+{
+
+ return (0);
+}
+
+int
softdep_slowdown(vp)
struct vnode *vp;
{
@@ -577,6 +585,33 @@ softdep_get_depcounts(struct mount *mp,
*softdepactiveaccp = 0;
}
+void
+softdep_buf_append(bp, wkhd)
+ struct buf *bp;
+ struct workhead *wkhd;
+{
+
+ panic("softdep_buf_appendwork called");
+}
+
+void
+softdep_inode_append(ip, cred, wkhd)
+ struct inode *ip;
+ struct ucred *cred;
+ struct workhead *wkhd;
+{
+
+ panic("softdep_inode_appendwork called");
+}
+
+void
+softdep_freework(wkhd)
+ struct workhead *wkhd;
+{
+
+ panic("softdep_freework called");
+}
+
#else
FEATURE(softupdates, "FFS soft-updates support");
@@ -614,10 +649,13 @@ FEATURE(softupdates, "FFS soft-updates support");
#define D_JSEGDEP 23
#define D_SBDEP 24
#define D_JTRUNC 25
-#define D_LAST D_JTRUNC
+#define D_JFSYNC 26
+#define D_SENTINAL 27
+#define D_LAST D_SENTINAL
unsigned long dep_current[D_LAST + 1];
unsigned long dep_total[D_LAST + 1];
+unsigned long dep_write[D_LAST + 1];
SYSCTL_NODE(_debug, OID_AUTO, softdep, CTLFLAG_RW, 0, "soft updates stats");
@@ -625,13 +663,17 @@ SYSCTL_NODE(_debug_softdep, OID_AUTO, total, CTLFLAG_RW, 0,
"total dependencies allocated");
SYSCTL_NODE(_debug_softdep, OID_AUTO, current, CTLFLAG_RW, 0,
"current dependencies allocated");
+SYSCTL_NODE(_debug_softdep, OID_AUTO, write, CTLFLAG_RW, 0,
+ "current dependencies written");
#define SOFTDEP_TYPE(type, str, long) \
static MALLOC_DEFINE(M_ ## type, #str, long); \
SYSCTL_ULONG(_debug_softdep_total, OID_AUTO, str, CTLFLAG_RD, \
&dep_total[D_ ## type], 0, ""); \
SYSCTL_ULONG(_debug_softdep_current, OID_AUTO, str, CTLFLAG_RD, \
- &dep_current[D_ ## type], 0, "");
+ &dep_current[D_ ## type], 0, ""); \
+ SYSCTL_ULONG(_debug_softdep_write, OID_AUTO, str, CTLFLAG_RD, \
+ &dep_write[D_ ## type], 0, "");
SOFTDEP_TYPE(PAGEDEP, pagedep, "File page dependencies");
SOFTDEP_TYPE(INODEDEP, inodedep, "Inode dependencies");
@@ -660,6 +702,7 @@ SOFTDEP_TYPE(JSEG, jseg, "Journal segment");
SOFTDEP_TYPE(JSEGDEP, jsegdep, "Journal segment complete");
SOFTDEP_TYPE(SBDEP, sbdep, "Superblock write dependency");
SOFTDEP_TYPE(JTRUNC, jtrunc, "Journal inode truncation");
+SOFTDEP_TYPE(JFSYNC, jfsync, "Journal fsync complete");
static MALLOC_DEFINE(M_SAVEDINO, "savedino", "Saved inodes");
static MALLOC_DEFINE(M_JBLOCKS, "jblocks", "Journal block locations");
@@ -694,7 +737,8 @@ static struct malloc_type *memtype[] = {
M_JSEG,
M_JSEGDEP,
M_SBDEP,
- M_JTRUNC
+ M_JTRUNC,
+ M_JFSYNC
};
static LIST_HEAD(mkdirlist, mkdir) mkdirlisthd;
@@ -734,10 +778,11 @@ static void clear_unlinked_inodedep(struct inodedep *);
static struct inodedep *first_unlinked_inodedep(struct ufsmount *);
static int flush_pagedep_deps(struct vnode *, struct mount *,
struct diraddhd *);
-static void free_pagedep(struct pagedep *);
+static int free_pagedep(struct pagedep *);
static int flush_newblk_dep(struct vnode *, struct mount *, ufs_lbn_t);
-static int flush_inodedep_deps(struct mount *, ino_t);
+static int flush_inodedep_deps(struct vnode *, struct mount *, ino_t);
static int flush_deplist(struct allocdirectlst *, int, int *);
+static int sync_cgs(struct mount *, int);
static int handle_written_filepage(struct pagedep *, struct buf *);
static int handle_written_sbdep(struct sbdep *, struct buf *);
static void initiate_write_sbdep(struct sbdep *);
@@ -745,12 +790,14 @@ static void diradd_inode_written(struct diradd *, struct inodedep *);
static int handle_written_indirdep(struct indirdep *, struct buf *,
struct buf**);
static int handle_written_inodeblock(struct inodedep *, struct buf *);
+static int jnewblk_rollforward(struct jnewblk *, struct fs *, struct cg *,
+ uint8_t *);
static int handle_written_bmsafemap(struct bmsafemap *, struct buf *);
static void handle_written_jaddref(struct jaddref *);
static void handle_written_jremref(struct jremref *);
static void handle_written_jseg(struct jseg *, struct buf *);
static void handle_written_jnewblk(struct jnewblk *);
-static void handle_written_jfreeblk(struct jfreeblk *);
+static void handle_written_jblkdep(struct jblkdep *);
static void handle_written_jfreefrag(struct jfreefrag *);
static void complete_jseg(struct jseg *);
static void jseg_write(struct ufsmount *ump, struct jseg *, uint8_t *);
@@ -758,6 +805,7 @@ static void jaddref_write(struct jaddref *, struct jseg *, uint8_t *);
static void jremref_write(struct jremref *, struct jseg *, uint8_t *);
static void jmvref_write(struct jmvref *, struct jseg *, uint8_t *);
static void jtrunc_write(struct jtrunc *, struct jseg *, uint8_t *);
+static void jfsync_write(struct jfsync *, struct jseg *, uint8_t *data);
static void jnewblk_write(struct jnewblk *, struct jseg *, uint8_t *);
static void jfreeblk_write(struct jfreeblk *, struct jseg *, uint8_t *);
static void jfreefrag_write(struct jfreefrag *, struct jseg *, uint8_t *);
@@ -768,19 +816,25 @@ static void handle_allocdirect_partdone(struct allocdirect *,
static struct jnewblk *cancel_newblk(struct newblk *, struct worklist *,
struct workhead *);
static void indirdep_complete(struct indirdep *);
-static int indirblk_inseg(struct mount *, ufs2_daddr_t);
+static int indirblk_lookup(struct mount *, ufs2_daddr_t);
+static void indirblk_insert(struct freework *);
+static void indirblk_remove(struct freework *);
static void handle_allocindir_partdone(struct allocindir *);
static void initiate_write_filepage(struct pagedep *, struct buf *);
static void initiate_write_indirdep(struct indirdep*, struct buf *);
static void handle_written_mkdir(struct mkdir *, int);
+static int jnewblk_rollback(struct jnewblk *, struct fs *, struct cg *,
+ uint8_t *);
static void initiate_write_bmsafemap(struct bmsafemap *, struct buf *);
static void initiate_write_inodeblock_ufs1(struct inodedep *, struct buf *);
static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *);
static void handle_workitem_freefile(struct freefile *);
-static void handle_workitem_remove(struct dirrem *, struct vnode *);
+static int handle_workitem_remove(struct dirrem *, int);
static struct dirrem *newdirrem(struct buf *, struct inode *,
struct inode *, int, struct dirrem **);
-static void cancel_indirdep(struct indirdep *, struct buf *, struct inodedep *,
+static struct indirdep *indirdep_lookup(struct mount *, struct inode *,
+ struct buf *);
+static void cancel_indirdep(struct indirdep *, struct buf *,
struct freeblks *);
static void free_indirdep(struct indirdep *);
static void free_diradd(struct diradd *, struct workhead *);
@@ -795,8 +849,13 @@ static void cancel_diradd(struct diradd *, struct dirrem *, struct jremref *,
struct jremref *, struct jremref *);
static void dirrem_journal(struct dirrem *, struct jremref *, struct jremref *,
struct jremref *);
-static void cancel_allocindir(struct allocindir *, struct inodedep *,
- struct freeblks *);
+static void cancel_allocindir(struct allocindir *, struct buf *bp,
+ struct freeblks *, int);
+static int setup_trunc_indir(struct freeblks *, struct inode *,
+ ufs_lbn_t, ufs_lbn_t, ufs2_daddr_t);
+static void complete_trunc_indir(struct freework *);
+static void trunc_indirdep(struct indirdep *, struct freeblks *, struct buf *,
+ int);
static void complete_mkdir(struct mkdir *);
static void free_newdirblk(struct newdirblk *);
static void free_jremref(struct jremref *);
@@ -806,7 +865,7 @@ static void free_jsegs(struct jblocks *);
static void rele_jseg(struct jseg *);
static void free_jseg(struct jseg *, struct jblocks *);
static void free_jnewblk(struct jnewblk *);
-static void free_jfreeblk(struct jfreeblk *);
+static void free_jblkdep(struct jblkdep *);
static void free_jfreefrag(struct jfreefrag *);
static void free_freedep(struct freedep *);
static void journal_jremref(struct dirrem *, struct jremref *,
@@ -818,30 +877,33 @@ static void cancel_jfreefrag(struct jfreefrag *);
static inline void setup_freedirect(struct freeblks *, struct inode *,
int, int);
static inline void setup_freeext(struct freeblks *, struct inode *, int, int);
-static inline void setup_freeindir(struct freeblks *, struct inode *, int i,
+static inline void setup_freeindir(struct freeblks *, struct inode *, int,
ufs_lbn_t, int);
static inline struct freeblks *newfreeblks(struct mount *, struct inode *);
static void indir_trunc(struct freework *, ufs2_daddr_t, ufs_lbn_t);
-static void softdep_trunc_deps(struct vnode *, struct freeblks *, ufs_lbn_t,
+ufs2_daddr_t blkcount(struct fs *, ufs2_daddr_t, off_t);
+static int trunc_check_buf(struct buf *, int *, ufs_lbn_t, int, int);
+static void trunc_dependencies(struct inode *, struct freeblks *, ufs_lbn_t,
int, int);
-static int cancel_pagedep(struct pagedep *, struct inodedep *,
- struct freeblks *);
-static int deallocate_dependencies(struct buf *, struct inodedep *,
- struct freeblks *, int off);
+static void trunc_pages(struct inode *, off_t, ufs2_daddr_t, int);
+static int cancel_pagedep(struct pagedep *, struct freeblks *, int);
+static int deallocate_dependencies(struct buf *, struct freeblks *, int);
+static void newblk_freefrag(struct newblk*);
static void free_newblk(struct newblk *);
static void cancel_allocdirect(struct allocdirectlst *,
- struct allocdirect *, struct freeblks *, int);
+ struct allocdirect *, struct freeblks *);
static int check_inode_unwritten(struct inodedep *);
static int free_inodedep(struct inodedep *);
static void freework_freeblock(struct freework *);
-static void handle_workitem_freeblocks(struct freeblks *, int);
-static void handle_complete_freeblocks(struct freeblks *);
+static void freework_enqueue(struct freework *);
+static int handle_workitem_freeblocks(struct freeblks *, int);
+static int handle_complete_freeblocks(struct freeblks *, int);
static void handle_workitem_indirblk(struct freework *);
static void handle_written_freework(struct freework *);
static void merge_inode_lists(struct allocdirectlst *,struct allocdirectlst *);
static struct worklist *jnewblk_merge(struct worklist *, struct worklist *,
struct workhead *);
-static void setup_allocindir_phase2(struct buf *, struct inode *,
+static struct freefrag *setup_allocindir_phase2(struct buf *, struct inode *,
struct inodedep *, struct allocindir *, ufs_lbn_t);
static struct allocindir *newallocindir(struct inode *, int, ufs2_daddr_t,
ufs2_daddr_t, ufs_lbn_t);
@@ -862,18 +924,23 @@ static int newblk_lookup(struct mount *, ufs2_daddr_t, int, struct newblk **);
static int inodedep_find(struct inodedep_hashhead *, struct fs *, ino_t,
struct inodedep **);
static int inodedep_lookup(struct mount *, ino_t, int, struct inodedep **);
-static int pagedep_lookup(struct mount *, ino_t, ufs_lbn_t, int,
- struct pagedep **);
+static int pagedep_lookup(struct mount *, struct buf *bp, ino_t, ufs_lbn_t,
+ int, struct pagedep **);
static int pagedep_find(struct pagedep_hashhead *, ino_t, ufs_lbn_t,
struct mount *mp, int, struct pagedep **);
static void pause_timer(void *);
static int request_cleanup(struct mount *, int);
-static int process_worklist_item(struct mount *, int);
+static int process_worklist_item(struct mount *, int, int);
static void process_removes(struct vnode *);
+static void process_truncates(struct vnode *);
static void jwork_move(struct workhead *, struct workhead *);
+static void jwork_insert(struct workhead *, struct jsegdep *);
static void add_to_worklist(struct worklist *, int);
+static void wake_worklist(struct worklist *);
+static void wait_worklist(struct worklist *, char *);
static void remove_from_worklist(struct worklist *);
static void softdep_flush(void);
+static void softdep_flushjournal(struct mount *);
static int softdep_speedup(void);
static void worklist_speedup(void);
static int journal_mount(struct mount *, struct fs *, struct ucred *);
@@ -889,17 +956,20 @@ static struct jremref *newjremref(struct dirrem *, struct inode *,
struct inode *ip, off_t, nlink_t);
static struct jaddref *newjaddref(struct inode *, ino_t, off_t, int16_t,
uint16_t);
-static inline void newinoref(struct inoref *, ino_t, ino_t, off_t, nlink_t,
+static inline void newinoref(struct inoref *, ino_t, ino_t, off_t, nlink_t,
uint16_t);
-static inline struct jsegdep *inoref_jseg(struct inoref *);
+static inline struct jsegdep *inoref_jseg(struct inoref *);
static struct jmvref *newjmvref(struct inode *, ino_t, off_t, off_t);
static struct jfreeblk *newjfreeblk(struct freeblks *, ufs_lbn_t,
ufs2_daddr_t, int);
+static struct jtrunc *newjtrunc(struct freeblks *, off_t, int);
+static void move_newblock_dep(struct jaddref *, struct inodedep *);
+static void cancel_jfreeblk(struct freeblks *, ufs2_daddr_t);
static struct jfreefrag *newjfreefrag(struct freefrag *, struct inode *,
ufs2_daddr_t, long, ufs_lbn_t);
static struct freework *newfreework(struct ufsmount *, struct freeblks *,
- struct freework *, ufs_lbn_t, ufs2_daddr_t, int, int);
-static void jwait(struct worklist *wk);
+ struct freework *, ufs_lbn_t, ufs2_daddr_t, int, int, int);
+static int jwait(struct worklist *, int);
static struct inodedep *inodedep_lookup_ip(struct inode *);
static int bmsafemap_rollbacks(struct bmsafemap *);
static struct freefile *handle_bufwait(struct inodedep *, struct workhead *);
@@ -1064,6 +1134,30 @@ jwork_move(dst, src)
}
}
+static void
+jwork_insert(dst, jsegdep)
+ struct workhead *dst;
+ struct jsegdep *jsegdep;
+{
+ struct jsegdep *jsegdepn;
+ struct worklist *wk;
+
+ LIST_FOREACH(wk, dst, wk_list)
+ if (wk->wk_type == D_JSEGDEP)
+ break;
+ if (wk == NULL) {
+ WORKLIST_INSERT(dst, &jsegdep->jd_list);
+ return;
+ }
+ jsegdepn = WK_JSEGDEP(wk);
+ if (jsegdep->jd_seg->js_seq < jsegdepn->jd_seg->js_seq) {
+ WORKLIST_REMOVE(wk);
+ free_jsegdep(jsegdepn);
+ WORKLIST_INSERT(dst, &jsegdep->jd_list);
+ } else
+ free_jsegdep(jsegdep);
+}
+
/*
* Routines for tracking and managing workitems.
*/
@@ -1088,6 +1182,8 @@ workitem_free(item, type)
panic("workitem_free: type mismatch %s != %s",
TYPENAME(item->wk_type), TYPENAME(type));
#endif
+ if (item->wk_state & IOWAITING)
+ wakeup(item);
ump = VFSTOUFS(item->wk_mp);
if (--ump->softdep_deps == 0 && ump->softdep_req)
wakeup(&ump->softdep_deps);
@@ -1101,14 +1197,18 @@ workitem_alloc(item, type, mp)
int type;
struct mount *mp;
{
+ struct ufsmount *ump;
+
item->wk_type = type;
item->wk_mp = mp;
item->wk_state = 0;
+
+ ump = VFSTOUFS(mp);
ACQUIRE_LOCK(&lk);
dep_current[type]++;
dep_total[type]++;
- VFSTOUFS(mp)->softdep_deps++;
- VFSTOUFS(mp)->softdep_accdeps++;
+ ump->softdep_deps++;
+ ump->softdep_accdeps++;
FREE_LOCK(&lk);
}
@@ -1270,8 +1370,7 @@ softdep_flush(void)
vfslocked = VFS_LOCK_GIANT(mp);
progress += softdep_process_worklist(mp, 0);
ump = VFSTOUFS(mp);
- remaining += ump->softdep_on_worklist -
- ump->softdep_on_worklist_inprogress;
+ remaining += ump->softdep_on_worklist;
VFS_UNLOCK_GIANT(vfslocked);
mtx_lock(&mountlist_mtx);
nmp = TAILQ_NEXT(mp, mnt_list);
@@ -1314,10 +1413,14 @@ softdep_speedup(void)
* The following routine is the only one that removes items
* and does so in order from first to last.
*/
+
+#define WK_HEAD 0x0001 /* Add to HEAD. */
+#define WK_NODELAY 0x0002 /* Process immediately. */
+
static void
-add_to_worklist(wk, nodelay)
+add_to_worklist(wk, flags)
struct worklist *wk;
- int nodelay;
+ int flags;
{
struct ufsmount *ump;
@@ -1327,13 +1430,17 @@ add_to_worklist(wk, nodelay)
panic("add_to_worklist: %s(0x%X) already on list",
TYPENAME(wk->wk_type), wk->wk_state);
wk->wk_state |= ONWORKLIST;
- if (LIST_EMPTY(&ump->softdep_workitem_pending))
+ if (ump->softdep_on_worklist == 0) {
LIST_INSERT_HEAD(&ump->softdep_workitem_pending, wk, wk_list);
- else
+ ump->softdep_worklist_tail = wk;
+ } else if (flags & WK_HEAD) {
+ LIST_INSERT_HEAD(&ump->softdep_workitem_pending, wk, wk_list);
+ } else {
LIST_INSERT_AFTER(ump->softdep_worklist_tail, wk, wk_list);
- ump->softdep_worklist_tail = wk;
+ ump->softdep_worklist_tail = wk;
+ }
ump->softdep_on_worklist += 1;
- if (nodelay)
+ if (flags & WK_NODELAY)
worklist_speedup();
}
@@ -1346,19 +1453,35 @@ remove_from_worklist(wk)
struct worklist *wk;
{
struct ufsmount *ump;
- struct worklist *wkend;
ump = VFSTOUFS(wk->wk_mp);
WORKLIST_REMOVE(wk);
- if (wk == ump->softdep_worklist_tail) {
- LIST_FOREACH(wkend, &ump->softdep_workitem_pending, wk_list)
- if (LIST_NEXT(wkend, wk_list) == NULL)
- break;
- ump->softdep_worklist_tail = wkend;
- }
+ if (ump->softdep_worklist_tail == wk)
+ ump->softdep_worklist_tail =
+ (struct worklist *)wk->wk_list.le_prev;
ump->softdep_on_worklist -= 1;
}
+static void
+wake_worklist(wk)
+ struct worklist *wk;
+{
+ if (wk->wk_state & IOWAITING) {
+ wk->wk_state &= ~IOWAITING;
+ wakeup(wk);
+ }
+}
+
+static void
+wait_worklist(wk, wmesg)
+ struct worklist *wk;
+ char *wmesg;
+{
+
+ wk->wk_state |= IOWAITING;
+ msleep(wk, &lk, PVM, wmesg, 0);
+}
+
/*
* Process that runs once per second to handle items in the background queue.
*
@@ -1389,7 +1512,7 @@ softdep_process_worklist(mp, full)
starttime = time_second;
softdep_process_journal(mp, NULL, full?MNT_WAIT:0);
while (ump->softdep_on_worklist > 0) {
- if ((cnt = process_worklist_item(mp, LK_NOWAIT)) == -1)
+ if ((cnt = process_worklist_item(mp, 10, LK_NOWAIT)) == 0)
break;
else
matchcnt += cnt;
@@ -1449,46 +1572,123 @@ process_removes(vp)
mp = vp->v_mount;
inum = VTOI(vp)->i_number;
for (;;) {
+top:
if (inodedep_lookup(mp, inum, 0, &inodedep) == 0)
return;
- LIST_FOREACH(dirrem, &inodedep->id_dirremhd, dm_inonext)
- if ((dirrem->dm_state & (COMPLETE | ONWORKLIST)) ==
+ LIST_FOREACH(dirrem, &inodedep->id_dirremhd, dm_inonext) {
+ /*
+ * If another thread is trying to lock this vnode
+ * it will fail but we must wait for it to do so
+ * before we can proceed.
+ */
+ if (dirrem->dm_state & INPROGRESS) {
+ wait_worklist(&dirrem->dm_list, "pwrwait");
+ goto top;
+ }
+ if ((dirrem->dm_state & (COMPLETE | ONWORKLIST)) ==
(COMPLETE | ONWORKLIST))
break;
+ }
if (dirrem == NULL)
return;
- /*
- * If another thread is trying to lock this vnode it will
- * fail but we must wait for it to do so before we can
- * proceed.
- */
- if (dirrem->dm_state & INPROGRESS) {
- dirrem->dm_state |= IOWAITING;
- msleep(&dirrem->dm_list, &lk, PVM, "pwrwait", 0);
- continue;
- }
remove_from_worklist(&dirrem->dm_list);
FREE_LOCK(&lk);
if (vn_start_secondary_write(NULL, &mp, V_NOWAIT))
panic("process_removes: suspended filesystem");
- handle_workitem_remove(dirrem, vp);
+ handle_workitem_remove(dirrem, 0);
vn_finished_secondary_write(mp);
ACQUIRE_LOCK(&lk);
}
}
/*
+ * Process all truncations associated with a vnode if we are running out
+ * of journal space. This is called when the vnode lock is already held
+ * and no other process can clear the truncation. This function returns
+ * a value greater than zero if it did any work.
+ */
+static void
+process_truncates(vp)
+ struct vnode *vp;
+{
+ struct inodedep *inodedep;
+ struct freeblks *freeblks;
+ struct mount *mp;
+ ino_t inum;
+ int cgwait;
+
+ mtx_assert(&lk, MA_OWNED);
+
+ mp = vp->v_mount;
+ inum = VTOI(vp)->i_number;
+ for (;;) {
+ if (inodedep_lookup(mp, inum, 0, &inodedep) == 0)
+ return;
+ cgwait = 0;
+ TAILQ_FOREACH(freeblks, &inodedep->id_freeblklst, fb_next) {
+ /* Journal entries not yet written. */
+ if (!LIST_EMPTY(&freeblks->fb_jblkdephd)) {
+ jwait(&LIST_FIRST(
+ &freeblks->fb_jblkdephd)->jb_list,
+ MNT_WAIT);
+ break;
+ }
+ /* Another thread is executing this item. */
+ if (freeblks->fb_state & INPROGRESS) {
+ wait_worklist(&freeblks->fb_list, "ptrwait");
+ break;
+ }
+ /* Freeblks is waiting on a inode write. */
+ if ((freeblks->fb_state & COMPLETE) == 0) {
+ FREE_LOCK(&lk);
+ ffs_update(vp, 1);
+ ACQUIRE_LOCK(&lk);
+ break;
+ }
+ if ((freeblks->fb_state & (ALLCOMPLETE | ONWORKLIST)) ==
+ (ALLCOMPLETE | ONWORKLIST)) {
+ remove_from_worklist(&freeblks->fb_list);
+ freeblks->fb_state |= INPROGRESS;
+ FREE_LOCK(&lk);
+ if (vn_start_secondary_write(NULL, &mp,
+ V_NOWAIT))
+ panic("process_truncates: "
+ "suspended filesystem");
+ handle_workitem_freeblocks(freeblks, 0);
+ vn_finished_secondary_write(mp);
+ ACQUIRE_LOCK(&lk);
+ break;
+ }
+ if (freeblks->fb_cgwait)
+ cgwait++;
+ }
+ if (cgwait) {
+ FREE_LOCK(&lk);
+ sync_cgs(mp, MNT_WAIT);
+ ffs_sync_snap(mp, MNT_WAIT);
+ ACQUIRE_LOCK(&lk);
+ continue;
+ }
+ if (freeblks == NULL)
+ break;
+ }
+ return;
+}
+
+/*
* Process one item on the worklist.
*/
static int
-process_worklist_item(mp, flags)
+process_worklist_item(mp, target, flags)
struct mount *mp;
+ int target;
int flags;
{
+ struct worklist sintenel;
struct worklist *wk;
struct ufsmount *ump;
- struct vnode *vp;
- int matchcnt = 0;
+ int matchcnt;
+ int error;
mtx_assert(&lk, MA_OWNED);
KASSERT(mp != NULL, ("process_worklist_item: NULL mp"));
@@ -1499,77 +1699,79 @@ process_worklist_item(mp, flags)
*/
if (curthread->td_pflags & TDP_COWINPROGRESS)
return (-1);
- /*
- * Normally we just process each item on the worklist in order.
- * However, if we are in a situation where we cannot lock any
- * inodes, we have to skip over any dirrem requests whose
- * vnodes are resident and locked.
- */
- vp = NULL;
+ PHOLD(curproc); /* Don't let the stack go away. */
ump = VFSTOUFS(mp);
- LIST_FOREACH(wk, &ump->softdep_workitem_pending, wk_list) {
- if (wk->wk_state & INPROGRESS)
+ matchcnt = 0;
+ sintenel.wk_mp = NULL;
+ sintenel.wk_type = D_SENTINAL;
+ LIST_INSERT_HEAD(&ump->softdep_workitem_pending, &sintenel, wk_list);
+ for (wk = LIST_NEXT(&sintenel, wk_list); wk != NULL;
+ wk = LIST_NEXT(&sintenel, wk_list)) {
+ if (wk->wk_type == D_SENTINAL) {
+ LIST_REMOVE(&sintenel, wk_list);
+ LIST_INSERT_AFTER(wk, &sintenel, wk_list);
continue;
- if ((flags & LK_NOWAIT) == 0 || wk->wk_type != D_DIRREM)
- break;
+ }
+ if (wk->wk_state & INPROGRESS)
+ panic("process_worklist_item: %p already in progress.",
+ wk);
wk->wk_state |= INPROGRESS;
- ump->softdep_on_worklist_inprogress++;
+ remove_from_worklist(wk);
FREE_LOCK(&lk);
- ffs_vgetf(mp, WK_DIRREM(wk)->dm_oldinum,
- LK_NOWAIT | LK_EXCLUSIVE, &vp, FFSV_FORCEINSMQ);
- ACQUIRE_LOCK(&lk);
- if (wk->wk_state & IOWAITING) {
- wk->wk_state &= ~IOWAITING;
- wakeup(wk);
- }
- wk->wk_state &= ~INPROGRESS;
- ump->softdep_on_worklist_inprogress--;
- if (vp != NULL)
+ if (vn_start_secondary_write(NULL, &mp, V_NOWAIT))
+ panic("process_worklist_item: suspended filesystem");
+ switch (wk->wk_type) {
+ case D_DIRREM:
+ /* removal of a directory entry */
+ error = handle_workitem_remove(WK_DIRREM(wk), flags);
break;
- }
- if (wk == 0)
- return (-1);
- remove_from_worklist(wk);
- FREE_LOCK(&lk);
- if (vn_start_secondary_write(NULL, &mp, V_NOWAIT))
- panic("process_worklist_item: suspended filesystem");
- matchcnt++;
- switch (wk->wk_type) {
-
- case D_DIRREM:
- /* removal of a directory entry */
- handle_workitem_remove(WK_DIRREM(wk), vp);
- if (vp)
- vput(vp);
- break;
-
- case D_FREEBLKS:
- /* releasing blocks and/or fragments from a file */
- handle_workitem_freeblocks(WK_FREEBLKS(wk), flags & LK_NOWAIT);
- break;
- case D_FREEFRAG:
- /* releasing a fragment when replaced as a file grows */
- handle_workitem_freefrag(WK_FREEFRAG(wk));
- break;
+ case D_FREEBLKS:
+ /* releasing blocks and/or fragments from a file */
+ error = handle_workitem_freeblocks(WK_FREEBLKS(wk),
+ flags);
+ break;
- case D_FREEFILE:
- /* releasing an inode when its link count drops to 0 */
- handle_workitem_freefile(WK_FREEFILE(wk));
- break;
+ case D_FREEFRAG:
+ /* releasing a fragment when replaced as a file grows */
+ handle_workitem_freefrag(WK_FREEFRAG(wk));
+ error = 0;
+ break;
- case D_FREEWORK:
- /* Final block in an indirect was freed. */
- handle_workitem_indirblk(WK_FREEWORK(wk));
- break;
+ case D_FREEFILE:
+ /* releasing an inode when its link count drops to 0 */
+ handle_workitem_freefile(WK_FREEFILE(wk));
+ error = 0;
+ break;
- default:
- panic("%s_process_worklist: Unknown type %s",
- "softdep", TYPENAME(wk->wk_type));
- /* NOTREACHED */
- }
- vn_finished_secondary_write(mp);
- ACQUIRE_LOCK(&lk);
+ default:
+ panic("%s_process_worklist: Unknown type %s",
+ "softdep", TYPENAME(wk->wk_type));
+ /* NOTREACHED */
+ }
+ vn_finished_secondary_write(mp);
+ ACQUIRE_LOCK(&lk);
+ if (error == 0) {
+ if (++matchcnt == target)
+ break;
+ continue;
+ }
+ /*
+ * We have to retry the worklist item later. Wake up any
+ * waiters who may be able to complete it immediately and
+ * add the item back to the head so we don't try to execute
+ * it again.
+ */
+ wk->wk_state &= ~INPROGRESS;
+ wake_worklist(wk);
+ add_to_worklist(wk, WK_HEAD);
+ }
+ LIST_REMOVE(&sintenel, wk_list);
+ /* Sentinal could've become the tail from remove_from_worklist. */
+ if (ump->softdep_worklist_tail == &sintenel)
+ ump->softdep_worklist_tail =
+ (struct worklist *)sintenel.wk_list.le_prev;
+ PRELE(curproc);
return (matchcnt);
}
@@ -1774,31 +1976,26 @@ pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp)
{
struct pagedep *pagedep;
- LIST_FOREACH(pagedep, pagedephd, pd_hash)
- if (ino == pagedep->pd_ino &&
- lbn == pagedep->pd_lbn &&
- mp == pagedep->pd_list.wk_mp)
- break;
- if (pagedep) {
- *pagedeppp = pagedep;
- if ((flags & DEPALLOC) != 0 &&
- (pagedep->pd_state & ONWORKLIST) == 0)
- return (0);
- return (1);
+ LIST_FOREACH(pagedep, pagedephd, pd_hash) {
+ if (ino == pagedep->pd_ino && lbn == pagedep->pd_lbn &&
+ mp == pagedep->pd_list.wk_mp) {
+ *pagedeppp = pagedep;
+ return (1);
+ }
}
*pagedeppp = NULL;
return (0);
}
/*
- * Look up a pagedep. Return 1 if found, 0 if not found or found
- * when asked to allocate but not associated with any buffer.
+ * Look up a pagedep. Return 1 if found, 0 otherwise.
* If not found, allocate if DEPALLOC flag is passed.
* Found or allocated entry is returned in pagedeppp.
* This routine must be called with splbio interrupts blocked.
*/
static int
-pagedep_lookup(mp, ino, lbn, flags, pagedeppp)
+pagedep_lookup(mp, bp, ino, lbn, flags, pagedeppp)
struct mount *mp;
+ struct buf *bp;
ino_t ino;
ufs_lbn_t lbn;
int flags;
@@ -1806,15 +2003,28 @@ pagedep_lookup(mp, ino, lbn, flags, pagedeppp)
{
struct pagedep *pagedep;
struct pagedep_hashhead *pagedephd;
+ struct worklist *wk;
int ret;
int i;
mtx_assert(&lk, MA_OWNED);
+ if (bp) {
+ LIST_FOREACH(wk, &bp->b_dep, wk_list) {
+ if (wk->wk_type == D_PAGEDEP) {
+ *pagedeppp = WK_PAGEDEP(wk);
+ return (1);
+ }
+ }
+ }
pagedephd = PAGEDEP_HASH(mp, ino, lbn);
-
ret = pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp);
- if (*pagedeppp || (flags & DEPALLOC) == 0)
- return (ret);
+ if (ret) {
+ if (((*pagedeppp)->pd_state & ONWORKLIST) == 0 && bp)
+ WORKLIST_INSERT(&bp->b_dep, &(*pagedeppp)->pd_list);
+ return (1);
+ }
+ if ((flags & DEPALLOC) == 0)
+ return (0);
FREE_LOCK(&lk);
pagedep = malloc(sizeof(struct pagedep),
M_PAGEDEP, M_SOFTDEP_FLAGS|M_ZERO);
@@ -1822,6 +2032,10 @@ pagedep_lookup(mp, ino, lbn, flags, pagedeppp)
ACQUIRE_LOCK(&lk);
ret = pagedep_find(pagedephd, ino, lbn, mp, flags, pagedeppp);
if (*pagedeppp) {
+ /*
+ * This should never happen since we only create pagedeps
+ * with the vnode lock held. Could be an assert.
+ */
WORKITEM_FREE(pagedep, D_PAGEDEP);
return (ret);
}
@@ -1832,6 +2046,7 @@ pagedep_lookup(mp, ino, lbn, flags, pagedeppp)
for (i = 0; i < DAHASHSZ; i++)
LIST_INIT(&pagedep->pd_diraddhd[i]);
LIST_INSERT_HEAD(pagedephd, pagedep, pd_hash);
+ WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list);
*pagedeppp = pagedep;
return (0);
}
@@ -1922,6 +2137,7 @@ inodedep_lookup(mp, inum, flags, inodedeppp)
TAILQ_INIT(&inodedep->id_newinoupdt);
TAILQ_INIT(&inodedep->id_extupdt);
TAILQ_INIT(&inodedep->id_newextupdt);
+ TAILQ_INIT(&inodedep->id_freeblklst);
LIST_INSERT_HEAD(inodedephd, inodedep, id_hash);
*inodedeppp = inodedep;
return (0);
@@ -2008,43 +2224,86 @@ newblk_lookup(mp, newblkno, flags, newblkpp)
}
/*
- * Structures and routines associated with indir caching.
+ * Structures and routines associated with freed indirect block caching.
*/
-struct workhead *indir_hashtbl;
+struct freeworklst *indir_hashtbl;
u_long indir_hash; /* size of hash table - 1 */
#define INDIR_HASH(mp, blkno) \
(&indir_hashtbl[((((register_t)(mp)) >> 13) + (blkno)) & indir_hash])
+/*
+ * Lookup an indirect block in the indir hash table. The freework is
+ * removed and potentially freed. The caller must do a blocking journal
+ * write before writing to the blkno.
+ */
static int
-indirblk_inseg(mp, blkno)
+indirblk_lookup(mp, blkno)
struct mount *mp;
ufs2_daddr_t blkno;
{
struct freework *freework;
- struct workhead *wkhd;
- struct worklist *wk;
+ struct freeworklst *wkhd;
wkhd = INDIR_HASH(mp, blkno);
- LIST_FOREACH(wk, wkhd, wk_list) {
- freework = WK_FREEWORK(wk);
- if (freework->fw_blkno == blkno &&
- freework->fw_list.wk_mp == mp) {
- LIST_REMOVE(freework, fw_next);
- WORKLIST_REMOVE(&freework->fw_list);
- WORKITEM_FREE(freework, D_FREEWORK);
- return (1);
- }
+ TAILQ_FOREACH(freework, wkhd, fw_next) {
+ if (freework->fw_blkno != blkno)
+ continue;
+ if (freework->fw_list.wk_mp != mp)
+ continue;
+ indirblk_remove(freework);
+ return (1);
}
return (0);
}
/*
+ * Insert an indirect block represented by freework into the indirblk
+ * hash table so that it may prevent the block from being re-used prior
+ * to the journal being written.
+ */
+static void
+indirblk_insert(freework)
+ struct freework *freework;
+{
+ struct freeblks *freeblks;
+ struct jsegdep *jsegdep;
+ struct worklist *wk;
+
+ freeblks = freework->fw_freeblks;
+ LIST_FOREACH(wk, &freeblks->fb_jwork, wk_list)
+ if (wk->wk_type == D_JSEGDEP)
+ break;
+ if (wk == NULL)
+ return;
+
+ jsegdep = WK_JSEGDEP(wk);
+ LIST_INSERT_HEAD(&jsegdep->jd_seg->js_indirs, freework, fw_segs);
+ TAILQ_INSERT_HEAD(INDIR_HASH(freework->fw_list.wk_mp,
+ freework->fw_blkno), freework, fw_next);
+ freework->fw_state &= ~DEPCOMPLETE;
+}
+
+static void
+indirblk_remove(freework)
+ struct freework *freework;
+{
+
+ LIST_REMOVE(freework, fw_segs);
+ TAILQ_REMOVE(INDIR_HASH(freework->fw_list.wk_mp,
+ freework->fw_blkno), freework, fw_next);
+ freework->fw_state |= DEPCOMPLETE;
+ if ((freework->fw_state & ALLCOMPLETE) == ALLCOMPLETE)
+ WORKITEM_FREE(freework, D_FREEWORK);
+}
+
+/*
* Executed during filesystem system initialization before
* mounting any filesystems.
*/
void
softdep_initialize()
{
+ int i;
LIST_INIT(&mkdirlisthd);
max_softdeps = desiredvnodes * 4;
@@ -2052,7 +2311,12 @@ softdep_initialize()
inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, &inodedep_hash);
newblk_hashtbl = hashinit(desiredvnodes / 5, M_NEWBLK, &newblk_hash);
bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, &bmsafemap_hash);
- indir_hashtbl = hashinit(desiredvnodes / 10, M_FREEWORK, &indir_hash);
+ i = 1 << (ffs(desiredvnodes / 10) - 1);
+ indir_hashtbl = malloc(i * sizeof(indir_hashtbl[0]), M_FREEWORK,
+ M_WAITOK);
+ indir_hash = i - 1;
+ for (i = 0; i <= indir_hash; i++)
+ TAILQ_INIT(&indir_hashtbl[i]);
/* initialise bioops hack */
bioops.io_start = softdep_disk_io_initiation;
@@ -2077,6 +2341,7 @@ softdep_uninitialize()
hashdestroy(inodedep_hashtbl, M_INODEDEP, inodedep_hash);
hashdestroy(newblk_hashtbl, M_NEWBLK, newblk_hash);
hashdestroy(bmsafemap_hashtbl, M_BMSAFEMAP, bmsafemap_hash);
+ free(indir_hashtbl, M_FREEWORK);
}
/*
@@ -2108,6 +2373,7 @@ softdep_mount(devvp, mp, fs, cred)
LIST_INIT(&ump->softdep_workitem_pending);
LIST_INIT(&ump->softdep_journal_pending);
TAILQ_INIT(&ump->softdep_unlinked);
+ LIST_INIT(&ump->softdep_dirtycg);
ump->softdep_worklist_tail = NULL;
ump->softdep_on_worklist = 0;
ump->softdep_deps = 0;
@@ -2154,8 +2420,15 @@ softdep_unmount(mp)
struct mount *mp;
{
- if (mp->mnt_kern_flag & MNTK_SUJ)
- journal_unmount(mp);
+ MNT_ILOCK(mp);
+ mp->mnt_flag &= ~MNT_SOFTDEP;
+ if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) {
+ MNT_IUNLOCK(mp);
+ return;
+ }
+ mp->mnt_kern_flag &= ~MNTK_SUJ;
+ MNT_IUNLOCK(mp);
+ journal_unmount(mp);
}
struct jblocks {
@@ -2570,6 +2843,7 @@ softdep_prealloc(vp, waitok)
ffs_syncvnode(vp, waitok);
ACQUIRE_LOCK(&lk);
process_removes(vp);
+ process_truncates(vp);
if (journal_space(ump, 0) == 0) {
softdep_speedup();
if (journal_space(ump, 1) == 0)
@@ -2604,12 +2878,14 @@ softdep_prelink(dvp, vp)
ffs_syncvnode(dvp, MNT_WAIT);
ACQUIRE_LOCK(&lk);
/* Process vp before dvp as it may create .. removes. */
- if (vp)
+ if (vp) {
process_removes(vp);
+ process_truncates(vp);
+ }
process_removes(dvp);
+ process_truncates(dvp);
softdep_speedup();
- process_worklist_item(UFSTOVFS(ump), LK_NOWAIT);
- process_worklist_item(UFSTOVFS(ump), LK_NOWAIT);
+ process_worklist_item(UFSTOVFS(ump), 2, LK_NOWAIT);
if (journal_space(ump, 0) == 0) {
softdep_speedup();
if (journal_space(ump, 1) == 0)
@@ -2717,7 +2993,7 @@ jfreeblk_write(jfreeblk, jseg, data)
{
struct jblkrec *rec;
- jfreeblk->jf_jsegdep->jd_seg = jseg;
+ jfreeblk->jf_dep.jb_jsegdep->jd_seg = jseg;
rec = (struct jblkrec *)data;
rec->jb_op = JOP_FREEBLK;
rec->jb_ino = jfreeblk->jf_ino;
@@ -2753,6 +3029,7 @@ jtrunc_write(jtrunc, jseg, data)
{
struct jtrncrec *rec;
+ jtrunc->jt_dep.jb_jsegdep->jd_seg = jseg;
rec = (struct jtrncrec *)data;
rec->jt_op = JOP_TRUNC;
rec->jt_ino = jtrunc->jt_ino;
@@ -2760,6 +3037,40 @@ jtrunc_write(jtrunc, jseg, data)
rec->jt_extsize = jtrunc->jt_extsize;
}
+static void
+jfsync_write(jfsync, jseg, data)
+ struct jfsync *jfsync;
+ struct jseg *jseg;
+ uint8_t *data;
+{
+ struct jtrncrec *rec;
+
+ rec = (struct jtrncrec *)data;
+ rec->jt_op = JOP_SYNC;
+ rec->jt_ino = jfsync->jfs_ino;
+ rec->jt_size = jfsync->jfs_size;
+ rec->jt_extsize = jfsync->jfs_extsize;
+}
+
+static void
+softdep_flushjournal(mp)
+ struct mount *mp;
+{
+ struct jblocks *jblocks;
+ struct ufsmount *ump;
+
+ if ((mp->mnt_kern_flag & MNTK_SUJ) == 0)
+ return;
+ ump = VFSTOUFS(mp);
+ jblocks = ump->softdep_jblocks;
+ ACQUIRE_LOCK(&lk);
+ while (ump->softdep_on_journal) {
+ jblocks->jb_needseg = 1;
+ softdep_process_journal(mp, NULL, MNT_WAIT);
+ }
+ FREE_LOCK(&lk);
+}
+
/*
* Flush some journal records to disk.
*/
@@ -2909,7 +3220,7 @@ softdep_process_journal(mp, needwk, flags)
if (wk == needwk)
needwk = NULL;
remove_from_journal(wk);
- wk->wk_state |= IOSTARTED;
+ wk->wk_state |= INPROGRESS;
WORKLIST_INSERT(&jseg->js_entries, wk);
switch (wk->wk_type) {
case D_JADDREF:
@@ -2933,6 +3244,9 @@ softdep_process_journal(mp, needwk, flags)
case D_JTRUNC:
jtrunc_write(WK_JTRUNC(wk), jseg, data);
break;
+ case D_JFSYNC:
+ jfsync_write(WK_JFSYNC(wk), jseg, data);
+ break;
default:
panic("process_journal: Unknown type %s",
TYPENAME(wk->wk_type));
@@ -2956,7 +3270,7 @@ softdep_process_journal(mp, needwk, flags)
* We only do the blocking wait once we find the journal
* entry we're looking for.
*/
- if (needwk == NULL && flags & MNT_WAIT)
+ if (needwk == NULL && flags == MNT_WAIT)
bwrite(bp);
else
bawrite(bp);
@@ -2996,7 +3310,7 @@ complete_jseg(jseg)
while ((wk = LIST_FIRST(&jseg->js_entries)) != NULL) {
WORKLIST_REMOVE(wk);
waiting = wk->wk_state & IOWAITING;
- wk->wk_state &= ~(IOSTARTED | IOWAITING);
+ wk->wk_state &= ~(INPROGRESS | IOWAITING);
wk->wk_state |= COMPLETE;
KASSERT(i++ < jseg->js_cnt,
("handle_written_jseg: overflow %d >= %d",
@@ -3009,26 +3323,29 @@ complete_jseg(jseg)
handle_written_jremref(WK_JREMREF(wk));
break;
case D_JMVREF:
- /* No jsegdep here. */
- rele_jseg(jseg);
+ rele_jseg(jseg); /* No jsegdep. */
jmvref = WK_JMVREF(wk);
LIST_REMOVE(jmvref, jm_deps);
- free_pagedep(jmvref->jm_pagedep);
+ if ((jmvref->jm_pagedep->pd_state & ONWORKLIST) == 0)
+ free_pagedep(jmvref->jm_pagedep);
WORKITEM_FREE(jmvref, D_JMVREF);
break;
case D_JNEWBLK:
handle_written_jnewblk(WK_JNEWBLK(wk));
break;
case D_JFREEBLK:
- handle_written_jfreeblk(WK_JFREEBLK(wk));
+ handle_written_jblkdep(&WK_JFREEBLK(wk)->jf_dep);
+ break;
+ case D_JTRUNC:
+ handle_written_jblkdep(&WK_JTRUNC(wk)->jt_dep);
+ break;
+ case D_JFSYNC:
+ rele_jseg(jseg); /* No jsegdep. */
+ WORKITEM_FREE(wk, D_JFSYNC);
break;
case D_JFREEFRAG:
handle_written_jfreefrag(WK_JFREEFRAG(wk));
break;
- case D_JTRUNC:
- WK_JTRUNC(wk)->jt_jsegdep->jd_seg = jseg;
- WORKITEM_FREE(wk, D_JTRUNC);
- break;
default:
panic("handle_written_jseg: Unknown type %s",
TYPENAME(wk->wk_type));
@@ -3123,7 +3440,7 @@ handle_written_jremref(jremref)
jremref->jr_dirrem = NULL;
LIST_REMOVE(jremref, jr_deps);
jsegdep->jd_state |= jremref->jr_state & MKDIR_PARENT;
- WORKLIST_INSERT(&dirrem->dm_jwork, &jsegdep->jd_list);
+ jwork_insert(&dirrem->dm_jwork, jsegdep);
if (LIST_EMPTY(&dirrem->dm_jremrefhd) &&
(dirrem->dm_state & COMPLETE) != 0)
add_to_worklist(&dirrem->dm_list, 0);
@@ -3183,7 +3500,7 @@ handle_written_jaddref(jaddref)
mkdir->md_state |= DEPCOMPLETE;
complete_mkdir(mkdir);
}
- WORKLIST_INSERT(&diradd->da_jwork, &jsegdep->jd_list);
+ jwork_insert(&diradd->da_jwork, jsegdep);
if (jaddref->ja_state & NEWBLOCK) {
inodedep->id_state |= ONDEPLIST;
LIST_INSERT_HEAD(&inodedep->id_bmsafemap->sm_inodedephd,
@@ -3205,10 +3522,9 @@ handle_written_jnewblk(jnewblk)
{
struct bmsafemap *bmsafemap;
struct freefrag *freefrag;
+ struct freework *freework;
struct jsegdep *jsegdep;
struct newblk *newblk;
- struct freework *freework;
- struct indirdep *indirdep;
/* Grab the jsegdep. */
jsegdep = jnewblk->jn_jsegdep;
@@ -3225,10 +3541,13 @@ handle_written_jnewblk(jnewblk)
*/
newblk = WK_NEWBLK(jnewblk->jn_dep);
newblk->nb_jnewblk = NULL;
- bmsafemap = newblk->nb_bmsafemap;
- newblk->nb_state |= ONDEPLIST;
- LIST_INSERT_HEAD(&bmsafemap->sm_newblkhd, newblk, nb_deps);
- WORKLIST_INSERT(&newblk->nb_jwork, &jsegdep->jd_list);
+ if ((newblk->nb_state & GOINGAWAY) == 0) {
+ bmsafemap = newblk->nb_bmsafemap;
+ newblk->nb_state |= ONDEPLIST;
+ LIST_INSERT_HEAD(&bmsafemap->sm_newblkhd, newblk,
+ nb_deps);
+ }
+ jwork_insert(&newblk->nb_jwork, jsegdep);
break;
case D_FREEFRAG:
/*
@@ -3245,15 +3564,8 @@ handle_written_jnewblk(jnewblk)
*/
freework = WK_FREEWORK(jnewblk->jn_dep);
freework->fw_jnewblk = NULL;
- WORKLIST_INSERT(&freework->fw_jwork, &jsegdep->jd_list);
- break;
- case D_INDIRDEP:
- /*
- * An indirect block was removed by truncate.
- */
- indirdep = WK_INDIRDEP(jnewblk->jn_dep);
- LIST_REMOVE(jnewblk, jn_indirdeps);
- WORKLIST_INSERT(&indirdep->ir_jwork, &jsegdep->jd_list);
+ WORKLIST_INSERT(&freework->fw_freeblks->fb_jwork,
+ &jsegdep->jd_list);
break;
default:
panic("handle_written_jnewblk: Unknown type %d.",
@@ -3293,7 +3605,7 @@ free_jfreefrag(jfreefrag)
struct jfreefrag *jfreefrag;
{
- if (jfreefrag->fr_state & IOSTARTED)
+ if (jfreefrag->fr_state & INPROGRESS)
WORKLIST_REMOVE(&jfreefrag->fr_list);
else if (jfreefrag->fr_state & ONWORKLIST)
remove_from_journal(&jfreefrag->fr_list);
@@ -3321,7 +3633,7 @@ handle_written_jfreefrag(jfreefrag)
panic("handle_written_jfreefrag: No freefrag.");
freefrag->ff_state |= DEPCOMPLETE;
freefrag->ff_jdep = NULL;
- WORKLIST_INSERT(&freefrag->ff_jwork, &jsegdep->jd_list);
+ jwork_insert(&freefrag->ff_jwork, jsegdep);
if ((freefrag->ff_state & ALLCOMPLETE) == ALLCOMPLETE)
add_to_worklist(&freefrag->ff_list, 0);
jfreefrag->fr_freefrag = NULL;
@@ -3335,30 +3647,26 @@ handle_written_jfreefrag(jfreefrag)
* have been reclaimed.
*/
static void
-handle_written_jfreeblk(jfreeblk)
- struct jfreeblk *jfreeblk;
+handle_written_jblkdep(jblkdep)
+ struct jblkdep *jblkdep;
{
struct freeblks *freeblks;
struct jsegdep *jsegdep;
/* Grab the jsegdep. */
- jsegdep = jfreeblk->jf_jsegdep;
- jfreeblk->jf_jsegdep = NULL;
- freeblks = jfreeblk->jf_freeblks;
- LIST_REMOVE(jfreeblk, jf_deps);
+ jsegdep = jblkdep->jb_jsegdep;
+ jblkdep->jb_jsegdep = NULL;
+ freeblks = jblkdep->jb_freeblks;
+ LIST_REMOVE(jblkdep, jb_deps);
WORKLIST_INSERT(&freeblks->fb_jwork, &jsegdep->jd_list);
/*
* If the freeblks is all journaled, we can add it to the worklist.
*/
- if (LIST_EMPTY(&freeblks->fb_jfreeblkhd) &&
- (freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE) {
- /* Remove from the b_dep that is waiting on this write. */
- if (freeblks->fb_state & ONWORKLIST)
- WORKLIST_REMOVE(&freeblks->fb_list);
- add_to_worklist(&freeblks->fb_list, 1);
- }
+ if (LIST_EMPTY(&freeblks->fb_jblkdephd) &&
+ (freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE)
+ add_to_worklist(&freeblks->fb_list, WK_NODELAY);
- free_jfreeblk(jfreeblk);
+ free_jblkdep(jblkdep);
}
static struct jsegdep *
@@ -3480,9 +3788,12 @@ static void
free_freedep(freedep)
struct freedep *freedep;
{
+ struct freework *freework;
- if (--freedep->fd_freework->fw_ref == 0)
- add_to_worklist(&freedep->fd_freework->fw_list, 1);
+ freework = freedep->fd_freework;
+ freework->fw_freeblks->fb_cgwait--;
+ if (--freework->fw_ref == 0)
+ freework_enqueue(freework);
WORKITEM_FREE(freedep, D_FREEDEP);
}
@@ -3493,42 +3804,69 @@ free_freedep(freedep)
* is visible outside of softdep_setup_freeblocks().
*/
static struct freework *
-newfreework(ump, freeblks, parent, lbn, nb, frags, journal)
+newfreework(ump, freeblks, parent, lbn, nb, frags, off, journal)
struct ufsmount *ump;
struct freeblks *freeblks;
struct freework *parent;
ufs_lbn_t lbn;
ufs2_daddr_t nb;
int frags;
+ int off;
int journal;
{
struct freework *freework;
freework = malloc(sizeof(*freework), M_FREEWORK, M_SOFTDEP_FLAGS);
workitem_alloc(&freework->fw_list, D_FREEWORK, freeblks->fb_list.wk_mp);
+ freework->fw_state = ATTACHED;
freework->fw_jnewblk = NULL;
freework->fw_freeblks = freeblks;
freework->fw_parent = parent;
freework->fw_lbn = lbn;
freework->fw_blkno = nb;
freework->fw_frags = frags;
+ freework->fw_indir = NULL;
freework->fw_ref = ((UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ) == 0 ||
lbn >= -NXADDR) ? 0 : NINDIR(ump->um_fs) + 1;
- freework->fw_off = 0;
- LIST_INIT(&freework->fw_jwork);
-
+ freework->fw_start = freework->fw_off = off;
+ if (journal)
+ newjfreeblk(freeblks, lbn, nb, frags);
if (parent == NULL) {
- WORKLIST_INSERT_UNLOCKED(&freeblks->fb_freeworkhd,
- &freework->fw_list);
+ ACQUIRE_LOCK(&lk);
+ WORKLIST_INSERT(&freeblks->fb_freeworkhd, &freework->fw_list);
freeblks->fb_ref++;
+ FREE_LOCK(&lk);
}
- if (journal)
- newjfreeblk(freeblks, lbn, nb, frags);
return (freework);
}
/*
+ * Eliminate a jfreeblk for a block that does not need journaling.
+ */
+static void
+cancel_jfreeblk(freeblks, blkno)
+ struct freeblks *freeblks;
+ ufs2_daddr_t blkno;
+{
+ struct jfreeblk *jfreeblk;
+ struct jblkdep *jblkdep;
+
+ LIST_FOREACH(jblkdep, &freeblks->fb_jblkdephd, jb_deps) {
+ if (jblkdep->jb_list.wk_type != D_JFREEBLK)
+ continue;
+ jfreeblk = WK_JFREEBLK(&jblkdep->jb_list);
+ if (jfreeblk->jf_blkno == blkno)
+ break;
+ }
+ if (jblkdep == NULL)
+ return;
+ free_jsegdep(jblkdep->jb_jsegdep);
+ LIST_REMOVE(jblkdep, jb_deps);
+ WORKITEM_FREE(jfreeblk, D_JFREEBLK);
+}
+
+/*
* Allocate a new jfreeblk to journal top level block pointer when truncating
* a file. The caller must add this to the worklist when lk is held.
*/
@@ -3542,20 +3880,43 @@ newjfreeblk(freeblks, lbn, blkno, frags)
struct jfreeblk *jfreeblk;
jfreeblk = malloc(sizeof(*jfreeblk), M_JFREEBLK, M_SOFTDEP_FLAGS);
- workitem_alloc(&jfreeblk->jf_list, D_JFREEBLK, freeblks->fb_list.wk_mp);
- jfreeblk->jf_jsegdep = newjsegdep(&jfreeblk->jf_list);
- jfreeblk->jf_state = ATTACHED | DEPCOMPLETE;
- jfreeblk->jf_ino = freeblks->fb_previousinum;
+ workitem_alloc(&jfreeblk->jf_dep.jb_list, D_JFREEBLK,
+ freeblks->fb_list.wk_mp);
+ jfreeblk->jf_dep.jb_jsegdep = newjsegdep(&jfreeblk->jf_dep.jb_list);
+ jfreeblk->jf_dep.jb_freeblks = freeblks;
+ jfreeblk->jf_ino = freeblks->fb_inum;
jfreeblk->jf_lbn = lbn;
jfreeblk->jf_blkno = blkno;
jfreeblk->jf_frags = frags;
- jfreeblk->jf_freeblks = freeblks;
- LIST_INSERT_HEAD(&freeblks->fb_jfreeblkhd, jfreeblk, jf_deps);
+ LIST_INSERT_HEAD(&freeblks->fb_jblkdephd, &jfreeblk->jf_dep, jb_deps);
return (jfreeblk);
}
-static void move_newblock_dep(struct jaddref *, struct inodedep *);
+/*
+ * Allocate a new jtrunc to track a partial truncation.
+ */
+static struct jtrunc *
+newjtrunc(freeblks, size, extsize)
+ struct freeblks *freeblks;
+ off_t size;
+ int extsize;
+{
+ struct jtrunc *jtrunc;
+
+ jtrunc = malloc(sizeof(*jtrunc), M_JTRUNC, M_SOFTDEP_FLAGS);
+ workitem_alloc(&jtrunc->jt_dep.jb_list, D_JTRUNC,
+ freeblks->fb_list.wk_mp);
+ jtrunc->jt_dep.jb_jsegdep = newjsegdep(&jtrunc->jt_dep.jb_list);
+ jtrunc->jt_dep.jb_freeblks = freeblks;
+ jtrunc->jt_ino = freeblks->fb_inum;
+ jtrunc->jt_size = size;
+ jtrunc->jt_extsize = extsize;
+ LIST_INSERT_HEAD(&freeblks->fb_jblkdephd, &jtrunc->jt_dep, jb_deps);
+
+ return (jtrunc);
+}
+
/*
* If we're canceling a new bitmap we have to search for another ref
* to move into the bmsafemap dep. This might be better expressed
@@ -3613,7 +3974,7 @@ cancel_jaddref(jaddref, inodedep, wkhd)
KASSERT((jaddref->ja_state & COMPLETE) == 0,
("cancel_jaddref: Canceling complete jaddref"));
- if (jaddref->ja_state & (IOSTARTED | COMPLETE))
+ if (jaddref->ja_state & (INPROGRESS | COMPLETE))
needsj = 1;
else
needsj = 0;
@@ -3637,15 +3998,12 @@ cancel_jaddref(jaddref, inodedep, wkhd)
jsegdep = inoref_jseg(&jaddref->ja_ref);
if (jaddref->ja_state & NEWBLOCK)
move_newblock_dep(jaddref, inodedep);
- if (jaddref->ja_state & IOWAITING) {
- jaddref->ja_state &= ~IOWAITING;
- wakeup(&jaddref->ja_list);
- }
+ wake_worklist(&jaddref->ja_list);
jaddref->ja_mkdir = NULL;
- if (jaddref->ja_state & IOSTARTED) {
- jaddref->ja_state &= ~IOSTARTED;
+ if (jaddref->ja_state & INPROGRESS) {
+ jaddref->ja_state &= ~INPROGRESS;
WORKLIST_REMOVE(&jaddref->ja_list);
- WORKLIST_INSERT(wkhd, &jsegdep->jd_list);
+ jwork_insert(wkhd, jsegdep);
} else {
free_jsegdep(jsegdep);
if (jaddref->ja_state & DEPCOMPLETE)
@@ -3694,7 +4052,7 @@ free_jaddref(jaddref)
jaddref, jaddref->ja_state);
if (jaddref->ja_state & NEWBLOCK)
LIST_REMOVE(jaddref, ja_bmdeps);
- if (jaddref->ja_state & (IOSTARTED | ONWORKLIST))
+ if (jaddref->ja_state & (INPROGRESS | ONWORKLIST))
panic("free_jaddref: Bad state %p(0x%X)",
jaddref, jaddref->ja_state);
if (jaddref->ja_mkdir != NULL)
@@ -3712,7 +4070,7 @@ free_jremref(jremref)
if (jremref->jr_ref.if_jsegdep)
free_jsegdep(jremref->jr_ref.if_jsegdep);
- if (jremref->jr_state & IOSTARTED)
+ if (jremref->jr_state & INPROGRESS)
panic("free_jremref: IO still pending");
WORKITEM_FREE(jremref, D_JREMREF);
}
@@ -3734,11 +4092,7 @@ free_jnewblk(jnewblk)
}
/*
- * Cancel a jnewblk which has been superseded by a freeblk. The jnewblk
- * is kept linked into the bmsafemap until the free completes, thus
- * preventing the modified state from ever reaching disk. The free
- * routine must pass this structure via ffs_blkfree() to
- * softdep_setup_freeblks() so there is no race in releasing the space.
+ * Cancel a jnewblk which has been been made redundant by frag extension.
*/
static void
cancel_jnewblk(jnewblk, wkhd)
@@ -3753,27 +4107,30 @@ cancel_jnewblk(jnewblk, wkhd)
jnewblk->jn_jsegdep = NULL;
jnewblk->jn_dep = NULL;
jnewblk->jn_state |= GOINGAWAY;
- if (jnewblk->jn_state & IOSTARTED) {
- jnewblk->jn_state &= ~IOSTARTED;
+ if (jnewblk->jn_state & INPROGRESS) {
+ jnewblk->jn_state &= ~INPROGRESS;
WORKLIST_REMOVE(&jnewblk->jn_list);
- WORKLIST_INSERT(wkhd, &jsegdep->jd_list);
+ jwork_insert(wkhd, jsegdep);
} else {
free_jsegdep(jsegdep);
remove_from_journal(&jnewblk->jn_list);
}
- if (jnewblk->jn_state & IOWAITING) {
- jnewblk->jn_state &= ~IOWAITING;
- wakeup(&jnewblk->jn_list);
- }
+ wake_worklist(&jnewblk->jn_list);
WORKLIST_INSERT(wkhd, &jnewblk->jn_list);
}
static void
-free_jfreeblk(jfreeblk)
- struct jfreeblk *jfreeblk;
+free_jblkdep(jblkdep)
+ struct jblkdep *jblkdep;
{
- WORKITEM_FREE(jfreeblk, D_JFREEBLK);
+ if (jblkdep->jb_list.wk_type == D_JFREEBLK)
+ WORKITEM_FREE(jblkdep, D_JFREEBLK);
+ else if (jblkdep->jb_list.wk_type == D_JTRUNC)
+ WORKITEM_FREE(jblkdep, D_JTRUNC);
+ else
+ panic("free_jblkdep: Unexpected type %s",
+ TYPENAME(jblkdep->jb_list.wk_type));
}
/*
@@ -3792,11 +4149,8 @@ free_jseg(jseg, jblocks)
* Free freework structures that were lingering to indicate freed
* indirect blocks that forced journal write ordering on reallocate.
*/
- while ((freework = LIST_FIRST(&jseg->js_indirs)) != NULL) {
- LIST_REMOVE(freework, fw_next);
- WORKLIST_REMOVE(&freework->fw_list);
- WORKITEM_FREE(freework, D_FREEWORK);
- }
+ while ((freework = LIST_FIRST(&jseg->js_indirs)) != NULL)
+ indirblk_remove(freework);
if (jblocks->jb_oldestseg == jseg)
jblocks->jb_oldestseg = TAILQ_NEXT(jseg, js_next);
TAILQ_REMOVE(&jblocks->jb_segs, jseg, js_next);
@@ -3887,24 +4241,53 @@ free_jsegdep(jsegdep)
* Wait for a journal item to make it to disk. Initiate journal processing
* if required.
*/
-static void
-jwait(wk)
+static int
+jwait(wk, waitfor)
struct worklist *wk;
+ int waitfor;
{
- stat_journal_wait++;
+ /*
+ * Blocking journal waits cause slow synchronous behavior. Record
+ * stats on the frequency of these blocking operations.
+ */
+ if (waitfor == MNT_WAIT) {
+ stat_journal_wait++;
+ switch (wk->wk_type) {
+ case D_JREMREF:
+ case D_JMVREF:
+ stat_jwait_filepage++;
+ break;
+ case D_JTRUNC:
+ case D_JFREEBLK:
+ stat_jwait_freeblks++;
+ break;
+ case D_JNEWBLK:
+ stat_jwait_newblk++;
+ break;
+ case D_JADDREF:
+ stat_jwait_inode++;
+ break;
+ default:
+ break;
+ }
+ }
/*
* If IO has not started we process the journal. We can't mark the
* worklist item as IOWAITING because we drop the lock while
* processing the journal and the worklist entry may be freed after
* this point. The caller may call back in and re-issue the request.
*/
- if ((wk->wk_state & IOSTARTED) == 0) {
- softdep_process_journal(wk->wk_mp, wk, MNT_WAIT);
- return;
+ if ((wk->wk_state & INPROGRESS) == 0) {
+ softdep_process_journal(wk->wk_mp, wk, waitfor);
+ if (waitfor != MNT_WAIT)
+ return (EBUSY);
+ return (0);
}
- wk->wk_state |= IOWAITING;
- msleep(wk, &lk, PRIBIO, "jwait", 0);
+ if (waitfor != MNT_WAIT)
+ return (EBUSY);
+ wait_worklist(wk, "jwait");
+ return (0);
}
/*
@@ -3928,68 +4311,6 @@ inodedep_lookup_ip(ip)
}
/*
- * Create a journal entry that describes a truncate that we're about to
- * perform. The inode allocations and frees between here and the completion
- * of the operation are done asynchronously and without journaling. At
- * the end of the operation the vnode is sync'd and the journal space
- * is released. Recovery will discover the partially completed truncate
- * and complete it.
- */
-void *
-softdep_setup_trunc(vp, length, flags)
- struct vnode *vp;
- off_t length;
- int flags;
-{
- struct jsegdep *jsegdep;
- struct jtrunc *jtrunc;
- struct ufsmount *ump;
- struct inode *ip;
-
- softdep_prealloc(vp, MNT_WAIT);
- ip = VTOI(vp);
- ump = VFSTOUFS(vp->v_mount);
- jtrunc = malloc(sizeof(*jtrunc), M_JTRUNC, M_SOFTDEP_FLAGS);
- workitem_alloc(&jtrunc->jt_list, D_JTRUNC, vp->v_mount);
- jsegdep = jtrunc->jt_jsegdep = newjsegdep(&jtrunc->jt_list);
- jtrunc->jt_ino = ip->i_number;
- jtrunc->jt_extsize = 0;
- jtrunc->jt_size = length;
- if ((flags & IO_EXT) == 0 && ump->um_fstype == UFS2)
- jtrunc->jt_extsize = ip->i_din2->di_extsize;
- if ((flags & IO_NORMAL) == 0)
- jtrunc->jt_size = DIP(ip, i_size);
- ACQUIRE_LOCK(&lk);
- add_to_journal(&jtrunc->jt_list);
- while (jsegdep->jd_seg == NULL) {
- stat_jwait_freeblks++;
- jwait(&jtrunc->jt_list);
- }
- FREE_LOCK(&lk);
-
- return (jsegdep);
-}
-
-/*
- * After synchronous truncation is complete we free sync the vnode and
- * release the jsegdep so the journal space can be freed.
- */
-int
-softdep_complete_trunc(vp, cookie)
- struct vnode *vp;
- void *cookie;
-{
- int error;
-
- error = ffs_syncvnode(vp, MNT_WAIT);
- ACQUIRE_LOCK(&lk);
- free_jsegdep((struct jsegdep *)cookie);
- FREE_LOCK(&lk);
-
- return (error);
-}
-
-/*
* Called prior to creating a new inode and linking it to a directory. The
* jaddref structure must already be allocated by softdep_setup_inomapdep
* and it is discovered here so we can initialize the mode and update
@@ -4014,7 +4335,6 @@ softdep_setup_create(dp, ip)
inoreflst);
KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number,
("softdep_setup_create: No addref structure present."));
- jaddref->ja_mode = ip->i_mode;
}
softdep_prelink(dvp, NULL);
FREE_LOCK(&lk);
@@ -4121,7 +4441,6 @@ softdep_setup_mkdir(dp, ip)
KASSERT(jaddref->ja_parent == dp->i_number,
("softdep_setup_mkdir: bad parent %d",
jaddref->ja_parent));
- jaddref->ja_mode = ip->i_mode;
TAILQ_INSERT_BEFORE(&jaddref->ja_ref, &dotaddref->ja_ref,
if_deps);
}
@@ -4341,10 +4660,11 @@ softdep_revert_rmdir(dp, ip)
* Called just after updating the cylinder group block to allocate an inode.
*/
void
-softdep_setup_inomapdep(bp, ip, newinum)
+softdep_setup_inomapdep(bp, ip, newinum, mode)
struct buf *bp; /* buffer for cylgroup block with inode map */
struct inode *ip; /* inode related to allocation */
ino_t newinum; /* new inode number being allocated */
+ int mode;
{
struct inodedep *inodedep;
struct bmsafemap *bmsafemap;
@@ -4361,7 +4681,7 @@ softdep_setup_inomapdep(bp, ip, newinum)
* can be dependent on it.
*/
if (mp->mnt_kern_flag & MNTK_SUJ) {
- jaddref = newjaddref(ip, newinum, 0, 0, 0);
+ jaddref = newjaddref(ip, newinum, 0, 0, mode);
jaddref->ja_state |= NEWBLOCK;
}
@@ -4523,6 +4843,8 @@ bmsafemap_lookup(mp, bp, cg)
LIST_INIT(&bmsafemap->sm_newblkwr);
LIST_INIT(&bmsafemap->sm_jaddrefhd);
LIST_INIT(&bmsafemap->sm_jnewblkhd);
+ LIST_INIT(&bmsafemap->sm_freehd);
+ LIST_INIT(&bmsafemap->sm_freewr);
ACQUIRE_LOCK(&lk);
if (bmsafemap_find(bmsafemaphd, mp, cg, &collision) == 1) {
WORKITEM_FREE(bmsafemap, D_BMSAFEMAP);
@@ -4530,6 +4852,7 @@ bmsafemap_lookup(mp, bp, cg)
}
bmsafemap->sm_cg = cg;
LIST_INSERT_HEAD(bmsafemaphd, bmsafemap, sm_hash);
+ LIST_INSERT_HEAD(&VFSTOUFS(mp)->softdep_dirtycg, bmsafemap, sm_next);
WORKLIST_INSERT(&bp->b_dep, &bmsafemap->sm_list);
return (bmsafemap);
}
@@ -4609,10 +4932,9 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
* allocate an associated pagedep to track additions and
* deletions.
*/
- if ((ip->i_mode & IFMT) == IFDIR &&
- pagedep_lookup(mp, ip->i_number, off, DEPALLOC,
- &pagedep) == 0)
- WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list);
+ if ((ip->i_mode & IFMT) == IFDIR)
+ pagedep_lookup(mp, bp, ip->i_number, off, DEPALLOC,
+ &pagedep);
}
if (newblk_lookup(mp, newblkno, 0, &newblk) == 0)
panic("softdep_setup_allocdirect: lost block");
@@ -4716,14 +5038,12 @@ jnewblk_merge(new, old, wkhd)
if (jnewblk->jn_blkno != njnewblk->jn_blkno)
panic("jnewblk_merge: Merging disparate blocks.");
/*
- * The record may be rolled back in the cg update bits
- * appropriately. NEWBLOCK here alerts the cg rollback code
- * that the frag bits have changed.
+ * The record may be rolled back in the cg.
*/
if (jnewblk->jn_state & UNDONE) {
- njnewblk->jn_state |= UNDONE | NEWBLOCK;
- njnewblk->jn_state &= ~ATTACHED;
jnewblk->jn_state &= ~UNDONE;
+ njnewblk->jn_state |= UNDONE;
+ njnewblk->jn_state &= ~ATTACHED;
}
/*
* We modify the newer addref and free the older so that if neither
@@ -4751,7 +5071,6 @@ allocdirect_merge(adphead, newadp, oldadp)
{
struct worklist *wk;
struct freefrag *freefrag;
- struct newdirblk *newdirblk;
freefrag = NULL;
mtx_assert(&lk, MA_OWNED);
@@ -4791,11 +5110,10 @@ allocdirect_merge(adphead, newadp, oldadp)
* move it from the old allocdirect to the new allocdirect.
*/
if ((wk = LIST_FIRST(&oldadp->ad_newdirblk)) != NULL) {
- newdirblk = WK_NEWDIRBLK(wk);
- WORKLIST_REMOVE(&newdirblk->db_list);
+ WORKLIST_REMOVE(wk);
if (!LIST_EMPTY(&oldadp->ad_newdirblk))
panic("allocdirect_merge: extra newdirblk");
- WORKLIST_INSERT(&newadp->ad_newdirblk, &newdirblk->db_list);
+ WORKLIST_INSERT(&newadp->ad_newdirblk, wk);
}
TAILQ_REMOVE(adphead, oldadp, ad_next);
/*
@@ -4814,9 +5132,8 @@ allocdirect_merge(adphead, newadp, oldadp)
&oldadp->ad_block.nb_jnewblk->jn_list,
&newadp->ad_block.nb_jwork);
oldadp->ad_block.nb_jnewblk = NULL;
- if (cancel_newblk(&oldadp->ad_block, NULL,
- &newadp->ad_block.nb_jwork))
- panic("allocdirect_merge: Unexpected dependency.");
+ cancel_newblk(&oldadp->ad_block, NULL,
+ &newadp->ad_block.nb_jwork);
} else {
wk = (struct worklist *) cancel_newblk(&oldadp->ad_block,
&freefrag->ff_list, &freefrag->ff_jwork);
@@ -4877,6 +5194,7 @@ newfreefrag(ip, blkno, size, lbn)
freefrag->ff_state = ATTACHED;
LIST_INIT(&freefrag->ff_jwork);
freefrag->ff_inum = ip->i_number;
+ freefrag->ff_vtype = ITOV(ip)->v_type;
freefrag->ff_blkno = blkno;
freefrag->ff_fragsize = size;
@@ -4921,7 +5239,7 @@ handle_workitem_freefrag(freefrag)
}
FREE_LOCK(&lk);
ffs_blkfree(ump, ump->um_fs, ump->um_devvp, freefrag->ff_blkno,
- freefrag->ff_fragsize, freefrag->ff_inum, &wkhd);
+ freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd);
ACQUIRE_LOCK(&lk);
WORKITEM_FREE(freefrag, D_FREEFRAG);
FREE_LOCK(&lk);
@@ -5084,6 +5402,7 @@ newallocindir(ip, ptrno, newblkno, oldblkno, lbn)
aip = (struct allocindir *)newblk;
aip->ai_offset = ptrno;
aip->ai_oldblkno = oldblkno;
+ aip->ai_lbn = lbn;
if ((jnewblk = newblk->nb_jnewblk) != NULL) {
jnewblk->jn_ino = ip->i_number;
jnewblk->jn_lbn = lbn;
@@ -5110,6 +5429,7 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp)
struct buf *nbp; /* buffer holding allocated page */
{
struct inodedep *inodedep;
+ struct freefrag *freefrag;
struct allocindir *aip;
struct pagedep *pagedep;
struct mount *mp;
@@ -5126,12 +5446,13 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp)
* allocate an associated pagedep to track additions and
* deletions.
*/
- if ((ip->i_mode & IFMT) == IFDIR &&
- pagedep_lookup(mp, ip->i_number, lbn, DEPALLOC, &pagedep) == 0)
- WORKLIST_INSERT(&nbp->b_dep, &pagedep->pd_list);
+ if ((ip->i_mode & IFMT) == IFDIR)
+ pagedep_lookup(mp, nbp, ip->i_number, lbn, DEPALLOC, &pagedep);
WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list);
- setup_allocindir_phase2(bp, ip, inodedep, aip, lbn);
+ freefrag = setup_allocindir_phase2(bp, ip, inodedep, aip, lbn);
FREE_LOCK(&lk);
+ if (freefrag)
+ handle_workitem_freefrag(freefrag);
}
/*
@@ -5155,7 +5476,8 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
aip = newallocindir(ip, ptrno, newblkno, 0, lbn);
inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC, &inodedep);
WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list);
- setup_allocindir_phase2(bp, ip, inodedep, aip, lbn);
+ if (setup_allocindir_phase2(bp, ip, inodedep, aip, lbn))
+ panic("softdep_setup_allocindir_meta: Block already existed");
FREE_LOCK(&lk);
}
@@ -5166,7 +5488,7 @@ indirdep_complete(indirdep)
struct allocindir *aip;
LIST_REMOVE(indirdep, ir_next);
- indirdep->ir_state &= ~ONDEPLIST;
+ indirdep->ir_state |= DEPCOMPLETE;
while ((aip = LIST_FIRST(&indirdep->ir_completehd)) != NULL) {
LIST_REMOVE(aip, ai_next);
@@ -5181,124 +5503,131 @@ indirdep_complete(indirdep)
free_indirdep(indirdep);
}
-/*
- * Called to finish the allocation of the "aip" allocated
- * by one of the two routines above.
- */
-static void
-setup_allocindir_phase2(bp, ip, inodedep, aip, lbn)
- struct buf *bp; /* in-memory copy of the indirect block */
- struct inode *ip; /* inode for file being extended */
- struct inodedep *inodedep; /* Inodedep for ip */
- struct allocindir *aip; /* allocindir allocated by the above routines */
- ufs_lbn_t lbn; /* Logical block number for this block. */
+static struct indirdep *
+indirdep_lookup(mp, ip, bp)
+ struct mount *mp;
+ struct inode *ip;
+ struct buf *bp;
{
+ struct indirdep *indirdep, *newindirdep;
+ struct newblk *newblk;
struct worklist *wk;
struct fs *fs;
- struct newblk *newblk;
- struct indirdep *indirdep, *newindirdep;
- struct allocindir *oldaip;
- struct freefrag *freefrag;
- struct mount *mp;
ufs2_daddr_t blkno;
- mp = UFSTOVFS(ip->i_ump);
- fs = ip->i_fs;
mtx_assert(&lk, MA_OWNED);
- if (bp->b_lblkno >= 0)
- panic("setup_allocindir_phase2: not indir blk");
- for (freefrag = NULL, indirdep = NULL, newindirdep = NULL; ; ) {
+ indirdep = NULL;
+ newindirdep = NULL;
+ fs = ip->i_fs;
+ for (;;) {
LIST_FOREACH(wk, &bp->b_dep, wk_list) {
if (wk->wk_type != D_INDIRDEP)
continue;
indirdep = WK_INDIRDEP(wk);
break;
}
- if (indirdep == NULL && newindirdep) {
- indirdep = newindirdep;
- newindirdep = NULL;
- WORKLIST_INSERT(&bp->b_dep, &indirdep->ir_list);
- if (newblk_lookup(mp, dbtofsb(fs, bp->b_blkno), 0,
- &newblk)) {
- indirdep->ir_state |= ONDEPLIST;
- LIST_INSERT_HEAD(&newblk->nb_indirdeps,
- indirdep, ir_next);
- } else
- indirdep->ir_state |= DEPCOMPLETE;
- }
- if (indirdep) {
- aip->ai_indirdep = indirdep;
- /*
- * Check to see if there is an existing dependency
- * for this block. If there is, merge the old
- * dependency into the new one. This happens
- * as a result of reallocblk only.
- */
- if (aip->ai_oldblkno == 0)
- oldaip = NULL;
- else
-
- LIST_FOREACH(oldaip, &indirdep->ir_deplisthd,
- ai_next)
- if (oldaip->ai_offset == aip->ai_offset)
- break;
- if (oldaip != NULL)
- freefrag = allocindir_merge(aip, oldaip);
- LIST_INSERT_HEAD(&indirdep->ir_deplisthd, aip, ai_next);
- KASSERT(aip->ai_offset >= 0 &&
- aip->ai_offset < NINDIR(ip->i_ump->um_fs),
- ("setup_allocindir_phase2: Bad offset %d",
- aip->ai_offset));
- KASSERT(indirdep->ir_savebp != NULL,
- ("setup_allocindir_phase2 NULL ir_savebp"));
- if (ip->i_ump->um_fstype == UFS1)
- ((ufs1_daddr_t *)indirdep->ir_savebp->b_data)
- [aip->ai_offset] = aip->ai_oldblkno;
- else
- ((ufs2_daddr_t *)indirdep->ir_savebp->b_data)
- [aip->ai_offset] = aip->ai_oldblkno;
- FREE_LOCK(&lk);
- if (freefrag != NULL)
- handle_workitem_freefrag(freefrag);
- } else
- FREE_LOCK(&lk);
- if (newindirdep) {
- newindirdep->ir_savebp->b_flags |= B_INVAL | B_NOCACHE;
- brelse(newindirdep->ir_savebp);
- ACQUIRE_LOCK(&lk);
- WORKITEM_FREE((caddr_t)newindirdep, D_INDIRDEP);
- if (indirdep)
- break;
- FREE_LOCK(&lk);
- }
- if (indirdep) {
- ACQUIRE_LOCK(&lk);
+ /* Found on the buffer worklist, no new structure to free. */
+ if (indirdep != NULL && newindirdep == NULL)
+ return (indirdep);
+ if (indirdep != NULL && newindirdep != NULL)
+ panic("indirdep_lookup: simultaneous create");
+ /* None found on the buffer and a new structure is ready. */
+ if (indirdep == NULL && newindirdep != NULL)
break;
- }
+ /* None found and no new structure available. */
+ FREE_LOCK(&lk);
newindirdep = malloc(sizeof(struct indirdep),
- M_INDIRDEP, M_SOFTDEP_FLAGS);
+ M_INDIRDEP, M_SOFTDEP_FLAGS);
workitem_alloc(&newindirdep->ir_list, D_INDIRDEP, mp);
newindirdep->ir_state = ATTACHED;
if (ip->i_ump->um_fstype == UFS1)
newindirdep->ir_state |= UFS1FMT;
+ TAILQ_INIT(&newindirdep->ir_trunc);
newindirdep->ir_saveddata = NULL;
LIST_INIT(&newindirdep->ir_deplisthd);
LIST_INIT(&newindirdep->ir_donehd);
LIST_INIT(&newindirdep->ir_writehd);
LIST_INIT(&newindirdep->ir_completehd);
- LIST_INIT(&newindirdep->ir_jwork);
- LIST_INIT(&newindirdep->ir_jnewblkhd);
if (bp->b_blkno == bp->b_lblkno) {
ufs_bmaparray(bp->b_vp, bp->b_lblkno, &blkno, bp,
NULL, NULL);
bp->b_blkno = blkno;
}
+ newindirdep->ir_freeblks = NULL;
newindirdep->ir_savebp =
getblk(ip->i_devvp, bp->b_blkno, bp->b_bcount, 0, 0, 0);
+ newindirdep->ir_bp = bp;
BUF_KERNPROC(newindirdep->ir_savebp);
bcopy(bp->b_data, newindirdep->ir_savebp->b_data, bp->b_bcount);
ACQUIRE_LOCK(&lk);
}
+ indirdep = newindirdep;
+ WORKLIST_INSERT(&bp->b_dep, &indirdep->ir_list);
+ /*
+ * If the block is not yet allocated we don't set DEPCOMPLETE so
+ * that we don't free dependencies until the pointers are valid.
+ * This could search b_dep for D_ALLOCDIRECT/D_ALLOCINDIR rather
+ * than using the hash.
+ */
+ if (newblk_lookup(mp, dbtofsb(fs, bp->b_blkno), 0, &newblk))
+ LIST_INSERT_HEAD(&newblk->nb_indirdeps, indirdep, ir_next);
+ else
+ indirdep->ir_state |= DEPCOMPLETE;
+ return (indirdep);
+}
+
+/*
+ * Called to finish the allocation of the "aip" allocated
+ * by one of the two routines above.
+ */
+static struct freefrag *
+setup_allocindir_phase2(bp, ip, inodedep, aip, lbn)
+ struct buf *bp; /* in-memory copy of the indirect block */
+ struct inode *ip; /* inode for file being extended */
+ struct inodedep *inodedep; /* Inodedep for ip */
+ struct allocindir *aip; /* allocindir allocated by the above routines */
+ ufs_lbn_t lbn; /* Logical block number for this block. */
+{
+ struct fs *fs;
+ struct indirdep *indirdep;
+ struct allocindir *oldaip;
+ struct freefrag *freefrag;
+ struct mount *mp;
+
+ mtx_assert(&lk, MA_OWNED);
+ mp = UFSTOVFS(ip->i_ump);
+ fs = ip->i_fs;
+ if (bp->b_lblkno >= 0)
+ panic("setup_allocindir_phase2: not indir blk");
+ KASSERT(aip->ai_offset >= 0 && aip->ai_offset < NINDIR(fs),
+ ("setup_allocindir_phase2: Bad offset %d", aip->ai_offset));
+ indirdep = indirdep_lookup(mp, ip, bp);
+ KASSERT(indirdep->ir_savebp != NULL,
+ ("setup_allocindir_phase2 NULL ir_savebp"));
+ aip->ai_indirdep = indirdep;
+ /*
+ * Check for an unwritten dependency for this indirect offset. If
+ * there is, merge the old dependency into the new one. This happens
+ * as a result of reallocblk only.
+ */
+ freefrag = NULL;
+ if (aip->ai_oldblkno != 0) {
+ LIST_FOREACH(oldaip, &indirdep->ir_deplisthd, ai_next) {
+ if (oldaip->ai_offset == aip->ai_offset) {
+ freefrag = allocindir_merge(aip, oldaip);
+ goto done;
+ }
+ }
+ LIST_FOREACH(oldaip, &indirdep->ir_donehd, ai_next) {
+ if (oldaip->ai_offset == aip->ai_offset) {
+ freefrag = allocindir_merge(aip, oldaip);
+ goto done;
+ }
+ }
+ }
+done:
+ LIST_INSERT_HEAD(&indirdep->ir_deplisthd, aip, ai_next);
+ return (freefrag);
}
/*
@@ -5310,7 +5639,6 @@ allocindir_merge(aip, oldaip)
struct allocindir *aip;
struct allocindir *oldaip;
{
- struct newdirblk *newdirblk;
struct freefrag *freefrag;
struct worklist *wk;
@@ -5326,11 +5654,10 @@ allocindir_merge(aip, oldaip)
* move it from the old allocindir to the new allocindir.
*/
if ((wk = LIST_FIRST(&oldaip->ai_newdirblk)) != NULL) {
- newdirblk = WK_NEWDIRBLK(wk);
- WORKLIST_REMOVE(&newdirblk->db_list);
+ WORKLIST_REMOVE(wk);
if (!LIST_EMPTY(&oldaip->ai_newdirblk))
panic("allocindir_merge: extra newdirblk");
- WORKLIST_INSERT(&aip->ai_newdirblk, &newdirblk->db_list);
+ WORKLIST_INSERT(&aip->ai_newdirblk, wk);
}
/*
* We can skip journaling for this freefrag and just complete
@@ -5363,7 +5690,7 @@ setup_freedirect(freeblks, ip, i, needj)
DIP_SET(ip, i_db[i], 0);
frags = sblksize(ip->i_fs, ip->i_size, i);
frags = numfrags(ip->i_fs, frags);
- newfreework(ip->i_ump, freeblks, NULL, i, blkno, frags, needj);
+ newfreework(ip->i_ump, freeblks, NULL, i, blkno, frags, 0, needj);
}
static inline void
@@ -5382,15 +5709,15 @@ setup_freeext(freeblks, ip, i, needj)
ip->i_din2->di_extb[i] = 0;
frags = sblksize(ip->i_fs, ip->i_din2->di_extsize, i);
frags = numfrags(ip->i_fs, frags);
- newfreework(ip->i_ump, freeblks, NULL, -1 - i, blkno, frags, needj);
+ newfreework(ip->i_ump, freeblks, NULL, -1 - i, blkno, frags, 0, needj);
}
static inline void
setup_freeindir(freeblks, ip, i, lbn, needj)
struct freeblks *freeblks;
struct inode *ip;
- ufs_lbn_t lbn;
int i;
+ ufs_lbn_t lbn;
int needj;
{
ufs2_daddr_t blkno;
@@ -5400,7 +5727,7 @@ setup_freeindir(freeblks, ip, i, lbn, needj)
return;
DIP_SET(ip, i_ib[i], 0);
newfreework(ip->i_ump, freeblks, NULL, lbn, blkno, ip->i_fs->fs_frag,
- needj);
+ 0, needj);
}
static inline struct freeblks *
@@ -5413,17 +5740,617 @@ newfreeblks(mp, ip)
freeblks = malloc(sizeof(struct freeblks),
M_FREEBLKS, M_SOFTDEP_FLAGS|M_ZERO);
workitem_alloc(&freeblks->fb_list, D_FREEBLKS, mp);
- LIST_INIT(&freeblks->fb_jfreeblkhd);
+ LIST_INIT(&freeblks->fb_jblkdephd);
LIST_INIT(&freeblks->fb_jwork);
+ freeblks->fb_ref = 0;
+ freeblks->fb_cgwait = 0;
freeblks->fb_state = ATTACHED;
freeblks->fb_uid = ip->i_uid;
- freeblks->fb_previousinum = ip->i_number;
+ freeblks->fb_inum = ip->i_number;
+ freeblks->fb_vtype = ITOV(ip)->v_type;
+ freeblks->fb_modrev = DIP(ip, i_modrev);
freeblks->fb_devvp = ip->i_devvp;
freeblks->fb_chkcnt = 0;
+ freeblks->fb_freecnt = 0;
+ freeblks->fb_len = 0;
return (freeblks);
}
+static void
+trunc_indirdep(indirdep, freeblks, bp, off)
+ struct indirdep *indirdep;
+ struct freeblks *freeblks;
+ struct buf *bp;
+ int off;
+{
+ struct allocindir *aip, *aipn;
+
+ /*
+ * The first set of allocindirs won't be in savedbp.
+ */
+ LIST_FOREACH_SAFE(aip, &indirdep->ir_deplisthd, ai_next, aipn)
+ if (aip->ai_offset > off)
+ cancel_allocindir(aip, bp, freeblks, 1);
+ LIST_FOREACH_SAFE(aip, &indirdep->ir_donehd, ai_next, aipn)
+ if (aip->ai_offset > off)
+ cancel_allocindir(aip, bp, freeblks, 1);
+ /*
+ * These will exist in savedbp.
+ */
+ LIST_FOREACH_SAFE(aip, &indirdep->ir_writehd, ai_next, aipn)
+ if (aip->ai_offset > off)
+ cancel_allocindir(aip, NULL, freeblks, 0);
+ LIST_FOREACH_SAFE(aip, &indirdep->ir_completehd, ai_next, aipn)
+ if (aip->ai_offset > off)
+ cancel_allocindir(aip, NULL, freeblks, 0);
+}
+
+/*
+ * Follow the chain of indirects down to lastlbn creating a freework
+ * structure for each. This will be used to start indir_trunc() at
+ * the right offset and create the journal records for the parrtial
+ * truncation. A second step will handle the truncated dependencies.
+ */
+static int
+setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno)
+ struct freeblks *freeblks;
+ struct inode *ip;
+ ufs_lbn_t lbn;
+ ufs_lbn_t lastlbn;
+ ufs2_daddr_t blkno;
+{
+ struct indirdep *indirdep;
+ struct indirdep *indirn;
+ struct freework *freework;
+ struct newblk *newblk;
+ struct mount *mp;
+ struct buf *bp;
+ uint8_t *start;
+ uint8_t *end;
+ ufs_lbn_t lbnadd;
+ int level;
+ int error;
+ int off;
+
+
+ freework = NULL;
+ if (blkno == 0)
+ return (0);
+ mp = freeblks->fb_list.wk_mp;
+ bp = getblk(ITOV(ip), lbn, mp->mnt_stat.f_iosize, 0, 0, 0);
+ if ((bp->b_flags & B_CACHE) == 0) {
+ bp->b_blkno = blkptrtodb(VFSTOUFS(mp), blkno);
+ bp->b_iocmd = BIO_READ;
+ bp->b_flags &= ~B_INVAL;
+ bp->b_ioflags &= ~BIO_ERROR;
+ vfs_busy_pages(bp, 0);
+ bp->b_iooffset = dbtob(bp->b_blkno);
+ bstrategy(bp);
+ curthread->td_ru.ru_inblock++;
+ error = bufwait(bp);
+ if (error) {
+ brelse(bp);
+ return (error);
+ }
+ }
+ level = lbn_level(lbn);
+ lbnadd = lbn_offset(ip->i_fs, level);
+ /*
+ * Compute the offset of the last block we want to keep. Store
+ * in the freework the first block we want to completely free.
+ */
+ off = (lastlbn - -(lbn + level)) / lbnadd;
+ if (off + 1 == NINDIR(ip->i_fs))
+ goto nowork;
+ freework = newfreework(ip->i_ump, freeblks, NULL, lbn, blkno, 0, off+1,
+ 0);
+ /*
+ * Link the freework into the indirdep. This will prevent any new
+ * allocations from proceeding until we are finished with the
+ * truncate and the block is written.
+ */
+ ACQUIRE_LOCK(&lk);
+ indirdep = indirdep_lookup(mp, ip, bp);
+ if (indirdep->ir_freeblks)
+ panic("setup_trunc_indir: indirdep already truncated.");
+ TAILQ_INSERT_TAIL(&indirdep->ir_trunc, freework, fw_next);
+ freework->fw_indir = indirdep;
+ /*
+ * Cancel any allocindirs that will not make it to disk.
+ * We have to do this for all copies of the indirdep that
+ * live on this newblk.
+ */
+ if ((indirdep->ir_state & DEPCOMPLETE) == 0) {
+ newblk_lookup(mp, dbtofsb(ip->i_fs, bp->b_blkno), 0, &newblk);
+ LIST_FOREACH(indirn, &newblk->nb_indirdeps, ir_next)
+ trunc_indirdep(indirn, freeblks, bp, off);
+ } else
+ trunc_indirdep(indirdep, freeblks, bp, off);
+ FREE_LOCK(&lk);
+ /*
+ * Creation is protected by the buf lock. The saveddata is only
+ * needed if a full truncation follows a partial truncation but it
+ * is difficult to allocate in that case so we fetch it anyway.
+ */
+ if (indirdep->ir_saveddata == NULL)
+ indirdep->ir_saveddata = malloc(bp->b_bcount, M_INDIRDEP,
+ M_SOFTDEP_FLAGS);
+nowork:
+ /* Fetch the blkno of the child and the zero start offset. */
+ if (ip->i_ump->um_fstype == UFS1) {
+ blkno = ((ufs1_daddr_t *)bp->b_data)[off];
+ start = (uint8_t *)&((ufs1_daddr_t *)bp->b_data)[off+1];
+ } else {
+ blkno = ((ufs2_daddr_t *)bp->b_data)[off];
+ start = (uint8_t *)&((ufs2_daddr_t *)bp->b_data)[off+1];
+ }
+ if (freework) {
+ /* Zero the truncated pointers. */
+ end = bp->b_data + bp->b_bcount;
+ bzero(start, end - start);
+ bdwrite(bp);
+ } else
+ bqrelse(bp);
+ if (level == 0)
+ return (0);
+ lbn++; /* adjust level */
+ lbn -= (off * lbnadd);
+ return setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno);
+}
+
+/*
+ * Complete the partial truncation of an indirect block setup by
+ * setup_trunc_indir(). This zeros the truncated pointers in the saved
+ * copy and writes them to disk before the freeblks is allowed to complete.
+ */
+static void
+complete_trunc_indir(freework)
+ struct freework *freework;
+{
+ struct freework *fwn;
+ struct indirdep *indirdep;
+ struct buf *bp;
+ uintptr_t start;
+ int count;
+
+ indirdep = freework->fw_indir;
+ for (;;) {
+ bp = indirdep->ir_bp;
+ /* See if the block was discarded. */
+ if (bp == NULL)
+ break;
+ /* Inline part of getdirtybuf(). We dont want bremfree. */
+ if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0)
+ break;
+ if (BUF_LOCK(bp,
+ LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, &lk) == 0)
+ BUF_UNLOCK(bp);
+ ACQUIRE_LOCK(&lk);
+ }
+ mtx_assert(&lk, MA_OWNED);
+ freework->fw_state |= DEPCOMPLETE;
+ TAILQ_REMOVE(&indirdep->ir_trunc, freework, fw_next);
+ /*
+ * Zero the pointers in the saved copy.
+ */
+ if (indirdep->ir_state & UFS1FMT)
+ start = sizeof(ufs1_daddr_t);
+ else
+ start = sizeof(ufs2_daddr_t);
+ start *= freework->fw_start;
+ count = indirdep->ir_savebp->b_bcount - start;
+ start += (uintptr_t)indirdep->ir_savebp->b_data;
+ bzero((char *)start, count);
+ /*
+ * We need to start the next truncation in the list if it has not
+ * been started yet.
+ */
+ fwn = TAILQ_FIRST(&indirdep->ir_trunc);
+ if (fwn != NULL) {
+ if (fwn->fw_freeblks == indirdep->ir_freeblks)
+ TAILQ_REMOVE(&indirdep->ir_trunc, fwn, fw_next);
+ if ((fwn->fw_state & ONWORKLIST) == 0)
+ freework_enqueue(fwn);
+ }
+ /*
+ * If bp is NULL the block was fully truncated, restore
+ * the saved block list otherwise free it if it is no
+ * longer needed.
+ */
+ if (TAILQ_EMPTY(&indirdep->ir_trunc)) {
+ if (bp == NULL)
+ bcopy(indirdep->ir_saveddata,
+ indirdep->ir_savebp->b_data,
+ indirdep->ir_savebp->b_bcount);
+ free(indirdep->ir_saveddata, M_INDIRDEP);
+ indirdep->ir_saveddata = NULL;
+ }
+ /*
+ * When bp is NULL there is a full truncation pending. We
+ * must wait for this full truncation to be journaled before
+ * we can release this freework because the disk pointers will
+ * never be written as zero.
+ */
+ if (bp == NULL) {
+ if (LIST_EMPTY(&indirdep->ir_freeblks->fb_jblkdephd))
+ handle_written_freework(freework);
+ else
+ WORKLIST_INSERT(&indirdep->ir_freeblks->fb_freeworkhd,
+ &freework->fw_list);
+ } else {
+ /* Complete when the real copy is written. */
+ WORKLIST_INSERT(&bp->b_dep, &freework->fw_list);
+ BUF_UNLOCK(bp);
+ }
+}
+
+/*
+ * Calculate the number of blocks we are going to release where datablocks
+ * is the current total and length is the new file size.
+ */
+ufs2_daddr_t
+blkcount(fs, datablocks, length)
+ struct fs *fs;
+ ufs2_daddr_t datablocks;
+ off_t length;
+{
+ off_t totblks, numblks;
+
+ totblks = 0;
+ numblks = howmany(length, fs->fs_bsize);
+ if (numblks <= NDADDR) {
+ totblks = howmany(length, fs->fs_fsize);
+ goto out;
+ }
+ totblks = blkstofrags(fs, numblks);
+ numblks -= NDADDR;
+ /*
+ * Count all single, then double, then triple indirects required.
+ * Subtracting one indirects worth of blocks for each pass
+ * acknowledges one of each pointed to by the inode.
+ */
+ for (;;) {
+ totblks += blkstofrags(fs, howmany(numblks, NINDIR(fs)));
+ numblks -= NINDIR(fs);
+ if (numblks <= 0)
+ break;
+ numblks = howmany(numblks, NINDIR(fs));
+ }
+out:
+ totblks = fsbtodb(fs, totblks);
+ /*
+ * Handle sparse files. We can't reclaim more blocks than the inode
+ * references. We will correct it later in handle_complete_freeblks()
+ * when we know the real count.
+ */
+ if (totblks > datablocks)
+ return (0);
+ return (datablocks - totblks);
+}
+
+/*
+ * Handle freeblocks for journaled softupdate filesystems.
+ *
+ * Contrary to normal softupdates, we must preserve the block pointers in
+ * indirects until their subordinates are free. This is to avoid journaling
+ * every block that is freed which may consume more space than the journal
+ * itself. The recovery program will see the free block journals at the
+ * base of the truncated area and traverse them to reclaim space. The
+ * pointers in the inode may be cleared immediately after the journal
+ * records are written because each direct and indirect pointer in the
+ * inode is recorded in a journal. This permits full truncation to proceed
+ * asynchronously. The write order is journal -> inode -> cgs -> indirects.
+ *
+ * The algorithm is as follows:
+ * 1) Traverse the in-memory state and create journal entries to release
+ * the relevant blocks and full indirect trees.
+ * 2) Traverse the indirect block chain adding partial truncation freework
+ * records to indirects in the path to lastlbn. The freework will
+ * prevent new allocation dependencies from being satisfied in this
+ * indirect until the truncation completes.
+ * 3) Read and lock the inode block, performing an update with the new size
+ * and pointers. This prevents truncated data from becoming valid on
+ * disk through step 4.
+ * 4) Reap unsatisfied dependencies that are beyond the truncated area,
+ * eliminate journal work for those records that do not require it.
+ * 5) Schedule the journal records to be written followed by the inode block.
+ * 6) Allocate any necessary frags for the end of file.
+ * 7) Zero any partially truncated blocks.
+ *
+ * From this truncation proceeds asynchronously using the freework and
+ * indir_trunc machinery. The file will not be extended again into a
+ * partially truncated indirect block until all work is completed but
+ * the normal dependency mechanism ensures that it is rolled back/forward
+ * as appropriate. Further truncation may occur without delay and is
+ * serialized in indir_trunc().
+ */
+void
+softdep_journal_freeblocks(ip, cred, length, flags)
+ struct inode *ip; /* The inode whose length is to be reduced */
+ struct ucred *cred;
+ off_t length; /* The new length for the file */
+ int flags; /* IO_EXT and/or IO_NORMAL */
+{
+ struct freeblks *freeblks, *fbn;
+ struct inodedep *inodedep;
+ struct jblkdep *jblkdep;
+ struct allocdirect *adp, *adpn;
+ struct fs *fs;
+ struct buf *bp;
+ struct vnode *vp;
+ struct mount *mp;
+ ufs2_daddr_t extblocks, datablocks;
+ ufs_lbn_t tmpval, lbn, lastlbn;
+ int frags;
+ int lastoff, iboff;
+ int allocblock;
+ int error, i;
+ int needj;
+
+ fs = ip->i_fs;
+ mp = UFSTOVFS(ip->i_ump);
+ vp = ITOV(ip);
+ needj = 1;
+ iboff = -1;
+ allocblock = 0;
+ extblocks = 0;
+ datablocks = 0;
+ frags = 0;
+ freeblks = newfreeblks(mp, ip);
+ ACQUIRE_LOCK(&lk);
+ /*
+ * If we're truncating a removed file that will never be written
+ * we don't need to journal the block frees. The canceled journals
+ * for the allocations will suffice.
+ */
+ inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
+ if ((inodedep->id_state & (UNLINKED | DEPCOMPLETE)) == UNLINKED &&
+ length == 0)
+ needj = 0;
+ FREE_LOCK(&lk);
+ /*
+ * Calculate the lbn that we are truncating to. This results in -1
+ * if we're truncating the 0 bytes. So it is the last lbn we want
+ * to keep, not the first lbn we want to truncate.
+ */
+ lastlbn = lblkno(fs, length + fs->fs_bsize - 1) - 1;
+ lastoff = blkoff(fs, length);
+ /*
+ * Compute frags we are keeping in lastlbn. 0 means all.
+ */
+ if (lastlbn >= 0 && lastlbn < NDADDR) {
+ frags = fragroundup(fs, lastoff);
+ /* adp offset of last valid allocdirect. */
+ iboff = lastlbn;
+ } else if (lastlbn > 0)
+ iboff = NDADDR;
+ if (fs->fs_magic == FS_UFS2_MAGIC)
+ extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize));
+ /*
+ * Handle normal data blocks and indirects. This section saves
+ * values used after the inode update to complete frag and indirect
+ * truncation.
+ */
+ if ((flags & IO_NORMAL) != 0) {
+ /*
+ * Handle truncation of whole direct and indirect blocks.
+ */
+ for (i = iboff + 1; i < NDADDR; i++)
+ setup_freedirect(freeblks, ip, i, needj);
+ for (i = 0, tmpval = NINDIR(fs), lbn = NDADDR; i < NIADDR;
+ i++, lbn += tmpval, tmpval *= NINDIR(fs)) {
+ /* Release a whole indirect tree. */
+ if (lbn > lastlbn) {
+ setup_freeindir(freeblks, ip, i, -lbn -i,
+ needj);
+ continue;
+ }
+ iboff = i + NDADDR;
+ /*
+ * Traverse partially truncated indirect tree.
+ */
+ if (lbn <= lastlbn && lbn + tmpval - 1 > lastlbn)
+ setup_trunc_indir(freeblks, ip, -lbn - i,
+ lastlbn, DIP(ip, i_ib[i]));
+ }
+ /*
+ * Handle partial truncation to a frag boundary.
+ */
+ if (frags) {
+ ufs2_daddr_t blkno;
+ long oldfrags;
+
+ oldfrags = blksize(fs, ip, lastlbn);
+ blkno = DIP(ip, i_db[lastlbn]);
+ if (blkno && oldfrags != frags) {
+ oldfrags -= frags;
+ oldfrags = numfrags(ip->i_fs, oldfrags);
+ blkno += numfrags(ip->i_fs, frags);
+ newfreework(ip->i_ump, freeblks, NULL, lastlbn,
+ blkno, oldfrags, 0, needj);
+ } else if (blkno == 0)
+ allocblock = 1;
+ }
+ /*
+ * Add a journal record for partial truncate if we are
+ * handling indirect blocks. Non-indirects need no extra
+ * journaling.
+ */
+ if (length != 0 && lastlbn >= NDADDR) {
+ ip->i_flag |= IN_TRUNCATED;
+ newjtrunc(freeblks, length, 0);
+ }
+ ip->i_size = length;
+ DIP_SET(ip, i_size, ip->i_size);
+ datablocks = DIP(ip, i_blocks) - extblocks;
+ if (length != 0)
+ datablocks = blkcount(ip->i_fs, datablocks, length);
+ freeblks->fb_len = length;
+ }
+ if ((flags & IO_EXT) != 0) {
+ for (i = 0; i < NXADDR; i++)
+ setup_freeext(freeblks, ip, i, needj);
+ ip->i_din2->di_extsize = 0;
+ datablocks += extblocks;
+ }
+#ifdef QUOTA
+ /* Reference the quotas in case the block count is wrong in the end. */
+ quotaref(vp, freeblks->fb_quota);
+ (void) chkdq(ip, -datablocks, NOCRED, 0);
+#endif
+ freeblks->fb_chkcnt = datablocks;
+ UFS_LOCK(ip->i_ump);
+ fs->fs_pendingblocks += datablocks;
+ UFS_UNLOCK(ip->i_ump);
+ DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks);
+ /*
+ * Handle truncation of incomplete alloc direct dependencies. We
+ * hold the inode block locked to prevent incomplete dependencies
+ * from reaching the disk while we are eliminating those that
+ * have been truncated. This is a partially inlined ffs_update().
+ */
+ ufs_itimes(vp);
+ ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED);
+ error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
+ (int)fs->fs_bsize, cred, &bp);
+ if (error) {
+ brelse(bp);
+ softdep_error("softdep_journal_freeblocks", error);
+ return;
+ }
+ if (bp->b_bufsize == fs->fs_bsize)
+ bp->b_flags |= B_CLUSTEROK;
+ softdep_update_inodeblock(ip, bp, 0);
+ if (ip->i_ump->um_fstype == UFS1)
+ *((struct ufs1_dinode *)bp->b_data +
+ ino_to_fsbo(fs, ip->i_number)) = *ip->i_din1;
+ else
+ *((struct ufs2_dinode *)bp->b_data +
+ ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2;
+ ACQUIRE_LOCK(&lk);
+ (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
+ if ((inodedep->id_state & IOSTARTED) != 0)
+ panic("softdep_setup_freeblocks: inode busy");
+ /*
+ * Add the freeblks structure to the list of operations that
+ * must await the zero'ed inode being written to disk. If we
+ * still have a bitmap dependency (needj), then the inode
+ * has never been written to disk, so we can process the
+ * freeblks below once we have deleted the dependencies.
+ */
+ if (needj)
+ WORKLIST_INSERT(&bp->b_dep, &freeblks->fb_list);
+ else
+ freeblks->fb_state |= COMPLETE;
+ if ((flags & IO_NORMAL) != 0) {
+ TAILQ_FOREACH_SAFE(adp, &inodedep->id_inoupdt, ad_next, adpn) {
+ if (adp->ad_offset > iboff)
+ cancel_allocdirect(&inodedep->id_inoupdt, adp,
+ freeblks);
+ /*
+ * Truncate the allocdirect. We could eliminate
+ * or modify journal records as well.
+ */
+ else if (adp->ad_offset == iboff && frags)
+ adp->ad_newsize = frags;
+ }
+ }
+ if ((flags & IO_EXT) != 0)
+ while ((adp = TAILQ_FIRST(&inodedep->id_extupdt)) != 0)
+ cancel_allocdirect(&inodedep->id_extupdt, adp,
+ freeblks);
+ /*
+ * Add journal work.
+ */
+ LIST_FOREACH(jblkdep, &freeblks->fb_jblkdephd, jb_deps)
+ add_to_journal(&jblkdep->jb_list);
+ FREE_LOCK(&lk);
+ bdwrite(bp);
+ /*
+ * Truncate dependency structures beyond length.
+ */
+ trunc_dependencies(ip, freeblks, lastlbn, frags, flags);
+ /*
+ * This is only set when we need to allocate a fragment because
+ * none existed at the end of a frag-sized file. It handles only
+ * allocating a new, zero filled block.
+ */
+ if (allocblock) {
+ ip->i_size = length - lastoff;
+ DIP_SET(ip, i_size, ip->i_size);
+ error = UFS_BALLOC(vp, length - 1, 1, cred, BA_CLRBUF, &bp);
+ if (error != 0) {
+ softdep_error("softdep_journal_freeblks", error);
+ return;
+ }
+ ip->i_size = length;
+ DIP_SET(ip, i_size, length);
+ ip->i_flag |= IN_CHANGE | IN_UPDATE;
+ allocbuf(bp, frags);
+ ffs_update(vp, MNT_NOWAIT);
+ bawrite(bp);
+ } else if (lastoff != 0 && vp->v_type != VDIR) {
+ int size;
+
+ /*
+ * Zero the end of a truncated frag or block.
+ */
+ size = sblksize(fs, length, lastlbn);
+ error = bread(vp, lastlbn, size, cred, &bp);
+ if (error) {
+ softdep_error("softdep_journal_freeblks", error);
+ return;
+ }
+ bzero((char *)bp->b_data + lastoff, size - lastoff);
+ bawrite(bp);
+
+ }
+ ACQUIRE_LOCK(&lk);
+ inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
+ TAILQ_INSERT_TAIL(&inodedep->id_freeblklst, freeblks, fb_next);
+ freeblks->fb_state |= DEPCOMPLETE | ONDEPLIST;
+ /*
+ * We zero earlier truncations so they don't erroneously
+ * update i_blocks.
+ */
+ if (freeblks->fb_len == 0 && (flags & IO_NORMAL) != 0)
+ TAILQ_FOREACH(fbn, &inodedep->id_freeblklst, fb_next)
+ fbn->fb_len = 0;
+ if ((freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE &&
+ LIST_EMPTY(&freeblks->fb_jblkdephd))
+ freeblks->fb_state |= INPROGRESS;
+ else
+ freeblks = NULL;
+ FREE_LOCK(&lk);
+ if (freeblks)
+ handle_workitem_freeblocks(freeblks, 0);
+ trunc_pages(ip, length, extblocks, flags);
+
+}
+
+/*
+ * Flush a JOP_SYNC to the journal.
+ */
+void
+softdep_journal_fsync(ip)
+ struct inode *ip;
+{
+ struct jfsync *jfsync;
+
+ if ((ip->i_flag & IN_TRUNCATED) == 0)
+ return;
+ ip->i_flag &= ~IN_TRUNCATED;
+ jfsync = malloc(sizeof(*jfsync), M_JFSYNC, M_SOFTDEP_FLAGS | M_ZERO);
+ workitem_alloc(&jfsync->jfs_list, D_JFSYNC, UFSTOVFS(ip->i_ump));
+ jfsync->jfs_size = ip->i_size;
+ jfsync->jfs_ino = ip->i_number;
+ ACQUIRE_LOCK(&lk);
+ add_to_journal(&jfsync->jfs_list);
+ jwait(&jfsync->jfs_list, MNT_WAIT);
+ FREE_LOCK(&lk);
+}
+
/*
* Block de-allocation dependencies.
*
@@ -5464,7 +6391,6 @@ softdep_setup_freeblocks(ip, length, flags)
struct freeblks *freeblks;
struct inodedep *inodedep;
struct allocdirect *adp;
- struct jfreeblk *jfreeblk;
struct buf *bp;
struct fs *fs;
ufs2_daddr_t extblocks, datablocks;
@@ -5472,52 +6398,42 @@ softdep_setup_freeblocks(ip, length, flags)
int i, delay, error;
ufs_lbn_t tmpval;
ufs_lbn_t lbn;
- int needj;
fs = ip->i_fs;
mp = UFSTOVFS(ip->i_ump);
if (length != 0)
panic("softdep_setup_freeblocks: non-zero length");
freeblks = newfreeblks(mp, ip);
- ACQUIRE_LOCK(&lk);
- /*
- * If we're truncating a removed file that will never be written
- * we don't need to journal the block frees. The canceled journals
- * for the allocations will suffice.
- */
- inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
- if ((inodedep->id_state & (UNLINKED | DEPCOMPLETE)) == UNLINKED ||
- (fs->fs_flags & FS_SUJ) == 0)
- needj = 0;
- else
- needj = 1;
- FREE_LOCK(&lk);
extblocks = 0;
+ datablocks = 0;
if (fs->fs_magic == FS_UFS2_MAGIC)
extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize));
- datablocks = DIP(ip, i_blocks) - extblocks;
if ((flags & IO_NORMAL) != 0) {
for (i = 0; i < NDADDR; i++)
- setup_freedirect(freeblks, ip, i, needj);
+ setup_freedirect(freeblks, ip, i, 0);
for (i = 0, tmpval = NINDIR(fs), lbn = NDADDR; i < NIADDR;
i++, lbn += tmpval, tmpval *= NINDIR(fs))
- setup_freeindir(freeblks, ip, i, -lbn -i, needj);
+ setup_freeindir(freeblks, ip, i, -lbn -i, 0);
ip->i_size = 0;
DIP_SET(ip, i_size, 0);
- freeblks->fb_chkcnt = datablocks;
- UFS_LOCK(ip->i_ump);
- fs->fs_pendingblocks += datablocks;
- UFS_UNLOCK(ip->i_ump);
+ datablocks = DIP(ip, i_blocks) - extblocks;
}
if ((flags & IO_EXT) != 0) {
for (i = 0; i < NXADDR; i++)
- setup_freeext(freeblks, ip, i, needj);
+ setup_freeext(freeblks, ip, i, 0);
ip->i_din2->di_extsize = 0;
- freeblks->fb_chkcnt += extblocks;
+ datablocks += extblocks;
}
- if (LIST_EMPTY(&freeblks->fb_jfreeblkhd))
- needj = 0;
- DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - freeblks->fb_chkcnt);
+#ifdef QUOTA
+ /* Reference the quotas in case the block count is wrong in the end. */
+ quotaref(vp, freeblks->fb_quota);
+ (void) chkdq(ip, -datablocks, NOCRED, 0);
+#endif
+ freeblks->fb_chkcnt = datablocks;
+ UFS_LOCK(ip->i_ump);
+ fs->fs_pendingblocks += datablocks;
+ UFS_UNLOCK(ip->i_ump);
+ DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks);
/*
* Push the zero'ed inode to to its disk buffer so that we are free
* to delete its dependencies below. Once the dependencies are gone
@@ -5557,7 +6473,7 @@ softdep_setup_freeblocks(ip, length, flags)
delay = (inodedep->id_state & DEPCOMPLETE);
if (delay)
WORKLIST_INSERT(&bp->b_dep, &freeblks->fb_list);
- else if (needj)
+ else
freeblks->fb_state |= COMPLETE;
/*
* Because the file length has been truncated to zero, any
@@ -5573,67 +6489,145 @@ softdep_setup_freeblocks(ip, length, flags)
&inodedep->id_inoupdt);
while ((adp = TAILQ_FIRST(&inodedep->id_inoupdt)) != 0)
cancel_allocdirect(&inodedep->id_inoupdt, adp,
- freeblks, delay);
+ freeblks);
}
if (flags & IO_EXT) {
merge_inode_lists(&inodedep->id_newextupdt,
&inodedep->id_extupdt);
while ((adp = TAILQ_FIRST(&inodedep->id_extupdt)) != 0)
cancel_allocdirect(&inodedep->id_extupdt, adp,
- freeblks, delay);
+ freeblks);
}
- LIST_FOREACH(jfreeblk, &freeblks->fb_jfreeblkhd, jf_deps)
- add_to_journal(&jfreeblk->jf_list);
-
FREE_LOCK(&lk);
bdwrite(bp);
- softdep_trunc_deps(ITOV(ip), freeblks, 0, 0, flags);
+ trunc_dependencies(ip, freeblks, -1, 0, flags);
ACQUIRE_LOCK(&lk);
if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0)
(void) free_inodedep(inodedep);
+ freeblks->fb_state |= DEPCOMPLETE;
+ /*
+ * If the inode with zeroed block pointers is now on disk
+ * we can start freeing blocks.
+ */
+ if ((freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE)
+ freeblks->fb_state |= INPROGRESS;
+ else
+ freeblks = NULL;
+ FREE_LOCK(&lk);
+ if (freeblks)
+ handle_workitem_freeblocks(freeblks, 0);
+ trunc_pages(ip, length, extblocks, flags);
+}
- if (delay || needj)
- freeblks->fb_state |= DEPCOMPLETE;
- if (delay) {
- /*
- * If the inode with zeroed block pointers is now on disk
- * we can start freeing blocks. Add freeblks to the worklist
- * instead of calling handle_workitem_freeblocks directly as
- * it is more likely that additional IO is needed to complete
- * the request here than in the !delay case.
- */
- if ((freeblks->fb_state & ALLCOMPLETE) == ALLCOMPLETE)
- add_to_worklist(&freeblks->fb_list, 1);
- }
- if (needj && LIST_EMPTY(&freeblks->fb_jfreeblkhd))
- needj = 0;
+/*
+ * Eliminate pages from the page cache that back parts of this inode and
+ * adjust the vnode pager's idea of our size. This prevents stale data
+ * from hanging around in the page cache.
+ */
+static void
+trunc_pages(ip, length, extblocks, flags)
+ struct inode *ip;
+ off_t length;
+ ufs2_daddr_t extblocks;
+ int flags;
+{
+ struct vnode *vp;
+ struct fs *fs;
+ ufs_lbn_t lbn;
+ off_t end, extend;
- FREE_LOCK(&lk);
+ vp = ITOV(ip);
+ fs = ip->i_fs;
+ extend = OFF_TO_IDX(lblktosize(fs, -extblocks));
+ if ((flags & IO_EXT) != 0)
+ ffs_pages_remove(vp, extend, 0);
+ if ((flags & IO_NORMAL) == 0)
+ return;
+ BO_LOCK(&vp->v_bufobj);
+ drain_output(vp);
+ BO_UNLOCK(&vp->v_bufobj);
/*
- * If the inode has never been written to disk (delay == 0) and
- * we're not waiting on any journal writes, then we can process the
- * freeblks now that we have deleted the dependencies.
+ * The vnode pager eliminates file pages we eliminate indirects
+ * below.
*/
- if (!delay && !needj)
- handle_workitem_freeblocks(freeblks, 0);
+ vnode_pager_setsize(vp, length);
+ /*
+ * Calculate the end based on the last indirect we want to keep. If
+ * the block extends into indirects we can just use the negative of
+ * its lbn. Doubles and triples exist at lower numbers so we must
+ * be careful not to remove those, if they exist. double and triple
+ * indirect lbns do not overlap with others so it is not important
+ * to verify how many levels are required.
+ */
+ lbn = lblkno(fs, length);
+ if (lbn >= NDADDR) {
+ /* Calculate the virtual lbn of the triple indirect. */
+ lbn = -lbn - (NIADDR - 1);
+ end = OFF_TO_IDX(lblktosize(fs, lbn));
+ } else
+ end = extend;
+ ffs_pages_remove(vp, OFF_TO_IDX(OFF_MAX), end);
+}
+
+/*
+ * See if the buf bp is in the range eliminated by truncation.
+ */
+static int
+trunc_check_buf(bp, blkoffp, lastlbn, lastoff, flags)
+ struct buf *bp;
+ int *blkoffp;
+ ufs_lbn_t lastlbn;
+ int lastoff;
+ int flags;
+{
+ ufs_lbn_t lbn;
+
+ *blkoffp = 0;
+ /* Only match ext/normal blocks as appropriate. */
+ if (((flags & IO_EXT) == 0 && (bp->b_xflags & BX_ALTDATA)) ||
+ ((flags & IO_NORMAL) == 0 && (bp->b_xflags & BX_ALTDATA) == 0))
+ return (0);
+ /* ALTDATA is always a full truncation. */
+ if ((bp->b_xflags & BX_ALTDATA) != 0)
+ return (1);
+ /* -1 is full truncation. */
+ if (lastlbn == -1)
+ return (1);
+ /*
+ * If this is a partial truncate we only want those
+ * blocks and indirect blocks that cover the range
+ * we're after.
+ */
+ lbn = bp->b_lblkno;
+ if (lbn < 0)
+ lbn = -(lbn + lbn_level(lbn));
+ if (lbn < lastlbn)
+ return (0);
+ /* Here we only truncate lblkno if it's partial. */
+ if (lbn == lastlbn) {
+ if (lastoff == 0)
+ return (0);
+ *blkoffp = lastoff;
+ }
+ return (1);
}
/*
* Eliminate any dependencies that exist in memory beyond lblkno:off
*/
static void
-softdep_trunc_deps(vp, freeblks, lblkno, off, flags)
- struct vnode *vp;
+trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags)
+ struct inode *ip;
struct freeblks *freeblks;
- ufs_lbn_t lblkno;
- int off;
+ ufs_lbn_t lastlbn;
+ int lastoff;
int flags;
{
- struct inodedep *inodedep;
struct bufobj *bo;
+ struct vnode *vp;
struct buf *bp;
- struct mount *mp;
- ino_t ino;
+ struct fs *fs;
+ int blkoff;
/*
* We must wait for any I/O in progress to finish so that
@@ -5641,96 +6635,140 @@ softdep_trunc_deps(vp, freeblks, lblkno, off, flags)
* Once they are all there, walk the list and get rid of
* any dependencies.
*/
- ino = VTOI(vp)->i_number;
- mp = vp->v_mount;
+ fs = ip->i_fs;
+ vp = ITOV(ip);
bo = &vp->v_bufobj;
BO_LOCK(bo);
drain_output(vp);
+ TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs)
+ bp->b_vflags &= ~BV_SCANNED;
restart:
TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) {
- if (((flags & IO_EXT) == 0 && (bp->b_xflags & BX_ALTDATA)) ||
- ((flags & IO_NORMAL) == 0 &&
- (bp->b_xflags & BX_ALTDATA) == 0))
+ if (bp->b_vflags & BV_SCANNED)
continue;
+ if (!trunc_check_buf(bp, &blkoff, lastlbn, lastoff, flags)) {
+ bp->b_vflags |= BV_SCANNED;
+ continue;
+ }
if ((bp = getdirtybuf(bp, BO_MTX(bo), MNT_WAIT)) == NULL)
goto restart;
BO_UNLOCK(bo);
- ACQUIRE_LOCK(&lk);
- (void) inodedep_lookup(mp, ino, 0, &inodedep);
- if (deallocate_dependencies(bp, inodedep, freeblks, 0))
- bp->b_flags |= B_INVAL | B_NOCACHE;
- FREE_LOCK(&lk);
- brelse(bp);
+ if (deallocate_dependencies(bp, freeblks, blkoff))
+ bqrelse(bp);
+ else
+ brelse(bp);
BO_LOCK(bo);
goto restart;
}
+ /*
+ * Now do the work of vtruncbuf while also matching indirect blocks.
+ */
+ TAILQ_FOREACH(bp, &bo->bo_clean.bv_hd, b_bobufs)
+ bp->b_vflags &= ~BV_SCANNED;
+cleanrestart:
+ TAILQ_FOREACH(bp, &bo->bo_clean.bv_hd, b_bobufs) {
+ if (bp->b_vflags & BV_SCANNED)
+ continue;
+ if (!trunc_check_buf(bp, &blkoff, lastlbn, lastoff, flags)) {
+ bp->b_vflags |= BV_SCANNED;
+ continue;
+ }
+ if (BUF_LOCK(bp,
+ LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK,
+ BO_MTX(bo)) == ENOLCK) {
+ BO_LOCK(bo);
+ goto cleanrestart;
+ }
+ bp->b_vflags |= BV_SCANNED;
+ BO_LOCK(bo);
+ bremfree(bp);
+ BO_UNLOCK(bo);
+ if (blkoff != 0) {
+ allocbuf(bp, blkoff);
+ bqrelse(bp);
+ } else {
+ bp->b_flags |= B_INVAL | B_NOCACHE | B_RELBUF;
+ brelse(bp);
+ }
+ BO_LOCK(bo);
+ goto cleanrestart;
+ }
+ drain_output(vp);
BO_UNLOCK(bo);
}
static int
-cancel_pagedep(pagedep, inodedep, freeblks)
+cancel_pagedep(pagedep, freeblks, blkoff)
struct pagedep *pagedep;
- struct inodedep *inodedep;
struct freeblks *freeblks;
+ int blkoff;
{
- struct newdirblk *newdirblk;
struct jremref *jremref;
struct jmvref *jmvref;
- struct dirrem *dirrem;
+ struct dirrem *dirrem, *tmp;
int i;
/*
- * There should be no directory add dependencies present
- * as the directory could not be truncated until all
- * children were removed.
- */
- KASSERT(LIST_FIRST(&pagedep->pd_pendinghd) == NULL,
- ("deallocate_dependencies: pendinghd != NULL"));
- for (i = 0; i < DAHASHSZ; i++)
- KASSERT(LIST_FIRST(&pagedep->pd_diraddhd[i]) == NULL,
- ("deallocate_dependencies: diraddhd != NULL"));
- /*
* Copy any directory remove dependencies to the list
- * to be processed after the zero'ed inode is written.
- * If the inode has already been written, then they
+ * to be processed after the freeblks proceeds. If
+ * directory entry never made it to disk they
* can be dumped directly onto the work list.
*/
- LIST_FOREACH(dirrem, &pagedep->pd_dirremhd, dm_next) {
+ LIST_FOREACH_SAFE(dirrem, &pagedep->pd_dirremhd, dm_next, tmp) {
+ /* Skip this directory removal if it is intended to remain. */
+ if (dirrem->dm_offset < blkoff)
+ continue;
/*
- * If there are any dirrems we wait for
- * the journal write to complete and
- * then restart the buf scan as the lock
+ * If there are any dirrems we wait for the journal write
+ * to complete and then restart the buf scan as the lock
* has been dropped.
*/
- while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd))
- != NULL) {
- stat_jwait_filepage++;
- jwait(&jremref->jr_list);
+ while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL) {
+ jwait(&jremref->jr_list, MNT_WAIT);
return (ERESTART);
}
LIST_REMOVE(dirrem, dm_next);
dirrem->dm_dirinum = pagedep->pd_ino;
- if (inodedep == NULL ||
- (inodedep->id_state & ALLCOMPLETE) == ALLCOMPLETE) {
- dirrem->dm_state |= COMPLETE;
- add_to_worklist(&dirrem->dm_list, 0);
- } else
- WORKLIST_INSERT(&inodedep->id_bufwait,
- &dirrem->dm_list);
- }
- if ((pagedep->pd_state & NEWBLOCK) != 0) {
- newdirblk = pagedep->pd_newdirblk;
- WORKLIST_REMOVE(&newdirblk->db_list);
- free_newdirblk(newdirblk);
+ WORKLIST_INSERT(&freeblks->fb_freeworkhd, &dirrem->dm_list);
}
while ((jmvref = LIST_FIRST(&pagedep->pd_jmvrefhd)) != NULL) {
- stat_jwait_filepage++;
- jwait(&jmvref->jm_list);
+ jwait(&jmvref->jm_list, MNT_WAIT);
return (ERESTART);
}
- WORKLIST_REMOVE(&pagedep->pd_list);
- LIST_REMOVE(pagedep, pd_hash);
- WORKITEM_FREE(pagedep, D_PAGEDEP);
+ /*
+ * When we're partially truncating a pagedep we just want to flush
+ * journal entries and return. There can not be any adds in the
+ * truncated portion of the directory and newblk must remain if
+ * part of the block remains.
+ */
+ if (blkoff != 0) {
+ struct diradd *dap;
+
+ LIST_FOREACH(dap, &pagedep->pd_pendinghd, da_pdlist)
+ if (dap->da_offset > blkoff)
+ panic("cancel_pagedep: diradd %p off %d > %d",
+ dap, dap->da_offset, blkoff);
+ for (i = 0; i < DAHASHSZ; i++)
+ LIST_FOREACH(dap, &pagedep->pd_diraddhd[i], da_pdlist)
+ if (dap->da_offset > blkoff)
+ panic("cancel_pagedep: diradd %p off %d > %d",
+ dap, dap->da_offset, blkoff);
+ return (0);
+ }
+ /*
+ * There should be no directory add dependencies present
+ * as the directory could not be truncated until all
+ * children were removed.
+ */
+ KASSERT(LIST_FIRST(&pagedep->pd_pendinghd) == NULL,
+ ("deallocate_dependencies: pendinghd != NULL"));
+ for (i = 0; i < DAHASHSZ; i++)
+ KASSERT(LIST_FIRST(&pagedep->pd_diraddhd[i]) == NULL,
+ ("deallocate_dependencies: diraddhd != NULL"));
+ if ((pagedep->pd_state & NEWBLOCK) != 0)
+ free_newdirblk(pagedep->pd_newdirblk);
+ if (free_pagedep(pagedep) == 0)
+ panic("Failed to free pagedep %p", pagedep);
return (0);
}
@@ -5739,58 +6777,82 @@ cancel_pagedep(pagedep, inodedep, freeblks)
* be reallocated to a new vnode. The buffer must be locked, thus,
* no I/O completion operations can occur while we are manipulating
* its associated dependencies. The mutex is held so that other I/O's
- * associated with related dependencies do not occur. Returns 1 if
- * all dependencies were cleared, 0 otherwise.
+ * associated with related dependencies do not occur.
*/
static int
-deallocate_dependencies(bp, inodedep, freeblks, off)
+deallocate_dependencies(bp, freeblks, off)
struct buf *bp;
- struct inodedep *inodedep;
struct freeblks *freeblks;
int off;
{
- struct worklist *wk;
struct indirdep *indirdep;
- struct allocindir *aip;
struct pagedep *pagedep;
+ struct allocdirect *adp;
+ struct worklist *wk, *wkn;
- mtx_assert(&lk, MA_OWNED);
- while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) {
+ ACQUIRE_LOCK(&lk);
+ LIST_FOREACH_SAFE(wk, &bp->b_dep, wk_list, wkn) {
switch (wk->wk_type) {
-
case D_INDIRDEP:
indirdep = WK_INDIRDEP(wk);
if (bp->b_lblkno >= 0 ||
bp->b_blkno != indirdep->ir_savebp->b_lblkno)
panic("deallocate_dependencies: not indir");
- cancel_indirdep(indirdep, bp, inodedep, freeblks);
+ cancel_indirdep(indirdep, bp, freeblks);
continue;
case D_PAGEDEP:
pagedep = WK_PAGEDEP(wk);
- if (cancel_pagedep(pagedep, inodedep, freeblks))
- return (0);
+ if (cancel_pagedep(pagedep, freeblks, off)) {
+ FREE_LOCK(&lk);
+ return (ERESTART);
+ }
continue;
case D_ALLOCINDIR:
- aip = WK_ALLOCINDIR(wk);
- cancel_allocindir(aip, inodedep, freeblks);
+ /*
+ * Simply remove the allocindir, we'll find it via
+ * the indirdep where we can clear pointers if
+ * needed.
+ */
+ WORKLIST_REMOVE(wk);
continue;
- case D_ALLOCDIRECT:
- case D_INODEDEP:
- panic("deallocate_dependencies: Unexpected type %s",
- TYPENAME(wk->wk_type));
- /* NOTREACHED */
+ case D_FREEWORK:
+ /*
+ * A truncation is waiting for the zero'd pointers
+ * to be written. It can be freed when the freeblks
+ * is journaled.
+ */
+ WORKLIST_REMOVE(wk);
+ wk->wk_state |= ONDEPLIST;
+ WORKLIST_INSERT(&freeblks->fb_freeworkhd, wk);
+ break;
+ case D_ALLOCDIRECT:
+ adp = WK_ALLOCDIRECT(wk);
+ if (off != 0)
+ continue;
+ /* FALLTHROUGH */
default:
- panic("deallocate_dependencies: Unknown type %s",
+ panic("deallocate_dependencies: Unexpected type %s",
TYPENAME(wk->wk_type));
/* NOTREACHED */
}
}
+ FREE_LOCK(&lk);
+ /*
+ * Don't throw away this buf, we were partially truncating and
+ * some deps may always remain.
+ */
+ if (off) {
+ allocbuf(bp, off);
+ bp->b_vflags |= BV_SCANNED;
+ return (EBUSY);
+ }
+ bp->b_flags |= B_INVAL | B_NOCACHE;
- return (1);
+ return (0);
}
/*
@@ -5800,19 +6862,35 @@ deallocate_dependencies(bp, inodedep, freeblks, off)
* space is no longer pointed to by the inode or in the bitmap.
*/
static void
-cancel_allocdirect(adphead, adp, freeblks, delay)
+cancel_allocdirect(adphead, adp, freeblks)
struct allocdirectlst *adphead;
struct allocdirect *adp;
struct freeblks *freeblks;
- int delay;
{
struct freework *freework;
struct newblk *newblk;
struct worklist *wk;
- ufs_lbn_t lbn;
TAILQ_REMOVE(adphead, adp, ad_next);
newblk = (struct newblk *)adp;
+ freework = NULL;
+ /*
+ * Find the correct freework structure.
+ */
+ LIST_FOREACH(wk, &freeblks->fb_freeworkhd, wk_list) {
+ if (wk->wk_type != D_FREEWORK)
+ continue;
+ freework = WK_FREEWORK(wk);
+ if (freework->fw_blkno == newblk->nb_newblkno)
+ break;
+ }
+ if (freework == NULL)
+ panic("cancel_allocdirect: Freework not found");
+ /*
+ * If a newblk exists at all we still have the journal entry that
+ * initiated the allocation so we do not need to journal the free.
+ */
+ cancel_jfreeblk(freeblks, freework->fw_blkno);
/*
* If the journal hasn't been written the jnewblk must be passed
* to the call to ffs_blkfree that reclaims the space. We accomplish
@@ -5821,33 +6899,9 @@ cancel_allocdirect(adphead, adp, freeblks, delay)
* been written we can simply reclaim the journal space when the
* freeblks work is complete.
*/
- if (newblk->nb_jnewblk == NULL) {
- if (cancel_newblk(newblk, NULL, &freeblks->fb_jwork) != NULL)
- panic("cancel_allocdirect: Unexpected dependency");
- goto found;
- }
- lbn = newblk->nb_jnewblk->jn_lbn;
- /*
- * Find the correct freework structure so it releases the canceled
- * journal when the bitmap is cleared. This preserves rollback
- * until the allocation is reverted.
- */
- LIST_FOREACH(wk, &freeblks->fb_freeworkhd, wk_list) {
- freework = WK_FREEWORK(wk);
- if (freework->fw_lbn != lbn)
- continue;
- freework->fw_jnewblk = cancel_newblk(newblk, &freework->fw_list,
- &freework->fw_jwork);
- goto found;
- }
- panic("cancel_allocdirect: Freework not found for lbn %jd\n", lbn);
-found:
- if (delay)
- WORKLIST_INSERT(&adp->ad_inodedep->id_bufwait,
- &newblk->nb_list);
- else
- free_newblk(newblk);
- return;
+ freework->fw_jnewblk = cancel_newblk(newblk, &freework->fw_list,
+ &freeblks->fb_jwork);
+ WORKLIST_INSERT(&freeblks->fb_freeworkhd, &newblk->nb_list);
}
@@ -5865,33 +6919,18 @@ cancel_newblk(newblk, wk, wkhd)
struct worklist *wk;
struct workhead *wkhd;
{
- struct indirdep *indirdep;
- struct allocindir *aip;
struct jnewblk *jnewblk;
- while ((indirdep = LIST_FIRST(&newblk->nb_indirdeps)) != NULL) {
- indirdep->ir_state &= ~ONDEPLIST;
- LIST_REMOVE(indirdep, ir_next);
- /*
- * If an indirdep is not on the buf worklist we need to
- * free it here as deallocate_dependencies() will never
- * find it. These pointers were never visible on disk and
- * can be discarded immediately.
- */
- while ((aip = LIST_FIRST(&indirdep->ir_completehd)) != NULL) {
- LIST_REMOVE(aip, ai_next);
- if (cancel_newblk(&aip->ai_block, NULL, wkhd) != NULL)
- panic("cancel_newblk: aip has journal entry");
- free_newblk(&aip->ai_block);
- }
- /*
- * If this indirdep is not attached to a buf it was simply
- * waiting on completion to clear completehd. free_indirdep()
- * asserts that nothing is dangling.
- */
- if ((indirdep->ir_state & ONWORKLIST) == 0)
- free_indirdep(indirdep);
- }
+ newblk->nb_state |= GOINGAWAY;
+ /*
+ * Previously we traversed the completedhd on each indirdep
+ * attached to this newblk to cancel them and gather journal
+ * work. Since we need only the oldest journal segment and
+ * the lowest point on the tree will always have the oldest
+ * journal segment we are free to release the segments
+ * of any subordinates and may leave the indirdep list to
+ * indirdep_complete() when this newblk is freed.
+ */
if (newblk->nb_state & ONDEPLIST) {
newblk->nb_state &= ~ONDEPLIST;
LIST_REMOVE(newblk, nb_deps);
@@ -5904,17 +6943,44 @@ cancel_newblk(newblk, wk, wkhd)
* superseding operation completes.
*/
jnewblk = newblk->nb_jnewblk;
- if (jnewblk != NULL) {
+ if (jnewblk != NULL && wk != NULL) {
newblk->nb_jnewblk = NULL;
jnewblk->jn_dep = wk;
}
if (!LIST_EMPTY(&newblk->nb_jwork))
jwork_move(wkhd, &newblk->nb_jwork);
+ /*
+ * When truncating we must free the newdirblk early to remove
+ * the pagedep from the hash before returning.
+ */
+ if ((wk = LIST_FIRST(&newblk->nb_newdirblk)) != NULL)
+ free_newdirblk(WK_NEWDIRBLK(wk));
+ if (!LIST_EMPTY(&newblk->nb_newdirblk))
+ panic("cancel_newblk: extra newdirblk");
return (jnewblk);
}
/*
+ * Schedule the freefrag associated with a newblk to be released once
+ * the pointers are written and the previous block is no longer needed.
+ */
+static void
+newblk_freefrag(newblk)
+ struct newblk *newblk;
+{
+ struct freefrag *freefrag;
+
+ if (newblk->nb_freefrag == NULL)
+ return;
+ freefrag = newblk->nb_freefrag;
+ newblk->nb_freefrag = NULL;
+ freefrag->ff_state |= COMPLETE;
+ if ((freefrag->ff_state & ALLCOMPLETE) == ALLCOMPLETE)
+ add_to_worklist(&freefrag->ff_list, 0);
+}
+
+/*
* Free a newblk. Generate a new freefrag work request if appropriate.
* This must be called after the inode pointer and any direct block pointers
* are valid or fully removed via truncate or frag extension.
@@ -5924,34 +6990,23 @@ free_newblk(newblk)
struct newblk *newblk;
{
struct indirdep *indirdep;
- struct newdirblk *newdirblk;
- struct freefrag *freefrag;
struct worklist *wk;
+ KASSERT(newblk->nb_jnewblk == NULL,
+ ("free_newblk; jnewblk %p still attached", newblk->nb_jnewblk));
mtx_assert(&lk, MA_OWNED);
+ newblk_freefrag(newblk);
if (newblk->nb_state & ONDEPLIST)
LIST_REMOVE(newblk, nb_deps);
if (newblk->nb_state & ONWORKLIST)
WORKLIST_REMOVE(&newblk->nb_list);
LIST_REMOVE(newblk, nb_hash);
- if ((freefrag = newblk->nb_freefrag) != NULL) {
- freefrag->ff_state |= COMPLETE;
- if ((freefrag->ff_state & ALLCOMPLETE) == ALLCOMPLETE)
- add_to_worklist(&freefrag->ff_list, 0);
- }
- if ((wk = LIST_FIRST(&newblk->nb_newdirblk)) != NULL) {
- newdirblk = WK_NEWDIRBLK(wk);
- WORKLIST_REMOVE(&newdirblk->db_list);
- if (!LIST_EMPTY(&newblk->nb_newdirblk))
- panic("free_newblk: extra newdirblk");
- free_newdirblk(newdirblk);
- }
- while ((indirdep = LIST_FIRST(&newblk->nb_indirdeps)) != NULL) {
- indirdep->ir_state |= DEPCOMPLETE;
+ if ((wk = LIST_FIRST(&newblk->nb_newdirblk)) != NULL)
+ free_newdirblk(WK_NEWDIRBLK(wk));
+ if (!LIST_EMPTY(&newblk->nb_newdirblk))
+ panic("free_newblk: extra newdirblk");
+ while ((indirdep = LIST_FIRST(&newblk->nb_indirdeps)) != NULL)
indirdep_complete(indirdep);
- }
- KASSERT(newblk->nb_jnewblk == NULL,
- ("free_newblk; jnewblk %p still attached", newblk->nb_jnewblk));
handle_jwork(&newblk->nb_jwork);
newblk->nb_list.wk_type = D_NEWBLK;
WORKITEM_FREE(newblk, D_NEWBLK);
@@ -5968,9 +7023,9 @@ free_newdirblk(newdirblk)
struct pagedep *pagedep;
struct diradd *dap;
struct worklist *wk;
- int i;
mtx_assert(&lk, MA_OWNED);
+ WORKLIST_REMOVE(&newdirblk->db_list);
/*
* If the pagedep is still linked onto the directory buffer
* dependency chain, then some of the entries on the
@@ -5983,21 +7038,13 @@ free_newdirblk(newdirblk)
*/
pagedep = newdirblk->db_pagedep;
pagedep->pd_state &= ~NEWBLOCK;
- if ((pagedep->pd_state & ONWORKLIST) == 0)
+ if ((pagedep->pd_state & ONWORKLIST) == 0) {
while ((dap = LIST_FIRST(&pagedep->pd_pendinghd)) != NULL)
free_diradd(dap, NULL);
- /*
- * If no dependencies remain, the pagedep will be freed.
- */
- for (i = 0; i < DAHASHSZ; i++)
- if (!LIST_EMPTY(&pagedep->pd_diraddhd[i]))
- break;
- if (i == DAHASHSZ && (pagedep->pd_state & ONWORKLIST) == 0 &&
- LIST_EMPTY(&pagedep->pd_jmvrefhd)) {
- KASSERT(LIST_FIRST(&pagedep->pd_dirremhd) == NULL,
- ("free_newdirblk: Freeing non-free pagedep %p", pagedep));
- LIST_REMOVE(pagedep, pd_hash);
- WORKITEM_FREE(pagedep, D_PAGEDEP);
+ /*
+ * If no dependencies remain, the pagedep will be freed.
+ */
+ free_pagedep(pagedep);
}
/* Should only ever be one item in the list. */
while ((wk = LIST_FIRST(&newdirblk->db_mkdir)) != NULL) {
@@ -6020,6 +7067,7 @@ softdep_freefile(pvp, ino, mode)
struct inode *ip = VTOI(pvp);
struct inodedep *inodedep;
struct freefile *freefile;
+ struct freeblks *freeblks;
/*
* This sets up the inode de-allocation dependency.
@@ -6048,28 +7096,38 @@ softdep_freefile(pvp, ino, mode)
*/
ACQUIRE_LOCK(&lk);
inodedep_lookup(pvp->v_mount, ino, 0, &inodedep);
- /*
- * Remove this inode from the unlinked list and set
- * GOINGAWAY as appropriate to indicate that this inode
- * will never be written.
- */
- if (inodedep && inodedep->id_state & UNLINKED) {
+ if (inodedep) {
/*
- * Save the journal work to be freed with the bitmap
- * before we clear UNLINKED. Otherwise it can be lost
- * if the inode block is written.
+ * Clear out freeblks that no longer need to reference
+ * this inode.
*/
- handle_bufwait(inodedep, &freefile->fx_jwork);
- clear_unlinked_inodedep(inodedep);
- /* Re-acquire inodedep as we've dropped lk. */
- inodedep_lookup(pvp->v_mount, ino, 0, &inodedep);
+ while ((freeblks =
+ TAILQ_FIRST(&inodedep->id_freeblklst)) != NULL) {
+ TAILQ_REMOVE(&inodedep->id_freeblklst, freeblks,
+ fb_next);
+ freeblks->fb_state &= ~ONDEPLIST;
+ }
+ /*
+ * Remove this inode from the unlinked list.
+ */
+ if (inodedep->id_state & UNLINKED) {
+ /*
+ * Save the journal work to be freed with the bitmap
+ * before we clear UNLINKED. Otherwise it can be lost
+ * if the inode block is written.
+ */
+ handle_bufwait(inodedep, &freefile->fx_jwork);
+ clear_unlinked_inodedep(inodedep);
+ /* Re-acquire inodedep as we've dropped lk. */
+ inodedep_lookup(pvp->v_mount, ino, 0, &inodedep);
+ }
}
if (inodedep == NULL || check_inode_unwritten(inodedep)) {
FREE_LOCK(&lk);
handle_workitem_freefile(freefile);
return;
}
- if (inodedep && (inodedep->id_state & DEPCOMPLETE) == 0)
+ if ((inodedep->id_state & DEPCOMPLETE) == 0)
inodedep->id_state |= GOINGAWAY;
WORKLIST_INSERT(&inodedep->id_inowait, &freefile->fx_list);
FREE_LOCK(&lk);
@@ -6154,6 +7212,7 @@ free_inodedep(inodedep)
!TAILQ_EMPTY(&inodedep->id_newinoupdt) ||
!TAILQ_EMPTY(&inodedep->id_extupdt) ||
!TAILQ_EMPTY(&inodedep->id_newextupdt) ||
+ !TAILQ_EMPTY(&inodedep->id_freeblklst) ||
inodedep->id_mkdiradd != NULL ||
inodedep->id_nlinkdelta != 0 ||
inodedep->id_savedino1 != NULL)
@@ -6181,54 +7240,81 @@ freework_freeblock(freework)
struct ufsmount *ump;
struct workhead wkhd;
struct fs *fs;
- int pending;
int bsize;
int needj;
+ mtx_assert(&lk, MA_OWNED);
+ /*
+ * Handle partial truncate separately.
+ */
+ if (freework->fw_indir) {
+ complete_trunc_indir(freework);
+ return;
+ }
freeblks = freework->fw_freeblks;
ump = VFSTOUFS(freeblks->fb_list.wk_mp);
fs = ump->um_fs;
needj = freeblks->fb_list.wk_mp->mnt_kern_flag & MNTK_SUJ;
bsize = lfragtosize(fs, freework->fw_frags);
- pending = btodb(bsize);
LIST_INIT(&wkhd);
/*
+ * DEPCOMPLETE is cleared in indirblk_insert() if the block lives
+ * on the indirblk hashtable and prevents premature freeing.
+ */
+ freework->fw_state |= DEPCOMPLETE;
+ /*
+ * SUJ needs to wait for the segment referencing freed indirect
+ * blocks to expire so that we know the checker will not confuse
+ * a re-allocated indirect block with its old contents.
+ */
+ if (needj && freework->fw_lbn <= -NDADDR)
+ indirblk_insert(freework);
+ /*
* If we are canceling an existing jnewblk pass it to the free
* routine, otherwise pass the freeblk which will ultimately
* release the freeblks. If we're not journaling, we can just
* free the freeblks immediately.
*/
- ACQUIRE_LOCK(&lk);
- LIST_SWAP(&wkhd, &freework->fw_jwork, worklist, wk_list);
jnewblk = freework->fw_jnewblk;
if (jnewblk != NULL) {
- /* Could've already been canceled in indir_trunc(). */
- if ((jnewblk->jn_state & GOINGAWAY) == 0)
- cancel_jnewblk(jnewblk, &wkhd);
+ cancel_jnewblk(jnewblk, &wkhd);
needj = 0;
- } else if (needj)
+ } else if (needj) {
+ freework->fw_state |= DELAYEDFREE;
+ freeblks->fb_cgwait++;
WORKLIST_INSERT(&wkhd, &freework->fw_list);
- freeblks->fb_chkcnt -= pending;
- FREE_LOCK(&lk);
- /*
- * extattr blocks don't show up in pending blocks. XXX why?
- */
- if (freework->fw_lbn >= 0 || freework->fw_lbn <= -NDADDR) {
- UFS_LOCK(ump);
- fs->fs_pendingblocks -= pending;
- UFS_UNLOCK(ump);
}
- ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno,
- bsize, freeblks->fb_previousinum, &wkhd);
- if (needj)
- return;
+ freeblks->fb_freecnt += btodb(bsize);
+ FREE_LOCK(&lk);
+ ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, bsize,
+ freeblks->fb_inum, freeblks->fb_vtype, &wkhd);
+ ACQUIRE_LOCK(&lk);
/*
* The jnewblk will be discarded and the bits in the map never
* made it to disk. We can immediately free the freeblk.
*/
- ACQUIRE_LOCK(&lk);
- handle_written_freework(freework);
- FREE_LOCK(&lk);
+ if (needj == 0)
+ handle_written_freework(freework);
+}
+
+/*
+ * We enqueue freework items that need processing back on the freeblks and
+ * add the freeblks to the worklist. This makes it easier to find all work
+ * required to flush a truncation in process_truncates().
+ */
+static void
+freework_enqueue(freework)
+ struct freework *freework;
+{
+ struct freeblks *freeblks;
+
+ freeblks = freework->fw_freeblks;
+ if ((freework->fw_state & INPROGRESS) == 0)
+ WORKLIST_INSERT(&freeblks->fb_freeworkhd, &freework->fw_list);
+ if ((freeblks->fb_state &
+ (ONWORKLIST | INPROGRESS | ALLCOMPLETE)) == ALLCOMPLETE &&
+ LIST_EMPTY(&freeblks->fb_jblkdephd))
+ add_to_worklist(&freeblks->fb_list, WK_NODELAY);
}
/*
@@ -6246,21 +7332,28 @@ handle_workitem_indirblk(freework)
struct ufsmount *ump;
struct fs *fs;
-
freeblks = freework->fw_freeblks;
ump = VFSTOUFS(freeblks->fb_list.wk_mp);
fs = ump->um_fs;
- if (freework->fw_off == NINDIR(fs))
+ if (freework->fw_state & DEPCOMPLETE) {
+ handle_written_freework(freework);
+ return;
+ }
+ if (freework->fw_off == NINDIR(fs)) {
freework_freeblock(freework);
- else
- indir_trunc(freework, fsbtodb(fs, freework->fw_blkno),
- freework->fw_lbn);
+ return;
+ }
+ freework->fw_state |= INPROGRESS;
+ FREE_LOCK(&lk);
+ indir_trunc(freework, fsbtodb(fs, freework->fw_blkno),
+ freework->fw_lbn);
+ ACQUIRE_LOCK(&lk);
}
/*
* Called when a freework structure attached to a cg buf is written. The
* ref on either the parent or the freeblks structure is released and
- * either may be added to the worklist if it is the final ref.
+ * the freeblks is added back to the worklist if there is more work to do.
*/
static void
handle_written_freework(freework)
@@ -6268,48 +7361,24 @@ handle_written_freework(freework)
{
struct freeblks *freeblks;
struct freework *parent;
- struct jsegdep *jsegdep;
- struct worklist *wk;
- int needj;
- needj = 0;
freeblks = freework->fw_freeblks;
parent = freework->fw_parent;
- /*
- * SUJ needs to wait for the segment referencing freed indirect
- * blocks to expire so that we know the checker will not confuse
- * a re-allocated indirect block with its old contents.
- */
- if (freework->fw_lbn <= -NDADDR &&
- freework->fw_list.wk_mp->mnt_kern_flag & MNTK_SUJ) {
- LIST_FOREACH(wk, &freeblks->fb_jwork, wk_list)
- if (wk->wk_type == D_JSEGDEP)
- break;
- if (wk) {
- jsegdep = WK_JSEGDEP(wk);
- LIST_INSERT_HEAD(&jsegdep->jd_seg->js_indirs,
- freework, fw_next);
- WORKLIST_INSERT(INDIR_HASH(freework->fw_list.wk_mp,
- freework->fw_blkno), &freework->fw_list);
- needj = 1;
- }
- }
- if (parent) {
- if (--parent->fw_ref != 0)
- parent = NULL;
- freeblks = NULL;
- } else if (--freeblks->fb_ref != 0)
- freeblks = NULL;
- if (needj == 0)
+ if (freework->fw_state & DELAYEDFREE)
+ freeblks->fb_cgwait--;
+ freework->fw_state |= COMPLETE;
+ if ((freework->fw_state & ALLCOMPLETE) == ALLCOMPLETE)
WORKITEM_FREE(freework, D_FREEWORK);
- /*
- * Don't delay these block frees or it takes an intolerable amount
- * of time to process truncates and free their journal entries.
- */
- if (freeblks)
- add_to_worklist(&freeblks->fb_list, 1);
- if (parent)
- add_to_worklist(&parent->fw_list, 1);
+ if (parent) {
+ if (--parent->fw_ref == 0)
+ freework_enqueue(parent);
+ return;
+ }
+ if (--freeblks->fb_ref != 0)
+ return;
+ if ((freeblks->fb_state & (ALLCOMPLETE | ONWORKLIST | INPROGRESS)) ==
+ ALLCOMPLETE && LIST_EMPTY(&freeblks->fb_jblkdephd))
+ add_to_worklist(&freeblks->fb_list, WK_NODELAY);
}
/*
@@ -6320,38 +7389,73 @@ handle_written_freework(freework)
* to the number of blocks allocated for the file) are also
* performed in this function.
*/
-static void
+static int
handle_workitem_freeblocks(freeblks, flags)
struct freeblks *freeblks;
int flags;
{
struct freework *freework;
+ struct newblk *newblk;
+ struct allocindir *aip;
+ struct ufsmount *ump;
struct worklist *wk;
- KASSERT(LIST_EMPTY(&freeblks->fb_jfreeblkhd),
+ KASSERT(LIST_EMPTY(&freeblks->fb_jblkdephd),
("handle_workitem_freeblocks: Journal entries not written."));
- if (LIST_EMPTY(&freeblks->fb_freeworkhd)) {
- handle_complete_freeblocks(freeblks);
- return;
- }
- freeblks->fb_ref++;
+ ump = VFSTOUFS(freeblks->fb_list.wk_mp);
+ ACQUIRE_LOCK(&lk);
while ((wk = LIST_FIRST(&freeblks->fb_freeworkhd)) != NULL) {
- KASSERT(wk->wk_type == D_FREEWORK,
- ("handle_workitem_freeblocks: Unknown type %s",
- TYPENAME(wk->wk_type)));
- WORKLIST_REMOVE_UNLOCKED(wk);
- freework = WK_FREEWORK(wk);
- if (freework->fw_lbn <= -NDADDR)
- handle_workitem_indirblk(freework);
- else
- freework_freeblock(freework);
+ WORKLIST_REMOVE(wk);
+ switch (wk->wk_type) {
+ case D_DIRREM:
+ wk->wk_state |= COMPLETE;
+ add_to_worklist(wk, 0);
+ continue;
+
+ case D_ALLOCDIRECT:
+ free_newblk(WK_NEWBLK(wk));
+ continue;
+
+ case D_ALLOCINDIR:
+ aip = WK_ALLOCINDIR(wk);
+ freework = NULL;
+ if (aip->ai_state & DELAYEDFREE) {
+ FREE_LOCK(&lk);
+ freework = newfreework(ump, freeblks, NULL,
+ aip->ai_lbn, aip->ai_newblkno,
+ ump->um_fs->fs_frag, 0, 0);
+ ACQUIRE_LOCK(&lk);
+ }
+ newblk = WK_NEWBLK(wk);
+ if (newblk->nb_jnewblk) {
+ freework->fw_jnewblk = newblk->nb_jnewblk;
+ newblk->nb_jnewblk->jn_dep = &freework->fw_list;
+ newblk->nb_jnewblk = NULL;
+ }
+ free_newblk(newblk);
+ continue;
+
+ case D_FREEWORK:
+ freework = WK_FREEWORK(wk);
+ if (freework->fw_lbn <= -NDADDR)
+ handle_workitem_indirblk(freework);
+ else
+ freework_freeblock(freework);
+ continue;
+ default:
+ panic("handle_workitem_freeblocks: Unknown type %s",
+ TYPENAME(wk->wk_type));
+ }
}
- ACQUIRE_LOCK(&lk);
- if (--freeblks->fb_ref != 0)
+ if (freeblks->fb_ref != 0) {
+ freeblks->fb_state &= ~INPROGRESS;
+ wake_worklist(&freeblks->fb_list);
freeblks = NULL;
+ }
FREE_LOCK(&lk);
if (freeblks)
- handle_complete_freeblocks(freeblks);
+ return handle_complete_freeblocks(freeblks, flags);
+ return (0);
}
/*
@@ -6359,41 +7463,64 @@ handle_workitem_freeblocks(freeblks, flags)
* freeblocks dependency and any journal work awaiting completion. This
* can not be called until all other dependencies are stable on disk.
*/
-static void
-handle_complete_freeblocks(freeblks)
+static int
+handle_complete_freeblocks(freeblks, flags)
struct freeblks *freeblks;
+ int flags;
{
+ struct inodedep *inodedep;
struct inode *ip;
struct vnode *vp;
struct fs *fs;
struct ufsmount *ump;
- int flags;
+ ufs2_daddr_t spare;
ump = VFSTOUFS(freeblks->fb_list.wk_mp);
fs = ump->um_fs;
- flags = LK_NOWAIT;
+ flags = LK_EXCLUSIVE | flags;
+ spare = freeblks->fb_freecnt - freeblks->fb_chkcnt;
/*
- * If we still have not finished background cleanup, then check
- * to see if the block count needs to be adjusted.
+ * If we did not release the expected number of blocks we may have
+ * to adjust the inode block count here. Only do so if it wasn't
+ * a truncation to zero and the modrev still matches.
*/
- if (freeblks->fb_chkcnt != 0 && (fs->fs_flags & FS_UNCLEAN) != 0 &&
- ffs_vgetf(freeblks->fb_list.wk_mp, freeblks->fb_previousinum,
- (flags & LK_NOWAIT) | LK_EXCLUSIVE, &vp, FFSV_FORCEINSMQ) == 0) {
+ if (spare && freeblks->fb_len != 0) {
+ if (ffs_vgetf(freeblks->fb_list.wk_mp, freeblks->fb_inum,
+ flags, &vp, FFSV_FORCEINSMQ) != 0)
+ return (EBUSY);
ip = VTOI(vp);
- DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + freeblks->fb_chkcnt);
- ip->i_flag |= IN_CHANGE;
+ if (DIP(ip, i_modrev) == freeblks->fb_modrev) {
+ DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - spare);
+ ip->i_flag |= IN_CHANGE;
+ /*
+ * We must wait so this happens before the
+ * journal is reclaimed.
+ */
+ ffs_update(vp, 1);
+ }
vput(vp);
}
-
- if (!(freeblks->fb_chkcnt == 0 ||
- ((fs->fs_flags & FS_UNCLEAN) != 0 && (flags & LK_NOWAIT) == 0)))
- printf(
- "handle_workitem_freeblocks: inode %ju block count %jd\n",
- (uintmax_t)freeblks->fb_previousinum,
- (intmax_t)freeblks->fb_chkcnt);
-
+ if (freeblks->fb_chkcnt) {
+ UFS_LOCK(ump);
+ fs->fs_pendingblocks -= freeblks->fb_chkcnt;
+ UFS_UNLOCK(ump);
+ }
+#ifdef QUOTA
+ /* Handle spare. */
+ if (spare)
+ quotaadj(freeblks->fb_quota, ump, -spare);
+ quotarele(freeblks->fb_quota);
+#endif
ACQUIRE_LOCK(&lk);
+ if (freeblks->fb_state & ONDEPLIST) {
+ inodedep_lookup(freeblks->fb_list.wk_mp, freeblks->fb_inum,
+ 0, &inodedep);
+ TAILQ_REMOVE(&inodedep->id_freeblklst, freeblks, fb_next);
+ freeblks->fb_state &= ~ONDEPLIST;
+ if (TAILQ_EMPTY(&inodedep->id_freeblklst))
+ free_inodedep(inodedep);
+ }
/*
* All of the freeblock deps must be complete prior to this call
* so it's now safe to complete earlier outstanding journal entries.
@@ -6401,13 +7528,19 @@ handle_complete_freeblocks(freeblks)
handle_jwork(&freeblks->fb_jwork);
WORKITEM_FREE(freeblks, D_FREEBLKS);
FREE_LOCK(&lk);
+ return (0);
}
/*
- * Release blocks associated with the inode ip and stored in the indirect
+ * Release blocks associated with the freeblks and stored in the indirect
* block dbn. If level is greater than SINGLE, the block is an indirect block
* and recursive calls to indirtrunc must be used to cleanse other indirect
* blocks.
+ *
+ * This handles partial and complete truncation of blocks. Partial is noted
+ * with goingaway == 0. In this case the freework is completed after the
+ * zero'd indirects are written to disk. For full truncation the freework
+ * is completed after the block is freed.
*/
static void
indir_trunc(freework, dbn, lbn)
@@ -6417,165 +7550,113 @@ indir_trunc(freework, dbn, lbn)
{
struct freework *nfreework;
struct workhead wkhd;
- struct jnewblk *jnewblkn;
- struct jnewblk *jnewblk;
struct freeblks *freeblks;
struct buf *bp;
struct fs *fs;
- struct worklist *wkn;
- struct worklist *wk;
struct indirdep *indirdep;
struct ufsmount *ump;
ufs1_daddr_t *bap1 = 0;
ufs2_daddr_t nb, nnb, *bap2 = 0;
- ufs_lbn_t lbnadd;
+ ufs_lbn_t lbnadd, nlbn;
int i, nblocks, ufs1fmt;
int fs_pendingblocks;
+ int goingaway;
int freedeps;
int needj;
int level;
int cnt;
- LIST_INIT(&wkhd);
- level = lbn_level(lbn);
- if (level == -1)
- panic("indir_trunc: Invalid lbn %jd\n", lbn);
freeblks = freework->fw_freeblks;
ump = VFSTOUFS(freeblks->fb_list.wk_mp);
fs = ump->um_fs;
- fs_pendingblocks = 0;
- freedeps = 0;
- needj = UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ;
- lbnadd = lbn_offset(fs, level);
/*
- * Get buffer of block pointers to be freed. This routine is not
- * called until the zero'ed inode has been written, so it is safe
- * to free blocks as they are encountered. Because the inode has
- * been zero'ed, calls to bmap on these blocks will fail. So, we
- * have to use the on-disk address and the block device for the
- * filesystem to look them up. If the file was deleted before its
- * indirect blocks were all written to disk, the routine that set
- * us up (deallocate_dependencies) will have arranged to leave
- * a complete copy of the indirect block in memory for our use.
- * Otherwise we have to read the blocks in from the disk.
- */
-#ifdef notyet
- bp = getblk(freeblks->fb_devvp, dbn, (int)fs->fs_bsize, 0, 0,
- GB_NOCREAT);
-#else
- bp = incore(&freeblks->fb_devvp->v_bufobj, dbn);
-#endif
+ * Get buffer of block pointers to be freed. There are three cases:
+ *
+ * 1) Partial truncate caches the indirdep pointer in the freework
+ * which provides us a back copy to the save bp which holds the
+ * pointers we want to clear. When this completes the zero
+ * pointers are written to the real copy.
+ * 2) The indirect is being completely truncated, cancel_indirdep()
+ * eliminated the real copy and placed the indirdep on the saved
+ * copy. The indirdep and buf are discarded when this completes.
+ * 3) The indirect was not in memory, we read a copy off of the disk
+ * using the devvp and drop and invalidate the buffer when we're
+ * done.
+ */
+ goingaway = 1;
+ indirdep = NULL;
+ if (freework->fw_indir != NULL) {
+ goingaway = 0;
+ indirdep = freework->fw_indir;
+ bp = indirdep->ir_savebp;
+ if (bp == NULL || bp->b_blkno != dbn)
+ panic("indir_trunc: Bad saved buf %p blkno %jd",
+ bp, (intmax_t)dbn);
+ } else if ((bp = incore(&freeblks->fb_devvp->v_bufobj, dbn)) != NULL) {
+ /*
+ * The lock prevents the buf dep list from changing and
+ * indirects on devvp should only ever have one dependency.
+ */
+ indirdep = WK_INDIRDEP(LIST_FIRST(&bp->b_dep));
+ if (indirdep == NULL || (indirdep->ir_state & GOINGAWAY) == 0)
+ panic("indir_trunc: Bad indirdep %p from buf %p",
+ indirdep, bp);
+ } else if (bread(freeblks->fb_devvp, dbn, (int)fs->fs_bsize,
+ NOCRED, &bp) != 0) {
+ brelse(bp);
+ return;
+ }
ACQUIRE_LOCK(&lk);
- if (bp != NULL && (wk = LIST_FIRST(&bp->b_dep)) != NULL) {
- if (wk->wk_type != D_INDIRDEP ||
- (wk->wk_state & GOINGAWAY) == 0)
- panic("indir_trunc: lost indirdep %p", wk);
- indirdep = WK_INDIRDEP(wk);
- LIST_SWAP(&wkhd, &indirdep->ir_jwork, worklist, wk_list);
- LIST_FOREACH_SAFE(jnewblk, &indirdep->ir_jnewblkhd,
- jn_indirdeps, jnewblkn) {
+ /* Protects against a race with complete_trunc_indir(). */
+ freework->fw_state &= ~INPROGRESS;
+ /*
+ * If we have an indirdep we need to enforce the truncation order
+ * and discard it when it is complete.
+ */
+ if (indirdep) {
+ if (freework != TAILQ_FIRST(&indirdep->ir_trunc) &&
+ !TAILQ_EMPTY(&indirdep->ir_trunc)) {
/*
- * XXX This cancel may cause some lengthy delay
- * before the record is reclaimed below.
+ * Add the complete truncate to the list on the
+ * indirdep to enforce in-order processing.
*/
- LIST_REMOVE(jnewblk, jn_indirdeps);
- cancel_jnewblk(jnewblk, &wkhd);
- }
-
- free_indirdep(indirdep);
- if (!LIST_EMPTY(&bp->b_dep))
- panic("indir_trunc: dangling dep %p",
- LIST_FIRST(&bp->b_dep));
- ump->um_numindirdeps -= 1;
- FREE_LOCK(&lk);
- } else {
-#ifdef notyet
- if (bp)
- brelse(bp);
-#endif
- FREE_LOCK(&lk);
- if (bread(freeblks->fb_devvp, dbn, (int)fs->fs_bsize,
- NOCRED, &bp) != 0) {
- brelse(bp);
+ if (freework->fw_indir == NULL)
+ TAILQ_INSERT_TAIL(&indirdep->ir_trunc,
+ freework, fw_next);
+ FREE_LOCK(&lk);
return;
}
+ /*
+ * If we're goingaway, free the indirdep. Otherwise it will
+ * linger until the write completes.
+ */
+ if (goingaway) {
+ free_indirdep(indirdep);
+ ump->um_numindirdeps -= 1;
+ }
}
- /*
- * Recursively free indirect blocks.
- */
+ FREE_LOCK(&lk);
+ /* Initialize pointers depending on block size. */
if (ump->um_fstype == UFS1) {
- ufs1fmt = 1;
bap1 = (ufs1_daddr_t *)bp->b_data;
+ nb = bap1[freework->fw_off];
+ ufs1fmt = 1;
} else {
- ufs1fmt = 0;
bap2 = (ufs2_daddr_t *)bp->b_data;
+ nb = bap2[freework->fw_off];
+ ufs1fmt = 0;
}
-
- /*
- * Reclaim indirect blocks which never made it to disk.
- */
- cnt = 0;
- LIST_FOREACH_SAFE(wk, &wkhd, wk_list, wkn) {
- if (wk->wk_type != D_JNEWBLK)
- continue;
- /* XXX Is the lock necessary here for more than an assert? */
- ACQUIRE_LOCK(&lk);
- WORKLIST_REMOVE(wk);
- FREE_LOCK(&lk);
- jnewblk = WK_JNEWBLK(wk);
- if (jnewblk->jn_lbn > 0)
- i = (jnewblk->jn_lbn - -lbn) / lbnadd;
- else
- i = (-(jnewblk->jn_lbn + level - 1) - -(lbn + level)) /
- lbnadd;
- KASSERT(i >= 0 && i < NINDIR(fs),
- ("indir_trunc: Index out of range %d parent %jd lbn %jd level %d",
- i, lbn, jnewblk->jn_lbn, level));
- /* Clear the pointer so it isn't found below. */
- if (ufs1fmt) {
- nb = bap1[i];
- bap1[i] = 0;
- } else {
- nb = bap2[i];
- bap2[i] = 0;
- }
- KASSERT(nb == jnewblk->jn_blkno,
- ("indir_trunc: Block mismatch %jd != %jd",
- nb, jnewblk->jn_blkno));
- if (level != 0) {
- ufs_lbn_t nlbn;
-
- nlbn = (lbn + 1) - (i * lbnadd);
- nfreework = newfreework(ump, freeblks, freework,
- nlbn, nb, fs->fs_frag, 0);
- nfreework->fw_jnewblk = jnewblk;
- freedeps++;
- indir_trunc(nfreework, fsbtodb(fs, nb), nlbn);
- } else {
- struct workhead freewk;
-
- LIST_INIT(&freewk);
- ACQUIRE_LOCK(&lk);
- WORKLIST_INSERT(&freewk, wk);
- FREE_LOCK(&lk);
- ffs_blkfree(ump, fs, freeblks->fb_devvp,
- jnewblk->jn_blkno, fs->fs_bsize,
- freeblks->fb_previousinum, &freewk);
- }
- cnt++;
- }
- ACQUIRE_LOCK(&lk);
- /* Any remaining journal work can be completed with freeblks. */
- jwork_move(&freeblks->fb_jwork, &wkhd);
- FREE_LOCK(&lk);
+ level = lbn_level(lbn);
+ needj = UFSTOVFS(ump)->mnt_kern_flag & MNTK_SUJ;
+ lbnadd = lbn_offset(fs, level);
nblocks = btodb(fs->fs_bsize);
- if (ufs1fmt)
- nb = bap1[0];
- else
- nb = bap2[0];
nfreework = freework;
+ freedeps = 0;
+ cnt = 0;
/*
- * Reclaim on disk blocks.
+ * Reclaim blocks. Traverses into nested indirect levels and
+ * arranges for the current level to be freed when subordinates
+ * are free when journaling.
*/
for (i = freework->fw_off; i < NINDIR(fs); i++, nb = nnb) {
if (i != NINDIR(fs) - 1) {
@@ -6589,12 +7670,10 @@ indir_trunc(freework, dbn, lbn)
continue;
cnt++;
if (level != 0) {
- ufs_lbn_t nlbn;
-
nlbn = (lbn + 1) - (i * lbnadd);
if (needj != 0) {
nfreework = newfreework(ump, freeblks, freework,
- nlbn, nb, fs->fs_frag, 0);
+ nlbn, nb, fs->fs_frag, 0, 0);
freedeps++;
}
indir_trunc(nfreework, fsbtodb(fs, nb), nlbn);
@@ -6614,85 +7693,106 @@ indir_trunc(freework, dbn, lbn)
freedeps++;
}
ffs_blkfree(ump, fs, freeblks->fb_devvp, nb,
- fs->fs_bsize, freeblks->fb_previousinum, &wkhd);
+ fs->fs_bsize, freeblks->fb_inum,
+ freeblks->fb_vtype, &wkhd);
}
}
+ if (goingaway) {
+ bp->b_flags |= B_INVAL | B_NOCACHE;
+ brelse(bp);
+ }
+ fs_pendingblocks = 0;
if (level == 0)
fs_pendingblocks = (nblocks * cnt);
/*
- * If we're not journaling we can free the indirect now. Otherwise
- * setup the ref counts and offset so this indirect can be completed
- * when its children are free.
+ * If we are journaling set up the ref counts and offset so this
+ * indirect can be completed when its children are free.
*/
- if (needj == 0) {
- fs_pendingblocks += nblocks;
- dbn = dbtofsb(fs, dbn);
- ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize,
- freeblks->fb_previousinum, NULL);
- ACQUIRE_LOCK(&lk);
- freeblks->fb_chkcnt -= fs_pendingblocks;
- if (freework->fw_blkno == dbn)
- handle_written_freework(freework);
- FREE_LOCK(&lk);
- freework = NULL;
- } else {
+ if (needj) {
ACQUIRE_LOCK(&lk);
+ freeblks->fb_freecnt += fs_pendingblocks;
freework->fw_off = i;
freework->fw_ref += freedeps;
freework->fw_ref -= NINDIR(fs) + 1;
- if (freework->fw_ref != 0)
- freework = NULL;
- freeblks->fb_chkcnt -= fs_pendingblocks;
+ if (level == 0)
+ freeblks->fb_cgwait += freedeps;
+ if (freework->fw_ref == 0)
+ freework_freeblock(freework);
FREE_LOCK(&lk);
+ return;
}
- if (fs_pendingblocks) {
- UFS_LOCK(ump);
- fs->fs_pendingblocks -= fs_pendingblocks;
- UFS_UNLOCK(ump);
+ /*
+ * If we're not journaling we can free the indirect now.
+ */
+ fs_pendingblocks += nblocks;
+ dbn = dbtofsb(fs, dbn);
+ ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize,
+ freeblks->fb_inum, freeblks->fb_vtype, NULL);
+ /* Non SUJ softdep does single-threaded truncations. */
+ freeblks->fb_freecnt += fs_pendingblocks;
+ if (freework->fw_blkno == dbn) {
+ freework->fw_state |= ALLCOMPLETE;
+ ACQUIRE_LOCK(&lk);
+ handle_written_freework(freework);
+ FREE_LOCK(&lk);
}
- bp->b_flags |= B_INVAL | B_NOCACHE;
- brelse(bp);
- if (freework)
- handle_workitem_indirblk(freework);
return;
}
/*
- * Cancel an allocindir when it is removed via truncation.
+ * Cancel an allocindir when it is removed via truncation. When bp is not
+ * NULL the indirect never appeared on disk and is scheduled to be freed
+ * independently of the indir so we can more easily track journal work.
*/
static void
-cancel_allocindir(aip, inodedep, freeblks)
+cancel_allocindir(aip, bp, freeblks, trunc)
struct allocindir *aip;
- struct inodedep *inodedep;
+ struct buf *bp;
struct freeblks *freeblks;
+ int trunc;
{
- struct jnewblk *jnewblk;
+ struct indirdep *indirdep;
+ struct freefrag *freefrag;
struct newblk *newblk;
+ newblk = (struct newblk *)aip;
+ LIST_REMOVE(aip, ai_next);
+ /*
+ * We must eliminate the pointer in bp if it must be freed on its
+ * own due to partial truncate or pending journal work.
+ */
+ if (bp && (trunc || newblk->nb_jnewblk)) {
+ /*
+ * Clear the pointer and mark the aip to be freed
+ * directly if it never existed on disk.
+ */
+ aip->ai_state |= DELAYEDFREE;
+ indirdep = aip->ai_indirdep;
+ if (indirdep->ir_state & UFS1FMT)
+ ((ufs1_daddr_t *)bp->b_data)[aip->ai_offset] = 0;
+ else
+ ((ufs2_daddr_t *)bp->b_data)[aip->ai_offset] = 0;
+ }
+ /*
+ * When truncating the previous pointer will be freed via
+ * savedbp. Eliminate the freefrag which would dup free.
+ */
+ if (trunc && (freefrag = newblk->nb_freefrag) != NULL) {
+ newblk->nb_freefrag = NULL;
+ if (freefrag->ff_jdep)
+ cancel_jfreefrag(
+ WK_JFREEFRAG(freefrag->ff_jdep));
+ jwork_move(&freeblks->fb_jwork, &freefrag->ff_jwork);
+ WORKITEM_FREE(freefrag, D_FREEFRAG);
+ }
/*
* If the journal hasn't been written the jnewblk must be passed
* to the call to ffs_blkfree that reclaims the space. We accomplish
- * this by linking the journal dependency into the indirdep to be
- * freed when indir_trunc() is called. If the journal has already
- * been written we can simply reclaim the journal space when the
- * freeblks work is complete.
+ * this by leaving the journal dependency on the newblk to be freed
+ * when a freework is created in handle_workitem_freeblocks().
*/
- LIST_REMOVE(aip, ai_next);
- newblk = (struct newblk *)aip;
- if (newblk->nb_jnewblk == NULL) {
- if (cancel_newblk(newblk, NULL, &freeblks->fb_jwork))
- panic("cancel_allocindir: Unexpected dependency.");
- } else {
- jnewblk = cancel_newblk(newblk, &aip->ai_indirdep->ir_list,
- &aip->ai_indirdep->ir_jwork);
- if (jnewblk)
- LIST_INSERT_HEAD(&aip->ai_indirdep->ir_jnewblkhd,
- jnewblk, jn_indirdeps);
- }
- if (inodedep && inodedep->id_state & DEPCOMPLETE)
- WORKLIST_INSERT(&inodedep->id_bufwait, &newblk->nb_list);
- else
- free_newblk(newblk);
+ cancel_newblk(newblk, NULL, &freeblks->fb_jwork);
+ WORKLIST_INSERT(&freeblks->fb_freeworkhd, &newblk->nb_list);
}
/*
@@ -6750,13 +7850,15 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp)
* any subsequent additions are not marked live until the
* block is reachable via the inode.
*/
- if (pagedep_lookup(mp, newinum, 0, 0, &pagedep) == 0)
+ if (pagedep_lookup(mp, newdirbp, newinum, 0, 0, &pagedep) == 0)
panic("setup_newdir: lost pagedep");
LIST_FOREACH(wk, &newdirbp->b_dep, wk_list)
if (wk->wk_type == D_ALLOCDIRECT)
break;
if (wk == NULL)
panic("setup_newdir: lost allocdirect");
+ if (pagedep->pd_state & NEWBLOCK)
+ panic("setup_newdir: NEWBLOCK already set");
newblk = WK_NEWBLK(wk);
pagedep->pd_state |= NEWBLOCK;
pagedep->pd_newdirblk = newdirblk;
@@ -6788,7 +7890,7 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp)
WORKITEM_FREE(mkdir2, D_MKDIR);
} else {
LIST_INSERT_HEAD(&mkdirlisthd, mkdir2, md_mkdirs);
- WORKLIST_INSERT(&inodedep->id_bufwait,&mkdir2->md_list);
+ WORKLIST_INSERT(&inodedep->id_bufwait, &mkdir2->md_list);
}
*mkdirp = mkdir2;
@@ -6885,8 +7987,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk)
/*
* Link into parent directory pagedep to await its being written.
*/
- if (pagedep_lookup(mp, dp->i_number, lbn, DEPALLOC, &pagedep) == 0)
- WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list);
+ pagedep_lookup(mp, bp, dp->i_number, lbn, DEPALLOC, &pagedep);
#ifdef DEBUG
if (diradd_lookup(pagedep, offset) != NULL)
panic("softdep_setup_directory_add: %p already at off %d\n",
@@ -7027,11 +8128,8 @@ softdep_change_directoryentry_offset(bp, dp, base, oldloc, newloc, entrysize)
oldoffset = offset + (oldloc - base);
newoffset = offset + (newloc - base);
ACQUIRE_LOCK(&lk);
- if (pagedep_lookup(mp, dp->i_number, lbn, flags, &pagedep) == 0) {
- if (pagedep)
- WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list);
+ if (pagedep_lookup(mp, bp, dp->i_number, lbn, flags, &pagedep) == 0)
goto done;
- }
dap = diradd_lookup(pagedep, oldoffset);
if (dap) {
dap->da_offset = newoffset;
@@ -7327,7 +8425,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir)
direct = LIST_EMPTY(&dirrem->dm_jremrefhd);
FREE_LOCK(&lk);
if (direct)
- handle_workitem_remove(dirrem, NULL);
+ handle_workitem_remove(dirrem, 0);
}
}
@@ -7367,7 +8465,7 @@ cancel_diradd_dotdot(ip, dirrem, jremref)
struct diradd *dap;
struct worklist *wk;
- if (pagedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0, 0,
+ if (pagedep_lookup(UFSTOVFS(ip->i_ump), NULL, ip->i_number, 0, 0,
&pagedep) == 0)
return (jremref);
dap = diradd_lookup(pagedep, DOTDOT_OFFSET);
@@ -7536,10 +8634,10 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp)
ACQUIRE_LOCK(&lk);
lbn = lblkno(dp->i_fs, dp->i_offset);
offset = blkoff(dp->i_fs, dp->i_offset);
- if (pagedep_lookup(UFSTOVFS(dp->i_ump), dp->i_number, lbn, DEPALLOC,
- &pagedep) == 0)
- WORKLIST_INSERT(&bp->b_dep, &pagedep->pd_list);
+ pagedep_lookup(UFSTOVFS(dp->i_ump), bp, dp->i_number, lbn, DEPALLOC,
+ &pagedep);
dirrem->dm_pagedep = pagedep;
+ dirrem->dm_offset = offset;
/*
* If we're renaming a .. link to a new directory, cancel any
* existing MKDIR_PARENT mkdir. If it has already been canceled
@@ -8092,10 +9190,10 @@ clear_unlinked_inodedep(inodedep)
* This workitem decrements the inode's link count.
* If the link count reaches zero, the file is removed.
*/
-static void
-handle_workitem_remove(dirrem, xp)
+static int
+handle_workitem_remove(dirrem, flags)
struct dirrem *dirrem;
- struct vnode *xp;
+ int flags;
{
struct inodedep *inodedep;
struct workhead dotdotwk;
@@ -8105,7 +9203,6 @@ handle_workitem_remove(dirrem, xp)
struct vnode *vp;
struct inode *ip;
ino_t oldinum;
- int error;
if (dirrem->dm_state & ONWORKLIST)
panic("handle_workitem_remove: dirrem %p still on worklist",
@@ -8113,12 +9210,9 @@ handle_workitem_remove(dirrem, xp)
oldinum = dirrem->dm_oldinum;
mp = dirrem->dm_list.wk_mp;
ump = VFSTOUFS(mp);
- if ((vp = xp) == NULL &&
- (error = ffs_vgetf(mp, oldinum, LK_EXCLUSIVE, &vp,
- FFSV_FORCEINSMQ)) != 0) {
- softdep_error("handle_workitem_remove: vget", error);
- return;
- }
+ flags |= LK_EXCLUSIVE;
+ if (ffs_vgetf(mp, oldinum, flags, &vp, FFSV_FORCEINSMQ) != 0)
+ return (EBUSY);
ip = VTOI(vp);
ACQUIRE_LOCK(&lk);
if ((inodedep_lookup(mp, oldinum, 0, &inodedep)) == 0)
@@ -8209,22 +9303,17 @@ handle_workitem_remove(dirrem, xp)
if (inodedep == NULL ||
(inodedep->id_state & (DEPCOMPLETE | UNLINKED)) == UNLINKED ||
check_inode_unwritten(inodedep)) {
- if (xp != NULL)
- add_to_worklist(&dirrem->dm_list, 0);
FREE_LOCK(&lk);
- if (xp == NULL) {
- vput(vp);
- handle_workitem_remove(dirrem, NULL);
- }
- return;
+ vput(vp);
+ return handle_workitem_remove(dirrem, flags);
}
WORKLIST_INSERT(&inodedep->id_inowait, &dirrem->dm_list);
FREE_LOCK(&lk);
ip->i_flag |= IN_CHANGE;
out:
ffs_update(vp, 0);
- if (xp == NULL)
- vput(vp);
+ vput(vp);
+ return (0);
}
/*
@@ -8318,7 +9407,7 @@ softdep_disk_io_initiation(bp)
struct worklist marker;
struct inodedep *inodedep;
struct freeblks *freeblks;
- struct jfreeblk *jfreeblk;
+ struct jblkdep *jblkdep;
struct newblk *newblk;
/*
@@ -8370,19 +9459,18 @@ softdep_disk_io_initiation(bp)
case D_FREEBLKS:
freeblks = WK_FREEBLKS(wk);
- jfreeblk = LIST_FIRST(&freeblks->fb_jfreeblkhd);
+ jblkdep = LIST_FIRST(&freeblks->fb_jblkdephd);
/*
- * We have to wait for the jfreeblks to be journaled
+ * We have to wait for the freeblks to be journaled
* before we can write an inodeblock with updated
* pointers. Be careful to arrange the marker so
- * we revisit the jfreeblk if it's not removed by
+ * we revisit the freeblks if it's not removed by
* the first jwait().
*/
- if (jfreeblk != NULL) {
+ if (jblkdep != NULL) {
LIST_REMOVE(&marker, wk_list);
LIST_INSERT_BEFORE(wk, &marker, wk_list);
- stat_jwait_freeblks++;
- jwait(&jfreeblk->jf_list);
+ jwait(&jblkdep->jb_list, MNT_WAIT);
}
continue;
case D_ALLOCDIRECT:
@@ -8396,12 +9484,11 @@ softdep_disk_io_initiation(bp)
*/
newblk = WK_NEWBLK(wk);
if (newblk->nb_jnewblk != NULL &&
- indirblk_inseg(newblk->nb_list.wk_mp,
+ indirblk_lookup(newblk->nb_list.wk_mp,
newblk->nb_newblkno)) {
LIST_REMOVE(&marker, wk_list);
LIST_INSERT_BEFORE(wk, &marker, wk_list);
- stat_jwait_newblk++;
- jwait(&newblk->nb_jnewblk->jn_list);
+ jwait(&newblk->nb_jnewblk->jn_list, MNT_WAIT);
}
continue;
@@ -8461,14 +9548,10 @@ initiate_write_filepage(pagedep, bp)
* locked so the dependency can not go away.
*/
LIST_FOREACH(dirrem, &pagedep->pd_dirremhd, dm_next)
- while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL) {
- stat_jwait_filepage++;
- jwait(&jremref->jr_list);
- }
- while ((jmvref = LIST_FIRST(&pagedep->pd_jmvrefhd)) != NULL) {
- stat_jwait_filepage++;
- jwait(&jmvref->jm_list);
- }
+ while ((jremref = LIST_FIRST(&dirrem->dm_jremrefhd)) != NULL)
+ jwait(&jremref->jr_list, MNT_WAIT);
+ while ((jmvref = LIST_FIRST(&pagedep->pd_jmvrefhd)) != NULL)
+ jwait(&jmvref->jm_list, MNT_WAIT);
for (i = 0; i < DAHASHSZ; i++) {
LIST_FOREACH(dap, &pagedep->pd_diraddhd[i], da_pdlist) {
ep = (struct direct *)
@@ -8811,6 +9894,8 @@ initiate_write_inodeblock_ufs2(inodedep, bp)
#ifdef INVARIANTS
if (deplist != 0 && prevlbn >= adp->ad_offset)
panic("softdep_write_inodeblock: lbn order");
+ if ((adp->ad_state & ATTACHED) == 0)
+ panic("inodedep %p and adp %p not attached", inodedep, adp);
prevlbn = adp->ad_offset;
if (adp->ad_offset < NDADDR &&
dp->di_db[adp->ad_offset] != adp->ad_newblkno)
@@ -8900,10 +9985,9 @@ initiate_write_inodeblock_ufs2(inodedep, bp)
* list.
*/
static void
-cancel_indirdep(indirdep, bp, inodedep, freeblks)
+cancel_indirdep(indirdep, bp, freeblks)
struct indirdep *indirdep;
struct buf *bp;
- struct inodedep *inodedep;
struct freeblks *freeblks;
{
struct allocindir *aip;
@@ -8924,24 +10008,38 @@ cancel_indirdep(indirdep, bp, inodedep, freeblks)
*/
if (indirdep->ir_state & GOINGAWAY)
panic("cancel_indirdep: already gone");
- if (indirdep->ir_state & ONDEPLIST) {
- indirdep->ir_state &= ~ONDEPLIST;
+ if ((indirdep->ir_state & DEPCOMPLETE) == 0) {
+ indirdep->ir_state |= DEPCOMPLETE;
LIST_REMOVE(indirdep, ir_next);
}
indirdep->ir_state |= GOINGAWAY;
VFSTOUFS(indirdep->ir_list.wk_mp)->um_numindirdeps += 1;
+ /*
+ * Pass in bp for blocks still have journal writes
+ * pending so we can cancel them on their own.
+ */
while ((aip = LIST_FIRST(&indirdep->ir_deplisthd)) != 0)
- cancel_allocindir(aip, inodedep, freeblks);
+ cancel_allocindir(aip, bp, freeblks, 0);
while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0)
- cancel_allocindir(aip, inodedep, freeblks);
+ cancel_allocindir(aip, NULL, freeblks, 0);
while ((aip = LIST_FIRST(&indirdep->ir_writehd)) != 0)
- cancel_allocindir(aip, inodedep, freeblks);
+ cancel_allocindir(aip, NULL, freeblks, 0);
while ((aip = LIST_FIRST(&indirdep->ir_completehd)) != 0)
- cancel_allocindir(aip, inodedep, freeblks);
- bcopy(bp->b_data, indirdep->ir_savebp->b_data, bp->b_bcount);
+ cancel_allocindir(aip, NULL, freeblks, 0);
+ /*
+ * If there are pending partial truncations we need to keep the
+ * old block copy around until they complete. This is because
+ * the current b_data is not a perfect superset of the available
+ * blocks.
+ */
+ if (TAILQ_EMPTY(&indirdep->ir_trunc))
+ bcopy(bp->b_data, indirdep->ir_savebp->b_data, bp->b_bcount);
+ else
+ bcopy(bp->b_data, indirdep->ir_saveddata, bp->b_bcount);
WORKLIST_REMOVE(&indirdep->ir_list);
WORKLIST_INSERT(&indirdep->ir_savebp->b_dep, &indirdep->ir_list);
- indirdep->ir_savebp = NULL;
+ indirdep->ir_bp = NULL;
+ indirdep->ir_freeblks = freeblks;
}
/*
@@ -8952,10 +10050,8 @@ free_indirdep(indirdep)
struct indirdep *indirdep;
{
- KASSERT(LIST_EMPTY(&indirdep->ir_jwork),
- ("free_indirdep: Journal work not empty."));
- KASSERT(LIST_EMPTY(&indirdep->ir_jnewblkhd),
- ("free_indirdep: Journal new block list not empty."));
+ KASSERT(TAILQ_EMPTY(&indirdep->ir_trunc),
+ ("free_indirdep: Indir trunc list not empty."));
KASSERT(LIST_EMPTY(&indirdep->ir_completehd),
("free_indirdep: Complete head not empty."));
KASSERT(LIST_EMPTY(&indirdep->ir_writehd),
@@ -8964,10 +10060,10 @@ free_indirdep(indirdep)
("free_indirdep: done head not empty."));
KASSERT(LIST_EMPTY(&indirdep->ir_deplisthd),
("free_indirdep: deplist head not empty."));
- KASSERT(indirdep->ir_savebp == NULL,
- ("free_indirdep: %p ir_savebp != NULL", indirdep));
- KASSERT((indirdep->ir_state & ONDEPLIST) == 0,
- ("free_indirdep: %p still on deplist.", indirdep));
+ KASSERT((indirdep->ir_state & DEPCOMPLETE),
+ ("free_indirdep: %p still on newblk list.", indirdep));
+ KASSERT(indirdep->ir_saveddata == NULL,
+ ("free_indirdep: %p still has saved data.", indirdep));
if (indirdep->ir_state & ONWORKLIST)
WORKLIST_REMOVE(&indirdep->ir_list);
WORKITEM_FREE(indirdep, D_INDIRDEP);
@@ -8984,22 +10080,25 @@ initiate_write_indirdep(indirdep, bp)
struct buf *bp;
{
+ indirdep->ir_state |= IOSTARTED;
if (indirdep->ir_state & GOINGAWAY)
panic("disk_io_initiation: indirdep gone");
-
/*
* If there are no remaining dependencies, this will be writing
* the real pointers.
*/
- if (LIST_EMPTY(&indirdep->ir_deplisthd))
+ if (LIST_EMPTY(&indirdep->ir_deplisthd) &&
+ TAILQ_EMPTY(&indirdep->ir_trunc))
return;
/*
* Replace up-to-date version with safe version.
*/
- FREE_LOCK(&lk);
- indirdep->ir_saveddata = malloc(bp->b_bcount, M_INDIRDEP,
- M_SOFTDEP_FLAGS);
- ACQUIRE_LOCK(&lk);
+ if (indirdep->ir_saveddata == NULL) {
+ FREE_LOCK(&lk);
+ indirdep->ir_saveddata = malloc(bp->b_bcount, M_INDIRDEP,
+ M_SOFTDEP_FLAGS);
+ ACQUIRE_LOCK(&lk);
+ }
indirdep->ir_state &= ~ATTACHED;
indirdep->ir_state |= UNDONE;
bcopy(bp->b_data, indirdep->ir_saveddata, bp->b_bcount);
@@ -9066,11 +10165,11 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd)
int frags;
struct workhead *wkhd;
{
- struct jnewblk *jnewblk;
- struct worklist *wk, *wkn;
-#ifdef SUJ_DEBUG
struct bmsafemap *bmsafemap;
+ struct jnewblk *jnewblk;
+ struct worklist *wk;
struct fs *fs;
+#ifdef SUJ_DEBUG
uint8_t *blksfree;
struct cg *cgp;
ufs2_daddr_t jstart;
@@ -9081,25 +10180,29 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd)
#endif
ACQUIRE_LOCK(&lk);
+ /* Lookup the bmsafemap so we track when it is dirty. */
+ fs = VFSTOUFS(mp)->um_fs;
+ bmsafemap = bmsafemap_lookup(mp, bp, dtog(fs, blkno));
/*
* Detach any jnewblks which have been canceled. They must linger
* until the bitmap is cleared again by ffs_blkfree() to prevent
* an unjournaled allocation from hitting the disk.
*/
if (wkhd) {
- LIST_FOREACH_SAFE(wk, wkhd, wk_list, wkn) {
- if (wk->wk_type != D_JNEWBLK)
+ while ((wk = LIST_FIRST(wkhd)) != NULL) {
+ WORKLIST_REMOVE(wk);
+ if (wk->wk_type != D_JNEWBLK) {
+ WORKLIST_INSERT(&bmsafemap->sm_freehd, wk);
continue;
+ }
jnewblk = WK_JNEWBLK(wk);
KASSERT(jnewblk->jn_state & GOINGAWAY,
("softdep_setup_blkfree: jnewblk not canceled."));
- WORKLIST_REMOVE(wk);
#ifdef SUJ_DEBUG
/*
* Assert that this block is free in the bitmap
* before we discard the jnewblk.
*/
- fs = VFSTOUFS(mp)->um_fs;
cgp = (struct cg *)bp->b_data;
blksfree = cg_blksfree(cgp);
bno = dtogd(fs, jnewblk->jn_blkno);
@@ -9117,12 +10220,6 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd)
wk->wk_state |= COMPLETE | ATTACHED;
free_jnewblk(jnewblk);
}
- /*
- * The buf must be locked by the caller otherwise these could
- * be added while it's being written and the write would
- * complete them before they made it to disk.
- */
- jwork_move(&bp->b_dep, wkhd);
}
#ifdef SUJ_DEBUG
@@ -9158,6 +10255,70 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd)
FREE_LOCK(&lk);
}
+/*
+ * Revert a block allocation when the journal record that describes it
+ * is not yet written.
+ */
+int
+jnewblk_rollback(jnewblk, fs, cgp, blksfree)
+ struct jnewblk *jnewblk;
+ struct fs *fs;
+ struct cg *cgp;
+ uint8_t *blksfree;
+{
+ ufs1_daddr_t fragno;
+ long cgbno, bbase;
+ int frags, blk;
+ int i;
+
+ frags = 0;
+ cgbno = dtogd(fs, jnewblk->jn_blkno);
+ /*
+ * We have to test which frags need to be rolled back. We may
+ * be operating on a stale copy when doing background writes.
+ */
+ for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; i++)
+ if (isclr(blksfree, cgbno + i))
+ frags++;
+ if (frags == 0)
+ return (0);
+ /*
+ * This is mostly ffs_blkfree() sans some validation and
+ * superblock updates.
+ */
+ if (frags == fs->fs_frag) {
+ fragno = fragstoblks(fs, cgbno);
+ ffs_setblock(fs, blksfree, fragno);
+ ffs_clusteracct(fs, cgp, fragno, 1);
+ cgp->cg_cs.cs_nbfree++;
+ } else {
+ cgbno += jnewblk->jn_oldfrags;
+ bbase = cgbno - fragnum(fs, cgbno);
+ /* Decrement the old frags. */
+ blk = blkmap(fs, blksfree, bbase);
+ ffs_fragacct(fs, blk, cgp->cg_frsum, -1);
+ /* Deallocate the fragment */
+ for (i = 0; i < frags; i++)
+ setbit(blksfree, cgbno + i);
+ cgp->cg_cs.cs_nffree += frags;
+ /* Add back in counts associated with the new frags */
+ blk = blkmap(fs, blksfree, bbase);
+ ffs_fragacct(fs, blk, cgp->cg_frsum, 1);
+ /* If a complete block has been reassembled, account for it. */
+ fragno = fragstoblks(fs, bbase);
+ if (ffs_isblock(fs, blksfree, fragno)) {
+ cgp->cg_cs.cs_nffree -= fs->fs_frag;
+ ffs_clusteracct(fs, cgp, fragno, 1);
+ cgp->cg_cs.cs_nbfree++;
+ }
+ }
+ stat_jnewblk++;
+ jnewblk->jn_state &= ~ATTACHED;
+ jnewblk->jn_state |= UNDONE;
+
+ return (frags);
+}
+
static void
initiate_write_bmsafemap(bmsafemap, bp)
struct bmsafemap *bmsafemap;
@@ -9169,10 +10330,7 @@ initiate_write_bmsafemap(bmsafemap, bp)
uint8_t *blksfree;
struct cg *cgp;
struct fs *fs;
- int cleared;
ino_t ino;
- long bno;
- int i;
if (bmsafemap->sm_state & IOSTARTED)
panic("initiate_write_bmsafemap: Already started\n");
@@ -9211,25 +10369,9 @@ initiate_write_bmsafemap(bmsafemap, bp)
fs = VFSTOUFS(bmsafemap->sm_list.wk_mp)->um_fs;
blksfree = cg_blksfree(cgp);
LIST_FOREACH(jnewblk, &bmsafemap->sm_jnewblkhd, jn_deps) {
- bno = dtogd(fs, jnewblk->jn_blkno);
- cleared = 0;
- for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags;
- i++) {
- if (isclr(blksfree, bno + i)) {
- cleared = 1;
- setbit(blksfree, bno + i);
- }
- }
- /*
- * We may not clear the block if it's a background
- * copy. In that case there is no reason to detach
- * it.
- */
- if (cleared) {
- stat_jnewblk++;
- jnewblk->jn_state &= ~ATTACHED;
- jnewblk->jn_state |= UNDONE;
- } else if ((bp->b_xflags & BX_BKGRDMARKER) == 0)
+ if (jnewblk_rollback(jnewblk, fs, cgp, blksfree))
+ continue;
+ if ((bp->b_xflags & BX_BKGRDMARKER) == 0)
panic("initiate_write_bmsafemap: block %jd "
"marked free", jnewblk->jn_blkno);
}
@@ -9242,6 +10384,8 @@ initiate_write_bmsafemap(bmsafemap, bp)
inodedep, id_deps);
LIST_SWAP(&bmsafemap->sm_newblkhd, &bmsafemap->sm_newblkwr,
newblk, nb_deps);
+ LIST_SWAP(&bmsafemap->sm_freehd, &bmsafemap->sm_freewr, worklist,
+ wk_list);
}
/*
@@ -9260,6 +10404,7 @@ softdep_disk_write_complete(bp)
struct worklist *wk;
struct worklist *owk;
struct workhead reattach;
+ struct freeblks *freeblks;
struct buf *sbp;
/*
@@ -9277,6 +10422,7 @@ softdep_disk_write_complete(bp)
ACQUIRE_LOCK(&lk);
while ((wk = LIST_FIRST(&bp->b_dep)) != NULL) {
WORKLIST_REMOVE(wk);
+ dep_write[wk->wk_type]++;
if (wk == owk)
panic("duplicate worklist: %p\n", wk);
owk = wk;
@@ -9318,18 +10464,16 @@ softdep_disk_write_complete(bp)
case D_FREEBLKS:
wk->wk_state |= COMPLETE;
- if ((wk->wk_state & ALLCOMPLETE) == ALLCOMPLETE)
- add_to_worklist(wk, 1);
+ freeblks = WK_FREEBLKS(wk);
+ if ((wk->wk_state & ALLCOMPLETE) == ALLCOMPLETE &&
+ LIST_EMPTY(&freeblks->fb_jblkdephd))
+ add_to_worklist(wk, WK_NODELAY);
continue;
case D_FREEWORK:
handle_written_freework(WK_FREEWORK(wk));
break;
- case D_FREEDEP:
- free_freedep(WK_FREEDEP(wk));
- continue;
-
case D_JSEGDEP:
free_jsegdep(WK_JSEGDEP(wk));
continue;
@@ -9343,6 +10487,10 @@ softdep_disk_write_complete(bp)
WORKLIST_INSERT(&reattach, wk);
continue;
+ case D_FREEDEP:
+ free_freedep(WK_FREEDEP(wk));
+ continue;
+
default:
panic("handle_disk_write_complete: Unknown type %s",
TYPENAME(wk->wk_type));
@@ -9459,7 +10607,11 @@ handle_allocindir_partdone(aip)
return;
indirdep = aip->ai_indirdep;
LIST_REMOVE(aip, ai_next);
- if (indirdep->ir_state & UNDONE) {
+ /*
+ * Don't set a pointer while the buffer is undergoing IO or while
+ * we have active truncations.
+ */
+ if (indirdep->ir_state & UNDONE || !TAILQ_EMPTY(&indirdep->ir_trunc)) {
LIST_INSERT_HEAD(&indirdep->ir_donehd, aip, ai_next);
return;
}
@@ -9490,6 +10642,15 @@ handle_jwork(wkhd)
case D_JSEGDEP:
free_jsegdep(WK_JSEGDEP(wk));
continue;
+ case D_FREEDEP:
+ free_freedep(WK_FREEDEP(wk));
+ continue;
+ case D_FREEFRAG:
+ rele_jseg(WK_JSEG(WK_FREEFRAG(wk)->ff_jdep));
+ WORKITEM_FREE(wk, D_FREEFRAG);
+ case D_FREEWORK:
+ handle_written_freework(WK_FREEWORK(wk));
+ continue;
default:
panic("handle_jwork: Unknown type %s\n",
TYPENAME(wk->wk_type));
@@ -9852,21 +11013,26 @@ handle_written_indirdep(indirdep, bp, bpp)
struct buf **bpp;
{
struct allocindir *aip;
+ struct buf *sbp;
int chgs;
if (indirdep->ir_state & GOINGAWAY)
- panic("disk_write_complete: indirdep gone");
+ panic("handle_written_indirdep: indirdep gone");
+ if ((indirdep->ir_state & IOSTARTED) == 0)
+ panic("handle_written_indirdep: IO not started");
chgs = 0;
/*
* If there were rollbacks revert them here.
*/
if (indirdep->ir_saveddata) {
bcopy(indirdep->ir_saveddata, bp->b_data, bp->b_bcount);
- free(indirdep->ir_saveddata, M_INDIRDEP);
- indirdep->ir_saveddata = 0;
+ if (TAILQ_EMPTY(&indirdep->ir_trunc)) {
+ free(indirdep->ir_saveddata, M_INDIRDEP);
+ indirdep->ir_saveddata = NULL;
+ }
chgs = 1;
}
- indirdep->ir_state &= ~UNDONE;
+ indirdep->ir_state &= ~(UNDONE | IOSTARTED);
indirdep->ir_state |= ATTACHED;
/*
* Move allocindirs with written pointers to the completehd if
@@ -9878,6 +11044,7 @@ handle_written_indirdep(indirdep, bp, bpp)
if ((indirdep->ir_state & DEPCOMPLETE) == 0) {
LIST_INSERT_HEAD(&indirdep->ir_completehd, aip,
ai_next);
+ newblk_freefrag(&aip->ai_block);
continue;
}
free_newblk(&aip->ai_block);
@@ -9886,50 +11053,42 @@ handle_written_indirdep(indirdep, bp, bpp)
* Move allocindirs that have finished dependency processing from
* the done list to the write list after updating the pointers.
*/
- while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0) {
- handle_allocindir_partdone(aip);
- if (aip == LIST_FIRST(&indirdep->ir_donehd))
- panic("disk_write_complete: not gone");
- chgs = 1;
+ if (TAILQ_EMPTY(&indirdep->ir_trunc)) {
+ while ((aip = LIST_FIRST(&indirdep->ir_donehd)) != 0) {
+ handle_allocindir_partdone(aip);
+ if (aip == LIST_FIRST(&indirdep->ir_donehd))
+ panic("disk_write_complete: not gone");
+ chgs = 1;
+ }
}
/*
- * If this indirdep has been detached from its newblk during
- * I/O we need to keep this dep attached to the buffer so
- * deallocate_dependencies can find it and properly resolve
- * any outstanding dependencies.
+ * Preserve the indirdep if there were any changes or if it is not
+ * yet valid on disk.
*/
- if ((indirdep->ir_state & (ONDEPLIST | DEPCOMPLETE)) == 0)
- chgs = 1;
- if ((bp->b_flags & B_DELWRI) == 0)
+ if (chgs) {
stat_indir_blk_ptrs++;
+ bdirty(bp);
+ return (1);
+ }
/*
* If there were no changes we can discard the savedbp and detach
* ourselves from the buf. We are only carrying completed pointers
* in this case.
*/
- if (chgs == 0) {
- struct buf *sbp;
-
- sbp = indirdep->ir_savebp;
- sbp->b_flags |= B_INVAL | B_NOCACHE;
- indirdep->ir_savebp = NULL;
- if (*bpp != NULL)
- panic("handle_written_indirdep: bp already exists.");
- *bpp = sbp;
- } else
- bdirty(bp);
+ sbp = indirdep->ir_savebp;
+ sbp->b_flags |= B_INVAL | B_NOCACHE;
+ indirdep->ir_savebp = NULL;
+ indirdep->ir_bp = NULL;
+ if (*bpp != NULL)
+ panic("handle_written_indirdep: bp already exists.");
+ *bpp = sbp;
/*
- * If there are no fresh dependencies and none waiting on writes
- * we can free the indirdep.
+ * The indirdep may not be freed until its parent points at it.
*/
- if ((indirdep->ir_state & DEPCOMPLETE) && chgs == 0) {
- if (indirdep->ir_state & ONDEPLIST)
- LIST_REMOVE(indirdep, ir_next);
+ if (indirdep->ir_state & DEPCOMPLETE)
free_indirdep(indirdep);
- return (0);
- }
- return (chgs);
+ return (0);
}
/*
@@ -9961,6 +11120,58 @@ bmsafemap_rollbacks(bmsafemap)
}
/*
+ * Re-apply an allocation when a cg write is complete.
+ */
+static int
+jnewblk_rollforward(jnewblk, fs, cgp, blksfree)
+ struct jnewblk *jnewblk;
+ struct fs *fs;
+ struct cg *cgp;
+ uint8_t *blksfree;
+{
+ ufs1_daddr_t fragno;
+ ufs2_daddr_t blkno;
+ long cgbno, bbase;
+ int frags, blk;
+ int i;
+
+ frags = 0;
+ cgbno = dtogd(fs, jnewblk->jn_blkno);
+ for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; i++) {
+ if (isclr(blksfree, cgbno + i))
+ panic("jnewblk_rollforward: re-allocated fragment");
+ frags++;
+ }
+ if (frags == fs->fs_frag) {
+ blkno = fragstoblks(fs, cgbno);
+ ffs_clrblock(fs, blksfree, (long)blkno);
+ ffs_clusteracct(fs, cgp, blkno, -1);
+ cgp->cg_cs.cs_nbfree--;
+ } else {
+ bbase = cgbno - fragnum(fs, cgbno);
+ cgbno += jnewblk->jn_oldfrags;
+ /* If a complete block had been reassembled, account for it. */
+ fragno = fragstoblks(fs, bbase);
+ if (ffs_isblock(fs, blksfree, fragno)) {
+ cgp->cg_cs.cs_nffree += fs->fs_frag;
+ ffs_clusteracct(fs, cgp, fragno, -1);
+ cgp->cg_cs.cs_nbfree--;
+ }
+ /* Decrement the old frags. */
+ blk = blkmap(fs, blksfree, bbase);
+ ffs_fragacct(fs, blk, cgp->cg_frsum, -1);
+ /* Allocate the fragment */
+ for (i = 0; i < frags; i++)
+ clrbit(blksfree, cgbno + i);
+ cgp->cg_cs.cs_nffree -= frags;
+ /* Add back in counts associated with the new frags */
+ blk = blkmap(fs, blksfree, bbase);
+ ffs_fragacct(fs, blk, cgp->cg_frsum, 1);
+ }
+ return (frags);
+}
+
+/*
* Complete a write to a bmsafemap structure. Roll forward any bitmap
* changes if it's not a background write. Set all written dependencies
* to DEPCOMPLETE and free the structure if possible.
@@ -9974,20 +11185,25 @@ handle_written_bmsafemap(bmsafemap, bp)
struct inodedep *inodedep;
struct jaddref *jaddref, *jatmp;
struct jnewblk *jnewblk, *jntmp;
+ struct ufsmount *ump;
uint8_t *inosused;
uint8_t *blksfree;
struct cg *cgp;
struct fs *fs;
ino_t ino;
- long bno;
int chgs;
- int i;
if ((bmsafemap->sm_state & IOSTARTED) == 0)
panic("initiate_write_bmsafemap: Not started\n");
+ ump = VFSTOUFS(bmsafemap->sm_list.wk_mp);
chgs = 0;
bmsafemap->sm_state &= ~IOSTARTED;
/*
+ * Release journal work that was waiting on the write.
+ */
+ handle_jwork(&bmsafemap->sm_freewr);
+
+ /*
* Restore unwritten inode allocation pending jaddref writes.
*/
if (!LIST_EMPTY(&bmsafemap->sm_jaddrefhd)) {
@@ -10025,18 +11241,9 @@ handle_written_bmsafemap(bmsafemap, bp)
jntmp) {
if ((jnewblk->jn_state & UNDONE) == 0)
continue;
- bno = dtogd(fs, jnewblk->jn_blkno);
- for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags;
- i++) {
- if (bp->b_xflags & BX_BKGRDMARKER)
- break;
- if ((jnewblk->jn_state & NEWBLOCK) == 0 &&
- isclr(blksfree, bno + i))
- panic("handle_written_bmsafemap: "
- "re-allocated fragment");
- clrbit(blksfree, bno + i);
+ if ((bp->b_xflags & BX_BKGRDMARKER) == 0 &&
+ jnewblk_rollforward(jnewblk, fs, cgp, blksfree))
chgs = 1;
- }
jnewblk->jn_state &= ~(UNDONE | NEWBLOCK);
jnewblk->jn_state |= ATTACHED;
free_jnewblk(jnewblk);
@@ -10063,16 +11270,17 @@ handle_written_bmsafemap(bmsafemap, bp)
LIST_REMOVE(inodedep, id_deps);
inodedep->id_bmsafemap = NULL;
}
- if (LIST_EMPTY(&bmsafemap->sm_jaddrefhd) &&
+ LIST_REMOVE(bmsafemap, sm_next);
+ if (chgs == 0 && LIST_EMPTY(&bmsafemap->sm_jaddrefhd) &&
LIST_EMPTY(&bmsafemap->sm_jnewblkhd) &&
LIST_EMPTY(&bmsafemap->sm_newblkhd) &&
- LIST_EMPTY(&bmsafemap->sm_inodedephd)) {
- if (chgs)
- bdirty(bp);
+ LIST_EMPTY(&bmsafemap->sm_inodedephd) &&
+ LIST_EMPTY(&bmsafemap->sm_freehd)) {
LIST_REMOVE(bmsafemap, sm_hash);
WORKITEM_FREE(bmsafemap, D_BMSAFEMAP);
return (0);
}
+ LIST_INSERT_HEAD(&ump->softdep_dirtycg, bmsafemap, sm_next);
bdirty(bp);
return (1);
}
@@ -10113,25 +11321,29 @@ handle_written_mkdir(mkdir, type)
complete_mkdir(mkdir);
}
-static void
+static int
free_pagedep(pagedep)
struct pagedep *pagedep;
{
int i;
- if (pagedep->pd_state & (NEWBLOCK | ONWORKLIST))
- return;
+ if (pagedep->pd_state & NEWBLOCK)
+ return (0);
+ if (!LIST_EMPTY(&pagedep->pd_dirremhd))
+ return (0);
for (i = 0; i < DAHASHSZ; i++)
if (!LIST_EMPTY(&pagedep->pd_diraddhd[i]))
- return;
- if (!LIST_EMPTY(&pagedep->pd_jmvrefhd))
- return;
- if (!LIST_EMPTY(&pagedep->pd_dirremhd))
- return;
+ return (0);
if (!LIST_EMPTY(&pagedep->pd_pendinghd))
- return;
+ return (0);
+ if (!LIST_EMPTY(&pagedep->pd_jmvrefhd))
+ return (0);
+ if (pagedep->pd_state & ONWORKLIST)
+ WORKLIST_REMOVE(&pagedep->pd_list);
LIST_REMOVE(pagedep, pd_hash);
WORKITEM_FREE(pagedep, D_PAGEDEP);
+
+ return (1);
}
/*
@@ -10217,11 +11429,7 @@ handle_written_filepage(pagedep, bp)
* Otherwise it will remain to track any new entries on
* the page in case they are fsync'ed.
*/
- if ((pagedep->pd_state & NEWBLOCK) == 0 &&
- LIST_EMPTY(&pagedep->pd_jmvrefhd)) {
- LIST_REMOVE(pagedep, pd_hash);
- WORKITEM_FREE(pagedep, D_PAGEDEP);
- }
+ free_pagedep(pagedep);
return (0);
}
@@ -10324,8 +11532,7 @@ again:
TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) {
if ((inoref->if_state & (DEPCOMPLETE | GOINGAWAY))
== DEPCOMPLETE) {
- stat_jwait_inode++;
- jwait(&inoref->if_list);
+ jwait(&inoref->if_list, MNT_WAIT);
goto again;
}
}
@@ -10463,8 +11670,7 @@ restart:
TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) {
if ((inoref->if_state & (DEPCOMPLETE | GOINGAWAY))
== DEPCOMPLETE) {
- stat_jwait_inode++;
- jwait(&inoref->if_list);
+ jwait(&inoref->if_list, MNT_WAIT);
goto restart;
}
}
@@ -10610,6 +11816,8 @@ restart:
* Flush all the dirty bitmaps associated with the block device
* before flushing the rest of the dirty blocks so as to reduce
* the number of dependencies that will have to be rolled back.
+ *
+ * XXX Unused?
*/
void
softdep_fsync_mountdev(vp)
@@ -10656,76 +11864,129 @@ restart:
}
/*
+ * Sync all cylinder groups that were dirty at the time this function is
+ * called. Newly dirtied cgs will be inserted before the sintenel. This
+ * is used to flush freedep activity that may be holding up writes to a
+ * indirect block.
+ */
+static int
+sync_cgs(mp, waitfor)
+ struct mount *mp;
+ int waitfor;
+{
+ struct bmsafemap *bmsafemap;
+ struct bmsafemap *sintenel;
+ struct ufsmount *ump;
+ struct buf *bp;
+ int error;
+
+ sintenel = malloc(sizeof(*sintenel), M_BMSAFEMAP, M_ZERO | M_WAITOK);
+ sintenel->sm_cg = -1;
+ ump = VFSTOUFS(mp);
+ error = 0;
+ ACQUIRE_LOCK(&lk);
+ LIST_INSERT_HEAD(&ump->softdep_dirtycg, sintenel, sm_next);
+ for (bmsafemap = LIST_NEXT(sintenel, sm_next); bmsafemap != NULL;
+ bmsafemap = LIST_NEXT(sintenel, sm_next)) {
+ /* Skip sintenels and cgs with no work to release. */
+ if (bmsafemap->sm_cg == -1 ||
+ (LIST_EMPTY(&bmsafemap->sm_freehd) &&
+ LIST_EMPTY(&bmsafemap->sm_freewr))) {
+ LIST_REMOVE(sintenel, sm_next);
+ LIST_INSERT_AFTER(bmsafemap, sintenel, sm_next);
+ continue;
+ }
+ /*
+ * If we don't get the lock and we're waiting try again, if
+ * not move on to the next buf and try to sync it.
+ */
+ bp = getdirtybuf(bmsafemap->sm_buf, &lk, waitfor);
+ if (bp == NULL && waitfor == MNT_WAIT)
+ continue;
+ LIST_REMOVE(sintenel, sm_next);
+ LIST_INSERT_AFTER(bmsafemap, sintenel, sm_next);
+ if (bp == NULL)
+ continue;
+ FREE_LOCK(&lk);
+ if (waitfor == MNT_NOWAIT)
+ bawrite(bp);
+ else
+ error = bwrite(bp);
+ ACQUIRE_LOCK(&lk);
+ if (error)
+ break;
+ }
+ LIST_REMOVE(sintenel, sm_next);
+ FREE_LOCK(&lk);
+ free(sintenel, M_BMSAFEMAP);
+ return (error);
+}
+
+/*
* This routine is called when we are trying to synchronously flush a
* file. This routine must eliminate any filesystem metadata dependencies
- * so that the syncing routine can succeed by pushing the dirty blocks
- * associated with the file. If any I/O errors occur, they are returned.
+ * so that the syncing routine can succeed.
*/
int
softdep_sync_metadata(struct vnode *vp)
{
- struct pagedep *pagedep;
- struct allocindir *aip;
- struct newblk *newblk;
- struct buf *bp, *nbp;
- struct worklist *wk;
- struct bufobj *bo;
- int i, error, waitfor;
+ int error;
- if (!DOINGSOFTDEP(vp))
- return (0);
/*
- * Ensure that any direct block dependencies have been cleared.
+ * Ensure that any direct block dependencies have been cleared,
+ * truncations are started, and inode references are journaled.
*/
ACQUIRE_LOCK(&lk);
- if ((error = flush_inodedep_deps(vp->v_mount, VTOI(vp)->i_number))) {
- FREE_LOCK(&lk);
- return (error);
- }
- FREE_LOCK(&lk);
/*
- * For most files, the only metadata dependencies are the
- * cylinder group maps that allocate their inode or blocks.
- * The block allocation dependencies can be found by traversing
- * the dependency lists for any buffers that remain on their
- * dirty buffer list. The inode allocation dependency will
- * be resolved when the inode is updated with MNT_WAIT.
- * This work is done in two passes. The first pass grabs most
- * of the buffers and begins asynchronously writing them. The
- * only way to wait for these asynchronous writes is to sleep
- * on the filesystem vnode which may stay busy for a long time
- * if the filesystem is active. So, instead, we make a second
- * pass over the dependencies blocking on each write. In the
- * usual case we will be blocking against a write that we
- * initiated, so when it is done the dependency will have been
- * resolved. Thus the second pass is expected to end quickly.
+ * Write all journal records to prevent rollbacks on devvp.
*/
- waitfor = MNT_NOWAIT;
- bo = &vp->v_bufobj;
+ if (vp->v_type == VCHR)
+ softdep_flushjournal(vp->v_mount);
+ error = flush_inodedep_deps(vp, vp->v_mount, VTOI(vp)->i_number);
+ /*
+ * Ensure that all truncates are written so we won't find deps on
+ * indirect blocks.
+ */
+ process_truncates(vp);
+ FREE_LOCK(&lk);
+
+ return (error);
+}
+
+/*
+ * This routine is called when we are attempting to sync a buf with
+ * dependencies. If waitfor is MNT_NOWAIT it attempts to schedule any
+ * other IO it can but returns EBUSY if the buffer is not yet able to
+ * be written. Dependencies which will not cause rollbacks will always
+ * return 0.
+ */
+int
+softdep_sync_buf(struct vnode *vp, struct buf *bp, int waitfor)
+{
+ struct indirdep *indirdep;
+ struct pagedep *pagedep;
+ struct allocindir *aip;
+ struct newblk *newblk;
+ struct buf *nbp;
+ struct worklist *wk;
+ int i, error;
-top:
/*
- * We must wait for any I/O in progress to finish so that
- * all potential buffers on the dirty list will be visible.
+ * For VCHR we just don't want to force flush any dependencies that
+ * will cause rollbacks.
*/
- BO_LOCK(bo);
- drain_output(vp);
- while ((bp = TAILQ_FIRST(&bo->bo_dirty.bv_hd)) != NULL) {
- bp = getdirtybuf(bp, BO_MTX(bo), MNT_WAIT);
- if (bp)
- break;
- }
- BO_UNLOCK(bo);
- if (bp == NULL)
+ if (vp->v_type == VCHR) {
+ if (waitfor == MNT_NOWAIT && softdep_count_dependencies(bp, 0))
+ return (EBUSY);
return (0);
-loop:
- /* While syncing snapshots, we must allow recursive lookups */
- BUF_AREC(bp);
+ }
ACQUIRE_LOCK(&lk);
/*
* As we hold the buffer locked, none of its dependencies
* will disappear.
*/
+ error = 0;
+top:
LIST_FOREACH(wk, &bp->b_dep, wk_list) {
switch (wk->wk_type) {
@@ -10733,46 +11994,54 @@ loop:
case D_ALLOCINDIR:
newblk = WK_NEWBLK(wk);
if (newblk->nb_jnewblk != NULL) {
- stat_jwait_newblk++;
- jwait(&newblk->nb_jnewblk->jn_list);
- goto restart;
+ if (waitfor == MNT_NOWAIT) {
+ error = EBUSY;
+ goto out_unlock;
+ }
+ jwait(&newblk->nb_jnewblk->jn_list, waitfor);
+ goto top;
}
- if (newblk->nb_state & DEPCOMPLETE)
+ if (newblk->nb_state & DEPCOMPLETE ||
+ waitfor == MNT_NOWAIT)
continue;
nbp = newblk->nb_bmsafemap->sm_buf;
nbp = getdirtybuf(nbp, &lk, waitfor);
if (nbp == NULL)
- continue;
+ goto top;
FREE_LOCK(&lk);
- if (waitfor == MNT_NOWAIT) {
- bawrite(nbp);
- } else if ((error = bwrite(nbp)) != 0) {
- break;
- }
+ if ((error = bwrite(nbp)) != 0)
+ goto out;
ACQUIRE_LOCK(&lk);
continue;
case D_INDIRDEP:
+ indirdep = WK_INDIRDEP(wk);
+ if (waitfor == MNT_NOWAIT) {
+ if (!TAILQ_EMPTY(&indirdep->ir_trunc) ||
+ !LIST_EMPTY(&indirdep->ir_deplisthd)) {
+ error = EBUSY;
+ goto out_unlock;
+ }
+ }
+ if (!TAILQ_EMPTY(&indirdep->ir_trunc))
+ panic("softdep_sync_buf: truncation pending.");
restart:
-
- LIST_FOREACH(aip,
- &WK_INDIRDEP(wk)->ir_deplisthd, ai_next) {
+ LIST_FOREACH(aip, &indirdep->ir_deplisthd, ai_next) {
newblk = (struct newblk *)aip;
if (newblk->nb_jnewblk != NULL) {
- stat_jwait_newblk++;
- jwait(&newblk->nb_jnewblk->jn_list);
+ jwait(&newblk->nb_jnewblk->jn_list,
+ waitfor);
goto restart;
}
if (newblk->nb_state & DEPCOMPLETE)
continue;
nbp = newblk->nb_bmsafemap->sm_buf;
- nbp = getdirtybuf(nbp, &lk, MNT_WAIT);
+ nbp = getdirtybuf(nbp, &lk, waitfor);
if (nbp == NULL)
goto restart;
FREE_LOCK(&lk);
- if ((error = bwrite(nbp)) != 0) {
- goto loop_end;
- }
+ if ((error = bwrite(nbp)) != 0)
+ goto out;
ACQUIRE_LOCK(&lk);
goto restart;
}
@@ -10780,6 +12049,18 @@ loop:
case D_PAGEDEP:
/*
+ * Only flush directory entries in synchronous passes.
+ */
+ if (waitfor != MNT_WAIT) {
+ error = EBUSY;
+ goto out_unlock;
+ }
+ /*
+ * While syncing snapshots, we must allow recursive
+ * lookups.
+ */
+ BUF_AREC(bp);
+ /*
* We are trying to sync a directory that may
* have dependencies on both its own metadata
* and/or dependencies on the inodes of any
@@ -10790,64 +12071,28 @@ loop:
for (i = 0; i < DAHASHSZ; i++) {
if (LIST_FIRST(&pagedep->pd_diraddhd[i]) == 0)
continue;
- if ((error =
- flush_pagedep_deps(vp, wk->wk_mp,
- &pagedep->pd_diraddhd[i]))) {
- FREE_LOCK(&lk);
- goto loop_end;
+ if ((error = flush_pagedep_deps(vp, wk->wk_mp,
+ &pagedep->pd_diraddhd[i]))) {
+ BUF_NOREC(bp);
+ goto out_unlock;
}
}
+ BUF_NOREC(bp);
+ continue;
+
+ case D_FREEWORK:
continue;
default:
- panic("softdep_sync_metadata: Unknown type %s",
+ panic("softdep_sync_buf: Unknown type %s",
TYPENAME(wk->wk_type));
/* NOTREACHED */
}
- loop_end:
- /* We reach here only in error and unlocked */
- if (error == 0)
- panic("softdep_sync_metadata: zero error");
- BUF_NOREC(bp);
- bawrite(bp);
- return (error);
}
+out_unlock:
FREE_LOCK(&lk);
- BO_LOCK(bo);
- while ((nbp = TAILQ_NEXT(bp, b_bobufs)) != NULL) {
- nbp = getdirtybuf(nbp, BO_MTX(bo), MNT_WAIT);
- if (nbp)
- break;
- }
- BO_UNLOCK(bo);
- BUF_NOREC(bp);
- bawrite(bp);
- if (nbp != NULL) {
- bp = nbp;
- goto loop;
- }
- /*
- * The brief unlock is to allow any pent up dependency
- * processing to be done. Then proceed with the second pass.
- */
- if (waitfor == MNT_NOWAIT) {
- waitfor = MNT_WAIT;
- goto top;
- }
-
- /*
- * If we have managed to get rid of all the dirty buffers,
- * then we are done. For certain directories and block
- * devices, we may need to do further work.
- *
- * We must wait for any I/O in progress to finish so that
- * all potential buffers on the dirty list will be visible.
- */
- BO_LOCK(bo);
- drain_output(vp);
- BO_UNLOCK(bo);
- return ffs_update(vp, 1);
- /* return (0); */
+out:
+ return (error);
}
/*
@@ -10855,7 +12100,8 @@ loop:
* Called with splbio blocked.
*/
static int
-flush_inodedep_deps(mp, ino)
+flush_inodedep_deps(vp, mp, ino)
+ struct vnode *vp;
struct mount *mp;
ino_t ino;
{
@@ -10887,8 +12133,7 @@ restart:
TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) {
if ((inoref->if_state & (DEPCOMPLETE | GOINGAWAY))
== DEPCOMPLETE) {
- stat_jwait_inode++;
- jwait(&inoref->if_list);
+ jwait(&inoref->if_list, MNT_WAIT);
goto restart;
}
}
@@ -10930,8 +12175,7 @@ flush_deplist(listhead, waitfor, errorp)
TAILQ_FOREACH(adp, listhead, ad_next) {
newblk = (struct newblk *)adp;
if (newblk->nb_jnewblk != NULL) {
- stat_jwait_newblk++;
- jwait(&newblk->nb_jnewblk->jn_list);
+ jwait(&newblk->nb_jnewblk->jn_list, MNT_WAIT);
return (1);
}
if (newblk->nb_state & DEPCOMPLETE)
@@ -10944,12 +12188,10 @@ flush_deplist(listhead, waitfor, errorp)
return (1);
}
FREE_LOCK(&lk);
- if (waitfor == MNT_NOWAIT) {
+ if (waitfor == MNT_NOWAIT)
bawrite(bp);
- } else if ((*errorp = bwrite(bp)) != 0) {
- ACQUIRE_LOCK(&lk);
- return (1);
- }
+ else
+ *errorp = bwrite(bp);
ACQUIRE_LOCK(&lk);
return (1);
}
@@ -10995,8 +12237,7 @@ flush_newblk_dep(vp, mp, lbn)
* Flush the journal.
*/
if (newblk->nb_jnewblk != NULL) {
- stat_jwait_newblk++;
- jwait(&newblk->nb_jnewblk->jn_list);
+ jwait(&newblk->nb_jnewblk->jn_list, MNT_WAIT);
continue;
}
/*
@@ -11105,8 +12346,7 @@ restart:
TAILQ_FOREACH(inoref, &inodedep->id_inoreflst, if_deps) {
if ((inoref->if_state & (DEPCOMPLETE | GOINGAWAY))
== DEPCOMPLETE) {
- stat_jwait_inode++;
- jwait(&inoref->if_list);
+ jwait(&inoref->if_list, MNT_WAIT);
goto restart;
}
}
@@ -11237,6 +12477,8 @@ softdep_slowdown(vp)
softdep_speedup();
stat_sync_limit_hit += 1;
FREE_LOCK(&lk);
+ if (DOINGSUJ(vp))
+ return (0);
return (1);
}
@@ -11338,8 +12580,9 @@ retry:
UFS_UNLOCK(ump);
ACQUIRE_LOCK(&lk);
process_removes(vp);
+ process_truncates(vp);
if (ump->softdep_on_worklist > 0 &&
- process_worklist_item(UFSTOVFS(ump), LK_NOWAIT) != -1) {
+ process_worklist_item(UFSTOVFS(ump), 1, LK_NOWAIT) != 0) {
stat_worklist_push += 1;
FREE_LOCK(&lk);
UFS_LOCK(ump);
@@ -11363,24 +12606,14 @@ retry:
UFS_UNLOCK(ump);
MNT_ILOCK(mp);
MNT_VNODE_FOREACH(lvp, mp, mvp) {
- UFS_LOCK(ump);
- if (ump->softdep_on_worklist > 0) {
- UFS_UNLOCK(ump);
- MNT_VNODE_FOREACH_ABORT_ILOCKED(mp, mvp);
- MNT_IUNLOCK(mp);
- UFS_LOCK(ump);
- stat_cleanup_retries += 1;
- goto retry;
- }
- UFS_UNLOCK(ump);
VI_LOCK(lvp);
- if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0 ||
- VOP_ISLOCKED(lvp) != 0) {
+ if (TAILQ_FIRST(&lvp->v_bufobj.bo_dirty.bv_hd) == 0) {
VI_UNLOCK(lvp);
continue;
}
MNT_IUNLOCK(mp);
- if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK, curthread)) {
+ if (vget(lvp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT,
+ curthread)) {
MNT_ILOCK(mp);
continue;
}
@@ -11394,8 +12627,17 @@ retry:
MNT_ILOCK(mp);
}
MNT_IUNLOCK(mp);
- stat_cleanup_failures += 1;
+ lvp = ump->um_devvp;
+ if (vn_lock(lvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) {
+ VOP_FSYNC(lvp, MNT_NOWAIT, curthread);
+ VOP_UNLOCK(lvp, 0);
+ }
UFS_LOCK(ump);
+ if (ump->softdep_on_worklist > 0) {
+ stat_cleanup_retries += 1;
+ goto retry;
+ }
+ stat_cleanup_failures += 1;
}
if (time_second - starttime > stat_cleanup_high_delay)
stat_cleanup_high_delay = time_second - starttime;
@@ -11432,8 +12674,7 @@ request_cleanup(mp, resource)
*/
if (ump->softdep_on_worklist > max_softdeps / 10) {
td->td_pflags |= TDP_SOFTDEP;
- process_worklist_item(mp, LK_NOWAIT);
- process_worklist_item(mp, LK_NOWAIT);
+ process_worklist_item(mp, 2, LK_NOWAIT);
td->td_pflags &= ~TDP_SOFTDEP;
stat_worklist_push += 2;
return(1);
@@ -11652,6 +12893,53 @@ clear_inodedeps(td)
}
}
+void
+softdep_buf_append(bp, wkhd)
+ struct buf *bp;
+ struct workhead *wkhd;
+{
+ struct worklist *wk;
+
+ ACQUIRE_LOCK(&lk);
+ while ((wk = LIST_FIRST(wkhd)) != NULL) {
+ WORKLIST_REMOVE(wk);
+ WORKLIST_INSERT(&bp->b_dep, wk);
+ }
+ FREE_LOCK(&lk);
+
+}
+
+void
+softdep_inode_append(ip, cred, wkhd)
+ struct inode *ip;
+ struct ucred *cred;
+ struct workhead *wkhd;
+{
+ struct buf *bp;
+ struct fs *fs;
+ int error;
+
+ fs = ip->i_fs;
+ error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
+ (int)fs->fs_bsize, cred, &bp);
+ if (error) {
+ softdep_freework(wkhd);
+ return;
+ }
+ softdep_buf_append(bp, wkhd);
+ bqrelse(bp);
+}
+
+void
+softdep_freework(wkhd)
+ struct workhead *wkhd;
+{
+
+ ACQUIRE_LOCK(&lk);
+ handle_jwork(wkhd);
+ FREE_LOCK(&lk);
+}
+
/*
* Function to determine if the buffer has outstanding dependencies
* that will cause a roll-back if the buffer is written. If wantcount
@@ -11664,6 +12952,7 @@ softdep_count_dependencies(bp, wantcount)
{
struct worklist *wk;
struct bmsafemap *bmsafemap;
+ struct freework *freework;
struct inodedep *inodedep;
struct indirdep *indirdep;
struct freeblks *freeblks;
@@ -11711,6 +13000,13 @@ softdep_count_dependencies(bp, wantcount)
case D_INDIRDEP:
indirdep = WK_INDIRDEP(wk);
+ TAILQ_FOREACH(freework, &indirdep->ir_trunc, fw_next) {
+ /* indirect truncation dependency */
+ retval += 1;
+ if (!wantcount)
+ goto out;
+ }
+
LIST_FOREACH(aip, &indirdep->ir_deplisthd, ai_next) {
/* indirect block pointer dependency */
retval += 1;
@@ -11758,7 +13054,7 @@ softdep_count_dependencies(bp, wantcount)
case D_FREEBLKS:
freeblks = WK_FREEBLKS(wk);
- if (LIST_FIRST(&freeblks->fb_jfreeblkhd)) {
+ if (LIST_FIRST(&freeblks->fb_jblkdephd)) {
/* Freeblk journal dependency. */
retval += 1;
if (!wantcount)
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 68b9619..b0f2d7e 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -269,6 +269,8 @@ ffs_mount(struct mount *mp)
vfs_write_resume(mp);
return (error);
}
+ if (mp->mnt_flag & MNT_SOFTDEP)
+ softdep_unmount(mp);
DROP_GIANT();
g_topology_lock();
g_access(ump->um_cp, 0, -1, 0);
@@ -2034,12 +2036,10 @@ ffs_geom_strategy(struct bufobj *bo, struct buf *bp)
static void
db_print_ffs(struct ufsmount *ump)
{
- db_printf("mp %p %s devvp %p fs %p su_wl %d su_wl_in %d su_deps %d "
- "su_req %d\n",
+ db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n",
ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname,
ump->um_devvp, ump->um_fs, ump->softdep_on_worklist,
- ump->softdep_on_worklist_inprogress, ump->softdep_deps,
- ump->softdep_req);
+ ump->softdep_deps, ump->softdep_req);
}
DB_SHOW_COMMAND(ffs, db_show_ffs)
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index cf6a5a8..9f528da 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -212,26 +212,32 @@ retry:
int
ffs_syncvnode(struct vnode *vp, int waitfor)
{
- struct inode *ip = VTOI(vp);
+ struct inode *ip;
struct bufobj *bo;
struct buf *bp;
struct buf *nbp;
- int s, error, wait, passes, skipmeta;
ufs_lbn_t lbn;
+ int error, wait, passes;
- wait = (waitfor == MNT_WAIT);
- lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1));
- bo = &vp->v_bufobj;
+ ip = VTOI(vp);
ip->i_flag &= ~IN_NEEDSYNC;
+ bo = &vp->v_bufobj;
+
+ /*
+ * When doing MNT_WAIT we must first flush all dependencies
+ * on the inode.
+ */
+ if (DOINGSOFTDEP(vp) && waitfor == MNT_WAIT &&
+ (error = softdep_sync_metadata(vp)) != 0)
+ return (error);
/*
* Flush all dirty buffers associated with a vnode.
*/
- passes = NIADDR + 1;
- skipmeta = 0;
- if (wait)
- skipmeta = 1;
- s = splbio();
+ error = 0;
+ passes = 0;
+ wait = 0; /* Always do an async pass first. */
+ lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1));
BO_LOCK(bo);
loop:
TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs)
@@ -239,70 +245,53 @@ loop:
TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) {
/*
* Reasons to skip this buffer: it has already been considered
- * on this pass, this pass is the first time through on a
- * synchronous flush request and the buffer being considered
- * is metadata, the buffer has dependencies that will cause
+ * on this pass, the buffer has dependencies that will cause
* it to be redirtied and it has not already been deferred,
* or it is already being written.
*/
if ((bp->b_vflags & BV_SCANNED) != 0)
continue;
bp->b_vflags |= BV_SCANNED;
- if ((skipmeta == 1 && bp->b_lblkno < 0))
+ /* Flush indirects in order. */
+ if (waitfor == MNT_WAIT && bp->b_lblkno <= -NDADDR &&
+ lbn_level(bp->b_lblkno) >= passes)
continue;
+ if (bp->b_lblkno > lbn)
+ panic("ffs_syncvnode: syncing truncated data.");
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL))
continue;
BO_UNLOCK(bo);
- if (!wait && !LIST_EMPTY(&bp->b_dep) &&
- (bp->b_flags & B_DEFERRED) == 0 &&
- buf_countdeps(bp, 0)) {
- bp->b_flags |= B_DEFERRED;
- BUF_UNLOCK(bp);
- BO_LOCK(bo);
- continue;
- }
if ((bp->b_flags & B_DELWRI) == 0)
panic("ffs_fsync: not dirty");
/*
- * If this is a synchronous flush request, or it is not a
- * file or device, start the write on this buffer immediately.
+ * Check for dependencies and potentially complete them.
*/
- if (wait || (vp->v_type != VREG && vp->v_type != VBLK)) {
-
- /*
- * On our final pass through, do all I/O synchronously
- * so that we can find out if our flush is failing
- * because of write errors.
- */
- if (passes > 0 || !wait) {
- if ((bp->b_flags & B_CLUSTEROK) && !wait) {
- (void) vfs_bio_awrite(bp);
- } else {
- bremfree(bp);
- splx(s);
- (void) bawrite(bp);
- s = splbio();
- }
- } else {
- bremfree(bp);
- splx(s);
- if ((error = bwrite(bp)) != 0)
- return (error);
- s = splbio();
+ if (!LIST_EMPTY(&bp->b_dep) &&
+ (error = softdep_sync_buf(vp, bp,
+ wait ? MNT_WAIT : MNT_NOWAIT)) != 0) {
+ /* I/O error. */
+ if (error != EBUSY) {
+ BUF_UNLOCK(bp);
+ return (error);
}
- } else if ((vp->v_type == VREG) && (bp->b_lblkno >= lbn)) {
- /*
- * If the buffer is for data that has been truncated
- * off the file, then throw it away.
- */
+ /* If we deferred once, don't defer again. */
+ if ((bp->b_flags & B_DEFERRED) == 0) {
+ bp->b_flags |= B_DEFERRED;
+ BUF_UNLOCK(bp);
+ goto next;
+ }
+ }
+ if (wait) {
bremfree(bp);
- bp->b_flags |= B_INVAL | B_NOCACHE;
- splx(s);
- brelse(bp);
- s = splbio();
- } else
- vfs_bio_awrite(bp);
-
+ if ((error = bwrite(bp)) != 0)
+ return (error);
+ } else if ((bp->b_flags & B_CLUSTEROK)) {
+ (void) vfs_bio_awrite(bp);
+ } else {
+ bremfree(bp);
+ (void) bawrite(bp);
+ }
+next:
/*
* Since we may have slept during the I/O, we need
* to start from a known point.
@@ -310,51 +299,44 @@ loop:
BO_LOCK(bo);
nbp = TAILQ_FIRST(&bo->bo_dirty.bv_hd);
}
+ if (waitfor != MNT_WAIT) {
+ BO_UNLOCK(bo);
+ return (ffs_update(vp, waitfor));
+ }
+ /* Drain IO to see if we're done. */
+ bufobj_wwait(bo, 0, 0);
/*
- * If we were asked to do this synchronously, then go back for
- * another pass, this time doing the metadata.
+ * Block devices associated with filesystems may have new I/O
+ * requests posted for them even if the vnode is locked, so no
+ * amount of trying will get them clean. We make several passes
+ * as a best effort.
+ *
+ * Regular files may need multiple passes to flush all dependency
+ * work as it is possible that we must write once per indirect
+ * level, once for the leaf, and once for the inode and each of
+ * these will be done with one sync and one async pass.
*/
- if (skipmeta) {
- skipmeta = 0;
- goto loop;
- }
-
- if (wait) {
- bufobj_wwait(bo, 3, 0);
- BO_UNLOCK(bo);
-
- /*
- * Ensure that any filesystem metatdata associated
- * with the vnode has been written.
- */
- splx(s);
- if ((error = softdep_sync_metadata(vp)) != 0)
- return (error);
- s = splbio();
-
- BO_LOCK(bo);
- if (bo->bo_dirty.bv_cnt > 0) {
- /*
- * Block devices associated with filesystems may
- * have new I/O requests posted for them even if
- * the vnode is locked, so no amount of trying will
- * get them clean. Thus we give block devices a
- * good effort, then just give up. For all other file
- * types, go around and try again until it is clean.
- */
- if (passes > 0) {
- passes -= 1;
- goto loop;
- }
+ if (bo->bo_dirty.bv_cnt > 0) {
+ /* Write the inode after sync passes to flush deps. */
+ if (wait && DOINGSOFTDEP(vp)) {
+ BO_UNLOCK(bo);
+ ffs_update(vp, MNT_WAIT);
+ BO_LOCK(bo);
+ }
+ /* switch between sync/async. */
+ wait = !wait;
+ if (wait == 1 || ++passes < NIADDR + 2)
+ goto loop;
#ifdef INVARIANTS
- if (!vn_isdisk(vp, NULL))
- vprint("ffs_fsync: dirty", vp);
+ if (!vn_isdisk(vp, NULL))
+ vprint("ffs_fsync: dirty", vp);
#endif
- }
}
BO_UNLOCK(bo);
- splx(s);
- return (ffs_update(vp, wait));
+ error = ffs_update(vp, MNT_WAIT);
+ if (DOINGSUJ(vp))
+ softdep_journal_fsync(VTOI(vp));
+ return (error);
}
static int
diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h
index 0b7e908..a0b8e5b 100644
--- a/sys/ufs/ffs/fs.h
+++ b/sys/ufs/ffs/fs.h
@@ -664,6 +664,7 @@ lbn_offset(struct fs *fs, int level)
#define JOP_FREEBLK 4 /* Free a block or a tree of blocks. */
#define JOP_MVREF 5 /* Move a reference from one off to another. */
#define JOP_TRUNC 6 /* Partial truncation record. */
+#define JOP_SYNC 7 /* fsync() complete record. */
#define JREC_SIZE 32 /* Record and segment header size. */
@@ -729,7 +730,7 @@ struct jblkrec {
/*
* Truncation record. Records a partial truncation so that it may be
- * completed later.
+ * completed at check time. Also used for sync records.
*/
struct jtrncrec {
uint32_t jt_op;
diff --git a/sys/ufs/ffs/softdep.h b/sys/ufs/ffs/softdep.h
index d864a4a..80c7315 100644
--- a/sys/ufs/ffs/softdep.h
+++ b/sys/ufs/ffs/softdep.h
@@ -127,7 +127,7 @@
#define DIRCHG 0x000080 /* diradd, dirrem only */
#define GOINGAWAY 0x000100 /* indirdep, jremref only */
#define IOSTARTED 0x000200 /* inodedep, pagedep, bmsafemap only */
-#define UNUSED400 0x000400 /* currently available. */
+#define DELAYEDFREE 0x000400 /* allocindirect free delayed. */
#define NEWBLOCK 0x000800 /* pagedep, jaddref only */
#define INPROGRESS 0x001000 /* dirrem, freeblks, freefrag, freefile only */
#define UFS1FMT 0x002000 /* indirdep only */
@@ -195,8 +195,9 @@ struct worklist {
#define WK_JFREEBLK(wk) ((struct jfreeblk *)(wk))
#define WK_FREEDEP(wk) ((struct freedep *)(wk))
#define WK_JFREEFRAG(wk) ((struct jfreefrag *)(wk))
-#define WK_SBDEP(wk) ((struct sbdep *)wk)
+#define WK_SBDEP(wk) ((struct sbdep *)(wk))
#define WK_JTRUNC(wk) ((struct jtrunc *)(wk))
+#define WK_JFSYNC(wk) ((struct jfsync *)(wk))
/*
* Various types of lists
@@ -213,10 +214,12 @@ LIST_HEAD(jaddrefhd, jaddref);
LIST_HEAD(jremrefhd, jremref);
LIST_HEAD(jmvrefhd, jmvref);
LIST_HEAD(jnewblkhd, jnewblk);
-LIST_HEAD(jfreeblkhd, jfreeblk);
+LIST_HEAD(jblkdephd, jblkdep);
LIST_HEAD(freeworkhd, freework);
+TAILQ_HEAD(freeworklst, freework);
TAILQ_HEAD(jseglst, jseg);
TAILQ_HEAD(inoreflst, inoref);
+TAILQ_HEAD(freeblklst, freeblks);
/*
* The "pagedep" structure tracks the various dependencies related to
@@ -321,6 +324,7 @@ struct inodedep {
struct allocdirectlst id_newinoupdt; /* updates when inode written */
struct allocdirectlst id_extupdt; /* extdata updates pre-inode write */
struct allocdirectlst id_newextupdt; /* extdata updates at ino write */
+ struct freeblklst id_freeblklst; /* List of partial truncates. */
union {
struct ufs1_dinode *idu_savedino1; /* saved ufs1_dinode contents */
struct ufs2_dinode *idu_savedino2; /* saved ufs2_dinode contents */
@@ -342,8 +346,9 @@ struct inodedep {
struct bmsafemap {
struct worklist sm_list; /* cylgrp buffer */
# define sm_state sm_list.wk_state
- int sm_cg;
LIST_ENTRY(bmsafemap) sm_hash; /* Hash links. */
+ LIST_ENTRY(bmsafemap) sm_next; /* Mount list. */
+ int sm_cg;
struct buf *sm_buf; /* associated buffer */
struct allocdirecthd sm_allocdirecthd; /* allocdirect deps */
struct allocdirecthd sm_allocdirectwr; /* writing allocdirect deps */
@@ -355,6 +360,8 @@ struct bmsafemap {
struct newblkhd sm_newblkwr; /* writing newblk deps */
struct jaddrefhd sm_jaddrefhd; /* Pending inode allocations. */
struct jnewblkhd sm_jnewblkhd; /* Pending block allocations. */
+ struct workhead sm_freehd; /* Freedep deps. */
+ struct workhead sm_freewr; /* Written freedeps. */
};
/*
@@ -442,14 +449,15 @@ struct indirdep {
struct worklist ir_list; /* buffer holding indirect block */
# define ir_state ir_list.wk_state /* indirect block pointer state */
LIST_ENTRY(indirdep) ir_next; /* alloc{direct,indir} list */
+ TAILQ_HEAD(, freework) ir_trunc; /* List of truncations. */
caddr_t ir_saveddata; /* buffer cache contents */
struct buf *ir_savebp; /* buffer holding safe copy */
+ struct buf *ir_bp; /* buffer holding live copy */
struct allocindirhd ir_completehd; /* waiting for indirdep complete */
struct allocindirhd ir_writehd; /* Waiting for the pointer write. */
struct allocindirhd ir_donehd; /* done waiting to update safecopy */
struct allocindirhd ir_deplisthd; /* allocindir deps for this block */
- struct jnewblkhd ir_jnewblkhd; /* Canceled block allocations. */
- struct workhead ir_jwork; /* Journal work pending. */
+ struct freeblks *ir_freeblks; /* Freeblks that frees this indir. */
};
/*
@@ -471,6 +479,7 @@ struct allocindir {
LIST_ENTRY(allocindir) ai_next; /* indirdep's list of allocindir's */
struct indirdep *ai_indirdep; /* address of associated indirdep */
ufs2_daddr_t ai_oldblkno; /* old value of block pointer */
+ ufs_lbn_t ai_lbn; /* Logical block number. */
int ai_offset; /* Pointer offset in parent. */
};
#define ai_newblkno ai_block.nb_newblkno
@@ -502,6 +511,7 @@ struct freefrag {
ufs2_daddr_t ff_blkno; /* fragment physical block number */
long ff_fragsize; /* size of fragment being deleted */
ino_t ff_inum; /* owning inode number */
+ enum vtype ff_vtype; /* owning inode's file type */
};
/*
@@ -516,14 +526,23 @@ struct freefrag {
struct freeblks {
struct worklist fb_list; /* id_inowait or delayed worklist */
# define fb_state fb_list.wk_state /* inode and dirty block state */
- struct jfreeblkhd fb_jfreeblkhd; /* Journal entries pending */
+ TAILQ_ENTRY(freeblks) fb_next; /* List of inode truncates. */
+ struct jblkdephd fb_jblkdephd; /* Journal entries pending */
struct workhead fb_freeworkhd; /* Work items pending */
struct workhead fb_jwork; /* Journal work pending */
- ino_t fb_previousinum; /* inode of previous owner of blocks */
- uid_t fb_uid; /* uid of previous owner of blocks */
struct vnode *fb_devvp; /* filesystem device vnode */
- ufs2_daddr_t fb_chkcnt; /* used to check cnt of blks released */
+#ifdef QUOTA
+ struct dquot *fb_quota[MAXQUOTAS]; /* quotas to be adjusted */
+#endif
+ uint64_t fb_modrev; /* Inode revision at start of trunc. */
+ off_t fb_len; /* Length we're truncating to. */
+ ufs2_daddr_t fb_chkcnt; /* Expected blks released. */
+ ufs2_daddr_t fb_freecnt; /* Actual blocks released. */
+ ino_t fb_inum; /* inode owner of blocks */
+ enum vtype fb_vtype; /* inode owner's file type */
+ uid_t fb_uid; /* uid of previous owner of blocks */
int fb_ref; /* Children outstanding. */
+ int fb_cgwait; /* cg writes outstanding. */
};
/*
@@ -538,16 +557,18 @@ struct freeblks {
struct freework {
struct worklist fw_list; /* Delayed worklist. */
# define fw_state fw_list.wk_state
- LIST_ENTRY(freework) fw_next; /* For seg journal list. */
- struct jnewblk *fw_jnewblk; /* Journal entry to cancel. */
+ LIST_ENTRY(freework) fw_segs; /* Seg list. */
+ TAILQ_ENTRY(freework) fw_next; /* Hash/Trunc list. */
+ struct jnewblk *fw_jnewblk; /* Journal entry to cancel. */
struct freeblks *fw_freeblks; /* Root of operation. */
struct freework *fw_parent; /* Parent indirect. */
+ struct indirdep *fw_indir; /* indirect block. */
ufs2_daddr_t fw_blkno; /* Our block #. */
ufs_lbn_t fw_lbn; /* Original lbn before free. */
- int fw_frags; /* Number of frags. */
- int fw_ref; /* Number of children out. */
- int fw_off; /* Current working position. */
- struct workhead fw_jwork; /* Journal work pending. */
+ uint16_t fw_frags; /* Number of frags. */
+ uint16_t fw_ref; /* Number of children out. */
+ uint16_t fw_off; /* Current working position. */
+ uint16_t fw_start; /* Start of partial truncate. */
};
/*
@@ -674,6 +695,7 @@ struct dirrem {
LIST_ENTRY(dirrem) dm_inonext; /* inodedep's list of dirrem's */
struct jremrefhd dm_jremrefhd; /* Pending remove reference deps. */
ino_t dm_oldinum; /* inum of the removed dir entry */
+ doff_t dm_offset; /* offset of removed dir entry in blk */
union {
struct pagedep *dmu_pagedep; /* pagedep dependency for remove */
ino_t dmu_dirinum; /* parent inode number (for rmdir) */
@@ -707,7 +729,7 @@ struct dirrem {
*/
struct newdirblk {
struct worklist db_list; /* id_inowait or pg_newdirblk */
-# define db_state db_list.wk_state /* unused */
+# define db_state db_list.wk_state
struct pagedep *db_pagedep; /* associated pagedep */
struct workhead db_mkdir;
};
@@ -807,29 +829,36 @@ struct jnewblk {
# define jn_state jn_list.wk_state
struct jsegdep *jn_jsegdep; /* Will track our journal record. */
LIST_ENTRY(jnewblk) jn_deps; /* Jnewblks on sm_jnewblkhd. */
- LIST_ENTRY(jnewblk) jn_indirdeps; /* Jnewblks on ir_jnewblkhd. */
struct worklist *jn_dep; /* Dependency to ref completed seg. */
- ino_t jn_ino; /* Ino to which allocated. */
ufs_lbn_t jn_lbn; /* Lbn to which allocated. */
ufs2_daddr_t jn_blkno; /* Blkno allocated */
+ ino_t jn_ino; /* Ino to which allocated. */
int jn_oldfrags; /* Previous fragments when extended. */
int jn_frags; /* Number of fragments. */
};
/*
+ * A "jblkdep" structure tracks jfreeblk and jtrunc records attached to a
+ * freeblks structure.
+ */
+struct jblkdep {
+ struct worklist jb_list; /* For softdep journal pending. */
+ struct jsegdep *jb_jsegdep; /* Reference to the jseg. */
+ struct freeblks *jb_freeblks; /* Back pointer to freeblks. */
+ LIST_ENTRY(jblkdep) jb_deps; /* Dep list on freeblks. */
+
+};
+
+/*
* A "jfreeblk" structure tracks the journal write for freeing a block
* or tree of blocks. The block pointer must not be cleared in the inode
* or indirect prior to the jfreeblk being written to the journal.
*/
struct jfreeblk {
- struct worklist jf_list; /* Linked to softdep_journal_pending. */
-# define jf_state jf_list.wk_state
- struct jsegdep *jf_jsegdep; /* Will track our journal record. */
- struct freeblks *jf_freeblks; /* Back pointer to freeblks. */
- LIST_ENTRY(jfreeblk) jf_deps; /* Jfreeblk on fb_jfreeblkhd. */
- ino_t jf_ino; /* Ino from which blocks freed. */
+ struct jblkdep jf_dep; /* freeblks linkage. */
ufs_lbn_t jf_lbn; /* Lbn from which blocks freed. */
ufs2_daddr_t jf_blkno; /* Blkno being freed. */
+ ino_t jf_ino; /* Ino from which blocks freed. */
int jf_frags; /* Number of frags being freed. */
};
@@ -843,24 +872,31 @@ struct jfreefrag {
# define fr_state fr_list.wk_state
struct jsegdep *fr_jsegdep; /* Will track our journal record. */
struct freefrag *fr_freefrag; /* Back pointer to freefrag. */
- ino_t fr_ino; /* Ino from which frag freed. */
ufs_lbn_t fr_lbn; /* Lbn from which frag freed. */
ufs2_daddr_t fr_blkno; /* Blkno being freed. */
+ ino_t fr_ino; /* Ino from which frag freed. */
int fr_frags; /* Size of frag being freed. */
};
/*
- * A "jtrunc" journals the intent to truncate an inode to a non-zero
- * value. This is done synchronously prior to the synchronous partial
- * truncation process. The jsegdep is not released until the truncation
- * is complete and the truncated inode is fsync'd.
+ * A "jtrunc" journals the intent to truncate an inode's data or extent area.
*/
struct jtrunc {
- struct worklist jt_list; /* Linked to softdep_journal_pending. */
- struct jsegdep *jt_jsegdep; /* Will track our journal record. */
- ino_t jt_ino; /* Ino being truncated. */
- off_t jt_size; /* Final file size. */
- int jt_extsize; /* Final extent size. */
+ struct jblkdep jt_dep; /* freeblks linkage. */
+ off_t jt_size; /* Final file size. */
+ int jt_extsize; /* Final extent size. */
+ ino_t jt_ino; /* Ino being truncated. */
+};
+
+/*
+ * A "jfsync" journals the completion of an fsync which invalidates earlier
+ * jtrunc records in the journal.
+ */
+struct jfsync {
+ struct worklist jfs_list; /* For softdep journal pending. */
+ off_t jfs_size; /* Sync file size. */
+ int jfs_extsize; /* Sync extent size. */
+ ino_t jfs_ino; /* ino being synced. */
};
/*
diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h
index f6c4bb5..7adcc73 100644
--- a/sys/ufs/ufs/inode.h
+++ b/sys/ufs/ufs/inode.h
@@ -127,6 +127,8 @@ struct inode {
#define IN_EA_LOCKED 0x0200
#define IN_EA_LOCKWAIT 0x0400
+#define IN_TRUNCATED 0x0800 /* Journaled truncation pending. */
+
#define i_devvp i_ump->um_devvp
#define i_umbufobj i_ump->um_bo
#define i_dirhash i_un.dirhash
diff --git a/sys/ufs/ufs/quota.h b/sys/ufs/ufs/quota.h
index ca0dcce..3dfcf26 100644
--- a/sys/ufs/ufs/quota.h
+++ b/sys/ufs/ufs/quota.h
@@ -239,6 +239,12 @@ int setuse(struct thread *, struct mount *, u_long, int, void *);
int getquotasize(struct thread *, struct mount *, u_long, int, void *);
vfs_quotactl_t ufs_quotactl;
+#ifdef SOFTUPDATES
+int quotaref(struct vnode *, struct dquot **);
+void quotarele(struct dquot **);
+void quotaadj(struct dquot **, struct ufsmount *, int64_t);
+#endif /* SOFTUPDATES */
+
#else /* !_KERNEL */
#include <sys/cdefs.h>
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c
index 45ebea1..391b3e9 100644
--- a/sys/ufs/ufs/ufs_lookup.c
+++ b/sys/ufs/ufs/ufs_lookup.c
@@ -967,7 +967,7 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdirbp, isrename)
return (0);
if (tvp != NULL)
VOP_UNLOCK(tvp, 0);
- error = VOP_FSYNC(dvp, MNT_WAIT, td);
+ (void) VOP_FSYNC(dvp, MNT_WAIT, td);
if (tvp != NULL)
vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY);
return (error);
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index be82b8f..59e89f9 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -1613,6 +1613,101 @@ dqflush(struct vnode *vp)
}
/*
+ * The following three functions are provided for the adjustment of
+ * quotas by the soft updates code.
+ */
+#ifdef SOFTUPDATES
+/*
+ * Acquire a reference to the quota structures associated with a vnode.
+ * Return count of number of quota structures found.
+ */
+int
+quotaref(vp, qrp)
+ struct vnode *vp;
+ struct dquot **qrp;
+{
+ struct inode *ip;
+ struct dquot *dq;
+ int i, found;
+
+ for (i = 0; i < MAXQUOTAS; i++)
+ qrp[i] = NODQUOT;
+ /*
+ * Disk quotas must be turned off for system files. Currently
+ * snapshot and quota files.
+ */
+ if ((vp->v_vflag & VV_SYSTEM) != 0)
+ return (0);
+ /*
+ * Iterate through and copy active quotas.
+ */
+ found = 0;
+ ip = VTOI(vp);
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = ip->i_dquot[i]) == NODQUOT)
+ continue;
+ DQREF(dq);
+ qrp[i] = dq;
+ found++;
+ }
+ return (found);
+}
+
+/*
+ * Release a set of quota structures obtained from a vnode.
+ */
+void
+quotarele(qrp)
+ struct dquot **qrp;
+{
+ struct dquot *dq;
+ int i;
+
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = qrp[i]) == NODQUOT)
+ continue;
+ dqrele(NULL, dq);
+ }
+}
+
+/*
+ * Adjust the number of blocks associated with a quota.
+ * Positive numbers when adding blocks; negative numbers when freeing blocks.
+ */
+void
+quotaadj(qrp, ump, blkcount)
+ struct dquot **qrp;
+ struct ufsmount *ump;
+ int64_t blkcount;
+{
+ struct dquot *dq;
+ ufs2_daddr_t ncurblocks;
+ int i;
+
+ if (blkcount == 0)
+ return;
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if ((dq = qrp[i]) == NODQUOT)
+ continue;
+ DQI_LOCK(dq);
+ DQI_WAIT(dq, PINOD+1, "adjqta");
+ ncurblocks = dq->dq_curblocks + blkcount;
+ if (ncurblocks >= 0)
+ dq->dq_curblocks = ncurblocks;
+ else
+ dq->dq_curblocks = 0;
+ if (blkcount < 0)
+ dq->dq_flags &= ~DQ_BLKS;
+ else if (dq->dq_curblocks + blkcount >= dq->dq_bsoftlimit &&
+ dq->dq_curblocks < dq->dq_bsoftlimit)
+ dq->dq_btime = time_second + ump->um_btime[i];
+ dq->dq_flags |= DQ_MOD;
+ DQI_UNLOCK(dq);
+ }
+}
+#endif /* SOFTUPDATES */
+
+/*
* 32-bit / 64-bit conversion functions.
*
* 32-bit quota records are stored in native byte order. Attention must
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 34b1758..733413d 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1838,6 +1838,8 @@ ufs_mkdir(ap)
#ifdef QUOTA
if ((error = getinoquota(ip)) ||
(error = chkiq(ip, 1, ucp, 0))) {
+ if (DOINGSOFTDEP(tvp))
+ softdep_revert_link(dp, ip);
UFS_VFREE(tvp, ip->i_number, dmode);
vput(tvp);
return (error);
@@ -1850,6 +1852,8 @@ ufs_mkdir(ap)
#ifdef QUOTA
if ((error = getinoquota(ip)) ||
(error = chkiq(ip, 1, cnp->cn_cred, 0))) {
+ if (DOINGSOFTDEP(tvp))
+ softdep_revert_link(dp, ip);
UFS_VFREE(tvp, ip->i_number, dmode);
vput(tvp);
return (error);
@@ -2608,6 +2612,8 @@ ufs_makeinode(mode, dvp, vpp, cnp)
#ifdef QUOTA
if ((error = getinoquota(ip)) ||
(error = chkiq(ip, 1, ucp, 0))) {
+ if (DOINGSOFTDEP(tvp))
+ softdep_revert_link(pdir, ip);
UFS_VFREE(tvp, ip->i_number, mode);
vput(tvp);
return (error);
@@ -2620,6 +2626,8 @@ ufs_makeinode(mode, dvp, vpp, cnp)
#ifdef QUOTA
if ((error = getinoquota(ip)) ||
(error = chkiq(ip, 1, cnp->cn_cred, 0))) {
+ if (DOINGSOFTDEP(tvp))
+ softdep_revert_link(pdir, ip);
UFS_VFREE(tvp, ip->i_number, mode);
vput(tvp);
return (error);
diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h
index c2cfcfb..7874105 100644
--- a/sys/ufs/ufs/ufsmount.h
+++ b/sys/ufs/ufs/ufsmount.h
@@ -61,6 +61,7 @@ struct jblocks;
struct inodedep;
TAILQ_HEAD(inodedeplst, inodedep);
+LIST_HEAD(bmsafemaphd, bmsafemap);
/* This structure describes the UFS specific mount structure data. */
struct ufsmount {
@@ -82,10 +83,10 @@ struct ufsmount {
struct workhead softdep_journal_pending; /* journal work queue */
struct worklist *softdep_journal_tail; /* Tail pointer for above */
struct jblocks *softdep_jblocks; /* Journal block information */
- struct inodedeplst softdep_unlinked; /* Unlinked inodes */
+ struct inodedeplst softdep_unlinked; /* Unlinked inodes */
+ struct bmsafemaphd softdep_dirtycg; /* Dirty CGs */
int softdep_on_journal; /* Items on the journal list */
int softdep_on_worklist; /* Items on the worklist */
- int softdep_on_worklist_inprogress; /* Busy items on worklist */
int softdep_deps; /* Total dependency count */
int softdep_accdeps; /* accumulated dep count */
int softdep_req; /* Wakeup when deps hits 0. */
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index d417a84..7568f57 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len,
* caller's changes may go unnoticed because they are
* performed through an unmanaged mapping or by a DMA
* operation.
+ *
+ * The object lock is not held here. Therefore, like
+ * a pmap operation, the page queues lock may be
+ * required in order to call vm_page_dirty(). See
+ * vm_page_clear_dirty_mask().
*/
+#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
+ defined(__mips__)
+ vm_page_dirty(*mp);
+#else
vm_page_lock_queues();
vm_page_dirty(*mp);
vm_page_unlock_queues();
+#endif
}
}
if (pmap_failed) {
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index dbcac85..1a3d398 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -852,6 +852,21 @@ rescan:
flags, &clearobjflags);
if (object->generation != curgeneration)
goto rescan;
+
+ /*
+ * If the VOP_PUTPAGES() did a truncated write, so
+ * that even the first page of the run is not fully
+ * written, vm_pageout_flush() returns 0 as the run
+ * length. Since the condition that caused truncated
+ * write may be permanent, e.g. exhausted free space,
+ * accepting n == 0 would cause an infinite loop.
+ *
+ * Forwarding the iterator leaves the unwritten page
+ * behind, but there is not much we can do there if
+ * filesystem refuses to write it.
+ */
+ if (n == 0)
+ n = 1;
np = vm_page_find_least(object, pi + n);
}
#if 0
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index e2758ec..033c4c9 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *msg)
/*
* vm_page_dirty:
*
- * make page all dirty
+ * Set all bits in the page's dirty field.
+ *
+ * The object containing the specified page must be locked if the call is
+ * made from the machine-independent layer. If, however, the call is
+ * made from the pmap layer, then the page queues lock may be required.
+ * See vm_page_clear_dirty_mask().
*/
void
vm_page_dirty(vm_page_t m)
@@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, int pagebits)
/*
* If the object is locked and the page is neither VPO_BUSY nor
* PG_WRITEABLE, then the page's dirty field cannot possibly be
- * modified by a concurrent pmap operation.
+ * set by a concurrent pmap operation.
*/
VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0)
m->dirty &= ~pagebits;
else {
+#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
+ defined(__mips__)
+ /*
+ * On the aforementioned architectures, the page queues lock
+ * is not required by the following read-modify-write
+ * operation. The combination of the object's lock and an
+ * atomic operation suffice. Moreover, the pmap layer on
+ * these architectures can call vm_page_dirty() without
+ * holding the page queues lock.
+ */
+#if PAGE_SIZE == 4096
+ atomic_clear_char(&m->dirty, pagebits);
+#elif PAGE_SIZE == 8192
+ atomic_clear_short(&m->dirty, pagebits);
+#elif PAGE_SIZE == 16384
+ atomic_clear_int(&m->dirty, pagebits);
+#else
+#error "PAGE_SIZE is not supported."
+#endif
+#else
+ /*
+ * Otherwise, the page queues lock is required to ensure that
+ * a concurrent pmap operation does not set the page's dirty
+ * field during the following read-modify-write operation.
+ */
vm_page_lock_queues();
m->dirty &= ~pagebits;
vm_page_unlock_queues();
+#endif
}
}
@@ -2636,6 +2667,23 @@ vm_page_cowsetup(vm_page_t m)
return (0);
}
+#ifdef INVARIANTS
+void
+vm_page_object_lock_assert(vm_page_t m)
+{
+
+ /*
+ * Certain of the page's fields may only be modified by the
+ * holder of the containing object's lock or the setter of the
+ * page's VPO_BUSY flag. Unfortunately, the setter of the
+ * VPO_BUSY flag is not recorded, and thus cannot be checked
+ * here.
+ */
+ if (m->object != NULL && (m->oflags & VPO_BUSY) == 0)
+ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
+}
+#endif
+
#include "opt_ddb.h"
#ifdef DDB
#include <sys/kernel.h>
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index c34d2f0..e852313 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -89,10 +89,26 @@
* and offset to which this page belongs (for pageout),
* and sundry status bits.
*
- * Fields in this structure are locked either by the lock on the
- * object that the page belongs to (O), its corresponding page lock (P),
- * or by the lock on the page queues (Q).
- *
+ * In general, operations on this structure's mutable fields are
+ * synchronized using either one of or a combination of the lock on the
+ * object that the page belongs to (O), the pool lock for the page (P),
+ * or the lock for either the free or paging queues (Q). If a field is
+ * annotated below with two of these locks, then holding either lock is
+ * sufficient for read access, but both locks are required for write
+ * access.
+ *
+ * In contrast, the synchronization of accesses to the page's dirty field
+ * is machine dependent (M). In the machine-independent layer, the lock
+ * on the object that the page belongs to must be held in order to
+ * operate on the field. However, the pmap layer is permitted to set
+ * all bits within the field without holding that lock. Therefore, if
+ * the underlying architecture does not support atomic read-modify-write
+ * operations on the field's type, then the machine-independent layer
+ * must also hold the page queues lock when performing read-modify-write
+ * operations and the pmap layer must hold the page queues lock when
+ * setting the field. In the machine-independent layer, the
+ * implementation of read-modify-write operations on the field is
+ * encapsulated in vm_page_clear_dirty_mask().
*/
TAILQ_HEAD(pglist, vm_page);
@@ -120,18 +136,19 @@ struct vm_page {
u_char busy; /* page busy count (O) */
/* NOTE that these must support one bit per DEV_BSIZE in a page!!! */
/* so, on normal X86 kernels, they must be at least 8 bits wide */
+ /* In reality, support for 32KB pages is not fully implemented. */
#if PAGE_SIZE == 4096
u_char valid; /* map of valid DEV_BSIZE chunks (O) */
- u_char dirty; /* map of dirty DEV_BSIZE chunks (O) */
+ u_char dirty; /* map of dirty DEV_BSIZE chunks (M) */
#elif PAGE_SIZE == 8192
u_short valid; /* map of valid DEV_BSIZE chunks (O) */
- u_short dirty; /* map of dirty DEV_BSIZE chunks (O) */
+ u_short dirty; /* map of dirty DEV_BSIZE chunks (M) */
#elif PAGE_SIZE == 16384
u_int valid; /* map of valid DEV_BSIZE chunks (O) */
- u_int dirty; /* map of dirty DEV_BSIZE chunks (O) */
+ u_int dirty; /* map of dirty DEV_BSIZE chunks (M) */
#elif PAGE_SIZE == 32768
u_long valid; /* map of valid DEV_BSIZE chunks (O) */
- u_long dirty; /* map of dirty DEV_BSIZE chunks (O) */
+ u_long dirty; /* map of dirty DEV_BSIZE chunks (M) */
#endif
};
@@ -383,6 +400,13 @@ void vm_page_cowfault (vm_page_t);
int vm_page_cowsetup(vm_page_t);
void vm_page_cowclear (vm_page_t);
+#ifdef INVARIANTS
+void vm_page_object_lock_assert(vm_page_t m);
+#define VM_PAGE_OBJECT_LOCK_ASSERT(m) vm_page_object_lock_assert(m)
+#else
+#define VM_PAGE_OBJECT_LOCK_ASSERT(m) (void)0
+#endif
+
/*
* vm_page_sleep_if_busy:
*
@@ -412,6 +436,8 @@ vm_page_sleep_if_busy(vm_page_t m, int also_m_busy, const char *msg)
static __inline void
vm_page_undirty(vm_page_t m)
{
+
+ VM_PAGE_OBJECT_LOCK_ASSERT(m);
m->dirty = 0;
}
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index f497d41..a8eca20 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -1089,7 +1089,7 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *ma, int bytecount,
count = bytecount / PAGE_SIZE;
for (i = 0; i < count; i++)
- rtvals[i] = VM_PAGER_AGAIN;
+ rtvals[i] = VM_PAGER_ERROR;
if ((int64_t)ma[0]->pindex < 0) {
printf("vnode_pager_putpages: attempt to write meta-data!!! -- 0x%lx(%lx)\n",
@@ -1191,3 +1191,26 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *ma, int bytecount,
}
return rtvals[0];
}
+
+void
+vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written)
+{
+ vm_object_t obj;
+ int i, pos;
+
+ if (written == 0)
+ return;
+ obj = ma[0]->object;
+ VM_OBJECT_LOCK(obj);
+ for (i = 0, pos = 0; pos < written; i++, pos += PAGE_SIZE) {
+ if (pos < trunc_page(written)) {
+ rtvals[i] = VM_PAGER_OK;
+ vm_page_undirty(ma[i]);
+ } else {
+ /* Partially written page. */
+ rtvals[i] = VM_PAGER_AGAIN;
+ vm_page_clear_dirty(ma[i], 0, written & PAGE_MASK);
+ }
+ }
+ VM_OBJECT_UNLOCK(obj);
+}
diff --git a/sys/vm/vnode_pager.h b/sys/vm/vnode_pager.h
index 88ae306..5e3d5eb 100644
--- a/sys/vm/vnode_pager.h
+++ b/sys/vm/vnode_pager.h
@@ -49,5 +49,8 @@ int vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m,
int vnode_pager_generic_putpages(struct vnode *vp, vm_page_t *m,
int count, boolean_t sync,
int *rtvals);
+
+void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written);
+
#endif /* _KERNEL */
#endif /* _VNODE_PAGER_ */
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index e188d62..44e3a2e 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -1192,7 +1192,7 @@ lapic_handle_timer(struct trapframe *frame)
* and unlike other schedulers it actually schedules threads to
* those CPUs.
*/
- if ((hlt_cpus_mask & (1 << PCPU_GET(cpuid))) != 0)
+ if (CPU_ISSET(PCPU_GET(cpuid), &hlt_cpus_mask))
return;
#endif
diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c
index d82bd73..9501eee 100644
--- a/sys/x86/x86/tsc.c
+++ b/sys/x86/x86/tsc.c
@@ -79,7 +79,8 @@ static void tsc_freq_changed(void *arg, const struct cf_level *level,
int status);
static void tsc_freq_changing(void *arg, const struct cf_level *level,
int *status);
-static unsigned tsc_get_timecount(struct timecounter *tc);
+static unsigned tsc_get_timecount(struct timecounter *tc);
+static unsigned tsc_get_timecount_low(struct timecounter *tc);
static void tsc_levels_changed(void *arg, int unit);
static struct timecounter tsc_timecounter = {
@@ -166,9 +167,6 @@ tsc_freq_vmware(void)
tsc_freq = regs[0] | ((uint64_t)regs[1] << 32);
}
tsc_is_invariant = 1;
-#ifdef SMP
- smp_tsc = 1; /* XXX */
-#endif
return (1);
}
@@ -385,7 +383,29 @@ test_smp_tsc(void)
if (bootverbose)
printf("SMP: %sed TSC synchronization test\n",
smp_tsc ? "pass" : "fail");
- return (smp_tsc ? 800 : -100);
+ if (smp_tsc && tsc_is_invariant) {
+ switch (cpu_vendor_id) {
+ case CPU_VENDOR_AMD:
+ /*
+ * Starting with Family 15h processors, TSC clock
+ * source is in the north bridge. Check whether
+ * we have a single-socket/multi-core platform.
+ * XXX Need more work for complex cases.
+ */
+ if (CPUID_TO_FAMILY(cpu_id) < 0x15 ||
+ (amd_feature2 & AMDID2_CMP) == 0 ||
+ smp_cpus > (cpu_procinfo2 & AMDID_CMP_CORES) + 1)
+ break;
+ return (1000);
+ case CPU_VENDOR_INTEL:
+ /*
+ * XXX Assume Intel platforms have synchronized TSCs.
+ */
+ return (1000);
+ }
+ return (800);
+ }
+ return (-100);
}
#undef N
@@ -395,11 +415,19 @@ test_smp_tsc(void)
static void
init_TSC_tc(void)
{
+ uint64_t max_freq;
+ int shift;
if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled)
return;
/*
+ * Limit timecounter frequency to fit in an int and prevent it from
+ * overflowing too fast.
+ */
+ max_freq = UINT_MAX;
+
+ /*
* We can not use the TSC if we support APM. Precise timekeeping
* on an APM'ed machine is at best a fools pursuit, since
* any and all of the time spent in various SMM code can't
@@ -421,13 +449,30 @@ init_TSC_tc(void)
* We can not use the TSC in SMP mode unless the TSCs on all CPUs are
* synchronized. If the user is sure that the system has synchronized
* TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value.
+ * We also limit the frequency even lower to avoid "temporal anomalies"
+ * as much as possible.
*/
- if (smp_cpus > 1)
+ if (smp_cpus > 1) {
tsc_timecounter.tc_quality = test_smp_tsc();
+ max_freq >>= 8;
+ } else
#endif
+ if (tsc_is_invariant)
+ tsc_timecounter.tc_quality = 1000;
+
init:
+ for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++)
+ ;
+ if (shift > 0) {
+ tsc_timecounter.tc_get_timecount = tsc_get_timecount_low;
+ tsc_timecounter.tc_name = "TSC-low";
+ if (bootverbose)
+ printf("TSC timecounter discards lower %d bit(s)\n",
+ shift);
+ }
if (tsc_freq != 0) {
- tsc_timecounter.tc_frequency = tsc_freq;
+ tsc_timecounter.tc_frequency = tsc_freq >> shift;
+ tsc_timecounter.tc_priv = (void *)(intptr_t)shift;
tc_init(&tsc_timecounter);
}
}
@@ -499,7 +544,8 @@ tsc_freq_changed(void *arg, const struct cf_level *level, int status)
/* Total setting for this level gives the new frequency in MHz. */
freq = (uint64_t)level->total_set.freq * 1000000;
atomic_store_rel_64(&tsc_freq, freq);
- atomic_store_rel_64(&tsc_timecounter.tc_frequency, freq);
+ tsc_timecounter.tc_frequency =
+ freq >> (int)(intptr_t)tsc_timecounter.tc_priv;
}
static int
@@ -514,7 +560,8 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS)
error = sysctl_handle_64(oidp, &freq, 0, req);
if (error == 0 && req->newptr != NULL) {
atomic_store_rel_64(&tsc_freq, freq);
- atomic_store_rel_64(&tsc_timecounter.tc_frequency, freq);
+ atomic_store_rel_64(&tsc_timecounter.tc_frequency,
+ freq >> (int)(intptr_t)tsc_timecounter.tc_priv);
}
return (error);
}
@@ -523,8 +570,18 @@ SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_U64 | CTLFLAG_RW,
0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter frequency");
static u_int
-tsc_get_timecount(struct timecounter *tc)
+tsc_get_timecount(struct timecounter *tc __unused)
{
return (rdtsc32());
}
+
+static u_int
+tsc_get_timecount_low(struct timecounter *tc)
+{
+ uint32_t rv;
+
+ __asm __volatile("rdtsc; shrd %%cl, %%edx, %0"
+ : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx");
+ return (rv);
+}
diff --git a/sys/xen/interface/io/xenbus.h b/sys/xen/interface/io/xenbus.h
index 5e24f31..672c7d4 100644
--- a/sys/xen/interface/io/xenbus.h
+++ b/sys/xen/interface/io/xenbus.h
@@ -64,6 +64,15 @@ enum xenbus_state {
/*
* Closed: No connection exists between front and back end.
+ *
+ * For backend devices with the "online" attribute, the front can
+ * request a reconnect at any time. To handle this transition
+ * gracefully, backend devices must reinitialize any XenStore data
+ * used to negotiate features with a peer before transitioning to
+ * the closed state. When a reconnect request occurs, the
+ * XenBus backend support code will automatically transition the
+ * backend device from Closed to InitWait, kicking off the ring
+ * and feature negotiation process.
*/
XenbusStateClosed = 6,
diff --git a/sys/xen/xenbus/xenbus.c b/sys/xen/xenbus/xenbus.c
index c3e5fee..8887066 100644
--- a/sys/xen/xenbus/xenbus.c
+++ b/sys/xen/xenbus/xenbus.c
@@ -103,12 +103,13 @@ xenbus_strstate(XenbusState state)
int
xenbus_watch_path(device_t dev, char *path, struct xs_watch *watch,
- xs_watch_cb_t *callback)
+ xs_watch_cb_t *callback, uintptr_t callback_data)
{
int error;
watch->node = path;
watch->callback = callback;
+ watch->callback_data = callback_data;
error = xs_register_watch(watch);
@@ -124,7 +125,7 @@ xenbus_watch_path(device_t dev, char *path, struct xs_watch *watch,
int
xenbus_watch_path2(device_t dev, const char *path,
const char *path2, struct xs_watch *watch,
- xs_watch_cb_t *callback)
+ xs_watch_cb_t *callback, uintptr_t callback_data)
{
int error;
char *state = malloc(strlen(path) + 1 + strlen(path2) + 1,
@@ -134,7 +135,7 @@ xenbus_watch_path2(device_t dev, const char *path,
strcat(state, "/");
strcat(state, path2);
- error = xenbus_watch_path(dev, state, watch, callback);
+ error = xenbus_watch_path(dev, state, watch, callback, callback_data);
if (error) {
free(state,M_XENBUS);
}
@@ -286,3 +287,8 @@ xenbus_dev_is_online(device_t dev)
return (value);
}
+
+void
+xenbus_localend_changed(device_t dev, const char *path)
+{
+}
diff --git a/sys/xen/xenbus/xenbus_if.m b/sys/xen/xenbus/xenbus_if.m
index d671418..87d7c7f 100644
--- a/sys/xen/xenbus/xenbus_if.m
+++ b/sys/xen/xenbus/xenbus_if.m
@@ -27,7 +27,11 @@
#
#include <sys/bus.h>
-#include <xen/interface/io/xenbus.h>
+
+#include <machine/atomic.h>
+#include <machine/xen/xen-os.h>
+#include <xen/evtchn.h>
+#include <xen/xenbus/xenbusvar.h>
INTERFACE xenbus;
@@ -39,7 +43,21 @@ INTERFACE xenbus;
* state has changed..
* \param _newstate The new state of the otherend device.
*/
-METHOD int otherend_changed {
+METHOD void otherend_changed {
device_t _dev;
enum xenbus_state _newstate;
};
+
+/**
+ * \brief Callback triggered when the XenStore tree of the local end
+ * of a split device changes.
+ *
+ * \param _dev NewBus device_t for this XenBus device whose otherend's
+ * state has changed..
+ * \param _path The tree relative sub-path to the modified node. The empty
+ * string indicates the root of the tree was destroyed.
+ */
+METHOD void localend_changed {
+ device_t _dev;
+ const char * _path;
+} DEFAULT xenbus_localend_changed;
diff --git a/sys/xen/xenbus/xenbusb.c b/sys/xen/xenbus/xenbusb.c
index 4bc86aa..cc519c5 100644
--- a/sys/xen/xenbus/xenbusb.c
+++ b/sys/xen/xenbus/xenbusb.c
@@ -90,10 +90,16 @@ xenbusb_free_child_ivars(struct xenbus_device_ivars *ivars)
ivars->xd_otherend_watch.node = NULL;
}
+ if (ivars->xd_local_watch.node != NULL) {
+ xs_unregister_watch(&ivars->xd_local_watch);
+ ivars->xd_local_watch.node = NULL;
+ }
+
if (ivars->xd_node != NULL) {
free(ivars->xd_node, M_XENBUS);
ivars->xd_node = NULL;
}
+ ivars->xd_node_len = 0;
if (ivars->xd_type != NULL) {
free(ivars->xd_type, M_XENBUS);
@@ -104,6 +110,7 @@ xenbusb_free_child_ivars(struct xenbus_device_ivars *ivars)
free(ivars->xd_otherend_path, M_XENBUS);
ivars->xd_otherend_path = NULL;
}
+ ivars->xd_otherend_path_len = 0;
free(ivars, M_XENBUS);
}
@@ -121,30 +128,64 @@ xenbusb_free_child_ivars(struct xenbus_device_ivars *ivars)
* watch event data. The vector should be indexed via the
* xs_watch_type enum in xs_wire.h.
* \param vec_size The number of elements in vec.
- *
- * \return The device_t of the found device if any, or NULL.
- *
- * \note device_t is a pointer type, so it can be compared against
- * NULL for validity.
*/
static void
-xenbusb_otherend_changed(struct xs_watch *watch, const char **vec,
+xenbusb_otherend_watch_cb(struct xs_watch *watch, const char **vec,
unsigned int vec_size __unused)
{
struct xenbus_device_ivars *ivars;
- device_t dev;
+ device_t child;
+ device_t bus;
+ const char *path;
enum xenbus_state newstate;
- ivars = (struct xenbus_device_ivars *) watch;
- dev = ivars->xd_dev;
+ ivars = (struct xenbus_device_ivars *)watch->callback_data;
+ child = ivars->xd_dev;
+ bus = device_get_parent(child);
- if (!ivars->xd_otherend_path
- || strncmp(ivars->xd_otherend_path, vec[XS_WATCH_PATH],
- strlen(ivars->xd_otherend_path)))
+ path = vec[XS_WATCH_PATH];
+ if (ivars->xd_otherend_path == NULL
+ || strncmp(ivars->xd_otherend_path, path, ivars->xd_otherend_path_len))
return;
newstate = xenbus_read_driver_state(ivars->xd_otherend_path);
- XENBUS_OTHEREND_CHANGED(dev, newstate);
+ XENBUSB_OTHEREND_CHANGED(bus, child, newstate);
+}
+
+/**
+ * XenBus watch callback registered against the XenStore sub-tree
+ * represnting the local half of a split device connection.
+ *
+ * This callback is invoked whenever any XenStore data in the subtree
+ * is modified, either by us or another privledged domain.
+ *
+ * \param watch The xs_watch object used to register this callback
+ * function.
+ * \param vec An array of pointers to NUL terminated strings containing
+ * watch event data. The vector should be indexed via the
+ * xs_watch_type enum in xs_wire.h.
+ * \param vec_size The number of elements in vec.
+ *
+ */
+static void
+xenbusb_local_watch_cb(struct xs_watch *watch, const char **vec,
+ unsigned int vec_size __unused)
+{
+ struct xenbus_device_ivars *ivars;
+ device_t child;
+ device_t bus;
+ const char *path;
+
+ ivars = (struct xenbus_device_ivars *)watch->callback_data;
+ child = ivars->xd_dev;
+ bus = device_get_parent(child);
+
+ path = vec[XS_WATCH_PATH];
+ if (ivars->xd_node == NULL
+ || strncmp(ivars->xd_node, path, ivars->xd_node_len))
+ return;
+
+ XENBUSB_LOCALEND_CHANGED(bus, child, &path[ivars->xd_node_len]);
}
/**
@@ -193,12 +234,14 @@ xenbusb_delete_child(device_t dev, device_t child)
/*
* We no longer care about the otherend of the
- * connection. Cancel the watch now so that we
+ * connection. Cancel the watches now so that we
* don't try to handle an event for a partially
* detached child.
*/
if (ivars->xd_otherend_watch.node != NULL)
xs_unregister_watch(&ivars->xd_otherend_watch);
+ if (ivars->xd_local_watch.node != NULL)
+ xs_unregister_watch(&ivars->xd_local_watch);
device_delete_child(dev, child);
xenbusb_free_child_ivars(ivars);
@@ -421,6 +464,7 @@ xenbusb_probe_children(device_t dev)
*/
ivars = device_get_ivars(kids[i]);
xs_register_watch(&ivars->xd_otherend_watch);
+ xs_register_watch(&ivars->xd_local_watch);
}
free(kids, M_TEMP);
}
@@ -475,7 +519,7 @@ xenbusb_devices_changed(struct xs_watch *watch, const char **vec,
char *p;
u_int component;
- xbs = (struct xenbusb_softc *)watch;
+ xbs = (struct xenbusb_softc *)watch->callback_data;
dev = xbs->xbs_dev;
if (len <= XS_WATCH_PATH) {
@@ -620,6 +664,7 @@ xenbusb_add_device(device_t dev, const char *type, const char *id)
sx_init(&ivars->xd_lock, "xdlock");
ivars->xd_flags = XDF_CONNECTING;
ivars->xd_node = strdup(devpath, M_XENBUS);
+ ivars->xd_node_len = strlen(devpath);
ivars->xd_type = strdup(type, M_XENBUS);
ivars->xd_state = XenbusStateInitialising;
@@ -630,12 +675,16 @@ xenbusb_add_device(device_t dev, const char *type, const char *id)
goto out;
}
- statepath = malloc(strlen(ivars->xd_otherend_path)
+ statepath = malloc(ivars->xd_otherend_path_len
+ strlen("/state") + 1, M_XENBUS, M_WAITOK);
sprintf(statepath, "%s/state", ivars->xd_otherend_path);
-
ivars->xd_otherend_watch.node = statepath;
- ivars->xd_otherend_watch.callback = xenbusb_otherend_changed;
+ ivars->xd_otherend_watch.callback = xenbusb_otherend_watch_cb;
+ ivars->xd_otherend_watch.callback_data = (uintptr_t)ivars;
+
+ ivars->xd_local_watch.node = ivars->xd_node;
+ ivars->xd_local_watch.callback = xenbusb_local_watch_cb;
+ ivars->xd_local_watch.callback_data = (uintptr_t)ivars;
mtx_lock(&xbs->xbs_lock);
xbs->xbs_connecting_children++;
@@ -693,6 +742,7 @@ xenbusb_attach(device_t dev, char *bus_node, u_int id_components)
xbs->xbs_device_watch.node = bus_node;
xbs->xbs_device_watch.callback = xenbusb_devices_changed;
+ xbs->xbs_device_watch.callback_data = (uintptr_t)xbs;
TASK_INIT(&xbs->xbs_probe_children, 0, xenbusb_probe_children_cb, dev);
@@ -735,7 +785,7 @@ xenbusb_resume(device_t dev)
DEVICE_RESUME(kids[i]);
- statepath = malloc(strlen(ivars->xd_otherend_path)
+ statepath = malloc(ivars->xd_otherend_path_len
+ strlen("/state") + 1, M_XENBUS, M_WAITOK);
sprintf(statepath, "%s/state", ivars->xd_otherend_path);
@@ -819,7 +869,7 @@ xenbusb_write_ivar(device_t dev, device_t child, int index, uintptr_t value)
{
int error;
- newstate = (enum xenbus_state) value;
+ newstate = (enum xenbus_state)value;
sx_xlock(&ivars->xd_lock);
if (ivars->xd_state == newstate) {
error = 0;
@@ -876,3 +926,24 @@ xenbusb_write_ivar(device_t dev, device_t child, int index, uintptr_t value)
return (ENOENT);
}
+
+void
+xenbusb_otherend_changed(device_t bus, device_t child, enum xenbus_state state)
+{
+ XENBUS_OTHEREND_CHANGED(child, state);
+}
+
+void
+xenbusb_localend_changed(device_t bus, device_t child, const char *path)
+{
+
+ if (strcmp(path, "/state") != 0) {
+ struct xenbus_device_ivars *ivars;
+
+ ivars = device_get_ivars(child);
+ sx_xlock(&ivars->xd_lock);
+ ivars->xd_state = xenbus_read_driver_state(ivars->xd_node);
+ sx_xunlock(&ivars->xd_lock);
+ }
+ XENBUS_LOCALEND_CHANGED(child, path);
+}
diff --git a/sys/xen/xenbus/xenbusb.h b/sys/xen/xenbus/xenbusb.h
index 75abb98..33008f7 100644
--- a/sys/xen/xenbus/xenbusb.h
+++ b/sys/xen/xenbus/xenbusb.h
@@ -41,7 +41,6 @@
* Datastructures and function declarations for use in implementing
* bus attachements (e.g. frontend and backend device busses) for XenBus.
*/
-#include "xenbusb_if.h"
/**
* Enumeration of state flag values for the xbs_flags field of
@@ -61,10 +60,6 @@ struct xenbusb_softc {
* XenStore watch used to monitor the subtree of the
* XenStore where devices for this bus attachment arrive
* and depart.
- *
- * \note This field must be the first in the softc structure
- * so that a simple cast can be used to retrieve the
- * softc from within a XenStore watch event callback.
*/
struct xs_watch xbs_device_watch;
@@ -129,14 +124,17 @@ struct xenbus_device_ivars {
* XenStore watch used to monitor the subtree of the
* XenStore where information about the otherend of
* the split Xen device this device instance represents.
- *
- * \note This field must be the first in the instance
- * variable structure so that a simple cast can be
- * used to retrieve ivar data from within a XenStore
- * watch event callback.
*/
struct xs_watch xd_otherend_watch;
+ /**
+ * XenStore watch used to monitor the XenStore sub-tree
+ * associated with this device. This watch will fire
+ * for modifications that we make from our domain as
+ * well as for those made by the control domain.
+ */
+ struct xs_watch xd_local_watch;
+
/** Sleepable lock used to protect instance data. */
struct sx xd_lock;
@@ -152,6 +150,9 @@ struct xenbus_device_ivars {
*/
char *xd_node;
+ /** The length of xd_node. */
+ int xd_node_len;
+
/** XenBus device type ("vbd", "vif", etc.). */
char *xd_type;
@@ -168,6 +169,9 @@ struct xenbus_device_ivars {
* about the otherend of this split device instance.
*/
char *xd_otherend_path;
+
+ /** The length of xd_otherend_path. */
+ int xd_otherend_path_len;
};
/**
@@ -247,6 +251,26 @@ int xenbusb_write_ivar(device_t dev, device_t child, int index,
uintptr_t value);
/**
+ * \brief Common XenBus method implementing responses to peer state changes.
+ *
+ * \param bus The XenBus bus parent of child.
+ * \param child The XenBus child whose peer stat has changed.
+ * \param state The current state of the peer.
+ */
+void xenbusb_otherend_changed(device_t bus, device_t child,
+ enum xenbus_state state);
+
+/**
+ * \brief Common XenBus method implementing responses to local XenStore changes.
+ *
+ * \param bus The XenBus bus parent of child.
+ * \param child The XenBus child whose peer stat has changed.
+ * \param path The tree relative sub-path to the modified node. The empty
+ * string indicates the root of the tree was destroyed.
+ */
+void xenbusb_localend_changed(device_t bus, device_t child, const char *path);
+
+/**
* \brief Attempt to add a XenBus device instance to this XenBus bus.
*
* \param dev The NewBus device representing this XenBus bus.
@@ -269,4 +293,6 @@ int xenbusb_write_ivar(device_t dev, device_t child, int index,
*/
int xenbusb_add_device(device_t dev, const char *type, const char *id);
+#include "xenbusb_if.h"
+
#endif /* _XEN_XENBUS_XENBUSB_H */
diff --git a/sys/xen/xenbus/xenbusb_back.c b/sys/xen/xenbus/xenbusb_back.c
index 32bbc04..1252abe 100644
--- a/sys/xen/xenbus/xenbusb_back.c
+++ b/sys/xen/xenbus/xenbusb_back.c
@@ -208,57 +208,79 @@ xenbusb_back_get_otherend_node(device_t dev, struct xenbus_device_ivars *ivars)
if (error == 0) {
ivars->xd_otherend_path = strdup(otherend_path, M_XENBUS);
+ ivars->xd_otherend_path_len = strlen(otherend_path);
free(otherend_path, M_XENSTORE);
}
return (error);
}
/**
- * \brief Backend XenBus child instance variable write access method.
- *
- * \param dev The NewBus device representing this XenBus bus.
- * \param child The NewBus device representing a child of dev%'s XenBus bus.
- * \param index The index of the instance variable to access.
- * \param value The new value to set in the instance variable accessed.
- *
- * \return On success, 0. Otherwise an errno value indicating the
- * type of failure.
- *
- * Xenbus_back overrides this method so that it can trap state transitions
- * of local backend devices and clean up their XenStore entries as necessary
- * during device instance teardown.
+ * \brief Backend XenBus method implementing responses to peer state changes.
+ *
+ * \param bus The XenBus bus parent of child.
+ * \param child The XenBus child whose peer stat has changed.
+ * \param state The current state of the peer.
*/
-static int
-xenbusb_back_write_ivar(device_t dev, device_t child, int index,
- uintptr_t value)
+static void
+xenbusb_back_otherend_changed(device_t bus, device_t child,
+ enum xenbus_state peer_state)
{
- int error;
+ /* Perform default processing of state. */
+ xenbusb_otherend_changed(bus, child, peer_state);
- error = xenbusb_write_ivar(dev, child, index, value);
+ /*
+ * "Online" devices are never fully detached in the
+ * newbus sense. Only the front<->back connection is
+ * torn down. If the front returns to the initialising
+ * state after closing a previous connection, signal
+ * our willingness to reconnect and that all necessary
+ * XenStore data for feature negotiation is present.
+ */
+ if (peer_state == XenbusStateInitialising
+ && xenbus_dev_is_online(child) != 0
+ && xenbus_get_state(child) == XenbusStateClosed)
+ xenbus_set_state(child, XenbusStateInitWait);
+}
- if (index == XENBUS_IVAR_STATE
- && (enum xenbus_state)value == XenbusStateClosed
- && xenbus_dev_is_online(child) == 0) {
+/**
+ * \brief Backend XenBus method implementing responses to local
+ * XenStore changes.
+ *
+ * \param bus The XenBus bus parent of child.
+ * \param child The XenBus child whose peer stat has changed.
+ * \param_path The tree relative sub-path to the modified node. The empty
+ * string indicates the root of the tree was destroyed.
+ */
+static void
+xenbusb_back_localend_changed(device_t bus, device_t child, const char *path)
+{
- /*
- * Cleanup the hotplug entry in the XenStore if
- * present. The control domain expects any userland
- * component associated with this device to destroy
- * this node in order to signify it is safe to
- * teardown the device. However, not all backends
- * rely on userland components, and those that
- * do should either use a communication channel
- * other than the XenStore, or ensure the hotplug
- * data is already cleaned up.
- *
- * This removal ensures that no matter what path
- * is taken to mark a back-end closed, the control
- * domain will understand that it is closed.
- */
- xs_rm(XST_NIL, xenbus_get_node(child), "hotplug-status");
- }
+ xenbusb_localend_changed(bus, child, path);
- return (error);
+ if (strcmp(path, "/state") != 0
+ && strcmp(path, "/online") != 0)
+ return;
+
+ if (xenbus_get_state(child) != XenbusStateClosed
+ || xenbus_dev_is_online(child) != 0)
+ return;
+
+ /*
+ * Cleanup the hotplug entry in the XenStore if
+ * present. The control domain expects any userland
+ * component associated with this device to destroy
+ * this node in order to signify it is safe to
+ * teardown the device. However, not all backends
+ * rely on userland components, and those that
+ * do should either use a communication channel
+ * other than the XenStore, or ensure the hotplug
+ * data is already cleaned up.
+ *
+ * This removal ensures that no matter what path
+ * is taken to mark a back-end closed, the control
+ * domain will understand that it is closed.
+ */
+ xs_rm(XST_NIL, xenbus_get_node(child), "hotplug-status");
}
/*-------------------- Private Device Attachment Data -----------------------*/
@@ -275,7 +297,7 @@ static device_method_t xenbusb_back_methods[] = {
/* Bus Interface */
DEVMETHOD(bus_print_child, xenbusb_print_child),
DEVMETHOD(bus_read_ivar, xenbusb_read_ivar),
- DEVMETHOD(bus_write_ivar, xenbusb_back_write_ivar),
+ DEVMETHOD(bus_write_ivar, xenbusb_write_ivar),
DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
DEVMETHOD(bus_release_resource, bus_generic_release_resource),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
@@ -284,6 +306,8 @@ static device_method_t xenbusb_back_methods[] = {
/* XenBus Bus Interface */
DEVMETHOD(xenbusb_enumerate_type, xenbusb_back_enumerate_type),
DEVMETHOD(xenbusb_get_otherend_node, xenbusb_back_get_otherend_node),
+ DEVMETHOD(xenbusb_otherend_changed, xenbusb_back_otherend_changed),
+ DEVMETHOD(xenbusb_localend_changed, xenbusb_back_localend_changed),
{ 0, 0 }
};
diff --git a/sys/xen/xenbus/xenbusb_front.c b/sys/xen/xenbus/xenbusb_front.c
index 0bc06a4..b4e470e 100644
--- a/sys/xen/xenbus/xenbusb_front.c
+++ b/sys/xen/xenbus/xenbusb_front.c
@@ -156,6 +156,7 @@ xenbusb_front_get_otherend_node(device_t dev, struct xenbus_device_ivars *ivars)
if (error == 0) {
ivars->xd_otherend_path = strdup(otherend_path, M_XENBUS);
+ ivars->xd_otherend_path_len = strlen(otherend_path);
free(otherend_path, M_XENSTORE);
}
return (error);
diff --git a/sys/xen/xenbus/xenbusb_if.m b/sys/xen/xenbus/xenbusb_if.m
index a32e3f6..c49f333 100644
--- a/sys/xen/xenbus/xenbusb_if.m
+++ b/sys/xen/xenbus/xenbusb_if.m
@@ -31,10 +31,12 @@
#
#include <sys/bus.h>
+#include <sys/lock.h>
+#include <sys/sx.h>
+#include <sys/taskqueue.h>
-HEADER {
-struct xenbus_device_ivars;
-}
+#include <xen/xenstore/xenstorevar.h>
+#include <xen/xenbus/xenbusb.h>
INTERFACE xenbusb;
@@ -76,3 +78,34 @@ METHOD int get_otherend_node {
device_t _dev;
struct xenbus_device_ivars *_ivars;
}
+
+/**
+ * \brief Handle a XenStore change detected in the peer tree of a child
+ * device of the bus.
+ *
+ * \param _bus NewBus device_t for this XenBus (front/back) bus instance.
+ * \param _child NewBus device_t for the child device whose peer XenStore
+ * tree has changed.
+ * \param _state The current state of the peer.
+ */
+METHOD void otherend_changed {
+ device_t _bus;
+ device_t _child;
+ enum xenbus_state _state;
+} DEFAULT xenbusb_otherend_changed;
+
+/**
+ * \brief Handle a XenStore change detected in the local tree of a child
+ * device of the bus.
+ *
+ * \param _bus NewBus device_t for this XenBus (front/back) bus instance.
+ * \param _child NewBus device_t for the child device whose peer XenStore
+ * tree has changed.
+ * \param _path The tree relative sub-path to the modified node. The empty
+ * string indicates the root of the tree was destroyed.
+ */
+METHOD void localend_changed {
+ device_t _bus;
+ device_t _child;
+ const char * _path;
+} DEFAULT xenbusb_localend_changed;
diff --git a/sys/xen/xenbus/xenbusvar.h b/sys/xen/xenbus/xenbusvar.h
index 55d7f29..bf2a342 100644
--- a/sys/xen/xenbus/xenbusvar.h
+++ b/sys/xen/xenbus/xenbusvar.h
@@ -51,8 +51,6 @@
#include <xen/xenstore/xenstorevar.h>
-#include "xenbus_if.h"
-
/* XenBus allocations including XenStore data returned to clients. */
MALLOC_DECLARE(M_XENBUS);
@@ -116,6 +114,8 @@ XenbusState xenbus_read_driver_state(const char *path);
* must be stable for the lifetime of the watch.
* \param callback The function to call when XenStore objects at or below
* path are modified.
+ * \param cb_data Client data that can be retrieved from the watch object
+ * during the callback.
*
* \return On success, 0. Otherwise an errno value indicating the
* type of failure.
@@ -126,7 +126,8 @@ XenbusState xenbus_read_driver_state(const char *path);
*/
int xenbus_watch_path(device_t dev, char *path,
struct xs_watch *watch,
- xs_watch_cb_t *callback);
+ xs_watch_cb_t *callback,
+ uintptr_t cb_data);
/**
* Initialize and register a watch at path/path2 in the XenStore.
@@ -138,6 +139,8 @@ int xenbus_watch_path(device_t dev, char *path,
* must be stable for the lifetime of the watch.
* \param callback The function to call when XenStore objects at or below
* path are modified.
+ * \param cb_data Client data that can be retrieved from the watch object
+ * during the callback.
*
* \return On success, 0. Otherwise an errno value indicating the
* type of failure.
@@ -153,7 +156,8 @@ int xenbus_watch_path(device_t dev, char *path,
*/
int xenbus_watch_path2(device_t dev, const char *path,
const char *path2, struct xs_watch *watch,
- xs_watch_cb_t *callback);
+ xs_watch_cb_t *callback,
+ uintptr_t cb_data);
/**
* Grant access to the given ring_mfn to the peer of the given device.
@@ -275,4 +279,16 @@ const char *xenbus_strstate(enum xenbus_state state);
*/
int xenbus_dev_is_online(device_t dev);
+/**
+ * Default callback invoked when a change to the local XenStore sub-tree
+ * for a device is modified.
+ *
+ * \param dev The XenBus device whose tree was modified.
+ * \param path The tree relative sub-path to the modified node. The empty
+ * string indicates the root of the tree was destroyed.
+ */
+void xenbus_localend_changed(device_t dev, const char *path);
+
+#include "xenbus_if.h"
+
#endif /* _XEN_XENBUS_XENBUSVAR_H */
diff --git a/sys/xen/xenstore/xenstorevar.h b/sys/xen/xenstore/xenstorevar.h
index df41e31..4a1382d 100644
--- a/sys/xen/xenstore/xenstorevar.h
+++ b/sys/xen/xenstore/xenstorevar.h
@@ -56,8 +56,8 @@ struct xenstore_domain_interface;
struct xs_watch;
extern struct xenstore_domain_interface *xen_store;
-typedef void (xs_watch_cb_t)(struct xs_watch *,
- const char **vec, unsigned int len);
+typedef void (xs_watch_cb_t)(struct xs_watch *, const char **vec,
+ unsigned int len);
/* Register callback to watch subtree (node) in the XenStore. */
struct xs_watch
@@ -69,6 +69,9 @@ struct xs_watch
/* Callback (executed in a process context with no locks held). */
xs_watch_cb_t *callback;
+
+ /* Callback client data untouched by the XenStore watch mechanism. */
+ uintptr_t callback_data;
};
LIST_HEAD(xs_watch_list, xs_watch);
@@ -301,7 +304,7 @@ int xs_gather(struct xs_transaction t, const char *dir, ...);
* XenStore watches allow a client to be notified via a callback (embedded
* within the watch object) of changes to an object in the XenStore.
*
- * \param watch A xenbus_watch struct with it's node and callback fields
+ * \param watch An xs_watch struct with it's node and callback fields
* properly initialized.
*
* \return On success, 0. Otherwise an errno value indicating the
diff --git a/tools/build/make_check/Makefile b/tools/build/make_check/Makefile
index e57e70c..cc8ca6b 100644
--- a/tools/build/make_check/Makefile
+++ b/tools/build/make_check/Makefile
@@ -1,5 +1,7 @@
# $FreeBSD$
+.MAKE.MODE= normal
+
# Test for broken LHS expansion.
# This *must* cause make(1) to detect a recursive variable, and fail as such.
.if make(lhs_expn)
@@ -152,24 +154,19 @@ pass_cmd_vars:
@${SMAKE} CMD1=cmd1 CMD2=cmd2 pass_cmd_vars_4
.endif
-.if make(pass_cmd_vars_1)
+#
# Check that the variable definition arrived from the calling make
+#
+.if make(pass_cmd_vars_1)
+# These values should get overridden by the commandline
+CMD1=oops1
+CMD2=oops2
pass_cmd_vars_1:
@:
.if ${CMD1} != cmd1 || ${CMD2} != cmd2
.error variables not passed through MAKEFLAGS
.endif
-
-# Check that the variable definition is in MAKEFLAGS
-.if ${.MAKEFLAGS:MCMD1=*} != "CMD1=cmd1" || ${.MAKEFLAGS:MCMD2=*} != "CMD2=cmd2"
-.error variable assignment not found in $${MAKEFLAGS}
-.endif
-
-# Check that the variable definition is not in MFLAGS
-.if ${MFLAGS:MCMD1=*} != "" || ${MFLAGS:MCMD2=*} != ""
-.error variable assignment found in $${MFLAGS}
-.endif
.endif
.if make(pass_cmd_vars_2)
@@ -228,7 +225,7 @@ pass_cmd_vars_4_1:
#
.if make(plus_flag)
OUT != ${SMAKE} -n plus_flag_1
-.if ${OUT} != "/tmp"
+.if ${OUT:M/tmp} != "/tmp"
.error make doesn't handle + flag
.endif
plus_flag:
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index 8d24fc6..3de090d 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -7,11 +7,8 @@
.if ${MK_ACCT} == no
OLD_FILES+=etc/periodic/daily/310.accounting
-OLD_FILES+=etc/periodic/monthly/200.accounting
-OLD_FILES+=usr/sbin/ac
OLD_FILES+=usr/sbin/accton
OLD_FILES+=usr/sbin/sa
-OLD_FILES+=usr/share/man/man8/ac.8.gz
OLD_FILES+=usr/share/man/man8/accton.8.gz
OLD_FILES+=usr/share/man/man8/sa.8.gz
.endif
@@ -3329,6 +3326,24 @@ OLD_FILES+=usr/share/man/man8/telnetd.8.gz
# to be filled in
#.endif
+.if ${MK_UTMPX} == no
+OLD_FILES+=etc/periodic/monthly/200.accounting
+OLD_FILES+=usr/bin/last
+OLD_FILES+=usr/bin/users
+OLD_FILES+=usr/bin/who
+OLD_FILES+=usr/bin/wtmpcvt
+OLD_FILES+=usr/sbin/ac
+OLD_FILES+=usr/sbin/lastlogin
+OLD_FILES+=usr/sbin/utxrm
+OLD_FILES+=usr/share/man/man1/last.1.gz
+OLD_FILES+=usr/share/man/man1/users.1.gz
+OLD_FILES+=usr/share/man/man1/who.1.gz
+OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz
+OLD_FILES+=usr/share/man/man8/ac.8.gz
+OLD_FILES+=usr/share/man/man8/lastlogin.8.gz
+OLD_FILES+=usr/share/man/man8/utxrm.8.gz
+.endif
+
.if ${MK_WIRELESS} == no
OLD_FILES+=etc/regdomain.xml
OLD_FILES+=usr/sbin/ancontrol
diff --git a/tools/build/options/WITHOUT_ACCT b/tools/build/options/WITHOUT_ACCT
index 4538ee7..a0e0f54 100644
--- a/tools/build/options/WITHOUT_ACCT
+++ b/tools/build/options/WITHOUT_ACCT
@@ -1,5 +1,5 @@
.\" $FreeBSD$
Set to not build process accounting tools such as
-.Xr ac 8
+.Xr accton 8
and
-.Xr accton 8 .
+.Xr sa 8 .
diff --git a/tools/build/options/WITHOUT_UTMPX b/tools/build/options/WITHOUT_UTMPX
new file mode 100644
index 0000000..205ca5c
--- /dev/null
+++ b/tools/build/options/WITHOUT_UTMPX
@@ -0,0 +1,10 @@
+.\" $FreeBSD$
+Set to not build user accounting tools such as
+.Xr last 1 ,
+.Xr users 1 ,
+.Xr who 1 ,
+.Xr wtmpcvt 1 ,
+.Xr ac 8 ,
+.Xr lastlogin 8
+and
+.Xr utxrm 8 .
diff --git a/tools/build/options/WITH_BSD_GREP b/tools/build/options/WITH_BSD_GREP
index 702ca25..e664117 100644
--- a/tools/build/options/WITH_BSD_GREP
+++ b/tools/build/options/WITH_BSD_GREP
@@ -1,2 +1,2 @@
.\" $FreeBSD$
-Build BSD-licensed grep instead of GNU grep.
+Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
diff --git a/tools/regression/bin/sh/builtins/alias.1.stderr b/tools/regression/bin/sh/builtins/alias.1.stderr
index 5ea01d5..c9f4011 100644
--- a/tools/regression/bin/sh/builtins/alias.1.stderr
+++ b/tools/regression/bin/sh/builtins/alias.1.stderr
@@ -1 +1 @@
-alias: foo not found
+alias: foo: not found
diff --git a/tools/regression/bin/sh/builtins/case6.0 b/tools/regression/bin/sh/builtins/case6.0
new file mode 100644
index 0000000..8d79183
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/case6.0
@@ -0,0 +1,52 @@
+# $FreeBSD$
+
+unset LC_ALL
+LC_CTYPE=de_DE.ISO8859-1
+export LC_CTYPE
+
+c1=e
+# o umlaut
+c2=$(printf '\366')
+# non-break space
+c3=$(printf '\240')
+c4=$(printf '\240')
+# $c2$c3$c4 form one utf-8 character
+
+ok=0
+case $c1$c2$c3$c4 in
+*) ok=1 ;;
+esac
+if [ $ok = 0 ]; then
+ echo wrong at $LINENO
+ exit 3
+fi
+
+case $c1$c2$c3$c4 in
+$c1$c2$c3$c4) ;;
+*) echo wrong at $LINENO ;;
+esac
+
+case $c1$c2$c3$c4 in
+"$c1$c2$c3$c4") ;;
+*) echo wrong at $LINENO ;;
+esac
+
+case $c1$c2$c3$c4 in
+????) ;;
+*) echo wrong at $LINENO ;;
+esac
+
+case $c1$c2$c3$c4 in
+[!$c2][!b][!c][!d]) ;;
+*) echo wrong at $LINENO ;;
+esac
+
+case $c1$c2$c3$c4 in
+[$c1][$c2][$c3][$c4]) ;;
+*) echo wrong at $LINENO ;;
+esac
+
+case $c1$c2$c3$c4 in
+["$c1"]["$c2"]["$c3"]["$c4"]) ;;
+*) echo wrong at $LINENO ;;
+esac
diff --git a/tools/regression/bin/sh/builtins/case7.0 b/tools/regression/bin/sh/builtins/case7.0
new file mode 100644
index 0000000..96b9de6
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/case7.0
@@ -0,0 +1,24 @@
+# $FreeBSD$
+
+# Character ranges in a locale other than the POSIX locale, not specified
+# by POSIX.
+
+unset LC_ALL
+LC_CTYPE=de_DE.ISO8859-1
+export LC_CTYPE
+LC_COLLATE=de_DE.ISO8859-1
+export LC_COLLATE
+
+c1=e
+# o umlaut
+c2=$(printf '\366')
+
+case $c1$c2 in
+[a-z][a-z]) ;;
+*) echo wrong at $LINENO ;;
+esac
+
+case $c1$c2 in
+[a-f][n-p]) ;;
+*) echo wrong at $LINENO ;;
+esac
diff --git a/tools/regression/bin/sh/builtins/case8.0 b/tools/regression/bin/sh/builtins/case8.0
new file mode 100644
index 0000000..8d9f8b6
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/case8.0
@@ -0,0 +1,32 @@
+# $FreeBSD$
+
+case aZ_ in
+[[:alpha:]_][[:upper:]_][[:alpha:]_]) ;;
+*) echo Failed at $LINENO ;;
+esac
+
+case ' ' in
+[[:alpha:][:digit:]]) echo Failed at $LINENO ;;
+[![:alpha:][:digit:]]) ;;
+*) echo Failed at $LINENO ;;
+esac
+
+case '.X.' in
+*[[:lower:]]*) echo Failed at $LINENO ;;
+*[[:upper:]]*) ;;
+*) echo Failed at $LINENO ;;
+esac
+
+case ' ' in
+[![:print:]]) echo Failed at $LINENO ;;
+[![:alnum:][:punct:]]) ;;
+*) echo Failed at $LINENO ;;
+esac
+
+case '
+' in
+[[:print:]]) echo Failed at $LINENO ;;
+['
+'[:digit:]]) ;;
+*) echo Failed at $LINENO ;;
+esac
diff --git a/tools/regression/bin/sh/builtins/case9.0 b/tools/regression/bin/sh/builtins/case9.0
new file mode 100644
index 0000000..476caec
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/case9.0
@@ -0,0 +1,39 @@
+# $FreeBSD$
+
+errors=0
+
+f() {
+ result=
+ case $1 in
+ a) result=${result}a ;;
+ b) result=${result}b ;&
+ c) result=${result}c ;&
+ d) result=${result}d ;;
+ e) result=${result}e ;&
+ esac
+}
+
+check() {
+ f "$1"
+ if [ "$result" != "$2" ]; then
+ printf "For %s, expected %s got %s\n" "$1" "$2" "$result"
+ errors=$((errors + 1))
+ fi
+}
+
+check '' ''
+check a a
+check b bcd
+check c cd
+check d d
+check e e
+
+if ! (case 1 in
+ 1) false ;&
+ 2) true ;;
+esac) then
+ echo "Subshell bad"
+ errors=$((errors + 1))
+fi
+
+exit $((errors != 0))
diff --git a/tools/regression/bin/sh/builtins/cd5.0 b/tools/regression/bin/sh/builtins/cd5.0
new file mode 100644
index 0000000..3dff604
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/cd5.0
@@ -0,0 +1,23 @@
+# $FreeBSD$
+
+set -e
+T=$(mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXX")
+trap 'rm -rf "$T"' 0
+
+cd -P "$T"
+D=$(pwd)
+
+mkdir a a/1 b b/1 b/2
+
+CDPATH=$D/a:
+# Basic test.
+cd 1 >/dev/null
+[ "$(pwd)" = "$D/a/1" ]
+# Test that the current directory is not checked before CDPATH.
+cd "$D/b"
+cd 1 >/dev/null
+[ "$(pwd)" = "$D/a/1" ]
+# Test not using a CDPATH entry.
+cd "$D/b"
+cd 2
+[ "$(pwd)" = "$D/b/2" ]
diff --git a/tools/regression/bin/sh/builtins/cd6.0 b/tools/regression/bin/sh/builtins/cd6.0
new file mode 100644
index 0000000..083a061
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/cd6.0
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+set -e
+cd -P /bin
+d=$PWD
+CDPATH=/:
+cd -P .
+[ "$d" = "$PWD" ]
+cd -P ./
+[ "$d" = "$PWD" ]
diff --git a/tools/regression/bin/sh/builtins/cd7.0 b/tools/regression/bin/sh/builtins/cd7.0
new file mode 100644
index 0000000..9adda86
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/cd7.0
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+set -e
+cd /usr/bin
+[ "$PWD" = /usr/bin ]
+CDPATH=/:
+cd .
+[ "$PWD" = /usr/bin ]
+cd ./
+[ "$PWD" = /usr/bin ]
+cd ..
+[ "$PWD" = /usr ]
+cd /usr/bin
+cd ../
+[ "$PWD" = /usr ]
diff --git a/tools/regression/bin/sh/builtins/export1.0 b/tools/regression/bin/sh/builtins/export1.0
new file mode 100644
index 0000000..7b08c9d
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/export1.0
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+env @badness=1 ${SH} -c 'v=`export -p`; eval "$v"'
diff --git a/tools/regression/bin/sh/builtins/set1.0 b/tools/regression/bin/sh/builtins/set1.0
new file mode 100644
index 0000000..fc39fad
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/set1.0
@@ -0,0 +1,32 @@
+# $FreeBSD$
+
+set +C
+set +f
+set -e
+
+settings=$(set +o)
+set -C
+set -f
+set +e
+case $- in
+*C*) ;;
+*) echo missing C ;;
+esac
+case $- in
+*f*) ;;
+*) echo missing C ;;
+esac
+case $- in
+*e*) echo bad e ;;
+esac
+eval "$settings"
+case $- in
+*C*) echo bad C ;;
+esac
+case $- in
+*f*) echo bad f ;;
+esac
+case $- in
+*e*) ;;
+*) echo missing e ;;
+esac
diff --git a/tools/regression/bin/sh/builtins/set2.0 b/tools/regression/bin/sh/builtins/set2.0
new file mode 100644
index 0000000..ad13eab
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/set2.0
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+! env @badness=1 ${SH} -c 'v=`set`; eval "$v"' 2>&1 | grep @badness
diff --git a/tools/regression/bin/sh/execution/bg4.0 b/tools/regression/bin/sh/execution/bg4.0
new file mode 100644
index 0000000..25e4f4e
--- /dev/null
+++ b/tools/regression/bin/sh/execution/bg4.0
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+x=''
+: ${x:=1} &
+wait
+exit ${x:-0}
diff --git a/tools/regression/bin/sh/execution/set-n1.0 b/tools/regression/bin/sh/execution/set-n1.0
new file mode 100644
index 0000000..14c9b93
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-n1.0
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+v=$( ($SH -n <<'EOF'
+for
+EOF
+) 2>&1 >/dev/null)
+[ $? -ne 0 ] && [ -n "$v" ]
diff --git a/tools/regression/bin/sh/execution/set-n2.0 b/tools/regression/bin/sh/execution/set-n2.0
new file mode 100644
index 0000000..c7f3162
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-n2.0
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+$SH -n <<'EOF'
+echo bad
+EOF
diff --git a/tools/regression/bin/sh/execution/set-n3.0 b/tools/regression/bin/sh/execution/set-n3.0
new file mode 100644
index 0000000..24a9159
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-n3.0
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+v=$( ($SH -nc 'for') 2>&1 >/dev/null)
+[ $? -ne 0 ] && [ -n "$v" ]
diff --git a/tools/regression/bin/sh/execution/set-n4.0 b/tools/regression/bin/sh/execution/set-n4.0
new file mode 100644
index 0000000..3698508
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-n4.0
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+$SH -nc 'echo bad'
diff --git a/tools/regression/bin/sh/execution/set-x1.0 b/tools/regression/bin/sh/execution/set-x1.0
new file mode 100644
index 0000000..7fe1dbf
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-x1.0
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+key='must_contain_this'
+{ r=`set -x; { : "$key"; } 2>&1 >/dev/null`; } 2>/dev/null
+case $r in
+*"$key"*) true ;;
+*) false ;;
+esac
diff --git a/tools/regression/bin/sh/execution/set-x2.0 b/tools/regression/bin/sh/execution/set-x2.0
new file mode 100644
index 0000000..56d54e3
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-x2.0
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+key='must contain this'
+PS4="$key+ "
+{ r=`set -x; { :; } 2>&1 >/dev/null`; } 2>/dev/null
+case $r in
+*"$key"*) true ;;
+*) false ;;
+esac
diff --git a/tools/regression/bin/sh/execution/set-x3.0 b/tools/regression/bin/sh/execution/set-x3.0
new file mode 100644
index 0000000..1ca57ac
--- /dev/null
+++ b/tools/regression/bin/sh/execution/set-x3.0
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+key='must contain this'
+PS4='$key+ '
+{ r=`set -x; { :; } 2>&1 >/dev/null`; } 2>/dev/null
+case $r in
+*"$key"*) true ;;
+*) false ;;
+esac
diff --git a/tools/regression/bin/sh/expansion/cmdsubst11.0 b/tools/regression/bin/sh/expansion/cmdsubst11.0
new file mode 100644
index 0000000..f1af547
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/cmdsubst11.0
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+# Not required by POSIX but useful for efficiency.
+
+[ $$ = $(eval '${SH} -c echo\ \$PPID') ]
diff --git a/tools/regression/bin/sh/expansion/heredoc1.0 b/tools/regression/bin/sh/expansion/heredoc1.0
new file mode 100644
index 0000000..a67b2da
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/heredoc1.0
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+f() { return $1; }
+
+[ `f 42; { cat; } <<EOF
+$?
+EOF
+` = 42 ] || echo compound command bad
+
+[ `f 42; (cat) <<EOF
+$?
+EOF
+` = 42 ] || echo subshell bad
+
+long=`printf %08192d 0`
+
+[ `f 42; { cat; } <<EOF
+$long.$?
+EOF
+` = $long.42 ] || echo long compound command bad
+
+[ `f 42; (cat) <<EOF
+$long.$?
+EOF
+` = $long.42 ] || echo long subshell bad
diff --git a/tools/regression/bin/sh/expansion/heredoc2.0 b/tools/regression/bin/sh/expansion/heredoc2.0
new file mode 100644
index 0000000..2551432
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/heredoc2.0
@@ -0,0 +1,15 @@
+# $FreeBSD$
+
+f() { return $1; }
+
+[ `f 42; cat <<EOF
+$?
+EOF
+` = 42 ] || echo simple command bad
+
+long=`printf %08192d 0`
+
+[ `f 42; cat <<EOF
+$long.$?
+EOF
+` = $long.42 ] || echo long simple command bad
diff --git a/tools/regression/bin/sh/expansion/ifs4.0 b/tools/regression/bin/sh/expansion/ifs4.0
new file mode 100644
index 0000000..5b896a2
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/ifs4.0
@@ -0,0 +1,39 @@
+# $FreeBSD$
+
+c=: e= s=' '
+failures=''
+ok=''
+
+check_result() {
+ if [ "x$2" = "x$3" ]; then
+ ok=x$ok
+ else
+ failures=x$failures
+ echo "For $1, expected $3 actual $2"
+ fi
+}
+
+IFS='
+'
+set -- a b '' c
+set -- $@
+check_result 'set -- $@' "($#)($1)($2)($3)($4)" "(3)(a)(b)(c)()"
+
+IFS=''
+set -- a b '' c
+set -- $@
+check_result 'set -- $@' "($#)($1)($2)($3)($4)" "(3)(a)(b)(c)()"
+
+set -- a b '' c
+set -- $*
+check_result 'set -- $*' "($#)($1)($2)($3)($4)" "(3)(a)(b)(c)()"
+
+set -- a b '' c
+set -- "$@"
+check_result 'set -- "$@"' "($#)($1)($2)($3)($4)" "(4)(a)(b)()(c)"
+
+set -- a b '' c
+set -- "$*"
+check_result 'set -- "$*"' "($#)($1)($2)($3)($4)" "(1)(abc)()()()"
+
+test "x$failures" = x
diff --git a/tools/regression/bin/sh/parameters/env1.0 b/tools/regression/bin/sh/parameters/env1.0
new file mode 100644
index 0000000..c0d4a2c
--- /dev/null
+++ b/tools/regression/bin/sh/parameters/env1.0
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+export key='must contain this'
+unset x
+r=$(ENV="\${x?\$key}" ${SH} -i +m 2>&1 >/dev/null <<\EOF
+exit 0
+EOF
+) && case $r in
+*"$key"*) true ;;
+*) false ;;
+esac
diff --git a/tools/regression/bin/sh/parser/func2.0 b/tools/regression/bin/sh/parser/func2.0
new file mode 100644
index 0000000..5fd4dda
--- /dev/null
+++ b/tools/regression/bin/sh/parser/func2.0
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+f() { return 42; }
+f() { return 3; } &
+f
+[ $? -eq 42 ]
diff --git a/tools/regression/bin/sh/parser/func3.0 b/tools/regression/bin/sh/parser/func3.0
new file mode 100644
index 0000000..dcac732
--- /dev/null
+++ b/tools/regression/bin/sh/parser/func3.0
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+name=/var/empty/nosuch
+f() { true; } <$name
+name=/dev/null
+f
diff --git a/tools/regression/netinet/ipdivert/Makefile b/tools/regression/netinet/ipdivert/Makefile
new file mode 100644
index 0000000..385620b
--- /dev/null
+++ b/tools/regression/netinet/ipdivert/Makefile
@@ -0,0 +1,11 @@
+#
+# $FreeBSD$
+#
+
+PROG= ipdivert
+SRCS= ipdivert.c
+NO_MAN=
+
+WARNS?= 2
+
+.include <bsd.prog.mk>
diff --git a/tools/regression/netinet/ipdivert/ipdivert.c b/tools/regression/netinet/ipdivert/ipdivert.c
new file mode 100644
index 0000000..0d58491
--- /dev/null
+++ b/tools/regression/netinet/ipdivert/ipdivert.c
@@ -0,0 +1,166 @@
+/*-
+ * Copyright (c) 2010-2011 Juniper Networks, Inc.
+ * All rights reserved.
+ *
+ * This software was developed by Robert N. M. Watson under contract
+ * to Juniper Networks, Inc.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * This is a test tool for IP divert sockets. For the time being, it just
+ * exercise creation and binding of sockets, rather than their divert
+ * behaviour. It would be highly desirable to broaden this test tool to
+ * include packet injection and diversion.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+
+#include <err.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+static void
+ok(const char *test)
+{
+
+ fprintf(stderr, "%s: OK\n", test);
+}
+
+static void
+fail(const char *test, const char *note)
+{
+
+ fprintf(stderr, "%s - %s: FAIL (%s)\n", test, note, strerror(errno));
+ exit(1);
+}
+
+static void
+failx(const char *test, const char *note)
+{
+
+ fprintf(stderr, "%s - %s: FAIL\n", test, note);
+ exit(1);
+}
+
+static int
+ipdivert_create(const char *test)
+{
+ int s;
+
+ s = socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT);
+ if (s < 0)
+ fail(test, "socket");
+ return (s);
+}
+
+static void
+ipdivert_close(const char *test, int s)
+{
+
+ if (close(s) < 0)
+ fail(test, "close");
+}
+
+static void
+ipdivert_bind(const char *test, int s, u_short port, int expect)
+{
+ struct sockaddr_in sin;
+ int err;
+
+ bzero(&sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_addr.s_addr = htonl(INADDR_ANY);
+ sin.sin_port = htons(port);
+
+ err = bind(s, (struct sockaddr *)&sin, sizeof(sin));
+ if (err < 0) {
+ if (expect == 0)
+ fail(test, "bind");
+ if (errno != expect)
+ fail(test, "bind");
+ } else {
+ if (expect != 0)
+ failx(test, "bind");
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ const char *test;
+ int s1, s2;
+
+ /*
+ * First test: create and close an IP divert socket.
+ */
+ test = "create_close";
+ s1 = ipdivert_create(test);
+ ipdivert_close(test, s1);
+ ok(test);
+
+ /*
+ * Second test: create, bind, and close an IP divert socket.
+ */
+ test = "create_bind_close";
+ s1 = ipdivert_create(test);
+ ipdivert_bind(test, s1, 1000, 0);
+ ipdivert_close(test, s1);
+ ok(test);
+
+ /*
+ * Third test: create two sockets, bind to different ports, and close.
+ * This should succeed due to non-conflict on the port numbers.
+ */
+ test = "create2_bind2_close2";
+ s1 = ipdivert_create(test);
+ s2 = ipdivert_create(test);
+ ipdivert_bind(test, s1, 1000, 0);
+ ipdivert_bind(test, s2, 1001, 0);
+ ipdivert_close(test, s1);
+ ipdivert_close(test, s2);
+ ok(test);
+
+ /*
+ * Fourth test: create two sockets, bind to the *same* port, and
+ * close. This should fail due to conflicting port numbers.
+ */
+ test = "create2_bind2_conflict_close2";
+ s1 = ipdivert_create(test);
+ s2 = ipdivert_create(test);
+ ipdivert_bind(test, s1, 1000, 0);
+ ipdivert_bind(test, s2, 1000, EADDRINUSE);
+ ipdivert_close(test, s1);
+ ipdivert_close(test, s2);
+ ok(test);
+
+ return (0);
+}
diff --git a/tools/regression/netinet/tcpconnect/tcpconnect.c b/tools/regression/netinet/tcpconnect/tcpconnect.c
index b9942d1..1257f66 100644
--- a/tools/regression/netinet/tcpconnect/tcpconnect.c
+++ b/tools/regression/netinet/tcpconnect/tcpconnect.c
@@ -34,6 +34,7 @@
#include <arpa/inet.h>
+#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
diff --git a/tools/regression/netinet/tcpdrop/tcpdrop.c b/tools/regression/netinet/tcpdrop/tcpdrop.c
index bf78d55..e6b7f43 100644
--- a/tools/regression/netinet/tcpdrop/tcpdrop.c
+++ b/tools/regression/netinet/tcpdrop/tcpdrop.c
@@ -1,7 +1,11 @@
/*-
* Copyright (c) 2006 Robert N. M. Watson
+ * Copyright (c) 2011 Juniper Networks, Inc.
* All rights reserved.
*
+ * Portions of this software were developed by Robert N. M. Watson under
+ * contract to Juniper Networks, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -46,8 +50,6 @@
#include <string.h>
#include <unistd.h>
-#define TCP_PORT 9001
-
static int
tcp_drop(struct sockaddr_in *sin_local, struct sockaddr_in *sin_remote)
{
@@ -66,41 +68,12 @@ tcp_drop(struct sockaddr_in *sin_local, struct sockaddr_in *sin_remote)
}
static void
-tcp_server(pid_t partner)
+tcp_server(pid_t partner, int listen_fd)
{
- int error, listen_fd, accept_fd;
- struct sockaddr_in sin;
+ int error, accept_fd;
ssize_t len;
char ch;
- listen_fd = socket(PF_INET, SOCK_STREAM, 0);
- if (listen_fd < 0) {
- error = errno;
- (void)kill(partner, SIGTERM);
- errno = error;
- err(-1, "tcp_server: socket");
- }
-
- bzero(&sin, sizeof(sin));
- sin.sin_family = AF_INET;
- sin.sin_len = sizeof(sin);
- sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- sin.sin_port = htons(TCP_PORT);
-
- if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- error = errno;
- (void)kill(partner, SIGTERM);
- errno = error;
- err(-1, "tcp_server: bind");
- }
-
- if (listen(listen_fd, -1) < 0) {
- error = errno;
- (void)kill(partner, SIGTERM);
- errno = error;
- err(-1, "tcp_server: listen");
- }
-
accept_fd = accept(listen_fd, NULL, NULL);
if (accept_fd < 0) {
error = errno;
@@ -146,7 +119,7 @@ tcp_server(pid_t partner)
}
static void
-tcp_client(pid_t partner)
+tcp_client(pid_t partner, u_short port)
{
struct sockaddr_in sin, sin_local;
int error, sock;
@@ -168,7 +141,7 @@ tcp_client(pid_t partner)
sin.sin_family = AF_INET;
sin.sin_len = sizeof(sin);
sin.sin_addr.s_addr = ntohl(INADDR_LOOPBACK);
- sin.sin_port = htons(TCP_PORT);
+ sin.sin_port = port;
if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
error = errno;
@@ -230,6 +203,40 @@ int
main(int argc, char *argv[])
{
pid_t child_pid, parent_pid;
+ struct sockaddr_in sin;
+ int listen_fd;
+ u_short port;
+ socklen_t len;
+
+ listen_fd = socket(PF_INET, SOCK_STREAM, 0);
+ if (listen_fd < 0)
+ err(-1, "socket");
+
+ /*
+ * We use the loopback, but let the kernel select a port for the
+ * server socket.
+ */
+ bzero(&sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0)
+ err(-1, "bind");
+
+ if (listen(listen_fd, -1) < 0)
+ err(-1, "listen");
+
+ /*
+ * Query the port so that the client can use it.
+ */
+ bzero(&sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ if (getsockname(listen_fd, (struct sockaddr *)&sin, &len) < 0)
+ err(-1, "getsockname");
+ port = sin.sin_port;
+ printf("Using port %d\n", ntohs(port));
if (signal(SIGCHLD, SIG_IGN) == SIG_ERR)
err(-1, "signal");
@@ -240,9 +247,9 @@ main(int argc, char *argv[])
err(-1, "fork");
if (child_pid == 0) {
child_pid = getpid();
- tcp_server(parent_pid);
+ tcp_server(parent_pid, listen_fd);
} else
- tcp_client(child_pid);
+ tcp_client(child_pid, port);
return (0);
}
diff --git a/tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c b/tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c
index ac86b9e..6e4ac03 100644
--- a/tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c
+++ b/tools/regression/netinet/tcpfullwindowrst/tcpfullwindowrsttest.c
@@ -35,6 +35,7 @@ $FreeBSD$
#include <poll.h>
#include <unistd.h>
#include <signal.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/regression/netinet/tcpsocktimewait/tcpsocktimewait.c b/tools/regression/netinet/tcpsocktimewait/tcpsocktimewait.c
index a5e6542..3025468 100644
--- a/tools/regression/netinet/tcpsocktimewait/tcpsocktimewait.c
+++ b/tools/regression/netinet/tcpsocktimewait/tcpsocktimewait.c
@@ -1,7 +1,11 @@
/*-
* Copyright (c) 2006 Robert N. M. Watson
+ * Copyright (c) 2011 Juniper Networks, Inc.
* All rights reserved.
*
+ * Portions of this software were developed by Robert N. M. Watson under
+ * contract to Juniper Networks, Inc.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -41,45 +45,15 @@
#include <err.h>
#include <errno.h>
#include <signal.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#define TCP_PORT 9001
-
static void
-tcp_server(pid_t partner)
+tcp_server(pid_t partner, int listen_fd)
{
- int error, listen_fd, accept_fd;
- struct sockaddr_in sin;
-
- listen_fd = socket(PF_INET, SOCK_STREAM, 0);
- if (listen_fd < 0) {
- error = errno;
- (void)kill(partner, SIGTERM);
- errno = error;
- err(-1, "tcp_server: socket");
- }
-
- bzero(&sin, sizeof(sin));
- sin.sin_family = AF_INET;
- sin.sin_len = sizeof(sin);
- sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- sin.sin_port = htons(TCP_PORT);
-
- if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- error = errno;
- (void)kill(partner, SIGTERM);
- errno = error;
- err(-1, "tcp_server: bind");
- }
-
- if (listen(listen_fd, -1) < 0) {
- error = errno;
- (void)kill(partner, SIGTERM);
- errno = error;
- err(-1, "tcp_server: listen");
- }
+ int error, accept_fd;
accept_fd = accept(listen_fd, NULL, NULL);
if (accept_fd < 0) {
@@ -93,7 +67,7 @@ tcp_server(pid_t partner)
}
static void
-tcp_client(pid_t partner, int secs)
+tcp_client(pid_t partner, u_short port, int secs)
{
struct sockaddr_in sin;
int error, sock;
@@ -112,7 +86,7 @@ tcp_client(pid_t partner, int secs)
sin.sin_family = AF_INET;
sin.sin_len = sizeof(sin);
sin.sin_addr.s_addr = ntohl(INADDR_LOOPBACK);
- sin.sin_port = htons(TCP_PORT);
+ sin.sin_port = port;
if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
error = errno;
@@ -135,7 +109,11 @@ tcp_client(pid_t partner, int secs)
int
main(int argc, char *argv[])
{
+ struct sockaddr_in sin;
pid_t child_pid, parent_pid;
+ int listen_fd;
+ socklen_t len;
+ u_short port;
if (signal(SIGCHLD, SIG_IGN) == SIG_ERR)
err(-1, "signal");
@@ -144,29 +122,96 @@ main(int argc, char *argv[])
* Run the whole thing twice: once, with a short sleep in the client,
* so that we close before time wait runs out, and once with a long
* sleep so that the time wait terminates while the socket is open.
+ * We don't reuse listen sockets between runs.
+ */
+ listen_fd = socket(PF_INET, SOCK_STREAM, 0);
+ if (listen_fd < 0)
+ err(-1, "socket");
+
+ /*
+ * We use the loopback, but let the kernel select a port for the
+ * server socket.
+ */
+ bzero(&sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0)
+ err(-1, "bind");
+
+ if (listen(listen_fd, -1) < 0)
+ err(-1, "listen");
+
+ /*
+ * Query the port so that the client can use it.
*/
+ bzero(&sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ len = sizeof(sin);
+ if (getsockname(listen_fd, (struct sockaddr *)&sin, &len) < 0)
+ err(-1, "getsockname");
+ port = sin.sin_port;
+ printf("Using port %d\n", ntohs(port));
+
parent_pid = getpid();
child_pid = fork();
if (child_pid < 0)
err(-1, "fork");
if (child_pid == 0) {
child_pid = getpid();
- tcp_server(child_pid);
+ tcp_server(child_pid, listen_fd);
exit(0);
} else
- tcp_client(parent_pid, 1);
+ tcp_client(parent_pid, port, 1);
(void)kill(child_pid, SIGTERM);
+ close(listen_fd);
sleep(5);
+ /*
+ * Start again, this time long sleep.
+ */
+ listen_fd = socket(PF_INET, SOCK_STREAM, 0);
+ if (listen_fd < 0)
+ err(-1, "socket");
+
+ /*
+ * We use the loopback, but let the kernel select a port for the
+ * server socket.
+ */
+ bzero(&sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0)
+ err(-1, "bind");
+
+ if (listen(listen_fd, -1) < 0)
+ err(-1, "listen");
+
+ /*
+ * Query the port so that the client can use it.
+ */
+ bzero(&sin, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ len = sizeof(sin);
+ if (getsockname(listen_fd, (struct sockaddr *)&sin, &len) < 0)
+ err(-1, "getsockname");
+ port = sin.sin_port;
+ printf("Using port %d\n", ntohs(port));
+
parent_pid = getpid();
child_pid = fork();
if (child_pid < 0)
err(-1, "fork");
if (child_pid == 0) {
child_pid = getpid();
- tcp_server(parent_pid);
+ tcp_server(parent_pid, listen_fd);
} else
- tcp_client(child_pid, 800);
+ tcp_client(child_pid, port, 800);
return (0);
}
diff --git a/tools/regression/netinet/udpconnectjail/udpconnectjail.c b/tools/regression/netinet/udpconnectjail/udpconnectjail.c
index 7151ca4..718836c 100644
--- a/tools/regression/netinet/udpconnectjail/udpconnectjail.c
+++ b/tools/regression/netinet/udpconnectjail/udpconnectjail.c
@@ -77,6 +77,7 @@ main(int argc, __unused char *argv[])
{
struct sockaddr_in sin;
struct jail thejail;
+ struct in_addr ia4;
if (argc != 1)
usage();
@@ -94,12 +95,18 @@ main(int argc, __unused char *argv[])
/*
* Now re-run in a jail.
+ * XXX-BZ should switch to jail_set(2).
*/
+ ia4.s_addr = htonl(INADDR_LOOPBACK);
+
bzero(&thejail, sizeof(thejail));
- thejail.version = 0;
+ thejail.version = JAIL_API_VERSION;
thejail.path = "/";
thejail.hostname = "jail";
- thejail.ip_number = INADDR_LOOPBACK;
+ thejail.jailname = "udpconnectjail";
+ thejail.ip4s = 1;
+ thejail.ip4 = &ia4;
+
if (jail(&thejail) < 0)
errx(-1, "jail: %s", strerror(errno));
test("in jail", &sin);
diff --git a/tools/regression/usr.bin/printf/regress.l1.out b/tools/regression/usr.bin/printf/regress.l1.out
new file mode 100644
index 0000000..9be0dc9
--- /dev/null
+++ b/tools/regression/usr.bin/printf/regress.l1.out
@@ -0,0 +1 @@
+228
diff --git a/tools/regression/usr.bin/printf/regress.l2.out b/tools/regression/usr.bin/printf/regress.l2.out
new file mode 100644
index 0000000..9be0dc9
--- /dev/null
+++ b/tools/regression/usr.bin/printf/regress.l2.out
@@ -0,0 +1 @@
+228
diff --git a/tools/regression/usr.bin/printf/regress.sh b/tools/regression/usr.bin/printf/regress.sh
index 980fc70..4ce282f 100644
--- a/tools/regression/usr.bin/printf/regress.sh
+++ b/tools/regression/usr.bin/printf/regress.sh
@@ -2,11 +2,13 @@
REGRESSION_START($1)
-echo '1..9'
+echo '1..11'
REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"')
REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123')
REGRESSION_TEST(`f', `printf "%f,%-8.3f,%f,%f\n" +42.25 -42.25 inf nan')
+REGRESSION_TEST(`l1', `LC_ALL=en_US.ISO8859-1 printf "%d\n" $(printf \"\\344)')
+REGRESSION_TEST(`l2', `LC_ALL=en_US.UTF-8 printf "%d\n" $(printf \"\\303\\244)')
REGRESSION_TEST(`m1', `printf "%c%%%d\0\045\n" abc \"abc')
REGRESSION_TEST(`m2', `printf "abc\n\cdef"')
REGRESSION_TEST(`m3', `printf "%%%s\n" abc def ghi jkl')
diff --git a/tools/tools/README b/tools/tools/README
index ecae5de..42ea75c 100644
--- a/tools/tools/README
+++ b/tools/tools/README
@@ -16,6 +16,7 @@ cfi Common Flash Interface (CFI) tool
commitsdb A tool for reconstructing commit history using md5
checksums of the commit logs.
crypto Test and exercise tools related to the crypto framework
+cxgbetool A tool for the cxgbe(4) driver.
diffburst OBSOLETE: equivalent functionality is available via split -p.
For example: "split -p ^diff < patchfile". See split(1).
editing Editor modes and the like to help editing FreeBSD code.
diff --git a/tools/tools/ath/ath_ee_9287_print/9287.c b/tools/tools/ath/ath_ee_9287_print/9287.c
new file mode 100644
index 0000000..3ed970c
--- /dev/null
+++ b/tools/tools/ath/ath_ee_9287_print/9287.c
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <err.h>
+
+typedef enum {
+ AH_FALSE = 0, /* NB: lots of code assumes false is zero */
+ AH_TRUE = 1,
+} HAL_BOOL;
+
+typedef enum {
+ HAL_OK = 0, /* No error */
+} HAL_STATUS;
+
+struct ath_hal;
+
+#include "ah_eeprom_v14.h"
+#include "ah_eeprom_9287.h"
+
+void
+eeprom_9287_base_print(uint16_t *buf)
+{
+ HAL_EEPROM_9287 *eep = (HAL_EEPROM_9287 *) buf;
+ BASE_EEP_9287_HEADER *eh = &eep->ee_base.baseEepHeader;
+ int i;
+
+ printf("| Version: 0x%.4x | Length: 0x%.4x | Checksum: 0x%.4x ",
+ eh->version, eh->length, eh->checksum);
+ printf("| CapFlags: 0x%.2x | eepMisc: 0x%.2x | RegDomain: 0x%.4x 0x%.4x | \n",
+ eh->opCapFlags, eh->eepMisc, eh->regDmn[0], eh->regDmn[1]);
+ printf("| MAC: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x ",
+ eh->macAddr[0], eh->macAddr[1], eh->macAddr[2],
+ eh->macAddr[3], eh->macAddr[4], eh->macAddr[5]);
+ printf("| RxMask: 0x%.2x | TxMask: 0x%.2x | RfSilent: 0x%.4x | btOptions: 0x%.4x |\n",
+ eh->rxMask, eh->txMask, eh->rfSilent, eh->blueToothOptions);
+ printf("| DeviceCap: 0x%.4x | binBuildNumber: %.8x | deviceType: 0x%.2x | openLoopPwrCntl 0x%.2x |\n",
+ eh->deviceCap, eh->binBuildNumber, eh->deviceType, eh->openLoopPwrCntl);
+ printf("| pwrTableOffset: %d | tempSensSlope: %d | tempSensSlopePalOn: %d |\n",
+ eh->pwrTableOffset, eh->tempSensSlope, eh->tempSensSlopePalOn);
+
+ printf("Future:\n");
+ for (i = 0; i < sizeof(eh->futureBase) / sizeof(uint16_t); i++) {
+ printf("0x%.2x ", eh->futureBase[i]);
+ }
+ printf("\n");
+}
+
+void
+eeprom_9287_custdata_print(uint16_t *buf)
+{
+ HAL_EEPROM_9287 *eep = (HAL_EEPROM_9287 *) buf;
+ uint8_t *custdata = (uint8_t *) &eep->ee_base.custData;
+ int i;
+
+ printf("\n| Custdata: |\n");
+ for (i = 0; i < 20; i++) {
+ printf("%s0x%.2x %s",
+ i % 16 == 0 ? "| " : "",
+ custdata[i],
+ i % 16 == 15 ? "|\n" : "");
+ }
+ printf("\n");
+}
+
+void
+eeprom_9287_modal_print(uint16_t *buf)
+{
+ HAL_EEPROM_9287 *eep = (HAL_EEPROM_9287 *) buf;
+ MODAL_EEP_9287_HEADER *mh = &eep->ee_base.modalHeader;
+ int i;
+
+ printf("| antCtrlCommon: 0x%.8x |\n", mh->antCtrlCommon);
+ printf("| switchSettling: 0x%.2x |\n", mh->switchSettling);
+ printf("| adcDesiredSize: %d |\n", mh->adcDesiredSize);
+
+ for (i = 0; i < AR9287_MAX_CHAINS; i++) {
+ printf("| Chain %d:\n", i);
+ printf("| antCtrlChain: 0:0x%.4x |\n", mh->antCtrlChain[i]);
+ printf("| antennaGainCh: 0:0x%.2x |\n", mh->antennaGainCh[i]);
+ printf("| txRxAttenCh: 0:0x%.2x |\n", mh->txRxAttenCh[i]);
+ printf("| rxTxMarginCh: 0:0x%.2x |\n", mh->rxTxMarginCh[i]);
+ printf("| noiseFloorThresCh: 0:0x%.2x |\n", mh->noiseFloorThreshCh[i]);
+ printf("| iqCalICh: 0:0x%.2x |\n", mh->iqCalICh[i]);
+ printf("| iqCalQCh: 0:0x%.2x |\n", mh->iqCalQCh[i]);
+ printf("| bswAtten: 0:0x%.2x |\n", mh->bswAtten[i]);
+ printf("| bswMargin: 0:0x%.2x |\n", mh->bswMargin[i]);
+ printf("\n");
+ }
+
+ printf("| txEndToXpaOff: 0x%.2x | txEndToRxOn: 0x%.2x | txFrameToXpaOn: 0x%.2x |\n",
+ mh->txEndToXpaOff, mh->txEndToRxOn, mh->txFrameToXpaOn);
+ printf("| thres62: 0x%.2x\n", mh->thresh62);
+ printf("| xpdGain: 0x%.2x | xpd: 0x%.2x |\n", mh->xpdGain, mh->xpd);
+
+ printf("| pdGainOverlap: 0x%.2x xpaBiasLvl: 0x%.2x |\n", mh->pdGainOverlap, mh->xpaBiasLvl);
+ printf("| txFrameToDataStart: 0x%.2x | txFrameToPaOn: 0x%.2x |\n", mh->txFrameToDataStart, mh->txFrameToPaOn);
+ printf("| ht40PowerIncForPdadc: 0x%.2x |\n", mh->ht40PowerIncForPdadc);
+ printf("| swSettleHt40: 0x%.2x |\n", mh->swSettleHt40);
+
+ printf("| Modal Version: %.2x |\n", mh->version);
+ printf("| db1 = %d | db2 = %d |\n", mh->db1, mh->db2);
+ printf("| ob_cck = %d | ob_psk = %d | ob_qam = %d | ob_pal_off = %d |\n",
+ mh->ob_cck, mh->ob_psk, mh->ob_qam, mh->ob_pal_off);
+
+ printf("| futureModal: ");
+ for (i = 0; i < sizeof(mh->futureModal) / sizeof(uint16_t); i++) {
+ printf("0x%.2x ", mh->futureModal[i]);
+ }
+ printf("\n");
+
+ /* and now, spur channels */
+ for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) {
+ printf("| Spur %d: spurChan: 0x%.4x spurRangeLow: 0x%.2x spurRangeHigh: 0x%.2x |\n",
+ i, mh->spurChans[i].spurChan,
+ (int) mh->spurChans[i].spurRangeLow,
+ (int) mh->spurChans[i].spurRangeHigh);
+ }
+}
+
+static void
+eeprom_9287_print_caldata_oploop(struct cal_data_op_loop_ar9287 *f)
+{
+ int i, j;
+
+ /* XXX flesh out the rest */
+ for (i = 0; i < 2; i++) {
+ printf(" pwrPdg:");
+ for (j = 0; j < 5; j++) {
+ printf("[%d][%d]=%d, ", i, j, f->pwrPdg[i][j]);
+ }
+ printf("\n");
+
+ printf(" vpdPdg:");
+ for (j = 0; j < 5; j++) {
+ printf("[%d][%d]=%d, ", i, j, f->vpdPdg[i][j]);
+ }
+ printf("\n");
+
+ printf(" pcdac:");
+ for (j = 0; j < 5; j++) {
+ printf("[%d][%d]=%d, ", i, j, f->pcdac[i][j]);
+ }
+ printf("\n");
+
+ printf(" empty:");
+ for (j = 0; j < 5; j++) {
+ printf("[%d][%d]=%d, ", i, j, f->empty[i][j]);
+ }
+ printf("\n\n");
+ }
+}
+
+void
+eeprom_9287_calfreqpiers_print(uint16_t *buf)
+{
+ HAL_EEPROM_9287 *eep = (HAL_EEPROM_9287 *) buf;
+ int i, n;
+
+ /* 2ghz cal piers */
+ printf("calFreqPier2G: ");
+ for (i = 0; i < AR9287_NUM_2G_CAL_PIERS; i++) {
+ printf(" 0x%.2x ", eep->ee_base.calFreqPier2G[i]);
+ }
+ printf("|\n");
+
+ for (i = 0; i < AR9287_NUM_2G_CAL_PIERS; i++) {
+ if (eep->ee_base.calFreqPier2G[i] == 0xff)
+ continue;
+ printf("2Ghz Cal Pier %d\n", i);
+ for (n = 0; n < AR9287_MAX_CHAINS; n++) {
+ printf(" Chain %d:\n", n);
+ eeprom_9287_print_caldata_oploop((void *)&eep->ee_base.calPierData2G[n][i]);
+ }
+ }
+
+ printf("\n");
+}
+
+/* XXX these should just reference the v14 print routines */
+static void
+eeprom_v14_target_legacy_print(CAL_TARGET_POWER_LEG *l)
+{
+ int i;
+ if (l->bChannel == 0xff)
+ return;
+ printf(" bChannel: %d;", l->bChannel);
+ for (i = 0; i < 4; i++) {
+ printf(" %.2f", (float) l->tPow2x[i] / 2.0);
+ }
+ printf(" (dBm)\n");
+}
+
+static void
+eeprom_v14_target_ht_print(CAL_TARGET_POWER_HT *l)
+{
+ int i;
+ if (l->bChannel == 0xff)
+ return;
+ printf(" bChannel: %d;", l->bChannel);
+ for (i = 0; i < 8; i++) {
+ printf(" %.2f", (float) l->tPow2x[i] / 2.0);
+ }
+ printf(" (dBm)\n");
+}
+
+void
+eeprom_9287_print_targets(uint16_t *buf)
+{
+ HAL_EEPROM_9287 *eep = (HAL_EEPROM_9287 *) buf;
+ int i;
+
+ /* 2ghz rates */
+ printf("2Ghz CCK:\n");
+ for (i = 0; i < AR9287_NUM_2G_CCK_TARGET_POWERS; i++) {
+ eeprom_v14_target_legacy_print(&eep->ee_base.calTargetPowerCck[i]);
+ }
+ printf("2Ghz 11g:\n");
+ for (i = 0; i < AR9287_NUM_2G_20_TARGET_POWERS; i++) {
+ eeprom_v14_target_legacy_print(&eep->ee_base.calTargetPower2G[i]);
+ }
+ printf("2Ghz HT20:\n");
+ for (i = 0; i < AR9287_NUM_2G_20_TARGET_POWERS; i++) {
+ eeprom_v14_target_ht_print(&eep->ee_base.calTargetPower2GHT20[i]);
+ }
+ printf("2Ghz HT40:\n");
+ for (i = 0; i < AR9287_NUM_2G_40_TARGET_POWERS; i++) {
+ eeprom_v14_target_ht_print(&eep->ee_base.calTargetPower2GHT40[i]);
+ }
+
+}
+
+static void
+eeprom_9287_ctl_edge_print(struct cal_ctl_data_ar9287 *ctl)
+{
+ int i, j;
+ uint8_t pow, flag;
+
+ for (i = 0; i < AR9287_MAX_CHAINS; i++) {
+ printf(" chain %d: ", i);
+ for (j = 0; j < AR9287_NUM_BAND_EDGES; j++) {
+ pow = ctl->ctlEdges[i][j].tPowerFlag & 0x3f;
+ flag = (ctl->ctlEdges[i][j].tPowerFlag & 0xc0) >> 6;
+ printf(" %d:pow=%d,flag=%.2x", j, pow, flag);
+ }
+ printf("\n");
+ }
+}
+
+void
+eeprom_9287_ctl_print(uint16_t *buf)
+{
+ HAL_EEPROM_9287 *eep = (HAL_EEPROM_9287 *) buf;
+ int i;
+
+ for (i = 0; i < AR9287_NUM_CTLS; i++) {
+ if (eep->ee_base.ctlIndex[i] == 0)
+ continue;
+ printf("| ctlIndex: offset %d, value %d\n", i, eep->ee_base.ctlIndex[i]);
+ eeprom_9287_ctl_edge_print(&eep->ee_base.ctlData[i]);
+ }
+}
+
+void
+eeprom_9287_print_edges(uint16_t *buf)
+{
+ HAL_EEPROM_9287 *eep = (HAL_EEPROM_9287 *) buf;
+ int i;
+
+ printf("| eeNumCtls: %d\n", eep->ee_numCtls);
+ for (i = 0; i < NUM_EDGES*eep->ee_numCtls; i++) {
+ /* XXX is flag 8 or 32 bits? */
+ printf("| edge %2d/%2d: rdEdge: %5d EdgePower: %.2f dBm Flag: 0x%.8x\n",
+ i / NUM_EDGES, i % NUM_EDGES,
+ eep->ee_rdEdgesPower[i].rdEdge,
+ (float) eep->ee_rdEdgesPower[i].twice_rdEdgePower / 2.0,
+ eep->ee_rdEdgesPower[i].flag);
+
+ if (i % NUM_EDGES == (NUM_EDGES -1))
+ printf("|\n");
+ }
+}
+
+void
+eeprom_9287_print_other(uint16_t *buf)
+{
+ HAL_EEPROM_9287 *eep = (HAL_EEPROM_9287 *) buf;
+}
diff --git a/tools/tools/ath/ath_ee_9287_print/9287.h b/tools/tools/ath/ath_ee_9287_print/9287.h
new file mode 100644
index 0000000..4cfc424
--- /dev/null
+++ b/tools/tools/ath/ath_ee_9287_print/9287.h
@@ -0,0 +1,15 @@
+/* $FreeBSD$ */
+
+#ifndef __9287_H__
+#define __9287_H__
+
+extern void eeprom_9287_base_print(uint16_t *buf);
+extern void eeprom_9287_custdata_print(uint16_t *buf);
+extern void eeprom_9287_modal_print(uint16_t *buf);
+extern void eeprom_9287_calfreqpiers_print(uint16_t *buf);
+extern void eeprom_9287_ctl_print(uint16_t *buf);
+extern void eeprom_9287_print_targets(uint16_t *buf);
+extern void eeprom_9287_print_edges(uint16_t *buf);
+extern void eeprom_9287_print_other(uint16_t *buf);
+
+#endif
diff --git a/tools/tools/ath/ath_ee_9287_print/Makefile b/tools/tools/ath/ath_ee_9287_print/Makefile
new file mode 100644
index 0000000..b25172b
--- /dev/null
+++ b/tools/tools/ath/ath_ee_9287_print/Makefile
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal
+
+PROG= ath_ee_9287_print
+SRCS= main.c eeprom.c 9287.c
+NOMAN= yes
+NO_MAN= yes
+
+.include <../Makefile.inc>
+
+.include <bsd.prog.mk>
diff --git a/tools/tools/ath/ath_ee_9287_print/eeprom.c b/tools/tools/ath/ath_ee_9287_print/eeprom.c
new file mode 100644
index 0000000..9e5c865
--- /dev/null
+++ b/tools/tools/ath/ath_ee_9287_print/eeprom.c
@@ -0,0 +1,72 @@
+
+/*
+ * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <err.h>
+
+#include "eeprom.h"
+
+void
+load_eeprom_dump(const char *file, uint16_t *buf)
+{
+ unsigned int r[8];
+ FILE *fp;
+ char b[1024];
+ int i;
+
+ fp = fopen(file, "r");
+ if (!fp)
+ err(1, "fopen");
+
+ while (!feof(fp)) {
+ if (fgets(b, 1024, fp) == NULL)
+ break;
+ if (feof(fp))
+ break;
+ if (strlen(b) > 0)
+ b[strlen(b)-1] = '\0';
+ if (strlen(b) == 0)
+ break;
+ sscanf(b, "%x: %x %x %x %x %x %x %x %x\n",
+ &i, &r[0], &r[1], &r[2], &r[3], &r[4],
+ &r[5], &r[6], &r[7]);
+ buf[i++] = r[0];
+ buf[i++] = r[1];
+ buf[i++] = r[2];
+ buf[i++] = r[3];
+ buf[i++] = r[4];
+ buf[i++] = r[5];
+ buf[i++] = r[6];
+ buf[i++] = r[7];
+ }
+ fclose(fp);
+}
diff --git a/tools/tools/ath/ath_ee_9287_print/eeprom.h b/tools/tools/ath/ath_ee_9287_print/eeprom.h
new file mode 100644
index 0000000..a5fc76a
--- /dev/null
+++ b/tools/tools/ath/ath_ee_9287_print/eeprom.h
@@ -0,0 +1,8 @@
+/* $FreeBSD$ */
+
+#ifndef __EEPROM_H__
+#define __EEPROM_H__
+
+extern void load_eeprom_dump(const char *file, uint16_t *buf);
+
+#endif
diff --git a/tools/tools/ath/ath_ee_9287_print/main.c b/tools/tools/ath/ath_ee_9287_print/main.c
new file mode 100644
index 0000000..128b01f
--- /dev/null
+++ b/tools/tools/ath/ath_ee_9287_print/main.c
@@ -0,0 +1,85 @@
+
+/*
+ * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <err.h>
+
+#include "eeprom.h"
+#include "9287.h"
+
+void
+usage(char *argv[])
+{
+ printf("Usage: %s <eeprom dump file>\n", argv[0]);
+ printf("\n");
+ printf(" The eeprom dump file is a text hexdump of an EEPROM.\n");
+ printf(" The lines must be formatted as follows:\n");
+ printf(" 0xAAAA: 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD\n");
+ printf(" where each line must have exactly eight data bytes.\n");
+ exit(127);
+}
+
+int
+main(int argc, char *argv[])
+{
+ uint16_t *eep = NULL;
+ eep = calloc(4096, sizeof(int16_t));
+
+ if (argc < 2)
+ usage(argv);
+
+ load_eeprom_dump(argv[1], eep);
+
+ eeprom_9287_base_print(eep);
+ eeprom_9287_custdata_print(eep);
+ printf("\n2.4ghz:\n");
+ eeprom_9287_modal_print(eep);
+ printf("\n");
+
+ eeprom_9287_calfreqpiers_print(eep);
+ printf("\n");
+
+ eeprom_9287_print_targets(eep);
+ printf("\n");
+
+ eeprom_9287_ctl_print(eep);
+ printf("\n");
+
+ eeprom_9287_print_edges(eep);
+ printf("\n");
+
+ eeprom_9287_print_other(eep);
+ printf("\n");
+
+ free(eep);
+ exit(0);
+}
diff --git a/tools/tools/cxgbetool/Makefile b/tools/tools/cxgbetool/Makefile
new file mode 100644
index 0000000..dc2beda
--- /dev/null
+++ b/tools/tools/cxgbetool/Makefile
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+PROG= cxgbetool
+SRCS= cxgbetool.c
+NO_MAN=
+CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgbe -I.
+BINDIR?= /usr/sbin
+
+.include <bsd.prog.mk>
diff --git a/tools/tools/cxgbetool/cxgbetool.c b/tools/tools/cxgbetool/cxgbetool.c
new file mode 100644
index 0000000..da6bfba
--- /dev/null
+++ b/tools/tools/cxgbetool/cxgbetool.c
@@ -0,0 +1,1453 @@
+/*-
+ * Copyright (c) 2011 Chelsio Communications, Inc.
+ * All rights reserved.
+ * Written by: Navdeep Parhar <np@FreeBSD.org>
+ *
+ * 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 AUTHOR 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 AUTHOR 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <err.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/ethernet.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "t4_ioctl.h"
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+#define max(x, y) ((x) > (y) ? (x) : (y))
+
+static const char *progname, *nexus;
+
+struct reg_info {
+ const char *name;
+ uint32_t addr;
+ uint32_t len;
+};
+
+struct mod_regs {
+ const char *name;
+ const struct reg_info *ri;
+};
+
+struct field_desc {
+ const char *name; /* Field name */
+ unsigned short start; /* Start bit position */
+ unsigned short end; /* End bit position */
+ unsigned char shift; /* # of low order bits omitted and implicitly 0 */
+ unsigned char hex; /* Print field in hex instead of decimal */
+ unsigned char islog2; /* Field contains the base-2 log of the value */
+};
+
+#include "reg_defs_t4.c"
+#include "reg_defs_t4vf.c"
+
+static void
+usage(FILE *fp)
+{
+ fprintf(fp, "Usage: %s <nexus> [operation]\n", progname);
+ fprintf(fp,
+ "\tcontext <type> <id> show an SGE context\n"
+ "\tfilter <idx> [<param> <val>] ... set a filter\n"
+ "\tfilter <idx> delete|clear delete a filter\n"
+ "\tfilter list list all filters\n"
+ "\tfilter mode [<match>] ... get/set global filter mode\n"
+ "\treg <address>[=<val>] read/write register\n"
+ "\treg64 <address>[=<val>] read/write 64 bit register\n"
+ "\tregdump [<module>] ... dump registers\n"
+ "\tstdio interactive mode\n"
+ );
+}
+
+static inline unsigned int
+get_card_vers(unsigned int version)
+{
+ return (version & 0x3ff);
+}
+
+static int
+real_doit(unsigned long cmd, void *data, const char *cmdstr)
+{
+ static int fd = -1;
+ int rc = 0;
+
+ if (fd == -1) {
+ char buf[64];
+
+ snprintf(buf, sizeof(buf), "/dev/%s", nexus);
+ if ((fd = open(buf, O_RDWR)) < 0) {
+ warn("open(%s)", nexus);
+ rc = errno;
+ return (rc);
+ }
+ }
+
+ rc = ioctl(fd, cmd, data);
+ if (rc < 0) {
+ warn("%s", cmdstr);
+ rc = errno;
+ }
+
+ return (rc);
+}
+#define doit(x, y) real_doit(x, y, #x)
+
+static char *
+str_to_number(const char *s, long *val, long long *vall)
+{
+ char *p;
+
+ if (vall)
+ *vall = strtoll(s, &p, 0);
+ else if (val)
+ *val = strtol(s, &p, 0);
+ else
+ p = NULL;
+
+ return (p);
+}
+
+static int
+read_reg(long addr, int size, long long *val)
+{
+ struct t4_reg reg;
+ int rc;
+
+ reg.addr = (uint32_t) addr;
+ reg.size = (uint32_t) size;
+ reg.val = 0;
+
+ rc = doit(CHELSIO_T4_GETREG, &reg);
+
+ *val = reg.val;
+
+ return (rc);
+}
+
+static int
+write_reg(long addr, int size, long long val)
+{
+ struct t4_reg reg;
+
+ reg.addr = (uint32_t) addr;
+ reg.size = (uint32_t) size;
+ reg.val = (uint64_t) val;
+
+ return doit(CHELSIO_T4_SETREG, &reg);
+}
+
+static int
+register_io(int argc, const char *argv[], int size)
+{
+ char *p, *v;
+ long addr;
+ long long val;
+ int w = 0, rc;
+
+ if (argc == 1) {
+ /* <reg> OR <reg>=<value> */
+
+ p = str_to_number(argv[0], &addr, NULL);
+ if (*p) {
+ if (*p != '=') {
+ warnx("invalid register \"%s\"", argv[0]);
+ return (EINVAL);
+ }
+
+ w = 1;
+ v = p + 1;
+ p = str_to_number(v, NULL, &val);
+
+ if (*p) {
+ warnx("invalid value \"%s\"", v);
+ return (EINVAL);
+ }
+ }
+
+ } else if (argc == 2) {
+ /* <reg> <value> */
+
+ w = 1;
+
+ p = str_to_number(argv[0], &addr, NULL);
+ if (*p) {
+ warnx("invalid register \"%s\"", argv[0]);
+ return (EINVAL);
+ }
+
+ p = str_to_number(argv[1], NULL, &val);
+ if (*p) {
+ warnx("invalid value \"%s\"", argv[1]);
+ return (EINVAL);
+ }
+ } else {
+ warnx("reg: invalid number of arguments (%d)", argc);
+ return (EINVAL);
+ }
+
+ if (w)
+ rc = write_reg(addr, size, val);
+ else {
+ rc = read_reg(addr, size, &val);
+ if (rc == 0)
+ printf("0x%llx [%llu]\n", val, val);
+ }
+
+ return (rc);
+}
+
+static inline uint32_t
+xtract(uint32_t val, int shift, int len)
+{
+ return (val >> shift) & ((1 << len) - 1);
+}
+
+static int
+dump_block_regs(const struct reg_info *reg_array, const uint32_t *regs)
+{
+ uint32_t reg_val = 0;
+
+ for ( ; reg_array->name; ++reg_array)
+ if (!reg_array->len) {
+ reg_val = regs[reg_array->addr / 4];
+ printf("[%#7x] %-47s %#-10x %u\n", reg_array->addr,
+ reg_array->name, reg_val, reg_val);
+ } else {
+ uint32_t v = xtract(reg_val, reg_array->addr,
+ reg_array->len);
+
+ printf(" %*u:%u %-47s %#-10x %u\n",
+ reg_array->addr < 10 ? 3 : 2,
+ reg_array->addr + reg_array->len - 1,
+ reg_array->addr, reg_array->name, v, v);
+ }
+
+ return (1);
+}
+
+static int
+dump_regs_table(int argc, const char *argv[], const uint32_t *regs,
+ const struct mod_regs *modtab, int nmodules)
+{
+ int i, j, match;
+
+ for (i = 0; i < argc; i++) {
+ for (j = 0; j < nmodules; j++) {
+ if (!strcmp(argv[i], modtab[j].name))
+ break;
+ }
+
+ if (j == nmodules) {
+ warnx("invalid register block \"%s\"", argv[i]);
+ fprintf(stderr, "\nAvailable blocks:");
+ for ( ; nmodules; nmodules--, modtab++)
+ fprintf(stderr, " %s", modtab->name);
+ fprintf(stderr, "\n");
+ return (EINVAL);
+ }
+ }
+
+ for ( ; nmodules; nmodules--, modtab++) {
+
+ match = argc == 0 ? 1 : 0;
+ for (i = 0; !match && i < argc; i++) {
+ if (!strcmp(argv[i], modtab->name))
+ match = 1;
+ }
+
+ if (match)
+ dump_block_regs(modtab->ri, regs);
+ }
+
+ return (0);
+}
+
+#define T4_MODREGS(name) { #name, t4_##name##_regs }
+static int
+dump_regs_t4(int argc, const char *argv[], const uint32_t *regs)
+{
+ static struct mod_regs t4_mod[] = {
+ T4_MODREGS(sge),
+ { "pci", t4_pcie_regs },
+ T4_MODREGS(dbg),
+ T4_MODREGS(mc),
+ T4_MODREGS(ma),
+ { "edc0", t4_edc_0_regs },
+ { "edc1", t4_edc_1_regs },
+ T4_MODREGS(cim),
+ T4_MODREGS(tp),
+ T4_MODREGS(ulp_rx),
+ T4_MODREGS(ulp_tx),
+ { "pmrx", t4_pm_rx_regs },
+ { "pmtx", t4_pm_tx_regs },
+ T4_MODREGS(mps),
+ { "cplsw", t4_cpl_switch_regs },
+ T4_MODREGS(smb),
+ { "i2c", t4_i2cm_regs },
+ T4_MODREGS(mi),
+ T4_MODREGS(uart),
+ T4_MODREGS(pmu),
+ T4_MODREGS(sf),
+ T4_MODREGS(pl),
+ T4_MODREGS(le),
+ T4_MODREGS(ncsi),
+ T4_MODREGS(xgmac)
+ };
+
+ return dump_regs_table(argc, argv, regs, t4_mod, ARRAY_SIZE(t4_mod));
+}
+#undef T4_MODREGS
+
+static int
+dump_regs_t4vf(int argc, const char *argv[], const uint32_t *regs)
+{
+ static struct mod_regs t4vf_mod[] = {
+ { "sge", t4vf_sge_regs },
+ { "mps", t4vf_mps_regs },
+ { "pl", t4vf_pl_regs },
+ { "mbdata", t4vf_mbdata_regs },
+ { "cim", t4vf_cim_regs },
+ };
+
+ return dump_regs_table(argc, argv, regs, t4vf_mod,
+ ARRAY_SIZE(t4vf_mod));
+}
+
+static int
+dump_regs(int argc, const char *argv[])
+{
+ int vers, revision, is_pcie, rc;
+ struct t4_regdump regs;
+
+ regs.data = calloc(1, T4_REGDUMP_SIZE);
+ if (regs.data == NULL) {
+ warnc(ENOMEM, "regdump");
+ return (ENOMEM);
+ }
+
+ regs.len = T4_REGDUMP_SIZE;
+ rc = doit(CHELSIO_T4_REGDUMP, &regs);
+ if (rc != 0)
+ return (rc);
+
+ vers = get_card_vers(regs.version);
+ revision = (regs.version >> 10) & 0x3f;
+ is_pcie = (regs.version & 0x80000000) != 0;
+
+ if (vers == 4) {
+ if (revision == 0x3f)
+ rc = dump_regs_t4vf(argc, argv, regs.data);
+ else
+ rc = dump_regs_t4(argc, argv, regs.data);
+ } else {
+ warnx("%s (type %d, rev %d) is not a T4 card.",
+ nexus, vers, revision);
+ return (ENOTSUP);
+ }
+
+ free(regs.data);
+ return (rc);
+}
+
+static void
+do_show_info_header(uint32_t mode)
+{
+ uint32_t i;
+
+ printf ("%4s %8s", "Idx", "Hits");
+ for (i = T4_FILTER_FCoE; i <= T4_FILTER_IP_FRAGMENT; i <<= 1) {
+ switch (mode & i) {
+ case T4_FILTER_FCoE:
+ printf (" FCoE");
+ break;
+
+ case T4_FILTER_PORT:
+ printf (" Port");
+ break;
+
+ case T4_FILTER_OVLAN:
+ printf (" vld:oVLAN");
+ break;
+
+ case T4_FILTER_IVLAN:
+ printf (" vld:iVLAN");
+ break;
+
+ case T4_FILTER_IP_TOS:
+ printf (" TOS");
+ break;
+
+ case T4_FILTER_IP_PROTO:
+ printf (" Prot");
+ break;
+
+ case T4_FILTER_ETH_TYPE:
+ printf (" EthType");
+ break;
+
+ case T4_FILTER_MAC_IDX:
+ printf (" MACIdx");
+ break;
+
+ case T4_FILTER_MPS_HIT_TYPE:
+ printf (" MPS");
+ break;
+
+ case T4_FILTER_IP_FRAGMENT:
+ printf (" Frag");
+ break;
+
+ default:
+ /* compressed filter field not enabled */
+ break;
+ }
+ }
+ printf(" %20s %20s %9s %9s %s\n",
+ "DIP", "SIP", "DPORT", "SPORT", "Action");
+}
+
+/*
+ * Parse an argument sub-vector as a { <parameter name> <value>[:<mask>] }
+ * ordered tuple. If the parameter name in the argument sub-vector does not
+ * match the passed in parameter name, then a zero is returned for the
+ * function and no parsing is performed. If there is a match, then the value
+ * and optional mask are parsed and returned in the provided return value
+ * pointers. If no optional mask is specified, then a default mask of all 1s
+ * will be returned.
+ *
+ * An error in parsing the value[:mask] will result in an error message and
+ * program termination.
+ */
+static int
+parse_val_mask(const char *param, const char *args[], uint32_t *val,
+ uint32_t *mask)
+{
+ char *p;
+
+ if (strcmp(param, args[0]) != 0)
+ return (EINVAL);
+
+ *val = strtoul(args[1], &p, 0);
+ if (p > args[1]) {
+ if (p[0] == 0) {
+ *mask = ~0;
+ return (0);
+ }
+
+ if (p[0] == ':' && p[1] != 0) {
+ *mask = strtoul(p+1, &p, 0);
+ if (p[0] == 0)
+ return (0);
+ }
+ }
+
+ warnx("parameter \"%s\" has bad \"value[:mask]\" %s",
+ args[0], args[1]);
+
+ return (EINVAL);
+}
+
+/*
+ * Parse an argument sub-vector as a { <parameter name> <addr>[/<mask>] }
+ * ordered tuple. If the parameter name in the argument sub-vector does not
+ * match the passed in parameter name, then a zero is returned for the
+ * function and no parsing is performed. If there is a match, then the value
+ * and optional mask are parsed and returned in the provided return value
+ * pointers. If no optional mask is specified, then a default mask of all 1s
+ * will be returned.
+ *
+ * The value return parameter "afp" is used to specify the expected address
+ * family -- IPv4 or IPv6 -- of the address[/mask] and return its actual
+ * format. A passed in value of AF_UNSPEC indicates that either IPv4 or IPv6
+ * is acceptable; AF_INET means that only IPv4 addresses are acceptable; and
+ * AF_INET6 means that only IPv6 are acceptable. AF_INET is returned for IPv4
+ * and AF_INET6 for IPv6 addresses, respectively. IPv4 address/mask pairs are
+ * returned in the first four bytes of the address and mask return values with
+ * the address A.B.C.D returned with { A, B, C, D } returned in addresses { 0,
+ * 1, 2, 3}, respectively.
+ *
+ * An error in parsing the value[:mask] will result in an error message and
+ * program termination.
+ */
+static int
+parse_ipaddr(const char *param, const char *args[], int *afp, uint8_t addr[],
+ uint8_t mask[])
+{
+ const char *colon, *afn;
+ char *slash;
+ uint8_t *m;
+ int af, ret;
+ unsigned int masksize;
+
+ /*
+ * Is this our parameter?
+ */
+ if (strcmp(param, args[0]) != 0)
+ return (EINVAL);
+
+ /*
+ * Fundamental IPv4 versus IPv6 selection.
+ */
+ colon = strchr(args[1], ':');
+ if (!colon) {
+ afn = "IPv4";
+ af = AF_INET;
+ masksize = 32;
+ } else {
+ afn = "IPv6";
+ af = AF_INET6;
+ masksize = 128;
+ }
+ if (*afp == AF_UNSPEC)
+ *afp = af;
+ else if (*afp != af) {
+ warnx("address %s is not of expected family %s",
+ args[1], *afp == AF_INET ? "IP" : "IPv6");
+ return (EINVAL);
+ }
+
+ /*
+ * Parse address (temporarily stripping off any "/mask"
+ * specification).
+ */
+ slash = strchr(args[1], '/');
+ if (slash)
+ *slash = 0;
+ ret = inet_pton(af, args[1], addr);
+ if (slash)
+ *slash = '/';
+ if (ret <= 0) {
+ warnx("Cannot parse %s %s address %s", param, afn, args[1]);
+ return (EINVAL);
+ }
+
+ /*
+ * Parse optional mask specification.
+ */
+ if (slash) {
+ char *p;
+ unsigned int prefix = strtoul(slash + 1, &p, 10);
+
+ if (p == slash + 1) {
+ warnx("missing address prefix for %s", param);
+ return (EINVAL);
+ }
+ if (*p) {
+ warnx("%s is not a valid address prefix", slash + 1);
+ return (EINVAL);
+ }
+ if (prefix > masksize) {
+ warnx("prefix %u is too long for an %s address",
+ prefix, afn);
+ return (EINVAL);
+ }
+ memset(mask, 0, masksize / 8);
+ masksize = prefix;
+ }
+
+ /*
+ * Fill in mask.
+ */
+ for (m = mask; masksize >= 8; m++, masksize -= 8)
+ *m = ~0;
+ if (masksize)
+ *m = ~0 << (8 - masksize);
+
+ return (0);
+}
+
+/*
+ * Parse an argument sub-vector as a { <parameter name> <value> } ordered
+ * tuple. If the parameter name in the argument sub-vector does not match the
+ * passed in parameter name, then a zero is returned for the function and no
+ * parsing is performed. If there is a match, then the value is parsed and
+ * returned in the provided return value pointer.
+ */
+static int
+parse_val(const char *param, const char *args[], uint32_t *val)
+{
+ char *p;
+
+ if (strcmp(param, args[0]) != 0)
+ return (EINVAL);
+
+ *val = strtoul(args[1], &p, 0);
+ if (p > args[1] && p[0] == 0)
+ return (0);
+
+ warnx("parameter \"%s\" has bad \"value\" %s", args[0], args[1]);
+ return (EINVAL);
+}
+
+static void
+filters_show_ipaddr(int type, uint8_t *addr, uint8_t *addrm)
+{
+ int noctets, octet;
+
+ printf(" ");
+ if (type == 0) {
+ noctets = 4;
+ printf("%3s", " ");
+ } else
+ noctets = 16;
+
+ for (octet = 0; octet < noctets; octet++)
+ printf("%02x", addr[octet]);
+ printf("/");
+ for (octet = 0; octet < noctets; octet++)
+ printf("%02x", addrm[octet]);
+}
+
+static void
+do_show_one_filter_info(struct t4_filter *t, uint32_t mode)
+{
+ uint32_t i;
+
+ printf("%4d", t->idx);
+ if (t->hits == UINT64_MAX)
+ printf(" %8s", "-");
+ else
+ printf(" %8ju", t->hits);
+
+ /*
+ * Compressed header portion of filter.
+ */
+ for (i = T4_FILTER_FCoE; i <= T4_FILTER_IP_FRAGMENT; i <<= 1) {
+ switch (mode & i) {
+ case T4_FILTER_FCoE:
+ printf(" %1d/%1d", t->fs.val.fcoe, t->fs.mask.fcoe);
+ break;
+
+ case T4_FILTER_PORT:
+ printf(" %1d/%1d", t->fs.val.iport, t->fs.mask.iport);
+ break;
+
+ case T4_FILTER_OVLAN:
+ printf(" %1d:%1x:%02x/%1d:%1x:%02x",
+ t->fs.val.ovlan_vld, (t->fs.val.ovlan >> 7) & 0x7,
+ t->fs.val.ovlan & 0x7f, t->fs.mask.ovlan_vld,
+ (t->fs.mask.ovlan >> 7) & 0x7,
+ t->fs.mask.ovlan & 0x7f);
+ break;
+
+ case T4_FILTER_IVLAN:
+ printf(" %1d:%04x/%1d:%04x",
+ t->fs.val.ivlan_vld, t->fs.val.ivlan,
+ t->fs.mask.ivlan_vld, t->fs.mask.ivlan);
+ break;
+
+ case T4_FILTER_IP_TOS:
+ printf(" %02x/%02x", t->fs.val.tos, t->fs.mask.tos);
+ break;
+
+ case T4_FILTER_IP_PROTO:
+ printf(" %02x/%02x", t->fs.val.proto, t->fs.mask.proto);
+ break;
+
+ case T4_FILTER_ETH_TYPE:
+ printf(" %04x/%04x", t->fs.val.ethtype,
+ t->fs.mask.ethtype);
+ break;
+
+ case T4_FILTER_MAC_IDX:
+ printf(" %03x/%03x", t->fs.val.macidx,
+ t->fs.mask.macidx);
+ break;
+
+ case T4_FILTER_MPS_HIT_TYPE:
+ printf(" %1x/%1x", t->fs.val.matchtype,
+ t->fs.mask.matchtype);
+ break;
+
+ case T4_FILTER_IP_FRAGMENT:
+ printf(" %1d/%1d", t->fs.val.frag, t->fs.mask.frag);
+ break;
+
+ default:
+ /* compressed filter field not enabled */
+ break;
+ }
+ }
+
+ /*
+ * Fixed portion of filter.
+ */
+ filters_show_ipaddr(t->fs.type, t->fs.val.dip, t->fs.mask.dip);
+ filters_show_ipaddr(t->fs.type, t->fs.val.sip, t->fs.mask.sip);
+ printf(" %04x/%04x %04x/%04x",
+ t->fs.val.dport, t->fs.mask.dport,
+ t->fs.val.sport, t->fs.mask.sport);
+
+ /*
+ * Variable length filter action.
+ */
+ if (t->fs.action == FILTER_DROP)
+ printf(" Drop");
+ else if (t->fs.action == FILTER_SWITCH) {
+ printf(" Switch: port=%d", t->fs.eport);
+ if (t->fs.newdmac)
+ printf(
+ ", dmac=%02x:%02x:%02x:%02x:%02x:%02x "
+ ", l2tidx=%d",
+ t->fs.dmac[0], t->fs.dmac[1],
+ t->fs.dmac[2], t->fs.dmac[3],
+ t->fs.dmac[4], t->fs.dmac[5],
+ t->l2tidx);
+ if (t->fs.newsmac)
+ printf(
+ ", smac=%02x:%02x:%02x:%02x:%02x:%02x "
+ ", smtidx=%d",
+ t->fs.smac[0], t->fs.smac[1],
+ t->fs.smac[2], t->fs.smac[3],
+ t->fs.smac[4], t->fs.smac[5],
+ t->smtidx);
+ if (t->fs.newvlan == VLAN_REMOVE)
+ printf(", vlan=none");
+ else if (t->fs.newvlan == VLAN_INSERT)
+ printf(", vlan=insert(%x)", t->fs.vlan);
+ else if (t->fs.newvlan == VLAN_REWRITE)
+ printf(", vlan=rewrite(%x)", t->fs.vlan);
+ } else {
+ printf(" Pass: Q=");
+ if (t->fs.dirsteer == 0) {
+ printf("RSS");
+ if (t->fs.maskhash)
+ printf("(TCB=hash)");
+ } else {
+ printf("%d", t->fs.iq);
+ if (t->fs.dirsteerhash == 0)
+ printf("(QID)");
+ else
+ printf("(hash)");
+ }
+ }
+ if (t->fs.prio)
+ printf(" Prio");
+ if (t->fs.rpttid)
+ printf(" RptTID");
+ printf("\n");
+}
+
+static int
+show_filters(void)
+{
+ uint32_t mode = 0, header = 0;
+ struct t4_filter t;
+ int rc;
+
+ /* Get the global filter mode first */
+ rc = doit(CHELSIO_T4_GET_FILTER_MODE, &mode);
+ if (rc != 0)
+ return (rc);
+
+ t.idx = 0;
+ for (t.idx = 0; ; t.idx++) {
+ rc = doit(CHELSIO_T4_GET_FILTER, &t);
+ if (rc != 0 || t.idx == 0xffffffff)
+ break;
+
+ if (!header) {
+ do_show_info_header(mode);
+ header = 1;
+ }
+ do_show_one_filter_info(&t, mode);
+ };
+
+ return (rc);
+}
+
+static int
+get_filter_mode(void)
+{
+ uint32_t mode = 0;
+ int rc;
+
+ rc = doit(CHELSIO_T4_GET_FILTER_MODE, &mode);
+ if (rc != 0)
+ return (rc);
+
+ if (mode & T4_FILTER_IPv4)
+ printf("ipv4 ");
+
+ if (mode & T4_FILTER_IPv6)
+ printf("ipv6 ");
+
+ if (mode & T4_FILTER_IP_SADDR)
+ printf("sip ");
+
+ if (mode & T4_FILTER_IP_DADDR)
+ printf("dip ");
+
+ if (mode & T4_FILTER_IP_SPORT)
+ printf("sport ");
+
+ if (mode & T4_FILTER_IP_DPORT)
+ printf("dport ");
+
+ if (mode & T4_FILTER_MPS_HIT_TYPE)
+ printf("matchtype ");
+
+ if (mode & T4_FILTER_MAC_IDX)
+ printf("macidx ");
+
+ if (mode & T4_FILTER_ETH_TYPE)
+ printf("ethtype ");
+
+ if (mode & T4_FILTER_IP_PROTO)
+ printf("proto ");
+
+ if (mode & T4_FILTER_IP_TOS)
+ printf("tos ");
+
+ if (mode & T4_FILTER_IVLAN)
+ printf("ivlan ");
+
+ if (mode & T4_FILTER_OVLAN)
+ printf("ovlan ");
+
+ if (mode & T4_FILTER_PORT)
+ printf("iport ");
+
+ if (mode & T4_FILTER_FCoE)
+ printf("fcoe ");
+
+ printf("\n");
+
+ return (0);
+}
+
+static int
+set_filter_mode(int argc, const char *argv[])
+{
+ uint32_t mode = 0;
+
+ for (; argc; argc--, argv++) {
+ if (!strcmp(argv[0], "matchtype"))
+ mode |= T4_FILTER_MPS_HIT_TYPE;
+
+ if (!strcmp(argv[0], "macidx"))
+ mode |= T4_FILTER_MAC_IDX;
+
+ if (!strcmp(argv[0], "ethtype"))
+ mode |= T4_FILTER_ETH_TYPE;
+
+ if (!strcmp(argv[0], "proto"))
+ mode |= T4_FILTER_IP_PROTO;
+
+ if (!strcmp(argv[0], "tos"))
+ mode |= T4_FILTER_IP_TOS;
+
+ if (!strcmp(argv[0], "ivlan"))
+ mode |= T4_FILTER_IVLAN;
+
+ if (!strcmp(argv[0], "ovlan"))
+ mode |= T4_FILTER_OVLAN;
+
+ if (!strcmp(argv[0], "iport"))
+ mode |= T4_FILTER_PORT;
+
+ if (!strcmp(argv[0], "fcoe"))
+ mode |= T4_FILTER_FCoE;
+ }
+
+ return doit(CHELSIO_T4_SET_FILTER_MODE, &mode);
+}
+
+static int
+del_filter(uint32_t idx)
+{
+ struct t4_filter t;
+
+ t.idx = idx;
+
+ return doit(CHELSIO_T4_DEL_FILTER, &t);
+}
+
+static int
+set_filter(uint32_t idx, int argc, const char *argv[])
+{
+ int af = AF_UNSPEC, start_arg = 0;
+ struct t4_filter t;
+
+ if (argc < 2) {
+ warnc(EINVAL, "%s", __func__);
+ return (EINVAL);
+ };
+ bzero(&t, sizeof (t));
+ t.idx = idx;
+
+ for (start_arg = 0; start_arg + 2 <= argc; start_arg += 2) {
+ const char **args = &argv[start_arg];
+ uint32_t val, mask;
+
+ if (!strcmp(argv[start_arg], "type")) {
+ int newaf;
+ if (!strcasecmp(argv[start_arg + 1], "ipv4"))
+ newaf = AF_INET;
+ else if (!strcasecmp(argv[start_arg + 1], "ipv6"))
+ newaf = AF_INET6;
+ else {
+ warnx("invalid type \"%s\"; "
+ "must be one of \"ipv4\" or \"ipv6\"",
+ argv[start_arg + 1]);
+ return (EINVAL);
+ }
+
+ if (af != AF_UNSPEC && af != newaf) {
+ warnx("conflicting IPv4/IPv6 specifications.");
+ return (EINVAL);
+ }
+ af = newaf;
+ } else if (!parse_val_mask("fcoe", args, &val, &mask)) {
+ t.fs.val.fcoe = val;
+ t.fs.mask.fcoe = mask;
+ } else if (!parse_val_mask("iport", args, &val, &mask)) {
+ t.fs.val.iport = val;
+ t.fs.mask.iport = mask;
+ } else if (!parse_val_mask("ovlan", args, &val, &mask)) {
+ t.fs.val.ovlan = val;
+ t.fs.mask.ovlan = mask;
+ t.fs.val.ovlan_vld = 1;
+ t.fs.mask.ovlan_vld = 1;
+ } else if (!parse_val_mask("ivlan", args, &val, &mask)) {
+ t.fs.val.ivlan = val;
+ t.fs.mask.ivlan = mask;
+ t.fs.val.ivlan_vld = 1;
+ t.fs.mask.ivlan_vld = 1;
+ } else if (!parse_val_mask("tos", args, &val, &mask)) {
+ t.fs.val.tos = val;
+ t.fs.mask.tos = mask;
+ } else if (!parse_val_mask("proto", args, &val, &mask)) {
+ t.fs.val.proto = val;
+ t.fs.mask.proto = mask;
+ } else if (!parse_val_mask("ethtype", args, &val, &mask)) {
+ t.fs.val.ethtype = val;
+ t.fs.mask.ethtype = mask;
+ } else if (!parse_val_mask("macidx", args, &val, &mask)) {
+ t.fs.val.macidx = val;
+ t.fs.mask.macidx = mask;
+ } else if (!parse_val_mask("matchtype", args, &val, &mask)) {
+ t.fs.val.matchtype = val;
+ t.fs.mask.matchtype = mask;
+ } else if (!parse_val_mask("frag", args, &val, &mask)) {
+ t.fs.val.frag = val;
+ t.fs.mask.frag = mask;
+ } else if (!parse_val_mask("dport", args, &val, &mask)) {
+ t.fs.val.dport = val;
+ t.fs.mask.dport = mask;
+ } else if (!parse_val_mask("sport", args, &val, &mask)) {
+ t.fs.val.sport = val;
+ t.fs.mask.sport = mask;
+ } else if (!parse_ipaddr("dip", args, &af, t.fs.val.dip,
+ t.fs.mask.dip)) {
+ /* nada */;
+ } else if (!parse_ipaddr("sip", args, &af, t.fs.val.sip,
+ t.fs.mask.sip)) {
+ /* nada */;
+ } else if (!strcmp(argv[start_arg], "action")) {
+ if (!strcmp(argv[start_arg + 1], "pass"))
+ t.fs.action = FILTER_PASS;
+ else if (!strcmp(argv[start_arg + 1], "drop"))
+ t.fs.action = FILTER_DROP;
+ else if (!strcmp(argv[start_arg + 1], "switch"))
+ t.fs.action = FILTER_SWITCH;
+ else {
+ warnx("invalid action \"%s\"; must be one of"
+ " \"pass\", \"drop\" or \"switch\"",
+ argv[start_arg + 1]);
+ return (EINVAL);
+ }
+ } else if (!parse_val("hitcnts", args, &val)) {
+ t.fs.hitcnts = val;
+ } else if (!parse_val("prio", args, &val)) {
+ t.fs.prio = val;
+ } else if (!parse_val("rpttid", args, &val)) {
+ t.fs.rpttid = 1;
+ } else if (!parse_val("queue", args, &val)) {
+ t.fs.dirsteer = 1;
+ t.fs.iq = val;
+ } else if (!parse_val("tcbhash", args, &val)) {
+ t.fs.maskhash = 1;
+ t.fs.dirsteerhash = 1;
+ } else if (!parse_val("eport", args, &val)) {
+ t.fs.eport = val;
+ } else if (!strcmp(argv[start_arg], "dmac")) {
+ struct ether_addr *daddr;
+
+ daddr = ether_aton(argv[start_arg + 1]);
+ if (daddr == NULL) {
+ warnx("invalid dmac address \"%s\"",
+ argv[start_arg + 1]);
+ return (EINVAL);
+ }
+ memcpy(t.fs.dmac, daddr, ETHER_ADDR_LEN);
+ t.fs.newdmac = 1;
+ } else if (!strcmp(argv[start_arg], "smac")) {
+ struct ether_addr *saddr;
+
+ saddr = ether_aton(argv[start_arg + 1]);
+ if (saddr == NULL) {
+ warnx("invalid smac address \"%s\"",
+ argv[start_arg + 1]);
+ return (EINVAL);
+ }
+ memcpy(t.fs.smac, saddr, ETHER_ADDR_LEN);
+ t.fs.newsmac = 1;
+ } else if (!strcmp(argv[start_arg], "vlan")) {
+ char *p;
+ if (!strcmp(argv[start_arg + 1], "none")) {
+ t.fs.newvlan = VLAN_REMOVE;
+ } else if (argv[start_arg + 1][0] == '=') {
+ t.fs.newvlan = VLAN_REWRITE;
+ } else if (argv[start_arg + 1][0] == '+') {
+ t.fs.newvlan = VLAN_INSERT;
+ } else {
+ warnx("unknown vlan parameter \"%s\"; must"
+ " be one of \"none\", \"=<vlan>\" or"
+ " \"+<vlan>\"", argv[start_arg + 1]);
+ return (EINVAL);
+ }
+ if (t.fs.newvlan == VLAN_REWRITE ||
+ t.fs.newvlan == VLAN_INSERT) {
+ t.fs.vlan = strtoul(argv[start_arg + 1] + 1,
+ &p, 0);
+ if (p == argv[start_arg + 1] + 1 || p[0] != 0) {
+ warnx("invalid vlan \"%s\"",
+ argv[start_arg + 1]);
+ return (EINVAL);
+ }
+ }
+ } else {
+ warnx("invalid parameter \"%s\"", argv[start_arg]);
+ return (EINVAL);
+ }
+ }
+ if (start_arg != argc) {
+ warnx("no value for \"%s\"", argv[start_arg]);
+ return (EINVAL);
+ }
+
+ /*
+ * Check basic sanity of option combinations.
+ */
+ if (t.fs.action != FILTER_SWITCH &&
+ (t.fs.eport || t.fs.newdmac || t.fs.newsmac || t.fs.newvlan)) {
+ warnx("prio, port dmac, smac and vlan only make sense with"
+ " \"action switch\"");
+ return (EINVAL);
+ }
+ if (t.fs.action != FILTER_PASS &&
+ (t.fs.rpttid || t.fs.dirsteer || t.fs.maskhash)) {
+ warnx("rpttid, queue and tcbhash don't make sense with"
+ " action \"drop\" or \"switch\"");
+ return (EINVAL);
+ }
+
+ t.fs.type = (af == AF_INET6 ? 1 : 0); /* default IPv4 */
+ return doit(CHELSIO_T4_SET_FILTER, &t);
+}
+
+static int
+filter_cmd(int argc, const char *argv[])
+{
+ long long val;
+ uint32_t idx;
+ char *s;
+
+ if (argc == 0) {
+ warnx("filter: no arguments.");
+ return (EINVAL);
+ };
+
+ /* list */
+ if (strcmp(argv[0], "list") == 0) {
+ if (argc != 1)
+ warnx("trailing arguments after \"list\" ignored.");
+
+ return show_filters();
+ }
+
+ /* mode */
+ if (argc == 1 && strcmp(argv[0], "mode") == 0)
+ return get_filter_mode();
+
+ /* mode <mode> */
+ if (strcmp(argv[0], "mode") == 0)
+ return set_filter_mode(argc - 1, argv + 1);
+
+ /* <idx> ... */
+ s = str_to_number(argv[0], NULL, &val);
+ if (*s || val > 0xffffffffU) {
+ warnx("\"%s\" is neither an index nor a filter subcommand.",
+ argv[0]);
+ return (EINVAL);
+ }
+ idx = (uint32_t) val;
+
+ /* <idx> delete|clear */
+ if (argc == 2 &&
+ (strcmp(argv[1], "delete") == 0 || strcmp(argv[1], "clear") == 0)) {
+ return del_filter(idx);
+ }
+
+ /* <idx> [<param> <val>] ... */
+ return set_filter(idx, argc - 1, argv + 1);
+}
+
+/*
+ * Shows the fields of a multi-word structure. The structure is considered to
+ * consist of @nwords 32-bit words (i.e, it's an (@nwords * 32)-bit structure)
+ * whose fields are described by @fd. The 32-bit words are given in @words
+ * starting with the least significant 32-bit word.
+ */
+static void
+show_struct(const uint32_t *words, int nwords, const struct field_desc *fd)
+{
+ unsigned int w = 0;
+ const struct field_desc *p;
+
+ for (p = fd; p->name; p++)
+ w = max(w, strlen(p->name));
+
+ while (fd->name) {
+ unsigned long long data;
+ int first_word = fd->start / 32;
+ int shift = fd->start % 32;
+ int width = fd->end - fd->start + 1;
+ unsigned long long mask = (1ULL << width) - 1;
+
+ data = (words[first_word] >> shift) |
+ ((uint64_t)words[first_word + 1] << (32 - shift));
+ if (shift)
+ data |= ((uint64_t)words[first_word + 2] << (64 - shift));
+ data &= mask;
+ if (fd->islog2)
+ data = 1 << data;
+ printf("%-*s ", w, fd->name);
+ printf(fd->hex ? "%#llx\n" : "%llu\n", data << fd->shift);
+ fd++;
+ }
+}
+
+#define FIELD(name, start, end) { name, start, end, 0, 0, 0 }
+#define FIELD1(name, start) FIELD(name, start, start)
+
+static void
+show_sge_context(const struct t4_sge_context *p)
+{
+ static struct field_desc egress[] = {
+ FIELD1("StatusPgNS:", 180),
+ FIELD1("StatusPgRO:", 179),
+ FIELD1("FetchNS:", 178),
+ FIELD1("FetchRO:", 177),
+ FIELD1("Valid:", 176),
+ FIELD("PCIeDataChannel:", 174, 175),
+ FIELD1("DCAEgrQEn:", 173),
+ FIELD("DCACPUID:", 168, 172),
+ FIELD1("FCThreshOverride:", 167),
+ FIELD("WRLength:", 162, 166),
+ FIELD1("WRLengthKnown:", 161),
+ FIELD1("ReschedulePending:", 160),
+ FIELD1("OnChipQueue:", 159),
+ FIELD1("FetchSizeMode", 158),
+ { "FetchBurstMin:", 156, 157, 4, 0, 1 },
+ { "FetchBurstMax:", 153, 154, 6, 0, 1 },
+ FIELD("uPToken:", 133, 152),
+ FIELD1("uPTokenEn:", 132),
+ FIELD1("UserModeIO:", 131),
+ FIELD("uPFLCredits:", 123, 130),
+ FIELD1("uPFLCreditEn:", 122),
+ FIELD("FID:", 111, 121),
+ FIELD("HostFCMode:", 109, 110),
+ FIELD1("HostFCOwner:", 108),
+ { "CIDXFlushThresh:", 105, 107, 0, 0, 1 },
+ FIELD("CIDX:", 89, 104),
+ FIELD("PIDX:", 73, 88),
+ { "BaseAddress:", 18, 72, 9, 1 },
+ FIELD("QueueSize:", 2, 17),
+ FIELD1("QueueType:", 1),
+ FIELD1("CachePriority:", 0),
+ { NULL }
+ };
+ static struct field_desc fl[] = {
+ FIELD1("StatusPgNS:", 180),
+ FIELD1("StatusPgRO:", 179),
+ FIELD1("FetchNS:", 178),
+ FIELD1("FetchRO:", 177),
+ FIELD1("Valid:", 176),
+ FIELD("PCIeDataChannel:", 174, 175),
+ FIELD1("DCAEgrQEn:", 173),
+ FIELD("DCACPUID:", 168, 172),
+ FIELD1("FCThreshOverride:", 167),
+ FIELD("WRLength:", 162, 166),
+ FIELD1("WRLengthKnown:", 161),
+ FIELD1("ReschedulePending:", 160),
+ FIELD1("OnChipQueue:", 159),
+ FIELD1("FetchSizeMode", 158),
+ { "FetchBurstMin:", 156, 157, 4, 0, 1 },
+ { "FetchBurstMax:", 153, 154, 6, 0, 1 },
+ FIELD1("FLMcongMode:", 152),
+ FIELD("MaxuPFLCredits:", 144, 151),
+ FIELD("FLMcontextID:", 133, 143),
+ FIELD1("uPTokenEn:", 132),
+ FIELD1("UserModeIO:", 131),
+ FIELD("uPFLCredits:", 123, 130),
+ FIELD1("uPFLCreditEn:", 122),
+ FIELD("FID:", 111, 121),
+ FIELD("HostFCMode:", 109, 110),
+ FIELD1("HostFCOwner:", 108),
+ { "CIDXFlushThresh:", 105, 107, 0, 0, 1 },
+ FIELD("CIDX:", 89, 104),
+ FIELD("PIDX:", 73, 88),
+ { "BaseAddress:", 18, 72, 9, 1 },
+ FIELD("QueueSize:", 2, 17),
+ FIELD1("QueueType:", 1),
+ FIELD1("CachePriority:", 0),
+ { NULL }
+ };
+ static struct field_desc ingress[] = {
+ FIELD1("NoSnoop:", 145),
+ FIELD1("RelaxedOrdering:", 144),
+ FIELD1("GTSmode:", 143),
+ FIELD1("ISCSICoalescing:", 142),
+ FIELD1("Valid:", 141),
+ FIELD1("TimerPending:", 140),
+ FIELD1("DropRSS:", 139),
+ FIELD("PCIeChannel:", 137, 138),
+ FIELD1("SEInterruptArmed:", 136),
+ FIELD1("CongestionMgtEnable:", 135),
+ FIELD1("DCAIngQEnable:", 134),
+ FIELD("DCACPUID:", 129, 133),
+ FIELD1("UpdateScheduling:", 128),
+ FIELD("UpdateDelivery:", 126, 127),
+ FIELD1("InterruptSent:", 125),
+ FIELD("InterruptIDX:", 114, 124),
+ FIELD1("InterruptDestination:", 113),
+ FIELD1("InterruptArmed:", 112),
+ FIELD("RxIntCounter:", 106, 111),
+ FIELD("RxIntCounterThreshold:", 104, 105),
+ FIELD1("Generation:", 103),
+ { "BaseAddress:", 48, 102, 9, 1 },
+ FIELD("PIDX:", 32, 47),
+ FIELD("CIDX:", 16, 31),
+ { "QueueSize:", 4, 15, 4, 0 },
+ { "QueueEntrySize:", 2, 3, 4, 0, 1 },
+ FIELD1("QueueEntryOverride:", 1),
+ FIELD1("CachePriority:", 0),
+ { NULL }
+ };
+ static struct field_desc flm[] = {
+ FIELD1("NoSnoop:", 79),
+ FIELD1("RelaxedOrdering:", 78),
+ FIELD1("Valid:", 77),
+ FIELD("DCACPUID:", 72, 76),
+ FIELD1("DCAFLEn:", 71),
+ FIELD("EQid:", 54, 70),
+ FIELD("SplitEn:", 52, 53),
+ FIELD1("PadEn:", 51),
+ FIELD1("PackEn:", 50),
+ FIELD1("DBpriority:", 48),
+ FIELD("PackOffset:", 16, 47),
+ FIELD("CIDX:", 8, 15),
+ FIELD("PIDX:", 0, 7),
+ { NULL }
+ };
+ static struct field_desc conm[] = {
+ FIELD1("CngDBPHdr:", 6),
+ FIELD1("CngDBPData:", 5),
+ FIELD1("CngIMSG:", 4),
+ FIELD("CngChMap:", 0, 3),
+ { NULL }
+ };
+
+ if (p->mem_id == SGE_CONTEXT_EGRESS)
+ show_struct(p->data, 6, (p->data[0] & 2) ? fl : egress);
+ else if (p->mem_id == SGE_CONTEXT_FLM)
+ show_struct(p->data, 3, flm);
+ else if (p->mem_id == SGE_CONTEXT_INGRESS)
+ show_struct(p->data, 5, ingress);
+ else if (p->mem_id == SGE_CONTEXT_CNM)
+ show_struct(p->data, 1, conm);
+}
+
+#undef FIELD
+#undef FIELD1
+
+static int
+get_sge_context(int argc, const char *argv[])
+{
+ int rc;
+ char *p;
+ long cid;
+ struct t4_sge_context cntxt = {0};
+
+ if (argc != 2) {
+ warnx("sge_context: incorrect number of arguments.");
+ return (EINVAL);
+ }
+
+ if (!strcmp(argv[0], "egress"))
+ cntxt.mem_id = SGE_CONTEXT_EGRESS;
+ else if (!strcmp(argv[0], "ingress"))
+ cntxt.mem_id = SGE_CONTEXT_INGRESS;
+ else if (!strcmp(argv[0], "fl"))
+ cntxt.mem_id = SGE_CONTEXT_FLM;
+ else if (!strcmp(argv[0], "cong"))
+ cntxt.mem_id = SGE_CONTEXT_CNM;
+ else {
+ warnx("unknown context type \"%s\"; known types are egress, "
+ "ingress, fl, and cong.", argv[0]);
+ return (EINVAL);
+ }
+
+ p = str_to_number(argv[1], &cid, NULL);
+ if (*p) {
+ warnx("invalid context id \"%s\"", argv[1]);
+ return (EINVAL);
+ }
+ cntxt.cid = cid;
+
+ rc = doit(CHELSIO_T4_GET_SGE_CONTEXT, &cntxt);
+ if (rc != 0)
+ return (rc);
+
+ show_sge_context(&cntxt);
+ return (0);
+}
+
+static int
+run_cmd(int argc, const char *argv[])
+{
+ int rc = -1;
+ const char *cmd = argv[0];
+
+ /* command */
+ argc--;
+ argv++;
+
+ if (!strcmp(cmd, "reg") || !strcmp(cmd, "reg32"))
+ rc = register_io(argc, argv, 4);
+ else if (!strcmp(cmd, "reg64"))
+ rc = register_io(argc, argv, 8);
+ else if (!strcmp(cmd, "regdump"))
+ rc = dump_regs(argc, argv);
+ else if (!strcmp(cmd, "filter"))
+ rc = filter_cmd(argc, argv);
+ else if (!strcmp(cmd, "context"))
+ rc = get_sge_context(argc, argv);
+ else {
+ rc = EINVAL;
+ warnx("invalid command \"%s\"", cmd);
+ }
+
+ return (rc);
+}
+
+#define MAX_ARGS 15
+static int
+run_cmd_loop(void)
+{
+ int i, rc = 0;
+ char buffer[128], *buf;
+ const char *args[MAX_ARGS + 1];
+
+ /*
+ * Simple loop: displays a "> " prompt and processes any input as a
+ * cxgbetool command. You're supposed to enter only the part after
+ * "cxgbetool t4nexX". Use "quit" or "exit" to exit.
+ */
+ for (;;) {
+ fprintf(stdout, "> ");
+ fflush(stdout);
+ buf = fgets(buffer, sizeof(buffer), stdin);
+ if (buf == NULL) {
+ if (ferror(stdin)) {
+ warn("stdin error");
+ rc = errno; /* errno from fgets */
+ }
+ break;
+ }
+
+ i = 0;
+ while ((args[i] = strsep(&buf, " \t\n")) != NULL) {
+ if (args[i][0] != 0 && ++i == MAX_ARGS)
+ break;
+ }
+ args[i] = 0;
+
+ if (i == 0)
+ continue; /* skip empty line */
+
+ if (!strcmp(args[0], "quit") || !strcmp(args[0], "exit"))
+ break;
+
+ rc = run_cmd(i, args);
+ }
+
+ /* rc normally comes from the last command (not including quit/exit) */
+ return (rc);
+}
+
+int
+main(int argc, const char *argv[])
+{
+ int rc = -1;
+
+ progname = argv[0];
+
+ if (argc == 2) {
+ if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
+ usage(stdout);
+ exit(0);
+ }
+ }
+
+ if (argc < 3) {
+ usage(stderr);
+ exit(EINVAL);
+ }
+
+ nexus = argv[1];
+
+ /* progname and nexus */
+ argc -= 2;
+ argv += 2;
+
+ if (argc == 1 && !strcmp(argv[0], "stdio"))
+ rc = run_cmd_loop();
+ else
+ rc = run_cmd(argc, argv);
+
+ return (rc);
+}
diff --git a/tools/tools/cxgbetool/reg_defs_t4.c b/tools/tools/cxgbetool/reg_defs_t4.c
new file mode 100644
index 0000000..d838fe5
--- /dev/null
+++ b/tools/tools/cxgbetool/reg_defs_t4.c
@@ -0,0 +1,40394 @@
+/* This file is automatically generated --- changes will be lost */
+__FBSDID("$FreeBSD$");
+
+struct reg_info t4_sge_regs[] = {
+ { "SGE_PF_KDOORBELL", 0x1e000, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_PF_GTS", 0x1e004, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+ { "SGE_PF_KDOORBELL", 0x1e400, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_PF_GTS", 0x1e404, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+ { "SGE_PF_KDOORBELL", 0x1e800, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_PF_GTS", 0x1e804, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+ { "SGE_PF_KDOORBELL", 0x1ec00, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_PF_GTS", 0x1ec04, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+ { "SGE_PF_KDOORBELL", 0x1f000, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_PF_GTS", 0x1f004, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+ { "SGE_PF_KDOORBELL", 0x1f400, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_PF_GTS", 0x1f404, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+ { "SGE_PF_KDOORBELL", 0x1f800, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_PF_GTS", 0x1f804, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+ { "SGE_PF_KDOORBELL", 0x1fc00, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_PF_GTS", 0x1fc04, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+ { "SGE_CONTROL", 0x1008, 0 },
+ { "IgrAllCPLtoFL", 31, 1 },
+ { "FLSplitMin", 22, 9 },
+ { "FLSplitMode", 20, 2 },
+ { "DCASysType", 19, 1 },
+ { "RxPktCPLMode", 18, 1 },
+ { "EgrStatusPageSize", 17, 1 },
+ { "IngHintEnable1", 15, 1 },
+ { "IngHintEnable0", 14, 1 },
+ { "IngIntCompareIDX", 13, 1 },
+ { "PktShift", 10, 3 },
+ { "IngPCIeBoundary", 7, 3 },
+ { "IngPadBoundary", 4, 3 },
+ { "EgrPCIeBoundary", 1, 3 },
+ { "GlobalEnable", 0, 1 },
+ { "SGE_HOST_PAGE_SIZE", 0x100c, 0 },
+ { "HostPageSizePF7", 28, 4 },
+ { "HostPageSizePF6", 24, 4 },
+ { "HostPageSizePF5", 20, 4 },
+ { "HostPageSizePF4", 16, 4 },
+ { "HostPageSizePF3", 12, 4 },
+ { "HostPageSizePF2", 8, 4 },
+ { "HostPageSizePF1", 4, 4 },
+ { "HostPageSizePF0", 0, 4 },
+ { "SGE_EGRESS_QUEUES_PER_PAGE_PF", 0x1010, 0 },
+ { "QueuesPerPagePF7", 28, 4 },
+ { "QueuesPerPagePF6", 24, 4 },
+ { "QueuesPerPagePF5", 20, 4 },
+ { "QueuesPerPagePF4", 16, 4 },
+ { "QueuesPerPagePF3", 12, 4 },
+ { "QueuesPerPagePF2", 8, 4 },
+ { "QueuesPerPagePF1", 4, 4 },
+ { "QueuesPerPagePF0", 0, 4 },
+ { "SGE_EGRESS_QUEUES_PER_PAGE_VF", 0x1014, 0 },
+ { "QueuesPerPageVFPF7", 28, 4 },
+ { "QueuesPerPageVFPF6", 24, 4 },
+ { "QueuesPerPageVFPF5", 20, 4 },
+ { "QueuesPerPageVFPF4", 16, 4 },
+ { "QueuesPerPageVFPF3", 12, 4 },
+ { "QueuesPerPageVFPF2", 8, 4 },
+ { "QueuesPerPageVFPF1", 4, 4 },
+ { "QueuesPerPageVFPF0", 0, 4 },
+ { "SGE_USER_MODE_LIMITS", 0x1018, 0 },
+ { "Opcode_Min", 24, 8 },
+ { "Opcode_Max", 16, 8 },
+ { "Length_Min", 8, 8 },
+ { "Length_Max", 0, 8 },
+ { "SGE_WR_ERROR", 0x101c, 0 },
+ { "SGE_PERR_INJECT", 0x1020, 0 },
+ { "MemSel", 1, 5 },
+ { "InjectDataErr", 0, 1 },
+ { "SGE_INT_CAUSE1", 0x1024, 0 },
+ { "perr_flm_CreditFifo", 30, 1 },
+ { "perr_imsg_hint_fifo", 29, 1 },
+ { "perr_mc_pc", 28, 1 },
+ { "perr_mc_igr_ctxt", 27, 1 },
+ { "perr_mc_egr_ctxt", 26, 1 },
+ { "perr_mc_flm", 25, 1 },
+ { "perr_pc_mctag", 24, 1 },
+ { "perr_pc_chpi_rsp1", 23, 1 },
+ { "perr_pc_chpi_rsp0", 22, 1 },
+ { "perr_dbp_pc_rsp_fifo3", 21, 1 },
+ { "perr_dbp_pc_rsp_fifo2", 20, 1 },
+ { "perr_dbp_pc_rsp_fifo1", 19, 1 },
+ { "perr_dbp_pc_rsp_fifo0", 18, 1 },
+ { "perr_dmarbt", 17, 1 },
+ { "perr_flm_DbpFifo", 16, 1 },
+ { "perr_flm_MCReq_fifo", 15, 1 },
+ { "perr_flm_HintFifo", 14, 1 },
+ { "perr_align_ctl_fifo3", 13, 1 },
+ { "perr_align_ctl_fifo2", 12, 1 },
+ { "perr_align_ctl_fifo1", 11, 1 },
+ { "perr_align_ctl_fifo0", 10, 1 },
+ { "perr_edma_fifo3", 9, 1 },
+ { "perr_edma_fifo2", 8, 1 },
+ { "perr_edma_fifo1", 7, 1 },
+ { "perr_edma_fifo0", 6, 1 },
+ { "perr_pd_fifo3", 5, 1 },
+ { "perr_pd_fifo2", 4, 1 },
+ { "perr_pd_fifo1", 3, 1 },
+ { "perr_pd_fifo0", 2, 1 },
+ { "perr_ing_ctxt_mifrsp", 1, 1 },
+ { "perr_egr_ctxt_mifrsp", 0, 1 },
+ { "SGE_INT_ENABLE1", 0x1028, 0 },
+ { "perr_flm_CreditFifo", 30, 1 },
+ { "perr_imsg_hint_fifo", 29, 1 },
+ { "perr_mc_pc", 28, 1 },
+ { "perr_mc_igr_ctxt", 27, 1 },
+ { "perr_mc_egr_ctxt", 26, 1 },
+ { "perr_mc_flm", 25, 1 },
+ { "perr_pc_mctag", 24, 1 },
+ { "perr_pc_chpi_rsp1", 23, 1 },
+ { "perr_pc_chpi_rsp0", 22, 1 },
+ { "perr_dbp_pc_rsp_fifo3", 21, 1 },
+ { "perr_dbp_pc_rsp_fifo2", 20, 1 },
+ { "perr_dbp_pc_rsp_fifo1", 19, 1 },
+ { "perr_dbp_pc_rsp_fifo0", 18, 1 },
+ { "perr_dmarbt", 17, 1 },
+ { "perr_flm_DbpFifo", 16, 1 },
+ { "perr_flm_MCReq_fifo", 15, 1 },
+ { "perr_flm_HintFifo", 14, 1 },
+ { "perr_align_ctl_fifo3", 13, 1 },
+ { "perr_align_ctl_fifo2", 12, 1 },
+ { "perr_align_ctl_fifo1", 11, 1 },
+ { "perr_align_ctl_fifo0", 10, 1 },
+ { "perr_edma_fifo3", 9, 1 },
+ { "perr_edma_fifo2", 8, 1 },
+ { "perr_edma_fifo1", 7, 1 },
+ { "perr_edma_fifo0", 6, 1 },
+ { "perr_pd_fifo3", 5, 1 },
+ { "perr_pd_fifo2", 4, 1 },
+ { "perr_pd_fifo1", 3, 1 },
+ { "perr_pd_fifo0", 2, 1 },
+ { "perr_ing_ctxt_mifrsp", 1, 1 },
+ { "perr_egr_ctxt_mifrsp", 0, 1 },
+ { "SGE_PERR_ENABLE1", 0x102c, 0 },
+ { "perr_flm_CreditFifo", 30, 1 },
+ { "perr_imsg_hint_fifo", 29, 1 },
+ { "perr_mc_pc", 28, 1 },
+ { "perr_mc_igr_ctxt", 27, 1 },
+ { "perr_mc_egr_ctxt", 26, 1 },
+ { "perr_mc_flm", 25, 1 },
+ { "perr_pc_mctag", 24, 1 },
+ { "perr_pc_chpi_rsp1", 23, 1 },
+ { "perr_pc_chpi_rsp0", 22, 1 },
+ { "perr_dbp_pc_rsp_fifo3", 21, 1 },
+ { "perr_dbp_pc_rsp_fifo2", 20, 1 },
+ { "perr_dbp_pc_rsp_fifo1", 19, 1 },
+ { "perr_dbp_pc_rsp_fifo0", 18, 1 },
+ { "perr_dmarbt", 17, 1 },
+ { "perr_flm_DbpFifo", 16, 1 },
+ { "perr_flm_MCReq_fifo", 15, 1 },
+ { "perr_flm_HintFifo", 14, 1 },
+ { "perr_align_ctl_fifo3", 13, 1 },
+ { "perr_align_ctl_fifo2", 12, 1 },
+ { "perr_align_ctl_fifo1", 11, 1 },
+ { "perr_align_ctl_fifo0", 10, 1 },
+ { "perr_edma_fifo3", 9, 1 },
+ { "perr_edma_fifo2", 8, 1 },
+ { "perr_edma_fifo1", 7, 1 },
+ { "perr_edma_fifo0", 6, 1 },
+ { "perr_pd_fifo3", 5, 1 },
+ { "perr_pd_fifo2", 4, 1 },
+ { "perr_pd_fifo1", 3, 1 },
+ { "perr_pd_fifo0", 2, 1 },
+ { "perr_ing_ctxt_mifrsp", 1, 1 },
+ { "perr_egr_ctxt_mifrsp", 0, 1 },
+ { "SGE_INT_CAUSE2", 0x1030, 0 },
+ { "perr_hint_delay_fifo1", 30, 1 },
+ { "perr_hint_delay_fifo0", 29, 1 },
+ { "perr_imsg_pd_fifo", 28, 1 },
+ { "perr_ulptx_fifo1", 27, 1 },
+ { "perr_ulptx_fifo0", 26, 1 },
+ { "perr_idma2imsg_fifo1", 25, 1 },
+ { "perr_idma2imsg_fifo0", 24, 1 },
+ { "perr_headersplit_fifo1", 23, 1 },
+ { "perr_headersplit_fifo0", 22, 1 },
+ { "perr_eswitch_fifo3", 21, 1 },
+ { "perr_eswitch_fifo2", 20, 1 },
+ { "perr_eswitch_fifo1", 19, 1 },
+ { "perr_eswitch_fifo0", 18, 1 },
+ { "perr_pc_dbp1", 17, 1 },
+ { "perr_pc_dbp0", 16, 1 },
+ { "perr_imsg_ob_fifo", 15, 1 },
+ { "perr_conm_sram", 14, 1 },
+ { "perr_pc_mc_rsp", 13, 1 },
+ { "perr_isw_idma0_fifo", 12, 1 },
+ { "perr_isw_idma1_fifo", 11, 1 },
+ { "perr_isw_dbp_fifo", 10, 1 },
+ { "perr_isw_gts_fifo", 9, 1 },
+ { "perr_itp_evr", 8, 1 },
+ { "perr_flm_cntxmem", 7, 1 },
+ { "perr_flm_l1Cache", 6, 1 },
+ { "perr_dbp_hint_fifo", 5, 1 },
+ { "perr_dbp_hp_fifo", 4, 1 },
+ { "perr_dbp_lp_fifo", 3, 1 },
+ { "perr_ing_ctxt_cache", 2, 1 },
+ { "perr_egr_ctxt_cache", 1, 1 },
+ { "perr_base_size", 0, 1 },
+ { "SGE_INT_ENABLE2", 0x1034, 0 },
+ { "perr_hint_delay_fifo1", 30, 1 },
+ { "perr_hint_delay_fifo0", 29, 1 },
+ { "perr_imsg_pd_fifo", 28, 1 },
+ { "perr_ulptx_fifo1", 27, 1 },
+ { "perr_ulptx_fifo0", 26, 1 },
+ { "perr_idma2imsg_fifo1", 25, 1 },
+ { "perr_idma2imsg_fifo0", 24, 1 },
+ { "perr_headersplit_fifo1", 23, 1 },
+ { "perr_headersplit_fifo0", 22, 1 },
+ { "perr_eswitch_fifo3", 21, 1 },
+ { "perr_eswitch_fifo2", 20, 1 },
+ { "perr_eswitch_fifo1", 19, 1 },
+ { "perr_eswitch_fifo0", 18, 1 },
+ { "perr_pc_dbp1", 17, 1 },
+ { "perr_pc_dbp0", 16, 1 },
+ { "perr_imsg_ob_fifo", 15, 1 },
+ { "perr_conm_sram", 14, 1 },
+ { "perr_pc_mc_rsp", 13, 1 },
+ { "perr_isw_idma0_fifo", 12, 1 },
+ { "perr_isw_idma1_fifo", 11, 1 },
+ { "perr_isw_dbp_fifo", 10, 1 },
+ { "perr_isw_gts_fifo", 9, 1 },
+ { "perr_itp_evr", 8, 1 },
+ { "perr_flm_cntxmem", 7, 1 },
+ { "perr_flm_l1Cache", 6, 1 },
+ { "perr_dbp_hint_fifo", 5, 1 },
+ { "perr_dbp_hp_fifo", 4, 1 },
+ { "perr_dbp_lp_fifo", 3, 1 },
+ { "perr_ing_ctxt_cache", 2, 1 },
+ { "perr_egr_ctxt_cache", 1, 1 },
+ { "perr_base_size", 0, 1 },
+ { "SGE_PERR_ENABLE2", 0x1038, 0 },
+ { "perr_hint_delay_fifo1", 30, 1 },
+ { "perr_hint_delay_fifo0", 29, 1 },
+ { "perr_imsg_pd_fifo", 28, 1 },
+ { "perr_ulptx_fifo1", 27, 1 },
+ { "perr_ulptx_fifo0", 26, 1 },
+ { "perr_idma2imsg_fifo1", 25, 1 },
+ { "perr_idma2imsg_fifo0", 24, 1 },
+ { "perr_headersplit_fifo1", 23, 1 },
+ { "perr_headersplit_fifo0", 22, 1 },
+ { "perr_eswitch_fifo3", 21, 1 },
+ { "perr_eswitch_fifo2", 20, 1 },
+ { "perr_eswitch_fifo1", 19, 1 },
+ { "perr_eswitch_fifo0", 18, 1 },
+ { "perr_pc_dbp1", 17, 1 },
+ { "perr_pc_dbp0", 16, 1 },
+ { "perr_imsg_ob_fifo", 15, 1 },
+ { "perr_conm_sram", 14, 1 },
+ { "perr_pc_mc_rsp", 13, 1 },
+ { "perr_isw_idma0_fifo", 12, 1 },
+ { "perr_isw_idma1_fifo", 11, 1 },
+ { "perr_isw_dbp_fifo", 10, 1 },
+ { "perr_isw_gts_fifo", 9, 1 },
+ { "perr_itp_evr", 8, 1 },
+ { "perr_flm_cntxmem", 7, 1 },
+ { "perr_flm_l1Cache", 6, 1 },
+ { "perr_dbp_hint_fifo", 5, 1 },
+ { "perr_dbp_hp_fifo", 4, 1 },
+ { "perr_dbp_lp_fifo", 3, 1 },
+ { "perr_ing_ctxt_cache", 2, 1 },
+ { "perr_egr_ctxt_cache", 1, 1 },
+ { "perr_base_size", 0, 1 },
+ { "SGE_INT_CAUSE3", 0x103c, 0 },
+ { "err_flm_dbp", 31, 1 },
+ { "err_flm_idma1", 30, 1 },
+ { "err_flm_idma0", 29, 1 },
+ { "err_flm_hint", 28, 1 },
+ { "err_pcie_error3", 27, 1 },
+ { "err_pcie_error2", 26, 1 },
+ { "err_pcie_error1", 25, 1 },
+ { "err_pcie_error0", 24, 1 },
+ { "err_timer_above_max_qid", 23, 1 },
+ { "err_cpl_exceed_iqe_size", 22, 1 },
+ { "err_invalid_cidx_inc", 21, 1 },
+ { "err_itp_time_paused", 20, 1 },
+ { "err_cpl_opcode_0", 19, 1 },
+ { "err_dropped_db", 18, 1 },
+ { "err_data_cpl_on_high_qid1", 17, 1 },
+ { "err_data_cpl_on_high_qid0", 16, 1 },
+ { "err_bad_db_pidx3", 15, 1 },
+ { "err_bad_db_pidx2", 14, 1 },
+ { "err_bad_db_pidx1", 13, 1 },
+ { "err_bad_db_pidx0", 12, 1 },
+ { "err_ing_pcie_chan", 11, 1 },
+ { "err_ing_ctxt_prio", 10, 1 },
+ { "err_egr_ctxt_prio", 9, 1 },
+ { "dbfifo_hp_int", 8, 1 },
+ { "dbfifo_lp_int", 7, 1 },
+ { "reg_address_err", 6, 1 },
+ { "ingress_size_err", 5, 1 },
+ { "egress_size_err", 4, 1 },
+ { "err_inv_ctxt3", 3, 1 },
+ { "err_inv_ctxt2", 2, 1 },
+ { "err_inv_ctxt1", 1, 1 },
+ { "err_inv_ctxt0", 0, 1 },
+ { "SGE_INT_ENABLE3", 0x1040, 0 },
+ { "err_flm_dbp", 31, 1 },
+ { "err_flm_idma1", 30, 1 },
+ { "err_flm_idma0", 29, 1 },
+ { "err_flm_hint", 28, 1 },
+ { "err_pcie_error3", 27, 1 },
+ { "err_pcie_error2", 26, 1 },
+ { "err_pcie_error1", 25, 1 },
+ { "err_pcie_error0", 24, 1 },
+ { "err_timer_above_max_qid", 23, 1 },
+ { "err_cpl_exceed_iqe_size", 22, 1 },
+ { "err_invalid_cidx_inc", 21, 1 },
+ { "err_itp_time_paused", 20, 1 },
+ { "err_cpl_opcode_0", 19, 1 },
+ { "err_dropped_db", 18, 1 },
+ { "err_data_cpl_on_high_qid1", 17, 1 },
+ { "err_data_cpl_on_high_qid0", 16, 1 },
+ { "err_bad_db_pidx3", 15, 1 },
+ { "err_bad_db_pidx2", 14, 1 },
+ { "err_bad_db_pidx1", 13, 1 },
+ { "err_bad_db_pidx0", 12, 1 },
+ { "err_ing_pcie_chan", 11, 1 },
+ { "err_ing_ctxt_prio", 10, 1 },
+ { "err_egr_ctxt_prio", 9, 1 },
+ { "dbfifo_hp_int", 8, 1 },
+ { "dbfifo_lp_int", 7, 1 },
+ { "reg_address_err", 6, 1 },
+ { "ingress_size_err", 5, 1 },
+ { "egress_size_err", 4, 1 },
+ { "err_inv_ctxt3", 3, 1 },
+ { "err_inv_ctxt2", 2, 1 },
+ { "err_inv_ctxt1", 1, 1 },
+ { "err_inv_ctxt0", 0, 1 },
+ { "SGE_FL_BUFFER_SIZE0", 0x1044, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE1", 0x1048, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE2", 0x104c, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE3", 0x1050, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE4", 0x1054, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE5", 0x1058, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE6", 0x105c, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE7", 0x1060, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE8", 0x1064, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE9", 0x1068, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE10", 0x106c, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE11", 0x1070, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE12", 0x1074, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE13", 0x1078, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE14", 0x107c, 0 },
+ { "Size", 4, 28 },
+ { "SGE_FL_BUFFER_SIZE15", 0x1080, 0 },
+ { "Size", 4, 28 },
+ { "SGE_DBQ_CTXT_BADDR", 0x1084, 0 },
+ { "BaseAddr", 3, 29 },
+ { "SGE_IMSG_CTXT_BADDR", 0x1088, 0 },
+ { "BaseAddr", 3, 29 },
+ { "SGE_FLM_CACHE_BADDR", 0x108c, 0 },
+ { "BaseAddr", 3, 29 },
+ { "SGE_FLM_CFG", 0x1090, 0 },
+ { "OpMode", 26, 6 },
+ { "NoHdr", 18, 1 },
+ { "CachePtrCnt", 16, 2 },
+ { "EDRAMPtrCnt", 14, 2 },
+ { "HdrStartFLQ", 11, 3 },
+ { "FetchThresh", 6, 5 },
+ { "CreditCnt", 4, 2 },
+ { "NoEDRAM", 0, 1 },
+ { "SGE_CONM_CTRL", 0x1094, 0 },
+ { "EgrThreshold", 8, 6 },
+ { "IngThreshold", 2, 6 },
+ { "MPS_Enable", 1, 1 },
+ { "TP_Enable", 0, 1 },
+ { "SGE_TIMESTAMP_LO", 0x1098, 0 },
+ { "SGE_TIMESTAMP_HI", 0x109c, 0 },
+ { "Opcode", 28, 2 },
+ { "Value", 0, 28 },
+ { "SGE_INGRESS_RX_THRESHOLD", 0x10a0, 0 },
+ { "Threshold_0", 24, 6 },
+ { "Threshold_1", 16, 6 },
+ { "Threshold_2", 8, 6 },
+ { "Threshold_3", 0, 6 },
+ { "SGE_DBFIFO_STATUS", 0x10a4, 0 },
+ { "HP_Int_Thresh", 28, 4 },
+ { "HP_Count", 16, 11 },
+ { "LP_Int_Thresh", 12, 4 },
+ { "LP_Count", 0, 11 },
+ { "SGE_DOORBELL_CONTROL", 0x10a8, 0 },
+ { "HintDepthCtl", 27, 5 },
+ { "NoCoalesce", 26, 1 },
+ { "HP_Weight", 24, 2 },
+ { "HP_Disable", 23, 1 },
+ { "ForceUserDBtoLP", 22, 1 },
+ { "ForceVFPF0DBtoLP", 21, 1 },
+ { "ForceVFPF1DBtoLP", 20, 1 },
+ { "ForceVFPF2DBtoLP", 19, 1 },
+ { "ForceVFPF3DBtoLP", 18, 1 },
+ { "ForceVFPF4DBtoLP", 17, 1 },
+ { "ForceVFPF5DBtoLP", 16, 1 },
+ { "ForceVFPF6DBtoLP", 15, 1 },
+ { "ForceVFPF7DBtoLP", 14, 1 },
+ { "Enable_Drop", 13, 1 },
+ { "Drop_Timeout", 1, 12 },
+ { "Dropped_DB", 0, 1 },
+ { "SGE_DROPPED_DOORBELL", 0x10ac, 0 },
+ { "SGE_DOORBELL_THROTTLE_CONTROL", 0x10b0, 0 },
+ { "Throttle_Count", 1, 12 },
+ { "Throttle_Enable", 0, 1 },
+ { "SGE_ITP_CONTROL", 0x10b4, 0 },
+ { "Critical_Time", 10, 15 },
+ { "LL_Empty", 4, 6 },
+ { "LL_Read_Wait_Disable", 0, 1 },
+ { "SGE_TIMER_VALUE_0_AND_1", 0x10b8, 0 },
+ { "TimerValue0", 16, 16 },
+ { "TimerValue1", 0, 16 },
+ { "SGE_TIMER_VALUE_2_AND_3", 0x10bc, 0 },
+ { "TimerValue2", 16, 16 },
+ { "TimerValue3", 0, 16 },
+ { "SGE_TIMER_VALUE_4_AND_5", 0x10c0, 0 },
+ { "TimerValue4", 16, 16 },
+ { "TimerValue5", 0, 16 },
+ { "SGE_PD_RSP_CREDIT01", 0x10c4, 0 },
+ { "RspCreditEn0", 31, 1 },
+ { "MaxTag0", 24, 7 },
+ { "MaxRspCnt0", 16, 8 },
+ { "RspCreditEn1", 15, 1 },
+ { "MaxTag1", 8, 7 },
+ { "MaxRspCnt1", 0, 8 },
+ { "SGE_PD_RSP_CREDIT23", 0x10c8, 0 },
+ { "RspCreditEn2", 31, 1 },
+ { "MaxTag2", 24, 7 },
+ { "MaxRspCnt2", 16, 8 },
+ { "RspCreditEn3", 15, 1 },
+ { "MaxTag3", 8, 7 },
+ { "MaxRspCnt3", 0, 8 },
+ { "SGE_DEBUG_INDEX", 0x10cc, 0 },
+ { "SGE_DEBUG_DATA_HIGH", 0x10d0, 0 },
+ { "SGE_DEBUG_DATA_LOW", 0x10d4, 0 },
+ { "SGE_REVISION", 0x10d8, 0 },
+ { "SGE_INT_CAUSE4", 0x10dc, 0 },
+ { "err_bad_upfl_inc_credit3", 8, 1 },
+ { "err_bad_upfl_inc_credit2", 7, 1 },
+ { "err_bad_upfl_inc_credit1", 6, 1 },
+ { "err_bad_upfl_inc_credit0", 5, 1 },
+ { "err_physaddr_len0_idma1", 4, 1 },
+ { "err_physaddr_len0_idma0", 3, 1 },
+ { "err_flm_invalid_pkt_drop1", 2, 1 },
+ { "err_flm_invalid_pkt_drop0", 1, 1 },
+ { "err_unexpected_timer", 0, 1 },
+ { "SGE_INT_ENABLE4", 0x10e0, 0 },
+ { "err_bad_upfl_inc_credit3", 8, 1 },
+ { "err_bad_upfl_inc_credit2", 7, 1 },
+ { "err_bad_upfl_inc_credit1", 6, 1 },
+ { "err_bad_upfl_inc_credit0", 5, 1 },
+ { "err_physaddr_len0_idma1", 4, 1 },
+ { "err_physaddr_len0_idma0", 3, 1 },
+ { "err_flm_invalid_pkt_drop1", 2, 1 },
+ { "err_flm_invalid_pkt_drop0", 1, 1 },
+ { "err_unexpected_timer", 0, 1 },
+ { "SGE_STAT_TOTAL", 0x10e4, 0 },
+ { "SGE_STAT_MATCH", 0x10e8, 0 },
+ { "SGE_STAT_CFG", 0x10ec, 0 },
+ { "ITPOpMode", 8, 1 },
+ { "EgrCtxtOpMode", 6, 2 },
+ { "IngCtxtOpMode", 4, 2 },
+ { "StatMode", 2, 2 },
+ { "StatSource", 0, 2 },
+ { "SGE_HINT_CFG", 0x10f0, 0 },
+ { "HintsAllowedNoHdr", 6, 6 },
+ { "HintsAllowedHdr", 0, 6 },
+ { "SGE_INGRESS_QUEUES_PER_PAGE_PF", 0x10f4, 0 },
+ { "QueuesPerPagePF7", 28, 4 },
+ { "QueuesPerPagePF6", 24, 4 },
+ { "QueuesPerPagePF5", 20, 4 },
+ { "QueuesPerPagePF4", 16, 4 },
+ { "QueuesPerPagePF3", 12, 4 },
+ { "QueuesPerPagePF2", 8, 4 },
+ { "QueuesPerPagePF1", 4, 4 },
+ { "QueuesPerPagePF0", 0, 4 },
+ { "SGE_INGRESS_QUEUES_PER_PAGE_VF", 0x10f8, 0 },
+ { "QueuesPerPageVFPF7", 28, 4 },
+ { "QueuesPerPageVFPF6", 24, 4 },
+ { "QueuesPerPageVFPF5", 20, 4 },
+ { "QueuesPerPageVFPF4", 16, 4 },
+ { "QueuesPerPageVFPF3", 12, 4 },
+ { "QueuesPerPageVFPF2", 8, 4 },
+ { "QueuesPerPageVFPF1", 4, 4 },
+ { "QueuesPerPageVFPF0", 0, 4 },
+ { "SGE_PD_WRR_CONFIG", 0x10fc, 0 },
+ { "SGE_ERROR_STATS", 0x1100, 0 },
+ { "Uncaptured_Error", 18, 1 },
+ { "Error_QID_Valid", 17, 1 },
+ { "Error_QID", 0, 17 },
+ { "SGE_SHARED_TAG_CHAN_CFG", 0x1104, 0 },
+ { "MinTag3", 24, 8 },
+ { "MinTag2", 16, 8 },
+ { "MinTag1", 8, 8 },
+ { "MinTag0", 0, 8 },
+ { "SGE_SHARED_TAG_POOL_CFG", 0x1108, 0 },
+ { "SGE_PC0_REQ_BIST_CMD", 0x1180, 0 },
+ { "SGE_PC0_REQ_BIST_ERROR_CNT", 0x1184, 0 },
+ { "SGE_PC1_REQ_BIST_CMD", 0x1190, 0 },
+ { "SGE_PC1_REQ_BIST_ERROR_CNT", 0x1194, 0 },
+ { "SGE_PC0_RSP_BIST_CMD", 0x11a0, 0 },
+ { "SGE_PC0_RSP_BIST_ERROR_CNT", 0x11a4, 0 },
+ { "SGE_PC1_RSP_BIST_CMD", 0x11b0, 0 },
+ { "SGE_PC1_RSP_BIST_ERROR_CNT", 0x11b4, 0 },
+ { "SGE_CTXT_CMD", 0x11fc, 0 },
+ { "Busy", 31, 1 },
+ { "Opcode", 28, 2 },
+ { "CtxtType", 24, 2 },
+ { "QID", 0, 17 },
+ { "SGE_CTXT_DATA0", 0x1200, 0 },
+ { "SGE_CTXT_DATA1", 0x1204, 0 },
+ { "SGE_CTXT_DATA2", 0x1208, 0 },
+ { "SGE_CTXT_DATA3", 0x120c, 0 },
+ { "SGE_CTXT_DATA4", 0x1210, 0 },
+ { "SGE_CTXT_DATA5", 0x1214, 0 },
+ { "SGE_CTXT_DATA6", 0x1218, 0 },
+ { "SGE_CTXT_DATA7", 0x121c, 0 },
+ { "SGE_CTXT_MASK0", 0x1220, 0 },
+ { "SGE_CTXT_MASK1", 0x1224, 0 },
+ { "SGE_CTXT_MASK2", 0x1228, 0 },
+ { "SGE_CTXT_MASK3", 0x122c, 0 },
+ { "SGE_CTXT_MASK4", 0x1230, 0 },
+ { "SGE_CTXT_MASK5", 0x1234, 0 },
+ { "SGE_CTXT_MASK6", 0x1238, 0 },
+ { "SGE_CTXT_MASK7", 0x123c, 0 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1300, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1308, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1310, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1318, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1320, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1328, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1330, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1338, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1340, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1348, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1350, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1358, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1360, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1368, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1370, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1378, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1380, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1388, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1390, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1398, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13a0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13a8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13b0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13b8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13c0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13c8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13d0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13d8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13e0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13e8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13f0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x13f8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1400, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1408, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1410, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1418, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1420, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1428, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1430, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1438, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1440, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1448, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1450, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1458, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1460, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1468, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1470, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1478, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1480, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1488, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1490, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1498, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14a0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14a8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14b0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14b8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14c0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14c8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14d0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14d8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14e0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14e8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14f0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x14f8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1500, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1508, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1510, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1518, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1520, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1528, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1530, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1538, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1540, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1548, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1550, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1558, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1560, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1568, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1570, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1578, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1580, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1588, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1590, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1598, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15a0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15a8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15b0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15b8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15c0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15c8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15d0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15d8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15e0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15e8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15f0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x15f8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1600, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1608, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1610, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1618, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1620, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1628, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1630, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1638, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1640, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1648, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1650, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1658, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1660, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1668, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1670, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1678, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1680, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1688, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1690, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1698, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16a0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16a8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16b0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16b8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16c0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16c8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16d0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16d8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16e0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16e8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16f0, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x16f8, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1700, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1708, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1710, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1718, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1720, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1728, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1730, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_HIGH", 0x1738, 0 },
+ { "Egress_Log2Size", 27, 5 },
+ { "Egress_Base", 10, 17 },
+ { "Ingress2_Log2Size", 5, 5 },
+ { "Ingress1_Log2Size", 0, 5 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1304, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x130c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1314, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x131c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1324, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x132c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1334, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x133c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1344, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x134c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1354, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x135c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1364, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x136c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1374, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x137c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1384, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x138c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1394, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x139c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13a4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13ac, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13b4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13bc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13c4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13cc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13d4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13dc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13e4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13ec, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13f4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x13fc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1404, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x140c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1414, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x141c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1424, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x142c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1434, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x143c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1444, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x144c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1454, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x145c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1464, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x146c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1474, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x147c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1484, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x148c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1494, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x149c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14a4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14ac, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14b4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14bc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14c4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14cc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14d4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14dc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14e4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14ec, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14f4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x14fc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1504, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x150c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1514, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x151c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1524, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x152c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1534, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x153c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1544, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x154c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1554, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x155c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1564, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x156c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1574, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x157c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1584, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x158c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1594, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x159c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15a4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15ac, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15b4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15bc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15c4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15cc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15d4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15dc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15e4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15ec, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15f4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x15fc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1604, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x160c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1614, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x161c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1624, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x162c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1634, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x163c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1644, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x164c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1654, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x165c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1664, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x166c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1674, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x167c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1684, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x168c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1694, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x169c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16a4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16ac, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16b4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16bc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16c4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16cc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16d4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16dc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16e4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16ec, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16f4, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x16fc, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1704, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x170c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1714, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x171c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1724, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x172c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x1734, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_QUEUE_BASE_MAP_LOW", 0x173c, 0 },
+ { "Ingress2_Base", 16, 16 },
+ { "Ingress1_Base", 0, 16 },
+ { "SGE_LA_RDPTR_0", 0x1800, 0 },
+ { "SGE_LA_RDDATA_0", 0x1804, 0 },
+ { "SGE_LA_WRPTR_0", 0x1808, 0 },
+ { "SGE_LA_RESERVED_0", 0x180c, 0 },
+ { "SGE_LA_RDPTR_1", 0x1810, 0 },
+ { "SGE_LA_RDDATA_1", 0x1814, 0 },
+ { "SGE_LA_WRPTR_1", 0x1818, 0 },
+ { "SGE_LA_RESERVED_1", 0x181c, 0 },
+ { "SGE_LA_RDPTR_2", 0x1820, 0 },
+ { "SGE_LA_RDDATA_2", 0x1824, 0 },
+ { "SGE_LA_WRPTR_2", 0x1828, 0 },
+ { "SGE_LA_RESERVED_2", 0x182c, 0 },
+ { "SGE_LA_RDPTR_3", 0x1830, 0 },
+ { "SGE_LA_RDDATA_3", 0x1834, 0 },
+ { "SGE_LA_WRPTR_3", 0x1838, 0 },
+ { "SGE_LA_RESERVED_3", 0x183c, 0 },
+ { "SGE_LA_RDPTR_4", 0x1840, 0 },
+ { "SGE_LA_RDDATA_4", 0x1844, 0 },
+ { "SGE_LA_WRPTR_4", 0x1848, 0 },
+ { "SGE_LA_RESERVED_4", 0x184c, 0 },
+ { "SGE_LA_RDPTR_5", 0x1850, 0 },
+ { "SGE_LA_RDDATA_5", 0x1854, 0 },
+ { "SGE_LA_WRPTR_5", 0x1858, 0 },
+ { "SGE_LA_RESERVED_5", 0x185c, 0 },
+ { "SGE_LA_RDPTR_6", 0x1860, 0 },
+ { "SGE_LA_RDDATA_6", 0x1864, 0 },
+ { "SGE_LA_WRPTR_6", 0x1868, 0 },
+ { "SGE_LA_RESERVED_6", 0x186c, 0 },
+ { "SGE_LA_RDPTR_7", 0x1870, 0 },
+ { "SGE_LA_RDDATA_7", 0x1874, 0 },
+ { "SGE_LA_WRPTR_7", 0x1878, 0 },
+ { "SGE_LA_RESERVED_7", 0x187c, 0 },
+ { "SGE_LA_RDPTR_8", 0x1880, 0 },
+ { "SGE_LA_RDDATA_8", 0x1884, 0 },
+ { "SGE_LA_WRPTR_8", 0x1888, 0 },
+ { "SGE_LA_RESERVED_8", 0x188c, 0 },
+ { "SGE_LA_RDPTR_9", 0x1890, 0 },
+ { "SGE_LA_RDDATA_9", 0x1894, 0 },
+ { "SGE_LA_WRPTR_9", 0x1898, 0 },
+ { "SGE_LA_RESERVED_9", 0x189c, 0 },
+ { "SGE_LA_RDPTR_10", 0x18a0, 0 },
+ { "SGE_LA_RDDATA_10", 0x18a4, 0 },
+ { "SGE_LA_WRPTR_10", 0x18a8, 0 },
+ { "SGE_LA_RESERVED_10", 0x18ac, 0 },
+ { "SGE_LA_RDPTR_11", 0x18b0, 0 },
+ { "SGE_LA_RDDATA_11", 0x18b4, 0 },
+ { "SGE_LA_WRPTR_11", 0x18b8, 0 },
+ { "SGE_LA_RESERVED_11", 0x18bc, 0 },
+ { "SGE_LA_RDPTR_12", 0x18c0, 0 },
+ { "SGE_LA_RDDATA_12", 0x18c4, 0 },
+ { "SGE_LA_WRPTR_12", 0x18c8, 0 },
+ { "SGE_LA_RESERVED_12", 0x18cc, 0 },
+ { "SGE_LA_RDPTR_13", 0x18d0, 0 },
+ { "SGE_LA_RDDATA_13", 0x18d4, 0 },
+ { "SGE_LA_WRPTR_13", 0x18d8, 0 },
+ { "SGE_LA_RESERVED_13", 0x18dc, 0 },
+ { "SGE_LA_RDPTR_14", 0x18e0, 0 },
+ { "SGE_LA_RDDATA_14", 0x18e4, 0 },
+ { "SGE_LA_WRPTR_14", 0x18e8, 0 },
+ { "SGE_LA_RESERVED_14", 0x18ec, 0 },
+ { "SGE_LA_RDPTR_15", 0x18f0, 0 },
+ { "SGE_LA_RDDATA_15", 0x18f4, 0 },
+ { "SGE_LA_WRPTR_15", 0x18f8, 0 },
+ { "SGE_LA_RESERVED_15", 0x18fc, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_pcie_regs[] = {
+ { "PCIE_INT_ENABLE", 0x3000, 0 },
+ { "NonFatalErr", 30, 1 },
+ { "UnxSplCplErr", 29, 1 },
+ { "PCIEPINT", 28, 1 },
+ { "PCIESINT", 27, 1 },
+ { "RPLPerr", 26, 1 },
+ { "RxWrPerr", 25, 1 },
+ { "RxCplPerr", 24, 1 },
+ { "PIOTagPerr", 23, 1 },
+ { "MATagPerr", 22, 1 },
+ { "INTXClrPerr", 21, 1 },
+ { "FIDPerr", 20, 1 },
+ { "CfgSnpPerr", 19, 1 },
+ { "HRspPerr", 18, 1 },
+ { "HReqPerr", 17, 1 },
+ { "HCntPerr", 16, 1 },
+ { "DRspPerr", 15, 1 },
+ { "DReqPerr", 14, 1 },
+ { "DCntPerr", 13, 1 },
+ { "CRspPerr", 12, 1 },
+ { "CReqPerr", 11, 1 },
+ { "CCntPerr", 10, 1 },
+ { "TARTagPerr", 9, 1 },
+ { "PIOReqPerr", 8, 1 },
+ { "PIOCplPerr", 7, 1 },
+ { "MSIXDIPerr", 6, 1 },
+ { "MSIXDataPerr", 5, 1 },
+ { "MSIXAddrHPerr", 4, 1 },
+ { "MSIXAddrLPerr", 3, 1 },
+ { "MSIDataPerr", 2, 1 },
+ { "MSIAddrHPerr", 1, 1 },
+ { "MSIAddrLPerr", 0, 1 },
+ { "PCIE_INT_CAUSE", 0x3004, 0 },
+ { "NonFatalErr", 30, 1 },
+ { "UnxSplCplErr", 29, 1 },
+ { "PCIEPINT", 28, 1 },
+ { "PCIESINT", 27, 1 },
+ { "RPLPerr", 26, 1 },
+ { "RxWrPerr", 25, 1 },
+ { "RxCplPerr", 24, 1 },
+ { "PIOTagPerr", 23, 1 },
+ { "MATagPerr", 22, 1 },
+ { "INTXClrPerr", 21, 1 },
+ { "FIDPerr", 20, 1 },
+ { "CfgSnpPerr", 19, 1 },
+ { "HRspPerr", 18, 1 },
+ { "HReqPerr", 17, 1 },
+ { "HCntPerr", 16, 1 },
+ { "DRspPerr", 15, 1 },
+ { "DReqPerr", 14, 1 },
+ { "DCntPerr", 13, 1 },
+ { "CRspPerr", 12, 1 },
+ { "CReqPerr", 11, 1 },
+ { "CCntPerr", 10, 1 },
+ { "TARTagPerr", 9, 1 },
+ { "PIOReqPerr", 8, 1 },
+ { "PIOCplPerr", 7, 1 },
+ { "MSIXDIPerr", 6, 1 },
+ { "MSIXDataPerr", 5, 1 },
+ { "MSIXAddrHPerr", 4, 1 },
+ { "MSIXAddrLPerr", 3, 1 },
+ { "MSIDataPerr", 2, 1 },
+ { "MSIAddrHPerr", 1, 1 },
+ { "MSIAddrLPerr", 0, 1 },
+ { "PCIE_PERR_ENABLE", 0x3008, 0 },
+ { "RPLPerr", 26, 1 },
+ { "RxWrPerr", 25, 1 },
+ { "RxCplPerr", 24, 1 },
+ { "PIOTagPerr", 23, 1 },
+ { "MATagPerr", 22, 1 },
+ { "INTXClrPerr", 21, 1 },
+ { "FIDPerr", 20, 1 },
+ { "CfgSnpPerr", 19, 1 },
+ { "HRspPerr", 18, 1 },
+ { "HReqPerr", 17, 1 },
+ { "HCntPerr", 16, 1 },
+ { "DRspPerr", 15, 1 },
+ { "DReqPerr", 14, 1 },
+ { "DCntPerr", 13, 1 },
+ { "CRspPerr", 12, 1 },
+ { "CReqPerr", 11, 1 },
+ { "CCntPerr", 10, 1 },
+ { "TARTagPerr", 9, 1 },
+ { "PIOReqPerr", 8, 1 },
+ { "PIOCplPerr", 7, 1 },
+ { "MSIXDIPerr", 6, 1 },
+ { "MSIXDataPerr", 5, 1 },
+ { "MSIXAddrHPerr", 4, 1 },
+ { "MSIXAddrLPerr", 3, 1 },
+ { "MSIDataPerr", 2, 1 },
+ { "MSIAddrHPerr", 1, 1 },
+ { "MSIAddrLPerr", 0, 1 },
+ { "PCIE_PERR_INJECT", 0x300c, 0 },
+ { "MemSel", 1, 5 },
+ { "IDE", 0, 1 },
+ { "PCIE_NONFAT_ERR", 0x3010, 0 },
+ { "RdRspErr", 9, 1 },
+ { "VPDRspErr", 8, 1 },
+ { "PopD", 7, 1 },
+ { "PopH", 6, 1 },
+ { "PopC", 5, 1 },
+ { "MemReq", 4, 1 },
+ { "PIOReq", 3, 1 },
+ { "TagDrop", 2, 1 },
+ { "TagCpl", 1, 1 },
+ { "CfgSnp", 0, 1 },
+ { "PCIE_CFG", 0x3014, 0 },
+ { "CfgdMaxPyldSzRx", 26, 3 },
+ { "CfgdMaxPyldSzTx", 23, 3 },
+ { "CfgdMaxRdReqSz", 20, 3 },
+ { "MASyncEn", 19, 1 },
+ { "DCAEnDMA", 18, 1 },
+ { "DCAEnCMD", 17, 1 },
+ { "VFMSIPndEn", 16, 1 },
+ { "ForceTxError", 15, 1 },
+ { "VPDReqProtect", 14, 1 },
+ { "FIDTableInvalid", 13, 1 },
+ { "BypassMSIXCache", 12, 1 },
+ { "BypassMSICache", 11, 1 },
+ { "SimSpeed", 10, 1 },
+ { "TC0_Stamp", 9, 1 },
+ { "AI_TCVal", 6, 3 },
+ { "DMAStopEn", 5, 1 },
+ { "DevStateRstMode", 4, 1 },
+ { "HotRstPCIeCRstMode", 3, 1 },
+ { "DLDnPCIeCRstMode", 2, 1 },
+ { "DLDnPCIePreCRstMode", 1, 1 },
+ { "LinkDnRstEn", 0, 1 },
+ { "PCIE_DMA_CTRL", 0x3018, 0 },
+ { "LittleEndian", 7, 1 },
+ { "PCIE_DMA_CFG", 0x301c, 0 },
+ { "MaxPyldSize", 28, 3 },
+ { "MaxRdReqSize", 25, 3 },
+ { "MaxRspCnt", 16, 9 },
+ { "MaxReqCnt", 8, 8 },
+ { "MaxTag", 0, 7 },
+ { "PCIE_DMA_STAT", 0x3020, 0 },
+ { "StateReq", 28, 4 },
+ { "RspCnt", 16, 12 },
+ { "StateAReq", 13, 3 },
+ { "TagFree", 12, 1 },
+ { "ReqCnt", 0, 11 },
+ { "PCIE_DMA_CFG", 0x3024, 0 },
+ { "MaxPyldSize", 28, 3 },
+ { "MaxRdReqSize", 25, 3 },
+ { "MaxRspCnt", 16, 9 },
+ { "MaxReqCnt", 8, 8 },
+ { "MaxTag", 0, 7 },
+ { "PCIE_DMA_STAT", 0x3028, 0 },
+ { "StateReq", 28, 4 },
+ { "RspCnt", 16, 12 },
+ { "StateAReq", 13, 3 },
+ { "TagFree", 12, 1 },
+ { "ReqCnt", 0, 11 },
+ { "PCIE_DMA_CFG", 0x302c, 0 },
+ { "MaxPyldSize", 28, 3 },
+ { "MaxRdReqSize", 25, 3 },
+ { "MaxRspCnt", 16, 9 },
+ { "MaxReqCnt", 8, 8 },
+ { "MaxTag", 0, 7 },
+ { "PCIE_DMA_STAT", 0x3030, 0 },
+ { "StateReq", 28, 4 },
+ { "RspCnt", 16, 12 },
+ { "StateAReq", 13, 3 },
+ { "TagFree", 12, 1 },
+ { "ReqCnt", 0, 11 },
+ { "PCIE_DMA_CFG", 0x3034, 0 },
+ { "MaxPyldSize", 28, 3 },
+ { "MaxRdReqSize", 25, 3 },
+ { "MaxRspCnt", 16, 9 },
+ { "MaxReqCnt", 8, 8 },
+ { "MaxTag", 0, 7 },
+ { "PCIE_DMA_STAT", 0x3038, 0 },
+ { "StateReq", 28, 4 },
+ { "RspCnt", 16, 12 },
+ { "StateAReq", 13, 3 },
+ { "TagFree", 12, 1 },
+ { "ReqCnt", 0, 11 },
+ { "PCIE_CMD_CTRL", 0x303c, 0 },
+ { "LittleEndian", 7, 1 },
+ { "PCIE_CMD_CFG", 0x3040, 0 },
+ { "MaxPyldSize", 28, 3 },
+ { "MaxRdReqSize", 25, 3 },
+ { "MaxRspCnt", 16, 4 },
+ { "MaxReqCnt", 8, 5 },
+ { "MaxTag", 0, 7 },
+ { "PCIE_CMD_STAT", 0x3044, 0 },
+ { "StateReq", 28, 4 },
+ { "RspCnt", 16, 7 },
+ { "StateAReq", 13, 3 },
+ { "TagFree", 12, 1 },
+ { "ReqCnt", 0, 8 },
+ { "PCIE_CMD_CFG", 0x3048, 0 },
+ { "MaxPyldSize", 28, 3 },
+ { "MaxRdReqSize", 25, 3 },
+ { "MaxRspCnt", 16, 4 },
+ { "MaxReqCnt", 8, 5 },
+ { "MaxTag", 0, 7 },
+ { "PCIE_CMD_STAT", 0x304c, 0 },
+ { "StateReq", 28, 4 },
+ { "RspCnt", 16, 7 },
+ { "StateAReq", 13, 3 },
+ { "TagFree", 12, 1 },
+ { "ReqCnt", 0, 8 },
+ { "PCIE_HMA_CTRL", 0x3050, 0 },
+ { "IPLTSSM", 12, 4 },
+ { "IPConfigDown", 8, 3 },
+ { "LittleEndian", 7, 1 },
+ { "PCIE_HMA_CFG", 0x3054, 0 },
+ { "MaxPyldSize", 28, 3 },
+ { "MaxRdReqSize", 25, 3 },
+ { "MaxRspCnt", 16, 5 },
+ { "MaxReqCnt", 8, 5 },
+ { "MaxTag", 0, 7 },
+ { "PCIE_HMA_STAT", 0x3058, 0 },
+ { "StateReq", 28, 4 },
+ { "RspCnt", 16, 8 },
+ { "StateAReq", 13, 3 },
+ { "TagFree", 12, 1 },
+ { "ReqCnt", 0, 8 },
+ { "PCIE_PIO_FIFO_CFG", 0x305c, 0 },
+ { "CplConfig", 16, 16 },
+ { "PIOStopEn", 12, 1 },
+ { "IPLaneSwap", 11, 1 },
+ { "ForceStrictTS1", 10, 1 },
+ { "ForceProgressCnt", 0, 10 },
+ { "PCIE_CFG_SPACE_REQ", 0x3060, 0 },
+ { "Enable", 30, 1 },
+ { "AI", 29, 1 },
+ { "LocalCfg", 28, 1 },
+ { "Bus", 20, 8 },
+ { "Device", 15, 5 },
+ { "Function", 12, 3 },
+ { "ExtRegister", 8, 4 },
+ { "Register", 0, 8 },
+ { "PCIE_CFG_SPACE_DATA", 0x3064, 0 },
+ { "PCIE_MEM_ACCESS_BASE_WIN", 0x3068, 0 },
+ { "PCIEOfst", 10, 22 },
+ { "BIR", 8, 2 },
+ { "Window", 0, 8 },
+ { "PCIE_MEM_ACCESS_OFFSET", 0x306c, 0 },
+ { "PCIE_MEM_ACCESS_BASE_WIN", 0x3070, 0 },
+ { "PCIEOfst", 10, 22 },
+ { "BIR", 8, 2 },
+ { "Window", 0, 8 },
+ { "PCIE_MEM_ACCESS_OFFSET", 0x3074, 0 },
+ { "PCIE_MEM_ACCESS_BASE_WIN", 0x3078, 0 },
+ { "PCIEOfst", 10, 22 },
+ { "BIR", 8, 2 },
+ { "Window", 0, 8 },
+ { "PCIE_MEM_ACCESS_OFFSET", 0x307c, 0 },
+ { "PCIE_MEM_ACCESS_BASE_WIN", 0x3080, 0 },
+ { "PCIEOfst", 10, 22 },
+ { "BIR", 8, 2 },
+ { "Window", 0, 8 },
+ { "PCIE_MEM_ACCESS_OFFSET", 0x3084, 0 },
+ { "PCIE_MEM_ACCESS_BASE_WIN", 0x3088, 0 },
+ { "PCIEOfst", 10, 22 },
+ { "BIR", 8, 2 },
+ { "Window", 0, 8 },
+ { "PCIE_MEM_ACCESS_OFFSET", 0x308c, 0 },
+ { "PCIE_MEM_ACCESS_BASE_WIN", 0x3090, 0 },
+ { "PCIEOfst", 10, 22 },
+ { "BIR", 8, 2 },
+ { "Window", 0, 8 },
+ { "PCIE_MEM_ACCESS_OFFSET", 0x3094, 0 },
+ { "PCIE_MEM_ACCESS_BASE_WIN", 0x3098, 0 },
+ { "PCIEOfst", 10, 22 },
+ { "BIR", 8, 2 },
+ { "Window", 0, 8 },
+ { "PCIE_MEM_ACCESS_OFFSET", 0x309c, 0 },
+ { "PCIE_MEM_ACCESS_BASE_WIN", 0x30a0, 0 },
+ { "PCIEOfst", 10, 22 },
+ { "BIR", 8, 2 },
+ { "Window", 0, 8 },
+ { "PCIE_MEM_ACCESS_OFFSET", 0x30a4, 0 },
+ { "PCIE_MAILBOX_BASE_WIN", 0x30a8, 0 },
+ { "PCIEOfst", 6, 26 },
+ { "BIR", 4, 2 },
+ { "Window", 0, 2 },
+ { "PCIE_MAILBOX_OFFSET", 0x30ac, 0 },
+ { "PCIE_MA_CTRL", 0x30b0, 0 },
+ { "TagFree", 29, 1 },
+ { "MaxRspCnt", 24, 5 },
+ { "MaxReqCnt", 16, 5 },
+ { "LittleEndian", 15, 1 },
+ { "MaxPyldSize", 12, 3 },
+ { "MaxRdReqSize", 8, 3 },
+ { "MaxTag", 0, 5 },
+ { "PCIE_MA_SYNC", 0x30b4, 0 },
+ { "PCIE_FW", 0x30b8, 0 },
+ { "PCIE_FW_PF", 0x30bc, 0 },
+ { "PCIE_FW_PF", 0x30c0, 0 },
+ { "PCIE_FW_PF", 0x30c4, 0 },
+ { "PCIE_FW_PF", 0x30c8, 0 },
+ { "PCIE_FW_PF", 0x30cc, 0 },
+ { "PCIE_FW_PF", 0x30d0, 0 },
+ { "PCIE_FW_PF", 0x30d4, 0 },
+ { "PCIE_FW_PF", 0x30d8, 0 },
+ { "PCIE_PIO_PAUSE", 0x30dc, 0 },
+ { "PIOPauseDone", 31, 1 },
+ { "PauseTime", 4, 24 },
+ { "PIOPause", 0, 1 },
+ { "PCIE_SYS_CFG_READY", 0x30e0, 0 },
+ { "PCIE_STATIC_CFG1", 0x30e4, 0 },
+ { "LINKDOWN_RESET_EN", 26, 1 },
+ { "IN_WR_DISCONTIG", 25, 1 },
+ { "IN_RD_CPLSIZE", 22, 3 },
+ { "IN_RD_BUFMODE", 20, 2 },
+ { "GBIF_NPTRANS_TOT", 18, 2 },
+ { "IN_PDAT_TOT", 15, 3 },
+ { "PCIE_NPTRANS_TOT", 12, 3 },
+ { "OUT_PDAT_TOT", 9, 3 },
+ { "GBIF_MAX_WRSIZE", 6, 3 },
+ { "GBIF_MAX_RDSIZE", 3, 3 },
+ { "PCIE_MAX_RDSIZE", 0, 3 },
+ { "PCIE_DBG_INDIR_REQ", 0x30ec, 0 },
+ { "Enable", 31, 1 },
+ { "AI", 30, 1 },
+ { "Pointer", 8, 16 },
+ { "Select", 0, 4 },
+ { "PCIE_DBG_INDIR_DATA_0", 0x30f0, 0 },
+ { "PCIE_DBG_INDIR_DATA_1", 0x30f4, 0 },
+ { "PCIE_DBG_INDIR_DATA_2", 0x30f8, 0 },
+ { "PCIE_DBG_INDIR_DATA_3", 0x30fc, 0 },
+ { "PCIE_FUNC_INT_CFG", 0x3100, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3104, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3108, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x310c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3110, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3114, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3118, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x311c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3120, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3124, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3128, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x312c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3130, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3134, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3138, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x313c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3140, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3144, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3148, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x314c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3150, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3154, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3158, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x315c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3160, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3164, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3168, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x316c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3170, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3174, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3178, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x317c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3180, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3184, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3188, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x318c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3190, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3194, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3198, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x319c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31a0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31a4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31a8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31ac, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31b0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31b4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31b8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31bc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31c0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31c4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31c8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31cc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31d0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31d4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31d8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31dc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31e0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31e4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31e8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31ec, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31f0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31f4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x31f8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x31fc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3200, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3204, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3208, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x320c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3210, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3214, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3218, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x321c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3220, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3224, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3228, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x322c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3230, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3234, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3238, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x323c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3240, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3244, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3248, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x324c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3250, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3254, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3258, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x325c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3260, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3264, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3268, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x326c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3270, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3274, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3278, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x327c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3280, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3284, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3288, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x328c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3290, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3294, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3298, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x329c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32a0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32a4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32a8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32ac, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32b0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32b4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32b8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32bc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32c0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32c4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32c8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32cc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32d0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32d4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32d8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32dc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32e0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32e4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32e8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32ec, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32f0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32f4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x32f8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x32fc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3300, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3304, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3308, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x330c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3310, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3314, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3318, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x331c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3320, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3324, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3328, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x332c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3330, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3334, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3338, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x333c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3340, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3344, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3348, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x334c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3350, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3354, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3358, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x335c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3360, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3364, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3368, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x336c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3370, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3374, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3378, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x337c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3380, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3384, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3388, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x338c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3390, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3394, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3398, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x339c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33a0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33a4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33a8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33ac, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33b0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33b4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33b8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33bc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33c0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33c4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33c8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33cc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33d0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33d4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33d8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33dc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33e0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33e4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33e8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33ec, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33f0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33f4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x33f8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x33fc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3400, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3404, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3408, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x340c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3410, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3414, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3418, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x341c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3420, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3424, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3428, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x342c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3430, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3434, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3438, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x343c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3440, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3444, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3448, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x344c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3450, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3454, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3458, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x345c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3460, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3464, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3468, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x346c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3470, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3474, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3478, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x347c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3480, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3484, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3488, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x348c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3490, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3494, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3498, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x349c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34a0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34a4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34a8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34ac, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34b0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34b4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34b8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34bc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34c0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34c4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34c8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34cc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34d0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34d4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34d8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34dc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34e0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34e4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34e8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34ec, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34f0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34f4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x34f8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x34fc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3500, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3504, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3508, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x350c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3510, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3514, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3518, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x351c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3520, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3524, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3528, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x352c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3530, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3534, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3538, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x353c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3540, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3544, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3548, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x354c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3550, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3554, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3558, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x355c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3560, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3564, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3568, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x356c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3570, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3574, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3578, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x357c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3580, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3584, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3588, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x358c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3590, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3594, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3598, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x359c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35a0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35a4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35a8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35ac, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35b0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35b4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35b8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35bc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35c0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35c4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35c8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35cc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35d0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35d4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35d8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35dc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35e0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35e4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35e8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35ec, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35f0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35f4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x35f8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x35fc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3600, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3604, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3608, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x360c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3610, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3614, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3618, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x361c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3620, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3624, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3628, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x362c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3630, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3634, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3638, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x363c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3640, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3644, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3648, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x364c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3650, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3654, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3658, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x365c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3660, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3664, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3668, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x366c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3670, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3674, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3678, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x367c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3680, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3684, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3688, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x368c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3690, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3694, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3698, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x369c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36a0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36a4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36a8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36ac, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36b0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36b4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36b8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36bc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36c0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36c4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36c8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36cc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36d0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36d4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36d8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36dc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36e0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36e4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36e8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36ec, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36f0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36f4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x36f8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x36fc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3700, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3704, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3708, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x370c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3710, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3714, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3718, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x371c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3720, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3724, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3728, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x372c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3730, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3734, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3738, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x373c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3740, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3744, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3748, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x374c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3750, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3754, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3758, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x375c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3760, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3764, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3768, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x376c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3770, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3774, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3778, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x377c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3780, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3784, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3788, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x378c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3790, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3794, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3798, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x379c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37a0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37a4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37a8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37ac, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37b0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37b4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37b8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37bc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37c0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37c4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37c8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37cc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37d0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37d4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37d8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37dc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37e0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37e4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37e8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37ec, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37f0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37f4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x37f8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x37fc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3800, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3804, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3808, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x380c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3810, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3814, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3818, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x381c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3820, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3824, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3828, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x382c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3830, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3834, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3838, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x383c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3840, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3844, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3848, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x384c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3850, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3854, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3858, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x385c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3860, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3864, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3868, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x386c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3870, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3874, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3878, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x387c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3880, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3884, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3888, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x388c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3890, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x3894, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x3898, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x389c, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38a0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38a4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38a8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38ac, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38b0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38b4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38b8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38bc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38c0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38c4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38c8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38cc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38d0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38d4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38d8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38dc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38e0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38e4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38e8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38ec, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38f0, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38f4, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FUNC_INT_CFG", 0x38f8, 0 },
+ { "PBAOfst", 28, 4 },
+ { "TABOfst", 24, 4 },
+ { "VecNum", 12, 10 },
+ { "VecBase", 0, 11 },
+ { "PCIE_FUNC_CTL_STAT", 0x38fc, 0 },
+ { "SendFLRRsp", 31, 1 },
+ { "ImmFLRRsp", 24, 1 },
+ { "TxnDisable", 20, 1 },
+ { "PndTxns", 8, 10 },
+ { "VFVld", 3, 1 },
+ { "PFNum", 0, 3 },
+ { "PCIE_FID", 0x3900, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3904, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3908, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x390c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3910, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3914, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3918, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x391c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3920, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3924, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3928, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x392c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3930, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3934, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3938, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x393c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3940, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3944, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3948, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x394c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3950, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3954, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3958, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x395c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3960, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3964, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3968, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x396c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3970, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3974, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3978, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x397c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3980, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3984, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3988, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x398c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3990, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3994, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3998, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x399c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x39fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3a9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3aa0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3aa4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3aa8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3aac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ab0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ab4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ab8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3abc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ac0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ac4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ac8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3acc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ad0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ad4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ad8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3adc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ae0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ae4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ae8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3aec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3af0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3af4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3af8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3afc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3b9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ba0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ba4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ba8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bb0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bb4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bb8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bbc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bc0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bc4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bc8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bcc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bd0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bd4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bd8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bdc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3be0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3be4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3be8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bf0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bf4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bf8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3bfc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3c9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ca0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ca4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ca8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cb0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cb4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cb8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cbc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cc0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cc4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cc8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ccc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cd0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cd4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cd8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cdc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ce0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ce4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ce8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cf0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cf4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cf8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3cfc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3d9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3da0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3da4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3da8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3db0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3db4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3db8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dbc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dc0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dc4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dc8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dcc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dd0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dd4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dd8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ddc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3de0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3de4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3de8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3df0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3df4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3df8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3dfc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3e9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ea0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ea4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ea8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3eac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3eb0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3eb4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3eb8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ebc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ec0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ec4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ec8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ecc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ed0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ed4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ed8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3edc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ee0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ee4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ee8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3eec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ef0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ef4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ef8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3efc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3f9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fa0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fa4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fa8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fb0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fb4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fb8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fbc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fc0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fc4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fc8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fcc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fd0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fd4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fd8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fdc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fe0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fe4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fe8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3fec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ff0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ff4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ff8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x3ffc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4000, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4004, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4008, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x400c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4010, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4014, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4018, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x401c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4020, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4024, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4028, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x402c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4030, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4034, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4038, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x403c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4040, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4044, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4048, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x404c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4050, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4054, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4058, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x405c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4060, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4064, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4068, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x406c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4070, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4074, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4078, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x407c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4080, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4084, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4088, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x408c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4090, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4094, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4098, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x409c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x40fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4100, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4104, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4108, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x410c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4110, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4114, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4118, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x411c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4120, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4124, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4128, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x412c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4130, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4134, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4138, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x413c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4140, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4144, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4148, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x414c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4150, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4154, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4158, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x415c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4160, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4164, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4168, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x416c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4170, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4174, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4178, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x417c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4180, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4184, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4188, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x418c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4190, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4194, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4198, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x419c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x41fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4200, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4204, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4208, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x420c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4210, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4214, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4218, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x421c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4220, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4224, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4228, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x422c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4230, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4234, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4238, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x423c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4240, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4244, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4248, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x424c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4250, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4254, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4258, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x425c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4260, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4264, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4268, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x426c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4270, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4274, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4278, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x427c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4280, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4284, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4288, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x428c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4290, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4294, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4298, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x429c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x42fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4300, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4304, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4308, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x430c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4310, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4314, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4318, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x431c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4320, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4324, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4328, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x432c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4330, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4334, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4338, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x433c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4340, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4344, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4348, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x434c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4350, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4354, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4358, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x435c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4360, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4364, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4368, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x436c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4370, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4374, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4378, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x437c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4380, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4384, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4388, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x438c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4390, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4394, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4398, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x439c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x43fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4400, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4404, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4408, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x440c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4410, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4414, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4418, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x441c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4420, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4424, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4428, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x442c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4430, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4434, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4438, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x443c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4440, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4444, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4448, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x444c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4450, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4454, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4458, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x445c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4460, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4464, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4468, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x446c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4470, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4474, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4478, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x447c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4480, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4484, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4488, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x448c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4490, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4494, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4498, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x449c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x44fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4500, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4504, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4508, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x450c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4510, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4514, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4518, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x451c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4520, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4524, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4528, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x452c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4530, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4534, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4538, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x453c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4540, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4544, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4548, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x454c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4550, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4554, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4558, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x455c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4560, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4564, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4568, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x456c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4570, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4574, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4578, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x457c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4580, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4584, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4588, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x458c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4590, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4594, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4598, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x459c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x45fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4600, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4604, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4608, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x460c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4610, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4614, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4618, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x461c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4620, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4624, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4628, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x462c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4630, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4634, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4638, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x463c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4640, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4644, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4648, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x464c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4650, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4654, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4658, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x465c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4660, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4664, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4668, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x466c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4670, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4674, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4678, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x467c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4680, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4684, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4688, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x468c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4690, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4694, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4698, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x469c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x46fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4700, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4704, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4708, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x470c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4710, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4714, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4718, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x471c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4720, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4724, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4728, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x472c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4730, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4734, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4738, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x473c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4740, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4744, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4748, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x474c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4750, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4754, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4758, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x475c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4760, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4764, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4768, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x476c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4770, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4774, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4778, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x477c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4780, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4784, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4788, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x478c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4790, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4794, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4798, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x479c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x47fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4800, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4804, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4808, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x480c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4810, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4814, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4818, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x481c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4820, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4824, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4828, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x482c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4830, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4834, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4838, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x483c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4840, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4844, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4848, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x484c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4850, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4854, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4858, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x485c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4860, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4864, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4868, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x486c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4870, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4874, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4878, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x487c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4880, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4884, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4888, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x488c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4890, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4894, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4898, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x489c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x48fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4900, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4904, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4908, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x490c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4910, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4914, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4918, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x491c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4920, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4924, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4928, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x492c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4930, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4934, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4938, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x493c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4940, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4944, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4948, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x494c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4950, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4954, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4958, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x495c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4960, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4964, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4968, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x496c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4970, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4974, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4978, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x497c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4980, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4984, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4988, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x498c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4990, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4994, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4998, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x499c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x49fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4a9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4aa0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4aa4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4aa8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4aac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ab0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ab4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ab8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4abc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ac0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ac4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ac8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4acc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ad0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ad4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ad8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4adc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ae0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ae4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ae8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4aec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4af0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4af4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4af8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4afc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4b9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ba0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ba4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ba8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bb0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bb4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bb8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bbc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bc0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bc4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bc8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bcc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bd0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bd4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bd8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bdc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4be0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4be4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4be8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bf0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bf4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bf8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4bfc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4c9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ca0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ca4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ca8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cb0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cb4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cb8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cbc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cc0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cc4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cc8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ccc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cd0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cd4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cd8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cdc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ce0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ce4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ce8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cf0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cf4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cf8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4cfc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4d9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4da0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4da4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4da8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4db0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4db4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4db8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dbc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dc0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dc4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dc8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dcc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dd0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dd4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dd8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ddc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4de0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4de4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4de8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4df0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4df4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4df8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4dfc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4e9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ea0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ea4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ea8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4eac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4eb0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4eb4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4eb8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ebc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ec0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ec4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ec8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ecc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ed0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ed4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ed8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4edc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ee0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ee4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ee8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4eec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ef0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ef4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ef8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4efc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f00, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f04, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f08, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f0c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f10, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f14, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f18, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f1c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f20, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f24, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f28, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f2c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f30, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f34, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f38, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f3c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f40, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f44, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f48, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f4c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f50, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f54, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f58, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f5c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f60, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f64, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f68, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f6c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f70, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f74, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f78, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f7c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f80, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f84, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f88, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f8c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f90, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f94, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f98, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4f9c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fa0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fa4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fa8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fb0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fb4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fb8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fbc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fc0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fc4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fc8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fcc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fd0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fd4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fd8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fdc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fe0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fe4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fe8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4fec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ff0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ff4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ff8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x4ffc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5000, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5004, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5008, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x500c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5010, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5014, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5018, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x501c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5020, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5024, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5028, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x502c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5030, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5034, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5038, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x503c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5040, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5044, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5048, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x504c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5050, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5054, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5058, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x505c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5060, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5064, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5068, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x506c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5070, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5074, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5078, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x507c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5080, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5084, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5088, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x508c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5090, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5094, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5098, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x509c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x50fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5100, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5104, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5108, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x510c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5110, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5114, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5118, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x511c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5120, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5124, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5128, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x512c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5130, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5134, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5138, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x513c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5140, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5144, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5148, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x514c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5150, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5154, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5158, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x515c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5160, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5164, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5168, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x516c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5170, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5174, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5178, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x517c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5180, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5184, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5188, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x518c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5190, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5194, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5198, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x519c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x51fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5200, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5204, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5208, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x520c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5210, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5214, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5218, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x521c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5220, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5224, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5228, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x522c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5230, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5234, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5238, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x523c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5240, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5244, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5248, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x524c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5250, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5254, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5258, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x525c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5260, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5264, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5268, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x526c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5270, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5274, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5278, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x527c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5280, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5284, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5288, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x528c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5290, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5294, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5298, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x529c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x52fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5300, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5304, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5308, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x530c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5310, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5314, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5318, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x531c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5320, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5324, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5328, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x532c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5330, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5334, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5338, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x533c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5340, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5344, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5348, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x534c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5350, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5354, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5358, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x535c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5360, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5364, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5368, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x536c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5370, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5374, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5378, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x537c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5380, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5384, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5388, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x538c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5390, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5394, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5398, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x539c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x53fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5400, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5404, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5408, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x540c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5410, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5414, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5418, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x541c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5420, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5424, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5428, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x542c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5430, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5434, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5438, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x543c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5440, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5444, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5448, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x544c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5450, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5454, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5458, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x545c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5460, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5464, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5468, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x546c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5470, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5474, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5478, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x547c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5480, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5484, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5488, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x548c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5490, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5494, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5498, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x549c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x54fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5500, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5504, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5508, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x550c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5510, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5514, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5518, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x551c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5520, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5524, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5528, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x552c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5530, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5534, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5538, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x553c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5540, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5544, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5548, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x554c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5550, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5554, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5558, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x555c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5560, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5564, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5568, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x556c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5570, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5574, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5578, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x557c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5580, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5584, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5588, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x558c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5590, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5594, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5598, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x559c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x55fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5600, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5604, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5608, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x560c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5610, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5614, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5618, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x561c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5620, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5624, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5628, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x562c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5630, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5634, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5638, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x563c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5640, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5644, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5648, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x564c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5650, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5654, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5658, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x565c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5660, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5664, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5668, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x566c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5670, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5674, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5678, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x567c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5680, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5684, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5688, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x568c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5690, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5694, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5698, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x569c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x56fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5700, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5704, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5708, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x570c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5710, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5714, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5718, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x571c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5720, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5724, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5728, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x572c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5730, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5734, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5738, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x573c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5740, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5744, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5748, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x574c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5750, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5754, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5758, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x575c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5760, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5764, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5768, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x576c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5770, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5774, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5778, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x577c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5780, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5784, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5788, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x578c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5790, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5794, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5798, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x579c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x57fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5800, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5804, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5808, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x580c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5810, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5814, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5818, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x581c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5820, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5824, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5828, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x582c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5830, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5834, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5838, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x583c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5840, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5844, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5848, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x584c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5850, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5854, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5858, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x585c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5860, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5864, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5868, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x586c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5870, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5874, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5878, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x587c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5880, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5884, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5888, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x588c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5890, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5894, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x5898, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x589c, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58a0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58a4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58a8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58ac, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58b0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58b4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58b8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58bc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58c0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58c4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58c8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58cc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58d0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58d4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58d8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58dc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58e0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58e4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58e8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58ec, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58f0, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58f4, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58f8, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_FID", 0x58fc, 0 },
+ { "Pad", 11, 1 },
+ { "TC", 8, 3 },
+ { "Function", 0, 8 },
+ { "PCIE_REVISION", 0x5a00, 0 },
+ { "PCIE_PDEBUG_INDEX", 0x5a04, 0 },
+ { "PDEBUGSelH", 16, 6 },
+ { "PDEBUGSelL", 0, 6 },
+ { "PCIE_PDEBUG_DATA_HIGH", 0x5a08, 0 },
+ { "PCIE_PDEBUG_DATA_LOW", 0x5a0c, 0 },
+ { "PCIE_CDEBUG_INDEX", 0x5a10, 0 },
+ { "CDEBUGSelH", 16, 8 },
+ { "CDEBUGSelL", 0, 8 },
+ { "PCIE_CDEBUG_DATA_HIGH", 0x5a14, 0 },
+ { "PCIE_CDEBUG_DATA_LOW", 0x5a18, 0 },
+ { "PCIE_DMAW_SOP_CNT", 0x5a1c, 0 },
+ { "CH3", 24, 8 },
+ { "CH2", 16, 8 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_DMAW_EOP_CNT", 0x5a20, 0 },
+ { "CH3", 24, 8 },
+ { "CH2", 16, 8 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_DMAR_REQ_CNT", 0x5a24, 0 },
+ { "CH3", 24, 8 },
+ { "CH2", 16, 8 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_DMAR_RSP_SOP_CNT", 0x5a28, 0 },
+ { "CH3", 24, 8 },
+ { "CH2", 16, 8 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_DMAR_RSP_EOP_CNT", 0x5a2c, 0 },
+ { "CH3", 24, 8 },
+ { "CH2", 16, 8 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_DMAR_RSP_ERR_CNT", 0x5a30, 0 },
+ { "CH3", 24, 8 },
+ { "CH2", 16, 8 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_DMAI_CNT", 0x5a34, 0 },
+ { "CH3", 24, 8 },
+ { "CH2", 16, 8 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_CMDW_CNT", 0x5a38, 0 },
+ { "CH1_EOP", 24, 8 },
+ { "CH1_SOP", 16, 8 },
+ { "CH0_EOP", 8, 8 },
+ { "CH0_SOP", 0, 8 },
+ { "PCIE_CMDR_REQ_CNT", 0x5a3c, 0 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_CMDR_RSP_CNT", 0x5a40, 0 },
+ { "CH1_EOP", 24, 8 },
+ { "CH1_SOP", 16, 8 },
+ { "CH0_EOP", 8, 8 },
+ { "CH0_SOP", 0, 8 },
+ { "PCIE_CMDR_RSP_ERR_CNT", 0x5a44, 0 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "PCIE_HMA_REQ_CNT", 0x5a48, 0 },
+ { "CH0_READ", 16, 8 },
+ { "CH0_WEOP", 8, 8 },
+ { "CH0_WSOP", 0, 8 },
+ { "PCIE_HMA_RSP_CNT", 0x5a4c, 0 },
+ { "CH0_EOP", 8, 8 },
+ { "CH0_SOP", 0, 8 },
+ { "PCIE_DMA10_RSP_FREE", 0x5a50, 0 },
+ { "CH1", 16, 12 },
+ { "CH0", 0, 12 },
+ { "PCIE_DMA32_RSP_FREE", 0x5a54, 0 },
+ { "CH3", 16, 12 },
+ { "CH2", 0, 12 },
+ { "PCIE_CMD_RSP_FREE", 0x5a58, 0 },
+ { "CH1", 16, 7 },
+ { "CH0", 0, 7 },
+ { "PCIE_HMA_RSP_FREE", 0x5a5c, 0 },
+ { "PCIE_BUS_MST_STAT_0", 0x5a60, 0 },
+ { "PCIE_BUS_MST_STAT_1", 0x5a64, 0 },
+ { "PCIE_BUS_MST_STAT_2", 0x5a68, 0 },
+ { "PCIE_BUS_MST_STAT_3", 0x5a6c, 0 },
+ { "PCIE_BUS_MST_STAT_4", 0x5a70, 0 },
+ { "PCIE_BUS_MST_STAT_5", 0x5a74, 0 },
+ { "PCIE_BUS_MST_STAT_6", 0x5a78, 0 },
+ { "PCIE_BUS_MST_STAT_7", 0x5a7c, 0 },
+ { "PCIE_RSP_ERR_STAT_0", 0x5a80, 0 },
+ { "PCIE_RSP_ERR_STAT_1", 0x5a84, 0 },
+ { "PCIE_RSP_ERR_STAT_2", 0x5a88, 0 },
+ { "PCIE_RSP_ERR_STAT_3", 0x5a8c, 0 },
+ { "PCIE_RSP_ERR_STAT_4", 0x5a90, 0 },
+ { "PCIE_RSP_ERR_STAT_5", 0x5a94, 0 },
+ { "PCIE_RSP_ERR_STAT_6", 0x5a98, 0 },
+ { "PCIE_RSP_ERR_STAT_7", 0x5a9c, 0 },
+ { "PCIE_MSI_EN_0", 0x5aa0, 0 },
+ { "PCIE_MSI_EN_1", 0x5aa4, 0 },
+ { "PCIE_MSI_EN_2", 0x5aa8, 0 },
+ { "PCIE_MSI_EN_3", 0x5aac, 0 },
+ { "PCIE_MSI_EN_4", 0x5ab0, 0 },
+ { "PCIE_MSI_EN_5", 0x5ab4, 0 },
+ { "PCIE_MSI_EN_6", 0x5ab8, 0 },
+ { "PCIE_MSI_EN_7", 0x5abc, 0 },
+ { "PCIE_MSIX_EN_0", 0x5ac0, 0 },
+ { "PCIE_MSIX_EN_1", 0x5ac4, 0 },
+ { "PCIE_MSIX_EN_2", 0x5ac8, 0 },
+ { "PCIE_MSIX_EN_3", 0x5acc, 0 },
+ { "PCIE_MSIX_EN_4", 0x5ad0, 0 },
+ { "PCIE_MSIX_EN_5", 0x5ad4, 0 },
+ { "PCIE_MSIX_EN_6", 0x5ad8, 0 },
+ { "PCIE_MSIX_EN_7", 0x5adc, 0 },
+ { "PCIE_DMA_BUF_CTL", 0x5ae0, 0 },
+ { "BufRdCnt", 18, 14 },
+ { "BufWrCnt", 9, 9 },
+ { "MaxBufWrReq", 0, 9 },
+ { "PCIE_DMA_BUF_CTL", 0x5ae8, 0 },
+ { "BufRdCnt", 18, 14 },
+ { "BufWrCnt", 9, 9 },
+ { "MaxBufWrReq", 0, 9 },
+ { "PCIE_DMA_BUF_CTL", 0x5af0, 0 },
+ { "BufRdCnt", 18, 14 },
+ { "BufWrCnt", 9, 9 },
+ { "MaxBufWrReq", 0, 9 },
+ { "PCIE_DMA_BUF_CTL", 0x5af8, 0 },
+ { "BufRdCnt", 18, 14 },
+ { "BufWrCnt", 9, 9 },
+ { "MaxBufWrReq", 0, 9 },
+ { "PCIE_CORE_UTL_SYSTEM_BUS_CONTROL", 0x5900, 0 },
+ { "SMTD", 27, 1 },
+ { "SSTD", 26, 1 },
+ { "SWD0", 23, 1 },
+ { "SWD1", 22, 1 },
+ { "SWD2", 21, 1 },
+ { "SWD3", 20, 1 },
+ { "SWD4", 19, 1 },
+ { "SWD5", 18, 1 },
+ { "SWD6", 17, 1 },
+ { "SWD7", 16, 1 },
+ { "SWD8", 15, 1 },
+ { "SRD0", 13, 1 },
+ { "SRD1", 12, 1 },
+ { "SRD2", 11, 1 },
+ { "SRD3", 10, 1 },
+ { "SRD4", 9, 1 },
+ { "SRD5", 8, 1 },
+ { "SRD6", 7, 1 },
+ { "SRD7", 6, 1 },
+ { "SRD8", 5, 1 },
+ { "CRRE", 3, 1 },
+ { "CRMC", 0, 3 },
+ { "PCIE_CORE_UTL_STATUS", 0x5904, 0 },
+ { "USBP", 31, 1 },
+ { "UPEP", 30, 1 },
+ { "RCEP", 29, 1 },
+ { "EPEP", 28, 1 },
+ { "USBS", 27, 1 },
+ { "UPES", 26, 1 },
+ { "RCES", 25, 1 },
+ { "EPES", 24, 1 },
+ { "PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS", 0x5908, 0 },
+ { "RNPP", 31, 1 },
+ { "RPCP", 29, 1 },
+ { "RCIP", 27, 1 },
+ { "RCCP", 26, 1 },
+ { "RFTP", 23, 1 },
+ { "PTRP", 20, 1 },
+ { "PCIE_CORE_UTL_SYSTEM_BUS_AGENT_ERROR_SEVERITY", 0x590c, 0 },
+ { "RNPS", 31, 1 },
+ { "RPCS", 29, 1 },
+ { "RCIS", 27, 1 },
+ { "RCCS", 26, 1 },
+ { "RFTS", 23, 1 },
+ { "PCIE_CORE_UTL_SYSTEM_BUS_AGENT_INTERRUPT_ENABLE", 0x5910, 0 },
+ { "RNPI", 31, 1 },
+ { "RPCI", 29, 1 },
+ { "RCII", 27, 1 },
+ { "RCCI", 26, 1 },
+ { "RFTI", 23, 1 },
+ { "PCIE_CORE_SYSTEM_BUS_BURST_SIZE_CONFIGURATION", 0x5920, 0 },
+ { "SBRS", 28, 3 },
+ { "OTWS", 20, 3 },
+ { "PCIE_CORE_REVISION_ID", 0x5924, 0 },
+ { "RVID", 20, 12 },
+ { "BRVN", 12, 8 },
+ { "PCIE_CORE_OUTBOUND_POSTED_HEADER_BUFFER_ALLOCATION", 0x5960, 0 },
+ { "OP0H", 24, 4 },
+ { "OP1H", 16, 4 },
+ { "OP2H", 8, 4 },
+ { "OP3H", 0, 4 },
+ { "PCIE_CORE_OUTBOUND_POSTED_DATA_BUFFER_ALLOCATION", 0x5968, 0 },
+ { "OP0D", 24, 7 },
+ { "OP1D", 16, 7 },
+ { "OP2D", 8, 7 },
+ { "OP3D", 0, 7 },
+ { "PCIE_CORE_INBOUND_POSTED_HEADER_BUFFER_ALLOCATION", 0x5970, 0 },
+ { "IP0H", 24, 6 },
+ { "IP1H", 16, 6 },
+ { "IP2H", 8, 6 },
+ { "IP3H", 0, 6 },
+ { "PCIE_CORE_INBOUND_POSTED_DATA_BUFFER_ALLOCATION", 0x5978, 0 },
+ { "IP0D", 24, 8 },
+ { "IP1D", 16, 8 },
+ { "IP2D", 8, 8 },
+ { "IP3D", 0, 8 },
+ { "PCIE_CORE_OUTBOUND_NON_POSTED_BUFFER_ALLOCATION", 0x5980, 0 },
+ { "ON0H", 24, 4 },
+ { "ON1H", 16, 4 },
+ { "ON2H", 8, 4 },
+ { "ON3H", 0, 4 },
+ { "PCIE_CORE_INBOUND_NON_POSTED_REQUESTS_BUFFER_ALLOCATION", 0x5988, 0 },
+ { "IN0H", 24, 6 },
+ { "IN1H", 16, 6 },
+ { "IN2H", 8, 6 },
+ { "IN3H", 0, 6 },
+ { "PCIE_CORE_PCI_EXPRESS_TAGS_ALLOCATION", 0x5990, 0 },
+ { "OC0T", 24, 8 },
+ { "OC1T", 16, 8 },
+ { "OC2T", 8, 8 },
+ { "OC3T", 0, 8 },
+ { "PCIE_CORE_GBIF_READ_TAGS_ALLOCATION", 0x5998, 0 },
+ { "IC0T", 24, 6 },
+ { "IC1T", 16, 6 },
+ { "IC2T", 8, 6 },
+ { "IC3T", 0, 6 },
+ { "PCIE_CORE_UTL_PCI_EXPRESS_PORT_CONTROL", 0x59a0, 0 },
+ { "VRB0", 31, 1 },
+ { "VRB1", 30, 1 },
+ { "VRB2", 29, 1 },
+ { "VRB3", 28, 1 },
+ { "PSFE", 26, 1 },
+ { "RVDE", 25, 1 },
+ { "TXE0", 23, 1 },
+ { "TXE1", 22, 1 },
+ { "TXE2", 21, 1 },
+ { "TXE3", 20, 1 },
+ { "RPAM", 13, 1 },
+ { "RTOS", 4, 4 },
+ { "PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS", 0x59a4, 0 },
+ { "TPCP", 30, 1 },
+ { "TNPP", 29, 1 },
+ { "TFTP", 28, 1 },
+ { "TCAP", 27, 1 },
+ { "TCIP", 26, 1 },
+ { "RCAP", 25, 1 },
+ { "PLUP", 23, 1 },
+ { "PLDN", 22, 1 },
+ { "OTDD", 21, 1 },
+ { "GTRP", 20, 1 },
+ { "RDPE", 18, 1 },
+ { "TDCE", 17, 1 },
+ { "TDUE", 16, 1 },
+ { "PCIE_CORE_UTL_PCI_EXPRESS_PORT_ERROR_SEVERITY", 0x59a8, 0 },
+ { "TPCS", 30, 1 },
+ { "TNPS", 29, 1 },
+ { "TFTS", 28, 1 },
+ { "TCAS", 27, 1 },
+ { "TCIS", 26, 1 },
+ { "RCAS", 25, 1 },
+ { "PLUS", 23, 1 },
+ { "PLDS", 22, 1 },
+ { "OTDS", 21, 1 },
+ { "RDPS", 18, 1 },
+ { "TDCS", 17, 1 },
+ { "TDUS", 16, 1 },
+ { "PCIE_CORE_UTL_PCI_EXPRESS_PORT_INTERRUPT_ENABLE", 0x59ac, 0 },
+ { "TPCI", 30, 1 },
+ { "TNPI", 29, 1 },
+ { "TFTI", 28, 1 },
+ { "TCAI", 27, 1 },
+ { "TCII", 26, 1 },
+ { "RCAI", 25, 1 },
+ { "PLUI", 23, 1 },
+ { "PLDI", 22, 1 },
+ { "OTDI", 21, 1 },
+ { "RDPS", 18, 1 },
+ { "TDCS", 17, 1 },
+ { "TDUS", 16, 1 },
+ { "PCIE_CORE_ROOT_COMPLEX_STATUS", 0x59b0, 0 },
+ { "RLCE", 31, 1 },
+ { "RLNE", 30, 1 },
+ { "RLFE", 29, 1 },
+ { "RCPE", 25, 1 },
+ { "RCTO", 24, 1 },
+ { "PINA", 23, 1 },
+ { "PINB", 22, 1 },
+ { "PINC", 21, 1 },
+ { "PIND", 20, 1 },
+ { "ALER", 19, 1 },
+ { "CRSE", 18, 1 },
+ { "PCIE_CORE_ROOT_COMPLEX_ERROR_SEVERITY", 0x59b4, 0 },
+ { "RLCS", 31, 1 },
+ { "RLNS", 30, 1 },
+ { "RLFS", 29, 1 },
+ { "RCPS", 25, 1 },
+ { "RCTS", 24, 1 },
+ { "PAAS", 23, 1 },
+ { "PABS", 22, 1 },
+ { "PACS", 21, 1 },
+ { "PADS", 20, 1 },
+ { "ALES", 19, 1 },
+ { "CRSS", 18, 1 },
+ { "PCIE_CORE_ROOT_COMPLEX_INTERRUPT_ENABLE", 0x59b8, 0 },
+ { "RLCI", 31, 1 },
+ { "RLNI", 30, 1 },
+ { "RLFI", 29, 1 },
+ { "RCPI", 25, 1 },
+ { "RCTI", 24, 1 },
+ { "PAAI", 23, 1 },
+ { "PABI", 22, 1 },
+ { "PACI", 21, 1 },
+ { "PADI", 20, 1 },
+ { "ALEI", 19, 1 },
+ { "CRSI", 18, 1 },
+ { "PCIE_CORE_ENDPOINT_STATUS", 0x59bc, 0 },
+ { "PTOM", 31, 1 },
+ { "ALEA", 29, 1 },
+ { "PMC0", 23, 1 },
+ { "PMC1", 22, 1 },
+ { "PMC2", 21, 1 },
+ { "PMC3", 20, 1 },
+ { "PMC4", 19, 1 },
+ { "PMC5", 18, 1 },
+ { "PMC6", 17, 1 },
+ { "PMC7", 16, 1 },
+ { "PCIE_CORE_ENDPOINT_ERROR_SEVERITY", 0x59c0, 0 },
+ { "PTOS", 31, 1 },
+ { "AENS", 29, 1 },
+ { "PC0S", 23, 1 },
+ { "PC1S", 22, 1 },
+ { "PC2S", 21, 1 },
+ { "PC3S", 20, 1 },
+ { "PC4S", 19, 1 },
+ { "PC5S", 18, 1 },
+ { "PC6S", 17, 1 },
+ { "PC7S", 16, 1 },
+ { "PME0", 15, 1 },
+ { "PME1", 14, 1 },
+ { "PME2", 13, 1 },
+ { "PME3", 12, 1 },
+ { "PME4", 11, 1 },
+ { "PME5", 10, 1 },
+ { "PME6", 9, 1 },
+ { "PME7", 8, 1 },
+ { "PCIE_CORE_ENDPOINT_INTERRUPT_ENABLE", 0x59c4, 0 },
+ { "PTOI", 31, 1 },
+ { "AENI", 29, 1 },
+ { "PC0I", 23, 1 },
+ { "PC1I", 22, 1 },
+ { "PC2I", 21, 1 },
+ { "PC3I", 20, 1 },
+ { "PC4I", 19, 1 },
+ { "PC5I", 18, 1 },
+ { "PC6I", 17, 1 },
+ { "PC7I", 16, 1 },
+ { "PCIE_CORE_PCI_POWER_MANAGEMENT_CONTROL_1", 0x59c8, 0 },
+ { "TOAK", 31, 1 },
+ { "L1RS", 23, 1 },
+ { "L23S", 22, 1 },
+ { "AL1S", 21, 1 },
+ { "ALET", 19, 1 },
+ { "PCIE_CORE_PCI_POWER_MANAGEMENT_CONTROL_2", 0x59cc, 0 },
+ { "CPM0", 30, 2 },
+ { "CPM1", 28, 2 },
+ { "CPM2", 26, 2 },
+ { "CPM3", 24, 2 },
+ { "CPM4", 22, 2 },
+ { "CPM5", 20, 2 },
+ { "CPM6", 18, 2 },
+ { "CPM7", 16, 2 },
+ { "OPM0", 14, 2 },
+ { "OPM1", 12, 2 },
+ { "OPM2", 10, 2 },
+ { "OPM3", 8, 2 },
+ { "OPM4", 6, 2 },
+ { "OPM5", 4, 2 },
+ { "OPM6", 2, 2 },
+ { "OPM7", 0, 2 },
+ { "PCIE_CORE_GENERAL_PURPOSE_CONTROL_1", 0x59d0, 0 },
+ { "PCIE_CORE_GENERAL_PURPOSE_CONTROL_2", 0x59d4, 0 },
+ { "PCIE_PF_CFG", 0x1e040, 0 },
+ { "INTXStat", 16, 1 },
+ { "AuxPwrPMEn", 15, 1 },
+ { "NoSoftReset", 14, 1 },
+ { "AIVec", 4, 10 },
+ { "INTXType", 2, 2 },
+ { "D3HotEn", 1, 1 },
+ { "CLIDecEn", 0, 1 },
+ { "PCIE_PF_CLI", 0x1e044, 0 },
+ { "PCIE_PF_GEN_MSG", 0x1e048, 0 },
+ { "PCIE_PF_EXPROM_OFST", 0x1e04c, 0 },
+ { "Offset", 10, 14 },
+ { "PCIE_PF_CFG", 0x1e440, 0 },
+ { "INTXStat", 16, 1 },
+ { "AuxPwrPMEn", 15, 1 },
+ { "NoSoftReset", 14, 1 },
+ { "AIVec", 4, 10 },
+ { "INTXType", 2, 2 },
+ { "D3HotEn", 1, 1 },
+ { "CLIDecEn", 0, 1 },
+ { "PCIE_PF_CLI", 0x1e444, 0 },
+ { "PCIE_PF_GEN_MSG", 0x1e448, 0 },
+ { "PCIE_PF_EXPROM_OFST", 0x1e44c, 0 },
+ { "Offset", 10, 14 },
+ { "PCIE_PF_CFG", 0x1e840, 0 },
+ { "INTXStat", 16, 1 },
+ { "AuxPwrPMEn", 15, 1 },
+ { "NoSoftReset", 14, 1 },
+ { "AIVec", 4, 10 },
+ { "INTXType", 2, 2 },
+ { "D3HotEn", 1, 1 },
+ { "CLIDecEn", 0, 1 },
+ { "PCIE_PF_CLI", 0x1e844, 0 },
+ { "PCIE_PF_GEN_MSG", 0x1e848, 0 },
+ { "PCIE_PF_EXPROM_OFST", 0x1e84c, 0 },
+ { "Offset", 10, 14 },
+ { "PCIE_PF_CFG", 0x1ec40, 0 },
+ { "INTXStat", 16, 1 },
+ { "AuxPwrPMEn", 15, 1 },
+ { "NoSoftReset", 14, 1 },
+ { "AIVec", 4, 10 },
+ { "INTXType", 2, 2 },
+ { "D3HotEn", 1, 1 },
+ { "CLIDecEn", 0, 1 },
+ { "PCIE_PF_CLI", 0x1ec44, 0 },
+ { "PCIE_PF_GEN_MSG", 0x1ec48, 0 },
+ { "PCIE_PF_EXPROM_OFST", 0x1ec4c, 0 },
+ { "Offset", 10, 14 },
+ { "PCIE_PF_CFG", 0x1f040, 0 },
+ { "INTXStat", 16, 1 },
+ { "AuxPwrPMEn", 15, 1 },
+ { "NoSoftReset", 14, 1 },
+ { "AIVec", 4, 10 },
+ { "INTXType", 2, 2 },
+ { "D3HotEn", 1, 1 },
+ { "CLIDecEn", 0, 1 },
+ { "PCIE_PF_CLI", 0x1f044, 0 },
+ { "PCIE_PF_GEN_MSG", 0x1f048, 0 },
+ { "PCIE_PF_EXPROM_OFST", 0x1f04c, 0 },
+ { "Offset", 10, 14 },
+ { "PCIE_PF_CFG", 0x1f440, 0 },
+ { "INTXStat", 16, 1 },
+ { "AuxPwrPMEn", 15, 1 },
+ { "NoSoftReset", 14, 1 },
+ { "AIVec", 4, 10 },
+ { "INTXType", 2, 2 },
+ { "D3HotEn", 1, 1 },
+ { "CLIDecEn", 0, 1 },
+ { "PCIE_PF_CLI", 0x1f444, 0 },
+ { "PCIE_PF_GEN_MSG", 0x1f448, 0 },
+ { "PCIE_PF_EXPROM_OFST", 0x1f44c, 0 },
+ { "Offset", 10, 14 },
+ { "PCIE_PF_CFG", 0x1f840, 0 },
+ { "INTXStat", 16, 1 },
+ { "AuxPwrPMEn", 15, 1 },
+ { "NoSoftReset", 14, 1 },
+ { "AIVec", 4, 10 },
+ { "INTXType", 2, 2 },
+ { "D3HotEn", 1, 1 },
+ { "CLIDecEn", 0, 1 },
+ { "PCIE_PF_CLI", 0x1f844, 0 },
+ { "PCIE_PF_GEN_MSG", 0x1f848, 0 },
+ { "PCIE_PF_EXPROM_OFST", 0x1f84c, 0 },
+ { "Offset", 10, 14 },
+ { "PCIE_PF_CFG", 0x1fc40, 0 },
+ { "INTXStat", 16, 1 },
+ { "AuxPwrPMEn", 15, 1 },
+ { "NoSoftReset", 14, 1 },
+ { "AIVec", 4, 10 },
+ { "INTXType", 2, 2 },
+ { "D3HotEn", 1, 1 },
+ { "CLIDecEn", 0, 1 },
+ { "PCIE_PF_CLI", 0x1fc44, 0 },
+ { "PCIE_PF_GEN_MSG", 0x1fc48, 0 },
+ { "PCIE_PF_EXPROM_OFST", 0x1fc4c, 0 },
+ { "Offset", 10, 14 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_dbg_regs[] = {
+ { "DBG_DBG0_CFG", 0x6000, 0 },
+ { "ModuleSelect", 12, 8 },
+ { "RegSelect", 4, 8 },
+ { "ClkSelect", 0, 4 },
+ { "DBG_DBG0_EN", 0x6004, 0 },
+ { "PortEn_PONR", 16, 1 },
+ { "PortEn_POND", 12, 1 },
+ { "SDRHalfWord0", 8, 1 },
+ { "DDREn", 4, 1 },
+ { "PortEn", 0, 1 },
+ { "DBG_DBG1_CFG", 0x6008, 0 },
+ { "ModuleSelect", 12, 8 },
+ { "RegSelect", 4, 8 },
+ { "ClkSelect", 0, 4 },
+ { "DBG_DBG1_EN", 0x600c, 0 },
+ { "PortEn_PONR", 16, 1 },
+ { "PortEn_POND", 12, 1 },
+ { "SDRHalfWord0", 8, 1 },
+ { "DDREn", 4, 1 },
+ { "PortEn", 0, 1 },
+ { "DBG_GPIO_EN", 0x6010, 0 },
+ { "GPIO15_OEn", 31, 1 },
+ { "GPIO14_OEn", 30, 1 },
+ { "GPIO13_OEn", 29, 1 },
+ { "GPIO12_OEn", 28, 1 },
+ { "GPIO11_OEn", 27, 1 },
+ { "GPIO10_OEn", 26, 1 },
+ { "GPIO9_OEn", 25, 1 },
+ { "GPIO8_OEn", 24, 1 },
+ { "GPIO7_OEn", 23, 1 },
+ { "GPIO6_OEn", 22, 1 },
+ { "GPIO5_OEn", 21, 1 },
+ { "GPIO4_OEn", 20, 1 },
+ { "GPIO3_OEn", 19, 1 },
+ { "GPIO2_OEn", 18, 1 },
+ { "GPIO1_OEn", 17, 1 },
+ { "GPIO0_OEn", 16, 1 },
+ { "GPIO15_Out_Val", 15, 1 },
+ { "GPIO14_Out_Val", 14, 1 },
+ { "GPIO13_Out_Val", 13, 1 },
+ { "GPIO12_Out_Val", 12, 1 },
+ { "GPIO11_Out_Val", 11, 1 },
+ { "GPIO10_Out_Val", 10, 1 },
+ { "GPIO9_Out_Val", 9, 1 },
+ { "GPIO8_Out_Val", 8, 1 },
+ { "GPIO7_Out_Val", 7, 1 },
+ { "GPIO6_Out_Val", 6, 1 },
+ { "GPIO5_Out_Val", 5, 1 },
+ { "GPIO4_Out_Val", 4, 1 },
+ { "GPIO3_Out_Val", 3, 1 },
+ { "GPIO2_Out_Val", 2, 1 },
+ { "GPIO1_Out_Val", 1, 1 },
+ { "GPIO0_Out_Val", 0, 1 },
+ { "DBG_GPIO_IN", 0x6014, 0 },
+ { "GPIO15_CHG_DET", 31, 1 },
+ { "GPIO14_CHG_DET", 30, 1 },
+ { "GPIO13_CHG_DET", 29, 1 },
+ { "GPIO12_CHG_DET", 28, 1 },
+ { "GPIO11_CHG_DET", 27, 1 },
+ { "GPIO10_CHG_DET", 26, 1 },
+ { "GPIO9_CHG_DET", 25, 1 },
+ { "GPIO8_CHG_DET", 24, 1 },
+ { "GPIO7_CHG_DET", 23, 1 },
+ { "GPIO6_CHG_DET", 22, 1 },
+ { "GPIO5_CHG_DET", 21, 1 },
+ { "GPIO4_CHG_DET", 20, 1 },
+ { "GPIO3_CHG_DET", 19, 1 },
+ { "GPIO2_CHG_DET", 18, 1 },
+ { "GPIO1_CHG_DET", 17, 1 },
+ { "GPIO0_CHG_DET", 16, 1 },
+ { "GPIO15_IN", 15, 1 },
+ { "GPIO14_IN", 14, 1 },
+ { "GPIO13_IN", 13, 1 },
+ { "GPIO12_IN", 12, 1 },
+ { "GPIO11_IN", 11, 1 },
+ { "GPIO10_IN", 10, 1 },
+ { "GPIO9_IN", 9, 1 },
+ { "GPIO8_IN", 8, 1 },
+ { "GPIO7_IN", 7, 1 },
+ { "GPIO6_IN", 6, 1 },
+ { "GPIO5_IN", 5, 1 },
+ { "GPIO4_IN", 4, 1 },
+ { "GPIO3_IN", 3, 1 },
+ { "GPIO2_IN", 2, 1 },
+ { "GPIO1_IN", 1, 1 },
+ { "GPIO0_IN", 0, 1 },
+ { "DBG_INT_ENABLE", 0x6018, 0 },
+ { "IBM_FDL_FAIL_int_enbl", 25, 1 },
+ { "ARM_FAIL_int_enbl", 24, 1 },
+ { "ARM_ERROR_OUT_int_enbl", 23, 1 },
+ { "pll_lock_lost_int_enbl", 22, 1 },
+ { "C_LOCK", 21, 1 },
+ { "M_LOCK", 20, 1 },
+ { "U_LOCK", 19, 1 },
+ { "PCIe_LOCK", 18, 1 },
+ { "KX_LOCK", 17, 1 },
+ { "KR_LOCK", 16, 1 },
+ { "GPIO15", 15, 1 },
+ { "GPIO14", 14, 1 },
+ { "GPIO13", 13, 1 },
+ { "GPIO12", 12, 1 },
+ { "GPIO11", 11, 1 },
+ { "GPIO10", 10, 1 },
+ { "GPIO9", 9, 1 },
+ { "GPIO8", 8, 1 },
+ { "GPIO7", 7, 1 },
+ { "GPIO6", 6, 1 },
+ { "GPIO5", 5, 1 },
+ { "GPIO4", 4, 1 },
+ { "GPIO3", 3, 1 },
+ { "GPIO2", 2, 1 },
+ { "GPIO1", 1, 1 },
+ { "GPIO0", 0, 1 },
+ { "DBG_INT_CAUSE", 0x601c, 0 },
+ { "IBM_FDL_FAIL_int_cause", 25, 1 },
+ { "ARM_FAIL_int_cause", 24, 1 },
+ { "ARM_ERROR_OUT_int_cause", 23, 1 },
+ { "pll_lock_lost_int_cause", 22, 1 },
+ { "C_LOCK", 21, 1 },
+ { "M_LOCK", 20, 1 },
+ { "U_LOCK", 19, 1 },
+ { "PCIe_LOCK", 18, 1 },
+ { "KX_LOCK", 17, 1 },
+ { "KR_LOCK", 16, 1 },
+ { "GPIO15", 15, 1 },
+ { "GPIO14", 14, 1 },
+ { "GPIO13", 13, 1 },
+ { "GPIO12", 12, 1 },
+ { "GPIO11", 11, 1 },
+ { "GPIO10", 10, 1 },
+ { "GPIO9", 9, 1 },
+ { "GPIO8", 8, 1 },
+ { "GPIO7", 7, 1 },
+ { "GPIO6", 6, 1 },
+ { "GPIO5", 5, 1 },
+ { "GPIO4", 4, 1 },
+ { "GPIO3", 3, 1 },
+ { "GPIO2", 2, 1 },
+ { "GPIO1", 1, 1 },
+ { "GPIO0", 0, 1 },
+ { "DBG_DBG0_RST_VALUE", 0x6020, 0 },
+ { "DBG_OVERWRSERCFG_EN", 0x6024, 0 },
+ { "DBG_PLL_OCLK_PAD_EN", 0x6028, 0 },
+ { "PCIE_OCLK_En", 20, 1 },
+ { "KX_OCLK_En", 16, 1 },
+ { "U_OCLK_En", 12, 1 },
+ { "KR_OCLK_En", 8, 1 },
+ { "M_OCLK_En", 4, 1 },
+ { "C_OCLK_En", 0, 1 },
+ { "DBG_PLL_LOCK", 0x602c, 0 },
+ { "P_LOCK", 20, 1 },
+ { "KX_LOCK", 16, 1 },
+ { "U_LOCK", 12, 1 },
+ { "KR_LOCK", 8, 1 },
+ { "M_LOCK", 4, 1 },
+ { "C_LOCK", 0, 1 },
+ { "DBG_GPIO_ACT_LOW", 0x6030, 0 },
+ { "P_LOCK_ACT_LOW", 21, 1 },
+ { "C_LOCK_ACT_LOW", 20, 1 },
+ { "M_LOCK_ACT_LOW", 19, 1 },
+ { "U_LOCK_ACT_LOW", 18, 1 },
+ { "KR_LOCK_ACT_LOW", 17, 1 },
+ { "KX_LOCK_ACT_LOW", 16, 1 },
+ { "GPIO15_ACT_LOW", 15, 1 },
+ { "GPIO14_ACT_LOW", 14, 1 },
+ { "GPIO13_ACT_LOW", 13, 1 },
+ { "GPIO12_ACT_LOW", 12, 1 },
+ { "GPIO11_ACT_LOW", 11, 1 },
+ { "GPIO10_ACT_LOW", 10, 1 },
+ { "GPIO9_ACT_LOW", 9, 1 },
+ { "GPIO8_ACT_LOW", 8, 1 },
+ { "GPIO7_ACT_LOW", 7, 1 },
+ { "GPIO6_ACT_LOW", 6, 1 },
+ { "GPIO5_ACT_LOW", 5, 1 },
+ { "GPIO4_ACT_LOW", 4, 1 },
+ { "GPIO3_ACT_LOW", 3, 1 },
+ { "GPIO2_ACT_LOW", 2, 1 },
+ { "GPIO1_ACT_LOW", 1, 1 },
+ { "GPIO0_ACT_LOW", 0, 1 },
+ { "DBG_EFUSE_BYTE0_3", 0x6034, 0 },
+ { "DBG_EFUSE_BYTE4_7", 0x6038, 0 },
+ { "DBG_EFUSE_BYTE8_11", 0x603c, 0 },
+ { "DBG_EFUSE_BYTE12_15", 0x6040, 0 },
+ { "DBG_STATIC_U_PLL_CONF", 0x6044, 0 },
+ { "STATIC_U_PLL_MULT", 23, 9 },
+ { "STATIC_U_PLL_PREDIV", 18, 5 },
+ { "STATIC_U_PLL_RANGEA", 14, 4 },
+ { "STATIC_U_PLL_RANGEB", 10, 4 },
+ { "STATIC_U_PLL_TUNE", 0, 10 },
+ { "DBG_STATIC_C_PLL_CONF", 0x6048, 0 },
+ { "STATIC_C_PLL_MULT", 23, 9 },
+ { "STATIC_C_PLL_PREDIV", 18, 5 },
+ { "STATIC_C_PLL_RANGEA", 14, 4 },
+ { "STATIC_C_PLL_RANGEB", 10, 4 },
+ { "STATIC_C_PLL_TUNE", 0, 10 },
+ { "DBG_STATIC_M_PLL_CONF", 0x604c, 0 },
+ { "STATIC_M_PLL_MULT", 23, 9 },
+ { "STATIC_M_PLL_PREDIV", 18, 5 },
+ { "STATIC_M_PLL_RANGEA", 14, 4 },
+ { "STATIC_M_PLL_RANGEB", 10, 4 },
+ { "STATIC_M_PLL_TUNE", 0, 10 },
+ { "DBG_STATIC_KX_PLL_CONF", 0x6050, 0 },
+ { "STATIC_KX_PLL_C", 21, 8 },
+ { "STATIC_KX_PLL_M", 15, 6 },
+ { "STATIC_KX_PLL_N1", 11, 4 },
+ { "STATIC_KX_PLL_N2", 7, 4 },
+ { "STATIC_KX_PLL_N3", 3, 4 },
+ { "STATIC_KX_PLL_P", 0, 3 },
+ { "DBG_STATIC_KR_PLL_CONF", 0x6054, 0 },
+ { "STATIC_KR_PLL_C", 21, 8 },
+ { "STATIC_KR_PLL_M", 15, 6 },
+ { "STATIC_KR_PLL_N1", 11, 4 },
+ { "STATIC_KR_PLL_N2", 7, 4 },
+ { "STATIC_KR_PLL_N3", 3, 4 },
+ { "STATIC_KR_PLL_P", 0, 3 },
+ { "DBG_EXTRA_STATIC_BITS_CONF", 0x6058, 0 },
+ { "STATIC_M_PLL_RESET", 30, 1 },
+ { "STATIC_M_PLL_SLEEP", 29, 1 },
+ { "STATIC_M_PLL_BYPASS", 28, 1 },
+ { "STATIC_MPLL_CLK_SEL", 27, 1 },
+ { "STATIC_U_PLL_SLEEP", 26, 1 },
+ { "STATIC_C_PLL_SLEEP", 25, 1 },
+ { "STATIC_LVDS_CLKOUT_SEL", 23, 2 },
+ { "STATIC_LVDS_CLKOUT_EN", 22, 1 },
+ { "STATIC_CCLK_FREQ_SEL", 20, 2 },
+ { "STATIC_UCLK_FREQ_SEL", 18, 2 },
+ { "ExPHYClk_sel_en", 17, 1 },
+ { "ExPHYClk_sel", 15, 2 },
+ { "STATIC_U_PLL_BYPASS", 14, 1 },
+ { "STATIC_C_PLL_BYPASS", 13, 1 },
+ { "STATIC_KR_PLL_BYPASS", 12, 1 },
+ { "STATIC_KX_PLL_BYPASS", 11, 1 },
+ { "STATIC_KX_PLL_V", 7, 4 },
+ { "STATIC_KR_PLL_V", 3, 4 },
+ { "PSRO_sel", 0, 3 },
+ { "DBG_STATIC_OCLK_MUXSEL_CONF", 0x605c, 0 },
+ { "M_OCLK_MUXSEL", 12, 1 },
+ { "C_OCLK_MUXSEL", 10, 2 },
+ { "U_OCLK_MUXSEL", 8, 2 },
+ { "P_OCLK_MUXSEL", 6, 2 },
+ { "KX_OCLK_MUXSEL", 3, 3 },
+ { "KR_OCLK_MUXSEL", 0, 3 },
+ { "DBG_TRACE0_CONF_COMPREG0", 0x6060, 0 },
+ { "DBG_TRACE0_CONF_COMPREG1", 0x6064, 0 },
+ { "DBG_TRACE1_CONF_COMPREG0", 0x6068, 0 },
+ { "DBG_TRACE1_CONF_COMPREG1", 0x606c, 0 },
+ { "DBG_TRACE0_CONF_MASKREG0", 0x6070, 0 },
+ { "DBG_TRACE0_CONF_MASKREG1", 0x6074, 0 },
+ { "DBG_TRACE1_CONF_MASKREG0", 0x6078, 0 },
+ { "DBG_TRACE1_CONF_MASKREG1", 0x607c, 0 },
+ { "DBG_TRACE_COUNTER", 0x6080, 0 },
+ { "Counter1", 16, 16 },
+ { "Counter0", 0, 16 },
+ { "DBG_STATIC_REFCLK_PERIOD", 0x6084, 0 },
+ { "DBG_TRACE_CONF", 0x6088, 0 },
+ { "dbg_trace_operate_with_trg", 5, 1 },
+ { "dbg_trace_operate_en", 4, 1 },
+ { "dbg_operate_indv_combined", 3, 1 },
+ { "dbg_operate_order_of_trigger", 2, 1 },
+ { "dbg_operate_sgl_dbl_trigger", 1, 1 },
+ { "dbg_operate0_or_1", 0, 1 },
+ { "DBG_TRACE_RDEN", 0x608c, 0 },
+ { "RD_ADDR1", 10, 8 },
+ { "RD_ADDR0", 2, 8 },
+ { "Rd_en1", 1, 1 },
+ { "Rd_en0", 0, 1 },
+ { "DBG_TRACE_WRADDR", 0x6090, 0 },
+ { "Wr_pointer_addr1", 16, 8 },
+ { "Wr_pointer_addr0", 0, 8 },
+ { "DBG_TRACE0_DATA_OUT", 0x6094, 0 },
+ { "DBG_TRACE1_DATA_OUT", 0x6098, 0 },
+ { "DBG_PVT_REG_CALIBRATE_CTL", 0x6100, 0 },
+ { "HALT_CALIBRATE", 1, 1 },
+ { "RESET_CALIBRATE", 0, 1 },
+ { "DBG_PVT_REG_UPDATE_CTL", 0x6104, 0 },
+ { "FAST_UPDATe", 8, 1 },
+ { "FORCE_REG_IN_VALUE", 2, 1 },
+ { "HALT_UPDATe", 1, 1 },
+ { "DBG_PVT_REG_LAST_MEASUREMENT", 0x6108, 0 },
+ { "LAST_MEASUREMENT_SELECT", 8, 2 },
+ { "LAST_MEASUREMENT_RESULT_BANK_B", 4, 4 },
+ { "LAST_MEASUREMENT_RESULT_BANK_A", 0, 4 },
+ { "DBG_PVT_REG_DRVN", 0x610c, 0 },
+ { "PVT_REG_DRVN_EN", 8, 1 },
+ { "PVT_REG_DRVN_B", 4, 4 },
+ { "PVT_REG_DRVN_A", 0, 4 },
+ { "DBG_PVT_REG_DRVP", 0x6110, 0 },
+ { "PVT_REG_DRVP_EN", 8, 1 },
+ { "PVT_REG_DRVP_B", 4, 4 },
+ { "PVT_REG_DRVP_A", 0, 4 },
+ { "DBG_PVT_REG_TERMN", 0x6114, 0 },
+ { "PVT_REG_TERMN_EN", 8, 1 },
+ { "PVT_REG_TERMN_B", 4, 4 },
+ { "PVT_REG_TERMN_A", 0, 4 },
+ { "DBG_PVT_REG_TERMP", 0x6118, 0 },
+ { "PVT_REG_TERMP_EN", 8, 1 },
+ { "PVT_REG_TERMP_B", 4, 4 },
+ { "PVT_REG_TERMP_A", 0, 4 },
+ { "DBG_PVT_REG_THRESHOLD", 0x611c, 0 },
+ { "PVT_CALIBRATION_DONE", 8, 1 },
+ { "THRESHOLD_TERMP_MAX_SYNC", 7, 1 },
+ { "THRESHOLD_TERMP_MIN_SYNC", 6, 1 },
+ { "THRESHOLD_TERMN_MAX_SYNC", 5, 1 },
+ { "THRESHOLD_TERMN_MIN_SYNC", 4, 1 },
+ { "THRESHOLD_DRVP_MAX_SYNC", 3, 1 },
+ { "THRESHOLD_DRVP_MIN_SYNC", 2, 1 },
+ { "THRESHOLD_DRVN_MAX_SYNC", 1, 1 },
+ { "THRESHOLD_DRVN_MIN_SYNC", 0, 1 },
+ { "DBG_PVT_REG_IN_TERMP", 0x6120, 0 },
+ { "REG_IN_TERMP_B", 4, 4 },
+ { "REG_IN_TERMP_A", 0, 4 },
+ { "DBG_PVT_REG_IN_TERMN", 0x6124, 0 },
+ { "REG_IN_TERMN_B", 4, 4 },
+ { "REG_IN_TERMN_A", 0, 4 },
+ { "DBG_PVT_REG_IN_DRVP", 0x6128, 0 },
+ { "REG_IN_DRVP_B", 4, 4 },
+ { "REG_IN_DRVP_A", 0, 4 },
+ { "DBG_PVT_REG_IN_DRVN", 0x612c, 0 },
+ { "REG_IN_DRVN_B", 4, 4 },
+ { "REG_IN_DRVN_A", 0, 4 },
+ { "DBG_PVT_REG_OUT_TERMP", 0x6130, 0 },
+ { "REG_OUT_TERMP_B", 4, 4 },
+ { "REG_OUT_TERMP_A", 0, 4 },
+ { "DBG_PVT_REG_OUT_TERMN", 0x6134, 0 },
+ { "REG_OUT_TERMN_B", 4, 4 },
+ { "REG_OUT_TERMN_A", 0, 4 },
+ { "DBG_PVT_REG_OUT_DRVP", 0x6138, 0 },
+ { "REG_OUT_DRVP_B", 4, 4 },
+ { "REG_OUT_DRVP_A", 0, 4 },
+ { "DBG_PVT_REG_OUT_DRVN", 0x613c, 0 },
+ { "REG_OUT_DRVN_B", 4, 4 },
+ { "REG_OUT_DRVN_A", 0, 4 },
+ { "DBG_PVT_REG_HISTORY_TERMP", 0x6140, 0 },
+ { "termp_b_history", 4, 4 },
+ { "termp_a_history", 0, 4 },
+ { "DBG_PVT_REG_HISTORY_TERMN", 0x6144, 0 },
+ { "TERMN_B_HISTORY", 4, 4 },
+ { "TERMN_A_HISTORY", 0, 4 },
+ { "DBG_PVT_REG_HISTORY_DRVP", 0x6148, 0 },
+ { "DRVP_B_HISTORY", 4, 4 },
+ { "DRVP_A_HISTORY", 0, 4 },
+ { "DBG_PVT_REG_HISTORY_DRVN", 0x614c, 0 },
+ { "DRVN_B_HISTORY", 4, 4 },
+ { "DRVN_A_HISTORY", 0, 4 },
+ { "DBG_PVT_REG_SAMPLE_WAIT_CLKS", 0x6150, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_mc_regs[] = {
+ { "MC_PCTL_SCFG", 0x6200, 0 },
+ { "rkinf_en", 5, 1 },
+ { "dual_pctl_en", 4, 1 },
+ { "slave_mode", 3, 1 },
+ { "loopback_en", 1, 1 },
+ { "hw_low_power_en", 0, 1 },
+ { "MC_PCTL_SCTL", 0x6204, 0 },
+ { "MC_PCTL_STAT", 0x6208, 0 },
+ { "MC_PCTL_MCMD", 0x6240, 0 },
+ { "start_cmd", 31, 1 },
+ { "cmd_add_del", 24, 4 },
+ { "rank_sel", 20, 4 },
+ { "bank_addr", 17, 3 },
+ { "cmd_addr", 4, 13 },
+ { "cmd_opcode", 0, 3 },
+ { "MC_PCTL_POWCTL", 0x6244, 0 },
+ { "MC_PCTL_POWSTAT", 0x6248, 0 },
+ { "phy_calibdone", 1, 1 },
+ { "power_up_done", 0, 1 },
+ { "MC_PCTL_MCFG", 0x6280, 0 },
+ { "tfaw_cfg", 18, 2 },
+ { "pd_exit_mode", 17, 1 },
+ { "pd_type", 16, 1 },
+ { "pd_idle", 8, 8 },
+ { "page_policy", 6, 2 },
+ { "ddr3_en", 5, 1 },
+ { "two_t_en", 3, 1 },
+ { "bl8int_en", 2, 1 },
+ { "mem_bl", 0, 1 },
+ { "MC_PCTL_PPCFG", 0x6284, 0 },
+ { "rpmem_dis", 1, 8 },
+ { "ppmem_en", 0, 1 },
+ { "MC_PCTL_MSTAT", 0x6288, 0 },
+ { "MC_PCTL_ODTCFG", 0x628c, 0 },
+ { "rank3_odt_default", 28, 1 },
+ { "rank3_odt_write_sel", 27, 1 },
+ { "rank3_odt_write_nse", 26, 1 },
+ { "rank3_odt_read_sel", 25, 1 },
+ { "rank3_odt_read_nsel", 24, 1 },
+ { "rank2_odt_default", 20, 1 },
+ { "rank2_odt_write_sel", 19, 1 },
+ { "rank2_odt_write_nsel", 18, 1 },
+ { "rank2_odt_read_sel", 17, 1 },
+ { "rank2_odt_read_nsel", 16, 1 },
+ { "rank1_odt_default", 12, 1 },
+ { "rank1_odt_write_sel", 11, 1 },
+ { "rank1_odt_write_nsel", 10, 1 },
+ { "rank1_odt_read_sel", 9, 1 },
+ { "rank1_odt_read_nsel", 8, 1 },
+ { "rank0_odt_default", 4, 1 },
+ { "rank0_odt_write_sel", 3, 1 },
+ { "rank0_odt_write_nsel", 2, 1 },
+ { "rank0_odt_read_sel", 1, 1 },
+ { "rank0_odt_read_nsel", 0, 1 },
+ { "MC_PCTL_DQSECFG", 0x6290, 0 },
+ { "dv_alat", 20, 4 },
+ { "dv_alen", 16, 2 },
+ { "dse_alat", 12, 4 },
+ { "dse_alen", 8, 2 },
+ { "qse_alat", 4, 4 },
+ { "qse_alen", 0, 2 },
+ { "MC_PCTL_DTUPDES", 0x6294, 0 },
+ { "dtu_rd_missing", 13, 1 },
+ { "dtu_eaffl", 9, 4 },
+ { "dtu_random_error", 8, 1 },
+ { "dtu_error_b7", 7, 1 },
+ { "dtu_err_b6", 6, 1 },
+ { "dtu_err_b5", 5, 1 },
+ { "dtu_err_b4", 4, 1 },
+ { "dtu_err_b3", 3, 1 },
+ { "dtu_err_b2", 2, 1 },
+ { "dtu_err_b1", 1, 1 },
+ { "dtu_err_b0", 0, 1 },
+ { "MC_PCTL_DTUNA", 0x6298, 0 },
+ { "MC_PCTL_DTUNE", 0x629c, 0 },
+ { "MC_PCTL_DTUPRDO", 0x62a0, 0 },
+ { "dtu_allbits_1", 16, 16 },
+ { "dtu_allbits_0", 0, 16 },
+ { "MC_PCTL_DTUPRD1", 0x62a4, 0 },
+ { "dtu_allbits_3", 16, 16 },
+ { "dtu_allbits_2", 0, 16 },
+ { "MC_PCTL_DTUPRD2", 0x62a8, 0 },
+ { "dtu_allbits_5", 16, 16 },
+ { "dtu_allbits_4", 0, 16 },
+ { "MC_PCTL_DTUPRD3", 0x62ac, 0 },
+ { "dtu_allbits_7", 16, 16 },
+ { "dtu_allbits_6", 0, 16 },
+ { "MC_PCTL_DTUAWDT", 0x62b0, 0 },
+ { "number_ranks", 9, 2 },
+ { "row_addr_width", 6, 2 },
+ { "bank_addr_width", 3, 2 },
+ { "column_addr_width", 0, 2 },
+ { "MC_PCTL_TOGCNT1U", 0x62c0, 0 },
+ { "MC_PCTL_TINIT", 0x62c4, 0 },
+ { "MC_PCTL_TRSTH", 0x62c8, 0 },
+ { "MC_PCTL_TOGCNT100N", 0x62cc, 0 },
+ { "MC_PCTL_TREFI", 0x62d0, 0 },
+ { "MC_PCTL_TMRD", 0x62d4, 0 },
+ { "MC_PCTL_TRFC", 0x62d8, 0 },
+ { "MC_PCTL_TRP", 0x62dc, 0 },
+ { "MC_PCTL_TRTW", 0x62e0, 0 },
+ { "MC_PCTL_TAL", 0x62e4, 0 },
+ { "MC_PCTL_TCL", 0x62e8, 0 },
+ { "MC_PCTL_TCWL", 0x62ec, 0 },
+ { "MC_PCTL_TRAS", 0x62f0, 0 },
+ { "MC_PCTL_TRC", 0x62f4, 0 },
+ { "MC_PCTL_TRCD", 0x62f8, 0 },
+ { "MC_PCTL_TRRD", 0x62fc, 0 },
+ { "MC_PCTL_TRTP", 0x6300, 0 },
+ { "MC_PCTL_TWR", 0x6304, 0 },
+ { "MC_PCTL_TWTR", 0x6308, 0 },
+ { "MC_PCTL_TEXSR", 0x630c, 0 },
+ { "MC_PCTL_TXP", 0x6310, 0 },
+ { "MC_PCTL_TXPDLL", 0x6314, 0 },
+ { "MC_PCTL_TZQCS", 0x6318, 0 },
+ { "MC_PCTL_TZQCSI", 0x631c, 0 },
+ { "MC_PCTL_TDQS", 0x6320, 0 },
+ { "MC_PCTL_TCKSRE", 0x6324, 0 },
+ { "MC_PCTL_TCKSRX", 0x6328, 0 },
+ { "MC_PCTL_TCKE", 0x632c, 0 },
+ { "MC_PCTL_TMOD", 0x6330, 0 },
+ { "MC_PCTL_TRSTL", 0x6334, 0 },
+ { "MC_PCTL_TZQCL", 0x6338, 0 },
+ { "MC_PCTL_DWLCFG0", 0x6370, 0 },
+ { "MC_PCTL_DWLCFG1", 0x6374, 0 },
+ { "MC_PCTL_DWLCFG2", 0x6378, 0 },
+ { "MC_PCTL_DWLCFG3", 0x637c, 0 },
+ { "MC_PCTL_ECCCFG", 0x6380, 0 },
+ { "inline_syn_en", 4, 1 },
+ { "ecc_en", 3, 1 },
+ { "ecc_intr_en", 2, 1 },
+ { "MC_PCTL_ECCTST", 0x6384, 0 },
+ { "MC_PCTL_ECCCLR", 0x6388, 0 },
+ { "clr_ecc_log", 1, 1 },
+ { "clr_ecc_intr", 0, 1 },
+ { "MC_PCTL_ECCLOG", 0x638c, 0 },
+ { "MC_PCTL_DTUWACTL", 0x6400, 0 },
+ { "dtu_wr_rank", 30, 2 },
+ { "dtu_wr_row", 13, 17 },
+ { "dtu_wr_bank", 10, 3 },
+ { "dtu_wr_col", 0, 10 },
+ { "MC_PCTL_DTURACTL", 0x6404, 0 },
+ { "dtu_rd_rank", 30, 2 },
+ { "dtu_rd_row", 13, 17 },
+ { "dtu_rd_bank", 10, 3 },
+ { "dtu_rd_col", 0, 10 },
+ { "MC_PCTL_DTUCFG", 0x6408, 0 },
+ { "dtu_row_increments", 16, 7 },
+ { "dtu_wr_multi_rd", 15, 1 },
+ { "dtu_data_mask_en", 14, 1 },
+ { "dtu_target_lane", 10, 4 },
+ { "dtu_generate_random", 9, 1 },
+ { "dtu_incr_banks", 8, 1 },
+ { "dtu_incr_cols", 7, 1 },
+ { "dtu_nalen", 1, 6 },
+ { "dtu_enable", 0, 1 },
+ { "MC_PCTL_DTUECTL", 0x640c, 0 },
+ { "wr_multi_rd_rst", 2, 1 },
+ { "run_error_reports", 1, 1 },
+ { "run_dtu", 0, 1 },
+ { "MC_PCTL_DTUWD0", 0x6410, 0 },
+ { "dtu_wr_byte3", 24, 8 },
+ { "dtu_wr_byte2", 16, 8 },
+ { "dtu_wr_byte1", 8, 8 },
+ { "dtu_wr_byte0", 0, 8 },
+ { "MC_PCTL_DTUWD1", 0x6414, 0 },
+ { "dtu_wr_byte7", 24, 8 },
+ { "dtu_wr_byte6", 16, 8 },
+ { "dtu_wr_byte5", 8, 8 },
+ { "dtu_wr_byte4", 0, 8 },
+ { "MC_PCTL_DTUWD2", 0x6418, 0 },
+ { "dtu_wr_byte11", 24, 8 },
+ { "dtu_wr_byte10", 16, 8 },
+ { "dtu_wr_byte9", 8, 8 },
+ { "dtu_wr_byte8", 0, 8 },
+ { "MC_PCTL_DTUWD3", 0x641c, 0 },
+ { "dtu_wr_byte15", 24, 8 },
+ { "dtu_wr_byte14", 16, 8 },
+ { "dtu_wr_byte13", 8, 8 },
+ { "dtu_wr_byte12", 0, 8 },
+ { "MC_PCTL_DTUWDM", 0x6420, 0 },
+ { "MC_PCTL_DTURD0", 0x6424, 0 },
+ { "dtu_rd_byte3", 24, 8 },
+ { "dtu_rd_byte2", 16, 8 },
+ { "dtu_rd_byte1", 8, 8 },
+ { "dtu_rd_byte0", 0, 8 },
+ { "MC_PCTL_DTURD1", 0x6428, 0 },
+ { "dtu_rd_byte7", 24, 8 },
+ { "dtu_rd_byte6", 16, 8 },
+ { "dtu_rd_byte5", 8, 8 },
+ { "dtu_rd_byte4", 0, 8 },
+ { "MC_PCTL_DTURD2", 0x642c, 0 },
+ { "dtu_rd_byte11", 24, 8 },
+ { "dtu_rd_byte10", 16, 8 },
+ { "dtu_rd_byte9", 8, 8 },
+ { "dtu_rd_byte8", 0, 8 },
+ { "MC_PCTL_DTURD3", 0x6430, 0 },
+ { "dtu_rd_byte15", 24, 8 },
+ { "dtu_rd_byte14", 16, 8 },
+ { "dtu_rd_byte13", 8, 8 },
+ { "dtu_rd_byte12", 0, 8 },
+ { "MC_DTULFSRWD", 0x6434, 0 },
+ { "MC_PCTL_DTULFSRRD", 0x6438, 0 },
+ { "MC_PCTL_DTUEAF", 0x643c, 0 },
+ { "ea_rank", 30, 2 },
+ { "ea_row", 13, 17 },
+ { "ea_bank", 10, 3 },
+ { "ea_column", 0, 10 },
+ { "MC_PCTL_PHYPVTCFG", 0x6500, 0 },
+ { "pvt_upd_req_en", 15, 1 },
+ { "pvt_upd_trig_pol", 14, 1 },
+ { "pvt_upd_trig_type", 12, 1 },
+ { "pvt_upd_done_pol", 10, 1 },
+ { "pvt_upd_done_type", 8, 2 },
+ { "phy_upd_req_en", 7, 1 },
+ { "phy_upd_trig_pol", 6, 1 },
+ { "phy_upd_trig_type", 4, 1 },
+ { "phy_upd_done_pol", 2, 1 },
+ { "phy_upd_done_type", 0, 2 },
+ { "MC_PCTL_PHYPVTSTAT", 0x6504, 0 },
+ { "i_pvt_upd_trig", 5, 1 },
+ { "i_pvt_upd_done", 4, 1 },
+ { "i_phy_upd_trig", 1, 1 },
+ { "i_phy_upd_done", 0, 1 },
+ { "MC_PCTL_PHYTUPDON", 0x6508, 0 },
+ { "MC_PCTL_PHYTUPDDLY", 0x650c, 0 },
+ { "MC_PCTL_PVTTUPON", 0x6510, 0 },
+ { "MC_PCTL_PVTTUPDDLY", 0x6514, 0 },
+ { "MC_PCTL_PHYPVTUPDI", 0x6518, 0 },
+ { "MC_PCTL_PHYIOCRV1", 0x651c, 0 },
+ { "byte_oe_ctl", 16, 2 },
+ { "dyn_soc_odt_alat", 12, 4 },
+ { "dyn_soc_odt_aten", 8, 2 },
+ { "dyn_soc_odt", 2, 1 },
+ { "soc_odt_en", 0, 1 },
+ { "MC_PCTL_PHYTUPDWAIT", 0x6520, 0 },
+ { "MC_PCTL_PVTTUPDWAIT", 0x6524, 0 },
+ { "MC_DDR3PHYAC_GCR", 0x6a00, 0 },
+ { "WLRANK", 8, 2 },
+ { "FDEPTH", 6, 2 },
+ { "LPFDEPTH", 4, 2 },
+ { "LPFEN", 3, 1 },
+ { "WL", 2, 1 },
+ { "CAL", 1, 1 },
+ { "MDLEN", 0, 1 },
+ { "MC_DDR3PHYAC_RCR0", 0x6a04, 0 },
+ { "OCPONR", 8, 1 },
+ { "OCPOND", 7, 1 },
+ { "OCOEN", 6, 1 },
+ { "CKEPONR", 5, 1 },
+ { "CKEPOND", 4, 1 },
+ { "CKEOEN", 3, 1 },
+ { "CKPONR", 2, 1 },
+ { "CKPOND", 1, 1 },
+ { "CKOEN", 0, 1 },
+ { "MC_DDR3PHYAC_ACCR", 0x6a14, 0 },
+ { "ACPONR", 8, 1 },
+ { "ACPOND", 7, 1 },
+ { "ACOEN", 6, 1 },
+ { "CK5PONR", 5, 1 },
+ { "CK5POND", 4, 1 },
+ { "CK5OEN", 3, 1 },
+ { "CK4PONR", 2, 1 },
+ { "CK4POND", 1, 1 },
+ { "CK4OEN", 0, 1 },
+ { "MC_DDR3PHYAC_GSR", 0x6a18, 0 },
+ { "WLERR", 4, 1 },
+ { "INIT", 3, 1 },
+ { "WL", 2, 1 },
+ { "CAL", 1, 1 },
+ { "ACCAL", 0, 1 },
+ { "MC_DDR3PHYAC_ECSR", 0x6a1c, 0 },
+ { "WLDEC", 1, 1 },
+ { "WLINC", 0, 1 },
+ { "MC_DDR3PHYAC_OCSR", 0x6a20, 0 },
+ { "WLDEC", 1, 1 },
+ { "WLINC", 0, 1 },
+ { "MC_DDR3PHYAC_MDIPR", 0x6a24, 0 },
+ { "MC_DDR3PHYAC_MDTPR", 0x6a28, 0 },
+ { "MC_DDR3PHYAC_MDPPR0", 0x6a2c, 0 },
+ { "MC_DDR3PHYAC_MDPPR1", 0x6a30, 0 },
+ { "MC_DDR3PHYAC_PMBDR0", 0x6a34, 0 },
+ { "MC_DDR3PHYAC_PMBDR1", 0x6a38, 0 },
+ { "MC_DDR3PHYAC_ACR", 0x6a60, 0 },
+ { "TSEL", 9, 1 },
+ { "ISEL", 7, 2 },
+ { "CALBYP", 2, 1 },
+ { "SDRSELINV", 1, 1 },
+ { "CKINV", 0, 1 },
+ { "MC_DDR3PHYAC_PSCR", 0x6a64, 0 },
+ { "MC_DDR3PHYAC_PRCR", 0x6a68, 0 },
+ { "PHYINIT", 9, 1 },
+ { "PHYHRST", 7, 1 },
+ { "RSTCLKS", 3, 4 },
+ { "PLLPD", 2, 1 },
+ { "PLLRST", 1, 1 },
+ { "PHYRST", 0, 1 },
+ { "MC_DDR3PHYAC_PLLCR0", 0x6a6c, 0 },
+ { "RSTCXKS", 4, 5 },
+ { "ICPSEL", 3, 1 },
+ { "TESTA", 0, 3 },
+ { "MC_DDR3PHYAC_PLLCR1", 0x6a70, 0 },
+ { "BYPASS", 9, 1 },
+ { "BDIV", 3, 2 },
+ { "TESTD", 0, 3 },
+ { "MC_DDR3PHYAC_CLKENR", 0x6a78, 0 },
+ { "CKCLKEN", 3, 6 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x6b00, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x6b04, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x6b08, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x6b0c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x6b1c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x6b20, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x6b24, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x6b28, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x6b2c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x6b30, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x6b34, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x6b38, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x6b3c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x6b40, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x6b44, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x6b48, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x6b4c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x6b50, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x6b54, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x6b58, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x6b5c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x6b60, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x6b64, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x6b68, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x6b6c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x6b70, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x6b74, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x6b78, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x6b7c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x6b80, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x6b84, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x6bf0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x6bf4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x6bf8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x6c00, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x6c04, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x6c08, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x6c0c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x6c1c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x6c20, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x6c24, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x6c28, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x6c2c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x6c30, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x6c34, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x6c38, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x6c3c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x6c40, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x6c44, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x6c48, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x6c4c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x6c50, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x6c54, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x6c58, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x6c5c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x6c60, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x6c64, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x6c68, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x6c6c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x6c70, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x6c74, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x6c78, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x6c7c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x6c80, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x6c84, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x6cf0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x6cf4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x6cf8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x6d00, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x6d04, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x6d08, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x6d0c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x6d1c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x6d20, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x6d24, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x6d28, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x6d2c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x6d30, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x6d34, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x6d38, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x6d3c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x6d40, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x6d44, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x6d48, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x6d4c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x6d50, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x6d54, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x6d58, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x6d5c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x6d60, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x6d64, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x6d68, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x6d6c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x6d70, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x6d74, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x6d78, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x6d7c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x6d80, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x6d84, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x6df0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x6df4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x6df8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x6e00, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x6e04, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x6e08, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x6e0c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x6e1c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x6e20, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x6e24, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x6e28, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x6e2c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x6e30, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x6e34, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x6e38, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x6e3c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x6e40, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x6e44, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x6e48, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x6e4c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x6e50, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x6e54, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x6e58, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x6e5c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x6e60, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x6e64, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x6e68, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x6e6c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x6e70, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x6e74, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x6e78, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x6e7c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x6e80, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x6e84, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x6ef0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x6ef4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x6ef8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x6f00, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x6f04, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x6f08, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x6f0c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x6f1c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x6f20, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x6f24, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x6f28, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x6f2c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x6f30, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x6f34, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x6f38, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x6f3c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x6f40, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x6f44, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x6f48, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x6f4c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x6f50, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x6f54, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x6f58, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x6f5c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x6f60, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x6f64, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x6f68, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x6f6c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x6f70, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x6f74, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x6f78, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x6f7c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x6f80, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x6f84, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x6ff0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x6ff4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x6ff8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x7000, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x7004, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x7008, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x700c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x701c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x7020, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x7024, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x7028, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x702c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x7030, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x7034, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x7038, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x703c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x7040, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x7044, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x7048, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x704c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x7050, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x7054, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x7058, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x705c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x7060, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x7064, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x7068, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x706c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x7070, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x7074, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x7078, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x707c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x7080, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x7084, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x70f0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x70f4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x70f8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x7100, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x7104, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x7108, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x710c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x711c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x7120, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x7124, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x7128, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x712c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x7130, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x7134, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x7138, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x713c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x7140, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x7144, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x7148, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x714c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x7150, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x7154, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x7158, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x715c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x7160, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x7164, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x7168, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x716c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x7170, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x7174, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x7178, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x717c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x7180, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x7184, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x71f0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x71f4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x71f8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x7200, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x7204, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x7208, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x720c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x721c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x7220, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x7224, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x7228, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x722c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x7230, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x7234, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x7238, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x723c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x7240, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x7244, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x7248, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x724c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x7250, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x7254, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x7258, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x725c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x7260, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x7264, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x7268, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x726c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x7270, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x7274, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x7278, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x727c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x7280, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x7284, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x72f0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x72f4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x72f8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_DDR3PHYDATX8_GCR", 0x7300, 0 },
+ { "PONR", 6, 1 },
+ { "POND", 5, 1 },
+ { "RDBDVT", 4, 1 },
+ { "WDBDVT", 3, 1 },
+ { "RDSDVT", 2, 1 },
+ { "WDSDVT", 1, 1 },
+ { "WLSDVT", 0, 1 },
+ { "MC_DDR3PHYDATX8_WDSDR", 0x7304, 0 },
+ { "MC_DDR3PHYDATX8_WLDPR", 0x7308, 0 },
+ { "MC_DDR3PHYDATX8_WLDR", 0x730c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR0", 0x731c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR1", 0x7320, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR2", 0x7324, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR3", 0x7328, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR4", 0x732c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR5", 0x7330, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR6", 0x7334, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR7", 0x7338, 0 },
+ { "MC_DDR3PHYDATX8_WDBDR8", 0x733c, 0 },
+ { "MC_DDR3PHYDATX8_WDBDMR", 0x7340, 0 },
+ { "MC_DDR3PHYDATX8_RDSDR", 0x7344, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR0", 0x7348, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR1", 0x734c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR2", 0x7350, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR3", 0x7354, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR4", 0x7358, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR5", 0x735c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR6", 0x7360, 0 },
+ { "MC_DDR3PHYDATX8_RDBDR7", 0x7364, 0 },
+ { "MC_DDR3PHYDATX8_RDBDMR", 0x7368, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR0", 0x736c, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR1", 0x7370, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR2", 0x7374, 0 },
+ { "MC_DDR3PHYDATX8_PMBDR3", 0x7378, 0 },
+ { "MC_DDR3PHYDATX8_WDBDPR", 0x737c, 0 },
+ { "MC_DDR3PHYDATX8_RDBDPR", 0x7380, 0 },
+ { "MC_DDR3PHYDATX8_GSR", 0x7384, 0 },
+ { "WLERR", 4, 1 },
+ { "WLDONE", 3, 1 },
+ { "WLCAL", 2, 1 },
+ { "Read", 1, 1 },
+ { "RDQSCAL", 0, 1 },
+ { "MC_DDR3PHYDATX8_ACR", 0x73f0, 0 },
+ { "PHYHRST", 9, 1 },
+ { "WLSTEP", 8, 1 },
+ { "SDRSELINV", 2, 1 },
+ { "DDRSELINV", 1, 1 },
+ { "DSINV", 0, 1 },
+ { "MC_DDR3PHYDATX8_RSR", 0x73f4, 0 },
+ { "WLRANK", 9, 1 },
+ { "RANK", 0, 2 },
+ { "MC_DDR3PHYDATX8_CLKENR", 0x73f8, 0 },
+ { "DTOSEL", 8, 2 },
+ { "HDRCLKEN", 2, 1 },
+ { "SDRCLKEN", 1, 1 },
+ { "DDRCLKEN", 0, 1 },
+ { "MC_PVT_REG_CALIBRATE_CTL", 0x7400, 0 },
+ { "HALT_CALIBRATE", 1, 1 },
+ { "RESET_CALIBRATE", 0, 1 },
+ { "MC_PVT_REG_UPDATE_CTL", 0x7404, 0 },
+ { "FAST_UPDATe", 8, 1 },
+ { "FORCE_REG_IN_VALUE", 2, 1 },
+ { "HALT_UPDATe", 1, 1 },
+ { "MC_PVT_REG_LAST_MEASUREMENT", 0x7408, 0 },
+ { "LAST_MEASUREMENT_SELECT", 8, 2 },
+ { "LAST_MEASUREMENT_RESULT_BANK_B", 4, 4 },
+ { "LAST_MEASUREMENT_RESULT_BANK_A", 0, 4 },
+ { "MC_PVT_REG_DRVN", 0x740c, 0 },
+ { "PVT_REG_DRVN_EN", 8, 1 },
+ { "PVT_REG_DRVN_B", 4, 4 },
+ { "PVT_REG_DRVN_A", 0, 4 },
+ { "MC_PVT_REG_DRVP", 0x7410, 0 },
+ { "PVT_REG_DRVP_EN", 8, 1 },
+ { "PVT_REG_DRVP_B", 4, 4 },
+ { "PVT_REG_DRVP_A", 0, 4 },
+ { "MC_PVT_REG_TERMN", 0x7414, 0 },
+ { "PVT_REG_TERMN_EN", 8, 1 },
+ { "PVT_REG_TERMN_B", 4, 4 },
+ { "PVT_REG_TERMN_A", 0, 4 },
+ { "MC_PVT_REG_TERMP", 0x7418, 0 },
+ { "PVT_REG_TERMP_EN", 8, 1 },
+ { "PVT_REG_TERMP_B", 4, 4 },
+ { "PVT_REG_TERMP_A", 0, 4 },
+ { "MC_PVT_REG_THRESHOLD", 0x741c, 0 },
+ { "PVT_CALIBRATION_DONE", 8, 1 },
+ { "THRESHOLD_TERMP_MAX_SYNC", 7, 1 },
+ { "THRESHOLD_TERMP_MIN_SYNC", 6, 1 },
+ { "THRESHOLD_TERMN_MAX_SYNC", 5, 1 },
+ { "THRESHOLD_TERMN_MIN_SYNC", 4, 1 },
+ { "THRESHOLD_DRVP_MAX_SYNC", 3, 1 },
+ { "THRESHOLD_DRVP_MIN_SYNC", 2, 1 },
+ { "THRESHOLD_DRVN_MAX_SYNC", 1, 1 },
+ { "THRESHOLD_DRVN_MIN_SYNC", 0, 1 },
+ { "MC_PVT_REG_IN_TERMP", 0x7420, 0 },
+ { "REG_IN_TERMP_B", 4, 4 },
+ { "REG_IN_TERMP_A", 0, 4 },
+ { "MC_PVT_REG_IN_TERMN", 0x7424, 0 },
+ { "REG_IN_TERMN_B", 4, 4 },
+ { "REG_IN_TERMN_A", 0, 4 },
+ { "MC_PVT_REG_IN_DRVP", 0x7428, 0 },
+ { "REG_IN_DRVP_B", 4, 4 },
+ { "REG_IN_DRVP_A", 0, 4 },
+ { "MC_PVT_REG_IN_DRVN", 0x742c, 0 },
+ { "REG_IN_DRVN_B", 4, 4 },
+ { "REG_IN_DRVN_A", 0, 4 },
+ { "MC_PVT_REG_OUT_TERMP", 0x7430, 0 },
+ { "REG_OUT_TERMP_B", 4, 4 },
+ { "REG_OUT_TERMP_A", 0, 4 },
+ { "MC_PVT_REG_OUT_TERMN", 0x7434, 0 },
+ { "REG_OUT_TERMN_B", 4, 4 },
+ { "REG_OUT_TERMN_A", 0, 4 },
+ { "MC_PVT_REG_OUT_DRVP", 0x7438, 0 },
+ { "REG_OUT_DRVP_B", 4, 4 },
+ { "REG_OUT_DRVP_A", 0, 4 },
+ { "MC_PVT_REG_OUT_DRVN", 0x743c, 0 },
+ { "REG_OUT_DRVN_B", 4, 4 },
+ { "REG_OUT_DRVN_A", 0, 4 },
+ { "MC_PVT_REG_HISTORY_TERMP", 0x7440, 0 },
+ { "termp_b_history", 4, 4 },
+ { "termp_a_history", 0, 4 },
+ { "MC_PVT_REG_HISTORY_TERMN", 0x7444, 0 },
+ { "TERMN_B_HISTORY", 4, 4 },
+ { "TERMN_A_HISTORY", 0, 4 },
+ { "MC_PVT_REG_HISTORY_DRVP", 0x7448, 0 },
+ { "DRVP_B_HISTORY", 4, 4 },
+ { "DRVP_A_HISTORY", 0, 4 },
+ { "MC_PVT_REG_HISTORY_DRVN", 0x744c, 0 },
+ { "DRVN_B_HISTORY", 4, 4 },
+ { "DRVN_A_HISTORY", 0, 4 },
+ { "MC_PVT_REG_SAMPLE_WAIT_CLKS", 0x7450, 0 },
+ { "MC_DDRPHY_RST_CTRL", 0x7500, 0 },
+ { "DDRIO_ENABLE", 1, 1 },
+ { "PHY_RST_N", 0, 1 },
+ { "MC_PERFORMANCE_CTRL", 0x7504, 0 },
+ { "STALL_CHK_BIT", 2, 1 },
+ { "DDR3_BRC_MODE", 1, 1 },
+ { "RMW_PERF_CTRL", 0, 1 },
+ { "MC_ECC_CTRL", 0x7508, 0 },
+ { "ECC_BYPASS_BIST", 1, 1 },
+ { "ECC_DISABLE", 0, 1 },
+ { "MC_PAR_ENABLE", 0x750c, 0 },
+ { "ECC_UE_PAR_ENABLE", 3, 1 },
+ { "ECC_CE_PAR_ENABLE", 2, 1 },
+ { "PERR_REG_INT_ENABLE", 1, 1 },
+ { "PERR_BLK_INT_ENABLE", 0, 1 },
+ { "MC_PAR_CAUSE", 0x7510, 0 },
+ { "ECC_UE_PAR_CAUSE", 3, 1 },
+ { "ECC_CE_PAR_CAUSE", 2, 1 },
+ { "FIFOR_PAR_CAUSE", 1, 1 },
+ { "RDATA_FIFOR_PAR_CAUSE", 0, 1 },
+ { "MC_INT_ENABLE", 0x7514, 0 },
+ { "ECC_UE_INT_ENABLE", 2, 1 },
+ { "ECC_CE_INT_ENABLE", 1, 1 },
+ { "PERR_INT_ENABLE", 0, 1 },
+ { "MC_INT_CAUSE", 0x7518, 0 },
+ { "ECC_UE_INT_CAUSE", 2, 1 },
+ { "ECC_CE_INT_CAUSE", 1, 1 },
+ { "PERR_INT_CAUSE", 0, 1 },
+ { "MC_ECC_STATUS", 0x751c, 0 },
+ { "ECC_CECNT", 16, 16 },
+ { "ECC_UECNT", 0, 16 },
+ { "MC_PHY_CTRL", 0x7520, 0 },
+ { "MC_STATIC_CFG_STATUS", 0x7524, 0 },
+ { "STATIC_MODE", 9, 1 },
+ { "STATIC_DEN", 6, 3 },
+ { "STATIC_ORG", 5, 1 },
+ { "STATIC_RKS", 4, 1 },
+ { "STATIC_WIDTH", 1, 3 },
+ { "STATIC_SLOW", 0, 1 },
+ { "MC_CORE_PCTL_STAT", 0x7528, 0 },
+ { "MC_DEBUG_CNT", 0x752c, 0 },
+ { "WDATA_OCNT", 8, 5 },
+ { "RDATA_OCNT", 0, 5 },
+ { "MC_BONUS", 0x7530, 0 },
+ { "MC_BIST_CMD", 0x7600, 0 },
+ { "START_BIST", 31, 1 },
+ { "BIST_CMD_GAP", 8, 8 },
+ { "BIST_OPCODE", 0, 2 },
+ { "MC_BIST_CMD_ADDR", 0x7604, 0 },
+ { "MC_BIST_CMD_LEN", 0x7608, 0 },
+ { "MC_BIST_DATA_PATTERN", 0x760c, 0 },
+ { "MC_BIST_USER_WDATA0", 0x7614, 0 },
+ { "MC_BIST_USER_WDATA1", 0x7618, 0 },
+ { "MC_BIST_USER_WDATA2", 0x761c, 0 },
+ { "MC_BIST_NUM_ERR", 0x7680, 0 },
+ { "MC_BIST_ERR_FIRST_ADDR", 0x7684, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x7688, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x768c, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x7690, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x7694, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x7698, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x769c, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76a0, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76a4, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76a8, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76ac, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76b0, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76b4, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76b8, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76bc, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76c0, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76c4, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76c8, 0 },
+ { "MC_BIST_STATUS_RDATA", 0x76cc, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_ma_regs[] = {
+ { "MA_CLIENT0_RD_LATENCY_THRESHOLD", 0x7700, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT0_WR_LATENCY_THRESHOLD", 0x7704, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT1_RD_LATENCY_THRESHOLD", 0x7708, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT1_WR_LATENCY_THRESHOLD", 0x770c, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT2_RD_LATENCY_THRESHOLD", 0x7710, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT2_WR_LATENCY_THRESHOLD", 0x7714, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT3_RD_LATENCY_THRESHOLD", 0x7718, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT3_WR_LATENCY_THRESHOLD", 0x771c, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT4_RD_LATENCY_THRESHOLD", 0x7720, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT4_WR_LATENCY_THRESHOLD", 0x7724, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT5_RD_LATENCY_THRESHOLD", 0x7728, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT5_WR_LATENCY_THRESHOLD", 0x772c, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT6_RD_LATENCY_THRESHOLD", 0x7730, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT6_WR_LATENCY_THRESHOLD", 0x7734, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT7_RD_LATENCY_THRESHOLD", 0x7738, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT7_WR_LATENCY_THRESHOLD", 0x773c, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT8_RD_LATENCY_THRESHOLD", 0x7740, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT8_WR_LATENCY_THRESHOLD", 0x7744, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT9_RD_LATENCY_THRESHOLD", 0x7748, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT9_WR_LATENCY_THRESHOLD", 0x774c, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT10_RD_LATENCY_THRESHOLD", 0x7750, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT10_WR_LATENCY_THRESHOLD", 0x7754, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT11_RD_LATENCY_THRESHOLD", 0x7758, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT11_WR_LATENCY_THRESHOLD", 0x775c, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT12_RD_LATENCY_THRESHOLD", 0x7760, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_CLIENT12_WR_LATENCY_THRESHOLD", 0x7764, 0 },
+ { "THRESHOLD1", 17, 15 },
+ { "THRESHOLD1_EN", 16, 1 },
+ { "THRESHOLD0", 1, 15 },
+ { "THRESHOLD0_EN", 0, 1 },
+ { "MA_SGE_TH0_DEBUG_CNT", 0x7768, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_SGE_TH1_DEBUG_CNT", 0x776c, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_ULPTX_DEBUG_CNT", 0x7770, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_ULPRX_DEBUG_CNT", 0x7774, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_ULPTXRX_DEBUG_CNT", 0x7778, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_TP_TH0_DEBUG_CNT", 0x777c, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_TP_TH1_DEBUG_CNT", 0x7780, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_LE_DEBUG_CNT", 0x7784, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_CIM_DEBUG_CNT", 0x7788, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_PCIE_DEBUG_CNT", 0x778c, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_PMTX_DEBUG_CNT", 0x7790, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_PMRX_DEBUG_CNT", 0x7794, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_HMA_DEBUG_CNT", 0x7798, 0 },
+ { "DBG_READ_DATA_CNT", 24, 8 },
+ { "DBG_READ_REQ_CNT", 16, 8 },
+ { "DBG_WRITE_DATA_CNT", 8, 8 },
+ { "DBG_WRITE_REQ_CNT", 0, 8 },
+ { "MA_EDRAM0_BAR", 0x77c0, 0 },
+ { "EDRAM0_BASE", 16, 12 },
+ { "EDRAM0_SIZE", 0, 12 },
+ { "MA_EDRAM1_BAR", 0x77c4, 0 },
+ { "EDRAM1_BASE", 16, 12 },
+ { "EDRAM1_SIZE", 0, 12 },
+ { "MA_EXT_MEMORY_BAR", 0x77c8, 0 },
+ { "EXT_MEM_BASE", 16, 12 },
+ { "EXT_MEM_SIZE", 0, 12 },
+ { "MA_HOST_MEMORY_BAR", 0x77cc, 0 },
+ { "HMA_BASE", 16, 12 },
+ { "HMA_SIZE", 0, 12 },
+ { "MA_EXT_MEM_PAGE_SIZE", 0x77d0, 0 },
+ { "BRC_MODE", 2, 1 },
+ { "EXT_MEM_PAGE_SIZE", 0, 2 },
+ { "MA_ARB_CTRL", 0x77d4, 0 },
+ { "DIS_PAGE_HINT", 1, 1 },
+ { "DIS_ADV_ARB", 0, 1 },
+ { "MA_TARGET_MEM_ENABLE", 0x77d8, 0 },
+ { "HMA_ENABLE", 3, 1 },
+ { "EXT_MEM_ENABLE", 2, 1 },
+ { "EDRAM1_ENABLE", 1, 1 },
+ { "EDRAM0_ENABLE", 0, 1 },
+ { "MA_INT_ENABLE", 0x77dc, 0 },
+ { "MEM_PERR_INT_ENABLE", 1, 1 },
+ { "MEM_WRAP_INT_ENABLE", 0, 1 },
+ { "MA_INT_CAUSE", 0x77e0, 0 },
+ { "MEM_PERR_INT_CAUSE", 1, 1 },
+ { "MEM_WRAP_INT_CAUSE", 0, 1 },
+ { "MA_INT_WRAP_STATUS", 0x77e4, 0 },
+ { "MEM_WRAP_ADDRESS", 4, 28 },
+ { "MEM_WRAP_CLIENT_NUM", 0, 4 },
+ { "MA_TP_THREAD1_MAPPER", 0x77e8, 0 },
+ { "MA_SGE_THREAD1_MAPPER", 0x77ec, 0 },
+ { "MA_PARITY_ERROR_ENABLE", 0x77f0, 0 },
+ { "TP_DMARBT_PAR_ERROR_EN", 31, 1 },
+ { "LOGIC_FIFO_PAR_ERROR_EN", 30, 1 },
+ { "ARB3_PAR_WRQUEUE_ERROR_EN", 29, 1 },
+ { "ARB2_PAR_WRQUEUE_ERROR_EN", 28, 1 },
+ { "ARB1_PAR_WRQUEUE_ERROR_EN", 27, 1 },
+ { "ARB0_PAR_WRQUEUE_ERROR_EN", 26, 1 },
+ { "ARB3_PAR_RDQUEUE_ERROR_EN", 25, 1 },
+ { "ARB2_PAR_RDQUEUE_ERROR_EN", 24, 1 },
+ { "ARB1_PAR_RDQUEUE_ERROR_EN", 23, 1 },
+ { "ARB0_PAR_RDQUEUE_ERROR_EN", 22, 1 },
+ { "CL10_PAR_WRQUEUE_ERROR_EN", 21, 1 },
+ { "CL9_PAR_WRQUEUE_ERROR_EN", 20, 1 },
+ { "CL8_PAR_WRQUEUE_ERROR_EN", 19, 1 },
+ { "CL7_PAR_WRQUEUE_ERROR_EN", 18, 1 },
+ { "CL6_PAR_WRQUEUE_ERROR_EN", 17, 1 },
+ { "CL5_PAR_WRQUEUE_ERROR_EN", 16, 1 },
+ { "CL4_PAR_WRQUEUE_ERROR_EN", 15, 1 },
+ { "CL3_PAR_WRQUEUE_ERROR_EN", 14, 1 },
+ { "CL2_PAR_WRQUEUE_ERROR_EN", 13, 1 },
+ { "CL1_PAR_WRQUEUE_ERROR_EN", 12, 1 },
+ { "CL0_PAR_WRQUEUE_ERROR_EN", 11, 1 },
+ { "CL10_PAR_RDQUEUE_ERROR_EN", 10, 1 },
+ { "CL9_PAR_RDQUEUE_ERROR_EN", 9, 1 },
+ { "CL8_PAR_RDQUEUE_ERROR_EN", 8, 1 },
+ { "CL7_PAR_RDQUEUE_ERROR_EN", 7, 1 },
+ { "CL6_PAR_RDQUEUE_ERROR_EN", 6, 1 },
+ { "CL5_PAR_RDQUEUE_ERROR_EN", 5, 1 },
+ { "CL4_PAR_RDQUEUE_ERROR_EN", 4, 1 },
+ { "CL3_PAR_RDQUEUE_ERROR_EN", 3, 1 },
+ { "CL2_PAR_RDQUEUE_ERROR_EN", 2, 1 },
+ { "CL1_PAR_RDQUEUE_ERROR_EN", 1, 1 },
+ { "CL0_PAR_RDQUEUE_ERROR_EN", 0, 1 },
+ { "MA_PARITY_ERROR_STATUS", 0x77f4, 0 },
+ { "TP_DMARBT_PAR_ERROR", 31, 1 },
+ { "LOGIC_FIFO_PAR_ERROR", 30, 1 },
+ { "ARB3_PAR_WRQUEUE_ERROR", 29, 1 },
+ { "ARB2_PAR_WRQUEUE_ERROR", 28, 1 },
+ { "ARB1_PAR_WRQUEUE_ERROR", 27, 1 },
+ { "ARB0_PAR_WRQUEUE_ERROR", 26, 1 },
+ { "ARB3_PAR_RDQUEUE_ERROR", 25, 1 },
+ { "ARB2_PAR_RDQUEUE_ERROR", 24, 1 },
+ { "ARB1_PAR_RDQUEUE_ERROR", 23, 1 },
+ { "ARB0_PAR_RDQUEUE_ERROR", 22, 1 },
+ { "CL10_PAR_WRQUEUE_ERROR", 21, 1 },
+ { "CL9_PAR_WRQUEUE_ERROR", 20, 1 },
+ { "CL8_PAR_WRQUEUE_ERROR", 19, 1 },
+ { "CL7_PAR_WRQUEUE_ERROR", 18, 1 },
+ { "CL6_PAR_WRQUEUE_ERROR", 17, 1 },
+ { "CL5_PAR_WRQUEUE_ERROR", 16, 1 },
+ { "CL4_PAR_WRQUEUE_ERROR", 15, 1 },
+ { "CL3_PAR_WRQUEUE_ERROR", 14, 1 },
+ { "CL2_PAR_WRQUEUE_ERROR", 13, 1 },
+ { "CL1_PAR_WRQUEUE_ERROR", 12, 1 },
+ { "CL0_PAR_WRQUEUE_ERROR", 11, 1 },
+ { "CL10_PAR_RDQUEUE_ERROR", 10, 1 },
+ { "CL9_PAR_RDQUEUE_ERROR", 9, 1 },
+ { "CL8_PAR_RDQUEUE_ERROR", 8, 1 },
+ { "CL7_PAR_RDQUEUE_ERROR", 7, 1 },
+ { "CL6_PAR_RDQUEUE_ERROR", 6, 1 },
+ { "CL5_PAR_RDQUEUE_ERROR", 5, 1 },
+ { "CL4_PAR_RDQUEUE_ERROR", 4, 1 },
+ { "CL3_PAR_RDQUEUE_ERROR", 3, 1 },
+ { "CL2_PAR_RDQUEUE_ERROR", 2, 1 },
+ { "CL1_PAR_RDQUEUE_ERROR", 1, 1 },
+ { "CL0_PAR_RDQUEUE_ERROR", 0, 1 },
+ { "MA_SGE_PCIE_COHERANCY_CTRL", 0x77f8, 0 },
+ { "BONUS_REG", 6, 26 },
+ { "COHERANCY_CMD_TYPE", 4, 2 },
+ { "COHERANCY_THREAD_NUM", 1, 3 },
+ { "COHERANCY_ENABLE", 0, 1 },
+ { "MA_ERROR_ENABLE", 0x77fc, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_edc_0_regs[] = {
+ { "EDC_REF", 0x7900, 0 },
+ { "EDC_INST_NUM", 18, 1 },
+ { "ENABLE_PERF", 17, 1 },
+ { "ECC_BYPASS", 16, 1 },
+ { "RefFreq", 0, 16 },
+ { "EDC_BIST_CMD", 0x7904, 0 },
+ { "START_BIST", 31, 1 },
+ { "BIST_CMD_GAP", 8, 8 },
+ { "BIST_OPCODE", 0, 2 },
+ { "EDC_BIST_CMD_ADDR", 0x7908, 0 },
+ { "EDC_BIST_CMD_LEN", 0x790c, 0 },
+ { "EDC_BIST_DATA_PATTERN", 0x7910, 0 },
+ { "EDC_BIST_USER_WDATA0", 0x7914, 0 },
+ { "EDC_BIST_USER_WDATA1", 0x7918, 0 },
+ { "EDC_BIST_USER_WDATA2", 0x791c, 0 },
+ { "EDC_BIST_NUM_ERR", 0x7920, 0 },
+ { "EDC_BIST_ERR_FIRST_ADDR", 0x7924, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7928, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x792c, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7930, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7934, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7938, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x793c, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7940, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7944, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7948, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x794c, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7950, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7954, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7958, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x795c, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7960, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7964, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x7968, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x796c, 0 },
+ { "EDC_PAR_ENABLE", 0x7970, 0 },
+ { "ECC_UE_PAR_ENABLE", 2, 1 },
+ { "ECC_CE_PAR_ENABLE", 1, 1 },
+ { "PERR_INT_ENABLE", 0, 1 },
+ { "EDC_INT_ENABLE", 0x7974, 0 },
+ { "ECC_UE_INT_ENABLE", 2, 1 },
+ { "ECC_CE_INT_ENABLE", 1, 1 },
+ { "PERR_INT_ENABLE", 0, 1 },
+ { "EDC_INT_CAUSE", 0x7978, 0 },
+ { "ECC_UE_PAR_CAUSE", 5, 1 },
+ { "ECC_CE_PAR_CAUSE", 4, 1 },
+ { "PERR_PAR_CAUSE", 3, 1 },
+ { "ECC_UE_INT_CAUSE", 2, 1 },
+ { "ECC_CE_INT_CAUSE", 1, 1 },
+ { "PERR_INT_CAUSE", 0, 1 },
+ { "EDC_ECC_STATUS", 0x797c, 0 },
+ { "ECC_CECNT", 16, 16 },
+ { "ECC_UECNT", 0, 16 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_edc_1_regs[] = {
+ { "EDC_REF", 0x7980, 0 },
+ { "EDC_INST_NUM", 18, 1 },
+ { "ENABLE_PERF", 17, 1 },
+ { "ECC_BYPASS", 16, 1 },
+ { "RefFreq", 0, 16 },
+ { "EDC_BIST_CMD", 0x7984, 0 },
+ { "START_BIST", 31, 1 },
+ { "BIST_CMD_GAP", 8, 8 },
+ { "BIST_OPCODE", 0, 2 },
+ { "EDC_BIST_CMD_ADDR", 0x7988, 0 },
+ { "EDC_BIST_CMD_LEN", 0x798c, 0 },
+ { "EDC_BIST_DATA_PATTERN", 0x7990, 0 },
+ { "EDC_BIST_USER_WDATA0", 0x7994, 0 },
+ { "EDC_BIST_USER_WDATA1", 0x7998, 0 },
+ { "EDC_BIST_USER_WDATA2", 0x799c, 0 },
+ { "EDC_BIST_NUM_ERR", 0x79a0, 0 },
+ { "EDC_BIST_ERR_FIRST_ADDR", 0x79a4, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79a8, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79ac, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79b0, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79b4, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79b8, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79bc, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79c0, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79c4, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79c8, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79cc, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79d0, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79d4, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79d8, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79dc, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79e0, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79e4, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79e8, 0 },
+ { "EDC_BIST_STATUS_RDATA", 0x79ec, 0 },
+ { "EDC_PAR_ENABLE", 0x79f0, 0 },
+ { "ECC_UE_PAR_ENABLE", 2, 1 },
+ { "ECC_CE_PAR_ENABLE", 1, 1 },
+ { "PERR_INT_ENABLE", 0, 1 },
+ { "EDC_INT_ENABLE", 0x79f4, 0 },
+ { "ECC_UE_INT_ENABLE", 2, 1 },
+ { "ECC_CE_INT_ENABLE", 1, 1 },
+ { "PERR_INT_ENABLE", 0, 1 },
+ { "EDC_INT_CAUSE", 0x79f8, 0 },
+ { "ECC_UE_PAR_CAUSE", 5, 1 },
+ { "ECC_CE_PAR_CAUSE", 4, 1 },
+ { "PERR_PAR_CAUSE", 3, 1 },
+ { "ECC_UE_INT_CAUSE", 2, 1 },
+ { "ECC_CE_INT_CAUSE", 1, 1 },
+ { "PERR_INT_CAUSE", 0, 1 },
+ { "EDC_ECC_STATUS", 0x79fc, 0 },
+ { "ECC_CECNT", 16, 16 },
+ { "ECC_UECNT", 0, 16 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_hma_regs[] = {
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_cim_regs[] = {
+ { "CIM_BOOT_CFG", 0x7b00, 0 },
+ { "BootAddr", 8, 24 },
+ { "uPGen", 2, 6 },
+ { "BootSdram", 1, 1 },
+ { "uPCRst", 0, 1 },
+ { "CIM_BOOT_LEN", 0x7bf0, 0 },
+ { "BootLen", 4, 28 },
+ { "CIM_FLASH_BASE_ADDR", 0x7b04, 0 },
+ { "FlashBaseAddr", 6, 18 },
+ { "CIM_FLASH_ADDR_SIZE", 0x7b08, 0 },
+ { "FlashAddrSize", 4, 20 },
+ { "CIM_EEPROM_BASE_ADDR", 0x7b0c, 0 },
+ { "EEPROMBaseAddr", 6, 18 },
+ { "CIM_EEPROM_ADDR_SIZE", 0x7b10, 0 },
+ { "EEPROMAddrSize", 4, 20 },
+ { "CIM_SDRAM_BASE_ADDR", 0x7b14, 0 },
+ { "SdramBaseAddr", 6, 26 },
+ { "CIM_SDRAM_ADDR_SIZE", 0x7b18, 0 },
+ { "SdramAddrSize", 4, 28 },
+ { "CIM_EXTMEM2_BASE_ADDR", 0x7b1c, 0 },
+ { "ExtMem2BaseAddr", 6, 26 },
+ { "CIM_EXTMEM2_ADDR_SIZE", 0x7b20, 0 },
+ { "ExtMem2AddrSize", 4, 28 },
+ { "CIM_UP_SPARE_INT", 0x7b24, 0 },
+ { "TDebugInt", 4, 1 },
+ { "BootVecSel", 3, 1 },
+ { "uPSpareInt", 0, 3 },
+ { "CIM_HOST_INT_ENABLE", 0x7b28, 0 },
+ { "TieQOutParErrIntEn", 20, 1 },
+ { "TieQInParErrIntEn", 19, 1 },
+ { "MBHostParErr", 18, 1 },
+ { "MBuPParErr", 17, 1 },
+ { "IBQTP0ParErr", 16, 1 },
+ { "IBQTP1ParErr", 15, 1 },
+ { "IBQULPParErr", 14, 1 },
+ { "IBQSGELOParErr", 13, 1 },
+ { "IBQSGEHIParErr", 12, 1 },
+ { "IBQNCSIParErr", 11, 1 },
+ { "OBQULP0ParErr", 10, 1 },
+ { "OBQULP1ParErr", 9, 1 },
+ { "OBQULP2ParErr", 8, 1 },
+ { "OBQULP3ParErr", 7, 1 },
+ { "OBQSGEParErr", 6, 1 },
+ { "OBQNCSIParErr", 5, 1 },
+ { "Timer1IntEn", 3, 1 },
+ { "Timer0IntEn", 2, 1 },
+ { "PrefDropIntEn", 1, 1 },
+ { "CIM_HOST_INT_CAUSE", 0x7b2c, 0 },
+ { "TieQOutParErrInt", 20, 1 },
+ { "TieQInParErrInt", 19, 1 },
+ { "MBHostParErr", 18, 1 },
+ { "MBuPParErr", 17, 1 },
+ { "IBQTP0ParErr", 16, 1 },
+ { "IBQTP1ParErr", 15, 1 },
+ { "IBQULPParErr", 14, 1 },
+ { "IBQSGELOParErr", 13, 1 },
+ { "IBQSGEHIParErr", 12, 1 },
+ { "IBQNCSIParErr", 11, 1 },
+ { "OBQULP0ParErr", 10, 1 },
+ { "OBQULP1ParErr", 9, 1 },
+ { "OBQULP2ParErr", 8, 1 },
+ { "OBQULP3ParErr", 7, 1 },
+ { "OBQSGEParErr", 6, 1 },
+ { "OBQNCSIParErr", 5, 1 },
+ { "Timer1Int", 3, 1 },
+ { "Timer0Int", 2, 1 },
+ { "PrefDropInt", 1, 1 },
+ { "uPAccNonZero", 0, 1 },
+ { "CIM_HOST_UPACC_INT_ENABLE", 0x7b30, 0 },
+ { "EEPROMWRIntEn", 30, 1 },
+ { "TimeOutMAIntEn", 29, 1 },
+ { "TimeOutIntEn", 28, 1 },
+ { "RspOvrLookupIntEn", 27, 1 },
+ { "ReqOvrLookupIntEn", 26, 1 },
+ { "BlkWrPlIntEn", 25, 1 },
+ { "BlkRdPlIntEn", 24, 1 },
+ { "SglWrPlIntEn", 23, 1 },
+ { "SglRdPlIntEn", 22, 1 },
+ { "BlkWrCtlIntEn", 21, 1 },
+ { "BlkRdCtlIntEn", 20, 1 },
+ { "SglWrCtlIntEn", 19, 1 },
+ { "SglRdCtlIntEn", 18, 1 },
+ { "BlkWrEEPROMIntEn", 17, 1 },
+ { "BlkRdEEPROMIntEn", 16, 1 },
+ { "SglWrEEPROMIntEn", 15, 1 },
+ { "SglRdEEPROMIntEn", 14, 1 },
+ { "BlkWrFlashIntEn", 13, 1 },
+ { "BlkRdFlashIntEn", 12, 1 },
+ { "SglWrFlashIntEn", 11, 1 },
+ { "SglRdFlashIntEn", 10, 1 },
+ { "BlkWrBootIntEn", 9, 1 },
+ { "BlkRdBootIntEn", 8, 1 },
+ { "SglWrBootIntEn", 7, 1 },
+ { "SglRdBootIntEn", 6, 1 },
+ { "IllWrBEIntEn", 5, 1 },
+ { "IllRdBEIntEn", 4, 1 },
+ { "IllRdIntEn", 3, 1 },
+ { "IllWrIntEn", 2, 1 },
+ { "IllTransIntEn", 1, 1 },
+ { "RsvdSpaceIntEn", 0, 1 },
+ { "CIM_HOST_UPACC_INT_CAUSE", 0x7b34, 0 },
+ { "EEPROMWRInt", 30, 1 },
+ { "TimeOutMAInt", 29, 1 },
+ { "TimeOutInt", 28, 1 },
+ { "RspOvrLookupInt", 27, 1 },
+ { "ReqOvrLookupInt", 26, 1 },
+ { "BlkWrPlInt", 25, 1 },
+ { "BlkRdPlInt", 24, 1 },
+ { "SglWrPlInt", 23, 1 },
+ { "SglRdPlInt", 22, 1 },
+ { "BlkWrCtlInt", 21, 1 },
+ { "BlkRdCtlInt", 20, 1 },
+ { "SglWrCtlInt", 19, 1 },
+ { "SglRdCtlInt", 18, 1 },
+ { "BlkWrEEPROMInt", 17, 1 },
+ { "BlkRdEEPROMInt", 16, 1 },
+ { "SglWrEEPROMInt", 15, 1 },
+ { "SglRdEEPROMInt", 14, 1 },
+ { "BlkWrFlashInt", 13, 1 },
+ { "BlkRdFlashInt", 12, 1 },
+ { "SglWrFlashInt", 11, 1 },
+ { "SglRdFlashInt", 10, 1 },
+ { "BlkWrBootInt", 9, 1 },
+ { "BlkRdBootInt", 8, 1 },
+ { "SglWrBootInt", 7, 1 },
+ { "SglRdBootInt", 6, 1 },
+ { "IllWrBEInt", 5, 1 },
+ { "IllRdBEInt", 4, 1 },
+ { "IllRdInt", 3, 1 },
+ { "IllWrInt", 2, 1 },
+ { "IllTransInt", 1, 1 },
+ { "RsvdSpaceInt", 0, 1 },
+ { "CIM_UP_INT_ENABLE", 0x7b38, 0 },
+ { "TieQOutParErrIntEn", 20, 1 },
+ { "TieQInParErrIntEn", 19, 1 },
+ { "MBHostParErr", 18, 1 },
+ { "MBuPParErr", 17, 1 },
+ { "IBQTP0ParErr", 16, 1 },
+ { "IBQTP1ParErr", 15, 1 },
+ { "IBQULPParErr", 14, 1 },
+ { "IBQSGELOParErr", 13, 1 },
+ { "IBQSGEHIParErr", 12, 1 },
+ { "IBQNCSIParErr", 11, 1 },
+ { "OBQULP0ParErr", 10, 1 },
+ { "OBQULP1ParErr", 9, 1 },
+ { "OBQULP2ParErr", 8, 1 },
+ { "OBQULP3ParErr", 7, 1 },
+ { "OBQSGEParErr", 6, 1 },
+ { "OBQNCSIParErr", 5, 1 },
+ { "MstPlIntEn", 4, 1 },
+ { "Timer1IntEn", 3, 1 },
+ { "Timer0IntEn", 2, 1 },
+ { "PrefDropIntEn", 1, 1 },
+ { "CIM_UP_INT_CAUSE", 0x7b3c, 0 },
+ { "TieQOutParErrInt", 20, 1 },
+ { "TieQInParErrInt", 19, 1 },
+ { "MBHostParErr", 18, 1 },
+ { "MBuPParErr", 17, 1 },
+ { "IBQTP0ParErr", 16, 1 },
+ { "IBQTP1ParErr", 15, 1 },
+ { "IBQULPParErr", 14, 1 },
+ { "IBQSGELOParErr", 13, 1 },
+ { "IBQSGEHIParErr", 12, 1 },
+ { "IBQNCSIParErr", 11, 1 },
+ { "OBQULP0ParErr", 10, 1 },
+ { "OBQULP1ParErr", 9, 1 },
+ { "OBQULP2ParErr", 8, 1 },
+ { "OBQULP3ParErr", 7, 1 },
+ { "OBQSGEParErr", 6, 1 },
+ { "OBQNCSIParErr", 5, 1 },
+ { "MstPlInt", 4, 1 },
+ { "Timer1Int", 3, 1 },
+ { "Timer0Int", 2, 1 },
+ { "PrefDropInt", 1, 1 },
+ { "uPAccNonZero", 0, 1 },
+ { "CIM_UP_ACC_INT_ENABLE", 0x7b40, 0 },
+ { "EEPROMWRIntEn", 30, 1 },
+ { "TimeOutMAIntEn", 29, 1 },
+ { "TimeOutIntEn", 28, 1 },
+ { "RspOvrLookupIntEn", 27, 1 },
+ { "ReqOvrLookupIntEn", 26, 1 },
+ { "BlkWrPlIntEn", 25, 1 },
+ { "BlkRdPlIntEn", 24, 1 },
+ { "SglWrPlIntEn", 23, 1 },
+ { "SglRdPlIntEn", 22, 1 },
+ { "BlkWrCtlIntEn", 21, 1 },
+ { "BlkRdCtlIntEn", 20, 1 },
+ { "SglWrCtlIntEn", 19, 1 },
+ { "SglRdCtlIntEn", 18, 1 },
+ { "BlkWrEEPROMIntEn", 17, 1 },
+ { "BlkRdEEPROMIntEn", 16, 1 },
+ { "SglWrEEPROMIntEn", 15, 1 },
+ { "SglRdEEPROMIntEn", 14, 1 },
+ { "BlkWrFlashIntEn", 13, 1 },
+ { "BlkRdFlashIntEn", 12, 1 },
+ { "SglWrFlashIntEn", 11, 1 },
+ { "SglRdFlashIntEn", 10, 1 },
+ { "BlkWrBootIntEn", 9, 1 },
+ { "BlkRdBootIntEn", 8, 1 },
+ { "SglWrBootIntEn", 7, 1 },
+ { "SglRdBootIntEn", 6, 1 },
+ { "IllWrBEIntEn", 5, 1 },
+ { "IllRdBEIntEn", 4, 1 },
+ { "IllRdIntEn", 3, 1 },
+ { "IllWrIntEn", 2, 1 },
+ { "IllTransIntEn", 1, 1 },
+ { "RsvdSpaceIntEn", 0, 1 },
+ { "CIM_UP_ACC_INT_CAUSE", 0x7b44, 0 },
+ { "EEPROMWRInt", 30, 1 },
+ { "TimeOutMAInt", 29, 1 },
+ { "TimeOutInt", 28, 1 },
+ { "RspOvrLookupInt", 27, 1 },
+ { "ReqOvrLookupInt", 26, 1 },
+ { "BlkWrPlInt", 25, 1 },
+ { "BlkRdPlInt", 24, 1 },
+ { "SglWrPlInt", 23, 1 },
+ { "SglRdPlInt", 22, 1 },
+ { "BlkWrCtlInt", 21, 1 },
+ { "BlkRdCtlInt", 20, 1 },
+ { "SglWrCtlInt", 19, 1 },
+ { "SglRdCtlInt", 18, 1 },
+ { "BlkWrEEPROMInt", 17, 1 },
+ { "BlkRdEEPROMInt", 16, 1 },
+ { "SglWrEEPROMInt", 15, 1 },
+ { "SglRdEEPROMInt", 14, 1 },
+ { "BlkWrFlashInt", 13, 1 },
+ { "BlkRdFlashInt", 12, 1 },
+ { "SglWrFlashInt", 11, 1 },
+ { "SglRdFlashInt", 10, 1 },
+ { "BlkWrBootInt", 9, 1 },
+ { "BlkRdBootInt", 8, 1 },
+ { "SglWrBootInt", 7, 1 },
+ { "SglRdBootInt", 6, 1 },
+ { "IllWrBEInt", 5, 1 },
+ { "IllRdBEInt", 4, 1 },
+ { "IllRdInt", 3, 1 },
+ { "IllWrInt", 2, 1 },
+ { "IllTransInt", 1, 1 },
+ { "RsvdSpaceInt", 0, 1 },
+ { "CIM_QUEUE_CONFIG_REF", 0x7b48, 0 },
+ { "OBQSelect", 4, 1 },
+ { "IBQSelect", 3, 1 },
+ { "QueNumSelect", 0, 3 },
+ { "CIM_QUEUE_CONFIG_CTRL", 0x7b4c, 0 },
+ { "QueSize", 24, 6 },
+ { "QueBase", 16, 6 },
+ { "QueDbg8BEn", 9, 1 },
+ { "QueFullThrsh", 0, 9 },
+ { "CIM_HOST_ACC_CTRL", 0x7b50, 0 },
+ { "HostBusy", 17, 1 },
+ { "HostWrite", 16, 1 },
+ { "HostAddr", 0, 16 },
+ { "CIM_HOST_ACC_DATA", 0x7b54, 0 },
+ { "CIM_CDEBUGDATA", 0x7b58, 0 },
+ { "CDebugDataH", 16, 16 },
+ { "CDebugDataL", 0, 16 },
+ { "CIM_IBQ_DBG_CFG", 0x7b60, 0 },
+ { "IbqDbgAddr", 16, 12 },
+ { "IbqDbgWr", 2, 1 },
+ { "IbqDbgBusy", 1, 1 },
+ { "IbqDbgEn", 0, 1 },
+ { "CIM_OBQ_DBG_CFG", 0x7b64, 0 },
+ { "ObqDbgAddr", 16, 12 },
+ { "ObqDbgWr", 2, 1 },
+ { "ObqDbgBusy", 1, 1 },
+ { "ObqDbgEn", 0, 1 },
+ { "CIM_IBQ_DBG_DATA", 0x7b68, 0 },
+ { "CIM_OBQ_DBG_DATA", 0x7b6c, 0 },
+ { "CIM_DEBUGCFG", 0x7b70, 0 },
+ { "POLADbgRdPtr", 23, 9 },
+ { "PILADbgRdPtr", 14, 9 },
+ { "LAMaskTrig", 13, 1 },
+ { "LADbgEn", 12, 1 },
+ { "LAFillOnce", 11, 1 },
+ { "LAMaskStop", 10, 1 },
+ { "DebugSelH", 5, 5 },
+ { "DebugSelL", 0, 5 },
+ { "CIM_DEBUGSTS", 0x7b74, 0 },
+ { "LAReset", 31, 1 },
+ { "POLADbgWrPtr", 16, 9 },
+ { "PILADbgWrPtr", 0, 9 },
+ { "CIM_PO_LA_DEBUGDATA", 0x7b78, 0 },
+ { "CIM_PI_LA_DEBUGDATA", 0x7b7c, 0 },
+ { "CIM_PO_LA_MADEBUGDATA", 0x7b80, 0 },
+ { "CIM_PI_LA_MADEBUGDATA", 0x7b84, 0 },
+ { "CIM_PO_LA_PIFSMDEBUGDATA", 0x7b8c, 0 },
+ { "CIM_MEM_ZONE0_VA", 0x7b90, 0 },
+ { "MEM_ZONE_VA", 4, 28 },
+ { "CIM_MEM_ZONE0_BA", 0x7b94, 0 },
+ { "MEM_ZONE_BA", 6, 26 },
+ { "PBT_enable", 5, 1 },
+ { "ZONE_DST", 0, 2 },
+ { "CIM_MEM_ZONE0_LEN", 0x7b98, 0 },
+ { "MEM_ZONE_LEN", 4, 28 },
+ { "CIM_MEM_ZONE1_VA", 0x7b9c, 0 },
+ { "MEM_ZONE_VA", 4, 28 },
+ { "CIM_MEM_ZONE1_BA", 0x7ba0, 0 },
+ { "MEM_ZONE_BA", 6, 26 },
+ { "PBT_enable", 5, 1 },
+ { "ZONE_DST", 0, 2 },
+ { "CIM_MEM_ZONE1_LEN", 0x7ba4, 0 },
+ { "MEM_ZONE_LEN", 4, 28 },
+ { "CIM_MEM_ZONE2_VA", 0x7ba8, 0 },
+ { "MEM_ZONE_VA", 4, 28 },
+ { "CIM_MEM_ZONE2_BA", 0x7bac, 0 },
+ { "MEM_ZONE_BA", 6, 26 },
+ { "PBT_enable", 5, 1 },
+ { "ZONE_DST", 0, 2 },
+ { "CIM_MEM_ZONE2_LEN", 0x7bb0, 0 },
+ { "MEM_ZONE_LEN", 4, 28 },
+ { "CIM_MEM_ZONE3_VA", 0x7bb4, 0 },
+ { "MEM_ZONE_VA", 4, 28 },
+ { "CIM_MEM_ZONE3_BA", 0x7bb8, 0 },
+ { "MEM_ZONE_BA", 6, 26 },
+ { "PBT_enable", 5, 1 },
+ { "ZONE_DST", 0, 2 },
+ { "CIM_MEM_ZONE3_LEN", 0x7bbc, 0 },
+ { "MEM_ZONE_LEN", 4, 28 },
+ { "CIM_MEM_ZONE4_VA", 0x7bc0, 0 },
+ { "MEM_ZONE_VA", 4, 28 },
+ { "CIM_MEM_ZONE4_BA", 0x7bc4, 0 },
+ { "MEM_ZONE_BA", 6, 26 },
+ { "PBT_enable", 5, 1 },
+ { "ZONE_DST", 0, 2 },
+ { "CIM_MEM_ZONE4_LEN", 0x7bc8, 0 },
+ { "MEM_ZONE_LEN", 4, 28 },
+ { "CIM_MEM_ZONE5_VA", 0x7bcc, 0 },
+ { "MEM_ZONE_VA", 4, 28 },
+ { "CIM_MEM_ZONE5_BA", 0x7bd0, 0 },
+ { "MEM_ZONE_BA", 6, 26 },
+ { "PBT_enable", 5, 1 },
+ { "ZONE_DST", 0, 2 },
+ { "CIM_MEM_ZONE5_LEN", 0x7bd4, 0 },
+ { "MEM_ZONE_LEN", 4, 28 },
+ { "CIM_MEM_ZONE6_VA", 0x7bd8, 0 },
+ { "MEM_ZONE_VA", 4, 28 },
+ { "CIM_MEM_ZONE6_BA", 0x7bdc, 0 },
+ { "MEM_ZONE_BA", 6, 26 },
+ { "PBT_enable", 5, 1 },
+ { "ZONE_DST", 0, 2 },
+ { "CIM_MEM_ZONE6_LEN", 0x7be0, 0 },
+ { "MEM_ZONE_LEN", 4, 28 },
+ { "CIM_MEM_ZONE7_VA", 0x7be4, 0 },
+ { "MEM_ZONE_VA", 4, 28 },
+ { "CIM_MEM_ZONE7_BA", 0x7be8, 0 },
+ { "MEM_ZONE_BA", 6, 26 },
+ { "PBT_enable", 5, 1 },
+ { "ZONE_DST", 0, 2 },
+ { "CIM_MEM_ZONE7_LEN", 0x7bec, 0 },
+ { "MEM_ZONE_LEN", 4, 28 },
+ { "CIM_GLB_TIMER_CTL", 0x7bf4, 0 },
+ { "Timer1En", 4, 1 },
+ { "Timer0En", 3, 1 },
+ { "TimerEn", 1, 1 },
+ { "CIM_GLB_TIMER", 0x7bf8, 0 },
+ { "CIM_GLB_TIMER_TICK", 0x7bfc, 0 },
+ { "CIM_TIMER0", 0x7c00, 0 },
+ { "CIM_TIMER1", 0x7c04, 0 },
+ { "CIM_DEBUG_ADDR_TIMEOUT", 0x7c08, 0 },
+ { "DAddrTimeOut", 2, 30 },
+ { "CIM_DEBUG_ADDR_ILLEGAL", 0x7c0c, 0 },
+ { "DAddrIllegal", 2, 30 },
+ { "CIM_DEBUG_PIF_CAUSE_MASK", 0x7c10, 0 },
+ { "CIM_DEBUG_PIF_UPACC_CAUSE_MASK", 0x7c14, 0 },
+ { "CIM_DEBUG_UP_CAUSE_MASK", 0x7c18, 0 },
+ { "CIM_DEBUG_UP_UPACC_CAUSE_MASK", 0x7c1c, 0 },
+ { "CIM_PERR_INJECT", 0x7c20, 0 },
+ { "MemSel", 1, 5 },
+ { "InjectDataErr", 0, 1 },
+ { "CIM_PERR_ENABLE", 0x7c24, 0 },
+ { "CIM_EEPROM_BUSY_BIT", 0x7c28, 0 },
+ { "CIM_MA_TIMER_EN", 0x7c2c, 0 },
+ { "CIM_UP_PO_SINGLE_OUTSTANDING", 0x7c30, 0 },
+ { "CIM_CIM_DEBUG_SPARE", 0x7c34, 0 },
+ { "CIM_UP_OPERATION_FREQ", 0x7c38, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e240, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e244, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e248, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e24c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e250, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e254, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e258, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e25c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e260, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e264, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e268, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e26c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e270, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e274, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e278, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e27c, 0 },
+ { "CIM_PF_MAILBOX_CTRL", 0x1e280, 0 },
+ { "MBGeneric", 4, 28 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 2, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_PF_MAILBOX_ACC_STATUS", 0x1e284, 0 },
+ { "MBWrBusy", 31, 1 },
+ { "CIM_PF_HOST_INT_ENABLE", 0x1e288, 0 },
+ { "MBMsgRdyIntEn", 19, 1 },
+ { "CIM_PF_HOST_INT_CAUSE", 0x1e28c, 0 },
+ { "MBMsgRdyInt", 19, 1 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e640, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e644, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e648, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e64c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e650, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e654, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e658, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e65c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e660, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e664, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e668, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e66c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e670, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e674, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e678, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1e67c, 0 },
+ { "CIM_PF_MAILBOX_CTRL", 0x1e680, 0 },
+ { "MBGeneric", 4, 28 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 2, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_PF_MAILBOX_ACC_STATUS", 0x1e684, 0 },
+ { "MBWrBusy", 31, 1 },
+ { "CIM_PF_HOST_INT_ENABLE", 0x1e688, 0 },
+ { "MBMsgRdyIntEn", 19, 1 },
+ { "CIM_PF_HOST_INT_CAUSE", 0x1e68c, 0 },
+ { "MBMsgRdyInt", 19, 1 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea40, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea44, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea48, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea4c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea50, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea54, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea58, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea5c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea60, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea64, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea68, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea6c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea70, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea74, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea78, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ea7c, 0 },
+ { "CIM_PF_MAILBOX_CTRL", 0x1ea80, 0 },
+ { "MBGeneric", 4, 28 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 2, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_PF_MAILBOX_ACC_STATUS", 0x1ea84, 0 },
+ { "MBWrBusy", 31, 1 },
+ { "CIM_PF_HOST_INT_ENABLE", 0x1ea88, 0 },
+ { "MBMsgRdyIntEn", 19, 1 },
+ { "CIM_PF_HOST_INT_CAUSE", 0x1ea8c, 0 },
+ { "MBMsgRdyInt", 19, 1 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee40, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee44, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee48, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee4c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee50, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee54, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee58, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee5c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee60, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee64, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee68, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee6c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee70, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee74, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee78, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1ee7c, 0 },
+ { "CIM_PF_MAILBOX_CTRL", 0x1ee80, 0 },
+ { "MBGeneric", 4, 28 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 2, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_PF_MAILBOX_ACC_STATUS", 0x1ee84, 0 },
+ { "MBWrBusy", 31, 1 },
+ { "CIM_PF_HOST_INT_ENABLE", 0x1ee88, 0 },
+ { "MBMsgRdyIntEn", 19, 1 },
+ { "CIM_PF_HOST_INT_CAUSE", 0x1ee8c, 0 },
+ { "MBMsgRdyInt", 19, 1 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f240, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f244, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f248, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f24c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f250, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f254, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f258, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f25c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f260, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f264, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f268, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f26c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f270, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f274, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f278, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f27c, 0 },
+ { "CIM_PF_MAILBOX_CTRL", 0x1f280, 0 },
+ { "MBGeneric", 4, 28 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 2, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_PF_MAILBOX_ACC_STATUS", 0x1f284, 0 },
+ { "MBWrBusy", 31, 1 },
+ { "CIM_PF_HOST_INT_ENABLE", 0x1f288, 0 },
+ { "MBMsgRdyIntEn", 19, 1 },
+ { "CIM_PF_HOST_INT_CAUSE", 0x1f28c, 0 },
+ { "MBMsgRdyInt", 19, 1 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f640, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f644, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f648, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f64c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f650, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f654, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f658, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f65c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f660, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f664, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f668, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f66c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f670, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f674, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f678, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1f67c, 0 },
+ { "CIM_PF_MAILBOX_CTRL", 0x1f680, 0 },
+ { "MBGeneric", 4, 28 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 2, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_PF_MAILBOX_ACC_STATUS", 0x1f684, 0 },
+ { "MBWrBusy", 31, 1 },
+ { "CIM_PF_HOST_INT_ENABLE", 0x1f688, 0 },
+ { "MBMsgRdyIntEn", 19, 1 },
+ { "CIM_PF_HOST_INT_CAUSE", 0x1f68c, 0 },
+ { "MBMsgRdyInt", 19, 1 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa40, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa44, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa48, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa4c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa50, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa54, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa58, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa5c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa60, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa64, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa68, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa6c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa70, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa74, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa78, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fa7c, 0 },
+ { "CIM_PF_MAILBOX_CTRL", 0x1fa80, 0 },
+ { "MBGeneric", 4, 28 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 2, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_PF_MAILBOX_ACC_STATUS", 0x1fa84, 0 },
+ { "MBWrBusy", 31, 1 },
+ { "CIM_PF_HOST_INT_ENABLE", 0x1fa88, 0 },
+ { "MBMsgRdyIntEn", 19, 1 },
+ { "CIM_PF_HOST_INT_CAUSE", 0x1fa8c, 0 },
+ { "MBMsgRdyInt", 19, 1 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe40, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe44, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe48, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe4c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe50, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe54, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe58, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe5c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe60, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe64, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe68, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe6c, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe70, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe74, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe78, 0 },
+ { "CIM_PF_MAILBOX_DATA", 0x1fe7c, 0 },
+ { "CIM_PF_MAILBOX_CTRL", 0x1fe80, 0 },
+ { "MBGeneric", 4, 28 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 2, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_PF_MAILBOX_ACC_STATUS", 0x1fe84, 0 },
+ { "MBWrBusy", 31, 1 },
+ { "CIM_PF_HOST_INT_ENABLE", 0x1fe88, 0 },
+ { "MBMsgRdyIntEn", 19, 1 },
+ { "CIM_PF_HOST_INT_CAUSE", 0x1fe8c, 0 },
+ { "MBMsgRdyInt", 19, 1 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_tp_regs[] = {
+ { "TP_IN_CONFIG", 0x7d00, 0 },
+ { "TcpOptParserDisCh3", 27, 1 },
+ { "TcpOptParserDisCh2", 26, 1 },
+ { "TcpOptParserDisCh1", 25, 1 },
+ { "TcpOptParserDisCh0", 24, 1 },
+ { "CrcPassPrt3", 23, 1 },
+ { "CrcPassPrt2", 22, 1 },
+ { "CrcPassPrt1", 21, 1 },
+ { "CrcPassPrt0", 20, 1 },
+ { "VepaMode", 19, 1 },
+ { "FipUpEn", 18, 1 },
+ { "FcoeUpEn", 17, 1 },
+ { "FcoeEnable", 16, 1 },
+ { "IPv6Enable", 15, 1 },
+ { "NICMode", 14, 1 },
+ { "EChecksumCheckTCP", 13, 1 },
+ { "EChecksumCheckIP", 12, 1 },
+ { "EReportUdpHdrLen", 11, 1 },
+ { "ECPL", 10, 1 },
+ { "VnTagEnable", 9, 1 },
+ { "EEthernet", 8, 1 },
+ { "CChecksumCheckTCP", 6, 1 },
+ { "CChecksumCheckIP", 5, 1 },
+ { "CTag", 4, 1 },
+ { "CCPL", 3, 1 },
+ { "CEthernet", 1, 1 },
+ { "CTunnel", 0, 1 },
+ { "TP_OUT_CONFIG", 0x7d04, 0 },
+ { "PortQfcEn", 28, 4 },
+ { "EPktDistChn3", 23, 1 },
+ { "EPktDistChn2", 22, 1 },
+ { "EPktDistChn1", 21, 1 },
+ { "EPktDistChn0", 20, 1 },
+ { "TtlMode", 19, 1 },
+ { "EQfcDmac", 18, 1 },
+ { "ELpbkIncMpsStat", 17, 1 },
+ { "IPIDSplitMode", 16, 1 },
+ { "VLANExtEnablePort3", 15, 1 },
+ { "VLANExtEnablePort2", 14, 1 },
+ { "VLANExtEnablePort1", 13, 1 },
+ { "VLANExtEnablePort0", 12, 1 },
+ { "EChecksumInsertTCP", 11, 1 },
+ { "EChecksumInsertIP", 10, 1 },
+ { "ECPL", 8, 1 },
+ { "EPriority", 7, 1 },
+ { "EEthernet", 6, 1 },
+ { "CChecksumInsertTCP", 5, 1 },
+ { "CChecksumInsertIP", 4, 1 },
+ { "CCPL", 2, 1 },
+ { "CEthernet", 0, 1 },
+ { "TP_GLOBAL_CONFIG", 0x7d08, 0 },
+ { "SYNCookieParams", 26, 6 },
+ { "RXFlowControlDisable", 25, 1 },
+ { "TXPacingEnable", 24, 1 },
+ { "AttackFilterEnable", 23, 1 },
+ { "SYNCookieNoOptions", 22, 1 },
+ { "ProtectedMode", 21, 1 },
+ { "PingDrop", 20, 1 },
+ { "FragmentDrop", 19, 1 },
+ { "FiveTupleLookup", 17, 2 },
+ { "OfdMpsStats", 16, 1 },
+ { "DontFragment", 15, 1 },
+ { "IPIdentSplit", 14, 1 },
+ { "IPChecksumOffload", 13, 1 },
+ { "UDPChecksumOffload", 12, 1 },
+ { "TCPChecksumOffload", 11, 1 },
+ { "RssLoopbackEnable", 10, 1 },
+ { "TCAMServerUse", 8, 2 },
+ { "IPTTL", 0, 8 },
+ { "TP_DB_CONFIG", 0x7d0c, 0 },
+ { "DBMaxOpCnt", 24, 8 },
+ { "CxMaxOpCntDisable", 23, 1 },
+ { "CxMaxOpCnt", 16, 7 },
+ { "TxMaxOpCntDisable", 15, 1 },
+ { "TxMaxOpCnt", 8, 7 },
+ { "RxMaxOpCntDisable", 7, 1 },
+ { "RxMaxOpCnt", 0, 7 },
+ { "TP_CMM_TCB_BASE", 0x7d10, 0 },
+ { "TP_CMM_MM_BASE", 0x7d14, 0 },
+ { "TP_CMM_TIMER_BASE", 0x7d18, 0 },
+ { "TP_CMM_MM_FLST_SIZE", 0x7d1c, 0 },
+ { "RxPoolSize", 16, 16 },
+ { "TxPoolSize", 0, 16 },
+ { "TP_PMM_TX_BASE", 0x7d20, 0 },
+ { "TP_PMM_DEFRAG_BASE", 0x7d24, 0 },
+ { "TP_PMM_RX_BASE", 0x7d28, 0 },
+ { "TP_PMM_RX_PAGE_SIZE", 0x7d2c, 0 },
+ { "TP_PMM_RX_MAX_PAGE", 0x7d30, 0 },
+ { "PMRxNumChn", 31, 1 },
+ { "PMRxMaxPage", 0, 21 },
+ { "TP_PMM_TX_PAGE_SIZE", 0x7d34, 0 },
+ { "TP_PMM_TX_MAX_PAGE", 0x7d38, 0 },
+ { "PMTxNumChn", 30, 2 },
+ { "PMTxMaxPage", 0, 21 },
+ { "TP_TCP_OPTIONS", 0x7d40, 0 },
+ { "MTUDefault", 16, 16 },
+ { "MTUEnable", 10, 1 },
+ { "SACKTx", 9, 1 },
+ { "SACKRx", 8, 1 },
+ { "SACKMode", 4, 2 },
+ { "WindowScaleMode", 2, 2 },
+ { "TimestampsMode", 0, 2 },
+ { "TP_DACK_CONFIG", 0x7d44, 0 },
+ { "AutoState3", 30, 2 },
+ { "AutoState2", 28, 2 },
+ { "AutoState1", 26, 2 },
+ { "ByteThreshold", 8, 18 },
+ { "MSSThreshold", 4, 3 },
+ { "AutoCareful", 2, 1 },
+ { "AutoEnable", 1, 1 },
+ { "Mode", 0, 1 },
+ { "TP_PC_CONFIG", 0x7d48, 0 },
+ { "CMCacheDisable", 31, 1 },
+ { "EnableOcspiFull", 30, 1 },
+ { "EnableFLMErrorDDP", 29, 1 },
+ { "LockTid", 28, 1 },
+ { "DisableInvPend", 27, 1 },
+ { "EnableFilterCount", 26, 1 },
+ { "RddpCongEn", 25, 1 },
+ { "EnableOnFlyPDU", 24, 1 },
+ { "EnableMinRcvWnd", 23, 1 },
+ { "EnableMaxRcvWnd", 22, 1 },
+ { "TxDataAckRateEnable", 21, 1 },
+ { "TxDeferEnable", 20, 1 },
+ { "RxCongestionMode", 19, 1 },
+ { "HearbeatOnceDACK", 18, 1 },
+ { "HearbeatOnceHeap", 17, 1 },
+ { "HearbeatDACK", 16, 1 },
+ { "TxCongestionMode", 15, 1 },
+ { "AcceptLatestRcvAdv", 14, 1 },
+ { "DisableSYNData", 13, 1 },
+ { "DisableWindowPSH", 12, 1 },
+ { "DisableFINOldData", 11, 1 },
+ { "EnableFLMError", 10, 1 },
+ { "EnableOptMtu", 9, 1 },
+ { "FilterPeerFIN", 8, 1 },
+ { "EnableFeedbackSend", 7, 1 },
+ { "EnableRDMAError", 6, 1 },
+ { "EnableDDPFlowControl", 5, 1 },
+ { "DisableHeldFIN", 4, 1 },
+ { "EnableOfdoVLAN", 3, 1 },
+ { "DisableTimeWait", 2, 1 },
+ { "EnableVlanCheck", 1, 1 },
+ { "TxDataAckPageEnable", 0, 1 },
+ { "TP_PC_CONFIG2", 0x7d4c, 0 },
+ { "EnableMtuVfMode", 31, 1 },
+ { "EnableMibVfMode", 30, 1 },
+ { "DisableLbkCheck", 29, 1 },
+ { "EnableUrgDdpOff", 28, 1 },
+ { "EnableFilterLpbk", 27, 1 },
+ { "DisableTblMmgr", 26, 1 },
+ { "CngRecSndNxt", 25, 1 },
+ { "EnableLbkChn", 24, 1 },
+ { "EnableLroEcn", 23, 1 },
+ { "EnablePcmdCheck", 22, 1 },
+ { "EnableELbkAFull", 21, 1 },
+ { "EnableCLbkAFull", 20, 1 },
+ { "EnableOespiFull", 19, 1 },
+ { "DisableHitCheck", 18, 1 },
+ { "EnableRssErrCheck", 17, 1 },
+ { "DisableNewPshFlag", 16, 1 },
+ { "EnableRddpRcvAdvClr", 15, 1 },
+ { "EnableTxDataArpMiss", 14, 1 },
+ { "EnableArpMiss", 13, 1 },
+ { "EnableRstPaws", 12, 1 },
+ { "EnableIPv6RSS", 11, 1 },
+ { "EnableNonOfdHybRss", 10, 1 },
+ { "EnableUDP4TupRss", 9, 1 },
+ { "EnableRxPktTmstpRss", 8, 1 },
+ { "EnableEPCMDAFull", 7, 1 },
+ { "EnableCPCMDAFull", 6, 1 },
+ { "EnableEHdrAFull", 5, 1 },
+ { "EnableCHdrAFull", 4, 1 },
+ { "EnableEMacAFull", 3, 1 },
+ { "EnableNonOfdTidRss", 2, 1 },
+ { "EnableNonOfdTcbRss", 1, 1 },
+ { "EnableTnlOfdClosed", 0, 1 },
+ { "TP_TCP_BACKOFF_REG0", 0x7d50, 0 },
+ { "TimerBackoffIndex3", 24, 8 },
+ { "TimerBackoffIndex2", 16, 8 },
+ { "TimerBackoffIndex1", 8, 8 },
+ { "TimerBackoffIndex0", 0, 8 },
+ { "TP_TCP_BACKOFF_REG1", 0x7d54, 0 },
+ { "TimerBackoffIndex7", 24, 8 },
+ { "TimerBackoffIndex6", 16, 8 },
+ { "TimerBackoffIndex5", 8, 8 },
+ { "TimerBackoffIndex4", 0, 8 },
+ { "TP_TCP_BACKOFF_REG2", 0x7d58, 0 },
+ { "TimerBackoffIndex11", 24, 8 },
+ { "TimerBackoffIndex10", 16, 8 },
+ { "TimerBackoffIndex9", 8, 8 },
+ { "TimerBackoffIndex8", 0, 8 },
+ { "TP_TCP_BACKOFF_REG3", 0x7d5c, 0 },
+ { "TimerBackoffIndex15", 24, 8 },
+ { "TimerBackoffIndex14", 16, 8 },
+ { "TimerBackoffIndex13", 8, 8 },
+ { "TimerBackoffIndex12", 0, 8 },
+ { "TP_PARA_REG0", 0x7d60, 0 },
+ { "InitCwndIdle", 27, 1 },
+ { "InitCwnd", 24, 3 },
+ { "DupAckThresh", 20, 4 },
+ { "CplErrEnable", 12, 1 },
+ { "FastTnlCnt", 11, 1 },
+ { "FastTblCnt", 10, 1 },
+ { "TpTcamKey", 9, 1 },
+ { "SwsMode", 8, 1 },
+ { "TsmpMode", 6, 2 },
+ { "ByteCountLimit", 4, 2 },
+ { "SwsShove", 3, 1 },
+ { "TblTimer", 2, 1 },
+ { "RxtPace", 1, 1 },
+ { "SwsTimer", 0, 1 },
+ { "TP_PARA_REG1", 0x7d64, 0 },
+ { "InitRwnd", 16, 16 },
+ { "InitialSSThresh", 0, 16 },
+ { "TP_PARA_REG2", 0x7d68, 0 },
+ { "MaxRxData", 16, 16 },
+ { "RxCoalesceSize", 0, 16 },
+ { "TP_PARA_REG3", 0x7d6c, 0 },
+ { "EnableTnlCngLpbk", 31, 1 },
+ { "EnableTnlCngFifo", 30, 1 },
+ { "EnableTnlCngHdr", 29, 1 },
+ { "EnableTnlCngSge", 28, 1 },
+ { "RxMacCheck", 27, 1 },
+ { "RxSynFilter", 26, 1 },
+ { "CngCtrlECN", 25, 1 },
+ { "RxDdpOffInit", 24, 1 },
+ { "TunnelCngDrop3", 23, 1 },
+ { "TunnelCngDrop2", 22, 1 },
+ { "TunnelCngDrop1", 21, 1 },
+ { "TunnelCngDrop0", 20, 1 },
+ { "TxDataAckIdx", 16, 4 },
+ { "RxFragEnable", 12, 3 },
+ { "TxPaceFixedStrict", 11, 1 },
+ { "TxPaceAutoStrict", 10, 1 },
+ { "TxPaceFixed", 9, 1 },
+ { "TxPaceAuto", 8, 1 },
+ { "RxChnTunnel", 7, 1 },
+ { "RxUrgTunnel", 6, 1 },
+ { "RxUrgMode", 5, 1 },
+ { "TxUrgMode", 4, 1 },
+ { "CngCtrlMode", 2, 2 },
+ { "RxCoalesceEnable", 1, 1 },
+ { "RxCoalescePshEn", 0, 1 },
+ { "TP_PARA_REG4", 0x7d70, 0 },
+ { "HighSpeedCfg", 24, 8 },
+ { "NewRenoCfg", 16, 8 },
+ { "TahoeCfg", 8, 8 },
+ { "RenoCfg", 0, 8 },
+ { "TP_PARA_REG5", 0x7d74, 0 },
+ { "IndicateSize", 16, 16 },
+ { "MaxProxySize", 12, 4 },
+ { "EnableReadPdu", 11, 1 },
+ { "EnableReadAhead", 10, 1 },
+ { "EmptyRqEnable", 9, 1 },
+ { "SchdEnable", 8, 1 },
+ { "RearmDdpOffset", 4, 1 },
+ { "ResetDdpOffset", 3, 1 },
+ { "OnFlyDDPEnable", 2, 1 },
+ { "DackTimerSpin", 1, 1 },
+ { "PushTimerEnable", 0, 1 },
+ { "TP_PARA_REG6", 0x7d78, 0 },
+ { "TxPDUSizeAdj", 24, 8 },
+ { "LimitedTransmit", 20, 4 },
+ { "EnableCSav", 19, 1 },
+ { "EnableDeferPDU", 18, 1 },
+ { "EnableFlush", 17, 1 },
+ { "EnableBytePersist", 16, 1 },
+ { "DisableTmoCng", 15, 1 },
+ { "EnableReadAhead", 14, 1 },
+ { "AllowExeption", 13, 1 },
+ { "EnableDeferACK", 12, 1 },
+ { "EnableESnd", 11, 1 },
+ { "EnableCSnd", 10, 1 },
+ { "EnablePDUE", 9, 1 },
+ { "EnablePDUC", 8, 1 },
+ { "EnableBUFI", 7, 1 },
+ { "EnableBUFE", 6, 1 },
+ { "EnableDefer", 5, 1 },
+ { "EnableClearRxmtOos", 4, 1 },
+ { "DisablePDUCng", 3, 1 },
+ { "DisablePDUTimeout", 2, 1 },
+ { "DisablePDURxmt", 1, 1 },
+ { "DisablePDUxmt", 0, 1 },
+ { "TP_PARA_REG7", 0x7d7c, 0 },
+ { "PMMaxXferLen1", 16, 16 },
+ { "PMMaxXferLen0", 0, 16 },
+ { "TP_ENG_CONFIG", 0x7d80, 0 },
+ { "TableLatencyDone", 28, 4 },
+ { "TableLatencyStart", 24, 4 },
+ { "EngineLatencyDelta", 16, 4 },
+ { "EngineLatencyMmgr", 12, 4 },
+ { "EngineLatencyWireIp6", 8, 4 },
+ { "EngineLatencyWire", 4, 4 },
+ { "EngineLatencyBase", 0, 4 },
+ { "TP_ERR_CONFIG", 0x7d8c, 0 },
+ { "TnlErrorPing", 30, 1 },
+ { "TnlErrorCsum", 29, 1 },
+ { "TnlErrorCsumIP", 28, 1 },
+ { "TnlErrorTcpOpt", 25, 1 },
+ { "TnlErrorPktLen", 24, 1 },
+ { "TnlErrorTcpHdrLen", 23, 1 },
+ { "TnlErrorIpHdrLen", 22, 1 },
+ { "TnlErrorEthHdrLen", 21, 1 },
+ { "TnlErrorAttack", 20, 1 },
+ { "TnlErrorFrag", 19, 1 },
+ { "TnlErrorIpVer", 18, 1 },
+ { "TnlErrorMac", 17, 1 },
+ { "TnlErrorAny", 16, 1 },
+ { "DropErrorPing", 14, 1 },
+ { "DropErrorCsum", 13, 1 },
+ { "DropErrorCsumIP", 12, 1 },
+ { "DropErrorTcpOpt", 9, 1 },
+ { "DropErrorPktLen", 8, 1 },
+ { "DropErrorTcpHdrLen", 7, 1 },
+ { "DropErrorIpHdrLen", 6, 1 },
+ { "DropErrorEthHdrLen", 5, 1 },
+ { "DropErrorAttack", 4, 1 },
+ { "DropErrorFrag", 3, 1 },
+ { "DropErrorIpVer", 2, 1 },
+ { "DropErrorMac", 1, 1 },
+ { "DropErrorAny", 0, 1 },
+ { "TP_TIMER_RESOLUTION", 0x7d90, 0 },
+ { "TimerResolution", 16, 8 },
+ { "TimestampResolution", 8, 8 },
+ { "DelayedACKResolution", 0, 8 },
+ { "TP_MSL", 0x7d94, 0 },
+ { "TP_RXT_MIN", 0x7d98, 0 },
+ { "TP_RXT_MAX", 0x7d9c, 0 },
+ { "TP_PERS_MIN", 0x7da0, 0 },
+ { "TP_PERS_MAX", 0x7da4, 0 },
+ { "TP_KEEP_IDLE", 0x7da8, 0 },
+ { "TP_KEEP_INTVL", 0x7dac, 0 },
+ { "TP_INIT_SRTT", 0x7db0, 0 },
+ { "MaxRtt", 16, 16 },
+ { "InitSrtt", 0, 16 },
+ { "TP_DACK_TIMER", 0x7db4, 0 },
+ { "TP_FINWAIT2_TIMER", 0x7db8, 0 },
+ { "TP_FAST_FINWAIT2_TIMER", 0x7dbc, 0 },
+ { "TP_SHIFT_CNT", 0x7dc0, 0 },
+ { "SynShiftMax", 24, 8 },
+ { "RxtShiftMaxR1", 20, 4 },
+ { "RxtShiftMaxR2", 16, 4 },
+ { "PerShiftBackoffMax", 12, 4 },
+ { "PerShiftMax", 8, 4 },
+ { "KeepaliveMaxR1", 4, 4 },
+ { "KeepaliveMaxR2", 0, 4 },
+ { "TP_TM_CONFIG", 0x7dc4, 0 },
+ { "TP_TIME_LO", 0x7dc8, 0 },
+ { "TP_TIME_HI", 0x7dcc, 0 },
+ { "TP_PORT_MTU_0", 0x7dd0, 0 },
+ { "Port1MTUValue", 16, 16 },
+ { "Port0MTUValue", 0, 16 },
+ { "TP_PORT_MTU_1", 0x7dd4, 0 },
+ { "Port3MTUValue", 16, 16 },
+ { "Port2MTUValue", 0, 16 },
+ { "TP_PACE_TABLE", 0x7dd8, 0 },
+ { "TP_CCTRL_TABLE", 0x7ddc, 0 },
+ { "RowIndex", 16, 16 },
+ { "RowValue", 0, 16 },
+ { "TP_MTU_TABLE", 0x7de4, 0 },
+ { "MTUIndex", 24, 8 },
+ { "MTUWidth", 16, 4 },
+ { "MTUValue", 0, 14 },
+ { "TP_ULP_TABLE", 0x7de8, 0 },
+ { "ULPType7Field", 28, 4 },
+ { "ULPType6Field", 24, 4 },
+ { "ULPType5Field", 20, 4 },
+ { "ULPType4Field", 16, 4 },
+ { "ULPType3Field", 12, 4 },
+ { "ULPType2Field", 8, 4 },
+ { "ULPType1Field", 4, 4 },
+ { "ULPType0Field", 0, 4 },
+ { "TP_RSS_LKP_TABLE", 0x7dec, 0 },
+ { "LkpTblRowVld", 31, 1 },
+ { "LkpTblRowIdx", 20, 10 },
+ { "LkpTblQueue1", 10, 10 },
+ { "LkpTblQueue0", 0, 10 },
+ { "TP_RSS_CONFIG", 0x7df0, 0 },
+ { "TNL4tupEnIpv6", 31, 1 },
+ { "TNL2tupEnIpv6", 30, 1 },
+ { "TNL4tupEnIpv4", 29, 1 },
+ { "TNL2tupEnIpv4", 28, 1 },
+ { "TNLTcpSel", 27, 1 },
+ { "TNLIp6Sel", 26, 1 },
+ { "TNLVrtSel", 25, 1 },
+ { "TNLMapEn", 24, 1 },
+ { "OFDHashSave", 19, 1 },
+ { "OFDVrtSel", 18, 1 },
+ { "OFDMapEn", 17, 1 },
+ { "OFDLkpEn", 16, 1 },
+ { "SYN4tupEnIpv6", 15, 1 },
+ { "SYN2tupEnIpv6", 14, 1 },
+ { "SYN4tupEnIpv4", 13, 1 },
+ { "SYN2tupEnIpv4", 12, 1 },
+ { "SYNIp6Sel", 11, 1 },
+ { "SYNVrtSel", 10, 1 },
+ { "SYNMapEn", 9, 1 },
+ { "SYNLkpEn", 8, 1 },
+ { "ChannelEnable", 7, 1 },
+ { "PortEnable", 6, 1 },
+ { "TNLAllLookup", 5, 1 },
+ { "VirtEnable", 4, 1 },
+ { "CongestionEnable", 3, 1 },
+ { "HashToeplitz", 2, 1 },
+ { "UdpEnable", 1, 1 },
+ { "Disable", 0, 1 },
+ { "TP_RSS_CONFIG_TNL", 0x7df4, 0 },
+ { "MaskSize", 28, 4 },
+ { "MaskFilter", 16, 11 },
+ { "UseWireCh", 0, 1 },
+ { "TP_RSS_CONFIG_OFD", 0x7df8, 0 },
+ { "MaskSize", 28, 4 },
+ { "RRCPLMapEn", 20, 1 },
+ { "RRCPLQueWidth", 16, 4 },
+ { "TP_RSS_CONFIG_SYN", 0x7dfc, 0 },
+ { "MaskSize", 28, 4 },
+ { "UseWireCh", 0, 1 },
+ { "TP_RSS_CONFIG_VRT", 0x7e00, 0 },
+ { "VfRdRg", 25, 1 },
+ { "VfRdEn", 24, 1 },
+ { "VfPerrEn", 23, 1 },
+ { "KeyPerrEn", 22, 1 },
+ { "DisableVlan", 21, 1 },
+ { "EnableUp0", 20, 1 },
+ { "HashDelay", 16, 4 },
+ { "VfWrAddr", 8, 7 },
+ { "KeyMode", 6, 2 },
+ { "VfWrEn", 5, 1 },
+ { "KeyWrEn", 4, 1 },
+ { "KeyWrAddr", 0, 4 },
+ { "TP_RSS_CONFIG_CNG", 0x7e04, 0 },
+ { "ChnCount3", 31, 1 },
+ { "ChnCount2", 30, 1 },
+ { "ChnCount1", 29, 1 },
+ { "ChnCount0", 28, 1 },
+ { "ChnUndFlow3", 27, 1 },
+ { "ChnUndFlow2", 26, 1 },
+ { "ChnUndFlow1", 25, 1 },
+ { "ChnUndFlow0", 24, 1 },
+ { "ChnOvrFlow3", 23, 1 },
+ { "ChnOvrFlow2", 22, 1 },
+ { "ChnOvrFlow1", 21, 1 },
+ { "ChnOvrFlow0", 20, 1 },
+ { "RstChn3", 19, 1 },
+ { "RstChn2", 18, 1 },
+ { "RstChn1", 17, 1 },
+ { "RstChn0", 16, 1 },
+ { "UpdVld", 15, 1 },
+ { "Xoff", 14, 1 },
+ { "UpdChn3", 13, 1 },
+ { "UpdChn2", 12, 1 },
+ { "UpdChn1", 11, 1 },
+ { "UpdChn0", 10, 1 },
+ { "Queue", 0, 10 },
+ { "TP_LA_TABLE_0", 0x7e10, 0 },
+ { "VirtPort1Table", 16, 16 },
+ { "VirtPort0Table", 0, 16 },
+ { "TP_LA_TABLE_1", 0x7e14, 0 },
+ { "VirtPort3Table", 16, 16 },
+ { "VirtPort2Table", 0, 16 },
+ { "TP_TM_PIO_ADDR", 0x7e18, 0 },
+ { "TP_TM_PIO_DATA", 0x7e1c, 0 },
+ { "TP_MOD_CONFIG", 0x7e24, 0 },
+ { "RxChannelWeight1", 24, 8 },
+ { "RXChannelWeight0", 16, 8 },
+ { "TimerMode", 8, 8 },
+ { "TxChannelXoffEn", 0, 4 },
+ { "TP_TX_MOD_QUEUE_REQ_MAP", 0x7e28, 0 },
+ { "RX_MOD_WEIGHT", 24, 8 },
+ { "TX_MOD_WEIGHT", 16, 8 },
+ { "TX_MOD_QUEUE_REQ_MAP", 0, 16 },
+ { "TP_TX_MOD_QUEUE_WEIGHT1", 0x7e2c, 0 },
+ { "TP_TX_MOD_QUEUE_WEIGHT7", 24, 8 },
+ { "TP_TX_MOD_QUEUE_WEIGHT6", 16, 8 },
+ { "TP_TX_MOD_QUEUE_WEIGHT5", 8, 8 },
+ { "TP_TX_MOD_QUEUE_WEIGHT4", 0, 8 },
+ { "TP_TX_MOD_QUEUE_WEIGHT0", 0x7e30, 0 },
+ { "TP_TX_MOD_QUEUE_WEIGHT3", 24, 8 },
+ { "TP_TX_MOD_QUEUE_WEIGHT2", 16, 8 },
+ { "TP_TX_MOD_QUEUE_WEIGHT1", 8, 8 },
+ { "TP_TX_MOD_QUEUE_WEIGHT0", 0, 8 },
+ { "TP_TX_MOD_CHANNEL_WEIGHT", 0x7e34, 0 },
+ { "CH3", 24, 8 },
+ { "CH2", 16, 8 },
+ { "CH1", 8, 8 },
+ { "CH0", 0, 8 },
+ { "TP_MOD_RATE_LIMIT", 0x7e38, 0 },
+ { "RX_MOD_RATE_LIMIT_INC", 24, 8 },
+ { "RX_MOD_RATE_LIMIT_TICK", 16, 8 },
+ { "TX_MOD_RATE_LIMIT_INC", 8, 8 },
+ { "TX_MOD_RATE_LIMIT_TICK", 0, 8 },
+ { "TP_PIO_ADDR", 0x7e40, 0 },
+ { "TP_PIO_DATA", 0x7e44, 0 },
+ { "TP_RESET", 0x7e4c, 0 },
+ { "FlstInitEnable", 1, 1 },
+ { "TPReset", 0, 1 },
+ { "TP_MIB_INDEX", 0x7e50, 0 },
+ { "TP_MIB_DATA", 0x7e54, 0 },
+ { "TP_SYNC_TIME_HI", 0x7e58, 0 },
+ { "TP_SYNC_TIME_LO", 0x7e5c, 0 },
+ { "TP_CMM_MM_RX_FLST_BASE", 0x7e60, 0 },
+ { "TP_CMM_MM_TX_FLST_BASE", 0x7e64, 0 },
+ { "TP_CMM_MM_PS_FLST_BASE", 0x7e68, 0 },
+ { "TP_CMM_MM_MAX_PSTRUCT", 0x7e6c, 0 },
+ { "TP_INT_ENABLE", 0x7e70, 0 },
+ { "FlmTxFlstEmpty", 30, 1 },
+ { "RssLkpPerr", 29, 1 },
+ { "FlmPerrSet", 28, 1 },
+ { "ProtocolSramPerr", 27, 1 },
+ { "ArpLutPerr", 26, 1 },
+ { "CmRcfOpPerr", 25, 1 },
+ { "CmCachePerr", 24, 1 },
+ { "CmRcfDataPerr", 23, 1 },
+ { "DbL2tLutPerr", 22, 1 },
+ { "DbTxTidPerr", 21, 1 },
+ { "DbExtPerr", 20, 1 },
+ { "DbOpPerr", 19, 1 },
+ { "TmCachePerr", 18, 1 },
+ { "ETpOutCplFifoPerr", 17, 1 },
+ { "ETpOutTcpFifoPerr", 16, 1 },
+ { "ETpOutIpFifoPerr", 15, 1 },
+ { "ETpOutEthFifoPerr", 14, 1 },
+ { "ETpInCplFifoPerr", 13, 1 },
+ { "ETpInTcpOptFifoPerr", 12, 1 },
+ { "ETpInTcpFifoPerr", 11, 1 },
+ { "ETpInIpFifoPerr", 10, 1 },
+ { "ETpInEthFifoPerr", 9, 1 },
+ { "CTpOutCplFifoPerr", 8, 1 },
+ { "CTpOutTcpFifoPerr", 7, 1 },
+ { "CTpOutIpFifoPerr", 6, 1 },
+ { "CTpOutEthFifoPerr", 5, 1 },
+ { "CTpInCplFifoPerr", 4, 1 },
+ { "CTpInTcpOpFifoPerr", 3, 1 },
+ { "PduFbkFifoPerr", 2, 1 },
+ { "CmOpExtFifoPerr", 1, 1 },
+ { "DelInvFifoPerr", 0, 1 },
+ { "TP_INT_CAUSE", 0x7e74, 0 },
+ { "FlmTxFlstEmpty", 30, 1 },
+ { "RssLkpPerr", 29, 1 },
+ { "FlmPerrSet", 28, 1 },
+ { "ProtocolSramPerr", 27, 1 },
+ { "ArpLutPerr", 26, 1 },
+ { "CmRcfOpPerr", 25, 1 },
+ { "CmCachePerr", 24, 1 },
+ { "CmRcfDataPerr", 23, 1 },
+ { "DbL2tLutPerr", 22, 1 },
+ { "DbTxTidPerr", 21, 1 },
+ { "DbExtPerr", 20, 1 },
+ { "DbOpPerr", 19, 1 },
+ { "TmCachePerr", 18, 1 },
+ { "ETpOutCplFifoPerr", 17, 1 },
+ { "ETpOutTcpFifoPerr", 16, 1 },
+ { "ETpOutIpFifoPerr", 15, 1 },
+ { "ETpOutEthFifoPerr", 14, 1 },
+ { "ETpInCplFifoPerr", 13, 1 },
+ { "ETpInTcpOptFifoPerr", 12, 1 },
+ { "ETpInTcpFifoPerr", 11, 1 },
+ { "ETpInIpFifoPerr", 10, 1 },
+ { "ETpInEthFifoPerr", 9, 1 },
+ { "CTpOutCplFifoPerr", 8, 1 },
+ { "CTpOutTcpFifoPerr", 7, 1 },
+ { "CTpOutIpFifoPerr", 6, 1 },
+ { "CTpOutEthFifoPerr", 5, 1 },
+ { "CTpInCplFifoPerr", 4, 1 },
+ { "CTpInTcpOpFifoPerr", 3, 1 },
+ { "PduFbkFifoPerr", 2, 1 },
+ { "CmOpExtFifoPerr", 1, 1 },
+ { "DelInvFifoPerr", 0, 1 },
+ { "TP_PER_ENABLE", 0x7e78, 0 },
+ { "FlmTxFlstEmpty", 30, 1 },
+ { "RssLkpPerr", 29, 1 },
+ { "FlmPerrSet", 28, 1 },
+ { "ProtocolSramPerr", 27, 1 },
+ { "ArpLutPerr", 26, 1 },
+ { "CmRcfOpPerr", 25, 1 },
+ { "CmCachePerr", 24, 1 },
+ { "CmRcfDataPerr", 23, 1 },
+ { "DbL2tLutPerr", 22, 1 },
+ { "DbTxTidPerr", 21, 1 },
+ { "DbExtPerr", 20, 1 },
+ { "DbOpPerr", 19, 1 },
+ { "TmCachePerr", 18, 1 },
+ { "ETpOutCplFifoPerr", 17, 1 },
+ { "ETpOutTcpFifoPerr", 16, 1 },
+ { "ETpOutIpFifoPerr", 15, 1 },
+ { "ETpOutEthFifoPerr", 14, 1 },
+ { "ETpInCplFifoPerr", 13, 1 },
+ { "ETpInTcpOptFifoPerr", 12, 1 },
+ { "ETpInTcpFifoPerr", 11, 1 },
+ { "ETpInIpFifoPerr", 10, 1 },
+ { "ETpInEthFifoPerr", 9, 1 },
+ { "CTpOutCplFifoPerr", 8, 1 },
+ { "CTpOutTcpFifoPerr", 7, 1 },
+ { "CTpOutIpFifoPerr", 6, 1 },
+ { "CTpOutEthFifoPerr", 5, 1 },
+ { "CTpInCplFifoPerr", 4, 1 },
+ { "CTpInTcpOpFifoPerr", 3, 1 },
+ { "PduFbkFifoPerr", 2, 1 },
+ { "CmOpExtFifoPerr", 1, 1 },
+ { "DelInvFifoPerr", 0, 1 },
+ { "TP_FLM_FREE_PS_CNT", 0x7e80, 0 },
+ { "TP_FLM_FREE_RX_CNT", 0x7e84, 0 },
+ { "FreeRxPageChn", 28, 1 },
+ { "FreeRxPageCount", 0, 21 },
+ { "TP_FLM_FREE_TX_CNT", 0x7e88, 0 },
+ { "FreeTxPageChn", 28, 2 },
+ { "FreeTxPageCount", 0, 21 },
+ { "TP_TM_HEAP_PUSH_CNT", 0x7e8c, 0 },
+ { "TP_TM_HEAP_POP_CNT", 0x7e90, 0 },
+ { "TP_TM_DACK_PUSH_CNT", 0x7e94, 0 },
+ { "TP_TM_DACK_POP_CNT", 0x7e98, 0 },
+ { "TP_TM_MOD_PUSH_CNT", 0x7e9c, 0 },
+ { "TP_MOD_POP_CNT", 0x7ea0, 0 },
+ { "TP_TIMER_SEPARATOR", 0x7ea4, 0 },
+ { "TimerSeparator", 16, 16 },
+ { "DisableTimeFreeze", 0, 1 },
+ { "TP_DEBUG_FLAGS", 0x7eac, 0 },
+ { "RxTimerDackFirst", 26, 1 },
+ { "RxTimerDack", 25, 1 },
+ { "RxTimerHeartbeat", 24, 1 },
+ { "RxPawsDrop", 23, 1 },
+ { "RxUrgDataDrop", 22, 1 },
+ { "RxFutureData", 21, 1 },
+ { "RxRcvRxmData", 20, 1 },
+ { "RxRcvOooDataFin", 19, 1 },
+ { "RxRcvOooData", 18, 1 },
+ { "RxRcvWndZero", 17, 1 },
+ { "RxRcvWndLtMss", 16, 1 },
+ { "TxDupAckInc", 11, 1 },
+ { "TxRxmUrg", 10, 1 },
+ { "TxRxmFin", 9, 1 },
+ { "TxRxmSyn", 8, 1 },
+ { "TxRxmNewReno", 7, 1 },
+ { "TxRxmFast", 6, 1 },
+ { "TxRxmTimer", 5, 1 },
+ { "TxRxmTimerKeepalive", 4, 1 },
+ { "TxRxmTimerPersist", 3, 1 },
+ { "TxRcvAdvShrunk", 2, 1 },
+ { "TxRcvAdvZero", 1, 1 },
+ { "TxRcvAdvLtMss", 0, 1 },
+ { "TP_RX_SCHED", 0x7eb0, 0 },
+ { "CommitReset1", 31, 1 },
+ { "CommitReset0", 30, 1 },
+ { "ForceCong1", 29, 1 },
+ { "ForceCong0", 28, 1 },
+ { "EnableLpbkFull1", 26, 2 },
+ { "EnableLpbkFull0", 24, 2 },
+ { "EnableFifoFull1", 22, 2 },
+ { "EnablePcmdFull1", 20, 2 },
+ { "EnableHdrFull1", 18, 2 },
+ { "EnableFifoFull0", 16, 2 },
+ { "EnablePcmdFull0", 14, 2 },
+ { "EnableHdrFull0", 12, 2 },
+ { "CommitLimit1", 6, 6 },
+ { "CommitLimit0", 0, 6 },
+ { "TP_TX_SCHED", 0x7eb4, 0 },
+ { "CommitReset3", 31, 1 },
+ { "CommitReset2", 30, 1 },
+ { "CommitReset1", 29, 1 },
+ { "CommitReset0", 28, 1 },
+ { "ForceCong3", 27, 1 },
+ { "ForceCong2", 26, 1 },
+ { "ForceCong1", 25, 1 },
+ { "ForceCong0", 24, 1 },
+ { "CommitLimit3", 18, 6 },
+ { "CommitLimit2", 12, 6 },
+ { "CommitLimit1", 6, 6 },
+ { "CommitLimit0", 0, 6 },
+ { "TP_FX_SCHED", 0x7eb8, 0 },
+ { "TxChnXoff3", 19, 1 },
+ { "TxChnXoff2", 18, 1 },
+ { "TxChnXoff1", 17, 1 },
+ { "TxChnXoff0", 16, 1 },
+ { "TxModXoff7", 15, 1 },
+ { "TxModXoff6", 14, 1 },
+ { "TxModXoff5", 13, 1 },
+ { "TxModXoff4", 12, 1 },
+ { "TxModXoff3", 11, 1 },
+ { "TxModXoff2", 10, 1 },
+ { "TxModXoff1", 9, 1 },
+ { "TxModXoff0", 8, 1 },
+ { "RxChnXoff3", 7, 1 },
+ { "RxChnXoff2", 6, 1 },
+ { "RxChnXoff1", 5, 1 },
+ { "RxChnXoff0", 4, 1 },
+ { "RxModXoff1", 1, 1 },
+ { "RxModXoff0", 0, 1 },
+ { "TP_TX_ORATE", 0x7ebc, 0 },
+ { "OfdRate3", 24, 8 },
+ { "OfdRate2", 16, 8 },
+ { "OfdRate1", 8, 8 },
+ { "OfdRate0", 0, 8 },
+ { "TP_IX_SCHED0", 0x7ec0, 0 },
+ { "TP_IX_SCHED1", 0x7ec4, 0 },
+ { "TP_IX_SCHED2", 0x7ec8, 0 },
+ { "TP_IX_SCHED3", 0x7ecc, 0 },
+ { "TP_TX_TRATE", 0x7ed0, 0 },
+ { "TnlRate3", 24, 8 },
+ { "TnlRate2", 16, 8 },
+ { "TnlRate1", 8, 8 },
+ { "TnlRate0", 0, 8 },
+ { "TP_DBG_LA_CONFIG", 0x7ed4, 0 },
+ { "DbgLaOpcEnable", 24, 8 },
+ { "DbgLaWhlf", 23, 1 },
+ { "DbgLaWptr", 16, 7 },
+ { "DbgLaMode", 14, 2 },
+ { "DbgLaFatalFreeze", 13, 1 },
+ { "DbgLaEnable", 12, 1 },
+ { "DbgLaRptr", 0, 7 },
+ { "TP_DBG_LA_DATAL", 0x7ed8, 0 },
+ { "TP_DBG_LA_DATAH", 0x7edc, 0 },
+ { "TP_PROTOCOL_CNTRL", 0x7ee8, 0 },
+ { "WriteEnable", 31, 1 },
+ { "TcamEnable", 10, 1 },
+ { "BlockSelect", 8, 2 },
+ { "LineAddress", 1, 7 },
+ { "RequestDone", 0, 1 },
+ { "TP_PROTOCOL_DATA0", 0x7eec, 0 },
+ { "TP_PROTOCOL_DATA1", 0x7ef0, 0 },
+ { "TP_PROTOCOL_DATA2", 0x7ef4, 0 },
+ { "TP_PROTOCOL_DATA3", 0x7ef8, 0 },
+ { "TP_PROTOCOL_DATA4", 0x7efc, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_ulp_tx_regs[] = {
+ { "ULP_TX_CONFIG", 0x8dc0, 0 },
+ { "stag_mix_enable", 2, 1 },
+ { "stagf_fix_disable", 1, 1 },
+ { "extra_tag_insertion_enable", 0, 1 },
+ { "ULP_TX_PERR_INJECT", 0x8dc4, 0 },
+ { "MemSel", 1, 5 },
+ { "InjectDataErr", 0, 1 },
+ { "ULP_TX_INT_ENABLE", 0x8dc8, 0 },
+ { "Pbl_bound_err_ch3", 31, 1 },
+ { "Pbl_bound_err_ch2", 30, 1 },
+ { "Pbl_bound_err_ch1", 29, 1 },
+ { "Pbl_bound_err_ch0", 28, 1 },
+ { "sge2ulp_fifo_perr_set3", 27, 1 },
+ { "sge2ulp_fifo_perr_set2", 26, 1 },
+ { "sge2ulp_fifo_perr_set1", 25, 1 },
+ { "sge2ulp_fifo_perr_set0", 24, 1 },
+ { "cim2ulp_fifo_perr_set3", 23, 1 },
+ { "cim2ulp_fifo_perr_set2", 22, 1 },
+ { "cim2ulp_fifo_perr_set1", 21, 1 },
+ { "cim2ulp_fifo_perr_set0", 20, 1 },
+ { "CQE_fifo_perr_set3", 19, 1 },
+ { "CQE_fifo_perr_set2", 18, 1 },
+ { "CQE_fifo_perr_set1", 17, 1 },
+ { "CQE_fifo_perr_set0", 16, 1 },
+ { "pbl_fifo_perr_set3", 15, 1 },
+ { "pbl_fifo_perr_set2", 14, 1 },
+ { "pbl_fifo_perr_set1", 13, 1 },
+ { "pbl_fifo_perr_set0", 12, 1 },
+ { "cmd_fifo_perr_set3", 11, 1 },
+ { "cmd_fifo_perr_set2", 10, 1 },
+ { "cmd_fifo_perr_set1", 9, 1 },
+ { "cmd_fifo_perr_set0", 8, 1 },
+ { "lso_hdr_sram_perr_set3", 7, 1 },
+ { "lso_hdr_sram_perr_set2", 6, 1 },
+ { "lso_hdr_sram_perr_set1", 5, 1 },
+ { "lso_hdr_sram_perr_set0", 4, 1 },
+ { "imm_data_perr_set_ch3", 3, 1 },
+ { "imm_data_perr_set_ch2", 2, 1 },
+ { "imm_data_perr_set_ch1", 1, 1 },
+ { "imm_data_perr_set_ch0", 0, 1 },
+ { "ULP_TX_INT_CAUSE", 0x8dcc, 0 },
+ { "Pbl_bound_err_ch3", 31, 1 },
+ { "Pbl_bound_err_ch2", 30, 1 },
+ { "Pbl_bound_err_ch1", 29, 1 },
+ { "Pbl_bound_err_ch0", 28, 1 },
+ { "sge2ulp_fifo_perr_set3", 27, 1 },
+ { "sge2ulp_fifo_perr_set2", 26, 1 },
+ { "sge2ulp_fifo_perr_set1", 25, 1 },
+ { "sge2ulp_fifo_perr_set0", 24, 1 },
+ { "cim2ulp_fifo_perr_set3", 23, 1 },
+ { "cim2ulp_fifo_perr_set2", 22, 1 },
+ { "cim2ulp_fifo_perr_set1", 21, 1 },
+ { "cim2ulp_fifo_perr_set0", 20, 1 },
+ { "CQE_fifo_perr_set3", 19, 1 },
+ { "CQE_fifo_perr_set2", 18, 1 },
+ { "CQE_fifo_perr_set1", 17, 1 },
+ { "CQE_fifo_perr_set0", 16, 1 },
+ { "pbl_fifo_perr_set3", 15, 1 },
+ { "pbl_fifo_perr_set2", 14, 1 },
+ { "pbl_fifo_perr_set1", 13, 1 },
+ { "pbl_fifo_perr_set0", 12, 1 },
+ { "cmd_fifo_perr_set3", 11, 1 },
+ { "cmd_fifo_perr_set2", 10, 1 },
+ { "cmd_fifo_perr_set1", 9, 1 },
+ { "cmd_fifo_perr_set0", 8, 1 },
+ { "lso_hdr_sram_perr_set3", 7, 1 },
+ { "lso_hdr_sram_perr_set2", 6, 1 },
+ { "lso_hdr_sram_perr_set1", 5, 1 },
+ { "lso_hdr_sram_perr_set0", 4, 1 },
+ { "imm_data_perr_set_ch3", 3, 1 },
+ { "imm_data_perr_set_ch2", 2, 1 },
+ { "imm_data_perr_set_ch1", 1, 1 },
+ { "imm_data_perr_set_ch0", 0, 1 },
+ { "ULP_TX_PERR_ENABLE", 0x8dd0, 0 },
+ { "sge2ulp_fifo_perr_set3", 27, 1 },
+ { "sge2ulp_fifo_perr_set2", 26, 1 },
+ { "sge2ulp_fifo_perr_set1", 25, 1 },
+ { "sge2ulp_fifo_perr_set0", 24, 1 },
+ { "cim2ulp_fifo_perr_set3", 23, 1 },
+ { "cim2ulp_fifo_perr_set2", 22, 1 },
+ { "cim2ulp_fifo_perr_set1", 21, 1 },
+ { "cim2ulp_fifo_perr_set0", 20, 1 },
+ { "CQE_fifo_perr_set3", 19, 1 },
+ { "CQE_fifo_perr_set2", 18, 1 },
+ { "CQE_fifo_perr_set1", 17, 1 },
+ { "CQE_fifo_perr_set0", 16, 1 },
+ { "pbl_fifo_perr_set3", 15, 1 },
+ { "pbl_fifo_perr_set2", 14, 1 },
+ { "pbl_fifo_perr_set1", 13, 1 },
+ { "pbl_fifo_perr_set0", 12, 1 },
+ { "cmd_fifo_perr_set3", 11, 1 },
+ { "cmd_fifo_perr_set2", 10, 1 },
+ { "cmd_fifo_perr_set1", 9, 1 },
+ { "cmd_fifo_perr_set0", 8, 1 },
+ { "lso_hdr_sram_perr_set3", 7, 1 },
+ { "lso_hdr_sram_perr_set2", 6, 1 },
+ { "lso_hdr_sram_perr_set1", 5, 1 },
+ { "lso_hdr_sram_perr_set0", 4, 1 },
+ { "imm_data_perr_set_ch3", 3, 1 },
+ { "imm_data_perr_set_ch2", 2, 1 },
+ { "imm_data_perr_set_ch1", 1, 1 },
+ { "imm_data_perr_set_ch0", 0, 1 },
+ { "ULP_TX_TPT_LLIMIT", 0x8dd4, 0 },
+ { "ULP_TX_TPT_ULIMIT", 0x8dd8, 0 },
+ { "ULP_TX_PBL_LLIMIT", 0x8ddc, 0 },
+ { "ULP_TX_PBL_ULIMIT", 0x8de0, 0 },
+ { "ULP_TX_CPL_ERR_OFFSET", 0x8de4, 0 },
+ { "ULP_TX_CPL_ERR_MASK_L", 0x8de8, 0 },
+ { "ULP_TX_CPL_ERR_MASK_H", 0x8dec, 0 },
+ { "ULP_TX_CPL_ERR_VALUE_L", 0x8df0, 0 },
+ { "ULP_TX_CPL_ERR_VALUE_H", 0x8df4, 0 },
+ { "ULP_TX_CPL_PACK_SIZE1", 0x8df8, 0 },
+ { "Ch3Size1", 24, 8 },
+ { "Ch2Size1", 16, 8 },
+ { "Ch1Size1", 8, 8 },
+ { "Ch0Size1", 0, 8 },
+ { "ULP_TX_CPL_PACK_SIZE2", 0x8dfc, 0 },
+ { "Ch3Size2", 24, 8 },
+ { "Ch2Size2", 16, 8 },
+ { "Ch1Size2", 8, 8 },
+ { "Ch0Size2", 0, 8 },
+ { "ULP_TX_ERR_MSG2CIM", 0x8e00, 0 },
+ { "ULP_TX_ERR_TABLE_BASE", 0x8e04, 0 },
+ { "ULP_TX_ERR_CNT_CH0", 0x8e10, 0 },
+ { "ULP_TX_ERR_CNT_CH1", 0x8e14, 0 },
+ { "ULP_TX_ERR_CNT_CH2", 0x8e18, 0 },
+ { "ULP_TX_ERR_CNT_CH3", 0x8e1c, 0 },
+ { "ULP_TX_ULP2TP_BIST_CMD", 0x8e30, 0 },
+ { "ULP_TX_ULP2TP_BIST_ERROR_CNT", 0x8e34, 0 },
+ { "ULP_TX_FPGA_CMD_CTRL", 0x8e38, 0 },
+ { "ULP_TX_FPGA_CMD_0", 0x8e3c, 0 },
+ { "ULP_TX_FPGA_CMD_1", 0x8e40, 0 },
+ { "ULP_TX_FPGA_CMD_2", 0x8e44, 0 },
+ { "ULP_TX_FPGA_CMD_3", 0x8e48, 0 },
+ { "ULP_TX_FPGA_CMD_4", 0x8e4c, 0 },
+ { "ULP_TX_FPGA_CMD_5", 0x8e50, 0 },
+ { "ULP_TX_FPGA_CMD_6", 0x8e54, 0 },
+ { "ULP_TX_FPGA_CMD_7", 0x8e58, 0 },
+ { "ULP_TX_FPGA_CMD_8", 0x8e5c, 0 },
+ { "ULP_TX_FPGA_CMD_9", 0x8e60, 0 },
+ { "ULP_TX_FPGA_CMD_10", 0x8e64, 0 },
+ { "ULP_TX_FPGA_CMD_11", 0x8e68, 0 },
+ { "ULP_TX_FPGA_CMD_12", 0x8e6c, 0 },
+ { "ULP_TX_FPGA_CMD_13", 0x8e70, 0 },
+ { "ULP_TX_FPGA_CMD_14", 0x8e74, 0 },
+ { "ULP_TX_FPGA_CMD_15", 0x8e78, 0 },
+ { "ULP_TX_SE_CNT_ERR", 0x8ea0, 0 },
+ { "ERR_CH3", 12, 4 },
+ { "ERR_CH2", 8, 4 },
+ { "ERR_CH1", 4, 4 },
+ { "ERR_CH0", 0, 4 },
+ { "ULP_TX_SE_CNT_CLR", 0x8ea4, 0 },
+ { "CLR_DROP", 16, 4 },
+ { "CLR_CH3", 12, 4 },
+ { "CLR_CH2", 8, 4 },
+ { "CLR_CH1", 4, 4 },
+ { "CLR_CH0", 0, 4 },
+ { "ULP_TX_SE_CNT_CH0", 0x8ea8, 0 },
+ { "SOP_CNT_ULP2TP", 28, 4 },
+ { "EOP_CNT_ULP2TP", 24, 4 },
+ { "SOP_CNT_LSO_IN", 20, 4 },
+ { "EOP_CNT_LSO_IN", 16, 4 },
+ { "SOP_CNT_ALG_IN", 12, 4 },
+ { "EOP_CNT_ALG_IN", 8, 4 },
+ { "SOP_CNT_CIM2ULP", 4, 4 },
+ { "EOP_CNT_CIM2ULP", 0, 4 },
+ { "ULP_TX_SE_CNT_CH1", 0x8eac, 0 },
+ { "SOP_CNT_ULP2TP", 28, 4 },
+ { "EOP_CNT_ULP2TP", 24, 4 },
+ { "SOP_CNT_LSO_IN", 20, 4 },
+ { "EOP_CNT_LSO_IN", 16, 4 },
+ { "SOP_CNT_ALG_IN", 12, 4 },
+ { "EOP_CNT_ALG_IN", 8, 4 },
+ { "SOP_CNT_CIM2ULP", 4, 4 },
+ { "EOP_CNT_CIM2ULP", 0, 4 },
+ { "ULP_TX_SE_CNT_CH2", 0x8eb0, 0 },
+ { "SOP_CNT_ULP2TP", 28, 4 },
+ { "EOP_CNT_ULP2TP", 24, 4 },
+ { "SOP_CNT_LSO_IN", 20, 4 },
+ { "EOP_CNT_LSO_IN", 16, 4 },
+ { "SOP_CNT_ALG_IN", 12, 4 },
+ { "EOP_CNT_ALG_IN", 8, 4 },
+ { "SOP_CNT_CIM2ULP", 4, 4 },
+ { "EOP_CNT_CIM2ULP", 0, 4 },
+ { "ULP_TX_SE_CNT_CH3", 0x8eb4, 0 },
+ { "SOP_CNT_ULP2TP", 28, 4 },
+ { "EOP_CNT_ULP2TP", 24, 4 },
+ { "SOP_CNT_LSO_IN", 20, 4 },
+ { "EOP_CNT_LSO_IN", 16, 4 },
+ { "SOP_CNT_ALG_IN", 12, 4 },
+ { "EOP_CNT_ALG_IN", 8, 4 },
+ { "SOP_CNT_CIM2ULP", 4, 4 },
+ { "EOP_CNT_CIM2ULP", 0, 4 },
+ { "ULP_TX_DROP_CNT", 0x8eb8, 0 },
+ { "DROP_CH3", 12, 4 },
+ { "DROP_CH2", 8, 4 },
+ { "DROP_CH1", 4, 4 },
+ { "DROP_CH0", 0, 4 },
+ { "ULP_TX_LA_RDPTR_0", 0x8ec0, 0 },
+ { "ULP_TX_LA_RDDATA_0", 0x8ec4, 0 },
+ { "ULP_TX_LA_WRPTR_0", 0x8ec8, 0 },
+ { "ULP_TX_LA_RESERVED_0", 0x8ecc, 0 },
+ { "ULP_TX_LA_RDPTR_1", 0x8ed0, 0 },
+ { "ULP_TX_LA_RDDATA_1", 0x8ed4, 0 },
+ { "ULP_TX_LA_WRPTR_1", 0x8ed8, 0 },
+ { "ULP_TX_LA_RESERVED_1", 0x8edc, 0 },
+ { "ULP_TX_LA_RDPTR_2", 0x8ee0, 0 },
+ { "ULP_TX_LA_RDDATA_2", 0x8ee4, 0 },
+ { "ULP_TX_LA_WRPTR_2", 0x8ee8, 0 },
+ { "ULP_TX_LA_RESERVED_2", 0x8eec, 0 },
+ { "ULP_TX_LA_RDPTR_3", 0x8ef0, 0 },
+ { "ULP_TX_LA_RDDATA_3", 0x8ef4, 0 },
+ { "ULP_TX_LA_WRPTR_3", 0x8ef8, 0 },
+ { "ULP_TX_LA_RESERVED_3", 0x8efc, 0 },
+ { "ULP_TX_LA_RDPTR_4", 0x8f00, 0 },
+ { "ULP_TX_LA_RDDATA_4", 0x8f04, 0 },
+ { "ULP_TX_LA_WRPTR_4", 0x8f08, 0 },
+ { "ULP_TX_LA_RESERVED_4", 0x8f0c, 0 },
+ { "ULP_TX_LA_RDPTR_5", 0x8f10, 0 },
+ { "ULP_TX_LA_RDDATA_5", 0x8f14, 0 },
+ { "ULP_TX_LA_WRPTR_5", 0x8f18, 0 },
+ { "ULP_TX_LA_RESERVED_5", 0x8f1c, 0 },
+ { "ULP_TX_LA_RDPTR_6", 0x8f20, 0 },
+ { "ULP_TX_LA_RDDATA_6", 0x8f24, 0 },
+ { "ULP_TX_LA_WRPTR_6", 0x8f28, 0 },
+ { "ULP_TX_LA_RESERVED_6", 0x8f2c, 0 },
+ { "ULP_TX_LA_RDPTR_7", 0x8f30, 0 },
+ { "ULP_TX_LA_RDDATA_7", 0x8f34, 0 },
+ { "ULP_TX_LA_WRPTR_7", 0x8f38, 0 },
+ { "ULP_TX_LA_RESERVED_7", 0x8f3c, 0 },
+ { "ULP_TX_LA_RDPTR_8", 0x8f40, 0 },
+ { "ULP_TX_LA_RDDATA_8", 0x8f44, 0 },
+ { "ULP_TX_LA_WRPTR_8", 0x8f48, 0 },
+ { "ULP_TX_LA_RESERVED_8", 0x8f4c, 0 },
+ { "ULP_TX_LA_RDPTR_9", 0x8f50, 0 },
+ { "ULP_TX_LA_RDDATA_9", 0x8f54, 0 },
+ { "ULP_TX_LA_WRPTR_9", 0x8f58, 0 },
+ { "ULP_TX_LA_RESERVED_9", 0x8f5c, 0 },
+ { "ULP_TX_LA_RDPTR_10", 0x8f60, 0 },
+ { "ULP_TX_LA_RDDATA_10", 0x8f64, 0 },
+ { "ULP_TX_LA_WRPTR_10", 0x8f68, 0 },
+ { "ULP_TX_LA_RESERVED_10", 0x8f6c, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_pm_rx_regs[] = {
+ { "PM_RX_CFG", 0x8fc0, 0 },
+ { "ch1_output", 27, 5 },
+ { "strobe1", 16, 1 },
+ { "ch1_input", 11, 5 },
+ { "ch2_input", 6, 5 },
+ { "ch3_input", 1, 5 },
+ { "strobe0", 0, 1 },
+ { "PM_RX_MODE", 0x8fc4, 0 },
+ { "use_bundle_len", 4, 1 },
+ { "stat_to_ch", 3, 1 },
+ { "stat_from_ch", 1, 2 },
+ { "prefetch_enable", 0, 1 },
+ { "PM_RX_STAT_CONFIG", 0x8fc8, 0 },
+ { "PM_RX_STAT_COUNT", 0x8fcc, 0 },
+ { "PM_RX_STAT_LSB", 0x8fd0, 0 },
+ { "PM_RX_STAT_MSB", 0x8fd4, 0 },
+ { "PM_RX_INT_ENABLE", 0x8fd8, 0 },
+ { "zero_e_cmd_error", 22, 1 },
+ { "iespi0_fifo2x_Rx_framing_error", 21, 1 },
+ { "iespi1_fifo2x_Rx_framing_error", 20, 1 },
+ { "iespi2_fifo2x_Rx_framing_error", 19, 1 },
+ { "iespi3_fifo2x_Rx_framing_error", 18, 1 },
+ { "iespi0_Rx_framing_error", 17, 1 },
+ { "iespi1_Rx_framing_error", 16, 1 },
+ { "iespi2_Rx_framing_error", 15, 1 },
+ { "iespi3_Rx_framing_error", 14, 1 },
+ { "iespi0_Tx_framing_error", 13, 1 },
+ { "iespi1_Tx_framing_error", 12, 1 },
+ { "iespi2_Tx_framing_error", 11, 1 },
+ { "iespi3_Tx_framing_error", 10, 1 },
+ { "ocspi0_Rx_framing_error", 9, 1 },
+ { "ocspi1_Rx_framing_error", 8, 1 },
+ { "ocspi0_Tx_framing_error", 7, 1 },
+ { "ocspi1_Tx_framing_error", 6, 1 },
+ { "ocspi0_ofifo2x_Tx_framing_error", 5, 1 },
+ { "ocspi1_ofifo2x_Tx_framing_error", 4, 1 },
+ { "ocspi_par_error", 3, 1 },
+ { "db_options_par_error", 2, 1 },
+ { "iespi_par_error", 1, 1 },
+ { "e_pcmd_par_error", 0, 1 },
+ { "PM_RX_INT_CAUSE", 0x8fdc, 0 },
+ { "zero_e_cmd_error", 22, 1 },
+ { "iespi0_fifo2x_Rx_framing_error", 21, 1 },
+ { "iespi1_fifo2x_Rx_framing_error", 20, 1 },
+ { "iespi2_fifo2x_Rx_framing_error", 19, 1 },
+ { "iespi3_fifo2x_Rx_framing_error", 18, 1 },
+ { "iespi0_Rx_framing_error", 17, 1 },
+ { "iespi1_Rx_framing_error", 16, 1 },
+ { "iespi2_Rx_framing_error", 15, 1 },
+ { "iespi3_Rx_framing_error", 14, 1 },
+ { "iespi0_Tx_framing_error", 13, 1 },
+ { "iespi1_Tx_framing_error", 12, 1 },
+ { "iespi2_Tx_framing_error", 11, 1 },
+ { "iespi3_Tx_framing_error", 10, 1 },
+ { "ocspi0_Rx_framing_error", 9, 1 },
+ { "ocspi1_Rx_framing_error", 8, 1 },
+ { "ocspi0_Tx_framing_error", 7, 1 },
+ { "ocspi1_Tx_framing_error", 6, 1 },
+ { "ocspi0_ofifo2x_Tx_framing_error", 5, 1 },
+ { "ocspi1_ofifo2x_Tx_framing_error", 4, 1 },
+ { "ocspi_par_error", 3, 1 },
+ { "db_options_par_error", 2, 1 },
+ { "iespi_par_error", 1, 1 },
+ { "e_pcmd_par_error", 0, 1 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_pm_tx_regs[] = {
+ { "PM_TX_CFG", 0x8fe0, 0 },
+ { "ch1_output", 27, 5 },
+ { "ch2_output", 22, 5 },
+ { "ch3_output", 17, 5 },
+ { "strobe1", 16, 1 },
+ { "ch1_input", 11, 5 },
+ { "ch2_input", 6, 5 },
+ { "ch3_input", 1, 5 },
+ { "strobe0", 0, 1 },
+ { "PM_TX_MODE", 0x8fe4, 0 },
+ { "cong_thresh3", 25, 7 },
+ { "cong_thresh2", 18, 7 },
+ { "cong_thresh1", 11, 7 },
+ { "cong_thresh0", 4, 7 },
+ { "use_bundle_len", 3, 1 },
+ { "stat_channel", 1, 2 },
+ { "prefetch_enable", 0, 1 },
+ { "PM_TX_STAT_CONFIG", 0x8fe8, 0 },
+ { "PM_TX_STAT_COUNT", 0x8fec, 0 },
+ { "PM_TX_STAT_LSB", 0x8ff0, 0 },
+ { "PM_TX_STAT_MSB", 0x8ff4, 0 },
+ { "PM_TX_INT_ENABLE", 0x8ff8, 0 },
+ { "pcmd_len_ovfl0", 31, 1 },
+ { "pcmd_len_ovfl1", 30, 1 },
+ { "pcmd_len_ovfl2", 29, 1 },
+ { "zero_c_cmd_erro", 28, 1 },
+ { "icspi0_fifo2x_Rx_framing_error", 27, 1 },
+ { "icspi1_fifo2x_Rx_framing_error", 26, 1 },
+ { "icspi2_fifo2x_Rx_framing_error", 25, 1 },
+ { "icspi3_fifo2x_Rx_framing_error", 24, 1 },
+ { "icspi0_Rx_framing_error", 23, 1 },
+ { "icspi1_Rx_framing_error", 22, 1 },
+ { "icspi2_Rx_framing_error", 21, 1 },
+ { "icspi3_Rx_framing_error", 20, 1 },
+ { "icspi0_Tx_framing_error", 19, 1 },
+ { "icspi1_Tx_framing_error", 18, 1 },
+ { "icspi2_Tx_framing_error", 17, 1 },
+ { "icspi3_Tx_framing_error", 16, 1 },
+ { "oespi0_Rx_framing_error", 15, 1 },
+ { "oespi1_Rx_framing_error", 14, 1 },
+ { "oespi2_Rx_framing_error", 13, 1 },
+ { "oespi3_Rx_framing_error", 12, 1 },
+ { "oespi0_Tx_framing_error", 11, 1 },
+ { "oespi1_Tx_framing_error", 10, 1 },
+ { "oespi2_Tx_framing_error", 9, 1 },
+ { "oespi3_Tx_framing_error", 8, 1 },
+ { "oespi0_ofifo2x_Tx_framing_error", 7, 1 },
+ { "oespi1_ofifo2x_Tx_framing_error", 6, 1 },
+ { "oespi2_ofifo2x_Tx_framing_error", 5, 1 },
+ { "oespi3_ofifo2x_Tx_framing_error", 4, 1 },
+ { "oespi_par_error", 3, 1 },
+ { "db_options_par_error", 2, 1 },
+ { "icspi_par_error", 1, 1 },
+ { "c_pcmd_par_error", 0, 1 },
+ { "PM_TX_INT_CAUSE", 0x8ffc, 0 },
+ { "pcmd_len_ovfl0", 31, 1 },
+ { "pcmd_len_ovfl1", 30, 1 },
+ { "pcmd_len_ovfl2", 29, 1 },
+ { "zero_c_cmd_error", 28, 1 },
+ { "icspi0_fifo2x_Rx_framing_error", 27, 1 },
+ { "icspi1_fifo2x_Rx_framing_error", 26, 1 },
+ { "icspi2_fifo2x_Rx_framing_error", 25, 1 },
+ { "icspi3_fifo2x_Rx_framing_error", 24, 1 },
+ { "icspi0_Rx_framing_error", 23, 1 },
+ { "icspi1_Rx_framing_error", 22, 1 },
+ { "icspi2_Rx_framing_error", 21, 1 },
+ { "icspi3_Rx_framing_error", 20, 1 },
+ { "icspi0_Tx_framing_error", 19, 1 },
+ { "icspi1_Tx_framing_error", 18, 1 },
+ { "icspi2_Tx_framing_error", 17, 1 },
+ { "icspi3_Tx_framing_error", 16, 1 },
+ { "oespi0_Rx_framing_error", 15, 1 },
+ { "oespi1_Rx_framing_error", 14, 1 },
+ { "oespi2_Rx_framing_error", 13, 1 },
+ { "oespi3_Rx_framing_error", 12, 1 },
+ { "oespi0_Tx_framing_error", 11, 1 },
+ { "oespi1_Tx_framing_error", 10, 1 },
+ { "oespi2_Tx_framing_error", 9, 1 },
+ { "oespi3_Tx_framing_error", 8, 1 },
+ { "oespi0_ofifo2x_Tx_framing_error", 7, 1 },
+ { "oespi1_ofifo2x_Tx_framing_error", 6, 1 },
+ { "oespi2_ofifo2x_Tx_framing_error", 5, 1 },
+ { "oespi3_ofifo2x_Tx_framing_error", 4, 1 },
+ { "oespi_par_error", 3, 1 },
+ { "db_options_par_error", 2, 1 },
+ { "icspi_par_error", 1, 1 },
+ { "c_pcmd_par_error", 0, 1 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_mps_regs[] = {
+ { "MPS_CMN_CTL", 0x9000, 0 },
+ { "Detect8023", 3, 1 },
+ { "VFDirectAccess", 2, 1 },
+ { "NumPorts", 0, 2 },
+ { "MPS_INT_ENABLE", 0x9004, 0 },
+ { "StatIntEnb", 5, 1 },
+ { "TxIntEnb", 4, 1 },
+ { "RxIntEnb", 3, 1 },
+ { "TrcIntEnb", 2, 1 },
+ { "ClsIntEnb", 1, 1 },
+ { "PLIntEnb", 0, 1 },
+ { "MPS_INT_CAUSE", 0x9008, 0 },
+ { "StatInt", 5, 1 },
+ { "TxInt", 4, 1 },
+ { "RxInt", 3, 1 },
+ { "TrcInt", 2, 1 },
+ { "ClsInt", 1, 1 },
+ { "PLInt", 0, 1 },
+ { "MPS_VF_TX_CTL_31_0", 0x9010, 0 },
+ { "MPS_VF_TX_CTL_63_32", 0x9014, 0 },
+ { "MPS_VF_TX_CTL_95_64", 0x9018, 0 },
+ { "MPS_VF_TX_CTL_127_96", 0x901c, 0 },
+ { "MPS_VF_RX_CTL_31_0", 0x9020, 0 },
+ { "MPS_VF_RX_CTL_63_32", 0x9024, 0 },
+ { "MPS_VF_RX_CTL_95_64", 0x9028, 0 },
+ { "MPS_VF_RX_CTL_127_96", 0x902c, 0 },
+ { "MPS_TX_PAUSE_DURATION_BUF_GRP0", 0x9030, 0 },
+ { "MPS_TX_PAUSE_DURATION_BUF_GRP1", 0x9034, 0 },
+ { "MPS_TX_PAUSE_DURATION_BUF_GRP2", 0x9038, 0 },
+ { "MPS_TX_PAUSE_DURATION_BUF_GRP3", 0x903c, 0 },
+ { "MPS_TX_PAUSE_RETRANS_BUF_GRP0", 0x9040, 0 },
+ { "MPS_TX_PAUSE_RETRANS_BUF_GRP1", 0x9044, 0 },
+ { "MPS_TX_PAUSE_RETRANS_BUF_GRP2", 0x9048, 0 },
+ { "MPS_TX_PAUSE_RETRANS_BUF_GRP3", 0x904c, 0 },
+ { "MPS_TP_CSIDE_MUX_CTL_P0", 0x9050, 0 },
+ { "MPS_TP_CSIDE_MUX_CTL_P1", 0x9054, 0 },
+ { "MPS_WOL_CTL_MODE", 0x9058, 0 },
+ { "MPS_FPGA_DEBUG", 0x9060, 0 },
+ { "LPBK_EN", 8, 1 },
+ { "CH_MAP3", 6, 2 },
+ { "CH_MAP2", 4, 2 },
+ { "CH_MAP1", 2, 2 },
+ { "CH_MAP0", 0, 2 },
+ { "MPS_DEBUG_CTL", 0x9068, 0 },
+ { "DbgModeCtl_H", 11, 1 },
+ { "DbgSel_H", 6, 5 },
+ { "DbgModeCtl_L", 5, 1 },
+ { "DbgSel_L", 0, 5 },
+ { "MPS_DEBUG_DATA_REG_L", 0x906c, 0 },
+ { "MPS_DEBUG_DATA_REG_H", 0x9070, 0 },
+ { "MPS_TOP_SPARE", 0x9074, 0 },
+ { "TopSpare", 12, 20 },
+ { "Chikn_14463", 8, 4 },
+ { "oVlanSelLpbk3", 7, 1 },
+ { "oVlanSelLpbk2", 6, 1 },
+ { "oVlanSelLpbk1", 5, 1 },
+ { "oVlanSelLpbk0", 4, 1 },
+ { "oVlanSelMac3", 3, 1 },
+ { "oVlanSelMac2", 2, 1 },
+ { "oVlanSelMac1", 1, 1 },
+ { "oVlanSelMac0", 0, 1 },
+ { "MPS_BUILD_REVISION", 0x90fc, 0 },
+ { "MPS_PORT_CTL", 0x20000, 0 },
+ { "LpbkEn", 31, 1 },
+ { "TxEn", 30, 1 },
+ { "RxEn", 29, 1 },
+ { "PPPEn", 28, 1 },
+ { "FCSStripEn", 27, 1 },
+ { "PPPAndPause", 26, 1 },
+ { "PrioPPPEnMap", 16, 8 },
+ { "MPS_PORT_PAUSE_CTL", 0x20004, 0 },
+ { "MPS_PORT_TX_PAUSE_CTL", 0x20008, 0 },
+ { "RegSendOff", 24, 8 },
+ { "RegSendOn", 16, 8 },
+ { "SgeSendEn", 8, 8 },
+ { "RxSendEn", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_CTL2", 0x2000c, 0 },
+ { "MPS_PORT_RX_PAUSE_CTL", 0x20010, 0 },
+ { "RegHaltOn", 8, 8 },
+ { "RxHaltEn", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_STATUS", 0x20014, 0 },
+ { "RegSending", 16, 8 },
+ { "SgeSending", 8, 8 },
+ { "RxSending", 0, 8 },
+ { "MPS_PORT_RX_PAUSE_STATUS", 0x20018, 0 },
+ { "RegHalted", 8, 8 },
+ { "RxHalted", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_DEST_L", 0x2001c, 0 },
+ { "MPS_PORT_TX_PAUSE_DEST_H", 0x20020, 0 },
+ { "MPS_PORT_TX_PAUSE_SOURCE_L", 0x20024, 0 },
+ { "MPS_PORT_TX_PAUSE_SOURCE_H", 0x20028, 0 },
+ { "MPS_PORT_PRTY_BUFFER_GROUP_MAP", 0x2002c, 0 },
+ { "Prty7", 14, 2 },
+ { "Prty6", 12, 2 },
+ { "Prty5", 10, 2 },
+ { "Prty4", 8, 2 },
+ { "Prty3", 6, 2 },
+ { "Prty2", 4, 2 },
+ { "Prty1", 2, 2 },
+ { "Prty0", 0, 2 },
+ { "MPS_PORT_CTL", 0x22000, 0 },
+ { "LpbkEn", 31, 1 },
+ { "TxEn", 30, 1 },
+ { "RxEn", 29, 1 },
+ { "PPPEn", 28, 1 },
+ { "FCSStripEn", 27, 1 },
+ { "PPPAndPause", 26, 1 },
+ { "PrioPPPEnMap", 16, 8 },
+ { "MPS_PORT_PAUSE_CTL", 0x22004, 0 },
+ { "MPS_PORT_TX_PAUSE_CTL", 0x22008, 0 },
+ { "RegSendOff", 24, 8 },
+ { "RegSendOn", 16, 8 },
+ { "SgeSendEn", 8, 8 },
+ { "RxSendEn", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_CTL2", 0x2200c, 0 },
+ { "MPS_PORT_RX_PAUSE_CTL", 0x22010, 0 },
+ { "RegHaltOn", 8, 8 },
+ { "RxHaltEn", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_STATUS", 0x22014, 0 },
+ { "RegSending", 16, 8 },
+ { "SgeSending", 8, 8 },
+ { "RxSending", 0, 8 },
+ { "MPS_PORT_RX_PAUSE_STATUS", 0x22018, 0 },
+ { "RegHalted", 8, 8 },
+ { "RxHalted", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_DEST_L", 0x2201c, 0 },
+ { "MPS_PORT_TX_PAUSE_DEST_H", 0x22020, 0 },
+ { "MPS_PORT_TX_PAUSE_SOURCE_L", 0x22024, 0 },
+ { "MPS_PORT_TX_PAUSE_SOURCE_H", 0x22028, 0 },
+ { "MPS_PORT_PRTY_BUFFER_GROUP_MAP", 0x2202c, 0 },
+ { "Prty7", 14, 2 },
+ { "Prty6", 12, 2 },
+ { "Prty5", 10, 2 },
+ { "Prty4", 8, 2 },
+ { "Prty3", 6, 2 },
+ { "Prty2", 4, 2 },
+ { "Prty1", 2, 2 },
+ { "Prty0", 0, 2 },
+ { "MPS_PORT_CTL", 0x24000, 0 },
+ { "LpbkEn", 31, 1 },
+ { "TxEn", 30, 1 },
+ { "RxEn", 29, 1 },
+ { "PPPEn", 28, 1 },
+ { "FCSStripEn", 27, 1 },
+ { "PPPAndPause", 26, 1 },
+ { "PrioPPPEnMap", 16, 8 },
+ { "MPS_PORT_PAUSE_CTL", 0x24004, 0 },
+ { "MPS_PORT_TX_PAUSE_CTL", 0x24008, 0 },
+ { "RegSendOff", 24, 8 },
+ { "RegSendOn", 16, 8 },
+ { "SgeSendEn", 8, 8 },
+ { "RxSendEn", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_CTL2", 0x2400c, 0 },
+ { "MPS_PORT_RX_PAUSE_CTL", 0x24010, 0 },
+ { "RegHaltOn", 8, 8 },
+ { "RxHaltEn", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_STATUS", 0x24014, 0 },
+ { "RegSending", 16, 8 },
+ { "SgeSending", 8, 8 },
+ { "RxSending", 0, 8 },
+ { "MPS_PORT_RX_PAUSE_STATUS", 0x24018, 0 },
+ { "RegHalted", 8, 8 },
+ { "RxHalted", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_DEST_L", 0x2401c, 0 },
+ { "MPS_PORT_TX_PAUSE_DEST_H", 0x24020, 0 },
+ { "MPS_PORT_TX_PAUSE_SOURCE_L", 0x24024, 0 },
+ { "MPS_PORT_TX_PAUSE_SOURCE_H", 0x24028, 0 },
+ { "MPS_PORT_PRTY_BUFFER_GROUP_MAP", 0x2402c, 0 },
+ { "Prty7", 14, 2 },
+ { "Prty6", 12, 2 },
+ { "Prty5", 10, 2 },
+ { "Prty4", 8, 2 },
+ { "Prty3", 6, 2 },
+ { "Prty2", 4, 2 },
+ { "Prty1", 2, 2 },
+ { "Prty0", 0, 2 },
+ { "MPS_PORT_CTL", 0x26000, 0 },
+ { "LpbkEn", 31, 1 },
+ { "TxEn", 30, 1 },
+ { "RxEn", 29, 1 },
+ { "PPPEn", 28, 1 },
+ { "FCSStripEn", 27, 1 },
+ { "PPPAndPause", 26, 1 },
+ { "PrioPPPEnMap", 16, 8 },
+ { "MPS_PORT_PAUSE_CTL", 0x26004, 0 },
+ { "MPS_PORT_TX_PAUSE_CTL", 0x26008, 0 },
+ { "RegSendOff", 24, 8 },
+ { "RegSendOn", 16, 8 },
+ { "SgeSendEn", 8, 8 },
+ { "RxSendEn", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_CTL2", 0x2600c, 0 },
+ { "MPS_PORT_RX_PAUSE_CTL", 0x26010, 0 },
+ { "RegHaltOn", 8, 8 },
+ { "RxHaltEn", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_STATUS", 0x26014, 0 },
+ { "RegSending", 16, 8 },
+ { "SgeSending", 8, 8 },
+ { "RxSending", 0, 8 },
+ { "MPS_PORT_RX_PAUSE_STATUS", 0x26018, 0 },
+ { "RegHalted", 8, 8 },
+ { "RxHalted", 0, 8 },
+ { "MPS_PORT_TX_PAUSE_DEST_L", 0x2601c, 0 },
+ { "MPS_PORT_TX_PAUSE_DEST_H", 0x26020, 0 },
+ { "MPS_PORT_TX_PAUSE_SOURCE_L", 0x26024, 0 },
+ { "MPS_PORT_TX_PAUSE_SOURCE_H", 0x26028, 0 },
+ { "MPS_PORT_PRTY_BUFFER_GROUP_MAP", 0x2602c, 0 },
+ { "Prty7", 14, 2 },
+ { "Prty6", 12, 2 },
+ { "Prty5", 10, 2 },
+ { "Prty4", 8, 2 },
+ { "Prty3", 6, 2 },
+ { "Prty2", 4, 2 },
+ { "Prty1", 2, 2 },
+ { "Prty0", 0, 2 },
+ { "MPS_PF_CTL", 0x1e2c0, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+ { "MPS_PF_CTL", 0x1e6c0, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+ { "MPS_PF_CTL", 0x1eac0, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+ { "MPS_PF_CTL", 0x1eec0, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+ { "MPS_PF_CTL", 0x1f2c0, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+ { "MPS_PF_CTL", 0x1f6c0, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+ { "MPS_PF_CTL", 0x1fac0, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+ { "MPS_PF_CTL", 0x1fec0, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+ { "MPS_RX_CTL", 0x11000, 0 },
+ { "FILT_VLAN_SEL", 17, 1 },
+ { "CBA_EN", 16, 1 },
+ { "BLK_SNDR", 12, 4 },
+ { "CMPRS", 8, 4 },
+ { "SNF", 0, 8 },
+ { "MPS_RX_PORT_MUX_CTL", 0x11004, 0 },
+ { "CTL_P3", 12, 4 },
+ { "CTL_P2", 8, 4 },
+ { "CTL_P1", 4, 4 },
+ { "CTL_P0", 0, 4 },
+ { "MPS_RX_PG_FL", 0x11008, 0 },
+ { "RST", 16, 1 },
+ { "CNT", 0, 16 },
+ { "MPS_RX_PKT_FL", 0x1100c, 0 },
+ { "RST", 16, 1 },
+ { "CNT", 0, 16 },
+ { "MPS_RX_PG_RSV0", 0x11010, 0 },
+ { "CLR_INTR", 31, 1 },
+ { "SET_INTR", 30, 1 },
+ { "USED", 16, 11 },
+ { "ALLOC", 0, 11 },
+ { "MPS_RX_PG_RSV1", 0x11014, 0 },
+ { "CLR_INTR", 31, 1 },
+ { "SET_INTR", 30, 1 },
+ { "USED", 16, 11 },
+ { "ALLOC", 0, 11 },
+ { "MPS_RX_PG_RSV2", 0x11018, 0 },
+ { "CLR_INTR", 31, 1 },
+ { "SET_INTR", 30, 1 },
+ { "USED", 16, 11 },
+ { "ALLOC", 0, 11 },
+ { "MPS_RX_PG_RSV3", 0x1101c, 0 },
+ { "CLR_INTR", 31, 1 },
+ { "SET_INTR", 30, 1 },
+ { "USED", 16, 11 },
+ { "ALLOC", 0, 11 },
+ { "MPS_RX_PG_RSV4", 0x11020, 0 },
+ { "CLR_INTR", 31, 1 },
+ { "SET_INTR", 30, 1 },
+ { "USED", 16, 11 },
+ { "ALLOC", 0, 11 },
+ { "MPS_RX_PG_RSV5", 0x11024, 0 },
+ { "CLR_INTR", 31, 1 },
+ { "SET_INTR", 30, 1 },
+ { "USED", 16, 11 },
+ { "ALLOC", 0, 11 },
+ { "MPS_RX_PG_RSV6", 0x11028, 0 },
+ { "CLR_INTR", 31, 1 },
+ { "SET_INTR", 30, 1 },
+ { "USED", 16, 11 },
+ { "ALLOC", 0, 11 },
+ { "MPS_RX_PG_RSV7", 0x1102c, 0 },
+ { "CLR_INTR", 31, 1 },
+ { "SET_INTR", 30, 1 },
+ { "USED", 16, 11 },
+ { "ALLOC", 0, 11 },
+ { "MPS_RX_PG_SHR_BG0", 0x11030, 0 },
+ { "EN", 31, 1 },
+ { "SEL", 30, 1 },
+ { "MAX", 16, 11 },
+ { "BORW", 0, 11 },
+ { "MPS_RX_PG_SHR_BG1", 0x11034, 0 },
+ { "EN", 31, 1 },
+ { "SEL", 30, 1 },
+ { "MAX", 16, 11 },
+ { "BORW", 0, 11 },
+ { "MPS_RX_PG_SHR_BG2", 0x11038, 0 },
+ { "EN", 31, 1 },
+ { "SEL", 30, 1 },
+ { "MAX", 16, 11 },
+ { "BORW", 0, 11 },
+ { "MPS_RX_PG_SHR_BG3", 0x1103c, 0 },
+ { "EN", 31, 1 },
+ { "SEL", 30, 1 },
+ { "MAX", 16, 11 },
+ { "BORW", 0, 11 },
+ { "MPS_RX_PG_SHR0", 0x11040, 0 },
+ { "QUOTA", 16, 11 },
+ { "USED", 0, 11 },
+ { "MPS_RX_PG_SHR1", 0x11044, 0 },
+ { "QUOTA", 16, 11 },
+ { "USED", 0, 11 },
+ { "MPS_RX_PG_HYST_BG0", 0x11048, 0 },
+ { "EN", 31, 1 },
+ { "TH", 0, 11 },
+ { "MPS_RX_PG_HYST_BG1", 0x1104c, 0 },
+ { "EN", 31, 1 },
+ { "TH", 0, 11 },
+ { "MPS_RX_PG_HYST_BG2", 0x11050, 0 },
+ { "EN", 31, 1 },
+ { "TH", 0, 11 },
+ { "MPS_RX_PG_HYST_BG3", 0x11054, 0 },
+ { "EN", 31, 1 },
+ { "TH", 0, 11 },
+ { "MPS_RX_OCH_CTL", 0x11058, 0 },
+ { "DROP_WT", 27, 5 },
+ { "TRUNC_WT", 22, 5 },
+ { "DRAIN", 13, 5 },
+ { "DROP", 8, 5 },
+ { "STOP", 0, 5 },
+ { "MPS_RX_LPBK_BP0", 0x1105c, 0 },
+ { "MPS_RX_LPBK_BP1", 0x11060, 0 },
+ { "MPS_RX_LPBK_BP2", 0x11064, 0 },
+ { "MPS_RX_LPBK_BP3", 0x11068, 0 },
+ { "MPS_RX_PORT_GAP", 0x1106c, 0 },
+ { "MPS_RX_CHMN_CNT", 0x11070, 0 },
+ { "MPS_RX_PERR_INT_CAUSE", 0x11074, 0 },
+ { "FF", 23, 1 },
+ { "PGMO", 22, 1 },
+ { "PGME", 21, 1 },
+ { "CHMN", 20, 1 },
+ { "RPLC", 19, 1 },
+ { "ATRB", 18, 1 },
+ { "PSMX", 17, 1 },
+ { "PGLL", 16, 1 },
+ { "PGFL", 15, 1 },
+ { "PKTQ", 14, 1 },
+ { "PKFL", 13, 1 },
+ { "PPM3", 12, 1 },
+ { "PPM2", 11, 1 },
+ { "PPM1", 10, 1 },
+ { "PPM0", 9, 1 },
+ { "SPMX", 8, 1 },
+ { "CDL3", 7, 1 },
+ { "CDL2", 6, 1 },
+ { "CDL1", 5, 1 },
+ { "CDL0", 4, 1 },
+ { "CDM3", 3, 1 },
+ { "CDM2", 2, 1 },
+ { "CDM1", 1, 1 },
+ { "CDM0", 0, 1 },
+ { "MPS_RX_PERR_INT_ENABLE", 0x11078, 0 },
+ { "FF", 23, 1 },
+ { "PGMO", 22, 1 },
+ { "PGME", 21, 1 },
+ { "CHMN", 20, 1 },
+ { "RPLC", 19, 1 },
+ { "ATRB", 18, 1 },
+ { "PSMX", 17, 1 },
+ { "PGLL", 16, 1 },
+ { "PGFL", 15, 1 },
+ { "PKTQ", 14, 1 },
+ { "PKFL", 13, 1 },
+ { "PPM3", 12, 1 },
+ { "PPM2", 11, 1 },
+ { "PPM1", 10, 1 },
+ { "PPM0", 9, 1 },
+ { "SPMX", 8, 1 },
+ { "CDL3", 7, 1 },
+ { "CDL2", 6, 1 },
+ { "CDL1", 5, 1 },
+ { "CDL0", 4, 1 },
+ { "CDM3", 3, 1 },
+ { "CDM2", 2, 1 },
+ { "CDM1", 1, 1 },
+ { "CDM0", 0, 1 },
+ { "MPS_RX_PERR_ENABLE", 0x1107c, 0 },
+ { "FF", 23, 1 },
+ { "PGMO", 22, 1 },
+ { "PGME", 21, 1 },
+ { "CHMN", 20, 1 },
+ { "RPLC", 19, 1 },
+ { "ATRB", 18, 1 },
+ { "PSMX", 17, 1 },
+ { "PGLL", 16, 1 },
+ { "PGFL", 15, 1 },
+ { "PKTQ", 14, 1 },
+ { "PKFL", 13, 1 },
+ { "PPM3", 12, 1 },
+ { "PPM2", 11, 1 },
+ { "PPM1", 10, 1 },
+ { "PPM0", 9, 1 },
+ { "SPMX", 8, 1 },
+ { "CDL3", 7, 1 },
+ { "CDL2", 6, 1 },
+ { "CDL1", 5, 1 },
+ { "CDL0", 4, 1 },
+ { "CDM3", 3, 1 },
+ { "CDM2", 2, 1 },
+ { "CDM1", 1, 1 },
+ { "CDM0", 0, 1 },
+ { "MPS_RX_PERR_INJECT", 0x11080, 0 },
+ { "MemSel", 1, 5 },
+ { "InjectDataErr", 0, 1 },
+ { "MPS_RX_FUNC_INT_CAUSE", 0x11084, 0 },
+ { "INT_ERR_INT", 8, 5 },
+ { "PG_TH_INT7", 7, 1 },
+ { "PG_TH_INT6", 6, 1 },
+ { "PG_TH_INT5", 5, 1 },
+ { "PG_TH_INT4", 4, 1 },
+ { "PG_TH_INT3", 3, 1 },
+ { "PG_TH_INT2", 2, 1 },
+ { "PG_TH_INT1", 1, 1 },
+ { "PG_TH_INT0", 0, 1 },
+ { "MPS_RX_FUNC_INT_ENABLE", 0x11088, 0 },
+ { "INT_ERR_INT", 8, 5 },
+ { "PG_TH_INT7", 7, 1 },
+ { "PG_TH_INT6", 6, 1 },
+ { "PG_TH_INT5", 5, 1 },
+ { "PG_TH_INT4", 4, 1 },
+ { "PG_TH_INT3", 3, 1 },
+ { "PG_TH_INT2", 2, 1 },
+ { "PG_TH_INT1", 1, 1 },
+ { "PG_TH_INT0", 0, 1 },
+ { "MPS_RX_PAUSE_GEN_TH_0", 0x1108c, 0 },
+ { "TH_HIGH", 16, 16 },
+ { "TH_LOW", 0, 16 },
+ { "MPS_RX_PAUSE_GEN_TH_1", 0x11090, 0 },
+ { "TH_HIGH", 16, 16 },
+ { "TH_LOW", 0, 16 },
+ { "MPS_RX_PAUSE_GEN_TH_2", 0x11094, 0 },
+ { "TH_HIGH", 16, 16 },
+ { "TH_LOW", 0, 16 },
+ { "MPS_RX_PAUSE_GEN_TH_3", 0x11098, 0 },
+ { "TH_HIGH", 16, 16 },
+ { "TH_LOW", 0, 16 },
+ { "MPS_RX_PPP_ATRB", 0x1109c, 0 },
+ { "ETYPE", 16, 16 },
+ { "OPCODE", 0, 16 },
+ { "MPS_RX_QFC0_ATRB", 0x110a0, 0 },
+ { "ETYPE", 16, 16 },
+ { "DA", 0, 16 },
+ { "MPS_RX_QFC1_ATRB", 0x110a4, 0 },
+ { "MPS_RX_PT_ARB0", 0x110a8, 0 },
+ { "LPBK_WT", 16, 14 },
+ { "MAC_WT", 0, 14 },
+ { "MPS_RX_PT_ARB1", 0x110ac, 0 },
+ { "LPBK_WT", 16, 14 },
+ { "MAC_WT", 0, 14 },
+ { "MPS_RX_PT_ARB2", 0x110b0, 0 },
+ { "LPBK_WT", 16, 14 },
+ { "MAC_WT", 0, 14 },
+ { "MPS_RX_PT_ARB3", 0x110b4, 0 },
+ { "LPBK_WT", 16, 14 },
+ { "MAC_WT", 0, 14 },
+ { "MPS_RX_PT_ARB4", 0x110b8, 0 },
+ { "LPBK_WT", 16, 14 },
+ { "MAC_WT", 0, 14 },
+ { "MPS_PF_OUT_EN", 0x110bc, 0 },
+ { "MPS_BMC_MTU", 0x110c0, 0 },
+ { "MPS_BMC_PKT_CNT", 0x110c4, 0 },
+ { "MPS_BMC_BYTE_CNT", 0x110c8, 0 },
+ { "MPS_PFVF_ATRB_CTL", 0x110cc, 0 },
+ { "RD_WRN", 31, 1 },
+ { "PFVF", 0, 8 },
+ { "MPS_PFVF_ATRB", 0x110d0, 0 },
+ { "PF", 28, 3 },
+ { "OFF", 18, 1 },
+ { "NV_DROP", 17, 1 },
+ { "MODE", 16, 1 },
+ { "MTU", 0, 14 },
+ { "MPS_PFVF_ATRB_FLTR0", 0x110d4, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR1", 0x110d8, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR2", 0x110dc, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR3", 0x110e0, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR4", 0x110e4, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR5", 0x110e8, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR6", 0x110ec, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR7", 0x110f0, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR8", 0x110f4, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR9", 0x110f8, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR10", 0x110fc, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR11", 0x11100, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR12", 0x11104, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR13", 0x11108, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR14", 0x1110c, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PFVF_ATRB_FLTR15", 0x11110, 0 },
+ { "VLAN_EN", 16, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_RPLC_MAP_CTL", 0x11114, 0 },
+ { "RD_WRN", 31, 1 },
+ { "ADDR", 0, 10 },
+ { "MPS_PF_RPLCT_MAP", 0x11118, 0 },
+ { "MPS_VF_RPLCT_MAP0", 0x1111c, 0 },
+ { "MPS_VF_RPLCT_MAP1", 0x11120, 0 },
+ { "MPS_VF_RPLCT_MAP2", 0x11124, 0 },
+ { "MPS_VF_RPLCT_MAP3", 0x11128, 0 },
+ { "MPS_MEM_DBG_CTL", 0x1112c, 0 },
+ { "PKD", 17, 1 },
+ { "PGD", 16, 1 },
+ { "ADDR", 0, 16 },
+ { "MPS_PKD_MEM_DATA0", 0x11130, 0 },
+ { "MPS_PKD_MEM_DATA1", 0x11134, 0 },
+ { "MPS_PKD_MEM_DATA2", 0x11138, 0 },
+ { "MPS_PGD_MEM_DATA", 0x1113c, 0 },
+ { "MPS_RX_SE_CNT_ERR", 0x11140, 0 },
+ { "MPS_RX_SE_CNT_CLR", 0x11144, 0 },
+ { "MPS_RX_SE_CNT_IN0", 0x11148, 0 },
+ { "SOP_CNT_PM", 24, 8 },
+ { "EOP_CNT_PM", 16, 8 },
+ { "SOP_CNT_IN", 8, 8 },
+ { "EOP_CNT_IN", 0, 8 },
+ { "MPS_RX_SE_CNT_IN1", 0x1114c, 0 },
+ { "SOP_CNT_PM", 24, 8 },
+ { "EOP_CNT_PM", 16, 8 },
+ { "SOP_CNT_IN", 8, 8 },
+ { "EOP_CNT_IN", 0, 8 },
+ { "MPS_RX_SE_CNT_IN2", 0x11150, 0 },
+ { "SOP_CNT_PM", 24, 8 },
+ { "EOP_CNT_PM", 16, 8 },
+ { "SOP_CNT_IN", 8, 8 },
+ { "EOP_CNT_IN", 0, 8 },
+ { "MPS_RX_SE_CNT_IN3", 0x11154, 0 },
+ { "SOP_CNT_PM", 24, 8 },
+ { "EOP_CNT_PM", 16, 8 },
+ { "SOP_CNT_IN", 8, 8 },
+ { "EOP_CNT_IN", 0, 8 },
+ { "MPS_RX_SE_CNT_IN4", 0x11158, 0 },
+ { "SOP_CNT_PM", 24, 8 },
+ { "EOP_CNT_PM", 16, 8 },
+ { "SOP_CNT_IN", 8, 8 },
+ { "EOP_CNT_IN", 0, 8 },
+ { "MPS_RX_SE_CNT_IN5", 0x1115c, 0 },
+ { "SOP_CNT_PM", 24, 8 },
+ { "EOP_CNT_PM", 16, 8 },
+ { "SOP_CNT_IN", 8, 8 },
+ { "EOP_CNT_IN", 0, 8 },
+ { "MPS_RX_SE_CNT_IN6", 0x11160, 0 },
+ { "SOP_CNT_PM", 24, 8 },
+ { "EOP_CNT_PM", 16, 8 },
+ { "SOP_CNT_IN", 8, 8 },
+ { "EOP_CNT_IN", 0, 8 },
+ { "MPS_RX_SE_CNT_IN7", 0x11164, 0 },
+ { "SOP_CNT_PM", 24, 8 },
+ { "EOP_CNT_PM", 16, 8 },
+ { "SOP_CNT_IN", 8, 8 },
+ { "EOP_CNT_IN", 0, 8 },
+ { "MPS_RX_SE_CNT_OUT01", 0x11168, 0 },
+ { "SOP_CNT_1", 24, 8 },
+ { "EOP_CNT_1", 16, 8 },
+ { "SOP_CNT_0", 8, 8 },
+ { "EOP_CNT_0", 0, 8 },
+ { "MPS_RX_SE_CNT_OUT23", 0x1116c, 0 },
+ { "SOP_CNT_3", 24, 8 },
+ { "EOP_CNT_3", 16, 8 },
+ { "SOP_CNT_2", 8, 8 },
+ { "EOP_CNT_2", 0, 8 },
+ { "MPS_RX_SPI_ERR", 0x11170, 0 },
+ { "LEN_ERR", 21, 4 },
+ { "ERR", 0, 21 },
+ { "MPS_RX_IN_BUS_STATE", 0x11174, 0 },
+ { "ST3", 24, 8 },
+ { "ST2", 16, 8 },
+ { "ST1", 8, 8 },
+ { "ST0", 0, 8 },
+ { "MPS_RX_OUT_BUS_STATE", 0x11178, 0 },
+ { "ST_NCSI", 23, 9 },
+ { "ST_TP", 0, 23 },
+ { "MPS_RX_DBG_CTL", 0x1117c, 0 },
+ { "OUT_DBG_CHNL", 8, 3 },
+ { "DBG_PKD_QSEL", 7, 1 },
+ { "DBG_CDS_INV", 6, 1 },
+ { "IN_DBG_PORT", 3, 3 },
+ { "IN_DBG_CHNL", 0, 3 },
+ { "MPS_RX_CLS_DROP_CNT0", 0x11180, 0 },
+ { "LPBK_CNT0", 16, 16 },
+ { "MAC_CNT0", 0, 16 },
+ { "MPS_RX_CLS_DROP_CNT1", 0x11184, 0 },
+ { "LPBK_CNT1", 16, 16 },
+ { "MAC_CNT1", 0, 16 },
+ { "MPS_RX_CLS_DROP_CNT2", 0x11188, 0 },
+ { "LPBK_CNT2", 16, 16 },
+ { "MAC_CNT2", 0, 16 },
+ { "MPS_RX_CLS_DROP_CNT3", 0x1118c, 0 },
+ { "LPBK_CNT3", 16, 16 },
+ { "MAC_CNT3", 0, 16 },
+ { "MPS_RX_SPARE", 0x11190, 0 },
+ { "MPS_PORT_RX_CTL", 0x20100, 0 },
+ { "NO_RPLCT_M", 20, 1 },
+ { "RPLCT_SEL_L", 18, 2 },
+ { "FLTR_VLAN_SEL", 17, 1 },
+ { "PRIO_VLAN_SEL", 16, 1 },
+ { "CHK_8023_LEN_M", 15, 1 },
+ { "CHK_8023_LEN_L", 14, 1 },
+ { "NIV_DROP", 13, 1 },
+ { "NOV_DROP", 12, 1 },
+ { "CLS_PRT", 11, 1 },
+ { "RX_QFC_EN", 10, 1 },
+ { "QFC_FWD_UP", 9, 1 },
+ { "PPP_FWD_UP", 8, 1 },
+ { "PAUSE_FWD_UP", 7, 1 },
+ { "LPBK_BP", 6, 1 },
+ { "PASS_NO_MATCH", 5, 1 },
+ { "IVLAN_EN", 4, 1 },
+ { "OVLAN_EN3", 3, 1 },
+ { "OVLAN_EN2", 2, 1 },
+ { "OVLAN_EN1", 1, 1 },
+ { "OVLAN_EN0", 0, 1 },
+ { "MPS_PORT_RX_MTU", 0x20104, 0 },
+ { "MPS_PORT_RX_PF_MAP", 0x20108, 0 },
+ { "MPS_PORT_RX_VF_MAP0", 0x2010c, 0 },
+ { "MPS_PORT_RX_VF_MAP1", 0x20110, 0 },
+ { "MPS_PORT_RX_VF_MAP2", 0x20114, 0 },
+ { "MPS_PORT_RX_VF_MAP3", 0x20118, 0 },
+ { "MPS_PORT_RX_IVLAN", 0x2011c, 0 },
+ { "MPS_PORT_RX_OVLAN0", 0x20120, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN1", 0x20124, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN2", 0x20128, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN3", 0x2012c, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_RSS_HASH", 0x20130, 0 },
+ { "MPS_PORT_RX_RSS_CONTROL", 0x20134, 0 },
+ { "RSS_CTRL", 16, 8 },
+ { "QUE_NUM", 0, 16 },
+ { "MPS_PORT_RX_CTL1", 0x20138, 0 },
+ { "FIXED_PFVF_MAC", 13, 1 },
+ { "FIXED_PFVF_LPBK", 12, 1 },
+ { "FIXED_PFVF_LPBK_OV", 11, 1 },
+ { "FIXED_PF", 8, 3 },
+ { "FIXED_VF_VLD", 7, 1 },
+ { "FIXED_VF", 0, 7 },
+ { "MPS_PORT_RX_SPARE", 0x2013c, 0 },
+ { "MPS_PORT_RX_CTL", 0x22100, 0 },
+ { "NO_RPLCT_M", 20, 1 },
+ { "RPLCT_SEL_L", 18, 2 },
+ { "FLTR_VLAN_SEL", 17, 1 },
+ { "PRIO_VLAN_SEL", 16, 1 },
+ { "CHK_8023_LEN_M", 15, 1 },
+ { "CHK_8023_LEN_L", 14, 1 },
+ { "NIV_DROP", 13, 1 },
+ { "NOV_DROP", 12, 1 },
+ { "CLS_PRT", 11, 1 },
+ { "RX_QFC_EN", 10, 1 },
+ { "QFC_FWD_UP", 9, 1 },
+ { "PPP_FWD_UP", 8, 1 },
+ { "PAUSE_FWD_UP", 7, 1 },
+ { "LPBK_BP", 6, 1 },
+ { "PASS_NO_MATCH", 5, 1 },
+ { "IVLAN_EN", 4, 1 },
+ { "OVLAN_EN3", 3, 1 },
+ { "OVLAN_EN2", 2, 1 },
+ { "OVLAN_EN1", 1, 1 },
+ { "OVLAN_EN0", 0, 1 },
+ { "MPS_PORT_RX_MTU", 0x22104, 0 },
+ { "MPS_PORT_RX_PF_MAP", 0x22108, 0 },
+ { "MPS_PORT_RX_VF_MAP0", 0x2210c, 0 },
+ { "MPS_PORT_RX_VF_MAP1", 0x22110, 0 },
+ { "MPS_PORT_RX_VF_MAP2", 0x22114, 0 },
+ { "MPS_PORT_RX_VF_MAP3", 0x22118, 0 },
+ { "MPS_PORT_RX_IVLAN", 0x2211c, 0 },
+ { "MPS_PORT_RX_OVLAN0", 0x22120, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN1", 0x22124, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN2", 0x22128, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN3", 0x2212c, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_RSS_HASH", 0x22130, 0 },
+ { "MPS_PORT_RX_RSS_CONTROL", 0x22134, 0 },
+ { "RSS_CTRL", 16, 8 },
+ { "QUE_NUM", 0, 16 },
+ { "MPS_PORT_RX_CTL1", 0x22138, 0 },
+ { "FIXED_PFVF_MAC", 13, 1 },
+ { "FIXED_PFVF_LPBK", 12, 1 },
+ { "FIXED_PFVF_LPBK_OV", 11, 1 },
+ { "FIXED_PF", 8, 3 },
+ { "FIXED_VF_VLD", 7, 1 },
+ { "FIXED_VF", 0, 7 },
+ { "MPS_PORT_RX_SPARE", 0x2213c, 0 },
+ { "MPS_PORT_RX_CTL", 0x24100, 0 },
+ { "NO_RPLCT_M", 20, 1 },
+ { "RPLCT_SEL_L", 18, 2 },
+ { "FLTR_VLAN_SEL", 17, 1 },
+ { "PRIO_VLAN_SEL", 16, 1 },
+ { "CHK_8023_LEN_M", 15, 1 },
+ { "CHK_8023_LEN_L", 14, 1 },
+ { "NIV_DROP", 13, 1 },
+ { "NOV_DROP", 12, 1 },
+ { "CLS_PRT", 11, 1 },
+ { "RX_QFC_EN", 10, 1 },
+ { "QFC_FWD_UP", 9, 1 },
+ { "PPP_FWD_UP", 8, 1 },
+ { "PAUSE_FWD_UP", 7, 1 },
+ { "LPBK_BP", 6, 1 },
+ { "PASS_NO_MATCH", 5, 1 },
+ { "IVLAN_EN", 4, 1 },
+ { "OVLAN_EN3", 3, 1 },
+ { "OVLAN_EN2", 2, 1 },
+ { "OVLAN_EN1", 1, 1 },
+ { "OVLAN_EN0", 0, 1 },
+ { "MPS_PORT_RX_MTU", 0x24104, 0 },
+ { "MPS_PORT_RX_PF_MAP", 0x24108, 0 },
+ { "MPS_PORT_RX_VF_MAP0", 0x2410c, 0 },
+ { "MPS_PORT_RX_VF_MAP1", 0x24110, 0 },
+ { "MPS_PORT_RX_VF_MAP2", 0x24114, 0 },
+ { "MPS_PORT_RX_VF_MAP3", 0x24118, 0 },
+ { "MPS_PORT_RX_IVLAN", 0x2411c, 0 },
+ { "MPS_PORT_RX_OVLAN0", 0x24120, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN1", 0x24124, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN2", 0x24128, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN3", 0x2412c, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_RSS_HASH", 0x24130, 0 },
+ { "MPS_PORT_RX_RSS_CONTROL", 0x24134, 0 },
+ { "RSS_CTRL", 16, 8 },
+ { "QUE_NUM", 0, 16 },
+ { "MPS_PORT_RX_CTL1", 0x24138, 0 },
+ { "FIXED_PFVF_MAC", 13, 1 },
+ { "FIXED_PFVF_LPBK", 12, 1 },
+ { "FIXED_PFVF_LPBK_OV", 11, 1 },
+ { "FIXED_PF", 8, 3 },
+ { "FIXED_VF_VLD", 7, 1 },
+ { "FIXED_VF", 0, 7 },
+ { "MPS_PORT_RX_SPARE", 0x2413c, 0 },
+ { "MPS_PORT_RX_CTL", 0x26100, 0 },
+ { "NO_RPLCT_M", 20, 1 },
+ { "RPLCT_SEL_L", 18, 2 },
+ { "FLTR_VLAN_SEL", 17, 1 },
+ { "PRIO_VLAN_SEL", 16, 1 },
+ { "CHK_8023_LEN_M", 15, 1 },
+ { "CHK_8023_LEN_L", 14, 1 },
+ { "NIV_DROP", 13, 1 },
+ { "NOV_DROP", 12, 1 },
+ { "CLS_PRT", 11, 1 },
+ { "RX_QFC_EN", 10, 1 },
+ { "QFC_FWD_UP", 9, 1 },
+ { "PPP_FWD_UP", 8, 1 },
+ { "PAUSE_FWD_UP", 7, 1 },
+ { "LPBK_BP", 6, 1 },
+ { "PASS_NO_MATCH", 5, 1 },
+ { "IVLAN_EN", 4, 1 },
+ { "OVLAN_EN3", 3, 1 },
+ { "OVLAN_EN2", 2, 1 },
+ { "OVLAN_EN1", 1, 1 },
+ { "OVLAN_EN0", 0, 1 },
+ { "MPS_PORT_RX_MTU", 0x26104, 0 },
+ { "MPS_PORT_RX_PF_MAP", 0x26108, 0 },
+ { "MPS_PORT_RX_VF_MAP0", 0x2610c, 0 },
+ { "MPS_PORT_RX_VF_MAP1", 0x26110, 0 },
+ { "MPS_PORT_RX_VF_MAP2", 0x26114, 0 },
+ { "MPS_PORT_RX_VF_MAP3", 0x26118, 0 },
+ { "MPS_PORT_RX_IVLAN", 0x2611c, 0 },
+ { "MPS_PORT_RX_OVLAN0", 0x26120, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN1", 0x26124, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN2", 0x26128, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_OVLAN3", 0x2612c, 0 },
+ { "OVLAN_MASK", 16, 16 },
+ { "OVLAN_ETYPE", 0, 16 },
+ { "MPS_PORT_RX_RSS_HASH", 0x26130, 0 },
+ { "MPS_PORT_RX_RSS_CONTROL", 0x26134, 0 },
+ { "RSS_CTRL", 16, 8 },
+ { "QUE_NUM", 0, 16 },
+ { "MPS_PORT_RX_CTL1", 0x26138, 0 },
+ { "FIXED_PFVF_MAC", 13, 1 },
+ { "FIXED_PFVF_LPBK", 12, 1 },
+ { "FIXED_PFVF_LPBK_OV", 11, 1 },
+ { "FIXED_PF", 8, 3 },
+ { "FIXED_VF_VLD", 7, 1 },
+ { "FIXED_VF", 0, 7 },
+ { "MPS_PORT_RX_SPARE", 0x2613c, 0 },
+ { "MPS_TX_PRTY_SEL", 0x9400, 0 },
+ { "Ch4_Prty", 20, 3 },
+ { "Ch3_Prty", 16, 3 },
+ { "Ch2_Prty", 12, 3 },
+ { "Ch1_Prty", 8, 3 },
+ { "Ch0_Prty", 4, 3 },
+ { "TP_Source", 2, 2 },
+ { "NCSI_Source", 0, 2 },
+ { "MPS_TX_INT_ENABLE", 0x9404, 0 },
+ { "PortErr", 16, 1 },
+ { "FRMERR", 15, 1 },
+ { "SECNTERR", 14, 1 },
+ { "BUBBLE", 13, 1 },
+ { "TxDescFifo", 9, 4 },
+ { "TxDataFifo", 5, 4 },
+ { "Ncsi", 4, 1 },
+ { "TP", 0, 4 },
+ { "MPS_TX_INT_CAUSE", 0x9408, 0 },
+ { "PortErr", 16, 1 },
+ { "FRMERR", 15, 1 },
+ { "SECNTERR", 14, 1 },
+ { "BUBBLE", 13, 1 },
+ { "TxDescFifo", 9, 4 },
+ { "TxDataFifo", 5, 4 },
+ { "Ncsi", 4, 1 },
+ { "TP", 0, 4 },
+ { "MPS_TX_PERR_ENABLE", 0x9410, 0 },
+ { "TxDescFifo", 9, 4 },
+ { "TxDataFifo", 5, 4 },
+ { "Ncsi", 4, 1 },
+ { "TP", 0, 4 },
+ { "MPS_TX_PERR_INJECT", 0x9414, 0 },
+ { "MemSel", 1, 5 },
+ { "InjectDataErr", 0, 1 },
+ { "MPS_TX_SE_CNT_TP01", 0x9418, 0 },
+ { "SOP_CNT_1", 24, 8 },
+ { "EOP_CNT_1", 16, 8 },
+ { "SOP_CNT_0", 8, 8 },
+ { "EOP_CNT_0", 0, 8 },
+ { "MPS_TX_SE_CNT_TP23", 0x941c, 0 },
+ { "SOP_CNT_3", 24, 8 },
+ { "EOP_CNT_3", 16, 8 },
+ { "SOP_CNT_2", 8, 8 },
+ { "EOP_CNT_2", 0, 8 },
+ { "MPS_TX_SE_CNT_MAC01", 0x9420, 0 },
+ { "SOP_CNT_1", 24, 8 },
+ { "EOP_CNT_1", 16, 8 },
+ { "SOP_CNT_0", 8, 8 },
+ { "EOP_CNT_0", 0, 8 },
+ { "MPS_TX_SE_CNT_MAC23", 0x9424, 0 },
+ { "SOP_CNT_3", 24, 8 },
+ { "EOP_CNT_3", 16, 8 },
+ { "SOP_CNT_2", 8, 8 },
+ { "EOP_CNT_2", 0, 8 },
+ { "MPS_TX_SECNT_SPI_BUBBLE_ERR", 0x9428, 0 },
+ { "Bubble", 16, 8 },
+ { "Spi", 8, 8 },
+ { "SeCnt", 0, 8 },
+ { "MPS_TX_SECNT_BUBBLE_CLR", 0x942c, 0 },
+ { "Bubble", 8, 8 },
+ { "SeCnt", 0, 8 },
+ { "MPS_TX_PORT_ERR", 0x9430, 0 },
+ { "Lpbkpt3", 7, 1 },
+ { "Lpbkpt2", 6, 1 },
+ { "Lpbkpt1", 5, 1 },
+ { "Lpbkpt0", 4, 1 },
+ { "pt3", 3, 1 },
+ { "pt2", 2, 1 },
+ { "pt1", 1, 1 },
+ { "pt0", 0, 1 },
+ { "MPS_TX_LPBK_DROP_BP_CTL_CH0", 0x9434, 0 },
+ { "BpEn", 1, 1 },
+ { "DropEn", 0, 1 },
+ { "MPS_TX_LPBK_DROP_BP_CTL_CH1", 0x9438, 0 },
+ { "BpEn", 1, 1 },
+ { "DropEn", 0, 1 },
+ { "MPS_TX_LPBK_DROP_BP_CTL_CH2", 0x943c, 0 },
+ { "BpEn", 1, 1 },
+ { "DropEn", 0, 1 },
+ { "MPS_TX_LPBK_DROP_BP_CTL_CH3", 0x9440, 0 },
+ { "BpEn", 1, 1 },
+ { "DropEn", 0, 1 },
+ { "MPS_TX_DEBUG_REG_TP2TX_10", 0x9444, 0 },
+ { "SOPCh1", 31, 1 },
+ { "EOPCh1", 30, 1 },
+ { "SizeCh1", 27, 3 },
+ { "ErrCh1", 26, 1 },
+ { "FullCh1", 25, 1 },
+ { "ValidCh1", 24, 1 },
+ { "DataCh1", 16, 8 },
+ { "SOPCh0", 15, 1 },
+ { "EOPCh0", 14, 1 },
+ { "SizeCh0", 11, 3 },
+ { "ErrCh0", 10, 1 },
+ { "FullCh0", 9, 1 },
+ { "ValidCh0", 8, 1 },
+ { "DataCh0", 0, 8 },
+ { "MPS_TX_DEBUG_REG_TP2TX_32", 0x9448, 0 },
+ { "SOPCh3", 31, 1 },
+ { "EOPCh3", 30, 1 },
+ { "SizeCh3", 27, 3 },
+ { "ErrCh3", 26, 1 },
+ { "FullCh3", 25, 1 },
+ { "ValidCh3", 24, 1 },
+ { "DataCh3", 16, 8 },
+ { "SOPCh2", 15, 1 },
+ { "EOPCh2", 14, 1 },
+ { "SizeCh2", 11, 3 },
+ { "ErrCh2", 10, 1 },
+ { "FullCh2", 9, 1 },
+ { "ValidCh2", 8, 1 },
+ { "DataCh2", 0, 8 },
+ { "MPS_TX_DEBUG_REG_TX2MAC_10", 0x944c, 0 },
+ { "SOPPt1", 31, 1 },
+ { "EOPPt1", 30, 1 },
+ { "SizePt1", 27, 3 },
+ { "ErrPt1", 26, 1 },
+ { "FullPt1", 25, 1 },
+ { "ValidPt1", 24, 1 },
+ { "DataPt1", 16, 8 },
+ { "SOPPt0", 15, 1 },
+ { "EOPPt0", 14, 1 },
+ { "SizePt0", 11, 3 },
+ { "ErrPt0", 10, 1 },
+ { "FullPt0", 9, 1 },
+ { "ValidPt0", 8, 1 },
+ { "DataPt0", 0, 8 },
+ { "MPS_TX_DEBUG_REG_TX2MAC_32", 0x9450, 0 },
+ { "SOPPt3", 31, 1 },
+ { "EOPPt3", 30, 1 },
+ { "SizePt3", 27, 3 },
+ { "ErrPt3", 26, 1 },
+ { "FullPt3", 25, 1 },
+ { "ValidPt3", 24, 1 },
+ { "DataPt3", 16, 8 },
+ { "SOPPt2", 15, 1 },
+ { "EOPPt2", 14, 1 },
+ { "SizePt2", 11, 3 },
+ { "ErrPt2", 10, 1 },
+ { "FullPt2", 9, 1 },
+ { "ValidPt2", 8, 1 },
+ { "DataPt2", 0, 8 },
+ { "MPS_TX_SGE_CH_PAUSE_IGNR", 0x9454, 0 },
+ { "MPS_TX_DEBUG_SUBPART_SEL", 0x9458, 0 },
+ { "SubPrtH", 11, 5 },
+ { "PortH", 8, 3 },
+ { "SubPrtL", 3, 5 },
+ { "PortL", 0, 3 },
+ { "MPS_PF_TX_QINQ_VLAN", 0x1e2e0, 0 },
+ { "ProtocolID", 16, 16 },
+ { "Priority", 13, 3 },
+ { "CFI", 12, 1 },
+ { "Tag", 0, 12 },
+ { "MPS_PF_TX_QINQ_VLAN", 0x1e6e0, 0 },
+ { "ProtocolID", 16, 16 },
+ { "Priority", 13, 3 },
+ { "CFI", 12, 1 },
+ { "Tag", 0, 12 },
+ { "MPS_PF_TX_QINQ_VLAN", 0x1eae0, 0 },
+ { "ProtocolID", 16, 16 },
+ { "Priority", 13, 3 },
+ { "CFI", 12, 1 },
+ { "Tag", 0, 12 },
+ { "MPS_PF_TX_QINQ_VLAN", 0x1eee0, 0 },
+ { "ProtocolID", 16, 16 },
+ { "Priority", 13, 3 },
+ { "CFI", 12, 1 },
+ { "Tag", 0, 12 },
+ { "MPS_PF_TX_QINQ_VLAN", 0x1f2e0, 0 },
+ { "ProtocolID", 16, 16 },
+ { "Priority", 13, 3 },
+ { "CFI", 12, 1 },
+ { "Tag", 0, 12 },
+ { "MPS_PF_TX_QINQ_VLAN", 0x1f6e0, 0 },
+ { "ProtocolID", 16, 16 },
+ { "Priority", 13, 3 },
+ { "CFI", 12, 1 },
+ { "Tag", 0, 12 },
+ { "MPS_PF_TX_QINQ_VLAN", 0x1fae0, 0 },
+ { "ProtocolID", 16, 16 },
+ { "Priority", 13, 3 },
+ { "CFI", 12, 1 },
+ { "Tag", 0, 12 },
+ { "MPS_PF_TX_QINQ_VLAN", 0x1fee0, 0 },
+ { "ProtocolID", 16, 16 },
+ { "Priority", 13, 3 },
+ { "CFI", 12, 1 },
+ { "Tag", 0, 12 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH0", 0x20190, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH1", 0x20194, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH2", 0x20198, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH3", 0x2019c, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH4", 0x201a0, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH0", 0x201a8, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH1", 0x201ac, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH2", 0x201b0, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH3", 0x201b4, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH4", 0x201b8, 0 },
+ { "MPS_PORT_TX_FIFO_CTL", 0x201c4, 0 },
+ { "FifoTh", 5, 9 },
+ { "FifoEn", 4, 1 },
+ { "MaxPktCnt", 0, 4 },
+ { "MPS_PORT_FPGA_PAUSE_CTL", 0x201c8, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH0", 0x22190, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH1", 0x22194, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH2", 0x22198, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH3", 0x2219c, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH4", 0x221a0, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH0", 0x221a8, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH1", 0x221ac, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH2", 0x221b0, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH3", 0x221b4, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH4", 0x221b8, 0 },
+ { "MPS_PORT_TX_FIFO_CTL", 0x221c4, 0 },
+ { "FifoTh", 5, 9 },
+ { "FifoEn", 4, 1 },
+ { "MaxPktCnt", 0, 4 },
+ { "MPS_PORT_FPGA_PAUSE_CTL", 0x221c8, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH0", 0x24190, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH1", 0x24194, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH2", 0x24198, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH3", 0x2419c, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH4", 0x241a0, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH0", 0x241a8, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH1", 0x241ac, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH2", 0x241b0, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH3", 0x241b4, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH4", 0x241b8, 0 },
+ { "MPS_PORT_TX_FIFO_CTL", 0x241c4, 0 },
+ { "FifoTh", 5, 9 },
+ { "FifoEn", 4, 1 },
+ { "MaxPktCnt", 0, 4 },
+ { "MPS_PORT_FPGA_PAUSE_CTL", 0x241c8, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH0", 0x26190, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH1", 0x26194, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH2", 0x26198, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH3", 0x2619c, 0 },
+ { "MPS_PORT_TX_MAC_RELOAD_CH4", 0x261a0, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH0", 0x261a8, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH1", 0x261ac, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH2", 0x261b0, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH3", 0x261b4, 0 },
+ { "MPS_PORT_TX_LPBK_RELOAD_CH4", 0x261b8, 0 },
+ { "MPS_PORT_TX_FIFO_CTL", 0x261c4, 0 },
+ { "FifoTh", 5, 9 },
+ { "FifoEn", 4, 1 },
+ { "MaxPktCnt", 0, 4 },
+ { "MPS_PORT_FPGA_PAUSE_CTL", 0x261c8, 0 },
+ { "MPS_TRC_CFG", 0x9800, 0 },
+ { "TrcFifoEmpty", 4, 1 },
+ { "TrcIgnoreDropInput", 3, 1 },
+ { "TrcKeepDuplicates", 2, 1 },
+ { "TrcEn", 1, 1 },
+ { "TrcMultiFilter", 0, 1 },
+ { "MPS_TRC_RSS_HASH", 0x9804, 0 },
+ { "MPS_TRC_RSS_CONTROL", 0x9808, 0 },
+ { "RssControl", 16, 8 },
+ { "QueueNumber", 0, 16 },
+ { "MPS_TRC_FILTER_MATCH_CTL_A", 0x9810, 0 },
+ { "TfInvertMatch", 24, 1 },
+ { "TfPktTooLarge", 23, 1 },
+ { "TfEn", 22, 1 },
+ { "TfPort", 18, 4 },
+ { "TfDrop", 17, 1 },
+ { "TfSopEopErr", 16, 1 },
+ { "TfLength", 8, 5 },
+ { "TfOffset", 0, 5 },
+ { "MPS_TRC_FILTER_MATCH_CTL_A", 0x9814, 0 },
+ { "TfInvertMatch", 24, 1 },
+ { "TfPktTooLarge", 23, 1 },
+ { "TfEn", 22, 1 },
+ { "TfPort", 18, 4 },
+ { "TfDrop", 17, 1 },
+ { "TfSopEopErr", 16, 1 },
+ { "TfLength", 8, 5 },
+ { "TfOffset", 0, 5 },
+ { "MPS_TRC_FILTER_MATCH_CTL_A", 0x9818, 0 },
+ { "TfInvertMatch", 24, 1 },
+ { "TfPktTooLarge", 23, 1 },
+ { "TfEn", 22, 1 },
+ { "TfPort", 18, 4 },
+ { "TfDrop", 17, 1 },
+ { "TfSopEopErr", 16, 1 },
+ { "TfLength", 8, 5 },
+ { "TfOffset", 0, 5 },
+ { "MPS_TRC_FILTER_MATCH_CTL_A", 0x981c, 0 },
+ { "TfInvertMatch", 24, 1 },
+ { "TfPktTooLarge", 23, 1 },
+ { "TfEn", 22, 1 },
+ { "TfPort", 18, 4 },
+ { "TfDrop", 17, 1 },
+ { "TfSopEopErr", 16, 1 },
+ { "TfLength", 8, 5 },
+ { "TfOffset", 0, 5 },
+ { "MPS_TRC_FILTER_MATCH_CTL_B", 0x9820, 0 },
+ { "TfMinPktSize", 16, 9 },
+ { "TfCaptureMax", 0, 14 },
+ { "MPS_TRC_FILTER_MATCH_CTL_B", 0x9824, 0 },
+ { "TfMinPktSize", 16, 9 },
+ { "TfCaptureMax", 0, 14 },
+ { "MPS_TRC_FILTER_MATCH_CTL_B", 0x9828, 0 },
+ { "TfMinPktSize", 16, 9 },
+ { "TfCaptureMax", 0, 14 },
+ { "MPS_TRC_FILTER_MATCH_CTL_B", 0x982c, 0 },
+ { "TfMinPktSize", 16, 9 },
+ { "TfCaptureMax", 0, 14 },
+ { "MPS_TRC_FILTER_RUNT_CTL", 0x9830, 0 },
+ { "MPS_TRC_FILTER_RUNT_CTL", 0x9834, 0 },
+ { "MPS_TRC_FILTER_RUNT_CTL", 0x9838, 0 },
+ { "MPS_TRC_FILTER_RUNT_CTL", 0x983c, 0 },
+ { "MPS_TRC_FILTER_DROP", 0x9840, 0 },
+ { "TfDropInpCount", 16, 16 },
+ { "TfDropBufferCount", 0, 16 },
+ { "MPS_TRC_FILTER_DROP", 0x9844, 0 },
+ { "TfDropInpCount", 16, 16 },
+ { "TfDropBufferCount", 0, 16 },
+ { "MPS_TRC_FILTER_DROP", 0x9848, 0 },
+ { "TfDropInpCount", 16, 16 },
+ { "TfDropBufferCount", 0, 16 },
+ { "MPS_TRC_FILTER_DROP", 0x984c, 0 },
+ { "TfDropInpCount", 16, 16 },
+ { "TfDropBufferCount", 0, 16 },
+ { "MPS_TRC_PERR_INJECT", 0x9850, 0 },
+ { "MemSel", 1, 4 },
+ { "InjectDataErr", 0, 1 },
+ { "MPS_TRC_PERR_ENABLE", 0x9854, 0 },
+ { "MiscPerr", 8, 1 },
+ { "PktFifo", 4, 4 },
+ { "FiltMem", 0, 4 },
+ { "MPS_TRC_INT_ENABLE", 0x9858, 0 },
+ { "PLErrEnb", 9, 1 },
+ { "MiscPerr", 8, 1 },
+ { "PktFifo", 4, 4 },
+ { "FiltMem", 0, 4 },
+ { "MPS_TRC_INT_CAUSE", 0x985c, 0 },
+ { "PLErrEnb", 9, 1 },
+ { "MiscPerr", 8, 1 },
+ { "PktFifo", 4, 4 },
+ { "FiltMem", 0, 4 },
+ { "MPS_TRC_TIMESTAMP_L", 0x9860, 0 },
+ { "MPS_TRC_TIMESTAMP_H", 0x9864, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c00, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c04, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c08, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c0c, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c10, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c14, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c18, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c1c, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c20, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c24, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c28, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c2c, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c30, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c34, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c38, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c3c, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c40, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c44, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c48, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c4c, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c50, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c54, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c58, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c5c, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c60, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c64, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c68, 0 },
+ { "MPS_TRC_FILTER0_MATCH", 0x9c6c, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9c80, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9c84, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9c88, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9c8c, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9c90, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9c94, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9c98, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9c9c, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9ca0, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9ca4, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9ca8, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cac, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cb0, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cb4, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cb8, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cbc, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cc0, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cc4, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cc8, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9ccc, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cd0, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cd4, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cd8, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cdc, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9ce0, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9ce4, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9ce8, 0 },
+ { "MPS_TRC_FILTER0_DONT_CARE", 0x9cec, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d00, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d04, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d08, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d0c, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d10, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d14, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d18, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d1c, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d20, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d24, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d28, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d2c, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d30, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d34, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d38, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d3c, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d40, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d44, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d48, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d4c, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d50, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d54, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d58, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d5c, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d60, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d64, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d68, 0 },
+ { "MPS_TRC_FILTER1_MATCH", 0x9d6c, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9d80, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9d84, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9d88, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9d8c, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9d90, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9d94, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9d98, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9d9c, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9da0, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9da4, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9da8, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dac, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9db0, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9db4, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9db8, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dbc, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dc0, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dc4, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dc8, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dcc, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dd0, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dd4, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dd8, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9ddc, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9de0, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9de4, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9de8, 0 },
+ { "MPS_TRC_FILTER1_DONT_CARE", 0x9dec, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e00, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e04, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e08, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e0c, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e10, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e14, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e18, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e1c, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e20, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e24, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e28, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e2c, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e30, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e34, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e38, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e3c, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e40, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e44, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e48, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e4c, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e50, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e54, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e58, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e5c, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e60, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e64, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e68, 0 },
+ { "MPS_TRC_FILTER2_MATCH", 0x9e6c, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9e80, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9e84, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9e88, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9e8c, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9e90, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9e94, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9e98, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9e9c, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ea0, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ea4, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ea8, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9eac, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9eb0, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9eb4, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9eb8, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ebc, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ec0, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ec4, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ec8, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ecc, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ed0, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ed4, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ed8, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9edc, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ee0, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ee4, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9ee8, 0 },
+ { "MPS_TRC_FILTER2_DONT_CARE", 0x9eec, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f00, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f04, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f08, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f0c, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f10, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f14, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f18, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f1c, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f20, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f24, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f28, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f2c, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f30, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f34, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f38, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f3c, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f40, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f44, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f48, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f4c, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f50, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f54, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f58, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f5c, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f60, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f64, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f68, 0 },
+ { "MPS_TRC_FILTER3_MATCH", 0x9f6c, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9f80, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9f84, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9f88, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9f8c, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9f90, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9f94, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9f98, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9f9c, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fa0, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fa4, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fa8, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fac, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fb0, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fb4, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fb8, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fbc, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fc0, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fc4, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fc8, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fcc, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fd0, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fd4, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fd8, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fdc, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fe0, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fe4, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fe8, 0 },
+ { "MPS_TRC_FILTER3_DONT_CARE", 0x9fec, 0 },
+ { "MPS_STAT_CTL", 0x9600, 0 },
+ { "CountVFinPF", 1, 1 },
+ { "LpbkErrStat", 0, 1 },
+ { "MPS_STAT_INT_ENABLE", 0x9608, 0 },
+ { "MPS_STAT_INT_CAUSE", 0x960c, 0 },
+ { "MPS_STAT_PERR_INT_ENABLE_SRAM", 0x9610, 0 },
+ { "Rxbg", 20, 1 },
+ { "Rxvf", 18, 2 },
+ { "Txvf", 16, 2 },
+ { "Rxpf", 13, 3 },
+ { "Txpf", 11, 2 },
+ { "Rxport", 7, 4 },
+ { "Lbport", 4, 3 },
+ { "Txport", 0, 4 },
+ { "MPS_STAT_PERR_INT_CAUSE_SRAM", 0x9614, 0 },
+ { "Rxbg", 20, 1 },
+ { "Rxvf", 18, 2 },
+ { "Txvf", 16, 2 },
+ { "Rxpf", 13, 3 },
+ { "Txpf", 11, 2 },
+ { "Rxport", 7, 4 },
+ { "Lbport", 4, 3 },
+ { "Txport", 0, 4 },
+ { "MPS_STAT_PERR_ENABLE_SRAM", 0x9618, 0 },
+ { "Rxbg", 20, 1 },
+ { "Rxvf", 18, 2 },
+ { "Txvf", 16, 2 },
+ { "Rxpf", 13, 3 },
+ { "Txpf", 11, 2 },
+ { "Rxport", 7, 4 },
+ { "Lbport", 4, 3 },
+ { "Txport", 0, 4 },
+ { "MPS_STAT_PERR_INT_ENABLE_TX_FIFO", 0x961c, 0 },
+ { "Tx", 12, 8 },
+ { "Pause", 8, 4 },
+ { "Drop", 0, 8 },
+ { "MPS_STAT_PERR_INT_CAUSE_TX_FIFO", 0x9620, 0 },
+ { "Tx", 12, 8 },
+ { "Pause", 8, 4 },
+ { "Drop", 0, 8 },
+ { "MPS_STAT_PERR_ENABLE_TX_FIFO", 0x9624, 0 },
+ { "Tx", 12, 8 },
+ { "Pause", 8, 4 },
+ { "Drop", 0, 8 },
+ { "MPS_STAT_PERR_INT_ENABLE_RX_FIFO", 0x9628, 0 },
+ { "Pause", 20, 4 },
+ { "Lpbk", 16, 4 },
+ { "Nq", 8, 8 },
+ { "PV", 4, 4 },
+ { "Mac", 0, 4 },
+ { "MPS_STAT_PERR_INT_CAUSE_RX_FIFO", 0x962c, 0 },
+ { "Pause", 20, 4 },
+ { "Lpbk", 16, 4 },
+ { "Nq", 8, 8 },
+ { "PV", 4, 4 },
+ { "Mac", 0, 4 },
+ { "MPS_STAT_PERR_ENABLE_RX_FIFO", 0x9630, 0 },
+ { "Pause", 20, 4 },
+ { "Lpbk", 16, 4 },
+ { "Nq", 8, 8 },
+ { "PV", 4, 4 },
+ { "Mac", 0, 4 },
+ { "MPS_STAT_PERR_INJECT", 0x9634, 0 },
+ { "MemSel", 1, 7 },
+ { "InjectDataErr", 0, 1 },
+ { "MPS_STAT_DEBUG_SUB_SEL", 0x9638, 0 },
+ { "SubPrtH", 5, 5 },
+ { "SubPrtL", 0, 5 },
+ { "MPS_STAT_RX_BG_0_MAC_DROP_FRAME_L", 0x9640, 0 },
+ { "MPS_STAT_RX_BG_0_MAC_DROP_FRAME_H", 0x9644, 0 },
+ { "MPS_STAT_RX_BG_1_MAC_DROP_FRAME_L", 0x9648, 0 },
+ { "MPS_STAT_RX_BG_1_MAC_DROP_FRAME_H", 0x964c, 0 },
+ { "MPS_STAT_RX_BG_2_MAC_DROP_FRAME_L", 0x9650, 0 },
+ { "MPS_STAT_RX_BG_2_MAC_DROP_FRAME_H", 0x9654, 0 },
+ { "MPS_STAT_RX_BG_3_MAC_DROP_FRAME_L", 0x9658, 0 },
+ { "MPS_STAT_RX_BG_3_MAC_DROP_FRAME_H", 0x965c, 0 },
+ { "MPS_STAT_RX_BG_0_LB_DROP_FRAME_L", 0x9660, 0 },
+ { "MPS_STAT_RX_BG_0_LB_DROP_FRAME_H", 0x9664, 0 },
+ { "MPS_STAT_RX_BG_1_LB_DROP_FRAME_L", 0x9668, 0 },
+ { "MPS_STAT_RX_BG_1_LB_DROP_FRAME_H", 0x966c, 0 },
+ { "MPS_STAT_RX_BG_2_LB_DROP_FRAME_L", 0x9670, 0 },
+ { "MPS_STAT_RX_BG_2_LB_DROP_FRAME_H", 0x9674, 0 },
+ { "MPS_STAT_RX_BG_3_LB_DROP_FRAME_L", 0x9678, 0 },
+ { "MPS_STAT_RX_BG_3_LB_DROP_FRAME_H", 0x967c, 0 },
+ { "MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_L", 0x9680, 0 },
+ { "MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_H", 0x9684, 0 },
+ { "MPS_STAT_RX_BG_1_MAC_TRUNC_FRAME_L", 0x9688, 0 },
+ { "MPS_STAT_RX_BG_1_MAC_TRUNC_FRAME_H", 0x968c, 0 },
+ { "MPS_STAT_RX_BG_2_MAC_TRUNC_FRAME_L", 0x9690, 0 },
+ { "MPS_STAT_RX_BG_2_MAC_TRUNC_FRAME_H", 0x9694, 0 },
+ { "MPS_STAT_RX_BG_3_MAC_TRUNC_FRAME_L", 0x9698, 0 },
+ { "MPS_STAT_RX_BG_3_MAC_TRUNC_FRAME_H", 0x969c, 0 },
+ { "MPS_STAT_RX_BG_0_LB_TRUNC_FRAME_L", 0x96a0, 0 },
+ { "MPS_STAT_RX_BG_0_LB_TRUNC_FRAME_H", 0x96a4, 0 },
+ { "MPS_STAT_RX_BG_1_LB_TRUNC_FRAME_L", 0x96a8, 0 },
+ { "MPS_STAT_RX_BG_1_LB_TRUNC_FRAME_H", 0x96ac, 0 },
+ { "MPS_STAT_RX_BG_2_LB_TRUNC_FRAME_L", 0x96b0, 0 },
+ { "MPS_STAT_RX_BG_2_LB_TRUNC_FRAME_H", 0x96b4, 0 },
+ { "MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_L", 0x96b8, 0 },
+ { "MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_H", 0x96bc, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BYTES_L", 0x20400, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BYTES_H", 0x20404, 0 },
+ { "MPS_PORT_STAT_TX_PORT_FRAMES_L", 0x20408, 0 },
+ { "MPS_PORT_STAT_TX_PORT_FRAMES_H", 0x2040c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BCAST_L", 0x20410, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BCAST_H", 0x20414, 0 },
+ { "MPS_PORT_STAT_TX_PORT_MCAST_L", 0x20418, 0 },
+ { "MPS_PORT_STAT_TX_PORT_MCAST_H", 0x2041c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_UCAST_L", 0x20420, 0 },
+ { "MPS_PORT_STAT_TX_PORT_UCAST_H", 0x20424, 0 },
+ { "MPS_PORT_STAT_TX_PORT_ERROR_L", 0x20428, 0 },
+ { "MPS_PORT_STAT_TX_PORT_ERROR_H", 0x2042c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_64B_L", 0x20430, 0 },
+ { "MPS_PORT_STAT_TX_PORT_64B_H", 0x20434, 0 },
+ { "MPS_PORT_STAT_TX_PORT_65B_127B_L", 0x20438, 0 },
+ { "MPS_PORT_STAT_TX_PORT_65B_127B_H", 0x2043c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_128B_255B_L", 0x20440, 0 },
+ { "MPS_PORT_STAT_TX_PORT_128B_255B_H", 0x20444, 0 },
+ { "MPS_PORT_STAT_TX_PORT_256B_511B_L", 0x20448, 0 },
+ { "MPS_PORT_STAT_TX_PORT_256B_511B_H", 0x2044c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_512B_1023B_L", 0x20450, 0 },
+ { "MPS_PORT_STAT_TX_PORT_512B_1023B_H", 0x20454, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1024B_1518B_L", 0x20458, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1024B_1518B_H", 0x2045c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1519B_MAX_L", 0x20460, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1519B_MAX_H", 0x20464, 0 },
+ { "MPS_PORT_STAT_TX_PORT_DROP_L", 0x20468, 0 },
+ { "MPS_PORT_STAT_TX_PORT_DROP_H", 0x2046c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PAUSE_L", 0x20470, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PAUSE_H", 0x20474, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP0_L", 0x20478, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP0_H", 0x2047c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP1_L", 0x20480, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP1_H", 0x20484, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP2_L", 0x20488, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP2_H", 0x2048c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP3_L", 0x20490, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP3_H", 0x20494, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP4_L", 0x20498, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP4_H", 0x2049c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP5_L", 0x204a0, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP5_H", 0x204a4, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP6_L", 0x204a8, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP6_H", 0x204ac, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP7_L", 0x204b0, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP7_H", 0x204b4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BYTES_L", 0x204c0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BYTES_H", 0x204c4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_FRAMES_L", 0x204c8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_FRAMES_H", 0x204cc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BCAST_L", 0x204d0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BCAST_H", 0x204d4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_MCAST_L", 0x204d8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_MCAST_H", 0x204dc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_UCAST_L", 0x204e0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_UCAST_H", 0x204e4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_ERROR_L", 0x204e8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_ERROR_H", 0x204ec, 0 },
+ { "MPS_PORT_STAT_LB_PORT_64B_L", 0x204f0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_64B_H", 0x204f4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_65B_127B_L", 0x204f8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_65B_127B_H", 0x204fc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_128B_255B_L", 0x20500, 0 },
+ { "MPS_PORT_STAT_LB_PORT_128B_255B_H", 0x20504, 0 },
+ { "MPS_PORT_STAT_LB_PORT_256B_511B_L", 0x20508, 0 },
+ { "MPS_PORT_STAT_LB_PORT_256B_511B_H", 0x2050c, 0 },
+ { "MPS_PORT_STAT_LB_PORT_512B_1023B_L", 0x20510, 0 },
+ { "MPS_PORT_STAT_LB_PORT_512B_1023B_H", 0x20514, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1024B_1518B_L", 0x20518, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1024B_1518B_H", 0x2051c, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1519B_MAX_L", 0x20520, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1519B_MAX_H", 0x20524, 0 },
+ { "MPS_PORT_STAT_LB_PORT_DROP_FRAMES", 0x20528, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BYTES_L", 0x20540, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BYTES_H", 0x20544, 0 },
+ { "MPS_PORT_STAT_RX_PORT_FRAMES_L", 0x20548, 0 },
+ { "MPS_PORT_STAT_RX_PORT_FRAMES_H", 0x2054c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BCAST_L", 0x20550, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BCAST_H", 0x20554, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MCAST_L", 0x20558, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MCAST_H", 0x2055c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_UCAST_L", 0x20560, 0 },
+ { "MPS_PORT_STAT_RX_PORT_UCAST_H", 0x20564, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_ERROR_L", 0x20568, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_ERROR_H", 0x2056c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L", 0x20570, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_H", 0x20574, 0 },
+ { "MPS_PORT_STAT_RX_PORT_CRC_ERROR_L", 0x20578, 0 },
+ { "MPS_PORT_STAT_RX_PORT_CRC_ERROR_H", 0x2057c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LEN_ERROR_L", 0x20580, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LEN_ERROR_H", 0x20584, 0 },
+ { "MPS_PORT_STAT_RX_PORT_SYM_ERROR_L", 0x20588, 0 },
+ { "MPS_PORT_STAT_RX_PORT_SYM_ERROR_H", 0x2058c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_64B_L", 0x20590, 0 },
+ { "MPS_PORT_STAT_RX_PORT_64B_H", 0x20594, 0 },
+ { "MPS_PORT_STAT_RX_PORT_65B_127B_L", 0x20598, 0 },
+ { "MPS_PORT_STAT_RX_PORT_65B_127B_H", 0x2059c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_128B_255B_L", 0x205a0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_128B_255B_H", 0x205a4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_256B_511B_L", 0x205a8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_256B_511B_H", 0x205ac, 0 },
+ { "MPS_PORT_STAT_RX_PORT_512B_1023B_L", 0x205b0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_512B_1023B_H", 0x205b4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1024B_1518B_L", 0x205b8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1024B_1518B_H", 0x205bc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1519B_MAX_L", 0x205c0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1519B_MAX_H", 0x205c4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PAUSE_L", 0x205c8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PAUSE_H", 0x205cc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP0_L", 0x205d0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP0_H", 0x205d4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP1_L", 0x205d8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP1_H", 0x205dc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP2_L", 0x205e0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP2_H", 0x205e4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP3_L", 0x205e8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP3_H", 0x205ec, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP4_L", 0x205f0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP4_H", 0x205f4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP5_L", 0x205f8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP5_H", 0x205fc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP6_L", 0x20600, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP6_H", 0x20604, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP7_L", 0x20608, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP7_H", 0x2060c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LESS_64B_L", 0x20610, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LESS_64B_H", 0x20614, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BYTES_L", 0x22400, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BYTES_H", 0x22404, 0 },
+ { "MPS_PORT_STAT_TX_PORT_FRAMES_L", 0x22408, 0 },
+ { "MPS_PORT_STAT_TX_PORT_FRAMES_H", 0x2240c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BCAST_L", 0x22410, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BCAST_H", 0x22414, 0 },
+ { "MPS_PORT_STAT_TX_PORT_MCAST_L", 0x22418, 0 },
+ { "MPS_PORT_STAT_TX_PORT_MCAST_H", 0x2241c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_UCAST_L", 0x22420, 0 },
+ { "MPS_PORT_STAT_TX_PORT_UCAST_H", 0x22424, 0 },
+ { "MPS_PORT_STAT_TX_PORT_ERROR_L", 0x22428, 0 },
+ { "MPS_PORT_STAT_TX_PORT_ERROR_H", 0x2242c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_64B_L", 0x22430, 0 },
+ { "MPS_PORT_STAT_TX_PORT_64B_H", 0x22434, 0 },
+ { "MPS_PORT_STAT_TX_PORT_65B_127B_L", 0x22438, 0 },
+ { "MPS_PORT_STAT_TX_PORT_65B_127B_H", 0x2243c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_128B_255B_L", 0x22440, 0 },
+ { "MPS_PORT_STAT_TX_PORT_128B_255B_H", 0x22444, 0 },
+ { "MPS_PORT_STAT_TX_PORT_256B_511B_L", 0x22448, 0 },
+ { "MPS_PORT_STAT_TX_PORT_256B_511B_H", 0x2244c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_512B_1023B_L", 0x22450, 0 },
+ { "MPS_PORT_STAT_TX_PORT_512B_1023B_H", 0x22454, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1024B_1518B_L", 0x22458, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1024B_1518B_H", 0x2245c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1519B_MAX_L", 0x22460, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1519B_MAX_H", 0x22464, 0 },
+ { "MPS_PORT_STAT_TX_PORT_DROP_L", 0x22468, 0 },
+ { "MPS_PORT_STAT_TX_PORT_DROP_H", 0x2246c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PAUSE_L", 0x22470, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PAUSE_H", 0x22474, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP0_L", 0x22478, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP0_H", 0x2247c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP1_L", 0x22480, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP1_H", 0x22484, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP2_L", 0x22488, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP2_H", 0x2248c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP3_L", 0x22490, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP3_H", 0x22494, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP4_L", 0x22498, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP4_H", 0x2249c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP5_L", 0x224a0, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP5_H", 0x224a4, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP6_L", 0x224a8, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP6_H", 0x224ac, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP7_L", 0x224b0, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP7_H", 0x224b4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BYTES_L", 0x224c0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BYTES_H", 0x224c4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_FRAMES_L", 0x224c8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_FRAMES_H", 0x224cc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BCAST_L", 0x224d0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BCAST_H", 0x224d4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_MCAST_L", 0x224d8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_MCAST_H", 0x224dc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_UCAST_L", 0x224e0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_UCAST_H", 0x224e4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_ERROR_L", 0x224e8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_ERROR_H", 0x224ec, 0 },
+ { "MPS_PORT_STAT_LB_PORT_64B_L", 0x224f0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_64B_H", 0x224f4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_65B_127B_L", 0x224f8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_65B_127B_H", 0x224fc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_128B_255B_L", 0x22500, 0 },
+ { "MPS_PORT_STAT_LB_PORT_128B_255B_H", 0x22504, 0 },
+ { "MPS_PORT_STAT_LB_PORT_256B_511B_L", 0x22508, 0 },
+ { "MPS_PORT_STAT_LB_PORT_256B_511B_H", 0x2250c, 0 },
+ { "MPS_PORT_STAT_LB_PORT_512B_1023B_L", 0x22510, 0 },
+ { "MPS_PORT_STAT_LB_PORT_512B_1023B_H", 0x22514, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1024B_1518B_L", 0x22518, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1024B_1518B_H", 0x2251c, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1519B_MAX_L", 0x22520, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1519B_MAX_H", 0x22524, 0 },
+ { "MPS_PORT_STAT_LB_PORT_DROP_FRAMES", 0x22528, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BYTES_L", 0x22540, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BYTES_H", 0x22544, 0 },
+ { "MPS_PORT_STAT_RX_PORT_FRAMES_L", 0x22548, 0 },
+ { "MPS_PORT_STAT_RX_PORT_FRAMES_H", 0x2254c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BCAST_L", 0x22550, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BCAST_H", 0x22554, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MCAST_L", 0x22558, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MCAST_H", 0x2255c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_UCAST_L", 0x22560, 0 },
+ { "MPS_PORT_STAT_RX_PORT_UCAST_H", 0x22564, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_ERROR_L", 0x22568, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_ERROR_H", 0x2256c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L", 0x22570, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_H", 0x22574, 0 },
+ { "MPS_PORT_STAT_RX_PORT_CRC_ERROR_L", 0x22578, 0 },
+ { "MPS_PORT_STAT_RX_PORT_CRC_ERROR_H", 0x2257c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LEN_ERROR_L", 0x22580, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LEN_ERROR_H", 0x22584, 0 },
+ { "MPS_PORT_STAT_RX_PORT_SYM_ERROR_L", 0x22588, 0 },
+ { "MPS_PORT_STAT_RX_PORT_SYM_ERROR_H", 0x2258c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_64B_L", 0x22590, 0 },
+ { "MPS_PORT_STAT_RX_PORT_64B_H", 0x22594, 0 },
+ { "MPS_PORT_STAT_RX_PORT_65B_127B_L", 0x22598, 0 },
+ { "MPS_PORT_STAT_RX_PORT_65B_127B_H", 0x2259c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_128B_255B_L", 0x225a0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_128B_255B_H", 0x225a4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_256B_511B_L", 0x225a8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_256B_511B_H", 0x225ac, 0 },
+ { "MPS_PORT_STAT_RX_PORT_512B_1023B_L", 0x225b0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_512B_1023B_H", 0x225b4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1024B_1518B_L", 0x225b8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1024B_1518B_H", 0x225bc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1519B_MAX_L", 0x225c0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1519B_MAX_H", 0x225c4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PAUSE_L", 0x225c8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PAUSE_H", 0x225cc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP0_L", 0x225d0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP0_H", 0x225d4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP1_L", 0x225d8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP1_H", 0x225dc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP2_L", 0x225e0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP2_H", 0x225e4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP3_L", 0x225e8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP3_H", 0x225ec, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP4_L", 0x225f0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP4_H", 0x225f4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP5_L", 0x225f8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP5_H", 0x225fc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP6_L", 0x22600, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP6_H", 0x22604, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP7_L", 0x22608, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP7_H", 0x2260c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LESS_64B_L", 0x22610, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LESS_64B_H", 0x22614, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BYTES_L", 0x24400, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BYTES_H", 0x24404, 0 },
+ { "MPS_PORT_STAT_TX_PORT_FRAMES_L", 0x24408, 0 },
+ { "MPS_PORT_STAT_TX_PORT_FRAMES_H", 0x2440c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BCAST_L", 0x24410, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BCAST_H", 0x24414, 0 },
+ { "MPS_PORT_STAT_TX_PORT_MCAST_L", 0x24418, 0 },
+ { "MPS_PORT_STAT_TX_PORT_MCAST_H", 0x2441c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_UCAST_L", 0x24420, 0 },
+ { "MPS_PORT_STAT_TX_PORT_UCAST_H", 0x24424, 0 },
+ { "MPS_PORT_STAT_TX_PORT_ERROR_L", 0x24428, 0 },
+ { "MPS_PORT_STAT_TX_PORT_ERROR_H", 0x2442c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_64B_L", 0x24430, 0 },
+ { "MPS_PORT_STAT_TX_PORT_64B_H", 0x24434, 0 },
+ { "MPS_PORT_STAT_TX_PORT_65B_127B_L", 0x24438, 0 },
+ { "MPS_PORT_STAT_TX_PORT_65B_127B_H", 0x2443c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_128B_255B_L", 0x24440, 0 },
+ { "MPS_PORT_STAT_TX_PORT_128B_255B_H", 0x24444, 0 },
+ { "MPS_PORT_STAT_TX_PORT_256B_511B_L", 0x24448, 0 },
+ { "MPS_PORT_STAT_TX_PORT_256B_511B_H", 0x2444c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_512B_1023B_L", 0x24450, 0 },
+ { "MPS_PORT_STAT_TX_PORT_512B_1023B_H", 0x24454, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1024B_1518B_L", 0x24458, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1024B_1518B_H", 0x2445c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1519B_MAX_L", 0x24460, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1519B_MAX_H", 0x24464, 0 },
+ { "MPS_PORT_STAT_TX_PORT_DROP_L", 0x24468, 0 },
+ { "MPS_PORT_STAT_TX_PORT_DROP_H", 0x2446c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PAUSE_L", 0x24470, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PAUSE_H", 0x24474, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP0_L", 0x24478, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP0_H", 0x2447c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP1_L", 0x24480, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP1_H", 0x24484, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP2_L", 0x24488, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP2_H", 0x2448c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP3_L", 0x24490, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP3_H", 0x24494, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP4_L", 0x24498, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP4_H", 0x2449c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP5_L", 0x244a0, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP5_H", 0x244a4, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP6_L", 0x244a8, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP6_H", 0x244ac, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP7_L", 0x244b0, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP7_H", 0x244b4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BYTES_L", 0x244c0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BYTES_H", 0x244c4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_FRAMES_L", 0x244c8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_FRAMES_H", 0x244cc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BCAST_L", 0x244d0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BCAST_H", 0x244d4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_MCAST_L", 0x244d8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_MCAST_H", 0x244dc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_UCAST_L", 0x244e0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_UCAST_H", 0x244e4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_ERROR_L", 0x244e8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_ERROR_H", 0x244ec, 0 },
+ { "MPS_PORT_STAT_LB_PORT_64B_L", 0x244f0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_64B_H", 0x244f4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_65B_127B_L", 0x244f8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_65B_127B_H", 0x244fc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_128B_255B_L", 0x24500, 0 },
+ { "MPS_PORT_STAT_LB_PORT_128B_255B_H", 0x24504, 0 },
+ { "MPS_PORT_STAT_LB_PORT_256B_511B_L", 0x24508, 0 },
+ { "MPS_PORT_STAT_LB_PORT_256B_511B_H", 0x2450c, 0 },
+ { "MPS_PORT_STAT_LB_PORT_512B_1023B_L", 0x24510, 0 },
+ { "MPS_PORT_STAT_LB_PORT_512B_1023B_H", 0x24514, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1024B_1518B_L", 0x24518, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1024B_1518B_H", 0x2451c, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1519B_MAX_L", 0x24520, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1519B_MAX_H", 0x24524, 0 },
+ { "MPS_PORT_STAT_LB_PORT_DROP_FRAMES", 0x24528, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BYTES_L", 0x24540, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BYTES_H", 0x24544, 0 },
+ { "MPS_PORT_STAT_RX_PORT_FRAMES_L", 0x24548, 0 },
+ { "MPS_PORT_STAT_RX_PORT_FRAMES_H", 0x2454c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BCAST_L", 0x24550, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BCAST_H", 0x24554, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MCAST_L", 0x24558, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MCAST_H", 0x2455c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_UCAST_L", 0x24560, 0 },
+ { "MPS_PORT_STAT_RX_PORT_UCAST_H", 0x24564, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_ERROR_L", 0x24568, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_ERROR_H", 0x2456c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L", 0x24570, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_H", 0x24574, 0 },
+ { "MPS_PORT_STAT_RX_PORT_CRC_ERROR_L", 0x24578, 0 },
+ { "MPS_PORT_STAT_RX_PORT_CRC_ERROR_H", 0x2457c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LEN_ERROR_L", 0x24580, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LEN_ERROR_H", 0x24584, 0 },
+ { "MPS_PORT_STAT_RX_PORT_SYM_ERROR_L", 0x24588, 0 },
+ { "MPS_PORT_STAT_RX_PORT_SYM_ERROR_H", 0x2458c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_64B_L", 0x24590, 0 },
+ { "MPS_PORT_STAT_RX_PORT_64B_H", 0x24594, 0 },
+ { "MPS_PORT_STAT_RX_PORT_65B_127B_L", 0x24598, 0 },
+ { "MPS_PORT_STAT_RX_PORT_65B_127B_H", 0x2459c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_128B_255B_L", 0x245a0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_128B_255B_H", 0x245a4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_256B_511B_L", 0x245a8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_256B_511B_H", 0x245ac, 0 },
+ { "MPS_PORT_STAT_RX_PORT_512B_1023B_L", 0x245b0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_512B_1023B_H", 0x245b4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1024B_1518B_L", 0x245b8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1024B_1518B_H", 0x245bc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1519B_MAX_L", 0x245c0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1519B_MAX_H", 0x245c4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PAUSE_L", 0x245c8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PAUSE_H", 0x245cc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP0_L", 0x245d0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP0_H", 0x245d4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP1_L", 0x245d8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP1_H", 0x245dc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP2_L", 0x245e0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP2_H", 0x245e4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP3_L", 0x245e8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP3_H", 0x245ec, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP4_L", 0x245f0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP4_H", 0x245f4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP5_L", 0x245f8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP5_H", 0x245fc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP6_L", 0x24600, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP6_H", 0x24604, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP7_L", 0x24608, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP7_H", 0x2460c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LESS_64B_L", 0x24610, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LESS_64B_H", 0x24614, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BYTES_L", 0x26400, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BYTES_H", 0x26404, 0 },
+ { "MPS_PORT_STAT_TX_PORT_FRAMES_L", 0x26408, 0 },
+ { "MPS_PORT_STAT_TX_PORT_FRAMES_H", 0x2640c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BCAST_L", 0x26410, 0 },
+ { "MPS_PORT_STAT_TX_PORT_BCAST_H", 0x26414, 0 },
+ { "MPS_PORT_STAT_TX_PORT_MCAST_L", 0x26418, 0 },
+ { "MPS_PORT_STAT_TX_PORT_MCAST_H", 0x2641c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_UCAST_L", 0x26420, 0 },
+ { "MPS_PORT_STAT_TX_PORT_UCAST_H", 0x26424, 0 },
+ { "MPS_PORT_STAT_TX_PORT_ERROR_L", 0x26428, 0 },
+ { "MPS_PORT_STAT_TX_PORT_ERROR_H", 0x2642c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_64B_L", 0x26430, 0 },
+ { "MPS_PORT_STAT_TX_PORT_64B_H", 0x26434, 0 },
+ { "MPS_PORT_STAT_TX_PORT_65B_127B_L", 0x26438, 0 },
+ { "MPS_PORT_STAT_TX_PORT_65B_127B_H", 0x2643c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_128B_255B_L", 0x26440, 0 },
+ { "MPS_PORT_STAT_TX_PORT_128B_255B_H", 0x26444, 0 },
+ { "MPS_PORT_STAT_TX_PORT_256B_511B_L", 0x26448, 0 },
+ { "MPS_PORT_STAT_TX_PORT_256B_511B_H", 0x2644c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_512B_1023B_L", 0x26450, 0 },
+ { "MPS_PORT_STAT_TX_PORT_512B_1023B_H", 0x26454, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1024B_1518B_L", 0x26458, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1024B_1518B_H", 0x2645c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1519B_MAX_L", 0x26460, 0 },
+ { "MPS_PORT_STAT_TX_PORT_1519B_MAX_H", 0x26464, 0 },
+ { "MPS_PORT_STAT_TX_PORT_DROP_L", 0x26468, 0 },
+ { "MPS_PORT_STAT_TX_PORT_DROP_H", 0x2646c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PAUSE_L", 0x26470, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PAUSE_H", 0x26474, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP0_L", 0x26478, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP0_H", 0x2647c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP1_L", 0x26480, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP1_H", 0x26484, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP2_L", 0x26488, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP2_H", 0x2648c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP3_L", 0x26490, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP3_H", 0x26494, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP4_L", 0x26498, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP4_H", 0x2649c, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP5_L", 0x264a0, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP5_H", 0x264a4, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP6_L", 0x264a8, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP6_H", 0x264ac, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP7_L", 0x264b0, 0 },
+ { "MPS_PORT_STAT_TX_PORT_PPP7_H", 0x264b4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BYTES_L", 0x264c0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BYTES_H", 0x264c4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_FRAMES_L", 0x264c8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_FRAMES_H", 0x264cc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BCAST_L", 0x264d0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_BCAST_H", 0x264d4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_MCAST_L", 0x264d8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_MCAST_H", 0x264dc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_UCAST_L", 0x264e0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_UCAST_H", 0x264e4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_ERROR_L", 0x264e8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_ERROR_H", 0x264ec, 0 },
+ { "MPS_PORT_STAT_LB_PORT_64B_L", 0x264f0, 0 },
+ { "MPS_PORT_STAT_LB_PORT_64B_H", 0x264f4, 0 },
+ { "MPS_PORT_STAT_LB_PORT_65B_127B_L", 0x264f8, 0 },
+ { "MPS_PORT_STAT_LB_PORT_65B_127B_H", 0x264fc, 0 },
+ { "MPS_PORT_STAT_LB_PORT_128B_255B_L", 0x26500, 0 },
+ { "MPS_PORT_STAT_LB_PORT_128B_255B_H", 0x26504, 0 },
+ { "MPS_PORT_STAT_LB_PORT_256B_511B_L", 0x26508, 0 },
+ { "MPS_PORT_STAT_LB_PORT_256B_511B_H", 0x2650c, 0 },
+ { "MPS_PORT_STAT_LB_PORT_512B_1023B_L", 0x26510, 0 },
+ { "MPS_PORT_STAT_LB_PORT_512B_1023B_H", 0x26514, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1024B_1518B_L", 0x26518, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1024B_1518B_H", 0x2651c, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1519B_MAX_L", 0x26520, 0 },
+ { "MPS_PORT_STAT_LB_PORT_1519B_MAX_H", 0x26524, 0 },
+ { "MPS_PORT_STAT_LB_PORT_DROP_FRAMES", 0x26528, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BYTES_L", 0x26540, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BYTES_H", 0x26544, 0 },
+ { "MPS_PORT_STAT_RX_PORT_FRAMES_L", 0x26548, 0 },
+ { "MPS_PORT_STAT_RX_PORT_FRAMES_H", 0x2654c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BCAST_L", 0x26550, 0 },
+ { "MPS_PORT_STAT_RX_PORT_BCAST_H", 0x26554, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MCAST_L", 0x26558, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MCAST_H", 0x2655c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_UCAST_L", 0x26560, 0 },
+ { "MPS_PORT_STAT_RX_PORT_UCAST_H", 0x26564, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_ERROR_L", 0x26568, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_ERROR_H", 0x2656c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L", 0x26570, 0 },
+ { "MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_H", 0x26574, 0 },
+ { "MPS_PORT_STAT_RX_PORT_CRC_ERROR_L", 0x26578, 0 },
+ { "MPS_PORT_STAT_RX_PORT_CRC_ERROR_H", 0x2657c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LEN_ERROR_L", 0x26580, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LEN_ERROR_H", 0x26584, 0 },
+ { "MPS_PORT_STAT_RX_PORT_SYM_ERROR_L", 0x26588, 0 },
+ { "MPS_PORT_STAT_RX_PORT_SYM_ERROR_H", 0x2658c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_64B_L", 0x26590, 0 },
+ { "MPS_PORT_STAT_RX_PORT_64B_H", 0x26594, 0 },
+ { "MPS_PORT_STAT_RX_PORT_65B_127B_L", 0x26598, 0 },
+ { "MPS_PORT_STAT_RX_PORT_65B_127B_H", 0x2659c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_128B_255B_L", 0x265a0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_128B_255B_H", 0x265a4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_256B_511B_L", 0x265a8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_256B_511B_H", 0x265ac, 0 },
+ { "MPS_PORT_STAT_RX_PORT_512B_1023B_L", 0x265b0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_512B_1023B_H", 0x265b4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1024B_1518B_L", 0x265b8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1024B_1518B_H", 0x265bc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1519B_MAX_L", 0x265c0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_1519B_MAX_H", 0x265c4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PAUSE_L", 0x265c8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PAUSE_H", 0x265cc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP0_L", 0x265d0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP0_H", 0x265d4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP1_L", 0x265d8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP1_H", 0x265dc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP2_L", 0x265e0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP2_H", 0x265e4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP3_L", 0x265e8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP3_H", 0x265ec, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP4_L", 0x265f0, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP4_H", 0x265f4, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP5_L", 0x265f8, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP5_H", 0x265fc, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP6_L", 0x26600, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP6_H", 0x26604, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP7_L", 0x26608, 0 },
+ { "MPS_PORT_STAT_RX_PORT_PPP7_H", 0x2660c, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LESS_64B_L", 0x26610, 0 },
+ { "MPS_PORT_STAT_RX_PORT_LESS_64B_H", 0x26614, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_L", 0x1e300, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_H", 0x1e304, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_L", 0x1e308, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_H", 0x1e30c, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_L", 0x1e310, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_H", 0x1e314, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_L", 0x1e318, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_H", 0x1e31c, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_L", 0x1e320, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_H", 0x1e324, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_L", 0x1e328, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_H", 0x1e32c, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_L", 0x1e330, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_H", 0x1e334, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_L", 0x1e338, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_H", 0x1e33c, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_L", 0x1e340, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_H", 0x1e344, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_L", 0x1e348, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_H", 0x1e34c, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_L", 0x1e350, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_H", 0x1e354, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_L", 0x1e358, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_H", 0x1e35c, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_L", 0x1e360, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_H", 0x1e364, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_L", 0x1e368, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_H", 0x1e36c, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_L", 0x1e370, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_H", 0x1e374, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_L", 0x1e378, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_H", 0x1e37c, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_L", 0x1e380, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_H", 0x1e384, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_L", 0x1e700, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_H", 0x1e704, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_L", 0x1e708, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_H", 0x1e70c, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_L", 0x1e710, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_H", 0x1e714, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_L", 0x1e718, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_H", 0x1e71c, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_L", 0x1e720, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_H", 0x1e724, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_L", 0x1e728, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_H", 0x1e72c, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_L", 0x1e730, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_H", 0x1e734, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_L", 0x1e738, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_H", 0x1e73c, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_L", 0x1e740, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_H", 0x1e744, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_L", 0x1e748, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_H", 0x1e74c, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_L", 0x1e750, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_H", 0x1e754, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_L", 0x1e758, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_H", 0x1e75c, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_L", 0x1e760, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_H", 0x1e764, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_L", 0x1e768, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_H", 0x1e76c, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_L", 0x1e770, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_H", 0x1e774, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_L", 0x1e778, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_H", 0x1e77c, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_L", 0x1e780, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_H", 0x1e784, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_L", 0x1eb00, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_H", 0x1eb04, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_L", 0x1eb08, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_H", 0x1eb0c, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_L", 0x1eb10, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_H", 0x1eb14, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_L", 0x1eb18, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_H", 0x1eb1c, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_L", 0x1eb20, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_H", 0x1eb24, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_L", 0x1eb28, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_H", 0x1eb2c, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_L", 0x1eb30, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_H", 0x1eb34, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_L", 0x1eb38, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_H", 0x1eb3c, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_L", 0x1eb40, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_H", 0x1eb44, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_L", 0x1eb48, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_H", 0x1eb4c, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_L", 0x1eb50, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_H", 0x1eb54, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_L", 0x1eb58, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_H", 0x1eb5c, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_L", 0x1eb60, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_H", 0x1eb64, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_L", 0x1eb68, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_H", 0x1eb6c, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_L", 0x1eb70, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_H", 0x1eb74, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_L", 0x1eb78, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_H", 0x1eb7c, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_L", 0x1eb80, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_H", 0x1eb84, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_L", 0x1ef00, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_H", 0x1ef04, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_L", 0x1ef08, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_H", 0x1ef0c, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_L", 0x1ef10, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_H", 0x1ef14, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_L", 0x1ef18, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_H", 0x1ef1c, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_L", 0x1ef20, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_H", 0x1ef24, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_L", 0x1ef28, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_H", 0x1ef2c, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_L", 0x1ef30, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_H", 0x1ef34, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_L", 0x1ef38, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_H", 0x1ef3c, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_L", 0x1ef40, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_H", 0x1ef44, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_L", 0x1ef48, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_H", 0x1ef4c, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_L", 0x1ef50, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_H", 0x1ef54, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_L", 0x1ef58, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_H", 0x1ef5c, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_L", 0x1ef60, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_H", 0x1ef64, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_L", 0x1ef68, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_H", 0x1ef6c, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_L", 0x1ef70, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_H", 0x1ef74, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_L", 0x1ef78, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_H", 0x1ef7c, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_L", 0x1ef80, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_H", 0x1ef84, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_L", 0x1f300, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_H", 0x1f304, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_L", 0x1f308, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_H", 0x1f30c, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_L", 0x1f310, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_H", 0x1f314, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_L", 0x1f318, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_H", 0x1f31c, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_L", 0x1f320, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_H", 0x1f324, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_L", 0x1f328, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_H", 0x1f32c, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_L", 0x1f330, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_H", 0x1f334, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_L", 0x1f338, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_H", 0x1f33c, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_L", 0x1f340, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_H", 0x1f344, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_L", 0x1f348, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_H", 0x1f34c, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_L", 0x1f350, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_H", 0x1f354, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_L", 0x1f358, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_H", 0x1f35c, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_L", 0x1f360, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_H", 0x1f364, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_L", 0x1f368, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_H", 0x1f36c, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_L", 0x1f370, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_H", 0x1f374, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_L", 0x1f378, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_H", 0x1f37c, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_L", 0x1f380, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_H", 0x1f384, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_L", 0x1f700, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_H", 0x1f704, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_L", 0x1f708, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_H", 0x1f70c, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_L", 0x1f710, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_H", 0x1f714, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_L", 0x1f718, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_H", 0x1f71c, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_L", 0x1f720, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_H", 0x1f724, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_L", 0x1f728, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_H", 0x1f72c, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_L", 0x1f730, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_H", 0x1f734, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_L", 0x1f738, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_H", 0x1f73c, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_L", 0x1f740, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_H", 0x1f744, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_L", 0x1f748, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_H", 0x1f74c, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_L", 0x1f750, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_H", 0x1f754, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_L", 0x1f758, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_H", 0x1f75c, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_L", 0x1f760, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_H", 0x1f764, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_L", 0x1f768, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_H", 0x1f76c, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_L", 0x1f770, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_H", 0x1f774, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_L", 0x1f778, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_H", 0x1f77c, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_L", 0x1f780, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_H", 0x1f784, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_L", 0x1fb00, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_H", 0x1fb04, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_L", 0x1fb08, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_H", 0x1fb0c, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_L", 0x1fb10, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_H", 0x1fb14, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_L", 0x1fb18, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_H", 0x1fb1c, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_L", 0x1fb20, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_H", 0x1fb24, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_L", 0x1fb28, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_H", 0x1fb2c, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_L", 0x1fb30, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_H", 0x1fb34, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_L", 0x1fb38, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_H", 0x1fb3c, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_L", 0x1fb40, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_H", 0x1fb44, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_L", 0x1fb48, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_H", 0x1fb4c, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_L", 0x1fb50, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_H", 0x1fb54, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_L", 0x1fb58, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_H", 0x1fb5c, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_L", 0x1fb60, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_H", 0x1fb64, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_L", 0x1fb68, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_H", 0x1fb6c, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_L", 0x1fb70, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_H", 0x1fb74, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_L", 0x1fb78, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_H", 0x1fb7c, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_L", 0x1fb80, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_H", 0x1fb84, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_L", 0x1ff00, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_BYTES_H", 0x1ff04, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_L", 0x1ff08, 0 },
+ { "MPS_PF_STAT_TX_PF_BCAST_FRAMES_H", 0x1ff0c, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_L", 0x1ff10, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_BYTES_H", 0x1ff14, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_L", 0x1ff18, 0 },
+ { "MPS_PF_STAT_TX_PF_MCAST_FRAMES_H", 0x1ff1c, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_L", 0x1ff20, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_BYTES_H", 0x1ff24, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_L", 0x1ff28, 0 },
+ { "MPS_PF_STAT_TX_PF_UCAST_FRAMES_H", 0x1ff2c, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_L", 0x1ff30, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_BYTES_H", 0x1ff34, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_L", 0x1ff38, 0 },
+ { "MPS_PF_STAT_TX_PF_OFFLOAD_FRAMES_H", 0x1ff3c, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_L", 0x1ff40, 0 },
+ { "MPS_PF_STAT_RX_PF_BYTES_H", 0x1ff44, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_L", 0x1ff48, 0 },
+ { "MPS_PF_STAT_RX_PF_FRAMES_H", 0x1ff4c, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_L", 0x1ff50, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_BYTES_H", 0x1ff54, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_L", 0x1ff58, 0 },
+ { "MPS_PF_STAT_RX_PF_BCAST_FRAMES_H", 0x1ff5c, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_L", 0x1ff60, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_BYTES_H", 0x1ff64, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_L", 0x1ff68, 0 },
+ { "MPS_PF_STAT_RX_PF_MCAST_FRAMES_H", 0x1ff6c, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_L", 0x1ff70, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_BYTES_H", 0x1ff74, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_L", 0x1ff78, 0 },
+ { "MPS_PF_STAT_RX_PF_UCAST_FRAMES_H", 0x1ff7c, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_L", 0x1ff80, 0 },
+ { "MPS_PF_STAT_RX_PF_ERR_FRAMES_H", 0x1ff84, 0 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20200, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20204, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20208, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2020c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20210, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20214, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20218, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2021c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20220, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20224, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20228, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2022c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20230, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20234, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20238, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2023c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20240, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20244, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20248, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2024c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20250, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20254, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20258, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2025c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20260, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20264, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20268, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2026c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20270, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20274, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20278, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2027c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20280, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20284, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20288, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2028c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20290, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20294, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20298, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2029c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202a0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202a4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202a8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202ac, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202b0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202b4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202b8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202bc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202c0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202c4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202c8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202cc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202d0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202d4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202d8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202dc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202e0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202e4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202e8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202ec, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202f0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202f4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202f8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x202fc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x20300, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22200, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22204, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22208, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2220c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22210, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22214, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22218, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2221c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22220, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22224, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22228, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2222c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22230, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22234, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22238, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2223c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22240, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22244, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22248, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2224c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22250, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22254, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22258, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2225c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22260, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22264, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22268, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2226c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22270, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22274, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22278, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2227c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22280, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22284, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22288, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2228c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22290, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22294, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22298, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2229c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222a0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222a4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222a8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222ac, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222b0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222b4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222b8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222bc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222c0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222c4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222c8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222cc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222d0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222d4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222d8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222dc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222e0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222e4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222e8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222ec, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222f0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222f4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222f8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x222fc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x22300, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24200, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24204, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24208, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2420c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24210, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24214, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24218, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2421c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24220, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24224, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24228, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2422c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24230, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24234, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24238, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2423c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24240, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24244, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24248, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2424c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24250, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24254, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24258, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2425c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24260, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24264, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24268, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2426c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24270, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24274, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24278, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2427c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24280, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24284, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24288, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2428c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24290, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24294, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24298, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2429c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242a0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242a4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242a8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242ac, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242b0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242b4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242b8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242bc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242c0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242c4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242c8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242cc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242d0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242d4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242d8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242dc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242e0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242e4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242e8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242ec, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242f0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242f4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242f8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x242fc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x24300, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26200, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26204, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26208, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2620c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26210, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26214, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26218, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2621c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26220, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26224, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26228, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2622c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26230, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26234, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26238, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2623c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26240, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26244, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26248, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2624c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26250, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26254, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26258, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2625c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26260, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26264, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26268, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2626c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26270, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26274, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26278, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2627c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26280, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26284, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26288, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2628c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26290, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26294, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26298, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x2629c, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262a0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262a4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262a8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262ac, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262b0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262b4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262b8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262bc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262c0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262c4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262c8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262cc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262d0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262d4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262d8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262dc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262e0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262e4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262e8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262ec, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262f0, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262f4, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262f8, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x262fc, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_SRAM", 0x26300, 0 },
+ { "Valid", 20, 1 },
+ { "PortMap", 16, 4 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_HASH_CTL", 0x20304, 0 },
+ { "UnicastEnable", 31, 1 },
+ { "MPS_PORT_CLS_PROMISCUOUS_CTL", 0x20308, 0 },
+ { "Enable", 31, 1 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_BMC_MAC_ADDR_L", 0x2030c, 0 },
+ { "MPS_PORT_CLS_BMC_MAC_ADDR_H", 0x20310, 0 },
+ { "MatchBoth", 17, 1 },
+ { "Valid", 16, 1 },
+ { "DA", 0, 16 },
+ { "MPS_PORT_CLS_BMC_VLAN", 0x20314, 0 },
+ { "BMC_VLAN_SEL", 13, 1 },
+ { "Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PORT_CLS_CTL", 0x20318, 0 },
+ { "MPS_PORT_CLS_HASH_CTL", 0x22304, 0 },
+ { "UnicastEnable", 31, 1 },
+ { "MPS_PORT_CLS_PROMISCUOUS_CTL", 0x22308, 0 },
+ { "Enable", 31, 1 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_BMC_MAC_ADDR_L", 0x2230c, 0 },
+ { "MPS_PORT_CLS_BMC_MAC_ADDR_H", 0x22310, 0 },
+ { "MatchBoth", 17, 1 },
+ { "Valid", 16, 1 },
+ { "DA", 0, 16 },
+ { "MPS_PORT_CLS_BMC_VLAN", 0x22314, 0 },
+ { "BMC_VLAN_SEL", 13, 1 },
+ { "Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PORT_CLS_CTL", 0x22318, 0 },
+ { "MPS_PORT_CLS_HASH_CTL", 0x24304, 0 },
+ { "UnicastEnable", 31, 1 },
+ { "MPS_PORT_CLS_PROMISCUOUS_CTL", 0x24308, 0 },
+ { "Enable", 31, 1 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_BMC_MAC_ADDR_L", 0x2430c, 0 },
+ { "MPS_PORT_CLS_BMC_MAC_ADDR_H", 0x24310, 0 },
+ { "MatchBoth", 17, 1 },
+ { "Valid", 16, 1 },
+ { "DA", 0, 16 },
+ { "MPS_PORT_CLS_BMC_VLAN", 0x24314, 0 },
+ { "BMC_VLAN_SEL", 13, 1 },
+ { "Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PORT_CLS_CTL", 0x24318, 0 },
+ { "MPS_PORT_CLS_HASH_CTL", 0x26304, 0 },
+ { "UnicastEnable", 31, 1 },
+ { "MPS_PORT_CLS_PROMISCUOUS_CTL", 0x26308, 0 },
+ { "Enable", 31, 1 },
+ { "MultiListen", 15, 1 },
+ { "Priority", 12, 3 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_PORT_CLS_BMC_MAC_ADDR_L", 0x2630c, 0 },
+ { "MPS_PORT_CLS_BMC_MAC_ADDR_H", 0x26310, 0 },
+ { "MatchBoth", 17, 1 },
+ { "Valid", 16, 1 },
+ { "DA", 0, 16 },
+ { "MPS_PORT_CLS_BMC_VLAN", 0x26314, 0 },
+ { "BMC_VLAN_SEL", 13, 1 },
+ { "Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_PORT_CLS_CTL", 0x26318, 0 },
+ { "MPS_CLS_CTL", 0xd000, 0 },
+ { "MemWriteFault", 4, 1 },
+ { "MemWriteWaiting", 3, 1 },
+ { "CimNoPromiscuous", 2, 1 },
+ { "HypervisorOnly", 1, 1 },
+ { "VlanClsEn", 0, 1 },
+ { "MPS_CLS_ARB_WEIGHT", 0xd004, 0 },
+ { "PlWeight", 16, 5 },
+ { "CimWeight", 8, 5 },
+ { "LpbkWeight", 0, 5 },
+ { "MPS_CLS_BMC_MAC_ADDR_L", 0xd010, 0 },
+ { "MPS_CLS_BMC_MAC_ADDR_H", 0xd014, 0 },
+ { "MatchBoth", 17, 1 },
+ { "Valid", 16, 1 },
+ { "DA", 0, 16 },
+ { "MPS_CLS_BMC_VLAN", 0xd018, 0 },
+ { "Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_PERR_INJECT", 0xd01c, 0 },
+ { "MemSel", 1, 2 },
+ { "InjectDataErr", 0, 1 },
+ { "MPS_CLS_PERR_ENABLE", 0xd020, 0 },
+ { "HashSRAM", 2, 1 },
+ { "MatchTCAM", 1, 1 },
+ { "MatchSRAM", 0, 1 },
+ { "MPS_CLS_INT_ENABLE", 0xd024, 0 },
+ { "PLErrEnb", 3, 1 },
+ { "HashSRAM", 2, 1 },
+ { "MatchTCAM", 1, 1 },
+ { "MatchSRAM", 0, 1 },
+ { "MPS_CLS_INT_CAUSE", 0xd028, 0 },
+ { "PLErrEnb", 3, 1 },
+ { "HashSRAM", 2, 1 },
+ { "MatchTCAM", 1, 1 },
+ { "MatchSRAM", 0, 1 },
+ { "MPS_CLS_PL_TEST_DATA_L", 0xd02c, 0 },
+ { "MPS_CLS_PL_TEST_DATA_H", 0xd030, 0 },
+ { "MPS_CLS_PL_TEST_RES_DATA", 0xd034, 0 },
+ { "Cls_Priority", 24, 3 },
+ { "Cls_Replicate", 23, 1 },
+ { "Cls_Index", 14, 9 },
+ { "Cls_VF", 7, 7 },
+ { "Cls_VF_Vld", 6, 1 },
+ { "Cls_PF", 3, 3 },
+ { "Cls_Match", 0, 3 },
+ { "MPS_CLS_PL_TEST_CTL", 0xd038, 0 },
+ { "MPS_CLS_PORT_BMC_CTL", 0xd03c, 0 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfc0, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfc4, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfc8, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfcc, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfd0, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfd4, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfd8, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfdc, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_VLAN_TABLE", 0xdfe0, 0 },
+ { "VLAN_Mask", 16, 12 },
+ { "PF", 13, 3 },
+ { "VLAN_Valid", 12, 1 },
+ { "VLAN_ID", 0, 12 },
+ { "MPS_CLS_SRAM_L", 0xe000, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe008, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe010, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe018, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe020, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe028, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe030, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe038, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe040, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe048, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe050, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe058, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe060, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe068, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe070, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe078, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe080, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe088, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe090, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe098, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe0f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe100, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe108, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe110, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe118, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe120, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe128, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe130, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe138, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe140, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe148, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe150, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe158, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe160, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe168, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe170, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe178, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe180, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe188, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe190, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe198, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe1f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe200, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe208, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe210, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe218, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe220, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe228, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe230, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe238, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe240, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe248, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe250, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe258, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe260, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe268, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe270, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe278, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe280, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe288, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe290, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe298, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe2f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe300, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe308, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe310, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe318, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe320, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe328, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe330, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe338, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe340, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe348, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe350, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe358, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe360, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe368, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe370, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe378, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe380, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe388, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe390, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe398, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe3f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe400, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe408, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe410, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe418, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe420, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe428, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe430, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe438, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe440, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe448, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe450, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe458, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe460, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe468, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe470, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe478, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe480, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe488, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe490, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe498, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe4f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe500, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe508, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe510, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe518, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe520, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe528, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe530, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe538, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe540, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe548, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe550, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe558, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe560, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe568, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe570, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe578, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe580, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe588, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe590, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe598, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe5f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe600, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe608, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe610, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe618, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe620, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe628, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe630, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe638, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe640, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe648, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe650, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe658, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe660, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe668, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe670, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe678, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe680, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe688, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe690, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe698, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe6f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe700, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe708, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe710, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe718, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe720, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe728, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe730, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe738, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe740, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe748, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe750, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe758, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe760, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe768, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe770, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe778, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe780, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe788, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe790, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe798, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe7f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe800, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe808, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe810, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe818, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe820, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe828, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe830, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe838, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe840, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe848, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe850, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe858, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe860, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe868, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe870, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe878, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe880, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe888, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe890, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe898, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe8f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe900, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe908, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe910, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe918, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe920, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe928, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe930, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe938, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe940, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe948, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe950, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe958, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe960, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe968, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe970, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe978, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe980, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe988, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe990, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe998, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9a0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9a8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9b0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9b8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9c0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9c8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9d0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9d8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9e0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9e8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9f0, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xe9f8, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea00, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea08, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea10, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea18, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea20, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea28, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea30, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea38, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea40, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea48, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea50, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea58, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea60, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea68, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea70, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_L", 0xea78, 0 },
+ { "MultiListen3", 28, 1 },
+ { "MultiListen2", 27, 1 },
+ { "MultiListen1", 26, 1 },
+ { "MultiListen0", 25, 1 },
+ { "Priority3", 22, 3 },
+ { "Priority2", 19, 3 },
+ { "Priority1", 16, 3 },
+ { "Priority0", 13, 3 },
+ { "Valid", 12, 1 },
+ { "Replicate", 11, 1 },
+ { "PF", 8, 3 },
+ { "VF_Valid", 7, 1 },
+ { "VF", 0, 7 },
+ { "MPS_CLS_SRAM_H", 0xe004, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe00c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe014, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe01c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe024, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe02c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe034, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe03c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe044, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe04c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe054, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe05c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe064, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe06c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe074, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe07c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe084, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe08c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe094, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe09c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe0fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe104, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe10c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe114, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe11c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe124, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe12c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe134, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe13c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe144, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe14c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe154, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe15c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe164, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe16c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe174, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe17c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe184, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe18c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe194, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe19c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe1fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe204, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe20c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe214, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe21c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe224, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe22c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe234, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe23c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe244, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe24c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe254, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe25c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe264, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe26c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe274, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe27c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe284, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe28c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe294, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe29c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe2fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe304, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe30c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe314, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe31c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe324, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe32c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe334, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe33c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe344, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe34c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe354, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe35c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe364, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe36c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe374, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe37c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe384, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe38c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe394, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe39c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe3fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe404, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe40c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe414, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe41c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe424, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe42c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe434, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe43c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe444, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe44c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe454, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe45c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe464, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe46c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe474, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe47c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe484, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe48c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe494, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe49c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe4fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe504, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe50c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe514, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe51c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe524, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe52c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe534, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe53c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe544, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe54c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe554, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe55c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe564, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe56c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe574, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe57c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe584, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe58c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe594, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe59c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe5fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe604, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe60c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe614, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe61c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe624, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe62c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe634, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe63c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe644, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe64c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe654, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe65c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe664, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe66c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe674, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe67c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe684, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe68c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe694, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe69c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe6fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe704, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe70c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe714, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe71c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe724, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe72c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe734, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe73c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe744, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe74c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe754, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe75c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe764, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe76c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe774, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe77c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe784, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe78c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe794, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe79c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe7fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe804, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe80c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe814, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe81c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe824, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe82c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe834, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe83c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe844, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe84c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe854, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe85c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe864, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe86c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe874, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe87c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe884, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe88c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe894, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe89c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe8fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe904, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe90c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe914, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe91c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe924, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe92c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe934, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe93c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe944, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe94c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe954, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe95c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe964, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe96c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe974, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe97c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe984, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe98c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe994, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe99c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9a4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9ac, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9b4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9bc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9c4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9cc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9d4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9dc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9e4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9ec, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9f4, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xe9fc, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea04, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea0c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea14, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea1c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea24, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea2c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea34, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea3c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea44, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea4c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea54, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea5c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea64, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea6c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea74, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_SRAM_H", 0xea7c, 0 },
+ { "MacParity1", 9, 1 },
+ { "MacParity0", 8, 1 },
+ { "MacParityMaskSize", 4, 4 },
+ { "PortMap", 0, 4 },
+ { "MPS_CLS_TCAM_Y_L", 0xf000, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf010, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf020, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf030, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf040, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf050, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf060, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf070, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf080, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf090, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf0a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf0b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf0c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf0d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf0e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf0f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf100, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf110, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf120, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf130, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf140, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf150, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf160, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf170, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf180, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf190, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf1a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf1b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf1c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf1d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf1e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf1f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf200, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf210, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf220, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf230, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf240, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf250, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf260, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf270, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf280, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf290, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf2a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf2b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf2c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf2d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf2e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf2f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf300, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf310, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf320, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf330, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf340, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf350, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf360, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf370, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf380, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf390, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf3a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf3b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf3c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf3d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf3e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf3f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf400, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf410, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf420, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf430, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf440, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf450, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf460, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf470, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf480, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf490, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf4a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf4b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf4c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf4d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf4e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf4f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf500, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf510, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf520, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf530, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf540, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf550, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf560, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf570, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf580, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf590, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf5a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf5b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf5c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf5d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf5e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf5f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf600, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf610, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf620, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf630, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf640, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf650, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf660, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf670, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf680, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf690, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf6a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf6b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf6c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf6d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf6e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf6f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf700, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf710, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf720, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf730, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf740, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf750, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf760, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf770, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf780, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf790, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf7a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf7b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf7c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf7d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf7e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf7f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf800, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf810, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf820, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf830, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf840, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf850, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf860, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf870, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf880, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf890, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf8a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf8b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf8c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf8d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf8e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf8f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf900, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf910, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf920, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf930, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf940, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf950, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf960, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf970, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf980, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf990, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf9a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf9b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf9c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf9d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf9e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xf9f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfa90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfaa0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfab0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfac0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfad0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfae0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfaf0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfb90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfba0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfbb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfbc0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfbd0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfbe0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfbf0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfc90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfca0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfcb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfcc0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfcd0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfce0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfcf0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfd90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfda0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfdb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfdc0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfdd0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfde0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfdf0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfe90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfea0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfeb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfec0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfed0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfee0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfef0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xff90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xffa0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xffb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xffc0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xffd0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xffe0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0xfff0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10000, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10010, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10020, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10030, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10040, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10050, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10060, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10070, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10080, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10090, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x100a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x100b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x100c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x100d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x100e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x100f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10100, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10110, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10120, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10130, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10140, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10150, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10160, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10170, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10180, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10190, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x101a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x101b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x101c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x101d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x101e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x101f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10200, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10210, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10220, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10230, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10240, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10250, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10260, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10270, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10280, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10290, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x102a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x102b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x102c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x102d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x102e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x102f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10300, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10310, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10320, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10330, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10340, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10350, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10360, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10370, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10380, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10390, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x103a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x103b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x103c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x103d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x103e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x103f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10400, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10410, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10420, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10430, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10440, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10450, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10460, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10470, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10480, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10490, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x104a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x104b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x104c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x104d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x104e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x104f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10500, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10510, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10520, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10530, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10540, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10550, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10560, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10570, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10580, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10590, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x105a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x105b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x105c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x105d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x105e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x105f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10600, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10610, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10620, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10630, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10640, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10650, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10660, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10670, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10680, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10690, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x106a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x106b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x106c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x106d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x106e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x106f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10700, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10710, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10720, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10730, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10740, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10750, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10760, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10770, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10780, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10790, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x107a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x107b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x107c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x107d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x107e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x107f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10800, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10810, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10820, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10830, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10840, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10850, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10860, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10870, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10880, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10890, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x108a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x108b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x108c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x108d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x108e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x108f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10900, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10910, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10920, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10930, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10940, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10950, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10960, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10970, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10980, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10990, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x109a0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x109b0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x109c0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x109d0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x109e0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x109f0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10a90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10aa0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ab0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ac0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ad0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ae0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10af0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10b90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ba0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10bb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10bc0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10bd0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10be0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10bf0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10c90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ca0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10cb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10cc0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10cd0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ce0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10cf0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10d90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10da0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10db0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10dc0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10dd0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10de0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10df0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10e90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ea0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10eb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ec0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ed0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ee0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ef0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f00, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f10, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f20, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f30, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f40, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f50, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f60, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f70, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f80, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10f90, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10fa0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10fb0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10fc0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10fd0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10fe0, 0 },
+ { "MPS_CLS_TCAM_Y_L", 0x10ff0, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf004, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf014, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf024, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf034, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf044, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf054, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf064, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf074, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf084, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf094, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf0a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf0b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf0c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf0d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf0e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf0f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf104, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf114, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf124, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf134, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf144, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf154, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf164, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf174, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf184, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf194, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf1a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf1b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf1c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf1d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf1e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf1f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf204, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf214, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf224, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf234, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf244, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf254, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf264, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf274, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf284, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf294, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf2a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf2b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf2c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf2d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf2e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf2f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf304, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf314, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf324, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf334, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf344, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf354, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf364, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf374, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf384, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf394, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf3a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf3b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf3c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf3d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf3e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf3f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf404, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf414, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf424, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf434, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf444, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf454, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf464, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf474, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf484, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf494, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf4a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf4b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf4c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf4d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf4e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf4f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf504, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf514, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf524, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf534, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf544, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf554, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf564, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf574, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf584, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf594, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf5a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf5b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf5c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf5d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf5e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf5f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf604, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf614, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf624, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf634, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf644, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf654, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf664, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf674, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf684, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf694, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf6a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf6b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf6c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf6d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf6e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf6f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf704, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf714, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf724, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf734, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf744, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf754, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf764, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf774, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf784, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf794, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf7a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf7b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf7c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf7d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf7e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf7f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf804, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf814, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf824, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf834, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf844, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf854, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf864, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf874, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf884, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf894, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf8a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf8b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf8c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf8d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf8e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf8f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf904, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf914, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf924, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf934, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf944, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf954, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf964, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf974, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf984, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf994, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf9a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf9b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf9c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf9d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf9e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xf9f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfa94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfaa4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfab4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfac4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfad4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfae4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfaf4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfb94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfba4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfbb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfbc4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfbd4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfbe4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfbf4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfc94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfca4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfcb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfcc4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfcd4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfce4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfcf4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfd94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfda4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfdb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfdc4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfdd4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfde4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfdf4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfe94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfea4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfeb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfec4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfed4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfee4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfef4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xff94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xffa4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xffb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xffc4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xffd4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xffe4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0xfff4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10004, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10014, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10024, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10034, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10044, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10054, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10064, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10074, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10084, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10094, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x100a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x100b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x100c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x100d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x100e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x100f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10104, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10114, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10124, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10134, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10144, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10154, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10164, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10174, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10184, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10194, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x101a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x101b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x101c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x101d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x101e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x101f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10204, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10214, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10224, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10234, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10244, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10254, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10264, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10274, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10284, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10294, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x102a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x102b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x102c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x102d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x102e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x102f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10304, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10314, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10324, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10334, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10344, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10354, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10364, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10374, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10384, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10394, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x103a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x103b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x103c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x103d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x103e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x103f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10404, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10414, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10424, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10434, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10444, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10454, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10464, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10474, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10484, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10494, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x104a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x104b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x104c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x104d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x104e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x104f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10504, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10514, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10524, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10534, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10544, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10554, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10564, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10574, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10584, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10594, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x105a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x105b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x105c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x105d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x105e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x105f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10604, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10614, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10624, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10634, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10644, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10654, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10664, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10674, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10684, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10694, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x106a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x106b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x106c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x106d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x106e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x106f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10704, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10714, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10724, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10734, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10744, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10754, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10764, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10774, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10784, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10794, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x107a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x107b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x107c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x107d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x107e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x107f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10804, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10814, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10824, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10834, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10844, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10854, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10864, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10874, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10884, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10894, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x108a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x108b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x108c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x108d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x108e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x108f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10904, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10914, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10924, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10934, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10944, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10954, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10964, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10974, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10984, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10994, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x109a4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x109b4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x109c4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x109d4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x109e4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x109f4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10a94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10aa4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ab4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ac4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ad4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ae4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10af4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10b94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ba4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10bb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10bc4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10bd4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10be4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10bf4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10c94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ca4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10cb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10cc4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10cd4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ce4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10cf4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10d94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10da4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10db4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10dc4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10dd4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10de4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10df4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10e94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ea4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10eb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ec4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ed4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ee4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ef4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f04, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f14, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f24, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f34, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f44, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f54, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f64, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f74, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f84, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10f94, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10fa4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10fb4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10fc4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10fd4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10fe4, 0 },
+ { "MPS_CLS_TCAM_Y_H", 0x10ff4, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf008, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf018, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf028, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf038, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf048, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf058, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf068, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf078, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf088, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf098, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf0a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf0b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf0c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf0d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf0e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf0f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf108, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf118, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf128, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf138, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf148, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf158, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf168, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf178, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf188, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf198, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf1a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf1b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf1c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf1d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf1e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf1f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf208, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf218, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf228, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf238, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf248, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf258, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf268, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf278, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf288, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf298, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf2a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf2b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf2c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf2d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf2e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf2f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf308, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf318, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf328, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf338, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf348, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf358, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf368, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf378, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf388, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf398, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf3a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf3b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf3c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf3d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf3e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf3f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf408, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf418, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf428, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf438, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf448, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf458, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf468, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf478, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf488, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf498, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf4a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf4b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf4c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf4d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf4e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf4f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf508, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf518, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf528, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf538, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf548, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf558, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf568, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf578, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf588, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf598, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf5a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf5b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf5c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf5d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf5e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf5f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf608, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf618, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf628, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf638, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf648, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf658, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf668, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf678, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf688, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf698, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf6a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf6b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf6c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf6d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf6e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf6f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf708, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf718, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf728, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf738, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf748, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf758, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf768, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf778, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf788, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf798, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf7a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf7b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf7c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf7d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf7e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf7f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf808, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf818, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf828, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf838, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf848, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf858, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf868, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf878, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf888, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf898, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf8a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf8b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf8c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf8d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf8e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf8f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf908, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf918, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf928, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf938, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf948, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf958, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf968, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf978, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf988, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf998, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf9a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf9b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf9c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf9d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf9e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xf9f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfa98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfaa8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfab8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfac8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfad8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfae8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfaf8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfb98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfba8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfbb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfbc8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfbd8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfbe8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfbf8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfc98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfca8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfcb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfcc8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfcd8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfce8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfcf8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfd98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfda8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfdb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfdc8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfdd8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfde8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfdf8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfe98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfea8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfeb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfec8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfed8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfee8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfef8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xff98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xffa8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xffb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xffc8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xffd8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xffe8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0xfff8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10008, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10018, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10028, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10038, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10048, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10058, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10068, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10078, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10088, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10098, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x100a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x100b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x100c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x100d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x100e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x100f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10108, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10118, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10128, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10138, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10148, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10158, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10168, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10178, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10188, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10198, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x101a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x101b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x101c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x101d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x101e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x101f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10208, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10218, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10228, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10238, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10248, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10258, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10268, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10278, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10288, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10298, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x102a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x102b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x102c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x102d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x102e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x102f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10308, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10318, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10328, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10338, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10348, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10358, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10368, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10378, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10388, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10398, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x103a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x103b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x103c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x103d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x103e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x103f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10408, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10418, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10428, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10438, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10448, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10458, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10468, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10478, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10488, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10498, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x104a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x104b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x104c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x104d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x104e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x104f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10508, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10518, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10528, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10538, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10548, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10558, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10568, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10578, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10588, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10598, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x105a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x105b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x105c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x105d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x105e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x105f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10608, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10618, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10628, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10638, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10648, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10658, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10668, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10678, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10688, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10698, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x106a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x106b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x106c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x106d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x106e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x106f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10708, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10718, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10728, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10738, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10748, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10758, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10768, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10778, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10788, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10798, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x107a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x107b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x107c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x107d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x107e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x107f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10808, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10818, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10828, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10838, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10848, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10858, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10868, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10878, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10888, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10898, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x108a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x108b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x108c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x108d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x108e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x108f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10908, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10918, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10928, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10938, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10948, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10958, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10968, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10978, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10988, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10998, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x109a8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x109b8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x109c8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x109d8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x109e8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x109f8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10a98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10aa8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ab8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ac8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ad8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ae8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10af8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10b98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ba8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10bb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10bc8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10bd8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10be8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10bf8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10c98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ca8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10cb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10cc8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10cd8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ce8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10cf8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10d98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10da8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10db8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10dc8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10dd8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10de8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10df8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10e98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ea8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10eb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ec8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ed8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ee8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ef8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f08, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f18, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f28, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f38, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f48, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f58, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f68, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f78, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f88, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10f98, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10fa8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10fb8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10fc8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10fd8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10fe8, 0 },
+ { "MPS_CLS_TCAM_X_L", 0x10ff8, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf00c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf01c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf02c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf03c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf04c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf05c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf06c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf07c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf08c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf09c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf0ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf0bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf0cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf0dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf0ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf0fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf10c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf11c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf12c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf13c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf14c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf15c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf16c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf17c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf18c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf19c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf1ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf1bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf1cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf1dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf1ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf1fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf20c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf21c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf22c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf23c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf24c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf25c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf26c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf27c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf28c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf29c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf2ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf2bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf2cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf2dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf2ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf2fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf30c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf31c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf32c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf33c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf34c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf35c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf36c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf37c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf38c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf39c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf3ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf3bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf3cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf3dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf3ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf3fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf40c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf41c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf42c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf43c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf44c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf45c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf46c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf47c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf48c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf49c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf4ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf4bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf4cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf4dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf4ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf4fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf50c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf51c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf52c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf53c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf54c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf55c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf56c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf57c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf58c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf59c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf5ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf5bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf5cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf5dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf5ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf5fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf60c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf61c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf62c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf63c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf64c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf65c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf66c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf67c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf68c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf69c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf6ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf6bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf6cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf6dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf6ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf6fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf70c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf71c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf72c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf73c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf74c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf75c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf76c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf77c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf78c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf79c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf7ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf7bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf7cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf7dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf7ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf7fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf80c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf81c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf82c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf83c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf84c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf85c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf86c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf87c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf88c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf89c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf8ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf8bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf8cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf8dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf8ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf8fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf90c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf91c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf92c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf93c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf94c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf95c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf96c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf97c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf98c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf99c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf9ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf9bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf9cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf9dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf9ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xf9fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfa9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfaac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfabc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfacc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfadc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfaec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfafc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfb9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfbac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfbbc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfbcc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfbdc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfbec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfbfc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfc9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfcac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfcbc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfccc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfcdc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfcec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfcfc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfd9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfdac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfdbc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfdcc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfddc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfdec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfdfc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfe9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfeac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfebc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfecc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfedc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfeec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfefc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xff9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xffac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xffbc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xffcc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xffdc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xffec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0xfffc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1000c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1001c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1002c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1003c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1004c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1005c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1006c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1007c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1008c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1009c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x100ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x100bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x100cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x100dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x100ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x100fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1010c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1011c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1012c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1013c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1014c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1015c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1016c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1017c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1018c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1019c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x101ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x101bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x101cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x101dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x101ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x101fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1020c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1021c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1022c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1023c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1024c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1025c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1026c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1027c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1028c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1029c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x102ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x102bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x102cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x102dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x102ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x102fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1030c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1031c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1032c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1033c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1034c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1035c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1036c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1037c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1038c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1039c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x103ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x103bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x103cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x103dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x103ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x103fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1040c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1041c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1042c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1043c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1044c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1045c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1046c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1047c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1048c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1049c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x104ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x104bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x104cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x104dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x104ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x104fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1050c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1051c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1052c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1053c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1054c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1055c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1056c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1057c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1058c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1059c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x105ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x105bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x105cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x105dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x105ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x105fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1060c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1061c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1062c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1063c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1064c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1065c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1066c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1067c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1068c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1069c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x106ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x106bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x106cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x106dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x106ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x106fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1070c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1071c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1072c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1073c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1074c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1075c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1076c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1077c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1078c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1079c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x107ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x107bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x107cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x107dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x107ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x107fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1080c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1081c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1082c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1083c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1084c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1085c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1086c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1087c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1088c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1089c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x108ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x108bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x108cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x108dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x108ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x108fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1090c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1091c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1092c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1093c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1094c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1095c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1096c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1097c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1098c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x1099c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x109ac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x109bc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x109cc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x109dc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x109ec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x109fc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10a9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10aac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10abc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10acc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10adc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10aec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10afc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10b9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10bac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10bbc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10bcc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10bdc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10bec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10bfc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10c9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10cac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10cbc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10ccc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10cdc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10cec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10cfc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10d9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10dac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10dbc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10dcc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10ddc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10dec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10dfc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10e9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10eac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10ebc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10ecc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10edc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10eec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10efc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f0c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f1c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f2c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f3c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f4c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f5c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f6c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f7c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f8c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10f9c, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10fac, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10fbc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10fcc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10fdc, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10fec, 0 },
+ { "MPS_CLS_TCAM_X_H", 0x10ffc, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_cpl_switch_regs[] = {
+ { "CPL_SWITCH_CNTRL", 0x19040, 0 },
+ { "cpl_pkt_tid", 8, 24 },
+ { "cim_truncate_enable", 5, 1 },
+ { "cim_to_up_full_size", 4, 1 },
+ { "cpu_no_enable", 3, 1 },
+ { "switch_table_enable", 2, 1 },
+ { "sge_enable", 1, 1 },
+ { "cim_enable", 0, 1 },
+ { "CPL_SWITCH_TBL_IDX", 0x19044, 0 },
+ { "CPL_SWITCH_TBL_DATA", 0x19048, 0 },
+ { "CPL_SWITCH_ZERO_ERROR", 0x1904c, 0 },
+ { "zero_cmd_ch1", 8, 8 },
+ { "zero_cmd_ch0", 0, 8 },
+ { "CPL_INTR_ENABLE", 0x19050, 0 },
+ { "cim_op_map_perr", 5, 1 },
+ { "cim_ovfl_error", 4, 1 },
+ { "tp_framing_error", 3, 1 },
+ { "sge_framing_error", 2, 1 },
+ { "cim_framing_error", 1, 1 },
+ { "zero_switch_error", 0, 1 },
+ { "CPL_INTR_CAUSE", 0x19054, 0 },
+ { "cim_op_map_perr", 5, 1 },
+ { "cim_ovfl_error", 4, 1 },
+ { "tp_framing_error", 3, 1 },
+ { "sge_framing_error", 2, 1 },
+ { "cim_framing_error", 1, 1 },
+ { "zero_switch_error", 0, 1 },
+ { "CPL_MAP_TBL_IDX", 0x19058, 0 },
+ { "CPL_MAP_TBL_DATA", 0x1905c, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_smb_regs[] = {
+ { "SMB_GLOBAL_TIME_CFG", 0x19060, 0 },
+ { "MacroCntCfg", 8, 5 },
+ { "MicroCntCfg", 0, 8 },
+ { "SMB_MST_TIMEOUT_CFG", 0x19064, 0 },
+ { "SMB_MST_CTL_CFG", 0x19068, 0 },
+ { "MstFifoDbg", 31, 1 },
+ { "MstFifoDbgClr", 30, 1 },
+ { "MstRxByteCfg", 12, 6 },
+ { "MstTxByteCfg", 6, 6 },
+ { "MstReset", 1, 1 },
+ { "MstCtlEn", 0, 1 },
+ { "SMB_MST_CTL_STS", 0x1906c, 0 },
+ { "MstRxByteCnt", 12, 6 },
+ { "MstTxByteCnt", 6, 6 },
+ { "MstBusySts", 0, 1 },
+ { "SMB_MST_TX_FIFO_RDWR", 0x19070, 0 },
+ { "SMB_MST_RX_FIFO_RDWR", 0x19074, 0 },
+ { "SMB_SLV_TIMEOUT_CFG", 0x19078, 0 },
+ { "SMB_SLV_CTL_CFG", 0x1907c, 0 },
+ { "SlvFifoDbg", 31, 1 },
+ { "SlvFifoDbgClr", 30, 1 },
+ { "SlvCrcOutBitInv", 21, 1 },
+ { "SlvCrcOutBitRev", 20, 1 },
+ { "SlvCrcInBitRev", 19, 1 },
+ { "SlvCrcPreset", 11, 8 },
+ { "SlvAddrCfg", 4, 7 },
+ { "SlvAlrtSet", 2, 1 },
+ { "SlvReset", 1, 1 },
+ { "SlvCtlEn", 0, 1 },
+ { "SMB_SLV_CTL_STS", 0x19080, 0 },
+ { "SlvFifoTxCnt", 12, 6 },
+ { "SlvFifoCnt", 6, 6 },
+ { "SlvAlrtSts", 2, 1 },
+ { "SlvBusySts", 0, 1 },
+ { "SMB_SLV_FIFO_RDWR", 0x19084, 0 },
+ { "SMB_INT_ENABLE", 0x1908c, 0 },
+ { "MstTxFifoParEn", 21, 1 },
+ { "MstRxFifoParEn", 20, 1 },
+ { "SlvFifoParEn", 19, 1 },
+ { "SlvUnExpBusStopEn", 18, 1 },
+ { "SlvUnExpBusStartEn", 17, 1 },
+ { "SlvCommandCodeInvEn", 16, 1 },
+ { "SlvByteCntErrEn", 15, 1 },
+ { "SlvUnExpAckMstEn", 14, 1 },
+ { "SlvUnExpNackMstEn", 13, 1 },
+ { "SlvNoBusStopEn", 12, 1 },
+ { "SlvNoRepStartEn", 11, 1 },
+ { "SlvRxAddrIntEn", 10, 1 },
+ { "SlvRxPecErrIntEn", 9, 1 },
+ { "SlvPrepToArpIntEn", 8, 1 },
+ { "SlvTimeOutIntEn", 7, 1 },
+ { "SlvErrIntEn", 6, 1 },
+ { "SlvDoneIntEn", 5, 1 },
+ { "SlvRxRdyIntEn", 4, 1 },
+ { "MstTimeOutIntEn", 3, 1 },
+ { "MstNAckIntEn", 2, 1 },
+ { "MstLostArbIntEn", 1, 1 },
+ { "MstDoneIntEn", 0, 1 },
+ { "SMB_INT_CAUSE", 0x19090, 0 },
+ { "MstTxFifoParInt", 21, 1 },
+ { "MstRxFifoParInt", 20, 1 },
+ { "SlvFifoParInt", 19, 1 },
+ { "SlvUnExpBusStopInt", 18, 1 },
+ { "SlvUnExpBusStartInt", 17, 1 },
+ { "SlvCommandCodeInvInt", 16, 1 },
+ { "SlvByteCntErrInt", 15, 1 },
+ { "SlvUnExpAckMstInt", 14, 1 },
+ { "SlvUnExpNackMstInt", 13, 1 },
+ { "SlvNoBusStopInt", 12, 1 },
+ { "SlvNoRepStartInt", 11, 1 },
+ { "SlvRxAddrInt", 10, 1 },
+ { "SlvRxPecErrInt", 9, 1 },
+ { "SlvPrepToArpInt", 8, 1 },
+ { "SlvTimeOutInt", 7, 1 },
+ { "SlvErrInt", 6, 1 },
+ { "SlvDoneInt", 5, 1 },
+ { "SlvRxRdyInt", 4, 1 },
+ { "MstTimeOutInt", 3, 1 },
+ { "MstNAckInt", 2, 1 },
+ { "MstLostArbInt", 1, 1 },
+ { "MstDoneInt", 0, 1 },
+ { "SMB_DEBUG_DATA", 0x19094, 0 },
+ { "DebugDataH", 16, 16 },
+ { "DebugDataL", 0, 16 },
+ { "SMB_PERR_EN", 0x19098, 0 },
+ { "MstTxFifoPerrEn", 2, 1 },
+ { "MstRxFifoPerrEn", 1, 1 },
+ { "SlvFifoPerrEn", 0, 1 },
+ { "SMB_PERR_INJ", 0x1909c, 0 },
+ { "MstTxInjDataErr", 3, 1 },
+ { "MstRxInjDataErr", 2, 1 },
+ { "SlvInjDataErr", 1, 1 },
+ { "FifoInjDataErrEn", 0, 1 },
+ { "SMB_SLV_ARP_CTL", 0x190a0, 0 },
+ { "ArpCommandCode", 2, 8 },
+ { "ArpAddrRes", 1, 1 },
+ { "ArpAddrVal", 0, 1 },
+ { "SMB_ARP_UDID0", 0x190a4, 0 },
+ { "SMB_ARP_UDID1", 0x190a8, 0 },
+ { "SubsystemVendorID", 16, 16 },
+ { "SubsystemDeviceID", 0, 16 },
+ { "SMB_ARP_UDID2", 0x190ac, 0 },
+ { "DeviceID", 16, 16 },
+ { "Interface", 0, 16 },
+ { "SMB_ARP_UDID3", 0x190b0, 0 },
+ { "DeviceCap", 24, 8 },
+ { "VersionID", 16, 8 },
+ { "VendorID", 0, 16 },
+ { "SMB_SLV_AUX_ADDR0", 0x190b4, 0 },
+ { "AuxAddr0Val", 6, 1 },
+ { "AuxAddr0", 0, 6 },
+ { "SMB_SLV_AUX_ADDR1", 0x190b8, 0 },
+ { "AuxAddr1Val", 6, 1 },
+ { "AuxAddr1", 0, 6 },
+ { "SMB_SLV_AUX_ADDR2", 0x190bc, 0 },
+ { "AuxAddr2Val", 6, 1 },
+ { "AuxAddr2", 0, 6 },
+ { "SMB_SLV_AUX_ADDR3", 0x190c0, 0 },
+ { "AuxAddr3Val", 6, 1 },
+ { "AuxAddr3", 0, 6 },
+ { "SMB_COMMAND_CODE0", 0x190c4, 0 },
+ { "SMB_COMMAND_CODE1", 0x190c8, 0 },
+ { "SMB_COMMAND_CODE2", 0x190cc, 0 },
+ { "SMB_COMMAND_CODE3", 0x190d0, 0 },
+ { "SMB_COMMAND_CODE4", 0x190d4, 0 },
+ { "SMB_COMMAND_CODE5", 0x190d8, 0 },
+ { "SMB_COMMAND_CODE6", 0x190dc, 0 },
+ { "SMB_COMMAND_CODE7", 0x190e0, 0 },
+ { "SMB_MICRO_CNT_CLK_CFG", 0x190e4, 0 },
+ { "MacroCntClkCfg", 8, 5 },
+ { "MicroCntClkCfg", 0, 8 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_i2cm_regs[] = {
+ { "I2CM_CFG", 0x190f0, 0 },
+ { "I2CM_DATA", 0x190f4, 0 },
+ { "I2CM_OP", 0x190f8, 0 },
+ { "Busy", 31, 1 },
+ { "Ack", 30, 1 },
+ { "Cont", 1, 1 },
+ { "Op", 0, 1 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_mi_regs[] = {
+ { "MI_CFG", 0x19100, 0 },
+ { "T4_St", 14, 1 },
+ { "ClkDiv", 5, 8 },
+ { "St", 3, 2 },
+ { "PreEn", 2, 1 },
+ { "MDIInv", 1, 1 },
+ { "MDIO_1P2V_Sel", 0, 1 },
+ { "MI_ADDR", 0x19104, 0 },
+ { "PhyAddr", 5, 5 },
+ { "RegAddr", 0, 5 },
+ { "MI_DATA", 0x19108, 0 },
+ { "MI_OP", 0x1910c, 0 },
+ { "Busy", 31, 1 },
+ { "St", 3, 2 },
+ { "Inc", 2, 1 },
+ { "Op", 0, 2 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_uart_regs[] = {
+ { "UART_CONFIG", 0x19110, 0 },
+ { "StopBits", 22, 2 },
+ { "Parity", 20, 2 },
+ { "DataBits", 16, 4 },
+ { "ClkDiv", 0, 12 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_pmu_regs[] = {
+ { "PMU_PART_CG_PWRMODE", 0x19120, 0 },
+ { "TPPartCGEn", 14, 1 },
+ { "PDPPartCGEn", 13, 1 },
+ { "PCIePartCGEn", 12, 1 },
+ { "EDC1PartCGEn", 11, 1 },
+ { "MCPartCGEn", 10, 1 },
+ { "EDC0PartCGEn", 9, 1 },
+ { "LEPartCGEn", 8, 1 },
+ { "InitPowerMode", 0, 2 },
+ { "PMU_SLEEPMODE_WAKEUP", 0x19124, 0 },
+ { "HWWakeUpEn", 5, 1 },
+ { "Port3SleepMode", 4, 1 },
+ { "Port2SleepMode", 3, 1 },
+ { "Port1SleepMode", 2, 1 },
+ { "Port0SleepMode", 1, 1 },
+ { "WakeUp", 0, 1 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_ulp_rx_regs[] = {
+ { "ULP_RX_CTL", 0x19150, 0 },
+ { "PCMD1Threshold", 24, 8 },
+ { "PCMD0Threshold", 16, 8 },
+ { "disable_0B_STAG_ERR", 14, 1 },
+ { "RDMA_0b_wr_opcode", 10, 4 },
+ { "RDMA_0b_wr_pass", 9, 1 },
+ { "STAG_RQE", 8, 1 },
+ { "RDMA_State_En", 7, 1 },
+ { "Crc1_En", 6, 1 },
+ { "RDMA_0b_wr_cqe", 5, 1 },
+ { "PCIE_Atrb_En", 4, 1 },
+ { "RDMA_permissive_mode", 3, 1 },
+ { "PagePodME", 2, 1 },
+ { "IscsiTagTcb", 1, 1 },
+ { "TddpTagTcb", 0, 1 },
+ { "ULP_RX_INT_ENABLE", 0x19154, 0 },
+ { "ENABLE_CTX_1", 24, 1 },
+ { "ENABLE_CTX_0", 23, 1 },
+ { "ENABLE_FF", 22, 1 },
+ { "ENABLE_APF_1", 21, 1 },
+ { "ENABLE_APF_0", 20, 1 },
+ { "ENABLE_AF_1", 19, 1 },
+ { "ENABLE_AF_0", 18, 1 },
+ { "ENABLE_PCMDF_1", 17, 1 },
+ { "ENABLE_MPARC_1", 16, 1 },
+ { "ENABLE_MPARF_1", 15, 1 },
+ { "ENABLE_DDPCF_1", 14, 1 },
+ { "ENABLE_TPTCF_1", 13, 1 },
+ { "ENABLE_PCMDF_0", 12, 1 },
+ { "ENABLE_MPARC_0", 11, 1 },
+ { "ENABLE_MPARF_0", 10, 1 },
+ { "ENABLE_DDPCF_0", 9, 1 },
+ { "ENABLE_TPTCF_0", 8, 1 },
+ { "ENABLE_DDPDF_1", 7, 1 },
+ { "ENABLE_DDPMF_1", 6, 1 },
+ { "ENABLE_MEMRF_1", 5, 1 },
+ { "ENABLE_PRSDF_1", 4, 1 },
+ { "ENABLE_DDPDF_0", 3, 1 },
+ { "ENABLE_DDPMF_0", 2, 1 },
+ { "ENABLE_MEMRF_0", 1, 1 },
+ { "ENABLE_PRSDF_0", 0, 1 },
+ { "ULP_RX_INT_CAUSE", 0x19158, 0 },
+ { "CAUSE_CTX_1", 24, 1 },
+ { "CAUSE_CTX_0", 23, 1 },
+ { "CAUSE_FF", 22, 1 },
+ { "CAUSE_APF_1", 21, 1 },
+ { "CAUSE_APF_0", 20, 1 },
+ { "CAUSE_AF_1", 19, 1 },
+ { "CAUSE_AF_0", 18, 1 },
+ { "CAUSE_PCMDF_1", 17, 1 },
+ { "CAUSE_MPARC_1", 16, 1 },
+ { "CAUSE_MPARF_1", 15, 1 },
+ { "CAUSE_DDPCF_1", 14, 1 },
+ { "CAUSE_TPTCF_1", 13, 1 },
+ { "CAUSE_PCMDF_0", 12, 1 },
+ { "CAUSE_MPARC_0", 11, 1 },
+ { "CAUSE_MPARF_0", 10, 1 },
+ { "CAUSE_DDPCF_0", 9, 1 },
+ { "CAUSE_TPTCF_0", 8, 1 },
+ { "CAUSE_DDPDF_1", 7, 1 },
+ { "CAUSE_DDPMF_1", 6, 1 },
+ { "CAUSE_MEMRF_1", 5, 1 },
+ { "CAUSE_PRSDF_1", 4, 1 },
+ { "CAUSE_DDPDF_0", 3, 1 },
+ { "CAUSE_DDPMF_0", 2, 1 },
+ { "CAUSE_MEMRF_0", 1, 1 },
+ { "CAUSE_PRSDF_0", 0, 1 },
+ { "ULP_RX_ISCSI_LLIMIT", 0x1915c, 0 },
+ { "IscsiLlimit", 6, 26 },
+ { "ULP_RX_ISCSI_ULIMIT", 0x19160, 0 },
+ { "IscsiUlimit", 6, 26 },
+ { "ULP_RX_ISCSI_TAGMASK", 0x19164, 0 },
+ { "IscsiTagMask", 6, 26 },
+ { "ULP_RX_ISCSI_PSZ", 0x19168, 0 },
+ { "Hpz3", 24, 4 },
+ { "Hpz2", 16, 4 },
+ { "Hpz1", 8, 4 },
+ { "Hpz0", 0, 4 },
+ { "ULP_RX_TDDP_LLIMIT", 0x1916c, 0 },
+ { "TddpLlimit", 6, 26 },
+ { "ULP_RX_TDDP_ULIMIT", 0x19170, 0 },
+ { "TddpUlimit", 6, 26 },
+ { "ULP_RX_TDDP_TAGMASK", 0x19174, 0 },
+ { "TddpTagMask", 6, 26 },
+ { "ULP_RX_TDDP_PSZ", 0x19178, 0 },
+ { "Hpz3", 24, 4 },
+ { "Hpz2", 16, 4 },
+ { "Hpz1", 8, 4 },
+ { "Hpz0", 0, 4 },
+ { "ULP_RX_STAG_LLIMIT", 0x1917c, 0 },
+ { "ULP_RX_STAG_ULIMIT", 0x19180, 0 },
+ { "ULP_RX_RQ_LLIMIT", 0x19184, 0 },
+ { "ULP_RX_RQ_ULIMIT", 0x19188, 0 },
+ { "ULP_RX_PBL_LLIMIT", 0x1918c, 0 },
+ { "ULP_RX_PBL_ULIMIT", 0x19190, 0 },
+ { "ULP_RX_CTX_BASE", 0x19194, 0 },
+ { "ULP_RX_PERR_ENABLE", 0x1919c, 0 },
+ { "ENABLE_FF", 22, 1 },
+ { "ENABLE_APF_1", 21, 1 },
+ { "ENABLE_APF_0", 20, 1 },
+ { "ENABLE_AF_1", 19, 1 },
+ { "ENABLE_AF_0", 18, 1 },
+ { "ENABLE_PCMDF_1", 17, 1 },
+ { "ENABLE_MPARC_1", 16, 1 },
+ { "ENABLE_MPARF_1", 15, 1 },
+ { "ENABLE_DDPCF_1", 14, 1 },
+ { "ENABLE_TPTCF_1", 13, 1 },
+ { "ENABLE_PCMDF_0", 12, 1 },
+ { "ENABLE_MPARC_0", 11, 1 },
+ { "ENABLE_MPARF_0", 10, 1 },
+ { "ENABLE_DDPCF_0", 9, 1 },
+ { "ENABLE_TPTCF_0", 8, 1 },
+ { "ENABLE_DDPDF_1", 7, 1 },
+ { "ENABLE_DDPMF_1", 6, 1 },
+ { "ENABLE_MEMRF_1", 5, 1 },
+ { "ENABLE_PRSDF_1", 4, 1 },
+ { "ENABLE_DDPDF_0", 3, 1 },
+ { "ENABLE_DDPMF_0", 2, 1 },
+ { "ENABLE_MEMRF_0", 1, 1 },
+ { "ENABLE_PRSDF_0", 0, 1 },
+ { "ULP_RX_PERR_INJECT", 0x191a0, 0 },
+ { "MemSel", 1, 5 },
+ { "InjectDataErr", 0, 1 },
+ { "ULP_RX_RQUDP_LLIMIT", 0x191a4, 0 },
+ { "ULP_RX_RQUDP_ULIMIT", 0x191a8, 0 },
+ { "ULP_RX_CTX_ACC_CH0", 0x191ac, 0 },
+ { "REQ", 21, 1 },
+ { "WB", 20, 1 },
+ { "TID", 0, 20 },
+ { "ULP_RX_CTX_ACC_CH1", 0x191b0, 0 },
+ { "REQ", 21, 1 },
+ { "WB", 20, 1 },
+ { "TID", 0, 20 },
+ { "ULP_RX_SE_CNT_ERR", 0x191d0, 0 },
+ { "ERR_CH1", 4, 4 },
+ { "ERR_CH0", 0, 4 },
+ { "ULP_RX_SE_CNT_CLR", 0x191d4, 0 },
+ { "CLR_CH0", 4, 4 },
+ { "CLR_CH1", 0, 4 },
+ { "ULP_RX_SE_CNT_CH0", 0x191d8, 0 },
+ { "SOP_CNT_OUT0", 28, 4 },
+ { "EOP_CNT_OUT0", 24, 4 },
+ { "SOP_CNT_AL0", 20, 4 },
+ { "EOP_CNT_AL0", 16, 4 },
+ { "SOP_CNT_MR0", 12, 4 },
+ { "EOP_CNT_MR0", 8, 4 },
+ { "SOP_CNT_IN0", 4, 4 },
+ { "EOP_CNT_IN0", 0, 4 },
+ { "ULP_RX_SE_CNT_CH1", 0x191dc, 0 },
+ { "SOP_CNT_OUT1", 28, 4 },
+ { "EOP_CNT_OUT1", 24, 4 },
+ { "SOP_CNT_AL1", 20, 4 },
+ { "EOP_CNT_AL1", 16, 4 },
+ { "SOP_CNT_MR1", 12, 4 },
+ { "EOP_CNT_MR1", 8, 4 },
+ { "SOP_CNT_IN1", 4, 4 },
+ { "EOP_CNT_IN1", 0, 4 },
+ { "ULP_RX_DBG_CTL", 0x191e0, 0 },
+ { "EN_DBG_H", 17, 1 },
+ { "EN_DBG_L", 16, 1 },
+ { "SEL_H", 8, 8 },
+ { "SEL_L", 0, 8 },
+ { "ULP_RX_DBG_DATAH", 0x191e4, 0 },
+ { "ULP_RX_DBG_DATAL", 0x191e8, 0 },
+ { "ULP_RX_LA_CHNL", 0x19238, 0 },
+ { "ULP_RX_LA_CTL", 0x1923c, 0 },
+ { "ULP_RX_LA_RDPTR", 0x19240, 0 },
+ { "ULP_RX_LA_RDDATA", 0x19244, 0 },
+ { "ULP_RX_LA_WRPTR", 0x19248, 0 },
+ { "ULP_RX_LA_RESERVED", 0x1924c, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_sf_regs[] = {
+ { "SF_DATA", 0x193f8, 0 },
+ { "SF_OP", 0x193fc, 0 },
+ { "Busy", 31, 1 },
+ { "Lock", 4, 1 },
+ { "Cont", 3, 1 },
+ { "ByteCnt", 1, 2 },
+ { "Op", 0, 1 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_pl_regs[] = {
+ { "PL_PF_INT_CAUSE", 0x1e3c0, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_INT_ENABLE", 0x1e3c4, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_CTL", 0x1e3c8, 0 },
+ { "PL_PF_INT_CAUSE", 0x1e7c0, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_INT_ENABLE", 0x1e7c4, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_CTL", 0x1e7c8, 0 },
+ { "PL_PF_INT_CAUSE", 0x1ebc0, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_INT_ENABLE", 0x1ebc4, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_CTL", 0x1ebc8, 0 },
+ { "PL_PF_INT_CAUSE", 0x1efc0, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_INT_ENABLE", 0x1efc4, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_CTL", 0x1efc8, 0 },
+ { "PL_PF_INT_CAUSE", 0x1f3c0, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_INT_ENABLE", 0x1f3c4, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_CTL", 0x1f3c8, 0 },
+ { "PL_PF_INT_CAUSE", 0x1f7c0, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_INT_ENABLE", 0x1f7c4, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_CTL", 0x1f7c8, 0 },
+ { "PL_PF_INT_CAUSE", 0x1fbc0, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_INT_ENABLE", 0x1fbc4, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_CTL", 0x1fbc8, 0 },
+ { "PL_PF_INT_CAUSE", 0x1ffc0, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_INT_ENABLE", 0x1ffc4, 0 },
+ { "SW", 3, 1 },
+ { "SGE", 2, 1 },
+ { "CIM", 1, 1 },
+ { "MPS", 0, 1 },
+ { "PL_PF_CTL", 0x1ffc8, 0 },
+ { "PL_WHOAMI", 0x19400, 0 },
+ { "PortxMap", 24, 3 },
+ { "SourceBus", 16, 2 },
+ { "SourcePF", 8, 3 },
+ { "IsVF", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_PERR_CAUSE", 0x19404, 0 },
+ { "UART", 28, 1 },
+ { "ULP_TX", 27, 1 },
+ { "SGE", 26, 1 },
+ { "HMA", 25, 1 },
+ { "CPL_SWITCH", 24, 1 },
+ { "ULP_RX", 23, 1 },
+ { "PM_RX", 22, 1 },
+ { "PM_TX", 21, 1 },
+ { "MA", 20, 1 },
+ { "TP", 19, 1 },
+ { "LE", 18, 1 },
+ { "EDC1", 17, 1 },
+ { "EDC0", 16, 1 },
+ { "MC", 15, 1 },
+ { "PCIE", 14, 1 },
+ { "PMU", 13, 1 },
+ { "XGMAC_KR1", 12, 1 },
+ { "XGMAC_KR0", 11, 1 },
+ { "XGMAC1", 10, 1 },
+ { "XGMAC0", 9, 1 },
+ { "SMB", 8, 1 },
+ { "SF", 7, 1 },
+ { "PL", 6, 1 },
+ { "NCSI", 5, 1 },
+ { "MPS", 4, 1 },
+ { "MI", 3, 1 },
+ { "DBG", 2, 1 },
+ { "I2CM", 1, 1 },
+ { "CIM", 0, 1 },
+ { "PL_PERR_ENABLE", 0x19408, 0 },
+ { "UART", 28, 1 },
+ { "ULP_TX", 27, 1 },
+ { "SGE", 26, 1 },
+ { "HMA", 25, 1 },
+ { "CPL_SWITCH", 24, 1 },
+ { "ULP_RX", 23, 1 },
+ { "PM_RX", 22, 1 },
+ { "PM_TX", 21, 1 },
+ { "MA", 20, 1 },
+ { "TP", 19, 1 },
+ { "LE", 18, 1 },
+ { "EDC1", 17, 1 },
+ { "EDC0", 16, 1 },
+ { "MC", 15, 1 },
+ { "PCIE", 14, 1 },
+ { "PMU", 13, 1 },
+ { "XGMAC_KR1", 12, 1 },
+ { "XGMAC_KR0", 11, 1 },
+ { "XGMAC1", 10, 1 },
+ { "XGMAC0", 9, 1 },
+ { "SMB", 8, 1 },
+ { "SF", 7, 1 },
+ { "PL", 6, 1 },
+ { "NCSI", 5, 1 },
+ { "MPS", 4, 1 },
+ { "MI", 3, 1 },
+ { "DBG", 2, 1 },
+ { "I2CM", 1, 1 },
+ { "CIM", 0, 1 },
+ { "PL_INT_CAUSE", 0x1940c, 0 },
+ { "FLR", 30, 1 },
+ { "SW_CIM", 29, 1 },
+ { "UART", 28, 1 },
+ { "ULP_TX", 27, 1 },
+ { "SGE", 26, 1 },
+ { "HMA", 25, 1 },
+ { "CPL_SWITCH", 24, 1 },
+ { "ULP_RX", 23, 1 },
+ { "PM_RX", 22, 1 },
+ { "PM_TX", 21, 1 },
+ { "MA", 20, 1 },
+ { "TP", 19, 1 },
+ { "LE", 18, 1 },
+ { "EDC1", 17, 1 },
+ { "EDC0", 16, 1 },
+ { "MC", 15, 1 },
+ { "PCIE", 14, 1 },
+ { "PMU", 13, 1 },
+ { "XGMAC_KR1", 12, 1 },
+ { "XGMAC_KR0", 11, 1 },
+ { "XGMAC1", 10, 1 },
+ { "XGMAC0", 9, 1 },
+ { "SMB", 8, 1 },
+ { "SF", 7, 1 },
+ { "PL", 6, 1 },
+ { "NCSI", 5, 1 },
+ { "MPS", 4, 1 },
+ { "MI", 3, 1 },
+ { "DBG", 2, 1 },
+ { "I2CM", 1, 1 },
+ { "CIM", 0, 1 },
+ { "PL_INT_ENABLE", 0x19410, 0 },
+ { "FLR", 30, 1 },
+ { "SW_CIM", 29, 1 },
+ { "UART", 28, 1 },
+ { "ULP_TX", 27, 1 },
+ { "SGE", 26, 1 },
+ { "HMA", 25, 1 },
+ { "CPL_SWITCH", 24, 1 },
+ { "ULP_RX", 23, 1 },
+ { "PM_RX", 22, 1 },
+ { "PM_TX", 21, 1 },
+ { "MA", 20, 1 },
+ { "TP", 19, 1 },
+ { "LE", 18, 1 },
+ { "EDC1", 17, 1 },
+ { "EDC0", 16, 1 },
+ { "MC", 15, 1 },
+ { "PCIE", 14, 1 },
+ { "PMU", 13, 1 },
+ { "XGMAC_KR1", 12, 1 },
+ { "XGMAC_KR0", 11, 1 },
+ { "XGMAC1", 10, 1 },
+ { "XGMAC0", 9, 1 },
+ { "SMB", 8, 1 },
+ { "SF", 7, 1 },
+ { "PL", 6, 1 },
+ { "NCSI", 5, 1 },
+ { "MPS", 4, 1 },
+ { "MI", 3, 1 },
+ { "DBG", 2, 1 },
+ { "I2CM", 1, 1 },
+ { "CIM", 0, 1 },
+ { "PL_INT_MAP0", 0x19414, 0 },
+ { "MapNCSI", 16, 9 },
+ { "MapDefault", 0, 9 },
+ { "PL_INT_MAP1", 0x19418, 0 },
+ { "MapXGMAC1", 16, 9 },
+ { "MapXGMAC0", 0, 9 },
+ { "PL_INT_MAP2", 0x1941c, 0 },
+ { "MapXGMAC_KR1", 16, 9 },
+ { "MapXGMAC_KR0", 0, 9 },
+ { "PL_INT_MAP3", 0x19420, 0 },
+ { "MapMI", 16, 9 },
+ { "MapSMB", 0, 9 },
+ { "PL_INT_MAP4", 0x19424, 0 },
+ { "MapDBG", 16, 9 },
+ { "MapI2CM", 0, 9 },
+ { "PL_RST", 0x19428, 0 },
+ { "FatalPerrEn", 3, 1 },
+ { "SWIntCIM", 2, 1 },
+ { "PIORst", 1, 1 },
+ { "PIORstMode", 0, 1 },
+ { "PL_PL_PERR_INJECT", 0x1942c, 0 },
+ { "MemSel", 1, 1 },
+ { "InjectDataErr", 0, 1 },
+ { "PL_PL_INT_CAUSE", 0x19430, 0 },
+ { "PF_EnableErr", 5, 1 },
+ { "FatalPerr", 4, 1 },
+ { "InvalidAccess", 3, 1 },
+ { "Timeout", 2, 1 },
+ { "PLErr", 1, 1 },
+ { "PerrVFID", 0, 1 },
+ { "PL_PL_INT_ENABLE", 0x19434, 0 },
+ { "PF_EnableErr", 5, 1 },
+ { "FatalPerr", 4, 1 },
+ { "InvalidAccess", 3, 1 },
+ { "Timeout", 2, 1 },
+ { "PLErr", 1, 1 },
+ { "PerrVFID", 0, 1 },
+ { "PL_PL_PERR_ENABLE", 0x19438, 0 },
+ { "PL_REV", 0x1943c, 0 },
+ { "PL_SEMAPHORE_CTL", 0x1944c, 0 },
+ { "LockStatus", 16, 8 },
+ { "OwnerOverride", 8, 1 },
+ { "EnablePF", 0, 8 },
+ { "PL_SEMAPHORE_LOCK", 0x19450, 0 },
+ { "Lock", 31, 1 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+ { "PL_SEMAPHORE_LOCK", 0x19454, 0 },
+ { "Lock", 31, 1 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+ { "PL_SEMAPHORE_LOCK", 0x19458, 0 },
+ { "Lock", 31, 1 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+ { "PL_SEMAPHORE_LOCK", 0x1945c, 0 },
+ { "Lock", 31, 1 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+ { "PL_SEMAPHORE_LOCK", 0x19460, 0 },
+ { "Lock", 31, 1 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+ { "PL_SEMAPHORE_LOCK", 0x19464, 0 },
+ { "Lock", 31, 1 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+ { "PL_SEMAPHORE_LOCK", 0x19468, 0 },
+ { "Lock", 31, 1 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+ { "PL_SEMAPHORE_LOCK", 0x1946c, 0 },
+ { "Lock", 31, 1 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+ { "PL_PF_ENABLE", 0x19470, 0 },
+ { "PL_PORTX_MAP", 0x19474, 0 },
+ { "MAP7", 28, 3 },
+ { "MAP6", 24, 3 },
+ { "MAP5", 20, 3 },
+ { "MAP4", 16, 3 },
+ { "MAP3", 12, 3 },
+ { "MAP2", 8, 3 },
+ { "MAP1", 4, 3 },
+ { "MAP0", 0, 3 },
+ { "PL_VF_SLICE_L", 0x19490, 0 },
+ { "LimitAddr", 16, 10 },
+ { "BaseAddr", 0, 10 },
+ { "PL_VF_SLICE_L", 0x19498, 0 },
+ { "LimitAddr", 16, 10 },
+ { "BaseAddr", 0, 10 },
+ { "PL_VF_SLICE_L", 0x194a0, 0 },
+ { "LimitAddr", 16, 10 },
+ { "BaseAddr", 0, 10 },
+ { "PL_VF_SLICE_L", 0x194a8, 0 },
+ { "LimitAddr", 16, 10 },
+ { "BaseAddr", 0, 10 },
+ { "PL_VF_SLICE_L", 0x194b0, 0 },
+ { "LimitAddr", 16, 10 },
+ { "BaseAddr", 0, 10 },
+ { "PL_VF_SLICE_L", 0x194b8, 0 },
+ { "LimitAddr", 16, 10 },
+ { "BaseAddr", 0, 10 },
+ { "PL_VF_SLICE_L", 0x194c0, 0 },
+ { "LimitAddr", 16, 10 },
+ { "BaseAddr", 0, 10 },
+ { "PL_VF_SLICE_L", 0x194c8, 0 },
+ { "LimitAddr", 16, 10 },
+ { "BaseAddr", 0, 10 },
+ { "PL_VF_SLICE_H", 0x19494, 0 },
+ { "ModIndx", 16, 3 },
+ { "ModOffset", 0, 10 },
+ { "PL_VF_SLICE_H", 0x1949c, 0 },
+ { "ModIndx", 16, 3 },
+ { "ModOffset", 0, 10 },
+ { "PL_VF_SLICE_H", 0x194a4, 0 },
+ { "ModIndx", 16, 3 },
+ { "ModOffset", 0, 10 },
+ { "PL_VF_SLICE_H", 0x194ac, 0 },
+ { "ModIndx", 16, 3 },
+ { "ModOffset", 0, 10 },
+ { "PL_VF_SLICE_H", 0x194b4, 0 },
+ { "ModIndx", 16, 3 },
+ { "ModOffset", 0, 10 },
+ { "PL_VF_SLICE_H", 0x194bc, 0 },
+ { "ModIndx", 16, 3 },
+ { "ModOffset", 0, 10 },
+ { "PL_VF_SLICE_H", 0x194c4, 0 },
+ { "ModIndx", 16, 3 },
+ { "ModOffset", 0, 10 },
+ { "PL_VF_SLICE_H", 0x194cc, 0 },
+ { "ModIndx", 16, 3 },
+ { "ModOffset", 0, 10 },
+ { "PL_FLR_VF_STATUS", 0x194d0, 0 },
+ { "PL_FLR_VF_STATUS", 0x194d4, 0 },
+ { "PL_FLR_VF_STATUS", 0x194d8, 0 },
+ { "PL_FLR_VF_STATUS", 0x194dc, 0 },
+ { "PL_FLR_PF_STATUS", 0x194e0, 0 },
+ { "PL_TIMEOUT_CTL", 0x194f0, 0 },
+ { "PL_TIMEOUT_STATUS0", 0x194f4, 0 },
+ { "Addr", 2, 28 },
+ { "PL_TIMEOUT_STATUS1", 0x194f8, 0 },
+ { "Valid", 31, 1 },
+ { "Write", 22, 1 },
+ { "Bus", 20, 2 },
+ { "Rgn", 19, 1 },
+ { "PF", 16, 3 },
+ { "Function", 0, 16 },
+ { "PL_VFID_MAP", 0x19800, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19804, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19808, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1980c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19810, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19814, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19818, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1981c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19820, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19824, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19828, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1982c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19830, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19834, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19838, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1983c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19840, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19844, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19848, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1984c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19850, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19854, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19858, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1985c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19860, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19864, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19868, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1986c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19870, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19874, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19878, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1987c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19880, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19884, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19888, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1988c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19890, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19894, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19898, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1989c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198a0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198a4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198a8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198ac, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198b0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198b4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198b8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198bc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198c0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198c4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198c8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198cc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198d0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198d4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198d8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198dc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198e0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198e4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198e8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198ec, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198f0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198f4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198f8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x198fc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19900, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19904, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19908, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1990c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19910, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19914, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19918, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1991c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19920, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19924, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19928, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1992c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19930, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19934, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19938, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1993c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19940, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19944, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19948, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1994c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19950, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19954, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19958, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1995c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19960, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19964, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19968, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1996c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19970, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19974, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19978, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1997c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19980, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19984, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19988, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1998c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19990, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19994, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19998, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x1999c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199a0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199a4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199a8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199ac, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199b0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199b4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199b8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199bc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199c0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199c4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199c8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199cc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199d0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199d4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199d8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199dc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199e0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199e4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199e8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199ec, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199f0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199f4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199f8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x199fc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a00, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a04, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a08, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a0c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a10, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a14, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a18, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a1c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a20, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a24, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a28, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a2c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a30, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a34, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a38, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a3c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a40, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a44, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a48, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a4c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a50, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a54, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a58, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a5c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a60, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a64, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a68, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a6c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a70, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a74, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a78, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a7c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a80, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a84, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a88, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a8c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a90, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a94, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a98, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19a9c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19aa0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19aa4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19aa8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19aac, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ab0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ab4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ab8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19abc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ac0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ac4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ac8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19acc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ad0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ad4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ad8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19adc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ae0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ae4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ae8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19aec, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19af0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19af4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19af8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19afc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b00, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b04, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b08, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b0c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b10, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b14, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b18, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b1c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b20, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b24, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b28, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b2c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b30, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b34, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b38, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b3c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b40, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b44, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b48, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b4c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b50, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b54, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b58, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b5c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b60, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b64, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b68, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b6c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b70, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b74, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b78, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b7c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b80, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b84, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b88, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b8c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b90, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b94, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b98, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19b9c, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ba0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ba4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19ba8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bac, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bb0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bb4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bb8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bbc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bc0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bc4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bc8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bcc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bd0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bd4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bd8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bdc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19be0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19be4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19be8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bec, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bf0, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bf4, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bf8, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { "PL_VFID_MAP", 0x19bfc, 0 },
+ { "Valid", 7, 1 },
+ { "VFID", 0, 7 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_le_regs[] = {
+ { "LE_BUF_CONFIG", 0x19c00, 0 },
+ { "LE_DB_CONFIG", 0x19c04, 0 },
+ { "TCAMCMDOVLAPEN", 21, 1 },
+ { "HASHEN", 20, 1 },
+ { "ASBOTHSRCHEN", 18, 1 },
+ { "ASLIPCOMPEN", 17, 1 },
+ { "BUILD", 16, 1 },
+ { "FilterEn", 11, 1 },
+ { "SYNMode", 7, 2 },
+ { "LEBUSEN", 5, 1 },
+ { "ELOOKDUMEN", 4, 1 },
+ { "IPv4ONLYEN", 3, 1 },
+ { "MOSTCMDOEN", 2, 1 },
+ { "DELACTSYNOEN", 1, 1 },
+ { "CMDOVERLAPDIS", 0, 1 },
+ { "LE_MISC", 0x19c08, 0 },
+ { "LE_DB_ROUTING_TABLE_INDEX", 0x19c10, 0 },
+ { "RTINDX", 7, 6 },
+ { "LE_DB_FILTER_TABLE_INDEX", 0x19c14, 0 },
+ { "FTINDX", 7, 6 },
+ { "LE_DB_SERVER_INDEX", 0x19c18, 0 },
+ { "SRINDX", 7, 6 },
+ { "LE_DB_CLIP_TABLE_INDEX", 0x19c1c, 0 },
+ { "CLIPTINDX", 7, 6 },
+ { "LE_DB_ACT_CNT_IPV4", 0x19c20, 0 },
+ { "LE_DB_ACT_CNT_IPV6", 0x19c24, 0 },
+ { "LE_DB_HASH_CONFIG", 0x19c28, 0 },
+ { "HASHTIDSIZE", 16, 6 },
+ { "HASHSIZE", 0, 6 },
+ { "LE_DB_HASH_TABLE_BASE", 0x19c2c, 0 },
+ { "LE_DB_HASH_TID_BASE", 0x19c30, 0 },
+ { "LE_DB_SIZE", 0x19c34, 0 },
+ { "LE_DB_INT_ENABLE", 0x19c38, 0 },
+ { "MsgSel", 27, 5 },
+ { "ReqQParErr", 16, 1 },
+ { "UnknownCmd", 15, 1 },
+ { "DropFilterHit", 13, 1 },
+ { "FilterHit", 12, 1 },
+ { "SYNCookieOff", 11, 1 },
+ { "SYNCookieBad", 10, 1 },
+ { "SYNCookie", 9, 1 },
+ { "NFASrchFail", 8, 1 },
+ { "ActRgnFull", 7, 1 },
+ { "ParityErr", 6, 1 },
+ { "LIPMiss", 5, 1 },
+ { "LIP0", 4, 1 },
+ { "Miss", 3, 1 },
+ { "RoutingHit", 2, 1 },
+ { "ActiveHit", 1, 1 },
+ { "ServerHit", 0, 1 },
+ { "LE_DB_INT_CAUSE", 0x19c3c, 0 },
+ { "ReqQParErr", 16, 1 },
+ { "UnknownCmd", 15, 1 },
+ { "DropFilterHit", 13, 1 },
+ { "FilterHit", 12, 1 },
+ { "SYNCookieOff", 11, 1 },
+ { "SYNCookieBad", 10, 1 },
+ { "SYNCookie", 9, 1 },
+ { "NFASrchFail", 8, 1 },
+ { "ActRgnFull", 7, 1 },
+ { "ParityErr", 6, 1 },
+ { "LIPMiss", 5, 1 },
+ { "LIP0", 4, 1 },
+ { "Miss", 3, 1 },
+ { "RoutingHit", 2, 1 },
+ { "ActiveHit", 1, 1 },
+ { "ServerHit", 0, 1 },
+ { "LE_DB_INT_TID", 0x19c40, 0 },
+ { "LE_DB_INT_PTID", 0x19c44, 0 },
+ { "LE_DB_INT_INDEX", 0x19c48, 0 },
+ { "LE_DB_INT_CMD", 0x19c4c, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c50, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c54, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c58, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c5c, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c60, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c64, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c68, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c6c, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c70, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c74, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c78, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c7c, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c80, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c84, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c88, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c8c, 0 },
+ { "LE_DB_MASK_IPV4", 0x19c90, 0 },
+ { "LE_DB_MASK_IPV6", 0x19ca0, 0 },
+ { "LE_DB_MASK_IPV6", 0x19ca4, 0 },
+ { "LE_DB_MASK_IPV6", 0x19ca8, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cac, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cb0, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cb4, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cb8, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cbc, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cc0, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cc4, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cc8, 0 },
+ { "LE_DB_MASK_IPV6", 0x19ccc, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cd0, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cd4, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cd8, 0 },
+ { "LE_DB_MASK_IPV6", 0x19cdc, 0 },
+ { "LE_DB_MASK_IPV6", 0x19ce0, 0 },
+ { "LE_DB_REQ_RSP_CNT", 0x19ce4, 0 },
+ { "RspCnt", 16, 16 },
+ { "ReqCnt", 0, 16 },
+ { "LE_DB_DBGI_CONFIG", 0x19cf0, 0 },
+ { "DBGICMDPERR", 31, 1 },
+ { "DBGICMDRANGE", 22, 3 },
+ { "DBGICMDMSKTYPE", 21, 1 },
+ { "DBGICMDSEARCH", 20, 1 },
+ { "DBGICMDREAD", 19, 1 },
+ { "DBGICMDLEARN", 18, 1 },
+ { "DBGICMDERASE", 17, 1 },
+ { "DBGICMDIPv6", 16, 1 },
+ { "DBGICMDTYPE", 13, 3 },
+ { "DBGICMDACKERR", 12, 1 },
+ { "DBGICMDBUSY", 3, 1 },
+ { "DBGICMDSTRT", 2, 1 },
+ { "DBGICMDMODE", 0, 2 },
+ { "LE_DB_DBGI_REQ_TCAM_CMD", 0x19cf4, 0 },
+ { "DBGICMD", 20, 4 },
+ { "DBGITINDEX", 0, 20 },
+ { "LE_PERR_ENABLE", 0x19cf8, 0 },
+ { "ReqQueue", 1, 1 },
+ { "TCAM", 0, 1 },
+ { "LE_SPARE", 0x19cfc, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d00, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d04, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d08, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d0c, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d10, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d14, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d18, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d1c, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d20, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d24, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d28, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d2c, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d30, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d34, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d38, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d3c, 0 },
+ { "LE_DB_DBGI_REQ_DATA", 0x19d40, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d50, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d54, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d58, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d5c, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d60, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d64, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d68, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d6c, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d70, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d74, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d78, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d7c, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d80, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d84, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d88, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d8c, 0 },
+ { "LE_DB_DBGI_REQ_MASK", 0x19d90, 0 },
+ { "LE_DB_DBGI_RSP_STATUS", 0x19d94, 0 },
+ { "DBGIRspIndex", 12, 20 },
+ { "DBGIRspMsg", 8, 4 },
+ { "DBGIRspMsgVld", 7, 1 },
+ { "DBGIRspMHit", 2, 1 },
+ { "DBGIRspHit", 1, 1 },
+ { "DBGIRspValid", 0, 1 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19da0, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19da4, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19da8, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dac, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19db0, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19db4, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19db8, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dbc, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dc0, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dc4, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dc8, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dcc, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dd0, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dd4, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19dd8, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19ddc, 0 },
+ { "LE_DB_DBGI_RSP_DATA", 0x19de0, 0 },
+ { "LE_DB_DBGI_RSP_LAST_CMD", 0x19de4, 0 },
+ { "LastCmdB", 16, 11 },
+ { "LastCmdA", 0, 11 },
+ { "LE_DB_DROP_FILTER_ENTRY", 0x19de8, 0 },
+ { "DropFilterEn", 31, 1 },
+ { "DropFilterClear", 17, 1 },
+ { "DropFilterSet", 16, 1 },
+ { "DropFilterFIDX", 0, 13 },
+ { "LE_DB_PTID_SVRBASE", 0x19df0, 0 },
+ { "SVRBASE_ADDR", 2, 18 },
+ { "LE_DB_FTID_FLTRBASE", 0x19df4, 0 },
+ { "FLTRBASE_ADDR", 2, 18 },
+ { "LE_DB_TID_HASHBASE", 0x19df8, 0 },
+ { "HASHBASE_ADDR", 2, 20 },
+ { "LE_PERR_INJECT", 0x19dfc, 0 },
+ { "MemSel", 1, 3 },
+ { "InjectDataErr", 0, 1 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e00, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e04, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e08, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e0c, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e10, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e14, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e18, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e1c, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e20, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e24, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e28, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e2c, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e30, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e34, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e38, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e3c, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV4", 0x19e40, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e50, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e54, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e58, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e5c, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e60, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e64, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e68, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e6c, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e70, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e74, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e78, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e7c, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e80, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e84, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e88, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e8c, 0 },
+ { "LE_DB_ACTIVE_MASK_IPV6", 0x19e90, 0 },
+ { "LE_HASH_MASK_GEN_IPV4", 0x19ea0, 0 },
+ { "LE_HASH_MASK_GEN_IPV4", 0x19ea4, 0 },
+ { "LE_HASH_MASK_GEN_IPV4", 0x19ea8, 0 },
+ { "LE_HASH_MASK_GEN_IPV4", 0x19eac, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19eb0, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19eb4, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19eb8, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19ebc, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19ec0, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19ec4, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19ec8, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19ecc, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19ed0, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19ed4, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19ed8, 0 },
+ { "LE_HASH_MASK_GEN_IPV6", 0x19edc, 0 },
+ { "LE_HASH_MASK_CMP_IPV4", 0x19ee0, 0 },
+ { "LE_HASH_MASK_CMP_IPV4", 0x19ee4, 0 },
+ { "LE_HASH_MASK_CMP_IPV4", 0x19ee8, 0 },
+ { "LE_HASH_MASK_CMP_IPV4", 0x19eec, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19ef0, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19ef4, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19ef8, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19efc, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19f00, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19f04, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19f08, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19f0c, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19f10, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19f14, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19f18, 0 },
+ { "LE_HASH_MASK_CMP_IPV6", 0x19f1c, 0 },
+ { "LE_DEBUG_LA_CONFIG", 0x19f20, 0 },
+ { "LE_REQ_DEBUG_LA_DATA", 0x19f24, 0 },
+ { "LE_REQ_DEBUG_LA_WRPTR", 0x19f28, 0 },
+ { "LE_RSP_DEBUG_LA_DATA", 0x19f2c, 0 },
+ { "LE_RSP_DEBUG_LA_WRPTR", 0x19f30, 0 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_ncsi_regs[] = {
+ { "NCSI_PORT_CFGREG", 0x1a000, 0 },
+ { "WireEn", 28, 4 },
+ { "strp_crc", 24, 4 },
+ { "rx_halt", 22, 1 },
+ { "flush_rx_fifo", 21, 1 },
+ { "hw_arb_en", 20, 1 },
+ { "soft_pkg_sel", 19, 1 },
+ { "err_discard_en", 18, 1 },
+ { "max_pkt_size", 4, 14 },
+ { "rx_byte_swap", 3, 1 },
+ { "tx_byte_swap", 2, 1 },
+ { "NCSI_RST_CTRL", 0x1a004, 0 },
+ { "mac_ref_rst", 2, 1 },
+ { "mac_rx_rst", 1, 1 },
+ { "mac_tx_rst", 0, 1 },
+ { "NCSI_CH0_SADDR_LOW", 0x1a010, 0 },
+ { "NCSI_CH0_SADDR_HIGH", 0x1a014, 0 },
+ { "CHO_SADDR_EN", 31, 1 },
+ { "CH0_SADDR_HIGH", 0, 16 },
+ { "NCSI_CH1_SADDR_LOW", 0x1a018, 0 },
+ { "NCSI_CH1_SADDR_HIGH", 0x1a01c, 0 },
+ { "CH1_SADDR_EN", 31, 1 },
+ { "CH1_SADDR_HIGH", 0, 16 },
+ { "NCSI_CH2_SADDR_LOW", 0x1a020, 0 },
+ { "NCSI_CH2_SADDR_HIGH", 0x1a024, 0 },
+ { "CH2_SADDR_EN", 31, 1 },
+ { "CH2_SADDR_HIGH", 0, 16 },
+ { "NCSI_CH3_SADDR_LOW", 0x1a028, 0 },
+ { "NCSI_CH3_SADDR_HIGH", 0x1a02c, 0 },
+ { "CH3_SADDR_EN", 31, 1 },
+ { "CH3_SADDR_HIGH", 0, 16 },
+ { "NCSI_WORK_REQHDR_0", 0x1a030, 0 },
+ { "NCSI_WORK_REQHDR_1", 0x1a034, 0 },
+ { "NCSI_WORK_REQHDR_2", 0x1a038, 0 },
+ { "NCSI_WORK_REQHDR_3", 0x1a03c, 0 },
+ { "NCSI_MPS_HDR_LO", 0x1a040, 0 },
+ { "NCSI_MPS_HDR_HI", 0x1a044, 0 },
+ { "NCSI_CTL", 0x1a048, 0 },
+ { "STRIP_OVLAN", 3, 1 },
+ { "bmc_drop_non_bc", 2, 1 },
+ { "bmc_rx_fwd_all", 1, 1 },
+ { "FWD_BMC", 0, 1 },
+ { "NCSI_NCSI_ETYPE", 0x1a04c, 0 },
+ { "NCSI_RX_FIFO_CNT", 0x1a050, 0 },
+ { "NCSI_RX_ERR_CNT", 0x1a054, 0 },
+ { "NCSI_RX_OF_CNT", 0x1a058, 0 },
+ { "NCSI_RX_MS_CNT", 0x1a05c, 0 },
+ { "NCSI_RX_IE_CNT", 0x1a060, 0 },
+ { "NCSI_MPS_DEMUX_CNT", 0x1a064, 0 },
+ { "MPS2CIM_CNT", 16, 9 },
+ { "MPS2BMC_CNT", 0, 9 },
+ { "NCSI_CIM_DEMUX_CNT", 0x1a068, 0 },
+ { "CIM2MPS_CNT", 16, 9 },
+ { "CIM2BMC_CNT", 0, 9 },
+ { "NCSI_TX_FIFO_CNT", 0x1a06c, 0 },
+ { "NCSI_SE_CNT_CTL", 0x1a0b0, 0 },
+ { "NCSI_SE_CNT_MPS", 0x1a0b4, 0 },
+ { "NC2MPS_SOP_CNT", 24, 8 },
+ { "NC2MPS_EOP_CNT", 16, 6 },
+ { "MPS2NC_SOP_CNT", 8, 8 },
+ { "MPS2NC_EOP_CNT", 0, 8 },
+ { "NCSI_SE_CNT_CIM", 0x1a0b8, 0 },
+ { "NC2CIM_SOP_CNT", 24, 8 },
+ { "NC2CIM_EOP_CNT", 16, 6 },
+ { "CIM2NC_SOP_CNT", 8, 8 },
+ { "CIM2NC_EOP_CNT", 0, 8 },
+ { "NCSI_BUS_DEBUG", 0x1a0bc, 0 },
+ { "SOP_CNT_ERR", 12, 4 },
+ { "BUS_STATE_MPS_OUT", 6, 2 },
+ { "BUS_STATE_MPS_IN", 4, 2 },
+ { "BUS_STATE_CIM_OUT", 2, 2 },
+ { "BUS_STATE_CIM_IN", 0, 2 },
+ { "NCSI_LA_RDPTR", 0x1a0c0, 0 },
+ { "NCSI_LA_RDDATA", 0x1a0c4, 0 },
+ { "NCSI_LA_WRPTR", 0x1a0c8, 0 },
+ { "NCSI_LA_RESERVED", 0x1a0cc, 0 },
+ { "NCSI_LA_CTL", 0x1a0d0, 0 },
+ { "NCSI_INT_ENABLE", 0x1a0d4, 0 },
+ { "CIM_DM_prty_err", 8, 1 },
+ { "MPS_DM_prty_err", 7, 1 },
+ { "token", 6, 1 },
+ { "arb_done", 5, 1 },
+ { "arb_started", 4, 1 },
+ { "WOL", 3, 1 },
+ { "MACInt", 2, 1 },
+ { "TXFIFO_prty_err", 1, 1 },
+ { "RXFIFO_prty_err", 0, 1 },
+ { "NCSI_INT_CAUSE", 0x1a0d8, 0 },
+ { "CIM_DM_prty_err", 8, 1 },
+ { "MPS_DM_prty_err", 7, 1 },
+ { "token", 6, 1 },
+ { "arb_done", 5, 1 },
+ { "arb_started", 4, 1 },
+ { "WOL", 3, 1 },
+ { "MACInt", 2, 1 },
+ { "TXFIFO_prty_err", 1, 1 },
+ { "RXFIFO_prty_err", 0, 1 },
+ { "NCSI_STATUS", 0x1a0dc, 0 },
+ { "Master", 1, 1 },
+ { "arb_status", 0, 1 },
+ { "NCSI_PAUSE_CTRL", 0x1a0e0, 0 },
+ { "NCSI_PAUSE_TIMEOUT", 0x1a0e4, 0 },
+ { "NCSI_PAUSE_WM", 0x1a0ec, 0 },
+ { "PauseHWM", 16, 11 },
+ { "PauseLWM", 0, 11 },
+ { "NCSI_DEBUG", 0x1a0f0, 0 },
+ { "NCSI_PERR_INJECT", 0x1a0f4, 0 },
+ { "MemSel", 1, 1 },
+ { "InjectDataErr", 0, 1 },
+ { "NCSI_MACB_NETWORK_CTRL", 0x1a100, 0 },
+ { "TxSndZeroPause", 12, 1 },
+ { "TxSndPause", 11, 1 },
+ { "TxStop", 10, 1 },
+ { "TxStart", 9, 1 },
+ { "BackPress", 8, 1 },
+ { "StatWrEn", 7, 1 },
+ { "IncrStat", 6, 1 },
+ { "ClearStat", 5, 1 },
+ { "EnMgmtPort", 4, 1 },
+ { "TxEn", 3, 1 },
+ { "RxEn", 2, 1 },
+ { "LoopLocal", 1, 1 },
+ { "LoopPHY", 0, 1 },
+ { "NCSI_MACB_NETWORK_CFG", 0x1a104, 0 },
+ { "PClkDiv128", 22, 1 },
+ { "CopyPause", 21, 1 },
+ { "NonStdPreOK", 20, 1 },
+ { "NoFCS", 19, 1 },
+ { "RxEnHalfDup", 18, 1 },
+ { "NoCopyFCS", 17, 1 },
+ { "LenChkEn", 16, 1 },
+ { "RxBufOffset", 14, 2 },
+ { "PauseEn", 13, 1 },
+ { "RetryTest", 12, 1 },
+ { "PClkDiv", 10, 2 },
+ { "ExtClass", 9, 1 },
+ { "En1536Frame", 8, 1 },
+ { "UCastHashEn", 7, 1 },
+ { "MCastHashEn", 6, 1 },
+ { "RxBCastDis", 5, 1 },
+ { "CopyAllFrames", 4, 1 },
+ { "JumboEn", 3, 1 },
+ { "SerEn", 2, 1 },
+ { "FullDuplex", 1, 1 },
+ { "Speed", 0, 1 },
+ { "NCSI_MACB_NETWORK_STATUS", 0x1a108, 0 },
+ { "PHYMgmtStatus", 2, 1 },
+ { "MDIStatus", 1, 1 },
+ { "LinkStatus", 0, 1 },
+ { "NCSI_MACB_TX_STATUS", 0x1a114, 0 },
+ { "UnderrunErr", 6, 1 },
+ { "TxComplete", 5, 1 },
+ { "BufferExhausted", 4, 1 },
+ { "TxProgress", 3, 1 },
+ { "RetryLimit", 2, 1 },
+ { "ColEvent", 1, 1 },
+ { "UsedBitRead", 0, 1 },
+ { "NCSI_MACB_RX_BUF_QPTR", 0x1a118, 0 },
+ { "RxBufQPtr", 2, 30 },
+ { "NCSI_MACB_TX_BUF_QPTR", 0x1a11c, 0 },
+ { "TxBufQPtr", 2, 30 },
+ { "NCSI_MACB_RX_STATUS", 0x1a120, 0 },
+ { "RxOverrunErr", 2, 1 },
+ { "FrameRcvd", 1, 1 },
+ { "NoRxBuf", 0, 1 },
+ { "NCSI_MACB_INT_STATUS", 0x1a124, 0 },
+ { "PauseTimeZero", 13, 1 },
+ { "PauseRcvd", 12, 1 },
+ { "HRespNotOK", 11, 1 },
+ { "RxOverrun", 10, 1 },
+ { "LinkChange", 9, 1 },
+ { "TxComplete", 7, 1 },
+ { "TxBufErr", 6, 1 },
+ { "RetryLimitErr", 5, 1 },
+ { "TxBufUnderrun", 4, 1 },
+ { "TxUsedBitRead", 3, 1 },
+ { "RxUsedBitRead", 2, 1 },
+ { "RxComplete", 1, 1 },
+ { "MgmtFrameSent", 0, 1 },
+ { "NCSI_MACB_INT_EN", 0x1a128, 0 },
+ { "PauseTimeZero", 13, 1 },
+ { "PauseRcvd", 12, 1 },
+ { "HRespNotOK", 11, 1 },
+ { "RxOverrun", 10, 1 },
+ { "LinkChange", 9, 1 },
+ { "TxComplete", 7, 1 },
+ { "TxBufErr", 6, 1 },
+ { "RetryLimitErr", 5, 1 },
+ { "TxBufUnderrun", 4, 1 },
+ { "TxUsedBitRead", 3, 1 },
+ { "RxUsedBitRead", 2, 1 },
+ { "RxComplete", 1, 1 },
+ { "MgmtFrameSent", 0, 1 },
+ { "NCSI_MACB_INT_DIS", 0x1a12c, 0 },
+ { "PauseTimeZero", 13, 1 },
+ { "PauseRcvd", 12, 1 },
+ { "HRespNotOK", 11, 1 },
+ { "RxOverrun", 10, 1 },
+ { "LinkChange", 9, 1 },
+ { "TxComplete", 7, 1 },
+ { "TxBufErr", 6, 1 },
+ { "RetryLimitErr", 5, 1 },
+ { "TxBufUnderrun", 4, 1 },
+ { "TxUsedBitRead", 3, 1 },
+ { "RxUsedBitRead", 2, 1 },
+ { "RxComplete", 1, 1 },
+ { "MgmtFrameSent", 0, 1 },
+ { "NCSI_MACB_INT_MASK", 0x1a130, 0 },
+ { "PauseTimeZero", 13, 1 },
+ { "PauseRcvd", 12, 1 },
+ { "HRespNotOK", 11, 1 },
+ { "RxOverrun", 10, 1 },
+ { "LinkChange", 9, 1 },
+ { "TxComplete", 7, 1 },
+ { "TxBufErr", 6, 1 },
+ { "RetryLimitErr", 5, 1 },
+ { "TxBufUnderrun", 4, 1 },
+ { "TxUsedBitRead", 3, 1 },
+ { "RxUsedBitRead", 2, 1 },
+ { "RxComplete", 1, 1 },
+ { "MgmtFrameSent", 0, 1 },
+ { "NCSI_MACB_PAUSE_TIME", 0x1a138, 0 },
+ { "NCSI_MACB_PAUSE_FRAMES_RCVD", 0x1a13c, 0 },
+ { "NCSI_MACB_TX_FRAMES_OK", 0x1a140, 0 },
+ { "NCSI_MACB_SINGLE_COL_FRAMES", 0x1a144, 0 },
+ { "NCSI_MACB_MUL_COL_FRAMES", 0x1a148, 0 },
+ { "NCSI_MACB_RX_FRAMES_OK", 0x1a14c, 0 },
+ { "NCSI_MACB_FCS_ERR", 0x1a150, 0 },
+ { "NCSI_MACB_ALIGN_ERR", 0x1a154, 0 },
+ { "NCSI_MACB_DEF_TX_FRAMES", 0x1a158, 0 },
+ { "NCSI_MACB_LATE_COL", 0x1a15c, 0 },
+ { "NCSI_MACB_EXCESSIVE_COL", 0x1a160, 0 },
+ { "NCSI_MACB_TX_UNDERRUN_ERR", 0x1a164, 0 },
+ { "NCSI_MACB_CARRIER_SENSE_ERR", 0x1a168, 0 },
+ { "NCSI_MACB_RX_RESOURCE_ERR", 0x1a16c, 0 },
+ { "NCSI_MACB_RX_OVERRUN_ERR", 0x1a170, 0 },
+ { "NCSI_MACB_RX_SYMBOL_ERR", 0x1a174, 0 },
+ { "NCSI_MACB_RX_OVERSIZE_FRAME", 0x1a178, 0 },
+ { "NCSI_MACB_RX_JABBER_ERR", 0x1a17c, 0 },
+ { "NCSI_MACB_RX_UNDERSIZE_FRAME", 0x1a180, 0 },
+ { "NCSI_MACB_SQE_TEST_ERR", 0x1a184, 0 },
+ { "NCSI_MACB_LENGTH_ERR", 0x1a188, 0 },
+ { "NCSI_MACB_TX_PAUSE_FRAMES", 0x1a18c, 0 },
+ { "NCSI_MACB_HASH_LOW", 0x1a190, 0 },
+ { "NCSI_MACB_HASH_HIGH", 0x1a194, 0 },
+ { "NCSI_MACB_SPECIFIC_1_LOW", 0x1a198, 0 },
+ { "NCSI_MACB_SPECIFIC_1_HIGH", 0x1a19c, 0 },
+ { "NCSI_MACB_SPECIFIC_2_LOW", 0x1a1a0, 0 },
+ { "NCSI_MACB_SPECIFIC_2_HIGH", 0x1a1a4, 0 },
+ { "NCSI_MACB_SPECIFIC_3_LOW", 0x1a1a8, 0 },
+ { "NCSI_MACB_SPECIFIC_3_HIGH", 0x1a1ac, 0 },
+ { "NCSI_MACB_SPECIFIC_4_LOW", 0x1a1b0, 0 },
+ { "NCSI_MACB_SPECIFIC_4_HIGH", 0x1a1b4, 0 },
+ { "NCSI_MACB_TYPE_ID", 0x1a1b8, 0 },
+ { "NCSI_MACB_TX_PAUSE_QUANTUM", 0x1a1bc, 0 },
+ { "NCSI_MACB_USER_IO", 0x1a1c0, 0 },
+ { "UserProgInput", 16, 16 },
+ { "UserProgOutput", 0, 16 },
+ { "NCSI_MACB_WOL_CFG", 0x1a1c4, 0 },
+ { "MCHashEn", 19, 1 },
+ { "Specific1En", 18, 1 },
+ { "ARPEn", 17, 1 },
+ { "MagicPktEn", 16, 1 },
+ { "ARPIPAddr", 0, 16 },
+ { "NCSI_MACB_REV_STATUS", 0x1a1fc, 0 },
+ { "PartRef", 16, 16 },
+ { "DesRev", 0, 16 },
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4_xgmac_regs[] = {
+ { "XGMAC_PORT_CFG", 0x21000, 0 },
+ { "XGMII_Clk_Sel", 29, 3 },
+ { "SinkTx", 27, 1 },
+ { "SinkTxOnLinkDown", 26, 1 },
+ { "xg2g_speed_mode", 25, 1 },
+ { "LoopNoFwd", 24, 1 },
+ { "XGM_Tx_pause_size", 23, 1 },
+ { "XGM_Tx_pause_frame", 22, 1 },
+ { "XGM_Tx_Disable_Pre", 21, 1 },
+ { "XGM_Tx_Disable_Crc", 20, 1 },
+ { "Smux_Rx_Loop", 19, 1 },
+ { "Rx_Lane_Swap", 18, 1 },
+ { "Tx_Lane_Swap", 17, 1 },
+ { "Signal_Det", 14, 1 },
+ { "Pmux_Rx_Loop", 13, 1 },
+ { "Pmux_Tx_Loop", 12, 1 },
+ { "XGM_Rx_Sel", 10, 2 },
+ { "PCS_Tx_Sel", 8, 2 },
+ { "XAUI20_Rem_Pre", 5, 1 },
+ { "XAUI20_XGMII_Sel", 4, 1 },
+ { "Rx_Byte_Swap", 3, 1 },
+ { "Tx_Byte_Swap", 2, 1 },
+ { "Port_Sel", 0, 1 },
+ { "XGMAC_PORT_RESET_CTRL", 0x21004, 0 },
+ { "AuxExt_Reset", 10, 1 },
+ { "TXFIFO_Reset", 9, 1 },
+ { "RXFIFO_Reset", 8, 1 },
+ { "BEAN_Reset", 7, 1 },
+ { "XAUI_Reset", 6, 1 },
+ { "AE_Reset", 5, 1 },
+ { "XGM_Reset", 4, 1 },
+ { "XG2G_Reset", 3, 1 },
+ { "WOL_Reset", 2, 1 },
+ { "XFI_PCS_Reset", 1, 1 },
+ { "HSS_Reset", 0, 1 },
+ { "XGMAC_PORT_LED_CFG", 0x21008, 0 },
+ { "Led1_Cfg", 5, 3 },
+ { "Led1_Polarity_Inv", 4, 1 },
+ { "Led0_Cfg", 1, 3 },
+ { "Led0_Polarity_Inv", 0, 1 },
+ { "XGMAC_PORT_LED_COUNTHI", 0x2100c, 0 },
+ { "XGMAC_PORT_LED_COUNTLO", 0x21010, 0 },
+ { "XGMAC_PORT_DEBUG_CFG", 0x21014, 0 },
+ { "XGMAC_PORT_CFG2", 0x21018, 0 },
+ { "Rx_Polarity_Inv", 28, 4 },
+ { "Tx_Polarity_Inv", 24, 4 },
+ { "InstanceNum", 22, 2 },
+ { "StopOnPerr", 21, 1 },
+ { "MACTxEn", 20, 1 },
+ { "MACRxEn", 19, 1 },
+ { "PatEn", 18, 1 },
+ { "MagicEn", 17, 1 },
+ { "TX_IPG", 4, 13 },
+ { "AEC_PMA_TX_READY", 1, 1 },
+ { "AEC_PMA_RX_READY", 0, 1 },
+ { "XGMAC_PORT_PKT_COUNT", 0x2101c, 0 },
+ { "tx_sop_count", 24, 8 },
+ { "tx_eop_count", 16, 8 },
+ { "rx_sop_count", 8, 8 },
+ { "rx_eop_count", 0, 8 },
+ { "XGMAC_PORT_PERR_INJECT", 0x21020, 0 },
+ { "MemSel", 1, 1 },
+ { "InjectDataErr", 0, 1 },
+ { "XGMAC_PORT_MAGIC_MACID_LO", 0x21024, 0 },
+ { "XGMAC_PORT_MAGIC_MACID_HI", 0x21028, 0 },
+ { "XGMAC_PORT_BUILD_REVISION", 0x2102c, 0 },
+ { "XGMAC_PORT_XGMII_SE_COUNT", 0x21030, 0 },
+ { "TxSop", 24, 8 },
+ { "TxEop", 16, 8 },
+ { "RxSop", 8, 8 },
+ { "RxEop", 0, 8 },
+ { "XGMAC_PORT_LINK_STATUS", 0x21034, 0 },
+ { "remflt", 3, 1 },
+ { "locflt", 2, 1 },
+ { "linkup", 1, 1 },
+ { "linkdn", 0, 1 },
+ { "XGMAC_PORT_CHECKIN", 0x21038, 0 },
+ { "Preamble", 1, 1 },
+ { "CheckIn", 0, 1 },
+ { "XGMAC_PORT_FAULT_TEST", 0x2103c, 0 },
+ { "FltType", 1, 1 },
+ { "FltCtrl", 0, 1 },
+ { "XGMAC_PORT_SPARE", 0x21040, 0 },
+ { "XGMAC_PORT_HSS_SIGDET_STATUS", 0x21044, 0 },
+ { "XGMAC_PORT_EXT_LOS_STATUS", 0x21048, 0 },
+ { "XGMAC_PORT_EXT_LOS_CTRL", 0x2104c, 0 },
+ { "XGMAC_PORT_FPGA_PAUSE_CTL", 0x21050, 0 },
+ { "CTL", 31, 1 },
+ { "HWM", 13, 13 },
+ { "LWM", 0, 13 },
+ { "XGMAC_PORT_FPGA_ERRPKT_CNT", 0x21054, 0 },
+ { "XGMAC_PORT_LA_TX_0", 0x21058, 0 },
+ { "XGMAC_PORT_LA_RX_0", 0x2105c, 0 },
+ { "XGMAC_PORT_FPGA_LA_CTL", 0x21060, 0 },
+ { "rxrst", 5, 1 },
+ { "txrst", 4, 1 },
+ { "xgmii", 3, 1 },
+ { "pause", 2, 1 },
+ { "stopErr", 1, 1 },
+ { "stop", 0, 1 },
+ { "XGMAC_PORT_EPIO_DATA0", 0x210c0, 0 },
+ { "XGMAC_PORT_EPIO_DATA1", 0x210c4, 0 },
+ { "XGMAC_PORT_EPIO_DATA2", 0x210c8, 0 },
+ { "XGMAC_PORT_EPIO_DATA3", 0x210cc, 0 },
+ { "XGMAC_PORT_EPIO_OP", 0x210d0, 0 },
+ { "Busy", 31, 1 },
+ { "Write", 8, 1 },
+ { "Address", 0, 8 },
+ { "XGMAC_PORT_WOL_STATUS", 0x210d4, 0 },
+ { "MagicDetected", 31, 1 },
+ { "PatDetected", 30, 1 },
+ { "ClearMagic", 4, 1 },
+ { "ClearMatch", 3, 1 },
+ { "MatchedFilter", 0, 3 },
+ { "XGMAC_PORT_INT_EN", 0x210d8, 0 },
+ { "ext_los", 28, 1 },
+ { "incmptbl_link", 27, 1 },
+ { "PatDetWake", 26, 1 },
+ { "MagicWake", 25, 1 },
+ { "SigDetChg", 24, 1 },
+ { "PCSR_fec_corr", 23, 1 },
+ { "AE_Train_Local", 22, 1 },
+ { "HSSPLL_LOCK", 21, 1 },
+ { "HSSPRT_READY", 20, 1 },
+ { "AutoNeg_Done", 19, 1 },
+ { "PCSR_Hi_BER", 18, 1 },
+ { "PCSR_FEC_Error", 17, 1 },
+ { "PCSR_Link_Fail", 16, 1 },
+ { "XAUI_Dec_Error", 15, 1 },
+ { "XAUI_Link_Fail", 14, 1 },
+ { "PCS_CTC_Error", 13, 1 },
+ { "PCS_Link_Good", 12, 1 },
+ { "PCS_Link_Fail", 11, 1 },
+ { "RxFifoOverFlow", 10, 1 },
+ { "HSSPRBSErr", 9, 1 },
+ { "HSSEyeQual", 8, 1 },
+ { "RemoteFault", 7, 1 },
+ { "LocalFault", 6, 1 },
+ { "MAC_Link_Down", 5, 1 },
+ { "MAC_Link_Up", 4, 1 },
+ { "BEAN_Int", 3, 1 },
+ { "XGM_Int", 2, 1 },
+ { "TxFifo_prty_err", 1, 1 },
+ { "RxFifo_prty_err", 0, 1 },
+ { "XGMAC_PORT_INT_CAUSE", 0x210dc, 0 },
+ { "ext_los", 28, 1 },
+ { "incmptbl_link", 27, 1 },
+ { "PatDetWake", 26, 1 },
+ { "MagicWake", 25, 1 },
+ { "SigDetChg", 24, 1 },
+ { "PCSR_fec_corr", 23, 1 },
+ { "AE_Train_Local", 22, 1 },
+ { "HSSPLL_LOCK", 21, 1 },
+ { "HSSPRT_READY", 20, 1 },
+ { "AutoNeg_Done", 19, 1 },
+ { "PCSR_Hi_BER", 18, 1 },
+ { "PCSR_FEC_Error", 17, 1 },
+ { "PCSR_Link_Fail", 16, 1 },
+ { "XAUI_Dec_Error", 15, 1 },
+ { "XAUI_Link_Fail", 14, 1 },
+ { "PCS_CTC_Error", 13, 1 },
+ { "PCS_Link_Good", 12, 1 },
+ { "PCS_Link_Fail", 11, 1 },
+ { "RxFifoOverFlow", 10, 1 },
+ { "HSSPRBSErr", 9, 1 },
+ { "HSSEyeQual", 8, 1 },
+ { "RemoteFault", 7, 1 },
+ { "LocalFault", 6, 1 },
+ { "MAC_Link_Down", 5, 1 },
+ { "MAC_Link_Up", 4, 1 },
+ { "BEAN_Int", 3, 1 },
+ { "XGM_Int", 2, 1 },
+ { "TxFifo_prty_err", 1, 1 },
+ { "RxFifo_prty_err", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG0", 0x210e0, 0 },
+ { "TXDTS", 31, 1 },
+ { "TXCTS", 30, 1 },
+ { "TXBTS", 29, 1 },
+ { "TXATS", 28, 1 },
+ { "TXDOBS", 27, 1 },
+ { "TXCOBS", 26, 1 },
+ { "TXBOBS", 25, 1 },
+ { "TXAOBS", 24, 1 },
+ { "HSSREFCLKSEL", 20, 1 },
+ { "HSSAVDHI", 17, 1 },
+ { "HSSRXTS", 16, 1 },
+ { "HSSTXACMODE", 15, 1 },
+ { "HSSRXACMODE", 14, 1 },
+ { "HSSRESYNC", 13, 1 },
+ { "HSSRECCAL", 12, 1 },
+ { "HSSPDWNPLL", 11, 1 },
+ { "HSSDIVSEL", 9, 2 },
+ { "HSSREFDIV", 8, 1 },
+ { "HSSPLLBYP", 7, 1 },
+ { "HSSLOFREQPLL", 6, 1 },
+ { "HSSLOFREQ2PLL", 5, 1 },
+ { "HSSEXTC16SEL", 4, 1 },
+ { "HSSRSTCONFIG", 1, 3 },
+ { "HSSPRBSEN", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG1", 0x210e4, 0 },
+ { "RXDPRBSRST", 28, 1 },
+ { "RXDPRBSEN", 27, 1 },
+ { "RXDPRBSFRCERR", 26, 1 },
+ { "TXDPRBSRST", 25, 1 },
+ { "TXDPRBSEN", 24, 1 },
+ { "RXCPRBSRST", 20, 1 },
+ { "RXCPRBSEN", 19, 1 },
+ { "RXCPRBSFRCERR", 18, 1 },
+ { "TXCPRBSRST", 17, 1 },
+ { "TXCPRBSEN", 16, 1 },
+ { "RXBPRBSRST", 12, 1 },
+ { "RXBPRBSEN", 11, 1 },
+ { "RXBPRBSFRCERR", 10, 1 },
+ { "TXBPRBSRST", 9, 1 },
+ { "TXBPRBSEN", 8, 1 },
+ { "RXAPRBSRST", 4, 1 },
+ { "RXAPRBSEN", 3, 1 },
+ { "RXAPRBSFRCERR", 2, 1 },
+ { "TXAPRBSRST", 1, 1 },
+ { "TXAPRBSEN", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG2", 0x210e8, 0 },
+ { "RXDDATASYNC", 23, 1 },
+ { "RXCDATASYNC", 22, 1 },
+ { "RXBDATASYNC", 21, 1 },
+ { "RXADATASYNC", 20, 1 },
+ { "RXDEARLYIN", 19, 1 },
+ { "RXDLATEIN", 18, 1 },
+ { "RXDPHSLOCK", 17, 1 },
+ { "RXDPHSDNIN", 16, 1 },
+ { "RXDPHSUPIN", 15, 1 },
+ { "RXCEARLYIN", 14, 1 },
+ { "RXCLATEIN", 13, 1 },
+ { "RXCPHSLOCK", 12, 1 },
+ { "RXCPHSDNIN", 11, 1 },
+ { "RXCPHSUPIN", 10, 1 },
+ { "RXBEARLYIN", 9, 1 },
+ { "RXBLATEIN", 8, 1 },
+ { "RXBPHSLOCK", 7, 1 },
+ { "RXBPHSDNIN", 6, 1 },
+ { "RXBPHSUPIN", 5, 1 },
+ { "RXAEARLYIN", 4, 1 },
+ { "RXALATEIN", 3, 1 },
+ { "RXAPHSLOCK", 2, 1 },
+ { "RXAPHSDNIN", 1, 1 },
+ { "RXAPHSUPIN", 0, 1 },
+ { "XGMAC_PORT_HSS_STATUS", 0x210ec, 0 },
+ { "RXDPRBSSYNC", 15, 1 },
+ { "RXCPRBSSYNC", 14, 1 },
+ { "RXBPRBSSYNC", 13, 1 },
+ { "RXAPRBSSYNC", 12, 1 },
+ { "RXDPRBSERR", 11, 1 },
+ { "RXCPRBSERR", 10, 1 },
+ { "RXBPRBSERR", 9, 1 },
+ { "RXAPRBSERR", 8, 1 },
+ { "RXDSIGDET", 7, 1 },
+ { "RXCSIGDET", 6, 1 },
+ { "RXBSIGDET", 5, 1 },
+ { "RXASIGDET", 4, 1 },
+ { "HSSPLLLOCK", 1, 1 },
+ { "HSSPRTREADY", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_CTRL", 0x21200, 0 },
+ { "SendPause", 2, 1 },
+ { "SendZeroPause", 1, 1 },
+ { "TxEn", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_CFG", 0x21204, 0 },
+ { "CRCCal", 8, 2 },
+ { "DisDefIdleCnt", 7, 1 },
+ { "DecAvgTxIPG", 6, 1 },
+ { "UnidirTxEn", 5, 1 },
+ { "CfgClkSpeed", 2, 3 },
+ { "StretchMode", 1, 1 },
+ { "TxPauseEn", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_PAUSE_QUANTA", 0x21208, 0 },
+ { "XGMAC_PORT_XGM_RX_CTRL", 0x2120c, 0 },
+ { "XGMAC_PORT_XGM_RX_CFG", 0x21210, 0 },
+ { "CRCCal", 16, 2 },
+ { "LocalFault", 15, 1 },
+ { "RemoteFault", 14, 1 },
+ { "LenErrFrameDis", 13, 1 },
+ { "Con802_3Preamble", 12, 1 },
+ { "EnNon802_3Preamble", 11, 1 },
+ { "CopyPreamble", 10, 1 },
+ { "DisPauseFrames", 9, 1 },
+ { "En1536BFrames", 8, 1 },
+ { "EnJumbo", 7, 1 },
+ { "RmFCS", 6, 1 },
+ { "DisNonVlan", 5, 1 },
+ { "EnExtMatch", 4, 1 },
+ { "EnHashUcast", 3, 1 },
+ { "EnHashMcast", 2, 1 },
+ { "DisBCast", 1, 1 },
+ { "CopyAllFrames", 0, 1 },
+ { "XGMAC_PORT_XGM_RX_HASH_LOW", 0x21214, 0 },
+ { "XGMAC_PORT_XGM_RX_HASH_HIGH", 0x21218, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_1", 0x2121c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_1", 0x21220, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_2", 0x21224, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_2", 0x21228, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_3", 0x2122c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_3", 0x21230, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_4", 0x21234, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_4", 0x21238, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_5", 0x2123c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_5", 0x21240, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_6", 0x21244, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_6", 0x21248, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_7", 0x2124c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_7", 0x21250, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_8", 0x21254, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_8", 0x21258, 0 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_1", 0x2125c, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_2", 0x21260, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_3", 0x21264, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_4", 0x21268, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_INT_STATUS", 0x2126c, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_MASK", 0x21270, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_EN", 0x21274, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_DISABLE", 0x21278, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_PAUSE_TIMER", 0x2127c, 0 },
+ { "XGMAC_PORT_XGM_STAT_CTRL", 0x21280, 0 },
+ { "ReadSnpShot", 4, 1 },
+ { "TakeSnpShot", 3, 1 },
+ { "ClrStats", 2, 1 },
+ { "IncrStats", 1, 1 },
+ { "EnTestModeWr", 0, 1 },
+ { "XGMAC_PORT_XGM_MDIO_CTRL", 0x21284, 0 },
+ { "FrameType", 30, 2 },
+ { "Operation", 28, 2 },
+ { "PortAddr", 23, 5 },
+ { "DevAddr", 18, 5 },
+ { "Resrv", 16, 2 },
+ { "Data", 0, 16 },
+ { "XGMAC_PORT_XGM_MODULE_ID", 0x212fc, 0 },
+ { "ModuleID", 16, 16 },
+ { "ModuleRev", 0, 16 },
+ { "XGMAC_PORT_XGM_STAT_TX_BYTE_LOW", 0x21300, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_BYTE_HIGH", 0x21304, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_FRAME_LOW", 0x21308, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_FRAME_HIGH", 0x2130c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_BCAST", 0x21310, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_MCAST", 0x21314, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_PAUSE", 0x21318, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_64B_FRAMES", 0x2131c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_65_127B_FRAMES", 0x21320, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_128_255B_FRAMES", 0x21324, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_256_511B_FRAMES", 0x21328, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_512_1023B_FRAMES", 0x2132c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_1024_1518B_FRAMES", 0x21330, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_1519_MAXB_FRAMES", 0x21334, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_ERR_FRAMES", 0x21338, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BYTES_LOW", 0x2133c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BYTES_HIGH", 0x21340, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_FRAMES_LOW", 0x21344, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_FRAMES_HIGH", 0x21348, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BCAST_FRAMES", 0x2134c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_MCAST_FRAMES", 0x21350, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_PAUSE_FRAMES", 0x21354, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_64B_FRAMES", 0x21358, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_65_127B_FRAMES", 0x2135c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_128_255B_FRAMES", 0x21360, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_256_511B_FRAMES", 0x21364, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_512_1023B_FRAMES", 0x21368, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_1024_1518B_FRAMES", 0x2136c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_1519_MAXB_FRAMES", 0x21370, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_SHORT_FRAMES", 0x21374, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_OVERSIZE_FRAMES", 0x21378, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_JABBER_FRAMES", 0x2137c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_CRC_ERR_FRAMES", 0x21380, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_LENGTH_ERR_FRAMES", 0x21384, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_SYM_CODE_ERR_FRAMES", 0x21388, 0 },
+ { "XGMAC_PORT_XAUI_CTRL", 0x21400, 0 },
+ { "polarity_inv_rx", 8, 4 },
+ { "polarity_inv_tx", 4, 4 },
+ { "test_sel", 2, 2 },
+ { "test_en", 0, 1 },
+ { "XGMAC_PORT_XAUI_STATUS", 0x21404, 0 },
+ { "Decode_Error", 12, 8 },
+ { "Lane3_CTC_Status", 11, 1 },
+ { "Lane2_CTC_Status", 10, 1 },
+ { "Lane1_CTC_Status", 9, 1 },
+ { "Lane0_CTC_Status", 8, 1 },
+ { "Align_Status", 4, 1 },
+ { "Lane3_Sync_Status", 3, 1 },
+ { "Lane2_Sync_Status", 2, 1 },
+ { "Lane1_Sync_Status", 1, 1 },
+ { "Lane0_Sync_Status", 0, 1 },
+ { "XGMAC_PORT_PCSR_CTRL", 0x21500, 0 },
+ { "rx_clk_speed", 7, 1 },
+ { "ScrBypass", 6, 1 },
+ { "FECErrIndEn", 5, 1 },
+ { "FECEn", 4, 1 },
+ { "TestSel", 2, 2 },
+ { "ScrLoopEn", 1, 1 },
+ { "XGMIILoopEn", 0, 1 },
+ { "XGMAC_PORT_PCSR_TXTEST_CTRL", 0x21510, 0 },
+ { "tx_prbs9_en", 4, 1 },
+ { "tx_prbs31_en", 3, 1 },
+ { "tx_tst_dat_sel", 2, 1 },
+ { "tx_tst_sel", 1, 1 },
+ { "tx_tst_en", 0, 1 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDA_LOWER", 0x21514, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDA_UPPER", 0x21518, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDB_LOWER", 0x2152c, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDB_UPPER", 0x21530, 0 },
+ { "XGMAC_PORT_PCSR_RXTEST_CTRL", 0x2153c, 0 },
+ { "tpter_cnt_rst", 7, 1 },
+ { "test_cnt_125us", 6, 1 },
+ { "test_cnt_pre", 5, 1 },
+ { "ber_cnt_rst", 4, 1 },
+ { "err_blk_cnt_rst", 3, 1 },
+ { "rx_prbs31_en", 2, 1 },
+ { "rx_tst_dat_sel", 1, 1 },
+ { "rx_tst_en", 0, 1 },
+ { "XGMAC_PORT_PCSR_STATUS", 0x21550, 0 },
+ { "err_blk_cnt", 16, 8 },
+ { "ber_count", 8, 6 },
+ { "hi_ber", 2, 1 },
+ { "rx_fault", 1, 1 },
+ { "tx_fault", 0, 1 },
+ { "XGMAC_PORT_PCSR_TEST_STATUS", 0x21554, 0 },
+ { "XGMAC_PORT_AN_CONTROL", 0x21600, 0 },
+ { "soft_reset", 15, 1 },
+ { "an_enable", 12, 1 },
+ { "restart_an", 9, 1 },
+ { "XGMAC_PORT_AN_STATUS", 0x21604, 0 },
+ { "Noncer_Match", 31, 1 },
+ { "Parallel_Det_Fault", 9, 1 },
+ { "Page_Received", 6, 1 },
+ { "AN_Complete", 5, 1 },
+ { "Remote_Fault", 4, 1 },
+ { "AN_Ability", 3, 1 },
+ { "link_status", 2, 1 },
+ { "partner_an_ability", 0, 1 },
+ { "XGMAC_PORT_AN_ADVERTISEMENT", 0x21608, 0 },
+ { "FEC_Enable", 31, 1 },
+ { "FEC_Ability", 30, 1 },
+ { "10GBASE_KR_Capable", 23, 1 },
+ { "10GBASE_KX4_Capable", 22, 1 },
+ { "1000BASE_KX_Capable", 21, 1 },
+ { "Transmitted_Nonce", 16, 5 },
+ { "NP", 15, 1 },
+ { "ACK", 14, 1 },
+ { "Remote_Fault", 13, 1 },
+ { "ASM_DIR", 11, 1 },
+ { "Pause", 10, 1 },
+ { "Echoed_Nonce", 5, 5 },
+ { "XGMAC_PORT_AN_LINK_PARTNER_ABILITY", 0x2160c, 0 },
+ { "FEC_Enable", 31, 1 },
+ { "FEC_Ability", 30, 1 },
+ { "10GBASE_KR_Capable", 23, 1 },
+ { "10GBASE_KX4_Capable", 22, 1 },
+ { "1000BASE_KX_Capable", 21, 1 },
+ { "Transmitted_Nonce", 16, 5 },
+ { "NP", 15, 1 },
+ { "ACK", 14, 1 },
+ { "Remote_Fault", 13, 1 },
+ { "ASM_DIR", 11, 1 },
+ { "Pause", 10, 1 },
+ { "Echoed_Nonce", 5, 5 },
+ { "Selector_Field", 0, 5 },
+ { "XGMAC_PORT_AN_NP_LOWER_TRANSMIT", 0x21610, 0 },
+ { "NP_Info", 16, 16 },
+ { "NP_Indication", 15, 1 },
+ { "Message_Page", 13, 1 },
+ { "ACK_2", 12, 1 },
+ { "Toggle", 11, 1 },
+ { "XGMAC_PORT_AN_NP_UPPER_TRANSMIT", 0x21614, 0 },
+ { "XGMAC_PORT_AN_LP_NP_LOWER", 0x21618, 0 },
+ { "XGMAC_PORT_AN_LP_NP_UPPER", 0x2161c, 0 },
+ { "XGMAC_PORT_AN_BACKPLANE_ETHERNET_STATUS", 0x21624, 0 },
+ { "TX_Pause_Okay", 6, 1 },
+ { "RX_Pause_Okay", 5, 1 },
+ { "10GBASE_KR_FEC_neg", 4, 1 },
+ { "10GBASE_KR_neg", 3, 1 },
+ { "10GBASE_KX4_neg", 2, 1 },
+ { "1000BASE_KX_neg", 1, 1 },
+ { "BP_AN_Ability", 0, 1 },
+ { "XGMAC_PORT_AN_TX_NONCE_CONTROL", 0x21628, 0 },
+ { "Bypass_LFSR", 15, 1 },
+ { "LFSR_Init", 0, 15 },
+ { "XGMAC_PORT_AN_INTERRUPT_STATUS", 0x2162c, 0 },
+ { "NP_From_LP", 3, 1 },
+ { "Parallel_Det_Fault", 2, 1 },
+ { "BP_From_LP", 1, 1 },
+ { "PCS_AN_Complete", 0, 1 },
+ { "XGMAC_PORT_AN_GENERIC_TIMER_TIMEOUT", 0x21630, 0 },
+ { "XGMAC_PORT_AN_BREAK_LINK_TIMEOUT", 0x21634, 0 },
+ { "XGMAC_PORT_AN_MODULE_ID", 0x2163c, 0 },
+ { "Module_ID", 16, 16 },
+ { "Module_Revision", 0, 16 },
+ { "XGMAC_PORT_AE_RX_COEF_REQ", 0x21700, 0 },
+ { "RXREQ_CPRE", 13, 1 },
+ { "RXREQ_CINIT", 12, 1 },
+ { "RXREQ_C0", 4, 2 },
+ { "RXREQ_C1", 2, 2 },
+ { "RXREQ_C2", 0, 2 },
+ { "XGMAC_PORT_AE_RX_COEF_STAT", 0x21704, 0 },
+ { "RXSTAT_RDY", 15, 1 },
+ { "RXSTAT_C0", 4, 2 },
+ { "RXSTAT_C1", 2, 2 },
+ { "RXSTAT_C2", 0, 2 },
+ { "XGMAC_PORT_AE_TX_COEF_REQ", 0x21708, 0 },
+ { "TXREQ_CPRE", 13, 1 },
+ { "TXREQ_CINIT", 12, 1 },
+ { "TXREQ_C0", 4, 2 },
+ { "TXREQ_C1", 2, 2 },
+ { "TXREQ_C2", 0, 2 },
+ { "XGMAC_PORT_AE_TX_COEF_STAT", 0x2170c, 0 },
+ { "TXSTAT_RDY", 15, 1 },
+ { "TXSTAT_C0", 4, 2 },
+ { "TXSTAT_C1", 2, 2 },
+ { "TXSTAT_C2", 0, 2 },
+ { "XGMAC_PORT_AE_REG_MODE", 0x21710, 0 },
+ { "MAN_DEC", 4, 2 },
+ { "MANUAL_RDY", 3, 1 },
+ { "MWT_DISABLE", 2, 1 },
+ { "MDIO_OVR", 1, 1 },
+ { "STICKY_MODE", 0, 1 },
+ { "XGMAC_PORT_AE_PRBS_CTL", 0x21714, 0 },
+ { "PRBS_CHK_ERRCNT", 8, 8 },
+ { "PRBS_SYNCCNT", 5, 3 },
+ { "PRBS_CHK_SYNC", 4, 1 },
+ { "PRBS_CHK_RST", 3, 1 },
+ { "PRBS_CHK_OFF", 2, 1 },
+ { "PRBS_GEN_FRCERR", 1, 1 },
+ { "PRBS_GEN_OFF", 0, 1 },
+ { "XGMAC_PORT_AE_FSM_CTL", 0x21718, 0 },
+ { "FSM_TR_LCL", 14, 1 },
+ { "FSM_GDMRK", 11, 3 },
+ { "FSM_BADMRK", 8, 3 },
+ { "FSM_TR_FAIL", 7, 1 },
+ { "FSM_TR_ACT", 6, 1 },
+ { "FSM_FRM_LCK", 5, 1 },
+ { "FSM_TR_COMP", 4, 1 },
+ { "MC_RX_RDY", 3, 1 },
+ { "FSM_CU_DIS", 2, 1 },
+ { "FSM_TR_RST", 1, 1 },
+ { "FSM_TR_EN", 0, 1 },
+ { "XGMAC_PORT_AE_FSM_STATE", 0x2171c, 0 },
+ { "CC2FSM_STATE", 13, 3 },
+ { "CC1FSM_STATE", 10, 3 },
+ { "CC0FSM_STATE", 7, 3 },
+ { "FLFSM_STATE", 4, 3 },
+ { "TFSM_STATE", 0, 3 },
+ { "XGMAC_PORT_AE_TX_DIS", 0x21780, 0 },
+ { "XGMAC_PORT_AE_KR_CTRL", 0x21784, 0 },
+ { "Training_Enable", 1, 1 },
+ { "Restart_Training", 0, 1 },
+ { "XGMAC_PORT_AE_RX_SIGDET", 0x21788, 0 },
+ { "XGMAC_PORT_AE_KR_STATUS", 0x2178c, 0 },
+ { "Training_Failure", 3, 1 },
+ { "Training", 2, 1 },
+ { "Frame_Lock", 1, 1 },
+ { "RX_Trained", 0, 1 },
+ { "XGMAC_PORT_HSS_TXA_MODE_CFG", 0x21800, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TEST_CTRL", 0x21804, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXA_COEFF_CTRL", 0x21808, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXA_DRIVER_MODE", 0x2180c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_DRIVER_OVR_CTRL", 0x21810, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TDM_BIASGEN_STANDBY_TIMER", 0x21814, 0 },
+ { "XGMAC_PORT_HSS_TXA_TDM_BIASGEN_PWRON_TIMER", 0x21818, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_COEFF", 0x21820, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_COEFF", 0x21824, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_COEFF", 0x21828, 0 },
+ { "XGMAC_PORT_HSS_TXA_PWR", 0x21830, 0 },
+ { "XGMAC_PORT_HSS_TXA_POLARITY", 0x21834, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXA_8023AP_AE_CMD", 0x21838, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_8023AP_AE_STATUS", 0x2183c, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_IDAC_OVR", 0x21840, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_IDAC_OVR", 0x21844, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_IDAC_OVR", 0x21848, 0 },
+ { "XGMAC_PORT_HSS_TXA_PWR_DAC_OVR", 0x21850, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXA_PWR_DAC", 0x21854, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_IDAC_APP", 0x21860, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_IDAC_APP", 0x21864, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_IDAC_APP", 0x21868, 0 },
+ { "XGMAC_PORT_HSS_TXA_SEG_DIS_APP", 0x21870, 0 },
+ { "XGMAC_PORT_HSS_TXA_EXT_ADDR_DATA", 0x21878, 0 },
+ { "XGMAC_PORT_HSS_TXA_EXT_ADDR", 0x2187c, 0 },
+ { "XADDR", 1, 5 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_TXB_MODE_CFG", 0x21880, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TEST_CTRL", 0x21884, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXB_COEFF_CTRL", 0x21888, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXB_DRIVER_MODE", 0x2188c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_DRIVER_OVR_CTRL", 0x21890, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TDM_BIASGEN_STANDBY_TIMER", 0x21894, 0 },
+ { "XGMAC_PORT_HSS_TXB_TDM_BIASGEN_PWRON_TIMER", 0x21898, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_COEFF", 0x218a0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_COEFF", 0x218a4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_COEFF", 0x218a8, 0 },
+ { "XGMAC_PORT_HSS_TXB_PWR", 0x218b0, 0 },
+ { "XGMAC_PORT_HSS_TXB_POLARITY", 0x218b4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXB_8023AP_AE_CMD", 0x218b8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_8023AP_AE_STATUS", 0x218bc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_IDAC_OVR", 0x218c0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_IDAC_OVR", 0x218c4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_IDAC_OVR", 0x218c8, 0 },
+ { "XGMAC_PORT_HSS_TXB_PWR_DAC_OVR", 0x218d0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXB_PWR_DAC", 0x218d4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_IDAC_APP", 0x218e0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_IDAC_APP", 0x218e4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_IDAC_APP", 0x218e8, 0 },
+ { "XGMAC_PORT_HSS_TXB_SEG_DIS_APP", 0x218f0, 0 },
+ { "XGMAC_PORT_HSS_TXB_EXT_ADDR_DATA", 0x218f8, 0 },
+ { "XGMAC_PORT_HSS_TXB_EXT_ADDR", 0x218fc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_CFG_MODE", 0x21900, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXA_TEST_CTRL", 0x21904, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_CTRL", 0x21908, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_OFFSET_CTRL", 0x2190c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_POSITION1", 0x21910, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_POSITION2", 0x21914, 0 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_STATIC_PH_OFFSET", 0x21918, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_SIGDET_CTRL", 0x2191c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_CTRL", 0x21920, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_DATA_EDGE_SAMPLE", 0x21924, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_DFE_AMP_SAMPLE", 0x21928, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL1", 0x2192c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL2", 0x21930, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL3", 0x21934, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXA_DFE_D00_D01_OFFSET", 0x21938, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_D10_D11_OFFSET", 0x2193c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_E0_E1_OFFSET", 0x21940, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DACA_OFFSET", 0x21944, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_DACAP_DAC_AN_OFFSET", 0x21948, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_DACA_MIN", 0x2194c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_ADAC_CTRL", 0x21950, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXA_DIGITAL_EYE_CTRL", 0x21954, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DIGITAL_EYE_METRICS", 0x21958, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H1", 0x2195c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H2", 0x21960, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H3", 0x21964, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H4", 0x21968, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H5", 0x2196c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DAC_DPC", 0x21970, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DDC", 0x21974, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_INTERNAL_STATUS", 0x21978, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_FUNC_CTRL", 0x2197c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_CFG_MODE", 0x21980, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXB_TEST_CTRL", 0x21984, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_CTRL", 0x21988, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_OFFSET_CTRL", 0x2198c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_POSITION1", 0x21990, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_POSITION2", 0x21994, 0 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_STATIC_PH_OFFSET", 0x21998, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_SIGDET_CTRL", 0x2199c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_CTRL", 0x219a0, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_DATA_EDGE_SAMPLE", 0x219a4, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_DFE_AMP_SAMPLE", 0x219a8, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL1", 0x219ac, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL2", 0x219b0, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL3", 0x219b4, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXB_DFE_D00_D01_OFFSET", 0x219b8, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_D10_D11_OFFSET", 0x219bc, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_E0_E1_OFFSET", 0x219c0, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DACA_OFFSET", 0x219c4, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_DACAP_DAC_AN_OFFSET", 0x219c8, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_DACA_MIN", 0x219cc, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_ADAC_CTRL", 0x219d0, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXB_DIGITAL_EYE_CTRL", 0x219d4, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DIGITAL_EYE_METRICS", 0x219d8, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H1", 0x219dc, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H2", 0x219e0, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H3", 0x219e4, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H4", 0x219e8, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H5", 0x219ec, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DAC_DPC", 0x219f0, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DDC", 0x219f4, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_INTERNAL_STATUS", 0x219f8, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_FUNC_CTRL", 0x219fc, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_TXC_MODE_CFG", 0x21a00, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TEST_CTRL", 0x21a04, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXC_COEFF_CTRL", 0x21a08, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXC_DRIVER_MODE", 0x21a0c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_DRIVER_OVR_CTRL", 0x21a10, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TDM_BIASGEN_STANDBY_TIMER", 0x21a14, 0 },
+ { "XGMAC_PORT_HSS_TXC_TDM_BIASGEN_PWRON_TIMER", 0x21a18, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_COEFF", 0x21a20, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_COEFF", 0x21a24, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_COEFF", 0x21a28, 0 },
+ { "XGMAC_PORT_HSS_TXC_PWR", 0x21a30, 0 },
+ { "XGMAC_PORT_HSS_TXC_POLARITY", 0x21a34, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXC_8023AP_AE_CMD", 0x21a38, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_8023AP_AE_STATUS", 0x21a3c, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_IDAC_OVR", 0x21a40, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_IDAC_OVR", 0x21a44, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_IDAC_OVR", 0x21a48, 0 },
+ { "XGMAC_PORT_HSS_TXC_PWR_DAC_OVR", 0x21a50, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXC_PWR_DAC", 0x21a54, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_IDAC_APP", 0x21a60, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_IDAC_APP", 0x21a64, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_IDAC_APP", 0x21a68, 0 },
+ { "XGMAC_PORT_HSS_TXC_SEG_DIS_APP", 0x21a70, 0 },
+ { "XGMAC_PORT_HSS_TXC_EXT_ADDR_DATA", 0x21a78, 0 },
+ { "XGMAC_PORT_HSS_TXC_EXT_ADDR", 0x21a7c, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_TXD_MODE_CFG", 0x21a80, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TEST_CTRL", 0x21a84, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXD_COEFF_CTRL", 0x21a88, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXD_DRIVER_MODE", 0x21a8c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_DRIVER_OVR_CTRL", 0x21a90, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TDM_BIASGEN_STANDBY_TIMER", 0x21a94, 0 },
+ { "XGMAC_PORT_HSS_TXD_TDM_BIASGEN_PWRON_TIMER", 0x21a98, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_COEFF", 0x21aa0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_COEFF", 0x21aa4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_COEFF", 0x21aa8, 0 },
+ { "XGMAC_PORT_HSS_TXD_PWR", 0x21ab0, 0 },
+ { "XGMAC_PORT_HSS_TXD_POLARITY", 0x21ab4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXD_8023AP_AE_CMD", 0x21ab8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_8023AP_AE_STATUS", 0x21abc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_IDAC_OVR", 0x21ac0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_IDAC_OVR", 0x21ac4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_IDAC_OVR", 0x21ac8, 0 },
+ { "XGMAC_PORT_HSS_TXD_PWR_DAC_OVR", 0x21ad0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXD_PWR_DAC", 0x21ad4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_IDAC_APP", 0x21ae0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_IDAC_APP", 0x21ae4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_IDAC_APP", 0x21ae8, 0 },
+ { "XGMAC_PORT_HSS_TXD_SEG_DIS_APP", 0x21af0, 0 },
+ { "XGMAC_PORT_HSS_TXD_EXT_ADDR_DATA", 0x21af8, 0 },
+ { "XGMAC_PORT_HSS_TXD_EXT_ADDR", 0x21afc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_CFG_MODE", 0x21b00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXC_TEST_CTRL", 0x21b04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_CTRL", 0x21b08, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_OFFSET_CTRL", 0x21b0c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_POSITION1", 0x21b10, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_POSITION2", 0x21b14, 0 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_STATIC_PH_OFFSET", 0x21b18, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_SIGDET_CTRL", 0x21b1c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_CTRL", 0x21b20, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_DATA_EDGE_SAMPLE", 0x21b24, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_DFE_AMP_SAMPLE", 0x21b28, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL1", 0x21b2c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL2", 0x21b30, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL3", 0x21b34, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXC_DFE_D00_D01_OFFSET", 0x21b38, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_D10_D11_OFFSET", 0x21b3c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_E0_E1_OFFSET", 0x21b40, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DACA_OFFSET", 0x21b44, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_DACAP_DAC_AN_OFFSET", 0x21b48, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_DACA_MIN", 0x21b4c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_ADAC_CTRL", 0x21b50, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXC_DIGITAL_EYE_CTRL", 0x21b54, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DIGITAL_EYE_METRICS", 0x21b58, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H1", 0x21b5c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H2", 0x21b60, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H3", 0x21b64, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H4", 0x21b68, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H5", 0x21b6c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DAC_DPC", 0x21b70, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DDC", 0x21b74, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_INTERNAL_STATUS", 0x21b78, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_FUNC_CTRL", 0x21b7c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_CFG_MODE", 0x21b80, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXD_TEST_CTRL", 0x21b84, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_CTRL", 0x21b88, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_OFFSET_CTRL", 0x21b8c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_POSITION1", 0x21b90, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_POSITION2", 0x21b94, 0 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_STATIC_PH_OFFSET", 0x21b98, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_SIGDET_CTRL", 0x21b9c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_CTRL", 0x21ba0, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_DATA_EDGE_SAMPLE", 0x21ba4, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_DFE_AMP_SAMPLE", 0x21ba8, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL1", 0x21bac, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL2", 0x21bb0, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL3", 0x21bb4, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXD_DFE_D00_D01_OFFSET", 0x21bb8, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_D10_D11_OFFSET", 0x21bbc, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_E0_E1_OFFSET", 0x21bc0, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DACA_OFFSET", 0x21bc4, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_DACAP_DAC_AN_OFFSET", 0x21bc8, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_DACA_MIN", 0x21bcc, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_ADAC_CTRL", 0x21bd0, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXD_DIGITAL_EYE_CTRL", 0x21bd4, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DIGITAL_EYE_METRICS", 0x21bd8, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H1", 0x21bdc, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H2", 0x21be0, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H3", 0x21be4, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H4", 0x21be8, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H5", 0x21bec, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DAC_DPC", 0x21bf0, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DDC", 0x21bf4, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_INTERNAL_STATUS", 0x21bf8, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_FUNC_CTRL", 0x21bfc, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_0", 0x21c00, 0 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_1", 0x21c04, 0 },
+ { "LDET", 4, 1 },
+ { "CCERR", 3, 1 },
+ { "CCCMP", 2, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_2", 0x21c08, 0 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_3", 0x21c0c, 0 },
+ { "VISEL", 4, 1 },
+ { "FMIN", 3, 1 },
+ { "FMAX", 2, 1 },
+ { "CVHOLD", 1, 1 },
+ { "TCDIS", 0, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_4", 0x21c10, 0 },
+ { "CMETH", 2, 1 },
+ { "RECAL", 1, 1 },
+ { "CCLD", 0, 1 },
+ { "XGMAC_PORT_HSS_ANALOG_TEST_MUX", 0x21c14, 0 },
+ { "XGMAC_PORT_HSS_PORT_EN_0", 0x21c18, 0 },
+ { "RXDEN", 7, 1 },
+ { "RXCEN", 6, 1 },
+ { "TXDEN", 5, 1 },
+ { "TXCEN", 4, 1 },
+ { "RXBEN", 3, 1 },
+ { "RXAEN", 2, 1 },
+ { "TXBEN", 1, 1 },
+ { "TXAEN", 0, 1 },
+ { "XGMAC_PORT_HSS_PORT_RESET_0", 0x21c20, 0 },
+ { "RXDRST", 7, 1 },
+ { "RXCRST", 6, 1 },
+ { "TXDRST", 5, 1 },
+ { "TXCRST", 4, 1 },
+ { "RXBRST", 3, 1 },
+ { "RXARST", 2, 1 },
+ { "TXBRST", 1, 1 },
+ { "TXARST", 0, 1 },
+ { "XGMAC_PORT_HSS_CHARGE_PUMP_CTRL", 0x21c28, 0 },
+ { "ENCPIS", 2, 1 },
+ { "CPISEL", 0, 2 },
+ { "XGMAC_PORT_HSS_BAND_GAP_CTRL", 0x21c2c, 0 },
+ { "XGMAC_PORT_HSS_LOFREQ_OVR", 0x21c30, 0 },
+ { "LFREQ2", 3, 1 },
+ { "LFREQ1", 2, 1 },
+ { "LFREQO", 1, 1 },
+ { "LFSEL", 0, 1 },
+ { "XGMAC_PORT_HSS_VOLTAGE_BOOST_CTRL", 0x21c38, 0 },
+ { "PFVAL", 2, 1 },
+ { "PFEN", 1, 1 },
+ { "VBADJ", 0, 1 },
+ { "XGMAC_PORT_HSS_TX_MODE_CFG", 0x21c80, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXTEST_CTRL", 0x21c84, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TX_COEFF_CTRL", 0x21c88, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TX_DRIVER_MODE", 0x21c8c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_DRIVER_OVR_CTRL", 0x21c90, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_TDM_BIASGEN_STANDBY_TIMER", 0x21c94, 0 },
+ { "XGMAC_PORT_HSS_TX_TDM_BIASGEN_PWRON_TIMER", 0x21c98, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP0_COEFF", 0x21ca0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_COEFF", 0x21ca4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_COEFF", 0x21ca8, 0 },
+ { "XGMAC_PORT_HSS_TX_PWR", 0x21cb0, 0 },
+ { "XGMAC_PORT_HSS_TX_POLARITY", 0x21cb4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TX_8023AP_AE_CMD", 0x21cb8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_8023AP_AE_STATUS", 0x21cbc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_TAP0_IDAC_OVR", 0x21cc0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_IDAC_OVR", 0x21cc4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_IDAC_OVR", 0x21cc8, 0 },
+ { "XGMAC_PORT_HSS_TX_PWR_DAC_OVR", 0x21cd0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TX_PWR_DAC", 0x21cd4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP0_IDAC_APP", 0x21ce0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_IDAC_APP", 0x21ce4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_IDAC_APP", 0x21ce8, 0 },
+ { "XGMAC_PORT_HSS_TX_SEG_DIS_APP", 0x21cf0, 0 },
+ { "XGMAC_PORT_HSS_TX_EXT_ADDR_DATA", 0x21cf8, 0 },
+ { "XGMAC_PORT_HSS_TX_EXT_ADDR", 0x21cfc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_CFG_MODE", 0x21d00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXTEST_CTRL", 0x21d04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_CTRL", 0x21d08, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_OFFSET_CTRL", 0x21d0c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_POSITION1", 0x21d10, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_POSITION2", 0x21d14, 0 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_STATIC_PH_OFFSET", 0x21d18, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_SIGDET_CTRL", 0x21d1c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_CTRL", 0x21d20, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_DATA_EDGE_SAMPLE", 0x21d24, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_DFE_AMP_SAMPLE", 0x21d28, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL1", 0x21d2c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL2", 0x21d30, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL3", 0x21d34, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RX_DFE_D00_D01_OFFSET", 0x21d38, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_D10_D11_OFFSET", 0x21d3c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_E0_E1_OFFSET", 0x21d40, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DACA_OFFSET", 0x21d44, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_DACAP_DAC_AN_OFFSET", 0x21d48, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_DACA_MIN", 0x21d4c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_ADAC_CTRL", 0x21d50, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RX_DIGITAL_EYE_CTRL", 0x21d54, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DIGITAL_EYE_METRICS", 0x21d58, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_H1", 0x21d5c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_DFE_H2", 0x21d60, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_H3", 0x21d64, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DFE_H4", 0x21d68, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DFE_H5", 0x21d6c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DAC_DPC", 0x21d70, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DDC", 0x21d74, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_INTERNAL_STATUS", 0x21d78, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_FUNC_CTRL", 0x21d7c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_TXRX_CFG_MODE", 0x21e00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXRXTEST_CTRL", 0x21e04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_CFG", 0x23000, 0 },
+ { "XGMII_Clk_Sel", 29, 3 },
+ { "SinkTx", 27, 1 },
+ { "SinkTxOnLinkDown", 26, 1 },
+ { "xg2g_speed_mode", 25, 1 },
+ { "LoopNoFwd", 24, 1 },
+ { "XGM_Tx_pause_size", 23, 1 },
+ { "XGM_Tx_pause_frame", 22, 1 },
+ { "XGM_Tx_Disable_Pre", 21, 1 },
+ { "XGM_Tx_Disable_Crc", 20, 1 },
+ { "Smux_Rx_Loop", 19, 1 },
+ { "Rx_Lane_Swap", 18, 1 },
+ { "Tx_Lane_Swap", 17, 1 },
+ { "Signal_Det", 14, 1 },
+ { "Pmux_Rx_Loop", 13, 1 },
+ { "Pmux_Tx_Loop", 12, 1 },
+ { "XGM_Rx_Sel", 10, 2 },
+ { "PCS_Tx_Sel", 8, 2 },
+ { "XAUI20_Rem_Pre", 5, 1 },
+ { "XAUI20_XGMII_Sel", 4, 1 },
+ { "Rx_Byte_Swap", 3, 1 },
+ { "Tx_Byte_Swap", 2, 1 },
+ { "Port_Sel", 0, 1 },
+ { "XGMAC_PORT_RESET_CTRL", 0x23004, 0 },
+ { "AuxExt_Reset", 10, 1 },
+ { "TXFIFO_Reset", 9, 1 },
+ { "RXFIFO_Reset", 8, 1 },
+ { "BEAN_Reset", 7, 1 },
+ { "XAUI_Reset", 6, 1 },
+ { "AE_Reset", 5, 1 },
+ { "XGM_Reset", 4, 1 },
+ { "XG2G_Reset", 3, 1 },
+ { "WOL_Reset", 2, 1 },
+ { "XFI_PCS_Reset", 1, 1 },
+ { "HSS_Reset", 0, 1 },
+ { "XGMAC_PORT_LED_CFG", 0x23008, 0 },
+ { "Led1_Cfg", 5, 3 },
+ { "Led1_Polarity_Inv", 4, 1 },
+ { "Led0_Cfg", 1, 3 },
+ { "Led0_Polarity_Inv", 0, 1 },
+ { "XGMAC_PORT_LED_COUNTHI", 0x2300c, 0 },
+ { "XGMAC_PORT_LED_COUNTLO", 0x23010, 0 },
+ { "XGMAC_PORT_DEBUG_CFG", 0x23014, 0 },
+ { "XGMAC_PORT_CFG2", 0x23018, 0 },
+ { "Rx_Polarity_Inv", 28, 4 },
+ { "Tx_Polarity_Inv", 24, 4 },
+ { "InstanceNum", 22, 2 },
+ { "StopOnPerr", 21, 1 },
+ { "MACTxEn", 20, 1 },
+ { "MACRxEn", 19, 1 },
+ { "PatEn", 18, 1 },
+ { "MagicEn", 17, 1 },
+ { "TX_IPG", 4, 13 },
+ { "AEC_PMA_TX_READY", 1, 1 },
+ { "AEC_PMA_RX_READY", 0, 1 },
+ { "XGMAC_PORT_PKT_COUNT", 0x2301c, 0 },
+ { "tx_sop_count", 24, 8 },
+ { "tx_eop_count", 16, 8 },
+ { "rx_sop_count", 8, 8 },
+ { "rx_eop_count", 0, 8 },
+ { "XGMAC_PORT_PERR_INJECT", 0x23020, 0 },
+ { "MemSel", 1, 1 },
+ { "InjectDataErr", 0, 1 },
+ { "XGMAC_PORT_MAGIC_MACID_LO", 0x23024, 0 },
+ { "XGMAC_PORT_MAGIC_MACID_HI", 0x23028, 0 },
+ { "XGMAC_PORT_BUILD_REVISION", 0x2302c, 0 },
+ { "XGMAC_PORT_XGMII_SE_COUNT", 0x23030, 0 },
+ { "TxSop", 24, 8 },
+ { "TxEop", 16, 8 },
+ { "RxSop", 8, 8 },
+ { "RxEop", 0, 8 },
+ { "XGMAC_PORT_LINK_STATUS", 0x23034, 0 },
+ { "remflt", 3, 1 },
+ { "locflt", 2, 1 },
+ { "linkup", 1, 1 },
+ { "linkdn", 0, 1 },
+ { "XGMAC_PORT_CHECKIN", 0x23038, 0 },
+ { "Preamble", 1, 1 },
+ { "CheckIn", 0, 1 },
+ { "XGMAC_PORT_FAULT_TEST", 0x2303c, 0 },
+ { "FltType", 1, 1 },
+ { "FltCtrl", 0, 1 },
+ { "XGMAC_PORT_SPARE", 0x23040, 0 },
+ { "XGMAC_PORT_HSS_SIGDET_STATUS", 0x23044, 0 },
+ { "XGMAC_PORT_EXT_LOS_STATUS", 0x23048, 0 },
+ { "XGMAC_PORT_EXT_LOS_CTRL", 0x2304c, 0 },
+ { "XGMAC_PORT_FPGA_PAUSE_CTL", 0x23050, 0 },
+ { "CTL", 31, 1 },
+ { "HWM", 13, 13 },
+ { "LWM", 0, 13 },
+ { "XGMAC_PORT_FPGA_ERRPKT_CNT", 0x23054, 0 },
+ { "XGMAC_PORT_LA_TX_0", 0x23058, 0 },
+ { "XGMAC_PORT_LA_RX_0", 0x2305c, 0 },
+ { "XGMAC_PORT_FPGA_LA_CTL", 0x23060, 0 },
+ { "rxrst", 5, 1 },
+ { "txrst", 4, 1 },
+ { "xgmii", 3, 1 },
+ { "pause", 2, 1 },
+ { "stopErr", 1, 1 },
+ { "stop", 0, 1 },
+ { "XGMAC_PORT_EPIO_DATA0", 0x230c0, 0 },
+ { "XGMAC_PORT_EPIO_DATA1", 0x230c4, 0 },
+ { "XGMAC_PORT_EPIO_DATA2", 0x230c8, 0 },
+ { "XGMAC_PORT_EPIO_DATA3", 0x230cc, 0 },
+ { "XGMAC_PORT_EPIO_OP", 0x230d0, 0 },
+ { "Busy", 31, 1 },
+ { "Write", 8, 1 },
+ { "Address", 0, 8 },
+ { "XGMAC_PORT_WOL_STATUS", 0x230d4, 0 },
+ { "MagicDetected", 31, 1 },
+ { "PatDetected", 30, 1 },
+ { "ClearMagic", 4, 1 },
+ { "ClearMatch", 3, 1 },
+ { "MatchedFilter", 0, 3 },
+ { "XGMAC_PORT_INT_EN", 0x230d8, 0 },
+ { "ext_los", 28, 1 },
+ { "incmptbl_link", 27, 1 },
+ { "PatDetWake", 26, 1 },
+ { "MagicWake", 25, 1 },
+ { "SigDetChg", 24, 1 },
+ { "PCSR_fec_corr", 23, 1 },
+ { "AE_Train_Local", 22, 1 },
+ { "HSSPLL_LOCK", 21, 1 },
+ { "HSSPRT_READY", 20, 1 },
+ { "AutoNeg_Done", 19, 1 },
+ { "PCSR_Hi_BER", 18, 1 },
+ { "PCSR_FEC_Error", 17, 1 },
+ { "PCSR_Link_Fail", 16, 1 },
+ { "XAUI_Dec_Error", 15, 1 },
+ { "XAUI_Link_Fail", 14, 1 },
+ { "PCS_CTC_Error", 13, 1 },
+ { "PCS_Link_Good", 12, 1 },
+ { "PCS_Link_Fail", 11, 1 },
+ { "RxFifoOverFlow", 10, 1 },
+ { "HSSPRBSErr", 9, 1 },
+ { "HSSEyeQual", 8, 1 },
+ { "RemoteFault", 7, 1 },
+ { "LocalFault", 6, 1 },
+ { "MAC_Link_Down", 5, 1 },
+ { "MAC_Link_Up", 4, 1 },
+ { "BEAN_Int", 3, 1 },
+ { "XGM_Int", 2, 1 },
+ { "TxFifo_prty_err", 1, 1 },
+ { "RxFifo_prty_err", 0, 1 },
+ { "XGMAC_PORT_INT_CAUSE", 0x230dc, 0 },
+ { "ext_los", 28, 1 },
+ { "incmptbl_link", 27, 1 },
+ { "PatDetWake", 26, 1 },
+ { "MagicWake", 25, 1 },
+ { "SigDetChg", 24, 1 },
+ { "PCSR_fec_corr", 23, 1 },
+ { "AE_Train_Local", 22, 1 },
+ { "HSSPLL_LOCK", 21, 1 },
+ { "HSSPRT_READY", 20, 1 },
+ { "AutoNeg_Done", 19, 1 },
+ { "PCSR_Hi_BER", 18, 1 },
+ { "PCSR_FEC_Error", 17, 1 },
+ { "PCSR_Link_Fail", 16, 1 },
+ { "XAUI_Dec_Error", 15, 1 },
+ { "XAUI_Link_Fail", 14, 1 },
+ { "PCS_CTC_Error", 13, 1 },
+ { "PCS_Link_Good", 12, 1 },
+ { "PCS_Link_Fail", 11, 1 },
+ { "RxFifoOverFlow", 10, 1 },
+ { "HSSPRBSErr", 9, 1 },
+ { "HSSEyeQual", 8, 1 },
+ { "RemoteFault", 7, 1 },
+ { "LocalFault", 6, 1 },
+ { "MAC_Link_Down", 5, 1 },
+ { "MAC_Link_Up", 4, 1 },
+ { "BEAN_Int", 3, 1 },
+ { "XGM_Int", 2, 1 },
+ { "TxFifo_prty_err", 1, 1 },
+ { "RxFifo_prty_err", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG0", 0x230e0, 0 },
+ { "TXDTS", 31, 1 },
+ { "TXCTS", 30, 1 },
+ { "TXBTS", 29, 1 },
+ { "TXATS", 28, 1 },
+ { "TXDOBS", 27, 1 },
+ { "TXCOBS", 26, 1 },
+ { "TXBOBS", 25, 1 },
+ { "TXAOBS", 24, 1 },
+ { "HSSREFCLKSEL", 20, 1 },
+ { "HSSAVDHI", 17, 1 },
+ { "HSSRXTS", 16, 1 },
+ { "HSSTXACMODE", 15, 1 },
+ { "HSSRXACMODE", 14, 1 },
+ { "HSSRESYNC", 13, 1 },
+ { "HSSRECCAL", 12, 1 },
+ { "HSSPDWNPLL", 11, 1 },
+ { "HSSDIVSEL", 9, 2 },
+ { "HSSREFDIV", 8, 1 },
+ { "HSSPLLBYP", 7, 1 },
+ { "HSSLOFREQPLL", 6, 1 },
+ { "HSSLOFREQ2PLL", 5, 1 },
+ { "HSSEXTC16SEL", 4, 1 },
+ { "HSSRSTCONFIG", 1, 3 },
+ { "HSSPRBSEN", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG1", 0x230e4, 0 },
+ { "RXDPRBSRST", 28, 1 },
+ { "RXDPRBSEN", 27, 1 },
+ { "RXDPRBSFRCERR", 26, 1 },
+ { "TXDPRBSRST", 25, 1 },
+ { "TXDPRBSEN", 24, 1 },
+ { "RXCPRBSRST", 20, 1 },
+ { "RXCPRBSEN", 19, 1 },
+ { "RXCPRBSFRCERR", 18, 1 },
+ { "TXCPRBSRST", 17, 1 },
+ { "TXCPRBSEN", 16, 1 },
+ { "RXBPRBSRST", 12, 1 },
+ { "RXBPRBSEN", 11, 1 },
+ { "RXBPRBSFRCERR", 10, 1 },
+ { "TXBPRBSRST", 9, 1 },
+ { "TXBPRBSEN", 8, 1 },
+ { "RXAPRBSRST", 4, 1 },
+ { "RXAPRBSEN", 3, 1 },
+ { "RXAPRBSFRCERR", 2, 1 },
+ { "TXAPRBSRST", 1, 1 },
+ { "TXAPRBSEN", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG2", 0x230e8, 0 },
+ { "RXDDATASYNC", 23, 1 },
+ { "RXCDATASYNC", 22, 1 },
+ { "RXBDATASYNC", 21, 1 },
+ { "RXADATASYNC", 20, 1 },
+ { "RXDEARLYIN", 19, 1 },
+ { "RXDLATEIN", 18, 1 },
+ { "RXDPHSLOCK", 17, 1 },
+ { "RXDPHSDNIN", 16, 1 },
+ { "RXDPHSUPIN", 15, 1 },
+ { "RXCEARLYIN", 14, 1 },
+ { "RXCLATEIN", 13, 1 },
+ { "RXCPHSLOCK", 12, 1 },
+ { "RXCPHSDNIN", 11, 1 },
+ { "RXCPHSUPIN", 10, 1 },
+ { "RXBEARLYIN", 9, 1 },
+ { "RXBLATEIN", 8, 1 },
+ { "RXBPHSLOCK", 7, 1 },
+ { "RXBPHSDNIN", 6, 1 },
+ { "RXBPHSUPIN", 5, 1 },
+ { "RXAEARLYIN", 4, 1 },
+ { "RXALATEIN", 3, 1 },
+ { "RXAPHSLOCK", 2, 1 },
+ { "RXAPHSDNIN", 1, 1 },
+ { "RXAPHSUPIN", 0, 1 },
+ { "XGMAC_PORT_HSS_STATUS", 0x230ec, 0 },
+ { "RXDPRBSSYNC", 15, 1 },
+ { "RXCPRBSSYNC", 14, 1 },
+ { "RXBPRBSSYNC", 13, 1 },
+ { "RXAPRBSSYNC", 12, 1 },
+ { "RXDPRBSERR", 11, 1 },
+ { "RXCPRBSERR", 10, 1 },
+ { "RXBPRBSERR", 9, 1 },
+ { "RXAPRBSERR", 8, 1 },
+ { "RXDSIGDET", 7, 1 },
+ { "RXCSIGDET", 6, 1 },
+ { "RXBSIGDET", 5, 1 },
+ { "RXASIGDET", 4, 1 },
+ { "HSSPLLLOCK", 1, 1 },
+ { "HSSPRTREADY", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_CTRL", 0x23200, 0 },
+ { "SendPause", 2, 1 },
+ { "SendZeroPause", 1, 1 },
+ { "TxEn", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_CFG", 0x23204, 0 },
+ { "CRCCal", 8, 2 },
+ { "DisDefIdleCnt", 7, 1 },
+ { "DecAvgTxIPG", 6, 1 },
+ { "UnidirTxEn", 5, 1 },
+ { "CfgClkSpeed", 2, 3 },
+ { "StretchMode", 1, 1 },
+ { "TxPauseEn", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_PAUSE_QUANTA", 0x23208, 0 },
+ { "XGMAC_PORT_XGM_RX_CTRL", 0x2320c, 0 },
+ { "XGMAC_PORT_XGM_RX_CFG", 0x23210, 0 },
+ { "CRCCal", 16, 2 },
+ { "LocalFault", 15, 1 },
+ { "RemoteFault", 14, 1 },
+ { "LenErrFrameDis", 13, 1 },
+ { "Con802_3Preamble", 12, 1 },
+ { "EnNon802_3Preamble", 11, 1 },
+ { "CopyPreamble", 10, 1 },
+ { "DisPauseFrames", 9, 1 },
+ { "En1536BFrames", 8, 1 },
+ { "EnJumbo", 7, 1 },
+ { "RmFCS", 6, 1 },
+ { "DisNonVlan", 5, 1 },
+ { "EnExtMatch", 4, 1 },
+ { "EnHashUcast", 3, 1 },
+ { "EnHashMcast", 2, 1 },
+ { "DisBCast", 1, 1 },
+ { "CopyAllFrames", 0, 1 },
+ { "XGMAC_PORT_XGM_RX_HASH_LOW", 0x23214, 0 },
+ { "XGMAC_PORT_XGM_RX_HASH_HIGH", 0x23218, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_1", 0x2321c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_1", 0x23220, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_2", 0x23224, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_2", 0x23228, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_3", 0x2322c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_3", 0x23230, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_4", 0x23234, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_4", 0x23238, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_5", 0x2323c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_5", 0x23240, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_6", 0x23244, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_6", 0x23248, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_7", 0x2324c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_7", 0x23250, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_8", 0x23254, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_8", 0x23258, 0 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_1", 0x2325c, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_2", 0x23260, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_3", 0x23264, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_4", 0x23268, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_INT_STATUS", 0x2326c, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_MASK", 0x23270, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_EN", 0x23274, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_DISABLE", 0x23278, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_PAUSE_TIMER", 0x2327c, 0 },
+ { "XGMAC_PORT_XGM_STAT_CTRL", 0x23280, 0 },
+ { "ReadSnpShot", 4, 1 },
+ { "TakeSnpShot", 3, 1 },
+ { "ClrStats", 2, 1 },
+ { "IncrStats", 1, 1 },
+ { "EnTestModeWr", 0, 1 },
+ { "XGMAC_PORT_XGM_MDIO_CTRL", 0x23284, 0 },
+ { "FrameType", 30, 2 },
+ { "Operation", 28, 2 },
+ { "PortAddr", 23, 5 },
+ { "DevAddr", 18, 5 },
+ { "Resrv", 16, 2 },
+ { "Data", 0, 16 },
+ { "XGMAC_PORT_XGM_MODULE_ID", 0x232fc, 0 },
+ { "ModuleID", 16, 16 },
+ { "ModuleRev", 0, 16 },
+ { "XGMAC_PORT_XGM_STAT_TX_BYTE_LOW", 0x23300, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_BYTE_HIGH", 0x23304, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_FRAME_LOW", 0x23308, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_FRAME_HIGH", 0x2330c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_BCAST", 0x23310, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_MCAST", 0x23314, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_PAUSE", 0x23318, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_64B_FRAMES", 0x2331c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_65_127B_FRAMES", 0x23320, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_128_255B_FRAMES", 0x23324, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_256_511B_FRAMES", 0x23328, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_512_1023B_FRAMES", 0x2332c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_1024_1518B_FRAMES", 0x23330, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_1519_MAXB_FRAMES", 0x23334, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_ERR_FRAMES", 0x23338, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BYTES_LOW", 0x2333c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BYTES_HIGH", 0x23340, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_FRAMES_LOW", 0x23344, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_FRAMES_HIGH", 0x23348, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BCAST_FRAMES", 0x2334c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_MCAST_FRAMES", 0x23350, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_PAUSE_FRAMES", 0x23354, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_64B_FRAMES", 0x23358, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_65_127B_FRAMES", 0x2335c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_128_255B_FRAMES", 0x23360, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_256_511B_FRAMES", 0x23364, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_512_1023B_FRAMES", 0x23368, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_1024_1518B_FRAMES", 0x2336c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_1519_MAXB_FRAMES", 0x23370, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_SHORT_FRAMES", 0x23374, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_OVERSIZE_FRAMES", 0x23378, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_JABBER_FRAMES", 0x2337c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_CRC_ERR_FRAMES", 0x23380, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_LENGTH_ERR_FRAMES", 0x23384, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_SYM_CODE_ERR_FRAMES", 0x23388, 0 },
+ { "XGMAC_PORT_XAUI_CTRL", 0x23400, 0 },
+ { "polarity_inv_rx", 8, 4 },
+ { "polarity_inv_tx", 4, 4 },
+ { "test_sel", 2, 2 },
+ { "test_en", 0, 1 },
+ { "XGMAC_PORT_XAUI_STATUS", 0x23404, 0 },
+ { "Decode_Error", 12, 8 },
+ { "Lane3_CTC_Status", 11, 1 },
+ { "Lane2_CTC_Status", 10, 1 },
+ { "Lane1_CTC_Status", 9, 1 },
+ { "Lane0_CTC_Status", 8, 1 },
+ { "Align_Status", 4, 1 },
+ { "Lane3_Sync_Status", 3, 1 },
+ { "Lane2_Sync_Status", 2, 1 },
+ { "Lane1_Sync_Status", 1, 1 },
+ { "Lane0_Sync_Status", 0, 1 },
+ { "XGMAC_PORT_PCSR_CTRL", 0x23500, 0 },
+ { "rx_clk_speed", 7, 1 },
+ { "ScrBypass", 6, 1 },
+ { "FECErrIndEn", 5, 1 },
+ { "FECEn", 4, 1 },
+ { "TestSel", 2, 2 },
+ { "ScrLoopEn", 1, 1 },
+ { "XGMIILoopEn", 0, 1 },
+ { "XGMAC_PORT_PCSR_TXTEST_CTRL", 0x23510, 0 },
+ { "tx_prbs9_en", 4, 1 },
+ { "tx_prbs31_en", 3, 1 },
+ { "tx_tst_dat_sel", 2, 1 },
+ { "tx_tst_sel", 1, 1 },
+ { "tx_tst_en", 0, 1 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDA_LOWER", 0x23514, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDA_UPPER", 0x23518, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDB_LOWER", 0x2352c, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDB_UPPER", 0x23530, 0 },
+ { "XGMAC_PORT_PCSR_RXTEST_CTRL", 0x2353c, 0 },
+ { "tpter_cnt_rst", 7, 1 },
+ { "test_cnt_125us", 6, 1 },
+ { "test_cnt_pre", 5, 1 },
+ { "ber_cnt_rst", 4, 1 },
+ { "err_blk_cnt_rst", 3, 1 },
+ { "rx_prbs31_en", 2, 1 },
+ { "rx_tst_dat_sel", 1, 1 },
+ { "rx_tst_en", 0, 1 },
+ { "XGMAC_PORT_PCSR_STATUS", 0x23550, 0 },
+ { "err_blk_cnt", 16, 8 },
+ { "ber_count", 8, 6 },
+ { "hi_ber", 2, 1 },
+ { "rx_fault", 1, 1 },
+ { "tx_fault", 0, 1 },
+ { "XGMAC_PORT_PCSR_TEST_STATUS", 0x23554, 0 },
+ { "XGMAC_PORT_AN_CONTROL", 0x23600, 0 },
+ { "soft_reset", 15, 1 },
+ { "an_enable", 12, 1 },
+ { "restart_an", 9, 1 },
+ { "XGMAC_PORT_AN_STATUS", 0x23604, 0 },
+ { "Noncer_Match", 31, 1 },
+ { "Parallel_Det_Fault", 9, 1 },
+ { "Page_Received", 6, 1 },
+ { "AN_Complete", 5, 1 },
+ { "Remote_Fault", 4, 1 },
+ { "AN_Ability", 3, 1 },
+ { "link_status", 2, 1 },
+ { "partner_an_ability", 0, 1 },
+ { "XGMAC_PORT_AN_ADVERTISEMENT", 0x23608, 0 },
+ { "FEC_Enable", 31, 1 },
+ { "FEC_Ability", 30, 1 },
+ { "10GBASE_KR_Capable", 23, 1 },
+ { "10GBASE_KX4_Capable", 22, 1 },
+ { "1000BASE_KX_Capable", 21, 1 },
+ { "Transmitted_Nonce", 16, 5 },
+ { "NP", 15, 1 },
+ { "ACK", 14, 1 },
+ { "Remote_Fault", 13, 1 },
+ { "ASM_DIR", 11, 1 },
+ { "Pause", 10, 1 },
+ { "Echoed_Nonce", 5, 5 },
+ { "XGMAC_PORT_AN_LINK_PARTNER_ABILITY", 0x2360c, 0 },
+ { "FEC_Enable", 31, 1 },
+ { "FEC_Ability", 30, 1 },
+ { "10GBASE_KR_Capable", 23, 1 },
+ { "10GBASE_KX4_Capable", 22, 1 },
+ { "1000BASE_KX_Capable", 21, 1 },
+ { "Transmitted_Nonce", 16, 5 },
+ { "NP", 15, 1 },
+ { "ACK", 14, 1 },
+ { "Remote_Fault", 13, 1 },
+ { "ASM_DIR", 11, 1 },
+ { "Pause", 10, 1 },
+ { "Echoed_Nonce", 5, 5 },
+ { "Selector_Field", 0, 5 },
+ { "XGMAC_PORT_AN_NP_LOWER_TRANSMIT", 0x23610, 0 },
+ { "NP_Info", 16, 16 },
+ { "NP_Indication", 15, 1 },
+ { "Message_Page", 13, 1 },
+ { "ACK_2", 12, 1 },
+ { "Toggle", 11, 1 },
+ { "XGMAC_PORT_AN_NP_UPPER_TRANSMIT", 0x23614, 0 },
+ { "XGMAC_PORT_AN_LP_NP_LOWER", 0x23618, 0 },
+ { "XGMAC_PORT_AN_LP_NP_UPPER", 0x2361c, 0 },
+ { "XGMAC_PORT_AN_BACKPLANE_ETHERNET_STATUS", 0x23624, 0 },
+ { "TX_Pause_Okay", 6, 1 },
+ { "RX_Pause_Okay", 5, 1 },
+ { "10GBASE_KR_FEC_neg", 4, 1 },
+ { "10GBASE_KR_neg", 3, 1 },
+ { "10GBASE_KX4_neg", 2, 1 },
+ { "1000BASE_KX_neg", 1, 1 },
+ { "BP_AN_Ability", 0, 1 },
+ { "XGMAC_PORT_AN_TX_NONCE_CONTROL", 0x23628, 0 },
+ { "Bypass_LFSR", 15, 1 },
+ { "LFSR_Init", 0, 15 },
+ { "XGMAC_PORT_AN_INTERRUPT_STATUS", 0x2362c, 0 },
+ { "NP_From_LP", 3, 1 },
+ { "Parallel_Det_Fault", 2, 1 },
+ { "BP_From_LP", 1, 1 },
+ { "PCS_AN_Complete", 0, 1 },
+ { "XGMAC_PORT_AN_GENERIC_TIMER_TIMEOUT", 0x23630, 0 },
+ { "XGMAC_PORT_AN_BREAK_LINK_TIMEOUT", 0x23634, 0 },
+ { "XGMAC_PORT_AN_MODULE_ID", 0x2363c, 0 },
+ { "Module_ID", 16, 16 },
+ { "Module_Revision", 0, 16 },
+ { "XGMAC_PORT_AE_RX_COEF_REQ", 0x23700, 0 },
+ { "RXREQ_CPRE", 13, 1 },
+ { "RXREQ_CINIT", 12, 1 },
+ { "RXREQ_C0", 4, 2 },
+ { "RXREQ_C1", 2, 2 },
+ { "RXREQ_C2", 0, 2 },
+ { "XGMAC_PORT_AE_RX_COEF_STAT", 0x23704, 0 },
+ { "RXSTAT_RDY", 15, 1 },
+ { "RXSTAT_C0", 4, 2 },
+ { "RXSTAT_C1", 2, 2 },
+ { "RXSTAT_C2", 0, 2 },
+ { "XGMAC_PORT_AE_TX_COEF_REQ", 0x23708, 0 },
+ { "TXREQ_CPRE", 13, 1 },
+ { "TXREQ_CINIT", 12, 1 },
+ { "TXREQ_C0", 4, 2 },
+ { "TXREQ_C1", 2, 2 },
+ { "TXREQ_C2", 0, 2 },
+ { "XGMAC_PORT_AE_TX_COEF_STAT", 0x2370c, 0 },
+ { "TXSTAT_RDY", 15, 1 },
+ { "TXSTAT_C0", 4, 2 },
+ { "TXSTAT_C1", 2, 2 },
+ { "TXSTAT_C2", 0, 2 },
+ { "XGMAC_PORT_AE_REG_MODE", 0x23710, 0 },
+ { "MAN_DEC", 4, 2 },
+ { "MANUAL_RDY", 3, 1 },
+ { "MWT_DISABLE", 2, 1 },
+ { "MDIO_OVR", 1, 1 },
+ { "STICKY_MODE", 0, 1 },
+ { "XGMAC_PORT_AE_PRBS_CTL", 0x23714, 0 },
+ { "PRBS_CHK_ERRCNT", 8, 8 },
+ { "PRBS_SYNCCNT", 5, 3 },
+ { "PRBS_CHK_SYNC", 4, 1 },
+ { "PRBS_CHK_RST", 3, 1 },
+ { "PRBS_CHK_OFF", 2, 1 },
+ { "PRBS_GEN_FRCERR", 1, 1 },
+ { "PRBS_GEN_OFF", 0, 1 },
+ { "XGMAC_PORT_AE_FSM_CTL", 0x23718, 0 },
+ { "FSM_TR_LCL", 14, 1 },
+ { "FSM_GDMRK", 11, 3 },
+ { "FSM_BADMRK", 8, 3 },
+ { "FSM_TR_FAIL", 7, 1 },
+ { "FSM_TR_ACT", 6, 1 },
+ { "FSM_FRM_LCK", 5, 1 },
+ { "FSM_TR_COMP", 4, 1 },
+ { "MC_RX_RDY", 3, 1 },
+ { "FSM_CU_DIS", 2, 1 },
+ { "FSM_TR_RST", 1, 1 },
+ { "FSM_TR_EN", 0, 1 },
+ { "XGMAC_PORT_AE_FSM_STATE", 0x2371c, 0 },
+ { "CC2FSM_STATE", 13, 3 },
+ { "CC1FSM_STATE", 10, 3 },
+ { "CC0FSM_STATE", 7, 3 },
+ { "FLFSM_STATE", 4, 3 },
+ { "TFSM_STATE", 0, 3 },
+ { "XGMAC_PORT_AE_TX_DIS", 0x23780, 0 },
+ { "XGMAC_PORT_AE_KR_CTRL", 0x23784, 0 },
+ { "Training_Enable", 1, 1 },
+ { "Restart_Training", 0, 1 },
+ { "XGMAC_PORT_AE_RX_SIGDET", 0x23788, 0 },
+ { "XGMAC_PORT_AE_KR_STATUS", 0x2378c, 0 },
+ { "Training_Failure", 3, 1 },
+ { "Training", 2, 1 },
+ { "Frame_Lock", 1, 1 },
+ { "RX_Trained", 0, 1 },
+ { "XGMAC_PORT_HSS_TXA_MODE_CFG", 0x23800, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TEST_CTRL", 0x23804, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXA_COEFF_CTRL", 0x23808, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXA_DRIVER_MODE", 0x2380c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_DRIVER_OVR_CTRL", 0x23810, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TDM_BIASGEN_STANDBY_TIMER", 0x23814, 0 },
+ { "XGMAC_PORT_HSS_TXA_TDM_BIASGEN_PWRON_TIMER", 0x23818, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_COEFF", 0x23820, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_COEFF", 0x23824, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_COEFF", 0x23828, 0 },
+ { "XGMAC_PORT_HSS_TXA_PWR", 0x23830, 0 },
+ { "XGMAC_PORT_HSS_TXA_POLARITY", 0x23834, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXA_8023AP_AE_CMD", 0x23838, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_8023AP_AE_STATUS", 0x2383c, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_IDAC_OVR", 0x23840, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_IDAC_OVR", 0x23844, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_IDAC_OVR", 0x23848, 0 },
+ { "XGMAC_PORT_HSS_TXA_PWR_DAC_OVR", 0x23850, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXA_PWR_DAC", 0x23854, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_IDAC_APP", 0x23860, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_IDAC_APP", 0x23864, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_IDAC_APP", 0x23868, 0 },
+ { "XGMAC_PORT_HSS_TXA_SEG_DIS_APP", 0x23870, 0 },
+ { "XGMAC_PORT_HSS_TXA_EXT_ADDR_DATA", 0x23878, 0 },
+ { "XGMAC_PORT_HSS_TXA_EXT_ADDR", 0x2387c, 0 },
+ { "XADDR", 1, 5 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_TXB_MODE_CFG", 0x23880, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TEST_CTRL", 0x23884, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXB_COEFF_CTRL", 0x23888, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXB_DRIVER_MODE", 0x2388c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_DRIVER_OVR_CTRL", 0x23890, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TDM_BIASGEN_STANDBY_TIMER", 0x23894, 0 },
+ { "XGMAC_PORT_HSS_TXB_TDM_BIASGEN_PWRON_TIMER", 0x23898, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_COEFF", 0x238a0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_COEFF", 0x238a4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_COEFF", 0x238a8, 0 },
+ { "XGMAC_PORT_HSS_TXB_PWR", 0x238b0, 0 },
+ { "XGMAC_PORT_HSS_TXB_POLARITY", 0x238b4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXB_8023AP_AE_CMD", 0x238b8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_8023AP_AE_STATUS", 0x238bc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_IDAC_OVR", 0x238c0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_IDAC_OVR", 0x238c4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_IDAC_OVR", 0x238c8, 0 },
+ { "XGMAC_PORT_HSS_TXB_PWR_DAC_OVR", 0x238d0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXB_PWR_DAC", 0x238d4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_IDAC_APP", 0x238e0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_IDAC_APP", 0x238e4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_IDAC_APP", 0x238e8, 0 },
+ { "XGMAC_PORT_HSS_TXB_SEG_DIS_APP", 0x238f0, 0 },
+ { "XGMAC_PORT_HSS_TXB_EXT_ADDR_DATA", 0x238f8, 0 },
+ { "XGMAC_PORT_HSS_TXB_EXT_ADDR", 0x238fc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_CFG_MODE", 0x23900, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXA_TEST_CTRL", 0x23904, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_CTRL", 0x23908, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_OFFSET_CTRL", 0x2390c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_POSITION1", 0x23910, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_POSITION2", 0x23914, 0 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_STATIC_PH_OFFSET", 0x23918, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_SIGDET_CTRL", 0x2391c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_CTRL", 0x23920, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_DATA_EDGE_SAMPLE", 0x23924, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_DFE_AMP_SAMPLE", 0x23928, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL1", 0x2392c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL2", 0x23930, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL3", 0x23934, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXA_DFE_D00_D01_OFFSET", 0x23938, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_D10_D11_OFFSET", 0x2393c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_E0_E1_OFFSET", 0x23940, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DACA_OFFSET", 0x23944, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_DACAP_DAC_AN_OFFSET", 0x23948, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_DACA_MIN", 0x2394c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_ADAC_CTRL", 0x23950, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXA_DIGITAL_EYE_CTRL", 0x23954, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DIGITAL_EYE_METRICS", 0x23958, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H1", 0x2395c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H2", 0x23960, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H3", 0x23964, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H4", 0x23968, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H5", 0x2396c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DAC_DPC", 0x23970, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DDC", 0x23974, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_INTERNAL_STATUS", 0x23978, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_FUNC_CTRL", 0x2397c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_CFG_MODE", 0x23980, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXB_TEST_CTRL", 0x23984, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_CTRL", 0x23988, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_OFFSET_CTRL", 0x2398c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_POSITION1", 0x23990, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_POSITION2", 0x23994, 0 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_STATIC_PH_OFFSET", 0x23998, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_SIGDET_CTRL", 0x2399c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_CTRL", 0x239a0, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_DATA_EDGE_SAMPLE", 0x239a4, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_DFE_AMP_SAMPLE", 0x239a8, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL1", 0x239ac, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL2", 0x239b0, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL3", 0x239b4, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXB_DFE_D00_D01_OFFSET", 0x239b8, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_D10_D11_OFFSET", 0x239bc, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_E0_E1_OFFSET", 0x239c0, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DACA_OFFSET", 0x239c4, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_DACAP_DAC_AN_OFFSET", 0x239c8, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_DACA_MIN", 0x239cc, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_ADAC_CTRL", 0x239d0, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXB_DIGITAL_EYE_CTRL", 0x239d4, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DIGITAL_EYE_METRICS", 0x239d8, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H1", 0x239dc, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H2", 0x239e0, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H3", 0x239e4, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H4", 0x239e8, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H5", 0x239ec, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DAC_DPC", 0x239f0, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DDC", 0x239f4, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_INTERNAL_STATUS", 0x239f8, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_FUNC_CTRL", 0x239fc, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_TXC_MODE_CFG", 0x23a00, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TEST_CTRL", 0x23a04, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXC_COEFF_CTRL", 0x23a08, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXC_DRIVER_MODE", 0x23a0c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_DRIVER_OVR_CTRL", 0x23a10, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TDM_BIASGEN_STANDBY_TIMER", 0x23a14, 0 },
+ { "XGMAC_PORT_HSS_TXC_TDM_BIASGEN_PWRON_TIMER", 0x23a18, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_COEFF", 0x23a20, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_COEFF", 0x23a24, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_COEFF", 0x23a28, 0 },
+ { "XGMAC_PORT_HSS_TXC_PWR", 0x23a30, 0 },
+ { "XGMAC_PORT_HSS_TXC_POLARITY", 0x23a34, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXC_8023AP_AE_CMD", 0x23a38, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_8023AP_AE_STATUS", 0x23a3c, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_IDAC_OVR", 0x23a40, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_IDAC_OVR", 0x23a44, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_IDAC_OVR", 0x23a48, 0 },
+ { "XGMAC_PORT_HSS_TXC_PWR_DAC_OVR", 0x23a50, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXC_PWR_DAC", 0x23a54, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_IDAC_APP", 0x23a60, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_IDAC_APP", 0x23a64, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_IDAC_APP", 0x23a68, 0 },
+ { "XGMAC_PORT_HSS_TXC_SEG_DIS_APP", 0x23a70, 0 },
+ { "XGMAC_PORT_HSS_TXC_EXT_ADDR_DATA", 0x23a78, 0 },
+ { "XGMAC_PORT_HSS_TXC_EXT_ADDR", 0x23a7c, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_TXD_MODE_CFG", 0x23a80, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TEST_CTRL", 0x23a84, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXD_COEFF_CTRL", 0x23a88, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXD_DRIVER_MODE", 0x23a8c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_DRIVER_OVR_CTRL", 0x23a90, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TDM_BIASGEN_STANDBY_TIMER", 0x23a94, 0 },
+ { "XGMAC_PORT_HSS_TXD_TDM_BIASGEN_PWRON_TIMER", 0x23a98, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_COEFF", 0x23aa0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_COEFF", 0x23aa4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_COEFF", 0x23aa8, 0 },
+ { "XGMAC_PORT_HSS_TXD_PWR", 0x23ab0, 0 },
+ { "XGMAC_PORT_HSS_TXD_POLARITY", 0x23ab4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXD_8023AP_AE_CMD", 0x23ab8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_8023AP_AE_STATUS", 0x23abc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_IDAC_OVR", 0x23ac0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_IDAC_OVR", 0x23ac4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_IDAC_OVR", 0x23ac8, 0 },
+ { "XGMAC_PORT_HSS_TXD_PWR_DAC_OVR", 0x23ad0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXD_PWR_DAC", 0x23ad4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_IDAC_APP", 0x23ae0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_IDAC_APP", 0x23ae4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_IDAC_APP", 0x23ae8, 0 },
+ { "XGMAC_PORT_HSS_TXD_SEG_DIS_APP", 0x23af0, 0 },
+ { "XGMAC_PORT_HSS_TXD_EXT_ADDR_DATA", 0x23af8, 0 },
+ { "XGMAC_PORT_HSS_TXD_EXT_ADDR", 0x23afc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_CFG_MODE", 0x23b00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXC_TEST_CTRL", 0x23b04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_CTRL", 0x23b08, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_OFFSET_CTRL", 0x23b0c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_POSITION1", 0x23b10, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_POSITION2", 0x23b14, 0 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_STATIC_PH_OFFSET", 0x23b18, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_SIGDET_CTRL", 0x23b1c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_CTRL", 0x23b20, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_DATA_EDGE_SAMPLE", 0x23b24, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_DFE_AMP_SAMPLE", 0x23b28, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL1", 0x23b2c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL2", 0x23b30, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL3", 0x23b34, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXC_DFE_D00_D01_OFFSET", 0x23b38, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_D10_D11_OFFSET", 0x23b3c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_E0_E1_OFFSET", 0x23b40, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DACA_OFFSET", 0x23b44, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_DACAP_DAC_AN_OFFSET", 0x23b48, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_DACA_MIN", 0x23b4c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_ADAC_CTRL", 0x23b50, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXC_DIGITAL_EYE_CTRL", 0x23b54, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DIGITAL_EYE_METRICS", 0x23b58, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H1", 0x23b5c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H2", 0x23b60, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H3", 0x23b64, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H4", 0x23b68, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H5", 0x23b6c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DAC_DPC", 0x23b70, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DDC", 0x23b74, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_INTERNAL_STATUS", 0x23b78, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_FUNC_CTRL", 0x23b7c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_CFG_MODE", 0x23b80, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXD_TEST_CTRL", 0x23b84, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_CTRL", 0x23b88, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_OFFSET_CTRL", 0x23b8c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_POSITION1", 0x23b90, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_POSITION2", 0x23b94, 0 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_STATIC_PH_OFFSET", 0x23b98, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_SIGDET_CTRL", 0x23b9c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_CTRL", 0x23ba0, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_DATA_EDGE_SAMPLE", 0x23ba4, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_DFE_AMP_SAMPLE", 0x23ba8, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL1", 0x23bac, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL2", 0x23bb0, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL3", 0x23bb4, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXD_DFE_D00_D01_OFFSET", 0x23bb8, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_D10_D11_OFFSET", 0x23bbc, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_E0_E1_OFFSET", 0x23bc0, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DACA_OFFSET", 0x23bc4, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_DACAP_DAC_AN_OFFSET", 0x23bc8, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_DACA_MIN", 0x23bcc, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_ADAC_CTRL", 0x23bd0, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXD_DIGITAL_EYE_CTRL", 0x23bd4, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DIGITAL_EYE_METRICS", 0x23bd8, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H1", 0x23bdc, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H2", 0x23be0, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H3", 0x23be4, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H4", 0x23be8, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H5", 0x23bec, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DAC_DPC", 0x23bf0, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DDC", 0x23bf4, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_INTERNAL_STATUS", 0x23bf8, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_FUNC_CTRL", 0x23bfc, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_0", 0x23c00, 0 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_1", 0x23c04, 0 },
+ { "LDET", 4, 1 },
+ { "CCERR", 3, 1 },
+ { "CCCMP", 2, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_2", 0x23c08, 0 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_3", 0x23c0c, 0 },
+ { "VISEL", 4, 1 },
+ { "FMIN", 3, 1 },
+ { "FMAX", 2, 1 },
+ { "CVHOLD", 1, 1 },
+ { "TCDIS", 0, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_4", 0x23c10, 0 },
+ { "CMETH", 2, 1 },
+ { "RECAL", 1, 1 },
+ { "CCLD", 0, 1 },
+ { "XGMAC_PORT_HSS_ANALOG_TEST_MUX", 0x23c14, 0 },
+ { "XGMAC_PORT_HSS_PORT_EN_0", 0x23c18, 0 },
+ { "RXDEN", 7, 1 },
+ { "RXCEN", 6, 1 },
+ { "TXDEN", 5, 1 },
+ { "TXCEN", 4, 1 },
+ { "RXBEN", 3, 1 },
+ { "RXAEN", 2, 1 },
+ { "TXBEN", 1, 1 },
+ { "TXAEN", 0, 1 },
+ { "XGMAC_PORT_HSS_PORT_RESET_0", 0x23c20, 0 },
+ { "RXDRST", 7, 1 },
+ { "RXCRST", 6, 1 },
+ { "TXDRST", 5, 1 },
+ { "TXCRST", 4, 1 },
+ { "RXBRST", 3, 1 },
+ { "RXARST", 2, 1 },
+ { "TXBRST", 1, 1 },
+ { "TXARST", 0, 1 },
+ { "XGMAC_PORT_HSS_CHARGE_PUMP_CTRL", 0x23c28, 0 },
+ { "ENCPIS", 2, 1 },
+ { "CPISEL", 0, 2 },
+ { "XGMAC_PORT_HSS_BAND_GAP_CTRL", 0x23c2c, 0 },
+ { "XGMAC_PORT_HSS_LOFREQ_OVR", 0x23c30, 0 },
+ { "LFREQ2", 3, 1 },
+ { "LFREQ1", 2, 1 },
+ { "LFREQO", 1, 1 },
+ { "LFSEL", 0, 1 },
+ { "XGMAC_PORT_HSS_VOLTAGE_BOOST_CTRL", 0x23c38, 0 },
+ { "PFVAL", 2, 1 },
+ { "PFEN", 1, 1 },
+ { "VBADJ", 0, 1 },
+ { "XGMAC_PORT_HSS_TX_MODE_CFG", 0x23c80, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXTEST_CTRL", 0x23c84, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TX_COEFF_CTRL", 0x23c88, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TX_DRIVER_MODE", 0x23c8c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_DRIVER_OVR_CTRL", 0x23c90, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_TDM_BIASGEN_STANDBY_TIMER", 0x23c94, 0 },
+ { "XGMAC_PORT_HSS_TX_TDM_BIASGEN_PWRON_TIMER", 0x23c98, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP0_COEFF", 0x23ca0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_COEFF", 0x23ca4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_COEFF", 0x23ca8, 0 },
+ { "XGMAC_PORT_HSS_TX_PWR", 0x23cb0, 0 },
+ { "XGMAC_PORT_HSS_TX_POLARITY", 0x23cb4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TX_8023AP_AE_CMD", 0x23cb8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_8023AP_AE_STATUS", 0x23cbc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_TAP0_IDAC_OVR", 0x23cc0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_IDAC_OVR", 0x23cc4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_IDAC_OVR", 0x23cc8, 0 },
+ { "XGMAC_PORT_HSS_TX_PWR_DAC_OVR", 0x23cd0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TX_PWR_DAC", 0x23cd4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP0_IDAC_APP", 0x23ce0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_IDAC_APP", 0x23ce4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_IDAC_APP", 0x23ce8, 0 },
+ { "XGMAC_PORT_HSS_TX_SEG_DIS_APP", 0x23cf0, 0 },
+ { "XGMAC_PORT_HSS_TX_EXT_ADDR_DATA", 0x23cf8, 0 },
+ { "XGMAC_PORT_HSS_TX_EXT_ADDR", 0x23cfc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_CFG_MODE", 0x23d00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXTEST_CTRL", 0x23d04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_CTRL", 0x23d08, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_OFFSET_CTRL", 0x23d0c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_POSITION1", 0x23d10, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_POSITION2", 0x23d14, 0 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_STATIC_PH_OFFSET", 0x23d18, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_SIGDET_CTRL", 0x23d1c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_CTRL", 0x23d20, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_DATA_EDGE_SAMPLE", 0x23d24, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_DFE_AMP_SAMPLE", 0x23d28, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL1", 0x23d2c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL2", 0x23d30, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL3", 0x23d34, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RX_DFE_D00_D01_OFFSET", 0x23d38, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_D10_D11_OFFSET", 0x23d3c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_E0_E1_OFFSET", 0x23d40, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DACA_OFFSET", 0x23d44, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_DACAP_DAC_AN_OFFSET", 0x23d48, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_DACA_MIN", 0x23d4c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_ADAC_CTRL", 0x23d50, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RX_DIGITAL_EYE_CTRL", 0x23d54, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DIGITAL_EYE_METRICS", 0x23d58, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_H1", 0x23d5c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_DFE_H2", 0x23d60, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_H3", 0x23d64, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DFE_H4", 0x23d68, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DFE_H5", 0x23d6c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DAC_DPC", 0x23d70, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DDC", 0x23d74, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_INTERNAL_STATUS", 0x23d78, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_FUNC_CTRL", 0x23d7c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_TXRX_CFG_MODE", 0x23e00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXRXTEST_CTRL", 0x23e04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_CFG", 0x25000, 0 },
+ { "XGMII_Clk_Sel", 29, 3 },
+ { "SinkTx", 27, 1 },
+ { "SinkTxOnLinkDown", 26, 1 },
+ { "xg2g_speed_mode", 25, 1 },
+ { "LoopNoFwd", 24, 1 },
+ { "XGM_Tx_pause_size", 23, 1 },
+ { "XGM_Tx_pause_frame", 22, 1 },
+ { "XGM_Tx_Disable_Pre", 21, 1 },
+ { "XGM_Tx_Disable_Crc", 20, 1 },
+ { "Smux_Rx_Loop", 19, 1 },
+ { "Rx_Lane_Swap", 18, 1 },
+ { "Tx_Lane_Swap", 17, 1 },
+ { "Signal_Det", 14, 1 },
+ { "Pmux_Rx_Loop", 13, 1 },
+ { "Pmux_Tx_Loop", 12, 1 },
+ { "XGM_Rx_Sel", 10, 2 },
+ { "PCS_Tx_Sel", 8, 2 },
+ { "XAUI20_Rem_Pre", 5, 1 },
+ { "XAUI20_XGMII_Sel", 4, 1 },
+ { "Rx_Byte_Swap", 3, 1 },
+ { "Tx_Byte_Swap", 2, 1 },
+ { "Port_Sel", 0, 1 },
+ { "XGMAC_PORT_RESET_CTRL", 0x25004, 0 },
+ { "AuxExt_Reset", 10, 1 },
+ { "TXFIFO_Reset", 9, 1 },
+ { "RXFIFO_Reset", 8, 1 },
+ { "BEAN_Reset", 7, 1 },
+ { "XAUI_Reset", 6, 1 },
+ { "AE_Reset", 5, 1 },
+ { "XGM_Reset", 4, 1 },
+ { "XG2G_Reset", 3, 1 },
+ { "WOL_Reset", 2, 1 },
+ { "XFI_PCS_Reset", 1, 1 },
+ { "HSS_Reset", 0, 1 },
+ { "XGMAC_PORT_LED_CFG", 0x25008, 0 },
+ { "Led1_Cfg", 5, 3 },
+ { "Led1_Polarity_Inv", 4, 1 },
+ { "Led0_Cfg", 1, 3 },
+ { "Led0_Polarity_Inv", 0, 1 },
+ { "XGMAC_PORT_LED_COUNTHI", 0x2500c, 0 },
+ { "XGMAC_PORT_LED_COUNTLO", 0x25010, 0 },
+ { "XGMAC_PORT_DEBUG_CFG", 0x25014, 0 },
+ { "XGMAC_PORT_CFG2", 0x25018, 0 },
+ { "Rx_Polarity_Inv", 28, 4 },
+ { "Tx_Polarity_Inv", 24, 4 },
+ { "InstanceNum", 22, 2 },
+ { "StopOnPerr", 21, 1 },
+ { "MACTxEn", 20, 1 },
+ { "MACRxEn", 19, 1 },
+ { "PatEn", 18, 1 },
+ { "MagicEn", 17, 1 },
+ { "TX_IPG", 4, 13 },
+ { "AEC_PMA_TX_READY", 1, 1 },
+ { "AEC_PMA_RX_READY", 0, 1 },
+ { "XGMAC_PORT_PKT_COUNT", 0x2501c, 0 },
+ { "tx_sop_count", 24, 8 },
+ { "tx_eop_count", 16, 8 },
+ { "rx_sop_count", 8, 8 },
+ { "rx_eop_count", 0, 8 },
+ { "XGMAC_PORT_PERR_INJECT", 0x25020, 0 },
+ { "MemSel", 1, 1 },
+ { "InjectDataErr", 0, 1 },
+ { "XGMAC_PORT_MAGIC_MACID_LO", 0x25024, 0 },
+ { "XGMAC_PORT_MAGIC_MACID_HI", 0x25028, 0 },
+ { "XGMAC_PORT_BUILD_REVISION", 0x2502c, 0 },
+ { "XGMAC_PORT_XGMII_SE_COUNT", 0x25030, 0 },
+ { "TxSop", 24, 8 },
+ { "TxEop", 16, 8 },
+ { "RxSop", 8, 8 },
+ { "RxEop", 0, 8 },
+ { "XGMAC_PORT_LINK_STATUS", 0x25034, 0 },
+ { "remflt", 3, 1 },
+ { "locflt", 2, 1 },
+ { "linkup", 1, 1 },
+ { "linkdn", 0, 1 },
+ { "XGMAC_PORT_CHECKIN", 0x25038, 0 },
+ { "Preamble", 1, 1 },
+ { "CheckIn", 0, 1 },
+ { "XGMAC_PORT_FAULT_TEST", 0x2503c, 0 },
+ { "FltType", 1, 1 },
+ { "FltCtrl", 0, 1 },
+ { "XGMAC_PORT_SPARE", 0x25040, 0 },
+ { "XGMAC_PORT_HSS_SIGDET_STATUS", 0x25044, 0 },
+ { "XGMAC_PORT_EXT_LOS_STATUS", 0x25048, 0 },
+ { "XGMAC_PORT_EXT_LOS_CTRL", 0x2504c, 0 },
+ { "XGMAC_PORT_FPGA_PAUSE_CTL", 0x25050, 0 },
+ { "CTL", 31, 1 },
+ { "HWM", 13, 13 },
+ { "LWM", 0, 13 },
+ { "XGMAC_PORT_FPGA_ERRPKT_CNT", 0x25054, 0 },
+ { "XGMAC_PORT_LA_TX_0", 0x25058, 0 },
+ { "XGMAC_PORT_LA_RX_0", 0x2505c, 0 },
+ { "XGMAC_PORT_FPGA_LA_CTL", 0x25060, 0 },
+ { "rxrst", 5, 1 },
+ { "txrst", 4, 1 },
+ { "xgmii", 3, 1 },
+ { "pause", 2, 1 },
+ { "stopErr", 1, 1 },
+ { "stop", 0, 1 },
+ { "XGMAC_PORT_EPIO_DATA0", 0x250c0, 0 },
+ { "XGMAC_PORT_EPIO_DATA1", 0x250c4, 0 },
+ { "XGMAC_PORT_EPIO_DATA2", 0x250c8, 0 },
+ { "XGMAC_PORT_EPIO_DATA3", 0x250cc, 0 },
+ { "XGMAC_PORT_EPIO_OP", 0x250d0, 0 },
+ { "Busy", 31, 1 },
+ { "Write", 8, 1 },
+ { "Address", 0, 8 },
+ { "XGMAC_PORT_WOL_STATUS", 0x250d4, 0 },
+ { "MagicDetected", 31, 1 },
+ { "PatDetected", 30, 1 },
+ { "ClearMagic", 4, 1 },
+ { "ClearMatch", 3, 1 },
+ { "MatchedFilter", 0, 3 },
+ { "XGMAC_PORT_INT_EN", 0x250d8, 0 },
+ { "ext_los", 28, 1 },
+ { "incmptbl_link", 27, 1 },
+ { "PatDetWake", 26, 1 },
+ { "MagicWake", 25, 1 },
+ { "SigDetChg", 24, 1 },
+ { "PCSR_fec_corr", 23, 1 },
+ { "AE_Train_Local", 22, 1 },
+ { "HSSPLL_LOCK", 21, 1 },
+ { "HSSPRT_READY", 20, 1 },
+ { "AutoNeg_Done", 19, 1 },
+ { "PCSR_Hi_BER", 18, 1 },
+ { "PCSR_FEC_Error", 17, 1 },
+ { "PCSR_Link_Fail", 16, 1 },
+ { "XAUI_Dec_Error", 15, 1 },
+ { "XAUI_Link_Fail", 14, 1 },
+ { "PCS_CTC_Error", 13, 1 },
+ { "PCS_Link_Good", 12, 1 },
+ { "PCS_Link_Fail", 11, 1 },
+ { "RxFifoOverFlow", 10, 1 },
+ { "HSSPRBSErr", 9, 1 },
+ { "HSSEyeQual", 8, 1 },
+ { "RemoteFault", 7, 1 },
+ { "LocalFault", 6, 1 },
+ { "MAC_Link_Down", 5, 1 },
+ { "MAC_Link_Up", 4, 1 },
+ { "BEAN_Int", 3, 1 },
+ { "XGM_Int", 2, 1 },
+ { "TxFifo_prty_err", 1, 1 },
+ { "RxFifo_prty_err", 0, 1 },
+ { "XGMAC_PORT_INT_CAUSE", 0x250dc, 0 },
+ { "ext_los", 28, 1 },
+ { "incmptbl_link", 27, 1 },
+ { "PatDetWake", 26, 1 },
+ { "MagicWake", 25, 1 },
+ { "SigDetChg", 24, 1 },
+ { "PCSR_fec_corr", 23, 1 },
+ { "AE_Train_Local", 22, 1 },
+ { "HSSPLL_LOCK", 21, 1 },
+ { "HSSPRT_READY", 20, 1 },
+ { "AutoNeg_Done", 19, 1 },
+ { "PCSR_Hi_BER", 18, 1 },
+ { "PCSR_FEC_Error", 17, 1 },
+ { "PCSR_Link_Fail", 16, 1 },
+ { "XAUI_Dec_Error", 15, 1 },
+ { "XAUI_Link_Fail", 14, 1 },
+ { "PCS_CTC_Error", 13, 1 },
+ { "PCS_Link_Good", 12, 1 },
+ { "PCS_Link_Fail", 11, 1 },
+ { "RxFifoOverFlow", 10, 1 },
+ { "HSSPRBSErr", 9, 1 },
+ { "HSSEyeQual", 8, 1 },
+ { "RemoteFault", 7, 1 },
+ { "LocalFault", 6, 1 },
+ { "MAC_Link_Down", 5, 1 },
+ { "MAC_Link_Up", 4, 1 },
+ { "BEAN_Int", 3, 1 },
+ { "XGM_Int", 2, 1 },
+ { "TxFifo_prty_err", 1, 1 },
+ { "RxFifo_prty_err", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG0", 0x250e0, 0 },
+ { "TXDTS", 31, 1 },
+ { "TXCTS", 30, 1 },
+ { "TXBTS", 29, 1 },
+ { "TXATS", 28, 1 },
+ { "TXDOBS", 27, 1 },
+ { "TXCOBS", 26, 1 },
+ { "TXBOBS", 25, 1 },
+ { "TXAOBS", 24, 1 },
+ { "HSSREFCLKSEL", 20, 1 },
+ { "HSSAVDHI", 17, 1 },
+ { "HSSRXTS", 16, 1 },
+ { "HSSTXACMODE", 15, 1 },
+ { "HSSRXACMODE", 14, 1 },
+ { "HSSRESYNC", 13, 1 },
+ { "HSSRECCAL", 12, 1 },
+ { "HSSPDWNPLL", 11, 1 },
+ { "HSSDIVSEL", 9, 2 },
+ { "HSSREFDIV", 8, 1 },
+ { "HSSPLLBYP", 7, 1 },
+ { "HSSLOFREQPLL", 6, 1 },
+ { "HSSLOFREQ2PLL", 5, 1 },
+ { "HSSEXTC16SEL", 4, 1 },
+ { "HSSRSTCONFIG", 1, 3 },
+ { "HSSPRBSEN", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG1", 0x250e4, 0 },
+ { "RXDPRBSRST", 28, 1 },
+ { "RXDPRBSEN", 27, 1 },
+ { "RXDPRBSFRCERR", 26, 1 },
+ { "TXDPRBSRST", 25, 1 },
+ { "TXDPRBSEN", 24, 1 },
+ { "RXCPRBSRST", 20, 1 },
+ { "RXCPRBSEN", 19, 1 },
+ { "RXCPRBSFRCERR", 18, 1 },
+ { "TXCPRBSRST", 17, 1 },
+ { "TXCPRBSEN", 16, 1 },
+ { "RXBPRBSRST", 12, 1 },
+ { "RXBPRBSEN", 11, 1 },
+ { "RXBPRBSFRCERR", 10, 1 },
+ { "TXBPRBSRST", 9, 1 },
+ { "TXBPRBSEN", 8, 1 },
+ { "RXAPRBSRST", 4, 1 },
+ { "RXAPRBSEN", 3, 1 },
+ { "RXAPRBSFRCERR", 2, 1 },
+ { "TXAPRBSRST", 1, 1 },
+ { "TXAPRBSEN", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG2", 0x250e8, 0 },
+ { "RXDDATASYNC", 23, 1 },
+ { "RXCDATASYNC", 22, 1 },
+ { "RXBDATASYNC", 21, 1 },
+ { "RXADATASYNC", 20, 1 },
+ { "RXDEARLYIN", 19, 1 },
+ { "RXDLATEIN", 18, 1 },
+ { "RXDPHSLOCK", 17, 1 },
+ { "RXDPHSDNIN", 16, 1 },
+ { "RXDPHSUPIN", 15, 1 },
+ { "RXCEARLYIN", 14, 1 },
+ { "RXCLATEIN", 13, 1 },
+ { "RXCPHSLOCK", 12, 1 },
+ { "RXCPHSDNIN", 11, 1 },
+ { "RXCPHSUPIN", 10, 1 },
+ { "RXBEARLYIN", 9, 1 },
+ { "RXBLATEIN", 8, 1 },
+ { "RXBPHSLOCK", 7, 1 },
+ { "RXBPHSDNIN", 6, 1 },
+ { "RXBPHSUPIN", 5, 1 },
+ { "RXAEARLYIN", 4, 1 },
+ { "RXALATEIN", 3, 1 },
+ { "RXAPHSLOCK", 2, 1 },
+ { "RXAPHSDNIN", 1, 1 },
+ { "RXAPHSUPIN", 0, 1 },
+ { "XGMAC_PORT_HSS_STATUS", 0x250ec, 0 },
+ { "RXDPRBSSYNC", 15, 1 },
+ { "RXCPRBSSYNC", 14, 1 },
+ { "RXBPRBSSYNC", 13, 1 },
+ { "RXAPRBSSYNC", 12, 1 },
+ { "RXDPRBSERR", 11, 1 },
+ { "RXCPRBSERR", 10, 1 },
+ { "RXBPRBSERR", 9, 1 },
+ { "RXAPRBSERR", 8, 1 },
+ { "RXDSIGDET", 7, 1 },
+ { "RXCSIGDET", 6, 1 },
+ { "RXBSIGDET", 5, 1 },
+ { "RXASIGDET", 4, 1 },
+ { "HSSPLLLOCK", 1, 1 },
+ { "HSSPRTREADY", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_CTRL", 0x25200, 0 },
+ { "SendPause", 2, 1 },
+ { "SendZeroPause", 1, 1 },
+ { "TxEn", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_CFG", 0x25204, 0 },
+ { "CRCCal", 8, 2 },
+ { "DisDefIdleCnt", 7, 1 },
+ { "DecAvgTxIPG", 6, 1 },
+ { "UnidirTxEn", 5, 1 },
+ { "CfgClkSpeed", 2, 3 },
+ { "StretchMode", 1, 1 },
+ { "TxPauseEn", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_PAUSE_QUANTA", 0x25208, 0 },
+ { "XGMAC_PORT_XGM_RX_CTRL", 0x2520c, 0 },
+ { "XGMAC_PORT_XGM_RX_CFG", 0x25210, 0 },
+ { "CRCCal", 16, 2 },
+ { "LocalFault", 15, 1 },
+ { "RemoteFault", 14, 1 },
+ { "LenErrFrameDis", 13, 1 },
+ { "Con802_3Preamble", 12, 1 },
+ { "EnNon802_3Preamble", 11, 1 },
+ { "CopyPreamble", 10, 1 },
+ { "DisPauseFrames", 9, 1 },
+ { "En1536BFrames", 8, 1 },
+ { "EnJumbo", 7, 1 },
+ { "RmFCS", 6, 1 },
+ { "DisNonVlan", 5, 1 },
+ { "EnExtMatch", 4, 1 },
+ { "EnHashUcast", 3, 1 },
+ { "EnHashMcast", 2, 1 },
+ { "DisBCast", 1, 1 },
+ { "CopyAllFrames", 0, 1 },
+ { "XGMAC_PORT_XGM_RX_HASH_LOW", 0x25214, 0 },
+ { "XGMAC_PORT_XGM_RX_HASH_HIGH", 0x25218, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_1", 0x2521c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_1", 0x25220, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_2", 0x25224, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_2", 0x25228, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_3", 0x2522c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_3", 0x25230, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_4", 0x25234, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_4", 0x25238, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_5", 0x2523c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_5", 0x25240, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_6", 0x25244, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_6", 0x25248, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_7", 0x2524c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_7", 0x25250, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_8", 0x25254, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_8", 0x25258, 0 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_1", 0x2525c, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_2", 0x25260, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_3", 0x25264, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_4", 0x25268, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_INT_STATUS", 0x2526c, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_MASK", 0x25270, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_EN", 0x25274, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_DISABLE", 0x25278, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_PAUSE_TIMER", 0x2527c, 0 },
+ { "XGMAC_PORT_XGM_STAT_CTRL", 0x25280, 0 },
+ { "ReadSnpShot", 4, 1 },
+ { "TakeSnpShot", 3, 1 },
+ { "ClrStats", 2, 1 },
+ { "IncrStats", 1, 1 },
+ { "EnTestModeWr", 0, 1 },
+ { "XGMAC_PORT_XGM_MDIO_CTRL", 0x25284, 0 },
+ { "FrameType", 30, 2 },
+ { "Operation", 28, 2 },
+ { "PortAddr", 23, 5 },
+ { "DevAddr", 18, 5 },
+ { "Resrv", 16, 2 },
+ { "Data", 0, 16 },
+ { "XGMAC_PORT_XGM_MODULE_ID", 0x252fc, 0 },
+ { "ModuleID", 16, 16 },
+ { "ModuleRev", 0, 16 },
+ { "XGMAC_PORT_XGM_STAT_TX_BYTE_LOW", 0x25300, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_BYTE_HIGH", 0x25304, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_FRAME_LOW", 0x25308, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_FRAME_HIGH", 0x2530c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_BCAST", 0x25310, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_MCAST", 0x25314, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_PAUSE", 0x25318, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_64B_FRAMES", 0x2531c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_65_127B_FRAMES", 0x25320, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_128_255B_FRAMES", 0x25324, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_256_511B_FRAMES", 0x25328, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_512_1023B_FRAMES", 0x2532c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_1024_1518B_FRAMES", 0x25330, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_1519_MAXB_FRAMES", 0x25334, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_ERR_FRAMES", 0x25338, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BYTES_LOW", 0x2533c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BYTES_HIGH", 0x25340, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_FRAMES_LOW", 0x25344, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_FRAMES_HIGH", 0x25348, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BCAST_FRAMES", 0x2534c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_MCAST_FRAMES", 0x25350, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_PAUSE_FRAMES", 0x25354, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_64B_FRAMES", 0x25358, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_65_127B_FRAMES", 0x2535c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_128_255B_FRAMES", 0x25360, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_256_511B_FRAMES", 0x25364, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_512_1023B_FRAMES", 0x25368, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_1024_1518B_FRAMES", 0x2536c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_1519_MAXB_FRAMES", 0x25370, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_SHORT_FRAMES", 0x25374, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_OVERSIZE_FRAMES", 0x25378, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_JABBER_FRAMES", 0x2537c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_CRC_ERR_FRAMES", 0x25380, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_LENGTH_ERR_FRAMES", 0x25384, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_SYM_CODE_ERR_FRAMES", 0x25388, 0 },
+ { "XGMAC_PORT_XAUI_CTRL", 0x25400, 0 },
+ { "polarity_inv_rx", 8, 4 },
+ { "polarity_inv_tx", 4, 4 },
+ { "test_sel", 2, 2 },
+ { "test_en", 0, 1 },
+ { "XGMAC_PORT_XAUI_STATUS", 0x25404, 0 },
+ { "Decode_Error", 12, 8 },
+ { "Lane3_CTC_Status", 11, 1 },
+ { "Lane2_CTC_Status", 10, 1 },
+ { "Lane1_CTC_Status", 9, 1 },
+ { "Lane0_CTC_Status", 8, 1 },
+ { "Align_Status", 4, 1 },
+ { "Lane3_Sync_Status", 3, 1 },
+ { "Lane2_Sync_Status", 2, 1 },
+ { "Lane1_Sync_Status", 1, 1 },
+ { "Lane0_Sync_Status", 0, 1 },
+ { "XGMAC_PORT_PCSR_CTRL", 0x25500, 0 },
+ { "rx_clk_speed", 7, 1 },
+ { "ScrBypass", 6, 1 },
+ { "FECErrIndEn", 5, 1 },
+ { "FECEn", 4, 1 },
+ { "TestSel", 2, 2 },
+ { "ScrLoopEn", 1, 1 },
+ { "XGMIILoopEn", 0, 1 },
+ { "XGMAC_PORT_PCSR_TXTEST_CTRL", 0x25510, 0 },
+ { "tx_prbs9_en", 4, 1 },
+ { "tx_prbs31_en", 3, 1 },
+ { "tx_tst_dat_sel", 2, 1 },
+ { "tx_tst_sel", 1, 1 },
+ { "tx_tst_en", 0, 1 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDA_LOWER", 0x25514, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDA_UPPER", 0x25518, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDB_LOWER", 0x2552c, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDB_UPPER", 0x25530, 0 },
+ { "XGMAC_PORT_PCSR_RXTEST_CTRL", 0x2553c, 0 },
+ { "tpter_cnt_rst", 7, 1 },
+ { "test_cnt_125us", 6, 1 },
+ { "test_cnt_pre", 5, 1 },
+ { "ber_cnt_rst", 4, 1 },
+ { "err_blk_cnt_rst", 3, 1 },
+ { "rx_prbs31_en", 2, 1 },
+ { "rx_tst_dat_sel", 1, 1 },
+ { "rx_tst_en", 0, 1 },
+ { "XGMAC_PORT_PCSR_STATUS", 0x25550, 0 },
+ { "err_blk_cnt", 16, 8 },
+ { "ber_count", 8, 6 },
+ { "hi_ber", 2, 1 },
+ { "rx_fault", 1, 1 },
+ { "tx_fault", 0, 1 },
+ { "XGMAC_PORT_PCSR_TEST_STATUS", 0x25554, 0 },
+ { "XGMAC_PORT_AN_CONTROL", 0x25600, 0 },
+ { "soft_reset", 15, 1 },
+ { "an_enable", 12, 1 },
+ { "restart_an", 9, 1 },
+ { "XGMAC_PORT_AN_STATUS", 0x25604, 0 },
+ { "Noncer_Match", 31, 1 },
+ { "Parallel_Det_Fault", 9, 1 },
+ { "Page_Received", 6, 1 },
+ { "AN_Complete", 5, 1 },
+ { "Remote_Fault", 4, 1 },
+ { "AN_Ability", 3, 1 },
+ { "link_status", 2, 1 },
+ { "partner_an_ability", 0, 1 },
+ { "XGMAC_PORT_AN_ADVERTISEMENT", 0x25608, 0 },
+ { "FEC_Enable", 31, 1 },
+ { "FEC_Ability", 30, 1 },
+ { "10GBASE_KR_Capable", 23, 1 },
+ { "10GBASE_KX4_Capable", 22, 1 },
+ { "1000BASE_KX_Capable", 21, 1 },
+ { "Transmitted_Nonce", 16, 5 },
+ { "NP", 15, 1 },
+ { "ACK", 14, 1 },
+ { "Remote_Fault", 13, 1 },
+ { "ASM_DIR", 11, 1 },
+ { "Pause", 10, 1 },
+ { "Echoed_Nonce", 5, 5 },
+ { "XGMAC_PORT_AN_LINK_PARTNER_ABILITY", 0x2560c, 0 },
+ { "FEC_Enable", 31, 1 },
+ { "FEC_Ability", 30, 1 },
+ { "10GBASE_KR_Capable", 23, 1 },
+ { "10GBASE_KX4_Capable", 22, 1 },
+ { "1000BASE_KX_Capable", 21, 1 },
+ { "Transmitted_Nonce", 16, 5 },
+ { "NP", 15, 1 },
+ { "ACK", 14, 1 },
+ { "Remote_Fault", 13, 1 },
+ { "ASM_DIR", 11, 1 },
+ { "Pause", 10, 1 },
+ { "Echoed_Nonce", 5, 5 },
+ { "Selector_Field", 0, 5 },
+ { "XGMAC_PORT_AN_NP_LOWER_TRANSMIT", 0x25610, 0 },
+ { "NP_Info", 16, 16 },
+ { "NP_Indication", 15, 1 },
+ { "Message_Page", 13, 1 },
+ { "ACK_2", 12, 1 },
+ { "Toggle", 11, 1 },
+ { "XGMAC_PORT_AN_NP_UPPER_TRANSMIT", 0x25614, 0 },
+ { "XGMAC_PORT_AN_LP_NP_LOWER", 0x25618, 0 },
+ { "XGMAC_PORT_AN_LP_NP_UPPER", 0x2561c, 0 },
+ { "XGMAC_PORT_AN_BACKPLANE_ETHERNET_STATUS", 0x25624, 0 },
+ { "TX_Pause_Okay", 6, 1 },
+ { "RX_Pause_Okay", 5, 1 },
+ { "10GBASE_KR_FEC_neg", 4, 1 },
+ { "10GBASE_KR_neg", 3, 1 },
+ { "10GBASE_KX4_neg", 2, 1 },
+ { "1000BASE_KX_neg", 1, 1 },
+ { "BP_AN_Ability", 0, 1 },
+ { "XGMAC_PORT_AN_TX_NONCE_CONTROL", 0x25628, 0 },
+ { "Bypass_LFSR", 15, 1 },
+ { "LFSR_Init", 0, 15 },
+ { "XGMAC_PORT_AN_INTERRUPT_STATUS", 0x2562c, 0 },
+ { "NP_From_LP", 3, 1 },
+ { "Parallel_Det_Fault", 2, 1 },
+ { "BP_From_LP", 1, 1 },
+ { "PCS_AN_Complete", 0, 1 },
+ { "XGMAC_PORT_AN_GENERIC_TIMER_TIMEOUT", 0x25630, 0 },
+ { "XGMAC_PORT_AN_BREAK_LINK_TIMEOUT", 0x25634, 0 },
+ { "XGMAC_PORT_AN_MODULE_ID", 0x2563c, 0 },
+ { "Module_ID", 16, 16 },
+ { "Module_Revision", 0, 16 },
+ { "XGMAC_PORT_AE_RX_COEF_REQ", 0x25700, 0 },
+ { "RXREQ_CPRE", 13, 1 },
+ { "RXREQ_CINIT", 12, 1 },
+ { "RXREQ_C0", 4, 2 },
+ { "RXREQ_C1", 2, 2 },
+ { "RXREQ_C2", 0, 2 },
+ { "XGMAC_PORT_AE_RX_COEF_STAT", 0x25704, 0 },
+ { "RXSTAT_RDY", 15, 1 },
+ { "RXSTAT_C0", 4, 2 },
+ { "RXSTAT_C1", 2, 2 },
+ { "RXSTAT_C2", 0, 2 },
+ { "XGMAC_PORT_AE_TX_COEF_REQ", 0x25708, 0 },
+ { "TXREQ_CPRE", 13, 1 },
+ { "TXREQ_CINIT", 12, 1 },
+ { "TXREQ_C0", 4, 2 },
+ { "TXREQ_C1", 2, 2 },
+ { "TXREQ_C2", 0, 2 },
+ { "XGMAC_PORT_AE_TX_COEF_STAT", 0x2570c, 0 },
+ { "TXSTAT_RDY", 15, 1 },
+ { "TXSTAT_C0", 4, 2 },
+ { "TXSTAT_C1", 2, 2 },
+ { "TXSTAT_C2", 0, 2 },
+ { "XGMAC_PORT_AE_REG_MODE", 0x25710, 0 },
+ { "MAN_DEC", 4, 2 },
+ { "MANUAL_RDY", 3, 1 },
+ { "MWT_DISABLE", 2, 1 },
+ { "MDIO_OVR", 1, 1 },
+ { "STICKY_MODE", 0, 1 },
+ { "XGMAC_PORT_AE_PRBS_CTL", 0x25714, 0 },
+ { "PRBS_CHK_ERRCNT", 8, 8 },
+ { "PRBS_SYNCCNT", 5, 3 },
+ { "PRBS_CHK_SYNC", 4, 1 },
+ { "PRBS_CHK_RST", 3, 1 },
+ { "PRBS_CHK_OFF", 2, 1 },
+ { "PRBS_GEN_FRCERR", 1, 1 },
+ { "PRBS_GEN_OFF", 0, 1 },
+ { "XGMAC_PORT_AE_FSM_CTL", 0x25718, 0 },
+ { "FSM_TR_LCL", 14, 1 },
+ { "FSM_GDMRK", 11, 3 },
+ { "FSM_BADMRK", 8, 3 },
+ { "FSM_TR_FAIL", 7, 1 },
+ { "FSM_TR_ACT", 6, 1 },
+ { "FSM_FRM_LCK", 5, 1 },
+ { "FSM_TR_COMP", 4, 1 },
+ { "MC_RX_RDY", 3, 1 },
+ { "FSM_CU_DIS", 2, 1 },
+ { "FSM_TR_RST", 1, 1 },
+ { "FSM_TR_EN", 0, 1 },
+ { "XGMAC_PORT_AE_FSM_STATE", 0x2571c, 0 },
+ { "CC2FSM_STATE", 13, 3 },
+ { "CC1FSM_STATE", 10, 3 },
+ { "CC0FSM_STATE", 7, 3 },
+ { "FLFSM_STATE", 4, 3 },
+ { "TFSM_STATE", 0, 3 },
+ { "XGMAC_PORT_AE_TX_DIS", 0x25780, 0 },
+ { "XGMAC_PORT_AE_KR_CTRL", 0x25784, 0 },
+ { "Training_Enable", 1, 1 },
+ { "Restart_Training", 0, 1 },
+ { "XGMAC_PORT_AE_RX_SIGDET", 0x25788, 0 },
+ { "XGMAC_PORT_AE_KR_STATUS", 0x2578c, 0 },
+ { "Training_Failure", 3, 1 },
+ { "Training", 2, 1 },
+ { "Frame_Lock", 1, 1 },
+ { "RX_Trained", 0, 1 },
+ { "XGMAC_PORT_HSS_TXA_MODE_CFG", 0x25800, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TEST_CTRL", 0x25804, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXA_COEFF_CTRL", 0x25808, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXA_DRIVER_MODE", 0x2580c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_DRIVER_OVR_CTRL", 0x25810, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TDM_BIASGEN_STANDBY_TIMER", 0x25814, 0 },
+ { "XGMAC_PORT_HSS_TXA_TDM_BIASGEN_PWRON_TIMER", 0x25818, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_COEFF", 0x25820, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_COEFF", 0x25824, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_COEFF", 0x25828, 0 },
+ { "XGMAC_PORT_HSS_TXA_PWR", 0x25830, 0 },
+ { "XGMAC_PORT_HSS_TXA_POLARITY", 0x25834, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXA_8023AP_AE_CMD", 0x25838, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_8023AP_AE_STATUS", 0x2583c, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_IDAC_OVR", 0x25840, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_IDAC_OVR", 0x25844, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_IDAC_OVR", 0x25848, 0 },
+ { "XGMAC_PORT_HSS_TXA_PWR_DAC_OVR", 0x25850, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXA_PWR_DAC", 0x25854, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_IDAC_APP", 0x25860, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_IDAC_APP", 0x25864, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_IDAC_APP", 0x25868, 0 },
+ { "XGMAC_PORT_HSS_TXA_SEG_DIS_APP", 0x25870, 0 },
+ { "XGMAC_PORT_HSS_TXA_EXT_ADDR_DATA", 0x25878, 0 },
+ { "XGMAC_PORT_HSS_TXA_EXT_ADDR", 0x2587c, 0 },
+ { "XADDR", 1, 5 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_TXB_MODE_CFG", 0x25880, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TEST_CTRL", 0x25884, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXB_COEFF_CTRL", 0x25888, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXB_DRIVER_MODE", 0x2588c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_DRIVER_OVR_CTRL", 0x25890, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TDM_BIASGEN_STANDBY_TIMER", 0x25894, 0 },
+ { "XGMAC_PORT_HSS_TXB_TDM_BIASGEN_PWRON_TIMER", 0x25898, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_COEFF", 0x258a0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_COEFF", 0x258a4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_COEFF", 0x258a8, 0 },
+ { "XGMAC_PORT_HSS_TXB_PWR", 0x258b0, 0 },
+ { "XGMAC_PORT_HSS_TXB_POLARITY", 0x258b4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXB_8023AP_AE_CMD", 0x258b8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_8023AP_AE_STATUS", 0x258bc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_IDAC_OVR", 0x258c0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_IDAC_OVR", 0x258c4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_IDAC_OVR", 0x258c8, 0 },
+ { "XGMAC_PORT_HSS_TXB_PWR_DAC_OVR", 0x258d0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXB_PWR_DAC", 0x258d4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_IDAC_APP", 0x258e0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_IDAC_APP", 0x258e4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_IDAC_APP", 0x258e8, 0 },
+ { "XGMAC_PORT_HSS_TXB_SEG_DIS_APP", 0x258f0, 0 },
+ { "XGMAC_PORT_HSS_TXB_EXT_ADDR_DATA", 0x258f8, 0 },
+ { "XGMAC_PORT_HSS_TXB_EXT_ADDR", 0x258fc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_CFG_MODE", 0x25900, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXA_TEST_CTRL", 0x25904, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_CTRL", 0x25908, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_OFFSET_CTRL", 0x2590c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_POSITION1", 0x25910, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_POSITION2", 0x25914, 0 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_STATIC_PH_OFFSET", 0x25918, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_SIGDET_CTRL", 0x2591c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_CTRL", 0x25920, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_DATA_EDGE_SAMPLE", 0x25924, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_DFE_AMP_SAMPLE", 0x25928, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL1", 0x2592c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL2", 0x25930, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL3", 0x25934, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXA_DFE_D00_D01_OFFSET", 0x25938, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_D10_D11_OFFSET", 0x2593c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_E0_E1_OFFSET", 0x25940, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DACA_OFFSET", 0x25944, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_DACAP_DAC_AN_OFFSET", 0x25948, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_DACA_MIN", 0x2594c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_ADAC_CTRL", 0x25950, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXA_DIGITAL_EYE_CTRL", 0x25954, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DIGITAL_EYE_METRICS", 0x25958, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H1", 0x2595c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H2", 0x25960, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H3", 0x25964, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H4", 0x25968, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H5", 0x2596c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DAC_DPC", 0x25970, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DDC", 0x25974, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_INTERNAL_STATUS", 0x25978, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_FUNC_CTRL", 0x2597c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_CFG_MODE", 0x25980, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXB_TEST_CTRL", 0x25984, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_CTRL", 0x25988, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_OFFSET_CTRL", 0x2598c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_POSITION1", 0x25990, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_POSITION2", 0x25994, 0 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_STATIC_PH_OFFSET", 0x25998, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_SIGDET_CTRL", 0x2599c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_CTRL", 0x259a0, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_DATA_EDGE_SAMPLE", 0x259a4, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_DFE_AMP_SAMPLE", 0x259a8, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL1", 0x259ac, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL2", 0x259b0, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL3", 0x259b4, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXB_DFE_D00_D01_OFFSET", 0x259b8, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_D10_D11_OFFSET", 0x259bc, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_E0_E1_OFFSET", 0x259c0, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DACA_OFFSET", 0x259c4, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_DACAP_DAC_AN_OFFSET", 0x259c8, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_DACA_MIN", 0x259cc, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_ADAC_CTRL", 0x259d0, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXB_DIGITAL_EYE_CTRL", 0x259d4, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DIGITAL_EYE_METRICS", 0x259d8, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H1", 0x259dc, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H2", 0x259e0, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H3", 0x259e4, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H4", 0x259e8, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H5", 0x259ec, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DAC_DPC", 0x259f0, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DDC", 0x259f4, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_INTERNAL_STATUS", 0x259f8, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_FUNC_CTRL", 0x259fc, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_TXC_MODE_CFG", 0x25a00, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TEST_CTRL", 0x25a04, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXC_COEFF_CTRL", 0x25a08, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXC_DRIVER_MODE", 0x25a0c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_DRIVER_OVR_CTRL", 0x25a10, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TDM_BIASGEN_STANDBY_TIMER", 0x25a14, 0 },
+ { "XGMAC_PORT_HSS_TXC_TDM_BIASGEN_PWRON_TIMER", 0x25a18, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_COEFF", 0x25a20, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_COEFF", 0x25a24, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_COEFF", 0x25a28, 0 },
+ { "XGMAC_PORT_HSS_TXC_PWR", 0x25a30, 0 },
+ { "XGMAC_PORT_HSS_TXC_POLARITY", 0x25a34, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXC_8023AP_AE_CMD", 0x25a38, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_8023AP_AE_STATUS", 0x25a3c, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_IDAC_OVR", 0x25a40, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_IDAC_OVR", 0x25a44, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_IDAC_OVR", 0x25a48, 0 },
+ { "XGMAC_PORT_HSS_TXC_PWR_DAC_OVR", 0x25a50, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXC_PWR_DAC", 0x25a54, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_IDAC_APP", 0x25a60, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_IDAC_APP", 0x25a64, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_IDAC_APP", 0x25a68, 0 },
+ { "XGMAC_PORT_HSS_TXC_SEG_DIS_APP", 0x25a70, 0 },
+ { "XGMAC_PORT_HSS_TXC_EXT_ADDR_DATA", 0x25a78, 0 },
+ { "XGMAC_PORT_HSS_TXC_EXT_ADDR", 0x25a7c, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_TXD_MODE_CFG", 0x25a80, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TEST_CTRL", 0x25a84, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXD_COEFF_CTRL", 0x25a88, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXD_DRIVER_MODE", 0x25a8c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_DRIVER_OVR_CTRL", 0x25a90, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TDM_BIASGEN_STANDBY_TIMER", 0x25a94, 0 },
+ { "XGMAC_PORT_HSS_TXD_TDM_BIASGEN_PWRON_TIMER", 0x25a98, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_COEFF", 0x25aa0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_COEFF", 0x25aa4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_COEFF", 0x25aa8, 0 },
+ { "XGMAC_PORT_HSS_TXD_PWR", 0x25ab0, 0 },
+ { "XGMAC_PORT_HSS_TXD_POLARITY", 0x25ab4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXD_8023AP_AE_CMD", 0x25ab8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_8023AP_AE_STATUS", 0x25abc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_IDAC_OVR", 0x25ac0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_IDAC_OVR", 0x25ac4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_IDAC_OVR", 0x25ac8, 0 },
+ { "XGMAC_PORT_HSS_TXD_PWR_DAC_OVR", 0x25ad0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXD_PWR_DAC", 0x25ad4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_IDAC_APP", 0x25ae0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_IDAC_APP", 0x25ae4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_IDAC_APP", 0x25ae8, 0 },
+ { "XGMAC_PORT_HSS_TXD_SEG_DIS_APP", 0x25af0, 0 },
+ { "XGMAC_PORT_HSS_TXD_EXT_ADDR_DATA", 0x25af8, 0 },
+ { "XGMAC_PORT_HSS_TXD_EXT_ADDR", 0x25afc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_CFG_MODE", 0x25b00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXC_TEST_CTRL", 0x25b04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_CTRL", 0x25b08, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_OFFSET_CTRL", 0x25b0c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_POSITION1", 0x25b10, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_POSITION2", 0x25b14, 0 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_STATIC_PH_OFFSET", 0x25b18, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_SIGDET_CTRL", 0x25b1c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_CTRL", 0x25b20, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_DATA_EDGE_SAMPLE", 0x25b24, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_DFE_AMP_SAMPLE", 0x25b28, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL1", 0x25b2c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL2", 0x25b30, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL3", 0x25b34, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXC_DFE_D00_D01_OFFSET", 0x25b38, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_D10_D11_OFFSET", 0x25b3c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_E0_E1_OFFSET", 0x25b40, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DACA_OFFSET", 0x25b44, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_DACAP_DAC_AN_OFFSET", 0x25b48, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_DACA_MIN", 0x25b4c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_ADAC_CTRL", 0x25b50, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXC_DIGITAL_EYE_CTRL", 0x25b54, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DIGITAL_EYE_METRICS", 0x25b58, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H1", 0x25b5c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H2", 0x25b60, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H3", 0x25b64, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H4", 0x25b68, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H5", 0x25b6c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DAC_DPC", 0x25b70, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DDC", 0x25b74, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_INTERNAL_STATUS", 0x25b78, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_FUNC_CTRL", 0x25b7c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_CFG_MODE", 0x25b80, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXD_TEST_CTRL", 0x25b84, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_CTRL", 0x25b88, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_OFFSET_CTRL", 0x25b8c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_POSITION1", 0x25b90, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_POSITION2", 0x25b94, 0 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_STATIC_PH_OFFSET", 0x25b98, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_SIGDET_CTRL", 0x25b9c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_CTRL", 0x25ba0, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_DATA_EDGE_SAMPLE", 0x25ba4, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_DFE_AMP_SAMPLE", 0x25ba8, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL1", 0x25bac, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL2", 0x25bb0, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL3", 0x25bb4, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXD_DFE_D00_D01_OFFSET", 0x25bb8, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_D10_D11_OFFSET", 0x25bbc, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_E0_E1_OFFSET", 0x25bc0, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DACA_OFFSET", 0x25bc4, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_DACAP_DAC_AN_OFFSET", 0x25bc8, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_DACA_MIN", 0x25bcc, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_ADAC_CTRL", 0x25bd0, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXD_DIGITAL_EYE_CTRL", 0x25bd4, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DIGITAL_EYE_METRICS", 0x25bd8, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H1", 0x25bdc, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H2", 0x25be0, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H3", 0x25be4, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H4", 0x25be8, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H5", 0x25bec, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DAC_DPC", 0x25bf0, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DDC", 0x25bf4, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_INTERNAL_STATUS", 0x25bf8, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_FUNC_CTRL", 0x25bfc, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_0", 0x25c00, 0 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_1", 0x25c04, 0 },
+ { "LDET", 4, 1 },
+ { "CCERR", 3, 1 },
+ { "CCCMP", 2, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_2", 0x25c08, 0 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_3", 0x25c0c, 0 },
+ { "VISEL", 4, 1 },
+ { "FMIN", 3, 1 },
+ { "FMAX", 2, 1 },
+ { "CVHOLD", 1, 1 },
+ { "TCDIS", 0, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_4", 0x25c10, 0 },
+ { "CMETH", 2, 1 },
+ { "RECAL", 1, 1 },
+ { "CCLD", 0, 1 },
+ { "XGMAC_PORT_HSS_ANALOG_TEST_MUX", 0x25c14, 0 },
+ { "XGMAC_PORT_HSS_PORT_EN_0", 0x25c18, 0 },
+ { "RXDEN", 7, 1 },
+ { "RXCEN", 6, 1 },
+ { "TXDEN", 5, 1 },
+ { "TXCEN", 4, 1 },
+ { "RXBEN", 3, 1 },
+ { "RXAEN", 2, 1 },
+ { "TXBEN", 1, 1 },
+ { "TXAEN", 0, 1 },
+ { "XGMAC_PORT_HSS_PORT_RESET_0", 0x25c20, 0 },
+ { "RXDRST", 7, 1 },
+ { "RXCRST", 6, 1 },
+ { "TXDRST", 5, 1 },
+ { "TXCRST", 4, 1 },
+ { "RXBRST", 3, 1 },
+ { "RXARST", 2, 1 },
+ { "TXBRST", 1, 1 },
+ { "TXARST", 0, 1 },
+ { "XGMAC_PORT_HSS_CHARGE_PUMP_CTRL", 0x25c28, 0 },
+ { "ENCPIS", 2, 1 },
+ { "CPISEL", 0, 2 },
+ { "XGMAC_PORT_HSS_BAND_GAP_CTRL", 0x25c2c, 0 },
+ { "XGMAC_PORT_HSS_LOFREQ_OVR", 0x25c30, 0 },
+ { "LFREQ2", 3, 1 },
+ { "LFREQ1", 2, 1 },
+ { "LFREQO", 1, 1 },
+ { "LFSEL", 0, 1 },
+ { "XGMAC_PORT_HSS_VOLTAGE_BOOST_CTRL", 0x25c38, 0 },
+ { "PFVAL", 2, 1 },
+ { "PFEN", 1, 1 },
+ { "VBADJ", 0, 1 },
+ { "XGMAC_PORT_HSS_TX_MODE_CFG", 0x25c80, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXTEST_CTRL", 0x25c84, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TX_COEFF_CTRL", 0x25c88, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TX_DRIVER_MODE", 0x25c8c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_DRIVER_OVR_CTRL", 0x25c90, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_TDM_BIASGEN_STANDBY_TIMER", 0x25c94, 0 },
+ { "XGMAC_PORT_HSS_TX_TDM_BIASGEN_PWRON_TIMER", 0x25c98, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP0_COEFF", 0x25ca0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_COEFF", 0x25ca4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_COEFF", 0x25ca8, 0 },
+ { "XGMAC_PORT_HSS_TX_PWR", 0x25cb0, 0 },
+ { "XGMAC_PORT_HSS_TX_POLARITY", 0x25cb4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TX_8023AP_AE_CMD", 0x25cb8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_8023AP_AE_STATUS", 0x25cbc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_TAP0_IDAC_OVR", 0x25cc0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_IDAC_OVR", 0x25cc4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_IDAC_OVR", 0x25cc8, 0 },
+ { "XGMAC_PORT_HSS_TX_PWR_DAC_OVR", 0x25cd0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TX_PWR_DAC", 0x25cd4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP0_IDAC_APP", 0x25ce0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_IDAC_APP", 0x25ce4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_IDAC_APP", 0x25ce8, 0 },
+ { "XGMAC_PORT_HSS_TX_SEG_DIS_APP", 0x25cf0, 0 },
+ { "XGMAC_PORT_HSS_TX_EXT_ADDR_DATA", 0x25cf8, 0 },
+ { "XGMAC_PORT_HSS_TX_EXT_ADDR", 0x25cfc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_CFG_MODE", 0x25d00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXTEST_CTRL", 0x25d04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_CTRL", 0x25d08, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_OFFSET_CTRL", 0x25d0c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_POSITION1", 0x25d10, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_POSITION2", 0x25d14, 0 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_STATIC_PH_OFFSET", 0x25d18, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_SIGDET_CTRL", 0x25d1c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_CTRL", 0x25d20, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_DATA_EDGE_SAMPLE", 0x25d24, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_DFE_AMP_SAMPLE", 0x25d28, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL1", 0x25d2c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL2", 0x25d30, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL3", 0x25d34, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RX_DFE_D00_D01_OFFSET", 0x25d38, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_D10_D11_OFFSET", 0x25d3c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_E0_E1_OFFSET", 0x25d40, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DACA_OFFSET", 0x25d44, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_DACAP_DAC_AN_OFFSET", 0x25d48, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_DACA_MIN", 0x25d4c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_ADAC_CTRL", 0x25d50, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RX_DIGITAL_EYE_CTRL", 0x25d54, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DIGITAL_EYE_METRICS", 0x25d58, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_H1", 0x25d5c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_DFE_H2", 0x25d60, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_H3", 0x25d64, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DFE_H4", 0x25d68, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DFE_H5", 0x25d6c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DAC_DPC", 0x25d70, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DDC", 0x25d74, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_INTERNAL_STATUS", 0x25d78, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_FUNC_CTRL", 0x25d7c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_TXRX_CFG_MODE", 0x25e00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXRXTEST_CTRL", 0x25e04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_CFG", 0x27000, 0 },
+ { "XGMII_Clk_Sel", 29, 3 },
+ { "SinkTx", 27, 1 },
+ { "SinkTxOnLinkDown", 26, 1 },
+ { "xg2g_speed_mode", 25, 1 },
+ { "LoopNoFwd", 24, 1 },
+ { "XGM_Tx_pause_size", 23, 1 },
+ { "XGM_Tx_pause_frame", 22, 1 },
+ { "XGM_Tx_Disable_Pre", 21, 1 },
+ { "XGM_Tx_Disable_Crc", 20, 1 },
+ { "Smux_Rx_Loop", 19, 1 },
+ { "Rx_Lane_Swap", 18, 1 },
+ { "Tx_Lane_Swap", 17, 1 },
+ { "Signal_Det", 14, 1 },
+ { "Pmux_Rx_Loop", 13, 1 },
+ { "Pmux_Tx_Loop", 12, 1 },
+ { "XGM_Rx_Sel", 10, 2 },
+ { "PCS_Tx_Sel", 8, 2 },
+ { "XAUI20_Rem_Pre", 5, 1 },
+ { "XAUI20_XGMII_Sel", 4, 1 },
+ { "Rx_Byte_Swap", 3, 1 },
+ { "Tx_Byte_Swap", 2, 1 },
+ { "Port_Sel", 0, 1 },
+ { "XGMAC_PORT_RESET_CTRL", 0x27004, 0 },
+ { "AuxExt_Reset", 10, 1 },
+ { "TXFIFO_Reset", 9, 1 },
+ { "RXFIFO_Reset", 8, 1 },
+ { "BEAN_Reset", 7, 1 },
+ { "XAUI_Reset", 6, 1 },
+ { "AE_Reset", 5, 1 },
+ { "XGM_Reset", 4, 1 },
+ { "XG2G_Reset", 3, 1 },
+ { "WOL_Reset", 2, 1 },
+ { "XFI_PCS_Reset", 1, 1 },
+ { "HSS_Reset", 0, 1 },
+ { "XGMAC_PORT_LED_CFG", 0x27008, 0 },
+ { "Led1_Cfg", 5, 3 },
+ { "Led1_Polarity_Inv", 4, 1 },
+ { "Led0_Cfg", 1, 3 },
+ { "Led0_Polarity_Inv", 0, 1 },
+ { "XGMAC_PORT_LED_COUNTHI", 0x2700c, 0 },
+ { "XGMAC_PORT_LED_COUNTLO", 0x27010, 0 },
+ { "XGMAC_PORT_DEBUG_CFG", 0x27014, 0 },
+ { "XGMAC_PORT_CFG2", 0x27018, 0 },
+ { "Rx_Polarity_Inv", 28, 4 },
+ { "Tx_Polarity_Inv", 24, 4 },
+ { "InstanceNum", 22, 2 },
+ { "StopOnPerr", 21, 1 },
+ { "MACTxEn", 20, 1 },
+ { "MACRxEn", 19, 1 },
+ { "PatEn", 18, 1 },
+ { "MagicEn", 17, 1 },
+ { "TX_IPG", 4, 13 },
+ { "AEC_PMA_TX_READY", 1, 1 },
+ { "AEC_PMA_RX_READY", 0, 1 },
+ { "XGMAC_PORT_PKT_COUNT", 0x2701c, 0 },
+ { "tx_sop_count", 24, 8 },
+ { "tx_eop_count", 16, 8 },
+ { "rx_sop_count", 8, 8 },
+ { "rx_eop_count", 0, 8 },
+ { "XGMAC_PORT_PERR_INJECT", 0x27020, 0 },
+ { "MemSel", 1, 1 },
+ { "InjectDataErr", 0, 1 },
+ { "XGMAC_PORT_MAGIC_MACID_LO", 0x27024, 0 },
+ { "XGMAC_PORT_MAGIC_MACID_HI", 0x27028, 0 },
+ { "XGMAC_PORT_BUILD_REVISION", 0x2702c, 0 },
+ { "XGMAC_PORT_XGMII_SE_COUNT", 0x27030, 0 },
+ { "TxSop", 24, 8 },
+ { "TxEop", 16, 8 },
+ { "RxSop", 8, 8 },
+ { "RxEop", 0, 8 },
+ { "XGMAC_PORT_LINK_STATUS", 0x27034, 0 },
+ { "remflt", 3, 1 },
+ { "locflt", 2, 1 },
+ { "linkup", 1, 1 },
+ { "linkdn", 0, 1 },
+ { "XGMAC_PORT_CHECKIN", 0x27038, 0 },
+ { "Preamble", 1, 1 },
+ { "CheckIn", 0, 1 },
+ { "XGMAC_PORT_FAULT_TEST", 0x2703c, 0 },
+ { "FltType", 1, 1 },
+ { "FltCtrl", 0, 1 },
+ { "XGMAC_PORT_SPARE", 0x27040, 0 },
+ { "XGMAC_PORT_HSS_SIGDET_STATUS", 0x27044, 0 },
+ { "XGMAC_PORT_EXT_LOS_STATUS", 0x27048, 0 },
+ { "XGMAC_PORT_EXT_LOS_CTRL", 0x2704c, 0 },
+ { "XGMAC_PORT_FPGA_PAUSE_CTL", 0x27050, 0 },
+ { "CTL", 31, 1 },
+ { "HWM", 13, 13 },
+ { "LWM", 0, 13 },
+ { "XGMAC_PORT_FPGA_ERRPKT_CNT", 0x27054, 0 },
+ { "XGMAC_PORT_LA_TX_0", 0x27058, 0 },
+ { "XGMAC_PORT_LA_RX_0", 0x2705c, 0 },
+ { "XGMAC_PORT_FPGA_LA_CTL", 0x27060, 0 },
+ { "rxrst", 5, 1 },
+ { "txrst", 4, 1 },
+ { "xgmii", 3, 1 },
+ { "pause", 2, 1 },
+ { "stopErr", 1, 1 },
+ { "stop", 0, 1 },
+ { "XGMAC_PORT_EPIO_DATA0", 0x270c0, 0 },
+ { "XGMAC_PORT_EPIO_DATA1", 0x270c4, 0 },
+ { "XGMAC_PORT_EPIO_DATA2", 0x270c8, 0 },
+ { "XGMAC_PORT_EPIO_DATA3", 0x270cc, 0 },
+ { "XGMAC_PORT_EPIO_OP", 0x270d0, 0 },
+ { "Busy", 31, 1 },
+ { "Write", 8, 1 },
+ { "Address", 0, 8 },
+ { "XGMAC_PORT_WOL_STATUS", 0x270d4, 0 },
+ { "MagicDetected", 31, 1 },
+ { "PatDetected", 30, 1 },
+ { "ClearMagic", 4, 1 },
+ { "ClearMatch", 3, 1 },
+ { "MatchedFilter", 0, 3 },
+ { "XGMAC_PORT_INT_EN", 0x270d8, 0 },
+ { "ext_los", 28, 1 },
+ { "incmptbl_link", 27, 1 },
+ { "PatDetWake", 26, 1 },
+ { "MagicWake", 25, 1 },
+ { "SigDetChg", 24, 1 },
+ { "PCSR_fec_corr", 23, 1 },
+ { "AE_Train_Local", 22, 1 },
+ { "HSSPLL_LOCK", 21, 1 },
+ { "HSSPRT_READY", 20, 1 },
+ { "AutoNeg_Done", 19, 1 },
+ { "PCSR_Hi_BER", 18, 1 },
+ { "PCSR_FEC_Error", 17, 1 },
+ { "PCSR_Link_Fail", 16, 1 },
+ { "XAUI_Dec_Error", 15, 1 },
+ { "XAUI_Link_Fail", 14, 1 },
+ { "PCS_CTC_Error", 13, 1 },
+ { "PCS_Link_Good", 12, 1 },
+ { "PCS_Link_Fail", 11, 1 },
+ { "RxFifoOverFlow", 10, 1 },
+ { "HSSPRBSErr", 9, 1 },
+ { "HSSEyeQual", 8, 1 },
+ { "RemoteFault", 7, 1 },
+ { "LocalFault", 6, 1 },
+ { "MAC_Link_Down", 5, 1 },
+ { "MAC_Link_Up", 4, 1 },
+ { "BEAN_Int", 3, 1 },
+ { "XGM_Int", 2, 1 },
+ { "TxFifo_prty_err", 1, 1 },
+ { "RxFifo_prty_err", 0, 1 },
+ { "XGMAC_PORT_INT_CAUSE", 0x270dc, 0 },
+ { "ext_los", 28, 1 },
+ { "incmptbl_link", 27, 1 },
+ { "PatDetWake", 26, 1 },
+ { "MagicWake", 25, 1 },
+ { "SigDetChg", 24, 1 },
+ { "PCSR_fec_corr", 23, 1 },
+ { "AE_Train_Local", 22, 1 },
+ { "HSSPLL_LOCK", 21, 1 },
+ { "HSSPRT_READY", 20, 1 },
+ { "AutoNeg_Done", 19, 1 },
+ { "PCSR_Hi_BER", 18, 1 },
+ { "PCSR_FEC_Error", 17, 1 },
+ { "PCSR_Link_Fail", 16, 1 },
+ { "XAUI_Dec_Error", 15, 1 },
+ { "XAUI_Link_Fail", 14, 1 },
+ { "PCS_CTC_Error", 13, 1 },
+ { "PCS_Link_Good", 12, 1 },
+ { "PCS_Link_Fail", 11, 1 },
+ { "RxFifoOverFlow", 10, 1 },
+ { "HSSPRBSErr", 9, 1 },
+ { "HSSEyeQual", 8, 1 },
+ { "RemoteFault", 7, 1 },
+ { "LocalFault", 6, 1 },
+ { "MAC_Link_Down", 5, 1 },
+ { "MAC_Link_Up", 4, 1 },
+ { "BEAN_Int", 3, 1 },
+ { "XGM_Int", 2, 1 },
+ { "TxFifo_prty_err", 1, 1 },
+ { "RxFifo_prty_err", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG0", 0x270e0, 0 },
+ { "TXDTS", 31, 1 },
+ { "TXCTS", 30, 1 },
+ { "TXBTS", 29, 1 },
+ { "TXATS", 28, 1 },
+ { "TXDOBS", 27, 1 },
+ { "TXCOBS", 26, 1 },
+ { "TXBOBS", 25, 1 },
+ { "TXAOBS", 24, 1 },
+ { "HSSREFCLKSEL", 20, 1 },
+ { "HSSAVDHI", 17, 1 },
+ { "HSSRXTS", 16, 1 },
+ { "HSSTXACMODE", 15, 1 },
+ { "HSSRXACMODE", 14, 1 },
+ { "HSSRESYNC", 13, 1 },
+ { "HSSRECCAL", 12, 1 },
+ { "HSSPDWNPLL", 11, 1 },
+ { "HSSDIVSEL", 9, 2 },
+ { "HSSREFDIV", 8, 1 },
+ { "HSSPLLBYP", 7, 1 },
+ { "HSSLOFREQPLL", 6, 1 },
+ { "HSSLOFREQ2PLL", 5, 1 },
+ { "HSSEXTC16SEL", 4, 1 },
+ { "HSSRSTCONFIG", 1, 3 },
+ { "HSSPRBSEN", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG1", 0x270e4, 0 },
+ { "RXDPRBSRST", 28, 1 },
+ { "RXDPRBSEN", 27, 1 },
+ { "RXDPRBSFRCERR", 26, 1 },
+ { "TXDPRBSRST", 25, 1 },
+ { "TXDPRBSEN", 24, 1 },
+ { "RXCPRBSRST", 20, 1 },
+ { "RXCPRBSEN", 19, 1 },
+ { "RXCPRBSFRCERR", 18, 1 },
+ { "TXCPRBSRST", 17, 1 },
+ { "TXCPRBSEN", 16, 1 },
+ { "RXBPRBSRST", 12, 1 },
+ { "RXBPRBSEN", 11, 1 },
+ { "RXBPRBSFRCERR", 10, 1 },
+ { "TXBPRBSRST", 9, 1 },
+ { "TXBPRBSEN", 8, 1 },
+ { "RXAPRBSRST", 4, 1 },
+ { "RXAPRBSEN", 3, 1 },
+ { "RXAPRBSFRCERR", 2, 1 },
+ { "TXAPRBSRST", 1, 1 },
+ { "TXAPRBSEN", 0, 1 },
+ { "XGMAC_PORT_HSS_CFG2", 0x270e8, 0 },
+ { "RXDDATASYNC", 23, 1 },
+ { "RXCDATASYNC", 22, 1 },
+ { "RXBDATASYNC", 21, 1 },
+ { "RXADATASYNC", 20, 1 },
+ { "RXDEARLYIN", 19, 1 },
+ { "RXDLATEIN", 18, 1 },
+ { "RXDPHSLOCK", 17, 1 },
+ { "RXDPHSDNIN", 16, 1 },
+ { "RXDPHSUPIN", 15, 1 },
+ { "RXCEARLYIN", 14, 1 },
+ { "RXCLATEIN", 13, 1 },
+ { "RXCPHSLOCK", 12, 1 },
+ { "RXCPHSDNIN", 11, 1 },
+ { "RXCPHSUPIN", 10, 1 },
+ { "RXBEARLYIN", 9, 1 },
+ { "RXBLATEIN", 8, 1 },
+ { "RXBPHSLOCK", 7, 1 },
+ { "RXBPHSDNIN", 6, 1 },
+ { "RXBPHSUPIN", 5, 1 },
+ { "RXAEARLYIN", 4, 1 },
+ { "RXALATEIN", 3, 1 },
+ { "RXAPHSLOCK", 2, 1 },
+ { "RXAPHSDNIN", 1, 1 },
+ { "RXAPHSUPIN", 0, 1 },
+ { "XGMAC_PORT_HSS_STATUS", 0x270ec, 0 },
+ { "RXDPRBSSYNC", 15, 1 },
+ { "RXCPRBSSYNC", 14, 1 },
+ { "RXBPRBSSYNC", 13, 1 },
+ { "RXAPRBSSYNC", 12, 1 },
+ { "RXDPRBSERR", 11, 1 },
+ { "RXCPRBSERR", 10, 1 },
+ { "RXBPRBSERR", 9, 1 },
+ { "RXAPRBSERR", 8, 1 },
+ { "RXDSIGDET", 7, 1 },
+ { "RXCSIGDET", 6, 1 },
+ { "RXBSIGDET", 5, 1 },
+ { "RXASIGDET", 4, 1 },
+ { "HSSPLLLOCK", 1, 1 },
+ { "HSSPRTREADY", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_CTRL", 0x27200, 0 },
+ { "SendPause", 2, 1 },
+ { "SendZeroPause", 1, 1 },
+ { "TxEn", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_CFG", 0x27204, 0 },
+ { "CRCCal", 8, 2 },
+ { "DisDefIdleCnt", 7, 1 },
+ { "DecAvgTxIPG", 6, 1 },
+ { "UnidirTxEn", 5, 1 },
+ { "CfgClkSpeed", 2, 3 },
+ { "StretchMode", 1, 1 },
+ { "TxPauseEn", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_PAUSE_QUANTA", 0x27208, 0 },
+ { "XGMAC_PORT_XGM_RX_CTRL", 0x2720c, 0 },
+ { "XGMAC_PORT_XGM_RX_CFG", 0x27210, 0 },
+ { "CRCCal", 16, 2 },
+ { "LocalFault", 15, 1 },
+ { "RemoteFault", 14, 1 },
+ { "LenErrFrameDis", 13, 1 },
+ { "Con802_3Preamble", 12, 1 },
+ { "EnNon802_3Preamble", 11, 1 },
+ { "CopyPreamble", 10, 1 },
+ { "DisPauseFrames", 9, 1 },
+ { "En1536BFrames", 8, 1 },
+ { "EnJumbo", 7, 1 },
+ { "RmFCS", 6, 1 },
+ { "DisNonVlan", 5, 1 },
+ { "EnExtMatch", 4, 1 },
+ { "EnHashUcast", 3, 1 },
+ { "EnHashMcast", 2, 1 },
+ { "DisBCast", 1, 1 },
+ { "CopyAllFrames", 0, 1 },
+ { "XGMAC_PORT_XGM_RX_HASH_LOW", 0x27214, 0 },
+ { "XGMAC_PORT_XGM_RX_HASH_HIGH", 0x27218, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_1", 0x2721c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_1", 0x27220, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_2", 0x27224, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_2", 0x27228, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_3", 0x2722c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_3", 0x27230, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_4", 0x27234, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_4", 0x27238, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_5", 0x2723c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_5", 0x27240, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_6", 0x27244, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_6", 0x27248, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_7", 0x2724c, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_7", 0x27250, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_LOW_8", 0x27254, 0 },
+ { "XGMAC_PORT_XGM_RX_EXACT_MATCH_HIGH_8", 0x27258, 0 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_1", 0x2725c, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_2", 0x27260, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_3", 0x27264, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_RX_TYPE_MATCH_4", 0x27268, 0 },
+ { "EnTypeMatch", 31, 1 },
+ { "type", 0, 16 },
+ { "XGMAC_PORT_XGM_INT_STATUS", 0x2726c, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_MASK", 0x27270, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_EN", 0x27274, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_INT_DISABLE", 0x27278, 0 },
+ { "XGMIIExtInt", 10, 1 },
+ { "LinkFaultChange", 9, 1 },
+ { "PhyFrameComplete", 8, 1 },
+ { "PauseFrameTxmt", 7, 1 },
+ { "PauseCntrTimeOut", 6, 1 },
+ { "Non0PauseRcvd", 5, 1 },
+ { "StatOFlow", 4, 1 },
+ { "TxErrFIFO", 3, 1 },
+ { "TxUFlow", 2, 1 },
+ { "FrameTxmt", 1, 1 },
+ { "FrameRcvd", 0, 1 },
+ { "XGMAC_PORT_XGM_TX_PAUSE_TIMER", 0x2727c, 0 },
+ { "XGMAC_PORT_XGM_STAT_CTRL", 0x27280, 0 },
+ { "ReadSnpShot", 4, 1 },
+ { "TakeSnpShot", 3, 1 },
+ { "ClrStats", 2, 1 },
+ { "IncrStats", 1, 1 },
+ { "EnTestModeWr", 0, 1 },
+ { "XGMAC_PORT_XGM_MDIO_CTRL", 0x27284, 0 },
+ { "FrameType", 30, 2 },
+ { "Operation", 28, 2 },
+ { "PortAddr", 23, 5 },
+ { "DevAddr", 18, 5 },
+ { "Resrv", 16, 2 },
+ { "Data", 0, 16 },
+ { "XGMAC_PORT_XGM_MODULE_ID", 0x272fc, 0 },
+ { "ModuleID", 16, 16 },
+ { "ModuleRev", 0, 16 },
+ { "XGMAC_PORT_XGM_STAT_TX_BYTE_LOW", 0x27300, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_BYTE_HIGH", 0x27304, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_FRAME_LOW", 0x27308, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_FRAME_HIGH", 0x2730c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_BCAST", 0x27310, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_MCAST", 0x27314, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_PAUSE", 0x27318, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_64B_FRAMES", 0x2731c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_65_127B_FRAMES", 0x27320, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_128_255B_FRAMES", 0x27324, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_256_511B_FRAMES", 0x27328, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_512_1023B_FRAMES", 0x2732c, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_1024_1518B_FRAMES", 0x27330, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_1519_MAXB_FRAMES", 0x27334, 0 },
+ { "XGMAC_PORT_XGM_STAT_TX_ERR_FRAMES", 0x27338, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BYTES_LOW", 0x2733c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BYTES_HIGH", 0x27340, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_FRAMES_LOW", 0x27344, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_FRAMES_HIGH", 0x27348, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_BCAST_FRAMES", 0x2734c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_MCAST_FRAMES", 0x27350, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_PAUSE_FRAMES", 0x27354, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_64B_FRAMES", 0x27358, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_65_127B_FRAMES", 0x2735c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_128_255B_FRAMES", 0x27360, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_256_511B_FRAMES", 0x27364, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_512_1023B_FRAMES", 0x27368, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_1024_1518B_FRAMES", 0x2736c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_1519_MAXB_FRAMES", 0x27370, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_SHORT_FRAMES", 0x27374, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_OVERSIZE_FRAMES", 0x27378, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_JABBER_FRAMES", 0x2737c, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_CRC_ERR_FRAMES", 0x27380, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_LENGTH_ERR_FRAMES", 0x27384, 0 },
+ { "XGMAC_PORT_XGM_STAT_RX_SYM_CODE_ERR_FRAMES", 0x27388, 0 },
+ { "XGMAC_PORT_XAUI_CTRL", 0x27400, 0 },
+ { "polarity_inv_rx", 8, 4 },
+ { "polarity_inv_tx", 4, 4 },
+ { "test_sel", 2, 2 },
+ { "test_en", 0, 1 },
+ { "XGMAC_PORT_XAUI_STATUS", 0x27404, 0 },
+ { "Decode_Error", 12, 8 },
+ { "Lane3_CTC_Status", 11, 1 },
+ { "Lane2_CTC_Status", 10, 1 },
+ { "Lane1_CTC_Status", 9, 1 },
+ { "Lane0_CTC_Status", 8, 1 },
+ { "Align_Status", 4, 1 },
+ { "Lane3_Sync_Status", 3, 1 },
+ { "Lane2_Sync_Status", 2, 1 },
+ { "Lane1_Sync_Status", 1, 1 },
+ { "Lane0_Sync_Status", 0, 1 },
+ { "XGMAC_PORT_PCSR_CTRL", 0x27500, 0 },
+ { "rx_clk_speed", 7, 1 },
+ { "ScrBypass", 6, 1 },
+ { "FECErrIndEn", 5, 1 },
+ { "FECEn", 4, 1 },
+ { "TestSel", 2, 2 },
+ { "ScrLoopEn", 1, 1 },
+ { "XGMIILoopEn", 0, 1 },
+ { "XGMAC_PORT_PCSR_TXTEST_CTRL", 0x27510, 0 },
+ { "tx_prbs9_en", 4, 1 },
+ { "tx_prbs31_en", 3, 1 },
+ { "tx_tst_dat_sel", 2, 1 },
+ { "tx_tst_sel", 1, 1 },
+ { "tx_tst_en", 0, 1 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDA_LOWER", 0x27514, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDA_UPPER", 0x27518, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDB_LOWER", 0x2752c, 0 },
+ { "XGMAC_PORT_PCSR_TXTEST_SEEDB_UPPER", 0x27530, 0 },
+ { "XGMAC_PORT_PCSR_RXTEST_CTRL", 0x2753c, 0 },
+ { "tpter_cnt_rst", 7, 1 },
+ { "test_cnt_125us", 6, 1 },
+ { "test_cnt_pre", 5, 1 },
+ { "ber_cnt_rst", 4, 1 },
+ { "err_blk_cnt_rst", 3, 1 },
+ { "rx_prbs31_en", 2, 1 },
+ { "rx_tst_dat_sel", 1, 1 },
+ { "rx_tst_en", 0, 1 },
+ { "XGMAC_PORT_PCSR_STATUS", 0x27550, 0 },
+ { "err_blk_cnt", 16, 8 },
+ { "ber_count", 8, 6 },
+ { "hi_ber", 2, 1 },
+ { "rx_fault", 1, 1 },
+ { "tx_fault", 0, 1 },
+ { "XGMAC_PORT_PCSR_TEST_STATUS", 0x27554, 0 },
+ { "XGMAC_PORT_AN_CONTROL", 0x27600, 0 },
+ { "soft_reset", 15, 1 },
+ { "an_enable", 12, 1 },
+ { "restart_an", 9, 1 },
+ { "XGMAC_PORT_AN_STATUS", 0x27604, 0 },
+ { "Noncer_Match", 31, 1 },
+ { "Parallel_Det_Fault", 9, 1 },
+ { "Page_Received", 6, 1 },
+ { "AN_Complete", 5, 1 },
+ { "Remote_Fault", 4, 1 },
+ { "AN_Ability", 3, 1 },
+ { "link_status", 2, 1 },
+ { "partner_an_ability", 0, 1 },
+ { "XGMAC_PORT_AN_ADVERTISEMENT", 0x27608, 0 },
+ { "FEC_Enable", 31, 1 },
+ { "FEC_Ability", 30, 1 },
+ { "10GBASE_KR_Capable", 23, 1 },
+ { "10GBASE_KX4_Capable", 22, 1 },
+ { "1000BASE_KX_Capable", 21, 1 },
+ { "Transmitted_Nonce", 16, 5 },
+ { "NP", 15, 1 },
+ { "ACK", 14, 1 },
+ { "Remote_Fault", 13, 1 },
+ { "ASM_DIR", 11, 1 },
+ { "Pause", 10, 1 },
+ { "Echoed_Nonce", 5, 5 },
+ { "XGMAC_PORT_AN_LINK_PARTNER_ABILITY", 0x2760c, 0 },
+ { "FEC_Enable", 31, 1 },
+ { "FEC_Ability", 30, 1 },
+ { "10GBASE_KR_Capable", 23, 1 },
+ { "10GBASE_KX4_Capable", 22, 1 },
+ { "1000BASE_KX_Capable", 21, 1 },
+ { "Transmitted_Nonce", 16, 5 },
+ { "NP", 15, 1 },
+ { "ACK", 14, 1 },
+ { "Remote_Fault", 13, 1 },
+ { "ASM_DIR", 11, 1 },
+ { "Pause", 10, 1 },
+ { "Echoed_Nonce", 5, 5 },
+ { "Selector_Field", 0, 5 },
+ { "XGMAC_PORT_AN_NP_LOWER_TRANSMIT", 0x27610, 0 },
+ { "NP_Info", 16, 16 },
+ { "NP_Indication", 15, 1 },
+ { "Message_Page", 13, 1 },
+ { "ACK_2", 12, 1 },
+ { "Toggle", 11, 1 },
+ { "XGMAC_PORT_AN_NP_UPPER_TRANSMIT", 0x27614, 0 },
+ { "XGMAC_PORT_AN_LP_NP_LOWER", 0x27618, 0 },
+ { "XGMAC_PORT_AN_LP_NP_UPPER", 0x2761c, 0 },
+ { "XGMAC_PORT_AN_BACKPLANE_ETHERNET_STATUS", 0x27624, 0 },
+ { "TX_Pause_Okay", 6, 1 },
+ { "RX_Pause_Okay", 5, 1 },
+ { "10GBASE_KR_FEC_neg", 4, 1 },
+ { "10GBASE_KR_neg", 3, 1 },
+ { "10GBASE_KX4_neg", 2, 1 },
+ { "1000BASE_KX_neg", 1, 1 },
+ { "BP_AN_Ability", 0, 1 },
+ { "XGMAC_PORT_AN_TX_NONCE_CONTROL", 0x27628, 0 },
+ { "Bypass_LFSR", 15, 1 },
+ { "LFSR_Init", 0, 15 },
+ { "XGMAC_PORT_AN_INTERRUPT_STATUS", 0x2762c, 0 },
+ { "NP_From_LP", 3, 1 },
+ { "Parallel_Det_Fault", 2, 1 },
+ { "BP_From_LP", 1, 1 },
+ { "PCS_AN_Complete", 0, 1 },
+ { "XGMAC_PORT_AN_GENERIC_TIMER_TIMEOUT", 0x27630, 0 },
+ { "XGMAC_PORT_AN_BREAK_LINK_TIMEOUT", 0x27634, 0 },
+ { "XGMAC_PORT_AN_MODULE_ID", 0x2763c, 0 },
+ { "Module_ID", 16, 16 },
+ { "Module_Revision", 0, 16 },
+ { "XGMAC_PORT_AE_RX_COEF_REQ", 0x27700, 0 },
+ { "RXREQ_CPRE", 13, 1 },
+ { "RXREQ_CINIT", 12, 1 },
+ { "RXREQ_C0", 4, 2 },
+ { "RXREQ_C1", 2, 2 },
+ { "RXREQ_C2", 0, 2 },
+ { "XGMAC_PORT_AE_RX_COEF_STAT", 0x27704, 0 },
+ { "RXSTAT_RDY", 15, 1 },
+ { "RXSTAT_C0", 4, 2 },
+ { "RXSTAT_C1", 2, 2 },
+ { "RXSTAT_C2", 0, 2 },
+ { "XGMAC_PORT_AE_TX_COEF_REQ", 0x27708, 0 },
+ { "TXREQ_CPRE", 13, 1 },
+ { "TXREQ_CINIT", 12, 1 },
+ { "TXREQ_C0", 4, 2 },
+ { "TXREQ_C1", 2, 2 },
+ { "TXREQ_C2", 0, 2 },
+ { "XGMAC_PORT_AE_TX_COEF_STAT", 0x2770c, 0 },
+ { "TXSTAT_RDY", 15, 1 },
+ { "TXSTAT_C0", 4, 2 },
+ { "TXSTAT_C1", 2, 2 },
+ { "TXSTAT_C2", 0, 2 },
+ { "XGMAC_PORT_AE_REG_MODE", 0x27710, 0 },
+ { "MAN_DEC", 4, 2 },
+ { "MANUAL_RDY", 3, 1 },
+ { "MWT_DISABLE", 2, 1 },
+ { "MDIO_OVR", 1, 1 },
+ { "STICKY_MODE", 0, 1 },
+ { "XGMAC_PORT_AE_PRBS_CTL", 0x27714, 0 },
+ { "PRBS_CHK_ERRCNT", 8, 8 },
+ { "PRBS_SYNCCNT", 5, 3 },
+ { "PRBS_CHK_SYNC", 4, 1 },
+ { "PRBS_CHK_RST", 3, 1 },
+ { "PRBS_CHK_OFF", 2, 1 },
+ { "PRBS_GEN_FRCERR", 1, 1 },
+ { "PRBS_GEN_OFF", 0, 1 },
+ { "XGMAC_PORT_AE_FSM_CTL", 0x27718, 0 },
+ { "FSM_TR_LCL", 14, 1 },
+ { "FSM_GDMRK", 11, 3 },
+ { "FSM_BADMRK", 8, 3 },
+ { "FSM_TR_FAIL", 7, 1 },
+ { "FSM_TR_ACT", 6, 1 },
+ { "FSM_FRM_LCK", 5, 1 },
+ { "FSM_TR_COMP", 4, 1 },
+ { "MC_RX_RDY", 3, 1 },
+ { "FSM_CU_DIS", 2, 1 },
+ { "FSM_TR_RST", 1, 1 },
+ { "FSM_TR_EN", 0, 1 },
+ { "XGMAC_PORT_AE_FSM_STATE", 0x2771c, 0 },
+ { "CC2FSM_STATE", 13, 3 },
+ { "CC1FSM_STATE", 10, 3 },
+ { "CC0FSM_STATE", 7, 3 },
+ { "FLFSM_STATE", 4, 3 },
+ { "TFSM_STATE", 0, 3 },
+ { "XGMAC_PORT_AE_TX_DIS", 0x27780, 0 },
+ { "XGMAC_PORT_AE_KR_CTRL", 0x27784, 0 },
+ { "Training_Enable", 1, 1 },
+ { "Restart_Training", 0, 1 },
+ { "XGMAC_PORT_AE_RX_SIGDET", 0x27788, 0 },
+ { "XGMAC_PORT_AE_KR_STATUS", 0x2778c, 0 },
+ { "Training_Failure", 3, 1 },
+ { "Training", 2, 1 },
+ { "Frame_Lock", 1, 1 },
+ { "RX_Trained", 0, 1 },
+ { "XGMAC_PORT_HSS_TXA_MODE_CFG", 0x27800, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TEST_CTRL", 0x27804, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXA_COEFF_CTRL", 0x27808, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXA_DRIVER_MODE", 0x2780c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_DRIVER_OVR_CTRL", 0x27810, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TDM_BIASGEN_STANDBY_TIMER", 0x27814, 0 },
+ { "XGMAC_PORT_HSS_TXA_TDM_BIASGEN_PWRON_TIMER", 0x27818, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_COEFF", 0x27820, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_COEFF", 0x27824, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_COEFF", 0x27828, 0 },
+ { "XGMAC_PORT_HSS_TXA_PWR", 0x27830, 0 },
+ { "XGMAC_PORT_HSS_TXA_POLARITY", 0x27834, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXA_8023AP_AE_CMD", 0x27838, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_8023AP_AE_STATUS", 0x2783c, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_IDAC_OVR", 0x27840, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_IDAC_OVR", 0x27844, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_IDAC_OVR", 0x27848, 0 },
+ { "XGMAC_PORT_HSS_TXA_PWR_DAC_OVR", 0x27850, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXA_PWR_DAC", 0x27854, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP0_IDAC_APP", 0x27860, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP1_IDAC_APP", 0x27864, 0 },
+ { "XGMAC_PORT_HSS_TXA_TAP2_IDAC_APP", 0x27868, 0 },
+ { "XGMAC_PORT_HSS_TXA_SEG_DIS_APP", 0x27870, 0 },
+ { "XGMAC_PORT_HSS_TXA_EXT_ADDR_DATA", 0x27878, 0 },
+ { "XGMAC_PORT_HSS_TXA_EXT_ADDR", 0x2787c, 0 },
+ { "XADDR", 1, 5 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_TXB_MODE_CFG", 0x27880, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TEST_CTRL", 0x27884, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXB_COEFF_CTRL", 0x27888, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXB_DRIVER_MODE", 0x2788c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_DRIVER_OVR_CTRL", 0x27890, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TDM_BIASGEN_STANDBY_TIMER", 0x27894, 0 },
+ { "XGMAC_PORT_HSS_TXB_TDM_BIASGEN_PWRON_TIMER", 0x27898, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_COEFF", 0x278a0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_COEFF", 0x278a4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_COEFF", 0x278a8, 0 },
+ { "XGMAC_PORT_HSS_TXB_PWR", 0x278b0, 0 },
+ { "XGMAC_PORT_HSS_TXB_POLARITY", 0x278b4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXB_8023AP_AE_CMD", 0x278b8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_8023AP_AE_STATUS", 0x278bc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_IDAC_OVR", 0x278c0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_IDAC_OVR", 0x278c4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_IDAC_OVR", 0x278c8, 0 },
+ { "XGMAC_PORT_HSS_TXB_PWR_DAC_OVR", 0x278d0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXB_PWR_DAC", 0x278d4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP0_IDAC_APP", 0x278e0, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP1_IDAC_APP", 0x278e4, 0 },
+ { "XGMAC_PORT_HSS_TXB_TAP2_IDAC_APP", 0x278e8, 0 },
+ { "XGMAC_PORT_HSS_TXB_SEG_DIS_APP", 0x278f0, 0 },
+ { "XGMAC_PORT_HSS_TXB_EXT_ADDR_DATA", 0x278f8, 0 },
+ { "XGMAC_PORT_HSS_TXB_EXT_ADDR", 0x278fc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_CFG_MODE", 0x27900, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXA_TEST_CTRL", 0x27904, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_CTRL", 0x27908, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_OFFSET_CTRL", 0x2790c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_POSITION1", 0x27910, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_POSITION2", 0x27914, 0 },
+ { "XGMAC_PORT_HSS_RXA_PH_ROTATOR_STATIC_PH_OFFSET", 0x27918, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_SIGDET_CTRL", 0x2791c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_CTRL", 0x27920, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_DATA_EDGE_SAMPLE", 0x27924, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_DFE_AMP_SAMPLE", 0x27928, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL1", 0x2792c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL2", 0x27930, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_VGA_CTRL3", 0x27934, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXA_DFE_D00_D01_OFFSET", 0x27938, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_D10_D11_OFFSET", 0x2793c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_E0_E1_OFFSET", 0x27940, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DACA_OFFSET", 0x27944, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_DACAP_DAC_AN_OFFSET", 0x27948, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_DACA_MIN", 0x2794c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXA_ADAC_CTRL", 0x27950, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXA_DIGITAL_EYE_CTRL", 0x27954, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DIGITAL_EYE_METRICS", 0x27958, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H1", 0x2795c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H2", 0x27960, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H3", 0x27964, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H4", 0x27968, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DFE_H5", 0x2796c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DAC_DPC", 0x27970, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXA_DDC", 0x27974, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXA_INTERNAL_STATUS", 0x27978, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXA_DFE_FUNC_CTRL", 0x2797c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_CFG_MODE", 0x27980, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXB_TEST_CTRL", 0x27984, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_CTRL", 0x27988, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_OFFSET_CTRL", 0x2798c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_POSITION1", 0x27990, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_POSITION2", 0x27994, 0 },
+ { "XGMAC_PORT_HSS_RXB_PH_ROTATOR_STATIC_PH_OFFSET", 0x27998, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_SIGDET_CTRL", 0x2799c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_CTRL", 0x279a0, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_DATA_EDGE_SAMPLE", 0x279a4, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_DFE_AMP_SAMPLE", 0x279a8, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL1", 0x279ac, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL2", 0x279b0, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_VGA_CTRL3", 0x279b4, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXB_DFE_D00_D01_OFFSET", 0x279b8, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_D10_D11_OFFSET", 0x279bc, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_E0_E1_OFFSET", 0x279c0, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DACA_OFFSET", 0x279c4, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_DACAP_DAC_AN_OFFSET", 0x279c8, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_DACA_MIN", 0x279cc, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXB_ADAC_CTRL", 0x279d0, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXB_DIGITAL_EYE_CTRL", 0x279d4, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DIGITAL_EYE_METRICS", 0x279d8, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H1", 0x279dc, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H2", 0x279e0, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H3", 0x279e4, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H4", 0x279e8, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DFE_H5", 0x279ec, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DAC_DPC", 0x279f0, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXB_DDC", 0x279f4, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXB_INTERNAL_STATUS", 0x279f8, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXB_DFE_FUNC_CTRL", 0x279fc, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_TXC_MODE_CFG", 0x27a00, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TEST_CTRL", 0x27a04, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXC_COEFF_CTRL", 0x27a08, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXC_DRIVER_MODE", 0x27a0c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_DRIVER_OVR_CTRL", 0x27a10, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TDM_BIASGEN_STANDBY_TIMER", 0x27a14, 0 },
+ { "XGMAC_PORT_HSS_TXC_TDM_BIASGEN_PWRON_TIMER", 0x27a18, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_COEFF", 0x27a20, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_COEFF", 0x27a24, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_COEFF", 0x27a28, 0 },
+ { "XGMAC_PORT_HSS_TXC_PWR", 0x27a30, 0 },
+ { "XGMAC_PORT_HSS_TXC_POLARITY", 0x27a34, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXC_8023AP_AE_CMD", 0x27a38, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_8023AP_AE_STATUS", 0x27a3c, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_IDAC_OVR", 0x27a40, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_IDAC_OVR", 0x27a44, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_IDAC_OVR", 0x27a48, 0 },
+ { "XGMAC_PORT_HSS_TXC_PWR_DAC_OVR", 0x27a50, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXC_PWR_DAC", 0x27a54, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP0_IDAC_APP", 0x27a60, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP1_IDAC_APP", 0x27a64, 0 },
+ { "XGMAC_PORT_HSS_TXC_TAP2_IDAC_APP", 0x27a68, 0 },
+ { "XGMAC_PORT_HSS_TXC_SEG_DIS_APP", 0x27a70, 0 },
+ { "XGMAC_PORT_HSS_TXC_EXT_ADDR_DATA", 0x27a78, 0 },
+ { "XGMAC_PORT_HSS_TXC_EXT_ADDR", 0x27a7c, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_TXD_MODE_CFG", 0x27a80, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TEST_CTRL", 0x27a84, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXD_COEFF_CTRL", 0x27a88, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TXD_DRIVER_MODE", 0x27a8c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_DRIVER_OVR_CTRL", 0x27a90, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TDM_BIASGEN_STANDBY_TIMER", 0x27a94, 0 },
+ { "XGMAC_PORT_HSS_TXD_TDM_BIASGEN_PWRON_TIMER", 0x27a98, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_COEFF", 0x27aa0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_COEFF", 0x27aa4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_COEFF", 0x27aa8, 0 },
+ { "XGMAC_PORT_HSS_TXD_PWR", 0x27ab0, 0 },
+ { "XGMAC_PORT_HSS_TXD_POLARITY", 0x27ab4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TXD_8023AP_AE_CMD", 0x27ab8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_8023AP_AE_STATUS", 0x27abc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_IDAC_OVR", 0x27ac0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_IDAC_OVR", 0x27ac4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_IDAC_OVR", 0x27ac8, 0 },
+ { "XGMAC_PORT_HSS_TXD_PWR_DAC_OVR", 0x27ad0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TXD_PWR_DAC", 0x27ad4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP0_IDAC_APP", 0x27ae0, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP1_IDAC_APP", 0x27ae4, 0 },
+ { "XGMAC_PORT_HSS_TXD_TAP2_IDAC_APP", 0x27ae8, 0 },
+ { "XGMAC_PORT_HSS_TXD_SEG_DIS_APP", 0x27af0, 0 },
+ { "XGMAC_PORT_HSS_TXD_EXT_ADDR_DATA", 0x27af8, 0 },
+ { "XGMAC_PORT_HSS_TXD_EXT_ADDR", 0x27afc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_CFG_MODE", 0x27b00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXC_TEST_CTRL", 0x27b04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_CTRL", 0x27b08, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_OFFSET_CTRL", 0x27b0c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_POSITION1", 0x27b10, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_POSITION2", 0x27b14, 0 },
+ { "XGMAC_PORT_HSS_RXC_PH_ROTATOR_STATIC_PH_OFFSET", 0x27b18, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_SIGDET_CTRL", 0x27b1c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_CTRL", 0x27b20, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_DATA_EDGE_SAMPLE", 0x27b24, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_DFE_AMP_SAMPLE", 0x27b28, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL1", 0x27b2c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL2", 0x27b30, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_VGA_CTRL3", 0x27b34, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXC_DFE_D00_D01_OFFSET", 0x27b38, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_D10_D11_OFFSET", 0x27b3c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_E0_E1_OFFSET", 0x27b40, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DACA_OFFSET", 0x27b44, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_DACAP_DAC_AN_OFFSET", 0x27b48, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_DACA_MIN", 0x27b4c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXC_ADAC_CTRL", 0x27b50, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXC_DIGITAL_EYE_CTRL", 0x27b54, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DIGITAL_EYE_METRICS", 0x27b58, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H1", 0x27b5c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H2", 0x27b60, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H3", 0x27b64, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H4", 0x27b68, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DFE_H5", 0x27b6c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DAC_DPC", 0x27b70, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXC_DDC", 0x27b74, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXC_INTERNAL_STATUS", 0x27b78, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXC_DFE_FUNC_CTRL", 0x27b7c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_CFG_MODE", 0x27b80, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXD_TEST_CTRL", 0x27b84, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_CTRL", 0x27b88, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_OFFSET_CTRL", 0x27b8c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_POSITION1", 0x27b90, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_POSITION2", 0x27b94, 0 },
+ { "XGMAC_PORT_HSS_RXD_PH_ROTATOR_STATIC_PH_OFFSET", 0x27b98, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_SIGDET_CTRL", 0x27b9c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_CTRL", 0x27ba0, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_DATA_EDGE_SAMPLE", 0x27ba4, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_DFE_AMP_SAMPLE", 0x27ba8, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL1", 0x27bac, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL2", 0x27bb0, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_VGA_CTRL3", 0x27bb4, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RXD_DFE_D00_D01_OFFSET", 0x27bb8, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_D10_D11_OFFSET", 0x27bbc, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_E0_E1_OFFSET", 0x27bc0, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DACA_OFFSET", 0x27bc4, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_DACAP_DAC_AN_OFFSET", 0x27bc8, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_DACA_MIN", 0x27bcc, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RXD_ADAC_CTRL", 0x27bd0, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RXD_DIGITAL_EYE_CTRL", 0x27bd4, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DIGITAL_EYE_METRICS", 0x27bd8, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H1", 0x27bdc, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H2", 0x27be0, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H3", 0x27be4, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H4", 0x27be8, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DFE_H5", 0x27bec, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DAC_DPC", 0x27bf0, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RXD_DDC", 0x27bf4, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RXD_INTERNAL_STATUS", 0x27bf8, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RXD_DFE_FUNC_CTRL", 0x27bfc, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_0", 0x27c00, 0 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_1", 0x27c04, 0 },
+ { "LDET", 4, 1 },
+ { "CCERR", 3, 1 },
+ { "CCCMP", 2, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_2", 0x27c08, 0 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_3", 0x27c0c, 0 },
+ { "VISEL", 4, 1 },
+ { "FMIN", 3, 1 },
+ { "FMAX", 2, 1 },
+ { "CVHOLD", 1, 1 },
+ { "TCDIS", 0, 1 },
+ { "XGMAC_PORT_HSS_VCO_COARSE_CALIBRATION_4", 0x27c10, 0 },
+ { "CMETH", 2, 1 },
+ { "RECAL", 1, 1 },
+ { "CCLD", 0, 1 },
+ { "XGMAC_PORT_HSS_ANALOG_TEST_MUX", 0x27c14, 0 },
+ { "XGMAC_PORT_HSS_PORT_EN_0", 0x27c18, 0 },
+ { "RXDEN", 7, 1 },
+ { "RXCEN", 6, 1 },
+ { "TXDEN", 5, 1 },
+ { "TXCEN", 4, 1 },
+ { "RXBEN", 3, 1 },
+ { "RXAEN", 2, 1 },
+ { "TXBEN", 1, 1 },
+ { "TXAEN", 0, 1 },
+ { "XGMAC_PORT_HSS_PORT_RESET_0", 0x27c20, 0 },
+ { "RXDRST", 7, 1 },
+ { "RXCRST", 6, 1 },
+ { "TXDRST", 5, 1 },
+ { "TXCRST", 4, 1 },
+ { "RXBRST", 3, 1 },
+ { "RXARST", 2, 1 },
+ { "TXBRST", 1, 1 },
+ { "TXARST", 0, 1 },
+ { "XGMAC_PORT_HSS_CHARGE_PUMP_CTRL", 0x27c28, 0 },
+ { "ENCPIS", 2, 1 },
+ { "CPISEL", 0, 2 },
+ { "XGMAC_PORT_HSS_BAND_GAP_CTRL", 0x27c2c, 0 },
+ { "XGMAC_PORT_HSS_LOFREQ_OVR", 0x27c30, 0 },
+ { "LFREQ2", 3, 1 },
+ { "LFREQ1", 2, 1 },
+ { "LFREQO", 1, 1 },
+ { "LFSEL", 0, 1 },
+ { "XGMAC_PORT_HSS_VOLTAGE_BOOST_CTRL", 0x27c38, 0 },
+ { "PFVAL", 2, 1 },
+ { "PFEN", 1, 1 },
+ { "VBADJ", 0, 1 },
+ { "XGMAC_PORT_HSS_TX_MODE_CFG", 0x27c80, 0 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXTEST_CTRL", 0x27c84, 0 },
+ { "TWDP", 5, 1 },
+ { "TPGRST", 4, 1 },
+ { "TPGEN", 3, 1 },
+ { "TPSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_TX_COEFF_CTRL", 0x27c88, 0 },
+ { "AEINVPOL", 6, 1 },
+ { "AESOURCE", 5, 1 },
+ { "EQMODE", 4, 1 },
+ { "OCOEF", 3, 1 },
+ { "COEFRST", 2, 1 },
+ { "SPEN", 1, 1 },
+ { "ALOAD", 0, 1 },
+ { "XGMAC_PORT_HSS_TX_DRIVER_MODE", 0x27c8c, 0 },
+ { "DRVOFFT", 5, 1 },
+ { "SLEW", 2, 3 },
+ { "FFE", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_DRIVER_OVR_CTRL", 0x27c90, 0 },
+ { "VLINC", 7, 1 },
+ { "VLDEC", 6, 1 },
+ { "LOPWR", 5, 1 },
+ { "TDMEN", 4, 1 },
+ { "DCCEN", 3, 1 },
+ { "VHSEL", 2, 1 },
+ { "IDAC", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_TDM_BIASGEN_STANDBY_TIMER", 0x27c94, 0 },
+ { "XGMAC_PORT_HSS_TX_TDM_BIASGEN_PWRON_TIMER", 0x27c98, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP0_COEFF", 0x27ca0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_COEFF", 0x27ca4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_COEFF", 0x27ca8, 0 },
+ { "XGMAC_PORT_HSS_TX_PWR", 0x27cb0, 0 },
+ { "XGMAC_PORT_HSS_TX_POLARITY", 0x27cb4, 0 },
+ { "TXPOL", 4, 3 },
+ { "NTXPOL", 0, 3 },
+ { "XGMAC_PORT_HSS_TX_8023AP_AE_CMD", 0x27cb8, 0 },
+ { "CXPRESET", 13, 1 },
+ { "CXINIT", 12, 1 },
+ { "C2UPDT", 4, 2 },
+ { "C1UPDT", 2, 2 },
+ { "C0UPDT", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_8023AP_AE_STATUS", 0x27cbc, 0 },
+ { "C2STAT", 4, 2 },
+ { "C1STAT", 2, 2 },
+ { "C0STAT", 0, 2 },
+ { "XGMAC_PORT_HSS_TX_TAP0_IDAC_OVR", 0x27cc0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_IDAC_OVR", 0x27cc4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_IDAC_OVR", 0x27cc8, 0 },
+ { "XGMAC_PORT_HSS_TX_PWR_DAC_OVR", 0x27cd0, 0 },
+ { "OPEN", 7, 1 },
+ { "OPVAL", 0, 5 },
+ { "XGMAC_PORT_HSS_TX_PWR_DAC", 0x27cd4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP0_IDAC_APP", 0x27ce0, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP1_IDAC_APP", 0x27ce4, 0 },
+ { "XGMAC_PORT_HSS_TX_TAP2_IDAC_APP", 0x27ce8, 0 },
+ { "XGMAC_PORT_HSS_TX_SEG_DIS_APP", 0x27cf0, 0 },
+ { "XGMAC_PORT_HSS_TX_EXT_ADDR_DATA", 0x27cf8, 0 },
+ { "XGMAC_PORT_HSS_TX_EXT_ADDR", 0x27cfc, 0 },
+ { "XADDR", 2, 4 },
+ { "XWR", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_CFG_MODE", 0x27d00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_RXTEST_CTRL", 0x27d04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_CTRL", 0x27d08, 0 },
+ { "FTHROT", 12, 4 },
+ { "RTHROT", 11, 1 },
+ { "FILTCTL", 7, 4 },
+ { "RSRVO", 5, 2 },
+ { "EXTEL", 4, 1 },
+ { "RSTONSTUCK", 3, 1 },
+ { "FREEZEFW", 2, 1 },
+ { "RESETFW", 1, 1 },
+ { "SSCENABLE", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_OFFSET_CTRL", 0x27d0c, 0 },
+ { "RSNP", 11, 1 },
+ { "TSOEN", 10, 1 },
+ { "OFFEN", 9, 1 },
+ { "TMSCAL", 7, 2 },
+ { "APADJ", 6, 1 },
+ { "RSEL", 5, 1 },
+ { "PHOFFS", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_POSITION1", 0x27d10, 0 },
+ { "ROT0A", 8, 6 },
+ { "RTSEL", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_POSITION2", 0x27d14, 0 },
+ { "XGMAC_PORT_HSS_RX_PH_ROTATOR_STATIC_PH_OFFSET", 0x27d18, 0 },
+ { "RCALER", 15, 1 },
+ { "RAOOFF", 10, 5 },
+ { "RAEOFF", 5, 5 },
+ { "RDOFF", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_SIGDET_CTRL", 0x27d1c, 0 },
+ { "SIGNSD", 13, 2 },
+ { "DACSD", 8, 5 },
+ { "SDPDN", 6, 1 },
+ { "SIGDET", 5, 1 },
+ { "SDLVL", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_CTRL", 0x27d20, 0 },
+ { "REQCMP", 15, 1 },
+ { "DFEREQ", 14, 1 },
+ { "SPCEN", 13, 1 },
+ { "GATEEN", 12, 1 },
+ { "SPIFMT", 9, 3 },
+ { "DFEPWR", 6, 3 },
+ { "STNDBY", 5, 1 },
+ { "FRCH", 4, 1 },
+ { "NONRND", 3, 1 },
+ { "NONRNF", 2, 1 },
+ { "FSTLCK", 1, 1 },
+ { "DFERST", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_DATA_EDGE_SAMPLE", 0x27d24, 0 },
+ { "ESAMP", 8, 8 },
+ { "DSAMP", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_DFE_AMP_SAMPLE", 0x27d28, 0 },
+ { "SMODE", 8, 4 },
+ { "ADCORR", 7, 1 },
+ { "TRAINEN", 6, 1 },
+ { "ASAMPQ", 3, 3 },
+ { "ASAMP", 0, 3 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL1", 0x27d2c, 0 },
+ { "POLE", 12, 2 },
+ { "PEAK", 8, 3 },
+ { "VOFFSN", 6, 2 },
+ { "VOFFA", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL2", 0x27d30, 0 },
+ { "SHORTV", 10, 1 },
+ { "VGAIN", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_VGA_CTRL3", 0x27d34, 0 },
+ { "HBND1", 10, 1 },
+ { "HBND0", 9, 1 },
+ { "VLCKD", 8, 1 },
+ { "VLCKDF", 7, 1 },
+ { "AMAXT", 0, 7 },
+ { "XGMAC_PORT_HSS_RX_DFE_D00_D01_OFFSET", 0x27d38, 0 },
+ { "D01SN", 13, 2 },
+ { "D01AMP", 8, 5 },
+ { "D00SN", 5, 2 },
+ { "D00AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_D10_D11_OFFSET", 0x27d3c, 0 },
+ { "D11SN", 13, 2 },
+ { "D11AMP", 8, 5 },
+ { "D10SN", 5, 2 },
+ { "D10AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_E0_E1_OFFSET", 0x27d40, 0 },
+ { "E1SN", 13, 2 },
+ { "E1AMP", 8, 5 },
+ { "E0SN", 5, 2 },
+ { "E0AMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DACA_OFFSET", 0x27d44, 0 },
+ { "AOFFO", 8, 6 },
+ { "AOFFE", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_DACAP_DAC_AN_OFFSET", 0x27d48, 0 },
+ { "DACAN", 8, 8 },
+ { "DACAP", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_DACA_MIN", 0x27d4c, 0 },
+ { "DACAZ", 8, 8 },
+ { "DACAM", 0, 8 },
+ { "XGMAC_PORT_HSS_RX_ADAC_CTRL", 0x27d50, 0 },
+ { "ADSN", 7, 2 },
+ { "ADMAG", 0, 7 },
+ { "XGMAC_PORT_HSS_RX_DIGITAL_EYE_CTRL", 0x27d54, 0 },
+ { "BLKAZ", 15, 1 },
+ { "WIDTH", 10, 5 },
+ { "MINWIDTH", 5, 5 },
+ { "MINAMP", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DIGITAL_EYE_METRICS", 0x27d58, 0 },
+ { "EMBRDY", 10, 1 },
+ { "EMBUMP", 7, 1 },
+ { "EMMD", 5, 2 },
+ { "EMPAT", 1, 1 },
+ { "EMEN", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_H1", 0x27d5c, 0 },
+ { "H1OSN", 14, 2 },
+ { "H1OMAG", 8, 6 },
+ { "H1ESN", 6, 2 },
+ { "H1EMAG", 0, 6 },
+ { "XGMAC_PORT_HSS_RX_DFE_H2", 0x27d60, 0 },
+ { "H2OSN", 13, 2 },
+ { "H2OMAG", 8, 5 },
+ { "H2ESN", 5, 2 },
+ { "H2EMAG", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_DFE_H3", 0x27d64, 0 },
+ { "H3OSN", 12, 2 },
+ { "H3OMAG", 8, 4 },
+ { "H3ESN", 4, 2 },
+ { "H3EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DFE_H4", 0x27d68, 0 },
+ { "H4OSN", 12, 2 },
+ { "H4OMAG", 8, 4 },
+ { "H4ESN", 4, 2 },
+ { "H4EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DFE_H5", 0x27d6c, 0 },
+ { "H5OSN", 12, 2 },
+ { "H5OMAG", 8, 4 },
+ { "H5ESN", 4, 2 },
+ { "H5EMAG", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DAC_DPC", 0x27d70, 0 },
+ { "DPCCVG", 13, 1 },
+ { "DACCVG", 12, 1 },
+ { "DPCTGT", 9, 3 },
+ { "BLKH1T", 8, 1 },
+ { "BLKOAE", 7, 1 },
+ { "H1TGT", 4, 3 },
+ { "OAE", 0, 4 },
+ { "XGMAC_PORT_HSS_RX_DDC", 0x27d74, 0 },
+ { "OLS", 11, 5 },
+ { "OES", 6, 5 },
+ { "BLKODEC", 5, 1 },
+ { "ODEC", 0, 5 },
+ { "XGMAC_PORT_HSS_RX_INTERNAL_STATUS", 0x27d78, 0 },
+ { "BER6", 15, 1 },
+ { "BER6VAL", 14, 1 },
+ { "BER3VAL", 13, 1 },
+ { "DPCCMP", 9, 1 },
+ { "DACCMP", 8, 1 },
+ { "DDCCMP", 7, 1 },
+ { "AERRFLG", 6, 1 },
+ { "WERRFLG", 5, 1 },
+ { "TRCMP", 4, 1 },
+ { "VLCKF", 3, 1 },
+ { "ROCADJ", 2, 1 },
+ { "ROCCMP", 1, 1 },
+ { "OCCMP", 0, 1 },
+ { "XGMAC_PORT_HSS_RX_DFE_FUNC_CTRL", 0x27d7c, 0 },
+ { "FDPC", 15, 1 },
+ { "FDAC", 14, 1 },
+ { "FDDC", 13, 1 },
+ { "FNRND", 12, 1 },
+ { "FVGAIN", 11, 1 },
+ { "FVOFF", 10, 1 },
+ { "FSDET", 9, 1 },
+ { "FBER6", 8, 1 },
+ { "FROTO", 7, 1 },
+ { "FH4H5", 6, 1 },
+ { "FH2H3", 5, 1 },
+ { "FH1", 4, 1 },
+ { "FH1SN", 3, 1 },
+ { "FNRDF", 2, 1 },
+ { "FADAC", 0, 1 },
+ { "XGMAC_PORT_HSS_TXRX_CFG_MODE", 0x27e00, 0 },
+ { "BW810", 8, 1 },
+ { "AUXCLK", 7, 1 },
+ { "DMSEL", 4, 3 },
+ { "BWSEL", 2, 2 },
+ { "RTSEL", 0, 2 },
+ { "XGMAC_PORT_HSS_TXRXTEST_CTRL", 0x27e04, 0 },
+ { "RCLKEN", 15, 1 },
+ { "RRATE", 13, 2 },
+ { "LBFRCERROR", 10, 1 },
+ { "LBERROR", 9, 1 },
+ { "LBSYNC", 8, 1 },
+ { "FDWRAPCLK", 7, 1 },
+ { "FDWRAP", 6, 1 },
+ { "PRST", 4, 1 },
+ { "PCHKEN", 3, 1 },
+ { "PRBSSEL", 0, 3 },
+ { NULL, 0, 0 }
+};
diff --git a/tools/tools/cxgbetool/reg_defs_t4vf.c b/tools/tools/cxgbetool/reg_defs_t4vf.c
new file mode 100644
index 0000000..6ebd731
--- /dev/null
+++ b/tools/tools/cxgbetool/reg_defs_t4vf.c
@@ -0,0 +1,122 @@
+/*
+ * This file is _NOT_ automatically generated. It must agree with the
+ * Virtual Function register map definitions in t4vf_defs.h in the common
+ * code.
+ */
+__FBSDID("$FreeBSD$");
+
+struct reg_info t4vf_sge_regs[] = {
+ { "SGE_KDOORBELL", 0x000, 0 },
+ { "QID", 15, 17 },
+ { "Priority", 14, 1 },
+ { "PIDX", 0, 14 },
+ { "SGE_GTS", 0x004, 0 },
+ { "IngressQID", 16, 16 },
+ { "TimerReg", 13, 3 },
+ { "SEIntArm", 12, 1 },
+ { "CIDXInc", 0, 12 },
+
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4vf_mps_regs[] = {
+ { "MPS_VF_CTL", 0x100, 0 },
+ { "TxEn", 1, 1 },
+ { "RxEn", 0, 1 },
+
+ { "MPS_VF_STAT_TX_VF_BCAST_BYTES_L", 0x180, 0 },
+ { "MPS_VF_STAT_TX_VF_BCAST_BYTES_H", 0x184, 0 },
+ { "MPS_VF_STAT_TX_VF_BCAST_FRAMES_L", 0x188, 0 },
+ { "MPS_VF_STAT_TX_VF_BCAST_FRAMES_H", 0x18c, 0 },
+
+ { "MPS_VF_STAT_TX_VF_MCAST_BYTES_L", 0x190, 0 },
+ { "MPS_VF_STAT_TX_VF_MCAST_BYTES_H", 0x194, 0 },
+ { "MPS_VF_STAT_TX_VF_MCAST_FRAMES_L", 0x198, 0 },
+ { "MPS_VF_STAT_TX_VF_MCAST_FRAMES_H", 0x19c, 0 },
+
+ { "MPS_VF_STAT_TX_VF_UCAST_BYTES_L", 0x1a0, 0 },
+ { "MPS_VF_STAT_TX_VF_UCAST_BYTES_H", 0x1a4, 0 },
+ { "MPS_VF_STAT_TX_VF_UCAST_FRAMES_L", 0x1a8, 0 },
+ { "MPS_VF_STAT_TX_VF_UCAST_FRAMES_H", 0x1ac, 0 },
+
+ { "MPS_VF_STAT_TX_VF_DROP_FRAMES_L", 0x1b0, 0 },
+ { "MPS_VF_STAT_TX_VF_DROP_FRAMES_H", 0x1b4, 0 },
+
+ { "MPS_VF_STAT_TX_VF_OFFLOAD_BYTES_L", 0x1b8, 0 },
+ { "MPS_VF_STAT_TX_VF_OFFLOAD_BYTES_H", 0x1bc, 0 },
+ { "MPS_VF_STAT_TX_VF_OFFLOAD_FRAMES_L", 0x1c0, 0 },
+ { "MPS_VF_STAT_TX_VF_OFFLOAD_FRAMES_H", 0x1c4, 0 },
+
+ { "MPS_VF_STAT_RX_VF_BCAST_BYTES_L", 0x1c8, 0 },
+ { "MPS_VF_STAT_RX_VF_BCAST_BYTES_H", 0x1cc, 0 },
+ { "MPS_VF_STAT_RX_VF_BCAST_FRAMES_L", 0x1d0, 0 },
+ { "MPS_VF_STAT_RX_VF_BCAST_FRAMES_H", 0x1d4, 0 },
+
+ { "MPS_VF_STAT_RX_VF_MCAST_BYTES_L", 0x1d8, 0 },
+ { "MPS_VF_STAT_RX_VF_MCAST_BYTES_H", 0x1dc, 0 },
+ { "MPS_VF_STAT_RX_VF_MCAST_FRAMES_L", 0x1e0, 0 },
+ { "MPS_VF_STAT_RX_VF_MCAST_FRAMES_H", 0x1e4, 0 },
+
+ { "MPS_VF_STAT_RX_VF_UCAST_BYTES_L", 0x1e8, 0 },
+ { "MPS_VF_STAT_RX_VF_UCAST_BYTES_H", 0x1ec, 0 },
+ { "MPS_VF_STAT_RX_VF_UCAST_FRAMES_L", 0x1f0, 0 },
+ { "MPS_VF_STAT_RX_VF_UCAST_FRAMES_H", 0x1f4, 0 },
+
+ { "MPS_VF_STAT_RX_VF_ERR_FRAMES_L", 0x1f8, 0 },
+ { "MPS_VF_STAT_RX_VF_ERR_FRAMES_H", 0x1fc, 0 },
+
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4vf_pl_regs[] = {
+ { "PL_VF_WHOAMI", 0x200, 0 },
+ { "PortxMap", 5, 3 },
+ { "SourceBus", 3, 2 },
+ { "SourcePF", 0, 3 },
+
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4vf_cim_regs[] = {
+ /*
+ * Note: the Mailbox Control register has read side-effects so
+ * the driver simply returns 0xffff for this register.
+ */
+ { "CIM_VF_EXT_MAILBOX_CTRL", 0x300, 0 },
+ { "MBGeneric", 4, 4 },
+ { "MBMsgValid", 3, 1 },
+ { "MBIntReq", 3, 1 },
+ { "MBOwner", 0, 2 },
+ { "CIM_VF_EXT_MAILBOX_STATUS", 0x304, 0 },
+ { "MBVFReady", 0, 1 },
+
+ { NULL, 0, 0 }
+};
+
+struct reg_info t4vf_mbdata_regs[] = {
+ { "CIM_VF_EXT_MAILBOX_DATA_00", 0x240, 0 },
+ { "Return", 8, 8 },
+ { "Length16", 0, 8 },
+ { "CIM_VF_EXT_MAILBOX_DATA_04", 0x244, 0 },
+ { "OpCode", 24, 8 },
+ { "Request", 23, 1 },
+ { "Read", 22, 1 },
+ { "Write", 21, 1 },
+ { "Execute", 20, 1 },
+ { "CIM_VF_EXT_MAILBOX_DATA_08", 0x248, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_0c", 0x24c, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_10", 0x250, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_14", 0x254, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_18", 0x258, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_1c", 0x25c, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_20", 0x260, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_24", 0x264, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_28", 0x268, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_2c", 0x26c, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_30", 0x270, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_34", 0x274, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_38", 0x278, 0 },
+ { "CIM_VF_EXT_MAILBOX_DATA_3c", 0x27c, 0 },
+
+ { NULL, 0, 0 }
+};
diff --git a/tools/tools/ether_reflect/ether_reflect.1 b/tools/tools/ether_reflect/ether_reflect.1
index c8388f0..139dcc2 100644
--- a/tools/tools/ether_reflect/ether_reflect.1
+++ b/tools/tools/ether_reflect/ether_reflect.1
@@ -25,7 +25,7 @@
.\" $FreeBSD$
.\"
.Dd December 23, 2008
-.Dt ether_reflect 1
+.Dt ETHER_REFLECT 1
.Os
.Sh NAME
.Nm ether_reflect
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh
index 2d2a4e7..c3e96b3 100644
--- a/tools/tools/nanobsd/nanobsd.sh
+++ b/tools/tools/nanobsd/nanobsd.sh
@@ -418,7 +418,7 @@ populate_slice ( ) (
echo "Creating ${dev} with ${dir} (mounting on ${mnt})"
newfs_part $dev $mnt $lbl
cd ${dir}
- find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${mnt}
+ find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt}
df -i ${mnt}
umount ${mnt}
)
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 85a9180..87e8cad 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -57,7 +57,7 @@ SUBDIR= alias \
getconf \
getent \
getopt \
- ${_grep} \
+ grep \
gzip \
head \
hexdump \
@@ -74,7 +74,6 @@ SUBDIR= alias \
ktrace \
ktrdump \
lam \
- last \
lastcomm \
ldd \
leave \
@@ -170,7 +169,6 @@ SUBDIR= alias \
unzip \
units \
unvis \
- users \
uudecode \
uuencode \
vi \
@@ -182,10 +180,8 @@ SUBDIR= alias \
what \
whereis \
which \
- who \
whois \
write \
- wtmpcvt \
xargs \
xinstall \
${_xlint} \
@@ -227,10 +223,6 @@ SUBDIR+= bluetooth
SUBDIR+= cpio
.endif
-.if ${MK_BSD_GREP} != "no"
-_grep= grep
-.endif
-
.if ${MK_CALENDAR} != "no"
SUBDIR+= calendar
.endif
@@ -342,6 +334,13 @@ SUBDIR+= usbhidaction
SUBDIR+= usbhidctl
.endif
+.if ${MK_UTMPX} != "no"
+SUBDIR+= last
+SUBDIR+= users
+SUBDIR+= who
+SUBDIR+= wtmpcvt
+.endif
+
.include <bsd.arch.inc.mk>
SUBDIR:= ${SUBDIR:O}
diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd
index 83f3151..957dafd 100644
--- a/usr.bin/calendar/calendars/calendar.freebsd
+++ b/usr.bin/calendar/calendars/calendar.freebsd
@@ -260,12 +260,14 @@
09/05 Mark Robert Vaughan Murray <markm@FreeBSD.org> born in Harare, Mashonaland, Zimbabwe, 1961
09/05 Adrian Harold Chadd <adrian@FreeBSD.org> born in Perth, Western Australia, Australia, 1979
09/07 Tim Bishop <tdb@FreeBSD.org> born in Cornwall, United Kingdom, 1978
+09/07 Chris Rees <crees@FreeBSD.org> born in Kettering, United Kingdom, 1987
09/08 Boris Samorodov <bsam@FreeBSD.org> born in Krasnodar, Russian Federation, 1963
09/09 Yoshio Mita <mita@FreeBSD.org> born in Hiroshima, Japan, 1972
09/10 Wesley R. Peters <wes@FreeBSD.org> born in Hartford, Alabama, United States, 1961
09/12 Weongyo Jeong <weongyo@FreeBSD.org> born in Haman, Korea, 1980
09/12 Benedict Christopher Reuschling <bcr@FreeBSD.org> born in Darmstadt, Germany, 1981
09/12 William C. Fumerola II <billf@FreeBSD.org> born in Detroit, Michigan, United States, 1981
+09/15 Aleksandr Rybalko <ray@FreeBSD.org> born in Odessa, Ukraine, 1977
09/15 Dima Panov <fluffy@FreeBSD.org> born in Khabarovsk, Russian Federation, 1978
09/17 Maxim Bolotin <mb@FreeBSD.org> born in Rostov-on-Don, Russian Federation, 1976
09/18 Matthew Fleming <mdf@FreeBSD.org> born in Cleveland, Ohio, United States, 1975
@@ -293,6 +295,7 @@
10/22 Jean-Sebastien Pedron <dumbbell@FreeBSD.org> born in Redon, Ille-et-Vilaine, France, 1980
10/23 Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> born in Brasilia, Distrito Federal, Brazil, 1976
10/25 Eric Melville <eric@FreeBSD.org> born in Los Gatos, California, United States, 1980
+10/25 Julien Laffaye <jlaffaye@FreeBSD.org> born in Toulouse, France, 1988
10/26 Philip M. Gollucci <pgollucci@FreeBSD.org> born in Silver Spring, Maryland, United States, 1979
10/27 Takanori Watanabe <takawata@FreeBSD.org> born in Numazu, Shizuoka, Japan, 1972
11/05 M. Warner Losh <imp@FreeBSD.org> born in Kansas City, Kansas, United States, 1966
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c
index ef98d5d..eb37eac 100644
--- a/usr.bin/calendar/io.c
+++ b/usr.bin/calendar/io.c
@@ -346,7 +346,7 @@ closecal(FILE *fp)
write(pdes[1], pw->pw_name, strlen(pw->pw_name));
write(pdes[1], ">\nTo: <", 7);
write(pdes[1], pw->pw_name, strlen(pw->pw_name));
- write(pdes[1], ">\nSubject: ", 12);
+ write(pdes[1], ">\nSubject: ", 11);
write(pdes[1], dayname, strlen(dayname));
write(pdes[1], "'s Calendar\nPrecedence: bulk\n\n", 30);
diff --git a/usr.bin/clang/tblgen/Makefile b/usr.bin/clang/tblgen/Makefile
index abf85d2..f46496f 100644
--- a/usr.bin/clang/tblgen/Makefile
+++ b/usr.bin/clang/tblgen/Makefile
@@ -15,6 +15,7 @@ SRCS= ARMDecoderEmitter.cpp \
CodeEmitterGen.cpp \
CodeGenDAGPatterns.cpp \
CodeGenInstruction.cpp \
+ CodeGenRegisters.cpp \
CodeGenTarget.cpp \
DAGISelEmitter.cpp \
DAGISelMatcher.cpp \
@@ -33,6 +34,7 @@ SRCS= ARMDecoderEmitter.cpp \
OptParserEmitter.cpp \
Record.cpp \
RegisterInfoEmitter.cpp \
+ SetTheory.cpp \
StringMatcher.cpp \
SubtargetEmitter.cpp \
TGLexer.cpp \
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 26c022c..eabb054 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -846,7 +846,8 @@ f_fstype(PLAN *plan, FTSENT *entry)
static dev_t curdev; /* need a guaranteed illegal dev value */
static int first = 1;
struct statfs sb;
- static int val_type, val_flags;
+ static int val_flags;
+ static char fstype[sizeof(sb.f_fstypename)];
char *p, save[2] = {0,0};
if ((plan->flags & F_MTMASK) == F_MTUNKNOWN)
@@ -888,13 +889,13 @@ f_fstype(PLAN *plan, FTSENT *entry)
* always copy both of them.
*/
val_flags = sb.f_flags;
- val_type = sb.f_type;
+ strlcpy(fstype, sb.f_fstypename, sizeof(fstype));
}
switch (plan->flags & F_MTMASK) {
case F_MTFLAG:
return val_flags & plan->mt_data;
case F_MTTYPE:
- return val_type == plan->mt_data;
+ return (strncmp(fstype, plan->c_data, sizeof(fstype)) == 0);
default:
abort();
}
@@ -905,22 +906,11 @@ c_fstype(OPTION *option, char ***argvp)
{
char *fsname;
PLAN *new;
- struct xvfsconf vfc;
fsname = nextarg(option, argvp);
ftsoptions &= ~FTS_NOSTAT;
new = palloc(option);
-
- /*
- * Check first for a filesystem name.
- */
- if (getvfsbyname(fsname, &vfc) == 0) {
- new->flags |= F_MTTYPE;
- new->mt_data = vfc.vfc_typenum;
- return new;
- }
-
switch (*fsname) {
case 'l':
if (!strcmp(fsname, "local")) {
@@ -938,12 +928,8 @@ c_fstype(OPTION *option, char ***argvp)
break;
}
- /*
- * We need to make filesystem checks for filesystems
- * that exists but aren't in the kernel work.
- */
- fprintf(stderr, "Warning: Unknown filesystem type %s\n", fsname);
- new->flags |= F_MTUNKNOWN;
+ new->flags |= F_MTTYPE;
+ new->c_data = fsname;
return new;
}
diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c
index 2c11936..d901623 100644
--- a/usr.bin/find/main.c
+++ b/usr.bin/find/main.c
@@ -120,7 +120,7 @@ main(int argc, char *argv[])
break;
case '?':
default:
- break;
+ usage();
}
argc -= optind;
diff --git a/usr.bin/find/option.c b/usr.bin/find/option.c
index b2374e6..f8745b2 100644
--- a/usr.bin/find/option.c
+++ b/usr.bin/find/option.c
@@ -172,7 +172,7 @@ find_create(char ***argvp)
argv = *argvp;
if ((p = lookup_option(*argv)) == NULL)
- errx(1, "%s: unknown option", *argv);
+ errx(1, "%s: unknown primary or operator", *argv);
++argv;
new = (p->create)(p, &argv);
diff --git a/usr.bin/fstat/fuser.1 b/usr.bin/fstat/fuser.1
index a844939..90252f6 100644
--- a/usr.bin/fstat/fuser.1
+++ b/usr.bin/fstat/fuser.1
@@ -130,6 +130,16 @@ The
.Nm
utility is expected to conform to
.St -p1003.1-2004 .
+.Sh HISTORY
+The
+.Nm
+utility appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+The
+.Nm
+utility and this manual page was written by
+.An Stanislav Sedov Aq stas@FreeBSD.org .
.Sh BUGS
Since
.Nm
@@ -141,13 +151,3 @@ interface the report will be limited to filesystems the
.Nm
utility knows about (currently only cd9660, devfs, nfs, ntfs, nwfs, udf,
ufs and zfs).
-.Sh HISTORY
-The
-.Nm
-utility appeared in
-.Fx 9.0 .
-.Sh AUTHORS
-The
-.Nm
-utility and this manual page was written by
-.An Stanislav Sedov Aq stas@FreeBSD.org .
diff --git a/usr.bin/fstat/fuser.c b/usr.bin/fstat/fuser.c
index 02975b3..364d57c 100644
--- a/usr.bin/fstat/fuser.c
+++ b/usr.bin/fstat/fuser.c
@@ -358,9 +358,8 @@ str2sig(const char *str)
{
int i;
-#define SIGPREFIX "sig"
- if (!strncasecmp(str, SIGPREFIX, sizeof(SIGPREFIX)))
- str += sizeof(SIGPREFIX);
+ if (!strncasecmp(str, "SIG", 3))
+ str += 3;
for (i = 1; i < sys_nsig; i++) {
if (!strcasecmp(sys_signame[i], str))
return (i);
diff --git a/usr.bin/ftp/Makefile b/usr.bin/ftp/Makefile
index 6f42e69..55a36be 100644
--- a/usr.bin/ftp/Makefile
+++ b/usr.bin/ftp/Makefile
@@ -8,18 +8,18 @@
#
#CFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21
-LUKEMFTP= ${.CURDIR}/../../contrib/lukemftp
-.PATH: ${LUKEMFTP}/src
+TNFTP= ${.CURDIR}/../../contrib/tnftp
+.PATH: ${TNFTP}/src
PROG= ftp
-SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c progressbar.c \
- ruserpass.c util.c
+SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
+ progressbar.c ruserpass.c util.c
.if ${MK_INET6_SUPPORT} != "no"
CFLAGS+= -DINET6
.endif
-CFLAGS+= -I${.CURDIR} -I${LUKEMFTP}
+CFLAGS+= -I${.CURDIR} -I${TNFTP}
LDADD= -ledit -ltermcap -lutil
DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBUTIL}
diff --git a/usr.bin/ftp/config.h b/usr.bin/ftp/config.h
deleted file mode 100644
index 77dff70..0000000
--- a/usr.bin/ftp/config.h
+++ /dev/null
@@ -1,285 +0,0 @@
-/* $FreeBSD$ */
-
-
-/* config.h. Generated automatically by configure. */
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* $Id: config.h.in,v 1.24 2000/09/18 00:40:12 lukem Exp $ */
-
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if the closedir function returns void instead of int. */
-/* #undef CLOSEDIR_VOID */
-
-/* Define if the `getpgrp' function takes no argument. */
-#define GETPGRP_VOID 1
-
-/* Define if your C compiler doesn't accept -c and -o together. */
-/* #undef NO_MINUS_C_MINUS_O */
-
-/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */
-/* #undef F77_NO_MINUS_C_MINUS_O */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* Define to the type of arg1 for select(). */
-/* #undef SELECT_TYPE_ARG1 */
-
-/* Define to the type of args 2, 3 and 4 for select(). */
-/* #undef SELECT_TYPE_ARG234 */
-
-/* Define to the type of arg5 for select(). */
-/* #undef SELECT_TYPE_ARG5 */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Define if the closedir function returns void instead of int. */
-/* #undef VOID_CLOSEDIR */
-
-/* The number of bytes in a off_t. */
-#define SIZEOF_OFF_T 0
-
-/* Define if you have the err function. */
-#define HAVE_ERR 1
-
-/* Define if you have the fgetln function. */
-#define HAVE_FGETLN 1
-
-/* Define if you have the fparseln function. */
-#define HAVE_FPARSELN 1
-
-/* Define if you have the fseeko function. */
-#define HAVE_FSEEKO 1
-
-/* Define if you have the getaddrinfo function. */
-#define HAVE_GETADDRINFO 1
-
-/* Define if you have the gethostbyname2 function. */
-#define HAVE_GETHOSTBYNAME2 1
-
-/* Define if you have the getnameinfo function. */
-#define HAVE_GETNAMEINFO 1
-
-/* Define if you have the getpassphrase function. */
-/* #undef HAVE_GETPASSPHRASE */
-
-/* Define if you have the getpgrp function. */
-#define HAVE_GETPGRP 1
-
-/* Define if you have the glob function. */
-#define USE_GLOB_H 1
-
-/* Define if you have the inet_ntop function. */
-#define HAVE_INET_NTOP 1
-
-/* Define if you have the inet_pton function. */
-#define HAVE_INET_PTON 1
-
-/* Define if you have the issetugid function. */
-#define HAVE_ISSETUGID 1
-
-/* Define if you have the memmove function. */
-#define HAVE_MEMMOVE 1
-
-/* Define if you have the mkstemp function. */
-#define HAVE_MKSTEMP 1
-
-/* Define if you have the poll function. */
-#define HAVE_POLL 1
-
-/* Define if you have the select function. */
-#define HAVE_SELECT 1
-
-/* Define if you have the setprogname function. */
-#define HAVE_SETPROGNAME 1
-
-/* Define if you have the sl_init function. */
-#define HAVE_SL_INIT 1
-
-/* Define if you have the snprintf function. */
-#define HAVE_SNPRINTF 1
-
-/* Define if you have the strdup function. */
-#define HAVE_STRDUP 1
-
-/* Define if you have the strerror function. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the strlcat function. */
-#define HAVE_STRLCAT 1
-
-/* Define if you have the strlcpy function. */
-#define HAVE_STRLCPY 1
-
-/* Define if you have the strptime function. */
-#define HAVE_STRPTIME 1
-
-/* Define if you have the strsep function. */
-#define HAVE_STRSEP 1
-
-/* Define if you have the strtoll function. */
-#define HAVE_STRTOLL 1
-
-/* Define if you have the strunvis function. */
-#define HAVE_STRUNVIS 1
-
-/* Define if you have the strvis function. */
-#define HAVE_STRVIS 1
-
-/* Define if you have the timegm function. */
-#define HAVE_TIMEGM 1
-
-/* Define if you have the usleep function. */
-#define HAVE_USLEEP 1
-
-/* Define if you have the <arpa/nameser.h> header file. */
-#define HAVE_ARPA_NAMESER_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <err.h> header file. */
-#define HAVE_ERR_H 1
-
-/* Define if you have the <libutil.h> header file. */
-#define HAVE_LIBUTIL_H 1
-
-/* Define if you have the <ndir.h> header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the <paths.h> header file. */
-#define HAVE_PATHS_H 1
-
-/* Define if you have the <poll.h> header file. */
-#define HAVE_POLL_H 1
-
-/* Define if you have the <regex.h> header file. */
-#define HAVE_REGEX_H 1
-
-/* Define if you have the <sys/dir.h> header file. */
-#define HAVE_SYS_DIR_H 1
-
-/* Define if you have the <sys/ndir.h> header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <termcap.h> header file. */
-#define HAVE_TERMCAP_H 1
-
-/* Define if you have the <util.h> header file. */
-/* #undef HAVE_UTIL_H */
-
-/* Define if you have the <vis.h> header file. */
-#define HAVE_VIS_H 1
-
-/* Define if you have the nsl library (-lnsl). */
-/* #undef HAVE_LIBNSL */
-
-/* Define if you have the socket library (-lsocket). */
-/* #undef HAVE_LIBSOCKET */
-
-/* Define if you have the tinfo library (-ltinfo). */
-#define HAVE_LIBTINFO 1
-
-/* Define if you have the util library (-lutil). */
-#define HAVE_LIBUTIL 1
-
-/* Define if your compiler supports `long long' */
-#define HAVE_LONG_LONG 1
-
-/* Define if in_port_t exists */
-#define HAVE_IN_PORT_T 1
-
-/* Define if sa_family_t exists in <sys/socket.h> */
-#define HAVE_SA_FAMILY_T 1
-
-/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */
-#define HAVE_SOCKADDR_SA_LEN 1
-
-/* Define if socklen_t exists */
-#define HAVE_SOCKLEN_T 1
-
-/* Define if AF_INET6 exists in <sys/socket.h> */
-#define HAVE_AF_INET6 1
-
-/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */
-#define HAVE_SOCKADDR_IN6 1
-
-/* Define if `struct addrinfo' exists in <netdb.h> */
-#define HAVE_ADDRINFO 1
-
-/*
- * Define if <netdb.h> contains AI_NUMERICHOST et al.
- * Systems which only implement RFC2133 will need this.
- */
-#define HAVE_RFC2553_NETDB 1
-
-/* Define if `struct direct' has a d_namlen element */
-#define HAVE_D_NAMLEN 1
-
-/* Define if GLOB_BRACE exists in <glob.h> */
-#define HAVE_GLOB_BRACE 1
-
-/* Define if h_errno exists in <netdb.h> */
-#define HAVE_H_ERRNO_D 1
-
-/* Define if fclose() is declared in <stdio.h> */
-#define HAVE_FCLOSE_D 1
-
-/* Define if getpass() is declared in <stdlib.h> or <unistd.h> */
-#define HAVE_GETPASS_D 1
-
-/* Define if optarg is declared in <stdlib.h> or <unistd.h> */
-#define HAVE_OPTARG_D 1
-
-/* Define if optind is declared in <stdlib.h> or <unistd.h> */
-#define HAVE_OPTIND_D 1
-
-/* Define if pclose() is declared in <stdio.h> */
-#define HAVE_PCLOSE_D 1
-
-/* Define if `long long' is supported and sizeof(off_t) >= 8 */
-#define HAVE_QUAD_SUPPORT 1
-
-/* Define if strptime() is declared in <time.h> */
-#define HAVE_STRPTIME_D 1
-
-/*
- * Define this if compiling with SOCKS (the firewall traversal library).
- * Also, you must define connect, getsockname, bind, accept, listen, and
- * select to their R-versions.
- */
-/* #undef SOCKS */
-/* #undef SOCKS4 */
-/* #undef SOCKS5 */
-/* #undef connect */
-/* #undef getsockname */
-/* #undef bind */
-/* #undef accept */
-/* #undef listen */
-/* #undef select */
-/* #undef dup */
-/* #undef dup2 */
-/* #undef fclose */
-/* #undef gethostbyname */
-/* #undef getpeername */
-/* #undef read */
-/* #undef recv */
-/* #undef recvfrom */
-/* #undef rresvport */
-/* #undef send */
-/* #undef sendto */
-/* #undef shutdown */
-/* #undef write */
diff --git a/usr.bin/ftp/tnftp_config.h b/usr.bin/ftp/tnftp_config.h
new file mode 100644
index 0000000..75bfb75
--- /dev/null
+++ b/usr.bin/ftp/tnftp_config.h
@@ -0,0 +1,514 @@
+/* $FreeBSD$ */
+/* tnftp_config.h. Generated from tnftp_config.h.in by configure. */
+/* tnftp_config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if the `closedir' function returns void instead of `int'. */
+/* #undef CLOSEDIR_VOID */
+
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+/* #undef CRAY_STACKSEG_END */
+
+/* Define to 1 if using `alloca.c'. */
+/* #undef C_ALLOCA */
+
+/* Define to 1 if the `getpgrp' function requires zero arguments. */
+#define GETPGRP_VOID 1
+
+/* Define to 1 if `TIOCGWINSZ' requires <sys/ioctl.h>. */
+/* #undef GWINSZ_IN_SYS_IOCTL */
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define to 1 if you have the <arpa/ftp.h> header file. */
+#define HAVE_ARPA_FTP_H 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#define HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+#define HAVE_ARPA_NAMESER_H 1
+
+/* Define to 1 if you have the declaration of `AF_INET6', and to 0 if you
+ don't. */
+#define HAVE_DECL_AF_INET6 1
+
+/* Define to 1 if you have the declaration of `AI_NUMERICHOST', and to 0 if
+ you don't. */
+#define HAVE_DECL_AI_NUMERICHOST 1
+
+/* Define to 1 if you have the declaration of `dirname', and to 0 if you
+ don't. */
+#define HAVE_DECL_DIRNAME 1
+
+/* Define to 1 if you have the declaration of `fclose', and to 0 if you don't.
+ */
+#define HAVE_DECL_FCLOSE 1
+
+/* Define to 1 if you have the declaration of `getpass', and to 0 if you
+ don't. */
+#define HAVE_DECL_GETPASS 1
+
+/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
+ don't. */
+#define HAVE_DECL_H_ERRNO 1
+
+/* Define to 1 if you have the declaration of `NS_IN6ADDRSZ', and to 0 if you
+ don't. */
+#define HAVE_DECL_NS_IN6ADDRSZ 1
+
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
+ */
+#define HAVE_DECL_OPTARG 1
+
+/* Define to 1 if you have the declaration of `optind', and to 0 if you don't.
+ */
+#define HAVE_DECL_OPTIND 1
+
+/* Define to 1 if you have the declaration of `pclose', and to 0 if you don't.
+ */
+#define HAVE_DECL_PCLOSE 1
+
+/* Define to 1 if you have the declaration of `strptime', and to 0 if you
+ don't. */
+#define HAVE_DECL_STRPTIME 1
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#define HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the `dirname' function. */
+#define HAVE_DIRNAME 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the `err' function. */
+#define HAVE_ERR 1
+
+/* Define to 1 if you have the <err.h> header file. */
+#define HAVE_ERR_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `fgetln' function. */
+#define HAVE_FGETLN 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#define HAVE_FSEEKO 1
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#define HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `getcwd' function. */
+#define HAVE_GETCWD 1
+
+/* Define to 1 if you have the `gethostbyaddr' function. */
+#define HAVE_GETHOSTBYADDR 1
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#define HAVE_GETHOSTBYNAME 1
+
+/* Define to 1 if you have the `gethostbyname2' function. */
+#define HAVE_GETHOSTBYNAME2 1
+
+/* Define to 1 if you have the `gethostname' function. */
+#define HAVE_GETHOSTNAME 1
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#define HAVE_GETNAMEINFO 1
+
+/* Define to 1 if you have the `getpass' function. */
+#define HAVE_GETPASS 1
+
+/* Define to 1 if you have the `getpassphrase' function. */
+/* #undef HAVE_GETPASSPHRASE */
+
+/* Define to 1 if you have the `getpgrp' function. */
+#define HAVE_GETPGRP 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#define HAVE_INET_NTOP 1
+
+/* Define to 1 if you have the `inet_pton' function. */
+#define HAVE_INET_PTON 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if the system has the type `in_port_t'. */
+#define HAVE_IN_PORT_T 1
+
+/* Define to 1 if you have the `isascii' function. */
+#define HAVE_ISASCII 1
+
+/* Define to 1 if you have the <libgen.h> header file. */
+#define HAVE_LIBGEN_H 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define to 1 if the system has the type `long double'. */
+#define HAVE_LONG_DOUBLE 1
+
+/* Define to 1 if the system has the type `long long int'. */
+#define HAVE_LONG_LONG_INT 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+/* #undef HAVE_MALLOC_H */
+
+/* Define to 1 if you have the `memchr' function. */
+#define HAVE_MEMCHR 1
+
+/* Define to 1 if you have the `memmove' function. */
+#define HAVE_MEMMOVE 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `mkstemp' function. */
+#define HAVE_MKSTEMP 1
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#define HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#define HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+#define HAVE_NETINET_IN_SYSTM_H 1
+
+/* Define to 1 if you have the <netinet/ip.h> header file. */
+#define HAVE_NETINET_IP_H 1
+
+/* Define to 1 if you have the <paths.h> header file. */
+#define HAVE_PATHS_H 1
+
+/* Define if we have poll() and it is not emulated. */
+#define HAVE_POLL 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#define HAVE_POLL_H 1
+
+/* Define if `long long' is supported and *printf() supports %lld or %qd to
+ print them. */
+#define HAVE_PRINTF_LONG_LONG 1
+
+/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld). */
+/* #undef HAVE_PRINTF_QD */
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#define HAVE_PWD_H 1
+
+/* Define to 1 if you have the `realpath' function. */
+#define HAVE_REALPATH 1
+
+/* Define to 1 if you have the `regcomp' function. */
+#define HAVE_REGCOMP 1
+
+/* Define to 1 if you have the <regex.h> header file. */
+#define HAVE_REGEX_H 1
+
+/* Define to 1 if you have the <resolv.h> header file. */
+#define HAVE_RESOLV_H 1
+
+/* Define to 1 if the system has the type `sa_family_t'. */
+#define HAVE_SA_FAMILY_T 1
+
+/* Define to 1 if you have the `select' function. */
+#define HAVE_SELECT 1
+
+/* Define to 1 if you have the <setjmp.h> header file. */
+#define HAVE_SETJMP_H 1
+
+/* Define to 1 if you have the `setlocale' function. */
+#define HAVE_SETLOCALE 1
+
+/* Define to 1 if you have the `setprogname' function. */
+#define HAVE_SETPROGNAME 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the `sl_init' function. */
+#define HAVE_SL_INIT 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the `socket' function. */
+#define HAVE_SOCKET 1
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#define HAVE_SOCKLEN_T 1
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#define HAVE_STDDEF_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#define HAVE_STRCASECMP 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strcoll' function and it is properly defined.
+ */
+#define HAVE_STRCOLL 1
+
+/* Define to 1 if you have the `strcspn' function. */
+#define HAVE_STRCSPN 1
+
+/* Define to 1 if you have the `strdup' function. */
+#define HAVE_STRDUP 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+#define HAVE_STRLCAT 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the `strpbrk' function. */
+#define HAVE_STRPBRK 1
+
+/* Define to 1 if you have the `strptime' function. */
+#define HAVE_STRPTIME 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if you have the `strsep' function. */
+#define HAVE_STRSEP 1
+
+/* Define to 1 if you have the `strstr' function. */
+#define HAVE_STRSTR 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the `strtoll' function. */
+#define HAVE_STRTOLL 1
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Define to 1 if the system has the type `struct addrinfo'. */
+#define HAVE_STRUCT_ADDRINFO 1
+
+/* Define to 1 if `struct dirent' is a member of `d_namlen'. */
+#define HAVE_STRUCT_DIRENT_D_NAMLEN 1
+
+/* Define to 1 if the system has the type `struct pollfd'. */
+#define HAVE_STRUCT_POLLFD 1
+
+/* Define to 1 if the system has the type `struct sockaddr_in6'. */
+#define HAVE_STRUCT_SOCKADDR_IN6 1
+
+/* Define to 1 if `struct sockaddr_in' is a member of `sin_len'. */
+#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
+
+/* Define to 1 if `struct sockaddr' is a member of `sa_len'. */
+#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
+
+/* Define to 1 if you have the `strunvis' function. */
+#define HAVE_STRUNVIS 1
+
+/* Define to 1 if you have the `strvis' function. */
+#define HAVE_STRVIS 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#define HAVE_SYS_POLL_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/syslimits.h> header file. */
+#define HAVE_SYS_SYSLIMITS_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <termcap.h> header file. */
+#define HAVE_TERMCAP_H 1
+
+/* Define to 1 if you have the <termios.h> header file. */
+#define HAVE_TERMIOS_H 1
+
+/* Define to 1 if you have the `timegm' function. */
+#define HAVE_TIMEGM 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `usleep' function. */
+#define HAVE_USLEEP 1
+
+/* Define to 1 if you have the `utime' function. */
+#define HAVE_UTIME 1
+
+/* Define to 1 if you have the `utimes' function. */
+#define HAVE_UTIMES 1
+
+/* Define to 1 if you have the <utime.h> header file. */
+#define HAVE_UTIME_H 1
+
+/* Define to 1 if you have the `vfork' function. */
+#define HAVE_VFORK 1
+
+/* Define to 1 if you have the <vfork.h> header file. */
+/* #undef HAVE_VFORK_H */
+
+/* Define to 1 if you have the <vis.h> header file. */
+#define HAVE_VIS_H 1
+
+/* Define to 1 if `fork' works. */
+#define HAVE_WORKING_FORK 1
+
+/* Define to 1 if `vfork' works. */
+#define HAVE_WORKING_VFORK 1
+
+/* Name of package */
+#define PACKAGE "tnftp"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "lukem@NetBSD.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "tnftp"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "tnftp 20100108"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "tnftp"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "20100108"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+/* #undef STACK_DIRECTION */
+
+/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+/* #undef STAT_MACROS_BROKEN */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define if using (Dante) SOCKS5 proxy. */
+/* #undef USE_SOCKS */
+
+/* Version number of package */
+#define VERSION "20100108"
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+/* #undef _LARGEFILE_SOURCE */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define to `long int' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define as `fork' if `vfork' does not work. */
+/* #undef vfork */
+
+
+/* Define if using IPv6 support. */
+/* Commented out so this can be selected fromt he Makefile -gavin */
+/* #define USE_INET6 1 */
+
+#define USE_GLOB_H 1
diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile
index 98fceeb..f09a7d6 100644
--- a/usr.bin/grep/Makefile
+++ b/usr.bin/grep/Makefile
@@ -2,9 +2,16 @@
# $FreeBSD$
# $OpenBSD: Makefile,v 1.6 2003/06/25 15:00:04 millert Exp $
+.include <bsd.own.mk>
+
+.if ${MK_BSD_GREP} == "yes"
PROG= grep
+.else
+PROG= bsdgrep
+.endif
SRCS= fastgrep.c file.c grep.c queue.c util.c
+.if ${MK_BSD_GREP} == "yes"
LINKS= ${BINDIR}/grep ${BINDIR}/egrep \
${BINDIR}/grep ${BINDIR}/fgrep \
${BINDIR}/grep ${BINDIR}/zgrep \
@@ -16,8 +23,10 @@ MLINKS= grep.1 egrep.1 \
grep.1 zgrep.1 \
grep.1 zegrep.1 \
grep.1 zfgrep.1
+.endif
-WARNS?= 6
+bsdgrep.1: grep.1
+ cp ${.ALLSRC} ${.TARGET}
LDADD= -lz -lbz2
DPADD= ${LIBZ} ${LIBBZ2}
diff --git a/usr.bin/grep/fastgrep.c b/usr.bin/grep/fastgrep.c
index d5c9d31..bc8a3af 100644
--- a/usr.bin/grep/fastgrep.c
+++ b/usr.bin/grep/fastgrep.c
@@ -89,7 +89,7 @@ fastcomp(fastgrep_t *fg, const char *pat)
fg->bol = false;
fg->eol = false;
fg->reversed = false;
- fg->word = wflag;
+ fg->word = false;
/* Remove end-of-line character ('$'). */
if (fg->len > 0 && pat[fg->len - 1] == '$') {
diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c
index 0047650..d03c13c 100644
--- a/usr.bin/grep/grep.c
+++ b/usr.bin/grep/grep.c
@@ -73,7 +73,7 @@ const char *errstr[] = {
};
/* Flags passed to regcomp() and regexec() */
-int cflags = 0;
+int cflags = REG_NOSUB;
int eflags = REG_STARTEND;
/* Shortcut for matching all cases like empty regex */
@@ -519,6 +519,7 @@ main(int argc, char *argv[])
break;
case 'o':
oflag = true;
+ cflags &= ~REG_NOSUB;
break;
case 'p':
linkbehave = LINK_SKIP;
@@ -552,9 +553,11 @@ main(int argc, char *argv[])
break;
case 'w':
wflag = true;
+ cflags &= ~REG_NOSUB;
break;
case 'x':
xflag = true;
+ cflags &= ~REG_NOSUB;
break;
case 'Z':
filebehave = FILE_GZIP;
@@ -588,6 +591,7 @@ main(int argc, char *argv[])
strcasecmp("none", optarg) != 0 &&
strcasecmp("no", optarg) != 0)
errx(2, getstr(3), "--color");
+ cflags &= ~REG_NOSUB;
break;
case LABEL_OPT:
label = optarg;
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index dece127..683a537 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -301,18 +301,17 @@ procline(struct str *l, int nottext)
* XXX: grep_search() is a workaround for speed up and should be
* removed in the future. See fastgrep.c.
*/
- if (fg_pattern[i].pattern) {
+ if (fg_pattern[i].pattern)
r = grep_search(&fg_pattern[i],
(unsigned char *)l->dat,
l->len, &pmatch);
- r = (r == 0) ? 0 : REG_NOMATCH;
- st = pmatch.rm_eo;
- } else {
+ else
r = regexec(&r_pattern[i], l->dat, 1,
&pmatch, eflags);
- r = (r == 0) ? 0 : REG_NOMATCH;
- st = pmatch.rm_eo;
- }
+ r = (r == 0) ? 0 : REG_NOMATCH;
+ st = (cflags & REG_NOSUB)
+ ? (size_t)l->len
+ : (size_t)pmatch.rm_eo;
if (r == REG_NOMATCH)
continue;
/* Check for full match */
@@ -321,8 +320,7 @@ procline(struct str *l, int nottext)
(size_t)pmatch.rm_eo != l->len)
r = REG_NOMATCH;
/* Check for whole word match */
- if (r == 0 && fg_pattern[i].word &&
- pmatch.rm_so != 0) {
+ if (r == 0 && (wflag || fg_pattern[i].word)) {
wint_t wbegin, wend;
wbegin = wend = L' ';
@@ -330,11 +328,13 @@ procline(struct str *l, int nottext)
sscanf(&l->dat[pmatch.rm_so - 1],
"%lc", &wbegin) != 1)
r = REG_NOMATCH;
- else if ((size_t)pmatch.rm_eo != l->len &&
+ else if ((size_t)pmatch.rm_eo !=
+ l->len &&
sscanf(&l->dat[pmatch.rm_eo],
"%lc", &wend) != 1)
r = REG_NOMATCH;
- else if (iswword(wbegin) || iswword(wend))
+ else if (iswword(wbegin) ||
+ iswword(wend))
r = REG_NOMATCH;
}
if (r == 0) {
@@ -343,7 +343,8 @@ procline(struct str *l, int nottext)
if (m < MAX_LINE_MATCHES)
matches[m++] = pmatch;
/* matches - skip further patterns */
- if ((color != NULL && !oflag) || qflag || lflag)
+ if ((color == NULL && !oflag) ||
+ qflag || lflag)
break;
}
}
@@ -353,7 +354,7 @@ procline(struct str *l, int nottext)
break;
}
/* One pass if we are not recording matches */
- if ((color != NULL && !oflag) || qflag || lflag)
+ if ((color == NULL && !oflag) || qflag || lflag)
break;
if (st == (size_t)pmatch.rm_so)
diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c
index 927493e..217660e 100644
--- a/usr.bin/gzip/gzip.c
+++ b/usr.bin/gzip/gzip.c
@@ -1782,7 +1782,8 @@ handle_pathname(char *path)
}
retry:
- if (stat(path, &sb) != 0 || (fflag == 0 && lstat(path, &sb) != 0)) {
+ if (stat(path, &sb) != 0 || (fflag == 0 && cflag == 0 &&
+ lstat(path, &sb) != 0)) {
/* lets try <path>.gz if we're decompressing */
if (dflag && s == NULL && errno == ENOENT) {
len = strlen(path);
diff --git a/usr.bin/iconv/Makefile b/usr.bin/iconv/Makefile
index 7e8f6e7..deab092 100644
--- a/usr.bin/iconv/Makefile
+++ b/usr.bin/iconv/Makefile
@@ -7,8 +7,6 @@ PROG= iconv
#SRCS= iconv.c
MAN= iconv.1
-WARNS?= 6
-
LDADD+= -lcrypt
DPADD+= ${LIBCRYPT}
diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr
index afff24d..d6fa870 100644
--- a/usr.bin/kdump/mksubr
+++ b/usr.bin/kdump/mksubr
@@ -1,5 +1,28 @@
#!/bin/sh
#
+# Copyright (c) 2006 "David Kirchner" <dpk@dpk.net>. All rights reserved.
+#
+# 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 AUTHOR 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 AUTHOR 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.
+#
# $FreeBSD$
#
# Generates kdump_subr.c
@@ -345,7 +368,7 @@ auto_if_type "sockfamilyname" "AF_[[:alnum:]]+[[:space:]]+" "sys/socket.h"
auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h"
auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h"
auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h"
-auto_switch_type "ptraceopname" "PT_[[:alnum:]]+[[:space:]]+[0-9]+" "sys/ptrace.h"
+auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h"
cat <<_EOF_
/*
diff --git a/usr.bin/ldd/sods.c b/usr.bin/ldd/sods.c
index e6de90f..adf0f4f 100644
--- a/usr.bin/ldd/sods.c
+++ b/usr.bin/ldd/sods.c
@@ -142,6 +142,24 @@ main(int argc, char *argv[])
}
#endif
+static inline const void *align_struct(const void *expr)
+{
+ assert(!(((int)expr) & 3));
+ return expr;
+}
+
+static inline const void *align_long(const void *expr)
+{
+ assert(!(((int)expr) & 3));
+ return expr;
+}
+
+static inline const void *align_short(const void *expr)
+{
+ assert(!(((int)expr) & 1));
+ return expr;
+}
+
#ifdef STANDALONE
static
#endif
@@ -182,7 +200,7 @@ dump_file(const char *fname)
file_base = (const char *) objbase; /* Makes address arithmetic easier */
- if (IS_ELF(*(const Elf32_Ehdr*) file_base)) {
+ if (IS_ELF(*(const Elf32_Ehdr*) align_struct(file_base))) {
warnx("%s: this is an ELF program; use objdump to examine", fname);
++error_count;
munmap(objbase, sb.st_size);
@@ -190,7 +208,7 @@ dump_file(const char *fname)
return;
}
- ex = (const struct exec *) file_base;
+ ex = (const struct exec *) align_struct(file_base);
printf("%s: a_midmag = 0x%lx\n", fname, (long)ex->a_midmag);
printf(" magic = 0x%lx = 0%lo, netmagic = 0x%lx = 0%lo\n",
@@ -214,8 +232,9 @@ dump_file(const char *fname)
text_base = file_base + N_TXTOFF(*ex);
data_base = file_base + N_DATOFF(*ex);
- rel_base = (const struct relocation_info *) (file_base + N_RELOFF(*ex));
- sym_base = (const struct nlist *) (file_base + N_SYMOFF(*ex));
+ rel_base = (const struct relocation_info *)
+ align_struct(file_base + N_RELOFF(*ex));
+ sym_base = (const struct nlist *) align_struct(file_base + N_SYMOFF(*ex));
str_base = file_base + N_STROFF(*ex);
rel_count = (ex->a_trsize + ex->a_drsize) / sizeof rel_base[0];
@@ -276,19 +295,20 @@ dump_file(const char *fname)
printf(" Object file, origin = %lx\n", origin);
if (N_GETFLAG(*ex) & EX_DYNAMIC) {
- dyn = (const struct _dynamic *) data_base;
+ dyn = (const struct _dynamic *) align_struct(data_base);
printf(" Dynamic version = %d\n", dyn->d_version);
sdt = (const struct section_dispatch_table *)
- (text_addr + (unsigned long) dyn->d_un.d_sdt);
+ align_struct(text_addr + (unsigned long) dyn->d_un.d_sdt);
- rtrel_base =
- (const struct relocation_info *) (text_addr + sdt->sdt_rel);
+ rtrel_base = (const struct relocation_info *)
+ align_struct(text_addr + sdt->sdt_rel);
rtrel_count = (sdt->sdt_hash - sdt->sdt_rel) / sizeof rtrel_base[0];
assert(rtrel_count * sizeof rtrel_base[0] ==
(size_t)(sdt->sdt_hash - sdt->sdt_rel));
- rtsym_base = (const struct nzlist *) (text_addr + sdt->sdt_nzlist);
+ rtsym_base = (const struct nzlist *)
+ align_struct(text_addr + sdt->sdt_nzlist);
rtsym_count = (sdt->sdt_strings - sdt->sdt_nzlist) /
sizeof rtsym_base[0];
assert(rtsym_count * sizeof rtsym_base[0] ==
@@ -352,11 +372,13 @@ dump_rels(const char *label, const struct relocation_info *base,
break;
case 2:
snprintf(contents, sizeof contents, " [%04x]",
- *(unsigned const short *)(text_addr + r->r_address));
+ *(unsigned const short *)
+ align_short(text_addr + r->r_address));
break;
case 4:
snprintf(contents, sizeof contents, "[%08lx]",
- *(unsigned const long *)(text_addr + r->r_address));
+ *(unsigned const long *)
+ align_long(text_addr + r->r_address));
break;
}
} else
@@ -429,7 +451,7 @@ dump_sods(void)
sod_offset = sdt->sdt_sods;
printf(" Shared object dependencies:\n");
while (sod_offset != 0) {
- const struct sod *sodp = (const struct sod *) (text_addr + sod_offset);
+ const struct sod *sodp = (const struct sod *) align_struct((text_addr + sod_offset));
const char *name = (const char *) (text_addr + sodp->sod_name);
if (sodp->sod_library)
diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1
index 58f43e5..a9002ec 100644
--- a/usr.bin/man/man.1
+++ b/usr.bin/man/man.1
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 1, 2010
+.Dd June 3, 2011
.Dt MAN 1
.Os
.Sh NAME
@@ -73,8 +73,12 @@ environment variable.
.It Fl P Ar pager
Use specified pager.
Defaults to
+.Ic "less -sR"
+if color support is enabled, or
.Ic "more -s" .
Overrides the
+.Ev MANPAGER
+environment variable, which in turn overrides the
.Ev PAGER
environment variable.
.It Fl S Ar mansect
@@ -283,9 +287,25 @@ Restricts manual sections searched to the specified colon delimited list.
Corresponds to the
.Fl S
option.
-.It Ev PAGER
+.It Ev MANWIDTH
+If set to a numeric value, used as the width manpages should be displayed.
+Otherwise, if set to a special value
+.Dq Li tty ,
+and output is to a terminal,
+the pages may be displayed over the whole width of the screen.
+.It Ev MANCOLOR
+If set, enables color support.
+.It Ev MANPAGER
Program used to display files.
-If unset,
+.Pp
+If unset, and color support is enabled,
+.Ic "less -sR"
+is used.
+.Pp
+If unset, and color support is disabled, then
+.Ev PAGER
+is used.
+If that has no value either,
.Ic "more -s"
is used.
.El
diff --git a/usr.bin/man/man.conf.5 b/usr.bin/man/man.conf.5
index 6326bc1..24f8226 100644
--- a/usr.bin/man/man.conf.5
+++ b/usr.bin/man/man.conf.5
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 1, 2010
+.Dd June 3, 2011
.Os
.Dt MAN.CONF 5
.Sh NAME
@@ -72,7 +72,6 @@ For pages in a given language, overriding the default toolset for
display is supported via the following definitions:
.Bl -tag -offset indent -compact
.It EQN Ns _ Ns Va LANG
-.It COL Ns _ Ns Va LANG
.It NROFF Ns _ Ns Va LANG
.It PIC Ns _ Ns Va LANG
.It TBL Ns _ Ns Va LANG
@@ -112,7 +111,7 @@ with the following contents:
.Bd -literal -offset indent
# Setup Japanese toolset
MANLOCALE ja_JP.eucJP
-EQN_JA /usr/local/bin/gepn
+EQN_JA /usr/local/bin/geqn
PIC_JA /usr/local/bin/gpic
TBL_JA /usr/local/bin/gtbl
NROFF_JA /usr/local/bin/groff -man -dlang=ja_JP.eucJP
diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh
index f1c91ee..98749a6 100755
--- a/usr.bin/man/man.sh
+++ b/usr.bin/man/man.sh
@@ -112,7 +112,11 @@ check_man() {
setup_cattool $manpage
decho " Found manpage $manpage"
- if exists "$2" && is_newer $found $manpage; then
+ if [ -n "${use_width}" ]; then
+ # non-standard width
+ unset use_cat
+ decho " Skipping catpage: non-standard page width"
+ elif exists "$2" && is_newer $found $manpage; then
# cat page found and is newer, use that
use_cat=yes
catpage=$found
@@ -275,7 +279,7 @@ man_check_for_so() {
# Usage: man_display_page
# Display either the manpage or catpage depending on the use_cat variable
man_display_page() {
- local EQN COL NROFF PIC TBL TROFF REFER VGRIND
+ local EQN NROFF PIC TBL TROFF REFER VGRIND
local IFS l nroff_dev pipeline preproc_arg tool
# We are called with IFS set to colon. This causes really weird
@@ -290,10 +294,10 @@ man_display_page() {
ret=0
else
if [ $debug -gt 0 ]; then
- decho "Command: $cattool $catpage | $PAGER"
+ decho "Command: $cattool $catpage | $MANPAGER"
ret=0
else
- eval "$cattool $catpage | $PAGER"
+ eval "$cattool $catpage | $MANPAGER"
ret=$?
fi
fi
@@ -343,7 +347,7 @@ man_display_page() {
# Allow language specific calls to override the default
# set of utilities.
l=$(echo $man_lang | tr [:lower:] [:upper:])
- for tool in EQN COL NROFF PIC TBL TROFF REFER VGRIND; do
+ for tool in EQN NROFF PIC TBL TROFF REFER VGRIND; do
eval "$tool=\${${tool}_$l:-\$$tool}"
done
;;
@@ -352,6 +356,14 @@ man_display_page() {
;;
esac
+ if [ -z "$MANCOLOR" ]; then
+ NROFF="$NROFF -P-c"
+ fi
+
+ if [ -n "${use_width}" ]; then
+ NROFF="$NROFF -rLL=${use_width}n -rLT=${use_width}n"
+ fi
+
if [ -n "$MANROFFSEQ" ]; then
set -- -$MANROFFSEQ
while getopts 'egprtv' preproc_arg; do
@@ -360,7 +372,7 @@ man_display_page() {
g) ;; # Ignore for compatability.
p) pipeline="$pipeline | $PIC" ;;
r) pipeline="$pipeline | $REFER" ;;
- t) pipeline="$pipeline | $TBL"; use_col=yes ;;
+ t) pipeline="$pipeline | $TBL" ;;
v) pipeline="$pipeline | $VGRIND" ;;
*) usage ;;
esac
@@ -369,19 +381,12 @@ man_display_page() {
pipeline="${pipeline#" | "}"
else
pipeline="$TBL"
- use_col=yes
fi
if [ -n "$tflag" ]; then
pipeline="$pipeline | $TROFF"
else
- pipeline="$pipeline | $NROFF"
-
- if [ -n "$use_col" ]; then
- pipeline="$pipeline | $COL"
- fi
-
- pipeline="$pipeline | $PAGER"
+ pipeline="$pipeline | $NROFF | $MANPAGER"
fi
if [ $debug -gt 0 ]; then
@@ -483,7 +488,7 @@ man_parse_args() {
while getopts 'M:P:S:adfhkm:op:tw' cmd_arg; do
case "${cmd_arg}" in
M) MANPATH=$OPTARG ;;
- P) PAGER=$OPTARG ;;
+ P) MANPAGER=$OPTARG ;;
S) MANSECT=$OPTARG ;;
a) aflag=aflag ;;
d) debug=$(( $debug + 1 )) ;;
@@ -562,6 +567,35 @@ man_setup() {
build_manpath
man_setup_locale
+ man_setup_width
+}
+
+# Usage: man_setup_width
+# Set up page width.
+man_setup_width() {
+ local sizes
+
+ unset use_width
+ case "$MANWIDTH" in
+ [0-9]*)
+ if [ "$MANWIDTH" -gt 0 2>/dev/null ]; then
+ use_width=$MANWIDTH
+ fi
+ ;;
+ [Tt][Tt][Yy])
+ if { sizes=$($STTY size 0>&3 2>/dev/null); } 3>&1; then
+ set -- $sizes
+ if [ $2 -gt 80 ]; then
+ use_width=$(($2-2))
+ fi
+ fi
+ ;;
+ esac
+ if [ -n "$use_width" ]; then
+ decho "Using non-standard page width: ${use_width}"
+ else
+ decho 'Using standard page width'
+ fi
}
# Usage: man_setup_locale
@@ -667,7 +701,7 @@ parse_file() {
manlocales="$manlocales:$tstr"
;;
MANCONFIG*) decho " MANCONFIG" 3
- trim "${line#MANCONF}"
+ trim "${line#MANCONFIG}"
config_local="$tstr"
;;
# Set variables in the form of FOO_BAR
@@ -778,7 +812,7 @@ search_whatis() {
bad=${bad#\\n}
if [ -n "$good" ]; then
- echo -e "$good" | $PAGER
+ echo -e "$good" | $MANPAGER
fi
if [ -n "$bad" ]; then
@@ -802,13 +836,21 @@ setup_cattool() {
}
# Usage: setup_pager
-# Correctly sets $PAGER
+# Correctly sets $MANPAGER
setup_pager() {
# Setup pager.
- if [ -z "$PAGER" ]; then
- PAGER="more -s"
+ if [ -z "$MANPAGER" ]; then
+ if [ -n "$MANCOLOR" ]; then
+ MANPAGER="less -sR"
+ else
+ if [ -n "$PAGER" ]; then
+ MANPAGER="$PAGER"
+ else
+ MANPAGER="more -s"
+ fi
+ fi
fi
- decho "Using pager: $PAGER"
+ decho "Using pager: $MANPAGER"
}
# Usage: trim string
@@ -891,15 +933,15 @@ do_whatis() {
# User's PATH setting decides on the groff-suite to pick up.
EQN=eqn
-NROFF='groff -S -P-c -Wall -mtty-char -man'
+NROFF='groff -S -P-h -Wall -mtty-char -man'
PIC=pic
REFER=refer
TBL=tbl
-TROFF='groff -S -P-c -man'
+TROFF='groff -S -man'
VGRIND=vgrind
-COL=/usr/bin/col
LOCALE=/usr/bin/locale
+STTY=/bin/stty
SYSCTL=/sbin/sysctl
debug=0
diff --git a/usr.bin/mkcsmapper/mkcsmapper.1 b/usr.bin/mkcsmapper/mkcsmapper.1
index a2666b4..650df50 100644
--- a/usr.bin/mkcsmapper/mkcsmapper.1
+++ b/usr.bin/mkcsmapper/mkcsmapper.1
@@ -35,7 +35,7 @@
.\" $FreeBSD$
.\"
.Dd Sep 6, 2009
-.Dt mkcsmapper 1
+.Dt MKCSMAPPER 1
.Os
.Sh NAME
.Nm mkcsmapper
diff --git a/usr.bin/mkesdb/mkesdb.1 b/usr.bin/mkesdb/mkesdb.1
index 2e06371..66eb390 100644
--- a/usr.bin/mkesdb/mkesdb.1
+++ b/usr.bin/mkesdb/mkesdb.1
@@ -35,7 +35,7 @@
.\" $FreeBSD$
.\"
.Dd November 1, 2009
-.Dt mkesdb 1
+.Dt MKESDB 1
.Os
.Sh NAME
.Nm mkesdb
diff --git a/usr.bin/printf/printf.1 b/usr.bin/printf/printf.1
index 56c6855..792529a 100644
--- a/usr.bin/printf/printf.1
+++ b/usr.bin/printf/printf.1
@@ -31,7 +31,7 @@
.\" @(#)printf.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd April 25, 2011
+.Dd May 28, 2011
.Dt PRINTF 1
.Os
.Sh NAME
@@ -68,8 +68,7 @@ otherwise it is evaluated as a C constant, with the following extensions:
A leading plus or minus sign is allowed.
.It
If the leading character is a single or double quote, the value is the
-.Tn ASCII
-code of the next character.
+character code of the next character.
.El
.Pp
The format string is reused as often as necessary to satisfy the
@@ -172,7 +171,7 @@ A `\-' overrides a `0' if both are used;
.It "Field Width:"
An optional digit string specifying a
.Em field width ;
-if the output string has fewer characters than the field width it will
+if the output string has fewer bytes than the field width it will
be blank-padded on the left (or right, if the left-adjustment indicator
has been given) to make up the field width (note that a leading zero
is a flag, but an embedded zero is part of a field width);
@@ -186,7 +185,7 @@ for
.Cm e
and
.Cm f
-formats, or the maximum number of characters to be printed
+formats, or the maximum number of bytes to be printed
from a string; if the digit string is missing, the precision is treated
as zero;
.It Format:
@@ -272,15 +271,15 @@ and
.Ql nan ,
respectively.
.It Cm c
-The first character of
+The first byte of
.Ar argument
is printed.
.It Cm s
-Characters from the string
+Bytes from the string
.Ar argument
-are printed until the end is reached or until the number of characters
+are printed until the end is reached or until the number of bytes
indicated by the precision specification is reached; however if the
-precision is 0 or missing, all characters in the string are printed.
+precision is 0 or missing, the string is printed entirely.
.It Cm b
As for
.Cm s ,
@@ -347,6 +346,17 @@ to interpret the dash as a program argument.
.Nm --
must be used before
.Ar format .
+.Pp
+If the locale contains multibyte characters
+(such as UTF-8),
+the
+.Cm c
+format and
+.Cm b
+and
+.Cm s
+formats with a precision
+may not operate as expected.
.Sh BUGS
Since the floating point numbers are translated from
.Tn ASCII
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 56c1caf..eace370 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -58,6 +58,7 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <wchar.h>
#ifdef SHELL
#define main printfcmd
@@ -537,10 +538,23 @@ static int
asciicode(void)
{
int ch;
-
- ch = **gargv;
- if (ch == '\'' || ch == '"')
- ch = (*gargv)[1];
+ wchar_t wch;
+ mbstate_t mbs;
+
+ ch = (unsigned char)**gargv;
+ if (ch == '\'' || ch == '"') {
+ memset(&mbs, 0, sizeof(mbs));
+ switch (mbrtowc(&wch, *gargv + 1, MB_LEN_MAX, &mbs)) {
+ case (size_t)-2:
+ case (size_t)-1:
+ wch = (unsigned char)gargv[0][1];
+ break;
+ case 0:
+ wch = 0;
+ break;
+ }
+ ch = wch;
+ }
++gargv;
return (ch);
}
diff --git a/usr.bin/rctl/Makefile b/usr.bin/rctl/Makefile
index 1088cf1..c5c32eb 100644
--- a/usr.bin/rctl/Makefile
+++ b/usr.bin/rctl/Makefile
@@ -6,6 +6,4 @@ MAN= rctl.8
DPADD= ${LIBUTIL}
LDADD= -lutil
-WARNS?= 6
-
.include <bsd.prog.mk>
diff --git a/usr.bin/rctl/rctl.8 b/usr.bin/rctl/rctl.8
index bddd313..98c9d4e 100644
--- a/usr.bin/rctl/rctl.8
+++ b/usr.bin/rctl/rctl.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 3, 2011
+.Dd May 26, 2011
.Dt RCTL 8
.Os
.Sh NAME
@@ -82,7 +82,7 @@ Use unit suffixes: Byte, Kilobyte, Megabyte,
Gigabyte, Terabyte and Petabyte.
.It Fl n
Display user IDs numerically rather than converting them to a user name.
-.Pp
+.El
.Sh RULE SYNTAX
Syntax for a rule is subject:subject-id:resource:action=amount/per.
.Pp
@@ -123,7 +123,6 @@ A filter that matches all defined rules for nproc resource would be
.Sh RESOURCES
.Bl -column -offset 3n "msgqqueued"
.It cpu CPU time, in milliseconds
-.It fsize maximum file size, in bytes
.It data data size, in bytes
.It stack stack size, in bytes
.It core core dump size, in bytes
@@ -131,7 +130,6 @@ A filter that matches all defined rules for nproc resource would be
.It memlock locked memory, in bytes
.It nproc number of processes
.It nofile file descriptor table size
-.It sbsize memory consumed by socket buffers, in bytes
.It vmem address space limit, in bytes
.It npts number of PTYs
.It swap swap usage, in bytes
diff --git a/usr.bin/su/su.1 b/usr.bin/su/su.1
index 8b79d41..d9180e3 100644
--- a/usr.bin/su/su.1
+++ b/usr.bin/su/su.1
@@ -28,7 +28,7 @@
.\" @(#)su.1 8.2 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd July 1, 2008
+.Dd June 6, 2011
.Dt SU 1
.Os
.Sh NAME
@@ -193,16 +193,22 @@ PAM configuration for
.Sh EXAMPLES
.Bl -tag -width 5n -compact
.It Li "su -m man -c catman"
-Runs the command
-.Li catman
-as user
-.Li man .
+Starts a shell as user
+.Li man ,
+and runs the command
+.Li catman .
You will be asked for man's password unless your real UID is 0.
Note that the
.Fl m
option is required since user
.Dq man
does not have a valid shell by default.
+In this example,
+.Fl c
+is passed to the shell of the user
+.Dq man ,
+and is not interpreted as an argument to
+.Nm .
.It Li "su -m man -c 'catman /usr/share/man /usr/local/man'"
Same as above, but the target command consists of more than a
single word and hence is quoted for use with the
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index 989a5ae..2bdcf5f 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -155,7 +155,7 @@ static struct cmd cmdtab[] = {
{ "options", setoptions,
"enable or disable RFC2347 style options" },
{ "help", help, "print help information" },
- { "packetdrop", setpacketdrop, "artifical packetloss feature" },
+ { "packetdrop", setpacketdrop, "artificial packetloss feature" },
{ "?", help, "print help information" },
{ NULL, NULL, NULL }
};
@@ -840,8 +840,8 @@ help(int argc, char *argv[])
printf("%-*s\t%s\n", (int)HELPINDENT, c->name, c->help);
printf("\n[-] : You shouldn't use these ones anymore.\n");
- printf("[*] : RFC2834 options support required.\n");
- printf("[**] : Non-standard RFC2834 option.\n");
+ printf("[*] : RFC2347 options support required.\n");
+ printf("[**] : Non-standard RFC2347 option.\n");
return;
}
while (--argc > 0) {
@@ -955,7 +955,7 @@ setblocksize(int argc, char *argv[])
if (!options_rfc_enabled)
printf("RFC2347 style options are not enabled "
- "(but proceding anyway)\n");
+ "(but proceeding anyway)\n");
if (argc != 1) {
int size = atoi(argv[1]);
@@ -993,7 +993,7 @@ setblocksize2(int argc, char *argv[])
if (!options_rfc_enabled || !options_extra_enabled)
printf(
"RFC2347 style or non-RFC defined options are not enabled "
- "(but proceding anyway)\n");
+ "(but proceeding anyway)\n");
if (argc != 1) {
int size = atoi(argv[1]);
diff --git a/usr.bin/tftp/tftp.1 b/usr.bin/tftp/tftp.1
index 29acdad..bf8720b 100644
--- a/usr.bin/tftp/tftp.1
+++ b/usr.bin/tftp/tftp.1
@@ -174,7 +174,7 @@ The
.Nm
command appeared in
.Bx 4.3 .
-.Sh BUGS
+.Sh NOTES
Because there is no user-login or validation within
the
.Tn TFTP
@@ -185,4 +185,5 @@ exact methods are specific to each site and therefore
difficult to document here.
.Pp
Files larger than 33488896 octets (65535 blocks) cannot be transferred
-without client and server supporting blocksize negotiation (RFC1783).
+without client and server supporting the TFTP blocksize option (RFC2348),
+or the non-standard TFTP rollover option.
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index f98f64e..4c55682 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -624,6 +624,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
int show_system;
int show_uid;
int show_command;
+ int show_kidle;
/*
* Save the previous process info.
@@ -664,6 +665,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
show_system = sel->system;
show_uid = sel->uid != -1;
show_command = sel->command != NULL;
+ show_kidle = sel->kidle;
/* count up process states and get pointers to interesting procs */
total_procs = 0;
@@ -705,6 +707,11 @@ get_process_info(struct system_info *si, struct process_select *sel,
/* skip idle or non-running processes */
continue;
+ if (displaymode == DISP_CPU && !show_kidle &&
+ pp->ki_tdflags & TDF_IDLETD)
+ /* skip kernel idle process */
+ continue;
+
if (displaymode == DISP_IO && !show_idle && p_io == 0)
/* skip processes that aren't doing I/O */
continue;
diff --git a/usr.bin/top/top.local.1 b/usr.bin/top/top.local.1
index d7705e8..015b969 100644
--- a/usr.bin/top/top.local.1
+++ b/usr.bin/top/top.local.1
@@ -1,10 +1,6 @@
.\" $FreeBSD$
.SH "FreeBSD NOTES"
-.SH DISPLAY OF THREADS
-The '-H' option will toggle the display of kernel visible thread contexts.
-At runtime the 'H' key will toggle this mode. The default is OFF.
-
.SH DESCRIPTION OF MEMORY
Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free
Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out
diff --git a/usr.bin/users/users.c b/usr.bin/users/users.c
index f83a592..c13cc37 100644
--- a/usr.bin/users/users.c
+++ b/usr.bin/users/users.c
@@ -50,7 +50,7 @@ static const char rcsid[] =
#include <unistd.h>
#include <utmpx.h>
-typedef char namebuf[MAXLOGNAME];
+typedef char namebuf[sizeof(((struct utmpx *)0)->ut_user) + 1];
int scmp(const void *, const void *);
static void usage(void);
diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c
index 41492cf..06a412c 100644
--- a/usr.bin/xlint/lint1/decl.c
+++ b/usr.bin/xlint/lint1/decl.c
@@ -415,9 +415,6 @@ tdeferr(type_t *td, tspec_t t)
case UINT:
case INT:
break;
-
- case NTSPEC: /* this value unused */
- break;
}
/* Anything other is not accepted. */
diff --git a/usr.bin/xlint/lint1/scan.l b/usr.bin/xlint/lint1/scan.l
index 05f4ed7..65d2d11 100644
--- a/usr.bin/xlint/lint1/scan.l
+++ b/usr.bin/xlint/lint1/scan.l
@@ -580,9 +580,6 @@ icon(int base)
case CHAR:
case UNSIGN:
break;
-
- case NTSPEC: /* this value unused */
- break;
}
if (typ != QUAD && typ != UQUAD) {
diff --git a/usr.bin/xlint/lint2/msg.c b/usr.bin/xlint/lint2/msg.c
index b4a6a31..b7855ad 100644
--- a/usr.bin/xlint/lint2/msg.c
+++ b/usr.bin/xlint/lint2/msg.c
@@ -32,6 +32,7 @@
*/
#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: msg.c,v 1.6 2002/01/21 19:49:52 tv Exp $");
#endif
@@ -127,7 +128,7 @@ mkpos(pos_t *posp)
if (len > blen)
buf = xrealloc(buf, blen = len);
if (line != 0) {
- (void)sprintf(buf, "%s%s(%hu)",
+ (void)sprintf(buf, "%s%s(%d)",
fn, qm ? "?" : "", line);
} else {
(void)sprintf(buf, "%s", fn);
diff --git a/usr.bin/xlint/lint2/read.c b/usr.bin/xlint/lint2/read.c
index 6288cc1..9dfecfd 100644
--- a/usr.bin/xlint/lint2/read.c
+++ b/usr.bin/xlint/lint2/read.c
@@ -696,8 +696,6 @@ inptype(const char *cp, const char **epp)
case SIGNED:
case NOTSPEC:
break;
- case NTSPEC:
- abort();
}
*epp = cp;
@@ -901,8 +899,6 @@ gettlen(const char *cp, const char **epp)
case UQUAD:
case LONG:
break;
- case NTSPEC:
- abort();
}
*epp = cp;
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 7fc531a..f448f03 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -3,7 +3,7 @@
.include <bsd.own.mk>
-SUBDIR= adduser \
+SUBDIR= adduser \
arp \
bootparamd \
burncd \
@@ -34,7 +34,6 @@ SUBDIR= adduser \
inetd \
iostat \
kldxref \
- lastlogin \
mailwrapper \
makefs \
manctl \
@@ -89,7 +88,6 @@ SUBDIR= adduser \
trpt \
tzsetup \
ugidfw \
- utxrm \
vipw \
wake \
watch \
@@ -99,7 +97,6 @@ SUBDIR= adduser \
# NB: keep these sorted by MK_* knobs
.if ${MK_ACCT} != "no"
-SUBDIR+= ac
SUBDIR+= accton
SUBDIR+= sa
.endif
@@ -299,6 +296,12 @@ SUBDIR+= usbconfig
SUBDIR+= usbdump
.endif
+.if ${MK_UTMPX} != "no"
+SUBDIR+= ac
+SUBDIR+= lastlogin
+SUBDIR+= utxrm
+.endif
+
.if ${MK_WIRELESS} != "no"
SUBDIR+= ancontrol
SUBDIR+= wlandebug
diff --git a/usr.sbin/bluetooth/ath3kfw/Makefile b/usr.sbin/bluetooth/ath3kfw/Makefile
index 0ff010f..373655b 100644
--- a/usr.sbin/bluetooth/ath3kfw/Makefile
+++ b/usr.sbin/bluetooth/ath3kfw/Makefile
@@ -2,7 +2,6 @@
PROG= ath3kfw
MAN= ath3kfw.8
-WARNS?= 6
DPADD+= ${LIBUSB}
LDADD+= -lusb
diff --git a/usr.sbin/bsdinstall/Makefile b/usr.sbin/bsdinstall/Makefile
index 5e39b0b..e72b5d3 100644
--- a/usr.sbin/bsdinstall/Makefile
+++ b/usr.sbin/bsdinstall/Makefile
@@ -2,5 +2,6 @@
SUBDIR= distextract distfetch partedit scripts
SCRIPTS= bsdinstall
+MAN= bsdinstall.8
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8
new file mode 100644
index 0000000..4b8b51e
--- /dev/null
+++ b/usr.sbin/bsdinstall/bsdinstall.8
@@ -0,0 +1,187 @@
+.\"-
+.\" Copyright (c) 2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>
+.\" All rights reserved.
+.\"
+.\" 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 AUTHOR ``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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 11, 2011
+.Dt bsdinstall 8
+.Os
+.Sh NAME
+.Nm bsdinstall
+.Nd system installer
+.Sh SYNOPSIS
+.Nm
+.Op Ar target
+.Op Ar ...
+.Sh DESCRIPTION
+.Nm
+is used for installation of new systems, both for system setup from
+installation media (e.g. CD-ROMs) and for use on live systems to prepare
+VM images and jails.
+.Pp
+Much like
+.Xr make 1 , Nm
+takes a target and possible parameters of the target as arguments. If
+invoked with no arguments, it will invoke the
+.Cm auto
+target, which provides a standard interactive installation, invoking the
+others in sequence. To perform a scripted installation, these subtargets
+can be invoked separately by an installation script.
+.Sh TARGETS
+Most of the following targets are only useful for scripting the installer.
+For interactive use, most users will be interested only in the
+.Cm auto
+and
+.Cm jail
+targets.
+.Bl -tag -width ".Cm jail Ar destination"
+.It Cm auto
+Run the standard interactive installation, including disk partitioning.
+.It Cm jail Ar destination
+Sets up a new chroot system at
+.Pa destination ,
+suitable for use with
+.Xr jail 8 .
+Behavior is generally similar to
+.Cm auto ,
+except that disk partitioning and network setup are skipped and a kernel is
+not installed into the new system.
+.It Cm keymap
+If the current controlling TTY is a
+.Xr syscons 4
+console, asks the user to set the current keymap, and saves the result to the
+new system's
+.Pa rc.conf .
+.It Cm hostname
+Prompts the user for a host name for the new system and saves the result to the
+new system's
+.Pa rc.conf .
+If
+.Ev BSDINSTALL_CONFIGCURRENT
+is set, also sets the host name of the current system.
+.It Cm netconfig
+Interactively configures network interfaces (first invoking
+.Cm wlanconfig
+on wireless interfaces), saving the result to the new system's
+.Pa rc.conf
+and
+.Pa resolv.conf .
+If
+.Ev BSDINSTALL_CONFIGCURRENT
+is set, also configures the network interfaces of the current system to match.
+.It Cm autopart
+Provides the installer's interactive guided disk partitioner for single-disk
+installations. Partitions disks, runs
+.Xr newfs 8 ,
+and writes the new system's
+.Pa fstab .
+.It Cm partedit
+Provides the installer's interactive manual disk partitioner, with support
+for multi disk setups, non-UFS file systems, and manual selection of
+partition schemes. Partitions disks, runs
+.Xr newfs 8 ,
+and writes the new system's
+.Pa fstab .
+.It Cm mount
+Mounts the file systems previously configured by
+.Cm autopart
+or
+.Cm partedit
+under
+.Ev BSDINSTALL_CHROOT .
+.It Cm distfetch
+Fetches the distributions in
+.Ev DISTRIBUTIONS
+to
+.Ev BSDINSTALL_DISTDIR
+from
+.Ev BSDINSTALL_DISTSITE .
+.It Cm checksum
+Verifies the checksums of the distributions listed in
+.Ev DISTRIBUTIONS
+against the distribution manifest.
+.It Cm distextract
+Extracts the distributions listed in
+.Ev DISTRIBUTIONS
+into
+.Ev BSDINSTALL_CHROOT .
+.It Cm rootpass
+Interactively invokes
+.Xr passwd 1
+in the new system to set the root user's password.
+.It Cm adduser
+Interactively invokes
+.Xr adduser 8
+in the new system.
+.It Cm time
+Interactively sets the time, date, and time zone of the new system.
+.It Cm services
+Queries the user for the system daemons to begin at system startup,
+writing the result into the new system's
+.Pa rc.conf .
+.It Cm config
+Installs the configuration files destined for the new system (e.g. rc.conf
+fragments generated by
+.Cm netconfig ,
+etc.) onto the new system.
+.El
+.Sh ENVIRONMENT VARIABLES
+The following environment variables control various aspects of the installation
+process. Many are used internally during installation and have reasonable
+default values for most installation scenarios. Others are set by various
+interactive user prompts, and can be usefully overridden when making scripted
+or customized installers.
+.Bl -tag -width ".Ev BSDINSTALL_DISTDIR"
+.It Ev DISTRIBUTIONS
+The set of distributions to install (e.g. "base kernel ports"). Default: none
+.It Ev BSDINSTALL_DISTDIR
+The directory in which the distribution files can be found (or to which they
+should be downloaded). Default:
+.Pa /usr/freebsd-dist
+.It Ev BSDINSTALL_CHROOT
+The directory into which the distribution files should be unpacked and the
+directory at which the root file system of the new system should be mounted.
+Default:
+.Pa /mnt
+.It Ev BSDINSTALL_LOG
+Path to a log file for the installation. Default:
+.Pa /tmp/bsdinstall_log
+.It Ev BSDINSTALL_TMPETC
+Directory where files destined for the new system's
+.Pa /etc
+will be stored until the
+.Cm config
+target is executed. If this directory does not already exist, it will be
+created. Default:
+.Pa /tmp/bsdinstall_etc
+.El
+.Sh HISTORY
+This version of
+.Nm
+first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+.An -nosplit
+.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
diff --git a/usr.sbin/bsdinstall/scripts/Makefile b/usr.sbin/bsdinstall/scripts/Makefile
index 8ad6744..e32fda6 100644
--- a/usr.sbin/bsdinstall/scripts/Makefile
+++ b/usr.sbin/bsdinstall/scripts/Makefile
@@ -1,7 +1,8 @@
# $FreeBSD$
SCRIPTS= auto adduser checksum config hostname jail keymap mirrorselect \
- mount netconfig rootpass services time umount wlanconfig
+ mount netconfig netconfig_ipv4 netconfig_ipv6 rootpass services \
+ time umount wlanconfig
BINDIR= /usr/libexec/bsdinstall
NO_MAN= true
diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto
index c163c2c..bdc5fc4 100755
--- a/usr.sbin/bsdinstall/scripts/auto
+++ b/usr.sbin/bsdinstall/scripts/auto
@@ -105,7 +105,7 @@ case $? in
1) # Shell
clear
echo "Use this shell to set up partitions for the new system. When finished, mount the system at $BSDINSTALL_CHROOT and place an fstab file for the new system at $PATH_FSTAB. Then type 'exit'. You can also enter the partition editor at any time by entering 'bsdinstall partedit'."
- sh
+ sh 2>&1
;;
3) # Manual
bsdinstall partedit || error
@@ -199,7 +199,7 @@ finalconfig() {
clear
echo This shell is operating in a chroot in the new system. \
When finished making configuration changes, type \"exit\".
- chroot "$BSDINSTALL_CHROOT" /bin/sh
+ chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1
# Don't hose local rc.conf changes
cp $BSDINSTALL_CHROOT/etc/rc.conf $BSDINSTALL_TMPETC/rc.conf.manual
finalconfig
diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig
index 0374d12..b78e330 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig
+++ b/usr.sbin/bsdinstall/scripts/netconfig
@@ -2,6 +2,11 @@
#-
# Copyright (c) 2011 Nathan Whitehorn
# All rights reserved.
+# Copyright (c) 2011 The FreeBSD Foundation
+# All rights reserved.
+#
+# Portions of this software were developed by Bjoern Zeeb
+# under sponsorship from the FreeBSD Foundation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -36,8 +41,6 @@ DIALOG_TAGS=""
: ${DIALOG_ITEM_HELP=4}
: ${DIALOG_ESC=255}
-echo -n > $BSDINSTALL_TMPETC/rc.conf.net
-
for IF in `ifconfig -l`; do
test "$IF" = "lo0" && continue
(ifconfig -g wlan | egrep -wq $IF) && continue
@@ -51,12 +54,14 @@ INTERFACE=`echo $DIALOG_TAGS | xargs dialog --backtitle 'FreeBSD Installer' --ti
if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
exec 3>&-
+: > $BSDINSTALL_TMPETC/._rc.conf.net
+
# Do a dirty check to see if this a wireless interface -- there should be a
# better way
IFCONFIG_PREFIX=""
if ifconfig $INTERFACE | grep -q 'media: IEEE 802.11 Wireless'; then
NEXT_WLAN_IFACE=wlan0 # XXX
- echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/rc.conf.net
+ echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/._rc.conf.net
IFCONFIG_PREFIX="WPA "
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
ifconfig $NEXT_WLAN_IFACE create wlandev $INTERFACE
@@ -66,56 +71,129 @@ if ifconfig $INTERFACE | grep -q 'media: IEEE 802.11 Wireless'; then
INTERFACE="$NEXT_WLAN_IFACE"
fi
-dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0
-if [ $? -eq $DIALOG_OK ]; then
- echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> $BSDINSTALL_TMPETC/rc.conf.net
+IPV6_AVAIL=0
+IPV4_AVAIL=0
+sysctl -N kern.features.inet6 > /dev/null 2>&1
+case $? in
+0) IPV6_AVAIL=1 ;;
+esac
+sysctl -N kern.features.inet > /dev/null 2>&1
+case $? in
+0) IPV4_AVAIL=1 ;;
+esac
- if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
- dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0
- dhclient $INTERFACE 2>> $BSDINSTALL_LOG
- if [ $? -ne 0 ]; then
- dialog --backtitle 'FreeBSD Installer' --msgbox "DHCP lease acquisition failed." 0 0
- exec $0
- fi
+if [ ${IPV4_AVAIL} -eq 1 ]; then
+ dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \
+ --yesno 'Would you like to configure IPv4 for this interface?' 0 0
+ if [ $? -eq $DIALOG_OK ]; then
+ bsdinstall netconfig_ipv4 ${INTERFACE} "${IFCONFIG_PREFIX}" || \
+ exec $0
+ else
+ IPV4_AVAIL=0
+ fi
+fi
+# In case wlanconfig left an option and we do not support IPv4 we need to write
+# it out on its own. We cannot write it out with IPv6 as that suffix.
+if [ ${IPV4_AVAIL} -eq 0 -a -n ${IFCONFIG_PREFIX} ]; then
+ echo ifconfig_${INTERFACE}=\"${IFCONFIG_PREFIX}\" >> $BSDINSTALL_TMPETC/._rc.conf.net
+fi
+if [ ${IPV6_AVAIL} -eq 1 ]; then
+ dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \
+ --yesno 'Would you like to configure IPv6 for this interface?' 0 0
+ if [ $? -eq $DIALOG_OK ]; then
+ bsdinstall netconfig_ipv6 ${INTERFACE} || exec $0
+ else
+ IPV6_AVAIL=0
fi
- exit 0
fi
-IP_ADDRESS=`ifconfig $INTERFACE inet | awk '/inet/ {printf("%s\n", $2); }'`
-NETMASK=`ifconfig $INTERFACE inet | awk '/inet/ {printf("%s\n", $4); }'`
-ROUTER=`netstat -rn -f inet | awk '/default/ {printf("%s\n", $2);}'`
+SEARCH=""
+IP4_1=""
+IP4_2=""
+IP6_1=""
+IP6_2=""
+while read key value; do
+ case "${key}" in
+ search) SEARCH="${value}" ;;
+ nameserver) # is more trick as we have to distinguish v4 and v6
+ case "${value}" in
+ [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)
+ if [ -z "${IP4_1}" ] ; then
+ IP4_1="${value}"
+ elif [ -z "${IP4_2}" ]; then
+ IP4_2="${value}"
+ fi
+ ;;
+ [0-9A-Fa-f:]*:*)
+ if [ -z "${IP6_1}" ] ; then
+ IP6_1="${value}"
+ elif [ -z "${IP6_2}" ]; then
+ IP6_2="${value}"
+ fi
+ ;;
+ esac
+ ;;
+ # ignore others
+ esac
+done < ${BSDINSTALL_TMPETC}/resolv.conf
+
+RESOLV=""
+if [ ${IPV6_AVAIL} -eq 1 -a ${IPV4_AVAIL} -eq 1 ]; then
+ RESOLV="
+ 'Search' 1 0 \"${SEARCH}\" 1 16 50 0 0
+ 'Nameserver' 2 0 \"Nameserver\" 2 16 50 0 2
+ 'IPv6 DNS #1' 2 0 \"${IP6_1}\" 2 16 50 0 0
+ 'IPv6 DNS #2' 3 0 \"${IP6_2}\" 3 16 50 0 0
+ 'IPv4 DNS #1' 4 0 \"${IP4_1}\" 4 16 16 0 0
+ 'IPv4 DNS #2' 5 0 \"${IP4_2}\" 5 16 16 0 0"
+elif [ ${IPV6_AVAIL} -eq 1 ]; then
+ RESOLV="
+ 'Search' 1 0 \"${SEARCH}\" 1 16 50 0 0
+ 'Nameserver' 2 0 \"Nameserver\" 2 16 50 0 2
+ 'IPv6 DNS #1' 2 0 \"${IP6_1}\" 2 16 50 0 0
+ 'IPv6 DNS #2' 3 0 \"${IP6_2}\" 3 16 50 0 0"
+elif [ ${IPV4_AVAIL} -eq 1 ]; then
+ RESOLV="
+ 'Search' 1 0 \"${SEARCH}\" 1 16 50 0 0
+ 'Nameserver' 2 0 \"Nameserver\" 2 16 50 0 2
+ 'IPv4 DNS #1' 2 0 \"${IP4_1}\" 2 16 16 0 0
+ 'IPv4 DNS #2' 3 0 \"${IP4_2}\" 3 16 16 0 0"
+else
+ exit 0
+fi
exec 3>&1
-IF_CONFIG=$(dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --form 'Static Network Interface Configuration' 0 0 0 \
- 'IP Address' 1 0 "$IP_ADDRESS" 1 20 16 0 \
- 'Subnet Mask' 2 0 "$NETMASK" 2 20 16 0 \
- 'Default Router' 3 0 "$ROUTER" 3 20 16 0 \
- \
- 'Nameserver' 5 0 "" 5 20 16 0 \
- 'Search Domain' 6 0 "" 6 20 20 0 \
+RESOLV=$(echo "${RESOLV}" | xargs dialog --backtitle 'FreeBSD Installer' \
+ --title 'Network Configuration' \
+ --mixedform 'Resovler Configuration' 0 0 0 \
2>&1 1>&3)
if [ $? -eq $DIALOG_CANCEL ]; then exec $0; fi
exec 3>&-
-echo $INTERFACE $IF_CONFIG |
- awk -v prefix="$IFCONFIG_PREFIX" '{
- printf("ifconfig_%s=\"%s%s netmask %s\"\n", $1, prefix, $2, $3);
- printf("defaultrouter=\"%s\"\n", $4);
- }' >> $BSDINSTALL_TMPETC/rc.conf.net
-
-if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
- . $BSDINSTALL_TMPETC/rc.conf.net
- ifconfig $INTERFACE `eval echo \\\$ifconfig_$INTERFACE`
- route delete default
- route add default $defaultrouter
-fi
-
-
-echo $IF_CONFIG |
- awk '{
- if ($4 != "")
- printf("nameserver %s\n", $4);
- if ($5 != "")
- printf("search %s\n", $5);
- }' > $BSDINSTALL_TMPETC/resolv.conf
+echo ${RESOLV} | tr ' ' '\n' | \
+awk '
+BEGIN {
+ search=-1;
+}
+{
+ if (/^[[:space:]]+$/) {
+ next;
+ }
+ if (/^Nameserver$/) {
+ printf "\n";
+ search=0;
+ next;
+ }
+ if (search == -1) {
+ printf "search ";
+ search=1;
+ }
+ if (search > 0) {
+ printf "%s%s", (search > 1) ? " " : "", $1;
+ search++;
+ next;
+ }
+ printf "nameserver %s\n", $1;
+}' > ${BSDINSTALL_TMPETC}/resolv.conf
+mv $BSDINSTALL_TMPETC/._rc.conf.net $BSDINSTALL_TMPETC/rc.conf.net
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
new file mode 100755
index 0000000..72dc0ee
--- /dev/null
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
@@ -0,0 +1,85 @@
+#!/bin/sh
+#-
+# Copyright (c) 2011 Nathan Whitehorn
+# All rights reserved.
+#
+# 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 AUTHOR 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 AUTHOR 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.
+#
+# $FreeBSD$
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_HELP=2}
+: ${DIALOG_EXTRA=3}
+: ${DIALOG_ITEM_HELP=4}
+: ${DIALOG_ESC=255}
+
+INTERFACE=$1
+IFCONFIG_PREFIX="$2"
+case "${INTERFACE}" in
+"") dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \
+ --msgbox 'No interface specified for IPv4 configuration.' 0 0
+ exit 1
+ ;;
+esac
+
+dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0
+if [ $? -eq $DIALOG_OK ]; then
+ echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> $BSDINSTALL_TMPETC/._rc.conf.net
+
+ if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+ dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0
+ dhclient $INTERFACE 2>> $BSDINSTALL_LOG
+ if [ $? -ne 0 ]; then
+ dialog --backtitle 'FreeBSD Installer' --msgbox "DHCP lease acquisition failed." 0 0
+ exec $0 ${INTERFACE} "${IFCONFIG_PREFIX}"
+ fi
+ fi
+ exit 0
+fi
+
+IP_ADDRESS=`ifconfig $INTERFACE inet | awk '/inet/ {printf("%s\n", $2); }'`
+NETMASK=`ifconfig $INTERFACE inet | awk '/inet/ {printf("%s\n", $4); }'`
+ROUTER=`netstat -rn -f inet | awk '/default/ {printf("%s\n", $2);}'`
+
+exec 3>&1
+IF_CONFIG=$(dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --form 'Static Network Interface Configuration' 0 0 0 \
+ 'IP Address' 1 0 "$IP_ADDRESS" 1 20 16 0 \
+ 'Subnet Mask' 2 0 "$NETMASK" 2 20 16 0 \
+ 'Default Router' 3 0 "$ROUTER" 3 20 16 0 \
+2>&1 1>&3)
+if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
+exec 3>&-
+
+echo $INTERFACE $IF_CONFIG |
+ awk -v prefix="$IFCONFIG_PREFIX" '{
+ printf("ifconfig_%s=\"%s inet %s netmask %s\"\n", $1, prefix, $2, $3);
+ printf("defaultrouter=\"%s\"\n", $4);
+ }' >> $BSDINSTALL_TMPETC/._rc.conf.net
+
+if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+ . $BSDINSTALL_TMPETC/._rc.conf.net
+ ifconfig $INTERFACE inet `eval echo \\\$ifconfig_$INTERFACE`
+ route delete -inet default
+ route add -inet default $defaultrouter
+fi
+
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
new file mode 100755
index 0000000..8bff816
--- /dev/null
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
@@ -0,0 +1,148 @@
+#!/bin/sh
+#-
+# Copyright (c) 2011 Nathan Whitehorn
+# All rights reserved.
+# Copyright (c) 2011 The FreeBSD Foundation
+# All rights reserved.
+#
+# Portions of this software were developed by Bjoern Zeeb
+# under sponsorship from the FreeBSD Foundation.
+#
+# 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 AUTHOR 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 AUTHOR 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.
+#
+# $FreeBSD$
+
+#
+# TODO:
+# - Add DHCPv6 support once FreeBSD ships with it.
+#
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_HELP=2}
+: ${DIALOG_EXTRA=3}
+: ${DIALOG_ITEM_HELP=4}
+: ${DIALOG_ESC=255}
+
+INTERFACE=$1
+case "${INTERFACE}" in
+"") dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \
+ --msgbox 'No interface specified for IPv6 configuration.' 0 0
+ exit 1
+ ;;
+esac
+
+AGAIN=""
+while : ; do
+ MSG="Would you like to try stateless address autoconfiguration (SLAAC)${AGAIN}?"
+ dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' \
+ --yesno "${MSG}" 0 0
+ if [ $? -eq $DIALOG_OK ]; then
+ if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+ dialog --backtitle 'FreeBSD Installer' \
+ --infobox "Sending Router Solicitation ..." 0 0
+ ifconfig ${INTERFACE} inet6 -ifdisabled accept_rtadv up
+ rtsol -F $INTERFACE 2>> $BSDINSTALL_LOG
+ if [ $? -ne 0 ]; then
+ dialog --backtitle 'FreeBSD Installer' --msgbox "SLAAC failed." 0 0
+ AGAIN=" again"
+ continue
+ fi
+ fi
+ echo ifconfig_${INTERFACE}_ipv6=\"inet6 accept_rtadv\" >> $BSDINSTALL_TMPETC/._rc.conf.net
+ exit 0
+ else
+ break
+ fi
+done
+
+ROUTER6=`netstat -Wrn -f inet6 | awk '/default/ {printf("%s\n", $2);}'`
+ADDRS=`ifconfig ${INTERFACE} inet6 | \
+awk -v dfr="${ROUTER6}" '
+BEGIN {
+ n=0;
+}
+{
+ if (/inet6/) {
+ if (match($2, "^fe80:")) { next; };
+ # For the moment ignore all but the first address; it might confuse the user.
+ if (n > 0) { next; };
+ n++;
+ printf "\"IPv6 Address\" %d 0 \"%s/%s\" %d 16 50 0 0 ", n, $2, $4, n;
+ }
+}
+END {
+ if (n == 0) {
+ n++;
+ printf "\"IPv6 Address\" %d 0 \"\" %d 16 50 0 0 ", n, n;
+ }
+ n++;
+ # Nasty trick adding a (hidden, same y) read-only field as a marker
+ # to separate interface address(es) from the default router.
+ printf "\"Default Router\" %d 0 \"%s\" %d 16 50 0 2 ", n, "DefaultRouter", n;
+ printf "\"Default Router\" %d 0 \"%s\" %d 16 50 0 0 ", n, dfr, n;
+}'`
+
+exec 3>&1
+IF_CONFIG=$(echo ${ADDRS} | xargs dialog --backtitle 'FreeBSD Installer' \
+ --title 'Network Configuration' \
+ --mixedform 'Static IPv6 Network Interface Configuration' 0 0 0 \
+2>&1 1>&3)
+if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
+exec 3>&-
+
+echo ${IF_CONFIG} | tr ' ' '\n' | \
+awk -v iface="${INTERFACE}" '
+BEGIN {
+ dfr=0;
+ count=0;
+}
+{
+ if (/^[[:space:]]+$/) {
+ next;
+ }
+ if (/DefaultRouter/) {
+ dfr=1;
+ next;
+ }
+ if (dfr == 1) {
+ printf("ipv6_defaultrouter=\"%s\"\n", $1);
+ next;
+ }
+ if (count > 0) {
+ # Ignore all but the first IP address for now.
+ next;
+ }
+ count++;
+ if (!match($1, "/")) {
+ sub("$", "/64", $1);
+ }
+ printf("ifconfig_%s_ipv6=\"inet6 %s\"\n", iface, $1);
+}' >> $BSDINSTALL_TMPETC/._rc.conf.net
+
+if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
+ . $BSDINSTALL_TMPETC/._rc.conf.net
+ ifconfig ${INTERFACE} `eval echo \\\$ifconfig_${INTERFACE}_ipv6`
+ route delete default
+ route add default ${ipv6_defaultrouter}
+fi
+
diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 b/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3
index ebcf286..b77b5f7 100644
--- a/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3
+++ b/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3
@@ -26,7 +26,7 @@
.\" $FreeBSD$
.\"
.Dd August 6, 2007
-.Dt snmp_bridge 3
+.Dt SNMP_BRIDGE 3
.Os
.Sh NAME
.Nm snmp_bridge
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 b/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
index 403d605..774c027 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
@@ -29,7 +29,7 @@
.\" $FreeBSD$
.\"
.Dd January 3, 2006
-.Dt snmp_hostres 3
+.Dt SNMP_HOSTRES 3
.Os
.Sh NAME
.Nm snmp_hostres
diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile b/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile
index 9b8628b..6a53d46 100644
--- a/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile
+++ b/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile
@@ -6,8 +6,6 @@ MOD= wlan
SRCS= wlan_snmp.c wlan_sys.c
CFLAGS+= -DSNMPTREE_TYPES
-WARNS= 6
-
XSYM= begemotWlan
BMIBS= BEGEMOT-WIRELESS-MIB.txt
diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 b/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3
index 9f366f1..20256f0 100644
--- a/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3
+++ b/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3
@@ -29,7 +29,7 @@
.\" $FreeBSD$
.\"
.Dd June 28, 2010
-.Dt snmp_wlan 3
+.Dt SNMP_WLAN 3
.Os
.Sh NAME
.Nm snmp_wlan
diff --git a/usr.sbin/diskinfo/diskinfo.c b/usr.sbin/diskinfo/diskinfo.c
index 2f00936..168a909 100644
--- a/usr.sbin/diskinfo/diskinfo.c
+++ b/usr.sbin/diskinfo/diskinfo.c
@@ -39,6 +39,7 @@
#include <paths.h>
#include <err.h>
#include <sys/disk.h>
+#include <sys/param.h>
#include <sys/time.h>
static void
@@ -57,7 +58,7 @@ int
main(int argc, char **argv)
{
int i, ch, fd, error, exitval = 0;
- char buf[BUFSIZ], ident[DISK_IDENT_SIZE];
+ char buf[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN];
off_t mediasize, stripesize, stripeoffset;
u_int sectorsize, fwsectors, fwheads;
@@ -151,6 +152,8 @@ main(int argc, char **argv)
}
if (ioctl(fd, DIOCGIDENT, ident) == 0)
printf("\t%-12s\t# Disk ident.\n", ident);
+ if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0)
+ printf("\t%-12s\t# Physical path\n", physpath);
}
printf("\n");
if (opt_c)
diff --git a/usr.sbin/fdread/fdread.c b/usr.sbin/fdread/fdread.c
index 1aae665..ba9c758 100644
--- a/usr.sbin/fdread/fdread.c
+++ b/usr.sbin/fdread/fdread.c
@@ -149,7 +149,7 @@ main(int argc, char **argv)
err(EX_OSERR, "cannot create output file %s", fname);
}
- if ((fd = open(_devname, O_RDWR)) == -1)
+ if ((fd = open(_devname, O_RDONLY)) == -1)
err(EX_OSERR, "cannot open device %s", _devname);
return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname));
diff --git a/usr.sbin/gpioctl/gpioctl.8 b/usr.sbin/gpioctl/gpioctl.8
index ca14bec..4ceecf6 100644
--- a/usr.sbin/gpioctl/gpioctl.8
+++ b/usr.sbin/gpioctl/gpioctl.8
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 27, 2010
+.Dd May 25, 2011
.Dt GPIOCTL 1
.Os
.Sh NAME
@@ -93,17 +93,17 @@ be verbose: for each listed pin print current configuration
.Sh EXAMPLES
.Bl -bullet
.It
-List pins available on GPIO controller defined by device /dev/gpioctl0
+List pins available on GPIO controller defined by device /dev/gpioc0
.Pp
-gpioctl -f /dev/gpioctl0 -l
+gpioctl -f /dev/gpioc0 -l
.It
Set the value of pin 12 to 1
.Pp
-gpioctl -f /dev/gpioctl0 12 1
+gpioctl -f /dev/gpioc0 12 1
.It
Configure pin 12 to be input pin
.Pp
-gpioctl -f /dev/gpioctl0 -c 12 IN
+gpioctl -f /dev/gpioc0 -c 12 IN
.El
.Sh HISTORY
The
diff --git a/usr.sbin/jail/Makefile b/usr.sbin/jail/Makefile
index de35dcf..52d237b 100644
--- a/usr.sbin/jail/Makefile
+++ b/usr.sbin/jail/Makefile
@@ -10,5 +10,8 @@ LDADD= -ljail -lutil
.if ${MK_INET6_SUPPORT} != "no"
CFLAGS+= -DINET6
.endif
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+= -DINET
+.endif
.include <bsd.prog.mk>
diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c
index 0722bfd..fc4f71c 100644
--- a/usr.sbin/jail/jail.c
+++ b/usr.sbin/jail/jail.c
@@ -54,12 +54,18 @@ static struct jailparam *params;
static char **param_values;
static int nparams;
-static char *ip4_addr;
#ifdef INET6
+static int ip6_ok;
static char *ip6_addr;
#endif
+#ifdef INET
+static int ip4_ok;
+static char *ip4_addr;
+#endif
+#if defined(INET6) || defined(INET)
static void add_ip_addr(char **addrp, char *newaddr);
+#endif
#ifdef INET6
static void add_ip_addr46(char *newaddr);
#endif
@@ -194,6 +200,13 @@ main(int argc, char **argv)
if (uflag)
GET_USER_INFO;
+#ifdef INET6
+ ip6_ok = feature_present("inet6");
+#endif
+#ifdef INET
+ ip4_ok = feature_present("inet");
+#endif
+
if (jailname)
set_param("name", jailname);
if (securelevel)
@@ -207,10 +220,12 @@ main(int argc, char **argv)
break;
}
if (hflag) {
+#ifdef INET
if (!strncmp(argv[i], "ip4.addr=", 9)) {
add_ip_addr(&ip4_addr, argv[i] + 9);
break;
}
+#endif
#ifdef INET6
if (!strncmp(argv[i], "ip6.addr=", 9)) {
add_ip_addr(&ip6_addr, argv[i] + 9);
@@ -231,12 +246,14 @@ main(int argc, char **argv)
set_param("host.hostname", argv[1]);
if (hflag)
add_ip_addrinfo(0, argv[1]);
+#if defined(INET6) || defined(INET)
if (argv[2][0] != '\0')
#ifdef INET6
add_ip_addr46(argv[2]);
#else
add_ip_addr(&ip4_addr, argv[2]);
#endif
+#endif
cmdarg = 3;
/* Emulate the defaults from security.jail.* sysctls */
sysvallen = sizeof(sysval);
@@ -259,8 +276,10 @@ main(int argc, char **argv)
}
}
}
+#ifdef INET
if (ip4_addr != NULL)
set_param("ip4.addr", ip4_addr);
+#endif
#ifdef INET6
if (ip6_addr != NULL)
set_param("ip6.addr", ip6_addr);
@@ -297,14 +316,19 @@ main(int argc, char **argv)
for (i = 0; i < nparams; i++)
if (!strcmp(params[i].jp_name, "path"))
break;
-#ifdef INET6
+#if defined(INET6) && defined(INET)
fprintf(fp, "%d\t%s\t%s\t%s%s%s\t%s\n",
jid, i < nparams
? (char *)params[i].jp_value : argv[0],
argv[1], ip4_addr ? ip4_addr : "",
ip4_addr && ip4_addr[0] && ip6_addr && ip6_addr[0]
? "," : "", ip6_addr ? ip6_addr : "", argv[3]);
-#else
+#elif defined(INET6)
+ fprintf(fp, "%d\t%s\t%s\t%s\t%s\n",
+ jid, i < nparams
+ ? (char *)params[i].jp_value : argv[0],
+ argv[1], ip6_addr ? ip6_addr : "", argv[3]);
+#elif defined(INET)
fprintf(fp, "%d\t%s\t%s\t%s\t%s\n",
jid, i < nparams
? (char *)params[i].jp_value : argv[0],
@@ -348,6 +372,7 @@ main(int argc, char **argv)
err(1, "execvp: %s", argv[cmdarg]);
}
+#if defined(INET6) || defined(INET)
static void
add_ip_addr(char **addrp, char *value)
{
@@ -368,6 +393,7 @@ add_ip_addr(char **addrp, char *value)
*addrp = addr;
}
}
+#endif
#ifdef INET6
static void
@@ -391,23 +417,24 @@ static void
add_ip_addrinfo(int ai_flags, char *value)
{
struct addrinfo hints, *ai0, *ai;
- struct in_addr addr4;
- size_t size;
- int error, ip4ok;
- int mib[4];
+ int error;
+#ifdef INET
char avalue4[INET_ADDRSTRLEN];
+ struct in_addr addr4;
+#endif
#ifdef INET6
- struct in6_addr addr6;
- int ip6ok;
char avalue6[INET6_ADDRSTRLEN];
+ struct in6_addr addr6;
#endif
/* Look up the hostname (or get the address) */
memset(&hints, 0, sizeof(hints));
hints.ai_socktype = SOCK_STREAM;
-#ifdef INET6
+#if defined(INET6) && defined(INET)
hints.ai_family = PF_UNSPEC;
-#else
+#elif defined(INET6)
+ hints.ai_family = PF_INET6;
+#elif defined(INET)
hints.ai_family = PF_INET;
#endif
hints.ai_flags = ai_flags;
@@ -415,32 +442,12 @@ add_ip_addrinfo(int ai_flags, char *value)
if (error != 0)
errx(1, "hostname %s: %s", value, gai_strerror(error));
- /*
- * Silently ignore unsupported address families from DNS lookups.
- * But if this is a numeric address, let the kernel give the error.
- */
- if (ai_flags & AI_NUMERICHOST)
- ip4ok =
-#ifdef INET6
- ip6ok =
-#endif
- 1;
- else {
- size = 4;
- ip4ok = (sysctlnametomib("security.jail.param.ip4", mib,
- &size) == 0);
-#ifdef INET6
- size = 4;
- ip6ok = (sysctlnametomib("security.jail.param.ip6", mib,
- &size) == 0);
-#endif
- }
-
/* Convert the addresses to ASCII so set_param can convert them back. */
for (ai = ai0; ai; ai = ai->ai_next)
switch (ai->ai_family) {
+#ifdef INET
case AF_INET:
- if (!ip4ok)
+ if (!ip4_ok && (ai_flags & AI_NUMERICHOST) == 0)
break;
memcpy(&addr4, &((struct sockaddr_in *)
(void *)ai->ai_addr)->sin_addr, sizeof(addr4));
@@ -449,9 +456,10 @@ add_ip_addrinfo(int ai_flags, char *value)
err(1, "inet_ntop");
add_ip_addr(&ip4_addr, avalue4);
break;
+#endif
#ifdef INET6
case AF_INET6:
- if (!ip6ok)
+ if (!ip6_ok && (ai_flags & AI_NUMERICHOST) == 0)
break;
memcpy(&addr6, &((struct sockaddr_in6 *)
(void *)ai->ai_addr)->sin6_addr, sizeof(addr6));
diff --git a/usr.sbin/jls/Makefile b/usr.sbin/jls/Makefile
index e1157af..b297cc4 100644
--- a/usr.sbin/jls/Makefile
+++ b/usr.sbin/jls/Makefile
@@ -1,8 +1,17 @@
# $FreeBSD$
+.include <bsd.own.mk>
+
PROG= jls
MAN= jls.8
DPADD= ${LIBJAIL}
LDADD= -ljail
+.if ${MK_INET6_SUPPORT} != "no"
+CFLAGS+= -DINET6
+.endif
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+= -DINET
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/jls/jls.c b/usr.sbin/jls/jls.c
index 2c1655b..6568a1d 100644
--- a/usr.sbin/jls/jls.c
+++ b/usr.sbin/jls/jls.c
@@ -59,6 +59,12 @@ __FBSDID("$FreeBSD$");
static struct jailparam *params;
static int *param_parent;
static int nparams;
+#ifdef INET6
+static int ip6_ok;
+#endif
+#ifdef INET
+static int ip4_ok;
+#endif
static int add_param(const char *name, void *value, size_t valuelen,
struct jailparam *source, unsigned flags);
@@ -112,6 +118,13 @@ main(int argc, char **argv)
errx(1, "usage: jls [-dhnqv] [-j jail] [param ...]");
}
+#ifdef INET6
+ ip6_ok = feature_present("inet6");
+#endif
+#ifdef INET
+ ip4_ok = feature_present("inet");
+#endif
+
/* Add the parameters to print. */
if (optind == argc) {
if (pflags & (PRINT_HEADER | PRINT_NAMEVAL))
@@ -124,13 +137,24 @@ main(int argc, char **argv)
add_param("name", NULL, (size_t)0, NULL, JP_USER);
add_param("dying", NULL, (size_t)0, NULL, JP_USER);
add_param("cpuset.id", NULL, (size_t)0, NULL, JP_USER);
- add_param("ip4.addr", NULL, (size_t)0, NULL, JP_USER);
- add_param("ip6.addr", NULL, (size_t)0, NULL,
- JP_USER | JP_OPT);
+#ifdef INET
+ if (ip4_ok)
+ add_param("ip4.addr", NULL, (size_t)0, NULL,
+ JP_USER);
+#endif
+#ifdef INET6
+ if (ip6_ok)
+ add_param("ip6.addr", NULL, (size_t)0, NULL,
+ JP_USER | JP_OPT);
+#endif
} else {
pflags |= PRINT_DEFAULT;
add_param("jid", NULL, (size_t)0, NULL, JP_USER);
- add_param("ip4.addr", NULL, (size_t)0, NULL, JP_USER);
+#ifdef INET
+ if (ip4_ok)
+ add_param("ip4.addr", NULL, (size_t)0, NULL,
+ JP_USER);
+#endif
add_param("host.hostname", NULL, (size_t)0, NULL,
JP_USER);
add_param("path", NULL, (size_t)0, NULL, JP_USER);
@@ -327,7 +351,7 @@ print_jail(int pflags, int jflags)
{
char *nname;
char **param_values;
- int i, ai, jid, count, spc;
+ int i, ai, jid, count, n, spc;
char ipbuf[INET6_ADDRSTRLEN];
jid = jailparam_get(params, nparams, jflags);
@@ -345,31 +369,45 @@ print_jail(int pflags, int jflags)
*(int *)params[4].jp_value ? "DYING" : "ACTIVE",
"",
*(int *)params[5].jp_value);
- count = params[6].jp_valuelen / sizeof(struct in_addr);
- for (ai = 0; ai < count; ai++)
- if (inet_ntop(AF_INET,
- &((struct in_addr *)params[6].jp_value)[ai],
- ipbuf, sizeof(ipbuf)) == NULL)
- err(1, "inet_ntop");
- else
- printf("%6s %-15.15s\n", "", ipbuf);
- if (!strcmp(params[7].jp_name, "ip6.addr")) {
- count = params[7].jp_valuelen / sizeof(struct in6_addr);
+ n = 6;
+#ifdef INET
+ if (ip4_ok && !strcmp(params[n].jp_name, "ip.addr")) {
+ count = params[n].jp_valuelen / sizeof(struct in_addr);
+ for (ai = 0; ai < count; ai++)
+ if (inet_ntop(AF_INET,
+ &((struct in_addr *)params[n].jp_value)[ai],
+ ipbuf, sizeof(ipbuf)) == NULL)
+ err(1, "inet_ntop");
+ else
+ printf("%6s %-15.15s\n", "", ipbuf);
+ n++;
+ }
+#endif
+#ifdef INET6
+ if (ip6_ok && !strcmp(params[n].jp_name, "ip6.addr")) {
+ count = params[n].jp_valuelen / sizeof(struct in6_addr);
for (ai = 0; ai < count; ai++)
if (inet_ntop(AF_INET6,
- &((struct in6_addr *)params[7].jp_value)[ai],
+ &((struct in6_addr *)
+ params[n].jp_value)[ai],
ipbuf, sizeof(ipbuf)) == NULL)
err(1, "inet_ntop");
else
printf("%6s %s\n", "", ipbuf);
+ n++;
}
+#endif
} else if (pflags & PRINT_DEFAULT)
printf("%6d %-15.15s %-29.29s %.74s\n",
*(int *)params[0].jp_value,
- params[1].jp_valuelen == 0 ? "-"
+#ifdef INET
+ (!ip4_ok || params[1].jp_valuelen == 0) ? "-"
: inet_ntoa(*(struct in_addr *)params[1].jp_value),
- (char *)params[2].jp_value,
- (char *)params[3].jp_value);
+#else
+ "-",
+#endif
+ (char *)params[2-!ip4_ok].jp_value,
+ (char *)params[3-!ip4_ok].jp_value);
else {
param_values = alloca(nparams * sizeof(*param_values));
for (i = 0; i < nparams; i++) {
diff --git a/usr.sbin/kbdmap/kbdmap.c b/usr.sbin/kbdmap/kbdmap.c
index 93c5a08..c993389 100644
--- a/usr.sbin/kbdmap/kbdmap.c
+++ b/usr.sbin/kbdmap/kbdmap.c
@@ -226,10 +226,10 @@ get_font(void)
}
}
}
+ fclose(fp);
} else
fprintf(stderr, "Could not open %s for reading\n", sysconfig);
- fclose(fp);
return fnt;
}
diff --git a/usr.sbin/lastlogin/lastlogin.8 b/usr.sbin/lastlogin/lastlogin.8
index 0630163..fdbc871 100644
--- a/usr.sbin/lastlogin/lastlogin.8
+++ b/usr.sbin/lastlogin/lastlogin.8
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd January 11, 1996
+.Dd June 6, 2011
.Dt LASTLOGIN 8
.Os
.Sh NAME
@@ -39,6 +39,8 @@
.Nd indicate last login time of users
.Sh SYNOPSIS
.Nm
+.Op Fl f Ar file
+.Op Fl rt
.Op Ar user ...
.Sh DESCRIPTION
The
@@ -54,8 +56,8 @@ If more than one
.Ar user
is given, the session information for each user is printed in
the order given on the command line.
-Otherwise, information
-for all users is printed, sorted by name.
+Otherwise, information for all users is printed.
+By default, the entries are sorted by user name.
.Pp
The
.Nm
@@ -63,6 +65,18 @@ utility differs from
.Xr last 1
in that it only prints information regarding the very last login session.
The last login database is never turned over or deleted in standard usage.
+.Pp
+The following options are available:
+.Bl -tag -width indent
+.It Fl f Ar file
+Open last login database
+.Ar file
+instead of the system-wide database.
+.It Fl r
+Print the entries in reverse sorted order.
+.It Fl t
+Sort the elements by last login time, instead of user name.
+.El
.Sh FILES
.Bl -tag -width /var/log/utx.lastlogin -compact
.It Pa /var/log/utx.lastlogin
diff --git a/usr.sbin/lastlogin/lastlogin.c b/usr.sbin/lastlogin/lastlogin.c
index 4c08547..2f8dd78 100644
--- a/usr.sbin/lastlogin/lastlogin.c
+++ b/usr.sbin/lastlogin/lastlogin.c
@@ -47,30 +47,59 @@ __RCSID("$NetBSD: lastlogin.c,v 1.4 1998/02/03 04:45:35 perry Exp $");
int main(int, char **);
static void output(struct utmpx *);
static void usage(void);
+static int utcmp_user(const void *, const void *);
+
+static int order = 1;
+static const char *file = NULL;
+static int (*utcmp)(const void *, const void *) = utcmp_user;
static int
-utcmp(const void *u1, const void *u2)
+utcmp_user(const void *u1, const void *u2)
{
- return (strcmp(((const struct utmpx *)u1)->ut_user,
+ return (order * strcmp(((const struct utmpx *)u1)->ut_user,
((const struct utmpx *)u2)->ut_user));
}
+static int
+utcmp_time(const void *u1, const void *u2)
+{
+ time_t t1, t2;
+
+ t1 = ((const struct utmpx *)u1)->ut_tv.tv_sec;
+ t2 = ((const struct utmpx *)u2)->ut_tv.tv_sec;
+ return (t1 < t2 ? order : t1 > t2 ? -order : 0);
+}
+
int
main(int argc, char *argv[])
{
int ch, i, ulistsize;
struct utmpx *u, *ulist;
- while ((ch = getopt(argc, argv, "")) != -1) {
- usage();
+ while ((ch = getopt(argc, argv, "f:rt")) != -1) {
+ switch (ch) {
+ case 'f':
+ file = optarg;
+ break;
+ case 'r':
+ order = -1;
+ break;
+ case 't':
+ utcmp = utcmp_time;
+ break;
+ default:
+ usage();
+ }
}
+ argc -= optind;
+ argv += optind;
- /* Process usernames given on the command line. */
- if (argc > 1) {
- for (i = 1; i < argc; ++i) {
- if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0)
- errx(1, "failed to open lastlog database");
+ if (argc > 0) {
+ /* Process usernames given on the command line. */
+ for (i = 0; i < argc; i++) {
+ if (setutxdb(UTXDB_LASTLOGIN, file) != 0)
+ err(1, "failed to open lastlog database");
if ((u = getutxuser(argv[i])) == NULL) {
warnx("user '%s' not found", argv[i]);
continue;
@@ -78,11 +107,10 @@ main(int argc, char *argv[])
output(u);
endutxent();
}
- }
- /* Read all lastlog entries, looking for active ones */
- else {
- if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0)
- errx(1, "failed to open lastlog database");
+ } else {
+ /* Read all lastlog entries, looking for active ones. */
+ if (setutxdb(UTXDB_LASTLOGIN, file) != 0)
+ err(1, "failed to open lastlog database");
ulist = NULL;
ulistsize = 0;
while ((u = getutxent()) != NULL) {
@@ -119,6 +147,6 @@ output(struct utmpx *u)
static void
usage(void)
{
- fprintf(stderr, "usage: lastlogin [user ...]\n");
+ fprintf(stderr, "usage: lastlogin [-f file] [-rt] [user ...]\n");
exit(1);
}
diff --git a/usr.sbin/makefs/Makefile b/usr.sbin/makefs/Makefile
index 37eeb38..6fa0679 100644
--- a/usr.sbin/makefs/Makefile
+++ b/usr.sbin/makefs/Makefile
@@ -7,6 +7,7 @@ CFLAGS+=-I${.CURDIR}
SRCS= cd9660.c ffs.c \
getid.c \
makefs.c \
+ mtree.c \
walk.c
MAN= makefs.8
@@ -26,4 +27,7 @@ SRCS+= misc.c spec.c
.PATH: ${.CURDIR}/../../sys/ufs/ffs
SRCS+= ffs_tables.c
+DPADD= ${LIBSBUF}
+LDADD= -lsbuf
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/makefs/cd9660/cd9660_write.c b/usr.sbin/makefs/cd9660/cd9660_write.c
index 46d4a34..4622701 100644
--- a/usr.sbin/makefs/cd9660/cd9660_write.c
+++ b/usr.sbin/makefs/cd9660/cd9660_write.c
@@ -294,10 +294,12 @@ cd9660_write_file(FILE *fd, cd9660node *writenode)
INODE_WARNX(("%s: writing inode %d blocks at %" PRIu32,
__func__, (int)inode->st.st_ino, inode->ino));
inode->flags |= FI_WRITTEN;
- cd9660_compute_full_filename(writenode,
- temp_file_name, 0);
+ if (writenode->node->contents == NULL)
+ cd9660_compute_full_filename(writenode,
+ temp_file_name, 0);
ret = cd9660_copy_file(fd, writenode->fileDataSector,
- temp_file_name);
+ (writenode->node->contents != NULL) ?
+ writenode->node->contents : temp_file_name);
if (ret == 0)
goto out;
}
diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c
index a3c9d68..f833cf5 100644
--- a/usr.sbin/makefs/ffs.c
+++ b/usr.sbin/makefs/ffs.c
@@ -776,9 +776,11 @@ ffs_populate_dir(const char *dir, fsnode *root, fsinfo_t *fsopts)
continue; /* skip hard-linked entries */
cur->inode->flags |= FI_WRITTEN;
- if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name)
- >= sizeof(path))
- errx(1, "Pathname too long.");
+ if (cur->contents == NULL) {
+ if (snprintf(path, sizeof(path), "%s/%s", dir,
+ cur->name) >= sizeof(path))
+ errx(1, "Pathname too long.");
+ }
if (cur->child != NULL)
continue; /* child creates own inode */
@@ -802,7 +804,8 @@ ffs_populate_dir(const char *dir, fsnode *root, fsinfo_t *fsopts)
if (membuf != NULL) {
ffs_write_file(&din, cur->inode->ino, membuf, fsopts);
} else if (S_ISREG(cur->type)) {
- ffs_write_file(&din, cur->inode->ino, path, fsopts);
+ ffs_write_file(&din, cur->inode->ino,
+ (cur->contents) ? cur->contents : path, fsopts);
} else {
assert (! S_ISDIR(cur->type));
ffs_write_inode(&din, cur->inode->ino, fsopts);
diff --git a/usr.sbin/makefs/ffs/ffs_bswap.c b/usr.sbin/makefs/ffs/ffs_bswap.c
index 18ace03..a1a1c46 100644
--- a/usr.sbin/makefs/ffs/ffs_bswap.c
+++ b/usr.sbin/makefs/ffs/ffs_bswap.c
@@ -41,14 +41,6 @@ __FBSDID("$FreeBSD$");
#include <ufs/ufs/dinode.h>
#include "ffs/ufs_bswap.h"
#include <ufs/ffs/fs.h>
-/* XXX temporary */
-struct ufsmount;
-struct bufobj;
-struct mount;
-struct vnode;
-typedef int vfs_vget_t(struct mount *mp, ino_t ino, int flags,
- struct vnode **vpp);
-#include <ufs/ffs/ffs_extern.h>
#if !defined(_KERNEL)
#include <stddef.h>
diff --git a/usr.sbin/makefs/ffs/ffs_subr.c b/usr.sbin/makefs/ffs/ffs_subr.c
index 5f9b6f2..b857a58 100644
--- a/usr.sbin/makefs/ffs/ffs_subr.c
+++ b/usr.sbin/makefs/ffs/ffs_subr.c
@@ -38,15 +38,8 @@ __FBSDID("$FreeBSD$");
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
-/* XXX temporary */
-struct ufsmount;
-struct bufobj;
-struct mount;
-struct vnode;
-typedef int vfs_vget_t(struct mount *mp, ino_t ino, int flags,
- struct vnode **vpp);
-#include <ufs/ffs/ffs_extern.h>
#include "ffs/ufs_bswap.h"
+
void panic __P((const char *, ...))
__attribute__((__noreturn__,__format__(__printf__,1,2)));
diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8
index b9fb10e..9fe5c01 100644
--- a/usr.sbin/makefs/makefs.8
+++ b/usr.sbin/makefs/makefs.8
@@ -40,7 +40,7 @@
.Os
.Sh NAME
.Nm makefs
-.Nd create a file system image from a directory tree
+.Nd create a file system image from a directory tree or a mtree manifest
.Sh SYNOPSIS
.Nm
.Op Fl x
@@ -57,14 +57,16 @@
.Op Fl s Ar image-size
.Op Fl t Ar fs-type
.Ar image-file
-.Ar directory
+.Ar directory | manifest
.Sh DESCRIPTION
The utility
.Nm
creates a file system image into
.Ar image-file
from the directory tree
-.Ar directory .
+.Ar directory
+or from the mtree manifest
+.Ar manifest .
No special devices or privileges are required to perform this task.
.Pp
The options are as follows:
@@ -106,6 +108,8 @@ as an
.Xr mtree 8
.Sq specfile
specification.
+This option has no effect when the image is created from a mtree manifest
+rather than a directory.
.Pp
If a specfile entry exists in the underlying file system, its
permissions and modification time will be used unless specifically
@@ -330,6 +334,7 @@ Use RockRidge extensions (for longer filenames, etc.).
Volume set identifier of the image.
.El
.Sh SEE ALSO
+.Xr mtree 5 ,
.Xr mtree 8 ,
.Xr newfs 8
.Sh HISTORY
diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c
index 60b6916..a186014 100644
--- a/usr.sbin/makefs/makefs.c
+++ b/usr.sbin/makefs/makefs.c
@@ -38,6 +38,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/types.h>
+#include <sys/stat.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@@ -80,11 +82,13 @@ int main(int, char *[]);
int
main(int argc, char *argv[])
{
+ struct stat sb;
struct timeval start;
fstype_t *fstype;
fsinfo_t fsoptions;
fsnode *root;
int ch, len;
+ char *subtree;
char *specfile;
setprogname(argv[0]);
@@ -244,26 +248,47 @@ main(int argc, char *argv[])
if (fsoptions.onlyspec != 0 && specfile == NULL)
errx(1, "-x requires -F mtree-specfile.");
- /* walk the tree */
- TIMER_START(start);
- root = walk_dir(argv[1], NULL);
- TIMER_RESULTS(start, "walk_dir");
+ /* Accept '-' as meaning "read from standard input". */
+ if (strcmp(argv[1], "-") == 0)
+ sb.st_mode = S_IFREG;
+ else {
+ if (stat(argv[1], &sb) == -1)
+ err(1, "Can't stat `%s'", argv[1]);
+ }
+
+ switch (sb.st_mode & S_IFMT) {
+ case S_IFDIR: /* walk the tree */
+ subtree = argv[1];
+ TIMER_START(start);
+ root = walk_dir(subtree, NULL);
+ TIMER_RESULTS(start, "walk_dir");
+ break;
+ case S_IFREG: /* read the manifest file */
+ subtree = ".";
+ TIMER_START(start);
+ root = read_mtree(argv[1], NULL);
+ TIMER_RESULTS(start, "manifest");
+ break;
+ default:
+ errx(1, "%s: not a file or directory", argv[1]);
+ /* NOTREACHED */
+ }
if (specfile) { /* apply a specfile */
TIMER_START(start);
- apply_specfile(specfile, argv[1], root, fsoptions.onlyspec);
+ apply_specfile(specfile, subtree, root, fsoptions.onlyspec);
TIMER_RESULTS(start, "apply_specfile");
}
if (debug & DEBUG_DUMP_FSNODES) {
- printf("\nparent: %s\n", argv[1]);
+ printf("\nparent: %s\n", subtree);
dump_fsnodes(".", root);
putchar('\n');
}
/* build the file system */
TIMER_START(start);
- fstype->make_fs(argv[0], argv[1], root, &fsoptions);
+ fstype->make_fs(argv[0], subtree, root, &fsoptions);
TIMER_RESULTS(start, "make_fs");
free_fsnodes(root);
@@ -311,7 +336,7 @@ usage(void)
"usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n"
"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n"
"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n"
-"\t[-N userdb-dir] image-file directory\n",
+"\t[-N userdb-dir] image-file directory | manifest\n",
prog);
exit(1);
}
diff --git a/usr.sbin/makefs/makefs.h b/usr.sbin/makefs/makefs.h
index 997c4db..6556ec0 100644
--- a/usr.sbin/makefs/makefs.h
+++ b/usr.sbin/makefs/makefs.h
@@ -93,11 +93,13 @@ typedef struct _fsnode {
uint32_t type; /* type of entry */
fsinode *inode; /* actual inode data */
char *symlink; /* symlink target */
+ char *contents; /* file to provide contents */
char *name; /* file name */
int flags; /* misc flags */
} fsnode;
#define FSNODE_F_HASSPEC 0x01 /* fsnode has a spec entry */
+#define FSNODE_F_OPTIONAL 0x02 /* fsnode is optional */
/*
* fsinfo_t - contains various settings and parameters pertaining to
@@ -147,6 +149,7 @@ typedef struct {
void apply_specfile(const char *, const char *, fsnode *, int);
void dump_fsnodes(const char *, fsnode *);
const char * inode_type(mode_t);
+fsnode * read_mtree(const char *, fsnode *);
int set_option(option_t *, const char *, const char *);
fsnode * walk_dir(const char *, fsnode *);
void free_fsnodes(fsnode *);
diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c
new file mode 100644
index 0000000..5d88ad6
--- /dev/null
+++ b/usr.sbin/makefs/mtree.c
@@ -0,0 +1,1051 @@
+/*-
+ * Copyright (c) 2011 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * 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 AUTHOR(S) ``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 AUTHOR(S) 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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/queue.h>
+#include <sys/sbuf.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <inttypes.h>
+#include <pwd.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <unistd.h>
+
+#include "makefs.h"
+
+#define IS_DOT(nm) ((nm)[0] == '.' && (nm)[1] == '\0')
+#define IS_DOTDOT(nm) ((nm)[0] == '.' && (nm)[1] == '.' && (nm)[2] == '\0')
+
+struct mtree_fileinfo {
+ SLIST_ENTRY(mtree_fileinfo) next;
+ FILE *fp;
+ const char *name;
+ u_int line;
+};
+
+/* Global state used while parsing. */
+static SLIST_HEAD(, mtree_fileinfo) mtree_fileinfo =
+ SLIST_HEAD_INITIALIZER(mtree_fileinfo);
+static fsnode *mtree_root;
+static fsnode *mtree_current;
+static fsnode mtree_global;
+static fsinode mtree_global_inode;
+static u_int errors, warnings;
+
+static void mtree_error(const char *, ...) __printflike(1, 2);
+static void mtree_warning(const char *, ...) __printflike(1, 2);
+
+static int
+mtree_file_push(const char *name, FILE *fp)
+{
+ struct mtree_fileinfo *fi;
+
+ fi = malloc(sizeof(*fi));
+ if (fi == NULL)
+ return (ENOMEM);
+
+ if (strcmp(name, "-") == 0)
+ fi->name = strdup("(stdin)");
+ else
+ fi->name = strdup(name);
+ if (fi->name == NULL) {
+ free(fi);
+ return (ENOMEM);
+ }
+
+ fi->fp = fp;
+ fi->line = 0;
+
+ SLIST_INSERT_HEAD(&mtree_fileinfo, fi, next);
+ return (0);
+}
+
+static void
+mtree_print(const char *msgtype, const char *fmt, va_list ap)
+{
+ struct mtree_fileinfo *fi;
+
+ if (msgtype != NULL) {
+ fi = SLIST_FIRST(&mtree_fileinfo);
+ if (fi != NULL)
+ fprintf(stderr, "%s:%u: ", fi->name, fi->line);
+ fprintf(stderr, "%s: ", msgtype);
+ }
+ vfprintf(stderr, fmt, ap);
+}
+
+static void
+mtree_error(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ mtree_print("error", fmt, ap);
+ va_end(ap);
+
+ errors++;
+ fputc('\n', stderr);
+}
+
+static void
+mtree_warning(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ mtree_print("warning", fmt, ap);
+ va_end(ap);
+
+ warnings++;
+ fputc('\n', stderr);
+}
+
+/* mtree_resolve() sets errno to indicate why NULL was returned. */
+static char *
+mtree_resolve(const char *spec, int *istemp)
+{
+ struct sbuf *sb;
+ char *res, *var;
+ const char *base, *p, *v;
+ size_t len;
+ int c, error, quoted, subst;
+
+ len = strlen(spec);
+ if (len == 0) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ c = (len > 1) ? (spec[0] == spec[len - 1]) ? spec[0] : 0 : 0;
+ *istemp = (c == '`') ? 1 : 0;
+ subst = (c == '`' || c == '"') ? 1 : 0;
+ quoted = (subst || c == '\'') ? 1 : 0;
+
+ if (!subst) {
+ res = strdup(spec + quoted);
+ if (res != NULL && quoted)
+ res[len - 2] = '\0';
+ return (res);
+ }
+
+ sb = sbuf_new_auto();
+ if (sb == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+
+ base = spec + 1;
+ len -= 2;
+ error = 0;
+ while (len > 0) {
+ p = strchr(base, '$');
+ if (p == NULL) {
+ sbuf_bcat(sb, base, len);
+ base += len;
+ len = 0;
+ continue;
+ }
+ /* The following is safe. spec always starts with a quote. */
+ if (p[-1] == '\\')
+ p--;
+ if (base != p) {
+ sbuf_bcat(sb, base, p - base);
+ len -= p - base;
+ base = p;
+ }
+ if (*p == '\\') {
+ sbuf_putc(sb, '$');
+ base += 2;
+ len -= 2;
+ continue;
+ }
+ /* Skip the '$'. */
+ base++;
+ len--;
+ /* Handle ${X} vs $X. */
+ v = base;
+ if (*base == '{') {
+ p = strchr(v, '}');
+ if (p == NULL)
+ p = v;
+ } else
+ p = v;
+ len -= (p + 1) - base;
+ base = p + 1;
+
+ if (v == p) {
+ sbuf_putc(sb, *v);
+ continue;
+ }
+
+ error = ENOMEM;
+ var = calloc(p - v, 1);
+ if (var == NULL)
+ break;
+
+ memcpy(var, v + 1, p - v - 1);
+ if (strcmp(var, ".CURDIR") == 0) {
+ res = getcwd(NULL, 0);
+ if (res == NULL)
+ break;
+ } else if (strcmp(var, ".PROG") == 0) {
+ res = strdup(getprogname());
+ if (res == NULL)
+ break;
+ } else {
+ v = getenv(var);
+ if (v != NULL) {
+ res = strdup(v);
+ if (res == NULL)
+ break;
+ } else
+ res = NULL;
+ }
+ error = 0;
+
+ if (res != NULL) {
+ sbuf_cat(sb, res);
+ free(res);
+ }
+ free(var);
+ }
+
+ sbuf_finish(sb);
+ res = (error == 0) ? strdup(sbuf_data(sb)) : NULL;
+ sbuf_delete(sb);
+ if (res == NULL)
+ errno = ENOMEM;
+ return (res);
+}
+
+static int
+skip_over(FILE *fp, const char *cs)
+{
+ int c;
+
+ c = getc(fp);
+ while (c != EOF && strchr(cs, c) != NULL)
+ c = getc(fp);
+ if (c != EOF) {
+ ungetc(c, fp);
+ return (0);
+ }
+ return (ferror(fp) ? errno : -1);
+}
+
+static int
+skip_to(FILE *fp, const char *cs)
+{
+ int c;
+
+ c = getc(fp);
+ while (c != EOF && strchr(cs, c) == NULL)
+ c = getc(fp);
+ if (c != EOF) {
+ ungetc(c, fp);
+ return (0);
+ }
+ return (ferror(fp) ? errno : -1);
+}
+
+static int
+read_word(FILE *fp, char *buf, size_t bufsz)
+{
+ struct mtree_fileinfo *fi;
+ size_t idx, qidx;
+ int c, done, error, esc, qlvl;
+
+ if (bufsz == 0)
+ return (EINVAL);
+
+ done = 0;
+ esc = 0;
+ idx = 0;
+ qidx = -1;
+ qlvl = 0;
+ do {
+ c = getc(fp);
+ switch (c) {
+ case EOF:
+ buf[idx] = '\0';
+ error = ferror(fp) ? errno : -1;
+ if (error == -1)
+ mtree_error("unexpected end of file");
+ return (error);
+ case '\\':
+ esc++;
+ if (esc == 1)
+ continue;
+ break;
+ case '`':
+ case '\'':
+ case '"':
+ if (esc)
+ break;
+ if (qlvl == 0) {
+ qlvl++;
+ qidx = idx;
+ } else if (c == buf[qidx]) {
+ qlvl--;
+ if (qlvl > 0) {
+ do {
+ qidx--;
+ } while (buf[qidx] != '`' &&
+ buf[qidx] != '\'' &&
+ buf[qidx] != '"');
+ } else
+ qidx = -1;
+ } else {
+ qlvl++;
+ qidx = idx;
+ }
+ break;
+ case ' ':
+ case '\t':
+ case '\n':
+ if (!esc && qlvl == 0) {
+ ungetc(c, fp);
+ c = '\0';
+ done = 1;
+ break;
+ }
+ if (c == '\n') {
+ /*
+ * We going to eat the newline ourselves.
+ */
+ if (qlvl > 0)
+ mtree_warning("quoted word straddles "
+ "onto next line.");
+ fi = SLIST_FIRST(&mtree_fileinfo);
+ fi->line++;
+ }
+ break;
+ case 'a':
+ if (esc)
+ c = '\a';
+ break;
+ case 'b':
+ if (esc)
+ c = '\b';
+ break;
+ case 'f':
+ if (esc)
+ c = '\f';
+ break;
+ case 'n':
+ if (esc)
+ c = '\n';
+ break;
+ case 'r':
+ if (esc)
+ c = '\r';
+ break;
+ case 't':
+ if (esc)
+ c = '\t';
+ break;
+ case 'v':
+ if (esc)
+ c = '\v';
+ break;
+ }
+ buf[idx++] = c;
+ esc = 0;
+ } while (idx < bufsz && !done);
+
+ if (idx >= bufsz) {
+ mtree_error("word too long to fit buffer (max %zu characters)",
+ bufsz);
+ skip_to(fp, " \t\n");
+ }
+ return (0);
+}
+
+static fsnode *
+create_node(const char *name, u_int type, fsnode *parent, fsnode *global)
+{
+ fsnode *n;
+
+ n = calloc(1, sizeof(*n));
+ if (n == NULL)
+ return (NULL);
+
+ n->name = strdup(name);
+ if (n->name == NULL) {
+ free(n);
+ return (NULL);
+ }
+
+ n->type = (type == 0) ? global->type : type;
+ n->parent = parent;
+
+ n->inode = calloc(1, sizeof(*n->inode));
+ if (n->inode == NULL) {
+ free(n->name);
+ free(n);
+ return (NULL);
+ }
+
+ /* Assign global options/defaults. */
+ bcopy(global->inode, n->inode, sizeof(*n->inode));
+ n->inode->st.st_mode = (n->inode->st.st_mode & ~S_IFMT) | n->type;
+
+ if (n->type == S_IFLNK)
+ n->symlink = global->symlink;
+ else if (n->type == S_IFREG)
+ n->contents = global->contents;
+
+ return (n);
+}
+
+static void
+destroy_node(fsnode *n)
+{
+
+ assert(n != NULL);
+ assert(n->name != NULL);
+ assert(n->inode != NULL);
+
+ free(n->inode);
+ free(n->name);
+ free(n);
+}
+
+static int
+read_number(const char *tok, u_int base, intmax_t *res, intmax_t min,
+ intmax_t max)
+{
+ char *end;
+ intmax_t val;
+
+ val = strtoimax(tok, &end, base);
+ if (end == tok || end[0] != '\0')
+ return (EINVAL);
+ if (val < min || val > max)
+ return (EDOM);
+ *res = val;
+ return (0);
+}
+
+static int
+read_mtree_keywords(FILE *fp, fsnode *node)
+{
+ char keyword[PATH_MAX];
+ char *name, *p, *value;
+ struct group *grent;
+ struct passwd *pwent;
+ struct stat *st, sb;
+ intmax_t num;
+ u_long flset, flclr;
+ int error, istemp, type;
+
+ st = &node->inode->st;
+ do {
+ error = skip_over(fp, " \t");
+ if (error)
+ break;
+
+ error = read_word(fp, keyword, sizeof(keyword));
+ if (error)
+ break;
+
+ if (keyword[0] == '\0')
+ break;
+
+ value = strchr(keyword, '=');
+ if (value != NULL)
+ *value++ = '\0';
+
+ /*
+ * We use EINVAL, ENOATTR, ENOSYS and ENXIO to signal
+ * certain conditions:
+ * EINVAL - Value provided for a keyword that does
+ * not take a value. The value is ignored.
+ * ENOATTR - Value missing for a keyword that needs
+ * a value. The keyword is ignored.
+ * ENOSYS - Unsupported keyword encountered. The
+ * keyword is ignored.
+ * ENXIO - Value provided for a keyword that does
+ * not take a value. The value is ignored.
+ */
+ switch (keyword[0]) {
+ case 'c':
+ if (strcmp(keyword, "contents") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ node->contents = strdup(value);
+ } else
+ error = ENOSYS;
+ break;
+ case 'f':
+ if (strcmp(keyword, "flags") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ flset = flclr = 0;
+ if (!strtofflags(&value, &flset, &flclr)) {
+ st->st_flags &= ~flclr;
+ st->st_flags |= flset;
+ } else
+ error = errno;
+ } else
+ error = ENOSYS;
+ break;
+ case 'g':
+ if (strcmp(keyword, "gid") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ error = read_number(value, 10, &num,
+ 0, UINT_MAX);
+ if (!error)
+ st->st_gid = num;
+ } else if (strcmp(keyword, "gname") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ grent = getgrnam(value);
+ if (grent != NULL)
+ st->st_gid = grent->gr_gid;
+ else
+ error = errno;
+ } else
+ error = ENOSYS;
+ break;
+ case 'l':
+ if (strcmp(keyword, "link") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ node->symlink = strdup(value);
+ } else
+ error = ENOSYS;
+ break;
+ case 'm':
+ if (strcmp(keyword, "mode") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ if (value[0] >= '0' && value[0] <= '9') {
+ error = read_number(value, 8, &num,
+ 0, 07777);
+ if (!error) {
+ st->st_mode &= S_IFMT;
+ st->st_mode |= num;
+ }
+ } else {
+ /* Symbolic mode not supported. */
+ error = EINVAL;
+ break;
+ }
+ } else
+ error = ENOSYS;
+ break;
+ case 'o':
+ if (strcmp(keyword, "optional") == 0) {
+ if (value != NULL)
+ error = ENXIO;
+ node->flags |= FSNODE_F_OPTIONAL;
+ } else
+ error = ENOSYS;
+ break;
+ case 's':
+ if (strcmp(keyword, "size") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ error = read_number(value, 10, &num,
+ 0, INTMAX_MAX);
+ if (!error)
+ st->st_size = num;
+ } else
+ error = ENOSYS;
+ break;
+ case 't':
+ if (strcmp(keyword, "time") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ p = strchr(value, '.');
+ if (p != NULL)
+ *p++ = '\0';
+ error = read_number(value, 10, &num, 0,
+ INTMAX_MAX);
+ if (error)
+ break;
+ st->st_atime = num;
+ st->st_ctime = num;
+ st->st_mtime = num;
+ error = read_number(p, 10, &num, 0,
+ INTMAX_MAX);
+ if (error)
+ break;
+ if (num != 0)
+ error = EINVAL;
+ } else if (strcmp(keyword, "type") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ if (strcmp(value, "dir") == 0)
+ node->type = S_IFDIR;
+ else if (strcmp(value, "file") == 0)
+ node->type = S_IFREG;
+ else if (strcmp(value, "link") == 0)
+ node->type = S_IFLNK;
+ else
+ error = EINVAL;
+ } else
+ error = ENOSYS;
+ break;
+ case 'u':
+ if (strcmp(keyword, "uid") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ error = read_number(value, 10, &num,
+ 0, UINT_MAX);
+ if (!error)
+ st->st_uid = num;
+ } else if (strcmp(keyword, "uname") == 0) {
+ if (value == NULL) {
+ error = ENOATTR;
+ break;
+ }
+ pwent = getpwnam(value);
+ if (pwent != NULL)
+ st->st_uid = pwent->pw_uid;
+ else
+ error = errno;
+ } else
+ error = ENOSYS;
+ break;
+ default:
+ error = ENOSYS;
+ break;
+ }
+
+ switch (error) {
+ case EINVAL:
+ mtree_error("%s: invalid value '%s'", keyword, value);
+ break;
+ case ENOATTR:
+ mtree_error("%s: keyword needs a value", keyword);
+ break;
+ case ENOSYS:
+ mtree_warning("%s: unsupported keyword", keyword);
+ break;
+ case ENXIO:
+ mtree_error("%s: keyword does not take a value",
+ keyword);
+ break;
+ }
+ } while (1);
+
+ if (error)
+ return (error);
+
+ st->st_mode = (st->st_mode & ~S_IFMT) | node->type;
+
+ /* Nothing more to do for the global defaults. */
+ if (node->name == NULL)
+ return (0);
+
+ /*
+ * Be intelligent about the file type.
+ */
+ if (node->contents != NULL) {
+ if (node->symlink != NULL) {
+ mtree_error("%s: both link and contents keywords "
+ "defined", node->name);
+ return (0);
+ }
+ type = S_IFREG;
+ } else
+ type = (node->symlink != NULL) ? S_IFLNK : S_IFDIR;
+
+ if (node->type == 0)
+ node->type = type;
+
+ if (node->type != type) {
+ mtree_error("%s: file type and defined keywords to not match",
+ node->name);
+ return (0);
+ }
+
+ st->st_mode = (st->st_mode & ~S_IFMT) | node->type;
+
+ if (node->contents == NULL)
+ return (0);
+
+ name = mtree_resolve(node->contents, &istemp);
+ if (name == NULL)
+ return (errno);
+
+ if (stat(name, &sb) != 0) {
+ mtree_error("%s: contents file '%s' not found", node->name,
+ name);
+ free(name);
+ return (0);
+ }
+
+ free(node->contents);
+ node->contents = name;
+ st->st_size = sb.st_size;
+ return (0);
+}
+
+static int
+read_mtree_command(FILE *fp)
+{
+ char cmd[10];
+ int error;
+
+ error = read_word(fp, cmd, sizeof(cmd));
+ if (error)
+ goto out;
+
+ error = read_mtree_keywords(fp, &mtree_global);
+
+ out:
+ skip_to(fp, "\n");
+ (void)getc(fp);
+ return (error);
+}
+
+static int
+read_mtree_spec1(FILE *fp, bool def, const char *name)
+{
+ fsnode *last, *node, *parent;
+ u_int type;
+ int error;
+
+ assert(name[0] != '\0');
+
+ /*
+ * Treat '..' specially, because it only changes our current
+ * directory. We don't create a node for it. We simply ignore
+ * any keywords that may appear on the line as well.
+ * Going up a directory is a little non-obvious. A directory
+ * node has a corresponding '.' child. The parent of '.' is
+ * not the '.' node of the parent directory, but the directory
+ * node within the parent to which the child relates. However,
+ * going up a directory means we need to find the '.' node to
+ * which the directoy node is linked. This we can do via the
+ * first * pointer, because '.' is always the first entry in a
+ * directory.
+ */
+ if (IS_DOTDOT(name)) {
+ /* This deals with NULL pointers as well. */
+ if (mtree_current == mtree_root) {
+ mtree_warning("ignoring .. in root directory");
+ return (0);
+ }
+
+ node = mtree_current;
+
+ assert(node != NULL);
+ assert(IS_DOT(node->name));
+ assert(node->first == node);
+
+ /* Get the corresponding directory node in the parent. */
+ node = mtree_current->parent;
+
+ assert(node != NULL);
+ assert(!IS_DOT(node->name));
+
+ node = node->first;
+
+ assert(node != NULL);
+ assert(IS_DOT(node->name));
+ assert(node->first == node);
+
+ mtree_current = node;
+ return (0);
+ }
+
+ /*
+ * If we don't have a current directory and the first specification
+ * (either implicit or defined) is not '.', then we need to create
+ * a '.' node first (using a recursive call).
+ */
+ if (!IS_DOT(name) && mtree_current == NULL) {
+ error = read_mtree_spec1(fp, false, ".");
+ if (error)
+ return (error);
+ }
+
+ /*
+ * Lookup the name in the current directory (if we have a current
+ * directory) to make sure we do not create multiple nodes for the
+ * same component. For non-definitions, if we find a node with the
+ * same name, simply change the current directory. For definitions
+ * more happens.
+ */
+ last = NULL;
+ node = mtree_current;
+ while (node != NULL) {
+ assert(node->first == mtree_current);
+
+ if (strcmp(name, node->name) == 0) {
+ if (def == true) {
+ mtree_error("duplicate definition of %s",
+ name);
+ return (0);
+ }
+
+ if (node->type != S_IFDIR) {
+ mtree_error("%s is not a directory", name);
+ return (0);
+ }
+
+ assert(!IS_DOT(name));
+
+ node = node->child;
+
+ assert(node != NULL);
+ assert(IS_DOT(node->name));
+
+ mtree_current = node;
+ return (0);
+ }
+
+ last = node;
+ node = last->next;
+ }
+
+ parent = (mtree_current != NULL) ? mtree_current->parent : NULL;
+ type = (def == false || IS_DOT(name)) ? S_IFDIR : 0;
+ node = create_node(name, type, parent, &mtree_global);
+ if (node == NULL)
+ return (ENOMEM);
+
+ if (def == true) {
+ error = read_mtree_keywords(fp, node);
+ if (error) {
+ destroy_node(node);
+ return (error);
+ }
+ }
+
+ node->first = (mtree_current != NULL) ? mtree_current : node;
+
+ if (last != NULL)
+ last->next = node;
+
+ if (node->type != S_IFDIR)
+ return (0);
+
+ if (!IS_DOT(node->name)) {
+ parent = node;
+ node = create_node(".", S_IFDIR, parent, parent);
+ if (node == NULL) {
+ last->next = NULL;
+ destroy_node(parent);
+ return (ENOMEM);
+ }
+ parent->child = node;
+ node->first = node;
+ }
+
+ assert(node != NULL);
+ assert(IS_DOT(node->name));
+ assert(node->first == node);
+
+ mtree_current = node;
+ if (mtree_root == NULL)
+ mtree_root = node;
+
+ return (0);
+}
+
+static int
+read_mtree_spec(FILE *fp)
+{
+ char pathspec[PATH_MAX];
+ char *cp;
+ int error;
+
+ error = read_word(fp, pathspec, sizeof(pathspec));
+ if (error)
+ goto out;
+
+ cp = strchr(pathspec, '/');
+ if (cp != NULL) {
+ /* Absolute pathname */
+ mtree_current = mtree_root;
+
+ do {
+ *cp++ = '\0';
+
+ /* Disallow '.' and '..' as components. */
+ if (IS_DOT(pathspec) || IS_DOTDOT(pathspec)) {
+ mtree_error("absolute path cannot contain . "
+ "or .. components");
+ goto out;
+ }
+
+ /* Ignore multiple adjacent slashes. */
+ if (pathspec[0] != '\0')
+ error = read_mtree_spec1(fp, false, pathspec);
+ memmove(pathspec, cp, strlen(cp) + 1);
+ cp = strchr(pathspec, '/');
+ } while (!error && cp != NULL);
+
+ /* Disallow '.' and '..' as the last component. */
+ if (!error && (IS_DOT(pathspec) || IS_DOTDOT(pathspec))) {
+ mtree_error("absolute path cannot contain . or .. "
+ "components");
+ goto out;
+ }
+ }
+
+ /* Ignore absolute specfications that end with a slash. */
+ if (!error && pathspec[0] != '\0')
+ error = read_mtree_spec1(fp, true, pathspec);
+
+ out:
+ skip_to(fp, "\n");
+ (void)getc(fp);
+ return (error);
+}
+
+fsnode *
+read_mtree(const char *fname, fsnode *node)
+{
+ struct mtree_fileinfo *fi;
+ FILE *fp;
+ int c, error;
+
+ /* We do not yet support nesting... */
+ assert(node == NULL);
+
+ if (strcmp(fname, "-") == 0)
+ fp = stdin;
+ else {
+ fp = fopen(fname, "r");
+ if (fp == NULL)
+ err(1, "Can't open `%s'", fname);
+ }
+
+ error = mtree_file_push(fname, fp);
+ if (error)
+ goto out;
+
+ bzero(&mtree_global, sizeof(mtree_global));
+ bzero(&mtree_global_inode, sizeof(mtree_global_inode));
+ mtree_global.inode = &mtree_global_inode;
+ mtree_global_inode.nlink = 1;
+ mtree_global_inode.st.st_atime = mtree_global_inode.st.st_ctime =
+ mtree_global_inode.st.st_mtime = time(NULL);
+ errors = warnings = 0;
+
+ setgroupent(1);
+ setpassent(1);
+
+ mtree_root = node;
+ mtree_current = node;
+ do {
+ /* Start of a new line... */
+ fi = SLIST_FIRST(&mtree_fileinfo);
+ fi->line++;
+
+ error = skip_over(fp, " \t");
+ if (error)
+ break;
+
+ c = getc(fp);
+ if (c == EOF) {
+ error = ferror(fp) ? errno : -1;
+ break;
+ }
+
+ switch (c) {
+ case '\n': /* empty line */
+ error = 0;
+ break;
+ case '#': /* comment -- skip to end of line. */
+ error = skip_to(fp, "\n");
+ if (!error)
+ (void)getc(fp);
+ break;
+ case '/': /* special commands */
+ error = read_mtree_command(fp);
+ break;
+ default: /* specification */
+ ungetc(c, fp);
+ error = read_mtree_spec(fp);
+ break;
+ }
+ } while (!error);
+
+ endpwent();
+ endgrent();
+
+ if (error <= 0 && (errors || warnings)) {
+ warnx("%u error(s) and %u warning(s) in mtree manifest",
+ errors, warnings);
+ if (errors)
+ exit(1);
+ }
+
+ out:
+ if (error > 0)
+ errc(1, error, "Error reading mtree file");
+
+ if (fp != stdin)
+ fclose(fp);
+
+ if (mtree_root != NULL)
+ return (mtree_root);
+
+ /* Handle empty specifications. */
+ node = create_node(".", S_IFDIR, NULL, &mtree_global);
+ node->first = node;
+ return (node);
+}
diff --git a/usr.sbin/mfiutil/mfi_config.c b/usr.sbin/mfiutil/mfi_config.c
index fdda117..f6f1a9d 100644
--- a/usr.sbin/mfiutil/mfi_config.c
+++ b/usr.sbin/mfiutil/mfi_config.c
@@ -85,6 +85,7 @@ mfi_config_read(int fd, struct mfi_config_data **configp)
{
struct mfi_config_data *config;
uint32_t config_size;
+ int error;
/*
* Keep fetching the config in a loop until we have a large enough
@@ -97,8 +98,12 @@ fetch:
if (config == NULL)
return (-1);
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_READ, config,
- config_size, NULL, 0, NULL) < 0)
+ config_size, NULL, 0, NULL) < 0) {
+ error = errno;
+ free(config);
+ errno = error;
return (-1);
+ }
if (config->size > config_size) {
config_size = config->size;
@@ -162,12 +167,14 @@ clear_config(int ac, char **av)
if (!mfi_reconfig_supported()) {
warnx("The current mfi(4) driver does not support "
"configuration changes.");
+ close(fd);
return (EOPNOTSUPP);
}
if (mfi_ld_get_list(fd, &list, NULL) < 0) {
error = errno;
warn("Failed to get volume list");
+ close(fd);
return (error);
}
@@ -175,6 +182,7 @@ clear_config(int ac, char **av)
if (mfi_volume_busy(fd, list.ld_list[i].ld.v.target_id)) {
warnx("Volume %s is busy and cannot be deleted",
mfi_volume_name(fd, list.ld_list[i].ld.v.target_id));
+ close(fd);
return (EBUSY);
}
}
@@ -185,12 +193,14 @@ clear_config(int ac, char **av)
ch = getchar();
if (ch != 'y' && ch != 'Y') {
printf("\nAborting\n");
+ close(fd);
return (0);
}
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_CLEAR, NULL, 0, NULL, 0, NULL) < 0) {
error = errno;
warn("Failed to clear configuration");
+ close(fd);
return (error);
}
@@ -336,17 +346,21 @@ parse_array(int fd, int raid_type, char *array_str, struct array_info *info)
for (pinfo = info->drives; (cp = strsep(&array_str, ",")) != NULL;
pinfo++) {
error = mfi_lookup_drive(fd, cp, &device_id);
- if (error)
+ if (error) {
+ free(info->drives);
return (error);
+ }
if (mfi_pd_get_info(fd, device_id, pinfo, NULL) < 0) {
error = errno;
warn("Failed to fetch drive info for drive %s", cp);
+ free(info->drives);
return (error);
}
if (pinfo->fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) {
warnx("Drive %u is not available", device_id);
+ free(info->drives);
return (EINVAL);
}
}
@@ -405,8 +419,10 @@ build_array(int fd, char *arrayp, struct array_info *array_info,
ar->array_ref = find_next_array(state);
for (i = 0; i < array_info->drive_count; i++) {
if (verbose)
- printf("Adding drive %u to array %u\n",
+ printf("Adding drive %s to array %u\n",
+ mfi_drive_name(NULL,
array_info->drives[i].ref.v.device_id,
+ MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS),
ar->array_ref);
if (ar->size > array_info->drives[i].coerced_size)
ar->size = array_info->drives[i].coerced_size;
@@ -551,7 +567,12 @@ create_volume(int ac, char **av)
return (EINVAL);
}
-
+ bzero(&state, sizeof(state));
+ config = NULL;
+ arrays = NULL;
+ narrays = 0;
+ error = 0;
+
fd = mfi_open(mfi_unit);
if (fd < 0) {
error = errno;
@@ -562,7 +583,8 @@ create_volume(int ac, char **av)
if (!mfi_reconfig_supported()) {
warnx("The current mfi(4) driver does not support "
"configuration changes.");
- return (EOPNOTSUPP);
+ error = EOPNOTSUPP;
+ goto error;
}
/* Lookup the RAID type first. */
@@ -575,7 +597,8 @@ create_volume(int ac, char **av)
if (raid_type == -1) {
warnx("Unknown or unsupported volume type %s", av[1]);
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
/* Parse any options. */
@@ -603,7 +626,8 @@ create_volume(int ac, char **av)
break;
case '?':
default:
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
}
ac -= optind;
@@ -613,7 +637,8 @@ create_volume(int ac, char **av)
narrays = ac;
if (narrays == 0) {
warnx("At least one drive list is required");
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
switch (raid_type) {
case RT_RAID0:
@@ -623,7 +648,8 @@ create_volume(int ac, char **av)
case RT_CONCAT:
if (narrays != 1) {
warnx("Only one drive list can be specified");
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
break;
case RT_RAID10:
@@ -632,24 +658,27 @@ create_volume(int ac, char **av)
if (narrays < 1) {
warnx("RAID10, RAID50, and RAID60 require at least "
"two drive lists");
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
if (narrays > MFI_MAX_SPAN_DEPTH) {
warnx("Volume spans more than %d arrays",
MFI_MAX_SPAN_DEPTH);
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
break;
}
arrays = calloc(narrays, sizeof(*arrays));
if (arrays == NULL) {
warnx("malloc failed");
- return (ENOMEM);
+ error = ENOMEM;
+ goto error;
}
for (i = 0; i < narrays; i++) {
error = parse_array(fd, raid_type, av[i], &arrays[i]);
if (error)
- return (error);
+ goto error;
}
switch (raid_type) {
@@ -660,7 +689,8 @@ create_volume(int ac, char **av)
if (arrays[i].drive_count != arrays[0].drive_count) {
warnx("All arrays must contain the same "
"number of drives");
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
}
break;
@@ -673,7 +703,7 @@ create_volume(int ac, char **av)
if (mfi_config_read(fd, &config) < 0) {
error = errno;
warn("Failed to read configuration");
- return (error);
+ goto error;
}
p = (char *)config->array;
state.array_ref = 0xffff;
@@ -683,7 +713,8 @@ create_volume(int ac, char **av)
state.arrays = calloc(config->array_count, sizeof(int));
if (state.arrays == NULL) {
warnx("malloc failed");
- return (ENOMEM);
+ error = ENOMEM;
+ goto error;
}
for (i = 0; i < config->array_count; i++) {
ar = (struct mfi_array *)p;
@@ -699,7 +730,8 @@ create_volume(int ac, char **av)
state.volumes = calloc(config->log_drv_count, sizeof(int));
if (state.volumes == NULL) {
warnx("malloc failed");
- return (ENOMEM);
+ error = ENOMEM;
+ goto error;
}
for (i = 0; i < config->log_drv_count; i++) {
ld = (struct mfi_ld_config *)p;
@@ -739,7 +771,8 @@ create_volume(int ac, char **av)
config = calloc(1, config_size);
if (config == NULL) {
warnx("malloc failed");
- return (ENOMEM);
+ error = ENOMEM;
+ goto error;
}
config->size = config_size;
config->array_count = narrays;
@@ -776,21 +809,20 @@ create_volume(int ac, char **av)
NULL, 0, NULL) < 0) {
error = errno;
warn("Failed to add volume");
- return (error);
+ /* FALLTHROUGH */
}
+error:
/* Clean up. */
free(config);
- if (state.log_drv_count > 0)
- free(state.volumes);
- if (state.array_count > 0)
- free(state.arrays);
+ free(state.volumes);
+ free(state.arrays);
for (i = 0; i < narrays; i++)
free(arrays[i].drives);
free(arrays);
close(fd);
- return (0);
+ return (error);
}
MFI_COMMAND(top, create, create_volume);
@@ -831,24 +863,28 @@ delete_volume(int ac, char **av)
if (!mfi_reconfig_supported()) {
warnx("The current mfi(4) driver does not support "
"configuration changes.");
+ close(fd);
return (EOPNOTSUPP);
}
if (mfi_lookup_volume(fd, av[1], &target_id) < 0) {
error = errno;
warn("Invalid volume %s", av[1]);
+ close(fd);
return (error);
}
if (mfi_ld_get_info(fd, target_id, &info, NULL) < 0) {
error = errno;
warn("Failed to get info for volume %d", target_id);
+ close(fd);
return (error);
}
if (mfi_volume_busy(fd, target_id)) {
warnx("Volume %s is busy and cannot be deleted",
mfi_volume_name(fd, target_id));
+ close(fd);
return (EBUSY);
}
@@ -857,6 +893,7 @@ delete_volume(int ac, char **av)
sizeof(mbox), NULL) < 0) {
error = errno;
warn("Failed to delete volume");
+ close(fd);
return (error);
}
@@ -891,40 +928,44 @@ add_spare(int ac, char **av)
return (error);
}
+ config = NULL;
+ spare = NULL;
error = mfi_lookup_drive(fd, av[1], &device_id);
if (error)
- return (error);
+ goto error;
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
error = errno;
warn("Failed to fetch drive info");
- return (error);
+ goto error;
}
if (info.fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) {
warnx("Drive %u is not available", device_id);
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
if (ac > 2) {
if (mfi_lookup_volume(fd, av[2], &target_id) < 0) {
error = errno;
warn("Invalid volume %s", av[2]);
- return (error);
+ goto error;
}
}
if (mfi_config_read(fd, &config) < 0) {
error = errno;
warn("Failed to read configuration");
- return (error);
+ goto error;
}
spare = malloc(sizeof(struct mfi_spare) + sizeof(uint16_t) *
config->array_count);
if (spare == NULL) {
warnx("malloc failed");
- return (ENOMEM);
+ error = ENOMEM;
+ goto error;
}
bzero(spare, sizeof(struct mfi_spare));
spare->ref = info.ref;
@@ -937,7 +978,8 @@ add_spare(int ac, char **av)
if (ar->size > info.coerced_size) {
warnx("Spare isn't large enough for array %u",
ar->array_ref);
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
p += config->array_size;
}
@@ -950,7 +992,8 @@ add_spare(int ac, char **av)
ld = mfi_config_lookup_volume(config, target_id);
if (ld == NULL) {
warnx("Did not find volume %d", target_id);
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
spare->spare_type |= MFI_SPARE_DEDICATED;
@@ -960,29 +1003,33 @@ add_spare(int ac, char **av)
ld->span[i].array_ref);
if (ar == NULL) {
warnx("Missing array; inconsistent config?");
- return (ENXIO);
+ error = ENXIO;
+ goto error;
}
if (ar->size > info.coerced_size) {
warnx("Spare isn't large enough for array %u",
ar->array_ref);
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
spare->array_ref[i] = ar->array_ref;
}
}
- free(config);
if (mfi_dcmd_command(fd, MFI_DCMD_CFG_MAKE_SPARE, spare,
sizeof(struct mfi_spare) + sizeof(uint16_t) * spare->array_count,
NULL, 0, NULL) < 0) {
error = errno;
warn("Failed to assign spare");
- return (error);
+ /* FALLTHROUGH. */
}
+error:
+ free(spare);
+ free(config);
close(fd);
- return (0);
+ return (error);
}
MFI_COMMAND(top, add, add_spare);
@@ -1007,18 +1054,22 @@ remove_spare(int ac, char **av)
}
error = mfi_lookup_drive(fd, av[1], &device_id);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
/* Get the info for this drive. */
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
error = errno;
warn("Failed to fetch info for drive %u", device_id);
+ close(fd);
return (error);
}
if (info.fw_state != MFI_PD_STATE_HOT_SPARE) {
warnx("Drive %u is not a hot spare", device_id);
+ close(fd);
return (EINVAL);
}
@@ -1027,6 +1078,7 @@ remove_spare(int ac, char **av)
sizeof(mbox), NULL) < 0) {
error = errno;
warn("Failed to delete spare");
+ close(fd);
return (error);
}
@@ -1151,6 +1203,7 @@ debug_config(int ac, char **av)
if (mfi_config_read(fd, &config) < 0) {
error = errno;
warn("Failed to get config");
+ close(fd);
return (error);
}
@@ -1190,17 +1243,21 @@ dump(int ac, char **av)
warn("Failed to read debug command");
if (error == ENOENT)
error = EOPNOTSUPP;
+ close(fd);
return (error);
}
config = malloc(len);
if (config == NULL) {
warnx("malloc failed");
+ close(fd);
return (ENOMEM);
}
if (sysctlbyname(buf, config, &len, NULL, 0) < 0) {
error = errno;
warn("Failed to read debug command");
+ free(config);
+ close(fd);
return (error);
}
dump_config(fd, config);
diff --git a/usr.sbin/mfiutil/mfi_drive.c b/usr.sbin/mfiutil/mfi_drive.c
index 75c4a53..6341fd8 100644
--- a/usr.sbin/mfiutil/mfi_drive.c
+++ b/usr.sbin/mfiutil/mfi_drive.c
@@ -45,6 +45,87 @@
MFI_TABLE(top, drive);
+/*
+ * Print the name of a drive either by drive number as %2u or by enclosure:slot
+ * as Exx:Sxx (or both). Use default unless command line options override it
+ * and the command allows this (which we usually do unless we already print
+ * both). We prefer pinfo if given, otherwise try to look it up by device_id.
+ */
+const char *
+mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def)
+{
+ struct mfi_pd_info info;
+ static char buf[16];
+ char *p;
+ int error, fd, len;
+
+ if ((def & MFI_DNAME_HONOR_OPTS) != 0 &&
+ (mfi_opts & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) != 0)
+ def = mfi_opts & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID);
+
+ buf[0] = '\0';
+ if (pinfo == NULL && def & MFI_DNAME_ES) {
+ /* Fallback in case of error, just ignore flags. */
+ if (device_id == 0xffff)
+ snprintf(buf, sizeof(buf), "MISSING");
+ else
+ snprintf(buf, sizeof(buf), "%2u", device_id);
+
+ fd = mfi_open(mfi_unit);
+ if (fd < 0) {
+ warn("mfi_open");
+ return (buf);
+ }
+
+ /* Get the info for this drive. */
+ if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
+ warn("Failed to fetch info for drive %2u", device_id);
+ close(fd);
+ return (buf);
+ }
+
+ close(fd);
+ pinfo = &info;
+ }
+
+ p = buf;
+ len = sizeof(buf);
+ if (def & MFI_DNAME_DEVICE_ID) {
+ if (device_id == 0xffff)
+ error = snprintf(p, len, "MISSING");
+ else
+ error = snprintf(p, len, "%2u", device_id);
+ if (error >= 0) {
+ p += error;
+ len -= error;
+ }
+ }
+ if ((def & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) ==
+ (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID) && len >= 2) {
+ *p++ = ' ';
+ len--;
+ *p = '\0';
+ len--;
+ }
+ if (def & MFI_DNAME_ES) {
+ if (pinfo->encl_device_id == 0xffff)
+ error = snprintf(p, len, "S%u",
+ pinfo->slot_number);
+ else if (pinfo->encl_device_id == pinfo->ref.v.device_id)
+ error = snprintf(p, len, "E%u",
+ pinfo->encl_index);
+ else
+ error = snprintf(p, len, "E%u:S%u",
+ pinfo->encl_index, pinfo->slot_number);
+ if (error >= 0) {
+ p += error;
+ len -= error;
+ }
+ }
+
+ return (buf);
+}
+
const char *
mfi_pdstate(enum mfi_pd_state state)
{
@@ -310,19 +391,23 @@ drive_set_state(char *drive, uint16_t new_state)
}
error = mfi_lookup_drive(fd, drive, &device_id);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
/* Get the info for this drive. */
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
error = errno;
warn("Failed to fetch info for drive %u", device_id);
+ close(fd);
return (error);
}
/* Try to change the state. */
if (info.fw_state == new_state) {
warnx("Drive %u is already in the desired state", device_id);
+ close(fd);
return (EINVAL);
}
@@ -334,6 +419,7 @@ drive_set_state(char *drive, uint16_t new_state)
error = errno;
warn("Failed to set drive %u to %s", device_id,
mfi_pdstate(new_state));
+ close(fd);
return (error);
}
@@ -406,19 +492,23 @@ start_rebuild(int ac, char **av)
}
error = mfi_lookup_drive(fd, av[1], &device_id);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
/* Get the info for this drive. */
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
error = errno;
warn("Failed to fetch info for drive %u", device_id);
+ close(fd);
return (error);
}
/* Check the state, must be REBUILD. */
if (info.fw_state != MFI_PD_STATE_REBUILD) {
warnx("Drive %d is not in the REBUILD state", device_id);
+ close(fd);
return (EINVAL);
}
@@ -428,6 +518,7 @@ start_rebuild(int ac, char **av)
NULL) < 0) {
error = errno;
warn("Failed to start rebuild on drive %u", device_id);
+ close(fd);
return (error);
}
close(fd);
@@ -458,19 +549,23 @@ abort_rebuild(int ac, char **av)
}
error = mfi_lookup_drive(fd, av[1], &device_id);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
/* Get the info for this drive. */
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
error = errno;
warn("Failed to fetch info for drive %u", device_id);
+ close(fd);
return (error);
}
/* Check the state, must be REBUILD. */
if (info.fw_state != MFI_PD_STATE_REBUILD) {
warn("Drive %d is not in the REBUILD state", device_id);
+ close(fd);
return (EINVAL);
}
@@ -480,6 +575,7 @@ abort_rebuild(int ac, char **av)
NULL) < 0) {
error = errno;
warn("Failed to abort rebuild on drive %u", device_id);
+ close(fd);
return (error);
}
close(fd);
@@ -509,13 +605,16 @@ drive_progress(int ac, char **av)
}
error = mfi_lookup_drive(fd, av[1], &device_id);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
/* Get the info for this drive. */
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
error = errno;
warn("Failed to fetch info for drive %u", device_id);
+ close(fd);
return (error);
}
close(fd);
@@ -529,7 +628,9 @@ drive_progress(int ac, char **av)
mfi_display_progress("Clear", &info.prog_info.clear);
if ((info.prog_info.active & (MFI_PD_PROGRESS_REBUILD |
MFI_PD_PROGRESS_PATROL | MFI_PD_PROGRESS_CLEAR)) == 0)
- printf("No activity in progress for drive %u.\n", device_id);
+ printf("No activity in progress for drive %s.\n",
+ mfi_drive_name(NULL, device_id,
+ MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS));
return (0);
}
@@ -570,13 +671,16 @@ drive_clear(int ac, char **av)
}
error = mfi_lookup_drive(fd, av[1], &device_id);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
/* Get the info for this drive. */
if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
error = errno;
warn("Failed to fetch info for drive %u", device_id);
+ close(fd);
return (error);
}
@@ -586,6 +690,7 @@ drive_clear(int ac, char **av)
warn("Failed to %s clear on drive %u",
opcode == MFI_DCMD_PD_CLEAR_START ? "start" : "stop",
device_id);
+ close(fd);
return (error);
}
@@ -626,8 +731,10 @@ drive_locate(int ac, char **av)
}
error = mfi_lookup_drive(fd, av[1], &device_id);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
mbox_store_device_id(&mbox[0], device_id);
@@ -638,6 +745,7 @@ drive_locate(int ac, char **av)
warn("Failed to %s locate on drive %u",
opcode == MFI_DCMD_PD_LOCATE_START ? "start" : "stop",
device_id);
+ close(fd);
return (error);
}
close(fd);
diff --git a/usr.sbin/mfiutil/mfi_evt.c b/usr.sbin/mfiutil/mfi_evt.c
index b9288d8..336fbd3 100644
--- a/usr.sbin/mfiutil/mfi_evt.c
+++ b/usr.sbin/mfiutil/mfi_evt.c
@@ -83,6 +83,7 @@ show_logstate(int ac, char **av)
if (mfi_event_get_info(fd, &info, NULL) < 0) {
error = errno;
warn("Failed to get event log info");
+ close(fd);
return (error);
}
@@ -362,8 +363,8 @@ mfi_decode_evt(int fd, struct mfi_evt_detail *detail, int verbose)
{
printf("%5d (%s/%s/%s) - ", detail->seq, format_timestamp(detail->time),
- format_locale(detail->class.members.locale),
- format_class(detail->class.members.class));
+ format_locale(detail->evt_class.members.locale),
+ format_class(detail->evt_class.members.evt_class));
switch (detail->arg_type) {
case MR_EVT_ARGS_NONE:
break;
@@ -550,6 +551,7 @@ show_events(int ac, char **av)
if (mfi_event_get_info(fd, &info, NULL) < 0) {
error = errno;
warn("Failed to get event log info");
+ close(fd);
return (error);
}
@@ -557,7 +559,7 @@ show_events(int ac, char **av)
num_events = 15;
filter.members.reserved = 0;
filter.members.locale = MFI_EVT_LOCALE_ALL;
- filter.members.class = MFI_EVT_CLASS_WARNING;
+ filter.members.evt_class = MFI_EVT_CLASS_WARNING;
start = info.boot_seq_num;
stop = info.newest_seq_num;
verbose = 0;
@@ -567,9 +569,10 @@ show_events(int ac, char **av)
while ((ch = getopt(ac, av, "c:l:n:v")) != -1) {
switch (ch) {
case 'c':
- if (parse_class(optarg, &filter.members.class) < 0) {
+ if (parse_class(optarg, &filter.members.evt_class) < 0) {
error = errno;
warn("Error parsing event class");
+ close(fd);
return (error);
}
break;
@@ -577,6 +580,7 @@ show_events(int ac, char **av)
if (parse_locale(optarg, &filter.members.locale) < 0) {
error = errno;
warn("Error parsing event locale");
+ close(fd);
return (error);
}
break;
@@ -584,6 +588,7 @@ show_events(int ac, char **av)
val = strtol(optarg, &cp, 0);
if (*cp != '\0' || val <= 0) {
warnx("Invalid event count");
+ close(fd);
return (EINVAL);
}
num_events = val;
@@ -593,6 +598,7 @@ show_events(int ac, char **av)
break;
case '?':
default:
+ close(fd);
return (EINVAL);
}
}
@@ -604,28 +610,33 @@ show_events(int ac, char **av)
(num_events - 1);
if (size > getpagesize()) {
warnx("Event count is too high");
+ close(fd);
return (EINVAL);
}
/* Handle optional start and stop sequence numbers. */
if (ac > 2) {
warnx("show events: extra arguments");
+ close(fd);
return (EINVAL);
}
if (ac > 0 && parse_seq(&info, av[0], &start) < 0) {
error = errno;
warn("Error parsing starting sequence number");
+ close(fd);
return (error);
}
if (ac > 1 && parse_seq(&info, av[1], &stop) < 0) {
error = errno;
warn("Error parsing ending sequence number");
+ close(fd);
return (error);
}
list = malloc(size);
if (list == NULL) {
warnx("malloc failed");
+ close(fd);
return (ENOMEM);
}
for (seq = start;;) {
@@ -633,6 +644,8 @@ show_events(int ac, char **av)
&status) < 0) {
error = errno;
warn("Failed to fetch events");
+ free(list);
+ close(fd);
return (error);
}
if (status == MFI_STAT_NOT_FOUND) {
@@ -642,6 +655,8 @@ show_events(int ac, char **av)
}
if (status != MFI_STAT_OK) {
warnx("Error fetching events: %s", mfi_status(status));
+ free(list);
+ close(fd);
return (EIO);
}
diff --git a/usr.sbin/mfiutil/mfi_flash.c b/usr.sbin/mfiutil/mfi_flash.c
index 4039beb..6d07cb0 100644
--- a/usr.sbin/mfiutil/mfi_flash.c
+++ b/usr.sbin/mfiutil/mfi_flash.c
@@ -136,21 +136,25 @@ flash_adapter(int ac, char **av)
return (error);
}
+ buf = NULL;
+ fd = -1;
+
if (fstat(flash, &sb) < 0) {
error = errno;
warn("fstat(%s)", av[1]);
- return (error);
+ goto error;
}
if (sb.st_size % 1024 != 0 || sb.st_size > 0x7fffffff) {
warnx("Invalid flash file size");
- return (EINVAL);
+ error = EINVAL;
+ goto error;
}
fd = mfi_open(mfi_unit);
if (fd < 0) {
error = errno;
warn("mfi_open");
- return (error);
+ goto error;
}
/* First, ask the firmware to allocate space for the flash file. */
@@ -158,14 +162,16 @@ flash_adapter(int ac, char **av)
mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_OPEN, NULL, 0, mbox, 4, &status);
if (status != MFI_STAT_OK) {
warnx("Failed to alloc flash memory: %s", mfi_status(status));
- return (EIO);
+ error = EIO;
+ goto error;
}
/* Upload the file 64k at a time. */
buf = malloc(FLASH_BUF_SIZE);
if (buf == NULL) {
warnx("malloc failed");
- return (ENOMEM);
+ error = ENOMEM;
+ goto error;
}
offset = 0;
while (sb.st_size > 0) {
@@ -174,7 +180,8 @@ flash_adapter(int ac, char **av)
warnx("Bad read from flash file");
mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL, 0,
NULL, 0, NULL);
- return (ENXIO);
+ error = ENXIO;
+ goto error;
}
mbox_store_word(mbox, offset);
@@ -184,12 +191,12 @@ flash_adapter(int ac, char **av)
warnx("Flash download failed: %s", mfi_status(status));
mfi_dcmd_command(fd, MFI_DCMD_FLASH_FW_CLOSE, NULL, 0,
NULL, 0, NULL);
- return (ENXIO);
+ error = ENXIO;
+ goto error;
}
sb.st_size -= nread;
offset += nread;
}
- close(flash);
/* Kick off the flash. */
printf("WARNING: Firmware flash in progress, do not reboot machine... ");
@@ -198,12 +205,17 @@ flash_adapter(int ac, char **av)
NULL, 0, &status);
if (status != MFI_STAT_OK) {
printf("failed:\n\t%s\n", mfi_status(status));
- return (ENXIO);
+ error = ENXIO;
+ goto error;
}
printf("finished\n");
error = display_pending_firmware(fd);
- close(fd);
+error:
+ free(buf);
+ if (fd >= 0)
+ close(fd);
+ close(flash);
return (error);
}
diff --git a/usr.sbin/mfiutil/mfi_patrol.c b/usr.sbin/mfiutil/mfi_patrol.c
index da7ddb5..dd348ad 100644
--- a/usr.sbin/mfiutil/mfi_patrol.c
+++ b/usr.sbin/mfiutil/mfi_patrol.c
@@ -80,7 +80,7 @@ show_patrol(int ac, char **av)
struct mfi_pr_status status;
struct mfi_pd_list *list;
struct mfi_pd_info info;
- char label[16];
+ char label[24];
time_t now;
uint32_t at;
int error, fd;
@@ -96,8 +96,10 @@ show_patrol(int ac, char **av)
time(&now);
mfi_get_time(fd, &at);
error = patrol_get_props(fd, &prop);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
printf("Operation Mode: ");
switch (prop.op_mode) {
case MFI_PR_OPMODE_AUTO:
@@ -128,6 +130,7 @@ show_patrol(int ac, char **av)
sizeof(status), NULL, 0, NULL) < 0) {
error = errno;
warn("Failed to get patrol read properties");
+ close(fd);
return (error);
}
printf("Runs Completed: %u\n", status.num_iteration);
@@ -153,6 +156,7 @@ show_patrol(int ac, char **av)
if (mfi_pd_get_list(fd, &list, NULL) < 0) {
error = errno;
warn("Failed to get drive list");
+ close(fd);
return (error);
}
@@ -165,15 +169,20 @@ show_patrol(int ac, char **av)
error = errno;
warn("Failed to fetch info for drive %u",
list->addr[i].device_id);
+ free(list);
+ close(fd);
return (error);
}
if (info.prog_info.active & MFI_PD_PROGRESS_PATROL) {
- snprintf(label, sizeof(label), " Drive %u",
- list->addr[i].device_id);
+ snprintf(label, sizeof(label), " Drive %s",
+ mfi_drive_name(NULL,
+ list->addr[i].device_id,
+ MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS));
mfi_display_progress(label,
&info.prog_info.patrol);
}
}
+ free(list);
}
close(fd);
@@ -198,6 +207,7 @@ start_patrol(int ac, char **av)
0) {
error = errno;
warn("Failed to start patrol read");
+ close(fd);
return (error);
}
@@ -223,6 +233,7 @@ stop_patrol(int ac, char **av)
0) {
error = errno;
warn("Failed to stop patrol read");
+ close(fd);
return (error);
}
@@ -289,8 +300,10 @@ patrol_config(int ac, char **av)
}
error = patrol_get_props(fd, &prop);
- if (error)
+ if (error) {
+ close(fd);
return (error);
+ }
prop.op_mode = op_mode;
if (op_mode == MFI_PR_OPMODE_AUTO) {
if (ac > 2)
@@ -298,8 +311,10 @@ patrol_config(int ac, char **av)
if (ac > 3) {
time(&now);
mfi_get_time(fd, &at);
- if (at == 0)
+ if (at == 0) {
+ close(fd);
return (ENXIO);
+ }
prop.next_exec = at + next_exec;
printf("Starting next patrol read at %s",
adapter_time(now, at, prop.next_exec));
@@ -309,6 +324,7 @@ patrol_config(int ac, char **av)
sizeof(prop), NULL, 0, NULL) < 0) {
error = errno;
warn("Failed to set patrol read properties");
+ close(fd);
return (error);
}
diff --git a/usr.sbin/mfiutil/mfi_show.c b/usr.sbin/mfiutil/mfi_show.c
index 22a735d..d1f0071 100644
--- a/usr.sbin/mfiutil/mfi_show.c
+++ b/usr.sbin/mfiutil/mfi_show.c
@@ -71,6 +71,7 @@ show_adapter(int ac, char **av)
if (mfi_ctrl_get_info(fd, &info, NULL) < 0) {
error = errno;
warn("Failed to get controller info");
+ close(fd);
return (error);
}
printf("mfi%d Adapter:\n", mfi_unit);
@@ -158,10 +159,12 @@ show_battery(int ac, char **av)
sizeof(cap), NULL, 0, &status) < 0) {
if (status == MFI_STAT_NO_HW_PRESENT) {
printf("mfi%d: No battery present\n", mfi_unit);
+ close(fd);
return (0);
}
error = errno;
warn("Failed to get capacity info");
+ close(fd);
return (error);
}
@@ -169,6 +172,7 @@ show_battery(int ac, char **av)
sizeof(design), NULL, 0, NULL) < 0) {
error = errno;
warn("Failed to get design info");
+ close(fd);
return (error);
}
@@ -176,6 +180,7 @@ show_battery(int ac, char **av)
NULL, 0, NULL) < 0) {
error = errno;
warn("Failed to get status");
+ close(fd);
return (error);
}
@@ -253,7 +258,7 @@ print_ld(struct mfi_ld_info *info, int state_len)
}
static void
-print_pd(struct mfi_pd_info *info, int state_len, int location)
+print_pd(struct mfi_pd_info *info, int state_len)
{
const char *s;
char buf[6];
@@ -268,15 +273,6 @@ print_pd(struct mfi_pd_info *info, int state_len, int location)
s = mfi_pd_inq_string(info);
if (s != NULL)
printf(" %s", s);
- if (!location)
- return;
- if (info->encl_device_id == 0xffff)
- printf(" slot %d", info->slot_number);
- else if (info->encl_device_id == info->ref.v.device_id)
- printf(" enclosure %d", info->encl_index);
- else
- printf(" enclosure %d, slot %d", info->encl_index,
- info->slot_number);
}
static int
@@ -308,6 +304,7 @@ show_config(int ac, char **av)
if (mfi_config_read(fd, &config) < 0) {
error = errno;
warn("Failed to get config");
+ close(fd);
return (error);
}
@@ -323,16 +320,16 @@ show_config(int ac, char **av)
ar->num_drives);
for (j = 0; j < ar->num_drives; j++) {
device_id = ar->pd[j].ref.v.device_id;
- if (device_id == 0xffff)
- printf(" drive MISSING\n");
- else {
- printf(" drive %u ", device_id);
+ printf(" drive %s ", mfi_drive_name(NULL,
+ device_id,
+ MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS));
+ if (device_id != 0xffff) {
if (mfi_pd_get_info(fd, device_id, &pinfo,
NULL) < 0)
printf("%s",
mfi_pdstate(ar->pd[j].fw_state));
else
- print_pd(&pinfo, -1, 1);
+ print_pd(&pinfo, -1);
printf("\n");
}
}
@@ -361,13 +358,14 @@ show_config(int ac, char **av)
for (i = 0; i < config->spares_count; i++) {
sp = (struct mfi_spare *)p;
- printf(" %s spare %u ",
+ printf(" %s spare %s ",
sp->spare_type & MFI_SPARE_DEDICATED ? "dedicated" :
- "global", sp->ref.v.device_id);
+ "global", mfi_drive_name(NULL, sp->ref.v.device_id,
+ MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS));
if (mfi_pd_get_info(fd, sp->ref.v.device_id, &pinfo, NULL) < 0)
printf("%s", mfi_pdstate(MFI_PD_STATE_HOT_SPARE));
else
- print_pd(&pinfo, -1, 1);
+ print_pd(&pinfo, -1);
if (sp->spare_type & MFI_SPARE_DEDICATED) {
printf(" backs:\n");
for (j = 0; j < sp->array_count; j++)
@@ -376,6 +374,7 @@ show_config(int ac, char **av)
printf("\n");
p += config->spares_size;
}
+ free(config);
close(fd);
return (0);
@@ -406,6 +405,7 @@ show_volumes(int ac, char **av)
if (mfi_ld_get_list(fd, &list, NULL) < 0) {
error = errno;
warn("Failed to get volume list");
+ close(fd);
return (error);
}
@@ -431,6 +431,7 @@ show_volumes(int ac, char **av)
error = errno;
warn("Failed to get info for volume %d",
list.ld_list[i].ld.v.target_id);
+ close(fd);
return (error);
}
printf("%6s ",
@@ -483,10 +484,11 @@ show_drives(int ac, char **av)
return (error);
}
+ list = NULL;
if (mfi_pd_get_list(fd, &list, NULL) < 0) {
error = errno;
warn("Failed to get drive list");
- return (error);
+ goto error;
}
/* Walk the list of drives to determine width of state column. */
@@ -500,7 +502,7 @@ show_drives(int ac, char **av)
error = errno;
warn("Failed to fetch info for drive %u",
list->addr[i].device_id);
- return (error);
+ goto error;
}
len = strlen(mfi_pdstate(info.fw_state));
if (len > state_len)
@@ -521,15 +523,21 @@ show_drives(int ac, char **av)
error = errno;
warn("Failed to fetch info for drive %u",
list->addr[i].device_id);
- return (error);
+ goto error;
}
- print_pd(&info, state_len, 1);
+ printf("%s ", mfi_drive_name(&info, list->addr[i].device_id,
+ MFI_DNAME_DEVICE_ID));
+ print_pd(&info, state_len);
+ printf(" %s", mfi_drive_name(&info, list->addr[i].device_id,
+ MFI_DNAME_ES));
printf("\n");
}
+error:
+ free(list);
close(fd);
- return (0);
+ return (error);
}
MFI_COMMAND(show, drives, show_drives);
@@ -586,6 +594,7 @@ show_firmware(int ac, char **av)
if (mfi_ctrl_get_info(fd, &info, NULL) < 0) {
error = errno;
warn("Failed to get controller info");
+ close(fd);
return (error);
}
@@ -627,7 +636,6 @@ show_progress(int ac, char **av)
struct mfi_pd_info pinfo;
int busy, error, fd;
u_int i;
-
uint16_t device_id;
uint8_t target_id;
@@ -642,25 +650,29 @@ show_progress(int ac, char **av)
warn("mfi_open");
return (error);
}
- busy = 0;
if (mfi_ld_get_list(fd, &llist, NULL) < 0) {
error = errno;
warn("Failed to get volume list");
+ close(fd);
return (error);
}
if (mfi_pd_get_list(fd, &plist, NULL) < 0) {
error = errno;
warn("Failed to get drive list");
+ close(fd);
return (error);
}
+ busy = 0;
for (i = 0; i < llist.ld_count; i++) {
target_id = llist.ld_list[i].ld.v.target_id;
if (mfi_ld_get_info(fd, target_id, &linfo, NULL) < 0) {
error = errno;
warn("Failed to get info for volume %s",
mfi_volume_name(fd, target_id));
+ free(plist);
+ close(fd);
return (error);
}
if (linfo.progress.active & MFI_LD_PROGRESS_CC) {
@@ -697,27 +709,33 @@ show_progress(int ac, char **av)
if (mfi_pd_get_info(fd, device_id, &pinfo, NULL) < 0) {
error = errno;
warn("Failed to fetch info for drive %u", device_id);
+ free(plist);
+ close(fd);
return (error);
}
if (pinfo.prog_info.active & MFI_PD_PROGRESS_REBUILD) {
- printf("drive %u ", device_id);
+ printf("drive %s ", mfi_drive_name(NULL, device_id,
+ MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS));
mfi_display_progress("Rebuild", &pinfo.prog_info.rbld);
busy = 1;
}
if (pinfo.prog_info.active & MFI_PD_PROGRESS_PATROL) {
- printf("drive %u ", device_id);
+ printf("drive %s ", mfi_drive_name(NULL, device_id,
+ MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS));
mfi_display_progress("Patrol Read",
&pinfo.prog_info.patrol);
busy = 1;
}
if (pinfo.prog_info.active & MFI_PD_PROGRESS_CLEAR) {
- printf("drive %u ", device_id);
+ printf("drive %s ", mfi_drive_name(NULL, device_id,
+ MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS));
mfi_display_progress("Clear", &pinfo.prog_info.clear);
busy = 1;
}
}
+ free(plist);
close(fd);
if (!busy)
diff --git a/usr.sbin/mfiutil/mfi_volume.c b/usr.sbin/mfiutil/mfi_volume.c
index 1e679c4..0d9300a 100644
--- a/usr.sbin/mfiutil/mfi_volume.c
+++ b/usr.sbin/mfiutil/mfi_volume.c
@@ -174,12 +174,14 @@ volume_cache(int ac, char **av)
if (mfi_lookup_volume(fd, av[1], &target_id) < 0) {
error = errno;
warn("Invalid volume: %s", av[1]);
+ close(fd);
return (error);
}
if (mfi_ld_get_props(fd, target_id, &props) < 0) {
error = errno;
warn("Failed to fetch volume properties");
+ close(fd);
return (error);
}
@@ -264,6 +266,7 @@ volume_cache(int ac, char **av)
else if (strcmp(av[2], "read-ahead") == 0) {
if (ac < 4) {
warnx("cache: read-ahead setting required");
+ close(fd);
return (EINVAL);
}
if (strcmp(av[3], "none") == 0)
@@ -275,6 +278,7 @@ volume_cache(int ac, char **av)
MR_LD_CACHE_READ_ADAPTIVE;
else {
warnx("cache: invalid read-ahead setting");
+ close(fd);
return (EINVAL);
}
error = update_cache_policy(fd, &props, policy,
@@ -283,6 +287,7 @@ volume_cache(int ac, char **av)
} else if (strcmp(av[2], "bad-bbu-write-cache") == 0) {
if (ac < 4) {
warnx("cache: bad BBU setting required");
+ close(fd);
return (EINVAL);
}
if (strcmp(av[3], "enable") == 0)
@@ -291,6 +296,7 @@ volume_cache(int ac, char **av)
policy = 0;
else {
warnx("cache: invalid bad BBU setting");
+ close(fd);
return (EINVAL);
}
error = update_cache_policy(fd, &props, policy,
@@ -298,6 +304,7 @@ volume_cache(int ac, char **av)
} else if (strcmp(av[2], "write-cache") == 0) {
if (ac < 4) {
warnx("cache: write-cache setting required");
+ close(fd);
return (EINVAL);
}
if (strcmp(av[3], "enable") == 0)
@@ -308,6 +315,7 @@ volume_cache(int ac, char **av)
policy = MR_PD_CACHE_UNCHANGED;
else {
warnx("cache: invalid write-cache setting");
+ close(fd);
return (EINVAL);
}
error = 0;
@@ -331,6 +339,7 @@ volume_cache(int ac, char **av)
}
} else {
warnx("cache: Invalid command");
+ close(fd);
return (EINVAL);
}
}
@@ -367,12 +376,14 @@ volume_name(int ac, char **av)
if (mfi_lookup_volume(fd, av[1], &target_id) < 0) {
error = errno;
warn("Invalid volume: %s", av[1]);
+ close(fd);
return (error);
}
if (mfi_ld_get_props(fd, target_id, &props) < 0) {
error = errno;
warn("Failed to fetch volume properties");
+ close(fd);
return (error);
}
@@ -383,6 +394,7 @@ volume_name(int ac, char **av)
if (mfi_ld_set_props(fd, &props) < 0) {
error = errno;
warn("Failed to set volume properties");
+ close(fd);
return (error);
}
@@ -415,6 +427,7 @@ volume_progress(int ac, char **av)
if (mfi_lookup_volume(fd, av[1], &target_id) < 0) {
error = errno;
warn("Invalid volume: %s", av[1]);
+ close(fd);
return (error);
}
@@ -423,6 +436,7 @@ volume_progress(int ac, char **av)
error = errno;
warn("Failed to fetch info for volume %s",
mfi_volume_name(fd, target_id));
+ close(fd);
return (error);
}
diff --git a/usr.sbin/mfiutil/mfiutil.8 b/usr.sbin/mfiutil/mfiutil.8
index d5178a0..dcd17f5 100644
--- a/usr.sbin/mfiutil/mfiutil.8
+++ b/usr.sbin/mfiutil/mfiutil.8
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 29, 2011
+.Dd June 20, 2011
.Dt MFIUTIL 8
.Os
.Sh NAME
@@ -43,6 +43,8 @@
.Op Fl u Ar unit
.Cm show battery
.Nm
+.Op Fl d
+.Op Fl e
.Op Fl u Ar unit
.Cm show config
.Nm
@@ -63,9 +65,13 @@
.Op Fl u Ar unit
.Cm show logstate
.Nm
+.Op Fl d
+.Op Fl e
.Op Fl u Ar unit
.Cm show patrol
.Nm
+.Op Fl d
+.Op Fl e
.Op Fl u Ar unit
.Cm show progress
.Nm
@@ -155,15 +161,19 @@ If no unit is specified,
then unit 0 is used.
.El
.Pp
-Volumes may be specified in two forms.
-First,
-a volume may be identified by its target ID.
-Second,
-on the volume may be specified by the corresponding
-.Em mfidX
-device,
-such as
-.Em mfid0 .
+Various commands accept either or both of the two options:
+.Bl -tag -width indent
+.It Fl d
+Print numeric device IDs as drive identifier.
+This is the default.
+Useful in combination with
+.Fl e
+to print both, numeric device IDs and enclosure:slot information.
+.It Fl e
+Print drive identifiers in enclosure:slot form.
+See next paragraph on format details in context of input rather than
+output.
+.El
.Pp
Drives may be specified in two forms.
First,
@@ -184,6 +194,16 @@ and
is the slot for each drive as displayed in
.Cm show drives .
.Pp
+Volumes may be specified in two forms.
+First,
+a volume may be identified by its target ID.
+Second,
+on the volume may be specified by the corresponding
+.Em mfidX
+device,
+such as
+.Em mfid0 .
+.Pp
The
.Nm
utility supports several different groups of commands.
diff --git a/usr.sbin/mfiutil/mfiutil.c b/usr.sbin/mfiutil/mfiutil.c
index 1bce79e..43bb6bb 100644
--- a/usr.sbin/mfiutil/mfiutil.c
+++ b/usr.sbin/mfiutil/mfiutil.c
@@ -45,11 +45,13 @@ MFI_TABLE(top, abort);
int mfi_unit;
+u_int mfi_opts;
+
static void
usage(void)
{
- fprintf(stderr, "usage: mfiutil [-u unit] <command> ...\n\n");
+ fprintf(stderr, "usage: mfiutil [-de] [-u unit] <command> ...\n\n");
fprintf(stderr, "Commands include:\n");
fprintf(stderr, " version\n");
fprintf(stderr, " show adapter - display controller information\n");
@@ -58,6 +60,7 @@ usage(void)
fprintf(stderr, " show drives - list physical drives\n");
fprintf(stderr, " show events - display event log\n");
fprintf(stderr, " show firmware - list firmware images\n");
+ fprintf(stderr, " show logstate - display event log sequence numbers\n");
fprintf(stderr, " show volumes - list logical volumes\n");
fprintf(stderr, " show patrol - display patrol read status\n");
fprintf(stderr, " show progress - display status of active operations\n");
@@ -107,8 +110,14 @@ main(int ac, char **av)
struct mfiutil_command **cmd;
int ch;
- while ((ch = getopt(ac, av, "u:")) != -1) {
+ while ((ch = getopt(ac, av, "deu:")) != -1) {
switch (ch) {
+ case 'd':
+ mfi_opts |= MFI_DNAME_DEVICE_ID;
+ break;
+ case 'e':
+ mfi_opts |= MFI_DNAME_ES;
+ break;
case 'u':
mfi_unit = atoi(optarg);
break;
diff --git a/usr.sbin/mfiutil/mfiutil.h b/usr.sbin/mfiutil/mfiutil.h
index b080b50..232831e 100644
--- a/usr.sbin/mfiutil/mfiutil.h
+++ b/usr.sbin/mfiutil/mfiutil.h
@@ -115,7 +115,13 @@ struct mfiutil_command {
} \
MFI_COMMAND(set, name, mfiutil_ ## name ## _table_handler)
+/* Drive name printing options */
+#define MFI_DNAME_ES 0x0001 /* E%u:S%u */
+#define MFI_DNAME_DEVICE_ID 0x0002 /* %u */
+#define MFI_DNAME_HONOR_OPTS 0x8000 /* Allow cmd line to override default */
+
extern int mfi_unit;
+extern u_int mfi_opts;
void mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref);
void mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref);
@@ -143,5 +149,7 @@ int mfi_pd_get_info(int fd, uint16_t device_id, struct mfi_pd_info *info,
int mfi_pd_get_list(int fd, struct mfi_pd_list **listp, uint8_t *statusp);
int mfi_reconfig_supported(void);
const char *mfi_status(u_int status_code);
+const char *mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id,
+ uint32_t def);
#endif /* !__MFIUTIL_H__ */
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 65bf44f..01a27eb 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -158,6 +158,8 @@ struct fhreturn {
int *fhr_secflavors;
};
+#define GETPORT_MAXTRY 20 /* Max tries to get a port # */
+
/* Global defs */
char *add_expdir(struct dirlist **, char *, int);
void add_dlist(struct dirlist **, struct dirlist *,
@@ -167,7 +169,9 @@ int check_dirpath(char *);
int check_options(struct dirlist *);
int checkmask(struct sockaddr *sa);
int chk_host(struct dirlist *, struct sockaddr *, int *, int *);
-void create_service(struct netconfig *nconf);
+static int create_service(struct netconfig *nconf);
+static void complete_service(struct netconfig *nconf, char *port_str);
+static void clearout_service(void);
void del_mlist(char *hostp, char *dirp);
struct dirlist *dirp_search(struct dirlist *, char *);
int do_mount(struct exportlist *, struct grouplist *, int,
@@ -233,6 +237,10 @@ int got_sighup = 0;
int xcreated = 0;
char *svcport_str = NULL;
+static int mallocd_svcport = 0;
+static int *sock_fd;
+static int sock_fdcnt;
+static int sock_fdpos;
int opt_flags;
static int have_v6 = 1;
@@ -281,6 +289,8 @@ main(int argc, char **argv)
in_port_t svcport;
int c, k, s;
int maxrec = RPC_MAXDATASIZE;
+ int attempt_cnt, port_len, port_pos, ret;
+ char **port_list;
/* Check that another mountd isn't already running. */
pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &otherpid);
@@ -451,17 +461,97 @@ main(int argc, char **argv)
hosts[nhosts - 1] = "127.0.0.1";
}
+ attempt_cnt = 1;
+ sock_fdcnt = 0;
+ sock_fd = NULL;
+ port_list = NULL;
+ port_len = 0;
nc_handle = setnetconfig();
while ((nconf = getnetconfig(nc_handle))) {
if (nconf->nc_flag & NC_VISIBLE) {
if (have_v6 == 0 && strcmp(nconf->nc_protofmly,
"inet6") == 0) {
/* DO NOTHING */
+ } else {
+ ret = create_service(nconf);
+ if (ret == 1)
+ /* Ignore this call */
+ continue;
+ if (ret < 0) {
+ /*
+ * Failed to bind port, so close off
+ * all sockets created and try again
+ * if the port# was dynamically
+ * assigned via bind(2).
+ */
+ clearout_service();
+ if (mallocd_svcport != 0 &&
+ attempt_cnt < GETPORT_MAXTRY) {
+ free(svcport_str);
+ svcport_str = NULL;
+ mallocd_svcport = 0;
+ } else {
+ errno = EADDRINUSE;
+ syslog(LOG_ERR,
+ "bindresvport_sa: %m");
+ exit(1);
+ }
+
+ /* Start over at the first service. */
+ free(sock_fd);
+ sock_fdcnt = 0;
+ sock_fd = NULL;
+ nc_handle = setnetconfig();
+ attempt_cnt++;
+ } else if (mallocd_svcport != 0 &&
+ attempt_cnt == GETPORT_MAXTRY) {
+ /*
+ * For the last attempt, allow
+ * different port #s for each nconf
+ * by saving the svcport_str and
+ * setting it back to NULL.
+ */
+ port_list = realloc(port_list,
+ (port_len + 1) * sizeof(char *));
+ if (port_list == NULL)
+ out_of_mem();
+ port_list[port_len++] = svcport_str;
+ svcport_str = NULL;
+ mallocd_svcport = 0;
+ }
+ }
+ }
+ }
+
+ /*
+ * Successfully bound the ports, so call complete_service() to
+ * do the rest of the setup on the service(s).
+ */
+ sock_fdpos = 0;
+ port_pos = 0;
+ nc_handle = setnetconfig();
+ while ((nconf = getnetconfig(nc_handle))) {
+ if (nconf->nc_flag & NC_VISIBLE) {
+ if (have_v6 == 0 && strcmp(nconf->nc_protofmly,
+ "inet6") == 0) {
+ /* DO NOTHING */
+ } else if (port_list != NULL) {
+ if (port_pos >= port_len) {
+ syslog(LOG_ERR, "too many port#s");
+ exit(1);
+ }
+ complete_service(nconf, port_list[port_pos++]);
} else
- create_service(nconf);
+ complete_service(nconf, svcport_str);
}
}
endnetconfig(nc_handle);
+ free(sock_fd);
+ if (port_list != NULL) {
+ for (port_pos = 0; port_pos < port_len; port_pos++)
+ free(port_list[port_pos]);
+ free(port_list);
+ }
if (xcreated == 0) {
syslog(LOG_ERR, "could not create any services");
@@ -491,30 +581,31 @@ main(int argc, char **argv)
/*
* This routine creates and binds sockets on the appropriate
- * addresses. It gets called one time for each transport and
- * registrates the service with rpcbind on that trasport.
+ * addresses. It gets called one time for each transport.
+ * It returns 0 upon success, 1 for ingore the call and -1 to indicate
+ * bind failed with EADDRINUSE.
+ * Any file descriptors that have been created are stored in sock_fd and
+ * the total count of them is maintained in sock_fdcnt.
*/
-void
+static int
create_service(struct netconfig *nconf)
{
struct addrinfo hints, *res = NULL;
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;
struct __rpc_sockinfo si;
- struct netbuf servaddr;
- SVCXPRT *transp = NULL;
int aicode;
int fd;
int nhostsbak;
int one = 1;
int r;
- int registered = 0;
u_int32_t host_addr[4]; /* IPv4 or IPv6 */
+ int mallocd_res;
if ((nconf->nc_semantics != NC_TPI_CLTS) &&
(nconf->nc_semantics != NC_TPI_COTS) &&
(nconf->nc_semantics != NC_TPI_COTS_ORD))
- return; /* not my type */
+ return (1); /* not my type */
/*
* XXX - using RPC library internal functions.
@@ -522,7 +613,7 @@ create_service(struct netconfig *nconf)
if (!__rpc_nconf2sockinfo(nconf, &si)) {
syslog(LOG_ERR, "cannot get information for %s",
nconf->nc_netid);
- return;
+ return (1);
}
/* Get mountd's address on this transport */
@@ -538,6 +629,12 @@ create_service(struct netconfig *nconf)
nhostsbak = nhosts;
while (nhostsbak > 0) {
--nhostsbak;
+ sock_fd = realloc(sock_fd, (sock_fdcnt + 1) * sizeof(int));
+ if (sock_fd == NULL)
+ out_of_mem();
+ sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */
+ mallocd_res = 0;
+
/*
* XXX - using RPC library internal functions.
*/
@@ -549,14 +646,16 @@ create_service(struct netconfig *nconf)
syslog(non_fatal ? LOG_DEBUG : LOG_ERR,
"cannot create socket for %s", nconf->nc_netid);
- return;
+ if (non_fatal != 0)
+ continue;
+ exit(1);
}
switch (hints.ai_family) {
case AF_INET:
if (inet_pton(AF_INET, hosts[nhostsbak],
host_addr) == 1) {
- hints.ai_flags &= AI_NUMERICHOST;
+ hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET6 address.
@@ -571,7 +670,7 @@ create_service(struct netconfig *nconf)
case AF_INET6:
if (inet_pton(AF_INET6, hosts[nhostsbak],
host_addr) == 1) {
- hints.ai_flags &= AI_NUMERICHOST;
+ hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET address.
@@ -607,6 +706,7 @@ create_service(struct netconfig *nconf)
res = malloc(sizeof(struct addrinfo));
if (res == NULL)
out_of_mem();
+ mallocd_res = 1;
res->ai_flags = hints.ai_flags;
res->ai_family = hints.ai_family;
res->ai_protocol = hints.ai_protocol;
@@ -620,7 +720,7 @@ create_service(struct netconfig *nconf)
sin->sin_addr.s_addr = htonl(INADDR_ANY);
res->ai_addr = (struct sockaddr*) sin;
res->ai_addrlen = (socklen_t)
- sizeof(res->ai_addr);
+ sizeof(struct sockaddr_in);
break;
case AF_INET6:
sin6 = malloc(sizeof(struct sockaddr_in6));
@@ -631,10 +731,12 @@ create_service(struct netconfig *nconf)
sin6->sin6_addr = in6addr_any;
res->ai_addr = (struct sockaddr*) sin6;
res->ai_addrlen = (socklen_t)
- sizeof(res->ai_addr);
- break;
- default:
+ sizeof(struct sockaddr_in6);
break;
+ default:
+ syslog(LOG_ERR, "bad addr fam %d",
+ res->ai_family);
+ exit(1);
}
} else {
if ((aicode = getaddrinfo(NULL, svcport_str,
@@ -643,6 +745,7 @@ create_service(struct netconfig *nconf)
"cannot get local address for %s: %s",
nconf->nc_netid,
gai_strerror(aicode));
+ close(fd);
continue;
}
}
@@ -652,16 +755,91 @@ create_service(struct netconfig *nconf)
syslog(LOG_ERR,
"cannot get local address for %s: %s",
nconf->nc_netid, gai_strerror(aicode));
+ close(fd);
continue;
}
}
+ /* Store the fd. */
+ sock_fd[sock_fdcnt - 1] = fd;
+
+ /* Now, attempt the bind. */
r = bindresvport_sa(fd, res->ai_addr);
if (r != 0) {
+ if (errno == EADDRINUSE && mallocd_svcport != 0) {
+ if (mallocd_res != 0) {
+ free(res->ai_addr);
+ free(res);
+ } else
+ freeaddrinfo(res);
+ return (-1);
+ }
syslog(LOG_ERR, "bindresvport_sa: %m");
exit(1);
}
+ if (svcport_str == NULL) {
+ svcport_str = malloc(NI_MAXSERV * sizeof(char));
+ if (svcport_str == NULL)
+ out_of_mem();
+ mallocd_svcport = 1;
+
+ if (getnameinfo(res->ai_addr,
+ res->ai_addr->sa_len, NULL, NI_MAXHOST,
+ svcport_str, NI_MAXSERV * sizeof(char),
+ NI_NUMERICHOST | NI_NUMERICSERV))
+ errx(1, "Cannot get port number");
+ }
+ if (mallocd_res != 0) {
+ free(res->ai_addr);
+ free(res);
+ } else
+ freeaddrinfo(res);
+ res = NULL;
+ }
+ return (0);
+}
+
+/*
+ * Called after all the create_service() calls have succeeded, to complete
+ * the setup and registration.
+ */
+static void
+complete_service(struct netconfig *nconf, char *port_str)
+{
+ struct addrinfo hints, *res = NULL;
+ struct __rpc_sockinfo si;
+ struct netbuf servaddr;
+ SVCXPRT *transp = NULL;
+ int aicode, fd, nhostsbak;
+ int registered = 0;
+
+ if ((nconf->nc_semantics != NC_TPI_CLTS) &&
+ (nconf->nc_semantics != NC_TPI_COTS) &&
+ (nconf->nc_semantics != NC_TPI_COTS_ORD))
+ return; /* not my type */
+
+ /*
+ * XXX - using RPC library internal functions.
+ */
+ if (!__rpc_nconf2sockinfo(nconf, &si)) {
+ syslog(LOG_ERR, "cannot get information for %s",
+ nconf->nc_netid);
+ return;
+ }
+
+ nhostsbak = nhosts;
+ while (nhostsbak > 0) {
+ --nhostsbak;
+ if (sock_fdpos >= sock_fdcnt) {
+ /* Should never happen. */
+ syslog(LOG_ERR, "Ran out of socket fd's");
+ return;
+ }
+ fd = sock_fd[sock_fdpos++];
+ if (fd < 0)
+ continue;
+
if (nconf->nc_semantics != NC_TPI_CLTS)
listen(fd, SOMAXCONN);
@@ -696,19 +874,7 @@ create_service(struct netconfig *nconf)
hints.ai_socktype = si.si_socktype;
hints.ai_protocol = si.si_proto;
- if (svcport_str == NULL) {
- svcport_str = malloc(NI_MAXSERV * sizeof(char));
- if (svcport_str == NULL)
- out_of_mem();
-
- if (getnameinfo(res->ai_addr,
- res->ai_addr->sa_len, NULL, NI_MAXHOST,
- svcport_str, NI_MAXSERV * sizeof(char),
- NI_NUMERICHOST | NI_NUMERICSERV))
- errx(1, "Cannot get port number");
- }
-
- if((aicode = getaddrinfo(NULL, svcport_str, &hints,
+ if ((aicode = getaddrinfo(NULL, port_str, &hints,
&res)) != 0) {
syslog(LOG_ERR, "cannot get local address: %s",
gai_strerror(aicode));
@@ -728,6 +894,23 @@ create_service(struct netconfig *nconf)
} /* end while */
}
+/*
+ * Clear out sockets after a failure to bind one of them, so that the
+ * cycle of socket creation/binding can start anew.
+ */
+static void
+clearout_service(void)
+{
+ int i;
+
+ for (i = 0; i < sock_fdcnt; i++) {
+ if (sock_fd[i] >= 0) {
+ shutdown(sock_fd[i], SHUT_RDWR);
+ close(sock_fd[i]);
+ }
+ }
+}
+
static void
usage(void)
{
diff --git a/usr.sbin/pc-sysinstall/backend-query/enable-net.sh b/usr.sbin/pc-sysinstall/backend-query/enable-net.sh
index 3c73550..8cd72a1 100755
--- a/usr.sbin/pc-sysinstall/backend-query/enable-net.sh
+++ b/usr.sbin/pc-sysinstall/backend-query/enable-net.sh
@@ -1,6 +1,11 @@
#!/bin/sh
#-
# Copyright (c) 2010 iXsystems, Inc. All rights reserved.
+# Copyright (c) 2011 The FreeBSD Foundation
+# All rights reserved.
+#
+# Portions of this software were developed by Bjoern Zeeb
+# under sponsorship from the FreeBSD Foundation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -40,23 +45,67 @@ NETMASK="$3"
DNS="$4"
GATEWAY="$5"
MIRRORFETCH="$6"
+IPV6="$7"
+IPV6GATE="$8"
+IPV6DNS="$9"
if [ -z "${NIC}" ]
then
- echo "ERROR: Usage enable-net <nic> <ip> <netmask> <dns> <gateway>"
+ echo "ERROR: Usage enable-net <nic> <ip> <netmask> <dns> <gateway> <ipv6> " \
+ "<ipv6gateway> <ipv6dns>"
exit 150
fi
if [ "$NIC" = "AUTO-DHCP" ]
then
enable_auto_dhcp
+elif [ "$NIC" = "IPv6-SLAAC" ]
+then
+ enable_auto_slaac
+ # In addition, if static values were defined, add them as well.
+ # We might not get DNS information from RAs, for example.
+ if [ -n "${IPV6}" ]; then
+ VAL=""
+ get_first_wired_nic
+ if [ -n "${VAL}" ]; then
+ ifconfig ${VAL} inet6 ${IPV6} alias
+ fi
+ fi
+ # Append only here.
+ if [ -n "${IPV6DNS}" ]; then
+ echo "nameserver ${IPV6DNS}" >>/etc/resolv.conf
+ fi
+ # Do not
+ if [ -n "${IPV6GATE}" ]; then
+ # Check if we have a default route already to not overwrite.
+ if ! route -n get -inet6 default > /dev/null 2>&1 ; then
+ route add -inet6 default ${IPV6GATE}
+ fi
+ fi
else
echo "Enabling NIC: $NIC"
- ifconfig ${NIC} ${IP} ${NETMASK}
+ if [ -n "${IP}" ]; then
+ ifconfig ${NIC} inet ${IP} ${NETMASK}
+ fi
+ if [ -n "${IPV6}" ]; then
+ ifconfig ${NIC} inet6 ${IPV6} alias
+ fi
- echo "nameserver ${DNS}" >/etc/resolv.conf
+ # Keep default from IPv4-only support times and clear the resolv.conf file.
+ : > /etc/resolv.conf
+ if [ -n "${DNS}" ]; then
+ echo "nameserver ${DNS}" >>/etc/resolv.conf
+ fi
+ if [ -n "${IPV6DNS}" ]; then
+ echo "nameserver ${IPV6DNS}" >>/etc/resolv.conf
+ fi
- route add default ${GATE}
+ if [ -n "${GATE}" ]; then
+ route add -inet default ${GATE}
+ fi
+ if [ -n "${IPV6GATE}" ]; then
+ route add -inet6 default ${IPV6GATE}
+ fi
fi
case ${MIRRORFETCH} in
diff --git a/usr.sbin/pc-sysinstall/backend-query/test-netup.sh b/usr.sbin/pc-sysinstall/backend-query/test-netup.sh
index 4c8304e..e0a3eba 100755
--- a/usr.sbin/pc-sysinstall/backend-query/test-netup.sh
+++ b/usr.sbin/pc-sysinstall/backend-query/test-netup.sh
@@ -1,6 +1,11 @@
#!/bin/sh
#-
# Copyright (c) 2010 iXsystems, Inc. All rights reserved.
+# Copyright (c) 2011 The FreeBSD Foundation
+# All rights reserved.
+#
+# Portions of this software were developed by Bjoern Zeeb
+# under sponsorship from the FreeBSD Foundation.#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -26,8 +31,8 @@
# $FreeBSD$
-# Script which tests "fetch" when using a network connection, and saves
-# if we are using direct connect, or need FTP passive mode
+# Script which tries to ping "home" to see if Internet connectivity is
+# available.
#############################################################################
rm ${TMPDIR}/.testftp >/dev/null 2>/dev/null
@@ -39,12 +44,26 @@ then
exit 0
fi
+ping6 -c 2 www.pcbsd.org >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+ echo "ftp: Up"
+ exit 0
+fi
+
ping -c 2 www.freebsd.org >/dev/null 2>/dev/null
if [ "$?" = "0" ]
then
echo "ftp: Up"
exit 0
fi
-
+
+ping6 -c 2 www.freebsd.org >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+ echo "ftp: Up"
+ exit 0
+fi
+
echo "ftp: Down"
exit 1
diff --git a/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh b/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
index 97386f8..d69135a 100755
--- a/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
+++ b/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
@@ -219,9 +219,9 @@ setup_fstab()
# Echo out the fstab entry now
if [ "${PARTFS}" = "SWAP" ]
then
- echo "/dev/${DEVICE} none swap ${MNTOPTS} 0 0" >> ${FSTAB}
+ echo "/dev/${DEVICE} none swap ${MNTOPTS} 0 0" >> ${FSTAB}
else
- echo "/dev/${DEVICE} ${PARTMNT} ufs ${MNTOPTS} 1 1" >> ${FSTAB}
+ echo "/dev/${DEVICE} ${PARTMNT} ufs ${MNTOPTS} 1 1" >> ${FSTAB}
fi
fi # End of ZFS Check
diff --git a/usr.sbin/pc-sysinstall/backend/functions-networking.sh b/usr.sbin/pc-sysinstall/backend/functions-networking.sh
index d12a9cc..bdd5a1a 100755
--- a/usr.sbin/pc-sysinstall/backend/functions-networking.sh
+++ b/usr.sbin/pc-sysinstall/backend/functions-networking.sh
@@ -1,6 +1,11 @@
#!/bin/sh
#-
# Copyright (c) 2010 iXsystems, Inc. All rights reserved.
+# Copyright (c) 2011 The FreeBSD Foundation
+# All rights reserved.
+#
+# Portions of this software were developed by Bjoern Zeeb
+# under sponsorship from the FreeBSD Foundation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -119,6 +124,61 @@ save_auto_dhcp()
enable_dhcp_all
};
+# Function which simply enables iPv6 SLAAC on all detected nics
+enable_slaac_all()
+{
+ rm ${TMPDIR}/.niclist >/dev/null 2>/dev/null
+ # start by getting a list of nics on this system
+ ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist
+ if [ -e "${TMPDIR}/.niclist" ]
+ then
+ echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf
+ WLANCOUNT="0"
+ while read line
+ do
+ NIC="`echo $line | cut -d ':' -f 1`"
+ DESC="`echo $line | cut -d ':' -f 2`"
+ echo_log "Setting $NIC to acceptign RAs on the system."
+ check_is_wifi ${NIC}
+ if [ $? -eq 0 ]
+ then
+ # We have a wifi device, setup a wlan* entry for it
+ # Given we cannot have DHCP and SLAAC the same time currently
+ # it's save to just duplicate.
+ WLAN="wlan${WLANCOUNT}"
+ echo "wlans_${NIC}=\"${WLAN}\"" >>${FSMNT}/etc/rc.conf
+ #echo "ifconfig_${NIC}=\"up\"" >>${FSMNT}/etc/rc.conf
+ echo "ifconfig_${WLAN}=\"inet6 accept_rtadv\"" >>${FSMNT}/etc/rc.conf
+ CNIC="${WLAN}"
+ WLANCOUNT=$((WLANCOUNT+1))
+ else
+ #echo "ifconfig_${NIC}=\"up\"" >>${FSMNT}/etc/rc.conf
+ echo "ifconfig_${NIC}_ipv6=\"inet6 accept_rtadv\"" >>${FSMNT}/etc/rc.conf
+ CNIC="${NIC}"
+ fi
+
+ done < ${TMPDIR}/.niclist
+ fi
+
+ # Given we cannot yet rely on RAs to provide DNS information as much
+ # as we can in the DHCP world, we should append a given nameserver.
+ : > ${FSMNT}/etc/resolv.conf
+ get_value_from_cfg netSaveIPv6NameServer
+ NAMESERVER="${VAL}"
+ if [ -n "${NAMESERVER}" ]
+ then
+ echo "nameserver ${NAMESERVER}" >>${FSMNT}/etc/resolv.conf
+ fi
+
+};
+
+
+# Function which detects available nics, and enables IPv6 SLAAC on them
+save_auto_slaac()
+{
+ enable_slaac_all
+};
+
# Function which saves a manual nic setup to the installed system
save_manual_nic()
@@ -137,21 +197,41 @@ save_manual_nic()
fi
# If we get here, we have a manual setup, lets do so now
+ IFARGS=""
+ IF6ARGS=""
# Set the manual IP
- IFARGS="inet ${NETIP}"
-
- # Check if we have a netmask to set
- get_value_from_cfg netSaveMask
- NETMASK="${VAL}"
- if [ -n "${NETMASK}" ]
+ if [ -n "${NETIP}" ]
then
- IFARGS="${IFARGS} netmask ${NETMASK}"
+ IFARGS="inet ${NETIP}"
+
+ # Check if we have a netmask to set
+ get_value_from_cfg netSaveMask
+ NETMASK="${VAL}"
+ if [ -n "${NETMASK}" ]
+ then
+ IFARGS="${IFARGS} netmask ${NETMASK}"
+ fi
fi
+ get_value_from_cfg netSaveIPv6
+ NETIP6="${VAL}"
+ if [ -n "${NETIP6}" ]
+ then
+ # Make sure we have one inet6 prefix.
+ IF6ARGS=`echo "${NETIP6}" | awk '{ if ("^inet6 ") { print $0; } else
+ { printf "inet6 %s", $0; } }'`
+ fi
echo "# Auto-Enabled NICs from pc-sysinstall" >>${FSMNT}/etc/rc.conf
- echo "ifconfig_${NIC}=\"${IFARGS}\"" >>${FSMNT}/etc/rc.conf
+ if [ -n "${IFARGS}" ]
+ then
+ echo "ifconfig_${NIC}=\"${IFARGS}\"" >>${FSMNT}/etc/rc.conf
+ fi
+ if [ -n "${IF6ARGS}" ]
+ then
+ echo "ifconfig_${NIC}_ipv6=\"${IF6ARGS}\"" >>${FSMNT}/etc/rc.conf
+ fi
# Check if we have a default router to set
get_value_from_cfg netSaveDefaultRouter
@@ -160,15 +240,28 @@ save_manual_nic()
then
echo "defaultrouter=\"${NETROUTE}\"" >>${FSMNT}/etc/rc.conf
fi
+ get_value_from_cfg netSaveIPv6DefaultRouter
+ NETROUTE="${VAL}"
+ if [ -n "${NETROUTE}" ]
+ then
+ echo "ipv6_defaultrouter=\"${NETROUTE}\"" >>${FSMNT}/etc/rc.conf
+ fi
# Check if we have a nameserver to enable
+ : > ${FSMNT}/etc/resolv.conf
get_value_from_cfg netSaveNameServer
NAMESERVER="${VAL}"
if [ -n "${NAMESERVER}" ]
then
- echo "nameserver ${NAMESERVER}" >${FSMNT}/etc/resolv.conf
+ echo "nameserver ${NAMESERVER}" >>${FSMNT}/etc/resolv.conf
fi
-
+ get_value_from_cfg netSaveIPv6NameServer
+ NAMESERVER="${VAL}"
+ if [ -n "${NAMESERVER}" ]
+ then
+ echo "nameserver ${NAMESERVER}" >>${FSMNT}/etc/resolv.conf
+ fi
+
};
# Function which determines if a nic is active / up
@@ -208,6 +301,31 @@ enable_auto_dhcp()
};
+# Function which detects available nics, and runs rtsol on them.
+enable_auto_slaac()
+{
+
+ # start by getting a list of nics on this system
+ ${QUERYDIR}/detect-nics.sh > ${TMPDIR}/.niclist
+ ALLNICS=""
+ while read line
+ do
+ NIC="`echo $line | cut -d ':' -f 1`"
+ DESC="`echo $line | cut -d ':' -f 2`"
+
+ is_nic_active "${NIC}"
+ if [ $? -eq 0 ] ; then
+ echo_log "Will try IPv6 SLAAC on $NIC $DESC"
+ ifconfig ${NIC} inet6 -ifdisabled accept_rtadv up
+ ALLNICS="${ALLNICS} ${NIC}"
+ fi
+ done < ${TMPDIR}/.niclist
+
+ # XXX once we support it in-tree call /sbin/resovconf here.
+ echo_log "Running rtsol on ${ALLNICS}"
+ rtsol -F ${ALLNICS} >/dev/null 2>/dev/null
+}
+
# Get the mac address of a target NIC
get_nic_mac()
{
@@ -236,15 +354,20 @@ enable_manual_nic()
# If we get here, we have a manual setup, lets do so now
- # Set the manual IP
- rc_halt "ifconfig ${NIC} ${NETIP}"
+ # IPv4:
- # Check if we have a netmask to set
- get_value_from_cfg netMask
- NETMASK="${VAL}"
- if [ -n "${NETMASK}" ]
+ # Set the manual IP
+ if [ -n "${NETIP}" ]
then
- rc_halt "ifconfig ${NIC} netmask ${NETMASK}"
+ # Check if we have a netmask to set
+ get_value_from_cfg netMask
+ NETMASK="${VAL}"
+ if [ -n "${NETMASK}" ]
+ then
+ rc_halt "ifconfig inet ${NIC} netmask ${NETMASK}"
+ else
+ rc_halt "ifconfig inet ${NIC} ${NETIP}"
+ fi
fi
# Check if we have a default router to set
@@ -252,18 +375,42 @@ enable_manual_nic()
NETROUTE="${VAL}"
if [ -n "${NETROUTE}" ]
then
- rc_halt "route add default ${NETROUTE}"
+ rc_halt "route add -inet default ${NETROUTE}"
+ fi
+
+ # IPv6:
+
+ # Set static IPv6 address
+ get_value_from_cfg netIPv6
+ NETIP="${VAL}"
+ if [ -n ${NETIP} ]
+ then
+ rc_halt "ifconfig inet6 ${NIC} ${NETIP} -ifdisabled up"
+ fi
+
+ # Default router
+ get_value_from_cfg netIPv6DefaultRouter
+ NETROUTE="${VAL}"
+ if [ -n "${NETROUTE}" ]
+ then
+ rc_halt "route add -inet6 default ${NETROUTE}"
fi
# Check if we have a nameserver to enable
+ : >/etc/resolv.conf
get_value_from_cfg netNameServer
NAMESERVER="${VAL}"
if [ -n "${NAMESERVER}" ]
then
- echo "nameserver ${NAMESERVER}" >/etc/resolv.conf
+ echo "nameserver ${NAMESERVER}" >>/etc/resolv.conf
fi
-
-
+ get_value_from_cfg netIPv6NameServer
+ NAMESERVER="${VAL}"
+ if [ -n "${NAMESERVER}" ]
+ then
+ echo "nameserver ${NAMESERVER}" >>/etc/resolv.conf
+ fi
+
};
@@ -281,6 +428,9 @@ start_networking()
if [ "$NETDEV" = "AUTO-DHCP" ]
then
enable_auto_dhcp
+ elif [ "$NETDEV" = "IPv6-SLAAC" ]
+ then
+ enable_auto_slaac
else
enable_manual_nic ${NETDEV}
fi
@@ -304,6 +454,9 @@ save_networking_install()
if [ "$NETDEV" = "AUTO-DHCP" ]
then
save_auto_dhcp
+ elif [ "$NETDEV" = "IPv6-SLAAC" ]
+ then
+ save_auto_slaac
else
save_manual_nic ${NETDEV}
fi
diff --git a/usr.sbin/pmccontrol/pmccontrol.c b/usr.sbin/pmccontrol/pmccontrol.c
index cce1e0e..80d4bd7 100644
--- a/usr.sbin/pmccontrol/pmccontrol.c
+++ b/usr.sbin/pmccontrol/pmccontrol.c
@@ -28,8 +28,9 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/queue.h>
+#include <sys/cpuset.h>
#include <sys/sysctl.h>
#include <assert.h>
@@ -133,26 +134,32 @@ pmcc_init_debug(void)
static int
pmcc_do_enable_disable(struct pmcc_op_list *op_list)
{
+ long cpusetsize;
int c, error, i, j, ncpu, npmc, t;
- cpumask_t haltedcpus, cpumask;
+ cpuset_t haltedcpus, cpumask;
struct pmcc_op *np;
unsigned char *map;
unsigned char op;
int cpu, pmc;
- size_t dummy;
+ size_t setsize;
if ((ncpu = pmc_ncpu()) < 0)
err(EX_OSERR, "Unable to determine the number of cpus");
/* Determine the set of active CPUs. */
- cpumask = (1 << ncpu) - 1;
- dummy = sizeof(int);
- haltedcpus = (cpumask_t) 0;
+ cpusetsize = sysconf(_SC_CPUSET_SIZE);
+ if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) {
+ err(EX_OSERR, "ERROR: Cannot determine which CPUs are "
+ "halted");
+ }
+ CPU_ZERO(&haltedcpus);
+ setsize = (size_t)cpusetsize;
if (ncpu > 1 && sysctlbyname("machdep.hlt_cpus", &haltedcpus,
- &dummy, NULL, 0) < 0)
+ &setsize, NULL, 0) < 0)
err(EX_OSERR, "ERROR: Cannot determine which CPUs are "
"halted");
- cpumask &= ~haltedcpus;
+ CPU_FILL(&cpumask);
+ CPU_NAND(&cpumask, &haltedcpus);
/* Determine the maximum number of PMCs in any CPU. */
npmc = 0;
@@ -200,7 +207,7 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list)
if (cpu == PMCC_CPU_ALL)
for (i = 0; i < ncpu; i++) {
- if ((1 << i) & cpumask)
+ if (CPU_ISSET(i, &cpumask))
SET_PMCS(i, pmc, op);
}
else
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index db33746..b93ca66 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -163,7 +163,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
* If we'll need to use it or we're updating it,
* then create the base home directory if necessary
*/
- if (arg != NULL || getarg(args, 'm') != NULL) {
+ if ((arg != NULL || getarg(args, 'm') != NULL) && (getarg(args, 'd') == NULL)) {
int l = strlen(cnf->home);
if (l > 1 && cnf->home[l-1] == '/') /* Shave off any trailing path delimiter */
diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c
index fb9e536..b3402ff 100644
--- a/usr.sbin/rpc.lockd/lockd.c
+++ b/usr.sbin/rpc.lockd/lockd.c
@@ -74,6 +74,8 @@ __RCSID("$NetBSD: lockd.c,v 1.7 2000/08/12 18:08:44 thorpej Exp $");
#include "lockd.h"
#include <rpcsvc/nlm_prot.h>
+#define GETPORT_MAXTRY 20 /* Max tries to get a port # */
+
int debug_level = 0; /* 0 = no debugging syslog() calls */
int _rpcsvcdirty = 0;
@@ -84,13 +86,19 @@ int kernel_lockd_client;
pid_t client_pid;
struct mon mon_host;
char **hosts, *svcport_str = NULL;
+static int mallocd_svcport = 0;
+static int *sock_fd;
+static int sock_fdcnt;
+static int sock_fdpos;
int nhosts = 0;
int xcreated = 0;
char **addrs; /* actually (netid, uaddr) pairs */
int naddrs; /* count of how many (netid, uaddr) pairs */
char localhost[] = "localhost";
-void create_service(struct netconfig *nconf);
+static int create_service(struct netconfig *nconf);
+static void complete_service(struct netconfig *nconf, char *port_str);
+static void clearout_service(void);
void lookup_addresses(struct netconfig *nconf);
void init_nsm(void);
void nlm_prog_0(struct svc_req *, SVCXPRT *);
@@ -119,6 +127,8 @@ main(int argc, char **argv)
int have_v6 = 1;
int maxrec = RPC_MAXDATASIZE;
in_port_t svcport = 0;
+ int attempt_cnt, port_len, port_pos, ret;
+ char **port_list;
while ((ch = getopt(argc, argv, "d:g:h:p:")) != (-1)) {
switch (ch) {
@@ -309,6 +319,11 @@ main(int argc, char **argv)
}
endnetconfig(nc_handle);
} else {
+ attempt_cnt = 1;
+ sock_fdcnt = 0;
+ sock_fd = NULL;
+ port_list = NULL;
+ port_len = 0;
nc_handle = setnetconfig();
while ((nconf = getnetconfig(nc_handle))) {
/* We want to listen only on udp6, tcp6, udp, tcp transports */
@@ -317,11 +332,96 @@ main(int argc, char **argv)
if (have_v6 == 0 && strcmp(nconf->nc_protofmly, "inet6") == 0) {
/* DO NOTHING */
} else {
- create_service(nconf);
+ ret = create_service(nconf);
+ if (ret == 1)
+ /* Ignore this call */
+ continue;
+ if (ret < 0) {
+ /*
+ * Failed to bind port, so close
+ * off all sockets created and
+ * try again if the port# was
+ * dynamically assigned via
+ * bind(2).
+ */
+ clearout_service();
+ if (mallocd_svcport != 0 &&
+ attempt_cnt <
+ GETPORT_MAXTRY) {
+ free(svcport_str);
+ svcport_str = NULL;
+ mallocd_svcport = 0;
+ } else {
+ errno = EADDRINUSE;
+ syslog(LOG_ERR,
+ "bindresvport_sa: %m");
+ exit(1);
+ }
+
+ /*
+ * Start over at the first
+ * service.
+ */
+ free(sock_fd);
+ sock_fdcnt = 0;
+ sock_fd = NULL;
+ nc_handle = setnetconfig();
+ attempt_cnt++;
+ } else if (mallocd_svcport != 0 &&
+ attempt_cnt == GETPORT_MAXTRY) {
+ /*
+ * For the last attempt, allow
+ * different port #s for each
+ * nconf by saving the
+ * svcport_str and setting it
+ * back to NULL.
+ */
+ port_list = realloc(port_list,
+ (port_len + 1) *
+ sizeof(char *));
+ if (port_list == NULL)
+ out_of_mem();
+ port_list[port_len++] =
+ svcport_str;
+ svcport_str = NULL;
+ mallocd_svcport = 0;
+ }
}
}
}
+
+ /*
+ * Successfully bound the ports, so call complete_service() to
+ * do the rest of the setup on the service(s).
+ */
+ sock_fdpos = 0;
+ port_pos = 0;
+ nc_handle = setnetconfig();
+ while ((nconf = getnetconfig(nc_handle))) {
+ /* We want to listen only on udp6, tcp6, udp, tcp transports */
+ if (nconf->nc_flag & NC_VISIBLE) {
+ /* Skip if there's no IPv6 support */
+ if (have_v6 == 0 && strcmp(nconf->nc_protofmly, "inet6") == 0) {
+ /* DO NOTHING */
+ } else if (port_list != NULL) {
+ if (port_pos >= port_len) {
+ syslog(LOG_ERR,
+ "too many port#s");
+ exit(1);
+ }
+ complete_service(nconf,
+ port_list[port_pos++]);
+ } else
+ complete_service(nconf, svcport_str);
+ }
+ }
endnetconfig(nc_handle);
+ free(sock_fd);
+ if (port_list != NULL) {
+ for (port_pos = 0; port_pos < port_len; port_pos++)
+ free(port_list[port_pos]);
+ free(port_list);
+ }
}
/*
@@ -386,29 +486,30 @@ main(int argc, char **argv)
/*
* This routine creates and binds sockets on the appropriate
- * addresses. It gets called one time for each transport and
- * registrates the service with rpcbind on that trasport.
+ * addresses. It gets called one time for each transport.
+ * It returns 0 upon success, 1 for ingore the call and -1 to indicate
+ * bind failed with EADDRINUSE.
+ * Any file descriptors that have been created are stored in sock_fd and
+ * the total count of them is maintained in sock_fdcnt.
*/
-void
+static int
create_service(struct netconfig *nconf)
{
struct addrinfo hints, *res = NULL;
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;
struct __rpc_sockinfo si;
- struct netbuf servaddr;
- SVCXPRT *transp = NULL;
int aicode;
int fd;
int nhostsbak;
int r;
- int registered = 0;
u_int32_t host_addr[4]; /* IPv4 or IPv6 */
+ int mallocd_res;
if ((nconf->nc_semantics != NC_TPI_CLTS) &&
(nconf->nc_semantics != NC_TPI_COTS) &&
(nconf->nc_semantics != NC_TPI_COTS_ORD))
- return; /* not my type */
+ return (1); /* not my type */
/*
* XXX - using RPC library internal functions.
@@ -416,7 +517,7 @@ create_service(struct netconfig *nconf)
if (!__rpc_nconf2sockinfo(nconf, &si)) {
syslog(LOG_ERR, "cannot get information for %s",
nconf->nc_netid);
- return;
+ return (1);
}
/* Get rpc.statd's address on this transport */
@@ -432,6 +533,11 @@ create_service(struct netconfig *nconf)
nhostsbak = nhosts;
while (nhostsbak > 0) {
--nhostsbak;
+ sock_fd = realloc(sock_fd, (sock_fdcnt + 1) * sizeof(int));
+ if (sock_fd == NULL)
+ out_of_mem();
+ sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */
+ mallocd_res = 0;
/*
* XXX - using RPC library internal functions.
@@ -446,7 +552,7 @@ create_service(struct netconfig *nconf)
case AF_INET:
if (inet_pton(AF_INET, hosts[nhostsbak],
host_addr) == 1) {
- hints.ai_flags &= AI_NUMERICHOST;
+ hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET6 address.
@@ -461,7 +567,7 @@ create_service(struct netconfig *nconf)
case AF_INET6:
if (inet_pton(AF_INET6, hosts[nhostsbak],
host_addr) == 1) {
- hints.ai_flags &= AI_NUMERICHOST;
+ hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET address.
@@ -485,6 +591,7 @@ create_service(struct netconfig *nconf)
res = malloc(sizeof(struct addrinfo));
if (res == NULL)
out_of_mem();
+ mallocd_res = 1;
res->ai_flags = hints.ai_flags;
res->ai_family = hints.ai_family;
res->ai_protocol = hints.ai_protocol;
@@ -498,7 +605,7 @@ create_service(struct netconfig *nconf)
sin->sin_addr.s_addr = htonl(INADDR_ANY);
res->ai_addr = (struct sockaddr*) sin;
res->ai_addrlen = (socklen_t)
- sizeof(res->ai_addr);
+ sizeof(struct sockaddr_in);
break;
case AF_INET6:
sin6 = malloc(sizeof(struct sockaddr_in6));
@@ -508,10 +615,14 @@ create_service(struct netconfig *nconf)
sin6->sin6_port = htons(0);
sin6->sin6_addr = in6addr_any;
res->ai_addr = (struct sockaddr*) sin6;
- res->ai_addrlen = (socklen_t) sizeof(res->ai_addr);
+ res->ai_addrlen = (socklen_t)
+ sizeof(struct sockaddr_in6);
break;
default:
- break;
+ syslog(LOG_ERR,
+ "bad addr fam %d",
+ res->ai_family);
+ exit(1);
}
} else {
if ((aicode = getaddrinfo(NULL, svcport_str,
@@ -520,6 +631,7 @@ create_service(struct netconfig *nconf)
"cannot get local address for %s: %s",
nconf->nc_netid,
gai_strerror(aicode));
+ close(fd);
continue;
}
}
@@ -529,16 +641,92 @@ create_service(struct netconfig *nconf)
syslog(LOG_ERR,
"cannot get local address for %s: %s",
nconf->nc_netid, gai_strerror(aicode));
+ close(fd);
continue;
}
}
+
+ /* Store the fd. */
+ sock_fd[sock_fdcnt - 1] = fd;
+
+ /* Now, attempt the bind. */
r = bindresvport_sa(fd, res->ai_addr);
if (r != 0) {
+ if (errno == EADDRINUSE && mallocd_svcport != 0) {
+ if (mallocd_res != 0) {
+ free(res->ai_addr);
+ free(res);
+ } else
+ freeaddrinfo(res);
+ return (-1);
+ }
syslog(LOG_ERR, "bindresvport_sa: %m");
exit(1);
}
+ if (svcport_str == NULL) {
+ svcport_str = malloc(NI_MAXSERV * sizeof(char));
+ if (svcport_str == NULL)
+ out_of_mem();
+ mallocd_svcport = 1;
+
+ if (getnameinfo(res->ai_addr,
+ res->ai_addr->sa_len, NULL, NI_MAXHOST,
+ svcport_str, NI_MAXSERV * sizeof(char),
+ NI_NUMERICHOST | NI_NUMERICSERV))
+ errx(1, "Cannot get port number");
+ }
+ if (mallocd_res != 0) {
+ free(res->ai_addr);
+ free(res);
+ } else
+ freeaddrinfo(res);
+ res = NULL;
+ }
+ return (0);
+}
+
+/*
+ * Called after all the create_service() calls have succeeded, to complete
+ * the setup and registration.
+ */
+static void
+complete_service(struct netconfig *nconf, char *port_str)
+{
+ struct addrinfo hints, *res = NULL;
+ struct __rpc_sockinfo si;
+ struct netbuf servaddr;
+ SVCXPRT *transp = NULL;
+ int aicode, fd, nhostsbak;
+ int registered = 0;
+
+ if ((nconf->nc_semantics != NC_TPI_CLTS) &&
+ (nconf->nc_semantics != NC_TPI_COTS) &&
+ (nconf->nc_semantics != NC_TPI_COTS_ORD))
+ return; /* not my type */
+
+ /*
+ * XXX - using RPC library internal functions.
+ */
+ if (!__rpc_nconf2sockinfo(nconf, &si)) {
+ syslog(LOG_ERR, "cannot get information for %s",
+ nconf->nc_netid);
+ return;
+ }
+
+ nhostsbak = nhosts;
+ while (nhostsbak > 0) {
+ --nhostsbak;
+ if (sock_fdpos >= sock_fdcnt) {
+ /* Should never happen. */
+ syslog(LOG_ERR, "Ran out of socket fd's");
+ return;
+ }
+ fd = sock_fd[sock_fdpos++];
+ if (fd < 0)
+ continue;
+
if (nconf->nc_semantics != NC_TPI_CLTS)
listen(fd, SOMAXCONN);
@@ -582,19 +770,7 @@ create_service(struct netconfig *nconf)
hints.ai_socktype = si.si_socktype;
hints.ai_protocol = si.si_proto;
- if (svcport_str == NULL) {
- svcport_str = malloc(NI_MAXSERV * sizeof(char));
- if (svcport_str == NULL)
- out_of_mem();
-
- if (getnameinfo(res->ai_addr,
- res->ai_addr->sa_len, NULL, NI_MAXHOST,
- svcport_str, NI_MAXSERV * sizeof(char),
- NI_NUMERICHOST | NI_NUMERICSERV))
- errx(1, "Cannot get port number");
- }
-
- if((aicode = getaddrinfo(NULL, svcport_str, &hints,
+ if ((aicode = getaddrinfo(NULL, port_str, &hints,
&res)) != 0) {
syslog(LOG_ERR, "cannot get local address: %s",
gai_strerror(aicode));
@@ -617,6 +793,23 @@ create_service(struct netconfig *nconf)
}
/*
+ * Clear out sockets after a failure to bind one of them, so that the
+ * cycle of socket creation/binding can start anew.
+ */
+static void
+clearout_service(void)
+{
+ int i;
+
+ for (i = 0; i < sock_fdcnt; i++) {
+ if (sock_fd[i] >= 0) {
+ shutdown(sock_fd[i], SHUT_RDWR);
+ close(sock_fd[i]);
+ }
+ }
+}
+
+/*
* Look up addresses for the kernel to create transports for.
*/
void
diff --git a/usr.sbin/rpc.statd/statd.c b/usr.sbin/rpc.statd/statd.c
index b8b4311..ff537f8 100644
--- a/usr.sbin/rpc.statd/statd.c
+++ b/usr.sbin/rpc.statd/statd.c
@@ -39,6 +39,7 @@
__FBSDID("$FreeBSD$");
#include <err.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <rpc/rpc.h>
@@ -55,13 +56,21 @@ __FBSDID("$FreeBSD$");
#include <unistd.h>
#include "statd.h"
+#define GETPORT_MAXTRY 20 /* Max tries to get a port # */
+
int debug = 0; /* Controls syslog() calls for debug messages */
char **hosts, *svcport_str = NULL;
int nhosts = 0;
int xcreated = 0;
-
-void create_service(struct netconfig *nconf);
+static int mallocd_svcport = 0;
+static int *sock_fd;
+static int sock_fdcnt;
+static int sock_fdpos;
+
+static int create_service(struct netconfig *nconf);
+static void complete_service(struct netconfig *nconf, char *port_str);
+static void clearout_service(void);
static void handle_sigchld(int sig);
void out_of_mem(void);
@@ -78,6 +87,8 @@ main(int argc, char **argv)
char *endptr, **hosts_bak;
int have_v6 = 1;
int maxrec = RPC_MAXDATASIZE;
+ int attempt_cnt, port_len, port_pos, ret;
+ char **port_list;
while ((ch = getopt(argc, argv, "dh:p:")) != -1)
switch (ch) {
@@ -176,6 +187,11 @@ main(int argc, char **argv)
hosts[nhosts - 1] = "127.0.0.1";
}
+ attempt_cnt = 1;
+ sock_fdcnt = 0;
+ sock_fd = NULL;
+ port_list = NULL;
+ port_len = 0;
nc_handle = setnetconfig();
while ((nconf = getnetconfig(nc_handle))) {
/* We want to listen only on udp6, tcp6, udp, tcp transports */
@@ -184,11 +200,87 @@ main(int argc, char **argv)
if (have_v6 == 0 && strcmp(nconf->nc_protofmly, "inet6") == 0) {
/* DO NOTHING */
} else {
- create_service(nconf);
+ ret = create_service(nconf);
+ if (ret == 1)
+ /* Ignore this call */
+ continue;
+ if (ret < 0) {
+ /*
+ * Failed to bind port, so close off
+ * all sockets created and try again
+ * if the port# was dynamically
+ * assigned via bind(2).
+ */
+ clearout_service();
+ if (mallocd_svcport != 0 &&
+ attempt_cnt < GETPORT_MAXTRY) {
+ free(svcport_str);
+ svcport_str = NULL;
+ mallocd_svcport = 0;
+ } else {
+ errno = EADDRINUSE;
+ syslog(LOG_ERR,
+ "bindresvport_sa: %m");
+ exit(1);
+ }
+
+ /* Start over at the first service. */
+ free(sock_fd);
+ sock_fdcnt = 0;
+ sock_fd = NULL;
+ nc_handle = setnetconfig();
+ attempt_cnt++;
+ } else if (mallocd_svcport != 0 &&
+ attempt_cnt == GETPORT_MAXTRY) {
+ /*
+ * For the last attempt, allow
+ * different port #s for each nconf
+ * by saving the svcport_str and
+ * setting it back to NULL.
+ */
+ port_list = realloc(port_list,
+ (port_len + 1) * sizeof(char *));
+ if (port_list == NULL)
+ out_of_mem();
+ port_list[port_len++] = svcport_str;
+ svcport_str = NULL;
+ mallocd_svcport = 0;
+ }
}
}
}
+
+ /*
+ * Successfully bound the ports, so call complete_service() to
+ * do the rest of the setup on the service(s).
+ */
+ sock_fdpos = 0;
+ port_pos = 0;
+ nc_handle = setnetconfig();
+ while ((nconf = getnetconfig(nc_handle))) {
+ /* We want to listen only on udp6, tcp6, udp, tcp transports */
+ if (nconf->nc_flag & NC_VISIBLE) {
+ /* Skip if there's no IPv6 support */
+ if (have_v6 == 0 && strcmp(nconf->nc_protofmly, "inet6") == 0) {
+ /* DO NOTHING */
+ } else if (port_list != NULL) {
+ if (port_pos >= port_len) {
+ syslog(LOG_ERR, "too many port#s");
+ exit(1);
+ }
+ complete_service(nconf, port_list[port_pos++]);
+ } else
+ complete_service(nconf, svcport_str);
+ }
+ }
endnetconfig(nc_handle);
+ free(sock_fd);
+ if (port_list != NULL) {
+ for (port_pos = 0; port_pos < port_len; port_pos++)
+ free(port_list[port_pos]);
+ free(port_list);
+ }
+
init_file("/var/db/statd.status");
/* Note that it is NOT sensible to run this program from inetd - the */
@@ -215,29 +307,30 @@ main(int argc, char **argv)
/*
* This routine creates and binds sockets on the appropriate
- * addresses. It gets called one time for each transport and
- * registrates the service with rpcbind on that trasport.
+ * addresses. It gets called one time for each transport.
+ * It returns 0 upon success, 1 for ingore the call and -1 to indicate
+ * bind failed with EADDRINUSE.
+ * Any file descriptors that have been created are stored in sock_fd and
+ * the total count of them is maintained in sock_fdcnt.
*/
-void
+static int
create_service(struct netconfig *nconf)
{
struct addrinfo hints, *res = NULL;
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;
struct __rpc_sockinfo si;
- struct netbuf servaddr;
- SVCXPRT *transp = NULL;
int aicode;
int fd;
int nhostsbak;
int r;
- int registered = 0;
u_int32_t host_addr[4]; /* IPv4 or IPv6 */
+ int mallocd_res;
if ((nconf->nc_semantics != NC_TPI_CLTS) &&
(nconf->nc_semantics != NC_TPI_COTS) &&
(nconf->nc_semantics != NC_TPI_COTS_ORD))
- return; /* not my type */
+ return (1); /* not my type */
/*
* XXX - using RPC library internal functions.
@@ -245,7 +338,7 @@ create_service(struct netconfig *nconf)
if (!__rpc_nconf2sockinfo(nconf, &si)) {
syslog(LOG_ERR, "cannot get information for %s",
nconf->nc_netid);
- return;
+ return (1);
}
/* Get rpc.statd's address on this transport */
@@ -261,6 +354,11 @@ create_service(struct netconfig *nconf)
nhostsbak = nhosts;
while (nhostsbak > 0) {
--nhostsbak;
+ sock_fd = realloc(sock_fd, (sock_fdcnt + 1) * sizeof(int));
+ if (sock_fd == NULL)
+ out_of_mem();
+ sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */
+ mallocd_res = 0;
/*
* XXX - using RPC library internal functions.
@@ -274,7 +372,7 @@ create_service(struct netconfig *nconf)
case AF_INET:
if (inet_pton(AF_INET, hosts[nhostsbak],
host_addr) == 1) {
- hints.ai_flags &= AI_NUMERICHOST;
+ hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET6 address.
@@ -289,7 +387,7 @@ create_service(struct netconfig *nconf)
case AF_INET6:
if (inet_pton(AF_INET6, hosts[nhostsbak],
host_addr) == 1) {
- hints.ai_flags &= AI_NUMERICHOST;
+ hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET address.
@@ -313,6 +411,7 @@ create_service(struct netconfig *nconf)
res = malloc(sizeof(struct addrinfo));
if (res == NULL)
out_of_mem();
+ mallocd_res = 1;
res->ai_flags = hints.ai_flags;
res->ai_family = hints.ai_family;
res->ai_protocol = hints.ai_protocol;
@@ -326,7 +425,7 @@ create_service(struct netconfig *nconf)
sin->sin_addr.s_addr = htonl(INADDR_ANY);
res->ai_addr = (struct sockaddr*) sin;
res->ai_addrlen = (socklen_t)
- sizeof(res->ai_addr);
+ sizeof(struct sockaddr_in);
break;
case AF_INET6:
sin6 = malloc(sizeof(struct sockaddr_in6));
@@ -336,10 +435,13 @@ create_service(struct netconfig *nconf)
sin6->sin6_port = htons(0);
sin6->sin6_addr = in6addr_any;
res->ai_addr = (struct sockaddr*) sin6;
- res->ai_addrlen = (socklen_t) sizeof(res->ai_addr);
+ res->ai_addrlen = (socklen_t)
+ sizeof(struct sockaddr_in6);
break;
default:
- break;
+ syslog(LOG_ERR, "bad addr fam %d",
+ res->ai_family);
+ exit(1);
}
} else {
if ((aicode = getaddrinfo(NULL, svcport_str,
@@ -348,6 +450,7 @@ create_service(struct netconfig *nconf)
"cannot get local address for %s: %s",
nconf->nc_netid,
gai_strerror(aicode));
+ close(fd);
continue;
}
}
@@ -357,16 +460,91 @@ create_service(struct netconfig *nconf)
syslog(LOG_ERR,
"cannot get local address for %s: %s",
nconf->nc_netid, gai_strerror(aicode));
+ close(fd);
continue;
}
}
+ /* Store the fd. */
+ sock_fd[sock_fdcnt - 1] = fd;
+
+ /* Now, attempt the bind. */
r = bindresvport_sa(fd, res->ai_addr);
if (r != 0) {
+ if (errno == EADDRINUSE && mallocd_svcport != 0) {
+ if (mallocd_res != 0) {
+ free(res->ai_addr);
+ free(res);
+ } else
+ freeaddrinfo(res);
+ return (-1);
+ }
syslog(LOG_ERR, "bindresvport_sa: %m");
exit(1);
}
+ if (svcport_str == NULL) {
+ svcport_str = malloc(NI_MAXSERV * sizeof(char));
+ if (svcport_str == NULL)
+ out_of_mem();
+ mallocd_svcport = 1;
+
+ if (getnameinfo(res->ai_addr,
+ res->ai_addr->sa_len, NULL, NI_MAXHOST,
+ svcport_str, NI_MAXSERV * sizeof(char),
+ NI_NUMERICHOST | NI_NUMERICSERV))
+ errx(1, "Cannot get port number");
+ }
+ if (mallocd_res != 0) {
+ free(res->ai_addr);
+ free(res);
+ } else
+ freeaddrinfo(res);
+ res = NULL;
+ }
+ return (0);
+}
+
+/*
+ * Called after all the create_service() calls have succeeded, to complete
+ * the setup and registration.
+ */
+static void
+complete_service(struct netconfig *nconf, char *port_str)
+{
+ struct addrinfo hints, *res = NULL;
+ struct __rpc_sockinfo si;
+ struct netbuf servaddr;
+ SVCXPRT *transp = NULL;
+ int aicode, fd, nhostsbak;
+ int registered = 0;
+
+ if ((nconf->nc_semantics != NC_TPI_CLTS) &&
+ (nconf->nc_semantics != NC_TPI_COTS) &&
+ (nconf->nc_semantics != NC_TPI_COTS_ORD))
+ return; /* not my type */
+
+ /*
+ * XXX - using RPC library internal functions.
+ */
+ if (!__rpc_nconf2sockinfo(nconf, &si)) {
+ syslog(LOG_ERR, "cannot get information for %s",
+ nconf->nc_netid);
+ return;
+ }
+
+ nhostsbak = nhosts;
+ while (nhostsbak > 0) {
+ --nhostsbak;
+ if (sock_fdpos >= sock_fdcnt) {
+ /* Should never happen. */
+ syslog(LOG_ERR, "Ran out of socket fd's");
+ return;
+ }
+ fd = sock_fd[sock_fdpos++];
+ if (fd < 0)
+ continue;
+
if (nconf->nc_semantics != NC_TPI_CLTS)
listen(fd, SOMAXCONN);
@@ -397,19 +575,8 @@ create_service(struct netconfig *nconf)
hints.ai_socktype = si.si_socktype;
hints.ai_protocol = si.si_proto;
- if (svcport_str == NULL) {
- svcport_str = malloc(NI_MAXSERV * sizeof(char));
- if (svcport_str == NULL)
- out_of_mem();
-
- if (getnameinfo(res->ai_addr,
- res->ai_addr->sa_len, NULL, NI_MAXHOST,
- svcport_str, NI_MAXSERV * sizeof(char),
- NI_NUMERICHOST | NI_NUMERICSERV))
- errx(1, "Cannot get port number");
- }
- if((aicode = getaddrinfo(NULL, svcport_str, &hints,
+ if ((aicode = getaddrinfo(NULL, port_str, &hints,
&res)) != 0) {
syslog(LOG_ERR, "cannot get local address: %s",
gai_strerror(aicode));
@@ -428,6 +595,23 @@ create_service(struct netconfig *nconf)
} /* end while */
}
+/*
+ * Clear out sockets after a failure to bind one of them, so that the
+ * cycle of socket creation/binding can start anew.
+ */
+static void
+clearout_service(void)
+{
+ int i;
+
+ for (i = 0; i < sock_fdcnt; i++) {
+ if (sock_fd[i] >= 0) {
+ shutdown(sock_fd[i], SHUT_RDWR);
+ close(sock_fd[i]);
+ }
+ }
+}
+
static void
usage()
{
diff --git a/usr.sbin/rtadvd/advcap.c b/usr.sbin/rtadvd/advcap.c
index 792ea27..7280f40 100644
--- a/usr.sbin/rtadvd/advcap.c
+++ b/usr.sbin/rtadvd/advcap.c
@@ -64,8 +64,6 @@
#define V_TERM "HOST"
#endif
-char *RM;
-
/*
* termcap - routines for dealing with the terminal capability data base
*
@@ -83,12 +81,10 @@ char *RM;
static char *tbuf;
static int hopcount; /* detect infinite loops in termcap, init 0 */
-static char *remotefile;
-
-extern char *conffile;
+extern const char *conffile;
int tgetent(char *, char *);
-int getent(char *, char *, char *);
+int getent(char *, char *, const char *);
int tnchktc(void);
int tnamatch(char *);
static char *tskip(char *);
@@ -103,22 +99,18 @@ static char *tdecode(char *, char **);
* we just notice escaped newlines.
*/
int
-tgetent(bp, name)
- char *bp, *name;
+tgetent(char *bp, char *name)
{
- char *cp;
-
- remotefile = cp = conffile ? conffile : _PATH_RTADVDCONF;
- return (getent(bp, name, cp));
+ return (getent(bp, name, conffile));
}
int
-getent(bp, name, cp)
- char *bp, *name, *cp;
+getent(char *bp, char *name, const char *cfile)
{
int c;
int i = 0, cnt = 0;
char ibuf[BUFSIZ];
+ char *cp;
int tf;
tbuf = bp;
@@ -130,9 +122,9 @@ getent(bp, name, cp)
* use so we don't have to read the file. In this case it
* has to already have the newlines crunched out.
*/
- if (cp && *cp) {
- tf = open(RM = cp, O_RDONLY);
- }
+ if (cfile && *cfile)
+ tf = open(cfile, O_RDONLY);
+
if (tf < 0) {
syslog(LOG_INFO,
"<%s> open: %s", __func__, strerror(errno));
@@ -184,7 +176,7 @@ getent(bp, name, cp)
* Note that this works because of the left to right scan.
*/
int
-tnchktc()
+tnchktc(void)
{
char *p, *q;
char tcname[16]; /* name of similar terminal */
@@ -211,7 +203,7 @@ tnchktc()
write(STDERR_FILENO, "Infinite tc= loop\n", 18);
return (0);
}
- if (getent(tcbuf, tcname, remotefile) != 1) {
+ if (getent(tcbuf, tcname, conffile) != 1) {
return (0);
}
for (q = tcbuf; *q++ != ':'; )
@@ -233,8 +225,7 @@ tnchktc()
* name (before the first field) stops us.
*/
int
-tnamatch(np)
- char *np;
+tnamatch(char *np)
{
char *Np, *Bp;
@@ -260,8 +251,7 @@ tnamatch(np)
* into the termcap file in octal.
*/
static char *
-tskip(bp)
- char *bp;
+tskip(char *bp)
{
int dquote;
@@ -305,8 +295,7 @@ breakbreak:
* Note that we handle octal numbers beginning with 0.
*/
int64_t
-tgetnum(id)
- char *id;
+tgetnum(char *id)
{
int64_t i;
int base;
@@ -341,8 +330,7 @@ tgetnum(id)
* not given.
*/
int
-tgetflag(id)
- char *id;
+tgetflag(char *id)
{
char *bp = tbuf;
@@ -369,8 +357,7 @@ tgetflag(id)
* No checking on area overflow.
*/
char *
-tgetstr(id, area)
- char *id, **area;
+tgetstr(char *id, char **area)
{
char *bp = tbuf;
@@ -395,13 +382,11 @@ tgetstr(id, area)
* string capability escapes.
*/
static char *
-tdecode(str, area)
- char *str;
- char **area;
+tdecode(char *str, char **area)
{
char *cp;
int c;
- char *dp;
+ const char *dp;
int i;
char term;
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c
index 5eadcc5..c0e442b 100644
--- a/usr.sbin/rtadvd/config.c
+++ b/usr.sbin/rtadvd/config.c
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -34,7 +34,6 @@
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/time.h>
-#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_var.h>
@@ -53,6 +52,7 @@
#include <stdio.h>
#include <syslog.h>
#include <errno.h>
+#include <netdb.h>
#include <string.h>
#include <search.h>
#include <stdlib.h>
@@ -65,29 +65,55 @@
#include "if.h"
#include "config.h"
+/* label of tcapcode + number + domain name + zero octet */
+static char entbuf[10 + 3 + NI_MAXHOST + 1];
+static char oentbuf[10 + 3 + NI_MAXHOST + 1];
+static char abuf[DNAME_LABELENC_MAXLEN];
+
static time_t prefix_timo = (60 * 120); /* 2 hours.
* XXX: should be configurable. */
-extern struct rainfo *ralist;
static struct rtadvd_timer *prefix_timeout(void *);
-static void makeentry(char *, size_t, int, char *);
-static int getinet6sysctl(int);
+static void makeentry(char *, size_t, int, const char *);
+static size_t dname_labelenc(char *, const char *);
-void
-getconfig(intface)
- char *intface;
+/* Encode domain name label encoding in RFC 1035 Section 3.1 */
+static size_t
+dname_labelenc(char *dst, const char *src)
{
- int stat, i;
- char tbuf[BUFSIZ];
- struct rainfo *tmp;
- long val;
- int64_t val64;
- char buf[BUFSIZ];
- char *bp = buf;
- char *addr, *flagstr;
- static int forwarding = -1;
+ char *dst_origin;
+ char *p;
+ size_t len;
+
+ dst_origin = dst;
+ len = strlen(src);
+
+ /* Length fields per 63 octets + '\0' (<= DNAME_LABELENC_MAXLEN) */
+ memset(dst, 0, len + len / 64 + 1 + 1);
+
+ syslog(LOG_DEBUG, "<%s> labelenc = %s", __func__, src);
+ while (src && (len = strlen(src)) != 0) {
+ /* Put a length field with 63 octet limitation first. */
+ p = strchr(src, '.');
+ if (p == NULL)
+ *dst++ = len = MIN(63, len);
+ else
+ *dst++ = len = MIN(63, p - src);
+ /* Copy 63 octets at most. */
+ memcpy(dst, src, len);
+ dst += len;
+ if (p == NULL) /* the last label */
+ break;
+ src = p + 1;
+ }
+ /* Always need a 0-length label at the tail. */
+ *dst++ = '\0';
+
+ syslog(LOG_DEBUG, "<%s> labellen = %td", __func__, dst - dst_origin);
+ return (dst - dst_origin);
+}
-#define MUSTHAVE(var, cap) \
+#define MUSTHAVE(var, cap) \
do { \
int64_t t; \
if ((t = agetnum(cap)) < 0) { \
@@ -97,60 +123,184 @@ getconfig(intface)
} \
var = t; \
} while (0)
-#define MAYHAVE(var, cap, def) \
+
+#define MAYHAVE(var, cap, def) \
do { \
if ((var = agetnum(cap)) < 0) \
var = def; \
} while (0)
+#define ELM_MALLOC(p,error_action) \
+ do { \
+ p = malloc(sizeof(*p)); \
+ if (p == NULL) { \
+ syslog(LOG_ERR, "<%s> malloc failed: %s", \
+ __func__, strerror(errno)); \
+ error_action; \
+ } \
+ memset(p, 0, sizeof(*p)); \
+ } while(0)
+
+int
+loadconfig(char *ifl_names[], const int ifl_len)
+{
+ int i;
+ int idx;
+ int error;
+
+ for (i = 0; i < ifl_len; i++) {
+ idx = if_nametoindex(ifl_names[i]);
+ if (idx == 0) {
+ syslog(LOG_ERR,
+ "<%s> interface %s not found. "
+ "Ignored at this moment.", __func__, ifl_names[i]);
+ continue;
+ }
+ syslog(LOG_INFO,
+ "<%s> loading config for %s.", __func__, ifl_names[i]);
+ error = getconfig(idx);
+ if (error)
+ syslog(LOG_ERR,
+ "<%s> invalid configuration for %s. "
+ "Ignored at this moment.", __func__, ifl_names[i]);
+ }
+
+ return (0);
+}
+
+int
+rmconfig(int idx)
+{
+ struct rainfo *rai;
+ struct prefix *pfx;
+ struct soliciter *sol;
+ struct rdnss *rdn;
+ struct rdnss_addr *rdna;
+ struct dnssl *dns;
+ struct rtinfo *rti;
+
+ rai = if_indextorainfo(idx);
+ if (rai == NULL) {
+ syslog(LOG_ERR, "<%s>: rainfo not found (idx=%d)",
+ __func__, idx);
+ return (-1);
+ }
+
+ TAILQ_REMOVE(&railist, rai, rai_next);
+ syslog(LOG_DEBUG, "<%s>: rainfo (idx=%d) removed.",
+ __func__, idx);
+
+ /* Free all of allocated memories for this entry. */
+ rtadvd_remove_timer(rai->rai_timer);
+
+ if (rai->rai_ra_data != NULL)
+ free(rai->rai_ra_data);
+
+ if (rai->rai_sdl != NULL)
+ free(rai->rai_sdl);
+
+ while ((pfx = TAILQ_FIRST(&rai->rai_prefix)) != NULL) {
+ TAILQ_REMOVE(&rai->rai_prefix, pfx, pfx_next);
+ free(pfx);
+ }
+ while ((sol = TAILQ_FIRST(&rai->rai_soliciter)) != NULL) {
+ TAILQ_REMOVE(&rai->rai_soliciter, sol, sol_next);
+ free(sol);
+ }
+ while ((rdn = TAILQ_FIRST(&rai->rai_rdnss)) != NULL) {
+ TAILQ_REMOVE(&rai->rai_rdnss, rdn, rd_next);
+ while ((rdna = TAILQ_FIRST(&rdn->rd_list)) != NULL) {
+ TAILQ_REMOVE(&rdn->rd_list, rdna, ra_next);
+ free(rdna);
+ }
+ free(rdn);
+ }
+ while ((dns = TAILQ_FIRST(&rai->rai_dnssl)) != NULL) {
+ TAILQ_REMOVE(&rai->rai_dnssl, dns, dn_next);
+ free(dns);
+ }
+ while ((rti = TAILQ_FIRST(&rai->rai_route)) != NULL) {
+ TAILQ_REMOVE(&rai->rai_route, rti, rti_next);
+ free(rti);
+ }
+ free(rai);
+
+ return (0);
+}
+
+int
+getconfig(int idx)
+{
+ int stat, i;
+ char tbuf[BUFSIZ];
+ struct rainfo *rai;
+ struct rainfo *rai_old;
+ long val;
+ int64_t val64;
+ char buf[BUFSIZ];
+ char *bp = buf;
+ char *addr, *flagstr;
+ char intface[IFNAMSIZ];
+
+ if (if_indextoname(idx, intface) == NULL) {
+ syslog(LOG_ERR, "<%s> invalid index number (%d)",
+ __func__, idx);
+ return (-1);
+ }
+
+ TAILQ_FOREACH(rai_old, &railist, rai_next)
+ if (idx == rai_old->rai_ifindex)
+ break;
+
if ((stat = agetent(tbuf, intface)) <= 0) {
memset(tbuf, 0, sizeof(tbuf));
syslog(LOG_INFO,
- "<%s> %s isn't defined in the configuration file"
- " or the configuration file doesn't exist."
- " Treat it as default",
- __func__, intface);
+ "<%s> %s isn't defined in the configuration file"
+ " or the configuration file doesn't exist."
+ " Treat it as default",
+ __func__, intface);
}
- tmp = (struct rainfo *)malloc(sizeof(*ralist));
- if (tmp == NULL) {
- syslog(LOG_INFO, "<%s> %s: can't allocate enough memory",
- __func__, intface);
- exit(1);
- }
- memset(tmp, 0, sizeof(*tmp));
- tmp->prefix.next = tmp->prefix.prev = &tmp->prefix;
+ ELM_MALLOC(rai, exit(1));
+ TAILQ_INIT(&rai->rai_prefix);
#ifdef ROUTEINFO
- tmp->route.next = tmp->route.prev = &tmp->route;
+ TAILQ_INIT(&rai->rai_route);
#endif
+ TAILQ_INIT(&rai->rai_rdnss);
+ TAILQ_INIT(&rai->rai_dnssl);
+ TAILQ_INIT(&rai->rai_soliciter);
- /* check if we are allowed to forward packets (if not determined) */
- if (forwarding < 0) {
- if ((forwarding = getinet6sysctl(IPV6CTL_FORWARDING)) < 0)
- exit(1);
- }
+ /* gather on-link prefixes from the network interfaces. */
+ if (agetflag("noifprefix"))
+ rai->rai_advifprefix = 0;
+ else
+ rai->rai_advifprefix = 1;
/* get interface information */
if (agetflag("nolladdr"))
- tmp->advlinkopt = 0;
+ rai->rai_advlinkopt = 0;
else
- tmp->advlinkopt = 1;
- if (tmp->advlinkopt) {
- if ((tmp->sdl = if_nametosdl(intface)) == NULL) {
+ rai->rai_advlinkopt = 1;
+ if (rai->rai_advlinkopt) {
+ if ((rai->rai_sdl = if_nametosdl(intface)) == NULL) {
syslog(LOG_ERR,
- "<%s> can't get information of %s",
- __func__, intface);
- exit(1);
+ "<%s> can't get information of %s",
+ __func__, intface);
+ goto getconfig_free_rai;
}
- tmp->ifindex = tmp->sdl->sdl_index;
+ rai->rai_ifindex = rai->rai_sdl->sdl_index;
} else
- tmp->ifindex = if_nametoindex(intface);
- strncpy(tmp->ifname, intface, sizeof(tmp->ifname));
- if ((tmp->phymtu = if_getmtu(intface)) == 0) {
- tmp->phymtu = IPV6_MMTU;
+ rai->rai_ifindex = if_nametoindex(intface);
+ strncpy(rai->rai_ifname, intface, sizeof(rai->rai_ifname));
+ syslog(LOG_DEBUG,
+ "<%s> ifindex = %d on %s", __func__, rai->rai_ifindex,
+ rai->rai_ifname);
+
+ if ((rai->rai_phymtu = if_getmtu(intface)) == 0) {
+ rai->rai_phymtu = IPV6_MMTU;
syslog(LOG_WARNING,
- "<%s> can't get interface mtu of %s. Treat as %d",
- __func__, intface, IPV6_MMTU);
+ "<%s> can't get interface mtu of %s. Treat as %d",
+ __func__, intface, IPV6_MMTU);
}
/*
@@ -159,25 +309,27 @@ getconfig(intface)
MAYHAVE(val, "maxinterval", DEF_MAXRTRADVINTERVAL);
if (val < MIN_MAXINTERVAL || val > MAX_MAXINTERVAL) {
syslog(LOG_ERR,
- "<%s> maxinterval (%ld) on %s is invalid "
- "(must be between %u and %u)", __func__, val,
- intface, MIN_MAXINTERVAL, MAX_MAXINTERVAL);
- exit(1);
+ "<%s> maxinterval (%ld) on %s is invalid "
+ "(must be between %u and %u)", __func__, val,
+ intface, MIN_MAXINTERVAL, MAX_MAXINTERVAL);
+ goto getconfig_free_rai;
}
- tmp->maxinterval = (u_int)val;
- MAYHAVE(val, "mininterval", tmp->maxinterval/3);
- if (val < MIN_MININTERVAL || val > (tmp->maxinterval * 3) / 4) {
+ rai->rai_maxinterval = (u_int)val;
+
+ MAYHAVE(val, "mininterval", rai->rai_maxinterval/3);
+ if ((u_int)val < MIN_MININTERVAL ||
+ (u_int)val > (rai->rai_maxinterval * 3) / 4) {
syslog(LOG_ERR,
- "<%s> mininterval (%ld) on %s is invalid "
- "(must be between %d and %d)",
- __func__, val, intface, MIN_MININTERVAL,
- (tmp->maxinterval * 3) / 4);
- exit(1);
+ "<%s> mininterval (%ld) on %s is invalid "
+ "(must be between %d and %d)",
+ __func__, val, intface, MIN_MININTERVAL,
+ (rai->rai_maxinterval * 3) / 4);
+ goto getconfig_free_rai;
}
- tmp->mininterval = (u_int)val;
+ rai->rai_mininterval = (u_int)val;
MAYHAVE(val, "chlim", DEF_ADVCURHOPLIMIT);
- tmp->hoplimit = val & 0xff;
+ rai->rai_hoplimit = val & 0xff;
if ((flagstr = (char *)agetstr("raflags", &bp))) {
val = 0;
@@ -191,77 +343,61 @@ getconfig(intface)
if ((val & ND_RA_FLAG_RTPREF_HIGH)) {
syslog(LOG_ERR, "<%s> the \'h\' and \'l\'"
" router flags are exclusive", __func__);
- exit(1);
+ goto getconfig_free_rai;
}
val |= ND_RA_FLAG_RTPREF_LOW;
}
- } else {
+ } else
MAYHAVE(val, "raflags", 0);
- }
- tmp->managedflg = val & ND_RA_FLAG_MANAGED;
- tmp->otherflg = val & ND_RA_FLAG_OTHER;
+
+ rai->rai_managedflg = val & ND_RA_FLAG_MANAGED;
+ rai->rai_otherflg = val & ND_RA_FLAG_OTHER;
#ifndef ND_RA_FLAG_RTPREF_MASK
#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
#endif
- tmp->rtpref = val & ND_RA_FLAG_RTPREF_MASK;
- if (tmp->rtpref == ND_RA_FLAG_RTPREF_RSV) {
+ rai->rai_rtpref = val & ND_RA_FLAG_RTPREF_MASK;
+ if (rai->rai_rtpref == ND_RA_FLAG_RTPREF_RSV) {
syslog(LOG_ERR, "<%s> invalid router preference (%02x) on %s",
- __func__, tmp->rtpref, intface);
- exit(1);
+ __func__, rai->rai_rtpref, intface);
+ goto getconfig_free_rai;
}
- MAYHAVE(val, "rltime", tmp->maxinterval * 3);
- if (val && (val < tmp->maxinterval || val > MAXROUTERLIFETIME)) {
+ MAYHAVE(val, "rltime", rai->rai_maxinterval * 3);
+ if ((u_int)val && ((u_int)val < rai->rai_maxinterval ||
+ (u_int)val > MAXROUTERLIFETIME)) {
syslog(LOG_ERR,
- "<%s> router lifetime (%ld) on %s is invalid "
- "(must be 0 or between %d and %d)",
- __func__, val, intface,
- tmp->maxinterval,
- MAXROUTERLIFETIME);
- exit(1);
+ "<%s> router lifetime (%ld) on %s is invalid "
+ "(must be 0 or between %d and %d)",
+ __func__, val, intface, rai->rai_maxinterval,
+ MAXROUTERLIFETIME);
+ goto getconfig_free_rai;
}
- /*
- * Basically, hosts MUST NOT send Router Advertisement messages at any
- * time (RFC 2461, Section 6.2.3). However, it would sometimes be
- * useful to allow hosts to advertise some parameters such as prefix
- * information and link MTU. Thus, we allow hosts to invoke rtadvd
- * only when router lifetime (on every advertising interface) is
- * explicitly set zero. (see also the above section)
- */
- if (val && forwarding == 0) {
- syslog(LOG_ERR,
- "<%s> non zero router lifetime is specified for %s, "
- "which must not be allowed for hosts. you must "
- "change router lifetime or enable IPv6 forwarding.",
- __func__, intface);
- exit(1);
- }
- tmp->lifetime = val & 0xffff;
+ rai->rai_lifetime = val & 0xffff;
MAYHAVE(val, "rtime", DEF_ADVREACHABLETIME);
if (val < 0 || val > MAXREACHABLETIME) {
syslog(LOG_ERR,
- "<%s> reachable time (%ld) on %s is invalid "
- "(must be no greater than %d)",
- __func__, val, intface, MAXREACHABLETIME);
- exit(1);
+ "<%s> reachable time (%ld) on %s is invalid "
+ "(must be no greater than %d)",
+ __func__, val, intface, MAXREACHABLETIME);
+ goto getconfig_free_rai;
}
- tmp->reachabletime = (u_int32_t)val;
+ rai->rai_reachabletime = (u_int32_t)val;
MAYHAVE(val64, "retrans", DEF_ADVRETRANSTIMER);
if (val64 < 0 || val64 > 0xffffffff) {
syslog(LOG_ERR, "<%s> retrans time (%lld) on %s out of range",
- __func__, (long long)val64, intface);
- exit(1);
+ __func__, (long long)val64, intface);
+ goto getconfig_free_rai;
}
- tmp->retranstimer = (u_int32_t)val64;
+ rai->rai_retranstimer = (u_int32_t)val64;
if (agetnum("hapref") != -1 || agetnum("hatime") != -1) {
syslog(LOG_ERR,
- "<%s> mobile-ip6 configuration not supported",
- __func__);
- exit(1);
+ "<%s> mobile-ip6 configuration not supported",
+ __func__);
+ goto getconfig_free_rai;
}
/* prefix information */
@@ -271,12 +407,11 @@ getconfig(intface)
* checking consistency of advertised lifetimes.
*/
MAYHAVE(val, "clockskew", 0);
- tmp->clockskew = val;
+ rai->rai_clockskew = val;
- tmp->pfxs = 0;
+ rai->rai_pfxs = 0;
for (i = -1; i < MAXPREFIX; i++) {
struct prefix *pfx;
- char entbuf[256];
makeentry(entbuf, sizeof(entbuf), i, "addr");
addr = (char *)agetstr(entbuf, &bp);
@@ -284,49 +419,38 @@ getconfig(intface)
continue;
/* allocate memory to store prefix information */
- if ((pfx = malloc(sizeof(struct prefix))) == NULL) {
- syslog(LOG_ERR,
- "<%s> can't allocate enough memory",
- __func__);
- exit(1);
- }
- memset(pfx, 0, sizeof(*pfx));
+ ELM_MALLOC(pfx, exit(1));
+ pfx->pfx_rainfo = rai;
+ pfx->pfx_origin = PREFIX_FROM_CONFIG;
- /* link into chain */
- insque(pfx, &tmp->prefix);
- tmp->pfxs++;
- pfx->rainfo = tmp;
-
- pfx->origin = PREFIX_FROM_CONFIG;
-
- if (inet_pton(AF_INET6, addr, &pfx->prefix) != 1) {
+ if (inet_pton(AF_INET6, addr, &pfx->pfx_prefix) != 1) {
syslog(LOG_ERR,
- "<%s> inet_pton failed for %s",
- __func__, addr);
- exit(1);
+ "<%s> inet_pton failed for %s",
+ __func__, addr);
+ goto getconfig_free_pfx;
}
- if (IN6_IS_ADDR_MULTICAST(&pfx->prefix)) {
+ if (IN6_IS_ADDR_MULTICAST(&pfx->pfx_prefix)) {
syslog(LOG_ERR,
- "<%s> multicast prefix (%s) must "
- "not be advertised on %s",
- __func__, addr, intface);
- exit(1);
+ "<%s> multicast prefix (%s) must "
+ "not be advertised on %s",
+ __func__, addr, intface);
+ goto getconfig_free_pfx;
}
- if (IN6_IS_ADDR_LINKLOCAL(&pfx->prefix))
+ if (IN6_IS_ADDR_LINKLOCAL(&pfx->pfx_prefix))
syslog(LOG_NOTICE,
- "<%s> link-local prefix (%s) will be"
- " advertised on %s",
- __func__, addr, intface);
+ "<%s> link-local prefix (%s) will be"
+ " advertised on %s",
+ __func__, addr, intface);
makeentry(entbuf, sizeof(entbuf), i, "prefixlen");
MAYHAVE(val, entbuf, 64);
if (val < 0 || val > 128) {
syslog(LOG_ERR, "<%s> prefixlen (%ld) for %s "
- "on %s out of range",
- __func__, val, addr, intface);
- exit(1);
+ "on %s out of range",
+ __func__, val, addr, intface);
+ goto getconfig_free_pfx;
}
- pfx->prefixlen = (int)val;
+ pfx->pfx_prefixlen = (int)val;
makeentry(entbuf, sizeof(entbuf), i, "pinfoflags");
if ((flagstr = (char *)agetstr(entbuf, &bp))) {
@@ -339,8 +463,8 @@ getconfig(intface)
MAYHAVE(val, entbuf,
(ND_OPT_PI_FLAG_ONLINK|ND_OPT_PI_FLAG_AUTO));
}
- pfx->onlinkflg = val & ND_OPT_PI_FLAG_ONLINK;
- pfx->autoconfflg = val & ND_OPT_PI_FLAG_AUTO;
+ pfx->pfx_onlinkflg = val & ND_OPT_PI_FLAG_ONLINK;
+ pfx->pfx_autoconfflg = val & ND_OPT_PI_FLAG_AUTO;
makeentry(entbuf, sizeof(entbuf), i, "vltime");
MAYHAVE(val64, entbuf, DEF_ADVVALIDLIFETIME);
@@ -348,17 +472,17 @@ getconfig(intface)
syslog(LOG_ERR, "<%s> vltime (%lld) for "
"%s/%d on %s is out of range",
__func__, (long long)val64,
- addr, pfx->prefixlen, intface);
- exit(1);
+ addr, pfx->pfx_prefixlen, intface);
+ goto getconfig_free_pfx;
}
- pfx->validlifetime = (u_int32_t)val64;
+ pfx->pfx_validlifetime = (u_int32_t)val64;
makeentry(entbuf, sizeof(entbuf), i, "vltimedecr");
if (agetflag(entbuf)) {
struct timeval now;
gettimeofday(&now, 0);
- pfx->vltimeexpire =
- now.tv_sec + pfx->validlifetime;
+ pfx->pfx_vltimeexpire =
+ now.tv_sec + pfx->pfx_validlifetime;
}
makeentry(entbuf, sizeof(entbuf), i, "pltime");
@@ -368,44 +492,51 @@ getconfig(intface)
"<%s> pltime (%lld) for %s/%d on %s "
"is out of range",
__func__, (long long)val64,
- addr, pfx->prefixlen, intface);
- exit(1);
+ addr, pfx->pfx_prefixlen, intface);
+ goto getconfig_free_pfx;
}
- pfx->preflifetime = (u_int32_t)val64;
+ pfx->pfx_preflifetime = (u_int32_t)val64;
makeentry(entbuf, sizeof(entbuf), i, "pltimedecr");
if (agetflag(entbuf)) {
struct timeval now;
gettimeofday(&now, 0);
- pfx->pltimeexpire =
- now.tv_sec + pfx->preflifetime;
+ pfx->pfx_pltimeexpire =
+ now.tv_sec + pfx->pfx_preflifetime;
}
+ /* link into chain */
+ TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next);
+ rai->rai_pfxs++;
+ continue;
+getconfig_free_pfx:
+ free(pfx);
}
- if (tmp->pfxs == 0)
- get_prefix(tmp);
+ if (rai->rai_advifprefix && rai->rai_pfxs == 0)
+ get_prefix(rai);
MAYHAVE(val, "mtu", 0);
- if (val < 0 || val > 0xffffffff) {
+ if (val < 0 || (u_int)val > 0xffffffff) {
syslog(LOG_ERR,
- "<%s> mtu (%ld) on %s out of range",
- __func__, val, intface);
- exit(1);
+ "<%s> mtu (%ld) on %s out of range",
+ __func__, val, intface);
+ goto getconfig_free_rai;
}
- tmp->linkmtu = (u_int32_t)val;
- if (tmp->linkmtu == 0) {
+ rai->rai_linkmtu = (u_int32_t)val;
+ if (rai->rai_linkmtu == 0) {
char *mtustr;
if ((mtustr = (char *)agetstr("mtu", &bp)) &&
strcmp(mtustr, "auto") == 0)
- tmp->linkmtu = tmp->phymtu;
+ rai->rai_linkmtu = rai->rai_phymtu;
}
- else if (tmp->linkmtu < IPV6_MMTU || tmp->linkmtu > tmp->phymtu) {
+ else if (rai->rai_linkmtu < IPV6_MMTU ||
+ rai->rai_linkmtu > rai->rai_phymtu) {
syslog(LOG_ERR,
- "<%s> advertised link mtu (%lu) on %s is invalid (must "
- "be between least MTU (%d) and physical link MTU (%d)",
- __func__, (unsigned long)tmp->linkmtu, intface,
- IPV6_MMTU, tmp->phymtu);
- exit(1);
+ "<%s> advertised link mtu (%lu) on %s is invalid (must "
+ "be between least MTU (%d) and physical link MTU (%d)",
+ __func__, (unsigned long)rai->rai_linkmtu, intface,
+ IPV6_MMTU, rai->rai_phymtu);
+ goto getconfig_free_rai;
}
#ifdef SIOCSIFINFO_IN6
@@ -415,65 +546,52 @@ getconfig(intface)
if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
syslog(LOG_ERR, "<%s> socket: %s", __func__,
- strerror(errno));
+ strerror(errno));
exit(1);
}
memset(&ndi, 0, sizeof(ndi));
strncpy(ndi.ifname, intface, IFNAMSIZ);
- if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&ndi) < 0) {
+ if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&ndi) < 0)
syslog(LOG_INFO, "<%s> ioctl:SIOCGIFINFO_IN6 at %s: %s",
- __func__, intface, strerror(errno));
- }
+ __func__, intface, strerror(errno));
/* reflect the RA info to the host variables in kernel */
- ndi.ndi.chlim = tmp->hoplimit;
- ndi.ndi.retrans = tmp->retranstimer;
- ndi.ndi.basereachable = tmp->reachabletime;
- if (ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&ndi) < 0) {
+ ndi.ndi.chlim = rai->rai_hoplimit;
+ ndi.ndi.retrans = rai->rai_retranstimer;
+ ndi.ndi.basereachable = rai->rai_reachabletime;
+ if (ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&ndi) < 0)
syslog(LOG_INFO, "<%s> ioctl:SIOCSIFINFO_IN6 at %s: %s",
- __func__, intface, strerror(errno));
- }
+ __func__, intface, strerror(errno));
+
close(s);
}
#endif
/* route information */
#ifdef ROUTEINFO
- tmp->routes = 0;
+ rai->rai_routes = 0;
for (i = -1; i < MAXROUTE; i++) {
struct rtinfo *rti;
- char entbuf[256], oentbuf[256];
makeentry(entbuf, sizeof(entbuf), i, "rtprefix");
addr = (char *)agetstr(entbuf, &bp);
if (addr == NULL) {
makeentry(oentbuf, sizeof(oentbuf), i, "rtrprefix");
addr = (char *)agetstr(oentbuf, &bp);
- if (addr) {
+ if (addr)
fprintf(stderr, "%s was obsoleted. Use %s.\n",
- oentbuf, entbuf);
- }
+ oentbuf, entbuf);
}
if (addr == NULL)
continue;
/* allocate memory to store prefix information */
- if ((rti = malloc(sizeof(struct rtinfo))) == NULL) {
- syslog(LOG_ERR,
- "<%s> can't allocate enough memory",
- __func__);
- exit(1);
- }
- memset(rti, 0, sizeof(*rti));
-
- /* link into chain */
- insque(rti, &tmp->route);
- tmp->routes++;
+ ELM_MALLOC(rti, exit(1));
- if (inet_pton(AF_INET6, addr, &rti->prefix) != 1) {
+ if (inet_pton(AF_INET6, addr, &rti->rti_prefix) != 1) {
syslog(LOG_ERR, "<%s> inet_pton failed for %s",
- __func__, addr);
- exit(1);
+ __func__, addr);
+ goto getconfig_free_rti;
}
#if 0
/*
@@ -485,17 +603,17 @@ getconfig(intface)
MAYHAVE(val64, entbuf, DEF_ADVVALIDLIFETIME);
if (IN6_IS_ADDR_MULTICAST(&rti->prefix)) {
syslog(LOG_ERR,
- "<%s> multicast route (%s) must "
- "not be advertised on %s",
- __func__, addr, intface);
- exit(1);
+ "<%s> multicast route (%s) must "
+ "not be advertised on %s",
+ __func__, addr, intface);
+ goto getconfig_free_rti;
}
if (IN6_IS_ADDR_LINKLOCAL(&rti->prefix)) {
syslog(LOG_NOTICE,
- "<%s> link-local route (%s) will "
- "be advertised on %s",
- __func__, addr, intface);
- exit(1);
+ "<%s> link-local route (%s) will "
+ "be advertised on %s",
+ __func__, addr, intface);
+ goto getconfig_free_rti;
}
#endif
@@ -505,19 +623,19 @@ getconfig(intface)
if (val == 256) {
makeentry(oentbuf, sizeof(oentbuf), i, "rtrplen");
MAYHAVE(val, oentbuf, 256);
- if (val != 256) {
+ if (val != 256)
fprintf(stderr, "%s was obsoleted. Use %s.\n",
- oentbuf, entbuf);
- } else
+ oentbuf, entbuf);
+ else
val = 64;
}
if (val < 0 || val > 128) {
syslog(LOG_ERR, "<%s> prefixlen (%ld) for %s on %s "
- "out of range",
- __func__, val, addr, intface);
- exit(1);
+ "out of range",
+ __func__, val, addr, intface);
+ goto getconfig_free_rti;
}
- rti->prefixlen = (int)val;
+ rti->rti_prefixlen = (int)val;
makeentry(entbuf, sizeof(entbuf), i, "rtflags");
if ((flagstr = (char *)agetstr(entbuf, &bp))) {
@@ -530,7 +648,7 @@ getconfig(intface)
"<%s> the \'h\' and \'l\' route"
" preferences are exclusive",
__func__);
- exit(1);
+ goto getconfig_free_rti;
}
val |= ND_RA_FLAG_RTPREF_LOW;
}
@@ -541,17 +659,17 @@ getconfig(intface)
MAYHAVE(val, oentbuf, 256);
if (val != 256) {
fprintf(stderr, "%s was obsoleted. Use %s.\n",
- oentbuf, entbuf);
+ oentbuf, entbuf);
} else
val = 0;
}
- rti->rtpref = val & ND_RA_FLAG_RTPREF_MASK;
- if (rti->rtpref == ND_RA_FLAG_RTPREF_RSV) {
+ rti->rti_rtpref = val & ND_RA_FLAG_RTPREF_MASK;
+ if (rti->rti_rtpref == ND_RA_FLAG_RTPREF_RSV) {
syslog(LOG_ERR, "<%s> invalid route preference (%02x) "
- "for %s/%d on %s",
- __func__, rti->rtpref, addr,
- rti->prefixlen, intface);
- exit(1);
+ "for %s/%d on %s",
+ __func__, rti->rti_rtpref, addr,
+ rti->rti_prefixlen, intface);
+ goto getconfig_free_rti;
}
/*
@@ -565,60 +683,191 @@ getconfig(intface)
if (val64 == -1) {
makeentry(oentbuf, sizeof(oentbuf), i, "rtrltime");
MAYHAVE(val64, oentbuf, -1);
- if (val64 != -1) {
+ if (val64 != -1)
fprintf(stderr, "%s was obsoleted. Use %s.\n",
- oentbuf, entbuf);
- } else {
+ oentbuf, entbuf);
+ else {
fprintf(stderr, "%s should be specified "
- "for interface %s.\n",
- entbuf, intface);
- val64 = tmp->lifetime;
+ "for interface %s.\n", entbuf, intface);
+ val64 = rai->rai_lifetime;
}
}
if (val64 < 0 || val64 > 0xffffffff) {
syslog(LOG_ERR, "<%s> route lifetime (%lld) for "
"%s/%d on %s out of range", __func__,
- (long long)val64, addr, rti->prefixlen, intface);
- exit(1);
+ (long long)val64, addr, rti->rti_prefixlen, intface);
+ goto getconfig_free_rti;
}
- rti->ltime = (u_int32_t)val64;
+ rti->rti_ltime = (u_int32_t)val64;
+
+ /* link into chain */
+ TAILQ_INSERT_TAIL(&rai->rai_route, rti, rti_next);
+ rai->rai_routes++;
+ continue;
+getconfig_free_rti:
+ free(rti);
}
#endif
+ /* DNS server and DNS search list information */
+ for (i = -1; i < MAXRDNSSENT ; i++) {
+ struct rdnss *rdn;
+ struct rdnss_addr *rdna;
+ char *ap;
+ int c;
+
+ makeentry(entbuf, sizeof(entbuf), i, "rdnss");
+ addr = (char *)agetstr(entbuf, &bp);
+ if (addr == NULL)
+ break;
+ ELM_MALLOC(rdn, exit(1));
+
+ TAILQ_INIT(&rdn->rd_list);
+
+ for (ap = addr; ap - addr < (ssize_t)strlen(addr); ap += c+1) {
+ c = strcspn(ap, ",");
+ strncpy(abuf, ap, c);
+ abuf[c] = '\0';
+ ELM_MALLOC(rdna, goto getconfig_free_rdn);
+ if (inet_pton(AF_INET6, abuf, &rdna->ra_dns) != 1) {
+ syslog(LOG_ERR, "<%s> inet_pton failed for %s",
+ __func__, abuf);
+ free(rdna);
+ goto getconfig_free_rdn;
+ }
+ TAILQ_INSERT_TAIL(&rdn->rd_list, rdna, ra_next);
+ }
+
+ makeentry(entbuf, sizeof(entbuf), i, "rdnssltime");
+ MAYHAVE(val, entbuf, (rai->rai_maxinterval * 3 / 2));
+ if ((u_int)val < rai->rai_maxinterval ||
+ (u_int)val > rai->rai_maxinterval * 2) {
+ syslog(LOG_ERR, "%s (%ld) on %s is invalid "
+ "(must be between %d and %d)",
+ entbuf, val, intface, rai->rai_maxinterval,
+ rai->rai_maxinterval * 2);
+ goto getconfig_free_rdn;
+ }
+ rdn->rd_ltime = val;
+
+ /* link into chain */
+ TAILQ_INSERT_TAIL(&rai->rai_rdnss, rdn, rd_next);
+ continue;
+getconfig_free_rdn:
+ while ((rdna = TAILQ_FIRST(&rdn->rd_list)) != NULL) {
+ TAILQ_REMOVE(&rdn->rd_list, rdna, ra_next);
+ free(rdna);
+ }
+ free(rdn);
+ }
+
+ for (i = -1; i < MAXDNSSLENT ; i++) {
+ struct dnssl *dns;
+ struct dnssl_addr *dnsa;
+ char *ap;
+ int c;
+
+ makeentry(entbuf, sizeof(entbuf), i, "dnssl");
+ addr = (char *)agetstr(entbuf, &bp);
+ if (addr == NULL)
+ break;
+
+ ELM_MALLOC(dns, exit(1));
+
+ TAILQ_INIT(&dns->dn_list);
+
+ for (ap = addr; ap - addr < (ssize_t)strlen(addr); ap += c+1) {
+ c = strcspn(ap, ",");
+ strncpy(abuf, ap, c);
+ abuf[c] = '\0';
+ ELM_MALLOC(dnsa, goto getconfig_free_dns);
+ dnsa->da_len = dname_labelenc(dnsa->da_dom, abuf);
+ syslog(LOG_DEBUG, "<%s>: dnsa->da_len = %d", __func__,
+ dnsa->da_len);
+ TAILQ_INSERT_TAIL(&dns->dn_list, dnsa, da_next);
+ }
- /* okey */
- tmp->next = ralist;
- ralist = tmp;
+ makeentry(entbuf, sizeof(entbuf), i, "dnsslltime");
+ MAYHAVE(val, entbuf, (rai->rai_maxinterval * 3 / 2));
+ if ((u_int)val < rai->rai_maxinterval ||
+ (u_int)val > rai->rai_maxinterval * 2) {
+ syslog(LOG_ERR, "%s (%ld) on %s is invalid "
+ "(must be between %d and %d)",
+ entbuf, val, intface, rai->rai_maxinterval,
+ rai->rai_maxinterval * 2);
+ goto getconfig_free_dns;
+ }
+ dns->dn_ltime = val;
+ /* link into chain */
+ TAILQ_INSERT_TAIL(&rai->rai_dnssl, dns, dn_next);
+ continue;
+getconfig_free_dns:
+ while ((dnsa = TAILQ_FIRST(&dns->dn_list)) != NULL) {
+ TAILQ_REMOVE(&dns->dn_list, dnsa, da_next);
+ free(dnsa);
+ }
+ free(dns);
+ }
/* construct the sending packet */
- make_packet(tmp);
+ make_packet(rai);
+
+ /*
+ * If an entry with the same ifindex exists, remove it first.
+ * Before the removal, RDNSS and DNSSL options with
+ * zero-lifetime will be sent.
+ */
+ if (rai_old != NULL) {
+ const int retrans = MAX_FINAL_RTR_ADVERTISEMENTS;
+ struct rdnss *rdn;
+ struct dnssl *dns;
+
+ rai_old->rai_lifetime = 0;
+ TAILQ_FOREACH(rdn, &rai_old->rai_rdnss, rd_next)
+ rdn->rd_ltime = 0;
+ TAILQ_FOREACH(dns, &rai_old->rai_dnssl, dn_next)
+ dns->dn_ltime = 0;
+
+ make_packet(rai_old);
+ for (i = 0; i < retrans; i++) {
+ ra_output(rai_old);
+ sleep(MIN_DELAY_BETWEEN_RAS);
+ }
+ rmconfig(idx);
+ }
+ TAILQ_INSERT_TAIL(&railist, rai, rai_next);
/* set timer */
- tmp->timer = rtadvd_add_timer(ra_timeout, ra_timer_update,
- tmp, tmp);
- ra_timer_update((void *)tmp, &tmp->timer->tm);
- rtadvd_set_timer(&tmp->timer->tm, tmp->timer);
+ rai->rai_timer = rtadvd_add_timer(ra_timeout, ra_timer_update,
+ rai, rai);
+ ra_timer_update((void *)rai, &rai->rai_timer->rat_tm);
+ rtadvd_set_timer(&rai->rai_timer->rat_tm, rai->rai_timer);
+
+ return (0);
+getconfig_free_rai:
+ free(rai);
+ return (-1);
}
void
get_prefix(struct rainfo *rai)
{
struct ifaddrs *ifap, *ifa;
- struct prefix *pp;
+ struct prefix *pfx;
struct in6_addr *a;
u_char *p, *ep, *m, *lim;
u_char ntopbuf[INET6_ADDRSTRLEN];
if (getifaddrs(&ifap) < 0) {
syslog(LOG_ERR,
- "<%s> can't get interface addresses",
- __func__);
+ "<%s> can't get interface addresses",
+ __func__);
exit(1);
}
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
int plen;
- if (strcmp(ifa->ifa_name, rai->ifname) != 0)
+ if (strcmp(ifa->ifa_name, rai->rai_ifname) != 0)
continue;
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
@@ -631,8 +880,8 @@ get_prefix(struct rainfo *rai)
plen = prefixlen(m, lim);
if (plen <= 0 || plen > 128) {
syslog(LOG_ERR, "<%s> failed to get prefixlen "
- "or prefix is invalid",
- __func__);
+ "or prefix is invalid",
+ __func__);
exit(1);
}
if (plen == 128) /* XXX */
@@ -643,56 +892,46 @@ get_prefix(struct rainfo *rai)
}
/* allocate memory to store prefix info. */
- if ((pp = malloc(sizeof(*pp))) == NULL) {
- syslog(LOG_ERR,
- "<%s> can't get allocate buffer for prefix",
- __func__);
- exit(1);
- }
- memset(pp, 0, sizeof(*pp));
+ ELM_MALLOC(pfx, exit(1));
/* set prefix, sweep bits outside of prefixlen */
- pp->prefixlen = plen;
- memcpy(&pp->prefix, a, sizeof(*a));
- p = (u_char *)&pp->prefix;
- ep = (u_char *)(&pp->prefix + 1);
+ pfx->pfx_prefixlen = plen;
+ memcpy(&pfx->pfx_prefix, a, sizeof(*a));
+ p = (u_char *)&pfx->pfx_prefix;
+ ep = (u_char *)(&pfx->pfx_prefix + 1);
while (m < lim && p < ep)
*p++ &= *m++;
while (p < ep)
*p++ = 0x00;
- if (!inet_ntop(AF_INET6, &pp->prefix, ntopbuf,
+ if (!inet_ntop(AF_INET6, &pfx->pfx_prefix, ntopbuf,
sizeof(ntopbuf))) {
syslog(LOG_ERR, "<%s> inet_ntop failed", __func__);
exit(1);
}
syslog(LOG_DEBUG,
- "<%s> add %s/%d to prefix list on %s",
- __func__, ntopbuf, pp->prefixlen, rai->ifname);
+ "<%s> add %s/%d to prefix list on %s",
+ __func__, ntopbuf, pfx->pfx_prefixlen, rai->rai_ifname);
/* set other fields with protocol defaults */
- pp->validlifetime = DEF_ADVVALIDLIFETIME;
- pp->preflifetime = DEF_ADVPREFERREDLIFETIME;
- pp->onlinkflg = 1;
- pp->autoconfflg = 1;
- pp->origin = PREFIX_FROM_KERNEL;
- pp->rainfo = rai;
+ pfx->pfx_validlifetime = DEF_ADVVALIDLIFETIME;
+ pfx->pfx_preflifetime = DEF_ADVPREFERREDLIFETIME;
+ pfx->pfx_onlinkflg = 1;
+ pfx->pfx_autoconfflg = 1;
+ pfx->pfx_origin = PREFIX_FROM_KERNEL;
+ pfx->pfx_rainfo = rai;
/* link into chain */
- insque(pp, &rai->prefix);
+ TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next);
/* counter increment */
- rai->pfxs++;
+ rai->rai_pfxs++;
}
freeifaddrs(ifap);
}
static void
-makeentry(buf, len, id, string)
- char *buf;
- size_t len;
- int id;
- char *string;
+makeentry(char *buf, size_t len, int id, const char *string)
{
if (id < 0)
@@ -711,37 +950,28 @@ makeentry(buf, len, id, string)
static void
add_prefix(struct rainfo *rai, struct in6_prefixreq *ipr)
{
- struct prefix *prefix;
+ struct prefix *pfx;
u_char ntopbuf[INET6_ADDRSTRLEN];
- if ((prefix = malloc(sizeof(*prefix))) == NULL) {
- syslog(LOG_ERR, "<%s> memory allocation failed",
- __func__);
- return; /* XXX: error or exit? */
- }
- memset(prefix, 0, sizeof(*prefix));
- prefix->prefix = ipr->ipr_prefix.sin6_addr;
- prefix->prefixlen = ipr->ipr_plen;
- prefix->validlifetime = ipr->ipr_vltime;
- prefix->preflifetime = ipr->ipr_pltime;
- prefix->onlinkflg = ipr->ipr_raf_onlink;
- prefix->autoconfflg = ipr->ipr_raf_auto;
- prefix->origin = PREFIX_FROM_DYNAMIC;
-
- insque(prefix, &rai->prefix);
- prefix->rainfo = rai;
+ ELM_MALLOC(pfx, return);
+ pfx->pfx_prefix = ipr->ipr_prefix.sin6_addr;
+ pfx->pfx_prefixlen = ipr->ipr_plen;
+ pfx->pfx_validlifetime = ipr->ipr_vltime;
+ pfx->pfx_preflifetime = ipr->ipr_pltime;
+ pfx->pfx_onlinkflg = ipr->ipr_raf_onlink;
+ pfx->pfx_autoconfflg = ipr->ipr_raf_auto;
+ pfx->pfx_origin = PREFIX_FROM_DYNAMIC;
- syslog(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s",
- __func__, inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- ipr->ipr_plen, rai->ifname);
+ TAILQ_INSERT_TAIL(&rai->rai_prefix, pfx, pfx_next);
+ pfx->pfx_rainfo = rai;
- /* free the previous packet */
- free(rai->ra_data);
- rai->ra_data = NULL;
+ syslog(LOG_DEBUG, "<%s> new prefix %s/%d was added on %s",
+ __func__,
+ inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), ipr->ipr_plen, rai->rai_ifname);
/* reconstruct the packet */
- rai->pfxs++;
+ rai->rai_pfxs++;
make_packet(rai);
}
@@ -751,30 +981,33 @@ add_prefix(struct rainfo *rai, struct in6_prefixreq *ipr)
* The prefix must be in the list.
*/
void
-delete_prefix(struct prefix *prefix)
+delete_prefix(struct prefix *pfx)
{
u_char ntopbuf[INET6_ADDRSTRLEN];
- struct rainfo *rai = prefix->rainfo;
+ struct rainfo *rai;
- remque(prefix);
+ rai = pfx->pfx_rainfo;
+ TAILQ_REMOVE(&rai->rai_prefix, pfx, pfx_next);
syslog(LOG_DEBUG, "<%s> prefix %s/%d was deleted on %s",
- __func__, inet_ntop(AF_INET6, &prefix->prefix,
- ntopbuf, INET6_ADDRSTRLEN),
- prefix->prefixlen, rai->ifname);
- if (prefix->timer)
- rtadvd_remove_timer(&prefix->timer);
- free(prefix);
- rai->pfxs--;
+ __func__,
+ inet_ntop(AF_INET6, &pfx->pfx_prefix, ntopbuf,
+ sizeof(ntopbuf)), pfx->pfx_prefixlen, rai->rai_ifname);
+ if (pfx->pfx_timer)
+ rtadvd_remove_timer(pfx->pfx_timer);
+ free(pfx);
+ rai->rai_pfxs--;
+ make_packet(rai);
}
void
-invalidate_prefix(struct prefix *prefix)
+invalidate_prefix(struct prefix *pfx)
{
u_char ntopbuf[INET6_ADDRSTRLEN];
struct timeval timo;
- struct rainfo *rai = prefix->rainfo;
+ struct rainfo *rai;
- if (prefix->timer) { /* sanity check */
+ rai = pfx->pfx_rainfo;
+ if (pfx->pfx_timer) { /* sanity check */
syslog(LOG_ERR,
"<%s> assumption failure: timer already exists",
__func__);
@@ -783,38 +1016,38 @@ invalidate_prefix(struct prefix *prefix)
syslog(LOG_DEBUG, "<%s> prefix %s/%d was invalidated on %s, "
"will expire in %ld seconds", __func__,
- inet_ntop(AF_INET6, &prefix->prefix, ntopbuf, INET6_ADDRSTRLEN),
- prefix->prefixlen, rai->ifname, (long)prefix_timo);
+ inet_ntop(AF_INET6, &pfx->pfx_prefix, ntopbuf, sizeof(ntopbuf)),
+ pfx->pfx_prefixlen, rai->rai_ifname, (long)prefix_timo);
/* set the expiration timer */
- prefix->timer = rtadvd_add_timer(prefix_timeout, NULL, prefix, NULL);
- if (prefix->timer == NULL) {
+ pfx->pfx_timer = rtadvd_add_timer(prefix_timeout, NULL, pfx, NULL);
+ if (pfx->pfx_timer == NULL) {
syslog(LOG_ERR, "<%s> failed to add a timer for a prefix. "
"remove the prefix", __func__);
- delete_prefix(prefix);
+ delete_prefix(pfx);
}
timo.tv_sec = prefix_timo;
timo.tv_usec = 0;
- rtadvd_set_timer(&timo, prefix->timer);
+ rtadvd_set_timer(&timo, pfx->pfx_timer);
}
static struct rtadvd_timer *
prefix_timeout(void *arg)
{
- struct prefix *prefix = (struct prefix *)arg;
-
- delete_prefix(prefix);
- return(NULL);
+ delete_prefix((struct prefix *)arg);
+
+ return (NULL);
}
void
-update_prefix(struct prefix * prefix)
+update_prefix(struct prefix *pfx)
{
u_char ntopbuf[INET6_ADDRSTRLEN];
- struct rainfo *rai = prefix->rainfo;
+ struct rainfo *rai;
- if (prefix->timer == NULL) { /* sanity check */
+ rai = pfx->pfx_rainfo;
+ if (pfx->pfx_timer == NULL) { /* sanity check */
syslog(LOG_ERR,
"<%s> assumption failure: timer does not exist",
__func__);
@@ -822,11 +1055,12 @@ update_prefix(struct prefix * prefix)
}
syslog(LOG_DEBUG, "<%s> prefix %s/%d was re-enabled on %s",
- __func__, inet_ntop(AF_INET6, &prefix->prefix, ntopbuf,
- INET6_ADDRSTRLEN), prefix->prefixlen, rai->ifname);
+ __func__, inet_ntop(AF_INET6, &pfx->pfx_prefix, ntopbuf,
+ sizeof(ntopbuf)), pfx->pfx_prefixlen, rai->rai_ifname);
/* stop the expiration timer */
- rtadvd_remove_timer(&prefix->timer);
+ rtadvd_remove_timer(pfx->pfx_timer);
+ pfx->pfx_timer = NULL;
}
/*
@@ -842,13 +1076,13 @@ init_prefix(struct in6_prefixreq *ipr)
if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
syslog(LOG_ERR, "<%s> socket: %s", __func__,
- strerror(errno));
+ strerror(errno));
exit(1);
}
if (ioctl(s, SIOCGIFPREFIX_IN6, (caddr_t)ipr) < 0) {
syslog(LOG_INFO, "<%s> ioctl:SIOCGIFPREFIX %s", __func__,
- strerror(errno));
+ strerror(errno));
ipr->ipr_vltime = DEF_ADVVALIDLIFETIME;
ipr->ipr_pltime = DEF_ADVPREFERREDLIFETIME;
@@ -860,22 +1094,22 @@ init_prefix(struct in6_prefixreq *ipr)
u_char ntopbuf[INET6_ADDRSTRLEN];
syslog(LOG_WARNING, "<%s> Added prefix(%s)'s origin %d is"
- "lower than PR_ORIG_RR(router renumbering)."
- "This should not happen if I am router", __func__,
- inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf,
- sizeof(ntopbuf)), ipr->ipr_origin);
+ "lower than PR_ORIG_RR(router renumbering)."
+ "This should not happen if I am router", __func__,
+ inet_ntop(AF_INET6, &ipr->ipr_prefix.sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), ipr->ipr_origin);
close(s);
- return 1;
+ return (1);
}
close(s);
- return 0;
+ return (0);
#else
ipr->ipr_vltime = DEF_ADVVALIDLIFETIME;
ipr->ipr_pltime = DEF_ADVPREFERREDLIFETIME;
ipr->ipr_raf_onlink = 1;
ipr->ipr_raf_auto = 1;
- return 0;
+ return (0);
#endif
}
@@ -887,8 +1121,8 @@ make_prefix(struct rainfo *rai, int ifindex, struct in6_addr *addr, int plen)
memset(&ipr, 0, sizeof(ipr));
if (if_indextoname(ifindex, ipr.ipr_name) == NULL) {
syslog(LOG_ERR, "<%s> Prefix added interface No.%d doesn't"
- "exist. This should not happen! %s", __func__,
- ifindex, strerror(errno));
+ "exist. This should not happen! %s", __func__,
+ ifindex, strerror(errno));
exit(1);
}
ipr.ipr_prefix.sin6_len = sizeof(ipr.ipr_prefix);
@@ -902,7 +1136,7 @@ make_prefix(struct rainfo *rai, int ifindex, struct in6_addr *addr, int plen)
}
void
-make_packet(struct rainfo *rainfo)
+make_packet(struct rainfo *rai)
{
size_t packlen, lladdroptlen = 0;
char *buf;
@@ -913,45 +1147,68 @@ make_packet(struct rainfo *rainfo)
struct nd_opt_route_info *ndopt_rti;
struct rtinfo *rti;
#endif
+ struct nd_opt_rdnss *ndopt_rdnss;
+ struct rdnss *rdn;
+ struct nd_opt_dnssl *ndopt_dnssl;
+ struct dnssl *dns;
+ size_t len;
struct prefix *pfx;
/* calculate total length */
packlen = sizeof(struct nd_router_advert);
- if (rainfo->advlinkopt) {
- if ((lladdroptlen = lladdropt_length(rainfo->sdl)) == 0) {
+ if (rai->rai_advlinkopt) {
+ if ((lladdroptlen = lladdropt_length(rai->rai_sdl)) == 0) {
syslog(LOG_INFO,
- "<%s> link-layer address option has"
- " null length on %s. Treat as not included.",
- __func__, rainfo->ifname);
- rainfo->advlinkopt = 0;
+ "<%s> link-layer address option has"
+ " null length on %s. Treat as not included.",
+ __func__, rai->rai_ifname);
+ rai->rai_advlinkopt = 0;
}
packlen += lladdroptlen;
}
- if (rainfo->pfxs)
- packlen += sizeof(struct nd_opt_prefix_info) * rainfo->pfxs;
- if (rainfo->linkmtu)
+ if (rai->rai_pfxs)
+ packlen += sizeof(struct nd_opt_prefix_info) * rai->rai_pfxs;
+ if (rai->rai_linkmtu)
packlen += sizeof(struct nd_opt_mtu);
#ifdef ROUTEINFO
- for (rti = rainfo->route.next; rti != &rainfo->route; rti = rti->next)
- packlen += sizeof(struct nd_opt_route_info) +
- ((rti->prefixlen + 0x3f) >> 6) * 8;
+ TAILQ_FOREACH(rti, &rai->rai_route, rti_next)
+ packlen += sizeof(struct nd_opt_route_info) +
+ ((rti->rti_prefixlen + 0x3f) >> 6) * 8;
#endif
+ TAILQ_FOREACH(rdn, &rai->rai_rdnss, rd_next) {
+ struct rdnss_addr *rdna;
+
+ packlen += sizeof(struct nd_opt_rdnss);
+ TAILQ_FOREACH(rdna, &rdn->rd_list, ra_next)
+ packlen += sizeof(rdna->ra_dns);
+ }
+ TAILQ_FOREACH(dns, &rai->rai_dnssl, dn_next) {
+ struct dnssl_addr *dnsa;
+
+ packlen += sizeof(struct nd_opt_dnssl);
+ len = 0;
+ TAILQ_FOREACH(dnsa, &dns->dn_list, da_next)
+ len += dnsa->da_len;
+ /* A zero octet and 8 octet boundary */
+ len++;
+ len += (len % 8) ? 8 - len % 8 : 0;
+
+ packlen += len;
+ }
/* allocate memory for the packet */
if ((buf = malloc(packlen)) == NULL) {
syslog(LOG_ERR,
- "<%s> can't get enough memory for an RA packet",
- __func__);
+ "<%s> can't get enough memory for an RA packet",
+ __func__);
exit(1);
}
- if (rainfo->ra_data) {
- /* free the previous packet */
- free(rainfo->ra_data);
- rainfo->ra_data = NULL;
- }
- rainfo->ra_data = buf;
+ memset(buf, 0, packlen);
+ if (rai->rai_ra_data) /* Free old data if any. */
+ free(rai->rai_ra_data);
+ rai->rai_ra_data = buf;
/* XXX: what if packlen > 576? */
- rainfo->ra_datalen = packlen;
+ rai->rai_ra_datalen = packlen;
/*
* construct the packet
@@ -960,71 +1217,70 @@ make_packet(struct rainfo *rainfo)
ra->nd_ra_type = ND_ROUTER_ADVERT;
ra->nd_ra_code = 0;
ra->nd_ra_cksum = 0;
- ra->nd_ra_curhoplimit = (u_int8_t)(0xff & rainfo->hoplimit);
+ ra->nd_ra_curhoplimit = (u_int8_t)(0xff & rai->rai_hoplimit);
ra->nd_ra_flags_reserved = 0; /* just in case */
/*
* XXX: the router preference field, which is a 2-bit field, should be
* initialized before other fields.
*/
- ra->nd_ra_flags_reserved = 0xff & rainfo->rtpref;
+ ra->nd_ra_flags_reserved = 0xff & rai->rai_rtpref;
ra->nd_ra_flags_reserved |=
- rainfo->managedflg ? ND_RA_FLAG_MANAGED : 0;
+ rai->rai_managedflg ? ND_RA_FLAG_MANAGED : 0;
ra->nd_ra_flags_reserved |=
- rainfo->otherflg ? ND_RA_FLAG_OTHER : 0;
- ra->nd_ra_router_lifetime = htons(rainfo->lifetime);
- ra->nd_ra_reachable = htonl(rainfo->reachabletime);
- ra->nd_ra_retransmit = htonl(rainfo->retranstimer);
+ rai->rai_otherflg ? ND_RA_FLAG_OTHER : 0;
+ ra->nd_ra_router_lifetime = htons(rai->rai_lifetime);
+ ra->nd_ra_reachable = htonl(rai->rai_reachabletime);
+ ra->nd_ra_retransmit = htonl(rai->rai_retranstimer);
buf += sizeof(*ra);
- if (rainfo->advlinkopt) {
- lladdropt_fill(rainfo->sdl, (struct nd_opt_hdr *)buf);
+ if (rai->rai_advlinkopt) {
+ lladdropt_fill(rai->rai_sdl, (struct nd_opt_hdr *)buf);
buf += lladdroptlen;
}
- if (rainfo->linkmtu) {
+ if (rai->rai_linkmtu) {
ndopt_mtu = (struct nd_opt_mtu *)buf;
ndopt_mtu->nd_opt_mtu_type = ND_OPT_MTU;
ndopt_mtu->nd_opt_mtu_len = 1;
ndopt_mtu->nd_opt_mtu_reserved = 0;
- ndopt_mtu->nd_opt_mtu_mtu = htonl(rainfo->linkmtu);
+ ndopt_mtu->nd_opt_mtu_mtu = htonl(rai->rai_linkmtu);
buf += sizeof(struct nd_opt_mtu);
}
- for (pfx = rainfo->prefix.next;
- pfx != &rainfo->prefix; pfx = pfx->next) {
+ TAILQ_FOREACH(pfx, &rai->rai_prefix, pfx_next) {
u_int32_t vltime, pltime;
struct timeval now;
ndopt_pi = (struct nd_opt_prefix_info *)buf;
ndopt_pi->nd_opt_pi_type = ND_OPT_PREFIX_INFORMATION;
ndopt_pi->nd_opt_pi_len = 4;
- ndopt_pi->nd_opt_pi_prefix_len = pfx->prefixlen;
+ ndopt_pi->nd_opt_pi_prefix_len = pfx->pfx_prefixlen;
ndopt_pi->nd_opt_pi_flags_reserved = 0;
- if (pfx->onlinkflg)
+ if (pfx->pfx_onlinkflg)
ndopt_pi->nd_opt_pi_flags_reserved |=
ND_OPT_PI_FLAG_ONLINK;
- if (pfx->autoconfflg)
+ if (pfx->pfx_autoconfflg)
ndopt_pi->nd_opt_pi_flags_reserved |=
ND_OPT_PI_FLAG_AUTO;
- if (pfx->timer)
+ if (pfx->pfx_timer)
vltime = 0;
else {
- if (pfx->vltimeexpire || pfx->pltimeexpire)
+ if (pfx->pfx_vltimeexpire || pfx->pfx_pltimeexpire)
gettimeofday(&now, NULL);
- if (pfx->vltimeexpire == 0)
- vltime = pfx->validlifetime;
+ if (pfx->pfx_vltimeexpire == 0)
+ vltime = pfx->pfx_validlifetime;
else
- vltime = (pfx->vltimeexpire > now.tv_sec) ?
- pfx->vltimeexpire - now.tv_sec : 0;
+ vltime = (pfx->pfx_vltimeexpire > now.tv_sec) ?
+ pfx->pfx_vltimeexpire - now.tv_sec : 0;
}
- if (pfx->timer)
+ if (pfx->pfx_timer)
pltime = 0;
else {
- if (pfx->pltimeexpire == 0)
- pltime = pfx->preflifetime;
+ if (pfx->pfx_pltimeexpire == 0)
+ pltime = pfx->pfx_preflifetime;
else
- pltime = (pfx->pltimeexpire > now.tv_sec) ?
- pfx->pltimeexpire - now.tv_sec : 0;
+ pltime = (pfx->pfx_pltimeexpire > now.tv_sec) ?
+ pfx->pfx_pltimeexpire - now.tv_sec : 0;
}
if (vltime < pltime) {
/*
@@ -1036,45 +1292,72 @@ make_packet(struct rainfo *rainfo)
ndopt_pi->nd_opt_pi_valid_time = htonl(vltime);
ndopt_pi->nd_opt_pi_preferred_time = htonl(pltime);
ndopt_pi->nd_opt_pi_reserved2 = 0;
- ndopt_pi->nd_opt_pi_prefix = pfx->prefix;
+ ndopt_pi->nd_opt_pi_prefix = pfx->pfx_prefix;
buf += sizeof(struct nd_opt_prefix_info);
}
#ifdef ROUTEINFO
- for (rti = rainfo->route.next; rti != &rainfo->route; rti = rti->next) {
- u_int8_t psize = (rti->prefixlen + 0x3f) >> 6;
+ TAILQ_FOREACH(rti, &rai->rai_route, rti_next) {
+ u_int8_t psize = (rti->rti_prefixlen + 0x3f) >> 6;
ndopt_rti = (struct nd_opt_route_info *)buf;
ndopt_rti->nd_opt_rti_type = ND_OPT_ROUTE_INFO;
ndopt_rti->nd_opt_rti_len = 1 + psize;
- ndopt_rti->nd_opt_rti_prefixlen = rti->prefixlen;
- ndopt_rti->nd_opt_rti_flags = 0xff & rti->rtpref;
- ndopt_rti->nd_opt_rti_lifetime = htonl(rti->ltime);
- memcpy(ndopt_rti + 1, &rti->prefix, psize * 8);
+ ndopt_rti->nd_opt_rti_prefixlen = rti->rti_prefixlen;
+ ndopt_rti->nd_opt_rti_flags = 0xff & rti->rti_rtpref;
+ ndopt_rti->nd_opt_rti_lifetime = htonl(rti->rti_ltime);
+ memcpy(ndopt_rti + 1, &rti->rti_prefix, psize * 8);
buf += sizeof(struct nd_opt_route_info) + psize * 8;
}
#endif
+ TAILQ_FOREACH(rdn, &rai->rai_rdnss, rd_next) {
+ struct rdnss_addr *rdna;
+
+ ndopt_rdnss = (struct nd_opt_rdnss *)buf;
+ ndopt_rdnss->nd_opt_rdnss_type = ND_OPT_RDNSS;
+ ndopt_rdnss->nd_opt_rdnss_len = 0;
+ ndopt_rdnss->nd_opt_rdnss_reserved = 0;
+ ndopt_rdnss->nd_opt_rdnss_lifetime = htonl(rdn->rd_ltime);
+ buf += sizeof(struct nd_opt_rdnss);
+
+ TAILQ_FOREACH(rdna, &rdn->rd_list, ra_next) {
+ memcpy(buf, &rdna->ra_dns, sizeof(rdna->ra_dns));
+ buf += sizeof(rdna->ra_dns);
+ }
+ /* Length field should be in 8 octets */
+ ndopt_rdnss->nd_opt_rdnss_len = (buf - (char *)ndopt_rdnss) / 8;
- return;
-}
+ syslog(LOG_DEBUG, "<%s>: nd_opt_dnss_len = %d", __func__,
+ ndopt_rdnss->nd_opt_rdnss_len);
+ }
+ TAILQ_FOREACH(dns, &rai->rai_dnssl, dn_next) {
+ struct dnssl_addr *dnsa;
+
+ ndopt_dnssl = (struct nd_opt_dnssl *)buf;
+ ndopt_dnssl->nd_opt_dnssl_type = ND_OPT_DNSSL;
+ ndopt_dnssl->nd_opt_dnssl_len = 0;
+ ndopt_dnssl->nd_opt_dnssl_reserved = 0;
+ ndopt_dnssl->nd_opt_dnssl_lifetime = htonl(dns->dn_ltime);
+ buf += sizeof(*ndopt_dnssl);
+
+ TAILQ_FOREACH(dnsa, &dns->dn_list, da_next) {
+ memcpy(buf, dnsa->da_dom, dnsa->da_len);
+ buf += dnsa->da_len;
+ }
-static int
-getinet6sysctl(int code)
-{
- int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 };
- int value;
- size_t size;
-
- mib[3] = code;
- size = sizeof(value);
- if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &value, &size, NULL, 0)
- < 0) {
- syslog(LOG_ERR, "<%s>: failed to get ip6 sysctl(%d): %s",
- __func__, code,
- strerror(errno));
- return(-1);
+ /* A zero octet after encoded DNS server list. */
+ *buf++ = '\0';
+
+ /* Padding to next 8 octets boundary */
+ len = buf - (char *)ndopt_dnssl;
+ len += (len % 8) ? 8 - len % 8 : 0;
+
+ /* Length field must be in 8 octets */
+ ndopt_dnssl->nd_opt_dnssl_len = len / 8;
+
+ syslog(LOG_DEBUG, "<%s>: nd_opt_dnssl_len = %d", __func__,
+ ndopt_dnssl->nd_opt_dnssl_len);
}
- else
- return(value);
+ return;
}
diff --git a/usr.sbin/rtadvd/config.h b/usr.sbin/rtadvd/config.h
index 2d02b8a..01886a6 100644
--- a/usr.sbin/rtadvd/config.h
+++ b/usr.sbin/rtadvd/config.h
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -30,7 +30,9 @@
* SUCH DAMAGE.
*/
-extern void getconfig(char *);
+extern int getconfig(int);
+extern int rmconfig(int);
+extern int loadconfig(char *[], const int);
extern void delete_prefix(struct prefix *);
extern void invalidate_prefix(struct prefix *);
extern void update_prefix(struct prefix *);
@@ -45,3 +47,5 @@ extern void get_prefix(struct rainfo *);
*/
#define MAXPREFIX 100
#define MAXROUTE 100
+#define MAXRDNSSENT 100
+#define MAXDNSSLENT 100
diff --git a/usr.sbin/rtadvd/dump.c b/usr.sbin/rtadvd/dump.c
index d37f5db..fac3fb2 100644
--- a/usr.sbin/rtadvd/dump.c
+++ b/usr.sbin/rtadvd/dump.c
@@ -4,7 +4,7 @@
/*
* Copyright (C) 2000 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -45,6 +45,7 @@
#include <arpa/inet.h>
+#include <netdb.h>
#include <time.h>
#include <stdio.h>
#include <stdarg.h>
@@ -63,8 +64,9 @@ extern struct rainfo *ralist;
static char *ether_str(struct sockaddr_dl *);
static void if_dump(void);
+static size_t dname_labeldec(char *, size_t, const char *);
-static char *rtpref_str[] = {
+static const char *rtpref_str[] = {
"medium", /* 00 */
"high", /* 01 */
"rsv", /* 10 */
@@ -72,8 +74,7 @@ static char *rtpref_str[] = {
};
static char *
-ether_str(sdl)
- struct sockaddr_dl *sdl;
+ether_str(struct sockaddr_dl *sdl)
{
static char hbuf[32];
u_char *cp;
@@ -85,84 +86,86 @@ ether_str(sdl)
} else
snprintf(hbuf, sizeof(hbuf), "NONE");
- return(hbuf);
+ return (hbuf);
}
static void
-if_dump()
+if_dump(void)
{
struct rainfo *rai;
struct prefix *pfx;
#ifdef ROUTEINFO
struct rtinfo *rti;
#endif
+ struct rdnss *rdn;
+ struct dnssl *dns;
char prefixbuf[INET6_ADDRSTRLEN];
- int first;
struct timeval now;
gettimeofday(&now, NULL); /* XXX: unused in most cases */
- for (rai = ralist; rai; rai = rai->next) {
- fprintf(fp, "%s:\n", rai->ifname);
+ TAILQ_FOREACH(rai, &railist, rai_next) {
+ fprintf(fp, "%s:\n", rai->rai_ifname);
fprintf(fp, " Status: %s\n",
- (iflist[rai->ifindex]->ifm_flags & IFF_UP) ? "UP" :
- "DOWN");
+ (iflist[rai->rai_ifindex]->ifm_flags & IFF_UP) ? "UP" :
+ "DOWN");
/* control information */
- if (rai->lastsent.tv_sec) {
+ if (rai->rai_lastsent.tv_sec) {
/* note that ctime() appends CR by itself */
fprintf(fp, " Last RA sent: %s",
- ctime((time_t *)&rai->lastsent.tv_sec));
+ ctime((time_t *)&rai->rai_lastsent.tv_sec));
}
- if (rai->timer) {
+ if (rai->rai_timer)
fprintf(fp, " Next RA will be sent: %s",
- ctime((time_t *)&rai->timer->tm.tv_sec));
- }
+ ctime((time_t *)&rai->rai_timer->rat_tm.tv_sec));
else
fprintf(fp, " RA timer is stopped");
fprintf(fp, " waits: %d, initcount: %d\n",
- rai->waiting, rai->initcounter);
+ rai->rai_waiting, rai->rai_initcounter);
/* statistics */
fprintf(fp, " statistics: RA(out/in/inconsistent): "
"%llu/%llu/%llu, ",
- (unsigned long long)rai->raoutput,
- (unsigned long long)rai->rainput,
- (unsigned long long)rai->rainconsistent);
+ (unsigned long long)rai->rai_raoutput,
+ (unsigned long long)rai->rai_rainput,
+ (unsigned long long)rai->rai_rainconsistent);
fprintf(fp, "RS(input): %llu\n",
- (unsigned long long)rai->rsinput);
+ (unsigned long long)rai->rai_rsinput);
/* interface information */
- if (rai->advlinkopt)
+ if (rai->rai_advlinkopt)
fprintf(fp, " Link-layer address: %s\n",
- ether_str(rai->sdl));
- fprintf(fp, " MTU: %d\n", rai->phymtu);
+ ether_str(rai->rai_sdl));
+ fprintf(fp, " MTU: %d\n", rai->rai_phymtu);
/* Router configuration variables */
fprintf(fp, " DefaultLifetime: %d, MaxAdvInterval: %d, "
- "MinAdvInterval: %d\n", rai->lifetime, rai->maxinterval,
- rai->mininterval);
- fprintf(fp, " Flags: %s%s%s, ",
- rai->managedflg ? "M" : "", rai->otherflg ? "O" : "", "");
+ "MinAdvInterval: %d\n", rai->rai_lifetime,
+ rai->rai_maxinterval, rai->rai_mininterval);
+ fprintf(fp, " Flags: ");
+ if (rai->rai_managedflg || rai->rai_otherflg) {
+ fprintf(fp, "%s", rai->rai_managedflg ? "M" : "");
+ fprintf(fp, "%s", rai->rai_otherflg ? "O" : "");
+ } else
+ fprintf(fp, "<none>");
+ fprintf(fp, ", ");
fprintf(fp, "Preference: %s, ",
- rtpref_str[(rai->rtpref >> 3) & 0xff]);
- fprintf(fp, "MTU: %d\n", rai->linkmtu);
+ rtpref_str[(rai->rai_rtpref >> 3) & 0xff]);
+ fprintf(fp, "MTU: %d\n", rai->rai_linkmtu);
fprintf(fp, " ReachableTime: %d, RetransTimer: %d, "
- "CurHopLimit: %d\n", rai->reachabletime,
- rai->retranstimer, rai->hoplimit);
- if (rai->clockskew)
+ "CurHopLimit: %d\n", rai->rai_reachabletime,
+ rai->rai_retranstimer, rai->rai_hoplimit);
+ if (rai->rai_clockskew)
fprintf(fp, " Clock skew: %ldsec\n",
- rai->clockskew);
- for (first = 1, pfx = rai->prefix.next; pfx != &rai->prefix;
- pfx = pfx->next) {
- if (first) {
+ rai->rai_clockskew);
+ TAILQ_FOREACH(pfx, &rai->rai_prefix, pfx_next) {
+ if (pfx == TAILQ_FIRST(&rai->rai_prefix))
fprintf(fp, " Prefixes:\n");
- first = 0;
- }
fprintf(fp, " %s/%d(",
- inet_ntop(AF_INET6, &pfx->prefix, prefixbuf,
- sizeof(prefixbuf)), pfx->prefixlen);
- switch (pfx->origin) {
+ inet_ntop(AF_INET6, &pfx->pfx_prefix, prefixbuf,
+ sizeof(prefixbuf)), pfx->pfx_prefixlen);
+ switch (pfx->pfx_origin) {
case PREFIX_FROM_KERNEL:
fprintf(fp, "KERNEL, ");
break;
@@ -173,36 +176,42 @@ if_dump()
fprintf(fp, "DYNAMIC, ");
break;
}
- if (pfx->validlifetime == ND6_INFINITE_LIFETIME)
+ if (pfx->pfx_validlifetime == ND6_INFINITE_LIFETIME)
fprintf(fp, "vltime: infinity");
else
fprintf(fp, "vltime: %ld",
- (long)pfx->validlifetime);
- if (pfx->vltimeexpire != 0)
- fprintf(fp, "(decr,expire %ld), ", (long)
- pfx->vltimeexpire > now.tv_sec ?
- pfx->vltimeexpire - now.tv_sec : 0);
+ (long)pfx->pfx_validlifetime);
+ if (pfx->pfx_vltimeexpire != 0)
+ fprintf(fp, "(decr,expire %ld), ",
+ (long)pfx->pfx_vltimeexpire > now.tv_sec ?
+ (long)pfx->pfx_vltimeexpire - now.tv_sec :
+ 0);
else
fprintf(fp, ", ");
- if (pfx->preflifetime == ND6_INFINITE_LIFETIME)
+ if (pfx->pfx_preflifetime == ND6_INFINITE_LIFETIME)
fprintf(fp, "pltime: infinity");
else
fprintf(fp, "pltime: %ld",
- (long)pfx->preflifetime);
- if (pfx->pltimeexpire != 0)
- fprintf(fp, "(decr,expire %ld), ", (long)
- pfx->pltimeexpire > now.tv_sec ?
- pfx->pltimeexpire - now.tv_sec : 0);
+ (long)pfx->pfx_preflifetime);
+ if (pfx->pfx_pltimeexpire != 0)
+ fprintf(fp, "(decr,expire %ld), ",
+ (long)pfx->pfx_pltimeexpire > now.tv_sec ?
+ (long)pfx->pfx_pltimeexpire - now.tv_sec :
+ 0);
else
fprintf(fp, ", ");
- fprintf(fp, "flags: %s%s%s",
- pfx->onlinkflg ? "L" : "",
- pfx->autoconfflg ? "A" : "",
- "");
- if (pfx->timer) {
+ fprintf(fp, "flags: ");
+ if (pfx->pfx_onlinkflg || pfx->pfx_autoconfflg) {
+ fprintf(fp, "%s",
+ pfx->pfx_onlinkflg ? "L" : "");
+ fprintf(fp, "%s",
+ pfx->pfx_autoconfflg ? "A" : "");
+ } else
+ fprintf(fp, "<none>");
+ if (pfx->pfx_timer) {
struct timeval *rest;
- rest = rtadvd_timer_rest(pfx->timer);
+ rest = rtadvd_timer_rest(pfx->pfx_timer);
if (rest) { /* XXX: what if not? */
fprintf(fp, ", expire in: %ld",
(long)rest->tv_sec);
@@ -211,31 +220,64 @@ if_dump()
fprintf(fp, ")\n");
}
#ifdef ROUTEINFO
- for (first = 1, rti = rai->route.next; rti != &rai->route;
- rti = rti->next) {
- if (first) {
+ TAILQ_FOREACH(rti, &rai->rai_route, rti_next) {
+ if (rti == TAILQ_FIRST(&rai->rai_route))
fprintf(fp, " Route Information:\n");
- first = 0;
- }
fprintf(fp, " %s/%d (",
- inet_ntop(AF_INET6, &rti->prefix,
- prefixbuf, sizeof(prefixbuf)),
- rti->prefixlen);
+ inet_ntop(AF_INET6, &rti->rti_prefix,
+ prefixbuf, sizeof(prefixbuf)),
+ rti->rti_prefixlen);
fprintf(fp, "preference: %s, ",
- rtpref_str[0xff & (rti->rtpref >> 3)]);
- if (rti->ltime == ND6_INFINITE_LIFETIME)
+ rtpref_str[0xff & (rti->rti_rtpref >> 3)]);
+ if (rti->rti_ltime == ND6_INFINITE_LIFETIME)
fprintf(fp, "lifetime: infinity");
else
- fprintf(fp, "lifetime: %ld", (long)rti->ltime);
+ fprintf(fp, "lifetime: %ld",
+ (long)rti->rti_ltime);
fprintf(fp, ")\n");
}
#endif
+ TAILQ_FOREACH(rdn, &rai->rai_rdnss, rd_next) {
+ struct rdnss_addr *rdna;
+
+ if (rdn == TAILQ_FIRST(&rai->rai_rdnss))
+ fprintf(fp, " Recursive DNS servers:\n"
+ " Lifetime\tServers\n");
+
+ fprintf(fp, " %8u\t", rdn->rd_ltime);
+ TAILQ_FOREACH(rdna, &rdn->rd_list, ra_next) {
+ inet_ntop(AF_INET6, &rdna->ra_dns,
+ prefixbuf, sizeof(prefixbuf));
+
+ if (rdna != TAILQ_FIRST(&rdn->rd_list))
+ fprintf(fp, " \t");
+ fprintf(fp, "%s\n", prefixbuf);
+ }
+ fprintf(fp, "\n");
+ }
+
+ TAILQ_FOREACH(dns, &rai->rai_dnssl, dn_next) {
+ struct dnssl_addr *dnsa;
+ char buf[NI_MAXHOST];
+
+ if (dns == TAILQ_FIRST(&rai->rai_dnssl))
+ fprintf(fp, " DNS search list:\n"
+ " Lifetime\tDomains\n");
+
+ fprintf(fp, " %8u\t", dns->dn_ltime);
+ TAILQ_FOREACH(dnsa, &dns->dn_list, da_next) {
+ dname_labeldec(buf, sizeof(buf), dnsa->da_dom);
+ if (dnsa != TAILQ_FIRST(&dns->dn_list))
+ fprintf(fp, " \t");
+ fprintf(fp, "%s(%d)\n", buf, dnsa->da_len);
+ }
+ fprintf(fp, "\n");
+ }
}
}
void
-rtadvd_dump_file(dumpfile)
- char *dumpfile;
+rtadvd_dump_file(const char *dumpfile)
{
syslog(LOG_DEBUG, "<%s> dump current status to %s", __func__,
dumpfile);
@@ -250,3 +292,30 @@ rtadvd_dump_file(dumpfile)
fclose(fp);
}
+
+/* Decode domain name label encoding in RFC 1035 Section 3.1 */
+static size_t
+dname_labeldec(char *dst, size_t dlen, const char *src)
+{
+ size_t len;
+ const char *src_origin;
+ const char *src_last;
+ const char *dst_origin;
+
+ src_origin = src;
+ src_last = strchr(src, '\0');
+ dst_origin = dst;
+ memset(dst, '\0', dlen);
+ while (src && (len = (uint8_t)(*src++) & 0x3f) &&
+ (src + len) <= src_last) {
+ if (dst != dst_origin)
+ *dst++ = '.';
+ syslog(LOG_DEBUG, "<%s> labellen = %zd", __func__, len);
+ memcpy(dst, src, len);
+ src += len;
+ dst += len;
+ }
+ *dst = '\0';
+
+ return (src - src_origin);
+}
diff --git a/usr.sbin/rtadvd/dump.h b/usr.sbin/rtadvd/dump.h
index c8a6b22..8696e13 100644
--- a/usr.sbin/rtadvd/dump.h
+++ b/usr.sbin/rtadvd/dump.h
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -30,4 +30,4 @@
* SUCH DAMAGE.
*/
-extern void rtadvd_dump_file(char *);
+extern void rtadvd_dump_file(const char *);
diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c
index d8ed088..302c334 100644
--- a/usr.sbin/rtadvd/if.c
+++ b/usr.sbin/rtadvd/if.c
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -44,34 +44,35 @@
#include <netinet/icmp6.h>
#include <unistd.h>
#include <errno.h>
+#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include "rtadvd.h"
#include "if.h"
-#define ROUNDUP(a, size) \
+#define ROUNDUP(a, size) \
(((a) & ((size)-1)) ? (1 + ((a) | ((size)-1))) : (a))
-#define NEXT_SA(ap) (ap) = (struct sockaddr *) \
- ((caddr_t)(ap) + ((ap)->sa_len ? ROUNDUP((ap)->sa_len,\
- sizeof(u_long)) :\
- sizeof(u_long)))
+#define NEXT_SA(ap) \
+ (ap) = (struct sockaddr *)((caddr_t)(ap) + \
+ ((ap)->sa_len ? ROUNDUP((ap)->sa_len, sizeof(u_long)) : \
+ sizeof(u_long)))
struct if_msghdr **iflist;
int iflist_init_ok;
size_t ifblock_size;
char *ifblock;
-static void get_iflist(char **buf, size_t *size);
-static void parse_iflist(struct if_msghdr ***ifmlist_p, char *buf,
- size_t bufsize);
+static void get_iflist(char **buf, size_t *size);
+static void parse_iflist(struct if_msghdr ***ifmlist_p,
+ char *buf, size_t bufsize);
static void
get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info)
{
int i;
-
+
for (i = 0; i < RTAX_MAX; i++) {
if (addrs & (1 << i)) {
rti_info[i] = sa;
@@ -93,12 +94,12 @@ if_nametosdl(char *name)
struct sockaddr_dl *sdl = NULL, *ret_sdl;
if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0)
- return(NULL);
+ return (NULL);
if ((buf = malloc(len)) == NULL)
- return(NULL);
+ return (NULL);
if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) {
free(buf);
- return(NULL);
+ return (NULL);
}
lim = buf + len;
@@ -124,7 +125,7 @@ if_nametosdl(char *name)
if (next == lim) {
/* search failed */
free(buf);
- return(NULL);
+ return (NULL);
}
if ((ret_sdl = malloc(sdl->sdl_len)) == NULL)
@@ -133,7 +134,7 @@ if_nametosdl(char *name)
end:
free(buf);
- return(ret_sdl);
+ return (ret_sdl);
}
int
@@ -144,7 +145,7 @@ if_getmtu(char *name)
u_long mtu = 0;
if (getifaddrs(&ifap) < 0)
- return(0);
+ return (0);
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
if (strcmp(ifa->ifa_name, name) == 0) {
ifd = ifa->ifa_data;
@@ -161,14 +162,14 @@ if_getmtu(char *name)
int s;
if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
- return(0);
+ return (0);
ifr.ifr_addr.sa_family = AF_INET6;
strncpy(ifr.ifr_name, name,
sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) < 0) {
close(s);
- return(0);
+ return (0);
}
close(s);
@@ -176,7 +177,7 @@ if_getmtu(char *name)
}
#endif
- return(mtu);
+ return (mtu);
}
/* give interface index and its old flags, then new flags returned */
@@ -188,14 +189,14 @@ if_getflags(int ifindex, int oifflags)
if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
syslog(LOG_ERR, "<%s> socket: %s", __func__,
- strerror(errno));
+ strerror(errno));
return (oifflags & ~IFF_UP);
}
if_indextoname(ifindex, ifr.ifr_name);
if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) {
syslog(LOG_ERR, "<%s> ioctl:SIOCGIFFLAGS: failed for %s",
- __func__, ifr.ifr_name);
+ __func__, ifr.ifr_name);
close(s);
return (oifflags & ~IFF_UP);
}
@@ -209,9 +210,9 @@ lladdropt_length(struct sockaddr_dl *sdl)
{
switch (sdl->sdl_type) {
case IFT_ETHER:
- return(ROUNDUP8(ETHER_ADDR_LEN + 2));
+ return (ROUNDUP8(ETHER_ADDR_LEN + 2));
default:
- return(0);
+ return (0);
}
}
@@ -238,16 +239,15 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_hdr *ndopt)
}
int
-rtbuf_len()
+rtbuf_len(void)
{
size_t len;
-
int mib[6] = {CTL_NET, AF_ROUTE, 0, AF_INET6, NET_RT_DUMP, 0};
if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0)
- return(-1);
+ return (-1);
- return(len);
+ return (len);
}
#define FILTER_MATCH(type, filter) ((0x1 << type) & filter)
@@ -267,14 +267,21 @@ get_next_msg(char *buf, char *lim, int ifindex, size_t *lenp, int filter)
/* just for safety */
if (!rtm->rtm_msglen) {
syslog(LOG_WARNING, "<%s> rtm_msglen is 0 "
- "(buf=%p lim=%p rtm=%p)", __func__,
- buf, lim, rtm);
+ "(buf=%p lim=%p rtm=%p)", __func__,
+ buf, lim, rtm);
break;
}
- if (FILTER_MATCH(rtm->rtm_type, filter) == 0) {
+ if (((struct rt_msghdr *)buf)->rtm_version != RTM_VERSION) {
+ syslog(LOG_WARNING,
+ "<%s> routing message version mismatch "
+ "(buf=%p lim=%p rtm=%p)", __func__,
+ buf, lim, rtm);
continue;
}
+ if (FILTER_MATCH(rtm->rtm_type, filter) == 0)
+ continue;
+
switch (rtm->rtm_type) {
case RTM_GET:
case RTM_ADD:
@@ -328,6 +335,7 @@ get_next_msg(char *buf, char *lim, int ifindex, size_t *lenp, int filter)
return (char *)rtm;
/* NOTREACHED */
case RTM_IFINFO:
+ case RTM_IFANNOUNCE:
/* found */
*lenp = rtm->rtm_msglen;
return (char *)rtm;
@@ -335,7 +343,7 @@ get_next_msg(char *buf, char *lim, int ifindex, size_t *lenp, int filter)
}
}
- return (char *)rtm;
+ return ((char *)rtm);
}
#undef FILTER_MATCH
@@ -348,7 +356,7 @@ get_addr(char *buf)
sa = (struct sockaddr *)(rtm + 1);
get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
- return(&SIN6(rti_info[RTAX_DST])->sin6_addr);
+ return (&SIN6(rti_info[RTAX_DST])->sin6_addr);
}
int
@@ -360,7 +368,7 @@ get_rtm_ifindex(char *buf)
sa = (struct sockaddr *)(rtm + 1);
get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
- return(((struct sockaddr_dl *)rti_info[RTAX_GATEWAY])->sdl_index);
+ return (((struct sockaddr_dl *)rti_info[RTAX_GATEWAY])->sdl_index);
}
int
@@ -393,7 +401,7 @@ get_prefixlen(char *buf)
struct rt_msghdr *rtm = (struct rt_msghdr *)buf;
struct sockaddr *sa, *rti_info[RTAX_MAX];
u_char *p, *lim;
-
+
sa = (struct sockaddr *)(rtm + 1);
get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
sa = rti_info[RTAX_NETMASK];
@@ -437,11 +445,11 @@ prefixlen(u_char *p, u_char *lim)
case 0x00:
break;
default:
- return(-1);
+ return (-1);
}
}
- return(masklen);
+ return (masklen);
}
int
@@ -449,7 +457,7 @@ rtmsg_type(char *buf)
{
struct rt_msghdr *rtm = (struct rt_msghdr *)buf;
- return(rtm->rtm_type);
+ return (rtm->rtm_type);
}
int
@@ -457,7 +465,7 @@ rtmsg_len(char *buf)
{
struct rt_msghdr *rtm = (struct rt_msghdr *)buf;
- return(rtm->rtm_msglen);
+ return (rtm->rtm_msglen);
}
int
@@ -465,7 +473,7 @@ ifmsg_len(char *buf)
{
struct if_msghdr *ifm = (struct if_msghdr *)buf;
- return(ifm->ifm_msglen);
+ return (ifm->ifm_msglen);
}
/*
@@ -486,7 +494,7 @@ get_iflist(char **buf, size_t *size)
if (sysctl(mib, 6, NULL, size, NULL, 0) < 0) {
syslog(LOG_ERR, "<%s> sysctl: iflist size get failed",
- __func__);
+ __func__);
exit(1);
}
if ((*buf = malloc(*size)) == NULL) {
@@ -495,7 +503,7 @@ get_iflist(char **buf, size_t *size)
}
if (sysctl(mib, 6, *buf, size, NULL, 0) < 0) {
syslog(LOG_ERR, "<%s> sysctl: iflist get failed",
- __func__);
+ __func__);
exit(1);
}
return;
@@ -529,8 +537,8 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize)
for (ifm = (struct if_msghdr *)buf; ifm < (struct if_msghdr *)lim;) {
if (ifm->ifm_msglen == 0) {
syslog(LOG_WARNING, "<%s> ifm_msglen is 0 "
- "(buf=%p lim=%p ifm=%p)", __func__,
- buf, lim, ifm);
+ "(buf=%p lim=%p ifm=%p)", __func__,
+ buf, lim, ifm);
return;
}
@@ -538,10 +546,10 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize)
(*ifmlist_p)[ifm->ifm_index] = ifm;
} else {
syslog(LOG_ERR, "out of sync parsing NET_RT_IFLIST\n"
- "expected %d, got %d\n msglen = %d\n"
- "buf:%p, ifm:%p, lim:%p\n",
- RTM_IFINFO, ifm->ifm_type, ifm->ifm_msglen,
- buf, ifm, lim);
+ "expected %d, got %d\n msglen = %d\n"
+ "buf:%p, ifm:%p, lim:%p\n",
+ RTM_IFINFO, ifm->ifm_type, ifm->ifm_msglen,
+ buf, ifm, lim);
exit (1);
}
for (ifam = (struct ifa_msghdr *)
@@ -552,8 +560,8 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize)
/* just for safety */
if (!ifam->ifam_msglen) {
syslog(LOG_WARNING, "<%s> ifa_msglen is 0 "
- "(buf=%p lim=%p ifam=%p)", __func__,
- buf, lim, ifam);
+ "(buf=%p lim=%p ifam=%p)", __func__,
+ buf, lim, ifam);
return;
}
if (ifam->ifam_type != RTM_NEWADDR)
@@ -564,8 +572,11 @@ parse_iflist(struct if_msghdr ***ifmlist_p, char *buf, size_t bufsize)
}
void
-init_iflist()
+init_iflist(void)
{
+ syslog(LOG_DEBUG,
+ "<%s> generate iflist.", __func__);
+
if (ifblock) {
free(ifblock);
ifblock_size = 0;
diff --git a/usr.sbin/rtadvd/if.h b/usr.sbin/rtadvd/if.h
index 216eaa0..8728e19 100644
--- a/usr.sbin/rtadvd/if.h
+++ b/usr.sbin/rtadvd/if.h
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
diff --git a/usr.sbin/rtadvd/pathnames.h b/usr.sbin/rtadvd/pathnames.h
index 3afee55..13329da 100644
--- a/usr.sbin/rtadvd/pathnames.h
+++ b/usr.sbin/rtadvd/pathnames.h
@@ -1,4 +1,7 @@
/* $KAME: pathnames.h,v 1.2 2000/05/16 13:34:13 itojun Exp $ */
/* $FreeBSD$ */
-#define _PATH_RTADVDCONF "/etc/rtadvd.conf"
+#define _PATH_RTADVDCONF "/etc/rtadvd.conf"
+#define _PATH_RTADVDDUMP "/var/run/rtadvd.dump"
+#define _PATH_RTADVDPID "/var/run/rtadvd.pid"
+
diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c
index aafa0f9..660ed53 100644
--- a/usr.sbin/rtadvd/rrenum.c
+++ b/usr.sbin/rtadvd/rrenum.c
@@ -45,6 +45,7 @@
#include <arpa/inet.h>
#include <errno.h>
+#include <netdb.h>
#include <string.h>
#include <stdlib.h>
#include <syslog.h>
@@ -74,7 +75,7 @@ static int s = -1;
/*
* Check validity of a Prefix Control Operation(PCO).
- * Return 0 on success, 1 on failure.
+ * return 0 on success, 1 on failure.
*/
static int
rr_pco_check(int len, struct rr_pco_match *rpm)
@@ -86,8 +87,8 @@ rr_pco_check(int len, struct rr_pco_match *rpm)
if ((rpm->rpm_len - 3) < 0 || /* must be at least 3 */
(rpm->rpm_len - 3) & 0x3) { /* must be multiple of 4 */
syslog(LOG_WARNING, "<%s> rpm_len %d is not 4N * 3",
- __func__, rpm->rpm_len);
- return 1;
+ __func__, rpm->rpm_len);
+ return (1);
}
/* rpm->rpm_code must be valid value */
switch (rpm->rpm_code) {
@@ -97,14 +98,14 @@ rr_pco_check(int len, struct rr_pco_match *rpm)
break;
default:
syslog(LOG_WARNING, "<%s> unknown rpm_code %d", __func__,
- rpm->rpm_code);
- return 1;
+ rpm->rpm_code);
+ return (1);
}
/* rpm->rpm_matchlen must be 0 to 128 inclusive */
if (rpm->rpm_matchlen > 128) {
syslog(LOG_WARNING, "<%s> rpm_matchlen %d is over 128",
- __func__, rpm->rpm_matchlen);
- return 1;
+ __func__, rpm->rpm_matchlen);
+ return (1);
}
/*
@@ -126,23 +127,22 @@ rr_pco_check(int len, struct rr_pco_match *rpm)
*/
if (checklen > 128) {
syslog(LOG_WARNING, "<%s> sum of rpu_uselen %d and"
- " rpu_keeplen %d is %d(over 128)",
- __func__, rpu->rpu_uselen,
- rpu->rpu_keeplen,
- rpu->rpu_uselen + rpu->rpu_keeplen);
- return 1;
+ " rpu_keeplen %d is %d(over 128)",
+ __func__, rpu->rpu_uselen, rpu->rpu_keeplen,
+ rpu->rpu_uselen + rpu->rpu_keeplen);
+ return (1);
}
}
- return 0;
+ return (0);
}
static void
do_use_prefix(int len, struct rr_pco_match *rpm,
- struct in6_rrenumreq *irr, int ifindex)
+ struct in6_rrenumreq *irr, int ifindex)
{
struct rr_pco_use *rpu, *rpulim;
struct rainfo *rai;
- struct prefix *pp;
+ struct prefix *pfx;
rpu = (struct rr_pco_use *)(rpm + 1);
rpulim = (struct rr_pco_use *)((char *)rpm + len);
@@ -164,7 +164,7 @@ do_use_prefix(int len, struct rr_pco_match *rpm,
if (ioctl(s, rrcmd2pco[rpm->rpm_code], (caddr_t)irr) < 0 &&
errno != EADDRNOTAVAIL)
syslog(LOG_ERR, "<%s> ioctl: %s", __func__,
- strerror(errno));
+ strerror(errno));
return;
}
@@ -176,19 +176,23 @@ do_use_prefix(int len, struct rr_pco_match *rpm,
irr->irr_u_uselen = rpu->rpu_uselen;
irr->irr_u_keeplen = rpu->rpu_keeplen;
irr->irr_raf_mask_onlink =
- !!(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK);
+ !!(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK);
irr->irr_raf_mask_auto =
- !!(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_AUTO);
+ !!(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_AUTO);
irr->irr_vltime = ntohl(rpu->rpu_vltime);
irr->irr_pltime = ntohl(rpu->rpu_pltime);
irr->irr_raf_onlink =
- (rpu->rpu_raflags & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK) == 0 ? 0 : 1;
+ (rpu->rpu_raflags & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK) == 0 ?
+ 0 : 1;
irr->irr_raf_auto =
- (rpu->rpu_raflags & ICMP6_RR_PCOUSE_RAFLAGS_AUTO) == 0 ? 0 : 1;
+ (rpu->rpu_raflags & ICMP6_RR_PCOUSE_RAFLAGS_AUTO) == 0 ?
+ 0 : 1;
irr->irr_rrf_decrvalid =
- (rpu->rpu_flags & ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME) == 0 ? 0 : 1;
+ (rpu->rpu_flags & ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME) == 0 ?
+ 0 : 1;
irr->irr_rrf_decrprefd =
- (rpu->rpu_flags & ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME) == 0 ? 0 : 1;
+ (rpu->rpu_flags & ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME) == 0 ?
+ 0 : 1;
irr->irr_useprefix.sin6_len = sizeof(irr->irr_useprefix);
irr->irr_useprefix.sin6_family = AF_INET6;
irr->irr_useprefix.sin6_addr = rpu->rpu_prefix;
@@ -196,7 +200,7 @@ do_use_prefix(int len, struct rr_pco_match *rpm,
if (ioctl(s, rrcmd2pco[rpm->rpm_code], (caddr_t)irr) < 0 &&
errno != EADDRNOTAVAIL)
syslog(LOG_ERR, "<%s> ioctl: %s", __func__,
- strerror(errno));
+ strerror(errno));
/* very adhoc: should be rewritten */
if (rpm->rpm_code == RPM_PCO_CHANGE &&
@@ -206,28 +210,31 @@ do_use_prefix(int len, struct rr_pco_match *rpm,
if ((rai = if_indextorainfo(ifindex)) == NULL)
continue; /* non-advertising IF */
- for (pp = rai->prefix.next; pp != &rai->prefix;
- pp = pp->next) {
+ TAILQ_FOREACH(pfx, &rai->rai_prefix, pfx_next) {
struct timeval now;
- if (prefix_match(&pp->prefix, pp->prefixlen,
- &rpm->rpm_prefix,
- rpm->rpm_matchlen)) {
+ if (prefix_match(&pfx->pfx_prefix,
+ pfx->pfx_prefixlen, &rpm->rpm_prefix,
+ rpm->rpm_matchlen)) {
/* change parameters */
- pp->validlifetime = ntohl(rpu->rpu_vltime);
- pp->preflifetime = ntohl(rpu->rpu_pltime);
+ pfx->pfx_validlifetime =
+ ntohl(rpu->rpu_vltime);
+ pfx->pfx_preflifetime =
+ ntohl(rpu->rpu_pltime);
if (irr->irr_rrf_decrvalid) {
gettimeofday(&now, 0);
- pp->vltimeexpire =
- now.tv_sec + pp->validlifetime;
+ pfx->pfx_vltimeexpire =
+ now.tv_sec +
+ pfx->pfx_validlifetime;
} else
- pp->vltimeexpire = 0;
+ pfx->pfx_vltimeexpire = 0;
if (irr->irr_rrf_decrprefd) {
gettimeofday(&now, 0);
- pp->pltimeexpire =
- now.tv_sec + pp->preflifetime;
+ pfx->pfx_pltimeexpire =
+ now.tv_sec +
+ pfx->pfx_preflifetime;
} else
- pp->pltimeexpire = 0;
+ pfx->pfx_pltimeexpire = 0;
}
}
}
@@ -245,11 +252,11 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm)
struct in6_rrenumreq irr;
if ((rr_pco_check(len, rpm) != 0))
- return 1;
+ return (1);
if (s == -1 && (s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
syslog(LOG_ERR, "<%s> socket: %s", __func__,
- strerror(errno));
+ strerror(errno));
exit(1);
}
@@ -264,8 +271,8 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm)
while (if_indextoname(++ifindex, irr.irr_name)) {
/*
- * if ICMP6_RR_FLAGS_FORCEAPPLY(A flag) is 0 and IFF_UP is off,
- * the interface is not applied
+ * if ICMP6_RR_FLAGS_FORCEAPPLY(A flag) is 0 and
+ * IFF_UP is off, the interface is not applied
*/
if ((rr->rr_flags & ICMP6_RR_FLAGS_FORCEAPPLY) == 0 &&
(iflist[ifindex]->ifm_flags & IFF_UP) == 0)
@@ -274,13 +281,13 @@ do_pco(struct icmp6_router_renum *rr, int len, struct rr_pco_match *rpm)
do_use_prefix(len, rpm, &irr, ifindex);
}
if (errno == ENXIO)
- return 0;
+ return (0);
else if (errno) {
syslog(LOG_ERR, "<%s> if_indextoname: %s", __func__,
- strerror(errno));
- return 1;
+ strerror(errno));
+ return (1);
}
- return 0;
+ return (0);
}
/*
@@ -305,11 +312,11 @@ do_rr(int len, struct icmp6_router_renum *rr)
int rpmlen;
rpm = (struct rr_pco_match *)cp;
- if (len < sizeof(struct rr_pco_match)) {
+ if ((size_t)len < sizeof(struct rr_pco_match)) {
tooshort:
syslog(LOG_ERR, "<%s> pkt too short. left len = %d. "
- "gabage at end of pkt?", __func__, len);
- return 1;
+ "gabage at end of pkt?", __func__, len);
+ return (1);
}
rpmlen = rpm->rpm_len << 3;
if (len < rpmlen)
@@ -325,7 +332,7 @@ do_rr(int len, struct icmp6_router_renum *rr)
len -= rpmlen;
}
- return 0;
+ return (0);
}
/*
@@ -334,46 +341,45 @@ do_rr(int len, struct icmp6_router_renum *rr)
*/
static int
rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from,
- struct in6_addr *dst)
+ struct in6_addr *dst)
{
u_char ntopbuf[INET6_ADDRSTRLEN];
/* omit rr minimal length check. hope kernel have done it. */
/* rr_command length check */
- if (len < (sizeof(struct icmp6_router_renum) +
- sizeof(struct rr_pco_match))) {
+ if ((size_t)len < (sizeof(struct icmp6_router_renum) +
+ sizeof(struct rr_pco_match))) {
syslog(LOG_ERR, "<%s> rr_command len %d is too short",
- __func__, len);
- return 1;
+ __func__, len);
+ return (1);
}
/* destination check. only for multicast. omit unicast check. */
if (IN6_IS_ADDR_MULTICAST(dst) && !IN6_IS_ADDR_MC_LINKLOCAL(dst) &&
!IN6_IS_ADDR_MC_SITELOCAL(dst)) {
syslog(LOG_ERR, "<%s> dst mcast addr %s is illegal",
- __func__,
- inet_ntop(AF_INET6, dst, ntopbuf, INET6_ADDRSTRLEN));
- return 1;
+ __func__,
+ inet_ntop(AF_INET6, dst, ntopbuf, sizeof(ntopbuf)));
+ return (1);
}
/* seqnum and segnum check */
if (rro.rro_seqnum > rr->rr_seqnum) {
syslog(LOG_WARNING,
- "<%s> rcvd old seqnum %d from %s",
- __func__, (u_int32_t)ntohl(rr->rr_seqnum),
- inet_ntop(AF_INET6, from, ntopbuf, INET6_ADDRSTRLEN));
- return 1;
+ "<%s> rcvd old seqnum %d from %s",
+ __func__, (u_int32_t)ntohl(rr->rr_seqnum),
+ inet_ntop(AF_INET6, from, ntopbuf, sizeof(ntopbuf)));
+ return (1);
}
if (rro.rro_seqnum == rr->rr_seqnum &&
(rr->rr_flags & ICMP6_RR_FLAGS_TEST) == 0 &&
RR_ISSET_SEGNUM(rro.rro_segnum_bits, rr->rr_segnum)) {
if ((rr->rr_flags & ICMP6_RR_FLAGS_REQRESULT) != 0)
syslog(LOG_WARNING,
- "<%s> rcvd duped segnum %d from %s",
- __func__, rr->rr_segnum,
- inet_ntop(AF_INET6, from, ntopbuf,
- INET6_ADDRSTRLEN));
- return 0;
+ "<%s> rcvd duped segnum %d from %s",
+ __func__, rr->rr_segnum, inet_ntop(AF_INET6, from,
+ ntopbuf, sizeof(ntopbuf)));
+ return (0);
}
/* update seqnum */
@@ -382,16 +388,16 @@ rr_command_check(int len, struct icmp6_router_renum *rr, struct in6_addr *from,
/* init rro_segnum_bits */
memset(rro.rro_segnum_bits, 0,
- sizeof(rro.rro_segnum_bits));
+ sizeof(rro.rro_segnum_bits));
}
rro.rro_seqnum = rr->rr_seqnum;
- return 0;
+ return (0);
}
static void
rr_command_input(int len, struct icmp6_router_renum *rr,
- struct in6_addr *from, struct in6_addr *dst)
+ struct in6_addr *from, struct in6_addr *dst)
{
/* rr_command validity check */
if (rr_command_check(len, rr, from, dst))
@@ -401,9 +407,8 @@ rr_command_input(int len, struct icmp6_router_renum *rr,
return;
/* do router renumbering */
- if (do_rr(len, rr)) {
+ if (do_rr(len, rr))
goto failed;
- }
/* update segnum */
RR_SET_SEGNUM(rro.rro_segnum_bits, rr->rr_segnum);
@@ -417,27 +422,26 @@ rr_command_input(int len, struct icmp6_router_renum *rr,
void
rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi,
- struct sockaddr_in6 *from, struct in6_addr *dst)
+ struct sockaddr_in6 *from, struct in6_addr *dst)
{
u_char ntopbuf[2][INET6_ADDRSTRLEN], ifnamebuf[IFNAMSIZ];
syslog(LOG_DEBUG,
- "<%s> RR received from %s to %s on %s",
- __func__,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf[0], INET6_ADDRSTRLEN),
- inet_ntop(AF_INET6, &dst, ntopbuf[1], INET6_ADDRSTRLEN),
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s> RR received from %s to %s on %s",
+ __func__,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[0] ,sizeof(ntopbuf[0])),
+ inet_ntop(AF_INET6, &dst, ntopbuf[1], sizeof(ntopbuf[1])),
+ if_indextoname(pi->ipi6_ifindex, ifnamebuf));
/* packet validation based on Section 4.1 of RFC2894 */
- if (len < sizeof(struct icmp6_router_renum)) {
+ if ((size_t)len < sizeof(struct icmp6_router_renum)) {
syslog(LOG_NOTICE,
- "<%s>: RR short message (size %d) from %s to %s on %s",
- __func__, len,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf[0], INET6_ADDRSTRLEN),
- inet_ntop(AF_INET6, &dst, ntopbuf[1], INET6_ADDRSTRLEN),
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s>: RR short message (size %d) from %s to %s on %s",
+ __func__, len,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[0],
+ sizeof(ntopbuf[0])),
+ inet_ntop(AF_INET6, &dst, ntopbuf[1], sizeof(ntopbuf[1])),
+ if_indextoname(pi->ipi6_ifindex, ifnamebuf));
return;
}
@@ -449,16 +453,16 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi,
* We rely on the kernel input routine for unicast addresses, and thus
* check multicast destinations only.
*/
- if (IN6_IS_ADDR_MULTICAST(&pi->ipi6_addr) &&
- !IN6_ARE_ADDR_EQUAL(&in6a_site_allrouters, &pi->ipi6_addr)) {
+ if (IN6_IS_ADDR_MULTICAST(&pi->ipi6_addr) && !IN6_ARE_ADDR_EQUAL(
+ &sin6_sitelocal_allrouters.sin6_addr, &pi->ipi6_addr)) {
syslog(LOG_NOTICE,
- "<%s>: RR message with invalid destination (%s) "
- "from %s on %s",
- __func__,
- inet_ntop(AF_INET6, &dst, ntopbuf[0], INET6_ADDRSTRLEN),
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf[1], INET6_ADDRSTRLEN),
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s>: RR message with invalid destination (%s) "
+ "from %s on %s",
+ __func__,
+ inet_ntop(AF_INET6, &dst, ntopbuf[0], sizeof(ntopbuf[0])),
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf[1],
+ sizeof(ntopbuf[1])),
+ if_indextoname(pi->ipi6_ifindex, ifnamebuf));
return;
}
@@ -477,7 +481,7 @@ rr_input(int len, struct icmp6_router_renum *rr, struct in6_pktinfo *pi,
break;
default:
syslog(LOG_ERR, "<%s> received unknown code %d",
- __func__, rr->rr_code);
+ __func__, rr->rr_code);
break;
}
diff --git a/usr.sbin/rtadvd/rrenum.h b/usr.sbin/rtadvd/rrenum.h
index c358a2b..2b20d59 100644
--- a/usr.sbin/rtadvd/rrenum.h
+++ b/usr.sbin/rtadvd/rrenum.h
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
diff --git a/usr.sbin/rtadvd/rtadvd.8 b/usr.sbin/rtadvd/rtadvd.8
index 7bc3064..b41f7c06 100644
--- a/usr.sbin/rtadvd/rtadvd.8
+++ b/usr.sbin/rtadvd/rtadvd.8
@@ -37,9 +37,10 @@
.Nd router advertisement daemon
.Sh SYNOPSIS
.Nm
-.Op Fl dDfMRs
+.Op Fl dDfRs
.Op Fl c Ar configfile
.Op Fl F Ar dumpfile
+.Op Fl M Ar ifname
.Op Fl p Ar pidfile
.Ar interface ...
.Sh DESCRIPTION
@@ -103,7 +104,7 @@ will not watch the routing table and the whole functionality described
above will be suppressed.
.Pp
Basically, hosts MUST NOT send Router Advertisement messages at any
-time (RFC 2461, Section 6.2.3).
+time (RFC 4861, Section 6.2.3).
However, it would sometimes be useful to allow hosts to advertise some
parameters such as prefix information and link MTU.
Thus,
@@ -168,6 +169,18 @@ or the file specified with option
.Fl F .
.Pp
Use
+.Dv SIGHUP
+to reload the configuration file
+.Pa /etc/rtadvd.conf .
+If an invalid parameter is found in the configuration file upon the reload,
+the entry will be ignored and the old configuration will be used.
+When parameters in an existing entry are updated,
+.Nm
+will send Router Advertisement messages with the old configuration but
+zero router lifetime to the interface first, and then start to send a new
+message.
+.Pp
+Use
.Dv SIGTERM
to kill
.Nm
@@ -176,7 +189,7 @@ In this case,
.Nm
will transmit router advertisement with router lifetime 0
to all the interfaces
-.Pq in accordance with RFC2461 6.2.5 .
+.Pq in accordance with RFC 4861 6.2.5 .
.Sh FILES
.Bl -tag -width Pa -compact
.It Pa /etc/rtadvd.conf
@@ -193,6 +206,34 @@ dumps its internal state.
.Sh SEE ALSO
.Xr rtadvd.conf 5 ,
.Xr rtsol 8
+.Rs
+.%A Thomas Narten
+.%A Erik Nordmark
+.%A W. A. Simpson
+.%A Hesham Soliman
+.%T Neighbor Discovery for IP version 6 (IPv6)
+.%R RFC 4861
+.Re
+.Rs
+.%A Thomas Narten
+.%A Erik Nordmark
+.%A W. A. Simpson
+.%T Neighbor Discovery for IP version 6 (IPv6)
+.%R RFC 2461 (obsoleted by RFC 4861)
+.Re
+.Rs
+.%A Richard Draves
+.%T Default Router Preferences and More-Specific Routes
+.%R draft-ietf-ipngwg-router-selection-xx.txt
+.Re
+.Rs
+.%A J. Jeong
+.%A S. Park
+.%A L. Beloeil
+.%A S. Madanapalli
+.%T IPv6 Router Advertisement Options for DNS Configuration
+.%R RFC 6106
+.Re
.Sh HISTORY
The
.Nm
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c
index 02e3dc7..e9b212c 100644
--- a/usr.sbin/rtadvd/rtadvd.c
+++ b/usr.sbin/rtadvd/rtadvd.c
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -31,12 +31,15 @@
*/
#include <sys/param.h>
+#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <sys/queue.h>
+#include <sys/sysctl.h>
#include <net/if.h>
+#include <net/if_media.h>
#include <net/route.h>
#include <net/if_dl.h>
#include <netinet/in.h>
@@ -46,12 +49,17 @@
#include <arpa/inet.h>
+#include <net/if_var.h>
+#include <netinet/in_var.h>
+#include <netinet6/nd6.h>
+
#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <err.h>
#include <errno.h>
#include <libutil.h>
+#include <netdb.h>
#include <string.h>
#include <stdlib.h>
#include <syslog.h>
@@ -66,6 +74,7 @@
#include "if.h"
#include "config.h"
#include "dump.h"
+#include "pathnames.h"
struct msghdr rcvmhdr;
static u_char *rcvcmsgbuf;
@@ -74,30 +83,32 @@ static u_char *sndcmsgbuf = NULL;
static size_t sndcmsgbuflen;
volatile sig_atomic_t do_dump;
volatile sig_atomic_t do_die;
+volatile sig_atomic_t do_reload;
struct msghdr sndmhdr;
struct iovec rcviov[2];
struct iovec sndiov[2];
struct sockaddr_in6 rcvfrom;
-struct sockaddr_in6 sin6_allnodes = {sizeof(sin6_allnodes), AF_INET6};
-struct in6_addr in6a_site_allrouters;
-static char *dumpfilename = "/var/run/rtadvd.dump";
-static char *pidfilename = "/var/run/rtadvd.pid";
+static const char *dumpfilename = _PATH_RTADVDDUMP;
+static const char *pidfilename = _PATH_RTADVDPID;
+const char *conffile = _PATH_RTADVDCONF;
static struct pidfh *pfh;
static char *mcastif;
int sock;
int rtsock = -1;
int accept_rr = 0;
int dflag = 0, sflag = 0;
+static int ifl_len;
+static char **ifl_names;
-u_char *conffile = NULL;
+struct railist_head_t railist =
+ TAILQ_HEAD_INITIALIZER(railist);
-struct rainfo *ralist = NULL;
struct nd_optlist {
- struct nd_optlist *next;
- struct nd_opt_hdr *opt;
+ TAILQ_ENTRY(nd_optlist) nol_next;
+ struct nd_opt_hdr *nol_opt;
};
-union nd_opts {
- struct nd_opt_hdr *nd_opt_array[9];
+union nd_opt {
+ struct nd_opt_hdr *opt_array[9];
struct {
struct nd_opt_hdr *zero;
struct nd_opt_hdr *src_lladdr;
@@ -105,51 +116,76 @@ union nd_opts {
struct nd_opt_prefix_info *pi;
struct nd_opt_rd_hdr *rh;
struct nd_opt_mtu *mtu;
- struct nd_optlist *list;
+ TAILQ_HEAD(, nd_optlist) opt_list;
} nd_opt_each;
};
-#define nd_opts_src_lladdr nd_opt_each.src_lladdr
-#define nd_opts_tgt_lladdr nd_opt_each.tgt_lladdr
-#define nd_opts_pi nd_opt_each.pi
-#define nd_opts_rh nd_opt_each.rh
-#define nd_opts_mtu nd_opt_each.mtu
-#define nd_opts_list nd_opt_each.list
-
-#define NDOPT_FLAG_SRCLINKADDR 0x1
-#define NDOPT_FLAG_TGTLINKADDR 0x2
-#define NDOPT_FLAG_PREFIXINFO 0x4
-#define NDOPT_FLAG_RDHDR 0x8
-#define NDOPT_FLAG_MTU 0x10
+#define opt_src_lladdr nd_opt_each.src_lladdr
+#define opt_tgt_lladdr nd_opt_each.tgt_lladdr
+#define opt_pi nd_opt_each.pi
+#define opt_rh nd_opt_each.rh
+#define opt_mtu nd_opt_each.mtu
+#define opt_list nd_opt_each.opt_list
+
+#define NDOPT_FLAG_SRCLINKADDR (1 << 0)
+#define NDOPT_FLAG_TGTLINKADDR (1 << 1)
+#define NDOPT_FLAG_PREFIXINFO (1 << 2)
+#define NDOPT_FLAG_RDHDR (1 << 3)
+#define NDOPT_FLAG_MTU (1 << 4)
+#define NDOPT_FLAG_RDNSS (1 << 5)
+#define NDOPT_FLAG_DNSSL (1 << 6)
u_int32_t ndopt_flags[] = {
- 0, NDOPT_FLAG_SRCLINKADDR, NDOPT_FLAG_TGTLINKADDR,
- NDOPT_FLAG_PREFIXINFO, NDOPT_FLAG_RDHDR, NDOPT_FLAG_MTU,
+ [ND_OPT_SOURCE_LINKADDR] = NDOPT_FLAG_SRCLINKADDR,
+ [ND_OPT_TARGET_LINKADDR] = NDOPT_FLAG_TGTLINKADDR,
+ [ND_OPT_PREFIX_INFORMATION] = NDOPT_FLAG_PREFIXINFO,
+ [ND_OPT_REDIRECTED_HEADER] = NDOPT_FLAG_RDHDR,
+ [ND_OPT_MTU] = NDOPT_FLAG_MTU,
+ [ND_OPT_RDNSS] = NDOPT_FLAG_RDNSS,
+ [ND_OPT_DNSSL] = NDOPT_FLAG_DNSSL,
+};
+
+struct sockaddr_in6 sin6_linklocal_allnodes = {
+ .sin6_len = sizeof(sin6_linklocal_allnodes),
+ .sin6_family = AF_INET6,
+ .sin6_addr = IN6ADDR_LINKLOCAL_ALLNODES_INIT,
+};
+
+struct sockaddr_in6 sin6_linklocal_allrouters = {
+ .sin6_len = sizeof(sin6_linklocal_allrouters),
+ .sin6_family = AF_INET6,
+ .sin6_addr = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT,
+};
+
+struct sockaddr_in6 sin6_sitelocal_allrouters = {
+ .sin6_len = sizeof(sin6_sitelocal_allrouters),
+ .sin6_family = AF_INET6,
+ .sin6_addr = IN6ADDR_SITELOCAL_ALLROUTERS_INIT,
};
-int main(int, char *[]);
-static void set_die(int);
-static void die(void);
-static void sock_open(void);
-static void rtsock_open(void);
-static void rtadvd_input(void);
-static void rs_input(int, struct nd_router_solicit *,
- struct in6_pktinfo *, struct sockaddr_in6 *);
-static void ra_input(int, struct nd_router_advert *,
- struct in6_pktinfo *, struct sockaddr_in6 *);
-static int prefix_check(struct nd_opt_prefix_info *, struct rainfo *,
- struct sockaddr_in6 *);
-static int nd6_options(struct nd_opt_hdr *, int,
- union nd_opts *, u_int32_t);
-static void free_ndopts(union nd_opts *);
-static void ra_output(struct rainfo *);
-static void rtmsg_input(void);
-static void rtadvd_set_dump_file(int);
-static void set_short_delay(struct rainfo *);
+static void set_reload(int);
+static void set_die(int);
+static void die(void);
+static void sock_open(void);
+static void rtsock_open(void);
+static void rtadvd_input(void);
+static void rs_input(int, struct nd_router_solicit *,
+ struct in6_pktinfo *, struct sockaddr_in6 *);
+static void ra_input(int, struct nd_router_advert *,
+ struct in6_pktinfo *, struct sockaddr_in6 *);
+static int prefix_check(struct nd_opt_prefix_info *, struct rainfo *,
+ struct sockaddr_in6 *);
+static int nd6_options(struct nd_opt_hdr *, int,
+ union nd_opt *, u_int32_t);
+static void free_ndopts(union nd_opt *);
+static void rtmsg_input(void);
+static void rtadvd_set_dump_file(int);
+static void set_short_delay(struct rainfo *);
+static int ifl_lookup(char *, char **, int);
+static int check_accept_rtadv(int);
+static int getinet6sysctl(int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
#ifdef HAVE_POLL_H
struct pollfd set[2];
@@ -164,16 +200,16 @@ main(argc, argv)
pid_t pid, otherpid;
/* get command line options and arguments */
- while ((ch = getopt(argc, argv, "c:dDF:fMp:Rs")) != -1) {
+ while ((ch = getopt(argc, argv, "c:dDfF:M:p:Rs")) != -1) {
switch (ch) {
case 'c':
conffile = optarg;
break;
case 'd':
- dflag = 1;
+ dflag++;
break;
case 'D':
- dflag = 2;
+ dflag += 2;
break;
case 'f':
fflag = 1;
@@ -202,8 +238,9 @@ main(argc, argv)
argv += optind;
if (argc == 0) {
fprintf(stderr,
- "usage: rtadvd [-dDfMRs] [-c conffile] "
- "[-F dumpfile] [-p pidfile] interfaces...\n");
+ "usage: rtadvd [-dDfRs] [-c conffile] "
+ "[-F dumpfile] [-M ifname] "
+ "[-p pidfile] interfaces...\n");
exit(1);
}
@@ -213,10 +250,12 @@ main(argc, argv)
openlog("rtadvd", logopt, LOG_DAEMON);
/* set log level */
- if (dflag == 0)
- (void)setlogmask(LOG_UPTO(LOG_ERR));
- if (dflag == 1)
+ if (dflag > 1)
+ (void)setlogmask(LOG_UPTO(LOG_DEBUG));
+ else if (dflag > 0)
(void)setlogmask(LOG_UPTO(LOG_INFO));
+ else
+ (void)setlogmask(LOG_UPTO(LOG_ERR));
/* timer initialization */
rtadvd_timer_init();
@@ -229,17 +268,12 @@ main(argc, argv)
srandom((u_long)time(NULL));
#endif
#endif
-
/* get iflist block from kernel */
init_iflist();
+ ifl_names = argv;
+ ifl_len = argc;
- while (argc--)
- getconfig(*argv++);
-
- if (inet_pton(AF_INET6, ALLNODES, &sin6_allnodes.sin6_addr) != 1) {
- fprintf(stderr, "fatal: inet_pton failed\n");
- exit(1);
- }
+ loadconfig(argv, argc);
pfh = pidfile_open(pidfilename, 0600, &otherpid);
if (pfh == NULL) {
@@ -292,15 +326,14 @@ main(argc, argv)
if (rtsock >= 0)
FD_SET(rtsock, fdsetp);
#endif
-
signal(SIGTERM, set_die);
signal(SIGUSR1, rtadvd_set_dump_file);
+ signal(SIGHUP, set_reload);
while (1) {
#ifndef HAVE_POLL_H
memcpy(selectfdp, fdsetp, fdmasks); /* reinitialize */
#endif
-
if (do_dump) { /* SIGUSR1 */
do_dump = 0;
rtadvd_dump_file(dumpfilename);
@@ -311,6 +344,11 @@ main(argc, argv)
/*NOTREACHED*/
}
+ if (do_reload) {
+ loadconfig(argv, argc);
+ do_reload = 0;
+ }
+
/* timer expiration check and reset the timer */
timeout = rtadvd_check_timer();
@@ -325,7 +363,6 @@ main(argc, argv)
"<%s> there's no timer. waiting for inputs",
__func__);
}
-
#ifdef HAVE_POLL_H
if ((i = poll(set, 2, timeout ? (timeout->tv_sec * 1000 +
timeout->tv_usec / 1000) : INFTIM)) < 0)
@@ -358,75 +395,95 @@ main(argc, argv)
exit(0); /* NOTREACHED */
}
+static int
+ifl_lookup(char *ifn, char **names, int len)
+{
+ while (len--)
+ if (strncmp(names[len], ifn, IFNAMSIZ) == 0)
+ return (0);
+ return (-1);
+}
+
static void
-rtadvd_set_dump_file(sig)
- int sig;
+rtadvd_set_dump_file(int sig __unused)
{
+
do_dump = 1;
}
static void
-set_die(sig)
- int sig;
+set_reload(int sig __unused)
{
+
+ do_reload = 1;
+}
+
+static void
+set_die(int sig __unused)
+{
+
do_die = 1;
}
static void
-die()
+die(void)
{
- struct rainfo *ra;
+ struct rainfo *rai;
+ struct rdnss *rdn;
+ struct dnssl *dns;
int i;
const int retrans = MAX_FINAL_RTR_ADVERTISEMENTS;
- if (dflag > 1) {
- syslog(LOG_DEBUG, "<%s> cease to be an advertising router\n",
- __func__);
- }
+ syslog(LOG_DEBUG, "<%s> cease to be an advertising router\n",
+ __func__);
- for (ra = ralist; ra; ra = ra->next) {
- ra->lifetime = 0;
- make_packet(ra);
+ TAILQ_FOREACH(rai, &railist, rai_next) {
+ rai->rai_lifetime = 0;
+ TAILQ_FOREACH(rdn, &rai->rai_rdnss, rd_next)
+ rdn->rd_ltime = 0;
+ TAILQ_FOREACH(dns, &rai->rai_dnssl, dn_next)
+ dns->dn_ltime = 0;
+ make_packet(rai);
}
for (i = 0; i < retrans; i++) {
- for (ra = ralist; ra; ra = ra->next)
- ra_output(ra);
+ TAILQ_FOREACH(rai, &railist, rai_next)
+ ra_output(rai);
sleep(MIN_DELAY_BETWEEN_RAS);
}
pidfile_remove(pfh);
+
exit(0);
- /*NOTREACHED*/
}
static void
-rtmsg_input()
+rtmsg_input(void)
{
int n, type, ifindex = 0, plen;
size_t len;
char msg[2048], *next, *lim;
- u_char ifname[IF_NAMESIZE];
- struct prefix *prefix;
+ u_char ifname[IFNAMSIZ];
+ struct if_announcemsghdr *ifan;
+ struct prefix *pfx;
struct rainfo *rai;
struct in6_addr *addr;
char addrbuf[INET6_ADDRSTRLEN];
int prefixchange = 0;
+ int error;
n = read(rtsock, msg, sizeof(msg));
- if (dflag > 1) {
- syslog(LOG_DEBUG, "<%s> received a routing message "
- "(type = %d, len = %d)", __func__, rtmsg_type(msg), n);
- }
+ syslog(LOG_DEBUG, "<%s> received a routing message "
+ "(type = %d, len = %d)", __func__, rtmsg_type(msg), n);
+
if (n > rtmsg_len(msg)) {
/*
- * This usually won't happen for messages received on
+ * This usually won't happen for messages received on
* a routing socket.
*/
- if (dflag > 1)
- syslog(LOG_DEBUG,
- "<%s> received data length is larger than "
- "1st routing message len. multiple messages? "
- "read %d bytes, but 1st msg len = %d",
- __func__, n, rtmsg_len(msg));
+ syslog(LOG_DEBUG,
+ "<%s> received data length is larger than "
+ "1st routing message len. multiple messages? "
+ "read %d bytes, but 1st msg len = %d",
+ __func__, n, rtmsg_len(msg));
#if 0
/* adjust length */
n = rtmsg_len(msg);
@@ -438,11 +495,12 @@ rtmsg_input()
int oldifflags;
next = get_next_msg(next, lim, 0, &len,
- RTADV_TYPE2BITMASK(RTM_ADD) |
- RTADV_TYPE2BITMASK(RTM_DELETE) |
- RTADV_TYPE2BITMASK(RTM_NEWADDR) |
- RTADV_TYPE2BITMASK(RTM_DELADDR) |
- RTADV_TYPE2BITMASK(RTM_IFINFO));
+ RTADV_TYPE2BITMASK(RTM_ADD) |
+ RTADV_TYPE2BITMASK(RTM_DELETE) |
+ RTADV_TYPE2BITMASK(RTM_NEWADDR) |
+ RTADV_TYPE2BITMASK(RTM_DELADDR) |
+ RTADV_TYPE2BITMASK(RTM_IFINFO) |
+ RTADV_TYPE2BITMASK(RTM_IFANNOUNCE));
if (len == 0)
break;
type = rtmsg_type(next);
@@ -458,25 +516,65 @@ rtmsg_input()
case RTM_IFINFO:
ifindex = get_ifm_ifindex(next);
break;
- default:
- /* should not reach here */
- if (dflag > 1) {
+ case RTM_IFANNOUNCE:
+ ifan = (struct if_announcemsghdr *)next;
+ switch (ifan->ifan_what) {
+ case IFAN_ARRIVAL:
+ case IFAN_DEPARTURE:
+ break;
+ default:
syslog(LOG_DEBUG,
- "<%s:%d> unknown rtmsg %d on %s",
- __func__, __LINE__, type,
- if_indextoname(ifindex, ifname));
+ "<%s:%d> unknown ifan msg (ifan_what=%d)",
+ __func__, __LINE__, ifan->ifan_what);
+ continue;
+ }
+
+ syslog(LOG_INFO, "<%s>: if_announcemsg (idx=%d:%d)",
+ __func__, ifan->ifan_index, ifan->ifan_what);
+ init_iflist();
+ error = ifl_lookup(ifan->ifan_name,
+ ifl_names, ifl_len);
+ if (error) {
+ syslog(LOG_INFO, "<%s>: not a target "
+ "interface (idx=%d)", __func__,
+ ifan->ifan_index);
+ continue;
+ }
+
+ switch (ifan->ifan_what) {
+ case IFAN_ARRIVAL:
+ error = getconfig(ifan->ifan_index);
+ if (error)
+ syslog(LOG_ERR,
+ "<%s>: getconfig failed (idx=%d)"
+ " Ignored.", __func__,
+ ifan->ifan_index);
+ break;
+ case IFAN_DEPARTURE:
+ error = rmconfig(ifan->ifan_index);
+ if (error)
+ syslog(LOG_ERR,
+ "<%s>: rmconfig failed (idx=%d)"
+ " Ignored.", __func__,
+ ifan->ifan_index);
+ break;
}
continue;
+ default:
+ /* should not reach here */
+ syslog(LOG_DEBUG,
+ "<%s:%d> unknown rtmsg %d on %s",
+ __func__, __LINE__, type,
+ if_indextoname(ifindex, ifname));
+ continue;
}
if ((rai = if_indextorainfo(ifindex)) == NULL) {
- if (dflag > 1) {
- syslog(LOG_DEBUG,
- "<%s> route changed on "
- "non advertising interface(%s)",
- __func__,
- if_indextoname(ifindex, ifname));
- }
+ syslog(LOG_DEBUG,
+ "<%s> route changed on "
+ "non advertising interface(%s)",
+ __func__,
+ if_indextoname(ifindex, ifname));
continue;
}
oldifflags = iflist[ifindex]->ifm_flags;
@@ -500,25 +598,25 @@ rtmsg_input()
__func__, plen);
break;
}
- prefix = find_prefix(rai, addr, plen);
- if (prefix) {
- if (prefix->timer) {
+ pfx = find_prefix(rai, addr, plen);
+ if (pfx) {
+ if (pfx->pfx_timer) {
/*
* If the prefix has been invalidated,
* make it available again.
*/
- update_prefix(prefix);
+ update_prefix(pfx);
prefixchange = 1;
- } else if (dflag > 1) {
+ } else
syslog(LOG_DEBUG,
"<%s> new prefix(%s/%d) "
"added on %s, "
"but it was already in list",
__func__,
inet_ntop(AF_INET6, addr,
- (char *)addrbuf, INET6_ADDRSTRLEN),
- plen, rai->ifname);
- }
+ (char *)addrbuf,
+ sizeof(addrbuf)),
+ plen, rai->rai_ifname);
break;
}
make_prefix(rai, ifindex, addr, plen);
@@ -543,21 +641,17 @@ rtmsg_input()
__func__, plen);
break;
}
- prefix = find_prefix(rai, addr, plen);
- if (prefix == NULL) {
- if (dflag > 1) {
- syslog(LOG_DEBUG,
- "<%s> prefix(%s/%d) was "
- "deleted on %s, "
- "but it was not in list",
- __func__,
- inet_ntop(AF_INET6, addr,
- (char *)addrbuf, INET6_ADDRSTRLEN),
- plen, rai->ifname);
- }
+ pfx = find_prefix(rai, addr, plen);
+ if (pfx == NULL) {
+ syslog(LOG_DEBUG,
+ "<%s> prefix(%s/%d) was deleted on %s, "
+ "but it was not in list",
+ __func__, inet_ntop(AF_INET6, addr,
+ (char *)addrbuf, sizeof(addrbuf)),
+ plen, rai->rai_ifname);
break;
}
- invalidate_prefix(prefix);
+ invalidate_prefix(pfx);
prefixchange = 1;
break;
case RTM_NEWADDR:
@@ -571,12 +665,10 @@ rtmsg_input()
break;
default:
/* should not reach here */
- if (dflag > 1) {
- syslog(LOG_DEBUG,
- "<%s:%d> unknown rtmsg %d on %s",
- __func__, __LINE__, type,
- if_indextoname(ifindex, ifname));
- }
+ syslog(LOG_DEBUG,
+ "<%s:%d> unknown rtmsg %d on %s",
+ __func__, __LINE__, type,
+ if_indextoname(ifindex, ifname));
return;
}
@@ -585,27 +677,29 @@ rtmsg_input()
!(iflist[ifindex]->ifm_flags & IFF_UP)) {
syslog(LOG_INFO,
"<%s> interface %s becomes down. stop timer.",
- __func__, rai->ifname);
- rtadvd_remove_timer(&rai->timer);
+ __func__, rai->rai_ifname);
+ rtadvd_remove_timer(rai->rai_timer);
+ rai->rai_timer = NULL;
} else if (!(oldifflags & IFF_UP) && /* DOWN to UP */
- (iflist[ifindex]->ifm_flags & IFF_UP)) {
+ (iflist[ifindex]->ifm_flags & IFF_UP)) {
syslog(LOG_INFO,
"<%s> interface %s becomes up. restart timer.",
- __func__, rai->ifname);
+ __func__, rai->rai_ifname);
- rai->initcounter = 0; /* reset the counter */
- rai->waiting = 0; /* XXX */
- rai->timer = rtadvd_add_timer(ra_timeout,
+ rai->rai_initcounter = 0; /* reset the counter */
+ rai->rai_waiting = 0; /* XXX */
+ rai->rai_timer = rtadvd_add_timer(ra_timeout,
ra_timer_update, rai, rai);
- ra_timer_update((void *)rai, &rai->timer->tm);
- rtadvd_set_timer(&rai->timer->tm, rai->timer);
+ ra_timer_update(rai, &rai->rai_timer->rat_tm);
+ rtadvd_set_timer(&rai->rai_timer->rat_tm,
+ rai->rai_timer);
} else if (prefixchange &&
(iflist[ifindex]->ifm_flags & IFF_UP)) {
/*
* An advertised prefix has been added or invalidated.
* Will notice the change in a short delay.
*/
- rai->initcounter = 0;
+ rai->rai_initcounter = 0;
set_short_delay(rai);
}
}
@@ -614,13 +708,13 @@ rtmsg_input()
}
void
-rtadvd_input()
+rtadvd_input(void)
{
- int i;
+ ssize_t i;
int *hlimp = NULL;
#ifdef OLDRAWSOCKET
struct ip6_hdr *ip;
-#endif
+#endif
struct icmp6_hdr *icp;
int ifindex = 0;
struct cmsghdr *cm;
@@ -655,14 +749,14 @@ rtadvd_input()
}
if (ifindex == 0) {
syslog(LOG_ERR,
- "<%s> failed to get receiving interface",
- __func__);
+ "<%s> failed to get receiving interface",
+ __func__);
return;
}
if (hlimp == NULL) {
syslog(LOG_ERR,
- "<%s> failed to get receiving hop limit",
- __func__);
+ "<%s> failed to get receiving hop limit",
+ __func__);
return;
}
@@ -673,28 +767,28 @@ rtadvd_input()
if (iflist[pi->ipi6_ifindex] == NULL ||
(iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) {
syslog(LOG_INFO,
- "<%s> received data on a disabled interface (%s)",
- __func__,
- (iflist[pi->ipi6_ifindex] == NULL) ? "[gone]" :
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s> received data on a disabled interface (%s)",
+ __func__,
+ (iflist[pi->ipi6_ifindex] == NULL) ? "[gone]" :
+ if_indextoname(pi->ipi6_ifindex, ifnamebuf));
return;
}
#ifdef OLDRAWSOCKET
- if (i < sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr)) {
+ if ((size_t)i < sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr)) {
syslog(LOG_ERR,
- "<%s> packet size(%d) is too short",
- __func__, i);
+ "<%s> packet size(%d) is too short",
+ __func__, i);
return;
}
ip = (struct ip6_hdr *)rcvmhdr.msg_iov[0].iov_base;
icp = (struct icmp6_hdr *)(ip + 1); /* XXX: ext. hdr? */
#else
- if (i < sizeof(struct icmp6_hdr)) {
+ if ((size_t)i < sizeof(struct icmp6_hdr)) {
syslog(LOG_ERR,
- "<%s> packet size(%d) is too short",
- __func__, i);
+ "<%s> packet size(%zd) is too short",
+ __func__, i);
return;
}
@@ -704,7 +798,7 @@ rtadvd_input()
switch (icp->icmp6_type) {
case ND_ROUTER_SOLICIT:
/*
- * Message verification - RFC-2461 6.1.1
+ * Message verification - RFC 4861 6.1.1
* XXX: these checks must be done in the kernel as well,
* but we can't completely rely on them.
*/
@@ -714,7 +808,7 @@ rtadvd_input()
"received from %s on %s",
__func__, *hlimp,
inet_ntop(AF_INET6, &rcvfrom.sin6_addr, ntopbuf,
- INET6_ADDRSTRLEN),
+ sizeof(ntopbuf)),
if_indextoname(pi->ipi6_ifindex, ifnamebuf));
return;
}
@@ -724,17 +818,17 @@ rtadvd_input()
"received from %s on %s",
__func__, icp->icmp6_code,
inet_ntop(AF_INET6, &rcvfrom.sin6_addr, ntopbuf,
- INET6_ADDRSTRLEN),
+ sizeof(ntopbuf)),
if_indextoname(pi->ipi6_ifindex, ifnamebuf));
return;
}
- if (i < sizeof(struct nd_router_solicit)) {
+ if ((size_t)i < sizeof(struct nd_router_solicit)) {
syslog(LOG_NOTICE,
"<%s> RS from %s on %s does not have enough "
- "length (len = %d)",
+ "length (len = %zd)",
__func__,
inet_ntop(AF_INET6, &rcvfrom.sin6_addr, ntopbuf,
- INET6_ADDRSTRLEN),
+ sizeof(ntopbuf)),
if_indextoname(pi->ipi6_ifindex, ifnamebuf), i);
return;
}
@@ -742,16 +836,25 @@ rtadvd_input()
break;
case ND_ROUTER_ADVERT:
/*
- * Message verification - RFC-2461 6.1.2
- * XXX: there's a same dilemma as above...
+ * Message verification - RFC 4861 6.1.2
+ * XXX: there's the same dilemma as above...
*/
+ if (!IN6_IS_ADDR_LINKLOCAL(&rcvfrom.sin6_addr)) {
+ syslog(LOG_NOTICE,
+ "<%s> RA witn non-linklocal source address "
+ "received from %s on %s",
+ __func__, inet_ntop(AF_INET6, &rcvfrom.sin6_addr,
+ ntopbuf, sizeof(ntopbuf)),
+ if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ return;
+ }
if (*hlimp != 255) {
syslog(LOG_NOTICE,
"<%s> RA with invalid hop limit(%d) "
"received from %s on %s",
__func__, *hlimp,
inet_ntop(AF_INET6, &rcvfrom.sin6_addr, ntopbuf,
- INET6_ADDRSTRLEN),
+ sizeof(ntopbuf)),
if_indextoname(pi->ipi6_ifindex, ifnamebuf));
return;
}
@@ -761,17 +864,17 @@ rtadvd_input()
"received from %s on %s",
__func__, icp->icmp6_code,
inet_ntop(AF_INET6, &rcvfrom.sin6_addr, ntopbuf,
- INET6_ADDRSTRLEN),
+ sizeof(ntopbuf)),
if_indextoname(pi->ipi6_ifindex, ifnamebuf));
return;
}
- if (i < sizeof(struct nd_router_advert)) {
+ if ((size_t)i < sizeof(struct nd_router_advert)) {
syslog(LOG_NOTICE,
"<%s> RA from %s on %s does not have enough "
- "length (len = %d)",
+ "length (len = %zd)",
__func__,
inet_ntop(AF_INET6, &rcvfrom.sin6_addr, ntopbuf,
- INET6_ADDRSTRLEN),
+ sizeof(ntopbuf)),
if_indextoname(pi->ipi6_ifindex, ifnamebuf), i);
return;
}
@@ -785,7 +888,7 @@ rtadvd_input()
break;
}
rr_input(i, (struct icmp6_router_renum *)icp, pi, &rcvfrom,
- &dst);
+ &dst);
break;
default:
/*
@@ -806,17 +909,17 @@ static void
rs_input(int len, struct nd_router_solicit *rs,
struct in6_pktinfo *pi, struct sockaddr_in6 *from)
{
- u_char ntopbuf[INET6_ADDRSTRLEN], ifnamebuf[IFNAMSIZ];
- union nd_opts ndopts;
- struct rainfo *ra;
+ u_char ntopbuf[INET6_ADDRSTRLEN];
+ u_char ifnamebuf[IFNAMSIZ];
+ union nd_opt ndopts;
+ struct rainfo *rai;
struct soliciter *sol;
syslog(LOG_DEBUG,
- "<%s> RS received from %s on %s",
- __func__,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s> RS received from %s on %s",
+ __func__,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, sizeof(ntopbuf)),
+ if_indextoname(pi->ipi6_ifindex, ifnamebuf));
/* ND option check */
memset(&ndopts, 0, sizeof(ndopts));
@@ -824,36 +927,33 @@ rs_input(int len, struct nd_router_solicit *rs,
len - sizeof(struct nd_router_solicit),
&ndopts, NDOPT_FLAG_SRCLINKADDR)) {
syslog(LOG_INFO,
- "<%s> ND option check failed for an RS from %s on %s",
- __func__,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s> ND option check failed for an RS from %s on %s",
+ __func__,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)),
+ if_indextoname(pi->ipi6_ifindex, ifnamebuf));
return;
}
/*
* If the IP source address is the unspecified address, there
* must be no source link-layer address option in the message.
- * (RFC-2461 6.1.1)
+ * (RFC 4861 6.1.1)
*/
if (IN6_IS_ADDR_UNSPECIFIED(&from->sin6_addr) &&
- ndopts.nd_opts_src_lladdr) {
+ ndopts.opt_src_lladdr) {
syslog(LOG_INFO,
- "<%s> RS from unspecified src on %s has a link-layer"
- " address option",
- __func__,
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s> RS from unspecified src on %s has a link-layer"
+ " address option",
+ __func__, if_indextoname(pi->ipi6_ifindex, ifnamebuf));
goto done;
}
- ra = ralist;
- while (ra != NULL) {
- if (pi->ipi6_ifindex == ra->ifindex)
+ TAILQ_FOREACH(rai, &railist, rai_next)
+ if (pi->ipi6_ifindex == (unsigned int)rai->rai_ifindex)
break;
- ra = ra->next;
- }
- if (ra == NULL) {
+
+ if (rai == NULL) {
syslog(LOG_INFO,
"<%s> RS received on non advertising interface(%s)",
__func__,
@@ -861,7 +961,7 @@ rs_input(int len, struct nd_router_solicit *rs,
goto done;
}
- ra->rsinput++; /* increment statistics */
+ rai->rai_rsinput++; /* increment statistics */
/*
* Decide whether to send RA according to the rate-limit
@@ -871,21 +971,20 @@ rs_input(int len, struct nd_router_solicit *rs,
/* record sockaddr waiting for RA, if possible */
sol = (struct soliciter *)malloc(sizeof(*sol));
if (sol) {
- sol->addr = *from;
- /* XXX RFC2553 need clarification on flowinfo */
- sol->addr.sin6_flowinfo = 0;
- sol->next = ra->soliciter;
- ra->soliciter = sol;
+ sol->sol_addr = *from;
+ /* XXX RFC 2553 need clarification on flowinfo */
+ sol->sol_addr.sin6_flowinfo = 0;
+ TAILQ_INSERT_TAIL(&rai->rai_soliciter, sol, sol_next);
}
/*
* If there is already a waiting RS packet, don't
* update the timer.
*/
- if (ra->waiting++)
+ if (rai->rai_waiting++)
goto done;
- set_short_delay(ra);
+ set_short_delay(rai);
done:
free_ndopts(&ndopts);
@@ -893,8 +992,7 @@ rs_input(int len, struct nd_router_solicit *rs,
}
static void
-set_short_delay(rai)
- struct rainfo *rai;
+set_short_delay(struct rainfo *rai)
{
long delay; /* must not be greater than 1000000 */
struct timeval interval, now, min_delay, tm_tmp, *rest;
@@ -904,7 +1002,7 @@ set_short_delay(rai)
* corresponds to a time later than the time the next
* multicast RA is scheduled to be sent, ignore the random
* delay and send the advertisement at the
- * already-scheduled time. RFC-2461 6.2.6
+ * already-scheduled time. RFC 4861 6.2.6
*/
#ifdef HAVE_ARC4RANDOM
delay = arc4random_uniform(MAX_RA_DELAY_TIME);
@@ -913,8 +1011,8 @@ set_short_delay(rai)
#endif
interval.tv_sec = 0;
interval.tv_usec = delay;
- rest = rtadvd_timer_rest(rai->timer);
- if (TIMEVAL_LT(*rest, interval)) {
+ rest = rtadvd_timer_rest(rai->rai_timer);
+ if (TIMEVAL_LT(rest, &interval)) {
syslog(LOG_DEBUG, "<%s> random delay is larger than "
"the rest of the current timer", __func__);
interval = *rest;
@@ -928,170 +1026,217 @@ set_short_delay(rai)
* previous advertisement was sent.
*/
gettimeofday(&now, NULL);
- TIMEVAL_SUB(&now, &rai->lastsent, &tm_tmp);
+ TIMEVAL_SUB(&now, &rai->rai_lastsent, &tm_tmp);
min_delay.tv_sec = MIN_DELAY_BETWEEN_RAS;
min_delay.tv_usec = 0;
- if (TIMEVAL_LT(tm_tmp, min_delay)) {
+ if (TIMEVAL_LT(&tm_tmp, &min_delay)) {
TIMEVAL_SUB(&min_delay, &tm_tmp, &min_delay);
TIMEVAL_ADD(&min_delay, &interval, &interval);
}
- rtadvd_set_timer(&interval, rai->timer);
+ rtadvd_set_timer(&interval, rai->rai_timer);
+}
+
+static int
+check_accept_rtadv(int idx)
+{
+ struct in6_ndireq nd;
+ u_char ifname[IFNAMSIZ];
+ int s6;
+ int error;
+
+ if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
+ syslog(LOG_ERR,
+ "<%s> open socket failed for idx=%d.",
+ __func__, idx);
+ return (0);
+ }
+ if ((if_indextoname(idx, ifname)) == NULL) {
+ syslog(LOG_ERR,
+ "<%s> ifindex->ifname failed (idx=%d).",
+ __func__, idx);
+ close(s6);
+ return (0);
+ }
+ memset(&nd, 0, sizeof(nd));
+ strncpy(nd.ifname, ifname, sizeof(nd.ifname));
+ error = ioctl(s6, SIOCGIFINFO_IN6, &nd);
+ if (error) {
+ syslog(LOG_ERR,
+ "<%s> ioctl(SIOCGIFINFO_IN6) failed for idx=%d.",
+ __func__, idx);
+ nd.ndi.flags = 0;
+ }
+ close(s6);
+
+ return (nd.ndi.flags & ND6_IFF_ACCEPT_RTADV);
+}
+
+static int
+getinet6sysctl(int code)
+{
+ int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 };
+ int value;
+ size_t size;
+
+ mib[3] = code;
+ size = sizeof(value);
+ if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &value, &size, NULL, 0)
+ < 0) {
+ syslog(LOG_ERR, "<%s>: failed to get ip6 sysctl(%d): %s",
+ __func__, code,
+ strerror(errno));
+ return (-1);
+ }
+ else
+ return (value);
}
static void
-ra_input(int len, struct nd_router_advert *ra,
+ra_input(int len, struct nd_router_advert *nra,
struct in6_pktinfo *pi, struct sockaddr_in6 *from)
{
struct rainfo *rai;
- u_char ntopbuf[INET6_ADDRSTRLEN], ifnamebuf[IFNAMSIZ];
- union nd_opts ndopts;
- char *on_off[] = {"OFF", "ON"};
+ u_char ntopbuf[INET6_ADDRSTRLEN];
+ u_char ifnamebuf[IFNAMSIZ];
+ union nd_opt ndopts;
+ const char *on_off[] = {"OFF", "ON"};
u_int32_t reachabletime, retranstimer, mtu;
int inconsistent = 0;
+ int error;
+
+ syslog(LOG_DEBUG, "<%s> RA received from %s on %s", __func__,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf, sizeof(ntopbuf)),
+ if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+
+ if (!check_accept_rtadv(pi->ipi6_ifindex)) {
+ syslog(LOG_INFO,
+ "<%s> An RA from %s on %s ignored (no ACCEPT_RTADV flag).",
+ __func__,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), if_indextoname(pi->ipi6_ifindex,
+ ifnamebuf));
+ return;
+ }
- syslog(LOG_DEBUG,
- "<%s> RA received from %s on %s",
- __func__,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
-
/* ND option check */
memset(&ndopts, 0, sizeof(ndopts));
- if (nd6_options((struct nd_opt_hdr *)(ra + 1),
- len - sizeof(struct nd_router_advert),
- &ndopts, NDOPT_FLAG_SRCLINKADDR |
- NDOPT_FLAG_PREFIXINFO | NDOPT_FLAG_MTU)) {
+ error = nd6_options((struct nd_opt_hdr *)(nra + 1),
+ len - sizeof(struct nd_router_advert), &ndopts,
+ NDOPT_FLAG_SRCLINKADDR | NDOPT_FLAG_PREFIXINFO | NDOPT_FLAG_MTU |
+ NDOPT_FLAG_RDNSS | NDOPT_FLAG_DNSSL);
+ if (error) {
syslog(LOG_INFO,
- "<%s> ND option check failed for an RA from %s on %s",
- __func__,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s> ND option check failed for an RA from %s on %s",
+ __func__,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), if_indextoname(pi->ipi6_ifindex,
+ ifnamebuf));
return;
}
/*
- * RA consistency check according to RFC-2461 6.2.7
+ * RA consistency check according to RFC 4861 6.2.7
*/
- if ((rai = if_indextorainfo(pi->ipi6_ifindex)) == 0) {
+ rai = if_indextorainfo(pi->ipi6_ifindex);
+ if (rai == NULL) {
syslog(LOG_INFO,
- "<%s> received RA from %s on non-advertising"
- " interface(%s)",
- __func__,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+ "<%s> received RA from %s on non-advertising"
+ " interface(%s)",
+ __func__,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), if_indextoname(pi->ipi6_ifindex,
+ ifnamebuf));
goto done;
}
- rai->rainput++; /* increment statistics */
-
+ rai->rai_rainput++; /* increment statistics */
+
/* Cur Hop Limit value */
- if (ra->nd_ra_curhoplimit && rai->hoplimit &&
- ra->nd_ra_curhoplimit != rai->hoplimit) {
+ if (nra->nd_ra_curhoplimit && rai->rai_hoplimit &&
+ nra->nd_ra_curhoplimit != rai->rai_hoplimit) {
syslog(LOG_INFO,
- "<%s> CurHopLimit inconsistent on %s:"
- " %d from %s, %d from us",
- __func__,
- rai->ifname,
- ra->nd_ra_curhoplimit,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- rai->hoplimit);
+ "<%s> CurHopLimit inconsistent on %s:"
+ " %d from %s, %d from us",
+ __func__, rai->rai_ifname, nra->nd_ra_curhoplimit,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), rai->rai_hoplimit);
inconsistent++;
}
/* M flag */
- if ((ra->nd_ra_flags_reserved & ND_RA_FLAG_MANAGED) !=
- rai->managedflg) {
+ if ((nra->nd_ra_flags_reserved & ND_RA_FLAG_MANAGED) !=
+ rai->rai_managedflg) {
syslog(LOG_INFO,
- "<%s> M flag inconsistent on %s:"
- " %s from %s, %s from us",
- __func__,
- rai->ifname,
- on_off[!rai->managedflg],
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- on_off[rai->managedflg]);
+ "<%s> M flag inconsistent on %s:"
+ " %s from %s, %s from us",
+ __func__, rai->rai_ifname, on_off[!rai->rai_managedflg],
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), on_off[rai->rai_managedflg]);
inconsistent++;
}
/* O flag */
- if ((ra->nd_ra_flags_reserved & ND_RA_FLAG_OTHER) !=
- rai->otherflg) {
+ if ((nra->nd_ra_flags_reserved & ND_RA_FLAG_OTHER) !=
+ rai->rai_otherflg) {
syslog(LOG_INFO,
- "<%s> O flag inconsistent on %s:"
- " %s from %s, %s from us",
- __func__,
- rai->ifname,
- on_off[!rai->otherflg],
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- on_off[rai->otherflg]);
+ "<%s> O flag inconsistent on %s:"
+ " %s from %s, %s from us",
+ __func__, rai->rai_ifname, on_off[!rai->rai_otherflg],
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), on_off[rai->rai_otherflg]);
inconsistent++;
}
/* Reachable Time */
- reachabletime = ntohl(ra->nd_ra_reachable);
- if (reachabletime && rai->reachabletime &&
- reachabletime != rai->reachabletime) {
+ reachabletime = ntohl(nra->nd_ra_reachable);
+ if (reachabletime && rai->rai_reachabletime &&
+ reachabletime != rai->rai_reachabletime) {
syslog(LOG_INFO,
- "<%s> ReachableTime inconsistent on %s:"
- " %d from %s, %d from us",
- __func__,
- rai->ifname,
- reachabletime,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- rai->reachabletime);
+ "<%s> ReachableTime inconsistent on %s:"
+ " %d from %s, %d from us",
+ __func__, rai->rai_ifname, reachabletime,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), rai->rai_reachabletime);
inconsistent++;
}
/* Retrans Timer */
- retranstimer = ntohl(ra->nd_ra_retransmit);
- if (retranstimer && rai->retranstimer &&
- retranstimer != rai->retranstimer) {
+ retranstimer = ntohl(nra->nd_ra_retransmit);
+ if (retranstimer && rai->rai_retranstimer &&
+ retranstimer != rai->rai_retranstimer) {
syslog(LOG_INFO,
- "<%s> RetranceTimer inconsistent on %s:"
- " %d from %s, %d from us",
- __func__,
- rai->ifname,
- retranstimer,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- rai->retranstimer);
+ "<%s> RetranceTimer inconsistent on %s:"
+ " %d from %s, %d from us",
+ __func__, rai->rai_ifname, retranstimer,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), rai->rai_retranstimer);
inconsistent++;
}
/* Values in the MTU options */
- if (ndopts.nd_opts_mtu) {
- mtu = ntohl(ndopts.nd_opts_mtu->nd_opt_mtu_mtu);
- if (mtu && rai->linkmtu && mtu != rai->linkmtu) {
+ if (ndopts.opt_mtu) {
+ mtu = ntohl(ndopts.opt_mtu->nd_opt_mtu_mtu);
+ if (mtu && rai->rai_linkmtu && mtu != rai->rai_linkmtu) {
syslog(LOG_INFO,
- "<%s> MTU option value inconsistent on %s:"
- " %d from %s, %d from us",
- __func__,
- rai->ifname, mtu,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- rai->linkmtu);
+ "<%s> MTU option value inconsistent on %s:"
+ " %d from %s, %d from us",
+ __func__, rai->rai_ifname, mtu,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), rai->rai_linkmtu);
inconsistent++;
}
}
/* Preferred and Valid Lifetimes for prefixes */
{
- struct nd_optlist *optp = ndopts.nd_opts_list;
+ struct nd_optlist *nol;
- if (ndopts.nd_opts_pi) {
- if (prefix_check(ndopts.nd_opts_pi, rai, from))
+ if (ndopts.opt_pi)
+ if (prefix_check(ndopts.opt_pi, rai, from))
inconsistent++;
- }
- while (optp) {
- if (prefix_check((struct nd_opt_prefix_info *)optp->opt,
- rai, from))
+
+ TAILQ_FOREACH(nol, &ndopts.opt_list, nol_next)
+ if (prefix_check((struct nd_opt_prefix_info *)nol->nol_opt,
+ rai, from))
inconsistent++;
- optp = optp->next;
- }
}
if (inconsistent)
- rai->rainconsistent++;
-
+ rai->rai_rainconsistent++;
+
done:
free_ndopts(&ndopts);
return;
@@ -1100,51 +1245,49 @@ ra_input(int len, struct nd_router_advert *ra,
/* return a non-zero value if the received prefix is inconsitent with ours */
static int
prefix_check(struct nd_opt_prefix_info *pinfo,
- struct rainfo *rai, struct sockaddr_in6 *from)
+ struct rainfo *rai, struct sockaddr_in6 *from)
{
u_int32_t preferred_time, valid_time;
- struct prefix *pp;
+ struct prefix *pfx;
int inconsistent = 0;
- u_char ntopbuf[INET6_ADDRSTRLEN], prefixbuf[INET6_ADDRSTRLEN];
+ u_char ntopbuf[INET6_ADDRSTRLEN];
+ u_char prefixbuf[INET6_ADDRSTRLEN];
struct timeval now;
#if 0 /* impossible */
if (pinfo->nd_opt_pi_type != ND_OPT_PREFIX_INFORMATION)
- return(0);
+ return (0);
#endif
/*
* log if the adveritsed prefix has link-local scope(sanity check?)
*/
- if (IN6_IS_ADDR_LINKLOCAL(&pinfo->nd_opt_pi_prefix)) {
+ if (IN6_IS_ADDR_LINKLOCAL(&pinfo->nd_opt_pi_prefix))
syslog(LOG_INFO,
- "<%s> link-local prefix %s/%d is advertised "
- "from %s on %s",
- __func__,
- inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix,
- prefixbuf, INET6_ADDRSTRLEN),
- pinfo->nd_opt_pi_prefix_len,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- rai->ifname);
- }
-
- if ((pp = find_prefix(rai, &pinfo->nd_opt_pi_prefix,
- pinfo->nd_opt_pi_prefix_len)) == NULL) {
+ "<%s> link-local prefix %s/%d is advertised "
+ "from %s on %s",
+ __func__,
+ inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf,
+ sizeof(prefixbuf)),
+ pinfo->nd_opt_pi_prefix_len,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), rai->rai_ifname);
+
+ if ((pfx = find_prefix(rai, &pinfo->nd_opt_pi_prefix,
+ pinfo->nd_opt_pi_prefix_len)) == NULL) {
syslog(LOG_INFO,
- "<%s> prefix %s/%d from %s on %s is not in our list",
- __func__,
- inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix,
- prefixbuf, INET6_ADDRSTRLEN),
- pinfo->nd_opt_pi_prefix_len,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- rai->ifname);
- return(0);
+ "<%s> prefix %s/%d from %s on %s is not in our list",
+ __func__,
+ inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf,
+ sizeof(prefixbuf)),
+ pinfo->nd_opt_pi_prefix_len,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), rai->rai_ifname);
+ return (0);
}
preferred_time = ntohl(pinfo->nd_opt_pi_preferred_time);
- if (pp->pltimeexpire) {
+ if (pfx->pfx_pltimeexpire) {
/*
* The lifetime is decremented in real time, so we should
* compare the expiration time.
@@ -1155,134 +1298,135 @@ prefix_check(struct nd_opt_prefix_info *pinfo,
gettimeofday(&now, NULL);
preferred_time += now.tv_sec;
- if (!pp->timer && rai->clockskew &&
- abs(preferred_time - pp->pltimeexpire) > rai->clockskew) {
+ if (!pfx->pfx_timer && rai->rai_clockskew &&
+ abs(preferred_time - pfx->pfx_pltimeexpire) > rai->rai_clockskew) {
syslog(LOG_INFO,
- "<%s> preferred lifetime for %s/%d"
- " (decr. in real time) inconsistent on %s:"
- " %d from %s, %ld from us",
- __func__,
- inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix,
- prefixbuf, INET6_ADDRSTRLEN),
- pinfo->nd_opt_pi_prefix_len,
- rai->ifname, preferred_time,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- pp->pltimeexpire);
+ "<%s> preferred lifetime for %s/%d"
+ " (decr. in real time) inconsistent on %s:"
+ " %d from %s, %ld from us",
+ __func__,
+ inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf,
+ sizeof(prefixbuf)),
+ pinfo->nd_opt_pi_prefix_len,
+ rai->rai_ifname, preferred_time,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), pfx->pfx_pltimeexpire);
inconsistent++;
}
- } else if (!pp->timer && preferred_time != pp->preflifetime) {
+ } else if (!pfx->pfx_timer && preferred_time != pfx->pfx_preflifetime)
syslog(LOG_INFO,
- "<%s> preferred lifetime for %s/%d"
- " inconsistent on %s:"
- " %d from %s, %d from us",
- __func__,
- inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix,
- prefixbuf, INET6_ADDRSTRLEN),
- pinfo->nd_opt_pi_prefix_len,
- rai->ifname, preferred_time,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- pp->preflifetime);
- }
+ "<%s> preferred lifetime for %s/%d"
+ " inconsistent on %s:"
+ " %d from %s, %d from us",
+ __func__,
+ inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf,
+ sizeof(prefixbuf)),
+ pinfo->nd_opt_pi_prefix_len,
+ rai->rai_ifname, preferred_time,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), pfx->pfx_preflifetime);
valid_time = ntohl(pinfo->nd_opt_pi_valid_time);
- if (pp->vltimeexpire) {
+ if (pfx->pfx_vltimeexpire) {
gettimeofday(&now, NULL);
valid_time += now.tv_sec;
- if (!pp->timer && rai->clockskew &&
- abs(valid_time - pp->vltimeexpire) > rai->clockskew) {
+ if (!pfx->pfx_timer && rai->rai_clockskew &&
+ abs(valid_time - pfx->pfx_vltimeexpire) > rai->rai_clockskew) {
syslog(LOG_INFO,
- "<%s> valid lifetime for %s/%d"
- " (decr. in real time) inconsistent on %s:"
- " %d from %s, %ld from us",
- __func__,
- inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix,
- prefixbuf, INET6_ADDRSTRLEN),
- pinfo->nd_opt_pi_prefix_len,
- rai->ifname, preferred_time,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- pp->vltimeexpire);
+ "<%s> valid lifetime for %s/%d"
+ " (decr. in real time) inconsistent on %s:"
+ " %d from %s, %ld from us",
+ __func__,
+ inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf,
+ sizeof(prefixbuf)),
+ pinfo->nd_opt_pi_prefix_len,
+ rai->rai_ifname, preferred_time,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), pfx->pfx_vltimeexpire);
inconsistent++;
}
- } else if (!pp->timer && valid_time != pp->validlifetime) {
+ } else if (!pfx->pfx_timer && valid_time != pfx->pfx_validlifetime) {
syslog(LOG_INFO,
- "<%s> valid lifetime for %s/%d"
- " inconsistent on %s:"
- " %d from %s, %d from us",
- __func__,
- inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix,
- prefixbuf, INET6_ADDRSTRLEN),
- pinfo->nd_opt_pi_prefix_len,
- rai->ifname, valid_time,
- inet_ntop(AF_INET6, &from->sin6_addr,
- ntopbuf, INET6_ADDRSTRLEN),
- pp->validlifetime);
+ "<%s> valid lifetime for %s/%d"
+ " inconsistent on %s:"
+ " %d from %s, %d from us",
+ __func__,
+ inet_ntop(AF_INET6, &pinfo->nd_opt_pi_prefix, prefixbuf,
+ sizeof(prefixbuf)),
+ pinfo->nd_opt_pi_prefix_len,
+ rai->rai_ifname, valid_time,
+ inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
+ sizeof(ntopbuf)), pfx->pfx_validlifetime);
inconsistent++;
}
- return(inconsistent);
+ return (inconsistent);
}
struct prefix *
find_prefix(struct rainfo *rai, struct in6_addr *prefix, int plen)
{
- struct prefix *pp;
+ struct prefix *pfx;
int bytelen, bitlen;
u_char bitmask;
- for (pp = rai->prefix.next; pp != &rai->prefix; pp = pp->next) {
- if (plen != pp->prefixlen)
+ TAILQ_FOREACH(pfx, &rai->rai_prefix, pfx_next) {
+ if (plen != pfx->pfx_prefixlen)
continue;
+
bytelen = plen / 8;
bitlen = plen % 8;
bitmask = 0xff << (8 - bitlen);
- if (memcmp((void *)prefix, (void *)&pp->prefix, bytelen))
+
+ if (memcmp((void *)prefix, (void *)&pfx->pfx_prefix, bytelen))
continue;
+
if (bitlen == 0 ||
- ((prefix->s6_addr[bytelen] & bitmask) ==
- (pp->prefix.s6_addr[bytelen] & bitmask))) {
- return(pp);
+ ((prefix->s6_addr[bytelen] & bitmask) ==
+ (pfx->pfx_prefix.s6_addr[bytelen] & bitmask))) {
+ return (pfx);
}
}
- return(NULL);
+ return (NULL);
}
/* check if p0/plen0 matches p1/plen1; return 1 if matches, otherwise 0. */
int
prefix_match(struct in6_addr *p0, int plen0,
- struct in6_addr *p1, int plen1)
+ struct in6_addr *p1, int plen1)
{
int bytelen, bitlen;
u_char bitmask;
if (plen0 < plen1)
- return(0);
+ return (0);
+
bytelen = plen1 / 8;
bitlen = plen1 % 8;
bitmask = 0xff << (8 - bitlen);
+
if (memcmp((void *)p0, (void *)p1, bytelen))
- return(0);
+ return (0);
+
if (bitlen == 0 ||
((p0->s6_addr[bytelen] & bitmask) ==
(p1->s6_addr[bytelen] & bitmask))) {
- return(1);
+ return (1);
}
- return(0);
+ return (0);
}
static int
nd6_options(struct nd_opt_hdr *hdr, int limit,
- union nd_opts *ndopts, u_int32_t optflags)
+ union nd_opt *ndopts, u_int32_t optflags)
{
int optlen = 0;
for (; limit > 0; limit -= optlen) {
- if (limit < sizeof(struct nd_opt_hdr)) {
+ if ((size_t)limit < sizeof(struct nd_opt_hdr)) {
syslog(LOG_INFO, "<%s> short option header", __func__);
goto bad;
}
@@ -1300,7 +1444,9 @@ nd6_options(struct nd_opt_hdr *hdr, int limit,
goto bad;
}
- if (hdr->nd_opt_type > ND_OPT_MTU) {
+ if (hdr->nd_opt_type > ND_OPT_MTU &&
+ hdr->nd_opt_type != ND_OPT_RDNSS &&
+ hdr->nd_opt_type != ND_OPT_DNSSL) {
syslog(LOG_INFO, "<%s> unknown ND option(type %d)",
__func__, hdr->nd_opt_type);
continue;
@@ -1316,10 +1462,25 @@ nd6_options(struct nd_opt_hdr *hdr, int limit,
* Option length check. Do it here for all fixed-length
* options.
*/
- if ((hdr->nd_opt_type == ND_OPT_MTU &&
- (optlen != sizeof(struct nd_opt_mtu))) ||
- ((hdr->nd_opt_type == ND_OPT_PREFIX_INFORMATION &&
- optlen != sizeof(struct nd_opt_prefix_info)))) {
+ switch (hdr->nd_opt_type) {
+ case ND_OPT_MTU:
+ if (optlen == sizeof(struct nd_opt_mtu))
+ break;
+ goto skip;
+ case ND_OPT_RDNSS:
+ if (optlen >= 24 &&
+ (optlen - sizeof(struct nd_opt_rdnss)) % 16 == 0)
+ break;
+ goto skip;
+ case ND_OPT_DNSSL:
+ if (optlen >= 16 &&
+ (optlen - sizeof(struct nd_opt_dnssl)) % 8 == 0)
+ break;
+ goto skip;
+ case ND_OPT_PREFIX_INFORMATION:
+ if (optlen == sizeof(struct nd_opt_prefix_info))
+ break;
+skip:
syslog(LOG_INFO, "<%s> invalid option length",
__func__);
continue;
@@ -1328,33 +1489,35 @@ nd6_options(struct nd_opt_hdr *hdr, int limit,
switch (hdr->nd_opt_type) {
case ND_OPT_TARGET_LINKADDR:
case ND_OPT_REDIRECTED_HEADER:
+ case ND_OPT_RDNSS:
+ case ND_OPT_DNSSL:
break; /* we don't care about these options */
case ND_OPT_SOURCE_LINKADDR:
case ND_OPT_MTU:
- if (ndopts->nd_opt_array[hdr->nd_opt_type]) {
+ if (ndopts->opt_array[hdr->nd_opt_type]) {
syslog(LOG_INFO,
"<%s> duplicated ND option (type = %d)",
__func__, hdr->nd_opt_type);
}
- ndopts->nd_opt_array[hdr->nd_opt_type] = hdr;
+ ndopts->opt_array[hdr->nd_opt_type] = hdr;
break;
case ND_OPT_PREFIX_INFORMATION:
{
- struct nd_optlist *pfxlist;
+ struct nd_optlist *nol;
- if (ndopts->nd_opts_pi == 0) {
- ndopts->nd_opts_pi =
+ if (ndopts->opt_pi == 0) {
+ ndopts->opt_pi =
(struct nd_opt_prefix_info *)hdr;
continue;
}
- if ((pfxlist = malloc(sizeof(*pfxlist))) == NULL) {
+ nol = malloc(sizeof(*nol));
+ if (nol == NULL) {
syslog(LOG_ERR, "<%s> can't allocate memory",
__func__);
goto bad;
}
- pfxlist->next = ndopts->nd_opts_list;
- pfxlist->opt = hdr;
- ndopts->nd_opts_list = pfxlist;
+ nol->nol_opt = hdr;
+ TAILQ_INSERT_TAIL(&(ndopts->opt_list), nol, nol_next);
break;
}
@@ -1363,46 +1526,45 @@ nd6_options(struct nd_opt_hdr *hdr, int limit,
}
}
- return(0);
+ return (0);
bad:
free_ndopts(ndopts);
- return(-1);
+ return (-1);
}
static void
-free_ndopts(union nd_opts *ndopts)
+free_ndopts(union nd_opt *ndopts)
{
- struct nd_optlist *opt = ndopts->nd_opts_list, *next;
+ struct nd_optlist *nol;
- while (opt) {
- next = opt->next;
- free(opt);
- opt = next;
+ while ((nol = TAILQ_FIRST(&ndopts->opt_list)) != NULL) {
+ TAILQ_REMOVE(&ndopts->opt_list, nol, nol_next);
+ free(nol);
}
}
void
-sock_open()
+sock_open(void)
{
struct icmp6_filter filt;
struct ipv6_mreq mreq;
- struct rainfo *ra = ralist;
+ struct rainfo *rai;
int on;
/* XXX: should be max MTU attached to the node */
static u_char answer[1500];
rcvcmsgbuflen = CMSG_SPACE(sizeof(struct in6_pktinfo)) +
- CMSG_SPACE(sizeof(int));
+ CMSG_SPACE(sizeof(int));
rcvcmsgbuf = (u_char *)malloc(rcvcmsgbuflen);
if (rcvcmsgbuf == NULL) {
syslog(LOG_ERR, "<%s> not enough core", __func__);
exit(1);
}
- sndcmsgbuflen = CMSG_SPACE(sizeof(struct in6_pktinfo)) +
- CMSG_SPACE(sizeof(int));
+ sndcmsgbuflen = CMSG_SPACE(sizeof(struct in6_pktinfo)) +
+ CMSG_SPACE(sizeof(int));
sndcmsgbuf = (u_char *)malloc(sndcmsgbuflen);
if (sndcmsgbuf == NULL) {
syslog(LOG_ERR, "<%s> not enough core", __func__);
@@ -1410,113 +1572,84 @@ sock_open()
}
if ((sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) {
- syslog(LOG_ERR, "<%s> socket: %s", __func__,
- strerror(errno));
+ syslog(LOG_ERR, "<%s> socket: %s", __func__, strerror(errno));
exit(1);
}
-
/* specify to tell receiving interface */
on = 1;
-#ifdef IPV6_RECVPKTINFO
if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on,
- sizeof(on)) < 0) {
- syslog(LOG_ERR, "<%s> IPV6_RECVPKTINFO: %s",
- __func__, strerror(errno));
- exit(1);
- }
-#else /* old adv. API */
- if (setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, &on,
- sizeof(on)) < 0) {
- syslog(LOG_ERR, "<%s> IPV6_PKTINFO: %s",
- __func__, strerror(errno));
+ sizeof(on)) < 0) {
+ syslog(LOG_ERR, "<%s> IPV6_RECVPKTINFO: %s", __func__,
+ strerror(errno));
exit(1);
}
-#endif
-
on = 1;
/* specify to tell value of hoplimit field of received IP6 hdr */
-#ifdef IPV6_RECVHOPLIMIT
if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on,
- sizeof(on)) < 0) {
- syslog(LOG_ERR, "<%s> IPV6_RECVHOPLIMIT: %s",
- __func__, strerror(errno));
- exit(1);
- }
-#else /* old adv. API */
- if (setsockopt(sock, IPPROTO_IPV6, IPV6_HOPLIMIT, &on,
- sizeof(on)) < 0) {
- syslog(LOG_ERR, "<%s> IPV6_HOPLIMIT: %s",
- __func__, strerror(errno));
+ sizeof(on)) < 0) {
+ syslog(LOG_ERR, "<%s> IPV6_RECVHOPLIMIT: %s", __func__,
+ strerror(errno));
exit(1);
}
-#endif
-
ICMP6_FILTER_SETBLOCKALL(&filt);
ICMP6_FILTER_SETPASS(ND_ROUTER_SOLICIT, &filt);
ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &filt);
if (accept_rr)
ICMP6_FILTER_SETPASS(ICMP6_ROUTER_RENUMBERING, &filt);
+
if (setsockopt(sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filt,
- sizeof(filt)) < 0) {
+ sizeof(filt)) < 0) {
syslog(LOG_ERR, "<%s> IICMP6_FILTER: %s",
- __func__, strerror(errno));
+ __func__, strerror(errno));
exit(1);
}
/*
* join all routers multicast address on each advertising interface.
*/
- if (inet_pton(AF_INET6, ALLROUTERS_LINK,
- &mreq.ipv6mr_multiaddr.s6_addr)
- != 1) {
- syslog(LOG_ERR, "<%s> inet_pton failed(library bug?)",
- __func__);
- exit(1);
- }
- while (ra) {
- mreq.ipv6mr_interface = ra->ifindex;
+ memcpy(&mreq.ipv6mr_multiaddr.s6_addr,
+ &sin6_linklocal_allrouters.sin6_addr,
+ sizeof(mreq.ipv6mr_multiaddr.s6_addr));
+ TAILQ_FOREACH(rai, &railist, rai_next) {
+ mreq.ipv6mr_interface = rai->rai_ifindex;
if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq,
- sizeof(mreq)) < 0) {
+ sizeof(mreq)) < 0) {
syslog(LOG_ERR, "<%s> IPV6_JOIN_GROUP(link) on %s: %s",
- __func__, ra->ifname, strerror(errno));
+ __func__, rai->rai_ifname, strerror(errno));
exit(1);
}
- ra = ra->next;
}
/*
* When attending router renumbering, join all-routers site-local
- * multicast group.
+ * multicast group.
*/
if (accept_rr) {
- if (inet_pton(AF_INET6, ALLROUTERS_SITE,
- &in6a_site_allrouters) != 1) {
- syslog(LOG_ERR, "<%s> inet_pton failed(library bug?)",
- __func__);
- exit(1);
- }
- mreq.ipv6mr_multiaddr = in6a_site_allrouters;
+ memcpy(&mreq.ipv6mr_multiaddr.s6_addr,
+ &sin6_sitelocal_allrouters.sin6_addr,
+ sizeof(mreq.ipv6mr_multiaddr.s6_addr));
if (mcastif) {
if ((mreq.ipv6mr_interface = if_nametoindex(mcastif))
== 0) {
syslog(LOG_ERR,
- "<%s> invalid interface: %s",
- __func__, mcastif);
+ "<%s> invalid interface: %s",
+ __func__, mcastif);
exit(1);
}
} else
- mreq.ipv6mr_interface = ralist->ifindex;
+ mreq.ipv6mr_interface =
+ TAILQ_FIRST(&railist)->rai_ifindex;
if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
- &mreq, sizeof(mreq)) < 0) {
+ &mreq, sizeof(mreq)) < 0) {
syslog(LOG_ERR,
- "<%s> IPV6_JOIN_GROUP(site) on %s: %s",
- __func__,
- mcastif ? mcastif : ralist->ifname,
- strerror(errno));
+ "<%s> IPV6_JOIN_GROUP(site) on %s: %s", __func__,
+ mcastif ? mcastif :
+ TAILQ_FIRST(&railist)->rai_ifname,
+ strerror(errno));
exit(1);
}
}
-
+
/* initialize msghdr for receiving packets */
rcviov[0].iov_base = (caddr_t)answer;
rcviov[0].iov_len = sizeof(answer);
@@ -1533,17 +1666,17 @@ sock_open()
sndmhdr.msg_iovlen = 1;
sndmhdr.msg_control = (caddr_t)sndcmsgbuf;
sndmhdr.msg_controllen = sndcmsgbuflen;
-
+
return;
}
/* open a routing socket to watch the routing table */
static void
-rtsock_open()
+rtsock_open(void)
{
if ((rtsock = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) {
syslog(LOG_ERR,
- "<%s> socket: %s", __func__, strerror(errno));
+ "<%s> socket: %s", __func__, strerror(errno));
exit(1);
}
}
@@ -1551,36 +1684,72 @@ rtsock_open()
struct rainfo *
if_indextorainfo(int idx)
{
- struct rainfo *rai = ralist;
+ struct rainfo *rai;
- for (rai = ralist; rai; rai = rai->next) {
- if (rai->ifindex == idx)
- return(rai);
+ TAILQ_FOREACH(rai, &railist, rai_next) {
+ syslog(LOG_DEBUG, "<%s> rai->rai_ifindex %d == idx %d?",
+ __func__, rai->rai_ifindex, idx);
+ if (rai->rai_ifindex == idx)
+ return (rai);
}
- return(NULL); /* search failed */
+ return (NULL); /* search failed */
}
-static void
-ra_output(rainfo)
-struct rainfo *rainfo;
+void
+ra_output(struct rainfo *rai)
{
int i;
struct cmsghdr *cm;
struct in6_pktinfo *pi;
- struct soliciter *sol, *nextsol;
+ struct soliciter *sol;
- if ((iflist[rainfo->ifindex]->ifm_flags & IFF_UP) == 0) {
+ if ((iflist[rai->rai_ifindex]->ifm_flags & IFF_UP) == 0) {
syslog(LOG_DEBUG, "<%s> %s is not up, skip sending RA",
- __func__, rainfo->ifname);
+ __func__, rai->rai_ifname);
return;
}
- make_packet(rainfo); /* XXX: inefficient */
+ /*
+ * Check lifetime, ACCEPT_RTADV flag, and ip6.forwarding.
+ *
+ * (lifetime == 0) = output
+ * (lifetime != 0 && (ACCEPT_RTADV || !ip6.forwarding) = no output
+ *
+ * Basically, hosts MUST NOT send Router Advertisement
+ * messages at any time (RFC 4861, Section 6.2.3). However, it
+ * would sometimes be useful to allow hosts to advertise some
+ * parameters such as prefix information and link MTU. Thus,
+ * we allow hosts to invoke rtadvd only when router lifetime
+ * (on every advertising interface) is explicitly set
+ * zero. (see also the above section)
+ */
+ syslog(LOG_DEBUG,
+ "<%s> check lifetime=%d, ACCEPT_RTADV=%d, ip6.forwarding=%d on %s",
+ __func__, rai->rai_lifetime, check_accept_rtadv(rai->rai_ifindex),
+ getinet6sysctl(IPV6CTL_FORWARDING), rai->rai_ifname);
+ if (rai->rai_lifetime != 0) {
+ if (check_accept_rtadv(rai->rai_ifindex)) {
+ syslog(LOG_INFO,
+ "<%s> non-zero lifetime RA "
+ "on RA receiving interface %s."
+ " Ignored.", __func__, rai->rai_ifname);
+ return;
+ }
+ if (getinet6sysctl(IPV6CTL_FORWARDING) == 0) {
+ syslog(LOG_INFO,
+ "<%s> non-zero lifetime RA "
+ "but net.inet6.ip6.forwarding=0. "
+ "Ignored.", __func__);
+ return;
+ }
+ }
+
+ make_packet(rai); /* XXX: inefficient */
- sndmhdr.msg_name = (caddr_t)&sin6_allnodes;
- sndmhdr.msg_iov[0].iov_base = (caddr_t)rainfo->ra_data;
- sndmhdr.msg_iov[0].iov_len = rainfo->ra_datalen;
+ sndmhdr.msg_name = (caddr_t)&sin6_linklocal_allnodes;
+ sndmhdr.msg_iov[0].iov_base = (caddr_t)rai->rai_ra_data;
+ sndmhdr.msg_iov[0].iov_len = rai->rai_ra_datalen;
cm = CMSG_FIRSTHDR(&sndmhdr);
/* specify the outgoing interface */
@@ -1589,7 +1758,7 @@ struct rainfo *rainfo;
cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
pi = (struct in6_pktinfo *)CMSG_DATA(cm);
memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/
- pi->ipi6_ifindex = rainfo->ifindex;
+ pi->ipi6_ifindex = rai->rai_ifindex;
/* specify the hop limit of the packet */
{
@@ -1603,80 +1772,79 @@ struct rainfo *rainfo;
}
syslog(LOG_DEBUG,
- "<%s> send RA on %s, # of waitings = %d",
- __func__, rainfo->ifname, rainfo->waiting);
+ "<%s> send RA on %s, # of waitings = %d",
+ __func__, rai->rai_ifname, rai->rai_waiting);
i = sendmsg(sock, &sndmhdr, 0);
- if (i < 0 || i != rainfo->ra_datalen) {
+ if (i < 0 || (size_t)i != rai->rai_ra_datalen) {
if (i < 0) {
syslog(LOG_ERR, "<%s> sendmsg on %s: %s",
- __func__, rainfo->ifname,
- strerror(errno));
+ __func__, rai->rai_ifname,
+ strerror(errno));
}
}
/* update counter */
- if (rainfo->initcounter < MAX_INITIAL_RTR_ADVERTISEMENTS)
- rainfo->initcounter++;
- rainfo->raoutput++;
+ if (rai->rai_initcounter < MAX_INITIAL_RTR_ADVERTISEMENTS)
+ rai->rai_initcounter++;
+ rai->rai_raoutput++;
/*
* unicast advertisements
* XXX commented out. reason: though spec does not forbit it, unicast
* advert does not really help
*/
- for (sol = rainfo->soliciter; sol; sol = nextsol) {
- nextsol = sol->next;
-
- sol->next = NULL;
+ while ((sol = TAILQ_FIRST(&rai->rai_soliciter)) != NULL) {
+ TAILQ_REMOVE(&rai->rai_soliciter, sol, sol_next);
free(sol);
}
- rainfo->soliciter = NULL;
/* update timestamp */
- gettimeofday(&rainfo->lastsent, NULL);
+ gettimeofday(&rai->rai_lastsent, NULL);
/* reset waiting conter */
- rainfo->waiting = 0;
+ rai->rai_waiting = 0;
}
/* process RA timer */
struct rtadvd_timer *
-ra_timeout(void *data)
+ra_timeout(void *arg)
{
- struct rainfo *rai = (struct rainfo *)data;
+ struct rainfo *rai;
#ifdef notyet
/* if necessary, reconstruct the packet. */
#endif
-
- syslog(LOG_DEBUG,
- "<%s> RA timer on %s is expired",
- __func__, rai->ifname);
+ rai = (struct rainfo *)arg;
+ syslog(LOG_DEBUG, "<%s> RA timer on %s is expired",
+ __func__, rai->rai_ifname);
ra_output(rai);
- return(rai->timer);
+ return (rai->rai_timer);
}
/* update RA timer */
void
-ra_timer_update(void *data, struct timeval *tm)
+ra_timer_update(void *arg, struct timeval *tm)
{
- struct rainfo *rai = (struct rainfo *)data;
long interval;
+ struct rainfo *rai;
+ rai = (struct rainfo *)arg;
/*
* Whenever a multicast advertisement is sent from an interface,
* the timer is reset to a uniformly-distributed random value
* between the interface's configured MinRtrAdvInterval and
* MaxRtrAdvInterval (RFC2461 6.2.4).
*/
- interval = rai->mininterval;
+ interval = rai->rai_mininterval;
#ifdef HAVE_ARC4RANDOM
- interval += arc4random_uniform(rai->maxinterval - rai->mininterval);
+ interval += arc4random_uniform(rai->rai_maxinterval -
+ rai->rai_mininterval);
#else
- interval += random() % (rai->maxinterval - rai->mininterval);
+ interval += random() % (rai->rai_maxinterval -
+ rai->rai_mininterval);
#endif
/*
@@ -1684,9 +1852,9 @@ ra_timer_update(void *data, struct timeval *tm)
* MAX_INITIAL_RTR_ADVERTISEMENTS), if the randomly chosen interval
* is greater than MAX_INITIAL_RTR_ADVERT_INTERVAL, the timer
* SHOULD be set to MAX_INITIAL_RTR_ADVERT_INTERVAL instead.
- * (RFC-2461 6.2.4)
+ * (RFC 4861 6.2.4)
*/
- if (rai->initcounter < MAX_INITIAL_RTR_ADVERTISEMENTS &&
+ if (rai->rai_initcounter < MAX_INITIAL_RTR_ADVERTISEMENTS &&
interval > MAX_INITIAL_RTR_ADVERT_INTERVAL)
interval = MAX_INITIAL_RTR_ADVERT_INTERVAL;
@@ -1694,9 +1862,9 @@ ra_timer_update(void *data, struct timeval *tm)
tm->tv_usec = 0;
syslog(LOG_DEBUG,
- "<%s> RA timer on %s is set to %ld:%ld",
- __func__, rai->ifname,
- (long int)tm->tv_sec, (long int)tm->tv_usec);
+ "<%s> RA timer on %s is set to %ld:%ld",
+ __func__, rai->rai_ifname,
+ (long int)tm->tv_sec, (long int)tm->tv_usec);
return;
}
diff --git a/usr.sbin/rtadvd/rtadvd.conf b/usr.sbin/rtadvd/rtadvd.conf
index 33ab7f3..1e42c75 100644
--- a/usr.sbin/rtadvd/rtadvd.conf
+++ b/usr.sbin/rtadvd/rtadvd.conf
@@ -18,4 +18,5 @@
# this part by hand, and then invoke rtadvd with the -s option.
#ef0:\
-# :addr="3ffe:501:ffff:1000::":prefixlen#64:
+# :addr="2001:db8:ffff:1000::":prefixlen#64:\
+# :rdnss="2001:db8:ffff:1000::1":dnssl="example.com":
diff --git a/usr.sbin/rtadvd/rtadvd.conf.5 b/usr.sbin/rtadvd/rtadvd.conf.5
index 81ffa70..ba2f490 100644
--- a/usr.sbin/rtadvd/rtadvd.conf.5
+++ b/usr.sbin/rtadvd/rtadvd.conf.5
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 17, 1998
+.Dd June 4, 2011
.Dt RTADVD.CONF 5
.Os
.Sh NAME
@@ -179,10 +179,25 @@ will automatically get appropriate prefixes from the kernel's routing table,
and advertise the prefixes with the default parameters.
Keywords other than
.Cm clockskew
+and
+.Cm noifprefix
can be augmented with a number, like
.Dq Li prefix2 ,
to specify multiple prefixes.
.Bl -tag -width indent
+.It Cm \&noifprefix
+(bool) Specifies no prefix on the network interfaces will be advertised.
+By default
+.Nm rtadvd
+automatically gathers on-link prefixes from all of the network interfaces
+and advertise them.
+The
+.Cm noifprefix
+disables that behavior.
+If this is specified and no
+.Cm addr
+keyword is specified, no prefix information option will be included in the
+message.
.It Cm \&clockskew
(num) Time skew to adjust link propagation delays and clock skews
between routers on the link
@@ -355,6 +370,66 @@ However, keywords that start with
.Dq Li rtr
have basically been obsoleted, and should not be used any more.
.Pp
+The following items are for ICMPv6 Recursive DNS Server Option and
+DNS Search List Option
+.Pq RFC 6106 ,
+which will be attached to router advertisement header.
+These items are optional.
+.Bl -tag -width indent
+.It Cm \&rdnss
+(str) The IPv6 address of one or more recursive DNS servers.
+The argument must be inside double quotes.
+Multiple DNS servers can be specified in a comma-separated string.
+If different lifetimes are needed for different servers,
+separate entries can be given by using
+.Cm rdnss ,
+.Cm rdnss0 ,
+.Cm rdnss1 ,
+.Cm rdnss2 ...
+options with corresponding
+.Cm rdnssltime ,
+.Cm rdnssltime0 ,
+.Cm rdnssltime1 ,
+.Cm rdnssltime2 ...
+entries.
+Note that the maximum number of servers depends on the receiver side.
+See also
+.Xr resolver 5
+manual page for resolver implementation in
+.Fx .
+.It Cm \&rdnssltime
+The lifetime of the
+.Cm rdnss
+DNS server entries.
+The default value is 3/2 of the interval time.
+.It Cm \&dnssl
+(str) One or more domain names in a comma-separated string.
+These domain names will be used when making DNS queries on a
+non-fully-qualified domain name.
+If different lifetimes are needed for different domains, separate entries
+can be given by using
+.Cm dnssl ,
+.Cm dnssl0 ,
+.Cm dnssl1 ,
+.Cm dnssl2 ...
+options with corresponding
+.Cm dnsslltime ,
+.Cm dnsslltime0 ,
+.Cm dnsslltime1 ,
+.Cm dnsslltime2 ...
+entries.
+Note that the maximum number of names depends on the receiver side.
+See also
+.Xr resolver 5
+manual page for resolver implementation in
+.Fx .
+.It Cm \&dnsslltime
+The lifetime of the
+.Cm dnssl
+DNS search list entries.
+The default value is 3/2 of the interval time.
+.El
+.Pp
You can also refer one line from another by using
.Cm tc
capability.
@@ -388,7 +463,18 @@ option to
.Xr rtadvd 8 .
.Bd -literal -offset
ef0:\\
- :addr="3ffe:501:ffff:1000::":prefixlen#64:
+ :addr="2001:db8:ffff:1000::":prefixlen#64:
+.Ed
+.Pp
+The following example configures the
+.Li wlan0
+interface and adds two DNS servers and a DNS domain search options
+using the default option lifetime values.
+.Bd -literal -offset
+wlan0:\\
+ :addr="2001:db8:ffff:1000::":prefixlen#64:\\
+ :rdnss="2001:db8:ffff::10,2001:db8:ffff::2:43":\\
+ :dnssl="example.com":
.Ed
.Pp
The following example presents the default values in an explicit manner.
@@ -399,24 +485,41 @@ default:\\
:chlim#64:raflags#0:rltime#1800:rtime#0:retrans#0:\\
:pinfoflags="la":vltime#2592000:pltime#604800:mtu#0:
ef0:\\
- :addr="3ffe:501:ffff:1000::":prefixlen#64:tc=default:
+ :addr="2001:db8:ffff:1000::":prefixlen#64:tc=default:
.Ed
.Sh SEE ALSO
.Xr termcap 5 ,
+.Xr resolver 5 ,
.Xr rtadvd 8 ,
.Xr rtsol 8
.Rs
.%A Thomas Narten
.%A Erik Nordmark
.%A W. A. Simpson
+.%A Hesham Soliman
.%T Neighbor Discovery for IP version 6 (IPv6)
-.%R RFC 2461
+.%R RFC 4861
+.Re
+.Rs
+.%A Thomas Narten
+.%A Erik Nordmark
+.%A W. A. Simpson
+.%T Neighbor Discovery for IP version 6 (IPv6)
+.%R RFC 2461 (obsoleted by RFC 4861)
.Re
.Rs
.%A Richard Draves
.%T Default Router Preferences and More-Specific Routes
.%R draft-ietf-ipngwg-router-selection-xx.txt
.Re
+.Rs
+.%A J. Jeong
+.%A S. Park
+.%A L. Beloeil
+.%A S. Madanapalli
+.%T IPv6 Router Advertisement Options for DNS Configuration
+.%R RFC 6106
+.Re
.Sh HISTORY
The
.Xr rtadvd 8
diff --git a/usr.sbin/rtadvd/rtadvd.h b/usr.sbin/rtadvd/rtadvd.h
index 828fec6..190bb0d 100644
--- a/usr.sbin/rtadvd/rtadvd.h
+++ b/usr.sbin/rtadvd/rtadvd.h
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -30,11 +30,41 @@
* SUCH DAMAGE.
*/
-#define ALLNODES "ff02::1"
-#define ALLROUTERS_LINK "ff02::2"
-#define ALLROUTERS_SITE "ff05::2"
-#define ANY "::"
-#define RTSOLLEN 8
+#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
+ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
+
+#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
+ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
+
+#define IN6ADDR_SITELOCAL_ALLROUTERS_INIT \
+ {{{ 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
+
+extern struct sockaddr_in6 sin6_linklocal_allnodes;
+extern struct sockaddr_in6 sin6_linklocal_allrouters;
+extern struct sockaddr_in6 sin6_sitelocal_allrouters;
+
+/*
+ * RFC 3542 API deprecates IPV6_PKTINFO in favor of
+ * IPV6_RECVPKTINFO
+ */
+#ifndef IPV6_RECVPKTINFO
+#ifdef IPV6_PKTINFO
+#define IPV6_RECVPKTINFO IPV6_PKTINFO
+#endif
+#endif
+
+/*
+ * RFC 3542 API deprecates IPV6_HOPLIMIT in favor of
+ * IPV6_RECVHOPLIMIT
+ */
+#ifndef IPV6_RECVHOPLIMIT
+#ifdef IPV6_HOPLIMIT
+#define IPV6_RECVHOPLIMIT IPV6_HOPLIMIT
+#endif
+#endif
/* protocol constants and default values */
#define DEF_MAXRTRADVINTERVAL 600
@@ -62,100 +92,151 @@
#define PREFIX_FROM_DYNAMIC 3
struct prefix {
- struct prefix *next; /* forward link */
- struct prefix *prev; /* previous link */
-
- struct rainfo *rainfo; /* back pointer to the interface */
-
- struct rtadvd_timer *timer; /* expiration timer. used when a prefix
- * derived from the kernel is deleted.
- */
-
- u_int32_t validlifetime; /* AdvValidLifetime */
- long vltimeexpire; /* expiration of vltime; decrement case only */
- u_int32_t preflifetime; /* AdvPreferredLifetime */
- long pltimeexpire; /* expiration of pltime; decrement case only */
- u_int onlinkflg; /* bool: AdvOnLinkFlag */
- u_int autoconfflg; /* bool: AdvAutonomousFlag */
- int prefixlen;
- int origin; /* from kernel or config */
- struct in6_addr prefix;
+ TAILQ_ENTRY(prefix) pfx_next;
+
+ struct rainfo *pfx_rainfo; /* back pointer to the interface */
+ /*
+ * Expiration timer. This is used when a prefix derived from
+ * the kernel is deleted.
+ */
+ struct rtadvd_timer *pfx_timer;
+
+ u_int32_t pfx_validlifetime; /* AdvValidLifetime */
+ long pfx_vltimeexpire; /* Expiration of vltime */
+ u_int32_t pfx_preflifetime; /* AdvPreferredLifetime */
+ long pfx_pltimeexpire; /* Expiration of pltime */
+ u_int pfx_onlinkflg; /* bool: AdvOnLinkFlag */
+ u_int pfx_autoconfflg; /* bool: AdvAutonomousFlag */
+ int pfx_prefixlen;
+ int pfx_origin; /* From kernel or config */
+
+ struct in6_addr pfx_prefix;
};
#ifdef ROUTEINFO
struct rtinfo {
- struct rtinfo *prev; /* previous link */
- struct rtinfo *next; /* forward link */
+ TAILQ_ENTRY(rtinfo) rti_next;
- u_int32_t ltime; /* route lifetime */
- u_int rtpref; /* route preference */
- int prefixlen;
- struct in6_addr prefix;
+ u_int32_t rti_ltime; /* route lifetime */
+ u_int rti_rtpref; /* route preference */
+ int rti_prefixlen;
+ struct in6_addr rti_prefix;
};
#endif
+struct rdnss_addr {
+ TAILQ_ENTRY(rdnss_addr) ra_next;
+
+ struct in6_addr ra_dns; /* DNS server entry */
+};
+
+struct rdnss {
+ TAILQ_ENTRY(rdnss) rd_next;
+
+ TAILQ_HEAD(, rdnss_addr) rd_list; /* list of DNS servers */
+ int rd_cnt; /* number of DNS servers */
+ u_int32_t rd_ltime; /* number of seconds valid */
+};
+
+/*
+ * The maximum length of a domain name in a DNS search list is calculated
+ * by a domain name + length fields per 63 octets + a zero octet at
+ * the tail and adding 8 octet boundary padding.
+ */
+#define _DNAME_LABELENC_MAXLEN \
+ (NI_MAXHOST + (NI_MAXHOST / 64 + 1) + 1)
+
+#define DNAME_LABELENC_MAXLEN \
+ (_DNAME_LABELENC_MAXLEN + 8 - _DNAME_LABELENC_MAXLEN % 8)
+
+struct dnssl_addr {
+ TAILQ_ENTRY(dnssl_addr) da_next;
+
+ int da_len; /* length of entry */
+ char da_dom[DNAME_LABELENC_MAXLEN]; /* search domain name entry */
+};
+
+struct dnssl {
+ TAILQ_ENTRY(dnssl) dn_next;
+
+ TAILQ_HEAD(, dnssl_addr) dn_list; /* list of search domains */
+ u_int32_t dn_ltime; /* number of seconds valid */
+};
+
struct soliciter {
- struct soliciter *next;
- struct sockaddr_in6 addr;
+ TAILQ_ENTRY(soliciter) sol_next;
+
+ struct sockaddr_in6 sol_addr;
};
struct rainfo {
/* pointer for list */
- struct rainfo *next;
+ TAILQ_ENTRY(rainfo) rai_next;
/* timer related parameters */
- struct rtadvd_timer *timer;
- int initcounter; /* counter for the first few advertisements */
- struct timeval lastsent; /* timestamp when the latest RA was sent */
- int waiting; /* number of RS waiting for RA */
+ struct rtadvd_timer *rai_timer;
+ /* counter for the first few advertisements */
+ int rai_initcounter;
+ /* timestamp when the latest RA was sent */
+ struct timeval rai_lastsent;
+ /* number of RS waiting for RA */
+ int rai_waiting;
/* interface information */
- int ifindex;
- int advlinkopt; /* bool: whether include link-layer addr opt */
- struct sockaddr_dl *sdl;
- char ifname[16];
- int phymtu; /* mtu of the physical interface */
+ int rai_ifindex;
+ int rai_advlinkopt; /* bool: whether include link-layer addr opt */
+ int rai_advifprefix; /* bool: gather IF prefixes? */
+ struct sockaddr_dl *rai_sdl;
+ char rai_ifname[IFNAMSIZ];
+ u_int32_t rai_phymtu; /* mtu of the physical interface */
/* Router configuration variables */
- u_short lifetime; /* AdvDefaultLifetime */
- u_int maxinterval; /* MaxRtrAdvInterval */
- u_int mininterval; /* MinRtrAdvInterval */
- int managedflg; /* AdvManagedFlag */
- int otherflg; /* AdvOtherConfigFlag */
-
- int rtpref; /* router preference */
- u_int32_t linkmtu; /* AdvLinkMTU */
- u_int32_t reachabletime; /* AdvReachableTime */
- u_int32_t retranstimer; /* AdvRetransTimer */
- u_int hoplimit; /* AdvCurHopLimit */
- struct prefix prefix; /* AdvPrefixList(link head) */
- int pfxs; /* number of prefixes */
- long clockskew; /* used for consisitency check of lifetimes */
+ u_short rai_lifetime; /* AdvDefaultLifetime */
+ u_int rai_maxinterval; /* MaxRtrAdvInterval */
+ u_int rai_mininterval; /* MinRtrAdvInterval */
+ int rai_managedflg; /* AdvManagedFlag */
+ int rai_otherflg; /* AdvOtherConfigFlag */
+ int rai_rtpref; /* router preference */
+ u_int32_t rai_linkmtu; /* AdvLinkMTU */
+ u_int32_t rai_reachabletime; /* AdvReachableTime */
+ u_int32_t rai_retranstimer; /* AdvRetransTimer */
+ u_int rai_hoplimit; /* AdvCurHopLimit */
+
+ TAILQ_HEAD(, prefix) rai_prefix;/* AdvPrefixList(link head) */
+ int rai_pfxs; /* number of prefixes */
+
+ long rai_clockskew; /* used for consisitency check of lifetimes */
+
+ TAILQ_HEAD(, rdnss) rai_rdnss; /* DNS server list */
+ TAILQ_HEAD(, dnssl) rai_dnssl; /* search domain list */
#ifdef ROUTEINFO
- struct rtinfo route; /* route information option (link head) */
- int routes; /* number of route information options */
+ TAILQ_HEAD(, rtinfo) rai_route; /* route information option (link head) */
+ int rai_routes; /* number of route information options */
#endif
-
/* actual RA packet data and its length */
- size_t ra_datalen;
- u_char *ra_data;
+ size_t rai_ra_datalen;
+ u_char *rai_ra_data;
/* statistics */
- u_quad_t raoutput; /* number of RAs sent */
- u_quad_t rainput; /* number of RAs received */
- u_quad_t rainconsistent; /* number of RAs inconsistent with ours */
- u_quad_t rsinput; /* number of RSs received */
+ u_quad_t rai_raoutput; /* # of RAs sent */
+ u_quad_t rai_rainput; /* # of RAs received */
+ u_quad_t rai_rainconsistent; /* # of RAs inconsistent with ours */
+ u_quad_t rai_rsinput; /* # of RSs received */
/* info about soliciter */
- struct soliciter *soliciter; /* recent solication source */
+ TAILQ_HEAD(, soliciter) rai_soliciter; /* recent solication source */
};
-struct rtadvd_timer *ra_timeout(void *);
-void ra_timer_update(void *, struct timeval *);
+/* Interface list including RA information */
+extern TAILQ_HEAD(railist_head_t, rainfo) railist;
-int prefix_match(struct in6_addr *, int, struct in6_addr *, int);
-struct rainfo *if_indextorainfo(int);
-struct prefix *find_prefix(struct rainfo *, struct in6_addr *, int);
+struct rtadvd_timer *ra_timeout(void *);
+void ra_timer_update(void *, struct timeval *);
+void ra_output(struct rainfo *);
-extern struct in6_addr in6a_site_allrouters;
+int prefix_match(struct in6_addr *, int,
+ struct in6_addr *, int);
+struct rainfo *if_indextorainfo(int);
+struct prefix *find_prefix(struct rainfo *,
+ struct in6_addr *, int);
diff --git a/usr.sbin/rtadvd/timer.c b/usr.sbin/rtadvd/timer.c
index 7fb0902..8cad6ad 100644
--- a/usr.sbin/rtadvd/timer.c
+++ b/usr.sbin/rtadvd/timer.c
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -31,6 +31,7 @@
*/
#include <sys/time.h>
+#include <sys/queue.h>
#include <unistd.h>
#include <syslog.h>
@@ -39,21 +40,19 @@
#include <search.h>
#include "timer.h"
-static struct rtadvd_timer timer_head;
-
#define MILLION 1000000
-#define TIMEVAL_EQUAL(t1,t2) ((t1)->tv_sec == (t2)->tv_sec &&\
- (t1)->tv_usec == (t2)->tv_usec)
-static struct timeval tm_max = {0x7fffffff, 0x7fffffff};
+struct rtadvd_timer_head_t ra_timer =
+ TAILQ_HEAD_INITIALIZER(ra_timer);
+static struct timeval tm_limit = {0x7fffffff, 0x7fffffff};
+static struct timeval tm_max;
void
-rtadvd_timer_init()
+rtadvd_timer_init(void)
{
- memset(&timer_head, 0, sizeof(timer_head));
- timer_head.next = timer_head.prev = &timer_head;
- timer_head.tm = tm_max;
+ tm_max = tm_limit;
+ TAILQ_INIT(&ra_timer);
}
struct rtadvd_timer *
@@ -61,54 +60,57 @@ rtadvd_add_timer(struct rtadvd_timer *(*timeout)(void *),
void (*update)(void *, struct timeval *),
void *timeodata, void *updatedata)
{
- struct rtadvd_timer *newtimer;
+ struct rtadvd_timer *rat;
- if ((newtimer = malloc(sizeof(*newtimer))) == NULL) {
+ if (timeout == NULL) {
syslog(LOG_ERR,
- "<%s> can't allocate memory", __func__);
+ "<%s> timeout function unspecified", __func__);
exit(1);
}
- memset(newtimer, 0, sizeof(*newtimer));
-
- if (timeout == NULL) {
+ rat = malloc(sizeof(*rat));
+ if (rat == NULL) {
syslog(LOG_ERR,
- "<%s> timeout function unspecified", __func__);
+ "<%s> can't allocate memory", __func__);
exit(1);
}
- newtimer->expire = timeout;
- newtimer->update = update;
- newtimer->expire_data = timeodata;
- newtimer->update_data = updatedata;
- newtimer->tm = tm_max;
+ memset(rat, 0, sizeof(*rat));
+
+ rat->rat_expire = timeout;
+ rat->rat_update = update;
+ rat->rat_expire_data = timeodata;
+ rat->rat_update_data = updatedata;
+ rat->rat_tm = tm_max;
/* link into chain */
- insque(newtimer, &timer_head);
+ TAILQ_INSERT_TAIL(&ra_timer, rat, rat_next);
- return(newtimer);
+ return (rat);
}
void
-rtadvd_remove_timer(struct rtadvd_timer **timer)
+rtadvd_remove_timer(struct rtadvd_timer *rat)
{
- remque(*timer);
- free(*timer);
- *timer = NULL;
+
+ if (rat == NULL)
+ return;
+
+ TAILQ_REMOVE(&ra_timer, rat, rat_next);
+ free(rat);
}
void
-rtadvd_set_timer(struct timeval *tm, struct rtadvd_timer *timer)
+rtadvd_set_timer(struct timeval *tm, struct rtadvd_timer *rat)
{
struct timeval now;
/* reset the timer */
gettimeofday(&now, NULL);
-
- TIMEVAL_ADD(&now, tm, &timer->tm);
+ TIMEVAL_ADD(&now, tm, &rat->rat_tm);
/* update the next expiration time */
- if (TIMEVAL_LT(timer->tm, timer_head.tm))
- timer_head.tm = timer->tm;
+ if (TIMEVAL_LT(&rat->rat_tm, &tm_max))
+ tm_max = rat->rat_tm;
return;
}
@@ -119,58 +121,52 @@ rtadvd_set_timer(struct timeval *tm, struct rtadvd_timer *timer)
* Return the next interval for select() call.
*/
struct timeval *
-rtadvd_check_timer()
+rtadvd_check_timer(void)
{
static struct timeval returnval;
struct timeval now;
- struct rtadvd_timer *tm = timer_head.next, *tm_next;
+ struct rtadvd_timer *rat;
gettimeofday(&now, NULL);
-
- timer_head.tm = tm_max;
-
- for (tm = timer_head.next; tm != &timer_head; tm = tm_next) {
- tm_next = tm->next;
-
- if (TIMEVAL_LEQ(tm->tm, now)) {
- if (((*tm->expire)(tm->expire_data) == NULL))
+ tm_max = tm_limit;
+ TAILQ_FOREACH(rat, &ra_timer, rat_next) {
+ if (TIMEVAL_LEQ(&rat->rat_tm, &now)) {
+ if (((*rat->rat_expire)(rat->rat_expire_data) == NULL))
continue; /* the timer was removed */
- if (tm->update)
- (*tm->update)(tm->update_data, &tm->tm);
- TIMEVAL_ADD(&tm->tm, &now, &tm->tm);
+ if (rat->rat_update)
+ (*rat->rat_update)(rat->rat_update_data, &rat->rat_tm);
+ TIMEVAL_ADD(&rat->rat_tm, &now, &rat->rat_tm);
}
-
- if (TIMEVAL_LT(tm->tm, timer_head.tm))
- timer_head.tm = tm->tm;
+ if (TIMEVAL_LT(&rat->rat_tm, &tm_max))
+ tm_max = rat->rat_tm;
}
-
- if (TIMEVAL_EQUAL(&tm_max, &timer_head.tm)) {
+ if (TIMEVAL_EQUAL(&tm_max, &tm_limit)) {
/* no need to timeout */
- return(NULL);
- } else if (TIMEVAL_LT(timer_head.tm, now)) {
+ return (NULL);
+ } else if (TIMEVAL_LT(&tm_max, &now)) {
/* this may occur when the interval is too small */
returnval.tv_sec = returnval.tv_usec = 0;
} else
- TIMEVAL_SUB(&timer_head.tm, &now, &returnval);
- return(&returnval);
+ TIMEVAL_SUB(&tm_max, &now, &returnval);
+ return (&returnval);
}
struct timeval *
-rtadvd_timer_rest(struct rtadvd_timer *timer)
+rtadvd_timer_rest(struct rtadvd_timer *rat)
{
static struct timeval returnval, now;
gettimeofday(&now, NULL);
- if (TIMEVAL_LEQ(timer->tm, now)) {
+ if (TIMEVAL_LEQ(&rat->rat_tm, &now)) {
syslog(LOG_DEBUG,
- "<%s> a timer must be expired, but not yet",
- __func__);
+ "<%s> a timer must be expired, but not yet",
+ __func__);
returnval.tv_sec = returnval.tv_usec = 0;
}
else
- TIMEVAL_SUB(&timer->tm, &now, &returnval);
+ TIMEVAL_SUB(&rat->rat_tm, &now, &returnval);
- return(&returnval);
+ return (&returnval);
}
/* result = a + b */
diff --git a/usr.sbin/rtadvd/timer.h b/usr.sbin/rtadvd/timer.h
index 4526103..e2e0c65 100644
--- a/usr.sbin/rtadvd/timer.h
+++ b/usr.sbin/rtadvd/timer.h
@@ -4,7 +4,7 @@
/*
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -16,7 +16,7 @@
* 3. Neither the name of the project 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 PROJECT 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
@@ -31,35 +31,42 @@
*/
/* a < b */
-#define TIMEVAL_LT(a, b) (((a).tv_sec < (b).tv_sec) ||\
- (((a).tv_sec == (b).tv_sec) && \
- ((a).tv_usec < (b).tv_usec)))
+#define TIMEVAL_LT(a, b) \
+ (((a)->tv_sec < (b)->tv_sec) || \
+ (((a)->tv_sec == (b)->tv_sec) && \
+ ((a)->tv_usec < (b)->tv_usec)))
/* a <= b */
-#define TIMEVAL_LEQ(a, b) (((a).tv_sec < (b).tv_sec) ||\
- (((a).tv_sec == (b).tv_sec) &&\
- ((a).tv_usec <= (b).tv_usec)))
+#define TIMEVAL_LEQ(a, b) \
+ (((a)->tv_sec < (b)->tv_sec) || \
+ (((a)->tv_sec == (b)->tv_sec) && \
+ ((a)->tv_usec <= (b)->tv_usec)))
+#define TIMEVAL_EQUAL(a,b) \
+ (((a)->tv_sec == (b)->tv_sec) && \
+ ((a)->tv_usec == (b)->tv_usec))
+
+extern TAILQ_HEAD(rtadvd_timer_head_t, rtadvd_timer) ra_timer;
struct rtadvd_timer {
- struct rtadvd_timer *next;
- struct rtadvd_timer *prev;
- struct rainfo *rai;
- struct timeval tm;
+ TAILQ_ENTRY(rtadvd_timer) rat_next;
- struct rtadvd_timer *(*expire)(void *); /* expiration function */
- void *expire_data;
- void (*update)(void *, struct timeval *); /* update function */
- void *update_data;
+ struct rainfo *rat_rai;
+ struct timeval rat_tm;
+ struct rtadvd_timer *(*rat_expire)(void *);
+ void *rat_expire_data;
+ void (*rat_update)(void *, struct timeval *);
+ void *rat_update_data;
};
-void rtadvd_timer_init(void);
-struct rtadvd_timer *rtadvd_add_timer(struct rtadvd_timer *(*)(void *),
- void (*)(void *, struct timeval *), void *, void *);
-void rtadvd_set_timer(struct timeval *, struct rtadvd_timer *);
-void rtadvd_remove_timer(struct rtadvd_timer **);
-struct timeval * rtadvd_check_timer(void);
-struct timeval * rtadvd_timer_rest(struct rtadvd_timer *);
-void TIMEVAL_ADD(struct timeval *, struct timeval *,
- struct timeval *);
-void TIMEVAL_SUB(struct timeval *, struct timeval *,
- struct timeval *);
+void rtadvd_timer_init(void);
+struct rtadvd_timer *rtadvd_add_timer(struct rtadvd_timer *(*)(void *),
+ void (*)(void *, struct timeval *), void *, void *);
+void rtadvd_set_timer(struct timeval *,
+ struct rtadvd_timer *);
+void rtadvd_remove_timer(struct rtadvd_timer *);
+struct timeval *rtadvd_check_timer(void);
+struct timeval *rtadvd_timer_rest(struct rtadvd_timer *);
+void TIMEVAL_ADD(struct timeval *, struct timeval *,
+ struct timeval *);
+void TIMEVAL_SUB(struct timeval *, struct timeval *,
+ struct timeval *);
diff --git a/usr.sbin/rtsold/dump.c b/usr.sbin/rtsold/dump.c
index 2756b87..52d4b62 100644
--- a/usr.sbin/rtsold/dump.c
+++ b/usr.sbin/rtsold/dump.c
@@ -34,10 +34,12 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
+#include <sys/queue.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/icmp6.h>
+#include <arpa/inet.h>
#include <syslog.h>
#include <time.h>
@@ -52,47 +54,73 @@ static FILE *fp;
extern struct ifinfo *iflist;
static void dump_interface_status(void);
-static const char *sec2str(time_t);
static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"};
static void
dump_interface_status(void)
{
- struct ifinfo *ifinfo;
+ struct ifinfo *ifi;
+ struct rainfo *rai;
+ struct ra_opt *rao;
struct timeval now;
+ char ntopbuf[INET6_ADDRSTRLEN];
gettimeofday(&now, NULL);
- for (ifinfo = iflist; ifinfo; ifinfo = ifinfo->next) {
- fprintf(fp, "Interface %s\n", ifinfo->ifname);
+ TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) {
+ fprintf(fp, "Interface %s\n", ifi->ifname);
fprintf(fp, " probe interval: ");
- if (ifinfo->probeinterval) {
- fprintf(fp, "%d\n", ifinfo->probeinterval);
- fprintf(fp, " probe timer: %d\n", ifinfo->probetimer);
+ if (ifi->probeinterval) {
+ fprintf(fp, "%d\n", ifi->probeinterval);
+ fprintf(fp, " probe timer: %d\n", ifi->probetimer);
} else {
fprintf(fp, "infinity\n");
fprintf(fp, " no probe timer\n");
}
fprintf(fp, " interface status: %s\n",
- ifinfo->active > 0 ? "active" : "inactive");
+ ifi->active > 0 ? "active" : "inactive");
fprintf(fp, " other config: %s\n",
- ifinfo->otherconfig ? "on" : "off");
- fprintf(fp, " rtsold status: %s\n", ifstatstr[ifinfo->state]);
+ ifi->otherconfig ? "on" : "off");
+ fprintf(fp, " rtsold status: %s\n", ifstatstr[ifi->state]);
fprintf(fp, " carrier detection: %s\n",
- ifinfo->mediareqok ? "available" : "unavailable");
+ ifi->mediareqok ? "available" : "unavailable");
fprintf(fp, " probes: %d, dadcount = %d\n",
- ifinfo->probes, ifinfo->dadcount);
- if (ifinfo->timer.tv_sec == tm_max.tv_sec &&
- ifinfo->timer.tv_usec == tm_max.tv_usec)
+ ifi->probes, ifi->dadcount);
+ if (ifi->timer.tv_sec == tm_max.tv_sec &&
+ ifi->timer.tv_usec == tm_max.tv_usec)
fprintf(fp, " no timer\n");
else {
fprintf(fp, " timer: interval=%d:%d, expire=%s\n",
- (int)ifinfo->timer.tv_sec,
- (int)ifinfo->timer.tv_usec,
- (ifinfo->expire.tv_sec < now.tv_sec) ? "expired"
- : sec2str(ifinfo->expire.tv_sec - now.tv_sec));
+ (int)ifi->timer.tv_sec,
+ (int)ifi->timer.tv_usec,
+ (ifi->expire.tv_sec < now.tv_sec) ? "expired"
+ : sec2str(&ifi->expire));
+ }
+ fprintf(fp, " number of valid RAs: %d\n", ifi->racnt);
+
+ TAILQ_FOREACH(rai, &ifi->ifi_rainfo, rai_next) {
+ fprintf(fp, " RA from %s\n",
+ inet_ntop(AF_INET6, &rai->rai_saddr.sin6_addr,
+ ntopbuf, sizeof(ntopbuf)));
+ TAILQ_FOREACH(rao, &rai->rai_ra_opt, rao_next) {
+ fprintf(fp, " option: ");
+ switch (rao->rao_type) {
+ case ND_OPT_RDNSS:
+ fprintf(fp, "RDNSS: %s (expire: %s)\n",
+ (char *)rao->rao_msg,
+ sec2str(&rao->rao_expire));
+ break;
+ case ND_OPT_DNSSL:
+ fprintf(fp, "DNSSL: %s (expire: %s)\n",
+ (char *)rao->rao_msg,
+ sec2str(&rao->rao_expire));
+ break;
+ default:
+ break;
+ }
+ }
+ fprintf(fp, "\n");
}
- fprintf(fp, " number of valid RAs: %d\n", ifinfo->racnt);
}
}
@@ -108,8 +136,8 @@ rtsold_dump_file(const char *dumpfile)
fclose(fp);
}
-static const char *
-sec2str(time_t total)
+const char *
+sec2str(const struct timeval *total)
{
static char result[256];
int days, hours, mins, secs;
@@ -117,11 +145,19 @@ sec2str(time_t total)
char *p = result;
char *ep = &result[sizeof(result)];
int n;
+ struct timeval now;
+ time_t tsec;
- days = total / 3600 / 24;
- hours = (total / 3600) % 24;
- mins = (total / 60) % 60;
- secs = total % 60;
+ gettimeofday(&now, NULL);
+ tsec = total->tv_sec;
+ tsec += total->tv_usec / 1000000;
+ tsec -= now.tv_sec;
+ tsec -= now.tv_usec / 1000000;
+
+ days = tsec / 3600 / 24;
+ hours = (tsec / 3600) % 24;
+ mins = (tsec / 60) % 60;
+ secs = tsec % 60;
if (days) {
first = 0;
@@ -145,5 +181,6 @@ sec2str(time_t total)
p += n;
}
snprintf(p, ep - p, "%ds", secs);
- return(result);
+
+ return (result);
}
diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c
index c555d2a..58ec514 100644
--- a/usr.sbin/rtsold/if.c
+++ b/usr.sbin/rtsold/if.c
@@ -91,25 +91,25 @@ interface_up(char *name)
if (ioctl(ifsock, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) {
warnmsg(LOG_WARNING, __func__, "ioctl(SIOCGIFFLAGS): %s",
strerror(errno));
- return(-1);
+ return (-1);
}
if (!(ifr.ifr_flags & IFF_UP)) {
ifr.ifr_flags |= IFF_UP;
if (ioctl(ifsock, SIOCSIFFLAGS, (caddr_t)&ifr) < 0)
warnmsg(LOG_ERR, __func__,
"ioctl(SIOCSIFFLAGS): %s", strerror(errno));
- return(-1);
+ return (-1);
}
if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
warnmsg(LOG_WARNING, __func__, "socket(AF_INET6, SOCK_DGRAM): %s",
strerror(errno));
- return(-1);
+ return (-1);
}
if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) {
warnmsg(LOG_WARNING, __func__, "ioctl(SIOCGIFINFO_IN6): %s",
strerror(errno));
close(s);
- return(-1);
+ return (-1);
}
warnmsg(LOG_DEBUG, __func__, "checking if %s is ready...", name);
@@ -122,13 +122,13 @@ interface_up(char *name)
"ioctl(SIOCSIFINFO_IN6): %s",
strerror(errno));
close(s);
- return(-1);
+ return (-1);
}
} else {
warnmsg(LOG_WARNING, __func__,
"%s is disabled.", name);
close(s);
- return(-1);
+ return (-1);
}
}
if (!(nd.ndi.flags & ND6_IFF_ACCEPT_RTADV)) {
@@ -139,13 +139,13 @@ interface_up(char *name)
"ioctl(SIOCSIFINFO_IN6): %s",
strerror(errno));
close(s);
- return(-1);
+ return (-1);
}
} else {
warnmsg(LOG_WARNING, __func__,
"%s does not accept Router Advertisement.", name);
close(s);
- return(-1);
+ return (-1);
}
}
close(s);
@@ -154,22 +154,22 @@ interface_up(char *name)
if (llflag < 0) {
warnmsg(LOG_WARNING, __func__,
"get_llflag() failed, anyway I'll try");
- return 0;
+ return (0);
}
if (!(llflag & IN6_IFF_NOTREADY)) {
warnmsg(LOG_DEBUG, __func__, "%s is ready", name);
- return(0);
+ return (0);
} else {
if (llflag & IN6_IFF_TENTATIVE) {
warnmsg(LOG_DEBUG, __func__, "%s is tentative",
name);
- return IFS_TENTATIVE;
+ return (IFS_TENTATIVE);
}
if (llflag & IN6_IFF_DUPLICATED)
warnmsg(LOG_DEBUG, __func__, "%s is duplicated",
name);
- return -1;
+ return (-1);
}
}
@@ -186,16 +186,14 @@ interface_status(struct ifinfo *ifinfo)
if (ioctl(ifsock, SIOCGIFFLAGS, &ifr) < 0) {
warnmsg(LOG_ERR, __func__, "ioctl(SIOCGIFFLAGS) on %s: %s",
ifname, strerror(errno));
- return(-1);
+ return (-1);
}
/*
* if one of UP and RUNNING flags is dropped,
* the interface is not active.
*/
- if ((ifr.ifr_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {
+ if ((ifr.ifr_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
goto inactive;
- }
-
/* Next, check carrier on the interface, if possible */
if (!ifinfo->mediareqok)
goto active;
@@ -232,10 +230,10 @@ interface_status(struct ifinfo *ifinfo)
}
inactive:
- return(0);
+ return (0);
active:
- return(1);
+ return (1);
}
#define ROUNDUP(a, size) \
@@ -254,9 +252,9 @@ lladdropt_length(struct sockaddr_dl *sdl)
#ifdef IFT_IEEE80211
case IFT_IEEE80211:
#endif
- return(ROUNDUP8(ETHER_ADDR_LEN + 2));
+ return (ROUNDUP8(ETHER_ADDR_LEN + 2));
default:
- return(0);
+ return (0);
}
}
@@ -301,7 +299,7 @@ if_nametosdl(char *name)
return(NULL);
if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) {
free(buf);
- return(NULL);
+ return (NULL);
}
lim = buf + len;
@@ -327,17 +325,17 @@ if_nametosdl(char *name)
if (next == lim) {
/* search failed */
free(buf);
- return(NULL);
+ return (NULL);
}
if ((ret_sdl = malloc(sdl->sdl_len)) == NULL) {
free(buf);
- return(NULL);
+ return (NULL);
}
memcpy((caddr_t)ret_sdl, (caddr_t)sdl, sdl->sdl_len);
free(buf);
- return(ret_sdl);
+ return (ret_sdl);
}
int
@@ -350,9 +348,9 @@ getinet6sysctl(int code)
mib[3] = code;
size = sizeof(value);
if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &value, &size, NULL, 0) < 0)
- return -1;
+ return (-1);
else
- return value;
+ return (value);
}
int
@@ -366,9 +364,9 @@ setinet6sysctl(int code, int newval)
size = sizeof(value);
if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &value, &size,
&newval, sizeof(newval)) < 0)
- return -1;
+ return (-1);
else
- return value;
+ return (value);
}
/*------------------------------------------------------------*/
@@ -414,12 +412,12 @@ get_llflag(const char *name)
freeifaddrs(ifap);
close(s);
- return ifr6.ifr_ifru.ifru_flags6;
+ return (ifr6.ifr_ifru.ifru_flags6);
}
freeifaddrs(ifap);
close(s);
- return -1;
+ return (-1);
}
diff --git a/usr.sbin/rtsold/probe.c b/usr.sbin/rtsold/probe.c
index 6d0ea79..657ae40 100644
--- a/usr.sbin/rtsold/probe.c
+++ b/usr.sbin/rtsold/probe.c
@@ -72,18 +72,18 @@ probe_init(void)
if (sndcmsgbuf == NULL &&
(sndcmsgbuf = (u_char *)malloc(scmsglen)) == NULL) {
warnmsg(LOG_ERR, __func__, "malloc failed");
- return(-1);
+ return (-1);
}
if ((probesock = socket(AF_INET6, SOCK_RAW, IPPROTO_NONE)) < 0) {
warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno));
- return(-1);
+ return (-1);
}
/* make the socket send-only */
if (shutdown(probesock, 0)) {
warnmsg(LOG_ERR, __func__, "shutdown: %s", strerror(errno));
- return(-1);
+ return (-1);
}
/* initialize msghdr for sending packets */
@@ -92,7 +92,8 @@ probe_init(void)
sndmhdr.msg_iovlen = 1;
sndmhdr.msg_control = (caddr_t)sndcmsgbuf;
sndmhdr.msg_controllen = scmsglen;
- return(0);
+
+ return (0);
}
/*
diff --git a/usr.sbin/rtsold/rtsock.c b/usr.sbin/rtsold/rtsock.c
index 726c1e6..fe22bc7 100644
--- a/usr.sbin/rtsold/rtsock.c
+++ b/usr.sbin/rtsold/rtsock.c
@@ -83,7 +83,7 @@ int
rtsock_open(void)
{
- return socket(PF_ROUTE, SOCK_RAW, 0);
+ return (socket(PF_ROUTE, SOCK_RAW, 0));
}
int
@@ -130,7 +130,7 @@ rtsock_input(int s)
}
}
- return ret;
+ return (ret);
}
#ifdef RTM_IFANNOUNCE /*NetBSD 1.5 or later*/
@@ -142,7 +142,7 @@ rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim)
ifan = (struct if_announcemsghdr *)rtm;
if ((char *)(ifan + 1) > lim)
- return -1;
+ return (-1);
switch (ifan->ifan_what) {
case IFAN_ARRIVAL:
@@ -170,6 +170,6 @@ rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, char *lim)
break;
}
- return 0;
+ return (0);
}
#endif
diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c
index be2a9b8..13845f3 100644
--- a/usr.sbin/rtsold/rtsol.c
+++ b/usr.sbin/rtsold/rtsol.c
@@ -2,6 +2,7 @@
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * Copyright (C) 2011 Hiroki Sato
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,13 +44,16 @@
#include <net/route.h>
#include <net/if_dl.h>
+#define __BSD_VISIBLE 1 /* IN6ADDR_LINKLOCAL_ALLROUTERS_INIT */
#include <netinet/in.h>
+#undef __BSD_VISIBLE
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#include <netinet/icmp6.h>
#include <arpa/inet.h>
+#include <netdb.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
@@ -61,8 +65,6 @@
#include <syslog.h>
#include "rtsold.h"
-#define ALLROUTER "ff02::2"
-
static struct msghdr rcvmhdr;
static struct msghdr sndmhdr;
static struct iovec rcviov[2];
@@ -71,14 +73,40 @@ static struct sockaddr_in6 from;
static int rcvcmsglen;
int rssock;
+struct ifinfo_head_t ifinfo_head =
+ TAILQ_HEAD_INITIALIZER(ifinfo_head);
-static struct sockaddr_in6 sin6_allrouters = {
+static const struct sockaddr_in6 sin6_allrouters = {
.sin6_len = sizeof(sin6_allrouters),
.sin6_family = AF_INET6,
+ .sin6_addr = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT,
};
-static void call_script(char *, char *);
+static void call_script(const int, const char *const *, void *);
+static size_t dname_labeldec(char *, size_t, const char *);
static int safefile(const char *);
+static struct ra_opt *find_raopt(struct rainfo *, int, void *, size_t);
+
+#define _ARGS_OTHER otherconf_script, ifi->ifname
+#define _ARGS_RESADD resolvconf_script, "-a", ifi->ifname
+#define _ARGS_RESDEL resolvconf_script, "-d", ifi->ifname
+
+#define CALL_SCRIPT(name, sm_head) \
+ do { \
+ const char *const sarg[] = { _ARGS_##name, NULL }; \
+ call_script(sizeof(sarg), sarg, sm_head); \
+ } while(0)
+
+#define ELM_MALLOC(p,error_action) \
+ do { \
+ p = malloc(sizeof(*p)); \
+ if (p == NULL) { \
+ warnmsg(LOG_ERR, __func__, "malloc failed: %s", \
+ strerror(errno)); \
+ error_action; \
+ } \
+ memset(p, 0, sizeof(*p)); \
+ } while(0)
int
sockopen(void)
@@ -93,63 +121,35 @@ sockopen(void)
if (rcvcmsgbuf == NULL && (rcvcmsgbuf = malloc(rcvcmsglen)) == NULL) {
warnmsg(LOG_ERR, __func__,
"malloc for receive msghdr failed");
- return(-1);
+ return (-1);
}
if (sndcmsgbuf == NULL && (sndcmsgbuf = malloc(sndcmsglen)) == NULL) {
warnmsg(LOG_ERR, __func__,
"malloc for send msghdr failed");
- return(-1);
- }
- memset(&sin6_allrouters, 0, sizeof(struct sockaddr_in6));
- sin6_allrouters.sin6_family = AF_INET6;
- sin6_allrouters.sin6_len = sizeof(sin6_allrouters);
- if (inet_pton(AF_INET6, ALLROUTER,
- &sin6_allrouters.sin6_addr.s6_addr) != 1) {
- warnmsg(LOG_ERR, __func__, "inet_pton failed for %s",
- ALLROUTER);
- return(-1);
+ return (-1);
}
-
if ((rssock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) {
warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno));
- return(-1);
+ return (-1);
}
/* specify to tell receiving interface */
on = 1;
-#ifdef IPV6_RECVPKTINFO
if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on,
sizeof(on)) < 0) {
warnmsg(LOG_ERR, __func__, "IPV6_RECVPKTINFO: %s",
strerror(errno));
exit(1);
}
-#else /* old adv. API */
- if (setsockopt(rssock, IPPROTO_IPV6, IPV6_PKTINFO, &on,
- sizeof(on)) < 0) {
- warnmsg(LOG_ERR, __func__, "IPV6_PKTINFO: %s",
- strerror(errno));
- exit(1);
- }
-#endif
- on = 1;
/* specify to tell value of hoplimit field of received IP6 hdr */
-#ifdef IPV6_RECVHOPLIMIT
+ on = 1;
if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on,
sizeof(on)) < 0) {
warnmsg(LOG_ERR, __func__, "IPV6_RECVHOPLIMIT: %s",
strerror(errno));
exit(1);
}
-#else /* old adv. API */
- if (setsockopt(rssock, IPPROTO_IPV6, IPV6_HOPLIMIT, &on,
- sizeof(on)) < 0) {
- warnmsg(LOG_ERR, __func__, "IPV6_HOPLIMIT: %s",
- strerror(errno));
- exit(1);
- }
-#endif
/* specfiy to accept only router advertisements on the socket */
ICMP6_FILTER_SETBLOCKALL(&filt);
@@ -176,11 +176,11 @@ sockopen(void)
sndmhdr.msg_control = (caddr_t)sndcmsgbuf;
sndmhdr.msg_controllen = sndcmsglen;
- return(rssock);
+ return (rssock);
}
void
-sendpacket(struct ifinfo *ifinfo)
+sendpacket(struct ifinfo *ifi)
{
struct in6_pktinfo *pi;
struct cmsghdr *cm;
@@ -189,11 +189,11 @@ sendpacket(struct ifinfo *ifinfo)
struct sockaddr_in6 dst;
dst = sin6_allrouters;
- dst.sin6_scope_id = ifinfo->linkid;
+ dst.sin6_scope_id = ifi->linkid;
sndmhdr.msg_name = (caddr_t)&dst;
- sndmhdr.msg_iov[0].iov_base = (caddr_t)ifinfo->rs_data;
- sndmhdr.msg_iov[0].iov_len = ifinfo->rs_datalen;
+ sndmhdr.msg_iov[0].iov_base = (caddr_t)ifi->rs_data;
+ sndmhdr.msg_iov[0].iov_len = ifi->rs_datalen;
cm = CMSG_FIRSTHDR(&sndmhdr);
/* specify the outgoing interface */
@@ -202,7 +202,7 @@ sendpacket(struct ifinfo *ifinfo)
cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
pi = (struct in6_pktinfo *)CMSG_DATA(cm);
memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/
- pi->ipi6_ifindex = ifinfo->sdl->sdl_index;
+ pi->ipi6_ifindex = ifi->sdl->sdl_index;
/* specify the hop limit of the packet */
cm = CMSG_NXTHDR(&sndmhdr, cm);
@@ -213,38 +213,53 @@ sendpacket(struct ifinfo *ifinfo)
warnmsg(LOG_DEBUG, __func__,
"send RS on %s, whose state is %d",
- ifinfo->ifname, ifinfo->state);
+ ifi->ifname, ifi->state);
i = sendmsg(rssock, &sndmhdr, 0);
- if (i < 0 || (size_t)i != ifinfo->rs_datalen) {
+ if (i < 0 || (size_t)i != ifi->rs_datalen) {
/*
* ENETDOWN is not so serious, especially when using several
* network cards on a mobile node. We ignore it.
*/
if (errno != ENETDOWN || dflag > 0)
warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s",
- ifinfo->ifname, strerror(errno));
+ ifi->ifname, strerror(errno));
}
/* update counter */
- ifinfo->probes++;
+ ifi->probes++;
}
void
rtsol_input(int s)
{
u_char ntopbuf[INET6_ADDRSTRLEN], ifnamebuf[IFNAMSIZ];
- int ifindex = 0, *hlimp = NULL;
- ssize_t i;
+ int l, ifindex = 0, *hlimp = NULL;
+ ssize_t msglen;
struct in6_pktinfo *pi = NULL;
struct ifinfo *ifi = NULL;
+ struct ra_opt *rao = NULL;
struct icmp6_hdr *icp;
struct nd_router_advert *nd_ra;
struct cmsghdr *cm;
+ struct rainfo *rai;
+ char *raoptp;
+ char *p;
+ struct in6_addr *addr;
+ struct nd_opt_hdr *ndo;
+ struct nd_opt_rdnss *rdnss;
+ struct nd_opt_dnssl *dnssl;
+ size_t len;
+ char nsbuf[INET6_ADDRSTRLEN + 1 + IFNAMSIZ + 1];
+ char dname[NI_MAXHOST];
+ struct timeval now;
+ struct timeval lifetime;
+ int newent_rai;
+ int newent_rao;
/* get message. namelen and controllen must always be initialized. */
rcvmhdr.msg_namelen = sizeof(from);
rcvmhdr.msg_controllen = rcvcmsglen;
- if ((i = recvmsg(s, &rcvmhdr, 0)) < 0) {
+ if ((msglen = recvmsg(s, &rcvmhdr, 0)) < 0) {
warnmsg(LOG_ERR, __func__, "recvmsg: %s", strerror(errno));
return;
}
@@ -275,9 +290,9 @@ rtsol_input(int s)
return;
}
- if ((size_t)i < sizeof(struct nd_router_advert)) {
+ if ((size_t)msglen < sizeof(struct nd_router_advert)) {
warnmsg(LOG_INFO, __func__,
- "packet size(%zd) is too short", i);
+ "packet size(%zd) is too short", msglen);
return;
}
@@ -354,9 +369,179 @@ rtsol_input(int s)
warnmsg(LOG_DEBUG, __func__,
"OtherConfigFlag on %s is turned on", ifi->ifname);
ifi->otherconfig = 1;
- call_script(otherconf_script, ifi->ifname);
+ CALL_SCRIPT(OTHER, NULL);
+ }
+ gettimeofday(&now, NULL);
+ newent_rai = 0;
+ rai = find_rainfo(ifi, &from);
+ if (rai == NULL) {
+ ELM_MALLOC(rai, exit(1));
+ rai->rai_ifinfo = ifi;
+ TAILQ_INIT(&rai->rai_ra_opt);
+ memcpy(&rai->rai_saddr.sin6_addr, &from.sin6_addr,
+ sizeof(rai->rai_saddr.sin6_addr));
+ newent_rai = 1;
}
+#define RA_OPT_NEXT_HDR(x) (struct nd_opt_hdr *)((char *)x + \
+ (((struct nd_opt_hdr *)x)->nd_opt_len * 8))
+ /* Process RA options. */
+ warnmsg(LOG_DEBUG, __func__, "Processing RA");
+ raoptp = (char *)icp + sizeof(struct nd_router_advert);
+ while (raoptp < (char *)icp + msglen) {
+ ndo = (struct nd_opt_hdr *)raoptp;
+ warnmsg(LOG_DEBUG, __func__, "ndo = %p", raoptp);
+ warnmsg(LOG_DEBUG, __func__, "ndo->nd_opt_type = %d",
+ ndo->nd_opt_type);
+ warnmsg(LOG_DEBUG, __func__, "ndo->nd_opt_len = %d",
+ ndo->nd_opt_len);
+
+ switch (ndo->nd_opt_type) {
+ case ND_OPT_RDNSS:
+ rdnss = (struct nd_opt_rdnss *)raoptp;
+
+ /* Optlen sanity check (Section 5.3.1 in RFC 6106) */
+ if (rdnss->nd_opt_rdnss_len < 3) {
+ warnmsg(LOG_INFO, __func__,
+ "too short RDNSS option"
+ "in RA from %s was ignored.",
+ inet_ntop(AF_INET6, &from.sin6_addr,
+ ntopbuf, INET6_ADDRSTRLEN));
+ break;
+ }
+
+ addr = (struct in6_addr *)(raoptp + sizeof(*rdnss));
+ while ((char *)addr < (char *)RA_OPT_NEXT_HDR(raoptp)) {
+ if (inet_ntop(AF_INET6, addr, ntopbuf,
+ INET6_ADDRSTRLEN) == NULL) {
+ warnmsg(LOG_INFO, __func__,
+ "an invalid address in RDNSS option"
+ " in RA from %s was ignored.",
+ inet_ntop(AF_INET6, &from.sin6_addr,
+ ntopbuf, INET6_ADDRSTRLEN));
+ addr++;
+ continue;
+ }
+ if (IN6_IS_ADDR_LINKLOCAL(addr))
+ /* XXX: % has to be escaped here */
+ l = snprintf(nsbuf, sizeof(nsbuf),
+ "%s%c%s", ntopbuf,
+ SCOPE_DELIMITER,
+ ifi->ifname);
+ else
+ l = snprintf(nsbuf, sizeof(nsbuf),
+ "%s", ntopbuf);
+ if (l < 0 || (size_t)l >= sizeof(nsbuf)) {
+ warnmsg(LOG_ERR, __func__,
+ "address copying error in "
+ "RDNSS option: %d.", l);
+ addr++;
+ continue;
+ }
+ warnmsg(LOG_DEBUG, __func__, "nsbuf = %s",
+ nsbuf);
+
+ newent_rao = 0;
+ rao = find_raopt(rai, ndo->nd_opt_type, nsbuf,
+ strlen(nsbuf));
+ if (rao == NULL) {
+ ELM_MALLOC(rao, break);
+ rao->rao_type = ndo->nd_opt_type;
+ rao->rao_len = strlen(nsbuf);
+ rao->rao_msg = strdup(nsbuf);
+ if (rao->rao_msg == NULL) {
+ warnmsg(LOG_ERR, __func__,
+ "strdup failed: %s",
+ strerror(errno));
+ free(rao);
+ addr++;
+ continue;
+ }
+ newent_rao = 1;
+ }
+ /* Set expiration timer */
+ memset(&rao->rao_expire, 0,
+ sizeof(rao->rao_expire));
+ memset(&lifetime, 0, sizeof(lifetime));
+ lifetime.tv_sec =
+ ntohl(rdnss->nd_opt_rdnss_lifetime);
+ timeradd(&now, &lifetime, &rao->rao_expire);
+
+ if (newent_rao)
+ TAILQ_INSERT_TAIL(&rai->rai_ra_opt,
+ rao, rao_next);
+ addr++;
+ }
+ break;
+ case ND_OPT_DNSSL:
+ dnssl = (struct nd_opt_dnssl *)raoptp;
+
+ /* Optlen sanity check (Section 5.3.1 in RFC 6106) */
+ if (dnssl->nd_opt_dnssl_len < 2) {
+ warnmsg(LOG_INFO, __func__,
+ "too short DNSSL option"
+ "in RA from %s was ignored.",
+ inet_ntop(AF_INET6, &from.sin6_addr,
+ ntopbuf, INET6_ADDRSTRLEN));
+ break;
+ }
+
+ /*
+ * Ensure NUL-termination in DNSSL in case of
+ * malformed field.
+ */
+ p = (char *)RA_OPT_NEXT_HDR(raoptp);
+ *(p - 1) = '\0';
+
+ p = raoptp + sizeof(*dnssl);
+ while (1 < (len = dname_labeldec(dname, sizeof(dname),
+ p))) {
+ /* length == 1 means empty string */
+ warnmsg(LOG_DEBUG, __func__, "dname = %s",
+ dname);
+
+ newent_rao = 0;
+ rao = find_raopt(rai, ndo->nd_opt_type, dname,
+ strlen(dname));
+ if (rao == NULL) {
+ ELM_MALLOC(rao, break);
+ rao->rao_type = ndo->nd_opt_type;
+ rao->rao_len = strlen(dname);
+ rao->rao_msg = strdup(dname);
+ if (rao->rao_msg == NULL) {
+ warnmsg(LOG_ERR, __func__,
+ "strdup failed: %s",
+ strerror(errno));
+ free(rao);
+ addr++;
+ continue;
+ }
+ newent_rao = 1;
+ }
+ /* Set expiration timer */
+ memset(&rao->rao_expire, 0,
+ sizeof(rao->rao_expire));
+ memset(&lifetime, 0, sizeof(lifetime));
+ lifetime.tv_sec =
+ ntohl(dnssl->nd_opt_dnssl_lifetime);
+ timeradd(&now, &lifetime, &rao->rao_expire);
+
+ if (newent_rao)
+ TAILQ_INSERT_TAIL(&rai->rai_ra_opt,
+ rao, rao_next);
+ p += len;
+ }
+ break;
+ default:
+ /* nothing to do for other options */
+ break;
+ }
+ raoptp = (char *)RA_OPT_NEXT_HDR(raoptp);
+ }
+ if (newent_rai)
+ TAILQ_INSERT_TAIL(&ifi->ifi_rainfo, rai, rai_next);
+
+ ra_opt_handler(ifi);
ifi->racnt++;
switch (ifi->state) {
@@ -371,23 +556,209 @@ rtsol_input(int s)
}
}
+static char resstr_ns_prefix[] = "nameserver ";
+static char resstr_sh_prefix[] = "search ";
+static char resstr_nl[] = "\n";
+static char resstr_sp[] = " ";
+
+int
+ra_opt_handler(struct ifinfo *ifi)
+{
+ struct ra_opt *rao;
+ struct rainfo *rai;
+ struct script_msg *smp1, *smp2, *smp3;
+ struct timeval now;
+ TAILQ_HEAD(, script_msg) sm_rdnss_head =
+ TAILQ_HEAD_INITIALIZER(sm_rdnss_head);
+ TAILQ_HEAD(, script_msg) sm_dnssl_head =
+ TAILQ_HEAD_INITIALIZER(sm_dnssl_head);
+ int dcount, dlen;
+
+ dcount = 0;
+ dlen = strlen(resstr_sh_prefix) + strlen(resstr_nl);
+ gettimeofday(&now, NULL);
+
+ /*
+ * All options from multiple RAs with the same or different
+ * source addresses on a single interface will be gathered and
+ * handled, not overridden. [RFC 4861 6.3.4]
+ */
+ TAILQ_FOREACH(rai, &ifi->ifi_rainfo, rai_next) {
+ TAILQ_FOREACH(rao, &rai->rai_ra_opt, rao_next) {
+ switch (rao->rao_type) {
+ case ND_OPT_RDNSS:
+ if (timercmp(&now, &rao->rao_expire, >)) {
+ warnmsg(LOG_INFO, __func__,
+ "expired rdnss entry: %s",
+ (char *)rao->rao_msg);
+ break;
+ }
+ ELM_MALLOC(smp1, continue);
+ ELM_MALLOC(smp2, goto free1);
+ ELM_MALLOC(smp3, goto free2);
+ smp1->sm_msg = resstr_ns_prefix;
+ TAILQ_INSERT_TAIL(&sm_rdnss_head, smp1,
+ sm_next);
+ smp2->sm_msg = rao->rao_msg;
+ TAILQ_INSERT_TAIL(&sm_rdnss_head, smp2,
+ sm_next);
+ smp3->sm_msg = resstr_nl;
+ TAILQ_INSERT_TAIL(&sm_rdnss_head, smp3,
+ sm_next);
+ ifi->ifi_rdnss = IFI_DNSOPT_STATE_RECEIVED;
+
+ break;
+ case ND_OPT_DNSSL:
+ if (timercmp(&now, &rao->rao_expire, >)) {
+ warnmsg(LOG_INFO, __func__,
+ "expired dnssl entry: %s",
+ (char *)rao->rao_msg);
+ break;
+ }
+ dcount++;
+ /* Check resolv.conf(5) restrictions. */
+ if (dcount > 6) {
+ warnmsg(LOG_INFO, __func__,
+ "dnssl entry exceeding maximum count (%d>6)"
+ ": %s", dcount, (char *)rao->rao_msg);
+ break;
+ }
+ if (256 < dlen + strlen(rao->rao_msg) +
+ strlen(resstr_sp)) {
+ warnmsg(LOG_INFO, __func__,
+ "dnssl entry exceeding maximum length "
+ "(>256): %s", (char *)rao->rao_msg);
+ break;
+ }
+ ELM_MALLOC(smp1, continue);
+ ELM_MALLOC(smp2, goto free1);
+ if (TAILQ_EMPTY(&sm_dnssl_head)) {
+ ELM_MALLOC(smp3, goto free2);
+ smp3->sm_msg = resstr_sh_prefix;
+ TAILQ_INSERT_TAIL(&sm_dnssl_head, smp3,
+ sm_next);
+ }
+ smp1->sm_msg = rao->rao_msg;
+ TAILQ_INSERT_TAIL(&sm_dnssl_head, smp1,
+ sm_next);
+ smp2->sm_msg = resstr_sp;
+ TAILQ_INSERT_TAIL(&sm_dnssl_head, smp2,
+ sm_next);
+ dlen += strlen(rao->rao_msg) +
+ strlen(resstr_sp);
+ break;
+
+ ifi->ifi_dnssl = IFI_DNSOPT_STATE_RECEIVED;
+ default:
+ break;
+ }
+ continue;
+free2:
+ free(smp2);
+free1:
+ free(smp1);
+ }
+ }
+ /* Add \n for DNSSL list. */
+ if (!TAILQ_EMPTY(&sm_dnssl_head)) {
+ ELM_MALLOC(smp1, goto ra_opt_handler_freeit);
+ smp1->sm_msg = resstr_nl;
+ TAILQ_INSERT_TAIL(&sm_dnssl_head, smp1, sm_next);
+ }
+ TAILQ_CONCAT(&sm_rdnss_head, &sm_dnssl_head, sm_next);
+
+ if (!TAILQ_EMPTY(&sm_rdnss_head))
+ CALL_SCRIPT(RESADD, &sm_rdnss_head);
+ else if (ifi->ifi_rdnss == IFI_DNSOPT_STATE_RECEIVED ||
+ ifi->ifi_dnssl == IFI_DNSOPT_STATE_RECEIVED) {
+ CALL_SCRIPT(RESDEL, NULL);
+ ifi->ifi_rdnss = IFI_DNSOPT_STATE_NOINFO;
+ ifi->ifi_dnssl = IFI_DNSOPT_STATE_NOINFO;
+ }
+
+ra_opt_handler_freeit:
+ /* Clear script message queue. */
+ if (!TAILQ_EMPTY(&sm_rdnss_head)) {
+ while ((smp1 = TAILQ_FIRST(&sm_rdnss_head)) != NULL) {
+ TAILQ_REMOVE(&sm_rdnss_head, smp1, sm_next);
+ free(smp1);
+ }
+ }
+ if (!TAILQ_EMPTY(&sm_dnssl_head)) {
+ while ((smp1 = TAILQ_FIRST(&sm_dnssl_head)) != NULL) {
+ TAILQ_REMOVE(&sm_dnssl_head, smp1, sm_next);
+ free(smp1);
+ }
+ }
+ return (0);
+}
+
+static struct ra_opt *
+find_raopt(struct rainfo *rai, int type, void *msg, size_t len)
+{
+ struct ra_opt *rao;
+
+ TAILQ_FOREACH(rao, &rai->rai_ra_opt, rao_next) {
+ if (rao->rao_type == type &&
+ rao->rao_len == strlen(msg) &&
+ memcmp(rao->rao_msg, msg, len) == 0)
+ break;
+ }
+
+ return (rao);
+}
+
static void
-call_script(char *scriptpath, char *ifname)
+call_script(const int argc, const char *const argv[], void *head)
{
+ const char *scriptpath;
+ int fd[2];
+ int error;
pid_t pid, wpid;
+ TAILQ_HEAD(, script_msg) *sm_head;
- if (scriptpath == NULL)
+ if ((scriptpath = argv[0]) == NULL)
return;
+ fd[0] = fd[1] = -1;
+ sm_head = head;
+ if (sm_head != NULL && !TAILQ_EMPTY(sm_head)) {
+ error = pipe(fd);
+ if (error) {
+ warnmsg(LOG_ERR, __func__,
+ "failed to create a pipe: %s", strerror(errno));
+ return;
+ }
+ }
+
/* launch the script */
pid = fork();
if (pid < 0) {
warnmsg(LOG_ERR, __func__,
"failed to fork: %s", strerror(errno));
return;
- } else if (pid) {
+ } else if (pid) { /* parent */
int wstatus;
+ if (fd[0] != -1) { /* Send message to the child if any. */
+ ssize_t len;
+ struct script_msg *smp;
+
+ close(fd[0]);
+ TAILQ_FOREACH(smp, sm_head, sm_next) {
+ len = strlen(smp->sm_msg);
+ warnmsg(LOG_DEBUG, __func__,
+ "write to child = %s(%zd)",
+ smp->sm_msg, len);
+ if (write(fd[1], smp->sm_msg, len) != len) {
+ warnmsg(LOG_ERR, __func__,
+ "write to child failed: %s",
+ strerror(errno));
+ break;
+ }
+ }
+ close(fd[1]);
+ }
do {
wpid = wait(&wstatus);
} while (wpid != pid && wpid > 0);
@@ -395,17 +766,12 @@ call_script(char *scriptpath, char *ifname)
if (wpid < 0)
warnmsg(LOG_ERR, __func__,
"wait: %s", strerror(errno));
- else {
+ else
warnmsg(LOG_DEBUG, __func__,
"script \"%s\" terminated", scriptpath);
- }
- } else {
- char *argv[3];
- int fd;
-
- argv[0] = scriptpath;
- argv[1] = ifname;
- argv[2] = NULL;
+ } else { /* child */
+ int nullfd;
+ char **_argv;
if (safefile(scriptpath)) {
warnmsg(LOG_ERR, __func__,
@@ -413,20 +779,42 @@ call_script(char *scriptpath, char *ifname)
scriptpath);
exit(1);
}
-
- if ((fd = open("/dev/null", O_RDWR)) != -1) {
- dup2(fd, STDIN_FILENO);
- dup2(fd, STDOUT_FILENO);
- dup2(fd, STDERR_FILENO);
- if (fd > STDERR_FILENO)
- close(fd);
+ nullfd = open("/dev/null", O_RDWR);
+ if (nullfd < 0) {
+ warnmsg(LOG_ERR, __func__,
+ "open /dev/null: %s", strerror(errno));
+ exit(1);
}
-
- execv(scriptpath, argv);
-
+ if (fd[0] != -1) { /* Receive message from STDIN if any. */
+ close(fd[1]);
+ if (fd[0] != STDIN_FILENO) {
+ /* Connect a pipe read-end to child's STDIN. */
+ if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) {
+ warnmsg(LOG_ERR, __func__,
+ "dup2 STDIN: %s", strerror(errno));
+ exit(1);
+ }
+ close(fd[0]);
+ }
+ } else
+ dup2(nullfd, STDIN_FILENO);
+
+ dup2(nullfd, STDOUT_FILENO);
+ dup2(nullfd, STDERR_FILENO);
+ if (nullfd > STDERR_FILENO)
+ close(nullfd);
+
+ _argv = malloc(sizeof(*_argv) * argc);
+ if (_argv == NULL) {
+ warnmsg(LOG_ERR, __func__,
+ "malloc: %s", strerror(errno));
+ exit(1);
+ }
+ memcpy(_argv, argv, (size_t)argc);
+ execv(scriptpath, (char *const *)_argv);
warnmsg(LOG_ERR, __func__, "child: exec failed: %s",
strerror(errno));
- exit(0);
+ exit(1);
}
return;
@@ -471,3 +859,37 @@ safefile(const char *path)
return (0);
}
+
+/* Decode domain name label encoding in RFC 1035 Section 3.1 */
+static size_t
+dname_labeldec(char *dst, size_t dlen, const char *src)
+{
+ size_t len;
+ const char *src_origin;
+ const char *src_last;
+ const char *dst_origin;
+
+ src_origin = src;
+ src_last = strchr(src, '\0');
+ dst_origin = dst;
+ memset(dst, '\0', dlen);
+ while (src && (len = (uint8_t)(*src++) & 0x3f) &&
+ (src + len) <= src_last) {
+ if (dst != dst_origin)
+ *dst++ = '.';
+ warnmsg(LOG_DEBUG, __func__, "labellen = %zd", len);
+ memcpy(dst, src, len);
+ src += len;
+ dst += len;
+ }
+ *dst = '\0';
+
+ /*
+ * XXX validate that domain name only contains valid characters
+ * for two reasons: 1) correctness, 2) we do not want to pass
+ * possible malicious, unescaped characters like `` to a script
+ * or program that could be exploited that way.
+ */
+
+ return (src - src_origin);
+}
diff --git a/usr.sbin/rtsold/rtsold.8 b/usr.sbin/rtsold/rtsold.8
index 9ce0bb0..8eb2539 100644
--- a/usr.sbin/rtsold/rtsold.8
+++ b/usr.sbin/rtsold/rtsold.8
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 2, 2009
+.Dd May 28, 2011
.Dt RTSOLD 8
.Os
.\"
@@ -41,18 +41,24 @@
.Nm
.Op Fl dDfFm1
.Op Fl O Ar script-name
+.Op Fl P Ar pidfile
+.Op Fl R Ar script-name
.Ar interface ...
.Nm
.Op Fl dDfFm1
.Op Fl O Ar script-name
+.Op Fl P Ar pidfile
+.Op Fl R Ar script-name
.Fl a
.Nm rtsol
-.Op Fl dDF
+.Op Fl dD
.Op Fl O Ar script-name
+.Op Fl R Ar script-name
.Ar interface ...
.Nm rtsol
.Op Fl dD
.Op Fl O Ar script-name
+.Op Fl R Ar script-name
.Fl a
.\"
.Sh DESCRIPTION
@@ -221,6 +227,24 @@ configuration.
must be the absolute path from root to the script file, be a regular
file, and be created by the same owner who runs
.Nm .
+.It Fl P Ar pidfile
+Writes the process ID of
+.Nm
+to
+.Pa pidfile
+instead of the default PID file
+.Pa /var/run/rtsold.pid .
+.It Fl R Ar script-name
+Specifies a script to run when router advertisment options
+.Dv RDNSS Pq Recursive DNS Server
+or
+.Dv DNSSL Pq DNS Search List
+are encountered.
+The information of DNS servers and DNS search domains will be sent to
+standard input of this script.
+The
+.Xr resolvconf 8
+script is used by default.
.El
.Sh FILES
.Bl -tag -width /var/run/rtsold.dump -compact
@@ -235,6 +259,7 @@ dumps internal state on.
.Ex -std
.\"
.Sh SEE ALSO
+.Xr resolvconf 8 ,
.Xr rtadvd 8 ,
.Xr sysctl 8
.\"
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c
index 0db050c..94046a1 100644
--- a/usr.sbin/rtsold/rtsold.c
+++ b/usr.sbin/rtsold/rtsold.c
@@ -44,6 +44,7 @@
#include <netinet/in.h>
#include <netinet/icmp6.h>
#include <netinet/in_var.h>
+#include <arpa/inet.h>
#include <netinet6/nd6.h>
@@ -63,6 +64,9 @@
#include "rtsold.h"
+#define RTSOL_DUMPFILE "/var/run/rtsold.dump";
+#define RTSOL_PIDFILE "/var/run/rtsold.pid";
+
struct ifinfo *iflist;
struct timeval tm_max = {0x7fffffff, 0x7fffffff};
static int log_upto = 999;
@@ -72,7 +76,8 @@ int Fflag = 0; /* force setting sysctl parameters */
int aflag = 0;
int dflag = 0;
-char *otherconf_script;
+const char *otherconf_script;
+const char *resolvconf_script = "/sbin/resolvconf";
/* protocol constants */
#define MAX_RTR_SOLICITATION_DELAY 1 /* second */
@@ -85,35 +90,32 @@ char *otherconf_script;
*/
#define PROBE_INTERVAL 60
-int main(int, char **);
-
/* static variables and functions */
static int mobile_node = 0;
+static const char *pidfilename = RTSOL_PIDFILE;
+
#ifndef SMALL
static int do_dump;
-static const char *dumpfilename = "/var/run/rtsold.dump"; /* XXX: should be configurable */
-#endif
-#if 1
-static const char *pidfilename = "/var/run/rtsold.pid"; /* should be configurable */
+static const char *dumpfilename = RTSOL_DUMPFILE;
#endif
#if 0
static int ifreconfig(char *);
#endif
+
static int make_packet(struct ifinfo *);
static struct timeval *rtsol_check_timer(void);
#ifndef SMALL
static void rtsold_set_dump_file(int);
#endif
-static void usage(char *);
+static void usage(void);
int
main(int argc, char **argv)
{
int s, ch, once = 0;
struct timeval *timeout;
- char *argv0;
const char *opts;
#ifdef HAVE_POLL_H
struct pollfd set[2];
@@ -123,20 +125,19 @@ main(int argc, char **argv)
int maxfd;
#endif
int rtsock;
+ char *argv0;
- /*
- * Initialization
- */
+#ifndef SMALL
+ /* rtsold */
+ opts = "adDfFm1O:P:R:";
+#else
+ /* rtsol */
+ opts = "adDFO:P:R:";
+ fflag = 1;
+ once = 1;
+#endif
argv0 = argv[0];
- /* get option */
- if (argv0 && argv0[strlen(argv0) - 1] != 'd') {
- fflag = 1;
- once = 1;
- opts = "adDFO:";
- } else
- opts = "adDfFm1O:";
-
while ((ch = getopt(argc, argv, opts)) != -1) {
switch (ch) {
case 'a':
@@ -163,17 +164,23 @@ main(int argc, char **argv)
case 'O':
otherconf_script = optarg;
break;
+ case 'P':
+ pidfilename = optarg;
+ break;
+ case 'R':
+ resolvconf_script = optarg;
+ break;
default:
- usage(argv0);
- /*NOTREACHED*/
+ usage();
+ exit(1);
}
}
argc -= optind;
argv += optind;
if ((!aflag && argc == 0) || (aflag && argc != 0)) {
- usage(argv0);
- /*NOTREACHED*/
+ usage();
+ exit(1);
}
/* set log level */
@@ -196,7 +203,14 @@ main(int argc, char **argv)
errx(1, "configuration script (%s) must be an absolute path",
otherconf_script);
}
-
+ if (resolvconf_script && *resolvconf_script != '/') {
+ errx(1, "configuration script (%s) must be an absolute path",
+ resolvconf_script);
+ }
+ if (pidfilename && *pidfilename != '/') {
+ errx(1, "pid filename (%s) must be an absolute path",
+ pidfilename);
+ }
#ifndef HAVE_ARC4RANDOM
/* random value initialization */
srandom((u_long)time(NULL));
@@ -226,7 +240,6 @@ main(int argc, char **argv)
if ((s = sockopen()) < 0) {
warnmsg(LOG_ERR, __func__, "failed to open a socket");
exit(1);
- /*NOTREACHED*/
}
#ifdef HAVE_POLL_H
set[0].fd = s;
@@ -242,7 +255,6 @@ main(int argc, char **argv)
if ((rtsock = rtsock_open()) < 0) {
warnmsg(LOG_ERR, __func__, "failed to open a socket");
exit(1);
- /*NOTREACHED*/
}
#ifdef HAVE_POLL_H
set[1].fd = rtsock;
@@ -255,12 +267,12 @@ main(int argc, char **argv)
#ifndef HAVE_POLL_H
fdmasks = howmany(maxfd + 1, NFDBITS) * sizeof(fd_mask);
if ((fdsetp = malloc(fdmasks)) == NULL) {
- err(1, "malloc");
- /*NOTREACHED*/
+ warnmsg(LOG_ERR, __func__, "malloc");
+ exit(1);
}
if ((selectfdp = malloc(fdmasks)) == NULL) {
- err(1, "malloc");
- /*NOTREACHED*/
+ warnmsg(LOG_ERR, __func__, "malloc");
+ exit(1);
}
#endif
@@ -269,7 +281,6 @@ main(int argc, char **argv)
warnmsg(LOG_ERR, __func__,
"failed to initialize interfaces");
exit(1);
- /*NOTREACHED*/
}
if (aflag)
argv = autoifprobe();
@@ -278,7 +289,6 @@ main(int argc, char **argv)
warnmsg(LOG_ERR, __func__,
"failed to initialize %s", *argv);
exit(1);
- /*NOTREACHED*/
}
argv++;
}
@@ -291,7 +301,6 @@ main(int argc, char **argv)
/*NOTREACHED*/
}
-#if 1
/* dump the current pid */
if (!once) {
pid_t pid = getpid();
@@ -306,8 +315,6 @@ main(int argc, char **argv)
fclose(fp);
}
}
-#endif
-
#ifndef HAVE_POLL_H
memset(fdsetp, 0, fdmasks);
FD_SET(s, fdsetp);
@@ -337,7 +344,7 @@ main(int argc, char **argv)
break;
/* if all interfaces have got RA packet, we are done */
- for (ifi = iflist; ifi; ifi = ifi->next) {
+ TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) {
if (ifi->state != IFS_DOWN && ifi->racnt == 0)
break;
}
@@ -373,102 +380,99 @@ main(int argc, char **argv)
}
/* NOTREACHED */
- return 0;
+ return (0);
}
int
ifconfig(char *ifname)
{
- struct ifinfo *ifinfo;
+ struct ifinfo *ifi;
struct sockaddr_dl *sdl;
int flags;
if ((sdl = if_nametosdl(ifname)) == NULL) {
warnmsg(LOG_ERR, __func__,
"failed to get link layer information for %s", ifname);
- return(-1);
+ return (-1);
}
if (find_ifinfo(sdl->sdl_index)) {
warnmsg(LOG_ERR, __func__,
"interface %s was already configured", ifname);
free(sdl);
- return(-1);
+ return (-1);
}
- if ((ifinfo = malloc(sizeof(*ifinfo))) == NULL) {
+ if ((ifi = malloc(sizeof(*ifi))) == NULL) {
warnmsg(LOG_ERR, __func__, "memory allocation failed");
free(sdl);
- return(-1);
+ return (-1);
}
- memset(ifinfo, 0, sizeof(*ifinfo));
- ifinfo->sdl = sdl;
-
- strlcpy(ifinfo->ifname, ifname, sizeof(ifinfo->ifname));
+ memset(ifi, 0, sizeof(*ifi));
+ ifi->sdl = sdl;
+ ifi->ifi_rdnss = IFI_DNSOPT_STATE_NOINFO;
+ ifi->ifi_dnssl = IFI_DNSOPT_STATE_NOINFO;
+ TAILQ_INIT(&ifi->ifi_rainfo);
+ strlcpy(ifi->ifname, ifname, sizeof(ifi->ifname));
/* construct a router solicitation message */
- if (make_packet(ifinfo))
+ if (make_packet(ifi))
goto bad;
/* set link ID of this interface. */
#ifdef HAVE_SCOPELIB
- if (inet_zoneid(AF_INET6, 2, ifname, &ifinfo->linkid))
+ if (inet_zoneid(AF_INET6, 2, ifname, &ifi->linkid))
goto bad;
#else
/* XXX: assume interface IDs as link IDs */
- ifinfo->linkid = ifinfo->sdl->sdl_index;
+ ifi->linkid = ifi->sdl->sdl_index;
#endif
/*
* check if the interface is available.
* also check if SIOCGIFMEDIA ioctl is OK on the interface.
*/
- ifinfo->mediareqok = 1;
- ifinfo->active = interface_status(ifinfo);
- if (!ifinfo->mediareqok) {
+ ifi->mediareqok = 1;
+ ifi->active = interface_status(ifi);
+ if (!ifi->mediareqok) {
/*
* probe routers periodically even if the link status
* does not change.
*/
- ifinfo->probeinterval = PROBE_INTERVAL;
+ ifi->probeinterval = PROBE_INTERVAL;
}
/* activate interface: interface_up returns 0 on success */
- flags = interface_up(ifinfo->ifname);
+ flags = interface_up(ifi->ifname);
if (flags == 0)
- ifinfo->state = IFS_DELAY;
+ ifi->state = IFS_DELAY;
else if (flags == IFS_TENTATIVE)
- ifinfo->state = IFS_TENTATIVE;
+ ifi->state = IFS_TENTATIVE;
else
- ifinfo->state = IFS_DOWN;
-
- rtsol_timer_update(ifinfo);
+ ifi->state = IFS_DOWN;
- /* link into chain */
- if (iflist)
- ifinfo->next = iflist;
- iflist = ifinfo;
+ rtsol_timer_update(ifi);
- return(0);
+ TAILQ_INSERT_TAIL(&ifinfo_head, ifi, ifi_next);
+ return (0);
bad:
- free(ifinfo->sdl);
- free(ifinfo);
- return(-1);
+ free(ifi->sdl);
+ free(ifi);
+ return (-1);
}
void
iflist_init(void)
{
- struct ifinfo *ifi, *next;
+ struct ifinfo *ifi;
- for (ifi = iflist; ifi; ifi = next) {
- next = ifi->next;
- if (ifi->sdl)
+ while ((ifi = TAILQ_FIRST(&ifinfo_head)) != NULL) {
+ TAILQ_REMOVE(&ifinfo_head, ifi, ifi_next);
+ if (ifi->sdl != NULL)
free(ifi->sdl);
- if (ifi->rs_data)
+ if (ifi->rs_data != NULL)
free(ifi->rs_data);
free(ifi);
- iflist = NULL;
}
}
@@ -480,7 +484,7 @@ ifreconfig(char *ifname)
int rv;
prev = NULL;
- for (ifi = iflist; ifi; ifi = ifi->next) {
+ TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) {
if (strncmp(ifi->ifname, ifname, sizeof(ifi->ifname)) == 0)
break;
prev = ifi;
@@ -494,43 +498,58 @@ ifreconfig(char *ifname)
free(ifi->rs_data);
free(ifi->sdl);
free(ifi);
- return rv;
+
+ return (rv);
}
#endif
+struct rainfo *
+find_rainfo(struct ifinfo *ifi, struct sockaddr_in6 *sin6)
+{
+ struct rainfo *rai;
+
+ TAILQ_FOREACH(rai, &ifi->ifi_rainfo, rai_next)
+ if (memcmp(&rai->rai_saddr.sin6_addr, &sin6->sin6_addr,
+ sizeof(rai->rai_saddr.sin6_addr)) == 0)
+ return (rai);
+
+ return (NULL);
+}
+
struct ifinfo *
find_ifinfo(int ifindex)
{
struct ifinfo *ifi;
- for (ifi = iflist; ifi; ifi = ifi->next)
+ TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) {
if (ifi->sdl->sdl_index == ifindex)
- return(ifi);
- return(NULL);
+ return (ifi);
+ }
+ return (NULL);
}
static int
-make_packet(struct ifinfo *ifinfo)
+make_packet(struct ifinfo *ifi)
{
size_t packlen = sizeof(struct nd_router_solicit), lladdroptlen = 0;
struct nd_router_solicit *rs;
char *buf;
- if ((lladdroptlen = lladdropt_length(ifinfo->sdl)) == 0) {
+ if ((lladdroptlen = lladdropt_length(ifi->sdl)) == 0) {
warnmsg(LOG_INFO, __func__,
"link-layer address option has null length"
- " on %s. Treat as not included.", ifinfo->ifname);
+ " on %s. Treat as not included.", ifi->ifname);
}
packlen += lladdroptlen;
- ifinfo->rs_datalen = packlen;
+ ifi->rs_datalen = packlen;
/* allocate buffer */
if ((buf = malloc(packlen)) == NULL) {
warnmsg(LOG_ERR, __func__,
- "memory allocation failed for %s", ifinfo->ifname);
- return(-1);
+ "memory allocation failed for %s", ifi->ifname);
+ return (-1);
}
- ifinfo->rs_data = buf;
+ ifi->rs_data = buf;
/* fill in the message */
rs = (struct nd_router_solicit *)buf;
@@ -542,9 +561,9 @@ make_packet(struct ifinfo *ifinfo)
/* fill in source link-layer address option */
if (lladdroptlen)
- lladdropt_fill(ifinfo->sdl, (struct nd_opt_hdr *)buf);
+ lladdropt_fill(ifi->sdl, (struct nd_opt_hdr *)buf);
- return(0);
+ return (0);
}
static struct timeval *
@@ -552,56 +571,68 @@ rtsol_check_timer(void)
{
static struct timeval returnval;
struct timeval now, rtsol_timer;
- struct ifinfo *ifinfo;
+ struct ifinfo *ifi;
+ struct rainfo *rai;
+ struct ra_opt *rao;
int flags;
gettimeofday(&now, NULL);
rtsol_timer = tm_max;
- for (ifinfo = iflist; ifinfo; ifinfo = ifinfo->next) {
- if (timercmp(&ifinfo->expire, &now, <=)) {
- if (dflag > 1)
- warnmsg(LOG_DEBUG, __func__,
- "timer expiration on %s, "
- "state = %d", ifinfo->ifname,
- ifinfo->state);
-
- switch (ifinfo->state) {
+ TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) {
+ if (timercmp(&ifi->expire, &now, <=)) {
+ warnmsg(LOG_DEBUG, __func__, "timer expiration on %s, "
+ "state = %d", ifi->ifname, ifi->state);
+
+ while((rai = TAILQ_FIRST(&ifi->ifi_rainfo)) != NULL) {
+ /* Remove all RA options. */
+ TAILQ_REMOVE(&ifi->ifi_rainfo, rai, rai_next);
+ while ((rao = TAILQ_FIRST(&rai->rai_ra_opt)) !=
+ NULL) {
+ TAILQ_REMOVE(&rai->rai_ra_opt, rao,
+ rao_next);
+ if (rao->rao_msg != NULL)
+ free(rao->rao_msg);
+ free(rao);
+ }
+ free(rai);
+ }
+ switch (ifi->state) {
case IFS_DOWN:
case IFS_TENTATIVE:
/* interface_up returns 0 on success */
- flags = interface_up(ifinfo->ifname);
+ flags = interface_up(ifi->ifname);
if (flags == 0)
- ifinfo->state = IFS_DELAY;
+ ifi->state = IFS_DELAY;
else if (flags == IFS_TENTATIVE)
- ifinfo->state = IFS_TENTATIVE;
+ ifi->state = IFS_TENTATIVE;
else
- ifinfo->state = IFS_DOWN;
+ ifi->state = IFS_DOWN;
break;
case IFS_IDLE:
{
- int oldstatus = ifinfo->active;
+ int oldstatus = ifi->active;
int probe = 0;
- ifinfo->active = interface_status(ifinfo);
+ ifi->active = interface_status(ifi);
- if (oldstatus != ifinfo->active) {
+ if (oldstatus != ifi->active) {
warnmsg(LOG_DEBUG, __func__,
"%s status is changed"
" from %d to %d",
- ifinfo->ifname,
- oldstatus, ifinfo->active);
+ ifi->ifname,
+ oldstatus, ifi->active);
probe = 1;
- ifinfo->state = IFS_DELAY;
- } else if (ifinfo->probeinterval &&
- (ifinfo->probetimer -=
- ifinfo->timer.tv_sec) <= 0) {
+ ifi->state = IFS_DELAY;
+ } else if (ifi->probeinterval &&
+ (ifi->probetimer -=
+ ifi->timer.tv_sec) <= 0) {
/* probe timer expired */
- ifinfo->probetimer =
- ifinfo->probeinterval;
+ ifi->probetimer =
+ ifi->probeinterval;
probe = 1;
- ifinfo->state = IFS_PROBE;
+ ifi->state = IFS_PROBE;
}
/*
@@ -609,77 +640,104 @@ rtsol_check_timer(void)
* status wrt the "other" configuration.
*/
if (probe)
- ifinfo->otherconfig = 0;
+ ifi->otherconfig = 0;
if (probe && mobile_node)
- defrouter_probe(ifinfo);
+ defrouter_probe(ifi);
break;
}
case IFS_DELAY:
- ifinfo->state = IFS_PROBE;
- sendpacket(ifinfo);
+ ifi->state = IFS_PROBE;
+ sendpacket(ifi);
break;
case IFS_PROBE:
- if (ifinfo->probes < MAX_RTR_SOLICITATIONS)
- sendpacket(ifinfo);
+ if (ifi->probes < MAX_RTR_SOLICITATIONS)
+ sendpacket(ifi);
else {
warnmsg(LOG_INFO, __func__,
"No answer after sending %d RSs",
- ifinfo->probes);
- ifinfo->probes = 0;
- ifinfo->state = IFS_IDLE;
+ ifi->probes);
+ ifi->probes = 0;
+ ifi->state = IFS_IDLE;
}
break;
}
- rtsol_timer_update(ifinfo);
- }
+ rtsol_timer_update(ifi);
+ } else {
+ /* Expiration check for RA options. */
+ int expire = 0;
- if (timercmp(&ifinfo->expire, &rtsol_timer, <))
- rtsol_timer = ifinfo->expire;
+ TAILQ_FOREACH(rai, &ifi->ifi_rainfo, rai_next) {
+ TAILQ_FOREACH(rao, &rai->rai_ra_opt, rao_next) {
+ warnmsg(LOG_DEBUG, __func__,
+ "RA expiration timer: "
+ "type=%d, msg=%s, expire=%s",
+ rao->rao_type, (char *)rao->rao_msg,
+ sec2str(&rao->rao_expire));
+ if (timercmp(&now, &rao->rao_expire,
+ >=)) {
+ warnmsg(LOG_DEBUG, __func__,
+ "RA expiration timer: "
+ "expired.");
+ TAILQ_REMOVE(&rai->rai_ra_opt,
+ rao, rao_next);
+ if (rao->rao_msg != NULL)
+ free(rao->rao_msg);
+ free(rao);
+ expire = 1;
+ }
+ }
+ }
+ if (expire)
+ ra_opt_handler(ifi);
+ }
+ if (timercmp(&ifi->expire, &rtsol_timer, <))
+ rtsol_timer = ifi->expire;
}
if (timercmp(&rtsol_timer, &tm_max, ==)) {
warnmsg(LOG_DEBUG, __func__, "there is no timer");
- return(NULL);
+ return (NULL);
} else if (timercmp(&rtsol_timer, &now, <))
/* this may occur when the interval is too small */
returnval.tv_sec = returnval.tv_usec = 0;
else
timersub(&rtsol_timer, &now, &returnval);
- if (dflag > 1)
- warnmsg(LOG_DEBUG, __func__, "New timer is %ld:%08ld",
- (long)returnval.tv_sec, (long)returnval.tv_usec);
+ now.tv_sec += returnval.tv_sec;
+ now.tv_usec += returnval.tv_usec;
+ warnmsg(LOG_DEBUG, __func__, "New timer is %s",
+ sec2str(&now));
- return(&returnval);
+ return (&returnval);
}
void
-rtsol_timer_update(struct ifinfo *ifinfo)
+rtsol_timer_update(struct ifinfo *ifi)
{
#define MILLION 1000000
#define DADRETRY 10 /* XXX: adhoc */
long interval;
struct timeval now;
- bzero(&ifinfo->timer, sizeof(ifinfo->timer));
+ bzero(&ifi->timer, sizeof(ifi->timer));
- switch (ifinfo->state) {
+ switch (ifi->state) {
case IFS_DOWN:
case IFS_TENTATIVE:
- if (++ifinfo->dadcount > DADRETRY) {
- ifinfo->dadcount = 0;
- ifinfo->timer.tv_sec = PROBE_INTERVAL;
+ if (++ifi->dadcount > DADRETRY) {
+ ifi->dadcount = 0;
+ ifi->timer.tv_sec = PROBE_INTERVAL;
} else
- ifinfo->timer.tv_sec = 1;
+ ifi->timer.tv_sec = 1;
break;
case IFS_IDLE:
if (mobile_node) {
/* XXX should be configurable */
- ifinfo->timer.tv_sec = 3;
+ ifi->timer.tv_sec = 3;
}
else
- ifinfo->timer = tm_max; /* stop timer(valid?) */
+ ifi->timer = tm_max; /* stop timer(valid?) */
break;
case IFS_DELAY:
#ifndef HAVE_ARC4RANDOM
@@ -687,12 +745,12 @@ rtsol_timer_update(struct ifinfo *ifinfo)
#else
interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION);
#endif
- ifinfo->timer.tv_sec = interval / MILLION;
- ifinfo->timer.tv_usec = interval % MILLION;
+ ifi->timer.tv_sec = interval / MILLION;
+ ifi->timer.tv_usec = interval % MILLION;
break;
case IFS_PROBE:
- if (ifinfo->probes < MAX_RTR_SOLICITATIONS)
- ifinfo->timer.tv_sec = RTR_SOLICITATION_INTERVAL;
+ if (ifi->probes < MAX_RTR_SOLICITATIONS)
+ ifi->timer.tv_sec = RTR_SOLICITATION_INTERVAL;
else {
/*
* After sending MAX_RTR_SOLICITATIONS solicitations,
@@ -701,30 +759,29 @@ rtsol_timer_update(struct ifinfo *ifinfo)
* the timer value to MAX_RTR_SOLICITATION_DELAY based
* on RFC 2461, Section 6.3.7.
*/
- ifinfo->timer.tv_sec = MAX_RTR_SOLICITATION_DELAY;
+ ifi->timer.tv_sec = MAX_RTR_SOLICITATION_DELAY;
}
break;
default:
warnmsg(LOG_ERR, __func__,
"illegal interface state(%d) on %s",
- ifinfo->state, ifinfo->ifname);
+ ifi->state, ifi->ifname);
return;
}
/* reset the timer */
- if (timercmp(&ifinfo->timer, &tm_max, ==)) {
- ifinfo->expire = tm_max;
+ if (timercmp(&ifi->timer, &tm_max, ==)) {
+ ifi->expire = tm_max;
warnmsg(LOG_DEBUG, __func__,
- "stop timer for %s", ifinfo->ifname);
+ "stop timer for %s", ifi->ifname);
} else {
gettimeofday(&now, NULL);
- timeradd(&now, &ifinfo->timer, &ifinfo->expire);
+ timeradd(&now, &ifi->timer, &ifi->expire);
- if (dflag > 1)
- warnmsg(LOG_DEBUG, __func__,
- "set timer for %s to %d:%d", ifinfo->ifname,
- (int)ifinfo->timer.tv_sec,
- (int)ifinfo->timer.tv_usec);
+ now.tv_sec += ifi->timer.tv_sec;
+ now.tv_usec += ifi->timer.tv_usec;
+ warnmsg(LOG_DEBUG, __func__, "set timer for %s to %s",
+ ifi->ifname, sec2str(&now));
}
#undef MILLION
@@ -742,28 +799,23 @@ rtsold_set_dump_file(int sig __unused)
#endif
static void
-usage(char *progname)
+usage(void)
{
- if (progname && progname[strlen(progname) - 1] != 'd') {
- fprintf(stderr, "usage: rtsol [-dDF] interfaces...\n");
- fprintf(stderr, "usage: rtsol [-dDF] -a\n");
- } else {
- fprintf(stderr, "usage: rtsold [-adDfFm1] interfaces...\n");
- fprintf(stderr, "usage: rtsold [-dDfFm1] -a\n");
- }
- exit(1);
+#ifndef SMALL
+ fprintf(stderr, "usage: rtsold [-adDfFm1] [-O script-name] "
+ "[-P pidfile] [-R script-name] interfaces...\n");
+ fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] "
+ "[-P pidfile] [-R script-name] -a\n");
+#else
+ fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] "
+ "[-P pidfile] [-R script-name] interfaces...\n");
+ fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] "
+ "[-P pidfile] [-R script-name] -a\n");
+#endif
}
void
-#if __STDC__
warnmsg(int priority, const char *func, const char *msg, ...)
-#else
-warnmsg(priority, func, msg, va_alist)
- int priority;
- const char *func;
- const char *msg;
- va_dcl
-#endif
{
va_list ap;
char buf[BUFSIZ];
@@ -805,11 +857,11 @@ autoifprobe(void)
n = 0;
if (getifaddrs(&ifap) != 0)
- return NULL;
+ return (NULL);
if (!Fflag && (s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
- err(1, "socket");
- /* NOTREACHED */
+ warnmsg(LOG_ERR, __func__, "socket");
+ exit(1);
}
target = NULL;
@@ -845,8 +897,9 @@ autoifprobe(void)
memset(&nd, 0, sizeof(nd));
strlcpy(nd.ifname, ifa->ifa_name, sizeof(nd.ifname));
if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) {
- err(1, "ioctl(SIOCGIFINFO_IN6)");
- /* NOTREACHED */
+ warnmsg(LOG_ERR, __func__,
+ "ioctl(SIOCGIFINFO_IN6)");
+ exit(1);
}
if ((nd.ndi.flags & ND6_IFF_IFDISABLED))
continue;
@@ -856,32 +909,40 @@ autoifprobe(void)
/* if we find multiple candidates, just warn. */
if (n != 0 && dflag > 1)
- warnx("multiple interfaces found");
+ warnmsg(LOG_WARNING, __func__,
+ "multiple interfaces found");
a = (char **)realloc(argv, (n + 1) * sizeof(char **));
- if (a == NULL)
- err(1, "realloc");
+ if (a == NULL) {
+ warnmsg(LOG_ERR, __func__, "realloc");
+ exit(1);
+ }
argv = a;
argv[n] = strdup(ifa->ifa_name);
- if (!argv[n])
- err(1, "malloc");
+ if (!argv[n]) {
+ warnmsg(LOG_ERR, __func__, "malloc");
+ exit(1);
+ }
n++;
}
if (n) {
a = (char **)realloc(argv, (n + 1) * sizeof(char **));
- if (a == NULL)
- err(1, "realloc");
+ if (a == NULL) {
+ warnmsg(LOG_ERR, __func__, "realloc");
+ exit(1);
+ }
argv = a;
argv[n] = NULL;
if (dflag > 0) {
for (i = 0; i < n; i++)
- warnx("probing %s", argv[i]);
+ warnmsg(LOG_WARNING, __func__, "probing %s",
+ argv[i]);
}
}
if (!Fflag)
close(s);
freeifaddrs(ifap);
- return argv;
+ return (argv);
}
diff --git a/usr.sbin/rtsold/rtsold.h b/usr.sbin/rtsold/rtsold.h
index 8aef490..0aa9b4f 100644
--- a/usr.sbin/rtsold/rtsold.h
+++ b/usr.sbin/rtsold/rtsold.h
@@ -31,8 +31,33 @@
* $FreeBSD$
*/
+struct script_msg {
+ TAILQ_ENTRY(script_msg) sm_next;
+
+ char *sm_msg;
+};
+
+struct ra_opt {
+ TAILQ_ENTRY(ra_opt) rao_next;
+
+ u_int8_t rao_type;
+ struct timeval rao_expire;
+ size_t rao_len;
+ void *rao_msg;
+};
+
+TAILQ_HEAD(rainfo_head, ra_opt);
+
+struct rainfo {
+ TAILQ_ENTRY(rainfo) rai_next;
+
+ struct ifinfo *rai_ifinfo;
+ struct sockaddr_in6 rai_saddr;
+ TAILQ_HEAD(, ra_opt) rai_ra_opt;
+};
+
struct ifinfo {
- struct ifinfo *next; /* pointer to the next interface */
+ TAILQ_ENTRY(ifinfo) ifi_next; /* pointer to the next interface */
struct sockaddr_dl *sdl; /* link-layer address */
char ifname[IF_NAMESIZE]; /* interface name */
@@ -49,8 +74,13 @@ struct ifinfo {
struct timeval timer;
struct timeval expire;
int errors; /* # of errors we've got - detect wedge */
+#define IFI_DNSOPT_STATE_NOINFO 0
+#define IFI_DNSOPT_STATE_RECEIVED 1
+ int ifi_rdnss; /* RDNSS option state */
+ int ifi_dnssl; /* DNSSL option state */
int racnt; /* total # of valid RAs it have got */
+ TAILQ_HEAD(, rainfo) ifi_rainfo;
size_t rs_datalen;
u_char *rs_data;
@@ -63,19 +93,50 @@ struct ifinfo {
#define IFS_DOWN 3
#define IFS_TENTATIVE 4
+/* Interface list */
+extern TAILQ_HEAD(ifinfo_head_t, ifinfo) ifinfo_head;
+
+/*
+ * RFC 3542 API deprecates IPV6_PKTINFO in favor of
+ * IPV6_RECVPKTINFO
+ */
+#ifndef IPV6_RECVPKTINFO
+#ifdef IPV6_PKTINFO
+#define IPV6_RECVPKTINFO IPV6_PKTINFO
+#endif
+#endif
+/*
+ * RFC 3542 API deprecates IPV6_HOPLIMIT in favor of
+ * IPV6_RECVHOPLIMIT
+ */
+#ifndef IPV6_RECVHOPLIMIT
+#ifdef IPV6_HOPLIMIT
+#define IPV6_RECVHOPLIMIT IPV6_HOPLIMIT
+#endif
+#endif
+
+#ifndef IN6ADDR_LINKLOCAL_ALLROUTERS_INIT
+#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
+ {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
+#endif
+
/* rtsold.c */
extern struct timeval tm_max;
extern int dflag;
extern int aflag;
extern int Fflag;
-extern char *otherconf_script;
+extern const char *otherconf_script;
+extern const char *resolvconf_script;
extern int ifconfig(char *);
extern void iflist_init(void);
struct ifinfo *find_ifinfo(int);
+struct rainfo *find_rainfo(struct ifinfo *, struct sockaddr_in6 *);
void rtsol_timer_update(struct ifinfo *);
extern void warnmsg(int, const char *, const char *, ...)
__attribute__((__format__(__printf__, 3, 4)));
extern char **autoifprobe(void);
+extern int ra_opt_handler(struct ifinfo *);
/* if.c */
extern int ifinit(void);
@@ -98,6 +159,7 @@ extern void defrouter_probe(struct ifinfo *);
/* dump.c */
extern void rtsold_dump_file(const char *);
+extern const char *sec2str(const struct timeval *);
/* rtsock.c */
extern int rtsock_open(void);
diff --git a/usr.sbin/tcpdrop/tcpdrop.c b/usr.sbin/tcpdrop/tcpdrop.c
index 6aae85c..dce6c6d 100644
--- a/usr.sbin/tcpdrop/tcpdrop.c
+++ b/usr.sbin/tcpdrop/tcpdrop.c
@@ -20,12 +20,13 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
-#include <netinet/in.h>
+#include <netinet/in.h>
#include <netinet/in_pcb.h>
#define TCPSTATES
#include <netinet/tcp_fsm.h>
diff --git a/usr.sbin/usbdump/usbdump.8 b/usr.sbin/usbdump/usbdump.8
index f2b00e4..104c3b3 100644
--- a/usr.sbin/usbdump/usbdump.8
+++ b/usr.sbin/usbdump/usbdump.8
@@ -25,8 +25,8 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 4, 2010
-.Dt usbdump 8
+.Dd May 31, 2011
+.Dt USBDUMP 8
.Os
.Sh NAME
.Nm usbdump
@@ -63,16 +63,16 @@ Write the raw packets to
.Ar file .
.El
.Sh EXAMPLES
-Captures USB raw packets on usbus2:
+Capture the USB raw packets on usbus2:
.Pp
.Dl "usbdump -i usbus2 -s 256 -v"
.Pp
-Dumps the USB raw packets of usbus2 into the file without packet
+Dump the USB raw packets of usbus2 into the file without packet
size limit:
.Pp
.Dl "usbdump -i usbus2 -s 0 -w /tmp/dump_pkts"
.Pp
-Read the USB raw packets from previous file:
+Read and display the USB raw packets from previous file:
.Pp
.Dl "usbdump -r /tmp/dump_pkts -v"
.Sh OUTPUT FORMAT
diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c
index ec39d1b..057174b 100644
--- a/usr.sbin/ypserv/yp_main.c
+++ b/usr.sbin/ypserv/yp_main.c
@@ -216,7 +216,7 @@ reaper(int sig)
static void
usage(void)
{
- fprintf(stderr, "usage: ypserv [-h] [-d] [-n] [-p path] [-P port]\n");
+ fprintf(stderr, "usage: ypserv [-h addr] [-d] [-n] [-p path] [-P port]\n");
exit(1);
}
OpenPOWER on IntegriCloud